UNPKG

react-zdog-renderer

Version:

npm install zdog react-zdog-renderer # or yarn add zdog react-zdog-renderer

1,575 lines (1,572 loc) 521 kB
var t0 = Object.defineProperty; var n0 = (x, h, z) => h in x ? t0(x, h, { enumerable: !0, configurable: !0, writable: !0, value: z }) : x[h] = z; var Xp = (x, h, z) => (n0(x, typeof h != "symbol" ? h + "" : h, z), z); import Pn, { useState as r0, useRef as Iy, useEffect as Sc, useMemo as a0, useDebugValue as l0 } from "react"; import am from "zdog"; const u0 = (x) => x.charAt(0).toUpperCase() + x.substring(1), hS = ["children", "key", "ref", "__self", "__source"]; function i0(x) { const h = {}; for (const z in x) hS.includes(z) || (h[z] = x[z]); return h; } class yS extends Pn.Component { constructor() { super(...arguments); Xp(this, "state", { error: !1 }); } componentDidCatch(z) { this.props.set(z); } render() { return this.state.error ? null : this.props.children; } } Xp(yS, "getDerivedStateFromError", () => ({ error: !0 })); function dm(x) { return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x.default : x; } var lm = { exports: {} }, hc = {}; /** * @license React * react-jsx-runtime.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 $y; function o0() { if ($y) return hc; $y = 1; var x = Pn, h = Symbol.for("react.element"), z = Symbol.for("react.fragment"), oe = Object.prototype.hasOwnProperty, I = x.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, k = { key: !0, ref: !0, __self: !0, __source: !0 }; function M(we, Y, E) { var ne, B = {}, W = null, Ae = null; E !== void 0 && (W = "" + E), Y.key !== void 0 && (W = "" + Y.key), Y.ref !== void 0 && (Ae = Y.ref); for (ne in Y) oe.call(Y, ne) && !k.hasOwnProperty(ne) && (B[ne] = Y[ne]); if (we && we.defaultProps) for (ne in Y = we.defaultProps, Y) B[ne] === void 0 && (B[ne] = Y[ne]); return { $$typeof: h, type: we, key: W, ref: Ae, props: B, _owner: I.current }; } return hc.Fragment = z, hc.jsx = M, hc.jsxs = M, hc; } var yc = {}; /** * @license React * react-jsx-runtime.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 eS; function s0() { return eS || (eS = 1, process.env.NODE_ENV !== "production" && function() { var x = Pn, h = Symbol.for("react.element"), z = Symbol.for("react.portal"), oe = Symbol.for("react.fragment"), I = Symbol.for("react.strict_mode"), k = Symbol.for("react.profiler"), M = Symbol.for("react.provider"), we = Symbol.for("react.context"), Y = Symbol.for("react.forward_ref"), E = Symbol.for("react.suspense"), ne = Symbol.for("react.suspense_list"), B = Symbol.for("react.memo"), W = Symbol.for("react.lazy"), Ae = Symbol.for("react.offscreen"), ye = Symbol.iterator, Ve = "@@iterator"; function Ye(S) { if (S === null || typeof S != "object") return null; var V = ye && S[ye] || S[Ve]; return typeof V == "function" ? V : null; } var Et = x.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; function Se(S) { { for (var V = arguments.length, X = new Array(V > 1 ? V - 1 : 0), xe = 1; xe < V; xe++) X[xe - 1] = arguments[xe]; Ne("error", S, X); } } function Ne(S, V, X) { { var xe = Et.ReactDebugCurrentFrame, ot = xe.getStackAddendum(); ot !== "" && (V += "%s", X = X.concat([ot])); var et = X.map(function(Je) { return String(Je); }); et.unshift("Warning: " + V), Function.prototype.apply.call(console[S], console, et); } } var ge = !1, Ze = !1, G = !1, $ = !1, it = !1, ve; ve = Symbol.for("react.module.reference"); function Me(S) { return !!(typeof S == "string" || typeof S == "function" || S === oe || S === k || it || S === I || S === E || S === ne || $ || S === Ae || ge || Ze || G || typeof S == "object" && S !== null && (S.$$typeof === W || S.$$typeof === B || S.$$typeof === M || S.$$typeof === we || S.$$typeof === Y || // This needs to include all possible module reference object // types supported by any Flight configuration anywhere since // we don't know which Flight build this will end up being used // with. S.$$typeof === ve || S.getModuleId !== void 0)); } function ee(S, V, X) { var xe = S.displayName; if (xe) return xe; var ot = V.displayName || V.name || ""; return ot !== "" ? X + "(" + ot + ")" : X; } function Pe(S) { return S.displayName || "Context"; } function Ge(S) { if (S == null) return null; if (typeof S.tag == "number" && Se("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof S == "function") return S.displayName || S.name || null; if (typeof S == "string") return S; switch (S) { case oe: return "Fragment"; case z: return "Portal"; case k: return "Profiler"; case I: return "StrictMode"; case E: return "Suspense"; case ne: return "SuspenseList"; } if (typeof S == "object") switch (S.$$typeof) { case we: var V = S; return Pe(V) + ".Consumer"; case M: var X = S; return Pe(X._context) + ".Provider"; case Y: return ee(S, S.render, "ForwardRef"); case B: var xe = S.displayName || null; return xe !== null ? xe : Ge(S.type) || "Memo"; case W: { var ot = S, et = ot._payload, Je = ot._init; try { return Ge(Je(et)); } catch { return null; } } } return null; } var $e = Object.assign, Qt = 0, St, Be, P, re, Ee, Re, dt; function un() { } un.__reactDisabledLog = !0; function mn() { { if (Qt === 0) { St = console.log, Be = console.info, P = console.warn, re = console.error, Ee = console.group, Re = console.groupCollapsed, dt = console.groupEnd; var S = { configurable: !0, enumerable: !0, value: un, writable: !0 }; Object.defineProperties(console, { info: S, log: S, warn: S, error: S, group: S, groupCollapsed: S, groupEnd: S }); } Qt++; } } function Vt() { { if (Qt--, Qt === 0) { var S = { configurable: !0, enumerable: !0, writable: !0 }; Object.defineProperties(console, { log: $e({}, S, { value: St }), info: $e({}, S, { value: Be }), warn: $e({}, S, { value: P }), error: $e({}, S, { value: re }), group: $e({}, S, { value: Ee }), groupCollapsed: $e({}, S, { value: Re }), groupEnd: $e({}, S, { value: dt }) }); } Qt < 0 && Se("disabledDepth fell below zero. This is a bug in React. Please file an issue."); } } var Gt = Et.ReactCurrentDispatcher, Rt; function pr(S, V, X) { { if (Rt === void 0) try { throw Error(); } catch (ot) { var xe = ot.stack.trim().match(/\n( *(at )?)/); Rt = xe && xe[1] || ""; } return ` ` + Rt + S; } } var Kr = !1, mr; { var kt = typeof WeakMap == "function" ? WeakMap : Map; mr = new kt(); } function Gn(S, V) { if (!S || Kr) return ""; { var X = mr.get(S); if (X !== void 0) return X; } var xe; Kr = !0; var ot = Error.prepareStackTrace; Error.prepareStackTrace = void 0; var et; et = Gt.current, Gt.current = null, mn(); try { if (V) { var Je = function() { throw Error(); }; if (Object.defineProperty(Je.prototype, "props", { set: function() { throw Error(); } }), typeof Reflect == "object" && Reflect.construct) { try { Reflect.construct(Je, []); } catch (Zr) { xe = Zr; } Reflect.construct(S, [], Je); } else { try { Je.call(); } catch (Zr) { xe = Zr; } S.call(Je.prototype); } } else { try { throw Error(); } catch (Zr) { xe = Zr; } S(); } } catch (Zr) { if (Zr && xe && typeof Zr.stack == "string") { for (var ke = Zr.stack.split(` `), Jt = xe.stack.split(` `), zt = ke.length - 1, Nt = Jt.length - 1; zt >= 1 && Nt >= 0 && ke[zt] !== Jt[Nt]; ) Nt--; for (; zt >= 1 && Nt >= 0; zt--, Nt--) if (ke[zt] !== Jt[Nt]) { if (zt !== 1 || Nt !== 1) do if (zt--, Nt--, Nt < 0 || ke[zt] !== Jt[Nt]) { var Yt = ` ` + ke[zt].replace(" at new ", " at "); return S.displayName && Yt.includes("<anonymous>") && (Yt = Yt.replace("<anonymous>", S.displayName)), typeof S == "function" && mr.set(S, Yt), Yt; } while (zt >= 1 && Nt >= 0); break; } } } finally { Kr = !1, Gt.current = et, Vt(), Error.prepareStackTrace = ot; } var el = S ? S.displayName || S.name : "", Ml = el ? pr(el) : ""; return typeof S == "function" && mr.set(S, Ml), Ml; } function Kt(S, V, X) { return Gn(S, !1); } function da(S) { var V = S.prototype; return !!(V && V.isReactComponent); } function hr(S, V, X) { if (S == null) return ""; if (typeof S == "function") return Gn(S, da(S)); if (typeof S == "string") return pr(S); switch (S) { case E: return pr("Suspense"); case ne: return pr("SuspenseList"); } if (typeof S == "object") switch (S.$$typeof) { case Y: return Kt(S.render); case B: return hr(S.type, V, X); case W: { var xe = S, ot = xe._payload, et = xe._init; try { return hr(et(ot), V, X); } catch { } } } return ""; } var Or = Object.prototype.hasOwnProperty, va = {}, Lr = Et.ReactDebugCurrentFrame; function Mr(S) { if (S) { var V = S._owner, X = hr(S.type, S._source, V ? V.type : null); Lr.setExtraStackFrame(X); } else Lr.setExtraStackFrame(null); } function Hr(S, V, X, xe, ot) { { var et = Function.call.bind(Or); for (var Je in S) if (et(S, Je)) { var ke = void 0; try { if (typeof S[Je] != "function") { var Jt = Error((xe || "React class") + ": " + X + " type `" + Je + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof S[Je] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); throw Jt.name = "Invariant Violation", Jt; } ke = S[Je](V, Je, xe, X, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); } catch (zt) { ke = zt; } ke && !(ke instanceof Error) && (Mr(ot), Se("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", xe || "React class", X, Je, typeof ke), Mr(null)), ke instanceof Error && !(ke.message in va) && (va[ke.message] = !0, Mr(ot), Se("Failed %s type: %s", X, ke.message), Mr(null)); } } } var Na = Array.isArray; function Bt(S) { return Na(S); } function Ua(S) { { var V = typeof Symbol == "function" && Symbol.toStringTag, X = V && S[Symbol.toStringTag] || S.constructor.name || "Object"; return X; } } function pa(S) { try { return zl(S), !1; } catch { return !0; } } function zl(S) { return "" + S; } function $a(S) { if (pa(S)) return Se("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ua(S)), zl(S); } var Jr = Et.ReactCurrentOwner, lu = { key: !0, ref: !0, __self: !0, __source: !0 }, Nl, uu, K; K = {}; function Ue(S) { if (Or.call(S, "ref")) { var V = Object.getOwnPropertyDescriptor(S, "ref").get; if (V && V.isReactWarning) return !1; } return S.ref !== void 0; } function Ke(S) { if (Or.call(S, "key")) { var V = Object.getOwnPropertyDescriptor(S, "key").get; if (V && V.isReactWarning) return !1; } return S.key !== void 0; } function _e(S, V) { if (typeof S.ref == "string" && Jr.current && V && Jr.current.stateNode !== V) { var X = Ge(Jr.current.type); K[X] || (Se('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', Ge(Jr.current.type), S.ref), K[X] = !0); } } function qt(S, V) { { var X = function() { Nl || (Nl = !0, Se("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", V)); }; X.isReactWarning = !0, Object.defineProperty(S, "key", { get: X, configurable: !0 }); } } function Fn(S, V) { { var X = function() { uu || (uu = !0, Se("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", V)); }; X.isReactWarning = !0, Object.defineProperty(S, "ref", { get: X, configurable: !0 }); } } var pe = function(S, V, X, xe, ot, et, Je) { var ke = { // This tag allows us to uniquely identify this as a React Element $$typeof: h, // Built-in properties that belong on the element type: S, key: V, ref: X, props: Je, // Record the component responsible for creating this element. _owner: et }; return ke._store = {}, Object.defineProperty(ke._store, "validated", { configurable: !1, enumerable: !1, writable: !0, value: !1 }), Object.defineProperty(ke, "_self", { configurable: !1, enumerable: !1, writable: !1, value: xe }), Object.defineProperty(ke, "_source", { configurable: !1, enumerable: !1, writable: !1, value: ot }), Object.freeze && (Object.freeze(ke.props), Object.freeze(ke)), ke; }; function ce(S, V, X, xe, ot) { { var et, Je = {}, ke = null, Jt = null; X !== void 0 && ($a(X), ke = "" + X), Ke(V) && ($a(V.key), ke = "" + V.key), Ue(V) && (Jt = V.ref, _e(V, ot)); for (et in V) Or.call(V, et) && !lu.hasOwnProperty(et) && (Je[et] = V[et]); if (S && S.defaultProps) { var zt = S.defaultProps; for (et in zt) Je[et] === void 0 && (Je[et] = zt[et]); } if (ke || Jt) { var Nt = typeof S == "function" ? S.displayName || S.name || "Unknown" : S; ke && qt(Je, Nt), Jt && Fn(Je, Nt); } return pe(S, ke, Jt, ot, xe, Jr.current, Je); } } var wt = Et.ReactCurrentOwner, Tt = Et.ReactDebugCurrentFrame; function Qe(S) { if (S) { var V = S._owner, X = hr(S.type, S._source, V ? V.type : null); Tt.setExtraStackFrame(X); } else Tt.setExtraStackFrame(null); } var wr; wr = !1; function Oa(S) { return typeof S == "object" && S !== null && S.$$typeof === h; } function Ul() { { if (wt.current) { var S = Ge(wt.current.type); if (S) return ` Check the render method of \`` + S + "`."; } return ""; } } function at(S) { { if (S !== void 0) { var V = S.fileName.replace(/^.*[\\\/]/, ""), X = S.lineNumber; return ` Check your code at ` + V + ":" + X + "."; } return ""; } } var Ar = {}; function jr(S) { { var V = Ul(); if (!V) { var X = typeof S == "string" ? S : S.displayName || S.name; X && (V = ` Check the top-level render call using <` + X + ">."); } return V; } } function Xr(S, V) { { if (!S._store || S._store.validated || S.key != null) return; S._store.validated = !0; var X = jr(V); if (Ar[X]) return; Ar[X] = !0; var xe = ""; S && S._owner && S._owner !== wt.current && (xe = " It was passed a child from " + Ge(S._owner.type) + "."), Qe(S), Se('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', X, xe), Qe(null); } } function kn(S, V) { { if (typeof S != "object") return; if (Bt(S)) for (var X = 0; X < S.length; X++) { var xe = S[X]; Oa(xe) && Xr(xe, V); } else if (Oa(S)) S._store && (S._store.validated = !0); else if (S) { var ot = Ye(S); if (typeof ot == "function" && ot !== S.entries) for (var et = ot.call(S), Je; !(Je = et.next()).done; ) Oa(Je.value) && Xr(Je.value, V); } } } function Wr(S) { { var V = S.type; if (V == null || typeof V == "string") return; var X; if (typeof V == "function") X = V.propTypes; else if (typeof V == "object" && (V.$$typeof === Y || // Note: Memo only checks outer props here. // Inner props are checked in the reconciler. V.$$typeof === B)) X = V.propTypes; else return; if (X) { var xe = Ge(V); Hr(X, S.props, "prop", xe, S); } else if (V.PropTypes !== void 0 && !wr) { wr = !0; var ot = Ge(V); Se("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", ot || "Unknown"); } typeof V.getDefaultProps == "function" && !V.getDefaultProps.isReactClassApproved && Se("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); } } function La(S) { { for (var V = Object.keys(S.props), X = 0; X < V.length; X++) { var xe = V[X]; if (xe !== "children" && xe !== "key") { Qe(S), Se("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", xe), Qe(null); break; } } S.ref !== null && (Qe(S), Se("Invalid attribute `ref` supplied to `React.Fragment`."), Qe(null)); } } function Ol(S, V, X, xe, ot, et) { { var Je = Me(S); if (!Je) { var ke = ""; (S === void 0 || typeof S == "object" && S !== null && Object.keys(S).length === 0) && (ke += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."); var Jt = at(ot); Jt ? ke += Jt : ke += Ul(); var zt; S === null ? zt = "null" : Bt(S) ? zt = "array" : S !== void 0 && S.$$typeof === h ? (zt = "<" + (Ge(S.type) || "Unknown") + " />", ke = " Did you accidentally export a JSX literal instead of a component?") : zt = typeof S, Se("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", zt, ke); } var Nt = ce(S, V, X, ot, et); if (Nt == null) return Nt; if (Je) { var Yt = V.children; if (Yt !== void 0) if (xe) if (Bt(Yt)) { for (var el = 0; el < Yt.length; el++) kn(Yt[el], S); Object.freeze && Object.freeze(Yt); } else Se("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."); else kn(Yt, S); } return S === oe ? La(Nt) : Wr(Nt), Nt; } } function Di(S, V, X) { return Ol(S, V, X, !0); } function Gu(S, V, X) { return Ol(S, V, X, !1); } var Ll = Gu, xn = Di; yc.Fragment = oe, yc.jsx = Ll, yc.jsxs = xn; }()), yc; } process.env.NODE_ENV === "production" ? lm.exports = o0() : lm.exports = s0(); var Yo = lm.exports; function um(x, h, z) { var oe, I, k, M, we; h == null && (h = 100); function Y() { var ne = Date.now() - M; ne < h && ne >= 0 ? oe = setTimeout(Y, h - ne) : (oe = null, z || (we = x.apply(k, I), k = I = null)); } var E = function() { k = this, I = arguments, M = Date.now(); var ne = z && !oe; return oe || (oe = setTimeout(Y, h)), ne && (we = x.apply(k, I), k = I = null), we; }; return E.clear = function() { oe && (clearTimeout(oe), oe = null); }, E.flush = function() { oe && (we = x.apply(k, I), k = I = null, clearTimeout(oe), oe = null); }, E; } um.debounce = um; var c0 = um; const tS = /* @__PURE__ */ dm(c0); function f0(x) { let { debounce: h, scroll: z, polyfill: oe, offsetSize: I } = x === void 0 ? { debounce: 0, scroll: !1, offsetSize: !1 } : x; const k = oe || (typeof window > "u" ? class { } : window.ResizeObserver); if (!k) throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills"); const [M, we] = r0({ left: 0, top: 0, width: 0, height: 0, bottom: 0, right: 0, x: 0, y: 0 }), Y = Iy({ element: null, scrollContainers: null, resizeObserver: null, lastBounds: M }), E = h ? typeof h == "number" ? h : h.scroll : null, ne = h ? typeof h == "number" ? h : h.resize : null, B = Iy(!1); Sc(() => (B.current = !0, () => void (B.current = !1))); const [W, Ae, ye] = a0(() => { const Se = () => { if (!Y.current.element) return; const { left: Ne, top: ge, width: Ze, height: G, bottom: $, right: it, x: ve, y: Me } = Y.current.element.getBoundingClientRect(), ee = { left: Ne, top: ge, width: Ze, height: G, bottom: $, right: it, x: ve, y: Me }; Y.current.element instanceof HTMLElement && I && (ee.height = Y.current.element.offsetHeight, ee.width = Y.current.element.offsetWidth), Object.freeze(ee), B.current && !m0(Y.current.lastBounds, ee) && we(Y.current.lastBounds = ee); }; return [Se, ne ? tS(Se, ne) : Se, E ? tS(Se, E) : Se]; }, [we, I, E, ne]); function Ve() { Y.current.scrollContainers && (Y.current.scrollContainers.forEach((Se) => Se.removeEventListener("scroll", ye, !0)), Y.current.scrollContainers = null), Y.current.resizeObserver && (Y.current.resizeObserver.disconnect(), Y.current.resizeObserver = null); } function Ye() { Y.current.element && (Y.current.resizeObserver = new k(ye), Y.current.resizeObserver.observe(Y.current.element), z && Y.current.scrollContainers && Y.current.scrollContainers.forEach((Se) => Se.addEventListener("scroll", ye, { capture: !0, passive: !0 }))); } const Et = (Se) => { !Se || Se === Y.current.element || (Ve(), Y.current.element = Se, Y.current.scrollContainers = SS(Se), Ye()); }; return v0(ye, !!z), d0(Ae), Sc(() => { Ve(), Ye(); }, [z, ye, Ae]), Sc(() => Ve, []), [Et, M, W]; } function d0(x) { Sc(() => { const h = x; return window.addEventListener("resize", h), () => void window.removeEventListener("resize", h); }, [x]); } function v0(x, h) { Sc(() => { if (h) { const z = x; return window.addEventListener("scroll", z, { capture: !0, passive: !0 }), () => void window.removeEventListener("scroll", z, !0); } }, [x, h]); } function SS(x) { const h = []; if (!x || x === document.body) return h; const { overflow: z, overflowX: oe, overflowY: I } = window.getComputedStyle(x); return [z, oe, I].some((k) => k === "auto" || k === "scroll") && h.push(x), [...h, ...SS(x.parentElement)]; } const p0 = ["x", "y", "top", "bottom", "left", "right", "width", "height"], m0 = (x, h) => p0.every((z) => x[z] === h[z]), Q0 = ({ style: x, children: h, resize: z, dragRotate: oe, rotate: I, background: k, zoom: M = 1, centered: we = !0, element: Y = "canvas", onDragStart: E, frameloop: ne = "always", ...B }) => { const W = Pn.useRef(null), [Ae, { width: ye, height: Ve }] = f0({ scroll: !0, debounce: { scroll: 50, resize: 0 } }), [Ye, Et] = Pn.useState(), [Se, Ne] = Pn.useState(!1); if (Se) throw Se; Ye && ye > 0 && Ve > 0 && M0(/* @__PURE__ */ Yo.jsx(yS, { set: Ne, children: h }), Ye, { dragRotate: oe, rotate: I, onDragStart: E, zoom: M, centered: we, frameloop: ne, width: ye, height: Ve, resize: z }), cm(() => { Et(W.current); }, []), Pn.useEffect(() => { if (Ye) return () => { H0(Ye); }; }, [Ye]); const ge = Y, Ze = Y === "svg" ? { width: ye, height: Ve } : {}; return /* @__PURE__ */ Yo.jsx(Yo.Fragment, { children: /* @__PURE__ */ Yo.jsx( "div", { ...B, ref: Ae, style: { position: "relative", width: "100%", height: "100%", overflow: "hidden", ...x }, children: /* @__PURE__ */ Yo.jsx( ge, { ref: W, style: { display: "block", boxSizing: "border-box", background: k || "#fff" }, ...Ze } ) } ) }); }; var im = { exports: {} }, gd = { exports: {} }, Wp = {}; /** * @license React * scheduler.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 nS; function h0() { return nS || (nS = 1, function(x) { function h(P, re) { var Ee = P.length; P.push(re); e: for (; 0 < Ee; ) { var Re = Ee - 1 >>> 1, dt = P[Re]; if (0 < I(dt, re)) P[Re] = re, P[Ee] = dt, Ee = Re; else break e; } } function z(P) { return P.length === 0 ? null : P[0]; } function oe(P) { if (P.length === 0) return null; var re = P[0], Ee = P.pop(); if (Ee !== re) { P[0] = Ee; e: for (var Re = 0, dt = P.length, un = dt >>> 1; Re < un; ) { var mn = 2 * (Re + 1) - 1, Vt = P[mn], Gt = mn + 1, Rt = P[Gt]; if (0 > I(Vt, Ee)) Gt < dt && 0 > I(Rt, Vt) ? (P[Re] = Rt, P[Gt] = Ee, Re = Gt) : (P[Re] = Vt, P[mn] = Ee, Re = mn); else if (Gt < dt && 0 > I(Rt, Ee)) P[Re] = Rt, P[Gt] = Ee, Re = Gt; else break e; } } return re; } function I(P, re) { var Ee = P.sortIndex - re.sortIndex; return Ee !== 0 ? Ee : P.id - re.id; } if (typeof performance == "object" && typeof performance.now == "function") { var k = performance; x.unstable_now = function() { return k.now(); }; } else { var M = Date, we = M.now(); x.unstable_now = function() { return M.now() - we; }; } var Y = [], E = [], ne = 1, B = null, W = 3, Ae = !1, ye = !1, Ve = !1, Ye = typeof setTimeout == "function" ? setTimeout : null, Et = typeof clearTimeout == "function" ? clearTimeout : null, Se = typeof setImmediate < "u" ? setImmediate : null; typeof navigator < "u" && navigator.scheduling !== void 0 && navigator.scheduling.isInputPending !== void 0 && navigator.scheduling.isInputPending.bind(navigator.scheduling); function Ne(P) { for (var re = z(E); re !== null; ) { if (re.callback === null) oe(E); else if (re.startTime <= P) oe(E), re.sortIndex = re.expirationTime, h(Y, re); else break; re = z(E); } } function ge(P) { if (Ve = !1, Ne(P), !ye) if (z(Y) !== null) ye = !0, St(Ze); else { var re = z(E); re !== null && Be(ge, re.startTime - P); } } function Ze(P, re) { ye = !1, Ve && (Ve = !1, Et(it), it = -1), Ae = !0; var Ee = W; try { for (Ne(re), B = z(Y); B !== null && (!(B.expirationTime > re) || P && !ee()); ) { var Re = B.callback; if (typeof Re == "function") { B.callback = null, W = B.priorityLevel; var dt = Re(B.expirationTime <= re); re = x.unstable_now(), typeof dt == "function" ? B.callback = dt : B === z(Y) && oe(Y), Ne(re); } else oe(Y); B = z(Y); } if (B !== null) var un = !0; else { var mn = z(E); mn !== null && Be(ge, mn.startTime - re), un = !1; } return un; } finally { B = null, W = Ee, Ae = !1; } } var G = !1, $ = null, it = -1, ve = 5, Me = -1; function ee() { return !(x.unstable_now() - Me < ve); } function Pe() { if ($ !== null) { var P = x.unstable_now(); Me = P; var re = !0; try { re = $(!0, P); } finally { re ? Ge() : (G = !1, $ = null); } } else G = !1; } var Ge; if (typeof Se == "function") Ge = function() { Se(Pe); }; else if (typeof MessageChannel < "u") { var $e = new MessageChannel(), Qt = $e.port2; $e.port1.onmessage = Pe, Ge = function() { Qt.postMessage(null); }; } else Ge = function() { Ye(Pe, 0); }; function St(P) { $ = P, G || (G = !0, Ge()); } function Be(P, re) { it = Ye(function() { P(x.unstable_now()); }, re); } x.unstable_IdlePriority = 5, x.unstable_ImmediatePriority = 1, x.unstable_LowPriority = 4, x.unstable_NormalPriority = 3, x.unstable_Profiling = null, x.unstable_UserBlockingPriority = 2, x.unstable_cancelCallback = function(P) { P.callback = null; }, x.unstable_continueExecution = function() { ye || Ae || (ye = !0, St(Ze)); }, x.unstable_forceFrameRate = function(P) { 0 > P || 125 < P ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : ve = 0 < P ? Math.floor(1e3 / P) : 5; }, x.unstable_getCurrentPriorityLevel = function() { return W; }, x.unstable_getFirstCallbackNode = function() { return z(Y); }, x.unstable_next = function(P) { switch (W) { case 1: case 2: case 3: var re = 3; break; default: re = W; } var Ee = W; W = re; try { return P(); } finally { W = Ee; } }, x.unstable_pauseExecution = function() { }, x.unstable_requestPaint = function() { }, x.unstable_runWithPriority = function(P, re) { switch (P) { case 1: case 2: case 3: case 4: case 5: break; default: P = 3; } var Ee = W; W = P; try { return re(); } finally { W = Ee; } }, x.unstable_scheduleCallback = function(P, re, Ee) { var Re = x.unstable_now(); switch (typeof Ee == "object" && Ee !== null ? (Ee = Ee.delay, Ee = typeof Ee == "number" && 0 < Ee ? Re + Ee : Re) : Ee = Re, P) { case 1: var dt = -1; break; case 2: dt = 250; break; case 5: dt = 1073741823; break; case 4: dt = 1e4; break; default: dt = 5e3; } return dt = Ee + dt, P = { id: ne++, callback: re, priorityLevel: P, startTime: Ee, expirationTime: dt, sortIndex: -1 }, Ee > Re ? (P.sortIndex = Ee, h(E, P), z(Y) === null && P === z(E) && (Ve ? (Et(it), it = -1) : Ve = !0, Be(ge, Ee - Re))) : (P.sortIndex = dt, h(Y, P), ye || Ae || (ye = !0, St(Ze))), P; }, x.unstable_shouldYield = ee, x.unstable_wrapCallback = function(P) { var re = W; return function() { var Ee = W; W = re; try { return P.apply(this, arguments); } finally { W = Ee; } }; }; }(Wp)), Wp; } var Zp = {}; /** * @license React * scheduler.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 rS; function y0() { return rS || (rS = 1, function(x) { process.env.NODE_ENV !== "production" && function() { typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); var h = !1, z = !1, oe = 5; function I(K, Ue) { var Ke = K.length; K.push(Ue), we(K, Ue, Ke); } function k(K) { return K.length === 0 ? null : K[0]; } function M(K) { if (K.length === 0) return null; var Ue = K[0], Ke = K.pop(); return Ke !== Ue && (K[0] = Ke, Y(K, Ke, 0)), Ue; } function we(K, Ue, Ke) { for (var _e = Ke; _e > 0; ) { var qt = _e - 1 >>> 1, Fn = K[qt]; if (E(Fn, Ue) > 0) K[qt] = Ue, K[_e] = Fn, _e = qt; else return; } } function Y(K, Ue, Ke) { for (var _e = Ke, qt = K.length, Fn = qt >>> 1; _e < Fn; ) { var pe = (_e + 1) * 2 - 1, ce = K[pe], wt = pe + 1, Tt = K[wt]; if (E(ce, Ue) < 0) wt < qt && E(Tt, ce) < 0 ? (K[_e] = Tt, K[wt] = Ue, _e = wt) : (K[_e] = ce, K[pe] = Ue, _e = pe); else if (wt < qt && E(Tt, Ue) < 0) K[_e] = Tt, K[wt] = Ue, _e = wt; else return; } } function E(K, Ue) { var Ke = K.sortIndex - Ue.sortIndex; return Ke !== 0 ? Ke : K.id - Ue.id; } var ne = 1, B = 2, W = 3, Ae = 4, ye = 5; function Ve(K, Ue) { } var Ye = typeof performance == "object" && typeof performance.now == "function"; if (Ye) { var Et = performance; x.unstable_now = function() { return Et.now(); }; } else { var Se = Date, Ne = Se.now(); x.unstable_now = function() { return Se.now() - Ne; }; } var ge = 1073741823, Ze = -1, G = 250, $ = 5e3, it = 1e4, ve = ge, Me = [], ee = [], Pe = 1, Ge = null, $e = W, Qt = !1, St = !1, Be = !1, P = typeof setTimeout == "function" ? setTimeout : null, re = typeof clearTimeout == "function" ? clearTimeout : null, Ee = typeof setImmediate < "u" ? setImmediate : null; typeof navigator < "u" && navigator.scheduling !== void 0 && navigator.scheduling.isInputPending !== void 0 && navigator.scheduling.isInputPending.bind(navigator.scheduling); function Re(K) { for (var Ue = k(ee); Ue !== null; ) { if (Ue.callback === null) M(ee); else if (Ue.startTime <= K) M(ee), Ue.sortIndex = Ue.expirationTime, I(Me, Ue); else return; Ue = k(ee); } } function dt(K) { if (Be = !1, Re(K), !St) if (k(Me) !== null) St = !0, $a(un); else { var Ue = k(ee); Ue !== null && Jr(dt, Ue.startTime - K); } } function un(K, Ue) { St = !1, Be && (Be = !1, lu()), Qt = !0; var Ke = $e; try { var _e; if (!z) return mn(K, Ue); } finally { Ge = null, $e = Ke, Qt = !1; } } function mn(K, Ue) { var Ke = Ue; for (Re(Ke), Ge = k(Me); Ge !== null && !h && !(Ge.expirationTime > Ke && (!K || Mr())); ) { var _e = Ge.callback; if (typeof _e == "function") { Ge.callback = null, $e = Ge.priorityLevel; var qt = Ge.expirationTime <= Ke, Fn = _e(qt); Ke = x.unstable_now(), typeof Fn == "function" ? Ge.callback = Fn : Ge === k(Me) && M(Me), Re(Ke); } else M(Me); Ge = k(Me); } if (Ge !== null) return !0; var pe = k(ee); return pe !== null && Jr(dt, pe.startTime - Ke), !1; } function Vt(K, Ue) { switch (K) { case ne: case B: case W: case Ae: case ye: break; default: K = W; } var Ke = $e; $e = K; try { return Ue(); } finally { $e = Ke; } } function Gt(K) { var Ue; switch ($e) { case ne: case B: case W: Ue = W; break; default: Ue = $e; break; } var Ke = $e; $e = Ue; try { return K(); } finally { $e = Ke; } } function Rt(K) { var Ue = $e; return function() { var Ke = $e; $e = Ue; try { return K.apply(this, arguments); } finally { $e = Ke; } }; } function pr(K, Ue, Ke) { var _e = x.unstable_now(), qt; if (typeof Ke == "object" && Ke !== null) { var Fn = Ke.delay; typeof Fn == "number" && Fn > 0 ? qt = _e + Fn : qt = _e; } else qt = _e; var pe; switch (K) { case ne: pe = Ze; break; case B: pe = G; break; case ye: pe = ve; break; case Ae: pe = it; break; case W: default: pe = $; break; } var ce = qt + pe, wt = { id: Pe++, callback: Ue, priorityLevel: K, startTime: qt, expirationTime: ce, sortIndex: -1 }; return qt > _e ? (wt.sortIndex = qt, I(ee, wt), k(Me) === null && wt === k(ee) && (Be ? lu() : Be = !0, Jr(dt, qt - _e))) : (wt.sortIndex = ce, I(Me, wt), !St && !Qt && (St = !0, $a(un))), wt; } function Kr() { } function mr() { !St && !Qt && (St = !0, $a(un)); } function kt() { return k(Me); } function Gn(K) { K.callback = null; } function Kt() { return $e; } var da = !1, hr = null, Or = -1, va = oe, Lr = -1; function Mr() { var K = x.unstable_now() - Lr; return !(K < va); } function Hr() { } function Na(K) { if (K < 0 || K > 125) { console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"); return; } K > 0 ? va = Math.floor(1e3 / K) : va = oe; } var Bt = function() { if (hr !== null) { var K = x.unstable_now(); Lr = K; var Ue = !0, Ke = !0; try { Ke = hr(Ue, K); } finally { Ke ? Ua() : (da = !1, hr = null); } } else da = !1; }, Ua; if (typeof Ee == "function") Ua = function() { Ee(Bt); }; else if (typeof MessageChannel < "u") { var pa = new MessageChannel(), zl = pa.port2; pa.port1.onmessage = Bt, Ua = function() { zl.postMessage(null); }; } else Ua = function() { P(Bt, 0); }; function $a(K) { hr = K, da || (da = !0, Ua()); } function Jr(K, Ue) { Or = P(function() { K(x.unstable_now()); }, Ue); } function lu() { re(Or), Or = -1; } var Nl = Hr, uu = null; x.unstable_IdlePriority = ye, x.unstable_ImmediatePriority = ne, x.unstable_LowPriority = Ae, x.unstable_NormalPriority = W, x.unstable_Profiling = uu, x.unstable_UserBlockingPriority = B, x.unstable_cancelCallback = Gn, x.unstable_continueExecution = mr, x.unstable_forceFrameRate = Na, x.unstable_getCurrentPriorityLevel = Kt, x.unstable_getFirstCallbackNode = kt, x.unstable_next = Gt, x.unstable_pauseExecution = Kr, x.unstable_requestPaint = Nl, x.unstable_runWithPriority = Vt, x.unstable_scheduleCallback = pr, x.unstable_shouldYield = Mr, x.unstable_wrapCallback = Rt, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error()); }(); }(Zp)), Zp; } var aS; function gS() { return aS || (aS = 1, process.env.NODE_ENV === "production" ? gd.exports = h0() : gd.exports = y0()), gd.exports; } /** * @license React * react-reconciler.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 Ip, lS; function S0() { return lS || (lS = 1, Ip = function(h) { var z = {}, oe = Pn, I = gS(), k = Object.assign; function M(n) { for (var r = "https://reactjs.org/docs/error-decoder.html?invariant=" + n, u = 1; u < arguments.length; u++) r += "&args[]=" + encodeURIComponent(arguments[u]); return "Minified React error #" + n + "; visit " + r + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings."; } var we = oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, Y = Symbol.for("react.element"), E = Symbol.for("react.portal"), ne = Symbol.for("react.fragment"), B = Symbol.for("react.strict_mode"), W = Symbol.for("react.profiler"), Ae = Symbol.for("react.provider"), ye = Symbol.for("react.context"), Ve = Symbol.for("react.forward_ref"), Ye = Symbol.for("react.suspense"), Et = Symbol.for("react.suspense_list"), Se = Symbol.for("react.memo"), Ne = Symbol.for("react.lazy"), ge = Symbol.for("react.offscreen"), Ze = Symbol.iterator; function G(n) { return n === null || typeof n != "object" ? null : (n = Ze && n[Ze] || n["@@iterator"], typeof n == "function" ? n : null); } function $(n) { if (n == null) return null; if (typeof n == "function") return n.displayName || n.name || null; if (typeof n == "string") return n; switch (n) { case ne: return "Fragment"; case E: return "Portal"; case W: return "Profiler"; case B: return "StrictMode"; case Ye: return "Suspense"; case Et: return "SuspenseList"; } if (typeof n == "object") switch (n.$$typeof) { case ye: return (n.displayName || "Context") + ".Consumer"; case Ae: return (n._context.displayName || "Context") + ".Provider"; case Ve: var r = n.render; return n = n.displayName, n || (n = r.displayName || r.name || "", n = n !== "" ? "ForwardRef(" + n + ")" : "ForwardRef"), n; case Se: return r = n.displayName || null, r !== null ? r : $(n.type) || "Memo"; case Ne: r = n._payload, n = n._init; try { return $(n(r)); } catch { } } return null; } function it(n) { var r = n.type; switch (n.tag) { case 24: return "Cache"; case 9: return (r.displayName || "Context") + ".Consumer"; case 10: return (r._context.displayName || "Context") + ".Provider"; case 18: return "DehydratedFragment"; case 11: return n = r.render, n = n.displayName || n.name || "", r.displayName || (n !== "" ? "ForwardRef(" + n + ")" : "ForwardRef"); case 7: return "Fragment"; case 5: return r; case 4: return "Portal"; case 3: return "Root"; case 6: return "Text"; case 16: return $(r); case 8: return r === B ? "StrictMode" : "Mode"; case 22: return "Offscreen"; case 12: return "Profiler"; case 21: return "Scope"; case 13: return "Suspense"; case 19: return "SuspenseList"; case 25: return "TracingMarker"; case 1: case 0: case 17: case 2: case 14: case 15: if (typeof r == "function") return r.displayName || r.name || null; if (typeof r == "string") return r; } return null; } function ve(n) { var r = n, u = n; if (n.alternate) for (; r.return; ) r = r.return; else { n = r; do r = n, r.flags & 4098 && (u = r.return), n = r.return; while (n); } return r.tag === 3 ? u : null; } function Me(n) { if (ve(n) !== n) throw Error(M(188)); } function ee(n) { var r = n.alternate; if (!r) { if (r = ve(n), r === null) throw Error(M(188)); return r !== n ? null : n; } for (var u = n, o = r; ; ) { var c = u.return; if (c === null) break; var f = c.alternate; if (f === null) { if (o = c.return, o !== null) { u = o; continue; } break; } if (c.child === f.child) { for (f = c.child; f; ) { if (f === u) return Me(c), n; if (f === o) return Me(c), r; f = f.sibling; } throw Error(M(188)); } if (u.return !== o.return) u = c, o = f; else { for (var m = !1, R = c.child; R; ) { if (R === u) { m = !0, u = c, o = f; break; } if (R === o) { m = !0, o = c, u = f; break; } R = R.sibling; } if (!m) { for (R = f.child; R; ) { if (R === u) { m = !0, u = f, o = c; break; } if (R === o) { m = !0, o = f, u = c; break; } R = R.sibling; } if (!m) throw Error(M(189)); } } if (u.alternate !== o) throw Error(M(190)); } if (u.tag !== 3) throw Error(M(188)); return u.stateNode.current === u ? n : r; } function Pe(n) { return n = ee(n), n !== null ? Ge(n) : null; } function Ge(n) { if (n.tag === 5 || n.tag === 6) return n; for (n = n.child; n !== null; ) { var r = Ge(n); if (r !== null) return r; n = n.sibling; } return null; } function $e(n) { if (n.tag === 5 || n.tag === 6) return n; for (n = n.child; n !== null; ) { if (n.tag !== 4) { var r = $e(n); if (r !== null) return r; } n = n.sibling; } retur