react-iiif-vault 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.build/types/features/rendering-strategy/get-rendering-strategy.d.ts +3 -3
- package/.build/types/utils.d.ts +2 -0
- package/dist/bundle/cjs/index.js +6 -70
- package/dist/bundle/cjs/index.js.map +1 -1
- package/dist/bundle/esm/index.mjs +1570 -5253
- package/dist/bundle/esm/index.mjs.map +1 -1
- package/dist/canvas-panel/cjs/canvas-panel.js +5 -69
- package/dist/canvas-panel/cjs/canvas-panel.js.map +1 -1
- package/dist/canvas-panel/esm/canvas-panel.mjs +1286 -4966
- package/dist/canvas-panel/esm/canvas-panel.mjs.map +1 -1
- package/dist/index.umd.js +76 -80
- package/dist/index.umd.js.map +1 -1
- package/dist/react17/cjs/index.js +6 -70
- package/dist/react17/cjs/index.js.map +1 -1
- package/dist/react17/esm/index.mjs +1570 -5253
- package/dist/react17/esm/index.mjs.map +1 -1
- package/dist/utils/cjs/utils.js +2 -0
- package/dist/utils/cjs/utils.js.map +1 -0
- package/dist/utils/esm/utils.mjs +237 -0
- package/dist/utils/esm/utils.mjs.map +1 -0
- package/package.json +22 -15
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(fe,
|
|
1
|
+
(function(fe,C){typeof exports=="object"&&typeof module<"u"?C(exports,require("react"),require("react-dom"),require("@iiif/helpers/vault"),require("@atlas-viewer/iiif-image-api")):typeof define=="function"&&define.amd?define(["exports","react","react-dom","@iiif/helpers/vault","@atlas-viewer/iiif-image-api"],C):(fe=typeof globalThis<"u"?globalThis:fe||self,C(fe.ReactIIIFVault={},fe.React,fe.ReactDOM,fe.IIIFVault,fe.IIIFImageApi))})(this,function(fe,C,vg,cf,ka){"use strict";function Ix(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}function Fx(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in t)){const c=Object.getOwnPropertyDescriptor(r,o);c&&Object.defineProperty(t,o,c.get?c:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const ae=Ix(C);function Bx(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Gh={exports:{}},wu={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.development.js
|
|
4
4
|
*
|
|
@@ -6,17 +6,17 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
10
|
-
`+
|
|
11
|
-
`),
|
|
12
|
-
`),
|
|
13
|
-
`+
|
|
9
|
+
*/var mg;function Hx(){return mg||(mg=1,process.env.NODE_ENV!=="production"&&function(){var t=C,e=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),h=Symbol.for("react.provider"),v=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),P=Symbol.for("react.offscreen"),M=Symbol.iterator,_="@@iterator";function L(U){if(U===null||typeof U!="object")return null;var de=M&&U[M]||U[_];return typeof de=="function"?de:null}var k=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function O(U){{for(var de=arguments.length,we=new Array(de>1?de-1:0),Qe=1;Qe<de;Qe++)we[Qe-1]=arguments[Qe];I("error",U,we)}}function I(U,de,we){{var Qe=k.ReactDebugCurrentFrame,Et=Qe.getStackAddendum();Et!==""&&(de+="%s",we=we.concat([Et]));var At=we.map(function(vt){return String(vt)});At.unshift("Warning: "+de),Function.prototype.apply.call(console[U],console,At)}}var q=!1,te=!1,H=!1,J=!1,re=!1,$;$=Symbol.for("react.module.reference");function se(U){return!!(typeof U=="string"||typeof U=="function"||U===r||U===c||re||U===o||U===x||U===m||J||U===P||q||te||H||typeof U=="object"&&U!==null&&(U.$$typeof===A||U.$$typeof===w||U.$$typeof===h||U.$$typeof===v||U.$$typeof===g||U.$$typeof===$||U.getModuleId!==void 0))}function ge(U,de,we){var Qe=U.displayName;if(Qe)return Qe;var Et=de.displayName||de.name||"";return Et!==""?we+"("+Et+")":we}function Ce(U){return U.displayName||"Context"}function me(U){if(U==null)return null;if(typeof U.tag=="number"&&O("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof U=="function")return U.displayName||U.name||null;if(typeof U=="string")return U;switch(U){case r:return"Fragment";case n:return"Portal";case c:return"Profiler";case o:return"StrictMode";case x:return"Suspense";case m:return"SuspenseList"}if(typeof U=="object")switch(U.$$typeof){case v:var de=U;return Ce(de)+".Consumer";case h:var we=U;return Ce(we._context)+".Provider";case g:return ge(U,U.render,"ForwardRef");case w:var Qe=U.displayName||null;return Qe!==null?Qe:me(U.type)||"Memo";case A:{var Et=U,At=Et._payload,vt=Et._init;try{return me(vt(At))}catch{return null}}}return null}var Ie=Object.assign,_e=0,Ye,gt,Z,Ue,dt,pe,je;function He(){}He.__reactDisabledLog=!0;function ut(){{if(_e===0){Ye=console.log,gt=console.info,Z=console.warn,Ue=console.error,dt=console.group,pe=console.groupCollapsed,je=console.groupEnd;var U={configurable:!0,enumerable:!0,value:He,writable:!0};Object.defineProperties(console,{info:U,log:U,warn:U,error:U,group:U,groupCollapsed:U,groupEnd:U})}_e++}}function pt(){{if(_e--,_e===0){var U={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Ie({},U,{value:Ye}),info:Ie({},U,{value:gt}),warn:Ie({},U,{value:Z}),error:Ie({},U,{value:Ue}),group:Ie({},U,{value:dt}),groupCollapsed:Ie({},U,{value:pe}),groupEnd:Ie({},U,{value:je})})}_e<0&&O("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var vn=k.ReactCurrentDispatcher,Kt;function xt(U,de,we){{if(Kt===void 0)try{throw Error()}catch(Et){var Qe=Et.stack.trim().match(/\n( *(at )?)/);Kt=Qe&&Qe[1]||""}return`
|
|
10
|
+
`+Kt+U}}var ct=!1,Ge;{var nt=typeof WeakMap=="function"?WeakMap:Map;Ge=new nt}function Ze(U,de){if(!U||ct)return"";{var we=Ge.get(U);if(we!==void 0)return we}var Qe;ct=!0;var Et=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var At;At=vn.current,vn.current=null,ut();try{if(de){var vt=function(){throw Error()};if(Object.defineProperty(vt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(vt,[])}catch(mt){Qe=mt}Reflect.construct(U,[],vt)}else{try{vt.call()}catch(mt){Qe=mt}U.call(vt.prototype)}}else{try{throw Error()}catch(mt){Qe=mt}U()}}catch(mt){if(mt&&Qe&&typeof mt.stack=="string"){for(var ot=mt.stack.split(`
|
|
11
|
+
`),yn=Qe.stack.split(`
|
|
12
|
+
`),Ut=ot.length-1,Ht=yn.length-1;Ut>=1&&Ht>=0&&ot[Ut]!==yn[Ht];)Ht--;for(;Ut>=1&&Ht>=0;Ut--,Ht--)if(ot[Ut]!==yn[Ht]){if(Ut!==1||Ht!==1)do if(Ut--,Ht--,Ht<0||ot[Ut]!==yn[Ht]){var zn=`
|
|
13
|
+
`+ot[Ut].replace(" at new "," at ");return U.displayName&&zn.includes("<anonymous>")&&(zn=zn.replace("<anonymous>",U.displayName)),typeof U=="function"&&Ge.set(U,zn),zn}while(Ut>=1&&Ht>=0);break}}}finally{ct=!1,vn.current=At,pt(),Error.prepareStackTrace=Et}var Zn=U?U.displayName||U.name:"",zi=Zn?xt(Zn):"";return typeof U=="function"&&Ge.set(U,zi),zi}function ht(U,de,we){return Ze(U,!1)}function ft(U){var de=U.prototype;return!!(de&&de.isReactComponent)}function mn(U,de,we){if(U==null)return"";if(typeof U=="function")return Ze(U,ft(U));if(typeof U=="string")return xt(U);switch(U){case x:return xt("Suspense");case m:return xt("SuspenseList")}if(typeof U=="object")switch(U.$$typeof){case g:return ht(U.render);case w:return mn(U.type,de,we);case A:{var Qe=U,Et=Qe._payload,At=Qe._init;try{return mn(At(Et),de,we)}catch{}}}return""}var Qt=Object.prototype.hasOwnProperty,Gi={},j=k.ReactDebugCurrentFrame;function z(U){if(U){var de=U._owner,we=mn(U.type,U._source,de?de.type:null);j.setExtraStackFrame(we)}else j.setExtraStackFrame(null)}function G(U,de,we,Qe,Et){{var At=Function.call.bind(Qt);for(var vt in U)if(At(U,vt)){var ot=void 0;try{if(typeof U[vt]!="function"){var yn=Error((Qe||"React class")+": "+we+" type `"+vt+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof U[vt]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw yn.name="Invariant Violation",yn}ot=U[vt](de,vt,Qe,we,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Ut){ot=Ut}ot&&!(ot instanceof Error)&&(z(Et),O("%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).",Qe||"React class",we,vt,typeof ot),z(null)),ot instanceof Error&&!(ot.message in Gi)&&(Gi[ot.message]=!0,z(Et),O("Failed %s type: %s",we,ot.message),z(null))}}}var Se=Array.isArray;function st(U){return Se(U)}function Ve(U){{var de=typeof Symbol=="function"&&Symbol.toStringTag,we=de&&U[Symbol.toStringTag]||U.constructor.name||"Object";return we}}function gn(U){try{return ki(U),!1}catch{return!0}}function ki(U){return""+U}function be(U){if(gn(U))return O("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ve(U)),ki(U)}var at=k.ReactCurrentOwner,ui={key:!0,ref:!0,__self:!0,__source:!0},Dt,et,Te;Te={};function Pe(U){if(Qt.call(U,"ref")){var de=Object.getOwnPropertyDescriptor(U,"ref").get;if(de&&de.isReactWarning)return!1}return U.ref!==void 0}function rt(U){if(Qt.call(U,"key")){var de=Object.getOwnPropertyDescriptor(U,"key").get;if(de&&de.isReactWarning)return!1}return U.key!==void 0}function Lt(U,de){if(typeof U.ref=="string"&&at.current&&de&&at.current.stateNode!==de){var we=me(at.current.type);Te[we]||(O('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',me(at.current.type),U.ref),Te[we]=!0)}}function tt(U,de){{var we=function(){Dt||(Dt=!0,O("%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)",de))};we.isReactWarning=!0,Object.defineProperty(U,"key",{get:we,configurable:!0})}}function an(U,de){{var we=function(){et||(et=!0,O("%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)",de))};we.isReactWarning=!0,Object.defineProperty(U,"ref",{get:we,configurable:!0})}}var Zt=function(U,de,we,Qe,Et,At,vt){var ot={$$typeof:e,type:U,key:de,ref:we,props:vt,_owner:At};return ot._store={},Object.defineProperty(ot._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ot,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Qe}),Object.defineProperty(ot,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Et}),Object.freeze&&(Object.freeze(ot.props),Object.freeze(ot)),ot};function Fn(U,de,we,Qe,Et){{var At,vt={},ot=null,yn=null;we!==void 0&&(be(we),ot=""+we),rt(de)&&(be(de.key),ot=""+de.key),Pe(de)&&(yn=de.ref,Lt(de,Et));for(At in de)Qt.call(de,At)&&!ui.hasOwnProperty(At)&&(vt[At]=de[At]);if(U&&U.defaultProps){var Ut=U.defaultProps;for(At in Ut)vt[At]===void 0&&(vt[At]=Ut[At])}if(ot||yn){var Ht=typeof U=="function"?U.displayName||U.name||"Unknown":U;ot&&tt(vt,Ht),yn&&an(vt,Ht)}return Zt(U,ot,yn,Et,Qe,at.current,vt)}}var nn=k.ReactCurrentOwner,bi=k.ReactDebugCurrentFrame;function qr(U){if(U){var de=U._owner,we=mn(U.type,U._source,de?de.type:null);bi.setExtraStackFrame(we)}else bi.setExtraStackFrame(null)}var Ha;Ha=!1;function Va(U){return typeof U=="object"&&U!==null&&U.$$typeof===e}function Yr(){{if(nn.current){var U=me(nn.current.type);if(U)return`
|
|
14
14
|
|
|
15
|
-
Check the render method of \``+
|
|
15
|
+
Check the render method of \``+U+"`."}return""}}function xi(U){{if(U!==void 0){var de=U.fileName.replace(/^.*[\\\/]/,""),we=U.lineNumber;return`
|
|
16
16
|
|
|
17
|
-
Check your code at `+de+":"+
|
|
17
|
+
Check your code at `+de+":"+we+"."}return""}}var ia={};function Wa(U){{var de=Yr();if(!de){var we=typeof U=="string"?U:U.displayName||U.name;we&&(de=`
|
|
18
18
|
|
|
19
|
-
Check the top-level render call using <`+
|
|
19
|
+
Check the top-level render call using <`+we+">.")}return de}}function ws(U,de){{if(!U._store||U._store.validated||U.key!=null)return;U._store.validated=!0;var we=Wa(de);if(ia[we])return;ia[we]=!0;var Qe="";U&&U._owner&&U._owner!==nn.current&&(Qe=" It was passed a child from "+me(U._owner.type)+"."),qr(U),O('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',we,Qe),qr(null)}}function Xi(U,de){{if(typeof U!="object")return;if(st(U))for(var we=0;we<U.length;we++){var Qe=U[we];Va(Qe)&&ws(Qe,de)}else if(Va(U))U._store&&(U._store.validated=!0);else if(U){var Et=L(U);if(typeof Et=="function"&&Et!==U.entries)for(var At=Et.call(U),vt;!(vt=At.next()).done;)Va(vt.value)&&ws(vt.value,de)}}}function vl(U){{var de=U.type;if(de==null||typeof de=="string")return;var we;if(typeof de=="function")we=de.propTypes;else if(typeof de=="object"&&(de.$$typeof===g||de.$$typeof===w))we=de.propTypes;else return;if(we){var Qe=me(de);G(we,U.props,"prop",Qe,U)}else if(de.PropTypes!==void 0&&!Ha){Ha=!0;var Et=me(de);O("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Et||"Unknown")}typeof de.getDefaultProps=="function"&&!de.getDefaultProps.isReactClassApproved&&O("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ml(U){{for(var de=Object.keys(U.props),we=0;we<de.length;we++){var Qe=de[we];if(Qe!=="children"&&Qe!=="key"){qr(U),O("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Qe),qr(null);break}}U.ref!==null&&(qr(U),O("Invalid attribute `ref` supplied to `React.Fragment`."),qr(null))}}function Qr(U,de,we,Qe,Et,At){{var vt=se(U);if(!vt){var ot="";(U===void 0||typeof U=="object"&&U!==null&&Object.keys(U).length===0)&&(ot+=" 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 yn=xi(Et);yn?ot+=yn:ot+=Yr();var Ut;U===null?Ut="null":st(U)?Ut="array":U!==void 0&&U.$$typeof===e?(Ut="<"+(me(U.type)||"Unknown")+" />",ot=" Did you accidentally export a JSX literal instead of a component?"):Ut=typeof U,O("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Ut,ot)}var Ht=Fn(U,de,we,Et,At);if(Ht==null)return Ht;if(vt){var zn=de.children;if(zn!==void 0)if(Qe)if(st(zn)){for(var Zn=0;Zn<zn.length;Zn++)Xi(zn[Zn],U);Object.freeze&&Object.freeze(zn)}else O("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 Xi(zn,U)}return U===r?ml(Ht):vl(Ht),Ht}}function Ju(U,de,we){return Qr(U,de,we,!0)}function ec(U,de,we){return Qr(U,de,we,!1)}var gl=ec,yl=Ju;wu.Fragment=r,wu.jsx=gl,wu.jsxs=yl}()),wu}var Tu={};/**
|
|
20
20
|
* @license React
|
|
21
21
|
* react-jsx-runtime.production.min.js
|
|
22
22
|
*
|
|
@@ -24,120 +24,120 @@ Check the top-level render call using <`+Te+">.")}return de}}function ks(z,de){{
|
|
|
24
24
|
*
|
|
25
25
|
* This source code is licensed under the MIT license found in the
|
|
26
26
|
* LICENSE file in the root directory of this source tree.
|
|
27
|
-
*/var
|
|
27
|
+
*/var gg;function Vx(){if(gg)return Tu;gg=1;var t=C,e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function h(v,g,x){var m,w={},A=null,P=null;x!==void 0&&(A=""+x),g.key!==void 0&&(A=""+g.key),g.ref!==void 0&&(P=g.ref);for(m in g)r.call(g,m)&&!c.hasOwnProperty(m)&&(w[m]=g[m]);if(v&&v.defaultProps)for(m in g=v.defaultProps,g)w[m]===void 0&&(w[m]=g[m]);return{$$typeof:e,type:v,key:A,ref:P,props:w,_owner:o.current}}return Tu.Fragment=n,Tu.jsx=h,Tu.jsxs=h,Tu}process.env.NODE_ENV==="production"?Gh.exports=Vx():Gh.exports=Hx();var le=Gh.exports,Xh={exports:{}},ff={exports:{}};/*
|
|
28
28
|
object-assign
|
|
29
29
|
(c) Sindre Sorhus
|
|
30
30
|
@license MIT
|
|
31
|
-
*/var
|
|
31
|
+
*/var Kh,yg;function Sg(){if(yg)return Kh;yg=1;var t=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(c){if(c==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(c)}function o(){try{if(!Object.assign)return!1;var c=new String("abc");if(c[5]="de",Object.getOwnPropertyNames(c)[0]==="5")return!1;for(var h={},v=0;v<10;v++)h["_"+String.fromCharCode(v)]=v;var g=Object.getOwnPropertyNames(h).map(function(m){return h[m]});if(g.join("")!=="0123456789")return!1;var x={};return"abcdefghijklmnopqrst".split("").forEach(function(m){x[m]=m}),Object.keys(Object.assign({},x)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Kh=o()?Object.assign:function(c,h){for(var v,g=r(c),x,m=1;m<arguments.length;m++){v=Object(arguments[m]);for(var w in v)e.call(v,w)&&(g[w]=v[w]);if(t){x=t(v);for(var A=0;A<x.length;A++)n.call(v,x[A])&&(g[x[A]]=v[x[A]])}}return g},Kh}var df={exports:{}},Zh={};/** @license React v0.20.2
|
|
32
32
|
* scheduler.development.js
|
|
33
33
|
*
|
|
34
34
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
35
35
|
*
|
|
36
36
|
* This source code is licensed under the MIT license found in the
|
|
37
37
|
* LICENSE file in the root directory of this source tree.
|
|
38
|
-
*/var
|
|
38
|
+
*/var bg;function Wx(){return bg||(bg=1,function(t){process.env.NODE_ENV!=="production"&&function(){var e=!1,n=!1,r,o,c,h,v=typeof performance=="object"&&typeof performance.now=="function";if(v){var g=performance;t.unstable_now=function(){return g.now()}}else{var x=Date,m=x.now();t.unstable_now=function(){return x.now()-m}}if(typeof window>"u"||typeof MessageChannel!="function"){var w=null,A=null,P=function(){if(w!==null)try{var Te=t.unstable_now(),Pe=!0;w(Pe,Te),w=null}catch(rt){throw setTimeout(P,0),rt}};r=function(Te){w!==null?setTimeout(r,0,Te):(w=Te,setTimeout(P,0))},o=function(Te,Pe){A=setTimeout(Te,Pe)},c=function(){clearTimeout(A)},t.unstable_shouldYield=function(){return!1},h=t.unstable_forceFrameRate=function(){}}else{var M=window.setTimeout,_=window.clearTimeout;if(typeof console<"u"){var L=window.requestAnimationFrame,k=window.cancelAnimationFrame;typeof L!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),typeof k!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var O=!1,I=null,q=-1,te=5,H=0;t.unstable_shouldYield=function(){return t.unstable_now()>=H},h=function(){},t.unstable_forceFrameRate=function(Te){if(Te<0||Te>125){console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported");return}Te>0?te=Math.floor(1e3/Te):te=5};var J=function(){if(I!==null){var Te=t.unstable_now();H=Te+te;var Pe=!0;try{var rt=I(Pe,Te);rt?$.postMessage(null):(O=!1,I=null)}catch(Lt){throw $.postMessage(null),Lt}}else O=!1},re=new MessageChannel,$=re.port2;re.port1.onmessage=J,r=function(Te){I=Te,O||(O=!0,$.postMessage(null))},o=function(Te,Pe){q=M(function(){Te(t.unstable_now())},Pe)},c=function(){_(q),q=-1}}function se(Te,Pe){var rt=Te.length;Te.push(Pe),me(Te,Pe,rt)}function ge(Te){var Pe=Te[0];return Pe===void 0?null:Pe}function Ce(Te){var Pe=Te[0];if(Pe!==void 0){var rt=Te.pop();return rt!==Pe&&(Te[0]=rt,Ie(Te,rt,0)),Pe}else return null}function me(Te,Pe,rt){for(var Lt=rt;;){var tt=Lt-1>>>1,an=Te[tt];if(an!==void 0&&_e(an,Pe)>0)Te[tt]=Pe,Te[Lt]=an,Lt=tt;else return}}function Ie(Te,Pe,rt){for(var Lt=rt,tt=Te.length;Lt<tt;){var an=(Lt+1)*2-1,Zt=Te[an],Fn=an+1,nn=Te[Fn];if(Zt!==void 0&&_e(Zt,Pe)<0)nn!==void 0&&_e(nn,Zt)<0?(Te[Lt]=nn,Te[Fn]=Pe,Lt=Fn):(Te[Lt]=Zt,Te[an]=Pe,Lt=an);else if(nn!==void 0&&_e(nn,Pe)<0)Te[Lt]=nn,Te[Fn]=Pe,Lt=Fn;else return}}function _e(Te,Pe){var rt=Te.sortIndex-Pe.sortIndex;return rt!==0?rt:Te.id-Pe.id}var Ye=1,gt=2,Z=3,Ue=4,dt=5;function pe(Te,Pe){}var je=1073741823,He=-1,ut=250,pt=5e3,vn=1e4,Kt=je,xt=[],ct=[],Ge=1,nt=null,Ze=Z,ht=!1,ft=!1,mn=!1;function Qt(Te){for(var Pe=ge(ct);Pe!==null;){if(Pe.callback===null)Ce(ct);else if(Pe.startTime<=Te)Ce(ct),Pe.sortIndex=Pe.expirationTime,se(xt,Pe);else return;Pe=ge(ct)}}function Gi(Te){if(mn=!1,Qt(Te),!ft)if(ge(xt)!==null)ft=!0,r(j);else{var Pe=ge(ct);Pe!==null&&o(Gi,Pe.startTime-Te)}}function j(Te,Pe){ft=!1,mn&&(mn=!1,c()),ht=!0;var rt=Ze;try{var Lt;if(!n)return z(Te,Pe)}finally{nt=null,Ze=rt,ht=!1}}function z(Te,Pe){var rt=Pe;for(Qt(rt),nt=ge(xt);nt!==null&&!e&&!(nt.expirationTime>rt&&(!Te||t.unstable_shouldYield()));){var Lt=nt.callback;if(typeof Lt=="function"){nt.callback=null,Ze=nt.priorityLevel;var tt=nt.expirationTime<=rt,an=Lt(tt);rt=t.unstable_now(),typeof an=="function"?nt.callback=an:nt===ge(xt)&&Ce(xt),Qt(rt)}else Ce(xt);nt=ge(xt)}if(nt!==null)return!0;var Zt=ge(ct);return Zt!==null&&o(Gi,Zt.startTime-rt),!1}function G(Te,Pe){switch(Te){case Ye:case gt:case Z:case Ue:case dt:break;default:Te=Z}var rt=Ze;Ze=Te;try{return Pe()}finally{Ze=rt}}function Se(Te){var Pe;switch(Ze){case Ye:case gt:case Z:Pe=Z;break;default:Pe=Ze;break}var rt=Ze;Ze=Pe;try{return Te()}finally{Ze=rt}}function st(Te){var Pe=Ze;return function(){var rt=Ze;Ze=Pe;try{return Te.apply(this,arguments)}finally{Ze=rt}}}function Ve(Te,Pe,rt){var Lt=t.unstable_now(),tt;if(typeof rt=="object"&&rt!==null){var an=rt.delay;typeof an=="number"&&an>0?tt=Lt+an:tt=Lt}else tt=Lt;var Zt;switch(Te){case Ye:Zt=He;break;case gt:Zt=ut;break;case dt:Zt=Kt;break;case Ue:Zt=vn;break;case Z:default:Zt=pt;break}var Fn=tt+Zt,nn={id:Ge++,callback:Pe,priorityLevel:Te,startTime:tt,expirationTime:Fn,sortIndex:-1};return tt>Lt?(nn.sortIndex=tt,se(ct,nn),ge(xt)===null&&nn===ge(ct)&&(mn?c():mn=!0,o(Gi,tt-Lt))):(nn.sortIndex=Fn,se(xt,nn),!ft&&!ht&&(ft=!0,r(j))),nn}function gn(){}function ki(){!ft&&!ht&&(ft=!0,r(j))}function be(){return ge(xt)}function at(Te){Te.callback=null}function ui(){return Ze}var Dt=h,et=null;t.unstable_IdlePriority=dt,t.unstable_ImmediatePriority=Ye,t.unstable_LowPriority=Ue,t.unstable_NormalPriority=Z,t.unstable_Profiling=et,t.unstable_UserBlockingPriority=gt,t.unstable_cancelCallback=at,t.unstable_continueExecution=ki,t.unstable_getCurrentPriorityLevel=ui,t.unstable_getFirstCallbackNode=be,t.unstable_next=Se,t.unstable_pauseExecution=gn,t.unstable_requestPaint=Dt,t.unstable_runWithPriority=G,t.unstable_scheduleCallback=Ve,t.unstable_wrapCallback=st}()}(Zh)),Zh}var Jh={};/** @license React v0.20.2
|
|
39
39
|
* scheduler.production.min.js
|
|
40
40
|
*
|
|
41
41
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
42
42
|
*
|
|
43
43
|
* This source code is licensed under the MIT license found in the
|
|
44
44
|
* LICENSE file in the root directory of this source tree.
|
|
45
|
-
*/var
|
|
45
|
+
*/var xg;function $x(){return xg||(xg=1,function(t){var e,n,r,o;if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;t.unstable_now=function(){return c.now()}}else{var h=Date,v=h.now();t.unstable_now=function(){return h.now()-v}}if(typeof window>"u"||typeof MessageChannel!="function"){var g=null,x=null,m=function(){if(g!==null)try{var pe=t.unstable_now();g(!0,pe),g=null}catch(je){throw setTimeout(m,0),je}};e=function(pe){g!==null?setTimeout(e,0,pe):(g=pe,setTimeout(m,0))},n=function(pe,je){x=setTimeout(pe,je)},r=function(){clearTimeout(x)},t.unstable_shouldYield=function(){return!1},o=t.unstable_forceFrameRate=function(){}}else{var w=window.setTimeout,A=window.clearTimeout;if(typeof console<"u"){var P=window.cancelAnimationFrame;typeof window.requestAnimationFrame!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),typeof P!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var M=!1,_=null,L=-1,k=5,O=0;t.unstable_shouldYield=function(){return t.unstable_now()>=O},o=function(){},t.unstable_forceFrameRate=function(pe){0>pe||125<pe?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<pe?Math.floor(1e3/pe):5};var I=new MessageChannel,q=I.port2;I.port1.onmessage=function(){if(_!==null){var pe=t.unstable_now();O=pe+k;try{_(!0,pe)?q.postMessage(null):(M=!1,_=null)}catch(je){throw q.postMessage(null),je}}else M=!1},e=function(pe){_=pe,M||(M=!0,q.postMessage(null))},n=function(pe,je){L=w(function(){pe(t.unstable_now())},je)},r=function(){A(L),L=-1}}function te(pe,je){var He=pe.length;pe.push(je);e:for(;;){var ut=He-1>>>1,pt=pe[ut];if(pt!==void 0&&0<re(pt,je))pe[ut]=je,pe[He]=pt,He=ut;else break e}}function H(pe){return pe=pe[0],pe===void 0?null:pe}function J(pe){var je=pe[0];if(je!==void 0){var He=pe.pop();if(He!==je){pe[0]=He;e:for(var ut=0,pt=pe.length;ut<pt;){var vn=2*(ut+1)-1,Kt=pe[vn],xt=vn+1,ct=pe[xt];if(Kt!==void 0&&0>re(Kt,He))ct!==void 0&&0>re(ct,Kt)?(pe[ut]=ct,pe[xt]=He,ut=xt):(pe[ut]=Kt,pe[vn]=He,ut=vn);else if(ct!==void 0&&0>re(ct,He))pe[ut]=ct,pe[xt]=He,ut=xt;else break e}}return je}return null}function re(pe,je){var He=pe.sortIndex-je.sortIndex;return He!==0?He:pe.id-je.id}var $=[],se=[],ge=1,Ce=null,me=3,Ie=!1,_e=!1,Ye=!1;function gt(pe){for(var je=H(se);je!==null;){if(je.callback===null)J(se);else if(je.startTime<=pe)J(se),je.sortIndex=je.expirationTime,te($,je);else break;je=H(se)}}function Z(pe){if(Ye=!1,gt(pe),!_e)if(H($)!==null)_e=!0,e(Ue);else{var je=H(se);je!==null&&n(Z,je.startTime-pe)}}function Ue(pe,je){_e=!1,Ye&&(Ye=!1,r()),Ie=!0;var He=me;try{for(gt(je),Ce=H($);Ce!==null&&(!(Ce.expirationTime>je)||pe&&!t.unstable_shouldYield());){var ut=Ce.callback;if(typeof ut=="function"){Ce.callback=null,me=Ce.priorityLevel;var pt=ut(Ce.expirationTime<=je);je=t.unstable_now(),typeof pt=="function"?Ce.callback=pt:Ce===H($)&&J($),gt(je)}else J($);Ce=H($)}if(Ce!==null)var vn=!0;else{var Kt=H(se);Kt!==null&&n(Z,Kt.startTime-je),vn=!1}return vn}finally{Ce=null,me=He,Ie=!1}}var dt=o;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(pe){pe.callback=null},t.unstable_continueExecution=function(){_e||Ie||(_e=!0,e(Ue))},t.unstable_getCurrentPriorityLevel=function(){return me},t.unstable_getFirstCallbackNode=function(){return H($)},t.unstable_next=function(pe){switch(me){case 1:case 2:case 3:var je=3;break;default:je=me}var He=me;me=je;try{return pe()}finally{me=He}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=dt,t.unstable_runWithPriority=function(pe,je){switch(pe){case 1:case 2:case 3:case 4:case 5:break;default:pe=3}var He=me;me=pe;try{return je()}finally{me=He}},t.unstable_scheduleCallback=function(pe,je,He){var ut=t.unstable_now();switch(typeof He=="object"&&He!==null?(He=He.delay,He=typeof He=="number"&&0<He?ut+He:ut):He=ut,pe){case 1:var pt=-1;break;case 2:pt=250;break;case 5:pt=1073741823;break;case 4:pt=1e4;break;default:pt=5e3}return pt=He+pt,pe={id:ge++,callback:je,priorityLevel:pe,startTime:He,expirationTime:pt,sortIndex:-1},He>ut?(pe.sortIndex=He,te(se,pe),H($)===null&&pe===H(se)&&(Ye?r():Ye=!0,n(Z,He-ut))):(pe.sortIndex=pt,te($,pe),_e||Ie||(_e=!0,e(Ue))),pe},t.unstable_wrapCallback=function(pe){var je=me;return function(){var He=me;me=je;try{return pe.apply(this,arguments)}finally{me=He}}}}(Jh)),Jh}var Eg;function wg(){return Eg||(Eg=1,process.env.NODE_ENV==="production"?df.exports=$x():df.exports=Wx()),df.exports}var hf={exports:{}},ep={};/** @license React v0.20.2
|
|
46
46
|
* scheduler-tracing.development.js
|
|
47
47
|
*
|
|
48
48
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
49
49
|
*
|
|
50
50
|
* This source code is licensed under the MIT license found in the
|
|
51
51
|
* LICENSE file in the root directory of this source tree.
|
|
52
|
-
*/var
|
|
52
|
+
*/var Tg;function qx(){return Tg||(Tg=1,function(t){process.env.NODE_ENV!=="production"&&function(){var e=0,n=0,r=0;t.__interactionsRef=null,t.__subscriberRef=null,t.__interactionsRef={current:new Set},t.__subscriberRef={current:null};function o(O){var I=t.__interactionsRef.current;t.__interactionsRef.current=new Set;try{return O()}finally{t.__interactionsRef.current=I}}function c(){return t.__interactionsRef.current}function h(){return++r}function v(O,I,q){var te=arguments.length>3&&arguments[3]!==void 0?arguments[3]:e,H={__count:1,id:n++,name:O,timestamp:I},J=t.__interactionsRef.current,re=new Set(J);re.add(H),t.__interactionsRef.current=re;var $=t.__subscriberRef.current,se;try{$!==null&&$.onInteractionTraced(H)}finally{try{$!==null&&$.onWorkStarted(re,te)}finally{try{se=q()}finally{t.__interactionsRef.current=J;try{$!==null&&$.onWorkStopped(re,te)}finally{H.__count--,$!==null&&H.__count===0&&$.onInteractionScheduledWorkCompleted(H)}}}}return se}function g(O){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,q=t.__interactionsRef.current,te=t.__subscriberRef.current;te!==null&&te.onWorkScheduled(q,I),q.forEach(function(re){re.__count++});var H=!1;function J(){var re=t.__interactionsRef.current;t.__interactionsRef.current=q,te=t.__subscriberRef.current;try{var $;try{te!==null&&te.onWorkStarted(q,I)}finally{try{$=O.apply(void 0,arguments)}finally{t.__interactionsRef.current=re,te!==null&&te.onWorkStopped(q,I)}}return $}finally{H||(H=!0,q.forEach(function(se){se.__count--,te!==null&&se.__count===0&&te.onInteractionScheduledWorkCompleted(se)}))}}return J.cancel=function(){te=t.__subscriberRef.current;try{te!==null&&te.onWorkCanceled(q,I)}finally{q.forEach(function($){$.__count--,te&&$.__count===0&&te.onInteractionScheduledWorkCompleted($)})}},J}var x=null;x=new Set;function m(O){x.add(O),x.size===1&&(t.__subscriberRef.current={onInteractionScheduledWorkCompleted:P,onInteractionTraced:A,onWorkCanceled:k,onWorkScheduled:M,onWorkStarted:_,onWorkStopped:L})}function w(O){x.delete(O),x.size===0&&(t.__subscriberRef.current=null)}function A(O){var I=!1,q=null;if(x.forEach(function(te){try{te.onInteractionTraced(O)}catch(H){I||(I=!0,q=H)}}),I)throw q}function P(O){var I=!1,q=null;if(x.forEach(function(te){try{te.onInteractionScheduledWorkCompleted(O)}catch(H){I||(I=!0,q=H)}}),I)throw q}function M(O,I){var q=!1,te=null;if(x.forEach(function(H){try{H.onWorkScheduled(O,I)}catch(J){q||(q=!0,te=J)}}),q)throw te}function _(O,I){var q=!1,te=null;if(x.forEach(function(H){try{H.onWorkStarted(O,I)}catch(J){q||(q=!0,te=J)}}),q)throw te}function L(O,I){var q=!1,te=null;if(x.forEach(function(H){try{H.onWorkStopped(O,I)}catch(J){q||(q=!0,te=J)}}),q)throw te}function k(O,I){var q=!1,te=null;if(x.forEach(function(H){try{H.onWorkCanceled(O,I)}catch(J){q||(q=!0,te=J)}}),q)throw te}t.unstable_clear=o,t.unstable_getCurrent=c,t.unstable_getThreadID=h,t.unstable_subscribe=m,t.unstable_trace=v,t.unstable_unsubscribe=w,t.unstable_wrap=g}()}(ep)),ep}var br={};/** @license React v0.20.2
|
|
53
53
|
* scheduler-tracing.production.min.js
|
|
54
54
|
*
|
|
55
55
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
56
56
|
*
|
|
57
57
|
* This source code is licensed under the MIT license found in the
|
|
58
58
|
* LICENSE file in the root directory of this source tree.
|
|
59
|
-
*/var
|
|
59
|
+
*/var Cg;function Yx(){if(Cg)return br;Cg=1;var t=0;return br.__interactionsRef=null,br.__subscriberRef=null,br.unstable_clear=function(e){return e()},br.unstable_getCurrent=function(){return null},br.unstable_getThreadID=function(){return++t},br.unstable_subscribe=function(){},br.unstable_trace=function(e,n,r){return r()},br.unstable_unsubscribe=function(){},br.unstable_wrap=function(e){return e},br}var Rg;function Qx(){return Rg||(Rg=1,process.env.NODE_ENV==="production"?hf.exports=Yx():hf.exports=qx()),hf.exports}/** @license React v0.26.2
|
|
60
60
|
* react-reconciler.development.js
|
|
61
61
|
*
|
|
62
62
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
63
63
|
*
|
|
64
64
|
* This source code is licensed under the MIT license found in the
|
|
65
65
|
* LICENSE file in the root directory of this source tree.
|
|
66
|
-
*/
|
|
67
|
-
`+
|
|
68
|
-
`),D=
|
|
69
|
-
`),F=
|
|
70
|
-
`+A[F].replace(" at new "," at ");return typeof r=="function"&&xo.set(r,X),X}while(F>=1&&$>=0);break}}}finally{Ns=!1,yr.current=b,sr(),Error.prepareStackTrace=v}var J=r?r.displayName||r.name:"",pe=J?kr(J):"";return typeof r=="function"&&xo.set(r,pe),pe}function au(r,s,c){return Ta(r,!0)}function Ra(r,s,c){return Ta(r,!1)}function lh(r){var s=r.prototype;return!!(s&&s.isReactComponent)}function ou(r,s,c){if(r==null)return"";if(typeof r=="function")return Ta(r,lh(r));if(typeof r=="string")return kr(r);switch(r){case ot:return kr("Suspense");case lt:return kr("SuspenseList")}if(typeof r=="object")switch(r.$$typeof){case nt:return Ra(r.render);case Et:return ou(r.type,s,c);case yn:return Ra(r._render);case wt:{var h=r,v=h._payload,b=h._init;try{return ou(b(v),s,c)}catch{}}}return""}var lu={},wo=g.ReactDebugCurrentFrame;function rs(r){if(r){var s=r._owner,c=ou(r.type,r._source,s?s.type:null);wo.setExtraStackFrame(c)}else wo.setExtraStackFrame(null)}function vi(r,s,c,h,v){{var b=Function.call.bind(Object.prototype.hasOwnProperty);for(var w in r)if(b(r,w)){var A=void 0;try{if(typeof r[w]!="function"){var D=Error((h||"React class")+": "+c+" type `"+w+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof r[w]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw D.name="Invariant Violation",D}A=r[w](s,w,h,c,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(F){A=F}A&&!(A instanceof Error)&&(rs(v),m("%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).",h||"React class",c,w,typeof A),rs(null)),A instanceof Error&&!(A.message in lu)&&(lu[A.message]=!0,rs(v),m("Failed %s type: %s",c,A.message),rs(null))}}}var uu=[],zs;zs=[];var br=-1;function Wi(r){return{current:r}}function Ft(r,s){if(br<0){m("Unexpected pop.");return}s!==zs[br]&&m("Unexpected Fiber popped."),r.current=uu[br],uu[br]=null,zs[br]=null,br--}function En(r,s,c){br++,uu[br]=r.current,zs[br]=c,r.current=s}var ss;ss={};var fn={};Object.freeze(fn);var ar=Wi(fn),ri=Wi(!1),cu=fn;function as(r,s,c){return c&&Yn(s)?cu:ar.current}function an(r,s,c){{var h=r.stateNode;h.__reactInternalMemoizedUnmaskedChildContext=s,h.__reactInternalMemoizedMaskedChildContext=c}}function Ir(r,s){{var c=r.type,h=c.contextTypes;if(!h)return fn;var v=r.stateNode;if(v&&v.__reactInternalMemoizedUnmaskedChildContext===s)return v.__reactInternalMemoizedMaskedChildContext;var b={};for(var w in h)b[w]=s[w];{var A=xe(c)||"Unknown";vi(h,b,"context",A)}return v&&an(r,s,b),b}}function qi(){return ri.current}function Yn(r){{var s=r.childContextTypes;return s!=null}}function Oi(r){Ft(ri,r),Ft(ar,r)}function fu(r){Ft(ri,r),Ft(ar,r)}function $c(r,s,c){{if(ar.current!==fn)throw Error("Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.");En(ar,s,r),En(ri,c,r)}}function du(r,s,c){{var h=r.stateNode,v=s.childContextTypes;if(typeof h.getChildContext!="function"){{var b=xe(s)||"Unknown";ss[b]||(ss[b]=!0,m("%s.childContextTypes is specified but there is no getChildContext() method on the instance. You can either define getChildContext() on %s or remove childContextTypes from it.",b,b))}return c}var w=h.getChildContext();for(var A in w)if(!(A in v))throw Error((xe(s)||"Unknown")+'.getChildContext(): key "'+A+'" is not defined in childContextTypes.');{var D=xe(s)||"Unknown";vi(v,w,"child context",D)}return u({},c,w)}}function Co(r){{var s=r.stateNode,c=s&&s.__reactInternalMemoizedMergedChildContext||fn;return cu=ar.current,En(ar,c,r),En(ri,ri.current,r),!0}}function To(r,s,c){{var h=r.stateNode;if(!h)throw Error("Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.");if(c){var v=du(r,s,cu);h.__reactInternalMemoizedMergedChildContext=v,Ft(ri,r),Ft(ar,r),En(ar,v,r),En(ri,c,r)}else Ft(ri,r),En(ri,c,r)}}function Wc(r){{if(!(Pc(r)&&r.tag===_))throw Error("Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.");var s=r;do{switch(s.tag){case k:return s.stateNode.context;case _:{var c=s.type;if(Yn(c))return s.stateNode.__reactInternalMemoizedMergedChildContext;break}}s=s.return}while(s!==null);throw Error("Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.")}}var Us=0,hu=1,Aa=2,si=null,mi=null,qt=!1,Qn=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u";function Bn(r){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")return!1;var s=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(s.isDisabled)return!0;if(!s.supportsFiber)return m("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://reactjs.org/link/react-devtools"),!0;try{si=s.inject(r),mi=s}catch(c){m("React instrumentation encountered an error: %s.",c)}return!0}function pu(r,s){if(mi&&typeof mi.onScheduleFiberRoot=="function")try{mi.onScheduleFiberRoot(si,r,s)}catch(c){qt||(qt=!0,m("React instrumentation encountered an error: %s",c))}}function Ro(r,s){if(mi&&typeof mi.onCommitFiberRoot=="function")try{var c=(r.current.flags&rt)===rt;mo&&mi.onCommitFiberRoot(si,r,s,c)}catch(h){qt||(qt=!0,m("React instrumentation encountered an error: %s",h))}}function gi(r){if(mi&&typeof mi.onCommitFiberUnmount=="function")try{mi.onCommitFiberUnmount(si,r)}catch(s){qt||(qt=!0,m("React instrumentation encountered an error: %s",s))}}var qc=f.unstable_now;if(!(p.__interactionsRef!=null&&p.__interactionsRef.current!=null))throw Error("It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling");var vu=99,os=98,ls=97,Er=96,Ma=95,Ao=90;qc();var js=15,Mo=14,Yc=13,us=12,Oo=11,Fs=10,_o=9,Nr=8,mu=7,Lo=6,Oa=5,Qc=4,Gc=3,Po=2,gu=1,zr=0,uh=31,le=0,Gn=0,Rt=1,Do=2,yu=4,Su=24,ch=32,Yi=192,ai=256,bu=3584,Xc=4096,Bs=4186112,_a=62914560,Hs=33554432,ko=67108864,Kc=134217727,Eu=134217728,xu=805306368,_i=1073741824,on=-1,Zc=zr;function Jc(){return Zc}function ef(r){Zc=r}var Bt=Nr;function Ur(r){if((Rt&r)!==le)return Bt=js,Rt;if((Do&r)!==le)return Bt=Mo,Do;if((yu&r)!==le)return Bt=Yc,yu;var s=Su&r;if(s!==le)return Bt=us,s;if((r&ch)!==le)return Bt=Oo,ch;var c=Yi&r;if(c!==le)return Bt=Fs,c;if((r&ai)!==le)return Bt=_o,ai;var h=bu&r;if(h!==le)return Bt=Nr,h;if((r&Xc)!==le)return Bt=mu,Xc;var v=Bs&r;if(v!==le)return Bt=Lo,v;var b=_a&r;if(b!==le)return Bt=Oa,b;if(r&ko)return Bt=Qc,ko;if((r&Eu)!==le)return Bt=Gc,Eu;var w=xu&r;return w!==le?(Bt=Po,w):(_i&r)!==le?(Bt=gu,_i):(m("Should have found matching lanes. This is a bug in React."),Bt=Nr,r)}function fh(r){switch(r){case vu:return js;case os:return Fs;case ls:case Er:return Nr;case Ma:return Po;default:return zr}}function jr(r){switch(r){case js:case Mo:return vu;case Yc:case us:case Oo:case Fs:return os;case _o:case Nr:case mu:case Lo:case Qc:case Oa:return ls;case Gc:case Po:case gu:return Ma;case zr:return Ao;default:throw Error("Invalid update priority: "+r+". This is a bug in React.")}}function yi(r,s){var c=r.pendingLanes;if(c===le)return Bt=zr,le;var h=le,v=zr,b=r.expiredLanes,w=r.suspendedLanes,A=r.pingedLanes;if(b!==le)h=b,v=Bt=js;else{var D=c&Kc;if(D!==le){var F=D&~w;if(F!==le)h=Ur(F),v=Bt;else{var $=D&A;$!==le&&(h=Ur($),v=Bt)}}else{var X=c&~w;X!==le?(h=Ur(X),v=Bt):A!==le&&(h=Ur(A),v=Bt)}}if(h===le)return le;if(h=c&mh(h),s!==le&&s!==h&&(s&w)===le){Ur(s);var J=Bt;if(v<=J)return s;Bt=v}var pe=r.entangledLanes;if(pe!==le)for(var ye=r.entanglements,Ce=h&pe;Ce>0;){var Ze=cs(Ce),bt=1<<Ze;h|=ye[Ze],Ce&=~bt}return h}function Io(r,s){for(var c=r.eventTimes,h=on;s>0;){var v=cs(s),b=1<<v,w=c[v];w>h&&(h=w),s&=~b}return h}function No(r,s){Ur(r);var c=Bt;return c>=Fs?s+250:c>=Lo?s+5e3:on}function wu(r,s){for(var c=r.pendingLanes,h=r.suspendedLanes,v=r.pingedLanes,b=r.expirationTimes,w=c;w>0;){var A=cs(w),D=1<<A,F=b[A];F===on?((D&h)===le||(D&v)!==le)&&(b[A]=No(D,s)):F<=s&&(r.expiredLanes|=D),w&=~D}}function Cu(r){return Ur(r.pendingLanes)}function tf(r){var s=r.pendingLanes&~_i;return s!==le?s:s&_i?_i:le}function zo(){return Bt}function dh(r){return(r&Kc)!==le}function hh(r){return(r&_a)===r}function nf(r){return(r&Bs)===r}function La(r,s){switch(r){case zr:break;case js:return Rt;case Mo:return Do;case us:{var c=oi(Su&~s);return c===Gn?La(Fs,s):c}case Fs:{var h=oi(Yi&~s);return h===Gn?La(Nr,s):h}case Nr:{var v=oi(bu&~s);return v===Gn&&(v=oi(Bs&~s),v===Gn&&(v=oi(bu))),v}case Lo:case Oa:break;case Po:var b=oi(xu&~s);return b===Gn&&(b=oi(xu)),b}throw Error("Invalid update priority: "+r+". This is a bug in React.")}function Tm(r,s){var c=oi(Bs&~s);return c===Gn&&(c=oi(Bs&~r),c===Gn&&(c=oi(Bs))),c}function ph(r){var s=oi(_a&~r);return s===Gn&&(s=oi(_a)),s}function vh(r){return r&-r}function Rm(r){var s=31-Bo(r);return s<0?le:1<<s}function mh(r){return(Rm(r)<<1)-1}function oi(r){return vh(r)}function cs(r){return 31-Bo(r)}function Am(r){return cs(r)}function Hn(r,s){return(r&s)!==le}function fs(r,s){return(r&s)===s}function At(r,s){return r|s}function Uo(r,s){return r&~s}function Mm(r){return r}function gh(r,s){return r!==Gn&&r<s?r:s}function jo(r){for(var s=[],c=0;c<uh;c++)s.push(r);return s}function Pa(r,s,c){r.pendingLanes|=s;var h=s-1;r.suspendedLanes&=h,r.pingedLanes&=h;var v=r.eventTimes,b=Am(s);v[b]=c}function yh(r,s){r.suspendedLanes|=s,r.pingedLanes&=~s;for(var c=r.expirationTimes,h=s;h>0;){var v=cs(h),b=1<<v;c[v]=on,h&=~b}}function Tu(r,s,c){r.pingedLanes|=r.suspendedLanes&s}function Sh(r,s){r.expiredLanes|=s&r.pendingLanes}function Ru(r){r.expiredLanes|=Su&r.pendingLanes}function Om(r){return(r&Su)!==le}function Fo(r,s){r.mutableReadLanes|=s&r.pendingLanes}function Au(r,s){var c=r.pendingLanes&~s;r.pendingLanes=s,r.suspendedLanes=0,r.pingedLanes=0,r.expiredLanes&=s,r.mutableReadLanes&=s,r.entangledLanes&=s;for(var h=r.entanglements,v=r.eventTimes,b=r.expirationTimes,w=c;w>0;){var A=cs(w),D=1<<A;h[A]=le,v[A]=on,b[A]=on,w&=~D}}function Mu(r,s){r.entangledLanes|=s;for(var c=r.entanglements,h=s;h>0;){var v=cs(h),b=1<<v;c[v]|=s,h&=~b}}var Bo=Math.clz32?Math.clz32:rf,Ou=Math.log,Ho=Math.LN2;function rf(r){return r===0?32:31-(Ou(r)/Ho|0)|0}var sf=f.unstable_runWithPriority,Vo=f.unstable_scheduleCallback,af=f.unstable_cancelCallback,of=f.unstable_shouldYield,$o=f.unstable_requestPaint,lf=f.unstable_now,_m=f.unstable_getCurrentPriorityLevel,Vs=f.unstable_ImmediatePriority,_u=f.unstable_UserBlockingPriority,Lu=f.unstable_NormalPriority,Qe=f.unstable_LowPriority,Xn=f.unstable_IdlePriority;if(!(p.__interactionsRef!=null&&p.__interactionsRef.current!=null))throw Error("It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling");var xn={},Nt=99,Li=98,Qi=97,kn=96,Wo=95,ds=90,qo=of,Da=$o!==void 0?$o:function(){},or=null,ka=null,Yo=!1,Pu=lf(),nn=Pu<1e4?lf:function(){return lf()-Pu};function _e(){switch(_m()){case Vs:return Nt;case _u:return Li;case Lu:return Qi;case Qe:return kn;case Xn:return Wo;default:throw Error("Unknown priority level.")}}function Qo(r){switch(r){case Nt:return Vs;case Li:return _u;case Qi:return Lu;case kn:return Qe;case Wo:return Xn;default:throw Error("Unknown priority level.")}}function lr(r,s){var c=Qo(r);return sf(c,s)}function Vn(r,s,c){var h=Qo(r);return Vo(h,s,c)}function hs(r){return or===null?(or=[r],ka=Vo(Vs,Du)):or.push(r),xn}function Ia(r){r!==xn&&af(r)}function Kn(){if(ka!==null){var r=ka;ka=null,af(r)}Du()}function Du(){if(!Yo&&or!==null){Yo=!0;var r=0;try{var s=!0,c=or;lr(Nt,function(){for(;r<c.length;r++){var h=c[r];do h=h(s);while(h!==null)}}),or=null}catch(h){throw or!==null&&(or=or.slice(r+1)),Vo(Vs,Kn),h}finally{Yo=!1}}}var Yt=0,_t=1,In=2,Fr=4,Zn=8,Br=16,ku=g.ReactCurrentBatchConfig,Go=0;function Xo(){return ku.transition}function Si(r,s){return r===s&&(r!==0||1/r===1/s)||r!==r&&s!==s}var An=typeof Object.is=="function"?Object.is:Si,Hr=Object.prototype.hasOwnProperty;function $s(r,s){if(An(r,s))return!0;if(typeof r!="object"||r===null||typeof s!="object"||s===null)return!1;var c=Object.keys(r),h=Object.keys(s);if(c.length!==h.length)return!1;for(var v=0;v<c.length;v++)if(!Hr.call(s,c[v])||!An(r[c[v]],s[c[v]]))return!1;return!0}function Pi(r){switch(r._debugOwner&&r._debugOwner.type,r._debugSource,r.tag){case P:return kr(r.type);case be:return kr("Lazy");case W:return kr("Suspense");case je:return kr("SuspenseList");case R:case M:case ge:return Ra(r.type);case Z:return Ra(r.type.render);case me:return Ra(r.type._render);case _:return au(r.type);default:return""}}function uf(r){try{var s="",c=r;do s+=Pi(c),c=c.return;while(c);return s}catch(h){return`
|
|
71
|
-
Error generating stack: `+
|
|
72
|
-
`+
|
|
66
|
+
*/ff.exports;var Ag;function Gx(){return Ag||(Ag=1,function(t){process.env.NODE_ENV!=="production"&&(t.exports=function(n){var r={},o=C,c=Sg(),h=wg(),v=Qx(),g=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function x(i){{for(var s=arguments.length,u=new Array(s>1?s-1:0),d=1;d<s;d++)u[d-1]=arguments[d];w("warn",i,u)}}function m(i){{for(var s=arguments.length,u=new Array(s>1?s-1:0),d=1;d<s;d++)u[d-1]=arguments[d];w("error",i,u)}}function w(i,s,u){{var d=g.ReactDebugCurrentFrame,p=d.getStackAddendum();p!==""&&(s+="%s",u=u.concat([p]));var S=u.map(function(E){return""+E});S.unshift("Warning: "+s),Function.prototype.apply.call(console[i],console,S)}}var A=0,P=1,M=2,_=3,L=4,k=5,O=6,I=7,q=8,te=9,H=10,J=11,re=12,$=13,se=14,ge=15,Ce=16,me=17,Ie=18,_e=19,Ye=20,gt=21,Z=22,Ue=23,dt=24;function pe(i){return i._reactInternals}function je(i,s){i._reactInternals=s}var He=60103,ut=60106,pt=60107,vn=60108,Kt=60114,xt=60109,ct=60110,Ge=60112,nt=60113,Ze=60120,ht=60115,ft=60116,mn=60121,Qt=60119,Gi=60129,j=60130,z=60131;if(typeof Symbol=="function"&&Symbol.for){var G=Symbol.for;He=G("react.element"),ut=G("react.portal"),pt=G("react.fragment"),vn=G("react.strict_mode"),Kt=G("react.profiler"),xt=G("react.provider"),ct=G("react.context"),Ge=G("react.forward_ref"),nt=G("react.suspense"),Ze=G("react.suspense_list"),ht=G("react.memo"),ft=G("react.lazy"),mn=G("react.block"),G("react.server.block"),G("react.fundamental"),Qt=G("react.scope"),G("react.opaque.id"),Gi=G("react.debug_trace_mode"),j=G("react.offscreen"),z=G("react.legacy_hidden")}var Se=typeof Symbol=="function"&&Symbol.iterator,st="@@iterator";function Ve(i){if(i===null||typeof i!="object")return null;var s=Se&&i[Se]||i[st];return typeof s=="function"?s:null}function gn(i,s,u){var d=s.displayName||s.name||"";return i.displayName||(d!==""?u+"("+d+")":u)}function ki(i){return i.displayName||"Context"}function be(i){if(i==null)return null;if(typeof i.tag=="number"&&m("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case pt:return"Fragment";case ut:return"Portal";case Kt:return"Profiler";case vn:return"StrictMode";case nt:return"Suspense";case Ze:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case ct:var s=i;return ki(s)+".Consumer";case xt:var u=i;return ki(u._context)+".Provider";case Ge:return gn(i,i.render,"ForwardRef");case ht:return be(i.type);case mn:return be(i._render);case ft:{var d=i,p=d._payload,S=d._init;try{return be(S(p))}catch{return null}}}return null}var at=0,ui=1,Dt=2,et=4,Te=6,Pe=8,rt=16,Lt=32,tt=64,an=128,Zt=256,Fn=512,nn=8192,bi=1024,qr=1028,Ha=932,Va=2047,Yr=2048,xi=4096,ia=16384,Wa=!0,ws=!1,Xi=!1,vl=!1,ml=g.ReactCurrentOwner;function Qr(i){var s=i,u=i;if(i.alternate)for(;s.return;)s=s.return;else{var d=s;do s=d,(s.flags&(Dt|bi))!==at&&(u=s.return),d=s.return;while(d)}return s.tag===_?u:null}function Ju(i){return Qr(i)===i}function ec(i){{var s=ml.current;if(s!==null&&s.tag===P){var u=s,d=u.stateNode;d._warnedAboutRefsInRender||m("%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.",be(u.type)||"A component"),d._warnedAboutRefsInRender=!0}}var p=pe(i);return p?Qr(p)===p:!1}function gl(i){if(Qr(i)!==i)throw Error("Unable to find node on an unmounted component.")}function yl(i){var s=i.alternate;if(!s){var u=Qr(i);if(u===null)throw Error("Unable to find node on an unmounted component.");return u!==i?null:i}for(var d=i,p=s;;){var S=d.return;if(S===null)break;var E=S.alternate;if(E===null){var R=S.return;if(R!==null){d=p=R;continue}break}if(S.child===E.child){for(var D=S.child;D;){if(D===d)return gl(S),i;if(D===p)return gl(S),s;D=D.sibling}throw Error("Unable to find node on an unmounted component.")}if(d.return!==p.return)d=S,p=E;else{for(var F=!1,W=S.child;W;){if(W===d){F=!0,d=S,p=E;break}if(W===p){F=!0,p=S,d=E;break}W=W.sibling}if(!F){for(W=E.child;W;){if(W===d){F=!0,d=E,p=S;break}if(W===p){F=!0,p=E,d=S;break}W=W.sibling}if(!F)throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.")}}if(d.alternate!==p)throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.")}if(d.tag!==_)throw Error("Unable to find node on an unmounted component.");return d.stateNode.current===d?i:s}function U(i){var s=yl(i);if(!s)return null;for(var u=s;;){if(u.tag===k||u.tag===O)return u;if(u.child){u.child.return=u,u=u.child;continue}if(u===s)return null;for(;!u.sibling;){if(!u.return||u.return===s)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}function de(i){var s=yl(i);if(!s)return null;for(var u=s;;){if(u.tag===k||u.tag===O||ws)return u;if(u.child&&u.tag!==L){u.child.return=u,u=u.child;continue}if(u===s)return null;for(;!u.sibling;){if(!u.return||u.return===s)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}function we(i,s){for(var u=s,d=i.alternate;u!==null;){if(u===i||u===d)return!0;u=u.return}return!1}var Qe=n.getPublicInstance,Et=n.getRootHostContext,At=n.getChildHostContext,vt=n.prepareForCommit,ot=n.resetAfterCommit,yn=n.createInstance,Ut=n.appendInitialChild,Ht=n.finalizeInitialChildren,zn=n.prepareUpdate,Zn=n.shouldSetTextContent,zi=n.createTextInstance,mt=n.scheduleTimeout,on=n.cancelTimeout,ur=n.noTimeout;n.now;var ln=n.isPrimaryRenderer,Bn=n.warnsIfNotActing,Nn=n.supportsMutation,cr=n.supportsPersistence,Jt=n.supportsHydration;n.getFundamentalComponentInstance,n.mountFundamentalComponent,n.shouldUpdateFundamentalComponent;var Sl=n.getInstanceFromNode;n.isOpaqueHydratingObject;var Sd=n.makeOpaqueHydratingObject;n.makeClientId;var bd=n.makeClientIdInDEV,$a=n.beforeActiveInstanceBlur,xd=n.afterActiveInstanceBlur,tc=n.preparePortalMount;n.preparePortalMount,n.getInstanceFromScope;var Ni=n.supportsTestSelectors,ov=n.findFiberRoot,bl=n.getBoundingRect,Vt=n.getTextContent,Ki=n.isHiddenSubtree,lv=n.matchAccessibilityRole,uv=n.setFocusIfFocusable,qa=n.setupIntersectionObserver,Ed=n.appendChild,xl=n.appendChildToContainer,ra=n.commitTextUpdate,nc=n.commitMount,El=n.commitUpdate,Gr=n.insertBefore,cv=n.insertInContainerBefore,fv=n.removeChild,dv=n.removeChildFromContainer,wd=n.resetTextContent,ic=n.hideInstance,rc=n.hideTextInstance,hv=n.unhideInstance,Td=n.unhideTextInstance;n.updateFundamentalComponent,n.unmountFundamentalComponent;var Ya=n.clearContainer,pv=n.cloneInstance,Qa=n.createContainerChildSet,sc=n.appendChildToContainerChildSet,Cd=n.finalizeContainerChildren,ac=n.replaceContainerChildren,oc=n.cloneHiddenInstance,wl=n.cloneHiddenTextInstance;n.cloneInstance;var vv=n.canHydrateInstance,Tr=n.canHydrateTextInstance;n.canHydrateSuspenseInstance;var Tl=n.isSuspenseInstancePending,lc=n.isSuspenseInstanceFallback;n.registerSuspenseInstanceRetry;var Cl=n.getNextHydratableSibling,On=n.getFirstHydratableChild,sa=n.hydrateInstance,Rd=n.hydrateTextInstance;n.hydrateSuspenseInstance;var Cr=n.getNextHydratableInstanceAfterSuspenseInstance,aa=n.commitHydratedContainer,_i=n.commitHydratedSuspenseInstance;n.clearSuspenseBoundary,n.clearSuspenseBoundaryFromContainer;var Ad=n.didNotMatchHydratedContainerTextInstance,mv=n.didNotMatchHydratedTextInstance,gv=n.didNotHydrateContainerInstance,Ui=n.didNotHydrateInstance,yv=n.didNotFindHydratableContainerInstance,Rl=n.didNotFindHydratableContainerTextInstance,Sv=n.didNotFindHydratableContainerSuspenseInstance,Zi=n.didNotFindHydratableInstance,Al=n.didNotFindHydratableTextInstance,Ml=n.didNotFindHydratableSuspenseInstance,fr=0,Ga,Ol,uc,Dl,cc,Ts,Ei;function Rr(){}Rr.__reactDisabledLog=!0;function ji(){{if(fr===0){Ga=console.log,Ol=console.info,uc=console.warn,Dl=console.error,cc=console.group,Ts=console.groupCollapsed,Ei=console.groupEnd;var i={configurable:!0,enumerable:!0,value:Rr,writable:!0};Object.defineProperties(console,{info:i,log:i,warn:i,error:i,group:i,groupCollapsed:i,groupEnd:i})}fr++}}function Ji(){{if(fr--,fr===0){var i={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:c({},i,{value:Ga}),info:c({},i,{value:Ol}),warn:c({},i,{value:uc}),error:c({},i,{value:Dl}),group:c({},i,{value:cc}),groupCollapsed:c({},i,{value:Ts}),groupEnd:c({},i,{value:Ei})})}fr<0&&m("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var dr=g.ReactCurrentDispatcher,hr;function Ar(i,s,u){{if(hr===void 0)try{throw Error()}catch(p){var d=p.stack.trim().match(/\n( *(at )?)/);hr=d&&d[1]||""}return`
|
|
67
|
+
`+hr+i}}var Cs=!1,Xa;{var Md=typeof WeakMap=="function"?WeakMap:Map;Xa=new Md}function oa(i,s){if(!i||Cs)return"";{var u=Xa.get(i);if(u!==void 0)return u}var d;Cs=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var S;S=dr.current,dr.current=null,ji();try{if(s){var E=function(){throw Error()};if(Object.defineProperty(E.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(E,[])}catch(ye){d=ye}Reflect.construct(i,[],E)}else{try{E.call()}catch(ye){d=ye}i.call(E.prototype)}}else{try{throw Error()}catch(ye){d=ye}i()}}catch(ye){if(ye&&d&&typeof ye.stack=="string"){for(var R=ye.stack.split(`
|
|
68
|
+
`),D=d.stack.split(`
|
|
69
|
+
`),F=R.length-1,W=D.length-1;F>=1&&W>=0&&R[F]!==D[W];)W--;for(;F>=1&&W>=0;F--,W--)if(R[F]!==D[W]){if(F!==1||W!==1)do if(F--,W--,W<0||R[F]!==D[W]){var X=`
|
|
70
|
+
`+R[F].replace(" at new "," at ");return typeof i=="function"&&Xa.set(i,X),X}while(F>=1&&W>=0);break}}}finally{Cs=!1,dr.current=S,Ji(),Error.prepareStackTrace=p}var ee=i?i.displayName||i.name:"",he=ee?Ar(ee):"";return typeof i=="function"&&Xa.set(i,he),he}function Ll(i,s,u){return oa(i,!0)}function la(i,s,u){return oa(i,!1)}function Od(i){var s=i.prototype;return!!(s&&s.isReactComponent)}function Pl(i,s,u){if(i==null)return"";if(typeof i=="function")return oa(i,Od(i));if(typeof i=="string")return Ar(i);switch(i){case nt:return Ar("Suspense");case Ze:return Ar("SuspenseList")}if(typeof i=="object")switch(i.$$typeof){case Ge:return la(i.render);case ht:return Pl(i.type,s,u);case mn:return la(i._render);case ft:{var d=i,p=d._payload,S=d._init;try{return Pl(S(p),s,u)}catch{}}}return""}var kl={},Ka=g.ReactDebugCurrentFrame;function Xr(i){if(i){var s=i._owner,u=Pl(i.type,i._source,s?s.type:null);Ka.setExtraStackFrame(u)}else Ka.setExtraStackFrame(null)}function ci(i,s,u,d,p){{var S=Function.call.bind(Object.prototype.hasOwnProperty);for(var E in i)if(S(i,E)){var R=void 0;try{if(typeof i[E]!="function"){var D=Error((d||"React class")+": "+u+" type `"+E+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[E]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw D.name="Invariant Violation",D}R=i[E](s,E,d,u,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(F){R=F}R&&!(R instanceof Error)&&(Xr(p),m("%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).",d||"React class",u,E,typeof R),Xr(null)),R instanceof Error&&!(R.message in kl)&&(kl[R.message]=!0,Xr(p),m("Failed %s type: %s",u,R.message),Xr(null))}}}var zl=[],Rs;Rs=[];var pr=-1;function Ii(i){return{current:i}}function jt(i,s){if(pr<0){m("Unexpected pop.");return}s!==Rs[pr]&&m("Unexpected Fiber popped."),i.current=zl[pr],zl[pr]=null,Rs[pr]=null,pr--}function Sn(i,s,u){pr++,zl[pr]=i.current,Rs[pr]=u,i.current=s}var Kr;Kr={};var un={};Object.freeze(un);var er=Ii(un),Jn=Ii(!1),Nl=un;function Zr(i,s,u){return u&&Hn(s)?Nl:er.current}function rn(i,s,u){{var d=i.stateNode;d.__reactInternalMemoizedUnmaskedChildContext=s,d.__reactInternalMemoizedMaskedChildContext=u}}function Mr(i,s){{var u=i.type,d=u.contextTypes;if(!d)return un;var p=i.stateNode;if(p&&p.__reactInternalMemoizedUnmaskedChildContext===s)return p.__reactInternalMemoizedMaskedChildContext;var S={};for(var E in d)S[E]=s[E];{var R=be(u)||"Unknown";ci(d,S,"context",R)}return p&&rn(i,s,S),S}}function Fi(){return Jn.current}function Hn(i){{var s=i.childContextTypes;return s!=null}}function wi(i){jt(Jn,i),jt(er,i)}function _l(i){jt(Jn,i),jt(er,i)}function fc(i,s,u){{if(er.current!==un)throw Error("Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.");Sn(er,s,i),Sn(Jn,u,i)}}function Ul(i,s,u){{var d=i.stateNode,p=s.childContextTypes;if(typeof d.getChildContext!="function"){{var S=be(s)||"Unknown";Kr[S]||(Kr[S]=!0,m("%s.childContextTypes is specified but there is no getChildContext() method on the instance. You can either define getChildContext() on %s or remove childContextTypes from it.",S,S))}return u}var E=d.getChildContext();for(var R in E)if(!(R in p))throw Error((be(s)||"Unknown")+'.getChildContext(): key "'+R+'" is not defined in childContextTypes.');{var D=be(s)||"Unknown";ci(p,E,"child context",D)}return c({},u,E)}}function Za(i){{var s=i.stateNode,u=s&&s.__reactInternalMemoizedMergedChildContext||un;return Nl=er.current,Sn(er,u,i),Sn(Jn,Jn.current,i),!0}}function Ja(i,s,u){{var d=i.stateNode;if(!d)throw Error("Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.");if(u){var p=Ul(i,s,Nl);d.__reactInternalMemoizedMergedChildContext=p,jt(Jn,i),jt(er,i),Sn(er,p,i),Sn(Jn,u,i)}else jt(Jn,i),Sn(Jn,u,i)}}function dc(i){{if(!(Ju(i)&&i.tag===P))throw Error("Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.");var s=i;do{switch(s.tag){case _:return s.stateNode.context;case P:{var u=s.type;if(Hn(u))return s.stateNode.__reactInternalMemoizedMergedChildContext;break}}s=s.return}while(s!==null);throw Error("Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.")}}var As=0,jl=1,ua=2,ei=null,fi=null,Wt=!1,Vn=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u";function _n(i){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")return!1;var s=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(s.isDisabled)return!0;if(!s.supportsFiber)return m("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://reactjs.org/link/react-devtools"),!0;try{ei=s.inject(i),fi=s}catch(u){m("React instrumentation encountered an error: %s.",u)}return!0}function Il(i,s){if(fi&&typeof fi.onScheduleFiberRoot=="function")try{fi.onScheduleFiberRoot(ei,i,s)}catch(u){Wt||(Wt=!0,m("React instrumentation encountered an error: %s",u))}}function eo(i,s){if(fi&&typeof fi.onCommitFiberRoot=="function")try{var u=(i.current.flags&tt)===tt;Wa&&fi.onCommitFiberRoot(ei,i,s,u)}catch(d){Wt||(Wt=!0,m("React instrumentation encountered an error: %s",d))}}function di(i){if(fi&&typeof fi.onCommitFiberUnmount=="function")try{fi.onCommitFiberUnmount(ei,i)}catch(s){Wt||(Wt=!0,m("React instrumentation encountered an error: %s",s))}}var hc=h.unstable_now;if(!(v.__interactionsRef!=null&&v.__interactionsRef.current!=null))throw Error("It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling");var Fl=99,Jr=98,es=97,vr=96,ca=95,to=90;hc();var Ms=15,no=14,pc=13,ts=12,io=11,Os=10,ro=9,Or=8,Bl=7,so=6,fa=5,vc=4,mc=3,ao=2,Hl=1,Dr=0,Dd=31,ue=0,Wn=0,Tt=1,oo=2,Vl=4,Wl=24,Ld=32,Bi=192,ti=256,$l=3584,gc=4096,Ds=4186112,da=62914560,Ls=33554432,lo=67108864,yc=134217727,ql=134217728,Yl=805306368,Ti=1073741824,sn=-1,Sc=Dr;function bc(){return Sc}function xc(i){Sc=i}var It=Or;function Lr(i){if((Tt&i)!==ue)return It=Ms,Tt;if((oo&i)!==ue)return It=no,oo;if((Vl&i)!==ue)return It=pc,Vl;var s=Wl&i;if(s!==ue)return It=ts,s;if((i&Ld)!==ue)return It=io,Ld;var u=Bi&i;if(u!==ue)return It=Os,u;if((i&ti)!==ue)return It=ro,ti;var d=$l&i;if(d!==ue)return It=Or,d;if((i&gc)!==ue)return It=Bl,gc;var p=Ds&i;if(p!==ue)return It=so,p;var S=da&i;if(S!==ue)return It=fa,S;if(i&lo)return It=vc,lo;if((i&ql)!==ue)return It=mc,ql;var E=Yl&i;return E!==ue?(It=ao,E):(Ti&i)!==ue?(It=Hl,Ti):(m("Should have found matching lanes. This is a bug in React."),It=Or,i)}function Pd(i){switch(i){case Fl:return Ms;case Jr:return Os;case es:case vr:return Or;case ca:return ao;default:return Dr}}function Pr(i){switch(i){case Ms:case no:return Fl;case pc:case ts:case io:case Os:return Jr;case ro:case Or:case Bl:case so:case vc:case fa:return es;case mc:case ao:case Hl:return ca;case Dr:return to;default:throw Error("Invalid update priority: "+i+". This is a bug in React.")}}function hi(i,s){var u=i.pendingLanes;if(u===ue)return It=Dr,ue;var d=ue,p=Dr,S=i.expiredLanes,E=i.suspendedLanes,R=i.pingedLanes;if(S!==ue)d=S,p=It=Ms;else{var D=u&yc;if(D!==ue){var F=D&~E;if(F!==ue)d=Lr(F),p=It;else{var W=D&R;W!==ue&&(d=Lr(W),p=It)}}else{var X=u&~E;X!==ue?(d=Lr(X),p=It):R!==ue&&(d=Lr(R),p=It)}}if(d===ue)return ue;if(d=u&Ud(d),s!==ue&&s!==d&&(s&E)===ue){Lr(s);var ee=It;if(p<=ee)return s;It=p}var he=i.entangledLanes;if(he!==ue)for(var ye=i.entanglements,Ee=d&he;Ee>0;){var Xe=ns(Ee),St=1<<Xe;d|=ye[Xe],Ee&=~St}return d}function uo(i,s){for(var u=i.eventTimes,d=sn;s>0;){var p=ns(s),S=1<<p,E=u[p];E>d&&(d=E),s&=~S}return d}function co(i,s){Lr(i);var u=It;return u>=Os?s+250:u>=so?s+5e3:sn}function Ql(i,s){for(var u=i.pendingLanes,d=i.suspendedLanes,p=i.pingedLanes,S=i.expirationTimes,E=u;E>0;){var R=ns(E),D=1<<R,F=S[R];F===sn?((D&d)===ue||(D&p)!==ue)&&(S[R]=co(D,s)):F<=s&&(i.expiredLanes|=D),E&=~D}}function Gl(i){return Lr(i.pendingLanes)}function Ec(i){var s=i.pendingLanes&~Ti;return s!==ue?s:s&Ti?Ti:ue}function fo(){return It}function kd(i){return(i&yc)!==ue}function zd(i){return(i&da)===i}function wc(i){return(i&Ds)===i}function ha(i,s){switch(i){case Dr:break;case Ms:return Tt;case no:return oo;case ts:{var u=ni(Wl&~s);return u===Wn?ha(Os,s):u}case Os:{var d=ni(Bi&~s);return d===Wn?ha(Or,s):d}case Or:{var p=ni($l&~s);return p===Wn&&(p=ni(Ds&~s),p===Wn&&(p=ni($l))),p}case so:case fa:break;case ao:var S=ni(Yl&~s);return S===Wn&&(S=ni(Yl)),S}throw Error("Invalid update priority: "+i+". This is a bug in React.")}function bv(i,s){var u=ni(Ds&~s);return u===Wn&&(u=ni(Ds&~i),u===Wn&&(u=ni(Ds))),u}function Nd(i){var s=ni(da&~i);return s===Wn&&(s=ni(da)),s}function _d(i){return i&-i}function xv(i){var s=31-mo(i);return s<0?ue:1<<s}function Ud(i){return(xv(i)<<1)-1}function ni(i){return _d(i)}function ns(i){return 31-mo(i)}function Ev(i){return ns(i)}function Un(i,s){return(i&s)!==ue}function is(i,s){return(i&s)===s}function Ct(i,s){return i|s}function ho(i,s){return i&~s}function wv(i){return i}function jd(i,s){return i!==Wn&&i<s?i:s}function po(i){for(var s=[],u=0;u<Dd;u++)s.push(i);return s}function pa(i,s,u){i.pendingLanes|=s;var d=s-1;i.suspendedLanes&=d,i.pingedLanes&=d;var p=i.eventTimes,S=Ev(s);p[S]=u}function Id(i,s){i.suspendedLanes|=s,i.pingedLanes&=~s;for(var u=i.expirationTimes,d=s;d>0;){var p=ns(d),S=1<<p;u[p]=sn,d&=~S}}function Xl(i,s,u){i.pingedLanes|=i.suspendedLanes&s}function Fd(i,s){i.expiredLanes|=s&i.pendingLanes}function Kl(i){i.expiredLanes|=Wl&i.pendingLanes}function Tv(i){return(i&Wl)!==ue}function vo(i,s){i.mutableReadLanes|=s&i.pendingLanes}function Zl(i,s){var u=i.pendingLanes&~s;i.pendingLanes=s,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=s,i.mutableReadLanes&=s,i.entangledLanes&=s;for(var d=i.entanglements,p=i.eventTimes,S=i.expirationTimes,E=u;E>0;){var R=ns(E),D=1<<R;d[R]=ue,p[R]=sn,S[R]=sn,E&=~D}}function Jl(i,s){i.entangledLanes|=s;for(var u=i.entanglements,d=s;d>0;){var p=ns(d),S=1<<p;u[p]|=s,d&=~S}}var mo=Math.clz32?Math.clz32:Tc,eu=Math.log,go=Math.LN2;function Tc(i){return i===0?32:31-(eu(i)/go|0)|0}var Cc=h.unstable_runWithPriority,yo=h.unstable_scheduleCallback,Rc=h.unstable_cancelCallback,Ac=h.unstable_shouldYield,So=h.unstable_requestPaint,Mc=h.unstable_now,Cv=h.unstable_getCurrentPriorityLevel,Ps=h.unstable_ImmediatePriority,tu=h.unstable_UserBlockingPriority,nu=h.unstable_NormalPriority,qe=h.unstable_LowPriority,$n=h.unstable_IdlePriority;if(!(v.__interactionsRef!=null&&v.__interactionsRef.current!=null))throw Error("It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling");var bn={},zt=99,Ci=98,Hi=97,Dn=96,bo=95,rs=90,xo=Ac,va=So!==void 0?So:function(){},tr=null,ma=null,Eo=!1,iu=Mc(),en=iu<1e4?Mc:function(){return Mc()-iu};function Oe(){switch(Cv()){case Ps:return zt;case tu:return Ci;case nu:return Hi;case qe:return Dn;case $n:return bo;default:throw Error("Unknown priority level.")}}function wo(i){switch(i){case zt:return Ps;case Ci:return tu;case Hi:return nu;case Dn:return qe;case bo:return $n;default:throw Error("Unknown priority level.")}}function nr(i,s){var u=wo(i);return Cc(u,s)}function jn(i,s,u){var d=wo(i);return yo(d,s,u)}function ss(i){return tr===null?(tr=[i],ma=yo(Ps,ru)):tr.push(i),bn}function ga(i){i!==bn&&Rc(i)}function qn(){if(ma!==null){var i=ma;ma=null,Rc(i)}ru()}function ru(){if(!Eo&&tr!==null){Eo=!0;var i=0;try{var s=!0,u=tr;nr(zt,function(){for(;i<u.length;i++){var d=u[i];do d=d(s);while(d!==null)}}),tr=null}catch(d){throw tr!==null&&(tr=tr.slice(i+1)),yo(Ps,qn),d}finally{Eo=!1}}}var $t=0,Mt=1,Ln=2,kr=4,Yn=8,zr=16,su=g.ReactCurrentBatchConfig,To=0;function Co(){return su.transition}function pi(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var Cn=typeof Object.is=="function"?Object.is:pi,Nr=Object.prototype.hasOwnProperty;function ks(i,s){if(Cn(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var u=Object.keys(i),d=Object.keys(s);if(u.length!==d.length)return!1;for(var p=0;p<u.length;p++)if(!Nr.call(s,u[p])||!Cn(i[u[p]],s[u[p]]))return!1;return!0}function Ri(i){switch(i._debugOwner&&i._debugOwner.type,i._debugSource,i.tag){case k:return Ar(i.type);case Ce:return Ar("Lazy");case $:return Ar("Suspense");case _e:return Ar("SuspenseList");case A:case M:case ge:return la(i.type);case J:return la(i.type.render);case Z:return la(i.type._render);case P:return Ll(i.type);default:return""}}function Oc(i){try{var s="",u=i;do s+=Ri(u),u=u.return;while(u);return s}catch(d){return`
|
|
71
|
+
Error generating stack: `+d.message+`
|
|
72
|
+
`+d.stack}}var zs=g.ReactDebugCurrentFrame,Qn=null,ya=!1;function Bd(){{if(Qn===null)return null;var i=Qn._debugOwner;if(i!==null&&typeof i<"u")return be(i.type)}return null}function Hd(){return Qn===null?"":Oc(Qn)}function In(){zs.getCurrentStack=null,Qn=null,ya=!1}function xn(i){zs.getCurrentStack=Hd,Qn=i,ya=!1}function ii(i){ya=i}function Vd(){return ya}var Vi={recordUnsafeLifecycleWarnings:function(i,s){},flushPendingUnsafeLifecycleWarnings:function(){},recordLegacyContextWarning:function(i,s){},flushLegacyContextWarning:function(){},discardPendingWarnings:function(){}};{var Ro=function(i){for(var s=null,u=i;u!==null;)u.mode&Mt&&(s=u),u=u.return;return s},Ns=function(i){var s=[];return i.forEach(function(u){s.push(u)}),s.sort().join(", ")},Ao=[],Sa=[],ba=[],ir=[],Mo=[],Oo=[],ri=new Set;Vi.recordUnsafeLifecycleWarnings=function(i,s){ri.has(i.type)||(typeof s.componentWillMount=="function"&&s.componentWillMount.__suppressDeprecationWarning!==!0&&Ao.push(i),i.mode&Mt&&typeof s.UNSAFE_componentWillMount=="function"&&Sa.push(i),typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps.__suppressDeprecationWarning!==!0&&ba.push(i),i.mode&Mt&&typeof s.UNSAFE_componentWillReceiveProps=="function"&&ir.push(i),typeof s.componentWillUpdate=="function"&&s.componentWillUpdate.__suppressDeprecationWarning!==!0&&Mo.push(i),i.mode&Mt&&typeof s.UNSAFE_componentWillUpdate=="function"&&Oo.push(i))},Vi.flushPendingUnsafeLifecycleWarnings=function(){var i=new Set;Ao.length>0&&(Ao.forEach(function(ee){i.add(be(ee.type)||"Component"),ri.add(ee.type)}),Ao=[]);var s=new Set;Sa.length>0&&(Sa.forEach(function(ee){s.add(be(ee.type)||"Component"),ri.add(ee.type)}),Sa=[]);var u=new Set;ba.length>0&&(ba.forEach(function(ee){u.add(be(ee.type)||"Component"),ri.add(ee.type)}),ba=[]);var d=new Set;ir.length>0&&(ir.forEach(function(ee){d.add(be(ee.type)||"Component"),ri.add(ee.type)}),ir=[]);var p=new Set;Mo.length>0&&(Mo.forEach(function(ee){p.add(be(ee.type)||"Component"),ri.add(ee.type)}),Mo=[]);var S=new Set;if(Oo.length>0&&(Oo.forEach(function(ee){S.add(be(ee.type)||"Component"),ri.add(ee.type)}),Oo=[]),s.size>0){var E=Ns(s);m(`Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.
|
|
73
73
|
|
|
74
74
|
* Move code with side effects to componentDidMount, and set initial state in the constructor.
|
|
75
75
|
|
|
76
|
-
Please update the following components: %s`,
|
|
76
|
+
Please update the following components: %s`,E)}if(d.size>0){var R=Ns(d);m(`Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.
|
|
77
77
|
|
|
78
78
|
* Move data fetching code or side effects to componentDidUpdate.
|
|
79
79
|
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state
|
|
80
80
|
|
|
81
|
-
Please update the following components: %s`,
|
|
81
|
+
Please update the following components: %s`,R)}if(S.size>0){var D=Ns(S);m(`Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.
|
|
82
82
|
|
|
83
83
|
* Move data fetching code or side effects to componentDidUpdate.
|
|
84
84
|
|
|
85
|
-
Please update the following components: %s`,D)}if(
|
|
85
|
+
Please update the following components: %s`,D)}if(i.size>0){var F=Ns(i);x(`componentWillMount has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.
|
|
86
86
|
|
|
87
87
|
* Move code with side effects to componentDidMount, and set initial state in the constructor.
|
|
88
88
|
* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
|
|
89
89
|
|
|
90
|
-
Please update the following components: %s`,F)}if(
|
|
90
|
+
Please update the following components: %s`,F)}if(u.size>0){var W=Ns(u);x(`componentWillReceiveProps has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.
|
|
91
91
|
|
|
92
92
|
* Move data fetching code or side effects to componentDidUpdate.
|
|
93
93
|
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state
|
|
94
94
|
* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
|
|
95
95
|
|
|
96
|
-
Please update the following components: %s
|
|
96
|
+
Please update the following components: %s`,W)}if(p.size>0){var X=Ns(p);x(`componentWillUpdate has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.
|
|
97
97
|
|
|
98
98
|
* Move data fetching code or side effects to componentDidUpdate.
|
|
99
99
|
* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
|
|
100
100
|
|
|
101
|
-
Please update the following components: %s`,X)}};var
|
|
101
|
+
Please update the following components: %s`,X)}};var au=new Map,Dc=new Set;Vi.recordLegacyContextWarning=function(i,s){var u=Ro(i);if(u===null){m("Expected to find a StrictMode component in a strict mode tree. This error is likely caused by a bug in React. Please file an issue.");return}if(!Dc.has(i.type)){var d=au.get(u);(i.type.contextTypes!=null||i.type.childContextTypes!=null||s!==null&&typeof s.getChildContext=="function")&&(d===void 0&&(d=[],au.set(u,d)),d.push(i))}},Vi.flushLegacyContextWarning=function(){au.forEach(function(i,s){if(i.length!==0){var u=i[0],d=new Set;i.forEach(function(S){d.add(be(S.type)||"Component"),Dc.add(S.type)});var p=Ns(d);try{xn(u),m(`Legacy context API has been detected within a strict-mode tree.
|
|
102
102
|
|
|
103
103
|
The old API will be supported in all 16.x releases, but applications using it should migrate to the new version.
|
|
104
104
|
|
|
105
105
|
Please update the following components: %s
|
|
106
106
|
|
|
107
|
-
Learn more about this warning here: https://reactjs.org/link/legacy-context`,v)}finally{$n()}}})},Gi.discardPendingWarnings=function(){Zo=[],za=[],Ua=[],ur=[],Jo=[],el=[],Iu=new Map}}function cr(r,s){if(r&&r.defaultProps){var c=u({},s),h=r.defaultProps;for(var v in h)c[v]===void 0&&(c[v]=h[v]);return c}return s}var tl=1073741823,fr=Wi(null),nl;nl={};var Nu=null,Ys=null,Qs=null,ja=!1;function il(){Nu=null,Ys=null,Qs=null,ja=!1}function zu(){ja=!0}function ff(){ja=!1}function rl(r,s){var c=r.type._context;cn?(En(fr,c._currentValue,r),c._currentValue=s,c._currentRenderer!==void 0&&c._currentRenderer!==null&&c._currentRenderer!==nl&&m("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."),c._currentRenderer=nl):(En(fr,c._currentValue2,r),c._currentValue2=s,c._currentRenderer2!==void 0&&c._currentRenderer2!==null&&c._currentRenderer2!==nl&&m("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."),c._currentRenderer2=nl)}function Uu(r){var s=fr.current;Ft(fr,r);var c=r.type._context;cn?c._currentValue=s:c._currentValue2=s}function Lm(r,s,c){if(An(c,s))return 0;var h=typeof r._calculateChangedBits=="function"?r._calculateChangedBits(c,s):tl;return(h&tl)!==h&&m("calculateChangedBits: Expected the return value to be a 31-bit integer. Instead received: %s",h),h|0}function Di(r,s){for(var c=r;c!==null;){var h=c.alternate;if(!fs(c.childLanes,s))c.childLanes=At(c.childLanes,s),h!==null&&(h.childLanes=At(h.childLanes,s));else if(h!==null&&!fs(h.childLanes,s))h.childLanes=At(h.childLanes,s);else break;c=c.return}}function df(r,s,c,h){var v=r.child;for(v!==null&&(v.return=r);v!==null;){var b=void 0,w=v.dependencies;if(w!==null){b=v.child;for(var A=w.firstContext;A!==null;){if(A.context===s&&A.observedBits&c){if(v.tag===_){var D=ps(on,oi(h));D.tag=Ba,vs(v,D)}v.lanes=At(v.lanes,h);var F=v.alternate;F!==null&&(F.lanes=At(F.lanes,h)),Di(v.return,h),w.lanes=At(w.lanes,h);break}A=A.next}}else v.tag===H?b=v.type===r.type?null:v.child:b=v.child;if(b!==null)b.return=v;else for(b=v;b!==null;){if(b===r){b=null;break}var $=b.sibling;if($!==null){$.return=b.return,b=$;break}b=b.return}v=b}}function Fa(r,s){Nu=r,Ys=null,Qs=null;var c=r.dependencies;if(c!==null){var h=c.firstContext;h!==null&&(Hn(c.lanes,s)&&Rg(),c.firstContext=null)}}function Ht(r,s){if(ja&&m("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."),Qs!==r){if(!(s===!1||s===0)){var c;typeof s!="number"||s===tl?(Qs=r,c=tl):c=s;var h={context:r,observedBits:c,next:null};if(Ys===null){if(Nu===null)throw Error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");Ys=h,Nu.dependencies={lanes:le,firstContext:h,responders:null}}else Ys=Ys.next=h}}return cn?r._currentValue:r._currentValue2}var sl=0,Gs=1,Ba=2,al=3,Ha=!1,hf,ol;hf=!1,ol=null;function ju(r){var s={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null};r.updateQueue=s}function ll(r,s){var c=s.updateQueue,h=r.updateQueue;if(c===h){var v={baseState:h.baseState,firstBaseUpdate:h.firstBaseUpdate,lastBaseUpdate:h.lastBaseUpdate,shared:h.shared,effects:h.effects};s.updateQueue=v}}function ps(r,s){var c={eventTime:r,lane:s,tag:sl,payload:null,callback:null,next:null};return c}function vs(r,s){var c=r.updateQueue;if(c!==null){var h=c.shared,v=h.pending;v===null?s.next=s:(s.next=v.next,v.next=s),h.pending=s,ol===h&&!hf&&(m("An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback."),hf=!0)}}function o(r,s){var c=r.updateQueue,h=r.alternate;if(h!==null){var v=h.updateQueue;if(c===v){var b=null,w=null,A=c.firstBaseUpdate;if(A!==null){var D=A;do{var F={eventTime:D.eventTime,lane:D.lane,tag:D.tag,payload:D.payload,callback:D.callback,next:null};w===null?b=w=F:(w.next=F,w=F),D=D.next}while(D!==null);w===null?b=w=s:(w.next=s,w=s)}else b=w=s;c={baseState:v.baseState,firstBaseUpdate:b,lastBaseUpdate:w,shared:v.shared,effects:v.effects},r.updateQueue=c;return}}var $=c.lastBaseUpdate;$===null?c.firstBaseUpdate=s:$.next=s,c.lastBaseUpdate=s}function l(r,s,c,h,v,b){switch(c.tag){case Gs:{var w=c.payload;if(typeof w=="function"){zu();var A=w.call(b,h,v);{if(r.mode&_t){$i();try{w.call(b,h,v)}finally{sr()}}ff()}return A}return w}case al:r.flags=r.flags&~Ai|rt;case sl:{var D=c.payload,F;if(typeof D=="function"){zu(),F=D.call(b,h,v);{if(r.mode&_t){$i();try{D.call(b,h,v)}finally{sr()}}ff()}}else F=D;return F==null?h:u({},h,F)}case Ba:return Ha=!0,h}return h}function d(r,s,c,h){var v=r.updateQueue;Ha=!1,ol=v.shared;var b=v.firstBaseUpdate,w=v.lastBaseUpdate,A=v.shared.pending;if(A!==null){v.shared.pending=null;var D=A,F=D.next;D.next=null,w===null?b=F:w.next=F,w=D;var $=r.alternate;if($!==null){var X=$.updateQueue,J=X.lastBaseUpdate;J!==w&&(J===null?X.firstBaseUpdate=F:J.next=F,X.lastBaseUpdate=D)}}if(b!==null){var pe=v.baseState,ye=le,Ce=null,Ze=null,bt=null,st=b;do{var Jt=st.lane,Rn=st.eventTime;if(fs(h,Jt)){if(bt!==null){var ae={eventTime:Rn,lane:Gn,tag:st.tag,payload:st.payload,callback:st.callback,next:null};bt=bt.next=ae}pe=l(r,v,st,pe,s,c);var Y=st.callback;if(Y!==null){r.flags|=Dt;var ve=v.effects;ve===null?v.effects=[st]:ve.push(st)}}else{var K={eventTime:Rn,lane:Jt,tag:st.tag,payload:st.payload,callback:st.callback,next:null};bt===null?(Ze=bt=K,Ce=pe):bt=bt.next=K,ye=At(ye,Jt)}if(st=st.next,st===null){if(A=v.shared.pending,A===null)break;var Le=A,Ie=Le.next;Le.next=null,st=Ie,v.lastBaseUpdate=Le,v.shared.pending=null}}while(!0);bt===null&&(Ce=pe),v.baseState=Ce,v.firstBaseUpdate=Ze,v.lastBaseUpdate=bt,Zg(ye),r.lanes=ye,r.memoizedState=pe}ol=null}function y(r,s){if(typeof r!="function")throw Error("Invalid argument passed as callback. Expected a function. Instead received: "+r);r.call(s)}function E(){Ha=!1}function C(){return Ha}function N(r,s,c){var h=s.effects;if(s.effects=null,h!==null)for(var v=0;v<h.length;v++){var b=h[v],w=b.callback;w!==null&&(b.callback=null,y(w,c))}}var B={},te=Array.isArray,we=new a.Component().refs,He,Je,Me,kt,Qt,ki,Q,V,ne,Ae;{He=new Set,Je=new Set,Me=new Set,kt=new Set,V=new Set,Qt=new Set,ne=new Set,Ae=new Set;var Ve=new Set;Q=function(r,s){if(!(r===null||typeof r=="function")){var c=s+"_"+r;Ve.has(c)||(Ve.add(c),m("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",s,r))}},ki=function(r,s){if(s===void 0){var c=xe(r)||"Component";Qt.has(c)||(Qt.add(c),m("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.",c))}},Object.defineProperty(B,"_processChildContext",{enumerable:!1,value:function(){throw Error("_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).")}}),Object.freeze(B)}function It(r,s,c,h){var v=r.memoizedState;if(r.mode&_t){$i();try{c(h,v)}finally{sr()}}var b=c(h,v);ki(s,b);var w=b==null?v:u({},v,b);if(r.memoizedState=w,r.lanes===le){var A=r.updateQueue;A.baseState=w}}var et={isMounted:Dc,enqueueSetState:function(r,s,c){var h=he(r),v=Ji(),b=Ya(h),w=ps(v,b);w.payload=s,c!=null&&(Q(c,"setState"),w.callback=c),vs(h,w),fi(h,b,v)},enqueueReplaceState:function(r,s,c){var h=he(r),v=Ji(),b=Ya(h),w=ps(v,b);w.tag=Gs,w.payload=s,c!=null&&(Q(c,"replaceState"),w.callback=c),vs(h,w),fi(h,b,v)},enqueueForceUpdate:function(r,s){var c=he(r),h=Ji(),v=Ya(c),b=ps(h,v);b.tag=Ba,s!=null&&(Q(s,"forceUpdate"),b.callback=s),vs(c,b),fi(c,v,h)}};function Mt(r,s,c,h,v,b,w){var A=r.stateNode;if(typeof A.shouldComponentUpdate=="function"){if(r.mode&_t){$i();try{A.shouldComponentUpdate(h,b,w)}finally{sr()}}var D=A.shouldComponentUpdate(h,b,w);return D===void 0&&m("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.",xe(s)||"Component"),D}return s.prototype&&s.prototype.isPureReactComponent?!$s(c,h)||!$s(v,b):!0}function Cn(r,s,c){var h=r.stateNode;{var v=xe(s)||"Component",b=h.render;b||(s.prototype&&typeof s.prototype.render=="function"?m("%s(...): No `render` method found on the returned component instance: did you accidentally return an object from the constructor?",v):m("%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`.",v)),h.getInitialState&&!h.getInitialState.isReactClassApproved&&!h.state&&m("getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?",v),h.getDefaultProps&&!h.getDefaultProps.isReactClassApproved&&m("getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.",v),h.propTypes&&m("propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.",v),h.contextType&&m("contextType was defined as an instance property on %s. Use a static property to define contextType instead.",v),h.contextTypes&&m("contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.",v),s.contextType&&s.contextTypes&&!ne.has(s)&&(ne.add(s),m("%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.",v)),typeof h.componentShouldUpdate=="function"&&m("%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",v),s.prototype&&s.prototype.isPureReactComponent&&typeof h.shouldComponentUpdate<"u"&&m("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.",xe(s)||"A pure component"),typeof h.componentDidUnmount=="function"&&m("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?",v),typeof h.componentDidReceiveProps=="function"&&m("%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().",v),typeof h.componentWillRecieveProps=="function"&&m("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",v),typeof h.UNSAFE_componentWillRecieveProps=="function"&&m("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?",v);var w=h.props!==c;h.props!==void 0&&w&&m("%s(...): When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.",v,v),h.defaultProps&&m("Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.",v,v),typeof h.getSnapshotBeforeUpdate=="function"&&typeof h.componentDidUpdate!="function"&&!Me.has(s)&&(Me.add(s),m("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.",xe(s))),typeof h.getDerivedStateFromProps=="function"&&m("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.",v),typeof h.getDerivedStateFromError=="function"&&m("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.",v),typeof s.getSnapshotBeforeUpdate=="function"&&m("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.",v);var A=h.state;A&&(typeof A!="object"||te(A))&&m("%s.state: must be set to an object or null",v),typeof h.getChildContext=="function"&&typeof s.childContextTypes!="object"&&m("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().",v)}}function St(r,s){s.updater=et,r.stateNode=s,Fe(s,r),s._reactInternalInstance=B}function Vr(r,s,c){var h=!1,v=fn,b=fn,w=s.contextType;if("contextType"in s){var A=w===null||w!==void 0&&w.$$typeof===Be&&w._context===void 0;if(!A&&!Ae.has(s)){Ae.add(s);var D="";w===void 0?D=" However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file.":typeof w!="object"?D=" However, it is set to a "+typeof w+".":w.$$typeof===yt?D=" Did you accidentally pass the Context.Provider instead?":w._context!==void 0?D=" Did you accidentally pass the Context.Consumer instead?":D=" However, it is set to an object with keys {"+Object.keys(w).join(", ")+"}.",m("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s",xe(s)||"Component",D)}}if(typeof w=="object"&&w!==null)b=Ht(w);else{v=as(r,s,!0);var F=s.contextTypes;h=F!=null,b=h?Ir(r,v):fn}if(r.mode&_t){$i();try{new s(c,b)}finally{sr()}}var $=new s(c,b),X=r.memoizedState=$.state!==null&&$.state!==void 0?$.state:null;St(r,$);{if(typeof s.getDerivedStateFromProps=="function"&&X===null){var J=xe(s)||"Component";Je.has(J)||(Je.add(J),m("`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.",J,$.state===null?"null":"undefined",J))}if(typeof s.getDerivedStateFromProps=="function"||typeof $.getSnapshotBeforeUpdate=="function"){var pe=null,ye=null,Ce=null;if(typeof $.componentWillMount=="function"&&$.componentWillMount.__suppressDeprecationWarning!==!0?pe="componentWillMount":typeof $.UNSAFE_componentWillMount=="function"&&(pe="UNSAFE_componentWillMount"),typeof $.componentWillReceiveProps=="function"&&$.componentWillReceiveProps.__suppressDeprecationWarning!==!0?ye="componentWillReceiveProps":typeof $.UNSAFE_componentWillReceiveProps=="function"&&(ye="UNSAFE_componentWillReceiveProps"),typeof $.componentWillUpdate=="function"&&$.componentWillUpdate.__suppressDeprecationWarning!==!0?Ce="componentWillUpdate":typeof $.UNSAFE_componentWillUpdate=="function"&&(Ce="UNSAFE_componentWillUpdate"),pe!==null||ye!==null||Ce!==null){var Ze=xe(s)||"Component",bt=typeof s.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";kt.has(Ze)||(kt.add(Ze),m(`Unsafe legacy lifecycles will not be called for components using new component APIs.
|
|
107
|
+
Learn more about this warning here: https://reactjs.org/link/legacy-context`,p)}finally{In()}}})},Vi.discardPendingWarnings=function(){Ao=[],Sa=[],ba=[],ir=[],Mo=[],Oo=[],au=new Map}}function rr(i,s){if(i&&i.defaultProps){var u=c({},s),d=i.defaultProps;for(var p in d)u[p]===void 0&&(u[p]=d[p]);return u}return s}var Do=1073741823,sr=Ii(null),Lo;Lo={};var ou=null,_s=null,Us=null,xa=!1;function Po(){ou=null,_s=null,Us=null,xa=!1}function lu(){xa=!0}function Lc(){xa=!1}function ko(i,s){var u=i.type._context;ln?(Sn(sr,u._currentValue,i),u._currentValue=s,u._currentRenderer!==void 0&&u._currentRenderer!==null&&u._currentRenderer!==Lo&&m("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."),u._currentRenderer=Lo):(Sn(sr,u._currentValue2,i),u._currentValue2=s,u._currentRenderer2!==void 0&&u._currentRenderer2!==null&&u._currentRenderer2!==Lo&&m("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."),u._currentRenderer2=Lo)}function uu(i){var s=sr.current;jt(sr,i);var u=i.type._context;ln?u._currentValue=s:u._currentValue2=s}function Rv(i,s,u){if(Cn(u,s))return 0;var d=typeof i._calculateChangedBits=="function"?i._calculateChangedBits(u,s):Do;return(d&Do)!==d&&m("calculateChangedBits: Expected the return value to be a 31-bit integer. Instead received: %s",d),d|0}function Ai(i,s){for(var u=i;u!==null;){var d=u.alternate;if(!is(u.childLanes,s))u.childLanes=Ct(u.childLanes,s),d!==null&&(d.childLanes=Ct(d.childLanes,s));else if(d!==null&&!is(d.childLanes,s))d.childLanes=Ct(d.childLanes,s);else break;u=u.return}}function Pc(i,s,u,d){var p=i.child;for(p!==null&&(p.return=i);p!==null;){var S=void 0,E=p.dependencies;if(E!==null){S=p.child;for(var R=E.firstContext;R!==null;){if(R.context===s&&R.observedBits&u){if(p.tag===P){var D=as(sn,ni(d));D.tag=wa,os(p,D)}p.lanes=Ct(p.lanes,d);var F=p.alternate;F!==null&&(F.lanes=Ct(F.lanes,d)),Ai(p.return,d),E.lanes=Ct(E.lanes,d);break}R=R.next}}else p.tag===H?S=p.type===i.type?null:p.child:S=p.child;if(S!==null)S.return=p;else for(S=p;S!==null;){if(S===i){S=null;break}var W=S.sibling;if(W!==null){W.return=S.return,S=W;break}S=S.return}p=S}}function Ea(i,s){ou=i,_s=null,Us=null;var u=i.dependencies;if(u!==null){var d=u.firstContext;d!==null&&(Un(u.lanes,s)&&xm(),u.firstContext=null)}}function Ft(i,s){if(xa&&m("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."),Us!==i){if(!(s===!1||s===0)){var u;typeof s!="number"||s===Do?(Us=i,u=Do):u=s;var d={context:i,observedBits:u,next:null};if(_s===null){if(ou===null)throw Error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");_s=d,ou.dependencies={lanes:ue,firstContext:d,responders:null}}else _s=_s.next=d}}return ln?i._currentValue:i._currentValue2}var zo=0,js=1,wa=2,No=3,Ta=!1,kc,_o;kc=!1,_o=null;function cu(i){var s={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null};i.updateQueue=s}function Uo(i,s){var u=s.updateQueue,d=i.updateQueue;if(u===d){var p={baseState:d.baseState,firstBaseUpdate:d.firstBaseUpdate,lastBaseUpdate:d.lastBaseUpdate,shared:d.shared,effects:d.effects};s.updateQueue=p}}function as(i,s){var u={eventTime:i,lane:s,tag:zo,payload:null,callback:null,next:null};return u}function os(i,s){var u=i.updateQueue;if(u!==null){var d=u.shared,p=d.pending;p===null?s.next=s:(s.next=p.next,p.next=s),d.pending=s,_o===d&&!kc&&(m("An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback."),kc=!0)}}function a(i,s){var u=i.updateQueue,d=i.alternate;if(d!==null){var p=d.updateQueue;if(u===p){var S=null,E=null,R=u.firstBaseUpdate;if(R!==null){var D=R;do{var F={eventTime:D.eventTime,lane:D.lane,tag:D.tag,payload:D.payload,callback:D.callback,next:null};E===null?S=E=F:(E.next=F,E=F),D=D.next}while(D!==null);E===null?S=E=s:(E.next=s,E=s)}else S=E=s;u={baseState:p.baseState,firstBaseUpdate:S,lastBaseUpdate:E,shared:p.shared,effects:p.effects},i.updateQueue=u;return}}var W=u.lastBaseUpdate;W===null?u.firstBaseUpdate=s:W.next=s,u.lastBaseUpdate=s}function l(i,s,u,d,p,S){switch(u.tag){case js:{var E=u.payload;if(typeof E=="function"){lu();var R=E.call(S,d,p);{if(i.mode&Mt){ji();try{E.call(S,d,p)}finally{Ji()}}Lc()}return R}return E}case No:i.flags=i.flags&~xi|tt;case zo:{var D=u.payload,F;if(typeof D=="function"){lu(),F=D.call(S,d,p);{if(i.mode&Mt){ji();try{D.call(S,d,p)}finally{Ji()}}Lc()}}else F=D;return F==null?d:c({},d,F)}case wa:return Ta=!0,d}return d}function f(i,s,u,d){var p=i.updateQueue;Ta=!1,_o=p.shared;var S=p.firstBaseUpdate,E=p.lastBaseUpdate,R=p.shared.pending;if(R!==null){p.shared.pending=null;var D=R,F=D.next;D.next=null,E===null?S=F:E.next=F,E=D;var W=i.alternate;if(W!==null){var X=W.updateQueue,ee=X.lastBaseUpdate;ee!==E&&(ee===null?X.firstBaseUpdate=F:ee.next=F,X.lastBaseUpdate=D)}}if(S!==null){var he=p.baseState,ye=ue,Ee=null,Xe=null,St=null,it=S;do{var Xt=it.lane,Tn=it.eventTime;if(is(d,Xt)){if(St!==null){var oe={eventTime:Tn,lane:Wn,tag:it.tag,payload:it.payload,callback:it.callback,next:null};St=St.next=oe}he=l(i,p,it,he,s,u);var Y=it.callback;if(Y!==null){i.flags|=Lt;var ve=p.effects;ve===null?p.effects=[it]:ve.push(it)}}else{var K={eventTime:Tn,lane:Xt,tag:it.tag,payload:it.payload,callback:it.callback,next:null};St===null?(Xe=St=K,Ee=he):St=St.next=K,ye=Ct(ye,Xt)}if(it=it.next,it===null){if(R=p.shared.pending,R===null)break;var De=R,ze=De.next;De.next=null,it=ze,p.lastBaseUpdate=De,p.shared.pending=null}}while(!0);St===null&&(Ee=he),p.baseState=Ee,p.firstBaseUpdate=Xe,p.lastBaseUpdate=St,Ym(ye),i.lanes=ye,i.memoizedState=he}_o=null}function y(i,s){if(typeof i!="function")throw Error("Invalid argument passed as callback. Expected a function. Instead received: "+i);i.call(s)}function b(){Ta=!1}function T(){return Ta}function N(i,s,u){var d=s.effects;if(s.effects=null,d!==null)for(var p=0;p<d.length;p++){var S=d[p],E=S.callback;E!==null&&(S.callback=null,y(E,u))}}var B={},ne=Array.isArray,xe=new o.Component().refs,Fe,Ke,Ae,Pt,qt,Mi,Q,V,ie,Re;{Fe=new Set,Ke=new Set,Ae=new Set,Pt=new Set,V=new Set,qt=new Set,ie=new Set,Re=new Set;var Be=new Set;Q=function(i,s){if(!(i===null||typeof i=="function")){var u=s+"_"+i;Be.has(u)||(Be.add(u),m("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",s,i))}},Mi=function(i,s){if(s===void 0){var u=be(i)||"Component";qt.has(u)||(qt.add(u),m("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.",u))}},Object.defineProperty(B,"_processChildContext",{enumerable:!1,value:function(){throw Error("_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).")}}),Object.freeze(B)}function kt(i,s,u,d){var p=i.memoizedState;if(i.mode&Mt){ji();try{u(d,p)}finally{Ji()}}var S=u(d,p);Mi(s,S);var E=S==null?p:c({},p,S);if(i.memoizedState=E,i.lanes===ue){var R=i.updateQueue;R.baseState=E}}var Je={isMounted:ec,enqueueSetState:function(i,s,u){var d=pe(i),p=Yi(),S=Oa(d),E=as(p,S);E.payload=s,u!=null&&(Q(u,"setState"),E.callback=u),os(d,E),ai(d,S,p)},enqueueReplaceState:function(i,s,u){var d=pe(i),p=Yi(),S=Oa(d),E=as(p,S);E.tag=js,E.payload=s,u!=null&&(Q(u,"replaceState"),E.callback=u),os(d,E),ai(d,S,p)},enqueueForceUpdate:function(i,s){var u=pe(i),d=Yi(),p=Oa(u),S=as(d,p);S.tag=wa,s!=null&&(Q(s,"forceUpdate"),S.callback=s),os(u,S),ai(u,p,d)}};function Rt(i,s,u,d,p,S,E){var R=i.stateNode;if(typeof R.shouldComponentUpdate=="function"){if(i.mode&Mt){ji();try{R.shouldComponentUpdate(d,S,E)}finally{Ji()}}var D=R.shouldComponentUpdate(d,S,E);return D===void 0&&m("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.",be(s)||"Component"),D}return s.prototype&&s.prototype.isPureReactComponent?!ks(u,d)||!ks(p,S):!0}function En(i,s,u){var d=i.stateNode;{var p=be(s)||"Component",S=d.render;S||(s.prototype&&typeof s.prototype.render=="function"?m("%s(...): No `render` method found on the returned component instance: did you accidentally return an object from the constructor?",p):m("%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`.",p)),d.getInitialState&&!d.getInitialState.isReactClassApproved&&!d.state&&m("getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?",p),d.getDefaultProps&&!d.getDefaultProps.isReactClassApproved&&m("getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.",p),d.propTypes&&m("propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.",p),d.contextType&&m("contextType was defined as an instance property on %s. Use a static property to define contextType instead.",p),d.contextTypes&&m("contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.",p),s.contextType&&s.contextTypes&&!ie.has(s)&&(ie.add(s),m("%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.",p)),typeof d.componentShouldUpdate=="function"&&m("%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",p),s.prototype&&s.prototype.isPureReactComponent&&typeof d.shouldComponentUpdate<"u"&&m("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.",be(s)||"A pure component"),typeof d.componentDidUnmount=="function"&&m("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?",p),typeof d.componentDidReceiveProps=="function"&&m("%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().",p),typeof d.componentWillRecieveProps=="function"&&m("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",p),typeof d.UNSAFE_componentWillRecieveProps=="function"&&m("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?",p);var E=d.props!==u;d.props!==void 0&&E&&m("%s(...): When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.",p,p),d.defaultProps&&m("Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.",p,p),typeof d.getSnapshotBeforeUpdate=="function"&&typeof d.componentDidUpdate!="function"&&!Ae.has(s)&&(Ae.add(s),m("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.",be(s))),typeof d.getDerivedStateFromProps=="function"&&m("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.",p),typeof d.getDerivedStateFromError=="function"&&m("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.",p),typeof s.getSnapshotBeforeUpdate=="function"&&m("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.",p);var R=d.state;R&&(typeof R!="object"||ne(R))&&m("%s.state: must be set to an object or null",p),typeof d.getChildContext=="function"&&typeof s.childContextTypes!="object"&&m("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().",p)}}function yt(i,s){s.updater=Je,i.stateNode=s,je(s,i),s._reactInternalInstance=B}function _r(i,s,u){var d=!1,p=un,S=un,E=s.contextType;if("contextType"in s){var R=E===null||E!==void 0&&E.$$typeof===ct&&E._context===void 0;if(!R&&!Re.has(s)){Re.add(s);var D="";E===void 0?D=" However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file.":typeof E!="object"?D=" However, it is set to a "+typeof E+".":E.$$typeof===xt?D=" Did you accidentally pass the Context.Provider instead?":E._context!==void 0?D=" Did you accidentally pass the Context.Consumer instead?":D=" However, it is set to an object with keys {"+Object.keys(E).join(", ")+"}.",m("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s",be(s)||"Component",D)}}if(typeof E=="object"&&E!==null)S=Ft(E);else{p=Zr(i,s,!0);var F=s.contextTypes;d=F!=null,S=d?Mr(i,p):un}if(i.mode&Mt){ji();try{new s(u,S)}finally{Ji()}}var W=new s(u,S),X=i.memoizedState=W.state!==null&&W.state!==void 0?W.state:null;yt(i,W);{if(typeof s.getDerivedStateFromProps=="function"&&X===null){var ee=be(s)||"Component";Ke.has(ee)||(Ke.add(ee),m("`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.",ee,W.state===null?"null":"undefined",ee))}if(typeof s.getDerivedStateFromProps=="function"||typeof W.getSnapshotBeforeUpdate=="function"){var he=null,ye=null,Ee=null;if(typeof W.componentWillMount=="function"&&W.componentWillMount.__suppressDeprecationWarning!==!0?he="componentWillMount":typeof W.UNSAFE_componentWillMount=="function"&&(he="UNSAFE_componentWillMount"),typeof W.componentWillReceiveProps=="function"&&W.componentWillReceiveProps.__suppressDeprecationWarning!==!0?ye="componentWillReceiveProps":typeof W.UNSAFE_componentWillReceiveProps=="function"&&(ye="UNSAFE_componentWillReceiveProps"),typeof W.componentWillUpdate=="function"&&W.componentWillUpdate.__suppressDeprecationWarning!==!0?Ee="componentWillUpdate":typeof W.UNSAFE_componentWillUpdate=="function"&&(Ee="UNSAFE_componentWillUpdate"),he!==null||ye!==null||Ee!==null){var Xe=be(s)||"Component",St=typeof s.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";Pt.has(Xe)||(Pt.add(Xe),m(`Unsafe legacy lifecycles will not be called for components using new component APIs.
|
|
108
108
|
|
|
109
109
|
%s uses %s but also contains the following legacy lifecycles:%s%s%s
|
|
110
110
|
|
|
111
111
|
The above lifecycles should be removed. Learn more about this warning here:
|
|
112
|
-
https://reactjs.org/link/unsafe-component-lifecycles`,
|
|
113
|
-
`+
|
|
114
|
-
`+ye:"",
|
|
115
|
-
`+
|
|
112
|
+
https://reactjs.org/link/unsafe-component-lifecycles`,Xe,St,he!==null?`
|
|
113
|
+
`+he:"",ye!==null?`
|
|
114
|
+
`+ye:"",Ee!==null?`
|
|
115
|
+
`+Ee:""))}}}return d&&rn(i,p,S),W}function Av(i,s){var u=s.state;typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),u!==s.state&&(m("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",be(i.type)||"Component"),Je.enqueueReplaceState(s,s.state,null))}function DS(i,s,u,d){var p=s.state;if(typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(u,d),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(u,d),s.state!==p){{var S=be(i.type)||"Component";Fe.has(S)||(Fe.add(S),m("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",S))}Je.enqueueReplaceState(s,s.state,null)}}function Mv(i,s,u,d){En(i,s,u);var p=i.stateNode;p.props=u,p.state=i.memoizedState,p.refs=xe,cu(i);var S=s.contextType;if(typeof S=="object"&&S!==null)p.context=Ft(S);else{var E=Zr(i,s,!0);p.context=Mr(i,E)}{if(p.state===u){var R=be(s)||"Component";V.has(R)||(V.add(R),m("%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.",R))}i.mode&Mt&&Vi.recordLegacyContextWarning(i,p),Vi.recordUnsafeLifecycleWarnings(i,p)}f(i,u,p,d),p.state=i.memoizedState;var D=s.getDerivedStateFromProps;typeof D=="function"&&(kt(i,s,D,u),p.state=i.memoizedState),typeof s.getDerivedStateFromProps!="function"&&typeof p.getSnapshotBeforeUpdate!="function"&&(typeof p.UNSAFE_componentWillMount=="function"||typeof p.componentWillMount=="function")&&(Av(i,p),f(i,u,p,d),p.state=i.memoizedState),typeof p.componentDidMount=="function"&&(i.flags|=et)}function fO(i,s,u,d){var p=i.stateNode,S=i.memoizedProps;p.props=S;var E=p.context,R=s.contextType,D=un;if(typeof R=="object"&&R!==null)D=Ft(R);else{var F=Zr(i,s,!0);D=Mr(i,F)}var W=s.getDerivedStateFromProps,X=typeof W=="function"||typeof p.getSnapshotBeforeUpdate=="function";!X&&(typeof p.UNSAFE_componentWillReceiveProps=="function"||typeof p.componentWillReceiveProps=="function")&&(S!==u||E!==D)&&DS(i,p,u,D),b();var ee=i.memoizedState,he=p.state=ee;if(f(i,u,p,d),he=i.memoizedState,S===u&&ee===he&&!Fi()&&!T())return typeof p.componentDidMount=="function"&&(i.flags|=et),!1;typeof W=="function"&&(kt(i,s,W,u),he=i.memoizedState);var ye=T()||Rt(i,s,S,u,ee,he,D);return ye?(!X&&(typeof p.UNSAFE_componentWillMount=="function"||typeof p.componentWillMount=="function")&&(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(i.flags|=et)):(typeof p.componentDidMount=="function"&&(i.flags|=et),i.memoizedProps=u,i.memoizedState=he),p.props=u,p.state=he,p.context=D,ye}function dO(i,s,u,d,p){var S=s.stateNode;Uo(i,s);var E=s.memoizedProps,R=s.type===s.elementType?E:rr(s.type,E);S.props=R;var D=s.pendingProps,F=S.context,W=u.contextType,X=un;if(typeof W=="object"&&W!==null)X=Ft(W);else{var ee=Zr(s,u,!0);X=Mr(s,ee)}var he=u.getDerivedStateFromProps,ye=typeof he=="function"||typeof S.getSnapshotBeforeUpdate=="function";!ye&&(typeof S.UNSAFE_componentWillReceiveProps=="function"||typeof S.componentWillReceiveProps=="function")&&(E!==D||F!==X)&&DS(s,S,d,X),b();var Ee=s.memoizedState,Xe=S.state=Ee;if(f(s,d,S,p),Xe=s.memoizedState,E===D&&Ee===Xe&&!Fi()&&!T())return typeof S.componentDidUpdate=="function"&&(E!==i.memoizedProps||Ee!==i.memoizedState)&&(s.flags|=et),typeof S.getSnapshotBeforeUpdate=="function"&&(E!==i.memoizedProps||Ee!==i.memoizedState)&&(s.flags|=Zt),!1;typeof he=="function"&&(kt(s,u,he,d),Xe=s.memoizedState);var St=T()||Rt(s,u,R,d,Ee,Xe,X);return St?(!ye&&(typeof S.UNSAFE_componentWillUpdate=="function"||typeof S.componentWillUpdate=="function")&&(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(d,Xe,X),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(d,Xe,X)),typeof S.componentDidUpdate=="function"&&(s.flags|=et),typeof S.getSnapshotBeforeUpdate=="function"&&(s.flags|=Zt)):(typeof S.componentDidUpdate=="function"&&(E!==i.memoizedProps||Ee!==i.memoizedState)&&(s.flags|=et),typeof S.getSnapshotBeforeUpdate=="function"&&(E!==i.memoizedProps||Ee!==i.memoizedState)&&(s.flags|=Zt),s.memoizedProps=d,s.memoizedState=Xe),S.props=d,S.state=Xe,S.context=X,St}var Ov,Dv,Lv,Pv,kv,LS=function(i,s){};Ov=!1,Dv=!1,Lv={},Pv={},kv={},LS=function(i,s){if(!(i===null||typeof i!="object")&&!(!i._store||i._store.validated||i.key!=null)){if(typeof i._store!="object")throw Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.");i._store.validated=!0;var u=be(s.type)||"Component";Pv[u]||(Pv[u]=!0,m('Each child in a list should have a unique "key" prop. See https://reactjs.org/link/warning-keys for more information.'))}};var Wd=Array.isArray;function zc(i,s,u){var d=u.ref;if(d!==null&&typeof d!="function"&&typeof d!="object"){if((i.mode&Mt||vl)&&!(u._owner&&u._self&&u._owner.stateNode!==u._self)){var p=be(i.type)||"Component";Lv[p]||(m('A string ref, "%s", has been found within a strict mode tree. String refs are a source of potential bugs and should be avoided. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',d),Lv[p]=!0)}if(u._owner){var S=u._owner,E;if(S){var R=S;if(R.tag!==P)throw Error("Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref");E=R.stateNode}if(!E)throw Error("Missing owner for string ref "+d+". This error is likely caused by a bug in React. Please file an issue.");var D=""+d;if(s!==null&&s.ref!==null&&typeof s.ref=="function"&&s.ref._stringRef===D)return s.ref;var F=function(W){var X=E.refs;X===xe&&(X=E.refs={}),W===null?delete X[D]:X[D]=W};return F._stringRef=D,F}else{if(typeof d!="string")throw Error("Expected ref to be a function, a string, an object returned by React.createRef(), or null.");if(!u._owner)throw Error("Element ref was specified as a string ("+d+`) but no owner was set. This could happen for one of the following reasons:
|
|
116
116
|
1. You may be adding a ref to a function component
|
|
117
117
|
2. You may be adding a ref to a component that was not created inside a component's render method
|
|
118
118
|
3. You have multiple copies of React loaded
|
|
119
|
-
See https://reactjs.org/link/refs-must-have-owner for more information.`)}}return h}function Ch(r,s){if(r.type!=="textarea")throw Error("Objects are not valid as a React child (found: "+(Object.prototype.toString.call(s)==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":s)+"). If you meant to render a collection of children, use an array instead.")}function Th(r){{var s=xe(r.type)||"Component";if(Um[s])return;Um[s]=!0,m("Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.")}}function YE(r){function s(K,ae){if(r){var Y=K.lastEffect;Y!==null?(Y.nextEffect=ae,K.lastEffect=ae):K.firstEffect=K.lastEffect=ae,ae.nextEffect=null,ae.flags=De}}function c(K,ae){if(!r)return null;for(var Y=ae;Y!==null;)s(K,Y),Y=Y.sibling;return null}function h(K,ae){for(var Y=new Map,ve=ae;ve!==null;)ve.key!==null?Y.set(ve.key,ve):Y.set(ve.index,ve),ve=ve.sibling;return Y}function v(K,ae){var Y=wl(K,ae);return Y.index=0,Y.sibling=null,Y}function b(K,ae,Y){if(K.index=Y,!r)return ae;var ve=K.alternate;if(ve!==null){var Le=ve.index;return Le<ae?(K.flags=Pt,ae):Le}else return K.flags=Pt,ae}function w(K){return r&&K.alternate===null&&(K.flags=Pt),K}function A(K,ae,Y,ve){if(ae===null||ae.tag!==O){var Le=py(Y,K.mode,ve);return Le.return=K,Le}else{var Ie=v(ae,Y);return Ie.return=K,Ie}}function D(K,ae,Y,ve){if(ae!==null&&(ae.elementType===Y.type||Pw(ae,Y))){var Le=v(ae,Y.props);return Le.ref=pf(K,ae,Y),Le.return=K,Le._debugSource=Y._source,Le._debugOwner=Y._owner,Le}var Ie=dy(Y,K.mode,ve);return Ie.ref=pf(K,ae,Y),Ie.return=K,Ie}function F(K,ae,Y,ve){if(ae===null||ae.tag!==L||ae.stateNode.containerInfo!==Y.containerInfo||ae.stateNode.implementation!==Y.implementation){var Le=vy(Y,K.mode,ve);return Le.return=K,Le}else{var Ie=v(ae,Y.children||[]);return Ie.return=K,Ie}}function $(K,ae,Y,ve,Le){if(ae===null||ae.tag!==j){var Ie=Cl(Y,K.mode,ve,Le);return Ie.return=K,Ie}else{var xt=v(ae,Y);return xt.return=K,xt}}function X(K,ae,Y){if(typeof ae=="string"||typeof ae=="number"){var ve=py(""+ae,K.mode,Y);return ve.return=K,ve}if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case $e:{var Le=dy(ae,K.mode,Y);return Le.ref=pf(K,null,ae),Le.return=K,Le}case ht:{var Ie=vy(ae,K.mode,Y);return Ie.return=K,Ie}}if(wh(ae)||We(ae)){var xt=Cl(ae,K.mode,Y,null);return xt.return=K,xt}Ch(K,ae)}return typeof ae=="function"&&Th(K),null}function J(K,ae,Y,ve){var Le=ae!==null?ae.key:null;if(typeof Y=="string"||typeof Y=="number")return Le!==null?null:A(K,ae,""+Y,ve);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case $e:return Y.key===Le?Y.type===gt?$(K,ae,Y.props.children,ve,Le):D(K,ae,Y,ve):null;case ht:return Y.key===Le?F(K,ae,Y,ve):null}if(wh(Y)||We(Y))return Le!==null?null:$(K,ae,Y,ve,null);Ch(K,Y)}return typeof Y=="function"&&Th(K),null}function pe(K,ae,Y,ve,Le){if(typeof ve=="string"||typeof ve=="number"){var Ie=K.get(Y)||null;return A(ae,Ie,""+ve,Le)}if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case $e:{var xt=K.get(ve.key===null?Y:ve.key)||null;return ve.type===gt?$(ae,xt,ve.props.children,Le,ve.key):D(ae,xt,ve,Le)}case ht:{var rn=K.get(ve.key===null?Y:ve.key)||null;return F(ae,rn,ve,Le)}}if(wh(ve)||We(ve)){var hn=K.get(Y)||null;return $(ae,hn,ve,Le,null)}Ch(ae,ve)}return typeof ve=="function"&&Th(ae),null}function ye(K,ae,Y){{if(typeof K!="object"||K===null)return ae;switch(K.$$typeof){case $e:case ht:qE(K,Y);var ve=K.key;if(typeof ve!="string")break;if(ae===null){ae=new Set,ae.add(ve);break}if(!ae.has(ve)){ae.add(ve);break}m("Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.",ve);break}}return ae}function Ce(K,ae,Y,ve){for(var Le=null,Ie=0;Ie<Y.length;Ie++){var xt=Y[Ie];Le=ye(xt,Le,K)}for(var rn=null,hn=null,zt=ae,Nn=0,Lt=0,pn=null;zt!==null&&Lt<Y.length;Lt++){zt.index>Lt?(pn=zt,zt=null):pn=zt.sibling;var ti=J(K,zt,Y[Lt],ve);if(ti===null){zt===null&&(zt=pn);break}r&&zt&&ti.alternate===null&&s(K,zt),Nn=b(ti,Nn,Lt),hn===null?rn=ti:hn.sibling=ti,hn=ti,zt=pn}if(Lt===Y.length)return c(K,zt),rn;if(zt===null){for(;Lt<Y.length;Lt++){var Mn=X(K,Y[Lt],ve);Mn!==null&&(Nn=b(Mn,Nn,Lt),hn===null?rn=Mn:hn.sibling=Mn,hn=Mn)}return rn}for(var bs=h(K,zt);Lt<Y.length;Lt++){var On=pe(bs,K,Lt,Y[Lt],ve);On!==null&&(r&&On.alternate!==null&&bs.delete(On.key===null?Lt:On.key),Nn=b(On,Nn,Lt),hn===null?rn=On:hn.sibling=On,hn=On)}return r&&bs.forEach(function(Es){return s(K,Es)}),rn}function Ze(K,ae,Y,ve){var Le=We(Y);if(typeof Le!="function")throw Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.");{typeof Symbol=="function"&&Y[Symbol.toStringTag]==="Generator"&&(Im||m("Using Generators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. Keep in mind you might need to polyfill these features for older browsers."),Im=!0),Y.entries===Le&&(km||m("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),km=!0);var Ie=Le.call(Y);if(Ie)for(var xt=null,rn=Ie.next();!rn.done;rn=Ie.next()){var hn=rn.value;xt=ye(hn,xt,K)}}var zt=Le.call(Y);if(zt==null)throw Error("An iterable object provided no iterator.");for(var Nn=null,Lt=null,pn=ae,ti=0,Mn=0,bs=null,On=zt.next();pn!==null&&!On.done;Mn++,On=zt.next()){pn.index>Mn?(bs=pn,pn=null):bs=pn.sibling;var Es=J(K,pn,On.value,ve);if(Es===null){pn===null&&(pn=bs);break}r&&pn&&Es.alternate===null&&s(K,pn),ti=b(Es,ti,Mn),Lt===null?Nn=Es:Lt.sibling=Es,Lt=Es,pn=bs}if(On.done)return c(K,pn),Nn;if(pn===null){for(;!On.done;Mn++,On=zt.next()){var Tl=X(K,On.value,ve);Tl!==null&&(ti=b(Tl,ti,Mn),Lt===null?Nn=Tl:Lt.sibling=Tl,Lt=Tl)}return Nn}for(var Sy=h(K,pn);!On.done;Mn++,On=zt.next()){var Xa=pe(Sy,K,Mn,On.value,ve);Xa!==null&&(r&&Xa.alternate!==null&&Sy.delete(Xa.key===null?Mn:Xa.key),ti=b(Xa,ti,Mn),Lt===null?Nn=Xa:Lt.sibling=Xa,Lt=Xa)}return r&&Sy.forEach(function(NN){return s(K,NN)}),Nn}function bt(K,ae,Y,ve){if(ae!==null&&ae.tag===O){c(K,ae.sibling);var Le=v(ae,Y);return Le.return=K,Le}c(K,ae);var Ie=py(Y,K.mode,ve);return Ie.return=K,Ie}function st(K,ae,Y,ve){for(var Le=Y.key,Ie=ae;Ie!==null;){if(Ie.key===Le){switch(Ie.tag){case j:{if(Y.type===gt){c(K,Ie.sibling);var xt=v(Ie,Y.props.children);return xt.return=K,xt._debugSource=Y._source,xt._debugOwner=Y._owner,xt}break}case me:default:{if(Ie.elementType===Y.type||Pw(Ie,Y)){c(K,Ie.sibling);var rn=v(Ie,Y.props);return rn.ref=pf(K,Ie,Y),rn.return=K,rn._debugSource=Y._source,rn._debugOwner=Y._owner,rn}break}}c(K,Ie);break}else s(K,Ie);Ie=Ie.sibling}if(Y.type===gt){var hn=Cl(Y.props.children,K.mode,ve,Y.key);return hn.return=K,hn}else{var zt=dy(Y,K.mode,ve);return zt.ref=pf(K,ae,Y),zt.return=K,zt}}function Jt(K,ae,Y,ve){for(var Le=Y.key,Ie=ae;Ie!==null;){if(Ie.key===Le)if(Ie.tag===L&&Ie.stateNode.containerInfo===Y.containerInfo&&Ie.stateNode.implementation===Y.implementation){c(K,Ie.sibling);var xt=v(Ie,Y.children||[]);return xt.return=K,xt}else{c(K,Ie);break}else s(K,Ie);Ie=Ie.sibling}var rn=vy(Y,K.mode,ve);return rn.return=K,rn}function Rn(K,ae,Y,ve){var Le=typeof Y=="object"&&Y!==null&&Y.type===gt&&Y.key===null;Le&&(Y=Y.props.children);var Ie=typeof Y=="object"&&Y!==null;if(Ie)switch(Y.$$typeof){case $e:return w(st(K,ae,Y,ve));case ht:return w(Jt(K,ae,Y,ve))}if(typeof Y=="string"||typeof Y=="number")return w(bt(K,ae,""+Y,ve));if(wh(Y))return Ce(K,ae,Y,ve);if(We(Y))return Ze(K,ae,Y,ve);if(Ie&&Ch(K,Y),typeof Y=="function"&&Th(K),typeof Y>"u"&&!Le)switch(K.tag){case _:{var xt=K.stateNode;if(xt.render._isMockFunction)break}case me:case R:case Z:case ge:throw Error((xe(K.type)||"Component")+"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.")}return c(K,ae)}return Rn}var Rh=YE(!0),QE=YE(!1);function ND(r,s){if(!(r===null||s.child===r.child))throw Error("Resuming work not yet implemented.");if(s.child!==null){var c=s.child,h=wl(c,c.pendingProps);for(s.child=h,h.return=s;c.sibling!==null;)c=c.sibling,h=h.sibling=wl(c,c.pendingProps),h.return=s;h.sibling=null}}function zD(r,s){for(var c=r.child;c!==null;)cN(c,s),c=c.sibling}var vf={},Va=Wi(vf),mf=Wi(vf),Ah=Wi(vf);function Mh(r){if(r===vf)throw Error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.");return r}function jm(){var r=Mh(Ah.current);return r}function Fm(r,s){En(Ah,s,r),En(mf,r,r),En(Va,vf,r);var c=Ct(s);Ft(Va,r),En(Va,c,r)}function Fu(r){Ft(Va,r),Ft(mf,r),Ft(Ah,r)}function gf(){var r=Mh(Va.current);return r}function GE(r){var s=Mh(Ah.current),c=Mh(Va.current),h=Ot(c,r.type,s);c!==h&&(En(mf,r,r),En(Va,h,r))}function Bm(r){mf.current===r&&(Ft(Va,r),Ft(mf,r))}var UD=0,XE=1,Hm=1,yf=2,$r=Wi(UD);function Oh(r,s){return(r&s)!==0}function Sf(r){return r&XE}function Vm(r,s){return r&XE|s}function jD(r,s){return r|s}function ul(r,s){En($r,s,r)}function Bu(r){Ft($r,r)}function FD(r,s){var c=r.memoizedState;if(c!==null)return c.dehydrated!==null;var h=r.memoizedProps;return h.fallback===void 0?!1:h.unstable_avoidThisFallback!==!0?!0:!s}function _h(r){for(var s=r;s!==null;){if(s.tag===W){var c=s.memoizedState;if(c!==null){var h=c.dehydrated;if(h===null||Jl(h)||Bc(h))return s}}else if(s.tag===je&&s.memoizedProps.revealOrder!==void 0){var v=(s.flags&rt)!==ct;if(v)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)return null;for(;s.sibling===null;){if(s.return===null||s.return===r)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var $m=0,cl=1,fl=2,bf=4,xr=null,dl=null,$a=!1;function BD(r){if(!tn)return!1;var s=r.stateNode.containerInfo;return dl=Dn(s),xr=r,$a=!0,!0}function KE(r,s){switch(r.tag){case k:xm(r.stateNode.containerInfo,s);break;case P:Vi(r.type,r.memoizedProps,r.stateNode,s);break}var c=mN();c.stateNode=s,c.return=r,c.flags=De,r.lastEffect!==null?(r.lastEffect.nextEffect=c,r.lastEffect=c):r.firstEffect=r.lastEffect=c}function ZE(r,s){switch(s.flags=s.flags&~Ri|Pt,r.tag){case k:{var c=r.stateNode.containerInfo;switch(s.tag){case P:var h=s.type,v=s.pendingProps;wm(c,h,v);break;case O:var b=s.pendingProps;tu(c,b);break;case W:Cm(c);break}break}case P:{var w=r.type,A=r.memoizedProps,D=r.stateNode;switch(s.tag){case P:var F=s.type,$=s.pendingProps;rr(w,A,D,F,$);break;case O:var X=s.pendingProps;nu(w,A,D,X);break;case W:iu(w,A,D);break}break}default:return}}function JE(r,s){switch(r.tag){case P:{var c=r.type,h=r.pendingProps,v=bm(s,c,h);return v!==null?(r.stateNode=v,!0):!1}case O:{var b=r.pendingProps,w=Lr(s,b);return w!==null?(r.stateNode=w,!0):!1}case W:return!1;default:return!1}}function Wm(r){if($a){var s=dl;if(!s){ZE(xr,r),$a=!1,xr=r;return}var c=s;if(!JE(r,s)){if(s=eu(c),!s||!JE(r,s)){ZE(xr,r),$a=!1,xr=r;return}KE(xr,c)}xr=r,dl=Dn(s)}}function HD(r,s,c){if(!tn)throw Error("Expected prepareToHydrateHostInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");var h=r.stateNode,v=wa(h,r.type,r.memoizedProps,s,c,r);return r.updateQueue=v,v!==null}function VD(r){if(!tn)throw Error("Expected prepareToHydrateHostTextInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");var s=r.stateNode,c=r.memoizedProps,h=sh(s,c,r);if(h){var v=xr;if(v!==null)switch(v.tag){case k:{var b=v.stateNode.containerInfo;ah(b,s,c);break}case P:{var w=v.type,A=v.memoizedProps,D=v.stateNode;Em(w,A,D,s,c);break}}}return h}function $D(r){if(!tn)throw Error("Expected skipPastDehydratedSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");var s=r.memoizedState,c=s!==null?s.dehydrated:null;if(!c)throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");return Pr(c)}function ex(r){for(var s=r.return;s!==null&&s.tag!==P&&s.tag!==k&&s.tag!==W;)s=s.return;xr=s}function Lh(r){if(!tn||r!==xr)return!1;if(!$a)return ex(r),$a=!0,!1;var s=r.type;if(r.tag!==P||s!=="head"&&s!=="body"&&!ii(s,r.memoizedProps))for(var c=dl;c;)KE(r,c),c=eu(c);return ex(r),r.tag===W?dl=$D(r):dl=xr?eu(r.stateNode):null,!0}function qm(){tn&&(xr=null,dl=null,$a=!1)}function Ym(){return $a}var Ef=[],xf;xf={};function WD(r){Ef.push(r)}function Qm(){for(var r=0;r<Ef.length;r++){var s=Ef[r];cn?s._workInProgressVersionPrimary=null:s._workInProgressVersionSecondary=null}Ef.length=0}function qD(r){return cn?r._workInProgressVersionPrimary:r._workInProgressVersionSecondary}function tx(r,s){cn?r._workInProgressVersionPrimary=s:r._workInProgressVersionSecondary=s,Ef.push(r)}function YD(r){cn?r._currentPrimaryRenderer==null?r._currentPrimaryRenderer=xf:r._currentPrimaryRenderer!==xf&&m("Detected multiple renderers concurrently rendering the same mutable source. This is currently unsupported."):r._currentSecondaryRenderer==null?r._currentSecondaryRenderer=xf:r._currentSecondaryRenderer!==xf&&m("Detected multiple renderers concurrently rendering the same mutable source. This is currently unsupported.")}var Oe=g.ReactCurrentDispatcher,wr=g.ReactCurrentBatchConfig,Gm,Xm;Xm={},Gm=new Set;var wf=le,Zt=null,bi=null,ei=null,Ph=!1,Cf=!1,QD=25,ue=null,Cr=null,Wa=-1,Km=!1;function Gt(){{var r=ue;Cr===null?Cr=[r]:Cr.push(r)}}function Pe(){{var r=ue;Cr!==null&&(Wa++,Cr[Wa]!==r&&GD(r))}}function Tf(r){r!=null&&!Array.isArray(r)&&m("%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.",ue,typeof r)}function GD(r){{var s=xe(Zt.type);if(!Gm.has(s)&&(Gm.add(s),Cr!==null)){for(var c="",h=30,v=0;v<=Wa;v++){for(var b=Cr[v],w=v===Wa?r:b,A=v+1+". "+b;A.length<h;)A+=" ";A+=w+`
|
|
120
|
-
`,
|
|
119
|
+
See https://reactjs.org/link/refs-must-have-owner for more information.`)}}return d}function $d(i,s){if(i.type!=="textarea")throw Error("Objects are not valid as a React child (found: "+(Object.prototype.toString.call(s)==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":s)+"). If you meant to render a collection of children, use an array instead.")}function qd(i){{var s=be(i.type)||"Component";if(kv[s])return;kv[s]=!0,m("Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.")}}function PS(i){function s(K,oe){if(i){var Y=K.lastEffect;Y!==null?(Y.nextEffect=oe,K.lastEffect=oe):K.firstEffect=K.lastEffect=oe,oe.nextEffect=null,oe.flags=Pe}}function u(K,oe){if(!i)return null;for(var Y=oe;Y!==null;)s(K,Y),Y=Y.sibling;return null}function d(K,oe){for(var Y=new Map,ve=oe;ve!==null;)ve.key!==null?Y.set(ve.key,ve):Y.set(ve.index,ve),ve=ve.sibling;return Y}function p(K,oe){var Y=Zo(K,oe);return Y.index=0,Y.sibling=null,Y}function S(K,oe,Y){if(K.index=Y,!i)return oe;var ve=K.alternate;if(ve!==null){var De=ve.index;return De<oe?(K.flags=Dt,oe):De}else return K.flags=Dt,oe}function E(K){return i&&K.alternate===null&&(K.flags=Dt),K}function R(K,oe,Y,ve){if(oe===null||oe.tag!==O){var De=ug(Y,K.mode,ve);return De.return=K,De}else{var ze=p(oe,Y);return ze.return=K,ze}}function D(K,oe,Y,ve){if(oe!==null&&(oe.elementType===Y.type||gx(oe,Y))){var De=p(oe,Y.props);return De.ref=zc(K,oe,Y),De.return=K,De._debugSource=Y._source,De._debugOwner=Y._owner,De}var ze=og(Y,K.mode,ve);return ze.ref=zc(K,oe,Y),ze.return=K,ze}function F(K,oe,Y,ve){if(oe===null||oe.tag!==L||oe.stateNode.containerInfo!==Y.containerInfo||oe.stateNode.implementation!==Y.implementation){var De=cg(Y,K.mode,ve);return De.return=K,De}else{var ze=p(oe,Y.children||[]);return ze.return=K,ze}}function W(K,oe,Y,ve,De){if(oe===null||oe.tag!==I){var ze=Jo(Y,K.mode,ve,De);return ze.return=K,ze}else{var bt=p(oe,Y);return bt.return=K,bt}}function X(K,oe,Y){if(typeof oe=="string"||typeof oe=="number"){var ve=ug(""+oe,K.mode,Y);return ve.return=K,ve}if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case He:{var De=og(oe,K.mode,Y);return De.ref=zc(K,null,oe),De.return=K,De}case ut:{var ze=cg(oe,K.mode,Y);return ze.return=K,ze}}if(Wd(oe)||Ve(oe)){var bt=Jo(oe,K.mode,Y,null);return bt.return=K,bt}$d(K,oe)}return typeof oe=="function"&&qd(K),null}function ee(K,oe,Y,ve){var De=oe!==null?oe.key:null;if(typeof Y=="string"||typeof Y=="number")return De!==null?null:R(K,oe,""+Y,ve);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case He:return Y.key===De?Y.type===pt?W(K,oe,Y.props.children,ve,De):D(K,oe,Y,ve):null;case ut:return Y.key===De?F(K,oe,Y,ve):null}if(Wd(Y)||Ve(Y))return De!==null?null:W(K,oe,Y,ve,null);$d(K,Y)}return typeof Y=="function"&&qd(K),null}function he(K,oe,Y,ve,De){if(typeof ve=="string"||typeof ve=="number"){var ze=K.get(Y)||null;return R(oe,ze,""+ve,De)}if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case He:{var bt=K.get(ve.key===null?Y:ve.key)||null;return ve.type===pt?W(oe,bt,ve.props.children,De,ve.key):D(oe,bt,ve,De)}case ut:{var tn=K.get(ve.key===null?Y:ve.key)||null;return F(oe,tn,ve,De)}}if(Wd(ve)||Ve(ve)){var fn=K.get(Y)||null;return W(oe,fn,ve,De,null)}$d(oe,ve)}return typeof ve=="function"&&qd(oe),null}function ye(K,oe,Y){{if(typeof K!="object"||K===null)return oe;switch(K.$$typeof){case He:case ut:LS(K,Y);var ve=K.key;if(typeof ve!="string")break;if(oe===null){oe=new Set,oe.add(ve);break}if(!oe.has(ve)){oe.add(ve);break}m("Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.",ve);break}}return oe}function Ee(K,oe,Y,ve){for(var De=null,ze=0;ze<Y.length;ze++){var bt=Y[ze];De=ye(bt,De,K)}for(var tn=null,fn=null,Nt=oe,Pn=0,Ot=0,dn=null;Nt!==null&&Ot<Y.length;Ot++){Nt.index>Ot?(dn=Nt,Nt=null):dn=Nt.sibling;var Xn=ee(K,Nt,Y[Ot],ve);if(Xn===null){Nt===null&&(Nt=dn);break}i&&Nt&&Xn.alternate===null&&s(K,Nt),Pn=S(Xn,Pn,Ot),fn===null?tn=Xn:fn.sibling=Xn,fn=Xn,Nt=dn}if(Ot===Y.length)return u(K,Nt),tn;if(Nt===null){for(;Ot<Y.length;Ot++){var Rn=X(K,Y[Ot],ve);Rn!==null&&(Pn=S(Rn,Pn,Ot),fn===null?tn=Rn:fn.sibling=Rn,fn=Rn)}return tn}for(var ds=d(K,Nt);Ot<Y.length;Ot++){var An=he(ds,K,Ot,Y[Ot],ve);An!==null&&(i&&An.alternate!==null&&ds.delete(An.key===null?Ot:An.key),Pn=S(An,Pn,Ot),fn===null?tn=An:fn.sibling=An,fn=An)}return i&&ds.forEach(function(hs){return s(K,hs)}),tn}function Xe(K,oe,Y,ve){var De=Ve(Y);if(typeof De!="function")throw Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.");{typeof Symbol=="function"&&Y[Symbol.toStringTag]==="Generator"&&(Dv||m("Using Generators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. Keep in mind you might need to polyfill these features for older browsers."),Dv=!0),Y.entries===De&&(Ov||m("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),Ov=!0);var ze=De.call(Y);if(ze)for(var bt=null,tn=ze.next();!tn.done;tn=ze.next()){var fn=tn.value;bt=ye(fn,bt,K)}}var Nt=De.call(Y);if(Nt==null)throw Error("An iterable object provided no iterator.");for(var Pn=null,Ot=null,dn=oe,Xn=0,Rn=0,ds=null,An=Nt.next();dn!==null&&!An.done;Rn++,An=Nt.next()){dn.index>Rn?(ds=dn,dn=null):ds=dn.sibling;var hs=ee(K,dn,An.value,ve);if(hs===null){dn===null&&(dn=ds);break}i&&dn&&hs.alternate===null&&s(K,dn),Xn=S(hs,Xn,Rn),Ot===null?Pn=hs:Ot.sibling=hs,Ot=hs,dn=ds}if(An.done)return u(K,dn),Pn;if(dn===null){for(;!An.done;Rn++,An=Nt.next()){var el=X(K,An.value,ve);el!==null&&(Xn=S(el,Xn,Rn),Ot===null?Pn=el:Ot.sibling=el,Ot=el)}return Pn}for(var pg=d(K,dn);!An.done;Rn++,An=Nt.next()){var Pa=he(pg,K,Rn,An.value,ve);Pa!==null&&(i&&Pa.alternate!==null&&pg.delete(Pa.key===null?Rn:Pa.key),Xn=S(Pa,Xn,Rn),Ot===null?Pn=Pa:Ot.sibling=Pa,Ot=Pa)}return i&&pg.forEach(function(hP){return s(K,hP)}),Pn}function St(K,oe,Y,ve){if(oe!==null&&oe.tag===O){u(K,oe.sibling);var De=p(oe,Y);return De.return=K,De}u(K,oe);var ze=ug(Y,K.mode,ve);return ze.return=K,ze}function it(K,oe,Y,ve){for(var De=Y.key,ze=oe;ze!==null;){if(ze.key===De){switch(ze.tag){case I:{if(Y.type===pt){u(K,ze.sibling);var bt=p(ze,Y.props.children);return bt.return=K,bt._debugSource=Y._source,bt._debugOwner=Y._owner,bt}break}case Z:default:{if(ze.elementType===Y.type||gx(ze,Y)){u(K,ze.sibling);var tn=p(ze,Y.props);return tn.ref=zc(K,ze,Y),tn.return=K,tn._debugSource=Y._source,tn._debugOwner=Y._owner,tn}break}}u(K,ze);break}else s(K,ze);ze=ze.sibling}if(Y.type===pt){var fn=Jo(Y.props.children,K.mode,ve,Y.key);return fn.return=K,fn}else{var Nt=og(Y,K.mode,ve);return Nt.ref=zc(K,oe,Y),Nt.return=K,Nt}}function Xt(K,oe,Y,ve){for(var De=Y.key,ze=oe;ze!==null;){if(ze.key===De)if(ze.tag===L&&ze.stateNode.containerInfo===Y.containerInfo&&ze.stateNode.implementation===Y.implementation){u(K,ze.sibling);var bt=p(ze,Y.children||[]);return bt.return=K,bt}else{u(K,ze);break}else s(K,ze);ze=ze.sibling}var tn=cg(Y,K.mode,ve);return tn.return=K,tn}function Tn(K,oe,Y,ve){var De=typeof Y=="object"&&Y!==null&&Y.type===pt&&Y.key===null;De&&(Y=Y.props.children);var ze=typeof Y=="object"&&Y!==null;if(ze)switch(Y.$$typeof){case He:return E(it(K,oe,Y,ve));case ut:return E(Xt(K,oe,Y,ve))}if(typeof Y=="string"||typeof Y=="number")return E(St(K,oe,""+Y,ve));if(Wd(Y))return Ee(K,oe,Y,ve);if(Ve(Y))return Xe(K,oe,Y,ve);if(ze&&$d(K,Y),typeof Y=="function"&&qd(K),typeof Y>"u"&&!De)switch(K.tag){case P:{var bt=K.stateNode;if(bt.render._isMockFunction)break}case Z:case A:case J:case ge:throw Error((be(K.type)||"Component")+"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.")}return u(K,oe)}return Tn}var Yd=PS(!0),kS=PS(!1);function hO(i,s){if(!(i===null||s.child===i.child))throw Error("Resuming work not yet implemented.");if(s.child!==null){var u=s.child,d=Zo(u,u.pendingProps);for(s.child=d,d.return=s;u.sibling!==null;)u=u.sibling,d=d.sibling=Zo(u,u.pendingProps),d.return=s;d.sibling=null}}function pO(i,s){for(var u=i.child;u!==null;)BL(u,s),u=u.sibling}var Nc={},Ca=Ii(Nc),_c=Ii(Nc),Qd=Ii(Nc);function Gd(i){if(i===Nc)throw Error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.");return i}function zv(){var i=Gd(Qd.current);return i}function Nv(i,s){Sn(Qd,s,i),Sn(_c,i,i),Sn(Ca,Nc,i);var u=Et(s);jt(Ca,i),Sn(Ca,u,i)}function fu(i){jt(Ca,i),jt(_c,i),jt(Qd,i)}function Uc(){var i=Gd(Ca.current);return i}function zS(i){var s=Gd(Qd.current),u=Gd(Ca.current),d=At(u,i.type,s);u!==d&&(Sn(_c,i,i),Sn(Ca,d,i))}function _v(i){_c.current===i&&(jt(Ca,i),jt(_c,i))}var vO=0,NS=1,Uv=1,jc=2,Ur=Ii(vO);function Xd(i,s){return(i&s)!==0}function Ic(i){return i&NS}function jv(i,s){return i&NS|s}function mO(i,s){return i|s}function jo(i,s){Sn(Ur,s,i)}function du(i){jt(Ur,i)}function gO(i,s){var u=i.memoizedState;if(u!==null)return u.dehydrated!==null;var d=i.memoizedProps;return d.fallback===void 0?!1:d.unstable_avoidThisFallback!==!0?!0:!s}function Kd(i){for(var s=i;s!==null;){if(s.tag===$){var u=s.memoizedState;if(u!==null){var d=u.dehydrated;if(d===null||Tl(d)||lc(d))return s}}else if(s.tag===_e&&s.memoizedProps.revealOrder!==void 0){var p=(s.flags&tt)!==at;if(p)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)return null;for(;s.sibling===null;){if(s.return===null||s.return===i)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var Iv=0,Io=1,Fo=2,Fc=4,mr=null,Bo=null,Ra=!1;function yO(i){if(!Jt)return!1;var s=i.stateNode.containerInfo;return Bo=On(s),mr=i,Ra=!0,!0}function _S(i,s){switch(i.tag){case _:gv(i.stateNode.containerInfo,s);break;case k:Ui(i.type,i.memoizedProps,i.stateNode,s);break}var u=YL();u.stateNode=s,u.return=i,u.flags=Pe,i.lastEffect!==null?(i.lastEffect.nextEffect=u,i.lastEffect=u):i.firstEffect=i.lastEffect=u}function US(i,s){switch(s.flags=s.flags&~bi|Dt,i.tag){case _:{var u=i.stateNode.containerInfo;switch(s.tag){case k:var d=s.type,p=s.pendingProps;yv(u,d,p);break;case O:var S=s.pendingProps;Rl(u,S);break;case $:Sv(u);break}break}case k:{var E=i.type,R=i.memoizedProps,D=i.stateNode;switch(s.tag){case k:var F=s.type,W=s.pendingProps;Zi(E,R,D,F,W);break;case O:var X=s.pendingProps;Al(E,R,D,X);break;case $:Ml(E,R,D);break}break}default:return}}function jS(i,s){switch(i.tag){case k:{var u=i.type,d=i.pendingProps,p=vv(s,u,d);return p!==null?(i.stateNode=p,!0):!1}case O:{var S=i.pendingProps,E=Tr(s,S);return E!==null?(i.stateNode=E,!0):!1}case $:return!1;default:return!1}}function Fv(i){if(Ra){var s=Bo;if(!s){US(mr,i),Ra=!1,mr=i;return}var u=s;if(!jS(i,s)){if(s=Cl(u),!s||!jS(i,s)){US(mr,i),Ra=!1,mr=i;return}_S(mr,u)}mr=i,Bo=On(s)}}function SO(i,s,u){if(!Jt)throw Error("Expected prepareToHydrateHostInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");var d=i.stateNode,p=sa(d,i.type,i.memoizedProps,s,u,i);return i.updateQueue=p,p!==null}function bO(i){if(!Jt)throw Error("Expected prepareToHydrateHostTextInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");var s=i.stateNode,u=i.memoizedProps,d=Rd(s,u,i);if(d){var p=mr;if(p!==null)switch(p.tag){case _:{var S=p.stateNode.containerInfo;Ad(S,s,u);break}case k:{var E=p.type,R=p.memoizedProps,D=p.stateNode;mv(E,R,D,s,u);break}}}return d}function xO(i){if(!Jt)throw Error("Expected skipPastDehydratedSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");var s=i.memoizedState,u=s!==null?s.dehydrated:null;if(!u)throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");return Cr(u)}function IS(i){for(var s=i.return;s!==null&&s.tag!==k&&s.tag!==_&&s.tag!==$;)s=s.return;mr=s}function Zd(i){if(!Jt||i!==mr)return!1;if(!Ra)return IS(i),Ra=!0,!1;var s=i.type;if(i.tag!==k||s!=="head"&&s!=="body"&&!Zn(s,i.memoizedProps))for(var u=Bo;u;)_S(i,u),u=Cl(u);return IS(i),i.tag===$?Bo=xO(i):Bo=mr?Cl(i.stateNode):null,!0}function Bv(){Jt&&(mr=null,Bo=null,Ra=!1)}function Hv(){return Ra}var Bc=[],Hc;Hc={};function EO(i){Bc.push(i)}function Vv(){for(var i=0;i<Bc.length;i++){var s=Bc[i];ln?s._workInProgressVersionPrimary=null:s._workInProgressVersionSecondary=null}Bc.length=0}function wO(i){return ln?i._workInProgressVersionPrimary:i._workInProgressVersionSecondary}function FS(i,s){ln?i._workInProgressVersionPrimary=s:i._workInProgressVersionSecondary=s,Bc.push(i)}function TO(i){ln?i._currentPrimaryRenderer==null?i._currentPrimaryRenderer=Hc:i._currentPrimaryRenderer!==Hc&&m("Detected multiple renderers concurrently rendering the same mutable source. This is currently unsupported."):i._currentSecondaryRenderer==null?i._currentSecondaryRenderer=Hc:i._currentSecondaryRenderer!==Hc&&m("Detected multiple renderers concurrently rendering the same mutable source. This is currently unsupported.")}var Me=g.ReactCurrentDispatcher,gr=g.ReactCurrentBatchConfig,Wv,$v;$v={},Wv=new Set;var Vc=ue,Gt=null,vi=null,Gn=null,Jd=!1,Wc=!1,CO=25,ce=null,yr=null,Aa=-1,qv=!1;function Yt(){{var i=ce;yr===null?yr=[i]:yr.push(i)}}function Le(){{var i=ce;yr!==null&&(Aa++,yr[Aa]!==i&&RO(i))}}function $c(i){i!=null&&!Array.isArray(i)&&m("%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.",ce,typeof i)}function RO(i){{var s=be(Gt.type);if(!Wv.has(s)&&(Wv.add(s),yr!==null)){for(var u="",d=30,p=0;p<=Aa;p++){for(var S=yr[p],E=p===Aa?i:S,R=p+1+". "+S;R.length<d;)R+=" ";R+=E+`
|
|
120
|
+
`,u+=R}m(`React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://reactjs.org/link/rules-of-hooks
|
|
121
121
|
|
|
122
122
|
Previous render Next render
|
|
123
123
|
------------------------------------------------------
|
|
124
124
|
%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
125
|
-
`,s,
|
|
125
|
+
`,s,u)}}}function Wi(){throw Error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
126
126
|
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
127
127
|
2. You might be breaking the Rules of Hooks
|
|
128
128
|
3. You might have more than one copy of React in the same app
|
|
129
|
-
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`)}function
|
|
129
|
+
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`)}function Yv(i,s){if(qv)return!1;if(s===null)return m("%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.",ce),!1;i.length!==s.length&&m(`The final argument passed to %s changed size between renders. The order and size of this array must remain constant.
|
|
130
130
|
|
|
131
131
|
Previous: %s
|
|
132
|
-
Incoming: %s`,ue,"["+s.join(", ")+"]","["+r.join(", ")+"]");for(var c=0;c<s.length&&c<r.length;c++)if(!An(r[c],s[c]))return!1;return!0}function Hu(r,s,c,h,v,b){wf=b,Zt=s,Cr=r!==null?r._debugHookTypes:null,Wa=-1,Km=r!==null&&r.type!==s.type,s.memoizedState=null,s.updateQueue=null,s.lanes=le,r!==null&&r.memoizedState!==null?Oe.current=mx:Cr!==null?Oe.current=vx:Oe.current=px;var w=c(h,v);if(Cf){var A=0;do{if(Cf=!1,!(A<QD))throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");A+=1,Km=!1,bi=null,ei=null,s.updateQueue=null,Wa=-1,Oe.current=gx,w=c(h,v)}while(Cf)}Oe.current=$h,s._debugHookTypes=Cr;var D=bi!==null&&bi.next!==null;if(wf=le,Zt=null,bi=null,ei=null,ue=null,Cr=null,Wa=-1,Ph=!1,D)throw Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");return w}function nx(r,s,c){s.updateQueue=r.updateQueue,s.flags&=~(Wn|it),r.lanes=Uo(r.lanes,c)}function ix(){if(Oe.current=$h,Ph){for(var r=Zt.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}Ph=!1}wf=le,Zt=null,bi=null,ei=null,Cr=null,Wa=-1,ue=null,Vh=!1,Cf=!1}function hl(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ei===null?Zt.memoizedState=ei=r:ei=ei.next=r,ei}function pl(){var r;if(bi===null){var s=Zt.alternate;s!==null?r=s.memoizedState:r=null}else r=bi.next;var c;if(ei===null?c=Zt.memoizedState:c=ei.next,c!==null)ei=c,c=ei.next,bi=r;else{if(r===null)throw Error("Rendered more hooks than during the previous render.");bi=r;var h={memoizedState:bi.memoizedState,baseState:bi.baseState,baseQueue:bi.baseQueue,queue:bi.queue,next:null};ei===null?Zt.memoizedState=ei=h:ei=ei.next=h}return ei}function XD(){return{lastEffect:null}}function Dh(r,s){return typeof s=="function"?s(r):s}function Jm(r,s,c){var h=hl(),v;c!==void 0?v=c(s):v=s,h.memoizedState=h.baseState=v;var b=h.queue={pending:null,dispatch:null,lastRenderedReducer:r,lastRenderedState:v},w=b.dispatch=dg.bind(null,Zt,b);return[h.memoizedState,w]}function eg(r,s,c){var h=pl(),v=h.queue;if(v===null)throw Error("Should have a queue. This is likely a bug in React. Please file an issue.");v.lastRenderedReducer=r;var b=bi,w=b.baseQueue,A=v.pending;if(A!==null){if(w!==null){var D=w.next,F=A.next;w.next=F,A.next=D}b.baseQueue!==w&&m("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React."),b.baseQueue=w=A,v.pending=null}if(w!==null){var $=w.next,X=b.baseState,J=null,pe=null,ye=null,Ce=$;do{var Ze=Ce.lane;if(fs(wf,Ze)){if(ye!==null){var st={lane:Gn,action:Ce.action,eagerReducer:Ce.eagerReducer,eagerState:Ce.eagerState,next:null};ye=ye.next=st}if(Ce.eagerReducer===r)X=Ce.eagerState;else{var Jt=Ce.action;X=r(X,Jt)}}else{var bt={lane:Ze,action:Ce.action,eagerReducer:Ce.eagerReducer,eagerState:Ce.eagerState,next:null};ye===null?(pe=ye=bt,J=X):ye=ye.next=bt,Zt.lanes=At(Zt.lanes,Ze),Zg(Ze)}Ce=Ce.next}while(Ce!==null&&Ce!==$);ye===null?J=X:ye.next=pe,An(X,h.memoizedState)||Rg(),h.memoizedState=X,h.baseState=J,h.baseQueue=ye,v.lastRenderedState=X}var Rn=v.dispatch;return[h.memoizedState,Rn]}function tg(r,s,c){var h=pl(),v=h.queue;if(v===null)throw Error("Should have a queue. This is likely a bug in React. Please file an issue.");v.lastRenderedReducer=r;var b=v.dispatch,w=v.pending,A=h.memoizedState;if(w!==null){v.pending=null;var D=w.next,F=D;do{var $=F.action;A=r(A,$),F=F.next}while(F!==D);An(A,h.memoizedState)||Rg(),h.memoizedState=A,h.baseQueue===null&&(h.baseState=A),v.lastRenderedState=A}return[A,b]}function rx(r,s,c){YD(s);var h=s._getVersion,v=h(s._source),b=!1,w=qD(s);if(w!==null?b=w===v:(b=fs(wf,r.mutableReadLanes),b&&tx(s,v)),b){var A=c(s._source);return typeof A=="function"&&m("Mutable source should not return a function as the snapshot value. Functions may close over mutable values and cause tearing."),A}else throw WD(s),Error("Cannot read from mutable source during the current render without tearing. This is a bug in React. Please file an issue.")}function sx(r,s,c,h){var v=fI();if(v===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");var b=s._getVersion,w=b(s._source),A=Oe.current,D=A.useState(function(){return rx(v,s,c)}),F=D[0],$=D[1],X=F,J=ei,pe=r.memoizedState,ye=pe.refs,Ce=ye.getSnapshot,Ze=pe.source,bt=pe.subscribe,st=Zt;if(r.memoizedState={refs:ye,source:s,subscribe:h},A.useEffect(function(){ye.getSnapshot=c,ye.setSnapshot=$;var Rn=b(s._source);if(!An(w,Rn)){var K=c(s._source);if(typeof K=="function"&&m("Mutable source should not return a function as the snapshot value. Functions may close over mutable values and cause tearing."),!An(X,K)){$(K);var ae=Ya(st);Fo(v,ae)}Mu(v,v.mutableReadLanes)}},[c,s,h]),A.useEffect(function(){var Rn=function(){var ae=ye.getSnapshot,Y=ye.setSnapshot;try{Y(ae(s._source));var ve=Ya(st);Fo(v,ve)}catch(Le){Y(function(){throw Le})}},K=h(s._source,Rn);return typeof K!="function"&&m("Mutable source subscribe function must return an unsubscribe function."),K},[s,h]),!An(Ce,c)||!An(Ze,s)||!An(bt,h)){var Jt={pending:null,dispatch:null,lastRenderedReducer:Dh,lastRenderedState:X};Jt.dispatch=$=dg.bind(null,Zt,Jt),J.queue=Jt,J.baseQueue=null,X=rx(v,s,c),J.memoizedState=J.baseState=X}return X}function ng(r,s,c){var h=hl();return h.memoizedState={refs:{getSnapshot:s,setSnapshot:null},source:r,subscribe:c},sx(h,r,s,c)}function kh(r,s,c){var h=pl();return sx(h,r,s,c)}function vl(r){var s=hl();typeof r=="function"&&(r=r()),s.memoizedState=s.baseState=r;var c=s.queue={pending:null,dispatch:null,lastRenderedReducer:Dh,lastRenderedState:r},h=c.dispatch=dg.bind(null,Zt,c);return[s.memoizedState,h]}function Rf(r){return eg(Dh)}function Af(r){return tg(Dh)}function Ih(r,s,c,h){var v={tag:r,create:s,destroy:c,deps:h,next:null},b=Zt.updateQueue;if(b===null)b=XD(),Zt.updateQueue=b,b.lastEffect=v.next=v;else{var w=b.lastEffect;if(w===null)b.lastEffect=v.next=v;else{var A=w.next;w.next=v,v.next=A,b.lastEffect=v}}return v}function Nh(r){var s=hl(),c={current:r};return Object.seal(c),s.memoizedState=c,c}function Vu(r){var s=pl();return s.memoizedState}function ig(r,s,c,h){var v=hl(),b=h===void 0?null:h;Zt.flags|=r,v.memoizedState=Ih(cl|s,c,void 0,b)}function rg(r,s,c,h){var v=pl(),b=h===void 0?null:h,w=void 0;if(bi!==null){var A=bi.memoizedState;if(w=A.destroy,b!==null){var D=A.deps;if(Zm(b,D)){Ih(s,c,w,b);return}}}Zt.flags|=r,v.memoizedState=Ih(cl|s,c,w,b)}function zh(r,s){return typeof jest<"u"&&ww(Zt),ig(it|Wn,bf,r,s)}function $u(r,s){return typeof jest<"u"&&ww(Zt),rg(it|Wn,bf,r,s)}function sg(r,s){return ig(it,fl,r,s)}function Uh(r,s){return rg(it,fl,r,s)}function ax(r,s){if(typeof s=="function"){var c=s,h=r();return c(h),function(){c(null)}}else if(s!=null){var v=s;v.hasOwnProperty("current")||m("Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.","an object with keys {"+Object.keys(v).join(", ")+"}");var b=r();return v.current=b,function(){v.current=null}}}function ag(r,s,c){typeof s!="function"&&m("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",s!==null?typeof s:"null");var h=c!=null?c.concat([r]):null;return ig(it,fl,ax.bind(null,s,r),h)}function jh(r,s,c){typeof s!="function"&&m("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",s!==null?typeof s:"null");var h=c!=null?c.concat([r]):null;return rg(it,fl,ax.bind(null,s,r),h)}function KD(r,s){}var Fh=KD;function og(r,s){var c=hl(),h=s===void 0?null:s;return c.memoizedState=[r,h],r}function Bh(r,s){var c=pl(),h=s===void 0?null:s,v=c.memoizedState;if(v!==null&&h!==null){var b=v[1];if(Zm(h,b))return v[0]}return c.memoizedState=[r,h],r}function lg(r,s){var c=hl(),h=s===void 0?null:s,v=r();return c.memoizedState=[v,h],v}function Hh(r,s){var c=pl(),h=s===void 0?null:s,v=c.memoizedState;if(v!==null&&h!==null){var b=v[1];if(Zm(h,b))return v[0]}var w=r();return c.memoizedState=[w,h],w}function ug(r){var s=vl(r),c=s[0],h=s[1];return zh(function(){var v=wr.transition;wr.transition=1;try{h(r)}finally{wr.transition=v}},[r]),c}function ox(r){var s=Rf(),c=s[0],h=s[1];return $u(function(){var v=wr.transition;wr.transition=1;try{h(r)}finally{wr.transition=v}},[r]),c}function lx(r){var s=Af(),c=s[0],h=s[1];return $u(function(){var v=wr.transition;wr.transition=1;try{h(r)}finally{wr.transition=v}},[r]),c}function ZD(r,s){var c=_e();lr(c<Li?Li:c,function(){r(!0)}),lr(c>Qi?Qi:c,function(){var h=wr.transition;wr.transition=1;try{r(!1),s()}finally{wr.transition=h}})}function cg(){var r=vl(!1),s=r[0],c=r[1],h=ZD.bind(null,c);return Nh(h),[h,s]}function ux(){var r=Rf(),s=r[0],c=Vu(),h=c.current;return[h,s]}function cx(){var r=Af(),s=r[0],c=Vu(),h=c.current;return[h,s]}var Vh=!1;function JD(){return Vh}function fx(r){{var s=xe(r.type)||"Unknown";xh()&&!Xm[s]&&(m("The object passed back from useOpaqueIdentifier is meant to be passed through to attributes only. Do not read the value directly."),Xm[s]=!0)}}function fg(){var r=Jd.bind(null,fx.bind(null,Zt));if(Ym()){var s=!1,c=Zt,h=function(){throw s||(s=!0,Vh=!0,b(r()),Vh=!1,fx(c)),Error("The object passed back from useOpaqueIdentifier is meant to be passed through to attributes only. Do not read the value directly.")},v=Zd(h),b=vl(v)[1];return(Zt.mode&In)===Yt&&(Zt.flags|=it|Wn,Ih(cl|bf,function(){b(r())},void 0,null)),v}else{var w=r();return vl(w),w}}function dx(){var r=Rf()[0];return r}function hx(){var r=Af()[0];return r}function dg(r,s,c){typeof arguments[3]=="function"&&m("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect().");var h=Ji(),v=Ya(r),b={lane:v,action:c,eagerReducer:null,eagerState:null,next:null},w=s.pending;w===null?b.next=b:(b.next=w.next,w.next=b),s.pending=b;var A=r.alternate;if(r===Zt||A!==null&&A===Zt)Cf=Ph=!0;else{if(r.lanes===le&&(A===null||A.lanes===le)){var D=s.lastRenderedReducer;if(D!==null){var F;F=Oe.current,Oe.current=Wr;try{var $=s.lastRenderedState,X=D($,c);if(b.eagerReducer=D,b.eagerState=X,An(X,$))return}catch{}finally{Oe.current=F}}}typeof jest<"u"&&(xw(r),KI(r)),fi(r,v,h)}}var $h={readContext:Ht,useCallback:Xi,useContext:Xi,useEffect:Xi,useImperativeHandle:Xi,useLayoutEffect:Xi,useMemo:Xi,useReducer:Xi,useRef:Xi,useState:Xi,useDebugValue:Xi,useDeferredValue:Xi,useTransition:Xi,useMutableSource:Xi,useOpaqueIdentifier:Xi,unstable_isNewReconciler:nr},px=null,vx=null,mx=null,gx=null,ms=null,Wr=null,Wh=null;{var hg=function(){m("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().")},dt=function(){m("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://reactjs.org/link/rules-of-hooks")};px={readContext:function(r,s){return Ht(r,s)},useCallback:function(r,s){return ue="useCallback",Gt(),Tf(s),og(r,s)},useContext:function(r,s){return ue="useContext",Gt(),Ht(r,s)},useEffect:function(r,s){return ue="useEffect",Gt(),Tf(s),zh(r,s)},useImperativeHandle:function(r,s,c){return ue="useImperativeHandle",Gt(),Tf(c),ag(r,s,c)},useLayoutEffect:function(r,s){return ue="useLayoutEffect",Gt(),Tf(s),sg(r,s)},useMemo:function(r,s){ue="useMemo",Gt(),Tf(s);var c=Oe.current;Oe.current=ms;try{return lg(r,s)}finally{Oe.current=c}},useReducer:function(r,s,c){ue="useReducer",Gt();var h=Oe.current;Oe.current=ms;try{return Jm(r,s,c)}finally{Oe.current=h}},useRef:function(r){return ue="useRef",Gt(),Nh(r)},useState:function(r){ue="useState",Gt();var s=Oe.current;Oe.current=ms;try{return vl(r)}finally{Oe.current=s}},useDebugValue:function(r,s){return ue="useDebugValue",Gt(),void 0},useDeferredValue:function(r){return ue="useDeferredValue",Gt(),ug(r)},useTransition:function(){return ue="useTransition",Gt(),cg()},useMutableSource:function(r,s,c){return ue="useMutableSource",Gt(),ng(r,s,c)},useOpaqueIdentifier:function(){return ue="useOpaqueIdentifier",Gt(),fg()},unstable_isNewReconciler:nr},vx={readContext:function(r,s){return Ht(r,s)},useCallback:function(r,s){return ue="useCallback",Pe(),og(r,s)},useContext:function(r,s){return ue="useContext",Pe(),Ht(r,s)},useEffect:function(r,s){return ue="useEffect",Pe(),zh(r,s)},useImperativeHandle:function(r,s,c){return ue="useImperativeHandle",Pe(),ag(r,s,c)},useLayoutEffect:function(r,s){return ue="useLayoutEffect",Pe(),sg(r,s)},useMemo:function(r,s){ue="useMemo",Pe();var c=Oe.current;Oe.current=ms;try{return lg(r,s)}finally{Oe.current=c}},useReducer:function(r,s,c){ue="useReducer",Pe();var h=Oe.current;Oe.current=ms;try{return Jm(r,s,c)}finally{Oe.current=h}},useRef:function(r){return ue="useRef",Pe(),Nh(r)},useState:function(r){ue="useState",Pe();var s=Oe.current;Oe.current=ms;try{return vl(r)}finally{Oe.current=s}},useDebugValue:function(r,s){return ue="useDebugValue",Pe(),void 0},useDeferredValue:function(r){return ue="useDeferredValue",Pe(),ug(r)},useTransition:function(){return ue="useTransition",Pe(),cg()},useMutableSource:function(r,s,c){return ue="useMutableSource",Pe(),ng(r,s,c)},useOpaqueIdentifier:function(){return ue="useOpaqueIdentifier",Pe(),fg()},unstable_isNewReconciler:nr},mx={readContext:function(r,s){return Ht(r,s)},useCallback:function(r,s){return ue="useCallback",Pe(),Bh(r,s)},useContext:function(r,s){return ue="useContext",Pe(),Ht(r,s)},useEffect:function(r,s){return ue="useEffect",Pe(),$u(r,s)},useImperativeHandle:function(r,s,c){return ue="useImperativeHandle",Pe(),jh(r,s,c)},useLayoutEffect:function(r,s){return ue="useLayoutEffect",Pe(),Uh(r,s)},useMemo:function(r,s){ue="useMemo",Pe();var c=Oe.current;Oe.current=Wr;try{return Hh(r,s)}finally{Oe.current=c}},useReducer:function(r,s,c){ue="useReducer",Pe();var h=Oe.current;Oe.current=Wr;try{return eg(r,s,c)}finally{Oe.current=h}},useRef:function(r){return ue="useRef",Pe(),Vu()},useState:function(r){ue="useState",Pe();var s=Oe.current;Oe.current=Wr;try{return Rf(r)}finally{Oe.current=s}},useDebugValue:function(r,s){return ue="useDebugValue",Pe(),Fh()},useDeferredValue:function(r){return ue="useDeferredValue",Pe(),ox(r)},useTransition:function(){return ue="useTransition",Pe(),ux()},useMutableSource:function(r,s,c){return ue="useMutableSource",Pe(),kh(r,s,c)},useOpaqueIdentifier:function(){return ue="useOpaqueIdentifier",Pe(),dx()},unstable_isNewReconciler:nr},gx={readContext:function(r,s){return Ht(r,s)},useCallback:function(r,s){return ue="useCallback",Pe(),Bh(r,s)},useContext:function(r,s){return ue="useContext",Pe(),Ht(r,s)},useEffect:function(r,s){return ue="useEffect",Pe(),$u(r,s)},useImperativeHandle:function(r,s,c){return ue="useImperativeHandle",Pe(),jh(r,s,c)},useLayoutEffect:function(r,s){return ue="useLayoutEffect",Pe(),Uh(r,s)},useMemo:function(r,s){ue="useMemo",Pe();var c=Oe.current;Oe.current=Wh;try{return Hh(r,s)}finally{Oe.current=c}},useReducer:function(r,s,c){ue="useReducer",Pe();var h=Oe.current;Oe.current=Wh;try{return tg(r,s,c)}finally{Oe.current=h}},useRef:function(r){return ue="useRef",Pe(),Vu()},useState:function(r){ue="useState",Pe();var s=Oe.current;Oe.current=Wh;try{return Af(r)}finally{Oe.current=s}},useDebugValue:function(r,s){return ue="useDebugValue",Pe(),Fh()},useDeferredValue:function(r){return ue="useDeferredValue",Pe(),lx(r)},useTransition:function(){return ue="useTransition",Pe(),cx()},useMutableSource:function(r,s,c){return ue="useMutableSource",Pe(),kh(r,s,c)},useOpaqueIdentifier:function(){return ue="useOpaqueIdentifier",Pe(),hx()},unstable_isNewReconciler:nr},ms={readContext:function(r,s){return hg(),Ht(r,s)},useCallback:function(r,s){return ue="useCallback",dt(),Gt(),og(r,s)},useContext:function(r,s){return ue="useContext",dt(),Gt(),Ht(r,s)},useEffect:function(r,s){return ue="useEffect",dt(),Gt(),zh(r,s)},useImperativeHandle:function(r,s,c){return ue="useImperativeHandle",dt(),Gt(),ag(r,s,c)},useLayoutEffect:function(r,s){return ue="useLayoutEffect",dt(),Gt(),sg(r,s)},useMemo:function(r,s){ue="useMemo",dt(),Gt();var c=Oe.current;Oe.current=ms;try{return lg(r,s)}finally{Oe.current=c}},useReducer:function(r,s,c){ue="useReducer",dt(),Gt();var h=Oe.current;Oe.current=ms;try{return Jm(r,s,c)}finally{Oe.current=h}},useRef:function(r){return ue="useRef",dt(),Gt(),Nh(r)},useState:function(r){ue="useState",dt(),Gt();var s=Oe.current;Oe.current=ms;try{return vl(r)}finally{Oe.current=s}},useDebugValue:function(r,s){return ue="useDebugValue",dt(),Gt(),void 0},useDeferredValue:function(r){return ue="useDeferredValue",dt(),Gt(),ug(r)},useTransition:function(){return ue="useTransition",dt(),Gt(),cg()},useMutableSource:function(r,s,c){return ue="useMutableSource",dt(),Gt(),ng(r,s,c)},useOpaqueIdentifier:function(){return ue="useOpaqueIdentifier",dt(),Gt(),fg()},unstable_isNewReconciler:nr},Wr={readContext:function(r,s){return hg(),Ht(r,s)},useCallback:function(r,s){return ue="useCallback",dt(),Pe(),Bh(r,s)},useContext:function(r,s){return ue="useContext",dt(),Pe(),Ht(r,s)},useEffect:function(r,s){return ue="useEffect",dt(),Pe(),$u(r,s)},useImperativeHandle:function(r,s,c){return ue="useImperativeHandle",dt(),Pe(),jh(r,s,c)},useLayoutEffect:function(r,s){return ue="useLayoutEffect",dt(),Pe(),Uh(r,s)},useMemo:function(r,s){ue="useMemo",dt(),Pe();var c=Oe.current;Oe.current=Wr;try{return Hh(r,s)}finally{Oe.current=c}},useReducer:function(r,s,c){ue="useReducer",dt(),Pe();var h=Oe.current;Oe.current=Wr;try{return eg(r,s,c)}finally{Oe.current=h}},useRef:function(r){return ue="useRef",dt(),Pe(),Vu()},useState:function(r){ue="useState",dt(),Pe();var s=Oe.current;Oe.current=Wr;try{return Rf(r)}finally{Oe.current=s}},useDebugValue:function(r,s){return ue="useDebugValue",dt(),Pe(),Fh()},useDeferredValue:function(r){return ue="useDeferredValue",dt(),Pe(),ox(r)},useTransition:function(){return ue="useTransition",dt(),Pe(),ux()},useMutableSource:function(r,s,c){return ue="useMutableSource",dt(),Pe(),kh(r,s,c)},useOpaqueIdentifier:function(){return ue="useOpaqueIdentifier",dt(),Pe(),dx()},unstable_isNewReconciler:nr},Wh={readContext:function(r,s){return hg(),Ht(r,s)},useCallback:function(r,s){return ue="useCallback",dt(),Pe(),Bh(r,s)},useContext:function(r,s){return ue="useContext",dt(),Pe(),Ht(r,s)},useEffect:function(r,s){return ue="useEffect",dt(),Pe(),$u(r,s)},useImperativeHandle:function(r,s,c){return ue="useImperativeHandle",dt(),Pe(),jh(r,s,c)},useLayoutEffect:function(r,s){return ue="useLayoutEffect",dt(),Pe(),Uh(r,s)},useMemo:function(r,s){ue="useMemo",dt(),Pe();var c=Oe.current;Oe.current=Wr;try{return Hh(r,s)}finally{Oe.current=c}},useReducer:function(r,s,c){ue="useReducer",dt(),Pe();var h=Oe.current;Oe.current=Wr;try{return tg(r,s,c)}finally{Oe.current=h}},useRef:function(r){return ue="useRef",dt(),Pe(),Vu()},useState:function(r){ue="useState",dt(),Pe();var s=Oe.current;Oe.current=Wr;try{return Af(r)}finally{Oe.current=s}},useDebugValue:function(r,s){return ue="useDebugValue",dt(),Pe(),Fh()},useDeferredValue:function(r){return ue="useDeferredValue",dt(),Pe(),lx(r)},useTransition:function(){return ue="useTransition",dt(),Pe(),cx()},useMutableSource:function(r,s,c){return ue="useMutableSource",dt(),Pe(),kh(r,s,c)},useOpaqueIdentifier:function(){return ue="useOpaqueIdentifier",dt(),Pe(),hx()},unstable_isNewReconciler:nr}}var qh=f.unstable_now,yx=0,Mf=-1;function ek(){return yx}function Sx(){yx=qh()}function pg(r){Mf=qh(),r.actualStartTime<0&&(r.actualStartTime=qh())}function bx(r){Mf=-1}function Yh(r,s){if(Mf>=0){var c=qh()-Mf;r.actualDuration+=c,s&&(r.selfBaseDuration=c),Mf=-1}}function vg(r){for(var s=r.child;s;)r.actualDuration+=s.actualDuration,s=s.sibling}var Of=g.ReactCurrentOwner,gs=!1,mg,_f,gg,yg,Sg,ml,bg,Qh;mg={},_f={},gg={},yg={},Sg={},ml=!1,bg={},Qh={};function Ki(r,s,c,h){r===null?s.child=QE(s,null,c,h):s.child=Rh(s,r.child,c,h)}function tk(r,s,c,h){s.child=Rh(s,r.child,null,h),s.child=Rh(s,null,c,h)}function Ex(r,s,c,h,v){if(s.type!==s.elementType){var b=c.propTypes;b&&vi(b,h,"prop",xe(c))}var w=c.render,A=s.ref,D;Fa(s,v);{if(Of.current=s,li(!0),D=Hu(r,s,w,h,A,v),s.mode&_t){$i();try{D=Hu(r,s,w,h,A,v)}finally{sr()}}li(!1)}return r!==null&&!gs?(nx(r,s,v),Xs(r,s,v)):(s.flags|=pi,Ki(r,s,D,v),s.child)}function xx(r,s,c,h,v,b){if(r===null){var w=c.type;if(lN(w)&&c.compare===null&&c.defaultProps===void 0){var A=w;return A=Ku(w),s.tag=ge,s.type=A,Cg(s,w),wx(r,s,A,h,v,b)}{var D=w.propTypes;D&&vi(D,h,"prop",xe(w))}var F=fy(c.type,null,h,s,s.mode,b);return F.ref=s.ref,F.return=s,s.child=F,F}{var $=c.type,X=$.propTypes;X&&vi(X,h,"prop",xe($))}var J=r.child;if(!Hn(v,b)){var pe=J.memoizedProps,ye=c.compare;if(ye=ye!==null?ye:$s,ye(pe,h)&&r.ref===s.ref)return Xs(r,s,b)}s.flags|=pi;var Ce=wl(J,h);return Ce.ref=s.ref,Ce.return=s,s.child=Ce,Ce}function wx(r,s,c,h,v,b){if(s.type!==s.elementType){var w=s.elementType;if(w.$$typeof===wt){var A=w,D=A._payload,F=A._init;try{w=F(D)}catch{w=null}var $=w&&w.propTypes;$&&vi($,h,"prop",xe(w))}}if(r!==null){var X=r.memoizedProps;if($s(X,h)&&r.ref===s.ref&&s.type===r.type)if(gs=!1,Hn(b,v))(r.flags&Ea)!==ct&&(gs=!0);else return s.lanes=r.lanes,Xs(r,s,b)}return xg(r,s,c,h,b)}function Eg(r,s,c){var h=s.pendingProps,v=h.children,b=r!==null?r.memoizedState:null;if(h.mode==="hidden"||h.mode==="unstable-defer-without-hiding")if((s.mode&Fr)===Yt){var w={baseLanes:le};s.memoizedState=w,Ep(s,c)}else if(Hn(c,_i)){var $={baseLanes:le};s.memoizedState=$;var X=b!==null?b.baseLanes:c;Ep(s,X)}else{var A;if(b!==null){var D=b.baseLanes;A=At(D,c)}else A=c;Rp(_i),s.lanes=s.childLanes=_i;var F={baseLanes:A};return s.memoizedState=F,Ep(s,A),null}else{var J;b!==null?(J=At(b.baseLanes,c),s.memoizedState=null):J=c,Ep(s,J)}return Ki(r,s,v,c),s.child}var nk=Eg;function ik(r,s,c){var h=s.pendingProps;return Ki(r,s,h,c),s.child}function rk(r,s,c){var h=s.pendingProps.children;return Ki(r,s,h,c),s.child}function sk(r,s,c){{s.flags|=it;var h=s.stateNode;h.effectDuration=0,h.passiveEffectDuration=0}var v=s.pendingProps,b=v.children;return Ki(r,s,b,c),s.child}function Cx(r,s){var c=s.ref;(r===null&&c!==null||r!==null&&r.ref!==c)&&(s.flags|=ln)}function xg(r,s,c,h,v){if(s.type!==s.elementType){var b=c.propTypes;b&&vi(b,h,"prop",xe(c))}var w;{var A=as(s,c,!0);w=Ir(s,A)}var D;Fa(s,v);{if(Of.current=s,li(!0),D=Hu(r,s,c,h,w,v),s.mode&_t){$i();try{D=Hu(r,s,c,h,w,v)}finally{sr()}}li(!1)}return r!==null&&!gs?(nx(r,s,v),Xs(r,s,v)):(s.flags|=pi,Ki(r,s,D,v),s.child)}function Tx(r,s,c,h,v){if(s.type!==s.elementType){var b=c.propTypes;b&&vi(b,h,"prop",xe(c))}var w;Yn(c)?(w=!0,Co(s)):w=!1,Fa(s,v);var A=s.stateNode,D;A===null?(r!==null&&(r.alternate=null,s.alternate=null,s.flags|=Pt),Vr(s,c,h),Dm(s,c,h,v),D=!0):r===null?D=kD(s,c,h,v):D=ID(r,s,c,h,v);var F=wg(r,s,c,D,w,v);{var $=s.stateNode;D&&$.props!==h&&(ml||m("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",xe(s.type)||"a component"),ml=!0)}return F}function wg(r,s,c,h,v,b){Cx(r,s);var w=(s.flags&rt)!==ct;if(!h&&!w)return v&&To(s,c,!1),Xs(r,s,b);var A=s.stateNode;Of.current=s;var D;if(w&&typeof c.getDerivedStateFromError!="function")D=null,bx();else{if(li(!0),D=A.render(),s.mode&_t){$i();try{A.render()}finally{sr()}}li(!1)}return s.flags|=pi,r!==null&&w?tk(r,s,D,b):Ki(r,s,D,b),s.memoizedState=A.state,v&&To(s,c,!0),s.child}function Rx(r){var s=r.stateNode;s.pendingContext?$c(r,s.pendingContext,s.pendingContext!==s.context):s.context&&$c(r,s.context,!1),Fm(r,s.containerInfo)}function ak(r,s,c){Rx(s);var h=s.updateQueue;if(!(r!==null&&h!==null))throw Error("If the root does not have an updateQueue, we should have already bailed out. This error is likely caused by a bug in React. Please file an issue.");var v=s.pendingProps,b=s.memoizedState,w=b!==null?b.element:null;ll(r,s),d(s,v,null,c);var A=s.memoizedState,D=A.element;if(D===w)return qm(),Xs(r,s,c);var F=s.stateNode;if(F.hydrate&&BD(s)){if(tn){var $=F.mutableSourceEagerHydrationData;if($!=null)for(var X=0;X<$.length;X+=2){var J=$[X],pe=$[X+1];tx(J,pe)}}var ye=QE(s,null,D,c);s.child=ye;for(var Ce=ye;Ce;)Ce.flags=Ce.flags&~Pt|Ri,Ce=Ce.sibling}else Ki(r,s,D,c),qm();return s.child}function ok(r,s,c){GE(s),r===null&&Wm(s);var h=s.type,v=s.pendingProps,b=r!==null?r.memoizedProps:null,w=v.children,A=ii(h,v);return A?w=null:b!==null&&ii(h,b)&&(s.flags|=at),Cx(r,s),Ki(r,s,w,c),s.child}function lk(r,s){return r===null&&Wm(s),null}function uk(r,s,c,h,v){r!==null&&(r.alternate=null,s.alternate=null,s.flags|=Pt);var b=s.pendingProps,w=c,A=w._payload,D=w._init,F=D(A);s.type=F;var $=s.tag=uN(F),X=cr(F,b),J;switch($){case R:return Cg(s,F),s.type=F=Ku(F),J=xg(null,s,F,X,v),J;case _:return s.type=F=sy(F),J=Tx(null,s,F,X,v),J;case Z:return s.type=F=ay(F),J=Ex(null,s,F,X,v),J;case re:{if(s.type!==s.elementType){var pe=F.propTypes;pe&&vi(pe,X,"prop",xe(F))}return J=xx(null,s,F,cr(F.type,X),h,v),J}}var ye="";throw F!==null&&typeof F=="object"&&F.$$typeof===wt&&(ye=" Did you wrap a component in React.lazy() more than once?"),Error("Element type is invalid. Received a promise that resolves to: "+F+". Lazy element type must resolve to a class or function."+ye)}function ck(r,s,c,h,v){r!==null&&(r.alternate=null,s.alternate=null,s.flags|=Pt),s.tag=_;var b;return Yn(c)?(b=!0,Co(s)):b=!1,Fa(s,v),Vr(s,c,h),Dm(s,c,h,v),wg(null,s,c,!0,b,v)}function fk(r,s,c,h){r!==null&&(r.alternate=null,s.alternate=null,s.flags|=Pt);var v=s.pendingProps,b;{var w=as(s,c,!1);b=Ir(s,w)}Fa(s,h);var A;{if(c.prototype&&typeof c.prototype.render=="function"){var D=xe(c)||"Unknown";mg[D]||(m("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.",D,D),mg[D]=!0)}s.mode&_t&&Gi.recordLegacyContextWarning(s,null),li(!0),Of.current=s,A=Hu(null,s,c,v,b,h),li(!1)}if(s.flags|=pi,typeof A=="object"&&A!==null&&typeof A.render=="function"&&A.$$typeof===void 0){var F=xe(c)||"Unknown";_f[F]||(m("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.",F,F,F),_f[F]=!0)}if(typeof A=="object"&&A!==null&&typeof A.render=="function"&&A.$$typeof===void 0){{var $=xe(c)||"Unknown";_f[$]||(m("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.",$,$,$),_f[$]=!0)}s.tag=_,s.memoizedState=null,s.updateQueue=null;var X=!1;Yn(c)?(X=!0,Co(s)):X=!1,s.memoizedState=A.state!==null&&A.state!==void 0?A.state:null,ju(s);var J=c.getDerivedStateFromProps;return typeof J=="function"&&It(s,c,J,v),St(s,A),Dm(s,c,v,h),wg(null,s,c,!0,X,h)}else{if(s.tag=R,s.mode&_t){$i();try{A=Hu(null,s,c,v,b,h)}finally{sr()}}return Ki(null,s,A,h),Cg(s,c),s.child}}function Cg(r,s){{if(s&&s.childContextTypes&&m("%s(...): childContextTypes cannot be defined on a function component.",s.displayName||s.name||"Component"),r.ref!==null){var c="",h=bh();h&&(c+=`
|
|
132
|
+
Incoming: %s`,ce,"["+s.join(", ")+"]","["+i.join(", ")+"]");for(var u=0;u<s.length&&u<i.length;u++)if(!Cn(i[u],s[u]))return!1;return!0}function hu(i,s,u,d,p,S){Vc=S,Gt=s,yr=i!==null?i._debugHookTypes:null,Aa=-1,qv=i!==null&&i.type!==s.type,s.memoizedState=null,s.updateQueue=null,s.lanes=ue,i!==null&&i.memoizedState!==null?Me.current=tb:yr!==null?Me.current=eb:Me.current=JS;var E=u(d,p);if(Wc){var R=0;do{if(Wc=!1,!(R<CO))throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");R+=1,qv=!1,vi=null,Gn=null,s.updateQueue=null,Aa=-1,Me.current=nb,E=u(d,p)}while(Wc)}Me.current=fh,s._debugHookTypes=yr;var D=vi!==null&&vi.next!==null;if(Vc=ue,Gt=null,vi=null,Gn=null,ce=null,yr=null,Aa=-1,Jd=!1,D)throw Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");return E}function BS(i,s,u){s.updateQueue=i.updateQueue,s.flags&=~(Fn|et),i.lanes=ho(i.lanes,u)}function HS(){if(Me.current=fh,Jd){for(var i=Gt.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}Jd=!1}Vc=ue,Gt=null,vi=null,Gn=null,yr=null,Aa=-1,ce=null,ch=!1,Wc=!1}function Ho(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Gn===null?Gt.memoizedState=Gn=i:Gn=Gn.next=i,Gn}function Vo(){var i;if(vi===null){var s=Gt.alternate;s!==null?i=s.memoizedState:i=null}else i=vi.next;var u;if(Gn===null?u=Gt.memoizedState:u=Gn.next,u!==null)Gn=u,u=Gn.next,vi=i;else{if(i===null)throw Error("Rendered more hooks than during the previous render.");vi=i;var d={memoizedState:vi.memoizedState,baseState:vi.baseState,baseQueue:vi.baseQueue,queue:vi.queue,next:null};Gn===null?Gt.memoizedState=Gn=d:Gn=Gn.next=d}return Gn}function AO(){return{lastEffect:null}}function eh(i,s){return typeof s=="function"?s(i):s}function Qv(i,s,u){var d=Ho(),p;u!==void 0?p=u(s):p=s,d.memoizedState=d.baseState=p;var S=d.queue={pending:null,dispatch:null,lastRenderedReducer:i,lastRenderedState:p},E=S.dispatch=om.bind(null,Gt,S);return[d.memoizedState,E]}function Gv(i,s,u){var d=Vo(),p=d.queue;if(p===null)throw Error("Should have a queue. This is likely a bug in React. Please file an issue.");p.lastRenderedReducer=i;var S=vi,E=S.baseQueue,R=p.pending;if(R!==null){if(E!==null){var D=E.next,F=R.next;E.next=F,R.next=D}S.baseQueue!==E&&m("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React."),S.baseQueue=E=R,p.pending=null}if(E!==null){var W=E.next,X=S.baseState,ee=null,he=null,ye=null,Ee=W;do{var Xe=Ee.lane;if(is(Vc,Xe)){if(ye!==null){var it={lane:Wn,action:Ee.action,eagerReducer:Ee.eagerReducer,eagerState:Ee.eagerState,next:null};ye=ye.next=it}if(Ee.eagerReducer===i)X=Ee.eagerState;else{var Xt=Ee.action;X=i(X,Xt)}}else{var St={lane:Xe,action:Ee.action,eagerReducer:Ee.eagerReducer,eagerState:Ee.eagerState,next:null};ye===null?(he=ye=St,ee=X):ye=ye.next=St,Gt.lanes=Ct(Gt.lanes,Xe),Ym(Xe)}Ee=Ee.next}while(Ee!==null&&Ee!==W);ye===null?ee=X:ye.next=he,Cn(X,d.memoizedState)||xm(),d.memoizedState=X,d.baseState=ee,d.baseQueue=ye,p.lastRenderedState=X}var Tn=p.dispatch;return[d.memoizedState,Tn]}function Xv(i,s,u){var d=Vo(),p=d.queue;if(p===null)throw Error("Should have a queue. This is likely a bug in React. Please file an issue.");p.lastRenderedReducer=i;var S=p.dispatch,E=p.pending,R=d.memoizedState;if(E!==null){p.pending=null;var D=E.next,F=D;do{var W=F.action;R=i(R,W),F=F.next}while(F!==D);Cn(R,d.memoizedState)||xm(),d.memoizedState=R,d.baseQueue===null&&(d.baseState=R),p.lastRenderedState=R}return[R,S]}function VS(i,s,u){TO(s);var d=s._getVersion,p=d(s._source),S=!1,E=wO(s);if(E!==null?S=E===p:(S=is(Vc,i.mutableReadLanes),S&&FS(s,p)),S){var R=u(s._source);return typeof R=="function"&&m("Mutable source should not return a function as the snapshot value. Functions may close over mutable values and cause tearing."),R}else throw EO(s),Error("Cannot read from mutable source during the current render without tearing. This is a bug in React. Please file an issue.")}function WS(i,s,u,d){var p=HD();if(p===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");var S=s._getVersion,E=S(s._source),R=Me.current,D=R.useState(function(){return VS(p,s,u)}),F=D[0],W=D[1],X=F,ee=Gn,he=i.memoizedState,ye=he.refs,Ee=ye.getSnapshot,Xe=he.source,St=he.subscribe,it=Gt;if(i.memoizedState={refs:ye,source:s,subscribe:d},R.useEffect(function(){ye.getSnapshot=u,ye.setSnapshot=W;var Tn=S(s._source);if(!Cn(E,Tn)){var K=u(s._source);if(typeof K=="function"&&m("Mutable source should not return a function as the snapshot value. Functions may close over mutable values and cause tearing."),!Cn(X,K)){W(K);var oe=Oa(it);vo(p,oe)}Jl(p,p.mutableReadLanes)}},[u,s,d]),R.useEffect(function(){var Tn=function(){var oe=ye.getSnapshot,Y=ye.setSnapshot;try{Y(oe(s._source));var ve=Oa(it);vo(p,ve)}catch(De){Y(function(){throw De})}},K=d(s._source,Tn);return typeof K!="function"&&m("Mutable source subscribe function must return an unsubscribe function."),K},[s,d]),!Cn(Ee,u)||!Cn(Xe,s)||!Cn(St,d)){var Xt={pending:null,dispatch:null,lastRenderedReducer:eh,lastRenderedState:X};Xt.dispatch=W=om.bind(null,Gt,Xt),ee.queue=Xt,ee.baseQueue=null,X=VS(p,s,u),ee.memoizedState=ee.baseState=X}return X}function Kv(i,s,u){var d=Ho();return d.memoizedState={refs:{getSnapshot:s,setSnapshot:null},source:i,subscribe:u},WS(d,i,s,u)}function th(i,s,u){var d=Vo();return WS(d,i,s,u)}function Wo(i){var s=Ho();typeof i=="function"&&(i=i()),s.memoizedState=s.baseState=i;var u=s.queue={pending:null,dispatch:null,lastRenderedReducer:eh,lastRenderedState:i},d=u.dispatch=om.bind(null,Gt,u);return[s.memoizedState,d]}function qc(i){return Gv(eh)}function Yc(i){return Xv(eh)}function nh(i,s,u,d){var p={tag:i,create:s,destroy:u,deps:d,next:null},S=Gt.updateQueue;if(S===null)S=AO(),Gt.updateQueue=S,S.lastEffect=p.next=p;else{var E=S.lastEffect;if(E===null)S.lastEffect=p.next=p;else{var R=E.next;E.next=p,p.next=R,S.lastEffect=p}}return p}function ih(i){var s=Ho(),u={current:i};return Object.seal(u),s.memoizedState=u,u}function pu(i){var s=Vo();return s.memoizedState}function Zv(i,s,u,d){var p=Ho(),S=d===void 0?null:d;Gt.flags|=i,p.memoizedState=nh(Io|s,u,void 0,S)}function Jv(i,s,u,d){var p=Vo(),S=d===void 0?null:d,E=void 0;if(vi!==null){var R=vi.memoizedState;if(E=R.destroy,S!==null){var D=R.deps;if(Yv(S,D)){nh(s,u,E,S);return}}}Gt.flags|=i,p.memoizedState=nh(Io|s,u,E,S)}function rh(i,s){return typeof jest<"u"&&lx(Gt),Zv(et|Fn,Fc,i,s)}function vu(i,s){return typeof jest<"u"&&lx(Gt),Jv(et|Fn,Fc,i,s)}function em(i,s){return Zv(et,Fo,i,s)}function sh(i,s){return Jv(et,Fo,i,s)}function $S(i,s){if(typeof s=="function"){var u=s,d=i();return u(d),function(){u(null)}}else if(s!=null){var p=s;p.hasOwnProperty("current")||m("Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.","an object with keys {"+Object.keys(p).join(", ")+"}");var S=i();return p.current=S,function(){p.current=null}}}function tm(i,s,u){typeof s!="function"&&m("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",s!==null?typeof s:"null");var d=u!=null?u.concat([i]):null;return Zv(et,Fo,$S.bind(null,s,i),d)}function ah(i,s,u){typeof s!="function"&&m("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",s!==null?typeof s:"null");var d=u!=null?u.concat([i]):null;return Jv(et,Fo,$S.bind(null,s,i),d)}function MO(i,s){}var oh=MO;function nm(i,s){var u=Ho(),d=s===void 0?null:s;return u.memoizedState=[i,d],i}function lh(i,s){var u=Vo(),d=s===void 0?null:s,p=u.memoizedState;if(p!==null&&d!==null){var S=p[1];if(Yv(d,S))return p[0]}return u.memoizedState=[i,d],i}function im(i,s){var u=Ho(),d=s===void 0?null:s,p=i();return u.memoizedState=[p,d],p}function uh(i,s){var u=Vo(),d=s===void 0?null:s,p=u.memoizedState;if(p!==null&&d!==null){var S=p[1];if(Yv(d,S))return p[0]}var E=i();return u.memoizedState=[E,d],E}function rm(i){var s=Wo(i),u=s[0],d=s[1];return rh(function(){var p=gr.transition;gr.transition=1;try{d(i)}finally{gr.transition=p}},[i]),u}function qS(i){var s=qc(),u=s[0],d=s[1];return vu(function(){var p=gr.transition;gr.transition=1;try{d(i)}finally{gr.transition=p}},[i]),u}function YS(i){var s=Yc(),u=s[0],d=s[1];return vu(function(){var p=gr.transition;gr.transition=1;try{d(i)}finally{gr.transition=p}},[i]),u}function OO(i,s){var u=Oe();nr(u<Ci?Ci:u,function(){i(!0)}),nr(u>Hi?Hi:u,function(){var d=gr.transition;gr.transition=1;try{i(!1),s()}finally{gr.transition=d}})}function sm(){var i=Wo(!1),s=i[0],u=i[1],d=OO.bind(null,u);return ih(d),[d,s]}function QS(){var i=qc(),s=i[0],u=pu(),d=u.current;return[d,s]}function GS(){var i=Yc(),s=i[0],u=pu(),d=u.current;return[d,s]}var ch=!1;function DO(){return ch}function XS(i){{var s=be(i.type)||"Unknown";Vd()&&!$v[s]&&(m("The object passed back from useOpaqueIdentifier is meant to be passed through to attributes only. Do not read the value directly."),$v[s]=!0)}}function am(){var i=bd.bind(null,XS.bind(null,Gt));if(Hv()){var s=!1,u=Gt,d=function(){throw s||(s=!0,ch=!0,S(i()),ch=!1,XS(u)),Error("The object passed back from useOpaqueIdentifier is meant to be passed through to attributes only. Do not read the value directly.")},p=Sd(d),S=Wo(p)[1];return(Gt.mode&Ln)===$t&&(Gt.flags|=et|Fn,nh(Io|Fc,function(){S(i())},void 0,null)),p}else{var E=i();return Wo(E),E}}function KS(){var i=qc()[0];return i}function ZS(){var i=Yc()[0];return i}function om(i,s,u){typeof arguments[3]=="function"&&m("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect().");var d=Yi(),p=Oa(i),S={lane:p,action:u,eagerReducer:null,eagerState:null,next:null},E=s.pending;E===null?S.next=S:(S.next=E.next,E.next=S),s.pending=S;var R=i.alternate;if(i===Gt||R!==null&&R===Gt)Wc=Jd=!0;else{if(i.lanes===ue&&(R===null||R.lanes===ue)){var D=s.lastRenderedReducer;if(D!==null){var F;F=Me.current,Me.current=jr;try{var W=s.lastRenderedState,X=D(W,u);if(S.eagerReducer=D,S.eagerState=X,Cn(X,W))return}catch{}finally{Me.current=F}}}typeof jest<"u"&&(ox(i),ML(i)),ai(i,p,d)}}var fh={readContext:Ft,useCallback:Wi,useContext:Wi,useEffect:Wi,useImperativeHandle:Wi,useLayoutEffect:Wi,useMemo:Wi,useReducer:Wi,useRef:Wi,useState:Wi,useDebugValue:Wi,useDeferredValue:Wi,useTransition:Wi,useMutableSource:Wi,useOpaqueIdentifier:Wi,unstable_isNewReconciler:Xi},JS=null,eb=null,tb=null,nb=null,ls=null,jr=null,dh=null;{var lm=function(){m("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().")},lt=function(){m("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://reactjs.org/link/rules-of-hooks")};JS={readContext:function(i,s){return Ft(i,s)},useCallback:function(i,s){return ce="useCallback",Yt(),$c(s),nm(i,s)},useContext:function(i,s){return ce="useContext",Yt(),Ft(i,s)},useEffect:function(i,s){return ce="useEffect",Yt(),$c(s),rh(i,s)},useImperativeHandle:function(i,s,u){return ce="useImperativeHandle",Yt(),$c(u),tm(i,s,u)},useLayoutEffect:function(i,s){return ce="useLayoutEffect",Yt(),$c(s),em(i,s)},useMemo:function(i,s){ce="useMemo",Yt(),$c(s);var u=Me.current;Me.current=ls;try{return im(i,s)}finally{Me.current=u}},useReducer:function(i,s,u){ce="useReducer",Yt();var d=Me.current;Me.current=ls;try{return Qv(i,s,u)}finally{Me.current=d}},useRef:function(i){return ce="useRef",Yt(),ih(i)},useState:function(i){ce="useState",Yt();var s=Me.current;Me.current=ls;try{return Wo(i)}finally{Me.current=s}},useDebugValue:function(i,s){return ce="useDebugValue",Yt(),void 0},useDeferredValue:function(i){return ce="useDeferredValue",Yt(),rm(i)},useTransition:function(){return ce="useTransition",Yt(),sm()},useMutableSource:function(i,s,u){return ce="useMutableSource",Yt(),Kv(i,s,u)},useOpaqueIdentifier:function(){return ce="useOpaqueIdentifier",Yt(),am()},unstable_isNewReconciler:Xi},eb={readContext:function(i,s){return Ft(i,s)},useCallback:function(i,s){return ce="useCallback",Le(),nm(i,s)},useContext:function(i,s){return ce="useContext",Le(),Ft(i,s)},useEffect:function(i,s){return ce="useEffect",Le(),rh(i,s)},useImperativeHandle:function(i,s,u){return ce="useImperativeHandle",Le(),tm(i,s,u)},useLayoutEffect:function(i,s){return ce="useLayoutEffect",Le(),em(i,s)},useMemo:function(i,s){ce="useMemo",Le();var u=Me.current;Me.current=ls;try{return im(i,s)}finally{Me.current=u}},useReducer:function(i,s,u){ce="useReducer",Le();var d=Me.current;Me.current=ls;try{return Qv(i,s,u)}finally{Me.current=d}},useRef:function(i){return ce="useRef",Le(),ih(i)},useState:function(i){ce="useState",Le();var s=Me.current;Me.current=ls;try{return Wo(i)}finally{Me.current=s}},useDebugValue:function(i,s){return ce="useDebugValue",Le(),void 0},useDeferredValue:function(i){return ce="useDeferredValue",Le(),rm(i)},useTransition:function(){return ce="useTransition",Le(),sm()},useMutableSource:function(i,s,u){return ce="useMutableSource",Le(),Kv(i,s,u)},useOpaqueIdentifier:function(){return ce="useOpaqueIdentifier",Le(),am()},unstable_isNewReconciler:Xi},tb={readContext:function(i,s){return Ft(i,s)},useCallback:function(i,s){return ce="useCallback",Le(),lh(i,s)},useContext:function(i,s){return ce="useContext",Le(),Ft(i,s)},useEffect:function(i,s){return ce="useEffect",Le(),vu(i,s)},useImperativeHandle:function(i,s,u){return ce="useImperativeHandle",Le(),ah(i,s,u)},useLayoutEffect:function(i,s){return ce="useLayoutEffect",Le(),sh(i,s)},useMemo:function(i,s){ce="useMemo",Le();var u=Me.current;Me.current=jr;try{return uh(i,s)}finally{Me.current=u}},useReducer:function(i,s,u){ce="useReducer",Le();var d=Me.current;Me.current=jr;try{return Gv(i,s,u)}finally{Me.current=d}},useRef:function(i){return ce="useRef",Le(),pu()},useState:function(i){ce="useState",Le();var s=Me.current;Me.current=jr;try{return qc(i)}finally{Me.current=s}},useDebugValue:function(i,s){return ce="useDebugValue",Le(),oh()},useDeferredValue:function(i){return ce="useDeferredValue",Le(),qS(i)},useTransition:function(){return ce="useTransition",Le(),QS()},useMutableSource:function(i,s,u){return ce="useMutableSource",Le(),th(i,s,u)},useOpaqueIdentifier:function(){return ce="useOpaqueIdentifier",Le(),KS()},unstable_isNewReconciler:Xi},nb={readContext:function(i,s){return Ft(i,s)},useCallback:function(i,s){return ce="useCallback",Le(),lh(i,s)},useContext:function(i,s){return ce="useContext",Le(),Ft(i,s)},useEffect:function(i,s){return ce="useEffect",Le(),vu(i,s)},useImperativeHandle:function(i,s,u){return ce="useImperativeHandle",Le(),ah(i,s,u)},useLayoutEffect:function(i,s){return ce="useLayoutEffect",Le(),sh(i,s)},useMemo:function(i,s){ce="useMemo",Le();var u=Me.current;Me.current=dh;try{return uh(i,s)}finally{Me.current=u}},useReducer:function(i,s,u){ce="useReducer",Le();var d=Me.current;Me.current=dh;try{return Xv(i,s,u)}finally{Me.current=d}},useRef:function(i){return ce="useRef",Le(),pu()},useState:function(i){ce="useState",Le();var s=Me.current;Me.current=dh;try{return Yc(i)}finally{Me.current=s}},useDebugValue:function(i,s){return ce="useDebugValue",Le(),oh()},useDeferredValue:function(i){return ce="useDeferredValue",Le(),YS(i)},useTransition:function(){return ce="useTransition",Le(),GS()},useMutableSource:function(i,s,u){return ce="useMutableSource",Le(),th(i,s,u)},useOpaqueIdentifier:function(){return ce="useOpaqueIdentifier",Le(),ZS()},unstable_isNewReconciler:Xi},ls={readContext:function(i,s){return lm(),Ft(i,s)},useCallback:function(i,s){return ce="useCallback",lt(),Yt(),nm(i,s)},useContext:function(i,s){return ce="useContext",lt(),Yt(),Ft(i,s)},useEffect:function(i,s){return ce="useEffect",lt(),Yt(),rh(i,s)},useImperativeHandle:function(i,s,u){return ce="useImperativeHandle",lt(),Yt(),tm(i,s,u)},useLayoutEffect:function(i,s){return ce="useLayoutEffect",lt(),Yt(),em(i,s)},useMemo:function(i,s){ce="useMemo",lt(),Yt();var u=Me.current;Me.current=ls;try{return im(i,s)}finally{Me.current=u}},useReducer:function(i,s,u){ce="useReducer",lt(),Yt();var d=Me.current;Me.current=ls;try{return Qv(i,s,u)}finally{Me.current=d}},useRef:function(i){return ce="useRef",lt(),Yt(),ih(i)},useState:function(i){ce="useState",lt(),Yt();var s=Me.current;Me.current=ls;try{return Wo(i)}finally{Me.current=s}},useDebugValue:function(i,s){return ce="useDebugValue",lt(),Yt(),void 0},useDeferredValue:function(i){return ce="useDeferredValue",lt(),Yt(),rm(i)},useTransition:function(){return ce="useTransition",lt(),Yt(),sm()},useMutableSource:function(i,s,u){return ce="useMutableSource",lt(),Yt(),Kv(i,s,u)},useOpaqueIdentifier:function(){return ce="useOpaqueIdentifier",lt(),Yt(),am()},unstable_isNewReconciler:Xi},jr={readContext:function(i,s){return lm(),Ft(i,s)},useCallback:function(i,s){return ce="useCallback",lt(),Le(),lh(i,s)},useContext:function(i,s){return ce="useContext",lt(),Le(),Ft(i,s)},useEffect:function(i,s){return ce="useEffect",lt(),Le(),vu(i,s)},useImperativeHandle:function(i,s,u){return ce="useImperativeHandle",lt(),Le(),ah(i,s,u)},useLayoutEffect:function(i,s){return ce="useLayoutEffect",lt(),Le(),sh(i,s)},useMemo:function(i,s){ce="useMemo",lt(),Le();var u=Me.current;Me.current=jr;try{return uh(i,s)}finally{Me.current=u}},useReducer:function(i,s,u){ce="useReducer",lt(),Le();var d=Me.current;Me.current=jr;try{return Gv(i,s,u)}finally{Me.current=d}},useRef:function(i){return ce="useRef",lt(),Le(),pu()},useState:function(i){ce="useState",lt(),Le();var s=Me.current;Me.current=jr;try{return qc(i)}finally{Me.current=s}},useDebugValue:function(i,s){return ce="useDebugValue",lt(),Le(),oh()},useDeferredValue:function(i){return ce="useDeferredValue",lt(),Le(),qS(i)},useTransition:function(){return ce="useTransition",lt(),Le(),QS()},useMutableSource:function(i,s,u){return ce="useMutableSource",lt(),Le(),th(i,s,u)},useOpaqueIdentifier:function(){return ce="useOpaqueIdentifier",lt(),Le(),KS()},unstable_isNewReconciler:Xi},dh={readContext:function(i,s){return lm(),Ft(i,s)},useCallback:function(i,s){return ce="useCallback",lt(),Le(),lh(i,s)},useContext:function(i,s){return ce="useContext",lt(),Le(),Ft(i,s)},useEffect:function(i,s){return ce="useEffect",lt(),Le(),vu(i,s)},useImperativeHandle:function(i,s,u){return ce="useImperativeHandle",lt(),Le(),ah(i,s,u)},useLayoutEffect:function(i,s){return ce="useLayoutEffect",lt(),Le(),sh(i,s)},useMemo:function(i,s){ce="useMemo",lt(),Le();var u=Me.current;Me.current=jr;try{return uh(i,s)}finally{Me.current=u}},useReducer:function(i,s,u){ce="useReducer",lt(),Le();var d=Me.current;Me.current=jr;try{return Xv(i,s,u)}finally{Me.current=d}},useRef:function(i){return ce="useRef",lt(),Le(),pu()},useState:function(i){ce="useState",lt(),Le();var s=Me.current;Me.current=jr;try{return Yc(i)}finally{Me.current=s}},useDebugValue:function(i,s){return ce="useDebugValue",lt(),Le(),oh()},useDeferredValue:function(i){return ce="useDeferredValue",lt(),Le(),YS(i)},useTransition:function(){return ce="useTransition",lt(),Le(),GS()},useMutableSource:function(i,s,u){return ce="useMutableSource",lt(),Le(),th(i,s,u)},useOpaqueIdentifier:function(){return ce="useOpaqueIdentifier",lt(),Le(),ZS()},unstable_isNewReconciler:Xi}}var hh=h.unstable_now,ib=0,Qc=-1;function LO(){return ib}function rb(){ib=hh()}function um(i){Qc=hh(),i.actualStartTime<0&&(i.actualStartTime=hh())}function sb(i){Qc=-1}function ph(i,s){if(Qc>=0){var u=hh()-Qc;i.actualDuration+=u,s&&(i.selfBaseDuration=u),Qc=-1}}function cm(i){for(var s=i.child;s;)i.actualDuration+=s.actualDuration,s=s.sibling}var Gc=g.ReactCurrentOwner,us=!1,fm,Xc,dm,hm,pm,$o,vm,vh;fm={},Xc={},dm={},hm={},pm={},$o=!1,vm={},vh={};function $i(i,s,u,d){i===null?s.child=kS(s,null,u,d):s.child=Yd(s,i.child,u,d)}function PO(i,s,u,d){s.child=Yd(s,i.child,null,d),s.child=Yd(s,null,u,d)}function ab(i,s,u,d,p){if(s.type!==s.elementType){var S=u.propTypes;S&&ci(S,d,"prop",be(u))}var E=u.render,R=s.ref,D;Ea(s,p);{if(Gc.current=s,ii(!0),D=hu(i,s,E,d,R,p),s.mode&Mt){ji();try{D=hu(i,s,E,d,R,p)}finally{Ji()}}ii(!1)}return i!==null&&!us?(BS(i,s,p),Is(i,s,p)):(s.flags|=ui,$i(i,s,D,p),s.child)}function ob(i,s,u,d,p,S){if(i===null){var E=u.type;if(IL(E)&&u.compare===null&&u.defaultProps===void 0){var R=E;return R=Eu(E),s.tag=ge,s.type=R,Sm(s,E),lb(i,s,R,d,p,S)}{var D=E.propTypes;D&&ci(D,d,"prop",be(E))}var F=ag(u.type,null,d,s,s.mode,S);return F.ref=s.ref,F.return=s,s.child=F,F}{var W=u.type,X=W.propTypes;X&&ci(X,d,"prop",be(W))}var ee=i.child;if(!Un(p,S)){var he=ee.memoizedProps,ye=u.compare;if(ye=ye!==null?ye:ks,ye(he,d)&&i.ref===s.ref)return Is(i,s,S)}s.flags|=ui;var Ee=Zo(ee,d);return Ee.ref=s.ref,Ee.return=s,s.child=Ee,Ee}function lb(i,s,u,d,p,S){if(s.type!==s.elementType){var E=s.elementType;if(E.$$typeof===ft){var R=E,D=R._payload,F=R._init;try{E=F(D)}catch{E=null}var W=E&&E.propTypes;W&&ci(W,d,"prop",be(E))}}if(i!==null){var X=i.memoizedProps;if(ks(X,d)&&i.ref===s.ref&&s.type===i.type)if(us=!1,Un(S,p))(i.flags&ia)!==at&&(us=!0);else return s.lanes=i.lanes,Is(i,s,S)}return gm(i,s,u,d,S)}function mm(i,s,u){var d=s.pendingProps,p=d.children,S=i!==null?i.memoizedState:null;if(d.mode==="hidden"||d.mode==="unstable-defer-without-hiding")if((s.mode&kr)===$t){var E={baseLanes:ue};s.memoizedState=E,Hh(s,u)}else if(Un(u,Ti)){var W={baseLanes:ue};s.memoizedState=W;var X=S!==null?S.baseLanes:u;Hh(s,X)}else{var R;if(S!==null){var D=S.baseLanes;R=Ct(D,u)}else R=u;Yh(Ti),s.lanes=s.childLanes=Ti;var F={baseLanes:R};return s.memoizedState=F,Hh(s,R),null}else{var ee;S!==null?(ee=Ct(S.baseLanes,u),s.memoizedState=null):ee=u,Hh(s,ee)}return $i(i,s,p,u),s.child}var kO=mm;function zO(i,s,u){var d=s.pendingProps;return $i(i,s,d,u),s.child}function NO(i,s,u){var d=s.pendingProps.children;return $i(i,s,d,u),s.child}function _O(i,s,u){{s.flags|=et;var d=s.stateNode;d.effectDuration=0,d.passiveEffectDuration=0}var p=s.pendingProps,S=p.children;return $i(i,s,S,u),s.child}function ub(i,s){var u=s.ref;(i===null&&u!==null||i!==null&&i.ref!==u)&&(s.flags|=an)}function gm(i,s,u,d,p){if(s.type!==s.elementType){var S=u.propTypes;S&&ci(S,d,"prop",be(u))}var E;{var R=Zr(s,u,!0);E=Mr(s,R)}var D;Ea(s,p);{if(Gc.current=s,ii(!0),D=hu(i,s,u,d,E,p),s.mode&Mt){ji();try{D=hu(i,s,u,d,E,p)}finally{Ji()}}ii(!1)}return i!==null&&!us?(BS(i,s,p),Is(i,s,p)):(s.flags|=ui,$i(i,s,D,p),s.child)}function cb(i,s,u,d,p){if(s.type!==s.elementType){var S=u.propTypes;S&&ci(S,d,"prop",be(u))}var E;Hn(u)?(E=!0,Za(s)):E=!1,Ea(s,p);var R=s.stateNode,D;R===null?(i!==null&&(i.alternate=null,s.alternate=null,s.flags|=Dt),_r(s,u,d),Mv(s,u,d,p),D=!0):i===null?D=fO(s,u,d,p):D=dO(i,s,u,d,p);var F=ym(i,s,u,D,E,p);{var W=s.stateNode;D&&W.props!==d&&($o||m("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",be(s.type)||"a component"),$o=!0)}return F}function ym(i,s,u,d,p,S){ub(i,s);var E=(s.flags&tt)!==at;if(!d&&!E)return p&&Ja(s,u,!1),Is(i,s,S);var R=s.stateNode;Gc.current=s;var D;if(E&&typeof u.getDerivedStateFromError!="function")D=null,sb();else{if(ii(!0),D=R.render(),s.mode&Mt){ji();try{R.render()}finally{Ji()}}ii(!1)}return s.flags|=ui,i!==null&&E?PO(i,s,D,S):$i(i,s,D,S),s.memoizedState=R.state,p&&Ja(s,u,!0),s.child}function fb(i){var s=i.stateNode;s.pendingContext?fc(i,s.pendingContext,s.pendingContext!==s.context):s.context&&fc(i,s.context,!1),Nv(i,s.containerInfo)}function UO(i,s,u){fb(s);var d=s.updateQueue;if(!(i!==null&&d!==null))throw Error("If the root does not have an updateQueue, we should have already bailed out. This error is likely caused by a bug in React. Please file an issue.");var p=s.pendingProps,S=s.memoizedState,E=S!==null?S.element:null;Uo(i,s),f(s,p,null,u);var R=s.memoizedState,D=R.element;if(D===E)return Bv(),Is(i,s,u);var F=s.stateNode;if(F.hydrate&&yO(s)){if(Jt){var W=F.mutableSourceEagerHydrationData;if(W!=null)for(var X=0;X<W.length;X+=2){var ee=W[X],he=W[X+1];FS(ee,he)}}var ye=kS(s,null,D,u);s.child=ye;for(var Ee=ye;Ee;)Ee.flags=Ee.flags&~Dt|bi,Ee=Ee.sibling}else $i(i,s,D,u),Bv();return s.child}function jO(i,s,u){zS(s),i===null&&Fv(s);var d=s.type,p=s.pendingProps,S=i!==null?i.memoizedProps:null,E=p.children,R=Zn(d,p);return R?E=null:S!==null&&Zn(d,S)&&(s.flags|=rt),ub(i,s),$i(i,s,E,u),s.child}function IO(i,s){return i===null&&Fv(s),null}function FO(i,s,u,d,p){i!==null&&(i.alternate=null,s.alternate=null,s.flags|=Dt);var S=s.pendingProps,E=u,R=E._payload,D=E._init,F=D(R);s.type=F;var W=s.tag=FL(F),X=rr(F,S),ee;switch(W){case A:return Sm(s,F),s.type=F=Eu(F),ee=gm(null,s,F,X,p),ee;case P:return s.type=F=eg(F),ee=cb(null,s,F,X,p),ee;case J:return s.type=F=tg(F),ee=ab(null,s,F,X,p),ee;case se:{if(s.type!==s.elementType){var he=F.propTypes;he&&ci(he,X,"prop",be(F))}return ee=ob(null,s,F,rr(F.type,X),d,p),ee}}var ye="";throw F!==null&&typeof F=="object"&&F.$$typeof===ft&&(ye=" Did you wrap a component in React.lazy() more than once?"),Error("Element type is invalid. Received a promise that resolves to: "+F+". Lazy element type must resolve to a class or function."+ye)}function BO(i,s,u,d,p){i!==null&&(i.alternate=null,s.alternate=null,s.flags|=Dt),s.tag=P;var S;return Hn(u)?(S=!0,Za(s)):S=!1,Ea(s,p),_r(s,u,d),Mv(s,u,d,p),ym(null,s,u,!0,S,p)}function HO(i,s,u,d){i!==null&&(i.alternate=null,s.alternate=null,s.flags|=Dt);var p=s.pendingProps,S;{var E=Zr(s,u,!1);S=Mr(s,E)}Ea(s,d);var R;{if(u.prototype&&typeof u.prototype.render=="function"){var D=be(u)||"Unknown";fm[D]||(m("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.",D,D),fm[D]=!0)}s.mode&Mt&&Vi.recordLegacyContextWarning(s,null),ii(!0),Gc.current=s,R=hu(null,s,u,p,S,d),ii(!1)}if(s.flags|=ui,typeof R=="object"&&R!==null&&typeof R.render=="function"&&R.$$typeof===void 0){var F=be(u)||"Unknown";Xc[F]||(m("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.",F,F,F),Xc[F]=!0)}if(typeof R=="object"&&R!==null&&typeof R.render=="function"&&R.$$typeof===void 0){{var W=be(u)||"Unknown";Xc[W]||(m("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.",W,W,W),Xc[W]=!0)}s.tag=P,s.memoizedState=null,s.updateQueue=null;var X=!1;Hn(u)?(X=!0,Za(s)):X=!1,s.memoizedState=R.state!==null&&R.state!==void 0?R.state:null,cu(s);var ee=u.getDerivedStateFromProps;return typeof ee=="function"&&kt(s,u,ee,p),yt(s,R),Mv(s,u,p,d),ym(null,s,u,!0,X,d)}else{if(s.tag=A,s.mode&Mt){ji();try{R=hu(null,s,u,p,S,d)}finally{Ji()}}return $i(null,s,R,d),Sm(s,u),s.child}}function Sm(i,s){{if(s&&s.childContextTypes&&m("%s(...): childContextTypes cannot be defined on a function component.",s.displayName||s.name||"Component"),i.ref!==null){var u="",d=Bd();d&&(u+=`
|
|
133
133
|
|
|
134
|
-
Check the render method of \``+h+"`.");var v=h||r._debugID||"",b=r._debugSource;b&&(v=b.fileName+":"+b.lineNumber),Sg[v]||(Sg[v]=!0,m("Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?%s",c))}if(typeof s.getDerivedStateFromProps=="function"){var w=xe(s)||"Unknown";yg[w]||(m("%s: Function components do not support getDerivedStateFromProps.",w),yg[w]=!0)}if(typeof s.contextType=="object"&&s.contextType!==null){var A=xe(s)||"Unknown";gg[A]||(m("%s: Function components do not support contextType.",A),gg[A]=!0)}}}var Gh={dehydrated:null,retryLane:Gn};function Xh(r){return{baseLanes:r}}function Ax(r,s){return{baseLanes:At(r.baseLanes,s)}}function dk(r,s,c,h){if(s!==null){var v=s.memoizedState;if(v===null)return!1}return Oh(r,yf)}function Mx(r,s){return Uo(r.childLanes,s)}function Ox(r,s,c){var h=s.pendingProps;jw(s)&&(s.flags|=rt);var v=$r.current,b=!1,w=(s.flags&rt)!==ct;if(w||dk(v,r)?(b=!0,s.flags&=~rt):(r===null||r.memoizedState!==null)&&h.fallback!==void 0&&h.unstable_avoidThisFallback!==!0&&(v=jD(v,Hm)),v=Sf(v),ul(s,v),r===null){h.fallback!==void 0&&Wm(s);var A=h.children,D=h.fallback;if(b){var F=_x(s,A,D,c),$=s.child;return $.memoizedState=Xh(c),s.memoizedState=Gh,F}else if(typeof h.unstable_expectedLoadTime=="number"){var X=_x(s,A,D,c),J=s.child;return J.memoizedState=Xh(c),s.memoizedState=Gh,s.lanes=Hs,Rp(Hs),X}else return hk(s,A,c)}else{var pe=r.memoizedState;if(pe!==null)if(b){var ye=h.fallback,Ce=h.children,Ze=Dx(r,s,Ce,ye,c),bt=s.child,st=r.child.memoizedState;return bt.memoizedState=st===null?Xh(c):Ax(st,c),bt.childLanes=Mx(r,c),s.memoizedState=Gh,Ze}else{var Jt=h.children,Rn=Px(r,s,Jt,c);return s.memoizedState=null,Rn}else if(b){var K=h.fallback,ae=h.children,Y=Dx(r,s,ae,K,c),ve=s.child,Le=r.child.memoizedState;return ve.memoizedState=Le===null?Xh(c):Ax(Le,c),ve.childLanes=Mx(r,c),s.memoizedState=Gh,Y}else{var Ie=h.children,xt=Px(r,s,Ie,c);return s.memoizedState=null,xt}}}function hk(r,s,c){var h=r.mode,v={mode:"visible",children:s},b=hy(v,h,c,null);return b.return=r,r.child=b,b}function _x(r,s,c,h){var v=r.mode,b=r.child,w={mode:"hidden",children:s},A,D;return(v&In)===Yt&&b!==null?(A=b,A.childLanes=le,A.pendingProps=w,r.mode&Zn&&(A.actualDuration=0,A.actualStartTime=-1,A.selfBaseDuration=0,A.treeBaseDuration=0),D=Cl(c,v,h,null)):(A=hy(w,v,le,null),D=Cl(c,v,h,null)),A.return=r,D.return=r,A.sibling=D,r.child=A,D}function Lx(r,s){return wl(r,s)}function Px(r,s,c,h){var v=r.child,b=v.sibling,w=Lx(v,{mode:"visible",children:c});return(s.mode&In)===Yt&&(w.lanes=h),w.return=s,w.sibling=null,b!==null&&(b.nextEffect=null,b.flags=De,s.firstEffect=s.lastEffect=b),s.child=w,w}function Dx(r,s,c,h,v){var b=s.mode,w=r.child,A=w.sibling,D={mode:"hidden",children:c},F;if((b&In)===Yt&&s.child!==w){var $=s.child;F=$,F.childLanes=le,F.pendingProps=D,s.mode&Zn&&(F.actualDuration=0,F.actualStartTime=-1,F.selfBaseDuration=w.selfBaseDuration,F.treeBaseDuration=w.treeBaseDuration);var X=F.lastEffect;X!==null?(s.firstEffect=F.firstEffect,s.lastEffect=X,X.nextEffect=null):s.firstEffect=s.lastEffect=null}else F=Lx(w,D);var J;return A!==null?J=wl(A,h):(J=Cl(h,b,v,null),J.flags|=Pt),J.return=s,F.return=s,F.sibling=J,s.child=F,J}function kx(r,s){r.lanes=At(r.lanes,s);var c=r.alternate;c!==null&&(c.lanes=At(c.lanes,s)),Di(r.return,s)}function pk(r,s,c){for(var h=s;h!==null;){if(h.tag===W){var v=h.memoizedState;v!==null&&kx(h,c)}else if(h.tag===je)kx(h,c);else if(h.child!==null){h.child.return=h,h=h.child;continue}if(h===r)return;for(;h.sibling===null;){if(h.return===null||h.return===r)return;h=h.return}h.sibling.return=h.return,h=h.sibling}}function vk(r){for(var s=r,c=null;s!==null;){var h=s.alternate;h!==null&&_h(h)===null&&(c=s),s=s.sibling}return c}function mk(r){if(r!==void 0&&r!=="forwards"&&r!=="backwards"&&r!=="together"&&!bg[r])if(bg[r]=!0,typeof r=="string")switch(r.toLowerCase()){case"together":case"forwards":case"backwards":{m('"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.',r,r.toLowerCase());break}case"forward":case"backward":{m('"%s" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use "%ss" instead.',r,r.toLowerCase());break}default:m('"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',r);break}else m('%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',r)}function gk(r,s){r!==void 0&&!Qh[r]&&(r!=="collapsed"&&r!=="hidden"?(Qh[r]=!0,m('"%s" is not a supported value for tail on <SuspenseList />. Did you mean "collapsed" or "hidden"?',r)):s!=="forwards"&&s!=="backwards"&&(Qh[r]=!0,m('<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?',r)))}function Ix(r,s){{var c=Array.isArray(r),h=!c&&typeof We(r)=="function";if(c||h){var v=c?"array":"iterable";return m("A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>",v,s,v),!1}}return!0}function yk(r,s){if((s==="forwards"||s==="backwards")&&r!==void 0&&r!==null&&r!==!1)if(Array.isArray(r)){for(var c=0;c<r.length;c++)if(!Ix(r[c],c))return}else{var h=We(r);if(typeof h=="function"){var v=h.call(r);if(v)for(var b=v.next(),w=0;!b.done;b=v.next()){if(!Ix(b.value,w))return;w++}}else m('A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?',s)}}function Tg(r,s,c,h,v,b){var w=r.memoizedState;w===null?r.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:h,tail:c,tailMode:v,lastEffect:b}:(w.isBackwards=s,w.rendering=null,w.renderingStartTime=0,w.last=h,w.tail=c,w.tailMode=v,w.lastEffect=b)}function Nx(r,s,c){var h=s.pendingProps,v=h.revealOrder,b=h.tail,w=h.children;mk(v),gk(b,v),yk(w,v),Ki(r,s,w,c);var A=$r.current,D=Oh(A,yf);if(D)A=Vm(A,yf),s.flags|=rt;else{var F=r!==null&&(r.flags&rt)!==ct;F&&pk(s,s.child,c),A=Sf(A)}if(ul(s,A),(s.mode&In)===Yt)s.memoizedState=null;else switch(v){case"forwards":{var $=vk(s.child),X;$===null?(X=s.child,s.child=null):(X=$.sibling,$.sibling=null),Tg(s,!1,X,$,b,s.lastEffect);break}case"backwards":{var J=null,pe=s.child;for(s.child=null;pe!==null;){var ye=pe.alternate;if(ye!==null&&_h(ye)===null){s.child=pe;break}var Ce=pe.sibling;pe.sibling=J,J=pe,pe=Ce}Tg(s,!0,J,null,b,s.lastEffect);break}case"together":{Tg(s,!1,null,null,void 0,s.lastEffect);break}default:s.memoizedState=null}return s.child}function Sk(r,s,c){Fm(s,s.stateNode.containerInfo);var h=s.pendingProps;return r===null?s.child=Rh(s,null,h,c):Ki(r,s,h,c),s.child}var zx=!1;function bk(r,s,c){var h=s.type,v=h._context,b=s.pendingProps,w=s.memoizedProps,A=b.value;{"value"in b||zx||(zx=!0,m("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?"));var D=s.type.propTypes;D&&vi(D,b,"prop","Context.Provider")}if(rl(s,A),w!==null){var F=w.value,$=Lm(v,A,F);if($===0){if(w.children===b.children&&!qi())return Xs(r,s,c)}else df(s,v,$,c)}var X=b.children;return Ki(r,s,X,c),s.child}var Ux=!1;function Ek(r,s,c){var h=s.type;h._context===void 0?h!==h.Consumer&&(Ux||(Ux=!0,m("Rendering <Context> directly is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?"))):h=h._context;var v=s.pendingProps,b=v.children;typeof b!="function"&&m("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it."),Fa(s,c);var w=Ht(h,v.unstable_observedBits),A;return Of.current=s,li(!0),A=b(w),li(!1),s.flags|=pi,Ki(r,s,A,c),s.child}function Rg(){gs=!0}function Xs(r,s,c){return r!==null&&(s.dependencies=r.dependencies),bx(),Zg(s.lanes),Hn(c,s.childLanes)?(ND(r,s),s.child):null}function xk(r,s,c){{var h=s.return;if(h===null)throw new Error("Cannot swap the root fiber.");if(r.alternate=null,s.alternate=null,c.index=s.index,c.sibling=s.sibling,c.return=s.return,c.ref=s.ref,s===h.child)h.child=c;else{var v=h.child;if(v===null)throw new Error("Expected parent to have a child.");for(;v.sibling!==s;)if(v=v.sibling,v===null)throw new Error("Expected to find the previous sibling.");v.sibling=c}var b=h.lastEffect;return b!==null?(b.nextEffect=r,h.lastEffect=r):h.firstEffect=h.lastEffect=r,r.nextEffect=null,r.flags=De,c.flags|=Pt,c}}function jx(r,s,c){var h=s.lanes;if(s._debugNeedsRemount&&r!==null)return xk(r,s,fy(s.type,s.key,s.pendingProps,s._debugOwner||null,s.mode,s.lanes));if(r!==null){var v=r.memoizedProps,b=s.pendingProps;if(v!==b||qi()||s.type!==r.type)gs=!0;else if(Hn(c,h))(r.flags&Ea)!==ct?gs=!0:gs=!1;else{switch(gs=!1,s.tag){case k:Rx(s),qm();break;case P:GE(s);break;case _:{var w=s.type;Yn(w)&&Co(s);break}case L:Fm(s,s.stateNode.containerInfo);break;case H:{var A=s.memoizedProps.value;rl(s,A);break}case ie:{var D=Hn(c,s.childLanes);D&&(s.flags|=it);var F=s.stateNode;F.effectDuration=0,F.passiveEffectDuration=0}break;case W:{var $=s.memoizedState;if($!==null){var X=s.child,J=X.childLanes;if(Hn(c,J))return Ox(r,s,c);ul(s,Sf($r.current));var pe=Xs(r,s,c);return pe!==null?pe.sibling:null}else ul(s,Sf($r.current));break}case je:{var ye=(r.flags&rt)!==ct,Ce=Hn(c,s.childLanes);if(ye){if(Ce)return Nx(r,s,c);s.flags|=rt}var Ze=s.memoizedState;if(Ze!==null&&(Ze.rendering=null,Ze.tail=null,Ze.lastEffect=null),ul(s,$r.current),Ce)break;return null}case tt:case mt:return s.lanes=le,Eg(r,s,c)}return Xs(r,s,c)}}else gs=!1;switch(s.lanes=le,s.tag){case M:return fk(r,s,s.type,c);case be:{var bt=s.elementType;return uk(r,s,bt,h,c)}case R:{var st=s.type,Jt=s.pendingProps,Rn=s.elementType===st?Jt:cr(st,Jt);return xg(r,s,st,Rn,c)}case _:{var K=s.type,ae=s.pendingProps,Y=s.elementType===K?ae:cr(K,ae);return Tx(r,s,K,Y,c)}case k:return ak(r,s,c);case P:return ok(r,s,c);case O:return lk(r,s);case W:return Ox(r,s,c);case L:return Sk(r,s,c);case Z:{var ve=s.type,Le=s.pendingProps,Ie=s.elementType===ve?Le:cr(ve,Le);return Ex(r,s,ve,Ie,c)}case j:return ik(r,s,c);case q:return rk(r,s,c);case ie:return sk(r,s,c);case H:return bk(r,s,c);case ee:return Ek(r,s,c);case re:{var xt=s.type,rn=s.pendingProps,hn=cr(xt,rn);if(s.type!==s.elementType){var zt=xt.propTypes;zt&&vi(zt,hn,"prop",xe(xt))}return hn=cr(xt.type,hn),xx(r,s,xt,hn,h,c)}case ge:return wx(r,s,s.type,s.pendingProps,h,c);case Ee:{var Nn=s.type,Lt=s.pendingProps,pn=s.elementType===Nn?Lt:cr(Nn,Lt);return ck(r,s,Nn,pn,c)}case je:return Nx(r,s,c);case Xe:break;case ce:break;case me:break;case tt:return Eg(r,s,c);case mt:return nk(r,s,c)}throw Error("Unknown unit of work tag ("+s.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function ys(r){r.flags|=it}function Fx(r){r.flags|=ln}var Lf,Pf,Kh,Zh;if(Fn)Lf=function(r,s,c,h){for(var v=s.child;v!==null;){if(v.tag===P||v.tag===O)jt(r,v.stateNode);else if(v.tag!==L){if(v.child!==null){v.child.return=v,v=v.child;continue}}if(v===s)return;for(;v.sibling===null;){if(v.return===null||v.return===s)return;v=v.return}v.sibling.return=v.return,v=v.sibling}},Pf=function(r){},Kh=function(r,s,c,h,v){var b=r.memoizedProps;if(b!==h){var w=s.stateNode,A=gf(),D=jn(w,c,b,h,v,A);s.updateQueue=D,D&&ys(s)}},Zh=function(r,s,c,h){c!==h&&ys(s)};else if(mr){Lf=function(r,s,c,h){for(var v=s.child;v!==null;){if(v.tag===P){var b=v.stateNode;if(c&&h){var w=v.memoizedProps,A=v.type;b=Fc(b,A,w,v)}jt(r,b)}else if(v.tag===O){var D=v.stateNode;if(c&&h){var F=v.memoizedProps;D=Zl(D,F,v)}jt(r,D)}else if(v.tag!==L){if(v.tag===W){if((v.flags&it)!==ct){var $=v.memoizedState!==null;if($){var X=v.child;if(X!==null){X.child!==null&&(X.child.return=X,Lf(r,X,!0,$));var J=X.sibling;if(J!==null){J.return=v,v=J;continue}}}}if(v.child!==null){v.child.return=v,v=v.child;continue}}else if(v.child!==null){v.child.return=v,v=v.child;continue}}if(v=v,v===s)return;for(;v.sibling===null;){if(v.return===null||v.return===s)return;v=v.return}v.sibling.return=v.return,v=v.sibling}};var Bx=function(r,s,c,h){for(var v=s.child;v!==null;){if(v.tag===P){var b=v.stateNode;if(c&&h){var w=v.memoizedProps,A=v.type;b=Fc(b,A,w,v)}Uc(r,b)}else if(v.tag===O){var D=v.stateNode;if(c&&h){var F=v.memoizedProps;D=Zl(D,F,v)}Uc(r,D)}else if(v.tag!==L){if(v.tag===W){if((v.flags&it)!==ct){var $=v.memoizedState!==null;if($){var X=v.child;if(X!==null){X.child!==null&&(X.child.return=X,Bx(r,X,!0,$));var J=X.sibling;if(J!==null){J.return=v,v=J;continue}}}}if(v.child!==null){v.child.return=v,v=v.child;continue}}else if(v.child!==null){v.child.return=v,v=v.child;continue}}if(v=v,v===s)return;for(;v.sibling===null;){if(v.return===null||v.return===s)return;v=v.return}v.sibling.return=v.return,v=v.sibling}};Pf=function(r){var s=r.stateNode,c=r.firstEffect===null;if(!c){var h=s.containerInfo,v=bo(h);Bx(v,r,!1,!1),s.pendingChildren=v,ys(r),rh(h,v)}},Kh=function(r,s,c,h,v){var b=r.stateNode,w=r.memoizedProps,A=s.firstEffect===null;if(A&&w===h){s.stateNode=b;return}var D=s.stateNode,F=gf(),$=null;if(w!==h&&($=jn(D,c,w,h,v,F)),A&&$===null){s.stateNode=b;return}var X=Sm(b,$,c,w,h,s,A,D);$t(X,c,h,v,F)&&ys(s),s.stateNode=X,A?ys(s):Lf(X,s,!1,!1)},Zh=function(r,s,c,h){if(c!==h){var v=jm(),b=gf();s.stateNode=Fi(h,v,b,s),ys(s)}else s.stateNode=r.stateNode}}else Pf=function(r){},Kh=function(r,s,c,h,v){},Zh=function(r,s,c,h){};function Df(r,s){if(!Ym())switch(r.tailMode){case"hidden":{for(var c=r.tail,h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?r.tail=null:h.sibling=null;break}case"collapsed":{for(var v=r.tail,b=null;v!==null;)v.alternate!==null&&(b=v),v=v.sibling;b===null?!s&&r.tail!==null?r.tail.sibling=null:r.tail=null:b.sibling=null;break}}}function Hx(r,s,c){var h=s.pendingProps;switch(s.tag){case M:case be:case ge:case R:case Z:case j:case q:case ie:case ee:case re:return null;case _:{var v=s.type;return Yn(v)&&Oi(s),null}case k:{Fu(s),fu(s),Qm();var b=s.stateNode;if(b.pendingContext&&(b.context=b.pendingContext,b.pendingContext=null),r===null||r.child===null){var w=Lh(s);w?ys(s):b.hydrate||(s.flags|=en)}return Pf(s),null}case P:{Bm(s);var A=jm(),D=s.type;if(r!==null&&s.stateNode!=null)Kh(r,s,D,h,A),r.ref!==s.ref&&Fx(s);else{if(!h){if(s.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");return null}var F=gf(),$=Lh(s);if($)HD(s,A,F)&&ys(s);else{var X=bn(D,h,A,F,s);Lf(X,s,!1,!1),s.stateNode=X,$t(X,D,h,A,F)&&ys(s)}s.ref!==null&&Fx(s)}return null}case O:{var J=h;if(r&&s.stateNode!=null){var pe=r.memoizedProps;Zh(r,s,pe,J)}else{if(typeof J!="string"&&s.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");var ye=jm(),Ce=gf(),Ze=Lh(s);Ze?VD(s)&&ys(s):s.stateNode=Fi(J,ye,Ce,s)}return null}case W:{Bu(s);var bt=s.memoizedState;if((s.flags&rt)!==ct)return s.lanes=c,(s.mode&Zn)!==Yt&&vg(s),s;var st=bt!==null,Jt=!1;if(r===null)s.memoizedProps.fallback!==void 0&&Lh(s);else{var Rn=r.memoizedState;Jt=Rn!==null}if(st&&!Jt&&(s.mode&In)!==Yt){var K=r===null&&s.memoizedProps.unstable_avoidThisFallback!==!0;K||Oh($r.current,Hm)?wI():CI()}return mr&&st&&(s.flags|=it),Fn&&(st||Jt)&&(s.flags|=it),null}case L:return Fu(s),Pf(s),r===null&&kc(s.stateNode.containerInfo),null;case H:return Uu(s),null;case Ee:{var ae=s.type;return Yn(ae)&&Oi(s),null}case je:{Bu(s);var Y=s.memoizedState;if(Y===null)return null;var ve=(s.flags&rt)!==ct,Le=Y.rendering;if(Le===null)if(ve)Df(Y,!1);else{var Ie=RI()&&(r===null||(r.flags&rt)===ct);if(!Ie)for(var xt=s.child;xt!==null;){var rn=_h(xt);if(rn!==null){ve=!0,s.flags|=rt,Df(Y,!1);var hn=rn.updateQueue;return hn!==null&&(s.updateQueue=hn,s.flags|=it),Y.lastEffect===null&&(s.firstEffect=null),s.lastEffect=Y.lastEffect,zD(s,c),ul(s,Vm($r.current,yf)),s.child}xt=xt.sibling}Y.tail!==null&&nn()>cw()&&(s.flags|=rt,ve=!0,Df(Y,!1),s.lanes=Hs,Rp(Hs))}else{if(!ve){var zt=_h(Le);if(zt!==null){s.flags|=rt,ve=!0;var Nn=zt.updateQueue;if(Nn!==null&&(s.updateQueue=Nn,s.flags|=it),Df(Y,!0),Y.tail===null&&Y.tailMode==="hidden"&&!Le.alternate&&!Ym()){var Lt=s.lastEffect=Y.lastEffect;return Lt!==null&&(Lt.nextEffect=null),null}}else nn()*2-Y.renderingStartTime>cw()&&c!==_i&&(s.flags|=rt,ve=!0,Df(Y,!1),s.lanes=Hs,Rp(Hs))}if(Y.isBackwards)Le.sibling=s.child,s.child=Le;else{var pn=Y.last;pn!==null?pn.sibling=Le:s.child=Le,Y.last=Le}}if(Y.tail!==null){var ti=Y.tail;Y.rendering=ti,Y.tail=ti.sibling,Y.lastEffect=s.lastEffect,Y.renderingStartTime=nn(),ti.sibling=null;var Mn=$r.current;return ve?Mn=Vm(Mn,yf):Mn=Sf(Mn),ul(s,Mn),ti}return null}case Xe:break;case ce:break;case me:break;case tt:case mt:{if(Kg(s),r!==null){var bs=s.memoizedState,On=r.memoizedState,Es=On!==null,Tl=bs!==null;Es!==Tl&&h.mode!=="unstable-defer-without-hiding"&&(s.flags|=it)}return null}}throw Error("Unknown unit of work tag ("+s.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function wk(r,s){switch(r.tag){case _:{var c=r.type;Yn(c)&&Oi(r);var h=r.flags;return h&Ai?(r.flags=h&~Ai|rt,(r.mode&Zn)!==Yt&&vg(r),r):null}case k:{Fu(r),fu(r),Qm();var v=r.flags;if((v&rt)!==ct)throw Error("The root failed to unmount after an error. This is likely a bug in React. Please file an issue.");return r.flags=v&~Ai|rt,r}case P:return Bm(r),null;case W:{Bu(r);var b=r.flags;return b&Ai?(r.flags=b&~Ai|rt,(r.mode&Zn)!==Yt&&vg(r),r):null}case je:return Bu(r),null;case L:return Fu(r),null;case H:return Uu(r),null;case tt:case mt:return Kg(r),null;default:return null}}function Vx(r){switch(r.tag){case _:{var s=r.type.childContextTypes;s!=null&&Oi(r);break}case k:{Fu(r),fu(r),Qm();break}case P:{Bm(r);break}case L:Fu(r);break;case W:Bu(r);break;case je:Bu(r);break;case H:Uu(r);break;case tt:case mt:Kg(r);break}}function Ag(r,s){return{value:r,source:s,stack:uf(s)}}function Ck(r,s){return!0}function Mg(r,s){try{var c=Ck(r,s);if(c===!1)return;var h=s.value,v=s.source,b=s.stack,w=b!==null?b:"";if(h!=null&&h._suppressLogging){if(r.tag===_)return;console.error(h)}var A=v?xe(v.type):null,D=A?"The above error occurred in the <"+A+"> component:":"The above error occurred in one of your React components:",F,$=xe(r.type);$?F="React will try to recreate this component tree from scratch "+("using the error boundary you provided, "+$+"."):F=`Consider adding an error boundary to your tree to customize error handling behavior.
|
|
134
|
+
Check the render method of \``+d+"`.");var p=d||i._debugID||"",S=i._debugSource;S&&(p=S.fileName+":"+S.lineNumber),pm[p]||(pm[p]=!0,m("Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?%s",u))}if(typeof s.getDerivedStateFromProps=="function"){var E=be(s)||"Unknown";hm[E]||(m("%s: Function components do not support getDerivedStateFromProps.",E),hm[E]=!0)}if(typeof s.contextType=="object"&&s.contextType!==null){var R=be(s)||"Unknown";dm[R]||(m("%s: Function components do not support contextType.",R),dm[R]=!0)}}}var mh={dehydrated:null,retryLane:Wn};function gh(i){return{baseLanes:i}}function db(i,s){return{baseLanes:Ct(i.baseLanes,s)}}function VO(i,s,u,d){if(s!==null){var p=s.memoizedState;if(p===null)return!1}return Xd(i,jc)}function hb(i,s){return ho(i.childLanes,s)}function pb(i,s,u){var d=s.pendingProps;Tx(s)&&(s.flags|=tt);var p=Ur.current,S=!1,E=(s.flags&tt)!==at;if(E||VO(p,i)?(S=!0,s.flags&=~tt):(i===null||i.memoizedState!==null)&&d.fallback!==void 0&&d.unstable_avoidThisFallback!==!0&&(p=mO(p,Uv)),p=Ic(p),jo(s,p),i===null){d.fallback!==void 0&&Fv(s);var R=d.children,D=d.fallback;if(S){var F=vb(s,R,D,u),W=s.child;return W.memoizedState=gh(u),s.memoizedState=mh,F}else if(typeof d.unstable_expectedLoadTime=="number"){var X=vb(s,R,D,u),ee=s.child;return ee.memoizedState=gh(u),s.memoizedState=mh,s.lanes=Ls,Yh(Ls),X}else return WO(s,R,u)}else{var he=i.memoizedState;if(he!==null)if(S){var ye=d.fallback,Ee=d.children,Xe=yb(i,s,Ee,ye,u),St=s.child,it=i.child.memoizedState;return St.memoizedState=it===null?gh(u):db(it,u),St.childLanes=hb(i,u),s.memoizedState=mh,Xe}else{var Xt=d.children,Tn=gb(i,s,Xt,u);return s.memoizedState=null,Tn}else if(S){var K=d.fallback,oe=d.children,Y=yb(i,s,oe,K,u),ve=s.child,De=i.child.memoizedState;return ve.memoizedState=De===null?gh(u):db(De,u),ve.childLanes=hb(i,u),s.memoizedState=mh,Y}else{var ze=d.children,bt=gb(i,s,ze,u);return s.memoizedState=null,bt}}}function WO(i,s,u){var d=i.mode,p={mode:"visible",children:s},S=lg(p,d,u,null);return S.return=i,i.child=S,S}function vb(i,s,u,d){var p=i.mode,S=i.child,E={mode:"hidden",children:s},R,D;return(p&Ln)===$t&&S!==null?(R=S,R.childLanes=ue,R.pendingProps=E,i.mode&Yn&&(R.actualDuration=0,R.actualStartTime=-1,R.selfBaseDuration=0,R.treeBaseDuration=0),D=Jo(u,p,d,null)):(R=lg(E,p,ue,null),D=Jo(u,p,d,null)),R.return=i,D.return=i,R.sibling=D,i.child=R,D}function mb(i,s){return Zo(i,s)}function gb(i,s,u,d){var p=i.child,S=p.sibling,E=mb(p,{mode:"visible",children:u});return(s.mode&Ln)===$t&&(E.lanes=d),E.return=s,E.sibling=null,S!==null&&(S.nextEffect=null,S.flags=Pe,s.firstEffect=s.lastEffect=S),s.child=E,E}function yb(i,s,u,d,p){var S=s.mode,E=i.child,R=E.sibling,D={mode:"hidden",children:u},F;if((S&Ln)===$t&&s.child!==E){var W=s.child;F=W,F.childLanes=ue,F.pendingProps=D,s.mode&Yn&&(F.actualDuration=0,F.actualStartTime=-1,F.selfBaseDuration=E.selfBaseDuration,F.treeBaseDuration=E.treeBaseDuration);var X=F.lastEffect;X!==null?(s.firstEffect=F.firstEffect,s.lastEffect=X,X.nextEffect=null):s.firstEffect=s.lastEffect=null}else F=mb(E,D);var ee;return R!==null?ee=Zo(R,d):(ee=Jo(d,S,p,null),ee.flags|=Dt),ee.return=s,F.return=s,F.sibling=ee,s.child=F,ee}function Sb(i,s){i.lanes=Ct(i.lanes,s);var u=i.alternate;u!==null&&(u.lanes=Ct(u.lanes,s)),Ai(i.return,s)}function $O(i,s,u){for(var d=s;d!==null;){if(d.tag===$){var p=d.memoizedState;p!==null&&Sb(d,u)}else if(d.tag===_e)Sb(d,u);else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===i)return;for(;d.sibling===null;){if(d.return===null||d.return===i)return;d=d.return}d.sibling.return=d.return,d=d.sibling}}function qO(i){for(var s=i,u=null;s!==null;){var d=s.alternate;d!==null&&Kd(d)===null&&(u=s),s=s.sibling}return u}function YO(i){if(i!==void 0&&i!=="forwards"&&i!=="backwards"&&i!=="together"&&!vm[i])if(vm[i]=!0,typeof i=="string")switch(i.toLowerCase()){case"together":case"forwards":case"backwards":{m('"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.',i,i.toLowerCase());break}case"forward":case"backward":{m('"%s" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use "%ss" instead.',i,i.toLowerCase());break}default:m('"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',i);break}else m('%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',i)}function QO(i,s){i!==void 0&&!vh[i]&&(i!=="collapsed"&&i!=="hidden"?(vh[i]=!0,m('"%s" is not a supported value for tail on <SuspenseList />. Did you mean "collapsed" or "hidden"?',i)):s!=="forwards"&&s!=="backwards"&&(vh[i]=!0,m('<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?',i)))}function bb(i,s){{var u=Array.isArray(i),d=!u&&typeof Ve(i)=="function";if(u||d){var p=u?"array":"iterable";return m("A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>",p,s,p),!1}}return!0}function GO(i,s){if((s==="forwards"||s==="backwards")&&i!==void 0&&i!==null&&i!==!1)if(Array.isArray(i)){for(var u=0;u<i.length;u++)if(!bb(i[u],u))return}else{var d=Ve(i);if(typeof d=="function"){var p=d.call(i);if(p)for(var S=p.next(),E=0;!S.done;S=p.next()){if(!bb(S.value,E))return;E++}}else m('A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?',s)}}function bm(i,s,u,d,p,S){var E=i.memoizedState;E===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:d,tail:u,tailMode:p,lastEffect:S}:(E.isBackwards=s,E.rendering=null,E.renderingStartTime=0,E.last=d,E.tail=u,E.tailMode=p,E.lastEffect=S)}function xb(i,s,u){var d=s.pendingProps,p=d.revealOrder,S=d.tail,E=d.children;YO(p),QO(S,p),GO(E,p),$i(i,s,E,u);var R=Ur.current,D=Xd(R,jc);if(D)R=jv(R,jc),s.flags|=tt;else{var F=i!==null&&(i.flags&tt)!==at;F&&$O(s,s.child,u),R=Ic(R)}if(jo(s,R),(s.mode&Ln)===$t)s.memoizedState=null;else switch(p){case"forwards":{var W=qO(s.child),X;W===null?(X=s.child,s.child=null):(X=W.sibling,W.sibling=null),bm(s,!1,X,W,S,s.lastEffect);break}case"backwards":{var ee=null,he=s.child;for(s.child=null;he!==null;){var ye=he.alternate;if(ye!==null&&Kd(ye)===null){s.child=he;break}var Ee=he.sibling;he.sibling=ee,ee=he,he=Ee}bm(s,!0,ee,null,S,s.lastEffect);break}case"together":{bm(s,!1,null,null,void 0,s.lastEffect);break}default:s.memoizedState=null}return s.child}function XO(i,s,u){Nv(s,s.stateNode.containerInfo);var d=s.pendingProps;return i===null?s.child=Yd(s,null,d,u):$i(i,s,d,u),s.child}var Eb=!1;function KO(i,s,u){var d=s.type,p=d._context,S=s.pendingProps,E=s.memoizedProps,R=S.value;{"value"in S||Eb||(Eb=!0,m("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?"));var D=s.type.propTypes;D&&ci(D,S,"prop","Context.Provider")}if(ko(s,R),E!==null){var F=E.value,W=Rv(p,R,F);if(W===0){if(E.children===S.children&&!Fi())return Is(i,s,u)}else Pc(s,p,W,u)}var X=S.children;return $i(i,s,X,u),s.child}var wb=!1;function ZO(i,s,u){var d=s.type;d._context===void 0?d!==d.Consumer&&(wb||(wb=!0,m("Rendering <Context> directly is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?"))):d=d._context;var p=s.pendingProps,S=p.children;typeof S!="function"&&m("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it."),Ea(s,u);var E=Ft(d,p.unstable_observedBits),R;return Gc.current=s,ii(!0),R=S(E),ii(!1),s.flags|=ui,$i(i,s,R,u),s.child}function xm(){us=!0}function Is(i,s,u){return i!==null&&(s.dependencies=i.dependencies),sb(),Ym(s.lanes),Un(u,s.childLanes)?(hO(i,s),s.child):null}function JO(i,s,u){{var d=s.return;if(d===null)throw new Error("Cannot swap the root fiber.");if(i.alternate=null,s.alternate=null,u.index=s.index,u.sibling=s.sibling,u.return=s.return,u.ref=s.ref,s===d.child)d.child=u;else{var p=d.child;if(p===null)throw new Error("Expected parent to have a child.");for(;p.sibling!==s;)if(p=p.sibling,p===null)throw new Error("Expected to find the previous sibling.");p.sibling=u}var S=d.lastEffect;return S!==null?(S.nextEffect=i,d.lastEffect=i):d.firstEffect=d.lastEffect=i,i.nextEffect=null,i.flags=Pe,u.flags|=Dt,u}}function Tb(i,s,u){var d=s.lanes;if(s._debugNeedsRemount&&i!==null)return JO(i,s,ag(s.type,s.key,s.pendingProps,s._debugOwner||null,s.mode,s.lanes));if(i!==null){var p=i.memoizedProps,S=s.pendingProps;if(p!==S||Fi()||s.type!==i.type)us=!0;else if(Un(u,d))(i.flags&ia)!==at?us=!0:us=!1;else{switch(us=!1,s.tag){case _:fb(s),Bv();break;case k:zS(s);break;case P:{var E=s.type;Hn(E)&&Za(s);break}case L:Nv(s,s.stateNode.containerInfo);break;case H:{var R=s.memoizedProps.value;ko(s,R);break}case re:{var D=Un(u,s.childLanes);D&&(s.flags|=et);var F=s.stateNode;F.effectDuration=0,F.passiveEffectDuration=0}break;case $:{var W=s.memoizedState;if(W!==null){var X=s.child,ee=X.childLanes;if(Un(u,ee))return pb(i,s,u);jo(s,Ic(Ur.current));var he=Is(i,s,u);return he!==null?he.sibling:null}else jo(s,Ic(Ur.current));break}case _e:{var ye=(i.flags&tt)!==at,Ee=Un(u,s.childLanes);if(ye){if(Ee)return xb(i,s,u);s.flags|=tt}var Xe=s.memoizedState;if(Xe!==null&&(Xe.rendering=null,Xe.tail=null,Xe.lastEffect=null),jo(s,Ur.current),Ee)break;return null}case Ue:case dt:return s.lanes=ue,mm(i,s,u)}return Is(i,s,u)}}else us=!1;switch(s.lanes=ue,s.tag){case M:return HO(i,s,s.type,u);case Ce:{var St=s.elementType;return FO(i,s,St,d,u)}case A:{var it=s.type,Xt=s.pendingProps,Tn=s.elementType===it?Xt:rr(it,Xt);return gm(i,s,it,Tn,u)}case P:{var K=s.type,oe=s.pendingProps,Y=s.elementType===K?oe:rr(K,oe);return cb(i,s,K,Y,u)}case _:return UO(i,s,u);case k:return jO(i,s,u);case O:return IO(i,s);case $:return pb(i,s,u);case L:return XO(i,s,u);case J:{var ve=s.type,De=s.pendingProps,ze=s.elementType===ve?De:rr(ve,De);return ab(i,s,ve,ze,u)}case I:return zO(i,s,u);case q:return NO(i,s,u);case re:return _O(i,s,u);case H:return KO(i,s,u);case te:return ZO(i,s,u);case se:{var bt=s.type,tn=s.pendingProps,fn=rr(bt,tn);if(s.type!==s.elementType){var Nt=bt.propTypes;Nt&&ci(Nt,fn,"prop",be(bt))}return fn=rr(bt.type,fn),ob(i,s,bt,fn,d,u)}case ge:return lb(i,s,s.type,s.pendingProps,d,u);case me:{var Pn=s.type,Ot=s.pendingProps,dn=s.elementType===Pn?Ot:rr(Pn,Ot);return BO(i,s,Pn,dn,u)}case _e:return xb(i,s,u);case Ye:break;case gt:break;case Z:break;case Ue:return mm(i,s,u);case dt:return kO(i,s,u)}throw Error("Unknown unit of work tag ("+s.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function cs(i){i.flags|=et}function Cb(i){i.flags|=an}var Kc,Zc,yh,Sh;if(Nn)Kc=function(i,s,u,d){for(var p=s.child;p!==null;){if(p.tag===k||p.tag===O)Ut(i,p.stateNode);else if(p.tag!==L){if(p.child!==null){p.child.return=p,p=p.child;continue}}if(p===s)return;for(;p.sibling===null;){if(p.return===null||p.return===s)return;p=p.return}p.sibling.return=p.return,p=p.sibling}},Zc=function(i){},yh=function(i,s,u,d,p){var S=i.memoizedProps;if(S!==d){var E=s.stateNode,R=Uc(),D=zn(E,u,S,d,p,R);s.updateQueue=D,D&&cs(s)}},Sh=function(i,s,u,d){u!==d&&cs(s)};else if(cr){Kc=function(i,s,u,d){for(var p=s.child;p!==null;){if(p.tag===k){var S=p.stateNode;if(u&&d){var E=p.memoizedProps,R=p.type;S=oc(S,R,E,p)}Ut(i,S)}else if(p.tag===O){var D=p.stateNode;if(u&&d){var F=p.memoizedProps;D=wl(D,F,p)}Ut(i,D)}else if(p.tag!==L){if(p.tag===$){if((p.flags&et)!==at){var W=p.memoizedState!==null;if(W){var X=p.child;if(X!==null){X.child!==null&&(X.child.return=X,Kc(i,X,!0,W));var ee=X.sibling;if(ee!==null){ee.return=p,p=ee;continue}}}}if(p.child!==null){p.child.return=p,p=p.child;continue}}else if(p.child!==null){p.child.return=p,p=p.child;continue}}if(p=p,p===s)return;for(;p.sibling===null;){if(p.return===null||p.return===s)return;p=p.return}p.sibling.return=p.return,p=p.sibling}};var Rb=function(i,s,u,d){for(var p=s.child;p!==null;){if(p.tag===k){var S=p.stateNode;if(u&&d){var E=p.memoizedProps,R=p.type;S=oc(S,R,E,p)}sc(i,S)}else if(p.tag===O){var D=p.stateNode;if(u&&d){var F=p.memoizedProps;D=wl(D,F,p)}sc(i,D)}else if(p.tag!==L){if(p.tag===$){if((p.flags&et)!==at){var W=p.memoizedState!==null;if(W){var X=p.child;if(X!==null){X.child!==null&&(X.child.return=X,Rb(i,X,!0,W));var ee=X.sibling;if(ee!==null){ee.return=p,p=ee;continue}}}}if(p.child!==null){p.child.return=p,p=p.child;continue}}else if(p.child!==null){p.child.return=p,p=p.child;continue}}if(p=p,p===s)return;for(;p.sibling===null;){if(p.return===null||p.return===s)return;p=p.return}p.sibling.return=p.return,p=p.sibling}};Zc=function(i){var s=i.stateNode,u=i.firstEffect===null;if(!u){var d=s.containerInfo,p=Qa(d);Rb(p,i,!1,!1),s.pendingChildren=p,cs(i),Cd(d,p)}},yh=function(i,s,u,d,p){var S=i.stateNode,E=i.memoizedProps,R=s.firstEffect===null;if(R&&E===d){s.stateNode=S;return}var D=s.stateNode,F=Uc(),W=null;if(E!==d&&(W=zn(D,u,E,d,p,F)),R&&W===null){s.stateNode=S;return}var X=pv(S,W,u,E,d,s,R,D);Ht(X,u,d,p,F)&&cs(s),s.stateNode=X,R?cs(s):Kc(X,s,!1,!1)},Sh=function(i,s,u,d){if(u!==d){var p=zv(),S=Uc();s.stateNode=zi(d,p,S,s),cs(s)}else s.stateNode=i.stateNode}}else Zc=function(i){},yh=function(i,s,u,d,p){},Sh=function(i,s,u,d){};function Jc(i,s){if(!Hv())switch(i.tailMode){case"hidden":{for(var u=i.tail,d=null;u!==null;)u.alternate!==null&&(d=u),u=u.sibling;d===null?i.tail=null:d.sibling=null;break}case"collapsed":{for(var p=i.tail,S=null;p!==null;)p.alternate!==null&&(S=p),p=p.sibling;S===null?!s&&i.tail!==null?i.tail.sibling=null:i.tail=null:S.sibling=null;break}}}function Ab(i,s,u){var d=s.pendingProps;switch(s.tag){case M:case Ce:case ge:case A:case J:case I:case q:case re:case te:case se:return null;case P:{var p=s.type;return Hn(p)&&wi(s),null}case _:{fu(s),_l(s),Vv();var S=s.stateNode;if(S.pendingContext&&(S.context=S.pendingContext,S.pendingContext=null),i===null||i.child===null){var E=Zd(s);E?cs(s):S.hydrate||(s.flags|=Zt)}return Zc(s),null}case k:{_v(s);var R=zv(),D=s.type;if(i!==null&&s.stateNode!=null)yh(i,s,D,d,R),i.ref!==s.ref&&Cb(s);else{if(!d){if(s.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");return null}var F=Uc(),W=Zd(s);if(W)SO(s,R,F)&&cs(s);else{var X=yn(D,d,R,F,s);Kc(X,s,!1,!1),s.stateNode=X,Ht(X,D,d,R,F)&&cs(s)}s.ref!==null&&Cb(s)}return null}case O:{var ee=d;if(i&&s.stateNode!=null){var he=i.memoizedProps;Sh(i,s,he,ee)}else{if(typeof ee!="string"&&s.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");var ye=zv(),Ee=Uc(),Xe=Zd(s);Xe?bO(s)&&cs(s):s.stateNode=zi(ee,ye,Ee,s)}return null}case $:{du(s);var St=s.memoizedState;if((s.flags&tt)!==at)return s.lanes=u,(s.mode&Yn)!==$t&&cm(s),s;var it=St!==null,Xt=!1;if(i===null)s.memoizedProps.fallback!==void 0&&Zd(s);else{var Tn=i.memoizedState;Xt=Tn!==null}if(it&&!Xt&&(s.mode&Ln)!==$t){var K=i===null&&s.memoizedProps.unstable_avoidThisFallback!==!0;K||Xd(Ur.current,Uv)?eL():tL()}return cr&&it&&(s.flags|=et),Nn&&(it||Xt)&&(s.flags|=et),null}case L:return fu(s),Zc(s),i===null&&tc(s.stateNode.containerInfo),null;case H:return uu(s),null;case me:{var oe=s.type;return Hn(oe)&&wi(s),null}case _e:{du(s);var Y=s.memoizedState;if(Y===null)return null;var ve=(s.flags&tt)!==at,De=Y.rendering;if(De===null)if(ve)Jc(Y,!1);else{var ze=iL()&&(i===null||(i.flags&tt)===at);if(!ze)for(var bt=s.child;bt!==null;){var tn=Kd(bt);if(tn!==null){ve=!0,s.flags|=tt,Jc(Y,!1);var fn=tn.updateQueue;return fn!==null&&(s.updateQueue=fn,s.flags|=et),Y.lastEffect===null&&(s.firstEffect=null),s.lastEffect=Y.lastEffect,pO(s,u),jo(s,jv(Ur.current,jc)),s.child}bt=bt.sibling}Y.tail!==null&&en()>Gb()&&(s.flags|=tt,ve=!0,Jc(Y,!1),s.lanes=Ls,Yh(Ls))}else{if(!ve){var Nt=Kd(De);if(Nt!==null){s.flags|=tt,ve=!0;var Pn=Nt.updateQueue;if(Pn!==null&&(s.updateQueue=Pn,s.flags|=et),Jc(Y,!0),Y.tail===null&&Y.tailMode==="hidden"&&!De.alternate&&!Hv()){var Ot=s.lastEffect=Y.lastEffect;return Ot!==null&&(Ot.nextEffect=null),null}}else en()*2-Y.renderingStartTime>Gb()&&u!==Ti&&(s.flags|=tt,ve=!0,Jc(Y,!1),s.lanes=Ls,Yh(Ls))}if(Y.isBackwards)De.sibling=s.child,s.child=De;else{var dn=Y.last;dn!==null?dn.sibling=De:s.child=De,Y.last=De}}if(Y.tail!==null){var Xn=Y.tail;Y.rendering=Xn,Y.tail=Xn.sibling,Y.lastEffect=s.lastEffect,Y.renderingStartTime=en(),Xn.sibling=null;var Rn=Ur.current;return ve?Rn=jv(Rn,jc):Rn=Ic(Rn),jo(s,Rn),Xn}return null}case Ye:break;case gt:break;case Z:break;case Ue:case dt:{if(qm(s),i!==null){var ds=s.memoizedState,An=i.memoizedState,hs=An!==null,el=ds!==null;hs!==el&&d.mode!=="unstable-defer-without-hiding"&&(s.flags|=et)}return null}}throw Error("Unknown unit of work tag ("+s.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function eD(i,s){switch(i.tag){case P:{var u=i.type;Hn(u)&&wi(i);var d=i.flags;return d&xi?(i.flags=d&~xi|tt,(i.mode&Yn)!==$t&&cm(i),i):null}case _:{fu(i),_l(i),Vv();var p=i.flags;if((p&tt)!==at)throw Error("The root failed to unmount after an error. This is likely a bug in React. Please file an issue.");return i.flags=p&~xi|tt,i}case k:return _v(i),null;case $:{du(i);var S=i.flags;return S&xi?(i.flags=S&~xi|tt,(i.mode&Yn)!==$t&&cm(i),i):null}case _e:return du(i),null;case L:return fu(i),null;case H:return uu(i),null;case Ue:case dt:return qm(i),null;default:return null}}function Mb(i){switch(i.tag){case P:{var s=i.type.childContextTypes;s!=null&&wi(i);break}case _:{fu(i),_l(i),Vv();break}case k:{_v(i);break}case L:fu(i);break;case $:du(i);break;case _e:du(i);break;case H:uu(i);break;case Ue:case dt:qm(i);break}}function Em(i,s){return{value:i,source:s,stack:Oc(s)}}function tD(i,s){return!0}function wm(i,s){try{var u=tD(i,s);if(u===!1)return;var d=s.value,p=s.source,S=s.stack,E=S!==null?S:"";if(d!=null&&d._suppressLogging){if(i.tag===P)return;console.error(d)}var R=p?be(p.type):null,D=R?"The above error occurred in the <"+R+"> component:":"The above error occurred in one of your React components:",F,W=be(i.type);W?F="React will try to recreate this component tree from scratch "+("using the error boundary you provided, "+W+"."):F=`Consider adding an error boundary to your tree to customize error handling behavior.
|
|
135
135
|
Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.`;var X=D+`
|
|
136
|
-
`+
|
|
136
|
+
`+E+`
|
|
137
137
|
|
|
138
|
-
`+(""+F);console.error(X)}catch(
|
|
138
|
+
`+(""+F);console.error(X)}catch(ee){setTimeout(function(){throw ee})}}var nD=typeof WeakMap=="function"?WeakMap:Map;function Ob(i,s,u){var d=as(sn,u);d.tag=No,d.payload={element:null};var p=s.value;return d.callback=function(){gL(p),wm(i,s)},d}function Db(i,s,u){var d=as(sn,u);d.tag=No;var p=i.type.getDerivedStateFromError;if(typeof p=="function"){var S=s.value;d.payload=function(){return wm(i,s),p(S)}}var E=i.stateNode;return E!==null&&typeof E.componentDidCatch=="function"?d.callback=function(){yx(i),typeof p!="function"&&(vL(this),wm(i,s));var D=s.value,F=s.stack;this.componentDidCatch(D,{componentStack:F!==null?F:""}),typeof p!="function"&&(Un(i.lanes,Tt)||m("%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.",be(i.type)||"Unknown"))}:d.callback=function(){yx(i)},d}function iD(i,s,u){var d=i.pingCache,p;if(d===null?(d=i.pingCache=new nD,p=new Set,d.set(s,p)):(p=d.get(s),p===void 0&&(p=new Set,d.set(s,p))),!p.has(u)){p.add(u);var S=yL.bind(null,i,s,u);s.then(S,S)}}function rD(i,s,u,d,p){if(u.flags|=Yr,u.firstEffect=u.lastEffect=null,d!==null&&typeof d=="object"&&typeof d.then=="function"){var S=d;if((u.mode&Ln)===$t){var E=u.alternate;E?(u.updateQueue=E.updateQueue,u.memoizedState=E.memoizedState,u.lanes=E.lanes):(u.updateQueue=null,u.memoizedState=null)}var R=Xd(Ur.current,Uv),D=s;do{if(D.tag===$&&gO(D,R)){var F=D.updateQueue;if(F===null){var W=new Set;W.add(S),D.updateQueue=W}else F.add(S);if((D.mode&Ln)===$t){if(D.flags|=tt,u.flags|=ia,u.flags&=~(Ha|Yr),u.tag===P){var X=u.alternate;if(X===null)u.tag=me;else{var ee=as(sn,Tt);ee.tag=wa,os(u,ee)}}u.lanes=Ct(u.lanes,Tt);return}iD(i,S,p),D.flags|=xi,D.lanes=p;return}D=D.return}while(D!==null);d=new Error((be(u.type)||"A React component")+` suspended while rendering, but no fallback UI was specified.
|
|
139
139
|
|
|
140
|
-
Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`)}
|
|
140
|
+
Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`)}nL(),d=Em(d,u);var he=s;do{switch(he.tag){case _:{var ye=d;he.flags|=xi;var Ee=ni(p);he.lanes=Ct(he.lanes,Ee);var Xe=Ob(he,ye,Ee);a(he,Xe);return}case P:var St=d,it=he.type,Xt=he.stateNode;if((he.flags&tt)===at&&(typeof it.getDerivedStateFromError=="function"||Xt!==null&&typeof Xt.componentDidCatch=="function"&&!Qm(Xt))){he.flags|=xi;var Tn=ni(p);he.lanes=Ct(he.lanes,Tn);var K=Db(he,St,Tn);a(he,K);return}break}he=he.return}while(he!==null)}function Lb(i,s,u,d,p,S,E,R,D){var F=Array.prototype.slice.call(arguments,3);try{s.apply(u,F)}catch(W){this.onError(W)}}var Pb=Lb;if(typeof window<"u"&&typeof window.dispatchEvent=="function"&&typeof document<"u"&&typeof document.createEvent=="function"){var Tm=document.createElement("react");Pb=function(s,u,d,p,S,E,R,D,F){if(!(typeof document<"u"))throw Error("The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.");var W=document.createEvent("Event"),X=!1,ee=!0,he=window.event,ye=Object.getOwnPropertyDescriptor(window,"event");function Ee(){Tm.removeEventListener(oe,St,!1),typeof window.event<"u"&&window.hasOwnProperty("event")&&(window.event=he)}var Xe=Array.prototype.slice.call(arguments,3);function St(){X=!0,Ee(),u.apply(d,Xe),ee=!1}var it,Xt=!1,Tn=!1;function K(Y){if(it=Y.error,Xt=!0,it===null&&Y.colno===0&&Y.lineno===0&&(Tn=!0),Y.defaultPrevented&&it!=null&&typeof it=="object")try{it._suppressLogging=!0}catch{}}var oe="react-"+(s||"invokeguardedcallback");if(window.addEventListener("error",K),Tm.addEventListener(oe,St,!1),W.initEvent(oe,!1,!1),Tm.dispatchEvent(W),ye&&Object.defineProperty(window,"event",ye),X&&ee&&(Xt?Tn&&(it=new Error("A cross-origin error was thrown. React doesn't have access to the actual error object in development. See https://reactjs.org/link/crossorigin-error for more information.")):it=new Error(`An error was thrown inside one of your components, but React doesn't know what it was. This is likely due to browser flakiness. React does its best to preserve the "Pause on exceptions" behavior of the DevTools, which requires some DEV-mode only tricks. It's possible that these don't work in your browser. Try triggering the error in production mode, or switching to a modern browser. If you suspect that this is actually an issue with React, please file an issue.`),this.onError(it)),window.removeEventListener("error",K),!X)return Ee(),Lb.apply(this,arguments)}}var sD=Pb,ef=!1,bh=null,aD={onError:function(i){ef=!0,bh=i}};function Fs(i,s,u,d,p,S,E,R,D){ef=!1,bh=null,sD.apply(aD,arguments)}function Bs(){return ef}function Hs(){if(ef){var i=bh;return ef=!1,bh=null,i}else throw Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.")}var kb=null;kb=new Set;var oD=typeof WeakSet=="function"?WeakSet:Set,lD=function(i,s){s.props=i.memoizedProps,s.state=i.memoizedState,s.componentWillUnmount()};function uD(i,s){if(Fs(null,lD,null,i,s),Bs()){var u=Hs();Da(i,u)}}function zb(i){var s=i.ref;if(s!==null)if(typeof s=="function"){if(Fs(null,s,null,null),Bs()){var u=Hs();Da(i,u)}}else s.current=null}function cD(i,s){if(Fs(null,s,null),Bs()){var u=Hs();Da(i,u)}}function fD(i,s){switch(s.tag){case A:case J:case ge:case Z:return;case P:{if(s.flags&Zt&&i!==null){var u=i.memoizedProps,d=i.memoizedState,p=s.stateNode;s.type===s.elementType&&!$o&&(p.props!==s.memoizedProps&&m("Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",be(s.type)||"instance"),p.state!==s.memoizedState&&m("Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",be(s.type)||"instance"));var S=p.getSnapshotBeforeUpdate(s.elementType===s.type?u:rr(s.type,u),d);{var E=kb;S===void 0&&!E.has(s.type)&&(E.add(s.type),m("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.",be(s.type)))}p.__reactInternalSnapshotBeforeUpdate=S}return}case _:{if(Nn&&s.flags&Zt){var R=s.stateNode;Ya(R.containerInfo)}return}case k:case O:case L:case me:return}throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}function Nb(i,s){var u=s.updateQueue,d=u!==null?u.lastEffect:null;if(d!==null){var p=d.next,S=p;do{if((S.tag&i)===i){var E=S.destroy;S.destroy=void 0,E!==void 0&&E()}S=S.next}while(S!==p)}}function dD(i,s){var u=s.updateQueue,d=u!==null?u.lastEffect:null;if(d!==null){var p=d.next,S=p;do{if((S.tag&i)===i){var E=S.create;S.destroy=E();{var R=S.destroy;if(R!==void 0&&typeof R!="function"){var D=void 0;R===null?D=" You returned null. If your effect does not require clean up, return undefined (or nothing).":typeof R.then=="function"?D=`
|
|
141
141
|
|
|
142
142
|
It looks like you wrote useEffect(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:
|
|
143
143
|
|
|
@@ -150,11 +150,11 @@ useEffect(() => {
|
|
|
150
150
|
fetchData();
|
|
151
151
|
}, [someId]); // Or [] if effect doesn't need props or state
|
|
152
152
|
|
|
153
|
-
Learn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching`:D=" You returned: "+A,m("An effect function must not return anything besides a function, which is used for clean-up.%s",D)}}}b=b.next}while(b!==v)}}function Nk(r){var s=r.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var h=c.next,v=h;do{var b=v,w=b.next,A=b.tag;(A&bf)!==$m&&(A&cl)!==$m&&(yw(r,v),II(r,v)),v=w}while(v!==h)}}function zk(r,s,c,h){switch(c.tag){case R:case Z:case ge:case me:{Ik(fl|cl,c),Nk(c);return}case _:{var v=c.stateNode;if(c.flags&it)if(s===null)c.type===c.elementType&&!ml&&(v.props!==c.memoizedProps&&m("Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",xe(c.type)||"instance"),v.state!==c.memoizedState&&m("Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",xe(c.type)||"instance")),v.componentDidMount();else{var b=c.elementType===c.type?s.memoizedProps:cr(c.type,s.memoizedProps),w=s.memoizedState;c.type===c.elementType&&!ml&&(v.props!==c.memoizedProps&&m("Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",xe(c.type)||"instance"),v.state!==c.memoizedState&&m("Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",xe(c.type)||"instance")),v.componentDidUpdate(b,w,v.__reactInternalSnapshotBeforeUpdate)}var A=c.updateQueue;A!==null&&(c.type===c.elementType&&!ml&&(v.props!==c.memoizedProps&&m("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",xe(c.type)||"instance"),v.state!==c.memoizedState&&m("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",xe(c.type)||"instance")),N(c,A,v));return}case k:{var D=c.updateQueue;if(D!==null){var F=null;if(c.child!==null)switch(c.child.tag){case P:F=Ke(c.child.stateNode);break;case _:F=c.child.stateNode;break}N(c,D,F)}return}case P:{var $=c.stateNode;if(s===null&&c.flags&it){var X=c.type,J=c.memoizedProps;Ic($,X,J,c)}return}case O:return;case L:return;case ie:{{var pe=c.memoizedProps;pe.onCommit;var ye=pe.onRender;c.stateNode.effectDuration;var Ce=ek();typeof ye=="function"&&ye(c.memoizedProps.id,s===null?"mount":"update",c.actualDuration,c.treeBaseDuration,c.actualStartTime,Ce,r.memoizedInteractions)}return}case W:{Wk(r,c);return}case je:case Ee:case Xe:case ce:case tt:case mt:return}throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}function Kx(r,s){if(Fn)for(var c=r;;){if(c.tag===P){var h=c.stateNode;s?Nc(h):ym(c.stateNode,c.memoizedProps)}else if(c.tag===O){var v=c.stateNode;s?zc(v):ih(v,c.memoizedProps)}else if(!((c.tag===tt||c.tag===mt)&&c.memoizedState!==null&&c!==r)){if(c.child!==null){c.child.return=c,c=c.child;continue}}if(c===r)return;for(;c.sibling===null;){if(c.return===null||c.return===r)return;c=c.return}c.sibling.return=c.return,c=c.sibling}}function Uk(r){var s=r.ref;if(s!==null){var c=r.stateNode,h;switch(r.tag){case P:h=Ke(c);break;default:h=c}typeof s=="function"?s(h):(s.hasOwnProperty("current")||m("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().",xe(r.type)),s.current=h)}}function jk(r){var s=r.ref;s!==null&&(typeof s=="function"?s(null):s.current=null)}function Zx(r,s,c){switch(gi(s),s.tag){case R:case Z:case re:case ge:case me:{var h=s.updateQueue;if(h!==null){var v=h.lastEffect;if(v!==null){var b=v.next,w=b;do{var A=w,D=A.destroy,F=A.tag;D!==void 0&&((F&bf)!==$m?yw(s,w):Dk(s,D)),w=w.next}while(w!==b)}}return}case _:{Gx(s);var $=s.stateNode;typeof $.componentWillUnmount=="function"&&Pk(s,$);return}case P:{Gx(s);return}case L:{Fn?iw(r,s):mr&&Fk(s);return}case Xe:return;case Ue:return;case ce:return}}function Jx(r,s,c){for(var h=s;;){if(Zx(r,h),h.child!==null&&(!Fn||h.tag!==L)){h.child.return=h,h=h.child;continue}if(h===s)return;for(;h.sibling===null;){if(h.return===null||h.return===s)return;h=h.return}h.sibling.return=h.return,h=h.sibling}}function ew(r){r.alternate=null,r.child=null,r.dependencies=null,r.firstEffect=null,r.lastEffect=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.return=null,r.updateQueue=null,r._debugOwner=null}function Fk(r){if(mr){var s=r.stateNode,c=s.containerInfo,h=bo(c);jc(c,h)}}function Bk(r){if(mr){switch(r.tag){case _:case P:case O:case Xe:return;case k:case L:{var s=r.stateNode,c=s.containerInfo,h=s.pendingChildren;jc(c,h);return}}throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}}function Hk(r){for(var s=r.return;s!==null;){if(tw(s))return s;s=s.return}throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.")}function tw(r){return r.tag===P||r.tag===k||r.tag===L}function Vk(r){var s=r;e:for(;;){for(;s.sibling===null;){if(s.return===null||tw(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==P&&s.tag!==O&&s.tag!==Ue;){if(s.flags&Pt||s.child===null||s.tag===L)continue e;s.child.return=s,s=s.child}if(!(s.flags&Pt))return s.stateNode}}function nw(r){if(Fn){var s=Hk(r),c,h,v=s.stateNode;switch(s.tag){case P:c=v,h=!1;break;case k:c=v.containerInfo,h=!0;break;case L:c=v.containerInfo,h=!0;break;case Xe:default:throw Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.")}s.flags&at&&(nh(c),s.flags&=~at);var b=Vk(r);h?_g(r,b,c):Lg(r,b,c)}}function _g(r,s,c){var h=r.tag,v=h===P||h===O;if(v||ks){var b=v?r.stateNode:r.stateNode.instance;s?vm(c,b,s):Xl(c,b)}else if(h!==L){var w=r.child;if(w!==null){_g(w,s,c);for(var A=w.sibling;A!==null;)_g(A,s,c),A=A.sibling}}}function Lg(r,s,c){var h=r.tag,v=h===P||h===O;if(v||ks){var b=v?r.stateNode:r.stateNode.instance;s?is(c,b,s):th(c,b)}else if(h!==L){var w=r.child;if(w!==null){Lg(w,s,c);for(var A=w.sibling;A!==null;)Lg(A,s,c),A=A.sibling}}}function iw(r,s,c){for(var h=s,v=!1,b,w;;){if(!v){var A=h.return;e:for(;;){if(A===null)throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");var D=A.stateNode;switch(A.tag){case P:b=D,w=!1;break e;case k:b=D.containerInfo,w=!0;break e;case L:b=D.containerInfo,w=!0;break e}A=A.return}v=!0}if(h.tag===P||h.tag===O)Jx(r,h),w?gm(b,h.stateNode):mm(b,h.stateNode);else if(h.tag===L){if(h.child!==null){b=h.stateNode.containerInfo,w=!0,h.child.return=h,h=h.child;continue}}else if(Zx(r,h),h.child!==null){h.child.return=h,h=h.child;continue}if(h===s)return;for(;h.sibling===null;){if(h.return===null||h.return===s)return;h=h.return,h.tag===L&&(v=!1)}h.sibling.return=h.return,h=h.sibling}}function $k(r,s,c){Fn?iw(r,s):Jx(r,s);var h=s.alternate;ew(s),h!==null&&ew(h)}function Pg(r,s){if(!Fn){switch(s.tag){case R:case Z:case re:case ge:case me:{Xx(fl|cl,s);return}case ie:return;case W:{rw(s),ep(s);return}case je:{ep(s);return}case k:{if(tn){var c=s.stateNode;c.hydrate&&(c.hydrate=!1,Ca(c.containerInfo))}break}case tt:case mt:return}Bk(s);return}switch(s.tag){case R:case Z:case re:case ge:case me:{Xx(fl|cl,s);return}case _:return;case P:{var h=s.stateNode;if(h!=null){var v=s.memoizedProps,b=r!==null?r.memoizedProps:v,w=s.type,A=s.updateQueue;s.updateQueue=null,A!==null&&Kl(h,A,w,b,v,s)}return}case O:{if(s.stateNode===null)throw Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");var D=s.stateNode,F=s.memoizedProps,$=r!==null?r.memoizedProps:F;xa(D,$,F);return}case k:{if(tn){var X=s.stateNode;X.hydrate&&(X.hydrate=!1,Ca(X.containerInfo))}return}case ie:return;case W:{rw(s),ep(s);return}case je:{ep(s);return}case Ee:return;case Xe:break;case ce:break;case tt:case mt:{var J=s.memoizedState,pe=J!==null;Kx(s,pe);return}}throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}function rw(r){var s=r.memoizedState;if(s!==null&&(xI(),Fn)){var c=r.child;Kx(c,!0)}}function Wk(r,s){if(tn){var c=s.memoizedState;if(c===null){var h=s.alternate;if(h!==null){var v=h.memoizedState;if(v!==null){var b=v.dehydrated;b!==null&&Hi(b)}}}}}function ep(r){var s=r.updateQueue;if(s!==null){r.updateQueue=null;var c=r.stateNode;c===null&&(c=r.stateNode=new _k),s.forEach(function(h){var v=VI.bind(null,r,h);c.has(h)||(h.__reactDoNotTraceInteractions!==!0&&(v=p.unstable_wrap(v)),c.add(h),h.then(v,v))})}}function qk(r,s){if(r!==null){var c=r.memoizedState;if(c===null||c.dehydrated!==null){var h=s.memoizedState;return h!==null&&h.dehydrated===null}}return!1}function Yk(r){Fn&&nh(r.stateNode)}var tp=0,np=1,ip=2,rp=3,sp=4;if(typeof Symbol=="function"&&Symbol.for){var If=Symbol.for;tp=If("selector.component"),np=If("selector.has_pseudo_class"),ip=If("selector.role"),rp=If("selector.test_id"),sp=If("selector.text")}function Qk(r){return{$$typeof:tp,value:r}}function Gk(r){return{$$typeof:np,value:r}}function Xk(r){return{$$typeof:ip,value:r}}function Kk(r){return{$$typeof:sp,value:r}}function Zk(r){return{$$typeof:rp,value:r}}function Dg(r){var s=Ql(r);if(s!=null){if(typeof s.memoizedProps["data-testname"]!="string")throw Error("Invalid host root specified. Should be either a React container or a node with a testname attribute.");return s}else{var c=dm(r);if(c===null)throw Error("Could not find React container within specified host subtree.");return c.stateNode.current}}function kg(r,s){switch(s.$$typeof){case tp:if(r.type===s.value)return!0;break;case np:return Jk(r,s.value);case ip:if(r.tag===P){var c=r.stateNode;if(hm(c,s.value))return!0}break;case sp:if(r.tag===P||r.tag===O){var h=Wt(r);if(h!==null&&h.indexOf(s.value)>=0)return!0}break;case rp:if(r.tag===P){var v=r.memoizedProps["data-testname"];if(typeof v=="string"&&v.toLowerCase()===s.value.toLowerCase())return!0}break;default:throw Error("Invalid selector type "+s+" specified.")}return!1}function Ig(r){switch(r.$$typeof){case tp:var s=xe(r.value)||"Unknown";return"<"+s+">";case np:return":has("+(Ig(r)||"")+")";case ip:return'[role="'+r.value+'"]';case sp:return'"'+r.value+'"';case rp:return'[data-testname="'+r.value+'"]';default:throw Error("Invalid selector type "+r+" specified.")}}function sw(r,s){for(var c=[],h=[r,0],v=0;v<h.length;){var b=h[v++],w=h[v++],A=s[w];if(!(b.tag===P&&ir(b))){for(;A!=null&&kg(b,A);)w++,A=s[w];if(w===s.length)c.push(b);else for(var D=b.child;D!==null;)h.push(D,w),D=D.sibling}}return c}function Jk(r,s){for(var c=[r,0],h=0;h<c.length;){var v=c[h++],b=c[h++],w=s[b];if(!(v.tag===P&&ir(v))){for(;w!=null&&kg(v,w);)b++,w=s[b];if(b===s.length)return!0;for(var A=v.child;A!==null;)c.push(A,b),A=A.sibling}}return!1}function ap(r,s){if(!Bi)throw Error("Test selector API is not supported by this renderer.");for(var c=Dg(r),h=sw(c,s),v=[],b=Array.from(h),w=0;w<b.length;){var A=b[w++];if(A.tag===P){if(ir(A))continue;v.push(A.stateNode)}else for(var D=A.child;D!==null;)b.push(D),D=D.sibling}return v}function eI(r,s){if(!Bi)throw Error("Test selector API is not supported by this renderer.");for(var c=Dg(r),h=0,v=[],b=[c,0],w=0;w<b.length;){var A=b[w++],D=b[w++],F=s[D];if(!(A.tag===P&&ir(A))&&(kg(A,F)&&(v.push(Ig(F)),D++,D>h&&(h=D)),D<s.length))for(var $=A.child;$!==null;)b.push($,D),$=$.sibling}if(h<s.length){for(var X=[],J=h;J<s.length;J++)X.push(Ig(s[J]));return`findAllNodes was able to match part of the selector:
|
|
154
|
-
`+(" "+
|
|
153
|
+
Learn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching`:D=" You returned: "+R,m("An effect function must not return anything besides a function, which is used for clean-up.%s",D)}}}S=S.next}while(S!==p)}}function hD(i){var s=i.updateQueue,u=s!==null?s.lastEffect:null;if(u!==null){var d=u.next,p=d;do{var S=p,E=S.next,R=S.tag;(R&Fc)!==Iv&&(R&Io)!==Iv&&(ix(i,p),dL(i,p)),p=E}while(p!==d)}}function pD(i,s,u,d){switch(u.tag){case A:case J:case ge:case Z:{dD(Fo|Io,u),hD(u);return}case P:{var p=u.stateNode;if(u.flags&et)if(s===null)u.type===u.elementType&&!$o&&(p.props!==u.memoizedProps&&m("Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",be(u.type)||"instance"),p.state!==u.memoizedState&&m("Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",be(u.type)||"instance")),p.componentDidMount();else{var S=u.elementType===u.type?s.memoizedProps:rr(u.type,s.memoizedProps),E=s.memoizedState;u.type===u.elementType&&!$o&&(p.props!==u.memoizedProps&&m("Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",be(u.type)||"instance"),p.state!==u.memoizedState&&m("Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",be(u.type)||"instance")),p.componentDidUpdate(S,E,p.__reactInternalSnapshotBeforeUpdate)}var R=u.updateQueue;R!==null&&(u.type===u.elementType&&!$o&&(p.props!==u.memoizedProps&&m("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",be(u.type)||"instance"),p.state!==u.memoizedState&&m("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",be(u.type)||"instance")),N(u,R,p));return}case _:{var D=u.updateQueue;if(D!==null){var F=null;if(u.child!==null)switch(u.child.tag){case k:F=Qe(u.child.stateNode);break;case P:F=u.child.stateNode;break}N(u,D,F)}return}case k:{var W=u.stateNode;if(s===null&&u.flags&et){var X=u.type,ee=u.memoizedProps;nc(W,X,ee,u)}return}case O:return;case L:return;case re:{{var he=u.memoizedProps;he.onCommit;var ye=he.onRender;u.stateNode.effectDuration;var Ee=LO();typeof ye=="function"&&ye(u.memoizedProps.id,s===null?"mount":"update",u.actualDuration,u.treeBaseDuration,u.actualStartTime,Ee,i.memoizedInteractions)}return}case $:{ED(i,u);return}case _e:case me:case Ye:case gt:case Ue:case dt:return}throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}function _b(i,s){if(Nn)for(var u=i;;){if(u.tag===k){var d=u.stateNode;s?ic(d):hv(u.stateNode,u.memoizedProps)}else if(u.tag===O){var p=u.stateNode;s?rc(p):Td(p,u.memoizedProps)}else if(!((u.tag===Ue||u.tag===dt)&&u.memoizedState!==null&&u!==i)){if(u.child!==null){u.child.return=u,u=u.child;continue}}if(u===i)return;for(;u.sibling===null;){if(u.return===null||u.return===i)return;u=u.return}u.sibling.return=u.return,u=u.sibling}}function vD(i){var s=i.ref;if(s!==null){var u=i.stateNode,d;switch(i.tag){case k:d=Qe(u);break;default:d=u}typeof s=="function"?s(d):(s.hasOwnProperty("current")||m("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().",be(i.type)),s.current=d)}}function mD(i){var s=i.ref;s!==null&&(typeof s=="function"?s(null):s.current=null)}function Ub(i,s,u){switch(di(s),s.tag){case A:case J:case se:case ge:case Z:{var d=s.updateQueue;if(d!==null){var p=d.lastEffect;if(p!==null){var S=p.next,E=S;do{var R=E,D=R.destroy,F=R.tag;D!==void 0&&((F&Fc)!==Iv?ix(s,E):cD(s,D)),E=E.next}while(E!==S)}}return}case P:{zb(s);var W=s.stateNode;typeof W.componentWillUnmount=="function"&&uD(s,W);return}case k:{zb(s);return}case L:{Nn?Hb(i,s):cr&&gD(s);return}case Ye:return;case Ie:return;case gt:return}}function jb(i,s,u){for(var d=s;;){if(Ub(i,d),d.child!==null&&(!Nn||d.tag!==L)){d.child.return=d,d=d.child;continue}if(d===s)return;for(;d.sibling===null;){if(d.return===null||d.return===s)return;d=d.return}d.sibling.return=d.return,d=d.sibling}}function Ib(i){i.alternate=null,i.child=null,i.dependencies=null,i.firstEffect=null,i.lastEffect=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.return=null,i.updateQueue=null,i._debugOwner=null}function gD(i){if(cr){var s=i.stateNode,u=s.containerInfo,d=Qa(u);ac(u,d)}}function yD(i){if(cr){switch(i.tag){case P:case k:case O:case Ye:return;case _:case L:{var s=i.stateNode,u=s.containerInfo,d=s.pendingChildren;ac(u,d);return}}throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}}function SD(i){for(var s=i.return;s!==null;){if(Fb(s))return s;s=s.return}throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.")}function Fb(i){return i.tag===k||i.tag===_||i.tag===L}function bD(i){var s=i;e:for(;;){for(;s.sibling===null;){if(s.return===null||Fb(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==k&&s.tag!==O&&s.tag!==Ie;){if(s.flags&Dt||s.child===null||s.tag===L)continue e;s.child.return=s,s=s.child}if(!(s.flags&Dt))return s.stateNode}}function Bb(i){if(Nn){var s=SD(i),u,d,p=s.stateNode;switch(s.tag){case k:u=p,d=!1;break;case _:u=p.containerInfo,d=!0;break;case L:u=p.containerInfo,d=!0;break;case Ye:default:throw Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.")}s.flags&rt&&(wd(u),s.flags&=~rt);var S=bD(i);d?Cm(i,S,u):Rm(i,S,u)}}function Cm(i,s,u){var d=i.tag,p=d===k||d===O;if(p||ws){var S=p?i.stateNode:i.stateNode.instance;s?cv(u,S,s):xl(u,S)}else if(d!==L){var E=i.child;if(E!==null){Cm(E,s,u);for(var R=E.sibling;R!==null;)Cm(R,s,u),R=R.sibling}}}function Rm(i,s,u){var d=i.tag,p=d===k||d===O;if(p||ws){var S=p?i.stateNode:i.stateNode.instance;s?Gr(u,S,s):Ed(u,S)}else if(d!==L){var E=i.child;if(E!==null){Rm(E,s,u);for(var R=E.sibling;R!==null;)Rm(R,s,u),R=R.sibling}}}function Hb(i,s,u){for(var d=s,p=!1,S,E;;){if(!p){var R=d.return;e:for(;;){if(R===null)throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");var D=R.stateNode;switch(R.tag){case k:S=D,E=!1;break e;case _:S=D.containerInfo,E=!0;break e;case L:S=D.containerInfo,E=!0;break e}R=R.return}p=!0}if(d.tag===k||d.tag===O)jb(i,d),E?dv(S,d.stateNode):fv(S,d.stateNode);else if(d.tag===L){if(d.child!==null){S=d.stateNode.containerInfo,E=!0,d.child.return=d,d=d.child;continue}}else if(Ub(i,d),d.child!==null){d.child.return=d,d=d.child;continue}if(d===s)return;for(;d.sibling===null;){if(d.return===null||d.return===s)return;d=d.return,d.tag===L&&(p=!1)}d.sibling.return=d.return,d=d.sibling}}function xD(i,s,u){Nn?Hb(i,s):jb(i,s);var d=s.alternate;Ib(s),d!==null&&Ib(d)}function Am(i,s){if(!Nn){switch(s.tag){case A:case J:case se:case ge:case Z:{Nb(Fo|Io,s);return}case re:return;case $:{Vb(s),xh(s);return}case _e:{xh(s);return}case _:{if(Jt){var u=s.stateNode;u.hydrate&&(u.hydrate=!1,aa(u.containerInfo))}break}case Ue:case dt:return}yD(s);return}switch(s.tag){case A:case J:case se:case ge:case Z:{Nb(Fo|Io,s);return}case P:return;case k:{var d=s.stateNode;if(d!=null){var p=s.memoizedProps,S=i!==null?i.memoizedProps:p,E=s.type,R=s.updateQueue;s.updateQueue=null,R!==null&&El(d,R,E,S,p,s)}return}case O:{if(s.stateNode===null)throw Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");var D=s.stateNode,F=s.memoizedProps,W=i!==null?i.memoizedProps:F;ra(D,W,F);return}case _:{if(Jt){var X=s.stateNode;X.hydrate&&(X.hydrate=!1,aa(X.containerInfo))}return}case re:return;case $:{Vb(s),xh(s);return}case _e:{xh(s);return}case me:return;case Ye:break;case gt:break;case Ue:case dt:{var ee=s.memoizedState,he=ee!==null;_b(s,he);return}}throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}function Vb(i){var s=i.memoizedState;if(s!==null&&(JD(),Nn)){var u=i.child;_b(u,!0)}}function ED(i,s){if(Jt){var u=s.memoizedState;if(u===null){var d=s.alternate;if(d!==null){var p=d.memoizedState;if(p!==null){var S=p.dehydrated;S!==null&&_i(S)}}}}}function xh(i){var s=i.updateQueue;if(s!==null){i.updateQueue=null;var u=i.stateNode;u===null&&(u=i.stateNode=new oD),s.forEach(function(d){var p=bL.bind(null,i,d);u.has(d)||(d.__reactDoNotTraceInteractions!==!0&&(p=v.unstable_wrap(p)),u.add(d),d.then(p,p))})}}function wD(i,s){if(i!==null){var u=i.memoizedState;if(u===null||u.dehydrated!==null){var d=s.memoizedState;return d!==null&&d.dehydrated===null}}return!1}function TD(i){Nn&&wd(i.stateNode)}var Eh=0,wh=1,Th=2,Ch=3,Rh=4;if(typeof Symbol=="function"&&Symbol.for){var tf=Symbol.for;Eh=tf("selector.component"),wh=tf("selector.has_pseudo_class"),Th=tf("selector.role"),Ch=tf("selector.test_id"),Rh=tf("selector.text")}function CD(i){return{$$typeof:Eh,value:i}}function RD(i){return{$$typeof:wh,value:i}}function AD(i){return{$$typeof:Th,value:i}}function MD(i){return{$$typeof:Rh,value:i}}function OD(i){return{$$typeof:Ch,value:i}}function Mm(i){var s=Sl(i);if(s!=null){if(typeof s.memoizedProps["data-testname"]!="string")throw Error("Invalid host root specified. Should be either a React container or a node with a testname attribute.");return s}else{var u=ov(i);if(u===null)throw Error("Could not find React container within specified host subtree.");return u.stateNode.current}}function Om(i,s){switch(s.$$typeof){case Eh:if(i.type===s.value)return!0;break;case wh:return DD(i,s.value);case Th:if(i.tag===k){var u=i.stateNode;if(lv(u,s.value))return!0}break;case Rh:if(i.tag===k||i.tag===O){var d=Vt(i);if(d!==null&&d.indexOf(s.value)>=0)return!0}break;case Ch:if(i.tag===k){var p=i.memoizedProps["data-testname"];if(typeof p=="string"&&p.toLowerCase()===s.value.toLowerCase())return!0}break;default:throw Error("Invalid selector type "+s+" specified.")}return!1}function Dm(i){switch(i.$$typeof){case Eh:var s=be(i.value)||"Unknown";return"<"+s+">";case wh:return":has("+(Dm(i)||"")+")";case Th:return'[role="'+i.value+'"]';case Rh:return'"'+i.value+'"';case Ch:return'[data-testname="'+i.value+'"]';default:throw Error("Invalid selector type "+i+" specified.")}}function Wb(i,s){for(var u=[],d=[i,0],p=0;p<d.length;){var S=d[p++],E=d[p++],R=s[E];if(!(S.tag===k&&Ki(S))){for(;R!=null&&Om(S,R);)E++,R=s[E];if(E===s.length)u.push(S);else for(var D=S.child;D!==null;)d.push(D,E),D=D.sibling}}return u}function DD(i,s){for(var u=[i,0],d=0;d<u.length;){var p=u[d++],S=u[d++],E=s[S];if(!(p.tag===k&&Ki(p))){for(;E!=null&&Om(p,E);)S++,E=s[S];if(S===s.length)return!0;for(var R=p.child;R!==null;)u.push(R,S),R=R.sibling}}return!1}function Ah(i,s){if(!Ni)throw Error("Test selector API is not supported by this renderer.");for(var u=Mm(i),d=Wb(u,s),p=[],S=Array.from(d),E=0;E<S.length;){var R=S[E++];if(R.tag===k){if(Ki(R))continue;p.push(R.stateNode)}else for(var D=R.child;D!==null;)S.push(D),D=D.sibling}return p}function LD(i,s){if(!Ni)throw Error("Test selector API is not supported by this renderer.");for(var u=Mm(i),d=0,p=[],S=[u,0],E=0;E<S.length;){var R=S[E++],D=S[E++],F=s[D];if(!(R.tag===k&&Ki(R))&&(Om(R,F)&&(p.push(Dm(F)),D++,D>d&&(d=D)),D<s.length))for(var W=R.child;W!==null;)S.push(W,D),W=W.sibling}if(d<s.length){for(var X=[],ee=d;ee<s.length;ee++)X.push(Dm(s[ee]));return`findAllNodes was able to match part of the selector:
|
|
154
|
+
`+(" "+p.join(" > ")+`
|
|
155
155
|
|
|
156
156
|
`)+`No matching component was found for:
|
|
157
|
-
`+(" "+X.join(" > "))}return null}function tI(r,s){if(!Bi)throw Error("Test selector API is not supported by this renderer.");for(var c=ap(r,s),h=[],v=0;v<c.length;v++)h.push(Gl(c[v]));for(var b=h.length-1;b>0;b--)for(var w=h[b],A=w.x,D=A+w.width,F=w.y,$=F+w.height,X=b-1;X>=0;X--)if(b!==X){var J=h[X],pe=J.x,ye=pe+J.width,Ce=J.y,Ze=Ce+J.height;if(A>=pe&&F>=Ce&&D<=ye&&$<=Ze){h.splice(b,1);break}else if(A===pe&&w.width===J.width&&!(Ze<F)&&!(Ce>$)){Ce>F&&(J.height+=Ce-F,J.y=F),Ze<$&&(J.height=$-Ce),h.splice(b,1);break}else if(F===Ce&&w.height===J.height&&!(ye<A)&&!(pe>D)){pe>A&&(J.width+=pe-A,J.x=A),ye<D&&(J.width=D-pe),h.splice(b,1);break}}return h}function nI(r,s){if(!Bi)throw Error("Test selector API is not supported by this renderer.");for(var c=Dg(r),h=sw(c,s),v=Array.from(h),b=0;b<v.length;){var w=v[b++];if(!ir(w)){if(w.tag===P){var A=w.stateNode;if(pm(A))return!0}for(var D=w.child;D!==null;)v.push(D),D=D.sibling}}return!1}var op=[];function iI(){Bi&&op.forEach(function(r){return r()})}function rI(r,s,c,h){if(!Bi)throw Error("Test selector API is not supported by this renderer.");var v=ap(r,s),b=yo(v,c,h),w=b.disconnect,A=b.observe,D=b.unobserve,F=function(){var $=ap(r,s);v.forEach(function(X){$.indexOf(X)<0&&D(X)}),$.forEach(function(X){v.indexOf(X)<0&&A(X)})};return op.push(F),{disconnect:function(){var $=op.indexOf(F);$>=0&&op.splice($,1),w()}}}var aw=!1,lp=null;function sI(r){if(lp===null)try{var s=("require"+Math.random()).slice(0,7),c=t&&t[s];lp=c.call(t,"timers").setImmediate}catch{lp=function(v){aw===!1&&(aw=!0,typeof MessageChannel>"u"&&m("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var b=new MessageChannel;b.port1.onmessage=v,b.port2.postMessage(void 0)}}return lp(r)}var aI=Math.ceil,Ng=g.ReactCurrentDispatcher,zg=g.ReactCurrentOwner,Wu=g.IsSomeRendererActing,dn=0,Nf=1,oI=2,Ug=4,jg=8,Zi=16,qr=32,ow=64,ea=0,up=1,cp=2,fp=3,dp=4,Fg=5,Ye=dn,Ii=null,Tn=null,Ni=le,Ss=le,Bg=Wi(le),ci=ea,hp=null,gl=le,pp=le,yl=le,vp=le,Hg=null,Vg=0,lw=500,uw=1/0,lI=500;function qa(){uw=nn()+lI}function cw(){return uw}var ke=null,mp=!1,$g=null,qu=null,ta=!1,Yu=null,zf=ds,Wg=le,qg=[],Yg=[],na=null,uI=50,Uf=0,Qg=null,cI=50,gp=0,Sl=null,jf=on,ia=le,yp=le,Gg=!1,Ff=null,Bf=!1;function fI(){return Ii}function Ji(){return(Ye&(Zi|qr))!==dn?nn():(jf!==on||(jf=nn()),jf)}function Ya(r){var s=r.mode;if((s&In)===Yt)return Rt;if((s&Fr)===Yt)return _e()===Nt?Rt:Do;ia===le&&(ia=gl);var c=Xo()!==Go;if(c)return yp!==le&&(yp=Hg!==null?Hg.pendingLanes:le),Tm(ia,yp);var h=_e(),v;if((Ye&Ug)!==dn&&h===Li)v=La(us,ia);else{var b=fh(h);v=La(b,ia)}return v}function dI(r){var s=r.mode;return(s&In)===Yt?Rt:(s&Fr)===Yt?_e()===Nt?Rt:Do:(ia===le&&(ia=gl),ph(ia))}function fi(r,s,c){WI(),GI(r);var h=Sp(r,s);if(h===null)return YI(r),null;Pa(h,s,c),h===Ii&&(yl=At(yl,s),ci===dp&&Qu(h,Ni));var v=_e();s===Rt?(Ye&jg)!==dn&&(Ye&(Zi|qr))===dn?(Ga(h,s),Xg(h)):(dr(h,c),Ga(h,s),Ye===dn&&(qa(),Kn())):((Ye&Ug)!==dn&&(v===Li||v===Nt)&&(na===null?na=new Set([h]):na.add(h)),dr(h,c),Ga(h,s)),Hg=h}function Sp(r,s){r.lanes=At(r.lanes,s);var c=r.alternate;c!==null&&(c.lanes=At(c.lanes,s)),c===null&&(r.flags&(Pt|Ri))!==ct&&bw(r);for(var h=r,v=r.return;v!==null;)v.childLanes=At(v.childLanes,s),c=v.alternate,c!==null?c.childLanes=At(c.childLanes,s):(v.flags&(Pt|Ri))!==ct&&bw(r),h=v,v=v.return;if(h.tag===k){var b=h.stateNode;return b}else return null}function dr(r,s){var c=r.callbackNode;wu(r,s);var h=yi(r,r===Ii?Ni:le),v=zo();if(h===le){c!==null&&(Ia(c),r.callbackNode=null,r.callbackPriority=zr);return}if(c!==null){var b=r.callbackPriority;if(b===v)return;Ia(c)}var w;if(v===js)w=hs(Xg.bind(null,r));else if(v===Mo)w=Vn(Nt,Xg.bind(null,r));else{var A=jr(v);w=Vn(A,fw.bind(null,r))}r.callbackPriority=v,r.callbackNode=w}function fw(r){if(jf=on,ia=le,yp=le,(Ye&(Zi|qr))!==dn)throw Error("Should not already be working.");var s=r.callbackNode,c=Yr();if(c&&r.callbackNode!==s)return null;var h=yi(r,r===Ii?Ni:le);if(h===le)return null;var v=MI(r,h);if(Hn(gl,yl))Gu(r,le);else if(v!==ea){if(v===cp&&(Ye|=ow,r.hydrate&&(r.hydrate=!1,So(r.containerInfo)),h=tf(r),h!==le&&(v=Hf(r,h))),v===up){var b=hp;throw Gu(r,le),Qu(r,h),dr(r,nn()),b}var w=r.current.alternate;r.finishedWork=w,r.finishedLanes=h,hI(r,v,h)}return dr(r,nn()),r.callbackNode===s?fw.bind(null,r):null}function hI(r,s,c){switch(s){case ea:case up:throw Error("Root did not complete. This is a bug in React.");case cp:{bl(r);break}case fp:{if(Qu(r,c),hh(c)&&!Mw()){var h=Vg+lw-nn();if(h>10){var v=yi(r,le);if(v!==le)break;var b=r.suspendedLanes;if(!fs(b,c)){Ji(),Tu(r,b);break}r.timeoutHandle=vt(bl.bind(null,r),h);break}}bl(r);break}case dp:{if(Qu(r,c),nf(c))break;if(!Mw()){var w=Io(r,c),A=w,D=nn()-A,F=$I(D)-D;if(F>10){r.timeoutHandle=vt(bl.bind(null,r),F);break}}bl(r);break}case Fg:{bl(r);break}default:throw Error("Unknown root exit status.")}}function Qu(r,s){s=Uo(s,vp),s=Uo(s,yl),yh(r,s)}function Xg(r){if((Ye&(Zi|qr))!==dn)throw Error("Should not already be working.");Yr();var s,c;if(r===Ii&&Hn(r.expiredLanes,Ni)?(s=Ni,c=Hf(r,s),Hn(gl,yl)&&(s=yi(r,s),c=Hf(r,s))):(s=yi(r,le),c=Hf(r,s)),r.tag!==Us&&c===cp&&(Ye|=ow,r.hydrate&&(r.hydrate=!1,So(r.containerInfo)),s=tf(r),s!==le&&(c=Hf(r,s))),c===up){var h=hp;throw Gu(r,le),Qu(r,s),dr(r,nn()),h}var v=r.current.alternate;return r.finishedWork=v,r.finishedLanes=s,bl(r),dr(r,nn()),null}function pI(r,s){Sh(r,s),dr(r,nn()),(Ye&(Zi|qr))===dn&&(qa(),Kn())}function vI(){if((Ye&(Nf|Zi|qr))!==dn){(Ye&Zi)!==dn&&m("unstable_flushDiscreteUpdates: Cannot flush updates when React is already rendering.");return}gI(),Yr()}function mI(r){return lr(Qi,r)}function gI(){if(na!==null){var r=na;na=null,r.forEach(function(s){Ru(s),dr(s,nn())})}Kn()}function dw(r,s){var c=Ye;Ye|=Nf;try{return r(s)}finally{Ye=c,Ye===dn&&(qa(),Kn())}}function yI(r,s){var c=Ye;Ye|=oI;try{return r(s)}finally{Ye=c,Ye===dn&&(qa(),Kn())}}function SI(r,s,c,h,v){var b=Ye;Ye|=Ug;try{return lr(Li,r.bind(null,s,c,h,v))}finally{Ye=b,Ye===dn&&(qa(),Kn())}}function bI(r,s){var c=Ye;Ye&=~Nf,Ye|=jg;try{return r(s)}finally{Ye=c,Ye===dn&&(qa(),Kn())}}function bp(r,s){var c=Ye;if((c&(Zi|qr))!==dn)return m("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task."),r(s);Ye|=Nf;try{return r?lr(Nt,r.bind(null,s)):void 0}finally{Ye=c,Kn()}}function EI(r){var s=Ye;Ye|=Nf;try{lr(Nt,r)}finally{Ye=s,Ye===dn&&(qa(),Kn())}}function Ep(r,s){En(Bg,Ss,r),Ss=At(Ss,s),gl=At(gl,s)}function Kg(r){Ss=Bg.current,Ft(Bg,r)}function Gu(r,s){r.finishedWork=null,r.finishedLanes=le;var c=r.timeoutHandle;if(c!==vr&&(r.timeoutHandle=vr,un(c)),Tn!==null)for(var h=Tn.return;h!==null;)Vx(h),h=h.return;Ii=r,Tn=wl(r.current,null),Ni=Ss=gl=s,ci=ea,hp=null,pp=le,yl=le,vp=le,Sl=null,Gi.discardPendingWarnings()}function hw(r,s){do{var c=Tn;try{if(il(),ix(),$n(),zg.current=null,c===null||c.return===null){ci=up,hp=s,Tn=null;return}mo&&c.mode&Zn&&Yh(c,!0),Ak(r,c.return,c,s,Ni),gw(c)}catch(h){s=h,Tn===c&&c!==null?(c=c.return,Tn=c):c=Tn;continue}return}while(!0)}function pw(){var r=Ng.current;return Ng.current=$h,r===null?$h:r}function vw(r){Ng.current=r}function xp(r){{var s=p.__interactionsRef.current;return p.__interactionsRef.current=r.memoizedInteractions,s}}function wp(r){p.__interactionsRef.current=r}function xI(){Vg=nn()}function Zg(r){pp=At(r,pp)}function wI(){ci===ea&&(ci=fp)}function CI(){(ci===ea||ci===fp)&&(ci=dp),Ii!==null&&(dh(pp)||dh(yl))&&Qu(Ii,Ni)}function TI(){ci!==Fg&&(ci=cp)}function RI(){return ci===ea}function Hf(r,s){var c=Ye;Ye|=Zi;var h=pw();(Ii!==r||Ni!==s)&&(Gu(r,s),Rw(r,s));var v=xp(r);do try{AI();break}catch(b){hw(r,b)}while(!0);if(il(),wp(v),Ye=c,vw(h),Tn!==null)throw Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.");return Ii=null,Ni=le,ci}function AI(){for(;Tn!==null;)mw(Tn)}function MI(r,s){var c=Ye;Ye|=Zi;var h=pw();(Ii!==r||Ni!==s)&&(qa(),Gu(r,s),Rw(r,s));var v=xp(r);do try{OI();break}catch(b){hw(r,b)}while(!0);return il(),wp(v),vw(h),Ye=c,Tn!==null?ea:(Ii=null,Ni=le,ci)}function OI(){for(;Tn!==null&&!qo();)mw(Tn)}function mw(r){var s=r.alternate;wn(r);var c;(r.mode&Zn)!==Yt?(pg(r),c=ey(s,r,Ss),Yh(r,!0)):c=ey(s,r,Ss),$n(),r.memoizedProps=r.pendingProps,c===null?gw(r):Tn=c,zg.current=null}function gw(r){var s=r;do{var c=s.alternate,h=s.return;if((s.flags&ts)===ct){wn(s);var v=void 0;if((s.mode&Zn)===Yt?v=Hx(c,s,Ss):(pg(s),v=Hx(c,s,Ss),Yh(s,!1)),$n(),v!==null){Tn=v;return}if(_I(s),h!==null&&(h.flags&ts)===ct){h.firstEffect===null&&(h.firstEffect=s.firstEffect),s.lastEffect!==null&&(h.lastEffect!==null&&(h.lastEffect.nextEffect=s.firstEffect),h.lastEffect=s.lastEffect);var b=s.flags;b>pi&&(h.lastEffect!==null?h.lastEffect.nextEffect=s:h.firstEffect=s,h.lastEffect=s)}}else{var w=wk(s);if(w!==null){w.flags&=vo,Tn=w;return}if((s.mode&Zn)!==Yt){Yh(s,!1);for(var A=s.actualDuration,D=s.child;D!==null;)A+=D.actualDuration,D=D.sibling;s.actualDuration=A}h!==null&&(h.firstEffect=h.lastEffect=null,h.flags|=ts)}var F=s.sibling;if(F!==null){Tn=F;return}s=h,Tn=s}while(s!==null);ci===ea&&(ci=Fg)}function _I(r){if(!((r.tag===mt||r.tag===tt)&&r.memoizedState!==null&&!Hn(Ss,_i)&&(r.mode&Fr)!==le)){var s=le;if((r.mode&Zn)!==Yt){for(var c=r.actualDuration,h=r.selfBaseDuration,v=r.alternate===null||r.child!==r.alternate.child,b=r.child;b!==null;)s=At(s,At(b.lanes,b.childLanes)),v&&(c+=b.actualDuration),h+=b.treeBaseDuration,b=b.sibling;var w=r.tag===W&&r.memoizedState!==null;if(w){var A=r.child;A!==null&&(h-=A.treeBaseDuration)}r.actualDuration=c,r.treeBaseDuration=h}else for(var D=r.child;D!==null;)s=At(s,At(D.lanes,D.childLanes)),D=D.sibling;r.childLanes=s}}function bl(r){var s=_e();return lr(Nt,LI.bind(null,r,s)),null}function LI(r,s){do Yr();while(Yu!==null);if(qI(),(Ye&(Zi|qr))!==dn)throw Error("Should not already be working.");var c=r.finishedWork,h=r.finishedLanes;if(c===null)return null;if(r.finishedWork=null,r.finishedLanes=le,c===r.current)throw Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");r.callbackNode=null;var v=At(c.lanes,c.childLanes);Au(r,v),na!==null&&!Om(v)&&na.has(r)&&na.delete(r),r===Ii&&(Ii=null,Tn=null,Ni=le);var b;if(c.flags>pi?c.lastEffect!==null?(c.lastEffect.nextEffect=c,b=c.firstEffect):b=c:b=c.firstEffect,b!==null){var w=Ye;Ye|=qr;var A=xp(r);zg.current=null,Ff=pt(r.containerInfo),Bf=!1,ke=b;do if(Ks(null,PI,null),Zs()){if(ke===null)throw Error("Should be working on an effect.");var D=Js();Qa(ke,D),ke=ke.nextEffect}while(ke!==null);Ff=null,Sx(),ke=b;do if(Ks(null,DI,null,r,s),Zs()){if(ke===null)throw Error("Should be working on an effect.");var F=Js();Qa(ke,F),ke=ke.nextEffect}while(ke!==null);Bf&&eh(),ft(r.containerInfo),r.current=c,ke=b;do if(Ks(null,kI,null,r,h),Zs()){if(ke===null)throw Error("Should be working on an effect.");var $=Js();Qa(ke,$),ke=ke.nextEffect}while(ke!==null);ke=null,Da(),wp(A),Ye=w}else r.current=c,Sx();var X=ta;if(ta)ta=!1,Yu=r,Wg=h,zf=s;else for(ke=b;ke!==null;){var J=ke.nextEffect;ke.nextEffect=null,ke.flags&De&&Lw(ke),ke=J}if(v=r.pendingLanes,v!==le){if(Sl!==null){var pe=Sl;Sl=null;for(var ye=0;ye<pe.length;ye++)Tw(r,pe[ye],r.memoizedInteractions)}Ga(r,v)}else qu=null;if(X||Aw(r,h),v===Rt?r===Qg?Uf++:(Uf=0,Qg=r):Uf=0,Ro(c.stateNode,s),iI(),dr(r,nn()),mp){mp=!1;var Ce=$g;throw $g=null,Ce}return(Ye&jg)!==dn||Kn(),null}function PI(){for(;ke!==null;){var r=ke.alternate;!Bf&&Ff!==null&&((ke.flags&De)!==ct?Te(ke,Ff)&&(Bf=!0,go()):ke.tag===W&&qk(r,ke)&&Te(ke,Ff)&&(Bf=!0,go()));var s=ke.flags;(s&en)!==ct&&(wn(ke),kk(r,ke),$n()),(s&Wn)!==ct&&(ta||(ta=!0,Vn(Qi,function(){return Yr(),null}))),ke=ke.nextEffect}}function DI(r,s){for(;ke!==null;){wn(ke);var c=ke.flags;if(c&at&&Yk(ke),c&ln){var h=ke.alternate;h!==null&&jk(h)}var v=c&(Pt|it|De|Ri);switch(v){case Pt:{nw(ke),ke.flags&=~Pt;break}case Re:{nw(ke),ke.flags&=~Pt;var b=ke.alternate;Pg(b,ke);break}case Ri:{ke.flags&=~Ri;break}case es:{ke.flags&=~Ri;var w=ke.alternate;Pg(w,ke);break}case it:{var A=ke.alternate;Pg(A,ke);break}case De:{$k(r,ke);break}}$n(),ke=ke.nextEffect}}function kI(r,s){for(;ke!==null;){wn(ke);var c=ke.flags;if(c&(it|Dt)){var h=ke.alternate;zk(r,h,ke)}c&ln&&Uk(ke),$n(),ke=ke.nextEffect}}function Yr(){if(zf!==ds){var r=zf>Qi?Qi:zf;return zf=ds,lr(r,zI)}return!1}function II(r,s){qg.push(s,r),ta||(ta=!0,Vn(Qi,function(){return Yr(),null}))}function yw(r,s){Yg.push(s,r);{r.flags|=sn;var c=r.alternate;c!==null&&(c.flags|=sn)}ta||(ta=!0,Vn(Qi,function(){return Yr(),null}))}function NI(r){var s=r.create;r.destroy=s()}function zI(){if(Yu===null)return!1;var r=Yu,s=Wg;if(Yu=null,Wg=le,(Ye&(Zi|qr))!==dn)throw Error("Cannot flush passive effects while already rendering.");Gg=!0;var c=Ye;Ye|=qr;var h=xp(r),v=Yg;Yg=[];for(var b=0;b<v.length;b+=2){var w=v[b],A=v[b+1],D=w.destroy;w.destroy=void 0;{A.flags&=~sn;var F=A.alternate;F!==null&&(F.flags&=~sn)}if(typeof D=="function"){if(wn(A),Ks(null,D,null),Zs()){if(A===null)throw Error("Should be working on an effect.");var $=Js();Qa(A,$)}$n()}}var X=qg;qg=[];for(var J=0;J<X.length;J+=2){var pe=X[J],ye=X[J+1];{if(wn(ye),Ks(null,NI,null,pe),Zs()){if(ye===null)throw Error("Should be working on an effect.");var Ce=Js();Qa(ye,Ce)}$n()}}for(var Ze=r.current.firstEffect;Ze!==null;){var bt=Ze.nextEffect;Ze.nextEffect=null,Ze.flags&De&&Lw(Ze),Ze=bt}return wp(h),Aw(r,s),Gg=!1,Ye=c,Kn(),gp=Yu===null?0:gp+1,!0}function Jg(r){return qu!==null&&qu.has(r)}function UI(r){qu===null?qu=new Set([r]):qu.add(r)}function jI(r){mp||(mp=!0,$g=r)}var FI=jI;function Sw(r,s,c){var h=Ag(c,s),v=$x(r,h,Rt);vs(r,v);var b=Ji(),w=Sp(r,Rt);w!==null&&(Pa(w,Rt,b),dr(w,b),Ga(w,Rt))}function Qa(r,s){if(r.tag===k){Sw(r,r,s);return}for(var c=r.return;c!==null;){if(c.tag===k){Sw(c,r,s);return}else if(c.tag===_){var h=c.type,v=c.stateNode;if(typeof h.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&!Jg(v)){var b=Ag(s,r),w=Wx(c,b,Rt);vs(c,w);var A=Ji(),D=Sp(c,Rt);if(D!==null)Pa(D,Rt,A),dr(D,A),Ga(D,Rt);else if(typeof v.componentDidCatch=="function"&&!Jg(v))try{v.componentDidCatch(s,b)}catch{}return}}c=c.return}}function BI(r,s,c){var h=r.pingCache;h!==null&&h.delete(s);var v=Ji();Tu(r,c),Ii===r&&fs(Ni,c)&&(ci===dp||ci===fp&&hh(Ni)&&nn()-Vg<lw?Gu(r,le):vp=At(vp,c)),dr(r,v),Ga(r,c)}function HI(r,s){s===Gn&&(s=dI(r));var c=Ji(),h=Sp(r,s);h!==null&&(Pa(h,s,c),dr(h,c),Ga(h,s))}function VI(r,s){var c=Gn,h;h=r.stateNode,h!==null&&h.delete(s),HI(r,c)}function $I(r){return r<120?120:r<480?480:r<1080?1080:r<1920?1920:r<3e3?3e3:r<4320?4320:aI(r/1960)*1960}function WI(){if(Uf>uI)throw Uf=0,Qg=null,Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.");gp>cI&&(gp=0,m("Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render."))}function qI(){Gi.flushLegacyContextWarning(),Gi.flushPendingUnsafeLifecycleWarnings()}var Cp=null;function bw(r){{if((Ye&Zi)!==dn||!(r.mode&(In|Fr)))return;var s=r.tag;if(s!==M&&s!==k&&s!==_&&s!==R&&s!==Z&&s!==re&&s!==ge&&s!==me)return;var c=xe(r.type)||"ReactComponent";if(Cp!==null){if(Cp.has(c))return;Cp.add(c)}else Cp=new Set([c]);var h=Jn;try{wn(r),m("Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead.")}finally{h?wn(r):$n()}}}var Tp=null;function YI(r){{var s=r.tag;if(s!==k&&s!==_&&s!==R&&s!==Z&&s!==re&&s!==ge&&s!==me||(r.flags&sn)!==ct)return;var c=xe(r.type)||"ReactComponent";if(Tp!==null){if(Tp.has(c))return;Tp.add(c)}else Tp=new Set([c]);if(!Gg){var h=Jn;try{wn(r),m("Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in %s.",s===_?"the componentWillUnmount method":"a useEffect cleanup function")}finally{h?wn(r):$n()}}}}var ey;{var QI=null;ey=function(r,s,c){var h=Iw(QI,s);try{return jx(r,s,c)}catch(b){if(b!==null&&typeof b=="object"&&typeof b.then=="function")throw b;if(il(),ix(),Vx(s),Iw(s,h),s.mode&Zn&&pg(s),Ks(null,jx,null,r,s,c),Zs()){var v=Js();throw v}else throw b}}}var Ew=!1,ty;ty=new Set;function GI(r){if(Na&&(Ye&Zi)!==dn&&!JD())switch(r.tag){case R:case Z:case ge:{var s=Tn&&xe(Tn.type)||"Unknown",c=s;if(!ty.has(c)){ty.add(c);var h=xe(r.type)||"Unknown";m("Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render",h,s,s)}break}case _:{Ew||(m("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state."),Ew=!0);break}}}var El={current:!1};function xw(r){if(qn===!0&&Wu.current===!0&&El.current!==!0){var s=Jn;try{wn(r),m(`It looks like you're using the wrong act() around your test interactions.
|
|
157
|
+
`+(" "+X.join(" > "))}return null}function PD(i,s){if(!Ni)throw Error("Test selector API is not supported by this renderer.");for(var u=Ah(i,s),d=[],p=0;p<u.length;p++)d.push(bl(u[p]));for(var S=d.length-1;S>0;S--)for(var E=d[S],R=E.x,D=R+E.width,F=E.y,W=F+E.height,X=S-1;X>=0;X--)if(S!==X){var ee=d[X],he=ee.x,ye=he+ee.width,Ee=ee.y,Xe=Ee+ee.height;if(R>=he&&F>=Ee&&D<=ye&&W<=Xe){d.splice(S,1);break}else if(R===he&&E.width===ee.width&&!(Xe<F)&&!(Ee>W)){Ee>F&&(ee.height+=Ee-F,ee.y=F),Xe<W&&(ee.height=W-Ee),d.splice(S,1);break}else if(F===Ee&&E.height===ee.height&&!(ye<R)&&!(he>D)){he>R&&(ee.width+=he-R,ee.x=R),ye<D&&(ee.width=D-he),d.splice(S,1);break}}return d}function kD(i,s){if(!Ni)throw Error("Test selector API is not supported by this renderer.");for(var u=Mm(i),d=Wb(u,s),p=Array.from(d),S=0;S<p.length;){var E=p[S++];if(!Ki(E)){if(E.tag===k){var R=E.stateNode;if(uv(R))return!0}for(var D=E.child;D!==null;)p.push(D),D=D.sibling}}return!1}var Mh=[];function zD(){Ni&&Mh.forEach(function(i){return i()})}function ND(i,s,u,d){if(!Ni)throw Error("Test selector API is not supported by this renderer.");var p=Ah(i,s),S=qa(p,u,d),E=S.disconnect,R=S.observe,D=S.unobserve,F=function(){var W=Ah(i,s);p.forEach(function(X){W.indexOf(X)<0&&D(X)}),W.forEach(function(X){p.indexOf(X)<0&&R(X)})};return Mh.push(F),{disconnect:function(){var W=Mh.indexOf(F);W>=0&&Mh.splice(W,1),E()}}}var $b=!1,Oh=null;function _D(i){if(Oh===null)try{var s=("require"+Math.random()).slice(0,7),u=t&&t[s];Oh=u.call(t,"timers").setImmediate}catch{Oh=function(p){$b===!1&&($b=!0,typeof MessageChannel>"u"&&m("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var S=new MessageChannel;S.port1.onmessage=p,S.port2.postMessage(void 0)}}return Oh(i)}var UD=Math.ceil,Lm=g.ReactCurrentDispatcher,Pm=g.ReactCurrentOwner,mu=g.IsSomeRendererActing,cn=0,nf=1,jD=2,km=4,zm=8,qi=16,Ir=32,qb=64,Vs=0,Dh=1,Lh=2,Ph=3,kh=4,Nm=5,$e=cn,Oi=null,wn=null,Di=ue,fs=ue,_m=Ii(ue),si=Vs,zh=null,qo=ue,Nh=ue,Yo=ue,_h=ue,Um=null,jm=0,Yb=500,Qb=1/0,ID=500;function Ma(){Qb=en()+ID}function Gb(){return Qb}var ke=null,Uh=!1,Im=null,gu=null,Ws=!1,yu=null,rf=rs,Fm=ue,Bm=[],Hm=[],$s=null,FD=50,sf=0,Vm=null,BD=50,jh=0,Qo=null,af=sn,qs=ue,Ih=ue,Wm=!1,of=null,lf=!1;function HD(){return Oi}function Yi(){return($e&(qi|Ir))!==cn?en():(af!==sn||(af=en()),af)}function Oa(i){var s=i.mode;if((s&Ln)===$t)return Tt;if((s&kr)===$t)return Oe()===zt?Tt:oo;qs===ue&&(qs=qo);var u=Co()!==To;if(u)return Ih!==ue&&(Ih=Um!==null?Um.pendingLanes:ue),bv(qs,Ih);var d=Oe(),p;if(($e&km)!==cn&&d===Ci)p=ha(ts,qs);else{var S=Pd(d);p=ha(S,qs)}return p}function VD(i){var s=i.mode;return(s&Ln)===$t?Tt:(s&kr)===$t?Oe()===zt?Tt:oo:(qs===ue&&(qs=qo),Nd(qs))}function ai(i,s,u){EL(),RL(i);var d=Fh(i,s);if(d===null)return TL(i),null;pa(d,s,u),d===Oi&&(Yo=Ct(Yo,s),si===kh&&Su(d,Di));var p=Oe();s===Tt?($e&zm)!==cn&&($e&(qi|Ir))===cn?(La(d,s),$m(d)):(ar(d,u),La(d,s),$e===cn&&(Ma(),qn())):(($e&km)!==cn&&(p===Ci||p===zt)&&($s===null?$s=new Set([d]):$s.add(d)),ar(d,u),La(d,s)),Um=d}function Fh(i,s){i.lanes=Ct(i.lanes,s);var u=i.alternate;u!==null&&(u.lanes=Ct(u.lanes,s)),u===null&&(i.flags&(Dt|bi))!==at&&sx(i);for(var d=i,p=i.return;p!==null;)p.childLanes=Ct(p.childLanes,s),u=p.alternate,u!==null?u.childLanes=Ct(u.childLanes,s):(p.flags&(Dt|bi))!==at&&sx(i),d=p,p=p.return;if(d.tag===_){var S=d.stateNode;return S}else return null}function ar(i,s){var u=i.callbackNode;Ql(i,s);var d=hi(i,i===Oi?Di:ue),p=fo();if(d===ue){u!==null&&(ga(u),i.callbackNode=null,i.callbackPriority=Dr);return}if(u!==null){var S=i.callbackPriority;if(S===p)return;ga(u)}var E;if(p===Ms)E=ss($m.bind(null,i));else if(p===no)E=jn(zt,$m.bind(null,i));else{var R=Pr(p);E=jn(R,Xb.bind(null,i))}i.callbackPriority=p,i.callbackNode=E}function Xb(i){if(af=sn,qs=ue,Ih=ue,($e&(qi|Ir))!==cn)throw Error("Should not already be working.");var s=i.callbackNode,u=Fr();if(u&&i.callbackNode!==s)return null;var d=hi(i,i===Oi?Di:ue);if(d===ue)return null;var p=sL(i,d);if(Un(qo,Yo))bu(i,ue);else if(p!==Vs){if(p===Lh&&($e|=qb,i.hydrate&&(i.hydrate=!1,Ya(i.containerInfo)),d=Ec(i),d!==ue&&(p=uf(i,d))),p===Dh){var S=zh;throw bu(i,ue),Su(i,d),ar(i,en()),S}var E=i.current.alternate;i.finishedWork=E,i.finishedLanes=d,WD(i,p,d)}return ar(i,en()),i.callbackNode===s?Xb.bind(null,i):null}function WD(i,s,u){switch(s){case Vs:case Dh:throw Error("Root did not complete. This is a bug in React.");case Lh:{Go(i);break}case Ph:{if(Su(i,u),zd(u)&&!hx()){var d=jm+Yb-en();if(d>10){var p=hi(i,ue);if(p!==ue)break;var S=i.suspendedLanes;if(!is(S,u)){Yi(),Xl(i,S);break}i.timeoutHandle=mt(Go.bind(null,i),d);break}}Go(i);break}case kh:{if(Su(i,u),wc(u))break;if(!hx()){var E=uo(i,u),R=E,D=en()-R,F=xL(D)-D;if(F>10){i.timeoutHandle=mt(Go.bind(null,i),F);break}}Go(i);break}case Nm:{Go(i);break}default:throw Error("Unknown root exit status.")}}function Su(i,s){s=ho(s,_h),s=ho(s,Yo),Id(i,s)}function $m(i){if(($e&(qi|Ir))!==cn)throw Error("Should not already be working.");Fr();var s,u;if(i===Oi&&Un(i.expiredLanes,Di)?(s=Di,u=uf(i,s),Un(qo,Yo)&&(s=hi(i,s),u=uf(i,s))):(s=hi(i,ue),u=uf(i,s)),i.tag!==As&&u===Lh&&($e|=qb,i.hydrate&&(i.hydrate=!1,Ya(i.containerInfo)),s=Ec(i),s!==ue&&(u=uf(i,s))),u===Dh){var d=zh;throw bu(i,ue),Su(i,s),ar(i,en()),d}var p=i.current.alternate;return i.finishedWork=p,i.finishedLanes=s,Go(i),ar(i,en()),null}function $D(i,s){Fd(i,s),ar(i,en()),($e&(qi|Ir))===cn&&(Ma(),qn())}function qD(){if(($e&(nf|qi|Ir))!==cn){($e&qi)!==cn&&m("unstable_flushDiscreteUpdates: Cannot flush updates when React is already rendering.");return}QD(),Fr()}function YD(i){return nr(Hi,i)}function QD(){if($s!==null){var i=$s;$s=null,i.forEach(function(s){Kl(s),ar(s,en())})}qn()}function Kb(i,s){var u=$e;$e|=nf;try{return i(s)}finally{$e=u,$e===cn&&(Ma(),qn())}}function GD(i,s){var u=$e;$e|=jD;try{return i(s)}finally{$e=u,$e===cn&&(Ma(),qn())}}function XD(i,s,u,d,p){var S=$e;$e|=km;try{return nr(Ci,i.bind(null,s,u,d,p))}finally{$e=S,$e===cn&&(Ma(),qn())}}function KD(i,s){var u=$e;$e&=~nf,$e|=zm;try{return i(s)}finally{$e=u,$e===cn&&(Ma(),qn())}}function Bh(i,s){var u=$e;if((u&(qi|Ir))!==cn)return m("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task."),i(s);$e|=nf;try{return i?nr(zt,i.bind(null,s)):void 0}finally{$e=u,qn()}}function ZD(i){var s=$e;$e|=nf;try{nr(zt,i)}finally{$e=s,$e===cn&&(Ma(),qn())}}function Hh(i,s){Sn(_m,fs,i),fs=Ct(fs,s),qo=Ct(qo,s)}function qm(i){fs=_m.current,jt(_m,i)}function bu(i,s){i.finishedWork=null,i.finishedLanes=ue;var u=i.timeoutHandle;if(u!==ur&&(i.timeoutHandle=ur,on(u)),wn!==null)for(var d=wn.return;d!==null;)Mb(d),d=d.return;Oi=i,wn=Zo(i.current,null),Di=fs=qo=s,si=Vs,zh=null,Nh=ue,Yo=ue,_h=ue,Qo=null,Vi.discardPendingWarnings()}function Zb(i,s){do{var u=wn;try{if(Po(),HS(),In(),Pm.current=null,u===null||u.return===null){si=Dh,zh=s,wn=null;return}Wa&&u.mode&Yn&&ph(u,!0),rD(i,u.return,u,s,Di),nx(u)}catch(d){s=d,wn===u&&u!==null?(u=u.return,wn=u):u=wn;continue}return}while(!0)}function Jb(){var i=Lm.current;return Lm.current=fh,i===null?fh:i}function ex(i){Lm.current=i}function Vh(i){{var s=v.__interactionsRef.current;return v.__interactionsRef.current=i.memoizedInteractions,s}}function Wh(i){v.__interactionsRef.current=i}function JD(){jm=en()}function Ym(i){Nh=Ct(i,Nh)}function eL(){si===Vs&&(si=Ph)}function tL(){(si===Vs||si===Ph)&&(si=kh),Oi!==null&&(kd(Nh)||kd(Yo))&&Su(Oi,Di)}function nL(){si!==Nm&&(si=Lh)}function iL(){return si===Vs}function uf(i,s){var u=$e;$e|=qi;var d=Jb();(Oi!==i||Di!==s)&&(bu(i,s),fx(i,s));var p=Vh(i);do try{rL();break}catch(S){Zb(i,S)}while(!0);if(Po(),Wh(p),$e=u,ex(d),wn!==null)throw Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.");return Oi=null,Di=ue,si}function rL(){for(;wn!==null;)tx(wn)}function sL(i,s){var u=$e;$e|=qi;var d=Jb();(Oi!==i||Di!==s)&&(Ma(),bu(i,s),fx(i,s));var p=Vh(i);do try{aL();break}catch(S){Zb(i,S)}while(!0);return Po(),Wh(p),ex(d),$e=u,wn!==null?Vs:(Oi=null,Di=ue,si)}function aL(){for(;wn!==null&&!xo();)tx(wn)}function tx(i){var s=i.alternate;xn(i);var u;(i.mode&Yn)!==$t?(um(i),u=Gm(s,i,fs),ph(i,!0)):u=Gm(s,i,fs),In(),i.memoizedProps=i.pendingProps,u===null?nx(i):wn=u,Pm.current=null}function nx(i){var s=i;do{var u=s.alternate,d=s.return;if((s.flags&Yr)===at){xn(s);var p=void 0;if((s.mode&Yn)===$t?p=Ab(u,s,fs):(um(s),p=Ab(u,s,fs),ph(s,!1)),In(),p!==null){wn=p;return}if(oL(s),d!==null&&(d.flags&Yr)===at){d.firstEffect===null&&(d.firstEffect=s.firstEffect),s.lastEffect!==null&&(d.lastEffect!==null&&(d.lastEffect.nextEffect=s.firstEffect),d.lastEffect=s.lastEffect);var S=s.flags;S>ui&&(d.lastEffect!==null?d.lastEffect.nextEffect=s:d.firstEffect=s,d.lastEffect=s)}}else{var E=eD(s);if(E!==null){E.flags&=Va,wn=E;return}if((s.mode&Yn)!==$t){ph(s,!1);for(var R=s.actualDuration,D=s.child;D!==null;)R+=D.actualDuration,D=D.sibling;s.actualDuration=R}d!==null&&(d.firstEffect=d.lastEffect=null,d.flags|=Yr)}var F=s.sibling;if(F!==null){wn=F;return}s=d,wn=s}while(s!==null);si===Vs&&(si=Nm)}function oL(i){if(!((i.tag===dt||i.tag===Ue)&&i.memoizedState!==null&&!Un(fs,Ti)&&(i.mode&kr)!==ue)){var s=ue;if((i.mode&Yn)!==$t){for(var u=i.actualDuration,d=i.selfBaseDuration,p=i.alternate===null||i.child!==i.alternate.child,S=i.child;S!==null;)s=Ct(s,Ct(S.lanes,S.childLanes)),p&&(u+=S.actualDuration),d+=S.treeBaseDuration,S=S.sibling;var E=i.tag===$&&i.memoizedState!==null;if(E){var R=i.child;R!==null&&(d-=R.treeBaseDuration)}i.actualDuration=u,i.treeBaseDuration=d}else for(var D=i.child;D!==null;)s=Ct(s,Ct(D.lanes,D.childLanes)),D=D.sibling;i.childLanes=s}}function Go(i){var s=Oe();return nr(zt,lL.bind(null,i,s)),null}function lL(i,s){do Fr();while(yu!==null);if(wL(),($e&(qi|Ir))!==cn)throw Error("Should not already be working.");var u=i.finishedWork,d=i.finishedLanes;if(u===null)return null;if(i.finishedWork=null,i.finishedLanes=ue,u===i.current)throw Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");i.callbackNode=null;var p=Ct(u.lanes,u.childLanes);Zl(i,p),$s!==null&&!Tv(p)&&$s.has(i)&&$s.delete(i),i===Oi&&(Oi=null,wn=null,Di=ue);var S;if(u.flags>ui?u.lastEffect!==null?(u.lastEffect.nextEffect=u,S=u.firstEffect):S=u:S=u.firstEffect,S!==null){var E=$e;$e|=Ir;var R=Vh(i);Pm.current=null,of=vt(i.containerInfo),lf=!1,ke=S;do if(Fs(null,uL,null),Bs()){if(ke===null)throw Error("Should be working on an effect.");var D=Hs();Da(ke,D),ke=ke.nextEffect}while(ke!==null);of=null,rb(),ke=S;do if(Fs(null,cL,null,i,s),Bs()){if(ke===null)throw Error("Should be working on an effect.");var F=Hs();Da(ke,F),ke=ke.nextEffect}while(ke!==null);lf&&xd(),ot(i.containerInfo),i.current=u,ke=S;do if(Fs(null,fL,null,i,d),Bs()){if(ke===null)throw Error("Should be working on an effect.");var W=Hs();Da(ke,W),ke=ke.nextEffect}while(ke!==null);ke=null,va(),Wh(R),$e=E}else i.current=u,rb();var X=Ws;if(Ws)Ws=!1,yu=i,Fm=d,rf=s;else for(ke=S;ke!==null;){var ee=ke.nextEffect;ke.nextEffect=null,ke.flags&Pe&&mx(ke),ke=ee}if(p=i.pendingLanes,p!==ue){if(Qo!==null){var he=Qo;Qo=null;for(var ye=0;ye<he.length;ye++)cx(i,he[ye],i.memoizedInteractions)}La(i,p)}else gu=null;if(X||dx(i,d),p===Tt?i===Vm?sf++:(sf=0,Vm=i):sf=0,eo(u.stateNode,s),zD(),ar(i,en()),Uh){Uh=!1;var Ee=Im;throw Im=null,Ee}return($e&zm)!==cn||qn(),null}function uL(){for(;ke!==null;){var i=ke.alternate;!lf&&of!==null&&((ke.flags&Pe)!==at?we(ke,of)&&(lf=!0,$a()):ke.tag===$&&wD(i,ke)&&we(ke,of)&&(lf=!0,$a()));var s=ke.flags;(s&Zt)!==at&&(xn(ke),fD(i,ke),In()),(s&Fn)!==at&&(Ws||(Ws=!0,jn(Hi,function(){return Fr(),null}))),ke=ke.nextEffect}}function cL(i,s){for(;ke!==null;){xn(ke);var u=ke.flags;if(u&rt&&TD(ke),u&an){var d=ke.alternate;d!==null&&mD(d)}var p=u&(Dt|et|Pe|bi);switch(p){case Dt:{Bb(ke),ke.flags&=~Dt;break}case Te:{Bb(ke),ke.flags&=~Dt;var S=ke.alternate;Am(S,ke);break}case bi:{ke.flags&=~bi;break}case qr:{ke.flags&=~bi;var E=ke.alternate;Am(E,ke);break}case et:{var R=ke.alternate;Am(R,ke);break}case Pe:{xD(i,ke);break}}In(),ke=ke.nextEffect}}function fL(i,s){for(;ke!==null;){xn(ke);var u=ke.flags;if(u&(et|Lt)){var d=ke.alternate;pD(i,d,ke)}u&an&&vD(ke),In(),ke=ke.nextEffect}}function Fr(){if(rf!==rs){var i=rf>Hi?Hi:rf;return rf=rs,nr(i,pL)}return!1}function dL(i,s){Bm.push(s,i),Ws||(Ws=!0,jn(Hi,function(){return Fr(),null}))}function ix(i,s){Hm.push(s,i);{i.flags|=nn;var u=i.alternate;u!==null&&(u.flags|=nn)}Ws||(Ws=!0,jn(Hi,function(){return Fr(),null}))}function hL(i){var s=i.create;i.destroy=s()}function pL(){if(yu===null)return!1;var i=yu,s=Fm;if(yu=null,Fm=ue,($e&(qi|Ir))!==cn)throw Error("Cannot flush passive effects while already rendering.");Wm=!0;var u=$e;$e|=Ir;var d=Vh(i),p=Hm;Hm=[];for(var S=0;S<p.length;S+=2){var E=p[S],R=p[S+1],D=E.destroy;E.destroy=void 0;{R.flags&=~nn;var F=R.alternate;F!==null&&(F.flags&=~nn)}if(typeof D=="function"){if(xn(R),Fs(null,D,null),Bs()){if(R===null)throw Error("Should be working on an effect.");var W=Hs();Da(R,W)}In()}}var X=Bm;Bm=[];for(var ee=0;ee<X.length;ee+=2){var he=X[ee],ye=X[ee+1];{if(xn(ye),Fs(null,hL,null,he),Bs()){if(ye===null)throw Error("Should be working on an effect.");var Ee=Hs();Da(ye,Ee)}In()}}for(var Xe=i.current.firstEffect;Xe!==null;){var St=Xe.nextEffect;Xe.nextEffect=null,Xe.flags&Pe&&mx(Xe),Xe=St}return Wh(d),dx(i,s),Wm=!1,$e=u,qn(),jh=yu===null?0:jh+1,!0}function Qm(i){return gu!==null&&gu.has(i)}function vL(i){gu===null?gu=new Set([i]):gu.add(i)}function mL(i){Uh||(Uh=!0,Im=i)}var gL=mL;function rx(i,s,u){var d=Em(u,s),p=Ob(i,d,Tt);os(i,p);var S=Yi(),E=Fh(i,Tt);E!==null&&(pa(E,Tt,S),ar(E,S),La(E,Tt))}function Da(i,s){if(i.tag===_){rx(i,i,s);return}for(var u=i.return;u!==null;){if(u.tag===_){rx(u,i,s);return}else if(u.tag===P){var d=u.type,p=u.stateNode;if(typeof d.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&!Qm(p)){var S=Em(s,i),E=Db(u,S,Tt);os(u,E);var R=Yi(),D=Fh(u,Tt);if(D!==null)pa(D,Tt,R),ar(D,R),La(D,Tt);else if(typeof p.componentDidCatch=="function"&&!Qm(p))try{p.componentDidCatch(s,S)}catch{}return}}u=u.return}}function yL(i,s,u){var d=i.pingCache;d!==null&&d.delete(s);var p=Yi();Xl(i,u),Oi===i&&is(Di,u)&&(si===kh||si===Ph&&zd(Di)&&en()-jm<Yb?bu(i,ue):_h=Ct(_h,u)),ar(i,p),La(i,u)}function SL(i,s){s===Wn&&(s=VD(i));var u=Yi(),d=Fh(i,s);d!==null&&(pa(d,s,u),ar(d,u),La(d,s))}function bL(i,s){var u=Wn,d;d=i.stateNode,d!==null&&d.delete(s),SL(i,u)}function xL(i){return i<120?120:i<480?480:i<1080?1080:i<1920?1920:i<3e3?3e3:i<4320?4320:UD(i/1960)*1960}function EL(){if(sf>FD)throw sf=0,Vm=null,Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.");jh>BD&&(jh=0,m("Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render."))}function wL(){Vi.flushLegacyContextWarning(),Vi.flushPendingUnsafeLifecycleWarnings()}var $h=null;function sx(i){{if(($e&qi)!==cn||!(i.mode&(Ln|kr)))return;var s=i.tag;if(s!==M&&s!==_&&s!==P&&s!==A&&s!==J&&s!==se&&s!==ge&&s!==Z)return;var u=be(i.type)||"ReactComponent";if($h!==null){if($h.has(u))return;$h.add(u)}else $h=new Set([u]);var d=Qn;try{xn(i),m("Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead.")}finally{d?xn(i):In()}}}var qh=null;function TL(i){{var s=i.tag;if(s!==_&&s!==P&&s!==A&&s!==J&&s!==se&&s!==ge&&s!==Z||(i.flags&nn)!==at)return;var u=be(i.type)||"ReactComponent";if(qh!==null){if(qh.has(u))return;qh.add(u)}else qh=new Set([u]);if(!Wm){var d=Qn;try{xn(i),m("Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in %s.",s===P?"the componentWillUnmount method":"a useEffect cleanup function")}finally{d?xn(i):In()}}}}var Gm;{var CL=null;Gm=function(i,s,u){var d=bx(CL,s);try{return Tb(i,s,u)}catch(S){if(S!==null&&typeof S=="object"&&typeof S.then=="function")throw S;if(Po(),HS(),Mb(s),bx(s,d),s.mode&Yn&&um(s),Fs(null,Tb,null,i,s,u),Bs()){var p=Hs();throw p}else throw S}}}var ax=!1,Xm;Xm=new Set;function RL(i){if(ya&&($e&qi)!==cn&&!DO())switch(i.tag){case A:case J:case ge:{var s=wn&&be(wn.type)||"Unknown",u=s;if(!Xm.has(u)){Xm.add(u);var d=be(i.type)||"Unknown";m("Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render",d,s,s)}break}case P:{ax||(m("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state."),ax=!0);break}}}var Xo={current:!1};function ox(i){if(Bn===!0&&mu.current===!0&&Xo.current!==!0){var s=Qn;try{xn(i),m(`It looks like you're using the wrong act() around your test interactions.
|
|
158
158
|
Be sure to use the matching version of act() corresponding to your renderer:
|
|
159
159
|
|
|
160
160
|
// for react-dom:
|
|
@@ -166,7 +166,7 @@ act(() => ...);
|
|
|
166
166
|
import TestRenderer from react-test-renderer';
|
|
167
167
|
const {act} = TestRenderer;
|
|
168
168
|
// ...
|
|
169
|
-
act(() => ...);`)}finally{s?
|
|
169
|
+
act(() => ...);`)}finally{s?xn(i):In()}}}function lx(i){Bn===!0&&(i.mode&Mt)!==$t&&mu.current===!1&&Xo.current===!1&&m(`An update to %s ran an effect, but was not wrapped in act(...).
|
|
170
170
|
|
|
171
171
|
When testing, code that causes React state updates should be wrapped into act(...):
|
|
172
172
|
|
|
@@ -175,7 +175,7 @@ act(() => {
|
|
|
175
175
|
});
|
|
176
176
|
/* assert on the output */
|
|
177
177
|
|
|
178
|
-
This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act`,
|
|
178
|
+
This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act`,be(i.type))}function AL(i){if(Bn===!0&&$e===cn&&mu.current===!1&&Xo.current===!1){var s=Qn;try{xn(i),m(`An update to %s inside a test was not wrapped in act(...).
|
|
179
179
|
|
|
180
180
|
When testing, code that causes React state updates should be wrapped into act(...):
|
|
181
181
|
|
|
@@ -184,33 +184,33 @@ act(() => {
|
|
|
184
184
|
});
|
|
185
185
|
/* assert on the output */
|
|
186
186
|
|
|
187
|
-
This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act`,
|
|
187
|
+
This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act`,be(i.type))}finally{s?xn(i):In()}}}var ML=AL,ux=!1;function OL(i){ux===!1&&h.unstable_flushAllWithoutAsserting===void 0&&(i.mode&Ln||i.mode&kr)&&(ux=!0,m(`In Concurrent or Sync modes, the "scheduler" module needs to be mocked to guarantee consistent behaviour across tests and browsers. For example, with jest:
|
|
188
188
|
jest.mock('scheduler', () => require('scheduler/unstable_mock'));
|
|
189
189
|
|
|
190
|
-
For more info, visit https://reactjs.org/link/mock-scheduler`))}function
|
|
190
|
+
For more info, visit https://reactjs.org/link/mock-scheduler`))}function Km(i,s){return s*1e3+i.interactionThreadID}function Yh(i){Qo===null?Qo=[i]:Qo.push(i)}function cx(i,s,u){if(u.size>0){var d=i.pendingInteractionMap,p=d.get(s);p!=null?u.forEach(function(R){p.has(R)||R.__count++,p.add(R)}):(d.set(s,new Set(u)),u.forEach(function(R){R.__count++}));var S=v.__subscriberRef.current;if(S!==null){var E=Km(i,s);S.onWorkScheduled(u,E)}}}function La(i,s){cx(i,s,v.__interactionsRef.current)}function fx(i,s){var u=new Set;if(i.pendingInteractionMap.forEach(function(S,E){Un(s,E)&&S.forEach(function(R){return u.add(R)})}),i.memoizedInteractions=u,u.size>0){var d=v.__subscriberRef.current;if(d!==null){var p=Km(i,s);try{d.onWorkStarted(u,p)}catch(S){jn(zt,function(){throw S})}}}}function dx(i,s){var u=i.pendingLanes,d;try{if(d=v.__subscriberRef.current,d!==null&&i.memoizedInteractions.size>0){var p=Km(i,s);d.onWorkStopped(i.memoizedInteractions,p)}}catch(E){jn(zt,function(){throw E})}finally{var S=i.pendingInteractionMap;S.forEach(function(E,R){Un(u,R)||(S.delete(R),E.forEach(function(D){if(D.__count--,d!==null&&D.__count===0)try{d.onInteractionScheduledWorkCompleted(D)}catch(F){jn(zt,function(){throw F})}}))})}}function hx(){return Ko>0}var Zm=h.unstable_flushAllWithoutAsserting,px=typeof Zm=="function";function Jm(){if(Zm!==void 0)try{return Zm()}finally{}else try{for(var i=!1;Fr();)i=!0;return i}finally{}}function vx(i){try{Jm(),_D(function(){Jm()?vx(i):i()})}catch(s){i(s)}}var Ko=0;function DL(i){var s=Ko;Ko++;var u=mu.current,d=Xo.current;mu.current=!0,Xo.current=!0;function p(){Ko--,mu.current=u,Xo.current=d,Ko>s&&m("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. ")}var S;try{S=Kb(i)}catch(R){throw p(),R}if(S!==null&&typeof S=="object"&&typeof S.then=="function"){var E=!1;return typeof Promise<"u"&&Promise.resolve().then(function(){}).then(function(){E===!1&&m("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);")}),{then:function(R,D){E=!0,S.then(function(){if(Ko>1||px===!0&&u===!0){p(),R();return}vx(function(F){p(),F?D(F):R()})},function(F){p(),D(F)})}}}else{S!==void 0&&m("The callback passed to act(...) function must return undefined, or a Promise. You returned %s",S);try{Ko===1&&(px===!1||u===!1)&&Jm(),p()}catch(R){throw p(),R}return{then:function(R){m("Do not await the result of calling act(...) with sync logic, it is not a Promise."),R()}}}}function mx(i){i.sibling=null,i.stateNode=null}var Sr=null,xu=null,LL=function(i){Sr=i};function Eu(i){{if(Sr===null)return i;var s=Sr(i);return s===void 0?i:s.current}}function eg(i){return Eu(i)}function tg(i){{if(Sr===null)return i;var s=Sr(i);if(s===void 0){if(i!=null&&typeof i.render=="function"){var u=Eu(i.render);if(i.render!==u){var d={$$typeof:Ge,render:u};return i.displayName!==void 0&&(d.displayName=i.displayName),d}}return i}return s.current}}function gx(i,s){{if(Sr===null)return!1;var u=i.elementType,d=s.type,p=!1,S=typeof d=="object"&&d!==null?d.$$typeof:null;switch(i.tag){case P:{typeof d=="function"&&(p=!0);break}case A:{(typeof d=="function"||S===ft)&&(p=!0);break}case J:{(S===Ge||S===ft)&&(p=!0);break}case se:case ge:{(S===ht||S===ft)&&(p=!0);break}default:return!1}if(p){var E=Sr(u);if(E!==void 0&&E===Sr(d))return!0}return!1}}function yx(i){{if(Sr===null||typeof WeakSet!="function")return;xu===null&&(xu=new WeakSet),xu.add(i)}}var PL=function(i,s){{if(Sr===null)return;var u=s.staleFamilies,d=s.updatedFamilies;Fr(),Bh(function(){ng(i.current,d,u)})}},kL=function(i,s){{if(i.context!==un)return;Fr(),Bh(function(){xx(s,i,null,null)})}};function ng(i,s,u){{var d=i.alternate,p=i.child,S=i.sibling,E=i.tag,R=i.type,D=null;switch(E){case A:case ge:case P:D=R;break;case J:D=R.render;break}if(Sr===null)throw new Error("Expected resolveFamily to be set during hot reload.");var F=!1,W=!1;if(D!==null){var X=Sr(D);X!==void 0&&(u.has(X)?W=!0:s.has(X)&&(E===P?W=!0:F=!0))}xu!==null&&(xu.has(i)||d!==null&&xu.has(d))&&(W=!0),W&&(i._debugNeedsRemount=!0),(W||F)&&ai(i,Tt,sn),p!==null&&!W&&ng(p,s,u),S!==null&&ng(S,s,u)}}var zL=function(i,s){{var u=new Set,d=new Set(s.map(function(p){return p.current}));return ig(i.current,d,u),u}};function ig(i,s,u){{var d=i.child,p=i.sibling,S=i.tag,E=i.type,R=null;switch(S){case A:case ge:case P:R=E;break;case J:R=E.render;break}var D=!1;R!==null&&s.has(R)&&(D=!0),D?NL(i,u):d!==null&&ig(d,s,u),p!==null&&ig(p,s,u)}}function NL(i,s){{var u=_L(i,s);if(u)return;for(var d=i;;){switch(d.tag){case k:s.add(d.stateNode);return;case L:s.add(d.stateNode.containerInfo);return;case _:s.add(d.stateNode.containerInfo);return}if(d.return===null)throw new Error("Expected to reach root first.");d=d.return}}}function _L(i,s){for(var u=i,d=!1;;){if(u.tag===k)d=!0,s.add(u.stateNode);else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===i)return d;for(;u.sibling===null;){if(u.return===null||u.return===i)return d;u=u.return}u.sibling.return=u.return,u=u.sibling}return!1}var rg;{rg=!1;try{var Sx=Object.preventExtensions({})}catch{rg=!0}}var UL=1;function jL(i,s,u,d){this.tag=i,this.key=u,this.elementType=null,this.type=null,this.stateNode=null,this.return=null,this.child=null,this.sibling=null,this.index=0,this.ref=null,this.pendingProps=s,this.memoizedProps=null,this.updateQueue=null,this.memoizedState=null,this.dependencies=null,this.mode=d,this.flags=at,this.nextEffect=null,this.firstEffect=null,this.lastEffect=null,this.lanes=ue,this.childLanes=ue,this.alternate=null,this.actualDuration=Number.NaN,this.actualStartTime=Number.NaN,this.selfBaseDuration=Number.NaN,this.treeBaseDuration=Number.NaN,this.actualDuration=0,this.actualStartTime=-1,this.selfBaseDuration=0,this.treeBaseDuration=0,this._debugID=UL++,this._debugSource=null,this._debugOwner=null,this._debugNeedsRemount=!1,this._debugHookTypes=null,!rg&&typeof Object.preventExtensions=="function"&&Object.preventExtensions(this)}var or=function(i,s,u,d){return new jL(i,s,u,d)};function sg(i){var s=i.prototype;return!!(s&&s.isReactComponent)}function IL(i){return typeof i=="function"&&!sg(i)&&i.defaultProps===void 0}function FL(i){if(typeof i=="function")return sg(i)?P:A;if(i!=null){var s=i.$$typeof;if(s===Ge)return J;if(s===ht)return se}return M}function Zo(i,s){var u=i.alternate;u===null?(u=or(i.tag,s,i.key,i.mode),u.elementType=i.elementType,u.type=i.type,u.stateNode=i.stateNode,u._debugID=i._debugID,u._debugSource=i._debugSource,u._debugOwner=i._debugOwner,u._debugHookTypes=i._debugHookTypes,u.alternate=i,i.alternate=u):(u.pendingProps=s,u.type=i.type,u.flags=at,u.nextEffect=null,u.firstEffect=null,u.lastEffect=null,u.actualDuration=0,u.actualStartTime=-1),u.childLanes=i.childLanes,u.lanes=i.lanes,u.child=i.child,u.memoizedProps=i.memoizedProps,u.memoizedState=i.memoizedState,u.updateQueue=i.updateQueue;var d=i.dependencies;switch(u.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},u.sibling=i.sibling,u.index=i.index,u.ref=i.ref,u.selfBaseDuration=i.selfBaseDuration,u.treeBaseDuration=i.treeBaseDuration,u._debugNeedsRemount=i._debugNeedsRemount,u.tag){case M:case A:case ge:u.type=Eu(i.type);break;case P:u.type=eg(i.type);break;case J:u.type=tg(i.type);break}return u}function BL(i,s){i.flags&=Dt,i.nextEffect=null,i.firstEffect=null,i.lastEffect=null;var u=i.alternate;if(u===null)i.childLanes=ue,i.lanes=s,i.child=null,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null,i.selfBaseDuration=0,i.treeBaseDuration=0;else{i.childLanes=u.childLanes,i.lanes=u.lanes,i.child=u.child,i.memoizedProps=u.memoizedProps,i.memoizedState=u.memoizedState,i.updateQueue=u.updateQueue,i.type=u.type;var d=u.dependencies;i.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},i.selfBaseDuration=u.selfBaseDuration,i.treeBaseDuration=u.treeBaseDuration}return i}function HL(i){var s;return i===ua?s=kr|Ln|Mt:i===jl?s=Ln|Mt:s=$t,Vn&&(s|=Yn),or(_,null,null,s)}function ag(i,s,u,d,p,S){var E=M,R=i;if(typeof i=="function")sg(i)?(E=P,R=eg(R)):R=Eu(R);else if(typeof i=="string")E=k;else e:switch(i){case pt:return Jo(u.children,p,S,s);case Gi:E=q,p|=zr;break;case vn:E=q,p|=Mt;break;case Kt:return VL(u,p,S,s);case nt:return WL(u,p,S,s);case Ze:return $L(u,p,S,s);case j:return lg(u,p,S,s);case z:return qL(u,p,S,s);case Qt:default:{if(typeof i=="object"&&i!==null)switch(i.$$typeof){case xt:E=H;break e;case ct:E=te;break e;case Ge:E=J,R=tg(R);break e;case ht:E=se;break e;case ft:E=Ce,R=null;break e;case mn:E=Z;break e}var D="";{(i===void 0||typeof i=="object"&&i!==null&&Object.keys(i).length===0)&&(D+=" 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 F=d?be(d.type):null;F&&(D+=`
|
|
191
191
|
|
|
192
|
-
Check the render method of \``+F+"`.")}throw Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: "+(
|
|
192
|
+
Check the render method of \``+F+"`.")}throw Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: "+(i==null?i:typeof i)+"."+D)}}var W=or(E,u,s,p);return W.elementType=i,W.type=R,W.lanes=S,W._debugOwner=d,W}function og(i,s,u){var d=null;d=i._owner;var p=i.type,S=i.key,E=i.props,R=ag(p,S,E,d,s,u);return R._debugSource=i._source,R._debugOwner=i._owner,R}function Jo(i,s,u,d){var p=or(I,i,d,s);return p.lanes=u,p}function VL(i,s,u,d){typeof i.id!="string"&&m('Profiler must specify an "id" as a prop');var p=or(re,i,d,s|Yn);return p.elementType=Kt,p.type=Kt,p.lanes=u,p.stateNode={effectDuration:0,passiveEffectDuration:0},p}function WL(i,s,u,d){var p=or($,i,d,s);return p.type=nt,p.elementType=nt,p.lanes=u,p}function $L(i,s,u,d){var p=or(_e,i,d,s);return p.type=Ze,p.elementType=Ze,p.lanes=u,p}function lg(i,s,u,d){var p=or(Ue,i,d,s);return p.type=j,p.elementType=j,p.lanes=u,p}function qL(i,s,u,d){var p=or(dt,i,d,s);return p.type=z,p.elementType=z,p.lanes=u,p}function ug(i,s,u){var d=or(O,i,null,s);return d.lanes=u,d}function YL(){var i=or(k,null,null,$t);return i.elementType="DELETED",i.type="DELETED",i}function cg(i,s,u){var d=i.children!==null?i.children:[],p=or(L,d,i.key,s);return p.lanes=u,p.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},p}function bx(i,s){return i===null&&(i=or(M,null,null,$t)),i.tag=s.tag,i.key=s.key,i.elementType=s.elementType,i.type=s.type,i.stateNode=s.stateNode,i.return=s.return,i.child=s.child,i.sibling=s.sibling,i.index=s.index,i.ref=s.ref,i.pendingProps=s.pendingProps,i.memoizedProps=s.memoizedProps,i.updateQueue=s.updateQueue,i.memoizedState=s.memoizedState,i.dependencies=s.dependencies,i.mode=s.mode,i.flags=s.flags,i.nextEffect=s.nextEffect,i.firstEffect=s.firstEffect,i.lastEffect=s.lastEffect,i.lanes=s.lanes,i.childLanes=s.childLanes,i.alternate=s.alternate,i.actualDuration=s.actualDuration,i.actualStartTime=s.actualStartTime,i.selfBaseDuration=s.selfBaseDuration,i.treeBaseDuration=s.treeBaseDuration,i._debugID=s._debugID,i._debugSource=s._debugSource,i._debugOwner=s._debugOwner,i._debugNeedsRemount=s._debugNeedsRemount,i._debugHookTypes=s._debugHookTypes,i}function QL(i,s,u){switch(this.tag=s,this.containerInfo=i,this.pendingChildren=null,this.current=null,this.pingCache=null,this.finishedWork=null,this.timeoutHandle=ur,this.context=null,this.pendingContext=null,this.hydrate=u,this.callbackNode=null,this.callbackPriority=Dr,this.eventTimes=po(ue),this.expirationTimes=po(sn),this.pendingLanes=ue,this.suspendedLanes=ue,this.pingedLanes=ue,this.expiredLanes=ue,this.mutableReadLanes=ue,this.finishedLanes=ue,this.entangledLanes=ue,this.entanglements=po(ue),Jt&&(this.mutableSourceEagerHydrationData=null),this.interactionThreadID=v.unstable_getThreadID(),this.memoizedInteractions=new Set,this.pendingInteractionMap=new Map,s){case jl:this._debugRootType="createBlockingRoot()";break;case ua:this._debugRootType="createRoot()";break;case As:this._debugRootType="createLegacyRoot()";break}}function GL(i,s,u,d){var p=new QL(i,s,u),S=HL(s);return p.current=S,S.stateNode=p,cu(S),p}function XL(i,s){var u=s._getVersion,d=u(s._source);i.mutableSourceEagerHydrationData==null?i.mutableSourceEagerHydrationData=[s,d]:i.mutableSourceEagerHydrationData.push(s,d)}function KL(i,s,u){var d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ut,key:d==null?null:""+d,children:i,containerInfo:s,implementation:u}}var fg,dg;fg=!1,dg={};function ZL(i){if(!i)return un;var s=pe(i),u=dc(s);if(s.tag===P){var d=s.type;if(Hn(d))return Ul(s,d,u)}return u}function JL(i){var s=pe(i);if(s===void 0)throw typeof i.render=="function"?Error("Unable to find node on an unmounted component."):Error("Argument appears to not be a ReactComponent. Keys: "+Object.keys(i));var u=U(s);return u===null?null:u.stateNode}function eP(i,s){{var u=pe(i);if(u===void 0)throw typeof i.render=="function"?Error("Unable to find node on an unmounted component."):Error("Argument appears to not be a ReactComponent. Keys: "+Object.keys(i));var d=U(u);if(d===null)return null;if(d.mode&Mt){var p=be(u.type)||"Component";if(!dg[p]){dg[p]=!0;var S=Qn;try{xn(d),u.mode&Mt?m("%s is deprecated in StrictMode. %s was passed an instance of %s which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node",s,s,p):m("%s is deprecated in StrictMode. %s was passed an instance of %s which renders StrictMode children. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node",s,s,p)}finally{S?xn(S):In()}}}return d.stateNode}}function tP(i,s,u,d){return GL(i,s,u)}function xx(i,s,u,d){Il(s,i);var p=s.current,S=Yi();typeof jest<"u"&&(OL(p),ox(p));var E=Oa(p),R=ZL(u);s.context===null?s.context=R:s.pendingContext=R,ya&&Qn!==null&&!fg&&(fg=!0,m(`Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.
|
|
193
193
|
|
|
194
|
-
Check the render method of %s.`,
|
|
194
|
+
Check the render method of %s.`,be(Qn.type)||"Unknown"));var D=as(S,E);return D.payload={element:i},d=d===void 0?null:d,d!==null&&(typeof d!="function"&&m("render(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",d),D.callback=d),os(p,D),ai(p,E,S),E}function nP(i){var s=i.current;if(!s.child)return null;switch(s.child.tag){case k:return Qe(s.child.stateNode);default:return s.child.stateNode}}function iP(i){switch(i.tag){case _:var s=i.stateNode;if(s.hydrate){var u=Gl(s);$D(s,u)}break;case $:var d=Yi();Bh(function(){return ai(i,Tt,d)});var p=Vl;Qh(i,p);break}}function Ex(i,s){var u=i.memoizedState;u!==null&&u.dehydrated!==null&&(u.retryLane=jd(u.retryLane,s))}function Qh(i,s){Ex(i,s);var u=i.alternate;u&&Ex(u,s)}function rP(i){if(i.tag===$){var s=Yi(),u=Vl;ai(i,u,s),Qh(i,u)}}function sP(i){if(i.tag===$){var s=Yi(),u=lo;ai(i,u,s),Qh(i,u)}}function aP(i){if(i.tag===$){var s=Yi(),u=Oa(i);ai(i,u,s),Qh(i,u)}}function oP(i,s){var u=bc();try{return xc(i),s()}finally{xc(u)}}function lP(i){var s=de(i);return s===null?null:s.tag===Ye?s.stateNode.instance:s.stateNode}var wx=function(i){return!1};function Tx(i){return wx(i)}var Cx=null,Rx=null,Ax=null,Mx=null,Ox=null,Dx=null,Lx=null,Px=null;{var kx=function(i,s,u){var d=s[u],p=Array.isArray(i)?i.slice():c({},i);return u+1===s.length?(Array.isArray(p)?p.splice(d,1):delete p[d],p):(p[d]=kx(i[d],s,u+1),p)},zx=function(i,s){return kx(i,s,0)},Nx=function(i,s,u,d){var p=s[d],S=Array.isArray(i)?i.slice():c({},i);if(d+1===s.length){var E=u[d];S[E]=S[p],Array.isArray(S)?S.splice(p,1):delete S[p]}else S[p]=Nx(i[p],s,u,d+1);return S},_x=function(i,s,u){if(s.length!==u.length){x("copyWithRename() expects paths of the same length");return}else for(var d=0;d<u.length-1;d++)if(s[d]!==u[d]){x("copyWithRename() expects paths to be the same except for the deepest key");return}return Nx(i,s,u,0)},Ux=function(i,s,u,d){if(u>=s.length)return d;var p=s[u],S=Array.isArray(i)?i.slice():c({},i);return S[p]=Ux(i[p],s,u+1,d),S},jx=function(i,s,u){return Ux(i,s,0,u)},hg=function(i,s){for(var u=i.memoizedState;u!==null&&s>0;)u=u.next,s--;return u};Cx=function(i,s,u,d){var p=hg(i,s);if(p!==null){var S=jx(p.memoizedState,u,d);p.memoizedState=S,p.baseState=S,i.memoizedProps=c({},i.memoizedProps),ai(i,Tt,sn)}},Rx=function(i,s,u){var d=hg(i,s);if(d!==null){var p=zx(d.memoizedState,u);d.memoizedState=p,d.baseState=p,i.memoizedProps=c({},i.memoizedProps),ai(i,Tt,sn)}},Ax=function(i,s,u,d){var p=hg(i,s);if(p!==null){var S=_x(p.memoizedState,u,d);p.memoizedState=S,p.baseState=S,i.memoizedProps=c({},i.memoizedProps),ai(i,Tt,sn)}},Mx=function(i,s,u){i.pendingProps=jx(i.memoizedProps,s,u),i.alternate&&(i.alternate.pendingProps=i.pendingProps),ai(i,Tt,sn)},Ox=function(i,s){i.pendingProps=zx(i.memoizedProps,s),i.alternate&&(i.alternate.pendingProps=i.pendingProps),ai(i,Tt,sn)},Dx=function(i,s,u){i.pendingProps=_x(i.memoizedProps,s,u),i.alternate&&(i.alternate.pendingProps=i.pendingProps),ai(i,Tt,sn)},Lx=function(i){ai(i,Tt,sn)},Px=function(i){wx=i}}function uP(i){var s=U(i);return s===null?null:s.stateNode}function cP(i){return null}function fP(){return Qn}function dP(i){var s=i.findFiberByHostInstance,u=g.ReactCurrentDispatcher;return _n({bundleType:i.bundleType,version:i.version,rendererPackageName:i.rendererPackageName,rendererConfig:i.rendererConfig,overrideHookState:Cx,overrideHookStateDeletePath:Rx,overrideHookStateRenamePath:Ax,overrideProps:Mx,overridePropsDeletePath:Ox,overridePropsRenamePath:Dx,setSuspenseHandler:Px,scheduleUpdate:Lx,currentDispatcherRef:u,findHostInstanceByFiber:uP,findFiberByHostInstance:s||cP,findHostInstancesForRefresh:zL,scheduleRefresh:PL,scheduleRoot:kL,setRefreshHandler:LL,getCurrentFiber:fP})}return r.IsThisRendererActing=Xo,r.act=DL,r.attemptContinuousHydration=sP,r.attemptHydrationAtCurrentPriority=aP,r.attemptSynchronousHydration=iP,r.attemptUserBlockingHydration=rP,r.batchedEventUpdates=GD,r.batchedUpdates=Kb,r.createComponentSelector=CD,r.createContainer=tP,r.createHasPsuedoClassSelector=RD,r.createPortal=KL,r.createRoleSelector=AD,r.createTestNameSelector=OD,r.createTextSelector=MD,r.deferredUpdates=YD,r.discreteUpdates=XD,r.findAllNodes=Ah,r.findBoundingRects=PD,r.findHostInstance=JL,r.findHostInstanceWithNoPortals=lP,r.findHostInstanceWithWarning=eP,r.flushControlled=ZD,r.flushDiscreteUpdates=qD,r.flushPassiveEffects=Fr,r.flushSync=Bh,r.focusWithin=kD,r.getCurrentUpdateLanePriority=bc,r.getFindAllNodesFailureDescription=LD,r.getPublicRootInstance=nP,r.injectIntoDevTools=dP,r.observeVisibleRects=ND,r.registerMutableSourceForHydration=XL,r.runWithPriority=oP,r.shouldSuspend=Tx,r.unbatchedUpdates=KD,r.updateContainer=xx,r})}(ff)),ff.exports}var pf={exports:{}};/** @license React v0.26.2
|
|
195
195
|
* react-reconciler.production.min.js
|
|
196
196
|
*
|
|
197
197
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
198
198
|
*
|
|
199
199
|
* This source code is licensed under the MIT license found in the
|
|
200
200
|
* LICENSE file in the root directory of this source tree.
|
|
201
|
-
*/
|
|
202
|
-
`+
|
|
203
|
-
`),
|
|
204
|
-
`),N=
|
|
205
|
-
`+E[N].replace(" at new "," at ");while(1<=N&&0<=B);break}}}finally{jt=!1,Error.prepareStackTrace=d}return(o=o?o.displayName||o.name:"")?bn(o):""}var jn=[],ii=-1;function Fi(o){return{current:o}}function vt(o){0>ii||(o.current=jn[ii],jn[ii]=null,ii--)}function un(o,l){ii++,jn[ii]=o.current,o.current=l}var vr={},cn=Fi(vr),qn=Fi(!1),Fn=vr;function mr(o,l){var d=o.type.contextTypes;if(!d)return vr;var y=o.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===l)return y.__reactInternalMemoizedMaskedChildContext;var E={},C;for(C in d)E[C]=l[C];return y&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=l,o.__reactInternalMemoizedMaskedChildContext=E),E}function tn(o){return o=o.childContextTypes,o!=null}function Ql(){vt(qn),vt(cn)}function Zd(o,l,d){if(cn.current!==vr)throw Error(p(168));un(cn,l),un(qn,d)}function Jd(o,l,d){var y=o.stateNode;if(o=l.childContextTypes,typeof y.getChildContext!="function")return d;y=y.getChildContext();for(var E in y)if(!(E in o))throw Error(p(108,be(l)||"Unknown",E));return a({},d,y)}function go(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||vr,Fn=cn.current,un(cn,o),un(qn,qn.current),!0}function eh(o,l,d){var y=o.stateNode;if(!y)throw Error(p(169));d?(o=Jd(o,l,Fn),y.__reactInternalMemoizedMergedChildContext=o,vt(qn),vt(cn),un(cn,o)):vt(qn),un(qn,d)}var kc=null,Bi=null,dm=f.unstable_now;dm();var Gl=0,Wt=8;function ir(o){if(1&o)return Wt=15,1;if(2&o)return Wt=14,2;if(4&o)return Wt=13,4;var l=24&o;return l!==0?(Wt=12,l):o&32?(Wt=11,32):(l=192&o,l!==0?(Wt=10,l):o&256?(Wt=9,256):(l=3584&o,l!==0?(Wt=8,l):o&4096?(Wt=7,4096):(l=4186112&o,l!==0?(Wt=6,l):(l=62914560&o,l!==0?(Wt=5,l):o&67108864?(Wt=4,67108864):o&134217728?(Wt=3,134217728):(l=805306368&o,l!==0?(Wt=2,l):1073741824&o?(Wt=1,1073741824):(Wt=8,o))))))}function hm(o){switch(o){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}function pm(o){switch(o){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(p(358,o))}}function yo(o,l){var d=o.pendingLanes;if(d===0)return Wt=0;var y=0,E=0,C=o.expiredLanes,N=o.suspendedLanes,B=o.pingedLanes;if(C!==0)y=C,E=Wt=15;else if(C=d&134217727,C!==0){var te=C&~N;te!==0?(y=ir(te),E=Wt):(B&=C,B!==0&&(y=ir(B),E=Wt))}else C=d&~N,C!==0?(y=ir(C),E=Wt):B!==0&&(y=ir(B),E=Wt);if(y===0)return 0;if(y=31-is(y),y=d&((0>y?0:1<<y)<<1)-1,l!==0&&l!==y&&!(l&N)){if(ir(l),E<=Wt)return l;Wt=E}if(l=o.entangledLanes,l!==0)for(o=o.entanglements,l&=y;0<l;)d=31-is(l),E=1<<d,y|=o[d],l&=~E;return y}function th(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function Xl(o,l){switch(o){case 15:return 1;case 14:return 2;case 12:return o=xa(24&~l),o===0?Xl(10,l):o;case 10:return o=xa(192&~l),o===0?Xl(8,l):o;case 8:return o=xa(3584&~l),o===0&&(o=xa(4186112&~l),o===0&&(o=512)),o;case 2:return l=xa(805306368&~l),l===0&&(l=268435456),l}throw Error(p(358,o))}function xa(o){return o&-o}function Ic(o){for(var l=[],d=0;31>d;d++)l.push(o);return l}function Kl(o,l,d){o.pendingLanes|=l;var y=l-1;o.suspendedLanes&=y,o.pingedLanes&=y,o=o.eventTimes,l=31-is(l),o[l]=d}var is=Math.clz32?Math.clz32:gm,vm=Math.log,mm=Math.LN2;function gm(o){return o===0?32:31-(vm(o)/mm|0)|0}var nh=f.unstable_runWithPriority,Nc=f.unstable_scheduleCallback,zc=f.unstable_cancelCallback,ym=f.unstable_shouldYield,ih=f.unstable_requestPaint,So=f.unstable_now,Sm=f.unstable_getCurrentPriorityLevel,bo=f.unstable_ImmediatePriority,Uc=f.unstable_UserBlockingPriority,rh=f.unstable_NormalPriority,jc=f.unstable_LowPriority,Fc=f.unstable_IdlePriority,Zl={},bm=ih!==void 0?ih:function(){},Lr=null,Jl=null,Bc=!1,eu=So(),Dn=1e4>eu?So:function(){return So()-eu};function wa(){switch(Sm()){case bo:return 99;case Uc:return 98;case rh:return 97;case jc:return 96;case Fc:return 95;default:throw Error(p(332))}}function sh(o){switch(o){case 99:return bo;case 98:return Uc;case 97:return rh;case 96:return jc;case 95:return Fc;default:throw Error(p(332))}}function Pr(o,l){return o=sh(o),nh(o,l)}function Ca(o,l,d){return o=sh(o),Nc(o,l,d)}function Hi(){if(Jl!==null){var o=Jl;Jl=null,zc(o)}ah()}function ah(){if(!Bc&&Lr!==null){Bc=!0;var o=0;try{var l=Lr;Pr(99,function(){for(;o<l.length;o++){var d=l[o];do d=d(!0);while(d!==null)}}),Lr=null}catch(d){throw Lr!==null&&(Lr=Lr.slice(o+1)),Nc(bo,Hi),d}finally{Bc=!1}}}var Em=g.ReactCurrentBatchConfig;function xm(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var Vi=typeof Object.is=="function"?Object.is:xm,wm=Object.prototype.hasOwnProperty;function tu(o,l){if(Vi(o,l))return!0;if(typeof o!="object"||o===null||typeof l!="object"||l===null)return!1;var d=Object.keys(o),y=Object.keys(l);if(d.length!==y.length)return!1;for(y=0;y<d.length;y++)if(!wm.call(l,d[y])||!Vi(o[d[y]],l[d[y]]))return!1;return!0}function Cm(o){switch(o.tag){case 5:return bn(o.type);case 16:return bn("Lazy");case 13:return bn("Suspense");case 19:return bn("SuspenseList");case 0:case 2:case 15:return o=$t(o.type,!1),o;case 11:return o=$t(o.type.render,!1),o;case 22:return o=$t(o.type._render,!1),o;case 1:return o=$t(o.type,!0),o;default:return""}}function rr(o,l){if(o&&o.defaultProps){l=a({},l),o=o.defaultProps;for(var d in o)l[d]===void 0&&(l[d]=o[d]);return l}return l}var nu=Fi(null),iu=null,gr=null,Eo=null;function ru(){Eo=gr=iu=null}function Hc(o,l){o=o.type._context,Et?(un(nu,o._currentValue),o._currentValue=l):(un(nu,o._currentValue2),o._currentValue2=l)}function su(o){var l=nu.current;vt(nu),o=o.type._context,Et?o._currentValue=l:o._currentValue2=l}function Vc(o,l){for(;o!==null;){var d=o.alternate;if((o.childLanes&l)===l){if(d===null||(d.childLanes&l)===l)break;d.childLanes|=l}else o.childLanes|=l,d!==null&&(d.childLanes|=l);o=o.return}}function Is(o,l){iu=o,Eo=gr=null,o=o.dependencies,o!==null&&o.firstContext!==null&&(o.lanes&l&&(Yi=!0),o.firstContext=null)}function Mi(o,l){if(Eo!==o&&l!==!1&&l!==0)if((typeof l!="number"||l===1073741823)&&(Eo=o,l=1073741823),l={context:o,observedBits:l,next:null},gr===null){if(iu===null)throw Error(p(308));gr=l,iu.dependencies={lanes:0,firstContext:l,responders:null}}else gr=gr.next=l;return Et?o._currentValue:o._currentValue2}var Dr=!1;function $i(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function sr(o,l){o=o.updateQueue,l.updateQueue===o&&(l.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,effects:o.effects})}function yr(o,l){return{eventTime:o,lane:l,tag:0,payload:null,callback:null,next:null}}function Sr(o,l){if(o=o.updateQueue,o!==null){o=o.shared;var d=o.pending;d===null?l.next=l:(l.next=d.next,d.next=l),o.pending=l}}function kr(o,l){var d=o.updateQueue,y=o.alternate;if(y!==null&&(y=y.updateQueue,d===y)){var E=null,C=null;if(d=d.firstBaseUpdate,d!==null){do{var N={eventTime:d.eventTime,lane:d.lane,tag:d.tag,payload:d.payload,callback:d.callback,next:null};C===null?E=C=N:C=C.next=N,d=d.next}while(d!==null);C===null?E=C=l:C=C.next=l}else E=C=l;d={baseState:y.baseState,firstBaseUpdate:E,lastBaseUpdate:C,shared:y.shared,effects:y.effects},o.updateQueue=d;return}o=d.lastBaseUpdate,o===null?d.firstBaseUpdate=l:o.next=l,d.lastBaseUpdate=l}function Ns(o,l,d,y){var E=o.updateQueue;Dr=!1;var C=E.firstBaseUpdate,N=E.lastBaseUpdate,B=E.shared.pending;if(B!==null){E.shared.pending=null;var te=B,we=te.next;te.next=null,N===null?C=we:N.next=we,N=te;var He=o.alternate;if(He!==null){He=He.updateQueue;var Je=He.lastBaseUpdate;Je!==N&&(Je===null?He.firstBaseUpdate=we:Je.next=we,He.lastBaseUpdate=te)}}if(C!==null){Je=E.baseState,N=0,He=we=te=null;do{B=C.lane;var Me=C.eventTime;if((y&B)===B){He!==null&&(He=He.next={eventTime:Me,lane:0,tag:C.tag,payload:C.payload,callback:C.callback,next:null});e:{var kt=o,Qt=C;switch(B=l,Me=d,Qt.tag){case 1:if(kt=Qt.payload,typeof kt=="function"){Je=kt.call(Me,Je,B);break e}Je=kt;break e;case 3:kt.flags=kt.flags&-4097|64;case 0:if(kt=Qt.payload,B=typeof kt=="function"?kt.call(Me,Je,B):kt,B==null)break e;Je=a({},Je,B);break e;case 2:Dr=!0}}C.callback!==null&&(o.flags|=32,B=E.effects,B===null?E.effects=[C]:B.push(C))}else Me={eventTime:Me,lane:B,tag:C.tag,payload:C.payload,callback:C.callback,next:null},He===null?(we=He=Me,te=Je):He=He.next=Me,N|=B;if(C=C.next,C===null){if(B=E.shared.pending,B===null)break;C=B.next,B.next=null,E.lastBaseUpdate=B,E.shared.pending=null}}while(!0);He===null&&(te=Je),E.baseState=te,E.firstBaseUpdate=we,E.lastBaseUpdate=He,qo|=N,o.lanes=N,o.memoizedState=Je}}function xo(o,l,d){if(o=l.effects,l.effects=null,o!==null)for(l=0;l<o.length;l++){var y=o[l],E=y.callback;if(E!==null){if(y.callback=null,y=d,typeof E!="function")throw Error(p(191,E));E.call(y)}}}var oh=new u.Component().refs;function Ta(o,l,d,y){l=o.memoizedState,d=d(y,l),d=d==null?l:a({},l,d),o.memoizedState=d,o.lanes===0&&(o.updateQueue.baseState=d)}var au={isMounted:function(o){return(o=o._reactInternals)?Ee(o)===o:!1},enqueueSetState:function(o,l,d){o=o._reactInternals;var y=Si(),E=An(o),C=yr(y,E);C.payload=l,d!=null&&(C.callback=d),Sr(o,C),Hr(o,E,y)},enqueueReplaceState:function(o,l,d){o=o._reactInternals;var y=Si(),E=An(o),C=yr(y,E);C.tag=1,C.payload=l,d!=null&&(C.callback=d),Sr(o,C),Hr(o,E,y)},enqueueForceUpdate:function(o,l){o=o._reactInternals;var d=Si(),y=An(o),E=yr(d,y);E.tag=2,l!=null&&(E.callback=l),Sr(o,E),Hr(o,y,d)}};function Ra(o,l,d,y,E,C,N){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(y,C,N):l.prototype&&l.prototype.isPureReactComponent?!tu(d,y)||!tu(E,C):!0}function lh(o,l,d){var y=!1,E=vr,C=l.contextType;return typeof C=="object"&&C!==null?C=Mi(C):(E=tn(l)?Fn:cn.current,y=l.contextTypes,C=(y=y!=null)?mr(o,E):vr),l=new l(d,C),o.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=au,o.stateNode=l,l._reactInternals=o,y&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=E,o.__reactInternalMemoizedMaskedChildContext=C),l}function ou(o,l,d,y){o=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(d,y),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(d,y),l.state!==o&&au.enqueueReplaceState(l,l.state,null)}function lu(o,l,d,y){var E=o.stateNode;E.props=d,E.state=o.memoizedState,E.refs=oh,$i(o);var C=l.contextType;typeof C=="object"&&C!==null?E.context=Mi(C):(C=tn(l)?Fn:cn.current,E.context=mr(o,C)),Ns(o,d,E,y),E.state=o.memoizedState,C=l.getDerivedStateFromProps,typeof C=="function"&&(Ta(o,l,C,d),E.state=o.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(l=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),l!==E.state&&au.enqueueReplaceState(E,E.state,null),Ns(o,d,E,y),E.state=o.memoizedState),typeof E.componentDidMount=="function"&&(o.flags|=4)}var wo=Array.isArray;function rs(o,l,d){if(o=d.ref,o!==null&&typeof o!="function"&&typeof o!="object"){if(d._owner){if(d=d._owner,d){if(d.tag!==1)throw Error(p(309));var y=d.stateNode}if(!y)throw Error(p(147,o));var E=""+o;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===E?l.ref:(l=function(C){var N=y.refs;N===oh&&(N=y.refs={}),C===null?delete N[E]:N[E]=C},l._stringRef=E,l)}if(typeof o!="string")throw Error(p(284));if(!d._owner)throw Error(p(290,o))}return o}function vi(o,l){if(o.type!=="textarea")throw Error(p(31,Object.prototype.toString.call(l)==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":l))}function uu(o){function l(Q,V){if(o){var ne=Q.lastEffect;ne!==null?(ne.nextEffect=V,Q.lastEffect=V):Q.firstEffect=Q.lastEffect=V,V.nextEffect=null,V.flags=8}}function d(Q,V){if(!o)return null;for(;V!==null;)l(Q,V),V=V.sibling;return null}function y(Q,V){for(Q=new Map;V!==null;)V.key!==null?Q.set(V.key,V):Q.set(V.index,V),V=V.sibling;return Q}function E(Q,V){return Q=Ht(Q,V),Q.index=0,Q.sibling=null,Q}function C(Q,V,ne){return Q.index=ne,o?(ne=Q.alternate,ne!==null?(ne=ne.index,ne<V?(Q.flags=2,V):ne):(Q.flags=2,V)):V}function N(Q){return o&&Q.alternate===null&&(Q.flags=2),Q}function B(Q,V,ne,Ae){return V===null||V.tag!==6?(V=al(ne,Q.mode,Ae),V.return=Q,V):(V=E(V,ne),V.return=Q,V)}function te(Q,V,ne,Ae){return V!==null&&V.elementType===ne.type?(Ae=E(V,ne.props),Ae.ref=rs(Q,V,ne),Ae.return=Q,Ae):(Ae=sl(ne.type,ne.key,ne.props,null,Q.mode,Ae),Ae.ref=rs(Q,V,ne),Ae.return=Q,Ae)}function we(Q,V,ne,Ae){return V===null||V.tag!==4||V.stateNode.containerInfo!==ne.containerInfo||V.stateNode.implementation!==ne.implementation?(V=Ha(ne,Q.mode,Ae),V.return=Q,V):(V=E(V,ne.children||[]),V.return=Q,V)}function He(Q,V,ne,Ae,Ve){return V===null||V.tag!==7?(V=Gs(ne,Q.mode,Ae,Ve),V.return=Q,V):(V=E(V,ne),V.return=Q,V)}function Je(Q,V,ne){if(typeof V=="string"||typeof V=="number")return V=al(""+V,Q.mode,ne),V.return=Q,V;if(typeof V=="object"&&V!==null){switch(V.$$typeof){case S:return ne=sl(V.type,V.key,V.props,null,Q.mode,ne),ne.ref=rs(Q,null,V),ne.return=Q,ne;case m:return V=Ha(V,Q.mode,ne),V.return=Q,V}if(wo(V)||ge(V))return V=Gs(V,Q.mode,ne,null),V.return=Q,V;vi(Q,V)}return null}function Me(Q,V,ne,Ae){var Ve=V!==null?V.key:null;if(typeof ne=="string"||typeof ne=="number")return Ve!==null?null:B(Q,V,""+ne,Ae);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case S:return ne.key===Ve?ne.type===x?He(Q,V,ne.props.children,Ae,Ve):te(Q,V,ne,Ae):null;case m:return ne.key===Ve?we(Q,V,ne,Ae):null}if(wo(ne)||ge(ne))return Ve!==null?null:He(Q,V,ne,Ae,null);vi(Q,ne)}return null}function kt(Q,V,ne,Ae,Ve){if(typeof Ae=="string"||typeof Ae=="number")return Q=Q.get(ne)||null,B(V,Q,""+Ae,Ve);if(typeof Ae=="object"&&Ae!==null){switch(Ae.$$typeof){case S:return Q=Q.get(Ae.key===null?ne:Ae.key)||null,Ae.type===x?He(V,Q,Ae.props.children,Ve,Ae.key):te(V,Q,Ae,Ve);case m:return Q=Q.get(Ae.key===null?ne:Ae.key)||null,we(V,Q,Ae,Ve)}if(wo(Ae)||ge(Ae))return Q=Q.get(ne)||null,He(V,Q,Ae,Ve,null);vi(V,Ae)}return null}function Qt(Q,V,ne,Ae){for(var Ve=null,It=null,et=V,Mt=V=0,Cn=null;et!==null&&Mt<ne.length;Mt++){et.index>Mt?(Cn=et,et=null):Cn=et.sibling;var St=Me(Q,et,ne[Mt],Ae);if(St===null){et===null&&(et=Cn);break}o&&et&&St.alternate===null&&l(Q,et),V=C(St,V,Mt),It===null?Ve=St:It.sibling=St,It=St,et=Cn}if(Mt===ne.length)return d(Q,et),Ve;if(et===null){for(;Mt<ne.length;Mt++)et=Je(Q,ne[Mt],Ae),et!==null&&(V=C(et,V,Mt),It===null?Ve=et:It.sibling=et,It=et);return Ve}for(et=y(Q,et);Mt<ne.length;Mt++)Cn=kt(et,Q,Mt,ne[Mt],Ae),Cn!==null&&(o&&Cn.alternate!==null&&et.delete(Cn.key===null?Mt:Cn.key),V=C(Cn,V,Mt),It===null?Ve=Cn:It.sibling=Cn,It=Cn);return o&&et.forEach(function(Vr){return l(Q,Vr)}),Ve}function ki(Q,V,ne,Ae){var Ve=ge(ne);if(typeof Ve!="function")throw Error(p(150));if(ne=Ve.call(ne),ne==null)throw Error(p(151));for(var It=Ve=null,et=V,Mt=V=0,Cn=null,St=ne.next();et!==null&&!St.done;Mt++,St=ne.next()){et.index>Mt?(Cn=et,et=null):Cn=et.sibling;var Vr=Me(Q,et,St.value,Ae);if(Vr===null){et===null&&(et=Cn);break}o&&et&&Vr.alternate===null&&l(Q,et),V=C(Vr,V,Mt),It===null?Ve=Vr:It.sibling=Vr,It=Vr,et=Cn}if(St.done)return d(Q,et),Ve;if(et===null){for(;!St.done;Mt++,St=ne.next())St=Je(Q,St.value,Ae),St!==null&&(V=C(St,V,Mt),It===null?Ve=St:It.sibling=St,It=St);return Ve}for(et=y(Q,et);!St.done;Mt++,St=ne.next())St=kt(et,Q,Mt,St.value,Ae),St!==null&&(o&&St.alternate!==null&&et.delete(St.key===null?Mt:St.key),V=C(St,V,Mt),It===null?Ve=St:It.sibling=St,It=St);return o&&et.forEach(function(Pm){return l(Q,Pm)}),Ve}return function(Q,V,ne,Ae){var Ve=typeof ne=="object"&&ne!==null&&ne.type===x&&ne.key===null;Ve&&(ne=ne.props.children);var It=typeof ne=="object"&&ne!==null;if(It)switch(ne.$$typeof){case S:e:{for(It=ne.key,Ve=V;Ve!==null;){if(Ve.key===It){switch(Ve.tag){case 7:if(ne.type===x){d(Q,Ve.sibling),V=E(Ve,ne.props.children),V.return=Q,Q=V;break e}break;default:if(Ve.elementType===ne.type){d(Q,Ve.sibling),V=E(Ve,ne.props),V.ref=rs(Q,Ve,ne),V.return=Q,Q=V;break e}}d(Q,Ve);break}else l(Q,Ve);Ve=Ve.sibling}ne.type===x?(V=Gs(ne.props.children,Q.mode,Ae,ne.key),V.return=Q,Q=V):(Ae=sl(ne.type,ne.key,ne.props,null,Q.mode,Ae),Ae.ref=rs(Q,V,ne),Ae.return=Q,Q=Ae)}return N(Q);case m:e:{for(Ve=ne.key;V!==null;){if(V.key===Ve)if(V.tag===4&&V.stateNode.containerInfo===ne.containerInfo&&V.stateNode.implementation===ne.implementation){d(Q,V.sibling),V=E(V,ne.children||[]),V.return=Q,Q=V;break e}else{d(Q,V);break}else l(Q,V);V=V.sibling}V=Ha(ne,Q.mode,Ae),V.return=Q,Q=V}return N(Q)}if(typeof ne=="string"||typeof ne=="number")return ne=""+ne,V!==null&&V.tag===6?(d(Q,V.sibling),V=E(V,ne),V.return=Q,Q=V):(d(Q,V),V=al(ne,Q.mode,Ae),V.return=Q,Q=V),N(Q);if(wo(ne))return Qt(Q,V,ne,Ae);if(ge(ne))return ki(Q,V,ne,Ae);if(It&&vi(Q,ne),typeof ne>"u"&&!Ve)switch(Q.tag){case 1:case 22:case 0:case 11:case 15:throw Error(p(152,be(Q.type)||"Component"))}return d(Q,V)}}var zs=uu(!0),br=uu(!1),Wi={},Ft=Fi(Wi),En=Fi(Wi),ss=Fi(Wi);function fn(o){if(o===Wi)throw Error(p(174));return o}function ar(o,l){un(ss,l),un(En,o),un(Ft,Wi),o=mt(l),vt(Ft),un(Ft,o)}function ri(){vt(Ft),vt(En),vt(ss)}function cu(o){var l=fn(ss.current),d=fn(Ft.current);l=he(d,o.type,l),d!==l&&(un(En,o),un(Ft,l))}function as(o){En.current===o&&(vt(Ft),vt(En))}var an=Fi(0);function Ir(o){for(var l=o;l!==null;){if(l.tag===13){var d=l.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||ql(d)||Yl(d)))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if(l.flags&64)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var qi=null,Yn=null,Oi=!1;function fu(o,l){var d=Di(5,null,null,0);d.elementType="DELETED",d.type="DELETED",d.stateNode=l,d.return=o,d.flags=8,o.lastEffect!==null?(o.lastEffect.nextEffect=d,o.lastEffect=d):o.firstEffect=o.lastEffect=d}function $c(o,l){switch(o.tag){case 5:return l=Pc(l,o.type,o.pendingProps),l!==null?(o.stateNode=l,!0):!1;case 6:return l=Dc(l,o.pendingProps),l!==null?(o.stateNode=l,!0):!1;case 13:return!1;default:return!1}}function du(o){if(Oi){var l=Yn;if(l){var d=l;if(!$c(o,l)){if(l=z(d),!l||!$c(o,l)){o.flags=o.flags&-1025|2,Oi=!1,qi=o;return}fu(qi,d)}qi=o,Yn=de(l)}else o.flags=o.flags&-1025|2,Oi=!1,qi=o}}function Co(o){for(o=o.return;o!==null&&o.tag!==5&&o.tag!==3&&o.tag!==13;)o=o.return;qi=o}function To(o){if(!Kt||o!==qi)return!1;if(!Oi)return Co(o),Oi=!0,!1;var l=o.type;if(o.tag!==5||l!=="head"&&l!=="body"&&!yt(l,o.memoizedProps))for(l=Yn;l;)fu(o,l),l=z(l);if(Co(o),o.tag===13){if(!Kt)throw Error(p(316));if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(p(317));Yn=Ct(o)}else Yn=qi?z(o.stateNode):null;return!0}function Wc(){Kt&&(Yn=qi=null,Oi=!1)}var Us=[];function hu(){for(var o=0;o<Us.length;o++){var l=Us[o];Et?l._workInProgressVersionPrimary=null:l._workInProgressVersionSecondary=null}Us.length=0}var Aa=g.ReactCurrentDispatcher,si=g.ReactCurrentBatchConfig,mi=0,qt=null,Qn=null,Bn=null,pu=!1,Ro=!1;function gi(){throw Error(p(321))}function qc(o,l){if(l===null)return!1;for(var d=0;d<l.length&&d<o.length;d++)if(!Vi(o[d],l[d]))return!1;return!0}function vu(o,l,d,y,E,C){if(mi=C,qt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,Aa.current=o===null||o.memoizedState===null?Do:yu,o=d(y,E),Ro){C=0;do{if(Ro=!1,!(25>C))throw Error(p(301));C+=1,Bn=Qn=null,l.updateQueue=null,Aa.current=Su,o=d(y,E)}while(Ro)}if(Aa.current=Rt,l=Qn!==null&&Qn.next!==null,mi=0,Bn=Qn=qt=null,pu=!1,l)throw Error(p(300));return o}function os(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bn===null?qt.memoizedState=Bn=o:Bn=Bn.next=o,Bn}function ls(){if(Qn===null){var o=qt.alternate;o=o!==null?o.memoizedState:null}else o=Qn.next;var l=Bn===null?qt.memoizedState:Bn.next;if(l!==null)Bn=l,Qn=o;else{if(o===null)throw Error(p(310));Qn=o,o={memoizedState:Qn.memoizedState,baseState:Qn.baseState,baseQueue:Qn.baseQueue,queue:Qn.queue,next:null},Bn===null?qt.memoizedState=Bn=o:Bn=Bn.next=o}return Bn}function Er(o,l){return typeof l=="function"?l(o):l}function Ma(o){var l=ls(),d=l.queue;if(d===null)throw Error(p(311));d.lastRenderedReducer=o;var y=Qn,E=y.baseQueue,C=d.pending;if(C!==null){if(E!==null){var N=E.next;E.next=C.next,C.next=N}y.baseQueue=E=C,d.pending=null}if(E!==null){E=E.next,y=y.baseState;var B=N=C=null,te=E;do{var we=te.lane;if((mi&we)===we)B!==null&&(B=B.next={lane:0,action:te.action,eagerReducer:te.eagerReducer,eagerState:te.eagerState,next:null}),y=te.eagerReducer===o?te.eagerState:o(y,te.action);else{var He={lane:we,action:te.action,eagerReducer:te.eagerReducer,eagerState:te.eagerState,next:null};B===null?(N=B=He,C=y):B=B.next=He,qt.lanes|=we,qo|=we}te=te.next}while(te!==null&&te!==E);B===null?C=y:B.next=N,Vi(y,l.memoizedState)||(Yi=!0),l.memoizedState=y,l.baseState=C,l.baseQueue=B,d.lastRenderedState=y}return[l.memoizedState,d.dispatch]}function Ao(o){var l=ls(),d=l.queue;if(d===null)throw Error(p(311));d.lastRenderedReducer=o;var y=d.dispatch,E=d.pending,C=l.memoizedState;if(E!==null){d.pending=null;var N=E=E.next;do C=o(C,N.action),N=N.next;while(N!==E);Vi(C,l.memoizedState)||(Yi=!0),l.memoizedState=C,l.baseQueue===null&&(l.baseState=C),d.lastRenderedState=C}return[C,y]}function js(o,l,d){var y=l._getVersion;y=y(l._source);var E=Et?l._workInProgressVersionPrimary:l._workInProgressVersionSecondary;if(E!==null?o=E===y:(o=o.mutableReadLanes,(o=(mi&o)===o)&&(Et?l._workInProgressVersionPrimary=y:l._workInProgressVersionSecondary=y,Us.push(l))),o)return d(l._source);throw Us.push(l),Error(p(350))}function Mo(o,l,d,y){var E=Xn;if(E===null)throw Error(p(349));var C=l._getVersion,N=C(l._source),B=Aa.current,te=B.useState(function(){return js(E,l,d)}),we=te[1],He=te[0];te=Bn;var Je=o.memoizedState,Me=Je.refs,kt=Me.getSnapshot,Qt=Je.source;Je=Je.subscribe;var ki=qt;return o.memoizedState={refs:Me,source:l,subscribe:y},B.useEffect(function(){Me.getSnapshot=d,Me.setSnapshot=we;var Q=C(l._source);if(!Vi(N,Q)){Q=d(l._source),Vi(He,Q)||(we(Q),Q=An(ki),E.mutableReadLanes|=Q&E.pendingLanes),Q=E.mutableReadLanes,E.entangledLanes|=Q;for(var V=E.entanglements,ne=Q;0<ne;){var Ae=31-is(ne),Ve=1<<Ae;V[Ae]|=Q,ne&=~Ve}}},[d,l,y]),B.useEffect(function(){return y(l._source,function(){var Q=Me.getSnapshot,V=Me.setSnapshot;try{V(Q(l._source));var ne=An(ki);E.mutableReadLanes|=ne&E.pendingLanes}catch(Ae){V(function(){throw Ae})}})},[l,y]),Vi(kt,d)&&Vi(Qt,l)&&Vi(Je,y)||(o={pending:null,dispatch:null,lastRenderedReducer:Er,lastRenderedState:He},o.dispatch=we=Gn.bind(null,qt,o),te.queue=o,te.baseQueue=null,He=js(E,l,d),te.memoizedState=te.baseState=He),He}function Yc(o,l,d){var y=ls();return Mo(y,o,l,d)}function us(o){var l=os();return typeof o=="function"&&(o=o()),l.memoizedState=l.baseState=o,o=l.queue={pending:null,dispatch:null,lastRenderedReducer:Er,lastRenderedState:o},o=o.dispatch=Gn.bind(null,qt,o),[l.memoizedState,o]}function Oo(o,l,d,y){return o={tag:o,create:l,destroy:d,deps:y,next:null},l=qt.updateQueue,l===null?(l={lastEffect:null},qt.updateQueue=l,l.lastEffect=o.next=o):(d=l.lastEffect,d===null?l.lastEffect=o.next=o:(y=d.next,d.next=o,o.next=y,l.lastEffect=o)),o}function Fs(o){var l=os();return o={current:o},l.memoizedState=o}function _o(){return ls().memoizedState}function Nr(o,l,d,y){var E=os();qt.flags|=o,E.memoizedState=Oo(1|l,d,void 0,y===void 0?null:y)}function mu(o,l,d,y){var E=ls();y=y===void 0?null:y;var C=void 0;if(Qn!==null){var N=Qn.memoizedState;if(C=N.destroy,y!==null&&qc(y,N.deps)){Oo(l,d,C,y);return}}qt.flags|=o,E.memoizedState=Oo(1|l,d,C,y)}function Lo(o,l){return Nr(516,4,o,l)}function Oa(o,l){return mu(516,4,o,l)}function Qc(o,l){return mu(4,2,o,l)}function Gc(o,l){if(typeof l=="function")return o=o(),l(o),function(){l(null)};if(l!=null)return o=o(),l.current=o,function(){l.current=null}}function Po(o,l,d){return d=d!=null?d.concat([o]):null,mu(4,2,Gc.bind(null,l,o),d)}function gu(){}function zr(o,l){var d=ls();l=l===void 0?null:l;var y=d.memoizedState;return y!==null&&l!==null&&qc(l,y[1])?y[0]:(d.memoizedState=[o,l],o)}function uh(o,l){var d=ls();l=l===void 0?null:l;var y=d.memoizedState;return y!==null&&l!==null&&qc(l,y[1])?y[0]:(o=o(),d.memoizedState=[o,l],o)}function le(o,l){var d=wa();Pr(98>d?98:d,function(){o(!0)}),Pr(97<d?97:d,function(){var y=si.transition;si.transition=1;try{o(!1),l()}finally{si.transition=y}})}function Gn(o,l,d){var y=Si(),E=An(o),C={lane:E,action:d,eagerReducer:null,eagerState:null,next:null},N=l.pending;if(N===null?C.next=C:(C.next=N.next,N.next=C),l.pending=C,N=o.alternate,o===qt||N!==null&&N===qt)Ro=pu=!0;else{if(o.lanes===0&&(N===null||N.lanes===0)&&(N=l.lastRenderedReducer,N!==null))try{var B=l.lastRenderedState,te=N(B,d);if(C.eagerReducer=N,C.eagerState=te,Vi(te,B))return}catch{}finally{}Hr(o,E,y)}}var Rt={readContext:Mi,useCallback:gi,useContext:gi,useEffect:gi,useImperativeHandle:gi,useLayoutEffect:gi,useMemo:gi,useReducer:gi,useRef:gi,useState:gi,useDebugValue:gi,useDeferredValue:gi,useTransition:gi,useMutableSource:gi,useOpaqueIdentifier:gi,unstable_isNewReconciler:!1},Do={readContext:Mi,useCallback:function(o,l){return os().memoizedState=[o,l===void 0?null:l],o},useContext:Mi,useEffect:Lo,useImperativeHandle:function(o,l,d){return d=d!=null?d.concat([o]):null,Nr(4,2,Gc.bind(null,l,o),d)},useLayoutEffect:function(o,l){return Nr(4,2,o,l)},useMemo:function(o,l){var d=os();return l=l===void 0?null:l,o=o(),d.memoizedState=[o,l],o},useReducer:function(o,l,d){var y=os();return l=d!==void 0?d(l):l,y.memoizedState=y.baseState=l,o=y.queue={pending:null,dispatch:null,lastRenderedReducer:o,lastRenderedState:l},o=o.dispatch=Gn.bind(null,qt,o),[y.memoizedState,o]},useRef:Fs,useState:us,useDebugValue:gu,useDeferredValue:function(o){var l=us(o),d=l[0],y=l[1];return Lo(function(){var E=si.transition;si.transition=1;try{y(o)}finally{si.transition=E}},[o]),d},useTransition:function(){var o=us(!1),l=o[0];return o=le.bind(null,o[1]),Fs(o),[o,l]},useMutableSource:function(o,l,d){var y=os();return y.memoizedState={refs:{getSnapshot:l,setSnapshot:null},source:o,subscribe:d},Mo(y,o,l,d)},useOpaqueIdentifier:function(){if(Oi){var o=!1,l=U(function(){throw o||(o=!0,d(I())),Error(p(355))}),d=us(l)[1];return!(qt.mode&2)&&(qt.flags|=516,Oo(5,function(){d(I())},void 0,null)),l}return l=I(),us(l),l},unstable_isNewReconciler:!1},yu={readContext:Mi,useCallback:zr,useContext:Mi,useEffect:Oa,useImperativeHandle:Po,useLayoutEffect:Qc,useMemo:uh,useReducer:Ma,useRef:_o,useState:function(){return Ma(Er)},useDebugValue:gu,useDeferredValue:function(o){var l=Ma(Er),d=l[0],y=l[1];return Oa(function(){var E=si.transition;si.transition=1;try{y(o)}finally{si.transition=E}},[o]),d},useTransition:function(){var o=Ma(Er)[0];return[_o().current,o]},useMutableSource:Yc,useOpaqueIdentifier:function(){return Ma(Er)[0]},unstable_isNewReconciler:!1},Su={readContext:Mi,useCallback:zr,useContext:Mi,useEffect:Oa,useImperativeHandle:Po,useLayoutEffect:Qc,useMemo:uh,useReducer:Ao,useRef:_o,useState:function(){return Ao(Er)},useDebugValue:gu,useDeferredValue:function(o){var l=Ao(Er),d=l[0],y=l[1];return Oa(function(){var E=si.transition;si.transition=1;try{y(o)}finally{si.transition=E}},[o]),d},useTransition:function(){var o=Ao(Er)[0];return[_o().current,o]},useMutableSource:Yc,useOpaqueIdentifier:function(){return Ao(Er)[0]},unstable_isNewReconciler:!1},ch=g.ReactCurrentOwner,Yi=!1;function ai(o,l,d,y){l.child=o===null?br(l,null,d,y):zs(l,o.child,d,y)}function bu(o,l,d,y,E){d=d.render;var C=l.ref;return Is(l,E),y=vu(o,l,d,y,C,E),o!==null&&!Yi?(l.updateQueue=o.updateQueue,l.flags&=-517,o.lanes&=~E,jr(o,l,E)):(l.flags|=1,ai(o,l,y,E),l.child)}function Xc(o,l,d,y,E,C){if(o===null){var N=d.type;return typeof N=="function"&&!df(N)&&N.defaultProps===void 0&&d.compare===null&&d.defaultProps===void 0?(l.tag=15,l.type=N,Bs(o,l,N,y,E,C)):(o=sl(d.type,null,y,l,l.mode,C),o.ref=l.ref,o.return=l,l.child=o)}return N=o.child,!(E&C)&&(E=N.memoizedProps,d=d.compare,d=d!==null?d:tu,d(E,y)&&o.ref===l.ref)?jr(o,l,C):(l.flags|=1,o=Ht(N,y),o.ref=l.ref,o.return=l,l.child=o)}function Bs(o,l,d,y,E,C){if(o!==null&&tu(o.memoizedProps,y)&&o.ref===l.ref)if(Yi=!1,(C&E)!==0)o.flags&16384&&(Yi=!0);else return l.lanes=o.lanes,jr(o,l,C);return ko(o,l,d,y,C)}function _a(o,l,d){var y=l.pendingProps,E=y.children,C=o!==null?o.memoizedState:null;if(y.mode==="hidden"||y.mode==="unstable-defer-without-hiding")if(!(l.mode&4))l.memoizedState={baseLanes:0},$n(l,d);else if(d&1073741824)l.memoizedState={baseLanes:0},$n(l,C!==null?C.baseLanes:d);else return o=C!==null?C.baseLanes|d:d,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:o},$n(l,o),null;else C!==null?(y=C.baseLanes|d,l.memoizedState=null):y=d,$n(l,y);return ai(o,l,E,d),l.child}function Hs(o,l){var d=l.ref;(o===null&&d!==null||o!==null&&o.ref!==d)&&(l.flags|=128)}function ko(o,l,d,y,E){var C=tn(d)?Fn:cn.current;return C=mr(l,C),Is(l,E),d=vu(o,l,d,y,C,E),o!==null&&!Yi?(l.updateQueue=o.updateQueue,l.flags&=-517,o.lanes&=~E,jr(o,l,E)):(l.flags|=1,ai(o,l,d,E),l.child)}function Kc(o,l,d,y,E){if(tn(d)){var C=!0;go(l)}else C=!1;if(Is(l,E),l.stateNode===null)o!==null&&(o.alternate=null,l.alternate=null,l.flags|=2),lh(l,d,y),lu(l,d,y,E),y=!0;else if(o===null){var N=l.stateNode,B=l.memoizedProps;N.props=B;var te=N.context,we=d.contextType;typeof we=="object"&&we!==null?we=Mi(we):(we=tn(d)?Fn:cn.current,we=mr(l,we));var He=d.getDerivedStateFromProps,Je=typeof He=="function"||typeof N.getSnapshotBeforeUpdate=="function";Je||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(B!==y||te!==we)&&ou(l,N,y,we),Dr=!1;var Me=l.memoizedState;N.state=Me,Ns(l,y,N,E),te=l.memoizedState,B!==y||Me!==te||qn.current||Dr?(typeof He=="function"&&(Ta(l,d,He,y),te=l.memoizedState),(B=Dr||Ra(l,d,B,y,Me,te,we))?(Je||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(l.flags|=4)):(typeof N.componentDidMount=="function"&&(l.flags|=4),l.memoizedProps=y,l.memoizedState=te),N.props=y,N.state=te,N.context=we,y=B):(typeof N.componentDidMount=="function"&&(l.flags|=4),y=!1)}else{N=l.stateNode,sr(o,l),B=l.memoizedProps,we=l.type===l.elementType?B:rr(l.type,B),N.props=we,Je=l.pendingProps,Me=N.context,te=d.contextType,typeof te=="object"&&te!==null?te=Mi(te):(te=tn(d)?Fn:cn.current,te=mr(l,te));var kt=d.getDerivedStateFromProps;(He=typeof kt=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(B!==Je||Me!==te)&&ou(l,N,y,te),Dr=!1,Me=l.memoizedState,N.state=Me,Ns(l,y,N,E);var Qt=l.memoizedState;B!==Je||Me!==Qt||qn.current||Dr?(typeof kt=="function"&&(Ta(l,d,kt,y),Qt=l.memoizedState),(we=Dr||Ra(l,d,we,y,Me,Qt,te))?(He||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(y,Qt,te),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(y,Qt,te)),typeof N.componentDidUpdate=="function"&&(l.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(l.flags|=256)):(typeof N.componentDidUpdate!="function"||B===o.memoizedProps&&Me===o.memoizedState||(l.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||B===o.memoizedProps&&Me===o.memoizedState||(l.flags|=256),l.memoizedProps=y,l.memoizedState=Qt),N.props=y,N.state=Qt,N.context=te,y=we):(typeof N.componentDidUpdate!="function"||B===o.memoizedProps&&Me===o.memoizedState||(l.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||B===o.memoizedProps&&Me===o.memoizedState||(l.flags|=256),y=!1)}return Eu(o,l,d,y,C,E)}function Eu(o,l,d,y,E,C){Hs(o,l);var N=(l.flags&64)!==0;if(!y&&!N)return E&&eh(l,d,!1),jr(o,l,C);y=l.stateNode,ch.current=l;var B=N&&typeof d.getDerivedStateFromError!="function"?null:y.render();return l.flags|=1,o!==null&&N?(l.child=zs(l,o.child,null,C),l.child=zs(l,null,B,C)):ai(o,l,B,C),l.memoizedState=y.state,E&&eh(l,d,!0),l.child}function xu(o){var l=o.stateNode;l.pendingContext?Zd(o,l.pendingContext,l.pendingContext!==l.context):l.context&&Zd(o,l.context,!1),ar(o,l.containerInfo)}var _i={dehydrated:null,retryLane:0};function on(o,l,d){var y=l.pendingProps,E=an.current,C=!1,N;return(N=(l.flags&64)!==0)||(N=o!==null&&o.memoizedState===null?!1:(E&2)!==0),N?(C=!0,l.flags&=-65):o!==null&&o.memoizedState===null||y.fallback===void 0||y.unstable_avoidThisFallback===!0||(E|=1),un(an,E&1),o===null?(y.fallback!==void 0&&du(l),o=y.children,E=y.fallback,C?(o=Zc(l,o,E,d),l.child.memoizedState={baseLanes:d},l.memoizedState=_i,o):typeof y.unstable_expectedLoadTime=="number"?(o=Zc(l,o,E,d),l.child.memoizedState={baseLanes:d},l.memoizedState=_i,l.lanes=33554432,o):(d=Ba({mode:"visible",children:o},l.mode,d,null),d.return=l,l.child=d)):o.memoizedState!==null?C?(y=ef(o,l,y.children,y.fallback,d),C=l.child,E=o.child.memoizedState,C.memoizedState=E===null?{baseLanes:d}:{baseLanes:E.baseLanes|d},C.childLanes=o.childLanes&~d,l.memoizedState=_i,y):(d=Jc(o,l,y.children,d),l.memoizedState=null,d):C?(y=ef(o,l,y.children,y.fallback,d),C=l.child,E=o.child.memoizedState,C.memoizedState=E===null?{baseLanes:d}:{baseLanes:E.baseLanes|d},C.childLanes=o.childLanes&~d,l.memoizedState=_i,y):(d=Jc(o,l,y.children,d),l.memoizedState=null,d)}function Zc(o,l,d,y){var E=o.mode,C=o.child;return l={mode:"hidden",children:l},!(E&2)&&C!==null?(C.childLanes=0,C.pendingProps=l):C=Ba(l,E,0,null),d=Gs(d,E,y,null),C.return=o,d.return=o,C.sibling=d,o.child=C,d}function Jc(o,l,d,y){var E=o.child;return o=E.sibling,d=Ht(E,{mode:"visible",children:d}),!(l.mode&2)&&(d.lanes=y),d.return=l,d.sibling=null,o!==null&&(o.nextEffect=null,o.flags=8,l.firstEffect=l.lastEffect=o),l.child=d}function ef(o,l,d,y,E){var C=l.mode,N=o.child;o=N.sibling;var B={mode:"hidden",children:d};return!(C&2)&&l.child!==N?(d=l.child,d.childLanes=0,d.pendingProps=B,N=d.lastEffect,N!==null?(l.firstEffect=d.firstEffect,l.lastEffect=N,N.nextEffect=null):l.firstEffect=l.lastEffect=null):d=Ht(N,B),o!==null?y=Ht(o,y):(y=Gs(y,C,E,null),y.flags|=2),y.return=l,d.return=l,d.sibling=y,l.child=d,y}function Bt(o,l){o.lanes|=l;var d=o.alternate;d!==null&&(d.lanes|=l),Vc(o.return,l)}function Ur(o,l,d,y,E,C){var N=o.memoizedState;N===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:y,tail:d,tailMode:E,lastEffect:C}:(N.isBackwards=l,N.rendering=null,N.renderingStartTime=0,N.last=y,N.tail=d,N.tailMode=E,N.lastEffect=C)}function fh(o,l,d){var y=l.pendingProps,E=y.revealOrder,C=y.tail;if(ai(o,l,y.children,d),y=an.current,y&2)y=y&1|2,l.flags|=64;else{if(o!==null&&o.flags&64)e:for(o=l.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&Bt(o,d);else if(o.tag===19)Bt(o,d);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===l)break e;for(;o.sibling===null;){if(o.return===null||o.return===l)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}y&=1}if(un(an,y),!(l.mode&2))l.memoizedState=null;else switch(E){case"forwards":for(d=l.child,E=null;d!==null;)o=d.alternate,o!==null&&Ir(o)===null&&(E=d),d=d.sibling;d=E,d===null?(E=l.child,l.child=null):(E=d.sibling,d.sibling=null),Ur(l,!1,E,d,C,l.lastEffect);break;case"backwards":for(d=null,E=l.child,l.child=null;E!==null;){if(o=E.alternate,o!==null&&Ir(o)===null){l.child=E;break}o=E.sibling,E.sibling=d,d=E,E=o}Ur(l,!0,d,null,C,l.lastEffect);break;case"together":Ur(l,!1,null,null,void 0,l.lastEffect);break;default:l.memoizedState=null}return l.child}function jr(o,l,d){if(o!==null&&(l.dependencies=o.dependencies),qo|=l.lanes,d&l.childLanes){if(o!==null&&l.child!==o.child)throw Error(p(153));if(l.child!==null){for(o=l.child,d=Ht(o,o.pendingProps),l.child=d,d.return=l;o.sibling!==null;)o=o.sibling,d=d.sibling=Ht(o,o.pendingProps),d.return=l;d.sibling=null}return l.child}return null}function yi(o){o.flags|=4}var Io,No,wu,Cu;if(wt)Io=function(o,l){for(var d=l.child;d!==null;){if(d.tag===5||d.tag===6)gt(o,d.stateNode);else if(d.tag!==4&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return;d=d.return}d.sibling.return=d.return,d=d.sibling}},No=function(){},wu=function(o,l,d,y,E){if(o=o.memoizedProps,o!==y){var C=l.stateNode,N=fn(Ft.current);d=Xt(C,d,o,y,E,N),(l.updateQueue=d)&&yi(l)}},Cu=function(o,l,d,y){d!==y&&yi(l)};else if(yn){Io=function(o,l,d,y){for(var E=l.child;E!==null;){if(E.tag===5){var C=E.stateNode;d&&y&&(C=Wl(C,E.type,E.memoizedProps,E)),gt(o,C)}else if(E.tag===6)C=E.stateNode,d&&y&&(C=ns(C,E.memoizedProps,E)),gt(o,C);else if(E.tag!==4){if(E.tag===13&&E.flags&4&&(C=E.memoizedState!==null)){var N=E.child;if(N!==null&&(N.child!==null&&(N.child.return=N,Io(o,N,!0,C)),C=N.sibling,C!==null)){C.return=E,E=C;continue}}if(E.child!==null){E.child.return=E,E=E.child;continue}}if(E===l)break;for(;E.sibling===null;){if(E.return===null||E.return===l)return;E=E.return}E.sibling.return=E.return,E=E.sibling}};var tf=function(o,l,d,y){for(var E=l.child;E!==null;){if(E.tag===5){var C=E.stateNode;d&&y&&(C=Wl(C,E.type,E.memoizedProps,E)),ks(o,C)}else if(E.tag===6)C=E.stateNode,d&&y&&(C=ns(C,E.memoizedProps,E)),ks(o,C);else if(E.tag!==4){if(E.tag===13&&E.flags&4&&(C=E.memoizedState!==null)){var N=E.child;if(N!==null&&(N.child!==null&&(N.child.return=N,tf(o,N,!0,C)),C=N.sibling,C!==null)){C.return=E,E=C;continue}}if(E.child!==null){E.child.return=E,E=E.child;continue}}if(E===l)break;for(;E.sibling===null;){if(E.return===null||E.return===l)return;E=E.return}E.sibling.return=E.return,E=E.sibling}};No=function(o){var l=o.stateNode;if(o.firstEffect!==null){var d=l.containerInfo,y=mo(d);tf(y,o,!1,!1),l.pendingChildren=y,yi(o),nr(d,y)}},wu=function(o,l,d,y,E){var C=o.stateNode,N=o.memoizedProps;if((o=l.firstEffect===null)&&N===y)l.stateNode=C;else{var B=l.stateNode,te=fn(Ft.current),we=null;N!==y&&(we=Xt(B,d,N,y,E,te)),o&&we===null?l.stateNode=C:(C=Ea(C,we,d,N,y,l,o,B),gn(C,d,y,E,te)&&yi(l),l.stateNode=C,o?yi(l):Io(C,l,!1,!1))}},Cu=function(o,l,d,y){d!==y?(o=fn(ss.current),d=fn(Ft.current),l.stateNode=Be(y,o,d,l),yi(l)):l.stateNode=o.stateNode}}else No=function(){},wu=function(){},Cu=function(){};function zo(o,l){if(!Oi)switch(o.tailMode){case"hidden":l=o.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?o.tail=null:d.sibling=null;break;case"collapsed":d=o.tail;for(var y=null;d!==null;)d.alternate!==null&&(y=d),d=d.sibling;y===null?l||o.tail===null?o.tail=null:o.tail.sibling=null:y.sibling=null}}function dh(o,l,d){var y=l.pendingProps;switch(l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:return tn(l.type)&&Ql(),null;case 3:return ri(),vt(qn),vt(cn),hu(),y=l.stateNode,y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(o===null||o.child===null)&&(To(l)?yi(l):y.hydrate||(l.flags|=256)),No(l),null;case 5:as(l);var E=fn(ss.current);if(d=l.type,o!==null&&l.stateNode!=null)wu(o,l,d,y,E),o.ref!==l.ref&&(l.flags|=128);else{if(!y){if(l.stateNode===null)throw Error(p(166));return null}if(o=fn(Ft.current),To(l)){if(!Kt)throw Error(p(175));o=Te(l.stateNode,l.type,l.memoizedProps,E,o,l),l.updateQueue=o,o!==null&&yi(l)}else{var C=ht(d,y,E,o,l);Io(C,l,!1,!1),l.stateNode=C,gn(C,d,y,E,o)&&yi(l)}l.ref!==null&&(l.flags|=128)}return null;case 6:if(o&&l.stateNode!=null)Cu(o,l,o.memoizedProps,y);else{if(typeof y!="string"&&l.stateNode===null)throw Error(p(166));if(o=fn(ss.current),E=fn(Ft.current),To(l)){if(!Kt)throw Error(p(176));Ke(l.stateNode,l.memoizedProps,l)&&yi(l)}else l.stateNode=Be(y,o,E,l)}return null;case 13:return vt(an),y=l.memoizedState,l.flags&64?(l.lanes=d,l):(y=y!==null,E=!1,o===null?l.memoizedProps.fallback!==void 0&&To(l):E=o.memoizedState!==null,y&&!E&&l.mode&2&&(o===null&&l.memoizedProps.unstable_avoidThisFallback!==!0||an.current&1?kn===0&&(kn=3):((kn===0||kn===3)&&(kn=4),Xn===null||!(qo&134217727)&&!(Da&134217727)||Ws(Xn,Nt))),yn&&y&&(l.flags|=4),wt&&(y||E)&&(l.flags|=4),null);case 4:return ri(),No(l),o===null&&ut(l.stateNode.containerInfo),null;case 10:return su(l),null;case 17:return tn(l.type)&&Ql(),null;case 19:if(vt(an),y=l.memoizedState,y===null)return null;if(E=(l.flags&64)!==0,C=y.rendering,C===null)if(E)zo(y,!1);else{if(kn!==0||o!==null&&o.flags&64)for(o=l.child;o!==null;){if(C=Ir(o),C!==null){for(l.flags|=64,zo(y,!1),o=C.updateQueue,o!==null&&(l.updateQueue=o,l.flags|=4),y.lastEffect===null&&(l.firstEffect=null),l.lastEffect=y.lastEffect,o=d,y=l.child;y!==null;)E=y,d=o,E.flags&=2,E.nextEffect=null,E.firstEffect=null,E.lastEffect=null,C=E.alternate,C===null?(E.childLanes=0,E.lanes=d,E.child=null,E.memoizedProps=null,E.memoizedState=null,E.updateQueue=null,E.dependencies=null,E.stateNode=null):(E.childLanes=C.childLanes,E.lanes=C.lanes,E.child=C.child,E.memoizedProps=C.memoizedProps,E.memoizedState=C.memoizedState,E.updateQueue=C.updateQueue,E.type=C.type,d=C.dependencies,E.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext}),y=y.sibling;return un(an,an.current&1|2),l.child}o=o.sibling}y.tail!==null&&Dn()>Pu&&(l.flags|=64,E=!0,zo(y,!1),l.lanes=33554432)}else{if(!E)if(o=Ir(C),o!==null){if(l.flags|=64,E=!0,o=o.updateQueue,o!==null&&(l.updateQueue=o,l.flags|=4),zo(y,!0),y.tail===null&&y.tailMode==="hidden"&&!C.alternate&&!Oi)return l=l.lastEffect=y.lastEffect,l!==null&&(l.nextEffect=null),null}else 2*Dn()-y.renderingStartTime>Pu&&d!==1073741824&&(l.flags|=64,E=!0,zo(y,!1),l.lanes=33554432);y.isBackwards?(C.sibling=l.child,l.child=C):(o=y.last,o!==null?o.sibling=C:l.child=C,y.last=C)}return y.tail!==null?(o=y.tail,y.rendering=o,y.tail=o.sibling,y.lastEffect=l.lastEffect,y.renderingStartTime=Dn(),o.sibling=null,l=an.current,un(an,E?l&1|2:l&1),o):null;case 23:case 24:return wn(),o!==null&&o.memoizedState!==null!=(l.memoizedState!==null)&&y.mode!=="unstable-defer-without-hiding"&&(l.flags|=4),null}throw Error(p(156,l.tag))}function hh(o){switch(o.tag){case 1:tn(o.type)&&Ql();var l=o.flags;return l&4096?(o.flags=l&-4097|64,o):null;case 3:if(ri(),vt(qn),vt(cn),hu(),l=o.flags,l&64)throw Error(p(285));return o.flags=l&-4097|64,o;case 5:return as(o),null;case 13:return vt(an),l=o.flags,l&4096?(o.flags=l&-4097|64,o):null;case 19:return vt(an),null;case 4:return ri(),null;case 10:return su(o),null;case 23:case 24:return wn(),null;default:return null}}function nf(o,l){try{var d="",y=l;do d+=Cm(y),y=y.return;while(y);var E=d}catch(C){E=`
|
|
206
|
-
Error generating stack: `+
|
|
207
|
-
`+C.stack}return{value:o,source:l,stack:E}}function La(o,l){try{console.error(l.value)}catch(d){setTimeout(function(){throw d})}}var Tm=typeof WeakMap=="function"?WeakMap:Map;function ph(o,l,d){d=yr(-1,d),d.tag=3,d.payload={element:null};var y=l.value;return d.callback=function(){Qo||(Qo=!0,lr=y),La(o,l)},d}function vh(o,l,d){d=yr(-1,d),d.tag=3;var y=o.type.getDerivedStateFromError;if(typeof y=="function"){var E=l.value;d.payload=function(){return La(o,l),y(E)}}var C=o.stateNode;return C!==null&&typeof C.componentDidCatch=="function"&&(d.callback=function(){typeof y!="function"&&(Vn===null?Vn=new Set([this]):Vn.add(this),La(o,l));var N=l.stack;this.componentDidCatch(l.value,{componentStack:N!==null?N:""})}),d}var Rm=typeof WeakSet=="function"?WeakSet:Set;function mh(o){var l=o.ref;if(l!==null)if(typeof l=="function")try{l(null)}catch(d){fr(o,d)}else l.current=null}function oi(o,l){switch(l.tag){case 0:case 11:case 15:case 22:return;case 1:if(l.flags&256&&o!==null){var d=o.memoizedProps,y=o.memoizedState;o=l.stateNode,l=o.getSnapshotBeforeUpdate(l.elementType===l.type?d:rr(l.type,d),y),o.__reactInternalSnapshotBeforeUpdate=l}return;case 3:wt&&l.flags&256&&Ai(l.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(p(163))}function cs(o,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var d=l=l.next;do{if((d.tag&o)===o){var y=d.destroy;d.destroy=void 0,y!==void 0&&y()}d=d.next}while(d!==l)}}function Am(o,l,d){switch(d.tag){case 0:case 11:case 15:case 22:if(l=d.updateQueue,l=l!==null?l.lastEffect:null,l!==null){o=l=l.next;do{if((o.tag&3)===3){var y=o.create;o.destroy=y()}o=o.next}while(o!==l)}if(l=d.updateQueue,l=l!==null?l.lastEffect:null,l!==null){o=l=l.next;do{var E=o;y=E.next,E=E.tag,E&4&&E&1&&(cf(d,o),Iu(d,o)),o=y}while(o!==l)}return;case 1:o=d.stateNode,d.flags&4&&(l===null?o.componentDidMount():(y=d.elementType===d.type?l.memoizedProps:rr(d.type,l.memoizedProps),o.componentDidUpdate(y,l.memoizedState,o.__reactInternalSnapshotBeforeUpdate))),l=d.updateQueue,l!==null&&xo(d,l,o);return;case 3:if(l=d.updateQueue,l!==null){if(o=null,d.child!==null)switch(d.child.tag){case 5:o=tt(d.child.stateNode);break;case 1:o=d.child.stateNode}xo(d,l,o)}return;case 5:o=d.stateNode,l===null&&d.flags&4&&Dt(o,d.type,d.memoizedProps,d);return;case 6:return;case 4:return;case 12:return;case 13:Kt&&d.memoizedState===null&&(d=d.alternate,d!==null&&(d=d.memoizedState,d!==null&&(d=d.dehydrated,d!==null&&pt(d))));return;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(p(163))}function Hn(o,l){if(wt)for(var d=o;;){if(d.tag===5){var y=d.stateNode;l?es(y):vo(d.stateNode,d.memoizedProps)}else if(d.tag===6)y=d.stateNode,l?po(y):ts(y,d.memoizedProps);else if((d.tag!==23&&d.tag!==24||d.memoizedState===null||d===o)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===o)break;for(;d.sibling===null;){if(d.return===null||d.return===o)return;d=d.return}d.sibling.return=d.return,d=d.sibling}}function fs(o,l){if(Bi&&typeof Bi.onCommitFiberUnmount=="function")try{Bi.onCommitFiberUnmount(kc,l)}catch{}switch(l.tag){case 0:case 11:case 14:case 15:case 22:if(o=l.updateQueue,o!==null&&(o=o.lastEffect,o!==null)){var d=o=o.next;do{var y=d,E=y.destroy;if(y=y.tag,E!==void 0)if(y&4)cf(l,d);else{y=l;try{E()}catch(C){fr(y,C)}}d=d.next}while(d!==o)}break;case 1:if(mh(l),o=l.stateNode,typeof o.componentWillUnmount=="function")try{o.props=l.memoizedProps,o.state=l.memoizedState,o.componentWillUnmount()}catch(C){fr(l,C)}break;case 5:mh(l);break;case 4:wt?yh(o,l):yn&&yn&&(l=l.stateNode.containerInfo,o=mo(l),$l(l,o))}}function At(o,l){for(var d=l;;)if(fs(o,d),d.child===null||wt&&d.tag===4){if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return;d=d.return}d.sibling.return=d.return,d=d.sibling}else d.child.return=d,d=d.child}function Uo(o){o.alternate=null,o.child=null,o.dependencies=null,o.firstEffect=null,o.lastEffect=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.return=null,o.updateQueue=null}function Mm(o){return o.tag===5||o.tag===3||o.tag===4}function gh(o){if(wt){e:{for(var l=o.return;l!==null;){if(Mm(l))break e;l=l.return}throw Error(p(160))}var d=l;switch(l=d.stateNode,d.tag){case 5:var y=!1;break;case 3:l=l.containerInfo,y=!0;break;case 4:l=l.containerInfo,y=!0;break;default:throw Error(p(161))}d.flags&16&&(Ri(l),d.flags&=-17);e:t:for(d=o;;){for(;d.sibling===null;){if(d.return===null||Mm(d.return)){d=null;break e}d=d.return}for(d.sibling.return=d.return,d=d.sibling;d.tag!==5&&d.tag!==6&&d.tag!==18;){if(d.flags&2||d.child===null||d.tag===4)continue t;d.child.return=d,d=d.child}if(!(d.flags&2)){d=d.stateNode;break e}}y?jo(o,d,l):Pa(o,d,l)}}function jo(o,l,d){var y=o.tag,E=y===5||y===6;if(E)o=E?o.stateNode:o.stateNode.instance,l?en(d,o,l):De(d,o);else if(y!==4&&(o=o.child,o!==null))for(jo(o,l,d),o=o.sibling;o!==null;)jo(o,l,d),o=o.sibling}function Pa(o,l,d){var y=o.tag,E=y===5||y===6;if(E)o=E?o.stateNode:o.stateNode.instance,l?ln(d,o,l):Re(d,o);else if(y!==4&&(o=o.child,o!==null))for(Pa(o,l,d),o=o.sibling;o!==null;)Pa(o,l,d),o=o.sibling}function yh(o,l){for(var d=l,y=!1,E,C;;){if(!y){y=d.return;e:for(;;){if(y===null)throw Error(p(160));switch(E=y.stateNode,y.tag){case 5:C=!1;break e;case 3:E=E.containerInfo,C=!0;break e;case 4:E=E.containerInfo,C=!0;break e}y=y.return}y=!0}if(d.tag===5||d.tag===6)At(o,d),C?sn(E,d.stateNode):Wn(E,d.stateNode);else if(d.tag===4){if(d.child!==null){E=d.stateNode.containerInfo,C=!0,d.child.return=d,d=d.child;continue}}else if(fs(o,d),d.child!==null){d.child.return=d,d=d.child;continue}if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return;d=d.return,d.tag===4&&(y=!1)}d.sibling.return=d.return,d=d.sibling}}function Tu(o,l){if(wt){switch(l.tag){case 0:case 11:case 14:case 15:case 22:cs(3,l);return;case 1:return;case 5:var d=l.stateNode;if(d!=null){var y=l.memoizedProps;o=o!==null?o.memoizedProps:y;var E=l.type,C=l.updateQueue;l.updateQueue=null,C!==null&&rt(d,C,E,o,y,l)}return;case 6:if(l.stateNode===null)throw Error(p(162));d=l.memoizedProps,at(l.stateNode,o!==null?o.memoizedProps:d,d);return;case 3:Kt&&(l=l.stateNode,l.hydrate&&(l.hydrate=!1,Ot(l.containerInfo)));return;case 12:return;case 13:Sh(l),Ru(l);return;case 19:Ru(l);return;case 17:return;case 23:case 24:Hn(l,l.memoizedState!==null);return}throw Error(p(163))}switch(l.tag){case 0:case 11:case 14:case 15:case 22:cs(3,l);return;case 12:return;case 13:Sh(l),Ru(l);return;case 19:Ru(l);return;case 3:Kt&&(d=l.stateNode,d.hydrate&&(d.hydrate=!1,Ot(d.containerInfo)));break;case 23:case 24:return}e:if(yn){switch(l.tag){case 1:case 5:case 6:case 20:break e;case 3:case 4:l=l.stateNode,$l(l.containerInfo,l.pendingChildren);break e}throw Error(p(163))}}function Sh(o){o.memoizedState!==null&&(Yo=Dn(),wt&&Hn(o.child,!0))}function Ru(o){var l=o.updateQueue;if(l!==null){o.updateQueue=null;var d=o.stateNode;d===null&&(d=o.stateNode=new Rm),l.forEach(function(y){var E=Nu.bind(null,o,y);d.has(y)||(d.add(y),y.then(E,E))})}}function Om(o,l){return o!==null&&(o=o.memoizedState,o===null||o.dehydrated!==null)?(l=l.memoizedState,l!==null&&l.dehydrated===null):!1}var Fo=0,Au=1,Mu=2,Bo=3,Ou=4;if(typeof Symbol=="function"&&Symbol.for){var Ho=Symbol.for;Fo=Ho("selector.component"),Au=Ho("selector.has_pseudo_class"),Mu=Ho("selector.role"),Bo=Ho("selector.test_id"),Ou=Ho("selector.text")}function rf(o){var l=tr(o);if(l!=null){if(typeof l.memoizedProps["data-testname"]!="string")throw Error(p(364));return l}if(o=Sn(o),o===null)throw Error(p(362));return o.stateNode.current}function sf(o,l){switch(l.$$typeof){case Fo:if(o.type===l.value)return!0;break;case Au:e:{l=l.value,o=[o,0];for(var d=0;d<o.length;){var y=o[d++],E=o[d++],C=l[E];if(y.tag!==5||!ct(y)){for(;C!=null&&sf(y,C);)E++,C=l[E];if(E===l.length){l=!0;break e}else for(y=y.child;y!==null;)o.push(y,E),y=y.sibling}}l=!1}return l;case Mu:if(o.tag===5&&pi(o.stateNode,l.value))return!0;break;case Ou:if((o.tag===5||o.tag===6)&&(o=xe(o),o!==null&&0<=o.indexOf(l.value)))return!0;break;case Bo:if(o.tag===5&&(o=o.memoizedProps["data-testname"],typeof o=="string"&&o.toLowerCase()===l.value.toLowerCase()))return!0;break;default:throw Error(p(365,l))}return!1}function Vo(o){switch(o.$$typeof){case Fo:return"<"+(be(o.value)||"Unknown")+">";case Au:return":has("+(Vo(o)||"")+")";case Mu:return'[role="'+o.value+'"]';case Ou:return'"'+o.value+'"';case Bo:return'[data-testname="'+o.value+'"]';default:throw Error(p(365,o))}}function af(o,l){var d=[];o=[o,0];for(var y=0;y<o.length;){var E=o[y++],C=o[y++],N=l[C];if(E.tag!==5||!ct(E)){for(;N!=null&&sf(E,N);)C++,N=l[C];if(C===l.length)d.push(E);else for(E=E.child;E!==null;)o.push(E,C),E=E.sibling}}return d}function of(o,l){if(!We)throw Error(p(363));o=rf(o),o=af(o,l),l=[],o=Array.from(o);for(var d=0;d<o.length;){var y=o[d++];if(y.tag===5)ct(y)||l.push(y.stateNode);else for(y=y.child;y!==null;)o.push(y),y=y.sibling}return l}var $o=null;function lf(o){if($o===null)try{var l=("require"+Math.random()).slice(0,7);$o=(t&&t[l]).call(t,"timers").setImmediate}catch{$o=function(y){var E=new MessageChannel;E.port1.onmessage=y,E.port2.postMessage(void 0)}}return $o(o)}var _m=Math.ceil,Vs=g.ReactCurrentDispatcher,_u=g.ReactCurrentOwner,Lu=g.IsSomeRendererActing,Qe=0,Xn=null,xn=null,Nt=0,Li=0,Qi=Fi(0),kn=0,Wo=null,ds=0,qo=0,Da=0,or=0,ka=null,Yo=0,Pu=1/0;function nn(){Pu=Dn()+500}var _e=null,Qo=!1,lr=null,Vn=null,hs=!1,Ia=null,Kn=90,Du=[],Yt=[],_t=null,In=0,Fr=null,Zn=-1,Br=0,ku=0,Go=null,Xo=!1;function Si(){return Qe&48?Dn():Zn!==-1?Zn:Zn=Dn()}function An(o){if(o=o.mode,!(o&2))return 1;if(!(o&4))return wa()===99?1:2;if(Br===0&&(Br=ds),Em.transition!==0){ku!==0&&(ku=ka!==null?ka.pendingLanes:0),o=Br;var l=4186112&~ku;return l&=-l,l===0&&(o=4186112&~o,l=o&-o,l===0&&(l=8192)),l}return o=wa(),Qe&4&&o===98?o=Xl(12,Br):(o=hm(o),o=Xl(o,Br)),o}function Hr(o,l,d){if(50<In)throw In=0,Fr=null,Error(p(185));if(o=$s(o,l),o===null)return null;Kl(o,l,d),o===Xn&&(Da|=l,kn===4&&Ws(o,Nt));var y=wa();l===1?Qe&8&&!(Qe&48)?Jn(o):(Pi(o,d),Qe===0&&(nn(),Hi())):(!(Qe&4)||y!==98&&y!==99||(_t===null?_t=new Set([o]):_t.add(o)),Pi(o,d)),ka=o}function $s(o,l){o.lanes|=l;var d=o.alternate;for(d!==null&&(d.lanes|=l),d=o,o=o.return;o!==null;)o.childLanes|=l,d=o.alternate,d!==null&&(d.childLanes|=l),d=o,o=o.return;return d.tag===3?d.stateNode:null}function Pi(o,l){for(var d=o.callbackNode,y=o.suspendedLanes,E=o.pingedLanes,C=o.expirationTimes,N=o.pendingLanes;0<N;){var B=31-is(N),te=1<<B,we=C[B];if(we===-1){if(!(te&y)||te&E){we=l,ir(te);var He=Wt;C[B]=10<=He?we+250:6<=He?we+5e3:-1}}else we<=l&&(o.expiredLanes|=te);N&=~te}if(y=yo(o,o===Xn?Nt:0),l=Wt,y===0)d!==null&&(d!==Zl&&zc(d),o.callbackNode=null,o.callbackPriority=0);else{if(d!==null){if(o.callbackPriority===l)return;d!==Zl&&zc(d)}l===15?(d=Jn.bind(null,o),Lr===null?(Lr=[d],Jl=Nc(bo,ah)):Lr.push(d),d=Zl):l===14?d=Ca(99,Jn.bind(null,o)):(d=pm(l),d=Ca(d,uf.bind(null,o))),o.callbackPriority=l,o.callbackNode=d}}function uf(o){if(Zn=-1,ku=Br=0,Qe&48)throw Error(p(327));var l=o.callbackNode;if(ui()&&o.callbackNode!==l)return null;var d=yo(o,o===Xn?Nt:0);if(d===0)return null;var y=d,E=Qe;Qe|=16;var C=Gi();(Xn!==o||Nt!==y)&&(nn(),li(o,y));do try{Zo();break}catch(B){xh(o,B)}while(!0);if(ru(),Vs.current=C,Qe=E,xn!==null?y=0:(Xn=null,Nt=0,y=kn),ds&Da)li(o,0);else if(y!==0){if(y===2&&(Qe|=64,o.hydrate&&(o.hydrate=!1,Ai(o.containerInfo)),d=th(o),d!==0&&(y=Ko(o,d))),y===1)throw l=Wo,li(o,0),Ws(o,d),Pi(o,Dn()),l;switch(o.finishedWork=o.current.alternate,o.finishedLanes=d,y){case 0:case 1:throw Error(p(345));case 2:ur(o);break;case 3:if(Ws(o,d),(d&62914560)===d&&(y=Yo+500-Dn(),10<y)){if(yo(o,0)!==0)break;if(E=o.suspendedLanes,(E&d)!==d){Si(),o.pingedLanes|=o.suspendedLanes&E;break}o.timeoutHandle=nt(ur.bind(null,o),y);break}ur(o);break;case 4:if(Ws(o,d),(d&4186112)===d)break;for(y=o.eventTimes,E=-1;0<d;){var N=31-is(d);C=1<<N,N=y[N],N>E&&(E=N),d&=~C}if(d=E,d=Dn()-d,d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3e3>d?3e3:4320>d?4320:1960*_m(d/1960))-d,10<d){o.timeoutHandle=nt(ur.bind(null,o),d);break}ur(o);break;case 5:ur(o);break;default:throw Error(p(329))}}return Pi(o,Dn()),o.callbackNode===l?uf.bind(null,o):null}function Ws(o,l){for(l&=~or,l&=~Da,o.suspendedLanes|=l,o.pingedLanes&=~l,o=o.expirationTimes;0<l;){var d=31-is(l),y=1<<d;o[d]=-1,l&=~y}}function Jn(o){if(Qe&48)throw Error(p(327));if(ui(),o===Xn&&o.expiredLanes&Nt){var l=Nt,d=Ko(o,l);ds&Da&&(l=yo(o,l),d=Ko(o,l))}else l=yo(o,0),d=Ko(o,l);if(o.tag!==0&&d===2&&(Qe|=64,o.hydrate&&(o.hydrate=!1,Ai(o.containerInfo)),l=th(o),l!==0&&(d=Ko(o,l))),d===1)throw d=Wo,li(o,0),Ws(o,l),Pi(o,Dn()),d;return o.finishedWork=o.current.alternate,o.finishedLanes=l,ur(o),Pi(o,Dn()),null}function Na(){if(_t!==null){var o=_t;_t=null,o.forEach(function(l){l.expiredLanes|=24&l.pendingLanes,Pi(l,Dn())})}Hi()}function bh(o,l){var d=Qe;Qe|=1;try{return o(l)}finally{Qe=d,Qe===0&&(nn(),Hi())}}function Eh(o,l){var d=Qe;if(d&48)return o(l);Qe|=1;try{if(o)return Pr(99,o.bind(null,l))}finally{Qe=d,Hi()}}function $n(o,l){un(Qi,Li),Li|=l,ds|=l}function wn(){Li=Qi.current,vt(Qi)}function li(o,l){o.finishedWork=null,o.finishedLanes=0;var d=o.timeoutHandle;if(d!==lt&&(o.timeoutHandle=lt,ot(d)),xn!==null)for(d=xn.return;d!==null;){var y=d;switch(y.tag){case 1:y=y.type.childContextTypes,y!=null&&Ql();break;case 3:ri(),vt(qn),vt(cn),hu();break;case 5:as(y);break;case 4:ri();break;case 13:vt(an);break;case 19:vt(an);break;case 10:su(y);break;case 23:case 24:wn()}d=d.return}Xn=o,xn=Ht(o.current,null),Nt=Li=ds=l,kn=0,Wo=null,or=Da=qo=0}function xh(o,l){do{var d=xn;try{if(ru(),Aa.current=Rt,pu){for(var y=qt.memoizedState;y!==null;){var E=y.queue;E!==null&&(E.pending=null),y=y.next}pu=!1}if(mi=0,Bn=Qn=qt=null,Ro=!1,_u.current=null,d===null||d.return===null){kn=1,Wo=l,xn=null;break}e:{var C=o,N=d.return,B=d,te=l;if(l=Nt,B.flags|=2048,B.firstEffect=B.lastEffect=null,te!==null&&typeof te=="object"&&typeof te.then=="function"){var we=te;if(!(B.mode&2)){var He=B.alternate;He?(B.updateQueue=He.updateQueue,B.memoizedState=He.memoizedState,B.lanes=He.lanes):(B.updateQueue=null,B.memoizedState=null)}var Je=(an.current&1)!==0,Me=N;do{var kt;if(kt=Me.tag===13){var Qt=Me.memoizedState;if(Qt!==null)kt=Qt.dehydrated!==null;else{var ki=Me.memoizedProps;kt=ki.fallback===void 0?!1:ki.unstable_avoidThisFallback!==!0?!0:!Je}}if(kt){var Q=Me.updateQueue;if(Q===null){var V=new Set;V.add(we),Me.updateQueue=V}else Q.add(we);if(!(Me.mode&2)){if(Me.flags|=64,B.flags|=16384,B.flags&=-2981,B.tag===1)if(B.alternate===null)B.tag=17;else{var ne=yr(-1,1);ne.tag=2,Sr(B,ne)}B.lanes|=1;break e}te=void 0,B=l;var Ae=C.pingCache;if(Ae===null?(Ae=C.pingCache=new Tm,te=new Set,Ae.set(we,te)):(te=Ae.get(we),te===void 0&&(te=new Set,Ae.set(we,te))),!te.has(B)){te.add(B);var Ve=nl.bind(null,C,we,B);we.then(Ve,Ve)}Me.flags|=4096,Me.lanes=l;break e}Me=Me.return}while(Me!==null);te=Error((be(B.type)||"A React component")+` suspended while rendering, but no fallback UI was specified.
|
|
208
|
-
|
|
209
|
-
Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`)}kn!==5&&(kn=2),te=nf(te,B),Me=N;do{switch(Me.tag){case 3:C=te,Me.flags|=4096,l&=-l,Me.lanes|=l;var It=ph(Me,C,l);kr(Me,It);break e;case 1:C=te;var et=Me.type,Mt=Me.stateNode;if(!(Me.flags&64)&&(typeof et.getDerivedStateFromError=="function"||Mt!==null&&typeof Mt.componentDidCatch=="function"&&(Vn===null||!Vn.has(Mt)))){Me.flags|=4096,l&=-l,Me.lanes|=l;var Cn=vh(Me,C,l);kr(Me,Cn);break e}}Me=Me.return}while(Me!==null)}Ua(d)}catch(St){l=St,xn===d&&d!==null&&(xn=d=d.return);continue}break}while(!0)}function Gi(){var o=Vs.current;return Vs.current=Rt,o===null?Rt:o}function Ko(o,l){var d=Qe;Qe|=16;var y=Gi();Xn===o&&Nt===l||li(o,l);do try{qs();break}catch(E){xh(o,E)}while(!0);if(ru(),Qe=d,Vs.current=y,xn!==null)throw Error(p(261));return Xn=null,Nt=0,kn}function qs(){for(;xn!==null;)za(xn)}function Zo(){for(;xn!==null&&!ym();)za(xn)}function za(o){var l=Ys(o.alternate,o,Li);o.memoizedProps=o.pendingProps,l===null?Ua(o):xn=l,_u.current=null}function Ua(o){var l=o;do{var d=l.alternate;if(o=l.return,l.flags&2048){if(d=hh(l),d!==null){d.flags&=2047,xn=d;return}o!==null&&(o.firstEffect=o.lastEffect=null,o.flags|=2048)}else{if(d=dh(d,l,Li),d!==null){xn=d;return}if(d=l,d.tag!==24&&d.tag!==23||d.memoizedState===null||Li&1073741824||!(d.mode&4)){for(var y=0,E=d.child;E!==null;)y|=E.lanes|E.childLanes,E=E.sibling;d.childLanes=y}o!==null&&!(o.flags&2048)&&(o.firstEffect===null&&(o.firstEffect=l.firstEffect),l.lastEffect!==null&&(o.lastEffect!==null&&(o.lastEffect.nextEffect=l.firstEffect),o.lastEffect=l.lastEffect),1<l.flags&&(o.lastEffect!==null?o.lastEffect.nextEffect=l:o.firstEffect=l,o.lastEffect=l))}if(l=l.sibling,l!==null){xn=l;return}xn=l=o}while(l!==null);kn===0&&(kn=5)}function ur(o){var l=wa();return Pr(99,Jo.bind(null,o,l)),null}function Jo(o,l){do ui();while(Ia!==null);if(Qe&48)throw Error(p(327));var d=o.finishedWork;if(d===null)return null;if(o.finishedWork=null,o.finishedLanes=0,d===o.current)throw Error(p(177));o.callbackNode=null;var y=d.lanes|d.childLanes,E=y,C=o.pendingLanes&~E;o.pendingLanes=E,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=E,o.mutableReadLanes&=E,o.entangledLanes&=E,E=o.entanglements;for(var N=o.eventTimes,B=o.expirationTimes;0<C;){var te=31-is(C),we=1<<te;E[te]=0,N[te]=-1,B[te]=-1,C&=~we}if(_t!==null&&!(y&24)&&_t.has(o)&&_t.delete(o),o===Xn&&(xn=Xn=null,Nt=0),1<d.flags?d.lastEffect!==null?(d.lastEffect.nextEffect=d,y=d.firstEffect):y=d:y=d.firstEffect,y!==null){E=Qe,Qe|=32,_u.current=null,Go=Fe(o.containerInfo),Xo=!1,_e=y;do try{el()}catch(V){if(_e===null)throw Error(p(330));fr(_e,V),_e=_e.nextEffect}while(_e!==null);Go=null,_e=y;do try{for(N=o;_e!==null;){var He=_e.flags;if(He&16&&wt&&Ri(_e.stateNode),He&128){var Je=_e.alternate;if(Je!==null){var Me=Je.ref;Me!==null&&(typeof Me=="function"?Me(null):Me.current=null)}}switch(He&1038){case 2:gh(_e),_e.flags&=-3;break;case 6:gh(_e),_e.flags&=-3,Tu(_e.alternate,_e);break;case 1024:_e.flags&=-1025;break;case 1028:_e.flags&=-1025,Tu(_e.alternate,_e);break;case 4:Tu(_e.alternate,_e);break;case 8:B=N,C=_e,wt?yh(B,C):At(B,C);var kt=C.alternate;Uo(C),kt!==null&&Uo(kt)}_e=_e.nextEffect}}catch(V){if(_e===null)throw Error(p(330));fr(_e,V),_e=_e.nextEffect}while(_e!==null);Xo&&Se(),$e(o.containerInfo),o.current=d,_e=y;do try{for(He=o;_e!==null;){var Qt=_e.flags;if(Qt&36&&Am(He,_e.alternate,_e),Qt&128){Je=void 0;var ki=_e.ref;if(ki!==null){var Q=_e.stateNode;switch(_e.tag){case 5:Je=tt(Q);break;default:Je=Q}typeof ki=="function"?ki(Je):ki.current=Je}}_e=_e.nextEffect}}catch(V){if(_e===null)throw Error(p(330));fr(_e,V),_e=_e.nextEffect}while(_e!==null);_e=null,bm(),Qe=E}else o.current=d;if(hs)hs=!1,Ia=o,Kn=l;else for(_e=y;_e!==null;)l=_e.nextEffect,_e.nextEffect=null,_e.flags&8&&(Qt=_e,Qt.sibling=null,Qt.stateNode=null),_e=l;if(y=o.pendingLanes,y===0&&(Vn=null),y===1?o===Fr?In++:(In=0,Fr=o):In=0,d=d.stateNode,Bi&&typeof Bi.onCommitFiberRoot=="function")try{Bi.onCommitFiberRoot(kc,d,void 0,(d.current.flags&64)===64)}catch{}if(Pi(o,Dn()),Qo)throw Qo=!1,o=lr,lr=null,o;return Qe&8||Hi(),null}function el(){for(;_e!==null;){var o=_e.alternate;Xo||Go===null||(_e.flags&8?me(_e,Go)&&(Xo=!0,G()):_e.tag===13&&Om(o,_e)&&me(_e,Go)&&(Xo=!0,G()));var l=_e.flags;l&256&&oi(o,_e),!(l&512)||hs||(hs=!0,Ca(97,function(){return ui(),null})),_e=_e.nextEffect}}function ui(){if(Kn!==90){var o=97<Kn?97:Kn;return Kn=90,Pr(o,cr)}return!1}function Iu(o,l){Du.push(l,o),hs||(hs=!0,Ca(97,function(){return ui(),null}))}function cf(o,l){Yt.push(l,o),hs||(hs=!0,Ca(97,function(){return ui(),null}))}function cr(){if(Ia===null)return!1;var o=Ia;if(Ia=null,Qe&48)throw Error(p(331));var l=Qe;Qe|=32;var d=Yt;Yt=[];for(var y=0;y<d.length;y+=2){var E=d[y],C=d[y+1],N=E.destroy;if(E.destroy=void 0,typeof N=="function")try{N()}catch(te){if(C===null)throw Error(p(330));fr(C,te)}}for(d=Du,Du=[],y=0;y<d.length;y+=2){E=d[y],C=d[y+1];try{var B=E.create;E.destroy=B()}catch(te){if(C===null)throw Error(p(330));fr(C,te)}}for(B=o.current.firstEffect;B!==null;)o=B.nextEffect,B.nextEffect=null,B.flags&8&&(B.sibling=null,B.stateNode=null),B=o;return Qe=l,Hi(),!0}function tl(o,l,d){l=nf(d,l),l=ph(o,l,1),Sr(o,l),l=Si(),o=$s(o,1),o!==null&&(Kl(o,1,l),Pi(o,l))}function fr(o,l){if(o.tag===3)tl(o,o,l);else for(var d=o.return;d!==null;){if(d.tag===3){tl(d,o,l);break}else if(d.tag===1){var y=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(Vn===null||!Vn.has(y))){o=nf(l,o);var E=vh(d,o,1);if(Sr(d,E),E=Si(),d=$s(d,1),d!==null)Kl(d,1,E),Pi(d,E);else if(typeof y.componentDidCatch=="function"&&(Vn===null||!Vn.has(y)))try{y.componentDidCatch(l,o)}catch{}break}}d=d.return}}function nl(o,l,d){var y=o.pingCache;y!==null&&y.delete(l),l=Si(),o.pingedLanes|=o.suspendedLanes&d,Xn===o&&(Nt&d)===d&&(kn===4||kn===3&&(Nt&62914560)===Nt&&500>Dn()-Yo?li(o,0):or|=d),Pi(o,l)}function Nu(o,l){var d=o.stateNode;d!==null&&d.delete(l),l=0,l===0&&(l=o.mode,l&2?l&4?(Br===0&&(Br=ds),l=xa(62914560&~Br),l===0&&(l=4194304)):l=wa()===99?1:2:l=1),d=Si(),o=$s(o,l),o!==null&&(Kl(o,l,d),Pi(o,d))}var Ys;Ys=function(o,l,d){var y=l.lanes;if(o!==null)if(o.memoizedProps!==l.pendingProps||qn.current)Yi=!0;else if(d&y)Yi=!!(o.flags&16384);else{switch(Yi=!1,l.tag){case 3:xu(l),Wc();break;case 5:cu(l);break;case 1:tn(l.type)&&go(l);break;case 4:ar(l,l.stateNode.containerInfo);break;case 10:Hc(l,l.memoizedProps.value);break;case 13:if(l.memoizedState!==null)return d&l.child.childLanes?on(o,l,d):(un(an,an.current&1),l=jr(o,l,d),l!==null?l.sibling:null);un(an,an.current&1);break;case 19:if(y=(d&l.childLanes)!==0,o.flags&64){if(y)return fh(o,l,d);l.flags|=64}var E=l.memoizedState;if(E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),un(an,an.current),y)break;return null;case 23:case 24:return l.lanes=0,_a(o,l,d)}return jr(o,l,d)}else Yi=!1;switch(l.lanes=0,l.tag){case 2:if(y=l.type,o!==null&&(o.alternate=null,l.alternate=null,l.flags|=2),o=l.pendingProps,E=mr(l,cn.current),Is(l,d),E=vu(null,l,y,o,E,d),l.flags|=1,typeof E=="object"&&E!==null&&typeof E.render=="function"&&E.$$typeof===void 0){if(l.tag=1,l.memoizedState=null,l.updateQueue=null,tn(y)){var C=!0;go(l)}else C=!1;l.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,$i(l);var N=y.getDerivedStateFromProps;typeof N=="function"&&Ta(l,y,N,o),E.updater=au,l.stateNode=E,E._reactInternals=l,lu(l,y,o,d),l=Eu(null,l,y,!0,C,d)}else l.tag=0,ai(null,l,E,d),l=l.child;return l;case 16:E=l.elementType;e:{switch(o!==null&&(o.alternate=null,l.alternate=null,l.flags|=2),o=l.pendingProps,C=E._init,E=C(E._payload),l.type=E,C=l.tag=Fa(E),o=rr(E,o),C){case 0:l=ko(null,l,E,o,d);break e;case 1:l=Kc(null,l,E,o,d);break e;case 11:l=bu(null,l,E,o,d);break e;case 14:l=Xc(null,l,E,rr(E.type,o),y,d);break e}throw Error(p(306,E,""))}return l;case 0:return y=l.type,E=l.pendingProps,E=l.elementType===y?E:rr(y,E),ko(o,l,y,E,d);case 1:return y=l.type,E=l.pendingProps,E=l.elementType===y?E:rr(y,E),Kc(o,l,y,E,d);case 3:if(xu(l),y=l.updateQueue,o===null||y===null)throw Error(p(282));if(y=l.pendingProps,E=l.memoizedState,E=E!==null?E.element:null,sr(o,l),Ns(l,y,null,d),y=l.memoizedState.element,y===E)Wc(),l=jr(o,l,d);else{if(E=l.stateNode,(C=E.hydrate)&&(Kt?(Yn=de(l.stateNode.containerInfo),qi=l,C=Oi=!0):C=!1),C){if(Kt&&(o=E.mutableSourceEagerHydrationData,o!=null))for(E=0;E<o.length;E+=2)C=o[E],N=o[E+1],Et?C._workInProgressVersionPrimary=N:C._workInProgressVersionSecondary=N,Us.push(C);for(d=br(l,null,y,d),l.child=d;d;)d.flags=d.flags&-3|1024,d=d.sibling}else ai(o,l,y,d),Wc();l=l.child}return l;case 5:return cu(l),o===null&&du(l),y=l.type,E=l.pendingProps,C=o!==null?o.memoizedProps:null,N=E.children,yt(y,E)?N=null:C!==null&&yt(y,C)&&(l.flags|=16),Hs(o,l),ai(o,l,N,d),l.child;case 6:return o===null&&du(l),null;case 13:return on(o,l,d);case 4:return ar(l,l.stateNode.containerInfo),y=l.pendingProps,o===null?l.child=zs(l,null,y,d):ai(o,l,y,d),l.child;case 11:return y=l.type,E=l.pendingProps,E=l.elementType===y?E:rr(y,E),bu(o,l,y,E,d);case 7:return ai(o,l,l.pendingProps,d),l.child;case 8:return ai(o,l,l.pendingProps.children,d),l.child;case 12:return ai(o,l,l.pendingProps.children,d),l.child;case 10:e:{if(y=l.type._context,E=l.pendingProps,N=l.memoizedProps,C=E.value,Hc(l,C),N!==null){var B=N.value;if(C=Vi(B,C)?0:(typeof y._calculateChangedBits=="function"?y._calculateChangedBits(B,C):1073741823)|0,C===0){if(N.children===E.children&&!qn.current){l=jr(o,l,d);break e}}else for(B=l.child,B!==null&&(B.return=l);B!==null;){var te=B.dependencies;if(te!==null){N=B.child;for(var we=te.firstContext;we!==null;){if(we.context===y&&we.observedBits&C){B.tag===1&&(we=yr(-1,d&-d),we.tag=2,Sr(B,we)),B.lanes|=d,we=B.alternate,we!==null&&(we.lanes|=d),Vc(B.return,d),te.lanes|=d;break}we=we.next}}else N=B.tag===10&&B.type===l.type?null:B.child;if(N!==null)N.return=B;else for(N=B;N!==null;){if(N===l){N=null;break}if(B=N.sibling,B!==null){B.return=N.return,N=B;break}N=N.return}B=N}}ai(o,l,E.children,d),l=l.child}return l;case 9:return E=l.type,C=l.pendingProps,y=C.children,Is(l,d),E=Mi(E,C.unstable_observedBits),y=y(E),l.flags|=1,ai(o,l,y,d),l.child;case 14:return E=l.type,C=rr(E,l.pendingProps),C=rr(E.type,C),Xc(o,l,E,C,y,d);case 15:return Bs(o,l,l.type,l.pendingProps,y,d);case 17:return y=l.type,E=l.pendingProps,E=l.elementType===y?E:rr(y,E),o!==null&&(o.alternate=null,l.alternate=null,l.flags|=2),l.tag=1,tn(y)?(o=!0,go(l)):o=!1,Is(l,d),lh(l,y,E),lu(l,y,E,d),Eu(null,l,y,!0,o,d);case 19:return fh(o,l,d);case 23:return _a(o,l,d);case 24:return _a(o,l,d)}throw Error(p(156,l.tag))};var Qs={current:!1},ja=f.unstable_flushAllWithoutAsserting,il=typeof ja=="function";function zu(){if(ja!==void 0)return ja();for(var o=!1;ui();)o=!0;return o}function ff(o){try{zu(),lf(function(){zu()?ff(o):o()})}catch(l){o(l)}}var rl=0,Uu=!1;function Lm(o,l,d,y){this.tag=o,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function Di(o,l,d,y){return new Lm(o,l,d,y)}function df(o){return o=o.prototype,!(!o||!o.isReactComponent)}function Fa(o){if(typeof o=="function")return df(o)?1:0;if(o!=null){if(o=o.$$typeof,o===L)return 11;if(o===j)return 14}return 2}function Ht(o,l){var d=o.alternate;return d===null?(d=Di(o.tag,l,o.key,o.mode),d.elementType=o.elementType,d.type=o.type,d.stateNode=o.stateNode,d.alternate=o,o.alternate=d):(d.pendingProps=l,d.type=o.type,d.flags=0,d.nextEffect=null,d.firstEffect=null,d.lastEffect=null),d.childLanes=o.childLanes,d.lanes=o.lanes,d.child=o.child,d.memoizedProps=o.memoizedProps,d.memoizedState=o.memoizedState,d.updateQueue=o.updateQueue,l=o.dependencies,d.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},d.sibling=o.sibling,d.index=o.index,d.ref=o.ref,d}function sl(o,l,d,y,E,C){var N=2;if(y=o,typeof o=="function")df(o)&&(N=1);else if(typeof o=="string")N=5;else e:switch(o){case x:return Gs(d.children,E,C,l);case H:N=8,E|=16;break;case R:N=8,E|=1;break;case _:return o=Di(12,d,l,E|8),o.elementType=_,o.type=_,o.lanes=C,o;case P:return o=Di(13,d,l,E),o.type=P,o.elementType=P,o.lanes=C,o;case O:return o=Di(19,d,l,E),o.elementType=O,o.lanes=C,o;case Z:return Ba(d,E,C,l);case ie:return o=Di(24,d,l,E),o.elementType=ie,o.lanes=C,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case M:N=10;break e;case k:N=9;break e;case L:N=11;break e;case j:N=14;break e;case q:N=16,y=null;break e;case ee:N=22;break e}throw Error(p(130,o==null?o:typeof o,""))}return l=Di(N,d,l,E),l.elementType=o,l.type=y,l.lanes=C,l}function Gs(o,l,d,y){return o=Di(7,o,y,l),o.lanes=d,o}function Ba(o,l,d,y){return o=Di(23,o,y,l),o.elementType=Z,o.lanes=d,o}function al(o,l,d){return o=Di(6,o,null,l),o.lanes=d,o}function Ha(o,l,d){return l=Di(4,o.children!==null?o.children:[],o.key,l),l.lanes=d,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}function hf(o,l,d){this.tag=l,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=lt,this.pendingContext=this.context=null,this.hydrate=d,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=Ic(0),this.expirationTimes=Ic(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ic(0),Kt&&(this.mutableSourceEagerHydrationData=null)}function ol(o){var l=o._reactInternals;if(l===void 0)throw typeof o.render=="function"?Error(p(188)):Error(p(268,Object.keys(o)));return o=Xe(l),o===null?null:o.stateNode}function ju(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var d=o.retryLane;o.retryLane=d!==0&&d<l?d:l}}function ll(o,l){ju(o,l),(o=o.alternate)&&ju(o,l)}function ps(o){return o=Xe(o),o===null?null:o.stateNode}function vs(){return null}return i.IsThisRendererActing=Qs,i.act=function(o){function l(){rl--,Lu.current=d,Qs.current=y}Uu===!1&&(Uu=!0,console.error("act(...) is not supported in production builds of React, and might not behave as expected.")),rl++;var d=Lu.current,y=Qs.current;Lu.current=!0,Qs.current=!0;try{var E=bh(o)}catch(C){throw l(),C}if(E!==null&&typeof E=="object"&&typeof E.then=="function")return{then:function(C,N){E.then(function(){1<rl||il===!0&&d===!0?(l(),C()):ff(function(B){l(),B?N(B):C()})},function(B){l(),N(B)})}};try{rl!==1||il!==!1&&d!==!1||zu(),l()}catch(C){throw l(),C}return{then:function(C){C()}}},i.attemptContinuousHydration=function(o){if(o.tag===13){var l=Si();Hr(o,67108864,l),ll(o,67108864)}},i.attemptHydrationAtCurrentPriority=function(o){if(o.tag===13){var l=Si(),d=An(o);Hr(o,d,l),ll(o,d)}},i.attemptSynchronousHydration=function(o){switch(o.tag){case 3:var l=o.stateNode;if(l.hydrate){var d=ir(l.pendingLanes);l.expiredLanes|=d&l.pendingLanes,Pi(l,Dn()),!(Qe&48)&&(nn(),Hi())}break;case 13:var y=Si();Eh(function(){return Hr(o,1,y)}),ll(o,4)}},i.attemptUserBlockingHydration=function(o){if(o.tag===13){var l=Si();Hr(o,4,l),ll(o,4)}},i.batchedEventUpdates=function(o,l){var d=Qe;Qe|=2;try{return o(l)}finally{Qe=d,Qe===0&&(nn(),Hi())}},i.batchedUpdates=bh,i.createComponentSelector=function(o){return{$$typeof:Fo,value:o}},i.createContainer=function(o,l,d){return o=new hf(o,l,d),l=Di(3,null,null,l===2?7:l===1?3:0),o.current=l,l.stateNode=o,$i(l),o},i.createHasPsuedoClassSelector=function(o){return{$$typeof:Au,value:o}},i.createPortal=function(o,l,d){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:m,key:y==null?null:""+y,children:o,containerInfo:l,implementation:d}},i.createRoleSelector=function(o){return{$$typeof:Mu,value:o}},i.createTestNameSelector=function(o){return{$$typeof:Bo,value:o}},i.createTextSelector=function(o){return{$$typeof:Ou,value:o}},i.deferredUpdates=function(o){return Pr(97,o)},i.discreteUpdates=function(o,l,d,y,E){var C=Qe;Qe|=4;try{return Pr(98,o.bind(null,l,d,y,E))}finally{Qe=C,Qe===0&&(nn(),Hi())}},i.findAllNodes=of,i.findBoundingRects=function(o,l){if(!We)throw Error(p(363));l=of(o,l),o=[];for(var d=0;d<l.length;d++)o.push(ji(l[d]));for(l=o.length-1;0<l;l--){d=o[l];for(var y=d.x,E=y+d.width,C=d.y,N=C+d.height,B=l-1;0<=B;B--)if(l!==B){var te=o[B],we=te.x,He=we+te.width,Je=te.y,Me=Je+te.height;if(y>=we&&C>=Je&&E<=He&&N<=Me){o.splice(l,1);break}else if(y!==we||d.width!==te.width||Me<C||Je>N){if(!(C!==Je||d.height!==te.height||He<y||we>E)){we>y&&(te.width+=we-y,te.x=y),He<E&&(te.width=E-we),o.splice(l,1);break}}else{Je>C&&(te.height+=Je-C,te.y=C),Me<N&&(te.height=N-Je),o.splice(l,1);break}}}return o},i.findHostInstance=ol,i.findHostInstanceWithNoPortals=function(o){return o=ce(o),o===null?null:o.tag===20?o.stateNode.instance:o.stateNode},i.findHostInstanceWithWarning=function(o){return ol(o)},i.flushControlled=function(o){var l=Qe;Qe|=1;try{Pr(99,o)}finally{Qe=l,Qe===0&&(nn(),Hi())}},i.flushDiscreteUpdates=function(){!(Qe&49)&&(Na(),ui())},i.flushPassiveEffects=ui,i.flushSync=Eh,i.focusWithin=function(o,l){if(!We)throw Error(p(363));for(o=rf(o),l=af(o,l),l=Array.from(l),o=0;o<l.length;){var d=l[o++];if(!ct(d)){if(d.tag===5&&Pt(d.stateNode))return!0;for(d=d.child;d!==null;)l.push(d),d=d.sibling}}return!1},i.getCurrentUpdateLanePriority=function(){return Gl},i.getFindAllNodesFailureDescription=function(o,l){if(!We)throw Error(p(363));var d=0,y=[];o=[rf(o),0];for(var E=0;E<o.length;){var C=o[E++],N=o[E++],B=l[N];if((C.tag!==5||!ct(C))&&(sf(C,B)&&(y.push(Vo(B)),N++,N>d&&(d=N)),N<l.length))for(C=C.child;C!==null;)o.push(C,N),C=C.sibling}if(d<l.length){for(o=[];d<l.length;d++)o.push(Vo(l[d]));return`findAllNodes was able to match part of the selector:
|
|
201
|
+
*/pf.exports;var Mg;function Xx(){return Mg||(Mg=1,function(t){t.exports=function(n){var r={},o=Sg(),c=C,h=wg();function v(a){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+a,f=1;f<arguments.length;f++)l+="&args[]="+encodeURIComponent(arguments[f]);return"Minified React error #"+a+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var g=c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,x=60103,m=60106,w=60107,A=60108,P=60114,M=60109,_=60110,L=60112,k=60113,O=60120,I=60115,q=60116,te=60121,H=60129,J=60130,re=60131;if(typeof Symbol=="function"&&Symbol.for){var $=Symbol.for;x=$("react.element"),m=$("react.portal"),w=$("react.fragment"),A=$("react.strict_mode"),P=$("react.profiler"),M=$("react.provider"),_=$("react.context"),L=$("react.forward_ref"),k=$("react.suspense"),O=$("react.suspense_list"),I=$("react.memo"),q=$("react.lazy"),te=$("react.block"),$("react.scope"),H=$("react.debug_trace_mode"),J=$("react.offscreen"),re=$("react.legacy_hidden")}var se=typeof Symbol=="function"&&Symbol.iterator;function ge(a){return a===null||typeof a!="object"?null:(a=se&&a[se]||a["@@iterator"],typeof a=="function"?a:null)}function Ce(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case w:return"Fragment";case m:return"Portal";case P:return"Profiler";case A:return"StrictMode";case k:return"Suspense";case O:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case _:return(a.displayName||"Context")+".Consumer";case M:return(a._context.displayName||"Context")+".Provider";case L:var l=a.render;return l=l.displayName||l.name||"",a.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case I:return Ce(a.type);case te:return Ce(a._render);case q:l=a._payload,a=a._init;try{return Ce(a(l))}catch{}}return null}function me(a){var l=a,f=a;if(a.alternate)for(;l.return;)l=l.return;else{a=l;do l=a,l.flags&1026&&(f=l.return),a=l.return;while(a)}return l.tag===3?f:null}function Ie(a){if(me(a)!==a)throw Error(v(188))}function _e(a){var l=a.alternate;if(!l){if(l=me(a),l===null)throw Error(v(188));return l!==a?null:a}for(var f=a,y=l;;){var b=f.return;if(b===null)break;var T=b.alternate;if(T===null){if(y=b.return,y!==null){f=y;continue}break}if(b.child===T.child){for(T=b.child;T;){if(T===f)return Ie(b),a;if(T===y)return Ie(b),l;T=T.sibling}throw Error(v(188))}if(f.return!==y.return)f=b,y=T;else{for(var N=!1,B=b.child;B;){if(B===f){N=!0,f=b,y=T;break}if(B===y){N=!0,y=b,f=T;break}B=B.sibling}if(!N){for(B=T.child;B;){if(B===f){N=!0,f=T,y=b;break}if(B===y){N=!0,y=T,f=b;break}B=B.sibling}if(!N)throw Error(v(189))}}if(f.alternate!==y)throw Error(v(190))}if(f.tag!==3)throw Error(v(188));return f.stateNode.current===f?a:l}function Ye(a){if(a=_e(a),!a)return null;for(var l=a;;){if(l.tag===5||l.tag===6)return l;if(l.child)l.child.return=l,l=l.child;else{if(l===a)break;for(;!l.sibling;){if(!l.return||l.return===a)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}}return null}function gt(a){if(a=_e(a),!a)return null;for(var l=a;;){if(l.tag===5||l.tag===6)return l;if(l.child&&l.tag!==4)l.child.return=l,l=l.child;else{if(l===a)break;for(;!l.sibling;){if(!l.return||l.return===a)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}}return null}function Z(a,l){for(var f=a.alternate;l!==null;){if(l===a||l===f)return!0;l=l.return}return!1}var Ue=n.getPublicInstance,dt=n.getRootHostContext,pe=n.getChildHostContext,je=n.prepareForCommit,He=n.resetAfterCommit,ut=n.createInstance,pt=n.appendInitialChild,vn=n.finalizeInitialChildren,Kt=n.prepareUpdate,xt=n.shouldSetTextContent,ct=n.createTextInstance,Ge=n.scheduleTimeout,nt=n.cancelTimeout,Ze=n.noTimeout,ht=n.isPrimaryRenderer,ft=n.supportsMutation,mn=n.supportsPersistence,Qt=n.supportsHydration,Gi=n.getInstanceFromNode,j=n.makeOpaqueHydratingObject,z=n.makeClientId,G=n.beforeActiveInstanceBlur,Se=n.afterActiveInstanceBlur,st=n.preparePortalMount,Ve=n.supportsTestSelectors,gn=n.findFiberRoot,ki=n.getBoundingRect,be=n.getTextContent,at=n.isHiddenSubtree,ui=n.matchAccessibilityRole,Dt=n.setFocusIfFocusable,et=n.setupIntersectionObserver,Te=n.appendChild,Pe=n.appendChildToContainer,rt=n.commitTextUpdate,Lt=n.commitMount,tt=n.commitUpdate,an=n.insertBefore,Zt=n.insertInContainerBefore,Fn=n.removeChild,nn=n.removeChildFromContainer,bi=n.resetTextContent,qr=n.hideInstance,Ha=n.hideTextInstance,Va=n.unhideInstance,Yr=n.unhideTextInstance,xi=n.clearContainer,ia=n.cloneInstance,Wa=n.createContainerChildSet,ws=n.appendChildToContainerChildSet,Xi=n.finalizeContainerChildren,vl=n.replaceContainerChildren,ml=n.cloneHiddenInstance,Qr=n.cloneHiddenTextInstance,Ju=n.canHydrateInstance,ec=n.canHydrateTextInstance,gl=n.isSuspenseInstancePending,yl=n.isSuspenseInstanceFallback,U=n.getNextHydratableSibling,de=n.getFirstHydratableChild,we=n.hydrateInstance,Qe=n.hydrateTextInstance,Et=n.getNextHydratableInstanceAfterSuspenseInstance,At=n.commitHydratedContainer,vt=n.commitHydratedSuspenseInstance,ot;function yn(a){if(ot===void 0)try{throw Error()}catch(f){var l=f.stack.trim().match(/\n( *(at )?)/);ot=l&&l[1]||""}return`
|
|
202
|
+
`+ot+a}var Ut=!1;function Ht(a,l){if(!a||Ut)return"";Ut=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(l)if(l=function(){throw Error()},Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(ne){var y=ne}Reflect.construct(a,[],l)}else{try{l.call()}catch(ne){y=ne}a.call(l.prototype)}else{try{throw Error()}catch(ne){y=ne}a()}}catch(ne){if(ne&&y&&typeof ne.stack=="string"){for(var b=ne.stack.split(`
|
|
203
|
+
`),T=y.stack.split(`
|
|
204
|
+
`),N=b.length-1,B=T.length-1;1<=N&&0<=B&&b[N]!==T[B];)B--;for(;1<=N&&0<=B;N--,B--)if(b[N]!==T[B]){if(N!==1||B!==1)do if(N--,B--,0>B||b[N]!==T[B])return`
|
|
205
|
+
`+b[N].replace(" at new "," at ");while(1<=N&&0<=B);break}}}finally{Ut=!1,Error.prepareStackTrace=f}return(a=a?a.displayName||a.name:"")?yn(a):""}var zn=[],Zn=-1;function zi(a){return{current:a}}function mt(a){0>Zn||(a.current=zn[Zn],zn[Zn]=null,Zn--)}function on(a,l){Zn++,zn[Zn]=a.current,a.current=l}var ur={},ln=zi(ur),Bn=zi(!1),Nn=ur;function cr(a,l){var f=a.type.contextTypes;if(!f)return ur;var y=a.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===l)return y.__reactInternalMemoizedMaskedChildContext;var b={},T;for(T in f)b[T]=l[T];return y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=l,a.__reactInternalMemoizedMaskedChildContext=b),b}function Jt(a){return a=a.childContextTypes,a!=null}function Sl(){mt(Bn),mt(ln)}function Sd(a,l,f){if(ln.current!==ur)throw Error(v(168));on(ln,l),on(Bn,f)}function bd(a,l,f){var y=a.stateNode;if(a=l.childContextTypes,typeof y.getChildContext!="function")return f;y=y.getChildContext();for(var b in y)if(!(b in a))throw Error(v(108,Ce(l)||"Unknown",b));return o({},f,y)}function $a(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||ur,Nn=ln.current,on(ln,a),on(Bn,Bn.current),!0}function xd(a,l,f){var y=a.stateNode;if(!y)throw Error(v(169));f?(a=bd(a,l,Nn),y.__reactInternalMemoizedMergedChildContext=a,mt(Bn),mt(ln),on(ln,a)):mt(Bn),on(Bn,f)}var tc=null,Ni=null,ov=h.unstable_now;ov();var bl=0,Vt=8;function Ki(a){if(1&a)return Vt=15,1;if(2&a)return Vt=14,2;if(4&a)return Vt=13,4;var l=24&a;return l!==0?(Vt=12,l):a&32?(Vt=11,32):(l=192&a,l!==0?(Vt=10,l):a&256?(Vt=9,256):(l=3584&a,l!==0?(Vt=8,l):a&4096?(Vt=7,4096):(l=4186112&a,l!==0?(Vt=6,l):(l=62914560&a,l!==0?(Vt=5,l):a&67108864?(Vt=4,67108864):a&134217728?(Vt=3,134217728):(l=805306368&a,l!==0?(Vt=2,l):1073741824&a?(Vt=1,1073741824):(Vt=8,a))))))}function lv(a){switch(a){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}function uv(a){switch(a){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(v(358,a))}}function qa(a,l){var f=a.pendingLanes;if(f===0)return Vt=0;var y=0,b=0,T=a.expiredLanes,N=a.suspendedLanes,B=a.pingedLanes;if(T!==0)y=T,b=Vt=15;else if(T=f&134217727,T!==0){var ne=T&~N;ne!==0?(y=Ki(ne),b=Vt):(B&=T,B!==0&&(y=Ki(B),b=Vt))}else T=f&~N,T!==0?(y=Ki(T),b=Vt):B!==0&&(y=Ki(B),b=Vt);if(y===0)return 0;if(y=31-Gr(y),y=f&((0>y?0:1<<y)<<1)-1,l!==0&&l!==y&&!(l&N)){if(Ki(l),b<=Vt)return l;Vt=b}if(l=a.entangledLanes,l!==0)for(a=a.entanglements,l&=y;0<l;)f=31-Gr(l),b=1<<f,y|=a[f],l&=~b;return y}function Ed(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function xl(a,l){switch(a){case 15:return 1;case 14:return 2;case 12:return a=ra(24&~l),a===0?xl(10,l):a;case 10:return a=ra(192&~l),a===0?xl(8,l):a;case 8:return a=ra(3584&~l),a===0&&(a=ra(4186112&~l),a===0&&(a=512)),a;case 2:return l=ra(805306368&~l),l===0&&(l=268435456),l}throw Error(v(358,a))}function ra(a){return a&-a}function nc(a){for(var l=[],f=0;31>f;f++)l.push(a);return l}function El(a,l,f){a.pendingLanes|=l;var y=l-1;a.suspendedLanes&=y,a.pingedLanes&=y,a=a.eventTimes,l=31-Gr(l),a[l]=f}var Gr=Math.clz32?Math.clz32:dv,cv=Math.log,fv=Math.LN2;function dv(a){return a===0?32:31-(cv(a)/fv|0)|0}var wd=h.unstable_runWithPriority,ic=h.unstable_scheduleCallback,rc=h.unstable_cancelCallback,hv=h.unstable_shouldYield,Td=h.unstable_requestPaint,Ya=h.unstable_now,pv=h.unstable_getCurrentPriorityLevel,Qa=h.unstable_ImmediatePriority,sc=h.unstable_UserBlockingPriority,Cd=h.unstable_NormalPriority,ac=h.unstable_LowPriority,oc=h.unstable_IdlePriority,wl={},vv=Td!==void 0?Td:function(){},Tr=null,Tl=null,lc=!1,Cl=Ya(),On=1e4>Cl?Ya:function(){return Ya()-Cl};function sa(){switch(pv()){case Qa:return 99;case sc:return 98;case Cd:return 97;case ac:return 96;case oc:return 95;default:throw Error(v(332))}}function Rd(a){switch(a){case 99:return Qa;case 98:return sc;case 97:return Cd;case 96:return ac;case 95:return oc;default:throw Error(v(332))}}function Cr(a,l){return a=Rd(a),wd(a,l)}function aa(a,l,f){return a=Rd(a),ic(a,l,f)}function _i(){if(Tl!==null){var a=Tl;Tl=null,rc(a)}Ad()}function Ad(){if(!lc&&Tr!==null){lc=!0;var a=0;try{var l=Tr;Cr(99,function(){for(;a<l.length;a++){var f=l[a];do f=f(!0);while(f!==null)}}),Tr=null}catch(f){throw Tr!==null&&(Tr=Tr.slice(a+1)),ic(Qa,_i),f}finally{lc=!1}}}var mv=g.ReactCurrentBatchConfig;function gv(a,l){return a===l&&(a!==0||1/a===1/l)||a!==a&&l!==l}var Ui=typeof Object.is=="function"?Object.is:gv,yv=Object.prototype.hasOwnProperty;function Rl(a,l){if(Ui(a,l))return!0;if(typeof a!="object"||a===null||typeof l!="object"||l===null)return!1;var f=Object.keys(a),y=Object.keys(l);if(f.length!==y.length)return!1;for(y=0;y<f.length;y++)if(!yv.call(l,f[y])||!Ui(a[f[y]],l[f[y]]))return!1;return!0}function Sv(a){switch(a.tag){case 5:return yn(a.type);case 16:return yn("Lazy");case 13:return yn("Suspense");case 19:return yn("SuspenseList");case 0:case 2:case 15:return a=Ht(a.type,!1),a;case 11:return a=Ht(a.type.render,!1),a;case 22:return a=Ht(a.type._render,!1),a;case 1:return a=Ht(a.type,!0),a;default:return""}}function Zi(a,l){if(a&&a.defaultProps){l=o({},l),a=a.defaultProps;for(var f in a)l[f]===void 0&&(l[f]=a[f]);return l}return l}var Al=zi(null),Ml=null,fr=null,Ga=null;function Ol(){Ga=fr=Ml=null}function uc(a,l){a=a.type._context,ht?(on(Al,a._currentValue),a._currentValue=l):(on(Al,a._currentValue2),a._currentValue2=l)}function Dl(a){var l=Al.current;mt(Al),a=a.type._context,ht?a._currentValue=l:a._currentValue2=l}function cc(a,l){for(;a!==null;){var f=a.alternate;if((a.childLanes&l)===l){if(f===null||(f.childLanes&l)===l)break;f.childLanes|=l}else a.childLanes|=l,f!==null&&(f.childLanes|=l);a=a.return}}function Ts(a,l){Ml=a,Ga=fr=null,a=a.dependencies,a!==null&&a.firstContext!==null&&(a.lanes&l&&(Bi=!0),a.firstContext=null)}function Ei(a,l){if(Ga!==a&&l!==!1&&l!==0)if((typeof l!="number"||l===1073741823)&&(Ga=a,l=1073741823),l={context:a,observedBits:l,next:null},fr===null){if(Ml===null)throw Error(v(308));fr=l,Ml.dependencies={lanes:0,firstContext:l,responders:null}}else fr=fr.next=l;return ht?a._currentValue:a._currentValue2}var Rr=!1;function ji(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function Ji(a,l){a=a.updateQueue,l.updateQueue===a&&(l.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function dr(a,l){return{eventTime:a,lane:l,tag:0,payload:null,callback:null,next:null}}function hr(a,l){if(a=a.updateQueue,a!==null){a=a.shared;var f=a.pending;f===null?l.next=l:(l.next=f.next,f.next=l),a.pending=l}}function Ar(a,l){var f=a.updateQueue,y=a.alternate;if(y!==null&&(y=y.updateQueue,f===y)){var b=null,T=null;if(f=f.firstBaseUpdate,f!==null){do{var N={eventTime:f.eventTime,lane:f.lane,tag:f.tag,payload:f.payload,callback:f.callback,next:null};T===null?b=T=N:T=T.next=N,f=f.next}while(f!==null);T===null?b=T=l:T=T.next=l}else b=T=l;f={baseState:y.baseState,firstBaseUpdate:b,lastBaseUpdate:T,shared:y.shared,effects:y.effects},a.updateQueue=f;return}a=f.lastBaseUpdate,a===null?f.firstBaseUpdate=l:a.next=l,f.lastBaseUpdate=l}function Cs(a,l,f,y){var b=a.updateQueue;Rr=!1;var T=b.firstBaseUpdate,N=b.lastBaseUpdate,B=b.shared.pending;if(B!==null){b.shared.pending=null;var ne=B,xe=ne.next;ne.next=null,N===null?T=xe:N.next=xe,N=ne;var Fe=a.alternate;if(Fe!==null){Fe=Fe.updateQueue;var Ke=Fe.lastBaseUpdate;Ke!==N&&(Ke===null?Fe.firstBaseUpdate=xe:Ke.next=xe,Fe.lastBaseUpdate=ne)}}if(T!==null){Ke=b.baseState,N=0,Fe=xe=ne=null;do{B=T.lane;var Ae=T.eventTime;if((y&B)===B){Fe!==null&&(Fe=Fe.next={eventTime:Ae,lane:0,tag:T.tag,payload:T.payload,callback:T.callback,next:null});e:{var Pt=a,qt=T;switch(B=l,Ae=f,qt.tag){case 1:if(Pt=qt.payload,typeof Pt=="function"){Ke=Pt.call(Ae,Ke,B);break e}Ke=Pt;break e;case 3:Pt.flags=Pt.flags&-4097|64;case 0:if(Pt=qt.payload,B=typeof Pt=="function"?Pt.call(Ae,Ke,B):Pt,B==null)break e;Ke=o({},Ke,B);break e;case 2:Rr=!0}}T.callback!==null&&(a.flags|=32,B=b.effects,B===null?b.effects=[T]:B.push(T))}else Ae={eventTime:Ae,lane:B,tag:T.tag,payload:T.payload,callback:T.callback,next:null},Fe===null?(xe=Fe=Ae,ne=Ke):Fe=Fe.next=Ae,N|=B;if(T=T.next,T===null){if(B=b.shared.pending,B===null)break;T=B.next,B.next=null,b.lastBaseUpdate=B,b.shared.pending=null}}while(!0);Fe===null&&(ne=Ke),b.baseState=ne,b.firstBaseUpdate=xe,b.lastBaseUpdate=Fe,xo|=N,a.lanes=N,a.memoizedState=Ke}}function Xa(a,l,f){if(a=l.effects,l.effects=null,a!==null)for(l=0;l<a.length;l++){var y=a[l],b=y.callback;if(b!==null){if(y.callback=null,y=f,typeof b!="function")throw Error(v(191,b));b.call(y)}}}var Md=new c.Component().refs;function oa(a,l,f,y){l=a.memoizedState,f=f(y,l),f=f==null?l:o({},l,f),a.memoizedState=f,a.lanes===0&&(a.updateQueue.baseState=f)}var Ll={isMounted:function(a){return(a=a._reactInternals)?me(a)===a:!1},enqueueSetState:function(a,l,f){a=a._reactInternals;var y=pi(),b=Cn(a),T=dr(y,b);T.payload=l,f!=null&&(T.callback=f),hr(a,T),Nr(a,b,y)},enqueueReplaceState:function(a,l,f){a=a._reactInternals;var y=pi(),b=Cn(a),T=dr(y,b);T.tag=1,T.payload=l,f!=null&&(T.callback=f),hr(a,T),Nr(a,b,y)},enqueueForceUpdate:function(a,l){a=a._reactInternals;var f=pi(),y=Cn(a),b=dr(f,y);b.tag=2,l!=null&&(b.callback=l),hr(a,b),Nr(a,y,f)}};function la(a,l,f,y,b,T,N){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(y,T,N):l.prototype&&l.prototype.isPureReactComponent?!Rl(f,y)||!Rl(b,T):!0}function Od(a,l,f){var y=!1,b=ur,T=l.contextType;return typeof T=="object"&&T!==null?T=Ei(T):(b=Jt(l)?Nn:ln.current,y=l.contextTypes,T=(y=y!=null)?cr(a,b):ur),l=new l(f,T),a.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=Ll,a.stateNode=l,l._reactInternals=a,y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=T),l}function Pl(a,l,f,y){a=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(f,y),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(f,y),l.state!==a&&Ll.enqueueReplaceState(l,l.state,null)}function kl(a,l,f,y){var b=a.stateNode;b.props=f,b.state=a.memoizedState,b.refs=Md,ji(a);var T=l.contextType;typeof T=="object"&&T!==null?b.context=Ei(T):(T=Jt(l)?Nn:ln.current,b.context=cr(a,T)),Cs(a,f,b,y),b.state=a.memoizedState,T=l.getDerivedStateFromProps,typeof T=="function"&&(oa(a,l,T,f),b.state=a.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(l=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),l!==b.state&&Ll.enqueueReplaceState(b,b.state,null),Cs(a,f,b,y),b.state=a.memoizedState),typeof b.componentDidMount=="function"&&(a.flags|=4)}var Ka=Array.isArray;function Xr(a,l,f){if(a=f.ref,a!==null&&typeof a!="function"&&typeof a!="object"){if(f._owner){if(f=f._owner,f){if(f.tag!==1)throw Error(v(309));var y=f.stateNode}if(!y)throw Error(v(147,a));var b=""+a;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===b?l.ref:(l=function(T){var N=y.refs;N===Md&&(N=y.refs={}),T===null?delete N[b]:N[b]=T},l._stringRef=b,l)}if(typeof a!="string")throw Error(v(284));if(!f._owner)throw Error(v(290,a))}return a}function ci(a,l){if(a.type!=="textarea")throw Error(v(31,Object.prototype.toString.call(l)==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":l))}function zl(a){function l(Q,V){if(a){var ie=Q.lastEffect;ie!==null?(ie.nextEffect=V,Q.lastEffect=V):Q.firstEffect=Q.lastEffect=V,V.nextEffect=null,V.flags=8}}function f(Q,V){if(!a)return null;for(;V!==null;)l(Q,V),V=V.sibling;return null}function y(Q,V){for(Q=new Map;V!==null;)V.key!==null?Q.set(V.key,V):Q.set(V.index,V),V=V.sibling;return Q}function b(Q,V){return Q=Ft(Q,V),Q.index=0,Q.sibling=null,Q}function T(Q,V,ie){return Q.index=ie,a?(ie=Q.alternate,ie!==null?(ie=ie.index,ie<V?(Q.flags=2,V):ie):(Q.flags=2,V)):V}function N(Q){return a&&Q.alternate===null&&(Q.flags=2),Q}function B(Q,V,ie,Re){return V===null||V.tag!==6?(V=No(ie,Q.mode,Re),V.return=Q,V):(V=b(V,ie),V.return=Q,V)}function ne(Q,V,ie,Re){return V!==null&&V.elementType===ie.type?(Re=b(V,ie.props),Re.ref=Xr(Q,V,ie),Re.return=Q,Re):(Re=zo(ie.type,ie.key,ie.props,null,Q.mode,Re),Re.ref=Xr(Q,V,ie),Re.return=Q,Re)}function xe(Q,V,ie,Re){return V===null||V.tag!==4||V.stateNode.containerInfo!==ie.containerInfo||V.stateNode.implementation!==ie.implementation?(V=Ta(ie,Q.mode,Re),V.return=Q,V):(V=b(V,ie.children||[]),V.return=Q,V)}function Fe(Q,V,ie,Re,Be){return V===null||V.tag!==7?(V=js(ie,Q.mode,Re,Be),V.return=Q,V):(V=b(V,ie),V.return=Q,V)}function Ke(Q,V,ie){if(typeof V=="string"||typeof V=="number")return V=No(""+V,Q.mode,ie),V.return=Q,V;if(typeof V=="object"&&V!==null){switch(V.$$typeof){case x:return ie=zo(V.type,V.key,V.props,null,Q.mode,ie),ie.ref=Xr(Q,null,V),ie.return=Q,ie;case m:return V=Ta(V,Q.mode,ie),V.return=Q,V}if(Ka(V)||ge(V))return V=js(V,Q.mode,ie,null),V.return=Q,V;ci(Q,V)}return null}function Ae(Q,V,ie,Re){var Be=V!==null?V.key:null;if(typeof ie=="string"||typeof ie=="number")return Be!==null?null:B(Q,V,""+ie,Re);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case x:return ie.key===Be?ie.type===w?Fe(Q,V,ie.props.children,Re,Be):ne(Q,V,ie,Re):null;case m:return ie.key===Be?xe(Q,V,ie,Re):null}if(Ka(ie)||ge(ie))return Be!==null?null:Fe(Q,V,ie,Re,null);ci(Q,ie)}return null}function Pt(Q,V,ie,Re,Be){if(typeof Re=="string"||typeof Re=="number")return Q=Q.get(ie)||null,B(V,Q,""+Re,Be);if(typeof Re=="object"&&Re!==null){switch(Re.$$typeof){case x:return Q=Q.get(Re.key===null?ie:Re.key)||null,Re.type===w?Fe(V,Q,Re.props.children,Be,Re.key):ne(V,Q,Re,Be);case m:return Q=Q.get(Re.key===null?ie:Re.key)||null,xe(V,Q,Re,Be)}if(Ka(Re)||ge(Re))return Q=Q.get(ie)||null,Fe(V,Q,Re,Be,null);ci(V,Re)}return null}function qt(Q,V,ie,Re){for(var Be=null,kt=null,Je=V,Rt=V=0,En=null;Je!==null&&Rt<ie.length;Rt++){Je.index>Rt?(En=Je,Je=null):En=Je.sibling;var yt=Ae(Q,Je,ie[Rt],Re);if(yt===null){Je===null&&(Je=En);break}a&&Je&&yt.alternate===null&&l(Q,Je),V=T(yt,V,Rt),kt===null?Be=yt:kt.sibling=yt,kt=yt,Je=En}if(Rt===ie.length)return f(Q,Je),Be;if(Je===null){for(;Rt<ie.length;Rt++)Je=Ke(Q,ie[Rt],Re),Je!==null&&(V=T(Je,V,Rt),kt===null?Be=Je:kt.sibling=Je,kt=Je);return Be}for(Je=y(Q,Je);Rt<ie.length;Rt++)En=Pt(Je,Q,Rt,ie[Rt],Re),En!==null&&(a&&En.alternate!==null&&Je.delete(En.key===null?Rt:En.key),V=T(En,V,Rt),kt===null?Be=En:kt.sibling=En,kt=En);return a&&Je.forEach(function(_r){return l(Q,_r)}),Be}function Mi(Q,V,ie,Re){var Be=ge(ie);if(typeof Be!="function")throw Error(v(150));if(ie=Be.call(ie),ie==null)throw Error(v(151));for(var kt=Be=null,Je=V,Rt=V=0,En=null,yt=ie.next();Je!==null&&!yt.done;Rt++,yt=ie.next()){Je.index>Rt?(En=Je,Je=null):En=Je.sibling;var _r=Ae(Q,Je,yt.value,Re);if(_r===null){Je===null&&(Je=En);break}a&&Je&&_r.alternate===null&&l(Q,Je),V=T(_r,V,Rt),kt===null?Be=_r:kt.sibling=_r,kt=_r,Je=En}if(yt.done)return f(Q,Je),Be;if(Je===null){for(;!yt.done;Rt++,yt=ie.next())yt=Ke(Q,yt.value,Re),yt!==null&&(V=T(yt,V,Rt),kt===null?Be=yt:kt.sibling=yt,kt=yt);return Be}for(Je=y(Q,Je);!yt.done;Rt++,yt=ie.next())yt=Pt(Je,Q,Rt,yt.value,Re),yt!==null&&(a&&yt.alternate!==null&&Je.delete(yt.key===null?Rt:yt.key),V=T(yt,V,Rt),kt===null?Be=yt:kt.sibling=yt,kt=yt);return a&&Je.forEach(function(Av){return l(Q,Av)}),Be}return function(Q,V,ie,Re){var Be=typeof ie=="object"&&ie!==null&&ie.type===w&&ie.key===null;Be&&(ie=ie.props.children);var kt=typeof ie=="object"&&ie!==null;if(kt)switch(ie.$$typeof){case x:e:{for(kt=ie.key,Be=V;Be!==null;){if(Be.key===kt){switch(Be.tag){case 7:if(ie.type===w){f(Q,Be.sibling),V=b(Be,ie.props.children),V.return=Q,Q=V;break e}break;default:if(Be.elementType===ie.type){f(Q,Be.sibling),V=b(Be,ie.props),V.ref=Xr(Q,Be,ie),V.return=Q,Q=V;break e}}f(Q,Be);break}else l(Q,Be);Be=Be.sibling}ie.type===w?(V=js(ie.props.children,Q.mode,Re,ie.key),V.return=Q,Q=V):(Re=zo(ie.type,ie.key,ie.props,null,Q.mode,Re),Re.ref=Xr(Q,V,ie),Re.return=Q,Q=Re)}return N(Q);case m:e:{for(Be=ie.key;V!==null;){if(V.key===Be)if(V.tag===4&&V.stateNode.containerInfo===ie.containerInfo&&V.stateNode.implementation===ie.implementation){f(Q,V.sibling),V=b(V,ie.children||[]),V.return=Q,Q=V;break e}else{f(Q,V);break}else l(Q,V);V=V.sibling}V=Ta(ie,Q.mode,Re),V.return=Q,Q=V}return N(Q)}if(typeof ie=="string"||typeof ie=="number")return ie=""+ie,V!==null&&V.tag===6?(f(Q,V.sibling),V=b(V,ie),V.return=Q,Q=V):(f(Q,V),V=No(ie,Q.mode,Re),V.return=Q,Q=V),N(Q);if(Ka(ie))return qt(Q,V,ie,Re);if(ge(ie))return Mi(Q,V,ie,Re);if(kt&&ci(Q,ie),typeof ie>"u"&&!Be)switch(Q.tag){case 1:case 22:case 0:case 11:case 15:throw Error(v(152,Ce(Q.type)||"Component"))}return f(Q,V)}}var Rs=zl(!0),pr=zl(!1),Ii={},jt=zi(Ii),Sn=zi(Ii),Kr=zi(Ii);function un(a){if(a===Ii)throw Error(v(174));return a}function er(a,l){on(Kr,l),on(Sn,a),on(jt,Ii),a=dt(l),mt(jt),on(jt,a)}function Jn(){mt(jt),mt(Sn),mt(Kr)}function Nl(a){var l=un(Kr.current),f=un(jt.current);l=pe(f,a.type,l),f!==l&&(on(Sn,a),on(jt,l))}function Zr(a){Sn.current===a&&(mt(jt),mt(Sn))}var rn=zi(0);function Mr(a){for(var l=a;l!==null;){if(l.tag===13){var f=l.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||gl(f)||yl(f)))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if(l.flags&64)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===a)break;for(;l.sibling===null;){if(l.return===null||l.return===a)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Fi=null,Hn=null,wi=!1;function _l(a,l){var f=Ai(5,null,null,0);f.elementType="DELETED",f.type="DELETED",f.stateNode=l,f.return=a,f.flags=8,a.lastEffect!==null?(a.lastEffect.nextEffect=f,a.lastEffect=f):a.firstEffect=a.lastEffect=f}function fc(a,l){switch(a.tag){case 5:return l=Ju(l,a.type,a.pendingProps),l!==null?(a.stateNode=l,!0):!1;case 6:return l=ec(l,a.pendingProps),l!==null?(a.stateNode=l,!0):!1;case 13:return!1;default:return!1}}function Ul(a){if(wi){var l=Hn;if(l){var f=l;if(!fc(a,l)){if(l=U(f),!l||!fc(a,l)){a.flags=a.flags&-1025|2,wi=!1,Fi=a;return}_l(Fi,f)}Fi=a,Hn=de(l)}else a.flags=a.flags&-1025|2,wi=!1,Fi=a}}function Za(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;Fi=a}function Ja(a){if(!Qt||a!==Fi)return!1;if(!wi)return Za(a),wi=!0,!1;var l=a.type;if(a.tag!==5||l!=="head"&&l!=="body"&&!xt(l,a.memoizedProps))for(l=Hn;l;)_l(a,l),l=U(l);if(Za(a),a.tag===13){if(!Qt)throw Error(v(316));if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(v(317));Hn=Et(a)}else Hn=Fi?U(a.stateNode):null;return!0}function dc(){Qt&&(Hn=Fi=null,wi=!1)}var As=[];function jl(){for(var a=0;a<As.length;a++){var l=As[a];ht?l._workInProgressVersionPrimary=null:l._workInProgressVersionSecondary=null}As.length=0}var ua=g.ReactCurrentDispatcher,ei=g.ReactCurrentBatchConfig,fi=0,Wt=null,Vn=null,_n=null,Il=!1,eo=!1;function di(){throw Error(v(321))}function hc(a,l){if(l===null)return!1;for(var f=0;f<l.length&&f<a.length;f++)if(!Ui(a[f],l[f]))return!1;return!0}function Fl(a,l,f,y,b,T){if(fi=T,Wt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,ua.current=a===null||a.memoizedState===null?oo:Vl,a=f(y,b),eo){T=0;do{if(eo=!1,!(25>T))throw Error(v(301));T+=1,_n=Vn=null,l.updateQueue=null,ua.current=Wl,a=f(y,b)}while(eo)}if(ua.current=Tt,l=Vn!==null&&Vn.next!==null,fi=0,_n=Vn=Wt=null,Il=!1,l)throw Error(v(300));return a}function Jr(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _n===null?Wt.memoizedState=_n=a:_n=_n.next=a,_n}function es(){if(Vn===null){var a=Wt.alternate;a=a!==null?a.memoizedState:null}else a=Vn.next;var l=_n===null?Wt.memoizedState:_n.next;if(l!==null)_n=l,Vn=a;else{if(a===null)throw Error(v(310));Vn=a,a={memoizedState:Vn.memoizedState,baseState:Vn.baseState,baseQueue:Vn.baseQueue,queue:Vn.queue,next:null},_n===null?Wt.memoizedState=_n=a:_n=_n.next=a}return _n}function vr(a,l){return typeof l=="function"?l(a):l}function ca(a){var l=es(),f=l.queue;if(f===null)throw Error(v(311));f.lastRenderedReducer=a;var y=Vn,b=y.baseQueue,T=f.pending;if(T!==null){if(b!==null){var N=b.next;b.next=T.next,T.next=N}y.baseQueue=b=T,f.pending=null}if(b!==null){b=b.next,y=y.baseState;var B=N=T=null,ne=b;do{var xe=ne.lane;if((fi&xe)===xe)B!==null&&(B=B.next={lane:0,action:ne.action,eagerReducer:ne.eagerReducer,eagerState:ne.eagerState,next:null}),y=ne.eagerReducer===a?ne.eagerState:a(y,ne.action);else{var Fe={lane:xe,action:ne.action,eagerReducer:ne.eagerReducer,eagerState:ne.eagerState,next:null};B===null?(N=B=Fe,T=y):B=B.next=Fe,Wt.lanes|=xe,xo|=xe}ne=ne.next}while(ne!==null&&ne!==b);B===null?T=y:B.next=N,Ui(y,l.memoizedState)||(Bi=!0),l.memoizedState=y,l.baseState=T,l.baseQueue=B,f.lastRenderedState=y}return[l.memoizedState,f.dispatch]}function to(a){var l=es(),f=l.queue;if(f===null)throw Error(v(311));f.lastRenderedReducer=a;var y=f.dispatch,b=f.pending,T=l.memoizedState;if(b!==null){f.pending=null;var N=b=b.next;do T=a(T,N.action),N=N.next;while(N!==b);Ui(T,l.memoizedState)||(Bi=!0),l.memoizedState=T,l.baseQueue===null&&(l.baseState=T),f.lastRenderedState=T}return[T,y]}function Ms(a,l,f){var y=l._getVersion;y=y(l._source);var b=ht?l._workInProgressVersionPrimary:l._workInProgressVersionSecondary;if(b!==null?a=b===y:(a=a.mutableReadLanes,(a=(fi&a)===a)&&(ht?l._workInProgressVersionPrimary=y:l._workInProgressVersionSecondary=y,As.push(l))),a)return f(l._source);throw As.push(l),Error(v(350))}function no(a,l,f,y){var b=$n;if(b===null)throw Error(v(349));var T=l._getVersion,N=T(l._source),B=ua.current,ne=B.useState(function(){return Ms(b,l,f)}),xe=ne[1],Fe=ne[0];ne=_n;var Ke=a.memoizedState,Ae=Ke.refs,Pt=Ae.getSnapshot,qt=Ke.source;Ke=Ke.subscribe;var Mi=Wt;return a.memoizedState={refs:Ae,source:l,subscribe:y},B.useEffect(function(){Ae.getSnapshot=f,Ae.setSnapshot=xe;var Q=T(l._source);if(!Ui(N,Q)){Q=f(l._source),Ui(Fe,Q)||(xe(Q),Q=Cn(Mi),b.mutableReadLanes|=Q&b.pendingLanes),Q=b.mutableReadLanes,b.entangledLanes|=Q;for(var V=b.entanglements,ie=Q;0<ie;){var Re=31-Gr(ie),Be=1<<Re;V[Re]|=Q,ie&=~Be}}},[f,l,y]),B.useEffect(function(){return y(l._source,function(){var Q=Ae.getSnapshot,V=Ae.setSnapshot;try{V(Q(l._source));var ie=Cn(Mi);b.mutableReadLanes|=ie&b.pendingLanes}catch(Re){V(function(){throw Re})}})},[l,y]),Ui(Pt,f)&&Ui(qt,l)&&Ui(Ke,y)||(a={pending:null,dispatch:null,lastRenderedReducer:vr,lastRenderedState:Fe},a.dispatch=xe=Wn.bind(null,Wt,a),ne.queue=a,ne.baseQueue=null,Fe=Ms(b,l,f),ne.memoizedState=ne.baseState=Fe),Fe}function pc(a,l,f){var y=es();return no(y,a,l,f)}function ts(a){var l=Jr();return typeof a=="function"&&(a=a()),l.memoizedState=l.baseState=a,a=l.queue={pending:null,dispatch:null,lastRenderedReducer:vr,lastRenderedState:a},a=a.dispatch=Wn.bind(null,Wt,a),[l.memoizedState,a]}function io(a,l,f,y){return a={tag:a,create:l,destroy:f,deps:y,next:null},l=Wt.updateQueue,l===null?(l={lastEffect:null},Wt.updateQueue=l,l.lastEffect=a.next=a):(f=l.lastEffect,f===null?l.lastEffect=a.next=a:(y=f.next,f.next=a,a.next=y,l.lastEffect=a)),a}function Os(a){var l=Jr();return a={current:a},l.memoizedState=a}function ro(){return es().memoizedState}function Or(a,l,f,y){var b=Jr();Wt.flags|=a,b.memoizedState=io(1|l,f,void 0,y===void 0?null:y)}function Bl(a,l,f,y){var b=es();y=y===void 0?null:y;var T=void 0;if(Vn!==null){var N=Vn.memoizedState;if(T=N.destroy,y!==null&&hc(y,N.deps)){io(l,f,T,y);return}}Wt.flags|=a,b.memoizedState=io(1|l,f,T,y)}function so(a,l){return Or(516,4,a,l)}function fa(a,l){return Bl(516,4,a,l)}function vc(a,l){return Bl(4,2,a,l)}function mc(a,l){if(typeof l=="function")return a=a(),l(a),function(){l(null)};if(l!=null)return a=a(),l.current=a,function(){l.current=null}}function ao(a,l,f){return f=f!=null?f.concat([a]):null,Bl(4,2,mc.bind(null,l,a),f)}function Hl(){}function Dr(a,l){var f=es();l=l===void 0?null:l;var y=f.memoizedState;return y!==null&&l!==null&&hc(l,y[1])?y[0]:(f.memoizedState=[a,l],a)}function Dd(a,l){var f=es();l=l===void 0?null:l;var y=f.memoizedState;return y!==null&&l!==null&&hc(l,y[1])?y[0]:(a=a(),f.memoizedState=[a,l],a)}function ue(a,l){var f=sa();Cr(98>f?98:f,function(){a(!0)}),Cr(97<f?97:f,function(){var y=ei.transition;ei.transition=1;try{a(!1),l()}finally{ei.transition=y}})}function Wn(a,l,f){var y=pi(),b=Cn(a),T={lane:b,action:f,eagerReducer:null,eagerState:null,next:null},N=l.pending;if(N===null?T.next=T:(T.next=N.next,N.next=T),l.pending=T,N=a.alternate,a===Wt||N!==null&&N===Wt)eo=Il=!0;else{if(a.lanes===0&&(N===null||N.lanes===0)&&(N=l.lastRenderedReducer,N!==null))try{var B=l.lastRenderedState,ne=N(B,f);if(T.eagerReducer=N,T.eagerState=ne,Ui(ne,B))return}catch{}finally{}Nr(a,b,y)}}var Tt={readContext:Ei,useCallback:di,useContext:di,useEffect:di,useImperativeHandle:di,useLayoutEffect:di,useMemo:di,useReducer:di,useRef:di,useState:di,useDebugValue:di,useDeferredValue:di,useTransition:di,useMutableSource:di,useOpaqueIdentifier:di,unstable_isNewReconciler:!1},oo={readContext:Ei,useCallback:function(a,l){return Jr().memoizedState=[a,l===void 0?null:l],a},useContext:Ei,useEffect:so,useImperativeHandle:function(a,l,f){return f=f!=null?f.concat([a]):null,Or(4,2,mc.bind(null,l,a),f)},useLayoutEffect:function(a,l){return Or(4,2,a,l)},useMemo:function(a,l){var f=Jr();return l=l===void 0?null:l,a=a(),f.memoizedState=[a,l],a},useReducer:function(a,l,f){var y=Jr();return l=f!==void 0?f(l):l,y.memoizedState=y.baseState=l,a=y.queue={pending:null,dispatch:null,lastRenderedReducer:a,lastRenderedState:l},a=a.dispatch=Wn.bind(null,Wt,a),[y.memoizedState,a]},useRef:Os,useState:ts,useDebugValue:Hl,useDeferredValue:function(a){var l=ts(a),f=l[0],y=l[1];return so(function(){var b=ei.transition;ei.transition=1;try{y(a)}finally{ei.transition=b}},[a]),f},useTransition:function(){var a=ts(!1),l=a[0];return a=ue.bind(null,a[1]),Os(a),[a,l]},useMutableSource:function(a,l,f){var y=Jr();return y.memoizedState={refs:{getSnapshot:l,setSnapshot:null},source:a,subscribe:f},no(y,a,l,f)},useOpaqueIdentifier:function(){if(wi){var a=!1,l=j(function(){throw a||(a=!0,f(z())),Error(v(355))}),f=ts(l)[1];return!(Wt.mode&2)&&(Wt.flags|=516,io(5,function(){f(z())},void 0,null)),l}return l=z(),ts(l),l},unstable_isNewReconciler:!1},Vl={readContext:Ei,useCallback:Dr,useContext:Ei,useEffect:fa,useImperativeHandle:ao,useLayoutEffect:vc,useMemo:Dd,useReducer:ca,useRef:ro,useState:function(){return ca(vr)},useDebugValue:Hl,useDeferredValue:function(a){var l=ca(vr),f=l[0],y=l[1];return fa(function(){var b=ei.transition;ei.transition=1;try{y(a)}finally{ei.transition=b}},[a]),f},useTransition:function(){var a=ca(vr)[0];return[ro().current,a]},useMutableSource:pc,useOpaqueIdentifier:function(){return ca(vr)[0]},unstable_isNewReconciler:!1},Wl={readContext:Ei,useCallback:Dr,useContext:Ei,useEffect:fa,useImperativeHandle:ao,useLayoutEffect:vc,useMemo:Dd,useReducer:to,useRef:ro,useState:function(){return to(vr)},useDebugValue:Hl,useDeferredValue:function(a){var l=to(vr),f=l[0],y=l[1];return fa(function(){var b=ei.transition;ei.transition=1;try{y(a)}finally{ei.transition=b}},[a]),f},useTransition:function(){var a=to(vr)[0];return[ro().current,a]},useMutableSource:pc,useOpaqueIdentifier:function(){return to(vr)[0]},unstable_isNewReconciler:!1},Ld=g.ReactCurrentOwner,Bi=!1;function ti(a,l,f,y){l.child=a===null?pr(l,null,f,y):Rs(l,a.child,f,y)}function $l(a,l,f,y,b){f=f.render;var T=l.ref;return Ts(l,b),y=Fl(a,l,f,y,T,b),a!==null&&!Bi?(l.updateQueue=a.updateQueue,l.flags&=-517,a.lanes&=~b,Pr(a,l,b)):(l.flags|=1,ti(a,l,y,b),l.child)}function gc(a,l,f,y,b,T){if(a===null){var N=f.type;return typeof N=="function"&&!Pc(N)&&N.defaultProps===void 0&&f.compare===null&&f.defaultProps===void 0?(l.tag=15,l.type=N,Ds(a,l,N,y,b,T)):(a=zo(f.type,null,y,l,l.mode,T),a.ref=l.ref,a.return=l,l.child=a)}return N=a.child,!(b&T)&&(b=N.memoizedProps,f=f.compare,f=f!==null?f:Rl,f(b,y)&&a.ref===l.ref)?Pr(a,l,T):(l.flags|=1,a=Ft(N,y),a.ref=l.ref,a.return=l,l.child=a)}function Ds(a,l,f,y,b,T){if(a!==null&&Rl(a.memoizedProps,y)&&a.ref===l.ref)if(Bi=!1,(T&b)!==0)a.flags&16384&&(Bi=!0);else return l.lanes=a.lanes,Pr(a,l,T);return lo(a,l,f,y,T)}function da(a,l,f){var y=l.pendingProps,b=y.children,T=a!==null?a.memoizedState:null;if(y.mode==="hidden"||y.mode==="unstable-defer-without-hiding")if(!(l.mode&4))l.memoizedState={baseLanes:0},In(l,f);else if(f&1073741824)l.memoizedState={baseLanes:0},In(l,T!==null?T.baseLanes:f);else return a=T!==null?T.baseLanes|f:f,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:a},In(l,a),null;else T!==null?(y=T.baseLanes|f,l.memoizedState=null):y=f,In(l,y);return ti(a,l,b,f),l.child}function Ls(a,l){var f=l.ref;(a===null&&f!==null||a!==null&&a.ref!==f)&&(l.flags|=128)}function lo(a,l,f,y,b){var T=Jt(f)?Nn:ln.current;return T=cr(l,T),Ts(l,b),f=Fl(a,l,f,y,T,b),a!==null&&!Bi?(l.updateQueue=a.updateQueue,l.flags&=-517,a.lanes&=~b,Pr(a,l,b)):(l.flags|=1,ti(a,l,f,b),l.child)}function yc(a,l,f,y,b){if(Jt(f)){var T=!0;$a(l)}else T=!1;if(Ts(l,b),l.stateNode===null)a!==null&&(a.alternate=null,l.alternate=null,l.flags|=2),Od(l,f,y),kl(l,f,y,b),y=!0;else if(a===null){var N=l.stateNode,B=l.memoizedProps;N.props=B;var ne=N.context,xe=f.contextType;typeof xe=="object"&&xe!==null?xe=Ei(xe):(xe=Jt(f)?Nn:ln.current,xe=cr(l,xe));var Fe=f.getDerivedStateFromProps,Ke=typeof Fe=="function"||typeof N.getSnapshotBeforeUpdate=="function";Ke||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(B!==y||ne!==xe)&&Pl(l,N,y,xe),Rr=!1;var Ae=l.memoizedState;N.state=Ae,Cs(l,y,N,b),ne=l.memoizedState,B!==y||Ae!==ne||Bn.current||Rr?(typeof Fe=="function"&&(oa(l,f,Fe,y),ne=l.memoizedState),(B=Rr||la(l,f,B,y,Ae,ne,xe))?(Ke||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(l.flags|=4)):(typeof N.componentDidMount=="function"&&(l.flags|=4),l.memoizedProps=y,l.memoizedState=ne),N.props=y,N.state=ne,N.context=xe,y=B):(typeof N.componentDidMount=="function"&&(l.flags|=4),y=!1)}else{N=l.stateNode,Ji(a,l),B=l.memoizedProps,xe=l.type===l.elementType?B:Zi(l.type,B),N.props=xe,Ke=l.pendingProps,Ae=N.context,ne=f.contextType,typeof ne=="object"&&ne!==null?ne=Ei(ne):(ne=Jt(f)?Nn:ln.current,ne=cr(l,ne));var Pt=f.getDerivedStateFromProps;(Fe=typeof Pt=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(B!==Ke||Ae!==ne)&&Pl(l,N,y,ne),Rr=!1,Ae=l.memoizedState,N.state=Ae,Cs(l,y,N,b);var qt=l.memoizedState;B!==Ke||Ae!==qt||Bn.current||Rr?(typeof Pt=="function"&&(oa(l,f,Pt,y),qt=l.memoizedState),(xe=Rr||la(l,f,xe,y,Ae,qt,ne))?(Fe||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(y,qt,ne),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(y,qt,ne)),typeof N.componentDidUpdate=="function"&&(l.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(l.flags|=256)):(typeof N.componentDidUpdate!="function"||B===a.memoizedProps&&Ae===a.memoizedState||(l.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||B===a.memoizedProps&&Ae===a.memoizedState||(l.flags|=256),l.memoizedProps=y,l.memoizedState=qt),N.props=y,N.state=qt,N.context=ne,y=xe):(typeof N.componentDidUpdate!="function"||B===a.memoizedProps&&Ae===a.memoizedState||(l.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||B===a.memoizedProps&&Ae===a.memoizedState||(l.flags|=256),y=!1)}return ql(a,l,f,y,T,b)}function ql(a,l,f,y,b,T){Ls(a,l);var N=(l.flags&64)!==0;if(!y&&!N)return b&&xd(l,f,!1),Pr(a,l,T);y=l.stateNode,Ld.current=l;var B=N&&typeof f.getDerivedStateFromError!="function"?null:y.render();return l.flags|=1,a!==null&&N?(l.child=Rs(l,a.child,null,T),l.child=Rs(l,null,B,T)):ti(a,l,B,T),l.memoizedState=y.state,b&&xd(l,f,!0),l.child}function Yl(a){var l=a.stateNode;l.pendingContext?Sd(a,l.pendingContext,l.pendingContext!==l.context):l.context&&Sd(a,l.context,!1),er(a,l.containerInfo)}var Ti={dehydrated:null,retryLane:0};function sn(a,l,f){var y=l.pendingProps,b=rn.current,T=!1,N;return(N=(l.flags&64)!==0)||(N=a!==null&&a.memoizedState===null?!1:(b&2)!==0),N?(T=!0,l.flags&=-65):a!==null&&a.memoizedState===null||y.fallback===void 0||y.unstable_avoidThisFallback===!0||(b|=1),on(rn,b&1),a===null?(y.fallback!==void 0&&Ul(l),a=y.children,b=y.fallback,T?(a=Sc(l,a,b,f),l.child.memoizedState={baseLanes:f},l.memoizedState=Ti,a):typeof y.unstable_expectedLoadTime=="number"?(a=Sc(l,a,b,f),l.child.memoizedState={baseLanes:f},l.memoizedState=Ti,l.lanes=33554432,a):(f=wa({mode:"visible",children:a},l.mode,f,null),f.return=l,l.child=f)):a.memoizedState!==null?T?(y=xc(a,l,y.children,y.fallback,f),T=l.child,b=a.child.memoizedState,T.memoizedState=b===null?{baseLanes:f}:{baseLanes:b.baseLanes|f},T.childLanes=a.childLanes&~f,l.memoizedState=Ti,y):(f=bc(a,l,y.children,f),l.memoizedState=null,f):T?(y=xc(a,l,y.children,y.fallback,f),T=l.child,b=a.child.memoizedState,T.memoizedState=b===null?{baseLanes:f}:{baseLanes:b.baseLanes|f},T.childLanes=a.childLanes&~f,l.memoizedState=Ti,y):(f=bc(a,l,y.children,f),l.memoizedState=null,f)}function Sc(a,l,f,y){var b=a.mode,T=a.child;return l={mode:"hidden",children:l},!(b&2)&&T!==null?(T.childLanes=0,T.pendingProps=l):T=wa(l,b,0,null),f=js(f,b,y,null),T.return=a,f.return=a,T.sibling=f,a.child=T,f}function bc(a,l,f,y){var b=a.child;return a=b.sibling,f=Ft(b,{mode:"visible",children:f}),!(l.mode&2)&&(f.lanes=y),f.return=l,f.sibling=null,a!==null&&(a.nextEffect=null,a.flags=8,l.firstEffect=l.lastEffect=a),l.child=f}function xc(a,l,f,y,b){var T=l.mode,N=a.child;a=N.sibling;var B={mode:"hidden",children:f};return!(T&2)&&l.child!==N?(f=l.child,f.childLanes=0,f.pendingProps=B,N=f.lastEffect,N!==null?(l.firstEffect=f.firstEffect,l.lastEffect=N,N.nextEffect=null):l.firstEffect=l.lastEffect=null):f=Ft(N,B),a!==null?y=Ft(a,y):(y=js(y,T,b,null),y.flags|=2),y.return=l,f.return=l,f.sibling=y,l.child=f,y}function It(a,l){a.lanes|=l;var f=a.alternate;f!==null&&(f.lanes|=l),cc(a.return,l)}function Lr(a,l,f,y,b,T){var N=a.memoizedState;N===null?a.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:y,tail:f,tailMode:b,lastEffect:T}:(N.isBackwards=l,N.rendering=null,N.renderingStartTime=0,N.last=y,N.tail=f,N.tailMode=b,N.lastEffect=T)}function Pd(a,l,f){var y=l.pendingProps,b=y.revealOrder,T=y.tail;if(ti(a,l,y.children,f),y=rn.current,y&2)y=y&1|2,l.flags|=64;else{if(a!==null&&a.flags&64)e:for(a=l.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&It(a,f);else if(a.tag===19)It(a,f);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===l)break e;for(;a.sibling===null;){if(a.return===null||a.return===l)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}y&=1}if(on(rn,y),!(l.mode&2))l.memoizedState=null;else switch(b){case"forwards":for(f=l.child,b=null;f!==null;)a=f.alternate,a!==null&&Mr(a)===null&&(b=f),f=f.sibling;f=b,f===null?(b=l.child,l.child=null):(b=f.sibling,f.sibling=null),Lr(l,!1,b,f,T,l.lastEffect);break;case"backwards":for(f=null,b=l.child,l.child=null;b!==null;){if(a=b.alternate,a!==null&&Mr(a)===null){l.child=b;break}a=b.sibling,b.sibling=f,f=b,b=a}Lr(l,!0,f,null,T,l.lastEffect);break;case"together":Lr(l,!1,null,null,void 0,l.lastEffect);break;default:l.memoizedState=null}return l.child}function Pr(a,l,f){if(a!==null&&(l.dependencies=a.dependencies),xo|=l.lanes,f&l.childLanes){if(a!==null&&l.child!==a.child)throw Error(v(153));if(l.child!==null){for(a=l.child,f=Ft(a,a.pendingProps),l.child=f,f.return=l;a.sibling!==null;)a=a.sibling,f=f.sibling=Ft(a,a.pendingProps),f.return=l;f.sibling=null}return l.child}return null}function hi(a){a.flags|=4}var uo,co,Ql,Gl;if(ft)uo=function(a,l){for(var f=l.child;f!==null;){if(f.tag===5||f.tag===6)pt(a,f.stateNode);else if(f.tag!==4&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===l)break;for(;f.sibling===null;){if(f.return===null||f.return===l)return;f=f.return}f.sibling.return=f.return,f=f.sibling}},co=function(){},Ql=function(a,l,f,y,b){if(a=a.memoizedProps,a!==y){var T=l.stateNode,N=un(jt.current);f=Kt(T,f,a,y,b,N),(l.updateQueue=f)&&hi(l)}},Gl=function(a,l,f,y){f!==y&&hi(l)};else if(mn){uo=function(a,l,f,y){for(var b=l.child;b!==null;){if(b.tag===5){var T=b.stateNode;f&&y&&(T=ml(T,b.type,b.memoizedProps,b)),pt(a,T)}else if(b.tag===6)T=b.stateNode,f&&y&&(T=Qr(T,b.memoizedProps,b)),pt(a,T);else if(b.tag!==4){if(b.tag===13&&b.flags&4&&(T=b.memoizedState!==null)){var N=b.child;if(N!==null&&(N.child!==null&&(N.child.return=N,uo(a,N,!0,T)),T=N.sibling,T!==null)){T.return=b,b=T;continue}}if(b.child!==null){b.child.return=b,b=b.child;continue}}if(b===l)break;for(;b.sibling===null;){if(b.return===null||b.return===l)return;b=b.return}b.sibling.return=b.return,b=b.sibling}};var Ec=function(a,l,f,y){for(var b=l.child;b!==null;){if(b.tag===5){var T=b.stateNode;f&&y&&(T=ml(T,b.type,b.memoizedProps,b)),ws(a,T)}else if(b.tag===6)T=b.stateNode,f&&y&&(T=Qr(T,b.memoizedProps,b)),ws(a,T);else if(b.tag!==4){if(b.tag===13&&b.flags&4&&(T=b.memoizedState!==null)){var N=b.child;if(N!==null&&(N.child!==null&&(N.child.return=N,Ec(a,N,!0,T)),T=N.sibling,T!==null)){T.return=b,b=T;continue}}if(b.child!==null){b.child.return=b,b=b.child;continue}}if(b===l)break;for(;b.sibling===null;){if(b.return===null||b.return===l)return;b=b.return}b.sibling.return=b.return,b=b.sibling}};co=function(a){var l=a.stateNode;if(a.firstEffect!==null){var f=l.containerInfo,y=Wa(f);Ec(y,a,!1,!1),l.pendingChildren=y,hi(a),Xi(f,y)}},Ql=function(a,l,f,y,b){var T=a.stateNode,N=a.memoizedProps;if((a=l.firstEffect===null)&&N===y)l.stateNode=T;else{var B=l.stateNode,ne=un(jt.current),xe=null;N!==y&&(xe=Kt(B,f,N,y,b,ne)),a&&xe===null?l.stateNode=T:(T=ia(T,xe,f,N,y,l,a,B),vn(T,f,y,b,ne)&&hi(l),l.stateNode=T,a?hi(l):uo(T,l,!1,!1))}},Gl=function(a,l,f,y){f!==y?(a=un(Kr.current),f=un(jt.current),l.stateNode=ct(y,a,f,l),hi(l)):l.stateNode=a.stateNode}}else co=function(){},Ql=function(){},Gl=function(){};function fo(a,l){if(!wi)switch(a.tailMode){case"hidden":l=a.tail;for(var f=null;l!==null;)l.alternate!==null&&(f=l),l=l.sibling;f===null?a.tail=null:f.sibling=null;break;case"collapsed":f=a.tail;for(var y=null;f!==null;)f.alternate!==null&&(y=f),f=f.sibling;y===null?l||a.tail===null?a.tail=null:a.tail.sibling=null:y.sibling=null}}function kd(a,l,f){var y=l.pendingProps;switch(l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:return Jt(l.type)&&Sl(),null;case 3:return Jn(),mt(Bn),mt(ln),jl(),y=l.stateNode,y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(a===null||a.child===null)&&(Ja(l)?hi(l):y.hydrate||(l.flags|=256)),co(l),null;case 5:Zr(l);var b=un(Kr.current);if(f=l.type,a!==null&&l.stateNode!=null)Ql(a,l,f,y,b),a.ref!==l.ref&&(l.flags|=128);else{if(!y){if(l.stateNode===null)throw Error(v(166));return null}if(a=un(jt.current),Ja(l)){if(!Qt)throw Error(v(175));a=we(l.stateNode,l.type,l.memoizedProps,b,a,l),l.updateQueue=a,a!==null&&hi(l)}else{var T=ut(f,y,b,a,l);uo(T,l,!1,!1),l.stateNode=T,vn(T,f,y,b,a)&&hi(l)}l.ref!==null&&(l.flags|=128)}return null;case 6:if(a&&l.stateNode!=null)Gl(a,l,a.memoizedProps,y);else{if(typeof y!="string"&&l.stateNode===null)throw Error(v(166));if(a=un(Kr.current),b=un(jt.current),Ja(l)){if(!Qt)throw Error(v(176));Qe(l.stateNode,l.memoizedProps,l)&&hi(l)}else l.stateNode=ct(y,a,b,l)}return null;case 13:return mt(rn),y=l.memoizedState,l.flags&64?(l.lanes=f,l):(y=y!==null,b=!1,a===null?l.memoizedProps.fallback!==void 0&&Ja(l):b=a.memoizedState!==null,y&&!b&&l.mode&2&&(a===null&&l.memoizedProps.unstable_avoidThisFallback!==!0||rn.current&1?Dn===0&&(Dn=3):((Dn===0||Dn===3)&&(Dn=4),$n===null||!(xo&134217727)&&!(va&134217727)||zs($n,zt))),mn&&y&&(l.flags|=4),ft&&(y||b)&&(l.flags|=4),null);case 4:return Jn(),co(l),a===null&&st(l.stateNode.containerInfo),null;case 10:return Dl(l),null;case 17:return Jt(l.type)&&Sl(),null;case 19:if(mt(rn),y=l.memoizedState,y===null)return null;if(b=(l.flags&64)!==0,T=y.rendering,T===null)if(b)fo(y,!1);else{if(Dn!==0||a!==null&&a.flags&64)for(a=l.child;a!==null;){if(T=Mr(a),T!==null){for(l.flags|=64,fo(y,!1),a=T.updateQueue,a!==null&&(l.updateQueue=a,l.flags|=4),y.lastEffect===null&&(l.firstEffect=null),l.lastEffect=y.lastEffect,a=f,y=l.child;y!==null;)b=y,f=a,b.flags&=2,b.nextEffect=null,b.firstEffect=null,b.lastEffect=null,T=b.alternate,T===null?(b.childLanes=0,b.lanes=f,b.child=null,b.memoizedProps=null,b.memoizedState=null,b.updateQueue=null,b.dependencies=null,b.stateNode=null):(b.childLanes=T.childLanes,b.lanes=T.lanes,b.child=T.child,b.memoizedProps=T.memoizedProps,b.memoizedState=T.memoizedState,b.updateQueue=T.updateQueue,b.type=T.type,f=T.dependencies,b.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext}),y=y.sibling;return on(rn,rn.current&1|2),l.child}a=a.sibling}y.tail!==null&&On()>iu&&(l.flags|=64,b=!0,fo(y,!1),l.lanes=33554432)}else{if(!b)if(a=Mr(T),a!==null){if(l.flags|=64,b=!0,a=a.updateQueue,a!==null&&(l.updateQueue=a,l.flags|=4),fo(y,!0),y.tail===null&&y.tailMode==="hidden"&&!T.alternate&&!wi)return l=l.lastEffect=y.lastEffect,l!==null&&(l.nextEffect=null),null}else 2*On()-y.renderingStartTime>iu&&f!==1073741824&&(l.flags|=64,b=!0,fo(y,!1),l.lanes=33554432);y.isBackwards?(T.sibling=l.child,l.child=T):(a=y.last,a!==null?a.sibling=T:l.child=T,y.last=T)}return y.tail!==null?(a=y.tail,y.rendering=a,y.tail=a.sibling,y.lastEffect=l.lastEffect,y.renderingStartTime=On(),a.sibling=null,l=rn.current,on(rn,b?l&1|2:l&1),a):null;case 23:case 24:return xn(),a!==null&&a.memoizedState!==null!=(l.memoizedState!==null)&&y.mode!=="unstable-defer-without-hiding"&&(l.flags|=4),null}throw Error(v(156,l.tag))}function zd(a){switch(a.tag){case 1:Jt(a.type)&&Sl();var l=a.flags;return l&4096?(a.flags=l&-4097|64,a):null;case 3:if(Jn(),mt(Bn),mt(ln),jl(),l=a.flags,l&64)throw Error(v(285));return a.flags=l&-4097|64,a;case 5:return Zr(a),null;case 13:return mt(rn),l=a.flags,l&4096?(a.flags=l&-4097|64,a):null;case 19:return mt(rn),null;case 4:return Jn(),null;case 10:return Dl(a),null;case 23:case 24:return xn(),null;default:return null}}function wc(a,l){try{var f="",y=l;do f+=Sv(y),y=y.return;while(y);var b=f}catch(T){b=`
|
|
206
|
+
Error generating stack: `+T.message+`
|
|
207
|
+
`+T.stack}return{value:a,source:l,stack:b}}function ha(a,l){try{console.error(l.value)}catch(f){setTimeout(function(){throw f})}}var bv=typeof WeakMap=="function"?WeakMap:Map;function Nd(a,l,f){f=dr(-1,f),f.tag=3,f.payload={element:null};var y=l.value;return f.callback=function(){wo||(wo=!0,nr=y),ha(a,l)},f}function _d(a,l,f){f=dr(-1,f),f.tag=3;var y=a.type.getDerivedStateFromError;if(typeof y=="function"){var b=l.value;f.payload=function(){return ha(a,l),y(b)}}var T=a.stateNode;return T!==null&&typeof T.componentDidCatch=="function"&&(f.callback=function(){typeof y!="function"&&(jn===null?jn=new Set([this]):jn.add(this),ha(a,l));var N=l.stack;this.componentDidCatch(l.value,{componentStack:N!==null?N:""})}),f}var xv=typeof WeakSet=="function"?WeakSet:Set;function Ud(a){var l=a.ref;if(l!==null)if(typeof l=="function")try{l(null)}catch(f){sr(a,f)}else l.current=null}function ni(a,l){switch(l.tag){case 0:case 11:case 15:case 22:return;case 1:if(l.flags&256&&a!==null){var f=a.memoizedProps,y=a.memoizedState;a=l.stateNode,l=a.getSnapshotBeforeUpdate(l.elementType===l.type?f:Zi(l.type,f),y),a.__reactInternalSnapshotBeforeUpdate=l}return;case 3:ft&&l.flags&256&&xi(l.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(v(163))}function ns(a,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var f=l=l.next;do{if((f.tag&a)===a){var y=f.destroy;f.destroy=void 0,y!==void 0&&y()}f=f.next}while(f!==l)}}function Ev(a,l,f){switch(f.tag){case 0:case 11:case 15:case 22:if(l=f.updateQueue,l=l!==null?l.lastEffect:null,l!==null){a=l=l.next;do{if((a.tag&3)===3){var y=a.create;a.destroy=y()}a=a.next}while(a!==l)}if(l=f.updateQueue,l=l!==null?l.lastEffect:null,l!==null){a=l=l.next;do{var b=a;y=b.next,b=b.tag,b&4&&b&1&&(Dc(f,a),au(f,a)),a=y}while(a!==l)}return;case 1:a=f.stateNode,f.flags&4&&(l===null?a.componentDidMount():(y=f.elementType===f.type?l.memoizedProps:Zi(f.type,l.memoizedProps),a.componentDidUpdate(y,l.memoizedState,a.__reactInternalSnapshotBeforeUpdate))),l=f.updateQueue,l!==null&&Xa(f,l,a);return;case 3:if(l=f.updateQueue,l!==null){if(a=null,f.child!==null)switch(f.child.tag){case 5:a=Ue(f.child.stateNode);break;case 1:a=f.child.stateNode}Xa(f,l,a)}return;case 5:a=f.stateNode,l===null&&f.flags&4&&Lt(a,f.type,f.memoizedProps,f);return;case 6:return;case 4:return;case 12:return;case 13:Qt&&f.memoizedState===null&&(f=f.alternate,f!==null&&(f=f.memoizedState,f!==null&&(f=f.dehydrated,f!==null&&vt(f))));return;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(v(163))}function Un(a,l){if(ft)for(var f=a;;){if(f.tag===5){var y=f.stateNode;l?qr(y):Va(f.stateNode,f.memoizedProps)}else if(f.tag===6)y=f.stateNode,l?Ha(y):Yr(y,f.memoizedProps);else if((f.tag!==23&&f.tag!==24||f.memoizedState===null||f===a)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===a)break;for(;f.sibling===null;){if(f.return===null||f.return===a)return;f=f.return}f.sibling.return=f.return,f=f.sibling}}function is(a,l){if(Ni&&typeof Ni.onCommitFiberUnmount=="function")try{Ni.onCommitFiberUnmount(tc,l)}catch{}switch(l.tag){case 0:case 11:case 14:case 15:case 22:if(a=l.updateQueue,a!==null&&(a=a.lastEffect,a!==null)){var f=a=a.next;do{var y=f,b=y.destroy;if(y=y.tag,b!==void 0)if(y&4)Dc(l,f);else{y=l;try{b()}catch(T){sr(y,T)}}f=f.next}while(f!==a)}break;case 1:if(Ud(l),a=l.stateNode,typeof a.componentWillUnmount=="function")try{a.props=l.memoizedProps,a.state=l.memoizedState,a.componentWillUnmount()}catch(T){sr(l,T)}break;case 5:Ud(l);break;case 4:ft?Id(a,l):mn&&mn&&(l=l.stateNode.containerInfo,a=Wa(l),vl(l,a))}}function Ct(a,l){for(var f=l;;)if(is(a,f),f.child===null||ft&&f.tag===4){if(f===l)break;for(;f.sibling===null;){if(f.return===null||f.return===l)return;f=f.return}f.sibling.return=f.return,f=f.sibling}else f.child.return=f,f=f.child}function ho(a){a.alternate=null,a.child=null,a.dependencies=null,a.firstEffect=null,a.lastEffect=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.return=null,a.updateQueue=null}function wv(a){return a.tag===5||a.tag===3||a.tag===4}function jd(a){if(ft){e:{for(var l=a.return;l!==null;){if(wv(l))break e;l=l.return}throw Error(v(160))}var f=l;switch(l=f.stateNode,f.tag){case 5:var y=!1;break;case 3:l=l.containerInfo,y=!0;break;case 4:l=l.containerInfo,y=!0;break;default:throw Error(v(161))}f.flags&16&&(bi(l),f.flags&=-17);e:t:for(f=a;;){for(;f.sibling===null;){if(f.return===null||wv(f.return)){f=null;break e}f=f.return}for(f.sibling.return=f.return,f=f.sibling;f.tag!==5&&f.tag!==6&&f.tag!==18;){if(f.flags&2||f.child===null||f.tag===4)continue t;f.child.return=f,f=f.child}if(!(f.flags&2)){f=f.stateNode;break e}}y?po(a,f,l):pa(a,f,l)}}function po(a,l,f){var y=a.tag,b=y===5||y===6;if(b)a=b?a.stateNode:a.stateNode.instance,l?Zt(f,a,l):Pe(f,a);else if(y!==4&&(a=a.child,a!==null))for(po(a,l,f),a=a.sibling;a!==null;)po(a,l,f),a=a.sibling}function pa(a,l,f){var y=a.tag,b=y===5||y===6;if(b)a=b?a.stateNode:a.stateNode.instance,l?an(f,a,l):Te(f,a);else if(y!==4&&(a=a.child,a!==null))for(pa(a,l,f),a=a.sibling;a!==null;)pa(a,l,f),a=a.sibling}function Id(a,l){for(var f=l,y=!1,b,T;;){if(!y){y=f.return;e:for(;;){if(y===null)throw Error(v(160));switch(b=y.stateNode,y.tag){case 5:T=!1;break e;case 3:b=b.containerInfo,T=!0;break e;case 4:b=b.containerInfo,T=!0;break e}y=y.return}y=!0}if(f.tag===5||f.tag===6)Ct(a,f),T?nn(b,f.stateNode):Fn(b,f.stateNode);else if(f.tag===4){if(f.child!==null){b=f.stateNode.containerInfo,T=!0,f.child.return=f,f=f.child;continue}}else if(is(a,f),f.child!==null){f.child.return=f,f=f.child;continue}if(f===l)break;for(;f.sibling===null;){if(f.return===null||f.return===l)return;f=f.return,f.tag===4&&(y=!1)}f.sibling.return=f.return,f=f.sibling}}function Xl(a,l){if(ft){switch(l.tag){case 0:case 11:case 14:case 15:case 22:ns(3,l);return;case 1:return;case 5:var f=l.stateNode;if(f!=null){var y=l.memoizedProps;a=a!==null?a.memoizedProps:y;var b=l.type,T=l.updateQueue;l.updateQueue=null,T!==null&&tt(f,T,b,a,y,l)}return;case 6:if(l.stateNode===null)throw Error(v(162));f=l.memoizedProps,rt(l.stateNode,a!==null?a.memoizedProps:f,f);return;case 3:Qt&&(l=l.stateNode,l.hydrate&&(l.hydrate=!1,At(l.containerInfo)));return;case 12:return;case 13:Fd(l),Kl(l);return;case 19:Kl(l);return;case 17:return;case 23:case 24:Un(l,l.memoizedState!==null);return}throw Error(v(163))}switch(l.tag){case 0:case 11:case 14:case 15:case 22:ns(3,l);return;case 12:return;case 13:Fd(l),Kl(l);return;case 19:Kl(l);return;case 3:Qt&&(f=l.stateNode,f.hydrate&&(f.hydrate=!1,At(f.containerInfo)));break;case 23:case 24:return}e:if(mn){switch(l.tag){case 1:case 5:case 6:case 20:break e;case 3:case 4:l=l.stateNode,vl(l.containerInfo,l.pendingChildren);break e}throw Error(v(163))}}function Fd(a){a.memoizedState!==null&&(Eo=On(),ft&&Un(a.child,!0))}function Kl(a){var l=a.updateQueue;if(l!==null){a.updateQueue=null;var f=a.stateNode;f===null&&(f=a.stateNode=new xv),l.forEach(function(y){var b=ou.bind(null,a,y);f.has(y)||(f.add(y),y.then(b,b))})}}function Tv(a,l){return a!==null&&(a=a.memoizedState,a===null||a.dehydrated!==null)?(l=l.memoizedState,l!==null&&l.dehydrated===null):!1}var vo=0,Zl=1,Jl=2,mo=3,eu=4;if(typeof Symbol=="function"&&Symbol.for){var go=Symbol.for;vo=go("selector.component"),Zl=go("selector.has_pseudo_class"),Jl=go("selector.role"),mo=go("selector.test_id"),eu=go("selector.text")}function Tc(a){var l=Gi(a);if(l!=null){if(typeof l.memoizedProps["data-testname"]!="string")throw Error(v(364));return l}if(a=gn(a),a===null)throw Error(v(362));return a.stateNode.current}function Cc(a,l){switch(l.$$typeof){case vo:if(a.type===l.value)return!0;break;case Zl:e:{l=l.value,a=[a,0];for(var f=0;f<a.length;){var y=a[f++],b=a[f++],T=l[b];if(y.tag!==5||!at(y)){for(;T!=null&&Cc(y,T);)b++,T=l[b];if(b===l.length){l=!0;break e}else for(y=y.child;y!==null;)a.push(y,b),y=y.sibling}}l=!1}return l;case Jl:if(a.tag===5&&ui(a.stateNode,l.value))return!0;break;case eu:if((a.tag===5||a.tag===6)&&(a=be(a),a!==null&&0<=a.indexOf(l.value)))return!0;break;case mo:if(a.tag===5&&(a=a.memoizedProps["data-testname"],typeof a=="string"&&a.toLowerCase()===l.value.toLowerCase()))return!0;break;default:throw Error(v(365,l))}return!1}function yo(a){switch(a.$$typeof){case vo:return"<"+(Ce(a.value)||"Unknown")+">";case Zl:return":has("+(yo(a)||"")+")";case Jl:return'[role="'+a.value+'"]';case eu:return'"'+a.value+'"';case mo:return'[data-testname="'+a.value+'"]';default:throw Error(v(365,a))}}function Rc(a,l){var f=[];a=[a,0];for(var y=0;y<a.length;){var b=a[y++],T=a[y++],N=l[T];if(b.tag!==5||!at(b)){for(;N!=null&&Cc(b,N);)T++,N=l[T];if(T===l.length)f.push(b);else for(b=b.child;b!==null;)a.push(b,T),b=b.sibling}}return f}function Ac(a,l){if(!Ve)throw Error(v(363));a=Tc(a),a=Rc(a,l),l=[],a=Array.from(a);for(var f=0;f<a.length;){var y=a[f++];if(y.tag===5)at(y)||l.push(y.stateNode);else for(y=y.child;y!==null;)a.push(y),y=y.sibling}return l}var So=null;function Mc(a){if(So===null)try{var l=("require"+Math.random()).slice(0,7);So=(t&&t[l]).call(t,"timers").setImmediate}catch{So=function(y){var b=new MessageChannel;b.port1.onmessage=y,b.port2.postMessage(void 0)}}return So(a)}var Cv=Math.ceil,Ps=g.ReactCurrentDispatcher,tu=g.ReactCurrentOwner,nu=g.IsSomeRendererActing,qe=0,$n=null,bn=null,zt=0,Ci=0,Hi=zi(0),Dn=0,bo=null,rs=0,xo=0,va=0,tr=0,ma=null,Eo=0,iu=1/0;function en(){iu=On()+500}var Oe=null,wo=!1,nr=null,jn=null,ss=!1,ga=null,qn=90,ru=[],$t=[],Mt=null,Ln=0,kr=null,Yn=-1,zr=0,su=0,To=null,Co=!1;function pi(){return qe&48?On():Yn!==-1?Yn:Yn=On()}function Cn(a){if(a=a.mode,!(a&2))return 1;if(!(a&4))return sa()===99?1:2;if(zr===0&&(zr=rs),mv.transition!==0){su!==0&&(su=ma!==null?ma.pendingLanes:0),a=zr;var l=4186112&~su;return l&=-l,l===0&&(a=4186112&~a,l=a&-a,l===0&&(l=8192)),l}return a=sa(),qe&4&&a===98?a=xl(12,zr):(a=lv(a),a=xl(a,zr)),a}function Nr(a,l,f){if(50<Ln)throw Ln=0,kr=null,Error(v(185));if(a=ks(a,l),a===null)return null;El(a,l,f),a===$n&&(va|=l,Dn===4&&zs(a,zt));var y=sa();l===1?qe&8&&!(qe&48)?Qn(a):(Ri(a,f),qe===0&&(en(),_i())):(!(qe&4)||y!==98&&y!==99||(Mt===null?Mt=new Set([a]):Mt.add(a)),Ri(a,f)),ma=a}function ks(a,l){a.lanes|=l;var f=a.alternate;for(f!==null&&(f.lanes|=l),f=a,a=a.return;a!==null;)a.childLanes|=l,f=a.alternate,f!==null&&(f.childLanes|=l),f=a,a=a.return;return f.tag===3?f.stateNode:null}function Ri(a,l){for(var f=a.callbackNode,y=a.suspendedLanes,b=a.pingedLanes,T=a.expirationTimes,N=a.pendingLanes;0<N;){var B=31-Gr(N),ne=1<<B,xe=T[B];if(xe===-1){if(!(ne&y)||ne&b){xe=l,Ki(ne);var Fe=Vt;T[B]=10<=Fe?xe+250:6<=Fe?xe+5e3:-1}}else xe<=l&&(a.expiredLanes|=ne);N&=~ne}if(y=qa(a,a===$n?zt:0),l=Vt,y===0)f!==null&&(f!==wl&&rc(f),a.callbackNode=null,a.callbackPriority=0);else{if(f!==null){if(a.callbackPriority===l)return;f!==wl&&rc(f)}l===15?(f=Qn.bind(null,a),Tr===null?(Tr=[f],Tl=ic(Qa,Ad)):Tr.push(f),f=wl):l===14?f=aa(99,Qn.bind(null,a)):(f=uv(l),f=aa(f,Oc.bind(null,a))),a.callbackPriority=l,a.callbackNode=f}}function Oc(a){if(Yn=-1,su=zr=0,qe&48)throw Error(v(327));var l=a.callbackNode;if(ri()&&a.callbackNode!==l)return null;var f=qa(a,a===$n?zt:0);if(f===0)return null;var y=f,b=qe;qe|=16;var T=Vi();($n!==a||zt!==y)&&(en(),ii(a,y));do try{Ao();break}catch(B){Vd(a,B)}while(!0);if(Ol(),Ps.current=T,qe=b,bn!==null?y=0:($n=null,zt=0,y=Dn),rs&va)ii(a,0);else if(y!==0){if(y===2&&(qe|=64,a.hydrate&&(a.hydrate=!1,xi(a.containerInfo)),f=Ed(a),f!==0&&(y=Ro(a,f))),y===1)throw l=bo,ii(a,0),zs(a,f),Ri(a,On()),l;switch(a.finishedWork=a.current.alternate,a.finishedLanes=f,y){case 0:case 1:throw Error(v(345));case 2:ir(a);break;case 3:if(zs(a,f),(f&62914560)===f&&(y=Eo+500-On(),10<y)){if(qa(a,0)!==0)break;if(b=a.suspendedLanes,(b&f)!==f){pi(),a.pingedLanes|=a.suspendedLanes&b;break}a.timeoutHandle=Ge(ir.bind(null,a),y);break}ir(a);break;case 4:if(zs(a,f),(f&4186112)===f)break;for(y=a.eventTimes,b=-1;0<f;){var N=31-Gr(f);T=1<<N,N=y[N],N>b&&(b=N),f&=~T}if(f=b,f=On()-f,f=(120>f?120:480>f?480:1080>f?1080:1920>f?1920:3e3>f?3e3:4320>f?4320:1960*Cv(f/1960))-f,10<f){a.timeoutHandle=Ge(ir.bind(null,a),f);break}ir(a);break;case 5:ir(a);break;default:throw Error(v(329))}}return Ri(a,On()),a.callbackNode===l?Oc.bind(null,a):null}function zs(a,l){for(l&=~tr,l&=~va,a.suspendedLanes|=l,a.pingedLanes&=~l,a=a.expirationTimes;0<l;){var f=31-Gr(l),y=1<<f;a[f]=-1,l&=~y}}function Qn(a){if(qe&48)throw Error(v(327));if(ri(),a===$n&&a.expiredLanes&zt){var l=zt,f=Ro(a,l);rs&va&&(l=qa(a,l),f=Ro(a,l))}else l=qa(a,0),f=Ro(a,l);if(a.tag!==0&&f===2&&(qe|=64,a.hydrate&&(a.hydrate=!1,xi(a.containerInfo)),l=Ed(a),l!==0&&(f=Ro(a,l))),f===1)throw f=bo,ii(a,0),zs(a,l),Ri(a,On()),f;return a.finishedWork=a.current.alternate,a.finishedLanes=l,ir(a),Ri(a,On()),null}function ya(){if(Mt!==null){var a=Mt;Mt=null,a.forEach(function(l){l.expiredLanes|=24&l.pendingLanes,Ri(l,On())})}_i()}function Bd(a,l){var f=qe;qe|=1;try{return a(l)}finally{qe=f,qe===0&&(en(),_i())}}function Hd(a,l){var f=qe;if(f&48)return a(l);qe|=1;try{if(a)return Cr(99,a.bind(null,l))}finally{qe=f,_i()}}function In(a,l){on(Hi,Ci),Ci|=l,rs|=l}function xn(){Ci=Hi.current,mt(Hi)}function ii(a,l){a.finishedWork=null,a.finishedLanes=0;var f=a.timeoutHandle;if(f!==Ze&&(a.timeoutHandle=Ze,nt(f)),bn!==null)for(f=bn.return;f!==null;){var y=f;switch(y.tag){case 1:y=y.type.childContextTypes,y!=null&&Sl();break;case 3:Jn(),mt(Bn),mt(ln),jl();break;case 5:Zr(y);break;case 4:Jn();break;case 13:mt(rn);break;case 19:mt(rn);break;case 10:Dl(y);break;case 23:case 24:xn()}f=f.return}$n=a,bn=Ft(a.current,null),zt=Ci=rs=l,Dn=0,bo=null,tr=va=xo=0}function Vd(a,l){do{var f=bn;try{if(Ol(),ua.current=Tt,Il){for(var y=Wt.memoizedState;y!==null;){var b=y.queue;b!==null&&(b.pending=null),y=y.next}Il=!1}if(fi=0,_n=Vn=Wt=null,eo=!1,tu.current=null,f===null||f.return===null){Dn=1,bo=l,bn=null;break}e:{var T=a,N=f.return,B=f,ne=l;if(l=zt,B.flags|=2048,B.firstEffect=B.lastEffect=null,ne!==null&&typeof ne=="object"&&typeof ne.then=="function"){var xe=ne;if(!(B.mode&2)){var Fe=B.alternate;Fe?(B.updateQueue=Fe.updateQueue,B.memoizedState=Fe.memoizedState,B.lanes=Fe.lanes):(B.updateQueue=null,B.memoizedState=null)}var Ke=(rn.current&1)!==0,Ae=N;do{var Pt;if(Pt=Ae.tag===13){var qt=Ae.memoizedState;if(qt!==null)Pt=qt.dehydrated!==null;else{var Mi=Ae.memoizedProps;Pt=Mi.fallback===void 0?!1:Mi.unstable_avoidThisFallback!==!0?!0:!Ke}}if(Pt){var Q=Ae.updateQueue;if(Q===null){var V=new Set;V.add(xe),Ae.updateQueue=V}else Q.add(xe);if(!(Ae.mode&2)){if(Ae.flags|=64,B.flags|=16384,B.flags&=-2981,B.tag===1)if(B.alternate===null)B.tag=17;else{var ie=dr(-1,1);ie.tag=2,hr(B,ie)}B.lanes|=1;break e}ne=void 0,B=l;var Re=T.pingCache;if(Re===null?(Re=T.pingCache=new bv,ne=new Set,Re.set(xe,ne)):(ne=Re.get(xe),ne===void 0&&(ne=new Set,Re.set(xe,ne))),!ne.has(B)){ne.add(B);var Be=Lo.bind(null,T,xe,B);xe.then(Be,Be)}Ae.flags|=4096,Ae.lanes=l;break e}Ae=Ae.return}while(Ae!==null);ne=Error((Ce(B.type)||"A React component")+` suspended while rendering, but no fallback UI was specified.
|
|
208
|
+
|
|
209
|
+
Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`)}Dn!==5&&(Dn=2),ne=wc(ne,B),Ae=N;do{switch(Ae.tag){case 3:T=ne,Ae.flags|=4096,l&=-l,Ae.lanes|=l;var kt=Nd(Ae,T,l);Ar(Ae,kt);break e;case 1:T=ne;var Je=Ae.type,Rt=Ae.stateNode;if(!(Ae.flags&64)&&(typeof Je.getDerivedStateFromError=="function"||Rt!==null&&typeof Rt.componentDidCatch=="function"&&(jn===null||!jn.has(Rt)))){Ae.flags|=4096,l&=-l,Ae.lanes|=l;var En=_d(Ae,T,l);Ar(Ae,En);break e}}Ae=Ae.return}while(Ae!==null)}ba(f)}catch(yt){l=yt,bn===f&&f!==null&&(bn=f=f.return);continue}break}while(!0)}function Vi(){var a=Ps.current;return Ps.current=Tt,a===null?Tt:a}function Ro(a,l){var f=qe;qe|=16;var y=Vi();$n===a&&zt===l||ii(a,l);do try{Ns();break}catch(b){Vd(a,b)}while(!0);if(Ol(),qe=f,Ps.current=y,bn!==null)throw Error(v(261));return $n=null,zt=0,Dn}function Ns(){for(;bn!==null;)Sa(bn)}function Ao(){for(;bn!==null&&!hv();)Sa(bn)}function Sa(a){var l=_s(a.alternate,a,Ci);a.memoizedProps=a.pendingProps,l===null?ba(a):bn=l,tu.current=null}function ba(a){var l=a;do{var f=l.alternate;if(a=l.return,l.flags&2048){if(f=zd(l),f!==null){f.flags&=2047,bn=f;return}a!==null&&(a.firstEffect=a.lastEffect=null,a.flags|=2048)}else{if(f=kd(f,l,Ci),f!==null){bn=f;return}if(f=l,f.tag!==24&&f.tag!==23||f.memoizedState===null||Ci&1073741824||!(f.mode&4)){for(var y=0,b=f.child;b!==null;)y|=b.lanes|b.childLanes,b=b.sibling;f.childLanes=y}a!==null&&!(a.flags&2048)&&(a.firstEffect===null&&(a.firstEffect=l.firstEffect),l.lastEffect!==null&&(a.lastEffect!==null&&(a.lastEffect.nextEffect=l.firstEffect),a.lastEffect=l.lastEffect),1<l.flags&&(a.lastEffect!==null?a.lastEffect.nextEffect=l:a.firstEffect=l,a.lastEffect=l))}if(l=l.sibling,l!==null){bn=l;return}bn=l=a}while(l!==null);Dn===0&&(Dn=5)}function ir(a){var l=sa();return Cr(99,Mo.bind(null,a,l)),null}function Mo(a,l){do ri();while(ga!==null);if(qe&48)throw Error(v(327));var f=a.finishedWork;if(f===null)return null;if(a.finishedWork=null,a.finishedLanes=0,f===a.current)throw Error(v(177));a.callbackNode=null;var y=f.lanes|f.childLanes,b=y,T=a.pendingLanes&~b;a.pendingLanes=b,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=b,a.mutableReadLanes&=b,a.entangledLanes&=b,b=a.entanglements;for(var N=a.eventTimes,B=a.expirationTimes;0<T;){var ne=31-Gr(T),xe=1<<ne;b[ne]=0,N[ne]=-1,B[ne]=-1,T&=~xe}if(Mt!==null&&!(y&24)&&Mt.has(a)&&Mt.delete(a),a===$n&&(bn=$n=null,zt=0),1<f.flags?f.lastEffect!==null?(f.lastEffect.nextEffect=f,y=f.firstEffect):y=f:y=f.firstEffect,y!==null){b=qe,qe|=32,tu.current=null,To=je(a.containerInfo),Co=!1,Oe=y;do try{Oo()}catch(V){if(Oe===null)throw Error(v(330));sr(Oe,V),Oe=Oe.nextEffect}while(Oe!==null);To=null,Oe=y;do try{for(N=a;Oe!==null;){var Fe=Oe.flags;if(Fe&16&&ft&&bi(Oe.stateNode),Fe&128){var Ke=Oe.alternate;if(Ke!==null){var Ae=Ke.ref;Ae!==null&&(typeof Ae=="function"?Ae(null):Ae.current=null)}}switch(Fe&1038){case 2:jd(Oe),Oe.flags&=-3;break;case 6:jd(Oe),Oe.flags&=-3,Xl(Oe.alternate,Oe);break;case 1024:Oe.flags&=-1025;break;case 1028:Oe.flags&=-1025,Xl(Oe.alternate,Oe);break;case 4:Xl(Oe.alternate,Oe);break;case 8:B=N,T=Oe,ft?Id(B,T):Ct(B,T);var Pt=T.alternate;ho(T),Pt!==null&&ho(Pt)}Oe=Oe.nextEffect}}catch(V){if(Oe===null)throw Error(v(330));sr(Oe,V),Oe=Oe.nextEffect}while(Oe!==null);Co&&Se(),He(a.containerInfo),a.current=f,Oe=y;do try{for(Fe=a;Oe!==null;){var qt=Oe.flags;if(qt&36&&Ev(Fe,Oe.alternate,Oe),qt&128){Ke=void 0;var Mi=Oe.ref;if(Mi!==null){var Q=Oe.stateNode;switch(Oe.tag){case 5:Ke=Ue(Q);break;default:Ke=Q}typeof Mi=="function"?Mi(Ke):Mi.current=Ke}}Oe=Oe.nextEffect}}catch(V){if(Oe===null)throw Error(v(330));sr(Oe,V),Oe=Oe.nextEffect}while(Oe!==null);Oe=null,vv(),qe=b}else a.current=f;if(ss)ss=!1,ga=a,qn=l;else for(Oe=y;Oe!==null;)l=Oe.nextEffect,Oe.nextEffect=null,Oe.flags&8&&(qt=Oe,qt.sibling=null,qt.stateNode=null),Oe=l;if(y=a.pendingLanes,y===0&&(jn=null),y===1?a===kr?Ln++:(Ln=0,kr=a):Ln=0,f=f.stateNode,Ni&&typeof Ni.onCommitFiberRoot=="function")try{Ni.onCommitFiberRoot(tc,f,void 0,(f.current.flags&64)===64)}catch{}if(Ri(a,On()),wo)throw wo=!1,a=nr,nr=null,a;return qe&8||_i(),null}function Oo(){for(;Oe!==null;){var a=Oe.alternate;Co||To===null||(Oe.flags&8?Z(Oe,To)&&(Co=!0,G()):Oe.tag===13&&Tv(a,Oe)&&Z(Oe,To)&&(Co=!0,G()));var l=Oe.flags;l&256&&ni(a,Oe),!(l&512)||ss||(ss=!0,aa(97,function(){return ri(),null})),Oe=Oe.nextEffect}}function ri(){if(qn!==90){var a=97<qn?97:qn;return qn=90,Cr(a,rr)}return!1}function au(a,l){ru.push(l,a),ss||(ss=!0,aa(97,function(){return ri(),null}))}function Dc(a,l){$t.push(l,a),ss||(ss=!0,aa(97,function(){return ri(),null}))}function rr(){if(ga===null)return!1;var a=ga;if(ga=null,qe&48)throw Error(v(331));var l=qe;qe|=32;var f=$t;$t=[];for(var y=0;y<f.length;y+=2){var b=f[y],T=f[y+1],N=b.destroy;if(b.destroy=void 0,typeof N=="function")try{N()}catch(ne){if(T===null)throw Error(v(330));sr(T,ne)}}for(f=ru,ru=[],y=0;y<f.length;y+=2){b=f[y],T=f[y+1];try{var B=b.create;b.destroy=B()}catch(ne){if(T===null)throw Error(v(330));sr(T,ne)}}for(B=a.current.firstEffect;B!==null;)a=B.nextEffect,B.nextEffect=null,B.flags&8&&(B.sibling=null,B.stateNode=null),B=a;return qe=l,_i(),!0}function Do(a,l,f){l=wc(f,l),l=Nd(a,l,1),hr(a,l),l=pi(),a=ks(a,1),a!==null&&(El(a,1,l),Ri(a,l))}function sr(a,l){if(a.tag===3)Do(a,a,l);else for(var f=a.return;f!==null;){if(f.tag===3){Do(f,a,l);break}else if(f.tag===1){var y=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(jn===null||!jn.has(y))){a=wc(l,a);var b=_d(f,a,1);if(hr(f,b),b=pi(),f=ks(f,1),f!==null)El(f,1,b),Ri(f,b);else if(typeof y.componentDidCatch=="function"&&(jn===null||!jn.has(y)))try{y.componentDidCatch(l,a)}catch{}break}}f=f.return}}function Lo(a,l,f){var y=a.pingCache;y!==null&&y.delete(l),l=pi(),a.pingedLanes|=a.suspendedLanes&f,$n===a&&(zt&f)===f&&(Dn===4||Dn===3&&(zt&62914560)===zt&&500>On()-Eo?ii(a,0):tr|=f),Ri(a,l)}function ou(a,l){var f=a.stateNode;f!==null&&f.delete(l),l=0,l===0&&(l=a.mode,l&2?l&4?(zr===0&&(zr=rs),l=ra(62914560&~zr),l===0&&(l=4194304)):l=sa()===99?1:2:l=1),f=pi(),a=ks(a,l),a!==null&&(El(a,l,f),Ri(a,f))}var _s;_s=function(a,l,f){var y=l.lanes;if(a!==null)if(a.memoizedProps!==l.pendingProps||Bn.current)Bi=!0;else if(f&y)Bi=!!(a.flags&16384);else{switch(Bi=!1,l.tag){case 3:Yl(l),dc();break;case 5:Nl(l);break;case 1:Jt(l.type)&&$a(l);break;case 4:er(l,l.stateNode.containerInfo);break;case 10:uc(l,l.memoizedProps.value);break;case 13:if(l.memoizedState!==null)return f&l.child.childLanes?sn(a,l,f):(on(rn,rn.current&1),l=Pr(a,l,f),l!==null?l.sibling:null);on(rn,rn.current&1);break;case 19:if(y=(f&l.childLanes)!==0,a.flags&64){if(y)return Pd(a,l,f);l.flags|=64}var b=l.memoizedState;if(b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),on(rn,rn.current),y)break;return null;case 23:case 24:return l.lanes=0,da(a,l,f)}return Pr(a,l,f)}else Bi=!1;switch(l.lanes=0,l.tag){case 2:if(y=l.type,a!==null&&(a.alternate=null,l.alternate=null,l.flags|=2),a=l.pendingProps,b=cr(l,ln.current),Ts(l,f),b=Fl(null,l,y,a,b,f),l.flags|=1,typeof b=="object"&&b!==null&&typeof b.render=="function"&&b.$$typeof===void 0){if(l.tag=1,l.memoizedState=null,l.updateQueue=null,Jt(y)){var T=!0;$a(l)}else T=!1;l.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,ji(l);var N=y.getDerivedStateFromProps;typeof N=="function"&&oa(l,y,N,a),b.updater=Ll,l.stateNode=b,b._reactInternals=l,kl(l,y,a,f),l=ql(null,l,y,!0,T,f)}else l.tag=0,ti(null,l,b,f),l=l.child;return l;case 16:b=l.elementType;e:{switch(a!==null&&(a.alternate=null,l.alternate=null,l.flags|=2),a=l.pendingProps,T=b._init,b=T(b._payload),l.type=b,T=l.tag=Ea(b),a=Zi(b,a),T){case 0:l=lo(null,l,b,a,f);break e;case 1:l=yc(null,l,b,a,f);break e;case 11:l=$l(null,l,b,a,f);break e;case 14:l=gc(null,l,b,Zi(b.type,a),y,f);break e}throw Error(v(306,b,""))}return l;case 0:return y=l.type,b=l.pendingProps,b=l.elementType===y?b:Zi(y,b),lo(a,l,y,b,f);case 1:return y=l.type,b=l.pendingProps,b=l.elementType===y?b:Zi(y,b),yc(a,l,y,b,f);case 3:if(Yl(l),y=l.updateQueue,a===null||y===null)throw Error(v(282));if(y=l.pendingProps,b=l.memoizedState,b=b!==null?b.element:null,Ji(a,l),Cs(l,y,null,f),y=l.memoizedState.element,y===b)dc(),l=Pr(a,l,f);else{if(b=l.stateNode,(T=b.hydrate)&&(Qt?(Hn=de(l.stateNode.containerInfo),Fi=l,T=wi=!0):T=!1),T){if(Qt&&(a=b.mutableSourceEagerHydrationData,a!=null))for(b=0;b<a.length;b+=2)T=a[b],N=a[b+1],ht?T._workInProgressVersionPrimary=N:T._workInProgressVersionSecondary=N,As.push(T);for(f=pr(l,null,y,f),l.child=f;f;)f.flags=f.flags&-3|1024,f=f.sibling}else ti(a,l,y,f),dc();l=l.child}return l;case 5:return Nl(l),a===null&&Ul(l),y=l.type,b=l.pendingProps,T=a!==null?a.memoizedProps:null,N=b.children,xt(y,b)?N=null:T!==null&&xt(y,T)&&(l.flags|=16),Ls(a,l),ti(a,l,N,f),l.child;case 6:return a===null&&Ul(l),null;case 13:return sn(a,l,f);case 4:return er(l,l.stateNode.containerInfo),y=l.pendingProps,a===null?l.child=Rs(l,null,y,f):ti(a,l,y,f),l.child;case 11:return y=l.type,b=l.pendingProps,b=l.elementType===y?b:Zi(y,b),$l(a,l,y,b,f);case 7:return ti(a,l,l.pendingProps,f),l.child;case 8:return ti(a,l,l.pendingProps.children,f),l.child;case 12:return ti(a,l,l.pendingProps.children,f),l.child;case 10:e:{if(y=l.type._context,b=l.pendingProps,N=l.memoizedProps,T=b.value,uc(l,T),N!==null){var B=N.value;if(T=Ui(B,T)?0:(typeof y._calculateChangedBits=="function"?y._calculateChangedBits(B,T):1073741823)|0,T===0){if(N.children===b.children&&!Bn.current){l=Pr(a,l,f);break e}}else for(B=l.child,B!==null&&(B.return=l);B!==null;){var ne=B.dependencies;if(ne!==null){N=B.child;for(var xe=ne.firstContext;xe!==null;){if(xe.context===y&&xe.observedBits&T){B.tag===1&&(xe=dr(-1,f&-f),xe.tag=2,hr(B,xe)),B.lanes|=f,xe=B.alternate,xe!==null&&(xe.lanes|=f),cc(B.return,f),ne.lanes|=f;break}xe=xe.next}}else N=B.tag===10&&B.type===l.type?null:B.child;if(N!==null)N.return=B;else for(N=B;N!==null;){if(N===l){N=null;break}if(B=N.sibling,B!==null){B.return=N.return,N=B;break}N=N.return}B=N}}ti(a,l,b.children,f),l=l.child}return l;case 9:return b=l.type,T=l.pendingProps,y=T.children,Ts(l,f),b=Ei(b,T.unstable_observedBits),y=y(b),l.flags|=1,ti(a,l,y,f),l.child;case 14:return b=l.type,T=Zi(b,l.pendingProps),T=Zi(b.type,T),gc(a,l,b,T,y,f);case 15:return Ds(a,l,l.type,l.pendingProps,y,f);case 17:return y=l.type,b=l.pendingProps,b=l.elementType===y?b:Zi(y,b),a!==null&&(a.alternate=null,l.alternate=null,l.flags|=2),l.tag=1,Jt(y)?(a=!0,$a(l)):a=!1,Ts(l,f),Od(l,y,b),kl(l,y,b,f),ql(null,l,y,!0,a,f);case 19:return Pd(a,l,f);case 23:return da(a,l,f);case 24:return da(a,l,f)}throw Error(v(156,l.tag))};var Us={current:!1},xa=h.unstable_flushAllWithoutAsserting,Po=typeof xa=="function";function lu(){if(xa!==void 0)return xa();for(var a=!1;ri();)a=!0;return a}function Lc(a){try{lu(),Mc(function(){lu()?Lc(a):a()})}catch(l){a(l)}}var ko=0,uu=!1;function Rv(a,l,f,y){this.tag=a,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function Ai(a,l,f,y){return new Rv(a,l,f,y)}function Pc(a){return a=a.prototype,!(!a||!a.isReactComponent)}function Ea(a){if(typeof a=="function")return Pc(a)?1:0;if(a!=null){if(a=a.$$typeof,a===L)return 11;if(a===I)return 14}return 2}function Ft(a,l){var f=a.alternate;return f===null?(f=Ai(a.tag,l,a.key,a.mode),f.elementType=a.elementType,f.type=a.type,f.stateNode=a.stateNode,f.alternate=a,a.alternate=f):(f.pendingProps=l,f.type=a.type,f.flags=0,f.nextEffect=null,f.firstEffect=null,f.lastEffect=null),f.childLanes=a.childLanes,f.lanes=a.lanes,f.child=a.child,f.memoizedProps=a.memoizedProps,f.memoizedState=a.memoizedState,f.updateQueue=a.updateQueue,l=a.dependencies,f.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},f.sibling=a.sibling,f.index=a.index,f.ref=a.ref,f}function zo(a,l,f,y,b,T){var N=2;if(y=a,typeof a=="function")Pc(a)&&(N=1);else if(typeof a=="string")N=5;else e:switch(a){case w:return js(f.children,b,T,l);case H:N=8,b|=16;break;case A:N=8,b|=1;break;case P:return a=Ai(12,f,l,b|8),a.elementType=P,a.type=P,a.lanes=T,a;case k:return a=Ai(13,f,l,b),a.type=k,a.elementType=k,a.lanes=T,a;case O:return a=Ai(19,f,l,b),a.elementType=O,a.lanes=T,a;case J:return wa(f,b,T,l);case re:return a=Ai(24,f,l,b),a.elementType=re,a.lanes=T,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case M:N=10;break e;case _:N=9;break e;case L:N=11;break e;case I:N=14;break e;case q:N=16,y=null;break e;case te:N=22;break e}throw Error(v(130,a==null?a:typeof a,""))}return l=Ai(N,f,l,b),l.elementType=a,l.type=y,l.lanes=T,l}function js(a,l,f,y){return a=Ai(7,a,y,l),a.lanes=f,a}function wa(a,l,f,y){return a=Ai(23,a,y,l),a.elementType=J,a.lanes=f,a}function No(a,l,f){return a=Ai(6,a,null,l),a.lanes=f,a}function Ta(a,l,f){return l=Ai(4,a.children!==null?a.children:[],a.key,l),l.lanes=f,l.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},l}function kc(a,l,f){this.tag=l,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Ze,this.pendingContext=this.context=null,this.hydrate=f,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=nc(0),this.expirationTimes=nc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=nc(0),Qt&&(this.mutableSourceEagerHydrationData=null)}function _o(a){var l=a._reactInternals;if(l===void 0)throw typeof a.render=="function"?Error(v(188)):Error(v(268,Object.keys(a)));return a=Ye(l),a===null?null:a.stateNode}function cu(a,l){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var f=a.retryLane;a.retryLane=f!==0&&f<l?f:l}}function Uo(a,l){cu(a,l),(a=a.alternate)&&cu(a,l)}function as(a){return a=Ye(a),a===null?null:a.stateNode}function os(){return null}return r.IsThisRendererActing=Us,r.act=function(a){function l(){ko--,nu.current=f,Us.current=y}uu===!1&&(uu=!0,console.error("act(...) is not supported in production builds of React, and might not behave as expected.")),ko++;var f=nu.current,y=Us.current;nu.current=!0,Us.current=!0;try{var b=Bd(a)}catch(T){throw l(),T}if(b!==null&&typeof b=="object"&&typeof b.then=="function")return{then:function(T,N){b.then(function(){1<ko||Po===!0&&f===!0?(l(),T()):Lc(function(B){l(),B?N(B):T()})},function(B){l(),N(B)})}};try{ko!==1||Po!==!1&&f!==!1||lu(),l()}catch(T){throw l(),T}return{then:function(T){T()}}},r.attemptContinuousHydration=function(a){if(a.tag===13){var l=pi();Nr(a,67108864,l),Uo(a,67108864)}},r.attemptHydrationAtCurrentPriority=function(a){if(a.tag===13){var l=pi(),f=Cn(a);Nr(a,f,l),Uo(a,f)}},r.attemptSynchronousHydration=function(a){switch(a.tag){case 3:var l=a.stateNode;if(l.hydrate){var f=Ki(l.pendingLanes);l.expiredLanes|=f&l.pendingLanes,Ri(l,On()),!(qe&48)&&(en(),_i())}break;case 13:var y=pi();Hd(function(){return Nr(a,1,y)}),Uo(a,4)}},r.attemptUserBlockingHydration=function(a){if(a.tag===13){var l=pi();Nr(a,4,l),Uo(a,4)}},r.batchedEventUpdates=function(a,l){var f=qe;qe|=2;try{return a(l)}finally{qe=f,qe===0&&(en(),_i())}},r.batchedUpdates=Bd,r.createComponentSelector=function(a){return{$$typeof:vo,value:a}},r.createContainer=function(a,l,f){return a=new kc(a,l,f),l=Ai(3,null,null,l===2?7:l===1?3:0),a.current=l,l.stateNode=a,ji(l),a},r.createHasPsuedoClassSelector=function(a){return{$$typeof:Zl,value:a}},r.createPortal=function(a,l,f){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:m,key:y==null?null:""+y,children:a,containerInfo:l,implementation:f}},r.createRoleSelector=function(a){return{$$typeof:Jl,value:a}},r.createTestNameSelector=function(a){return{$$typeof:mo,value:a}},r.createTextSelector=function(a){return{$$typeof:eu,value:a}},r.deferredUpdates=function(a){return Cr(97,a)},r.discreteUpdates=function(a,l,f,y,b){var T=qe;qe|=4;try{return Cr(98,a.bind(null,l,f,y,b))}finally{qe=T,qe===0&&(en(),_i())}},r.findAllNodes=Ac,r.findBoundingRects=function(a,l){if(!Ve)throw Error(v(363));l=Ac(a,l),a=[];for(var f=0;f<l.length;f++)a.push(ki(l[f]));for(l=a.length-1;0<l;l--){f=a[l];for(var y=f.x,b=y+f.width,T=f.y,N=T+f.height,B=l-1;0<=B;B--)if(l!==B){var ne=a[B],xe=ne.x,Fe=xe+ne.width,Ke=ne.y,Ae=Ke+ne.height;if(y>=xe&&T>=Ke&&b<=Fe&&N<=Ae){a.splice(l,1);break}else if(y!==xe||f.width!==ne.width||Ae<T||Ke>N){if(!(T!==Ke||f.height!==ne.height||Fe<y||xe>b)){xe>y&&(ne.width+=xe-y,ne.x=y),Fe<b&&(ne.width=b-xe),a.splice(l,1);break}}else{Ke>T&&(ne.height+=Ke-T,ne.y=T),Ae<N&&(ne.height=N-Ke),a.splice(l,1);break}}}return a},r.findHostInstance=_o,r.findHostInstanceWithNoPortals=function(a){return a=gt(a),a===null?null:a.tag===20?a.stateNode.instance:a.stateNode},r.findHostInstanceWithWarning=function(a){return _o(a)},r.flushControlled=function(a){var l=qe;qe|=1;try{Cr(99,a)}finally{qe=l,qe===0&&(en(),_i())}},r.flushDiscreteUpdates=function(){!(qe&49)&&(ya(),ri())},r.flushPassiveEffects=ri,r.flushSync=Hd,r.focusWithin=function(a,l){if(!Ve)throw Error(v(363));for(a=Tc(a),l=Rc(a,l),l=Array.from(l),a=0;a<l.length;){var f=l[a++];if(!at(f)){if(f.tag===5&&Dt(f.stateNode))return!0;for(f=f.child;f!==null;)l.push(f),f=f.sibling}}return!1},r.getCurrentUpdateLanePriority=function(){return bl},r.getFindAllNodesFailureDescription=function(a,l){if(!Ve)throw Error(v(363));var f=0,y=[];a=[Tc(a),0];for(var b=0;b<a.length;){var T=a[b++],N=a[b++],B=l[N];if((T.tag!==5||!at(T))&&(Cc(T,B)&&(y.push(yo(B)),N++,N>f&&(f=N)),N<l.length))for(T=T.child;T!==null;)a.push(T,N),T=T.sibling}if(f<l.length){for(a=[];f<l.length;f++)a.push(yo(l[f]));return`findAllNodes was able to match part of the selector:
|
|
210
210
|
`+(y.join(" > ")+`
|
|
211
211
|
|
|
212
212
|
No matching component was found for:
|
|
213
|
-
`)+o.join(" > ")}return null},i.getPublicRootInstance=function(o){if(o=o.current,!o.child)return null;switch(o.child.tag){case 5:return tt(o.child.stateNode);default:return o.child.stateNode}},i.injectIntoDevTools=function(o){if(o={bundleType:o.bundleType,version:o.version,rendererPackageName:o.rendererPackageName,rendererConfig:o.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:g.ReactCurrentDispatcher,findHostInstanceByFiber:ps,findFiberByHostInstance:o.findFiberByHostInstance||vs,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")o=!1;else{var l=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!l.isDisabled&&l.supportsFiber)try{kc=l.inject(o),Bi=l}catch{}o=!0}return o},i.observeVisibleRects=function(o,l,d,y){if(!We)throw Error(p(363));o=of(o,l);var E=it(o,d,y).disconnect;return{disconnect:function(){E()}}},i.registerMutableSourceForHydration=function(o,l){var d=l._getVersion;d=d(l._source),o.mutableSourceEagerHydrationData==null?o.mutableSourceEagerHydrationData=[l,d]:o.mutableSourceEagerHydrationData.push(l,d)},i.runWithPriority=function(o,l){var d=Gl;try{return Gl=o,l()}finally{Gl=d}},i.shouldSuspend=function(){return!1},i.unbatchedUpdates=function(o,l){var d=Qe;Qe&=-2,Qe|=8;try{return o(l)}finally{Qe=d,Qe===0&&(nn(),Hi())}},i.updateContainer=function(o,l,d,y){var E=l.current,C=Si(),N=An(E);e:if(d){d=d._reactInternals;t:{if(Ee(d)!==d||d.tag!==1)throw Error(p(170));var B=d;do{switch(B.tag){case 3:B=B.stateNode.context;break t;case 1:if(tn(B.type)){B=B.stateNode.__reactInternalMemoizedMergedChildContext;break t}}B=B.return}while(B!==null);throw Error(p(171))}if(d.tag===1){var te=d.type;if(tn(te)){d=Jd(d,te,B);break e}}d=B}else d=vr;return l.context===null?l.context=d:l.pendingContext=d,l=yr(C,N),l.payload={element:o},y=y===void 0?null:y,y!==null&&(l.callback=y),Sr(E,l),Hr(E,N,C),N},i}}(qf)),qf.exports}process.env.NODE_ENV==="production"?Op.exports=fC():Op.exports=cC();var dC=Op.exports;const hC=nC(dC),Yf=["onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onScroll","onWheel","onClick","onDragStart","onDragEnd","onDragEnter","onDragExit","onDrag","onDragOver"];function pC(){return Yf.reduce((t,e)=>(t[e]=[],t),{})}const Rl=Yf.reduce((t,e)=>(t[e.slice(2).toLowerCase()]=e,t[e]=e,t),{}),ec=(t,e,n)=>{const i=t.length,a=n||qe(i);for(let u=0;u<i;u++)a[u]=u%5===0?t[u+1]<e[3]&&t[u+3]>e[1]&&t[u+2]<e[4]&&t[u+4]>e[2]?1:0:t[u];return a};function qe(t,e,n){return new Float32Array(t,e,n)}const vC=(t,e,n)=>{const i=t[1]<=e[3]&&t[3]>=e[1]&&t[2]<=e[4]&&t[4]>=e[2],a=n||qe(5);return i?(a[0]=1,a[1]=Math.max(t[1],e[1]),a[2]=Math.max(t[2],e[2]),a[3]=Math.min(t[3],e[3]),a[4]=Math.min(t[4],e[4]),a):(a[0]=0,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a)},mC=t=>t.length/5,xs=(t,e,n)=>{const i=n||qe(9);return i[0]=t[0]*e[0]+t[1]*e[3]+t[2]*e[6],i[1]=t[0]*e[1]+t[1]*e[4]+t[2]*e[7],i[2]=t[0]*e[2]+t[1]*e[5]+t[2]*e[8],i[3]=t[3]*e[0]+t[4]*e[3]+t[5]*e[6],i[4]=t[3]*e[1]+t[4]*e[4]+t[5]*e[7],i[5]=t[3]*e[2]+t[4]*e[5]+t[5]*e[8],i[6]=t[6]*e[0]+t[7]*e[3]+t[8]*e[6],i[7]=t[6]*e[1]+t[7]*e[4]+t[8]*e[7],i[8]=t[6]*e[2]+t[7]*e[5]+t[8]*e[8],i};class Tt{constructor(e){this.index=0,this.length=e,this.points=qe(this.length)}static grid(e=1,n=1){return new Tt(5*e*n)}static point(e,n){const i=qe(5);return i[0]=1,i[1]=e,i[2]=n,i[3]=e,i[4]=n,i}static positionPair(e){const n=qe(5);return n[0]=1,n[1]=e.x1,n[2]=e.y1,n[3]=e.x2,n[4]=e.y2,n}static projection(e){return Tt.singleBox(e.width,e.height,e.x,e.y)}static singleBox(e,n,i=0,a=0){const u=qe(5);return u[0]=1,u[1]=i,u[2]=a,u[3]=e+i,u[4]=n+a,u}row(e){return e(this)}addPoints(e,n,i,a){return this.points[this.index]=1,this.points[1+this.index]=e,this.points[2+this.index]=n,this.points[3+this.index]=i,this.points[4+this.index]=a,this.index+=5,this}addBox(e,n,i,a){return this.addPoints(e,n,e+i,n+a),this}build(){return this.points}}const Qr=(t,e)=>{const n=t.length;for(let i=0;i<n;i++)t[i]=i%5===0?e[6]*t[i+1]+e[7]*t[i+2]+e[8]*t[i]:i%5%2===1?e[0]*t[i]+e[1]*t[i+1]+e[2]:e[3]*t[i-1]+e[4]*t[i]+e[5];return t},ra=t=>{const e=qe(9);return e[0]=t,e[4]=t,e[8]=1,e},Ei=(t,e)=>{const n=qe(9);return n[0]=1,n[2]=t,n[4]=1,n[5]=e,n[8]=1,n},tc=(t,e,n)=>xs(Ei((1-t)*e,(1-t)*n),ra(t)),ws=(t,e,n)=>{const i=t.length,a=n&&n.length>=i?n.slice(0,i):qe(i);for(let u=0;u<i;u++)a[u]=u%5===0?e[6]*t[u+1]+e[7]*t[u+2]+e[8]*t[u]:u%5%2===1?e[0]*t[u]+e[1]*t[u+1]+e[2]:e[3]*t[u-1]+e[4]*t[u]+e[5];return a};let Qf=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((e,n)=>(n&=63,n<36?e+=n.toString(36):n<62?e+=(n-26).toString(36).toUpperCase():n>62?e+="-":e+="_",e),"");class Gr{constructor(){this.__revision=0,this.__owner={value:void 0},this.__state={},this.scale=1,this.layers=[],this.time=[],this.addEventListener=(e,n,i)=>{const a=Rl[e];if(!this.eventHandlers[a])throw new Error(`Unknown event ${a}`);this.eventHandlers[a].indexOf(n)===-1&&this.eventHandlers[a].push(n)},this.removeEventListener=(e,n)=>{const i=Rl[e];if(!this.eventHandlers[i]){console.warn(`Unknown event ${i}`);return}this.eventHandlers[i].indexOf(n)!==-1&&(this.eventHandlers[i]=this.eventHandlers[i].filter(a=>a!==n))},this.id=this.__id=Qf(),this.eventHandlers=pC()}get crop(){return this._crop}set crop(e){this._crop=e}getObjectsAt(e){return[]}getAllPointsAt(e,n,i){return[]}getScheduledUpdates(e,n){return[]}dispatchEvent(e,n){const i=this.eventHandlers[e],a=i?i.length:0;let u=!1;if(a)for(let f=0;f<a;f++)try{i[f](n),u=!0}catch(p){console.error(e,p)}return u}get x(){return this.points[1]}get y(){return this.points[2]}get width(){return this.points[3]-this.points[1]}get height(){return this.points[4]-this.points[2]}translate(e,n){Qr(this.points,Ei(e,n))}atScale(e){Qr(this.points,tc(e,this.x,this.y)),this.scale*=e}transform(e){Qr(this.points,e)}applyProps(e){this.__revision++}appendChild(e){}removeChild(e){}insertBefore(e,n){}hideInstance(){}}class Ar extends Gr{constructor(e){if(super(),this.type="spacial-content",this.style={opacity:1},!e)this.id="",this.uri="",this.display={x:0,y:0,scale:1,width:0,height:0,points:qe(5)},this.points=qe(5);else{const n=e.scale||1;this.id=e.id||e.uri,this.uri=e.uri,this.points=Tt.singleBox(e.width,e.height,e.x,e.y),this.display={x:0,y:0,scale:n,width:e.width/n,height:e.height/n,points:Tt.singleBox(e.width/n,e.height/n),rotation:e==null?void 0:e.rotation}}}applyProps(e){const n=e.display?e.display.width:e.target.width,i=e.target.width/n;if(this.id=e.id||e.uri,this.uri=e.uri,this.points.set(Tt.singleBox(e.target.width,e.target.height,e.target.x,e.target.y)),e.style&&typeof e.style.opacity<"u"&&(this.style.opacity=e.style.opacity),e.crop){this.cropData=e.crop;const a=Tt.singleBox(e.crop.width,e.crop.height,e.crop.x,e.crop.y);Qr(a,Ei(-e.crop.x,-e.crop.y)),this.crop?this.crop.set(a):this.crop=qe(a)}e.display?(this.display.scale=i,this.display.width=e.display.width,this.display.height=e.display.height,this.display.rotation=e.display.rotation,this.display.points=Tt.singleBox(e.display.width,e.display.height)):(this.display.scale=i,this.display.width=e.target.width/i,this.display.height=e.target.height/i,this.display.points=Tt.singleBox(e.target.width/i,e.target.height/i))}getAllPointsAt(e,n,i){return[[this,this.crop||this.points,n]]}static fromSvg(e,n,i,a){return Ar.fromImage("data:image/svg+xml;base64,"+btoa(e),n,i,a)}static fromImage(e,n,i,a){const u=new Ar;return u.applyProps({uri:e,id:a,display:i,target:n}),u}getImageUrl(){return this.uri}}class kp extends Gr{constructor(e){if(super(),this.type="spacial-content",this.getTexture=()=>({source:void 0,hash:-1}),!e)this.id="",this.uri="",this.display={x:0,y:0,scale:1,width:0,height:0,points:qe(5)},this.points=qe(5);else{const n=e.scale||1;this.id=e.id||e.uri,this.uri=e.uri,this.points=Tt.singleBox(e.width,e.height),this.display={x:0,y:0,scale:n,width:e.width/n,height:e.height/n,points:n!==1?Tt.singleBox(e.width/n,e.height/n):this.points}}}applyProps(e){const n=e.display?e.display.width:e.target.width,i=e.target.width/n;this.id=e.id,this.points.set(Tt.singleBox(e.target.width,e.target.height)),this.display.scale=i,this.display.width=e.target.width/i,this.display.height=e.target.height/i,this.getTexture=e.getTexture,this.display.points=i!==1?Tt.singleBox(e.target.width/i,e.target.height/i):this.points}getAllPointsAt(e,n,i){return[[this,this.points,n]]}}function gC(t,e,n=1){const i=e.length;if(i===0)throw new Error("No resources passed in.");let a=0;for(let u=0;u<i&&!(!e[u]||!e[u].display);u++)a=Math.abs(e[u].display.scale-t)*n<Math.abs(e[a].display.scale-t)?u:a;return a}function ky(t,e){return Math.abs(t-e)}function Gf(t,e){const n=ky(t.x,e.x),i=ky(t.y,e.y);return Math.sqrt(Math.pow(n,2)+Math.pow(i,2))}function yC(t){const e=t.length;return t.indexOf("/info.json")===e-10?t.slice(0,-10):t}function Iy(...t){return e=>t.forEach(n=>function(i,a){typeof i=="function"?i(a):i!=null&&(i.current=a)}(n,e))}function Xf(...t){return se.useCallback(Iy(...t),t)}function di(){return di=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},di.apply(this,arguments)}const Ny=se.forwardRef((t,e)=>{const{children:n,...i}=t;return se.Children.toArray(n).some(Uy)?se.createElement(se.Fragment,null,se.Children.map(n,a=>Uy(a)?se.createElement(Ip,di({},i,{ref:e}),a.props.children):a)):se.createElement(Ip,di({},i,{ref:e}),n)});Ny.displayName="Slot";const Ip=se.forwardRef((t,e)=>{const{children:n,...i}=t;return se.isValidElement(n)?se.cloneElement(n,{...SC(i,n.props),ref:Iy(e,n.ref)}):se.Children.count(n)>1?se.Children.only(null):null});Ip.displayName="SlotClone";const zy=({children:t})=>se.createElement(se.Fragment,null,t);function Uy(t){return se.isValidElement(t)&&t.type===zy}function SC(t,e){const n={...e};for(const i in e){const a=t[i],u=e[i];/^on[A-Z]/.test(i)?n[i]=(...f)=>{u==null||u(...f),a==null||a(...f)}:i==="style"?n[i]={...a,...u}:i==="className"&&(n[i]=[a,u].filter(Boolean).join(" "))}return{...t,...n}}const Kf=globalThis!=null&&globalThis.document?se.useLayoutEffect:()=>{};var Zf=function(e,n,i,a){this.name=e,this.fn=n,this.args=i,this.modifiers=a};Zf.prototype._test=function(e){var n=this.fn;try{Al(this.modifiers.slice(),n,this)(e)}catch{n=function(){return!1}}try{return Al(this.modifiers.slice(),n,this)(e)}catch{return!1}},Zf.prototype._check=function(e){try{Al(this.modifiers.slice(),this.fn,this)(e)}catch{if(Al(this.modifiers.slice(),function(i){return i},this)(!1))return}if(!Al(this.modifiers.slice(),this.fn,this)(e))throw null},Zf.prototype._testAsync=function(e){var n=this;return new Promise(function(i,a){Fy(n.modifiers.slice(),n.fn,n)(e).then(function(u){u?i(e):a(null)}).catch(function(u){return a(u)})})};function jy(t,e){return e===void 0&&(e="simple"),typeof t=="object"?t[e]:t}function Al(t,e,n){if(t.length){var i=t.shift(),a=Al(t,e,n);return i.perform(a,n)}else return jy(e)}function Fy(t,e,n){if(t.length){var i=t.shift(),a=Fy(t,e,n);return i.performAsync(a,n)}else return function(u){return Promise.resolve(jy(e,"async")(u))}}var bC=function(e,n,i){this.name=e,this.perform=n,this.performAsync=i},Np=function(t){function e(n,i,a,u){for(var f=[],p=arguments.length-4;p-- >0;)f[p]=arguments[p+4];t.call(this,f),t.captureStackTrace&&t.captureStackTrace(this,e),this.rule=n,this.value=i,this.cause=a,this.target=u}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),Xr=function(e,n){e===void 0&&(e=[]),n===void 0&&(n=[]),this.chain=e,this.nextRuleModifiers=n};Xr.prototype._applyRule=function(e,n){var i=this;return function(){for(var a=[],u=arguments.length;u--;)a[u]=arguments[u];return i.chain.push(new Zf(n,e.apply(i,a),a,i.nextRuleModifiers)),i.nextRuleModifiers=[],i}},Xr.prototype._applyModifier=function(e,n){return this.nextRuleModifiers.push(new bC(n,e.simple,e.async)),this},Xr.prototype._clone=function(){return new Xr(this.chain.slice(),this.nextRuleModifiers.slice())},Xr.prototype.test=function(e){return this.chain.every(function(n){return n._test(e)})},Xr.prototype.testAll=function(e){var n=[];return this.chain.forEach(function(i){try{i._check(e)}catch(a){n.push(new Np(i,e,a))}}),n},Xr.prototype.check=function(e){this.chain.forEach(function(n){try{n._check(e)}catch(i){throw new Np(n,e,i)}})},Xr.prototype.testAsync=function(e){var n=this;return new Promise(function(i,a){By(e,n.chain.slice(),i,a)})};function By(t,e,n,i){if(e.length){var a=e.shift();a._testAsync(t).then(function(){By(t,e,n,i)},function(u){i(new Np(a,t,u))})}else n(t)}var Hy=function(t,e){return e&&typeof t=="string"&&t.trim().length===0?!0:t==null};function EC(t,e){return e===void 0&&(e=!1),{simple:function(n){return Hy(n,e)||t.check(n)===void 0},async:function(n){return Hy(n,e)||t.testAsync(n)}}}function sa(){return typeof Proxy<"u"?Vy(new Xr):zp(new Xr)}var nc={};sa.extend=function(t){Object.assign(nc,t)},sa.clearCustomRules=function(){nc={}};function Vy(t){return new Proxy(t,{get:function(n,i){if(i in n)return n[i];var a=Vy(t._clone());if(i in Jf)return a._applyModifier(Jf[i],i);if(i in nc)return a._applyRule(nc[i],i);if(i in Up)return a._applyRule(Up[i],i)}})}function zp(t){var e=function(a,u){return Object.keys(a).forEach(function(f){u[f]=function(){for(var p=[],g=arguments.length;g--;)p[g]=arguments[g];var S=zp(u._clone()),m=S._applyRule(a[f],f).apply(void 0,p);return m}}),u},n=e(Up,t),i=e(nc,n);return Object.keys(Jf).forEach(function(a){Object.defineProperty(i,a,{get:function(){var u=zp(i._clone());return u._applyModifier(Jf[a],a)}})}),i}var Jf={not:{simple:function(t){return function(e){return!t(e)}},async:function(t){return function(e){return Promise.resolve(t(e)).then(function(n){return!n}).catch(function(){return!0})}}},some:{simple:function(t){return function(e){return ed(e).some(function(n){try{return t(n)}catch{return!1}})}},async:function(t){return function(e){return Promise.all(ed(e).map(function(n){try{return t(n).catch(function(){return!1})}catch{return!1}})).then(function(n){return n.some(Boolean)})}}},every:{simple:function(t){return function(e){return e!==!1&&ed(e).every(t)}},async:function(t){return function(e){return Promise.all(ed(e).map(t)).then(function(n){return n.every(Boolean)})}}},strict:{simple:function(t,e){return function(n){return $y(e)&&n&&typeof n=="object"?Object.keys(e.args[0]).length===Object.keys(n).length&&t(n):t(n)}},async:function(t,e){return function(n){return Promise.resolve(t(n)).then(function(i){return $y(e)&&n&&typeof n=="object"?Object.keys(e.args[0]).length===Object.keys(n).length&&i:i}).catch(function(){return!1})}}}};function $y(t){return t&&t.name==="schema"&&t.args.length>0&&typeof t.args[0]=="object"}function ed(t){return typeof t=="string"?t.split(""):t}var Up={equal:function(t){return function(e){return e==t}},exact:function(t){return function(e){return e===t}},number:function(t){return t===void 0&&(t=!0),function(e){return typeof e=="number"&&(t||isFinite(e))}},integer:function(){return function(t){var e=Number.isInteger||xC;return e(t)}},numeric:function(){return function(t){return!isNaN(parseFloat(t))&&isFinite(t)}},string:function(){return Ml("string")},boolean:function(){return Ml("boolean")},undefined:function(){return Ml("undefined")},null:function(){return Ml("null")},array:function(){return Ml("array")},object:function(){return Ml("object")},instanceOf:function(t){return function(e){return e instanceof t}},pattern:function(t){return function(e){return t.test(e)}},lowercase:function(){return function(t){return typeof t=="boolean"||t===t.toLowerCase()&&t.trim()!==""}},uppercase:function(){return function(t){return t===t.toUpperCase()&&t.trim()!==""}},vowel:function(){return function(t){return/^[aeiou]+$/i.test(t)}},consonant:function(){return function(t){return/^(?=[^aeiou])([a-z]+)$/i.test(t)}},first:function(t){return function(e){return e[0]==t}},last:function(t){return function(e){return e[e.length-1]==t}},empty:function(){return function(t){return t.length===0}},length:function(t,e){return function(n){return n.length>=t&&n.length<=(e||t)}},minLength:function(t){return function(e){return e.length>=t}},maxLength:function(t){return function(e){return e.length<=t}},negative:function(){return function(t){return t<0}},positive:function(){return function(t){return t>=0}},between:function(t,e){return function(n){return n>=t&&n<=e}},range:function(t,e){return function(n){return n>=t&&n<=e}},lessThan:function(t){return function(e){return e<t}},lessThanOrEqual:function(t){return function(e){return e<=t}},greaterThan:function(t){return function(e){return e>t}},greaterThanOrEqual:function(t){return function(e){return e>=t}},even:function(){return function(t){return t%2===0}},odd:function(){return function(t){return t%2!==0}},includes:function(t){return function(e){return~e.indexOf(t)}},schema:function(t){return wC(t)},passesAnyOf:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return function(n){return t.some(function(i){return i.test(n)})}},optional:EC};function Ml(t){return function(e){return Array.isArray(e)&&t==="array"||e===null&&t==="null"||typeof e===t}}function xC(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t}function wC(t){return{simple:function(e){var n=[];if(Object.keys(t).forEach(function(i){var a=t[i];try{a.check((e||{})[i])}catch(u){u.target=i,n.push(u)}}),n.length>0)throw n;return!0},async:function(e){var n=[],i=Object.keys(t).map(function(a){var u=t[a];return u.testAsync((e||{})[a]).catch(function(f){f.target=a,n.push(f)})});return Promise.all(i).then(function(){if(n.length>0)throw n;return!0})}}}var Vt="colors",xi="sizes",Ne="space",CC={gap:Ne,gridGap:Ne,columnGap:Ne,gridColumnGap:Ne,rowGap:Ne,gridRowGap:Ne,inset:Ne,insetBlock:Ne,insetBlockEnd:Ne,insetBlockStart:Ne,insetInline:Ne,insetInlineEnd:Ne,insetInlineStart:Ne,margin:Ne,marginTop:Ne,marginRight:Ne,marginBottom:Ne,marginLeft:Ne,marginBlock:Ne,marginBlockEnd:Ne,marginBlockStart:Ne,marginInline:Ne,marginInlineEnd:Ne,marginInlineStart:Ne,padding:Ne,paddingTop:Ne,paddingRight:Ne,paddingBottom:Ne,paddingLeft:Ne,paddingBlock:Ne,paddingBlockEnd:Ne,paddingBlockStart:Ne,paddingInline:Ne,paddingInlineEnd:Ne,paddingInlineStart:Ne,top:Ne,right:Ne,bottom:Ne,left:Ne,scrollMargin:Ne,scrollMarginTop:Ne,scrollMarginRight:Ne,scrollMarginBottom:Ne,scrollMarginLeft:Ne,scrollMarginX:Ne,scrollMarginY:Ne,scrollMarginBlock:Ne,scrollMarginBlockEnd:Ne,scrollMarginBlockStart:Ne,scrollMarginInline:Ne,scrollMarginInlineEnd:Ne,scrollMarginInlineStart:Ne,scrollPadding:Ne,scrollPaddingTop:Ne,scrollPaddingRight:Ne,scrollPaddingBottom:Ne,scrollPaddingLeft:Ne,scrollPaddingX:Ne,scrollPaddingY:Ne,scrollPaddingBlock:Ne,scrollPaddingBlockEnd:Ne,scrollPaddingBlockStart:Ne,scrollPaddingInline:Ne,scrollPaddingInlineEnd:Ne,scrollPaddingInlineStart:Ne,fontSize:"fontSizes",background:Vt,backgroundColor:Vt,backgroundImage:Vt,borderImage:Vt,border:Vt,borderBlock:Vt,borderBlockEnd:Vt,borderBlockStart:Vt,borderBottom:Vt,borderBottomColor:Vt,borderColor:Vt,borderInline:Vt,borderInlineEnd:Vt,borderInlineStart:Vt,borderLeft:Vt,borderLeftColor:Vt,borderRight:Vt,borderRightColor:Vt,borderTop:Vt,borderTopColor:Vt,caretColor:Vt,color:Vt,columnRuleColor:Vt,fill:Vt,outline:Vt,outlineColor:Vt,stroke:Vt,textDecorationColor:Vt,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:xi,minBlockSize:xi,maxBlockSize:xi,inlineSize:xi,minInlineSize:xi,maxInlineSize:xi,width:xi,minWidth:xi,maxWidth:xi,height:xi,minHeight:xi,maxHeight:xi,flexBasis:xi,gridTemplateColumns:xi,gridTemplateRows:xi,borderWidth:"borderWidths",borderTopWidth:"borderWidths",borderRightWidth:"borderWidths",borderBottomWidth:"borderWidths",borderLeftWidth:"borderWidths",borderStyle:"borderStyles",borderTopStyle:"borderStyles",borderRightStyle:"borderStyles",borderBottomStyle:"borderStyles",borderLeftStyle:"borderStyles",borderRadius:"radii",borderTopLeftRadius:"radii",borderTopRightRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",boxShadow:"shadows",textShadow:"shadows",transition:"transitions",zIndex:"zIndices"},TC=(t,e)=>typeof e=="function"?{"()":Function.prototype.toString.call(e)}:e,Ol=()=>{const t=Object.create(null);return(e,n,...i)=>{const a=(u=>JSON.stringify(u,TC))(e);return a in t?t[a]:t[a]=n(e,...i)}},Za=Symbol.for("sxs.internal"),jp=(t,e)=>Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)),Wy=t=>{for(const e in t)return!0;return!1},{hasOwnProperty:RC}=Object.prototype,Fp=t=>t.includes("-")?t:t.replace(/[A-Z]/g,e=>"-"+e.toLowerCase()),AC=/\s+(?![^()]*\))/,_l=t=>e=>t(...typeof e=="string"?String(e).split(AC):[e]),qy={appearance:t=>({WebkitAppearance:t,appearance:t}),backfaceVisibility:t=>({WebkitBackfaceVisibility:t,backfaceVisibility:t}),backdropFilter:t=>({WebkitBackdropFilter:t,backdropFilter:t}),backgroundClip:t=>({WebkitBackgroundClip:t,backgroundClip:t}),boxDecorationBreak:t=>({WebkitBoxDecorationBreak:t,boxDecorationBreak:t}),clipPath:t=>({WebkitClipPath:t,clipPath:t}),content:t=>({content:t.includes('"')||t.includes("'")||/^([A-Za-z]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)$/.test(t)?t:`"${t}"`}),hyphens:t=>({WebkitHyphens:t,hyphens:t}),maskImage:t=>({WebkitMaskImage:t,maskImage:t}),maskSize:t=>({WebkitMaskSize:t,maskSize:t}),tabSize:t=>({MozTabSize:t,tabSize:t}),textSizeAdjust:t=>({WebkitTextSizeAdjust:t,textSizeAdjust:t}),userSelect:t=>({WebkitUserSelect:t,userSelect:t}),marginBlock:_l((t,e)=>({marginBlockStart:t,marginBlockEnd:e||t})),marginInline:_l((t,e)=>({marginInlineStart:t,marginInlineEnd:e||t})),maxSize:_l((t,e)=>({maxBlockSize:t,maxInlineSize:e||t})),minSize:_l((t,e)=>({minBlockSize:t,minInlineSize:e||t})),paddingBlock:_l((t,e)=>({paddingBlockStart:t,paddingBlockEnd:e||t})),paddingInline:_l((t,e)=>({paddingInlineStart:t,paddingInlineEnd:e||t}))},Bp=/([\d.]+)([^]*)/,MC=(t,e)=>t.length?t.reduce((n,i)=>(n.push(...e.map(a=>a.includes("&")?a.replace(/&/g,/[ +>|~]/.test(i)&&/&.*&/.test(a)?`:is(${i})`:i):i+" "+a)),n),[]):e,OC=(t,e)=>t in _C&&typeof e=="string"?e.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,(n,i,a,u)=>i+(a==="stretch"?`-moz-available${u};${Fp(t)}:${i}-webkit-fill-available`:`-moz-fit-content${u};${Fp(t)}:${i}fit-content`)+u):String(e),_C={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},Cs=t=>t?t+"-":"",Yy=(t,e,n)=>t.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,(i,a,u,f,p)=>f=="$"==!!u?i:(a||f=="--"?"calc(":"")+"var(--"+(f==="$"?Cs(e)+(p.includes("$")?"":Cs(n))+p.replace(/\$/g,"-"):p)+")"+(a||f=="--"?"*"+(a||"")+(u||"1")+")":"")),LC=/\s*,\s*(?![^()]*\))/,PC=Object.prototype.toString,Ll=(t,e,n,i,a)=>{let u,f,p;const g=(S,m,x)=>{let R,_;const M=k=>{for(R in k){const O=R.charCodeAt(0)===64,j=O&&Array.isArray(k[R])?k[R]:[k[R]];for(_ of j){const q=/[A-Z]/.test(P=R)?P:P.replace(/-[^]/g,H=>H[1].toUpperCase()),ee=typeof _=="object"&&_&&_.toString===PC&&(!i.utils[q]||!m.length);if(q in i.utils&&!ee){const H=i.utils[q];if(H!==f){f=H,M(H(_)),f=null;continue}}else if(q in qy){const H=qy[q];if(H!==p){p=H,M(H(_)),p=null;continue}}if(O&&(L=R.slice(1)in i.media?"@media "+i.media[R.slice(1)]:R,R=L.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,(H,Z,ie,W,re,ge)=>{const be=Bp.test(Z),Ee=.0625*(be?-1:1),[Ue,je]=be?[W,Z]:[Z,W];return"("+(ie[0]==="="?"":ie[0]===">"===be?"max-":"min-")+Ue+":"+(ie[0]!=="="&&ie.length===1?je.replace(Bp,(Xe,ce,me)=>Number(ce)+Ee*(ie===">"?1:-1)+me):je)+(re?") and ("+(re[0]===">"?"min-":"max-")+Ue+":"+(re.length===1?ge.replace(Bp,(Xe,ce,me)=>Number(ce)+Ee*(re===">"?-1:1)+me):ge):"")+")"})),ee){const H=O?x.concat(R):[...x],Z=O?[...m]:MC(m,R.split(LC));u!==void 0&&a(Qy(...u)),u=void 0,g(_,Z,H)}else u===void 0&&(u=[[],m,x]),R=O||R.charCodeAt(0)!==36?R:`--${Cs(i.prefix)}${R.slice(1).replace(/\$/g,"-")}`,_=ee?_:typeof _=="number"?_&&q in DC?String(_)+"px":String(_):Yy(OC(q,_??""),i.prefix,i.themeMap[q]),u[0].push(`${O?`${R} `:`${Fp(R)}:`}${_}`)}}var L,P};M(S),u!==void 0&&a(Qy(...u)),u=void 0};g(t,e,n)},Qy=(t,e,n)=>`${n.map(i=>`${i}{`).join("")}${e.length?`${e.join(",")}{`:""}${t.join(";")}${e.length?"}":""}${Array(n.length?n.length+1:0).join("}")}`,DC={animationDelay:1,animationDuration:1,backgroundSize:1,blockSize:1,border:1,borderBlock:1,borderBlockEnd:1,borderBlockEndWidth:1,borderBlockStart:1,borderBlockStartWidth:1,borderBlockWidth:1,borderBottom:1,borderBottomLeftRadius:1,borderBottomRightRadius:1,borderBottomWidth:1,borderEndEndRadius:1,borderEndStartRadius:1,borderInlineEnd:1,borderInlineEndWidth:1,borderInlineStart:1,borderInlineStartWidth:1,borderInlineWidth:1,borderLeft:1,borderLeftWidth:1,borderRadius:1,borderRight:1,borderRightWidth:1,borderSpacing:1,borderStartEndRadius:1,borderStartStartRadius:1,borderTop:1,borderTopLeftRadius:1,borderTopRightRadius:1,borderTopWidth:1,borderWidth:1,bottom:1,columnGap:1,columnRule:1,columnRuleWidth:1,columnWidth:1,containIntrinsicSize:1,flexBasis:1,fontSize:1,gap:1,gridAutoColumns:1,gridAutoRows:1,gridTemplateColumns:1,gridTemplateRows:1,height:1,inlineSize:1,inset:1,insetBlock:1,insetBlockEnd:1,insetBlockStart:1,insetInline:1,insetInlineEnd:1,insetInlineStart:1,left:1,letterSpacing:1,margin:1,marginBlock:1,marginBlockEnd:1,marginBlockStart:1,marginBottom:1,marginInline:1,marginInlineEnd:1,marginInlineStart:1,marginLeft:1,marginRight:1,marginTop:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,offsetDistance:1,offsetRotate:1,outline:1,outlineOffset:1,outlineWidth:1,overflowClipMargin:1,padding:1,paddingBlock:1,paddingBlockEnd:1,paddingBlockStart:1,paddingBottom:1,paddingInline:1,paddingInlineEnd:1,paddingInlineStart:1,paddingLeft:1,paddingRight:1,paddingTop:1,perspective:1,right:1,rowGap:1,scrollMargin:1,scrollMarginBlock:1,scrollMarginBlockEnd:1,scrollMarginBlockStart:1,scrollMarginBottom:1,scrollMarginInline:1,scrollMarginInlineEnd:1,scrollMarginInlineStart:1,scrollMarginLeft:1,scrollMarginRight:1,scrollMarginTop:1,scrollPadding:1,scrollPaddingBlock:1,scrollPaddingBlockEnd:1,scrollPaddingBlockStart:1,scrollPaddingBottom:1,scrollPaddingInline:1,scrollPaddingInlineEnd:1,scrollPaddingInlineStart:1,scrollPaddingLeft:1,scrollPaddingRight:1,scrollPaddingTop:1,shapeMargin:1,textDecoration:1,textDecorationThickness:1,textIndent:1,textUnderlineOffset:1,top:1,transitionDelay:1,transitionDuration:1,verticalAlign:1,width:1,wordSpacing:1},Gy=t=>String.fromCharCode(t+(t>25?39:97)),Ja=t=>(e=>{let n,i="";for(n=Math.abs(e);n>52;n=n/52|0)i=Gy(n%52)+i;return Gy(n%52)+i})(((e,n)=>{let i=n.length;for(;i;)e=33*e^n.charCodeAt(--i);return e})(5381,JSON.stringify(t))>>>0),ic=["themed","global","styled","onevar","resonevar","allvar","inline"],kC=t=>{if(t.href&&!t.href.startsWith(location.origin))return!1;try{return!!t.cssRules}catch{return!1}},IC=t=>{let e;const n=()=>{const{cssRules:a}=e.sheet;return[].map.call(a,(u,f)=>{const{cssText:p}=u;let g="";if(p.startsWith("--sxs"))return"";if(a[f-1]&&(g=a[f-1].cssText).startsWith("--sxs")){if(!u.cssRules.length)return"";for(const S in e.rules)if(e.rules[S].group===u)return`--sxs{--sxs:${[...e.rules[S].cache].join(" ")}}${p}`;return u.cssRules.length?`${g}${p}`:""}return p}).join("")},i=()=>{if(e){const{rules:p,sheet:g}=e;if(!g.deleteRule){for(;Object(Object(g.cssRules)[0]).type===3;)g.cssRules.splice(0,1);g.cssRules=[]}for(const S in p)delete p[S]}const a=Object(t).styleSheets||[];for(const p of a)if(kC(p)){for(let g=0,S=p.cssRules;S[g];++g){const m=Object(S[g]);if(m.type!==1)continue;const x=Object(S[g+1]);if(x.type!==4)continue;++g;const{cssText:R}=m;if(!R.startsWith("--sxs"))continue;const _=R.slice(14,-3).trim().split(/\s+/),M=ic[_[0]];M&&(e||(e={sheet:p,reset:i,rules:{},toString:n}),e.rules[M]={group:x,index:g,cache:new Set(_)})}if(e)break}if(!e){const p=(g,S)=>({type:S,cssRules:[],insertRule(m,x){this.cssRules.splice(x,0,p(m,{import:3,undefined:1}[(m.toLowerCase().match(/^@([a-z]+)/)||[])[1]]||4))},get cssText(){return g==="@media{}"?`@media{${[].map.call(this.cssRules,m=>m.cssText).join("")}}`:g}});e={sheet:t?(t.head||t).appendChild(document.createElement("style")).sheet:p("","text/css"),rules:{},reset:i,toString:n}}const{sheet:u,rules:f}=e;for(let p=ic.length-1;p>=0;--p){const g=ic[p];if(!f[g]){const S=ic[p+1],m=f[S]?f[S].index:u.cssRules.length;u.insertRule("@media{}",m),u.insertRule(`--sxs{--sxs:${p}}`,m),f[g]={group:u.cssRules[m+1],index:m,cache:new Set([p])}}NC(f[g])}};return i(),e},NC=t=>{const e=t.group;let n=e.cssRules.length;t.apply=i=>{try{e.insertRule(i,n),++n}catch{}}},rc=Symbol(),zC=Ol(),Xy=(t,e)=>zC(t,()=>(...n)=>{let i={type:null,composers:new Set};for(const a of n)if(a!=null)if(a[Za]){i.type==null&&(i.type=a[Za].type);for(const u of a[Za].composers)i.composers.add(u)}else a.constructor!==Object||a.$$typeof?i.type==null&&(i.type=a):i.composers.add(UC(a,t));return i.type==null&&(i.type="span"),i.composers.size||i.composers.add(["PJLV",{},[],[],{},[]]),jC(t,i,e)}),UC=({variants:t,compoundVariants:e,defaultVariants:n,...i},a)=>{const u=`${Cs(a.prefix)}c-${Ja(i)}`,f=[],p=[],g=Object.create(null),S=[];for(const R in n)g[R]=String(n[R]);if(typeof t=="object"&&t)for(const R in t){m=g,x=R,RC.call(m,x)||(g[R]="undefined");const _=t[R];for(const M in _){const k={[R]:String(M)};String(M)==="undefined"&&S.push(R);const L=_[M],P=[k,L,!Wy(L)];f.push(P)}}var m,x;if(typeof e=="object"&&e)for(const R of e){let{css:_,...M}=R;_=typeof _=="object"&&_||{};for(const L in M)M[L]=String(M[L]);const k=[M,_,!Wy(_)];p.push(k)}return[u,i,f,p,g,S]},jC=(t,e,n)=>{const[i,a,u,f]=FC(e.composers),p=typeof e.type=="function"||e.type.$$typeof?(x=>{function R(){for(let _=0;_<R[rc].length;_++){const[M,k]=R[rc][_];x.rules[M].apply(k)}return R[rc]=[],null}return R[rc]=[],R.rules={},ic.forEach(_=>R.rules[_]={apply:M=>R[rc].push([_,M])}),R})(n):null,g=(p||n).rules,S=`.${i}${a.length>1?`:where(.${a.slice(1).join(".")})`:""}`,m=x=>{x=typeof x=="object"&&x||BC;const{css:R,..._}=x,M={};for(const P in u)if(delete _[P],P in x){let O=x[P];typeof O=="object"&&O?M[P]={"@initial":u[P],...O}:(O=String(O),M[P]=O!=="undefined"||f.has(P)?O:u[P])}else M[P]=u[P];const k=new Set([...a]);for(const[P,O,j,q]of e.composers){n.rules.styled.cache.has(P)||(n.rules.styled.cache.add(P),Ll(O,[`.${P}`],[],t,Z=>{g.styled.apply(Z)}));const ee=Ky(j,M,t.media),H=Ky(q,M,t.media,!0);for(const Z of ee)if(Z!==void 0)for(const[ie,W,re]of Z){const ge=`${P}-${Ja(W)}-${ie}`;k.add(ge);const be=(re?n.rules.resonevar:n.rules.onevar).cache,Ee=re?g.resonevar:g.onevar;be.has(ge)||(be.add(ge),Ll(W,[`.${ge}`],[],t,Ue=>{Ee.apply(Ue)}))}for(const Z of H)if(Z!==void 0)for(const[ie,W]of Z){const re=`${P}-${Ja(W)}-${ie}`;k.add(re),n.rules.allvar.cache.has(re)||(n.rules.allvar.cache.add(re),Ll(W,[`.${re}`],[],t,ge=>{g.allvar.apply(ge)}))}}if(typeof R=="object"&&R){const P=`${i}-i${Ja(R)}-css`;k.add(P),n.rules.inline.cache.has(P)||(n.rules.inline.cache.add(P),Ll(R,[`.${P}`],[],t,O=>{g.inline.apply(O)}))}for(const P of String(x.className||"").trim().split(/\s+/))P&&k.add(P);const L=_.className=[...k].join(" ");return{type:e.type,className:L,selector:S,props:_,toString:()=>L,deferredInjector:p}};return jp(m,{className:i,selector:S,[Za]:e,toString:()=>(n.rules.styled.cache.has(i)||m(),i)})},FC=t=>{let e="";const n=[],i={},a=[];for(const[u,,,,f,p]of t){e===""&&(e=u),n.push(u),a.push(...p);for(const g in f){const S=f[g];(i[g]===void 0||S!=="undefined"||p.includes(S))&&(i[g]=S)}}return[e,n,i,new Set(a)]},Ky=(t,e,n,i)=>{const a=[];e:for(let[u,f,p]of t){if(p)continue;let g,S=0,m=!1;for(g in u){const x=u[g];let R=e[g];if(R!==x){if(typeof R!="object"||!R)continue e;{let _,M,k=0;for(const L in R){if(x===String(R[L])){if(L!=="@initial"){const P=L.slice(1);(M=M||[]).push(P in n?n[P]:L.replace(/^@media ?/,"")),m=!0}S+=k,_=!0}++k}if(M&&M.length&&(f={["@media "+M.join(", ")]:f}),!_)continue e}}}(a[S]=a[S]||[]).push([i?"cv":`${g}-${u[g]}`,f,m])}return a},BC={},HC=Ol(),VC=(t,e)=>HC(t,()=>(...n)=>{const i=()=>{for(let a of n){a=typeof a=="object"&&a||{};let u=Ja(a);if(!e.rules.global.cache.has(u)){if(e.rules.global.cache.add(u),"@import"in a){let f=[].indexOf.call(e.sheet.cssRules,e.rules.themed.group)-1;for(let p of[].concat(a["@import"]))p=p.includes('"')||p.includes("'")?p:`"${p}"`,e.sheet.insertRule(`@import ${p};`,f++);delete a["@import"]}Ll(a,[],[],t,f=>{e.rules.global.apply(f)})}}return""};return jp(i,{toString:i})}),$C=Ol(),WC=(t,e)=>$C(t,()=>n=>{const i=`${Cs(t.prefix)}k-${Ja(n)}`,a=()=>{if(!e.rules.global.cache.has(i)){e.rules.global.cache.add(i);const u=[];Ll(n,[],[],t,p=>u.push(p));const f=`@keyframes ${i}{${u.join("")}}`;e.rules.global.apply(f)}return i};return jp(a,{get name(){return a()},toString:a})}),qC=class{constructor(e,n,i,a){this.token=e==null?"":String(e),this.value=n==null?"":String(n),this.scale=i==null?"":String(i),this.prefix=a==null?"":String(a)}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+Cs(this.prefix)+Cs(this.scale)+this.token}toString(){return this.computedValue}},YC=Ol(),QC=(t,e)=>YC(t,()=>(n,i)=>{i=typeof n=="object"&&n||Object(i);const a=`.${n=(n=typeof n=="string"?n:"")||`${Cs(t.prefix)}t-${Ja(i)}`}`,u={},f=[];for(const g in i){u[g]={};for(const S in i[g]){const m=`--${Cs(t.prefix)}${g}-${S}`,x=Yy(String(i[g][S]),t.prefix,g);u[g][S]=new qC(S,x,g,t.prefix),f.push(`${m}:${x}`)}}const p=()=>{if(f.length&&!e.rules.themed.cache.has(n)){e.rules.themed.cache.add(n);const g=`${i===t.theme?":root,":""}.${n}{${f.join(";")}}`;e.rules.themed.apply(g)}return n};return{...u,get className(){return p()},selector:a,toString:p}}),GC=Ol(),XC=Ol(),KC=t=>{const e=(n=>{let i=!1;const a=GC(n,u=>{i=!0;const f="prefix"in(u=typeof u=="object"&&u||{})?String(u.prefix):"",p=typeof u.media=="object"&&u.media||{},g=typeof u.root=="object"?u.root||null:globalThis.document||null,S=typeof u.theme=="object"&&u.theme||{},m={prefix:f,media:p,theme:S,themeMap:typeof u.themeMap=="object"&&u.themeMap||{...CC},utils:typeof u.utils=="object"&&u.utils||{}},x=IC(g),R={css:Xy(m,x),globalCss:VC(m,x),keyframes:WC(m,x),createTheme:QC(m,x),reset(){x.reset(),R.theme.toString()},theme:{},sheet:x,config:m,prefix:f,getCssText:x.toString,toString:x.toString};return String(R.theme=R.createTheme(S)),R});return i||a.reset(),a})(t);return e.styled=(({config:n,sheet:i})=>XC(n,()=>{const a=Xy(n,i);return(...u)=>{const f=a(...u),p=f[Za].type,g=T.forwardRef((S,m)=>{const x=S&&S.as||p,{props:R,deferredInjector:_}=f(S);return delete R.as,R.ref=m,_?T.createElement(T.Fragment,null,T.createElement(x,R),T.createElement(_,null)):T.createElement(x,R)});return g.className=f.className,g.displayName=`Styled.${p.displayName||p.name||p}`,g.selector=f.selector,g.toString=()=>f.selector,g[Za]=f[Za],g}}))(e),e};function ZC(t,e,n){return Math.max(e,Math.min(t,n))}const hi={toVector(t,e){return t===void 0&&(t=e),Array.isArray(t)?t:[t,t]},add(t,e){return[t[0]+e[0],t[1]+e[1]]},sub(t,e){return[t[0]-e[0],t[1]-e[1]]},addTo(t,e){t[0]+=e[0],t[1]+=e[1]},subTo(t,e){t[0]-=e[0],t[1]-=e[1]}};function Zy(t,e,n){return e===0||Math.abs(e)===1/0?Math.pow(t,n*5):t*e*n/(e+n*t)}function Jy(t,e,n,i=.15){return i===0?ZC(t,e,n):t<e?-Zy(e-t,n-e,i)+e:t>n?+Zy(t-n,n-e,i)+n:t}function JC(t,[e,n],[i,a]){const[[u,f],[p,g]]=t;return[Jy(e,u,f,i),Jy(n,p,g,a)]}function eT(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function tT(t){var e=eT(t,"string");return typeof e=="symbol"?e:String(e)}function zi(t,e,n){return e=tT(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e0(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),n.push.apply(n,i)}return n}function vn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?e0(Object(n),!0).forEach(function(i){zi(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):e0(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}const t0={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function n0(t){return t?t[0].toUpperCase()+t.slice(1):""}const nT=["enter","leave"];function iT(t=!1,e){return t&&!nT.includes(e)}function rT(t,e="",n=!1){const i=t0[t],a=i&&i[e]||e;return"on"+n0(t)+n0(a)+(iT(n,a)?"Capture":"")}const sT=["gotpointercapture","lostpointercapture"];function aT(t){let e=t.substring(2).toLowerCase();const n=!!~e.indexOf("passive");n&&(e=e.replace("passive",""));const i=sT.includes(e)?"capturecapture":"capture",a=!!~e.indexOf(i);return a&&(e=e.replace("capture","")),{device:e,capture:a,passive:n}}function oT(t,e=""){const n=t0[t],i=n&&n[e]||e;return t+i}function td(t){return"touches"in t}function i0(t){return td(t)?"touch":"pointerType"in t?t.pointerType:"mouse"}function lT(t){return Array.from(t.touches).filter(e=>{var n,i;return e.target===t.currentTarget||((n=t.currentTarget)===null||n===void 0||(i=n.contains)===null||i===void 0?void 0:i.call(n,e.target))})}function uT(t){return t.type==="touchend"||t.type==="touchcancel"?t.changedTouches:t.targetTouches}function r0(t){return td(t)?uT(t)[0]:t}function cT(t){return lT(t).map(e=>e.identifier)}function Hp(t){const e=r0(t);return td(t)?e.identifier:e.pointerId}function s0(t){const e=r0(t);return[e.clientX,e.clientY]}function fT(t){const e={};if("buttons"in t&&(e.buttons=t.buttons),"shiftKey"in t){const{shiftKey:n,altKey:i,metaKey:a,ctrlKey:u}=t;Object.assign(e,{shiftKey:n,altKey:i,metaKey:a,ctrlKey:u})}return e}function nd(t,...e){return typeof t=="function"?t(...e):t}function dT(){}function hT(...t){return t.length===0?dT:t.length===1?t[0]:function(){let e;for(const n of t)e=n.apply(this,arguments)||e;return e}}function a0(t,e){return Object.assign({},e,t||{})}const pT=32;class vT{constructor(e,n,i){this.ctrl=e,this.args=n,this.key=i,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:n,ingKey:i,args:a}=this;n[i]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=a,e.axis=void 0,e.memo=void 0,e.elapsedTime=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const n=this.state,i=this.config;n._active||(this.reset(),this.computeInitial(),n._active=!0,n.target=e.target,n.currentTarget=e.currentTarget,n.lastOffset=i.from?nd(i.from,n):n.offset,n.offset=n.lastOffset),n.startTime=n.timeStamp=e.timeStamp}computeValues(e){const n=this.state;n._values=e,n.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:n,config:i,shared:a}=this;n.args=this.args;let u=0;if(e&&(n.event=e,i.preventDefault&&e.cancelable&&n.event.preventDefault(),n.type=e.type,a.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,a.locked=!!document.pointerLockElement,Object.assign(a,fT(e)),a.down=a.pressed=a.buttons%2===1||a.touches>0,u=e.timeStamp-n.timeStamp,n.timeStamp=e.timeStamp,n.elapsedTime=n.timeStamp-n.startTime),n._active){const H=n._delta.map(Math.abs);hi.addTo(n._distance,H)}this.axisIntent&&this.axisIntent(e);const[f,p]=n._movement,[g,S]=i.threshold,{_step:m,values:x}=n;if(i.hasCustomTransform?(m[0]===!1&&(m[0]=Math.abs(f)>=g&&x[0]),m[1]===!1&&(m[1]=Math.abs(p)>=S&&x[1])):(m[0]===!1&&(m[0]=Math.abs(f)>=g&&Math.sign(f)*g),m[1]===!1&&(m[1]=Math.abs(p)>=S&&Math.sign(p)*S)),n.intentional=m[0]!==!1||m[1]!==!1,!n.intentional)return;const R=[0,0];if(i.hasCustomTransform){const[H,Z]=x;R[0]=m[0]!==!1?H-m[0]:0,R[1]=m[1]!==!1?Z-m[1]:0}else R[0]=m[0]!==!1?f-m[0]:0,R[1]=m[1]!==!1?p-m[1]:0;this.restrictToAxis&&!n._blocked&&this.restrictToAxis(R);const _=n.offset,M=n._active&&!n._blocked||n.active;M&&(n.first=n._active&&!n.active,n.last=!n._active&&n.active,n.active=a[this.ingKey]=n._active,e&&(n.first&&("bounds"in i&&(n._bounds=nd(i.bounds,n)),this.setup&&this.setup()),n.movement=R,this.computeOffset()));const[k,L]=n.offset,[[P,O],[j,q]]=n._bounds;n.overflow=[k<P?-1:k>O?1:0,L<j?-1:L>q?1:0],n._movementBound[0]=n.overflow[0]?n._movementBound[0]===!1?n._movement[0]:n._movementBound[0]:!1,n._movementBound[1]=n.overflow[1]?n._movementBound[1]===!1?n._movement[1]:n._movementBound[1]:!1;const ee=n._active?i.rubberband||[0,0]:[0,0];if(n.offset=JC(n._bounds,n.offset,ee),n.delta=hi.sub(n.offset,_),this.computeMovement(),M&&(!n.last||u>pT)){n.delta=hi.sub(n.offset,_);const H=n.delta.map(Math.abs);hi.addTo(n.distance,H),n.direction=n.delta.map(Math.sign),n._direction=n._delta.map(Math.sign),!n.first&&u>0&&(n.velocity=[H[0]/u,H[1]/u])}}emit(){const e=this.state,n=this.shared,i=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!i.triggerAllEvents)return;const a=this.handler(vn(vn(vn({},n),e),{},{[this.aliasKey]:e.values}));a!==void 0&&(e.memo=a)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function mT([t,e],n){const i=Math.abs(t),a=Math.abs(e);if(i>a&&i>n)return"x";if(a>i&&a>n)return"y"}class gT extends vT{constructor(...e){super(...e),zi(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=hi.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=hi.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const n=this.state,i=this.config;if(!n.axis&&e){const a=typeof i.axisThreshold=="object"?i.axisThreshold[i0(e)]:i.axisThreshold;n.axis=mT(n._movement,a)}n._blocked=(i.lockDirection||!!i.axis)&&!n.axis||!!i.axis&&i.axis!==n.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0;break}}}const yT=t=>t,o0=.15,l0={enabled(t=!0){return t},eventOptions(t,e,n){return vn(vn({},n.shared.eventOptions),t)},preventDefault(t=!1){return t},triggerAllEvents(t=!1){return t},rubberband(t=0){switch(t){case!0:return[o0,o0];case!1:return[0,0];default:return hi.toVector(t)}},from(t){if(typeof t=="function")return t;if(t!=null)return hi.toVector(t)},transform(t,e,n){const i=t||n.shared.transform;return this.hasCustomTransform=!!i,i||yT},threshold(t){return hi.toVector(t,0)}},ST=0,sc=vn(vn({},l0),{},{axis(t,e,{axis:n}){if(this.lockDirection=n==="lock",!this.lockDirection)return n},axisThreshold(t=ST){return t},bounds(t={}){if(typeof t=="function")return u=>sc.bounds(t(u));if("current"in t)return()=>t.current;if(typeof HTMLElement=="function"&&t instanceof HTMLElement)return t;const{left:e=-1/0,right:n=1/0,top:i=-1/0,bottom:a=1/0}=t;return[[e,n],[i,a]]}}),u0={ArrowRight:(t,e=1)=>[t*e,0],ArrowLeft:(t,e=1)=>[-1*t*e,0],ArrowUp:(t,e=1)=>[0,-1*t*e],ArrowDown:(t,e=1)=>[0,t*e]};class bT extends gT{constructor(...e){super(...e),zi(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const n=e._bounds.getBoundingClientRect(),i=e.currentTarget.getBoundingClientRect(),a={left:n.left-i.left+e.offset[0],right:n.right-i.right+e.offset[0],top:n.top-i.top+e.offset[1],bottom:n.bottom-i.bottom+e.offset[1]};e._bounds=sc.bounds(a)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const n=this.config,i=this.state;if(e.buttons!=null&&(Array.isArray(n.pointerButtons)?!n.pointerButtons.includes(e.buttons):n.pointerButtons!==-1&&n.pointerButtons!==e.buttons))return;const a=this.ctrl.setEventIds(e);n.pointerCapture&&e.target.setPointerCapture(e.pointerId),!(a&&a.size>1&&i._pointerActive)&&(this.start(e),this.setupPointer(e),i._pointerId=Hp(e),i._pointerActive=!0,this.computeValues(s0(e)),this.computeInitial(),n.preventScrollAxis&&i0(e)!=="mouse"?(i._active=!1,this.setupScrollPrevention(e)):n.delay>0?(this.setupDelayTrigger(e),n.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){const n=this.state;n._active=!0,n._preventScroll=!0,n._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const n=this.state,i=this.config;if(!n._pointerActive||n.type===e.type&&e.timeStamp===n.timeStamp)return;const a=Hp(e);if(n._pointerId!==void 0&&a!==n._pointerId)return;const u=s0(e);if(document.pointerLockElement===e.target?n._delta=[e.movementX,e.movementY]:(n._delta=hi.sub(u,n._values),this.computeValues(u)),hi.addTo(n._movement,n._delta),this.compute(e),n._delayed&&n.intentional){this.timeoutStore.remove("dragDelay"),n.active=!1,this.startPointerDrag(e);return}if(i.preventScrollAxis&&!n._preventScroll)if(n.axis)if(n.axis===i.preventScrollAxis||i.preventScrollAxis==="xy"){n._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(e);return}else return;this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch{}const n=this.state,i=this.config;if(!n._active||!n._pointerActive)return;const a=Hp(e);if(n._pointerId!==void 0&&a!==n._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[u,f]=n._distance;if(n.tap=u<=i.tapsThreshold&&f<=i.tapsThreshold,n.tap&&i.filterTaps)n._force=!0;else{const[p,g]=n.direction,[S,m]=n.velocity,[x,R]=n.movement,[_,M]=i.swipe.velocity,[k,L]=i.swipe.distance,P=i.swipe.duration;n.elapsedTime<P&&(Math.abs(S)>_&&Math.abs(x)>k&&(n.swipe[0]=p),Math.abs(m)>M&&Math.abs(R)>L&&(n.swipe[1]=g))}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){const n=this.config,i=n.device;n.pointerLock&&e.currentTarget.requestPointerLock(),n.pointerCapture||(this.eventStore.add(this.sharedConfig.window,i,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,i,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,i,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,ET(e);const n=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",n),this.eventStore.add(this.sharedConfig.window,"touch","cancel",n),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(e)},this.config.delay)}keyDown(e){const n=u0[e.key];if(n){const i=this.state,a=e.shiftKey?10:e.altKey?.1:1;this.start(e),i._delta=n(this.config.keyboardDisplacement,a),i._keyboardActive=!0,hi.addTo(i._movement,i._delta),this.compute(e),this.emit()}}keyUp(e){e.key in u0&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const n=this.config.device;e(n,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(n,"change",this.pointerMove.bind(this)),e(n,"end",this.pointerUp.bind(this)),e(n,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function ET(t){"persist"in t&&typeof t.persist=="function"&&t.persist()}const ac=typeof window<"u"&&window.document&&window.document.createElement;function xT(){return ac&&"ontouchstart"in window}function c0(){return xT()||ac&&window.navigator.maxTouchPoints>1}function wT(){return ac&&"onpointerdown"in window}function CT(){return ac&&"exitPointerLock"in window.document}function TT(){try{return"constructor"in GestureEvent}catch{return!1}}const pr={isBrowser:ac,gesture:TT(),touch:c0(),touchscreen:c0(),pointer:wT(),pointerLock:CT()},RT=250,AT=180,MT=.5,OT=50,_T=250,LT=10,f0={mouse:0,touch:0,pen:8},PT=vn(vn({},sc),{},{device(t,e,{pointer:{touch:n=!1,lock:i=!1,mouse:a=!1}={}}){return this.pointerLock=i&&pr.pointerLock,pr.touch&&n?"touch":this.pointerLock?"mouse":pr.pointer&&!a?"pointer":pr.touch?"touch":"mouse"},preventScrollAxis(t,e,{preventScroll:n}){if(this.preventScrollDelay=typeof n=="number"?n:n||n===void 0&&t?RT:void 0,!(!pr.touchscreen||n===!1))return t||(n!==void 0?"y":void 0)},pointerCapture(t,e,{pointer:{capture:n=!0,buttons:i=1,keys:a=!0}={}}){return this.pointerButtons=i,this.keys=a,!this.pointerLock&&this.device==="pointer"&&n},threshold(t,e,{filterTaps:n=!1,tapsThreshold:i=3,axis:a=void 0}){const u=hi.toVector(t,n?i:a?1:0);return this.filterTaps=n,this.tapsThreshold=i,u},swipe({velocity:t=MT,distance:e=OT,duration:n=_T}={}){return{velocity:this.transform(hi.toVector(t)),distance:this.transform(hi.toVector(e)),duration:n}},delay(t=0){switch(t){case!0:return AT;case!1:return 0;default:return t}},axisThreshold(t){return t?vn(vn({},f0),t):f0},keyboardDisplacement(t=LT){return t}});vn(vn({},l0),{},{device(t,e,{shared:n,pointer:{touch:i=!1}={}}){if(n.target&&!pr.touch&&pr.gesture)return"gesture";if(pr.touch&&i)return"touch";if(pr.touchscreen){if(pr.pointer)return"pointer";if(pr.touch)return"touch"}},bounds(t,e,{scaleBounds:n={},angleBounds:i={}}){const a=f=>{const p=a0(nd(n,f),{min:-1/0,max:1/0});return[p.min,p.max]},u=f=>{const p=a0(nd(i,f),{min:-1/0,max:1/0});return[p.min,p.max]};return typeof n!="function"&&typeof i!="function"?[a(),u()]:f=>[a(f),u(f)]},threshold(t,e,n){return this.lockDirection=n.axis==="lock",hi.toVector(t,this.lockDirection?[.1,3]:0)},modifierKey(t){return t===void 0?"ctrlKey":t},pinchOnWheel(t=!0){return t}}),vn(vn({},sc),{},{mouseOnly:(t=!0)=>t}),vn(vn({},sc),{},{mouseOnly:(t=!0)=>t});const d0=new Map,Vp=new Map;function DT(t){d0.set(t.key,t.engine),Vp.set(t.key,t.resolver)}const kT={key:"drag",engine:bT,resolver:PT};function IT(t,e){if(t==null)return{};var n={},i=Object.keys(t),a,u;for(u=0;u<i.length;u++)a=i[u],!(e.indexOf(a)>=0)&&(n[a]=t[a]);return n}function NT(t,e){if(t==null)return{};var n=IT(t,e),i,a;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(t);for(a=0;a<u.length;a++)i=u[a],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}const zT={target(t){if(t)return()=>"current"in t?t.current:t},enabled(t=!0){return t},window(t=pr.isBrowser?window:void 0){return t},eventOptions({passive:t=!0,capture:e=!1}={}){return{passive:t,capture:e}},transform(t){return t}},UT=["target","eventOptions","window","enabled","transform"];function id(t={},e){const n={};for(const[i,a]of Object.entries(e))switch(typeof a){case"function":n[i]=a.call(n,t[i],i,t);break;case"object":n[i]=id(t[i],a);break;case"boolean":a&&(n[i]=t[i]);break}return n}function jT(t,e,n={}){const i=t,{target:a,eventOptions:u,window:f,enabled:p,transform:g}=i,S=NT(i,UT);if(n.shared=id({target:a,eventOptions:u,window:f,enabled:p,transform:g},zT),e){const m=Vp.get(e);n[e]=id(vn({shared:n.shared},S),m)}else for(const m in S){const x=Vp.get(m);x&&(n[m]=id(vn({shared:n.shared},S[m]),x))}return n}class h0{constructor(e,n){zi(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=n}add(e,n,i,a,u){const f=this._listeners,p=oT(n,i),g=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},S=vn(vn({},g),u);e.addEventListener(p,a,S);const m=()=>{e.removeEventListener(p,a,S),f.delete(m)};return f.add(m),m}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}}class FT{constructor(){zi(this,"_timeouts",new Map)}add(e,n,i=140,...a){this.remove(e),this._timeouts.set(e,window.setTimeout(n,i,...a))}remove(e){const n=this._timeouts.get(e);n&&window.clearTimeout(n)}clean(){this._timeouts.forEach(e=>void window.clearTimeout(e)),this._timeouts.clear()}}class BT{constructor(e){zi(this,"gestures",new Set),zi(this,"_targetEventStore",new h0(this)),zi(this,"gestureEventStores",{}),zi(this,"gestureTimeoutStores",{}),zi(this,"handlers",{}),zi(this,"config",{}),zi(this,"pointerIds",new Set),zi(this,"touchIds",new Set),zi(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),HT(this,e)}setEventIds(e){if(td(e))return this.touchIds=new Set(cT(e)),this.touchIds;if("pointerId"in e)return e.type==="pointerup"||e.type==="pointercancel"?this.pointerIds.delete(e.pointerId):e.type==="pointerdown"&&this.pointerIds.add(e.pointerId),this.pointerIds}applyHandlers(e,n){this.handlers=e,this.nativeHandlers=n}applyConfig(e,n){this.config=jT(e,n,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const n=this.config.shared,i={};let a;if(!(n.target&&(a=n.target(),!a))){if(n.enabled){for(const f of this.gestures){const p=this.config[f],g=p0(i,p.eventOptions,!!a);if(p.enabled){const S=d0.get(f);new S(this,e,f).bind(g)}}const u=p0(i,n.eventOptions,!!a);for(const f in this.nativeHandlers)u(f,"",p=>this.nativeHandlers[f](vn(vn({},this.state.shared),{},{event:p,args:e})),void 0,!0)}for(const u in i)i[u]=hT(...i[u]);if(!a)return i;for(const u in i){const{device:f,capture:p,passive:g}=aT(u);this._targetEventStore.add(a,f,"",i[u],{capture:p,passive:g})}}}}function Pl(t,e){t.gestures.add(e),t.gestureEventStores[e]=new h0(t,e),t.gestureTimeoutStores[e]=new FT}function HT(t,e){e.drag&&Pl(t,"drag"),e.wheel&&Pl(t,"wheel"),e.scroll&&Pl(t,"scroll"),e.move&&Pl(t,"move"),e.pinch&&Pl(t,"pinch"),e.hover&&Pl(t,"hover")}const p0=(t,e,n)=>(i,a,u,f={},p=!1)=>{var g,S;const m=(g=f.capture)!==null&&g!==void 0?g:e.capture,x=(S=f.passive)!==null&&S!==void 0?S:e.passive;let R=p?i:rT(i,a,m);n&&x&&(R+="Passive"),t[R]=t[R]||[],t[R].push(u)};function VT(t,e={},n,i){const a=T.useMemo(()=>new BT(t),[]);if(a.applyHandlers(t,i),a.applyConfig(e,n),T.useEffect(a.effect.bind(a)),T.useEffect(()=>a.clean.bind(a),[]),e.target===void 0)return a.bind.bind(a)}function $T(t,e){return DT(kT),VT({drag:t},e||{},"drag")}const WT=se.useId||(()=>{});let qT=0;function YT(t){const[e,n]=se.useState(WT());return Kf(()=>{t||n(i=>i??String(qT++))},[t]),t||(e?`radix-${e}`:"")}const Dl=["a","button","div","h2","h3","img","li","nav","p","span","svg","ul"].reduce((t,e)=>({...t,[e]:se.forwardRef((n,i)=>{const{asChild:a,...u}=n,f=a?Ny:e;return se.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),n.as&&console.error(QT),se.createElement(f,di({},u,{ref:i}))})}),{}),QT="Warning: The `as` prop has been removed in favour of `asChild`. For details, see https://radix-ui.com/docs/primitives/overview/styling#changing-the-rendered-element",GT=se.forwardRef((t,e)=>se.createElement(Dl.span,di({},t,{ref:e,style:{...t.style,position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}}))),XT=se.forwardRef((t,e)=>{var n,i;const{containerRef:a,style:u,...f}=t,p=(n=a==null?void 0:a.current)!==null&&n!==void 0?n:globalThis==null||(i=globalThis.document)===null||i===void 0?void 0:i.body,[,g]=se.useState({});return Kf(()=>{g({})},[]),p?by.createPortal(se.createElement(Dl.div,di({"data-radix-portal":""},f,{ref:e,style:p===document.body?{position:"absolute",top:0,left:0,zIndex:2147483647,...u}:void 0})),p):null}),KT=se.forwardRef((t,e)=>{const{children:n,width:i=10,height:a=5,...u}=t;return se.createElement(Dl.svg,di({},u,{ref:e,width:i,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),t.asChild?n:se.createElement("polygon",{points:"0,0 30,0 15,10"}))});function v0(t){const[e,n]=se.useState(void 0);return se.useEffect(()=>{if(t){const i=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const u=a[0];let f,p;if("borderBoxSize"in u){const g=u.borderBoxSize,S=Array.isArray(g)?g[0]:g;f=S.inlineSize,p=S.blockSize}else{const g=t.getBoundingClientRect();f=g.width,p=g.height}n({width:f,height:p})});return i.observe(t,{box:"border-box"}),()=>{n(void 0),i.unobserve(t)}}},[t]),e}function ZT(t,e){const n=eo.get(t);return n===void 0?(eo.set(t,{rect:{},callbacks:[e]}),eo.size===1&&($p=requestAnimationFrame(m0))):(n.callbacks.push(e),e(t.getBoundingClientRect())),()=>{const i=eo.get(t);if(i===void 0)return;const a=i.callbacks.indexOf(e);a>-1&&i.callbacks.splice(a,1),i.callbacks.length===0&&(eo.delete(t),eo.size===0&&cancelAnimationFrame($p))}}let $p;const eo=new Map;function m0(){const t=[];eo.forEach((e,n)=>{const i=n.getBoundingClientRect();var a,u;a=e.rect,u=i,(a.width!==u.width||a.height!==u.height||a.top!==u.top||a.right!==u.right||a.bottom!==u.bottom||a.left!==u.left)&&(e.rect=i,t.push(e))}),t.forEach(e=>{e.callbacks.forEach(n=>n(e.rect))}),$p=requestAnimationFrame(m0)}function g0(t){const[e,n]=se.useState();return se.useEffect(()=>{if(t){const i=ZT(t,n);return()=>{n(void 0),i()}}},[t]),e}function y0(t,e=[]){let n=[];const i=()=>{const a=n.map(u=>se.createContext(u));return function(u){const f=(u==null?void 0:u[t])||a;return se.useMemo(()=>({[`__scope${t}`]:{...u,[t]:f}}),[u,f])}};return i.scopeName=t,[function(a,u){const f=se.createContext(u),p=n.length;function g(S){const{scope:m,children:x,...R}=S,_=(m==null?void 0:m[t][p])||f,M=se.useMemo(()=>R,Object.values(R));return se.createElement(_.Provider,{value:M},x)}return n=[...n,u],g.displayName=a+"Provider",[g,function(S,m){const x=(m==null?void 0:m[t][p])||f,R=se.useContext(x);if(R)return R;if(u!==void 0)return u;throw new Error(`\`${S}\` must be used within \`${a}\``)}]},JT(i,...e)]}function JT(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const i=t.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(a){const u=i.reduce((f,{useScope:p,scopeName:g})=>({...f,...p(a)[`__scope${g}`]}),{});return se.useMemo(()=>({[`__scope${e.scopeName}`]:u}),[u])}};return n.scopeName=e.scopeName,n}function eR({anchorRect:t,popperSize:e,arrowSize:n,arrowOffset:i=0,side:a,sideOffset:u=0,align:f,alignOffset:p=0,shouldAvoidCollisions:g=!0,collisionBoundariesRect:S,collisionTolerance:m=0}){if(!t||!e||!S)return{popperStyles:tR,arrowStyles:Wp};const x=function(Z,ie,W=0,re=0,ge){const be=ge?ge.height:0,Ee=S0(ie,Z,"x"),Ue=S0(ie,Z,"y"),je=Ue.before-W-be,Xe=Ue.after+W+be,ce=Ee.before-W-be,me=Ee.after+W+be;return{top:{start:{x:Ee.start+re,y:je},center:{x:Ee.center,y:je},end:{x:Ee.end-re,y:je}},right:{start:{x:me,y:Ue.start+re},center:{x:me,y:Ue.center},end:{x:me,y:Ue.end-re}},bottom:{start:{x:Ee.start+re,y:Xe},center:{x:Ee.center,y:Xe},end:{x:Ee.end-re,y:Xe}},left:{start:{x:ce,y:Ue.start+re},center:{x:ce,y:Ue.center},end:{x:ce,y:Ue.end-re}}}}(e,t,u,p,n),R=x[a][f];if(g===!1){const Z=b0(R);let ie=Wp;return n&&(ie=x0({popperSize:e,arrowSize:n,arrowOffset:i,side:a,align:f})),{popperStyles:{...Z,"--radix-popper-transform-origin":E0(e,a,f,i,n)},arrowStyles:ie,placedSide:a,placedAlign:f}}const _=DOMRect.fromRect({...e,...R}),M=(k=S,L=m,DOMRect.fromRect({width:k.width-2*L,height:k.height-2*L,x:k.left+L,y:k.top+L}));var k,L;const P=C0(_,M),O=x[w0(a)][f],j=function(Z,ie,W){const re=w0(Z);return ie[Z]&&!W[re]?re:Z}(a,P,C0(DOMRect.fromRect({...e,...O}),M)),q=function(Z,ie,W,re,ge){const be=W==="top"||W==="bottom",Ee=be?"left":"top",Ue=be?"right":"bottom",je=be?"width":"height",Xe=ie[je]>Z[je];return(re==="start"||re==="center")&&(ge[Ee]&&Xe||ge[Ue]&&!Xe)?"end":(re==="end"||re==="center")&&(ge[Ue]&&Xe||ge[Ee]&&!Xe)?"start":re}(e,t,a,f,P),ee=b0(x[j][q]);let H=Wp;return n&&(H=x0({popperSize:e,arrowSize:n,arrowOffset:i,side:j,align:q})),{popperStyles:{...ee,"--radix-popper-transform-origin":E0(e,j,q,i,n)},arrowStyles:H,placedSide:j,placedAlign:q}}function S0(t,e,n){const i=t[n==="x"?"left":"top"],a=n==="x"?"width":"height",u=t[a],f=e[a];return{before:i-f,start:i,center:i+(u-f)/2,end:i+u-f,after:i+u}}function b0(t){return{position:"absolute",top:0,left:0,minWidth:"max-content",willChange:"transform",transform:`translate3d(${Math.round(t.x+window.scrollX)}px, ${Math.round(t.y+window.scrollY)}px, 0)`}}function E0(t,e,n,i,a){const u=e==="top"||e==="bottom",f=a?a.width:0,p=a?a.height:0,g=f/2+i;let S="",m="";return u?(S={start:`${g}px`,center:"center",end:t.width-g+"px"}[n],m=e==="top"?`${t.height+p}px`:-p+"px"):(S=e==="left"?`${t.width+p}px`:-p+"px",m={start:`${g}px`,center:"center",end:t.height-g+"px"}[n]),`${S} ${m}`}const tR={position:"fixed",top:0,left:0,opacity:0,transform:"translate3d(0, -200%, 0)"},Wp={position:"absolute",opacity:0};function x0({popperSize:t,arrowSize:e,arrowOffset:n,side:i,align:a}){const u=(t.width-e.width)/2,f=(t.height-e.width)/2,p={top:0,right:90,bottom:180,left:-90}[i],g=Math.max(e.width,e.height),S={width:`${g}px`,height:`${g}px`,transform:`rotate(${p}deg)`,willChange:"transform",position:"absolute",[i]:"100%",direction:nR(i,a)};return i!=="top"&&i!=="bottom"||(a==="start"&&(S.left=`${n}px`),a==="center"&&(S.left=`${u}px`),a==="end"&&(S.right=`${n}px`)),i!=="left"&&i!=="right"||(a==="start"&&(S.top=`${n}px`),a==="center"&&(S.top=`${f}px`),a==="end"&&(S.bottom=`${n}px`)),S}function nR(t,e){return(t!=="top"&&t!=="right"||e!=="end")&&(t!=="bottom"&&t!=="left"||e==="end")?"ltr":"rtl"}function w0(t){return{top:"bottom",right:"left",bottom:"top",left:"right"}[t]}function C0(t,e){return{top:t.top<e.top,right:t.right>e.right,bottom:t.bottom>e.bottom,left:t.left<e.left}}const[T0,R0]=y0("Popper"),[iR,A0]=T0("Popper"),rR=t=>{const{__scopePopper:e,children:n}=t,[i,a]=se.useState(null);return se.createElement(iR,{scope:e,anchor:i,onAnchorChange:a},n)},sR=se.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:i,...a}=t,u=A0("PopperAnchor",n),f=se.useRef(null),p=Xf(e,f);return se.useEffect(()=>{u.onAnchorChange((i==null?void 0:i.current)||f.current)}),i?null:se.createElement(Dl.div,di({},a,{ref:p}))}),[aR,oR]=T0("PopperContent"),lR=se.forwardRef((t,e)=>{const{__scopePopper:n,side:i="bottom",sideOffset:a,align:u="center",alignOffset:f,collisionTolerance:p,avoidCollisions:g=!0,...S}=t,m=A0("PopperContent",n),[x,R]=se.useState(),_=g0(m.anchor),[M,k]=se.useState(null),L=v0(M),[P,O]=se.useState(null),j=v0(P),q=Xf(e,be=>k(be)),ee=function(){const[be,Ee]=se.useState(void 0);return se.useEffect(()=>{let Ue;function je(){Ee({width:window.innerWidth,height:window.innerHeight})}function Xe(){window.clearTimeout(Ue),Ue=window.setTimeout(je,100)}return je(),window.addEventListener("resize",Xe),()=>window.removeEventListener("resize",Xe)},[]),be}(),H=ee?DOMRect.fromRect({...ee,x:0,y:0}):void 0,{popperStyles:Z,arrowStyles:ie,placedSide:W,placedAlign:re}=eR({anchorRect:_,popperSize:L,arrowSize:j,arrowOffset:x,side:i,sideOffset:a,align:u,alignOffset:f,shouldAvoidCollisions:g,collisionBoundariesRect:H,collisionTolerance:p}),ge=W!==void 0;return se.createElement("div",{style:Z,"data-radix-popper-content-wrapper":""},se.createElement(aR,{scope:n,arrowStyles:ie,onArrowChange:O,onArrowOffsetChange:R},se.createElement(Dl.div,di({"data-side":W,"data-align":re},S,{style:{...S.style,animation:ge?void 0:"none"},ref:q}))))}),uR=se.forwardRef(function(t,e){const{__scopePopper:n,offset:i,...a}=t,u=oR("PopperArrow",n),{onArrowOffsetChange:f}=u;return se.useEffect(()=>f(i),[f,i]),se.createElement("span",{style:{...u.arrowStyles,pointerEvents:"none"}},se.createElement("span",{ref:u.onArrowChange,style:{display:"inline-block",verticalAlign:"top",pointerEvents:"auto"}},se.createElement(KT,di({},a,{ref:e,style:{...a.style,display:"block"}}))))}),cR=rR,fR=sR,dR=lR,hR=uR,M0=t=>{const{present:e,children:n}=t,i=function(f){const[p,g]=se.useState(),S=se.useRef({}),m=se.useRef(f),x=se.useRef("none"),R=f?"mounted":"unmounted",[_,M]=function(k,L){return se.useReducer((P,O)=>{const j=L[P][O];return j??P},k)}(R,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return se.useEffect(()=>{const k=rd(S.current);x.current=_==="mounted"?k:"none"},[_]),Kf(()=>{const k=S.current,L=m.current;if(L!==f){const P=x.current,O=rd(k);f?M("MOUNT"):O==="none"||(k==null?void 0:k.display)==="none"?M("UNMOUNT"):M(L&&P!==O?"ANIMATION_OUT":"UNMOUNT"),m.current=f}},[f,M]),Kf(()=>{if(p){const k=P=>{const O=rd(S.current).includes(P.animationName);P.target===p&&O&&M("ANIMATION_END")},L=P=>{P.target===p&&(x.current=rd(S.current))};return p.addEventListener("animationstart",L),p.addEventListener("animationcancel",k),p.addEventListener("animationend",k),()=>{p.removeEventListener("animationstart",L),p.removeEventListener("animationcancel",k),p.removeEventListener("animationend",k)}}},[p,M]),{isPresent:["mounted","unmountSuspended"].includes(_),ref:se.useCallback(k=>{k&&(S.current=getComputedStyle(k)),g(k)},[])}}(e),a=typeof n=="function"?n({present:i.isPresent}):se.Children.only(n),u=Xf(i.ref,a.ref);return typeof n=="function"||i.isPresent?se.cloneElement(a,{ref:u}):null};function rd(t){return(t==null?void 0:t.animationName)||"none"}M0.displayName="Presence";function O0(t){const e=se.useRef(t);return se.useEffect(()=>{e.current=t},[t]),e.current}function qp(t){const e=se.useRef(t);return se.useEffect(()=>{e.current=t}),se.useMemo(()=>(...n)=>{var i;return(i=e.current)===null||i===void 0?void 0:i.call(e,...n)},[])}function pR(t){const e=qp(t);se.useEffect(()=>{const n=i=>{i.key==="Escape"&&e(i)};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e])}function vR({prop:t,defaultProp:e,onChange:n=()=>{}}){const[i,a]=function({defaultProp:g,onChange:S}){const m=se.useState(g),[x]=m,R=se.useRef(x),_=qp(S);return se.useEffect(()=>{R.current!==x&&(_(x),R.current=x)},[x,R,_]),m}({defaultProp:e,onChange:n}),u=t!==void 0,f=u?t:i,p=qp(n);return[f,se.useCallback(g=>{if(u){const S=g,m=typeof g=="function"?S(t):g;m!==t&&p(m)}else a(g)},[u,t,a,p])]}function kl(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}const[_0,jN]=y0("Tooltip",[R0]),sd=R0(),mR=700,[FN,gR]=_0("TooltipProvider",{isOpenDelayed:!0,delayDuration:mR,onOpen:()=>{},onClose:()=>{}}),[yR,ad]=_0("Tooltip"),SR=t=>{const{__scopeTooltip:e,children:n,open:i,defaultOpen:a=!1,onOpenChange:u,delayDuration:f}=t,p=gR("Tooltip",e),g=sd(e),[S,m]=se.useState(null),x=YT(),R=se.useRef(0),_=f??p.delayDuration,M=se.useRef(!1),{onOpen:k,onClose:L}=p,[P=!1,O]=vR({prop:i,defaultProp:a,onChange:H=>{H&&(document.dispatchEvent(new CustomEvent("tooltip.open")),k()),u==null||u(H)}}),j=se.useMemo(()=>P?M.current?"delayed-open":"instant-open":"closed",[P]),q=se.useCallback(()=>{window.clearTimeout(R.current),M.current=!1,O(!0)},[O]),ee=se.useCallback(()=>{window.clearTimeout(R.current),R.current=window.setTimeout(()=>{M.current=!0,O(!0)},_)},[_,O]);return se.useEffect(()=>()=>window.clearTimeout(R.current),[]),se.createElement(cR,g,se.createElement(yR,{scope:e,contentId:x,open:P,stateAttribute:j,trigger:S,onTriggerChange:m,onTriggerEnter:se.useCallback(()=>{p.isOpenDelayed?ee():q()},[p.isOpenDelayed,ee,q]),onOpen:se.useCallback(q,[q]),onClose:se.useCallback(()=>{window.clearTimeout(R.current),O(!1),L()},[O,L])},n))},bR=se.forwardRef((t,e)=>{const{__scopeTooltip:n,...i}=t,a=ad("TooltipTrigger",n),u=sd(n),f=Xf(e,a.onTriggerChange),p=se.useRef(!1),g=se.useCallback(()=>p.current=!1,[]);return se.useEffect(()=>()=>document.removeEventListener("mouseup",g),[g]),se.createElement(fR,di({asChild:!0},u),se.createElement(Dl.button,di({"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute},i,{ref:f,onMouseEnter:kl(t.onMouseEnter,a.onTriggerEnter),onMouseLeave:kl(t.onMouseLeave,a.onClose),onMouseDown:kl(t.onMouseDown,()=>{a.onClose(),p.current=!0,document.addEventListener("mouseup",g,{once:!0})}),onFocus:kl(t.onFocus,()=>{p.current||a.onOpen()}),onBlur:kl(t.onBlur,a.onClose),onClick:kl(t.onClick,a.onClose)})))}),ER=se.forwardRef((t,e)=>{const{forceMount:n,...i}=t,a=ad("TooltipContent",t.__scopeTooltip);return se.createElement(M0,{present:n||a.open},se.createElement(xR,di({ref:e},i)))}),xR=se.forwardRef((t,e)=>{const{__scopeTooltip:n,children:i,"aria-label":a,portalled:u=!0,...f}=t,p=ad("TooltipContent",n),g=sd(n),S=u?XT:se.Fragment,{onClose:m}=p;return pR(()=>m()),se.useEffect(()=>(document.addEventListener("tooltip.open",m),()=>document.removeEventListener("tooltip.open",m)),[m]),se.createElement(S,null,se.createElement(CR,{__scopeTooltip:n}),se.createElement(dR,di({"data-state":p.stateAttribute},g,f,{ref:e,style:{...f.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)"}}),se.createElement(zy,null,i),se.createElement(GT,{id:p.contentId,role:"tooltip"},a||i)))}),wR=se.forwardRef((t,e)=>{const{__scopeTooltip:n,...i}=t,a=sd(n);return se.createElement(hR,di({},a,i,{ref:e}))});function CR(t){const{__scopeTooltip:e}=t,n=ad("CheckTriggerMoved",e),i=g0(n.trigger),a=i==null?void 0:i.left,u=O0(a),f=i==null?void 0:i.top,p=O0(f),g=n.onClose;return se.useEffect(()=>{(u!==void 0&&u!==a||p!==void 0&&p!==f)&&g()},[g,u,p,a,f]),null}const TR=SR,RR=bR,AR=ER,MR=wR;function OR(t,e){if(t==null)return{};var n={},i=Object.keys(t),a,u;for(u=0;u<i.length;u++)a=i[u],!(e.indexOf(a)>=0)&&(n[a]=t[a]);return n}function Ts(t,e){if(t==null)return{};var n=OR(t,e),i,a;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(t);for(a=0;a<u.length;a++)i=u[a],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}let wi;(function(t){t[t.UNSUPPORTED_INPUT=0]="UNSUPPORTED_INPUT",t[t.NO_COMPONENT_FOR_TYPE=1]="NO_COMPONENT_FOR_TYPE",t[t.UNKNOWN_INPUT=2]="UNKNOWN_INPUT",t[t.DUPLICATE_KEYS=3]="DUPLICATE_KEYS",t[t.ALREADY_REGISTERED_TYPE=4]="ALREADY_REGISTERED_TYPE",t[t.CLIPBOARD_ERROR=5]="CLIPBOARD_ERROR",t[t.THEME_ERROR=6]="THEME_ERROR",t[t.PATH_DOESNT_EXIST=7]="PATH_DOESNT_EXIST",t[t.INPUT_TYPE_OVERRIDE=8]="INPUT_TYPE_OVERRIDE",t[t.EMPTY_KEY=9]="EMPTY_KEY"})(wi||(wi={}));const _R={[wi.UNSUPPORTED_INPUT]:(t,e)=>[`An input with type \`${t}\` input was found at path \`${e}\` but it's not supported yet.`],[wi.NO_COMPONENT_FOR_TYPE]:(t,e)=>[`Type \`${t}\` found at path \`${e}\` can't be displayed in panel because no component supports it yet.`],[wi.UNKNOWN_INPUT]:(t,e)=>[`input at path \`${t}\` is not recognized.`,e],[wi.DUPLICATE_KEYS]:(t,e,n)=>[`Key \`${t}\` of path \`${e}\` already exists at path \`${n}\`. Even nested keys need to be unique. Rename one of the keys.`],[wi.ALREADY_REGISTERED_TYPE]:t=>[`Type ${t} has already been registered. You can't register a component with the same type.`],[wi.CLIPBOARD_ERROR]:t=>["Error copying the value",t],[wi.THEME_ERROR]:(t,e)=>[`Error accessing the theme \`${t}.${e}\` value.`],[wi.PATH_DOESNT_EXIST]:t=>[`Error getting the value at path \`${t}\`. There is probably an error in your \`render\` function.`],[wi.PATH_DOESNT_EXIST]:t=>[`Error accessing the value at path \`${t}\``],[wi.INPUT_TYPE_OVERRIDE]:(t,e,n)=>[`Input at path \`${t}\` already exists with type: \`${e}\`. Its type cannot be overridden with type \`${n}\`.`],[wi.EMPTY_KEY]:()=>["Keys can not be empty, if you want to hide a label use whitespace."]};function L0(t,e,...n){const[i,...a]=_R[e](...n);console[t]("LEVA: "+i,...a)}const P0=L0.bind(null,"warn");L0.bind(null,"log");function BN(t){return t}function LR(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function D0(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),n.push.apply(n,i)}return n}function to(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?D0(Object(n),!0).forEach(function(i){LR(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):D0(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}const aa=(t,e,n)=>t>n?n:t<e?e:t,PR=t=>{if(t===""||typeof t=="number")return t;try{const e=oa(t);if(!isNaN(e))return e}catch{}return parseFloat(t)},DR=Math.log(10);function k0(t){let e=Math.abs(+String(t).replace(".",""));if(e===0)return .01;for(;e!==0&&e%10===0;)e/=10;const n=Math.floor(Math.log(e)/DR)+1,i=Math.floor(Math.log10(Math.abs(t))),a=Math.pow(10,i-n);return Math.max(a,.001)}const kR=(t,e,n)=>n===e?0:(aa(t,e,n)-e)/(n-e),I0=(t,e,n)=>t*(n-e)+e,N0=/\(([0-9+\-*/^ .]+)\)/,z0=/(\d+(?:\.\d+)?) ?\^ ?(\d+(?:\.\d+)?)/,U0=/(\d+(?:\.\d+)?) ?\* ?(\d+(?:\.\d+)?)/,j0=/(\d+(?:\.\d+)?) ?\/ ?(\d+(?:\.\d+)?)/,F0=/(\d+(?:\.\d+)?) ?\+ ?(\d+(?:\.\d+)?)/,B0=/(\d+(?:\.\d+)?) ?- ?(\d+(?:\.\d+)?)/;function oa(t){if(isNaN(Number(t)))if(N0.test(t)){const e=t.replace(N0,(n,i)=>String(oa(i)));return oa(e)}else if(z0.test(t)){const e=t.replace(z0,(n,i,a)=>String(Math.pow(Number(i),Number(a))));return oa(e)}else if(U0.test(t)){const e=t.replace(U0,(n,i,a)=>String(Number(i)*Number(a)));return oa(e)}else if(j0.test(t)){const e=t.replace(j0,(n,i,a)=>{if(a!=0)return String(Number(i)/Number(a));throw new Error("Division by zero")});return oa(e)}else if(F0.test(t)){const e=t.replace(F0,(n,i,a)=>String(Number(i)+Number(a)));return oa(e)}else if(B0.test(t)){const e=t.replace(B0,(n,i,a)=>String(Number(i)-Number(a)));return oa(e)}else return Number(t);return Number(t)}let H0;(function(t){t.BUTTON="BUTTON",t.BUTTON_GROUP="BUTTON_GROUP",t.MONITOR="MONITOR",t.FOLDER="FOLDER"})(H0||(H0={}));let V0;(function(t){t.SELECT="SELECT",t.IMAGE="IMAGE",t.NUMBER="NUMBER",t.COLOR="COLOR",t.STRING="STRING",t.BOOLEAN="BOOLEAN",t.INTERVAL="INTERVAL",t.VECTOR3D="VECTOR3D",t.VECTOR2D="VECTOR2D"})(V0||(V0={}));const IR=t=>t.shiftKey?5:t.altKey?1/5:1,NR=["value"],zR=["min","max"],UR=t=>{if(typeof t=="number")return!0;if(typeof t=="string"){const e=parseFloat(t);return isNaN(e)?!1:t.substring((""+e).length).trim().length<4}return!1},jR=(t,{min:e=-1/0,max:n=1/0,suffix:i})=>{const a=parseFloat(t);if(t===""||isNaN(a))throw Error("Invalid number");const u=aa(a,e,n);return i?u+i:u},FR=(t,{pad:e=0,suffix:n})=>{const i=parseFloat(t).toFixed(e);return n?i+n:i},BR=t=>{let{value:e}=t,n=Ts(t,NR);const{min:i=-1/0,max:a=1/0}=n,u=Ts(n,zR);let f=parseFloat(e);const p=typeof e=="string"?e.substring((""+f).length):void 0;f=aa(f,i,a);let g=n.step;g||(Number.isFinite(i)?Number.isFinite(a)?g=+(Math.abs(a-i)/100).toPrecision(1):g=+(Math.abs(f-i)/100).toPrecision(1):Number.isFinite(a)&&(g=+(Math.abs(a-f)/100).toPrecision(1)));const S=g?k0(g)*10:k0(f);g=g||S/10;const m=Math.round(aa(Math.log10(1/S),0,2));return{value:p?f+p:f,settings:to({initialValue:f,step:g,pad:m,min:i,max:a,suffix:p},u)}},$0=(t,{step:e,initialValue:n})=>{const i=Math.round((t-n)/e);return n+i*e};var HR=Object.freeze({__proto__:null,schema:UR,sanitize:jR,format:FR,normalize:BR,sanitizeStep:$0});function er(){return er=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},er.apply(this,arguments)}const VR=T.createContext({});function Rs(){return T.useContext(VR)}const $R=T.createContext(null);T.createContext(null);const WR=T.createContext(null);function qR(){return T.useContext(WR)}const YR=()=>({colors:{elevation1:"#292d39",elevation2:"#181c20",elevation3:"#373c4b",accent1:"#0066dc",accent2:"#007bff",accent3:"#3c93ff",highlight1:"#535760",highlight2:"#8c92a4",highlight3:"#fefefe",vivid1:"#ffcc00",folderWidgetColor:"$highlight2",folderTextColor:"$highlight3",toolTipBackground:"$highlight3",toolTipText:"$elevation2"},radii:{xs:"2px",sm:"3px",lg:"10px"},space:{xs:"3px",sm:"6px",md:"10px",rowGap:"7px",colGap:"7px"},fonts:{mono:"ui-monospace, SFMono-Regular, Menlo, 'Roboto Mono', monospace",sans:"system-ui, sans-serif"},fontSizes:{root:"11px",toolTip:"$root"},sizes:{rootWidth:"280px",controlWidth:"160px",numberInputMinWidth:"38px",scrubberWidth:"8px",scrubberHeight:"16px",rowHeight:"24px",folderTitleHeight:"20px",checkboxSize:"16px",joystickWidth:"100px",joystickHeight:"100px",colorPickerWidth:"$controlWidth",colorPickerHeight:"100px",imagePreviewWidth:"$controlWidth",imagePreviewHeight:"100px",monitorHeight:"60px",titleBarHeight:"39px"},shadows:{level1:"0 0 9px 0 #00000088",level2:"0 4px 14px #00000033"},borderWidths:{root:"0px",input:"1px",focus:"1px",hover:"1px",active:"1px",folder:"1px"},fontWeights:{label:"normal",folder:"normal",button:"normal"}});function od(t,e){const[n,i]=t.split(" "),a={};return n!=="none"&&(a.boxShadow=`${e.inset?"inset ":""}0 0 0 $borderWidths${[e.key]} $colors${n!=="default"&&n||e.borderColor}`),i&&(a.backgroundColor=i),a}const oc={$inputStyle:()=>t=>od(t,{key:"$input",borderColor:"$highlight1",inset:!0}),$focusStyle:()=>t=>od(t,{key:"$focus",borderColor:"$accent2"}),$hoverStyle:()=>t=>od(t,{key:"$hover",borderColor:"$accent1",inset:!0}),$activeStyle:()=>t=>od(t,{key:"$active",borderColor:"$accent1",inset:!0})},{styled:Ut,css:HN,createTheme:VN,globalCss:QR,keyframes:$N}=KC({prefix:"leva",theme:YR(),utils:to(to({},oc),{},{$flex:()=>({display:"flex",alignItems:"center"}),$flexCenter:()=>({display:"flex",alignItems:"center",justifyContent:"center"}),$reset:()=>({outline:"none",fontSize:"inherit",fontWeight:"inherit",color:"inherit",fontFamily:"inherit",border:"none",backgroundColor:"transparent",appearance:"none"}),$draggable:()=>({touchAction:"none",WebkitUserDrag:"none",userSelect:"none"}),$focus:t=>({"&:focus":oc.$focusStyle()(t)}),$focusWithin:t=>({"&:focus-within":oc.$focusStyle()(t)}),$hover:t=>({"&:hover":oc.$hoverStyle()(t)}),$active:t=>({"&:active":oc.$activeStyle()(t)})})});QR({".leva__panel__dragged":{WebkitUserDrag:"none",userSelect:"none",input:{userSelect:"none"},"*":{cursor:"ew-resize !important"}}});function GR(t,e){const{theme:n}=T.useContext($R);if(!(t in n)||!(e in n[t]))return P0(wi.THEME_ERROR,t,e),"";let i=e;for(;;){let a=n[t][i];if(typeof a=="string"&&a.charAt(0)==="$")i=a.substr(1);else return a}}const W0=Ut("input",{$reset:"",padding:"0 $sm",width:0,minWidth:0,flex:1,height:"100%",variants:{levaType:{number:{textAlign:"right"}},as:{textarea:{padding:"$sm"}}}}),q0=Ut("div",{$draggable:"",height:"100%",$flexCenter:"",position:"relative",padding:"0 $xs",fontSize:"0.8em",opacity:.8,cursor:"default",touchAction:"none",[`& + ${W0}`]:{paddingLeft:0}}),XR=Ut(q0,{cursor:"ew-resize",marginRight:"-$xs",textTransform:"uppercase",opacity:.3,"&:hover":{opacity:1},variants:{dragging:{true:{backgroundColor:"$accent2",opacity:1}}}}),KR=Ut("div",{$flex:"",position:"relative",borderRadius:"$sm",overflow:"hidden",color:"inherit",height:"$rowHeight",backgroundColor:"$elevation3",$inputStyle:"$elevation1",$hover:"",$focusWithin:"",variants:{textArea:{true:{height:"auto"}}}}),ZR=["innerLabel","value","onUpdate","onChange","onKeyDown","type","id","inputType","rows"],JR=["onUpdate"];function Y0(t){let{innerLabel:e,value:n,onUpdate:i,onChange:a,onKeyDown:u,type:f,id:p,inputType:g="text",rows:S=0}=t,m=Ts(t,ZR);const{id:x,emitOnEditStart:R,emitOnEditEnd:_,disabled:M}=Rs(),k=p||x,L=T.useRef(null),P=S>0,O=P?"textarea":"input",j=T.useCallback(H=>Z=>{const ie=Z.currentTarget.value;H(ie)},[]);T.useEffect(()=>{const H=L.current,Z=j(ie=>{i(ie),_()});return H==null||H.addEventListener("blur",Z),()=>H==null?void 0:H.removeEventListener("blur",Z)},[j,i,_]);const q=T.useCallback(H=>{H.key==="Enter"&&j(i)(H)},[j,i]),ee=Object.assign({as:O},P?{rows:S}:{},m);return T.createElement(KR,{textArea:P},e&&typeof e=="string"?T.createElement(q0,null,e):e,T.createElement(W0,er({levaType:f,ref:L,id:k,type:g,autoComplete:"off",spellCheck:"false",value:n,onChange:j(a),onFocus:()=>R(),onKeyPress:q,onKeyDown:u,disabled:M},ee)))}function eA(t){let{onUpdate:e}=t,n=Ts(t,JR);const i=T.useCallback(u=>e(PR(u)),[e]),a=T.useCallback(u=>{const f=u.key==="ArrowUp"?1:u.key==="ArrowDown"?-1:0;if(f){u.preventDefault();const p=u.altKey?.1:u.shiftKey?10:1;e(g=>parseFloat(g)+f*p)}},[e]);return T.createElement(Y0,er({},n,{onUpdate:i,onKeyDown:a,type:"number"}))}const Yp=Ut("div",{}),Q0=Ut("div",{position:"relative",background:"$elevation2",transition:"height 300ms ease",variants:{fill:{true:{},false:{}},flat:{false:{},true:{}},isRoot:{true:{},false:{paddingLeft:"$md","&::after":{content:'""',position:"absolute",left:0,top:0,width:"$borderWidths$folder",height:"100%",backgroundColor:"$folderWidgetColor",opacity:.4,transform:"translateX(-50%)"}}}},compoundVariants:[{isRoot:!0,fill:!1,css:{overflowY:"auto",maxHeight:"calc(100vh - 20px - $$titleBarHeight)"}},{isRoot:!0,flat:!1,css:{borderRadius:"$lg"}}]});Ut("div",{$flex:"",color:"$folderTextColor",userSelect:"none",cursor:"pointer",height:"$folderTitleHeight",fontWeight:"$folder","> svg":{marginLeft:-4,marginRight:4,cursor:"pointer",fill:"$folderWidgetColor",opacity:.6},"&:hover > svg":{fill:"$folderWidgetColor"},[`&:hover + ${Q0}::after`]:{opacity:.6},[`${Yp}:hover > & + ${Q0}::after`]:{opacity:.6},[`${Yp}:hover > & > svg`]:{opacity:1}});const tA=Ut("div",{position:"relative",display:"grid",gridTemplateColumns:"100%",rowGap:"$rowGap",transition:"opacity 250ms ease",variants:{toggled:{true:{opacity:1,transitionDelay:"250ms"},false:{opacity:0,transitionDelay:"0ms",pointerEvents:"none"}},isRoot:{true:{"& > div":{paddingLeft:"$md",paddingRight:"$md"},"& > div:first-of-type":{paddingTop:"$sm"},"& > div:last-of-type":{paddingBottom:"$sm"},[`> ${Yp}:not(:first-of-type)`]:{paddingTop:"$sm",marginTop:"$md",borderTop:"$borderWidths$folder solid $colors$elevation1"}}}}}),G0=Ut("div",{position:"relative",zIndex:100,display:"grid",rowGap:"$rowGap",gridTemplateRows:"minmax($sizes$rowHeight, max-content)",alignItems:"center",color:"$highlight2",[`${tA} > &`]:{"&:first-of-type":{marginTop:"$rowGap"},"&:last-of-type":{marginBottom:"$rowGap"}},variants:{disabled:{true:{pointerEvents:"none"},false:{"&:hover,&:focus-within":{color:"$highlight3"}}}}}),nA=Ut(G0,{gridTemplateColumns:"auto $sizes$controlWidth",columnGap:"$colGap"}),iA=Ut("div",{$flex:"",height:"100%",position:"relative",overflow:"hidden","& > div":{marginLeft:"$colGap",padding:"0 $xs",opacity:.4},"& > div:hover":{opacity:.8},"& > div > svg":{display:"none",cursor:"pointer",width:13,minWidth:13,height:13,backgroundColor:"$elevation2"},"&:hover > div > svg":{display:"block"},variants:{align:{top:{height:"100%",alignItems:"flex-start",paddingTop:"$sm"}}}}),rA=Ut("input",{$reset:"",height:0,width:0,opacity:0,margin:0,"& + label":{position:"relative",$flexCenter:"",height:"100%",userSelect:"none",cursor:"pointer",paddingLeft:2,paddingRight:"$sm",pointerEvents:"auto"},"& + label:after":{content:'""',width:6,height:6,backgroundColor:"$elevation3",borderRadius:"50%",$activeStyle:""},"&:focus + label:after":{$focusStyle:""},"& + label:active:after":{backgroundColor:"$accent1",$focusStyle:""},"&:checked + label:after":{backgroundColor:"$accent1"}}),Qp=Ut("label",{fontWeight:"$label",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","& > svg":{display:"block"}});Ut("div",{opacity:1,variants:{disabled:{true:{opacity:.6,pointerEvents:"none",[`& ${Qp}`]:{pointerEvents:"auto"}}}}}),Ut("div",{position:"fixed",top:0,bottom:0,right:0,left:0,zIndex:1e3,userSelect:"none"});const sA=Ut("div",{background:"$toolTipBackground",fontFamily:"$sans",fontSize:"$toolTip",padding:"$xs $sm",color:"$toolTipText",borderRadius:"$xs",boxShadow:"$level2",maxWidth:260}),aA=Ut(MR,{fill:"$toolTipBackground"}),oA=["align"];function lA(){const{id:t,disable:e,disabled:n}=Rs();return T.createElement(T.Fragment,null,T.createElement(rA,{id:t+"__disable",type:"checkbox",checked:!n,onChange:()=>e(!n)}),T.createElement("label",{htmlFor:t+"__disable"}))}function uA(t){const{id:e,optional:n,hint:i}=Rs(),a=t.htmlFor||(e?{htmlFor:e}:null),u=!i&&typeof t.children=="string"?{title:t.children}:null;return T.createElement(T.Fragment,null,n&&T.createElement(lA,null),i!==void 0?T.createElement(TR,null,T.createElement(RR,{asChild:!0},T.createElement(Qp,er({},a,t))),T.createElement(AR,{side:"top",sideOffset:2},T.createElement(sA,null,i,T.createElement(aA,null)))):T.createElement(Qp,er({},a,u,t)))}function ld(t){let{align:e}=t,n=Ts(t,oA);const{value:i,label:a,key:u,disabled:f}=Rs(),{hideCopyButton:p}=qR(),g=!p&&u!==void 0,[S,m]=T.useState(!1),x=async()=>{try{await navigator.clipboard.writeText(JSON.stringify({[u]:i??""})),m(!0)}catch{P0(wi.CLIPBOARD_ERROR,{[u]:i})}};return T.createElement(iA,{align:e,onPointerLeave:()=>m(!1)},T.createElement(uA,n),g&&!f&&T.createElement("div",{title:`Click to copy ${typeof a=="string"?a:u} value`},S?T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},T.createElement("path",{d:"M9 2a1 1 0 000 2h2a1 1 0 100-2H9z"}),T.createElement("path",{fillRule:"evenodd",d:"M4 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v11a2 2 0 01-2 2H6a2 2 0 01-2-2V5zm9.707 5.707a1 1 0 00-1.414-1.414L9 12.586l-1.293-1.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})):T.createElement("svg",{onClick:x,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},T.createElement("path",{d:"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"}),T.createElement("path",{d:"M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z"}))))}const cA=["toggled"],fA=Ut("svg",{fill:"currentColor",transition:"transform 350ms ease, fill 250ms ease"});function dA(t){let{toggled:e}=t,n=Ts(t,cA);return T.createElement(fA,er({width:"9",height:"5",viewBox:"0 0 9 5",xmlns:"http://www.w3.org/2000/svg",style:{transform:`rotate(${e?0:-90}deg)`}},n),T.createElement("path",{d:"M3.8 4.4c.4.3 1 .3 1.4 0L8 1.7A1 1 0 007.4 0H1.6a1 1 0 00-.7 1.7l3 2.7z"}))}const hA=["input"];function ud(t){let{input:e}=t,n=Ts(t,hA);return e?T.createElement(nA,n):T.createElement(G0,n)}function X0(t,e){const{emitOnEditStart:n,emitOnEditEnd:i}=Rs();return $T(a=>{a.first&&(document.body.classList.add("leva__panel__dragged"),n==null||n());const u=t(a);return a.last&&(document.body.classList.remove("leva__panel__dragged"),i==null||i()),u},e)}const pA=Ut("div",{variants:{hasRange:{true:{position:"relative",display:"grid",gridTemplateColumns:"auto $sizes$numberInputMinWidth",columnGap:"$colGap",alignItems:"center"}}}}),vA=Ut("div",{position:"relative",width:"100%",height:2,borderRadius:"$xs",backgroundColor:"$elevation1"}),mA=Ut("div",{position:"absolute",width:"$scrubberWidth",height:"$scrubberHeight",borderRadius:"$xs",boxShadow:"0 0 0 2px $colors$elevation2",backgroundColor:"$accent2",cursor:"pointer",$active:"none $accent1",$hover:"none $accent3",variants:{position:{left:{borderTopRightRadius:0,borderBottomRightRadius:0,transform:"translateX(calc(-0.5 * ($sizes$scrubberWidth + 4px)))"},right:{borderTopLeftRadius:0,borderBottomLeftRadius:0,transform:"translateX(calc(0.5 * ($sizes$scrubberWidth + 4px)))"}}}}),gA=Ut("div",{position:"relative",$flex:"",height:"100%",cursor:"pointer",touchAction:"none"}),yA=Ut("div",{position:"absolute",height:"100%",backgroundColor:"$accent2"});function SA({value:t,min:e,max:n,onDrag:i,step:a,initialValue:u}){const f=T.useRef(null),p=T.useRef(null),g=T.useRef(0),S=GR("sizes","scrubberWidth"),m=X0(({event:R,first:_,xy:[M],movement:[k],memo:L})=>{if(_){const{width:O,left:j}=f.current.getBoundingClientRect();g.current=O-parseFloat(S),L=(R==null?void 0:R.target)===p.current?t:I0((M-j)/O,e,n)}const P=L+I0(k/g.current,0,n-e);return i($0(P,{step:a,initialValue:u})),L}),x=kR(t,e,n);return T.createElement(gA,er({ref:f},m()),T.createElement(vA,null,T.createElement(yA,{style:{left:0,right:`${(1-x)*100}%`}})),T.createElement(mA,{ref:p,style:{left:`calc(${x} * (100% - ${S}))`}}))}const bA=T.memo(({label:t,onUpdate:e,step:n,innerLabelTrim:i})=>{const[a,u]=T.useState(!1),f=X0(({active:p,delta:[g],event:S,memo:m=0})=>(u(p),m+=g/2,Math.abs(m)>=1&&(e(x=>parseFloat(x)+Math.floor(m)*n*IR(S)),m=0),m));return T.createElement(XR,er({dragging:a,title:t.length>1?t:""},f()),t.slice(0,i))});function EA({label:t,id:e,displayValue:n,onUpdate:i,onChange:a,settings:u,innerLabelTrim:f=1}){const p=f>0&&T.createElement(bA,{label:t,step:u.step,onUpdate:i,innerLabelTrim:f});return T.createElement(eA,{id:e,value:String(n),onUpdate:i,onChange:a,innerLabel:p})}function xA(){const t=Rs(),{label:e,value:n,onUpdate:i,settings:a,id:u}=t,{min:f,max:p}=a,g=p!==1/0&&f!==-1/0;return T.createElement(ud,{input:!0},T.createElement(ld,null,e),T.createElement(pA,{hasRange:g},g&&T.createElement(SA,er({value:parseFloat(n),onDrag:i},a)),T.createElement(EA,er({},t,{id:u,label:"value",innerLabelTrim:g?0:1}))))}const wA=Ts(HR,["sanitizeStep"]);to({component:xA},wA);var CA=Object.freeze({__proto__:null,schema:(t,e)=>sa().schema({options:sa().passesAnyOf(sa().object(),sa().array())}).test(e),sanitize:(t,{values:e})=>{if(e.indexOf(t)<0)throw Error("Selected value doesn't match Select options");return t},format:(t,{values:e})=>e.indexOf(t),normalize:t=>{let{value:e,options:n}=t,i,a;return Array.isArray(n)?(a=n,i=n.map(u=>String(u))):(a=Object.values(n),i=Object.keys(n)),"value"in t?a.includes(e)||(i.unshift(String(e)),a.unshift(e)):e=a[0],Object.values(n).includes(e)||(n[String(e)]=e),{value:e,settings:{keys:i,values:a}}}});const TA=Ut("div",{$flexCenter:"",position:"relative","> svg":{pointerEvents:"none",position:"absolute",right:"$md"}}),Gp=Ut("select",{position:"absolute",top:0,left:0,width:"100%",height:"100%",opacity:0}),RA=Ut("div",{display:"flex",alignItems:"center",width:"100%",height:"$rowHeight",backgroundColor:"$elevation3",borderRadius:"$sm",padding:"0 $sm",cursor:"pointer",[`${Gp}:focus + &`]:{$focusStyle:""},[`${Gp}:hover + &`]:{$hoverStyle:""}});function AA({displayValue:t,value:e,onUpdate:n,id:i,settings:a,disabled:u}){const{keys:f,values:p}=a,g=T.useRef();return e===p[t]&&(g.current=f[t]),T.createElement(TA,null,T.createElement(Gp,{id:i,value:t,onChange:S=>n(p[Number(S.currentTarget.value)]),disabled:u},f.map((S,m)=>T.createElement("option",{key:S,value:m},S))),T.createElement(RA,null,g.current),T.createElement(dA,{toggled:!0}))}function MA(){const{label:t,value:e,displayValue:n,onUpdate:i,id:a,disabled:u,settings:f}=Rs();return T.createElement(ud,{input:!0},T.createElement(ld,null,t),T.createElement(AA,{id:a,value:e,displayValue:n,onUpdate:i,settings:f,disabled:u}))}to({component:MA},CA);var OA=Object.freeze({__proto__:null,schema:t=>sa().string().test(t),sanitize:t=>{if(typeof t!="string")throw Error("Invalid string");return t},normalize:({value:t,editable:e=!0,rows:n=!1})=>({value:t,settings:{editable:e,rows:typeof n=="number"?n:n?5:0}})});const _A=["displayValue","onUpdate","onChange","editable"],LA=Ut("div",{whiteSpace:"pre-wrap"});function PA(t){let{displayValue:e,onUpdate:n,onChange:i,editable:a=!0}=t,u=Ts(t,_A);return a?T.createElement(Y0,er({value:e,onUpdate:n,onChange:i},u)):T.createElement(LA,null,e)}function DA(){const{label:t,settings:e,displayValue:n,onUpdate:i,onChange:a}=Rs();return T.createElement(ud,{input:!0},T.createElement(ld,null,t),T.createElement(PA,er({displayValue:n,onUpdate:i,onChange:a},e)))}to({component:DA},OA);var kA=Object.freeze({__proto__:null,schema:t=>sa().boolean().test(t),sanitize:t=>{if(typeof t!="boolean")throw Error("Invalid boolean");return t}});const IA=Ut("div",{position:"relative",$flex:"",height:"$rowHeight",input:{$reset:"",height:0,width:0,opacity:0,margin:0},label:{position:"relative",$flexCenter:"",userSelect:"none",cursor:"pointer",height:"$checkboxSize",width:"$checkboxSize",backgroundColor:"$elevation3",borderRadius:"$sm",$hover:""},"input:focus + label":{$focusStyle:""},"input:focus:checked + label, input:checked + label:hover":{$hoverStyle:"$accent3"},"input + label:active":{backgroundColor:"$accent1"},"input:checked + label:active":{backgroundColor:"$accent1"},"label > svg":{display:"none",width:"90%",height:"90%",stroke:"$highlight3"},"input:checked + label":{backgroundColor:"$accent2"},"input:checked + label > svg":{display:"block"}});function NA({value:t,onUpdate:e,id:n,disabled:i}){return T.createElement(IA,null,T.createElement("input",{id:n,type:"checkbox",checked:t,onChange:a=>e(a.currentTarget.checked),disabled:i}),T.createElement("label",{htmlFor:n},T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},T.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"}))))}function zA(){const{label:t,value:e,onUpdate:n,disabled:i,id:a}=Rs();return T.createElement(ud,{input:!0},T.createElement(ld,null,t),T.createElement(NA,{value:e,onUpdate:n,id:a,disabled:i}))}to({component:zA},kA),Ut("div",{display:"grid",columnGap:"$colGap",gridAutoFlow:"column dense",alignItems:"center",variants:{withLock:{true:{gridTemplateColumns:"10px auto","> svg":{cursor:"pointer"}}}}});class no extends Gr{constructor(e){super(),this.type="spacial-content",this.style={opacity:1},this.format="jpg",this.tileUrl=yC(e.url),this.id=e.id||`${this.tileUrl}--${e.scaleFactor}`,this.points=e.displayPoints?e.displayPoints:ws(e.points,ra(e.scaleFactor)),this.tileWidth=e.tileWidth,this.display={x:0,y:0,width:e.width/e.scaleFactor,height:e.height/e.scaleFactor,points:e.points,scale:e.scaleFactor},e.format&&(this.format=e.format)}applyProps(e){if(e.style&&typeof e.style.opacity<"u"&&(this.style.opacity=e.style.opacity),e.service!==this.service&&(this.service=e.service),e.format?this.format=e.format:this.format="jpg",e.crop){this.cropData=e.crop;const n=qe([...this.points]),i=n.length/5,a=e.crop.x||0,u=e.crop.y||0,f=e.crop.x+e.crop.width,p=e.crop.y+e.crop.height;for(let g=0;g<i;g++){const S=g*5;n[S+1]<f&&n[S+3]>a&&n[S+2]<p&&n[S+4]>u?(n[S+1]=aa(n[S+1],a,f),n[S+3]=aa(n[S+3],a,f),n[S+2]=aa(n[S+2],u,p),n[S+4]=aa(n[S+4],u,p)):n[S]=0}Qr(n,Ei(-e.crop.x,-e.crop.y)),this.crop?this.crop.set(n):this.crop=n}}static fromTile(e,n,i,a,u,f){i.height=i.height?i.height:i.width;const p=Math.ceil(n.width/a),g=Math.ceil(n.height/a),S=Math.ceil(p/i.width),m=Math.ceil(g/i.height),x=Tt.grid(S,m),R=Tt.grid(S,m);for(let M=0;M<m;M++)for(let k=0;k<S;k++){const L=k*i.width,P=M*i.height;R.addPoints(L*a,P*a,k===S-1?n.width:(L+i.width)*a,M===m-1?n.height:(P+i.height)*a),x.addPoints(L,P,k===S-1?p:L+i.width,M===m-1?g:P+i.height)}const _=new no({url:e,scaleFactor:a,points:x.build(),displayPoints:R.build(),width:n.width,height:n.height,tileWidth:i.width,format:f});return _.applyProps({service:u}),_}getImageUrl(e){const n=this.points.slice(e*5,e*5+5),i=n[3]-n[1],a=n[4]-n[2],u=Math.ceil(i/this.display.scale);return`${this.tileUrl}/${n[1]},${n[2]},${i},${a}/${u>this.tileWidth?this.tileWidth:u},/0/default.${this.format||"jpg"}`}getAllPointsAt(e,n,i){const a=ec(this.crop||this.points,e);return[[this,a,n]]}transform(e){Qr(this.points,e)}getScheduledUpdates(e,n){return[]}}class UA extends Gr{constructor(){super(...arguments),this.type="spacial-content"}getAllPointsAt(e,n,i){return[[this,this.points,n]]}}class jA extends UA{constructor(e){super(),this.images=[],this.allImages=[],this.scaleFactors=[],this.aggregateBuffer=qe(9),this.isFullyLoaded=!1,this.maxScaleFactor=0,this._scheduleSortByScales=!1,this._sortByScales=()=>{this._scheduleSortByScales=!1,this.allImages.sort((i,a)=>a.display.width-i.display.width),this.images=[];let n=.1;for(const i of this.allImages){if(i.display.width<this.renderOptions.minSize&&i.display.height<this.renderOptions.minSize&&!i.priority||i instanceof Ar&&(i.display.width>this.renderOptions.maxImageSize||i.display.height>this.renderOptions.maxImageSize)&&!i.priority)continue;if(Math.abs(i.display.scale-n)<.25||i.priority){const u=this.images.pop();u&&(u instanceof Ar||u.priority)?(i.priority&&this.images.push(i),this.images.push(u)):i&&this.images.push(i)}else i&&this.images.push(i);n=i.display.scale}this.images.length===0&&(this.images=[...this.allImages]),this.scaleFactors=this.images.map(i=>i.display.scale),this.maxScaleFactor=Math.max(...this.scaleFactors)},this.loadFullResource=async()=>{if(!this.isFullyLoaded&&this.lazyLoader){this.isFullyLoaded=!0;const n=await this.lazyLoader();this.addImages(n)}},this.fallback=[this.loadFullResource],this.id=e.id,this.points=Tt.singleBox(e.width,e.height),this.lazyLoader=e.loadFullImages,e.loadFullImages||(this.isFullyLoaded=!0),this.display={x:0,y:0,points:Tt.singleBox(e.width,e.height),height:e.height,width:e.width,scale:1},this.renderOptions={renderSmallestFallback:!0,renderLayers:3,minSize:255,maxImageSize:1024,quality:1.2,...e.renderOptions||{}},this.addImages(e.images)}applyProps(e){typeof e.renderSmallestFallback<"u"&&e.renderSmallestFallback!==this.renderOptions.renderSmallestFallback&&(this.renderOptions.renderSmallestFallback=e.renderSmallestFallback),typeof e.renderLayers<"u"&&e.renderLayers!==this.renderOptions.renderLayers&&(this.renderOptions.renderLayers=e.renderLayers),typeof e.minSize<"u"&&e.minSize!==this.renderOptions.minSize&&(this.renderOptions.minSize=e.minSize),typeof e.maxImageSize<"u"&&e.maxImageSize!==this.renderOptions.maxImageSize&&(this.renderOptions.maxImageSize=e.maxImageSize),typeof e.quality<"u"&&e.quality!==this.renderOptions.quality&&(this.renderOptions.quality=e.quality)}appendChild(e){this.addImages([e])}removeChild(e){this.images.indexOf(e)!==-1&&(this.images=this.images.filter(n=>n!==e),this.sortByScales())}insertBefore(e,n){this.addImages([e])}hideInstance(){}addImages(e){for(const n of e)n.__parent=this,n.__owner=this.__owner;this.allImages.push(...e.filter(Boolean)),this.sortByScales()}sortByScales(){this._scheduleSortByScales=!0}getScheduledUpdates(e,n){return this._scheduleSortByScales?[this._sortByScales]:this.isFullyLoaded?[]:n>1/this.maxScaleFactor?this.fallback:[]}getAllPointsAt(e,n,i){if(this.images.length===0)return[];const a=gC(1/(i||1)/(window.devicePixelRatio||1),this.images,this.renderOptions.quality),u=this.images.length,f=n?xs(n,Ei(this.x,this.y)):Ei(this.x,this.y);if(a!==this.images.length-1&&this.images[a+1]){let p=[];for(let m=u-1;m>=a;m--)p.push(m);const g=p[0];this.renderOptions.renderLayers&&(p=p.slice(-this.renderOptions.renderLayers)),this.renderOptions.renderSmallestFallback&&p.indexOf(g)===-1&&p.unshift(g);const S=[];for(let m=0;m<p.length;m++)S.push(...this.images[p[m]].getAllPointsAt(e,f,i));return S}return this.images[a].getAllPointsAt(e,f,i)}}function cd(t,e,n,i,a){const u=Math.PI/180*a,f=Math.cos(u),p=Math.sin(u),g=f*(n-t)+p*(i-e)+t,S=f*(i-e)-p*(n-t)+e;return[g,S]}class lc extends Gr{constructor(e,n){super(),this.type="world-object",this.intersectionBuffer=qe(5),this.aggregateBuffer=qe(9),this.invertedBuffer=qe(9),this.rotation=0,this._updatedList=[];const{x:i=0,y:a=0}=n||{};e?(this.id=e.id||"",this.scale=1,this.layers=e.layers,this.points=qe([1,i,a,i+e.width,a+e.height]),this.worldPoints=qe([1,i,a,i+e.width,a+e.height]),this.filteredPointsBuffer=qe(e.layers.length*5)):(this.id="",this.scale=1,this.layers=[],this.points=qe(5),this.worldPoints=qe(5),this.filteredPointsBuffer=qe(5))}static createWithProps(e){const n=new lc;return n.applyProps(e),n}applyProps(e){const n=e.x||0,i=e.y||0;this.id=e.id;const a=typeof e.scale<"u"?e.scale:this.scale;this.points[0]=1,this.points[1]=n,this.points[2]=i,this.points[3]=n+e.width,this.points[4]=i+e.height,this.rotation=e.rotation||0,this.worldPoints[3]=this.worldPoints[1]+e.width,this.worldPoints[4]=this.worldPoints[2]+e.height,e.scale&&e.scale!==1&&this.atScale(a),this.scale=a}appendChild(e){e.points[0]===0&&e.points.set(this.points),e.__owner.value=this,this.addLayers([e])}removeChild(e){this.layers=this.layers.filter(n=>n!==e),this.filteredPointsBuffer=qe(this.layers.length*5)}insertBefore(e,n){const i=this.layers.indexOf(n);if(i===-1||this.layers.indexOf(e)!==-1)return;const a=this.layers.slice(0,i),u=this.layers.slice(i);this.layers=[...a,e,...u]}hideInstance(){console.warn("hideInstance: not yet implemented")}getObjectsAt(e,n){if(this.rotation&&(e=this.applyRotation(e)),ec(this.points,e,this.filteredPointsBuffer)[0]===0)return[];const a=this.layers.length,u=[];for(let f=0;f<a;f++){const p=this.layers[f];if(n&&p.isShape){const S=ws(p.points,Ei(this.x,this.y));if(!p.intersects([e[1]-S[1],e[2]-S[2]]))continue}if(ec(ws(p.points,Ei(this.x,this.y)),e,this.filteredPointsBuffer)[0]!==0&&u.push(p),n){const S=p;u.push(...S.getObjectsAt(e,n))}}return u}applyRotation(e){if(this.rotation){const n={x:e[1],y:e[2]},i={x:e[1],y:e[4]},a={x:e[3],y:e[2]},u={x:e[3],y:e[4]},f=this.points[1]+(this.points[3]-this.points[1])/2,p=this.points[2]+(this.points[4]-this.points[2])/2,[g,S]=cd(f,p,n.x,n.y,this.rotation),[m,x]=cd(f,p,i.x,i.y,this.rotation),[R,_]=cd(f,p,a.x,a.y,this.rotation),[M,k]=cd(f,p,u.x,u.y,this.rotation),L=Math.min(g,m,R,M),P=Math.max(g,m,R,M),O=Math.min(S,x,_,k),j=Math.max(S,x,_,k);return qe([e[0],L,O,P,j])}return e}getAllPointsAt(e,n,i){const a=xs(Ei(this.x,this.y),ra(this.scale),this.aggregateBuffer);this.rotation&&(e=this.applyRotation(e));const u=vC(e,this.points,this.intersectionBuffer),f=this.layers.length,p=[],g=ws(u,xs(ra(1/this.scale),Ei(-this.x,-this.y),this.invertedBuffer)),S=n?xs(n,a,this.aggregateBuffer):a,m=i*this.scale;for(let x=0;x<f;x++)p.push(...this.layers[x].getAllPointsAt(g,S,m));return p}addLayers(e){const n=[];for(const i of e)this.layers.indexOf(i)===-1&&(n.push(i),i.points.length===5&&(i.points[1]<this.worldPoints[1]/this.scale||i.points[2]<this.worldPoints[2]/this.scale||i.points[3]>this.worldPoints[3]/this.scale||i.points[4]>this.worldPoints[4]/this.scale)&&(i.crop=i.crop||qe([1,Math.max(this.worldPoints[1]/this.scale,i.points[1]),Math.max(this.worldPoints[2]/this.scale,i.points[2]),Math.min(this.worldPoints[3]/this.scale,i.points[3]),Math.min(this.worldPoints[4]/this.scale,i.points[4])])));this.layers=this.layers.concat(n),this.filteredPointsBuffer=qe(this.layers.length*5)}getScheduledUpdates(e,n){const i=this.layers.length;this._updatedList=[];const a=n*this.scale;for(let u=0;u<i;u++){const f=this.layers[u].getScheduledUpdates(e,a);f&&this._updatedList.push(...f)}return this._updatedList}}class Il extends Gr{constructor(e=0,n=0,i=100,a="left-to-right"){super(),this.id="world",this.aggregateBuffer=qe(9),this.isDirty=!1,this.zones=[],this.triggerQueue=[],this.activatedEvents=[],this._updatedList=[],this.translationBuffer=qe(9),this.needsRecalculate=!0,this.emptyPaintables=[],this.renderOrder=[],this.objects=[],this.subscriptions=[],this._propagateEventTargets=[],this._alreadyFlushed=[],this._width=e,this._height=n,this.aspectRatio=Number.isNaN(e/n)?1:e/n,this.viewingDirection=a,this.points=qe(i*5),this.filteredPointsBuffer=qe(i*5)}get x(){return 0}get y(){return 0}get width(){return this._width}get height(){return this._height}static withProps(e){const n=new Il;return n.applyProps(e),n}applyProps(e){typeof e.width<"u"&&typeof e.height<"u"&&(e.width!==this._width||e.height!==this._height)&&this.resize(e.width,e.height),e.viewingDirection!==this.viewingDirection&&(this.viewingDirection=e.viewingDirection,this.triggerRepaint())}propagateTouchEvent(e,n,i){const a=[];for(const u of i)if(u.x&&u.y){const f=Tt.singleBox(1,1,u.x,u.y);a.push(this.getObjectsAt(f,!0).reverse())}return a.map(u=>this.propagateEvent(e,n,u,{bubbles:!0,cancelable:!0}))}propagatePointerEvent(e,n,i,a,u={}){const f=Tt.singleBox(1,1,i,a),p=this.getObjectsAt(f,!0).reverse();return this.propagateEvent(e,n,p,u)}propagateEvent(e,n,i,{bubbles:a=!1,cancelable:u=!1}={}){n.atlasTarget=this,this._propagateEventTargets.length=1,this._propagateEventTargets[0]=this;let f=!1;n.stopPropagation=()=>{f=!0};const p=i.length;for(let m=p-1;m>=0;m--){this._propagateEventTargets.unshift(i[m][0]);const x=i[m][1].length;if(x)for(let R=0;R<x;R++)this._propagateEventTargets.unshift(i[m][1][R])}const g=this._propagateEventTargets.length;let S=!1;for(let m=0;m<g&&(n.atlasTarget=this._propagateEventTargets[m],n.atlasWorld=this,S=this._propagateEventTargets[m].dispatchEvent(e,n)||S,!f);m++);return S&&this.triggerRepaint(),this._propagateEventTargets}appendChild(e){const n=this.appendWorldObject(e);this.renderOrder.push(n/5)}removeChild(e){const n=this.objects.indexOf(e);if(n===-1){for(const i of this.objects)if(i&&i.id===e.id){this.removeChild(i);return}return}this.objects[n]=null,this.renderOrder=this.renderOrder.filter(i=>i!==n),this.points[n*5]=0,this.triggerRepaint(),this.needsRecalculate=!0}insertBefore(e,n){const i=this.objects.indexOf(n);if(i===-1)return;const a=this.appendWorldObject(e);this.renderOrder.splice(i-1,0,a/5)}hideInstance(){}asWorldObject(){return null}addZone(e){this.zones.push(e)}selectZone(e){if(typeof e=="string"){const n=this.zones.length;for(let i=0;i<n;i++)if(this.zones[i].id===e){this.selectedZone=i,this.trigger("zone-changed");return}}else this.zones[e]&&(this.selectedZone=e,this.trigger("zone-changed"))}deselectZone(){this.selectedZone=void 0}getActiveZone(){if(this.selectedZone)return this.zones[this.selectedZone]}hasActiveZone(){return typeof this.selectedZone<"u"}checkResizeInternalBuffer(){if(mC(this.points)===this.objects.length){const e=this.points,n=qe(this.points.length*2);n.set(e,0),this.points=n}}appendWorldObject(e){this.checkResizeInternalBuffer();const n=this.objects.length*5,i=e.points;return e.points=this.points.subarray(this.objects.length*5,this.objects.length*5+5),e.points[1]=i[1],e.points[2]=i[2],e.points[3]=i[3],e.points[4]=i[4],this.objects.push(e),this.filteredPointsBuffer=qe(this.objects.length*5),this.needsRecalculate=!0,this.triggerRepaint(),n}recalculateWorldSize(){let e=!1;if(this.needsRecalculate){const n=new Int32Array(this.objects.length),i=new Int32Array(this.objects.length),a=this.renderOrder.length;for(let p=0;p<a;p++){const g=this.renderOrder[p];this.objects[g]&&(n[p]=this.points[g*5+3],i[p]=this.points[g*5+4])}const u=Math.max(...n);u!==this._width&&(this._width=u,e=!0);const f=Math.max(...i);f!==this._height&&(this._height=f,e=!0),e&&this.trigger("recalculate-world-size",{width:u,height:f}),this.needsRecalculate=!1}return e}addObjectAt(e,n){n.width&&!n.height?n.height=n.width/e.width*e.height:n.height&&!n.width&&(n.width=n.height/e.height*e.width),(!n||!n.width||!n.height)&&(n.width=e.width,n.height=e.height);const{width:i,x:a,y:u}=n,f=i/e.width;this.checkResizeInternalBuffer(),this.points.set(Tt.singleBox(e.width,e.height,0,0),this.objects.length*5);const p=new lc(e);return p.points=this.points.subarray(this.objects.length*5,this.objects.length*5+5),this.objects.push(p),this.scaleWorldObject(this.objects.length-1,f),this.translateWorldObject(this.objects.length-1,a,u),this.filteredPointsBuffer=qe(this.points.length*2),this.triggerRepaint(),this.needsRecalculate=!0,p}scaleWorldObject(e,n){Qr(this.points.subarray(e*5,e*5+5),tc(n,this.points[e*5+1],this.points[e*5+2]));const i=this.objects[e];i&&(i.atScale(n),this.triggerRepaint())}translateWorldObject(e,n,i){Qr(this.points.subarray(e*5,e*5+5),Ei(n,i));const a=this.objects[e];a&&(a.translate(n,i),this.triggerRepaint())}resize(e,n){return this._width=e,this._height=n,this.aspectRatio=e/n,this.triggerRepaint(),this}getObjects(){return this.objects}getPoints(){return this.points}getPointsFromViewer(e,n){const i=Tt.singleBox(e.width,e.height,e.x,e.y);return this.getPointsAt(i,n,e.scale)}addLayoutSubscriber(e){return this.subscriptions.push(e),()=>{this.subscriptions.splice(this.subscriptions.indexOf(e),1)}}getScheduledUpdates(e,n){const i=ec(this.points,e,this.filteredPointsBuffer),a=this.objects.length;this._updatedList=[];for(let u=0;u<a;u++)if(i[u*5]!==0){if(!this.objects[u])continue;this._updatedList.push(...this.objects[u].getScheduledUpdates(e,n))}return this._updatedList}getObjectsAt(e,n=!1){const i=this.getActiveZone(),a=ec(this.points,e,this.filteredPointsBuffer),u=this.renderOrder.length,f=[];for(let p=0;p<u;p++){const g=this.renderOrder[p];if(a[g*5]!==0){const S=this.objects[g];if(!S||i&&i.objects.indexOf(S)===-1)continue;if(S.type!=="world-object"){f.push([S,[S]]);continue}n?f.push([S,S.getObjectsAt(e,n)]):f.push([S,this.emptyPaintables])}}return f}getPointsAt(e,n,i=1){const a=this.getObjectsAt(e),u=xs(ra(i),Ei(-e[1],-e[2]),this.translationBuffer),f=n?xs(n,u,this.aggregateBuffer):u,p=a.length,g=[];for(let S=0;S<p;S++)a[S]&&g.push(...a[S][0].getAllPointsAt(e,f,i));return g}flushSubscriptions(){if(this.triggerQueue.length){this._alreadyFlushed=[];const e=this.triggerQueue.length;for(let n=0;n<e;n++){if(this._alreadyFlushed.indexOf(this.triggerQueue[n][0])!==-1)continue;typeof this.triggerQueue[n][1]>"u"&&this._alreadyFlushed.push(this.triggerQueue[n][0]);const i=this.subscriptions.length;for(let a=0;a<i;a++)this.subscriptions[a].apply(null,this.triggerQueue[n])}this.triggerQueue=[]}}trigger(e,n){this.triggerQueue.push([e,n])}triggerEventActivation(){this.trigger("event-activation")}triggerRepaint(){this.trigger("repaint")}gotoRegion(e){this.trigger("goto-region",e)}goHome(e=!1){this.trigger("go-home",{immediate:e})}zoomTo(e,n,i){this.trigger("zoom-to",{point:n,factor:e,stream:i})}zoomIn(e){this.trigger("zoom-to",{point:e,factor:.5})}zoomOut(e){this.trigger("zoom-to",{point:e,factor:2})}constraintBounds(e){this.trigger("constrain-bounds",{immediate:e})}}const fd=/([0-9]+(px|em)\s+)+(solid)\s+(.*)/g,dd={},FA=["backgroundColor","opacity","boxShadow","borderColor","borderWidth","borderStyle","outlineColor","outlineWidth","outlineOffset","outlineStyle"];class uc extends Gr{constructor(){super(),this.type="spacial-content",this.hoverEvents=!1,this.activeEvents=!1,this.display={x:0,y:0,scale:1,width:-1,height:-1,points:qe(5)},this._parsed={border:{id:null,match:[]},outline:{id:null,match:[]}},this.props={},this.addHover=()=>{this.hovering=!0,this.__revision++},this.removeHover=()=>{this.hovering=!1,this.pressing=!1,this.__revision++},this.addPress=()=>{this.pressing=!0,this.__revision++},this.removePress=()=>{this.pressing=!1,this.__revision++},this.id=Qf(12),this.points=qe(5)}getAllPointsAt(e,n){return[[this,this.points,n]]}applyProps(e={}){let n=!1;if(e.interactive!==this.props.interactive&&(n=!0,this.props.interactive=e.interactive),e.style){const i=e.border||e.style.border;if(i!==this._parsed.border.id)if(!i)this._parsed.border.id=null,this._parsed.border.match=[];else{const a=dd[i]||fd.exec(i)||fd.exec(i);a&&(this._parsed.border.id=i,this._parsed.border.match=dd[i]=a)}if(this._parsed.border.id&&(e.style.borderWidth=this._parsed.border.match[1],e.style.borderStyle="solid",e.style.borderColor=this._parsed.border.match[4]),e.style.outline!==this._parsed.outline.id)if(!e.style.outline)this._parsed.outline.id=null,this._parsed.outline.match=[];else{const a=dd[e.style.outline]||fd.exec(e.style.outline)||fd.exec(e.style.outline);a&&(this._parsed.outline.id=e.style.outline,this._parsed.outline.match=dd[e.style.outline]=a)}this._parsed.outline.id&&(e.style.outlineWidth=this._parsed.outline.match[1],e.style.outlineStyle="solid",e.style.outlineColor=this._parsed.outline.match[4]),this.props.style=e.style,e.backgroundColor&&!this.props.style.backgroundColor&&(this.props.style.backgroundColor=e.backgroundColor,n=!0),e.style.background&&!this.props.style.backgroundColor&&(this.props.style.backgroundColor=e.style.background,n=!0);for(const a of FA)if(this.props.style[a]!==e.style[a]){n=!0;break}e.style[":hover"]!==this.props.hoverStyles&&(this.props.hoverStyles=e.style[":hover"],this.hoverEvents||(this.hoverEvents=!0,this.addEventListener("pointerenter",this.addHover),this.addEventListener("pointerleave",this.removeHover)),n=!0),e.style[":active"]!==this.props.pressStyles&&(this.props.pressStyles=e.style[":active"],this.activeEvents||(this.activeEvents=!0,this.addEventListener("mousedown",this.addPress),this.addEventListener("mouseup",this.removePress)),n=!0)}e.href!==this.props.href&&(this.props.href=e.href,n=!0),e.hrefTarget!==this.props.hrefTarget&&(this.props.hrefTarget=e.hrefTarget,n=!0),e.title!==this.props.title&&(this.props.title=e.title,n=!0),e.className!==this.props.className&&(this.props.className=e.className,e.className&&!this.hoverEvents&&(this.hoverEvents=!0,this.addEventListener("pointerenter",this.addHover),this.addEventListener("pointerleave",this.removeHover)),e.className&&!this.activeEvents&&(this.activeEvents=!0,this.addEventListener("mousedown",this.addPress),this.addEventListener("mouseup",this.removePress)),n=!0),e.relativeSize!==this.props.relativeSize&&(this.props.relativeSize=e.relativeSize,n=!0),e.relativeStyle!==this.props.relativeStyle&&(this.props.relativeStyle=e.relativeStyle,n=!0),e.html!==this.props.html&&(this.props.html=e.html,n=!0),e.target&&(e.target.width!==this.display.width||e.target.height!==this.display.height||e.target.x!==this.points[1]||e.target.y!==this.points[2])&&(n=!0,this.points=Tt.singleBox(e.target.width,e.target.height,e.target.x,e.target.y),this.display.points=Tt.singleBox(e.target.width,e.target.height,e.target.x,e.target.y),this.display.width=e.target.width,this.display.height=e.target.height),n&&this.__revision++}}class hd extends Gr{constructor(){super(),this.type="spacial-content",this.color="#000",this.text="",this.display={x:0,y:0,scale:1,width:100,height:100,points:qe(5)},this.interactive=!1,this.props={font:"18px Arial, sans-serif",lineHeight:1,textAlign:"left",verticalAlign:"top",paddingX:0,paddingY:0,fitParent:!1,lineBreak:"auto",strokeText:!1,sizeToFill:!1,maxFontSizeToFill:void 0,allowNewLine:!0,justifyLines:!1,renderHDPI:!1,textDecoration:"none",interactive:!1,relativeSize:!1},this.id="",this.points=qe(5)}getAllPointsAt(e,n){return[[this,this.points,n]]}applyProps({id:e,target:n,text:i,color:a,backgroundColor:u,fontSize:f=18,interactive:p,fontFamily:g="Arial, sans-serif",...S}){S.font=`${f}px ${g}`,this.interactive=p||!1,typeof i<"u"&&(this.text=i||""),a&&(this.color=a),u&&(this.backgroundColor=u),e&&(this.id=e),n&&(this.points=Tt.singleBox(n.width,n.height,n.x,n.y),this.display.points=this.points,this.display.width=n.width,this.display.height=n.height),this.props={...this.props,...S},this.__revision++}}const mn=Math.pow,pd=Math.sqrt,cc=Math.sin,K0=Math.cos,fc=Math.PI,vd=1.70158,md=vd*1.525,Z0=vd+1,J0=2*fc/3,e1=2*fc/4.5,gd=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},la={linear:t=>t,easeInQuad:function(t){return t*t},easeOutQuad:function(t){return 1-(1-t)*(1-t)},easeInOutQuad:function(t){return t<.5?2*t*t:1-mn(-2*t+2,2)/2},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return 1-mn(1-t,3)},easeInOutCubic:function(t){return t<.5?4*t*t*t:1-mn(-2*t+2,3)/2},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return 1-mn(1-t,4)},easeInOutQuart:function(t){return t<.5?8*t*t*t*t:1-mn(-2*t+2,4)/2},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return 1-mn(1-t,5)},easeInOutQuint:function(t){return t<.5?16*t*t*t*t*t:1-mn(-2*t+2,5)/2},easeInSine:function(t){return 1-K0(t*fc/2)},easeOutSine:function(t){return cc(t*fc/2)},easeInOutSine:function(t){return-(K0(fc*t)-1)/2},easeInExpo:function(t){return t===0?0:mn(2,10*t-10)},easeOutExpo:function(t){return t===1?1:1-mn(2,-10*t)},easeInOutExpo:function(t){return t===0?0:t===1?1:t<.5?mn(2,20*t-10)/2:(2-mn(2,-20*t+10))/2},easeInCirc:function(t){return 1-pd(1-mn(t,2))},easeOutCirc:function(t){return pd(1-mn(t-1,2))},easeInOutCirc:function(t){return t<.5?(1-pd(1-mn(2*t,2)))/2:(pd(1-mn(-2*t+2,2))+1)/2},easeInBack:function(t){return Z0*t*t*t-vd*t*t},easeOutBack:function(t){return 1+Z0*mn(t-1,3)+vd*mn(t-1,2)},easeInOutBack:function(t){return t<.5?mn(2*t,2)*((md+1)*2*t-md)/2:(mn(2*t-2,2)*((md+1)*(t*2-2)+md)+2)/2},easeInElastic:function(t){return t===0?0:t===1?1:-mn(2,10*t-10)*cc((t*10-10.75)*J0)},easeOutElastic:function(t){return t===0?0:t===1?1:mn(2,-10*t)*cc((t*10-.75)*J0)+1},easeInOutElastic:function(t){return t===0?0:t===1?1:t<.5?-(mn(2,20*t-10)*cc((20*t-11.125)*e1))/2:mn(2,-20*t+10)*cc((20*t-11.125)*e1)/2+1},easeInBounce:function(t){return 1-gd(1-t)},easeOutBounce:gd,easeInOutBounce:function(t){return t<.5?(1-gd(1-2*t))/2:(1+gd(2*t-1))/2}};class BA{constructor(e){this.runtime=e,this.pendingTransition={from:qe(5),to:qe(5),elapsed_time:0,done:!0,total_time:0,timingFunction:la.easeInOutQuad,constrain:!1}}hasPending(){return!this.pendingTransition.done}getPendingTransition(){return this.pendingTransition}getPendingFrom(){return this.pendingTransition.from}customTransition(e){e(this.pendingTransition)}stopTransition(){this.pendingTransition.from=qe(this.runtime.target),this.pendingTransition.to=qe(this.runtime.target),this.pendingTransition.done=!0,this.pendingTransition.elapsed_time=0,this.pendingTransition.total_time=0}runTransition(e,n){if(!this.pendingTransition.done){const i=this.pendingTransition,a=i.total_time===0?0:(i.elapsed_time+n)/i.total_time,u=i.total_time===0?1:a===0?0:i.timingFunction(a);e[1]=i.from[1]+(i.to[1]-i.from[1])*u,e[2]=i.from[2]+(i.to[2]-i.from[2])*u,e[3]=i.from[3]+(i.to[3]-i.from[3])*u,e[4]=i.from[4]+(i.to[4]-i.from[4])*u,this.pendingTransition.elapsed_time+=n,this.pendingTransition.elapsed_time>=this.pendingTransition.total_time&&(this.pendingTransition.done=!0,this.pendingTransition.constrain&&this.constrainBounds({transition:{duration:this.pendingTransition.total_time===0?0:500,easing:la.easeOutExpo}}))}}zoomTo(e,{origin:n,stream:i=!1,transition:a}={}){const u=this.runtime.getZoomedPosition(e,{origin:n}),f=Math.abs(1-e);this.applyTransition(u,a,{duration:2e3*f,easing:la.easeOutExpo,constrain:!0},{stream:!1})}constrainBounds({transition:e,panPadding:n=0}={}){const[i,a]=this.runtime.constrainBounds(this.runtime.target,{panPadding:n});i&&(this.applyTransition(a,e,{duration:500,easing:la.easeOutQuart,constrain:!1}),this.runtime.updateNextFrame())}applyTransition(e,n,i,{stream:a}={}){this.pendingTransition.from=qe(this.runtime.target),this.pendingTransition.to=e,a||(this.pendingTransition.elapsed_time=0),this.pendingTransition.done=!1,this.pendingTransition.total_time=typeof(n==null?void 0:n.duration)<"u"?n.duration:typeof(i==null?void 0:i.duration)<"u"?i.duration:1e3,this.pendingTransition.constrain=typeof(n==null?void 0:n.constrain)<"u"?n.constrain:typeof(i==null?void 0:i.constrain)<"u"?i.constrain:!1,this.pendingTransition.timingFunction=(n==null?void 0:n.easing)||(i==null?void 0:i.easing)||la.easeInOutSine}goToRegion(e,{transition:n}={}){const i=this.runtime.clampRegion(e);this.applyTransition(Tt.singleBox(i.width,i.height,i.x,i.y),n,{duration:1e3,easing:la.easeOutExpo,constrain:!0}),this.runtime.updateNextFrame()}}class yd{constructor(e,n,i,a=[],u){this.id=Qf(),this.ready=!1,this.transformBuffer=qe(500),this.lastTarget=qe(5),this.zoomBuffer=qe(5),this.logNextRender=!1,this.pendingUpdate=!0,this.isCommitting=!1,this.firstRender=!0,this.mode="explore",this.controllers=[],this.controllersRunning=!1,this.controllerStopFunctions=[],this.maxScaleFactor=1,this._viewerToWorld={x:0,y:0},this._lastGoodScale=1,this.hooks={useFrame:[],useBeforeFrame:[],useAfterPaint:[],useAfterFrame:[]},this._viewport={x:0,y:0,width:0,height:0},this.setViewport=f=>{const p=typeof f.x>"u"?this.target[1]:f.x,g=typeof f.y>"u"?this.target[2]:f.y;f.width?this.target[3]=p+f.width:this.target[3]=this.target[3]-this.target[1]+p,f.height?this.target[4]=g+f.height:this.target[4]=this.target[4]-this.target[2]+g,Math.abs(this.target[1]-p)>.01&&(this.target[1]=p),Math.abs(this.target[2]-g)>.01&&(this.target[2]=g),this.pendingUpdate=!0},this.render=f=>{const p=f-this.lastTime;if(this.isCommitting||this.fpsLimit&&p<1e3/this.fpsLimit){this.stopId=window.requestAnimationFrame(this.render);return}this.lastTime=f,this.world.flushSubscriptions(),this.stopId=window.requestAnimationFrame(this.render),this.hook("useFrame",p);const g=this.pendingUpdate,S=this.renderer.pendingUpdate();if(this.transitionManager.hasPending()&&(this.transitionManager.runTransition(this.target,p),this.pendingUpdate=!0,this.updateControllerPosition()),!this.firstRender&&!g&&!S&&this.target[0]===this.lastTarget[0]&&this.target[1]===this.lastTarget[1]&&this.target[2]===this.lastTarget[2]&&this.target[3]===this.lastTarget[3]&&this.target[4]===this.lastTarget[4])return;this.hook("useBeforeFrame",p),this.renderer.beforeFrame(this.world,p,this.target);const m=this.getScaleFactor(),x=this.renderer.getPointsAt(this.world,this.target,this.aggregate,m),R=x.length;for(let k=0;k<R;k++){const L=x[k][0],P=x[k][1],O=x[k][2],j=O?ws(P,O,this.transformBuffer):P;this.renderer.prepareLayer(L,L.__parent&&O?ws(L.__parent.crop||L.__parent.points,O):j);const q=j.length/5;for(let ee=0;ee<q;ee++){const H=ee*5;j[H]!==0&&(this.renderer.paint(L,ee,j[H+1],j[H+2],j[H+3]-j[H+1],j[H+4]-j[H+2]),this.hook("useAfterPaint",L))}this.renderer.finishLayer(L,P)}this.renderer.afterFrame(this.world,p,this.target),this.hook("useAfterFrame",p),this.lastTarget[0]=this.target[0],this.lastTarget[1]=this.target[1],this.lastTarget[2]=this.target[2],this.lastTarget[3]=this.target[3],this.lastTarget[4]=this.target[4],this.firstRender=!1,this.pendingUpdate=!1,this.logNextRender=!1,this.renderer.isReady()&&(this.ready=!0,this.world.trigger("ready")),this.world.flushSubscriptions();const _=this.world.getScheduledUpdates(this.target,m),M=_.length;if(M>0)for(let k=0;k<M;k++){const L=_[M-k-1]();L?L.then(()=>{this.pendingUpdate=!0}):this.pendingUpdate=!0}},this.renderer=e,this.world=n,this.options={maxOverZoom:1,maxUnderZoom:1,visibilityRatio:1.5,...u||{}},this.target=Tt.projection(i),this.manualHomePosition=!1,this.pendingUpdate=!0,this.homePosition=Tt.projection(this.world),this.manualFocalPosition=!1,this.focalPosition=this.target,this.updateFocalPosition(),this.transitionManager=new BA(this),this.aggregate=ra(1),this.world.addLayoutSubscriber(f=>{f==="repaint"&&(this.pendingUpdate=!0),f==="recalculate-world-size"&&(this.manualHomePosition||(this.setHomePosition(),this.goHome()),this.updateFocalPosition())}),this.lastTime=performance.now(),this.controllers=a,this.render(this.lastTime),this.startControllers()}get x(){return this.target[1]}set x(e){this.target[1]=e}get y(){return this.target[2]}set y(e){this.target[2]=e}get x2(){return this.target[3]}set x2(e){this.target[3]=e}get y2(){return this.target[4]}set y2(e){this.target[4]=e}get width(){return this.target[3]-this.target[1]}set width(e){this.target[3]=this.target[1]+e}get height(){return this.target[4]-this.target[2]}set height(e){this.target[4]=this.target[2]=e}setHomePosition(e){this.homePosition.set(Tt.projection(e||this.world)),this.pendingUpdate=!0}startControllers(){if(!this.controllersRunning){for(const e of this.controllers)this.controllerStopFunctions.push(e.start(this));this.controllersRunning=!0}}stopControllers(){if(this.controllersRunning){for(const e of this.controllerStopFunctions)e();this.controllersRunning=!1,this.controllerStopFunctions=[]}}updateControllerPosition(){for(const e of this.controllers)e.updatePosition(this.x,this.y,this.width,this.height)}triggerResize(){this.renderer.triggerResize&&this.renderer.triggerResize(),this.pendingUpdate=!0}addController(e){this.controllers.push(e),this.controllersRunning&&e.start(this),this.pendingUpdate=!0}cover(){return this.goHome({cover:!0})}getRendererScreenPosition(){return this.renderer.getRendererScreenPosition()}updateRendererScreenPosition(){this.pendingUpdate=!0,this.renderer.resize()}setOptions(e){this.options={...this.options,...e}}goHome(e={}){if(this.world.width<=0||this.world.height<=0)return;const n=this.getScaleFactor(),i=e.position?{x:e.position[1],y:e.position[2],width:e.position[3]-e.position[1],height:e.position[4]-e.position[2]}:{x:this.homePosition[1],y:this.homePosition[2],width:this.homePosition[3]-this.homePosition[1],height:this.homePosition[4]-this.homePosition[2]},a=this.width*n,u=this.height*n,f=i.width/a,p=i.height/u,g=a/u;if(e.cover?f>p:f<p){const S=g*i.height,m=(S-i.width)/2;this.target[1]=-m+i.x,this.target[2]=i.y,this.target[3]=S-m+i.x,this.target[4]=i.height+i.y}else{const S=i.width/g,m=(S-i.height)/2;this.target[1]=i.x,this.target[2]=i.y-m,this.target[3]=i.x+i.width,this.target[4]=i.y+S-m}this.constrainBounds(this.target),this.updateControllerPosition()}resize(e,n,i,a){this.updateFocalPosition(e-n,i-a);const u=n/e,f=a/i;this.target[3]=this.target[1]+(this.target[3]-this.target[1])*u,this.target[4]=this.target[2]+(this.target[4]-this.target[2])*f,this.goHome({position:this.focalPosition}),this.renderer.resize(n,a),this.pendingUpdate=!0}updateFocalPosition(e,n){if(!this.manualFocalPosition){const i=this.width,a=this.height,u=Math.min(i,a),f=0,p=0,g=this.x+f,S=this.y+p;if(i<a){const m=this.height-this.width;this.focalPosition=Tt.projection({x:g,y:S+m/2,width:u-f*2,height:u-p*2}),this.pendingUpdate=!0}else{const m=this.width-this.height;this.focalPosition=Tt.projection({x:g+m/2,y:S,width:u-f*2,height:u-p*2}),this.pendingUpdate=!0}}}getViewport(){return this._viewport.x=this.target[1],this._viewport.y=this.target[2],this._viewport.width=this.target[3]-this.target[1],this._viewport.height=this.target[4]-this.target[2],this._viewport}constrainBounds(e,{panPadding:n=0,ref:i=!1}={}){const{minX:a,maxX:u,minY:f,maxY:p}=this.getBounds({target:e,padding:n});let g=!1;const S=i?e:qe(e),m=e[3]-e[1],x=e[4]-e[2];return a>e[1]&&(g=!0,S[1]=a,S[3]=a+m),f>e[2]&&(g=!0,S[2]=f,S[4]=f+x),u<e[1]&&(g=!0,S[1]=u,S[3]=u+m),p<e[2]&&(g=!0,S[2]=p,S[4]=p+x),[g,S]}getBounds(e){const n=e.target||this.target,i=e.padding,a=this.options.visibilityRatio,u=Math.abs(1-a);if(this.world.hasActiveZone()){const O=this.world.getActiveZone();if(O){const j=n[3]-n[1]<O.points[3]-O.points[1],q=n[4]-n[2]<O.points[4]-O.points[2];return{minX:j?O.points[1]-i:O.points[1]+(O.points[3]-O.points[1])/2-(n[3]-n[1])/2,maxX:q?O.points[2]-i:O.points[2]+(O.points[4]-O.points[2])/2-(n[4]-n[2])/2,minY:j?O.points[3]+i:O.points[1]+(O.points[3]-O.points[1])/2-(n[3]-n[1])/2,maxY:q?O.points[4]+i:O.points[2]+(O.points[4]-O.points[2])/2-(n[4]-n[2])/2}}}const f=n[3]-n[1],p=this.world.width,g=-f*u,S=p-f-g,m=n[4]-n[2],x=this.world.height,R=-m*u,_=x-m-R,M=Math.max(g,S),k=Math.min(g,S),L=Math.max(R,_),P=Math.min(R,_);return{minX:k,maxX:M,minY:P,maxY:L}}getScaleFactor(e=!1){const n=this.renderer.getScale(this.target[3]-this.target[1],this.target[4]-this.target[2],e);return n===0?this._lastGoodScale:(this._lastGoodScale=n,n)}getZoomedPosition(e,{origin:n,fromPos:i}){var a;const u=i?{width:i[3]-i[1],height:i[4]-i[2]}:void 0,f=u?this.renderer.getScale(u.width,u.height):this.getScaleFactor(),p=u?u.width:this.width,g=u?u.height:this.height,S=(a=this.getRendererScreenPosition())==null?void 0:a.width,m=this.world.width,x=S?S/m:1,R=this.options.maxUnderZoom,_=Math.max(x||1,this.options.maxOverZoom),M=1/e,k=f*M;if(M<1){const O=p*f,j=g*f,q=this.world.width/O,ee=this.world.height/j;if(q>ee){const H=this.world.width*k,ie=~~(p*f)*R;H<ie&&(e=this.world.width*f/(p*f*R))}else{const H=this.world.height*k,ie=~~(g*f)*R;H<ie&&(e=this.world.height*f/(g*f*R))}}else k>_&&(e=f/_);const P=ws(this.target,tc(e,n?n.x:this.target[1]+(this.target[3]-this.target[1])/2,n?n.y:this.target[2]+(this.target[4]-this.target[2])/2),this.zoomBuffer);return this.constrainBounds(P,{ref:!0,panPadding:100}),P}clampRegion({x:e,y:n,width:i,height:a,padding:u=0}){const f=this.width,p=this.height,g=i/f<a/p,S=e-u,m=n-u,x=i+u*2,R=a+u*2;if(g){const M=R/p*f;return{x:S-(M-x)/2,y:m,width:M,height:R}}const _=x/f*p;return{x:S,y:m-(_-R)/2,width:x,height:_}}viewerToWorld(e,n){const i=this.getScaleFactor();return this._viewerToWorld.x=this.target[1]+e/i,this._viewerToWorld.y=this.target[2]+n/i,this._viewerToWorld}worldToViewer(e,n,i,a){const u=Tt.singleBox(i,a,e,n);return Qr(u,xs(ra(this.getScaleFactor()),Ei(-this.target[1],-this.target[2]))),{x:u[1],y:u[2],width:u[3]-u[1],height:u[4]-u[2],strand:u}}setScale(e,n){Qr(this.target,tc(e,n?n.x:this.target[1]+(this.target[3]-this.target[1])/2,n?n.y:this.target[2]+(this.target[4]-this.target[2])/2)),this.pendingUpdate=!0}syncTo(e){const n=this.target;return this.target=e.target,this.pendingUpdate=!0,()=>{this.target=n}}stop(){return typeof this.stopId<"u"&&(window.cancelAnimationFrame(this.stopId),this.stopId=void 0),()=>{this.render(performance.now())}}reset(){this.renderer.reset()}selectZone(e){this.world.selectZone(e),this.pendingUpdate=!0}deselectZone(){this.world.deselectZone(),this.pendingUpdate=!0}hook(e,n){const i=this.hooks[e].length;if(i!==0)for(let a=0;a<i;a++)this.hooks[e][a](n)}registerHook(e,n){return this.hooks[e].push(n),()=>{this.hooks[e]=this.hooks[e].filter(i=>i!==n)}}updateNextFrame(){this.pendingUpdate=!0}}const dc=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Sd=typeof AbortController=="function"?AbortController:class{constructor(){this.signal=new t1}abort(e=new Error("This operation was aborted")){this.signal.reason=e,this.signal.dispatchEvent({type:"abort",target:this.signal})}},HA=typeof AbortSignal=="function",VA=typeof Sd.AbortSignal=="function",t1=HA?AbortSignal:VA?Sd.AbortController:class{constructor(){this.reason=void 0,this.aborted=!1,this._listeners=[]}dispatchEvent(e){e.type==="abort"&&(this.aborted=!0,this.onabort(e),this._listeners.forEach(n=>n(e),this))}onabort(){}addEventListener(e,n){e==="abort"&&this._listeners.push(n)}removeEventListener(e,n){e==="abort"&&(this._listeners=this._listeners.filter(i=>i!==n))}},Xp=new Set,Kp=(t,e)=>{const n=`LRU_CACHE_OPTION_${t}`;bd(n)&&Jp(n,`${t} option`,`options.${e}`,io)},Zp=(t,e)=>{const n=`LRU_CACHE_METHOD_${t}`;if(bd(n)){const{prototype:i}=io,{get:a}=Object.getOwnPropertyDescriptor(i,t);Jp(n,`${t} method`,`cache.${e}()`,a)}},$A=(t,e)=>{const n=`LRU_CACHE_PROPERTY_${t}`;if(bd(n)){const{prototype:i}=io,{get:a}=Object.getOwnPropertyDescriptor(i,t);Jp(n,`${t} property`,`cache.${e}`,a)}},n1=(...t)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...t):console.error(...t)},bd=t=>!Xp.has(t),Jp=(t,e,n,i)=>{Xp.add(t);const a=`The ${e} is deprecated. Please use ${n} instead.`;n1(a,"DeprecationWarning",t,i)},ua=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),i1=t=>ua(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Ed:null:null;class Ed extends Array{constructor(e){super(e),this.fill(0)}}class WA{constructor(e){if(e===0)return[];const n=i1(e);this.heap=new n(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}}class io{constructor(e={}){const{max:n=0,ttl:i,ttlResolution:a=1,ttlAutopurge:u,updateAgeOnGet:f,updateAgeOnHas:p,allowStale:g,dispose:S,disposeAfter:m,noDisposeOnSet:x,noUpdateTTL:R,maxSize:_=0,maxEntrySize:M=0,sizeCalculation:k,fetchMethod:L,fetchContext:P,noDeleteOnFetchRejection:O,noDeleteOnStaleGet:j,allowStaleOnFetchRejection:q,allowStaleOnFetchAbort:ee,ignoreFetchAbort:H}=e,{length:Z,maxAge:ie,stale:W}=e instanceof io?{}:e;if(n!==0&&!ua(n))throw new TypeError("max option must be a nonnegative integer");const re=n?i1(n):Array;if(!re)throw new Error("invalid max value: "+n);if(this.max=n,this.maxSize=_,this.maxEntrySize=M||this.maxSize,this.sizeCalculation=k||Z,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=L||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=P,!this.fetchMethod&&P!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(n).fill(null),this.valList=new Array(n).fill(null),this.next=new re(n),this.prev=new re(n),this.head=0,this.tail=0,this.free=new WA(n),this.initialFill=1,this.size=0,typeof S=="function"&&(this.dispose=S),typeof m=="function"?(this.disposeAfter=m,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!x,this.noUpdateTTL=!!R,this.noDeleteOnFetchRejection=!!O,this.allowStaleOnFetchRejection=!!q,this.allowStaleOnFetchAbort=!!ee,this.ignoreFetchAbort=!!H,this.maxEntrySize!==0){if(this.maxSize!==0&&!ua(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!ua(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!g||!!W,this.noDeleteOnStaleGet=!!j,this.updateAgeOnGet=!!f,this.updateAgeOnHas=!!p,this.ttlResolution=ua(a)||a===0?a:1,this.ttlAutopurge=!!u,this.ttl=i||ie||0,this.ttl){if(!ua(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){const ge="LRU_CACHE_UNBOUNDED";bd(ge)&&(Xp.add(ge),n1("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ge,io))}W&&Kp("stale","allowStale"),ie&&Kp("maxAge","ttl"),Z&&Kp("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new Ed(this.max),this.starts=new Ed(this.max),this.setItemTTL=(i,a,u=dc.now())=>{if(this.starts[i]=a!==0?u:0,this.ttls[i]=a,a!==0&&this.ttlAutopurge){const f=setTimeout(()=>{this.isStale(i)&&this.delete(this.keyList[i])},a+1);f.unref&&f.unref()}},this.updateItemAge=i=>{this.starts[i]=this.ttls[i]!==0?dc.now():0};let e=0;const n=()=>{const i=dc.now();if(this.ttlResolution>0){e=i;const a=setTimeout(()=>e=0,this.ttlResolution);a.unref&&a.unref()}return i};this.getRemainingTTL=i=>{const a=this.keyMap.get(i);return a===void 0?0:this.ttls[a]===0||this.starts[a]===0?1/0:this.starts[a]+this.ttls[a]-(e||n())},this.isStale=i=>this.ttls[i]!==0&&this.starts[i]!==0&&(e||n())-this.starts[i]>this.ttls[i]}updateItemAge(e){}setItemTTL(e,n,i){}isStale(e){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new Ed(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,n,i,a)=>{if(this.isBackgroundFetch(n))return 0;if(!ua(i))if(a){if(typeof a!="function")throw new TypeError("sizeCalculation must be a function");if(i=a(n,e),!ua(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.addItemSize=(e,n)=>{if(this.sizes[e]=n,this.maxSize){const i=this.maxSize-this.sizes[e];for(;this.calculatedSize>i;)this.evict(!0)}this.calculatedSize+=this.sizes[e]}}removeItemSize(e){}addItemSize(e,n){}requireSize(e,n,i,a){if(i||a)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:e=this.allowStale}={}){if(this.size)for(let n=this.tail;!(!this.isValidIndex(n)||((e||!this.isStale(n))&&(yield n),n===this.head));)n=this.prev[n]}*rindexes({allowStale:e=this.allowStale}={}){if(this.size)for(let n=this.head;!(!this.isValidIndex(n)||((e||!this.isStale(n))&&(yield n),n===this.tail));)n=this.next[n]}isValidIndex(e){return this.keyMap.get(this.keyList[e])===e}*entries(){for(const e of this.indexes())this.isBackgroundFetch(this.valList[e])||(yield[this.keyList[e],this.valList[e]])}*rentries(){for(const e of this.rindexes())this.isBackgroundFetch(this.valList[e])||(yield[this.keyList[e],this.valList[e]])}*keys(){for(const e of this.indexes())this.isBackgroundFetch(this.valList[e])||(yield this.keyList[e])}*rkeys(){for(const e of this.rindexes())this.isBackgroundFetch(this.valList[e])||(yield this.keyList[e])}*values(){for(const e of this.indexes())this.isBackgroundFetch(this.valList[e])||(yield this.valList[e])}*rvalues(){for(const e of this.rindexes())this.isBackgroundFetch(this.valList[e])||(yield this.valList[e])}[Symbol.iterator](){return this.entries()}find(e,n={}){for(const i of this.indexes())if(e(this.valList[i],this.keyList[i],this))return this.get(this.keyList[i],n)}forEach(e,n=this){for(const i of this.indexes())e.call(n,this.valList[i],this.keyList[i],this)}rforEach(e,n=this){for(const i of this.rindexes())e.call(n,this.valList[i],this.keyList[i],this)}get prune(){return Zp("prune","purgeStale"),this.purgeStale}purgeStale(){let e=!1;for(const n of this.rindexes({allowStale:!0}))this.isStale(n)&&(this.delete(this.keyList[n]),e=!0);return e}dump(){const e=[];for(const n of this.indexes({allowStale:!0})){const i=this.keyList[n],a=this.valList[n],u=this.isBackgroundFetch(a)?a.__staleWhileFetching:a;if(u===void 0)continue;const f={value:u};if(this.ttls){f.ttl=this.ttls[n];const p=dc.now()-this.starts[n];f.start=Math.floor(Date.now()-p)}this.sizes&&(f.size=this.sizes[n]),e.unshift([i,f])}return e}load(e){this.clear();for(const[n,i]of e){if(i.start){const a=Date.now()-i.start;i.start=dc.now()-a}this.set(n,i.value,i)}}dispose(e,n,i){}set(e,n,{ttl:i=this.ttl,start:a,noDisposeOnSet:u=this.noDisposeOnSet,size:f=0,sizeCalculation:p=this.sizeCalculation,noUpdateTTL:g=this.noUpdateTTL}={}){if(f=this.requireSize(e,n,f,p),this.maxEntrySize&&f>this.maxEntrySize)return this.delete(e),this;let S=this.size===0?void 0:this.keyMap.get(e);if(S===void 0)S=this.newIndex(),this.keyList[S]=e,this.valList[S]=n,this.keyMap.set(e,S),this.next[this.tail]=S,this.prev[S]=this.tail,this.tail=S,this.size++,this.addItemSize(S,f),g=!1;else{this.moveToTail(S);const m=this.valList[S];n!==m&&(this.isBackgroundFetch(m)?m.__abortController.abort(new Error("replaced")):u||(this.dispose(m,e,"set"),this.disposeAfter&&this.disposed.push([m,e,"set"])),this.removeItemSize(S),this.valList[S]=n,this.addItemSize(S,f))}if(i!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),g||this.setItemTTL(S,i,a),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){const e=this.valList[this.head];return this.evict(!0),e}}evict(e){const n=this.head,i=this.keyList[n],a=this.valList[n];return this.isBackgroundFetch(a)?a.__abortController.abort(new Error("evicted")):(this.dispose(a,i,"evict"),this.disposeAfter&&this.disposed.push([a,i,"evict"])),this.removeItemSize(n),e&&(this.keyList[n]=null,this.valList[n]=null,this.free.push(n)),this.head=this.next[n],this.keyMap.delete(i),this.size--,n}has(e,{updateAgeOnHas:n=this.updateAgeOnHas}={}){const i=this.keyMap.get(e);return i!==void 0&&!this.isStale(i)?(n&&this.updateItemAge(i),!0):!1}peek(e,{allowStale:n=this.allowStale}={}){const i=this.keyMap.get(e);if(i!==void 0&&(n||!this.isStale(i))){const a=this.valList[i];return this.isBackgroundFetch(a)?a.__staleWhileFetching:a}}backgroundFetch(e,n,i,a){const u=n===void 0?void 0:this.valList[n];if(this.isBackgroundFetch(u))return u;const f=new Sd;i.signal&&i.signal.addEventListener("abort",()=>f.abort(i.signal.reason));const p={signal:f.signal,options:i,context:a},g=(R,_=!1)=>{const{aborted:M}=f.signal,k=i.ignoreFetchAbort&&R!==void 0;return M&&!k&&!_?S(f.signal.reason):(this.valList[n]===x&&(R===void 0?x.__staleWhileFetching?this.valList[n]=x.__staleWhileFetching:this.delete(e):this.set(e,R,p.options)),R)},S=R=>{const{aborted:_}=f.signal,M=_&&i.allowStaleOnFetchAbort,k=M||i.allowStaleOnFetchRejection,L=k||i.noDeleteOnFetchRejection;if(this.valList[n]===x&&(!L||x.__staleWhileFetching===void 0?this.delete(e):M||(this.valList[n]=x.__staleWhileFetching)),k)return x.__staleWhileFetching;if(x.__returned===x)throw R},m=(R,_)=>{this.fetchMethod(e,u,p).then(M=>R(M),_),f.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(R(),i.allowStaleOnFetchAbort&&(R=M=>g(M,!0)))})},x=new Promise(m).then(g,S);return x.__abortController=f,x.__staleWhileFetching=u,x.__returned=null,n===void 0?(this.set(e,x,p.options),n=this.keyMap.get(e)):this.valList[n]=x,x}isBackgroundFetch(e){return e&&typeof e=="object"&&typeof e.then=="function"&&Object.prototype.hasOwnProperty.call(e,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(e,"__returned")&&(e.__returned===e||e.__returned===null)}async fetch(e,{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,ttl:u=this.ttl,noDisposeOnSet:f=this.noDisposeOnSet,size:p=0,sizeCalculation:g=this.sizeCalculation,noUpdateTTL:S=this.noUpdateTTL,noDeleteOnFetchRejection:m=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:x=this.allowStaleOnFetchRejection,ignoreFetchAbort:R=this.ignoreFetchAbort,allowStaleOnFetchAbort:_=this.allowStaleOnFetchAbort,fetchContext:M=this.fetchContext,forceRefresh:k=!1,signal:L}={}){if(!this.fetchMethod)return this.get(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:a});const P={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:a,ttl:u,noDisposeOnSet:f,size:p,sizeCalculation:g,noUpdateTTL:S,noDeleteOnFetchRejection:m,allowStaleOnFetchRejection:x,allowStaleOnFetchAbort:_,ignoreFetchAbort:R,signal:L};let O=this.keyMap.get(e);if(O===void 0){const j=this.backgroundFetch(e,O,P,M);return j.__returned=j}else{const j=this.valList[O];if(this.isBackgroundFetch(j))return n&&j.__staleWhileFetching!==void 0?j.__staleWhileFetching:j.__returned=j;if(!k&&!this.isStale(O))return this.moveToTail(O),i&&this.updateItemAge(O),j;const q=this.backgroundFetch(e,O,P,M);return n&&q.__staleWhileFetching!==void 0?q.__staleWhileFetching:q.__returned=q}}get(e,{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet}={}){const u=this.keyMap.get(e);if(u!==void 0){const f=this.valList[u],p=this.isBackgroundFetch(f);return this.isStale(u)?p?n?f.__staleWhileFetching:void 0:(a||this.delete(e),n?f:void 0):p?void 0:(this.moveToTail(u),i&&this.updateItemAge(u),f)}}connect(e,n){this.prev[n]=e,this.next[e]=n}moveToTail(e){e!==this.tail&&(e===this.head?this.head=this.next[e]:this.connect(this.prev[e],this.next[e]),this.connect(this.tail,e),this.tail=e)}get del(){return Zp("del","delete"),this.delete}delete(e){let n=!1;if(this.size!==0){const i=this.keyMap.get(e);if(i!==void 0)if(n=!0,this.size===1)this.clear();else{this.removeItemSize(i);const a=this.valList[i];this.isBackgroundFetch(a)?a.__abortController.abort(new Error("deleted")):(this.dispose(a,e,"delete"),this.disposeAfter&&this.disposed.push([a,e,"delete"])),this.keyMap.delete(e),this.keyList[i]=null,this.valList[i]=null,i===this.tail?this.tail=this.prev[i]:i===this.head?this.head=this.next[i]:(this.next[this.prev[i]]=this.next[i],this.prev[this.next[i]]=this.prev[i]),this.size--,this.free.push(i)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return n}clear(){for(const e of this.rindexes({allowStale:!0})){const n=this.valList[e];if(this.isBackgroundFetch(n))n.__abortController.abort(new Error("deleted"));else{const i=this.keyList[e];this.dispose(n,i,"delete"),this.disposeAfter&&this.disposed.push([n,i,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return Zp("reset","clear"),this.clear}get length(){return $A("length","size"),this.size}static get AbortController(){return Sd}static get AbortSignal(){return t1}}var qA=io;const xd=/([0-9]+(px|em)\s+)+(solid)\s+(.*)/g,wd={},YA=["backgroundColor","opacity","boxShadow","borderColor","borderWidth","borderStyle","outlineColor","outlineWidth","outlineOffset","outlineStyle"];class r1 extends Gr{constructor(){super(),this.type="spacial-content",this.isShape=!0,this.hoverEvents=!1,this.activeEvents=!1,this.display={x:0,y:0,scale:1,width:-1,height:-1,points:qe(5)},this.boundingBox=null,this._parsed={border:{id:null,match:[]},outline:{id:null,match:[]}},this.props={},this.shape={type:"none"},this.addHover=()=>{this.hovering=!0,this.__revision++},this.removeHover=()=>{this.hovering=!1,this.pressing=!1,this.__revision++},this.addPress=()=>{this.pressing=!0,this.__revision++},this.removePress=()=>{this.pressing=!1,this.__revision++},this.id=Qf(12),this.points=qe(5),this.shape={type:"none"}}updateBoundingBox(){if(this.shape.type==="none")return;const e=this.shape.points;if(this.shape.points.length>2){const n=Math.min(...e.map(f=>f[0])),i=Math.min(...e.map(f=>f[1])),a=Math.max(0,...e.map(f=>f[0])),u=Math.max(0,...e.map(f=>f[1]));this.boundingBox={x:n,y:i,width:a-n,height:u-i};return}this.boundingBox=null}intersects(e){if(!e||this.shape.type==="none")return!1;const[n,i]=e,a=this.shape.points;let u=this.boundingBox;if(u||(this.updateBoundingBox(),u=this.boundingBox),!u||n<u.x||n>u.x+u.width||i<u.y||i>u.height+u.y)return!1;let f=!1;for(let p=0,g=a.length-1;p<a.length;g=p++)a[p][1]>i!=a[g][1]>i&&n<(a[g][0]-a[p][0])*(i-a[p][1])/(a[g][1]-a[p][1])+a[p][0]&&(f=!f);return f}getAllPointsAt(e,n){return e[3]-e[1]===1&&e[4]-e[2]===1?this.intersects([e[1],e[2]])?[[this,this.points,n]]:[]:[[this,this.points,n]]}applyProps(e={}){let n=!1;if(e.points)if(this.shape.type!=="polygon"||this.shape.points.length!==e.points.length)this.shape={type:"polygon",points:e.points,open:e.open},this.updateBoundingBox();else{let i=!1;const a=e.points.length;for(let u=0;u<a;u++)if(e.points[u][0]!==this.shape.points[u][0]||e.points[u][1]!==this.shape.points[u][1]){i=!0;break}i&&(this.shape={type:"polygon",points:e.points,open:e.open},this.updateBoundingBox())}if(e.interactive!==this.props.interactive&&(n=!0,this.props.interactive=e.interactive),(e.open||e.open===!1)&&(n=!0,this.shape.open=e.open),e.style){const i=e.border||e.style.border;if(i!==this._parsed.border.id)if(!i)this._parsed.border.id=null,this._parsed.border.match=[];else{const a=wd[i]||xd.exec(i)||xd.exec(i);a&&(this._parsed.border.id=i,this._parsed.border.match=wd[i]=a)}if(this._parsed.border.id&&(e.style.borderWidth=this._parsed.border.match[1],e.style.borderStyle="solid",e.style.borderColor=this._parsed.border.match[4]),e.style.outline!==this._parsed.outline.id)if(!e.style.outline)this._parsed.outline.id=null,this._parsed.outline.match=[];else{const a=wd[e.style.outline]||xd.exec(e.style.outline)||xd.exec(e.style.outline);a&&(this._parsed.outline.id=e.style.outline,this._parsed.outline.match=wd[e.style.outline]=a)}this._parsed.outline.id&&(e.style.outlineWidth=this._parsed.outline.match[1],e.style.outlineStyle="solid",e.style.outlineColor=this._parsed.outline.match[4]),this.props.style=e.style,e.backgroundColor&&!this.props.style.backgroundColor&&(this.props.style.backgroundColor=e.backgroundColor,n=!0),e.style.background&&!this.props.style.backgroundColor&&(this.props.style.backgroundColor=e.style.background,n=!0);for(const a of YA)if(this.props.style[a]!==e.style[a]){n=!0;break}e.style[":hover"]!==this.props.hoverStyles&&(this.props.hoverStyles=e.style[":hover"],this.hoverEvents||(this.hoverEvents=!0,this.addEventListener("pointerenter",this.addHover),this.addEventListener("pointerleave",this.removeHover)),n=!0),e.style[":active"]!==this.props.pressStyles&&(this.props.pressStyles=e.style[":active"],this.activeEvents||(this.activeEvents=!0,this.addEventListener("mousedown",this.addPress),this.addEventListener("mouseup",this.removePress)),n=!0)}e.href!==this.props.href&&(this.props.href=e.href,n=!0),e.hrefTarget!==this.props.hrefTarget&&(this.props.hrefTarget=e.hrefTarget,n=!0),e.title!==this.props.title&&(this.props.title=e.title,n=!0),e.className!==this.props.className&&(this.props.className=e.className,e.className&&!this.hoverEvents&&(this.hoverEvents=!0,this.addEventListener("pointerenter",this.addHover),this.addEventListener("pointerleave",this.removeHover)),e.className&&!this.activeEvents&&(this.activeEvents=!0,this.addEventListener("mousedown",this.addPress),this.addEventListener("mouseup",this.removePress)),n=!0),e.relativeSize!==this.props.relativeSize&&(this.props.relativeSize=e.relativeSize,n=!0),e.relativeStyle!==this.props.relativeStyle&&(this.props.relativeStyle=e.relativeStyle,n=!0),e.html!==this.props.html&&(this.props.html=e.html,n=!0),e.target&&(e.target.width!==this.display.width||e.target.height!==this.display.height||e.target.x!==this.points[1]||e.target.y!==this.points[2])&&(n=!0,this.points=Tt.singleBox(e.target.width,e.target.height,e.target.x,e.target.y),this.display.points=Tt.singleBox(e.target.width,e.target.height,e.target.x,e.target.y),this.display.width=e.target.width,this.display.height=e.target.height),n&&this.__revision++}}const s1=/(-?[0-9]+(px|em)\s+|0\s+)(-?[0-9]+(px|em)\s+|0\s+)(-?[0-9]+(px|em)\s+|0\s+)?(-?[0-9]+(px|em)\s+|0\s+)?(.*)/g,a1={},Cd={};class QA{constructor(e,n){this.imagesPending=0,this.imagesLoaded=0,this.frameIsRendering=!1,this.pendingDrawCall=!1,this.firstMeaningfulPaint=!1,this.parallelTasks=8,this.frameTasks=0,this.loadingQueueOrdered=!0,this.loadingQueue=[],this.currentTask=Promise.resolve(),this.tasksRunning=0,this.averageJobTime=1e3,this.lastKnownScale=1,this.visible=[],this.previousVisible=[],this.drawCalls=[],this.invalidated=[],this._worker=()=>{if(this.loadingQueue.length){const i=this.loadingQueue.pop();i&&(this.tasksRunning++,this.frameTasks++,this.currentTask=i.task().then(()=>{this.tasksRunning--}).catch(()=>{this.tasksRunning--}))}},this._scheduled=0,this._doWork=()=>{this.loadingQueue.length===0&&this.tasksRunning===0&&this._scheduled&&(clearInterval(this._scheduled),this._scheduled=0),this._worker()},this.canvas=e,this.rendererPosition=e.getBoundingClientRect(),this.ctx=e.getContext("2d",{alpha:!0}),this.ctx.imageSmoothingEnabled=!0,this.options=n||{},this.canvas.style.opacity="0",this.canvas.style.transition="opacity .3s",this.dpi=(n==null?void 0:n.dpi)||1,this.hostCache=n!=null&&n.lruCache?new qA({maxSize:1024*512*512,dispose:(i,a,u)=>{this.invalidated.push(a),i.width=0,i.height=0},sizeCalculation:(i,a)=>i.width*i.height}):{store:{},get(i){return this.store[i]},set(i,a){this.store[i]=a}}}getCanvasDims(){return{width:this.canvas.width/this.dpi,height:this.canvas.height/this.dpi}}resize(){this.rendererPosition=this.canvas.getBoundingClientRect()}isReady(){return this.firstMeaningfulPaint}afterFrame(e){if(this.clearTransform(),this.lastPaintedObject=void 0,this.frameIsRendering=!1,this.imagesPending=this.imagesPending-this.imagesLoaded,this.imagesLoaded=0,this.loadingQueueOrdered||(this.loadingQueue=this.loadingQueue.sort((n,i)=>n.network&&n.scale===i.scale?i.distance-n.distance:n.scale<i.scale?-1:1),this.loadingQueueOrdered=!0),this.previousVisible=this.visible,this.pendingDrawCall=!!this.drawCalls.length,this.pendingDrawCall)for(let n=0;n<this.drawCalls.length;n++){const i=this.drawCalls.shift();i&&i()}this.doOffscreenWork(),this.options.debug&&this.stats&&this.stats.end()}doOffscreenWork(){this.frameTasks=0,this.loadingQueue.length&&(this._worker(),this.loadingQueue.length&&(this._scheduled||(this._scheduled=setInterval(this._doWork,0))))}getScale(e,n,i){if(Number.isNaN(e)||Number.isNaN(n))return this.lastKnownScale;const a=this.getCanvasDims(),u=a.width/e,f=a.height/n,p=(u<f?f:u)*(i&&this.dpi||1);return Number.isNaN(p)||(this.lastKnownScale=p),this.lastKnownScale}beforeFrame(e,n,i){this.options.debug&&this.stats&&this.stats.begin(),this.frameIsRendering=!0,this.visible=[],this.options.beforeFrame&&this.options.beforeFrame(n);const a=this.getCanvasDims();this.ctx.globalAlpha=1,this.ctx.fillStyle=this.options.background||"rgb(0, 0, 0)",this.ctx.fillRect(0,0,a.width,a.height)}applyTransform(e,n,i,a,u){const f=e.__owner.value;if(f&&f.rotation){this.ctx.save();const p=n+a/2,g=i+u/2;this.ctx.translate(p,g),this.ctx.rotate(f.rotation*Math.PI/180),this.ctx.translate(-p,-g),this.lastPaintedObject=f}}clearTransform(){this.lastPaintedObject&&(this.lastPaintedObject.rotation&&this.ctx.restore(),this.lastPaintedObject=void 0)}paint(e,n,i,a,u,f){const p=this.ctx.globalAlpha;if(e instanceof Ar||e instanceof no){if(e.display.rotation){this.ctx.save();let m=i+u/2,x=a+f/2;e.crop&&(m-=e.crop[n*5+1],x-=e.crop[n*5+2]),this.ctx.translate(m,x),this.ctx.rotate(e.display.rotation*Math.PI/180),this.ctx.translate(-m,-x)}if(this.visible.push(e),typeof e.style&&e.style.opacity!=="undefined"){if(!e.style.opacity)return;this.ctx.globalAlpha=e.style.opacity}try{const m=e.__host.canvas,x=this.getCanvasDims();if((m.indices.indexOf(n)===-1||this.invalidated.indexOf(m.canvases[n])!==-1)&&this.schedulePaintToCanvas(m,e,n,Gf({x:i+u/2,y:a+u/2},{x:x.width/2,y:x.height/2})),!this.firstMeaningfulPaint)return;const R=this.hostCache.get(m.canvases[n]);if(R)if(e.crop&&e.cropData){if(e.crop[n*5]){const _=[e.crop[n*5+1]/e.display.scale-e.display.points[n*5+1],e.crop[n*5+2]/e.display.scale-e.display.points[n*5+2],1+(e.crop[n*5+3]-e.crop[n*5+1])/e.display.scale,1+(e.crop[n*5+4]-e.crop[n*5+2])/e.display.scale];_[0]+=e.cropData.x/e.display.scale,_[1]+=e.cropData.y/e.display.scale;const M=e.x*this.lastKnownScale,k=e.y*this.lastKnownScale,L=[i+M,a+k,u,f];L[0]+=M,L[1]+=k,this.ctx.drawImage(R,_[0],_[1],_[2],_[3],L[0],L[1],L[2]+1,L[3]+1)}}else this.ctx.drawImage(R,0,0,e.display.points[n*5+3]-e.display.points[n*5+1],e.display.points[n*5+4]-e.display.points[n*5+2],i,a,u+Number.MIN_VALUE,f+Number.MIN_VALUE)}catch{}e.display.rotation&&this.ctx.restore()}const g=e instanceof uc&&this.options.box,S=e instanceof r1&&this.options.polygon;if((g||S)&&!e.props.className&&!e.props.html&&!e.props.href){if(e.props.style){const m=Object.assign({},e.props.style||{},e.hovering?e.props.hoverStyles:{},e.pressing?e.props.pressStyles:{}),x=e.props.relativeStyle?1:u/e.width;typeof m.opacity<"u"&&(this.ctx.globalAlpha=m.opacity);let R=0;typeof m.borderWidth<"u"&&(R=parseInt(m.borderWidth,10)*x);let _=0;typeof m.outlineWidth<"u"&&(_=parseInt(m.outlineWidth,10)*x);let M=0;if(typeof m.outlineOffset<"u"&&(M=parseInt(m.outlineOffset,10)*x),m.borderColor&&(this.ctx.strokeStyle=m.borderColor),m.boxShadow){const k=m.boxShadow.split(/,(?![^(]*\))/);for(const L of k){const P=a1[L]||s1.exec(L)||s1.exec(L);a1[L]=P,P&&(this.ctx.save(),this.ctx.shadowOffsetX=parseInt(P[1])*this.dpi*x,this.ctx.shadowOffsetY=parseInt(P[3])*this.dpi*x,this.ctx.shadowBlur=parseInt(P[5])*this.dpi*x,this.ctx.shadowColor=P[9],this.ctx.fillStyle="rgba(0,0,0,1)",this.ctx.fillRect(i+R,a+R,u,f),this.ctx.restore())}}if(this.ctx.fillStyle=m.backgroundColor||"transparent",this.ctx.lineWidth=R,S){const k=e.shape,L=k.points||[],P=L.length;this.ctx.beginPath();for(let O=0;O<P;O++)this.ctx.lineTo(i+L[O][0]*this.lastKnownScale,a+L[O][1]*this.lastKnownScale);k.open||this.ctx.closePath(),R&&this.ctx.stroke(),k.open||this.ctx.fill()}else R&&this.ctx.strokeRect(i+R/2,a+R/2,u+R,f+R),this.ctx.fillRect(i+R,a+R,u,f);_&&(m.outlineColor&&(this.ctx.strokeStyle=m.outlineColor),this.ctx.lineWidth=_,this.ctx.strokeRect(i-_/2-M,a-_/2-M,u+R*2+_+M*2,f+R*2+_+M*2))}this.ctx.globalAlpha=p}}loadImage(e,n,i,a=!1){if(Cd[e]&&Cd[e].naturalWidth>0){n(Cd[e]);return}try{let u=!1;a||setTimeout(()=>{u||this.loadImage(e,n,i,!0)},3e3);const f=document.createElement("img");f.decoding="auto",f.onload=function(){u=!0,n(f),Cd[e]=f,f.onload=null},this.options.crossOrigin&&(f.crossOrigin="anonymous"),f.src=e,f.complete&&f.onload({}),f.width}catch(u){console.log("image error",u),i(u)}}schedulePaintToCanvas(e,n,i,a){this.imagesPending++,e.indices.push(i);const u=`${n.id}--${n.display.scale}-${i}`,f=this.invalidated.indexOf(u);f!==-1&&this.invalidated.splice(f,1),e.canvases[i]=u,n.__host.canvas.loading=!0,this.loadingQueueOrdered=!1,this.loadingQueue.push({id:u,scale:n.display.scale,network:!0,distance:a,task:()=>new Promise(p=>{if(this.visible.indexOf(n)===-1){this.imagesPending--,e.indices.splice(e.indices.indexOf(i),1),p();return}const g=n.getImageUrl(i);this.loadImage(g,S=>{this.loadingQueue.push({id:u,scale:n.display.scale,distance:a,task:()=>new Promise(m=>{this.imagesLoaded++,e.loaded.push(i),e.loaded.length===e.indices.length&&(e.loading=!1);const x=n.display.points.slice(i*5,i*5+5),R=document.createElement("canvas"),_=R.getContext("2d");R.width=x[3]-x[1],R.height=x[4]-x[2],this.hostCache.set(e.canvases[i],R),this.drawCalls.push(()=>{_.drawImage(S,0,0,x[3]-x[1],x[4]-x[2]),m()})})}),p()},S=>{this.imagesPending--,e.indices.splice(e.indices.indexOf(i),1),p()})})})}afterPaintLayer(e,n){}prepareLayer(e,n){e.__owner.value&&(e.cropData?(this.lastKnownScale*(1/e.display.scale),this.applyTransform(e,n[1],n[2],n[3]-n[1],n[4]-n[2])):this.applyTransform(e,n[1],n[2],n[3]-n[1],n[4]-n[2])),(!e.__host||!e.__host.canvas)&&(e instanceof Ar||e instanceof no)&&this.createImageHost(e)}finishLayer(){this.lastPaintedObject&&this.clearTransform()}createImageHost(e){e.__host=e.__host?e.__host:{},e.__host.canvas={canvas:void 0,canvases:[],indices:[],loaded:[],loading:!1}}getPointsAt(e,n,i,a){return e.getPointsAt(n,i,a)}getViewportBounds(e,n,i){const a=e.getActiveZone();if(a){const u=n[3]-n[1]<a.points[3]-a.points[1],f=n[4]-n[2]<a.points[4]-a.points[2];return{x1:u?a.points[1]-i:a.points[1]+(a.points[3]-a.points[1])/2-(n[3]-n[1])/2,y1:f?a.points[2]-i:a.points[2]+(a.points[4]-a.points[2])/2-(n[4]-n[2])/2,x2:u?a.points[3]+i:a.points[1]+(a.points[3]-a.points[1])/2-(n[3]-n[1])/2,y2:f?a.points[4]+i:a.points[2]+(a.points[4]-a.points[2])/2-(n[4]-n[2])/2}}return null}pendingUpdate(){const e=!this.pendingDrawCall&&this.drawCalls.length===0&&this.imagesPending===0&&this.loadingQueue.length===0&&this.tasksRunning===0;return!this.firstMeaningfulPaint&&e?(this.canvas.style.opacity="1",this.firstMeaningfulPaint=e,!0):this.options.debug?!0:!e}getRendererScreenPosition(){return this.rendererPosition}reset(){this.loadingQueue=[],this.drawCalls=[]}}class o1{constructor(e){this.renderers=[];for(const n of e)n&&this.renderers.push(n);this.length=this.renderers.length}afterFrame(e,n,i){for(let a=0;a<this.length;a++)this.renderers[a].afterFrame(e,n,i)}afterPaintLayer(e,n){for(let i=0;i<this.length;i++)this.renderers[i].afterPaintLayer(e,n)}beforeFrame(e,n,i){for(let a=0;a<this.length;a++)this.renderers[a].beforeFrame(e,n,i)}triggerResize(){for(let e=0;e<this.length;e++){const n=this.renderers[e];n.triggerResize&&n.triggerResize()}}getPointsAt(e,n,i,a){return this.renderers[0].getPointsAt(e,n,i,a)}getScale(e,n){return this.renderers[0].getScale(e,n)}getViewportBounds(e,n,i){return this.renderers[0].getViewportBounds(e,n,i)}getRendererScreenPosition(){return this.renderers[0].getRendererScreenPosition()}isReady(){for(let e=0;e<this.length;e++)if(!this.renderers[e].isReady())return!1;return!0}paint(e,n,i,a,u,f){for(let p=0;p<this.length;p++)this.renderers[p].paint(e,n,i,a,u,f)}pendingUpdate(){for(let e=0;e<this.length;e++)if(this.renderers[e].pendingUpdate())return!0;return!1}prepareLayer(e,n){for(let i=0;i<this.length;i++)this.renderers[i].prepareLayer(e,n)}finishLayer(e,n){for(let i=0;i<this.length;i++)this.renderers[i].finishLayer(e,n)}resize(e,n){for(let i=0;i<this.length;i++)this.renderers[i].resize(e,n)}reset(){for(let e=0;e<this.length;e++)this.renderers[e].reset()}}class GA{constructor(e){this.heightRatio=1,this.widthRatio=1,this.target=new Float32Array(5),this.delta=0,this.renderNextFrame=!0,this.canvas=e,this.initialWidth=e.width,this.initialHeight=e.height,this.context=e.getContext("2d"),this.context.globalAlpha=.5,this.aggregate=ra(1)}isReady(){return!0}resize(){this.initialWidth=this.canvas.width,this.initialHeight=this.canvas.height,this.renderNextFrame=!0}afterFrame(e,n,i){if(this.renderNextFrame){this.context.clearRect(0,0,this.canvas.width,this.canvas.height);const a=this.initialWidth/e.width,u=this.initialHeight/e.height,f=this.widthRatio>this.heightRatio?a:u;if(this.target=i,this.bounds){const p=e.getPointsAt(this.bounds,this.aggregate,f);for(const[g,S]of p)if(g instanceof Ar&&g.__host.canvas){const m=S.length/5;for(let x=0;x<m;x++)g.__host.canvas.canvases[x]&&(S[x+1]*f,S[x+2]*f,(S[x+3]-S[x+1])*f,(S[x+4]-S[x+2])*f)}}e.getPoints().forEach((p,g,S)=>{if(g%5===0&&p){const m={x1:S[g+1]*f,y1:S[g+2]*f,x2:S[g+3]*f,y2:S[g+4]*f,width:(S[g+3]-S[g+1])*f,height:(S[g+4]-S[g+2])*f};this.context.strokeStyle="red",this.context.strokeRect(m.x1,m.y1,m.width,m.height)}}),i&&(this.context.strokeStyle="red",this.context.lineWidth=window.devicePixelRatio||1,this.context.strokeRect(i[1]*f,i[2]*f,(i[3]-i[1])*f,(i[4]-i[2])*f))}}getActiveZone(e){return null}getPointsAt(e,n,i,a){return e.getPointsAt(n,i,a)}getScale(e,n){return 1}beforeFrame(e,n){this.bounds=Tt.singleBox(e.width,e.height)}drawImage(){}afterPaintLayer(e,n){}paint(e,n,i,a,u,f){this.renderNextFrame=!0}prepareLayer(e){}pendingUpdate(){return!1}hasActiveZone(){return!1}getViewportBounds(e,n,i){return null}getRendererScreenPosition(){return this.canvas.getBoundingClientRect()}finishLayer(){}reset(){}}var l1=!1,ro,ev,tv,Td,Rd,u1,Ad,nv,iv,rv,c1,sv,av,f1,d1;function Ui(){if(!l1){l1=!0;var t=navigator.userAgent,e=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(t),n=/(Mac OS X)|(Windows)|(Linux)/.exec(t);if(sv=/\b(iPhone|iP[ao]d)/.exec(t),av=/\b(iP[ao]d)/.exec(t),rv=/Android/i.exec(t),f1=/FBAN\/\w+;/i.exec(t),d1=/Mobile/i.exec(t),c1=!!/Win64/.exec(t),e){ro=e[1]?parseFloat(e[1]):e[5]?parseFloat(e[5]):NaN,ro&&document&&document.documentMode&&(ro=document.documentMode);var i=/(?:Trident\/(\d+.\d+))/.exec(t);u1=i?parseFloat(i[1])+4:ro,ev=e[2]?parseFloat(e[2]):NaN,tv=e[3]?parseFloat(e[3]):NaN,Td=e[4]?parseFloat(e[4]):NaN,Td?(e=/(?:Chrome\/(\d+\.\d+))/.exec(t),Rd=e&&e[1]?parseFloat(e[1]):NaN):Rd=NaN}else ro=ev=tv=Rd=Td=NaN;if(n){if(n[1]){var a=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(t);Ad=a?parseFloat(a[1].replace("_",".")):!0}else Ad=!1;nv=!!n[2],iv=!!n[3]}else Ad=nv=iv=!1}}var ov={ie:function(){return Ui()||ro},ieCompatibilityMode:function(){return Ui()||u1>ro},ie64:function(){return ov.ie()&&c1},firefox:function(){return Ui()||ev},opera:function(){return Ui()||tv},webkit:function(){return Ui()||Td},safari:function(){return ov.webkit()},chrome:function(){return Ui()||Rd},windows:function(){return Ui()||nv},osx:function(){return Ui()||Ad},linux:function(){return Ui()||iv},iphone:function(){return Ui()||sv},mobile:function(){return Ui()||sv||av||rv||d1},nativeApp:function(){return Ui()||f1},android:function(){return Ui()||rv},ipad:function(){return Ui()||av}},XA=ov,Md=!!(typeof window<"u"&&window.document&&window.document.createElement),KA={canUseDOM:Md,canUseWorkers:typeof Worker<"u",canUseEventListeners:Md&&!!(window.addEventListener||window.attachEvent),canUseViewport:Md&&!!window.screen,isInWorker:!Md},ZA=KA,h1=ZA,p1;h1.canUseDOM&&(p1=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0);/**
|
|
213
|
+
`)+a.join(" > ")}return null},r.getPublicRootInstance=function(a){if(a=a.current,!a.child)return null;switch(a.child.tag){case 5:return Ue(a.child.stateNode);default:return a.child.stateNode}},r.injectIntoDevTools=function(a){if(a={bundleType:a.bundleType,version:a.version,rendererPackageName:a.rendererPackageName,rendererConfig:a.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:g.ReactCurrentDispatcher,findHostInstanceByFiber:as,findFiberByHostInstance:a.findFiberByHostInstance||os,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")a=!1;else{var l=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!l.isDisabled&&l.supportsFiber)try{tc=l.inject(a),Ni=l}catch{}a=!0}return a},r.observeVisibleRects=function(a,l,f,y){if(!Ve)throw Error(v(363));a=Ac(a,l);var b=et(a,f,y).disconnect;return{disconnect:function(){b()}}},r.registerMutableSourceForHydration=function(a,l){var f=l._getVersion;f=f(l._source),a.mutableSourceEagerHydrationData==null?a.mutableSourceEagerHydrationData=[l,f]:a.mutableSourceEagerHydrationData.push(l,f)},r.runWithPriority=function(a,l){var f=bl;try{return bl=a,l()}finally{bl=f}},r.shouldSuspend=function(){return!1},r.unbatchedUpdates=function(a,l){var f=qe;qe&=-2,qe|=8;try{return a(l)}finally{qe=f,qe===0&&(en(),_i())}},r.updateContainer=function(a,l,f,y){var b=l.current,T=pi(),N=Cn(b);e:if(f){f=f._reactInternals;t:{if(me(f)!==f||f.tag!==1)throw Error(v(170));var B=f;do{switch(B.tag){case 3:B=B.stateNode.context;break t;case 1:if(Jt(B.type)){B=B.stateNode.__reactInternalMemoizedMergedChildContext;break t}}B=B.return}while(B!==null);throw Error(v(171))}if(f.tag===1){var ne=f.type;if(Jt(ne)){f=bd(f,ne,B);break e}}f=B}else f=ur;return l.context===null?l.context=f:l.pendingContext=f,l=dr(T,N),l.payload={element:a},y=y===void 0?null:y,y!==null&&(l.callback=y),hr(b,l),Nr(b,N,T),N},r}}(pf)),pf.exports}process.env.NODE_ENV==="production"?Xh.exports=Xx():Xh.exports=Gx();var Kx=Xh.exports;const Zx=Bx(Kx),vf=["onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onScroll","onWheel","onClick","onDragStart","onDragEnd","onDragEnter","onDragExit","onDrag","onDragOver"];function Jx(){return vf.reduce((t,e)=>(t[e]=[],t),{})}const tl=vf.reduce((t,e)=>(t[e.slice(2).toLowerCase()]=e,t[e]=e,t),{}),Cu=(t,e,n)=>{const r=t.length,o=n||We(r);for(let c=0;c<r;c++)o[c]=c%5===0?t[c+1]<e[3]&&t[c+3]>e[1]&&t[c+2]<e[4]&&t[c+4]>e[2]?1:0:t[c];return o};function We(t,e,n){return new Float32Array(t,e,n)}const eE=(t,e,n)=>{const r=t[1]<=e[3]&&t[3]>=e[1]&&t[2]<=e[4]&&t[4]>=e[2],o=n||We(5);return r?(o[0]=1,o[1]=Math.max(t[1],e[1]),o[2]=Math.max(t[2],e[2]),o[3]=Math.min(t[3],e[3]),o[4]=Math.min(t[4],e[4]),o):(o[0]=0,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o)},tE=t=>t.length/5,ps=(t,e,n)=>{const r=n||We(9);return r[0]=t[0]*e[0]+t[1]*e[3]+t[2]*e[6],r[1]=t[0]*e[1]+t[1]*e[4]+t[2]*e[7],r[2]=t[0]*e[2]+t[1]*e[5]+t[2]*e[8],r[3]=t[3]*e[0]+t[4]*e[3]+t[5]*e[6],r[4]=t[3]*e[1]+t[4]*e[4]+t[5]*e[7],r[5]=t[3]*e[2]+t[4]*e[5]+t[5]*e[8],r[6]=t[6]*e[0]+t[7]*e[3]+t[8]*e[6],r[7]=t[6]*e[1]+t[7]*e[4]+t[8]*e[7],r[8]=t[6]*e[2]+t[7]*e[5]+t[8]*e[8],r};class wt{constructor(e){this.index=0,this.length=e,this.points=We(this.length)}static grid(e=1,n=1){return new wt(5*e*n)}static point(e,n){const r=We(5);return r[0]=1,r[1]=e,r[2]=n,r[3]=e,r[4]=n,r}static positionPair(e){const n=We(5);return n[0]=1,n[1]=e.x1,n[2]=e.y1,n[3]=e.x2,n[4]=e.y2,n}static projection(e){return wt.singleBox(e.width,e.height,e.x,e.y)}static singleBox(e,n,r=0,o=0){const c=We(5);return c[0]=1,c[1]=r,c[2]=o,c[3]=e+r,c[4]=n+o,c}row(e){return e(this)}addPoints(e,n,r,o){return this.points[this.index]=1,this.points[1+this.index]=e,this.points[2+this.index]=n,this.points[3+this.index]=r,this.points[4+this.index]=o,this.index+=5,this}addBox(e,n,r,o){return this.addPoints(e,n,e+r,n+o),this}build(){return this.points}}const Br=(t,e)=>{const n=t.length;for(let r=0;r<n;r++)t[r]=r%5===0?e[6]*t[r+1]+e[7]*t[r+2]+e[8]*t[r]:r%5%2===1?e[0]*t[r]+e[1]*t[r+1]+e[2]:e[3]*t[r-1]+e[4]*t[r]+e[5];return t},Ys=t=>{const e=We(9);return e[0]=t,e[4]=t,e[8]=1,e},mi=(t,e)=>{const n=We(9);return n[0]=1,n[2]=t,n[4]=1,n[5]=e,n[8]=1,n},Ru=(t,e,n)=>ps(mi((1-t)*e,(1-t)*n),Ys(t)),vs=(t,e,n)=>{const r=t.length,o=n&&n.length>=r?n.slice(0,r):We(r);for(let c=0;c<r;c++)o[c]=c%5===0?e[6]*t[c+1]+e[7]*t[c+2]+e[8]*t[c]:c%5%2===1?e[0]*t[c]+e[1]*t[c+1]+e[2]:e[3]*t[c-1]+e[4]*t[c]+e[5];return o};let mf=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((e,n)=>(n&=63,n<36?e+=n.toString(36):n<62?e+=(n-26).toString(36).toUpperCase():n>62?e+="-":e+="_",e),"");class Hr{constructor(){this.__revision=0,this.__owner={value:void 0},this.__state={},this.scale=1,this.layers=[],this.time=[],this.addEventListener=(e,n,r)=>{const o=tl[e];if(!this.eventHandlers[o])throw new Error(`Unknown event ${o}`);this.eventHandlers[o].indexOf(n)===-1&&this.eventHandlers[o].push(n)},this.removeEventListener=(e,n)=>{const r=tl[e];if(!this.eventHandlers[r]){console.warn(`Unknown event ${r}`);return}this.eventHandlers[r].indexOf(n)!==-1&&(this.eventHandlers[r]=this.eventHandlers[r].filter(o=>o!==n))},this.id=this.__id=mf(),this.eventHandlers=Jx()}get crop(){return this._crop}set crop(e){this._crop=e}getObjectsAt(e){return[]}getAllPointsAt(e,n,r){return[]}getScheduledUpdates(e,n){return[]}dispatchEvent(e,n){const r=this.eventHandlers[e],o=r?r.length:0;let c=!1;if(o)for(let h=0;h<o;h++)try{r[h](n),c=!0}catch(v){console.error(e,v)}return c}get x(){return this.points[1]}get y(){return this.points[2]}get width(){return this.points[3]-this.points[1]}get height(){return this.points[4]-this.points[2]}translate(e,n){Br(this.points,mi(e,n))}atScale(e){Br(this.points,Ru(e,this.x,this.y)),this.scale*=e}transform(e){Br(this.points,e)}applyProps(e){this.__revision++}appendChild(e){}removeChild(e){}insertBefore(e,n){}hideInstance(){}}class xr extends Hr{constructor(e){if(super(),this.type="spacial-content",this.style={opacity:1},!e)this.id="",this.uri="",this.display={x:0,y:0,scale:1,width:0,height:0,points:We(5)},this.points=We(5);else{const n=e.scale||1;this.id=e.id||e.uri,this.uri=e.uri,this.points=wt.singleBox(e.width,e.height,e.x,e.y),this.display={x:0,y:0,scale:n,width:e.width/n,height:e.height/n,points:wt.singleBox(e.width/n,e.height/n),rotation:e==null?void 0:e.rotation}}}applyProps(e){const n=e.display?e.display.width:e.target.width,r=e.target.width/n;if(this.id=e.id||e.uri,this.uri=e.uri,this.points.set(wt.singleBox(e.target.width,e.target.height,e.target.x,e.target.y)),e.style&&typeof e.style.opacity<"u"&&(this.style.opacity=e.style.opacity),e.crop){this.cropData=e.crop;const o=wt.singleBox(e.crop.width,e.crop.height,e.crop.x,e.crop.y);Br(o,mi(-e.crop.x,-e.crop.y)),this.crop?this.crop.set(o):this.crop=We(o)}e.display?(this.display.scale=r,this.display.width=e.display.width,this.display.height=e.display.height,this.display.rotation=e.display.rotation,this.display.points=wt.singleBox(e.display.width,e.display.height)):(this.display.scale=r,this.display.width=e.target.width/r,this.display.height=e.target.height/r,this.display.points=wt.singleBox(e.target.width/r,e.target.height/r))}getAllPointsAt(e,n,r){return[[this,this.crop||this.points,n]]}static fromSvg(e,n,r,o){return xr.fromImage("data:image/svg+xml;base64,"+btoa(e),n,r,o)}static fromImage(e,n,r,o){const c=new xr;return c.applyProps({uri:e,id:o,display:r,target:n}),c}getImageUrl(){return this.uri}}class tp extends Hr{constructor(e){if(super(),this.type="spacial-content",this.getTexture=()=>({source:void 0,hash:-1}),!e)this.id="",this.uri="",this.display={x:0,y:0,scale:1,width:0,height:0,points:We(5)},this.points=We(5);else{const n=e.scale||1;this.id=e.id||e.uri,this.uri=e.uri,this.points=wt.singleBox(e.width,e.height),this.display={x:0,y:0,scale:n,width:e.width/n,height:e.height/n,points:n!==1?wt.singleBox(e.width/n,e.height/n):this.points}}}applyProps(e){const n=e.display?e.display.width:e.target.width,r=e.target.width/n;this.id=e.id,this.points.set(wt.singleBox(e.target.width,e.target.height)),this.display.scale=r,this.display.width=e.target.width/r,this.display.height=e.target.height/r,this.getTexture=e.getTexture,this.display.points=r!==1?wt.singleBox(e.target.width/r,e.target.height/r):this.points}getAllPointsAt(e,n,r){return[[this,this.points,n]]}}function nE(t,e,n=1){const r=e.length;if(r===0)throw new Error("No resources passed in.");let o=0;for(let c=0;c<r&&!(!e[c]||!e[c].display);c++)o=Math.abs(e[c].display.scale-t)*n<Math.abs(e[o].display.scale-t)?c:o;return o}function Og(t,e){return Math.abs(t-e)}function gf(t,e){const n=Og(t.x,e.x),r=Og(t.y,e.y);return Math.sqrt(Math.pow(n,2)+Math.pow(r,2))}function iE(t){const e=t.length;return t.indexOf("/info.json")===e-10?t.slice(0,-10):t}function Dg(...t){return e=>t.forEach(n=>function(r,o){typeof r=="function"?r(o):r!=null&&(r.current=o)}(n,e))}function yf(...t){return ae.useCallback(Dg(...t),t)}function oi(){return oi=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},oi.apply(this,arguments)}const Lg=ae.forwardRef((t,e)=>{const{children:n,...r}=t;return ae.Children.toArray(n).some(kg)?ae.createElement(ae.Fragment,null,ae.Children.map(n,o=>kg(o)?ae.createElement(np,oi({},r,{ref:e}),o.props.children):o)):ae.createElement(np,oi({},r,{ref:e}),n)});Lg.displayName="Slot";const np=ae.forwardRef((t,e)=>{const{children:n,...r}=t;return ae.isValidElement(n)?ae.cloneElement(n,{...rE(r,n.props),ref:Dg(e,n.ref)}):ae.Children.count(n)>1?ae.Children.only(null):null});np.displayName="SlotClone";const Pg=({children:t})=>ae.createElement(ae.Fragment,null,t);function kg(t){return ae.isValidElement(t)&&t.type===Pg}function rE(t,e){const n={...e};for(const r in e){const o=t[r],c=e[r];/^on[A-Z]/.test(r)?n[r]=(...h)=>{c==null||c(...h),o==null||o(...h)}:r==="style"?n[r]={...o,...c}:r==="className"&&(n[r]=[o,c].filter(Boolean).join(" "))}return{...t,...n}}const Sf=globalThis!=null&&globalThis.document?ae.useLayoutEffect:()=>{};var bf=function(e,n,r,o){this.name=e,this.fn=n,this.args=r,this.modifiers=o};bf.prototype._test=function(e){var n=this.fn;try{nl(this.modifiers.slice(),n,this)(e)}catch{n=function(){return!1}}try{return nl(this.modifiers.slice(),n,this)(e)}catch{return!1}},bf.prototype._check=function(e){try{nl(this.modifiers.slice(),this.fn,this)(e)}catch{if(nl(this.modifiers.slice(),function(r){return r},this)(!1))return}if(!nl(this.modifiers.slice(),this.fn,this)(e))throw null},bf.prototype._testAsync=function(e){var n=this;return new Promise(function(r,o){Ng(n.modifiers.slice(),n.fn,n)(e).then(function(c){c?r(e):o(null)}).catch(function(c){return o(c)})})};function zg(t,e){return e===void 0&&(e="simple"),typeof t=="object"?t[e]:t}function nl(t,e,n){if(t.length){var r=t.shift(),o=nl(t,e,n);return r.perform(o,n)}else return zg(e)}function Ng(t,e,n){if(t.length){var r=t.shift(),o=Ng(t,e,n);return r.performAsync(o,n)}else return function(c){return Promise.resolve(zg(e,"async")(c))}}var sE=function(e,n,r){this.name=e,this.perform=n,this.performAsync=r},ip=function(t){function e(n,r,o,c){for(var h=[],v=arguments.length-4;v-- >0;)h[v]=arguments[v+4];t.call(this,h),t.captureStackTrace&&t.captureStackTrace(this,e),this.rule=n,this.value=r,this.cause=o,this.target=c}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),Vr=function(e,n){e===void 0&&(e=[]),n===void 0&&(n=[]),this.chain=e,this.nextRuleModifiers=n};Vr.prototype._applyRule=function(e,n){var r=this;return function(){for(var o=[],c=arguments.length;c--;)o[c]=arguments[c];return r.chain.push(new bf(n,e.apply(r,o),o,r.nextRuleModifiers)),r.nextRuleModifiers=[],r}},Vr.prototype._applyModifier=function(e,n){return this.nextRuleModifiers.push(new sE(n,e.simple,e.async)),this},Vr.prototype._clone=function(){return new Vr(this.chain.slice(),this.nextRuleModifiers.slice())},Vr.prototype.test=function(e){return this.chain.every(function(n){return n._test(e)})},Vr.prototype.testAll=function(e){var n=[];return this.chain.forEach(function(r){try{r._check(e)}catch(o){n.push(new ip(r,e,o))}}),n},Vr.prototype.check=function(e){this.chain.forEach(function(n){try{n._check(e)}catch(r){throw new ip(n,e,r)}})},Vr.prototype.testAsync=function(e){var n=this;return new Promise(function(r,o){_g(e,n.chain.slice(),r,o)})};function _g(t,e,n,r){if(e.length){var o=e.shift();o._testAsync(t).then(function(){_g(t,e,n,r)},function(c){r(new ip(o,t,c))})}else n(t)}var Ug=function(t,e){return e&&typeof t=="string"&&t.trim().length===0?!0:t==null};function aE(t,e){return e===void 0&&(e=!1),{simple:function(n){return Ug(n,e)||t.check(n)===void 0},async:function(n){return Ug(n,e)||t.testAsync(n)}}}function Qs(){return typeof Proxy<"u"?jg(new Vr):rp(new Vr)}var Au={};Qs.extend=function(t){Object.assign(Au,t)},Qs.clearCustomRules=function(){Au={}};function jg(t){return new Proxy(t,{get:function(n,r){if(r in n)return n[r];var o=jg(t._clone());if(r in xf)return o._applyModifier(xf[r],r);if(r in Au)return o._applyRule(Au[r],r);if(r in sp)return o._applyRule(sp[r],r)}})}function rp(t){var e=function(o,c){return Object.keys(o).forEach(function(h){c[h]=function(){for(var v=[],g=arguments.length;g--;)v[g]=arguments[g];var x=rp(c._clone()),m=x._applyRule(o[h],h).apply(void 0,v);return m}}),c},n=e(sp,t),r=e(Au,n);return Object.keys(xf).forEach(function(o){Object.defineProperty(r,o,{get:function(){var c=rp(r._clone());return c._applyModifier(xf[o],o)}})}),r}var xf={not:{simple:function(t){return function(e){return!t(e)}},async:function(t){return function(e){return Promise.resolve(t(e)).then(function(n){return!n}).catch(function(){return!0})}}},some:{simple:function(t){return function(e){return Ef(e).some(function(n){try{return t(n)}catch{return!1}})}},async:function(t){return function(e){return Promise.all(Ef(e).map(function(n){try{return t(n).catch(function(){return!1})}catch{return!1}})).then(function(n){return n.some(Boolean)})}}},every:{simple:function(t){return function(e){return e!==!1&&Ef(e).every(t)}},async:function(t){return function(e){return Promise.all(Ef(e).map(t)).then(function(n){return n.every(Boolean)})}}},strict:{simple:function(t,e){return function(n){return Ig(e)&&n&&typeof n=="object"?Object.keys(e.args[0]).length===Object.keys(n).length&&t(n):t(n)}},async:function(t,e){return function(n){return Promise.resolve(t(n)).then(function(r){return Ig(e)&&n&&typeof n=="object"?Object.keys(e.args[0]).length===Object.keys(n).length&&r:r}).catch(function(){return!1})}}}};function Ig(t){return t&&t.name==="schema"&&t.args.length>0&&typeof t.args[0]=="object"}function Ef(t){return typeof t=="string"?t.split(""):t}var sp={equal:function(t){return function(e){return e==t}},exact:function(t){return function(e){return e===t}},number:function(t){return t===void 0&&(t=!0),function(e){return typeof e=="number"&&(t||isFinite(e))}},integer:function(){return function(t){var e=Number.isInteger||oE;return e(t)}},numeric:function(){return function(t){return!isNaN(parseFloat(t))&&isFinite(t)}},string:function(){return il("string")},boolean:function(){return il("boolean")},undefined:function(){return il("undefined")},null:function(){return il("null")},array:function(){return il("array")},object:function(){return il("object")},instanceOf:function(t){return function(e){return e instanceof t}},pattern:function(t){return function(e){return t.test(e)}},lowercase:function(){return function(t){return typeof t=="boolean"||t===t.toLowerCase()&&t.trim()!==""}},uppercase:function(){return function(t){return t===t.toUpperCase()&&t.trim()!==""}},vowel:function(){return function(t){return/^[aeiou]+$/i.test(t)}},consonant:function(){return function(t){return/^(?=[^aeiou])([a-z]+)$/i.test(t)}},first:function(t){return function(e){return e[0]==t}},last:function(t){return function(e){return e[e.length-1]==t}},empty:function(){return function(t){return t.length===0}},length:function(t,e){return function(n){return n.length>=t&&n.length<=(e||t)}},minLength:function(t){return function(e){return e.length>=t}},maxLength:function(t){return function(e){return e.length<=t}},negative:function(){return function(t){return t<0}},positive:function(){return function(t){return t>=0}},between:function(t,e){return function(n){return n>=t&&n<=e}},range:function(t,e){return function(n){return n>=t&&n<=e}},lessThan:function(t){return function(e){return e<t}},lessThanOrEqual:function(t){return function(e){return e<=t}},greaterThan:function(t){return function(e){return e>t}},greaterThanOrEqual:function(t){return function(e){return e>=t}},even:function(){return function(t){return t%2===0}},odd:function(){return function(t){return t%2!==0}},includes:function(t){return function(e){return~e.indexOf(t)}},schema:function(t){return lE(t)},passesAnyOf:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return function(n){return t.some(function(r){return r.test(n)})}},optional:aE};function il(t){return function(e){return Array.isArray(e)&&t==="array"||e===null&&t==="null"||typeof e===t}}function oE(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t}function lE(t){return{simple:function(e){var n=[];if(Object.keys(t).forEach(function(r){var o=t[r];try{o.check((e||{})[r])}catch(c){c.target=r,n.push(c)}}),n.length>0)throw n;return!0},async:function(e){var n=[],r=Object.keys(t).map(function(o){var c=t[o];return c.testAsync((e||{})[o]).catch(function(h){h.target=o,n.push(h)})});return Promise.all(r).then(function(){if(n.length>0)throw n;return!0})}}}var Bt="colors",gi="sizes",Ne="space",uE={gap:Ne,gridGap:Ne,columnGap:Ne,gridColumnGap:Ne,rowGap:Ne,gridRowGap:Ne,inset:Ne,insetBlock:Ne,insetBlockEnd:Ne,insetBlockStart:Ne,insetInline:Ne,insetInlineEnd:Ne,insetInlineStart:Ne,margin:Ne,marginTop:Ne,marginRight:Ne,marginBottom:Ne,marginLeft:Ne,marginBlock:Ne,marginBlockEnd:Ne,marginBlockStart:Ne,marginInline:Ne,marginInlineEnd:Ne,marginInlineStart:Ne,padding:Ne,paddingTop:Ne,paddingRight:Ne,paddingBottom:Ne,paddingLeft:Ne,paddingBlock:Ne,paddingBlockEnd:Ne,paddingBlockStart:Ne,paddingInline:Ne,paddingInlineEnd:Ne,paddingInlineStart:Ne,top:Ne,right:Ne,bottom:Ne,left:Ne,scrollMargin:Ne,scrollMarginTop:Ne,scrollMarginRight:Ne,scrollMarginBottom:Ne,scrollMarginLeft:Ne,scrollMarginX:Ne,scrollMarginY:Ne,scrollMarginBlock:Ne,scrollMarginBlockEnd:Ne,scrollMarginBlockStart:Ne,scrollMarginInline:Ne,scrollMarginInlineEnd:Ne,scrollMarginInlineStart:Ne,scrollPadding:Ne,scrollPaddingTop:Ne,scrollPaddingRight:Ne,scrollPaddingBottom:Ne,scrollPaddingLeft:Ne,scrollPaddingX:Ne,scrollPaddingY:Ne,scrollPaddingBlock:Ne,scrollPaddingBlockEnd:Ne,scrollPaddingBlockStart:Ne,scrollPaddingInline:Ne,scrollPaddingInlineEnd:Ne,scrollPaddingInlineStart:Ne,fontSize:"fontSizes",background:Bt,backgroundColor:Bt,backgroundImage:Bt,borderImage:Bt,border:Bt,borderBlock:Bt,borderBlockEnd:Bt,borderBlockStart:Bt,borderBottom:Bt,borderBottomColor:Bt,borderColor:Bt,borderInline:Bt,borderInlineEnd:Bt,borderInlineStart:Bt,borderLeft:Bt,borderLeftColor:Bt,borderRight:Bt,borderRightColor:Bt,borderTop:Bt,borderTopColor:Bt,caretColor:Bt,color:Bt,columnRuleColor:Bt,fill:Bt,outline:Bt,outlineColor:Bt,stroke:Bt,textDecorationColor:Bt,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:gi,minBlockSize:gi,maxBlockSize:gi,inlineSize:gi,minInlineSize:gi,maxInlineSize:gi,width:gi,minWidth:gi,maxWidth:gi,height:gi,minHeight:gi,maxHeight:gi,flexBasis:gi,gridTemplateColumns:gi,gridTemplateRows:gi,borderWidth:"borderWidths",borderTopWidth:"borderWidths",borderRightWidth:"borderWidths",borderBottomWidth:"borderWidths",borderLeftWidth:"borderWidths",borderStyle:"borderStyles",borderTopStyle:"borderStyles",borderRightStyle:"borderStyles",borderBottomStyle:"borderStyles",borderLeftStyle:"borderStyles",borderRadius:"radii",borderTopLeftRadius:"radii",borderTopRightRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",boxShadow:"shadows",textShadow:"shadows",transition:"transitions",zIndex:"zIndices"},cE=(t,e)=>typeof e=="function"?{"()":Function.prototype.toString.call(e)}:e,rl=()=>{const t=Object.create(null);return(e,n,...r)=>{const o=(c=>JSON.stringify(c,cE))(e);return o in t?t[o]:t[o]=n(e,...r)}},za=Symbol.for("sxs.internal"),ap=(t,e)=>Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)),Fg=t=>{for(const e in t)return!0;return!1},{hasOwnProperty:fE}=Object.prototype,op=t=>t.includes("-")?t:t.replace(/[A-Z]/g,e=>"-"+e.toLowerCase()),dE=/\s+(?![^()]*\))/,sl=t=>e=>t(...typeof e=="string"?String(e).split(dE):[e]),Bg={appearance:t=>({WebkitAppearance:t,appearance:t}),backfaceVisibility:t=>({WebkitBackfaceVisibility:t,backfaceVisibility:t}),backdropFilter:t=>({WebkitBackdropFilter:t,backdropFilter:t}),backgroundClip:t=>({WebkitBackgroundClip:t,backgroundClip:t}),boxDecorationBreak:t=>({WebkitBoxDecorationBreak:t,boxDecorationBreak:t}),clipPath:t=>({WebkitClipPath:t,clipPath:t}),content:t=>({content:t.includes('"')||t.includes("'")||/^([A-Za-z]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)$/.test(t)?t:`"${t}"`}),hyphens:t=>({WebkitHyphens:t,hyphens:t}),maskImage:t=>({WebkitMaskImage:t,maskImage:t}),maskSize:t=>({WebkitMaskSize:t,maskSize:t}),tabSize:t=>({MozTabSize:t,tabSize:t}),textSizeAdjust:t=>({WebkitTextSizeAdjust:t,textSizeAdjust:t}),userSelect:t=>({WebkitUserSelect:t,userSelect:t}),marginBlock:sl((t,e)=>({marginBlockStart:t,marginBlockEnd:e||t})),marginInline:sl((t,e)=>({marginInlineStart:t,marginInlineEnd:e||t})),maxSize:sl((t,e)=>({maxBlockSize:t,maxInlineSize:e||t})),minSize:sl((t,e)=>({minBlockSize:t,minInlineSize:e||t})),paddingBlock:sl((t,e)=>({paddingBlockStart:t,paddingBlockEnd:e||t})),paddingInline:sl((t,e)=>({paddingInlineStart:t,paddingInlineEnd:e||t}))},lp=/([\d.]+)([^]*)/,hE=(t,e)=>t.length?t.reduce((n,r)=>(n.push(...e.map(o=>o.includes("&")?o.replace(/&/g,/[ +>|~]/.test(r)&&/&.*&/.test(o)?`:is(${r})`:r):r+" "+o)),n),[]):e,pE=(t,e)=>t in vE&&typeof e=="string"?e.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,(n,r,o,c)=>r+(o==="stretch"?`-moz-available${c};${op(t)}:${r}-webkit-fill-available`:`-moz-fit-content${c};${op(t)}:${r}fit-content`)+c):String(e),vE={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},ms=t=>t?t+"-":"",Hg=(t,e,n)=>t.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,(r,o,c,h,v)=>h=="$"==!!c?r:(o||h=="--"?"calc(":"")+"var(--"+(h==="$"?ms(e)+(v.includes("$")?"":ms(n))+v.replace(/\$/g,"-"):v)+")"+(o||h=="--"?"*"+(o||"")+(c||"1")+")":"")),mE=/\s*,\s*(?![^()]*\))/,gE=Object.prototype.toString,al=(t,e,n,r,o)=>{let c,h,v;const g=(x,m,w)=>{let A,P;const M=_=>{for(A in _){const O=A.charCodeAt(0)===64,I=O&&Array.isArray(_[A])?_[A]:[_[A]];for(P of I){const q=/[A-Z]/.test(k=A)?k:k.replace(/-[^]/g,H=>H[1].toUpperCase()),te=typeof P=="object"&&P&&P.toString===gE&&(!r.utils[q]||!m.length);if(q in r.utils&&!te){const H=r.utils[q];if(H!==h){h=H,M(H(P)),h=null;continue}}else if(q in Bg){const H=Bg[q];if(H!==v){v=H,M(H(P)),v=null;continue}}if(O&&(L=A.slice(1)in r.media?"@media "+r.media[A.slice(1)]:A,A=L.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,(H,J,re,$,se,ge)=>{const Ce=lp.test(J),me=.0625*(Ce?-1:1),[Ie,_e]=Ce?[$,J]:[J,$];return"("+(re[0]==="="?"":re[0]===">"===Ce?"max-":"min-")+Ie+":"+(re[0]!=="="&&re.length===1?_e.replace(lp,(Ye,gt,Z)=>Number(gt)+me*(re===">"?1:-1)+Z):_e)+(se?") and ("+(se[0]===">"?"min-":"max-")+Ie+":"+(se.length===1?ge.replace(lp,(Ye,gt,Z)=>Number(gt)+me*(se===">"?-1:1)+Z):ge):"")+")"})),te){const H=O?w.concat(A):[...w],J=O?[...m]:hE(m,A.split(mE));c!==void 0&&o(Vg(...c)),c=void 0,g(P,J,H)}else c===void 0&&(c=[[],m,w]),A=O||A.charCodeAt(0)!==36?A:`--${ms(r.prefix)}${A.slice(1).replace(/\$/g,"-")}`,P=te?P:typeof P=="number"?P&&q in yE?String(P)+"px":String(P):Hg(pE(q,P??""),r.prefix,r.themeMap[q]),c[0].push(`${O?`${A} `:`${op(A)}:`}${P}`)}}var L,k};M(x),c!==void 0&&o(Vg(...c)),c=void 0};g(t,e,n)},Vg=(t,e,n)=>`${n.map(r=>`${r}{`).join("")}${e.length?`${e.join(",")}{`:""}${t.join(";")}${e.length?"}":""}${Array(n.length?n.length+1:0).join("}")}`,yE={animationDelay:1,animationDuration:1,backgroundSize:1,blockSize:1,border:1,borderBlock:1,borderBlockEnd:1,borderBlockEndWidth:1,borderBlockStart:1,borderBlockStartWidth:1,borderBlockWidth:1,borderBottom:1,borderBottomLeftRadius:1,borderBottomRightRadius:1,borderBottomWidth:1,borderEndEndRadius:1,borderEndStartRadius:1,borderInlineEnd:1,borderInlineEndWidth:1,borderInlineStart:1,borderInlineStartWidth:1,borderInlineWidth:1,borderLeft:1,borderLeftWidth:1,borderRadius:1,borderRight:1,borderRightWidth:1,borderSpacing:1,borderStartEndRadius:1,borderStartStartRadius:1,borderTop:1,borderTopLeftRadius:1,borderTopRightRadius:1,borderTopWidth:1,borderWidth:1,bottom:1,columnGap:1,columnRule:1,columnRuleWidth:1,columnWidth:1,containIntrinsicSize:1,flexBasis:1,fontSize:1,gap:1,gridAutoColumns:1,gridAutoRows:1,gridTemplateColumns:1,gridTemplateRows:1,height:1,inlineSize:1,inset:1,insetBlock:1,insetBlockEnd:1,insetBlockStart:1,insetInline:1,insetInlineEnd:1,insetInlineStart:1,left:1,letterSpacing:1,margin:1,marginBlock:1,marginBlockEnd:1,marginBlockStart:1,marginBottom:1,marginInline:1,marginInlineEnd:1,marginInlineStart:1,marginLeft:1,marginRight:1,marginTop:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,offsetDistance:1,offsetRotate:1,outline:1,outlineOffset:1,outlineWidth:1,overflowClipMargin:1,padding:1,paddingBlock:1,paddingBlockEnd:1,paddingBlockStart:1,paddingBottom:1,paddingInline:1,paddingInlineEnd:1,paddingInlineStart:1,paddingLeft:1,paddingRight:1,paddingTop:1,perspective:1,right:1,rowGap:1,scrollMargin:1,scrollMarginBlock:1,scrollMarginBlockEnd:1,scrollMarginBlockStart:1,scrollMarginBottom:1,scrollMarginInline:1,scrollMarginInlineEnd:1,scrollMarginInlineStart:1,scrollMarginLeft:1,scrollMarginRight:1,scrollMarginTop:1,scrollPadding:1,scrollPaddingBlock:1,scrollPaddingBlockEnd:1,scrollPaddingBlockStart:1,scrollPaddingBottom:1,scrollPaddingInline:1,scrollPaddingInlineEnd:1,scrollPaddingInlineStart:1,scrollPaddingLeft:1,scrollPaddingRight:1,scrollPaddingTop:1,shapeMargin:1,textDecoration:1,textDecorationThickness:1,textIndent:1,textUnderlineOffset:1,top:1,transitionDelay:1,transitionDuration:1,verticalAlign:1,width:1,wordSpacing:1},Wg=t=>String.fromCharCode(t+(t>25?39:97)),Na=t=>(e=>{let n,r="";for(n=Math.abs(e);n>52;n=n/52|0)r=Wg(n%52)+r;return Wg(n%52)+r})(((e,n)=>{let r=n.length;for(;r;)e=33*e^n.charCodeAt(--r);return e})(5381,JSON.stringify(t))>>>0),Mu=["themed","global","styled","onevar","resonevar","allvar","inline"],SE=t=>{if(t.href&&!t.href.startsWith(location.origin))return!1;try{return!!t.cssRules}catch{return!1}},bE=t=>{let e;const n=()=>{const{cssRules:o}=e.sheet;return[].map.call(o,(c,h)=>{const{cssText:v}=c;let g="";if(v.startsWith("--sxs"))return"";if(o[h-1]&&(g=o[h-1].cssText).startsWith("--sxs")){if(!c.cssRules.length)return"";for(const x in e.rules)if(e.rules[x].group===c)return`--sxs{--sxs:${[...e.rules[x].cache].join(" ")}}${v}`;return c.cssRules.length?`${g}${v}`:""}return v}).join("")},r=()=>{if(e){const{rules:v,sheet:g}=e;if(!g.deleteRule){for(;Object(Object(g.cssRules)[0]).type===3;)g.cssRules.splice(0,1);g.cssRules=[]}for(const x in v)delete v[x]}const o=Object(t).styleSheets||[];for(const v of o)if(SE(v)){for(let g=0,x=v.cssRules;x[g];++g){const m=Object(x[g]);if(m.type!==1)continue;const w=Object(x[g+1]);if(w.type!==4)continue;++g;const{cssText:A}=m;if(!A.startsWith("--sxs"))continue;const P=A.slice(14,-3).trim().split(/\s+/),M=Mu[P[0]];M&&(e||(e={sheet:v,reset:r,rules:{},toString:n}),e.rules[M]={group:w,index:g,cache:new Set(P)})}if(e)break}if(!e){const v=(g,x)=>({type:x,cssRules:[],insertRule(m,w){this.cssRules.splice(w,0,v(m,{import:3,undefined:1}[(m.toLowerCase().match(/^@([a-z]+)/)||[])[1]]||4))},get cssText(){return g==="@media{}"?`@media{${[].map.call(this.cssRules,m=>m.cssText).join("")}}`:g}});e={sheet:t?(t.head||t).appendChild(document.createElement("style")).sheet:v("","text/css"),rules:{},reset:r,toString:n}}const{sheet:c,rules:h}=e;for(let v=Mu.length-1;v>=0;--v){const g=Mu[v];if(!h[g]){const x=Mu[v+1],m=h[x]?h[x].index:c.cssRules.length;c.insertRule("@media{}",m),c.insertRule(`--sxs{--sxs:${v}}`,m),h[g]={group:c.cssRules[m+1],index:m,cache:new Set([v])}}xE(h[g])}};return r(),e},xE=t=>{const e=t.group;let n=e.cssRules.length;t.apply=r=>{try{e.insertRule(r,n),++n}catch{}}},Ou=Symbol(),EE=rl(),$g=(t,e)=>EE(t,()=>(...n)=>{let r={type:null,composers:new Set};for(const o of n)if(o!=null)if(o[za]){r.type==null&&(r.type=o[za].type);for(const c of o[za].composers)r.composers.add(c)}else o.constructor!==Object||o.$$typeof?r.type==null&&(r.type=o):r.composers.add(wE(o,t));return r.type==null&&(r.type="span"),r.composers.size||r.composers.add(["PJLV",{},[],[],{},[]]),TE(t,r,e)}),wE=({variants:t,compoundVariants:e,defaultVariants:n,...r},o)=>{const c=`${ms(o.prefix)}c-${Na(r)}`,h=[],v=[],g=Object.create(null),x=[];for(const A in n)g[A]=String(n[A]);if(typeof t=="object"&&t)for(const A in t){m=g,w=A,fE.call(m,w)||(g[A]="undefined");const P=t[A];for(const M in P){const _={[A]:String(M)};String(M)==="undefined"&&x.push(A);const L=P[M],k=[_,L,!Fg(L)];h.push(k)}}var m,w;if(typeof e=="object"&&e)for(const A of e){let{css:P,...M}=A;P=typeof P=="object"&&P||{};for(const L in M)M[L]=String(M[L]);const _=[M,P,!Fg(P)];v.push(_)}return[c,r,h,v,g,x]},TE=(t,e,n)=>{const[r,o,c,h]=CE(e.composers),v=typeof e.type=="function"||e.type.$$typeof?(w=>{function A(){for(let P=0;P<A[Ou].length;P++){const[M,_]=A[Ou][P];w.rules[M].apply(_)}return A[Ou]=[],null}return A[Ou]=[],A.rules={},Mu.forEach(P=>A.rules[P]={apply:M=>A[Ou].push([P,M])}),A})(n):null,g=(v||n).rules,x=`.${r}${o.length>1?`:where(.${o.slice(1).join(".")})`:""}`,m=w=>{w=typeof w=="object"&&w||RE;const{css:A,...P}=w,M={};for(const k in c)if(delete P[k],k in w){let O=w[k];typeof O=="object"&&O?M[k]={"@initial":c[k],...O}:(O=String(O),M[k]=O!=="undefined"||h.has(k)?O:c[k])}else M[k]=c[k];const _=new Set([...o]);for(const[k,O,I,q]of e.composers){n.rules.styled.cache.has(k)||(n.rules.styled.cache.add(k),al(O,[`.${k}`],[],t,J=>{g.styled.apply(J)}));const te=qg(I,M,t.media),H=qg(q,M,t.media,!0);for(const J of te)if(J!==void 0)for(const[re,$,se]of J){const ge=`${k}-${Na($)}-${re}`;_.add(ge);const Ce=(se?n.rules.resonevar:n.rules.onevar).cache,me=se?g.resonevar:g.onevar;Ce.has(ge)||(Ce.add(ge),al($,[`.${ge}`],[],t,Ie=>{me.apply(Ie)}))}for(const J of H)if(J!==void 0)for(const[re,$]of J){const se=`${k}-${Na($)}-${re}`;_.add(se),n.rules.allvar.cache.has(se)||(n.rules.allvar.cache.add(se),al($,[`.${se}`],[],t,ge=>{g.allvar.apply(ge)}))}}if(typeof A=="object"&&A){const k=`${r}-i${Na(A)}-css`;_.add(k),n.rules.inline.cache.has(k)||(n.rules.inline.cache.add(k),al(A,[`.${k}`],[],t,O=>{g.inline.apply(O)}))}for(const k of String(w.className||"").trim().split(/\s+/))k&&_.add(k);const L=P.className=[..._].join(" ");return{type:e.type,className:L,selector:x,props:P,toString:()=>L,deferredInjector:v}};return ap(m,{className:r,selector:x,[za]:e,toString:()=>(n.rules.styled.cache.has(r)||m(),r)})},CE=t=>{let e="";const n=[],r={},o=[];for(const[c,,,,h,v]of t){e===""&&(e=c),n.push(c),o.push(...v);for(const g in h){const x=h[g];(r[g]===void 0||x!=="undefined"||v.includes(x))&&(r[g]=x)}}return[e,n,r,new Set(o)]},qg=(t,e,n,r)=>{const o=[];e:for(let[c,h,v]of t){if(v)continue;let g,x=0,m=!1;for(g in c){const w=c[g];let A=e[g];if(A!==w){if(typeof A!="object"||!A)continue e;{let P,M,_=0;for(const L in A){if(w===String(A[L])){if(L!=="@initial"){const k=L.slice(1);(M=M||[]).push(k in n?n[k]:L.replace(/^@media ?/,"")),m=!0}x+=_,P=!0}++_}if(M&&M.length&&(h={["@media "+M.join(", ")]:h}),!P)continue e}}}(o[x]=o[x]||[]).push([r?"cv":`${g}-${c[g]}`,h,m])}return o},RE={},AE=rl(),ME=(t,e)=>AE(t,()=>(...n)=>{const r=()=>{for(let o of n){o=typeof o=="object"&&o||{};let c=Na(o);if(!e.rules.global.cache.has(c)){if(e.rules.global.cache.add(c),"@import"in o){let h=[].indexOf.call(e.sheet.cssRules,e.rules.themed.group)-1;for(let v of[].concat(o["@import"]))v=v.includes('"')||v.includes("'")?v:`"${v}"`,e.sheet.insertRule(`@import ${v};`,h++);delete o["@import"]}al(o,[],[],t,h=>{e.rules.global.apply(h)})}}return""};return ap(r,{toString:r})}),OE=rl(),DE=(t,e)=>OE(t,()=>n=>{const r=`${ms(t.prefix)}k-${Na(n)}`,o=()=>{if(!e.rules.global.cache.has(r)){e.rules.global.cache.add(r);const c=[];al(n,[],[],t,v=>c.push(v));const h=`@keyframes ${r}{${c.join("")}}`;e.rules.global.apply(h)}return r};return ap(o,{get name(){return o()},toString:o})}),LE=class{constructor(t,e,n,r){this.token=t==null?"":String(t),this.value=e==null?"":String(e),this.scale=n==null?"":String(n),this.prefix=r==null?"":String(r)}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+ms(this.prefix)+ms(this.scale)+this.token}toString(){return this.computedValue}},PE=rl(),kE=(t,e)=>PE(t,()=>(n,r)=>{r=typeof n=="object"&&n||Object(r);const o=`.${n=(n=typeof n=="string"?n:"")||`${ms(t.prefix)}t-${Na(r)}`}`,c={},h=[];for(const g in r){c[g]={};for(const x in r[g]){const m=`--${ms(t.prefix)}${g}-${x}`,w=Hg(String(r[g][x]),t.prefix,g);c[g][x]=new LE(x,w,g,t.prefix),h.push(`${m}:${w}`)}}const v=()=>{if(h.length&&!e.rules.themed.cache.has(n)){e.rules.themed.cache.add(n);const g=`${r===t.theme?":root,":""}.${n}{${h.join(";")}}`;e.rules.themed.apply(g)}return n};return{...c,get className(){return v()},selector:o,toString:v}}),zE=rl(),NE=rl(),_E=t=>{const e=(n=>{let r=!1;const o=zE(n,c=>{r=!0;const h="prefix"in(c=typeof c=="object"&&c||{})?String(c.prefix):"",v=typeof c.media=="object"&&c.media||{},g=typeof c.root=="object"?c.root||null:globalThis.document||null,x=typeof c.theme=="object"&&c.theme||{},m={prefix:h,media:v,theme:x,themeMap:typeof c.themeMap=="object"&&c.themeMap||{...uE},utils:typeof c.utils=="object"&&c.utils||{}},w=bE(g),A={css:$g(m,w),globalCss:ME(m,w),keyframes:DE(m,w),createTheme:kE(m,w),reset(){w.reset(),A.theme.toString()},theme:{},sheet:w,config:m,prefix:h,getCssText:w.toString,toString:w.toString};return String(A.theme=A.createTheme(x)),A});return r||o.reset(),o})(t);return e.styled=(({config:n,sheet:r})=>NE(n,()=>{const o=$g(n,r);return(...c)=>{const h=o(...c),v=h[za].type,g=C.forwardRef((x,m)=>{const w=x&&x.as||v,{props:A,deferredInjector:P}=h(x);return delete A.as,A.ref=m,P?C.createElement(C.Fragment,null,C.createElement(w,A),C.createElement(P,null)):C.createElement(w,A)});return g.className=h.className,g.displayName=`Styled.${v.displayName||v.name||v}`,g.selector=h.selector,g.toString=()=>h.selector,g[za]=h[za],g}}))(e),e};function UE(t,e,n){return Math.max(e,Math.min(t,n))}const li={toVector(t,e){return t===void 0&&(t=e),Array.isArray(t)?t:[t,t]},add(t,e){return[t[0]+e[0],t[1]+e[1]]},sub(t,e){return[t[0]-e[0],t[1]-e[1]]},addTo(t,e){t[0]+=e[0],t[1]+=e[1]},subTo(t,e){t[0]-=e[0],t[1]-=e[1]}};function Yg(t,e,n){return e===0||Math.abs(e)===1/0?Math.pow(t,n*5):t*e*n/(e+n*t)}function Qg(t,e,n,r=.15){return r===0?UE(t,e,n):t<e?-Yg(e-t,n-e,r)+e:t>n?+Yg(t-n,n-e,r)+n:t}function jE(t,[e,n],[r,o]){const[[c,h],[v,g]]=t;return[Qg(e,c,h,r),Qg(n,v,g,o)]}function IE(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function FE(t){var e=IE(t,"string");return typeof e=="symbol"?e:String(e)}function Li(t,e,n){return e=FE(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Gg(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function hn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Gg(Object(n),!0).forEach(function(r){Li(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Gg(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}const Xg={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function Kg(t){return t?t[0].toUpperCase()+t.slice(1):""}const BE=["enter","leave"];function HE(t=!1,e){return t&&!BE.includes(e)}function VE(t,e="",n=!1){const r=Xg[t],o=r&&r[e]||e;return"on"+Kg(t)+Kg(o)+(HE(n,o)?"Capture":"")}const WE=["gotpointercapture","lostpointercapture"];function $E(t){let e=t.substring(2).toLowerCase();const n=!!~e.indexOf("passive");n&&(e=e.replace("passive",""));const r=WE.includes(e)?"capturecapture":"capture",o=!!~e.indexOf(r);return o&&(e=e.replace("capture","")),{device:e,capture:o,passive:n}}function qE(t,e=""){const n=Xg[t],r=n&&n[e]||e;return t+r}function wf(t){return"touches"in t}function Zg(t){return wf(t)?"touch":"pointerType"in t?t.pointerType:"mouse"}function YE(t){return Array.from(t.touches).filter(e=>{var n,r;return e.target===t.currentTarget||((n=t.currentTarget)===null||n===void 0||(r=n.contains)===null||r===void 0?void 0:r.call(n,e.target))})}function QE(t){return t.type==="touchend"||t.type==="touchcancel"?t.changedTouches:t.targetTouches}function Jg(t){return wf(t)?QE(t)[0]:t}function GE(t){return YE(t).map(e=>e.identifier)}function up(t){const e=Jg(t);return wf(t)?e.identifier:e.pointerId}function ey(t){const e=Jg(t);return[e.clientX,e.clientY]}function XE(t){const e={};if("buttons"in t&&(e.buttons=t.buttons),"shiftKey"in t){const{shiftKey:n,altKey:r,metaKey:o,ctrlKey:c}=t;Object.assign(e,{shiftKey:n,altKey:r,metaKey:o,ctrlKey:c})}return e}function Tf(t,...e){return typeof t=="function"?t(...e):t}function KE(){}function ZE(...t){return t.length===0?KE:t.length===1?t[0]:function(){let e;for(const n of t)e=n.apply(this,arguments)||e;return e}}function ty(t,e){return Object.assign({},e,t||{})}const JE=32;class ew{constructor(e,n,r){this.ctrl=e,this.args=n,this.key=r,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:n,ingKey:r,args:o}=this;n[r]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=o,e.axis=void 0,e.memo=void 0,e.elapsedTime=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const n=this.state,r=this.config;n._active||(this.reset(),this.computeInitial(),n._active=!0,n.target=e.target,n.currentTarget=e.currentTarget,n.lastOffset=r.from?Tf(r.from,n):n.offset,n.offset=n.lastOffset),n.startTime=n.timeStamp=e.timeStamp}computeValues(e){const n=this.state;n._values=e,n.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:n,config:r,shared:o}=this;n.args=this.args;let c=0;if(e&&(n.event=e,r.preventDefault&&e.cancelable&&n.event.preventDefault(),n.type=e.type,o.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,o.locked=!!document.pointerLockElement,Object.assign(o,XE(e)),o.down=o.pressed=o.buttons%2===1||o.touches>0,c=e.timeStamp-n.timeStamp,n.timeStamp=e.timeStamp,n.elapsedTime=n.timeStamp-n.startTime),n._active){const H=n._delta.map(Math.abs);li.addTo(n._distance,H)}this.axisIntent&&this.axisIntent(e);const[h,v]=n._movement,[g,x]=r.threshold,{_step:m,values:w}=n;if(r.hasCustomTransform?(m[0]===!1&&(m[0]=Math.abs(h)>=g&&w[0]),m[1]===!1&&(m[1]=Math.abs(v)>=x&&w[1])):(m[0]===!1&&(m[0]=Math.abs(h)>=g&&Math.sign(h)*g),m[1]===!1&&(m[1]=Math.abs(v)>=x&&Math.sign(v)*x)),n.intentional=m[0]!==!1||m[1]!==!1,!n.intentional)return;const A=[0,0];if(r.hasCustomTransform){const[H,J]=w;A[0]=m[0]!==!1?H-m[0]:0,A[1]=m[1]!==!1?J-m[1]:0}else A[0]=m[0]!==!1?h-m[0]:0,A[1]=m[1]!==!1?v-m[1]:0;this.restrictToAxis&&!n._blocked&&this.restrictToAxis(A);const P=n.offset,M=n._active&&!n._blocked||n.active;M&&(n.first=n._active&&!n.active,n.last=!n._active&&n.active,n.active=o[this.ingKey]=n._active,e&&(n.first&&("bounds"in r&&(n._bounds=Tf(r.bounds,n)),this.setup&&this.setup()),n.movement=A,this.computeOffset()));const[_,L]=n.offset,[[k,O],[I,q]]=n._bounds;n.overflow=[_<k?-1:_>O?1:0,L<I?-1:L>q?1:0],n._movementBound[0]=n.overflow[0]?n._movementBound[0]===!1?n._movement[0]:n._movementBound[0]:!1,n._movementBound[1]=n.overflow[1]?n._movementBound[1]===!1?n._movement[1]:n._movementBound[1]:!1;const te=n._active?r.rubberband||[0,0]:[0,0];if(n.offset=jE(n._bounds,n.offset,te),n.delta=li.sub(n.offset,P),this.computeMovement(),M&&(!n.last||c>JE)){n.delta=li.sub(n.offset,P);const H=n.delta.map(Math.abs);li.addTo(n.distance,H),n.direction=n.delta.map(Math.sign),n._direction=n._delta.map(Math.sign),!n.first&&c>0&&(n.velocity=[H[0]/c,H[1]/c])}}emit(){const e=this.state,n=this.shared,r=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!r.triggerAllEvents)return;const o=this.handler(hn(hn(hn({},n),e),{},{[this.aliasKey]:e.values}));o!==void 0&&(e.memo=o)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function tw([t,e],n){const r=Math.abs(t),o=Math.abs(e);if(r>o&&r>n)return"x";if(o>r&&o>n)return"y"}class nw extends ew{constructor(...e){super(...e),Li(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=li.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=li.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const n=this.state,r=this.config;if(!n.axis&&e){const o=typeof r.axisThreshold=="object"?r.axisThreshold[Zg(e)]:r.axisThreshold;n.axis=tw(n._movement,o)}n._blocked=(r.lockDirection||!!r.axis)&&!n.axis||!!r.axis&&r.axis!==n.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0;break}}}const iw=t=>t,ny=.15,iy={enabled(t=!0){return t},eventOptions(t,e,n){return hn(hn({},n.shared.eventOptions),t)},preventDefault(t=!1){return t},triggerAllEvents(t=!1){return t},rubberband(t=0){switch(t){case!0:return[ny,ny];case!1:return[0,0];default:return li.toVector(t)}},from(t){if(typeof t=="function")return t;if(t!=null)return li.toVector(t)},transform(t,e,n){const r=t||n.shared.transform;return this.hasCustomTransform=!!r,r||iw},threshold(t){return li.toVector(t,0)}},rw=0,Du=hn(hn({},iy),{},{axis(t,e,{axis:n}){if(this.lockDirection=n==="lock",!this.lockDirection)return n},axisThreshold(t=rw){return t},bounds(t={}){if(typeof t=="function")return c=>Du.bounds(t(c));if("current"in t)return()=>t.current;if(typeof HTMLElement=="function"&&t instanceof HTMLElement)return t;const{left:e=-1/0,right:n=1/0,top:r=-1/0,bottom:o=1/0}=t;return[[e,n],[r,o]]}}),ry={ArrowRight:(t,e=1)=>[t*e,0],ArrowLeft:(t,e=1)=>[-1*t*e,0],ArrowUp:(t,e=1)=>[0,-1*t*e],ArrowDown:(t,e=1)=>[0,t*e]};class sw extends nw{constructor(...e){super(...e),Li(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const n=e._bounds.getBoundingClientRect(),r=e.currentTarget.getBoundingClientRect(),o={left:n.left-r.left+e.offset[0],right:n.right-r.right+e.offset[0],top:n.top-r.top+e.offset[1],bottom:n.bottom-r.bottom+e.offset[1]};e._bounds=Du.bounds(o)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const n=this.config,r=this.state;if(e.buttons!=null&&(Array.isArray(n.pointerButtons)?!n.pointerButtons.includes(e.buttons):n.pointerButtons!==-1&&n.pointerButtons!==e.buttons))return;const o=this.ctrl.setEventIds(e);n.pointerCapture&&e.target.setPointerCapture(e.pointerId),!(o&&o.size>1&&r._pointerActive)&&(this.start(e),this.setupPointer(e),r._pointerId=up(e),r._pointerActive=!0,this.computeValues(ey(e)),this.computeInitial(),n.preventScrollAxis&&Zg(e)!=="mouse"?(r._active=!1,this.setupScrollPrevention(e)):n.delay>0?(this.setupDelayTrigger(e),n.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){const n=this.state;n._active=!0,n._preventScroll=!0,n._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const n=this.state,r=this.config;if(!n._pointerActive||n.type===e.type&&e.timeStamp===n.timeStamp)return;const o=up(e);if(n._pointerId!==void 0&&o!==n._pointerId)return;const c=ey(e);if(document.pointerLockElement===e.target?n._delta=[e.movementX,e.movementY]:(n._delta=li.sub(c,n._values),this.computeValues(c)),li.addTo(n._movement,n._delta),this.compute(e),n._delayed&&n.intentional){this.timeoutStore.remove("dragDelay"),n.active=!1,this.startPointerDrag(e);return}if(r.preventScrollAxis&&!n._preventScroll)if(n.axis)if(n.axis===r.preventScrollAxis||r.preventScrollAxis==="xy"){n._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(e);return}else return;this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch{}const n=this.state,r=this.config;if(!n._active||!n._pointerActive)return;const o=up(e);if(n._pointerId!==void 0&&o!==n._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[c,h]=n._distance;if(n.tap=c<=r.tapsThreshold&&h<=r.tapsThreshold,n.tap&&r.filterTaps)n._force=!0;else{const[v,g]=n.direction,[x,m]=n.velocity,[w,A]=n.movement,[P,M]=r.swipe.velocity,[_,L]=r.swipe.distance,k=r.swipe.duration;n.elapsedTime<k&&(Math.abs(x)>P&&Math.abs(w)>_&&(n.swipe[0]=v),Math.abs(m)>M&&Math.abs(A)>L&&(n.swipe[1]=g))}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){const n=this.config,r=n.device;n.pointerLock&&e.currentTarget.requestPointerLock(),n.pointerCapture||(this.eventStore.add(this.sharedConfig.window,r,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,aw(e);const n=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",n),this.eventStore.add(this.sharedConfig.window,"touch","cancel",n),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(e)},this.config.delay)}keyDown(e){const n=ry[e.key];if(n){const r=this.state,o=e.shiftKey?10:e.altKey?.1:1;this.start(e),r._delta=n(this.config.keyboardDisplacement,o),r._keyboardActive=!0,li.addTo(r._movement,r._delta),this.compute(e),this.emit()}}keyUp(e){e.key in ry&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const n=this.config.device;e(n,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(n,"change",this.pointerMove.bind(this)),e(n,"end",this.pointerUp.bind(this)),e(n,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function aw(t){"persist"in t&&typeof t.persist=="function"&&t.persist()}const Lu=typeof window<"u"&&window.document&&window.document.createElement;function ow(){return Lu&&"ontouchstart"in window}function sy(){return ow()||Lu&&window.navigator.maxTouchPoints>1}function lw(){return Lu&&"onpointerdown"in window}function uw(){return Lu&&"exitPointerLock"in window.document}function cw(){try{return"constructor"in GestureEvent}catch{return!1}}const lr={isBrowser:Lu,gesture:cw(),touch:sy(),touchscreen:sy(),pointer:lw(),pointerLock:uw()},fw=250,dw=180,hw=.5,pw=50,vw=250,mw=10,ay={mouse:0,touch:0,pen:8},gw=hn(hn({},Du),{},{device(t,e,{pointer:{touch:n=!1,lock:r=!1,mouse:o=!1}={}}){return this.pointerLock=r&&lr.pointerLock,lr.touch&&n?"touch":this.pointerLock?"mouse":lr.pointer&&!o?"pointer":lr.touch?"touch":"mouse"},preventScrollAxis(t,e,{preventScroll:n}){if(this.preventScrollDelay=typeof n=="number"?n:n||n===void 0&&t?fw:void 0,!(!lr.touchscreen||n===!1))return t||(n!==void 0?"y":void 0)},pointerCapture(t,e,{pointer:{capture:n=!0,buttons:r=1,keys:o=!0}={}}){return this.pointerButtons=r,this.keys=o,!this.pointerLock&&this.device==="pointer"&&n},threshold(t,e,{filterTaps:n=!1,tapsThreshold:r=3,axis:o=void 0}){const c=li.toVector(t,n?r:o?1:0);return this.filterTaps=n,this.tapsThreshold=r,c},swipe({velocity:t=hw,distance:e=pw,duration:n=vw}={}){return{velocity:this.transform(li.toVector(t)),distance:this.transform(li.toVector(e)),duration:n}},delay(t=0){switch(t){case!0:return dw;case!1:return 0;default:return t}},axisThreshold(t){return t?hn(hn({},ay),t):ay},keyboardDisplacement(t=mw){return t}});hn(hn({},iy),{},{device(t,e,{shared:n,pointer:{touch:r=!1}={}}){if(n.target&&!lr.touch&&lr.gesture)return"gesture";if(lr.touch&&r)return"touch";if(lr.touchscreen){if(lr.pointer)return"pointer";if(lr.touch)return"touch"}},bounds(t,e,{scaleBounds:n={},angleBounds:r={}}){const o=h=>{const v=ty(Tf(n,h),{min:-1/0,max:1/0});return[v.min,v.max]},c=h=>{const v=ty(Tf(r,h),{min:-1/0,max:1/0});return[v.min,v.max]};return typeof n!="function"&&typeof r!="function"?[o(),c()]:h=>[o(h),c(h)]},threshold(t,e,n){return this.lockDirection=n.axis==="lock",li.toVector(t,this.lockDirection?[.1,3]:0)},modifierKey(t){return t===void 0?"ctrlKey":t},pinchOnWheel(t=!0){return t}}),hn(hn({},Du),{},{mouseOnly:(t=!0)=>t}),hn(hn({},Du),{},{mouseOnly:(t=!0)=>t});const oy=new Map,cp=new Map;function yw(t){oy.set(t.key,t.engine),cp.set(t.key,t.resolver)}const Sw={key:"drag",engine:sw,resolver:gw};function bw(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,c;for(c=0;c<r.length;c++)o=r[c],!(e.indexOf(o)>=0)&&(n[o]=t[o]);return n}function xw(t,e){if(t==null)return{};var n=bw(t,e),r,o;if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(t);for(o=0;o<c.length;o++)r=c[o],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}const Ew={target(t){if(t)return()=>"current"in t?t.current:t},enabled(t=!0){return t},window(t=lr.isBrowser?window:void 0){return t},eventOptions({passive:t=!0,capture:e=!1}={}){return{passive:t,capture:e}},transform(t){return t}},ww=["target","eventOptions","window","enabled","transform"];function Cf(t={},e){const n={};for(const[r,o]of Object.entries(e))switch(typeof o){case"function":n[r]=o.call(n,t[r],r,t);break;case"object":n[r]=Cf(t[r],o);break;case"boolean":o&&(n[r]=t[r]);break}return n}function Tw(t,e,n={}){const r=t,{target:o,eventOptions:c,window:h,enabled:v,transform:g}=r,x=xw(r,ww);if(n.shared=Cf({target:o,eventOptions:c,window:h,enabled:v,transform:g},Ew),e){const m=cp.get(e);n[e]=Cf(hn({shared:n.shared},x),m)}else for(const m in x){const w=cp.get(m);w&&(n[m]=Cf(hn({shared:n.shared},x[m]),w))}return n}class ly{constructor(e,n){Li(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=n}add(e,n,r,o,c){const h=this._listeners,v=qE(n,r),g=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},x=hn(hn({},g),c);e.addEventListener(v,o,x);const m=()=>{e.removeEventListener(v,o,x),h.delete(m)};return h.add(m),m}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}}class Cw{constructor(){Li(this,"_timeouts",new Map)}add(e,n,r=140,...o){this.remove(e),this._timeouts.set(e,window.setTimeout(n,r,...o))}remove(e){const n=this._timeouts.get(e);n&&window.clearTimeout(n)}clean(){this._timeouts.forEach(e=>void window.clearTimeout(e)),this._timeouts.clear()}}class Rw{constructor(e){Li(this,"gestures",new Set),Li(this,"_targetEventStore",new ly(this)),Li(this,"gestureEventStores",{}),Li(this,"gestureTimeoutStores",{}),Li(this,"handlers",{}),Li(this,"config",{}),Li(this,"pointerIds",new Set),Li(this,"touchIds",new Set),Li(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),Aw(this,e)}setEventIds(e){if(wf(e))return this.touchIds=new Set(GE(e)),this.touchIds;if("pointerId"in e)return e.type==="pointerup"||e.type==="pointercancel"?this.pointerIds.delete(e.pointerId):e.type==="pointerdown"&&this.pointerIds.add(e.pointerId),this.pointerIds}applyHandlers(e,n){this.handlers=e,this.nativeHandlers=n}applyConfig(e,n){this.config=Tw(e,n,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const n=this.config.shared,r={};let o;if(!(n.target&&(o=n.target(),!o))){if(n.enabled){for(const h of this.gestures){const v=this.config[h],g=uy(r,v.eventOptions,!!o);if(v.enabled){const x=oy.get(h);new x(this,e,h).bind(g)}}const c=uy(r,n.eventOptions,!!o);for(const h in this.nativeHandlers)c(h,"",v=>this.nativeHandlers[h](hn(hn({},this.state.shared),{},{event:v,args:e})),void 0,!0)}for(const c in r)r[c]=ZE(...r[c]);if(!o)return r;for(const c in r){const{device:h,capture:v,passive:g}=$E(c);this._targetEventStore.add(o,h,"",r[c],{capture:v,passive:g})}}}}function ol(t,e){t.gestures.add(e),t.gestureEventStores[e]=new ly(t,e),t.gestureTimeoutStores[e]=new Cw}function Aw(t,e){e.drag&&ol(t,"drag"),e.wheel&&ol(t,"wheel"),e.scroll&&ol(t,"scroll"),e.move&&ol(t,"move"),e.pinch&&ol(t,"pinch"),e.hover&&ol(t,"hover")}const uy=(t,e,n)=>(r,o,c,h={},v=!1)=>{var g,x;const m=(g=h.capture)!==null&&g!==void 0?g:e.capture,w=(x=h.passive)!==null&&x!==void 0?x:e.passive;let A=v?r:VE(r,o,m);n&&w&&(A+="Passive"),t[A]=t[A]||[],t[A].push(c)};function Mw(t,e={},n,r){const o=C.useMemo(()=>new Rw(t),[]);if(o.applyHandlers(t,r),o.applyConfig(e,n),C.useEffect(o.effect.bind(o)),C.useEffect(()=>o.clean.bind(o),[]),e.target===void 0)return o.bind.bind(o)}function Ow(t,e){return yw(Sw),Mw({drag:t},e||{},"drag")}const Dw=ae.useId||(()=>{});let Lw=0;function Pw(t){const[e,n]=ae.useState(Dw());return Sf(()=>{t||n(r=>r??String(Lw++))},[t]),t||(e?`radix-${e}`:"")}const ll=["a","button","div","h2","h3","img","li","nav","p","span","svg","ul"].reduce((t,e)=>({...t,[e]:ae.forwardRef((n,r)=>{const{asChild:o,...c}=n,h=o?Lg:e;return ae.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),n.as&&console.error(kw),ae.createElement(h,oi({},c,{ref:r}))})}),{}),kw="Warning: The `as` prop has been removed in favour of `asChild`. For details, see https://radix-ui.com/docs/primitives/overview/styling#changing-the-rendered-element",zw=ae.forwardRef((t,e)=>ae.createElement(ll.span,oi({},t,{ref:e,style:{...t.style,position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}}))),Nw=ae.forwardRef((t,e)=>{var n,r;const{containerRef:o,style:c,...h}=t,v=(n=o==null?void 0:o.current)!==null&&n!==void 0?n:globalThis==null||(r=globalThis.document)===null||r===void 0?void 0:r.body,[,g]=ae.useState({});return Sf(()=>{g({})},[]),v?vg.createPortal(ae.createElement(ll.div,oi({"data-radix-portal":""},h,{ref:e,style:v===document.body?{position:"absolute",top:0,left:0,zIndex:2147483647,...c}:void 0})),v):null}),_w=ae.forwardRef((t,e)=>{const{children:n,width:r=10,height:o=5,...c}=t;return ae.createElement(ll.svg,oi({},c,{ref:e,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),t.asChild?n:ae.createElement("polygon",{points:"0,0 30,0 15,10"}))});function cy(t){const[e,n]=ae.useState(void 0);return ae.useEffect(()=>{if(t){const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const c=o[0];let h,v;if("borderBoxSize"in c){const g=c.borderBoxSize,x=Array.isArray(g)?g[0]:g;h=x.inlineSize,v=x.blockSize}else{const g=t.getBoundingClientRect();h=g.width,v=g.height}n({width:h,height:v})});return r.observe(t,{box:"border-box"}),()=>{n(void 0),r.unobserve(t)}}},[t]),e}function Uw(t,e){const n=_a.get(t);return n===void 0?(_a.set(t,{rect:{},callbacks:[e]}),_a.size===1&&(fp=requestAnimationFrame(fy))):(n.callbacks.push(e),e(t.getBoundingClientRect())),()=>{const r=_a.get(t);if(r===void 0)return;const o=r.callbacks.indexOf(e);o>-1&&r.callbacks.splice(o,1),r.callbacks.length===0&&(_a.delete(t),_a.size===0&&cancelAnimationFrame(fp))}}let fp;const _a=new Map;function fy(){const t=[];_a.forEach((e,n)=>{const r=n.getBoundingClientRect();var o,c;o=e.rect,c=r,(o.width!==c.width||o.height!==c.height||o.top!==c.top||o.right!==c.right||o.bottom!==c.bottom||o.left!==c.left)&&(e.rect=r,t.push(e))}),t.forEach(e=>{e.callbacks.forEach(n=>n(e.rect))}),fp=requestAnimationFrame(fy)}function dy(t){const[e,n]=ae.useState();return ae.useEffect(()=>{if(t){const r=Uw(t,n);return()=>{n(void 0),r()}}},[t]),e}function hy(t,e=[]){let n=[];const r=()=>{const o=n.map(c=>ae.createContext(c));return function(c){const h=(c==null?void 0:c[t])||o;return ae.useMemo(()=>({[`__scope${t}`]:{...c,[t]:h}}),[c,h])}};return r.scopeName=t,[function(o,c){const h=ae.createContext(c),v=n.length;function g(x){const{scope:m,children:w,...A}=x,P=(m==null?void 0:m[t][v])||h,M=ae.useMemo(()=>A,Object.values(A));return ae.createElement(P.Provider,{value:M},w)}return n=[...n,c],g.displayName=o+"Provider",[g,function(x,m){const w=(m==null?void 0:m[t][v])||h,A=ae.useContext(w);if(A)return A;if(c!==void 0)return c;throw new Error(`\`${x}\` must be used within \`${o}\``)}]},jw(r,...e)]}function jw(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(o){const c=r.reduce((h,{useScope:v,scopeName:g})=>({...h,...v(o)[`__scope${g}`]}),{});return ae.useMemo(()=>({[`__scope${e.scopeName}`]:c}),[c])}};return n.scopeName=e.scopeName,n}function Iw({anchorRect:t,popperSize:e,arrowSize:n,arrowOffset:r=0,side:o,sideOffset:c=0,align:h,alignOffset:v=0,shouldAvoidCollisions:g=!0,collisionBoundariesRect:x,collisionTolerance:m=0}){if(!t||!e||!x)return{popperStyles:Fw,arrowStyles:dp};const w=function(J,re,$=0,se=0,ge){const Ce=ge?ge.height:0,me=py(re,J,"x"),Ie=py(re,J,"y"),_e=Ie.before-$-Ce,Ye=Ie.after+$+Ce,gt=me.before-$-Ce,Z=me.after+$+Ce;return{top:{start:{x:me.start+se,y:_e},center:{x:me.center,y:_e},end:{x:me.end-se,y:_e}},right:{start:{x:Z,y:Ie.start+se},center:{x:Z,y:Ie.center},end:{x:Z,y:Ie.end-se}},bottom:{start:{x:me.start+se,y:Ye},center:{x:me.center,y:Ye},end:{x:me.end-se,y:Ye}},left:{start:{x:gt,y:Ie.start+se},center:{x:gt,y:Ie.center},end:{x:gt,y:Ie.end-se}}}}(e,t,c,v,n),A=w[o][h];if(g===!1){const J=vy(A);let re=dp;return n&&(re=gy({popperSize:e,arrowSize:n,arrowOffset:r,side:o,align:h})),{popperStyles:{...J,"--radix-popper-transform-origin":my(e,o,h,r,n)},arrowStyles:re,placedSide:o,placedAlign:h}}const P=DOMRect.fromRect({...e,...A}),M=(_=x,L=m,DOMRect.fromRect({width:_.width-2*L,height:_.height-2*L,x:_.left+L,y:_.top+L}));var _,L;const k=Sy(P,M),O=w[yy(o)][h],I=function(J,re,$){const se=yy(J);return re[J]&&!$[se]?se:J}(o,k,Sy(DOMRect.fromRect({...e,...O}),M)),q=function(J,re,$,se,ge){const Ce=$==="top"||$==="bottom",me=Ce?"left":"top",Ie=Ce?"right":"bottom",_e=Ce?"width":"height",Ye=re[_e]>J[_e];return(se==="start"||se==="center")&&(ge[me]&&Ye||ge[Ie]&&!Ye)?"end":(se==="end"||se==="center")&&(ge[Ie]&&Ye||ge[me]&&!Ye)?"start":se}(e,t,o,h,k),te=vy(w[I][q]);let H=dp;return n&&(H=gy({popperSize:e,arrowSize:n,arrowOffset:r,side:I,align:q})),{popperStyles:{...te,"--radix-popper-transform-origin":my(e,I,q,r,n)},arrowStyles:H,placedSide:I,placedAlign:q}}function py(t,e,n){const r=t[n==="x"?"left":"top"],o=n==="x"?"width":"height",c=t[o],h=e[o];return{before:r-h,start:r,center:r+(c-h)/2,end:r+c-h,after:r+c}}function vy(t){return{position:"absolute",top:0,left:0,minWidth:"max-content",willChange:"transform",transform:`translate3d(${Math.round(t.x+window.scrollX)}px, ${Math.round(t.y+window.scrollY)}px, 0)`}}function my(t,e,n,r,o){const c=e==="top"||e==="bottom",h=o?o.width:0,v=o?o.height:0,g=h/2+r;let x="",m="";return c?(x={start:`${g}px`,center:"center",end:t.width-g+"px"}[n],m=e==="top"?`${t.height+v}px`:-v+"px"):(x=e==="left"?`${t.width+v}px`:-v+"px",m={start:`${g}px`,center:"center",end:t.height-g+"px"}[n]),`${x} ${m}`}const Fw={position:"fixed",top:0,left:0,opacity:0,transform:"translate3d(0, -200%, 0)"},dp={position:"absolute",opacity:0};function gy({popperSize:t,arrowSize:e,arrowOffset:n,side:r,align:o}){const c=(t.width-e.width)/2,h=(t.height-e.width)/2,v={top:0,right:90,bottom:180,left:-90}[r],g=Math.max(e.width,e.height),x={width:`${g}px`,height:`${g}px`,transform:`rotate(${v}deg)`,willChange:"transform",position:"absolute",[r]:"100%",direction:Bw(r,o)};return r!=="top"&&r!=="bottom"||(o==="start"&&(x.left=`${n}px`),o==="center"&&(x.left=`${c}px`),o==="end"&&(x.right=`${n}px`)),r!=="left"&&r!=="right"||(o==="start"&&(x.top=`${n}px`),o==="center"&&(x.top=`${h}px`),o==="end"&&(x.bottom=`${n}px`)),x}function Bw(t,e){return(t!=="top"&&t!=="right"||e!=="end")&&(t!=="bottom"&&t!=="left"||e==="end")?"ltr":"rtl"}function yy(t){return{top:"bottom",right:"left",bottom:"top",left:"right"}[t]}function Sy(t,e){return{top:t.top<e.top,right:t.right>e.right,bottom:t.bottom>e.bottom,left:t.left<e.left}}const[by,xy]=hy("Popper"),[Hw,Ey]=by("Popper"),Vw=t=>{const{__scopePopper:e,children:n}=t,[r,o]=ae.useState(null);return ae.createElement(Hw,{scope:e,anchor:r,onAnchorChange:o},n)},Ww=ae.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...o}=t,c=Ey("PopperAnchor",n),h=ae.useRef(null),v=yf(e,h);return ae.useEffect(()=>{c.onAnchorChange((r==null?void 0:r.current)||h.current)}),r?null:ae.createElement(ll.div,oi({},o,{ref:v}))}),[$w,qw]=by("PopperContent"),Yw=ae.forwardRef((t,e)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o,align:c="center",alignOffset:h,collisionTolerance:v,avoidCollisions:g=!0,...x}=t,m=Ey("PopperContent",n),[w,A]=ae.useState(),P=dy(m.anchor),[M,_]=ae.useState(null),L=cy(M),[k,O]=ae.useState(null),I=cy(k),q=yf(e,Ce=>_(Ce)),te=function(){const[Ce,me]=ae.useState(void 0);return ae.useEffect(()=>{let Ie;function _e(){me({width:window.innerWidth,height:window.innerHeight})}function Ye(){window.clearTimeout(Ie),Ie=window.setTimeout(_e,100)}return _e(),window.addEventListener("resize",Ye),()=>window.removeEventListener("resize",Ye)},[]),Ce}(),H=te?DOMRect.fromRect({...te,x:0,y:0}):void 0,{popperStyles:J,arrowStyles:re,placedSide:$,placedAlign:se}=Iw({anchorRect:P,popperSize:L,arrowSize:I,arrowOffset:w,side:r,sideOffset:o,align:c,alignOffset:h,shouldAvoidCollisions:g,collisionBoundariesRect:H,collisionTolerance:v}),ge=$!==void 0;return ae.createElement("div",{style:J,"data-radix-popper-content-wrapper":""},ae.createElement($w,{scope:n,arrowStyles:re,onArrowChange:O,onArrowOffsetChange:A},ae.createElement(ll.div,oi({"data-side":$,"data-align":se},x,{style:{...x.style,animation:ge?void 0:"none"},ref:q}))))}),Qw=ae.forwardRef(function(t,e){const{__scopePopper:n,offset:r,...o}=t,c=qw("PopperArrow",n),{onArrowOffsetChange:h}=c;return ae.useEffect(()=>h(r),[h,r]),ae.createElement("span",{style:{...c.arrowStyles,pointerEvents:"none"}},ae.createElement("span",{ref:c.onArrowChange,style:{display:"inline-block",verticalAlign:"top",pointerEvents:"auto"}},ae.createElement(_w,oi({},o,{ref:e,style:{...o.style,display:"block"}}))))}),Gw=Vw,Xw=Ww,Kw=Yw,Zw=Qw,wy=t=>{const{present:e,children:n}=t,r=function(h){const[v,g]=ae.useState(),x=ae.useRef({}),m=ae.useRef(h),w=ae.useRef("none"),A=h?"mounted":"unmounted",[P,M]=function(_,L){return ae.useReducer((k,O)=>{const I=L[k][O];return I??k},_)}(A,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return ae.useEffect(()=>{const _=Rf(x.current);w.current=P==="mounted"?_:"none"},[P]),Sf(()=>{const _=x.current,L=m.current;if(L!==h){const k=w.current,O=Rf(_);h?M("MOUNT"):O==="none"||(_==null?void 0:_.display)==="none"?M("UNMOUNT"):M(L&&k!==O?"ANIMATION_OUT":"UNMOUNT"),m.current=h}},[h,M]),Sf(()=>{if(v){const _=k=>{const O=Rf(x.current).includes(k.animationName);k.target===v&&O&&M("ANIMATION_END")},L=k=>{k.target===v&&(w.current=Rf(x.current))};return v.addEventListener("animationstart",L),v.addEventListener("animationcancel",_),v.addEventListener("animationend",_),()=>{v.removeEventListener("animationstart",L),v.removeEventListener("animationcancel",_),v.removeEventListener("animationend",_)}}},[v,M]),{isPresent:["mounted","unmountSuspended"].includes(P),ref:ae.useCallback(_=>{_&&(x.current=getComputedStyle(_)),g(_)},[])}}(e),o=typeof n=="function"?n({present:r.isPresent}):ae.Children.only(n),c=yf(r.ref,o.ref);return typeof n=="function"||r.isPresent?ae.cloneElement(o,{ref:c}):null};function Rf(t){return(t==null?void 0:t.animationName)||"none"}wy.displayName="Presence";function Ty(t){const e=ae.useRef(t);return ae.useEffect(()=>{e.current=t},[t]),e.current}function hp(t){const e=ae.useRef(t);return ae.useEffect(()=>{e.current=t}),ae.useMemo(()=>(...n)=>{var r;return(r=e.current)===null||r===void 0?void 0:r.call(e,...n)},[])}function Jw(t){const e=hp(t);ae.useEffect(()=>{const n=r=>{r.key==="Escape"&&e(r)};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e])}function eT({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,o]=function({defaultProp:g,onChange:x}){const m=ae.useState(g),[w]=m,A=ae.useRef(w),P=hp(x);return ae.useEffect(()=>{A.current!==w&&(P(w),A.current=w)},[w,A,P]),m}({defaultProp:e,onChange:n}),c=t!==void 0,h=c?t:r,v=hp(n);return[h,ae.useCallback(g=>{if(c){const x=g,m=typeof g=="function"?x(t):g;m!==t&&v(m)}else o(g)},[c,t,o,v])]}function ul(t,e,{checkForDefaultPrevented:n=!0}={}){return function(r){if(t==null||t(r),n===!1||!r.defaultPrevented)return e==null?void 0:e(r)}}const[Cy,mP]=hy("Tooltip",[xy]),Af=xy(),tT=700,[gP,nT]=Cy("TooltipProvider",{isOpenDelayed:!0,delayDuration:tT,onOpen:()=>{},onClose:()=>{}}),[iT,Mf]=Cy("Tooltip"),rT=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:o=!1,onOpenChange:c,delayDuration:h}=t,v=nT("Tooltip",e),g=Af(e),[x,m]=ae.useState(null),w=Pw(),A=ae.useRef(0),P=h??v.delayDuration,M=ae.useRef(!1),{onOpen:_,onClose:L}=v,[k=!1,O]=eT({prop:r,defaultProp:o,onChange:H=>{H&&(document.dispatchEvent(new CustomEvent("tooltip.open")),_()),c==null||c(H)}}),I=ae.useMemo(()=>k?M.current?"delayed-open":"instant-open":"closed",[k]),q=ae.useCallback(()=>{window.clearTimeout(A.current),M.current=!1,O(!0)},[O]),te=ae.useCallback(()=>{window.clearTimeout(A.current),A.current=window.setTimeout(()=>{M.current=!0,O(!0)},P)},[P,O]);return ae.useEffect(()=>()=>window.clearTimeout(A.current),[]),ae.createElement(Gw,g,ae.createElement(iT,{scope:e,contentId:w,open:k,stateAttribute:I,trigger:x,onTriggerChange:m,onTriggerEnter:ae.useCallback(()=>{v.isOpenDelayed?te():q()},[v.isOpenDelayed,te,q]),onOpen:ae.useCallback(q,[q]),onClose:ae.useCallback(()=>{window.clearTimeout(A.current),O(!1),L()},[O,L])},n))},sT=ae.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,o=Mf("TooltipTrigger",n),c=Af(n),h=yf(e,o.onTriggerChange),v=ae.useRef(!1),g=ae.useCallback(()=>v.current=!1,[]);return ae.useEffect(()=>()=>document.removeEventListener("mouseup",g),[g]),ae.createElement(Xw,oi({asChild:!0},c),ae.createElement(ll.button,oi({"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute},r,{ref:h,onMouseEnter:ul(t.onMouseEnter,o.onTriggerEnter),onMouseLeave:ul(t.onMouseLeave,o.onClose),onMouseDown:ul(t.onMouseDown,()=>{o.onClose(),v.current=!0,document.addEventListener("mouseup",g,{once:!0})}),onFocus:ul(t.onFocus,()=>{v.current||o.onOpen()}),onBlur:ul(t.onBlur,o.onClose),onClick:ul(t.onClick,o.onClose)})))}),aT=ae.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=Mf("TooltipContent",t.__scopeTooltip);return ae.createElement(wy,{present:n||o.open},ae.createElement(oT,oi({ref:e},r)))}),oT=ae.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":o,portalled:c=!0,...h}=t,v=Mf("TooltipContent",n),g=Af(n),x=c?Nw:ae.Fragment,{onClose:m}=v;return Jw(()=>m()),ae.useEffect(()=>(document.addEventListener("tooltip.open",m),()=>document.removeEventListener("tooltip.open",m)),[m]),ae.createElement(x,null,ae.createElement(uT,{__scopeTooltip:n}),ae.createElement(Kw,oi({"data-state":v.stateAttribute},g,h,{ref:e,style:{...h.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)"}}),ae.createElement(Pg,null,r),ae.createElement(zw,{id:v.contentId,role:"tooltip"},o||r)))}),lT=ae.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,o=Af(n);return ae.createElement(Zw,oi({},o,r,{ref:e}))});function uT(t){const{__scopeTooltip:e}=t,n=Mf("CheckTriggerMoved",e),r=dy(n.trigger),o=r==null?void 0:r.left,c=Ty(o),h=r==null?void 0:r.top,v=Ty(h),g=n.onClose;return ae.useEffect(()=>{(c!==void 0&&c!==o||v!==void 0&&v!==h)&&g()},[g,c,v,o,h]),null}const cT=rT,fT=sT,dT=aT,hT=lT;function pT(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,c;for(c=0;c<r.length;c++)o=r[c],!(e.indexOf(o)>=0)&&(n[o]=t[o]);return n}function gs(t,e){if(t==null)return{};var n=pT(t,e),r,o;if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(t);for(o=0;o<c.length;o++)r=c[o],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}let yi;(function(t){t[t.UNSUPPORTED_INPUT=0]="UNSUPPORTED_INPUT",t[t.NO_COMPONENT_FOR_TYPE=1]="NO_COMPONENT_FOR_TYPE",t[t.UNKNOWN_INPUT=2]="UNKNOWN_INPUT",t[t.DUPLICATE_KEYS=3]="DUPLICATE_KEYS",t[t.ALREADY_REGISTERED_TYPE=4]="ALREADY_REGISTERED_TYPE",t[t.CLIPBOARD_ERROR=5]="CLIPBOARD_ERROR",t[t.THEME_ERROR=6]="THEME_ERROR",t[t.PATH_DOESNT_EXIST=7]="PATH_DOESNT_EXIST",t[t.INPUT_TYPE_OVERRIDE=8]="INPUT_TYPE_OVERRIDE",t[t.EMPTY_KEY=9]="EMPTY_KEY"})(yi||(yi={}));const vT={[yi.UNSUPPORTED_INPUT]:(t,e)=>[`An input with type \`${t}\` input was found at path \`${e}\` but it's not supported yet.`],[yi.NO_COMPONENT_FOR_TYPE]:(t,e)=>[`Type \`${t}\` found at path \`${e}\` can't be displayed in panel because no component supports it yet.`],[yi.UNKNOWN_INPUT]:(t,e)=>[`input at path \`${t}\` is not recognized.`,e],[yi.DUPLICATE_KEYS]:(t,e,n)=>[`Key \`${t}\` of path \`${e}\` already exists at path \`${n}\`. Even nested keys need to be unique. Rename one of the keys.`],[yi.ALREADY_REGISTERED_TYPE]:t=>[`Type ${t} has already been registered. You can't register a component with the same type.`],[yi.CLIPBOARD_ERROR]:t=>["Error copying the value",t],[yi.THEME_ERROR]:(t,e)=>[`Error accessing the theme \`${t}.${e}\` value.`],[yi.PATH_DOESNT_EXIST]:t=>[`Error getting the value at path \`${t}\`. There is probably an error in your \`render\` function.`],[yi.PATH_DOESNT_EXIST]:t=>[`Error accessing the value at path \`${t}\``],[yi.INPUT_TYPE_OVERRIDE]:(t,e,n)=>[`Input at path \`${t}\` already exists with type: \`${e}\`. Its type cannot be overridden with type \`${n}\`.`],[yi.EMPTY_KEY]:()=>["Keys can not be empty, if you want to hide a label use whitespace."]};function Ry(t,e,...n){const[r,...o]=vT[e](...n);console[t]("LEVA: "+r,...o)}const Ay=Ry.bind(null,"warn");Ry.bind(null,"log");function yP(t){return t}function mT(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function My(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function Ua(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?My(Object(n),!0).forEach(function(r){mT(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):My(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}const Gs=(t,e,n)=>t>n?n:t<e?e:t,gT=t=>{if(t===""||typeof t=="number")return t;try{const e=Xs(t);if(!isNaN(e))return e}catch{}return parseFloat(t)},yT=Math.log(10);function Oy(t){let e=Math.abs(+String(t).replace(".",""));if(e===0)return .01;for(;e!==0&&e%10===0;)e/=10;const n=Math.floor(Math.log(e)/yT)+1,r=Math.floor(Math.log10(Math.abs(t))),o=Math.pow(10,r-n);return Math.max(o,.001)}const ST=(t,e,n)=>n===e?0:(Gs(t,e,n)-e)/(n-e),Dy=(t,e,n)=>t*(n-e)+e,Ly=/\(([0-9+\-*/^ .]+)\)/,Py=/(\d+(?:\.\d+)?) ?\^ ?(\d+(?:\.\d+)?)/,ky=/(\d+(?:\.\d+)?) ?\* ?(\d+(?:\.\d+)?)/,zy=/(\d+(?:\.\d+)?) ?\/ ?(\d+(?:\.\d+)?)/,Ny=/(\d+(?:\.\d+)?) ?\+ ?(\d+(?:\.\d+)?)/,_y=/(\d+(?:\.\d+)?) ?- ?(\d+(?:\.\d+)?)/;function Xs(t){if(isNaN(Number(t)))if(Ly.test(t)){const e=t.replace(Ly,(n,r)=>String(Xs(r)));return Xs(e)}else if(Py.test(t)){const e=t.replace(Py,(n,r,o)=>String(Math.pow(Number(r),Number(o))));return Xs(e)}else if(ky.test(t)){const e=t.replace(ky,(n,r,o)=>String(Number(r)*Number(o)));return Xs(e)}else if(zy.test(t)){const e=t.replace(zy,(n,r,o)=>{if(o!=0)return String(Number(r)/Number(o));throw new Error("Division by zero")});return Xs(e)}else if(Ny.test(t)){const e=t.replace(Ny,(n,r,o)=>String(Number(r)+Number(o)));return Xs(e)}else if(_y.test(t)){const e=t.replace(_y,(n,r,o)=>String(Number(r)-Number(o)));return Xs(e)}else return Number(t);return Number(t)}let Uy;(function(t){t.BUTTON="BUTTON",t.BUTTON_GROUP="BUTTON_GROUP",t.MONITOR="MONITOR",t.FOLDER="FOLDER"})(Uy||(Uy={}));let jy;(function(t){t.SELECT="SELECT",t.IMAGE="IMAGE",t.NUMBER="NUMBER",t.COLOR="COLOR",t.STRING="STRING",t.BOOLEAN="BOOLEAN",t.INTERVAL="INTERVAL",t.VECTOR3D="VECTOR3D",t.VECTOR2D="VECTOR2D"})(jy||(jy={}));const bT=t=>t.shiftKey?5:t.altKey?1/5:1,xT=["value"],ET=["min","max"],wT=t=>{if(typeof t=="number")return!0;if(typeof t=="string"){const e=parseFloat(t);return isNaN(e)?!1:t.substring((""+e).length).trim().length<4}return!1},TT=(t,{min:e=-1/0,max:n=1/0,suffix:r})=>{const o=parseFloat(t);if(t===""||isNaN(o))throw Error("Invalid number");const c=Gs(o,e,n);return r?c+r:c},CT=(t,{pad:e=0,suffix:n})=>{const r=parseFloat(t).toFixed(e);return n?r+n:r},RT=t=>{let{value:e}=t,n=gs(t,xT);const{min:r=-1/0,max:o=1/0}=n,c=gs(n,ET);let h=parseFloat(e);const v=typeof e=="string"?e.substring((""+h).length):void 0;h=Gs(h,r,o);let g=n.step;g||(Number.isFinite(r)?Number.isFinite(o)?g=+(Math.abs(o-r)/100).toPrecision(1):g=+(Math.abs(h-r)/100).toPrecision(1):Number.isFinite(o)&&(g=+(Math.abs(o-h)/100).toPrecision(1)));const x=g?Oy(g)*10:Oy(h);g=g||x/10;const m=Math.round(Gs(Math.log10(1/x),0,2));return{value:v?h+v:h,settings:Ua({initialValue:h,step:g,pad:m,min:r,max:o,suffix:v},c)}},Iy=(t,{step:e,initialValue:n})=>{const r=Math.round((t-n)/e);return n+r*e};var AT=Object.freeze({__proto__:null,schema:wT,sanitize:TT,format:CT,normalize:RT,sanitizeStep:Iy});function Qi(){return Qi=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Qi.apply(this,arguments)}const MT=C.createContext({});function ys(){return C.useContext(MT)}const OT=C.createContext(null);C.createContext(null);const DT=C.createContext(null);function LT(){return C.useContext(DT)}const PT=()=>({colors:{elevation1:"#292d39",elevation2:"#181c20",elevation3:"#373c4b",accent1:"#0066dc",accent2:"#007bff",accent3:"#3c93ff",highlight1:"#535760",highlight2:"#8c92a4",highlight3:"#fefefe",vivid1:"#ffcc00",folderWidgetColor:"$highlight2",folderTextColor:"$highlight3",toolTipBackground:"$highlight3",toolTipText:"$elevation2"},radii:{xs:"2px",sm:"3px",lg:"10px"},space:{xs:"3px",sm:"6px",md:"10px",rowGap:"7px",colGap:"7px"},fonts:{mono:"ui-monospace, SFMono-Regular, Menlo, 'Roboto Mono', monospace",sans:"system-ui, sans-serif"},fontSizes:{root:"11px",toolTip:"$root"},sizes:{rootWidth:"280px",controlWidth:"160px",numberInputMinWidth:"38px",scrubberWidth:"8px",scrubberHeight:"16px",rowHeight:"24px",folderTitleHeight:"20px",checkboxSize:"16px",joystickWidth:"100px",joystickHeight:"100px",colorPickerWidth:"$controlWidth",colorPickerHeight:"100px",imagePreviewWidth:"$controlWidth",imagePreviewHeight:"100px",monitorHeight:"60px",titleBarHeight:"39px"},shadows:{level1:"0 0 9px 0 #00000088",level2:"0 4px 14px #00000033"},borderWidths:{root:"0px",input:"1px",focus:"1px",hover:"1px",active:"1px",folder:"1px"},fontWeights:{label:"normal",folder:"normal",button:"normal"}});function Of(t,e){const[n,r]=t.split(" "),o={};return n!=="none"&&(o.boxShadow=`${e.inset?"inset ":""}0 0 0 $borderWidths${[e.key]} $colors${n!=="default"&&n||e.borderColor}`),r&&(o.backgroundColor=r),o}const Pu={$inputStyle:()=>t=>Of(t,{key:"$input",borderColor:"$highlight1",inset:!0}),$focusStyle:()=>t=>Of(t,{key:"$focus",borderColor:"$accent2"}),$hoverStyle:()=>t=>Of(t,{key:"$hover",borderColor:"$accent1",inset:!0}),$activeStyle:()=>t=>Of(t,{key:"$active",borderColor:"$accent1",inset:!0})},{styled:_t,css:SP,createTheme:bP,globalCss:kT,keyframes:xP}=_E({prefix:"leva",theme:PT(),utils:Ua(Ua({},Pu),{},{$flex:()=>({display:"flex",alignItems:"center"}),$flexCenter:()=>({display:"flex",alignItems:"center",justifyContent:"center"}),$reset:()=>({outline:"none",fontSize:"inherit",fontWeight:"inherit",color:"inherit",fontFamily:"inherit",border:"none",backgroundColor:"transparent",appearance:"none"}),$draggable:()=>({touchAction:"none",WebkitUserDrag:"none",userSelect:"none"}),$focus:t=>({"&:focus":Pu.$focusStyle()(t)}),$focusWithin:t=>({"&:focus-within":Pu.$focusStyle()(t)}),$hover:t=>({"&:hover":Pu.$hoverStyle()(t)}),$active:t=>({"&:active":Pu.$activeStyle()(t)})})});kT({".leva__panel__dragged":{WebkitUserDrag:"none",userSelect:"none",input:{userSelect:"none"},"*":{cursor:"ew-resize !important"}}});function zT(t,e){const{theme:n}=C.useContext(OT);if(!(t in n)||!(e in n[t]))return Ay(yi.THEME_ERROR,t,e),"";let r=e;for(;;){let o=n[t][r];if(typeof o=="string"&&o.charAt(0)==="$")r=o.substr(1);else return o}}const Fy=_t("input",{$reset:"",padding:"0 $sm",width:0,minWidth:0,flex:1,height:"100%",variants:{levaType:{number:{textAlign:"right"}},as:{textarea:{padding:"$sm"}}}}),By=_t("div",{$draggable:"",height:"100%",$flexCenter:"",position:"relative",padding:"0 $xs",fontSize:"0.8em",opacity:.8,cursor:"default",touchAction:"none",[`& + ${Fy}`]:{paddingLeft:0}}),NT=_t(By,{cursor:"ew-resize",marginRight:"-$xs",textTransform:"uppercase",opacity:.3,"&:hover":{opacity:1},variants:{dragging:{true:{backgroundColor:"$accent2",opacity:1}}}}),_T=_t("div",{$flex:"",position:"relative",borderRadius:"$sm",overflow:"hidden",color:"inherit",height:"$rowHeight",backgroundColor:"$elevation3",$inputStyle:"$elevation1",$hover:"",$focusWithin:"",variants:{textArea:{true:{height:"auto"}}}}),UT=["innerLabel","value","onUpdate","onChange","onKeyDown","type","id","inputType","rows"],jT=["onUpdate"];function Hy(t){let{innerLabel:e,value:n,onUpdate:r,onChange:o,onKeyDown:c,type:h,id:v,inputType:g="text",rows:x=0}=t,m=gs(t,UT);const{id:w,emitOnEditStart:A,emitOnEditEnd:P,disabled:M}=ys(),_=v||w,L=C.useRef(null),k=x>0,O=k?"textarea":"input",I=C.useCallback(H=>J=>{const re=J.currentTarget.value;H(re)},[]);C.useEffect(()=>{const H=L.current,J=I(re=>{r(re),P()});return H==null||H.addEventListener("blur",J),()=>H==null?void 0:H.removeEventListener("blur",J)},[I,r,P]);const q=C.useCallback(H=>{H.key==="Enter"&&I(r)(H)},[I,r]),te=Object.assign({as:O},k?{rows:x}:{},m);return C.createElement(_T,{textArea:k},e&&typeof e=="string"?C.createElement(By,null,e):e,C.createElement(Fy,Qi({levaType:h,ref:L,id:_,type:g,autoComplete:"off",spellCheck:"false",value:n,onChange:I(o),onFocus:()=>A(),onKeyPress:q,onKeyDown:c,disabled:M},te)))}function IT(t){let{onUpdate:e}=t,n=gs(t,jT);const r=C.useCallback(c=>e(gT(c)),[e]),o=C.useCallback(c=>{const h=c.key==="ArrowUp"?1:c.key==="ArrowDown"?-1:0;if(h){c.preventDefault();const v=c.altKey?.1:c.shiftKey?10:1;e(g=>parseFloat(g)+h*v)}},[e]);return C.createElement(Hy,Qi({},n,{onUpdate:r,onKeyDown:o,type:"number"}))}const pp=_t("div",{}),Vy=_t("div",{position:"relative",background:"$elevation2",transition:"height 300ms ease",variants:{fill:{true:{},false:{}},flat:{false:{},true:{}},isRoot:{true:{},false:{paddingLeft:"$md","&::after":{content:'""',position:"absolute",left:0,top:0,width:"$borderWidths$folder",height:"100%",backgroundColor:"$folderWidgetColor",opacity:.4,transform:"translateX(-50%)"}}}},compoundVariants:[{isRoot:!0,fill:!1,css:{overflowY:"auto",maxHeight:"calc(100vh - 20px - $$titleBarHeight)"}},{isRoot:!0,flat:!1,css:{borderRadius:"$lg"}}]});_t("div",{$flex:"",color:"$folderTextColor",userSelect:"none",cursor:"pointer",height:"$folderTitleHeight",fontWeight:"$folder","> svg":{marginLeft:-4,marginRight:4,cursor:"pointer",fill:"$folderWidgetColor",opacity:.6},"&:hover > svg":{fill:"$folderWidgetColor"},[`&:hover + ${Vy}::after`]:{opacity:.6},[`${pp}:hover > & + ${Vy}::after`]:{opacity:.6},[`${pp}:hover > & > svg`]:{opacity:1}});const FT=_t("div",{position:"relative",display:"grid",gridTemplateColumns:"100%",rowGap:"$rowGap",transition:"opacity 250ms ease",variants:{toggled:{true:{opacity:1,transitionDelay:"250ms"},false:{opacity:0,transitionDelay:"0ms",pointerEvents:"none"}},isRoot:{true:{"& > div":{paddingLeft:"$md",paddingRight:"$md"},"& > div:first-of-type":{paddingTop:"$sm"},"& > div:last-of-type":{paddingBottom:"$sm"},[`> ${pp}:not(:first-of-type)`]:{paddingTop:"$sm",marginTop:"$md",borderTop:"$borderWidths$folder solid $colors$elevation1"}}}}}),Wy=_t("div",{position:"relative",zIndex:100,display:"grid",rowGap:"$rowGap",gridTemplateRows:"minmax($sizes$rowHeight, max-content)",alignItems:"center",color:"$highlight2",[`${FT} > &`]:{"&:first-of-type":{marginTop:"$rowGap"},"&:last-of-type":{marginBottom:"$rowGap"}},variants:{disabled:{true:{pointerEvents:"none"},false:{"&:hover,&:focus-within":{color:"$highlight3"}}}}}),BT=_t(Wy,{gridTemplateColumns:"auto $sizes$controlWidth",columnGap:"$colGap"}),HT=_t("div",{$flex:"",height:"100%",position:"relative",overflow:"hidden","& > div":{marginLeft:"$colGap",padding:"0 $xs",opacity:.4},"& > div:hover":{opacity:.8},"& > div > svg":{display:"none",cursor:"pointer",width:13,minWidth:13,height:13,backgroundColor:"$elevation2"},"&:hover > div > svg":{display:"block"},variants:{align:{top:{height:"100%",alignItems:"flex-start",paddingTop:"$sm"}}}}),VT=_t("input",{$reset:"",height:0,width:0,opacity:0,margin:0,"& + label":{position:"relative",$flexCenter:"",height:"100%",userSelect:"none",cursor:"pointer",paddingLeft:2,paddingRight:"$sm",pointerEvents:"auto"},"& + label:after":{content:'""',width:6,height:6,backgroundColor:"$elevation3",borderRadius:"50%",$activeStyle:""},"&:focus + label:after":{$focusStyle:""},"& + label:active:after":{backgroundColor:"$accent1",$focusStyle:""},"&:checked + label:after":{backgroundColor:"$accent1"}}),vp=_t("label",{fontWeight:"$label",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","& > svg":{display:"block"}});_t("div",{opacity:1,variants:{disabled:{true:{opacity:.6,pointerEvents:"none",[`& ${vp}`]:{pointerEvents:"auto"}}}}}),_t("div",{position:"fixed",top:0,bottom:0,right:0,left:0,zIndex:1e3,userSelect:"none"});const WT=_t("div",{background:"$toolTipBackground",fontFamily:"$sans",fontSize:"$toolTip",padding:"$xs $sm",color:"$toolTipText",borderRadius:"$xs",boxShadow:"$level2",maxWidth:260}),$T=_t(hT,{fill:"$toolTipBackground"}),qT=["align"];function YT(){const{id:t,disable:e,disabled:n}=ys();return C.createElement(C.Fragment,null,C.createElement(VT,{id:t+"__disable",type:"checkbox",checked:!n,onChange:()=>e(!n)}),C.createElement("label",{htmlFor:t+"__disable"}))}function QT(t){const{id:e,optional:n,hint:r}=ys(),o=t.htmlFor||(e?{htmlFor:e}:null),c=!r&&typeof t.children=="string"?{title:t.children}:null;return C.createElement(C.Fragment,null,n&&C.createElement(YT,null),r!==void 0?C.createElement(cT,null,C.createElement(fT,{asChild:!0},C.createElement(vp,Qi({},o,t))),C.createElement(dT,{side:"top",sideOffset:2},C.createElement(WT,null,r,C.createElement($T,null)))):C.createElement(vp,Qi({},o,c,t)))}function Df(t){let{align:e}=t,n=gs(t,qT);const{value:r,label:o,key:c,disabled:h}=ys(),{hideCopyButton:v}=LT(),g=!v&&c!==void 0,[x,m]=C.useState(!1),w=async()=>{try{await navigator.clipboard.writeText(JSON.stringify({[c]:r??""})),m(!0)}catch{Ay(yi.CLIPBOARD_ERROR,{[c]:r})}};return C.createElement(HT,{align:e,onPointerLeave:()=>m(!1)},C.createElement(QT,n),g&&!h&&C.createElement("div",{title:`Click to copy ${typeof o=="string"?o:c} value`},x?C.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},C.createElement("path",{d:"M9 2a1 1 0 000 2h2a1 1 0 100-2H9z"}),C.createElement("path",{fillRule:"evenodd",d:"M4 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v11a2 2 0 01-2 2H6a2 2 0 01-2-2V5zm9.707 5.707a1 1 0 00-1.414-1.414L9 12.586l-1.293-1.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})):C.createElement("svg",{onClick:w,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},C.createElement("path",{d:"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"}),C.createElement("path",{d:"M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z"}))))}const GT=["toggled"],XT=_t("svg",{fill:"currentColor",transition:"transform 350ms ease, fill 250ms ease"});function KT(t){let{toggled:e}=t,n=gs(t,GT);return C.createElement(XT,Qi({width:"9",height:"5",viewBox:"0 0 9 5",xmlns:"http://www.w3.org/2000/svg",style:{transform:`rotate(${e?0:-90}deg)`}},n),C.createElement("path",{d:"M3.8 4.4c.4.3 1 .3 1.4 0L8 1.7A1 1 0 007.4 0H1.6a1 1 0 00-.7 1.7l3 2.7z"}))}const ZT=["input"];function Lf(t){let{input:e}=t,n=gs(t,ZT);return e?C.createElement(BT,n):C.createElement(Wy,n)}function $y(t,e){const{emitOnEditStart:n,emitOnEditEnd:r}=ys();return Ow(o=>{o.first&&(document.body.classList.add("leva__panel__dragged"),n==null||n());const c=t(o);return o.last&&(document.body.classList.remove("leva__panel__dragged"),r==null||r()),c},e)}const JT=_t("div",{variants:{hasRange:{true:{position:"relative",display:"grid",gridTemplateColumns:"auto $sizes$numberInputMinWidth",columnGap:"$colGap",alignItems:"center"}}}}),eC=_t("div",{position:"relative",width:"100%",height:2,borderRadius:"$xs",backgroundColor:"$elevation1"}),tC=_t("div",{position:"absolute",width:"$scrubberWidth",height:"$scrubberHeight",borderRadius:"$xs",boxShadow:"0 0 0 2px $colors$elevation2",backgroundColor:"$accent2",cursor:"pointer",$active:"none $accent1",$hover:"none $accent3",variants:{position:{left:{borderTopRightRadius:0,borderBottomRightRadius:0,transform:"translateX(calc(-0.5 * ($sizes$scrubberWidth + 4px)))"},right:{borderTopLeftRadius:0,borderBottomLeftRadius:0,transform:"translateX(calc(0.5 * ($sizes$scrubberWidth + 4px)))"}}}}),nC=_t("div",{position:"relative",$flex:"",height:"100%",cursor:"pointer",touchAction:"none"}),iC=_t("div",{position:"absolute",height:"100%",backgroundColor:"$accent2"});function rC({value:t,min:e,max:n,onDrag:r,step:o,initialValue:c}){const h=C.useRef(null),v=C.useRef(null),g=C.useRef(0),x=zT("sizes","scrubberWidth"),m=$y(({event:A,first:P,xy:[M],movement:[_],memo:L})=>{if(P){const{width:O,left:I}=h.current.getBoundingClientRect();g.current=O-parseFloat(x),L=(A==null?void 0:A.target)===v.current?t:Dy((M-I)/O,e,n)}const k=L+Dy(_/g.current,0,n-e);return r(Iy(k,{step:o,initialValue:c})),L}),w=ST(t,e,n);return C.createElement(nC,Qi({ref:h},m()),C.createElement(eC,null,C.createElement(iC,{style:{left:0,right:`${(1-w)*100}%`}})),C.createElement(tC,{ref:v,style:{left:`calc(${w} * (100% - ${x}))`}}))}const sC=C.memo(({label:t,onUpdate:e,step:n,innerLabelTrim:r})=>{const[o,c]=C.useState(!1),h=$y(({active:v,delta:[g],event:x,memo:m=0})=>(c(v),m+=g/2,Math.abs(m)>=1&&(e(w=>parseFloat(w)+Math.floor(m)*n*bT(x)),m=0),m));return C.createElement(NT,Qi({dragging:o,title:t.length>1?t:""},h()),t.slice(0,r))});function aC({label:t,id:e,displayValue:n,onUpdate:r,onChange:o,settings:c,innerLabelTrim:h=1}){const v=h>0&&C.createElement(sC,{label:t,step:c.step,onUpdate:r,innerLabelTrim:h});return C.createElement(IT,{id:e,value:String(n),onUpdate:r,onChange:o,innerLabel:v})}function oC(){const t=ys(),{label:e,value:n,onUpdate:r,settings:o,id:c}=t,{min:h,max:v}=o,g=v!==1/0&&h!==-1/0;return C.createElement(Lf,{input:!0},C.createElement(Df,null,e),C.createElement(JT,{hasRange:g},g&&C.createElement(rC,Qi({value:parseFloat(n),onDrag:r},o)),C.createElement(aC,Qi({},t,{id:c,label:"value",innerLabelTrim:g?0:1}))))}const lC=gs(AT,["sanitizeStep"]);Ua({component:oC},lC);var uC=Object.freeze({__proto__:null,schema:(t,e)=>Qs().schema({options:Qs().passesAnyOf(Qs().object(),Qs().array())}).test(e),sanitize:(t,{values:e})=>{if(e.indexOf(t)<0)throw Error("Selected value doesn't match Select options");return t},format:(t,{values:e})=>e.indexOf(t),normalize:t=>{let{value:e,options:n}=t,r,o;return Array.isArray(n)?(o=n,r=n.map(c=>String(c))):(o=Object.values(n),r=Object.keys(n)),"value"in t?o.includes(e)||(r.unshift(String(e)),o.unshift(e)):e=o[0],Object.values(n).includes(e)||(n[String(e)]=e),{value:e,settings:{keys:r,values:o}}}});const cC=_t("div",{$flexCenter:"",position:"relative","> svg":{pointerEvents:"none",position:"absolute",right:"$md"}}),mp=_t("select",{position:"absolute",top:0,left:0,width:"100%",height:"100%",opacity:0}),fC=_t("div",{display:"flex",alignItems:"center",width:"100%",height:"$rowHeight",backgroundColor:"$elevation3",borderRadius:"$sm",padding:"0 $sm",cursor:"pointer",[`${mp}:focus + &`]:{$focusStyle:""},[`${mp}:hover + &`]:{$hoverStyle:""}});function dC({displayValue:t,value:e,onUpdate:n,id:r,settings:o,disabled:c}){const{keys:h,values:v}=o,g=C.useRef();return e===v[t]&&(g.current=h[t]),C.createElement(cC,null,C.createElement(mp,{id:r,value:t,onChange:x=>n(v[Number(x.currentTarget.value)]),disabled:c},h.map((x,m)=>C.createElement("option",{key:x,value:m},x))),C.createElement(fC,null,g.current),C.createElement(KT,{toggled:!0}))}function hC(){const{label:t,value:e,displayValue:n,onUpdate:r,id:o,disabled:c,settings:h}=ys();return C.createElement(Lf,{input:!0},C.createElement(Df,null,t),C.createElement(dC,{id:o,value:e,displayValue:n,onUpdate:r,settings:h,disabled:c}))}Ua({component:hC},uC);var pC=Object.freeze({__proto__:null,schema:t=>Qs().string().test(t),sanitize:t=>{if(typeof t!="string")throw Error("Invalid string");return t},normalize:({value:t,editable:e=!0,rows:n=!1})=>({value:t,settings:{editable:e,rows:typeof n=="number"?n:n?5:0}})});const vC=["displayValue","onUpdate","onChange","editable"],mC=_t("div",{whiteSpace:"pre-wrap"});function gC(t){let{displayValue:e,onUpdate:n,onChange:r,editable:o=!0}=t,c=gs(t,vC);return o?C.createElement(Hy,Qi({value:e,onUpdate:n,onChange:r},c)):C.createElement(mC,null,e)}function yC(){const{label:t,settings:e,displayValue:n,onUpdate:r,onChange:o}=ys();return C.createElement(Lf,{input:!0},C.createElement(Df,null,t),C.createElement(gC,Qi({displayValue:n,onUpdate:r,onChange:o},e)))}Ua({component:yC},pC);var SC=Object.freeze({__proto__:null,schema:t=>Qs().boolean().test(t),sanitize:t=>{if(typeof t!="boolean")throw Error("Invalid boolean");return t}});const bC=_t("div",{position:"relative",$flex:"",height:"$rowHeight",input:{$reset:"",height:0,width:0,opacity:0,margin:0},label:{position:"relative",$flexCenter:"",userSelect:"none",cursor:"pointer",height:"$checkboxSize",width:"$checkboxSize",backgroundColor:"$elevation3",borderRadius:"$sm",$hover:""},"input:focus + label":{$focusStyle:""},"input:focus:checked + label, input:checked + label:hover":{$hoverStyle:"$accent3"},"input + label:active":{backgroundColor:"$accent1"},"input:checked + label:active":{backgroundColor:"$accent1"},"label > svg":{display:"none",width:"90%",height:"90%",stroke:"$highlight3"},"input:checked + label":{backgroundColor:"$accent2"},"input:checked + label > svg":{display:"block"}});function xC({value:t,onUpdate:e,id:n,disabled:r}){return C.createElement(bC,null,C.createElement("input",{id:n,type:"checkbox",checked:t,onChange:o=>e(o.currentTarget.checked),disabled:r}),C.createElement("label",{htmlFor:n},C.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"}))))}function EC(){const{label:t,value:e,onUpdate:n,disabled:r,id:o}=ys();return C.createElement(Lf,{input:!0},C.createElement(Df,null,t),C.createElement(xC,{value:e,onUpdate:n,id:o,disabled:r}))}Ua({component:EC},SC),_t("div",{display:"grid",columnGap:"$colGap",gridAutoFlow:"column dense",alignItems:"center",variants:{withLock:{true:{gridTemplateColumns:"10px auto","> svg":{cursor:"pointer"}}}}});class ja extends Hr{constructor(e){super(),this.type="spacial-content",this.style={opacity:1},this.format="jpg",this.tileUrl=iE(e.url),this.id=e.id||`${this.tileUrl}--${e.scaleFactor}`,this.points=e.displayPoints?e.displayPoints:vs(e.points,Ys(e.scaleFactor)),this.tileWidth=e.tileWidth,this.display={x:0,y:0,width:e.width/e.scaleFactor,height:e.height/e.scaleFactor,points:e.points,scale:e.scaleFactor},e.format&&(this.format=e.format)}applyProps(e){if(e.style&&typeof e.style.opacity<"u"&&(this.style.opacity=e.style.opacity),e.service!==this.service&&(this.service=e.service),e.format?this.format=e.format:this.format="jpg",e.crop){this.cropData=e.crop;const n=We([...this.points]),r=n.length/5,o=e.crop.x||0,c=e.crop.y||0,h=e.crop.x+e.crop.width,v=e.crop.y+e.crop.height;for(let g=0;g<r;g++){const x=g*5;n[x+1]<h&&n[x+3]>o&&n[x+2]<v&&n[x+4]>c?(n[x+1]=Gs(n[x+1],o,h),n[x+3]=Gs(n[x+3],o,h),n[x+2]=Gs(n[x+2],c,v),n[x+4]=Gs(n[x+4],c,v)):n[x]=0}Br(n,mi(-e.crop.x,-e.crop.y)),this.crop?this.crop.set(n):this.crop=n}}static fromTile(e,n,r,o,c,h){r.height=r.height?r.height:r.width;const v=Math.ceil(n.width/o),g=Math.ceil(n.height/o),x=Math.ceil(v/r.width),m=Math.ceil(g/r.height),w=wt.grid(x,m),A=wt.grid(x,m);for(let M=0;M<m;M++)for(let _=0;_<x;_++){const L=_*r.width,k=M*r.height;A.addPoints(L*o,k*o,_===x-1?n.width:(L+r.width)*o,M===m-1?n.height:(k+r.height)*o),w.addPoints(L,k,_===x-1?v:L+r.width,M===m-1?g:k+r.height)}const P=new ja({url:e,scaleFactor:o,points:w.build(),displayPoints:A.build(),width:n.width,height:n.height,tileWidth:r.width,format:h});return P.applyProps({service:c}),P}getImageUrl(e){const n=this.points.slice(e*5,e*5+5),r=n[3]-n[1],o=n[4]-n[2],c=Math.ceil(r/this.display.scale);return`${this.tileUrl}/${n[1]},${n[2]},${r},${o}/${c>this.tileWidth?this.tileWidth:c},/0/default.${this.format||"jpg"}`}getAllPointsAt(e,n,r){const o=Cu(this.crop||this.points,e);return[[this,o,n]]}transform(e){Br(this.points,e)}getScheduledUpdates(e,n){return[]}}class wC extends Hr{constructor(){super(...arguments),this.type="spacial-content"}getAllPointsAt(e,n,r){return[[this,this.points,n]]}}class TC extends wC{constructor(e){super(),this.images=[],this.allImages=[],this.scaleFactors=[],this.aggregateBuffer=We(9),this.isFullyLoaded=!1,this.maxScaleFactor=0,this._scheduleSortByScales=!1,this._sortByScales=()=>{this._scheduleSortByScales=!1,this.allImages.sort((r,o)=>o.display.width-r.display.width),this.images=[];let n=.1;for(const r of this.allImages){if(r.display.width<this.renderOptions.minSize&&r.display.height<this.renderOptions.minSize&&!r.priority||r instanceof xr&&(r.display.width>this.renderOptions.maxImageSize||r.display.height>this.renderOptions.maxImageSize)&&!r.priority)continue;if(Math.abs(r.display.scale-n)<.25||r.priority){const c=this.images.pop();c&&(c instanceof xr||c.priority)?(r.priority&&this.images.push(r),this.images.push(c)):r&&this.images.push(r)}else r&&this.images.push(r);n=r.display.scale}this.images.length===0&&(this.images=[...this.allImages]),this.scaleFactors=this.images.map(r=>r.display.scale),this.maxScaleFactor=Math.max(...this.scaleFactors)},this.loadFullResource=async()=>{if(!this.isFullyLoaded&&this.lazyLoader){this.isFullyLoaded=!0;const n=await this.lazyLoader();this.addImages(n)}},this.fallback=[this.loadFullResource],this.id=e.id,this.points=wt.singleBox(e.width,e.height),this.lazyLoader=e.loadFullImages,e.loadFullImages||(this.isFullyLoaded=!0),this.display={x:0,y:0,points:wt.singleBox(e.width,e.height),height:e.height,width:e.width,scale:1},this.renderOptions={renderSmallestFallback:!0,renderLayers:3,minSize:255,maxImageSize:1024,quality:1.2,...e.renderOptions||{}},this.addImages(e.images)}applyProps(e){typeof e.renderSmallestFallback<"u"&&e.renderSmallestFallback!==this.renderOptions.renderSmallestFallback&&(this.renderOptions.renderSmallestFallback=e.renderSmallestFallback),typeof e.renderLayers<"u"&&e.renderLayers!==this.renderOptions.renderLayers&&(this.renderOptions.renderLayers=e.renderLayers),typeof e.minSize<"u"&&e.minSize!==this.renderOptions.minSize&&(this.renderOptions.minSize=e.minSize),typeof e.maxImageSize<"u"&&e.maxImageSize!==this.renderOptions.maxImageSize&&(this.renderOptions.maxImageSize=e.maxImageSize),typeof e.quality<"u"&&e.quality!==this.renderOptions.quality&&(this.renderOptions.quality=e.quality)}appendChild(e){this.addImages([e])}removeChild(e){this.images.indexOf(e)!==-1&&(this.images=this.images.filter(n=>n!==e),this.sortByScales())}insertBefore(e,n){this.addImages([e])}hideInstance(){}addImages(e){for(const n of e)n.__parent=this,n.__owner=this.__owner;this.allImages.push(...e.filter(Boolean)),this.sortByScales()}sortByScales(){this._scheduleSortByScales=!0}getScheduledUpdates(e,n){return this._scheduleSortByScales?[this._sortByScales]:this.isFullyLoaded?[]:n>1/this.maxScaleFactor?this.fallback:[]}getAllPointsAt(e,n,r){if(this.images.length===0)return[];const o=nE(1/(r||1)/(window.devicePixelRatio||1),this.images,this.renderOptions.quality),c=this.images.length,h=n?ps(n,mi(this.x,this.y)):mi(this.x,this.y);if(o!==this.images.length-1&&this.images[o+1]){let v=[];for(let m=c-1;m>=o;m--)v.push(m);const g=v[0];this.renderOptions.renderLayers&&(v=v.slice(-this.renderOptions.renderLayers)),this.renderOptions.renderSmallestFallback&&v.indexOf(g)===-1&&v.unshift(g);const x=[];for(let m=0;m<v.length;m++)x.push(...this.images[v[m]].getAllPointsAt(e,h,r));return x}return this.images[o].getAllPointsAt(e,h,r)}}function Pf(t,e,n,r,o){const c=Math.PI/180*o,h=Math.cos(c),v=Math.sin(c),g=h*(n-t)+v*(r-e)+t,x=h*(r-e)-v*(n-t)+e;return[g,x]}class ku extends Hr{constructor(e,n){super(),this.type="world-object",this.intersectionBuffer=We(5),this.aggregateBuffer=We(9),this.invertedBuffer=We(9),this.rotation=0,this._updatedList=[];const{x:r=0,y:o=0}=n||{};e?(this.id=e.id||"",this.scale=1,this.layers=e.layers,this.points=We([1,r,o,r+e.width,o+e.height]),this.worldPoints=We([1,r,o,r+e.width,o+e.height]),this.filteredPointsBuffer=We(e.layers.length*5)):(this.id="",this.scale=1,this.layers=[],this.points=We(5),this.worldPoints=We(5),this.filteredPointsBuffer=We(5))}static createWithProps(e){const n=new ku;return n.applyProps(e),n}applyProps(e){const n=e.x||0,r=e.y||0;this.id=e.id;const o=typeof e.scale<"u"?e.scale:this.scale;this.points[0]=1,this.points[1]=n,this.points[2]=r,this.points[3]=n+e.width,this.points[4]=r+e.height,this.rotation=e.rotation||0,this.worldPoints[3]=this.worldPoints[1]+e.width,this.worldPoints[4]=this.worldPoints[2]+e.height,e.scale&&e.scale!==1&&this.atScale(o),this.scale=o}appendChild(e){e.points[0]===0&&e.points.set(this.points),e.__owner.value=this,this.addLayers([e])}removeChild(e){this.layers=this.layers.filter(n=>n!==e),this.filteredPointsBuffer=We(this.layers.length*5)}insertBefore(e,n){const r=this.layers.indexOf(n);if(r===-1||this.layers.indexOf(e)!==-1)return;const o=this.layers.slice(0,r),c=this.layers.slice(r);this.layers=[...o,e,...c]}hideInstance(){console.warn("hideInstance: not yet implemented")}getObjectsAt(e,n){if(this.rotation&&(e=this.applyRotation(e)),Cu(this.points,e,this.filteredPointsBuffer)[0]===0)return[];const o=this.layers.length,c=[];for(let h=0;h<o;h++){const v=this.layers[h];if(n&&v.isShape){const x=vs(v.points,mi(this.x,this.y));if(!v.intersects([e[1]-x[1],e[2]-x[2]]))continue}if(Cu(vs(v.points,mi(this.x,this.y)),e,this.filteredPointsBuffer)[0]!==0&&c.push(v),n){const x=v;c.push(...x.getObjectsAt(e,n))}}return c}applyRotation(e){if(this.rotation){const n={x:e[1],y:e[2]},r={x:e[1],y:e[4]},o={x:e[3],y:e[2]},c={x:e[3],y:e[4]},h=this.points[1]+(this.points[3]-this.points[1])/2,v=this.points[2]+(this.points[4]-this.points[2])/2,[g,x]=Pf(h,v,n.x,n.y,this.rotation),[m,w]=Pf(h,v,r.x,r.y,this.rotation),[A,P]=Pf(h,v,o.x,o.y,this.rotation),[M,_]=Pf(h,v,c.x,c.y,this.rotation),L=Math.min(g,m,A,M),k=Math.max(g,m,A,M),O=Math.min(x,w,P,_),I=Math.max(x,w,P,_);return We([e[0],L,O,k,I])}return e}getAllPointsAt(e,n,r){const o=ps(mi(this.x,this.y),Ys(this.scale),this.aggregateBuffer);this.rotation&&(e=this.applyRotation(e));const c=eE(e,this.points,this.intersectionBuffer),h=this.layers.length,v=[],g=vs(c,ps(Ys(1/this.scale),mi(-this.x,-this.y),this.invertedBuffer)),x=n?ps(n,o,this.aggregateBuffer):o,m=r*this.scale;for(let w=0;w<h;w++)v.push(...this.layers[w].getAllPointsAt(g,x,m));return v}addLayers(e){const n=[];for(const r of e)this.layers.indexOf(r)===-1&&(n.push(r),r.points.length===5&&(r.points[1]<this.worldPoints[1]/this.scale||r.points[2]<this.worldPoints[2]/this.scale||r.points[3]>this.worldPoints[3]/this.scale||r.points[4]>this.worldPoints[4]/this.scale)&&(r.crop=r.crop||We([1,Math.max(this.worldPoints[1]/this.scale,r.points[1]),Math.max(this.worldPoints[2]/this.scale,r.points[2]),Math.min(this.worldPoints[3]/this.scale,r.points[3]),Math.min(this.worldPoints[4]/this.scale,r.points[4])])));this.layers=this.layers.concat(n),this.filteredPointsBuffer=We(this.layers.length*5)}getScheduledUpdates(e,n){const r=this.layers.length;this._updatedList=[];const o=n*this.scale;for(let c=0;c<r;c++){const h=this.layers[c].getScheduledUpdates(e,o);h&&this._updatedList.push(...h)}return this._updatedList}}class cl extends Hr{constructor(e=0,n=0,r=100,o="left-to-right"){super(),this.id="world",this.aggregateBuffer=We(9),this.isDirty=!1,this.zones=[],this.triggerQueue=[],this.activatedEvents=[],this._updatedList=[],this.translationBuffer=We(9),this.needsRecalculate=!0,this.emptyPaintables=[],this.renderOrder=[],this.objects=[],this.subscriptions=[],this._propagateEventTargets=[],this._alreadyFlushed=[],this._width=e,this._height=n,this.aspectRatio=Number.isNaN(e/n)?1:e/n,this.viewingDirection=o,this.points=We(r*5),this.filteredPointsBuffer=We(r*5)}get x(){return 0}get y(){return 0}get width(){return this._width}get height(){return this._height}static withProps(e){const n=new cl;return n.applyProps(e),n}applyProps(e){typeof e.width<"u"&&typeof e.height<"u"&&(e.width!==this._width||e.height!==this._height)&&this.resize(e.width,e.height),e.viewingDirection!==this.viewingDirection&&(this.viewingDirection=e.viewingDirection,this.triggerRepaint())}propagateTouchEvent(e,n,r){const o=[];for(const c of r)if(c.x&&c.y){const h=wt.singleBox(1,1,c.x,c.y);o.push(this.getObjectsAt(h,!0).reverse())}return o.map(c=>this.propagateEvent(e,n,c,{bubbles:!0,cancelable:!0}))}propagatePointerEvent(e,n,r,o,c={}){const h=wt.singleBox(1,1,r,o),v=this.getObjectsAt(h,!0).reverse();return this.propagateEvent(e,n,v,c)}propagateEvent(e,n,r,{bubbles:o=!1,cancelable:c=!1}={}){n.atlasTarget=this,this._propagateEventTargets.length=1,this._propagateEventTargets[0]=this;let h=!1;n.stopPropagation=()=>{h=!0};const v=r.length;for(let m=v-1;m>=0;m--){this._propagateEventTargets.unshift(r[m][0]);const w=r[m][1].length;if(w)for(let A=0;A<w;A++)this._propagateEventTargets.unshift(r[m][1][A])}const g=this._propagateEventTargets.length;let x=!1;for(let m=0;m<g&&(n.atlasTarget=this._propagateEventTargets[m],n.atlasWorld=this,x=this._propagateEventTargets[m].dispatchEvent(e,n)||x,!h);m++);return x&&this.triggerRepaint(),this._propagateEventTargets}appendChild(e){const n=this.appendWorldObject(e);this.renderOrder.push(n/5)}removeChild(e){const n=this.objects.indexOf(e);if(n===-1){for(const r of this.objects)if(r&&r.id===e.id){this.removeChild(r);return}return}this.objects[n]=null,this.renderOrder=this.renderOrder.filter(r=>r!==n),this.points[n*5]=0,this.triggerRepaint(),this.needsRecalculate=!0}insertBefore(e,n){const r=this.objects.indexOf(n);if(r===-1)return;const o=this.appendWorldObject(e);this.renderOrder.splice(r-1,0,o/5)}hideInstance(){}asWorldObject(){return null}addZone(e){this.zones.push(e)}selectZone(e){if(typeof e=="string"){const n=this.zones.length;for(let r=0;r<n;r++)if(this.zones[r].id===e){this.selectedZone=r,this.trigger("zone-changed");return}}else this.zones[e]&&(this.selectedZone=e,this.trigger("zone-changed"))}deselectZone(){this.selectedZone=void 0}getActiveZone(){if(this.selectedZone)return this.zones[this.selectedZone]}hasActiveZone(){return typeof this.selectedZone<"u"}checkResizeInternalBuffer(){if(tE(this.points)===this.objects.length){const e=this.points,n=We(this.points.length*2);n.set(e,0),this.points=n}}appendWorldObject(e){this.checkResizeInternalBuffer();const n=this.objects.length*5,r=e.points;return e.points=this.points.subarray(this.objects.length*5,this.objects.length*5+5),e.points[1]=r[1],e.points[2]=r[2],e.points[3]=r[3],e.points[4]=r[4],this.objects.push(e),this.filteredPointsBuffer=We(this.objects.length*5),this.needsRecalculate=!0,this.triggerRepaint(),n}recalculateWorldSize(){let e=!1;if(this.needsRecalculate){const n=new Int32Array(this.objects.length),r=new Int32Array(this.objects.length),o=this.renderOrder.length;for(let v=0;v<o;v++){const g=this.renderOrder[v];this.objects[g]&&(n[v]=this.points[g*5+3],r[v]=this.points[g*5+4])}const c=Math.max(...n);c!==this._width&&(this._width=c,e=!0);const h=Math.max(...r);h!==this._height&&(this._height=h,e=!0),e&&this.trigger("recalculate-world-size",{width:c,height:h}),this.needsRecalculate=!1}return e}addObjectAt(e,n){n.width&&!n.height?n.height=n.width/e.width*e.height:n.height&&!n.width&&(n.width=n.height/e.height*e.width),(!n||!n.width||!n.height)&&(n.width=e.width,n.height=e.height);const{width:r,x:o,y:c}=n,h=r/e.width;this.checkResizeInternalBuffer(),this.points.set(wt.singleBox(e.width,e.height,0,0),this.objects.length*5);const v=new ku(e);return v.points=this.points.subarray(this.objects.length*5,this.objects.length*5+5),this.objects.push(v),this.scaleWorldObject(this.objects.length-1,h),this.translateWorldObject(this.objects.length-1,o,c),this.filteredPointsBuffer=We(this.points.length*2),this.triggerRepaint(),this.needsRecalculate=!0,v}scaleWorldObject(e,n){Br(this.points.subarray(e*5,e*5+5),Ru(n,this.points[e*5+1],this.points[e*5+2]));const r=this.objects[e];r&&(r.atScale(n),this.triggerRepaint())}translateWorldObject(e,n,r){Br(this.points.subarray(e*5,e*5+5),mi(n,r));const o=this.objects[e];o&&(o.translate(n,r),this.triggerRepaint())}resize(e,n){return this._width=e,this._height=n,this.aspectRatio=e/n,this.triggerRepaint(),this}getObjects(){return this.objects}getPoints(){return this.points}getPointsFromViewer(e,n){const r=wt.singleBox(e.width,e.height,e.x,e.y);return this.getPointsAt(r,n,e.scale)}addLayoutSubscriber(e){return this.subscriptions.push(e),()=>{this.subscriptions.splice(this.subscriptions.indexOf(e),1)}}getScheduledUpdates(e,n){const r=Cu(this.points,e,this.filteredPointsBuffer),o=this.objects.length;this._updatedList=[];for(let c=0;c<o;c++)if(r[c*5]!==0){if(!this.objects[c])continue;this._updatedList.push(...this.objects[c].getScheduledUpdates(e,n))}return this._updatedList}getObjectsAt(e,n=!1){const r=this.getActiveZone(),o=Cu(this.points,e,this.filteredPointsBuffer),c=this.renderOrder.length,h=[];for(let v=0;v<c;v++){const g=this.renderOrder[v];if(o[g*5]!==0){const x=this.objects[g];if(!x||r&&r.objects.indexOf(x)===-1)continue;if(x.type!=="world-object"){h.push([x,[x]]);continue}n?h.push([x,x.getObjectsAt(e,n)]):h.push([x,this.emptyPaintables])}}return h}getPointsAt(e,n,r=1){const o=this.getObjectsAt(e),c=ps(Ys(r),mi(-e[1],-e[2]),this.translationBuffer),h=n?ps(n,c,this.aggregateBuffer):c,v=o.length,g=[];for(let x=0;x<v;x++)o[x]&&g.push(...o[x][0].getAllPointsAt(e,h,r));return g}flushSubscriptions(){if(this.triggerQueue.length){this._alreadyFlushed=[];const e=this.triggerQueue.length;for(let n=0;n<e;n++){if(this._alreadyFlushed.indexOf(this.triggerQueue[n][0])!==-1)continue;typeof this.triggerQueue[n][1]>"u"&&this._alreadyFlushed.push(this.triggerQueue[n][0]);const r=this.subscriptions.length;for(let o=0;o<r;o++)this.subscriptions[o].apply(null,this.triggerQueue[n])}this.triggerQueue=[]}}trigger(e,n){this.triggerQueue.push([e,n])}triggerEventActivation(){this.trigger("event-activation")}triggerRepaint(){this.trigger("repaint")}gotoRegion(e){this.trigger("goto-region",e)}goHome(e=!1){this.trigger("go-home",{immediate:e})}zoomTo(e,n,r){this.trigger("zoom-to",{point:n,factor:e,stream:r})}zoomIn(e){this.trigger("zoom-to",{point:e,factor:.5})}zoomOut(e){this.trigger("zoom-to",{point:e,factor:2})}constraintBounds(e){this.trigger("constrain-bounds",{immediate:e})}}const kf=/([0-9]+(px|em)\s+)+(solid)\s+(.*)/g,zf={},CC=["backgroundColor","opacity","boxShadow","borderColor","borderWidth","borderStyle","outlineColor","outlineWidth","outlineOffset","outlineStyle"];class zu extends Hr{constructor(){super(),this.type="spacial-content",this.hoverEvents=!1,this.activeEvents=!1,this.display={x:0,y:0,scale:1,width:-1,height:-1,points:We(5)},this._parsed={border:{id:null,match:[]},outline:{id:null,match:[]}},this.props={},this.addHover=()=>{this.hovering=!0,this.__revision++},this.removeHover=()=>{this.hovering=!1,this.pressing=!1,this.__revision++},this.addPress=()=>{this.pressing=!0,this.__revision++},this.removePress=()=>{this.pressing=!1,this.__revision++},this.id=mf(12),this.points=We(5)}getAllPointsAt(e,n){return[[this,this.points,n]]}applyProps(e={}){let n=!1;if(e.interactive!==this.props.interactive&&(n=!0,this.props.interactive=e.interactive),e.style){const r=e.border||e.style.border;if(r!==this._parsed.border.id)if(!r)this._parsed.border.id=null,this._parsed.border.match=[];else{const o=zf[r]||kf.exec(r)||kf.exec(r);o&&(this._parsed.border.id=r,this._parsed.border.match=zf[r]=o)}if(this._parsed.border.id&&(e.style.borderWidth=this._parsed.border.match[1],e.style.borderStyle="solid",e.style.borderColor=this._parsed.border.match[4]),e.style.outline!==this._parsed.outline.id)if(!e.style.outline)this._parsed.outline.id=null,this._parsed.outline.match=[];else{const o=zf[e.style.outline]||kf.exec(e.style.outline)||kf.exec(e.style.outline);o&&(this._parsed.outline.id=e.style.outline,this._parsed.outline.match=zf[e.style.outline]=o)}this._parsed.outline.id&&(e.style.outlineWidth=this._parsed.outline.match[1],e.style.outlineStyle="solid",e.style.outlineColor=this._parsed.outline.match[4]),this.props.style=e.style,e.backgroundColor&&!this.props.style.backgroundColor&&(this.props.style.backgroundColor=e.backgroundColor,n=!0),e.style.background&&!this.props.style.backgroundColor&&(this.props.style.backgroundColor=e.style.background,n=!0);for(const o of CC)if(this.props.style[o]!==e.style[o]){n=!0;break}e.style[":hover"]!==this.props.hoverStyles&&(this.props.hoverStyles=e.style[":hover"],this.hoverEvents||(this.hoverEvents=!0,this.addEventListener("pointerenter",this.addHover),this.addEventListener("pointerleave",this.removeHover)),n=!0),e.style[":active"]!==this.props.pressStyles&&(this.props.pressStyles=e.style[":active"],this.activeEvents||(this.activeEvents=!0,this.addEventListener("mousedown",this.addPress),this.addEventListener("mouseup",this.removePress)),n=!0)}e.href!==this.props.href&&(this.props.href=e.href,n=!0),e.hrefTarget!==this.props.hrefTarget&&(this.props.hrefTarget=e.hrefTarget,n=!0),e.title!==this.props.title&&(this.props.title=e.title,n=!0),e.className!==this.props.className&&(this.props.className=e.className,e.className&&!this.hoverEvents&&(this.hoverEvents=!0,this.addEventListener("pointerenter",this.addHover),this.addEventListener("pointerleave",this.removeHover)),e.className&&!this.activeEvents&&(this.activeEvents=!0,this.addEventListener("mousedown",this.addPress),this.addEventListener("mouseup",this.removePress)),n=!0),e.relativeSize!==this.props.relativeSize&&(this.props.relativeSize=e.relativeSize,n=!0),e.relativeStyle!==this.props.relativeStyle&&(this.props.relativeStyle=e.relativeStyle,n=!0),e.html!==this.props.html&&(this.props.html=e.html,n=!0),e.target&&(e.target.width!==this.display.width||e.target.height!==this.display.height||e.target.x!==this.points[1]||e.target.y!==this.points[2])&&(n=!0,this.points=wt.singleBox(e.target.width,e.target.height,e.target.x,e.target.y),this.display.points=wt.singleBox(e.target.width,e.target.height,e.target.x,e.target.y),this.display.width=e.target.width,this.display.height=e.target.height),n&&this.__revision++}}class Nf extends Hr{constructor(){super(),this.type="spacial-content",this.color="#000",this.text="",this.display={x:0,y:0,scale:1,width:100,height:100,points:We(5)},this.interactive=!1,this.props={font:"18px Arial, sans-serif",lineHeight:1,textAlign:"left",verticalAlign:"top",paddingX:0,paddingY:0,fitParent:!1,lineBreak:"auto",strokeText:!1,sizeToFill:!1,maxFontSizeToFill:void 0,allowNewLine:!0,justifyLines:!1,renderHDPI:!1,textDecoration:"none",interactive:!1,relativeSize:!1},this.id="",this.points=We(5)}getAllPointsAt(e,n){return[[this,this.points,n]]}applyProps({id:e,target:n,text:r,color:o,backgroundColor:c,fontSize:h=18,interactive:v,fontFamily:g="Arial, sans-serif",...x}){x.font=`${h}px ${g}`,this.interactive=v||!1,typeof r<"u"&&(this.text=r||""),o&&(this.color=o),c&&(this.backgroundColor=c),e&&(this.id=e),n&&(this.points=wt.singleBox(n.width,n.height,n.x,n.y),this.display.points=this.points,this.display.width=n.width,this.display.height=n.height),this.props={...this.props,...x},this.__revision++}}const pn=Math.pow,_f=Math.sqrt,Nu=Math.sin,qy=Math.cos,_u=Math.PI,Uf=1.70158,jf=Uf*1.525,Yy=Uf+1,Qy=2*_u/3,Gy=2*_u/4.5,If=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},Ks={linear:t=>t,easeInQuad:function(t){return t*t},easeOutQuad:function(t){return 1-(1-t)*(1-t)},easeInOutQuad:function(t){return t<.5?2*t*t:1-pn(-2*t+2,2)/2},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return 1-pn(1-t,3)},easeInOutCubic:function(t){return t<.5?4*t*t*t:1-pn(-2*t+2,3)/2},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return 1-pn(1-t,4)},easeInOutQuart:function(t){return t<.5?8*t*t*t*t:1-pn(-2*t+2,4)/2},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return 1-pn(1-t,5)},easeInOutQuint:function(t){return t<.5?16*t*t*t*t*t:1-pn(-2*t+2,5)/2},easeInSine:function(t){return 1-qy(t*_u/2)},easeOutSine:function(t){return Nu(t*_u/2)},easeInOutSine:function(t){return-(qy(_u*t)-1)/2},easeInExpo:function(t){return t===0?0:pn(2,10*t-10)},easeOutExpo:function(t){return t===1?1:1-pn(2,-10*t)},easeInOutExpo:function(t){return t===0?0:t===1?1:t<.5?pn(2,20*t-10)/2:(2-pn(2,-20*t+10))/2},easeInCirc:function(t){return 1-_f(1-pn(t,2))},easeOutCirc:function(t){return _f(1-pn(t-1,2))},easeInOutCirc:function(t){return t<.5?(1-_f(1-pn(2*t,2)))/2:(_f(1-pn(-2*t+2,2))+1)/2},easeInBack:function(t){return Yy*t*t*t-Uf*t*t},easeOutBack:function(t){return 1+Yy*pn(t-1,3)+Uf*pn(t-1,2)},easeInOutBack:function(t){return t<.5?pn(2*t,2)*((jf+1)*2*t-jf)/2:(pn(2*t-2,2)*((jf+1)*(t*2-2)+jf)+2)/2},easeInElastic:function(t){return t===0?0:t===1?1:-pn(2,10*t-10)*Nu((t*10-10.75)*Qy)},easeOutElastic:function(t){return t===0?0:t===1?1:pn(2,-10*t)*Nu((t*10-.75)*Qy)+1},easeInOutElastic:function(t){return t===0?0:t===1?1:t<.5?-(pn(2,20*t-10)*Nu((20*t-11.125)*Gy))/2:pn(2,-20*t+10)*Nu((20*t-11.125)*Gy)/2+1},easeInBounce:function(t){return 1-If(1-t)},easeOutBounce:If,easeInOutBounce:function(t){return t<.5?(1-If(1-2*t))/2:(1+If(2*t-1))/2}};class RC{constructor(e){this.runtime=e,this.pendingTransition={from:We(5),to:We(5),elapsed_time:0,done:!0,total_time:0,timingFunction:Ks.easeInOutQuad,constrain:!1}}hasPending(){return!this.pendingTransition.done}getPendingTransition(){return this.pendingTransition}getPendingFrom(){return this.pendingTransition.from}customTransition(e){e(this.pendingTransition)}stopTransition(){this.pendingTransition.from=We(this.runtime.target),this.pendingTransition.to=We(this.runtime.target),this.pendingTransition.done=!0,this.pendingTransition.elapsed_time=0,this.pendingTransition.total_time=0}runTransition(e,n){if(!this.pendingTransition.done){const r=this.pendingTransition,o=r.total_time===0?0:(r.elapsed_time+n)/r.total_time,c=r.total_time===0?1:o===0?0:r.timingFunction(o);e[1]=r.from[1]+(r.to[1]-r.from[1])*c,e[2]=r.from[2]+(r.to[2]-r.from[2])*c,e[3]=r.from[3]+(r.to[3]-r.from[3])*c,e[4]=r.from[4]+(r.to[4]-r.from[4])*c,this.pendingTransition.elapsed_time+=n,this.pendingTransition.elapsed_time>=this.pendingTransition.total_time&&(this.pendingTransition.done=!0,this.pendingTransition.constrain&&this.constrainBounds({transition:{duration:this.pendingTransition.total_time===0?0:500,easing:Ks.easeOutExpo}}))}}zoomTo(e,{origin:n,stream:r=!1,transition:o}={}){const c=this.runtime.getZoomedPosition(e,{origin:n}),h=Math.abs(1-e);this.applyTransition(c,o,{duration:2e3*h,easing:Ks.easeOutExpo,constrain:!0},{stream:!1})}constrainBounds({transition:e,panPadding:n=0}={}){const[r,o]=this.runtime.constrainBounds(this.runtime.target,{panPadding:n});r&&(this.applyTransition(o,e,{duration:500,easing:Ks.easeOutQuart,constrain:!1}),this.runtime.updateNextFrame())}applyTransition(e,n,r,{stream:o}={}){this.pendingTransition.from=We(this.runtime.target),this.pendingTransition.to=e,o||(this.pendingTransition.elapsed_time=0),this.pendingTransition.done=!1,this.pendingTransition.total_time=typeof(n==null?void 0:n.duration)<"u"?n.duration:typeof(r==null?void 0:r.duration)<"u"?r.duration:1e3,this.pendingTransition.constrain=typeof(n==null?void 0:n.constrain)<"u"?n.constrain:typeof(r==null?void 0:r.constrain)<"u"?r.constrain:!1,this.pendingTransition.timingFunction=(n==null?void 0:n.easing)||(r==null?void 0:r.easing)||Ks.easeInOutSine}goToRegion(e,{transition:n}={}){const r=this.runtime.clampRegion(e);this.applyTransition(wt.singleBox(r.width,r.height,r.x,r.y),n,{duration:1e3,easing:Ks.easeOutExpo,constrain:!0}),this.runtime.updateNextFrame()}}class Ff{constructor(e,n,r,o=[],c){this.id=mf(),this.ready=!1,this.transformBuffer=We(500),this.lastTarget=We(5),this.zoomBuffer=We(5),this.logNextRender=!1,this.pendingUpdate=!0,this.isCommitting=!1,this.firstRender=!0,this.mode="explore",this.controllers=[],this.controllersRunning=!1,this.controllerStopFunctions=[],this.maxScaleFactor=1,this._viewerToWorld={x:0,y:0},this._lastGoodScale=1,this.hooks={useFrame:[],useBeforeFrame:[],useAfterPaint:[],useAfterFrame:[]},this._viewport={x:0,y:0,width:0,height:0},this.setViewport=h=>{const v=typeof h.x>"u"?this.target[1]:h.x,g=typeof h.y>"u"?this.target[2]:h.y;h.width?this.target[3]=v+h.width:this.target[3]=this.target[3]-this.target[1]+v,h.height?this.target[4]=g+h.height:this.target[4]=this.target[4]-this.target[2]+g,Math.abs(this.target[1]-v)>.01&&(this.target[1]=v),Math.abs(this.target[2]-g)>.01&&(this.target[2]=g),this.pendingUpdate=!0},this.render=h=>{const v=h-this.lastTime;if(this.isCommitting||this.fpsLimit&&v<1e3/this.fpsLimit){this.stopId=window.requestAnimationFrame(this.render);return}this.lastTime=h,this.world.flushSubscriptions(),this.stopId=window.requestAnimationFrame(this.render),this.hook("useFrame",v);const g=this.pendingUpdate,x=this.renderer.pendingUpdate();if(this.transitionManager.hasPending()&&(this.transitionManager.runTransition(this.target,v),this.pendingUpdate=!0,this.updateControllerPosition()),!this.firstRender&&!g&&!x&&this.target[0]===this.lastTarget[0]&&this.target[1]===this.lastTarget[1]&&this.target[2]===this.lastTarget[2]&&this.target[3]===this.lastTarget[3]&&this.target[4]===this.lastTarget[4])return;this.hook("useBeforeFrame",v),this.renderer.beforeFrame(this.world,v,this.target);const m=this.getScaleFactor(),w=this.renderer.getPointsAt(this.world,this.target,this.aggregate,m),A=w.length;for(let _=0;_<A;_++){const L=w[_][0],k=w[_][1],O=w[_][2],I=O?vs(k,O,this.transformBuffer):k;this.renderer.prepareLayer(L,L.__parent&&O?vs(L.__parent.crop||L.__parent.points,O):I);const q=I.length/5;for(let te=0;te<q;te++){const H=te*5;I[H]!==0&&(this.renderer.paint(L,te,I[H+1],I[H+2],I[H+3]-I[H+1],I[H+4]-I[H+2]),this.hook("useAfterPaint",L))}this.renderer.finishLayer(L,k)}this.renderer.afterFrame(this.world,v,this.target),this.hook("useAfterFrame",v),this.lastTarget[0]=this.target[0],this.lastTarget[1]=this.target[1],this.lastTarget[2]=this.target[2],this.lastTarget[3]=this.target[3],this.lastTarget[4]=this.target[4],this.firstRender=!1,this.pendingUpdate=!1,this.logNextRender=!1,this.renderer.isReady()&&(this.ready=!0,this.world.trigger("ready")),this.world.flushSubscriptions();const P=this.world.getScheduledUpdates(this.target,m),M=P.length;if(M>0)for(let _=0;_<M;_++){const L=P[M-_-1]();L?L.then(()=>{this.pendingUpdate=!0}):this.pendingUpdate=!0}},this.renderer=e,this.world=n,this.options={maxOverZoom:1,maxUnderZoom:1,visibilityRatio:1.5,...c||{}},this.target=wt.projection(r),this.manualHomePosition=!1,this.pendingUpdate=!0,this.homePosition=wt.projection(this.world),this.manualFocalPosition=!1,this.focalPosition=this.target,this.updateFocalPosition(),this.transitionManager=new RC(this),this.aggregate=Ys(1),this.world.addLayoutSubscriber(h=>{h==="repaint"&&(this.pendingUpdate=!0),h==="recalculate-world-size"&&(this.manualHomePosition||(this.setHomePosition(),this.goHome()),this.updateFocalPosition())}),this.lastTime=performance.now(),this.controllers=o,this.render(this.lastTime),this.startControllers()}get x(){return this.target[1]}set x(e){this.target[1]=e}get y(){return this.target[2]}set y(e){this.target[2]=e}get x2(){return this.target[3]}set x2(e){this.target[3]=e}get y2(){return this.target[4]}set y2(e){this.target[4]=e}get width(){return this.target[3]-this.target[1]}set width(e){this.target[3]=this.target[1]+e}get height(){return this.target[4]-this.target[2]}set height(e){this.target[4]=this.target[2]=e}setHomePosition(e){this.homePosition.set(wt.projection(e||this.world)),this.pendingUpdate=!0}startControllers(){if(!this.controllersRunning){for(const e of this.controllers)this.controllerStopFunctions.push(e.start(this));this.controllersRunning=!0}}stopControllers(){if(this.controllersRunning){for(const e of this.controllerStopFunctions)e();this.controllersRunning=!1,this.controllerStopFunctions=[]}}updateControllerPosition(){for(const e of this.controllers)e.updatePosition(this.x,this.y,this.width,this.height)}triggerResize(){this.renderer.triggerResize&&this.renderer.triggerResize(),this.pendingUpdate=!0}addController(e){this.controllers.push(e),this.controllersRunning&&e.start(this),this.pendingUpdate=!0}cover(){return this.goHome({cover:!0})}getRendererScreenPosition(){return this.renderer.getRendererScreenPosition()}updateRendererScreenPosition(){this.pendingUpdate=!0,this.renderer.resize()}setOptions(e){this.options={...this.options,...e}}goHome(e={}){if(this.world.width<=0||this.world.height<=0)return;const n=this.getScaleFactor(),r=e.position?{x:e.position[1],y:e.position[2],width:e.position[3]-e.position[1],height:e.position[4]-e.position[2]}:{x:this.homePosition[1],y:this.homePosition[2],width:this.homePosition[3]-this.homePosition[1],height:this.homePosition[4]-this.homePosition[2]},o=this.width*n,c=this.height*n,h=r.width/o,v=r.height/c,g=o/c;if(e.cover?h>v:h<v){const x=g*r.height,m=(x-r.width)/2;this.target[1]=-m+r.x,this.target[2]=r.y,this.target[3]=x-m+r.x,this.target[4]=r.height+r.y}else{const x=r.width/g,m=(x-r.height)/2;this.target[1]=r.x,this.target[2]=r.y-m,this.target[3]=r.x+r.width,this.target[4]=r.y+x-m}this.constrainBounds(this.target),this.updateControllerPosition()}resize(e,n,r,o){this.updateFocalPosition(e-n,r-o);const c=n/e,h=o/r;this.target[3]=this.target[1]+(this.target[3]-this.target[1])*c,this.target[4]=this.target[2]+(this.target[4]-this.target[2])*h,this.goHome({position:this.focalPosition}),this.renderer.resize(n,o),this.pendingUpdate=!0}updateFocalPosition(e,n){if(!this.manualFocalPosition){const r=this.width,o=this.height,c=Math.min(r,o),h=0,v=0,g=this.x+h,x=this.y+v;if(r<o){const m=this.height-this.width;this.focalPosition=wt.projection({x:g,y:x+m/2,width:c-h*2,height:c-v*2}),this.pendingUpdate=!0}else{const m=this.width-this.height;this.focalPosition=wt.projection({x:g+m/2,y:x,width:c-h*2,height:c-v*2}),this.pendingUpdate=!0}}}getViewport(){return this._viewport.x=this.target[1],this._viewport.y=this.target[2],this._viewport.width=this.target[3]-this.target[1],this._viewport.height=this.target[4]-this.target[2],this._viewport}constrainBounds(e,{panPadding:n=0,ref:r=!1}={}){const{minX:o,maxX:c,minY:h,maxY:v}=this.getBounds({target:e,padding:n});let g=!1;const x=r?e:We(e),m=e[3]-e[1],w=e[4]-e[2];return o>e[1]&&(g=!0,x[1]=o,x[3]=o+m),h>e[2]&&(g=!0,x[2]=h,x[4]=h+w),c<e[1]&&(g=!0,x[1]=c,x[3]=c+m),v<e[2]&&(g=!0,x[2]=v,x[4]=v+w),[g,x]}getBounds(e){const n=e.target||this.target,r=e.padding,o=this.options.visibilityRatio,c=Math.abs(1-o);if(this.world.hasActiveZone()){const O=this.world.getActiveZone();if(O){const I=n[3]-n[1]<O.points[3]-O.points[1],q=n[4]-n[2]<O.points[4]-O.points[2];return{minX:I?O.points[1]-r:O.points[1]+(O.points[3]-O.points[1])/2-(n[3]-n[1])/2,maxX:q?O.points[2]-r:O.points[2]+(O.points[4]-O.points[2])/2-(n[4]-n[2])/2,minY:I?O.points[3]+r:O.points[1]+(O.points[3]-O.points[1])/2-(n[3]-n[1])/2,maxY:q?O.points[4]+r:O.points[2]+(O.points[4]-O.points[2])/2-(n[4]-n[2])/2}}}const h=n[3]-n[1],v=this.world.width,g=-h*c,x=v-h-g,m=n[4]-n[2],w=this.world.height,A=-m*c,P=w-m-A,M=Math.max(g,x),_=Math.min(g,x),L=Math.max(A,P),k=Math.min(A,P);return{minX:_,maxX:M,minY:k,maxY:L}}getScaleFactor(e=!1){const n=this.renderer.getScale(this.target[3]-this.target[1],this.target[4]-this.target[2],e);return n===0?this._lastGoodScale:(this._lastGoodScale=n,n)}getZoomedPosition(e,{origin:n,fromPos:r}){var o;const c=r?{width:r[3]-r[1],height:r[4]-r[2]}:void 0,h=c?this.renderer.getScale(c.width,c.height):this.getScaleFactor(),v=c?c.width:this.width,g=c?c.height:this.height,x=(o=this.getRendererScreenPosition())==null?void 0:o.width,m=this.world.width,w=x?x/m:1,A=this.options.maxUnderZoom,P=Math.max(w||1,this.options.maxOverZoom),M=1/e,_=h*M;if(M<1){const O=v*h,I=g*h,q=this.world.width/O,te=this.world.height/I;if(q>te){const H=this.world.width*_,re=~~(v*h)*A;H<re&&(e=this.world.width*h/(v*h*A))}else{const H=this.world.height*_,re=~~(g*h)*A;H<re&&(e=this.world.height*h/(g*h*A))}}else _>P&&(e=h/P);const k=vs(this.target,Ru(e,n?n.x:this.target[1]+(this.target[3]-this.target[1])/2,n?n.y:this.target[2]+(this.target[4]-this.target[2])/2),this.zoomBuffer);return this.constrainBounds(k,{ref:!0,panPadding:100}),k}clampRegion({x:e,y:n,width:r,height:o,padding:c=0}){const h=this.width,v=this.height,g=r/h<o/v,x=e-c,m=n-c,w=r+c*2,A=o+c*2;if(g){const M=A/v*h;return{x:x-(M-w)/2,y:m,width:M,height:A}}const P=w/h*v;return{x,y:m-(P-A)/2,width:w,height:P}}viewerToWorld(e,n){const r=this.getScaleFactor();return this._viewerToWorld.x=this.target[1]+e/r,this._viewerToWorld.y=this.target[2]+n/r,this._viewerToWorld}worldToViewer(e,n,r,o){const c=wt.singleBox(r,o,e,n);return Br(c,ps(Ys(this.getScaleFactor()),mi(-this.target[1],-this.target[2]))),{x:c[1],y:c[2],width:c[3]-c[1],height:c[4]-c[2],strand:c}}setScale(e,n){Br(this.target,Ru(e,n?n.x:this.target[1]+(this.target[3]-this.target[1])/2,n?n.y:this.target[2]+(this.target[4]-this.target[2])/2)),this.pendingUpdate=!0}syncTo(e){const n=this.target;return this.target=e.target,this.pendingUpdate=!0,()=>{this.target=n}}stop(){return typeof this.stopId<"u"&&(window.cancelAnimationFrame(this.stopId),this.stopId=void 0),()=>{this.render(performance.now())}}reset(){this.renderer.reset()}selectZone(e){this.world.selectZone(e),this.pendingUpdate=!0}deselectZone(){this.world.deselectZone(),this.pendingUpdate=!0}hook(e,n){const r=this.hooks[e].length;if(r!==0)for(let o=0;o<r;o++)this.hooks[e][o](n)}registerHook(e,n){return this.hooks[e].push(n),()=>{this.hooks[e]=this.hooks[e].filter(r=>r!==n)}}updateNextFrame(){this.pendingUpdate=!0}}const Uu=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Bf=typeof AbortController=="function"?AbortController:class{constructor(){this.signal=new Xy}abort(e=new Error("This operation was aborted")){this.signal.reason=e,this.signal.dispatchEvent({type:"abort",target:this.signal})}},AC=typeof AbortSignal=="function",MC=typeof Bf.AbortSignal=="function",Xy=AC?AbortSignal:MC?Bf.AbortController:class{constructor(){this.reason=void 0,this.aborted=!1,this._listeners=[]}dispatchEvent(e){e.type==="abort"&&(this.aborted=!0,this.onabort(e),this._listeners.forEach(n=>n(e),this))}onabort(){}addEventListener(e,n){e==="abort"&&this._listeners.push(n)}removeEventListener(e,n){e==="abort"&&(this._listeners=this._listeners.filter(r=>r!==n))}},gp=new Set,yp=(t,e)=>{const n=`LRU_CACHE_OPTION_${t}`;Hf(n)&&bp(n,`${t} option`,`options.${e}`,Ia)},Sp=(t,e)=>{const n=`LRU_CACHE_METHOD_${t}`;if(Hf(n)){const{prototype:r}=Ia,{get:o}=Object.getOwnPropertyDescriptor(r,t);bp(n,`${t} method`,`cache.${e}()`,o)}},OC=(t,e)=>{const n=`LRU_CACHE_PROPERTY_${t}`;if(Hf(n)){const{prototype:r}=Ia,{get:o}=Object.getOwnPropertyDescriptor(r,t);bp(n,`${t} property`,`cache.${e}`,o)}},Ky=(...t)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...t):console.error(...t)},Hf=t=>!gp.has(t),bp=(t,e,n,r)=>{gp.add(t);const o=`The ${e} is deprecated. Please use ${n} instead.`;Ky(o,"DeprecationWarning",t,r)},Zs=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),Zy=t=>Zs(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Vf:null:null;class Vf extends Array{constructor(e){super(e),this.fill(0)}}class DC{constructor(e){if(e===0)return[];const n=Zy(e);this.heap=new n(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}}class Ia{constructor(e={}){const{max:n=0,ttl:r,ttlResolution:o=1,ttlAutopurge:c,updateAgeOnGet:h,updateAgeOnHas:v,allowStale:g,dispose:x,disposeAfter:m,noDisposeOnSet:w,noUpdateTTL:A,maxSize:P=0,maxEntrySize:M=0,sizeCalculation:_,fetchMethod:L,fetchContext:k,noDeleteOnFetchRejection:O,noDeleteOnStaleGet:I,allowStaleOnFetchRejection:q,allowStaleOnFetchAbort:te,ignoreFetchAbort:H}=e,{length:J,maxAge:re,stale:$}=e instanceof Ia?{}:e;if(n!==0&&!Zs(n))throw new TypeError("max option must be a nonnegative integer");const se=n?Zy(n):Array;if(!se)throw new Error("invalid max value: "+n);if(this.max=n,this.maxSize=P,this.maxEntrySize=M||this.maxSize,this.sizeCalculation=_||J,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=L||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=k,!this.fetchMethod&&k!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(n).fill(null),this.valList=new Array(n).fill(null),this.next=new se(n),this.prev=new se(n),this.head=0,this.tail=0,this.free=new DC(n),this.initialFill=1,this.size=0,typeof x=="function"&&(this.dispose=x),typeof m=="function"?(this.disposeAfter=m,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!w,this.noUpdateTTL=!!A,this.noDeleteOnFetchRejection=!!O,this.allowStaleOnFetchRejection=!!q,this.allowStaleOnFetchAbort=!!te,this.ignoreFetchAbort=!!H,this.maxEntrySize!==0){if(this.maxSize!==0&&!Zs(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!Zs(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!g||!!$,this.noDeleteOnStaleGet=!!I,this.updateAgeOnGet=!!h,this.updateAgeOnHas=!!v,this.ttlResolution=Zs(o)||o===0?o:1,this.ttlAutopurge=!!c,this.ttl=r||re||0,this.ttl){if(!Zs(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){const ge="LRU_CACHE_UNBOUNDED";Hf(ge)&&(gp.add(ge),Ky("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ge,Ia))}$&&yp("stale","allowStale"),re&&yp("maxAge","ttl"),J&&yp("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new Vf(this.max),this.starts=new Vf(this.max),this.setItemTTL=(r,o,c=Uu.now())=>{if(this.starts[r]=o!==0?c:0,this.ttls[r]=o,o!==0&&this.ttlAutopurge){const h=setTimeout(()=>{this.isStale(r)&&this.delete(this.keyList[r])},o+1);h.unref&&h.unref()}},this.updateItemAge=r=>{this.starts[r]=this.ttls[r]!==0?Uu.now():0};let e=0;const n=()=>{const r=Uu.now();if(this.ttlResolution>0){e=r;const o=setTimeout(()=>e=0,this.ttlResolution);o.unref&&o.unref()}return r};this.getRemainingTTL=r=>{const o=this.keyMap.get(r);return o===void 0?0:this.ttls[o]===0||this.starts[o]===0?1/0:this.starts[o]+this.ttls[o]-(e||n())},this.isStale=r=>this.ttls[r]!==0&&this.starts[r]!==0&&(e||n())-this.starts[r]>this.ttls[r]}updateItemAge(e){}setItemTTL(e,n,r){}isStale(e){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new Vf(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,n,r,o)=>{if(this.isBackgroundFetch(n))return 0;if(!Zs(r))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(r=o(n,e),!Zs(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r},this.addItemSize=(e,n)=>{if(this.sizes[e]=n,this.maxSize){const r=this.maxSize-this.sizes[e];for(;this.calculatedSize>r;)this.evict(!0)}this.calculatedSize+=this.sizes[e]}}removeItemSize(e){}addItemSize(e,n){}requireSize(e,n,r,o){if(r||o)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:e=this.allowStale}={}){if(this.size)for(let n=this.tail;!(!this.isValidIndex(n)||((e||!this.isStale(n))&&(yield n),n===this.head));)n=this.prev[n]}*rindexes({allowStale:e=this.allowStale}={}){if(this.size)for(let n=this.head;!(!this.isValidIndex(n)||((e||!this.isStale(n))&&(yield n),n===this.tail));)n=this.next[n]}isValidIndex(e){return this.keyMap.get(this.keyList[e])===e}*entries(){for(const e of this.indexes())this.isBackgroundFetch(this.valList[e])||(yield[this.keyList[e],this.valList[e]])}*rentries(){for(const e of this.rindexes())this.isBackgroundFetch(this.valList[e])||(yield[this.keyList[e],this.valList[e]])}*keys(){for(const e of this.indexes())this.isBackgroundFetch(this.valList[e])||(yield this.keyList[e])}*rkeys(){for(const e of this.rindexes())this.isBackgroundFetch(this.valList[e])||(yield this.keyList[e])}*values(){for(const e of this.indexes())this.isBackgroundFetch(this.valList[e])||(yield this.valList[e])}*rvalues(){for(const e of this.rindexes())this.isBackgroundFetch(this.valList[e])||(yield this.valList[e])}[Symbol.iterator](){return this.entries()}find(e,n={}){for(const r of this.indexes())if(e(this.valList[r],this.keyList[r],this))return this.get(this.keyList[r],n)}forEach(e,n=this){for(const r of this.indexes())e.call(n,this.valList[r],this.keyList[r],this)}rforEach(e,n=this){for(const r of this.rindexes())e.call(n,this.valList[r],this.keyList[r],this)}get prune(){return Sp("prune","purgeStale"),this.purgeStale}purgeStale(){let e=!1;for(const n of this.rindexes({allowStale:!0}))this.isStale(n)&&(this.delete(this.keyList[n]),e=!0);return e}dump(){const e=[];for(const n of this.indexes({allowStale:!0})){const r=this.keyList[n],o=this.valList[n],c=this.isBackgroundFetch(o)?o.__staleWhileFetching:o;if(c===void 0)continue;const h={value:c};if(this.ttls){h.ttl=this.ttls[n];const v=Uu.now()-this.starts[n];h.start=Math.floor(Date.now()-v)}this.sizes&&(h.size=this.sizes[n]),e.unshift([r,h])}return e}load(e){this.clear();for(const[n,r]of e){if(r.start){const o=Date.now()-r.start;r.start=Uu.now()-o}this.set(n,r.value,r)}}dispose(e,n,r){}set(e,n,{ttl:r=this.ttl,start:o,noDisposeOnSet:c=this.noDisposeOnSet,size:h=0,sizeCalculation:v=this.sizeCalculation,noUpdateTTL:g=this.noUpdateTTL}={}){if(h=this.requireSize(e,n,h,v),this.maxEntrySize&&h>this.maxEntrySize)return this.delete(e),this;let x=this.size===0?void 0:this.keyMap.get(e);if(x===void 0)x=this.newIndex(),this.keyList[x]=e,this.valList[x]=n,this.keyMap.set(e,x),this.next[this.tail]=x,this.prev[x]=this.tail,this.tail=x,this.size++,this.addItemSize(x,h),g=!1;else{this.moveToTail(x);const m=this.valList[x];n!==m&&(this.isBackgroundFetch(m)?m.__abortController.abort(new Error("replaced")):c||(this.dispose(m,e,"set"),this.disposeAfter&&this.disposed.push([m,e,"set"])),this.removeItemSize(x),this.valList[x]=n,this.addItemSize(x,h))}if(r!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),g||this.setItemTTL(x,r,o),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){const e=this.valList[this.head];return this.evict(!0),e}}evict(e){const n=this.head,r=this.keyList[n],o=this.valList[n];return this.isBackgroundFetch(o)?o.__abortController.abort(new Error("evicted")):(this.dispose(o,r,"evict"),this.disposeAfter&&this.disposed.push([o,r,"evict"])),this.removeItemSize(n),e&&(this.keyList[n]=null,this.valList[n]=null,this.free.push(n)),this.head=this.next[n],this.keyMap.delete(r),this.size--,n}has(e,{updateAgeOnHas:n=this.updateAgeOnHas}={}){const r=this.keyMap.get(e);return r!==void 0&&!this.isStale(r)?(n&&this.updateItemAge(r),!0):!1}peek(e,{allowStale:n=this.allowStale}={}){const r=this.keyMap.get(e);if(r!==void 0&&(n||!this.isStale(r))){const o=this.valList[r];return this.isBackgroundFetch(o)?o.__staleWhileFetching:o}}backgroundFetch(e,n,r,o){const c=n===void 0?void 0:this.valList[n];if(this.isBackgroundFetch(c))return c;const h=new Bf;r.signal&&r.signal.addEventListener("abort",()=>h.abort(r.signal.reason));const v={signal:h.signal,options:r,context:o},g=(A,P=!1)=>{const{aborted:M}=h.signal,_=r.ignoreFetchAbort&&A!==void 0;return M&&!_&&!P?x(h.signal.reason):(this.valList[n]===w&&(A===void 0?w.__staleWhileFetching?this.valList[n]=w.__staleWhileFetching:this.delete(e):this.set(e,A,v.options)),A)},x=A=>{const{aborted:P}=h.signal,M=P&&r.allowStaleOnFetchAbort,_=M||r.allowStaleOnFetchRejection,L=_||r.noDeleteOnFetchRejection;if(this.valList[n]===w&&(!L||w.__staleWhileFetching===void 0?this.delete(e):M||(this.valList[n]=w.__staleWhileFetching)),_)return w.__staleWhileFetching;if(w.__returned===w)throw A},m=(A,P)=>{this.fetchMethod(e,c,v).then(M=>A(M),P),h.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(A(),r.allowStaleOnFetchAbort&&(A=M=>g(M,!0)))})},w=new Promise(m).then(g,x);return w.__abortController=h,w.__staleWhileFetching=c,w.__returned=null,n===void 0?(this.set(e,w,v.options),n=this.keyMap.get(e)):this.valList[n]=w,w}isBackgroundFetch(e){return e&&typeof e=="object"&&typeof e.then=="function"&&Object.prototype.hasOwnProperty.call(e,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(e,"__returned")&&(e.__returned===e||e.__returned===null)}async fetch(e,{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:v=0,sizeCalculation:g=this.sizeCalculation,noUpdateTTL:x=this.noUpdateTTL,noDeleteOnFetchRejection:m=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:w=this.allowStaleOnFetchRejection,ignoreFetchAbort:A=this.ignoreFetchAbort,allowStaleOnFetchAbort:P=this.allowStaleOnFetchAbort,fetchContext:M=this.fetchContext,forceRefresh:_=!1,signal:L}={}){if(!this.fetchMethod)return this.get(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:o});const k={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:o,ttl:c,noDisposeOnSet:h,size:v,sizeCalculation:g,noUpdateTTL:x,noDeleteOnFetchRejection:m,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:P,ignoreFetchAbort:A,signal:L};let O=this.keyMap.get(e);if(O===void 0){const I=this.backgroundFetch(e,O,k,M);return I.__returned=I}else{const I=this.valList[O];if(this.isBackgroundFetch(I))return n&&I.__staleWhileFetching!==void 0?I.__staleWhileFetching:I.__returned=I;if(!_&&!this.isStale(O))return this.moveToTail(O),r&&this.updateItemAge(O),I;const q=this.backgroundFetch(e,O,k,M);return n&&q.__staleWhileFetching!==void 0?q.__staleWhileFetching:q.__returned=q}}get(e,{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet}={}){const c=this.keyMap.get(e);if(c!==void 0){const h=this.valList[c],v=this.isBackgroundFetch(h);return this.isStale(c)?v?n?h.__staleWhileFetching:void 0:(o||this.delete(e),n?h:void 0):v?void 0:(this.moveToTail(c),r&&this.updateItemAge(c),h)}}connect(e,n){this.prev[n]=e,this.next[e]=n}moveToTail(e){e!==this.tail&&(e===this.head?this.head=this.next[e]:this.connect(this.prev[e],this.next[e]),this.connect(this.tail,e),this.tail=e)}get del(){return Sp("del","delete"),this.delete}delete(e){let n=!1;if(this.size!==0){const r=this.keyMap.get(e);if(r!==void 0)if(n=!0,this.size===1)this.clear();else{this.removeItemSize(r);const o=this.valList[r];this.isBackgroundFetch(o)?o.__abortController.abort(new Error("deleted")):(this.dispose(o,e,"delete"),this.disposeAfter&&this.disposed.push([o,e,"delete"])),this.keyMap.delete(e),this.keyList[r]=null,this.valList[r]=null,r===this.tail?this.tail=this.prev[r]:r===this.head?this.head=this.next[r]:(this.next[this.prev[r]]=this.next[r],this.prev[this.next[r]]=this.prev[r]),this.size--,this.free.push(r)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return n}clear(){for(const e of this.rindexes({allowStale:!0})){const n=this.valList[e];if(this.isBackgroundFetch(n))n.__abortController.abort(new Error("deleted"));else{const r=this.keyList[e];this.dispose(n,r,"delete"),this.disposeAfter&&this.disposed.push([n,r,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return Sp("reset","clear"),this.clear}get length(){return OC("length","size"),this.size}static get AbortController(){return Bf}static get AbortSignal(){return Xy}}var LC=Ia;const Wf=/([0-9]+(px|em)\s+)+(solid)\s+(.*)/g,$f={},PC=["backgroundColor","opacity","boxShadow","borderColor","borderWidth","borderStyle","outlineColor","outlineWidth","outlineOffset","outlineStyle"];class Jy extends Hr{constructor(){super(),this.type="spacial-content",this.isShape=!0,this.hoverEvents=!1,this.activeEvents=!1,this.display={x:0,y:0,scale:1,width:-1,height:-1,points:We(5)},this.boundingBox=null,this._parsed={border:{id:null,match:[]},outline:{id:null,match:[]}},this.props={},this.shape={type:"none"},this.addHover=()=>{this.hovering=!0,this.__revision++},this.removeHover=()=>{this.hovering=!1,this.pressing=!1,this.__revision++},this.addPress=()=>{this.pressing=!0,this.__revision++},this.removePress=()=>{this.pressing=!1,this.__revision++},this.id=mf(12),this.points=We(5),this.shape={type:"none"}}updateBoundingBox(){if(this.shape.type==="none")return;const e=this.shape.points;if(this.shape.points.length>2){const n=Math.min(...e.map(h=>h[0])),r=Math.min(...e.map(h=>h[1])),o=Math.max(0,...e.map(h=>h[0])),c=Math.max(0,...e.map(h=>h[1]));this.boundingBox={x:n,y:r,width:o-n,height:c-r};return}this.boundingBox=null}intersects(e){if(!e||this.shape.type==="none")return!1;const[n,r]=e,o=this.shape.points;let c=this.boundingBox;if(c||(this.updateBoundingBox(),c=this.boundingBox),!c||n<c.x||n>c.x+c.width||r<c.y||r>c.height+c.y)return!1;let h=!1;for(let v=0,g=o.length-1;v<o.length;g=v++)o[v][1]>r!=o[g][1]>r&&n<(o[g][0]-o[v][0])*(r-o[v][1])/(o[g][1]-o[v][1])+o[v][0]&&(h=!h);return h}getAllPointsAt(e,n){return e[3]-e[1]===1&&e[4]-e[2]===1?this.intersects([e[1],e[2]])?[[this,this.points,n]]:[]:[[this,this.points,n]]}applyProps(e={}){let n=!1;if(e.points)if(this.shape.type!=="polygon"||this.shape.points.length!==e.points.length)this.shape={type:"polygon",points:e.points,open:e.open},this.updateBoundingBox();else{let r=!1;const o=e.points.length;for(let c=0;c<o;c++)if(e.points[c][0]!==this.shape.points[c][0]||e.points[c][1]!==this.shape.points[c][1]){r=!0;break}r&&(this.shape={type:"polygon",points:e.points,open:e.open},this.updateBoundingBox())}if(e.interactive!==this.props.interactive&&(n=!0,this.props.interactive=e.interactive),(e.open||e.open===!1)&&(n=!0,this.shape.open=e.open),e.style){const r=e.border||e.style.border;if(r!==this._parsed.border.id)if(!r)this._parsed.border.id=null,this._parsed.border.match=[];else{const o=$f[r]||Wf.exec(r)||Wf.exec(r);o&&(this._parsed.border.id=r,this._parsed.border.match=$f[r]=o)}if(this._parsed.border.id&&(e.style.borderWidth=this._parsed.border.match[1],e.style.borderStyle="solid",e.style.borderColor=this._parsed.border.match[4]),e.style.outline!==this._parsed.outline.id)if(!e.style.outline)this._parsed.outline.id=null,this._parsed.outline.match=[];else{const o=$f[e.style.outline]||Wf.exec(e.style.outline)||Wf.exec(e.style.outline);o&&(this._parsed.outline.id=e.style.outline,this._parsed.outline.match=$f[e.style.outline]=o)}this._parsed.outline.id&&(e.style.outlineWidth=this._parsed.outline.match[1],e.style.outlineStyle="solid",e.style.outlineColor=this._parsed.outline.match[4]),this.props.style=e.style,e.backgroundColor&&!this.props.style.backgroundColor&&(this.props.style.backgroundColor=e.backgroundColor,n=!0),e.style.background&&!this.props.style.backgroundColor&&(this.props.style.backgroundColor=e.style.background,n=!0);for(const o of PC)if(this.props.style[o]!==e.style[o]){n=!0;break}e.style[":hover"]!==this.props.hoverStyles&&(this.props.hoverStyles=e.style[":hover"],this.hoverEvents||(this.hoverEvents=!0,this.addEventListener("pointerenter",this.addHover),this.addEventListener("pointerleave",this.removeHover)),n=!0),e.style[":active"]!==this.props.pressStyles&&(this.props.pressStyles=e.style[":active"],this.activeEvents||(this.activeEvents=!0,this.addEventListener("mousedown",this.addPress),this.addEventListener("mouseup",this.removePress)),n=!0)}e.href!==this.props.href&&(this.props.href=e.href,n=!0),e.hrefTarget!==this.props.hrefTarget&&(this.props.hrefTarget=e.hrefTarget,n=!0),e.title!==this.props.title&&(this.props.title=e.title,n=!0),e.className!==this.props.className&&(this.props.className=e.className,e.className&&!this.hoverEvents&&(this.hoverEvents=!0,this.addEventListener("pointerenter",this.addHover),this.addEventListener("pointerleave",this.removeHover)),e.className&&!this.activeEvents&&(this.activeEvents=!0,this.addEventListener("mousedown",this.addPress),this.addEventListener("mouseup",this.removePress)),n=!0),e.relativeSize!==this.props.relativeSize&&(this.props.relativeSize=e.relativeSize,n=!0),e.relativeStyle!==this.props.relativeStyle&&(this.props.relativeStyle=e.relativeStyle,n=!0),e.html!==this.props.html&&(this.props.html=e.html,n=!0),e.target&&(e.target.width!==this.display.width||e.target.height!==this.display.height||e.target.x!==this.points[1]||e.target.y!==this.points[2])&&(n=!0,this.points=wt.singleBox(e.target.width,e.target.height,e.target.x,e.target.y),this.display.points=wt.singleBox(e.target.width,e.target.height,e.target.x,e.target.y),this.display.width=e.target.width,this.display.height=e.target.height),n&&this.__revision++}}const e0=/(-?[0-9]+(px|em)\s+|0\s+)(-?[0-9]+(px|em)\s+|0\s+)(-?[0-9]+(px|em)\s+|0\s+)?(-?[0-9]+(px|em)\s+|0\s+)?(.*)/g,t0={},qf={};class kC{constructor(e,n){this.imagesPending=0,this.imagesLoaded=0,this.frameIsRendering=!1,this.pendingDrawCall=!1,this.firstMeaningfulPaint=!1,this.parallelTasks=8,this.frameTasks=0,this.loadingQueueOrdered=!0,this.loadingQueue=[],this.currentTask=Promise.resolve(),this.tasksRunning=0,this.averageJobTime=1e3,this.lastKnownScale=1,this.visible=[],this.previousVisible=[],this.drawCalls=[],this.invalidated=[],this._worker=()=>{if(this.loadingQueue.length){const r=this.loadingQueue.pop();r&&(this.tasksRunning++,this.frameTasks++,this.currentTask=r.task().then(()=>{this.tasksRunning--}).catch(()=>{this.tasksRunning--}))}},this._scheduled=0,this._doWork=()=>{this.loadingQueue.length===0&&this.tasksRunning===0&&this._scheduled&&(clearInterval(this._scheduled),this._scheduled=0),this._worker()},this.canvas=e,this.rendererPosition=e.getBoundingClientRect(),this.ctx=e.getContext("2d",{alpha:!0}),this.ctx.imageSmoothingEnabled=!0,this.options=n||{},this.canvas.style.opacity="0",this.canvas.style.transition="opacity .3s",this.dpi=(n==null?void 0:n.dpi)||1,this.hostCache=n!=null&&n.lruCache?new LC({maxSize:1024*512*512,dispose:(r,o,c)=>{this.invalidated.push(o),r.width=0,r.height=0},sizeCalculation:(r,o)=>r.width*r.height}):{store:{},get(r){return this.store[r]},set(r,o){this.store[r]=o}}}getCanvasDims(){return{width:this.canvas.width/this.dpi,height:this.canvas.height/this.dpi}}resize(){this.rendererPosition=this.canvas.getBoundingClientRect()}isReady(){return this.firstMeaningfulPaint}afterFrame(e){if(this.clearTransform(),this.lastPaintedObject=void 0,this.frameIsRendering=!1,this.imagesPending=this.imagesPending-this.imagesLoaded,this.imagesLoaded=0,this.loadingQueueOrdered||(this.loadingQueue=this.loadingQueue.sort((n,r)=>n.network&&n.scale===r.scale?r.distance-n.distance:n.scale<r.scale?-1:1),this.loadingQueueOrdered=!0),this.previousVisible=this.visible,this.pendingDrawCall=!!this.drawCalls.length,this.pendingDrawCall)for(let n=0;n<this.drawCalls.length;n++){const r=this.drawCalls.shift();r&&r()}this.doOffscreenWork(),this.options.debug&&this.stats&&this.stats.end()}doOffscreenWork(){this.frameTasks=0,this.loadingQueue.length&&(this._worker(),this.loadingQueue.length&&(this._scheduled||(this._scheduled=setInterval(this._doWork,0))))}getScale(e,n,r){if(Number.isNaN(e)||Number.isNaN(n))return this.lastKnownScale;const o=this.getCanvasDims(),c=o.width/e,h=o.height/n,v=(c<h?h:c)*(r&&this.dpi||1);return Number.isNaN(v)||(this.lastKnownScale=v),this.lastKnownScale}beforeFrame(e,n,r){this.options.debug&&this.stats&&this.stats.begin(),this.frameIsRendering=!0,this.visible=[],this.options.beforeFrame&&this.options.beforeFrame(n);const o=this.getCanvasDims();this.ctx.globalAlpha=1,this.ctx.fillStyle=this.options.background||"rgb(0, 0, 0)",this.ctx.fillRect(0,0,o.width,o.height)}applyTransform(e,n,r,o,c){const h=e.__owner.value;if(h&&h.rotation){this.ctx.save();const v=n+o/2,g=r+c/2;this.ctx.translate(v,g),this.ctx.rotate(h.rotation*Math.PI/180),this.ctx.translate(-v,-g),this.lastPaintedObject=h}}clearTransform(){this.lastPaintedObject&&(this.lastPaintedObject.rotation&&this.ctx.restore(),this.lastPaintedObject=void 0)}paint(e,n,r,o,c,h){const v=this.ctx.globalAlpha;if(e instanceof xr||e instanceof ja){if(e.display.rotation){this.ctx.save();let m=r+c/2,w=o+h/2;e.crop&&(m-=e.crop[n*5+1],w-=e.crop[n*5+2]),this.ctx.translate(m,w),this.ctx.rotate(e.display.rotation*Math.PI/180),this.ctx.translate(-m,-w)}if(this.visible.push(e),typeof e.style&&e.style.opacity!=="undefined"){if(!e.style.opacity)return;this.ctx.globalAlpha=e.style.opacity}try{const m=e.__host.canvas,w=this.getCanvasDims();if((m.indices.indexOf(n)===-1||this.invalidated.indexOf(m.canvases[n])!==-1)&&this.schedulePaintToCanvas(m,e,n,gf({x:r+c/2,y:o+c/2},{x:w.width/2,y:w.height/2})),!this.firstMeaningfulPaint)return;const A=this.hostCache.get(m.canvases[n]);if(A)if(e.crop&&e.cropData){if(e.crop[n*5]){const P=[e.crop[n*5+1]/e.display.scale-e.display.points[n*5+1],e.crop[n*5+2]/e.display.scale-e.display.points[n*5+2],1+(e.crop[n*5+3]-e.crop[n*5+1])/e.display.scale,1+(e.crop[n*5+4]-e.crop[n*5+2])/e.display.scale];P[0]+=e.cropData.x/e.display.scale,P[1]+=e.cropData.y/e.display.scale;const M=e.x*this.lastKnownScale,_=e.y*this.lastKnownScale,L=[r+M,o+_,c,h];L[0]+=M,L[1]+=_,this.ctx.drawImage(A,P[0],P[1],P[2],P[3],L[0],L[1],L[2]+1,L[3]+1)}}else this.ctx.drawImage(A,0,0,e.display.points[n*5+3]-e.display.points[n*5+1],e.display.points[n*5+4]-e.display.points[n*5+2],r,o,c+Number.MIN_VALUE,h+Number.MIN_VALUE)}catch{}e.display.rotation&&this.ctx.restore()}const g=e instanceof zu&&this.options.box,x=e instanceof Jy&&this.options.polygon;if((g||x)&&!e.props.className&&!e.props.html&&!e.props.href){if(e.props.style){const m=Object.assign({},e.props.style||{},e.hovering?e.props.hoverStyles:{},e.pressing?e.props.pressStyles:{}),w=e.props.relativeStyle?1:c/e.width;typeof m.opacity<"u"&&(this.ctx.globalAlpha=m.opacity);let A=0;typeof m.borderWidth<"u"&&(A=parseInt(m.borderWidth,10)*w);let P=0;typeof m.outlineWidth<"u"&&(P=parseInt(m.outlineWidth,10)*w);let M=0;if(typeof m.outlineOffset<"u"&&(M=parseInt(m.outlineOffset,10)*w),m.borderColor&&(this.ctx.strokeStyle=m.borderColor),m.boxShadow){const _=m.boxShadow.split(/,(?![^(]*\))/);for(const L of _){const k=t0[L]||e0.exec(L)||e0.exec(L);t0[L]=k,k&&(this.ctx.save(),this.ctx.shadowOffsetX=parseInt(k[1])*this.dpi*w,this.ctx.shadowOffsetY=parseInt(k[3])*this.dpi*w,this.ctx.shadowBlur=parseInt(k[5])*this.dpi*w,this.ctx.shadowColor=k[9],this.ctx.fillStyle="rgba(0,0,0,1)",this.ctx.fillRect(r+A,o+A,c,h),this.ctx.restore())}}if(this.ctx.fillStyle=m.backgroundColor||"transparent",this.ctx.lineWidth=A,x){const _=e.shape,L=_.points||[],k=L.length;this.ctx.beginPath();for(let O=0;O<k;O++)this.ctx.lineTo(r+L[O][0]*this.lastKnownScale,o+L[O][1]*this.lastKnownScale);_.open||this.ctx.closePath(),A&&this.ctx.stroke(),_.open||this.ctx.fill()}else A&&this.ctx.strokeRect(r+A/2,o+A/2,c+A,h+A),this.ctx.fillRect(r+A,o+A,c,h);P&&(m.outlineColor&&(this.ctx.strokeStyle=m.outlineColor),this.ctx.lineWidth=P,this.ctx.strokeRect(r-P/2-M,o-P/2-M,c+A*2+P+M*2,h+A*2+P+M*2))}this.ctx.globalAlpha=v}}loadImage(e,n,r,o=!1){if(qf[e]&&qf[e].naturalWidth>0){n(qf[e]);return}try{let c=!1;o||setTimeout(()=>{c||this.loadImage(e,n,r,!0)},3e3);const h=document.createElement("img");h.decoding="auto",h.onload=function(){c=!0,n(h),qf[e]=h,h.onload=null},this.options.crossOrigin&&(h.crossOrigin="anonymous"),h.src=e,h.complete&&h.onload({}),h.width}catch(c){console.log("image error",c),r(c)}}schedulePaintToCanvas(e,n,r,o){this.imagesPending++,e.indices.push(r);const c=`${n.id}--${n.display.scale}-${r}`,h=this.invalidated.indexOf(c);h!==-1&&this.invalidated.splice(h,1),e.canvases[r]=c,n.__host.canvas.loading=!0,this.loadingQueueOrdered=!1,this.loadingQueue.push({id:c,scale:n.display.scale,network:!0,distance:o,task:()=>new Promise(v=>{if(this.visible.indexOf(n)===-1){this.imagesPending--,e.indices.splice(e.indices.indexOf(r),1),v();return}const g=n.getImageUrl(r);this.loadImage(g,x=>{this.loadingQueue.push({id:c,scale:n.display.scale,distance:o,task:()=>new Promise(m=>{this.imagesLoaded++,e.loaded.push(r),e.loaded.length===e.indices.length&&(e.loading=!1);const w=n.display.points.slice(r*5,r*5+5),A=document.createElement("canvas"),P=A.getContext("2d");A.width=w[3]-w[1],A.height=w[4]-w[2],this.hostCache.set(e.canvases[r],A),this.drawCalls.push(()=>{P.drawImage(x,0,0,w[3]-w[1],w[4]-w[2]),m()})})}),v()},x=>{this.imagesPending--,e.indices.splice(e.indices.indexOf(r),1),v()})})})}afterPaintLayer(e,n){}prepareLayer(e,n){e.__owner.value&&(e.cropData?(this.lastKnownScale*(1/e.display.scale),this.applyTransform(e,n[1],n[2],n[3]-n[1],n[4]-n[2])):this.applyTransform(e,n[1],n[2],n[3]-n[1],n[4]-n[2])),(!e.__host||!e.__host.canvas)&&(e instanceof xr||e instanceof ja)&&this.createImageHost(e)}finishLayer(){this.lastPaintedObject&&this.clearTransform()}createImageHost(e){e.__host=e.__host?e.__host:{},e.__host.canvas={canvas:void 0,canvases:[],indices:[],loaded:[],loading:!1}}getPointsAt(e,n,r,o){return e.getPointsAt(n,r,o)}getViewportBounds(e,n,r){const o=e.getActiveZone();if(o){const c=n[3]-n[1]<o.points[3]-o.points[1],h=n[4]-n[2]<o.points[4]-o.points[2];return{x1:c?o.points[1]-r:o.points[1]+(o.points[3]-o.points[1])/2-(n[3]-n[1])/2,y1:h?o.points[2]-r:o.points[2]+(o.points[4]-o.points[2])/2-(n[4]-n[2])/2,x2:c?o.points[3]+r:o.points[1]+(o.points[3]-o.points[1])/2-(n[3]-n[1])/2,y2:h?o.points[4]+r:o.points[2]+(o.points[4]-o.points[2])/2-(n[4]-n[2])/2}}return null}pendingUpdate(){const e=!this.pendingDrawCall&&this.drawCalls.length===0&&this.imagesPending===0&&this.loadingQueue.length===0&&this.tasksRunning===0;return!this.firstMeaningfulPaint&&e?(this.canvas.style.opacity="1",this.firstMeaningfulPaint=e,!0):this.options.debug?!0:!e}getRendererScreenPosition(){return this.rendererPosition}reset(){this.loadingQueue=[],this.drawCalls=[]}}class n0{constructor(e){this.renderers=[];for(const n of e)n&&this.renderers.push(n);this.length=this.renderers.length}afterFrame(e,n,r){for(let o=0;o<this.length;o++)this.renderers[o].afterFrame(e,n,r)}afterPaintLayer(e,n){for(let r=0;r<this.length;r++)this.renderers[r].afterPaintLayer(e,n)}beforeFrame(e,n,r){for(let o=0;o<this.length;o++)this.renderers[o].beforeFrame(e,n,r)}triggerResize(){for(let e=0;e<this.length;e++){const n=this.renderers[e];n.triggerResize&&n.triggerResize()}}getPointsAt(e,n,r,o){return this.renderers[0].getPointsAt(e,n,r,o)}getScale(e,n){return this.renderers[0].getScale(e,n)}getViewportBounds(e,n,r){return this.renderers[0].getViewportBounds(e,n,r)}getRendererScreenPosition(){return this.renderers[0].getRendererScreenPosition()}isReady(){for(let e=0;e<this.length;e++)if(!this.renderers[e].isReady())return!1;return!0}paint(e,n,r,o,c,h){for(let v=0;v<this.length;v++)this.renderers[v].paint(e,n,r,o,c,h)}pendingUpdate(){for(let e=0;e<this.length;e++)if(this.renderers[e].pendingUpdate())return!0;return!1}prepareLayer(e,n){for(let r=0;r<this.length;r++)this.renderers[r].prepareLayer(e,n)}finishLayer(e,n){for(let r=0;r<this.length;r++)this.renderers[r].finishLayer(e,n)}resize(e,n){for(let r=0;r<this.length;r++)this.renderers[r].resize(e,n)}reset(){for(let e=0;e<this.length;e++)this.renderers[e].reset()}}class zC{constructor(e){this.heightRatio=1,this.widthRatio=1,this.target=new Float32Array(5),this.delta=0,this.renderNextFrame=!0,this.canvas=e,this.initialWidth=e.width,this.initialHeight=e.height,this.context=e.getContext("2d"),this.context.globalAlpha=.5,this.aggregate=Ys(1)}isReady(){return!0}resize(){this.initialWidth=this.canvas.width,this.initialHeight=this.canvas.height,this.renderNextFrame=!0}afterFrame(e,n,r){if(this.renderNextFrame){this.context.clearRect(0,0,this.canvas.width,this.canvas.height);const o=this.initialWidth/e.width,c=this.initialHeight/e.height,h=this.widthRatio>this.heightRatio?o:c;if(this.target=r,this.bounds){const v=e.getPointsAt(this.bounds,this.aggregate,h);for(const[g,x]of v)if(g instanceof xr&&g.__host.canvas){const m=x.length/5;for(let w=0;w<m;w++)g.__host.canvas.canvases[w]&&(x[w+1]*h,x[w+2]*h,(x[w+3]-x[w+1])*h,(x[w+4]-x[w+2])*h)}}e.getPoints().forEach((v,g,x)=>{if(g%5===0&&v){const m={x1:x[g+1]*h,y1:x[g+2]*h,x2:x[g+3]*h,y2:x[g+4]*h,width:(x[g+3]-x[g+1])*h,height:(x[g+4]-x[g+2])*h};this.context.strokeStyle="red",this.context.strokeRect(m.x1,m.y1,m.width,m.height)}}),r&&(this.context.strokeStyle="red",this.context.lineWidth=window.devicePixelRatio||1,this.context.strokeRect(r[1]*h,r[2]*h,(r[3]-r[1])*h,(r[4]-r[2])*h))}}getActiveZone(e){return null}getPointsAt(e,n,r,o){return e.getPointsAt(n,r,o)}getScale(e,n){return 1}beforeFrame(e,n){this.bounds=wt.singleBox(e.width,e.height)}drawImage(){}afterPaintLayer(e,n){}paint(e,n,r,o,c,h){this.renderNextFrame=!0}prepareLayer(e){}pendingUpdate(){return!1}hasActiveZone(){return!1}getViewportBounds(e,n,r){return null}getRendererScreenPosition(){return this.canvas.getBoundingClientRect()}finishLayer(){}reset(){}}var i0=!1,Fa,xp,Ep,Yf,Qf,r0,Gf,wp,Tp,Cp,s0,Rp,Ap,a0,o0;function Pi(){if(!i0){i0=!0;var t=navigator.userAgent,e=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(t),n=/(Mac OS X)|(Windows)|(Linux)/.exec(t);if(Rp=/\b(iPhone|iP[ao]d)/.exec(t),Ap=/\b(iP[ao]d)/.exec(t),Cp=/Android/i.exec(t),a0=/FBAN\/\w+;/i.exec(t),o0=/Mobile/i.exec(t),s0=!!/Win64/.exec(t),e){Fa=e[1]?parseFloat(e[1]):e[5]?parseFloat(e[5]):NaN,Fa&&document&&document.documentMode&&(Fa=document.documentMode);var r=/(?:Trident\/(\d+.\d+))/.exec(t);r0=r?parseFloat(r[1])+4:Fa,xp=e[2]?parseFloat(e[2]):NaN,Ep=e[3]?parseFloat(e[3]):NaN,Yf=e[4]?parseFloat(e[4]):NaN,Yf?(e=/(?:Chrome\/(\d+\.\d+))/.exec(t),Qf=e&&e[1]?parseFloat(e[1]):NaN):Qf=NaN}else Fa=xp=Ep=Qf=Yf=NaN;if(n){if(n[1]){var o=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(t);Gf=o?parseFloat(o[1].replace("_",".")):!0}else Gf=!1;wp=!!n[2],Tp=!!n[3]}else Gf=wp=Tp=!1}}var Mp={ie:function(){return Pi()||Fa},ieCompatibilityMode:function(){return Pi()||r0>Fa},ie64:function(){return Mp.ie()&&s0},firefox:function(){return Pi()||xp},opera:function(){return Pi()||Ep},webkit:function(){return Pi()||Yf},safari:function(){return Mp.webkit()},chrome:function(){return Pi()||Qf},windows:function(){return Pi()||wp},osx:function(){return Pi()||Gf},linux:function(){return Pi()||Tp},iphone:function(){return Pi()||Rp},mobile:function(){return Pi()||Rp||Ap||Cp||o0},nativeApp:function(){return Pi()||a0},android:function(){return Pi()||Cp},ipad:function(){return Pi()||Ap}},NC=Mp,Xf=!!(typeof window<"u"&&window.document&&window.document.createElement),_C={canUseDOM:Xf,canUseWorkers:typeof Worker<"u",canUseEventListeners:Xf&&!!(window.addEventListener||window.attachEvent),canUseViewport:Xf&&!!window.screen,isInWorker:!Xf},UC=_C,l0=UC,u0;l0.canUseDOM&&(u0=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0);/**
|
|
214
214
|
* Checks if an event is supported in the current execution environment.
|
|
215
215
|
*
|
|
216
216
|
* NOTE: This will not work correctly for non-generic events such as `change`,
|
|
@@ -223,7 +223,7 @@ No matching component was found for:
|
|
|
223
223
|
* @return {boolean} True if the event is supported.
|
|
224
224
|
* @internal
|
|
225
225
|
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
|
226
|
-
*/function JA(t,e){if(!h1.canUseDOM||e&&!("addEventListener"in document))return!1;var n="on"+t,i=n in document;if(!i){var a=document.createElement("div");a.setAttribute(n,"return;"),i=typeof a[n]=="function"}return!i&&p1&&t==="wheel"&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}var eM=JA,tM=XA,nM=eM,v1=10,m1=40,g1=800;function y1(t){var e=0,n=0,i=0,a=0;return"detail"in t&&(n=t.detail),"wheelDelta"in t&&(n=-t.wheelDelta/120),"wheelDeltaY"in t&&(n=-t.wheelDeltaY/120),"wheelDeltaX"in t&&(e=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(e=n,n=0),i=e*v1,a=n*v1,"deltaY"in t&&(a=t.deltaY),"deltaX"in t&&(i=t.deltaX),(i||a)&&t.deltaMode&&(t.deltaMode==1?(i*=m1,a*=m1):(i*=g1,a*=g1)),i&&!e&&(e=i<1?-1:1),a&&!n&&(n=a<1?-1:1),{spinX:e,spinY:n,pixelX:i,pixelY:a}}y1.getEventType=function(){return tM.firefox()?"DOMMouseScroll":nM("wheel")?"wheel":"mousewheel"};var iM=y1,rM=iM;function sM(t){return{x:t[1],y:t[2],width:t[3]-t[1],height:t[4]-t[2]}}const aM={zoomOutFactor:.8,zoomInFactor:1.25,maxZoomFactor:1,minZoomFactor:.05,zoomDuration:300,zoomWheelConstant:20,zoomClamp:.6,panBounceStiffness:120,panBounceDamping:15,panTimeConstant:240,panPower:.1,nudgeDistance:100,panPadding:0,devicePixelRatio:1,enableWheel:!0,enableClickToZoom:!1,onPanInSketchMode:()=>{}},S1=(t={})=>({start:function(e){const{zoomWheelConstant:n,enableWheel:i,enableClickToZoom:a}={...aM,...t},u={pointerStart:{x:0,y:0},isPressing:!1,mousemoveBuffer:qe(5),multiTouch:{distance:0}};e.world.activatedEvents.push("onMouseUp","onMouseDown","onMouseMove","onTouchStart","onTouchEnd","onTouchMove","onPointerUp","onPointerDown","onPointerMove");function f(){e.world.constraintBounds(),S=0}function p(L){if(L.which>1){u.isPressing=!1;return}e.mode==="explore"&&(L.preventDefault(),u.pointerStart.x=L.atlas.x,u.pointerStart.y=L.atlas.y,e.transitionManager.stopTransition(),u.isPressing=!0)}function g(){u.isPressing&&(e.mode==="explore"&&e.world.constraintBounds(),u.isPressing=!1)}let S=0;function m(L){if(e.mode==="explore"){if(L.atlasTouches.length===1&&(L.preventDefault(),u.pointerStart.x=L.atlasTouches[0].x,u.pointerStart.y=L.atlasTouches[0].y),L.atlasTouches.length===2){L.preventDefault();const P=L.atlasTouches[0].x,O=L.atlasTouches[1].x;u.pointerStart.x=(P+O)/2;const j=L.atlasTouches[0].y,q=L.atlasTouches[1].y;u.pointerStart.y=(j+q)/2,S=Gf({x:L.touches[0].clientX,y:L.touches[0].clientY},{x:L.touches[1].clientX,y:L.touches[1].clientY})}e.transitionManager.stopTransition(),u.isPressing=!0}}function x(L){let P=null,O=null,j=0;if(u.isPressing&&L.touches.length===2){const q=L.touches[0].clientX,ee=L.touches[1].clientX;P=(q+ee)/2;const H=L.touches[0].clientY,Z=L.touches[1].clientY;O=(H+Z)/2,j=Gf({x:L.touches[0].clientX,y:L.touches[0].clientY},{x:L.touches[1].clientX,y:L.touches[1].clientY})}if(u.isPressing&&L.touches.length===1){const q=L.touches[0];P=q.clientX,O=q.clientY}if(P!==null&&O!==null){const q=e.getRendererScreenPosition();if(q){const{x:ee,y:H}=e.viewerToWorld(P-q.x,O-q.y),Z=j&&S?j/S:1;e.transitionManager.customTransition(ie=>{ie.from=qe(e.target),ie.to=ws(ie.from,xs(Ei(u.pointerStart.x-ee,u.pointerStart.y-H),tc(1/Z,ee,H)),u.mousemoveBuffer),ie.elapsed_time=0,ie.total_time=0,ie.timingFunction=la.easeInOutExpo,ie.done=!1})}S=j}}function R(L){if(u.isPressing){const P=e.getRendererScreenPosition();if(P){const{x:O,y:j}=e.viewerToWorld(L.clientX-P.x,L.clientY-P.y);e.transitionManager.customTransition(q=>{q.from=qe(e.target),q.to=ws(q.from,Ei(u.pointerStart.x-O,u.pointerStart.y-j),u.mousemoveBuffer),q.elapsed_time=0,q.total_time=0,q.timingFunction=la.easeInOutExpo,q.done=!1})}}}function _(L){e.mode==="explore"&&e.world.zoomIn(L.atlas)}function M(L){const O=1+rM(L).spinY/n;e.world.zoomTo(O,L.atlas,!0)}e.world.addEventListener("mouseup",f),e.world.addEventListener("touchend",f),e.world.addEventListener("touchstart",m),e.world.addEventListener("mousedown",p),window.addEventListener("touchend",g),window.addEventListener("mouseup",g),window.addEventListener("mousemove",R),window.addEventListener("touchmove",x),a&&(e.world.activatedEvents.push("onClick"),e.world.addEventListener("click",_)),i&&(e.world.activatedEvents.push("onWheel"),e.world.addEventListener("wheel",M));const k=e.world.addLayoutSubscriber((L,P)=>{if(L==="zone-changed"&&e.transitionManager.constrainBounds({transition:{duration:0}}),L==="zoom-to"&&P&&e.transitionManager.zoomTo(P.factor,{origin:P.point,stream:P.stream}),L==="go-home"){const O=P.immediate?{duration:0}:void 0;e.transitionManager.goToRegion(sM(e.homePosition),{transition:O})}if(L==="goto-region"&&P){const O=P.immediate?{duration:0}:{};e.transitionManager.goToRegion(P,{transition:O})}L==="constrain-bounds"&&e.transitionManager.constrainBounds({transition:P!=null&&P.immediate?{duration:0}:void 0})});return()=>{e.world.removeEventListener("mouseup",f),e.world.removeEventListener("touchend",f),e.world.removeEventListener("touchstart",m),e.world.removeEventListener("mousedown",p),window.removeEventListener("touchend",g),window.removeEventListener("mouseup",g),e.world.removeEventListener("mousemove",R),e.world.removeEventListener("touchmove",R),a&&e.world.removeEventListener("click",_),i&&e.world.removeEventListener("wheel",M),k()}},updatePosition(){}}),Od=T.createContext("explore"),oM=()=>T.useContext(Od);function lv(t,e,n){var i,a,u,f,p;e==null&&(e=100);function g(){var m=Date.now()-f;m<e&&m>=0?i=setTimeout(g,e-m):(i=null,n||(p=t.apply(u,a),u=a=null))}var S=function(){u=this,a=arguments,f=Date.now();var m=n&&!i;return i||(i=setTimeout(g,e)),m&&(p=t.apply(u,a),u=a=null),p};return S.clear=function(){i&&(clearTimeout(i),i=null)},S.flush=function(){i&&(p=t.apply(u,a),u=a=null,clearTimeout(i),i=null)},S}lv.debounce=lv;var b1=lv;function E1(t){let{debounce:e,scroll:n,polyfill:i,offsetSize:a}=t===void 0?{debounce:0,scroll:!1,offsetSize:!1}:t;const u=i||(typeof window>"u"?class{}:window.ResizeObserver);if(!u)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[f,p]=T.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),g=T.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:f}),S=e?typeof e=="number"?e:e.scroll:null,m=e?typeof e=="number"?e:e.resize:null,x=T.useRef(!1);T.useEffect(()=>(x.current=!0,()=>void(x.current=!1)));const[R,_,M]=T.useMemo(()=>{const O=()=>{if(!g.current.element)return;const{left:j,top:q,width:ee,height:H,bottom:Z,right:ie,x:W,y:re}=g.current.element.getBoundingClientRect(),ge={left:j,top:q,width:ee,height:H,bottom:Z,right:ie,x:W,y:re};g.current.element instanceof HTMLElement&&a&&(ge.height=g.current.element.offsetHeight,ge.width=g.current.element.offsetWidth),Object.freeze(ge),x.current&&!fM(g.current.lastBounds,ge)&&p(g.current.lastBounds=ge)};return[O,m?b1(O,m):O,S?b1(O,S):O]},[p,a,S,m]);function k(){g.current.scrollContainers&&(g.current.scrollContainers.forEach(O=>O.removeEventListener("scroll",M,!0)),g.current.scrollContainers=null),g.current.resizeObserver&&(g.current.resizeObserver.disconnect(),g.current.resizeObserver=null)}function L(){g.current.element&&(g.current.resizeObserver=new u(M),g.current.resizeObserver.observe(g.current.element),n&&g.current.scrollContainers&&g.current.scrollContainers.forEach(O=>O.addEventListener("scroll",M,{capture:!0,passive:!0})))}const P=O=>{!O||O===g.current.element||(k(),g.current.element=O,g.current.scrollContainers=x1(O),L())};return uM(M,!!n),lM(_),T.useEffect(()=>{k(),L()},[n,M,_]),T.useEffect(()=>k,[]),[P,f,R]}function lM(t){T.useEffect(()=>{const e=t;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[t])}function uM(t,e){T.useEffect(()=>{if(e){const n=t;return window.addEventListener("scroll",n,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",n,!0)}},[t,e])}function x1(t){const e=[];if(!t||t===document.body)return e;const{overflow:n,overflowX:i,overflowY:a}=window.getComputedStyle(t);return[n,i,a].some(u=>u==="auto"||u==="scroll")&&e.push(t),[...e,...x1(t.parentElement)]}const cM=["x","y","top","bottom","left","right","width","height"],fM=(t,e)=>cM.every(n=>t[n]===e[n]),uv=T.createContext(null),cv=T.createContext(null);let _d;if(typeof performance=="object"&&typeof performance.now=="function"){const t=performance;_d=()=>t.now()}else{const t=Date,e=t.now();_d=()=>t.now()-e}function w1(t,e){t&&t.appendChild&&e&&t.appendChild(e)}function C1(t,e){t&&t.removeChild&&e&&t.removeChild(e)}function dM(t,e){return C1(t.world,e)}function hM(t,e,n){return T1(t.world,e,n)}function T1(t,e,n){t&&t instanceof yd&&(t=t.world),t&&t.insertBefore&&t.insertBefore(e,n)}function R1(t,e,n){if(n&&(t.applyProps&&t.applyProps(n),t instanceof Gr))for(const i of Yf){const a=i.slice(2).toLowerCase();n[i]!==e[i]&&(e[i]&&t.removeEventListener(a,e[i]),t.addEventListener(a,n[i]))}}function A1(t,e){const n=Object.keys(e);let i=!1;for(const a of n)if(Yf.indexOf(a)!==-1){const u=Rl[a];if(u){if(t.activatedEvents.indexOf(u)!==-1)continue;i=!0,t.activatedEvents.push(u)}}i&&t.triggerEventActivation()}const Ld=new Map,M1={};function pM(t,{args:e=[],...n},i,a,u){if(!(i instanceof yd)&&u){const g=S=>S.return?g(S.return):S.stateNode&&S.stateNode.containerInfo;i=g(u)}let f,p=i.world;switch(t){case"world":f=Il.withProps({width:n.width,height:n.height,viewingDirection:"left-to-right"}),f.activatedEvents=p.activatedEvents,f.eventHandlers=p.eventHandlers,f.subscriptions=p.subscriptions,f.triggerEventActivation(),p=f;break;case"box":f=new uc;break;case"shape":f=new r1;break;case"worldObject":case"world-object":f=new lc;break;case"worldImage":case"world-image":f=new Ar;break;case"texture":f=new kp;break;case"compositeImage":case"composite-image":f=new jA({id:n.id,width:n.width,height:n.height,images:[]});break;case"tiledImage":case"tiled-image":f=no.fromTile(n.uri,n.display,n.tile,n.scaleFactor,void 0,n.format);break;case"paragraph":f=new hd,f.text=n.children;break;default:return}return A1(p,n),R1(f,{},n),f}function vM(t,e){if(e instanceof Il)t.world=e;else if(e instanceof lc)t.world.appendChild(e);else if(e)throw new Error("Invalid root")}const hc=hC({unstable_now:_d,now:_d,createInstance:pM,removeChild:C1,appendChild:w1,appendInitialChild:w1,insertBefore:T1,warnsIfNotActing:!0,supportsMutation:!0,isPrimaryRenderer:!1,scheduleTimeout:typeof setTimeout<"u"?setTimeout:void 0,cancelTimeout:typeof clearTimeout<"u"?clearTimeout:void 0,setTimeout:typeof setTimeout<"u"?setTimeout:void 0,clearTimeout:typeof clearTimeout<"u"?clearTimeout:void 0,noTimeout:-1,appendChildToContainer:vM,removeChildFromContainer:dM,createTextInstance(){},insertInContainerBefore:hM,prepareUpdate(t,e,n,i,a){return A1(a.world,i),i},commitUpdate(t,e,n,i,a,u){t.applyProps&&e&&R1(t,i,e)},finalizeInitialChildren(t){return t==null?void 0:t.__handlers},getChildHostContext(){return M1},getRootHostContext(){return M1},prepareForCommit(t){return t.isCommitting=!0,null},preparePortalMount(){},hideInstance(t){t&&t.points&&(t.points[0]=0)},unhideInstance(t,e){t&&t.points&&(t.points[0]=1)},getPublicInstance(t){return t},hideTextInstance(){throw new Error("Text is not allowed in the react-three-fibre tree. You may have extraneous whitespace between components.")},resetAfterCommit(t){t.isCommitting=!1,t.pendingUpdate=!0,t.world&&t.world.needsRecalculate&&(t.world.recalculateWorldSize(),t.world.triggerRepaint())},shouldSetTextContent(){return!1},clearContainer(){return!1}});hc.injectIntoDevTools({bundleType:0,version:T.version,rendererPackageName:"@atlas-viewer/atlas"});function O1(t,e){const n=Ld.get(t);n&&hc.updateContainer(null,n,null,()=>{Ld.delete(t),e&&e(t)})}const mM={render(t,e){const n=Ld.get(e);if(n)hc.updateContainer(t,n,null,()=>{});else{const i=hc.createContainer(e,0,null,!1,null,"",()=>{},null);hc.updateContainer(t,i,null,null),Ld.set(e,i)}}},gM=T.memo(({children:t,setIsReady:e,onCreated:n,bounds:i,preset:a,mode:u="explore"})=>{const f=T.useCallback(function(g){const S=()=>{e(!0)};return T.useEffect(()=>{if(a){a.runtime.goHome();const m=n&&n(a);return void(m&&m.then?m.then(S):S())}return()=>{}},[]),g.children},[a]);return T.useLayoutEffect(()=>{if(a){const p=a.runtime;u!==p.mode&&(p.mode=u),mM.render(T.createElement(T.StrictMode,null,T.createElement(f,null,T.createElement(cv.Provider,{value:i},T.createElement(Od.Provider,{value:u},T.createElement(uv.Provider,{value:a},t))))),p)}},[a,u,t]),null});class yM{constructor(e,n){this.fragmentShaderSource=`
|
|
226
|
+
*/function jC(t,e){if(!l0.canUseDOM||e&&!("addEventListener"in document))return!1;var n="on"+t,r=n in document;if(!r){var o=document.createElement("div");o.setAttribute(n,"return;"),r=typeof o[n]=="function"}return!r&&u0&&t==="wheel"&&(r=document.implementation.hasFeature("Events.wheel","3.0")),r}var IC=jC,FC=NC,BC=IC,c0=10,f0=40,d0=800;function h0(t){var e=0,n=0,r=0,o=0;return"detail"in t&&(n=t.detail),"wheelDelta"in t&&(n=-t.wheelDelta/120),"wheelDeltaY"in t&&(n=-t.wheelDeltaY/120),"wheelDeltaX"in t&&(e=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(e=n,n=0),r=e*c0,o=n*c0,"deltaY"in t&&(o=t.deltaY),"deltaX"in t&&(r=t.deltaX),(r||o)&&t.deltaMode&&(t.deltaMode==1?(r*=f0,o*=f0):(r*=d0,o*=d0)),r&&!e&&(e=r<1?-1:1),o&&!n&&(n=o<1?-1:1),{spinX:e,spinY:n,pixelX:r,pixelY:o}}h0.getEventType=function(){return FC.firefox()?"DOMMouseScroll":BC("wheel")?"wheel":"mousewheel"};var HC=h0,VC=HC;function WC(t){return{x:t[1],y:t[2],width:t[3]-t[1],height:t[4]-t[2]}}const $C={zoomOutFactor:.8,zoomInFactor:1.25,maxZoomFactor:1,minZoomFactor:.05,zoomDuration:300,zoomWheelConstant:20,zoomClamp:.6,panBounceStiffness:120,panBounceDamping:15,panTimeConstant:240,panPower:.1,nudgeDistance:100,panPadding:0,devicePixelRatio:1,enableWheel:!0,enableClickToZoom:!1,onPanInSketchMode:()=>{}},p0=(t={})=>({start:function(e){const{zoomWheelConstant:n,enableWheel:r,enableClickToZoom:o}={...$C,...t},c={pointerStart:{x:0,y:0},isPressing:!1,mousemoveBuffer:We(5),multiTouch:{distance:0}};e.world.activatedEvents.push("onMouseUp","onMouseDown","onMouseMove","onTouchStart","onTouchEnd","onTouchMove","onPointerUp","onPointerDown","onPointerMove");function h(){e.world.constraintBounds(),x=0}function v(L){if(L.which>1){c.isPressing=!1;return}e.mode==="explore"&&(L.preventDefault(),c.pointerStart.x=L.atlas.x,c.pointerStart.y=L.atlas.y,e.transitionManager.stopTransition(),c.isPressing=!0)}function g(){c.isPressing&&(e.mode==="explore"&&e.world.constraintBounds(),c.isPressing=!1)}let x=0;function m(L){if(e.mode==="explore"){if(L.atlasTouches.length===1&&(L.preventDefault(),c.pointerStart.x=L.atlasTouches[0].x,c.pointerStart.y=L.atlasTouches[0].y),L.atlasTouches.length===2){L.preventDefault();const k=L.atlasTouches[0].x,O=L.atlasTouches[1].x;c.pointerStart.x=(k+O)/2;const I=L.atlasTouches[0].y,q=L.atlasTouches[1].y;c.pointerStart.y=(I+q)/2,x=gf({x:L.touches[0].clientX,y:L.touches[0].clientY},{x:L.touches[1].clientX,y:L.touches[1].clientY})}e.transitionManager.stopTransition(),c.isPressing=!0}}function w(L){let k=null,O=null,I=0;if(c.isPressing&&L.touches.length===2){const q=L.touches[0].clientX,te=L.touches[1].clientX;k=(q+te)/2;const H=L.touches[0].clientY,J=L.touches[1].clientY;O=(H+J)/2,I=gf({x:L.touches[0].clientX,y:L.touches[0].clientY},{x:L.touches[1].clientX,y:L.touches[1].clientY})}if(c.isPressing&&L.touches.length===1){const q=L.touches[0];k=q.clientX,O=q.clientY}if(k!==null&&O!==null){const q=e.getRendererScreenPosition();if(q){const{x:te,y:H}=e.viewerToWorld(k-q.x,O-q.y),J=I&&x?I/x:1;e.transitionManager.customTransition(re=>{re.from=We(e.target),re.to=vs(re.from,ps(mi(c.pointerStart.x-te,c.pointerStart.y-H),Ru(1/J,te,H)),c.mousemoveBuffer),re.elapsed_time=0,re.total_time=0,re.timingFunction=Ks.easeInOutExpo,re.done=!1})}x=I}}function A(L){if(c.isPressing){const k=e.getRendererScreenPosition();if(k){const{x:O,y:I}=e.viewerToWorld(L.clientX-k.x,L.clientY-k.y);e.transitionManager.customTransition(q=>{q.from=We(e.target),q.to=vs(q.from,mi(c.pointerStart.x-O,c.pointerStart.y-I),c.mousemoveBuffer),q.elapsed_time=0,q.total_time=0,q.timingFunction=Ks.easeInOutExpo,q.done=!1})}}}function P(L){e.mode==="explore"&&e.world.zoomIn(L.atlas)}function M(L){const O=1+VC(L).spinY/n;e.world.zoomTo(O,L.atlas,!0)}e.world.addEventListener("mouseup",h),e.world.addEventListener("touchend",h),e.world.addEventListener("touchstart",m),e.world.addEventListener("mousedown",v),window.addEventListener("touchend",g),window.addEventListener("mouseup",g),window.addEventListener("mousemove",A),window.addEventListener("touchmove",w),o&&(e.world.activatedEvents.push("onClick"),e.world.addEventListener("click",P)),r&&(e.world.activatedEvents.push("onWheel"),e.world.addEventListener("wheel",M));const _=e.world.addLayoutSubscriber((L,k)=>{if(L==="zone-changed"&&e.transitionManager.constrainBounds({transition:{duration:0}}),L==="zoom-to"&&k&&e.transitionManager.zoomTo(k.factor,{origin:k.point,stream:k.stream}),L==="go-home"){const O=k.immediate?{duration:0}:void 0;e.transitionManager.goToRegion(WC(e.homePosition),{transition:O})}if(L==="goto-region"&&k){const O=k.immediate?{duration:0}:{};e.transitionManager.goToRegion(k,{transition:O})}L==="constrain-bounds"&&e.transitionManager.constrainBounds({transition:k!=null&&k.immediate?{duration:0}:void 0})});return()=>{e.world.removeEventListener("mouseup",h),e.world.removeEventListener("touchend",h),e.world.removeEventListener("touchstart",m),e.world.removeEventListener("mousedown",v),window.removeEventListener("touchend",g),window.removeEventListener("mouseup",g),e.world.removeEventListener("mousemove",A),e.world.removeEventListener("touchmove",A),o&&e.world.removeEventListener("click",P),r&&e.world.removeEventListener("wheel",M),_()}},updatePosition(){}}),ju=C.createContext("explore");ju.displayName="Mode";const qC=()=>C.useContext(ju);function Op(t,e,n){var r,o,c,h,v;e==null&&(e=100);function g(){var m=Date.now()-h;m<e&&m>=0?r=setTimeout(g,e-m):(r=null,n||(v=t.apply(c,o),c=o=null))}var x=function(){c=this,o=arguments,h=Date.now();var m=n&&!r;return r||(r=setTimeout(g,e)),m&&(v=t.apply(c,o),c=o=null),v};return x.clear=function(){r&&(clearTimeout(r),r=null)},x.flush=function(){r&&(v=t.apply(c,o),c=o=null,clearTimeout(r),r=null)},x}Op.debounce=Op;var v0=Op;function m0(t){let{debounce:e,scroll:n,polyfill:r,offsetSize:o}=t===void 0?{debounce:0,scroll:!1,offsetSize:!1}:t;const c=r||(typeof window>"u"?class{}:window.ResizeObserver);if(!c)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[h,v]=C.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),g=C.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:h}),x=e?typeof e=="number"?e:e.scroll:null,m=e?typeof e=="number"?e:e.resize:null,w=C.useRef(!1);C.useEffect(()=>(w.current=!0,()=>void(w.current=!1)));const[A,P,M]=C.useMemo(()=>{const O=()=>{if(!g.current.element)return;const{left:I,top:q,width:te,height:H,bottom:J,right:re,x:$,y:se}=g.current.element.getBoundingClientRect(),ge={left:I,top:q,width:te,height:H,bottom:J,right:re,x:$,y:se};g.current.element instanceof HTMLElement&&o&&(ge.height=g.current.element.offsetHeight,ge.width=g.current.element.offsetWidth),Object.freeze(ge),w.current&&!XC(g.current.lastBounds,ge)&&v(g.current.lastBounds=ge)};return[O,m?v0(O,m):O,x?v0(O,x):O]},[v,o,x,m]);function _(){g.current.scrollContainers&&(g.current.scrollContainers.forEach(O=>O.removeEventListener("scroll",M,!0)),g.current.scrollContainers=null),g.current.resizeObserver&&(g.current.resizeObserver.disconnect(),g.current.resizeObserver=null)}function L(){g.current.element&&(g.current.resizeObserver=new c(M),g.current.resizeObserver.observe(g.current.element),n&&g.current.scrollContainers&&g.current.scrollContainers.forEach(O=>O.addEventListener("scroll",M,{capture:!0,passive:!0})))}const k=O=>{!O||O===g.current.element||(_(),g.current.element=O,g.current.scrollContainers=g0(O),L())};return QC(M,!!n),YC(P),C.useEffect(()=>{_(),L()},[n,M,P]),C.useEffect(()=>_,[]),[k,h,A]}function YC(t){C.useEffect(()=>{const e=t;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[t])}function QC(t,e){C.useEffect(()=>{if(e){const n=t;return window.addEventListener("scroll",n,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",n,!0)}},[t,e])}function g0(t){const e=[];if(!t||t===document.body)return e;const{overflow:n,overflowX:r,overflowY:o}=window.getComputedStyle(t);return[n,r,o].some(c=>c==="auto"||c==="scroll")&&e.push(t),[...e,...g0(t.parentElement)]}const GC=["x","y","top","bottom","left","right","width","height"],XC=(t,e)=>GC.every(n=>t[n]===e[n]),Kf=C.createContext(null);Kf.displayName="Atlas";const Zf=C.createContext(null);Zf.displayName="Bounds";let Jf;if(typeof performance=="object"&&typeof performance.now=="function"){const t=performance;Jf=()=>t.now()}else{const t=Date,e=t.now();Jf=()=>t.now()-e}function y0(t,e){t&&t.appendChild&&e&&t.appendChild(e)}function S0(t,e){t&&t.removeChild&&e&&t.removeChild(e)}function KC(t,e){return S0(t.world,e)}function ZC(t,e,n){return b0(t.world,e,n)}function b0(t,e,n){t&&t instanceof Ff&&(t=t.world),t&&t.insertBefore&&t.insertBefore(e,n)}function x0(t,e,n){if(n&&(t.applyProps&&t.applyProps(n),t instanceof Hr))for(const r of vf){const o=r.slice(2).toLowerCase();n[r]!==e[r]&&(e[r]&&t.removeEventListener(o,e[r]),t.addEventListener(o,n[r]))}}function E0(t,e){const n=Object.keys(e);let r=!1;for(const o of n)if(vf.indexOf(o)!==-1){const c=tl[o];if(c){if(t.activatedEvents.indexOf(c)!==-1)continue;r=!0,t.activatedEvents.push(c)}}r&&t.triggerEventActivation()}const ed=new Map,w0={};function JC(t,{args:e=[],...n},r,o,c){if(!(r instanceof Ff)&&c){const g=x=>x.return?g(x.return):x.stateNode&&x.stateNode.containerInfo;r=g(c)}let h,v=r.world;switch(t){case"world":h=cl.withProps({width:n.width,height:n.height,viewingDirection:"left-to-right"}),h.activatedEvents=v.activatedEvents,h.eventHandlers=v.eventHandlers,h.subscriptions=v.subscriptions,h.triggerEventActivation(),v=h;break;case"box":h=new zu;break;case"shape":h=new Jy;break;case"worldObject":case"world-object":h=new ku;break;case"worldImage":case"world-image":h=new xr;break;case"texture":h=new tp;break;case"compositeImage":case"composite-image":h=new TC({id:n.id,width:n.width,height:n.height,images:[]});break;case"tiledImage":case"tiled-image":h=ja.fromTile(n.uri,n.display,n.tile,n.scaleFactor,void 0,n.format);break;case"paragraph":h=new Nf,h.text=n.children;break;default:return}return E0(v,n),x0(h,{},n),h}function eR(t,e){if(e instanceof cl)t.world=e;else if(e instanceof ku)t.world.appendChild(e);else if(e)throw new Error("Invalid root")}const Iu=Zx({unstable_now:Jf,now:Jf,createInstance:JC,removeChild:S0,appendChild:y0,appendInitialChild:y0,insertBefore:b0,warnsIfNotActing:!0,supportsMutation:!0,isPrimaryRenderer:!1,scheduleTimeout:typeof setTimeout<"u"?setTimeout:void 0,cancelTimeout:typeof clearTimeout<"u"?clearTimeout:void 0,setTimeout:typeof setTimeout<"u"?setTimeout:void 0,clearTimeout:typeof clearTimeout<"u"?clearTimeout:void 0,noTimeout:-1,appendChildToContainer:eR,removeChildFromContainer:KC,createTextInstance(){},insertInContainerBefore:ZC,prepareUpdate(t,e,n,r,o){return E0(o.world,r),r},commitUpdate(t,e,n,r,o,c){t.applyProps&&e&&x0(t,r,e)},finalizeInitialChildren(t){return t==null?void 0:t.__handlers},getChildHostContext(){return w0},getRootHostContext(){return w0},prepareForCommit(t){return t.isCommitting=!0,null},preparePortalMount(){},hideInstance(t){t&&t.points&&(t.points[0]=0)},unhideInstance(t,e){t&&t.points&&(t.points[0]=1)},getPublicInstance(t){return t},hideTextInstance(){throw new Error("Text is not allowed in the react-three-fibre tree. You may have extraneous whitespace between components.")},resetAfterCommit(t){t.isCommitting=!1,t.pendingUpdate=!0,t.world&&t.world.needsRecalculate&&(t.world.recalculateWorldSize(),t.world.triggerRepaint())},shouldSetTextContent(){return!1},clearContainer(){return!1}});Iu.injectIntoDevTools({bundleType:0,version:C.version,rendererPackageName:"@atlas-viewer/atlas"});function Dp(t,e){const n=ed.get(t);n&&Iu.updateContainer(null,n,null,()=>{ed.delete(t),e&&e(t)})}const T0={render(t,e){const n=ed.get(e);if(n)Iu.updateContainer(t,n,null,()=>{});else{const r=Iu.createContainer(e,0,null,!1,null,"",()=>{},null);Iu.updateContainer(t,r,null,null),ed.set(e,r)}},unmountComponentAtNode(t,e){Dp(t,e)}},tR=C.memo(({children:t,setIsReady:e,onCreated:n,bounds:r,preset:o,mode:c="explore"})=>{const h=C.useCallback(function(g){const x=C.useRef(!1),m=()=>{e(!0)};return C.useEffect(()=>{if(o&&!x.current){o.runtime.goHome();const w=n&&n(o);return void(w&&w.then?w.then(m):m())}return()=>{}},[]),C.useEffect(()=>{x.current=!0},[]),g.children},[o]);return C.useLayoutEffect(()=>{if(o){const v=o.runtime;c!==v.mode&&(v.mode=c),T0.render(C.createElement(C.StrictMode,null,C.createElement(h,null,C.createElement(Zf.Provider,{value:r},C.createElement(ju.Provider,{value:c},C.createElement(Kf.Provider,{value:o},t))))),v)}},[o,c,t]),C.useLayoutEffect(()=>{if(o){const v=o.runtime;return()=>{T0.unmountComponentAtNode(v)}}return()=>{}},[o]),null});class nR{constructor(e,n){this.fragmentShaderSource=`
|
|
227
227
|
precision mediump float;
|
|
228
228
|
|
|
229
229
|
uniform sampler2D u_image;
|
|
@@ -256,16 +256,16 @@ No matching component was found for:
|
|
|
256
256
|
|
|
257
257
|
v_texCoord = a_texCoord;
|
|
258
258
|
}
|
|
259
|
-
`,this.lastResize=0,this.lastKnownScale=1,this.canvas=e,this.rendererPosition=e.getBoundingClientRect(),this.gl=e.getContext("webgl2"),this.fragmentShader=this.createShader(this.gl.FRAGMENT_SHADER,this.fragmentShaderSource),this.vertexShader=this.createShader(this.gl.VERTEX_SHADER,this.vertexShaderSource),this.program=this.createProgram(this.vertexShader,this.fragmentShader),this.dpi=(n==null?void 0:n.dpi)||1,this.attributes={position:this.gl.getAttribLocation(this.program,"a_position"),texCoord:this.gl.getAttribLocation(this.program,"a_texCoord")},this.uniforms={resolution:this.gl.getUniformLocation(this.program,"u_resolution"),texture:this.gl.getUniformLocation(this.program,"u_texture")},this.buffers={position:this.createArrayBuffer(),texCoord:this.createArrayBuffer(new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]))},this.rectBuffer=new Float32Array(12),this.resize(),this.gl.viewport(0,0,this.gl.canvas.width,this.gl.canvas.height),this.gl.clearColor(0,0,0,0),this.gl.clear(this.gl.COLOR_BUFFER_BIT),this.gl.useProgram(this.program),this.gl.enableVertexAttribArray(this.attributes.position)}resize(){this.resizeCanvasToDisplaySize(),this.gl.viewport(0,0,this.gl.canvas.width,this.gl.canvas.height),this.rendererPosition=this.canvas.getBoundingClientRect()}isReady(){return!0}beforeFrame(e,n,
|
|
259
|
+
`,this.lastResize=0,this.lastKnownScale=1,this.canvas=e,this.rendererPosition=e.getBoundingClientRect(),this.gl=e.getContext("webgl2"),this.fragmentShader=this.createShader(this.gl.FRAGMENT_SHADER,this.fragmentShaderSource),this.vertexShader=this.createShader(this.gl.VERTEX_SHADER,this.vertexShaderSource),this.program=this.createProgram(this.vertexShader,this.fragmentShader),this.dpi=(n==null?void 0:n.dpi)||1,this.attributes={position:this.gl.getAttribLocation(this.program,"a_position"),texCoord:this.gl.getAttribLocation(this.program,"a_texCoord")},this.uniforms={resolution:this.gl.getUniformLocation(this.program,"u_resolution"),texture:this.gl.getUniformLocation(this.program,"u_texture")},this.buffers={position:this.createArrayBuffer(),texCoord:this.createArrayBuffer(new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]))},this.rectBuffer=new Float32Array(12),this.resize(),this.gl.viewport(0,0,this.gl.canvas.width,this.gl.canvas.height),this.gl.clearColor(0,0,0,0),this.gl.clear(this.gl.COLOR_BUFFER_BIT),this.gl.useProgram(this.program),this.gl.enableVertexAttribArray(this.attributes.position)}resize(){this.resizeCanvasToDisplaySize(),this.gl.viewport(0,0,this.gl.canvas.width,this.gl.canvas.height),this.rendererPosition=this.canvas.getBoundingClientRect()}isReady(){return!0}beforeFrame(e,n,r){this.gl.clearColor(0,0,0,0),this.gl.clear(this.gl.COLOR_BUFFER_BIT),this.gl.vertexAttribPointer(this.attributes.position,2,this.gl.FLOAT,!1,0,0),this.gl.uniform2f(this.uniforms.resolution,this.gl.canvas.width,this.gl.canvas.height),this.lastResize>1e3&&(this.lastResize=0,this.resizeCanvasToDisplaySize()),this.lastResize+=n}prepareLayer(e){(!e.__host||!e.__host.webgl)&&((e instanceof xr||e instanceof ja)&&this.createImageHost(e),e instanceof tp&&this.createTextureHost(e))}createTextureHost(e){e.__host=e.__host?e.__host:{};const n=this.gl,r=this.gl.createTexture();n.bindTexture(n.TEXTURE_2D,r),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1);let o;if(e instanceof tp){const c=e.getTexture();c.source&&n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,c.source),o=c}n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),e.__host.webgl={height:e.height,width:e.width,texture:r,lastImage:o}}createImageHost(e){const n=[...new Array(e.points.length/5)];e.__host=e.__host?e.__host:{},e.__host.webgl={height:e.height,width:e.width,textures:n,loading:[],loaded:[],lastLevelRendered:-1,onLoad:(r,o)=>{const c=this.gl,h=this.gl.createTexture();c.bindTexture(c.TEXTURE_2D,h),c.pixelStorei(c.UNPACK_FLIP_Y_WEBGL,!1),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,o),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.LINEAR),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.LINEAR),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.bindTexture(c.TEXTURE_2D,null),e.__host.webgl.textures[r]=h,e.__host.webgl.loaded.push(r)}}}paint(e,n,r,o,c,h){if(e.type==="spacial-content"&&e.__host&&e.__host.webgl){if(e.getTexture){const g=e==null?void 0:e.getTexture();if(g&&e.__host.webgl.lastImage!==g.hash&&g.source&&!e.__host.webgl.error)try{const m=this.gl.RGBA,w=this.gl.RGBA,A=this.gl.UNSIGNED_BYTE;this.gl.bindTexture(this.gl.TEXTURE_2D,e.__host.webgl.texture),this.gl.texImage2D(this.gl.TEXTURE_2D,0,m,w,A,g.source),e.__host.webgl.lastImage=g.hash}catch(x){e.__host.webgl.error=x}}if(e.__host.webgl.loading&&e.__host.webgl.loading.indexOf(n)===-1&&e.getImageUrl){e.__host.webgl.loading.push(n);const g=document.createElement("img");g.decoding="async",g.crossOrigin="anonymous",g.src=e.getImageUrl(n),g.onload=()=>(g.onload=null,e.__host.webgl.onLoad(n,g))}const v=e.__host.webgl.texture?e.__host.webgl.texture:e.__host.webgl.textures[n];v&&(this.gl.enableVertexAttribArray(this.attributes.texCoord),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.buffers.texCoord),this.gl.enableVertexAttribArray(this.attributes.texCoord),this.gl.vertexAttribPointer(this.attributes.texCoord,2,this.gl.FLOAT,!1,0,0),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.buffers.position),this.gl.enableVertexAttribArray(this.attributes.position),this.gl.vertexAttribPointer(this.attributes.position,2,this.gl.FLOAT,!1,0,0),this.gl.bindTexture(this.gl.TEXTURE_2D,v),this.gl.uniform1i(this.uniforms.texture,0),this.setRectangle(r,o,c,h),this.gl.drawArrays(this.gl.TRIANGLES,0,6))}}afterPaintLayer(e,n){}pendingUpdate(){return!0}getPointsAt(e,n,r,o){return e.getPointsAt(n,r,o)}afterFrame(){}getScale(e,n,r){if(Number.isNaN(e)||Number.isNaN(n))return this.lastKnownScale;const o=this.getCanvasDims(),c=o.width/e,h=o.height/n,v=(c<h?h:c)*(r&&this.dpi||1);return Number.isNaN(v)||(this.lastKnownScale=v),this.lastKnownScale}getCanvasDims(){return{width:this.canvas.width/this.dpi,height:this.canvas.height/this.dpi}}getViewportBounds(e,n,r){return null}createShader(e,n){const r=this.gl.createShader(e);if(r){if(this.gl.shaderSource(r,n),this.gl.compileShader(r),this.gl.getShaderParameter(r,this.gl.COMPILE_STATUS))return r;const c=this.gl.getShaderInfoLog(r);if(this.gl.deleteShader(r),c)throw new Error(c)}throw new Error("Invalid shader")}createProgram(e,n){const r=this.gl.createProgram();if(r){if(this.gl.attachShader(r,e),this.gl.attachShader(r,n),this.gl.linkProgram(r),this.gl.getProgramParameter(r,this.gl.LINK_STATUS))return r;const c=this.gl.getProgramInfoLog(r);if(this.gl.deleteProgram(r),c)throw new Error(c)}throw new Error("Invalid program")}resizeCanvasToDisplaySize(){const e=this.gl.canvas,n=e.clientWidth,r=e.clientHeight,o=e.width!==n||e.height!==r;return o&&(e.width=n,e.height=r),o}createArrayBuffer(e){const n=this.gl.createBuffer();if(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,n),e&&this.gl.bufferData(this.gl.ARRAY_BUFFER,e,this.gl.STATIC_DRAW),!n)throw new Error("Cannot create buffer");return n}setRectangle(e,n,r,o){this.gl.bufferData(this.gl.ARRAY_BUFFER,this.getRectangle(e,n,r,o),this.gl.STATIC_DRAW)}getRectangle(e,n,r,o){const c=e,h=e+r,v=n,g=n+o;return this.rectBuffer.set([c,v,h,v,c,g,c,g,h,v,h,g]),this.rectBuffer}getRendererScreenPosition(){return this.rendererPosition}finishLayer(){}reset(){}}function Lp(t,e){const n=e?t:JSON.stringify(t);let r=5381,o=n.length;for(;o;)r=r*33^n.charCodeAt(--o);const h=(r>>>0).toString(16);return h.length%2?"0"+h:h}class C0{constructor(e){this.sheetPrefix=(e==null?void 0:e.sheetPrefix)||"a-",this.$element=document.createElement("style"),this.stylesheetClasses=[],this.activeStylesheetClasses=[],this.sheetsDidUpdate=!1,this.stylesheetEntries={}}getElement(){return this.$element}addStylesheet(e){const n=e.replace(/\s\s+/g," ").replace(/: /g,":").replace(/; /g,";").trim(),r=this.sheetPrefix+Lp(n,!0);return this.stylesheetClasses.indexOf(r)!==-1||(this.stylesheetClasses.push(r),this.activeStylesheetClasses.push(r),this.stylesheetEntries[r]=n,this.sheetsDidUpdate=!0),r}removeStylesheet(e){const n=this.sheetPrefix+Lp(e,!0);this.stylesheetClasses.indexOf(n)&&(this.stylesheetClasses=this.stylesheetClasses.filter(r=>r!==n)),this.sheetsDidUpdate=!0}clearClasses(){this.activeStylesheetClasses=[]}didUpdateActive(){if(this.activeStylesheetClasses.length){for(const e of this.activeStylesheetClasses)if(this.stylesheetClasses.indexOf(e)===-1)return!0;for(const e of this.stylesheetClasses)if(this.activeStylesheetClasses.indexOf(e)===-1)return!0}return!1}updateSheet(){(this.sheetsDidUpdate||this.didUpdateActive())&&(this.$element.innerText=this.activeStylesheetClasses.map(e=>`.${e}{${this.stylesheetEntries[e]}}`).join(""),this.sheetsDidUpdate=!1,this.stylesheetClasses=[...this.activeStylesheetClasses])}}class R0{constructor(e,n){this.visible=[],this.previousVisible=[],this.htmlIds=[],this.firstMeaningfulPaint=!1,this.paintTx=1,this.zIndex=0,this.htmlContainer=e,this.htmlContainer.innerHTML="",this.rendererPosition=this.htmlContainer.getBoundingClientRect(),this.options={triggerResize:()=>{},box:!1,text:!1,sheetPrefix:"",inlineStyles:!1,background:"",...n||{}},this.stylesheet=new C0({sheetPrefix:this.options.sheetPrefix}),this.options.inlineStyles||this.htmlContainer.appendChild(this.stylesheet.getElement()),this.options.background&&this.htmlContainer.classList.add(this.stylesheet.addStylesheet(`
|
|
260
260
|
background: ${this.options.background};
|
|
261
261
|
`)),this.classes={hostClassName:this.stylesheet.addStylesheet(`
|
|
262
262
|
position: absolute;
|
|
263
263
|
transform-origin: 0px 0px;
|
|
264
|
-
`),interactive:this.stylesheet.addStylesheet("pointer-events: all"),nonInteractive:this.stylesheet.addStylesheet("pointer-events: none")},this.stylesheet.updateSheet()}createHtmlHost(e){if(this.htmlContainer&&(this.options.box||e.props.className||e.props.html||e.props.href)){const n=document.createElement(e.props.href?"a":"div");if(e.props.href){n.style.display="block",n.href=e.props.href;const i=e.props.hrefTarget||"_blank";n.target=i,i!=="_self"&&(n.rel="noopener noreferrer")}n.title=e.props.title||"",this.options.inlineStyles?(n.style.display="block",n.style.position="absolute",n.style.overflow="hidden",n.style.transformOrigin="0px 0px"):n.classList.add(this.classes.hostClassName),e.__host={element:n,revision:null,relative:!1},this.updateHtmlHost(e,e.width,e.height),e.__onCreate&&e.__onCreate()}}triggerResize(){this.options.triggerResize()}updateHtmlHost(e,n,i){if(e.__revision!==e.__host.revision){const a=e.__host.element,u=[this.classes.hostClassName];if(e.props.interactive?this.options.inlineStyles?a.style.pointerEvents="all":u.push(this.classes.interactive):this.options.inlineStyles?a.style.pointerEvents="none":u.push(this.classes.nonInteractive),e.props.href){a.style.display="block",a.href=e.props.href;const g=e.props.hrefTarget||"_blank";a.target=g,g!=="_self"?a.rel="noopener noreferrer":a.rel=""}else a.href&&a.removeAttribute("href");if(e.props.title&&(a.title=e.props.title||""),e.props.className&&(u.push(e.props.className),e.hovering&&u.push(`${e.props.className}--hover`),e.pressing&&u.push(`${e.props.className}--active`)),e.props.relativeStyle?(a.style.width=`${n||e.width}px`,a.style.height=`${i||e.height}px`):(a.style.width=`${e.width}px`,a.style.height=`${e.height}px`),e.props.style){Object.assign(a.style,e.props.style||{},e.hovering?e.props.hoverStyles||{}:{},e.pressing?e.props.pressStyles||{}:{});return}if(this.options.text&&e instanceof hd){e.text&&(a.innerText=e.text),e.backgroundColor&&(a.style.backgroundColor=e.backgroundColor),e.color&&(a.style.color=e.color),e.props.font&&(a.style.font=e.props.font),e.props.textAlign&&(a.style.textAlign=e.props.textAlign),e.__host.revision=e.__revision;const g=u.join(" ");a.className=g,a.part=g}e instanceof uc&&(this.options.box||e.props.className||e.props.html)&&(e.props.backgroundColor&&(a.style.backgroundColor=e.props.backgroundColor),e.props.border!==a.style.border&&(a.style.border=e.props.border));const p=u.join(" ");a.className=p,a.part=p}}afterFrame(e,n,i){this.stylesheet.updateSheet();for(const a of this.previousVisible)this.visible.indexOf(a)===-1&&this.htmlContainer&&a.__id&&this.htmlIds.indexOf(a.__id)!==-1&&this.htmlContainer.removeChild(a.__host.element);this.previousVisible=this.visible}afterPaintLayer(e,n){}beforeFrame(e,n,i){this.stylesheet.clearClasses(),this.paintTx++,this.zIndex=0,this.visible=[]}getPointsAt(e,n,i,a){return e.getPointsAt(n,i,a)}getScale(e,n){const i=this.rendererPosition.width/e,a=this.rendererPosition.height/n;return i<a?a:i}getViewportBounds(e,n,i){return null}isReady(){return!1}paint(e,n,i,a,u,f){if(this.zIndex++,(this.options.text&&e instanceof hd||e instanceof uc&&(this.options.box||e.props.className||e.props.html))&&e.__host.tx!==this.paintTx&&(this.visible.push(e),e.__host.tx=this.paintTx,this.htmlContainer)){this.updateHtmlHost(e,u,f);const p=u/e.width,g=e.__host.element;g.style.zIndex=`${this.zIndex}`,e.props.relativeStyle?g.style.transform=`translate(${Math.round(i)}px, ${Math.round(a)}px)`:g.style.transform=`translate(${Math.round(i)}px, ${Math.round(a)}px) scale(${p})`,this.previousVisible.indexOf(e)===-1&&this.htmlContainer.appendChild(g),this.htmlIds.indexOf(e.__id)===-1&&this.htmlIds.push(e.__id)}}pendingUpdate(){return!1}prepareLayer(e){e.__host||(e instanceof hd||e instanceof uc)&&this.createHtmlHost(e)}resize(e,n){typeof e<"u"&&typeof n<"u"&&(this.htmlContainer.style.width=`${e}px`,this.htmlContainer.style.height=`${n}px`),this.rendererPosition=this.htmlContainer.getBoundingClientRect()}getRendererScreenPosition(){return this.rendererPosition}finishLayer(){}reset(){}}const Pd=class{constructor(t,e,n){this.activatedEvents=[],this.eventHandlers=[],this.pointerMoveEvent=void 0,this.pointerEventState={isClicking:!1,isDragging:!1,isPressed:!1,mousedOver:[],itemsBeingDragged:[],mouseDownStart:{x:0,y:0},lastTouches:[]},this._realPointerMove=a=>{this.pointerMoveEvent=a},this.onWheelEvent=a=>{a.preventDefault(),this.onPointerEvent(a)},this.onTouchEvent=a=>{const u=Rl[a.type],f=[],p=a.touches.length;for(let g=0;g<p;g++){const S=a.touches.item(g);if(!S)continue;const{x:m,y:x}=this.runtime.viewerToWorld(S.clientX-this.bounds.left,S.clientY-this.bounds.top),R={id:S.identifier,x:m,y:x};f.push(R)}f.length&&this.assignToEvent(a,f[0].x,f[0].y),u!=="onTouchEnd"?(this.pointerEventState.lastTouches=f,a.atlasTouches=f,this.runtime.world.propagateTouchEvent(u,a,f)):(a.atlasTouches=[],this.runtime.world.propagateTouchEvent(u,a,this.pointerEventState.lastTouches),this.pointerEventState.lastTouches=[])},this.onPointerEvent=a=>{const u=Rl[a.type];if(u&&this.runtime.world.activatedEvents.indexOf(u)!==-1){const{x:f,y:p}=this.runtime.viewerToWorld(a.clientX-this.bounds.left,a.clientY-this.bounds.top);this.assignToEvent(a,f,p),this.runtime.world.propagatePointerEvent(u,a,f,p)}},this.onPointerDown=a=>{this.pointerEventState.isPressed=!0,this.pointerEventState.isClicking=!0,this.pointerEventState.mouseDownStart.x=a.clientX,this.pointerEventState.mouseDownStart.y=a.clientY,setTimeout(()=>{this.runtime&&(this.pointerEventState.isClicking=!1)},250),setTimeout(()=>{if(this.runtime&&this.pointerEventState.isPressed&&!this.pointerEventState.isDragging){const u=this.runtime.viewerToWorld(this.pointerEventState.mouseDownStart.x-this.bounds.left,this.pointerEventState.mouseDownStart.y-this.bounds.top);this.pointerEventState.isDragging=!0,this.pointerEventState.itemsBeingDragged=this.runtime.world.propagatePointerEvent("onDragStart",a,u.x,u.y)}},800),this.onPointerEvent(a)},this.onPointerUp=a=>{if(this.pointerEventState.isClicking){const{x:u,y:f}=this.runtime.viewerToWorld(a.clientX-this.bounds.left,a.clientY-this.bounds.top);this.assignToEvent(a,u,f),this.runtime.world.propagatePointerEvent("onClick",a,u,f)}if(this.pointerEventState.isDragging){for(const u of this.pointerEventState.itemsBeingDragged)u.dispatchEvent("onDragEnd",a);this.pointerEventState.isDragging=!1}this.pointerEventState.isClicking=!1,this.pointerEventState.isPressed=!1,this.pointerEventState.itemsBeingDragged=[],this.onPointerEvent(a)},this.onPointerMove=a=>{this.pointerMoveEvent=void 0;const{x:u,y:f}=this.runtime.viewerToWorld(a.clientX-this.bounds.left,a.clientY-this.bounds.top);if(Number.isNaN(u)||Number.isNaN(f))return;this.assignToEvent(a,u,f),this.runtime.world.propagatePointerEvent("onPointerMove",a,u,f);const p=this.runtime.world.propagatePointerEvent("onMouseMove",a,u,f),g=[],S=[];for(const m of p)g.push(m.id),S.push(m),this.pointerEventState.mousedOver.indexOf(m)===-1&&(m.dispatchEvent("onMouseEnter",a),m.dispatchEvent("onPointerEnter",a),m.dispatchEvent("onMouseOver",a),m.dispatchEvent("onPointerOver",a));for(const m of this.pointerEventState.mousedOver)g.indexOf(m.id)===-1&&(m.dispatchEvent("onMouseLeave",a),m.dispatchEvent("onPointerLeave",a),m.dispatchEvent("onMouseOut",a),m.dispatchEvent("onPointerOut",a));if(this.pointerEventState.isDragging)for(const m of this.pointerEventState.itemsBeingDragged)m.dispatchEvent("onDrag",a);if(this.pointerEventState.isPressed&&!this.pointerEventState.isDragging&&Gf(this.pointerEventState.mouseDownStart,{x:a.clientX,y:a.clientY})>50){const m=this.runtime.viewerToWorld(this.pointerEventState.mouseDownStart.x-this.bounds.left,this.pointerEventState.mouseDownStart.y-this.bounds.top);this.pointerEventState.isDragging=!0,this.pointerEventState.itemsBeingDragged=this.runtime.world.propagatePointerEvent("onDragStart",{...a,atlas:{x:m.x,y:m.y}},m.x,m.y)}this.pointerEventState.mousedOver=S},this.element=t,this.runtime=e,this.unsubscribe=e.world.addLayoutSubscriber(this.layoutSubscriber.bind(this)),this.bounds=t.getBoundingClientRect(),this.options={simulationRate:0,...n||{}};let i=0;e.registerHook("useFrame",a=>{i+=a,i>this.options.simulationRate&&this.pointerMoveEvent&&(i=0,e.updateNextFrame())}),e.registerHook("useBeforeFrame",()=>{this.pointerMoveEvent&&this.onPointerMove(this.pointerMoveEvent)}),this.activateEvents()}updateBounds(){this.bounds=this.element.getBoundingClientRect(),this.runtime.updateRendererScreenPosition()}layoutSubscriber(t){t==="event-activation"&&this.activateEvents()}assignToEvent(t,e,n){Pd.eventPool.atlas.x=e,Pd.eventPool.atlas.y=n,t.atlas=Pd.eventPool.atlas}activateEvents(){this.element.addEventListener("pointermove",this._realPointerMove),this.element.addEventListener("pointerup",this.onPointerUp),this.element.addEventListener("pointerdown",this.onPointerDown),this.element.addEventListener("mousedown",this.onPointerEvent),this.element.addEventListener("mouseup",this.onPointerEvent),this.element.addEventListener("pointercancel",this.onPointerEvent),this.element.addEventListener("wheel",this.onWheelEvent),this.element.addEventListener("touchstart",this.onTouchEvent),this.element.addEventListener("touchcancel",this.onTouchEvent),this.element.addEventListener("touchend",this.onTouchEvent),this.element.addEventListener("touchmove",this.onTouchEvent)}normalizeEventName(t){return t.startsWith("on")?t.slice(2).toLowerCase():t.toLowerCase()}stop(){this.unsubscribe();for(const[t,e]of this.eventHandlers)this.element.removeEventListener(this.normalizeEventName(t),e)}};let dv=Pd;dv.eventPool={atlas:{x:0,y:0}};function P1({interactive:t=!0,viewport:e,forceRefresh:n,canvasElement:i,overlayElement:a,controllerConfig:u,unstable_webglRenderer:f,dpi:p,debug:g,canvasBox:S=!0,polygon:m=!0,navigatorElement:x,background:R,runtimeOptions:_}){if(!i)throw new Error("Invalid container");i.style.userSelect="none";const M=t?S1({minZoomFactor:.5,maxZoomFactor:3,enableClickToZoom:!1,...u||{}}):void 0,k=new o1([f?new yM(i,{dpi:p}):new QA(i,{dpi:p,debug:g,box:S,polygon:m,background:R}),a?new L1(a,{box:f||!S,text:!0,triggerResize:n}):void 0,x?new GA(x):void 0]),L=new yd(k,new Il(1024,1024),e,M?[M]:[],_),P=new dv(i,L);return{name:"default-preset",em:P,runtime:L,renderer:k,controller:M,canvas:i,navigator:x,unmount(){O1(L),L.stopControllers(),L.stop(),L.reset(),P&&P.stop()}}}class SM{constructor(e,n){this.pending=!0,this.zIndex=0,this.lastKnownScale=1,this.currentlyVisible=[],this.previouslyVisible=[],this.container=e,this.rendererPosition=e.getBoundingClientRect();const{width:i,height:a}=this.rendererPosition;this.width=i,this.height=a,this.options={addPart:!1,setDraggableFalse:!1,imageClass:"",widthStylesheet:!1,sheetPrefix:"position-",background:"#000",...n||{}},this.stylesheet=new _1({sheetPrefix:this.options.sheetPrefix}),this.container.classList.add(this.stylesheet.addStylesheet(`
|
|
264
|
+
`),interactive:this.stylesheet.addStylesheet("pointer-events: all"),nonInteractive:this.stylesheet.addStylesheet("pointer-events: none")},this.stylesheet.updateSheet()}createHtmlHost(e){if(this.htmlContainer&&(this.options.box||e.props.className||e.props.html||e.props.href)){const n=document.createElement(e.props.href?"a":"div");if(e.props.href){n.style.display="block",n.href=e.props.href;const r=e.props.hrefTarget||"_blank";n.target=r,r!=="_self"&&(n.rel="noopener noreferrer")}n.title=e.props.title||"",this.options.inlineStyles?(n.style.display="block",n.style.position="absolute",n.style.overflow="hidden",n.style.transformOrigin="0px 0px"):n.classList.add(this.classes.hostClassName),e.__host={element:n,revision:null,relative:!1},this.updateHtmlHost(e,e.width,e.height),e.__onCreate&&e.__onCreate()}}triggerResize(){this.options.triggerResize()}updateHtmlHost(e,n,r){if(e.__revision!==e.__host.revision){const o=e.__host.element,c=[this.classes.hostClassName];if(e.props.interactive?this.options.inlineStyles?o.style.pointerEvents="all":c.push(this.classes.interactive):this.options.inlineStyles?o.style.pointerEvents="none":c.push(this.classes.nonInteractive),e.props.href){o.style.display="block",o.href=e.props.href;const g=e.props.hrefTarget||"_blank";o.target=g,g!=="_self"?o.rel="noopener noreferrer":o.rel=""}else o.href&&o.removeAttribute("href");if(e.props.title&&(o.title=e.props.title||""),e.props.className&&(c.push(e.props.className),e.hovering&&c.push(`${e.props.className}--hover`),e.pressing&&c.push(`${e.props.className}--active`)),e.props.relativeStyle?(o.style.width=`${n||e.width}px`,o.style.height=`${r||e.height}px`):(o.style.width=`${e.width}px`,o.style.height=`${e.height}px`),e.props.style){Object.assign(o.style,e.props.style||{},e.hovering?e.props.hoverStyles||{}:{},e.pressing?e.props.pressStyles||{}:{});return}if(this.options.text&&e instanceof Nf){e.text&&(o.innerText=e.text),e.backgroundColor&&(o.style.backgroundColor=e.backgroundColor),e.color&&(o.style.color=e.color),e.props.font&&(o.style.font=e.props.font),e.props.textAlign&&(o.style.textAlign=e.props.textAlign),e.__host.revision=e.__revision;const g=c.join(" ");o.className=g,o.part=g}e instanceof zu&&(this.options.box||e.props.className||e.props.html)&&(e.props.backgroundColor&&(o.style.backgroundColor=e.props.backgroundColor),e.props.border!==o.style.border&&(o.style.border=e.props.border));const v=c.join(" ");o.className=v,o.part=v}}afterFrame(e,n,r){this.stylesheet.updateSheet();for(const o of this.previousVisible)this.visible.indexOf(o)===-1&&this.htmlContainer&&o.__id&&this.htmlIds.indexOf(o.__id)!==-1&&this.htmlContainer.removeChild(o.__host.element);this.previousVisible=this.visible}afterPaintLayer(e,n){}beforeFrame(e,n,r){this.stylesheet.clearClasses(),this.paintTx++,this.zIndex=0,this.visible=[]}getPointsAt(e,n,r,o){return e.getPointsAt(n,r,o)}getScale(e,n){const r=this.rendererPosition.width/e,o=this.rendererPosition.height/n;return r<o?o:r}getViewportBounds(e,n,r){return null}isReady(){return!1}paint(e,n,r,o,c,h){if(this.zIndex++,(this.options.text&&e instanceof Nf||e instanceof zu&&(this.options.box||e.props.className||e.props.html))&&e.__host.tx!==this.paintTx&&(this.visible.push(e),e.__host.tx=this.paintTx,this.htmlContainer)){this.updateHtmlHost(e,c,h);const v=c/e.width,g=e.__host.element;g.style.zIndex=`${this.zIndex}`,e.props.relativeStyle?g.style.transform=`translate(${Math.round(r)}px, ${Math.round(o)}px)`:g.style.transform=`translate(${Math.round(r)}px, ${Math.round(o)}px) scale(${v})`,this.previousVisible.indexOf(e)===-1&&this.htmlContainer.appendChild(g),this.htmlIds.indexOf(e.__id)===-1&&this.htmlIds.push(e.__id)}}pendingUpdate(){return!1}prepareLayer(e){e.__host||(e instanceof Nf||e instanceof zu)&&this.createHtmlHost(e)}resize(e,n){typeof e<"u"&&typeof n<"u"&&(this.htmlContainer.style.width=`${e}px`,this.htmlContainer.style.height=`${n}px`),this.rendererPosition=this.htmlContainer.getBoundingClientRect()}getRendererScreenPosition(){return this.rendererPosition}finishLayer(){}reset(){}}const td=class{constructor(t,e,n){this.activatedEvents=[],this.eventHandlers=[],this.pointerMoveEvent=void 0,this.pointerEventState={isClicking:!1,isDragging:!1,isPressed:!1,mousedOver:[],itemsBeingDragged:[],mouseDownStart:{x:0,y:0},lastTouches:[]},this._realPointerMove=o=>{this.pointerMoveEvent=o},this.onWheelEvent=o=>{o.preventDefault(),this.onPointerEvent(o)},this.onTouchEvent=o=>{const c=tl[o.type],h=[],v=o.touches.length;for(let g=0;g<v;g++){const x=o.touches.item(g);if(!x)continue;const{x:m,y:w}=this.runtime.viewerToWorld(x.clientX-this.bounds.left,x.clientY-this.bounds.top),A={id:x.identifier,x:m,y:w};h.push(A)}h.length&&this.assignToEvent(o,h[0].x,h[0].y),c!=="onTouchEnd"?(this.pointerEventState.lastTouches=h,o.atlasTouches=h,this.runtime.world.propagateTouchEvent(c,o,h)):(o.atlasTouches=[],this.runtime.world.propagateTouchEvent(c,o,this.pointerEventState.lastTouches),this.pointerEventState.lastTouches=[])},this.onPointerEvent=o=>{const c=tl[o.type];if(c&&this.runtime.world.activatedEvents.indexOf(c)!==-1){const{x:h,y:v}=this.runtime.viewerToWorld(o.clientX-this.bounds.left,o.clientY-this.bounds.top);this.assignToEvent(o,h,v),this.runtime.world.propagatePointerEvent(c,o,h,v)}},this.onPointerDown=o=>{this.pointerEventState.isPressed=!0,this.pointerEventState.isClicking=!0,this.pointerEventState.mouseDownStart.x=o.clientX,this.pointerEventState.mouseDownStart.y=o.clientY,setTimeout(()=>{this.runtime&&(this.pointerEventState.isClicking=!1)},250),setTimeout(()=>{if(this.runtime&&this.pointerEventState.isPressed&&!this.pointerEventState.isDragging){const c=this.runtime.viewerToWorld(this.pointerEventState.mouseDownStart.x-this.bounds.left,this.pointerEventState.mouseDownStart.y-this.bounds.top);this.pointerEventState.isDragging=!0,this.pointerEventState.itemsBeingDragged=this.runtime.world.propagatePointerEvent("onDragStart",o,c.x,c.y)}},800),this.onPointerEvent(o)},this.onPointerUp=o=>{if(this.pointerEventState.isClicking){const{x:c,y:h}=this.runtime.viewerToWorld(o.clientX-this.bounds.left,o.clientY-this.bounds.top);this.assignToEvent(o,c,h),this.runtime.world.propagatePointerEvent("onClick",o,c,h)}if(this.pointerEventState.isDragging){for(const c of this.pointerEventState.itemsBeingDragged)c.dispatchEvent("onDragEnd",o);this.pointerEventState.isDragging=!1}this.pointerEventState.isClicking=!1,this.pointerEventState.isPressed=!1,this.pointerEventState.itemsBeingDragged=[],this.onPointerEvent(o)},this.onPointerMove=o=>{this.pointerMoveEvent=void 0;const{x:c,y:h}=this.runtime.viewerToWorld(o.clientX-this.bounds.left,o.clientY-this.bounds.top);if(Number.isNaN(c)||Number.isNaN(h))return;this.assignToEvent(o,c,h),this.runtime.world.propagatePointerEvent("onPointerMove",o,c,h);const v=this.runtime.world.propagatePointerEvent("onMouseMove",o,c,h),g=[],x=[];for(const m of v)g.push(m.id),x.push(m),this.pointerEventState.mousedOver.indexOf(m)===-1&&(m.dispatchEvent("onMouseEnter",o),m.dispatchEvent("onPointerEnter",o),m.dispatchEvent("onMouseOver",o),m.dispatchEvent("onPointerOver",o));for(const m of this.pointerEventState.mousedOver)g.indexOf(m.id)===-1&&(m.dispatchEvent("onMouseLeave",o),m.dispatchEvent("onPointerLeave",o),m.dispatchEvent("onMouseOut",o),m.dispatchEvent("onPointerOut",o));if(this.pointerEventState.isDragging)for(const m of this.pointerEventState.itemsBeingDragged)m.dispatchEvent("onDrag",o);if(this.pointerEventState.isPressed&&!this.pointerEventState.isDragging&&gf(this.pointerEventState.mouseDownStart,{x:o.clientX,y:o.clientY})>50){const m=this.runtime.viewerToWorld(this.pointerEventState.mouseDownStart.x-this.bounds.left,this.pointerEventState.mouseDownStart.y-this.bounds.top);this.pointerEventState.isDragging=!0,this.pointerEventState.itemsBeingDragged=this.runtime.world.propagatePointerEvent("onDragStart",{...o,atlas:{x:m.x,y:m.y}},m.x,m.y)}this.pointerEventState.mousedOver=x},this.element=t,this.runtime=e,this.unsubscribe=e.world.addLayoutSubscriber(this.layoutSubscriber.bind(this)),this.bounds=t.getBoundingClientRect(),this.options={simulationRate:0,...n||{}};let r=0;e.registerHook("useFrame",o=>{r+=o,r>this.options.simulationRate&&this.pointerMoveEvent&&(r=0,e.updateNextFrame())}),e.registerHook("useBeforeFrame",()=>{this.pointerMoveEvent&&this.onPointerMove(this.pointerMoveEvent)}),this.activateEvents()}updateBounds(){this.bounds=this.element.getBoundingClientRect(),this.runtime.updateRendererScreenPosition()}layoutSubscriber(t){t==="event-activation"&&this.activateEvents()}assignToEvent(t,e,n){td.eventPool.atlas.x=e,td.eventPool.atlas.y=n,t.atlas=td.eventPool.atlas}activateEvents(){this.element.addEventListener("pointermove",this._realPointerMove),this.element.addEventListener("pointerup",this.onPointerUp),this.element.addEventListener("pointerdown",this.onPointerDown),this.element.addEventListener("mousedown",this.onPointerEvent),this.element.addEventListener("mouseup",this.onPointerEvent),this.element.addEventListener("pointercancel",this.onPointerEvent),this.element.addEventListener("wheel",this.onWheelEvent),this.element.addEventListener("touchstart",this.onTouchEvent),this.element.addEventListener("touchcancel",this.onTouchEvent),this.element.addEventListener("touchend",this.onTouchEvent),this.element.addEventListener("touchmove",this.onTouchEvent)}normalizeEventName(t){return t.startsWith("on")?t.slice(2).toLowerCase():t.toLowerCase()}stop(){this.unsubscribe();for(const[t,e]of this.eventHandlers)this.element.removeEventListener(this.normalizeEventName(t),e)}};let Pp=td;Pp.eventPool={atlas:{x:0,y:0}};function A0({interactive:t=!0,viewport:e,forceRefresh:n,canvasElement:r,overlayElement:o,controllerConfig:c,unstable_webglRenderer:h,dpi:v,debug:g,canvasBox:x=!0,polygon:m=!0,navigatorElement:w,background:A,runtimeOptions:P}){if(!r)throw new Error("Invalid container");r.style.userSelect="none";const M=t?p0({minZoomFactor:.5,maxZoomFactor:3,enableClickToZoom:!1,...c||{}}):void 0,_=new n0([h?new nR(r,{dpi:v}):new kC(r,{dpi:v,debug:g,box:x,polygon:m,background:A}),o?new R0(o,{box:h||!x,text:!0,triggerResize:n}):void 0,w?new zC(w):void 0]),L=new Ff(_,new cl(1024,1024),e,M?[M]:[],P),k=new Pp(r,L);return{name:"default-preset",em:k,runtime:L,renderer:_,controller:M,canvas:r,navigator:w,unmount(){Dp(L),L.stopControllers(),L.stop(),L.reset(),k&&k.stop()}}}class iR{constructor(e,n){this.pending=!0,this.zIndex=0,this.lastKnownScale=1,this.currentlyVisible=[],this.previouslyVisible=[],this.container=e,this.rendererPosition=e.getBoundingClientRect();const{width:r,height:o}=this.rendererPosition;this.width=r,this.height=o,this.options={addPart:!1,setDraggableFalse:!1,imageClass:"",widthStylesheet:!1,sheetPrefix:"position-",background:"#000",...n||{}},this.stylesheet=new C0({sheetPrefix:this.options.sheetPrefix}),this.container.classList.add(this.stylesheet.addStylesheet(`
|
|
265
265
|
background: ${this.options.background};
|
|
266
|
-
`)),this.options.widthStylesheet&&this.container.appendChild(this.stylesheet.getElement())}isReady(){return!0}resize(){this.rendererPosition=this.container.getBoundingClientRect(),this.width=this.rendererPosition.width,this.height=this.rendererPosition.height}getRendererScreenPosition(){return this.rendererPosition}afterFrame(e,n,
|
|
266
|
+
`)),this.options.widthStylesheet&&this.container.appendChild(this.stylesheet.getElement())}isReady(){return!0}resize(){this.rendererPosition=this.container.getBoundingClientRect(),this.width=this.rendererPosition.width,this.height=this.rendererPosition.height}getRendererScreenPosition(){return this.rendererPosition}afterFrame(e,n,r){this.stylesheet.updateSheet();for(const o of this.previouslyVisible)this.currentlyVisible.indexOf(o)===-1&&this.container.removeChild(o);for(const o of this.currentlyVisible)this.previouslyVisible.indexOf(o)===-1&&this.container.appendChild(o);this.previouslyVisible=this.currentlyVisible,this.currentlyVisible=[]}afterPaintLayer(e,n){}beforeFrame(e,n,r){this.stylesheet.clearClasses(),this.zIndex=0}getPointsAt(e,n,r,o){return e.getPointsAt(n,r,o)}getScale(e,n){if(Number.isNaN(e)||Number.isNaN(n))return this.lastKnownScale;const r=this.width/e,o=this.height/n,c=r<o?o:r;return Number.isNaN(c)||(this.lastKnownScale=c),this.lastKnownScale}getViewportBounds(e,n,r){return null}createImage(){const e=document.createElement("img");return this.options.imageClass?(e.className=this.options.imageClass,this.options.addPart&&e.setAttribute("part",this.options.imageClass)):(e.style.position="absolute",e.style.pointerEvents="none",e.style.userSelect="none"),this.options.setDraggableFalse&&e.setAttribute("draggable","false"),e}paint(e,n,r,o,c,h){if(this.pending=!1,this.zIndex++,e instanceof xr){if(!e.__host){const g=this.createImage();g.src=e.uri,e.__host=g,this.container.appendChild(e.__host)}const v=e.__host;this.currentlyVisible.push(v),v.style.zIndex=`${this.zIndex}`,v.style.opacity=`${e.style.opacity}`,this.options.widthStylesheet?v.className=this.options.imageClass+" "+this.stylesheet.addStylesheet(`width:${(c+Number.MIN_VALUE).toFixed(2)}px;height:${(h+Number.MIN_VALUE).toFixed(2)}px;`):(v.style.width=`${c+Number.MIN_VALUE}px`,v.style.height=`${h+Number.MIN_VALUE}px`),v.style.transform=`translate(${r}px, ${o}px)`}if(e instanceof ja){if(e.__host||(e.__host={images:[]}),!e.__host.images[n]){const g=e.getImageUrl(n),x=this.createImage();x.src=g,e.__host.images[n]=x,this.container.appendChild(x)}const v=e.__host.images[n];v.style.zIndex=`${this.zIndex}`,v.style.opacity=`${e.style.opacity}`,this.currentlyVisible.push(v),this.options.widthStylesheet?v.className=this.options.imageClass+" "+this.stylesheet.addStylesheet(`width:${(c+Number.MIN_VALUE).toFixed(2)}px;height:${(h+Number.MIN_VALUE).toFixed(2)}px;`):(v.style.width=`${c+Number.MIN_VALUE}px`,v.style.height=`${h+Number.MIN_VALUE}px`),v.style.transform=`translate(${r}px, ${o}px)`}}pendingUpdate(){return this.pending}prepareLayer(e){}finishLayer(e){}reset(){}}function rR({interactive:t,viewport:e,forceRefresh:n,containerElement:r,overlayElement:o,controllerConfig:c,background:h}){if(!r)throw new Error("Invalid container");r.style.userSelect="none";const v=t?p0({minZoomFactor:.5,maxZoomFactor:3,enableClickToZoom:!1,...c||{}}):void 0,g=new iR(r,{addPart:!1,setDraggableFalse:!1,imageClass:"atlas-static-image",background:h}),x=o?new n0([g,new R0(o,{box:!0,text:!0,triggerResize:n})]):g,m=new Ff(x,new cl(1024,1024),e,v?[v]:[]),w=new Pp(r,m);return{name:"static-preset",em:w,runtime:m,renderer:x,controller:v,container:r,overlay:o,unmount(){Dp(m),m.stopControllers(),m.stop(),w&&w.stop()}}}const sR={"default-preset":A0,"static-preset":rR},aR={};function oR(t,e){const n=C.useRef(),r=C.useRef(),o=C.useRef(),c=C.useRef(),h=C.useRef({width:e.width,height:e.height,didUpdate:!0}),[v="default-preset",g=aR]=Array.isArray(t)?t||[]:[t],[x,m]=C.useState(null);C.useLayoutEffect(()=>{const A=r.current,P=c.current,M=n.current,_=o.current,k=(sR[v]||A0)({containerElement:P,canvasElement:A,overlayElement:M,navigatorElement:_,viewport:h.current,dpi:window.devicePixelRatio||1,forceRefresh:e.forceRefresh,unstable_webglRenderer:e.unstable_webglRenderer,...g||{}});return m(k),()=>{k&&(k.unmount(),A&&(A.height=0,A.width=0),M&&(M.innerHTML=""),_&&(_.height=0,_.width=0))}},[v,g]);const w=C.useMemo(()=>({canvas:r,overlay:n,container:c,navigator:o}),[]);return[v,x,h,w]}function lR(t){return C.useMemo(()=>Lp(t),t)}const Fu=C.forwardRef((t,e)=>C.createElement("div",{...t,ref:e,part:t.className})),uR=({htmlChildren:t,renderPreset:e,onCreated:n,mode:r="explore",resetWorldOnChange:o=!0,unstable_webglRenderer:c=!1,unstable_noReconciler:h=!1,hideInlineStyle:v=!1,controllerConfig:g,children:x,overlayStyle:m,containerStyle:w,enableNavigator:A,className:P,containerProps:M={},homePosition:_,background:L,runtimeOptions:k,debug:O,...I})=>{const[q,te]=C.useState(L),[H,J]=C.useState(r),[re,$]=C.useState(!1),se=C.useRef(!1),ge=C.useMemo(()=>(typeof e=="string"&&(e=[e,{}]),q||O?e?[e[0],{debug:O,background:q,...e[1]||{}}]:["default-preset",{background:q,debug:O}]:e||"default-preset"),[e,q,O]),[Ce,me,Ie]=m0({scroll:!0}),_e=C.useRef(),Ye=Ge=>{_e.current=Ge,Ce(Ge)},[gt,Z,Ue,dt]=oR(ge,{width:I.width,height:I.height,forceRefresh:Ie,unstable_webglRenderer:c}),[pe,je]=C.useState("");C.useEffect(()=>{J(r)},[r]),C.useEffect(()=>{Z&&Z.em&&Z.em.updateBounds()},[Z,me]),C.useEffect(()=>{Z==null||Z.runtime.setOptions(k||{})},[k]),C.useEffect(()=>{Z&&Z.runtime&&(Z.runtime.mode=H),re&&Z&&(Z.ready=!0)},[Z,re,H]),C.useEffect(()=>{Z&&(Z.runtime.manualHomePosition=!!_,Z.runtime.setHomePosition(_))},[Z,_]),C.useEffect(()=>{if(Z){const Ge=Z.runtime;Ge.resize(Ue.current.width,I.width,Ue.current.height,I.height),Ue.current.width=I.width,Ue.current.height=I.height,Ge.updateNextFrame(),Ue.current.didUpdate=!0}},[Z,I.width,I.height]),C.useLayoutEffect(()=>{Z&&(Z.overlay&&(Z.overlay.style.width=`${me.width}px`,Z.overlay.style.height=`${me.height}px`),Z.container&&(Z.container.style.width=`${me.width}px`,Z.container.style.height=`${me.height}px`))},[Z,me.height,me.width]),C.useLayoutEffect(()=>{const Ge=()=>{if(Z){const nt=Z.runtime;Ue.current.width!==I.width&&Ue.current.height!==I.height&&(nt.resize(Ue.current.width,I.width,Ue.current.height,I.height),Ue.current.width=I.width,Ue.current.height=I.height,nt.updateNextFrame(),Ue.current.didUpdate=!0)}};return window.addEventListener("resize",Ge),()=>window.removeEventListener("resize",Ge)},[Z,I.height,I.width]);const He={width:120},ut=()=>{if(Z&&Z.navigator){const Ge=Z.runtime.world.height,nt=Z.runtime.world.width,Ze=window.devicePixelRatio||1,ht=He.width,ft=He.width/nt*Ge;Z.navigator.width=ht*Ze,Z.navigator.height=ft*Ze,Z.navigator.style.width=ht+"px",Z.navigator.style.height=ft+"px"}};C.useLayoutEffect(()=>{if(Z){ut();const Ge=Z.runtime;return Ge.world.addLayoutSubscriber(nt=>{nt==="recalculate-world-size"&&(ut(),Ge.resize(Ue.current.width,I.width,Ue.current.height,I.height))})}return()=>{}},[Z]);const pt=C.useCallback(function(nt){const Ze=()=>{$(!0)};return C.useEffect(()=>{if(Z){Z.runtime.goHome();const ht=n&&n(Z);return void(ht&&ht.then?ht.then(Ze):Ze())}else throw new Error("Invalid configuration - no runtime found")},[]),nt.children},[Z]);C.useEffect(()=>{if(Z){const Ge=Z.runtime;if(o)return Ge.world.addLayoutSubscriber(nt=>{nt==="recalculate-world-size"&&Ge.goHome()})}return()=>{}},[Z,o]),C.useEffect(()=>Z?Z.runtime.registerHook("useBeforeFrame",()=>{var nt;if(Ue.current.didUpdate&&Z.canvas){const Ze=window.devicePixelRatio||1,ht=Ue.current.width,ft=Ue.current.height;Z.canvas.width=ht*Ze,Z.canvas.height=ft*Ze,Z.canvas.style.width=ht+"px",Z.canvas.style.height=ft+"px",(nt=Z.canvas.getContext("2d"))==null||nt.scale(Ze,Ze),Z&&Z.em&&Z.em.updateBounds(),Ue.current.didUpdate=!1}}):()=>{},[Z,o]),C.useEffect(()=>{const Ge=()=>{Z&&(J("sketch"),je("mode-sketch")),window.removeEventListener("keyup",Ge)},nt=Ze=>{if(Ze.code==="Space"&&Z&&Z.runtime.mode==="sketch"){if(Ze.target&&Ze.target.tagName&&Ze.target.tagName.toLowerCase()==="input")return;Ze.preventDefault(),J("explore"),je("mode-explore"),window.addEventListener("keyup",Ge)}};return window.addEventListener("keydown",nt),()=>{window.removeEventListener("keydown",nt),window.removeEventListener("keyup",Ge)}},[Z]),C.useLayoutEffect(()=>{if(_e.current&&!q){const nt=getComputedStyle(_e.current).getPropertyValue("--atlas-background");nt&&te(nt)}},[q]),se.current=!0;const{height:vn,width:Kt,...xt}=I,ct=lR([I.width,I.height]);return C.createElement(Fu,{ref:Ye,className:["atlas",v?"":`atlas-width-${ct}`,pe,P].filter(Boolean).join(" ").trim(),style:{...w,...v?{}:{width:I.width,height:I.height}}},gt==="static-preset"?C.createElement(Fu,{className:"atlas-static-container",style:Z&&Z.controller?void 0:{pointerEvents:"none"},ref:dt.container,tabIndex:0,...M}):C.createElement("canvas",{className:"atlas-canvas",part:"atlas-canvas",tabIndex:0,...xt,...M,ref:dt.canvas}),C.createElement(Fu,{className:"atlas-overlay",style:{...m||{}},ref:dt.overlay},h?C.createElement(pt,null,C.createElement(Zf.Provider,{value:me},C.createElement(ju.Provider,{value:H},C.createElement(Kf.Provider,{value:Z},x)))):C.createElement(tR,{bounds:me,preset:Z,mode:H,setIsReady:$,onCreated:n},x)),A?C.createElement(Fu,{className:"atlas-navigator"},C.createElement("canvas",{className:"atlas-navigator-canvas",part:"atlas-navigator-canvas",ref:dt.navigator})):null,v?C.createElement("style",null,`.atlas-width-${ct} { width: ${I.width}px; height: ${I.height}px; }`):C.createElement("style",null,`
|
|
267
267
|
.atlas { position: relative; user-select: none; display: flex; background: var(--atlas-background, #000); z-index: var(--atlas-z-index, 10); touch-action: none; }
|
|
268
|
-
.atlas-width-${
|
|
268
|
+
.atlas-width-${ct} { width: ${I.width}px; height: ${I.height}px; }
|
|
269
269
|
.atlas-canvas { flex: 1 1 0px; }
|
|
270
270
|
.atlas-canvas:focus, .atlas-static-container:focus { outline: none }
|
|
271
271
|
.atlas-canvas:focus-visible, .atlas-canvas-container:focus-visible { outline: var(--atlas-focus, 2px solid darkorange) }
|
|
@@ -274,18 +274,14 @@ No matching component was found for:
|
|
|
274
274
|
.atlas-static-image { position: absolute; pointer-events: none; user-select: none; transform-origin: 0px 0px; }
|
|
275
275
|
.atlas-navigator { position: absolute; top: var(--atlas-navigator-top, 10px); right: var(--atlas-navigator-bottom, 10px); left: var(--atlas-navigator-left); bottom: var(--atlas-navigator-bottom); opacity: .8 }
|
|
276
276
|
.atlas-navigator-canvas { width: 100%; }
|
|
277
|
-
`),t)};function
|
|
277
|
+
`),t)};function cR(t){return Number(t)==t?`${t}px`:t}const fR=({resizeHash:t,aspectRatio:e,containerProps:n={},...r})=>{const[o,c,h]=m0(),{height:v,width:g,...x}=r;C.useEffect(()=>{h()},[g,v,t,h]);const m=C.useMemo(()=>e?{width:c.width,height:c.width*(1/e)}:c,[c,e]);return C.createElement(Fu,{ref:o,className:"atlas-container",...n},m.width?C.createElement(uR,{width:m.width||100,height:m.height||100,...x},r.children):null,r.hideInlineStyle?null:C.createElement("style",null,`
|
|
278
278
|
.atlas-container {
|
|
279
279
|
display: var(--atlas-container-display, block);
|
|
280
280
|
flex: var(--atlas-container-flex, none);
|
|
281
281
|
width: var(--atlas-container-width, ${g?`${g}px`:"100%"});
|
|
282
|
-
height: var(--atlas-container-height, ${
|
|
282
|
+
height: var(--atlas-container-height, ${cR(v||(e?m.height:512))})
|
|
283
283
|
}
|
|
284
|
-
`),i.htmlChildren)},MM=()=>T.useContext(uv),Dd=()=>{const t=MM();return t?t.runtime:void 0},D1=(t,e=[])=>{const n=Dd();T.useEffect(()=>n?n.registerHook("useFrame",t):()=>{},e)};function OM(){return T.useContext(cv)}async function _M(t,e,n){if(T.version.startsWith("18.")){const i=await Promise.resolve().then(()=>DD),a=i.default?i.default.createRoot:i.createRoot;n.current||(n.current=a(t)),n.current.render(e)}else if(typeof ReactDOM<"u"){const{render:i,unmountComponentAtNode:a}=ReactDOM;i(e,t),n.current={unmount(){a(t)}}}else{const i=await import("react-dom"),a=i.default?i.default.render:i.render,u=i.default?i.default.unmountComponentAtNode:i.unmountComponentAtNode;a(e,t),n.current={unmount(){u(t)}}}}const hv=T.forwardRef(({children:t,...e},n)=>{const i=T.useRef(),a=Dd(),u=T.useRef(0),f=T.useRef(),p=T.useRef();return D1(()=>{var g,S,m,x;if(e.relative){const R=i.current;if(R&&a){const _=a.getScaleFactor();u.current!==_&&(u.current=_,R.style.transformOrigin="0 0",R.style.transform=`scale(${1/u.current})`,R.style.width=`${u.current*100}%`,R.style.height=`${u.current*100}%`,i.current&&((S=(g=f.current)==null?void 0:g.__owner.value)!=null&&S.rotation)&&(R.style.transform=`scale(${1/u.current}) translate(50%, 50%) rotate(${((x=(m=f.current)==null?void 0:m.__owner.value)==null?void 0:x.rotation)||0}deg) translate(-50%, -50%)`))}}},[e.relative]),T.useLayoutEffect(()=>{const g=f.current;n&&g&&(typeof n=="function"?n(g):n.current=g);async function S(){if(g&&g.__host){const m=e.relative?T.createElement("div",{ref:i},t):t;await _M(g.__host.element,m,p)}}g&&g.__host?S():g&&(g.__onCreate=S)},[n,t,f,e.relative]),T.useLayoutEffect(()=>()=>{p.current&&setTimeout(()=>{p.current.unmount()},0)},[]),T.createElement("box",{html:!0,...e,ref:f})});hv.displayName="HTMLPortal";const k1=(t,e,n=[])=>{const i=Dd(),a=i?i.world:void 0;T.useEffect(()=>{if(i){const u=e,f=Rl[t];i.world.activatedEvents.push(f);const p=f.slice(2).toLowerCase();return i.world.addEventListener(p,u),()=>{i.world.removeEventListener(p,u)}}return()=>{}},[a,t,...n])};function I1(t,e){if(t===0)return[0,1];if(e===0)return[1,0];const n=Math.abs(t)/Math.abs(e);return[n,1-n]}function LM(){const t=T.useRef({ctrl:!1,shift:!1,alt:!1});return T.useLayoutEffect(()=>{function e(i){i.key==="Shift"&&(t.current.shift=!0),i.key==="Control"&&(t.current.ctrl=!0),i.key==="Alt"&&(t.current.alt=!0)}function n(i){i.key==="Shift"&&(t.current.shift=!1),i.key==="Control"&&(t.current.ctrl=!1),i.key==="Alt"&&(t.current.alt=!1)}return window.addEventListener("keydown",e),window.addEventListener("keyup",n),()=>{window.removeEventListener("keydown",e),window.removeEventListener("keyup",n)}},[]),t}const PM=(t,e)=>{const n=oM(),i=Dd(),a=OM(),u=T.useRef(),f=T.useRef(null),p=T.useRef(),[g,S]=T.useState(!1),m=T.useRef(!1),x=T.useRef({north:0,south:0,east:0,west:0}),R=LM(),_=T.useCallback(O=>j=>{if(m.current=!0,S(!0),a&&i){const{top:q,left:ee}=a,H=i.viewerToWorld(j.pageX-ee,j.pageY-q);p.current={x:H.x,y:H.y},u.current=O}},[a,i]),M=T.useMemo(()=>t.width/t.height,[t.width,t.height]),k=T.useCallback(O=>{if(!Math.abs(O.north-O.south+(O.east-O.west)))return;const q=-O.west+O.east,ee=-O.north+O.south,H=t.width+q,Z=t.height+ee;if(H/Z>=M){const W=Z*M,re=H-W,[ge,be]=I1(O.east,O.west);O.west=O.west+re*be,O.east=O.east-re*ge}else{const W=H/M,re=Z-W,[ge,be]=I1(O.north,O.south);O.north=O.north+re*ge,O.south=O.south-re*be}},[t.width,t.height,M]);D1(()=>{p&&i&&i.updateNextFrame()}),T.useEffect(()=>{i&&i.updateNextFrame()},[i,g]);const L=T.useCallback(O=>{var j;if(!i||!a||i.mode!=="sketch")return;const{top:q,left:ee}=a,H=i.viewerToWorld(O.pageX-ee,O.pageY-q),Z=f.current,ie=!t.maintainAspectRatio&&R.current.alt,W=!ie&&R.current.shift&&((j=u.current)==null?void 0:j.indexOf("-"))!==-1;if((u.current==="translate"||u.current==="east"||u.current==="north-east"||u.current==="south-east")&&(x.current.east=H.x-(p.current?p.current.x:0),ie&&(x.current.west=-x.current.east)),(u.current==="translate"||u.current==="west"||u.current==="north-west"||u.current==="south-west")&&(x.current.west=H.x-(p.current?p.current.x:0),ie&&(x.current.east=-x.current.west)),(u.current==="translate"||u.current==="north"||u.current==="north-east"||u.current==="north-west")&&(x.current.north=H.y-(p.current?p.current.y:0),ie&&(x.current.south=-x.current.north)),(u.current==="translate"||u.current==="south"||u.current==="south-west"||u.current==="south-east")&&(x.current.south=H.y-(p.current?p.current.y:0),ie&&(x.current.north=-x.current.south)),(t.maintainAspectRatio||W)&&k(x.current),Z){const re=x.current.west,ge=x.current.north,be=t.width+x.current.east,Ee=t.height+x.current.south;Z.points[1]=Math.min(re,be),Z.points[2]=Math.min(ge,Ee),Z.points[3]=Math.max(re,be),Z.points[4]=Math.max(ge,Ee),i.updateNextFrame()}},[i,t.width,t.height,t.maintainAspectRatio,a]);k1("mousemove",L,[t.width,t.height,a]),k1("pointermove",L,[t.width,t.height,a]);const P=T.useRef();return T.useEffect(()=>{P.current=()=>{if(m.current){const O=x.current.west,j=x.current.north,q=t.width+x.current.east,ee=t.height+x.current.south,H=Math.min(O,q),Z=Math.min(j,ee),ie=Math.max(O,q),W=Math.max(j,ee),re={x:(t.x||0)+H,y:(t.y||0)+Z,width:ie-H||1,height:W-Z||1};t.maintainAspectRatio,e(re),u.current=void 0,p.current=void 0,x.current.east=0,x.current.west=0,x.current.north=0,x.current.south=0,m.current=!1,S(!1)}}},[e,t.height,t.width,t.x,t.y]),T.useEffect(()=>{const O=()=>{P.current&&P.current()};return window.addEventListener("pointerup",O),window.addEventListener("touchend",O),()=>{window.removeEventListener("pointerup",O),window.removeEventListener("touchend",O)}},[]),{portalRef:f,mode:n,mouseEvent:_,onPointerMoveCallback:L,isEditing:g}};function DM({handleSize:t,resizable:e,onSave:n,children:i,maintainAspectRatio:a,disableCardinalControls:u,...f}){const p=typeof t>"u"?a?10:8:t,{portalRef:g,mode:S,mouseEvent:m,isEditing:x}=PM({x:f.x||0,y:f.y||0,width:f.width,height:f.height,maintainAspectRatio:a},n),R=T.useMemo(()=>m("translate"),[m]),_=T.useMemo(()=>m("east"),[m]),M=T.useMemo(()=>m("west"),[m]),k=T.useMemo(()=>m("south"),[m]),L=T.useMemo(()=>m("north"),[m]),P=T.useMemo(()=>m("south-east"),[m]),O=T.useMemo(()=>m("south-west"),[m]),j=T.useMemo(()=>m("north-east"),[m]),q=T.useMemo(()=>m("north-west"),[m]),ee=S==="sketch",H={zIndex:999,boxShadow:"0px 2px 3px 0 rgba(0,0,0,0.2)",border:"1px solid rgba(155,155,155,.7)",borderRadius:a||u?"50%":2,position:"absolute",background:"#fff",pointerEvents:x?"none":ee?"initial":"none"};return T.createElement(T.Fragment,null,T.createElement("world-object",{...f},i,ee&&e?T.createElement(hv,{ref:g,target:{x:0,y:0,height:f.height,width:f.width},relative:!0,interactive:!1},ee&&e?T.createElement(T.Fragment,null,T.createElement("div",{onMouseDown:R,onTouchStart:R,style:{display:"block",width:"100%",height:"100%",position:"relative",border:"1px solid rgba(155,155,155, .7)",boxSizing:"border-box",pointerEvents:x?"none":ee?"initial":"none"}}),a?null:T.createElement(T.Fragment,null,T.createElement("div",{title:"east",onTouchStart:_,onMouseDown:_,style:{...H,cursor:"e-resize",height:p*2,width:p,right:0,top:"50%",opacity:u?0:1,transform:`translate(${p/2}px, -${p}px)`}}),T.createElement("div",{title:"west",onMouseDown:M,style:{...H,cursor:"w-resize",position:"absolute",height:p*2,width:p,left:0,top:"50%",opacity:u?0:1,transform:`translate(-${p/2}px, -${p}px)`}}),T.createElement("div",{title:"north",onMouseDown:L,style:{...H,cursor:"n-resize",position:"absolute",height:p,width:p*2,left:"50%",top:0,opacity:u?0:1,transform:`translate(-${p}px, -${p/2}px)`}}),T.createElement("div",{title:"south",onMouseDown:k,style:{...H,cursor:"s-resize",position:"absolute",height:p,width:p*2,left:"50%",bottom:0,opacity:u?0:1,transform:`translate(-${p}px, ${p/2}px)`}})),T.createElement("div",{title:"north-east",onMouseDown:j,style:{...H,cursor:"ne-resize",position:"absolute",height:p,width:p,right:0,top:0,transform:`translate(${p/2}px, -${p/2}px)`}}),T.createElement("div",{title:"south-east",onMouseDown:P,style:{...H,cursor:"se-resize",position:"absolute",height:p,width:p,bottom:0,right:0,transform:`translate(${p/2}px, ${p/2}px)`}}),T.createElement("div",{title:"south-west",onMouseDown:O,style:{...H,cursor:"sw-resize",position:"absolute",height:p,width:p,bottom:0,left:0,transform:`translate(-${p/2}px, ${p/2}px)`}}),T.createElement("div",{title:"north-west",onMouseDown:q,style:{...H,cursor:"nw-resize",position:"absolute",height:p,width:p,top:0,left:0,transform:`translate(-${p/2}px, -${p/2}px)`}})):null):null))}function kM({interactive:t,region:e,onClick:n,onSave:i,maintainAspectRatio:a,disableCardinalControls:u,isEditing:f,rotation:p,style:g={backgroundColor:"rgba(0,0,0,.5)"}}){const S=T.useCallback(m=>{i({id:e.id,x:e.x,y:e.y,height:e.height,width:e.width,...m})},[i,e.id,e.x,e.y,e.height,e.width]);return T.createElement(DM,{x:e.x,y:e.y,rotation:p,width:e.width,height:e.height,resizable:f,onSave:S,maintainAspectRatio:a,disableCardinalControls:u},T.createElement("box",{interactive:t,onClick:m=>{m.preventDefault(),m.stopPropagation(),n(e)},target:{x:0,y:0,width:e.width,height:e.height},style:g}))}const IM=t=>{var e,n,i,a,u;const f=t.width/(((e=t.crop)==null?void 0:e.width)||t.tiles.width),p=t.tiles.imageService.tiles||[],g=t.tiles.imageService.sizes||[],S=t.enableThumbnail,m=t.enableSizes,x=T.useMemo(()=>{const R=t.tiles.imageService.id||t.tiles.imageService["@id"];return R&&R.endsWith("/info.json")?R.slice(0,-1*10):R},[t.tiles.imageService.id]);return T.createElement("world-object",{rotation:t.rotation,key:t.tiles.imageService.id,scale:f,height:((n=t.crop)==null?void 0:n.height)||t.tiles.height,width:((i=t.crop)==null?void 0:i.width)||t.tiles.width,x:t.x,y:t.y,onClick:t.onClick},T.createElement("composite-image",{key:t.tiles.imageService.id,id:t.tiles.imageService.id,width:((a=t.crop)==null?void 0:a.width)||t.tiles.width,height:((u=t.crop)==null?void 0:u.height)||t.tiles.height,crop:t.crop},S&&t.tiles.thumbnail?T.createElement("world-image",{priority:!0,uri:t.tiles.thumbnail.id,target:{width:t.tiles.width,height:t.tiles.height},display:{width:t.tiles.thumbnail.width,height:t.tiles.thumbnail.height},crop:t.crop}):null,m&&g.map((R,_)=>T.createElement("world-image",{key:_,uri:`${x}/full/${R.width},${R.height}/0/default.jpg`,target:{width:t.tiles.width,height:t.tiles.height},display:{width:R.width,height:R.height},crop:t.crop})),p.map(R=>(R.scaleFactors||[]).map(_=>T.createElement("tiled-image",{key:`${t.tiles.imageService.id}-tile-${_}`,uri:t.tiles.imageService.id,display:{width:t.tiles.width,height:t.tiles.height},tile:R,scaleFactor:_,crop:t.crop})))))};function NM(t,e){return t?e?{...t,...e||{},":hover":t[":hover"]?Object.assign(t[":hover"]||{},e[":hover"]||{}):e[":hover"],":active":t[":active"]?Object.assign(t[":active"]||{},e[":active"]||{}):e[":hover"]}:t:e}function pv(t,e){return pv=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},pv(t,e)}function zM(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,pv(t,e)}var UM=function(e,n){return e===void 0&&(e=[]),n===void 0&&(n=[]),e.length!==n.length||e.some(function(i,a){return!Object.is(i,n[a])})},N1={error:null},jM=function(t){zM(e,t);function e(){for(var i,a=arguments.length,u=new Array(a),f=0;f<a;f++)u[f]=arguments[f];return i=t.call.apply(t,[this].concat(u))||this,i.state=N1,i.resetErrorBoundary=function(){for(var p,g=arguments.length,S=new Array(g),m=0;m<g;m++)S[m]=arguments[m];i.props.onReset==null||(p=i.props).onReset.apply(p,S),i.reset()},i}e.getDerivedStateFromError=function(a){return{error:a}};var n=e.prototype;return n.reset=function(){this.setState(N1)},n.componentDidCatch=function(a,u){var f,p;(f=(p=this.props).onError)==null||f.call(p,a,u)},n.componentDidUpdate=function(a,u){var f=this.state.error,p=this.props.resetKeys;if(f!==null&&u.error!==null&&UM(a.resetKeys,p)){var g,S;(g=(S=this.props).onResetKeysChange)==null||g.call(S,a.resetKeys,p),this.reset()}},n.render=function(){var a=this.state.error,u=this.props,f=u.fallbackRender,p=u.FallbackComponent,g=u.fallback;if(a!==null){var S={error:a,resetErrorBoundary:this.resetErrorBoundary};if(se.isValidElement(g))return g;if(typeof f=="function")return f(S);if(p)return se.createElement(p,S);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},e}(se.Component);const FM={collection:void 0,manifest:void 0,range:void 0,canvas:void 0,annotation:void 0,annotationPage:void 0},kd=T.createContext(FM),As=()=>T.useContext(kd);function ca({value:t,children:e}){const n=As(),i=T.useMemo(()=>({...n,...t}),[t,n]);return oe.jsx(kd.Provider,{value:i,children:e})}var BM=Object.defineProperty,HM=(t,e,n)=>e in t?BM(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,fa=(t,e,n)=>(HM(t,typeof e!="symbol"?e+"":e,n),n);function da(t){return typeof t=="string"?!1:!!t&&t.type==="SpecificResource"}function z1(t,e){const n=e||"unknown";if(!t)return;if(typeof t=="string")return{id:t,type:n};if(da(t))return z1(t.source,e);let i=n&&n!=="unknown"?n:t.type||t["@type"];const a=t.id||t["@id"];if(i.indexOf(":")!==-1&&(i=i.split(":").pop()),a&&i)return{id:a,type:i}}const vc={},zn="iiif-parser:hasPart",Kr="iiif-parser:partOf",mc="iiif-parser:isExternal",Mr="__$UNSET$__",U1="__$UNWRAP$__",ze=[];Object.freeze(ze),Object.freeze(vc);function VM(t){if(t===vc||Object.keys(t).length===0)return!0;for(const e in t)return!1;return!0}function vv(t,e){if(e&&e["@explicit"]){const n={},i=Object.keys(e);for(const a of i)a===Kr||a==="@explicit"||(VM(e[a])?n[a]=t[a]:n[a]=e[a]);return n}return t}function j1(t,e,n){const i=z1(e);if(!i)return[void 0,void 0];const a=t.requests[i.id],u=i.type||t.mapping[i.id];if(!u||a&&a.resourceUri&&!t.entities[u][a.resourceUri])return[void 0,void 0];const f=t.entities[u][a?a.resourceUri:i.id];if(i.type&&!f)return j1(t,{id:i.id},n);if(f&&f[zn]){const p=f[zn].find(S=>n?S[Kr]===n.id:S[Kr]===f.id);return[vv(f,p),f]}return[f,f]}const $M={id:"https://iiif-parser/annotation-page",type:"AnnotationPage",behavior:ze,label:null,thumbnail:ze,summary:null,requiredStatement:null,metadata:ze,rights:null,provider:ze,items:ze,seeAlso:ze,homepage:ze,rendering:ze,service:ze},WM={id:"https://iiif-parser/empty-canvas",type:"Canvas",label:null,behavior:ze,thumbnail:ze,accompanyingCanvas:null,placeholderCanvas:null,summary:null,requiredStatement:null,metadata:ze,rights:null,navDate:null,provider:ze,items:ze,annotations:ze,seeAlso:ze,homepage:ze,partOf:ze,rendering:ze,service:ze,duration:0,height:0,width:0},qM={id:"https://iiif-parser/empty-collection",type:"Collection",label:null,viewingDirection:"left-to-right",behavior:ze,thumbnail:ze,accompanyingCanvas:null,placeholderCanvas:null,summary:null,requiredStatement:null,metadata:ze,rights:null,navDate:null,provider:ze,items:ze,annotations:ze,seeAlso:ze,homepage:ze,partOf:ze,rendering:ze,service:ze,services:ze},YM={id:"https://iiif-parser/empty-manifest",type:"Manifest",annotations:ze,behavior:ze,homepage:ze,items:ze,label:null,metadata:ze,navDate:null,provider:ze,partOf:ze,accompanyingCanvas:null,placeholderCanvas:null,rendering:ze,requiredStatement:null,rights:null,seeAlso:ze,service:ze,services:ze,start:null,structures:ze,summary:null,thumbnail:ze,viewingDirection:"left-to-right"},QM={id:"https://iiif-parser/empty-canvas",type:"Range",label:null,behavior:ze,thumbnail:ze,accompanyingCanvas:null,placeholderCanvas:null,summary:null,requiredStatement:null,metadata:ze,rights:null,navDate:null,provider:ze,items:ze,annotations:ze,seeAlso:ze,homepage:ze,partOf:ze,rendering:ze,service:ze,start:null,supplementary:null,viewingDirection:"left-to-right"},GM={id:"https://iiif-parser/empty-agent",type:"Agent",label:{},logo:ze,seeAlso:ze,homepage:ze},XM={id:"https://iiif-parser/empty-service",type:"UnknownService"};function Nl(t){return Array.isArray(t)?t:t?[t]:[]}function Id(...t){return e=>t.reduce((n,i)=>i(n),e)}const F1=["Collection","Manifest","Canvas","AnnotationPage","AnnotationCollection","Annotation","ContentResource","Range","Service","Selector","Agent"];function KM(t,e){if(typeof t>"u"||t===null)throw new Error("Null or undefined is not a valid entity.");if(Array.isArray(t))throw new Error("Array is not a valid entity");if(typeof t!="object"){if(e)return e;throw new Error(`${typeof t} is not a valid entity`)}if(typeof t.type=="string"){const n=F1.indexOf(t.type);if(n!==-1)return F1[n]}if(t.profile)return"Service";throw new Error("Resource type is not known")}class mv{constructor(e,n={}){fa(this,"traversals"),fa(this,"options"),fa(this,"_traverseManifest",Id(this.traverseManifestItems.bind(this),this.traverseLinking.bind(this),this.traverseDescriptive.bind(this),this.traverseLinkedCanvases.bind(this),this.traverseManifestStructures.bind(this),this.traverseInlineAnnotationPages.bind(this))),fa(this,"_traverseCanvas",Id(this.traverseCanvasItems.bind(this),this.traverseLinking.bind(this),this.traverseDescriptive.bind(this),this.traverseLinkedCanvases.bind(this),this.traverseInlineAnnotationPages.bind(this))),fa(this,"_traverseAnnotationPage",Id(this.traverseAnnotationPageItems.bind(this),this.traverseLinking.bind(this),this.traverseDescriptive.bind(this))),fa(this,"_traverseRange",Id(this.traverseRangeRanges.bind(this),this.traverseLinking.bind(this),this.traverseDescriptive.bind(this),this.traverseLinkedCanvases.bind(this))),this.traversals={collection:[],manifest:[],canvas:[],annotationCollection:[],annotationPage:[],annotation:[],contentResource:[],choice:[],range:[],service:[],agent:[],specificResource:[],geoJson:[],...e},this.options={allowUndefinedReturn:!1,...n}}static all(e){return new mv({collection:[e],manifest:[e],canvas:[e],annotationCollection:[e],annotationPage:[e],annotation:[e],contentResource:[e],choice:[e],range:[e],service:[e],geoJson:[e],specificResource:[e],agent:[e]})}traverseDescriptive(e){return e.thumbnail&&(e.thumbnail=Nl(e.thumbnail).map(n=>this.traverseType(n,{parent:e},this.traversals.contentResource))),e.provider&&(e.provider=e.provider.map(n=>this.traverseAgent(n,e))),e}traverseLinking(e){return e.seeAlso&&(e.seeAlso=e.seeAlso.map(n=>this.traverseType(n,{parent:e},this.traversals.contentResource))),e.service&&(e.service=Nl(e.service).map(n=>this.traverseService(n))),e.services&&(e.services=Nl(e.services).map(n=>this.traverseService(n,e))),e.logo&&(e.logo=e.logo.map(n=>this.traverseType(n,{parent:e},this.traversals.contentResource))),e.homepage&&(e.homepage=e.homepage.map(n=>this.traverseType(n,{parent:e},this.traversals.contentResource))),e.partOf&&(e.partOf=e.partOf.map(n=>typeof n=="string"||!n.type?this.traverseType(n,{parent:e},this.traversals.contentResource):n.type==="Canvas"?this.traverseType(n,{parent:e},this.traversals.canvas):n.type==="AnnotationCollection"?this.traverseType(n,{parent:e},this.traversals.annotationCollection):n.type==="Collection"?this.traverseType(n,{parent:e},this.traversals.collection):this.traverseType(n,{parent:e},this.traversals.contentResource))),e.start&&(da(e.start)?e.start=this.traverseSpecificResource(e.start,"Canvas",e):e.start=this.traverseType(e.start,{parent:e},this.traversals.canvas)),e.rendering&&(e.rendering=e.rendering.map(n=>this.traverseType(n,{parent:e},this.traversals.contentResource))),e.supplementary&&(e.supplementary=e.supplementary.map(n=>this.traverseType(n,{parent:e},this.traversals.contentResource))),e}traverseCollectionItems(e){return e.items&&e.items.map(n=>n.type==="Collection"?this.traverseCollection(n):this.traverseManifest(n)),e}traverseCollection(e,n){return this.traverseType(this.traverseDescriptive(this.traverseInlineAnnotationPages(this.traverseLinking(this.traverseLinkedCanvases(this.traverseCollectionItems(e))))),{parent:n},this.traversals.collection)}traverseGeoJson(e,n){return this.traverseType(e,{parent:n},this.traversals.geoJson)}traverseNavPlace(e){return e.navPlace&&(e.navPlace=this.traverseGeoJson(e.navPlace,e)),e}traverseManifestItems(e){return e.items&&(e.items=e.items.map(n=>this.traverseCanvas(n))),e}traverseManifestStructures(e){return e.structures&&(e.structures=e.structures.map(n=>this.traverseRange(n))),e}traverseManifest(e,n){return this.traverseType(this._traverseManifest(e),{parent:n},this.traversals.manifest)}traverseCanvasItems(e){return e.items=(e.items||[]).map(n=>this.traverseAnnotationPage(n,e)),e}traverseInlineAnnotationPages(e){return typeof e=="string"||!e||e.annotations&&(e.annotations=e.annotations.map(n=>this.traverseAnnotationPage(n,e))),e}traverseCanvas(e,n){return this.traverseType(this._traverseCanvas(e),{parent:n},this.traversals.canvas)}traverseAnnotationPageItems(e){return e.items&&(e.items=e.items.map(n=>this.traverseAnnotation(n,e))),e}traverseAnnotationPage(e,n){return this.traverseType(this._traverseAnnotationPage(e),{parent:n},this.traversals.annotationPage)}traverseAnnotationBody(e){return Array.isArray(e.body)?e.body=e.body.map(n=>this.traverseContentResource(n,e)):e.body&&(e.body=this.traverseContentResource(e.body,e)),e}traverseLinkedCanvases(e){return e.placeholderCanvas&&(e.placeholderCanvas=this.traverseCanvas(e.placeholderCanvas)),e.accompanyingCanvas&&(e.accompanyingCanvas=this.traverseCanvas(e.accompanyingCanvas)),e}traverseAnnotation(e,n){return this.traverseType(this.traverseLinking(this.traverseAnnotationBody(this.traverseDescriptive(e))),{parent:n},this.traversals.annotation)}traverseContentResourceLinking(e){return typeof e=="string"||!e||e&&e.service&&(e.service=Nl(e.service||[]).map(n=>this.traverseService(n,e))),e}traverseContentResource(e,n){return e.type==="Choice"&&(e.items=e.items.map(i=>this.traverseContentResource(i,e))),da(e)?this.traverseSpecificResource(e,"ContentResource"):this.traverseType(this.traverseInlineAnnotationPages(this.traverseContentResourceLinking(e)),{parent:n},this.traversals.contentResource)}traverseSpecificResource(e,n,i){let a=e.source;return typeof e.source=="string"&&(a={id:e.source,type:n||"unknown"}),this.traverseType({...e,source:n==="Canvas"||a.type==="Canvas"?this.traverseType(a,{parent:i},this.traversals.canvas):n==="ContentResource"?this.traverseContentResource(a,{parent:i}):this.traverseUnknown(a,{parent:i,typeHint:n})},{parent:i},this.traversals.specificResource)}traverseRangeRanges(e){return e.items&&(e.items=e.items.map(n=>typeof n=="string"?this.traverseCanvas({id:n,type:"Canvas"},e):da(n)?this.traverseSpecificResource(n,"Canvas",e):n.type==="Manifest"?this.traverseManifest(n,e):this.traverseRange(n,e))),e}traverseRange(e,n){return this.traverseType(this._traverseRange(e),{parent:n},this.traversals.range)}traverseAgent(e,n){return this.traverseType(this.traverseDescriptive(this.traverseLinking(e)),{parent:n},this.traversals.agent)}traverseType(e,n,i){return i.reduce((a,u)=>{const f=u(a,n);return typeof f>"u"&&!this.options.allowUndefinedReturn?a:f},e)}traverseService(e,n){const i=Object.assign({},e);return i&&i.service&&(i.service=Nl(i.service).map(a=>this.traverseService(a))),this.traverseType(i,{parent:n},this.traversals.service)}traverseUnknown(e,{parent:n,typeHint:i}={}){const a=KM(e,i);switch(a){case"Collection":return this.traverseCollection(e,n);case"Manifest":return this.traverseManifest(e,n);case"Canvas":return this.traverseCanvas(e,n);case"AnnotationPage":return this.traverseAnnotationPage(e,n);case"Annotation":return this.traverseAnnotation(e,n);case"ContentResource":return this.traverseContentResource(e,n);case"Range":return this.traverseRange(e,n);case"Service":return this.traverseService(e,n);case"Agent":return this.traverseAgent(e,n);default:{if(i)return i;throw new Error(`Unknown or unsupported resource type of ${a}`)}}}}const B1=["sc:Collection","sc:Manifest","sc:Canvas","sc:AnnotationList","oa:Annotation","sc:Range","sc:Layer","sc:Sequence","oa:Choice","Service","ContentResource"];function ZM(t){if(typeof t>"u"||t===null)throw new Error("Null or undefined is not a valid entity.");if(Array.isArray(t))throw new Error("Array is not a valid entity");if(typeof t!="object")throw new Error(`${typeof t} is not a valid entity`);if(typeof t["@type"]=="string"){const e=B1.indexOf(t["@type"]);if(e!==-1)return B1[e]}if(t.profile)return"Service";if(t.format||t["@type"])return"ContentResource";throw new Error("Resource type is not known")}class gv{constructor(e,n={}){fa(this,"traversals"),fa(this,"options"),this.traversals={collection:[],manifest:[],canvas:[],annotationList:[],sequence:[],annotation:[],contentResource:[],choice:[],range:[],service:[],layer:[],...e},this.options={convertPropsToArray:!0,mergeMemberProperties:!0,allowUndefinedReturn:!1,...n}}static all(e){return new gv({collection:[e],manifest:[e],canvas:[e],annotationList:[e],sequence:[e],annotation:[e],contentResource:[e],choice:[e],range:[e],service:[e],layer:[e]})}traverseCollection(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCollectionItems(e))),this.traversals.collection)}traverseCollectionItems(e){if(this.options.mergeMemberProperties){const n=[...(e.manifests||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Manifest"}:i),...(e.collections||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Collection"}:i),...e.members||[]];delete e.collections,delete e.manifests,e.members=n}return e.manifests&&(e.manifests=e.manifests.map(n=>this.traverseManifest(typeof n=="string"?{"@id":n,"@type":"sc:Manifest"}:n))),e.collections&&(e.collections=e.collections.map(n=>this.traverseCollection(typeof n=="string"?{"@id":n,"@type":"sc:Collection"}:n))),e.members&&(e.members=e.members.map(n=>typeof n=="string"?n:this.traverseUnknown(n))),e}traverseManifest(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseManifestItems(e))),this.traversals.manifest)}traverseManifestItems(e){return e.sequences&&(e.sequences=e.sequences.map(n=>this.traverseSequence(n))),e.structures&&(e.structures=e.structures.map(n=>this.traverseRange(n))),e}traverseSequence(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseSequenceItems(e))),this.traversals.sequence)}traverseSequenceItems(e){return e.canvases&&(e.canvases=e.canvases.map(n=>this.traverseCanvas(n))),e}traverseCanvas(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCanvasItems(e))),this.traversals.canvas)}traverseCanvasItems(e){return e.images&&(e.images=e.images.map(n=>this.traverseAnnotation(n))),e.otherContent&&(e.otherContent=e.otherContent.map(n=>this.traverseAnnotationList(n))),e}traverseRange(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseRangeItems(e))),this.traversals.range)}traverseRangeItems(e){if(this.options.mergeMemberProperties){const n=[...(e.ranges||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Range"}:i),...(e.canvases||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Canvas"}:i),...e.members||[]];delete e.ranges,delete e.canvases,e.members=n.length?n.map(i=>this.traverseUnknown(i)):void 0}return e}traverseAnnotationList(e){const n=typeof e=="string"?{"@id":e,"@type":"sc:AnnotationList"}:e;return this.traverseType(this.traverseDescriptive(this.traverseAnnotationListItems(n)),this.traversals.annotationList)}traverseAnnotationListItems(e){return e.resources&&(e.resources=e.resources.map(n=>this.traverseAnnotation(n))),e}traverseAnnotation(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseAnnotationItems(e))),this.traversals.annotation)}traverseAnnotationItems(e){return e.resource&&(Array.isArray(e.resource)?e.resource=e.resource.map(n=>this.traverseContentResource(n)):e.resource=this.traverseContentResource(e.resource)),e.on,e}traverseLayer(e){return this.traverseType(this.traverseLinking(this.traverseLayerItems(e)),this.traversals.layer)}traverseLayerItems(e){return e.otherContent&&(e.otherContent=e.otherContent.map(n=>this.traverseAnnotationList(n))),e}traverseChoice(e){return this.traverseType(this.traverseChoiceItems(e),this.traversals.choice)}traverseChoiceItems(e){return e.default&&e.default!=="rdf:nil"&&(e.default=this.traverseContentResource(e.default)),e.item&&e.item!=="rdf:nil"&&(e.item=e.item.map(n=>this.traverseContentResource(n))),e}traverseService(e){return this.traverseType(this.traverseLinking(e),this.traversals.service)}traverseContentResource(e){return e["@type"]==="oa:Choice"?this.traverseChoice(e):this.traverseType(this.traverseDescriptive(this.traverseLinking(e)),this.traversals.contentResource)}traverseUnknown(e){if(!e["@type"]||typeof e=="string")return e;switch(ZM(e)){case"sc:Collection":return this.traverseCollection(e);case"sc:Manifest":return this.traverseManifest(e);case"sc:Canvas":return this.traverseCanvas(e);case"sc:Sequence":return this.traverseSequence(e);case"sc:Range":return this.traverseRange(e);case"oa:Annotation":return this.traverseAnnotation(e);case"sc:AnnotationList":return this.traverseAnnotationList(e);case"sc:Layer":return this.traverseLayer(e);case"Service":return this.traverseService(e);case"oa:Choice":return this.traverseChoice(e);case"ContentResource":return this.traverseContentResource(e)}return e.profile?this.traverseService(e):e}traverseImageResource(e){const n=Array.isArray(e),i=Array.isArray(e)?e:[e],a=[];for(const u of i)typeof u=="string"?a.push(this.traverseContentResource({"@id":u,"@type":"dctypes:Image"})):a.push(this.traverseContentResource(u));return!n&&!this.options.convertPropsToArray?a[0]:a}traverseDescriptive(e){return e.thumbnail&&(e.thumbnail=this.traverseImageResource(e.thumbnail)),e.logo&&(e.logo=this.traverseImageResource(e.logo)),e}traverseOneOrMoreServices(e){const n=Array.isArray(e),i=Array.isArray(e)?e:[e],a=[];for(const u of i)a.push(this.traverseService(u));return!n&&!this.options.convertPropsToArray?a[0]:a}traverseLinking(e){return e.related&&(e.related=this.traverseOneOrManyType(e.related,this.traversals.contentResource)),e.rendering&&(e.rendering=this.traverseOneOrManyType(e.rendering,this.traversals.contentResource)),e.service&&(e.service=this.traverseOneOrMoreServices(e.service)),e.seeAlso&&(e.seeAlso=this.traverseOneOrManyType(e.seeAlso,this.traversals.contentResource)),e.within&&(typeof e.within=="string"||(e.within=this.traverseOneOrManyType(e.within,this.traversals.contentResource))),e.startCanvas&&(typeof e.startCanvas=="string"?e.startCanvas=this.traverseType({"@id":e.startCanvas,"@type":"sc:Canvas"},this.traversals.canvas):e.startCanvas&&this.traverseType(e.startCanvas,this.traversals.canvas)),e.contentLayer&&(typeof e.contentLayer=="string"?e.contentLayer=this.traverseLayer({"@id":e.contentLayer,"@type":"sc:Layer"}):e.contentLayer=this.traverseLayer(e.contentLayer)),e}traverseOneOrManyType(e,n){if(!Array.isArray(e))if(this.options.convertPropsToArray)e=[e];else return this.traverseType(e,n);return e.map(i=>this.traverseType(i,n))}traverseType(e,n){return n.reduce((i,a)=>{const u=a(i);return typeof u>"u"&&!this.options.allowUndefinedReturn?i:u},e)}}const JM="http://library.stanford.edu/iiif/image-api/compliance.html#level0",H1="http://library.stanford.edu/iiif/image-api/compliance.html#level1",V1="http://library.stanford.edu/iiif/image-api/compliance.html#level2",eO="http://library.stanford.edu/iiif/image-api/conformance.html#level0",$1="http://library.stanford.edu/iiif/image-api/conformance.html#level1",W1="http://library.stanford.edu/iiif/image-api/conformance.html#level2",tO="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",q1="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",Y1="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",nO="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",Q1="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",G1="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",iO="http://iiif.io/api/image/1/level0.json",rO="http://iiif.io/api/image/1/profiles/level0.json",X1="http://iiif.io/api/image/1/level1.json",K1="http://iiif.io/api/image/1/profiles/level1.json",Z1="http://iiif.io/api/image/1/level2.json",J1="http://iiif.io/api/image/1/profiles/level2.json",sO="http://iiif.io/api/image/2/level0.json",aO="http://iiif.io/api/image/2/profiles/level0.json",eS="http://iiif.io/api/image/2/level1.json",tS="http://iiif.io/api/image/2/profiles/level1.json",nS="http://iiif.io/api/image/2/level2.json",iS="http://iiif.io/api/image/2/profiles/level2.json",oO="level0",rS="level1",sS="level2",lO="http://iiif.io/api/image/2/level0",aS="http://iiif.io/api/image/2/level1",oS="http://iiif.io/api/image/2/level2",uO=[aS,oS,H1,V1,$1,W1,q1,Y1,Q1,G1,X1,K1,Z1,J1,eS,tS,nS,iS,rS,sS],cO=[lO,aS,oS,JM,H1,V1,eO,$1,W1,tO,q1,Y1,nO,Q1,G1,iO,rO,X1,K1,Z1,J1,sO,aO,eS,tS,nS,iS,oO,rS,sS];function Ms(t){for(const e in t)(typeof t[e]>"u"||t[e]===null)&&delete t[e];return t}const yv={attributionLabel:"Attribution",lang:"none",providerId:"http://example.org/provider",providerName:"Unknown"};function so(t,e="none"){if(!t)return{};const n=Array.isArray(t)?t:[t],i={};for(const a of n){if(typeof a=="string"){i[e]=i[e]?i[e]:[],i[e].push(a||"");continue}if(!a["@language"]){i[e]=i[e]?i[e]:[],i[e].push(a["@value"]||"");continue}const u=a["@language"];i[u]=i[u]?i[u]:[],i[u].push(a["@value"]||"")}return i}function lS(t){if(Array.isArray(t))return lS(t.find(e=>typeof e=="string"));if(cO.indexOf(t)!==-1)return"level2";if(uO.indexOf(t)!==-1)return"level1";if(typeof t=="string")return t}function fO(t){const e=Array.isArray(t)?t:[t];for(const n of e)switch(n){case"http://iiif.io/api/image/2/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2":return"ImageService2";case"http://iiif.io/api/image/1/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/context.json":return"ImageService1";case"http://iiif.io/api/annex/openannotation/context.json":return"ImageApiSelector"}}function dO(t){switch(t){case"http://iiif.io/api/image/2/level0.json":case"http://iiif.io/api/image/2/level1.json":case"http://iiif.io/api/image/2/level2.json":return"ImageService2";case"http://iiif.io/api/auth/1/kiosk":case"http://iiif.io/api/auth/1/login":case"http://iiif.io/api/auth/1/clickthrough":case"http://iiif.io/api/auth/1/external":case"http://iiif.io/api/auth/0/kiosk":case"http://iiif.io/api/auth/0/login":case"http://iiif.io/api/auth/0/clickthrough":case"http://iiif.io/api/auth/0/external":return"AuthCookieService1";case"http://iiif.io/api/auth/1/token":case"http://iiif.io/api/auth/0/token":return"AuthTokenService1";case"http://iiif.io/api/auth/1/logout":case"http://iiif.io/api/auth/0/logout":return"AuthLogoutService1";case"http://iiif.io/api/search/1/search":case"http://iiif.io/api/search/0/search":return"SearchService1";case"http://iiif.io/api/search/1/autocomplete":case"http://iiif.io/api/search/0/autocomplete":return"AutoCompleteService1"}}function uS(t){for(const e of["sc","oa","dcterms","dctypes","iiif"])if(t.startsWith(`${e}:`))return t.slice(e.length+1);return t}const hO=["Collection","Manifest","Annotation","AnnotationPage","Range","Service"];function Sv(t){const e=t["@id"]||t.id;let n=t["@type"]||t.type;const i=t.profile||void 0,a=t["@context"]||void 0;if(i){const u=dO(i);if(u)return u}if(a){const u=fO(a);if(u)return u}if(n){if(Array.isArray(n)){if(n.indexOf("oa:CssStylesheet")!==-1)return"CssStylesheet";if(n.indexOf("cnt:ContentAsText")!==-1)return"TextualBody";n=n[0]}for(const u of["sc","oa","dcterms","dctypes","iiif"])if(n.startsWith(`${u}:`)){n=n.slice(u.length+1);break}switch(n){case"Layer":return"AnnotationCollection";case"AnnotationList":return"AnnotationPage";case"cnt:ContentAsText":return"TextualBody"}}if(n&&hO.indexOf(n)!==-1)return n;if(t.format){if(t.format.startsWith("image/"))return"Image";if(t.format.startsWith("text/")||t.format==="application/pdf")return"Text";if(t.format.startsWith("application/"))return"Dataset"}return e&&(e.endsWith(".jpg")||e.endsWith(".png")||e.endsWith(".jpeg"))?"Image":n||"unknown"}const pO=/http(s)?:\/\/(creativecommons.org|rightsstatements.org)[^"'\\<\n]+/gm;function vO(t){const e=t.match(pO);return e?e[0]:t}function mO(t,e="Rights/License",n="none"){let i=null;const a=[],u=Array.isArray(t)?t:[t];for(const f of u){const p=f?vO(f):void 0;if(p&&(p.indexOf("creativecommons.org")!==-1||p.indexOf("rightsstatements.org")!==-1)){p.startsWith("https://")?i=`http://${p.slice(8)}`:i=p;continue}p&&a.push({label:{[n]:[e]},value:{[n]:[p]}})}return[i,a]}const gO=["http://iiif.io/api/presentation/2/context.json","http://iiif.io/api/image/2/context.json","http://iiif.io/api/image/1/context.json","http://library.stanford.edu/iiif/image-api/1.1/context.json","http://iiif.io/api/search/1/context.json","http://iiif.io/api/search/0/context.json","http://iiif.io/api/auth/1/context.json","http://iiif.io/api/auth/0/context.json","http://iiif.io/api/annex/openannotation/context.json"];function yO(t){if(t){const e=Array.isArray(t)?t:[t],n=[];for(const i of e)i==="http://iiif.io/api/presentation/2/context.json"&&n.push("http://iiif.io/api/presentation/3/context.json"),gO.indexOf(i)===-1&&n.push(i);if(e.length)return n.length===1?n[0]:n}}function SO(t){return t?t.map(e=>({label:so(e.label),value:so(e.value)})):[]}let cS=0;function fS(t,e){const n=encodeURI(t.id||t["@id"]||"").trim();return n&&e?`${n}/${e}`:n||(cS++,`http://example.org/${t["@type"]}${e?`/${e}`:""}/${cS}`)}function Os(t){const e=[...t.behavior||[]];t.viewingHint&&e.push(t.viewingHint);let n;return Array.isArray(t.motivation)?n=t.motivation.map(uS):t.motivation&&(n=uS(t.motivation)),{"@context":t["@context"]?yO(t["@context"]):void 0,id:(t["@id"]||fS(t)).trim(),type:Sv(t),behavior:e.length?e:void 0,height:t.height?t.height:void 0,width:t.width?t.width:void 0,motivation:n,viewingDirection:t.viewingDirection,profile:t.profile,format:t.format?t.format:void 0,duration:void 0,timeMode:void 0}}function _s(t){const[e,n]=mO(t.license),i=[...t.metadata?SO(t.metadata):[],...n];return{rights:e,metadata:i.length?i:void 0,label:t.label?so(t.label):void 0,requiredStatement:t.attribution?{label:so(yv.attributionLabel),value:so(t.attribution)}:void 0,navDate:t.navDate,summary:t.description?so(t.description):void 0,thumbnail:bO(t.thumbnail)}}function bO(t){return t&&(Array.isArray(t)?t:[t]).map(n=>typeof n=="string"?{id:n,type:"Image"}:(n.type==="unknown"&&(n.type="Image"),n))}function EO(t){if(!t.within)return;const e=Array.isArray(t.within)?t.within:[t.within],n=[];for(const i of e)if(typeof i=="string"){if(i)switch(t["@type"]){case"sc:Manifest":n.push({id:i,type:"Collection"});break}}else i["@id"]&&n.push({id:i["@id"],type:Sv(i)});return n.length?n:void 0}function ha(t){const e=t.related?Array.isArray(t.related)?t.related:[t.related]:[],n=t.contentLayer;return{provider:t.logo||e.length?[{id:yv.providerId,type:"Agent",homepage:e.length?[e[0]]:void 0,logo:t.logo?Array.isArray(t.logo)?t.logo:[t.logo]:void 0,label:so(yv.providerName)}]:void 0,partOf:EO(t),rendering:t.rendering,seeAlso:t.seeAlso,start:t.startCanvas,service:t.service?Nl(t.service):void 0,supplementary:n?[n]:void 0}}function xO(t){return{chars:t.chars,format:t.format?t.format:void 0,language:t.language}}function wO(t){return Ms({...Os(t),..._s(t),...ha(t),items:t.members})}function CO(t){const e=[],n=[];let i;for(const u of t.sequences||[])u.canvases.length&&e.push(...u.canvases),u.behavior&&n.push(...u.behavior),u.startCanvas&&(i=u.startCanvas);const a=Os(t);return n.length&&(a.behavior?a.behavior.push(...n):a.behavior=n),Ms({...a,..._s(t),...ha(t),start:i,items:e,structures:t.structures})}function TO(t){return Ms({...Os(t),..._s(t),...ha(t),annotations:t.otherContent&&t.otherContent.length?t.otherContent:void 0,items:t.images&&t.images.length?[{id:fS(t,"annotation-page"),type:"AnnotationPage",items:t.images}]:void 0})}function RO(t){return Ms({...Os(t),..._s(t),...ha(t),items:t.resources&&t.resources.length?t.resources:void 0})}function AO(t){return!t.canvases||t.canvases.length===0?{canvases:[],behavior:[]}:{canvases:t.canvases,behavior:t.viewingHint?[t.viewingHint]:[],startCanvas:t.startCanvas}}function MO(t){function e(n){if(Array.isArray(n)){if(n.length>1)return{type:"List",items:n.map(e)};n=n[0]}if(typeof n=="string")return encodeURI(n).trim();if("@type"in n){let i;if(typeof n.full=="string")i=n.full;else if(n.full["@type"]==="dctypes:Image")i={id:n.full["@id"],type:"Image"};else if(n.full["@type"]==="sc:Canvas")i={id:n.full["@id"],type:"Canvas"};else throw new Error(`Unsupported source type on annotation: ${n.full["@type"]}`);return{type:"SpecificResource",source:i,selector:Ev(n.selector)}}else return encodeURI(n["@id"]).trim()}return Ms({...Os(t),..._s(t),...ha(t),target:e(t.on),body:Array.isArray(t.resource)?t.resource.map(bv):bv(t.resource)})}function bv(t){const e=t;return Ms({...Os(e),..._s(e),...ha(e),...xO(e)})}function OO(t){const e=[];return t.default&&t.default!=="rdf:nil"&&e.push(t.default),t.item&&t.item!=="rdf:nil"&&e.push(...t.item),{...Os(t),..._s(t),items:e}}function _O(t){return Ms({...Os(t),..._s(t),...ha(t),items:t.members})}function LO(t){const{"@id":e,"@type":n,"@context":i,profile:a,...u}=t,f={};return e&&(f["@id"]=e),f["@type"]=Sv(t),f["@type"]==="unknown"&&(i&&i.length&&(f["@context"]=i),f["@type"]="Service"),a&&(f.profile=lS(a)),Ms({...f,...u})}function PO(t){return Ms({...Os(t),..._s(t),...ha(t)})}const DO=new gv({collection:[wO],manifest:[CO],canvas:[TO],annotationList:[RO],sequence:[AO],annotation:[MO],contentResource:[bv],choice:[OO],range:[_O],service:[LO],layer:[PO]});function kO(t){return t&&t["@context"]&&(t["@context"]==="http://iiif.io/api/presentation/2/context.json"||t["@context"].indexOf("http://iiif.io/api/presentation/2/context.json")!==-1||t["@context"]==="http://www.shared-canvas.org/ns/context.json")||t["@context"]==="http://iiif.io/api/image/2/context.json"?DO.traverseUnknown(t):t}function Ev(t){if((Array.isArray(t["@type"])&&t["@type"].includes("oa:SvgSelector")||t["@type"]=="oa:SvgSelector")&&("chars"in t||"value"in t))return{type:"SvgSelector",value:"chars"in t?t.chars:t.value};if(t["@type"]==="oa:FragmentSelector")return{type:"FragmentSelector",value:t.value};if(t["@type"]==="oa:Choice")return[Ev(t.default),...(Array.isArray(t.item)?t.item:[t.item]).map(Ev)];if(t["@type"]=="iiif:ImageApiSelector")return{type:"ImageApiSelector",region:"region"in t?t.region:void 0,rotation:"rotation"in t?t.rotation:void 0};throw new Error(`Unsupported selector type: ${t["@type"]}`)}function xv(t,e={}){if(Array.isArray(t))return xv(t[0]);if(typeof t=="string"){const[n,i]=t.split("#");return i?{type:"SpecificResource",source:{id:n,type:e.typeHint||"Unknown"},selector:{type:"FragmentSelector",value:i}}:{type:"SpecificResource",source:{id:n,type:e.typeMap&&e.typeMap[n]||e.typeHint||"Unknown"}}}if(t.type==="Choice"||t.type==="List"||t.type==="Composite"||t.type==="Independents")return xv(t.items[0]);if(t.type==="SpecificResource")return t.source.type==="Canvas"&&t.source.partOf&&typeof t.source.partOf=="string"&&(t.source.partOf=[{id:t.source.partOf,type:"Manifest"}]),t.selector?{type:"SpecificResource",source:t.source,selector:t.selector}:{type:"SpecificResource",source:t.source};if(t.id){t.type==="Canvas"&&t.partOf&&typeof t.partOf=="string"&&(t.partOf=[{id:t.partOf,type:"Manifest"}]);const[n,i]=t.id.split("#");return i?{type:"SpecificResource",source:{...t,id:n},selector:{type:"FragmentSelector",value:i}}:{type:"SpecificResource",source:{...t,id:n}}}return{type:"SpecificResource",source:t}}function IO(){return{Collection:{},Manifest:{},Canvas:{},AnnotationPage:{},AnnotationCollection:{},Annotation:{},ContentResource:{},Range:{},Service:{},Selector:{},Agent:{}}}function dS(t,e){if(typeof t=="string")return{id:t,type:e};if(!t.id)throw new Error(`Invalid resource does not have an ID (${JSON.stringify(t)}, ${e})`);return t}function NO(t,e){return(n,i)=>{const a=t[n]?t[n]:{};return(u,f)=>{const p=dS(u,i||n);return p&&p.id&&n?(a[p.id]=a[p.id]?Cv(a[p.id],p,{parent:f.parent,isTopLevel:e.id===p.id}):Cv({id:p.id,type:p.type},p,{parent:f.parent,isTopLevel:e.id===p.id}),{id:p.id,type:n==="ContentResource"?n:p.type}):p}}}function wv(t,e,n){if(!e)return t;if(Array.isArray(t)){if(!Array.isArray(e))throw new Error("Cannot merge array with non-array");const i=[...t];for(const a of e)if(a["@id"]&&!a.id&&(a.id=a["@id"]),a["@type"]&&!a.type&&(a.type=a["@type"]),a!=null)if(Array.isArray(a))i.push(a);else if(typeof a=="object"&&a.id&&a.type){const u=i.findIndex(f=>f.id===a.id&&f.type===a.type);u>=0&&(i[u]=wv(i[u],a))}else t.indexOf(a)===-1&&i.push(a);return i}else if(typeof t=="object"){if(Array.isArray(e)||typeof e!="object")throw new Error("Cannot merge object with non-object");const i={...t},a=[],u=[],f=Object.keys(t).filter(S=>S!==zn&&S!=="id"&&S!=="type"),p={},g={};for(const[S,m]of Object.entries(e)){if(S===zn||S==="id"||S==="type")continue;const x=i[S];x===m?u.push(S):x===ze||!x?(a.push(S),i[S]=m):(x&&m&&(p[S]=x,g[S]=m),i[S]=wv(x,m),i[S]===p[S]&&(u.push(S),delete p[S]))}if(n&&(n.parent&&n.parent.id||n.isTopLevel)){const S=[],m={};if(n.parent?m[Kr]=n.parent.id:n.isTopLevel&&(m[Kr]=t.id),i[zn]&&i[zn].length){const x=!(i[zn]||[]).find(_=>_["@explicit"]),R=a.length>0||u.length!==f.length;if(x&&R)for(const _ of i[zn]){const M={..._},k=Object.keys(p);if(M){M["@explicit"]=!0;for(const L of f)L!==zn&&(M[L]=vc);for(const L of k)M[L]=p[L]}S.push(M)}else S.push(...i[zn]);if(R){const _=Object.keys(g);m["@explicit"]=!0;for(const M of a)m[M]=vc;for(const M of u)m[M]=vc;for(const M of _)m[M]=g[M]}}m.id=i.id,m.type=i.type,S.push(m),i[zn]=S}return i}else if(t)return t;return e}function Cv(t,e,n){if(typeof t=="string")return t;if(e.id!==t.id||e.type!==t.type){if(e.type==="ImageService3")return e;if(t.type==="ImageService3")return t;throw new Error(`Can only merge entities with identical identifiers and type! ${e.type}(${e.id}) => ${t.type}(${t.id})`)}return wv({...t},e,n)}function zO(t){return(e,n)=>i=>{const{id:a,type:u}=dS(i,n||e);if(typeof a>"u")throw new Error("Found invalid entity without an ID.");return e==="ContentResource"||e==="Service"?t[a]=e:t[a]=u,i}}function UO(t){const e=Object.assign({},t);if(e["@id"]&&(e.id=e["@id"]),e["@type"]&&(e.type=e["@type"]),e.service){const n=[];e.service=Array.isArray(e.service)?e.service:[e.service];for(const i of e.service)n.push({id:i["@id"]||i.id,type:i["@type"]||i.type});e.service=n}return Object.assign({},XM,e)}function jO(t){return e=>{t.Service=t.Service?t.Service:{};const n=e.id||e["@id"],i=UO(e);return i&&i.id&&(t.Service[i.id]?t.Service[n]=Cv(t.Service[n],i):t.Service[n]=i),e}}function FO(t){const e=JSON.stringify(t);let n=5381,i=e.length;for(;i;)n=n*33^e.charCodeAt(--i);const u=(n>>>0).toString(16);return u.length%2?"0"+u:u}function Tv(t){return e=>typeof e=="string"?{id:e,type:t}:e.id?e.type?e:{type:t,...e}:{id:`vault://${FO(e)}`,type:t,...e}}function zl(t){return e=>({...t,...e})}function gc(t){return Array.isArray(t)?t:[t]}function BO(t){return t.body&&(t.body=gc(t.body)),t.seeAlso&&(t.seeAlso=gc(t.seeAlso)),t.audience&&(t.audience=gc(t.audience)),t.accessibility&&(t.accessibility=gc(t.accessibility)),t.motivation&&(t.motivation=gc(t.motivation)),t}function hS(t,{typeHint:e,partOfTypeHint:n}={}){if(typeof t=="string"&&(t={id:t,type:e||"unknown"}),da(t))return typeof t.source=="string"&&(t.source={id:t.source,type:e||"unknown"}),t.source.type==="Canvas"&&t.source.partOf&&typeof t.source.partOf=="string"&&(t.source.partOf=[{id:t.source.partOf,type:n||"Manifest"}]),t;let i;if((t.id||"").indexOf("#")!==-1){const[a,u]=(t.id||"").split("#");t.id=a,u&&(i={type:"FragmentSelector",value:u})}return{type:"SpecificResource",source:t,selector:i}}function HO(t){const e=Object.assign({},t);return t&&t.items&&(e.items=t.items.map(n=>typeof n=="string"||n.type==="Canvas"?hS(n):n)),e}function VO(t){const e=Object.assign({},t);return e.start?(e.start=hS(e.start,{typeHint:"Canvas"}),e):t}function $O(t){const e=Object.assign({},t);return e.target?(e.target=xv(e.target,{typeHint:"Canvas"}),e):t}function WO(t){return t}function Rv(t){return typeof t.items>"u"&&(t[mc]=!0),t}function qO(t){const e=kO(t),n=IO(),i={},a=NO(n,e),u=zO(i),p=new mv({collection:[Rv,zl(qM),u("Collection"),a("Collection")],manifest:[Rv,zl(YM),VO,u("Manifest"),a("Manifest")],canvas:[zl(WM),u("Canvas"),a("Canvas")],annotationPage:[Rv,Tv("AnnotationPage"),zl($M),u("AnnotationPage"),a("AnnotationPage")],annotation:[Tv("Annotation"),BO,$O,u("Annotation"),a("Annotation")],contentResource:[Tv("ContentResource"),u("ContentResource"),a("ContentResource")],range:[zl(QM),HO,u("Range","Canvas"),a("Range","Canvas")],agent:[zl(GM),u("Agent"),a("Agent")],specificResource:[WO],service:[jO(n)]}).traverseUnknown(e);return{entities:n,resource:p,mapping:i}}function YO(t){const e={};for(const[n,i]of t){if(n===U1&&i!==Mr)return i;i!==Mr&&typeof i<"u"&&i!==null&&(e[n]=i)}return e}function QO(t,e,n){if(!e.type||!e.id)throw new Error("Unknown entity");if(!n[e.type])throw new Error(`Serializer not found for ${e.type}`);function i(a,u,f=0){const p=n[a.type];if(!p)return Mr;if(f>20)throw new Error("Circular reference: "+a.id+" "+a.type);const[g,S]=j1(t,a.type?a:a.id,u)||(a.id&&a.type?a:null);if(!g)return Mr;const m=p(g,t,{parent:u,isTopLevel:e.id===a.id,fullResource:S});let x=m.next();for(;!x.done;){const R=x.value;let _=Mr;if(R)if(Array.isArray(R)){const M=[];for(const k of R)M.push(i(k,a,f+1));_=M}else _=i(R,a,f+1);x=m.next(_)}return x.value===Mr?Mr:YO(x.value)}return i(e)}function yc(t,{allowSourceString:e=!0,allowString:n=!1,allowedStringType:i}={}){const a=u=>{if(e&&u&&u.source&&typeof u.source!="string"){const f=Object.keys(u.source);if(u.source.id&&u.source.type&&f.length===2)return{...u,source:u.source.id}}return u};if(t){if(t.source&&t.source.partOf)return a(t);const u=Object.keys(t);if(u.length===2&&t.type&&t.source||u.length===3&&t.type&&t.source&&u.indexOf("selector")!==-1&&!t.selector)return n&&(!i||i===t.source.type)?t.source.id:t.source.type==="ContentResource"?{type:"SpecificResource",source:t.source.id}:t.source;if(t.selector&&!Array.isArray(t.selector)&&typeof t.selector!="string"&&t.selector.type==="FragmentSelector"){const f=`${t.source.id}#${t.selector.value}`;return n?f:{id:f,type:t.source.type}}}return a(t)}function Ul(t){if(!t)return;const e=Object.keys(t);if(e.length!==0){if(e.length===1){const n=e[0];if(!n)return"";const i=(t[n]||[]).join("");return n==="@none"||n==="none"||n==="en"?i:{"@language":n,"@value":i}}return e.map(n=>({"@language":n,"@value":(t[n]||[]).join("")}))}}function pS(t){return Array.isArray(t)?t.map(e=>pS(e)):typeof t=="string"?t:t.type&&t.type==="Canvas"?t.id:t}function pa(t,e=!1){if(t)return t.length>1&&!e?t:t[0]||void 0}function GO(t){if(t){if(typeof t=="string")return{"@id":t};if("@id"in t){const e={...t};return delete e["@type"],e}return{"@context":"http://iiif.io/api/image/2/context.json","@id":t.id,profile:`http://iiif.io/api/image/2/profiles/${t.profile}.json`}}}function ao(t,e){return[["@id",t.id],["@type",e],["format",t.format],["height",t.height],["width",t.width],["viewingDirection",t.viewingDirection!=="left-to-right"?t.viewingDirection:void 0],["license",t.license?t.license:void 0]]}function*oo(t){const e=t.provider?yield t.provider[0]:void 0;return[["label",Ul(t.label)],["metadata",t.metadata&&t.metadata.length?t.metadata.map(n=>({label:Ul(n.label)||"",value:Ul(n.value)||""})):void 0],["description",Ul(t.summary)],["thumbnail",pa(yield t.thumbnail)],["navDate",t.navDate],["logo",e?pa(e.logo):void 0],["homepage",e?e.homepage:void 0],["attribution",t.requiredStatement?Ul(t.requiredStatement.value):void 0]]}function*Sc(t){const e=t.start&&t.start.type&&t.start.type==="SpecificResource"?yc(t.start):t.start;return[["seeAlso",pa(yield t.seeAlso)],["service",pa((t.service||[]).map(GO))],["rendering",pa(yield t.rendering)],["startCanvas",e?e.id:void 0]]}function XO(t){return t.type==="SpecificResource"}function KO(t){return t&&t.type==="FragmentSelector"}function ZO(t){if(t&&XO(t)){let e=t.id;const n=t.selector?Array.isArray(t.selector)?t.selector[0]:t.selector:void 0;return KO(n)&&(e+="#"+n.value),e}return t==null?void 0:t.id}const JO={Manifest:function*(t,e,{isTopLevel:n}){return[...n?[["@context","http://iiif.io/api/presentation/2/context.json"]]:[],...ao(t,"sc:Manifest"),...yield*oo(t),...yield*Sc(t),["sequences",[{"@id":`${t.id}/sequence0`,"@type":"sc:Sequence",canvases:yield t.items}]],["structures",yield t.structures]]},Canvas:function*(t){const n=(yield t.items)[0];return[...ao(t,"sc:Canvas"),...yield*oo(t),...yield*Sc(t),["images",n?[n.resources]:void 0],["annotations",t.annotations&&t.annotations.length?pa(yield t.annotations):void 0]]},AnnotationPage:function*(t){return[...ao(t,"sc:AnnotationList"),...yield*oo(t),["resources",t.items&&t.items.length?pa(yield t.items):void 0]]},Annotation:function*(t){return[["@id",t.id],["@type","oa:Annotation"],["motivation","sc:painting"],["on",pS(t.target)],["resource",pa(yield t.body,!0)]]},ContentResource:function*(t){switch(t.type){case"Image":return[...ao(t,"dctypes:Image"),...yield*oo(t),...yield*Sc(t)];case"Text":case"Dataset":default:return[...ao(t,void 0),...yield*oo(t)]}},AnnotationCollection:function*(t){return[["@id",t.id],["@type","sc:Layer"],["label",Ul(t.label)]]},Collection:function*(t){return[...ao(t,"sc:Collection"),...yield*oo(t),...yield*Sc(t),["members",yield*t.items]]},Range:function*(t){const e=[],n=[];if(t.items)for(const i of t.items){const a=i.type==="SpecificResource"?i.source:i;if(a){const u=yield a;e.push({"@id":ZO(i),"@type":a.type,label:u?u.label:void 0,within:t.id}),a.type==="Canvas"&&n.push(a.id)}}return[...ao(t,"sc:Range"),...yield*oo(t),...yield*Sc(t),["canvases",n.length===e.length?n:void 0],["members",n.length!==e.length?e:void 0]]}};function lo(t){var e;return[["id",(e=t.id)!=null&&e.startsWith("vault://")?void 0:t.id],["type",t.type],["format",t.format],["profile",t.profile],["height",t.height||void 0],["width",t.width||void 0],["duration",t.duration||void 0],["viewingDirection",t.viewingDirection!=="left-to-right"?t.viewingDirection:void 0],["behavior",t.behavior&&t.behavior.length?t.behavior:void 0],["timeMode",t.timeMode],["motivation",Array.isArray(t.motivation)?t.motivation[0]:t.motivation],[zn,Mr]]}function _n(t){if(t===Mr||!t||t.length===0)return;const e=t.filter(n=>n!==Mr);if(e.length!==0)return e}function vS(t){if(t&&t.type&&t.type==="ImageService2"){const{id:e,type:n,profile:i,...a}=t,u=typeof i=="string"?i:Array.isArray(i)?i.find(f=>typeof f=="string"):"";return{"@id":e,"@type":n,profile:u?u.startsWith("http")?u:`http://iiif.io/api/image/2/${u}.json`:"http://iiif.io/api/image/2/level0.json",...a}}return t}function mS(t){if(Array.isArray(t)||(t=t?[t]:[]),!(!t||t.length===0))return t.map(vS)}function*va(t){return[["label",t.label],["metadata",_n(t.metadata)],["summary",t.summary],["requiredStatement",t.requiredStatement],["rights",Array.isArray(t.rights)?t.rights[0]||void 0:t.rights||void 0],["navDate",t.navDate],["language",t.language],["thumbnail",_n(yield t.thumbnail)],["placeholderCanvas",yield t.placeholderCanvas],["accompanyingCanvas",yield t.accompanyingCanvas],["provider",_n(yield t.provider)]]}function*ma(t){return[["seeAlso",_n(yield t.seeAlso)],["service",_n(mS(t.service))],["services",_n(mS(t.services))],["rendering",_n(yield t.rendering)],["supplementary",_n(yield t.supplementary)],["homepage",_n(yield t.homepage)],["logo",_n(yield t.logo)],["partOf",_n(yield t.partOf)],["start",t.start?yc(t.start):t.start]]}const e_={Manifest:function*(t,e,{isTopLevel:n}){return n?[["@context",t["@context"]?t["@context"]:"http://iiif.io/api/presentation/3/context.json"],...lo(t),...yield*va(t),...yield*ma(t),["items",yield t.items],["structures",_n(yield t.structures)],["annotations",_n(yield t.annotations)],["navPlace",t.navPlace]]:[...lo(t),...yield*va(t)]},Canvas:function*(t){return[...lo(t),...yield*va(t),...yield*ma(t),["items",yield t.items],["annotations",_n(yield t.annotations)],["navPlace",t.navPlace]]},Agent:function*(t){return[["id",t.id],["type","Agent"],["label",t.label],...yield*ma(t)]},AnnotationPage:function*(t){var e;const n=Object.entries(t).map(([a,u])=>[a,Array.isArray(u)?_n(u):u]).filter(([a,u])=>a!=="items"&&a!=="id"&&a!==zn&&a!==Kr&&a!==mc),i=yield t.items;return[["id",(e=t.id)!=null&&e.startsWith("vault://")?void 0:t.id],...n,...yield*ma(t),["items",i.length||t[mc]===!1?i:Mr]]},Service:function*(t){return[[U1,vS(t)]]},Annotation:function*(t){const e=Object.entries(t).map(([i,a])=>i==="motivation"?[i,Array.isArray(a)?a[0]:a]:i==="target"?[i,yc(a,{allowString:!0,allowSourceString:!0,allowedStringType:"Canvas"})]:[i,Array.isArray(a)?_n(a):a]).filter(([i])=>i!=="body"&&i!==zn&&i!==mc);let n;if(Array.isArray(t.body)){const i=[];for(const a of t.body)if(a&&da(a)){const u={...a};u.source=yield a.source,i.push(yc(u,{allowSourceString:!0}))}else i.push(yield a);n=i}else t.body&&da(t.body)?(n={...t.body},n.source=yield t.body.source):n=yield t.body;return[...e,...yield*va(t),...yield*ma(t),["body",n.length===1?n[0]:n]]},ContentResource:function*(t){return t_([...lo(t),...yield*va(t),...yield*ma(t),["annotations",_n(yield t.annotations)],["items",_n(yield t.items)]],t)},AnnotationCollection:function*(t){return[["id",t.id],["type","AnnotationCollection"],["label",t.label]]},Collection:function*(t,e,{isTopLevel:n}){return n?[["@context","http://iiif.io/api/presentation/3/context.json"],...lo(t),...yield*va(t),...yield*ma(t),["items",_n(yield t.items)],["navPlace",t.navPlace]]:[...lo(t),...yield*va(t)]},Range:function*(t){const e=[];for(const n of t.items)n.type==="Range"?e.push(yield n):n&&n.type==="SpecificResource"?e.push(yc(n)):e.push(n);return[...lo(t),...yield*va(t),...yield*ma(t),["items",e],["annotations",_n(yield t.annotations)],["navPlace",t.navPlace]]}};function t_(t,e){const n=Object.keys(e),i=t.map(([a])=>a);for(const a of n)a===zn||a===mc||i.indexOf(a)===-1&&typeof e[a]<"u"&&t.push([a,e[a]]);return t}var n_=Object.defineProperty,i_=(t,e,n)=>e in t?n_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ga=(t,e,n)=>(i_(t,typeof e!="symbol"?e+"":e,n),n);const Ln=function(t){return function(){const e={type:t,getType:()=>t,toString:()=>t};return(n,i)=>({...e,...n!==void 0&&{payload:n},...i!==void 0&&{meta:i}})}},gS="@iiif/IMPORT_ENTITIES",yS="@iiif/MODIFY_ENTITY_FIELD",SS="@iiif/REORDER_ENTITY_FIELD",bS="@iiif/ADD_REFERENCE",Av="@iiif/UPDATE_REFERENCE",ES="@iiif/REMOVE_REFERENCE",xS="@iiif/ADD_METADATA",wS="@iiif/REMOVE_METADATA",Mv="@iiif/UPDATE_METADATA",CS="@iiif/REORDER_METADATA",TS=Ln(gS)(),r_=Ln(yS)(),s_=Ln(SS)(),a_=Ln(bS)(),o_=Ln(ES)(),l_=Ln(Av)(),u_=Ln(xS)(),c_=Ln(Mv)(),f_=Ln(wS)(),d_=Ln(CS)(),h_={importEntities:TS,modifyEntityField:r_,reorderEntityField:s_,addReference:a_,removeReference:o_,updateReference:l_,addMetadata:u_,removeMetadata:f_,updateMetadata:c_,reorderMetadata:d_},RS="@iiif/ADD_MAPPING",AS="@iiif/ADD_MAPPINGS",p_=Ln(RS)(),v_=Ln(AS)(),MS="@iiif/SET_META_VALUE",OS="@iiif/SET_META_VALUE_DYNAMIC",_S="@iiif/UNSET_META_VALUE",m_=Ln(MS)(),g_=Ln(OS)(),y_=Ln(_S)(),LS={setMetaValue:m_,setMetaValueDynamic:g_,unsetMetaValue:y_},Ov="RESOURCE_ERROR",PS="RESOURCE_LOADING",_v="RESOURCE_READY",DS="@iiif/REQUEST_RESOURCE",kS="@iiif/REQUEST_ERROR",IS="@iiif/REQUEST_MISMATCH",NS="@iiif/REQUEST_COMPLETE",S_="@iiif/REQUEST_OFFLINE_RESOURCE",b_=Ln(DS)(),Lv=Ln(kS)(),E_=Ln(IS)(),x_=Ln(NS)(),Pv="@iiif/BATCH",w_="@iiif/BATCH_IMPORT",Dv=Ln(Pv)(),C_=(t,e)=>{const{entities:n,resource:i,mapping:a}=qO(e);if(i.id===void 0)return[Lv({id:t,message:"ID is not defined in resource."})];const u=[TS({entities:n}),v_({mapping:a})];return i.id!==t&&(u.push(p_({id:t,type:i.type})),u.push(E_({requestId:t,actualId:i.id}))),u.push(x_({id:t})),u},zS=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function T_(t,e){return!!(t===e||zS(t)&&zS(e))}function US(t,e){if(!Array.isArray(t)||!Array.isArray(e))return t===e;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!T_(t[n],e[n]))return!1;return!0}function kv(t,e,n){const i=t.iiif.requests[e],a=t.iiif.mapping[e];if(!a||!t.iiif.entities[a][i.resourceUri])return;const u=t.iiif.entities[a][i.resourceUri];if(u&&u[zn]){const f=u[zn].find(p=>n?p[Kr]===n.id:p[Kr]===u.id);return vv(u,f)}return u}function R_(t){return t&&typeof t.then=="function"}function jS(t,e,{waitTimeout:n=30}={}){return(i,a)=>{const u=t.getStore(),f=u.getState(),p=f.iiif.requests[i];if(p){if(p.loadingState===_v){const S=kv(f,i);if(S)return S}switch(p.loadingState){case Ov:break;case PS:return(async()=>{let S,m=!1;try{const x=await Promise.race([new Promise((R,_)=>{m||(S=u.subscribe(()=>{const M=u.getState();if(M.iiif.requests[i].loadingState===Ov){_();return}if(M.iiif.requests[i].loadingState===_v){const k=kv(M,i);k?R(k):_()}}))}),new Promise((R,_)=>setTimeout(()=>{m=!0,_()},n*60*1e3))]);if(S&&S(),x)return x}catch{S&&S()}})()}}t.dispatch(b_({id:i}));const g=S=>{if(!S)return;!S.id&&!S["@id"]&&(S["@type"]&&(S["@id"]=i),S.id=i);const m=C_(i,S);return t.dispatch(Dv({actions:m})),kv(u.getState(),i)};try{const S=e(i,a);return R_(S)?(async()=>{try{return g(await S)}catch(m){throw t.dispatch(Lv({id:i,message:m.toString()})),m}})():g(S)}catch(S){throw t.dispatch(Lv({id:i,message:S.toString()})),S}}}function FS(){return{Collection:{},Manifest:{},Canvas:{},AnnotationPage:{},AnnotationCollection:{},Annotation:{},ContentResource:{},Range:{},Service:{},Selector:{},Agent:{}}}const BS=t=>{let e;const n=new Set,i=(f,p)=>{const g=typeof f=="function"?f(e):f;if(!Object.is(g,e)){const S=e;e=p??typeof g!="object"?g:Object.assign({},e,g),n.forEach(m=>m(e,S))}},a=()=>e,u={setState:i,getState:a,subscribe:f=>(n.add(f),()=>n.delete(f)),destroy:()=>{n.clear()}};return e=t(i,a,u),u},A_=t=>t?BS(t):BS,M_=(t,e)=>(n,i,a)=>(a.dispatch=u=>(n(f=>t(f,u),!1,u),u),a.dispatchFromDevtools=!0,{dispatch:(...u)=>a.dispatch(...u),...e}),O_=M_,Iv=new Map,Nd=t=>{const e=Iv.get(t);return e?Object.fromEntries(Object.entries(e.stores).map(([n,i])=>[n,i.getState()])):{}},__=(t,e,n)=>{if(t===void 0)return{type:"untracked",connection:e.connect(n)};const i=Iv.get(n.name);if(i)return{type:"tracked",store:t,...i};const a={connection:e.connect(n),stores:{}};return Iv.set(n.name,a),{type:"tracked",store:t,...a}},L_=(t,e={})=>(n,i,a)=>{const{enabled:u,anonymousActionType:f,store:p,...g}=e;let S;try{S=(u??!1)&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!S)return t(n,i,a);const{connection:m,...x}=__(p,S,g);let R=!0;a.setState=(k,L,P)=>{const O=n(k,L);if(!R)return O;const j=P===void 0?{type:f||"anonymous"}:typeof P=="string"?{type:P}:P;return p===void 0?(m==null||m.send(j,i()),O):(m==null||m.send({...j,type:`${p}/${j.type}`},{...Nd(g.name),[p]:a.getState()}),O)};const _=(...k)=>{const L=R;R=!1,n(...k),R=L},M=t(a.setState,i,a);if(x.type==="untracked"?m==null||m.init(M):(x.stores[x.store]=a,m==null||m.init(Object.fromEntries(Object.entries(x.stores).map(([k,L])=>[k,k===x.store?M:L.getState()])))),a.dispatchFromDevtools&&typeof a.dispatch=="function"){const k=a.dispatch;a.dispatch=(...L)=>{k(...L)}}return m.subscribe(k=>{var L;switch(k.type){case"ACTION":if(typeof k.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return Nv(k.payload,P=>{if(P.type==="__setState"){if(p===void 0){_(P.state);return}Object.keys(P.state).length!==1&&console.error(`
|
|
285
|
-
[zustand devtools middleware] Unsupported __setState action format.
|
|
286
|
-
When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
|
|
287
|
-
and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
|
|
288
|
-
`);const O=P.state[p];if(O==null)return;JSON.stringify(a.getState())!==JSON.stringify(O)&&_(O);return}a.dispatchFromDevtools&&typeof a.dispatch=="function"&&a.dispatch(P)});case"DISPATCH":switch(k.payload.type){case"RESET":return _(M),p===void 0?m==null?void 0:m.init(a.getState()):m==null?void 0:m.init(Nd(g.name));case"COMMIT":if(p===void 0){m==null||m.init(a.getState());return}return m==null?void 0:m.init(Nd(g.name));case"ROLLBACK":return Nv(k.state,P=>{if(p===void 0){_(P),m==null||m.init(a.getState());return}_(P[p]),m==null||m.init(Nd(g.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return Nv(k.state,P=>{if(p===void 0){_(P);return}JSON.stringify(a.getState())!==JSON.stringify(P[p])&&_(P[p])});case"IMPORT_STATE":{const{nextLiftedState:P}=k.payload,O=(L=P.computedStates.slice(-1)[0])==null?void 0:L.state;if(!O)return;_(p===void 0?O:O[p]),m==null||m.send(null,P);return}case"PAUSE_RECORDING":return R=!R}return}}),M},P_=L_,Nv=(t,e)=>{let n;try{n=JSON.parse(t)}catch(i){console.error("[zustand devtools middleware] Could not parse the received json",i)}n!==void 0&&e(n)},D_=t=>(e,n,i)=>{const a=i.subscribe;return i.subscribe=(u,f,p)=>{let g=u;if(f){const S=(p==null?void 0:p.equalityFn)||Object.is;let m=u(i.getState());g=x=>{const R=u(x);if(!S(m,R)){const _=m;f(m=R,_)}},p!=null&&p.fireImmediately&&f(m,m)}return a(g)},t(e,n,i)},k_=D_,I_=(t={},e)=>{switch(e.type){case RS:return{...t,[e.payload.id]:e.payload.type};case AS:return{...t,...e.payload.mapping};default:return t}};function zv(t,e,n,i){return!(!t[n]||!t[n][e]||!t[n][e][i]||!Array.isArray(t[n][e][i]))}function N_(t,e){const n={},i=[];for(const[a,u]of Object.entries(t||{})){i.push(a);const f=(e||{})[a];if(!f||f.length===0){n[a]=u;continue}n[a]=f}for(const[a,u]of Object.entries(e||{}))i.indexOf(a)===-1&&(n[a]=u);return n}function Ge(t){return t.payload}function Uv(t,e){return typeof t>"u"?e:t}const z_=(t=FS(),e)=>{var n;const i=(a,u)=>({...t,[Ge(e).type]:{...t[Ge(e).type],[Ge(e).id]:{...a,...u}}});switch(e.type){case yS:{if(!t[Ge(e).type]||!t[Ge(e).type][Ge(e).id])return t;const a=t[Ge(e).type][Ge(e).id];return typeof a=="string"?t:i(a,{[Ge(e).key]:Ge(e).value})}case SS:{if(!zv(t,Ge(e).id,Ge(e).type,Ge(e).key))return t;const a=t[Ge(e).type][Ge(e).id];if(typeof a=="string")return t;const u=Array.from(a[Ge(e).key]),[f]=u.splice(Ge(e).startIndex,1);return u.splice(Ge(e).endIndex,0,f),i(a,{[Ge(e).key]:u})}case gS:{const a=Object.keys(Ge(e).entities),u={...t};for(const f of a){const p=Ge(e).entities[f],g={...t[f]||{}};let S=!1;const m=Object.keys(p||{})||[];if(p&&m){for(const x of m)S=!0,g[x]=t[f][x]?N_(t[f][x],p[x]):p[x];S&&(u[f]=g)}}return u}case bS:{if(!zv(t,Ge(e).id,Ge(e).type,Ge(e).key))return t;const a=t[Ge(e).type][Ge(e).id],u=Array.from(a[Ge(e).key]);return u.splice(Uv(Ge(e).index,u.length+1),0,Ge(e).reference),i(a,{[Ge(e).key]:u})}case Av:case ES:{if(!zv(t,Ge(e).id,Ge(e).type,Ge(e).key))return t;const a=t[Ge(e).type][Ge(e).id],u=Array.from(a[Ge(e).key]),f=Uv(Ge(e).index,u.findIndex(p=>p&&p.id===Ge(e).reference.id));return f===-1||((n=u[f])==null?void 0:n.id)!==Ge(e).reference.id?t:(e.type===Av?u.splice(f,1,Ge(e).reference):u.splice(f,1),i(a,{[Ge(e).key]:u}))}case xS:{const a=t[Ge(e).type][Ge(e).id];if(!a)return t;const u=Array.from(a.metadata||[]),f=Ge(e);return u.splice(Uv(e.payload.beforeIndex,u.length+1),0,{label:f.label,value:f.label}),i(a,{metadata:u})}case CS:{const a=t[Ge(e).type][Ge(e).id];if(typeof a=="string"||!a)return t;const u=Array.from(a.metadata||[]),[f]=u.splice(Ge(e).startIndex,1);return u.splice(Ge(e).endIndex,0,f),i(a,{metadata:u})}case Mv:case wS:{const a=t[Ge(e).type][Ge(e).id],u=Array.from(a.metadata||[]),f=Ge(e).atIndex;return typeof f>"u"||f===-1||!u[f]?t:(e.type===Mv?u.splice(f,1,{label:Ge(e).label,value:Ge(e).value}):u.splice(f,1),i(a,{metadata:u}))}default:return t}},U_=(t={},e)=>{switch(e.type){case DS:case S_:return{...t,[e.payload.id]:{requestUri:e.payload.id,loadingState:PS,uriMismatch:!1,resourceUri:e.payload.id}};case IS:return{...t,[e.payload.requestId]:{...t[e.payload.requestId]||{},uriMismatch:!0,resourceUri:e.payload.actualId},[e.payload.actualId]:{requestUri:e.payload.requestId,loadingState:t[e.payload.requestId].loadingState,uriMismatch:!0,resourceUri:e.payload.actualId}};case kS:return{...t,[e.payload.id]:{...t[e.payload.id]||{},loadingState:Ov,error:e.payload.message}};case NS:return{...t,[e.payload.id]:{...t[e.payload.id]||{},loadingState:_v,error:void 0}}}return t},j_=(t={},e)=>{const{id:n,updateValue:i,value:a,meta:u,key:f}=e&&e.payload||{};switch(e.type){case MS:return{...t,[n]:{...t[n]||{},[u]:{...t[n]?t[n][u]||{}:{},[f]:a}}};case OS:return{...t,[n]:{...t[n]||{},[u]:{...t[n]?t[n][u]||{}:{},[f]:t[n]&&t[n][u]?i(t[n][u][f]):i(void 0)}}};case _S:return t[n]&&t[n][u]&&t[n][u][f]?{...t,[n]:{...t[n]||{},[u]:{...t[n]?t[n][u]||{}:{},[f]:void 0}}}:t;default:return t}};function HS(t={}){const e=Object.keys(t);return function(n={},i){let a=!1;const u={};for(let f=0;f<e.length;f++){const p=e[f];u[p]=t[p](n[p],i),a=a||u[p]!==n[p]}return a?u:n}}function F_(t){return(e,n)=>n&&n.type===Pv?n.payload.actions.reduce(t,e):n&&n.type===w_?{...e,iiif:{...e.iiif,...n.payload.state}}:t(e,n)}const B_=HS({mapping:I_,entities:z_,requests:U_,meta:j_});function H_(){return{iiif:{entities:FS(),meta:{},mapping:{},requests:{}}}}function V_(t={}){const{enableDevtools:e=!1,iiifStoreName:n="iiif",defaultState:i=H_(),customReducers:a={}}=t,u=F_(HS({[n]:B_,...a}));return A_(k_(P_(O_(u,i),{enabled:e})))}function $_(t){return{all:t=t||new Map,on:function(e,n){var i=t.get(e);i?i.push(n):t.set(e,[n])},off:function(e,n){var i=t.get(e);i&&(n?i.splice(i.indexOf(n)>>>0,1):t.set(e,[]))},emit:function(e,n){var i=t.get(e);i&&i.slice().map(function(a){a(n)}),(i=t.get("*"))&&i.slice().map(function(a){a(e,n)})}}}function Ci(t,e,n,i=!0){e[jl]=e[jl]||[],e[jl].push(t);const a=new Map;Object.defineProperty(e,t,{enumerable:i,get(){if(typeof e[uo][t]>"u")return;const u=e[uo][t];if(!u)return u;const f=n.get(e[uo][t],{parent:this.id?{id:this.id,type:this.type}:void 0});return a.has(f)||(a.clear(),a.set(f,fo(f,n))),a.get(f)},set(u){e[uo][t]!==u&&(this[co]?n.modifyEntityField({id:this.id,type:this.type},t,$S(u)):this[uo][t]=u)}})}const uo=Symbol.for("_refs_"),co=Symbol.for("_reactive_"),jl=Symbol.for("_defined_"),VS=Symbol.for("_parent_");function W_(t,e=!1,n){const i={id:"",type:"unknown",[jl]:[],[uo]:{},[VS]:n||null,[co]:null,is(a){return typeof a=="string"?this.id===a:a.id?a.id===this.id:!1},reactive(){if(!this[co])return this[co]=this.subscribe(()=>this.refresh(),!0),()=>{this.unreactive()}},refresh(){if(this.id){const a=this.unwrap();for(const u of Object.keys(a||{}))this[jl].includes(u)?this[uo][u]=a[u]:this[u]=a[u]}},unreactive(){this[co]&&(this[co](),this[co]=null)},unwrap(){if(!this.id)throw new Error("Invalid object");const a=this[VS];return t.get(this.id,{parent:a?{id:a,type:"unknown"}:void 0})},toPresentation3(){return t.toPresentation3(this.unwrap())},toPresentation2(){return t.toPresentation2(this.unwrap())},valueOf(){return this.unwrap()},toJSON(){const a=this;return{...a,items:a.items,annotations:a.annotations,structures:a.structures,seeAlso:a.seeAlso,service:a.service,services:a.services,rendering:a.rendering,partOf:a.partOf,start:a.start,supplementary:a.supplementary,homepage:a.homepage,thumbnail:a.thumbnail,placeholderCanvas:a.placeholderCanvas,accompanyingCanvas:a.accompanyingCanvas,provider:a.provider}},subscribe(a,u=!0){return t.subscribe(()=>this.id?t.get(this.id):null,a,u)}};return Ci("items",i,t),Ci("annotations",i,t),Ci("structures",i,t),Ci("seeAlso",i,t),Ci("rendering",i,t),Ci("partOf",i,t),Ci("start",i,t,!1),Ci("supplementary",i,t),Ci("homepage",i,t),Ci("thumbnail",i,t),Ci("placeholderCanvas",i,t,!1),Ci("accompanyingCanvas",i,t,!1),Ci("provider",i,t),Ci("body",i,t),Ci("logo",i,t),i}function q_(t){return!!t[jl]}function $S(t){return Array.isArray(t)?t.map(e=>$S(e)):!t||!t.type?t:{id:t.id,type:t.type}}function fo(t,e,n=!1,i){if(Array.isArray(t))return t.map(p=>fo(p,e,n));if(!t||!t.type||!t.id)return t;const a=W_(e,n),u=Object.create(a),f=Object.assign(u,t);return n&&f.reactive(),f}function WS(t){switch(t){case"Image":case"Video":case"Sound":case"Dataset":case"Text":case"Composite":case"List":case"Independents":case"Audience":return"ContentResource";case"ImageService1":case"ImageService2":case"ImageService3":return"Service"}return t}let jv=class{constructor(e,n){ga(this,"options"),ga(this,"store"),ga(this,"emitter"),ga(this,"isBatching",!1),ga(this,"batchQueue",[]),ga(this,"remoteFetcher"),ga(this,"staticFetcher"),ga(this,"defaultFetcher",i=>fetch(i).then(a=>a.json())),this.options=Object.assign({reducers:{},customFetcher:this.defaultFetcher,enableDevtools:!0},e||{}),this.store=n||V_({customReducers:this.options.reducers,defaultState:this.options.defaultState,enableDevtools:this.options.enableDevtools}),this.emitter=$_(),this.remoteFetcher=jS(this,this.options.customFetcher),this.staticFetcher=jS(this,(i,a)=>a)}batch(e){this.isBatching=!0;try{e(this),this.isBatching=!1,this.dispatch(Dv({actions:this.batchQueue}))}catch(n){throw this.batchQueue=[],this.isBatching=!1,n}this.batchQueue=[]}async asyncBatch(e){this.isBatching=!0;try{await e(this),this.isBatching=!1,this.dispatch(Dv({actions:this.batchQueue}))}catch(n){throw this.batchQueue=[],this.isBatching=!1,n}this.batchQueue=[]}modifyEntityField(e,n,i){this.dispatch(h_.modifyEntityField({id:e.id,type:e.type,key:n,value:i}))}dispatch(e){if(this.isBatching)this.batchQueue.push(e);else{if(e.type===Pv){for(const a of e.payload.actions)this.emitter.emit(a.type,{action:a,state:this.store.getState()});this.store.dispatch(e);const i=this.getState();for(const a of e.payload.actions)this.emitter.emit(`after:${a.type}`,{action:a,state:i});return}this.emitter.emit(e.type,{action:e,state:this.store.getState()}),this.store.dispatch(e);const n=this.store.getState();this.emitter.emit(`after:${e.type}`,{action:e,state:n});return}}on(e,n){return this.emitter.on(e,n),()=>{this.emitter.off(e,n)}}serialize(e,n){return QO(this.getState().iiif,e,n)}toPresentation2(e){return this.serialize(e,JO)}toPresentation3(e){return this.serialize(e,e_)}hydrate(e,n,i={}){return this.get(e,n,{...i,skipSelfReturn:!1})}get(e,n,i={}){typeof n!="string"&&(i=n||{},n=void 0);const{skipSelfReturn:a=!0}=i||{};let u=i.parent?typeof i.parent=="string"?i.parent:i.parent.id:void 0;if(Array.isArray(e))return e.map(x=>this.get(x,i));const f=this.getState();if(da(e)&&!i.preserveSpecificResources&&(e=e.source),typeof e=="string"){const x=WS(n||f.iiif.mapping[e]);if(!x)return a?null:{id:e,type:"unknown"};e={id:e,type:x}}if(e&&e.partOf&&!u&&!i.skipPartOfCheck){const x=Array.isArray(e.partOf)?e.partOf[0]:e.partOf;x&&(typeof x=="string"&&(u=x),typeof x.id=="string"&&(u=x.id))}const p=WS(n||(e==null?void 0:e.type)),g=e==null?void 0:e.id,S=f.iiif.entities[p];if(!S){const x=f.iiif.requests[g];return x&&x.resourceUri!==g?this.get(x.resourceUri,i):a?null:e}const m=S[e.id];if(m&&m[zn]){const x=m[zn].find(R=>u?R[Kr]===u:R[Kr]===m.id);return vv(m,x)}return S[e.id]||(a?null:e)}select(e){return e(this.getState())}getStore(){return this.store}getState(){return this.store.getState()}deep(e,n){if(typeof e>"u")return this.get(n,{skipSelfReturn:!1});if(typeof e=="function")try{const a=e(this.get(n,{skipSelfReturn:!1})),u=f=>this.deep(f,a);return u.size=Array.isArray(a)?a.length:1,u}catch{const a=u=>this.deep(u,void 0);return a.size=0,a}const i=a=>this.deep(a,e);return i.size=Array.isArray(e)?e.length:1,i}loadManifest(e,n){const i=typeof e=="string"?e:e.id;return this.load(i,n)}loadCollection(e,n){const i=typeof e=="string"?e:e.id;return this.load(i,n)}load(e,n){const i=typeof e=="string"?e:e.id;return n?Promise.resolve(this.staticFetcher(i,n)):Promise.resolve(this.remoteFetcher(i))}loadSync(e,n){const i=typeof e=="string"?e:e.id;return this.staticFetcher(i,n)}loadManifestSync(e,n){const i=typeof e=="string"?e:e.id;return this.loadSync(i,n)}loadCollectionSync(e,n){const i=typeof e=="string"?e:e.id;return this.loadSync(i,n)}areInputsEqual(e,n){return US(e,n)}subscribe(e,n,i){return typeof i>"u"&&(typeof n>"u"||n===!1||n===!0)&&(i=n,n=e,e=a=>a),this.store.subscribe(e,a=>n(a,this),{equalityFn:US,fireImmediately:!i})}async ensureLoaded(e){const n=typeof e=="string"?e:e.id;this.requestStatus(n)||await this.load(n)}requestStatus(e){return this.select(n=>n.iiif.requests[e])}getResourceMeta(e,n){const i=this.getState().iiif.meta[e];if(i)return n?i[n]:i}getObject(e,n,i={}){const{reactive:a,...u}=i;return fo(this.get(e,n,u),this,a)}async loadObject(e,n){return fo(await this.load(e,n),this)}async loadManifestObject(e,n){return fo(await this.loadManifest(e,n),this)}async loadCollectionObject(e,n){return fo(await this.loadCollection(e,n),this)}wrapObject(e){return fo(this.get(e,{skipSelfReturn:!1}),this)}isWrapped(e){return q_(e)}setMetaValue([e,n,i],a){this.dispatch(typeof a=="function"?LS.setMetaValueDynamic({id:e,meta:n,key:i,updateValue:a}):LS.setMetaValue({id:e,meta:n,key:i,value:a}))}};function Y_(){return typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}function qS(t){const e=Y_();try{const i=e.IIIF_VAULT;if(i)return i}catch{}const n=new jv(t);try{e.IIIF_VAULT=n}catch{}return n}const bc=T.createContext({vault:null,setVaultInstance:t=>{}});function Fv({vault:t,vaultOptions:e,useGlobal:n,resources:i,children:a}){const[u,f]=T.useState(()=>t||(n?qS(e):e?new jv(e):new jv));return oe.jsx(bc.Provider,{value:{vault:u,setVaultInstance:f},children:oe.jsx(ca,{value:i||{},children:a})})}const Un=()=>{const{vault:t}=T.useContext(bc);if(t===null)throw new Error("Vault not found. Ensure you have your provider set up correctly.");return t};function Bv(t,{noCache:e=!1}={}){const n=typeof t=="string"?t:t.id,i=Un(),[a,u]=T.useState(n),[f,p]=T.useState(void 0),g=T.useMemo(()=>i.get(n,{skipSelfReturn:!0})||void 0,[n,i]),[S,m]=T.useState(g);return T.useEffect(()=>{(async()=>{try{const x=g&&!e?g:await i.load(n),R=x?x.id||x["@id"]:null;x&&a!==R&&u(R),m(x)}catch(x){p(x)}})()},[n,e]),{isLoaded:!!S,id:a,requestId:n,error:f,resource:S,cached:!!(S&&S===g)}}function YS(t,e){const{id:n,isLoaded:i,error:a,resource:u,requestId:f,cached:p}=Bv(t,e);return{id:n,isLoaded:i,error:a,manifest:u,requestId:f,cached:p}}function QS({manifest:t,children:e}){return oe.jsx(ca,{value:{manifest:t},children:e})}function zd({canvas:t,children:e}){return oe.jsx(ca,{value:{canvas:t},children:e})}function ni(t,e=[]){const n=Un(),[i,a]=T.useState(()=>t(n.getState(),n));return T.useEffect(()=>n.subscribe(u=>t(u,n),u=>{a(u)},!1),e),i}const Ec=T.createContext([]);function Hv(){const t=T.useContext(Ec);return ni(e=>t.map(n=>e.iiif.entities.Canvas[n]).filter(Boolean),[t])}function ya(t={},e=[]){const{id:n,selector:i}=t,a=As();Un();const u=n||a.manifest,f=ni(p=>u?p.iiif.entities.Manifest[u]:void 0,[u]);return T.useMemo(()=>{if(f)return i?i(f):f},[f,i,...e])}function GS({range:t,children:e}){return oe.jsx(ca,{value:{range:t},children:e})}function XS(t,e){for(const n of e.items){if(n.type==="Canvas")return n;if(n.type==="SpecificResource")return n.source;if(n.type==="Range"){const i=XS(t,t.get(n));if(i)return i}}return null}function Vv(t,e){var i;const n=[];for(const a of e.items)if(a.type==="SpecificResource"&&((i=a.source)==null?void 0:i.type)==="Canvas"&&(a.source.id.indexOf("#")!==-1?n.push({id:a.source.id.split("#")[0],type:"Canvas"}):n.push(a.source)),a.type==="Range"&&n.push(...Vv(t,t.get(a))),a.type==="SpecificResource"){const u=typeof a.source=="string"?a.source:a.source.id;n.push({id:u,type:"Canvas"})}return n}function Q_(t,e,n){for(const i of e.structures){const a=$v(t,t.get(i),n);if(a)return a}return null}function $v(t,e,n){var i,a,u;for(const f of e.items){const p=(a=(i=f==null?void 0:f.source)==null?void 0:i.id)==null?void 0:a.split("#")[0];if(f.type==="SpecificResource"&&f.source===n||f.type==="SpecificResource"&&((u=f.source)==null?void 0:u.type)==="Canvas"&&n===p)return e;if(f.type==="Range"){const g=$v(t,t.get(f),n);if(g)return g}}return null}function G_(t,e,n,i=!1){const a=e.behavior,u=n?t.get(n):null;if(!u)return[];const f=u.behavior,p=i?!1:a.includes("paged"),g=p?!1:a.includes("continuous"),S=p||g?!1:a.includes("individuals"),m=f.includes("facing-pages"),x=f.includes("non-paged");if(m||x||S||i)return[{id:u.id,type:"Canvas"}];const[R,_]=Wv(t,e);if(g)return R;const M=R.findIndex(k=>k.id===n);if(M===-1)return[];for(const k of _)if(k.includes(M))return k.map(L=>R[L]);return[{id:u.id,type:"Canvas"}]}function Wv(t,e,{disablePaging:n,skipNonPaged:i}={}){const a=e.behavior,u=a.includes("paged"),f=u?!1:a.includes("continuous"),p=u||f?!1:a.includes("individuals"),g=e.type==="Manifest"?e.items:Vv(t,e);if(f)return[g,[g.map((M,k)=>k)]];if(p||!u||n)return[g,g.map((M,k)=>[k])];const S=[];let m=[];const x=()=>{m.length&&(S.push([...m]),m=[])};let R=0,_=!1;for(let M=0;M<g.length;M++){const k=t.get(g[M]);if(k.behavior.includes("non-paged")){M===R&&R++,i||(x(),S.push([M]),x());continue}if(M===R||k.behavior.includes("facing-pages")){m.length&&(_=!0),x(),S.push([M]),x();continue}if(m.push(M),_){x(),_=!1;continue}m.length>1&&x()}return m.length&&x(),[g,S]}function KS(t={},e=[]){const{id:n,selector:i}=t,a=As(),u=n||a.range,f=ni(p=>u?p.iiif.entities.Range[u]:void 0,[u]);return T.useMemo(()=>{if(f)return i?i(f):f},[f,i,...e])}function ZS({startCanvas:t,disablePaging:e}){var M;const n=Un(),i=ya(),a=KS(),[u,f]=T.useState(void 0),p=a||i;if(!p)throw new Error("Nothing selected");const[g,S]=T.useMemo(()=>Wv(n,p,{disablePaging:e}),[n,p]),m=T.useCallback(k=>{const L=S.findIndex(P=>P.includes(k));f(L===-1?0:L)},[g,S]),x=T.useCallback(k=>{const L=g.findIndex(P=>P.id===k);L!==-1?m(L):f(0)},[g,S]),R=T.useCallback(()=>{f(k=>k>=S.length?k:k+1)},[S]),_=T.useCallback(()=>{f(k=>k<=0?0:k-1)},[S]);return typeof u>"u"&&(t?x(t):f(0)),{visibleItems:((M=S[u])==null?void 0:M.map(k=>g[k].id))||[],cursor:u,items:g,sequence:S,setSequenceIndex:f,setCanvasIndex:m,setCanvasId:x,next:R,previous:_}}const xc=()=>{},wc=T.createContext({setCurrentCanvasId:xc,setCurrentCanvasIndex:xc,nextCanvas:xc,previousCanvas:xc,items:[],sequence:[],setSequenceIndex:xc,currentSequenceIndex:0});function JS(t){const e=ya(),{cursor:n,visibleItems:i,next:a,sequence:u,items:f,setCanvasIndex:p,setCanvasId:g,previous:S,setSequenceIndex:m}=ZS({startCanvas:t.startCanvas,disablePaging:t.pagingEnabled===!1}),x=T.useMemo(()=>({sequence:u,items:f,setCurrentCanvasId:g,nextCanvas:a,previousCanvas:S,totalCanvases:f.length,setCurrentCanvasIndex:p,setSequenceIndex:m,currentSequenceIndex:n}),[u,f,g,a,S,f,p,m,n]);return e?i.length===0?null:oe.jsx(wc.Provider,{value:x,children:oe.jsx(Ec.Provider,{value:i,children:oe.jsx(zd,{canvas:i[0],children:t.children})})}):(console.warn("The manifest passed to the provider is not a valid IIIF manifest."),oe.jsx("div",{children:"Sorry, something went wrong."}))}function eb(t){const e=YS(t.manifest);if(!e)return console.warn("The manifest passed to the provider is not a valid IIIF manifest."),oe.jsx("div",{children:"Sorry, something went wrong."});if(e.error)return oe.jsx("div",{children:e.error.toString()});if(!e.isLoaded)return oe.jsx("div",{children:"Loading..."});const n=oe.jsx(JS,{...t,children:t.children});return oe.jsx(QS,{manifest:e.id,children:t.rangeId?oe.jsx(GS,{range:t.rangeId,children:n}):n})}function tb(){return T.useContext(wc)}function nb(){return{VaultContext:T.useContext(bc),ResourceContext:T.useContext(kd),SimpleViewerReactContext:T.useContext(wc),VisibleCanvasReactContext:T.useContext(Ec)}}function ib(t){return oe.jsx(Fv,{vault:t.bridge.VaultContext.vault||void 0,resources:t.bridge.ResourceContext,children:oe.jsx(Ec.Provider,{value:t.bridge.VisibleCanvasReactContext,children:oe.jsx(wc.Provider,{value:t.bridge.SimpleViewerReactContext,children:t.children})})})}const Zr=function(t){return function(){const e={type:t,getType:()=>t,toString:()=>t};return(n,i)=>({...e,...n!==void 0&&{payload:n},...i!==void 0&&{meta:i}})}},X_="@iiif/IMPORT_ENTITIES",K_="@iiif/MODIFY_ENTITY_FIELD",Z_="@iiif/REORDER_ENTITY_FIELD",J_="@iiif/ADD_REFERENCE",eL="@iiif/UPDATE_REFERENCE",tL="@iiif/REMOVE_REFERENCE",nL="@iiif/ADD_METADATA",iL="@iiif/REMOVE_METADATA",rL="@iiif/UPDATE_METADATA",sL="@iiif/REORDER_METADATA",aL=Zr(X_)(),oL=Zr(K_)(),lL=Zr(Z_)(),uL=Zr(J_)(),cL=Zr(tL)(),fL=Zr(eL)(),dL=Zr(nL)(),hL=Zr(rL)(),pL=Zr(iL)(),vL=Zr(sL)(),qv={importEntities:aL,modifyEntityField:oL,reorderEntityField:lL,addReference:uL,removeReference:cL,updateReference:fL,addMetadata:dL,removeMetadata:pL,updateMetadata:hL,reorderMetadata:vL};function rb(){const e=Un().getStore();return T.useMemo(()=>n=>e.dispatch(n),[e])}function sb(t){return typeof t!="string"&&t&&t.bindToVault}function ab(){const t=Un(),e=T.useRef([]),n=rb(),i=T.useMemo(()=>`vault://annotation-page/${new Date().getTime()}/${Math.round(Math.random()*1e9).toString(16)}`,[]);T.useLayoutEffect(()=>{const p={id:i,type:"AnnotationPage",behavior:[],label:null,thumbnail:[],summary:null,requiredStatement:null,metadata:[],rights:null,provider:[],items:[],seeAlso:[],homepage:[],rendering:[],service:[]};n(qv.importEntities({entities:{AnnotationPage:{[p.id]:p}}}))},[i]);const a=ni(p=>i?p.iiif.entities.AnnotationPage[i]:null,[i]),u=T.useCallback((p,g)=>{if(i){if(sb(p)){const x=p;x.__vault||x.bindToVault(t),p=typeof x.source=="string"?x.source:x.source.id,e.current[p]=x}else typeof p!="string"&&(p=p.id);const S=t.get({id:i,type:"AnnotationPage"}),m=t.get({id:p,type:"Annotation"});S&&m&&(S.items.find(x=>x.id===m.id)||n(qv.addReference({id:i,type:"AnnotationPage",key:"items",reference:{id:p,type:"Annotation"},index:g})))}},[i]),f=T.useCallback(p=>{i&&(sb(p)?p=typeof p.source=="string"?p.source:p.source.id:typeof p!="string"&&(p=p.id),e.current[p]&&e.current[p].beforeRemove(),t.get({id:i,type:"AnnotationPage"})&&n(qv.removeReference({id:i,type:"AnnotationPage",key:"items",reference:{id:p,type:"Annotation"}})))},[i]);return[a,{addAnnotation:u,removeAnnotation:f}]}const ob=T.createContext(null);function lb(){const t=T.useContext(ob);return[t.fullPage,{addAnnotation:t.addAnnotation,removeAnnotation:t.removeAnnotation}]}function ub({children:t}){const[e,{addAnnotation:n,removeAnnotation:i}]=ab();return oe.jsx(ob.Provider,{value:T.useMemo(()=>({fullPage:e,addAnnotation:n,removeAnnotation:i}),[e]),children:t})}function mL({width:t,style:e,height:n,error:i,resetErrorBoundary:a}){return oe.jsxs("div",{style:{width:t,height:n,minHeight:500,...e||{},background:"#f9f9f9"},children:[oe.jsx("h3",{children:"Error occurred"}),oe.jsx("p",{children:i.message}),oe.jsx("button",{onClick:a,children:"Reset"})]})}const Ud=T.createContext(null);function cb(){return T.useContext(Ud)}const fb=T.createContext(()=>{}),db=T.createContext(()=>{});function Fl(t,e,n,i,a=[]){const u=T.useContext(t==="portal"?db:fb);T.useEffect(()=>(t!=="none"&&u(e,n,i),()=>{u(e,null)}),[e,t,u,...a])}function Jr(t={},e=[]){const{id:n,selector:i}=t,a=As(),u=n||a.canvas,f=ni(p=>u?p.iiif.entities.Canvas[u]:void 0,[u]);return T.useMemo(()=>{if(f)return i?i(f):f},[f,i,...e])}const hb=T.createContext(()=>{});function gL(t){const e=Jr(),n=T.useContext(hb);T.useEffect(()=>e&&e.id?(n(e.id,t),()=>n(e.id,-1)):()=>{},[e,t])}function yL({children:t,errorFallback:e,outerContainerProps:n={},worldScale:i,...a}){const[u,f]=T.useState(),p=nb(),g=e||mL,[S,m]=T.useState({}),x=Object.entries(S),[R,_]=T.useState({}),M=Object.entries(R),[k,L]=T.useState({}),P=T.useMemo(()=>i||Math.max(...Object.values(k)),[k]),O=T.useMemo(()=>({maxOverZoom:P||1,...a.runtimeOptions||{}}),[P,a.runtimeOptions]),j=T.useCallback((H,Z)=>{L(ie=>{if(Z===-1){const{[H]:W,...re}=ie;return re}return{...ie,[H]:Z}})},[]),q=T.useCallback((H,Z,ie)=>{m(({[H]:W,...re})=>Z?{...re,[H]:{element:Z,props:ie}}:re)},[]),ee=T.useCallback((H,Z,ie)=>{_(({[H]:W,...re})=>Z?{...re,[H]:{element:Z,props:ie}}:re)},[]);return oe.jsxs(jM,{resetKeys:[],fallbackRender:H=>oe.jsx(g,{...a,...H}),children:[oe.jsx(AM,{...a,containerProps:{style:{position:"relative"},...a.containerProps||{}},htmlChildren:oe.jsx(oe.Fragment,{children:x.map(([H,{element:Z,props:ie}])=>oe.jsx(T.Fragment,{children:oe.jsx(Z,{...ie||{}})},H))}),onCreated:H=>{f(H),a.onCreated&&a.onCreated(H)},runtimeOptions:O,children:oe.jsx(Ud.Provider,{value:u,children:oe.jsx(hb.Provider,{value:j,children:oe.jsx(fb.Provider,{value:q,children:oe.jsx(db.Provider,{value:ee,children:oe.jsx(ib,{bridge:p,children:oe.jsx(Od.Provider,{value:a.mode||"explore",children:oe.jsx(ub,{children:t})})})})})})})}),oe.jsx("div",{children:M.map(([H,{element:Z,props:ie}])=>oe.jsx(T.Fragment,{children:oe.jsx(Z,{...ie||{}})},H))})]})}const jd={},pb={get(t){return t},setMetaValue([t,e,n],i){const a=pb.getResourceMeta(t,e),u=a?a[n]:void 0,f=typeof i=="function"?i(u):i;jd[t]={...jd[t]||{},[e]:{...(jd[t]||{})[e]||{},[n]:f}}},getResourceMeta:(t,e)=>{const n=jd[t];if(n)return e?n[e]:n}};function vb(t=pb){return{addEventListener(e,n,i,a){if(e)return t.setMetaValue([e.id,"eventManager",n],u=>{const f=u||[];for(const p of f)if(p.callback===i)return f;return[...f,{callback:i,scope:a}]}),i},removeEventListener(e,n,i){e&&t.setMetaValue([e.id,"eventManager",n],a=>(a||[]).filter(u=>u.callback!==i))},getListenersAsProps(e,n){const i=typeof e=="string"?{id:e}:e;if(!i||!i.id)return{};const a=t.getResourceMeta(i.id,"eventManager"),u={};if(a&&i)for(const f of Object.keys(a))u[f]=p=>{const g=t.get(i);for(const{callback:S,scope:m}of a[f]||[])(!m||n&&m.indexOf(n)!==-1)&&S(p,g)};return u}}}function Yv(t,e){const n=Un(),i=T.useMemo(()=>vb(n),[n]),a=ni(()=>t&&t.id?n.getResourceMeta(t.id,"eventManager"):null,[t]);return T.useMemo(()=>t?i.getListenersAsProps(t,e):{},[a,t,n,e])}const Fd={},mb={get(t){return t},setMetaValue([t,e,n],i){const a=mb.getResourceMeta(t,e),u=a?a[n]:void 0,f=typeof i=="function"?i(u):i;Fd[t]={...Fd[t]||{},[e]:{...(Fd[t]||{})[e]||{},[n]:f}}},getResourceMeta:(t,e)=>{const n=Fd[t];if(n)return e?n[e]:n}};function Qv(t=mb){return{applyStyles(e,n,i){const a=typeof e=="string"?e:e.id;return t.setMetaValue([a,"styles",n],i)},getAppliedStyles(e){const n=typeof e=="string"?e:e.id;return t.getResourceMeta(n,"styles")}}}function Cc(t,e){const n=Un(),i=T.useMemo(()=>Qv(n),[n]);return ni(()=>{if(!t)return null;const a=i.getAppliedStyles(t.id);return a?e?a[e]:a:void 0},[t,e])}var SL=Object.defineProperty,bL=(t,e,n)=>e in t?SL(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Bd=(t,e,n)=>(bL(t,typeof e!="symbol"?e+"":e,n),n),EL=function(){function t(e,n){var i=[],a=!0,u=!1,f=void 0;try{for(var p=e[Symbol.iterator](),g;!(a=(g=p.next()).done)&&(i.push(g.value),!(n&&i.length===n));a=!0);}catch(S){u=!0,f=S}finally{try{!a&&p.return&&p.return()}finally{if(u)throw f}}return i}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),Tc=Math.PI*2,Gv=function(t,e,n,i,a,u,f){var p=t.x,g=t.y;p*=e,g*=n;var S=i*p-a*g,m=a*p+i*g;return{x:S+u,y:m+f}},xL=function(t,e){var n=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(e/4),i=Math.cos(t),a=Math.sin(t),u=Math.cos(t+e),f=Math.sin(t+e);return[{x:i-a*n,y:a+i*n},{x:u+f*n,y:f-u*n},{x:u,y:f}]},gb=function(t,e,n,i){var a=t*i-e*n<0?-1:1,u=t*n+e*i;return u>1&&(u=1),u<-1&&(u=-1),a*Math.acos(u)},wL=function(t,e,n,i,a,u,f,p,g,S,m,x){var R=Math.pow(a,2),_=Math.pow(u,2),M=Math.pow(m,2),k=Math.pow(x,2),L=R*_-R*k-_*M;L<0&&(L=0),L/=R*k+_*M,L=Math.sqrt(L)*(f===p?-1:1);var P=L*a/u*x,O=L*-u/a*m,j=S*P-g*O+(t+n)/2,q=g*P+S*O+(e+i)/2,ee=(m-P)/a,H=(x-O)/u,Z=(-m-P)/a,ie=(-x-O)/u,W=gb(1,0,ee,H),re=gb(ee,H,Z,ie);return p===0&&re>0&&(re-=Tc),p===1&&re<0&&(re+=Tc),[j,q,W,re]},CL=function(t){var e=t.px,n=t.py,i=t.cx,a=t.cy,u=t.rx,f=t.ry,p=t.xAxisRotation,g=p===void 0?0:p,S=t.largeArcFlag,m=S===void 0?0:S,x=t.sweepFlag,R=x===void 0?0:x,_=[];if(u===0||f===0)return[];var M=Math.sin(g*Tc/360),k=Math.cos(g*Tc/360),L=k*(e-i)/2+M*(n-a)/2,P=-M*(e-i)/2+k*(n-a)/2;if(L===0&&P===0)return[];u=Math.abs(u),f=Math.abs(f);var O=Math.pow(L,2)/Math.pow(u,2)+Math.pow(P,2)/Math.pow(f,2);O>1&&(u*=Math.sqrt(O),f*=Math.sqrt(O));var j=wL(e,n,i,a,u,f,m,R,M,k,L,P),q=EL(j,4),ee=q[0],H=q[1],Z=q[2],ie=q[3],W=Math.abs(ie)/(Tc/4);Math.abs(1-W)<1e-7&&(W=1);var re=Math.max(Math.ceil(W),1);ie/=re;for(var ge=0;ge<re;ge++)_.push(xL(Z,ie)),Z+=ie;return _.map(function(be){var Ee=Gv(be[0],u,f,k,M,ee,H),Ue=Ee.x,je=Ee.y,Xe=Gv(be[1],u,f,k,M,ee,H),ce=Xe.x,me=Xe.y,tt=Gv(be[2],u,f,k,M,ee,H),mt=tt.x,he=tt.y;return{x1:Ue,y1:je,x2:ce,y2:me,x:mt,y:he}})};function yb(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var TL=AL,Xv={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},RL=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function AL(t){var e=[];return t.replace(RL,function(n,i,a){var u=i.toLowerCase();for(a=OL(a),u=="m"&&a.length>2&&(e.push([i].concat(a.splice(0,2))),u="l",i=i=="m"?"l":"L");;){if(a.length==Xv[u])return a.unshift(i),e.push(a);if(a.length<Xv[u])throw new Error("malformed path data");e.push([i].concat(a.splice(0,Xv[u])))}}),e}var ML=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function OL(t){var e=t.match(ML);return e?e.map(Number):[]}const _L=yb(TL);var LL=PL;function PL(t){var e=0,n=0,i=0,a=0;return t.map(function(u){u=u.slice();var f=u[0],p=f.toUpperCase();if(f!=p)switch(u[0]=p,f){case"a":u[6]+=i,u[7]+=a;break;case"v":u[1]+=a;break;case"h":u[1]+=i;break;default:for(var g=1;g<u.length;)u[g++]+=i,u[g++]+=a}switch(p){case"Z":i=e,a=n;break;case"H":i=u[1];break;case"V":a=u[1];break;case"M":i=e=u[1],a=n=u[2];break;default:i=u[u.length-2],a=u[u.length-1]}return u})}const DL=yb(LL);function kL(t){const e=_L(t),n=DL(e);let i,a=0,u=0,f=0,p=0,g,S,m=0,x=0;const R=[];for(let _=0;_<n.length;_++){let M=n[_];const k=M[0];switch(k){case"M":a=M[1],u=M[2];break;case"H":M=["L",M[1],u];break;case"V":M=["L",a,M[1]];break;case"S":{let L=m,P=x;(i==="C"||i=="S")&&(L+=L-f,P+=P-p),M=["C",L,P,M[1],M[2],M[3],M[4]]}break;case"T":i==="Q"||i=="T"?(g=m*2-g,S=x*2-S):(g=m,S=x),M=["Q",g,S,M[1],M[2]];break;case"Q":g=M[1],S=M[2];break;case"A":{const L=CL({px:m,py:x,cx:M[6],cy:M[7],rx:M[1],ry:M[2],xAxisRotation:M[3],largeArcFlag:M[4],sweepFlag:M[5]});if(!L.length)continue;for(const[P,O]of L.entries())M=["C",O.x1,O.y1,O.x2,O.y2,O.x,O.y],P<L.length-1&&R.push(M);M=M}break;case"Z":M=["L",a,u];break}i=k,m=M[M.length-2],x=M[M.length-1],["C","Q","A"].indexOf(k)>-1?(f=M[M.length-4],p=M[M.length-3]):(f=m,p=x),R.push(M)}return R}/** Code to "flatten" quadratic and cubic Bézier curves to polylines.
|
|
284
|
+
`),r.htmlChildren)},dR=()=>C.useContext(Kf),nd=()=>{const t=dR();return t?t.runtime:void 0},M0=(t,e=[])=>{const n=nd();C.useEffect(()=>n?n.registerHook("useFrame",t):()=>{},e)};function hR(){return C.useContext(Zf)}async function pR(t,e,n){if(C.version.startsWith("18.")){const r=await Promise.resolve().then(()=>cO),o=r.default?r.default.createRoot:r.createRoot;n.current||(n.current=o(t)),n.current.render(e)}else if(typeof ReactDOM<"u"){const{render:r,unmountComponentAtNode:o}=ReactDOM;r(e,t),n.current={unmount(){o(t)}}}else{const r=await import("react-dom"),o=r.default?r.default.render:r.render,c=r.default?r.default.unmountComponentAtNode:r.unmountComponentAtNode;o(e,t),n.current={unmount(){c(t)}}}}const kp=C.forwardRef(({children:t,...e},n)=>{const r=C.useRef(),o=nd(),c=C.useRef(0),h=C.useRef(),v=C.useRef();return M0(()=>{var g,x,m,w;if(e.relative){const A=r.current;if(A&&o){const P=o.getScaleFactor();c.current!==P&&(c.current=P,A.style.transformOrigin="0 0",A.style.transform=`scale(${1/c.current})`,A.style.width=`${c.current*100}%`,A.style.height=`${c.current*100}%`,r.current&&((x=(g=h.current)==null?void 0:g.__owner.value)!=null&&x.rotation)&&(A.style.transform=`scale(${1/c.current}) translate(50%, 50%) rotate(${((w=(m=h.current)==null?void 0:m.__owner.value)==null?void 0:w.rotation)||0}deg) translate(-50%, -50%)`))}}},[e.relative]),C.useLayoutEffect(()=>{const g=h.current;n&&g&&(typeof n=="function"?n(g):n.current=g);async function x(){if(g&&g.__host){const m=e.relative?C.createElement("div",{ref:r},t):t;await pR(g.__host.element,m,v)}}g&&g.__host?x():g&&(g.__onCreate=x)},[n,t,h,e.relative]),C.useLayoutEffect(()=>()=>{v.current&&setTimeout(()=>{v.current.unmount()},0)},[]),C.createElement("box",{html:!0,...e,ref:h})});kp.displayName="HTMLPortal";const O0=(t,e,n=[])=>{const r=nd(),o=r?r.world:void 0;C.useEffect(()=>{if(r){const c=e,h=tl[t];r.world.activatedEvents.push(h);const v=h.slice(2).toLowerCase();return r.world.addEventListener(v,c),()=>{r.world.removeEventListener(v,c)}}return()=>{}},[o,t,...n])};function D0(t,e){if(t===0)return[0,1];if(e===0)return[1,0];const n=Math.abs(t)/Math.abs(e);return[n,1-n]}function vR(){const t=C.useRef({ctrl:!1,shift:!1,alt:!1});return C.useLayoutEffect(()=>{function e(r){r.key==="Shift"&&(t.current.shift=!0),r.key==="Control"&&(t.current.ctrl=!0),r.key==="Alt"&&(t.current.alt=!0)}function n(r){r.key==="Shift"&&(t.current.shift=!1),r.key==="Control"&&(t.current.ctrl=!1),r.key==="Alt"&&(t.current.alt=!1)}return window.addEventListener("keydown",e),window.addEventListener("keyup",n),()=>{window.removeEventListener("keydown",e),window.removeEventListener("keyup",n)}},[]),t}const mR=(t,e)=>{const n=qC(),r=nd(),o=hR(),c=C.useRef(),h=C.useRef(null),v=C.useRef(),[g,x]=C.useState(!1),m=C.useRef(!1),w=C.useRef({north:0,south:0,east:0,west:0}),A=vR(),P=C.useCallback(O=>I=>{if(m.current=!0,x(!0),o&&r){const{top:q,left:te}=o,H=r.viewerToWorld(I.pageX-te,I.pageY-q);v.current={x:H.x,y:H.y},c.current=O}},[o,r]),M=C.useMemo(()=>t.width/t.height,[t.width,t.height]),_=C.useCallback(O=>{if(!Math.abs(O.north-O.south+(O.east-O.west)))return;const q=-O.west+O.east,te=-O.north+O.south,H=t.width+q,J=t.height+te;if(H/J>=M){const $=J*M,se=H-$,[ge,Ce]=D0(O.east,O.west);O.west=O.west+se*Ce,O.east=O.east-se*ge}else{const $=H/M,se=J-$,[ge,Ce]=D0(O.north,O.south);O.north=O.north+se*ge,O.south=O.south-se*Ce}},[t.width,t.height,M]);M0(()=>{v&&r&&r.updateNextFrame()}),C.useEffect(()=>{r&&r.updateNextFrame()},[r,g]);const L=C.useCallback(O=>{var I;if(!r||!o||r.mode!=="sketch")return;const{top:q,left:te}=o,H=r.viewerToWorld(O.pageX-te,O.pageY-q),J=h.current,re=!t.maintainAspectRatio&&A.current.alt,$=!re&&A.current.shift&&((I=c.current)==null?void 0:I.indexOf("-"))!==-1;if((c.current==="translate"||c.current==="east"||c.current==="north-east"||c.current==="south-east")&&(w.current.east=H.x-(v.current?v.current.x:0),re&&(w.current.west=-w.current.east)),(c.current==="translate"||c.current==="west"||c.current==="north-west"||c.current==="south-west")&&(w.current.west=H.x-(v.current?v.current.x:0),re&&(w.current.east=-w.current.west)),(c.current==="translate"||c.current==="north"||c.current==="north-east"||c.current==="north-west")&&(w.current.north=H.y-(v.current?v.current.y:0),re&&(w.current.south=-w.current.north)),(c.current==="translate"||c.current==="south"||c.current==="south-west"||c.current==="south-east")&&(w.current.south=H.y-(v.current?v.current.y:0),re&&(w.current.north=-w.current.south)),(t.maintainAspectRatio||$)&&_(w.current),J){const se=w.current.west,ge=w.current.north,Ce=t.width+w.current.east,me=t.height+w.current.south;J.points[1]=Math.min(se,Ce),J.points[2]=Math.min(ge,me),J.points[3]=Math.max(se,Ce),J.points[4]=Math.max(ge,me),r.updateNextFrame()}},[r,t.width,t.height,t.maintainAspectRatio,o]);O0("mousemove",L,[t.width,t.height,o]),O0("pointermove",L,[t.width,t.height,o]);const k=C.useRef();return C.useEffect(()=>{k.current=()=>{if(m.current){const O=w.current.west,I=w.current.north,q=t.width+w.current.east,te=t.height+w.current.south,H=Math.min(O,q),J=Math.min(I,te),re=Math.max(O,q),$=Math.max(I,te),se={x:(t.x||0)+H,y:(t.y||0)+J,width:re-H||1,height:$-J||1};t.maintainAspectRatio,e(se),c.current=void 0,v.current=void 0,w.current.east=0,w.current.west=0,w.current.north=0,w.current.south=0,m.current=!1,x(!1)}}},[e,t.height,t.width,t.x,t.y]),C.useEffect(()=>{const O=()=>{k.current&&k.current()};return window.addEventListener("pointerup",O),window.addEventListener("touchend",O),()=>{window.removeEventListener("pointerup",O),window.removeEventListener("touchend",O)}},[]),{portalRef:h,mode:n,mouseEvent:P,onPointerMoveCallback:L,isEditing:g}};function gR({handleSize:t,resizable:e,onSave:n,children:r,maintainAspectRatio:o,disableCardinalControls:c,...h}){const v=typeof t>"u"?o?10:8:t,{portalRef:g,mode:x,mouseEvent:m,isEditing:w}=mR({x:h.x||0,y:h.y||0,width:h.width,height:h.height,maintainAspectRatio:o},n),A=C.useMemo(()=>m("translate"),[m]),P=C.useMemo(()=>m("east"),[m]),M=C.useMemo(()=>m("west"),[m]),_=C.useMemo(()=>m("south"),[m]),L=C.useMemo(()=>m("north"),[m]),k=C.useMemo(()=>m("south-east"),[m]),O=C.useMemo(()=>m("south-west"),[m]),I=C.useMemo(()=>m("north-east"),[m]),q=C.useMemo(()=>m("north-west"),[m]),te=x==="sketch",H={zIndex:999,boxShadow:"0px 2px 3px 0 rgba(0,0,0,0.2)",border:"1px solid rgba(155,155,155,.7)",borderRadius:o||c?"50%":2,position:"absolute",background:"#fff",pointerEvents:w?"none":te?"initial":"none"};return C.createElement(C.Fragment,null,C.createElement("world-object",{...h},r,te&&e?C.createElement(kp,{ref:g,target:{x:0,y:0,height:h.height,width:h.width},relative:!0,interactive:!1},te&&e?C.createElement(C.Fragment,null,C.createElement("div",{onMouseDown:A,onTouchStart:A,style:{display:"block",width:"100%",height:"100%",position:"relative",border:"1px solid rgba(155,155,155, .7)",boxSizing:"border-box",pointerEvents:w?"none":te?"initial":"none"}}),o?null:C.createElement(C.Fragment,null,C.createElement("div",{title:"east",onTouchStart:P,onMouseDown:P,style:{...H,cursor:"e-resize",height:v*2,width:v,right:0,top:"50%",opacity:c?0:1,transform:`translate(${v/2}px, -${v}px)`}}),C.createElement("div",{title:"west",onMouseDown:M,style:{...H,cursor:"w-resize",position:"absolute",height:v*2,width:v,left:0,top:"50%",opacity:c?0:1,transform:`translate(-${v/2}px, -${v}px)`}}),C.createElement("div",{title:"north",onMouseDown:L,style:{...H,cursor:"n-resize",position:"absolute",height:v,width:v*2,left:"50%",top:0,opacity:c?0:1,transform:`translate(-${v}px, -${v/2}px)`}}),C.createElement("div",{title:"south",onMouseDown:_,style:{...H,cursor:"s-resize",position:"absolute",height:v,width:v*2,left:"50%",bottom:0,opacity:c?0:1,transform:`translate(-${v}px, ${v/2}px)`}})),C.createElement("div",{title:"north-east",onMouseDown:I,style:{...H,cursor:"ne-resize",position:"absolute",height:v,width:v,right:0,top:0,transform:`translate(${v/2}px, -${v/2}px)`}}),C.createElement("div",{title:"south-east",onMouseDown:k,style:{...H,cursor:"se-resize",position:"absolute",height:v,width:v,bottom:0,right:0,transform:`translate(${v/2}px, ${v/2}px)`}}),C.createElement("div",{title:"south-west",onMouseDown:O,style:{...H,cursor:"sw-resize",position:"absolute",height:v,width:v,bottom:0,left:0,transform:`translate(-${v/2}px, ${v/2}px)`}}),C.createElement("div",{title:"north-west",onMouseDown:q,style:{...H,cursor:"nw-resize",position:"absolute",height:v,width:v,top:0,left:0,transform:`translate(-${v/2}px, -${v/2}px)`}})):null):null))}function yR({interactive:t,region:e,onClick:n,onSave:r,maintainAspectRatio:o,disableCardinalControls:c,isEditing:h,rotation:v,style:g={backgroundColor:"rgba(0,0,0,.5)"}}){const x=C.useCallback(m=>{r({id:e.id,x:e.x,y:e.y,height:e.height,width:e.width,...m})},[r,e.id,e.x,e.y,e.height,e.width]);return C.createElement(gR,{x:e.x,y:e.y,rotation:v,width:e.width,height:e.height,resizable:h,onSave:x,maintainAspectRatio:o,disableCardinalControls:c},C.createElement("box",{interactive:t,onClick:m=>{m.preventDefault(),m.stopPropagation(),n(e)},target:{x:0,y:0,width:e.width,height:e.height},style:g}))}const SR=t=>{var e,n,r,o,c;const h=t.width/(((e=t.crop)==null?void 0:e.width)||t.tiles.width),v=t.tiles.imageService.tiles||[],g=t.tiles.imageService.sizes||[],x=t.enableThumbnail,m=t.enableSizes,w=C.useMemo(()=>{const A=t.tiles.imageService.id||t.tiles.imageService["@id"];return A&&A.endsWith("/info.json")?A.slice(0,-1*10):A},[t.tiles.imageService.id]);return C.createElement("world-object",{rotation:t.rotation,key:t.tiles.imageService.id,scale:h,height:((n=t.crop)==null?void 0:n.height)||t.tiles.height,width:((r=t.crop)==null?void 0:r.width)||t.tiles.width,x:t.x,y:t.y,onClick:t.onClick},C.createElement("composite-image",{key:t.tiles.imageService.id,id:t.tiles.imageService.id,width:((o=t.crop)==null?void 0:o.width)||t.tiles.width,height:((c=t.crop)==null?void 0:c.height)||t.tiles.height,crop:t.crop},x&&t.tiles.thumbnail?C.createElement("world-image",{priority:!0,uri:t.tiles.thumbnail.id,target:{width:t.tiles.width,height:t.tiles.height},display:{width:t.tiles.thumbnail.width,height:t.tiles.thumbnail.height},crop:t.crop}):null,m&&g.map((A,P)=>C.createElement("world-image",{key:P,uri:`${w}/full/${A.width},${A.height}/0/default.jpg`,target:{width:t.tiles.width,height:t.tiles.height},display:{width:A.width,height:A.height},crop:t.crop})),v.map(A=>(A.scaleFactors||[]).map(P=>C.createElement("tiled-image",{key:`${t.tiles.imageService.id}-tile-${P}`,uri:t.tiles.imageService.id,display:{width:t.tiles.width,height:t.tiles.height},tile:A,scaleFactor:P,crop:t.crop})))))};function bR(t,e){return t?e?{...t,...e||{},":hover":t[":hover"]?Object.assign(t[":hover"]||{},e[":hover"]||{}):e[":hover"],":active":t[":active"]?Object.assign(t[":active"]||{},e[":active"]||{}):e[":hover"]}:t:e}function zp(t,e){return zp=Object.setPrototypeOf||function(r,o){return r.__proto__=o,r},zp(t,e)}function xR(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,zp(t,e)}var ER=function(e,n){return e===void 0&&(e=[]),n===void 0&&(n=[]),e.length!==n.length||e.some(function(r,o){return!Object.is(r,n[o])})},L0={error:null},wR=function(t){xR(e,t);function e(){for(var r,o=arguments.length,c=new Array(o),h=0;h<o;h++)c[h]=arguments[h];return r=t.call.apply(t,[this].concat(c))||this,r.state=L0,r.resetErrorBoundary=function(){for(var v,g=arguments.length,x=new Array(g),m=0;m<g;m++)x[m]=arguments[m];r.props.onReset==null||(v=r.props).onReset.apply(v,x),r.reset()},r}e.getDerivedStateFromError=function(o){return{error:o}};var n=e.prototype;return n.reset=function(){this.setState(L0)},n.componentDidCatch=function(o,c){var h,v;(h=(v=this.props).onError)==null||h.call(v,o,c)},n.componentDidUpdate=function(o,c){var h=this.state.error,v=this.props.resetKeys;if(h!==null&&c.error!==null&&ER(o.resetKeys,v)){var g,x;(g=(x=this.props).onResetKeysChange)==null||g.call(x,o.resetKeys,v),this.reset()}},n.render=function(){var o=this.state.error,c=this.props,h=c.fallbackRender,v=c.FallbackComponent,g=c.fallback;if(o!==null){var x={error:o,resetErrorBoundary:this.resetErrorBoundary};if(ae.isValidElement(g))return g;if(typeof h=="function")return h(x);if(v)return ae.createElement(v,x);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},e}(ae.Component);const TR={collection:void 0,manifest:void 0,range:void 0,canvas:void 0,annotation:void 0,annotationPage:void 0},id=C.createContext(TR),Ss=()=>C.useContext(id);function Js({value:t,children:e}){const n=Ss(),r=C.useMemo(()=>({...n,...t}),[t,n]);return le.jsx(id.Provider,{value:r,children:e})}const Bu=C.createContext({vault:null,setVaultInstance:t=>{}});function Np({vault:t,vaultOptions:e,useGlobal:n,resources:r,children:o}){const[c,h]=C.useState(()=>t||(n?cf.globalVault(e):e?new cf.Vault(e):new cf.Vault));return le.jsx(Bu.Provider,{value:{vault:c,setVaultInstance:h},children:le.jsx(Js,{value:r||{},children:o})})}const kn=()=>{const{vault:t}=C.useContext(Bu);if(t===null)throw new Error("Vault not found. Ensure you have your provider set up correctly.");return t};function _p(t,{noCache:e=!1}={}){const n=typeof t=="string"?t:t.id,r=kn(),[o,c]=C.useState(n),[h,v]=C.useState(void 0),g=C.useMemo(()=>r.get(n,{skipSelfReturn:!0})||void 0,[n,r]),[x,m]=C.useState(g);return C.useEffect(()=>{(async()=>{try{const w=g&&!e?g:await r.load(n),A=w?w.id||w["@id"]:null;w&&o!==A&&c(A),m(w)}catch(w){v(w)}})()},[n,e]),{isLoaded:!!x,id:o,requestId:n,error:h,resource:x,cached:!!(x&&x===g)}}function P0(t,e){const{id:n,isLoaded:r,error:o,resource:c,requestId:h,cached:v}=_p(t,e);return{id:n,isLoaded:r,error:o,manifest:c,requestId:h,cached:v}}function k0({manifest:t,children:e}){return le.jsx(Js,{value:{manifest:t},children:e})}function rd({canvas:t,children:e}){return le.jsx(Js,{value:{canvas:t},children:e})}function Kn(t,e=[]){const n=kn(),[r,o]=C.useState(()=>t(n.getState(),n));return C.useEffect(()=>n.subscribe(c=>t(c,n),c=>{o(c)},!1),e),r}const Hu=C.createContext([]);function Up(){const t=C.useContext(Hu);return Kn(e=>t.map(n=>e.iiif.entities.Canvas[n]).filter(Boolean),[t])}function ea(t={},e=[]){const{id:n,selector:r}=t,o=Ss();kn();const c=n||o.manifest,h=Kn(v=>c?v.iiif.entities.Manifest[c]:void 0,[c]);return C.useMemo(()=>{if(h)return r?r(h):h},[h,r,...e])}function z0({range:t,children:e}){return le.jsx(Js,{value:{range:t},children:e})}function N0(t,e){for(const n of e.items){if(n.type==="Canvas")return n;if(n.type==="SpecificResource")return n.source;if(n.type==="Range"){const r=N0(t,t.get(n));if(r)return r}}return null}function jp(t,e){var r;const n=[];for(const o of e.items)if(o.type==="SpecificResource"&&((r=o.source)==null?void 0:r.type)==="Canvas"&&(o.source.id.indexOf("#")!==-1?n.push({id:o.source.id.split("#")[0],type:"Canvas"}):n.push(o.source)),o.type==="Range"&&n.push(...jp(t,t.get(o))),o.type==="SpecificResource"){const c=typeof o.source=="string"?o.source:o.source.id;n.push({id:c,type:"Canvas"})}return n}function CR(t,e,n){for(const r of e.structures){const o=Ip(t,t.get(r),n);if(o)return o}return null}function Ip(t,e,n){var r,o,c;for(const h of e.items){const v=(o=(r=h==null?void 0:h.source)==null?void 0:r.id)==null?void 0:o.split("#")[0];if(h.type==="SpecificResource"&&h.source===n||h.type==="SpecificResource"&&((c=h.source)==null?void 0:c.type)==="Canvas"&&n===v)return e;if(h.type==="Range"){const g=Ip(t,t.get(h),n);if(g)return g}}return null}function RR(t,e,n,r=!1){const o=e.behavior,c=n?t.get(n):null;if(!c)return[];const h=c.behavior,v=r?!1:o.includes("paged"),g=v?!1:o.includes("continuous"),x=v||g?!1:o.includes("individuals"),m=h.includes("facing-pages"),w=h.includes("non-paged");if(m||w||x||r)return[{id:c.id,type:"Canvas"}];const[A,P]=Fp(t,e);if(g)return A;const M=A.findIndex(_=>_.id===n);if(M===-1)return[];for(const _ of P)if(_.includes(M))return _.map(L=>A[L]);return[{id:c.id,type:"Canvas"}]}function Fp(t,e,{disablePaging:n,skipNonPaged:r}={}){const o=e.behavior,c=o.includes("paged"),h=c?!1:o.includes("continuous"),v=c||h?!1:o.includes("individuals"),g=e.type==="Manifest"?e.items:jp(t,e);if(h)return[g,[g.map((M,_)=>_)]];if(v||!c||n)return[g,g.map((M,_)=>[_])];const x=[];let m=[];const w=()=>{m.length&&(x.push([...m]),m=[])};let A=0,P=!1;for(let M=0;M<g.length;M++){const _=t.get(g[M]);if(_.behavior.includes("non-paged")){M===A&&A++,r||(w(),x.push([M]),w());continue}if(M===A||_.behavior.includes("facing-pages")){m.length&&(P=!0),w(),x.push([M]),w();continue}if(m.push(M),P){w(),P=!1;continue}m.length>1&&w()}return m.length&&w(),[g,x]}function _0(t={},e=[]){const{id:n,selector:r}=t,o=Ss(),c=n||o.range,h=Kn(v=>c?v.iiif.entities.Range[c]:void 0,[c]);return C.useMemo(()=>{if(h)return r?r(h):h},[h,r,...e])}function U0({startCanvas:t,disablePaging:e}){var M;const n=kn(),r=ea(),o=_0(),[c,h]=C.useState(void 0),v=o||r;if(!v)throw new Error("Nothing selected");const[g,x]=C.useMemo(()=>Fp(n,v,{disablePaging:e}),[n,v]),m=C.useCallback(_=>{const L=x.findIndex(k=>k.includes(_));h(L===-1?0:L)},[g,x]),w=C.useCallback(_=>{const L=g.findIndex(k=>k.id===_);L!==-1?m(L):h(0)},[g,x]),A=C.useCallback(()=>{h(_=>_>=x.length?_:_+1)},[x]),P=C.useCallback(()=>{h(_=>_<=0?0:_-1)},[x]);return typeof c>"u"&&(t?w(t):h(0)),{visibleItems:((M=x[c])==null?void 0:M.map(_=>g[_].id))||[],cursor:c,items:g,sequence:x,setSequenceIndex:h,setCanvasIndex:m,setCanvasId:w,next:A,previous:P}}const Vu=()=>{},Wu=C.createContext({setCurrentCanvasId:Vu,setCurrentCanvasIndex:Vu,nextCanvas:Vu,previousCanvas:Vu,items:[],sequence:[],setSequenceIndex:Vu,currentSequenceIndex:0});function j0(t){const e=ea(),{cursor:n,visibleItems:r,next:o,sequence:c,items:h,setCanvasIndex:v,setCanvasId:g,previous:x,setSequenceIndex:m}=U0({startCanvas:t.startCanvas,disablePaging:t.pagingEnabled===!1}),w=C.useMemo(()=>({sequence:c,items:h,setCurrentCanvasId:g,nextCanvas:o,previousCanvas:x,totalCanvases:h.length,setCurrentCanvasIndex:v,setSequenceIndex:m,currentSequenceIndex:n}),[c,h,g,o,x,h,v,m,n]);return e?r.length===0?null:le.jsx(Wu.Provider,{value:w,children:le.jsx(Hu.Provider,{value:r,children:le.jsx(rd,{canvas:r[0],children:t.children})})}):(console.warn("The manifest passed to the provider is not a valid IIIF manifest."),le.jsx("div",{children:"Sorry, something went wrong."}))}function I0(t){const e=P0(t.manifest);if(!e)return console.warn("The manifest passed to the provider is not a valid IIIF manifest."),le.jsx("div",{children:"Sorry, something went wrong."});if(e.error)return le.jsx("div",{children:e.error.toString()});if(!e.isLoaded)return le.jsx("div",{children:"Loading..."});const n=le.jsx(j0,{...t,children:t.children});return le.jsx(k0,{manifest:e.id,children:t.rangeId?le.jsx(z0,{range:t.rangeId,children:n}):n})}function F0(){return C.useContext(Wu)}function B0(){return{VaultContext:C.useContext(Bu),ResourceContext:C.useContext(id),SimpleViewerReactContext:C.useContext(Wu),VisibleCanvasReactContext:C.useContext(Hu)}}function H0(t){return le.jsx(Np,{vault:t.bridge.VaultContext.vault||void 0,resources:t.bridge.ResourceContext,children:le.jsx(Hu.Provider,{value:t.bridge.VisibleCanvasReactContext,children:le.jsx(Wu.Provider,{value:t.bridge.SimpleViewerReactContext,children:t.children})})})}const Wr=function(t){return function(){const e={type:t,getType:()=>t,toString:()=>t};return(n,r)=>({...e,...n!==void 0&&{payload:n},...r!==void 0&&{meta:r}})}},AR="@iiif/IMPORT_ENTITIES",MR="@iiif/MODIFY_ENTITY_FIELD",OR="@iiif/REORDER_ENTITY_FIELD",DR="@iiif/ADD_REFERENCE",LR="@iiif/UPDATE_REFERENCE",PR="@iiif/REMOVE_REFERENCE",kR="@iiif/ADD_METADATA",zR="@iiif/REMOVE_METADATA",NR="@iiif/UPDATE_METADATA",_R="@iiif/REORDER_METADATA",UR=Wr(AR)(),jR=Wr(MR)(),IR=Wr(OR)(),FR=Wr(DR)(),BR=Wr(PR)(),HR=Wr(LR)(),VR=Wr(kR)(),WR=Wr(NR)(),$R=Wr(zR)(),qR=Wr(_R)(),Bp={importEntities:UR,modifyEntityField:jR,reorderEntityField:IR,addReference:FR,removeReference:BR,updateReference:HR,addMetadata:VR,removeMetadata:$R,updateMetadata:WR,reorderMetadata:qR};function V0(){const e=kn().getStore();return C.useMemo(()=>n=>e.dispatch(n),[e])}function W0(t){return typeof t!="string"&&t&&t.bindToVault}function $0(){const t=kn(),e=C.useRef([]),n=V0(),r=C.useMemo(()=>`vault://annotation-page/${new Date().getTime()}/${Math.round(Math.random()*1e9).toString(16)}`,[]);C.useLayoutEffect(()=>{const v={id:r,type:"AnnotationPage",behavior:[],label:null,thumbnail:[],summary:null,requiredStatement:null,metadata:[],rights:null,provider:[],items:[],seeAlso:[],homepage:[],rendering:[],service:[]};n(Bp.importEntities({entities:{AnnotationPage:{[v.id]:v}}}))},[r]);const o=Kn(v=>r?v.iiif.entities.AnnotationPage[r]:null,[r]),c=C.useCallback((v,g)=>{if(r){if(W0(v)){const w=v;w.__vault||w.bindToVault(t),v=typeof w.source=="string"?w.source:w.source.id,e.current[v]=w}else typeof v!="string"&&(v=v.id);const x=t.get({id:r,type:"AnnotationPage"}),m=t.get({id:v,type:"Annotation"});x&&m&&(x.items.find(w=>w.id===m.id)||n(Bp.addReference({id:r,type:"AnnotationPage",key:"items",reference:{id:v,type:"Annotation"},index:g})))}},[r]),h=C.useCallback(v=>{r&&(W0(v)?v=typeof v.source=="string"?v.source:v.source.id:typeof v!="string"&&(v=v.id),e.current[v]&&e.current[v].beforeRemove(),t.get({id:r,type:"AnnotationPage"})&&n(Bp.removeReference({id:r,type:"AnnotationPage",key:"items",reference:{id:v,type:"Annotation"}})))},[r]);return[o,{addAnnotation:c,removeAnnotation:h}]}const q0=C.createContext(null);function Y0(){const t=C.useContext(q0);return[t.fullPage,{addAnnotation:t.addAnnotation,removeAnnotation:t.removeAnnotation}]}function Q0({children:t}){const[e,{addAnnotation:n,removeAnnotation:r}]=$0();return le.jsx(q0.Provider,{value:C.useMemo(()=>({fullPage:e,addAnnotation:n,removeAnnotation:r}),[e]),children:t})}function YR({width:t,style:e,height:n,error:r,resetErrorBoundary:o}){return le.jsxs("div",{style:{width:t,height:n,minHeight:500,...e||{},background:"#f9f9f9"},children:[le.jsx("h3",{children:"Error occurred"}),le.jsx("p",{children:r.message}),le.jsx("button",{onClick:o,children:"Reset"})]})}const sd=C.createContext(null);function G0(){return C.useContext(sd)}const X0=C.createContext(()=>{}),K0=C.createContext(()=>{});function fl(t,e,n,r,o=[]){const c=C.useContext(t==="portal"?K0:X0);C.useEffect(()=>(t!=="none"&&c(e,n,r),()=>{c(e,null)}),[e,t,c,...o])}function $r(t={},e=[]){const{id:n,selector:r}=t,o=Ss(),c=n||o.canvas,h=Kn(v=>c?v.iiif.entities.Canvas[c]:void 0,[c]);return C.useMemo(()=>{if(h)return r?r(h):h},[h,r,...e])}const Z0=C.createContext(()=>{});function QR(t){const e=$r(),n=C.useContext(Z0);C.useEffect(()=>e&&e.id?(n(e.id,t),()=>n(e.id,-1)):()=>{},[e,t])}function GR({children:t,errorFallback:e,outerContainerProps:n={},worldScale:r,...o}){const[c,h]=C.useState(),v=B0(),g=e||YR,[x,m]=C.useState({}),w=Object.entries(x),[A,P]=C.useState({}),M=Object.entries(A),[_,L]=C.useState({}),k=C.useMemo(()=>r||Math.max(...Object.values(_)),[_]),O=C.useMemo(()=>({maxOverZoom:k||1,...o.runtimeOptions||{}}),[k,o.runtimeOptions]),I=C.useCallback((H,J)=>{L(re=>{if(J===-1){const{[H]:$,...se}=re;return se}return{...re,[H]:J}})},[]),q=C.useCallback((H,J,re)=>{m(({[H]:$,...se})=>J?{...se,[H]:{element:J,props:re}}:se)},[]),te=C.useCallback((H,J,re)=>{P(({[H]:$,...se})=>J?{...se,[H]:{element:J,props:re}}:se)},[]);return le.jsxs(wR,{resetKeys:[],fallbackRender:H=>le.jsx(g,{...o,...H}),children:[le.jsx(fR,{...o,containerProps:{style:{position:"relative"},...o.containerProps||{}},htmlChildren:le.jsx(le.Fragment,{children:w.map(([H,{element:J,props:re}])=>le.jsx(C.Fragment,{children:le.jsx(J,{...re||{}})},H))}),onCreated:H=>{h(H),o.onCreated&&o.onCreated(H)},runtimeOptions:O,children:le.jsx(sd.Provider,{value:c,children:le.jsx(Z0.Provider,{value:I,children:le.jsx(X0.Provider,{value:q,children:le.jsx(K0.Provider,{value:te,children:le.jsx(H0,{bridge:v,children:le.jsx(ju.Provider,{value:o.mode||"explore",children:le.jsx(Q0,{children:t})})})})})})})}),le.jsx("div",{children:M.map(([H,{element:J,props:re}])=>le.jsx(C.Fragment,{children:le.jsx(J,{...re||{}})},H))})]})}const ad={},J0={get(t){return t},setMetaValue([t,e,n],r){const o=J0.getResourceMeta(t,e),c=o?o[n]:void 0,h=typeof r=="function"?r(c):r;ad[t]={...ad[t]||{},[e]:{...(ad[t]||{})[e]||{},[n]:h}}},getResourceMeta:(t,e)=>{const n=ad[t];if(n)return e?n[e]:n}};function e1(t=J0){return{addEventListener(e,n,r,o){if(e)return t.setMetaValue([e.id,"eventManager",n],c=>{const h=c||[];for(const v of h)if(v.callback===r)return h;return[...h,{callback:r,scope:o}]}),r},removeEventListener(e,n,r){e&&t.setMetaValue([e.id,"eventManager",n],o=>(o||[]).filter(c=>c.callback!==r))},getListenersAsProps(e,n){const r=typeof e=="string"?{id:e}:e;if(!r||!r.id)return{};const o=t.getResourceMeta(r.id,"eventManager"),c={};if(o&&r)for(const h of Object.keys(o))c[h]=v=>{const g=t.get(r);for(const{callback:x,scope:m}of o[h]||[])(!m||n&&m.indexOf(n)!==-1)&&x(v,g)};return c}}}function Hp(t,e){const n=kn(),r=C.useMemo(()=>e1(n),[n]),o=Kn(()=>t&&t.id?n.getResourceMeta(t.id,"eventManager"):null,[t]);return C.useMemo(()=>t?r.getListenersAsProps(t,e):{},[o,t,n,e])}const od={},t1={get(t){return t},setMetaValue([t,e,n],r){const o=t1.getResourceMeta(t,e),c=o?o[n]:void 0,h=typeof r=="function"?r(c):r;od[t]={...od[t]||{},[e]:{...(od[t]||{})[e]||{},[n]:h}}},getResourceMeta:(t,e)=>{const n=od[t];if(n)return e?n[e]:n}};function Vp(t=t1){return{applyStyles(e,n,r){const o=typeof e=="string"?e:e.id;return t.setMetaValue([o,"styles",n],r)},getAppliedStyles(e){const n=typeof e=="string"?e:e.id;return t.getResourceMeta(n,"styles")}}}function $u(t,e){const n=kn(),r=C.useMemo(()=>Vp(n),[n]);return Kn(()=>{if(!t)return null;const o=r.getAppliedStyles(t.id);return o?e?o[e]:o:void 0},[t,e])}var XR=Object.defineProperty,KR=(t,e,n)=>e in t?XR(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ld=(t,e,n)=>(KR(t,typeof e!="symbol"?e+"":e,n),n),ZR=function(){function t(e,n){var r=[],o=!0,c=!1,h=void 0;try{for(var v=e[Symbol.iterator](),g;!(o=(g=v.next()).done)&&(r.push(g.value),!(n&&r.length===n));o=!0);}catch(x){c=!0,h=x}finally{try{!o&&v.return&&v.return()}finally{if(c)throw h}}return r}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),qu=Math.PI*2,Wp=function(t,e,n,r,o,c,h){var v=t.x,g=t.y;v*=e,g*=n;var x=r*v-o*g,m=o*v+r*g;return{x:x+c,y:m+h}},JR=function(t,e){var n=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(e/4),r=Math.cos(t),o=Math.sin(t),c=Math.cos(t+e),h=Math.sin(t+e);return[{x:r-o*n,y:o+r*n},{x:c+h*n,y:h-c*n},{x:c,y:h}]},n1=function(t,e,n,r){var o=t*r-e*n<0?-1:1,c=t*n+e*r;return c>1&&(c=1),c<-1&&(c=-1),o*Math.acos(c)},eA=function(t,e,n,r,o,c,h,v,g,x,m,w){var A=Math.pow(o,2),P=Math.pow(c,2),M=Math.pow(m,2),_=Math.pow(w,2),L=A*P-A*_-P*M;L<0&&(L=0),L/=A*_+P*M,L=Math.sqrt(L)*(h===v?-1:1);var k=L*o/c*w,O=L*-c/o*m,I=x*k-g*O+(t+n)/2,q=g*k+x*O+(e+r)/2,te=(m-k)/o,H=(w-O)/c,J=(-m-k)/o,re=(-w-O)/c,$=n1(1,0,te,H),se=n1(te,H,J,re);return v===0&&se>0&&(se-=qu),v===1&&se<0&&(se+=qu),[I,q,$,se]},tA=function(t){var e=t.px,n=t.py,r=t.cx,o=t.cy,c=t.rx,h=t.ry,v=t.xAxisRotation,g=v===void 0?0:v,x=t.largeArcFlag,m=x===void 0?0:x,w=t.sweepFlag,A=w===void 0?0:w,P=[];if(c===0||h===0)return[];var M=Math.sin(g*qu/360),_=Math.cos(g*qu/360),L=_*(e-r)/2+M*(n-o)/2,k=-M*(e-r)/2+_*(n-o)/2;if(L===0&&k===0)return[];c=Math.abs(c),h=Math.abs(h);var O=Math.pow(L,2)/Math.pow(c,2)+Math.pow(k,2)/Math.pow(h,2);O>1&&(c*=Math.sqrt(O),h*=Math.sqrt(O));var I=eA(e,n,r,o,c,h,m,A,M,_,L,k),q=ZR(I,4),te=q[0],H=q[1],J=q[2],re=q[3],$=Math.abs(re)/(qu/4);Math.abs(1-$)<1e-7&&($=1);var se=Math.max(Math.ceil($),1);re/=se;for(var ge=0;ge<se;ge++)P.push(JR(J,re)),J+=re;return P.map(function(Ce){var me=Wp(Ce[0],c,h,_,M,te,H),Ie=me.x,_e=me.y,Ye=Wp(Ce[1],c,h,_,M,te,H),gt=Ye.x,Z=Ye.y,Ue=Wp(Ce[2],c,h,_,M,te,H),dt=Ue.x,pe=Ue.y;return{x1:Ie,y1:_e,x2:gt,y2:Z,x:dt,y:pe}})};function i1(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var nA=rA,$p={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},iA=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function rA(t){var e=[];return t.replace(iA,function(n,r,o){var c=r.toLowerCase();for(o=aA(o),c=="m"&&o.length>2&&(e.push([r].concat(o.splice(0,2))),c="l",r=r=="m"?"l":"L");;){if(o.length==$p[c])return o.unshift(r),e.push(o);if(o.length<$p[c])throw new Error("malformed path data");e.push([r].concat(o.splice(0,$p[c])))}}),e}var sA=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function aA(t){var e=t.match(sA);return e?e.map(Number):[]}const oA=i1(nA);var lA=uA;function uA(t){var e=0,n=0,r=0,o=0;return t.map(function(c){c=c.slice();var h=c[0],v=h.toUpperCase();if(h!=v)switch(c[0]=v,h){case"a":c[6]+=r,c[7]+=o;break;case"v":c[1]+=o;break;case"h":c[1]+=r;break;default:for(var g=1;g<c.length;)c[g++]+=r,c[g++]+=o}switch(v){case"Z":r=e,o=n;break;case"H":r=c[1];break;case"V":o=c[1];break;case"M":r=e=c[1],o=n=c[2];break;default:r=c[c.length-2],o=c[c.length-1]}return c})}const cA=i1(lA);function fA(t){const e=oA(t),n=cA(e);let r,o=0,c=0,h=0,v=0,g,x,m=0,w=0;const A=[];for(let P=0;P<n.length;P++){let M=n[P];const _=M[0];switch(_){case"M":o=M[1],c=M[2];break;case"H":M=["L",M[1],c];break;case"V":M=["L",o,M[1]];break;case"S":{let L=m,k=w;(r==="C"||r=="S")&&(L+=L-h,k+=k-v),M=["C",L,k,M[1],M[2],M[3],M[4]]}break;case"T":r==="Q"||r=="T"?(g=m*2-g,x=w*2-x):(g=m,x=w),M=["Q",g,x,M[1],M[2]];break;case"Q":g=M[1],x=M[2];break;case"A":{const L=tA({px:m,py:w,cx:M[6],cy:M[7],rx:M[1],ry:M[2],xAxisRotation:M[3],largeArcFlag:M[4],sweepFlag:M[5]});if(!L.length)continue;for(const[k,O]of L.entries())M=["C",O.x1,O.y1,O.x2,O.y2,O.x,O.y],k<L.length-1&&A.push(M);M=M}break;case"Z":M=["L",o,c];break}r=_,m=M[M.length-2],w=M[M.length-1],["C","Q","A"].indexOf(_)>-1?(h=M[M.length-4],v=M[M.length-3]):(h=m,v=w),A.push(M)}return A}/** Code to "flatten" quadratic and cubic Bézier curves to polylines.
|
|
289
285
|
*
|
|
290
286
|
* All code in this module is based on JavaScript code by Raph Levien, published on his blog at
|
|
291
287
|
* https://raphlinus.github.io/.
|
|
@@ -315,7 +311,7 @@ No matching component was found for:
|
|
|
315
311
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
316
312
|
* See the License for the specific language governing permissions and
|
|
317
313
|
* limitations under the License.
|
|
318
|
-
*/function IL(t,e,n,i=1){return new Sb(t,e,n).subdivide(i)}function NL(t,e,n,i,a=1){return new Kv(new Float64Array([t.x,t.y,e.x,e.y,n.x,n.y,i.x,i.y])).subdivide(a)}function zL(t){return t.x*t.x+t.y*t.y}function Rc(t){return t/(1-.67+Math.pow(Math.pow(.67,4)+.25*t*t,.25))}function Bl(t){return t*(1-.39+Math.sqrt(.39*.39+.25*t*t))}class Sb{constructor(e,n,i){Bd(this,"start"),Bd(this,"control"),Bd(this,"end"),this.start=e,this.control=n,this.end=i}eval(e){const n=1-e;return{x:this.start.x*n*n+2*this.control.x*n*e+this.end.x*e*e,y:this.start.y*n*n+2*this.control.y*n*e+this.end.y*e*e}}mapToBasic(){const{x:e,y:n}=this.start,{x:i,y:a}=this.control,{x:u,y:f}=this.end,p=2*i-e-u,g=2*a-n-f,S=(i-e)*p+(a-n)*g,m=(u-i)*p+(f-a)*g,x=(u-e)*g-(f-n)*p,R=S/x,_=m/x,M=Math.abs(x)/(Math.hypot(p,g)*Math.abs(_-R));return{x0:e,x2:u,scale:M,cross:x}}subdivide(e){const n=this.mapToBasic(),i=Rc(n.x0),a=Rc(n.x2),u=.5*Math.abs(a-i)*Math.sqrt(n.scale/e),f=Math.ceil(u),p=Bl(i),g=Bl(a),S=[0];for(let m=1;m<f;m++){const x=(Bl(i+(a-i)*m/f)-p)/(g-p);S.push(x)}return S.push(1),S.map(m=>this.eval(m))}}class Kv{constructor(e){Bd(this,"c"),this.c=e}weightsum(e,n,i,a){const u=e*this.c[0]+n*this.c[2]+i*this.c[4]+a*this.c[6],f=e*this.c[1]+n*this.c[3]+i*this.c[5]+a*this.c[7];return{x:u,y:f}}eval(e){const n=1-e,i=n*n*n,a=3*n*n*e,u=3*n*e*e,f=e*e*e;return this.weightsum(i,a,u,f)}deriv(e){const n=1-e,i=-3*n*n,a=3*e*e,u=-6*e*n-i,f=6*e*n-a;return this.weightsum(i,u,f,a)}midpoint_quadbez(){const e=this.weightsum(-.25,.75,.75,-.25);return new Sb({x:this.c[0],y:this.c[1]},e,{x:this.c[6],y:this.c[7]})}subsegment(e,n){const i=new Float64Array(8),a=this.eval(e),u=this.eval(n);i[0]=a.x,i[1]=a.y;const f=(n-e)/3,p=this.deriv(e);i[2]=a.x+f*p.x,i[3]=a.y+f*p.y;const g=this.deriv(n);return i[4]=u.x-f*g.x,i[5]=u.y-f*g.y,i[6]=u.x,i[7]=u.y,new Kv(i)}subdivide(e){const n=.1*e,i=e-n,a=Math.sqrt(i),u=zL(this.weightsum(1,-3,3,-1)),f=Math.ceil(Math.pow(u/(432*n*n),1/6)),p=[];let g=0;for(let M=0;M<f;M++){const k=M/f,L=(M+1)/f,P=this.subsegment(k,L).midpoint_quadbez(),O=P.mapToBasic(),j=Rc(O.x0),q=Rc(O.x2),ee=Math.sqrt(O.scale);let H=Math.abs(q-j)*ee;if(Math.sign(O.x0)!=Math.sign(O.x2)){const Z=a/ee,ie=a*Math.abs(q-j)/Rc(Z);H=Math.max(H,ie)}p.push({quad:P,a0:j,a2:q,val:H}),g+=H}const S=.5*g/a,m=Math.ceil(S),x=[{x:this.c[0],y:this.c[1]}];let R=0,_=0;for(let M=1;M<m;M++){const k=g*M/m;for(;R+p[_].val<k;)R+=p[_].val,_++;const L=p[_].a0,P=p[_].a2,O=Bl(L),j=Bl(P),q=L+(P-L)*(k-R)/p[_].val,ee=(Bl(q)-O)/(j-O);x.push(p[_].quad.eval(ee))}return x.push({x:this.c[6],y:this.c[7]}),x}}const UL=/&?(xywh=)?(pixel:|percent:|pct:)?([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?)/,jL=/&?(t=)(npt:)?([0-9]+(.[0-9]+)?)?(,([0-9]+(.[0-9]+)?))?/,bb=/^rgba\((\d+),(\d+),(\d+),([0-9.]+)\)$/;function Ac(t,{domParser:e,svgPreprocessor:n,iiifRenderingHints:i}={}){if(Array.isArray(t))return Or(t.reduce((a,u)=>{const{selector:f,selectors:p,iiifRenderingHints:g}=Ac(u,{domParser:e,svgPreprocessor:n,iiifRenderingHints:i});return f&&(a.selector||(a.selector=f),a.selectors.push(...p)),g&&(a.iiifRenderingHints=a.iiifRenderingHints||{type:"ImageApiSelector"},Object.assign(a.iiifRenderingHints,g)),a},{selector:null,selectors:[],iiifRenderingHints:i}));if(!t)return Or({selector:null,selectors:[],iiifRenderingHints:i});if(typeof t=="string"){const[a,u]=t.split("#");return u?Ac({type:"FragmentSelector",value:u},{svgPreprocessor:n,iiifRenderingHints:i,domParser:e}):Or({selector:null,selectors:[],iiifRenderingHints:i})}if(t.type&&t.type==="PointSelector"&&(t.t||t.t===0)){const a={type:"TemporalSelector",temporal:{startTime:t.t}};return Or({selector:a,selectors:[a],iiifRenderingHints:i})}if(xb(t)){const a=[];if(t.region){const u=Ac({type:"FragmentSelector",value:"xywh="+t.region},{domParser:e,svgPreprocessor:n,iiifRenderingHints:i});a.push(...u.selectors)}return Or({selector:a[0],selectors:a,iiifRenderingHints:i?{...i,...t}:t})}if(t.type==="FragmentSelector"){const a=UL.exec(t.value);if(a){const f={type:"BoxSelector",spatial:{unit:a[2]==="percent:"||a[2]==="pct:"?"percent":"pixel",x:parseFloat(a[3]),y:parseFloat(a[4]),width:parseFloat(a[5]),height:parseFloat(a[6])}};return Or({selector:f,selectors:[f],iiifRenderingHints:i})}const u=t.value.match(jL);if(u){const f={type:"TemporalSelector",temporal:{startTime:u[4]?parseFloat(u[4]):0,endTime:u[7]?parseFloat(u[7]):void 0}};return Or({selector:f,selectors:[f],iiifRenderingHints:i})}return Or({selector:null,selectors:[],iiifRenderingHints:i})}if(t.type==="SvgSelector"&&"value"in t){e||(typeof window<"u"?e=new window.DOMParser:console.warn("No DOMParser available, cannot parse SVG selector, `points`, `spatial` and `style` will be unavailable and the SVG will not be normalized."));let a=[],u,f,p=(n==null?void 0:n(t.value))??t.value,g;if(e){const m=e.parseFromString(t.value,"image/svg+xml").querySelector("svg");if(!m)return console.warn(`Illegal SVG selector: ${t.value}`),Or({selector:null,selectors:[],iiifRenderingHints:i});const x=Eb(m);x&&(a=x.points,g=x.shapeType,u=[Math.min(...a.map(R=>R[0])),Math.min(...a.map(R=>R[1])),Math.max(...a.map(R=>R[0])),Math.max(...a.map(R=>R[1]))],{style:f,svg:p}=HL(x.element)??{svg:p})}const S={type:"SvgSelector",svg:p,svgShape:g,style:f,points:a.length?a:void 0,spatial:u?{unit:"pixel",x:u[0],y:u[1],width:u[2]-u[0],height:u[3]-u[1]}:void 0};return Or({selector:S,selectors:[S],iiifRenderingHints:i})}return Or({selector:null,selectors:[],iiifRenderingHints:i})}function FL(t){const e=t.map(i=>i[0]).reduce((i,a)=>(i[a]+=1,i),{C:0,Q:0,L:0,M:0}),n=new Set(t.map(i=>i[0]));if(e.C>0||e.Q>0)return"path";if(e.L>0&&(n.size===1||n.size===2&&n.has("M"))){if(e.L===4)return"rect";const i=t.slice(-1)[0];return t[0][0]==="M"&&i[0]==="L"&&i[1]==t[0][1]&&i[2]===t[0][2]||i[1]===0&&i[2]===0?"polygon":"polyline"}return"path"}function Eb(t){var e;for(const n of Array.from(t.children))switch(n==null?void 0:n.tagName.toLowerCase()){case"g":{const i=Eb(n);if(i)return i}continue;case"path":{const i=n.getAttribute("d");if(!i)continue;const a=kL(i);return{element:n,points:BL(a),shapeType:FL(a)}}case"circle":{const i=parseFloat(n.getAttribute("cx")??"0"),a=parseFloat(n.getAttribute("cy")??"0"),u=parseFloat(n.getAttribute("r")??"0");if(!u)continue;const f=[];for(let p=0;p<=360;p+=12){const g=p*Math.PI/180;f.push([i+u*Math.cos(g),a+u*Math.sin(g)])}return{element:n,points:f,shapeType:"circle"}}case"ellipse":{const i=parseFloat(n.getAttribute("cx")??"0"),a=parseFloat(n.getAttribute("cy")??"0"),u=parseFloat(n.getAttribute("rx")??"0"),f=parseFloat(n.getAttribute("ry")??"0");if(!u&&!f)continue;const p=[];for(let g=0;g<=360;g+=12){const S=Math.tan(g/360*Math.PI),m=u*(1-S**2)/(1+S**2),x=f*2*S/(1+S**2);p.push([i+m,a+x])}return{element:n,points:p,shapeType:"ellipse"}}case"line":{const i=parseFloat(n.getAttribute("x0")??"0"),a=parseFloat(n.getAttribute("y0")??"0"),u=parseFloat(n.getAttribute("x1")??"0"),f=parseFloat(n.getAttribute("y1")??"0");if(i===u&&a===f)continue;return{element:n,points:[[i,a],[u,f]],shapeType:"polyline"}}case"polygon":case"polyline":{const i=((e=n.getAttribute("points"))==null?void 0:e.split(" ").map(u=>u.split(",").map(parseFloat)))??[];if(!i.length)continue;let a="polyline";return n.tagName.toLowerCase()==="polygon"&&(i.push(i[0]),a="polygon"),{element:n,points:i,shapeType:a}}case"rect":{const i=parseFloat(n.getAttribute("x")??"0"),a=parseFloat(n.getAttribute("y")??"0"),u=parseFloat(n.getAttribute("width")??"0"),f=parseFloat(n.getAttribute("height")??"0");if(!u||!f)continue;return{element:n,points:[[i,a],[i+u,a],[i+u,a+f],[i,a+f],[i,a]],shapeType:"rect"}}default:continue}return null}function BL(t){const e=[];for(let n=0;n<t.length;n++){const i=e[e.length-1]??[0,0],a=t[n];switch(a[0]){case"M":case"L":e.push([a[1],a[2]]);continue;case"C":e.push(...NL({x:i[0],y:i[1]},{x:a[1],y:a[2]},{x:a[3],y:a[4]},{x:a[5],y:a[6]}).map(u=>[u.x,u.y]).slice(1));continue;case"Q":e.push(...IL({x:i[0],y:i[1]},{x:a[1],y:a[2]},{x:a[3],y:a[4]}).map(u=>[u.x,u.y]).slice(1));continue}}return e}function HL(t){const e={};if(t.hasAttribute("fill")?(e.fill=t.getAttribute("fill"),t.removeAttribute("fill")):t.style.fill&&(e.fill=t.style.fill),e.fill){const i=bb.exec(e.fill);i&&(e.fillOpacity=parseFloat(i[4]),e.fill=`rgb(${i[1]}, ${i[2]}, ${i[3]})`)}if(t.hasAttribute("fill-opacity")?(e.fillOpacity=parseFloat(t.getAttribute("fill-opacity")),t.removeAttribute("fill-opacity")):t.style.fillOpacity&&(e.fillOpacity=parseFloat(t.style.fillOpacity)),t.hasAttribute("stroke")?(e.stroke=t.getAttribute("stroke"),t.removeAttribute("stroke")):t.style.stroke&&(e.stroke=t.style.stroke),e.stroke){const i=bb.exec(e.stroke);i&&(e.strokeOpacity=parseFloat(i[4]),e.stroke=`rgb(${i[1]}, ${i[2]}, ${i[3]})`)}t.hasAttribute("stroke-opacity")?(e.strokeOpacity=parseFloat(t.getAttribute("stroke-opacity")),t.removeAttribute("stroke-opacity")):t.style.strokeOpacity&&(e.strokeOpacity=parseFloat(t.style.strokeOpacity)),t.hasAttribute("stroke-width")?(e.strokeWidth=t.getAttribute("stroke-width"),t.removeAttribute("stroke-width")):t.style.strokeWidth&&(e.strokeWidth=t.style.strokeWidth),t.hasAttribute("stroke-dasharray")?(e.strokeDasharray=t.getAttribute("stroke-dasharray"),t.removeAttribute("stroke-dasharray")):t.style.strokeDasharray&&(e.strokeDasharray=t.style.strokeDasharray);let n=t;for(;n.tagName.toLowerCase()!=="svg";)if(n=n.parentElement,n===null)throw new Error("Could not find root SVG element");return{svg:n.outerHTML,style:Object.keys(e).length>0?e:void 0}}function xb(t){return!!t&&t.type==="iiif:ImageApiSelector"&&t.type==="iiif:ImageApiSelector"}function Or(t){if(t.iiifRenderingHints){const e=t.iiifRenderingHints;if(e.rotation){const n=wb(e.rotation);if(n)if(t.selectors.length)for(const i of t.selectors)i.rotation=n;else t.selectors.push({type:"RotationSelector",rotation:n})}}else delete t.iiifRenderingHints;return t}function wb(t){let e=parseFloat(t);return e&&t.startsWith("!")&&(e=360-e),e&&(e=e%360),e!==e?0:e||0}function Sa(t,e={}){if(Array.isArray(t))return Sa(t[0]);if(typeof t=="string"){const[n,i]=t.split("#");return i?Sa({type:"SpecificResource",source:{id:n,type:"Unknown"},selector:{type:"FragmentSelector",value:i}}):{type:"SpecificResource",source:{id:n,type:e.typeMap&&e.typeMap[n]||"Unknown"},selector:null,selectors:[]}}if(t.type==="Choice"||t.type==="List"||t.type==="Composite"||t.type==="Independents")return Sa(t.items[0]);if(t.type==="SpecificResource"){t.source.type==="Canvas"&&t.source.partOf&&typeof t.source.partOf=="string"&&(t.source.partOf=[{id:t.source.partOf,type:"Manifest"}]);const{selector:n,selectors:i}=t.selector?Ac(t.selector,e):{selector:null,selectors:[]};return{type:"SpecificResource",source:t.source,selector:n,selectors:i}}if(t.id){t.type==="Canvas"&&t.partOf&&typeof t.partOf=="string"&&(t.partOf=[{id:t.partOf,type:"Manifest"}]);const[n,i]=t.id.split("#");return i?Sa({type:"SpecificResource",source:{...t,id:n},selector:{type:"FragmentSelector",value:i}}):{type:"SpecificResource",source:{...t,id:n},selector:null,selectors:[]}}return{type:"SpecificResource",source:t,selector:null,selectors:[]}}function Zv(t={},e=[]){const{id:n,selector:i}=t,a=As(),u=Un(),f=n||a.annotation,p=ni(S=>f?S.iiif.entities.Annotation[f]:void 0,[f]),g=ni(S=>p&&p.body?p.body.map(m=>m?m.type==="SpecificResource"?{...m,source:u.get(m)}:m?S.iiif.entities[m.type][m.id]:null:null).filter(Boolean):[],[p]);return T.useMemo(()=>{if(!p)return;const S={...p,body:g,target:Sa(p.target,{typeMap:u.getState().iiif.mapping})};return i?i(S):S},[p,i,g,...e])}const Cb=({id:t,style:e,className:n,interactive:i})=>{const a=Zv({id:t}),u=Cc(a,"atlas"),f=Cc(a,"html"),p=Yv(a,["atlas"]),g=Jr(),S=T.useMemo(()=>NM(e,u),[e,u]);return g&&a&&a.target&&a.target.selector&&a.target.selector.type==="BoxSelector"&&a.target.source&&(a.target.source.id===g.id||a.target.source===g.id)?oe.jsx(kM,{id:a.id,isEditing:!0,region:a.target.selector.spatial,style:S,className:(f==null?void 0:f.className)||n,interactive:!!(f!=null&&f.href||i),href:(f==null?void 0:f.href)||null,title:(f==null?void 0:f.title)||null,hrefTarget:(f==null?void 0:f.target)||null,onClick:()=>{},...p}):null};function Tb(t={},e=[]){const{id:n,selector:i}=t,a=As(),u=n||a.annotationPage,f=ni(p=>u?p.iiif.entities.AnnotationPage[u]:void 0,[u]);return T.useMemo(()=>{if(f)return i?i(f):f},[f,...e])}const Jv=({className:t,page:e})=>{var u;const n=Tb({id:e.id})||e,i=Cc(n,"atlas"),a=Cc(n,"html");return ni(f=>n.id?f.iiif.entities.AnnotationPage[n.id]:null,[]),oe.jsx(T.Fragment,{children:(u=n.items)==null?void 0:u.map(f=>oe.jsx(Cb,{id:f.id,style:i,className:(a==null?void 0:a.className)||t},f.id))})};function Rb({id:t,image:e,thumbnail:n,isStatic:i,x:a=0,y:u=0,children:f,selector:p,onClick:g,enableSizes:S}){var x,R;const m=T.useMemo(()=>{if(!(!p||p.spatial.x===0&&p.spatial.y===0))return p.spatial},[p]);return oe.jsx("world-object",{x:a+e.target.spatial.x,y:u+e.target.spatial.y,width:e.target.spatial.width,height:e.target.spatial.height,onClick:g,children:e.service?oe.jsxs(T.Fragment,{children:[oe.jsx(IM,{tiles:{id:e.service.id||e.service["@id"]||"unknown",height:e.height,width:e.width,imageService:e.service,thumbnail:n&&n.type==="fixed"?n:void 0},enableSizes:S,x:0,y:0,width:(x=e.target)==null?void 0:x.spatial.width,height:(R=e.target)==null?void 0:R.spatial.height,crop:m}),f]},"service"):oe.jsxs(T.Fragment,{children:[oe.jsx("world-image",{onClick:g,uri:e.id,target:{x:0,y:0,width:e.target.spatial.width,height:e.target.spatial.height},display:e.width&&e.height?{width:e.width,height:e.height}:void 0,crop:m}),f]},"no-service")},t+(e.service?"server":"no-service"))}var VL=Object.defineProperty,$L=(t,e,n)=>e in t?VL(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Hd=(t,e,n)=>($L(t,typeof e!="symbol"?e+"":e,n),n),WL=function(){function t(e,n){var i=[],a=!0,u=!1,f=void 0;try{for(var p=e[Symbol.iterator](),g;!(a=(g=p.next()).done)&&(i.push(g.value),!(n&&i.length===n));a=!0);}catch(S){u=!0,f=S}finally{try{!a&&p.return&&p.return()}finally{if(u)throw f}}return i}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),Mc=Math.PI*2,em=function(t,e,n,i,a,u,f){var p=t.x,g=t.y;p*=e,g*=n;var S=i*p-a*g,m=a*p+i*g;return{x:S+u,y:m+f}},qL=function(t,e){var n=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(e/4),i=Math.cos(t),a=Math.sin(t),u=Math.cos(t+e),f=Math.sin(t+e);return[{x:i-a*n,y:a+i*n},{x:u+f*n,y:f-u*n},{x:u,y:f}]},Ab=function(t,e,n,i){var a=t*i-e*n<0?-1:1,u=t*n+e*i;return u>1&&(u=1),u<-1&&(u=-1),a*Math.acos(u)},YL=function(t,e,n,i,a,u,f,p,g,S,m,x){var R=Math.pow(a,2),_=Math.pow(u,2),M=Math.pow(m,2),k=Math.pow(x,2),L=R*_-R*k-_*M;L<0&&(L=0),L/=R*k+_*M,L=Math.sqrt(L)*(f===p?-1:1);var P=L*a/u*x,O=L*-u/a*m,j=S*P-g*O+(t+n)/2,q=g*P+S*O+(e+i)/2,ee=(m-P)/a,H=(x-O)/u,Z=(-m-P)/a,ie=(-x-O)/u,W=Ab(1,0,ee,H),re=Ab(ee,H,Z,ie);return p===0&&re>0&&(re-=Mc),p===1&&re<0&&(re+=Mc),[j,q,W,re]},QL=function(t){var e=t.px,n=t.py,i=t.cx,a=t.cy,u=t.rx,f=t.ry,p=t.xAxisRotation,g=p===void 0?0:p,S=t.largeArcFlag,m=S===void 0?0:S,x=t.sweepFlag,R=x===void 0?0:x,_=[];if(u===0||f===0)return[];var M=Math.sin(g*Mc/360),k=Math.cos(g*Mc/360),L=k*(e-i)/2+M*(n-a)/2,P=-M*(e-i)/2+k*(n-a)/2;if(L===0&&P===0)return[];u=Math.abs(u),f=Math.abs(f);var O=Math.pow(L,2)/Math.pow(u,2)+Math.pow(P,2)/Math.pow(f,2);O>1&&(u*=Math.sqrt(O),f*=Math.sqrt(O));var j=YL(e,n,i,a,u,f,m,R,M,k,L,P),q=WL(j,4),ee=q[0],H=q[1],Z=q[2],ie=q[3],W=Math.abs(ie)/(Mc/4);Math.abs(1-W)<1e-7&&(W=1);var re=Math.max(Math.ceil(W),1);ie/=re;for(var ge=0;ge<re;ge++)_.push(qL(Z,ie)),Z+=ie;return _.map(function(be){var Ee=em(be[0],u,f,k,M,ee,H),Ue=Ee.x,je=Ee.y,Xe=em(be[1],u,f,k,M,ee,H),ce=Xe.x,me=Xe.y,tt=em(be[2],u,f,k,M,ee,H),mt=tt.x,he=tt.y;return{x1:Ue,y1:je,x2:ce,y2:me,x:mt,y:he}})},GL=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Mb(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var XL=ZL,tm={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},KL=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function ZL(t){var e=[];return t.replace(KL,function(n,i,a){var u=i.toLowerCase();for(a=eP(a),u=="m"&&a.length>2&&(e.push([i].concat(a.splice(0,2))),u="l",i=i=="m"?"l":"L");;){if(a.length==tm[u])return a.unshift(i),e.push(a);if(a.length<tm[u])throw new Error("malformed path data");e.push([i].concat(a.splice(0,tm[u])))}}),e}var JL=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function eP(t){var e=t.match(JL);return e?e.map(Number):[]}const tP=Mb(XL);var nP=iP;function iP(t){var e=0,n=0,i=0,a=0;return t.map(function(u){u=u.slice();var f=u[0],p=f.toUpperCase();if(f!=p)switch(u[0]=p,f){case"a":u[6]+=i,u[7]+=a;break;case"v":u[1]+=a;break;case"h":u[1]+=i;break;default:for(var g=1;g<u.length;)u[g++]+=i,u[g++]+=a}switch(p){case"Z":i=e,a=n;break;case"H":i=u[1];break;case"V":a=u[1];break;case"M":i=e=u[1],a=n=u[2];break;default:i=u[u.length-2],a=u[u.length-1]}return u})}const rP=Mb(nP);function sP(t){const e=tP(t),n=rP(e);let i,a=0,u=0,f=0,p=0,g,S,m=0,x=0;const R=[];for(let _=0;_<n.length;_++){let M=n[_];const k=M[0];switch(k){case"M":a=M[1],u=M[2];break;case"H":M=["L",M[1],u];break;case"V":M=["L",a,M[1]];break;case"S":{let L=m,P=x;(i==="C"||i=="S")&&(L+=L-f,P+=P-p),M=["C",L,P,M[1],M[2],M[3],M[4]]}break;case"T":i==="Q"||i=="T"?(g=m*2-g,S=x*2-S):(g=m,S=x),M=["Q",g,S,M[1],M[2]];break;case"Q":g=M[1],S=M[2];break;case"A":{const L=QL({px:m,py:x,cx:M[6],cy:M[7],rx:M[1],ry:M[2],xAxisRotation:M[3],largeArcFlag:M[4],sweepFlag:M[5]});if(!L.length)continue;for(const[P,O]of L.entries())M=["C",O.x1,O.y1,O.x2,O.y2,O.x,O.y],P<L.length-1&&R.push(M);M=M}break;case"Z":M=["L",a,u];break}i=k,m=M[M.length-2],x=M[M.length-1],["C","Q","A"].indexOf(k)>-1?(f=M[M.length-4],p=M[M.length-3]):(f=m,p=x),R.push(M)}return R}/** Code to "flatten" quadratic and cubic Bézier curves to polylines.
|
|
314
|
+
*/function dA(t,e,n,r=1){return new r1(t,e,n).subdivide(r)}function hA(t,e,n,r,o=1){return new qp(new Float64Array([t.x,t.y,e.x,e.y,n.x,n.y,r.x,r.y])).subdivide(o)}function pA(t){return t.x*t.x+t.y*t.y}function Yu(t){return t/(1-.67+Math.pow(Math.pow(.67,4)+.25*t*t,.25))}function dl(t){return t*(1-.39+Math.sqrt(.39*.39+.25*t*t))}class r1{constructor(e,n,r){ld(this,"start"),ld(this,"control"),ld(this,"end"),this.start=e,this.control=n,this.end=r}eval(e){const n=1-e;return{x:this.start.x*n*n+2*this.control.x*n*e+this.end.x*e*e,y:this.start.y*n*n+2*this.control.y*n*e+this.end.y*e*e}}mapToBasic(){const{x:e,y:n}=this.start,{x:r,y:o}=this.control,{x:c,y:h}=this.end,v=2*r-e-c,g=2*o-n-h,x=(r-e)*v+(o-n)*g,m=(c-r)*v+(h-o)*g,w=(c-e)*g-(h-n)*v,A=x/w,P=m/w,M=Math.abs(w)/(Math.hypot(v,g)*Math.abs(P-A));return{x0:e,x2:c,scale:M,cross:w}}subdivide(e){const n=this.mapToBasic(),r=Yu(n.x0),o=Yu(n.x2),c=.5*Math.abs(o-r)*Math.sqrt(n.scale/e),h=Math.ceil(c),v=dl(r),g=dl(o),x=[0];for(let m=1;m<h;m++){const w=(dl(r+(o-r)*m/h)-v)/(g-v);x.push(w)}return x.push(1),x.map(m=>this.eval(m))}}class qp{constructor(e){ld(this,"c"),this.c=e}weightsum(e,n,r,o){const c=e*this.c[0]+n*this.c[2]+r*this.c[4]+o*this.c[6],h=e*this.c[1]+n*this.c[3]+r*this.c[5]+o*this.c[7];return{x:c,y:h}}eval(e){const n=1-e,r=n*n*n,o=3*n*n*e,c=3*n*e*e,h=e*e*e;return this.weightsum(r,o,c,h)}deriv(e){const n=1-e,r=-3*n*n,o=3*e*e,c=-6*e*n-r,h=6*e*n-o;return this.weightsum(r,c,h,o)}midpoint_quadbez(){const e=this.weightsum(-.25,.75,.75,-.25);return new r1({x:this.c[0],y:this.c[1]},e,{x:this.c[6],y:this.c[7]})}subsegment(e,n){const r=new Float64Array(8),o=this.eval(e),c=this.eval(n);r[0]=o.x,r[1]=o.y;const h=(n-e)/3,v=this.deriv(e);r[2]=o.x+h*v.x,r[3]=o.y+h*v.y;const g=this.deriv(n);return r[4]=c.x-h*g.x,r[5]=c.y-h*g.y,r[6]=c.x,r[7]=c.y,new qp(r)}subdivide(e){const n=.1*e,r=e-n,o=Math.sqrt(r),c=pA(this.weightsum(1,-3,3,-1)),h=Math.ceil(Math.pow(c/(432*n*n),1/6)),v=[];let g=0;for(let M=0;M<h;M++){const _=M/h,L=(M+1)/h,k=this.subsegment(_,L).midpoint_quadbez(),O=k.mapToBasic(),I=Yu(O.x0),q=Yu(O.x2),te=Math.sqrt(O.scale);let H=Math.abs(q-I)*te;if(Math.sign(O.x0)!=Math.sign(O.x2)){const J=o/te,re=o*Math.abs(q-I)/Yu(J);H=Math.max(H,re)}v.push({quad:k,a0:I,a2:q,val:H}),g+=H}const x=.5*g/o,m=Math.ceil(x),w=[{x:this.c[0],y:this.c[1]}];let A=0,P=0;for(let M=1;M<m;M++){const _=g*M/m;for(;A+v[P].val<_;)A+=v[P].val,P++;const L=v[P].a0,k=v[P].a2,O=dl(L),I=dl(k),q=L+(k-L)*(_-A)/v[P].val,te=(dl(q)-O)/(I-O);w.push(v[P].quad.eval(te))}return w.push({x:this.c[6],y:this.c[7]}),w}}const vA=/&?(xywh=)?(pixel:|percent:|pct:)?([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?)/,mA=/&?(t=)(npt:)?([0-9]+(.[0-9]+)?)?(,([0-9]+(.[0-9]+)?))?/,s1=/^rgba\((\d+),(\d+),(\d+),([0-9.]+)\)$/;function Qu(t,{domParser:e,svgPreprocessor:n,iiifRenderingHints:r}={}){if(Array.isArray(t))return Er(t.reduce((o,c)=>{const{selector:h,selectors:v,iiifRenderingHints:g}=Qu(c,{domParser:e,svgPreprocessor:n,iiifRenderingHints:r});return h&&(o.selector||(o.selector=h),o.selectors.push(...v)),g&&(o.iiifRenderingHints=o.iiifRenderingHints||{type:"ImageApiSelector"},Object.assign(o.iiifRenderingHints,g)),o},{selector:null,selectors:[],iiifRenderingHints:r}));if(!t)return Er({selector:null,selectors:[],iiifRenderingHints:r});if(typeof t=="string"){const[o,c]=t.split("#");return c?Qu({type:"FragmentSelector",value:c},{svgPreprocessor:n,iiifRenderingHints:r,domParser:e}):Er({selector:null,selectors:[],iiifRenderingHints:r})}if(t.type&&t.type==="PointSelector"&&(t.t||t.t===0)){const o={type:"TemporalSelector",temporal:{startTime:t.t}};return Er({selector:o,selectors:[o],iiifRenderingHints:r})}if(o1(t)){const o=[];if(t.region){const c=Qu({type:"FragmentSelector",value:"xywh="+t.region},{domParser:e,svgPreprocessor:n,iiifRenderingHints:r});o.push(...c.selectors)}return Er({selector:o[0],selectors:o,iiifRenderingHints:r?{...r,...t}:t})}if(t.type==="FragmentSelector"){const o=vA.exec(t.value);if(o){const h={type:"BoxSelector",spatial:{unit:o[2]==="percent:"||o[2]==="pct:"?"percent":"pixel",x:parseFloat(o[3]),y:parseFloat(o[4]),width:parseFloat(o[5]),height:parseFloat(o[6])}};return Er({selector:h,selectors:[h],iiifRenderingHints:r})}const c=t.value.match(mA);if(c){const h={type:"TemporalSelector",temporal:{startTime:c[4]?parseFloat(c[4]):0,endTime:c[7]?parseFloat(c[7]):void 0}};return Er({selector:h,selectors:[h],iiifRenderingHints:r})}return Er({selector:null,selectors:[],iiifRenderingHints:r})}if(t.type==="SvgSelector"&&"value"in t){e||(typeof window<"u"?e=new window.DOMParser:console.warn("No DOMParser available, cannot parse SVG selector, `points`, `spatial` and `style` will be unavailable and the SVG will not be normalized."));let o=[],c,h,v=(n==null?void 0:n(t.value))??t.value,g;if(e){const m=e.parseFromString(t.value,"image/svg+xml").querySelector("svg");if(!m)return console.warn(`Illegal SVG selector: ${t.value}`),Er({selector:null,selectors:[],iiifRenderingHints:r});const w=a1(m);w&&(o=w.points,g=w.shapeType,c=[Math.min(...o.map(A=>A[0])),Math.min(...o.map(A=>A[1])),Math.max(...o.map(A=>A[0])),Math.max(...o.map(A=>A[1]))],{style:h,svg:v}=SA(w.element)??{svg:v})}const x={type:"SvgSelector",svg:v,svgShape:g,style:h,points:o.length?o:void 0,spatial:c?{unit:"pixel",x:c[0],y:c[1],width:c[2]-c[0],height:c[3]-c[1]}:void 0};return Er({selector:x,selectors:[x],iiifRenderingHints:r})}return Er({selector:null,selectors:[],iiifRenderingHints:r})}function gA(t){const e=t.map(r=>r[0]).reduce((r,o)=>(r[o]+=1,r),{C:0,Q:0,L:0,M:0}),n=new Set(t.map(r=>r[0]));if(e.C>0||e.Q>0)return"path";if(e.L>0&&(n.size===1||n.size===2&&n.has("M"))){if(e.L===4)return"rect";const r=t.slice(-1)[0];return t[0][0]==="M"&&r[0]==="L"&&r[1]==t[0][1]&&r[2]===t[0][2]||r[1]===0&&r[2]===0?"polygon":"polyline"}return"path"}function a1(t){var e;for(const n of Array.from(t.children))switch(n==null?void 0:n.tagName.toLowerCase()){case"g":{const r=a1(n);if(r)return r}continue;case"path":{const r=n.getAttribute("d");if(!r)continue;const o=fA(r);return{element:n,points:yA(o),shapeType:gA(o)}}case"circle":{const r=parseFloat(n.getAttribute("cx")??"0"),o=parseFloat(n.getAttribute("cy")??"0"),c=parseFloat(n.getAttribute("r")??"0");if(!c)continue;const h=[];for(let v=0;v<=360;v+=12){const g=v*Math.PI/180;h.push([r+c*Math.cos(g),o+c*Math.sin(g)])}return{element:n,points:h,shapeType:"circle"}}case"ellipse":{const r=parseFloat(n.getAttribute("cx")??"0"),o=parseFloat(n.getAttribute("cy")??"0"),c=parseFloat(n.getAttribute("rx")??"0"),h=parseFloat(n.getAttribute("ry")??"0");if(!c&&!h)continue;const v=[];for(let g=0;g<=360;g+=12){const x=Math.tan(g/360*Math.PI),m=c*(1-x**2)/(1+x**2),w=h*2*x/(1+x**2);v.push([r+m,o+w])}return{element:n,points:v,shapeType:"ellipse"}}case"line":{const r=parseFloat(n.getAttribute("x0")??"0"),o=parseFloat(n.getAttribute("y0")??"0"),c=parseFloat(n.getAttribute("x1")??"0"),h=parseFloat(n.getAttribute("y1")??"0");if(r===c&&o===h)continue;return{element:n,points:[[r,o],[c,h]],shapeType:"polyline"}}case"polygon":case"polyline":{const r=((e=n.getAttribute("points"))==null?void 0:e.split(" ").map(c=>c.split(",").map(parseFloat)))??[];if(!r.length)continue;let o="polyline";return n.tagName.toLowerCase()==="polygon"&&(r.push(r[0]),o="polygon"),{element:n,points:r,shapeType:o}}case"rect":{const r=parseFloat(n.getAttribute("x")??"0"),o=parseFloat(n.getAttribute("y")??"0"),c=parseFloat(n.getAttribute("width")??"0"),h=parseFloat(n.getAttribute("height")??"0");if(!c||!h)continue;return{element:n,points:[[r,o],[r+c,o],[r+c,o+h],[r,o+h],[r,o]],shapeType:"rect"}}default:continue}return null}function yA(t){const e=[];for(let n=0;n<t.length;n++){const r=e[e.length-1]??[0,0],o=t[n];switch(o[0]){case"M":case"L":e.push([o[1],o[2]]);continue;case"C":e.push(...hA({x:r[0],y:r[1]},{x:o[1],y:o[2]},{x:o[3],y:o[4]},{x:o[5],y:o[6]}).map(c=>[c.x,c.y]).slice(1));continue;case"Q":e.push(...dA({x:r[0],y:r[1]},{x:o[1],y:o[2]},{x:o[3],y:o[4]}).map(c=>[c.x,c.y]).slice(1));continue}}return e}function SA(t){const e={};if(t.hasAttribute("fill")?(e.fill=t.getAttribute("fill"),t.removeAttribute("fill")):t.style.fill&&(e.fill=t.style.fill),e.fill){const r=s1.exec(e.fill);r&&(e.fillOpacity=parseFloat(r[4]),e.fill=`rgb(${r[1]}, ${r[2]}, ${r[3]})`)}if(t.hasAttribute("fill-opacity")?(e.fillOpacity=parseFloat(t.getAttribute("fill-opacity")),t.removeAttribute("fill-opacity")):t.style.fillOpacity&&(e.fillOpacity=parseFloat(t.style.fillOpacity)),t.hasAttribute("stroke")?(e.stroke=t.getAttribute("stroke"),t.removeAttribute("stroke")):t.style.stroke&&(e.stroke=t.style.stroke),e.stroke){const r=s1.exec(e.stroke);r&&(e.strokeOpacity=parseFloat(r[4]),e.stroke=`rgb(${r[1]}, ${r[2]}, ${r[3]})`)}t.hasAttribute("stroke-opacity")?(e.strokeOpacity=parseFloat(t.getAttribute("stroke-opacity")),t.removeAttribute("stroke-opacity")):t.style.strokeOpacity&&(e.strokeOpacity=parseFloat(t.style.strokeOpacity)),t.hasAttribute("stroke-width")?(e.strokeWidth=t.getAttribute("stroke-width"),t.removeAttribute("stroke-width")):t.style.strokeWidth&&(e.strokeWidth=t.style.strokeWidth),t.hasAttribute("stroke-dasharray")?(e.strokeDasharray=t.getAttribute("stroke-dasharray"),t.removeAttribute("stroke-dasharray")):t.style.strokeDasharray&&(e.strokeDasharray=t.style.strokeDasharray);let n=t;for(;n.tagName.toLowerCase()!=="svg";)if(n=n.parentElement,n===null)throw new Error("Could not find root SVG element");return{svg:n.outerHTML,style:Object.keys(e).length>0?e:void 0}}function o1(t){return!!t&&t.type==="iiif:ImageApiSelector"&&t.type==="iiif:ImageApiSelector"}function Er(t){if(t.iiifRenderingHints){const e=t.iiifRenderingHints;if(e.rotation){const n=l1(e.rotation);if(n)if(t.selectors.length)for(const r of t.selectors)r.rotation=n;else t.selectors.push({type:"RotationSelector",rotation:n})}}else delete t.iiifRenderingHints;return t}function l1(t){let e=parseFloat(t);return e&&t.startsWith("!")&&(e=360-e),e&&(e=e%360),e!==e?0:e||0}function ta(t,e={}){if(Array.isArray(t))return ta(t[0]);if(typeof t=="string"){const[n,r]=t.split("#");return r?ta({type:"SpecificResource",source:{id:n,type:"Unknown"},selector:{type:"FragmentSelector",value:r}}):{type:"SpecificResource",source:{id:n,type:e.typeMap&&e.typeMap[n]||"Unknown"},selector:null,selectors:[]}}if(t.type==="Choice"||t.type==="List"||t.type==="Composite"||t.type==="Independents")return ta(t.items[0]);if(t.type==="SpecificResource"){t.source.type==="Canvas"&&t.source.partOf&&typeof t.source.partOf=="string"&&(t.source.partOf=[{id:t.source.partOf,type:"Manifest"}]);const{selector:n,selectors:r}=t.selector?Qu(t.selector,e):{selector:null,selectors:[]};return{type:"SpecificResource",source:t.source,selector:n,selectors:r}}if(t.id){t.type==="Canvas"&&t.partOf&&typeof t.partOf=="string"&&(t.partOf=[{id:t.partOf,type:"Manifest"}]);const[n,r]=t.id.split("#");return r?ta({type:"SpecificResource",source:{...t,id:n},selector:{type:"FragmentSelector",value:r}}):{type:"SpecificResource",source:{...t,id:n},selector:null,selectors:[]}}return{type:"SpecificResource",source:t,selector:null,selectors:[]}}function Yp(t={},e=[]){const{id:n,selector:r}=t,o=Ss(),c=kn(),h=n||o.annotation,v=Kn(x=>h?x.iiif.entities.Annotation[h]:void 0,[h]),g=Kn(x=>v&&v.body?v.body.map(m=>m?m.type==="SpecificResource"?{...m,source:c.get(m)}:m?x.iiif.entities[m.type][m.id]:null:null).filter(Boolean):[],[v]);return C.useMemo(()=>{if(!v)return;const x={...v,body:g,target:ta(v.target,{typeMap:c.getState().iiif.mapping})};return r?r(x):x},[v,r,g,...e])}const u1=({id:t,style:e,className:n,interactive:r})=>{const o=Yp({id:t}),c=$u(o,"atlas"),h=$u(o,"html"),v=Hp(o,["atlas"]),g=$r(),x=C.useMemo(()=>bR(e,c),[e,c]);return g&&o&&o.target&&o.target.selector&&o.target.selector.type==="BoxSelector"&&o.target.source&&(o.target.source.id===g.id||o.target.source===g.id)?le.jsx(yR,{id:o.id,isEditing:!0,region:o.target.selector.spatial,style:x,className:(h==null?void 0:h.className)||n,interactive:!!(h!=null&&h.href||r),href:(h==null?void 0:h.href)||null,title:(h==null?void 0:h.title)||null,hrefTarget:(h==null?void 0:h.target)||null,onClick:()=>{},...v}):null};function c1(t={},e=[]){const{id:n,selector:r}=t,o=Ss(),c=n||o.annotationPage,h=Kn(v=>c?v.iiif.entities.AnnotationPage[c]:void 0,[c]);return C.useMemo(()=>{if(h)return r?r(h):h},[h,...e])}const Qp=({className:t,page:e})=>{var c;const n=c1({id:e.id})||e,r=$u(n,"atlas"),o=$u(n,"html");return Kn(h=>n.id?h.iiif.entities.AnnotationPage[n.id]:null,[]),le.jsx(C.Fragment,{children:(c=n.items)==null?void 0:c.map(h=>le.jsx(u1,{id:h.id,style:r,className:(o==null?void 0:o.className)||t},h.id))})};function f1({id:t,image:e,thumbnail:n,isStatic:r,x:o=0,y:c=0,children:h,selector:v,onClick:g,enableSizes:x}){var w,A;const m=C.useMemo(()=>{if(!(!v||v.spatial.x===0&&v.spatial.y===0))return v.spatial},[v]);return le.jsx("world-object",{x:o+e.target.spatial.x,y:c+e.target.spatial.y,width:e.target.spatial.width,height:e.target.spatial.height,onClick:g,children:e.service?le.jsxs(C.Fragment,{children:[le.jsx(SR,{tiles:{id:e.service.id||e.service["@id"]||"unknown",height:e.height,width:e.width,imageService:e.service,thumbnail:n&&n.type==="fixed"?n:void 0},enableSizes:x,x:0,y:0,width:(w=e.target)==null?void 0:w.spatial.width,height:(A=e.target)==null?void 0:A.spatial.height,crop:m}),h]},"service"):le.jsxs(C.Fragment,{children:[le.jsx("world-image",{onClick:g,uri:e.id,target:{x:0,y:0,width:e.target.spatial.width,height:e.target.spatial.height},display:e.width&&e.height?{width:e.width,height:e.height}:void 0,crop:m}),h]},"no-service")},t+(e.service?"server":"no-service"))}var bA=Object.defineProperty,xA=(t,e,n)=>e in t?bA(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ud=(t,e,n)=>(xA(t,typeof e!="symbol"?e+"":e,n),n),EA=function(){function t(e,n){var r=[],o=!0,c=!1,h=void 0;try{for(var v=e[Symbol.iterator](),g;!(o=(g=v.next()).done)&&(r.push(g.value),!(n&&r.length===n));o=!0);}catch(x){c=!0,h=x}finally{try{!o&&v.return&&v.return()}finally{if(c)throw h}}return r}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),Gu=Math.PI*2,Gp=function(t,e,n,r,o,c,h){var v=t.x,g=t.y;v*=e,g*=n;var x=r*v-o*g,m=o*v+r*g;return{x:x+c,y:m+h}},wA=function(t,e){var n=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(e/4),r=Math.cos(t),o=Math.sin(t),c=Math.cos(t+e),h=Math.sin(t+e);return[{x:r-o*n,y:o+r*n},{x:c+h*n,y:h-c*n},{x:c,y:h}]},d1=function(t,e,n,r){var o=t*r-e*n<0?-1:1,c=t*n+e*r;return c>1&&(c=1),c<-1&&(c=-1),o*Math.acos(c)},TA=function(t,e,n,r,o,c,h,v,g,x,m,w){var A=Math.pow(o,2),P=Math.pow(c,2),M=Math.pow(m,2),_=Math.pow(w,2),L=A*P-A*_-P*M;L<0&&(L=0),L/=A*_+P*M,L=Math.sqrt(L)*(h===v?-1:1);var k=L*o/c*w,O=L*-c/o*m,I=x*k-g*O+(t+n)/2,q=g*k+x*O+(e+r)/2,te=(m-k)/o,H=(w-O)/c,J=(-m-k)/o,re=(-w-O)/c,$=d1(1,0,te,H),se=d1(te,H,J,re);return v===0&&se>0&&(se-=Gu),v===1&&se<0&&(se+=Gu),[I,q,$,se]},CA=function(t){var e=t.px,n=t.py,r=t.cx,o=t.cy,c=t.rx,h=t.ry,v=t.xAxisRotation,g=v===void 0?0:v,x=t.largeArcFlag,m=x===void 0?0:x,w=t.sweepFlag,A=w===void 0?0:w,P=[];if(c===0||h===0)return[];var M=Math.sin(g*Gu/360),_=Math.cos(g*Gu/360),L=_*(e-r)/2+M*(n-o)/2,k=-M*(e-r)/2+_*(n-o)/2;if(L===0&&k===0)return[];c=Math.abs(c),h=Math.abs(h);var O=Math.pow(L,2)/Math.pow(c,2)+Math.pow(k,2)/Math.pow(h,2);O>1&&(c*=Math.sqrt(O),h*=Math.sqrt(O));var I=TA(e,n,r,o,c,h,m,A,M,_,L,k),q=EA(I,4),te=q[0],H=q[1],J=q[2],re=q[3],$=Math.abs(re)/(Gu/4);Math.abs(1-$)<1e-7&&($=1);var se=Math.max(Math.ceil($),1);re/=se;for(var ge=0;ge<se;ge++)P.push(wA(J,re)),J+=re;return P.map(function(Ce){var me=Gp(Ce[0],c,h,_,M,te,H),Ie=me.x,_e=me.y,Ye=Gp(Ce[1],c,h,_,M,te,H),gt=Ye.x,Z=Ye.y,Ue=Gp(Ce[2],c,h,_,M,te,H),dt=Ue.x,pe=Ue.y;return{x1:Ie,y1:_e,x2:gt,y2:Z,x:dt,y:pe}})},RA=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function h1(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var AA=OA,Xp={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},MA=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function OA(t){var e=[];return t.replace(MA,function(n,r,o){var c=r.toLowerCase();for(o=LA(o),c=="m"&&o.length>2&&(e.push([r].concat(o.splice(0,2))),c="l",r=r=="m"?"l":"L");;){if(o.length==Xp[c])return o.unshift(r),e.push(o);if(o.length<Xp[c])throw new Error("malformed path data");e.push([r].concat(o.splice(0,Xp[c])))}}),e}var DA=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function LA(t){var e=t.match(DA);return e?e.map(Number):[]}const PA=h1(AA);var kA=zA;function zA(t){var e=0,n=0,r=0,o=0;return t.map(function(c){c=c.slice();var h=c[0],v=h.toUpperCase();if(h!=v)switch(c[0]=v,h){case"a":c[6]+=r,c[7]+=o;break;case"v":c[1]+=o;break;case"h":c[1]+=r;break;default:for(var g=1;g<c.length;)c[g++]+=r,c[g++]+=o}switch(v){case"Z":r=e,o=n;break;case"H":r=c[1];break;case"V":o=c[1];break;case"M":r=e=c[1],o=n=c[2];break;default:r=c[c.length-2],o=c[c.length-1]}return c})}const NA=h1(kA);function _A(t){const e=PA(t),n=NA(e);let r,o=0,c=0,h=0,v=0,g,x,m=0,w=0;const A=[];for(let P=0;P<n.length;P++){let M=n[P];const _=M[0];switch(_){case"M":o=M[1],c=M[2];break;case"H":M=["L",M[1],c];break;case"V":M=["L",o,M[1]];break;case"S":{let L=m,k=w;(r==="C"||r=="S")&&(L+=L-h,k+=k-v),M=["C",L,k,M[1],M[2],M[3],M[4]]}break;case"T":r==="Q"||r=="T"?(g=m*2-g,x=w*2-x):(g=m,x=w),M=["Q",g,x,M[1],M[2]];break;case"Q":g=M[1],x=M[2];break;case"A":{const L=CA({px:m,py:w,cx:M[6],cy:M[7],rx:M[1],ry:M[2],xAxisRotation:M[3],largeArcFlag:M[4],sweepFlag:M[5]});if(!L.length)continue;for(const[k,O]of L.entries())M=["C",O.x1,O.y1,O.x2,O.y2,O.x,O.y],k<L.length-1&&A.push(M);M=M}break;case"Z":M=["L",o,c];break}r=_,m=M[M.length-2],w=M[M.length-1],["C","Q","A"].indexOf(_)>-1?(h=M[M.length-4],v=M[M.length-3]):(h=m,v=w),A.push(M)}return A}/** Code to "flatten" quadratic and cubic Bézier curves to polylines.
|
|
319
315
|
*
|
|
320
316
|
* All code in this module is based on JavaScript code by Raph Levien, published on his blog at
|
|
321
317
|
* https://raphlinus.github.io/.
|
|
@@ -345,7 +341,7 @@ No matching component was found for:
|
|
|
345
341
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
346
342
|
* See the License for the specific language governing permissions and
|
|
347
343
|
* limitations under the License.
|
|
348
|
-
*/function aP(t,e,n,i=1){return new Ob(t,e,n).subdivide(i)}function oP(t,e,n,i,a=1){return new nm(new Float64Array([t.x,t.y,e.x,e.y,n.x,n.y,i.x,i.y])).subdivide(a)}function lP(t){return t.x*t.x+t.y*t.y}function Oc(t){return t/(1-.67+Math.pow(Math.pow(.67,4)+.25*t*t,.25))}function Hl(t){return t*(1-.39+Math.sqrt(.39*.39+.25*t*t))}class Ob{constructor(e,n,i){Hd(this,"start"),Hd(this,"control"),Hd(this,"end"),this.start=e,this.control=n,this.end=i}eval(e){const n=1-e;return{x:this.start.x*n*n+2*this.control.x*n*e+this.end.x*e*e,y:this.start.y*n*n+2*this.control.y*n*e+this.end.y*e*e}}mapToBasic(){const{x:e,y:n}=this.start,{x:i,y:a}=this.control,{x:u,y:f}=this.end,p=2*i-e-u,g=2*a-n-f,S=(i-e)*p+(a-n)*g,m=(u-i)*p+(f-a)*g,x=(u-e)*g-(f-n)*p,R=S/x,_=m/x,M=Math.abs(x)/(Math.hypot(p,g)*Math.abs(_-R));return{x0:e,x2:u,scale:M,cross:x}}subdivide(e){const n=this.mapToBasic(),i=Oc(n.x0),a=Oc(n.x2),u=.5*Math.abs(a-i)*Math.sqrt(n.scale/e),f=Math.ceil(u),p=Hl(i),g=Hl(a),S=[0];for(let m=1;m<f;m++){const x=(Hl(i+(a-i)*m/f)-p)/(g-p);S.push(x)}return S.push(1),S.map(m=>this.eval(m))}}class nm{constructor(e){Hd(this,"c"),this.c=e}weightsum(e,n,i,a){const u=e*this.c[0]+n*this.c[2]+i*this.c[4]+a*this.c[6],f=e*this.c[1]+n*this.c[3]+i*this.c[5]+a*this.c[7];return{x:u,y:f}}eval(e){const n=1-e,i=n*n*n,a=3*n*n*e,u=3*n*e*e,f=e*e*e;return this.weightsum(i,a,u,f)}deriv(e){const n=1-e,i=-3*n*n,a=3*e*e,u=-6*e*n-i,f=6*e*n-a;return this.weightsum(i,u,f,a)}midpoint_quadbez(){const e=this.weightsum(-.25,.75,.75,-.25);return new Ob({x:this.c[0],y:this.c[1]},e,{x:this.c[6],y:this.c[7]})}subsegment(e,n){const i=new Float64Array(8),a=this.eval(e),u=this.eval(n);i[0]=a.x,i[1]=a.y;const f=(n-e)/3,p=this.deriv(e);i[2]=a.x+f*p.x,i[3]=a.y+f*p.y;const g=this.deriv(n);return i[4]=u.x-f*g.x,i[5]=u.y-f*g.y,i[6]=u.x,i[7]=u.y,new nm(i)}subdivide(e){const n=.1*e,i=e-n,a=Math.sqrt(i),u=lP(this.weightsum(1,-3,3,-1)),f=Math.ceil(Math.pow(u/(432*n*n),1/6)),p=[];let g=0;for(let M=0;M<f;M++){const k=M/f,L=(M+1)/f,P=this.subsegment(k,L).midpoint_quadbez(),O=P.mapToBasic(),j=Oc(O.x0),q=Oc(O.x2),ee=Math.sqrt(O.scale);let H=Math.abs(q-j)*ee;if(Math.sign(O.x0)!=Math.sign(O.x2)){const Z=a/ee,ie=a*Math.abs(q-j)/Oc(Z);H=Math.max(H,ie)}p.push({quad:P,a0:j,a2:q,val:H}),g+=H}const S=.5*g/a,m=Math.ceil(S),x=[{x:this.c[0],y:this.c[1]}];let R=0,_=0;for(let M=1;M<m;M++){const k=g*M/m;for(;R+p[_].val<k;)R+=p[_].val,_++;const L=p[_].a0,P=p[_].a2,O=Hl(L),j=Hl(P),q=L+(P-L)*(k-R)/p[_].val,ee=(Hl(q)-O)/(j-O);x.push(p[_].quad.eval(ee))}return x.push({x:this.c[6],y:this.c[7]}),x}}const uP=/&?(xywh=)?(pixel:|percent:|pct:)?([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?)/,cP=/&?(t=)(npt:)?([0-9]+(.[0-9]+)?)?(,([0-9]+(.[0-9]+)?))?/,_b=/^rgba\((\d+),(\d+),(\d+),([0-9.]+)\)$/;function Vd(t,{domParser:e,svgPreprocessor:n,iiifRenderingHints:i}={}){if(Array.isArray(t))return _r(t.reduce((a,u)=>{const{selector:f,selectors:p,iiifRenderingHints:g}=Vd(u,{domParser:e,svgPreprocessor:n,iiifRenderingHints:i});return f&&(a.selector||(a.selector=f),a.selectors.push(...p)),g&&(a.iiifRenderingHints=a.iiifRenderingHints||{type:"ImageApiSelector"},Object.assign(a.iiifRenderingHints,g)),a},{selector:null,selectors:[],iiifRenderingHints:i}));if(!t)return _r({selector:null,selectors:[],iiifRenderingHints:i});if(typeof t=="string"){const[a,u]=t.split("#");return u?Vd({type:"FragmentSelector",value:u},{svgPreprocessor:n,iiifRenderingHints:i,domParser:e}):_r({selector:null,selectors:[],iiifRenderingHints:i})}if(t.type&&t.type==="PointSelector"&&(t.t||t.t===0)){const a={type:"TemporalSelector",temporal:{startTime:t.t}};return _r({selector:a,selectors:[a],iiifRenderingHints:i})}if(pP(t)){const a=[];if(t.region){const u=Vd({type:"FragmentSelector",value:"xywh="+t.region},{domParser:e,svgPreprocessor:n,iiifRenderingHints:i});a.push(...u.selectors)}return _r({selector:a[0],selectors:a,iiifRenderingHints:i?{...i,...t}:t})}if(t.type==="FragmentSelector"){const a=uP.exec(t.value);if(a){const f={type:"BoxSelector",spatial:{unit:a[2]==="percent:"||a[2]==="pct:"?"percent":"pixel",x:parseFloat(a[3]),y:parseFloat(a[4]),width:parseFloat(a[5]),height:parseFloat(a[6])}};return _r({selector:f,selectors:[f],iiifRenderingHints:i})}const u=t.value.match(cP);if(u){const f={type:"TemporalSelector",temporal:{startTime:u[4]?parseFloat(u[4]):0,endTime:u[7]?parseFloat(u[7]):void 0}};return _r({selector:f,selectors:[f],iiifRenderingHints:i})}return _r({selector:null,selectors:[],iiifRenderingHints:i})}if(t.type==="SvgSelector"&&"value"in t){e||(typeof window<"u"?e=new window.DOMParser:console.warn("No DOMParser available, cannot parse SVG selector, `points`, `spatial` and `style` will be unavailable and the SVG will not be normalized."));let a=[],u,f,p=(n==null?void 0:n(t.value))??t.value,g;if(e){const m=e.parseFromString(t.value,"image/svg+xml").querySelector("svg");if(!m)return console.warn(`Illegal SVG selector: ${t.value}`),_r({selector:null,selectors:[],iiifRenderingHints:i});const x=Lb(m);x&&(a=x.points,g=x.shapeType,u=[Math.min(...a.map(R=>R[0])),Math.min(...a.map(R=>R[1])),Math.max(...a.map(R=>R[0])),Math.max(...a.map(R=>R[1]))],{style:f,svg:p}=hP(x.element)??{svg:p})}const S={type:"SvgSelector",svg:p,svgShape:g,style:f,points:a.length?a:void 0,spatial:u?{unit:"pixel",x:u[0],y:u[1],width:u[2]-u[0],height:u[3]-u[1]}:void 0};return _r({selector:S,selectors:[S],iiifRenderingHints:i})}return _r({selector:null,selectors:[],iiifRenderingHints:i})}function fP(t){const e=t.map(i=>i[0]).reduce((i,a)=>(i[a]+=1,i),{C:0,Q:0,L:0,M:0}),n=new Set(t.map(i=>i[0]));if(e.C>0||e.Q>0)return"path";if(e.L>0&&(n.size===1||n.size===2&&n.has("M"))){if(e.L===4)return"rect";const i=t.slice(-1)[0];return t[0][0]==="M"&&i[0]==="L"&&i[1]==t[0][1]&&i[2]===t[0][2]||i[1]===0&&i[2]===0?"polygon":"polyline"}return"path"}function Lb(t){var e;for(const n of Array.from(t.children))switch(n==null?void 0:n.tagName.toLowerCase()){case"g":{const i=Lb(n);if(i)return i}continue;case"path":{const i=n.getAttribute("d");if(!i)continue;const a=sP(i);return{element:n,points:dP(a),shapeType:fP(a)}}case"circle":{const i=parseFloat(n.getAttribute("cx")??"0"),a=parseFloat(n.getAttribute("cy")??"0"),u=parseFloat(n.getAttribute("r")??"0");if(!u)continue;const f=[];for(let p=0;p<=360;p+=12){const g=p*Math.PI/180;f.push([i+u*Math.cos(g),a+u*Math.sin(g)])}return{element:n,points:f,shapeType:"circle"}}case"ellipse":{const i=parseFloat(n.getAttribute("cx")??"0"),a=parseFloat(n.getAttribute("cy")??"0"),u=parseFloat(n.getAttribute("rx")??"0"),f=parseFloat(n.getAttribute("ry")??"0");if(!u&&!f)continue;const p=[];for(let g=0;g<=360;g+=12){const S=Math.tan(g/360*Math.PI),m=u*(1-S**2)/(1+S**2),x=f*2*S/(1+S**2);p.push([i+m,a+x])}return{element:n,points:p,shapeType:"ellipse"}}case"line":{const i=parseFloat(n.getAttribute("x0")??"0"),a=parseFloat(n.getAttribute("y0")??"0"),u=parseFloat(n.getAttribute("x1")??"0"),f=parseFloat(n.getAttribute("y1")??"0");if(i===u&&a===f)continue;return{element:n,points:[[i,a],[u,f]],shapeType:"polyline"}}case"polygon":case"polyline":{const i=((e=n.getAttribute("points"))==null?void 0:e.split(" ").map(u=>u.split(",").map(parseFloat)))??[];if(!i.length)continue;let a="polyline";return n.tagName.toLowerCase()==="polygon"&&(i.push(i[0]),a="polygon"),{element:n,points:i,shapeType:a}}case"rect":{const i=parseFloat(n.getAttribute("x")??"0"),a=parseFloat(n.getAttribute("y")??"0"),u=parseFloat(n.getAttribute("width")??"0"),f=parseFloat(n.getAttribute("height")??"0");if(!u||!f)continue;return{element:n,points:[[i,a],[i+u,a],[i+u,a+f],[i,a+f],[i,a]],shapeType:"rect"}}default:continue}return null}function dP(t){const e=[];for(let n=0;n<t.length;n++){const i=e[e.length-1]??[0,0],a=t[n];switch(a[0]){case"M":case"L":e.push([a[1],a[2]]);continue;case"C":e.push(...oP({x:i[0],y:i[1]},{x:a[1],y:a[2]},{x:a[3],y:a[4]},{x:a[5],y:a[6]}).map(u=>[u.x,u.y]).slice(1));continue;case"Q":e.push(...aP({x:i[0],y:i[1]},{x:a[1],y:a[2]},{x:a[3],y:a[4]}).map(u=>[u.x,u.y]).slice(1));continue}}return e}function hP(t){const e={};if(t.hasAttribute("fill")?(e.fill=t.getAttribute("fill"),t.removeAttribute("fill")):t.style.fill&&(e.fill=t.style.fill),e.fill){const i=_b.exec(e.fill);i&&(e.fillOpacity=parseFloat(i[4]),e.fill=`rgb(${i[1]}, ${i[2]}, ${i[3]})`)}if(t.hasAttribute("fill-opacity")?(e.fillOpacity=parseFloat(t.getAttribute("fill-opacity")),t.removeAttribute("fill-opacity")):t.style.fillOpacity&&(e.fillOpacity=parseFloat(t.style.fillOpacity)),t.hasAttribute("stroke")?(e.stroke=t.getAttribute("stroke"),t.removeAttribute("stroke")):t.style.stroke&&(e.stroke=t.style.stroke),e.stroke){const i=_b.exec(e.stroke);i&&(e.strokeOpacity=parseFloat(i[4]),e.stroke=`rgb(${i[1]}, ${i[2]}, ${i[3]})`)}t.hasAttribute("stroke-opacity")?(e.strokeOpacity=parseFloat(t.getAttribute("stroke-opacity")),t.removeAttribute("stroke-opacity")):t.style.strokeOpacity&&(e.strokeOpacity=parseFloat(t.style.strokeOpacity)),t.hasAttribute("stroke-width")?(e.strokeWidth=t.getAttribute("stroke-width"),t.removeAttribute("stroke-width")):t.style.strokeWidth&&(e.strokeWidth=t.style.strokeWidth),t.hasAttribute("stroke-dasharray")?(e.strokeDasharray=t.getAttribute("stroke-dasharray"),t.removeAttribute("stroke-dasharray")):t.style.strokeDasharray&&(e.strokeDasharray=t.style.strokeDasharray);let n=t;for(;n.tagName.toLowerCase()!=="svg";)if(n=n.parentElement,n===null)throw new Error("Could not find root SVG element");return{svg:n.outerHTML,style:Object.keys(e).length>0?e:void 0}}function pP(t){return!!t&&t.type==="iiif:ImageApiSelector"&&t.type==="iiif:ImageApiSelector"}function _r(t){if(t.iiifRenderingHints){const e=t.iiifRenderingHints;if(e.rotation){const n=vP(e.rotation);if(n)if(t.selectors.length)for(const i of t.selectors)i.rotation=n;else t.selectors.push({type:"RotationSelector",rotation:n})}}else delete t.iiifRenderingHints;return t}function vP(t){let e=parseFloat(t);return e&&t.startsWith("!")&&(e=360-e),e&&(e=e%360),e!==e?0:e||0}function _c(t,e={}){if(Array.isArray(t))return _c(t[0]);if(typeof t=="string"){const[n,i]=t.split("#");return i?_c({type:"SpecificResource",source:{id:n,type:"Unknown"},selector:{type:"FragmentSelector",value:i}}):{type:"SpecificResource",source:{id:n,type:e.typeMap&&e.typeMap[n]||"Unknown"},selector:null,selectors:[]}}if(t.type==="Choice"||t.type==="List"||t.type==="Composite"||t.type==="Independents")return _c(t.items[0]);if(t.type==="SpecificResource"){t.source.type==="Canvas"&&t.source.partOf&&typeof t.source.partOf=="string"&&(t.source.partOf=[{id:t.source.partOf,type:"Manifest"}]);const{selector:n,selectors:i}=t.selector?Vd(t.selector,e):{selector:null,selectors:[]};return{type:"SpecificResource",source:t.source,selector:n,selectors:i}}if(t.id){t.type==="Canvas"&&t.partOf&&typeof t.partOf=="string"&&(t.partOf=[{id:t.partOf,type:"Manifest"}]);const[n,i]=t.id.split("#");return i?_c({type:"SpecificResource",source:{...t,id:n},selector:{type:"FragmentSelector",value:i}}):{type:"SpecificResource",source:{...t,id:n},selector:null,selectors:[]}}return{type:"SpecificResource",source:t,selector:null,selectors:[]}}var mP=Object.defineProperty,gP=(t,e,n)=>e in t?mP(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Pb=(t,e,n)=>(gP(t,typeof e!="symbol"?e+"":e,n),n);function yP(t){return Array.isArray(t)?t:t?[t]:[]}const Db=["sc:Collection","sc:Manifest","sc:Canvas","sc:AnnotationList","oa:Annotation","sc:Range","sc:Layer","sc:Sequence","oa:Choice","Service","ContentResource"];function SP(t){if(typeof t>"u"||t===null)throw new Error("Null or undefined is not a valid entity.");if(Array.isArray(t))throw new Error("Array is not a valid entity");if(typeof t!="object")throw new Error(`${typeof t} is not a valid entity`);if(typeof t["@type"]=="string"){const e=Db.indexOf(t["@type"]);if(e!==-1)return Db[e]}if(t.profile)return"Service";if(t.format||t["@type"])return"ContentResource";throw new Error("Resource type is not known")}class im{constructor(e,n={}){Pb(this,"traversals"),Pb(this,"options"),this.traversals={collection:[],manifest:[],canvas:[],annotationList:[],sequence:[],annotation:[],contentResource:[],choice:[],range:[],service:[],layer:[],...e},this.options={convertPropsToArray:!0,mergeMemberProperties:!0,allowUndefinedReturn:!1,...n}}static all(e){return new im({collection:[e],manifest:[e],canvas:[e],annotationList:[e],sequence:[e],annotation:[e],contentResource:[e],choice:[e],range:[e],service:[e],layer:[e]})}traverseCollection(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCollectionItems(e))),this.traversals.collection)}traverseCollectionItems(e){if(this.options.mergeMemberProperties){const n=[...(e.manifests||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Manifest"}:i),...(e.collections||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Collection"}:i),...e.members||[]];delete e.collections,delete e.manifests,e.members=n}return e.manifests&&(e.manifests=e.manifests.map(n=>this.traverseManifest(typeof n=="string"?{"@id":n,"@type":"sc:Manifest"}:n))),e.collections&&(e.collections=e.collections.map(n=>this.traverseCollection(typeof n=="string"?{"@id":n,"@type":"sc:Collection"}:n))),e.members&&(e.members=e.members.map(n=>typeof n=="string"?n:this.traverseUnknown(n))),e}traverseManifest(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseManifestItems(e))),this.traversals.manifest)}traverseManifestItems(e){return e.sequences&&(e.sequences=e.sequences.map(n=>this.traverseSequence(n))),e.structures&&(e.structures=e.structures.map(n=>this.traverseRange(n))),e}traverseSequence(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseSequenceItems(e))),this.traversals.sequence)}traverseSequenceItems(e){return e.canvases&&(e.canvases=e.canvases.map(n=>this.traverseCanvas(n))),e}traverseCanvas(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCanvasItems(e))),this.traversals.canvas)}traverseCanvasItems(e){return e.images&&(e.images=e.images.map(n=>this.traverseAnnotation(n))),e.otherContent&&(e.otherContent=e.otherContent.map(n=>this.traverseAnnotationList(n))),e}traverseRange(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseRangeItems(e))),this.traversals.range)}traverseRangeItems(e){if(this.options.mergeMemberProperties){const n=[...(e.ranges||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Range"}:i),...(e.canvases||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Canvas"}:i),...e.members||[]];delete e.ranges,delete e.canvases,e.members=n.length?n.map(i=>this.traverseUnknown(i)):void 0}return e}traverseAnnotationList(e){const n=typeof e=="string"?{"@id":e,"@type":"sc:AnnotationList"}:e;return this.traverseType(this.traverseDescriptive(this.traverseAnnotationListItems(n)),this.traversals.annotationList)}traverseAnnotationListItems(e){return e.resources&&(e.resources=e.resources.map(n=>this.traverseAnnotation(n))),e}traverseAnnotation(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseAnnotationItems(e))),this.traversals.annotation)}traverseAnnotationItems(e){return e.resource&&(Array.isArray(e.resource)?e.resource=e.resource.map(n=>this.traverseContentResource(n)):e.resource=this.traverseContentResource(e.resource)),e.on,e}traverseLayer(e){return this.traverseType(this.traverseLinking(this.traverseLayerItems(e)),this.traversals.layer)}traverseLayerItems(e){return e.otherContent&&(e.otherContent=e.otherContent.map(n=>this.traverseAnnotationList(n))),e}traverseChoice(e){return this.traverseType(this.traverseChoiceItems(e),this.traversals.choice)}traverseChoiceItems(e){return e.default&&e.default!=="rdf:nil"&&(e.default=this.traverseContentResource(e.default)),e.item&&e.item!=="rdf:nil"&&(e.item=e.item.map(n=>this.traverseContentResource(n))),e}traverseService(e){return this.traverseType(this.traverseLinking(e),this.traversals.service)}traverseContentResource(e){return e["@type"]==="oa:Choice"?this.traverseChoice(e):this.traverseType(this.traverseDescriptive(this.traverseLinking(e)),this.traversals.contentResource)}traverseUnknown(e){if(!e["@type"]||typeof e=="string")return e;switch(SP(e)){case"sc:Collection":return this.traverseCollection(e);case"sc:Manifest":return this.traverseManifest(e);case"sc:Canvas":return this.traverseCanvas(e);case"sc:Sequence":return this.traverseSequence(e);case"sc:Range":return this.traverseRange(e);case"oa:Annotation":return this.traverseAnnotation(e);case"sc:AnnotationList":return this.traverseAnnotationList(e);case"sc:Layer":return this.traverseLayer(e);case"Service":return this.traverseService(e);case"oa:Choice":return this.traverseChoice(e);case"ContentResource":return this.traverseContentResource(e)}return e.profile?this.traverseService(e):e}traverseImageResource(e){const n=Array.isArray(e),i=Array.isArray(e)?e:[e],a=[];for(const u of i)typeof u=="string"?a.push(this.traverseContentResource({"@id":u,"@type":"dctypes:Image"})):a.push(this.traverseContentResource(u));return!n&&!this.options.convertPropsToArray?a[0]:a}traverseDescriptive(e){return e.thumbnail&&(e.thumbnail=this.traverseImageResource(e.thumbnail)),e.logo&&(e.logo=this.traverseImageResource(e.logo)),e}traverseOneOrMoreServices(e){const n=Array.isArray(e),i=Array.isArray(e)?e:[e],a=[];for(const u of i)a.push(this.traverseService(u));return!n&&!this.options.convertPropsToArray?a[0]:a}traverseLinking(e){return e.related&&(e.related=this.traverseOneOrManyType(e.related,this.traversals.contentResource)),e.rendering&&(e.rendering=this.traverseOneOrManyType(e.rendering,this.traversals.contentResource)),e.service&&(e.service=this.traverseOneOrMoreServices(e.service)),e.seeAlso&&(e.seeAlso=this.traverseOneOrManyType(e.seeAlso,this.traversals.contentResource)),e.within&&(typeof e.within=="string"||(e.within=this.traverseOneOrManyType(e.within,this.traversals.contentResource))),e.startCanvas&&(typeof e.startCanvas=="string"?e.startCanvas=this.traverseType({"@id":e.startCanvas,"@type":"sc:Canvas"},this.traversals.canvas):e.startCanvas&&this.traverseType(e.startCanvas,this.traversals.canvas)),e.contentLayer&&(typeof e.contentLayer=="string"?e.contentLayer=this.traverseLayer({"@id":e.contentLayer,"@type":"sc:Layer"}):e.contentLayer=this.traverseLayer(e.contentLayer)),e}traverseOneOrManyType(e,n){if(!Array.isArray(e))if(this.options.convertPropsToArray)e=[e];else return this.traverseType(e,n);return e.map(i=>this.traverseType(i,n))}traverseType(e,n){return n.reduce((i,a)=>{const u=a(i);return typeof u>"u"&&!this.options.allowUndefinedReturn?i:u},e)}}const bP="http://library.stanford.edu/iiif/image-api/compliance.html#level0",kb="http://library.stanford.edu/iiif/image-api/compliance.html#level1",Ib="http://library.stanford.edu/iiif/image-api/compliance.html#level2",EP="http://library.stanford.edu/iiif/image-api/conformance.html#level0",Nb="http://library.stanford.edu/iiif/image-api/conformance.html#level1",zb="http://library.stanford.edu/iiif/image-api/conformance.html#level2",xP="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",Ub="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",jb="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",wP="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",Fb="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",Bb="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",CP="http://iiif.io/api/image/1/level0.json",TP="http://iiif.io/api/image/1/profiles/level0.json",Hb="http://iiif.io/api/image/1/level1.json",Vb="http://iiif.io/api/image/1/profiles/level1.json",$b="http://iiif.io/api/image/1/level2.json",Wb="http://iiif.io/api/image/1/profiles/level2.json",RP="http://iiif.io/api/image/2/level0.json",AP="http://iiif.io/api/image/2/profiles/level0.json",qb="http://iiif.io/api/image/2/level1.json",Yb="http://iiif.io/api/image/2/profiles/level1.json",Qb="http://iiif.io/api/image/2/level2.json",Gb="http://iiif.io/api/image/2/profiles/level2.json",MP="level0",Xb="level1",Kb="level2",OP="http://iiif.io/api/image/2/level0",Zb="http://iiif.io/api/image/2/level1",Jb="http://iiif.io/api/image/2/level2",_P=[Zb,Jb,kb,Ib,Nb,zb,Ub,jb,Fb,Bb,Hb,Vb,$b,Wb,qb,Yb,Qb,Gb,Xb,Kb],LP=[OP,Zb,Jb,bP,kb,Ib,EP,Nb,zb,xP,Ub,jb,wP,Fb,Bb,CP,TP,Hb,Vb,$b,Wb,RP,AP,qb,Yb,Qb,Gb,MP,Xb,Kb];function Ls(t){for(const e in t)(typeof t[e]>"u"||t[e]===null)&&delete t[e];return t}const rm={attributionLabel:"Attribution",lang:"none",providerId:"http://example.org/provider",providerName:"Unknown"};function ho(t,e="none"){if(!t)return{};const n=Array.isArray(t)?t:[t],i={};for(const a of n){if(typeof a=="string"){i[e]=i[e]?i[e]:[],i[e].push(a||"");continue}if(!a["@language"]){i[e]=i[e]?i[e]:[],i[e].push(a["@value"]||"");continue}const u=a["@language"];i[u]=i[u]?i[u]:[],i[u].push(a["@value"]||"")}return i}function eE(t){if(Array.isArray(t))return eE(t.find(e=>typeof e=="string"));if(LP.indexOf(t)!==-1)return"level2";if(_P.indexOf(t)!==-1)return"level1";if(typeof t=="string")return t}function PP(t){const e=Array.isArray(t)?t:[t];for(const n of e)switch(n){case"http://iiif.io/api/image/2/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2":return"ImageService2";case"http://iiif.io/api/image/1/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/context.json":return"ImageService1";case"http://iiif.io/api/annex/openannotation/context.json":return"ImageApiSelector"}}function DP(t){switch(t){case"http://iiif.io/api/image/2/level0.json":case"http://iiif.io/api/image/2/level1.json":case"http://iiif.io/api/image/2/level2.json":return"ImageService2";case"http://iiif.io/api/auth/1/kiosk":case"http://iiif.io/api/auth/1/login":case"http://iiif.io/api/auth/1/clickthrough":case"http://iiif.io/api/auth/1/external":case"http://iiif.io/api/auth/0/kiosk":case"http://iiif.io/api/auth/0/login":case"http://iiif.io/api/auth/0/clickthrough":case"http://iiif.io/api/auth/0/external":return"AuthCookieService1";case"http://iiif.io/api/auth/1/token":case"http://iiif.io/api/auth/0/token":return"AuthTokenService1";case"http://iiif.io/api/auth/1/logout":case"http://iiif.io/api/auth/0/logout":return"AuthLogoutService1";case"http://iiif.io/api/search/1/search":case"http://iiif.io/api/search/0/search":return"SearchService1";case"http://iiif.io/api/search/1/autocomplete":case"http://iiif.io/api/search/0/autocomplete":return"AutoCompleteService1"}}function tE(t){for(const e of["sc","oa","dcterms","dctypes","iiif"])if(t.startsWith(`${e}:`))return t.slice(e.length+1);return t}const kP=["Collection","Manifest","Annotation","AnnotationPage","Range","Service"];function sm(t){const e=t["@id"]||t.id;let n=t["@type"]||t.type;const i=t.profile||void 0,a=t["@context"]||void 0;if(i){const u=DP(i);if(u)return u}if(a){const u=PP(a);if(u)return u}if(n){if(Array.isArray(n)){if(n.indexOf("oa:CssStylesheet")!==-1)return"CssStylesheet";if(n.indexOf("cnt:ContentAsText")!==-1)return"TextualBody";n=n[0]}for(const u of["sc","oa","dcterms","dctypes","iiif"])if(n.startsWith(`${u}:`)){n=n.slice(u.length+1);break}switch(n){case"Layer":return"AnnotationCollection";case"AnnotationList":return"AnnotationPage";case"cnt:ContentAsText":return"TextualBody"}}if(n&&kP.indexOf(n)!==-1)return n;if(t.format){if(t.format.startsWith("image/"))return"Image";if(t.format.startsWith("text/")||t.format==="application/pdf")return"Text";if(t.format.startsWith("application/"))return"Dataset"}return e&&(e.endsWith(".jpg")||e.endsWith(".png")||e.endsWith(".jpeg"))?"Image":n||"unknown"}const IP=/http(s)?:\/\/(creativecommons.org|rightsstatements.org)[^"'\\<\n]+/gm;function NP(t){const e=t.match(IP);return e?e[0]:t}function zP(t,e="Rights/License",n="none"){let i=null;const a=[],u=Array.isArray(t)?t:[t];for(const f of u){const p=f?NP(f):void 0;if(p&&(p.indexOf("creativecommons.org")!==-1||p.indexOf("rightsstatements.org")!==-1)){p.startsWith("https://")?i=`http://${p.slice(8)}`:i=p;continue}p&&a.push({label:{[n]:[e]},value:{[n]:[p]}})}return[i,a]}const UP=["http://iiif.io/api/presentation/2/context.json","http://iiif.io/api/image/2/context.json","http://iiif.io/api/image/1/context.json","http://library.stanford.edu/iiif/image-api/1.1/context.json","http://iiif.io/api/search/1/context.json","http://iiif.io/api/search/0/context.json","http://iiif.io/api/auth/1/context.json","http://iiif.io/api/auth/0/context.json","http://iiif.io/api/annex/openannotation/context.json"];function jP(t){if(t){const e=Array.isArray(t)?t:[t],n=[];for(const i of e)i==="http://iiif.io/api/presentation/2/context.json"&&n.push("http://iiif.io/api/presentation/3/context.json"),UP.indexOf(i)===-1&&n.push(i);if(e.length)return n.length===1?n[0]:n}}function FP(t){return t?t.map(e=>({label:ho(e.label),value:ho(e.value)})):[]}let nE=0;function iE(t,e){const n=encodeURI(t.id||t["@id"]||"").trim();return n&&e?`${n}/${e}`:n||(nE++,`http://example.org/${t["@type"]}${e?`/${e}`:""}/${nE}`)}function Ps(t){const e=[...t.behavior||[]];t.viewingHint&&e.push(t.viewingHint);let n;return Array.isArray(t.motivation)?n=t.motivation.map(tE):t.motivation&&(n=tE(t.motivation)),{"@context":t["@context"]?jP(t["@context"]):void 0,id:(t["@id"]||iE(t)).trim(),type:sm(t),behavior:e.length?e:void 0,height:t.height?t.height:void 0,width:t.width?t.width:void 0,motivation:n,viewingDirection:t.viewingDirection,profile:t.profile,format:t.format?t.format:void 0,duration:void 0,timeMode:void 0}}function Ds(t){const[e,n]=zP(t.license),i=[...t.metadata?FP(t.metadata):[],...n];return{rights:e,metadata:i.length?i:void 0,label:t.label?ho(t.label):void 0,requiredStatement:t.attribution?{label:ho(rm.attributionLabel),value:ho(t.attribution)}:void 0,navDate:t.navDate,summary:t.description?ho(t.description):void 0,thumbnail:BP(t.thumbnail)}}function BP(t){return t&&(Array.isArray(t)?t:[t]).map(e=>typeof e=="string"?{id:e,type:"Image"}:(e.type==="unknown"&&(e.type="Image"),e))}function HP(t){if(!t.within)return;const e=Array.isArray(t.within)?t.within:[t.within],n=[];for(const i of e)if(typeof i=="string"){if(i)switch(t["@type"]){case"sc:Manifest":n.push({id:i,type:"Collection"});break}}else i["@id"]&&n.push({id:i["@id"],type:sm(i)});return n.length?n:void 0}function ba(t){const e=t.related?Array.isArray(t.related)?t.related:[t.related]:[],n=t.contentLayer;return{provider:t.logo||e.length?[{id:rm.providerId,type:"Agent",homepage:e.length?[e[0]]:void 0,logo:t.logo?Array.isArray(t.logo)?t.logo:[t.logo]:void 0,label:ho(rm.providerName)}]:void 0,partOf:HP(t),rendering:t.rendering,seeAlso:t.seeAlso,start:t.startCanvas,service:t.service?yP(t.service):void 0,supplementary:n?[n]:void 0}}function VP(t){return{chars:t.chars,format:t.format?t.format:void 0,language:t.language}}function $P(t){return Ls({...Ps(t),...Ds(t),...ba(t),items:t.members})}function WP(t){const e=[],n=[];let i;for(const u of t.sequences||[])u.canvases.length&&e.push(...u.canvases),u.behavior&&n.push(...u.behavior),u.startCanvas&&(i=u.startCanvas);const a=Ps(t);return n.length&&(a.behavior?a.behavior.push(...n):a.behavior=n),Ls({...a,...Ds(t),...ba(t),start:i,items:e,structures:t.structures})}function qP(t){return Ls({...Ps(t),...Ds(t),...ba(t),annotations:t.otherContent&&t.otherContent.length?t.otherContent:void 0,items:t.images&&t.images.length?[{id:iE(t,"annotation-page"),type:"AnnotationPage",items:t.images}]:void 0})}function YP(t){return Ls({...Ps(t),...Ds(t),...ba(t),items:t.resources&&t.resources.length?t.resources:void 0})}function QP(t){return!t.canvases||t.canvases.length===0?{canvases:[],behavior:[]}:{canvases:t.canvases,behavior:t.viewingHint?[t.viewingHint]:[],startCanvas:t.startCanvas}}function GP(t){function e(n){if(Array.isArray(n)){if(n.length>1)return{type:"List",items:n.map(e)};n=n[0]}if(typeof n=="string")return encodeURI(n).trim();if("@type"in n){let i;if(typeof n.full=="string")i=n.full;else if(n.full["@type"]==="dctypes:Image")i={id:n.full["@id"],type:"Image"};else if(n.full["@type"]==="sc:Canvas")i={id:n.full["@id"],type:"Canvas"};else throw new Error(`Unsupported source type on annotation: ${n.full["@type"]}`);return{type:"SpecificResource",source:i,selector:om(n.selector)}}else return encodeURI(n["@id"]).trim()}return Ls({...Ps(t),...Ds(t),...ba(t),target:e(t.on),body:Array.isArray(t.resource)?t.resource.map(am):am(t.resource)})}function am(t){const e=t;return Ls({...Ps(e),...Ds(e),...ba(e),...VP(e)})}function XP(t){const e=[];return t.default&&t.default!=="rdf:nil"&&e.push(t.default),t.item&&t.item!=="rdf:nil"&&e.push(...t.item),{...Ps(t),...Ds(t),items:e}}function KP(t){return Ls({...Ps(t),...Ds(t),...ba(t),items:t.members})}function ZP(t){const{"@id":e,"@type":n,"@context":i,profile:a,...u}=t,f={};return e&&(f["@id"]=e),f["@type"]=sm(t),f["@type"]==="unknown"&&(i&&i.length&&(f["@context"]=i),f["@type"]="Service"),a&&(f.profile=eE(a)),Ls({...f,...u})}function JP(t){return Ls({...Ps(t),...Ds(t),...ba(t)})}new im({collection:[$P],manifest:[WP],canvas:[qP],annotationList:[YP],sequence:[QP],annotation:[GP],contentResource:[am],choice:[XP],range:[KP],service:[ZP],layer:[JP]});function om(t){if((Array.isArray(t["@type"])&&t["@type"].includes("oa:SvgSelector")||t["@type"]=="oa:SvgSelector")&&("chars"in t||"value"in t))return{type:"SvgSelector",value:"chars"in t?t.chars:t.value};if(t["@type"]==="oa:FragmentSelector")return{type:"FragmentSelector",value:t.value};if(t["@type"]==="oa:Choice")return[om(t.default),...(Array.isArray(t.item)?t.item:[t.item]).map(om)];if(t["@type"]=="iiif:ImageApiSelector")return{type:"ImageApiSelector",region:"region"in t?t.region:void 0,rotation:"rotation"in t?t.rotation:void 0};throw new Error(`Unsupported selector type: ${t["@type"]}`)}var rE={exports:{}};(function(t,e){var n=Object.defineProperty,i=(u,f,p)=>f in u?n(u,f,{enumerable:!0,configurable:!0,writable:!0,value:p}):u[f]=p,a=(u,f,p)=>(i(u,typeof f!="symbol"?f+"":f,p),p);(function(u,f){f(e)})(GL,function(u){const f="http://library.stanford.edu/iiif/image-api/compliance.html#level1",p="http://library.stanford.edu/iiif/image-api/compliance.html#level2",g="http://library.stanford.edu/iiif/image-api/conformance.html#level1",S="http://library.stanford.edu/iiif/image-api/conformance.html#level2",m="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",x="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",R="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",_="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",M="http://iiif.io/api/image/1/level1.json",k="http://iiif.io/api/image/1/profiles/level1.json",L="http://iiif.io/api/image/1/level2.json",P="http://iiif.io/api/image/1/profiles/level2.json",O="http://iiif.io/api/image/2/level1.json",j="http://iiif.io/api/image/2/profiles/level1.json",q="http://iiif.io/api/image/2/level2.json",ee="http://iiif.io/api/image/2/profiles/level2.json",H="level1",Z="level2",ie="http://iiif.io/api/image/2/level1",W="http://iiif.io/api/image/2/level2",re=[ie,W,f,p,g,S,m,x,R,_,M,k,L,P,O,j,q,ee,H,Z],ge=["http://iiif.io/api/image/2/level0",ie,W,"http://library.stanford.edu/iiif/image-api/compliance.html#level0",f,p,"http://library.stanford.edu/iiif/image-api/conformance.html#level0",g,S,"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",m,x,"http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",R,_,"http://iiif.io/api/image/1/level0.json","http://iiif.io/api/image/1/profiles/level0.json",M,k,L,P,"http://iiif.io/api/image/2/level0.json","http://iiif.io/api/image/2/profiles/level0.json",O,j,q,ee,"level0",H,Z],be=["sc:Collection","sc:Manifest","sc:Canvas","sc:AnnotationList","oa:Annotation","sc:Range","sc:Layer","sc:Sequence","oa:Choice","Service","ContentResource"];class Ee{constructor(I,G={}){a(this,"traversals"),a(this,"options"),this.traversals={collection:[],manifest:[],canvas:[],annotationList:[],sequence:[],annotation:[],contentResource:[],choice:[],range:[],service:[],layer:[],...I},this.options={convertPropsToArray:!0,mergeMemberProperties:!0,allowUndefinedReturn:!1,...G}}static all(I){return new Ee({collection:[I],manifest:[I],canvas:[I],annotationList:[I],sequence:[I],annotation:[I],contentResource:[I],choice:[I],range:[I],service:[I],layer:[I]})}traverseCollection(I){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCollectionItems(I))),this.traversals.collection)}traverseCollectionItems(I){if(this.options.mergeMemberProperties){const G=[...(I.manifests||[]).map(Se=>typeof Se=="string"?{"@id":Se,"@type":"sc:Manifest"}:Se),...(I.collections||[]).map(Se=>typeof Se=="string"?{"@id":Se,"@type":"sc:Collection"}:Se),...I.members||[]];delete I.collections,delete I.manifests,I.members=G}return I.manifests&&(I.manifests=I.manifests.map(G=>this.traverseManifest(typeof G=="string"?{"@id":G,"@type":"sc:Manifest"}:G))),I.collections&&(I.collections=I.collections.map(G=>this.traverseCollection(typeof G=="string"?{"@id":G,"@type":"sc:Collection"}:G))),I.members&&(I.members=I.members.map(G=>typeof G=="string"?G:this.traverseUnknown(G))),I}traverseManifest(I){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseManifestItems(I))),this.traversals.manifest)}traverseManifestItems(I){return I.sequences&&(I.sequences=I.sequences.map(G=>this.traverseSequence(G))),I.structures&&(I.structures=I.structures.map(G=>this.traverseRange(G))),I}traverseSequence(I){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseSequenceItems(I))),this.traversals.sequence)}traverseSequenceItems(I){return I.canvases&&(I.canvases=I.canvases.map(G=>this.traverseCanvas(G))),I}traverseCanvas(I){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCanvasItems(I))),this.traversals.canvas)}traverseCanvasItems(I){return I.images&&(I.images=I.images.map(G=>this.traverseAnnotation(G))),I.otherContent&&(I.otherContent=I.otherContent.map(G=>this.traverseAnnotationList(G))),I}traverseRange(I){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseRangeItems(I))),this.traversals.range)}traverseRangeItems(I){if(this.options.mergeMemberProperties){const G=[...(I.ranges||[]).map(Se=>typeof Se=="string"?{"@id":Se,"@type":"sc:Range"}:Se),...(I.canvases||[]).map(Se=>typeof Se=="string"?{"@id":Se,"@type":"sc:Canvas"}:Se),...I.members||[]];delete I.ranges,delete I.canvases,I.members=G.length?G.map(Se=>this.traverseUnknown(Se)):void 0}return I}traverseAnnotationList(I){const G=typeof I=="string"?{"@id":I,"@type":"sc:AnnotationList"}:I;return this.traverseType(this.traverseDescriptive(this.traverseAnnotationListItems(G)),this.traversals.annotationList)}traverseAnnotationListItems(I){return I.resources&&(I.resources=I.resources.map(G=>this.traverseAnnotation(G))),I}traverseAnnotation(I){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseAnnotationItems(I))),this.traversals.annotation)}traverseAnnotationItems(I){return I.resource&&(Array.isArray(I.resource)?I.resource=I.resource.map(G=>this.traverseContentResource(G)):I.resource=this.traverseContentResource(I.resource)),I.on,I}traverseLayer(I){return this.traverseType(this.traverseLinking(this.traverseLayerItems(I)),this.traversals.layer)}traverseLayerItems(I){return I.otherContent&&(I.otherContent=I.otherContent.map(G=>this.traverseAnnotationList(G))),I}traverseChoice(I){return this.traverseType(this.traverseChoiceItems(I),this.traversals.choice)}traverseChoiceItems(I){return I.default&&I.default!=="rdf:nil"&&(I.default=this.traverseContentResource(I.default)),I.item&&I.item!=="rdf:nil"&&(I.item=I.item.map(G=>this.traverseContentResource(G))),I}traverseService(I){return this.traverseType(this.traverseLinking(I),this.traversals.service)}traverseContentResource(I){return I["@type"]==="oa:Choice"?this.traverseChoice(I):this.traverseType(this.traverseDescriptive(this.traverseLinking(I)),this.traversals.contentResource)}traverseUnknown(I){if(!I["@type"]||typeof I=="string")return I;switch(function(G){if(G==null)throw new Error("Null or undefined is not a valid entity.");if(Array.isArray(G))throw new Error("Array is not a valid entity");if(typeof G!="object")throw new Error(typeof G+" is not a valid entity");if(typeof G["@type"]=="string"){const Se=be.indexOf(G["@type"]);if(Se!==-1)return be[Se]}if(G.profile)return"Service";if(G.format||G["@type"])return"ContentResource";throw new Error("Resource type is not known")}(I)){case"sc:Collection":return this.traverseCollection(I);case"sc:Manifest":return this.traverseManifest(I);case"sc:Canvas":return this.traverseCanvas(I);case"sc:Sequence":return this.traverseSequence(I);case"sc:Range":return this.traverseRange(I);case"oa:Annotation":return this.traverseAnnotation(I);case"sc:AnnotationList":return this.traverseAnnotationList(I);case"sc:Layer":return this.traverseLayer(I);case"Service":return this.traverseService(I);case"oa:Choice":return this.traverseChoice(I);case"ContentResource":return this.traverseContentResource(I)}return I.profile?this.traverseService(I):I}traverseImageResource(I){const G=Array.isArray(I),Se=Array.isArray(I)?I:[I],ut=[];for(const We of Se)typeof We=="string"?ut.push(this.traverseContentResource({"@id":We,"@type":"dctypes:Image"})):ut.push(this.traverseContentResource(We));return G||this.options.convertPropsToArray?ut:ut[0]}traverseDescriptive(I){return I.thumbnail&&(I.thumbnail=this.traverseImageResource(I.thumbnail)),I.logo&&(I.logo=this.traverseImageResource(I.logo)),I}traverseOneOrMoreServices(I){const G=Array.isArray(I),Se=Array.isArray(I)?I:[I],ut=[];for(const We of Se)ut.push(this.traverseService(We));return G||this.options.convertPropsToArray?ut:ut[0]}traverseLinking(I){return I.related&&(I.related=this.traverseOneOrManyType(I.related,this.traversals.contentResource)),I.rendering&&(I.rendering=this.traverseOneOrManyType(I.rendering,this.traversals.contentResource)),I.service&&(I.service=this.traverseOneOrMoreServices(I.service)),I.seeAlso&&(I.seeAlso=this.traverseOneOrManyType(I.seeAlso,this.traversals.contentResource)),I.within&&(typeof I.within=="string"||(I.within=this.traverseOneOrManyType(I.within,this.traversals.contentResource))),I.startCanvas&&(typeof I.startCanvas=="string"?I.startCanvas=this.traverseType({"@id":I.startCanvas,"@type":"sc:Canvas"},this.traversals.canvas):I.startCanvas&&this.traverseType(I.startCanvas,this.traversals.canvas)),I.contentLayer&&(typeof I.contentLayer=="string"?I.contentLayer=this.traverseLayer({"@id":I.contentLayer,"@type":"sc:Layer"}):I.contentLayer=this.traverseLayer(I.contentLayer)),I}traverseOneOrManyType(I,G){if(!Array.isArray(I)){if(!this.options.convertPropsToArray)return this.traverseType(I,G);I=[I]}return I.map(Se=>this.traverseType(Se,G))}traverseType(I,G){return G.reduce((Se,ut)=>{const We=ut(Se);return We!==void 0||this.options.allowUndefinedReturn?We:Se},I)}}function Ue(U){for(const I in U)U[I]!==void 0&&U[I]!==null||delete U[I];return U}const je="Attribution",Xe="http://example.org/provider",ce="Unknown";function me(U,I="none"){if(!U)return{};const G=Array.isArray(U)?U:[U],Se={};for(const ut of G){if(typeof ut=="string"){Se[I]=Se[I]?Se[I]:[],Se[I].push(ut||"");continue}if(!ut["@language"]){Se[I]=Se[I]?Se[I]:[],Se[I].push(ut["@value"]||"");continue}const We=ut["@language"];Se[We]=Se[We]?Se[We]:[],Se[We].push(ut["@value"]||"")}return Se}function tt(U){return Array.isArray(U)?tt(U.find(I=>typeof I=="string")):ge.indexOf(U)!==-1?"level2":re.indexOf(U)!==-1?"level1":typeof U=="string"?U:void 0}function mt(U){for(const I of["sc","oa","dcterms","dctypes","iiif"])if(U.startsWith(`${I}:`))return U.slice(I.length+1);return U}const he=["Collection","Manifest","Annotation","AnnotationPage","Range","Service"];function Fe(U){const I=U["@id"]||U.id;let G=U["@type"]||U.type;const Se=U.profile||void 0,ut=U["@context"]||void 0;if(Se){const We=function(Sn){switch(Sn){case"http://iiif.io/api/image/2/level0.json":case"http://iiif.io/api/image/2/level1.json":case"http://iiif.io/api/image/2/level2.json":return"ImageService2";case"http://iiif.io/api/auth/1/kiosk":case"http://iiif.io/api/auth/1/login":case"http://iiif.io/api/auth/1/clickthrough":case"http://iiif.io/api/auth/1/external":case"http://iiif.io/api/auth/0/kiosk":case"http://iiif.io/api/auth/0/login":case"http://iiif.io/api/auth/0/clickthrough":case"http://iiif.io/api/auth/0/external":return"AuthCookieService1";case"http://iiif.io/api/auth/1/token":case"http://iiif.io/api/auth/0/token":return"AuthTokenService1";case"http://iiif.io/api/auth/1/logout":case"http://iiif.io/api/auth/0/logout":return"AuthLogoutService1";case"http://iiif.io/api/search/1/search":case"http://iiif.io/api/search/0/search":return"SearchService1";case"http://iiif.io/api/search/1/autocomplete":case"http://iiif.io/api/search/0/autocomplete":return"AutoCompleteService1"}}(Se);if(We)return We}if(ut){const We=function(Sn){const ji=Array.isArray(Sn)?Sn:[Sn];for(const xe of ji)switch(xe){case"http://iiif.io/api/image/2/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2":return"ImageService2";case"http://iiif.io/api/image/1/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/context.json":return"ImageService1";case"http://iiif.io/api/annex/openannotation/context.json":return"ImageApiSelector"}}(ut);if(We)return We}if(G){if(Array.isArray(G)){if(G.indexOf("oa:CssStylesheet")!==-1)return"CssStylesheet";if(G.indexOf("cnt:ContentAsText")!==-1)return"TextualBody";G=G[0]}for(const We of["sc","oa","dcterms","dctypes","iiif"])if(G.startsWith(`${We}:`)){G=G.slice(We.length+1);break}switch(G){case"Layer":return"AnnotationCollection";case"AnnotationList":return"AnnotationPage";case"cnt:ContentAsText":return"TextualBody"}}if(G&&he.indexOf(G)!==-1)return G;if(U.format){if(U.format.startsWith("image/"))return"Image";if(U.format.startsWith("text/")||U.format==="application/pdf")return"Text";if(U.format.startsWith("application/"))return"Dataset"}return I&&(I.endsWith(".jpg")||I.endsWith(".png")||I.endsWith(".jpeg"))?"Image":G||"unknown"}const $e=/http(s)?:\/\/(creativecommons.org|rightsstatements.org)[^"'\\<\n]+/gm;function ht(U){const I=U.match($e);return I?I[0]:U}const gt=["http://iiif.io/api/presentation/2/context.json","http://iiif.io/api/image/2/context.json","http://iiif.io/api/image/1/context.json","http://library.stanford.edu/iiif/image-api/1.1/context.json","http://iiif.io/api/search/1/context.json","http://iiif.io/api/search/0/context.json","http://iiif.io/api/auth/1/context.json","http://iiif.io/api/auth/0/context.json","http://iiif.io/api/annex/openannotation/context.json"];function gn(U){if(U){const I=Array.isArray(U)?U:[U],G=[];for(const Se of I)Se==="http://iiif.io/api/presentation/2/context.json"&&G.push("http://iiif.io/api/presentation/3/context.json"),gt.indexOf(Se)===-1&&G.push(Se);if(I.length)return G.length===1?G[0]:G}}let Xt=0;function yt(U,I){const G=encodeURI(U.id||U["@id"]||"").trim();return G&&I?`${G}/${I}`:G||(Xt++,`http://example.org/${U["@type"]}${I?`/${I}`:""}/${Xt}`)}function Be(U){const I=[...U.behavior||[]];let G;return U.viewingHint&&I.push(U.viewingHint),Array.isArray(U.motivation)?G=U.motivation.map(mt):U.motivation&&(G=mt(U.motivation)),{"@context":U["@context"]?gn(U["@context"]):void 0,id:(U["@id"]||yt(U)).trim(),type:Fe(U),behavior:I.length?I:void 0,height:U.height?U.height:void 0,width:U.width?U.width:void 0,motivation:G,viewingDirection:U.viewingDirection,profile:U.profile,format:U.format?U.format:void 0,duration:void 0,timeMode:void 0}}function nt(U){const[I,G]=function(We,Sn="Rights/License",ji="none"){let xe=null;const ct=[],pi=Array.isArray(We)?We:[We];for(const Pt of pi){const it=Pt?ht(Pt):void 0;!it||it.indexOf("creativecommons.org")===-1&&it.indexOf("rightsstatements.org")===-1?it&&ct.push({label:{[ji]:[Sn]},value:{[ji]:[it]}}):xe=it.startsWith("https://")?`http://${it.slice(8)}`:it}return[xe,ct]}(U.license),Se=[...U.metadata?(ut=U.metadata,ut?ut.map(We=>({label:me(We.label),value:me(We.value)})):[]):[],...G];var ut;return{rights:I,metadata:Se.length?Se:void 0,label:U.label?me(U.label):void 0,requiredStatement:U.attribution?{label:me(je),value:me(U.attribution)}:void 0,navDate:U.navDate,summary:U.description?me(U.description):void 0,thumbnail:ot(U.thumbnail)}}function ot(U){return U&&(Array.isArray(U)?U:[U]).map(I=>typeof I=="string"?{id:I,type:"Image"}:(I.type==="unknown"&&(I.type="Image"),I))}function lt(U){if(!U.within)return;const I=Array.isArray(U.within)?U.within:[U.within],G=[];for(const Se of I)typeof Se=="string"?Se&&U["@type"]==="sc:Manifest"&&G.push({id:Se,type:"Collection"}):Se["@id"]&&G.push({id:Se["@id"],type:Fe(Se)});return G.length?G:void 0}function Et(U){const I=U.related?Array.isArray(U.related)?U.related:[U.related]:[],G=U.contentLayer;return{provider:U.logo||I.length?[{id:Xe,type:"Agent",homepage:I.length?[I[0]]:void 0,logo:U.logo?Array.isArray(U.logo)?U.logo:[U.logo]:void 0,label:me(ce)}]:void 0,partOf:lt(U),rendering:U.rendering,seeAlso:U.seeAlso,start:U.startCanvas,service:U.service?(Se=U.service,Array.isArray(Se)?Se:Se?[Se]:[]):void 0,supplementary:G?[G]:void 0};var Se}function wt(U){const I=U;return Ue({...Be(I),...nt(I),...Et(I),...(G=I,{chars:G.chars,format:G.format?G.format:void 0,language:G.language})});var G}const yn=new Ee({collection:[function(U){return Ue({...Be(U),...nt(U),...Et(U),items:U.members})}],manifest:[function(U){const I=[],G=[];let Se;for(const We of U.sequences||[])We.canvases.length&&I.push(...We.canvases),We.behavior&&G.push(...We.behavior),We.startCanvas&&(Se=We.startCanvas);const ut=Be(U);return G.length&&(ut.behavior?ut.behavior.push(...G):ut.behavior=G),Ue({...ut,...nt(U),...Et(U),start:Se,items:I,structures:U.structures})}],canvas:[function(U){return Ue({...Be(U),...nt(U),...Et(U),annotations:U.otherContent&&U.otherContent.length?U.otherContent:void 0,items:U.images&&U.images.length?[{id:yt(U,"annotation-page"),type:"AnnotationPage",items:U.images}]:void 0})}],annotationList:[function(U){return Ue({...Be(U),...nt(U),...Et(U),items:U.resources&&U.resources.length?U.resources:void 0})}],sequence:[function(U){return U.canvases&&U.canvases.length!==0?{canvases:U.canvases,behavior:U.viewingHint?[U.viewingHint]:[],startCanvas:U.startCanvas}:{canvases:[],behavior:[]}}],annotation:[function(U){return Ue({...Be(U),...nt(U),...Et(U),target:function I(G){if(Array.isArray(G)){if(G.length>1)return{type:"List",items:G.map(I)};G=G[0]}if(typeof G=="string")return encodeURI(G).trim();if("@type"in G){let Se;if(typeof G.full=="string")Se=G.full;else if(G.full["@type"]==="dctypes:Image")Se={id:G.full["@id"],type:"Image"};else{if(G.full["@type"]!=="sc:Canvas")throw new Error(`Unsupported source type on annotation: ${G.full["@type"]}`);Se={id:G.full["@id"],type:"Canvas"}}return{type:"SpecificResource",source:Se,selector:Kt(G.selector)}}return encodeURI(G["@id"]).trim()}(U.on),body:Array.isArray(U.resource)?U.resource.map(wt):wt(U.resource)})}],contentResource:[wt],choice:[function(U){const I=[];return U.default&&U.default!=="rdf:nil"&&I.push(U.default),U.item&&U.item!=="rdf:nil"&&I.push(...U.item),{...Be(U),...nt(U),items:I}}],range:[function(U){return Ue({...Be(U),...nt(U),...Et(U),items:U.members})}],service:[function(U){const{"@id":I,"@type":G,"@context":Se,profile:ut,...We}=U,Sn={};return I&&(Sn["@id"]=I),Sn["@type"]=Fe(U),Sn["@type"]==="unknown"&&(Se&&Se.length&&(Sn["@context"]=Se),Sn["@type"]="Service"),ut&&(Sn.profile=tt(ut)),Ue({...Sn,...We})}],layer:[function(U){return Ue({...Be(U),...nt(U),...Et(U)})}]});function Kt(U){if((Array.isArray(U["@type"])&&U["@type"].includes("oa:SvgSelector")||U["@type"]=="oa:SvgSelector")&&("chars"in U||"value"in U))return{type:"SvgSelector",value:"chars"in U?U.chars:U.value};if(U["@type"]==="oa:FragmentSelector")return{type:"FragmentSelector",value:U.value};if(U["@type"]==="oa:Choice")return[Kt(U.default),...(Array.isArray(U.item)?U.item:[U.item]).map(Kt)];if(U["@type"]=="iiif:ImageApiSelector")return{type:"ImageApiSelector",region:"region"in U?U.region:void 0,rotation:"rotation"in U?U.rotation:void 0};throw new Error(`Unsupported selector type: ${U["@type"]}`)}const tr=function(U){return U&&U["@context"]&&(U["@context"]==="http://iiif.io/api/presentation/2/context.json"||U["@context"].indexOf("http://iiif.io/api/presentation/2/context.json")!==-1||U["@context"]==="http://www.shared-canvas.org/ns/context.json")||U["@context"]==="http://iiif.io/api/image/2/context.json"?yn.traverseUnknown(U):U};u.upgrade=tr,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})})})(rE,rE.exports);function eD(t){return t.type==="SpecificResource"?[t.source,{selector:t.selector}]:[t,{selector:null}]}function lm(t,e){const{selector:n,source:i}=_c(e);if(i.id!==t.id)return[null,i];const a={type:"BoxSelector",spatial:{x:0,y:0,width:Number(t.width),height:Number(t.height)}};return[n?n.type==="TemporalSelector"?{type:"TemporalBoxSelector",temporal:n.temporal,spatial:a.spatial}:n:null,i]}const sE={makeChoice:()=>{}},$d={type:"unknown"},Pn=t=>({type:"unknown",reason:t,annotations:{pages:[]}}),aE=(t,e)=>({type:"empty",width:t,height:e,annotations:{pages:[]},image:null,images:[]});function tD(t,e){var i;const n=(i=t==null?void 0:t.iiif)==null?void 0:i.meta[e];return n?n.annotationPageManager:null}function nD(t,e){return ni(n=>{const i=[];if(!t)return i;const a=Object.keys(n.iiif.entities.AnnotationPage);for(const u of a)if(!e||e.indexOf(u)!==-1){const f=tD(n,u);f&&f.views&&f.views[t]&&i.push(u)}return i},[t,e])}function oE({canvas:t,manifest:e,all:n,canvases:i}){const a=[];if(e)for(const u of e.annotations)a.indexOf(u.id)===-1&&a.push(u.id);if(n){if(i&&i.length)for(const u of i)for(const f of u.annotations)a.indexOf(f.id)===-1&&a.push(f.id)}else if(t)for(const u of t.annotations)a.indexOf(u.id)===-1&&a.push(u.id);return a}function iD(t,e){var i;const n=(i=t==null?void 0:t.iiif)==null?void 0:i.meta[e];return n?n.annotationPageManager:null}function lE(t,e={}){const n=Un(),i=ya(),a=Jr(),u=Hv(),f=T.useMemo(()=>oE({all:e.all,manifest:i,canvas:a,canvases:u}),[e.all,a,u,i]),p=nD(t,e.all?void 0:f),g=T.useCallback(m=>{t&&n.setMetaValue([m,"annotationPageManager","views"],x=>x&&!x[t]?x:{...x||{},[t]:!1})},[t,n]),S=T.useCallback((m,x={})=>{if(!t)return;const R=n.getState(),_=[];if(x!=null&&x.deselectOthers){const M=Object.keys(R.iiif.entities.AnnotationPage);for(const k of M){const L=iD(R,k);L&&L.views&&L.views[t]&&_.push(k)}}for(const M of _)g(M);n.setMetaValue([m,"annotationPageManager","views"],M=>M&&M[t]?M:{...M||{},[t]:!0})},[t,g,n]);return{availablePageIds:f,enabledPageIds:p,setPageEnabled:S,setPageDisabled:g}}function uE(t,e){return ni((n,i)=>i.get(t.map(a=>({id:a,type:e}))),[t,e])}const cE=T.createContext(new Ka.ImageServiceLoader);function Wd(){return T.useContext(cE)}function fE(){const t=Wd(),[e,n]=T.useState({}),i=T.useRef(!1);return T.useEffect(()=>()=>{i.current=!0},[]),[T.useCallback((u,{height:f,width:p})=>{if(u){const g=u.id||u["@id"],S=t.loadServiceSync({id:g,width:u.width||p,height:u.height||f,source:u});S?u=S:e[g]||(i.current||n(m=>({...m,[g]:"loading"})),t.loadService({id:g,width:u.width||p,height:u.height||f}).then(()=>{i.current||n(m=>({...m,[g]:"done"}))}))}return u},[t,e]),e]}function qd(t={}){const e=Zv(),n=Jr(t.canvasId?{id:t.canvasId}:void 0);return ni((i,a)=>{if(!n)return[];if(e&&t.enableSingleAnnotation)return[e];const u=a.get(n.items),f=[];for(const p of u)f.push(...a.get(p.items));return f},[n])}function rD(t){return t.type==="SpecificResource"?[t.source,{selector:t.selector}]:[t,{selector:null}]}const Yd={},dE={get(t){return t},setMetaValue([t,e,n],i){const a=dE.getResourceMeta(t,e),u=a?a[n]:void 0,f=typeof i=="function"?i(u):i;Yd[t]={...Yd[t]||{},[e]:{...(Yd[t]||{})[e]||{},[n]:f}}},getResourceMeta:(t,e)=>{const n=Yd[t];if(n)return e?n[e]:n}};function sD(t=dE){function e(a){const u=a?typeof a=="string"?t.get(a):a:null;if(!u)return[];const f=t.get(u.items,{parent:u}),p=[];for(const g of f)p.push(...t.get(g.items,{parent:g}));return p}function n(a,u=[]){const f=Array.isArray(a)?a:e(a),p=[];let g=null;const S=[];for(const m of f){if(m.type!=="Annotation")throw new Error("getPaintables() accept either a canvas or list of annotations");const x=Array.from(Array.isArray(m.body)?m.body:[m.body]);for(const R of x){const[_,{selector:M}]=rD(R),k=t.get(_),L=(k.type||"unknown").toLowerCase();if(L==="choice"){const P=t.get(k.items,{parent:k.id}),O=u.length?u.map(j=>P.find(q=>q.id===j)).filter(Boolean):[P[0]];O.length===0&&O.push(P[0]),g={type:"single-choice",items:P.map(j=>({id:j.id,label:j.label,selected:O.indexOf(j)!==-1})),label:_.label},x.push(...O);continue}p.indexOf(L)===-1&&p.push(L),S.push({type:L,annotationId:m.id,resource:k,target:m.target,selector:M})}}return{types:p,items:S,choice:g}}function i(a){const{choice:u}=n(a);return u}return{getAllPaintingAnnotations:e,getPaintables:n,extractChoices:i}}function hE(t,e=[]){const n=Un(),i=T.useMemo(()=>sD(n),[]),a=qd({enableSingleAnnotation:t==null?void 0:t.enableSingleAnnotation}),[u,f]=T.useState((t==null?void 0:t.defaultChoices)||[]),p=T.useMemo(()=>i.getPaintables(a,u),[n,a,u,...e]),S={makeChoice:T.useCallback((m,{deselectOthers:x=!0,deselect:R=!1}={})=>{if(p.choice){if(p.choice.type!=="single-choice")throw new Error("Complex choice not supported yet");f(_=>{if(R){const k=_.filter(L=>L!==m);if(k.length===0){const L=p.items[0].resource.id;return L?[L]:[]}return k}if(x)return[m];const M=[..._];if(M.length===0&&p.items.length){const k=p.items[0].resource.id;k&&M.push(k)}return _.indexOf(m)!==-1?_:[..._,m]})}},[p.choice])};return[p,S]}const aD=["model/gltf-binary"];function pE(t,e){const i=e.items[0].resource;return i.format?aD.indexOf(i.format)===-1?Pn(`3D format: ${i.format} is unsupported`):{type:"3d-model",model:i}:Pn("Unknown format")}function oD(t,e){var i;if(!t.duration)return Pn("No duration on canvas");if(e.items.length>1)return Pn("Only one audio source supported");const n=(i=e.items[0])==null?void 0:i.resource;return n?n.format?{type:"media",media:{annotationId:e.items[0].annotationId,duration:t.duration,url:n.id,type:"Sound",target:{type:"TemporalSelector",temporal:{startTime:0,endTime:t.duration}},format:n.format,selector:{type:"TemporalSelector",temporal:{startTime:0,endTime:t.duration}}},annotations:{pages:[]}}:Pn("Audio does not have format"):Pn("Unknown audio")}function vE(t,e,n){const i=[];for(const a of e.items){const u=a.resource&&a.resource.type==="SpecificResource"?a.resource.source:a.resource;if(!u.id)return Pn("No resource Identifier");let f;if(u.service){const _=Ka.getImageServices(u);_[0]&&(f=n(_[0],t))}const p={type:"BoxSelector",spatial:{x:0,y:0,width:Number(t.width),height:Number(t.height)}},[g,S]=lm(t,a.target);if(S.id!==t.id)continue;a.resource.width&&a.resource.height&&(a.resource.width,a.resource.height);let m=a.resource.type==="SpecificResource"?Sa(a.resource):null;if(a.selector){const _=Sa({type:"SpecificResource",source:a.resource,selector:a.selector});_&&(m=_)}const x=m&&m.selector&&(m.selector.type==="BoxSelector"||m.selector.type==="TemporalBoxSelector")?{type:"BoxSelector",spatial:{x:m.selector.spatial.x,y:m.selector.spatial.y,width:m.selector.spatial.width,height:m.selector.spatial.height}}:void 0;f&&!f.id&&(f.id=f["@id"]);const R={id:u.id,type:"Image",annotationId:a.annotationId,width:Number(g||x?u.width:t.width),height:Number(g||x?u.height:t.height),service:f,sizes:f&&f.sizes?f.sizes:u.width&&u.height?[{width:u.width,height:u.height}]:[],target:g&&g.type!=="PointSelector"?g:p,selector:x};i.push(R)}return{type:"images",image:i[0],images:i,choice:e.choice}}function mE(t,e={},n){const i=t.language||n||"none";switch(t.type){case"TextualBody":{typeof t.value<"u"&&(e[i]=t.value);break}case"List":case"Composite":case"Choice":t.items&&t.items.forEach(a=>mE(a,e,i))}return e}function gE(t,e){const n=[];return e.items.forEach(i=>{if(i.resource){const[a]=lm(t,i.target);n.push({annotationId:i.annotationId,text:mE(i.resource),target:a})}}),{type:"textual-content",items:n}}const lD=/^.*(?:(?:youtu\.be\/|v\/|vi\/|u\/\w\/|embed\/|shorts\/)|(?:(?:watch)?\?vi?=|&vi?=))([^#&?]*).*/;function yE(t,e){var f;const n=e.items.filter(p=>p.type==="video");if(!t.duration)return Pn("No duration on canvas");if(n.length>1)return Pn("Only one video source supported");const i=(f=n[0])==null?void 0:f.resource,a=!!(i.service||[]).find(p=>(p.profile||"").includes("youtube.com"));if(!i)return Pn("Unknown video");if((!i.format||i.format==="text/html")&&!a)return Pn("Video does not have format");const u={annotationId:e.items[0].annotationId,duration:t.duration,url:i.id,type:"Video",items:[],target:{type:"TemporalSelector",temporal:{startTime:0,endTime:t.duration}},format:i.format,selector:{type:"TemporalSelector",temporal:{startTime:0,endTime:t.duration}}};if(a){u.type="VideoYouTube";const p=i.id.match(lD);if(!p[1])return Pn("Video is not known youtube video");u.youTubeId=p[1]}return{type:"media",media:u,annotations:{pages:[]}}}function SE({canvas:t,paintables:e,supports:n,loadImageService:i}){if(!t)return console.log("No canvas"),$d;if(e.types.length===0)return n.indexOf("empty")!==-1?aE(t.width,t.height):(console.log("No paintables"),$d);if(e.types.length!==1)if(e.types.length===2&&e.types.indexOf("text")!==-1)e.types=e.types.filter(u=>u!=="text");else return n.indexOf("complex-timeline")===-1?Pn("Complex timeline not supported"):Pn("ComplexTimelineStrategy not yet supported");const a=e.types[0];return a==="image"?n.indexOf("images")===-1?Pn("Image not supported"):vE(t,e,i):a==="Model"||a==="model"?n.indexOf("3d-model")===-1?Pn("3D not supported"):pE(t,e):a==="textualbody"?n.indexOf("textual-content")===-1?Pn("Textual content not supported"):gE(t,e):a==="sound"||a==="audio"?n.indexOf("media")===-1?Pn("Media not supported"):oD(t,e):a==="video"?n.indexOf("media")===-1?Pn("Media not supported"):yE(t,e):$d}function bE(t){const e=ya(),n=Jr(),i=Un(),[a,u]=fE(),{enabledPageIds:f}=lE((t==null?void 0:t.annotationPageManagerId)||(e==null?void 0:e.id)||(n==null?void 0:n.id),{all:!1}),p=uE(f,"AnnotationPage"),g=(t==null?void 0:t.strategies)||["empty","images","media","textual-content","complex-timeline"],[S,m]=hE(t,[u]),x=T.useMemo(()=>SE({canvas:n,paintables:S,supports:g,loadImageService:a}),[n,S,i,m.makeChoice]);return T.useMemo(()=>x.type==="unknown"?[x,sE]:[{...x,annotations:{pages:p}},m],[x,p])}const EE=(t,e=[])=>{const n=Un();T.useEffect(()=>{t(n)},[n,...e])},Qd={},xE={get(t){return t},setMetaValue([t,e,n],i){const a=xE.getResourceMeta(t,e),u=a?a[n]:void 0,f=typeof i=="function"?i(u):i;Qd[t]={...Qd[t]||{},[e]:{...(Qd[t]||{})[e]||{},[n]:f}}},getResourceMeta:(t,e)=>{const n=Qd[t];if(n)return e?n[e]:n}},uD=new Ka.ImageServiceLoader;function cD(t=xE,e={}){const n=e.imageServiceLoader||uD;async function i(a,u,f=!1,p=[],g){const S=()=>n.getThumbnailFromResource(void 0,u,f,p);if(!a)return await n.getThumbnailFromResource(void 0,u,f,p);if(typeof a=="string"){const x=Ka.getFixedSizeFromImage(a);return x&&p.push(x),await n.getThumbnailFromResource(void 0,u,f,p)}const m=t.get(a,{skipSelfReturn:!1});if(typeof m=="string")return{best:Ka.getFixedSizeFromImage(m),fallback:[],log:[]};if(!m)return await S();switch(await(async x=>{if(x&&x.thumbnail&&x.thumbnail.length){const R=t.get(x.thumbnail[0]),_=await n.getImageCandidates(R,f);_&&_.length&&p.push(..._)}})(m),m.type){case"Annotation":{const x=Array.isArray(m.body)?m.body:[m.body],R=t.get(x[0]);return g&&!R.width&&(R.width=g.width,R.height=g.height),await n.getThumbnailFromResource(R,u,f,p)}case"Canvas":{const x=m;return i(x.items[0],u,f,p,{width:x.width,height:x.height})}case"AnnotationPage":return i(m.items[0],u,f,p,g);case"Choice":{const x=m;return!x.items||x.items[0]?await S():i(x.items[0],u,f,p,g)}case"Collection":{const x=m.items[0];return x?i(x,u,f,p,g):await S()}case"Manifest":{const x=m.items[0];return x?i(x,u,f,p,g):await S()}case"SpecificResource":case"Image":case"Dataset":case"Sound":case"Text":case"TextualBody":case"Video":return g&&!m.width&&(m.width=g.width,m.height=g.height),n.getThumbnailFromResource(m,u,f,p)}return await S()}return{getBestThumbnailAtSize:i}}function wE(t,e,{canvasId:n,manifestId:i}={}){const a=Un(),u=Wd(),f=T.useMemo(()=>cD(a,{imageServiceLoader:u}),[a,u]),[p,g]=T.useState(),S=ya(i?{id:i}:void 0),m=Jr(n?{id:n}:void 0),x=m||S,R=T.useRef(!1);if(T.useEffect(()=>(R.current=!1,()=>{R.current=!0}),[]),!x)throw new Error("Must be called under a manifest or canvas context.");return EE(_=>{f.getBestThumbnailAtSize(x,t,e).then(M=>{M.best&&!R.current&&g(M.best)})},[x]),p}function fD(t){return{isMuted:!1,playRequested:!1,isPlaying:!1,isFinished:!1,volume:100,duration:t}}function dD(t,e){switch(e.type){case"FINISHED":return{...t,isFinished:!0,isPlaying:!1,playRequested:!1};case"PLAY_PAUSE":return{...t,isFinished:!1,isPlaying:!t.isPlaying};case"PLAY_REQUESTED":return{...t,isFinished:!1,playRequested:!0};case"PAUSE":return{...t,isPlaying:!1};case"PLAY":return{...t,isFinished:!1,playRequested:!1,isPlaying:!0};case"MUTE":return{...t,isMuted:!0};case"SET_VOLUME":return{...t,volume:e.volume,isMuted:e.volume===0};case"TOGGLE_MUTE":return{...t,isMuted:!t.isMuted};case"UNMUTE":return{...t,isMuted:!1}}return t}function CE(t){const e=Math.round(t);return`${Math.floor(e/60)}:${`${e%60}`.padStart(2,"0")}`}function Gd(t){const[e,n]=T.useReducer(dD,fD(t.duration)),i=T.useRef(null),a=T.useRef(null),u=T.useRef(null),f=T.useRef(!1),p=T.useCallback(()=>{a.current&&i.current&&(a.current.innerHTML=CE(i.current.currentTime),u.current&&(u.current.style.width=`${i.current.currentTime/t.duration*100}%`),f.current!==i.current.muted&&(f.current=i.current.muted,n(i.current.muted?{type:"MUTE"}:{type:"UNMUTE"})))},[t.duration]),g=T.useCallback(()=>{i.current&&(n({type:"PLAY_REQUESTED"}),i.current.play().then(()=>{n({type:"PLAY"})}),p())},[p]),S=T.useCallback(()=>{i.current&&(i.current.duration>0&&i.current.paused?g():m())},[p]),m=T.useCallback(()=>{i.current&&(i.current.pause(),n({type:"PAUSE"}),p())},[p]),x=T.useCallback(()=>{i.current&&(i.current.muted=!i.current.muted,n(i.current.muted?{type:"MUTE"}:{type:"UNMUTE"}))},[]),R=T.useCallback(()=>{i.current&&(i.current.muted=!0,n({type:"MUTE"}))},[]),_=T.useCallback(()=>{i.current&&(i.current.muted=!1,n({type:"UNMUTE"}))},[]),M=T.useCallback(P=>{i.current&&(i.current.muted=!1,i.current.volume=P/100,n({type:"SET_VOLUME",volume:P}))},[]),k=T.useCallback(P=>{i.current&&(i.current.currentTime=Math.max(0,Math.min(P*t.duration,t.duration)),p())},[]),L=T.useCallback(P=>{i.current&&(i.current.currentTime=Math.max(0,Math.min(P,t.duration)),p())},[]);return T.useEffect(()=>{const P=setInterval(()=>{p()},350);return()=>clearInterval(P)},[p,t.duration]),T.useEffect(()=>{const P=()=>{n({type:"FINISHED"})},O=i.current;return O==null||O.addEventListener("ended",P),()=>O==null?void 0:O.removeEventListener("ended",P)},[]),[{element:i,currentTime:a,progress:u},e,{play:g,pause:m,playPause:S,mute:R,unmute:_,toggleMute:x,setVolume:M,setDurationPercent:k,setTime:L}]}const TE=T.createContext(null),RE=T.createContext(null),AE=T.createContext(null);function hD(){const t=T.useContext(TE);if(!t)throw new Error("Ctx not found");return t}function pD(){const t=T.useContext(RE);if(!t)throw new Error("Ctx not found");return t}function vD(){const t=T.useContext(AE);if(!t)throw new Error("Ctx not found");return t}function um({actions:t,state:e,children:n,currentTime:i,progress:a,element:u}){return oe.jsx(AE.Provider,{value:{currentTime:i,progress:a,element:u},children:oe.jsx(RE.Provider,{value:t,children:oe.jsx(TE.Provider,{value:e,children:n})})})}function ME({media:t,children:e}){const[{element:n,currentTime:i,progress:a},u,f]=Gd({duration:t.duration});return oe.jsxs(um,{state:u,actions:f,currentTime:i,progress:a,element:n,children:[oe.jsx("audio",{ref:n,src:t.url}),e]})}function OE({media:t,mediaControlsDeps:e,children:n}){return Fl("portal","audio",ME,{media:t,children:n},[t,...e||[]]),null}function _E({element:t,media:e,playPause:n}){return oe.jsxs("div",{className:"video-container",part:"video-container",onClick:n,children:[oe.jsx("style",{children:`
|
|
344
|
+
*/function UA(t,e,n,r=1){return new p1(t,e,n).subdivide(r)}function jA(t,e,n,r,o=1){return new Kp(new Float64Array([t.x,t.y,e.x,e.y,n.x,n.y,r.x,r.y])).subdivide(o)}function IA(t){return t.x*t.x+t.y*t.y}function Xu(t){return t/(1-.67+Math.pow(Math.pow(.67,4)+.25*t*t,.25))}function hl(t){return t*(1-.39+Math.sqrt(.39*.39+.25*t*t))}class p1{constructor(e,n,r){ud(this,"start"),ud(this,"control"),ud(this,"end"),this.start=e,this.control=n,this.end=r}eval(e){const n=1-e;return{x:this.start.x*n*n+2*this.control.x*n*e+this.end.x*e*e,y:this.start.y*n*n+2*this.control.y*n*e+this.end.y*e*e}}mapToBasic(){const{x:e,y:n}=this.start,{x:r,y:o}=this.control,{x:c,y:h}=this.end,v=2*r-e-c,g=2*o-n-h,x=(r-e)*v+(o-n)*g,m=(c-r)*v+(h-o)*g,w=(c-e)*g-(h-n)*v,A=x/w,P=m/w,M=Math.abs(w)/(Math.hypot(v,g)*Math.abs(P-A));return{x0:e,x2:c,scale:M,cross:w}}subdivide(e){const n=this.mapToBasic(),r=Xu(n.x0),o=Xu(n.x2),c=.5*Math.abs(o-r)*Math.sqrt(n.scale/e),h=Math.ceil(c),v=hl(r),g=hl(o),x=[0];for(let m=1;m<h;m++){const w=(hl(r+(o-r)*m/h)-v)/(g-v);x.push(w)}return x.push(1),x.map(m=>this.eval(m))}}class Kp{constructor(e){ud(this,"c"),this.c=e}weightsum(e,n,r,o){const c=e*this.c[0]+n*this.c[2]+r*this.c[4]+o*this.c[6],h=e*this.c[1]+n*this.c[3]+r*this.c[5]+o*this.c[7];return{x:c,y:h}}eval(e){const n=1-e,r=n*n*n,o=3*n*n*e,c=3*n*e*e,h=e*e*e;return this.weightsum(r,o,c,h)}deriv(e){const n=1-e,r=-3*n*n,o=3*e*e,c=-6*e*n-r,h=6*e*n-o;return this.weightsum(r,c,h,o)}midpoint_quadbez(){const e=this.weightsum(-.25,.75,.75,-.25);return new p1({x:this.c[0],y:this.c[1]},e,{x:this.c[6],y:this.c[7]})}subsegment(e,n){const r=new Float64Array(8),o=this.eval(e),c=this.eval(n);r[0]=o.x,r[1]=o.y;const h=(n-e)/3,v=this.deriv(e);r[2]=o.x+h*v.x,r[3]=o.y+h*v.y;const g=this.deriv(n);return r[4]=c.x-h*g.x,r[5]=c.y-h*g.y,r[6]=c.x,r[7]=c.y,new Kp(r)}subdivide(e){const n=.1*e,r=e-n,o=Math.sqrt(r),c=IA(this.weightsum(1,-3,3,-1)),h=Math.ceil(Math.pow(c/(432*n*n),1/6)),v=[];let g=0;for(let M=0;M<h;M++){const _=M/h,L=(M+1)/h,k=this.subsegment(_,L).midpoint_quadbez(),O=k.mapToBasic(),I=Xu(O.x0),q=Xu(O.x2),te=Math.sqrt(O.scale);let H=Math.abs(q-I)*te;if(Math.sign(O.x0)!=Math.sign(O.x2)){const J=o/te,re=o*Math.abs(q-I)/Xu(J);H=Math.max(H,re)}v.push({quad:k,a0:I,a2:q,val:H}),g+=H}const x=.5*g/o,m=Math.ceil(x),w=[{x:this.c[0],y:this.c[1]}];let A=0,P=0;for(let M=1;M<m;M++){const _=g*M/m;for(;A+v[P].val<_;)A+=v[P].val,P++;const L=v[P].a0,k=v[P].a2,O=hl(L),I=hl(k),q=L+(k-L)*(_-A)/v[P].val,te=(hl(q)-O)/(I-O);w.push(v[P].quad.eval(te))}return w.push({x:this.c[6],y:this.c[7]}),w}}const FA=/&?(xywh=)?(pixel:|percent:|pct:)?([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?)/,BA=/&?(t=)(npt:)?([0-9]+(.[0-9]+)?)?(,([0-9]+(.[0-9]+)?))?/,v1=/^rgba\((\d+),(\d+),(\d+),([0-9.]+)\)$/;function cd(t,{domParser:e,svgPreprocessor:n,iiifRenderingHints:r}={}){if(Array.isArray(t))return wr(t.reduce((o,c)=>{const{selector:h,selectors:v,iiifRenderingHints:g}=cd(c,{domParser:e,svgPreprocessor:n,iiifRenderingHints:r});return h&&(o.selector||(o.selector=h),o.selectors.push(...v)),g&&(o.iiifRenderingHints=o.iiifRenderingHints||{type:"ImageApiSelector"},Object.assign(o.iiifRenderingHints,g)),o},{selector:null,selectors:[],iiifRenderingHints:r}));if(!t)return wr({selector:null,selectors:[],iiifRenderingHints:r});if(typeof t=="string"){const[o,c]=t.split("#");return c?cd({type:"FragmentSelector",value:c},{svgPreprocessor:n,iiifRenderingHints:r,domParser:e}):wr({selector:null,selectors:[],iiifRenderingHints:r})}if(t.type&&t.type==="PointSelector"&&(t.t||t.t===0)){const o={type:"TemporalSelector",temporal:{startTime:t.t}};return wr({selector:o,selectors:[o],iiifRenderingHints:r})}if($A(t)){const o=[];if(t.region){const c=cd({type:"FragmentSelector",value:"xywh="+t.region},{domParser:e,svgPreprocessor:n,iiifRenderingHints:r});o.push(...c.selectors)}return wr({selector:o[0],selectors:o,iiifRenderingHints:r?{...r,...t}:t})}if(t.type==="FragmentSelector"){const o=FA.exec(t.value);if(o){const h={type:"BoxSelector",spatial:{unit:o[2]==="percent:"||o[2]==="pct:"?"percent":"pixel",x:parseFloat(o[3]),y:parseFloat(o[4]),width:parseFloat(o[5]),height:parseFloat(o[6])}};return wr({selector:h,selectors:[h],iiifRenderingHints:r})}const c=t.value.match(BA);if(c){const h={type:"TemporalSelector",temporal:{startTime:c[4]?parseFloat(c[4]):0,endTime:c[7]?parseFloat(c[7]):void 0}};return wr({selector:h,selectors:[h],iiifRenderingHints:r})}return wr({selector:null,selectors:[],iiifRenderingHints:r})}if(t.type==="SvgSelector"&&"value"in t){e||(typeof window<"u"?e=new window.DOMParser:console.warn("No DOMParser available, cannot parse SVG selector, `points`, `spatial` and `style` will be unavailable and the SVG will not be normalized."));let o=[],c,h,v=(n==null?void 0:n(t.value))??t.value,g;if(e){const m=e.parseFromString(t.value,"image/svg+xml").querySelector("svg");if(!m)return console.warn(`Illegal SVG selector: ${t.value}`),wr({selector:null,selectors:[],iiifRenderingHints:r});const w=m1(m);w&&(o=w.points,g=w.shapeType,c=[Math.min(...o.map(A=>A[0])),Math.min(...o.map(A=>A[1])),Math.max(...o.map(A=>A[0])),Math.max(...o.map(A=>A[1]))],{style:h,svg:v}=WA(w.element)??{svg:v})}const x={type:"SvgSelector",svg:v,svgShape:g,style:h,points:o.length?o:void 0,spatial:c?{unit:"pixel",x:c[0],y:c[1],width:c[2]-c[0],height:c[3]-c[1]}:void 0};return wr({selector:x,selectors:[x],iiifRenderingHints:r})}return wr({selector:null,selectors:[],iiifRenderingHints:r})}function HA(t){const e=t.map(r=>r[0]).reduce((r,o)=>(r[o]+=1,r),{C:0,Q:0,L:0,M:0}),n=new Set(t.map(r=>r[0]));if(e.C>0||e.Q>0)return"path";if(e.L>0&&(n.size===1||n.size===2&&n.has("M"))){if(e.L===4)return"rect";const r=t.slice(-1)[0];return t[0][0]==="M"&&r[0]==="L"&&r[1]==t[0][1]&&r[2]===t[0][2]||r[1]===0&&r[2]===0?"polygon":"polyline"}return"path"}function m1(t){var e;for(const n of Array.from(t.children))switch(n==null?void 0:n.tagName.toLowerCase()){case"g":{const r=m1(n);if(r)return r}continue;case"path":{const r=n.getAttribute("d");if(!r)continue;const o=_A(r);return{element:n,points:VA(o),shapeType:HA(o)}}case"circle":{const r=parseFloat(n.getAttribute("cx")??"0"),o=parseFloat(n.getAttribute("cy")??"0"),c=parseFloat(n.getAttribute("r")??"0");if(!c)continue;const h=[];for(let v=0;v<=360;v+=12){const g=v*Math.PI/180;h.push([r+c*Math.cos(g),o+c*Math.sin(g)])}return{element:n,points:h,shapeType:"circle"}}case"ellipse":{const r=parseFloat(n.getAttribute("cx")??"0"),o=parseFloat(n.getAttribute("cy")??"0"),c=parseFloat(n.getAttribute("rx")??"0"),h=parseFloat(n.getAttribute("ry")??"0");if(!c&&!h)continue;const v=[];for(let g=0;g<=360;g+=12){const x=Math.tan(g/360*Math.PI),m=c*(1-x**2)/(1+x**2),w=h*2*x/(1+x**2);v.push([r+m,o+w])}return{element:n,points:v,shapeType:"ellipse"}}case"line":{const r=parseFloat(n.getAttribute("x0")??"0"),o=parseFloat(n.getAttribute("y0")??"0"),c=parseFloat(n.getAttribute("x1")??"0"),h=parseFloat(n.getAttribute("y1")??"0");if(r===c&&o===h)continue;return{element:n,points:[[r,o],[c,h]],shapeType:"polyline"}}case"polygon":case"polyline":{const r=((e=n.getAttribute("points"))==null?void 0:e.split(" ").map(c=>c.split(",").map(parseFloat)))??[];if(!r.length)continue;let o="polyline";return n.tagName.toLowerCase()==="polygon"&&(r.push(r[0]),o="polygon"),{element:n,points:r,shapeType:o}}case"rect":{const r=parseFloat(n.getAttribute("x")??"0"),o=parseFloat(n.getAttribute("y")??"0"),c=parseFloat(n.getAttribute("width")??"0"),h=parseFloat(n.getAttribute("height")??"0");if(!c||!h)continue;return{element:n,points:[[r,o],[r+c,o],[r+c,o+h],[r,o+h],[r,o]],shapeType:"rect"}}default:continue}return null}function VA(t){const e=[];for(let n=0;n<t.length;n++){const r=e[e.length-1]??[0,0],o=t[n];switch(o[0]){case"M":case"L":e.push([o[1],o[2]]);continue;case"C":e.push(...jA({x:r[0],y:r[1]},{x:o[1],y:o[2]},{x:o[3],y:o[4]},{x:o[5],y:o[6]}).map(c=>[c.x,c.y]).slice(1));continue;case"Q":e.push(...UA({x:r[0],y:r[1]},{x:o[1],y:o[2]},{x:o[3],y:o[4]}).map(c=>[c.x,c.y]).slice(1));continue}}return e}function WA(t){const e={};if(t.hasAttribute("fill")?(e.fill=t.getAttribute("fill"),t.removeAttribute("fill")):t.style.fill&&(e.fill=t.style.fill),e.fill){const r=v1.exec(e.fill);r&&(e.fillOpacity=parseFloat(r[4]),e.fill=`rgb(${r[1]}, ${r[2]}, ${r[3]})`)}if(t.hasAttribute("fill-opacity")?(e.fillOpacity=parseFloat(t.getAttribute("fill-opacity")),t.removeAttribute("fill-opacity")):t.style.fillOpacity&&(e.fillOpacity=parseFloat(t.style.fillOpacity)),t.hasAttribute("stroke")?(e.stroke=t.getAttribute("stroke"),t.removeAttribute("stroke")):t.style.stroke&&(e.stroke=t.style.stroke),e.stroke){const r=v1.exec(e.stroke);r&&(e.strokeOpacity=parseFloat(r[4]),e.stroke=`rgb(${r[1]}, ${r[2]}, ${r[3]})`)}t.hasAttribute("stroke-opacity")?(e.strokeOpacity=parseFloat(t.getAttribute("stroke-opacity")),t.removeAttribute("stroke-opacity")):t.style.strokeOpacity&&(e.strokeOpacity=parseFloat(t.style.strokeOpacity)),t.hasAttribute("stroke-width")?(e.strokeWidth=t.getAttribute("stroke-width"),t.removeAttribute("stroke-width")):t.style.strokeWidth&&(e.strokeWidth=t.style.strokeWidth),t.hasAttribute("stroke-dasharray")?(e.strokeDasharray=t.getAttribute("stroke-dasharray"),t.removeAttribute("stroke-dasharray")):t.style.strokeDasharray&&(e.strokeDasharray=t.style.strokeDasharray);let n=t;for(;n.tagName.toLowerCase()!=="svg";)if(n=n.parentElement,n===null)throw new Error("Could not find root SVG element");return{svg:n.outerHTML,style:Object.keys(e).length>0?e:void 0}}function $A(t){return!!t&&t.type==="iiif:ImageApiSelector"&&t.type==="iiif:ImageApiSelector"}function wr(t){if(t.iiifRenderingHints){const e=t.iiifRenderingHints;if(e.rotation){const n=qA(e.rotation);if(n)if(t.selectors.length)for(const r of t.selectors)r.rotation=n;else t.selectors.push({type:"RotationSelector",rotation:n})}}else delete t.iiifRenderingHints;return t}function qA(t){let e=parseFloat(t);return e&&t.startsWith("!")&&(e=360-e),e&&(e=e%360),e!==e?0:e||0}function Ku(t,e={}){if(Array.isArray(t))return Ku(t[0]);if(typeof t=="string"){const[n,r]=t.split("#");return r?Ku({type:"SpecificResource",source:{id:n,type:"Unknown"},selector:{type:"FragmentSelector",value:r}}):{type:"SpecificResource",source:{id:n,type:e.typeMap&&e.typeMap[n]||"Unknown"},selector:null,selectors:[]}}if(t.type==="Choice"||t.type==="List"||t.type==="Composite"||t.type==="Independents")return Ku(t.items[0]);if(t.type==="SpecificResource"){t.source.type==="Canvas"&&t.source.partOf&&typeof t.source.partOf=="string"&&(t.source.partOf=[{id:t.source.partOf,type:"Manifest"}]);const{selector:n,selectors:r}=t.selector?cd(t.selector,e):{selector:null,selectors:[]};return{type:"SpecificResource",source:t.source,selector:n,selectors:r}}if(t.id){t.type==="Canvas"&&t.partOf&&typeof t.partOf=="string"&&(t.partOf=[{id:t.partOf,type:"Manifest"}]);const[n,r]=t.id.split("#");return r?Ku({type:"SpecificResource",source:{...t,id:n},selector:{type:"FragmentSelector",value:r}}):{type:"SpecificResource",source:{...t,id:n},selector:null,selectors:[]}}return{type:"SpecificResource",source:t,selector:null,selectors:[]}}var YA=Object.defineProperty,QA=(t,e,n)=>e in t?YA(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,g1=(t,e,n)=>(QA(t,typeof e!="symbol"?e+"":e,n),n);function GA(t){return Array.isArray(t)?t:t?[t]:[]}const y1=["sc:Collection","sc:Manifest","sc:Canvas","sc:AnnotationList","oa:Annotation","sc:Range","sc:Layer","sc:Sequence","oa:Choice","Service","ContentResource"];function XA(t){if(typeof t>"u"||t===null)throw new Error("Null or undefined is not a valid entity.");if(Array.isArray(t))throw new Error("Array is not a valid entity");if(typeof t!="object")throw new Error(`${typeof t} is not a valid entity`);if(typeof t["@type"]=="string"){const e=y1.indexOf(t["@type"]);if(e!==-1)return y1[e]}if(t.profile)return"Service";if(t.format||t["@type"])return"ContentResource";throw new Error("Resource type is not known")}class Zp{constructor(e,n={}){g1(this,"traversals"),g1(this,"options"),this.traversals={collection:[],manifest:[],canvas:[],annotationList:[],sequence:[],annotation:[],contentResource:[],choice:[],range:[],service:[],layer:[],...e},this.options={convertPropsToArray:!0,mergeMemberProperties:!0,allowUndefinedReturn:!1,...n}}static all(e){return new Zp({collection:[e],manifest:[e],canvas:[e],annotationList:[e],sequence:[e],annotation:[e],contentResource:[e],choice:[e],range:[e],service:[e],layer:[e]})}traverseCollection(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCollectionItems(e))),this.traversals.collection)}traverseCollectionItems(e){if(this.options.mergeMemberProperties){const n=[...(e.manifests||[]).map(r=>typeof r=="string"?{"@id":r,"@type":"sc:Manifest"}:r),...(e.collections||[]).map(r=>typeof r=="string"?{"@id":r,"@type":"sc:Collection"}:r),...e.members||[]];delete e.collections,delete e.manifests,e.members=n}return e.manifests&&(e.manifests=e.manifests.map(n=>this.traverseManifest(typeof n=="string"?{"@id":n,"@type":"sc:Manifest"}:n))),e.collections&&(e.collections=e.collections.map(n=>this.traverseCollection(typeof n=="string"?{"@id":n,"@type":"sc:Collection"}:n))),e.members&&(e.members=e.members.map(n=>typeof n=="string"?n:this.traverseUnknown(n))),e}traverseManifest(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseManifestItems(e))),this.traversals.manifest)}traverseManifestItems(e){return e.sequences&&(e.sequences=e.sequences.map(n=>this.traverseSequence(n))),e.structures&&(e.structures=e.structures.map(n=>this.traverseRange(n))),e}traverseSequence(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseSequenceItems(e))),this.traversals.sequence)}traverseSequenceItems(e){return e.canvases&&(e.canvases=e.canvases.map(n=>this.traverseCanvas(n))),e}traverseCanvas(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCanvasItems(e))),this.traversals.canvas)}traverseCanvasItems(e){return e.images&&(e.images=e.images.map(n=>this.traverseAnnotation(n))),e.otherContent&&(e.otherContent=e.otherContent.map(n=>this.traverseAnnotationList(n))),e}traverseRange(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseRangeItems(e))),this.traversals.range)}traverseRangeItems(e){if(this.options.mergeMemberProperties){const n=[...(e.ranges||[]).map(r=>typeof r=="string"?{"@id":r,"@type":"sc:Range"}:r),...(e.canvases||[]).map(r=>typeof r=="string"?{"@id":r,"@type":"sc:Canvas"}:r),...e.members||[]];delete e.ranges,delete e.canvases,e.members=n.length?n.map(r=>this.traverseUnknown(r)):void 0}return e}traverseAnnotationList(e){const n=typeof e=="string"?{"@id":e,"@type":"sc:AnnotationList"}:e;return this.traverseType(this.traverseDescriptive(this.traverseAnnotationListItems(n)),this.traversals.annotationList)}traverseAnnotationListItems(e){return e.resources&&(e.resources=e.resources.map(n=>this.traverseAnnotation(n))),e}traverseAnnotation(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseAnnotationItems(e))),this.traversals.annotation)}traverseAnnotationItems(e){return e.resource&&(Array.isArray(e.resource)?e.resource=e.resource.map(n=>this.traverseContentResource(n)):e.resource=this.traverseContentResource(e.resource)),e.on,e}traverseLayer(e){return this.traverseType(this.traverseLinking(this.traverseLayerItems(e)),this.traversals.layer)}traverseLayerItems(e){return e.otherContent&&(e.otherContent=e.otherContent.map(n=>this.traverseAnnotationList(n))),e}traverseChoice(e){return this.traverseType(this.traverseChoiceItems(e),this.traversals.choice)}traverseChoiceItems(e){return e.default&&e.default!=="rdf:nil"&&(e.default=this.traverseContentResource(e.default)),e.item&&e.item!=="rdf:nil"&&(e.item=e.item.map(n=>this.traverseContentResource(n))),e}traverseService(e){return this.traverseType(this.traverseLinking(e),this.traversals.service)}traverseContentResource(e){return e["@type"]==="oa:Choice"?this.traverseChoice(e):this.traverseType(this.traverseDescriptive(this.traverseLinking(e)),this.traversals.contentResource)}traverseUnknown(e){if(!e["@type"]||typeof e=="string")return e;switch(XA(e)){case"sc:Collection":return this.traverseCollection(e);case"sc:Manifest":return this.traverseManifest(e);case"sc:Canvas":return this.traverseCanvas(e);case"sc:Sequence":return this.traverseSequence(e);case"sc:Range":return this.traverseRange(e);case"oa:Annotation":return this.traverseAnnotation(e);case"sc:AnnotationList":return this.traverseAnnotationList(e);case"sc:Layer":return this.traverseLayer(e);case"Service":return this.traverseService(e);case"oa:Choice":return this.traverseChoice(e);case"ContentResource":return this.traverseContentResource(e)}return e.profile?this.traverseService(e):e}traverseImageResource(e){const n=Array.isArray(e),r=Array.isArray(e)?e:[e],o=[];for(const c of r)typeof c=="string"?o.push(this.traverseContentResource({"@id":c,"@type":"dctypes:Image"})):o.push(this.traverseContentResource(c));return!n&&!this.options.convertPropsToArray?o[0]:o}traverseDescriptive(e){return e.thumbnail&&(e.thumbnail=this.traverseImageResource(e.thumbnail)),e.logo&&(e.logo=this.traverseImageResource(e.logo)),e}traverseOneOrMoreServices(e){const n=Array.isArray(e),r=Array.isArray(e)?e:[e],o=[];for(const c of r)o.push(this.traverseService(c));return!n&&!this.options.convertPropsToArray?o[0]:o}traverseLinking(e){return e.related&&(e.related=this.traverseOneOrManyType(e.related,this.traversals.contentResource)),e.rendering&&(e.rendering=this.traverseOneOrManyType(e.rendering,this.traversals.contentResource)),e.service&&(e.service=this.traverseOneOrMoreServices(e.service)),e.seeAlso&&(e.seeAlso=this.traverseOneOrManyType(e.seeAlso,this.traversals.contentResource)),e.within&&(typeof e.within=="string"||(e.within=this.traverseOneOrManyType(e.within,this.traversals.contentResource))),e.startCanvas&&(typeof e.startCanvas=="string"?e.startCanvas=this.traverseType({"@id":e.startCanvas,"@type":"sc:Canvas"},this.traversals.canvas):e.startCanvas&&this.traverseType(e.startCanvas,this.traversals.canvas)),e.contentLayer&&(typeof e.contentLayer=="string"?e.contentLayer=this.traverseLayer({"@id":e.contentLayer,"@type":"sc:Layer"}):e.contentLayer=this.traverseLayer(e.contentLayer)),e}traverseOneOrManyType(e,n){if(!Array.isArray(e))if(this.options.convertPropsToArray)e=[e];else return this.traverseType(e,n);return e.map(r=>this.traverseType(r,n))}traverseType(e,n){return n.reduce((r,o)=>{const c=o(r);return typeof c>"u"&&!this.options.allowUndefinedReturn?r:c},e)}}const KA="http://library.stanford.edu/iiif/image-api/compliance.html#level0",S1="http://library.stanford.edu/iiif/image-api/compliance.html#level1",b1="http://library.stanford.edu/iiif/image-api/compliance.html#level2",ZA="http://library.stanford.edu/iiif/image-api/conformance.html#level0",x1="http://library.stanford.edu/iiif/image-api/conformance.html#level1",E1="http://library.stanford.edu/iiif/image-api/conformance.html#level2",JA="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",w1="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",T1="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",eM="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",C1="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",R1="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",tM="http://iiif.io/api/image/1/level0.json",nM="http://iiif.io/api/image/1/profiles/level0.json",A1="http://iiif.io/api/image/1/level1.json",M1="http://iiif.io/api/image/1/profiles/level1.json",O1="http://iiif.io/api/image/1/level2.json",D1="http://iiif.io/api/image/1/profiles/level2.json",iM="http://iiif.io/api/image/2/level0.json",rM="http://iiif.io/api/image/2/profiles/level0.json",L1="http://iiif.io/api/image/2/level1.json",P1="http://iiif.io/api/image/2/profiles/level1.json",k1="http://iiif.io/api/image/2/level2.json",z1="http://iiif.io/api/image/2/profiles/level2.json",sM="level0",N1="level1",_1="level2",aM="http://iiif.io/api/image/2/level0",U1="http://iiif.io/api/image/2/level1",j1="http://iiif.io/api/image/2/level2",oM=[U1,j1,S1,b1,x1,E1,w1,T1,C1,R1,A1,M1,O1,D1,L1,P1,k1,z1,N1,_1],lM=[aM,U1,j1,KA,S1,b1,ZA,x1,E1,JA,w1,T1,eM,C1,R1,tM,nM,A1,M1,O1,D1,iM,rM,L1,P1,k1,z1,sM,N1,_1];function bs(t){for(const e in t)(typeof t[e]>"u"||t[e]===null)&&delete t[e];return t}const Jp={attributionLabel:"Attribution",lang:"none",providerId:"http://example.org/provider",providerName:"Unknown"};function Ba(t,e="none"){if(!t)return{};const n=Array.isArray(t)?t:[t],r={};for(const o of n){if(typeof o=="string"){r[e]=r[e]?r[e]:[],r[e].push(o||"");continue}if(!o["@language"]){r[e]=r[e]?r[e]:[],r[e].push(o["@value"]||"");continue}const c=o["@language"];r[c]=r[c]?r[c]:[],r[c].push(o["@value"]||"")}return r}function I1(t){if(Array.isArray(t))return I1(t.find(e=>typeof e=="string"));if(lM.indexOf(t)!==-1)return"level2";if(oM.indexOf(t)!==-1)return"level1";if(typeof t=="string")return t}function uM(t){const e=Array.isArray(t)?t:[t];for(const n of e)switch(n){case"http://iiif.io/api/image/2/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2":return"ImageService2";case"http://iiif.io/api/image/1/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/context.json":return"ImageService1";case"http://iiif.io/api/annex/openannotation/context.json":return"ImageApiSelector"}}function cM(t){switch(t){case"http://iiif.io/api/image/2/level0.json":case"http://iiif.io/api/image/2/level1.json":case"http://iiif.io/api/image/2/level2.json":return"ImageService2";case"http://iiif.io/api/auth/1/kiosk":case"http://iiif.io/api/auth/1/login":case"http://iiif.io/api/auth/1/clickthrough":case"http://iiif.io/api/auth/1/external":case"http://iiif.io/api/auth/0/kiosk":case"http://iiif.io/api/auth/0/login":case"http://iiif.io/api/auth/0/clickthrough":case"http://iiif.io/api/auth/0/external":return"AuthCookieService1";case"http://iiif.io/api/auth/1/token":case"http://iiif.io/api/auth/0/token":return"AuthTokenService1";case"http://iiif.io/api/auth/1/logout":case"http://iiif.io/api/auth/0/logout":return"AuthLogoutService1";case"http://iiif.io/api/search/1/search":case"http://iiif.io/api/search/0/search":return"SearchService1";case"http://iiif.io/api/search/1/autocomplete":case"http://iiif.io/api/search/0/autocomplete":return"AutoCompleteService1"}}function F1(t){for(const e of["sc","oa","dcterms","dctypes","iiif"])if(t.startsWith(`${e}:`))return t.slice(e.length+1);return t}const fM=["Collection","Manifest","Annotation","AnnotationPage","Range","Service"];function ev(t){const e=t["@id"]||t.id;let n=t["@type"]||t.type;const r=t.profile||void 0,o=t["@context"]||void 0;if(r){const c=cM(r);if(c)return c}if(o){const c=uM(o);if(c)return c}if(n){if(Array.isArray(n)){if(n.indexOf("oa:CssStylesheet")!==-1)return"CssStylesheet";if(n.indexOf("cnt:ContentAsText")!==-1)return"TextualBody";n=n[0]}for(const c of["sc","oa","dcterms","dctypes","iiif"])if(n.startsWith(`${c}:`)){n=n.slice(c.length+1);break}switch(n){case"Layer":return"AnnotationCollection";case"AnnotationList":return"AnnotationPage";case"cnt:ContentAsText":return"TextualBody"}}if(n&&fM.indexOf(n)!==-1)return n;if(t.format){if(t.format.startsWith("image/"))return"Image";if(t.format.startsWith("text/")||t.format==="application/pdf")return"Text";if(t.format.startsWith("application/"))return"Dataset"}return e&&(e.endsWith(".jpg")||e.endsWith(".png")||e.endsWith(".jpeg"))?"Image":n||"unknown"}const dM=/http(s)?:\/\/(creativecommons.org|rightsstatements.org)[^"'\\<\n]+/gm;function hM(t){const e=t.match(dM);return e?e[0]:t}function pM(t,e="Rights/License",n="none"){let r=null;const o=[],c=Array.isArray(t)?t:[t];for(const h of c){const v=h?hM(h):void 0;if(v&&(v.indexOf("creativecommons.org")!==-1||v.indexOf("rightsstatements.org")!==-1)){v.startsWith("https://")?r=`http://${v.slice(8)}`:r=v;continue}v&&o.push({label:{[n]:[e]},value:{[n]:[v]}})}return[r,o]}const vM=["http://iiif.io/api/presentation/2/context.json","http://iiif.io/api/image/2/context.json","http://iiif.io/api/image/1/context.json","http://library.stanford.edu/iiif/image-api/1.1/context.json","http://iiif.io/api/search/1/context.json","http://iiif.io/api/search/0/context.json","http://iiif.io/api/auth/1/context.json","http://iiif.io/api/auth/0/context.json","http://iiif.io/api/annex/openannotation/context.json"];function mM(t){if(t){const e=Array.isArray(t)?t:[t],n=[];for(const r of e)r==="http://iiif.io/api/presentation/2/context.json"&&n.push("http://iiif.io/api/presentation/3/context.json"),vM.indexOf(r)===-1&&n.push(r);if(e.length)return n.length===1?n[0]:n}}function gM(t){return t?t.map(e=>({label:Ba(e.label),value:Ba(e.value)})):[]}let B1=0;function H1(t,e){const n=encodeURI(t.id||t["@id"]||"").trim();return n&&e?`${n}/${e}`:n||(B1++,`http://example.org/${t["@type"]}${e?`/${e}`:""}/${B1}`)}function xs(t){const e=[...t.behavior||[]];t.viewingHint&&e.push(t.viewingHint);let n;return Array.isArray(t.motivation)?n=t.motivation.map(F1):t.motivation&&(n=F1(t.motivation)),{"@context":t["@context"]?mM(t["@context"]):void 0,id:(t["@id"]||H1(t)).trim(),type:ev(t),behavior:e.length?e:void 0,height:t.height?t.height:void 0,width:t.width?t.width:void 0,motivation:n,viewingDirection:t.viewingDirection,profile:t.profile,format:t.format?t.format:void 0,duration:void 0,timeMode:void 0}}function Es(t){const[e,n]=pM(t.license),r=[...t.metadata?gM(t.metadata):[],...n];return{rights:e,metadata:r.length?r:void 0,label:t.label?Ba(t.label):void 0,requiredStatement:t.attribution?{label:Ba(Jp.attributionLabel),value:Ba(t.attribution)}:void 0,navDate:t.navDate,summary:t.description?Ba(t.description):void 0,thumbnail:yM(t.thumbnail)}}function yM(t){return t&&(Array.isArray(t)?t:[t]).map(e=>typeof e=="string"?{id:e,type:"Image"}:(e.type==="unknown"&&(e.type="Image"),e))}function SM(t){if(!t.within)return;const e=Array.isArray(t.within)?t.within:[t.within],n=[];for(const r of e)if(typeof r=="string"){if(r)switch(t["@type"]){case"sc:Manifest":n.push({id:r,type:"Collection"});break}}else r["@id"]&&n.push({id:r["@id"],type:ev(r)});return n.length?n:void 0}function na(t){const e=t.related?Array.isArray(t.related)?t.related:[t.related]:[],n=t.contentLayer;return{provider:t.logo||e.length?[{id:Jp.providerId,type:"Agent",homepage:e.length?[e[0]]:void 0,logo:t.logo?Array.isArray(t.logo)?t.logo:[t.logo]:void 0,label:Ba(Jp.providerName)}]:void 0,partOf:SM(t),rendering:t.rendering,seeAlso:t.seeAlso,start:t.startCanvas,service:t.service?GA(t.service):void 0,supplementary:n?[n]:void 0}}function bM(t){return{chars:t.chars,format:t.format?t.format:void 0,language:t.language}}function xM(t){return bs({...xs(t),...Es(t),...na(t),items:t.members})}function EM(t){const e=[],n=[];let r;for(const c of t.sequences||[])c.canvases.length&&e.push(...c.canvases),c.behavior&&n.push(...c.behavior),c.startCanvas&&(r=c.startCanvas);const o=xs(t);return n.length&&(o.behavior?o.behavior.push(...n):o.behavior=n),bs({...o,...Es(t),...na(t),start:r,items:e,structures:t.structures})}function wM(t){return bs({...xs(t),...Es(t),...na(t),annotations:t.otherContent&&t.otherContent.length?t.otherContent:void 0,items:t.images&&t.images.length?[{id:H1(t,"annotation-page"),type:"AnnotationPage",items:t.images}]:void 0})}function TM(t){return bs({...xs(t),...Es(t),...na(t),items:t.resources&&t.resources.length?t.resources:void 0})}function CM(t){return!t.canvases||t.canvases.length===0?{canvases:[],behavior:[]}:{canvases:t.canvases,behavior:t.viewingHint?[t.viewingHint]:[],startCanvas:t.startCanvas}}function RM(t){function e(n){if(Array.isArray(n)){if(n.length>1)return{type:"List",items:n.map(e)};n=n[0]}if(typeof n=="string")return encodeURI(n).trim();if("@type"in n){let r;if(typeof n.full=="string")r=n.full;else if(n.full["@type"]==="dctypes:Image")r={id:n.full["@id"],type:"Image"};else if(n.full["@type"]==="sc:Canvas")r={id:n.full["@id"],type:"Canvas"};else throw new Error(`Unsupported source type on annotation: ${n.full["@type"]}`);return{type:"SpecificResource",source:r,selector:nv(n.selector)}}else return encodeURI(n["@id"]).trim()}return bs({...xs(t),...Es(t),...na(t),target:e(t.on),body:Array.isArray(t.resource)?t.resource.map(tv):tv(t.resource)})}function tv(t){const e=t;return bs({...xs(e),...Es(e),...na(e),...bM(e)})}function AM(t){const e=[];return t.default&&t.default!=="rdf:nil"&&e.push(t.default),t.item&&t.item!=="rdf:nil"&&e.push(...t.item),{...xs(t),...Es(t),items:e}}function MM(t){return bs({...xs(t),...Es(t),...na(t),items:t.members})}function OM(t){const{"@id":e,"@type":n,"@context":r,profile:o,...c}=t,h={};return e&&(h["@id"]=e),h["@type"]=ev(t),h["@type"]==="unknown"&&(r&&r.length&&(h["@context"]=r),h["@type"]="Service"),o&&(h.profile=I1(o)),bs({...h,...c})}function DM(t){return bs({...xs(t),...Es(t),...na(t)})}new Zp({collection:[xM],manifest:[EM],canvas:[wM],annotationList:[TM],sequence:[CM],annotation:[RM],contentResource:[tv],choice:[AM],range:[MM],service:[OM],layer:[DM]});function nv(t){if((Array.isArray(t["@type"])&&t["@type"].includes("oa:SvgSelector")||t["@type"]=="oa:SvgSelector")&&("chars"in t||"value"in t))return{type:"SvgSelector",value:"chars"in t?t.chars:t.value};if(t["@type"]==="oa:FragmentSelector")return{type:"FragmentSelector",value:t.value};if(t["@type"]==="oa:Choice")return[nv(t.default),...(Array.isArray(t.item)?t.item:[t.item]).map(nv)];if(t["@type"]=="iiif:ImageApiSelector")return{type:"ImageApiSelector",region:"region"in t?t.region:void 0,rotation:"rotation"in t?t.rotation:void 0};throw new Error(`Unsupported selector type: ${t["@type"]}`)}var V1={exports:{}};(function(t,e){var n=Object.defineProperty,r=(c,h,v)=>h in c?n(c,h,{enumerable:!0,configurable:!0,writable:!0,value:v}):c[h]=v,o=(c,h,v)=>(r(c,typeof h!="symbol"?h+"":h,v),v);(function(c,h){h(e)})(RA,function(c){const h="http://library.stanford.edu/iiif/image-api/compliance.html#level1",v="http://library.stanford.edu/iiif/image-api/compliance.html#level2",g="http://library.stanford.edu/iiif/image-api/conformance.html#level1",x="http://library.stanford.edu/iiif/image-api/conformance.html#level2",m="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",w="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",A="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",P="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",M="http://iiif.io/api/image/1/level1.json",_="http://iiif.io/api/image/1/profiles/level1.json",L="http://iiif.io/api/image/1/level2.json",k="http://iiif.io/api/image/1/profiles/level2.json",O="http://iiif.io/api/image/2/level1.json",I="http://iiif.io/api/image/2/profiles/level1.json",q="http://iiif.io/api/image/2/level2.json",te="http://iiif.io/api/image/2/profiles/level2.json",H="level1",J="level2",re="http://iiif.io/api/image/2/level1",$="http://iiif.io/api/image/2/level2",se=[re,$,h,v,g,x,m,w,A,P,M,_,L,k,O,I,q,te,H,J],ge=["http://iiif.io/api/image/2/level0",re,$,"http://library.stanford.edu/iiif/image-api/compliance.html#level0",h,v,"http://library.stanford.edu/iiif/image-api/conformance.html#level0",g,x,"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",m,w,"http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",A,P,"http://iiif.io/api/image/1/level0.json","http://iiif.io/api/image/1/profiles/level0.json",M,_,L,k,"http://iiif.io/api/image/2/level0.json","http://iiif.io/api/image/2/profiles/level0.json",O,I,q,te,"level0",H,J],Ce=["sc:Collection","sc:Manifest","sc:Canvas","sc:AnnotationList","oa:Annotation","sc:Range","sc:Layer","sc:Sequence","oa:Choice","Service","ContentResource"];class me{constructor(z,G={}){o(this,"traversals"),o(this,"options"),this.traversals={collection:[],manifest:[],canvas:[],annotationList:[],sequence:[],annotation:[],contentResource:[],choice:[],range:[],service:[],layer:[],...z},this.options={convertPropsToArray:!0,mergeMemberProperties:!0,allowUndefinedReturn:!1,...G}}static all(z){return new me({collection:[z],manifest:[z],canvas:[z],annotationList:[z],sequence:[z],annotation:[z],contentResource:[z],choice:[z],range:[z],service:[z],layer:[z]})}traverseCollection(z){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCollectionItems(z))),this.traversals.collection)}traverseCollectionItems(z){if(this.options.mergeMemberProperties){const G=[...(z.manifests||[]).map(Se=>typeof Se=="string"?{"@id":Se,"@type":"sc:Manifest"}:Se),...(z.collections||[]).map(Se=>typeof Se=="string"?{"@id":Se,"@type":"sc:Collection"}:Se),...z.members||[]];delete z.collections,delete z.manifests,z.members=G}return z.manifests&&(z.manifests=z.manifests.map(G=>this.traverseManifest(typeof G=="string"?{"@id":G,"@type":"sc:Manifest"}:G))),z.collections&&(z.collections=z.collections.map(G=>this.traverseCollection(typeof G=="string"?{"@id":G,"@type":"sc:Collection"}:G))),z.members&&(z.members=z.members.map(G=>typeof G=="string"?G:this.traverseUnknown(G))),z}traverseManifest(z){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseManifestItems(z))),this.traversals.manifest)}traverseManifestItems(z){return z.sequences&&(z.sequences=z.sequences.map(G=>this.traverseSequence(G))),z.structures&&(z.structures=z.structures.map(G=>this.traverseRange(G))),z}traverseSequence(z){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseSequenceItems(z))),this.traversals.sequence)}traverseSequenceItems(z){return z.canvases&&(z.canvases=z.canvases.map(G=>this.traverseCanvas(G))),z}traverseCanvas(z){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCanvasItems(z))),this.traversals.canvas)}traverseCanvasItems(z){return z.images&&(z.images=z.images.map(G=>this.traverseAnnotation(G))),z.otherContent&&(z.otherContent=z.otherContent.map(G=>this.traverseAnnotationList(G))),z}traverseRange(z){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseRangeItems(z))),this.traversals.range)}traverseRangeItems(z){if(this.options.mergeMemberProperties){const G=[...(z.ranges||[]).map(Se=>typeof Se=="string"?{"@id":Se,"@type":"sc:Range"}:Se),...(z.canvases||[]).map(Se=>typeof Se=="string"?{"@id":Se,"@type":"sc:Canvas"}:Se),...z.members||[]];delete z.ranges,delete z.canvases,z.members=G.length?G.map(Se=>this.traverseUnknown(Se)):void 0}return z}traverseAnnotationList(z){const G=typeof z=="string"?{"@id":z,"@type":"sc:AnnotationList"}:z;return this.traverseType(this.traverseDescriptive(this.traverseAnnotationListItems(G)),this.traversals.annotationList)}traverseAnnotationListItems(z){return z.resources&&(z.resources=z.resources.map(G=>this.traverseAnnotation(G))),z}traverseAnnotation(z){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseAnnotationItems(z))),this.traversals.annotation)}traverseAnnotationItems(z){return z.resource&&(Array.isArray(z.resource)?z.resource=z.resource.map(G=>this.traverseContentResource(G)):z.resource=this.traverseContentResource(z.resource)),z.on,z}traverseLayer(z){return this.traverseType(this.traverseLinking(this.traverseLayerItems(z)),this.traversals.layer)}traverseLayerItems(z){return z.otherContent&&(z.otherContent=z.otherContent.map(G=>this.traverseAnnotationList(G))),z}traverseChoice(z){return this.traverseType(this.traverseChoiceItems(z),this.traversals.choice)}traverseChoiceItems(z){return z.default&&z.default!=="rdf:nil"&&(z.default=this.traverseContentResource(z.default)),z.item&&z.item!=="rdf:nil"&&(z.item=z.item.map(G=>this.traverseContentResource(G))),z}traverseService(z){return this.traverseType(this.traverseLinking(z),this.traversals.service)}traverseContentResource(z){return z["@type"]==="oa:Choice"?this.traverseChoice(z):this.traverseType(this.traverseDescriptive(this.traverseLinking(z)),this.traversals.contentResource)}traverseUnknown(z){if(!z["@type"]||typeof z=="string")return z;switch(function(G){if(G==null)throw new Error("Null or undefined is not a valid entity.");if(Array.isArray(G))throw new Error("Array is not a valid entity");if(typeof G!="object")throw new Error(typeof G+" is not a valid entity");if(typeof G["@type"]=="string"){const Se=Ce.indexOf(G["@type"]);if(Se!==-1)return Ce[Se]}if(G.profile)return"Service";if(G.format||G["@type"])return"ContentResource";throw new Error("Resource type is not known")}(z)){case"sc:Collection":return this.traverseCollection(z);case"sc:Manifest":return this.traverseManifest(z);case"sc:Canvas":return this.traverseCanvas(z);case"sc:Sequence":return this.traverseSequence(z);case"sc:Range":return this.traverseRange(z);case"oa:Annotation":return this.traverseAnnotation(z);case"sc:AnnotationList":return this.traverseAnnotationList(z);case"sc:Layer":return this.traverseLayer(z);case"Service":return this.traverseService(z);case"oa:Choice":return this.traverseChoice(z);case"ContentResource":return this.traverseContentResource(z)}return z.profile?this.traverseService(z):z}traverseImageResource(z){const G=Array.isArray(z),Se=Array.isArray(z)?z:[z],st=[];for(const Ve of Se)typeof Ve=="string"?st.push(this.traverseContentResource({"@id":Ve,"@type":"dctypes:Image"})):st.push(this.traverseContentResource(Ve));return G||this.options.convertPropsToArray?st:st[0]}traverseDescriptive(z){return z.thumbnail&&(z.thumbnail=this.traverseImageResource(z.thumbnail)),z.logo&&(z.logo=this.traverseImageResource(z.logo)),z}traverseOneOrMoreServices(z){const G=Array.isArray(z),Se=Array.isArray(z)?z:[z],st=[];for(const Ve of Se)st.push(this.traverseService(Ve));return G||this.options.convertPropsToArray?st:st[0]}traverseLinking(z){return z.related&&(z.related=this.traverseOneOrManyType(z.related,this.traversals.contentResource)),z.rendering&&(z.rendering=this.traverseOneOrManyType(z.rendering,this.traversals.contentResource)),z.service&&(z.service=this.traverseOneOrMoreServices(z.service)),z.seeAlso&&(z.seeAlso=this.traverseOneOrManyType(z.seeAlso,this.traversals.contentResource)),z.within&&(typeof z.within=="string"||(z.within=this.traverseOneOrManyType(z.within,this.traversals.contentResource))),z.startCanvas&&(typeof z.startCanvas=="string"?z.startCanvas=this.traverseType({"@id":z.startCanvas,"@type":"sc:Canvas"},this.traversals.canvas):z.startCanvas&&this.traverseType(z.startCanvas,this.traversals.canvas)),z.contentLayer&&(typeof z.contentLayer=="string"?z.contentLayer=this.traverseLayer({"@id":z.contentLayer,"@type":"sc:Layer"}):z.contentLayer=this.traverseLayer(z.contentLayer)),z}traverseOneOrManyType(z,G){if(!Array.isArray(z)){if(!this.options.convertPropsToArray)return this.traverseType(z,G);z=[z]}return z.map(Se=>this.traverseType(Se,G))}traverseType(z,G){return G.reduce((Se,st)=>{const Ve=st(Se);return Ve!==void 0||this.options.allowUndefinedReturn?Ve:Se},z)}}function Ie(j){for(const z in j)j[z]!==void 0&&j[z]!==null||delete j[z];return j}const _e="Attribution",Ye="http://example.org/provider",gt="Unknown";function Z(j,z="none"){if(!j)return{};const G=Array.isArray(j)?j:[j],Se={};for(const st of G){if(typeof st=="string"){Se[z]=Se[z]?Se[z]:[],Se[z].push(st||"");continue}if(!st["@language"]){Se[z]=Se[z]?Se[z]:[],Se[z].push(st["@value"]||"");continue}const Ve=st["@language"];Se[Ve]=Se[Ve]?Se[Ve]:[],Se[Ve].push(st["@value"]||"")}return Se}function Ue(j){return Array.isArray(j)?Ue(j.find(z=>typeof z=="string")):ge.indexOf(j)!==-1?"level2":se.indexOf(j)!==-1?"level1":typeof j=="string"?j:void 0}function dt(j){for(const z of["sc","oa","dcterms","dctypes","iiif"])if(j.startsWith(`${z}:`))return j.slice(z.length+1);return j}const pe=["Collection","Manifest","Annotation","AnnotationPage","Range","Service"];function je(j){const z=j["@id"]||j.id;let G=j["@type"]||j.type;const Se=j.profile||void 0,st=j["@context"]||void 0;if(Se){const Ve=function(gn){switch(gn){case"http://iiif.io/api/image/2/level0.json":case"http://iiif.io/api/image/2/level1.json":case"http://iiif.io/api/image/2/level2.json":return"ImageService2";case"http://iiif.io/api/auth/1/kiosk":case"http://iiif.io/api/auth/1/login":case"http://iiif.io/api/auth/1/clickthrough":case"http://iiif.io/api/auth/1/external":case"http://iiif.io/api/auth/0/kiosk":case"http://iiif.io/api/auth/0/login":case"http://iiif.io/api/auth/0/clickthrough":case"http://iiif.io/api/auth/0/external":return"AuthCookieService1";case"http://iiif.io/api/auth/1/token":case"http://iiif.io/api/auth/0/token":return"AuthTokenService1";case"http://iiif.io/api/auth/1/logout":case"http://iiif.io/api/auth/0/logout":return"AuthLogoutService1";case"http://iiif.io/api/search/1/search":case"http://iiif.io/api/search/0/search":return"SearchService1";case"http://iiif.io/api/search/1/autocomplete":case"http://iiif.io/api/search/0/autocomplete":return"AutoCompleteService1"}}(Se);if(Ve)return Ve}if(st){const Ve=function(gn){const ki=Array.isArray(gn)?gn:[gn];for(const be of ki)switch(be){case"http://iiif.io/api/image/2/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2":return"ImageService2";case"http://iiif.io/api/image/1/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/context.json":return"ImageService1";case"http://iiif.io/api/annex/openannotation/context.json":return"ImageApiSelector"}}(st);if(Ve)return Ve}if(G){if(Array.isArray(G)){if(G.indexOf("oa:CssStylesheet")!==-1)return"CssStylesheet";if(G.indexOf("cnt:ContentAsText")!==-1)return"TextualBody";G=G[0]}for(const Ve of["sc","oa","dcterms","dctypes","iiif"])if(G.startsWith(`${Ve}:`)){G=G.slice(Ve.length+1);break}switch(G){case"Layer":return"AnnotationCollection";case"AnnotationList":return"AnnotationPage";case"cnt:ContentAsText":return"TextualBody"}}if(G&&pe.indexOf(G)!==-1)return G;if(j.format){if(j.format.startsWith("image/"))return"Image";if(j.format.startsWith("text/")||j.format==="application/pdf")return"Text";if(j.format.startsWith("application/"))return"Dataset"}return z&&(z.endsWith(".jpg")||z.endsWith(".png")||z.endsWith(".jpeg"))?"Image":G||"unknown"}const He=/http(s)?:\/\/(creativecommons.org|rightsstatements.org)[^"'\\<\n]+/gm;function ut(j){const z=j.match(He);return z?z[0]:j}const pt=["http://iiif.io/api/presentation/2/context.json","http://iiif.io/api/image/2/context.json","http://iiif.io/api/image/1/context.json","http://library.stanford.edu/iiif/image-api/1.1/context.json","http://iiif.io/api/search/1/context.json","http://iiif.io/api/search/0/context.json","http://iiif.io/api/auth/1/context.json","http://iiif.io/api/auth/0/context.json","http://iiif.io/api/annex/openannotation/context.json"];function vn(j){if(j){const z=Array.isArray(j)?j:[j],G=[];for(const Se of z)Se==="http://iiif.io/api/presentation/2/context.json"&&G.push("http://iiif.io/api/presentation/3/context.json"),pt.indexOf(Se)===-1&&G.push(Se);if(z.length)return G.length===1?G[0]:G}}let Kt=0;function xt(j,z){const G=encodeURI(j.id||j["@id"]||"").trim();return G&&z?`${G}/${z}`:G||(Kt++,`http://example.org/${j["@type"]}${z?`/${z}`:""}/${Kt}`)}function ct(j){const z=[...j.behavior||[]];let G;return j.viewingHint&&z.push(j.viewingHint),Array.isArray(j.motivation)?G=j.motivation.map(dt):j.motivation&&(G=dt(j.motivation)),{"@context":j["@context"]?vn(j["@context"]):void 0,id:(j["@id"]||xt(j)).trim(),type:je(j),behavior:z.length?z:void 0,height:j.height?j.height:void 0,width:j.width?j.width:void 0,motivation:G,viewingDirection:j.viewingDirection,profile:j.profile,format:j.format?j.format:void 0,duration:void 0,timeMode:void 0}}function Ge(j){const[z,G]=function(Ve,gn="Rights/License",ki="none"){let be=null;const at=[],ui=Array.isArray(Ve)?Ve:[Ve];for(const Dt of ui){const et=Dt?ut(Dt):void 0;!et||et.indexOf("creativecommons.org")===-1&&et.indexOf("rightsstatements.org")===-1?et&&at.push({label:{[ki]:[gn]},value:{[ki]:[et]}}):be=et.startsWith("https://")?`http://${et.slice(8)}`:et}return[be,at]}(j.license),Se=[...j.metadata?(st=j.metadata,st?st.map(Ve=>({label:Z(Ve.label),value:Z(Ve.value)})):[]):[],...G];var st;return{rights:z,metadata:Se.length?Se:void 0,label:j.label?Z(j.label):void 0,requiredStatement:j.attribution?{label:Z(_e),value:Z(j.attribution)}:void 0,navDate:j.navDate,summary:j.description?Z(j.description):void 0,thumbnail:nt(j.thumbnail)}}function nt(j){return j&&(Array.isArray(j)?j:[j]).map(z=>typeof z=="string"?{id:z,type:"Image"}:(z.type==="unknown"&&(z.type="Image"),z))}function Ze(j){if(!j.within)return;const z=Array.isArray(j.within)?j.within:[j.within],G=[];for(const Se of z)typeof Se=="string"?Se&&j["@type"]==="sc:Manifest"&&G.push({id:Se,type:"Collection"}):Se["@id"]&&G.push({id:Se["@id"],type:je(Se)});return G.length?G:void 0}function ht(j){const z=j.related?Array.isArray(j.related)?j.related:[j.related]:[],G=j.contentLayer;return{provider:j.logo||z.length?[{id:Ye,type:"Agent",homepage:z.length?[z[0]]:void 0,logo:j.logo?Array.isArray(j.logo)?j.logo:[j.logo]:void 0,label:Z(gt)}]:void 0,partOf:Ze(j),rendering:j.rendering,seeAlso:j.seeAlso,start:j.startCanvas,service:j.service?(Se=j.service,Array.isArray(Se)?Se:Se?[Se]:[]):void 0,supplementary:G?[G]:void 0};var Se}function ft(j){const z=j;return Ie({...ct(z),...Ge(z),...ht(z),...(G=z,{chars:G.chars,format:G.format?G.format:void 0,language:G.language})});var G}const mn=new me({collection:[function(j){return Ie({...ct(j),...Ge(j),...ht(j),items:j.members})}],manifest:[function(j){const z=[],G=[];let Se;for(const Ve of j.sequences||[])Ve.canvases.length&&z.push(...Ve.canvases),Ve.behavior&&G.push(...Ve.behavior),Ve.startCanvas&&(Se=Ve.startCanvas);const st=ct(j);return G.length&&(st.behavior?st.behavior.push(...G):st.behavior=G),Ie({...st,...Ge(j),...ht(j),start:Se,items:z,structures:j.structures})}],canvas:[function(j){return Ie({...ct(j),...Ge(j),...ht(j),annotations:j.otherContent&&j.otherContent.length?j.otherContent:void 0,items:j.images&&j.images.length?[{id:xt(j,"annotation-page"),type:"AnnotationPage",items:j.images}]:void 0})}],annotationList:[function(j){return Ie({...ct(j),...Ge(j),...ht(j),items:j.resources&&j.resources.length?j.resources:void 0})}],sequence:[function(j){return j.canvases&&j.canvases.length!==0?{canvases:j.canvases,behavior:j.viewingHint?[j.viewingHint]:[],startCanvas:j.startCanvas}:{canvases:[],behavior:[]}}],annotation:[function(j){return Ie({...ct(j),...Ge(j),...ht(j),target:function z(G){if(Array.isArray(G)){if(G.length>1)return{type:"List",items:G.map(z)};G=G[0]}if(typeof G=="string")return encodeURI(G).trim();if("@type"in G){let Se;if(typeof G.full=="string")Se=G.full;else if(G.full["@type"]==="dctypes:Image")Se={id:G.full["@id"],type:"Image"};else{if(G.full["@type"]!=="sc:Canvas")throw new Error(`Unsupported source type on annotation: ${G.full["@type"]}`);Se={id:G.full["@id"],type:"Canvas"}}return{type:"SpecificResource",source:Se,selector:Qt(G.selector)}}return encodeURI(G["@id"]).trim()}(j.on),body:Array.isArray(j.resource)?j.resource.map(ft):ft(j.resource)})}],contentResource:[ft],choice:[function(j){const z=[];return j.default&&j.default!=="rdf:nil"&&z.push(j.default),j.item&&j.item!=="rdf:nil"&&z.push(...j.item),{...ct(j),...Ge(j),items:z}}],range:[function(j){return Ie({...ct(j),...Ge(j),...ht(j),items:j.members})}],service:[function(j){const{"@id":z,"@type":G,"@context":Se,profile:st,...Ve}=j,gn={};return z&&(gn["@id"]=z),gn["@type"]=je(j),gn["@type"]==="unknown"&&(Se&&Se.length&&(gn["@context"]=Se),gn["@type"]="Service"),st&&(gn.profile=Ue(st)),Ie({...gn,...Ve})}],layer:[function(j){return Ie({...ct(j),...Ge(j),...ht(j)})}]});function Qt(j){if((Array.isArray(j["@type"])&&j["@type"].includes("oa:SvgSelector")||j["@type"]=="oa:SvgSelector")&&("chars"in j||"value"in j))return{type:"SvgSelector",value:"chars"in j?j.chars:j.value};if(j["@type"]==="oa:FragmentSelector")return{type:"FragmentSelector",value:j.value};if(j["@type"]==="oa:Choice")return[Qt(j.default),...(Array.isArray(j.item)?j.item:[j.item]).map(Qt)];if(j["@type"]=="iiif:ImageApiSelector")return{type:"ImageApiSelector",region:"region"in j?j.region:void 0,rotation:"rotation"in j?j.rotation:void 0};throw new Error(`Unsupported selector type: ${j["@type"]}`)}const Gi=function(j){return j&&j["@context"]&&(j["@context"]==="http://iiif.io/api/presentation/2/context.json"||j["@context"].indexOf("http://iiif.io/api/presentation/2/context.json")!==-1||j["@context"]==="http://www.shared-canvas.org/ns/context.json")||j["@context"]==="http://iiif.io/api/image/2/context.json"?mn.traverseUnknown(j):j};c.upgrade=Gi,Object.defineProperties(c,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})})})(V1,V1.exports);function LM(t){return t.type==="SpecificResource"?[t.source,{selector:t.selector}]:[t,{selector:null}]}function iv(t,e){const{selector:n,source:r}=Ku(e);if(r.id!==t.id)return[null,r];const o={type:"BoxSelector",spatial:{x:0,y:0,width:Number(t.width),height:Number(t.height)}};return[n?n.type==="TemporalSelector"?{type:"TemporalBoxSelector",temporal:n.temporal,spatial:o.spatial}:n:null,r]}const W1={makeChoice:()=>{}},fd={type:"unknown"},Mn=t=>({type:"unknown",reason:t,annotations:{pages:[]}}),$1=(t,e)=>({type:"empty",width:t,height:e,annotations:{pages:[]},image:null,images:[]});function PM(t,e){var r;const n=(r=t==null?void 0:t.iiif)==null?void 0:r.meta[e];return n?n.annotationPageManager:null}function kM(t,e){return Kn(n=>{const r=[];if(!t)return r;const o=Object.keys(n.iiif.entities.AnnotationPage);for(const c of o)if(!e||e.indexOf(c)!==-1){const h=PM(n,c);h&&h.views&&h.views[t]&&r.push(c)}return r},[t,e])}function q1({canvas:t,manifest:e,all:n,canvases:r}){const o=[];if(e)for(const c of e.annotations)o.indexOf(c.id)===-1&&o.push(c.id);if(n){if(r&&r.length)for(const c of r)for(const h of c.annotations)o.indexOf(h.id)===-1&&o.push(h.id)}else if(t)for(const c of t.annotations)o.indexOf(c.id)===-1&&o.push(c.id);return o}function zM(t,e){var r;const n=(r=t==null?void 0:t.iiif)==null?void 0:r.meta[e];return n?n.annotationPageManager:null}function Y1(t,e={}){const n=kn(),r=ea(),o=$r(),c=Up(),h=C.useMemo(()=>q1({all:e.all,manifest:r,canvas:o,canvases:c}),[e.all,o,c,r]),v=kM(t,e.all?void 0:h),g=C.useCallback(m=>{t&&n.setMetaValue([m,"annotationPageManager","views"],w=>w&&!w[t]?w:{...w||{},[t]:!1})},[t,n]),x=C.useCallback((m,w={})=>{if(!t)return;const A=n.getState(),P=[];if(w!=null&&w.deselectOthers){const M=Object.keys(A.iiif.entities.AnnotationPage);for(const _ of M){const L=zM(A,_);L&&L.views&&L.views[t]&&P.push(_)}}for(const M of P)g(M);n.setMetaValue([m,"annotationPageManager","views"],M=>M&&M[t]?M:{...M||{},[t]:!0})},[t,g,n]);return{availablePageIds:h,enabledPageIds:v,setPageEnabled:x,setPageDisabled:g}}function Q1(t,e){return Kn((n,r)=>r.get(t.map(o=>({id:o,type:e}))),[t,e])}const G1=C.createContext(new ka.ImageServiceLoader);function dd(){return C.useContext(G1)}function X1(){const t=dd(),[e,n]=C.useState({}),r=C.useRef(!1);return C.useEffect(()=>()=>{r.current=!0},[]),[C.useCallback((c,{height:h,width:v})=>{if(c){const g=c.id||c["@id"],x=t.loadServiceSync({id:g,width:c.width||v,height:c.height||h,source:c});x?c=x:e[g]||(r.current||n(m=>({...m,[g]:"loading"})),t.loadService({id:g,width:c.width||v,height:c.height||h}).then(()=>{r.current||n(m=>({...m,[g]:"done"}))}))}return c},[t,e]),e]}function hd(t={}){const e=Yp(),n=$r(t.canvasId?{id:t.canvasId}:void 0);return Kn((r,o)=>{if(!n)return[];if(e&&t.enableSingleAnnotation)return[e];const c=o.get(n.items),h=[];for(const v of c)h.push(...o.get(v.items));return h},[n])}function NM(t){return t.type==="SpecificResource"?[t.source,{selector:t.selector}]:[t,{selector:null}]}const pd={},K1={get(t){return t},setMetaValue([t,e,n],r){const o=K1.getResourceMeta(t,e),c=o?o[n]:void 0,h=typeof r=="function"?r(c):r;pd[t]={...pd[t]||{},[e]:{...(pd[t]||{})[e]||{},[n]:h}}},getResourceMeta:(t,e)=>{const n=pd[t];if(n)return e?n[e]:n}};function _M(t=K1){function e(o){const c=o?typeof o=="string"?t.get(o):o:null;if(!c)return[];const h=t.get(c.items,{parent:c}),v=[];for(const g of h)v.push(...t.get(g.items,{parent:g}));return v}function n(o,c=[]){const h=Array.isArray(o)?o:e(o),v=[];let g=null;const x=[];for(const m of h){if(m.type!=="Annotation")throw new Error("getPaintables() accept either a canvas or list of annotations");const w=Array.from(Array.isArray(m.body)?m.body:[m.body]);for(const A of w){const[P,{selector:M}]=NM(A),_=t.get(P),L=(_.type||"unknown").toLowerCase();if(L==="choice"){const k=t.get(_.items,{parent:_.id}),O=c.length?c.map(I=>k.find(q=>q.id===I)).filter(Boolean):[k[0]];O.length===0&&O.push(k[0]),g={type:"single-choice",items:k.map(I=>({id:I.id,label:I.label,selected:O.indexOf(I)!==-1})),label:P.label},w.push(...O);continue}v.indexOf(L)===-1&&v.push(L),x.push({type:L,annotationId:m.id,resource:_,target:m.target,selector:M})}}return{types:v,items:x,choice:g}}function r(o){const{choice:c}=n(o);return c}return{getAllPaintingAnnotations:e,getPaintables:n,extractChoices:r}}function Z1(t,e=[]){const n=kn(),r=C.useMemo(()=>_M(n),[]),o=hd({enableSingleAnnotation:t==null?void 0:t.enableSingleAnnotation}),[c,h]=C.useState((t==null?void 0:t.defaultChoices)||[]),v=C.useMemo(()=>r.getPaintables(o,c),[n,o,c,...e]),x={makeChoice:C.useCallback((m,{deselectOthers:w=!0,deselect:A=!1}={})=>{if(v.choice){if(v.choice.type!=="single-choice")throw new Error("Complex choice not supported yet");h(P=>{if(A){const _=P.filter(L=>L!==m);if(_.length===0){const L=v.items[0].resource.id;return L?[L]:[]}return _}if(w)return[m];const M=[...P];if(M.length===0&&v.items.length){const _=v.items[0].resource.id;_&&M.push(_)}return P.indexOf(m)!==-1?P:[...P,m]})}},[v.choice])};return[v,x]}const UM=["model/gltf-binary"];function J1(t,e){const r=e.items[0].resource;return r.format?UM.indexOf(r.format)===-1?Mn(`3D format: ${r.format} is unsupported`):{type:"3d-model",model:r}:Mn("Unknown format")}function jM(t,e){var r;if(!t.duration)return Mn("No duration on canvas");if(e.items.length>1)return Mn("Only one audio source supported");const n=(r=e.items[0])==null?void 0:r.resource;return n?n.format?{type:"media",media:{annotationId:e.items[0].annotationId,duration:t.duration,url:n.id,type:"Sound",target:{type:"TemporalSelector",temporal:{startTime:0,endTime:t.duration}},format:n.format,selector:{type:"TemporalSelector",temporal:{startTime:0,endTime:t.duration}}},annotations:{pages:[]}}:Mn("Audio does not have format"):Mn("Unknown audio")}function eS(t,e,n){const r=[];for(const o of e.items){const c=o.resource&&o.resource.type==="SpecificResource"?o.resource.source:o.resource;if(!c.id)return Mn("No resource Identifier");let h;if(c.service){const P=ka.getImageServices(c);P[0]&&(h=n(P[0],t))}const v={type:"BoxSelector",spatial:{x:0,y:0,width:Number(t.width),height:Number(t.height)}},[g,x]=iv(t,o.target);if(x.id!==t.id)continue;o.resource.width&&o.resource.height&&(o.resource.width,o.resource.height);let m=o.resource.type==="SpecificResource"?ta(o.resource):null;if(o.selector){const P=ta({type:"SpecificResource",source:o.resource,selector:o.selector});P&&(m=P)}const w=m&&m.selector&&(m.selector.type==="BoxSelector"||m.selector.type==="TemporalBoxSelector")?{type:"BoxSelector",spatial:{x:m.selector.spatial.x,y:m.selector.spatial.y,width:m.selector.spatial.width,height:m.selector.spatial.height}}:void 0;h&&!h.id&&(h.id=h["@id"]);const A={id:c.id,type:"Image",annotationId:o.annotationId,width:Number(g||w?c.width:t.width),height:Number(g||w?c.height:t.height),service:h,sizes:h&&h.sizes?h.sizes:c.width&&c.height?[{width:c.width,height:c.height}]:[],target:g&&g.type!=="PointSelector"?g:v,selector:w};r.push(A)}return{type:"images",image:r[0],images:r,choice:e.choice}}function tS(t,e={},n){const r=t.language||n||"none";switch(t.type){case"TextualBody":{typeof t.value<"u"&&(e[r]=t.value);break}case"List":case"Composite":case"Choice":t.items&&t.items.forEach(o=>tS(o,e,r))}return e}function nS(t,e){const n=[];return e.items.forEach(r=>{if(r.resource){const[o]=iv(t,r.target);n.push({annotationId:r.annotationId,text:tS(r.resource),target:o})}}),{type:"textual-content",items:n}}const IM=/^.*(?:(?:youtu\.be\/|v\/|vi\/|u\/\w\/|embed\/|shorts\/)|(?:(?:watch)?\?vi?=|&vi?=))([^#&?]*).*/;function iS(t,e){var h;const n=e.items.filter(v=>v.type==="video");if(!t.duration)return Mn("No duration on canvas");if(n.length>1)return Mn("Only one video source supported");const r=(h=n[0])==null?void 0:h.resource,o=!!(r.service||[]).find(v=>(v.profile||"").includes("youtube.com"));if(!r)return Mn("Unknown video");if((!r.format||r.format==="text/html")&&!o)return Mn("Video does not have format");const c={annotationId:e.items[0].annotationId,duration:t.duration,url:r.id,type:"Video",items:[],target:{type:"TemporalSelector",temporal:{startTime:0,endTime:t.duration}},format:r.format,selector:{type:"TemporalSelector",temporal:{startTime:0,endTime:t.duration}}};if(o){c.type="VideoYouTube";const v=r.id.match(IM);if(!v[1])return Mn("Video is not known youtube video");c.youTubeId=v[1]}return{type:"media",media:c,annotations:{pages:[]}}}function rS({canvas:t,paintables:e,supports:n,loadImageService:r}){if(!t)return console.log("No canvas"),fd;if(e.types.length===0)return n.indexOf("empty")!==-1?$1(t.width,t.height):(console.log("No paintables"),fd);if(e.types.length!==1)if(e.types.length===2&&e.types.indexOf("text")!==-1)e.types=e.types.filter(c=>c!=="text");else return n.indexOf("complex-timeline")===-1?Mn("Complex timeline not supported"):Mn("ComplexTimelineStrategy not yet supported");const o=e.types[0];return o==="image"?n.indexOf("images")===-1?Mn("Image not supported"):eS(t,e,r):o==="Model"||o==="model"?n.indexOf("3d-model")===-1?Mn("3D not supported"):J1(t,e):o==="textualbody"?n.indexOf("textual-content")===-1?Mn("Textual content not supported"):nS(t,e):o==="sound"||o==="audio"?n.indexOf("media")===-1?Mn("Media not supported"):jM(t,e):o==="video"?n.indexOf("media")===-1?Mn("Media not supported"):iS(t,e):fd}function sS(t){const e=ea(),n=$r(),r=kn(),[o,c]=X1(),{enabledPageIds:h}=Y1((t==null?void 0:t.annotationPageManagerId)||(e==null?void 0:e.id)||(n==null?void 0:n.id),{all:!1}),v=Q1(h,"AnnotationPage"),g=(t==null?void 0:t.strategies)||["empty","images","media","textual-content","complex-timeline"],[x,m]=Z1(t,[c]),w=C.useMemo(()=>rS({canvas:n,paintables:x,supports:g,loadImageService:o}),[n,x,r,m.makeChoice]);return C.useMemo(()=>w.type==="unknown"?[w,W1]:[{...w,annotations:{pages:v}},m],[w,v])}const aS=(t,e=[])=>{const n=kn();C.useEffect(()=>{t(n)},[n,...e])},vd={},oS={get(t){return t},setMetaValue([t,e,n],r){const o=oS.getResourceMeta(t,e),c=o?o[n]:void 0,h=typeof r=="function"?r(c):r;vd[t]={...vd[t]||{},[e]:{...(vd[t]||{})[e]||{},[n]:h}}},getResourceMeta:(t,e)=>{const n=vd[t];if(n)return e?n[e]:n}},FM=new ka.ImageServiceLoader;function BM(t=oS,e={}){const n=e.imageServiceLoader||FM;async function r(o,c,h=!1,v=[],g){const x=()=>n.getThumbnailFromResource(void 0,c,h,v);if(!o)return await n.getThumbnailFromResource(void 0,c,h,v);if(typeof o=="string"){const w=ka.getFixedSizeFromImage(o);return w&&v.push(w),await n.getThumbnailFromResource(void 0,c,h,v)}const m=t.get(o,{skipSelfReturn:!1});if(typeof m=="string")return{best:ka.getFixedSizeFromImage(m),fallback:[],log:[]};if(!m)return await x();switch(await(async w=>{if(w&&w.thumbnail&&w.thumbnail.length){const A=t.get(w.thumbnail[0]),P=await n.getImageCandidates(A,h);P&&P.length&&v.push(...P)}})(m),m.type){case"Annotation":{const w=Array.isArray(m.body)?m.body:[m.body],A=t.get(w[0]);return g&&!A.width&&(A.width=g.width,A.height=g.height),await n.getThumbnailFromResource(A,c,h,v)}case"Canvas":{const w=m;return r(w.items[0],c,h,v,{width:w.width,height:w.height})}case"AnnotationPage":return r(m.items[0],c,h,v,g);case"Choice":{const w=m;return!w.items||w.items[0]?await x():r(w.items[0],c,h,v,g)}case"Collection":{const w=m.items[0];return w?r(w,c,h,v,g):await x()}case"Manifest":{const w=m.items[0];return w?r(w,c,h,v,g):await x()}case"SpecificResource":case"Image":case"Dataset":case"Sound":case"Text":case"TextualBody":case"Video":return g&&!m.width&&(m.width=g.width,m.height=g.height),n.getThumbnailFromResource(m,c,h,v)}return await x()}return{getBestThumbnailAtSize:r}}function lS(t,e,{canvasId:n,manifestId:r}={}){const o=kn(),c=dd(),h=C.useMemo(()=>BM(o,{imageServiceLoader:c}),[o,c]),[v,g]=C.useState(),x=ea(r?{id:r}:void 0),m=$r(n?{id:n}:void 0),w=m||x,A=C.useRef(!1);if(C.useEffect(()=>(A.current=!1,()=>{A.current=!0}),[]),!w)throw new Error("Must be called under a manifest or canvas context.");return aS(P=>{h.getBestThumbnailAtSize(w,t,e).then(M=>{M.best&&!A.current&&g(M.best)})},[w]),v}function HM(t){return{isMuted:!1,playRequested:!1,isPlaying:!1,isFinished:!1,volume:100,duration:t}}function VM(t,e){switch(e.type){case"FINISHED":return{...t,isFinished:!0,isPlaying:!1,playRequested:!1};case"PLAY_PAUSE":return{...t,isFinished:!1,isPlaying:!t.isPlaying};case"PLAY_REQUESTED":return{...t,isFinished:!1,playRequested:!0};case"PAUSE":return{...t,isPlaying:!1};case"PLAY":return{...t,isFinished:!1,playRequested:!1,isPlaying:!0};case"MUTE":return{...t,isMuted:!0};case"SET_VOLUME":return{...t,volume:e.volume,isMuted:e.volume===0};case"TOGGLE_MUTE":return{...t,isMuted:!t.isMuted};case"UNMUTE":return{...t,isMuted:!1}}return t}function uS(t){const e=Math.round(t);return`${Math.floor(e/60)}:${`${e%60}`.padStart(2,"0")}`}function md(t){const[e,n]=C.useReducer(VM,HM(t.duration)),r=C.useRef(null),o=C.useRef(null),c=C.useRef(null),h=C.useRef(!1),v=C.useCallback(()=>{o.current&&r.current&&(o.current.innerHTML=uS(r.current.currentTime),c.current&&(c.current.style.width=`${r.current.currentTime/t.duration*100}%`),h.current!==r.current.muted&&(h.current=r.current.muted,n(r.current.muted?{type:"MUTE"}:{type:"UNMUTE"})))},[t.duration]),g=C.useCallback(()=>{r.current&&(n({type:"PLAY_REQUESTED"}),r.current.play().then(()=>{n({type:"PLAY"})}),v())},[v]),x=C.useCallback(()=>{r.current&&(r.current.duration>0&&r.current.paused?g():m())},[v]),m=C.useCallback(()=>{r.current&&(r.current.pause(),n({type:"PAUSE"}),v())},[v]),w=C.useCallback(()=>{r.current&&(r.current.muted=!r.current.muted,n(r.current.muted?{type:"MUTE"}:{type:"UNMUTE"}))},[]),A=C.useCallback(()=>{r.current&&(r.current.muted=!0,n({type:"MUTE"}))},[]),P=C.useCallback(()=>{r.current&&(r.current.muted=!1,n({type:"UNMUTE"}))},[]),M=C.useCallback(k=>{r.current&&(r.current.muted=!1,r.current.volume=k/100,n({type:"SET_VOLUME",volume:k}))},[]),_=C.useCallback(k=>{r.current&&(r.current.currentTime=Math.max(0,Math.min(k*t.duration,t.duration)),v())},[]),L=C.useCallback(k=>{r.current&&(r.current.currentTime=Math.max(0,Math.min(k,t.duration)),v())},[]);return C.useEffect(()=>{const k=setInterval(()=>{v()},350);return()=>clearInterval(k)},[v,t.duration]),C.useEffect(()=>{const k=()=>{n({type:"FINISHED"})},O=r.current;return O==null||O.addEventListener("ended",k),()=>O==null?void 0:O.removeEventListener("ended",k)},[]),[{element:r,currentTime:o,progress:c},e,{play:g,pause:m,playPause:x,mute:A,unmute:P,toggleMute:w,setVolume:M,setDurationPercent:_,setTime:L}]}const cS=C.createContext(null),fS=C.createContext(null),dS=C.createContext(null);function WM(){const t=C.useContext(cS);if(!t)throw new Error("Ctx not found");return t}function $M(){const t=C.useContext(fS);if(!t)throw new Error("Ctx not found");return t}function qM(){const t=C.useContext(dS);if(!t)throw new Error("Ctx not found");return t}function rv({actions:t,state:e,children:n,currentTime:r,progress:o,element:c}){return le.jsx(dS.Provider,{value:{currentTime:r,progress:o,element:c},children:le.jsx(fS.Provider,{value:t,children:le.jsx(cS.Provider,{value:e,children:n})})})}function hS({media:t,children:e}){const[{element:n,currentTime:r,progress:o},c,h]=md({duration:t.duration});return le.jsxs(rv,{state:c,actions:h,currentTime:r,progress:o,element:n,children:[le.jsx("audio",{ref:n,src:t.url}),e]})}function pS({media:t,mediaControlsDeps:e,children:n}){return fl("portal","audio",hS,{media:t,children:n},[t,...e||[]]),null}function vS({element:t,media:e,playPause:n}){return le.jsxs("div",{className:"video-container",part:"video-container",onClick:n,children:[le.jsx("style",{children:`
|
|
349
345
|
.video-container {
|
|
350
346
|
position: absolute;
|
|
351
347
|
top: 0;
|
|
@@ -358,7 +354,7 @@ No matching component was found for:
|
|
|
358
354
|
justify-content: center;
|
|
359
355
|
pointer-events: visible;
|
|
360
356
|
}
|
|
361
|
-
`}),
|
|
357
|
+
`}),le.jsx("video",{ref:t,src:e.url,style:{width:"100%",objectFit:"contain"}})]})}function mS({media:t,mediaControlsDeps:e,children:n}){const[{element:r,currentTime:o,progress:c},h,v]=md({duration:t.duration});return fl("overlay","video-element",vS,{element:r,media:t,playPause:v.playPause}),fl("portal","custom-controls",rv,{state:h,actions:v,currentTime:o,progress:c,element:r,children:n},[o,h,t,...e||[]]),null}function gS({model:t}){return le.jsxs(le.Fragment,{children:[le.jsx("style",{children:`
|
|
362
358
|
.model-container {
|
|
363
359
|
position: absolute;
|
|
364
360
|
top: 0;
|
|
@@ -371,9 +367,9 @@ No matching component was found for:
|
|
|
371
367
|
justify-content: center;
|
|
372
368
|
pointer-events: visible;
|
|
373
369
|
}
|
|
374
|
-
`}),
|
|
375
|
-
`):""},[n,e,t]),n]}function
|
|
376
|
-
`):""}}const
|
|
370
|
+
`}),le.jsx("div",{className:"model-container",children:le.jsx("model-viewer",{"interaction-prompt":"none",style:{width:"100%",height:"100%"},"camera-controls":"","ar-status":"not-presenting",src:t.id})})]})}function yS({model:t,name:e}){return fl("overlay",`model-${e}`,gS,{model:t},[t]),null}function SS({style:t}){const e=$r();return!e||!e.height||!e.width?null:le.jsx("box",{interactive:!1,target:{x:0,y:0,width:Number(e.width),height:Number(e.height)},style:t})}const bS=C.createContext("en");function YM(t){return le.jsx(bS.Provider,{value:t.language,children:t.children})}function gd(){return C.useContext(bS)}function xS(t){return t.indexOf("-")!==-1?t.slice(0,t.indexOf("-")):t}function ES({as:t,language:e,children:n,viewingDirection:r,...o}){const c=gd();return C.useMemo(()=>xS(c)===xS(e),[c,e])?t?le.jsx(t,{...o,children:n}):le.jsx("span",{...o,children:n}):t?le.jsx(t,{...o,lang:e,dir:r,children:n}):le.jsx("span",{...o,lang:e,dir:r,children:n})}function wS(t,e,n){if(e.length===0)return;if(e.length===1)return e[0];if(e.indexOf(t)!==-1)return t;const r=t.indexOf("-")!==-1?t.slice(0,t.indexOf("-")):null;if(r&&e.indexOf(r)!==-1)return r;for(const o of n)if(e.indexOf(o)!==-1)return o;return e.indexOf("none")!==-1?"none":e.indexOf("@none")!==-1?"@none":e[0]}const TS=(t,e=[])=>{const n=gd();return C.useMemo(()=>{const r=t();return wS(n,r,[])},[n,...e])};function CS(t,e){const n=TS(()=>Object.keys(t||{}),[t]);return[C.useMemo(()=>{if(!t)return e||"";if(typeof t=="string")return t;const r=n?t[n]:void 0;return r?typeof r=="string"?r:r.join(`
|
|
371
|
+
`):""},[n,e,t]),n]}function QM(){const t=gd();return function(n,r,o){const c=Object.keys(n||{}),h=wS(t,c,[]);if(!n)return r||"";if(typeof n=="string")return n;const v=h?n[h]:void 0;return v?typeof v=="string"?v:v.join(typeof o<"u"?o:`
|
|
372
|
+
`):""}}const RS=({as:t,defaultText:e,enableDangerouslySetInnerHTML:n,children:r,...o})=>{const[c,h]=CS(r,e);return h?le.jsx(ES,{...o,as:t,language:h,title:n?void 0:c,dangerouslySetInnerHTML:n?{__html:c}:void 0,children:n?void 0:c}):t?le.jsx(t,{...o,children:c}):le.jsx("span",{...o,title:n?void 0:c,dangerouslySetInnerHTML:n?{__html:c}:void 0,children:n?void 0:c})};function GM({element:t,media:e,playPause:n}){const r=C.useRef(null);return e.youTubeId?le.jsxs("div",{className:"video-container",part:"video-container",onClick:n,children:[le.jsx("style",{children:`
|
|
377
373
|
.video-container {
|
|
378
374
|
position: absolute;
|
|
379
375
|
top: 0;
|
|
@@ -391,5 +387,5 @@ No matching component was found for:
|
|
|
391
387
|
width: 100%;
|
|
392
388
|
object-fit: contain;
|
|
393
389
|
}
|
|
394
|
-
`}),oe.jsx("iframe",{className:"video-yt",ref:i,src:`https://www.youtube.com/embed/${e.youTubeId}?enablejsapi=1&origin=${window.location.host}`,referrerPolicy:"no-referrer",sandbox:"allow-scripts allow-same-origin allow-presentation"})]}):null}function SD({media:t,mediaControlsDeps:e,children:n}){const[{element:i,currentTime:a,progress:u},f,p]=Gd({duration:t.duration});return Fl("overlay","video-element",yD,{element:i,media:t,playPause:p.playPause}),null}function HE({x:t,y:e,onChoiceChange:n,registerActions:i,defaultChoices:a,isStatic:u,renderViewerControls:f,renderMediaControls:p,viewControlsDeps:g,mediaControlsDeps:S,strategies:m,throwOnUnknown:x,backgroundStyle:R,alwaysShowBackground:_,keepCanvasScale:M=!1,enableSizes:k=!1,enableYouTube:L=!0,onClickPaintingAnnotation:P,children:O}){const j=Jr(),q=Yv(j,["deep-zoom"]),[ee]=lb(),H=cb(),Z=Un(),ie=T.useMemo(()=>Qv(Z),[Z]),[W,re]=bE({strategies:m||["images"],defaultChoices:a==null?void 0:a.map(({id:me})=>me)}),ge=W.type==="images"?W.choice:void 0,be=T.useMemo(()=>M?1:Math.max(1,...W.type==="images"?W.images.map(me=>{var tt;return(me.width||0)/((tt=me.target)==null?void 0:tt.spatial.width)}):[]),[M,W]);gL(be),T.useEffect(()=>{i&&i(re)},[W.annotations]),T.useEffect(()=>{if(a)for(const me of a)typeof me.opacity<"u"&&ie.applyStyles({id:me.id},"atlas",{opacity:me.opacity})},[a]),T.useLayoutEffect(()=>{n&&n(ge)},[ge]),Fl(H&&(W.type==="images"||W.type==="empty"||W.type==="textual-content"&&f)?"overlay":"none",`canvas-portal-controls-${j==null?void 0:j.id}`,Ud.Provider,f?{value:H||null,children:f(W)}:{},[j,H,W,...g||[]]);const Ee=wE({maxWidth:256,maxHeight:256});if(!j)return null;const Ue=j.accompanyingCanvas,je=Ee&&Ee.type==="fixed"?oe.jsx("world-object",{height:j.height,width:j.width,x:t,y:e,children:oe.jsx("world-image",{uri:Ee.id,target:{x:0,y:0,width:j.width,height:j.height},display:Ee.width&&Ee.height?{width:Ee.width,height:Ee.height}:void 0,crop:void 0})}):null;if(W.type==="unknown"){if(je)return je;if(x)throw new Error(W.reason||"Unknown image strategy");return null}const Xe=oe.jsxs(T.Fragment,{children:[ee?oe.jsx(Jv,{page:ee}):null,W.annotations&&W.annotations.pages?W.annotations.pages.map(me=>oe.jsx(Jv,{page:me},me.id)):null,O]}),ce=W.type==="images"?W.images.length:0;return oe.jsxs(oe.Fragment,{children:[oe.jsxs("world-object",{height:j.height,width:j.width,x:t,y:e,...q,children:[W.type==="empty"||_?oe.jsx(kE,{style:R}):null,W.type==="textual-content"?W.items.map((me,tt)=>{var mt;return oe.jsxs(oe.Fragment,{children:[oe.jsx(hv,{onClick:P?he=>{he.stopPropagation(),P(me.annotationId,me,he)}:void 0,target:((mt=me.target)==null?void 0:mt.spatial)||void 0,children:oe.jsx("div",{"data-textual-content":!0,children:oe.jsx(BE,{enableDangerouslySetInnerHTML:!0,children:me.text})})},tt),Xe]})}):null,W.type==="images"?oe.jsxs(oe.Fragment,{children:[W.images.map((me,tt)=>oe.jsx(Rb,{isStatic:u,image:me,id:me.id,thumbnail:tt===0?Ee:void 0,selector:me.selector,enableSizes:k,onClick:P?mt=>{mt.stopPropagation(),P(me.annotationId,me,mt)}:void 0},me.id+tt)),Xe]}):null,W.type==="3d-model"?oe.jsx(DE,{model:W.model}):null,W.type==="media"?oe.jsx(oe.Fragment,{children:W.media.type==="Sound"?oe.jsxs(OE,{media:W.media,mediaControlsDeps:S,children:[je,p?p(W):null]}):W.media.type==="Video"?oe.jsxs(LE,{media:W.media,mediaControlsDeps:S,children:[je,p?p(W):null]}):W.media.type==="VideoYouTube"&&L?oe.jsxs(SD,{media:W.media,mediaControlsDeps:S,children:[je,p?p(W):null]}):null}):null]},`${j.id}/${W.type}/${ce}`),W.type==="media"&&W.media.type==="Sound"&&Ue?oe.jsx(zd,{canvas:Ue.id,children:oe.jsx(HE,{renderViewerControls:f})}):null]})}function VE(){const t=T.useContext(bc);return t&&t.vault?t.vault:qS()}const bD=T.forwardRef(function(e,n){const i=ya(),a=Hv(),u=tb(),{ViewerControls:f,MediaControls:p}=e.components||{};if(T.useImperativeHandle(n,()=>u,[u]),!i)return oe.jsx("div",{});let g=0;return oe.jsxs(oe.Fragment,{children:[e.header,oe.jsx(Ti.Viewer,{height:e.height,mode:e.mode,children:a.map((S,m)=>{const x=g;return g+=S.width+(e.spacing||0),oe.jsx(zd,{canvas:S.id,children:oe.jsx(Ti.RenderCanvas,{strategies:["3d-model","media","images","empty","textual-content"],renderViewerControls:m===0&&f?()=>oe.jsx(f,{}):void 0,renderMediaControls:m===0&&p?()=>oe.jsx(p,{}):void 0,x,...e.canvasProps||{},children:e.annotations},S.id)},S.id)})},e.reuseAtlas?"":u.currentSequenceIndex),e.children]})}),Ti=T.forwardRef(function({children:e,height:n,annotations:i,canvasProps:a,spacing:u,header:f,components:p,mode:g,...S},m){const x=VE();return oe.jsx(Fv,{vault:x,children:oe.jsx(eb,{...S,children:oe.jsx(bD,{ref:m,height:n,components:p,spacing:u,canvasProps:a,annotations:i,header:f,mode:g,children:e})})})});Ti.RenderImage=Rb,Ti.RenderCanvas=HE,Ti.RenderAnnotationPage=Jv,Ti.RenderAnnotation=Cb,Ti.Viewer=yL,Ti.CanvasBackground=kE,Ti.Audio=OE,Ti.Video=LE,Ti.Model=DE,Ti.AudioHTML=ME,Ti.VideoHTML=_E,Ti.ModelHTML=PE;function ED({annotation:t,children:e}){return oe.jsx(ca,{value:{annotation:t},children:e})}function xD({annotationPage:t,children:e}){return oe.jsx(ca,{value:{annotationPage:t},children:e})}function wD({collection:t,children:e}){return oe.jsx(ca,{value:{collection:t},children:e})}function CD(t,e={}){return qd(e)}function TD(t,e=!1){}function RD(t){const n=As().manifest,i=t?t.map(a=>typeof a=="string"?a:a==null?void 0:a.id):[];return ni(a=>{const u=n?a.iiif.entities.Manifest[n]:void 0,f=(u==null?void 0:u.items)||[];if(typeof t>"u")return f;const p=[];for(const g of(u==null?void 0:u.items)||[])i.indexOf(g.id)!==-1&&p.push(g);return p},[i.join("/")])}function AD(t,e=[]){const{id:n,selector:i}=t,a=As(),u=n||a.collection,f=ni(p=>u?p.iiif.entities.Collection[u]:void 0,[u]);return T.useMemo(()=>{if(f)return i?i(f):f},[f,i,...e])}function MD(t,e,n,i,a=[]){const u=Un(),f=T.useMemo(()=>vb(u),[u]);T.useEffect(()=>{const p=t;return p?(f.addEventListener(p,e,n,i),()=>{f.removeEventListener(p,e,n)}):()=>{}},[f,t,e,...a])}function OD(t,e){const{id:n,isLoaded:i,error:a,resource:u,requestId:f,cached:p}=Bv(t,e);return{id:n,isLoaded:i,error:a,manifest:u,requestId:f,cached:p}}function $E({cacheKey:t}={}){const e=Jr(),n=qd(),i=Un(),a=Wd(),[u,f]=T.useState(void 0),[p,g]=T.useState(!1),[S,m]=T.useState("idle"),[x,R]=T.useState(void 0),_=e?e.id:"undefined",M=T.useMemo(()=>{try{if(e&&n.length){const L=n[0],P=i.get(L.body[0]),j=Ka.getImageServices(P)[0];return j&&a.loadServiceSync({id:j.id||j["@id"],width:j.width||e.width,height:j.height||e.height})||void 0}}catch(L){console.error(L)}},[_,t,e]),k=S==="success"&&u?u:M;return T.useEffect(()=>{(async()=>{try{if(e&&n.length){const L=n[0],P=i.get(L.body[0]),j=Ka.getImageServices(P)[0];if(!j)return;g(!0),m("loading");try{const q=await a.loadService({id:j.id||j["@id"],width:j.width||e.width,height:j.height||e.height})||void 0;f(q),m("success"),g(!1)}catch(q){m("error"),R(q)}}}catch(L){m("error"),R(L)}})()},[_,t]),T.useMemo(()=>({data:k,isFetching:p,status:S,error:x}),[k,p,S,x])}function _D(){const t=$E();return{isLoading:t.isFetching,tile:t.data?{id:t.data.id||t.data["@id"],width:t.data.width,height:t.data.height,imageService:t.data,thumbnail:void 0}:null}}function LD(){const t=ya();return t?t.service.find(e=>e.profile==="SearchService1"||e.profile==="http://iiif.io/api/search/1/search"):void 0}function PD(){const t=Un();return T.useMemo(()=>Qv(t),[t])}var Vl={},cm,fm,Lc=by;if(process.env.NODE_ENV==="production")fm=Vl.createRoot=Lc.createRoot,cm=Vl.hydrateRoot=Lc.hydrateRoot;else{var Kd=Lc.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;fm=Vl.createRoot=function(t,e){Kd.usingClientEntryPoint=!0;try{return Lc.createRoot(t,e)}finally{Kd.usingClientEntryPoint=!1}},cm=Vl.hydrateRoot=function(t,e,n){Kd.usingClientEntryPoint=!0;try{return Lc.hydrateRoot(t,e,n)}finally{Kd.usingClientEntryPoint=!1}}}const DD=tC({__proto__:null,get createRoot(){return fm},default:Vl,get hydrateRoot(){return cm}},[Vl]);fe.AnnotationContext=ED,fe.AnnotationPageContext=xD,fe.CanvasContext=zd,fe.CanvasPanel=Ti,fe.CollectionContext=wD,fe.ContextBridge=ib,fe.ImageServiceLoaderContext=cE,fe.InnerViewerProvider=JS,fe.LanguageProvider=mD,fe.LanguageString=zE,fe.LocaleString=BE,fe.ManifestContext=QS,fe.MediaPlayerProvider=um,fe.RangeContext=GS,fe.ReactVaultContext=bc,fe.ResourceProvider=ca,fe.ResourceReactContext=kd,fe.SimpleViewerProvider=eb,fe.SimpleViewerReactContext=wc,fe.VaultProvider=Fv,fe.ViewerPresetContext=Ud,fe.VirtualAnnotationProvider=ub,fe.VisibleCanvasReactContext=Ec,fe.emptyActions=sE,fe.emptyStrategy=aE,fe.expandTarget=Sa,fe.findAllCanvasesInRange=Vv,fe.findFirstCanvasFromRange=XS,fe.findManifestSelectedRange=Q_,fe.findSelectedRange=$v,fe.flattenAnnotationPageIds=oE,fe.formatTime=CE,fe.get3dStrategy=pE,fe.getImageStrategy=vE,fe.getManifestSequence=Wv,fe.getParsedTargetSelector=lm,fe.getRenderingStrategy=SE,fe.getTextualContentStrategy=gE,fe.getVideoStrategy=yE,fe.getVisibleCanvasesFromCanvasId=G_,fe.isImageApiSelector=xb,fe.parseRotation=wb,fe.parseSelector=Ac,fe.parseSpecificResource=eD,fe.unknownResponse=$d,fe.unsupportedStrategy=Pn,fe.useAnnotation=Zv,fe.useAnnotationPage=Tb,fe.useAnnotationPageManager=lE,fe.useAnnotationsAtTime=CD,fe.useCanvas=Jr,fe.useCanvasClock=TD,fe.useCanvasSequence=ZS,fe.useCanvasSubset=RD,fe.useClosestLanguage=jE,fe.useCollection=AD,fe.useContextBridge=nb,fe.useCreateLocaleString=gD,fe.useDispatch=rb,fe.useEventListener=MD,fe.useExistingVault=VE,fe.useExternalCollection=OD,fe.useExternalManifest=YS,fe.useExternalResource=Bv,fe.useIIIFLanguage=Xd,fe.useImageService=$E,fe.useImageServiceLoader=Wd,fe.useImageTile=_D,fe.useLoadImageService=fE,fe.useLocaleString=FE,fe.useManifest=ya,fe.useMediaActions=pD,fe.useMediaElements=vD,fe.useMediaState=hD,fe.usePaintables=hE,fe.usePaintingAnnotations=qd,fe.useRange=KS,fe.useRenderingStrategy=bE,fe.useResourceContext=As,fe.useResourceEvents=Yv,fe.useResources=uE,fe.useSearchService=LD,fe.useSimpleMediaPlayer=Gd,fe.useSimpleViewer=tb,fe.useStyleHelper=PD,fe.useStyles=Cc,fe.useThumbnail=wE,fe.useVault=Un,fe.useVaultEffect=EE,fe.useVaultSelector=ni,fe.useViewerPreset=cb,fe.useVirtualAnnotationPage=ab,fe.useVirtualAnnotationPageContext=lb,fe.useVisibleCanvases=Hv,Object.defineProperty(fe,Symbol.toStringTag,{value:"Module"})});
|
|
390
|
+
`}),le.jsx("iframe",{className:"video-yt",ref:r,src:`https://www.youtube.com/embed/${e.youTubeId}?enablejsapi=1&origin=${window.location.host}`,referrerPolicy:"no-referrer",sandbox:"allow-scripts allow-same-origin allow-presentation"})]}):null}function XM({media:t,mediaControlsDeps:e,children:n}){const[{element:r,currentTime:o,progress:c},h,v]=md({duration:t.duration});return fl("overlay","video-element",GM,{element:r,media:t,playPause:v.playPause}),null}function AS({x:t,y:e,onChoiceChange:n,registerActions:r,defaultChoices:o,isStatic:c,renderViewerControls:h,renderMediaControls:v,viewControlsDeps:g,mediaControlsDeps:x,strategies:m,throwOnUnknown:w,backgroundStyle:A,alwaysShowBackground:P,keepCanvasScale:M=!1,enableSizes:_=!1,enableYouTube:L=!0,onClickPaintingAnnotation:k,children:O}){const I=$r(),q=Hp(I,["deep-zoom"]),[te]=Y0(),H=G0(),J=kn(),re=C.useMemo(()=>Vp(J),[J]),[$,se]=sS({strategies:m||["images"],defaultChoices:o==null?void 0:o.map(({id:Z})=>Z)}),ge=$.type==="images"?$.choice:void 0,Ce=C.useMemo(()=>M?1:Math.max(1,...$.type==="images"?$.images.map(Z=>{var Ue;return(Z.width||0)/((Ue=Z.target)==null?void 0:Ue.spatial.width)}):[]),[M,$]);QR(Ce),C.useEffect(()=>{r&&r(se)},[$.annotations]),C.useEffect(()=>{if(o)for(const Z of o)typeof Z.opacity<"u"&&re.applyStyles({id:Z.id},"atlas",{opacity:Z.opacity})},[o]),C.useLayoutEffect(()=>{n&&n(ge)},[ge]),fl(H&&($.type==="images"||$.type==="empty"||$.type==="textual-content"&&h)?"overlay":"none",`canvas-portal-controls-${I==null?void 0:I.id}`,sd.Provider,h?{value:H||null,children:h($)}:{},[I,H,$,...g||[]]);const me=lS({maxWidth:256,maxHeight:256});if(!I)return null;const Ie=I.accompanyingCanvas,_e=me&&me.type==="fixed"?le.jsx("world-object",{height:I.height,width:I.width,x:t,y:e,children:le.jsx("world-image",{uri:me.id,target:{x:0,y:0,width:I.width,height:I.height},display:me.width&&me.height?{width:me.width,height:me.height}:void 0,crop:void 0})}):null;if($.type==="unknown"){if(_e)return _e;if(w)throw new Error($.reason||"Unknown image strategy");return null}const Ye=le.jsxs(C.Fragment,{children:[te?le.jsx(Qp,{page:te}):null,$.annotations&&$.annotations.pages?$.annotations.pages.map(Z=>le.jsx(Qp,{page:Z},Z.id)):null,O]}),gt=$.type==="images"?$.images.length:0;return le.jsxs(le.Fragment,{children:[le.jsxs("world-object",{height:I.height,width:I.width,x:t,y:e,...q,children:[$.type==="empty"||P?le.jsx(SS,{style:A}):null,$.type==="textual-content"?$.items.map((Z,Ue)=>{var dt;return le.jsxs(le.Fragment,{children:[le.jsx(kp,{onClick:k?pe=>{pe.stopPropagation(),k(Z.annotationId,Z,pe)}:void 0,target:((dt=Z.target)==null?void 0:dt.spatial)||void 0,children:le.jsx("div",{"data-textual-content":!0,children:le.jsx(RS,{enableDangerouslySetInnerHTML:!0,children:Z.text})})},Ue),Ye]})}):null,$.type==="images"?le.jsxs(le.Fragment,{children:[$.images.map((Z,Ue)=>le.jsx(f1,{isStatic:c,image:Z,id:Z.id,thumbnail:Ue===0?me:void 0,selector:Z.selector,enableSizes:_,onClick:k?dt=>{dt.stopPropagation(),k(Z.annotationId,Z,dt)}:void 0},Z.id+Ue)),Ye]}):null,$.type==="3d-model"?le.jsx(yS,{model:$.model}):null,$.type==="media"?le.jsx(le.Fragment,{children:$.media.type==="Sound"?le.jsxs(pS,{media:$.media,mediaControlsDeps:x,children:[_e,v?v($):null]}):$.media.type==="Video"?le.jsxs(mS,{media:$.media,mediaControlsDeps:x,children:[_e,v?v($):null]}):$.media.type==="VideoYouTube"&&L?le.jsxs(XM,{media:$.media,mediaControlsDeps:x,children:[_e,v?v($):null]}):null}):null]},`${I.id}/${$.type}/${gt}`),$.type==="media"&&$.media.type==="Sound"&&Ie?le.jsx(rd,{canvas:Ie.id,children:le.jsx(AS,{renderViewerControls:h})}):null]})}function MS(){const t=C.useContext(Bu);return t&&t.vault?t.vault:cf.globalVault()}const KM=C.forwardRef(function(e,n){const r=ea(),o=Up(),c=F0(),{ViewerControls:h,MediaControls:v}=e.components||{};if(C.useImperativeHandle(n,()=>c,[c]),!r)return le.jsx("div",{});let g=0;return le.jsxs(le.Fragment,{children:[e.header,le.jsx(Si.Viewer,{height:e.height,mode:e.mode,children:o.map((x,m)=>{const w=g;return g+=x.width+(e.spacing||0),le.jsx(rd,{canvas:x.id,children:le.jsx(Si.RenderCanvas,{strategies:["3d-model","media","images","empty","textual-content"],renderViewerControls:m===0&&h?()=>le.jsx(h,{}):void 0,renderMediaControls:m===0&&v?()=>le.jsx(v,{}):void 0,x:w,...e.canvasProps||{},children:e.annotations},x.id)},x.id)})},e.reuseAtlas?"":c.currentSequenceIndex),e.children]})}),Si=C.forwardRef(function({children:e,height:n,annotations:r,canvasProps:o,spacing:c,header:h,components:v,mode:g,...x},m){const w=MS();return le.jsx(Np,{vault:w,children:le.jsx(I0,{...x,children:le.jsx(KM,{ref:m,height:n,components:v,spacing:c,canvasProps:o,annotations:r,header:h,mode:g,children:e})})})});Si.RenderImage=f1,Si.RenderCanvas=AS,Si.RenderAnnotationPage=Qp,Si.RenderAnnotation=u1,Si.Viewer=GR,Si.CanvasBackground=SS,Si.Audio=pS,Si.Video=mS,Si.Model=yS,Si.AudioHTML=hS,Si.VideoHTML=vS,Si.ModelHTML=gS;function ZM({annotation:t,children:e}){return le.jsx(Js,{value:{annotation:t},children:e})}function JM({annotationPage:t,children:e}){return le.jsx(Js,{value:{annotationPage:t},children:e})}function eO({collection:t,children:e}){return le.jsx(Js,{value:{collection:t},children:e})}function tO(t,e={}){return hd(e)}function nO(t,e=!1){}function iO(t){const n=Ss().manifest,r=t?t.map(o=>typeof o=="string"?o:o==null?void 0:o.id):[];return Kn(o=>{const c=n?o.iiif.entities.Manifest[n]:void 0,h=(c==null?void 0:c.items)||[];if(typeof t>"u")return h;const v=[];for(const g of(c==null?void 0:c.items)||[])r.indexOf(g.id)!==-1&&v.push(g);return v},[r.join("/")])}function rO(t,e=[]){const{id:n,selector:r}=t,o=Ss(),c=n||o.collection,h=Kn(v=>c?v.iiif.entities.Collection[c]:void 0,[c]);return C.useMemo(()=>{if(h)return r?r(h):h},[h,r,...e])}function sO(t,e,n,r,o=[]){const c=kn(),h=C.useMemo(()=>e1(c),[c]);C.useEffect(()=>{const v=t;return v?(h.addEventListener(v,e,n,r),()=>{h.removeEventListener(v,e,n)}):()=>{}},[h,t,e,...o])}function aO(t,e){const{id:n,isLoaded:r,error:o,resource:c,requestId:h,cached:v}=_p(t,e);return{id:n,isLoaded:r,error:o,manifest:c,requestId:h,cached:v}}function OS({cacheKey:t}={}){const e=$r(),n=hd(),r=kn(),o=dd(),[c,h]=C.useState(void 0),[v,g]=C.useState(!1),[x,m]=C.useState("idle"),[w,A]=C.useState(void 0),P=e?e.id:"undefined",M=C.useMemo(()=>{try{if(e&&n.length){const L=n[0],k=r.get(L.body[0]),I=ka.getImageServices(k)[0];return I&&o.loadServiceSync({id:I.id||I["@id"],width:I.width||e.width,height:I.height||e.height})||void 0}}catch(L){console.error(L)}},[P,t,e]),_=x==="success"&&c?c:M;return C.useEffect(()=>{(async()=>{try{if(e&&n.length){const L=n[0],k=r.get(L.body[0]),I=ka.getImageServices(k)[0];if(!I)return;g(!0),m("loading");try{const q=await o.loadService({id:I.id||I["@id"],width:I.width||e.width,height:I.height||e.height})||void 0;h(q),m("success"),g(!1)}catch(q){m("error"),A(q)}}}catch(L){m("error"),A(L)}})()},[P,t]),C.useMemo(()=>({data:_,isFetching:v,status:x,error:w}),[_,v,x,w])}function oO(){const t=OS();return{isLoading:t.isFetching,tile:t.data?{id:t.data.id||t.data["@id"],width:t.data.width,height:t.data.height,imageService:t.data,thumbnail:void 0}:null}}function lO(){const t=ea();return t?t.service.find(e=>e.profile==="SearchService1"||e.profile==="http://iiif.io/api/search/1/search"):void 0}function uO(){const t=kn();return C.useMemo(()=>Vp(t),[t])}var pl={},sv,av,Zu=vg;if(process.env.NODE_ENV==="production")av=pl.createRoot=Zu.createRoot,sv=pl.hydrateRoot=Zu.hydrateRoot;else{var yd=Zu.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;av=pl.createRoot=function(t,e){yd.usingClientEntryPoint=!0;try{return Zu.createRoot(t,e)}finally{yd.usingClientEntryPoint=!1}},sv=pl.hydrateRoot=function(t,e,n){yd.usingClientEntryPoint=!0;try{return Zu.hydrateRoot(t,e,n)}finally{yd.usingClientEntryPoint=!1}}}const cO=Fx({__proto__:null,get createRoot(){return av},default:pl,get hydrateRoot(){return sv}},[pl]);fe.AnnotationContext=ZM,fe.AnnotationPageContext=JM,fe.CanvasContext=rd,fe.CanvasPanel=Si,fe.CollectionContext=eO,fe.ContextBridge=H0,fe.ImageServiceLoaderContext=G1,fe.InnerViewerProvider=j0,fe.LanguageProvider=YM,fe.LanguageString=ES,fe.LocaleString=RS,fe.ManifestContext=k0,fe.MediaPlayerProvider=rv,fe.RangeContext=z0,fe.ReactVaultContext=Bu,fe.ResourceProvider=Js,fe.ResourceReactContext=id,fe.SimpleViewerProvider=I0,fe.SimpleViewerReactContext=Wu,fe.VaultProvider=Np,fe.ViewerPresetContext=sd,fe.VirtualAnnotationProvider=Q0,fe.VisibleCanvasReactContext=Hu,fe.emptyActions=W1,fe.emptyStrategy=$1,fe.expandTarget=ta,fe.findAllCanvasesInRange=jp,fe.findFirstCanvasFromRange=N0,fe.findManifestSelectedRange=CR,fe.findSelectedRange=Ip,fe.flattenAnnotationPageIds=q1,fe.formatTime=uS,fe.get3dStrategy=J1,fe.getImageStrategy=eS,fe.getManifestSequence=Fp,fe.getParsedTargetSelector=iv,fe.getRenderingStrategy=rS,fe.getTextualContentStrategy=nS,fe.getVideoStrategy=iS,fe.getVisibleCanvasesFromCanvasId=RR,fe.isImageApiSelector=o1,fe.parseRotation=l1,fe.parseSelector=Qu,fe.parseSpecificResource=LM,fe.unknownResponse=fd,fe.unsupportedStrategy=Mn,fe.useAnnotation=Yp,fe.useAnnotationPage=c1,fe.useAnnotationPageManager=Y1,fe.useAnnotationsAtTime=tO,fe.useCanvas=$r,fe.useCanvasClock=nO,fe.useCanvasSequence=U0,fe.useCanvasSubset=iO,fe.useClosestLanguage=TS,fe.useCollection=rO,fe.useContextBridge=B0,fe.useCreateLocaleString=QM,fe.useDispatch=V0,fe.useEventListener=sO,fe.useExistingVault=MS,fe.useExternalCollection=aO,fe.useExternalManifest=P0,fe.useExternalResource=_p,fe.useIIIFLanguage=gd,fe.useImageService=OS,fe.useImageServiceLoader=dd,fe.useImageTile=oO,fe.useLoadImageService=X1,fe.useLocaleString=CS,fe.useManifest=ea,fe.useMediaActions=$M,fe.useMediaElements=qM,fe.useMediaState=WM,fe.usePaintables=Z1,fe.usePaintingAnnotations=hd,fe.useRange=_0,fe.useRenderingStrategy=sS,fe.useResourceContext=Ss,fe.useResourceEvents=Hp,fe.useResources=Q1,fe.useSearchService=lO,fe.useSimpleMediaPlayer=md,fe.useSimpleViewer=F0,fe.useStyleHelper=uO,fe.useStyles=$u,fe.useThumbnail=lS,fe.useVault=kn,fe.useVaultEffect=aS,fe.useVaultSelector=Kn,fe.useViewerPreset=G0,fe.useVirtualAnnotationPage=$0,fe.useVirtualAnnotationPageContext=Y0,fe.useVisibleCanvases=Up,Object.defineProperty(fe,Symbol.toStringTag,{value:"Module"})});
|
|
395
391
|
//# sourceMappingURL=index.umd.js.map
|