UNPKG

svix-react

Version:

React components for using Svix in your dashboard.

1,494 lines (1,489 loc) 60.7 kB
import * as ae from "react"; import vt, { useRef as ht, useEffect as Ge, useImperativeHandle as yt, useCallback as U, useMemo as Fe, useContext as bt, useState as ge } from "react"; import { Svix as wt } from "svix"; function Ze(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; } var ft = { exports: {} }; (function(e) { console.info(` IFRAME-RESIZER Iframe-Resizer 5 is now available via the following two packages: * @iframe-resizer/parent * @iframe-resizer/child Additionally their are also new versions of iframe-resizer for React, Vue, and jQuery. Version 5 of iframe-resizer has been extensively rewritten to use modern browser APIs, which has enabled significantly better performance and greater accuracy in the detection of content resizing events. Please see https://iframe-resizer.com/upgrade for more details. `), function(i) { if (typeof window > "u") return; var r = 0, o, s = !1, u = !1, l = "message", a = l.length, h = "[iFrameSizer]", y = h.length, f = null, b = window.requestAnimationFrame, S = Object.freeze({ max: 1, scroll: 1, bodyScroll: 1, documentElementScroll: 1 }), t = {}, L = null, N = Object.freeze({ autoResize: !0, bodyBackground: null, bodyMargin: null, bodyMarginV1: 8, bodyPadding: null, checkOrigin: !0, inPageLinks: !1, enablePublicMethods: !0, heightCalculationMethod: "bodyOffset", id: "iFrameResizer", interval: 32, license: "1jqr0si6pnt", log: !1, maxHeight: 1 / 0, maxWidth: 1 / 0, minHeight: 0, minWidth: 0, mouseEvents: !0, resizeFrom: "parent", scrolling: !1, sizeHeight: !0, sizeWidth: !1, warningTimeout: 5e3, tolerance: 0, widthCalculationMethod: "scroll", onClose: function() { return !0; }, onClosed: function() { }, onInit: function() { }, onMessage: function() { ee("onMessage function not defined"); }, onMouseEnter: function() { }, onMouseLeave: function() { }, onResized: function() { }, onScroll: function() { return !0; } }); function C() { return window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; } function J(n, p, A) { n.addEventListener(p, A, !1); } function ye(n, p, A) { n.removeEventListener(p, A, !1); } function Q() { var n = ["moz", "webkit", "o", "ms"], p; for (p = 0; p < n.length && !b; p += 1) b = window[n[p] + "RequestAnimationFrame"]; b ? b = b.bind(window) : F("setup", "RequestAnimationFrame not supported"); } function X(n) { var p = "Host page: " + n; return window.top !== window.self && (p = window.parentIFrame && window.parentIFrame.getId ? window.parentIFrame.getId() + ": " + n : "Nested host page: " + n), p; } function d(n) { return h + "[" + X(n) + "]"; } function ue(n) { return t[n] ? t[n].log : s; } function F(n, p) { be("log", n, p, ue(n)); } function Me(n, p) { be("info", n, p, ue(n)); } function ee(n, p) { be("warn", n, p, !0); } function be(n, p, A, E) { E === !0 && typeof window.console == "object" && console[n](d(p), A); } function _e(n) { function p() { function m() { c(H), ve(R), Oe("onResized", H); } z("Height"), z("Width"), g(m, H, "init"); } function A() { var m = ce.slice(y).split(":"), O = m[1] ? parseInt(m[1], 10) : 0, B = t[m[0]] && t[m[0]].iframe, V = getComputedStyle(B); return { iframe: B, id: m[0], height: O + E(V) + W(V), width: m[2], type: m[3] }; } function E(m) { if (m.boxSizing !== "border-box") return 0; var O = m.paddingTop ? parseInt(m.paddingTop, 10) : 0, B = m.paddingBottom ? parseInt(m.paddingBottom, 10) : 0; return O + B; } function W(m) { if (m.boxSizing !== "border-box") return 0; var O = m.borderTopWidth ? parseInt(m.borderTopWidth, 10) : 0, B = m.borderBottomWidth ? parseInt(m.borderBottomWidth, 10) : 0; return O + B; } function z(m) { var O = Number(t[R]["max" + m]), B = Number(t[R]["min" + m]), V = m.toLowerCase(), Z = Number(H[V]); F(R, "Checking " + V + " is in range " + B + "-" + O), Z < B && (Z = B, F(R, "Set " + V + " to min value")), Z > O && (Z = O, F(R, "Set " + V + " to max value")), H[V] = "" + Z; } function fe() { function m() { function V() { var te = 0, me = !1; for (F( R, "Checking connection is from allowed list of origins: " + B ); te < B.length; te++) if (B[te] === O) { me = !0; break; } return me; } function Z() { var te = t[R] && t[R].remoteHost; return F(R, "Checking connection is from: " + te), O === te; } return B.constructor === Array ? V() : Z(); } var O = n.origin, B = t[R] && t[R].checkOrigin; if (B && "" + O != "null" && !m()) throw new Error( "Unexpected message received from: " + O + " for " + H.iframe.id + ". Message was: " + n.data + ". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains." ); return !0; } function xe() { return h === ("" + ce).slice(0, y) && ce.slice(y).split(":")[0] in t; } function de() { var m = H.type in { true: 1, false: 1, undefined: 1 }; return m && F(R, "Ignoring init message from meta parent page"), m; } function pe(m) { return ce.slice(ce.indexOf(":") + a + m); } function he(m) { F( R, "onMessage passed: {iframe: " + H.iframe.id + ", message: " + m + "}" ), Oe("onMessage", { iframe: H.iframe, message: JSON.parse(m) }), F(R, "--"); } function Le() { var m = document.body.getBoundingClientRect(), O = H.iframe.getBoundingClientRect(); return JSON.stringify({ iframeHeight: O.height, iframeWidth: O.width, clientHeight: Math.max( document.documentElement.clientHeight, window.innerHeight || 0 ), clientWidth: Math.max( document.documentElement.clientWidth, window.innerWidth || 0 ), offsetTop: parseInt(O.top - m.top, 10), offsetLeft: parseInt(O.left - m.left, 10), scrollTop: window.pageYOffset, scrollLeft: window.pageXOffset, documentHeight: document.documentElement.clientHeight, documentWidth: document.documentElement.clientWidth, windowHeight: window.innerHeight, windowWidth: window.innerWidth }); } function Ae(m, O) { function B() { x("Send Page Info", "pageInfo:" + Le(), m, O); } k(B, 32, O); } function Ne() { function m(Z, te) { function me() { t[V] ? Ae(t[V].iframe, V) : O(); } ["scroll", "resize"].forEach(function(et) { F(V, Z + et + " listener for sendPageInfo"), te(window, et, me); }); } function O() { m("Remove ", ye); } function B() { m("Add ", J); } var V = R; B(), t[V] && (t[V].stopPageInfo = O); } function He() { t[R] && t[R].stopPageInfo && (t[R].stopPageInfo(), delete t[R].stopPageInfo); } function De() { var m = !0; return H.iframe === null && (ee(R, "IFrame (" + H.id + ") not found"), m = !1), m; } function w(m) { var O = m.getBoundingClientRect(); return ie(R), { x: Math.floor(Number(O.left) + Number(f.x)), y: Math.floor(Number(O.top) + Number(f.y)) }; } function T(m) { function O() { f = te, G(), F(R, "--"); } function B() { return { x: Number(H.width) + Z.x, y: Number(H.height) + Z.y }; } function V() { window.parentIFrame ? window.parentIFrame["scrollTo" + (m ? "Offset" : "")]( te.x, te.y ) : ee( R, "Unable to scroll to requested position, window.parentIFrame not found" ); } var Z = m ? w(H.iframe) : { x: 0, y: 0 }, te = B(); F( R, "Reposition requested from iFrame (offset x:" + Z.x + " y:" + Z.y + ")" ), window.top === window.self ? O() : V(); } function G() { Oe("onScroll", f) === !1 ? Se() : ve(R); } function K(m) { function O() { var me = w(te); F( R, "Moving to in page link (#" + V + ") at x: " + me.x + " y: " + me.y ), f = { x: me.x, y: me.y }, G(), F(R, "--"); } function B() { window.parentIFrame ? window.parentIFrame.moveToAnchor(V) : F( R, "In page link #" + V + " not found and window.parentIFrame not found" ); } var V = m.split("#")[1] || "", Z = decodeURIComponent(V), te = document.getElementById(Z) || document.getElementsByName(Z)[0]; te ? O() : window.top === window.self ? F(R, "In page link #" + V + " not found") : B(); } function se(m) { var O = {}; if (Number(H.width) === 0 && Number(H.height) === 0) { var B = pe(9).split(":"); O = { x: B[1], y: B[0] }; } else O = { x: H.width, y: H.height }; Oe(m, { iframe: H.iframe, screenX: Number(O.x), screenY: Number(O.y), type: H.type }); } function Oe(m, O) { return we(R, m, O); } function ze() { switch (t[R] && t[R].firstRun && Ye(), H.type) { case "close": { Ee(H.iframe); break; } case "message": { he(pe(6)); break; } case "mouseenter": { se("onMouseEnter"); break; } case "mouseleave": { se("onMouseLeave"); break; } case "autoResize": { t[R].autoResize = JSON.parse(pe(9)); break; } case "scrollTo": { T(!1); break; } case "scrollToOffset": { T(!0); break; } case "pageInfo": { Ae( t[R] && t[R].iframe, R ), Ne(); break; } case "pageInfoStop": { He(); break; } case "inPageLink": { K(pe(9)); break; } case "reset": { Te(H); break; } case "init": { p(), Oe("onInit", H.iframe); break; } default: Number(H.width) === 0 && Number(H.height) === 0 ? ee( "Unsupported message received (" + H.type + "), this is likely due to the iframe containing a later version of iframe-resizer than the parent page" ) : p(); } } function qe(m) { var O = !0; return t[m] || (O = !1, ee( H.type + " No settings for " + m + ". Message was: " + ce )), O; } function $e() { for (var m in t) x( "iFrame requested init", I(m), t[m].iframe, m ); } function Ye() { t[R] && (t[R].firstRun = !1); } var ce = n.data, H = {}, R = null; ce === "[iFrameResizerChild]Ready" ? $e() : xe() ? (H = A(), R = H.id, t[R] && (t[R].loaded = !0), !de() && qe(R) && (F(R, "Received: " + ce), De() && fe() && ze())) : Me(R, "Ignored: " + ce); } function we(n, p, A) { var E = null, W = null; if (t[n]) if (E = t[n][p], typeof E == "function") W = E(A); else throw new TypeError( p + " on iFrame[" + n + "] is not a function" ); return W; } function le(n) { var p = n.id; delete t[p]; } function Ee(n) { var p = n.id; if (we(p, "onClose", p) === !1) { F(p, "Close iframe cancelled by onClose event"); return; } F(p, "Removing iFrame: " + p); try { n.parentNode && n.parentNode.removeChild(n); } catch (A) { ee(A); } we(p, "onClosed", p), F(p, "--"), le(n), o && (o.disconnect(), o = null); } function ie(n) { f === null && (f = { x: window.pageXOffset === i ? document.documentElement.scrollLeft : window.pageXOffset, y: window.pageYOffset === i ? document.documentElement.scrollTop : window.pageYOffset }, F( n, "Get page position: " + f.x + "," + f.y )); } function ve(n) { f !== null && (window.scrollTo(f.x, f.y), F( n, "Set page position: " + f.x + "," + f.y ), Se()); } function Se() { f = null; } function Te(n) { function p() { c(n), x("reset", "reset", n.iframe, n.id); } F( n.id, "Size reset requested by " + (n.type === "init" ? "host page" : "iFrame") ), ie(n.id), g(p, n, "reset"); } function c(n) { function p(z) { if (!n.id) { F("undefined", "messageData id not set"); return; } n.iframe.style[z] = n[z] + "px", F( n.id, "IFrame (" + W + ") " + z + " set to " + n[z] + "px" ); } function A(z) { !u && n[z] === "0" && (u = !0, F(W, "Hidden iFrame detected, creating visibility listener"), D()); } function E(z) { p(z), A(z); } var W = n.iframe.id; t[W] && (t[W].sizeHeight && E("height"), t[W].sizeWidth && E("width")); } function g(n, p, A) { A !== p.type && b && // including check for jasmine because had trouble getting spy to work in unit test using requestAnimationFrame !window.jasmine ? (F(p.id, "Requesting animation frame"), b(n)) : n(); } function x(n, p, A, E, W) { function z() { var he = t[E] && t[E].targetOrigin; F( E, "[" + n + "] Sending msg to iframe[" + E + "] (" + p + ") targetOrigin: " + he ), A.contentWindow.postMessage(h + p, he); } function fe() { ee(E, "[" + n + "] IFrame(" + E + ") not found"); } function xe() { A && "contentWindow" in A && A.contentWindow !== null ? z() : fe(); } function de() { function he() { t[E] && !t[E].loaded && !pe && (pe = !0, ee( E, "IFrame has not responded within " + t[E].warningTimeout / 1e3 + " seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning." )); } W && t[E] && t[E].warningTimeout && (t[E].msgTimeout = setTimeout( he, t[E].warningTimeout )); } var pe = !1; E = E || A.id, t[E] && (xe(), de()); } function I(n) { return n + ":" + t[n].bodyMarginV1 + ":" + t[n].sizeWidth + ":" + t[n].log + ":" + t[n].interval + ":" + t[n].enablePublicMethods + ":" + t[n].autoResize + ":" + t[n].bodyMargin + ":" + t[n].heightCalculationMethod + ":" + t[n].bodyBackground + ":" + t[n].bodyPadding + ":" + t[n].tolerance + ":" + t[n].inPageLinks + ":" + t[n].resizeFrom + ":" + t[n].widthCalculationMethod + ":" + t[n].mouseEvents; } function _(n) { return typeof n == "number"; } function j(n, p) { function A() { function T(K) { var se = t[w][K]; se !== 1 / 0 && se !== 0 && (n.style[K] = _(se) ? se + "px" : se, F(w, "Set " + K + " = " + n.style[K])); } function G(K) { if (t[w]["min" + K] > t[w]["max" + K]) throw new Error( "Value for min" + K + " can not be greater than max" + K ); } G("Height"), G("Width"), T("maxHeight"), T("minHeight"), T("maxWidth"), T("minWidth"); } function E() { var T = p && p.id || N.id + r++; return document.getElementById(T) !== null && (T += r++), T; } function W(T) { if (typeof T != "string") throw new TypeError("Invaild id for iFrame. Expected String"); return T === "" && (n.id = T = E(), s = (p || {}).log, F( T, "Added missing iframe ID: " + T + " (" + n.src + ")" )), T; } function z() { switch (F( w, "IFrame scrolling " + (t[w] && t[w].scrolling ? "enabled" : "disabled") + " for " + w ), n.style.overflow = (t[w] && t[w].scrolling) === !1 ? "hidden" : "auto", t[w] && t[w].scrolling) { case "omit": break; case !0: { n.scrolling = "yes"; break; } case !1: { n.scrolling = "no"; break; } default: n.scrolling = t[w] ? t[w].scrolling : "no"; } } function fe() { (typeof (t[w] && t[w].bodyMargin) == "number" || (t[w] && t[w].bodyMargin) === "0") && (t[w].bodyMarginV1 = t[w].bodyMargin, t[w].bodyMargin = "" + t[w].bodyMargin + "px"); } function xe() { var T = t[w] && t[w].firstRun, G = t[w] && t[w].heightCalculationMethod in S; !T && G && Te({ iframe: n, height: 0, width: 0, type: "init" }); } function de() { t[w] && (t[w].iframe.iFrameResizer = { close: Ee.bind(null, t[w].iframe), removeListeners: le.bind( null, t[w].iframe ), resize: x.bind( null, "Window resize", "resize", t[w].iframe ), moveToAnchor: function(T) { x( "Move to anchor", "moveToAnchor:" + T, t[w].iframe, w ); }, sendMessage: function(T) { T = JSON.stringify(T), x( "Send Message", "message:" + T, t[w].iframe, w ); } }); } function pe(T) { function G() { x("iFrame.onload", T, n, i, !0), xe(); } function K(Oe) { if (!n.parentNode) return null; var ze = new Oe(function(qe) { qe.forEach(function($e) { var Ye = Array.prototype.slice.call($e.removedNodes); Ye.forEach(function(ce) { ce === n && Ee(n); }); }); }); return ze.observe(n.parentNode, { childList: !0 }), ze; } var se = C(); se && (o = K(se)), J(n, "load", G), x("init", T, n, i, !0); } function he(T) { if (typeof T != "object") throw new TypeError("Options is not an object"); } function Le(T) { for (var G in N) Object.prototype.hasOwnProperty.call(N, G) && (t[w][G] = Object.prototype.hasOwnProperty.call( T, G ) ? T[G] : N[G]); } function Ae(T) { return T === "" || T.match(/^(about:blank|javascript:|file:\/\/)/) !== null ? "*" : T; } function Ne(T) { var G = T.split("Callback"); if (G.length === 2) { var K = "on" + G[0].charAt(0).toUpperCase() + G[0].slice(1); this[K] = this[T], delete this[T], ee( w, "Deprecated: '" + T + "' has been renamed '" + K + "'. The old method will be removed in the next major version." ); } } function He(T) { T = T || {}, t[w] = /* @__PURE__ */ Object.create(null), t[w].iframe = n, t[w].firstRun = !0, t[w].remoteHost = n.src && n.src.split("/").slice(0, 3).join("/"), he(T), Object.keys(T).forEach(Ne, T), Le(T), t[w] && (t[w].targetOrigin = t[w].checkOrigin === !0 ? Ae(t[w].remoteHost) : "*"); } function De() { return w in t && "iFrameResizer" in n; } var w = W(n.id); De() ? ee(w, "Ignored iFrame, already setup.") : (He(p), z(), A(), fe(), pe(I(w)), de()); } function M(n, p) { L === null && (L = setTimeout(function() { L = null, n(); }, p)); } var P = {}; function k(n, p, A) { P[A] || (P[A] = setTimeout(function() { P[A] = null, n(); }, p)); } function D() { function n() { function W(z) { function fe(de) { return (t[z] && t[z].iframe.style[de]) === "0px"; } function xe(de) { return de.offsetParent !== null; } t[z] && xe(t[z].iframe) && (fe("height") || fe("width")) && x( "Visibility change", "resize", t[z].iframe, z ); } Object.keys(t).forEach(function(z) { W(z); }); } function p(W) { F( "window", "Mutation observed: " + W[0].target + " " + W[0].type ), M(n, 16); } function A() { var W = document.querySelector("body"), z = { attributes: !0, attributeOldValue: !1, characterData: !0, characterDataOldValue: !1, childList: !0, subtree: !0 }, fe = new E(p); fe.observe(W, z); } var E = C(); E && A(); } function Y(n) { function p() { re("Window " + n, "resize"); } F("window", "Trigger event: " + n), M(p, 16); } function oe() { function n() { re("Tab Visible", "resize"); } document.visibilityState !== "hidden" && (F("document", "Trigger event: Visibility change"), M(n, 16)); } function re(n, p) { function A(E) { return t[E] && t[E].resizeFrom === "parent" && t[E].autoResize && !t[E].firstRun; } Object.keys(t).forEach(function(E) { A(E) && x(n, p, t[E].iframe, E); }); } function v() { J(window, "message", _e), J(window, "resize", function() { Y("resize"); }), J(document, "visibilitychange", oe), J(document, "-webkit-visibilitychange", oe); } function Re() { function n(E, W) { function z() { if (W.tagName) { if (W.tagName.toUpperCase() !== "IFRAME") throw new TypeError( "Expected <IFRAME> tag, found <" + W.tagName + ">" ); } else throw new TypeError("Object is not a valid DOM element"); } W && (z(), j(W, E), A.push(W)); } function p(E) { E && E.enablePublicMethods && ee( "enablePublicMethods option has been removed, public methods are now always available in the iFrame" ); } var A; return Q(), v(), function(W, z) { switch (A = [], p(W), typeof z) { case "undefined": case "string": { Array.prototype.forEach.call( document.querySelectorAll(z || "iframe"), n.bind(i, W) ); break; } case "object": { n(W, z); break; } default: throw new TypeError("Unexpected data type (" + typeof z + ")"); } return A; }; } function Ce(n) { n.fn ? n.fn.iFrameResize || (n.fn.iFrameResize = function(A) { function E(W, z) { j(z, A); } return this.filter("iframe").each(E).end(); }) : Me("", "Unable to bind to jQuery, it is not fully loaded."); } window.jQuery !== i && Ce(window.jQuery), typeof i == "function" && i.amd ? i([], Re) : e.exports = Re(), window.iFrameResize = window.iFrameResize || Re(); }(); })(ft); var Et = ft.exports; const Tt = /* @__PURE__ */ Ze(Et); var Qe = { exports: {} }, ke = { exports: {} }, q = {}; /** @license React v16.13.1 * react-is.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var tt; function Rt() { if (tt) return q; tt = 1; var e = typeof Symbol == "function" && Symbol.for, i = e ? Symbol.for("react.element") : 60103, r = e ? Symbol.for("react.portal") : 60106, o = e ? Symbol.for("react.fragment") : 60107, s = e ? Symbol.for("react.strict_mode") : 60108, u = e ? Symbol.for("react.profiler") : 60114, l = e ? Symbol.for("react.provider") : 60109, a = e ? Symbol.for("react.context") : 60110, h = e ? Symbol.for("react.async_mode") : 60111, y = e ? Symbol.for("react.concurrent_mode") : 60111, f = e ? Symbol.for("react.forward_ref") : 60112, b = e ? Symbol.for("react.suspense") : 60113, S = e ? Symbol.for("react.suspense_list") : 60120, t = e ? Symbol.for("react.memo") : 60115, L = e ? Symbol.for("react.lazy") : 60116, N = e ? Symbol.for("react.block") : 60121, C = e ? Symbol.for("react.fundamental") : 60117, J = e ? Symbol.for("react.responder") : 60118, ye = e ? Symbol.for("react.scope") : 60119; function Q(d) { if (typeof d == "object" && d !== null) { var ue = d.$$typeof; switch (ue) { case i: switch (d = d.type, d) { case h: case y: case o: case u: case s: case b: return d; default: switch (d = d && d.$$typeof, d) { case a: case f: case L: case t: case l: return d; default: return ue; } } case r: return ue; } } } function X(d) { return Q(d) === y; } return q.AsyncMode = h, q.ConcurrentMode = y, q.ContextConsumer = a, q.ContextProvider = l, q.Element = i, q.ForwardRef = f, q.Fragment = o, q.Lazy = L, q.Memo = t, q.Portal = r, q.Profiler = u, q.StrictMode = s, q.Suspense = b, q.isAsyncMode = function(d) { return X(d) || Q(d) === h; }, q.isConcurrentMode = X, q.isContextConsumer = function(d) { return Q(d) === a; }, q.isContextProvider = function(d) { return Q(d) === l; }, q.isElement = function(d) { return typeof d == "object" && d !== null && d.$$typeof === i; }, q.isForwardRef = function(d) { return Q(d) === f; }, q.isFragment = function(d) { return Q(d) === o; }, q.isLazy = function(d) { return Q(d) === L; }, q.isMemo = function(d) { return Q(d) === t; }, q.isPortal = function(d) { return Q(d) === r; }, q.isProfiler = function(d) { return Q(d) === u; }, q.isStrictMode = function(d) { return Q(d) === s; }, q.isSuspense = function(d) { return Q(d) === b; }, q.isValidElementType = function(d) { return typeof d == "string" || typeof d == "function" || d === o || d === y || d === u || d === s || d === b || d === S || typeof d == "object" && d !== null && (d.$$typeof === L || d.$$typeof === t || d.$$typeof === l || d.$$typeof === a || d.$$typeof === f || d.$$typeof === C || d.$$typeof === J || d.$$typeof === ye || d.$$typeof === N); }, q.typeOf = Q, q; } var $ = {}; /** @license React v16.13.1 * react-is.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var nt; function xt() { return nt || (nt = 1, process.env.NODE_ENV !== "production" && function() { var e = typeof Symbol == "function" && Symbol.for, i = e ? Symbol.for("react.element") : 60103, r = e ? Symbol.for("react.portal") : 60106, o = e ? Symbol.for("react.fragment") : 60107, s = e ? Symbol.for("react.strict_mode") : 60108, u = e ? Symbol.for("react.profiler") : 60114, l = e ? Symbol.for("react.provider") : 60109, a = e ? Symbol.for("react.context") : 60110, h = e ? Symbol.for("react.async_mode") : 60111, y = e ? Symbol.for("react.concurrent_mode") : 60111, f = e ? Symbol.for("react.forward_ref") : 60112, b = e ? Symbol.for("react.suspense") : 60113, S = e ? Symbol.for("react.suspense_list") : 60120, t = e ? Symbol.for("react.memo") : 60115, L = e ? Symbol.for("react.lazy") : 60116, N = e ? Symbol.for("react.block") : 60121, C = e ? Symbol.for("react.fundamental") : 60117, J = e ? Symbol.for("react.responder") : 60118, ye = e ? Symbol.for("react.scope") : 60119; function Q(v) { return typeof v == "string" || typeof v == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. v === o || v === y || v === u || v === s || v === b || v === S || typeof v == "object" && v !== null && (v.$$typeof === L || v.$$typeof === t || v.$$typeof === l || v.$$typeof === a || v.$$typeof === f || v.$$typeof === C || v.$$typeof === J || v.$$typeof === ye || v.$$typeof === N); } function X(v) { if (typeof v == "object" && v !== null) { var Re = v.$$typeof; switch (Re) { case i: var Ce = v.type; switch (Ce) { case h: case y: case o: case u: case s: case b: return Ce; default: var n = Ce && Ce.$$typeof; switch (n) { case a: case f: case L: case t: case l: return n; default: return Re; } } case r: return Re; } } } var d = h, ue = y, F = a, Me = l, ee = i, be = f, _e = o, we = L, le = t, Ee = r, ie = u, ve = s, Se = b, Te = !1; function c(v) { return Te || (Te = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), g(v) || X(v) === h; } function g(v) { return X(v) === y; } function x(v) { return X(v) === a; } function I(v) { return X(v) === l; } function _(v) { return typeof v == "object" && v !== null && v.$$typeof === i; } function j(v) { return X(v) === f; } function M(v) { return X(v) === o; } function P(v) { return X(v) === L; } function k(v) { return X(v) === t; } function D(v) { return X(v) === r; } function Y(v) { return X(v) === u; } function oe(v) { return X(v) === s; } function re(v) { return X(v) === b; } $.AsyncMode = d, $.ConcurrentMode = ue, $.ContextConsumer = F, $.ContextProvider = Me, $.Element = ee, $.ForwardRef = be, $.Fragment = _e, $.Lazy = we, $.Memo = le, $.Portal = Ee, $.Profiler = ie, $.StrictMode = ve, $.Suspense = Se, $.isAsyncMode = c, $.isConcurrentMode = g, $.isContextConsumer = x, $.isContextProvider = I, $.isElement = _, $.isForwardRef = j, $.isFragment = M, $.isLazy = P, $.isMemo = k, $.isPortal = D, $.isProfiler = Y, $.isStrictMode = oe, $.isSuspense = re, $.isValidElementType = Q, $.typeOf = X; }()), $; } var rt; function lt() { return rt || (rt = 1, process.env.NODE_ENV === "production" ? ke.exports = Rt() : ke.exports = xt()), ke.exports; } /* object-assign (c) Sindre Sorhus @license MIT */ var Be, it; function Ot() { if (it) return Be; it = 1; var e = Object.getOwnPropertySymbols, i = Object.prototype.hasOwnProperty, r = Object.prototype.propertyIsEnumerable; function o(u) { if (u == null) throw new TypeError("Object.assign cannot be called with null or undefined"); return Object(u); } function s() { try { if (!Object.assign) return !1; var u = new String("abc"); if (u[5] = "de", Object.getOwnPropertyNames(u)[0] === "5") return !1; for (var l = {}, a = 0; a < 10; a++) l["_" + String.fromCharCode(a)] = a; var h = Object.getOwnPropertyNames(l).map(function(f) { return l[f]; }); if (h.join("") !== "0123456789") return !1; var y = {}; return "abcdefghijklmnopqrst".split("").forEach(function(f) { y[f] = f; }), Object.keys(Object.assign({}, y)).join("") === "abcdefghijklmnopqrst"; } catch { return !1; } } return Be = s() ? Object.assign : function(u, l) { for (var a, h = o(u), y, f = 1; f < arguments.length; f++) { a = Object(arguments[f]); for (var b in a) i.call(a, b) && (h[b] = a[b]); if (e) { y = e(a); for (var S = 0; S < y.length; S++) r.call(a, y[S]) && (h[y[S]] = a[y[S]]); } } return h; }, Be; } var Ve, ot; function Ke() { if (ot) return Ve; ot = 1; var e = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"; return Ve = e, Ve; } var Ue, at; function Pt() { if (at) return Ue; at = 1; var e = function() { }; if (process.env.NODE_ENV !== "production") { var i = Ke(), r = {}, o = Function.call.bind(Object.prototype.hasOwnProperty); e = function(u) { var l = "Warning: " + u; typeof console < "u" && console.error(l); try { throw new Error(l); } catch { } }; } function s(u, l, a, h, y) { if (process.env.NODE_ENV !== "production") { for (var f in u) if (o(u, f)) { var b; try { if (typeof u[f] != "function") { var S = Error( (h || "React class") + ": " + a + " type `" + f + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof u[f] + "`." ); throw S.name = "Invariant Violation", S; } b = u[f](l, f, h, a, null, i); } catch (L) { b = L; } if (b && !(b instanceof Error) && e( (h || "React class") + ": type specification of " + a + " `" + f + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof b + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)." ), b instanceof Error && !(b.message in r)) { r[b.message] = !0; var t = y ? y() : ""; e( "Failed " + a + " type: " + b.message + (t ?? "") ); } } } } return s.resetWarningCache = function() { process.env.NODE_ENV !== "production" && (r = {}); }, Ue = s, Ue; } var Je, st; function Mt() { if (st) return Je; st = 1; var e = lt(), i = Ot(), r = Ke(), o = Pt(), s = Function.call.bind(Object.prototype.hasOwnProperty), u = function() { }; process.env.NODE_ENV !== "production" && (u = function(a) { var h = "Warning: " + a; typeof console < "u" && console.error(h); try { throw new Error(h); } catch { } }); function l() { return null; } return Je = function(a, h) { var y = typeof Symbol == "function" && Symbol.iterator, f = "@@iterator"; function b(c) { var g = c && (y && c[y] || c[f]); if (typeof g == "function") return g; } var S = "<<anonymous>>", t = { array: J("array"), bool: J("boolean"), func: J("function"), number: J("number"), object: J("object"), string: J("string"), symbol: J("symbol"), any: ye(), arrayOf: Q, element: X(), elementType: d(), instanceOf: ue, node: be(), objectOf: Me, oneOf: F, oneOfType: ee, shape: _e, exact: we }; function L(c, g) { return c === g ? c !== 0 || 1 / c === 1 / g : c !== c && g !== g; } function N(c) { this.message = c, this.stack = ""; } N.prototype = Error.prototype; function C(c) { if (process.env.NODE_ENV !== "production") var g = {}, x = 0; function I(j, M, P, k, D, Y, oe) { if (k = k || S, Y = Y || P, oe !== r) { if (h) { var re = new Error( "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types" ); throw re.name = "Invariant Violation", re; } else if (process.env.NODE_ENV !== "production" && typeof console < "u") { var v = k + ":" + P; !g[v] && // Avoid spamming the console because they are often not actionable except for lib authors x < 3 && (u( "You are manually calling a React.PropTypes validation function for the `" + Y + "` prop on `" + k + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details." ), g[v] = !0, x++); } } return M[P] == null ? j ? M[P] === null ? new N("The " + D + " `" + Y + "` is marked as required " + ("in `" + k + "`, but its value is `null`.")) : new N("The " + D + " `" + Y + "` is marked as required in " + ("`" + k + "`, but its value is `undefined`.")) : null : c(M, P, k, D, Y); } var _ = I.bind(null, !1); return _.isRequired = I.bind(null, !0), _; } function J(c) { function g(x, I, _, j, M, P) { var k = x[I], D = ie(k); if (D !== c) { var Y = ve(k); return new N("Invalid " + j + " `" + M + "` of type " + ("`" + Y + "` supplied to `" + _ + "`, expected ") + ("`" + c + "`.")); } return null; } return C(g); } function ye() { return C(l); } function Q(c) { function g(x, I, _, j, M) { if (typeof c != "function") return new N("Property `" + M + "` of component `" + _ + "` has invalid PropType notation inside arrayOf."); var P = x[I]; if (!Array.isArray(P)) { var k = ie(P); return new N("Invalid " + j + " `" + M + "` of type " + ("`" + k + "` supplied to `" + _ + "`, expected an array.")); } for (var D = 0; D < P.length; D++) { var Y = c(P, D, _, j, M + "[" + D + "]", r); if (Y instanceof Error) return Y; } return null; } return C(g); } function X() { function c(g, x, I, _, j) { var M = g[x]; if (!a(M)) { var P = ie(M); return new N("Invalid " + _ + " `" + j + "` of type " + ("`" + P + "` supplied to `" + I + "`, expected a single ReactElement.")); } return null; } return C(c); } function d() { function c(g, x, I, _, j) { var M = g[x]; if (!e.isValidElementType(M)) { var P = ie(M); return new N("Invalid " + _ + " `" + j + "` of type " + ("`" + P + "` supplied to `" + I + "`, expected a single ReactElement type.")); } return null; } return C(c); } function ue(c) { function g(x, I, _, j, M) { if (!(x[I] instanceof c)) { var P = c.name || S, k = Te(x[I]); return new N("Invalid " + j + " `" + M + "` of type " + ("`" + k + "` supplied to `" + _ + "`, expected ") + ("instance of `" + P + "`.")); } return null; } return C(g); } function F(c) { if (!Array.isArray(c)) return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? u( "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])." ) : u("Invalid argument supplied to oneOf, expected an array.")), l; function g(x, I, _, j, M) { for (var P = x[I], k = 0; k < c.length; k++) if (L(P, c[k])) return null; var D = JSON.stringify(c, function(oe, re) { var v = ve(re); return v === "symbol" ? String(re) : re; }); return new N("Invalid " + j + " `" + M + "` of value `" + String(P) + "` " + ("supplied to `" + _ + "`, expected one of " + D + ".")); } return C(g); } function Me(c) { function g(x, I, _, j, M) { if (typeof c != "function") return new N("Property `" + M + "` of component `" + _ + "` has invalid PropType notation inside objectOf."); var P = x[I], k = ie(P); if (k !== "object") return new N("Invalid " + j + " `" + M + "` of type " + ("`" + k + "` supplied to `" + _ + "`, expected an object.")); for (var D in P) if (s(P, D)) { var Y = c(P, D, _, j, M + "." + D, r); if (Y instanceof Error) return Y; } return null; } return C(g); } function ee(c) { if (!Array.isArray(c)) return process.env.NODE_ENV !== "production" && u("Invalid argument supplied to oneOfType, expected an instance of array."), l; for (var g = 0; g < c.length; g++) { var x = c[g]; if (typeof x != "function") return u( "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + Se(x) + " at index " + g + "." ), l; } function I(_, j, M, P, k) { for (var D = 0; D < c.length; D++) { var Y = c[D]; if (Y(_, j, M, P, k, r) == null) return null; } return new N("Invalid " + P + " `" + k + "` supplied to " + ("`" + M + "`.")); } return C(I); } function be() { function c(g, x, I, _, j) { return le(g[x]) ? null : new N("Invalid " + _ + " `" + j + "` supplied to " + ("`" + I + "`, expected a ReactNode.")); } return C(c); } function _e(c) { function g(x, I, _, j, M) { var P = x[I], k = ie(P); if (k !== "object") return new N("Invalid " + j + " `" + M + "` of type `" + k + "` " + ("supplied to `" + _ + "`, expected `object`.")); for (var D in c) { var Y = c[D]; if (Y) { var oe = Y(P, D, _, j, M + "." + D, r); if (oe) return oe; } } return null; } return C(g); } function we(c) { function g(x, I, _, j, M) { var P = x[I], k = ie(P); if (k !== "object") return new N("Invalid " + j + " `" + M + "` of type `" + k + "` " + ("supplied to `" + _ + "`, expected `object`.")); var D = i({}, x[I], c); for (var Y in D) { var oe = c[Y]; if (!oe) return new N( "Invalid " + j + " `" + M + "` key `" + Y + "` supplied to `" + _ + "`.\nBad object: " + JSON.stringify(x[I], null, " ") + ` Valid keys: ` + JSON.stringify(Object.keys(c), null, " ") ); var re = oe(P, Y, _, j, M + "." + Y, r); if (re) return re; } return null; } return C(g); } function le(c) { switch (typeof c) { case "number": case "string": case "undefined": return !0; case "boolean": return !c; case "object": if (Array.isArray(c)) return c.every(le); if (c === null || a(c)) return !0; var g = b(c); if (g) { var x = g.call(c), I; if (g !== c.entries) { for (; !(I = x.next()).done; ) if (!le(I.value)) return !1; } else for (; !(I = x.next()).done; ) { var _ = I.value; if (_ && !le(_[1])) return !1; } } else return !1; return !0; default: return !1; } } function Ee(c, g) { return c === "symbol" ? !0 : g ? g["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && g instanceof Symbol : !1; } function ie(c) { var g = typeof c; return Array.isArray(c) ? "array" : c instanceof RegExp ? "object" : Ee(g, c) ? "symbol" : g; } function ve(c) { if (typeof c > "u" || c === null) return "" + c; var g = ie(c); if (g === "object") { if (c instanceof Date) return "date"; if (c instanceof RegExp) return "regexp"; } return g; } function Se(c) { var g = ve(c); switch (g) { case "array": case "object": return "an " + g; case "boolean": case "date": case "regexp": return "a " + g; default: return g; } } function Te(c) { return !c.constructor || !c.constructor.name ? S : c.constructor.name; } return t.checkPropTypes = o, t.resetWarningCache = o.resetWarningCache, t.PropTypes = t, t; }, Je; } var Xe, ct; function St() { if (ct) return Xe; ct = 1; var e = Ke(); function i() { } function r() { } return r.resetWarningCache = i, Xe = function() { function o(l, a, h, y, f, b) { if (b !== e) { var S = new Error( "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types" ); throw S.name = "Invariant Violation", S; } } o.isRequired = o; function s() { return o; } var u = { array: o, bool: o, func: o, number: o, object: o, string: o, symbol: o, any: o, arrayOf: s, element: o, elementType: o, instanceOf: s, node: o, objectOf: s, oneOf: s, oneOfType: s, shape: s, exact: s, checkPropTypes: r, resetWarningCache: i }; return u.PropTypes = u, u; }, Xe; } if (process.env.NODE_ENV !== "production") { var Ct = lt(), Ft = !0; Qe.exports = Mt()(Ct.isElement, Ft); } else Qe.exports = St()(); var _t = Qe.exports; const It = /* @__PURE__ */ Ze(_t); var At = process.env.NODE_ENV !== "production", dt = function() { }; if (At) { var zt = function(i, r) { var o = arguments.length; r = new Array(o > 1 ? o - 1 : 0); for (var s = 1; s < o; s++) r[s - 1] = arguments[s]; var u = 0, l = "Warning: " + i.replace(/%s/g, function() { return r[u++]; }); typeof console < "u" && console.error(l); try { throw new Error(l); } catch { } }; dt = function(e, i, r) { var o = arguments.length; r = new Array(o > 2 ? o - 2 : 0); for (var s = 2; s < o; s++) r[s - 2] = arguments[s]; if (i === void 0) throw new Error( "`warning(condition, format, ...args)` requires a warning message argument" ); e || zt.apply(null, [i].concat(r)); }; } var kt = dt; const jt = /* @__PURE__ */ Ze(kt); function We() { return We = Object.assign ? Object.assign.bind() : function(e) { for (var i = 1; i < arguments.length; i++) { var r = arguments[i]; for (var o in r) Object.prototype.hasOwnProperty.call(r, o) && (e[o] = r[o]); } return e; }, We.apply(this, arguments); } function pt(e, i) { if (e == null) return {}; var r = {}; for (var o in e) if (Object.prototype.hasOwnProperty.call(e, o)) { if (i.indexOf(o) >= 0) continue; r[o] = e[o]; } return r; } var Wt = ["autoResize", "bodyBackground", "bodyMargin", "bodyPadding", "checkOrigin", "inPageLinks", "heightCalculationMethod", "interval", "log", "maxHeight", "maxWidth", "minHeight", "minWidth", "resizeFrom", "scrolling", "sizeHeight", "sizeWidth", "warningTimeout", "tolerance", "widthCalculationMethod", "onClosed", "onInit", "onMessage", "onResized"], Lt = function(e) { e.autoResize, e.bodyBackground, e.bodyMargin, e.bodyPadding, e.checkOrigin, e.inPageLinks, e.heightCalculationMethod, e.interval, e.log, e.maxHeight, e.maxWidth, e.minHeight, e.minWidth, e.resizeFrom, e.scrolling, e.sizeHeight, e.sizeWidth, e.warningTimeout, e.tolerance, e.widthCalculationMethod, e.onClosed, e.onInit, e.onMessage, e.onResized; var i = pt(e, Wt); return i; }, Nt = ["title", "forwardRef"], mt = function(i) { var r = i.title, o = r === void 0 ? "iframe" : r, s = i.forwardRef, u = pt(i, Nt), l = Lt(u), a = ht(null), h = function() { var f; return jt(!(a != null && a.current), "[iframeSizerReact][" + (a == null || (f = a.current) == null ? void 0 : f.id) + "] Close event ignored, to remove the iframe update your React component"), !(a != null && a.current); }; return Ge(function() { var y = a.