@camstack/addon-admin-ui 0.1.14 → 0.1.15
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/dist/assets/__mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.mjs-CKfGBI-Z.js +1 -0
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.mjs_commonjs-proxy-CykPKLuU.js +1 -0
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_client__loadShare__.mjs-DIkg6-MH.js +6 -0
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_client__loadShare__.mjs_commonjs-proxy-WD2WouMQ.js +1 -0
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.mjs-xMlwAAY4.js +1 -0
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.mjs_commonjs-proxy-Clpxla3F.js +1 -0
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare__react__loadShare__.mjs-B_akQFxJ.js +9 -0
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare__react__loadShare__.mjs_commonjs-proxy-BZBxNMgx.js +1 -0
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-C_6K4VBY.js +9 -0
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs_commonjs-proxy-DrLZNXOX.js +1 -0
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.mjs-CCRqQaXq.js +9 -0
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-B5D3mvYP.js +1 -0
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs-CRHuTm5p.js +25 -0
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs_commonjs-proxy-XIS4Ck9-.js +1 -0
- package/dist/assets/_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-D4TBsvIB.js +1 -0
- package/dist/assets/capability-router-map-Bqwnkkax.js +1 -0
- package/dist/assets/devices-CFL4MLSo.js +511 -0
- package/dist/assets/hostInit-DpSCsYyA.js +1 -0
- package/dist/assets/index-BP0PcGIN.js +1 -0
- package/dist/assets/index-BQVATbZy.js +5 -0
- package/dist/assets/index-BZhZ3Jvf.js +1 -0
- package/dist/assets/index-BfdtdylV.js +533 -0
- package/dist/assets/index-BkJ1uzOh.js +8420 -0
- package/dist/assets/index-BuajxCgS.js +1 -0
- package/dist/assets/index-CKMQgnc3.js +1 -0
- package/dist/assets/index-DAq7g5_U.js +1 -0
- package/dist/assets/index-DRebE_bu.js +22 -0
- package/dist/assets/index-DUjRaULz.js +1 -0
- package/dist/assets/index-OcuNiGT5.js +34 -0
- package/dist/assets/index-R6tzT59K.css +1 -0
- package/dist/assets/index-pmj5N6Ix.js +5 -0
- package/dist/assets/preload-helper-BlTxHScW.js +1 -0
- package/dist/assets/remoteEntry-0zDoMSWf.js +1 -0
- package/dist/assets/schemas-BOzikgNT.js +64 -0
- package/dist/assets/virtualExposes-_ivNhQLP.js +1 -0
- package/dist/assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-BnGk9xo_.js +8 -0
- package/dist/index.html +10 -14
- package/dist/mf-entry-bootstrap-0.js +17 -0
- package/dist/server/addon.d.ts +7 -6
- package/dist/server/addon.js +14 -25
- package/dist/server/addon.js.map +1 -1
- package/dist/sw.js +1 -1
- package/dist/workbox-9c191d2f.js +1 -0
- package/package.json +10 -5
- package/dist/assets/index-B2uWw-6M.js +0 -603
- package/dist/assets/index-QE1phGlM.css +0 -1
- package/dist/vendor/react-dom-client.mjs +0 -4
- package/dist/vendor/react-dom.mjs +0 -7
- package/dist/vendor/react-jsx-runtime.mjs +0 -24
- package/dist/vendor/react.mjs +0 -16
- package/dist/workbox-b20fbdff.js +0 -1
|
@@ -1,603 +0,0 @@
|
|
|
1
|
-
var H7=Object.defineProperty;var S2=t=>{throw TypeError(t)};var B7=(t,e,n)=>e in t?H7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Yp=(t,e,n)=>B7(t,typeof e!="symbol"?e+"":e,n),Qy=(t,e,n)=>e.has(t)||S2("Cannot "+n);var Q=(t,e,n)=>(Qy(t,e,"read from private field"),n?n.call(t):e.get(t)),He=(t,e,n)=>e.has(t)?S2("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Ae=(t,e,n,s)=>(Qy(t,e,"write to private field"),s?s.call(t,n):e.set(t,n),n),We=(t,e,n)=>(Qy(t,e,"access private method"),n);var q0=(t,e,n,s)=>({set _(i){Ae(t,e,i,n)},get _(){return Q(t,e,s)}});function Yb(t,e){for(var n=0;n<e.length;n++){const s=e[n];if(typeof s!="string"&&!Array.isArray(s)){for(const i in s)if(i!=="default"&&!(i in t)){const o=Object.getOwnPropertyDescriptor(s,i);o&&Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:()=>s[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const d of o.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&s(d)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function k1(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ky={exports:{}},Vp={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var N2;function G7(){if(N2)return Vp;N2=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(s,i,o){var d=null;if(o!==void 0&&(d=""+o),i.key!==void 0&&(d=""+i.key),"key"in i){o={};for(var f in i)f!=="key"&&(o[f]=i[f])}else o=i;return i=o.ref,{$$typeof:t,type:s,key:d,ref:i!==void 0?i:null,props:o}}return Vp.Fragment=e,Vp.jsx=n,Vp.jsxs=n,Vp}var _2;function P7(){return _2||(_2=1,Ky.exports=G7()),Ky.exports}var h=P7(),Xy={exports:{}},lt={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react.production.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var C2;function Y7(){if(C2)return lt;C2=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),_=Symbol.iterator;function j(B){return B===null||typeof B!="object"?null:(B=_&&B[_]||B["@@iterator"],typeof B=="function"?B:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,O={};function R(B,I,fe){this.props=B,this.context=I,this.refs=O,this.updater=fe||w}R.prototype.isReactComponent={},R.prototype.setState=function(B,I){if(typeof B!="object"&&typeof B!="function"&&B!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,B,I,"setState")},R.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function M(){}M.prototype=R.prototype;function z(B,I,fe){this.props=B,this.context=I,this.refs=O,this.updater=fe||w}var k=z.prototype=new M;k.constructor=z,T(k,R.prototype),k.isPureReactComponent=!0;var G=Array.isArray;function P(){}var L={H:null,A:null,T:null,S:null},U=Object.prototype.hasOwnProperty;function V(B,I,fe){var xe=fe.ref;return{$$typeof:t,type:B,key:I,ref:xe!==void 0?xe:null,props:fe}}function Z(B,I){return V(B.type,I,B.props)}function re(B){return typeof B=="object"&&B!==null&&B.$$typeof===t}function ne(B){var I={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(fe){return I[fe]})}var W=/\/+/g;function ie(B,I){return typeof B=="object"&&B!==null&&B.key!=null?ne(""+B.key):I.toString(36)}function ce(B){switch(B.status){case"fulfilled":return B.value;case"rejected":throw B.reason;default:switch(typeof B.status=="string"?B.then(P,P):(B.status="pending",B.then(function(I){B.status==="pending"&&(B.status="fulfilled",B.value=I)},function(I){B.status==="pending"&&(B.status="rejected",B.reason=I)})),B.status){case"fulfilled":return B.value;case"rejected":throw B.reason}}throw B}function Y(B,I,fe,xe,_e){var Ce=typeof B;(Ce==="undefined"||Ce==="boolean")&&(B=null);var ze=!1;if(B===null)ze=!0;else switch(Ce){case"bigint":case"string":case"number":ze=!0;break;case"object":switch(B.$$typeof){case t:case e:ze=!0;break;case S:return ze=B._init,Y(ze(B._payload),I,fe,xe,_e)}}if(ze)return _e=_e(B),ze=xe===""?"."+ie(B,0):xe,G(_e)?(fe="",ze!=null&&(fe=ze.replace(W,"$&/")+"/"),Y(_e,I,fe,"",function(Vt){return Vt})):_e!=null&&(re(_e)&&(_e=Z(_e,fe+(_e.key==null||B&&B.key===_e.key?"":(""+_e.key).replace(W,"$&/")+"/")+ze)),I.push(_e)),1;ze=0;var Ee=xe===""?".":xe+":";if(G(B))for(var we=0;we<B.length;we++)xe=B[we],Ce=Ee+ie(xe,we),ze+=Y(xe,I,fe,Ce,_e);else if(we=j(B),typeof we=="function")for(B=we.call(B),we=0;!(xe=B.next()).done;)xe=xe.value,Ce=Ee+ie(xe,we++),ze+=Y(xe,I,fe,Ce,_e);else if(Ce==="object"){if(typeof B.then=="function")return Y(ce(B),I,fe,xe,_e);throw I=String(B),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.")}return ze}function $(B,I,fe){if(B==null)return B;var xe=[],_e=0;return Y(B,xe,"","",function(Ce){return I.call(fe,Ce,_e++)}),xe}function ae(B){if(B._status===-1){var I=B._result;I=I(),I.then(function(fe){(B._status===0||B._status===-1)&&(B._status=1,B._result=fe)},function(fe){(B._status===0||B._status===-1)&&(B._status=2,B._result=fe)}),B._status===-1&&(B._status=0,B._result=I)}if(B._status===1)return B._result.default;throw B._result}var Ne=typeof reportError=="function"?reportError:function(B){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var I=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof B=="object"&&B!==null&&typeof B.message=="string"?String(B.message):String(B),error:B});if(!window.dispatchEvent(I))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",B);return}console.error(B)},me={map:$,forEach:function(B,I,fe){$(B,function(){I.apply(this,arguments)},fe)},count:function(B){var I=0;return $(B,function(){I++}),I},toArray:function(B){return $(B,function(I){return I})||[]},only:function(B){if(!re(B))throw Error("React.Children.only expected to receive a single React element child.");return B}};return lt.Activity=b,lt.Children=me,lt.Component=R,lt.Fragment=n,lt.Profiler=i,lt.PureComponent=z,lt.StrictMode=s,lt.Suspense=p,lt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,lt.__COMPILER_RUNTIME={__proto__:null,c:function(B){return L.H.useMemoCache(B)}},lt.cache=function(B){return function(){return B.apply(null,arguments)}},lt.cacheSignal=function(){return null},lt.cloneElement=function(B,I,fe){if(B==null)throw Error("The argument must be a React element, but you passed "+B+".");var xe=T({},B.props),_e=B.key;if(I!=null)for(Ce in I.key!==void 0&&(_e=""+I.key),I)!U.call(I,Ce)||Ce==="key"||Ce==="__self"||Ce==="__source"||Ce==="ref"&&I.ref===void 0||(xe[Ce]=I[Ce]);var Ce=arguments.length-2;if(Ce===1)xe.children=fe;else if(1<Ce){for(var ze=Array(Ce),Ee=0;Ee<Ce;Ee++)ze[Ee]=arguments[Ee+2];xe.children=ze}return V(B.type,_e,xe)},lt.createContext=function(B){return B={$$typeof:d,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null},B.Provider=B,B.Consumer={$$typeof:o,_context:B},B},lt.createElement=function(B,I,fe){var xe,_e={},Ce=null;if(I!=null)for(xe in I.key!==void 0&&(Ce=""+I.key),I)U.call(I,xe)&&xe!=="key"&&xe!=="__self"&&xe!=="__source"&&(_e[xe]=I[xe]);var ze=arguments.length-2;if(ze===1)_e.children=fe;else if(1<ze){for(var Ee=Array(ze),we=0;we<ze;we++)Ee[we]=arguments[we+2];_e.children=Ee}if(B&&B.defaultProps)for(xe in ze=B.defaultProps,ze)_e[xe]===void 0&&(_e[xe]=ze[xe]);return V(B,Ce,_e)},lt.createRef=function(){return{current:null}},lt.forwardRef=function(B){return{$$typeof:f,render:B}},lt.isValidElement=re,lt.lazy=function(B){return{$$typeof:S,_payload:{_status:-1,_result:B},_init:ae}},lt.memo=function(B,I){return{$$typeof:y,type:B,compare:I===void 0?null:I}},lt.startTransition=function(B){var I=L.T,fe={};L.T=fe;try{var xe=B(),_e=L.S;_e!==null&&_e(fe,xe),typeof xe=="object"&&xe!==null&&typeof xe.then=="function"&&xe.then(P,Ne)}catch(Ce){Ne(Ce)}finally{I!==null&&fe.types!==null&&(I.types=fe.types),L.T=I}},lt.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},lt.use=function(B){return L.H.use(B)},lt.useActionState=function(B,I,fe){return L.H.useActionState(B,I,fe)},lt.useCallback=function(B,I){return L.H.useCallback(B,I)},lt.useContext=function(B){return L.H.useContext(B)},lt.useDebugValue=function(){},lt.useDeferredValue=function(B,I){return L.H.useDeferredValue(B,I)},lt.useEffect=function(B,I){return L.H.useEffect(B,I)},lt.useEffectEvent=function(B){return L.H.useEffectEvent(B)},lt.useId=function(){return L.H.useId()},lt.useImperativeHandle=function(B,I,fe){return L.H.useImperativeHandle(B,I,fe)},lt.useInsertionEffect=function(B,I){return L.H.useInsertionEffect(B,I)},lt.useLayoutEffect=function(B,I){return L.H.useLayoutEffect(B,I)},lt.useMemo=function(B,I){return L.H.useMemo(B,I)},lt.useOptimistic=function(B,I){return L.H.useOptimistic(B,I)},lt.useReducer=function(B,I,fe){return L.H.useReducer(B,I,fe)},lt.useRef=function(B){return L.H.useRef(B)},lt.useState=function(B){return L.H.useState(B)},lt.useSyncExternalStore=function(B,I,fe){return L.H.useSyncExternalStore(B,I,fe)},lt.useTransition=function(){return L.H.useTransition()},lt.version="19.2.4",lt}var j2;function gl(){return j2||(j2=1,Xy.exports=Y7()),Xy.exports}var D=gl();const $t=k1(D),V7=Yb({__proto__:null,default:$t},[D]);var Fy={exports:{}},xs={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* react-dom.production.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var w2;function Q7(){if(w2)return xs;w2=1;var t=gl();function e(p){var y="https://react.dev/errors/"+p;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var S=2;S<arguments.length;S++)y+="&args[]="+encodeURIComponent(arguments[S])}return"Minified React error #"+p+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var s={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function o(p,y,S){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:b==null?null:""+b,children:p,containerInfo:y,implementation:S}}var d=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(p,y){if(p==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return xs.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,xs.createPortal=function(p,y){var S=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(e(299));return o(p,y,null,S)},xs.flushSync=function(p){var y=d.T,S=s.p;try{if(d.T=null,s.p=2,p)return p()}finally{d.T=y,s.p=S,s.d.f()}},xs.preconnect=function(p,y){typeof p=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,s.d.C(p,y))},xs.prefetchDNS=function(p){typeof p=="string"&&s.d.D(p)},xs.preinit=function(p,y){if(typeof p=="string"&&y&&typeof y.as=="string"){var S=y.as,b=f(S,y.crossOrigin),_=typeof y.integrity=="string"?y.integrity:void 0,j=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;S==="style"?s.d.S(p,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:b,integrity:_,fetchPriority:j}):S==="script"&&s.d.X(p,{crossOrigin:b,integrity:_,fetchPriority:j,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},xs.preinitModule=function(p,y){if(typeof p=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var S=f(y.as,y.crossOrigin);s.d.M(p,{crossOrigin:S,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0})}}else y==null&&s.d.M(p)},xs.preload=function(p,y){if(typeof p=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var S=y.as,b=f(S,y.crossOrigin);s.d.L(p,S,{crossOrigin:b,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},xs.preloadModule=function(p,y){if(typeof p=="string")if(y){var S=f(y.as,y.crossOrigin);s.d.m(p,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:S,integrity:typeof y.integrity=="string"?y.integrity:void 0})}else s.d.m(p)},xs.requestFormReset=function(p){s.d.r(p)},xs.unstable_batchedUpdates=function(p,y){return p(y)},xs.useFormState=function(p,y,S){return d.H.useFormState(p,y,S)},xs.useFormStatus=function(){return d.H.useHostTransitionStatus()},xs.version="19.2.4",xs}var E2;function L1(){if(E2)return Fy.exports;E2=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Fy.exports=Q7(),Fy.exports}var S4=L1();const K7=k1(S4),X7=Yb({__proto__:null,default:K7},[S4]);var Zy={exports:{}},Qp={},Iy={exports:{}},Jy={};/**
|
|
26
|
-
* @license React
|
|
27
|
-
* scheduler.production.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var T2;function F7(){return T2||(T2=1,(function(t){function e(Y,$){var ae=Y.length;Y.push($);e:for(;0<ae;){var Ne=ae-1>>>1,me=Y[Ne];if(0<i(me,$))Y[Ne]=$,Y[ae]=me,ae=Ne;else break e}}function n(Y){return Y.length===0?null:Y[0]}function s(Y){if(Y.length===0)return null;var $=Y[0],ae=Y.pop();if(ae!==$){Y[0]=ae;e:for(var Ne=0,me=Y.length,B=me>>>1;Ne<B;){var I=2*(Ne+1)-1,fe=Y[I],xe=I+1,_e=Y[xe];if(0>i(fe,ae))xe<me&&0>i(_e,fe)?(Y[Ne]=_e,Y[xe]=ae,Ne=xe):(Y[Ne]=fe,Y[I]=ae,Ne=I);else if(xe<me&&0>i(_e,ae))Y[Ne]=_e,Y[xe]=ae,Ne=xe;else break e}}return $}function i(Y,$){var ae=Y.sortIndex-$.sortIndex;return ae!==0?ae:Y.id-$.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var d=Date,f=d.now();t.unstable_now=function(){return d.now()-f}}var p=[],y=[],S=1,b=null,_=3,j=!1,w=!1,T=!1,O=!1,R=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,z=typeof setImmediate<"u"?setImmediate:null;function k(Y){for(var $=n(y);$!==null;){if($.callback===null)s(y);else if($.startTime<=Y)s(y),$.sortIndex=$.expirationTime,e(p,$);else break;$=n(y)}}function G(Y){if(T=!1,k(Y),!w)if(n(p)!==null)w=!0,P||(P=!0,ne());else{var $=n(y);$!==null&&ce(G,$.startTime-Y)}}var P=!1,L=-1,U=5,V=-1;function Z(){return O?!0:!(t.unstable_now()-V<U)}function re(){if(O=!1,P){var Y=t.unstable_now();V=Y;var $=!0;try{e:{w=!1,T&&(T=!1,M(L),L=-1),j=!0;var ae=_;try{t:{for(k(Y),b=n(p);b!==null&&!(b.expirationTime>Y&&Z());){var Ne=b.callback;if(typeof Ne=="function"){b.callback=null,_=b.priorityLevel;var me=Ne(b.expirationTime<=Y);if(Y=t.unstable_now(),typeof me=="function"){b.callback=me,k(Y),$=!0;break t}b===n(p)&&s(p),k(Y)}else s(p);b=n(p)}if(b!==null)$=!0;else{var B=n(y);B!==null&&ce(G,B.startTime-Y),$=!1}}break e}finally{b=null,_=ae,j=!1}$=void 0}}finally{$?ne():P=!1}}}var ne;if(typeof z=="function")ne=function(){z(re)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,ie=W.port2;W.port1.onmessage=re,ne=function(){ie.postMessage(null)}}else ne=function(){R(re,0)};function ce(Y,$){L=R(function(){Y(t.unstable_now())},$)}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(Y){Y.callback=null},t.unstable_forceFrameRate=function(Y){0>Y||125<Y?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<Y?Math.floor(1e3/Y):5},t.unstable_getCurrentPriorityLevel=function(){return _},t.unstable_next=function(Y){switch(_){case 1:case 2:case 3:var $=3;break;default:$=_}var ae=_;_=$;try{return Y()}finally{_=ae}},t.unstable_requestPaint=function(){O=!0},t.unstable_runWithPriority=function(Y,$){switch(Y){case 1:case 2:case 3:case 4:case 5:break;default:Y=3}var ae=_;_=Y;try{return $()}finally{_=ae}},t.unstable_scheduleCallback=function(Y,$,ae){var Ne=t.unstable_now();switch(typeof ae=="object"&&ae!==null?(ae=ae.delay,ae=typeof ae=="number"&&0<ae?Ne+ae:Ne):ae=Ne,Y){case 1:var me=-1;break;case 2:me=250;break;case 5:me=1073741823;break;case 4:me=1e4;break;default:me=5e3}return me=ae+me,Y={id:S++,callback:$,priorityLevel:Y,startTime:ae,expirationTime:me,sortIndex:-1},ae>Ne?(Y.sortIndex=ae,e(y,Y),n(p)===null&&Y===n(y)&&(T?(M(L),L=-1):T=!0,ce(G,ae-Ne))):(Y.sortIndex=me,e(p,Y),w||j||(w=!0,P||(P=!0,ne()))),Y},t.unstable_shouldYield=Z,t.unstable_wrapCallback=function(Y){var $=_;return function(){var ae=_;_=$;try{return Y.apply(this,arguments)}finally{_=ae}}}})(Jy)),Jy}var R2;function Vb(){return R2||(R2=1,Iy.exports=F7()),Iy.exports}/**
|
|
34
|
-
* @license React
|
|
35
|
-
* react-dom-client.production.js
|
|
36
|
-
*
|
|
37
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the MIT license found in the
|
|
40
|
-
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/var O2;function Z7(){if(O2)return Qp;O2=1;var t=Vb(),e=gl(),n=L1();function s(a){var r="https://react.dev/errors/"+a;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)r+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+a+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function o(a){var r=a,u=a;if(a.alternate)for(;r.return;)r=r.return;else{a=r;do r=a,(r.flags&4098)!==0&&(u=r.return),a=r.return;while(a)}return r.tag===3?u:null}function d(a){if(a.tag===13){var r=a.memoizedState;if(r===null&&(a=a.alternate,a!==null&&(r=a.memoizedState)),r!==null)return r.dehydrated}return null}function f(a){if(a.tag===31){var r=a.memoizedState;if(r===null&&(a=a.alternate,a!==null&&(r=a.memoizedState)),r!==null)return r.dehydrated}return null}function p(a){if(o(a)!==a)throw Error(s(188))}function y(a){var r=a.alternate;if(!r){if(r=o(a),r===null)throw Error(s(188));return r!==a?null:a}for(var u=a,m=r;;){var v=u.return;if(v===null)break;var N=v.alternate;if(N===null){if(m=v.return,m!==null){u=m;continue}break}if(v.child===N.child){for(N=v.child;N;){if(N===u)return p(v),a;if(N===m)return p(v),r;N=N.sibling}throw Error(s(188))}if(u.return!==m.return)u=v,m=N;else{for(var A=!1,H=v.child;H;){if(H===u){A=!0,u=v,m=N;break}if(H===m){A=!0,m=v,u=N;break}H=H.sibling}if(!A){for(H=N.child;H;){if(H===u){A=!0,u=N,m=v;break}if(H===m){A=!0,m=N,u=v;break}H=H.sibling}if(!A)throw Error(s(189))}}if(u.alternate!==m)throw Error(s(190))}if(u.tag!==3)throw Error(s(188));return u.stateNode.current===u?a:r}function S(a){var r=a.tag;if(r===5||r===26||r===27||r===6)return a;for(a=a.child;a!==null;){if(r=S(a),r!==null)return r;a=a.sibling}return null}var b=Object.assign,_=Symbol.for("react.element"),j=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),z=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),Z=Symbol.for("react.memo_cache_sentinel"),re=Symbol.iterator;function ne(a){return a===null||typeof a!="object"?null:(a=re&&a[re]||a["@@iterator"],typeof a=="function"?a:null)}var W=Symbol.for("react.client.reference");function ie(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===W?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case T:return"Fragment";case R:return"Profiler";case O:return"StrictMode";case G:return"Suspense";case P:return"SuspenseList";case V:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case w:return"Portal";case z:return a.displayName||"Context";case M:return(a._context.displayName||"Context")+".Consumer";case k:var r=a.render;return a=a.displayName,a||(a=r.displayName||r.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case L:return r=a.displayName||null,r!==null?r:ie(a.type)||"Memo";case U:r=a._payload,a=a._init;try{return ie(a(r))}catch{}}return null}var ce=Array.isArray,Y=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},Ne=[],me=-1;function B(a){return{current:a}}function I(a){0>me||(a.current=Ne[me],Ne[me]=null,me--)}function fe(a,r){me++,Ne[me]=a.current,a.current=r}var xe=B(null),_e=B(null),Ce=B(null),ze=B(null);function Ee(a,r){switch(fe(Ce,r),fe(_e,a),fe(xe,null),r.nodeType){case 9:case 11:a=(a=r.documentElement)&&(a=a.namespaceURI)?Vv(a):0;break;default:if(a=r.tagName,r=r.namespaceURI)r=Vv(r),a=Qv(r,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}I(xe),fe(xe,a)}function we(){I(xe),I(_e),I(Ce)}function Vt(a){a.memoizedState!==null&&fe(ze,a);var r=xe.current,u=Qv(r,a.type);r!==u&&(fe(_e,a),fe(xe,u))}function et(a){_e.current===a&&(I(xe),I(_e)),ze.current===a&&(I(ze),Hp._currentValue=ae)}var Mt,Ht;function En(a){if(Mt===void 0)try{throw Error()}catch(u){var r=u.stack.trim().match(/\n( *(at )?)/);Mt=r&&r[1]||"",Ht=-1<u.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+Mt+a+Ht}var Kn=!1;function Gt(a,r){if(!a||Kn)return"";Kn=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(r){var ve=function(){throw Error()};if(Object.defineProperty(ve.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ve,[])}catch(ge){var de=ge}Reflect.construct(a,[],ve)}else{try{ve.call()}catch(ge){de=ge}a.call(ve.prototype)}}else{try{throw Error()}catch(ge){de=ge}(ve=a())&&typeof ve.catch=="function"&&ve.catch(function(){})}}catch(ge){if(ge&&de&&typeof ge.stack=="string")return[ge.stack,de.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var v=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");v&&v.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var N=m.DetermineComponentFrameRoot(),A=N[0],H=N[1];if(A&&H){var X=A.split(`
|
|
44
|
-
`),oe=H.split(`
|
|
45
|
-
`);for(v=m=0;m<X.length&&!X[m].includes("DetermineComponentFrameRoot");)m++;for(;v<oe.length&&!oe[v].includes("DetermineComponentFrameRoot");)v++;if(m===X.length||v===oe.length)for(m=X.length-1,v=oe.length-1;1<=m&&0<=v&&X[m]!==oe[v];)v--;for(;1<=m&&0<=v;m--,v--)if(X[m]!==oe[v]){if(m!==1||v!==1)do if(m--,v--,0>v||X[m]!==oe[v]){var ye=`
|
|
46
|
-
`+X[m].replace(" at new "," at ");return a.displayName&&ye.includes("<anonymous>")&&(ye=ye.replace("<anonymous>",a.displayName)),ye}while(1<=m&&0<=v);break}}}finally{Kn=!1,Error.prepareStackTrace=u}return(u=a?a.displayName||a.name:"")?En(u):""}function fn(a,r){switch(a.tag){case 26:case 27:case 5:return En(a.type);case 16:return En("Lazy");case 13:return a.child!==r&&r!==null?En("Suspense Fallback"):En("Suspense");case 19:return En("SuspenseList");case 0:case 15:return Gt(a.type,!1);case 11:return Gt(a.type.render,!1);case 1:return Gt(a.type,!0);case 31:return En("Activity");default:return""}}function ur(a){try{var r="",u=null;do r+=fn(a,u),u=a,a=a.return;while(a);return r}catch(m){return`
|
|
47
|
-
Error generating stack: `+m.message+`
|
|
48
|
-
`+m.stack}}var Ft=Object.prototype.hasOwnProperty,Et=t.unstable_scheduleCallback,qn=t.unstable_cancelCallback,hn=t.unstable_shouldYield,Zt=t.unstable_requestPaint,Xn=t.unstable_now,Ss=t.unstable_getCurrentPriorityLevel,dr=t.unstable_ImmediatePriority,Qa=t.unstable_UserBlockingPriority,la=t.unstable_NormalPriority,Ea=t.unstable_LowPriority,rs=t.unstable_IdlePriority,fr=t.log,Ns=t.unstable_setDisableYieldValue,Hs=null,ta=null;function is(a){if(typeof fr=="function"&&Ns(a),ta&&typeof ta.setStrictMode=="function")try{ta.setStrictMode(Hs,a)}catch{}}var ba=Math.clz32?Math.clz32:Nl,Ta=Math.log,Pc=Math.LN2;function Nl(a){return a>>>=0,a===0?32:31-(Ta(a)/Pc|0)|0}var _s=256,hr=262144,yt=4194304;function mt(a){var r=a&42;if(r!==0)return r;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function Qt(a,r,u){var m=a.pendingLanes;if(m===0)return 0;var v=0,N=a.suspendedLanes,A=a.pingedLanes;a=a.warmLanes;var H=m&134217727;return H!==0?(m=H&~N,m!==0?v=mt(m):(A&=H,A!==0?v=mt(A):u||(u=H&~a,u!==0&&(v=mt(u))))):(H=m&~N,H!==0?v=mt(H):A!==0?v=mt(A):u||(u=m&~a,u!==0&&(v=mt(u)))),v===0?0:r!==0&&r!==v&&(r&N)===0&&(N=v&-v,u=r&-r,N>=u||N===32&&(u&4194048)!==0)?r:v}function At(a,r){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&r)===0}function Hn(a,r){switch(a){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function rn(){var a=yt;return yt<<=1,(yt&62914560)===0&&(yt=4194304),a}function Fn(a){for(var r=[],u=0;31>u;u++)r.push(a);return r}function yn(a,r){a.pendingLanes|=r,r!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Ra(a,r,u,m,v,N){var A=a.pendingLanes;a.pendingLanes=u,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=u,a.entangledLanes&=u,a.errorRecoveryDisabledLanes&=u,a.shellSuspendCounter=0;var H=a.entanglements,X=a.expirationTimes,oe=a.hiddenUpdates;for(u=A&~u;0<u;){var ye=31-ba(u),ve=1<<ye;H[ye]=0,X[ye]=-1;var de=oe[ye];if(de!==null)for(oe[ye]=null,ye=0;ye<de.length;ye++){var ge=de[ye];ge!==null&&(ge.lane&=-536870913)}u&=~ve}m!==0&&oa(a,m,0),N!==0&&v===0&&a.tag!==0&&(a.suspendedLanes|=N&~(A&~r))}function oa(a,r,u){a.pendingLanes|=r,a.suspendedLanes&=~r;var m=31-ba(r);a.entangledLanes|=r,a.entanglements[m]=a.entanglements[m]|1073741824|u&261930}function ls(a,r){var u=a.entangledLanes|=r;for(a=a.entanglements;u;){var m=31-ba(u),v=1<<m;v&r|a[m]&r&&(a[m]|=r),u&=~v}}function Bs(a,r){var u=r&-r;return u=(u&42)!==0?1:qe(u),(u&(a.suspendedLanes|r))!==0?0:u}function qe(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function tt(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function Qe(){var a=$.p;return a!==0?a:(a=window.event,a===void 0?32:p2(a.type))}function ot(a,r){var u=$.p;try{return $.p=a,r()}finally{$.p=u}}var xt=Math.random().toString(36).slice(2),Ze="__reactFiber$"+xt,ct="__reactProps$"+xt,sn="__reactContainer$"+xt,Tt="__reactEvents$"+xt,pn="__reactListeners$"+xt,Rr="__reactHandles$"+xt,os="__reactResources$"+xt,Ka="__reactMarker$"+xt;function Gs(a){delete a[Ze],delete a[ct],delete a[Tt],delete a[pn],delete a[Rr]}function Pt(a){var r=a[Ze];if(r)return r;for(var u=a.parentNode;u;){if(r=u[sn]||u[Ze]){if(u=r.alternate,r.child!==null||u!==null&&u.child!==null)for(a=Wv(a);a!==null;){if(u=a[Ze])return u;a=Wv(a)}return r}a=u,u=a.parentNode}return null}function pr(a){if(a=a[Ze]||a[sn]){var r=a.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return a}return null}function mr(a){var r=a.tag;if(r===5||r===26||r===27||r===6)return a.stateNode;throw Error(s(33))}function Cs(a){var r=a[os];return r||(r=a[os]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Tn(a){a[Ka]=!0}var js=new Set,ud={};function Ai(a,r){ws(a,r),ws(a+"Capture",r)}function ws(a,r){for(ud[a]=r,a=0;a<r.length;a++)js.add(r[a])}var Es=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Yc={},Rn={};function mh(a){return Ft.call(Rn,a)?!0:Ft.call(Yc,a)?!1:Es.test(a)?Rn[a]=!0:(Yc[a]=!0,!1)}function xo(a,r,u){if(mh(r))if(u===null)a.removeAttribute(r);else{switch(typeof u){case"undefined":case"function":case"symbol":a.removeAttribute(r);return;case"boolean":var m=r.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){a.removeAttribute(r);return}}a.setAttribute(r,""+u)}}function Vc(a,r,u){if(u===null)a.removeAttribute(r);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(r);return}a.setAttribute(r,""+u)}}function Or(a,r,u,m){if(m===null)a.removeAttribute(u);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(u);return}a.setAttributeNS(r,u,""+m)}}function Ps(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function dd(a){var r=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function gh(a,r,u){var m=Object.getOwnPropertyDescriptor(a.constructor.prototype,r);if(!a.hasOwnProperty(r)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var v=m.get,N=m.set;return Object.defineProperty(a,r,{configurable:!0,get:function(){return v.call(this)},set:function(A){u=""+A,N.call(this,A)}}),Object.defineProperty(a,r,{enumerable:m.enumerable}),{getValue:function(){return u},setValue:function(A){u=""+A},stopTracking:function(){a._valueTracker=null,delete a[r]}}}}function Qc(a){if(!a._valueTracker){var r=dd(a)?"checked":"value";a._valueTracker=gh(a,r,""+a[r])}}function qa(a){if(!a)return!1;var r=a._valueTracker;if(!r)return!0;var u=r.getValue(),m="";return a&&(m=dd(a)?a.checked?"true":"false":a.value),a=m,a!==u?(r.setValue(a),!0):!1}function xn(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var fd=/[\n"\\]/g;function Ha(a){return a.replace(fd,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function bo(a,r,u,m,v,N,A,H){a.name="",A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?a.type=A:a.removeAttribute("type"),r!=null?A==="number"?(r===0&&a.value===""||a.value!=r)&&(a.value=""+Ps(r)):a.value!==""+Ps(r)&&(a.value=""+Ps(r)):A!=="submit"&&A!=="reset"||a.removeAttribute("value"),r!=null?gr(a,A,Ps(r)):u!=null?gr(a,A,Ps(u)):m!=null&&a.removeAttribute("value"),v==null&&N!=null&&(a.defaultChecked=!!N),v!=null&&(a.checked=v&&typeof v!="function"&&typeof v!="symbol"),H!=null&&typeof H!="function"&&typeof H!="symbol"&&typeof H!="boolean"?a.name=""+Ps(H):a.removeAttribute("name")}function hd(a,r,u,m,v,N,A,H){if(N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(a.type=N),r!=null||u!=null){if(!(N!=="submit"&&N!=="reset"||r!=null)){Qc(a);return}u=u!=null?""+Ps(u):"",r=r!=null?""+Ps(r):u,H||r===a.value||(a.value=r),a.defaultValue=r}m=m??v,m=typeof m!="function"&&typeof m!="symbol"&&!!m,a.checked=H?a.checked:!!m,a.defaultChecked=!!m,A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(a.name=A),Qc(a)}function gr(a,r,u){r==="number"&&xn(a.ownerDocument)===a||a.defaultValue===""+u||(a.defaultValue=""+u)}function li(a,r,u,m){if(a=a.options,r){r={};for(var v=0;v<u.length;v++)r["$"+u[v]]=!0;for(u=0;u<a.length;u++)v=r.hasOwnProperty("$"+a[u].value),a[u].selected!==v&&(a[u].selected=v),v&&m&&(a[u].defaultSelected=!0)}else{for(u=""+Ps(u),r=null,v=0;v<a.length;v++){if(a[v].value===u){a[v].selected=!0,m&&(a[v].defaultSelected=!0);return}r!==null||a[v].disabled||(r=a[v])}r!==null&&(r.selected=!0)}}function pd(a,r,u){if(r!=null&&(r=""+Ps(r),r!==a.value&&(a.value=r),u==null)){a.defaultValue!==r&&(a.defaultValue=r);return}a.defaultValue=u!=null?""+Ps(u):""}function md(a,r,u,m){if(r==null){if(m!=null){if(u!=null)throw Error(s(92));if(ce(m)){if(1<m.length)throw Error(s(93));m=m[0]}u=m}u==null&&(u=""),r=u}u=Ps(r),a.defaultValue=u,m=a.textContent,m===u&&m!==""&&m!==null&&(a.value=m),Qc(a)}function _l(a,r){if(r){var u=a.firstChild;if(u&&u===a.lastChild&&u.nodeType===3){u.nodeValue=r;return}}a.textContent=r}var eg=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function yh(a,r,u){var m=r.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?m?a.setProperty(r,""):r==="float"?a.cssFloat="":a[r]="":m?a.setProperty(r,u):typeof u!="number"||u===0||eg.has(r)?r==="float"?a.cssFloat=u:a[r]=(""+u).trim():a[r]=u+"px"}function xh(a,r,u){if(r!=null&&typeof r!="object")throw Error(s(62));if(a=a.style,u!=null){for(var m in u)!u.hasOwnProperty(m)||r!=null&&r.hasOwnProperty(m)||(m.indexOf("--")===0?a.setProperty(m,""):m==="float"?a.cssFloat="":a[m]="");for(var v in r)m=r[v],r.hasOwnProperty(v)&&u[v]!==m&&yh(a,v,m)}else for(var N in r)r.hasOwnProperty(N)&&yh(a,N,r[N])}function gd(a){if(a.indexOf("-")===-1)return!1;switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var tg=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),bh=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Kc(a){return bh.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function oi(){}var yd=null;function xd(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Cl=null,Di=null;function vh(a){var r=pr(a);if(r&&(a=r.stateNode)){var u=a[ct]||null;e:switch(a=r.stateNode,r.type){case"input":if(bo(a,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),r=u.name,u.type==="radio"&&r!=null){for(u=a;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+Ha(""+r)+'"][type="radio"]'),r=0;r<u.length;r++){var m=u[r];if(m!==a&&m.form===a.form){var v=m[ct]||null;if(!v)throw Error(s(90));bo(m,v.value,v.defaultValue,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name)}}for(r=0;r<u.length;r++)m=u[r],m.form===a.form&&qa(m)}break e;case"textarea":pd(a,u.value,u.defaultValue);break e;case"select":r=u.value,r!=null&&li(a,!!u.multiple,r,!1)}}}var bd=!1;function Sh(a,r,u){if(bd)return a(r,u);bd=!0;try{var m=a(r);return m}finally{if(bd=!1,(Cl!==null||Di!==null)&&(Sr(),Cl&&(r=Cl,a=Di,Di=Cl=null,vh(r),a)))for(r=0;r<a.length;r++)vh(a[r])}}function vo(a,r){var u=a.stateNode;if(u===null)return null;var m=u[ct]||null;if(m===null)return null;u=m[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(a=a.type,m=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!m;break e;default:a=!1}if(a)return null;if(u&&typeof u!="function")throw Error(s(231,r,typeof u));return u}var Mr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Nh=!1;if(Mr)try{var So={};Object.defineProperty(So,"passive",{get:function(){Nh=!0}}),window.addEventListener("test",So,So),window.removeEventListener("test",So,So)}catch{Nh=!1}var Ts=null,vd=null,jl=null;function Xc(){if(jl)return jl;var a,r=vd,u=r.length,m,v="value"in Ts?Ts.value:Ts.textContent,N=v.length;for(a=0;a<u&&r[a]===v[a];a++);var A=u-a;for(m=1;m<=A&&r[u-m]===v[N-m];m++);return jl=v.slice(a,1<m?1-m:void 0)}function Fc(a){var r=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&r===13&&(a=13)):a=r,a===10&&(a=13),32<=a||a===13?a:0}function No(){return!0}function ng(){return!1}function Xa(a){function r(u,m,v,N,A){this._reactName=u,this._targetInst=v,this.type=m,this.nativeEvent=N,this.target=A,this.currentTarget=null;for(var H in a)a.hasOwnProperty(H)&&(u=a[H],this[H]=u?u(N):N[H]);return this.isDefaultPrevented=(N.defaultPrevented!=null?N.defaultPrevented:N.returnValue===!1)?No:ng,this.isPropagationStopped=ng,this}return b(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=No)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=No)},persist:function(){},isPersistent:No}),r}var zi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Zc=Xa(zi),_o=b({},zi,{view:0,detail:0}),ag=Xa(_o),Ic,Sd,Co,jo=b({},_o,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jd,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==Co&&(Co&&a.type==="mousemove"?(Ic=a.screenX-Co.screenX,Sd=a.screenY-Co.screenY):Sd=Ic=0,Co=a),Ic)},movementY:function(a){return"movementY"in a?a.movementY:Sd}}),_h=Xa(jo),sg=b({},jo,{dataTransfer:0}),rg=Xa(sg),Ch=b({},_o,{relatedTarget:0}),Nd=Xa(Ch),ig=b({},zi,{animationName:0,elapsedTime:0,pseudoElement:0}),dy=Xa(ig),fy=b({},zi,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),lg=Xa(fy),Jc=b({},zi,{data:0}),_d=Xa(Jc),Cd={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},og={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},cg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function jh(a){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(a):(a=cg[a])?!!r[a]:!1}function jd(){return jh}var ug=b({},_o,{key:function(a){if(a.key){var r=Cd[a.key]||a.key;if(r!=="Unidentified")return r}return a.type==="keypress"?(a=Fc(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?og[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jd,charCode:function(a){return a.type==="keypress"?Fc(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Fc(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),wl=Xa(ug),wd=b({},jo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),wh=Xa(wd),Eh=b({},_o,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jd}),dg=Xa(Eh),fg=b({},zi,{propertyName:0,elapsedTime:0,pseudoElement:0}),hy=Xa(fg),Oa=b({},jo,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),hg=Xa(Oa),pg=b({},zi,{newState:0,oldState:0}),mg=Xa(pg),gg=[9,13,27,32],El=Mr&&"CompositionEvent"in window,wo=null;Mr&&"documentMode"in document&&(wo=document.documentMode);var Ed=Mr&&"TextEvent"in window&&!wo,Th=Mr&&(!El||wo&&8<wo&&11>=wo),yg=" ",Wc=!1;function Td(a,r){switch(a){case"keyup":return gg.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rh(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Tl=!1;function xg(a,r){switch(a){case"compositionend":return Rh(r);case"keypress":return r.which!==32?null:(Wc=!0,yg);case"textInput":return a=r.data,a===yg&&Wc?null:a;default:return null}}function Oh(a,r){if(Tl)return a==="compositionend"||!El&&Td(a,r)?(a=Xc(),jl=vd=Ts=null,Tl=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Th&&r.locale!=="ko"?null:r.data;default:return null}}var Mh={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ah(a){var r=a&&a.nodeName&&a.nodeName.toLowerCase();return r==="input"?!!Mh[a.type]:r==="textarea"}function Rd(a,r,u,m){Cl?Di?Di.push(m):Di=[m]:Cl=m,r=_0(r,"onChange"),0<r.length&&(u=new Zc("onChange","change",null,u,m),a.push({event:u,listeners:r}))}var ki=null,Rl=null;function bg(a){qv(a,0)}function Eo(a){var r=mr(a);if(qa(r))return a}function Dh(a,r){if(a==="change")return r}var Ar=!1;if(Mr){var $c;if(Mr){var zh="oninput"in document;if(!zh){var kh=document.createElement("div");kh.setAttribute("oninput","return;"),zh=typeof kh.oninput=="function"}$c=zh}else $c=!1;Ar=$c&&(!document.documentMode||9<document.documentMode)}function Ys(){ki&&(ki.detachEvent("onpropertychange",eu),Rl=ki=null)}function eu(a){if(a.propertyName==="value"&&Eo(Rl)){var r=[];Rd(r,Rl,a,xd(a)),Sh(bg,r)}}function vg(a,r,u){a==="focusin"?(Ys(),ki=r,Rl=u,ki.attachEvent("onpropertychange",eu)):a==="focusout"&&Ys()}function Lh(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Eo(Rl)}function Sg(a,r){if(a==="click")return Eo(r)}function Ng(a,r){if(a==="input"||a==="change")return Eo(r)}function Uh(a,r){return a===r&&(a!==0||1/a===1/r)||a!==a&&r!==r}var Fa=typeof Object.is=="function"?Object.is:Uh;function To(a,r){if(Fa(a,r))return!0;if(typeof a!="object"||a===null||typeof r!="object"||r===null)return!1;var u=Object.keys(a),m=Object.keys(r);if(u.length!==m.length)return!1;for(m=0;m<u.length;m++){var v=u[m];if(!Ft.call(r,v)||!Fa(a[v],r[v]))return!1}return!0}function tu(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Ro(a,r){var u=tu(a);a=0;for(var m;u;){if(u.nodeType===3){if(m=a+u.textContent.length,a<=r&&m>=r)return{node:u,offset:r-a};a=m}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=tu(u)}}function ln(a,r){return a&&r?a===r?!0:a&&a.nodeType===3?!1:r&&r.nodeType===3?ln(a,r.parentNode):"contains"in a?a.contains(r):a.compareDocumentPosition?!!(a.compareDocumentPosition(r)&16):!1:!1}function _g(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var r=xn(a.document);r instanceof a.HTMLIFrameElement;){try{var u=typeof r.contentWindow.location.href=="string"}catch{u=!1}if(u)a=r.contentWindow;else break;r=xn(a.document)}return r}function qh(a){var r=a&&a.nodeName&&a.nodeName.toLowerCase();return r&&(r==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||r==="textarea"||a.contentEditable==="true")}var Cg=Mr&&"documentMode"in document&&11>=document.documentMode,Dr=null,zr=null,Oo=null,Od=!1;function Mo(a,r,u){var m=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Od||Dr==null||Dr!==xn(m)||(m=Dr,"selectionStart"in m&&qh(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Oo&&To(Oo,m)||(Oo=m,m=_0(zr,"onSelect"),0<m.length&&(r=new Zc("onSelect","select",null,r,u),a.push({event:r,listeners:m}),r.target=Dr)))}function Ba(a,r){var u={};return u[a.toLowerCase()]=r.toLowerCase(),u["Webkit"+a]="webkit"+r,u["Moz"+a]="moz"+r,u}var Ol={animationend:Ba("Animation","AnimationEnd"),animationiteration:Ba("Animation","AnimationIteration"),animationstart:Ba("Animation","AnimationStart"),transitionrun:Ba("Transition","TransitionRun"),transitionstart:Ba("Transition","TransitionStart"),transitioncancel:Ba("Transition","TransitionCancel"),transitionend:Ba("Transition","TransitionEnd")},nu={},Hh={};Mr&&(Hh=document.createElement("div").style,"AnimationEvent"in window||(delete Ol.animationend.animation,delete Ol.animationiteration.animation,delete Ol.animationstart.animation),"TransitionEvent"in window||delete Ol.transitionend.transition);function ci(a){if(nu[a])return nu[a];if(!Ol[a])return a;var r=Ol[a],u;for(u in r)if(r.hasOwnProperty(u)&&u in Hh)return nu[a]=r[u];return a}var Md=ci("animationend"),au=ci("animationiteration"),Bh=ci("animationstart"),jg=ci("transitionrun"),py=ci("transitionstart"),wg=ci("transitioncancel"),Gh=ci("transitionend"),Vs=new Map,su="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");su.push("scrollEnd");function Qs(a,r){Vs.set(a,r),Ai(r,[a])}var ru=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},Ks=[],ui=0,va=0;function iu(){for(var a=ui,r=va=ui=0;r<a;){var u=Ks[r];Ks[r++]=null;var m=Ks[r];Ks[r++]=null;var v=Ks[r];Ks[r++]=null;var N=Ks[r];if(Ks[r++]=null,m!==null&&v!==null){var A=m.pending;A===null?v.next=v:(v.next=A.next,A.next=v),m.pending=v}N!==0&&Li(u,v,N)}}function Sa(a,r,u,m){Ks[ui++]=a,Ks[ui++]=r,Ks[ui++]=u,Ks[ui++]=m,va|=m,a.lanes|=m,a=a.alternate,a!==null&&(a.lanes|=m)}function Ad(a,r,u,m){return Sa(a,r,u,m),Xs(a)}function Za(a,r){return Sa(a,null,null,r),Xs(a)}function Li(a,r,u){a.lanes|=u;var m=a.alternate;m!==null&&(m.lanes|=u);for(var v=!1,N=a.return;N!==null;)N.childLanes|=u,m=N.alternate,m!==null&&(m.childLanes|=u),N.tag===22&&(a=N.stateNode,a===null||a._visibility&1||(v=!0)),a=N,N=N.return;return a.tag===3?(N=a.stateNode,v&&r!==null&&(v=31-ba(u),a=N.hiddenUpdates,m=a[v],m===null?a[v]=[r]:m.push(r),r.lane=u|536870912),N):null}function Xs(a){if(50<tl)throw tl=0,Zl=null,Error(s(185));for(var r=a.return;r!==null;)a=r,r=a.return;return a.tag===3?a.stateNode:null}var Ui={};function Ph(a,r,u,m){this.tag=a,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function On(a,r,u,m){return new Ph(a,r,u,m)}function Dd(a){return a=a.prototype,!(!a||!a.isReactComponent)}function cs(a,r){var u=a.alternate;return u===null?(u=On(a.tag,r,a.key,a.mode),u.elementType=a.elementType,u.type=a.type,u.stateNode=a.stateNode,u.alternate=a,a.alternate=u):(u.pendingProps=r,u.type=a.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=a.flags&65011712,u.childLanes=a.childLanes,u.lanes=a.lanes,u.child=a.child,u.memoizedProps=a.memoizedProps,u.memoizedState=a.memoizedState,u.updateQueue=a.updateQueue,r=a.dependencies,u.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},u.sibling=a.sibling,u.index=a.index,u.ref=a.ref,u.refCleanup=a.refCleanup,u}function Ao(a,r){a.flags&=65011714;var u=a.alternate;return u===null?(a.childLanes=0,a.lanes=r,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=u.childLanes,a.lanes=u.lanes,a.child=u.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=u.memoizedProps,a.memoizedState=u.memoizedState,a.updateQueue=u.updateQueue,a.type=u.type,r=u.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),a}function kr(a,r,u,m,v,N){var A=0;if(m=a,typeof a=="function")Dd(a)&&(A=1);else if(typeof a=="string")A=E7(a,u,xe.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case V:return a=On(31,u,r,v),a.elementType=V,a.lanes=N,a;case T:return qi(u.children,v,N,r);case O:A=8,v|=24;break;case R:return a=On(12,u,r,v|2),a.elementType=R,a.lanes=N,a;case G:return a=On(13,u,r,v),a.elementType=G,a.lanes=N,a;case P:return a=On(19,u,r,v),a.elementType=P,a.lanes=N,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case z:A=10;break e;case M:A=9;break e;case k:A=11;break e;case L:A=14;break e;case U:A=16,m=null;break e}A=29,u=Error(s(130,a===null?"null":typeof a,"")),m=null}return r=On(A,u,r,v),r.elementType=a,r.type=m,r.lanes=N,r}function qi(a,r,u,m){return a=On(7,a,m,r),a.lanes=u,a}function zd(a,r,u){return a=On(6,a,null,r),a.lanes=u,a}function Do(a){var r=On(18,null,null,0);return r.stateNode=a,r}function kd(a,r,u){return r=On(4,a.children!==null?a.children:[],a.key,r),r.lanes=u,r.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},r}var lu=new WeakMap;function Rs(a,r){if(typeof a=="object"&&a!==null){var u=lu.get(a);return u!==void 0?u:(r={value:a,source:r,stack:ur(r)},lu.set(a,r),r)}return{value:a,source:r,stack:ur(r)}}var Hi=[],Bi=0,zo=null,ko=0,us=[],bn=0,di=null,Mn=1,yr="";function Lr(a,r){Hi[Bi++]=ko,Hi[Bi++]=zo,zo=a,ko=r}function Eg(a,r,u){us[bn++]=Mn,us[bn++]=yr,us[bn++]=di,di=a;var m=Mn;a=yr;var v=32-ba(m)-1;m&=~(1<<v),u+=1;var N=32-ba(r)+v;if(30<N){var A=v-v%5;N=(m&(1<<A)-1).toString(32),m>>=A,v-=A,Mn=1<<32-ba(r)+v|u<<v|m,yr=N+a}else Mn=1<<N|u<<v|m,yr=a}function Ur(a){a.return!==null&&(Lr(a,1),Eg(a,1,0))}function Ld(a){for(;a===zo;)zo=Hi[--Bi],Hi[Bi]=null,ko=Hi[--Bi],Hi[Bi]=null;for(;a===di;)di=us[--bn],us[bn]=null,yr=us[--bn],us[bn]=null,Mn=us[--bn],us[bn]=null}function Ud(a,r){us[bn++]=Mn,us[bn++]=yr,us[bn++]=di,Mn=r.id,yr=r.overflow,di=a}var Bn=null,on=null,jt=!1,fi=null,Os=!1,Lo=Error(s(519));function qr(a){var r=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Hr(Rs(r,a)),Lo}function Tg(a){var r=a.stateNode,u=a.type,m=a.memoizedProps;switch(r[Ze]=a,r[ct]=m,u){case"dialog":Ot("cancel",r),Ot("close",r);break;case"iframe":case"object":case"embed":Ot("load",r);break;case"video":case"audio":for(u=0;u<ir.length;u++)Ot(ir[u],r);break;case"source":Ot("error",r);break;case"img":case"image":case"link":Ot("error",r),Ot("load",r);break;case"details":Ot("toggle",r);break;case"input":Ot("invalid",r),hd(r,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":Ot("invalid",r);break;case"textarea":Ot("invalid",r),md(r,m.value,m.defaultValue,m.children)}u=m.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||r.textContent===""+u||m.suppressHydrationWarning===!0||Pv(r.textContent,u)?(m.popover!=null&&(Ot("beforetoggle",r),Ot("toggle",r)),m.onScroll!=null&&Ot("scroll",r),m.onScrollEnd!=null&&Ot("scrollend",r),m.onClick!=null&&(r.onclick=oi),r=!0):r=!1,r||qr(a,!0)}function Rg(a){for(Bn=a.return;Bn;)switch(Bn.tag){case 5:case 31:case 13:Os=!1;return;case 27:case 3:Os=!0;return;default:Bn=Bn.return}}function Uo(a){if(a!==Bn)return!1;if(!jt)return Rg(a),jt=!0,!1;var r=a.tag,u;if((u=r!==3&&r!==27)&&((u=r===5)&&(u=a.type,u=!(u!=="form"&&u!=="button")||Oy(a.type,a.memoizedProps)),u=!u),u&&on&&qr(a),Rg(a),r===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(s(317));on=Jv(a)}else if(r===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(s(317));on=Jv(a)}else r===27?(r=on,ac(a.type)?(a=ky,ky=null,on=a):on=r):on=Bn?$r(a.stateNode.nextSibling):null;return!0}function Gi(){on=Bn=null,jt=!1}function qd(){var a=fi;return a!==null&&(Pn===null?Pn=a:Pn.push.apply(Pn,a),fi=null),a}function Hr(a){fi===null?fi=[a]:fi.push(a)}var qo=B(null),Pi=null,Br=null;function hi(a,r,u){fe(qo,r._currentValue),r._currentValue=u}function Gr(a){a._currentValue=qo.current,I(qo)}function Hd(a,r,u){for(;a!==null;){var m=a.alternate;if((a.childLanes&r)!==r?(a.childLanes|=r,m!==null&&(m.childLanes|=r)):m!==null&&(m.childLanes&r)!==r&&(m.childLanes|=r),a===u)break;a=a.return}}function Bd(a,r,u,m){var v=a.child;for(v!==null&&(v.return=a);v!==null;){var N=v.dependencies;if(N!==null){var A=v.child;N=N.firstContext;e:for(;N!==null;){var H=N;N=v;for(var X=0;X<r.length;X++)if(H.context===r[X]){N.lanes|=u,H=N.alternate,H!==null&&(H.lanes|=u),Hd(N.return,u,a),m||(A=null);break e}N=H.next}}else if(v.tag===18){if(A=v.return,A===null)throw Error(s(341));A.lanes|=u,N=A.alternate,N!==null&&(N.lanes|=u),Hd(A,u,a),A=null}else A=v.child;if(A!==null)A.return=v;else for(A=v;A!==null;){if(A===a){A=null;break}if(v=A.sibling,v!==null){v.return=A.return,A=v;break}A=A.return}v=A}}function Pr(a,r,u,m){a=null;for(var v=r,N=!1;v!==null;){if(!N){if((v.flags&524288)!==0)N=!0;else if((v.flags&262144)!==0)break}if(v.tag===10){var A=v.alternate;if(A===null)throw Error(s(387));if(A=A.memoizedProps,A!==null){var H=v.type;Fa(v.pendingProps.value,A.value)||(a!==null?a.push(H):a=[H])}}else if(v===ze.current){if(A=v.alternate,A===null)throw Error(s(387));A.memoizedState.memoizedState!==v.memoizedState.memoizedState&&(a!==null?a.push(Hp):a=[Hp])}v=v.return}a!==null&&Bd(r,a,u,m),r.flags|=262144}function ou(a){for(a=a.firstContext;a!==null;){if(!Fa(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function Yi(a){Pi=a,Br=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function $e(a){return Og(Pi,a)}function Ho(a,r){return Pi===null&&Yi(a),Og(a,r)}function Og(a,r){var u=r._currentValue;if(r={context:r,memoizedValue:u,next:null},Br===null){if(a===null)throw Error(s(308));Br=r,a.dependencies={lanes:0,firstContext:r},a.flags|=524288}else Br=Br.next=r;return u}var Mg=typeof AbortController<"u"?AbortController:function(){var a=[],r=this.signal={aborted:!1,addEventListener:function(u,m){a.push(m)}};this.abort=function(){r.aborted=!0,a.forEach(function(u){return u()})}},my=t.unstable_scheduleCallback,gy=t.unstable_NormalPriority,na={$$typeof:z,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Yh(){return{controller:new Mg,data:new Map,refCount:0}}function Ml(a){a.refCount--,a.refCount===0&&my(gy,function(){a.controller.abort()})}var Ms=null,Gd=0,pi=0,Fs=null;function Vh(a,r){if(Ms===null){var u=Ms=[];Gd=0,pi=he(),Fs={status:"pending",value:void 0,then:function(m){u.push(m)}}}return Gd++,r.then(Qh,Qh),r}function Qh(){if(--Gd===0&&Ms!==null){Fs!==null&&(Fs.status="fulfilled");var a=Ms;Ms=null,pi=0,Fs=null;for(var r=0;r<a.length;r++)(0,a[r])()}}function Kh(a,r){var u=[],m={status:"pending",value:null,reason:null,then:function(v){u.push(v)}};return a.then(function(){m.status="fulfilled",m.value=r;for(var v=0;v<u.length;v++)(0,u[v])(r)},function(v){for(m.status="rejected",m.reason=v,v=0;v<u.length;v++)(0,u[v])(void 0)}),m}var Ag=Y.S;Y.S=function(a,r){Dp=Xn(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&Vh(a,r),Ag!==null&&Ag(a,r)};var Vi=B(null);function Pd(){var a=Vi.current;return a!==null?a:nt.pooledCache}function cu(a,r){r===null?fe(Vi,Vi.current):fe(Vi,r.pool)}function Xh(){var a=Pd();return a===null?null:{parent:na._currentValue,pool:a}}var Al=Error(s(460)),uu=Error(s(474)),ft=Error(s(542)),Yd={then:function(){}};function ds(a){return a=a.status,a==="fulfilled"||a==="rejected"}function Vd(a,r,u){switch(u=a[u],u===void 0?a.push(r):u!==r&&(r.then(oi,oi),r=u),r.status){case"fulfilled":return r.value;case"rejected":throw a=r.reason,kl(a),a;default:if(typeof r.status=="string")r.then(oi,oi);else{if(a=nt,a!==null&&100<a.shellSuspendCounter)throw Error(s(482));a=r,a.status="pending",a.then(function(m){if(r.status==="pending"){var v=r;v.status="fulfilled",v.value=m}},function(m){if(r.status==="pending"){var v=r;v.status="rejected",v.reason=m}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw a=r.reason,kl(a),a}throw Yr=r,Al}}function Dl(a){try{var r=a._init;return r(a._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(Yr=u,Al):u}}var Yr=null;function zl(){if(Yr===null)throw Error(s(459));var a=Yr;return Yr=null,a}function kl(a){if(a===Al||a===ft)throw Error(s(483))}var Ll=null,Ul=0;function du(a){var r=Ul;return Ul+=1,Ll===null&&(Ll=[]),Vd(Ll,a,r)}function Zs(a,r){r=r.props.ref,a.ref=r!==void 0?r:null}function Bo(a,r){throw r.$$typeof===_?Error(s(525)):(a=Object.prototype.toString.call(r),Error(s(31,a==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":a)))}function Qd(a){function r(te,J){if(a){var le=te.deletions;le===null?(te.deletions=[J],te.flags|=16):le.push(J)}}function u(te,J){if(!a)return null;for(;J!==null;)r(te,J),J=J.sibling;return null}function m(te){for(var J=new Map;te!==null;)te.key!==null?J.set(te.key,te):J.set(te.index,te),te=te.sibling;return J}function v(te,J){return te=cs(te,J),te.index=0,te.sibling=null,te}function N(te,J,le){return te.index=le,a?(le=te.alternate,le!==null?(le=le.index,le<J?(te.flags|=67108866,J):le):(te.flags|=67108866,J)):(te.flags|=1048576,J)}function A(te){return a&&te.alternate===null&&(te.flags|=67108866),te}function H(te,J,le,be){return J===null||J.tag!==6?(J=zd(le,te.mode,be),J.return=te,J):(J=v(J,le),J.return=te,J)}function X(te,J,le,be){var Xe=le.type;return Xe===T?ye(te,J,le.props.children,be,le.key):J!==null&&(J.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===U&&Dl(Xe)===J.type)?(J=v(J,le.props),Zs(J,le),J.return=te,J):(J=kr(le.type,le.key,le.props,null,te.mode,be),Zs(J,le),J.return=te,J)}function oe(te,J,le,be){return J===null||J.tag!==4||J.stateNode.containerInfo!==le.containerInfo||J.stateNode.implementation!==le.implementation?(J=kd(le,te.mode,be),J.return=te,J):(J=v(J,le.children||[]),J.return=te,J)}function ye(te,J,le,be,Xe){return J===null||J.tag!==7?(J=qi(le,te.mode,be,Xe),J.return=te,J):(J=v(J,le),J.return=te,J)}function ve(te,J,le){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return J=zd(""+J,te.mode,le),J.return=te,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case j:return le=kr(J.type,J.key,J.props,null,te.mode,le),Zs(le,J),le.return=te,le;case w:return J=kd(J,te.mode,le),J.return=te,J;case U:return J=Dl(J),ve(te,J,le)}if(ce(J)||ne(J))return J=qi(J,te.mode,le,null),J.return=te,J;if(typeof J.then=="function")return ve(te,du(J),le);if(J.$$typeof===z)return ve(te,Ho(te,J),le);Bo(te,J)}return null}function de(te,J,le,be){var Xe=J!==null?J.key:null;if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return Xe!==null?null:H(te,J,""+le,be);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case j:return le.key===Xe?X(te,J,le,be):null;case w:return le.key===Xe?oe(te,J,le,be):null;case U:return le=Dl(le),de(te,J,le,be)}if(ce(le)||ne(le))return Xe!==null?null:ye(te,J,le,be,null);if(typeof le.then=="function")return de(te,J,du(le),be);if(le.$$typeof===z)return de(te,J,Ho(te,le),be);Bo(te,le)}return null}function ge(te,J,le,be,Xe){if(typeof be=="string"&&be!==""||typeof be=="number"||typeof be=="bigint")return te=te.get(le)||null,H(J,te,""+be,Xe);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case j:return te=te.get(be.key===null?le:be.key)||null,X(J,te,be,Xe);case w:return te=te.get(be.key===null?le:be.key)||null,oe(J,te,be,Xe);case U:return be=Dl(be),ge(te,J,le,be,Xe)}if(ce(be)||ne(be))return te=te.get(le)||null,ye(J,te,be,Xe,null);if(typeof be.then=="function")return ge(te,J,le,du(be),Xe);if(be.$$typeof===z)return ge(te,J,le,Ho(J,be),Xe);Bo(J,be)}return null}function Be(te,J,le,be){for(var Xe=null,Kt=null,Ye=J,gt=J=0,zt=null;Ye!==null&><le.length;gt++){Ye.index>gt?(zt=Ye,Ye=null):zt=Ye.sibling;var Xt=de(te,Ye,le[gt],be);if(Xt===null){Ye===null&&(Ye=zt);break}a&&Ye&&Xt.alternate===null&&r(te,Ye),J=N(Xt,J,gt),Kt===null?Xe=Xt:Kt.sibling=Xt,Kt=Xt,Ye=zt}if(gt===le.length)return u(te,Ye),jt&&Lr(te,gt),Xe;if(Ye===null){for(;gt<le.length;gt++)Ye=ve(te,le[gt],be),Ye!==null&&(J=N(Ye,J,gt),Kt===null?Xe=Ye:Kt.sibling=Ye,Kt=Ye);return jt&&Lr(te,gt),Xe}for(Ye=m(Ye);gt<le.length;gt++)zt=ge(Ye,te,gt,le[gt],be),zt!==null&&(a&&zt.alternate!==null&&Ye.delete(zt.key===null?gt:zt.key),J=N(zt,J,gt),Kt===null?Xe=zt:Kt.sibling=zt,Kt=zt);return a&&Ye.forEach(function(oc){return r(te,oc)}),jt&&Lr(te,gt),Xe}function Je(te,J,le,be){if(le==null)throw Error(s(151));for(var Xe=null,Kt=null,Ye=J,gt=J=0,zt=null,Xt=le.next();Ye!==null&&!Xt.done;gt++,Xt=le.next()){Ye.index>gt?(zt=Ye,Ye=null):zt=Ye.sibling;var oc=de(te,Ye,Xt.value,be);if(oc===null){Ye===null&&(Ye=zt);break}a&&Ye&&oc.alternate===null&&r(te,Ye),J=N(oc,J,gt),Kt===null?Xe=oc:Kt.sibling=oc,Kt=oc,Ye=zt}if(Xt.done)return u(te,Ye),jt&&Lr(te,gt),Xe;if(Ye===null){for(;!Xt.done;gt++,Xt=le.next())Xt=ve(te,Xt.value,be),Xt!==null&&(J=N(Xt,J,gt),Kt===null?Xe=Xt:Kt.sibling=Xt,Kt=Xt);return jt&&Lr(te,gt),Xe}for(Ye=m(Ye);!Xt.done;gt++,Xt=le.next())Xt=ge(Ye,te,gt,Xt.value,be),Xt!==null&&(a&&Xt.alternate!==null&&Ye.delete(Xt.key===null?gt:Xt.key),J=N(Xt,J,gt),Kt===null?Xe=Xt:Kt.sibling=Xt,Kt=Xt);return a&&Ye.forEach(function(q7){return r(te,q7)}),jt&&Lr(te,gt),Xe}function dn(te,J,le,be){if(typeof le=="object"&&le!==null&&le.type===T&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case j:e:{for(var Xe=le.key;J!==null;){if(J.key===Xe){if(Xe=le.type,Xe===T){if(J.tag===7){u(te,J.sibling),be=v(J,le.props.children),be.return=te,te=be;break e}}else if(J.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===U&&Dl(Xe)===J.type){u(te,J.sibling),be=v(J,le.props),Zs(be,le),be.return=te,te=be;break e}u(te,J);break}else r(te,J);J=J.sibling}le.type===T?(be=qi(le.props.children,te.mode,be,le.key),be.return=te,te=be):(be=kr(le.type,le.key,le.props,null,te.mode,be),Zs(be,le),be.return=te,te=be)}return A(te);case w:e:{for(Xe=le.key;J!==null;){if(J.key===Xe)if(J.tag===4&&J.stateNode.containerInfo===le.containerInfo&&J.stateNode.implementation===le.implementation){u(te,J.sibling),be=v(J,le.children||[]),be.return=te,te=be;break e}else{u(te,J);break}else r(te,J);J=J.sibling}be=kd(le,te.mode,be),be.return=te,te=be}return A(te);case U:return le=Dl(le),dn(te,J,le,be)}if(ce(le))return Be(te,J,le,be);if(ne(le)){if(Xe=ne(le),typeof Xe!="function")throw Error(s(150));return le=Xe.call(le),Je(te,J,le,be)}if(typeof le.then=="function")return dn(te,J,du(le),be);if(le.$$typeof===z)return dn(te,J,Ho(te,le),be);Bo(te,le)}return typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint"?(le=""+le,J!==null&&J.tag===6?(u(te,J.sibling),be=v(J,le),be.return=te,te=be):(u(te,J),be=zd(le,te.mode,be),be.return=te,te=be),A(te)):u(te,J)}return function(te,J,le,be){try{Ul=0;var Xe=dn(te,J,le,be);return Ll=null,Xe}catch(Ye){if(Ye===Al||Ye===ft)throw Ye;var Kt=On(29,Ye,null,te.mode);return Kt.lanes=be,Kt.return=te,Kt}finally{}}}var mi=Qd(!0),Kd=Qd(!1),Ia=!1;function fu(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Fh(a,r){a=a.updateQueue,r.updateQueue===a&&(r.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function gi(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function Qi(a,r,u){var m=a.updateQueue;if(m===null)return null;if(m=m.shared,(Ve&2)!==0){var v=m.pending;return v===null?r.next=r:(r.next=v.next,v.next=r),m.pending=r,r=Xs(a),Li(a,null,u),r}return Sa(a,m,r,u),Xs(a)}function Ki(a,r,u){if(r=r.updateQueue,r!==null&&(r=r.shared,(u&4194048)!==0)){var m=r.lanes;m&=a.pendingLanes,u|=m,r.lanes=u,ls(a,u)}}function Ke(a,r){var u=a.updateQueue,m=a.alternate;if(m!==null&&(m=m.updateQueue,u===m)){var v=null,N=null;if(u=u.firstBaseUpdate,u!==null){do{var A={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};N===null?v=N=A:N=N.next=A,u=u.next}while(u!==null);N===null?v=N=r:N=N.next=r}else v=N=r;u={baseState:m.baseState,firstBaseUpdate:v,lastBaseUpdate:N,shared:m.shared,callbacks:m.callbacks},a.updateQueue=u;return}a=u.lastBaseUpdate,a===null?u.firstBaseUpdate=r:a.next=r,u.lastBaseUpdate=r}var Zh=!1;function hu(){if(Zh){var a=Fs;if(a!==null)throw a}}function Go(a,r,u,m){Zh=!1;var v=a.updateQueue;Ia=!1;var N=v.firstBaseUpdate,A=v.lastBaseUpdate,H=v.shared.pending;if(H!==null){v.shared.pending=null;var X=H,oe=X.next;X.next=null,A===null?N=oe:A.next=oe,A=X;var ye=a.alternate;ye!==null&&(ye=ye.updateQueue,H=ye.lastBaseUpdate,H!==A&&(H===null?ye.firstBaseUpdate=oe:H.next=oe,ye.lastBaseUpdate=X))}if(N!==null){var ve=v.baseState;A=0,ye=oe=X=null,H=N;do{var de=H.lane&-536870913,ge=de!==H.lane;if(ge?(ut&de)===de:(m&de)===de){de!==0&&de===pi&&(Zh=!0),ye!==null&&(ye=ye.next={lane:0,tag:H.tag,payload:H.payload,callback:null,next:null});e:{var Be=a,Je=H;de=r;var dn=u;switch(Je.tag){case 1:if(Be=Je.payload,typeof Be=="function"){ve=Be.call(dn,ve,de);break e}ve=Be;break e;case 3:Be.flags=Be.flags&-65537|128;case 0:if(Be=Je.payload,de=typeof Be=="function"?Be.call(dn,ve,de):Be,de==null)break e;ve=b({},ve,de);break e;case 2:Ia=!0}}de=H.callback,de!==null&&(a.flags|=64,ge&&(a.flags|=8192),ge=v.callbacks,ge===null?v.callbacks=[de]:ge.push(de))}else ge={lane:de,tag:H.tag,payload:H.payload,callback:H.callback,next:null},ye===null?(oe=ye=ge,X=ve):ye=ye.next=ge,A|=de;if(H=H.next,H===null){if(H=v.shared.pending,H===null)break;ge=H,H=ge.next,ge.next=null,v.lastBaseUpdate=ge,v.shared.pending=null}}while(!0);ye===null&&(X=ve),v.baseState=X,v.firstBaseUpdate=oe,v.lastBaseUpdate=ye,N===null&&(v.shared.lanes=0),Ir|=A,a.lanes=A,a.memoizedState=ve}}function Po(a,r){if(typeof a!="function")throw Error(s(191,a));a.call(r)}function Dg(a,r){var u=a.callbacks;if(u!==null)for(a.callbacks=null,a=0;a<u.length;a++)Po(u[a],r)}var Yo=B(null),Xd=B(0);function zg(a,r){a=ks,fe(Xd,a),fe(Yo,r),ks=a|r.baseLanes}function Ih(){fe(Xd,ks),fe(Yo,Yo.current)}function pu(){ks=Xd.current,I(Yo),I(Xd)}var fs=B(null),Ja=null;function yi(a){var r=a.alternate;fe(wt,wt.current&1),fe(fs,a),Ja===null&&(r===null||Yo.current!==null||r.memoizedState!==null)&&(Ja=a)}function Jh(a){fe(wt,wt.current),fe(fs,a),Ja===null&&(Ja=a)}function kg(a){a.tag===22?(fe(wt,wt.current),fe(fs,a),Ja===null&&(Ja=a)):hs()}function hs(){fe(wt,wt.current),fe(fs,fs.current)}function Zn(a){I(fs),Ja===a&&(Ja=null),I(wt)}var wt=B(0);function As(a){for(var r=a;r!==null;){if(r.tag===13){var u=r.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Dy(u)||zy(u)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break;for(;r.sibling===null;){if(r.return===null||r.return===a)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var vn=0,rt=null,tn=null,St=null,Is=!1,Vo=!1,ql=!1,Fd=0,mu=0,Qo=null,Wh=0;function An(){throw Error(s(321))}function $h(a,r){if(r===null)return!1;for(var u=0;u<r.length&&u<a.length;u++)if(!Fa(a[u],r[u]))return!1;return!0}function Zd(a,r,u,m,v,N){return vn=N,rt=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,Y.H=a===null||a.memoizedState===null?h0:bp,ql=!1,N=u(m,v),ql=!1,Vo&&(N=Hl(r,u,m,v)),Lg(a),N}function Lg(a){Y.H=Ko;var r=tn!==null&&tn.next!==null;if(vn=0,St=tn=rt=null,Is=!1,mu=0,Qo=null,r)throw Error(s(300));a===null||aa||(a=a.dependencies,a!==null&&ou(a)&&(aa=!0))}function Hl(a,r,u,m){rt=a;var v=0;do{if(Vo&&(Qo=null),mu=0,Vo=!1,25<=v)throw Error(s(301));if(v+=1,St=tn=null,a.updateQueue!=null){var N=a.updateQueue;N.lastEffect=null,N.events=null,N.stores=null,N.memoCache!=null&&(N.memoCache.index=0)}Y.H=Js,N=r(u,m)}while(Vo);return N}function Bl(){var a=Y.H,r=a.useState()[0];return r=typeof r.then=="function"?gu(r):r,a=a.useState()[0],(tn!==null?tn.memoizedState:null)!==a&&(rt.flags|=1024),r}function ep(){var a=Fd!==0;return Fd=0,a}function tp(a,r,u){r.updateQueue=a.updateQueue,r.flags&=-2053,a.lanes&=~u}function np(a){if(Is){for(a=a.memoizedState;a!==null;){var r=a.queue;r!==null&&(r.pending=null),a=a.next}Is=!1}vn=0,St=tn=rt=null,Vo=!1,mu=Fd=0,Qo=null}function ca(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return St===null?rt.memoizedState=St=a:St=St.next=a,St}function In(){if(tn===null){var a=rt.alternate;a=a!==null?a.memoizedState:null}else a=tn.next;var r=St===null?rt.memoizedState:St.next;if(r!==null)St=r,tn=a;else{if(a===null)throw rt.alternate===null?Error(s(467)):Error(s(310));tn=a,a={memoizedState:tn.memoizedState,baseState:tn.baseState,baseQueue:tn.baseQueue,queue:tn.queue,next:null},St===null?rt.memoizedState=St=a:St=St.next=a}return St}function Id(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function gu(a){var r=mu;return mu+=1,Qo===null&&(Qo=[]),a=Vd(Qo,a,r),r=rt,(St===null?r.memoizedState:St.next)===null&&(r=r.alternate,Y.H=r===null||r.memoizedState===null?h0:bp),a}function Xi(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return gu(a);if(a.$$typeof===z)return $e(a)}throw Error(s(438,String(a)))}function ap(a){var r=null,u=rt.updateQueue;if(u!==null&&(r=u.memoCache),r==null){var m=rt.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(r={data:m.data.map(function(v){return v.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),u===null&&(u=Id(),rt.updateQueue=u),u.memoCache=r,u=r.data[r.index],u===void 0)for(u=r.data[r.index]=Array(a),m=0;m<a;m++)u[m]=Z;return r.index++,u}function xi(a,r){return typeof r=="function"?r(a):r}function Jd(a){var r=In();return sp(r,tn,a)}function sp(a,r,u){var m=a.queue;if(m===null)throw Error(s(311));m.lastRenderedReducer=u;var v=a.baseQueue,N=m.pending;if(N!==null){if(v!==null){var A=v.next;v.next=N.next,N.next=A}r.baseQueue=v=N,m.pending=null}if(N=a.baseState,v===null)a.memoizedState=N;else{r=v.next;var H=A=null,X=null,oe=r,ye=!1;do{var ve=oe.lane&-536870913;if(ve!==oe.lane?(ut&ve)===ve:(vn&ve)===ve){var de=oe.revertLane;if(de===0)X!==null&&(X=X.next={lane:0,revertLane:0,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),ve===pi&&(ye=!0);else if((vn&de)===de){oe=oe.next,de===pi&&(ye=!0);continue}else ve={lane:0,revertLane:oe.revertLane,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},X===null?(H=X=ve,A=N):X=X.next=ve,rt.lanes|=de,Ir|=de;ve=oe.action,ql&&u(N,ve),N=oe.hasEagerState?oe.eagerState:u(N,ve)}else de={lane:ve,revertLane:oe.revertLane,gesture:oe.gesture,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},X===null?(H=X=de,A=N):X=X.next=de,rt.lanes|=ve,Ir|=ve;oe=oe.next}while(oe!==null&&oe!==r);if(X===null?A=N:X.next=H,!Fa(N,a.memoizedState)&&(aa=!0,ye&&(u=Fs,u!==null)))throw u;a.memoizedState=N,a.baseState=A,a.baseQueue=X,m.lastRenderedState=N}return v===null&&(m.lanes=0),[a.memoizedState,m.dispatch]}function rp(a){var r=In(),u=r.queue;if(u===null)throw Error(s(311));u.lastRenderedReducer=a;var m=u.dispatch,v=u.pending,N=r.memoizedState;if(v!==null){u.pending=null;var A=v=v.next;do N=a(N,A.action),A=A.next;while(A!==v);Fa(N,r.memoizedState)||(aa=!0),r.memoizedState=N,r.baseQueue===null&&(r.baseState=N),u.lastRenderedState=N}return[N,m]}function Ug(a,r,u){var m=rt,v=In(),N=jt;if(N){if(u===void 0)throw Error(s(407));u=u()}else u=r();var A=!Fa((tn||v).memoizedState,u);if(A&&(v.memoizedState=u,aa=!0),v=v.queue,hp(Bg.bind(null,m,v,a),[a]),v.getSnapshot!==r||A||St!==null&&St.memoizedState.tag&1){if(m.flags|=2048,Fi(9,{destroy:void 0},Hg.bind(null,m,v,u,r),null),nt===null)throw Error(s(349));N||(vn&127)!==0||qg(m,r,u)}return u}function qg(a,r,u){a.flags|=16384,a={getSnapshot:r,value:u},r=rt.updateQueue,r===null?(r=Id(),rt.updateQueue=r,r.stores=[a]):(u=r.stores,u===null?r.stores=[a]:u.push(a))}function Hg(a,r,u,m){r.value=u,r.getSnapshot=m,Gg(r)&&Pg(a)}function Bg(a,r,u){return u(function(){Gg(r)&&Pg(a)})}function Gg(a){var r=a.getSnapshot;a=a.value;try{var u=r();return!Fa(a,u)}catch{return!0}}function Pg(a){var r=Za(a,2);r!==null&&pt(r,a,2)}function ip(a){var r=ca();if(typeof a=="function"){var u=a;if(a=u(),ql){is(!0);try{u()}finally{is(!1)}}}return r.memoizedState=r.baseState=a,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xi,lastRenderedState:a},r}function lp(a,r,u,m){return a.baseState=u,sp(a,tn,typeof m=="function"?m:xi)}function yy(a,r,u,m,v){if(tf(a))throw Error(s(485));if(a=r.action,a!==null){var N={payload:v,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(A){N.listeners.push(A)}};Y.T!==null?u(!0):N.isTransition=!1,m(N),u=r.pending,u===null?(N.next=r.pending=N,Yg(r,N)):(N.next=u.next,r.pending=u.next=N)}}function Yg(a,r){var u=r.action,m=r.payload,v=a.state;if(r.isTransition){var N=Y.T,A={};Y.T=A;try{var H=u(v,m),X=Y.S;X!==null&&X(A,H),Vg(a,r,H)}catch(oe){op(a,r,oe)}finally{N!==null&&A.types!==null&&(N.types=A.types),Y.T=N}}else try{N=u(v,m),Vg(a,r,N)}catch(oe){op(a,r,oe)}}function Vg(a,r,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(m){Qg(a,r,m)},function(m){return op(a,r,m)}):Qg(a,r,u)}function Qg(a,r,u){r.status="fulfilled",r.value=u,Kg(r),a.state=u,r=a.pending,r!==null&&(u=r.next,u===r?a.pending=null:(u=u.next,r.next=u,Yg(a,u)))}function op(a,r,u){var m=a.pending;if(a.pending=null,m!==null){m=m.next;do r.status="rejected",r.reason=u,Kg(r),r=r.next;while(r!==m)}a.action=null}function Kg(a){a=a.listeners;for(var r=0;r<a.length;r++)(0,a[r])()}function cp(a,r){return r}function up(a,r){if(jt){var u=nt.formState;if(u!==null){e:{var m=rt;if(jt){if(on){t:{for(var v=on,N=Os;v.nodeType!==8;){if(!N){v=null;break t}if(v=$r(v.nextSibling),v===null){v=null;break t}}N=v.data,v=N==="F!"||N==="F"?v:null}if(v){on=$r(v.nextSibling),m=v.data==="F!";break e}}qr(m)}m=!1}m&&(r=u[0])}}return u=ca(),u.memoizedState=u.baseState=r,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cp,lastRenderedState:r},u.queue=m,u=u0.bind(null,rt,m),m.dispatch=u,m=ip(!1),N=xp.bind(null,rt,!1,m.queue),m=ca(),v={state:r,dispatch:null,action:a,pending:null},m.queue=v,u=yy.bind(null,rt,v,N,u),v.dispatch=u,m.memoizedState=a,[r,u,!1]}function Xg(a){var r=In();return dp(r,tn,a)}function dp(a,r,u){if(r=sp(a,r,cp)[0],a=Jd(xi)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var m=gu(r)}catch(A){throw A===Al?ft:A}else m=r;r=In();var v=r.queue,N=v.dispatch;return u!==r.memoizedState&&(rt.flags|=2048,Fi(9,{destroy:void 0},Fg.bind(null,v,u),null)),[m,N,a]}function Fg(a,r){a.action=r}function fp(a){var r=In(),u=tn;if(u!==null)return dp(r,u,a);In(),r=r.memoizedState,u=In();var m=u.queue.dispatch;return u.memoizedState=a,[r,m,!1]}function Fi(a,r,u,m){return a={tag:a,create:u,deps:m,inst:r,next:null},r=rt.updateQueue,r===null&&(r=Id(),rt.updateQueue=r),u=r.lastEffect,u===null?r.lastEffect=a.next=a:(m=u.next,u.next=a,a.next=m,r.lastEffect=a),a}function Wd(){return In().memoizedState}function $d(a,r,u,m){var v=ca();rt.flags|=a,v.memoizedState=Fi(1|r,{destroy:void 0},u,m===void 0?null:m)}function ef(a,r,u,m){var v=In();m=m===void 0?null:m;var N=v.memoizedState.inst;tn!==null&&m!==null&&$h(m,tn.memoizedState.deps)?v.memoizedState=Fi(r,N,u,m):(rt.flags|=a,v.memoizedState=Fi(1|r,N,u,m))}function Zg(a,r){$d(8390656,8,a,r)}function hp(a,r){ef(2048,8,a,r)}function Ig(a){rt.flags|=4;var r=rt.updateQueue;if(r===null)r=Id(),rt.updateQueue=r,r.events=[a];else{var u=r.events;u===null?r.events=[a]:u.push(a)}}function Jg(a){var r=In().memoizedState;return Ig({ref:r,nextImpl:a}),function(){if((Ve&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function Wg(a,r){return ef(4,2,a,r)}function $g(a,r){return ef(4,4,a,r)}function e0(a,r){if(typeof r=="function"){a=a();var u=r(a);return function(){typeof u=="function"?u():r(null)}}if(r!=null)return a=a(),r.current=a,function(){r.current=null}}function t0(a,r,u){u=u!=null?u.concat([a]):null,ef(4,4,e0.bind(null,r,a),u)}function pp(){}function n0(a,r){var u=In();r=r===void 0?null:r;var m=u.memoizedState;return r!==null&&$h(r,m[1])?m[0]:(u.memoizedState=[a,r],a)}function a0(a,r){var u=In();r=r===void 0?null:r;var m=u.memoizedState;if(r!==null&&$h(r,m[1]))return m[0];if(m=a(),ql){is(!0);try{a()}finally{is(!1)}}return u.memoizedState=[m,r],m}function mp(a,r,u){return u===void 0||(vn&1073741824)!==0&&(ut&261930)===0?a.memoizedState=r:(a.memoizedState=u,a=bt(),rt.lanes|=a,Ir|=a,u)}function s0(a,r,u,m){return Fa(u,r)?u:Yo.current!==null?(a=mp(a,u,m),Fa(a,r)||(aa=!0),a):(vn&42)===0||(vn&1073741824)!==0&&(ut&261930)===0?(aa=!0,a.memoizedState=u):(a=bt(),rt.lanes|=a,Ir|=a,r)}function r0(a,r,u,m,v){var N=$.p;$.p=N!==0&&8>N?N:8;var A=Y.T,H={};Y.T=H,xp(a,!1,r,u);try{var X=v(),oe=Y.S;if(oe!==null&&oe(H,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var ye=Kh(X,m);yu(a,r,ye,Us(a))}else yu(a,r,m,Us(a))}catch(ve){yu(a,r,{then:function(){},status:"rejected",reason:ve},Us())}finally{$.p=N,A!==null&&H.types!==null&&(A.types=H.types),Y.T=A}}function xy(){}function gp(a,r,u,m){if(a.tag!==5)throw Error(s(476));var v=i0(a).queue;r0(a,v,r,ae,u===null?xy:function(){return l0(a),u(m)})}function i0(a){var r=a.memoizedState;if(r!==null)return r;r={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xi,lastRenderedState:ae},next:null};var u={};return r.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xi,lastRenderedState:u},next:null},a.memoizedState=r,a=a.alternate,a!==null&&(a.memoizedState=r),r}function l0(a){var r=i0(a);r.next===null&&(r=a.alternate.memoizedState),yu(a,r.next.queue,{},Us())}function yp(){return $e(Hp)}function o0(){return In().memoizedState}function c0(){return In().memoizedState}function by(a){for(var r=a.return;r!==null;){switch(r.tag){case 24:case 3:var u=Us();a=gi(u);var m=Qi(r,a,u);m!==null&&(pt(m,r,u),Ki(m,r,u)),r={cache:Yh()},a.payload=r;return}r=r.return}}function vy(a,r,u){var m=Us();u={lane:m,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},tf(a)?d0(r,u):(u=Ad(a,r,u,m),u!==null&&(pt(u,a,m),f0(u,r,m)))}function u0(a,r,u){var m=Us();yu(a,r,u,m)}function yu(a,r,u,m){var v={lane:m,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(tf(a))d0(r,v);else{var N=a.alternate;if(a.lanes===0&&(N===null||N.lanes===0)&&(N=r.lastRenderedReducer,N!==null))try{var A=r.lastRenderedState,H=N(A,u);if(v.hasEagerState=!0,v.eagerState=H,Fa(H,A))return Sa(a,r,v,0),nt===null&&iu(),!1}catch{}finally{}if(u=Ad(a,r,v,m),u!==null)return pt(u,a,m),f0(u,r,m),!0}return!1}function xp(a,r,u,m){if(m={lane:2,revertLane:he(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},tf(a)){if(r)throw Error(s(479))}else r=Ad(a,u,m,2),r!==null&&pt(r,a,2)}function tf(a){var r=a.alternate;return a===rt||r!==null&&r===rt}function d0(a,r){Vo=Is=!0;var u=a.pending;u===null?r.next=r:(r.next=u.next,u.next=r),a.pending=r}function f0(a,r,u){if((u&4194048)!==0){var m=r.lanes;m&=a.pendingLanes,u|=m,r.lanes=u,ls(a,u)}}var Ko={readContext:$e,use:Xi,useCallback:An,useContext:An,useEffect:An,useImperativeHandle:An,useLayoutEffect:An,useInsertionEffect:An,useMemo:An,useReducer:An,useRef:An,useState:An,useDebugValue:An,useDeferredValue:An,useTransition:An,useSyncExternalStore:An,useId:An,useHostTransitionStatus:An,useFormState:An,useActionState:An,useOptimistic:An,useMemoCache:An,useCacheRefresh:An};Ko.useEffectEvent=An;var h0={readContext:$e,use:Xi,useCallback:function(a,r){return ca().memoizedState=[a,r===void 0?null:r],a},useContext:$e,useEffect:Zg,useImperativeHandle:function(a,r,u){u=u!=null?u.concat([a]):null,$d(4194308,4,e0.bind(null,r,a),u)},useLayoutEffect:function(a,r){return $d(4194308,4,a,r)},useInsertionEffect:function(a,r){$d(4,2,a,r)},useMemo:function(a,r){var u=ca();r=r===void 0?null:r;var m=a();if(ql){is(!0);try{a()}finally{is(!1)}}return u.memoizedState=[m,r],m},useReducer:function(a,r,u){var m=ca();if(u!==void 0){var v=u(r);if(ql){is(!0);try{u(r)}finally{is(!1)}}}else v=r;return m.memoizedState=m.baseState=v,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:v},m.queue=a,a=a.dispatch=vy.bind(null,rt,a),[m.memoizedState,a]},useRef:function(a){var r=ca();return a={current:a},r.memoizedState=a},useState:function(a){a=ip(a);var r=a.queue,u=u0.bind(null,rt,r);return r.dispatch=u,[a.memoizedState,u]},useDebugValue:pp,useDeferredValue:function(a,r){var u=ca();return mp(u,a,r)},useTransition:function(){var a=ip(!1);return a=r0.bind(null,rt,a.queue,!0,!1),ca().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,r,u){var m=rt,v=ca();if(jt){if(u===void 0)throw Error(s(407));u=u()}else{if(u=r(),nt===null)throw Error(s(349));(ut&127)!==0||qg(m,r,u)}v.memoizedState=u;var N={value:u,getSnapshot:r};return v.queue=N,Zg(Bg.bind(null,m,N,a),[a]),m.flags|=2048,Fi(9,{destroy:void 0},Hg.bind(null,m,N,u,r),null),u},useId:function(){var a=ca(),r=nt.identifierPrefix;if(jt){var u=yr,m=Mn;u=(m&~(1<<32-ba(m)-1)).toString(32)+u,r="_"+r+"R_"+u,u=Fd++,0<u&&(r+="H"+u.toString(32)),r+="_"}else u=Wh++,r="_"+r+"r_"+u.toString(32)+"_";return a.memoizedState=r},useHostTransitionStatus:yp,useFormState:up,useActionState:up,useOptimistic:function(a){var r=ca();r.memoizedState=r.baseState=a;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=u,r=xp.bind(null,rt,!0,u),u.dispatch=r,[a,r]},useMemoCache:ap,useCacheRefresh:function(){return ca().memoizedState=by.bind(null,rt)},useEffectEvent:function(a){var r=ca(),u={impl:a};return r.memoizedState=u,function(){if((Ve&2)!==0)throw Error(s(440));return u.impl.apply(void 0,arguments)}}},bp={readContext:$e,use:Xi,useCallback:n0,useContext:$e,useEffect:hp,useImperativeHandle:t0,useInsertionEffect:Wg,useLayoutEffect:$g,useMemo:a0,useReducer:Jd,useRef:Wd,useState:function(){return Jd(xi)},useDebugValue:pp,useDeferredValue:function(a,r){var u=In();return s0(u,tn.memoizedState,a,r)},useTransition:function(){var a=Jd(xi)[0],r=In().memoizedState;return[typeof a=="boolean"?a:gu(a),r]},useSyncExternalStore:Ug,useId:o0,useHostTransitionStatus:yp,useFormState:Xg,useActionState:Xg,useOptimistic:function(a,r){var u=In();return lp(u,tn,a,r)},useMemoCache:ap,useCacheRefresh:c0};bp.useEffectEvent=Jg;var Js={readContext:$e,use:Xi,useCallback:n0,useContext:$e,useEffect:hp,useImperativeHandle:t0,useInsertionEffect:Wg,useLayoutEffect:$g,useMemo:a0,useReducer:rp,useRef:Wd,useState:function(){return rp(xi)},useDebugValue:pp,useDeferredValue:function(a,r){var u=In();return tn===null?mp(u,a,r):s0(u,tn.memoizedState,a,r)},useTransition:function(){var a=rp(xi)[0],r=In().memoizedState;return[typeof a=="boolean"?a:gu(a),r]},useSyncExternalStore:Ug,useId:o0,useHostTransitionStatus:yp,useFormState:fp,useActionState:fp,useOptimistic:function(a,r){var u=In();return tn!==null?lp(u,tn,a,r):(u.baseState=a,[a,u.queue.dispatch])},useMemoCache:ap,useCacheRefresh:c0};Js.useEffectEvent=Jg;function nf(a,r,u,m){r=a.memoizedState,u=u(m,r),u=u==null?r:b({},r,u),a.memoizedState=u,a.lanes===0&&(a.updateQueue.baseState=u)}var xu={enqueueSetState:function(a,r,u){a=a._reactInternals;var m=Us(),v=gi(m);v.payload=r,u!=null&&(v.callback=u),r=Qi(a,v,m),r!==null&&(pt(r,a,m),Ki(r,a,m))},enqueueReplaceState:function(a,r,u){a=a._reactInternals;var m=Us(),v=gi(m);v.tag=1,v.payload=r,u!=null&&(v.callback=u),r=Qi(a,v,m),r!==null&&(pt(r,a,m),Ki(r,a,m))},enqueueForceUpdate:function(a,r){a=a._reactInternals;var u=Us(),m=gi(u);m.tag=2,r!=null&&(m.callback=r),r=Qi(a,m,u),r!==null&&(pt(r,a,u),Ki(r,a,u))}};function vp(a,r,u,m,v,N,A){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(m,N,A):r.prototype&&r.prototype.isPureReactComponent?!To(u,m)||!To(v,N):!0}function Sp(a,r,u,m){a=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(u,m),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(u,m),r.state!==a&&xu.enqueueReplaceState(r,r.state,null)}function Zi(a,r){var u=r;if("ref"in r){u={};for(var m in r)m!=="ref"&&(u[m]=r[m])}if(a=a.defaultProps){u===r&&(u=b({},u));for(var v in a)u[v]===void 0&&(u[v]=a[v])}return u}function p0(a){ru(a)}function Np(a){console.error(a)}function _p(a){ru(a)}function af(a,r){try{var u=a.onUncaughtError;u(r.value,{componentStack:r.stack})}catch(m){setTimeout(function(){throw m})}}function m0(a,r,u){try{var m=a.onCaughtError;m(u.value,{componentStack:u.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(v){setTimeout(function(){throw v})}}function Cp(a,r,u){return u=gi(u),u.tag=3,u.payload={element:null},u.callback=function(){af(a,r)},u}function jp(a){return a=gi(a),a.tag=3,a}function g0(a,r,u,m){var v=u.type.getDerivedStateFromError;if(typeof v=="function"){var N=m.value;a.payload=function(){return v(N)},a.callback=function(){m0(r,u,m)}}var A=u.stateNode;A!==null&&typeof A.componentDidCatch=="function"&&(a.callback=function(){m0(r,u,m),typeof v!="function"&&($n===null?$n=new Set([this]):$n.add(this));var H=m.stack;this.componentDidCatch(m.value,{componentStack:H!==null?H:""})})}function ua(a,r,u,m,v){if(u.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(r=u.alternate,r!==null&&Pr(r,u,v,!0),u=fs.current,u!==null){switch(u.tag){case 31:case 13:return Ja===null?$o():u.alternate===null&&Dn===0&&(Dn=3),u.flags&=-257,u.flags|=65536,u.lanes=v,m===Yd?u.flags|=16384:(r=u.updateQueue,r===null?u.updateQueue=new Set([m]):r.add(m),Ou(a,m,v)),!1;case 22:return u.flags|=65536,m===Yd?u.flags|=16384:(r=u.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([m])},u.updateQueue=r):(u=r.retryQueue,u===null?r.retryQueue=new Set([m]):u.add(m)),Ou(a,m,v)),!1}throw Error(s(435,u.tag))}return Ou(a,m,v),$o(),!1}if(jt)return r=fs.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=v,m!==Lo&&(a=Error(s(422),{cause:m}),Hr(Rs(a,u)))):(m!==Lo&&(r=Error(s(423),{cause:m}),Hr(Rs(r,u))),a=a.current.alternate,a.flags|=65536,v&=-v,a.lanes|=v,m=Rs(m,u),v=Cp(a.stateNode,m,v),Ke(a,v),Dn!==4&&(Dn=2)),!1;var N=Error(s(520),{cause:m});if(N=Rs(N,u),Fl===null?Fl=[N]:Fl.push(N),Dn!==4&&(Dn=2),r===null)return!0;m=Rs(m,u),u=r;do{switch(u.tag){case 3:return u.flags|=65536,a=v&-v,u.lanes|=a,a=Cp(u.stateNode,m,a),Ke(u,a),!1;case 1:if(r=u.type,N=u.stateNode,(u.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||N!==null&&typeof N.componentDidCatch=="function"&&($n===null||!$n.has(N))))return u.flags|=65536,v&=-v,u.lanes|=v,v=jp(v),g0(v,a,u,m),Ke(u,v),!1}u=u.return}while(u!==null);return!1}var sf=Error(s(461)),aa=!1;function Na(a,r,u,m){r.child=a===null?Kd(r,null,u,m):mi(r,a.child,u,m)}function wp(a,r,u,m,v){u=u.render;var N=r.ref;if("ref"in m){var A={};for(var H in m)H!=="ref"&&(A[H]=m[H])}else A=m;return Yi(r),m=Zd(a,r,u,A,N,v),H=ep(),a!==null&&!aa?(tp(a,r,v),Jn(a,r,v)):(jt&&H&&Ur(r),r.flags|=1,Na(a,r,m,v),r.child)}function Gl(a,r,u,m,v){if(a===null){var N=u.type;return typeof N=="function"&&!Dd(N)&&N.defaultProps===void 0&&u.compare===null?(r.tag=15,r.type=N,rf(a,r,N,m,v)):(a=kr(u.type,null,m,r,r.mode,v),a.ref=r.ref,a.return=r,r.child=a)}if(N=a.child,!ff(a,v)){var A=N.memoizedProps;if(u=u.compare,u=u!==null?u:To,u(A,m)&&a.ref===r.ref)return Jn(a,r,v)}return r.flags|=1,a=cs(N,m),a.ref=r.ref,a.return=r,r.child=a}function rf(a,r,u,m,v){if(a!==null){var N=a.memoizedProps;if(To(N,m)&&a.ref===r.ref)if(aa=!1,r.pendingProps=m=N,ff(a,v))(a.flags&131072)!==0&&(aa=!0);else return r.lanes=a.lanes,Jn(a,r,v)}return Xo(a,r,u,m,v)}function Pl(a,r,u,m){var v=m.children,N=a!==null?a.memoizedState:null;if(a===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((r.flags&128)!==0){if(N=N!==null?N.baseLanes|u:u,a!==null){for(m=r.child=a.child,v=0;m!==null;)v=v|m.lanes|m.childLanes,m=m.sibling;m=v&~N}else m=0,r.child=null;return ps(a,r,N,u,m)}if((u&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},a!==null&&cu(r,N!==null?N.cachePool:null),N!==null?zg(r,N):Ih(),kg(r);else return m=r.lanes=536870912,ps(a,r,N!==null?N.baseLanes|u:u,u,m)}else N!==null?(cu(r,N.cachePool),zg(r,N),hs(),r.memoizedState=null):(a!==null&&cu(r,null),Ih(),hs());return Na(a,r,v,u),r.child}function Vr(a,r){return a!==null&&a.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function ps(a,r,u,m,v){var N=Pd();return N=N===null?null:{parent:na._currentValue,pool:N},r.memoizedState={baseLanes:u,cachePool:N},a!==null&&cu(r,null),Ih(),kg(r),a!==null&&Pr(a,r,m,!0),r.childLanes=v,null}function lf(a,r){return r=df({mode:r.mode,children:r.children},a.mode),r.ref=a.ref,a.child=r,r.return=a,r}function y0(a,r,u){return mi(r,a.child,null,u),a=lf(r,r.pendingProps),a.flags|=2,Zn(r),r.memoizedState=null,a}function of(a,r,u){var m=r.pendingProps,v=(r.flags&128)!==0;if(r.flags&=-129,a===null){if(jt){if(m.mode==="hidden")return a=lf(r,m),r.lanes=536870912,Vr(null,a);if(Jh(r),(a=on)?(a=Iv(a,Os),a=a!==null&&a.data==="&"?a:null,a!==null&&(r.memoizedState={dehydrated:a,treeContext:di!==null?{id:Mn,overflow:yr}:null,retryLane:536870912,hydrationErrors:null},u=Do(a),u.return=r,r.child=u,Bn=r,on=null)):a=null,a===null)throw qr(r);return r.lanes=536870912,null}return lf(r,m)}var N=a.memoizedState;if(N!==null){var A=N.dehydrated;if(Jh(r),v)if(r.flags&256)r.flags&=-257,r=y0(a,r,u);else if(r.memoizedState!==null)r.child=a.child,r.flags|=128,r=null;else throw Error(s(558));else if(aa||Pr(a,r,u,!1),v=(u&a.childLanes)!==0,aa||v){if(m=nt,m!==null&&(A=Bs(m,u),A!==0&&A!==N.retryLane))throw N.retryLane=A,Za(a,A),pt(m,a,A),sf;$o(),r=y0(a,r,u)}else a=N.treeContext,on=$r(A.nextSibling),Bn=r,jt=!0,fi=null,Os=!1,a!==null&&Ud(r,a),r=lf(r,m),r.flags|=4096;return r}return a=cs(a.child,{mode:m.mode,children:m.children}),a.ref=r.ref,r.child=a,a.return=r,a}function Yl(a,r){var u=r.ref;if(u===null)a!==null&&a.ref!==null&&(r.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(s(284));(a===null||a.ref!==u)&&(r.flags|=4194816)}}function Xo(a,r,u,m,v){return Yi(r),u=Zd(a,r,u,m,void 0,v),m=ep(),a!==null&&!aa?(tp(a,r,v),Jn(a,r,v)):(jt&&m&&Ur(r),r.flags|=1,Na(a,r,u,v),r.child)}function bu(a,r,u,m,v,N){return Yi(r),r.updateQueue=null,u=Hl(r,m,u,v),Lg(a),m=ep(),a!==null&&!aa?(tp(a,r,N),Jn(a,r,N)):(jt&&m&&Ur(r),r.flags|=1,Na(a,r,u,N),r.child)}function cf(a,r,u,m,v){if(Yi(r),r.stateNode===null){var N=Ui,A=u.contextType;typeof A=="object"&&A!==null&&(N=$e(A)),N=new u(m,N),r.memoizedState=N.state!==null&&N.state!==void 0?N.state:null,N.updater=xu,r.stateNode=N,N._reactInternals=r,N=r.stateNode,N.props=m,N.state=r.memoizedState,N.refs={},fu(r),A=u.contextType,N.context=typeof A=="object"&&A!==null?$e(A):Ui,N.state=r.memoizedState,A=u.getDerivedStateFromProps,typeof A=="function"&&(nf(r,u,A,m),N.state=r.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof N.getSnapshotBeforeUpdate=="function"||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(A=N.state,typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount(),A!==N.state&&xu.enqueueReplaceState(N,N.state,null),Go(r,m,N,v),hu(),N.state=r.memoizedState),typeof N.componentDidMount=="function"&&(r.flags|=4194308),m=!0}else if(a===null){N=r.stateNode;var H=r.memoizedProps,X=Zi(u,H);N.props=X;var oe=N.context,ye=u.contextType;A=Ui,typeof ye=="object"&&ye!==null&&(A=$e(ye));var ve=u.getDerivedStateFromProps;ye=typeof ve=="function"||typeof N.getSnapshotBeforeUpdate=="function",H=r.pendingProps!==H,ye||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(H||oe!==A)&&Sp(r,N,m,A),Ia=!1;var de=r.memoizedState;N.state=de,Go(r,m,N,v),hu(),oe=r.memoizedState,H||de!==oe||Ia?(typeof ve=="function"&&(nf(r,u,ve,m),oe=r.memoizedState),(X=Ia||vp(r,u,X,m,de,oe,A))?(ye||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"&&(r.flags|=4194308)):(typeof N.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=m,r.memoizedState=oe),N.props=m,N.state=oe,N.context=A,m=X):(typeof N.componentDidMount=="function"&&(r.flags|=4194308),m=!1)}else{N=r.stateNode,Fh(a,r),A=r.memoizedProps,ye=Zi(u,A),N.props=ye,ve=r.pendingProps,de=N.context,oe=u.contextType,X=Ui,typeof oe=="object"&&oe!==null&&(X=$e(oe)),H=u.getDerivedStateFromProps,(oe=typeof H=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(A!==ve||de!==X)&&Sp(r,N,m,X),Ia=!1,de=r.memoizedState,N.state=de,Go(r,m,N,v),hu();var ge=r.memoizedState;A!==ve||de!==ge||Ia||a!==null&&a.dependencies!==null&&ou(a.dependencies)?(typeof H=="function"&&(nf(r,u,H,m),ge=r.memoizedState),(ye=Ia||vp(r,u,ye,m,de,ge,X)||a!==null&&a.dependencies!==null&&ou(a.dependencies))?(oe||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(m,ge,X),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(m,ge,X)),typeof N.componentDidUpdate=="function"&&(r.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof N.componentDidUpdate!="function"||A===a.memoizedProps&&de===a.memoizedState||(r.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||A===a.memoizedProps&&de===a.memoizedState||(r.flags|=1024),r.memoizedProps=m,r.memoizedState=ge),N.props=m,N.state=ge,N.context=X,m=ye):(typeof N.componentDidUpdate!="function"||A===a.memoizedProps&&de===a.memoizedState||(r.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||A===a.memoizedProps&&de===a.memoizedState||(r.flags|=1024),m=!1)}return N=m,Yl(a,r),m=(r.flags&128)!==0,N||m?(N=r.stateNode,u=m&&typeof u.getDerivedStateFromError!="function"?null:N.render(),r.flags|=1,a!==null&&m?(r.child=mi(r,a.child,null,v),r.child=mi(r,null,u,v)):Na(a,r,u,v),r.memoizedState=N.state,a=r.child):a=Jn(a,r,v),a}function x0(a,r,u,m){return Gi(),r.flags|=256,Na(a,r,u,m),r.child}var Ep={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ga(a){return{baseLanes:a,cachePool:Xh()}}function uf(a,r,u){return a=a!==null?a.childLanes&~u:0,r&&(a|=ts),a}function b0(a,r,u){var m=r.pendingProps,v=!1,N=(r.flags&128)!==0,A;if((A=N)||(A=a!==null&&a.memoizedState===null?!1:(wt.current&2)!==0),A&&(v=!0,r.flags&=-129),A=(r.flags&32)!==0,r.flags&=-33,a===null){if(jt){if(v?yi(r):hs(),(a=on)?(a=Iv(a,Os),a=a!==null&&a.data!=="&"?a:null,a!==null&&(r.memoizedState={dehydrated:a,treeContext:di!==null?{id:Mn,overflow:yr}:null,retryLane:536870912,hydrationErrors:null},u=Do(a),u.return=r,r.child=u,Bn=r,on=null)):a=null,a===null)throw qr(r);return zy(a)?r.lanes=32:r.lanes=536870912,null}var H=m.children;return m=m.fallback,v?(hs(),v=r.mode,H=df({mode:"hidden",children:H},v),m=qi(m,v,u,null),H.return=r,m.return=r,H.sibling=m,r.child=H,m=r.child,m.memoizedState=Ga(u),m.childLanes=uf(a,A,u),r.memoizedState=Ep,Vr(null,m)):(yi(r),vu(r,H))}var X=a.memoizedState;if(X!==null&&(H=X.dehydrated,H!==null)){if(N)r.flags&256?(yi(r),r.flags&=-257,r=Tp(a,r,u)):r.memoizedState!==null?(hs(),r.child=a.child,r.flags|=128,r=null):(hs(),H=m.fallback,v=r.mode,m=df({mode:"visible",children:m.children},v),H=qi(H,v,u,null),H.flags|=2,m.return=r,H.return=r,m.sibling=H,r.child=m,mi(r,a.child,null,u),m=r.child,m.memoizedState=Ga(u),m.childLanes=uf(a,A,u),r.memoizedState=Ep,r=Vr(null,m));else if(yi(r),zy(H)){if(A=H.nextSibling&&H.nextSibling.dataset,A)var oe=A.dgst;A=oe,m=Error(s(419)),m.stack="",m.digest=A,Hr({value:m,source:null,stack:null}),r=Tp(a,r,u)}else if(aa||Pr(a,r,u,!1),A=(u&a.childLanes)!==0,aa||A){if(A=nt,A!==null&&(m=Bs(A,u),m!==0&&m!==X.retryLane))throw X.retryLane=m,Za(a,m),pt(A,a,m),sf;Dy(H)||$o(),r=Tp(a,r,u)}else Dy(H)?(r.flags|=192,r.child=a.child,r=null):(a=X.treeContext,on=$r(H.nextSibling),Bn=r,jt=!0,fi=null,Os=!1,a!==null&&Ud(r,a),r=vu(r,m.children),r.flags|=4096);return r}return v?(hs(),H=m.fallback,v=r.mode,X=a.child,oe=X.sibling,m=cs(X,{mode:"hidden",children:m.children}),m.subtreeFlags=X.subtreeFlags&65011712,oe!==null?H=cs(oe,H):(H=qi(H,v,u,null),H.flags|=2),H.return=r,m.return=r,m.sibling=H,r.child=m,Vr(null,m),m=r.child,H=a.child.memoizedState,H===null?H=Ga(u):(v=H.cachePool,v!==null?(X=na._currentValue,v=v.parent!==X?{parent:X,pool:X}:v):v=Xh(),H={baseLanes:H.baseLanes|u,cachePool:v}),m.memoizedState=H,m.childLanes=uf(a,A,u),r.memoizedState=Ep,Vr(a.child,m)):(yi(r),u=a.child,a=u.sibling,u=cs(u,{mode:"visible",children:m.children}),u.return=r,u.sibling=null,a!==null&&(A=r.deletions,A===null?(r.deletions=[a],r.flags|=16):A.push(a)),r.child=u,r.memoizedState=null,u)}function vu(a,r){return r=df({mode:"visible",children:r},a.mode),r.return=a,a.child=r}function df(a,r){return a=On(22,a,null,r),a.lanes=0,a}function Tp(a,r,u){return mi(r,a.child,null,u),a=vu(r,r.pendingProps.children),a.flags|=2,r.memoizedState=null,a}function v0(a,r,u){a.lanes|=r;var m=a.alternate;m!==null&&(m.lanes|=r),Hd(a.return,r,u)}function Vl(a,r,u,m,v,N){var A=a.memoizedState;A===null?a.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:m,tail:u,tailMode:v,treeForkCount:N}:(A.isBackwards=r,A.rendering=null,A.renderingStartTime=0,A.last=m,A.tail=u,A.tailMode=v,A.treeForkCount=N)}function ms(a,r,u){var m=r.pendingProps,v=m.revealOrder,N=m.tail;m=m.children;var A=wt.current,H=(A&2)!==0;if(H?(A=A&1|2,r.flags|=128):A&=1,fe(wt,A),Na(a,r,m,u),m=jt?ko:0,!H&&a!==null&&(a.flags&128)!==0)e:for(a=r.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&v0(a,u,r);else if(a.tag===19)v0(a,u,r);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break e;for(;a.sibling===null;){if(a.return===null||a.return===r)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(v){case"forwards":for(u=r.child,v=null;u!==null;)a=u.alternate,a!==null&&As(a)===null&&(v=u),u=u.sibling;u=v,u===null?(v=r.child,r.child=null):(v=u.sibling,u.sibling=null),Vl(r,!1,v,u,N,m);break;case"backwards":case"unstable_legacy-backwards":for(u=null,v=r.child,r.child=null;v!==null;){if(a=v.alternate,a!==null&&As(a)===null){r.child=v;break}a=v.sibling,v.sibling=u,u=v,v=a}Vl(r,!0,u,null,N,m);break;case"together":Vl(r,!1,null,null,void 0,m);break;default:r.memoizedState=null}return r.child}function Jn(a,r,u){if(a!==null&&(r.dependencies=a.dependencies),Ir|=r.lanes,(u&r.childLanes)===0)if(a!==null){if(Pr(a,r,u,!1),(u&r.childLanes)===0)return null}else return null;if(a!==null&&r.child!==a.child)throw Error(s(153));if(r.child!==null){for(a=r.child,u=cs(a,a.pendingProps),r.child=u,u.return=r;a.sibling!==null;)a=a.sibling,u=u.sibling=cs(a,a.pendingProps),u.return=r;u.sibling=null}return r.child}function ff(a,r){return(a.lanes&r)!==0?!0:(a=a.dependencies,!!(a!==null&&ou(a)))}function Sy(a,r,u){switch(r.tag){case 3:Ee(r,r.stateNode.containerInfo),hi(r,na,a.memoizedState.cache),Gi();break;case 27:case 5:Vt(r);break;case 4:Ee(r,r.stateNode.containerInfo);break;case 10:hi(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Jh(r),null;break;case 13:var m=r.memoizedState;if(m!==null)return m.dehydrated!==null?(yi(r),r.flags|=128,null):(u&r.child.childLanes)!==0?b0(a,r,u):(yi(r),a=Jn(a,r,u),a!==null?a.sibling:null);yi(r);break;case 19:var v=(a.flags&128)!==0;if(m=(u&r.childLanes)!==0,m||(Pr(a,r,u,!1),m=(u&r.childLanes)!==0),v){if(m)return ms(a,r,u);r.flags|=128}if(v=r.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),fe(wt,wt.current),m)break;return null;case 22:return r.lanes=0,Pl(a,r,u,r.pendingProps);case 24:hi(r,na,a.memoizedState.cache)}return Jn(a,r,u)}function hf(a,r,u){if(a!==null)if(a.memoizedProps!==r.pendingProps)aa=!0;else{if(!ff(a,u)&&(r.flags&128)===0)return aa=!1,Sy(a,r,u);aa=(a.flags&131072)!==0}else aa=!1,jt&&(r.flags&1048576)!==0&&Eg(r,ko,r.index);switch(r.lanes=0,r.tag){case 16:e:{var m=r.pendingProps;if(a=Dl(r.elementType),r.type=a,typeof a=="function")Dd(a)?(m=Zi(a,m),r.tag=1,r=cf(null,r,a,m,u)):(r.tag=0,r=Xo(null,r,a,m,u));else{if(a!=null){var v=a.$$typeof;if(v===k){r.tag=11,r=wp(null,r,a,m,u);break e}else if(v===L){r.tag=14,r=Gl(null,r,a,m,u);break e}}throw r=ie(a)||a,Error(s(306,r,""))}}return r;case 0:return Xo(a,r,r.type,r.pendingProps,u);case 1:return m=r.type,v=Zi(m,r.pendingProps),cf(a,r,m,v,u);case 3:e:{if(Ee(r,r.stateNode.containerInfo),a===null)throw Error(s(387));m=r.pendingProps;var N=r.memoizedState;v=N.element,Fh(a,r),Go(r,m,null,u);var A=r.memoizedState;if(m=A.cache,hi(r,na,m),m!==N.cache&&Bd(r,[na],u,!0),hu(),m=A.element,N.isDehydrated)if(N={element:m,isDehydrated:!1,cache:A.cache},r.updateQueue.baseState=N,r.memoizedState=N,r.flags&256){r=x0(a,r,m,u);break e}else if(m!==v){v=Rs(Error(s(424)),r),Hr(v),r=x0(a,r,m,u);break e}else{switch(a=r.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(on=$r(a.firstChild),Bn=r,jt=!0,fi=null,Os=!0,u=Kd(r,null,m,u),r.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(Gi(),m===v){r=Jn(a,r,u);break e}Na(a,r,m,u)}r=r.child}return r;case 26:return Yl(a,r),a===null?(u=n2(r.type,null,r.pendingProps,null))?r.memoizedState=u:jt||(u=r.type,a=r.pendingProps,m=C0(Ce.current).createElement(u),m[Ze]=r,m[ct]=a,as(m,u,a),Tn(m),r.stateNode=m):r.memoizedState=n2(r.type,a.memoizedProps,r.pendingProps,a.memoizedState),null;case 27:return Vt(r),a===null&&jt&&(m=r.stateNode=$v(r.type,r.pendingProps,Ce.current),Bn=r,Os=!0,v=on,ac(r.type)?(ky=v,on=$r(m.firstChild)):on=v),Na(a,r,r.pendingProps.children,u),Yl(a,r),a===null&&(r.flags|=4194304),r.child;case 5:return a===null&&jt&&((v=m=on)&&(m=p7(m,r.type,r.pendingProps,Os),m!==null?(r.stateNode=m,Bn=r,on=$r(m.firstChild),Os=!1,v=!0):v=!1),v||qr(r)),Vt(r),v=r.type,N=r.pendingProps,A=a!==null?a.memoizedProps:null,m=N.children,Oy(v,N)?m=null:A!==null&&Oy(v,A)&&(r.flags|=32),r.memoizedState!==null&&(v=Zd(a,r,Bl,null,null,u),Hp._currentValue=v),Yl(a,r),Na(a,r,m,u),r.child;case 6:return a===null&&jt&&((a=u=on)&&(u=m7(u,r.pendingProps,Os),u!==null?(r.stateNode=u,Bn=r,on=null,a=!0):a=!1),a||qr(r)),null;case 13:return b0(a,r,u);case 4:return Ee(r,r.stateNode.containerInfo),m=r.pendingProps,a===null?r.child=mi(r,null,m,u):Na(a,r,m,u),r.child;case 11:return wp(a,r,r.type,r.pendingProps,u);case 7:return Na(a,r,r.pendingProps,u),r.child;case 8:return Na(a,r,r.pendingProps.children,u),r.child;case 12:return Na(a,r,r.pendingProps.children,u),r.child;case 10:return m=r.pendingProps,hi(r,r.type,m.value),Na(a,r,m.children,u),r.child;case 9:return v=r.type._context,m=r.pendingProps.children,Yi(r),v=$e(v),m=m(v),r.flags|=1,Na(a,r,m,u),r.child;case 14:return Gl(a,r,r.type,r.pendingProps,u);case 15:return rf(a,r,r.type,r.pendingProps,u);case 19:return ms(a,r,u);case 31:return of(a,r,u);case 22:return Pl(a,r,u,r.pendingProps);case 24:return Yi(r),m=$e(na),a===null?(v=Pd(),v===null&&(v=nt,N=Yh(),v.pooledCache=N,N.refCount++,N!==null&&(v.pooledCacheLanes|=u),v=N),r.memoizedState={parent:m,cache:v},fu(r),hi(r,na,v)):((a.lanes&u)!==0&&(Fh(a,r),Go(r,null,null,u),hu()),v=a.memoizedState,N=r.memoizedState,v.parent!==m?(v={parent:m,cache:m},r.memoizedState=v,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=v),hi(r,na,m)):(m=N.cache,hi(r,na,m),m!==v.cache&&Bd(r,[na],u,!0))),Na(a,r,r.pendingProps.children,u),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function Qr(a){a.flags|=4}function Su(a,r,u,m,v){if((r=(a.mode&32)!==0)&&(r=!1),r){if(a.flags|=16777216,(v&335544128)===v)if(a.stateNode.complete)a.flags|=8192;else if(kn())a.flags|=8192;else throw Yr=Yd,uu}else a.flags&=-16777217}function Rp(a,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!l2(r))if(kn())a.flags|=8192;else throw Yr=Yd,uu}function bi(a,r){r!==null&&(a.flags|=4),a.flags&16384&&(r=a.tag!==22?rn():536870912,a.lanes|=r,mn|=r)}function Kr(a,r){if(!jt)switch(a.tailMode){case"hidden":r=a.tail;for(var u=null;r!==null;)r.alternate!==null&&(u=r),r=r.sibling;u===null?a.tail=null:u.sibling=null;break;case"collapsed":u=a.tail;for(var m=null;u!==null;)u.alternate!==null&&(m=u),u=u.sibling;m===null?r||a.tail===null?a.tail=null:a.tail.sibling=null:m.sibling=null}}function nn(a){var r=a.alternate!==null&&a.alternate.child===a.child,u=0,m=0;if(r)for(var v=a.child;v!==null;)u|=v.lanes|v.childLanes,m|=v.subtreeFlags&65011712,m|=v.flags&65011712,v.return=a,v=v.sibling;else for(v=a.child;v!==null;)u|=v.lanes|v.childLanes,m|=v.subtreeFlags,m|=v.flags,v.return=a,v=v.sibling;return a.subtreeFlags|=m,a.childLanes=u,r}function Nu(a,r,u){var m=r.pendingProps;switch(Ld(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return nn(r),null;case 1:return nn(r),null;case 3:return u=r.stateNode,m=null,a!==null&&(m=a.memoizedState.cache),r.memoizedState.cache!==m&&(r.flags|=2048),Gr(na),we(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(a===null||a.child===null)&&(Uo(r)?Qr(r):a===null||a.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,qd())),nn(r),null;case 26:var v=r.type,N=r.memoizedState;return a===null?(Qr(r),N!==null?(nn(r),Rp(r,N)):(nn(r),Su(r,v,null,m,u))):N?N!==a.memoizedState?(Qr(r),nn(r),Rp(r,N)):(nn(r),r.flags&=-16777217):(a=a.memoizedProps,a!==m&&Qr(r),nn(r),Su(r,v,a,m,u)),null;case 27:if(et(r),u=Ce.current,v=r.type,a!==null&&r.stateNode!=null)a.memoizedProps!==m&&Qr(r);else{if(!m){if(r.stateNode===null)throw Error(s(166));return nn(r),null}a=xe.current,Uo(r)?Tg(r):(a=$v(v,m,u),r.stateNode=a,Qr(r))}return nn(r),null;case 5:if(et(r),v=r.type,a!==null&&r.stateNode!=null)a.memoizedProps!==m&&Qr(r);else{if(!m){if(r.stateNode===null)throw Error(s(166));return nn(r),null}if(N=xe.current,Uo(r))Tg(r);else{var A=C0(Ce.current);switch(N){case 1:N=A.createElementNS("http://www.w3.org/2000/svg",v);break;case 2:N=A.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;default:switch(v){case"svg":N=A.createElementNS("http://www.w3.org/2000/svg",v);break;case"math":N=A.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;case"script":N=A.createElement("div"),N.innerHTML="<script><\/script>",N=N.removeChild(N.firstChild);break;case"select":N=typeof m.is=="string"?A.createElement("select",{is:m.is}):A.createElement("select"),m.multiple?N.multiple=!0:m.size&&(N.size=m.size);break;default:N=typeof m.is=="string"?A.createElement(v,{is:m.is}):A.createElement(v)}}N[Ze]=r,N[ct]=m;e:for(A=r.child;A!==null;){if(A.tag===5||A.tag===6)N.appendChild(A.stateNode);else if(A.tag!==4&&A.tag!==27&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===r)break e;for(;A.sibling===null;){if(A.return===null||A.return===r)break e;A=A.return}A.sibling.return=A.return,A=A.sibling}r.stateNode=N;e:switch(as(N,v,m),v){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&Qr(r)}}return nn(r),Su(r,r.type,a===null?null:a.memoizedProps,r.pendingProps,u),null;case 6:if(a&&r.stateNode!=null)a.memoizedProps!==m&&Qr(r);else{if(typeof m!="string"&&r.stateNode===null)throw Error(s(166));if(a=Ce.current,Uo(r)){if(a=r.stateNode,u=r.memoizedProps,m=null,v=Bn,v!==null)switch(v.tag){case 27:case 5:m=v.memoizedProps}a[Ze]=r,a=!!(a.nodeValue===u||m!==null&&m.suppressHydrationWarning===!0||Pv(a.nodeValue,u)),a||qr(r,!0)}else a=C0(a).createTextNode(m),a[Ze]=r,r.stateNode=a}return nn(r),null;case 31:if(u=r.memoizedState,a===null||a.memoizedState!==null){if(m=Uo(r),u!==null){if(a===null){if(!m)throw Error(s(318));if(a=r.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(s(557));a[Ze]=r}else Gi(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;nn(r),a=!1}else u=qd(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=u),a=!0;if(!a)return r.flags&256?(Zn(r),r):(Zn(r),null);if((r.flags&128)!==0)throw Error(s(558))}return nn(r),null;case 13:if(m=r.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(v=Uo(r),m!==null&&m.dehydrated!==null){if(a===null){if(!v)throw Error(s(318));if(v=r.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(s(317));v[Ze]=r}else Gi(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;nn(r),v=!1}else v=qd(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=v),v=!0;if(!v)return r.flags&256?(Zn(r),r):(Zn(r),null)}return Zn(r),(r.flags&128)!==0?(r.lanes=u,r):(u=m!==null,a=a!==null&&a.memoizedState!==null,u&&(m=r.child,v=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(v=m.alternate.memoizedState.cachePool.pool),N=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(N=m.memoizedState.cachePool.pool),N!==v&&(m.flags|=2048)),u!==a&&u&&(r.child.flags|=8192),bi(r,r.updateQueue),nn(r),null);case 4:return we(),a===null&&jy(r.stateNode.containerInfo),nn(r),null;case 10:return Gr(r.type),nn(r),null;case 19:if(I(wt),m=r.memoizedState,m===null)return nn(r),null;if(v=(r.flags&128)!==0,N=m.rendering,N===null)if(v)Kr(m,!1);else{if(Dn!==0||a!==null&&(a.flags&128)!==0)for(a=r.child;a!==null;){if(N=As(a),N!==null){for(r.flags|=128,Kr(m,!1),a=N.updateQueue,r.updateQueue=a,bi(r,a),r.subtreeFlags=0,a=u,u=r.child;u!==null;)Ao(u,a),u=u.sibling;return fe(wt,wt.current&1|2),jt&&Lr(r,m.treeForkCount),r.child}a=a.sibling}m.tail!==null&&Xn()>Wn&&(r.flags|=128,v=!0,Kr(m,!1),r.lanes=4194304)}else{if(!v)if(a=As(N),a!==null){if(r.flags|=128,v=!0,a=a.updateQueue,r.updateQueue=a,bi(r,a),Kr(m,!0),m.tail===null&&m.tailMode==="hidden"&&!N.alternate&&!jt)return nn(r),null}else 2*Xn()-m.renderingStartTime>Wn&&u!==536870912&&(r.flags|=128,v=!0,Kr(m,!1),r.lanes=4194304);m.isBackwards?(N.sibling=r.child,r.child=N):(a=m.last,a!==null?a.sibling=N:r.child=N,m.last=N)}return m.tail!==null?(a=m.tail,m.rendering=a,m.tail=a.sibling,m.renderingStartTime=Xn(),a.sibling=null,u=wt.current,fe(wt,v?u&1|2:u&1),jt&&Lr(r,m.treeForkCount),a):(nn(r),null);case 22:case 23:return Zn(r),pu(),m=r.memoizedState!==null,a!==null?a.memoizedState!==null!==m&&(r.flags|=8192):m&&(r.flags|=8192),m?(u&536870912)!==0&&(r.flags&128)===0&&(nn(r),r.subtreeFlags&6&&(r.flags|=8192)):nn(r),u=r.updateQueue,u!==null&&bi(r,u.retryQueue),u=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),m=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(m=r.memoizedState.cachePool.pool),m!==u&&(r.flags|=2048),a!==null&&I(Vi),null;case 24:return u=null,a!==null&&(u=a.memoizedState.cache),r.memoizedState.cache!==u&&(r.flags|=2048),Gr(na),nn(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function Ws(a,r){switch(Ld(r),r.tag){case 1:return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 3:return Gr(na),we(),a=r.flags,(a&65536)!==0&&(a&128)===0?(r.flags=a&-65537|128,r):null;case 26:case 27:case 5:return et(r),null;case 31:if(r.memoizedState!==null){if(Zn(r),r.alternate===null)throw Error(s(340));Gi()}return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 13:if(Zn(r),a=r.memoizedState,a!==null&&a.dehydrated!==null){if(r.alternate===null)throw Error(s(340));Gi()}return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 19:return I(wt),null;case 4:return we(),null;case 10:return Gr(r.type),null;case 22:case 23:return Zn(r),pu(),a!==null&&I(Vi),a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 24:return Gr(na),null;case 25:return null;default:return null}}function Ds(a,r){switch(Ld(r),r.tag){case 3:Gr(na),we();break;case 26:case 27:case 5:et(r);break;case 4:we();break;case 31:r.memoizedState!==null&&Zn(r);break;case 13:Zn(r);break;case 19:I(wt);break;case 10:Gr(r.type);break;case 22:case 23:Zn(r),pu(),a!==null&&I(Vi);break;case 24:Gr(na)}}function $s(a,r){try{var u=r.updateQueue,m=u!==null?u.lastEffect:null;if(m!==null){var v=m.next;u=v;do{if((u.tag&a)===a){m=void 0;var N=u.create,A=u.inst;m=N(),A.destroy=m}u=u.next}while(u!==v)}}catch(H){Ut(r,r.return,H)}}function Ma(a,r,u){try{var m=r.updateQueue,v=m!==null?m.lastEffect:null;if(v!==null){var N=v.next;m=N;do{if((m.tag&a)===a){var A=m.inst,H=A.destroy;if(H!==void 0){A.destroy=void 0,v=r;var X=u,oe=H;try{oe()}catch(ye){Ut(v,X,ye)}}}m=m.next}while(m!==N)}}catch(ye){Ut(r,r.return,ye)}}function xr(a){var r=a.updateQueue;if(r!==null){var u=a.stateNode;try{Dg(r,u)}catch(m){Ut(a,a.return,m)}}}function _a(a,r,u){u.props=Zi(a.type,a.memoizedProps),u.state=a.memoizedState;try{u.componentWillUnmount()}catch(m){Ut(a,r,m)}}function vi(a,r){try{var u=a.ref;if(u!==null){switch(a.tag){case 26:case 27:case 5:var m=a.stateNode;break;case 30:m=a.stateNode;break;default:m=a.stateNode}typeof u=="function"?a.refCleanup=u(m):u.current=m}}catch(v){Ut(a,r,v)}}function Aa(a,r){var u=a.ref,m=a.refCleanup;if(u!==null)if(typeof m=="function")try{m()}catch(v){Ut(a,r,v)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(v){Ut(a,r,v)}else u.current=null}function _u(a){var r=a.type,u=a.memoizedProps,m=a.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":u.autoFocus&&m.focus();break e;case"img":u.src?m.src=u.src:u.srcSet&&(m.srcset=u.srcSet)}}catch(v){Ut(a,a.return,v)}}function da(a,r,u){try{var m=a.stateNode;o7(m,a.type,u,r),m[ct]=r}catch(v){Ut(a,a.return,v)}}function Sn(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&ac(a.type)||a.tag===4}function Nt(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||Sn(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&ac(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function Xr(a,r,u){var m=a.tag;if(m===5||m===6)a=a.stateNode,r?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(a,r):(r=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,r.appendChild(a),u=u._reactRootContainer,u!=null||r.onclick!==null||(r.onclick=oi));else if(m!==4&&(m===27&&ac(a.type)&&(u=a.stateNode,r=null),a=a.child,a!==null))for(Xr(a,r,u),a=a.sibling;a!==null;)Xr(a,r,u),a=a.sibling}function Wa(a,r,u){var m=a.tag;if(m===5||m===6)a=a.stateNode,r?u.insertBefore(a,r):u.appendChild(a);else if(m!==4&&(m===27&&ac(a.type)&&(u=a.stateNode),a=a.child,a!==null))for(Wa(a,r,u),a=a.sibling;a!==null;)Wa(a,r,u),a=a.sibling}function pf(a){var r=a.stateNode,u=a.memoizedProps;try{for(var m=a.type,v=r.attributes;v.length;)r.removeAttributeNode(v[0]);as(r,m,u),r[Ze]=a,r[ct]=u}catch(N){Ut(a,a.return,N)}}var er=!1,cn=!1,br=!1,S0=typeof WeakSet=="function"?WeakSet:Set,Ca=null;function Ny(a,r){if(a=a.containerInfo,Ty=M0,a=_g(a),qh(a)){if("selectionStart"in a)var u={start:a.selectionStart,end:a.selectionEnd};else e:{u=(u=a.ownerDocument)&&u.defaultView||window;var m=u.getSelection&&u.getSelection();if(m&&m.rangeCount!==0){u=m.anchorNode;var v=m.anchorOffset,N=m.focusNode;m=m.focusOffset;try{u.nodeType,N.nodeType}catch{u=null;break e}var A=0,H=-1,X=-1,oe=0,ye=0,ve=a,de=null;t:for(;;){for(var ge;ve!==u||v!==0&&ve.nodeType!==3||(H=A+v),ve!==N||m!==0&&ve.nodeType!==3||(X=A+m),ve.nodeType===3&&(A+=ve.nodeValue.length),(ge=ve.firstChild)!==null;)de=ve,ve=ge;for(;;){if(ve===a)break t;if(de===u&&++oe===v&&(H=A),de===N&&++ye===m&&(X=A),(ge=ve.nextSibling)!==null)break;ve=de,de=ve.parentNode}ve=ge}u=H===-1||X===-1?null:{start:H,end:X}}else u=null}u=u||{start:0,end:0}}else u=null;for(Ry={focusedElem:a,selectionRange:u},M0=!1,Ca=r;Ca!==null;)if(r=Ca,a=r.child,(r.subtreeFlags&1028)!==0&&a!==null)a.return=r,Ca=a;else for(;Ca!==null;){switch(r=Ca,N=r.alternate,a=r.flags,r.tag){case 0:if((a&4)!==0&&(a=r.updateQueue,a=a!==null?a.events:null,a!==null))for(u=0;u<a.length;u++)v=a[u],v.ref.impl=v.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&N!==null){a=void 0,u=r,v=N.memoizedProps,N=N.memoizedState,m=u.stateNode;try{var Be=Zi(u.type,v);a=m.getSnapshotBeforeUpdate(Be,N),m.__reactInternalSnapshotBeforeUpdate=a}catch(Je){Ut(u,u.return,Je)}}break;case 3:if((a&1024)!==0){if(a=r.stateNode.containerInfo,u=a.nodeType,u===9)Ay(a);else if(u===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Ay(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(s(163))}if(a=r.sibling,a!==null){a.return=r.return,Ca=a;break}Ca=r.return}}function Nn(a,r,u){var m=u.flags;switch(u.tag){case 0:case 11:case 15:ar(a,u),m&4&&$s(5,u);break;case 1:if(ar(a,u),m&4)if(a=u.stateNode,r===null)try{a.componentDidMount()}catch(A){Ut(u,u.return,A)}else{var v=Zi(u.type,r.memoizedProps);r=r.memoizedState;try{a.componentDidUpdate(v,r,a.__reactInternalSnapshotBeforeUpdate)}catch(A){Ut(u,u.return,A)}}m&64&&xr(u),m&512&&vi(u,u.return);break;case 3:if(ar(a,u),m&64&&(a=u.updateQueue,a!==null)){if(r=null,u.child!==null)switch(u.child.tag){case 27:case 5:r=u.child.stateNode;break;case 1:r=u.child.stateNode}try{Dg(a,r)}catch(A){Ut(u,u.return,A)}}break;case 27:r===null&&m&4&&pf(u);case 26:case 5:ar(a,u),r===null&&m&4&&_u(u),m&512&&vi(u,u.return);break;case 12:ar(a,u);break;case 31:ar(a,u),m&4&&Ii(a,u);break;case 13:ar(a,u),m&4&&Fo(a,u),m&64&&(a=u.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(u=g.bind(null,u),g7(a,u))));break;case 22:if(m=u.memoizedState!==null||er,!m){r=r!==null&&r.memoizedState!==null||cn,v=er;var N=cn;er=m,(cn=r)&&!N?$a(a,u,(u.subtreeFlags&8772)!==0):ar(a,u),er=v,cn=N}break;case 30:break;default:ar(a,u)}}function Cu(a){var r=a.alternate;r!==null&&(a.alternate=null,Cu(r)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(r=a.stateNode,r!==null&&Gs(r)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var It=null,Pa=!1;function tr(a,r,u){for(u=u.child;u!==null;)mf(a,r,u),u=u.sibling}function mf(a,r,u){if(ta&&typeof ta.onCommitFiberUnmount=="function")try{ta.onCommitFiberUnmount(Hs,u)}catch{}switch(u.tag){case 26:cn||Aa(u,r),tr(a,r,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:cn||Aa(u,r);var m=It,v=Pa;ac(u.type)&&(It=u.stateNode,Pa=!1),tr(a,r,u),Lp(u.stateNode),It=m,Pa=v;break;case 5:cn||Aa(u,r);case 6:if(m=It,v=Pa,It=null,tr(a,r,u),It=m,Pa=v,It!==null)if(Pa)try{(It.nodeType===9?It.body:It.nodeName==="HTML"?It.ownerDocument.body:It).removeChild(u.stateNode)}catch(N){Ut(u,r,N)}else try{It.removeChild(u.stateNode)}catch(N){Ut(u,r,N)}break;case 18:It!==null&&(Pa?(a=It,Fv(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,u.stateNode),_f(a)):Fv(It,u.stateNode));break;case 4:m=It,v=Pa,It=u.stateNode.containerInfo,Pa=!0,tr(a,r,u),It=m,Pa=v;break;case 0:case 11:case 14:case 15:Ma(2,u,r),cn||Ma(4,u,r),tr(a,r,u);break;case 1:cn||(Aa(u,r),m=u.stateNode,typeof m.componentWillUnmount=="function"&&_a(u,r,m)),tr(a,r,u);break;case 21:tr(a,r,u);break;case 22:cn=(m=cn)||u.memoizedState!==null,tr(a,r,u),cn=m;break;default:tr(a,r,u)}}function Ii(a,r){if(r.memoizedState===null&&(a=r.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{_f(a)}catch(u){Ut(r,r.return,u)}}}function Fo(a,r){if(r.memoizedState===null&&(a=r.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{_f(a)}catch(u){Ut(r,r.return,u)}}function Op(a){switch(a.tag){case 31:case 13:case 19:var r=a.stateNode;return r===null&&(r=a.stateNode=new S0),r;case 22:return a=a.stateNode,r=a._retryCache,r===null&&(r=a._retryCache=new S0),r;default:throw Error(s(435,a.tag))}}function Si(a,r){var u=Op(a);r.forEach(function(m){if(!u.has(m)){u.add(m);var v=x.bind(null,a,m);m.then(v,v)}})}function fa(a,r){var u=r.deletions;if(u!==null)for(var m=0;m<u.length;m++){var v=u[m],N=a,A=r,H=A;e:for(;H!==null;){switch(H.tag){case 27:if(ac(H.type)){It=H.stateNode,Pa=!1;break e}break;case 5:It=H.stateNode,Pa=!1;break e;case 3:case 4:It=H.stateNode.containerInfo,Pa=!0;break e}H=H.return}if(It===null)throw Error(s(160));mf(N,A,v),It=null,Pa=!1,N=v.alternate,N!==null&&(N.return=null),v.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)Ji(r,a),r=r.sibling}var nr=null;function Ji(a,r){var u=a.alternate,m=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:fa(r,a),ha(a),m&4&&(Ma(3,a,a.return),$s(3,a),Ma(5,a,a.return));break;case 1:fa(r,a),ha(a),m&512&&(cn||u===null||Aa(u,u.return)),m&64&&er&&(a=a.updateQueue,a!==null&&(m=a.callbacks,m!==null&&(u=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=u===null?m:u.concat(m))));break;case 26:var v=nr;if(fa(r,a),ha(a),m&512&&(cn||u===null||Aa(u,u.return)),m&4){var N=u!==null?u.memoizedState:null;if(m=a.memoizedState,u===null)if(m===null)if(a.stateNode===null){e:{m=a.type,u=a.memoizedProps,v=v.ownerDocument||v;t:switch(m){case"title":N=v.getElementsByTagName("title")[0],(!N||N[Ka]||N[Ze]||N.namespaceURI==="http://www.w3.org/2000/svg"||N.hasAttribute("itemprop"))&&(N=v.createElement(m),v.head.insertBefore(N,v.querySelector("head > title"))),as(N,m,u),N[Ze]=a,Tn(N),m=N;break e;case"link":var A=r2("link","href",v).get(m+(u.href||""));if(A){for(var H=0;H<A.length;H++)if(N=A[H],N.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&N.getAttribute("rel")===(u.rel==null?null:u.rel)&&N.getAttribute("title")===(u.title==null?null:u.title)&&N.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){A.splice(H,1);break t}}N=v.createElement(m),as(N,m,u),v.head.appendChild(N);break;case"meta":if(A=r2("meta","content",v).get(m+(u.content||""))){for(H=0;H<A.length;H++)if(N=A[H],N.getAttribute("content")===(u.content==null?null:""+u.content)&&N.getAttribute("name")===(u.name==null?null:u.name)&&N.getAttribute("property")===(u.property==null?null:u.property)&&N.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&N.getAttribute("charset")===(u.charSet==null?null:u.charSet)){A.splice(H,1);break t}}N=v.createElement(m),as(N,m,u),v.head.appendChild(N);break;default:throw Error(s(468,m))}N[Ze]=a,Tn(N),m=N}a.stateNode=m}else i2(v,a.type,a.stateNode);else a.stateNode=s2(v,m,a.memoizedProps);else N!==m?(N===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):N.count--,m===null?i2(v,a.type,a.stateNode):s2(v,m,a.memoizedProps)):m===null&&a.stateNode!==null&&da(a,a.memoizedProps,u.memoizedProps)}break;case 27:fa(r,a),ha(a),m&512&&(cn||u===null||Aa(u,u.return)),u!==null&&m&4&&da(a,a.memoizedProps,u.memoizedProps);break;case 5:if(fa(r,a),ha(a),m&512&&(cn||u===null||Aa(u,u.return)),a.flags&32){v=a.stateNode;try{_l(v,"")}catch(Be){Ut(a,a.return,Be)}}m&4&&a.stateNode!=null&&(v=a.memoizedProps,da(a,v,u!==null?u.memoizedProps:v)),m&1024&&(br=!0);break;case 6:if(fa(r,a),ha(a),m&4){if(a.stateNode===null)throw Error(s(162));m=a.memoizedProps,u=a.stateNode;try{u.nodeValue=m}catch(Be){Ut(a,a.return,Be)}}break;case 3:if(E0=null,v=nr,nr=j0(r.containerInfo),fa(r,a),nr=v,ha(a),m&4&&u!==null&&u.memoizedState.isDehydrated)try{_f(r.containerInfo)}catch(Be){Ut(a,a.return,Be)}br&&(br=!1,gf(a));break;case 4:m=nr,nr=j0(a.stateNode.containerInfo),fa(r,a),ha(a),nr=m;break;case 12:fa(r,a),ha(a);break;case 31:fa(r,a),ha(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,Si(a,m)));break;case 13:fa(r,a),ha(a),a.child.flags&8192&&a.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Zo=Xn()),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,Si(a,m)));break;case 22:v=a.memoizedState!==null;var X=u!==null&&u.memoizedState!==null,oe=er,ye=cn;if(er=oe||v,cn=ye||X,fa(r,a),cn=ye,er=oe,ha(a),m&8192)e:for(r=a.stateNode,r._visibility=v?r._visibility&-2:r._visibility|1,v&&(u===null||X||er||cn||Fr(a)),u=null,r=a;;){if(r.tag===5||r.tag===26){if(u===null){X=u=r;try{if(N=X.stateNode,v)A=N.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none";else{H=X.stateNode;var ve=X.memoizedProps.style,de=ve!=null&&ve.hasOwnProperty("display")?ve.display:null;H.style.display=de==null||typeof de=="boolean"?"":(""+de).trim()}}catch(Be){Ut(X,X.return,Be)}}}else if(r.tag===6){if(u===null){X=r;try{X.stateNode.nodeValue=v?"":X.memoizedProps}catch(Be){Ut(X,X.return,Be)}}}else if(r.tag===18){if(u===null){X=r;try{var ge=X.stateNode;v?Zv(ge,!0):Zv(X.stateNode,!1)}catch(Be){Ut(X,X.return,Be)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===a)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break e;for(;r.sibling===null;){if(r.return===null||r.return===a)break e;u===r&&(u=null),r=r.return}u===r&&(u=null),r.sibling.return=r.return,r=r.sibling}m&4&&(m=a.updateQueue,m!==null&&(u=m.retryQueue,u!==null&&(m.retryQueue=null,Si(a,u))));break;case 19:fa(r,a),ha(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,Si(a,m)));break;case 30:break;case 21:break;default:fa(r,a),ha(a)}}function ha(a){var r=a.flags;if(r&2){try{for(var u,m=a.return;m!==null;){if(Sn(m)){u=m;break}m=m.return}if(u==null)throw Error(s(160));switch(u.tag){case 27:var v=u.stateNode,N=Nt(a);Wa(a,N,v);break;case 5:var A=u.stateNode;u.flags&32&&(_l(A,""),u.flags&=-33);var H=Nt(a);Wa(a,H,A);break;case 3:case 4:var X=u.stateNode.containerInfo,oe=Nt(a);Xr(a,oe,X);break;default:throw Error(s(161))}}catch(ye){Ut(a,a.return,ye)}a.flags&=-3}r&4096&&(a.flags&=-4097)}function gf(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var r=a;gf(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),a=a.sibling}}function ar(a,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Nn(a,r.alternate,r),r=r.sibling}function Fr(a){for(a=a.child;a!==null;){var r=a;switch(r.tag){case 0:case 11:case 14:case 15:Ma(4,r,r.return),Fr(r);break;case 1:Aa(r,r.return);var u=r.stateNode;typeof u.componentWillUnmount=="function"&&_a(r,r.return,u),Fr(r);break;case 27:Lp(r.stateNode);case 26:case 5:Aa(r,r.return),Fr(r);break;case 22:r.memoizedState===null&&Fr(r);break;case 30:Fr(r);break;default:Fr(r)}a=a.sibling}}function $a(a,r,u){for(u=u&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var m=r.alternate,v=a,N=r,A=N.flags;switch(N.tag){case 0:case 11:case 15:$a(v,N,u),$s(4,N);break;case 1:if($a(v,N,u),m=N,v=m.stateNode,typeof v.componentDidMount=="function")try{v.componentDidMount()}catch(oe){Ut(m,m.return,oe)}if(m=N,v=m.updateQueue,v!==null){var H=m.stateNode;try{var X=v.shared.hiddenCallbacks;if(X!==null)for(v.shared.hiddenCallbacks=null,v=0;v<X.length;v++)Po(X[v],H)}catch(oe){Ut(m,m.return,oe)}}u&&A&64&&xr(N),vi(N,N.return);break;case 27:pf(N);case 26:case 5:$a(v,N,u),u&&m===null&&A&4&&_u(N),vi(N,N.return);break;case 12:$a(v,N,u);break;case 31:$a(v,N,u),u&&A&4&&Ii(v,N);break;case 13:$a(v,N,u),u&&A&4&&Fo(v,N);break;case 22:N.memoizedState===null&&$a(v,N,u),vi(N,N.return);break;case 30:break;default:$a(v,N,u)}r=r.sibling}}function Wi(a,r){var u=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==u&&(a!=null&&a.refCount++,u!=null&&Ml(u))}function Ql(a,r){a=null,r.alternate!==null&&(a=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==a&&(r.refCount++,a!=null&&Ml(a))}function Da(a,r,u,m){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Mp(a,r,u,m),r=r.sibling}function Mp(a,r,u,m){var v=r.flags;switch(r.tag){case 0:case 11:case 15:Da(a,r,u,m),v&2048&&$s(9,r);break;case 1:Da(a,r,u,m);break;case 3:Da(a,r,u,m),v&2048&&(a=null,r.alternate!==null&&(a=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==a&&(r.refCount++,a!=null&&Ml(a)));break;case 12:if(v&2048){Da(a,r,u,m),a=r.stateNode;try{var N=r.memoizedProps,A=N.id,H=N.onPostCommit;typeof H=="function"&&H(A,r.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(X){Ut(r,r.return,X)}}else Da(a,r,u,m);break;case 31:Da(a,r,u,m);break;case 13:Da(a,r,u,m);break;case 23:break;case 22:N=r.stateNode,A=r.alternate,r.memoizedState!==null?N._visibility&2?Da(a,r,u,m):Zr(a,r):N._visibility&2?Da(a,r,u,m):(N._visibility|=2,za(a,r,u,m,(r.subtreeFlags&10256)!==0||!1)),v&2048&&Wi(A,r);break;case 24:Da(a,r,u,m),v&2048&&Ql(r.alternate,r);break;default:Da(a,r,u,m)}}function za(a,r,u,m,v){for(v=v&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var N=a,A=r,H=u,X=m,oe=A.flags;switch(A.tag){case 0:case 11:case 15:za(N,A,H,X,v),$s(8,A);break;case 23:break;case 22:var ye=A.stateNode;A.memoizedState!==null?ye._visibility&2?za(N,A,H,X,v):Zr(N,A):(ye._visibility|=2,za(N,A,H,X,v)),v&&oe&2048&&Wi(A.alternate,A);break;case 24:za(N,A,H,X,v),v&&oe&2048&&Ql(A.alternate,A);break;default:za(N,A,H,X,v)}r=r.sibling}}function Zr(a,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var u=a,m=r,v=m.flags;switch(m.tag){case 22:Zr(u,m),v&2048&&Wi(m.alternate,m);break;case 24:Zr(u,m),v&2048&&Ql(m.alternate,m);break;default:Zr(u,m)}r=r.sibling}}var Kl=8192;function zs(a,r,u){if(a.subtreeFlags&Kl)for(a=a.child;a!==null;)yf(a,r,u),a=a.sibling}function yf(a,r,u){switch(a.tag){case 26:zs(a,r,u),a.flags&Kl&&a.memoizedState!==null&&T7(u,nr,a.memoizedState,a.memoizedProps);break;case 5:zs(a,r,u);break;case 3:case 4:var m=nr;nr=j0(a.stateNode.containerInfo),zs(a,r,u),nr=m;break;case 22:a.memoizedState===null&&(m=a.alternate,m!==null&&m.memoizedState!==null?(m=Kl,Kl=16777216,zs(a,r,u),Kl=m):zs(a,r,u));break;default:zs(a,r,u)}}function Xl(a){var r=a.alternate;if(r!==null&&(a=r.child,a!==null)){r.child=null;do r=a.sibling,a.sibling=null,a=r;while(a!==null)}}function $i(a){var r=a.deletions;if((a.flags&16)!==0){if(r!==null)for(var u=0;u<r.length;u++){var m=r[u];Ca=m,Gn(m,a)}Xl(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)gs(a),a=a.sibling}function gs(a){switch(a.tag){case 0:case 11:case 15:$i(a),a.flags&2048&&Ma(9,a,a.return);break;case 3:$i(a);break;case 12:$i(a);break;case 22:var r=a.stateNode;a.memoizedState!==null&&r._visibility&2&&(a.return===null||a.return.tag!==13)?(r._visibility&=-3,es(a)):$i(a);break;default:$i(a)}}function es(a){var r=a.deletions;if((a.flags&16)!==0){if(r!==null)for(var u=0;u<r.length;u++){var m=r[u];Ca=m,Gn(m,a)}Xl(a)}for(a=a.child;a!==null;){switch(r=a,r.tag){case 0:case 11:case 15:Ma(8,r,r.return),es(r);break;case 22:u=r.stateNode,u._visibility&2&&(u._visibility&=-3,es(r));break;default:es(r)}a=a.sibling}}function Gn(a,r){for(;Ca!==null;){var u=Ca;switch(u.tag){case 0:case 11:case 15:Ma(8,u,r);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var m=u.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:Ml(u.memoizedState.cache)}if(m=u.child,m!==null)m.return=u,Ca=m;else e:for(u=a;Ca!==null;){m=Ca;var v=m.sibling,N=m.return;if(Cu(m),m===u){Ca=null;break e}if(v!==null){v.return=N,Ca=v;break e}Ca=N}}}var Ni={getCacheForType:function(a){var r=$e(na),u=r.data.get(a);return u===void 0&&(u=a(),r.data.set(a,u)),u},cacheSignal:function(){return $e(na).controller.signal}},it=typeof WeakMap=="function"?WeakMap:Map,Ve=0,nt=null,ht=null,ut=0,Rt=0,Ya=null,sr=!1,vr=!1,Ap=!1,ks=0,Dn=0,Ir=0,el=0,ju=0,ts=0,mn=0,Fl=null,Pn=null,Yn=!1,Zo=0,Dp=0,Wn=1/0,zn=null,$n=null,Jt=0,Ls=null,Io=null,rr=0,Jo=0,Wo=null,wu=null,tl=0,Zl=null;function Us(){return(Ve&2)!==0&&ut!==0?ut&-ut:Y.T!==null?he():Qe()}function bt(){if(ts===0)if((ut&536870912)===0||jt){var a=hr;hr<<=1,(hr&3932160)===0&&(hr=262144),ts=a}else ts=536870912;return a=fs.current,a!==null&&(a.flags|=32),ts}function pt(a,r,u){(a===nt&&(Rt===2||Rt===9)||a.cancelPendingCommit!==null)&&(al(a,0),sa(a,ut,ts,!1)),yn(a,u),((Ve&2)===0||a!==nt)&&(a===nt&&((Ve&2)===0&&(el|=u),Dn===4&&sa(a,ut,ts,!1)),je(a))}function vt(a,r,u){if((Ve&6)!==0)throw Error(s(327));var m=!u&&(r&127)===0&&(r&a.expiredLanes)===0||At(a,r),v=m?Eu(a,r):ns(a,r,!0),N=m;do{if(v===0){vr&&!m&&sa(a,r,0,!1);break}else{if(u=a.current.alternate,N&&!Wt(u)){v=ns(a,r,!1),N=!1;continue}if(v===2){if(N=r,a.errorRecoveryDisabledLanes&N)var A=0;else A=a.pendingLanes&-536870913,A=A!==0?A:A&536870912?536870912:0;if(A!==0){r=A;e:{var H=a;v=Fl;var X=H.current.memoizedState.isDehydrated;if(X&&(al(H,A).flags|=256),A=ns(H,A,!1),A!==2){if(Ap&&!X){H.errorRecoveryDisabledLanes|=N,el|=N,v=4;break e}N=Pn,Pn=v,N!==null&&(Pn===null?Pn=N:Pn.push.apply(Pn,N))}v=A}if(N=!1,v!==2)continue}}if(v===1){al(a,0),sa(a,r,0,!0);break}e:{switch(m=a,N=v,N){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:sa(m,r,ts,!sr);break e;case 2:Pn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(v=Zo+300-Xn(),10<v)){if(sa(m,r,ts,!sr),Qt(m,0,!0)!==0)break e;rr=r,m.timeoutHandle=Kv(_t.bind(null,m,u,Pn,zn,Yn,r,ts,el,mn,sr,N,"Throttled",-0,0),v);break e}_t(m,u,Pn,zn,Yn,r,ts,el,mn,sr,N,null,-0,0)}}break}while(!0);je(a)}function _t(a,r,u,m,v,N,A,H,X,oe,ye,ve,de,ge){if(a.timeoutHandle=-1,ve=r.subtreeFlags,ve&8192||(ve&16785408)===16785408){ve={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:oi},yf(r,N,ve);var Be=(N&62914560)===N?Zo-Xn():(N&4194048)===N?Dp-Xn():0;if(Be=R7(ve,Be),Be!==null){rr=N,a.cancelPendingCommit=Be(Ci.bind(null,a,r,N,u,m,v,A,H,X,ye,ve,null,de,ge)),sa(a,N,A,!oe);return}}Ci(a,r,N,u,m,v,A,H,X)}function Wt(a){for(var r=a;;){var u=r.tag;if((u===0||u===11||u===15)&&r.flags&16384&&(u=r.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var m=0;m<u.length;m++){var v=u[m],N=v.getSnapshot;v=v.value;try{if(!Fa(N(),v))return!1}catch{return!1}}if(u=r.child,r.subtreeFlags&16384&&u!==null)u.return=r,r=u;else{if(r===a)break;for(;r.sibling===null;){if(r.return===null||r.return===a)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function sa(a,r,u,m){r&=~ju,r&=~el,a.suspendedLanes|=r,a.pingedLanes&=~r,m&&(a.warmLanes|=r),m=a.expirationTimes;for(var v=r;0<v;){var N=31-ba(v),A=1<<N;m[N]=-1,v&=~A}u!==0&&oa(a,u,r)}function Sr(){return(Ve&6)===0?(Ue(0),!1):!0}function nl(){if(ht!==null){if(Rt===0)var a=ht.return;else a=ht,Br=Pi=null,np(a),Ll=null,Ul=0,a=ht;for(;a!==null;)Ds(a.alternate,a),a=a.return;ht=null}}function al(a,r){var u=a.timeoutHandle;u!==-1&&(a.timeoutHandle=-1,d7(u)),u=a.cancelPendingCommit,u!==null&&(a.cancelPendingCommit=null,u()),rr=0,nl(),nt=a,ht=u=cs(a.current,null),ut=r,Rt=0,Ya=null,sr=!1,vr=At(a,r),Ap=!1,mn=ts=ju=el=Ir=Dn=0,Pn=Fl=null,Yn=!1,(r&8)!==0&&(r|=r&32);var m=a.entangledLanes;if(m!==0)for(a=a.entanglements,m&=r;0<m;){var v=31-ba(m),N=1<<v;r|=a[v],m&=~N}return ks=r,iu(),u}function Jr(a,r){rt=null,Y.H=Ko,r===Al||r===ft?(r=zl(),Rt=3):r===uu?(r=zl(),Rt=4):Rt=r===sf?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,Ya=r,ht===null&&(Dn=1,af(a,Rs(r,a.current)))}function kn(){var a=fs.current;return a===null?!0:(ut&4194048)===ut?Ja===null:(ut&62914560)===ut||(ut&536870912)!==0?a===Ja:!1}function _i(){var a=Y.H;return Y.H=Ko,a===null?Ko:a}function sl(){var a=Y.A;return Y.A=Ni,a}function $o(){Dn=4,sr||(ut&4194048)!==ut&&fs.current!==null||(vr=!0),(Ir&134217727)===0&&(el&134217727)===0||nt===null||sa(nt,ut,ts,!1)}function ns(a,r,u){var m=Ve;Ve|=2;var v=_i(),N=sl();(nt!==a||ut!==r)&&(zn=null,al(a,r)),r=!1;var A=Dn;e:do try{if(Rt!==0&&ht!==null){var H=ht,X=Ya;switch(Rt){case 8:nl(),A=6;break e;case 3:case 2:case 9:case 6:fs.current===null&&(r=!0);var oe=Rt;if(Rt=0,Ya=null,Il(a,H,X,oe),u&&vr){A=0;break e}break;default:oe=Rt,Rt=0,Ya=null,Il(a,H,X,oe)}}ec(),A=Dn;break}catch(ye){Jr(a,ye)}while(!0);return r&&a.shellSuspendCounter++,Br=Pi=null,Ve=m,Y.H=v,Y.A=N,ht===null&&(nt=null,ut=0,iu()),A}function ec(){for(;ht!==null;)xf(ht)}function Eu(a,r){var u=Ve;Ve|=2;var m=_i(),v=sl();nt!==a||ut!==r?(zn=null,Wn=Xn()+500,al(a,r)):vr=At(a,r);e:do try{if(Rt!==0&&ht!==null){r=ht;var N=Ya;t:switch(Rt){case 1:Rt=0,Ya=null,Il(a,r,N,1);break;case 2:case 9:if(ds(N)){Rt=0,Ya=null,Tu(r);break}r=function(){Rt!==2&&Rt!==9||nt!==a||(Rt=7),je(a)},N.then(r,r);break e;case 3:Rt=7;break e;case 4:Rt=5;break e;case 7:ds(N)?(Rt=0,Ya=null,Tu(r)):(Rt=0,Ya=null,Il(a,r,N,7));break;case 5:var A=null;switch(ht.tag){case 26:A=ht.memoizedState;case 5:case 27:var H=ht;if(A?l2(A):H.stateNode.complete){Rt=0,Ya=null;var X=H.sibling;if(X!==null)ht=X;else{var oe=H.return;oe!==null?(ht=oe,rl(oe)):ht=null}break t}}Rt=0,Ya=null,Il(a,r,N,5);break;case 6:Rt=0,Ya=null,Il(a,r,N,6);break;case 8:nl(),Dn=6;break e;default:throw Error(s(462))}}ys();break}catch(ye){Jr(a,ye)}while(!0);return Br=Pi=null,Y.H=m,Y.A=v,Ve=u,ht!==null?0:(nt=null,ut=0,iu(),Dn)}function ys(){for(;ht!==null&&!hn();)xf(ht)}function xf(a){var r=hf(a.alternate,a,ks);a.memoizedProps=a.pendingProps,r===null?rl(a):ht=r}function Tu(a){var r=a,u=r.alternate;switch(r.tag){case 15:case 0:r=bu(u,r,r.pendingProps,r.type,void 0,ut);break;case 11:r=bu(u,r,r.pendingProps,r.type.render,r.ref,ut);break;case 5:np(r);default:Ds(u,r),r=ht=Ao(r,ks),r=hf(u,r,ks)}a.memoizedProps=a.pendingProps,r===null?rl(a):ht=r}function Il(a,r,u,m){Br=Pi=null,np(r),Ll=null,Ul=0;var v=r.return;try{if(ua(a,v,r,u,ut)){Dn=1,af(a,Rs(u,a.current)),ht=null;return}}catch(N){if(v!==null)throw ht=v,N;Dn=1,af(a,Rs(u,a.current)),ht=null;return}r.flags&32768?(jt||m===1?a=!0:vr||(ut&536870912)!==0?a=!1:(sr=a=!0,(m===2||m===9||m===3||m===6)&&(m=fs.current,m!==null&&m.tag===13&&(m.flags|=16384))),Ru(r,a)):rl(r)}function rl(a){var r=a;do{if((r.flags&32768)!==0){Ru(r,sr);return}a=r.return;var u=Nu(r.alternate,r,ks);if(u!==null){ht=u;return}if(r=r.sibling,r!==null){ht=r;return}ht=r=a}while(r!==null);Dn===0&&(Dn=5)}function Ru(a,r){do{var u=Ws(a.alternate,a);if(u!==null){u.flags&=32767,ht=u;return}if(u=a.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!r&&(a=a.sibling,a!==null)){ht=a;return}ht=a=u}while(a!==null);Dn=6,ht=null}function Ci(a,r,u,m,v,N,A,H,X){a.cancelPendingCommit=null;do tc();while(Jt!==0);if((Ve&6)!==0)throw Error(s(327));if(r!==null){if(r===a.current)throw Error(s(177));if(N=r.lanes|r.childLanes,N|=va,Ra(a,u,N,A,H,X),a===nt&&(ht=nt=null,ut=0),Io=r,Ls=a,rr=u,Jo=N,Wo=v,wu=m,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,C(la,function(){return bf(),null})):(a.callbackNode=null,a.callbackPriority=0),m=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||m){m=Y.T,Y.T=null,v=$.p,$.p=2,A=Ve,Ve|=4;try{Ny(a,r,u)}finally{Ve=A,$.p=v,Y.T=m}}Jt=1,ra(),ji(),Jl()}}function ra(){if(Jt===1){Jt=0;var a=Ls,r=Io,u=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||u){u=Y.T,Y.T=null;var m=$.p;$.p=2;var v=Ve;Ve|=4;try{Ji(r,a);var N=Ry,A=_g(a.containerInfo),H=N.focusedElem,X=N.selectionRange;if(A!==H&&H&&H.ownerDocument&&ln(H.ownerDocument.documentElement,H)){if(X!==null&&qh(H)){var oe=X.start,ye=X.end;if(ye===void 0&&(ye=oe),"selectionStart"in H)H.selectionStart=oe,H.selectionEnd=Math.min(ye,H.value.length);else{var ve=H.ownerDocument||document,de=ve&&ve.defaultView||window;if(de.getSelection){var ge=de.getSelection(),Be=H.textContent.length,Je=Math.min(X.start,Be),dn=X.end===void 0?Je:Math.min(X.end,Be);!ge.extend&&Je>dn&&(A=dn,dn=Je,Je=A);var te=Ro(H,Je),J=Ro(H,dn);if(te&&J&&(ge.rangeCount!==1||ge.anchorNode!==te.node||ge.anchorOffset!==te.offset||ge.focusNode!==J.node||ge.focusOffset!==J.offset)){var le=ve.createRange();le.setStart(te.node,te.offset),ge.removeAllRanges(),Je>dn?(ge.addRange(le),ge.extend(J.node,J.offset)):(le.setEnd(J.node,J.offset),ge.addRange(le))}}}}for(ve=[],ge=H;ge=ge.parentNode;)ge.nodeType===1&&ve.push({element:ge,left:ge.scrollLeft,top:ge.scrollTop});for(typeof H.focus=="function"&&H.focus(),H=0;H<ve.length;H++){var be=ve[H];be.element.scrollLeft=be.left,be.element.scrollTop=be.top}}M0=!!Ty,Ry=Ty=null}finally{Ve=v,$.p=m,Y.T=u}}a.current=r,Jt=2}}function ji(){if(Jt===2){Jt=0;var a=Ls,r=Io,u=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||u){u=Y.T,Y.T=null;var m=$.p;$.p=2;var v=Ve;Ve|=4;try{Nn(a,r.alternate,r)}finally{Ve=v,$.p=m,Y.T=u}}Jt=3}}function Jl(){if(Jt===4||Jt===3){Jt=0,Zt();var a=Ls,r=Io,u=rr,m=wu;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Jt=5:(Jt=0,Io=Ls=null,Wr(a,a.pendingLanes));var v=a.pendingLanes;if(v===0&&($n=null),tt(u),r=r.stateNode,ta&&typeof ta.onCommitFiberRoot=="function")try{ta.onCommitFiberRoot(Hs,r,void 0,(r.current.flags&128)===128)}catch{}if(m!==null){r=Y.T,v=$.p,$.p=2,Y.T=null;try{for(var N=a.onRecoverableError,A=0;A<m.length;A++){var H=m[A];N(H.value,{componentStack:H.stack})}}finally{Y.T=r,$.p=v}}(rr&3)!==0&&tc(),je(a),v=a.pendingLanes,(u&261930)!==0&&(v&42)!==0?a===Zl?tl++:(tl=0,Zl=a):tl=0,Ue(0)}}function Wr(a,r){(a.pooledCacheLanes&=r)===0&&(r=a.pooledCache,r!=null&&(a.pooledCache=null,Ml(r)))}function tc(){return ra(),ji(),Jl(),bf()}function bf(){if(Jt!==5)return!1;var a=Ls,r=Jo;Jo=0;var u=tt(rr),m=Y.T,v=$.p;try{$.p=32>u?32:u,Y.T=null,u=Wo,Wo=null;var N=Ls,A=rr;if(Jt=0,Io=Ls=null,rr=0,(Ve&6)!==0)throw Error(s(331));var H=Ve;if(Ve|=4,gs(N.current),Mp(N,N.current,A,u),Ve=H,Ue(0,!1),ta&&typeof ta.onPostCommitFiberRoot=="function")try{ta.onPostCommitFiberRoot(Hs,N)}catch{}return!0}finally{$.p=v,Y.T=m,Wr(a,r)}}function zp(a,r,u){r=Rs(u,r),r=Cp(a.stateNode,r,2),a=Qi(a,r,2),a!==null&&(yn(a,2),je(a))}function Ut(a,r,u){if(a.tag===3)zp(a,a,u);else for(;r!==null;){if(r.tag===3){zp(r,a,u);break}else if(r.tag===1){var m=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&($n===null||!$n.has(m))){a=Rs(u,a),u=jp(2),m=Qi(r,u,2),m!==null&&(g0(u,m,r,a),yn(m,2),je(m));break}}r=r.return}}function Ou(a,r,u){var m=a.pingCache;if(m===null){m=a.pingCache=new it;var v=new Set;m.set(r,v)}else v=m.get(r),v===void 0&&(v=new Set,m.set(r,v));v.has(u)||(Ap=!0,v.add(u),a=l.bind(null,a,r,u),r.then(a,a))}function l(a,r,u){var m=a.pingCache;m!==null&&m.delete(r),a.pingedLanes|=a.suspendedLanes&u,a.warmLanes&=~u,nt===a&&(ut&u)===u&&(Dn===4||Dn===3&&(ut&62914560)===ut&&300>Xn()-Zo?(Ve&2)===0&&al(a,0):ju|=u,mn===ut&&(mn=0)),je(a)}function c(a,r){r===0&&(r=rn()),a=Za(a,r),a!==null&&(yn(a,r),je(a))}function g(a){var r=a.memoizedState,u=0;r!==null&&(u=r.retryLane),c(a,u)}function x(a,r){var u=0;switch(a.tag){case 31:case 13:var m=a.stateNode,v=a.memoizedState;v!==null&&(u=v.retryLane);break;case 19:m=a.stateNode;break;case 22:m=a.stateNode._retryCache;break;default:throw Error(s(314))}m!==null&&m.delete(r),c(a,u)}function C(a,r){return Et(a,r)}var E=null,q=null,F=!1,pe=!1,Se=!1,Me=0;function je(a){a!==q&&a.next===null&&(q===null?E=q=a:q=q.next=a),pe=!0,F||(F=!0,se())}function Ue(a,r){if(!Se&&pe){Se=!0;do for(var u=!1,m=E;m!==null;){if(a!==0){var v=m.pendingLanes;if(v===0)var N=0;else{var A=m.suspendedLanes,H=m.pingedLanes;N=(1<<31-ba(42|a)+1)-1,N&=v&~(A&~H),N=N&201326741?N&201326741|1:N?N|2:0}N!==0&&(u=!0,ue(m,N))}else N=ut,N=Qt(m,m===nt?N:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(N&3)===0||At(m,N)||(u=!0,ue(m,N));m=m.next}while(u);Se=!1}}function st(){ja()}function ja(){pe=F=!1;var a=0;Me!==0&&u7()&&(a=Me);for(var r=Xn(),u=null,m=E;m!==null;){var v=m.next,N=nc(m,r);N===0?(m.next=null,u===null?E=v:u.next=v,v===null&&(q=u)):(u=m,(a!==0||(N&3)!==0)&&(pe=!0)),m=v}Jt!==0&&Jt!==5||Ue(a),Me!==0&&(Me=0)}function nc(a,r){for(var u=a.suspendedLanes,m=a.pingedLanes,v=a.expirationTimes,N=a.pendingLanes&-62914561;0<N;){var A=31-ba(N),H=1<<A,X=v[A];X===-1?((H&u)===0||(H&m)!==0)&&(v[A]=Hn(H,r)):X<=r&&(a.expiredLanes|=H),N&=~H}if(r=nt,u=ut,u=Qt(a,a===r?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m=a.callbackNode,u===0||a===r&&(Rt===2||Rt===9)||a.cancelPendingCommit!==null)return m!==null&&m!==null&&qn(m),a.callbackNode=null,a.callbackPriority=0;if((u&3)===0||At(a,u)){if(r=u&-u,r===a.callbackPriority)return r;switch(m!==null&&qn(m),tt(u)){case 2:case 8:u=Qa;break;case 32:u=la;break;case 268435456:u=rs;break;default:u=la}return m=il.bind(null,a),u=Et(u,m),a.callbackPriority=r,a.callbackNode=u,r}return m!==null&&m!==null&&qn(m),a.callbackPriority=2,a.callbackNode=null,2}function il(a,r){if(Jt!==0&&Jt!==5)return a.callbackNode=null,a.callbackPriority=0,null;var u=a.callbackNode;if(tc()&&a.callbackNode!==u)return null;var m=ut;return m=Qt(a,a===nt?m:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m===0?null:(vt(a,m,r),nc(a,Xn()),a.callbackNode!=null&&a.callbackNode===u?il.bind(null,a):null)}function ue(a,r){if(tc())return null;vt(a,r,!0)}function se(){f7(function(){(Ve&6)!==0?Et(dr,st):ja()})}function he(){if(Me===0){var a=pi;a===0&&(a=_s,_s<<=1,(_s&261888)===0&&(_s=256)),Me=a}return Me}function Re(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Kc(""+a)}function Fe(a,r){var u=r.ownerDocument.createElement("input");return u.name=r.name,u.value=r.value,a.id&&u.setAttribute("form",a.id),r.parentNode.insertBefore(u,r),a=new FormData(a),u.parentNode.removeChild(u),a}function Ln(a,r,u,m,v){if(r==="submit"&&u&&u.stateNode===v){var N=Re((v[ct]||null).action),A=m.submitter;A&&(r=(r=A[ct]||null)?Re(r.formAction):A.getAttribute("formAction"),r!==null&&(N=r,A=null));var H=new Zc("action","action",null,m,v);a.push({event:H,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(Me!==0){var X=A?Fe(v,A):new FormData(v);gp(u,{pending:!0,data:X,method:v.method,action:N},null,X)}}else typeof N=="function"&&(H.preventDefault(),X=A?Fe(v,A):new FormData(v),gp(u,{pending:!0,data:X,method:v.method,action:N},N,X))},currentTarget:v}]})}}for(var Ie=0;Ie<su.length;Ie++){var Dt=su[Ie],wa=Dt.toLowerCase(),Bt=Dt[0].toUpperCase()+Dt.slice(1);Qs(wa,"on"+Bt)}Qs(Md,"onAnimationEnd"),Qs(au,"onAnimationIteration"),Qs(Bh,"onAnimationStart"),Qs("dblclick","onDoubleClick"),Qs("focusin","onFocus"),Qs("focusout","onBlur"),Qs(jg,"onTransitionRun"),Qs(py,"onTransitionStart"),Qs(wg,"onTransitionCancel"),Qs(Gh,"onTransitionEnd"),ws("onMouseEnter",["mouseout","mouseover"]),ws("onMouseLeave",["mouseout","mouseover"]),ws("onPointerEnter",["pointerout","pointerover"]),ws("onPointerLeave",["pointerout","pointerover"]),Ai("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ai("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ai("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ai("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ai("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ai("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ir="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),_y=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ir));function qv(a,r){r=(r&4)!==0;for(var u=0;u<a.length;u++){var m=a[u],v=m.event;m=m.listeners;e:{var N=void 0;if(r)for(var A=m.length-1;0<=A;A--){var H=m[A],X=H.instance,oe=H.currentTarget;if(H=H.listener,X!==N&&v.isPropagationStopped())break e;N=H,v.currentTarget=oe;try{N(v)}catch(ye){ru(ye)}v.currentTarget=null,N=X}else for(A=0;A<m.length;A++){if(H=m[A],X=H.instance,oe=H.currentTarget,H=H.listener,X!==N&&v.isPropagationStopped())break e;N=H,v.currentTarget=oe;try{N(v)}catch(ye){ru(ye)}v.currentTarget=null,N=X}}}}function Ot(a,r){var u=r[Tt];u===void 0&&(u=r[Tt]=new Set);var m=a+"__bubble";u.has(m)||(Hv(r,a,2,!1),u.add(m))}function Cy(a,r,u){var m=0;r&&(m|=4),Hv(u,a,m,r)}var N0="_reactListening"+Math.random().toString(36).slice(2);function jy(a){if(!a[N0]){a[N0]=!0,js.forEach(function(u){u!=="selectionchange"&&(_y.has(u)||Cy(u,!1,a),Cy(u,!0,a))});var r=a.nodeType===9?a:a.ownerDocument;r===null||r[N0]||(r[N0]=!0,Cy("selectionchange",!1,r))}}function Hv(a,r,u,m){switch(p2(r)){case 2:var v=A7;break;case 8:v=D7;break;default:v=By}u=v.bind(null,r,u,a),v=void 0,!Nh||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(v=!0),m?v!==void 0?a.addEventListener(r,u,{capture:!0,passive:v}):a.addEventListener(r,u,!0):v!==void 0?a.addEventListener(r,u,{passive:v}):a.addEventListener(r,u,!1)}function wy(a,r,u,m,v){var N=m;if((r&1)===0&&(r&2)===0&&m!==null)e:for(;;){if(m===null)return;var A=m.tag;if(A===3||A===4){var H=m.stateNode.containerInfo;if(H===v)break;if(A===4)for(A=m.return;A!==null;){var X=A.tag;if((X===3||X===4)&&A.stateNode.containerInfo===v)return;A=A.return}for(;H!==null;){if(A=Pt(H),A===null)return;if(X=A.tag,X===5||X===6||X===26||X===27){m=N=A;continue e}H=H.parentNode}}m=m.return}Sh(function(){var oe=N,ye=xd(u),ve=[];e:{var de=Vs.get(a);if(de!==void 0){var ge=Zc,Be=a;switch(a){case"keypress":if(Fc(u)===0)break e;case"keydown":case"keyup":ge=wl;break;case"focusin":Be="focus",ge=Nd;break;case"focusout":Be="blur",ge=Nd;break;case"beforeblur":case"afterblur":ge=Nd;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ge=_h;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ge=rg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ge=dg;break;case Md:case au:case Bh:ge=dy;break;case Gh:ge=hy;break;case"scroll":case"scrollend":ge=ag;break;case"wheel":ge=hg;break;case"copy":case"cut":case"paste":ge=lg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ge=wh;break;case"toggle":case"beforetoggle":ge=mg}var Je=(r&4)!==0,dn=!Je&&(a==="scroll"||a==="scrollend"),te=Je?de!==null?de+"Capture":null:de;Je=[];for(var J=oe,le;J!==null;){var be=J;if(le=be.stateNode,be=be.tag,be!==5&&be!==26&&be!==27||le===null||te===null||(be=vo(J,te),be!=null&&Je.push(kp(J,be,le))),dn)break;J=J.return}0<Je.length&&(de=new ge(de,Be,null,u,ye),ve.push({event:de,listeners:Je}))}}if((r&7)===0){e:{if(de=a==="mouseover"||a==="pointerover",ge=a==="mouseout"||a==="pointerout",de&&u!==yd&&(Be=u.relatedTarget||u.fromElement)&&(Pt(Be)||Be[sn]))break e;if((ge||de)&&(de=ye.window===ye?ye:(de=ye.ownerDocument)?de.defaultView||de.parentWindow:window,ge?(Be=u.relatedTarget||u.toElement,ge=oe,Be=Be?Pt(Be):null,Be!==null&&(dn=o(Be),Je=Be.tag,Be!==dn||Je!==5&&Je!==27&&Je!==6)&&(Be=null)):(ge=null,Be=oe),ge!==Be)){if(Je=_h,be="onMouseLeave",te="onMouseEnter",J="mouse",(a==="pointerout"||a==="pointerover")&&(Je=wh,be="onPointerLeave",te="onPointerEnter",J="pointer"),dn=ge==null?de:mr(ge),le=Be==null?de:mr(Be),de=new Je(be,J+"leave",ge,u,ye),de.target=dn,de.relatedTarget=le,be=null,Pt(ye)===oe&&(Je=new Je(te,J+"enter",Be,u,ye),Je.target=le,Je.relatedTarget=dn,be=Je),dn=be,ge&&Be)t:{for(Je=r7,te=ge,J=Be,le=0,be=te;be;be=Je(be))le++;be=0;for(var Xe=J;Xe;Xe=Je(Xe))be++;for(;0<le-be;)te=Je(te),le--;for(;0<be-le;)J=Je(J),be--;for(;le--;){if(te===J||J!==null&&te===J.alternate){Je=te;break t}te=Je(te),J=Je(J)}Je=null}else Je=null;ge!==null&&Bv(ve,de,ge,Je,!1),Be!==null&&dn!==null&&Bv(ve,dn,Be,Je,!0)}}e:{if(de=oe?mr(oe):window,ge=de.nodeName&&de.nodeName.toLowerCase(),ge==="select"||ge==="input"&&de.type==="file")var Kt=Dh;else if(Ah(de))if(Ar)Kt=Ng;else{Kt=Lh;var Ye=vg}else ge=de.nodeName,!ge||ge.toLowerCase()!=="input"||de.type!=="checkbox"&&de.type!=="radio"?oe&&gd(oe.elementType)&&(Kt=Dh):Kt=Sg;if(Kt&&(Kt=Kt(a,oe))){Rd(ve,Kt,u,ye);break e}Ye&&Ye(a,de,oe),a==="focusout"&&oe&&de.type==="number"&&oe.memoizedProps.value!=null&&gr(de,"number",de.value)}switch(Ye=oe?mr(oe):window,a){case"focusin":(Ah(Ye)||Ye.contentEditable==="true")&&(Dr=Ye,zr=oe,Oo=null);break;case"focusout":Oo=zr=Dr=null;break;case"mousedown":Od=!0;break;case"contextmenu":case"mouseup":case"dragend":Od=!1,Mo(ve,u,ye);break;case"selectionchange":if(Cg)break;case"keydown":case"keyup":Mo(ve,u,ye)}var gt;if(El)e:{switch(a){case"compositionstart":var zt="onCompositionStart";break e;case"compositionend":zt="onCompositionEnd";break e;case"compositionupdate":zt="onCompositionUpdate";break e}zt=void 0}else Tl?Td(a,u)&&(zt="onCompositionEnd"):a==="keydown"&&u.keyCode===229&&(zt="onCompositionStart");zt&&(Th&&u.locale!=="ko"&&(Tl||zt!=="onCompositionStart"?zt==="onCompositionEnd"&&Tl&&(gt=Xc()):(Ts=ye,vd="value"in Ts?Ts.value:Ts.textContent,Tl=!0)),Ye=_0(oe,zt),0<Ye.length&&(zt=new _d(zt,a,null,u,ye),ve.push({event:zt,listeners:Ye}),gt?zt.data=gt:(gt=Rh(u),gt!==null&&(zt.data=gt)))),(gt=Ed?xg(a,u):Oh(a,u))&&(zt=_0(oe,"onBeforeInput"),0<zt.length&&(Ye=new _d("onBeforeInput","beforeinput",null,u,ye),ve.push({event:Ye,listeners:zt}),Ye.data=gt)),Ln(ve,a,oe,u,ye)}qv(ve,r)})}function kp(a,r,u){return{instance:a,listener:r,currentTarget:u}}function _0(a,r){for(var u=r+"Capture",m=[];a!==null;){var v=a,N=v.stateNode;if(v=v.tag,v!==5&&v!==26&&v!==27||N===null||(v=vo(a,u),v!=null&&m.unshift(kp(a,v,N)),v=vo(a,r),v!=null&&m.push(kp(a,v,N))),a.tag===3)return m;a=a.return}return[]}function r7(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function Bv(a,r,u,m,v){for(var N=r._reactName,A=[];u!==null&&u!==m;){var H=u,X=H.alternate,oe=H.stateNode;if(H=H.tag,X!==null&&X===m)break;H!==5&&H!==26&&H!==27||oe===null||(X=oe,v?(oe=vo(u,N),oe!=null&&A.unshift(kp(u,oe,X))):v||(oe=vo(u,N),oe!=null&&A.push(kp(u,oe,X)))),u=u.return}A.length!==0&&a.push({event:r,listeners:A})}var i7=/\r\n?/g,l7=/\u0000|\uFFFD/g;function Gv(a){return(typeof a=="string"?a:""+a).replace(i7,`
|
|
49
|
-
`).replace(l7,"")}function Pv(a,r){return r=Gv(r),Gv(a)===r}function un(a,r,u,m,v,N){switch(u){case"children":typeof m=="string"?r==="body"||r==="textarea"&&m===""||_l(a,m):(typeof m=="number"||typeof m=="bigint")&&r!=="body"&&_l(a,""+m);break;case"className":Vc(a,"class",m);break;case"tabIndex":Vc(a,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":Vc(a,u,m);break;case"style":xh(a,m,N);break;case"data":if(r!=="object"){Vc(a,"data",m);break}case"src":case"href":if(m===""&&(r!=="a"||u!=="href")){a.removeAttribute(u);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(u);break}m=Kc(""+m),a.setAttribute(u,m);break;case"action":case"formAction":if(typeof m=="function"){a.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof N=="function"&&(u==="formAction"?(r!=="input"&&un(a,r,"name",v.name,v,null),un(a,r,"formEncType",v.formEncType,v,null),un(a,r,"formMethod",v.formMethod,v,null),un(a,r,"formTarget",v.formTarget,v,null)):(un(a,r,"encType",v.encType,v,null),un(a,r,"method",v.method,v,null),un(a,r,"target",v.target,v,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(u);break}m=Kc(""+m),a.setAttribute(u,m);break;case"onClick":m!=null&&(a.onclick=oi);break;case"onScroll":m!=null&&Ot("scroll",a);break;case"onScrollEnd":m!=null&&Ot("scrollend",a);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(s(61));if(u=m.__html,u!=null){if(v.children!=null)throw Error(s(60));a.innerHTML=u}}break;case"multiple":a.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":a.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){a.removeAttribute("xlink:href");break}u=Kc(""+m),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(u,""+m):a.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(u,""):a.removeAttribute(u);break;case"capture":case"download":m===!0?a.setAttribute(u,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(u,m):a.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?a.setAttribute(u,m):a.removeAttribute(u);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?a.removeAttribute(u):a.setAttribute(u,m);break;case"popover":Ot("beforetoggle",a),Ot("toggle",a),xo(a,"popover",m);break;case"xlinkActuate":Or(a,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":Or(a,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":Or(a,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":Or(a,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":Or(a,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":Or(a,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":Or(a,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":Or(a,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":Or(a,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":xo(a,"is",m);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=tg.get(u)||u,xo(a,u,m))}}function Ey(a,r,u,m,v,N){switch(u){case"style":xh(a,m,N);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(s(61));if(u=m.__html,u!=null){if(v.children!=null)throw Error(s(60));a.innerHTML=u}}break;case"children":typeof m=="string"?_l(a,m):(typeof m=="number"||typeof m=="bigint")&&_l(a,""+m);break;case"onScroll":m!=null&&Ot("scroll",a);break;case"onScrollEnd":m!=null&&Ot("scrollend",a);break;case"onClick":m!=null&&(a.onclick=oi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ud.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(v=u.endsWith("Capture"),r=u.slice(2,v?u.length-7:void 0),N=a[ct]||null,N=N!=null?N[u]:null,typeof N=="function"&&a.removeEventListener(r,N,v),typeof m=="function")){typeof N!="function"&&N!==null&&(u in a?a[u]=null:a.hasAttribute(u)&&a.removeAttribute(u)),a.addEventListener(r,m,v);break e}u in a?a[u]=m:m===!0?a.setAttribute(u,""):xo(a,u,m)}}}function as(a,r,u){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ot("error",a),Ot("load",a);var m=!1,v=!1,N;for(N in u)if(u.hasOwnProperty(N)){var A=u[N];if(A!=null)switch(N){case"src":m=!0;break;case"srcSet":v=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:un(a,r,N,A,u,null)}}v&&un(a,r,"srcSet",u.srcSet,u,null),m&&un(a,r,"src",u.src,u,null);return;case"input":Ot("invalid",a);var H=N=A=v=null,X=null,oe=null;for(m in u)if(u.hasOwnProperty(m)){var ye=u[m];if(ye!=null)switch(m){case"name":v=ye;break;case"type":A=ye;break;case"checked":X=ye;break;case"defaultChecked":oe=ye;break;case"value":N=ye;break;case"defaultValue":H=ye;break;case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(s(137,r));break;default:un(a,r,m,ye,u,null)}}hd(a,N,H,X,oe,A,v,!1);return;case"select":Ot("invalid",a),m=A=N=null;for(v in u)if(u.hasOwnProperty(v)&&(H=u[v],H!=null))switch(v){case"value":N=H;break;case"defaultValue":A=H;break;case"multiple":m=H;default:un(a,r,v,H,u,null)}r=N,u=A,a.multiple=!!m,r!=null?li(a,!!m,r,!1):u!=null&&li(a,!!m,u,!0);return;case"textarea":Ot("invalid",a),N=v=m=null;for(A in u)if(u.hasOwnProperty(A)&&(H=u[A],H!=null))switch(A){case"value":m=H;break;case"defaultValue":v=H;break;case"children":N=H;break;case"dangerouslySetInnerHTML":if(H!=null)throw Error(s(91));break;default:un(a,r,A,H,u,null)}md(a,m,v,N);return;case"option":for(X in u)if(u.hasOwnProperty(X)&&(m=u[X],m!=null))switch(X){case"selected":a.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:un(a,r,X,m,u,null)}return;case"dialog":Ot("beforetoggle",a),Ot("toggle",a),Ot("cancel",a),Ot("close",a);break;case"iframe":case"object":Ot("load",a);break;case"video":case"audio":for(m=0;m<ir.length;m++)Ot(ir[m],a);break;case"image":Ot("error",a),Ot("load",a);break;case"details":Ot("toggle",a);break;case"embed":case"source":case"link":Ot("error",a),Ot("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(oe in u)if(u.hasOwnProperty(oe)&&(m=u[oe],m!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:un(a,r,oe,m,u,null)}return;default:if(gd(r)){for(ye in u)u.hasOwnProperty(ye)&&(m=u[ye],m!==void 0&&Ey(a,r,ye,m,u,void 0));return}}for(H in u)u.hasOwnProperty(H)&&(m=u[H],m!=null&&un(a,r,H,m,u,null))}function o7(a,r,u,m){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var v=null,N=null,A=null,H=null,X=null,oe=null,ye=null;for(ge in u){var ve=u[ge];if(u.hasOwnProperty(ge)&&ve!=null)switch(ge){case"checked":break;case"value":break;case"defaultValue":X=ve;default:m.hasOwnProperty(ge)||un(a,r,ge,null,m,ve)}}for(var de in m){var ge=m[de];if(ve=u[de],m.hasOwnProperty(de)&&(ge!=null||ve!=null))switch(de){case"type":N=ge;break;case"name":v=ge;break;case"checked":oe=ge;break;case"defaultChecked":ye=ge;break;case"value":A=ge;break;case"defaultValue":H=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(s(137,r));break;default:ge!==ve&&un(a,r,de,ge,m,ve)}}bo(a,A,H,X,oe,ye,N,v);return;case"select":ge=A=H=de=null;for(N in u)if(X=u[N],u.hasOwnProperty(N)&&X!=null)switch(N){case"value":break;case"multiple":ge=X;default:m.hasOwnProperty(N)||un(a,r,N,null,m,X)}for(v in m)if(N=m[v],X=u[v],m.hasOwnProperty(v)&&(N!=null||X!=null))switch(v){case"value":de=N;break;case"defaultValue":H=N;break;case"multiple":A=N;default:N!==X&&un(a,r,v,N,m,X)}r=H,u=A,m=ge,de!=null?li(a,!!u,de,!1):!!m!=!!u&&(r!=null?li(a,!!u,r,!0):li(a,!!u,u?[]:"",!1));return;case"textarea":ge=de=null;for(H in u)if(v=u[H],u.hasOwnProperty(H)&&v!=null&&!m.hasOwnProperty(H))switch(H){case"value":break;case"children":break;default:un(a,r,H,null,m,v)}for(A in m)if(v=m[A],N=u[A],m.hasOwnProperty(A)&&(v!=null||N!=null))switch(A){case"value":de=v;break;case"defaultValue":ge=v;break;case"children":break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(s(91));break;default:v!==N&&un(a,r,A,v,m,N)}pd(a,de,ge);return;case"option":for(var Be in u)if(de=u[Be],u.hasOwnProperty(Be)&&de!=null&&!m.hasOwnProperty(Be))switch(Be){case"selected":a.selected=!1;break;default:un(a,r,Be,null,m,de)}for(X in m)if(de=m[X],ge=u[X],m.hasOwnProperty(X)&&de!==ge&&(de!=null||ge!=null))switch(X){case"selected":a.selected=de&&typeof de!="function"&&typeof de!="symbol";break;default:un(a,r,X,de,m,ge)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Je in u)de=u[Je],u.hasOwnProperty(Je)&&de!=null&&!m.hasOwnProperty(Je)&&un(a,r,Je,null,m,de);for(oe in m)if(de=m[oe],ge=u[oe],m.hasOwnProperty(oe)&&de!==ge&&(de!=null||ge!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(s(137,r));break;default:un(a,r,oe,de,m,ge)}return;default:if(gd(r)){for(var dn in u)de=u[dn],u.hasOwnProperty(dn)&&de!==void 0&&!m.hasOwnProperty(dn)&&Ey(a,r,dn,void 0,m,de);for(ye in m)de=m[ye],ge=u[ye],!m.hasOwnProperty(ye)||de===ge||de===void 0&&ge===void 0||Ey(a,r,ye,de,m,ge);return}}for(var te in u)de=u[te],u.hasOwnProperty(te)&&de!=null&&!m.hasOwnProperty(te)&&un(a,r,te,null,m,de);for(ve in m)de=m[ve],ge=u[ve],!m.hasOwnProperty(ve)||de===ge||de==null&&ge==null||un(a,r,ve,de,m,ge)}function Yv(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function c7(){if(typeof performance.getEntriesByType=="function"){for(var a=0,r=0,u=performance.getEntriesByType("resource"),m=0;m<u.length;m++){var v=u[m],N=v.transferSize,A=v.initiatorType,H=v.duration;if(N&&H&&Yv(A)){for(A=0,H=v.responseEnd,m+=1;m<u.length;m++){var X=u[m],oe=X.startTime;if(oe>H)break;var ye=X.transferSize,ve=X.initiatorType;ye&&Yv(ve)&&(X=X.responseEnd,A+=ye*(X<H?1:(H-oe)/(X-oe)))}if(--m,r+=8*(N+A)/(v.duration/1e3),a++,10<a)break}}if(0<a)return r/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var Ty=null,Ry=null;function C0(a){return a.nodeType===9?a:a.ownerDocument}function Vv(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Qv(a,r){if(a===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&r==="foreignObject"?0:a}function Oy(a,r){return a==="textarea"||a==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var My=null;function u7(){var a=window.event;return a&&a.type==="popstate"?a===My?!1:(My=a,!0):(My=null,!1)}var Kv=typeof setTimeout=="function"?setTimeout:void 0,d7=typeof clearTimeout=="function"?clearTimeout:void 0,Xv=typeof Promise=="function"?Promise:void 0,f7=typeof queueMicrotask=="function"?queueMicrotask:typeof Xv<"u"?function(a){return Xv.resolve(null).then(a).catch(h7)}:Kv;function h7(a){setTimeout(function(){throw a})}function ac(a){return a==="head"}function Fv(a,r){var u=r,m=0;do{var v=u.nextSibling;if(a.removeChild(u),v&&v.nodeType===8)if(u=v.data,u==="/$"||u==="/&"){if(m===0){a.removeChild(v),_f(r);return}m--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")m++;else if(u==="html")Lp(a.ownerDocument.documentElement);else if(u==="head"){u=a.ownerDocument.head,Lp(u);for(var N=u.firstChild;N;){var A=N.nextSibling,H=N.nodeName;N[Ka]||H==="SCRIPT"||H==="STYLE"||H==="LINK"&&N.rel.toLowerCase()==="stylesheet"||u.removeChild(N),N=A}}else u==="body"&&Lp(a.ownerDocument.body);u=v}while(u);_f(r)}function Zv(a,r){var u=a;a=0;do{var m=u.nextSibling;if(u.nodeType===1?r?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(r?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),m&&m.nodeType===8)if(u=m.data,u==="/$"){if(a===0)break;a--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||a++;u=m}while(u)}function Ay(a){var r=a.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var u=r;switch(r=r.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Ay(u),Gs(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}a.removeChild(u)}}function p7(a,r,u,m){for(;a.nodeType===1;){var v=u;if(a.nodeName.toLowerCase()!==r.toLowerCase()){if(!m&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(m){if(!a[Ka])switch(r){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(N=a.getAttribute("rel"),N==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(N!==v.rel||a.getAttribute("href")!==(v.href==null||v.href===""?null:v.href)||a.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin)||a.getAttribute("title")!==(v.title==null?null:v.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(N=a.getAttribute("src"),(N!==(v.src==null?null:v.src)||a.getAttribute("type")!==(v.type==null?null:v.type)||a.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin))&&N&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(r==="input"&&a.type==="hidden"){var N=v.name==null?null:""+v.name;if(v.type==="hidden"&&a.getAttribute("name")===N)return a}else return a;if(a=$r(a.nextSibling),a===null)break}return null}function m7(a,r,u){if(r==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!u||(a=$r(a.nextSibling),a===null))return null;return a}function Iv(a,r){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!r||(a=$r(a.nextSibling),a===null))return null;return a}function Dy(a){return a.data==="$?"||a.data==="$~"}function zy(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function g7(a,r){var u=a.ownerDocument;if(a.data==="$~")a._reactRetry=r;else if(a.data!=="$?"||u.readyState!=="loading")r();else{var m=function(){r(),u.removeEventListener("DOMContentLoaded",m)};u.addEventListener("DOMContentLoaded",m),a._reactRetry=m}}function $r(a){for(;a!=null;a=a.nextSibling){var r=a.nodeType;if(r===1||r===3)break;if(r===8){if(r=a.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return a}var ky=null;function Jv(a){a=a.nextSibling;for(var r=0;a;){if(a.nodeType===8){var u=a.data;if(u==="/$"||u==="/&"){if(r===0)return $r(a.nextSibling);r--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||r++}a=a.nextSibling}return null}function Wv(a){a=a.previousSibling;for(var r=0;a;){if(a.nodeType===8){var u=a.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(r===0)return a;r--}else u!=="/$"&&u!=="/&"||r++}a=a.previousSibling}return null}function $v(a,r,u){switch(r=C0(u),a){case"html":if(a=r.documentElement,!a)throw Error(s(452));return a;case"head":if(a=r.head,!a)throw Error(s(453));return a;case"body":if(a=r.body,!a)throw Error(s(454));return a;default:throw Error(s(451))}}function Lp(a){for(var r=a.attributes;r.length;)a.removeAttributeNode(r[0]);Gs(a)}var ei=new Map,e2=new Set;function j0(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var Wl=$.d;$.d={f:y7,r:x7,D:b7,C:v7,L:S7,m:N7,X:C7,S:_7,M:j7};function y7(){var a=Wl.f(),r=Sr();return a||r}function x7(a){var r=pr(a);r!==null&&r.tag===5&&r.type==="form"?l0(r):Wl.r(a)}var vf=typeof document>"u"?null:document;function t2(a,r,u){var m=vf;if(m&&typeof r=="string"&&r){var v=Ha(r);v='link[rel="'+a+'"][href="'+v+'"]',typeof u=="string"&&(v+='[crossorigin="'+u+'"]'),e2.has(v)||(e2.add(v),a={rel:a,crossOrigin:u,href:r},m.querySelector(v)===null&&(r=m.createElement("link"),as(r,"link",a),Tn(r),m.head.appendChild(r)))}}function b7(a){Wl.D(a),t2("dns-prefetch",a,null)}function v7(a,r){Wl.C(a,r),t2("preconnect",a,r)}function S7(a,r,u){Wl.L(a,r,u);var m=vf;if(m&&a&&r){var v='link[rel="preload"][as="'+Ha(r)+'"]';r==="image"&&u&&u.imageSrcSet?(v+='[imagesrcset="'+Ha(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(v+='[imagesizes="'+Ha(u.imageSizes)+'"]')):v+='[href="'+Ha(a)+'"]';var N=v;switch(r){case"style":N=Sf(a);break;case"script":N=Nf(a)}ei.has(N)||(a=b({rel:"preload",href:r==="image"&&u&&u.imageSrcSet?void 0:a,as:r},u),ei.set(N,a),m.querySelector(v)!==null||r==="style"&&m.querySelector(Up(N))||r==="script"&&m.querySelector(qp(N))||(r=m.createElement("link"),as(r,"link",a),Tn(r),m.head.appendChild(r)))}}function N7(a,r){Wl.m(a,r);var u=vf;if(u&&a){var m=r&&typeof r.as=="string"?r.as:"script",v='link[rel="modulepreload"][as="'+Ha(m)+'"][href="'+Ha(a)+'"]',N=v;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":N=Nf(a)}if(!ei.has(N)&&(a=b({rel:"modulepreload",href:a},r),ei.set(N,a),u.querySelector(v)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(qp(N)))return}m=u.createElement("link"),as(m,"link",a),Tn(m),u.head.appendChild(m)}}}function _7(a,r,u){Wl.S(a,r,u);var m=vf;if(m&&a){var v=Cs(m).hoistableStyles,N=Sf(a);r=r||"default";var A=v.get(N);if(!A){var H={loading:0,preload:null};if(A=m.querySelector(Up(N)))H.loading=5;else{a=b({rel:"stylesheet",href:a,"data-precedence":r},u),(u=ei.get(N))&&Ly(a,u);var X=A=m.createElement("link");Tn(X),as(X,"link",a),X._p=new Promise(function(oe,ye){X.onload=oe,X.onerror=ye}),X.addEventListener("load",function(){H.loading|=1}),X.addEventListener("error",function(){H.loading|=2}),H.loading|=4,w0(A,r,m)}A={type:"stylesheet",instance:A,count:1,state:H},v.set(N,A)}}}function C7(a,r){Wl.X(a,r);var u=vf;if(u&&a){var m=Cs(u).hoistableScripts,v=Nf(a),N=m.get(v);N||(N=u.querySelector(qp(v)),N||(a=b({src:a,async:!0},r),(r=ei.get(v))&&Uy(a,r),N=u.createElement("script"),Tn(N),as(N,"link",a),u.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},m.set(v,N))}}function j7(a,r){Wl.M(a,r);var u=vf;if(u&&a){var m=Cs(u).hoistableScripts,v=Nf(a),N=m.get(v);N||(N=u.querySelector(qp(v)),N||(a=b({src:a,async:!0,type:"module"},r),(r=ei.get(v))&&Uy(a,r),N=u.createElement("script"),Tn(N),as(N,"link",a),u.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},m.set(v,N))}}function n2(a,r,u,m){var v=(v=Ce.current)?j0(v):null;if(!v)throw Error(s(446));switch(a){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(r=Sf(u.href),u=Cs(v).hoistableStyles,m=u.get(r),m||(m={type:"style",instance:null,count:0,state:null},u.set(r,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){a=Sf(u.href);var N=Cs(v).hoistableStyles,A=N.get(a);if(A||(v=v.ownerDocument||v,A={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},N.set(a,A),(N=v.querySelector(Up(a)))&&!N._p&&(A.instance=N,A.state.loading=5),ei.has(a)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},ei.set(a,u),N||w7(v,a,u,A.state))),r&&m===null)throw Error(s(528,""));return A}if(r&&m!==null)throw Error(s(529,""));return null;case"script":return r=u.async,u=u.src,typeof u=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Nf(u),u=Cs(v).hoistableScripts,m=u.get(r),m||(m={type:"script",instance:null,count:0,state:null},u.set(r,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,a))}}function Sf(a){return'href="'+Ha(a)+'"'}function Up(a){return'link[rel="stylesheet"]['+a+"]"}function a2(a){return b({},a,{"data-precedence":a.precedence,precedence:null})}function w7(a,r,u,m){a.querySelector('link[rel="preload"][as="style"]['+r+"]")?m.loading=1:(r=a.createElement("link"),m.preload=r,r.addEventListener("load",function(){return m.loading|=1}),r.addEventListener("error",function(){return m.loading|=2}),as(r,"link",u),Tn(r),a.head.appendChild(r))}function Nf(a){return'[src="'+Ha(a)+'"]'}function qp(a){return"script[async]"+a}function s2(a,r,u){if(r.count++,r.instance===null)switch(r.type){case"style":var m=a.querySelector('style[data-href~="'+Ha(u.href)+'"]');if(m)return r.instance=m,Tn(m),m;var v=b({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return m=(a.ownerDocument||a).createElement("style"),Tn(m),as(m,"style",v),w0(m,u.precedence,a),r.instance=m;case"stylesheet":v=Sf(u.href);var N=a.querySelector(Up(v));if(N)return r.state.loading|=4,r.instance=N,Tn(N),N;m=a2(u),(v=ei.get(v))&&Ly(m,v),N=(a.ownerDocument||a).createElement("link"),Tn(N);var A=N;return A._p=new Promise(function(H,X){A.onload=H,A.onerror=X}),as(N,"link",m),r.state.loading|=4,w0(N,u.precedence,a),r.instance=N;case"script":return N=Nf(u.src),(v=a.querySelector(qp(N)))?(r.instance=v,Tn(v),v):(m=u,(v=ei.get(N))&&(m=b({},u),Uy(m,v)),a=a.ownerDocument||a,v=a.createElement("script"),Tn(v),as(v,"link",m),a.head.appendChild(v),r.instance=v);case"void":return null;default:throw Error(s(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(m=r.instance,r.state.loading|=4,w0(m,u.precedence,a));return r.instance}function w0(a,r,u){for(var m=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),v=m.length?m[m.length-1]:null,N=v,A=0;A<m.length;A++){var H=m[A];if(H.dataset.precedence===r)N=H;else if(N!==v)break}N?N.parentNode.insertBefore(a,N.nextSibling):(r=u.nodeType===9?u.head:u,r.insertBefore(a,r.firstChild))}function Ly(a,r){a.crossOrigin==null&&(a.crossOrigin=r.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=r.referrerPolicy),a.title==null&&(a.title=r.title)}function Uy(a,r){a.crossOrigin==null&&(a.crossOrigin=r.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=r.referrerPolicy),a.integrity==null&&(a.integrity=r.integrity)}var E0=null;function r2(a,r,u){if(E0===null){var m=new Map,v=E0=new Map;v.set(u,m)}else v=E0,m=v.get(u),m||(m=new Map,v.set(u,m));if(m.has(a))return m;for(m.set(a,null),u=u.getElementsByTagName(a),v=0;v<u.length;v++){var N=u[v];if(!(N[Ka]||N[Ze]||a==="link"&&N.getAttribute("rel")==="stylesheet")&&N.namespaceURI!=="http://www.w3.org/2000/svg"){var A=N.getAttribute(r)||"";A=a+A;var H=m.get(A);H?H.push(N):m.set(A,[N])}}return m}function i2(a,r,u){a=a.ownerDocument||a,a.head.insertBefore(u,r==="title"?a.querySelector("head > title"):null)}function E7(a,r,u){if(u===1||r.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return a=r.disabled,typeof r.precedence=="string"&&a==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function l2(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function T7(a,r,u,m){if(u.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var v=Sf(m.href),N=r.querySelector(Up(v));if(N){r=N._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(a.count++,a=T0.bind(a),r.then(a,a)),u.state.loading|=4,u.instance=N,Tn(N);return}N=r.ownerDocument||r,m=a2(m),(v=ei.get(v))&&Ly(m,v),N=N.createElement("link"),Tn(N);var A=N;A._p=new Promise(function(H,X){A.onload=H,A.onerror=X}),as(N,"link",m),u.instance=N}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(u,r),(r=u.state.preload)&&(u.state.loading&3)===0&&(a.count++,u=T0.bind(a),r.addEventListener("load",u),r.addEventListener("error",u))}}var qy=0;function R7(a,r){return a.stylesheets&&a.count===0&&O0(a,a.stylesheets),0<a.count||0<a.imgCount?function(u){var m=setTimeout(function(){if(a.stylesheets&&O0(a,a.stylesheets),a.unsuspend){var N=a.unsuspend;a.unsuspend=null,N()}},6e4+r);0<a.imgBytes&&qy===0&&(qy=62500*c7());var v=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&O0(a,a.stylesheets),a.unsuspend)){var N=a.unsuspend;a.unsuspend=null,N()}},(a.imgBytes>qy?50:800)+r);return a.unsuspend=u,function(){a.unsuspend=null,clearTimeout(m),clearTimeout(v)}}:null}function T0(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)O0(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var R0=null;function O0(a,r){a.stylesheets=null,a.unsuspend!==null&&(a.count++,R0=new Map,r.forEach(O7,a),R0=null,T0.call(a))}function O7(a,r){if(!(r.state.loading&4)){var u=R0.get(a);if(u)var m=u.get(null);else{u=new Map,R0.set(a,u);for(var v=a.querySelectorAll("link[data-precedence],style[data-precedence]"),N=0;N<v.length;N++){var A=v[N];(A.nodeName==="LINK"||A.getAttribute("media")!=="not all")&&(u.set(A.dataset.precedence,A),m=A)}m&&u.set(null,m)}v=r.instance,A=v.getAttribute("data-precedence"),N=u.get(A)||m,N===m&&u.set(null,v),u.set(A,v),this.count++,m=T0.bind(this),v.addEventListener("load",m),v.addEventListener("error",m),N?N.parentNode.insertBefore(v,N.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(v,a.firstChild)),r.state.loading|=4}}var Hp={$$typeof:z,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function M7(a,r,u,m,v,N,A,H,X){this.tag=1,this.containerInfo=a,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Fn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fn(0),this.hiddenUpdates=Fn(null),this.identifierPrefix=m,this.onUncaughtError=v,this.onCaughtError=N,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=X,this.incompleteTransitions=new Map}function o2(a,r,u,m,v,N,A,H,X,oe,ye,ve){return a=new M7(a,r,u,A,X,oe,ye,ve,H),r=1,N===!0&&(r|=24),N=On(3,null,null,r),a.current=N,N.stateNode=a,r=Yh(),r.refCount++,a.pooledCache=r,r.refCount++,N.memoizedState={element:m,isDehydrated:u,cache:r},fu(N),a}function c2(a){return a?(a=Ui,a):Ui}function u2(a,r,u,m,v,N){v=c2(v),m.context===null?m.context=v:m.pendingContext=v,m=gi(r),m.payload={element:u},N=N===void 0?null:N,N!==null&&(m.callback=N),u=Qi(a,m,r),u!==null&&(pt(u,a,r),Ki(u,a,r))}function d2(a,r){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var u=a.retryLane;a.retryLane=u!==0&&u<r?u:r}}function Hy(a,r){d2(a,r),(a=a.alternate)&&d2(a,r)}function f2(a){if(a.tag===13||a.tag===31){var r=Za(a,67108864);r!==null&&pt(r,a,67108864),Hy(a,67108864)}}function h2(a){if(a.tag===13||a.tag===31){var r=Us();r=qe(r);var u=Za(a,r);u!==null&&pt(u,a,r),Hy(a,r)}}var M0=!0;function A7(a,r,u,m){var v=Y.T;Y.T=null;var N=$.p;try{$.p=2,By(a,r,u,m)}finally{$.p=N,Y.T=v}}function D7(a,r,u,m){var v=Y.T;Y.T=null;var N=$.p;try{$.p=8,By(a,r,u,m)}finally{$.p=N,Y.T=v}}function By(a,r,u,m){if(M0){var v=Gy(m);if(v===null)wy(a,r,m,A0,u),m2(a,m);else if(k7(v,a,r,u,m))m.stopPropagation();else if(m2(a,m),r&4&&-1<z7.indexOf(a)){for(;v!==null;){var N=pr(v);if(N!==null)switch(N.tag){case 3:if(N=N.stateNode,N.current.memoizedState.isDehydrated){var A=mt(N.pendingLanes);if(A!==0){var H=N;for(H.pendingLanes|=2,H.entangledLanes|=2;A;){var X=1<<31-ba(A);H.entanglements[1]|=X,A&=~X}je(N),(Ve&6)===0&&(Wn=Xn()+500,Ue(0))}}break;case 31:case 13:H=Za(N,2),H!==null&&pt(H,N,2),Sr(),Hy(N,2)}if(N=Gy(m),N===null&&wy(a,r,m,A0,u),N===v)break;v=N}v!==null&&m.stopPropagation()}else wy(a,r,m,null,u)}}function Gy(a){return a=xd(a),Py(a)}var A0=null;function Py(a){if(A0=null,a=Pt(a),a!==null){var r=o(a);if(r===null)a=null;else{var u=r.tag;if(u===13){if(a=d(r),a!==null)return a;a=null}else if(u===31){if(a=f(r),a!==null)return a;a=null}else if(u===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;a=null}else r!==a&&(a=null)}}return A0=a,null}function p2(a){switch(a){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ss()){case dr:return 2;case Qa:return 8;case la:case Ea:return 32;case rs:return 268435456;default:return 32}default:return 32}}var Yy=!1,sc=null,rc=null,ic=null,Bp=new Map,Gp=new Map,lc=[],z7="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function m2(a,r){switch(a){case"focusin":case"focusout":sc=null;break;case"dragenter":case"dragleave":rc=null;break;case"mouseover":case"mouseout":ic=null;break;case"pointerover":case"pointerout":Bp.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gp.delete(r.pointerId)}}function Pp(a,r,u,m,v,N){return a===null||a.nativeEvent!==N?(a={blockedOn:r,domEventName:u,eventSystemFlags:m,nativeEvent:N,targetContainers:[v]},r!==null&&(r=pr(r),r!==null&&f2(r)),a):(a.eventSystemFlags|=m,r=a.targetContainers,v!==null&&r.indexOf(v)===-1&&r.push(v),a)}function k7(a,r,u,m,v){switch(r){case"focusin":return sc=Pp(sc,a,r,u,m,v),!0;case"dragenter":return rc=Pp(rc,a,r,u,m,v),!0;case"mouseover":return ic=Pp(ic,a,r,u,m,v),!0;case"pointerover":var N=v.pointerId;return Bp.set(N,Pp(Bp.get(N)||null,a,r,u,m,v)),!0;case"gotpointercapture":return N=v.pointerId,Gp.set(N,Pp(Gp.get(N)||null,a,r,u,m,v)),!0}return!1}function g2(a){var r=Pt(a.target);if(r!==null){var u=o(r);if(u!==null){if(r=u.tag,r===13){if(r=d(u),r!==null){a.blockedOn=r,ot(a.priority,function(){h2(u)});return}}else if(r===31){if(r=f(u),r!==null){a.blockedOn=r,ot(a.priority,function(){h2(u)});return}}else if(r===3&&u.stateNode.current.memoizedState.isDehydrated){a.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}a.blockedOn=null}function D0(a){if(a.blockedOn!==null)return!1;for(var r=a.targetContainers;0<r.length;){var u=Gy(a.nativeEvent);if(u===null){u=a.nativeEvent;var m=new u.constructor(u.type,u);yd=m,u.target.dispatchEvent(m),yd=null}else return r=pr(u),r!==null&&f2(r),a.blockedOn=u,!1;r.shift()}return!0}function y2(a,r,u){D0(a)&&u.delete(r)}function L7(){Yy=!1,sc!==null&&D0(sc)&&(sc=null),rc!==null&&D0(rc)&&(rc=null),ic!==null&&D0(ic)&&(ic=null),Bp.forEach(y2),Gp.forEach(y2)}function z0(a,r){a.blockedOn===r&&(a.blockedOn=null,Yy||(Yy=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,L7)))}var k0=null;function x2(a){k0!==a&&(k0=a,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){k0===a&&(k0=null);for(var r=0;r<a.length;r+=3){var u=a[r],m=a[r+1],v=a[r+2];if(typeof m!="function"){if(Py(m||u)===null)continue;break}var N=pr(u);N!==null&&(a.splice(r,3),r-=3,gp(N,{pending:!0,data:v,method:u.method,action:m},m,v))}}))}function _f(a){function r(X){return z0(X,a)}sc!==null&&z0(sc,a),rc!==null&&z0(rc,a),ic!==null&&z0(ic,a),Bp.forEach(r),Gp.forEach(r);for(var u=0;u<lc.length;u++){var m=lc[u];m.blockedOn===a&&(m.blockedOn=null)}for(;0<lc.length&&(u=lc[0],u.blockedOn===null);)g2(u),u.blockedOn===null&&lc.shift();if(u=(a.ownerDocument||a).$$reactFormReplay,u!=null)for(m=0;m<u.length;m+=3){var v=u[m],N=u[m+1],A=v[ct]||null;if(typeof N=="function")A||x2(u);else if(A){var H=null;if(N&&N.hasAttribute("formAction")){if(v=N,A=N[ct]||null)H=A.formAction;else if(Py(v)!==null)continue}else H=A.action;typeof H=="function"?u[m+1]=H:(u.splice(m,3),m-=3),x2(u)}}}function b2(){function a(N){N.canIntercept&&N.info==="react-transition"&&N.intercept({handler:function(){return new Promise(function(A){return v=A})},focusReset:"manual",scroll:"manual"})}function r(){v!==null&&(v(),v=null),m||setTimeout(u,20)}function u(){if(!m&&!navigation.transition){var N=navigation.currentEntry;N&&N.url!=null&&navigation.navigate(N.url,{state:N.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,v=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(u,100),function(){m=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),v!==null&&(v(),v=null)}}}function Vy(a){this._internalRoot=a}L0.prototype.render=Vy.prototype.render=function(a){var r=this._internalRoot;if(r===null)throw Error(s(409));var u=r.current,m=Us();u2(u,m,a,r,null,null)},L0.prototype.unmount=Vy.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var r=a.containerInfo;u2(a.current,2,null,a,null,null),Sr(),r[sn]=null}};function L0(a){this._internalRoot=a}L0.prototype.unstable_scheduleHydration=function(a){if(a){var r=Qe();a={blockedOn:null,target:a,priority:r};for(var u=0;u<lc.length&&r!==0&&r<lc[u].priority;u++);lc.splice(u,0,a),u===0&&g2(a)}};var v2=e.version;if(v2!=="19.2.4")throw Error(s(527,v2,"19.2.4"));$.findDOMNode=function(a){var r=a._reactInternals;if(r===void 0)throw typeof a.render=="function"?Error(s(188)):(a=Object.keys(a).join(","),Error(s(268,a)));return a=y(r),a=a!==null?S(a):null,a=a===null?null:a.stateNode,a};var U7={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Y,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var U0=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!U0.isDisabled&&U0.supportsFiber)try{Hs=U0.inject(U7),ta=U0}catch{}}return Qp.createRoot=function(a,r){if(!i(a))throw Error(s(299));var u=!1,m="",v=p0,N=Np,A=_p;return r!=null&&(r.unstable_strictMode===!0&&(u=!0),r.identifierPrefix!==void 0&&(m=r.identifierPrefix),r.onUncaughtError!==void 0&&(v=r.onUncaughtError),r.onCaughtError!==void 0&&(N=r.onCaughtError),r.onRecoverableError!==void 0&&(A=r.onRecoverableError)),r=o2(a,1,!1,null,null,u,m,null,v,N,A,b2),a[sn]=r.current,jy(a),new Vy(r)},Qp.hydrateRoot=function(a,r,u){if(!i(a))throw Error(s(299));var m=!1,v="",N=p0,A=Np,H=_p,X=null;return u!=null&&(u.unstable_strictMode===!0&&(m=!0),u.identifierPrefix!==void 0&&(v=u.identifierPrefix),u.onUncaughtError!==void 0&&(N=u.onUncaughtError),u.onCaughtError!==void 0&&(A=u.onCaughtError),u.onRecoverableError!==void 0&&(H=u.onRecoverableError),u.formState!==void 0&&(X=u.formState)),r=o2(a,1,!0,r,u??null,m,v,X,N,A,H,b2),r.context=c2(null),u=r.current,m=Us(),m=qe(m),v=gi(m),v.callback=null,Qi(u,v,m),u=m,r.current.lanes=u,yn(r,u),je(r),a[sn]=r.current,jy(a),new L0(r)},Qp.version="19.2.4",Qp}var M2;function I7(){if(M2)return Zy.exports;M2=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Zy.exports=Z7(),Zy.exports}var Qb=I7();const J7=k1(Qb),N4=Yb({__proto__:null,default:J7},[Qb]);var $u=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Hu,bc,Lf,c4,W7=(c4=class extends $u{constructor(){super();He(this,Hu);He(this,bc);He(this,Lf);Ae(this,Lf,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){Q(this,bc)||this.setEventListener(Q(this,Lf))}onUnsubscribe(){var e;this.hasListeners()||((e=Q(this,bc))==null||e.call(this),Ae(this,bc,void 0))}setEventListener(e){var n;Ae(this,Lf,e),(n=Q(this,bc))==null||n.call(this),Ae(this,bc,e(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()}))}setFocused(e){Q(this,Hu)!==e&&(Ae(this,Hu,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof Q(this,Hu)=="boolean"?Q(this,Hu):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Hu=new WeakMap,bc=new WeakMap,Lf=new WeakMap,c4),U1=new W7,$7={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},vc,Pb,u4,e9=(u4=class{constructor(){He(this,vc,$7);He(this,Pb,!1)}setTimeoutProvider(t){Ae(this,vc,t)}setTimeout(t,e){return Q(this,vc).setTimeout(t,e)}clearTimeout(t){Q(this,vc).clearTimeout(t)}setInterval(t,e){return Q(this,vc).setInterval(t,e)}clearInterval(t){Q(this,vc).clearInterval(t)}},vc=new WeakMap,Pb=new WeakMap,u4),Rc=new e9;function t9(t){setTimeout(t,0)}var _4=typeof window>"u"||"Deno"in globalThis;function ma(){}function n9(t,e){return typeof t=="function"?t(e):t}function qx(t){return typeof t=="number"&&t>=0&&t!==1/0}function C4(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Oc(t,e){return typeof t=="function"?t(e):t}function ai(t,e){return typeof t=="function"?t(e):t}function Hx(t,e){const{type:n="all",exact:s,fetchStatus:i,predicate:o,queryKey:d,stale:f}=t;if(d){if(s){if(e.queryHash!==Kb(d,e.options))return!1}else if(!Jf(e.queryKey,d))return!1}if(n!=="all"){const p=e.isActive();if(n==="active"&&!p||n==="inactive"&&p)return!1}return!(typeof f=="boolean"&&e.isStale()!==f||i&&i!==e.state.fetchStatus||o&&!o(e))}function Bx(t,e){const{exact:n,status:s,predicate:i,mutationKey:o}=t;if(o){if(!e.options.mutationKey)return!1;if(n){if(Ac(e.options.mutationKey)!==Ac(o))return!1}else if(!Jf(e.options.mutationKey,o))return!1}return!(s&&e.state.status!==s||i&&!i(e))}function Kb(t,e){return((e==null?void 0:e.queryKeyHashFn)||Ac)(t)}function Ac(t){return JSON.stringify(t,(e,n)=>Gx(n)?Object.keys(n).sort().reduce((s,i)=>(s[i]=n[i],s),{}):n)}function Jf(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>Jf(t[n],e[n])):!1}var a9=Object.prototype.hasOwnProperty;function Km(t,e,n=0){if(t===e)return t;if(n>500)return e;const s=A2(t)&&A2(e);if(!s&&!(Gx(t)&&Gx(e)))return e;const o=(s?t:Object.keys(t)).length,d=s?e:Object.keys(e),f=d.length,p=s?new Array(f):{};let y=0;for(let S=0;S<f;S++){const b=s?S:d[S],_=t[b],j=e[b];if(_===j){p[b]=_,(s?S<o:a9.call(t,b))&&y++;continue}if(_===null||j===null||typeof _!="object"||typeof j!="object"){p[b]=j;continue}const w=Km(_,j,n+1);p[b]=w,w===_&&y++}return o===f&&y===o?t:p}function Cm(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function A2(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Gx(t){if(!D2(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!D2(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function D2(t){return Object.prototype.toString.call(t)==="[object Object]"}function s9(t){return new Promise(e=>{Rc.setTimeout(e,t)})}function Px(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?Km(t,e):e}function r9(t){return t}function j4(t,e,n=0){const s=[...t,e];return n&&s.length>n?s.slice(1):s}function i9(t,e,n=0){const s=[e,...t];return n&&s.length>n?s.slice(0,-1):s}var q1=Symbol();function w4(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===q1?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function H1(t,e){return typeof t=="function"?t(...e):!!t}function E4(t,e,n){let s=!1,i;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(i??(i=e()),s||(s=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),t}var Wf=(()=>{let t=()=>_4;return{isServer(){return t()},setIsServer(e){t=e}}})();function Yx(){let t,e;const n=new Promise((i,o)=>{t=i,e=o});n.status="pending",n.catch(()=>{});function s(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{s({status:"fulfilled",value:i}),t(i)},n.reject=i=>{s({status:"rejected",reason:i}),e(i)},n}function l9(t){var n;let e;if((n=t.then(s=>(e=s,s),ma))==null||n.catch(ma),e!==void 0)return{data:e}}function T4(t){return t}function o9(t){return{mutationKey:t.options.mutationKey,state:t.state,...t.options.scope&&{scope:t.options.scope},...t.meta&&{meta:t.meta}}}function c9(t,e,n){const s=()=>{var o;const i=(o=t.promise)==null?void 0:o.then(e).catch(d=>n(d)?Promise.reject(new Error("redacted")):Promise.reject(d));return i==null||i.catch(ma),i};return{dehydratedAt:Date.now(),state:{...t.state,...t.state.data!==void 0&&{data:e(t.state.data)}},queryKey:t.queryKey,queryHash:t.queryHash,...t.state.status==="pending"&&{promise:s()},...t.meta&&{meta:t.meta}}}function R4(t){return t.state.isPaused}function O4(t){return t.state.status==="success"}function u9(t){return!0}function d9(t,e={}){var p,y,S,b;const n=e.shouldDehydrateMutation??((p=t.getDefaultOptions().dehydrate)==null?void 0:p.shouldDehydrateMutation)??R4,s=t.getMutationCache().getAll().flatMap(_=>n(_)?[o9(_)]:[]),i=e.shouldDehydrateQuery??((y=t.getDefaultOptions().dehydrate)==null?void 0:y.shouldDehydrateQuery)??O4,o=e.shouldRedactErrors??((S=t.getDefaultOptions().dehydrate)==null?void 0:S.shouldRedactErrors)??u9,d=e.serializeData??((b=t.getDefaultOptions().dehydrate)==null?void 0:b.serializeData)??T4,f=t.getQueryCache().getAll().flatMap(_=>i(_)?[c9(_,d,o)]:[]);return{mutations:s,queries:f}}function Vx(t,e,n){var p,y;if(typeof e!="object"||e===null)return;const s=t.getMutationCache(),i=t.getQueryCache(),o=((p=n==null?void 0:n.defaultOptions)==null?void 0:p.deserializeData)??((y=t.getDefaultOptions().hydrate)==null?void 0:y.deserializeData)??T4,d=e.mutations||[],f=e.queries||[];d.forEach(({state:S,...b})=>{var _,j;s.build(t,{...(_=t.getDefaultOptions().hydrate)==null?void 0:_.mutations,...(j=n==null?void 0:n.defaultOptions)==null?void 0:j.mutations,...b},S)}),f.forEach(({queryKey:S,state:b,queryHash:_,meta:j,promise:w,dehydratedAt:T})=>{var P,L;const O=w?l9(w):void 0,R=b.data===void 0?O==null?void 0:O.data:b.data,M=R===void 0?R:o(R);let z=i.get(_);const k=(z==null?void 0:z.state.status)==="pending",G=(z==null?void 0:z.state.fetchStatus)==="fetching";if(z){const U=O&&T!==void 0&&T>z.state.dataUpdatedAt;if(b.dataUpdatedAt>z.state.dataUpdatedAt||U){const{fetchStatus:V,...Z}=b;z.setState({...Z,data:M})}}else z=i.build(t,{...(P=t.getDefaultOptions().hydrate)==null?void 0:P.queries,...(L=n==null?void 0:n.defaultOptions)==null?void 0:L.queries,queryKey:S,queryHash:_,meta:j},{...b,data:M,fetchStatus:"idle",status:M!==void 0?"success":b.status});w&&!k&&!G&&(T===void 0||T>z.state.dataUpdatedAt)&&z.fetch(void 0,{initialPromise:Promise.resolve(w).then(o)}).catch(ma)})}var M4=t9;function f9(){let t=[],e=0,n=f=>{f()},s=f=>{f()},i=M4;const o=f=>{e?t.push(f):i(()=>{n(f)})},d=()=>{const f=t;t=[],f.length&&i(()=>{s(()=>{f.forEach(p=>{n(p)})})})};return{batch:f=>{let p;e++;try{p=f()}finally{e--,e||d()}return p},batchCalls:f=>(...p)=>{o(()=>{f(...p)})},schedule:o,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{s=f},setScheduler:f=>{i=f}}}var Un=f9(),Uf,Sc,qf,d4,h9=(d4=class extends $u{constructor(){super();He(this,Uf,!0);He(this,Sc);He(this,qf);Ae(this,qf,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",s)}}})}onSubscribe(){Q(this,Sc)||this.setEventListener(Q(this,qf))}onUnsubscribe(){var e;this.hasListeners()||((e=Q(this,Sc))==null||e.call(this),Ae(this,Sc,void 0))}setEventListener(e){var n;Ae(this,qf,e),(n=Q(this,Sc))==null||n.call(this),Ae(this,Sc,e(this.setOnline.bind(this)))}setOnline(e){Q(this,Uf)!==e&&(Ae(this,Uf,e),this.listeners.forEach(s=>{s(e)}))}isOnline(){return Q(this,Uf)}},Uf=new WeakMap,Sc=new WeakMap,qf=new WeakMap,d4),jm=new h9;function p9(t){return Math.min(1e3*2**t,3e4)}function A4(t){return(t??"online")==="online"?jm.isOnline():!0}var wm=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function m9(t){return t instanceof wm}function D4(t){let e=!1,n=0,s;const i=Yx(),o=()=>i.status!=="pending",d=T=>{var O;if(!o()){const R=new wm(T);_(R),(O=t.onCancel)==null||O.call(t,R)}},f=()=>{e=!0},p=()=>{e=!1},y=()=>U1.isFocused()&&(t.networkMode==="always"||jm.isOnline())&&t.canRun(),S=()=>A4(t.networkMode)&&t.canRun(),b=T=>{o()||(s==null||s(),i.resolve(T))},_=T=>{o()||(s==null||s(),i.reject(T))},j=()=>new Promise(T=>{var O;s=R=>{(o()||y())&&T(R)},(O=t.onPause)==null||O.call(t)}).then(()=>{var T;s=void 0,o()||(T=t.onContinue)==null||T.call(t)}),w=()=>{if(o())return;let T;const O=n===0?t.initialPromise:void 0;try{T=O??t.fn()}catch(R){T=Promise.reject(R)}Promise.resolve(T).then(b).catch(R=>{var P;if(o())return;const M=t.retry??(Wf.isServer()?0:3),z=t.retryDelay??p9,k=typeof z=="function"?z(n,R):z,G=M===!0||typeof M=="number"&&n<M||typeof M=="function"&&M(n,R);if(e||!G){_(R);return}n++,(P=t.onFail)==null||P.call(t,n,R),s9(k).then(()=>y()?void 0:j()).then(()=>{e?_(R):w()})})};return{promise:i,status:()=>i.status,cancel:d,continue:()=>(s==null||s(),i),cancelRetry:f,continueRetry:p,canStart:S,start:()=>(S()?w():j().then(w),i)}}var Bu,f4,z4=(f4=class{constructor(){He(this,Bu)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),qx(this.gcTime)&&Ae(this,Bu,Rc.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Wf.isServer()?1/0:300*1e3))}clearGcTimeout(){Q(this,Bu)&&(Rc.clearTimeout(Q(this,Bu)),Ae(this,Bu,void 0))}},Bu=new WeakMap,f4),Gu,Hf,ti,Pu,Va,Um,Yu,_r,L4,ao,h4,k4=(h4=class extends z4{constructor(e){super();He(this,_r);He(this,Gu);He(this,Hf);He(this,ti);He(this,Pu);He(this,Va);He(this,Um);He(this,Yu);Ae(this,Yu,!1),Ae(this,Um,e.defaultOptions),this.setOptions(e.options),this.observers=[],Ae(this,Pu,e.client),Ae(this,ti,Q(this,Pu).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Ae(this,Gu,k2(this.options)),this.state=e.state??Q(this,Gu),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=Q(this,Va))==null?void 0:e.promise}setOptions(e){if(this.options={...Q(this,Um),...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=k2(this.options);n.data!==void 0&&(this.setState(z2(n.data,n.dataUpdatedAt)),Ae(this,Gu,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Q(this,ti).remove(this)}setData(e,n){const s=Px(this.state.data,e,this.options);return We(this,_r,ao).call(this,{data:s,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),s}setState(e,n){We(this,_r,ao).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var s,i;const n=(s=Q(this,Va))==null?void 0:s.promise;return(i=Q(this,Va))==null||i.cancel(e),n?n.then(ma).catch(ma):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return Q(this,Gu)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>ai(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===q1||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Oc(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!C4(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(s=>s.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=Q(this,Va))==null||n.continue()}onOnline(){var n;const e=this.observers.find(s=>s.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=Q(this,Va))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),Q(this,ti).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(Q(this,Va)&&(Q(this,Yu)||We(this,_r,L4).call(this)?Q(this,Va).cancel({revert:!0}):Q(this,Va).cancelRetry()),this.scheduleGc()),Q(this,ti).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||We(this,_r,ao).call(this,{type:"invalidate"})}async fetch(e,n){var p,y,S,b,_,j,w,T,O,R,M,z;if(this.state.fetchStatus!=="idle"&&((p=Q(this,Va))==null?void 0:p.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(Q(this,Va))return Q(this,Va).continueRetry(),Q(this,Va).promise}if(e&&this.setOptions(e),!this.options.queryFn){const k=this.observers.find(G=>G.options.queryFn);k&&this.setOptions(k.options)}const s=new AbortController,i=k=>{Object.defineProperty(k,"signal",{enumerable:!0,get:()=>(Ae(this,Yu,!0),s.signal)})},o=()=>{const k=w4(this.options,n),P=(()=>{const L={client:Q(this,Pu),queryKey:this.queryKey,meta:this.meta};return i(L),L})();return Ae(this,Yu,!1),this.options.persister?this.options.persister(k,P,this):k(P)},f=(()=>{const k={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:Q(this,Pu),state:this.state,fetchFn:o};return i(k),k})();(y=this.options.behavior)==null||y.onFetch(f,this),Ae(this,Hf,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((S=f.fetchOptions)==null?void 0:S.meta))&&We(this,_r,ao).call(this,{type:"fetch",meta:(b=f.fetchOptions)==null?void 0:b.meta}),Ae(this,Va,D4({initialPromise:n==null?void 0:n.initialPromise,fn:f.fetchFn,onCancel:k=>{k instanceof wm&&k.revert&&this.setState({...Q(this,Hf),fetchStatus:"idle"}),s.abort()},onFail:(k,G)=>{We(this,_r,ao).call(this,{type:"failed",failureCount:k,error:G})},onPause:()=>{We(this,_r,ao).call(this,{type:"pause"})},onContinue:()=>{We(this,_r,ao).call(this,{type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0}));try{const k=await Q(this,Va).start();if(k===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(k),(j=(_=Q(this,ti).config).onSuccess)==null||j.call(_,k,this),(T=(w=Q(this,ti).config).onSettled)==null||T.call(w,k,this.state.error,this),k}catch(k){if(k instanceof wm){if(k.silent)return Q(this,Va).promise;if(k.revert){if(this.state.data===void 0)throw k;return this.state.data}}throw We(this,_r,ao).call(this,{type:"error",error:k}),(R=(O=Q(this,ti).config).onError)==null||R.call(O,k,this),(z=(M=Q(this,ti).config).onSettled)==null||z.call(M,this.state.data,k,this),k}finally{this.scheduleGc()}}},Gu=new WeakMap,Hf=new WeakMap,ti=new WeakMap,Pu=new WeakMap,Va=new WeakMap,Um=new WeakMap,Yu=new WeakMap,_r=new WeakSet,L4=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},ao=function(e){const n=s=>{switch(e.type){case"failed":return{...s,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...U4(s.data,this.options),fetchMeta:e.meta??null};case"success":const i={...s,...z2(e.data,e.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ae(this,Hf,e.manual?i:void 0),i;case"error":const o=e.error;return{...s,error:o,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...e.state}}};this.state=n(this.state),Un.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),Q(this,ti).notify({query:this,type:"updated",action:e})})},h4);function U4(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:A4(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function z2(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function k2(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,s=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var or,qt,qm,qs,Vu,Bf,io,Nc,Hm,Gf,Pf,Qu,Ku,_c,Yf,an,cm,Qx,Kx,Xx,Fx,Zx,Ix,Jx,q4,p4,rh=(p4=class extends $u{constructor(e,n){super();He(this,an);He(this,or);He(this,qt);He(this,qm);He(this,qs);He(this,Vu);He(this,Bf);He(this,io);He(this,Nc);He(this,Hm);He(this,Gf);He(this,Pf);He(this,Qu);He(this,Ku);He(this,_c);He(this,Yf,new Set);this.options=n,Ae(this,or,e),Ae(this,Nc,null),Ae(this,io,Yx()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Q(this,qt).addObserver(this),L2(Q(this,qt),this.options)?We(this,an,cm).call(this):this.updateResult(),We(this,an,Fx).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Wx(Q(this,qt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Wx(Q(this,qt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,We(this,an,Zx).call(this),We(this,an,Ix).call(this),Q(this,qt).removeObserver(this)}setOptions(e){const n=this.options,s=Q(this,qt);if(this.options=Q(this,or).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ai(this.options.enabled,Q(this,qt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");We(this,an,Jx).call(this),Q(this,qt).setOptions(this.options),n._defaulted&&!Cm(this.options,n)&&Q(this,or).getQueryCache().notify({type:"observerOptionsUpdated",query:Q(this,qt),observer:this});const i=this.hasListeners();i&&U2(Q(this,qt),s,this.options,n)&&We(this,an,cm).call(this),this.updateResult(),i&&(Q(this,qt)!==s||ai(this.options.enabled,Q(this,qt))!==ai(n.enabled,Q(this,qt))||Oc(this.options.staleTime,Q(this,qt))!==Oc(n.staleTime,Q(this,qt)))&&We(this,an,Qx).call(this);const o=We(this,an,Kx).call(this);i&&(Q(this,qt)!==s||ai(this.options.enabled,Q(this,qt))!==ai(n.enabled,Q(this,qt))||o!==Q(this,_c))&&We(this,an,Xx).call(this,o)}getOptimisticResult(e){const n=Q(this,or).getQueryCache().build(Q(this,or),e),s=this.createResult(n,e);return y9(this,s)&&(Ae(this,qs,s),Ae(this,Bf,this.options),Ae(this,Vu,Q(this,qt).state)),s}getCurrentResult(){return Q(this,qs)}trackResult(e,n){return new Proxy(e,{get:(s,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&Q(this,io).status==="pending"&&Q(this,io).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,i))})}trackProp(e){Q(this,Yf).add(e)}getCurrentQuery(){return Q(this,qt)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=Q(this,or).defaultQueryOptions(e),s=Q(this,or).getQueryCache().build(Q(this,or),n);return s.fetch().then(()=>this.createResult(s,n))}fetch(e){return We(this,an,cm).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),Q(this,qs)))}createResult(e,n){var V;const s=Q(this,qt),i=this.options,o=Q(this,qs),d=Q(this,Vu),f=Q(this,Bf),y=e!==s?e.state:Q(this,qm),{state:S}=e;let b={...S},_=!1,j;if(n._optimisticResults){const Z=this.hasListeners(),re=!Z&&L2(e,n),ne=Z&&U2(e,s,n,i);(re||ne)&&(b={...b,...U4(S.data,e.options)}),n._optimisticResults==="isRestoring"&&(b.fetchStatus="idle")}let{error:w,errorUpdatedAt:T,status:O}=b;j=b.data;let R=!1;if(n.placeholderData!==void 0&&j===void 0&&O==="pending"){let Z;o!=null&&o.isPlaceholderData&&n.placeholderData===(f==null?void 0:f.placeholderData)?(Z=o.data,R=!0):Z=typeof n.placeholderData=="function"?n.placeholderData((V=Q(this,Pf))==null?void 0:V.state.data,Q(this,Pf)):n.placeholderData,Z!==void 0&&(O="success",j=Px(o==null?void 0:o.data,Z,n),_=!0)}if(n.select&&j!==void 0&&!R)if(o&&j===(d==null?void 0:d.data)&&n.select===Q(this,Hm))j=Q(this,Gf);else try{Ae(this,Hm,n.select),j=n.select(j),j=Px(o==null?void 0:o.data,j,n),Ae(this,Gf,j),Ae(this,Nc,null)}catch(Z){Ae(this,Nc,Z)}Q(this,Nc)&&(w=Q(this,Nc),j=Q(this,Gf),T=Date.now(),O="error");const M=b.fetchStatus==="fetching",z=O==="pending",k=O==="error",G=z&&M,P=j!==void 0,U={status:O,fetchStatus:b.fetchStatus,isPending:z,isSuccess:O==="success",isError:k,isInitialLoading:G,isLoading:G,data:j,dataUpdatedAt:b.dataUpdatedAt,error:w,errorUpdatedAt:T,failureCount:b.fetchFailureCount,failureReason:b.fetchFailureReason,errorUpdateCount:b.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:b.dataUpdateCount>y.dataUpdateCount||b.errorUpdateCount>y.errorUpdateCount,isFetching:M,isRefetching:M&&!z,isLoadingError:k&&!P,isPaused:b.fetchStatus==="paused",isPlaceholderData:_,isRefetchError:k&&P,isStale:Xb(e,n),refetch:this.refetch,promise:Q(this,io),isEnabled:ai(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const Z=U.data!==void 0,re=U.status==="error"&&!Z,ne=ce=>{re?ce.reject(U.error):Z&&ce.resolve(U.data)},W=()=>{const ce=Ae(this,io,U.promise=Yx());ne(ce)},ie=Q(this,io);switch(ie.status){case"pending":e.queryHash===s.queryHash&&ne(ie);break;case"fulfilled":(re||U.data!==ie.value)&&W();break;case"rejected":(!re||U.error!==ie.reason)&&W();break}}return U}updateResult(){const e=Q(this,qs),n=this.createResult(Q(this,qt),this.options);if(Ae(this,Vu,Q(this,qt).state),Ae(this,Bf,this.options),Q(this,Vu).data!==void 0&&Ae(this,Pf,Q(this,qt)),Cm(n,e))return;Ae(this,qs,n);const s=()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!Q(this,Yf).size)return!0;const d=new Set(o??Q(this,Yf));return this.options.throwOnError&&d.add("error"),Object.keys(Q(this,qs)).some(f=>{const p=f;return Q(this,qs)[p]!==e[p]&&d.has(p)})};We(this,an,q4).call(this,{listeners:s()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&We(this,an,Fx).call(this)}},or=new WeakMap,qt=new WeakMap,qm=new WeakMap,qs=new WeakMap,Vu=new WeakMap,Bf=new WeakMap,io=new WeakMap,Nc=new WeakMap,Hm=new WeakMap,Gf=new WeakMap,Pf=new WeakMap,Qu=new WeakMap,Ku=new WeakMap,_c=new WeakMap,Yf=new WeakMap,an=new WeakSet,cm=function(e){We(this,an,Jx).call(this);let n=Q(this,qt).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(ma)),n},Qx=function(){We(this,an,Zx).call(this);const e=Oc(this.options.staleTime,Q(this,qt));if(Wf.isServer()||Q(this,qs).isStale||!qx(e))return;const s=C4(Q(this,qs).dataUpdatedAt,e)+1;Ae(this,Qu,Rc.setTimeout(()=>{Q(this,qs).isStale||this.updateResult()},s))},Kx=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Q(this,qt)):this.options.refetchInterval)??!1},Xx=function(e){We(this,an,Ix).call(this),Ae(this,_c,e),!(Wf.isServer()||ai(this.options.enabled,Q(this,qt))===!1||!qx(Q(this,_c))||Q(this,_c)===0)&&Ae(this,Ku,Rc.setInterval(()=>{(this.options.refetchIntervalInBackground||U1.isFocused())&&We(this,an,cm).call(this)},Q(this,_c)))},Fx=function(){We(this,an,Qx).call(this),We(this,an,Xx).call(this,We(this,an,Kx).call(this))},Zx=function(){Q(this,Qu)&&(Rc.clearTimeout(Q(this,Qu)),Ae(this,Qu,void 0))},Ix=function(){Q(this,Ku)&&(Rc.clearInterval(Q(this,Ku)),Ae(this,Ku,void 0))},Jx=function(){const e=Q(this,or).getQueryCache().build(Q(this,or),this.options);if(e===Q(this,qt))return;const n=Q(this,qt);Ae(this,qt,e),Ae(this,qm,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},q4=function(e){Un.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(Q(this,qs))}),Q(this,or).getQueryCache().notify({query:Q(this,qt),type:"observerResultsUpdated"})})},p4);function g9(t,e){return ai(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function L2(t,e){return g9(t,e)||t.state.data!==void 0&&Wx(t,e,e.refetchOnMount)}function Wx(t,e,n){if(ai(e.enabled,t)!==!1&&Oc(e.staleTime,t)!=="static"){const s=typeof n=="function"?n(t):n;return s==="always"||s!==!1&&Xb(t,e)}return!1}function U2(t,e,n,s){return(t!==e||ai(s.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&Xb(t,n)}function Xb(t,e){return ai(e.enabled,t)!==!1&&t.isStaleByTime(Oc(e.staleTime,t))}function y9(t,e){return!Cm(t.getCurrentResult(),e)}function v1(t){return{onFetch:(e,n)=>{var S,b,_,j,w;const s=e.options,i=(_=(b=(S=e.fetchOptions)==null?void 0:S.meta)==null?void 0:b.fetchMore)==null?void 0:_.direction,o=((j=e.state.data)==null?void 0:j.pages)||[],d=((w=e.state.data)==null?void 0:w.pageParams)||[];let f={pages:[],pageParams:[]},p=0;const y=async()=>{let T=!1;const O=z=>{E4(z,()=>e.signal,()=>T=!0)},R=w4(e.options,e.fetchOptions),M=async(z,k,G)=>{if(T)return Promise.reject();if(k==null&&z.pages.length)return Promise.resolve(z);const L=(()=>{const re={client:e.client,queryKey:e.queryKey,pageParam:k,direction:G?"backward":"forward",meta:e.options.meta};return O(re),re})(),U=await R(L),{maxPages:V}=e.options,Z=G?i9:j4;return{pages:Z(z.pages,U,V),pageParams:Z(z.pageParams,k,V)}};if(i&&o.length){const z=i==="backward",k=z?H4:$x,G={pages:o,pageParams:d},P=k(s,G);f=await M(G,P,z)}else{const z=t??o.length;do{const k=p===0?d[0]??s.initialPageParam:$x(s,f);if(p>0&&k==null)break;f=await M(f,k),p++}while(p<z)}return f};e.options.persister?e.fetchFn=()=>{var T,O;return(O=(T=e.options).persister)==null?void 0:O.call(T,y,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=y}}}function $x(t,{pages:e,pageParams:n}){const s=e.length-1;return e.length>0?t.getNextPageParam(e[s],e,n[s],n):void 0}function H4(t,{pages:e,pageParams:n}){var s;return e.length>0?(s=t.getPreviousPageParam)==null?void 0:s.call(t,e[0],e,n[0],n):void 0}function x9(t,e){return e?$x(t,e)!=null:!1}function b9(t,e){return!e||!t.getPreviousPageParam?!1:H4(t,e)!=null}var Fb=class extends rh{constructor(t,e){super(t,e)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(t){super.setOptions({...t,behavior:v1()})}getOptimisticResult(t){return t.behavior=v1(),super.getOptimisticResult(t)}fetchNextPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"backward"}}})}createResult(t,e){var w,T;const{state:n}=t,s=super.createResult(t,e),{isFetching:i,isRefetching:o,isError:d,isRefetchError:f}=s,p=(T=(w=n.fetchMeta)==null?void 0:w.fetchMore)==null?void 0:T.direction,y=d&&p==="forward",S=i&&p==="forward",b=d&&p==="backward",_=i&&p==="backward";return{...s,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:x9(e,n.data),hasPreviousPage:b9(e,n.data),isFetchNextPageError:y,isFetchingNextPage:S,isFetchPreviousPageError:b,isFetchingPreviousPage:_,isRefetchError:f&&!y&&!b,isRefetching:o&&!S&&!_}}},Bm,ul,bs,Xu,dl,hc,m4,B4=(m4=class extends z4{constructor(e){super();He(this,dl);He(this,Bm);He(this,ul);He(this,bs);He(this,Xu);Ae(this,Bm,e.client),this.mutationId=e.mutationId,Ae(this,bs,e.mutationCache),Ae(this,ul,[]),this.state=e.state||G4(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){Q(this,ul).includes(e)||(Q(this,ul).push(e),this.clearGcTimeout(),Q(this,bs).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Ae(this,ul,Q(this,ul).filter(n=>n!==e)),this.scheduleGc(),Q(this,bs).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){Q(this,ul).length||(this.state.status==="pending"?this.scheduleGc():Q(this,bs).remove(this))}continue(){var e;return((e=Q(this,Xu))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var d,f,p,y,S,b,_,j,w,T,O,R,M,z,k,G,P,L;const n=()=>{We(this,dl,hc).call(this,{type:"continue"})},s={client:Q(this,Bm),meta:this.options.meta,mutationKey:this.options.mutationKey};Ae(this,Xu,D4({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(new Error("No mutationFn found")),onFail:(U,V)=>{We(this,dl,hc).call(this,{type:"failed",failureCount:U,error:V})},onPause:()=>{We(this,dl,hc).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Q(this,bs).canRun(this)}));const i=this.state.status==="pending",o=!Q(this,Xu).canStart();try{if(i)n();else{We(this,dl,hc).call(this,{type:"pending",variables:e,isPaused:o}),Q(this,bs).config.onMutate&&await Q(this,bs).config.onMutate(e,this,s);const V=await((f=(d=this.options).onMutate)==null?void 0:f.call(d,e,s));V!==this.state.context&&We(this,dl,hc).call(this,{type:"pending",context:V,variables:e,isPaused:o})}const U=await Q(this,Xu).start();return await((y=(p=Q(this,bs).config).onSuccess)==null?void 0:y.call(p,U,e,this.state.context,this,s)),await((b=(S=this.options).onSuccess)==null?void 0:b.call(S,U,e,this.state.context,s)),await((j=(_=Q(this,bs).config).onSettled)==null?void 0:j.call(_,U,null,this.state.variables,this.state.context,this,s)),await((T=(w=this.options).onSettled)==null?void 0:T.call(w,U,null,e,this.state.context,s)),We(this,dl,hc).call(this,{type:"success",data:U}),U}catch(U){try{await((R=(O=Q(this,bs).config).onError)==null?void 0:R.call(O,U,e,this.state.context,this,s))}catch(V){Promise.reject(V)}try{await((z=(M=this.options).onError)==null?void 0:z.call(M,U,e,this.state.context,s))}catch(V){Promise.reject(V)}try{await((G=(k=Q(this,bs).config).onSettled)==null?void 0:G.call(k,void 0,U,this.state.variables,this.state.context,this,s))}catch(V){Promise.reject(V)}try{await((L=(P=this.options).onSettled)==null?void 0:L.call(P,void 0,U,e,this.state.context,s))}catch(V){Promise.reject(V)}throw We(this,dl,hc).call(this,{type:"error",error:U}),U}finally{Q(this,bs).runNext(this)}}},Bm=new WeakMap,ul=new WeakMap,bs=new WeakMap,Xu=new WeakMap,dl=new WeakSet,hc=function(e){const n=s=>{switch(e.type){case"failed":return{...s,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...s,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:e.error,failureCount:s.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Un.batch(()=>{Q(this,ul).forEach(s=>{s.onMutationUpdate(e)}),Q(this,bs).notify({mutation:this,type:"updated",action:e})})},m4);function G4(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var lo,wi,Gm,g4,P4=(g4=class extends $u{constructor(e={}){super();He(this,lo);He(this,wi);He(this,Gm);this.config=e,Ae(this,lo,new Set),Ae(this,wi,new Map),Ae(this,Gm,0)}build(e,n,s){const i=new B4({client:e,mutationCache:this,mutationId:++q0(this,Gm)._,options:e.defaultMutationOptions(n),state:s});return this.add(i),i}add(e){Q(this,lo).add(e);const n=H0(e);if(typeof n=="string"){const s=Q(this,wi).get(n);s?s.push(e):Q(this,wi).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(Q(this,lo).delete(e)){const n=H0(e);if(typeof n=="string"){const s=Q(this,wi).get(n);if(s)if(s.length>1){const i=s.indexOf(e);i!==-1&&s.splice(i,1)}else s[0]===e&&Q(this,wi).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=H0(e);if(typeof n=="string"){const s=Q(this,wi).get(n),i=s==null?void 0:s.find(o=>o.state.status==="pending");return!i||i===e}else return!0}runNext(e){var s;const n=H0(e);if(typeof n=="string"){const i=(s=Q(this,wi).get(n))==null?void 0:s.find(o=>o!==e&&o.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Un.batch(()=>{Q(this,lo).forEach(e=>{this.notify({type:"removed",mutation:e})}),Q(this,lo).clear(),Q(this,wi).clear()})}getAll(){return Array.from(Q(this,lo))}find(e){const n={exact:!0,...e};return this.getAll().find(s=>Bx(n,s))}findAll(e={}){return this.getAll().filter(n=>Bx(e,n))}notify(e){Un.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Un.batch(()=>Promise.all(e.map(n=>n.continue().catch(ma))))}},lo=new WeakMap,wi=new WeakMap,Gm=new WeakMap,g4);function H0(t){var e;return(e=t.options.scope)==null?void 0:e.id}var oo,Cc,cr,co,fo,f1,eb,y4,Y4=(y4=class extends $u{constructor(n,s){super();He(this,fo);He(this,oo);He(this,Cc);He(this,cr);He(this,co);Ae(this,oo,n),this.setOptions(s),this.bindMethods(),We(this,fo,f1).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const s=this.options;this.options=Q(this,oo).defaultMutationOptions(n),Cm(this.options,s)||Q(this,oo).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Q(this,cr),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&Ac(s.mutationKey)!==Ac(this.options.mutationKey)?this.reset():((i=Q(this,cr))==null?void 0:i.state.status)==="pending"&&Q(this,cr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=Q(this,cr))==null||n.removeObserver(this)}onMutationUpdate(n){We(this,fo,f1).call(this),We(this,fo,eb).call(this,n)}getCurrentResult(){return Q(this,Cc)}reset(){var n;(n=Q(this,cr))==null||n.removeObserver(this),Ae(this,cr,void 0),We(this,fo,f1).call(this),We(this,fo,eb).call(this)}mutate(n,s){var i;return Ae(this,co,s),(i=Q(this,cr))==null||i.removeObserver(this),Ae(this,cr,Q(this,oo).getMutationCache().build(Q(this,oo),this.options)),Q(this,cr).addObserver(this),Q(this,cr).execute(n)}},oo=new WeakMap,Cc=new WeakMap,cr=new WeakMap,co=new WeakMap,fo=new WeakSet,f1=function(){var s;const n=((s=Q(this,cr))==null?void 0:s.state)??G4();Ae(this,Cc,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},eb=function(n){Un.batch(()=>{var s,i,o,d,f,p,y,S;if(Q(this,co)&&this.hasListeners()){const b=Q(this,Cc).variables,_=Q(this,Cc).context,j={client:Q(this,oo),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(i=(s=Q(this,co)).onSuccess)==null||i.call(s,n.data,b,_,j)}catch(w){Promise.reject(w)}try{(d=(o=Q(this,co)).onSettled)==null||d.call(o,n.data,null,b,_,j)}catch(w){Promise.reject(w)}}else if((n==null?void 0:n.type)==="error"){try{(p=(f=Q(this,co)).onError)==null||p.call(f,n.error,b,_,j)}catch(w){Promise.reject(w)}try{(S=(y=Q(this,co)).onSettled)==null||S.call(y,void 0,n.error,b,_,j)}catch(w){Promise.reject(w)}}}this.listeners.forEach(b=>{b(Q(this,Cc))})})},y4);function q2(t,e){const n=new Set(e);return t.filter(s=>!n.has(s))}function v9(t,e,n){const s=t.slice(0);return s[e]=n,s}var Vf,Nr,Qf,Kf,ni,jc,Pm,Ym,Vm,Qm,ss,tb,nb,ab,sb,rb,x4,V4=(x4=class extends $u{constructor(e,n,s){super();He(this,ss);He(this,Vf);He(this,Nr);He(this,Qf);He(this,Kf);He(this,ni);He(this,jc);He(this,Pm);He(this,Ym);He(this,Vm);He(this,Qm,[]);Ae(this,Vf,e),Ae(this,Kf,s),Ae(this,Qf,[]),Ae(this,ni,[]),Ae(this,Nr,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&Q(this,ni).forEach(e=>{e.subscribe(n=>{We(this,ss,sb).call(this,e,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,Q(this,ni).forEach(e=>{e.destroy()})}setQueries(e,n){Ae(this,Qf,e),Ae(this,Kf,n),Un.batch(()=>{const s=Q(this,ni),i=We(this,ss,ab).call(this,Q(this,Qf));i.forEach(b=>b.observer.setOptions(b.defaultedQueryOptions));const o=i.map(b=>b.observer),d=o.map(b=>b.getCurrentResult()),f=s.length!==o.length,p=o.some((b,_)=>b!==s[_]),y=f||p,S=y?!0:d.some((b,_)=>{const j=Q(this,Nr)[_];return!j||!Cm(b,j)});!y&&!S||(y&&(Ae(this,Qm,i),Ae(this,ni,o)),Ae(this,Nr,d),this.hasListeners()&&(y&&(q2(s,o).forEach(b=>{b.destroy()}),q2(o,s).forEach(b=>{b.subscribe(_=>{We(this,ss,sb).call(this,b,_)})})),We(this,ss,rb).call(this)))})}getCurrentResult(){return Q(this,Nr)}getQueries(){return Q(this,ni).map(e=>e.getCurrentQuery())}getObservers(){return Q(this,ni)}getOptimisticResult(e,n){const s=We(this,ss,ab).call(this,e),i=s.map(d=>d.observer.getOptimisticResult(d.defaultedQueryOptions)),o=s.map(d=>d.defaultedQueryOptions.queryHash);return[i,d=>We(this,ss,nb).call(this,d??i,n,o),()=>We(this,ss,tb).call(this,i,s)]}},Vf=new WeakMap,Nr=new WeakMap,Qf=new WeakMap,Kf=new WeakMap,ni=new WeakMap,jc=new WeakMap,Pm=new WeakMap,Ym=new WeakMap,Vm=new WeakMap,Qm=new WeakMap,ss=new WeakSet,tb=function(e,n){return n.map((s,i)=>{const o=e[i];return s.defaultedQueryOptions.notifyOnChangeProps?o:s.observer.trackResult(o,d=>{n.forEach(f=>{f.observer.trackProp(d)})})})},nb=function(e,n,s){if(n){const i=Q(this,Vm),o=s!==void 0&&i!==void 0&&(i.length!==s.length||s.some((d,f)=>d!==i[f]));return(!Q(this,jc)||Q(this,Nr)!==Q(this,Ym)||o||n!==Q(this,Pm))&&(Ae(this,Pm,n),Ae(this,Ym,Q(this,Nr)),s!==void 0&&Ae(this,Vm,s),Ae(this,jc,Km(Q(this,jc),n(e)))),Q(this,jc)}return e},ab=function(e){const n=new Map;Q(this,ni).forEach(i=>{const o=i.options.queryHash;if(!o)return;const d=n.get(o);d?d.push(i):n.set(o,[i])});const s=[];return e.forEach(i=>{var p;const o=Q(this,Vf).defaultQueryOptions(i),f=((p=n.get(o.queryHash))==null?void 0:p.shift())??new rh(Q(this,Vf),o);s.push({defaultedQueryOptions:o,observer:f})}),s},sb=function(e,n){const s=Q(this,ni).indexOf(e);s!==-1&&(Ae(this,Nr,v9(Q(this,Nr),s,n)),We(this,ss,rb).call(this))},rb=function(){var e;if(this.hasListeners()){const n=Q(this,jc),s=We(this,ss,tb).call(this,Q(this,Nr),Q(this,Qm)),i=We(this,ss,nb).call(this,s,(e=Q(this,Kf))==null?void 0:e.combine);n!==i&&Un.batch(()=>{this.listeners.forEach(o=>{o(Q(this,Nr))})})}},x4),fl,b4,Q4=(b4=class extends $u{constructor(e={}){super();He(this,fl);this.config=e,Ae(this,fl,new Map)}build(e,n,s){const i=n.queryKey,o=n.queryHash??Kb(i,n);let d=this.get(o);return d||(d=new k4({client:e,queryKey:i,queryHash:o,options:e.defaultQueryOptions(n),state:s,defaultOptions:e.getQueryDefaults(i)}),this.add(d)),d}add(e){Q(this,fl).has(e.queryHash)||(Q(this,fl).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=Q(this,fl).get(e.queryHash);n&&(e.destroy(),n===e&&Q(this,fl).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Un.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return Q(this,fl).get(e)}getAll(){return[...Q(this,fl).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(s=>Hx(n,s))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(s=>Hx(e,s)):n}notify(e){Un.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Un.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Un.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},fl=new WeakMap,b4),ia,wc,Ec,Xf,Ff,Tc,Zf,If,v4,K4=(v4=class{constructor(t={}){He(this,ia);He(this,wc);He(this,Ec);He(this,Xf);He(this,Ff);He(this,Tc);He(this,Zf);He(this,If);Ae(this,ia,t.queryCache||new Q4),Ae(this,wc,t.mutationCache||new P4),Ae(this,Ec,t.defaultOptions||{}),Ae(this,Xf,new Map),Ae(this,Ff,new Map),Ae(this,Tc,0)}mount(){q0(this,Tc)._++,Q(this,Tc)===1&&(Ae(this,Zf,U1.subscribe(async t=>{t&&(await this.resumePausedMutations(),Q(this,ia).onFocus())})),Ae(this,If,jm.subscribe(async t=>{t&&(await this.resumePausedMutations(),Q(this,ia).onOnline())})))}unmount(){var t,e;q0(this,Tc)._--,Q(this,Tc)===0&&((t=Q(this,Zf))==null||t.call(this),Ae(this,Zf,void 0),(e=Q(this,If))==null||e.call(this),Ae(this,If,void 0))}isFetching(t){return Q(this,ia).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return Q(this,wc).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=Q(this,ia).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=Q(this,ia).build(this,e),s=n.state.data;return s===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Oc(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(s))}getQueriesData(t){return Q(this,ia).findAll(t).map(({queryKey:e,state:n})=>{const s=n.data;return[e,s]})}setQueryData(t,e,n){const s=this.defaultQueryOptions({queryKey:t}),i=Q(this,ia).get(s.queryHash),o=i==null?void 0:i.state.data,d=n9(e,o);if(d!==void 0)return Q(this,ia).build(this,s).setData(d,{...n,manual:!0})}setQueriesData(t,e,n){return Un.batch(()=>Q(this,ia).findAll(t).map(({queryKey:s})=>[s,this.setQueryData(s,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=Q(this,ia).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=Q(this,ia);Un.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=Q(this,ia);return Un.batch(()=>(n.findAll(t).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},s=Un.batch(()=>Q(this,ia).findAll(t).map(i=>i.cancel(n)));return Promise.all(s).then(ma).catch(ma)}invalidateQueries(t,e={}){return Un.batch(()=>(Q(this,ia).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},s=Un.batch(()=>Q(this,ia).findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(ma)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(s).then(ma)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=Q(this,ia).build(this,e);return n.isStaleByTime(Oc(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(ma).catch(ma)}fetchInfiniteQuery(t){return t.behavior=v1(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(ma).catch(ma)}ensureInfiniteQueryData(t){return t.behavior=v1(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return jm.isOnline()?Q(this,wc).resumePausedMutations():Promise.resolve()}getQueryCache(){return Q(this,ia)}getMutationCache(){return Q(this,wc)}getDefaultOptions(){return Q(this,Ec)}setDefaultOptions(t){Ae(this,Ec,t)}setQueryDefaults(t,e){Q(this,Xf).set(Ac(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...Q(this,Xf).values()],n={};return e.forEach(s=>{Jf(t,s.queryKey)&&Object.assign(n,s.defaultOptions)}),n}setMutationDefaults(t,e){Q(this,Ff).set(Ac(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...Q(this,Ff).values()],n={};return e.forEach(s=>{Jf(t,s.mutationKey)&&Object.assign(n,s.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...Q(this,Ec).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Kb(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===q1&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...Q(this,Ec).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){Q(this,ia).clear(),Q(this,wc).clear()}},ia=new WeakMap,wc=new WeakMap,Ec=new WeakMap,Xf=new WeakMap,Ff=new WeakMap,Tc=new WeakMap,Zf=new WeakMap,If=new WeakMap,v4);function S9({streamFn:t,refetchMode:e="reset",reducer:n=(i,o)=>j4(i,o),initialValue:s=[]}){return async i=>{const o=i.client.getQueryCache().find({queryKey:i.queryKey,exact:!0}),d=!!o&&o.isFetched();d&&e==="reset"&&o.setState({...o.resetState,fetchStatus:"fetching"});let f=s,p=!1;const y=E4({client:i.client,meta:i.meta,queryKey:i.queryKey,pageParam:i.pageParam,direction:i.direction},()=>i.signal,()=>p=!0),S=await t(y),b=d&&e==="replace";for await(const _ of S){if(p)break;b?f=n(f,_):i.client.setQueryData(i.queryKey,j=>n(j===void 0?s:j,_))}return b&&!p&&i.client.setQueryData(i.queryKey,f),i.client.getQueryData(i.queryKey)??s}}var N9=Symbol("dataTagSymbol"),_9=Symbol("dataTagErrorSymbol"),C9=Symbol("unsetMarker"),Zb=D.createContext(void 0),ga=t=>{const e=D.useContext(Zb);if(t)return t;if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},X4=({client:t,children:e})=>(D.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),h.jsx(Zb.Provider,{value:t,children:e})),F4=D.createContext(!1),Ib=()=>D.useContext(F4),j9=F4.Provider;function Z4(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var I4=D.createContext(Z4()),Jb=()=>D.useContext(I4),w9=({children:t})=>{const[e]=D.useState(()=>Z4());return h.jsx(I4.Provider,{value:e,children:typeof t=="function"?t(e):t})},J4=(t,e,n)=>{const s=n!=null&&n.state.error&&typeof t.throwOnError=="function"?H1(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||s)&&(e.isReset()||(t.retryOnMount=!1))},W4=t=>{D.useEffect(()=>{t.clearReset()},[t])},$4=({result:t,errorResetBoundary:e,throwOnError:n,query:s,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&s&&(i&&t.data===void 0||H1(n,[t.error,s])),Wb=(t,e)=>e.state.data===void 0,eS=t=>{if(t.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),s=t.staleTime;t.staleTime=typeof s=="function"?(...i)=>n(s(...i)):n(s),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},E9=(t,e)=>t.isLoading&&t.isFetching&&!e,ib=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,lb=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function tS({queries:t,...e},n){const s=ga(n),i=Ib(),o=Jb(),d=D.useMemo(()=>t.map(T=>{const O=s.defaultQueryOptions(T);return O._optimisticResults=i?"isRestoring":"optimistic",O}),[t,s,i]);d.forEach(T=>{eS(T);const O=s.getQueryCache().get(T.queryHash);J4(T,o,O)}),W4(o);const[f]=D.useState(()=>new V4(s,d,e)),[p,y,S]=f.getOptimisticResult(d,e.combine),b=!i&&e.subscribed!==!1;D.useSyncExternalStore(D.useCallback(T=>b?f.subscribe(Un.batchCalls(T)):ma,[f,b]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),D.useEffect(()=>{f.setQueries(d,e)},[d,e,f]);const j=p.some((T,O)=>ib(d[O],T))?p.flatMap((T,O)=>{const R=d[O];if(R&&ib(R,T)){const M=new rh(s,R);return lb(R,M,o)}return[]}):[];if(j.length>0)throw Promise.all(j);const w=p.find((T,O)=>{const R=d[O];return R&&$4({result:T,errorResetBoundary:o,throwOnError:R.throwOnError,query:s.getQueryCache().get(R.queryHash),suspense:R.suspense})});if(w!=null&&w.error)throw w.error;return y(S())}function B1(t,e,n){var _,j,w,T;const s=Ib(),i=Jb(),o=ga(n),d=o.defaultQueryOptions(t);(j=(_=o.getDefaultOptions().queries)==null?void 0:_._experimental_beforeQuery)==null||j.call(_,d);const f=o.getQueryCache().get(d.queryHash);d._optimisticResults=s?"isRestoring":"optimistic",eS(d),J4(d,i,f),W4(i);const p=!o.getQueryCache().get(d.queryHash),[y]=D.useState(()=>new e(o,d)),S=y.getOptimisticResult(d),b=!s&&t.subscribed!==!1;if(D.useSyncExternalStore(D.useCallback(O=>{const R=b?y.subscribe(Un.batchCalls(O)):ma;return y.updateResult(),R},[y,b]),()=>y.getCurrentResult(),()=>y.getCurrentResult()),D.useEffect(()=>{y.setOptions(d)},[d,y]),ib(d,S))throw lb(d,y,i);if($4({result:S,errorResetBoundary:i,throwOnError:d.throwOnError,query:f,suspense:d.suspense}))throw S.error;if((T=(w=o.getDefaultOptions().queries)==null?void 0:w._experimental_afterQuery)==null||T.call(w,d,S),d.experimental_prefetchInRender&&!Wf.isServer()&&E9(S,s)){const O=p?lb(d,y,i):f==null?void 0:f.promise;O==null||O.catch(ma).finally(()=>{y.updateResult()})}return d.notifyOnChangeProps?S:y.trackResult(S)}function dt(t,e){return B1(t,rh,e)}function T9(t,e){return B1({...t,enabled:!0,suspense:!0,throwOnError:Wb,placeholderData:void 0},rh,e)}function R9(t,e){return B1({...t,enabled:!0,suspense:!0,throwOnError:Wb},Fb,e)}function O9(t,e){return tS({...t,queries:t.queries.map(n=>({...n,suspense:!0,throwOnError:Wb,enabled:!0,placeholderData:void 0}))},e)}function M9(t,e){const n=ga(e);n.getQueryState(t.queryKey)||n.prefetchQuery(t)}function A9(t,e){const n=ga(e);n.getQueryState(t.queryKey)||n.prefetchInfiniteQuery(t)}function D9(t){return t}function z9(t){return t}var k9=({children:t,options:e={},state:n,queryClient:s})=>{const i=ga(s),o=D.useRef(e);D.useEffect(()=>{o.current=e});const d=D.useMemo(()=>{if(n){if(typeof n!="object")return;const f=i.getQueryCache(),p=n.queries||[],y=[],S=[];for(const b of p){const _=f.get(b.queryHash);_?(b.state.dataUpdatedAt>_.state.dataUpdatedAt||b.promise&&_.state.status!=="pending"&&_.state.fetchStatus!=="fetching"&&b.dehydratedAt!==void 0&&b.dehydratedAt>_.state.dataUpdatedAt)&&S.push(b):y.push(b)}if(y.length>0&&Vx(i,{queries:y},o.current),S.length>0)return S}},[i,n]);return D.useEffect(()=>{d&&Vx(i,{queries:d},o.current)},[i,d]),t};function L9(t,e){const n=ga(e),s=n.getQueryCache();return D.useSyncExternalStore(D.useCallback(i=>s.subscribe(Un.batchCalls(i)),[s]),()=>n.isFetching(t),()=>n.isFetching(t))}function U9(t,e){const n=ga(e);return nS({filters:{...t,status:"pending"}},n).length}function H2(t,e){return t.findAll(e.filters).map(n=>e.select?e.select(n):n.state)}function nS(t={},e){const n=ga(e).getMutationCache(),s=D.useRef(t),i=D.useRef(null);return i.current===null&&(i.current=H2(n,t)),D.useEffect(()=>{s.current=t}),D.useSyncExternalStore(D.useCallback(o=>n.subscribe(()=>{const d=Km(i.current,H2(n,s.current));i.current!==d&&(i.current=d,Un.schedule(o))}),[n]),()=>i.current,()=>i.current)}function jn(t,e){const n=ga(e),[s]=D.useState(()=>new Y4(n,t));D.useEffect(()=>{s.setOptions(t)},[s,t]);const i=D.useSyncExternalStore(D.useCallback(d=>s.subscribe(Un.batchCalls(d)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),o=D.useCallback((d,f)=>{s.mutate(d,f).catch(ma)},[s]);if(i.error&&H1(s.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}function q9(t){return t}function H9(t,e){return B1(t,Fb,e)}const B9=Object.freeze(Object.defineProperty({__proto__:null,CancelledError:wm,HydrationBoundary:k9,InfiniteQueryObserver:Fb,IsRestoringProvider:j9,Mutation:B4,MutationCache:P4,MutationObserver:Y4,QueriesObserver:V4,Query:k4,QueryCache:Q4,QueryClient:K4,QueryClientContext:Zb,QueryClientProvider:X4,QueryErrorResetBoundary:w9,QueryObserver:rh,dataTagErrorSymbol:_9,dataTagSymbol:N9,defaultScheduler:M4,defaultShouldDehydrateMutation:R4,defaultShouldDehydrateQuery:O4,dehydrate:d9,environmentManager:Wf,experimental_streamedQuery:S9,focusManager:U1,hashKey:Ac,hydrate:Vx,infiniteQueryOptions:z9,isCancelledError:m9,isServer:_4,keepPreviousData:r9,matchMutation:Bx,matchQuery:Hx,mutationOptions:q9,noop:ma,notifyManager:Un,onlineManager:jm,partialMatchKey:Jf,queryOptions:D9,replaceEqualDeep:Km,shouldThrowError:H1,skipToken:q1,timeoutManager:Rc,unsetMarker:C9,useInfiniteQuery:H9,useIsFetching:L9,useIsMutating:U9,useIsRestoring:Ib,useMutation:jn,useMutationState:nS,usePrefetchInfiniteQuery:A9,usePrefetchQuery:M9,useQueries:tS,useQuery:dt,useQueryClient:ga,useQueryErrorResetBoundary:Jb,useSuspenseInfiniteQuery:R9,useSuspenseQueries:O9,useSuspenseQuery:T9},Symbol.toStringTag,{value:"Module"}));function G9(){window.__camstack={React:$t,ReactDOM:N4,ReactQuery:B9}}/**
|
|
50
|
-
* react-router v7.13.1
|
|
51
|
-
*
|
|
52
|
-
* Copyright (c) Remix Software Inc.
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the MIT license found in the
|
|
55
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
-
*
|
|
57
|
-
* @license MIT
|
|
58
|
-
*/var B2="popstate";function G2(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function P9(t={}){function e(s,i){var y;let o=(y=i.state)==null?void 0:y.masked,{pathname:d,search:f,hash:p}=o||s.location;return ob("",{pathname:d,search:f,hash:p},i.state&&i.state.usr||null,i.state&&i.state.key||"default",o?{pathname:s.location.pathname,search:s.location.search,hash:s.location.hash}:void 0)}function n(s,i){return typeof i=="string"?i:Em(i)}return V9(e,n,null,t)}function Vn(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Ei(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function Y9(){return Math.random().toString(36).substring(2,10)}function P2(t,e){return{usr:t.state,key:t.key,idx:e,masked:t.unstable_mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function ob(t,e,n=null,s,i){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?ih(e):e,state:n,key:e&&e.key||s||Y9(),unstable_mask:i}}function Em({pathname:t="/",search:e="",hash:n=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function ih(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substring(n),t=t.substring(0,n));let s=t.indexOf("?");s>=0&&(e.search=t.substring(s),t=t.substring(0,s)),t&&(e.pathname=t)}return e}function V9(t,e,n,s={}){let{window:i=document.defaultView,v5Compat:o=!1}=s,d=i.history,f="POP",p=null,y=S();y==null&&(y=0,d.replaceState({...d.state,idx:y},""));function S(){return(d.state||{idx:null}).idx}function b(){f="POP";let O=S(),R=O==null?null:O-y;y=O,p&&p({action:f,location:T.location,delta:R})}function _(O,R){f="PUSH";let M=G2(O)?O:ob(T.location,O,R);y=S()+1;let z=P2(M,y),k=T.createHref(M.unstable_mask||M);try{d.pushState(z,"",k)}catch(G){if(G instanceof DOMException&&G.name==="DataCloneError")throw G;i.location.assign(k)}o&&p&&p({action:f,location:T.location,delta:1})}function j(O,R){f="REPLACE";let M=G2(O)?O:ob(T.location,O,R);y=S();let z=P2(M,y),k=T.createHref(M.unstable_mask||M);d.replaceState(z,"",k),o&&p&&p({action:f,location:T.location,delta:0})}function w(O){return Q9(O)}let T={get action(){return f},get location(){return t(i,d)},listen(O){if(p)throw new Error("A history only accepts one active listener");return i.addEventListener(B2,b),p=O,()=>{i.removeEventListener(B2,b),p=null}},createHref(O){return e(i,O)},createURL:w,encodeLocation(O){let R=w(O);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:_,replace:j,go(O){return d.go(O)}};return T}function Q9(t,e=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Vn(n,"No window.location.(origin|href) available to create URL");let s=typeof t=="string"?t:Em(t);return s=s.replace(/ $/,"%20"),!e&&s.startsWith("//")&&(s=n+s),new URL(s,n)}function aS(t,e,n="/"){return K9(t,e,n,!1)}function K9(t,e,n,s){let i=typeof e=="string"?ih(e):e,o=ho(i.pathname||"/",n);if(o==null)return null;let d=sS(t);X9(d);let f=null;for(let p=0;f==null&&p<d.length;++p){let y=sN(o);f=nN(d[p],y,s)}return f}function sS(t,e=[],n=[],s="",i=!1){let o=(d,f,p=i,y)=>{let S={relativePath:y===void 0?d.path||"":y,caseSensitive:d.caseSensitive===!0,childrenIndex:f,route:d};if(S.relativePath.startsWith("/")){if(!S.relativePath.startsWith(s)&&p)return;Vn(S.relativePath.startsWith(s),`Absolute route path "${S.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),S.relativePath=S.relativePath.slice(s.length)}let b=pl([s,S.relativePath]),_=n.concat(S);d.children&&d.children.length>0&&(Vn(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),sS(d.children,e,_,b,p)),!(d.path==null&&!d.index)&&e.push({path:b,score:eN(b,d.index),routesMeta:_})};return t.forEach((d,f)=>{var p;if(d.path===""||!((p=d.path)!=null&&p.includes("?")))o(d,f);else for(let y of rS(d.path))o(d,f,!0,y)}),e}function rS(t){let e=t.split("/");if(e.length===0)return[];let[n,...s]=e,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(s.length===0)return i?[o,""]:[o];let d=rS(s.join("/")),f=[];return f.push(...d.map(p=>p===""?o:[o,p].join("/"))),i&&f.push(...d),f.map(p=>t.startsWith("/")&&p===""?"/":p)}function X9(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:tN(e.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}var F9=/^:[\w-]+$/,Z9=3,I9=2,J9=1,W9=10,$9=-2,Y2=t=>t==="*";function eN(t,e){let n=t.split("/"),s=n.length;return n.some(Y2)&&(s+=$9),e&&(s+=I9),n.filter(i=>!Y2(i)).reduce((i,o)=>i+(F9.test(o)?Z9:o===""?J9:W9),s)}function tN(t,e){return t.length===e.length&&t.slice(0,-1).every((s,i)=>s===e[i])?t[t.length-1]-e[e.length-1]:0}function nN(t,e,n=!1){let{routesMeta:s}=t,i={},o="/",d=[];for(let f=0;f<s.length;++f){let p=s[f],y=f===s.length-1,S=o==="/"?e:e.slice(o.length)||"/",b=S1({path:p.relativePath,caseSensitive:p.caseSensitive,end:y},S),_=p.route;if(!b&&y&&n&&!s[s.length-1].route.index&&(b=S1({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},S)),!b)return null;Object.assign(i,b.params),d.push({params:i,pathname:pl([o,b.pathname]),pathnameBase:oN(pl([o,b.pathnameBase])),route:_}),b.pathnameBase!=="/"&&(o=pl([o,b.pathnameBase]))}return d}function S1(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,s]=aN(t.path,t.caseSensitive,t.end),i=e.match(n);if(!i)return null;let o=i[0],d=o.replace(/(.)\/+$/,"$1"),f=i.slice(1);return{params:s.reduce((y,{paramName:S,isOptional:b},_)=>{if(S==="*"){let w=f[_]||"";d=o.slice(0,o.length-w.length).replace(/(.)\/+$/,"$1")}const j=f[_];return b&&!j?y[S]=void 0:y[S]=(j||"").replace(/%2F/g,"/"),y},{}),pathname:o,pathnameBase:d,pattern:t}}function aN(t,e=!1,n=!0){Ei(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let s=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,f,p,y,S)=>{if(s.push({paramName:f,isOptional:p!=null}),p){let b=S.charAt(y+d.length);return b&&b!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(s.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),s]}function sN(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Ei(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),t}}function ho(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,s=t.charAt(n);return s&&s!=="/"?null:t.slice(n)||"/"}var rN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function iN(t,e="/"){let{pathname:n,search:s="",hash:i=""}=typeof t=="string"?ih(t):t,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=V2(n.substring(1),"/"):o=V2(n,e)):o=e,{pathname:o,search:cN(s),hash:uN(i)}}function V2(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Wy(t,e,n,s){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function lN(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function $b(t){let e=lN(t);return e.map((n,s)=>s===e.length-1?n.pathname:n.pathnameBase)}function G1(t,e,n,s=!1){let i;typeof t=="string"?i=ih(t):(i={...t},Vn(!i.pathname||!i.pathname.includes("?"),Wy("?","pathname","search",i)),Vn(!i.pathname||!i.pathname.includes("#"),Wy("#","pathname","hash",i)),Vn(!i.search||!i.search.includes("#"),Wy("#","search","hash",i)));let o=t===""||i.pathname==="",d=o?"/":i.pathname,f;if(d==null)f=n;else{let b=e.length-1;if(!s&&d.startsWith("..")){let _=d.split("/");for(;_[0]==="..";)_.shift(),b-=1;i.pathname=_.join("/")}f=b>=0?e[b]:"/"}let p=iN(i,f),y=d&&d!=="/"&&d.endsWith("/"),S=(o||d===".")&&n.endsWith("/");return!p.pathname.endsWith("/")&&(y||S)&&(p.pathname+="/"),p}var pl=t=>t.join("/").replace(/\/\/+/g,"/"),oN=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),cN=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,uN=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,dN=class{constructor(t,e,n,s=!1){this.status=t,this.statusText=e||"",this.internal=s,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function fN(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function hN(t){return t.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var iS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function lS(t,e){let n=t;if(typeof n!="string"||!rN.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let s=n,i=!1;if(iS)try{let o=new URL(window.location.href),d=n.startsWith("//")?new URL(o.protocol+n):new URL(n),f=ho(d.pathname,e);d.origin===o.origin&&f!=null?n=f+d.search+d.hash:i=!0}catch{Ei(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var oS=["POST","PUT","PATCH","DELETE"];new Set(oS);var pN=["GET",...oS];new Set(pN);var lh=D.createContext(null);lh.displayName="DataRouter";var P1=D.createContext(null);P1.displayName="DataRouterState";var mN=D.createContext(!1),cS=D.createContext({isTransitioning:!1});cS.displayName="ViewTransition";var gN=D.createContext(new Map);gN.displayName="Fetchers";var yN=D.createContext(null);yN.displayName="Await";var wr=D.createContext(null);wr.displayName="Navigation";var Xm=D.createContext(null);Xm.displayName="Location";var ii=D.createContext({outlet:null,matches:[],isDataRoute:!1});ii.displayName="Route";var ev=D.createContext(null);ev.displayName="RouteError";var uS="REACT_ROUTER_ERROR",xN="REDIRECT",bN="ROUTE_ERROR_RESPONSE";function vN(t){if(t.startsWith(`${uS}:${xN}:{`))try{let e=JSON.parse(t.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="string"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function SN(t){if(t.startsWith(`${uS}:${bN}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new dN(e.status,e.statusText,e.data)}catch{}}function NN(t,{relative:e}={}){Vn(oh(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:s}=D.useContext(wr),{hash:i,pathname:o,search:d}=Fm(t,{relative:e}),f=o;return n!=="/"&&(f=o==="/"?n:pl([n,o])),s.createHref({pathname:f,search:d,hash:i})}function oh(){return D.useContext(Xm)!=null}function yl(){return Vn(oh(),"useLocation() may be used only in the context of a <Router> component."),D.useContext(Xm).location}var dS="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function fS(t){D.useContext(wr).static||D.useLayoutEffect(t)}function xl(){let{isDataRoute:t}=D.useContext(ii);return t?UN():_N()}function _N(){Vn(oh(),"useNavigate() may be used only in the context of a <Router> component.");let t=D.useContext(lh),{basename:e,navigator:n}=D.useContext(wr),{matches:s}=D.useContext(ii),{pathname:i}=yl(),o=JSON.stringify($b(s)),d=D.useRef(!1);return fS(()=>{d.current=!0}),D.useCallback((p,y={})=>{if(Ei(d.current,dS),!d.current)return;if(typeof p=="number"){n.go(p);return}let S=G1(p,JSON.parse(o),i,y.relative==="path");t==null&&e!=="/"&&(S.pathname=S.pathname==="/"?e:pl([e,S.pathname])),(y.replace?n.replace:n.push)(S,y.state,y)},[e,n,o,i,t])}var CN=D.createContext(null);function jN(t){let e=D.useContext(ii).outlet;return D.useMemo(()=>e&&D.createElement(CN.Provider,{value:t},e),[e,t])}function tv(){let{matches:t}=D.useContext(ii),e=t[t.length-1];return e?e.params:{}}function Fm(t,{relative:e}={}){let{matches:n}=D.useContext(ii),{pathname:s}=yl(),i=JSON.stringify($b(n));return D.useMemo(()=>G1(t,JSON.parse(i),s,e==="path"),[t,i,s,e])}function wN(t,e){return hS(t,e)}function hS(t,e,n){var O;Vn(oh(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=D.useContext(wr),{matches:i}=D.useContext(ii),o=i[i.length-1],d=o?o.params:{},f=o?o.pathname:"/",p=o?o.pathnameBase:"/",y=o&&o.route;{let R=y&&y.path||"";mS(f,!y||R.endsWith("*")||R.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${R}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
59
|
-
|
|
60
|
-
Please change the parent <Route path="${R}"> to <Route path="${R==="/"?"*":`${R}/*`}">.`)}let S=yl(),b;if(e){let R=typeof e=="string"?ih(e):e;Vn(p==="/"||((O=R.pathname)==null?void 0:O.startsWith(p)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${R.pathname}" was given in the \`location\` prop.`),b=R}else b=S;let _=b.pathname||"/",j=_;if(p!=="/"){let R=p.replace(/^\//,"").split("/");j="/"+_.replace(/^\//,"").split("/").slice(R.length).join("/")}let w=aS(t,{pathname:j});Ei(y||w!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Ei(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let T=MN(w&&w.map(R=>Object.assign({},R,{params:Object.assign({},d,R.params),pathname:pl([p,s.encodeLocation?s.encodeLocation(R.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?p:pl([p,s.encodeLocation?s.encodeLocation(R.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),i,n);return e&&T?D.createElement(Xm.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...b},navigationType:"POP"}},T):T}function EN(){let t=LN(),e=fN(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,s="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:s},o={padding:"2px 4px",backgroundColor:s},d=null;return console.error("Error handled by React Router default ErrorBoundary:",t),d=D.createElement(D.Fragment,null,D.createElement("p",null,"💿 Hey developer 👋"),D.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",D.createElement("code",{style:o},"ErrorBoundary")," or"," ",D.createElement("code",{style:o},"errorElement")," prop on your route.")),D.createElement(D.Fragment,null,D.createElement("h2",null,"Unexpected Application Error!"),D.createElement("h3",{style:{fontStyle:"italic"}},e),n?D.createElement("pre",{style:i},n):null,d)}var TN=D.createElement(EN,null),pS=class extends D.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.onError?this.props.onError(t,e):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const n=SN(t.digest);n&&(t=n)}let e=t!==void 0?D.createElement(ii.Provider,{value:this.props.routeContext},D.createElement(ev.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?D.createElement(RN,{error:t},e):e}};pS.contextType=mN;var $y=new WeakMap;function RN({children:t,error:e}){let{basename:n}=D.useContext(wr);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let s=vN(e.digest);if(s){let i=$y.get(e);if(i)throw i;let o=lS(s.location,n);if(iS&&!$y.get(e))if(o.isExternal||s.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:s.replace}));throw $y.set(e,d),d}return D.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return t}function ON({routeContext:t,match:e,children:n}){let s=D.useContext(lh);return s&&s.static&&s.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=e.route.id),D.createElement(ii.Provider,{value:t},n)}function MN(t,e=[],n){let s=n==null?void 0:n.state;if(t==null){if(!s)return null;if(s.errors)t=s.matches;else if(e.length===0&&!s.initialized&&s.matches.length>0)t=s.matches;else return null}let i=t,o=s==null?void 0:s.errors;if(o!=null){let S=i.findIndex(b=>b.route.id&&(o==null?void 0:o[b.route.id])!==void 0);Vn(S>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),i=i.slice(0,Math.min(i.length,S+1))}let d=!1,f=-1;if(n&&s){d=s.renderFallback;for(let S=0;S<i.length;S++){let b=i[S];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(f=S),b.route.id){let{loaderData:_,errors:j}=s,w=b.route.loader&&!_.hasOwnProperty(b.route.id)&&(!j||j[b.route.id]===void 0);if(b.route.lazy||w){n.isStatic&&(d=!0),f>=0?i=i.slice(0,f+1):i=[i[0]];break}}}}let p=n==null?void 0:n.onError,y=s&&p?(S,b)=>{var _,j;p(S,{location:s.location,params:((j=(_=s.matches)==null?void 0:_[0])==null?void 0:j.params)??{},unstable_pattern:hN(s.matches),errorInfo:b})}:void 0;return i.reduceRight((S,b,_)=>{let j,w=!1,T=null,O=null;s&&(j=o&&b.route.id?o[b.route.id]:void 0,T=b.route.errorElement||TN,d&&(f<0&&_===0?(mS("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,O=null):f===_&&(w=!0,O=b.route.hydrateFallbackElement||null)));let R=e.concat(i.slice(0,_+1)),M=()=>{let z;return j?z=T:w?z=O:b.route.Component?z=D.createElement(b.route.Component,null):b.route.element?z=b.route.element:z=S,D.createElement(ON,{match:b,routeContext:{outlet:S,matches:R,isDataRoute:s!=null},children:z})};return s&&(b.route.ErrorBoundary||b.route.errorElement||_===0)?D.createElement(pS,{location:s.location,revalidation:s.revalidation,component:T,error:j,children:M(),routeContext:{outlet:null,matches:R,isDataRoute:!0},onError:y}):M()},null)}function nv(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function AN(t){let e=D.useContext(lh);return Vn(e,nv(t)),e}function DN(t){let e=D.useContext(P1);return Vn(e,nv(t)),e}function zN(t){let e=D.useContext(ii);return Vn(e,nv(t)),e}function av(t){let e=zN(t),n=e.matches[e.matches.length-1];return Vn(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function kN(){return av("useRouteId")}function LN(){var s;let t=D.useContext(ev),e=DN("useRouteError"),n=av("useRouteError");return t!==void 0?t:(s=e.errors)==null?void 0:s[n]}function UN(){let{router:t}=AN("useNavigate"),e=av("useNavigate"),n=D.useRef(!1);return fS(()=>{n.current=!0}),D.useCallback(async(i,o={})=>{Ei(n.current,dS),n.current&&(typeof i=="number"?await t.navigate(i):await t.navigate(i,{fromRouteId:e,...o}))},[t,e])}var Q2={};function mS(t,e,n){!e&&!Q2[t]&&(Q2[t]=!0,Ei(!1,n))}D.memo(qN);function qN({routes:t,future:e,state:n,isStatic:s,onError:i}){return hS(t,void 0,{state:n,isStatic:s,onError:i})}function cb({to:t,replace:e,state:n,relative:s}){Vn(oh(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=D.useContext(wr);Ei(!i,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=D.useContext(ii),{pathname:d}=yl(),f=xl(),p=G1(t,$b(o),d,s==="path"),y=JSON.stringify(p);return D.useEffect(()=>{f(JSON.parse(y),{replace:e,state:n,relative:s})},[f,y,s,e,n]),null}function HN(t){return jN(t.context)}function La(t){Vn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function BN({basename:t="/",children:e=null,location:n,navigationType:s="POP",navigator:i,static:o=!1,unstable_useTransitions:d}){Vn(!oh(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=t.replace(/^\/*/,"/"),p=D.useMemo(()=>({basename:f,navigator:i,static:o,unstable_useTransitions:d,future:{}}),[f,i,o,d]);typeof n=="string"&&(n=ih(n));let{pathname:y="/",search:S="",hash:b="",state:_=null,key:j="default",unstable_mask:w}=n,T=D.useMemo(()=>{let O=ho(y,f);return O==null?null:{location:{pathname:O,search:S,hash:b,state:_,key:j,unstable_mask:w},navigationType:s}},[f,y,S,b,_,j,s,w]);return Ei(T!=null,`<Router basename="${f}"> is not able to match the URL "${y}${S}${b}" because it does not start with the basename, so the <Router> won't render anything.`),T==null?null:D.createElement(wr.Provider,{value:p},D.createElement(Xm.Provider,{children:e,value:T}))}function GN({children:t,location:e}){return wN(ub(t),e)}function ub(t,e=[]){let n=[];return D.Children.forEach(t,(s,i)=>{if(!D.isValidElement(s))return;let o=[...e,i];if(s.type===D.Fragment){n.push.apply(n,ub(s.props.children,o));return}Vn(s.type===La,`[${typeof s.type=="string"?s.type:s.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Vn(!s.props.index||!s.props.children,"An index route cannot have child routes.");let d={id:s.props.id||o.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,middleware:s.props.middleware,loader:s.props.loader,action:s.props.action,hydrateFallbackElement:s.props.hydrateFallbackElement,HydrateFallback:s.props.HydrateFallback,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.hasErrorBoundary===!0||s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(d.children=ub(s.props.children,o)),n.push(d)}),n}var h1="get",p1="application/x-www-form-urlencoded";function Y1(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function PN(t){return Y1(t)&&t.tagName.toLowerCase()==="button"}function YN(t){return Y1(t)&&t.tagName.toLowerCase()==="form"}function VN(t){return Y1(t)&&t.tagName.toLowerCase()==="input"}function QN(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function KN(t,e){return t.button===0&&(!e||e==="_self")&&!QN(t)}var B0=null;function XN(){if(B0===null)try{new FormData(document.createElement("form"),0),B0=!1}catch{B0=!0}return B0}var FN=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ex(t){return t!=null&&!FN.has(t)?(Ei(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${p1}"`),null):t}function ZN(t,e){let n,s,i,o,d;if(YN(t)){let f=t.getAttribute("action");s=f?ho(f,e):null,n=t.getAttribute("method")||h1,i=ex(t.getAttribute("enctype"))||p1,o=new FormData(t)}else if(PN(t)||VN(t)&&(t.type==="submit"||t.type==="image")){let f=t.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=t.getAttribute("formaction")||f.getAttribute("action");if(s=p?ho(p,e):null,n=t.getAttribute("formmethod")||f.getAttribute("method")||h1,i=ex(t.getAttribute("formenctype"))||ex(f.getAttribute("enctype"))||p1,o=new FormData(f,t),!XN()){let{name:y,type:S,value:b}=t;if(S==="image"){let _=y?`${y}.`:"";o.append(`${_}x`,"0"),o.append(`${_}y`,"0")}else y&&o.append(y,b)}}else{if(Y1(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=h1,s=null,i=p1,d=t}return o&&i==="text/plain"&&(d=o,o=void 0),{action:s,method:n.toLowerCase(),encType:i,formData:o,body:d}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function sv(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function IN(t,e,n,s){let i=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return n?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${s}`:i.pathname=`${i.pathname}.${s}`:i.pathname==="/"?i.pathname=`_root.${s}`:e&&ho(i.pathname,e)==="/"?i.pathname=`${e.replace(/\/$/,"")}/_root.${s}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${s}`,i}async function JN(t,e){if(t.id in e)return e[t.id];try{let n=await import(t.module);return e[t.id]=n,n}catch(n){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function WN(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function $N(t,e,n){let s=await Promise.all(t.map(async i=>{let o=e.routes[i.route.id];if(o){let d=await JN(o,n);return d.links?d.links():[]}return[]}));return a_(s.flat(1).filter(WN).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function K2(t,e,n,s,i,o){let d=(p,y)=>n[y]?p.route.id!==n[y].route.id:!0,f=(p,y)=>{var S;return n[y].pathname!==p.pathname||((S=n[y].route.path)==null?void 0:S.endsWith("*"))&&n[y].params["*"]!==p.params["*"]};return o==="assets"?e.filter((p,y)=>d(p,y)||f(p,y)):o==="data"?e.filter((p,y)=>{var b;let S=s.routes[p.route.id];if(!S||!S.hasLoader)return!1;if(d(p,y)||f(p,y))return!0;if(p.route.shouldRevalidate){let _=p.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((b=n[0])==null?void 0:b.params)||{},nextUrl:new URL(t,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof _=="boolean")return _}return!0}):[]}function e_(t,e,{includeHydrateFallback:n}={}){return t_(t.map(s=>{let i=e.routes[s.route.id];if(!i)return[];let o=[i.module];return i.clientActionModule&&(o=o.concat(i.clientActionModule)),i.clientLoaderModule&&(o=o.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(o=o.concat(i.hydrateFallbackModule)),i.imports&&(o=o.concat(i.imports)),o}).flat(1))}function t_(t){return[...new Set(t)]}function n_(t){let e={},n=Object.keys(t).sort();for(let s of n)e[s]=t[s];return e}function a_(t,e){let n=new Set;return new Set(e),t.reduce((s,i)=>{let o=JSON.stringify(n_(i));return n.has(o)||(n.add(o),s.push({key:o,link:i})),s},[])}function gS(){let t=D.useContext(lh);return sv(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function s_(){let t=D.useContext(P1);return sv(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var rv=D.createContext(void 0);rv.displayName="FrameworkContext";function yS(){let t=D.useContext(rv);return sv(t,"You must render this element inside a <HydratedRouter> element"),t}function r_(t,e){let n=D.useContext(rv),[s,i]=D.useState(!1),[o,d]=D.useState(!1),{onFocus:f,onBlur:p,onMouseEnter:y,onMouseLeave:S,onTouchStart:b}=e,_=D.useRef(null);D.useEffect(()=>{if(t==="render"&&d(!0),t==="viewport"){let T=R=>{R.forEach(M=>{d(M.isIntersecting)})},O=new IntersectionObserver(T,{threshold:.5});return _.current&&O.observe(_.current),()=>{O.disconnect()}}},[t]),D.useEffect(()=>{if(s){let T=setTimeout(()=>{d(!0)},100);return()=>{clearTimeout(T)}}},[s]);let j=()=>{i(!0)},w=()=>{i(!1),d(!1)};return n?t!=="intent"?[o,_,{}]:[o,_,{onFocus:Kp(f,j),onBlur:Kp(p,w),onMouseEnter:Kp(y,j),onMouseLeave:Kp(S,w),onTouchStart:Kp(b,j)}]:[!1,_,{}]}function Kp(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function i_({page:t,...e}){let{router:n}=gS(),s=D.useMemo(()=>aS(n.routes,t,n.basename),[n.routes,t,n.basename]);return s?D.createElement(o_,{page:t,matches:s,...e}):null}function l_(t){let{manifest:e,routeModules:n}=yS(),[s,i]=D.useState([]);return D.useEffect(()=>{let o=!1;return $N(t,e,n).then(d=>{o||i(d)}),()=>{o=!0}},[t,e,n]),s}function o_({page:t,matches:e,...n}){let s=yl(),{future:i,manifest:o,routeModules:d}=yS(),{basename:f}=gS(),{loaderData:p,matches:y}=s_(),S=D.useMemo(()=>K2(t,e,y,o,s,"data"),[t,e,y,o,s]),b=D.useMemo(()=>K2(t,e,y,o,s,"assets"),[t,e,y,o,s]),_=D.useMemo(()=>{if(t===s.pathname+s.search+s.hash)return[];let T=new Set,O=!1;if(e.forEach(M=>{var k;let z=o.routes[M.route.id];!z||!z.hasLoader||(!S.some(G=>G.route.id===M.route.id)&&M.route.id in p&&((k=d[M.route.id])!=null&&k.shouldRevalidate)||z.hasClientLoader?O=!0:T.add(M.route.id))}),T.size===0)return[];let R=IN(t,f,i.unstable_trailingSlashAwareDataRequests,"data");return O&&T.size>0&&R.searchParams.set("_routes",e.filter(M=>T.has(M.route.id)).map(M=>M.route.id).join(",")),[R.pathname+R.search]},[f,i.unstable_trailingSlashAwareDataRequests,p,s,o,S,e,t,d]),j=D.useMemo(()=>e_(b,o),[b,o]),w=l_(b);return D.createElement(D.Fragment,null,_.map(T=>D.createElement("link",{key:T,rel:"prefetch",as:"fetch",href:T,...n})),j.map(T=>D.createElement("link",{key:T,rel:"modulepreload",href:T,...n})),w.map(({key:T,link:O})=>D.createElement("link",{key:T,nonce:n.nonce,...O,crossOrigin:O.crossOrigin??n.crossOrigin})))}function c_(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var u_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{u_&&(window.__reactRouterVersion="7.13.1")}catch{}function d_({basename:t,children:e,unstable_useTransitions:n,window:s}){let i=D.useRef();i.current==null&&(i.current=P9({window:s,v5Compat:!0}));let o=i.current,[d,f]=D.useState({action:o.action,location:o.location}),p=D.useCallback(y=>{n===!1?f(y):D.startTransition(()=>f(y))},[n]);return D.useLayoutEffect(()=>o.listen(p),[o,p]),D.createElement(BN,{basename:t,children:e,location:d.location,navigationType:d.action,navigator:o,unstable_useTransitions:n})}var xS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,iv=D.forwardRef(function({onClick:e,discover:n="render",prefetch:s="none",relative:i,reloadDocument:o,replace:d,unstable_mask:f,state:p,target:y,to:S,preventScrollReset:b,viewTransition:_,unstable_defaultShouldRevalidate:j,...w},T){let{basename:O,navigator:R,unstable_useTransitions:M}=D.useContext(wr),z=typeof S=="string"&&xS.test(S),k=lS(S,O);S=k.to;let G=NN(S,{relative:i}),P=yl(),L=null;if(f){let ce=G1(f,[],P.unstable_mask?P.unstable_mask.pathname:"/",!0);O!=="/"&&(ce.pathname=ce.pathname==="/"?O:pl([O,ce.pathname])),L=R.createHref(ce)}let[U,V,Z]=r_(s,w),re=m_(S,{replace:d,unstable_mask:f,state:p,target:y,preventScrollReset:b,relative:i,viewTransition:_,unstable_defaultShouldRevalidate:j,unstable_useTransitions:M});function ne(ce){e&&e(ce),ce.defaultPrevented||re(ce)}let W=!(k.isExternal||o),ie=D.createElement("a",{...w,...Z,href:(W?L:void 0)||k.absoluteURL||G,onClick:W?ne:e,ref:c_(T,V),target:y,"data-discover":!z&&n==="render"?"true":void 0});return U&&!z?D.createElement(D.Fragment,null,ie,D.createElement(i_,{page:G})):ie});iv.displayName="Link";var f_=D.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:s="",end:i=!1,style:o,to:d,viewTransition:f,children:p,...y},S){let b=Fm(d,{relative:y.relative}),_=yl(),j=D.useContext(P1),{navigator:w,basename:T}=D.useContext(wr),O=j!=null&&v_(b)&&f===!0,R=w.encodeLocation?w.encodeLocation(b).pathname:b.pathname,M=_.pathname,z=j&&j.navigation&&j.navigation.location?j.navigation.location.pathname:null;n||(M=M.toLowerCase(),z=z?z.toLowerCase():null,R=R.toLowerCase()),z&&T&&(z=ho(z,T)||z);const k=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let G=M===R||!i&&M.startsWith(R)&&M.charAt(k)==="/",P=z!=null&&(z===R||!i&&z.startsWith(R)&&z.charAt(R.length)==="/"),L={isActive:G,isPending:P,isTransitioning:O},U=G?e:void 0,V;typeof s=="function"?V=s(L):V=[s,G?"active":null,P?"pending":null,O?"transitioning":null].filter(Boolean).join(" ");let Z=typeof o=="function"?o(L):o;return D.createElement(iv,{...y,"aria-current":U,className:V,ref:S,style:Z,to:d,viewTransition:f},typeof p=="function"?p(L):p)});f_.displayName="NavLink";var h_=D.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:s,replace:i,state:o,method:d=h1,action:f,onSubmit:p,relative:y,preventScrollReset:S,viewTransition:b,unstable_defaultShouldRevalidate:_,...j},w)=>{let{unstable_useTransitions:T}=D.useContext(wr),O=x_(),R=b_(f,{relative:y}),M=d.toLowerCase()==="get"?"get":"post",z=typeof f=="string"&&xS.test(f),k=G=>{if(p&&p(G),G.defaultPrevented)return;G.preventDefault();let P=G.nativeEvent.submitter,L=(P==null?void 0:P.getAttribute("formmethod"))||d,U=()=>O(P||G.currentTarget,{fetcherKey:e,method:L,navigate:n,replace:i,state:o,relative:y,preventScrollReset:S,viewTransition:b,unstable_defaultShouldRevalidate:_});T&&n!==!1?D.startTransition(()=>U()):U()};return D.createElement("form",{ref:w,method:M,action:R,onSubmit:s?p:k,...j,"data-discover":!z&&t==="render"?"true":void 0})});h_.displayName="Form";function p_(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function bS(t){let e=D.useContext(lh);return Vn(e,p_(t)),e}function m_(t,{target:e,replace:n,unstable_mask:s,state:i,preventScrollReset:o,relative:d,viewTransition:f,unstable_defaultShouldRevalidate:p,unstable_useTransitions:y}={}){let S=xl(),b=yl(),_=Fm(t,{relative:d});return D.useCallback(j=>{if(KN(j,e)){j.preventDefault();let w=n!==void 0?n:Em(b)===Em(_),T=()=>S(t,{replace:w,unstable_mask:s,state:i,preventScrollReset:o,relative:d,viewTransition:f,unstable_defaultShouldRevalidate:p});y?D.startTransition(()=>T()):T()}},[b,S,_,n,s,i,e,t,o,d,f,p,y])}var g_=0,y_=()=>`__${String(++g_)}__`;function x_(){let{router:t}=bS("useSubmit"),{basename:e}=D.useContext(wr),n=kN(),s=t.fetch,i=t.navigate;return D.useCallback(async(o,d={})=>{let{action:f,method:p,encType:y,formData:S,body:b}=ZN(o,e);if(d.navigate===!1){let _=d.fetcherKey||y_();await s(_,n,d.action||f,{unstable_defaultShouldRevalidate:d.unstable_defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:S,body:b,formMethod:d.method||p,formEncType:d.encType||y,flushSync:d.flushSync})}else await i(d.action||f,{unstable_defaultShouldRevalidate:d.unstable_defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:S,body:b,formMethod:d.method||p,formEncType:d.encType||y,replace:d.replace,state:d.state,fromRouteId:n,flushSync:d.flushSync,viewTransition:d.viewTransition})},[s,i,e,n])}function b_(t,{relative:e}={}){let{basename:n}=D.useContext(wr),s=D.useContext(ii);Vn(s,"useFormAction must be used inside a RouteContext");let[i]=s.matches.slice(-1),o={...Fm(t||".",{relative:e})},d=yl();if(t==null){o.search=d.search;let f=new URLSearchParams(o.search),p=f.getAll("index");if(p.some(S=>S==="")){f.delete("index"),p.filter(b=>b).forEach(b=>f.append("index",b));let S=f.toString();o.search=S?`?${S}`:""}}return(!t||t===".")&&i.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:pl([n,o.pathname])),Em(o)}function v_(t,{relative:e}={}){let n=D.useContext(cS);Vn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=bS("useViewTransitionState"),i=Fm(t,{relative:e});if(!n.isTransitioning)return!1;let o=ho(n.currentLocation.pathname,s)||n.currentLocation.pathname,d=ho(n.nextLocation.pathname,s)||n.nextLocation.pathname;return S1(i.pathname,d)!=null||S1(i.pathname,o)!=null}const vS=D.createContext(null),tx=["dark","light","system"];function SS(){return typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function S_(t,e){if(typeof window>"u")return e;const n=localStorage.getItem(t);return n==="dark"||n==="light"||n==="system"?n:e}function X2(t){return t==="system"?SS():t}function N_({children:t,defaultMode:e="system",storageKey:n="camstack-theme-mode"}){const[s,i]=D.useState(()=>S_(n,e)),[o,d]=D.useState(()=>X2(s)),f=D.useCallback(S=>{i(S),d(X2(S)),typeof window<"u"&&localStorage.setItem(n,S)},[n]),p=D.useCallback(()=>{const b=(tx.indexOf(s)+1)%tx.length;f(tx[b]??"dark")},[s,f]);D.useEffect(()=>{if(typeof document>"u")return;const S=document.documentElement;S.classList.remove("dark","light"),S.classList.add(o)},[s,o]),D.useEffect(()=>{if(typeof window>"u"||s!=="system")return;const S=window.matchMedia("(prefers-color-scheme: dark)"),b=()=>{d(SS())};return S.addEventListener("change",b),()=>S.removeEventListener("change",b)},[s]);const y=D.useMemo(()=>({mode:s,resolvedMode:o,setMode:f,toggleMode:p}),[s,o,f,p]);return h.jsx(vS.Provider,{value:y,children:t})}function NS(){const t=D.useContext(vS);if(!t)throw new Error("useThemeMode must be used within a ThemeProvider");return t}function _S(t){var e,n,s="";if(typeof t=="string"||typeof t=="number")s+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=_S(t[e]))&&(s&&(s+=" "),s+=n)}else for(n in t)t[n]&&(s&&(s+=" "),s+=n);return s}function V1(){for(var t,e,n=0,s="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=_S(t))&&(s&&(s+=" "),s+=e);return s}const __=(t,e)=>{const n=new Array(t.length+e.length);for(let s=0;s<t.length;s++)n[s]=t[s];for(let s=0;s<e.length;s++)n[t.length+s]=e[s];return n},C_=(t,e)=>({classGroupId:t,validator:e}),CS=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),N1="-",F2=[],j_="arbitrary..",w_=t=>{const e=T_(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=t;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return E_(d);const f=d.split(N1),p=f[0]===""&&f.length>1?1:0;return jS(f,p,e)},getConflictingClassGroupIds:(d,f)=>{if(f){const p=s[d],y=n[d];return p?y?__(y,p):p:y||F2}return n[d]||F2}}},jS=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const i=t[e],o=n.nextPart.get(i);if(o){const y=jS(t,e+1,o);if(y)return y}const d=n.validators;if(d===null)return;const f=e===0?t.join(N1):t.slice(e).join(N1),p=d.length;for(let y=0;y<p;y++){const S=d[y];if(S.validator(f))return S.classGroupId}},E_=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),s=e.slice(0,n);return s?j_+s:void 0})(),T_=t=>{const{theme:e,classGroups:n}=t;return R_(n,e)},R_=(t,e)=>{const n=CS();for(const s in t){const i=t[s];lv(i,n,s,e)}return n},lv=(t,e,n,s)=>{const i=t.length;for(let o=0;o<i;o++){const d=t[o];O_(d,e,n,s)}},O_=(t,e,n,s)=>{if(typeof t=="string"){M_(t,e,n);return}if(typeof t=="function"){A_(t,e,n,s);return}D_(t,e,n,s)},M_=(t,e,n)=>{const s=t===""?e:wS(e,t);s.classGroupId=n},A_=(t,e,n,s)=>{if(z_(t)){lv(t(s),e,n,s);return}e.validators===null&&(e.validators=[]),e.validators.push(C_(n,t))},D_=(t,e,n,s)=>{const i=Object.entries(t),o=i.length;for(let d=0;d<o;d++){const[f,p]=i[d];lv(p,wS(e,f),n,s)}},wS=(t,e)=>{let n=t;const s=e.split(N1),i=s.length;for(let o=0;o<i;o++){const d=s[o];let f=n.nextPart.get(d);f||(f=CS(),n.nextPart.set(d,f)),n=f}return n},z_=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,k_=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),s=Object.create(null);const i=(o,d)=>{n[o]=d,e++,e>t&&(e=0,s=n,n=Object.create(null))};return{get(o){let d=n[o];if(d!==void 0)return d;if((d=s[o])!==void 0)return i(o,d),d},set(o,d){o in n?n[o]=d:i(o,d)}}},db="!",Z2=":",L_=[],I2=(t,e,n,s,i)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:s,isExternal:i}),U_=t=>{const{prefix:e,experimentalParseClassName:n}=t;let s=i=>{const o=[];let d=0,f=0,p=0,y;const S=i.length;for(let T=0;T<S;T++){const O=i[T];if(d===0&&f===0){if(O===Z2){o.push(i.slice(p,T)),p=T+1;continue}if(O==="/"){y=T;continue}}O==="["?d++:O==="]"?d--:O==="("?f++:O===")"&&f--}const b=o.length===0?i:i.slice(p);let _=b,j=!1;b.endsWith(db)?(_=b.slice(0,-1),j=!0):b.startsWith(db)&&(_=b.slice(1),j=!0);const w=y&&y>p?y-p:void 0;return I2(o,j,_,w)};if(e){const i=e+Z2,o=s;s=d=>d.startsWith(i)?o(d.slice(i.length)):I2(L_,!1,d,void 0,!0)}if(n){const i=s;s=o=>n({className:o,parseClassName:i})}return s},q_=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,s)=>{e.set(n,1e6+s)}),n=>{const s=[];let i=[];for(let o=0;o<n.length;o++){const d=n[o],f=d[0]==="[",p=e.has(d);f||p?(i.length>0&&(i.sort(),s.push(...i),i=[]),s.push(d)):i.push(d)}return i.length>0&&(i.sort(),s.push(...i)),s}},H_=t=>({cache:k_(t.cacheSize),parseClassName:U_(t),sortModifiers:q_(t),...w_(t)}),B_=/\s+/,G_=(t,e)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:i,sortModifiers:o}=e,d=[],f=t.trim().split(B_);let p="";for(let y=f.length-1;y>=0;y-=1){const S=f[y],{isExternal:b,modifiers:_,hasImportantModifier:j,baseClassName:w,maybePostfixModifierPosition:T}=n(S);if(b){p=S+(p.length>0?" "+p:p);continue}let O=!!T,R=s(O?w.substring(0,T):w);if(!R){if(!O){p=S+(p.length>0?" "+p:p);continue}if(R=s(w),!R){p=S+(p.length>0?" "+p:p);continue}O=!1}const M=_.length===0?"":_.length===1?_[0]:o(_).join(":"),z=j?M+db:M,k=z+R;if(d.indexOf(k)>-1)continue;d.push(k);const G=i(R,O);for(let P=0;P<G.length;++P){const L=G[P];d.push(z+L)}p=S+(p.length>0?" "+p:p)}return p},P_=(...t)=>{let e=0,n,s,i="";for(;e<t.length;)(n=t[e++])&&(s=ES(n))&&(i&&(i+=" "),i+=s);return i},ES=t=>{if(typeof t=="string")return t;let e,n="";for(let s=0;s<t.length;s++)t[s]&&(e=ES(t[s]))&&(n&&(n+=" "),n+=e);return n},Y_=(t,...e)=>{let n,s,i,o;const d=p=>{const y=e.reduce((S,b)=>b(S),t());return n=H_(y),s=n.cache.get,i=n.cache.set,o=f,f(p)},f=p=>{const y=s(p);if(y)return y;const S=G_(p,n);return i(p,S),S};return o=d,(...p)=>o(P_(...p))},V_=[],ka=t=>{const e=n=>n[t]||V_;return e.isThemeGetter=!0,e},TS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,RS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Q_=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,K_=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,X_=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,F_=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Z_=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,I_=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,cc=t=>Q_.test(t),Ct=t=>!!t&&!Number.isNaN(Number(t)),uc=t=>!!t&&Number.isInteger(Number(t)),nx=t=>t.endsWith("%")&&Ct(t.slice(0,-1)),$l=t=>K_.test(t),OS=()=>!0,J_=t=>X_.test(t)&&!F_.test(t),ov=()=>!1,W_=t=>Z_.test(t),$_=t=>I_.test(t),eC=t=>!Ge(t)&&!Pe(t),tC=t=>kc(t,DS,ov),Ge=t=>TS.test(t),Mu=t=>kc(t,zS,J_),J2=t=>kc(t,cC,Ct),nC=t=>kc(t,LS,OS),aC=t=>kc(t,kS,ov),W2=t=>kc(t,MS,ov),sC=t=>kc(t,AS,$_),G0=t=>kc(t,US,W_),Pe=t=>RS.test(t),Xp=t=>ed(t,zS),rC=t=>ed(t,kS),$2=t=>ed(t,MS),iC=t=>ed(t,DS),lC=t=>ed(t,AS),P0=t=>ed(t,US,!0),oC=t=>ed(t,LS,!0),kc=(t,e,n)=>{const s=TS.exec(t);return s?s[1]?e(s[1]):n(s[2]):!1},ed=(t,e,n=!1)=>{const s=RS.exec(t);return s?s[1]?e(s[1]):n:!1},MS=t=>t==="position"||t==="percentage",AS=t=>t==="image"||t==="url",DS=t=>t==="length"||t==="size"||t==="bg-size",zS=t=>t==="length",cC=t=>t==="number",kS=t=>t==="family-name",LS=t=>t==="number"||t==="weight",US=t=>t==="shadow",uC=()=>{const t=ka("color"),e=ka("font"),n=ka("text"),s=ka("font-weight"),i=ka("tracking"),o=ka("leading"),d=ka("breakpoint"),f=ka("container"),p=ka("spacing"),y=ka("radius"),S=ka("shadow"),b=ka("inset-shadow"),_=ka("text-shadow"),j=ka("drop-shadow"),w=ka("blur"),T=ka("perspective"),O=ka("aspect"),R=ka("ease"),M=ka("animate"),z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],G=()=>[...k(),Pe,Ge],P=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto","contain","none"],U=()=>[Pe,Ge,p],V=()=>[cc,"full","auto",...U()],Z=()=>[uc,"none","subgrid",Pe,Ge],re=()=>["auto",{span:["full",uc,Pe,Ge]},uc,Pe,Ge],ne=()=>[uc,"auto",Pe,Ge],W=()=>["auto","min","max","fr",Pe,Ge],ie=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ce=()=>["start","end","center","stretch","center-safe","end-safe"],Y=()=>["auto",...U()],$=()=>[cc,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...U()],ae=()=>[cc,"screen","full","dvw","lvw","svw","min","max","fit",...U()],Ne=()=>[cc,"screen","full","lh","dvh","lvh","svh","min","max","fit",...U()],me=()=>[t,Pe,Ge],B=()=>[...k(),$2,W2,{position:[Pe,Ge]}],I=()=>["no-repeat",{repeat:["","x","y","space","round"]}],fe=()=>["auto","cover","contain",iC,tC,{size:[Pe,Ge]}],xe=()=>[nx,Xp,Mu],_e=()=>["","none","full",y,Pe,Ge],Ce=()=>["",Ct,Xp,Mu],ze=()=>["solid","dashed","dotted","double"],Ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],we=()=>[Ct,nx,$2,W2],Vt=()=>["","none",w,Pe,Ge],et=()=>["none",Ct,Pe,Ge],Mt=()=>["none",Ct,Pe,Ge],Ht=()=>[Ct,Pe,Ge],En=()=>[cc,"full",...U()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[$l],breakpoint:[$l],color:[OS],container:[$l],"drop-shadow":[$l],ease:["in","out","in-out"],font:[eC],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[$l],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[$l],shadow:[$l],spacing:["px",Ct],text:[$l],"text-shadow":[$l],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",cc,Ge,Pe,O]}],container:["container"],columns:[{columns:[Ct,Ge,Pe,f]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:G()}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:V()}],"inset-x":[{"inset-x":V()}],"inset-y":[{"inset-y":V()}],start:[{"inset-s":V(),start:V()}],end:[{"inset-e":V(),end:V()}],"inset-bs":[{"inset-bs":V()}],"inset-be":[{"inset-be":V()}],top:[{top:V()}],right:[{right:V()}],bottom:[{bottom:V()}],left:[{left:V()}],visibility:["visible","invisible","collapse"],z:[{z:[uc,"auto",Pe,Ge]}],basis:[{basis:[cc,"full","auto",f,...U()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ct,cc,"auto","initial","none",Ge]}],grow:[{grow:["",Ct,Pe,Ge]}],shrink:[{shrink:["",Ct,Pe,Ge]}],order:[{order:[uc,"first","last","none",Pe,Ge]}],"grid-cols":[{"grid-cols":Z()}],"col-start-end":[{col:re()}],"col-start":[{"col-start":ne()}],"col-end":[{"col-end":ne()}],"grid-rows":[{"grid-rows":Z()}],"row-start-end":[{row:re()}],"row-start":[{"row-start":ne()}],"row-end":[{"row-end":ne()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:U()}],"gap-x":[{"gap-x":U()}],"gap-y":[{"gap-y":U()}],"justify-content":[{justify:[...ie(),"normal"]}],"justify-items":[{"justify-items":[...ce(),"normal"]}],"justify-self":[{"justify-self":["auto",...ce()]}],"align-content":[{content:["normal",...ie()]}],"align-items":[{items:[...ce(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ce(),{baseline:["","last"]}]}],"place-content":[{"place-content":ie()}],"place-items":[{"place-items":[...ce(),"baseline"]}],"place-self":[{"place-self":["auto",...ce()]}],p:[{p:U()}],px:[{px:U()}],py:[{py:U()}],ps:[{ps:U()}],pe:[{pe:U()}],pbs:[{pbs:U()}],pbe:[{pbe:U()}],pt:[{pt:U()}],pr:[{pr:U()}],pb:[{pb:U()}],pl:[{pl:U()}],m:[{m:Y()}],mx:[{mx:Y()}],my:[{my:Y()}],ms:[{ms:Y()}],me:[{me:Y()}],mbs:[{mbs:Y()}],mbe:[{mbe:Y()}],mt:[{mt:Y()}],mr:[{mr:Y()}],mb:[{mb:Y()}],ml:[{ml:Y()}],"space-x":[{"space-x":U()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":U()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],"inline-size":[{inline:["auto",...ae()]}],"min-inline-size":[{"min-inline":["auto",...ae()]}],"max-inline-size":[{"max-inline":["none",...ae()]}],"block-size":[{block:["auto",...Ne()]}],"min-block-size":[{"min-block":["auto",...Ne()]}],"max-block-size":[{"max-block":["none",...Ne()]}],w:[{w:[f,"screen",...$()]}],"min-w":[{"min-w":[f,"screen","none",...$()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[d]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh",...$()]}],"font-size":[{text:["base",n,Xp,Mu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,oC,nC]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",nx,Ge]}],"font-family":[{font:[rC,aC,e]}],"font-features":[{"font-features":[Ge]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,Pe,Ge]}],"line-clamp":[{"line-clamp":[Ct,"none",Pe,J2]}],leading:[{leading:[o,...U()]}],"list-image":[{"list-image":["none",Pe,Ge]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Pe,Ge]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:me()}],"text-color":[{text:me()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ze(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ct,"from-font","auto",Pe,Mu]}],"text-decoration-color":[{decoration:me()}],"underline-offset":[{"underline-offset":[Ct,"auto",Pe,Ge]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:U()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Pe,Ge]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Pe,Ge]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:B()}],"bg-repeat":[{bg:I()}],"bg-size":[{bg:fe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},uc,Pe,Ge],radial:["",Pe,Ge],conic:[uc,Pe,Ge]},lC,sC]}],"bg-color":[{bg:me()}],"gradient-from-pos":[{from:xe()}],"gradient-via-pos":[{via:xe()}],"gradient-to-pos":[{to:xe()}],"gradient-from":[{from:me()}],"gradient-via":[{via:me()}],"gradient-to":[{to:me()}],rounded:[{rounded:_e()}],"rounded-s":[{"rounded-s":_e()}],"rounded-e":[{"rounded-e":_e()}],"rounded-t":[{"rounded-t":_e()}],"rounded-r":[{"rounded-r":_e()}],"rounded-b":[{"rounded-b":_e()}],"rounded-l":[{"rounded-l":_e()}],"rounded-ss":[{"rounded-ss":_e()}],"rounded-se":[{"rounded-se":_e()}],"rounded-ee":[{"rounded-ee":_e()}],"rounded-es":[{"rounded-es":_e()}],"rounded-tl":[{"rounded-tl":_e()}],"rounded-tr":[{"rounded-tr":_e()}],"rounded-br":[{"rounded-br":_e()}],"rounded-bl":[{"rounded-bl":_e()}],"border-w":[{border:Ce()}],"border-w-x":[{"border-x":Ce()}],"border-w-y":[{"border-y":Ce()}],"border-w-s":[{"border-s":Ce()}],"border-w-e":[{"border-e":Ce()}],"border-w-bs":[{"border-bs":Ce()}],"border-w-be":[{"border-be":Ce()}],"border-w-t":[{"border-t":Ce()}],"border-w-r":[{"border-r":Ce()}],"border-w-b":[{"border-b":Ce()}],"border-w-l":[{"border-l":Ce()}],"divide-x":[{"divide-x":Ce()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Ce()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ze(),"hidden","none"]}],"divide-style":[{divide:[...ze(),"hidden","none"]}],"border-color":[{border:me()}],"border-color-x":[{"border-x":me()}],"border-color-y":[{"border-y":me()}],"border-color-s":[{"border-s":me()}],"border-color-e":[{"border-e":me()}],"border-color-bs":[{"border-bs":me()}],"border-color-be":[{"border-be":me()}],"border-color-t":[{"border-t":me()}],"border-color-r":[{"border-r":me()}],"border-color-b":[{"border-b":me()}],"border-color-l":[{"border-l":me()}],"divide-color":[{divide:me()}],"outline-style":[{outline:[...ze(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ct,Pe,Ge]}],"outline-w":[{outline:["",Ct,Xp,Mu]}],"outline-color":[{outline:me()}],shadow:[{shadow:["","none",S,P0,G0]}],"shadow-color":[{shadow:me()}],"inset-shadow":[{"inset-shadow":["none",b,P0,G0]}],"inset-shadow-color":[{"inset-shadow":me()}],"ring-w":[{ring:Ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:me()}],"ring-offset-w":[{"ring-offset":[Ct,Mu]}],"ring-offset-color":[{"ring-offset":me()}],"inset-ring-w":[{"inset-ring":Ce()}],"inset-ring-color":[{"inset-ring":me()}],"text-shadow":[{"text-shadow":["none",_,P0,G0]}],"text-shadow-color":[{"text-shadow":me()}],opacity:[{opacity:[Ct,Pe,Ge]}],"mix-blend":[{"mix-blend":[...Ee(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ee()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ct]}],"mask-image-linear-from-pos":[{"mask-linear-from":we()}],"mask-image-linear-to-pos":[{"mask-linear-to":we()}],"mask-image-linear-from-color":[{"mask-linear-from":me()}],"mask-image-linear-to-color":[{"mask-linear-to":me()}],"mask-image-t-from-pos":[{"mask-t-from":we()}],"mask-image-t-to-pos":[{"mask-t-to":we()}],"mask-image-t-from-color":[{"mask-t-from":me()}],"mask-image-t-to-color":[{"mask-t-to":me()}],"mask-image-r-from-pos":[{"mask-r-from":we()}],"mask-image-r-to-pos":[{"mask-r-to":we()}],"mask-image-r-from-color":[{"mask-r-from":me()}],"mask-image-r-to-color":[{"mask-r-to":me()}],"mask-image-b-from-pos":[{"mask-b-from":we()}],"mask-image-b-to-pos":[{"mask-b-to":we()}],"mask-image-b-from-color":[{"mask-b-from":me()}],"mask-image-b-to-color":[{"mask-b-to":me()}],"mask-image-l-from-pos":[{"mask-l-from":we()}],"mask-image-l-to-pos":[{"mask-l-to":we()}],"mask-image-l-from-color":[{"mask-l-from":me()}],"mask-image-l-to-color":[{"mask-l-to":me()}],"mask-image-x-from-pos":[{"mask-x-from":we()}],"mask-image-x-to-pos":[{"mask-x-to":we()}],"mask-image-x-from-color":[{"mask-x-from":me()}],"mask-image-x-to-color":[{"mask-x-to":me()}],"mask-image-y-from-pos":[{"mask-y-from":we()}],"mask-image-y-to-pos":[{"mask-y-to":we()}],"mask-image-y-from-color":[{"mask-y-from":me()}],"mask-image-y-to-color":[{"mask-y-to":me()}],"mask-image-radial":[{"mask-radial":[Pe,Ge]}],"mask-image-radial-from-pos":[{"mask-radial-from":we()}],"mask-image-radial-to-pos":[{"mask-radial-to":we()}],"mask-image-radial-from-color":[{"mask-radial-from":me()}],"mask-image-radial-to-color":[{"mask-radial-to":me()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":k()}],"mask-image-conic-pos":[{"mask-conic":[Ct]}],"mask-image-conic-from-pos":[{"mask-conic-from":we()}],"mask-image-conic-to-pos":[{"mask-conic-to":we()}],"mask-image-conic-from-color":[{"mask-conic-from":me()}],"mask-image-conic-to-color":[{"mask-conic-to":me()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:B()}],"mask-repeat":[{mask:I()}],"mask-size":[{mask:fe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Pe,Ge]}],filter:[{filter:["","none",Pe,Ge]}],blur:[{blur:Vt()}],brightness:[{brightness:[Ct,Pe,Ge]}],contrast:[{contrast:[Ct,Pe,Ge]}],"drop-shadow":[{"drop-shadow":["","none",j,P0,G0]}],"drop-shadow-color":[{"drop-shadow":me()}],grayscale:[{grayscale:["",Ct,Pe,Ge]}],"hue-rotate":[{"hue-rotate":[Ct,Pe,Ge]}],invert:[{invert:["",Ct,Pe,Ge]}],saturate:[{saturate:[Ct,Pe,Ge]}],sepia:[{sepia:["",Ct,Pe,Ge]}],"backdrop-filter":[{"backdrop-filter":["","none",Pe,Ge]}],"backdrop-blur":[{"backdrop-blur":Vt()}],"backdrop-brightness":[{"backdrop-brightness":[Ct,Pe,Ge]}],"backdrop-contrast":[{"backdrop-contrast":[Ct,Pe,Ge]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ct,Pe,Ge]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ct,Pe,Ge]}],"backdrop-invert":[{"backdrop-invert":["",Ct,Pe,Ge]}],"backdrop-opacity":[{"backdrop-opacity":[Ct,Pe,Ge]}],"backdrop-saturate":[{"backdrop-saturate":[Ct,Pe,Ge]}],"backdrop-sepia":[{"backdrop-sepia":["",Ct,Pe,Ge]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":U()}],"border-spacing-x":[{"border-spacing-x":U()}],"border-spacing-y":[{"border-spacing-y":U()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Pe,Ge]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ct,"initial",Pe,Ge]}],ease:[{ease:["linear","initial",R,Pe,Ge]}],delay:[{delay:[Ct,Pe,Ge]}],animate:[{animate:["none",M,Pe,Ge]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[T,Pe,Ge]}],"perspective-origin":[{"perspective-origin":G()}],rotate:[{rotate:et()}],"rotate-x":[{"rotate-x":et()}],"rotate-y":[{"rotate-y":et()}],"rotate-z":[{"rotate-z":et()}],scale:[{scale:Mt()}],"scale-x":[{"scale-x":Mt()}],"scale-y":[{"scale-y":Mt()}],"scale-z":[{"scale-z":Mt()}],"scale-3d":["scale-3d"],skew:[{skew:Ht()}],"skew-x":[{"skew-x":Ht()}],"skew-y":[{"skew-y":Ht()}],transform:[{transform:[Pe,Ge,"","none","gpu","cpu"]}],"transform-origin":[{origin:G()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:En()}],"translate-x":[{"translate-x":En()}],"translate-y":[{"translate-y":En()}],"translate-z":[{"translate-z":En()}],"translate-none":["translate-none"],accent:[{accent:me()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:me()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Pe,Ge]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mbs":[{"scroll-mbs":U()}],"scroll-mbe":[{"scroll-mbe":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pbs":[{"scroll-pbs":U()}],"scroll-pbe":[{"scroll-pbe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Pe,Ge]}],fill:[{fill:["none",...me()]}],"stroke-w":[{stroke:[Ct,Xp,Mu,J2]}],stroke:[{stroke:["none",...me()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},dC=Y_(uC);function Qn(...t){return dC(V1(t))}/**
|
|
61
|
-
* @license lucide-react v0.576.0 - ISC
|
|
62
|
-
*
|
|
63
|
-
* This source code is licensed under the ISC license.
|
|
64
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
-
*/const qS=(...t)=>t.filter((e,n,s)=>!!e&&e.trim()!==""&&s.indexOf(e)===n).join(" ").trim();/**
|
|
66
|
-
* @license lucide-react v0.576.0 - ISC
|
|
67
|
-
*
|
|
68
|
-
* This source code is licensed under the ISC license.
|
|
69
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
-
*/const fC=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
71
|
-
* @license lucide-react v0.576.0 - ISC
|
|
72
|
-
*
|
|
73
|
-
* This source code is licensed under the ISC license.
|
|
74
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
-
*/const hC=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,s)=>s?s.toUpperCase():n.toLowerCase());/**
|
|
76
|
-
* @license lucide-react v0.576.0 - ISC
|
|
77
|
-
*
|
|
78
|
-
* This source code is licensed under the ISC license.
|
|
79
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
-
*/const e3=t=>{const e=hC(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
|
|
81
|
-
* @license lucide-react v0.576.0 - ISC
|
|
82
|
-
*
|
|
83
|
-
* This source code is licensed under the ISC license.
|
|
84
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
-
*/var pC={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
86
|
-
* @license lucide-react v0.576.0 - ISC
|
|
87
|
-
*
|
|
88
|
-
* This source code is licensed under the ISC license.
|
|
89
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
-
*/const mC=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};/**
|
|
91
|
-
* @license lucide-react v0.576.0 - ISC
|
|
92
|
-
*
|
|
93
|
-
* This source code is licensed under the ISC license.
|
|
94
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
-
*/const gC=D.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:i="",children:o,iconNode:d,...f},p)=>D.createElement("svg",{ref:p,...pC,width:e,height:e,stroke:t,strokeWidth:s?Number(n)*24/Number(e):n,className:qS("lucide",i),...!o&&!mC(f)&&{"aria-hidden":"true"},...f},[...d.map(([y,S])=>D.createElement(y,S)),...Array.isArray(o)?o:[o]]));/**
|
|
96
|
-
* @license lucide-react v0.576.0 - ISC
|
|
97
|
-
*
|
|
98
|
-
* This source code is licensed under the ISC license.
|
|
99
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
-
*/const td=(t,e)=>{const n=D.forwardRef(({className:s,...i},o)=>D.createElement(gC,{ref:o,iconNode:e,className:qS(`lucide-${fC(e3(t))}`,`lucide-${t}`,s),...i}));return n.displayName=e3(t),n};/**
|
|
101
|
-
* @license lucide-react v0.576.0 - ISC
|
|
102
|
-
*
|
|
103
|
-
* This source code is licensed under the ISC license.
|
|
104
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
-
*/const yC=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],HS=td("chevron-down",yC);/**
|
|
106
|
-
* @license lucide-react v0.576.0 - ISC
|
|
107
|
-
*
|
|
108
|
-
* This source code is licensed under the ISC license.
|
|
109
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
-
*/const xC=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],bC=td("chevron-right",xC);/**
|
|
111
|
-
* @license lucide-react v0.576.0 - ISC
|
|
112
|
-
*
|
|
113
|
-
* This source code is licensed under the ISC license.
|
|
114
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
-
*/const vC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],SC=td("circle-plus",vC);/**
|
|
116
|
-
* @license lucide-react v0.576.0 - ISC
|
|
117
|
-
*
|
|
118
|
-
* This source code is licensed under the ISC license.
|
|
119
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
-
*/const NC=[["line",{x1:"15",x2:"15",y1:"12",y2:"18",key:"1p7wdc"}],["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],_C=td("copy-plus",NC);/**
|
|
121
|
-
* @license lucide-react v0.576.0 - ISC
|
|
122
|
-
*
|
|
123
|
-
* This source code is licensed under the ISC license.
|
|
124
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
-
*/const CC=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],jC=td("save",CC);/**
|
|
126
|
-
* @license lucide-react v0.576.0 - ISC
|
|
127
|
-
*
|
|
128
|
-
* This source code is licensed under the ISC license.
|
|
129
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
-
*/const wC=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],EC=td("trash-2",wC);/**
|
|
131
|
-
* @license lucide-react v0.576.0 - ISC
|
|
132
|
-
*
|
|
133
|
-
* This source code is licensed under the ISC license.
|
|
134
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
-
*/const TC=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],RC=td("x",TC),t3=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,n3=V1,nd=(t,e)=>n=>{var s;if((e==null?void 0:e.variants)==null)return n3(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=e,d=Object.keys(i).map(y=>{const S=n==null?void 0:n[y],b=o==null?void 0:o[y];if(S===null)return null;const _=t3(S)||t3(b);return i[y][_]}),f=n&&Object.entries(n).reduce((y,S)=>{let[b,_]=S;return _===void 0||(y[b]=_),y},{}),p=e==null||(s=e.compoundVariants)===null||s===void 0?void 0:s.reduce((y,S)=>{let{class:b,className:_,...j}=S;return Object.entries(j).every(w=>{let[T,O]=w;return Array.isArray(O)?O.includes({...o,...f}[T]):{...o,...f}[T]===O})?[...y,b,_]:y},[]);return n3(t,d,p,n==null?void 0:n.class,n==null?void 0:n.className)},OC=nd("inline-flex items-center justify-center rounded-md font-medium transition-colors disabled:opacity-50 disabled:pointer-events-none",{variants:{variant:{primary:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-surface text-foreground hover:bg-surface-hover",ghost:"hover:bg-surface-hover text-foreground-muted",danger:"bg-danger text-white hover:bg-danger/90",outline:"border border-border bg-transparent hover:bg-surface-hover"},size:{sm:"h-7 px-2.5 text-xs gap-1.5",md:"h-8 px-3 text-sm gap-2",lg:"h-9 px-4 text-sm gap-2"}},defaultVariants:{variant:"primary",size:"sm"}}),MC=D.forwardRef(({className:t,variant:e,size:n,...s},i)=>h.jsx("button",{ref:i,className:Qn(OC({variant:e,size:n}),t),...s}));MC.displayName="Button";const AC=nd("inline-flex items-center justify-center rounded-md font-medium transition-colors disabled:opacity-50 disabled:pointer-events-none",{variants:{variant:{primary:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-surface text-foreground hover:bg-surface-hover",ghost:"hover:bg-surface-hover text-foreground-muted",danger:"bg-danger text-white hover:bg-danger/90",outline:"border border-border bg-transparent hover:bg-surface-hover"},size:{sm:"h-7 w-7",md:"h-8 w-8",lg:"h-9 w-9"}},defaultVariants:{variant:"primary",size:"sm"}}),DC=D.forwardRef(({className:t,variant:e,size:n,icon:s,...i},o)=>h.jsx("button",{ref:o,className:Qn(AC({variant:e,size:n}),t),...i,children:h.jsx(s,{className:"h-4 w-4"})}));DC.displayName="IconButton";const zC=nd("inline-flex items-center rounded-full text-xs font-medium px-2 py-0.5",{variants:{variant:{default:"bg-surface-hover text-foreground",success:"bg-success/15 text-success",warning:"bg-warning/15 text-warning",danger:"bg-danger/15 text-danger",info:"bg-info/15 text-info"},styleVariant:{solid:"",outline:"border bg-transparent"}},defaultVariants:{variant:"default",styleVariant:"solid"}}),kC=D.forwardRef(({className:t,variant:e,style:n,...s},i)=>h.jsx("span",{ref:i,className:Qn(zC({variant:e,styleVariant:n}),t),...s}));kC.displayName="Badge";const LC=nd("rounded-lg p-3",{variants:{variant:{flat:"bg-surface",bordered:"bg-surface border border-border"}},defaultVariants:{variant:"bordered"}}),UC=D.forwardRef(({className:t,variant:e,...n},s)=>h.jsx("div",{ref:s,className:Qn(LC({variant:e}),t),...n}));UC.displayName="Card";const qC=D.forwardRef(({className:t,...e},n)=>h.jsx("label",{ref:n,className:Qn("text-[10px] uppercase tracking-wider text-foreground-muted font-medium",t),...e}));qC.displayName="Label";const HC=nd("",{variants:{orientation:{horizontal:"h-px w-full bg-border-subtle",vertical:"w-px h-full bg-border-subtle"}},defaultVariants:{orientation:"horizontal"}}),BC=D.forwardRef(({className:t,orientation:e,...n},s)=>h.jsx("div",{ref:s,role:"separator",className:Qn(HC({orientation:e}),t),...n}));BC.displayName="Separator";const GC=D.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:Qn("animate-pulse bg-surface-hover rounded-md h-4 w-full",t),...e}));GC.displayName="Skeleton";const a3=nd("h-7 w-full px-2.5 text-xs bg-surface border rounded-md text-foreground placeholder:text-foreground-subtle focus:outline-none focus:ring-1 focus:ring-primary transition-colors",{variants:{state:{default:"border-border",error:"border-danger"}},defaultVariants:{state:"default"}}),PC=D.forwardRef(({className:t,state:e,leftSlot:n,rightSlot:s,...i},o)=>n||s?h.jsxs("div",{className:"relative flex items-center w-full",children:[n&&h.jsx("div",{className:"absolute left-2.5 flex items-center pointer-events-none",children:n}),h.jsx("input",{ref:o,className:Qn(a3({state:e}),n?"pl-7":"",s?"pr-7":"",t),...i}),s&&h.jsx("div",{className:"absolute right-2.5 flex items-center pointer-events-none",children:s})]}):h.jsx("input",{ref:o,className:Qn(a3({state:e}),t),...i}));PC.displayName="Input";const YC=D.forwardRef(({className:t,options:e,...n},s)=>h.jsxs("div",{className:"relative w-full",children:[h.jsx("select",{ref:s,className:Qn("h-7 w-full px-2.5 text-xs bg-surface border border-border rounded-md text-foreground appearance-none pr-7 focus:outline-none focus:ring-1 focus:ring-primary",t),...n,children:e.map(i=>h.jsx("option",{value:i.value,children:i.label},i.value))}),h.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none text-foreground-muted",children:h.jsx(HS,{className:"h-3.5 w-3.5"})})]}));YC.displayName="Select";const VC=D.forwardRef(({className:t,...e},n)=>h.jsx("input",{ref:n,type:"checkbox",className:Qn("w-3.5 h-3.5 rounded-sm border border-border accent-primary",t),...e}));VC.displayName="Checkbox";const QC=D.forwardRef(({className:t,checked:e,onCheckedChange:n,label:s,...i},o)=>h.jsxs("button",{ref:o,role:"switch","aria-checked":e,type:"button",onClick:()=>n(!e),className:Qn("inline-flex items-center gap-2",t),...i,children:[h.jsx("span",{className:Qn("w-8 h-4 rounded-full transition-colors",e?"bg-primary":"bg-surface-hover"),children:h.jsx("span",{className:Qn("block w-3.5 h-3.5 rounded-full bg-white transition-transform",e?"translate-x-4":"translate-x-0.5")})}),s&&h.jsx("span",{className:"text-xs text-foreground",children:s})]}));QC.displayName="Switch";const KC=D.createContext(null);function XC(){const t=D.useContext(KC);if(!t)throw new Error("Dialog compound components must be used within <Dialog>");return t}const FC=nd("bg-background-elevated border border-border rounded-lg p-4 backdrop:bg-black/50 backdrop:backdrop-blur-sm max-w-[calc(100vw-2rem)] max-h-[calc(100dvh-2rem)] overflow-y-auto",{variants:{width:{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"}},defaultVariants:{width:"md"}}),ZC=D.forwardRef(({className:t,width:e,children:n,...s},i)=>{const{open:o,setOpen:d,contentId:f}=XC(),p=D.useRef(null),y=i??p;D.useEffect(()=>{const b=y.current;b&&(o&&!b.open&&b.showModal(),!o&&b.open&&b.close())},[o,y]);const S=b=>{b.target===b.currentTarget&&d(!1)};return h.jsx("dialog",{ref:y,id:f,className:Qn(FC({width:e}),"w-full",t),onClick:S,onClose:()=>d(!1),...s,children:n})});ZC.displayName="DialogContent";D.createContext(null);D.createContext(null);const BS="(max-width: 767px)";function IC(t){const e=window.matchMedia(BS);return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}function JC(){return window.matchMedia(BS).matches}function WC(){return!1}function GS(){return D.useSyncExternalStore(IC,JC,WC)}D.createContext(null);D.createContext(null);const $C=D.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:Qn("overflow-auto [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-surface-hover [&::-webkit-scrollbar-thumb]:rounded-full",t),...e}));$C.displayName="ScrollArea";function ej({open:t,onClose:e,children:n,className:s,width:i="w-64"}){const o=D.useRef(null);return D.useEffect(()=>{if(!t)return;const d=f=>{f.key==="Escape"&&e()};return document.addEventListener("keydown",d),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",d),document.body.style.overflow=""}},[t,e]),h.jsxs(h.Fragment,{children:[h.jsx("div",{className:Qn("fixed inset-0 z-40 bg-black/50 backdrop-blur-sm transition-opacity duration-200",t?"opacity-100":"pointer-events-none opacity-0"),onClick:e,"aria-hidden":"true"}),h.jsx("div",{ref:o,role:"dialog","aria-modal":"true",className:Qn("fixed inset-y-0 left-0 z-50 flex flex-col bg-surface border-r border-border shadow-2xl transition-transform duration-200 ease-out",i,t?"translate-x-0":"-translate-x-full",s),children:n})]})}const tj={"object-detection":"border-l-blue-500","motion-detection":"border-l-amber-500","face-detection":"border-l-purple-500","face-recognition":"border-l-violet-500","plate-detection":"border-l-pink-500","plate-recognition":"border-l-rose-500","animal-classifier":"border-l-lime-500","bird-nabirds-classifier":"border-l-emerald-500","bird-global-classifier":"border-l-teal-500","audio-classification":"border-l-green-500","segmentation-refiner":"border-l-cyan-500"},nj={detector:"border-l-blue-500",cropper:"border-l-purple-500",classifier:"border-l-lime-500",refiner:"border-l-cyan-500"};function aj(t,e){return tj[t]??nj[e]??"border-l-primary"}const sj={cpu:"onnx",coreml:"coreml",openvino:"openvino",cuda:"onnx",tensorrt:"onnx","onnx-py":"onnx",pytorch:"pt"};function rj(t,e,n){const s=t==="node"?e.runtimes.node.backends:e.runtimes.python.backends;if(!n)return s;const i=new Set;for(const o of n.models)for(const d of Object.keys(o.formats))i.add(d);return t==="node"&&i.add("onnx"),s.map(o=>{const d=sj[o.id]??"onnx",f=i.has(d);return{...o,available:o.available&&f}})}function ij(t,e,n,s){var o;if(!t)return[];const i=e==="node"?"onnx":((o=s.runtimes.python.backends.find(d=>d.id===n))==null?void 0:o.modelFormat)??"onnx";return t.models.filter(d=>d.formats[i]).map(d=>{var f;return{id:d.id,name:d.name,downloaded:((f=d.formats[i])==null?void 0:f.downloaded)??!1}})}function lj(t){const e=[{id:"node",label:"Node.js (ONNX)",available:!0}];return t.runtimes.python.available&&t.runtimes.python.backends.some(n=>n.available)&&e.unshift({id:"python",label:"Python",available:!0}),e}function ax({step:t,schema:e,allSchemas:n,capabilities:s,depth:i=0,onChange:o,onDelete:d,readOnly:f=!1}){var O;const[p,y]=D.useState(!1),S=aj(t.addonId,t.slot),b=rj(t.runtime,s,e),_=lj(s);if(!(((O=b.find(R=>R.id===t.backend))==null?void 0:O.available)??!1)&&!f){const R=b.find(M=>M.available);R&&R.id!==t.backend&&queueMicrotask(()=>o({...t,backend:R.id}))}const w=ij(e,t.runtime,t.backend,s);if(w.length>0&&!w.some(R=>R.id===t.modelId)&&!f){const M=(e!=null&&e.defaultModelId?w.find(z=>z.id===e.defaultModelId):null)??w[0];M&&M.id!==t.modelId&&queueMicrotask(()=>o({...t,modelId:M.id}))}function T(R){R.target.closest(".step-config")||y(M=>!M)}return h.jsx("div",{className:"space-y-2",children:h.jsxs("div",{className:Qn("rounded-xl border border-border bg-surface overflow-hidden border-l-4 shadow-sm",S,!t.enabled&&"opacity-[0.45]"),children:[h.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5 cursor-pointer select-none",onClick:T,children:[h.jsx("span",{className:"text-foreground-subtle",children:p?h.jsx(HS,{className:"h-4 w-4"}):h.jsx(bC,{className:"h-4 w-4"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("span",{className:"text-[10px] uppercase tracking-wider font-medium text-foreground-subtle/60 block leading-none",children:t.slot}),h.jsx("span",{className:"text-sm font-semibold text-foreground truncate block leading-tight",children:t.addonName}),h.jsxs("div",{className:"flex items-center gap-1 mt-0.5 flex-wrap",children:[t.inputClasses.map(R=>h.jsx("span",{className:"text-[9px] uppercase font-semibold tracking-wide px-1.5 py-0.5 rounded bg-blue-500/12 text-blue-400",children:R},R)),t.inputClasses.length>0&&t.outputClasses.length>0&&h.jsx("span",{className:"text-foreground-subtle/40 text-[10px]",children:"→"}),t.outputClasses.map(R=>h.jsx("span",{className:"text-[9px] uppercase font-semibold tracking-wide px-1.5 py-0.5 rounded bg-green-500/12 text-green-400",children:R},R))]})]}),h.jsx("button",{onClick:R=>{R.stopPropagation(),o({...t,enabled:!t.enabled})},className:Qn("relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors",t.enabled?"bg-success":"bg-foreground-subtle/30"),children:h.jsx("span",{className:Qn("inline-block h-4 w-4 rounded-full bg-white shadow transition-transform",t.enabled?"translate-x-6":"translate-x-1")})})]}),p&&h.jsxs("div",{className:"step-config border-t border-border bg-background px-4 py-4 space-y-3",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[h.jsx(Y0,{label:"Agent",value:t.agentId,disabled:f,options:[{value:t.agentId||"hub",label:t.agentId||"Hub (local)"}],onChange:R=>o({...t,agentId:R})}),h.jsx(Y0,{label:"Runtime",value:t.runtime,disabled:f,options:_.map(R=>({value:R.id,label:R.label,disabled:!R.available})),onChange:R=>o({...t,runtime:R})}),h.jsx(Y0,{label:"Backend",value:t.backend,disabled:f,options:b.map(R=>({value:R.id,label:R.label,disabled:!R.available})),onChange:R=>o({...t,backend:R})}),h.jsx(Y0,{label:"Model",value:t.modelId,disabled:f,options:w.map(R=>({value:R.id,label:`${R.name}${R.downloaded?" ✓":""}`})),onChange:R=>o({...t,modelId:R})})]}),h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center justify-between mb-1",children:[h.jsx("span",{className:"text-[10px] font-medium text-foreground-subtle uppercase tracking-wide",children:"Confidence"}),h.jsxs("span",{className:"text-xs font-medium text-foreground tabular-nums",children:[(t.confidence*100).toFixed(0),"%"]})]}),h.jsx("input",{type:"range",min:0,max:1,step:.01,value:t.confidence,disabled:f,onChange:R=>o({...t,confidence:Number(R.target.value)}),className:"w-full accent-primary h-1.5"})]})]})]})})}function Y0({label:t,value:e,options:n,disabled:s,onChange:i}){return h.jsxs("div",{children:[h.jsx("label",{className:"block text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-1.5",children:t}),h.jsxs("select",{value:e,onChange:o=>i(o.target.value),disabled:s,className:"w-full rounded-lg border border-border bg-surface px-3 py-2 text-xs text-foreground focus:outline-none focus:border-primary/50",children:[n.length===0&&h.jsx("option",{value:e,children:e||"default"}),n.map(o=>h.jsx("option",{value:o.value,disabled:o.disabled,children:o.label},o.value))]})]})}function oj(t,e){const n=new Set(e.slots.flatMap(d=>d.addons.map(f=>f.id))),s=[];function i(d){if(!n.has(d.addonId))return s.push(`Addon "${d.addonId}" is no longer available — step removed`),null;const f=e.slots.flatMap(S=>S.addons).find(S=>S.id===d.addonId);let p=d.modelId;if(f&&!f.models.some(S=>S.id===p)){const S=f.defaultModelId;s.push(`Model "${p}" not available for ${d.addonId} — using "${S}"`),p=S}const y=d.children.map(S=>i(S)).filter(S=>S!==null);return{...d,modelId:p,children:y}}const o=t.map(d=>i(d)).filter(d=>d!==null);return{valid:s.length===0,steps:o,warnings:s}}function cj(t){const e=new Map;for(const n of t.slots)for(const s of n.addons)e.set(s.id,s);return e}function sx(t,e,n){return{addonId:t.id,addonName:t.name,slot:t.slot,inputClasses:[...t.inputClasses],outputClasses:[...t.outputClasses],enabled:!0,agentId:"hub",runtime:t.defaultRuntime??e??"node",backend:t.defaultBackend??n??"cpu",modelId:t.defaultModelId,confidence:t.defaultConfidence,classFilters:[...t.inputClasses],children:[]}}function rx({addon:t,onClick:e}){return h.jsx("button",{type:"button",onClick:e,className:"w-full rounded-xl border-2 border-dashed border-border/60 px-4 py-3 text-left transition-all hover:border-primary/30 hover:bg-surface/60 group",children:h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(SC,{className:"h-[18px] w-[18px] text-foreground-subtle/30 group-hover:text-primary/60 shrink-0"}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("span",{className:"text-[13px] font-medium text-foreground-subtle/50 group-hover:text-foreground-subtle block truncate",children:t.name}),h.jsxs("div",{className:"flex items-center gap-1 mt-0.5 flex-wrap",children:[t.inputClasses.map(n=>h.jsx("span",{className:"text-[9px] uppercase font-semibold tracking-wide px-1.5 py-0.5 rounded bg-blue-500/8 text-blue-400/50",children:n},n)),t.inputClasses.length>0&&t.outputClasses.length>0&&h.jsx("span",{className:"text-foreground-subtle/25 text-[10px]",children:"→"}),t.outputClasses.map(n=>h.jsx("span",{className:"text-[9px] uppercase font-semibold tracking-wide px-1.5 py-0.5 rounded bg-green-500/8 text-green-400/50",children:n},n))]})]})]})})}function uj({schema:t,capabilities:e,steps:n,onChange:s,templates:i,selectedTemplateId:o,onSelectTemplate:d,onSaveTemplate:f,onUpdateTemplate:p,onDeleteTemplate:y,readOnly:S=!1,excludeAddons:b=[]}){var $,ae,Ne,me;const _=D.useMemo(()=>new Set(b),[b]),j=D.useMemo(()=>cj(t),[t]),[w,T]=D.useState([]),O=($=e.platformScores)==null?void 0:$.find(B=>B.available),R=e.runtimes.python.available&&e.runtimes.python.backends.some(B=>B.available),M=(O==null?void 0:O.runtime)??(R?"python":"node"),z=(O==null?void 0:O.backend)??(R?((ae=e.runtimes.python.backends.find(B=>B.available))==null?void 0:ae.id)??"cpu":((Ne=e.runtimes.node.backends.find(B=>B.available&&B.id!=="cpu"))==null?void 0:Ne.id)??"cpu"),k=o?JSON.stringify(n)!==JSON.stringify((me=i.find(B=>B.id===o))==null?void 0:me.steps):!1;function G(B){const I=B.target.value||null;if(I){const fe=i.find(xe=>xe.id===I);if(fe){const xe=oj(fe.steps,t);T([...xe.warnings])}}else T([]);d(I)}function P(){o&&p(o,n)}function L(){const B=window.prompt("Template name:");B!=null&&B.trim()&&f(B.trim(),n)}function U(){if(!o)return;const B=i.find(I=>I.id===o);B&&window.confirm(`Delete template "${B.name}"?`)&&y(o)}function V(B){s(n.map(I=>I.addonId!==B.addonId?I:Z(B)))}function Z(B){const I=B.children.some(fe=>fe.enabled||fe.children.some(xe=>xe.enabled));return{...B,enabled:B.enabled||I,children:B.children.map(fe=>{const xe=fe.children.some(_e=>_e.enabled);return{...fe,enabled:fe.enabled||xe}})}}function re(B,I){const fe=sx(I,M,z);s(n.map(xe=>xe.addonId!==B?xe:{...xe,children:[...xe.children,fe]}))}function ne(B){const I=new Set;for(const fe of B){I.add(fe.addonId);for(const _e of fe.children)I.add(_e.addonId);const xe=ne(fe.children);for(const _e of xe)I.add(_e)}return I}const W=ne(n);function ie(B){const I=j.get(B.addonId);if(!I)return[];const fe=I.childSlots,xe=new Set(B.children.map(Ce=>Ce.addonId)),_e=[];for(const Ce of t.slots)if(fe.includes(Ce.id))for(const ze of Ce.addons){if(xe.has(ze.id)||_.has(ze.id))continue;ze.inputClasses.some(we=>B.outputClasses.includes(we))&&_e.push(ze)}return _e}function ce(B){const I=ie(B);return h.jsxs("div",{className:"space-y-1.5",children:[h.jsx(ax,{step:B,schema:j.get(B.addonId)??null,allSchemas:j,capabilities:e,onChange:V,onDelete:S?void 0:fe=>s(n.filter(xe=>xe.addonId!==fe)),readOnly:S}),(B.children.length>0||I.length>0)&&h.jsxs("div",{className:"ml-6 pl-4 border-l-2 border-dashed border-border/40 space-y-1.5",children:[h.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/40",children:"Slot: Cropper / Classifier"}),B.children.map(fe=>{const xe=ie(fe);return h.jsxs("div",{className:"space-y-1.5",children:[h.jsx(ax,{step:fe,schema:j.get(fe.addonId)??null,allSchemas:j,capabilities:e,depth:1,onChange:_e=>{V({...B,children:B.children.map(Ce=>Ce.addonId===_e.addonId?_e:Ce)})},onDelete:S?void 0:_e=>{V({...B,children:B.children.filter(Ce=>Ce.addonId!==_e)})},readOnly:S}),(fe.children.length>0||xe.length>0)&&h.jsxs("div",{className:"ml-6 pl-4 border-l-2 border-dashed border-border/30 space-y-1.5",children:[h.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/30",children:"Slot: Recognizer"}),fe.children.map(_e=>h.jsx(ax,{step:_e,schema:j.get(_e.addonId)??null,allSchemas:j,capabilities:e,depth:2,onChange:Ce=>{V({...B,children:B.children.map(ze=>ze.addonId===fe.addonId?{...ze,children:ze.children.map(Ee=>Ee.addonId===Ce.addonId?Ce:Ee)}:ze)})},onDelete:S?void 0:Ce=>{V({...B,children:B.children.map(ze=>ze.addonId===fe.addonId?{...ze,children:ze.children.filter(Ee=>Ee.addonId!==Ce)}:ze)})},readOnly:S},_e.addonId)),!S&&xe.map(_e=>h.jsx(rx,{addon:_e,onClick:()=>{const Ce=sx(_e,M,z);V({...B,children:B.children.map(ze=>ze.addonId===fe.addonId?{...ze,children:[...ze.children,Ce]}:ze)})}},_e.id))]})]},fe.addonId)}),!S&&I.map(fe=>h.jsx(rx,{addon:fe,onClick:()=>re(B.addonId,fe)},fe.id))]})]},B.addonId)}const Y=t.slots.filter(B=>B.parentSlot===null).sort((B,I)=>B.priority-I.priority);return h.jsxs("div",{className:"space-y-4",children:[h.jsx("div",{className:"rounded-xl border border-border bg-surface p-3",children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"relative flex-1 min-w-0",children:h.jsxs("select",{value:o??"",onChange:G,className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground focus:outline-none focus:border-primary/50",children:[h.jsx("option",{value:"",children:"No template"}),i.map(B=>h.jsx("option",{value:B.id,children:B.name},B.id))]})}),k&&h.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-amber-500 shrink-0"}),h.jsx("button",{onClick:P,disabled:!o||S,title:"Save",className:Qn("p-2 rounded-lg border border-border transition-colors",o&&!S?"text-foreground-subtle hover:bg-surface-hover":"text-foreground-subtle/30 cursor-not-allowed"),children:h.jsx(jC,{className:"h-4 w-4"})}),h.jsx("button",{onClick:L,disabled:S,title:"Save As",className:Qn("p-2 rounded-lg border border-border transition-colors",S?"text-foreground-subtle/30 cursor-not-allowed":"text-foreground-subtle hover:bg-surface-hover"),children:h.jsx(_C,{className:"h-4 w-4"})}),h.jsx("button",{onClick:U,disabled:!o||S,title:"Delete",className:Qn("p-2 rounded-lg border border-border transition-colors",o&&!S?"text-foreground-subtle hover:text-danger":"text-foreground-subtle/30 cursor-not-allowed"),children:h.jsx(EC,{className:"h-4 w-4"})})]})}),w.length>0&&h.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 p-3 text-xs text-amber-400 space-y-1",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"font-medium",children:"Template loaded with warnings:"}),h.jsx("button",{onClick:()=>T([]),className:"text-amber-400/60 hover:text-amber-400",children:h.jsx(RC,{className:"h-3.5 w-3.5"})})]}),w.map((B,I)=>h.jsxs("div",{children:["• ",B]},I))]}),Y.map(B=>{const I=n.filter(xe=>xe.slot===B.id&&!_.has(xe.addonId)),fe=B.addons.filter(xe=>!W.has(xe.id)&&!_.has(xe.id));return h.jsxs("div",{className:"space-y-2",children:[h.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/50",children:["Slot: ",B.label]}),I.map(xe=>ce(xe)),!S&&fe.map(xe=>h.jsx(rx,{addon:xe,onClick:()=>{s([...n,sx(xe,M,z)])}},xe.id))]},B.id)})]})}var dj=Object.create,PS=Object.defineProperty,fj=Object.getOwnPropertyDescriptor,YS=Object.getOwnPropertyNames,hj=Object.getPrototypeOf,pj=Object.prototype.hasOwnProperty,bl=(t,e)=>function(){return e||(0,t[YS(t)[0]])((e={exports:{}}).exports,e),e.exports},mj=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(var i=YS(e),o=0,d=i.length,f;o<d;o++)f=i[o],!pj.call(t,f)&&f!==n&&PS(t,f,{get:(p=>e[p]).bind(null,f),enumerable:!(s=fj(e,f))||s.enumerable});return t},ya=(t,e,n)=>(n=t!=null?dj(hj(t)):{},mj(PS(n,"default",{value:t,enumerable:!0}),t)),VS=bl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(t,e){function n(s){"@babel/helpers - typeof";return e.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},e.exports.__esModule=!0,e.exports.default=e.exports,n(s)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),gj=bl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(t,e){var n=VS().default;function s(i,o){if(n(i)!="object"||!i)return i;var d=i[Symbol.toPrimitive];if(d!==void 0){var f=d.call(i,o||"default");if(n(f)!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(i)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),yj=bl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(t,e){var n=VS().default,s=gj();function i(o){var d=s(o,"string");return n(d)=="symbol"?d:d+""}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}}),ad=bl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(t,e){var n=yj();function s(i,o,d){return(o=n(o))in i?Object.defineProperty(i,o,{value:d,enumerable:!0,configurable:!0,writable:!0}):i[o]=d,i}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),Ti=bl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(t,e){var n=ad();function s(o,d){var f=Object.keys(o);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(o);d&&(p=p.filter(function(y){return Object.getOwnPropertyDescriptor(o,y).enumerable})),f.push.apply(f,p)}return f}function i(o){for(var d=1;d<arguments.length;d++){var f=arguments[d]!=null?arguments[d]:{};d%2?s(Object(f),!0).forEach(function(p){n(o,p,f[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(f)):s(Object(f)).forEach(function(p){Object.defineProperty(o,p,Object.getOwnPropertyDescriptor(f,p))})}return o}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}});function xj(t){const e={subscribe(n){let s=null,i=!1,o=!1,d=!1;function f(){if(s===null){d=!0;return}o||(o=!0,typeof s=="function"?s():s&&s.unsubscribe())}return s=t({next(p){var y;i||(y=n.next)===null||y===void 0||y.call(n,p)},error(p){var y;i||(i=!0,(y=n.error)===null||y===void 0||y.call(n,p),f())},complete(){var p;i||(i=!0,(p=n.complete)===null||p===void 0||p.call(n),f())}}),d&&f(),{unsubscribe:f}},pipe(...n){return n.reduce(bj,e)}};return e}function bj(t,e){return e(t)}function vj(t){let e=t;const n=[],s=d=>{e!==void 0&&d.next(e),n.push(d)},i=d=>{n.splice(n.indexOf(d),1)},o=xj(d=>(s(d),()=>{i(d)}));return o.next=d=>{if(e!==d){e=d;for(const f of n)f.next(d)}},o.get=()=>e,o}ya(ad());ya(Ti());ya(Ti());ya(Ti());ya(Ti());ya(Ti());const QS=(t,...e)=>typeof t=="function"?t(...e):t;ya(ad());function Sj(){let t,e;return{promise:new Promise((s,i)=>{t=s,e=i}),resolve:t,reject:e}}async function Nj(t){const e=await QS(t.url);if(!t.connectionParams)return e;const s=`${e.includes("?")?"&":"?"}connectionParams=1`;return e+s}async function _j(t,e){const n={method:"connectionParams",data:await QS(t)};return e.encode(n)}ya(ad());var pc=ya(ad());function Cj(t){const{promise:e,resolve:n,reject:s}=Sj();return t.addEventListener("open",()=>{t.removeEventListener("error",s),n()}),t.addEventListener("error",s),e}function jj(t,{intervalMs:e,pongTimeoutMs:n}){let s,i;function o(){s=setTimeout(()=>{t.send("PING"),i=setTimeout(()=>{t.close()},n)},e)}function d(){clearTimeout(s),o()}function f(){clearTimeout(i),d()}t.addEventListener("open",o),t.addEventListener("message",({data:p})=>{clearTimeout(s),o(),p==="PONG"&&f()}),t.addEventListener("close",()=>{clearTimeout(s),clearTimeout(i)})}var wj=class fb{constructor(e){var n;if((0,pc.default)(this,"id",++fb.connectCount),(0,pc.default)(this,"WebSocketPonyfill",void 0),(0,pc.default)(this,"urlOptions",void 0),(0,pc.default)(this,"keepAliveOpts",void 0),(0,pc.default)(this,"encoder",void 0),(0,pc.default)(this,"wsObservable",vj(null)),(0,pc.default)(this,"openPromise",null),this.WebSocketPonyfill=(n=e.WebSocketPonyfill)!==null&&n!==void 0?n:WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=e.urlOptions,this.keepAliveOpts=e.keepAlive,this.encoder=e.encoder}get ws(){return this.wsObservable.get()}set ws(e){this.wsObservable.next(e)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){var e=this;if(e.openPromise)return e.openPromise;e.id=++fb.connectCount;const n=Nj(e.urlOptions).then(s=>new e.WebSocketPonyfill(s));e.openPromise=n.then(async s=>{e.ws=s,s.binaryType="arraybuffer",s.addEventListener("message",function({data:i}){i==="PING"&&this.send("PONG")}),e.keepAliveOpts.enabled&&jj(s,e.keepAliveOpts),s.addEventListener("close",()=>{e.ws===s&&(e.ws=null)}),await Cj(s),e.urlOptions.connectionParams&&s.send(await _j(e.urlOptions.connectionParams,e.encoder))});try{await e.openPromise}finally{e.openPromise=null}}async close(){var e=this;try{await e.openPromise}finally{var n;(n=e.ws)===null||n===void 0||n.close()}}};(0,pc.default)(wj,"connectCount",0);ya(ad());ya(Ti());ya(ad());ya(Ti());ya(Ti());ya(Ti());var Ej=bl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(t,e){function n(i){var o,d,f,p=2;for(typeof Symbol<"u"&&(d=Symbol.asyncIterator,f=Symbol.iterator);p--;){if(d&&(o=i[d])!=null)return o.call(i);if(f&&(o=i[f])!=null)return new s(o.call(i));d="@@asyncIterator",f="@@iterator"}throw new TypeError("Object is not async iterable")}function s(i){function o(d){if(Object(d)!==d)return Promise.reject(new TypeError(d+" is not an object."));var f=d.done;return Promise.resolve(d.value).then(function(p){return{value:p,done:f}})}return s=function(f){this.s=f,this.n=f.next},s.prototype={s:null,n:null,next:function(){return o(this.n.apply(this.s,arguments))},return:function(f){var p=this.s.return;return p===void 0?Promise.resolve({value:f,done:!0}):o(p.apply(this.s,arguments))},throw:function(f){var p=this.s.return;return p===void 0?Promise.reject(f):o(p.apply(this.s,arguments))}},new s(i)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}});ya(Ej());ya(Ti());var Tj=bl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(t,e){function n(){var s=typeof SuppressedError=="function"?SuppressedError:function(f,p){var y=Error();return y.name="SuppressedError",y.error=f,y.suppressed=p,y},i={},o=[];function d(f,p){if(p!=null){if(Object(p)!==p)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(f)var y=p[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(y===void 0&&(y=p[Symbol.dispose||Symbol.for("Symbol.dispose")],f))var S=y;if(typeof y!="function")throw new TypeError("Object is not disposable.");S&&(y=function(){try{S.call(p)}catch(_){return Promise.reject(_)}}),o.push({v:p,d:y,a:f})}else f&&o.push({d:p,a:f});return p}return{e:i,u:d.bind(null,!1),a:d.bind(null,!0),d:function(){var p,y=this.e,S=0;function b(){for(;p=o.pop();)try{if(!p.a&&S===1)return S=0,o.push(p),Promise.resolve().then(b);if(p.d){var j=p.d.call(p.v);if(p.a)return S|=2,Promise.resolve(j).then(b,_)}else S|=1}catch(w){return _(w)}if(S===1)return y!==i?Promise.reject(y):Promise.resolve();if(y!==i)throw y}function _(j){return y=y!==i?new s(j,y):j,b()}return b()}}}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),KS=bl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(t,e){function n(s,i){this.v=s,this.k=i}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),Rj=bl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(t,e){var n=KS();function s(i){return new n(i,0)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),Oj=bl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(t,e){var n=KS();function s(o){return function(){return new i(o.apply(this,arguments))}}function i(o){var d,f;function p(S,b){try{var _=o[S](b),j=_.value,w=j instanceof n;Promise.resolve(w?j.v:j).then(function(T){if(w){var O=S==="return"?"return":"next";if(!j.k||T.done)return p(O,T);T=o[O](T).value}y(_.done?"return":"normal",T)},function(T){p("throw",T)})}catch(T){y("throw",T)}}function y(S,b){switch(S){case"return":d.resolve({value:b,done:!0});break;case"throw":d.reject(b);break;default:d.resolve({value:b,done:!1})}(d=d.next)?p(d.key,d.arg):f=null}this._invoke=function(S,b){return new Promise(function(_,j){var w={key:S,arg:b,resolve:_,reject:j,next:null};f?f=f.next=w:(d=f=w,p(S,b))})},typeof o.return!="function"&&(this.return=void 0)}i.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},i.prototype.next=function(o){return this._invoke("next",o)},i.prototype.throw=function(o){return this._invoke("throw",o)},i.prototype.return=function(o){return this._invoke("return",o)},e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}});ya(Tj());ya(Rj());ya(Oj());ya(Ti());class Mj{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(e,n){this.keyToValue.set(e,n),this.valueToKey.set(n,e)}getByKey(e){return this.keyToValue.get(e)}getByValue(e){return this.valueToKey.get(e)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}}class XS{constructor(e){this.generateIdentifier=e,this.kv=new Mj}register(e,n){this.kv.getByValue(e)||(n||(n=this.generateIdentifier(e)),this.kv.set(n,e))}clear(){this.kv.clear()}getIdentifier(e){return this.kv.getByValue(e)}getValue(e){return this.kv.getByKey(e)}}class Aj extends XS{constructor(){super(e=>e.name),this.classToAllowedProps=new Map}register(e,n){typeof n=="object"?(n.allowProps&&this.classToAllowedProps.set(e,n.allowProps),super.register(e,n.identifier)):super.register(e,n)}getAllowedProps(e){return this.classToAllowedProps.get(e)}}function Dj(t){if("values"in Object)return Object.values(t);const e=[];for(const n in t)t.hasOwnProperty(n)&&e.push(t[n]);return e}function zj(t,e){const n=Dj(t);if("find"in n)return n.find(e);const s=n;for(let i=0;i<s.length;i++){const o=s[i];if(e(o))return o}}function $f(t,e){Object.entries(t).forEach(([n,s])=>e(s,n))}function m1(t,e){return t.indexOf(e)!==-1}function s3(t,e){for(let n=0;n<t.length;n++){const s=t[n];if(e(s))return s}}class kj{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return zj(this.transfomers,n=>n.isApplicable(e))}findByName(e){return this.transfomers[e]}}const Lj=t=>Object.prototype.toString.call(t).slice(8,-1),FS=t=>typeof t>"u",Uj=t=>t===null,Tm=t=>typeof t!="object"||t===null||t===Object.prototype?!1:Object.getPrototypeOf(t)===null?!0:Object.getPrototypeOf(t)===Object.prototype,hb=t=>Tm(t)&&Object.keys(t).length===0,Dc=t=>Array.isArray(t),qj=t=>typeof t=="string",Hj=t=>typeof t=="number"&&!isNaN(t),Bj=t=>typeof t=="boolean",Gj=t=>t instanceof RegExp,Rm=t=>t instanceof Map,Om=t=>t instanceof Set,ZS=t=>Lj(t)==="Symbol",Pj=t=>t instanceof Date&&!isNaN(t.valueOf()),IS=t=>t instanceof Error,r3=t=>typeof t=="number"&&isNaN(t),Yj=t=>Bj(t)||Uj(t)||FS(t)||Hj(t)||qj(t)||ZS(t),Vj=t=>typeof t=="bigint",Qj=t=>t===1/0||t===-1/0,Kj=t=>ArrayBuffer.isView(t)&&!(t instanceof DataView),Xj=t=>t instanceof URL,pb=t=>t.replace(/\\/g,"\\\\").replace(/\./g,"\\."),ix=t=>t.map(String).map(pb).join("."),mm=(t,e)=>{const n=[];let s="";for(let o=0;o<t.length;o++){let d=t.charAt(o);if(!e&&d==="\\"){const y=t.charAt(o+1);if(y==="\\"){s+="\\",o++;continue}else if(y!==".")throw Error("invalid path")}if(d==="\\"&&t.charAt(o+1)==="."){s+=".",o++;continue}if(d==="."){n.push(s),s="";continue}s+=d}const i=s;return n.push(i),n};function ll(t,e,n,s){return{isApplicable:t,annotation:e,transform:n,untransform:s}}const JS=[ll(FS,"undefined",()=>null,()=>{}),ll(Vj,"bigint",t=>t.toString(),t=>typeof BigInt<"u"?BigInt(t):(console.error("Please add a BigInt polyfill."),t)),ll(Pj,"Date",t=>t.toISOString(),t=>new Date(t)),ll(IS,"Error",(t,e)=>{const n={name:t.name,message:t.message};return"cause"in t&&(n.cause=t.cause),e.allowedErrorProps.forEach(s=>{n[s]=t[s]}),n},(t,e)=>{const n=new Error(t.message,{cause:t.cause});return n.name=t.name,n.stack=t.stack,e.allowedErrorProps.forEach(s=>{n[s]=t[s]}),n}),ll(Gj,"regexp",t=>""+t,t=>{const e=t.slice(1,t.lastIndexOf("/")),n=t.slice(t.lastIndexOf("/")+1);return new RegExp(e,n)}),ll(Om,"set",t=>[...t.values()],t=>new Set(t)),ll(Rm,"map",t=>[...t.entries()],t=>new Map(t)),ll(t=>r3(t)||Qj(t),"number",t=>r3(t)?"NaN":t>0?"Infinity":"-Infinity",Number),ll(t=>t===0&&1/t===-1/0,"number",()=>"-0",Number),ll(Xj,"URL",t=>t.toString(),t=>new URL(t))];function Q1(t,e,n,s){return{isApplicable:t,annotation:e,transform:n,untransform:s}}const WS=Q1((t,e)=>ZS(t)?!!e.symbolRegistry.getIdentifier(t):!1,(t,e)=>["symbol",e.symbolRegistry.getIdentifier(t)],t=>t.description,(t,e,n)=>{const s=n.symbolRegistry.getValue(e[1]);if(!s)throw new Error("Trying to deserialize unknown symbol");return s}),Fj=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((t,e)=>(t[e.name]=e,t),{}),$S=Q1(Kj,t=>["typed-array",t.constructor.name],t=>[...t],(t,e)=>{const n=Fj[e[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(t)});function e6(t,e){return t!=null&&t.constructor?!!e.classRegistry.getIdentifier(t.constructor):!1}const t6=Q1(e6,(t,e)=>["class",e.classRegistry.getIdentifier(t.constructor)],(t,e)=>{const n=e.classRegistry.getAllowedProps(t.constructor);if(!n)return{...t};const s={};return n.forEach(i=>{s[i]=t[i]}),s},(t,e,n)=>{const s=n.classRegistry.getValue(e[1]);if(!s)throw new Error(`Trying to deserialize unknown class '${e[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(s.prototype),t)}),n6=Q1((t,e)=>!!e.customTransformerRegistry.findApplicable(t),(t,e)=>["custom",e.customTransformerRegistry.findApplicable(t).name],(t,e)=>e.customTransformerRegistry.findApplicable(t).serialize(t),(t,e,n)=>{const s=n.customTransformerRegistry.findByName(e[1]);if(!s)throw new Error("Trying to deserialize unknown custom value");return s.deserialize(t)}),Zj=[t6,WS,n6,$S],i3=(t,e)=>{const n=s3(Zj,i=>i.isApplicable(t,e));if(n)return{value:n.transform(t,e),type:n.annotation(t,e)};const s=s3(JS,i=>i.isApplicable(t,e));if(s)return{value:s.transform(t,e),type:s.annotation}},a6={};JS.forEach(t=>{a6[t.annotation]=t});const Ij=(t,e,n)=>{if(Dc(e))switch(e[0]){case"symbol":return WS.untransform(t,e,n);case"class":return t6.untransform(t,e,n);case"custom":return n6.untransform(t,e,n);case"typed-array":return $S.untransform(t,e,n);default:throw new Error("Unknown transformation: "+e)}else{const s=a6[e];if(!s)throw new Error("Unknown transformation: "+e);return s.untransform(t,n)}},Of=(t,e)=>{if(e>t.size)throw new Error("index out of bounds");const n=t.keys();for(;e>0;)n.next(),e--;return n.next().value};function s6(t){if(m1(t,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(m1(t,"prototype"))throw new Error("prototype is not allowed as a property");if(m1(t,"constructor"))throw new Error("constructor is not allowed as a property")}const Jj=(t,e)=>{s6(e);for(let n=0;n<e.length;n++){const s=e[n];if(Om(t))t=Of(t,+s);else if(Rm(t)){const i=+s,o=+e[++n]==0?"key":"value",d=Of(t,i);switch(o){case"key":t=d;break;case"value":t=t.get(d);break}}else t=t[s]}return t},mb=(t,e,n)=>{if(s6(e),e.length===0)return n(t);let s=t;for(let o=0;o<e.length-1;o++){const d=e[o];if(Dc(s)){const f=+d;s=s[f]}else if(Tm(s))s=s[d];else if(Om(s)){const f=+d;s=Of(s,f)}else if(Rm(s)){if(o===e.length-2)break;const p=+d,y=+e[++o]==0?"key":"value",S=Of(s,p);switch(y){case"key":s=S;break;case"value":s=s.get(S);break}}}const i=e[e.length-1];if(Dc(s)?s[+i]=n(s[+i]):Tm(s)&&(s[i]=n(s[i])),Om(s)){const o=Of(s,+i),d=n(o);o!==d&&(s.delete(o),s.add(d))}if(Rm(s)){const o=+e[e.length-2],d=Of(s,o);switch(+i==0?"key":"value"){case"key":{const p=n(d);s.set(p,s.get(d)),p!==d&&s.delete(d);break}case"value":{s.set(d,n(s.get(d)));break}}}return t},r6=t=>t<1;function gb(t,e,n,s=[]){if(!t)return;const i=r6(n);if(!Dc(t)){$f(t,(f,p)=>gb(f,e,n,[...s,...mm(p,i)]));return}const[o,d]=t;d&&$f(d,(f,p)=>{gb(f,e,n,[...s,...mm(p,i)])}),e(o,s)}function Wj(t,e,n,s){return gb(e,(i,o)=>{t=mb(t,o,d=>Ij(d,i,s))},n),t}function $j(t,e,n){const s=r6(n);function i(o,d){const f=Jj(t,mm(d,s));o.map(p=>mm(p,s)).forEach(p=>{t=mb(t,p,()=>f)})}if(Dc(e)){const[o,d]=e;o.forEach(f=>{t=mb(t,mm(f,s),()=>t)}),d&&$f(d,i)}else $f(e,i);return t}const ew=(t,e)=>Tm(t)||Dc(t)||Rm(t)||Om(t)||IS(t)||e6(t,e);function tw(t,e,n){const s=n.get(t);s?s.push(e):n.set(t,[e])}function nw(t,e){const n={};let s;return t.forEach(i=>{if(i.length<=1)return;e||(i=i.map(f=>f.map(String)).sort((f,p)=>f.length-p.length));const[o,...d]=i;o.length===0?s=d.map(ix):n[ix(o)]=d.map(ix)}),s?hb(n)?[s]:[s,n]:hb(n)?void 0:n}const i6=(t,e,n,s,i=[],o=[],d=new Map)=>{const f=Yj(t);if(!f){tw(t,i,e);const j=d.get(t);if(j)return s?{transformedValue:null}:j}if(!ew(t,n)){const j=i3(t,n),w=j?{transformedValue:j.value,annotations:[j.type]}:{transformedValue:t};return f||d.set(t,w),w}if(m1(o,t))return{transformedValue:null};const p=i3(t,n),y=(p==null?void 0:p.value)??t,S=Dc(y)?[]:{},b={};$f(y,(j,w)=>{if(w==="__proto__"||w==="constructor"||w==="prototype")throw new Error(`Detected property ${w}. This is a prototype pollution risk, please remove it from your object.`);const T=i6(j,e,n,s,[...i,w],[...o,t],d);S[w]=T.transformedValue,Dc(T.annotations)?b[pb(w)]=T.annotations:Tm(T.annotations)&&$f(T.annotations,(O,R)=>{b[pb(w)+"."+R]=O})});const _=hb(b)?{transformedValue:S,annotations:p?[p.type]:void 0}:{transformedValue:S,annotations:p?[p.type,b]:b};return f||d.set(t,_),_};function l6(t){return Object.prototype.toString.call(t).slice(8,-1)}function l3(t){return l6(t)==="Array"}function aw(t){if(l6(t)!=="Object")return!1;const e=Object.getPrototypeOf(t);return!!e&&e.constructor===Object&&e===Object.prototype}function sw(t,e,n,s,i){const o={}.propertyIsEnumerable.call(s,e)?"enumerable":"nonenumerable";o==="enumerable"&&(t[e]=n),i&&o==="nonenumerable"&&Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})}function yb(t,e={}){if(l3(t))return t.map(i=>yb(i,e));if(!aw(t))return t;const n=Object.getOwnPropertyNames(t),s=Object.getOwnPropertySymbols(t);return[...n,...s].reduce((i,o)=>{if(o==="__proto__"||l3(e.props)&&!e.props.includes(o))return i;const d=t[o],f=yb(d,e);return sw(i,o,f,t,e.nonenumerable),i},{})}class kt{constructor({dedupe:e=!1}={}){this.classRegistry=new Aj,this.symbolRegistry=new XS(n=>n.description??""),this.customTransformerRegistry=new kj,this.allowedErrorProps=[],this.dedupe=e}serialize(e){const n=new Map,s=i6(e,n,this,this.dedupe),i={json:s.transformedValue};s.annotations&&(i.meta={...i.meta,values:s.annotations});const o=nw(n,this.dedupe);return o&&(i.meta={...i.meta,referentialEqualities:o}),i.meta&&(i.meta.v=1),i}deserialize(e,n){const{json:s,meta:i}=e;let o=n!=null&&n.inPlace?s:yb(s);return i!=null&&i.values&&(o=Wj(o,i.values,i.v??0,this)),i!=null&&i.referentialEqualities&&(o=$j(o,i.referentialEqualities,i.v??0)),o}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e),{inPlace:!0})}registerClass(e,n){this.classRegistry.register(e,n)}registerSymbol(e,n){this.symbolRegistry.register(e,n)}registerCustom(e,n){this.customTransformerRegistry.register({name:n,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}}kt.defaultInstance=new kt;kt.serialize=kt.defaultInstance.serialize.bind(kt.defaultInstance);kt.deserialize=kt.defaultInstance.deserialize.bind(kt.defaultInstance);kt.stringify=kt.defaultInstance.stringify.bind(kt.defaultInstance);kt.parse=kt.defaultInstance.parse.bind(kt.defaultInstance);kt.registerClass=kt.defaultInstance.registerClass.bind(kt.defaultInstance);kt.registerSymbol=kt.defaultInstance.registerSymbol.bind(kt.defaultInstance);kt.registerCustom=kt.defaultInstance.registerCustom.bind(kt.defaultInstance);kt.allowErrorProps=kt.defaultInstance.allowErrorProps.bind(kt.defaultInstance);kt.serialize;kt.deserialize;kt.stringify;kt.parse;kt.registerClass;kt.registerCustom;kt.registerSymbol;kt.allowErrorProps;D.createContext(null);var rw=Object.create,o6=Object.defineProperty,iw=Object.getOwnPropertyDescriptor,c6=Object.getOwnPropertyNames,lw=Object.getPrototypeOf,ow=Object.prototype.hasOwnProperty,vl=(t,e)=>function(){return e||(0,t[c6(t)[0]])((e={exports:{}}).exports,e),e.exports},cw=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(var i=c6(e),o=0,d=i.length,f;o<d;o++)f=i[o],!ow.call(t,f)&&f!==n&&o6(t,f,{get:(p=>e[p]).bind(null,f),enumerable:!(s=iw(e,f))||s.enumerable});return t},xa=(t,e,n)=>(n=t!=null?rw(lw(t)):{},cw(e||!t||!t.__esModule?o6(n,"default",{value:t,enumerable:!0}):n,t)),u6=vl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(t,e){function n(s){"@babel/helpers - typeof";return e.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},e.exports.__esModule=!0,e.exports.default=e.exports,n(s)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),uw=vl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(t,e){var n=u6().default;function s(i,o){if(n(i)!="object"||!i)return i;var d=i[Symbol.toPrimitive];if(d!==void 0){var f=d.call(i,o||"default");if(n(f)!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(i)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),dw=vl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(t,e){var n=u6().default,s=uw();function i(o){var d=s(o,"string");return n(d)=="symbol"?d:d+""}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}}),sd=vl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(t,e){var n=dw();function s(i,o,d){return(o=n(o))in i?Object.defineProperty(i,o,{value:d,enumerable:!0,configurable:!0,writable:!0}):i[o]=d,i}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),Ri=vl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(t,e){var n=sd();function s(o,d){var f=Object.keys(o);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(o);d&&(p=p.filter(function(y){return Object.getOwnPropertyDescriptor(o,y).enumerable})),f.push.apply(f,p)}return f}function i(o){for(var d=1;d<arguments.length;d++){var f=arguments[d]!=null?arguments[d]:{};d%2?s(Object(f),!0).forEach(function(p){n(o,p,f[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(f)):s(Object(f)).forEach(function(p){Object.defineProperty(o,p,Object.getOwnPropertyDescriptor(f,p))})}return o}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}});function ch(t){const e={subscribe(n){let s=null,i=!1,o=!1,d=!1;function f(){if(s===null){d=!0;return}o||(o=!0,typeof s=="function"?s():s&&s.unsubscribe())}return s=t({next(p){var y;i||(y=n.next)===null||y===void 0||y.call(n,p)},error(p){var y;i||(i=!0,(y=n.error)===null||y===void 0||y.call(n,p),f())},complete(){var p;i||(i=!0,(p=n.complete)===null||p===void 0||p.call(n),f())}}),d&&f(),{unsubscribe:f}},pipe(...n){return n.reduce(fw,e)}};return e}function fw(t,e){return e(t)}function hw(t){const e=new AbortController;return new Promise((s,i)=>{let o=!1;function d(){o||(o=!0,f.unsubscribe())}e.signal.addEventListener("abort",()=>{i(e.signal.reason)});const f=t.subscribe({next(p){o=!0,s(p),d()},error(p){i(p)},complete(){e.abort(),d()}})})}function pw(t){return e=>{let n=0,s=null;const i=[];function o(){s||(s=e.subscribe({next(f){for(const y of i){var p;(p=y.next)===null||p===void 0||p.call(y,f)}},error(f){for(const y of i){var p;(p=y.error)===null||p===void 0||p.call(y,f)}},complete(){for(const p of i){var f;(f=p.complete)===null||f===void 0||f.call(p)}}}))}function d(){if(n===0&&s){const f=s;s=null,f.unsubscribe()}}return ch(f=>(n++,i.push(f),o(),{unsubscribe(){n--,d();const p=i.findIndex(y=>y===f);p>-1&&i.splice(p,1)}}))}}function d6(t){let e=t;const n=[],s=d=>{e!==void 0&&d.next(e),n.push(d)},i=d=>{n.splice(n.indexOf(d),1)},o=ch(d=>(s(d),()=>{i(d)}));return o.next=d=>{if(e!==d){e=d;for(const f of n)f.next(d)}},o.get=()=>e,o}function mw(t){return ch(e=>{function n(i=0,o=t.op){const d=t.links[i];if(!d)throw new Error("No more links to execute - did you forget to add an ending link?");return d({op:o,next(p){return n(i+1,p)}})}return n().subscribe(e)})}function Mm(t){return!!t&&!Array.isArray(t)&&typeof t=="object"}function gw(){return Object.create(null)}const o3=t=>t();function c3(t=0){return new Promise(e=>setTimeout(e,t))}var yw=Object.create,f6=Object.defineProperty,xw=Object.getOwnPropertyDescriptor,h6=Object.getOwnPropertyNames,bw=Object.getPrototypeOf,vw=Object.prototype.hasOwnProperty,Zm=(t,e)=>function(){return e||(0,t[h6(t)[0]])((e={exports:{}}).exports,e),e.exports},Sw=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(var i=h6(e),o=0,d=i.length,f;o<d;o++)f=i[o],!vw.call(t,f)&&f!==n&&f6(t,f,{get:(p=>e[p]).bind(null,f),enumerable:!(s=xw(e,f))||s.enumerable});return t},K1=(t,e,n)=>(n=t!=null?yw(bw(t)):{},Sw(f6(n,"default",{value:t,enumerable:!0}),t));const p6=()=>{},u3=t=>{Object.freeze&&Object.freeze(t)};function m6(t,e,n){var s;const i=e.join(".");return(s=n[i])!==null&&s!==void 0||(n[i]=new Proxy(p6,{get(o,d){if(!(typeof d!="string"||d==="then"))return m6(t,[...e,d],n)},apply(o,d,f){const p=e[e.length-1];let y={args:f,path:e};return p==="call"?y={args:f.length>=2?[f[1]]:[],path:e.slice(0,-1)}:p==="apply"&&(y={args:f.length>=2?f[1]:[],path:e.slice(0,-1)}),u3(y.args),u3(y.path),t(y)}})),n[i]}const Nw=t=>m6(t,[],gw()),_w=t=>new Proxy(p6,{get(e,n){if(n!=="then")return t(n)}});var g6=Zm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(t,e){function n(s){"@babel/helpers - typeof";return e.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},e.exports.__esModule=!0,e.exports.default=e.exports,n(s)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),Cw=Zm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(t,e){var n=g6().default;function s(i,o){if(n(i)!="object"||!i)return i;var d=i[Symbol.toPrimitive];if(d!==void 0){var f=d.call(i,o||"default");if(n(f)!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(i)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),jw=Zm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(t,e){var n=g6().default,s=Cw();function i(o){var d=s(o,"string");return n(d)=="symbol"?d:d+""}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}}),y6=Zm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(t,e){var n=jw();function s(i,o,d){return(o=n(o))in i?Object.defineProperty(i,o,{value:d,enumerable:!0,configurable:!0,writable:!0}):i[o]=d,i}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),cv=Zm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(t,e){var n=y6();function s(o,d){var f=Object.keys(o);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(o);d&&(p=p.filter(function(y){return Object.getOwnPropertyDescriptor(o,y).enumerable})),f.push.apply(f,p)}return f}function i(o){for(var d=1;d<arguments.length;d++){var f=arguments[d]!=null?arguments[d]:{};d%2?s(Object(f),!0).forEach(function(p){n(o,p,f[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(f)):s(Object(f)).forEach(function(p){Object.defineProperty(o,p,Object.getOwnPropertyDescriptor(f,p))})}return o}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}});K1(cv());K1(y6());var V0=K1(cv());function ww(t,e){if("error"in t){const s=e.deserialize(t.error);return{ok:!1,error:(0,V0.default)((0,V0.default)({},t),{},{error:s})}}return{ok:!0,result:(0,V0.default)((0,V0.default)({},t.result),(!t.result.type||t.result.type==="data")&&{type:"data",data:e.deserialize(t.result.data)})}}var lx=class extends Error{constructor(){super("Unable to transform response from server")}};function x6(t,e){let n;try{n=ww(t,e)}catch{throw new lx}if(!n.ok&&(!Mm(n.error.error)||typeof n.error.error.code!="number"))throw new lx;if(n.ok&&!Mm(n.result))throw new lx;return n}K1(cv());var Q0=xa(sd(),1),Cf=xa(Ri(),1);function Ew(t){return t instanceof uo}function Tw(t){return Mm(t)&&Mm(t.error)&&typeof t.error.code=="number"&&typeof t.error.message=="string"}function Rw(t,e){return typeof t=="string"?t:Mm(t)&&typeof t.message=="string"?t.message:e}var uo=class g1 extends Error{constructor(e,n){var s,i;const o=n==null?void 0:n.cause;super(e,{cause:o}),(0,Q0.default)(this,"cause",void 0),(0,Q0.default)(this,"shape",void 0),(0,Q0.default)(this,"data",void 0),(0,Q0.default)(this,"meta",void 0),this.meta=n==null?void 0:n.meta,this.cause=o,this.shape=n==null||(s=n.result)===null||s===void 0?void 0:s.error,this.data=n==null||(i=n.result)===null||i===void 0?void 0:i.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,g1.prototype)}static from(e,n={}){const s=e;return Ew(s)?(n.meta&&(s.meta=(0,Cf.default)((0,Cf.default)({},s.meta),n.meta)),s):Tw(s)?new g1(s.error.message,(0,Cf.default)((0,Cf.default)({},n),{},{result:s,cause:n.cause})):new g1(Rw(s,"Unknown error"),(0,Cf.default)((0,Cf.default)({},n),{},{cause:s}))}};function b6(t){const e=t;return e?"input"in e?e:{input:e,output:e}:{input:{serialize:n=>n,deserialize:n=>n},output:{serialize:n=>n,deserialize:n=>n}}}const d3=t=>typeof t=="function";function Ow(t){if(t)return t;if(typeof window<"u"&&d3(window.fetch))return window.fetch;if(typeof globalThis<"u"&&d3(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var gm=xa(Ri());function Mw(t){return{url:t.url.toString(),fetch:t.fetch,transformer:b6(t.transformer),methodOverride:t.methodOverride}}function Aw(t){const e={};for(let n=0;n<t.length;n++){const s=t[n];e[n]=s}return e}const Dw={query:"GET",mutation:"POST",subscription:"PATCH"};function v6(t){return"input"in t?t.transformer.input.serialize(t.input):Aw(t.inputs.map(e=>t.transformer.input.serialize(e)))}const xb=t=>{const e=t.url.split("?");let s=e[0].replace(/\/$/,"")+"/"+t.path;const i=[];if(e[1]&&i.push(e[1]),"inputs"in t&&i.push("batch=1"),t.type==="query"||t.type==="subscription"){const o=v6(t);o!==void 0&&t.methodOverride!=="POST"&&i.push(`input=${encodeURIComponent(JSON.stringify(o))}`)}return i.length&&(s+="?"+i.join("&")),s},zw=t=>{if(t.type==="query"&&t.methodOverride!=="POST")return;const e=v6(t);return e!==void 0?JSON.stringify(e):void 0},kw=t=>bb((0,gm.default)((0,gm.default)({},t),{},{contentTypeHeader:"application/json",getUrl:xb,getBody:zw}));var Lw=class extends Error{constructor(){const t="AbortError";super(t),this.name=t,this.message=t}};const Uw=t=>{var e;if(t!=null&&t.aborted)throw(e=t.throwIfAborted)===null||e===void 0||e.call(t),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new Lw};async function qw(t){var e,n;Uw(t.signal);const s=t.getUrl(t),i=t.getBody(t),o=(e=t.methodOverride)!==null&&e!==void 0?e:Dw[t.type],d=await(async()=>{const p=await t.headers();return Symbol.iterator in p?Object.fromEntries(p):p})(),f=(0,gm.default)((0,gm.default)((0,gm.default)({},t.contentTypeHeader&&o!=="GET"?{"content-type":t.contentTypeHeader}:{}),t.trpcAcceptHeader?{[(n=t.trpcAcceptHeaderKey)!==null&&n!==void 0?n:"trpc-accept"]:t.trpcAcceptHeader}:void 0),d);return Ow(t.fetch)(s,{method:o,signal:t.signal,body:i,headers:f})}async function bb(t){const e={},n=await qw(t);e.response=n;const s=await n.json();return e.responseJSON=s,{json:s,meta:e}}function Hw(t){return t instanceof Uint8Array||t instanceof Blob}function Bw(t){return t instanceof FormData}var Mf=xa(Ri(),1);const Gw=t=>{if("input"in t){const{input:e}=t;if(Bw(e)){if(t.type!=="mutation"&&t.methodOverride!=="POST")throw new Error("FormData is only supported for mutations");return bb((0,Mf.default)((0,Mf.default)({},t),{},{contentTypeHeader:void 0,getUrl:xb,getBody:()=>e}))}if(Hw(e)){if(t.type!=="mutation"&&t.methodOverride!=="POST")throw new Error("Octet type input is only supported for mutations");return bb((0,Mf.default)((0,Mf.default)({},t),{},{contentTypeHeader:"application/octet-stream",getUrl:xb,getBody:()=>e}))}}return kw(t)};function Pw(t){const e=Mw(t);return()=>n=>{const{op:s}=n;return ch(i=>{const{path:o,input:d,type:f}=s;/* istanbul ignore if -- @preserve */if(f==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const p=Gw((0,Mf.default)((0,Mf.default)({},e),{},{type:f,path:o,input:d,signal:s.signal,headers(){return t.headers?typeof t.headers=="function"?t.headers({op:s}):t.headers:{}}}));let y;return p.then(S=>{y=S.meta;const b=x6(S.json,e.transformer.output);if(!b.ok){i.error(uo.from(b.error,{meta:y}));return}i.next({context:S.meta,result:b.result}),i.complete()}).catch(S=>{i.error(uo.from(S,{meta:y}))}),()=>{}})}}xa(Ri(),1);xa(Ri(),1);const Yw={encode:t=>JSON.stringify(t),decode:t=>{if(typeof t!="string")throw new Error("jsonEncoder received binary data. JSON uses text frames. Use a binary encoder for binary data.");return JSON.parse(t)}},Vw={enabled:!1,closeMs:0},Qw={enabled:!1,pongTimeoutMs:1e3,intervalMs:5e3},Kw=t=>t===0?0:Math.min(1e3*2**t,3e4),S6=(t,...e)=>typeof t=="function"?t(...e):t;var Xw=xa(sd(),1),jf=class N6 extends Error{constructor(e){super(e.message,{cause:e.cause}),this.name="TRPCWebSocketClosedError",Object.setPrototypeOf(this,N6.prototype)}},Fw=class{constructor(t,e){this.onTimeout=t,this.timeoutMs=e,(0,Xw.default)(this,"timeout",void 0)}reset(){this.timeout&&(clearTimeout(this.timeout),this.timeout=setTimeout(this.onTimeout,this.timeoutMs))}start(){clearTimeout(this.timeout),this.timeout=setTimeout(this.onTimeout,this.timeoutMs)}stop(){clearTimeout(this.timeout),this.timeout=void 0}};function _6(){let t,e;return{promise:new Promise((s,i)=>{t=s,e=i}),resolve:t,reject:e}}async function Zw(t){const e=await S6(t.url);if(!t.connectionParams)return e;const s=`${e.includes("?")?"&":"?"}connectionParams=1`;return e+s}async function Iw(t,e){const n={method:"connectionParams",data:await S6(t)};return e.encode(n)}var f3=xa(sd(),1),Jw=class{constructor(){(0,f3.default)(this,"outgoingRequests",new Array),(0,f3.default)(this,"pendingRequests",{})}register(t,e){const{promise:n,resolve:s}=_6();return this.outgoingRequests.push({id:String(t.id),message:t,end:n,callbacks:{next:e.next,complete:()=>{e.complete(),s()},error:i=>{e.error(i),s()}}}),()=>{this.delete(t.id),e.complete(),s()}}delete(t){t!==null&&(this.outgoingRequests=this.outgoingRequests.filter(({id:e})=>e!==String(t)),delete this.pendingRequests[String(t)])}flush(){const t=this.outgoingRequests;this.outgoingRequests=[];for(const e of t)this.pendingRequests[e.id]=e;return t}getPendingRequests(){return Object.values(this.pendingRequests)}getPendingRequest(t){return t===null?null:this.pendingRequests[String(t)]}getOutgoingRequests(){return this.outgoingRequests}getRequests(){return[...this.getOutgoingRequests().map(t=>({state:"outgoing",message:t.message,end:t.end,callbacks:t.callbacks})),...this.getPendingRequests().map(t=>({state:"pending",message:t.message,end:t.end,callbacks:t.callbacks}))]}hasPendingRequests(){return this.getPendingRequests().length>0}hasPendingSubscriptions(){return this.getPendingRequests().some(t=>t.message.method==="subscription")}hasOutgoingRequests(){return this.outgoingRequests.length>0}},mc=xa(sd(),1);function Ww(t){const{promise:e,resolve:n,reject:s}=_6();return t.addEventListener("open",()=>{t.removeEventListener("error",s),n()}),t.addEventListener("error",s),e}function $w(t,{intervalMs:e,pongTimeoutMs:n}){let s,i;function o(){s=setTimeout(()=>{t.send("PING"),i=setTimeout(()=>{t.close()},n)},e)}function d(){clearTimeout(s),o()}function f(){clearTimeout(i),d()}t.addEventListener("open",o),t.addEventListener("message",({data:p})=>{clearTimeout(s),o(),p==="PONG"&&f()}),t.addEventListener("close",()=>{clearTimeout(s),clearTimeout(i)})}var C6=class vb{constructor(e){var n;if((0,mc.default)(this,"id",++vb.connectCount),(0,mc.default)(this,"WebSocketPonyfill",void 0),(0,mc.default)(this,"urlOptions",void 0),(0,mc.default)(this,"keepAliveOpts",void 0),(0,mc.default)(this,"encoder",void 0),(0,mc.default)(this,"wsObservable",d6(null)),(0,mc.default)(this,"openPromise",null),this.WebSocketPonyfill=(n=e.WebSocketPonyfill)!==null&&n!==void 0?n:WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=e.urlOptions,this.keepAliveOpts=e.keepAlive,this.encoder=e.encoder}get ws(){return this.wsObservable.get()}set ws(e){this.wsObservable.next(e)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){var e=this;if(e.openPromise)return e.openPromise;e.id=++vb.connectCount;const n=Zw(e.urlOptions).then(s=>new e.WebSocketPonyfill(s));e.openPromise=n.then(async s=>{e.ws=s,s.binaryType="arraybuffer",s.addEventListener("message",function({data:i}){i==="PING"&&this.send("PONG")}),e.keepAliveOpts.enabled&&$w(s,e.keepAliveOpts),s.addEventListener("close",()=>{e.ws===s&&(e.ws=null)}),await Ww(s),e.urlOptions.connectionParams&&s.send(await Iw(e.urlOptions.connectionParams,e.encoder))});try{await e.openPromise}finally{e.openPromise=null}}async close(){var e=this;try{await e.openPromise}finally{var n;(n=e.ws)===null||n===void 0||n.close()}}};(0,mc.default)(C6,"connectCount",0);function eE(t){return t.isOpen()?{id:t.id,state:"open",ws:t.ws}:t.isClosed()?{id:t.id,state:"closed",ws:t.ws}:t.ws?{id:t.id,state:"connecting",ws:t.ws}:null}var ol=xa(sd(),1),wf=xa(Ri(),1),tE=class{constructor(t){var e,n;(0,ol.default)(this,"connectionState",void 0),(0,ol.default)(this,"allowReconnect",!1),(0,ol.default)(this,"requestManager",new Jw),(0,ol.default)(this,"activeConnection",void 0),(0,ol.default)(this,"reconnectRetryDelay",void 0),(0,ol.default)(this,"inactivityTimeout",void 0),(0,ol.default)(this,"callbacks",void 0),(0,ol.default)(this,"lazyMode",void 0),(0,ol.default)(this,"encoder",void 0),(0,ol.default)(this,"reconnecting",null),this.encoder=(e=t.experimental_encoder)!==null&&e!==void 0?e:Yw,this.callbacks={onOpen:t.onOpen,onClose:t.onClose,onError:t.onError};const s=(0,wf.default)((0,wf.default)({},Vw),t.lazy);this.inactivityTimeout=new Fw(()=>{if(this.requestManager.hasOutgoingRequests()||this.requestManager.hasPendingRequests()){this.inactivityTimeout.reset();return}this.close().catch(()=>null)},s.closeMs),this.activeConnection=new C6({WebSocketPonyfill:t.WebSocket,urlOptions:t,keepAlive:(0,wf.default)((0,wf.default)({},Qw),t.keepAlive),encoder:this.encoder}),this.activeConnection.wsObservable.subscribe({next:i=>{i&&this.setupWebSocketListeners(i)}}),this.reconnectRetryDelay=(n=t.retryDelayMs)!==null&&n!==void 0?n:Kw,this.lazyMode=s.enabled,this.connectionState=d6({type:"state",state:s.enabled?"idle":"connecting",error:null}),this.lazyMode||this.open().catch(()=>null)}async open(){var t=this;t.allowReconnect=!0,t.connectionState.get().state==="idle"&&t.connectionState.next({type:"state",state:"connecting",error:null});try{await t.activeConnection.open()}catch(e){return t.reconnect(new jf({message:"Initialization error",cause:e})),t.reconnecting}}async close(){var t=this;t.allowReconnect=!1,t.inactivityTimeout.stop();const e=[];for(const n of t.requestManager.getRequests())n.message.method==="subscription"?n.callbacks.complete():n.state==="outgoing"?n.callbacks.error(uo.from(new jf({message:"Closed before connection was established"}))):e.push(n.end);await Promise.all(e).catch(()=>null),await t.activeConnection.close().catch(()=>null),t.connectionState.next({type:"state",state:"idle",error:null})}request({op:{id:t,type:e,path:n,input:s,signal:i},transformer:o,lastEventId:d}){return ch(f=>{const p=this.batchSend({id:t,method:e,params:{input:o.input.serialize(s),path:n,lastEventId:d}},(0,wf.default)((0,wf.default)({},f),{},{next(y){const S=x6(y,o.output);if(!S.ok){f.error(uo.from(S.error));return}f.next({result:S.result})}}));return()=>{p(),e==="subscription"&&this.activeConnection.isOpen()&&this.send({id:t,method:"subscription.stop"}),i==null||i.removeEventListener("abort",p)}})}get connection(){return eE(this.activeConnection)}reconnect(t){var e=this;if(this.connectionState.next({type:"state",state:"connecting",error:uo.from(t)}),this.reconnecting)return;const n=async s=>{try{await c3(e.reconnectRetryDelay(s)),e.allowReconnect&&(await e.activeConnection.close(),await e.activeConnection.open(),e.requestManager.hasPendingRequests()&&e.send(e.requestManager.getPendingRequests().map(({message:i})=>i))),e.reconnecting=null}catch{await n(s+1)}};this.reconnecting=n(0)}setupWebSocketListeners(t){var e=this;const n=s=>{const i=this.requestManager.getPendingRequests();for(const{message:o,callbacks:d}of i)o.method!=="subscription"&&(d.error(uo.from(s??new jf({message:"WebSocket closed",cause:s}))),this.requestManager.delete(o.id))};t.addEventListener("open",()=>{o3(async()=>{var s,i;e.lazyMode&&e.inactivityTimeout.start(),(s=(i=e.callbacks).onOpen)===null||s===void 0||s.call(i),e.connectionState.next({type:"state",state:"pending",error:null})}).catch(s=>{t.close(3e3),n(s)})}),t.addEventListener("message",({data:s})=>{if(this.inactivityTimeout.reset(),["PING","PONG"].includes(s))return;const i=this.encoder.decode(s);if("method"in i){this.handleIncomingRequest(i);return}this.handleResponseMessage(i)}),t.addEventListener("close",s=>{var i,o;n(s),(i=(o=this.callbacks).onClose)===null||i===void 0||i.call(o,s),(!this.lazyMode||this.requestManager.hasPendingSubscriptions())&&this.reconnect(new jf({message:"WebSocket closed",cause:s}))}),t.addEventListener("error",s=>{var i,o;n(s),(i=(o=this.callbacks).onError)===null||i===void 0||i.call(o,s),this.reconnect(new jf({message:"WebSocket closed",cause:s}))})}handleResponseMessage(t){const e=this.requestManager.getPendingRequest(t.id);if(!e)return;e.callbacks.next(t);let n=!0;"result"in t&&e.message.method==="subscription"&&(t.result.type==="data"&&(e.message.params.lastEventId=t.result.id),t.result.type!=="stopped"&&(n=!1)),n&&(e.callbacks.complete(),this.requestManager.delete(t.id))}handleIncomingRequest(t){t.method==="reconnect"&&this.reconnect(new jf({message:"Server requested reconnect"}))}send(t){if(!this.activeConnection.isOpen())throw new Error("Active connection is not open");const e=t instanceof Array?t:[t];this.activeConnection.ws.send(this.encoder.encode(e.length===1?e[0]:e))}batchSend(t,e){var n=this;return this.inactivityTimeout.reset(),o3(async()=>{n.activeConnection.isOpen()||await n.open(),await c3(0),n.requestManager.hasOutgoingRequests()&&n.send(n.requestManager.flush().map(({message:s})=>s))}).catch(s=>{this.requestManager.delete(t.id),e.error(uo.from(s))}),this.requestManager.register(t,e)}};function nE(t){return new tE(t)}function aE(t){const{client:e}=t,n=b6(t.transformer);return()=>({op:s})=>ch(i=>{const o=s.type==="subscription"?e.connectionState.subscribe({next(f){i.next({result:f,context:s.context})}}):null,d=e.request({op:s,transformer:n}).subscribe(i);return()=>{d.unsubscribe(),o==null||o.unsubscribe()}})}var ox=xa(sd(),1),h3=xa(Ri(),1),sE=class{constructor(t){(0,ox.default)(this,"links",void 0),(0,ox.default)(this,"runtime",void 0),(0,ox.default)(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=t.links.map(e=>e(this.runtime))}$request(t){var e;return mw({links:this.links,op:(0,h3.default)((0,h3.default)({},t),{},{context:(e=t.context)!==null&&e!==void 0?e:{},id:++this.requestId})}).pipe(pw())}async requestAsPromise(t){var e=this;try{const n=e.$request(t);return(await hw(n)).result.data}catch(n){throw uo.from(n)}}query(t,e,n){return this.requestAsPromise({type:"query",path:t,input:e,context:n==null?void 0:n.context,signal:n==null?void 0:n.signal})}mutation(t,e,n){return this.requestAsPromise({type:"mutation",path:t,input:e,context:n==null?void 0:n.context,signal:n==null?void 0:n.signal})}subscription(t,e,n){return this.$request({type:"subscription",path:t,input:e,context:n.context,signal:n.signal}).subscribe({next(i){switch(i.result.type){case"state":{var o;(o=n.onConnectionStateChange)===null||o===void 0||o.call(n,i.result);break}case"started":{var d;(d=n.onStarted)===null||d===void 0||d.call(n,{context:i.context});break}case"stopped":{var f;(f=n.onStopped)===null||f===void 0||f.call(n);break}case"data":case void 0:{var p;(p=n.onData)===null||p===void 0||p.call(n,i.result.data);break}}},error(i){var o;(o=n.onError)===null||o===void 0||o.call(n,i)},complete(){var i;(i=n.onComplete)===null||i===void 0||i.call(n)}})}};const rE=Symbol.for("trpc_untypedClient"),iE={query:"query",mutate:"mutation",subscribe:"subscription"},lE=t=>iE[t];function oE(t){const e=Nw(({path:n,args:s})=>{const i=[...n],o=lE(i.pop()),d=i.join(".");return t[o](d,...s)});return _w(n=>n===rE?t:e[n])}function p3(t){const e=new sE(t);return oE(e)}xa(Ri(),1);xa(Ri(),1);var cE=vl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(t,e){function n(i){var o,d,f,p=2;for(typeof Symbol<"u"&&(d=Symbol.asyncIterator,f=Symbol.iterator);p--;){if(d&&(o=i[d])!=null)return o.call(i);if(f&&(o=i[f])!=null)return new s(o.call(i));d="@@asyncIterator",f="@@iterator"}throw new TypeError("Object is not async iterable")}function s(i){function o(d){if(Object(d)!==d)return Promise.reject(new TypeError(d+" is not an object."));var f=d.done;return Promise.resolve(d.value).then(function(p){return{value:p,done:f}})}return s=function(f){this.s=f,this.n=f.next},s.prototype={s:null,n:null,next:function(){return o(this.n.apply(this.s,arguments))},return:function(f){var p=this.s.return;return p===void 0?Promise.resolve({value:f,done:!0}):o(p.apply(this.s,arguments))},throw:function(f){var p=this.s.return;return p===void 0?Promise.reject(f):o(p.apply(this.s,arguments))}},new s(i)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}});xa(cE(),1);xa(Ri(),1);var uE=vl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(t,e){function n(){var s=typeof SuppressedError=="function"?SuppressedError:function(f,p){var y=Error();return y.name="SuppressedError",y.error=f,y.suppressed=p,y},i={},o=[];function d(f,p){if(p!=null){if(Object(p)!==p)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(f)var y=p[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(y===void 0&&(y=p[Symbol.dispose||Symbol.for("Symbol.dispose")],f))var S=y;if(typeof y!="function")throw new TypeError("Object is not disposable.");S&&(y=function(){try{S.call(p)}catch(_){return Promise.reject(_)}}),o.push({v:p,d:y,a:f})}else f&&o.push({d:p,a:f});return p}return{e:i,u:d.bind(null,!1),a:d.bind(null,!0),d:function(){var p,y=this.e,S=0;function b(){for(;p=o.pop();)try{if(!p.a&&S===1)return S=0,o.push(p),Promise.resolve().then(b);if(p.d){var j=p.d.call(p.v);if(p.a)return S|=2,Promise.resolve(j).then(b,_)}else S|=1}catch(w){return _(w)}if(S===1)return y!==i?Promise.reject(y):Promise.resolve();if(y!==i)throw y}function _(j){return y=y!==i?new s(j,y):j,b()}return b()}}}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),j6=vl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(t,e){function n(s,i){this.v=s,this.k=i}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),dE=vl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(t,e){var n=j6();function s(i){return new n(i,0)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),fE=vl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(t,e){var n=j6();function s(o){return function(){return new i(o.apply(this,arguments))}}function i(o){var d,f;function p(S,b){try{var _=o[S](b),j=_.value,w=j instanceof n;Promise.resolve(w?j.v:j).then(function(T){if(w){var O=S==="return"?"return":"next";if(!j.k||T.done)return p(O,T);T=o[O](T).value}y(_.done?"return":"normal",T)},function(T){p("throw",T)})}catch(T){y("throw",T)}}function y(S,b){switch(S){case"return":d.resolve({value:b,done:!0});break;case"throw":d.reject(b);break;default:d.resolve({value:b,done:!1})}(d=d.next)?p(d.key,d.arg):f=null}this._invoke=function(S,b){return new Promise(function(_,j){var w={key:S,arg:b,resolve:_,reject:j,next:null};f?f=f.next=w:(d=f=w,p(S,b))})},typeof o.return!="function"&&(this.return=void 0)}i.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},i.prototype.next=function(o){return this._invoke("next",o)},i.prototype.throw=function(o){return this._invoke("throw",o)},i.prototype.return=function(o){return this._invoke("return",o)},e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}});xa(uE(),1);xa(dE(),1);xa(fE(),1);xa(Ri(),1);class hE{constructor(e){Yp(this,"trpc");Yp(this,"serverUrl");Yp(this,"token");Yp(this,"wsClient",null);this.serverUrl=e.serverUrl.replace(/\/+$/,""),this.token=e.token;const n=typeof window<"u",s=e.useWebSocket??n,i=()=>{const o={};return this.token&&(o.Authorization=`Bearer ${this.token}`),o};if(s){const o=this.serverUrl.replace(/^http/,"ws")+"/trpc";this.wsClient=nE({url:o,connectionParams:()=>({token:this.token}),retryDelayMs:()=>2e3}),this.trpc=p3({links:[aE({client:this.wsClient,transformer:kt})]})}else this.trpc=p3({links:[Pw({url:`${this.serverUrl}/trpc`,headers:i,transformer:kt})]})}setToken(e){this.token=e}close(){var e;(e=this.wsClient)==null||e.close()}async login(e,n){return this.trpc.auth.login.mutate({username:e,password:n})}async getMe(){return this.trpc.auth.me.query()}async logout(){return this.trpc.auth.logout.mutate()}async getSystemInfo(){return this.trpc.system.info.query()}async getFeatureFlags(){return this.trpc.system.featureFlags.query()}async listProviders(){return this.trpc.providers.list.query()}async getProvider(e){return this.trpc.providers.get.query({id:e})}async startProvider(e){return this.trpc.providers.start.mutate({id:e})}async stopProvider(e){return this.trpc.providers.stop.mutate({id:e})}async listProviderTypes(){return this.trpc.providerConfig.getAvailableTypes.query()}async listDevices(){return this.trpc.devices.list.query()}async getDevice(e){return this.trpc.devices.get.query({id:e})}async discoverDevices(e){return this.trpc.devices.discoverDevices.query({providerId:e})}async adoptDevice(e,n){return this.trpc.devices.adoptDevice.mutate({providerId:e,externalId:n})}async createDevice(e,n){return this.trpc.devices.createDevice.mutate({providerId:e,config:n})}getAddonAssetUrl(e,n){return`/api/addon-assets/${e}/${n}`}async listAddons(){return this.trpc.addons.list.query()}async getAddonConfigSchema(e){return this.trpc.addons.getConfigSchema.query({addonId:e})}async getAddonConfig(e){return this.trpc.addons.getConfig.query({addonId:e})}async updateAddonConfig(e,n){return this.trpc.addons.updateConfig.mutate({addonId:e,config:n})}async getAddonLogs(e,n){return this.trpc.addons.getLogs.query({addonId:e,...n})}async listKnownFaces(){return this.trpc.knownFaces.list.query()}async registerFace(e,n,s){return this.trpc.knownFaces.register.mutate({label:e,cropBase64:n,group:s})}async listPipelines(){return this.trpc.bridgePipeline.listAddons.query()}async getPipelineStatus(e){return this.trpc.bridgePipeline.getPipeline.query({deviceId:e})}async listAgents(){return this.trpc.agents.listAgents.query()}async dispatchTask(e,n){return this.trpc.agents.dispatchTask.mutate({capability:e,input:n})}async getProcessTree(){return this.trpc.agent.processTree.query()}async bridgeListAddons(){return this.trpc.bridgePipeline.listAddons.query()}async bridgeGetPipeline(e){return this.trpc.bridgePipeline.getPipeline.query({deviceId:e})}async bridgeSetPipeline(e,n){return this.trpc.bridgePipeline.setPipeline.mutate({deviceId:e,config:n})}async bridgeValidatePipeline(e){return this.trpc.bridgePipeline.validatePipeline.query(e)}async bridgeGetAddonConfig(e){return this.trpc.bridgePipeline.getAddonConfig.query({addonId:e})}async bridgeSetAddonConfig(e,n){return this.trpc.bridgePipeline.setAddonConfig.mutate({addonId:e,config:n})}async bridgeListPackages(){return this.trpc.addons.listPackages.query()}async bridgeListAddonsPackages(){return this.trpc.addons.list.query()}async bridgeInstallPackage(e,n){return this.trpc.addons.installPackage.mutate({packageName:e,version:n})}async bridgeUninstallPackage(e){return this.trpc.addons.uninstallPackage.mutate({packageName:e})}async getRecordingConfig(e){return this.trpc.recording.getConfig.query({deviceId:e})}async getRecordingPolicy(e){return this.trpc.recording.getPolicy.query({deviceId:e})}async getRecordingPolicyStatus(e){return this.trpc.recording.getPolicyStatus.query({deviceId:e})}async getRecordingSegments(e,n,s,i){return this.trpc.recording.getSegments.query({deviceId:e,streamId:n,startTime:s,endTime:i})}async getEvents(e,n){return this.trpc.events.query.query({deviceId:e,...n})}async getLogs(e){return this.trpc.logs.query.query(e??{})}async replEval(e,n){return this.trpc.repl.execute.mutate({code:e,scope:n??{type:"system"}})}async listUsers(){return this.trpc.users.list.query()}async createUser(e,n,s){return this.trpc.users.create.mutate({username:e,password:n,role:s})}async getTrackingSessions(e){return this.trpc.session.getActiveTracks.query({deviceId:e})}async listProcesses(){return this.trpc.processes.listProcesses.query()}async enableProvider(e){return this.trpc.processes.enableProvider.mutate({id:e})}async disableProvider(e){return this.trpc.processes.disableProvider.mutate({id:e})}async getSettingsSchema(e){return this.trpc.settings.getSchema.query({section:e})}async getSettings(e){return this.trpc.settings.get.query({section:e})}async updateSettings(e,n){return this.trpc.settings.update.mutate({section:e,data:n})}}var w6=(t=>(t.Motion="motion",t.Person="person",t.Vehicle="vehicle",t.Animal="animal",t.Audio="audio",t.Face="face",t.Plate="plate",t.Package="package",t.Doorbell="doorbell",t.Sensor="sensor",t))(w6||{});const pE=["animal","dog_cat","dog","cat","horse","sheep","cow","elephant","bear","zebra","giraffe","mouse","rabbit","deer","lion","tiger","bird","eagle","owl","pigeon","fish","whale","dolphin","snake","turtle","lizard"],mE=["person","people","pedestrian","rider","driver","cyclist","skier","skateboarder","face","hand","head","body"],gE=["vehicle","car","truck","bus","motorcycle","bicycle","van","ambulance","police_car","fire_truck","train","subway","tram","airplane","boat","ship","helicopter"],yE=["face","eyes","nose","mouth","ears","eyebrows","left_eye","right_eye","pupil","iris","eyelid","eye_corner","upper_lip","lower_lip","teeth","chin","cheek","forehead","jaw","glasses","sunglasses","facial_hair","beard","mustache","facial_landmark","facial_keypoint"],xE=["plate","license_plate","front_plate","rear_plate","motorcycle_plate","temporary_plate","dealer_plate","licensePlate","plate_number","plate_character","plate_digit","plate_letter","plate_symbol","plate_region","plate_country_identifier","plate_frame","plate_bolt","plate_sticker","plate_validation_tag","damaged_plate","obscured_plate","dirty_plate"],bE=["motion","movement","other"],vE=["package","packet"],SE=["audio"],NE=["speech","scream","babbling","yell","bellow","whoop","whispering","laughter","snicker","crying","cry","sigh","singing","choir","chant","mantra","child_singing","rapping","humming","groan","grunt","whistling","breathing","wheeze","snoring","gasp","pant","snort","cough","throat_clearing","sneeze","sniff","cheering","applause","chatter","crowd","children_playing","bark","yip","howl","bow-wow","growling","whimper_dog","purr","meow","hiss","caterwaul","pets","livestock","doorbell","ding-dong","door","slam","knock","alarm","telephone","music","dog","dogs"],_E=["doorbell","ring"],CE=["lock","binary","flood","entry","door","leak","door_open","flooded","entry_open"];({...pE.reduce((t,e)=>({...t,[e]:"animal"}),{}),...mE.reduce((t,e)=>({...t,[e]:"person"}),{}),...gE.reduce((t,e)=>({...t,[e]:"vehicle"}),{}),...bE.reduce((t,e)=>({...t,[e]:"motion"}),{}),...vE.reduce((t,e)=>({...t,[e]:"package"}),{}),...yE.reduce((t,e)=>({...t,[e]:"face"}),{}),...xE.reduce((t,e)=>({...t,[e]:"plate"}),{}),...SE.reduce((t,e)=>({...t,[e]:"audio"}),{}),...NE.reduce((t,e)=>({...t,[e]:"audio"}),{}),..._E.reduce((t,e)=>({...t,[e]:"doorbell"}),{}),...CE.reduce((t,e)=>({...t,[e]:"sensor"}),{})});const jE=Object.values(w6),wE=jE.filter(t=>t!=="motion");[...wE];const EE=["Entry","Light","Switch","Lock","SecuritySystem","Buttons","WindowCovering","Siren","Sensor","Select","Program"];new Set(EE);const TE=["light","switch","input_boolean","cover","lock","alarm_control_panel","input_button","button","input_select","select","siren","media_player","script"];new Set(TE);let y1=null;function Am(){if(!y1){const t=window.location.origin,e=localStorage.getItem("camstack_admin_token")??void 0;y1=new hE({serverUrl:t,token:e})}return y1}function m3(){y1=null}const E6=D.createContext(null);function g3(t){try{const e=JSON.parse(atob(t.split(".")[1]));return{username:e.username??"unknown",role:e.role??"viewer",exp:e.exp??0}}catch{return null}}function RE({children:t}){const[e,n]=D.useState(null),[s,i]=D.useState(!0);D.useEffect(()=>{const f=localStorage.getItem("camstack_admin_token");if(!f){i(!1);return}const p=g3(f);if(!p||p.exp*1e3<Date.now()){localStorage.removeItem("camstack_admin_token"),i(!1);return}Am().getSystemInfo().then(()=>n(p)).catch(S=>{var _;const b=(_=S==null?void 0:S.data)==null?void 0:_.code;b==="UNAUTHORIZED"||b==="FORBIDDEN"?(localStorage.removeItem("camstack_admin_token"),m3()):n(p)}).finally(()=>i(!1))},[]);const o=D.useCallback(async(f,p)=>{const y=Am(),b=(await y.login(f,p)).token;localStorage.setItem("camstack_admin_token",b),y.setToken(b),n(g3(b))},[]),d=D.useCallback(()=>{localStorage.removeItem("camstack_admin_token"),m3(),n(null)},[]);return h.jsx(E6.Provider,{value:{user:e,loading:s,login:o,logout:d},children:t})}function uv(){const t=D.useContext(E6);if(!t)throw new Error("useAuth must be used within AuthProvider");return t}function Au({children:t,requiredRole:e}){const{user:n,loading:s}=uv();return s?h.jsx("div",{className:"flex h-screen items-center justify-center bg-background text-foreground-subtle",children:"Loading..."}):n?e==="admin"&&n.role!=="admin"&&n.role!=="super_admin"?h.jsx(cb,{to:"/access-denied",replace:!0}):h.jsx(h.Fragment,{children:t}):h.jsx(cb,{to:"/login",replace:!0})}/**
|
|
136
|
-
* @license lucide-react v0.511.0 - ISC
|
|
137
|
-
*
|
|
138
|
-
* This source code is licensed under the ISC license.
|
|
139
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
-
*/const OE=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ME=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,s)=>s?s.toUpperCase():n.toLowerCase()),y3=t=>{const e=ME(t);return e.charAt(0).toUpperCase()+e.slice(1)},T6=(...t)=>t.filter((e,n,s)=>!!e&&e.trim()!==""&&s.indexOf(e)===n).join(" ").trim(),AE=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};/**
|
|
141
|
-
* @license lucide-react v0.511.0 - ISC
|
|
142
|
-
*
|
|
143
|
-
* This source code is licensed under the ISC license.
|
|
144
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
-
*/var DE={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
146
|
-
* @license lucide-react v0.511.0 - ISC
|
|
147
|
-
*
|
|
148
|
-
* This source code is licensed under the ISC license.
|
|
149
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
-
*/const zE=D.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:i="",children:o,iconNode:d,...f},p)=>D.createElement("svg",{ref:p,...DE,width:e,height:e,stroke:t,strokeWidth:s?Number(n)*24/Number(e):n,className:T6("lucide",i),...!o&&!AE(f)&&{"aria-hidden":"true"},...f},[...d.map(([y,S])=>D.createElement(y,S)),...Array.isArray(o)?o:[o]]));/**
|
|
151
|
-
* @license lucide-react v0.511.0 - ISC
|
|
152
|
-
*
|
|
153
|
-
* This source code is licensed under the ISC license.
|
|
154
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
-
*/const Le=(t,e)=>{const n=D.forwardRef(({className:s,...i},o)=>D.createElement(zE,{ref:o,iconNode:e,className:T6(`lucide-${OE(y3(t))}`,`lucide-${t}`,s),...i}));return n.displayName=y3(t),n};/**
|
|
156
|
-
* @license lucide-react v0.511.0 - ISC
|
|
157
|
-
*
|
|
158
|
-
* This source code is licensed under the ISC license.
|
|
159
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
-
*/const kE=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],dv=Le("activity",kE);/**
|
|
161
|
-
* @license lucide-react v0.511.0 - ISC
|
|
162
|
-
*
|
|
163
|
-
* This source code is licensed under the ISC license.
|
|
164
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
-
*/const LE=[["path",{d:"M5 3h14",key:"7usisc"}],["path",{d:"m18 13-6-6-6 6",key:"1kf1n9"}],["path",{d:"M12 7v14",key:"1akyts"}]],R6=Le("arrow-up-to-line",LE);/**
|
|
166
|
-
* @license lucide-react v0.511.0 - ISC
|
|
167
|
-
*
|
|
168
|
-
* This source code is licensed under the ISC license.
|
|
169
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
-
*/const UE=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],fv=Le("bell",UE);/**
|
|
171
|
-
* @license lucide-react v0.511.0 - ISC
|
|
172
|
-
*
|
|
173
|
-
* This source code is licensed under the ISC license.
|
|
174
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
-
*/const qE=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Sb=Le("bot",qE);/**
|
|
176
|
-
* @license lucide-react v0.511.0 - ISC
|
|
177
|
-
*
|
|
178
|
-
* This source code is licensed under the ISC license.
|
|
179
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
-
*/const HE=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],BE=Le("box",HE);/**
|
|
181
|
-
* @license lucide-react v0.511.0 - ISC
|
|
182
|
-
*
|
|
183
|
-
* This source code is licensed under the ISC license.
|
|
184
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
-
*/const GE=[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]],PE=Le("bug",GE);/**
|
|
186
|
-
* @license lucide-react v0.511.0 - ISC
|
|
187
|
-
*
|
|
188
|
-
* This source code is licensed under the ISC license.
|
|
189
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
-
*/const YE=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],VE=Le("calendar",YE);/**
|
|
191
|
-
* @license lucide-react v0.511.0 - ISC
|
|
192
|
-
*
|
|
193
|
-
* This source code is licensed under the ISC license.
|
|
194
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
-
*/const QE=[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],Lc=Le("camera",QE);/**
|
|
196
|
-
* @license lucide-react v0.511.0 - ISC
|
|
197
|
-
*
|
|
198
|
-
* This source code is licensed under the ISC license.
|
|
199
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
-
*/const KE=[["path",{d:"M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2",key:"5owen"}],["circle",{cx:"7",cy:"17",r:"2",key:"u2ysq9"}],["path",{d:"M9 17h6",key:"r8uit2"}],["circle",{cx:"17",cy:"17",r:"2",key:"axvx0g"}]],XE=Le("car",KE);/**
|
|
201
|
-
* @license lucide-react v0.511.0 - ISC
|
|
202
|
-
*
|
|
203
|
-
* This source code is licensed under the ISC license.
|
|
204
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
-
*/const FE=[["path",{d:"M16.75 12h3.632a1 1 0 0 1 .894 1.447l-2.034 4.069a1 1 0 0 1-1.708.134l-2.124-2.97",key:"ir91b5"}],["path",{d:"M17.106 9.053a1 1 0 0 1 .447 1.341l-3.106 6.211a1 1 0 0 1-1.342.447L3.61 12.3a2.92 2.92 0 0 1-1.3-3.91L3.69 5.6a2.92 2.92 0 0 1 3.92-1.3z",key:"jlp8i1"}],["path",{d:"M2 19h3.76a2 2 0 0 0 1.8-1.1L9 15",key:"19bib8"}],["path",{d:"M2 21v-4",key:"l40lih"}],["path",{d:"M7 9h.01",key:"19b3jx"}]],ZE=Le("cctv",FE);/**
|
|
206
|
-
* @license lucide-react v0.511.0 - ISC
|
|
207
|
-
*
|
|
208
|
-
* This source code is licensed under the ISC license.
|
|
209
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
-
*/const IE=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Im=Le("check",IE);/**
|
|
211
|
-
* @license lucide-react v0.511.0 - ISC
|
|
212
|
-
*
|
|
213
|
-
* This source code is licensed under the ISC license.
|
|
214
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
-
*/const JE=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Mc=Le("chevron-down",JE);/**
|
|
216
|
-
* @license lucide-react v0.511.0 - ISC
|
|
217
|
-
*
|
|
218
|
-
* This source code is licensed under the ISC license.
|
|
219
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
-
*/const WE=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],$E=Le("chevron-left",WE);/**
|
|
221
|
-
* @license lucide-react v0.511.0 - ISC
|
|
222
|
-
*
|
|
223
|
-
* This source code is licensed under the ISC license.
|
|
224
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
-
*/const eT=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Zu=Le("chevron-right",eT);/**
|
|
226
|
-
* @license lucide-react v0.511.0 - ISC
|
|
227
|
-
*
|
|
228
|
-
* This source code is licensed under the ISC license.
|
|
229
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
-
*/const tT=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],_1=Le("chevron-up",tT);/**
|
|
231
|
-
* @license lucide-react v0.511.0 - ISC
|
|
232
|
-
*
|
|
233
|
-
* This source code is licensed under the ISC license.
|
|
234
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
-
*/const nT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],hv=Le("circle-alert",nT);/**
|
|
236
|
-
* @license lucide-react v0.511.0 - ISC
|
|
237
|
-
*
|
|
238
|
-
* This source code is licensed under the ISC license.
|
|
239
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
-
*/const aT=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],sT=Le("circle-check-big",aT);/**
|
|
241
|
-
* @license lucide-react v0.511.0 - ISC
|
|
242
|
-
*
|
|
243
|
-
* This source code is licensed under the ISC license.
|
|
244
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
-
*/const rT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],O6=Le("circle-dot",rT);/**
|
|
246
|
-
* @license lucide-react v0.511.0 - ISC
|
|
247
|
-
*
|
|
248
|
-
* This source code is licensed under the ISC license.
|
|
249
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
-
*/const iT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],x3=Le("circle-help",iT);/**
|
|
251
|
-
* @license lucide-react v0.511.0 - ISC
|
|
252
|
-
*
|
|
253
|
-
* This source code is licensed under the ISC license.
|
|
254
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
-
*/const lT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],M6=Le("clock",lT);/**
|
|
256
|
-
* @license lucide-react v0.511.0 - ISC
|
|
257
|
-
*
|
|
258
|
-
* This source code is licensed under the ISC license.
|
|
259
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
-
*/const oT=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],cT=Le("copy",oT);/**
|
|
261
|
-
* @license lucide-react v0.511.0 - ISC
|
|
262
|
-
*
|
|
263
|
-
* This source code is licensed under the ISC license.
|
|
264
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
-
*/const uT=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],zf=Le("cpu",uT);/**
|
|
266
|
-
* @license lucide-react v0.511.0 - ISC
|
|
267
|
-
*
|
|
268
|
-
* This source code is licensed under the ISC license.
|
|
269
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
-
*/const dT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]],fT=Le("crosshair",dT);/**
|
|
271
|
-
* @license lucide-react v0.511.0 - ISC
|
|
272
|
-
*
|
|
273
|
-
* This source code is licensed under the ISC license.
|
|
274
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
-
*/const hT=[["path",{d:"M11.25 16.25h1.5L12 17z",key:"w7jh35"}],["path",{d:"M16 14v.5",key:"1lajdz"}],["path",{d:"M4.42 11.247A13.152 13.152 0 0 0 4 14.556C4 18.728 7.582 21 12 21s8-2.272 8-6.444a11.702 11.702 0 0 0-.493-3.309",key:"u7s9ue"}],["path",{d:"M8 14v.5",key:"1nzgdb"}],["path",{d:"M8.5 8.5c-.384 1.05-1.083 2.028-2.344 2.5-1.931.722-3.576-.297-3.656-1-.113-.994 1.177-6.53 4-7 1.923-.321 3.651.845 3.651 2.235A7.497 7.497 0 0 1 14 5.277c0-1.39 1.844-2.598 3.767-2.277 2.823.47 4.113 6.006 4 7-.08.703-1.725 1.722-3.656 1-1.261-.472-1.855-1.45-2.239-2.5",key:"v8hric"}]],pT=Le("dog",hT);/**
|
|
276
|
-
* @license lucide-react v0.511.0 - ISC
|
|
277
|
-
*
|
|
278
|
-
* This source code is licensed under the ISC license.
|
|
279
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
-
*/const mT=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Dm=Le("download",mT);/**
|
|
281
|
-
* @license lucide-react v0.511.0 - ISC
|
|
282
|
-
*
|
|
283
|
-
* This source code is licensed under the ISC license.
|
|
284
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
285
|
-
*/const gT=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],yT=Le("external-link",gT);/**
|
|
286
|
-
* @license lucide-react v0.511.0 - ISC
|
|
287
|
-
*
|
|
288
|
-
* This source code is licensed under the ISC license.
|
|
289
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
290
|
-
*/const xT=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],A6=Le("eye-off",xT);/**
|
|
291
|
-
* @license lucide-react v0.511.0 - ISC
|
|
292
|
-
*
|
|
293
|
-
* This source code is licensed under the ISC license.
|
|
294
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
295
|
-
*/const bT=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],uh=Le("eye",bT);/**
|
|
296
|
-
* @license lucide-react v0.511.0 - ISC
|
|
297
|
-
*
|
|
298
|
-
* This source code is licensed under the ISC license.
|
|
299
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
300
|
-
*/const vT=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M3 7.5h4",key:"zfgn84"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 16.5h4",key:"1230mu"}],["path",{d:"M17 3v18",key:"in4fa5"}],["path",{d:"M17 7.5h4",key:"myr1c1"}],["path",{d:"M17 16.5h4",key:"go4c1d"}]],D6=Le("film",vT);/**
|
|
301
|
-
* @license lucide-react v0.511.0 - ISC
|
|
302
|
-
*
|
|
303
|
-
* This source code is licensed under the ISC license.
|
|
304
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
305
|
-
*/const ST=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],NT=Le("flask-conical",ST);/**
|
|
306
|
-
* @license lucide-react v0.511.0 - ISC
|
|
307
|
-
*
|
|
308
|
-
* This source code is licensed under the ISC license.
|
|
309
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
310
|
-
*/const _T=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],CT=Le("funnel",_T);/**
|
|
311
|
-
* @license lucide-react v0.511.0 - ISC
|
|
312
|
-
*
|
|
313
|
-
* This source code is licensed under the ISC license.
|
|
314
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
315
|
-
*/const jT=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],wT=Le("gauge",jT);/**
|
|
316
|
-
* @license lucide-react v0.511.0 - ISC
|
|
317
|
-
*
|
|
318
|
-
* This source code is licensed under the ISC license.
|
|
319
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
320
|
-
*/const ET=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],X1=Le("git-branch",ET);/**
|
|
321
|
-
* @license lucide-react v0.511.0 - ISC
|
|
322
|
-
*
|
|
323
|
-
* This source code is licensed under the ISC license.
|
|
324
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
325
|
-
*/const TT=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],RT=Le("grip-vertical",TT);/**
|
|
326
|
-
* @license lucide-react v0.511.0 - ISC
|
|
327
|
-
*
|
|
328
|
-
* This source code is licensed under the ISC license.
|
|
329
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
330
|
-
*/const OT=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],ym=Le("hard-drive",OT);/**
|
|
331
|
-
* @license lucide-react v0.511.0 - ISC
|
|
332
|
-
*
|
|
333
|
-
* This source code is licensed under the ISC license.
|
|
334
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
335
|
-
*/const MT=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],AT=Le("house",MT);/**
|
|
336
|
-
* @license lucide-react v0.511.0 - ISC
|
|
337
|
-
*
|
|
338
|
-
* This source code is licensed under the ISC license.
|
|
339
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
340
|
-
*/const DT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],C1=Le("info",DT);/**
|
|
341
|
-
* @license lucide-react v0.511.0 - ISC
|
|
342
|
-
*
|
|
343
|
-
* This source code is licensed under the ISC license.
|
|
344
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
345
|
-
*/const zT=[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]],kT=Le("languages",zT);/**
|
|
346
|
-
* @license lucide-react v0.511.0 - ISC
|
|
347
|
-
*
|
|
348
|
-
* This source code is licensed under the ISC license.
|
|
349
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
350
|
-
*/const LT=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],z6=Le("layout-dashboard",LT);/**
|
|
351
|
-
* @license lucide-react v0.511.0 - ISC
|
|
352
|
-
*
|
|
353
|
-
* This source code is licensed under the ISC license.
|
|
354
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
355
|
-
*/const UT=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],qT=Le("lightbulb",UT);/**
|
|
356
|
-
* @license lucide-react v0.511.0 - ISC
|
|
357
|
-
*
|
|
358
|
-
* This source code is licensed under the ISC license.
|
|
359
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
360
|
-
*/const HT=[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]],BT=Le("list-todo",HT);/**
|
|
361
|
-
* @license lucide-react v0.511.0 - ISC
|
|
362
|
-
*
|
|
363
|
-
* This source code is licensed under the ISC license.
|
|
364
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
365
|
-
*/const GT=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],ml=Le("loader-circle",GT);/**
|
|
366
|
-
* @license lucide-react v0.511.0 - ISC
|
|
367
|
-
*
|
|
368
|
-
* This source code is licensed under the ISC license.
|
|
369
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
370
|
-
*/const PT=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],YT=Le("log-out",PT);/**
|
|
371
|
-
* @license lucide-react v0.511.0 - ISC
|
|
372
|
-
*
|
|
373
|
-
* This source code is licensed under the ISC license.
|
|
374
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
375
|
-
*/const VT=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],QT=Le("menu",VT);/**
|
|
376
|
-
* @license lucide-react v0.511.0 - ISC
|
|
377
|
-
*
|
|
378
|
-
* This source code is licensed under the ISC license.
|
|
379
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
380
|
-
*/const KT=[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]],k6=Le("mic",KT);/**
|
|
381
|
-
* @license lucide-react v0.511.0 - ISC
|
|
382
|
-
*
|
|
383
|
-
* This source code is licensed under the ISC license.
|
|
384
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
385
|
-
*/const XT=[["path",{d:"M5 12h14",key:"1ays0h"}]],FT=Le("minus",XT);/**
|
|
386
|
-
* @license lucide-react v0.511.0 - ISC
|
|
387
|
-
*
|
|
388
|
-
* This source code is licensed under the ISC license.
|
|
389
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
390
|
-
*/const ZT=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],j1=Le("monitor",ZT);/**
|
|
391
|
-
* @license lucide-react v0.511.0 - ISC
|
|
392
|
-
*
|
|
393
|
-
* This source code is licensed under the ISC license.
|
|
394
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
395
|
-
*/const IT=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],JT=Le("moon",IT);/**
|
|
396
|
-
* @license lucide-react v0.511.0 - ISC
|
|
397
|
-
*
|
|
398
|
-
* This source code is licensed under the ISC license.
|
|
399
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
400
|
-
*/const WT=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],zm=Le("package",WT);/**
|
|
401
|
-
* @license lucide-react v0.511.0 - ISC
|
|
402
|
-
*
|
|
403
|
-
* This source code is licensed under the ISC license.
|
|
404
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
405
|
-
*/const $T=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],eR=Le("pencil",$T);/**
|
|
406
|
-
* @license lucide-react v0.511.0 - ISC
|
|
407
|
-
*
|
|
408
|
-
* This source code is licensed under the ISC license.
|
|
409
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
410
|
-
*/const tR=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],F1=Le("play",tR);/**
|
|
411
|
-
* @license lucide-react v0.511.0 - ISC
|
|
412
|
-
*
|
|
413
|
-
* This source code is licensed under the ISC license.
|
|
414
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
415
|
-
*/const nR=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]],L6=Le("plug",nR);/**
|
|
416
|
-
* @license lucide-react v0.511.0 - ISC
|
|
417
|
-
*
|
|
418
|
-
* This source code is licensed under the ISC license.
|
|
419
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
420
|
-
*/const aR=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],po=Le("plus",aR);/**
|
|
421
|
-
* @license lucide-react v0.511.0 - ISC
|
|
422
|
-
*
|
|
423
|
-
* This source code is licensed under the ISC license.
|
|
424
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
425
|
-
*/const sR=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],w1=Le("puzzle",sR);/**
|
|
426
|
-
* @license lucide-react v0.511.0 - ISC
|
|
427
|
-
*
|
|
428
|
-
* This source code is licensed under the ISC license.
|
|
429
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
430
|
-
*/const rR=[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]],pv=Le("radio",rR);/**
|
|
431
|
-
* @license lucide-react v0.511.0 - ISC
|
|
432
|
-
*
|
|
433
|
-
* This source code is licensed under the ISC license.
|
|
434
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
435
|
-
*/const iR=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],eh=Le("refresh-cw",iR);/**
|
|
436
|
-
* @license lucide-react v0.511.0 - ISC
|
|
437
|
-
*
|
|
438
|
-
* This source code is licensed under the ISC license.
|
|
439
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
440
|
-
*/const lR=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],U6=Le("save",lR);/**
|
|
441
|
-
* @license lucide-react v0.511.0 - ISC
|
|
442
|
-
*
|
|
443
|
-
* This source code is licensed under the ISC license.
|
|
444
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
445
|
-
*/const oR=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],Jm=Le("scroll-text",oR);/**
|
|
446
|
-
* @license lucide-react v0.511.0 - ISC
|
|
447
|
-
*
|
|
448
|
-
* This source code is licensed under the ISC license.
|
|
449
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
450
|
-
*/const cR=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],mv=Le("search",cR);/**
|
|
451
|
-
* @license lucide-react v0.511.0 - ISC
|
|
452
|
-
*
|
|
453
|
-
* This source code is licensed under the ISC license.
|
|
454
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
455
|
-
*/const uR=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],E1=Le("server",uR);/**
|
|
456
|
-
* @license lucide-react v0.511.0 - ISC
|
|
457
|
-
*
|
|
458
|
-
* This source code is licensed under the ISC license.
|
|
459
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
460
|
-
*/const dR=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Wm=Le("settings",dR);/**
|
|
461
|
-
* @license lucide-react v0.511.0 - ISC
|
|
462
|
-
*
|
|
463
|
-
* This source code is licensed under the ISC license.
|
|
464
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
465
|
-
*/const fR=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m14.5 9.5-5 5",key:"17q4r4"}],["path",{d:"m9.5 9.5 5 5",key:"18nt4w"}]],hR=Le("shield-x",fR);/**
|
|
466
|
-
* @license lucide-react v0.511.0 - ISC
|
|
467
|
-
*
|
|
468
|
-
* This source code is licensed under the ISC license.
|
|
469
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
470
|
-
*/const pR=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],gv=Le("square",pR);/**
|
|
471
|
-
* @license lucide-react v0.511.0 - ISC
|
|
472
|
-
*
|
|
473
|
-
* This source code is licensed under the ISC license.
|
|
474
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
475
|
-
*/const mR=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],gR=Le("sun",mR);/**
|
|
476
|
-
* @license lucide-react v0.511.0 - ISC
|
|
477
|
-
*
|
|
478
|
-
* This source code is licensed under the ISC license.
|
|
479
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
480
|
-
*/const yR=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],xR=Le("terminal",yR);/**
|
|
481
|
-
* @license lucide-react v0.511.0 - ISC
|
|
482
|
-
*
|
|
483
|
-
* This source code is licensed under the ISC license.
|
|
484
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
485
|
-
*/const bR=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],vR=Le("toggle-left",bR);/**
|
|
486
|
-
* @license lucide-react v0.511.0 - ISC
|
|
487
|
-
*
|
|
488
|
-
* This source code is licensed under the ISC license.
|
|
489
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
490
|
-
*/const SR=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],dh=Le("trash-2",SR);/**
|
|
491
|
-
* @license lucide-react v0.511.0 - ISC
|
|
492
|
-
*
|
|
493
|
-
* This source code is licensed under the ISC license.
|
|
494
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
495
|
-
*/const NR=[["path",{d:"m17 14 3 3.3a1 1 0 0 1-.7 1.7H4.7a1 1 0 0 1-.7-1.7L7 14h-.3a1 1 0 0 1-.7-1.7L9 9h-.2A1 1 0 0 1 8 7.3L12 3l4 4.3a1 1 0 0 1-.8 1.7H15l3 3.3a1 1 0 0 1-.7 1.7H17Z",key:"cpyugq"}],["path",{d:"M12 22v-3",key:"kmzjlo"}]],_R=Le("tree-pine",NR);/**
|
|
496
|
-
* @license lucide-react v0.511.0 - ISC
|
|
497
|
-
*
|
|
498
|
-
* This source code is licensed under the ISC license.
|
|
499
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
500
|
-
*/const CR=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Z1=Le("triangle-alert",CR);/**
|
|
501
|
-
* @license lucide-react v0.511.0 - ISC
|
|
502
|
-
*
|
|
503
|
-
* This source code is licensed under the ISC license.
|
|
504
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
505
|
-
*/const jR=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],yv=Le("upload",jR);/**
|
|
506
|
-
* @license lucide-react v0.511.0 - ISC
|
|
507
|
-
*
|
|
508
|
-
* This source code is licensed under the ISC license.
|
|
509
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
510
|
-
*/const wR=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],ER=Le("user",wR);/**
|
|
511
|
-
* @license lucide-react v0.511.0 - ISC
|
|
512
|
-
*
|
|
513
|
-
* This source code is licensed under the ISC license.
|
|
514
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
515
|
-
*/const TR=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],RR=Le("users",TR);/**
|
|
516
|
-
* @license lucide-react v0.511.0 - ISC
|
|
517
|
-
*
|
|
518
|
-
* This source code is licensed under the ISC license.
|
|
519
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
520
|
-
*/const OR=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],MR=Le("video",OR);/**
|
|
521
|
-
* @license lucide-react v0.511.0 - ISC
|
|
522
|
-
*
|
|
523
|
-
* This source code is licensed under the ISC license.
|
|
524
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
525
|
-
*/const AR=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],DR=Le("wifi-off",AR);/**
|
|
526
|
-
* @license lucide-react v0.511.0 - ISC
|
|
527
|
-
*
|
|
528
|
-
* This source code is licensed under the ISC license.
|
|
529
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
530
|
-
*/const zR=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],b3=Le("wifi",zR);/**
|
|
531
|
-
* @license lucide-react v0.511.0 - ISC
|
|
532
|
-
*
|
|
533
|
-
* This source code is licensed under the ISC license.
|
|
534
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
535
|
-
*/const kR=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],LR=Le("workflow",kR);/**
|
|
536
|
-
* @license lucide-react v0.511.0 - ISC
|
|
537
|
-
*
|
|
538
|
-
* This source code is licensed under the ISC license.
|
|
539
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
540
|
-
*/const UR=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Oi=Le("x",UR);/**
|
|
541
|
-
* @license lucide-react v0.511.0 - ISC
|
|
542
|
-
*
|
|
543
|
-
* This source code is licensed under the ISC license.
|
|
544
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
545
|
-
*/const qR=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]],q6=Le("wrench",qR);var v3={};const at=t=>typeof t=="string",Fp=()=>{let t,e;const n=new Promise((s,i)=>{t=s,e=i});return n.resolve=t,n.reject=e,n},S3=t=>t==null?"":""+t,HR=(t,e,n)=>{t.forEach(s=>{e[s]&&(n[s]=e[s])})},BR=/###/g,N3=t=>t&&t.indexOf("###")>-1?t.replace(BR,"."):t,_3=t=>!t||at(t),xm=(t,e,n)=>{const s=at(e)?e.split("."):e;let i=0;for(;i<s.length-1;){if(_3(t))return{};const o=N3(s[i]);!t[o]&&n&&(t[o]=new n),Object.prototype.hasOwnProperty.call(t,o)?t=t[o]:t={},++i}return _3(t)?{}:{obj:t,k:N3(s[i])}},C3=(t,e,n)=>{const{obj:s,k:i}=xm(t,e,Object);if(s!==void 0||e.length===1){s[i]=n;return}let o=e[e.length-1],d=e.slice(0,e.length-1),f=xm(t,d,Object);for(;f.obj===void 0&&d.length;)o=`${d[d.length-1]}.${o}`,d=d.slice(0,d.length-1),f=xm(t,d,Object),f!=null&&f.obj&&typeof f.obj[`${f.k}.${o}`]<"u"&&(f.obj=void 0);f.obj[`${f.k}.${o}`]=n},GR=(t,e,n,s)=>{const{obj:i,k:o}=xm(t,e,Object);i[o]=i[o]||[],i[o].push(n)},T1=(t,e)=>{const{obj:n,k:s}=xm(t,e);if(n&&Object.prototype.hasOwnProperty.call(n,s))return n[s]},PR=(t,e,n)=>{const s=T1(t,n);return s!==void 0?s:T1(e,n)},H6=(t,e,n)=>{for(const s in e)s!=="__proto__"&&s!=="constructor"&&(s in t?at(t[s])||t[s]instanceof String||at(e[s])||e[s]instanceof String?n&&(t[s]=e[s]):H6(t[s],e[s],n):t[s]=e[s]);return t},Du=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var YR={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const VR=t=>at(t)?t.replace(/[&<>"'\/]/g,e=>YR[e]):t;class QR{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const s=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,s),this.regExpQueue.push(e),s}}const KR=[" ",",","?","!",";"],XR=new QR(20),FR=(t,e,n)=>{e=e||"",n=n||"";const s=KR.filter(d=>e.indexOf(d)<0&&n.indexOf(d)<0);if(s.length===0)return!0;const i=XR.getRegExp(`(${s.map(d=>d==="?"?"\\?":d).join("|")})`);let o=!i.test(t);if(!o){const d=t.indexOf(n);d>0&&!i.test(t.substring(0,d))&&(o=!0)}return o},Nb=(t,e,n=".")=>{if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const s=e.split(n);let i=t;for(let o=0;o<s.length;){if(!i||typeof i!="object")return;let d,f="";for(let p=o;p<s.length;++p)if(p!==o&&(f+=n),f+=s[p],d=i[f],d!==void 0){if(["string","number","boolean"].indexOf(typeof d)>-1&&p<s.length-1)continue;o+=p-o+1;break}i=d}return i},km=t=>t==null?void 0:t.replace(/_/g,"-"),ZR={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){var n,s;(s=(n=console==null?void 0:console[t])==null?void 0:n.apply)==null||s.call(n,console,e)}};class R1{constructor(e,n={}){this.init(e,n)}init(e,n={}){this.prefix=n.prefix||"i18next:",this.logger=e||ZR,this.options=n,this.debug=n.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,n,s,i){return i&&!this.debug?null:(at(e[0])&&(e[0]=`${s}${this.prefix} ${e[0]}`),this.logger[n](e))}create(e){return new R1(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new R1(this.logger,e)}}var hl=new R1;class I1{constructor(){this.observers={}}on(e,n){return e.split(" ").forEach(s=>{this.observers[s]||(this.observers[s]=new Map);const i=this.observers[s].get(n)||0;this.observers[s].set(n,i+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}emit(e,...n){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([i,o])=>{for(let d=0;d<o;d++)i(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([i,o])=>{for(let d=0;d<o;d++)i.apply(i,[e,...n])})}}class j3 extends I1{constructor(e,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,s,i={}){var y,S;const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,d=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let f;e.indexOf(".")>-1?f=e.split("."):(f=[e,n],s&&(Array.isArray(s)?f.push(...s):at(s)&&o?f.push(...s.split(o)):f.push(s)));const p=T1(this.data,f);return!p&&!n&&!s&&e.indexOf(".")>-1&&(e=f[0],n=f[1],s=f.slice(2).join(".")),p||!d||!at(s)?p:Nb((S=(y=this.data)==null?void 0:y[e])==null?void 0:S[n],s,o)}addResource(e,n,s,i,o={silent:!1}){const d=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let f=[e,n];s&&(f=f.concat(d?s.split(d):s)),e.indexOf(".")>-1&&(f=e.split("."),i=n,n=f[1]),this.addNamespaces(n),C3(this.data,f,i),o.silent||this.emit("added",e,n,s,i)}addResources(e,n,s,i={silent:!1}){for(const o in s)(at(s[o])||Array.isArray(s[o]))&&this.addResource(e,n,o,s[o],{silent:!0});i.silent||this.emit("added",e,n,s)}addResourceBundle(e,n,s,i,o,d={silent:!1,skipCopy:!1}){let f=[e,n];e.indexOf(".")>-1&&(f=e.split("."),i=s,s=n,n=f[1]),this.addNamespaces(n);let p=T1(this.data,f)||{};d.skipCopy||(s=JSON.parse(JSON.stringify(s))),i?H6(p,s,o):p={...p,...s},C3(this.data,f,p),d.silent||this.emit("added",e,n,s)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var B6={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,s,i){return t.forEach(o=>{var d;e=((d=this.processors[o])==null?void 0:d.process(e,n,s,i))??e}),e}};const G6=Symbol("i18next/PATH_KEY");function IR(){const t=[],e=Object.create(null);let n;return e.get=(s,i)=>{var o;return(o=n==null?void 0:n.revoke)==null||o.call(n),i===G6?t:(t.push(i),n=Proxy.revocable(s,e),n.proxy)},Proxy.revocable(Object.create(null),e).proxy}function kf(t,e){const{[G6]:n}=t(IR()),s=(e==null?void 0:e.keySeparator)??".",i=(e==null?void 0:e.nsSeparator)??":";if(n.length>1&&i){const o=e==null?void 0:e.ns,d=Array.isArray(o)?o:null;if(d&&d.length>1&&d.slice(1).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(s)}`}return n.join(s)}const w3={},cx=t=>!at(t)&&typeof t!="boolean"&&typeof t!="number";class O1 extends I1{constructor(e,n={}){super(),HR(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=hl.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,n={interpolation:{}}){const s={...n};if(e==null)return!1;const i=this.resolve(e,s);if((i==null?void 0:i.res)===void 0)return!1;const o=cx(i.res);return!(s.returnObjects===!1&&o)}extractFromKey(e,n){let s=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const d=s&&e.indexOf(s)>-1,f=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!FR(e,s,i);if(d&&!f){const p=e.match(this.interpolator.nestingRegexp);if(p&&p.length>0)return{key:e,namespaces:at(o)?[o]:o};const y=e.split(s);(s!==i||s===i&&this.options.ns.indexOf(y[0])>-1)&&(o=y.shift()),e=y.join(i)}return{key:e,namespaces:at(o)?[o]:o}}translate(e,n,s){let i=typeof n=="object"?{...n}:n;if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i={...i}),i||(i={}),e==null)return"";typeof e=="function"&&(e=kf(e,{...this.options,...i})),Array.isArray(e)||(e=[String(e)]),e=e.map(W=>typeof W=="function"?kf(W,{...this.options,...i}):String(W));const o=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,d=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:f,namespaces:p}=this.extractFromKey(e[e.length-1],i),y=p[p.length-1];let S=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;S===void 0&&(S=":");const b=i.lng||this.language,_=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((b==null?void 0:b.toLowerCase())==="cimode")return _?o?{res:`${y}${S}${f}`,usedKey:f,exactUsedKey:f,usedLng:b,usedNS:y,usedParams:this.getUsedParamsDetails(i)}:`${y}${S}${f}`:o?{res:f,usedKey:f,exactUsedKey:f,usedLng:b,usedNS:y,usedParams:this.getUsedParamsDetails(i)}:f;const j=this.resolve(e,i);let w=j==null?void 0:j.res;const T=(j==null?void 0:j.usedKey)||f,O=(j==null?void 0:j.exactUsedKey)||f,R=["[object Number]","[object Function]","[object RegExp]"],M=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,z=!this.i18nFormat||this.i18nFormat.handleAsObject,k=i.count!==void 0&&!at(i.count),G=O1.hasDefaultValue(i),P=k?this.pluralResolver.getSuffix(b,i.count,i):"",L=i.ordinal&&k?this.pluralResolver.getSuffix(b,i.count,{ordinal:!1}):"",U=k&&!i.ordinal&&i.count===0,V=U&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${P}`]||i[`defaultValue${L}`]||i.defaultValue;let Z=w;z&&!w&&G&&(Z=V);const re=cx(Z),ne=Object.prototype.toString.apply(Z);if(z&&Z&&re&&R.indexOf(ne)<0&&!(at(M)&&Array.isArray(Z))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const W=this.options.returnedObjectHandler?this.options.returnedObjectHandler(T,Z,{...i,ns:p}):`key '${f} (${this.language})' returned an object instead of string.`;return o?(j.res=W,j.usedParams=this.getUsedParamsDetails(i),j):W}if(d){const W=Array.isArray(Z),ie=W?[]:{},ce=W?O:T;for(const Y in Z)if(Object.prototype.hasOwnProperty.call(Z,Y)){const $=`${ce}${d}${Y}`;G&&!w?ie[Y]=this.translate($,{...i,defaultValue:cx(V)?V[Y]:void 0,joinArrays:!1,ns:p}):ie[Y]=this.translate($,{...i,joinArrays:!1,ns:p}),ie[Y]===$&&(ie[Y]=Z[Y])}w=ie}}else if(z&&at(M)&&Array.isArray(w))w=w.join(M),w&&(w=this.extendTranslation(w,e,i,s));else{let W=!1,ie=!1;!this.isValidLookup(w)&&G&&(W=!0,w=V),this.isValidLookup(w)||(ie=!0,w=f);const Y=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&ie?void 0:w,$=G&&V!==w&&this.options.updateMissing;if(ie||W||$){if(this.logger.log($?"updateKey":"missingKey",b,y,f,$?V:w),d){const B=this.resolve(f,{...i,keySeparator:!1});B&&B.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let ae=[];const Ne=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Ne&&Ne[0])for(let B=0;B<Ne.length;B++)ae.push(Ne[B]);else this.options.saveMissingTo==="all"?ae=this.languageUtils.toResolveHierarchy(i.lng||this.language):ae.push(i.lng||this.language);const me=(B,I,fe)=>{var _e;const xe=G&&fe!==w?fe:Y;this.options.missingKeyHandler?this.options.missingKeyHandler(B,y,I,xe,$,i):(_e=this.backendConnector)!=null&&_e.saveMissing&&this.backendConnector.saveMissing(B,y,I,xe,$,i),this.emit("missingKey",B,y,I,w)};this.options.saveMissing&&(this.options.saveMissingPlurals&&k?ae.forEach(B=>{const I=this.pluralResolver.getSuffixes(B,i);U&&i[`defaultValue${this.options.pluralSeparator}zero`]&&I.indexOf(`${this.options.pluralSeparator}zero`)<0&&I.push(`${this.options.pluralSeparator}zero`),I.forEach(fe=>{me([B],f+fe,i[`defaultValue${fe}`]||V)})}):me(ae,f,V))}w=this.extendTranslation(w,e,i,j,s),ie&&w===f&&this.options.appendNamespaceToMissingKey&&(w=`${y}${S}${f}`),(ie||W)&&this.options.parseMissingKeyHandler&&(w=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${y}${S}${f}`:f,W?w:void 0,i))}return o?(j.res=w,j.usedParams=this.getUsedParamsDetails(i),j):w}extendTranslation(e,n,s,i,o){var p,y;if((p=this.i18nFormat)!=null&&p.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init({...s,interpolation:{...this.options.interpolation,...s.interpolation}});const S=at(e)&&(((y=s==null?void 0:s.interpolation)==null?void 0:y.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let b;if(S){const j=e.match(this.interpolator.nestingRegexp);b=j&&j.length}let _=s.replace&&!at(s.replace)?s.replace:s;if(this.options.interpolation.defaultVariables&&(_={...this.options.interpolation.defaultVariables,..._}),e=this.interpolator.interpolate(e,_,s.lng||this.language||i.usedLng,s),S){const j=e.match(this.interpolator.nestingRegexp),w=j&&j.length;b<w&&(s.nest=!1)}!s.lng&&i&&i.res&&(s.lng=this.language||i.usedLng),s.nest!==!1&&(e=this.interpolator.nest(e,(...j)=>(o==null?void 0:o[0])===j[0]&&!s.context?(this.logger.warn(`It seems you are nesting recursively key: ${j[0]} in key: ${n[0]}`),null):this.translate(...j,n),s)),s.interpolation&&this.interpolator.reset()}const d=s.postProcess||this.options.postProcess,f=at(d)?[d]:d;return e!=null&&(f!=null&&f.length)&&s.applyPostProcessor!==!1&&(e=B6.handle(f,e,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),e}resolve(e,n={}){let s,i,o,d,f;return at(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(p=>typeof p=="function"?kf(p,{...this.options,...n}):p)),e.forEach(p=>{if(this.isValidLookup(s))return;const y=this.extractFromKey(p,n),S=y.key;i=S;let b=y.namespaces;this.options.fallbackNS&&(b=b.concat(this.options.fallbackNS));const _=n.count!==void 0&&!at(n.count),j=_&&!n.ordinal&&n.count===0,w=n.context!==void 0&&(at(n.context)||typeof n.context=="number")&&n.context!=="",T=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);b.forEach(O=>{var R,M;this.isValidLookup(s)||(f=O,!w3[`${T[0]}-${O}`]&&((R=this.utils)!=null&&R.hasLoadedNamespace)&&!((M=this.utils)!=null&&M.hasLoadedNamespace(f))&&(w3[`${T[0]}-${O}`]=!0,this.logger.warn(`key "${i}" for languages "${T.join(", ")}" won't get resolved as namespace "${f}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),T.forEach(z=>{var P;if(this.isValidLookup(s))return;d=z;const k=[S];if((P=this.i18nFormat)!=null&&P.addLookupKeys)this.i18nFormat.addLookupKeys(k,S,z,O,n);else{let L;_&&(L=this.pluralResolver.getSuffix(z,n.count,n));const U=`${this.options.pluralSeparator}zero`,V=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(_&&(n.ordinal&&L.indexOf(V)===0&&k.push(S+L.replace(V,this.options.pluralSeparator)),k.push(S+L),j&&k.push(S+U)),w){const Z=`${S}${this.options.contextSeparator||"_"}${n.context}`;k.push(Z),_&&(n.ordinal&&L.indexOf(V)===0&&k.push(Z+L.replace(V,this.options.pluralSeparator)),k.push(Z+L),j&&k.push(Z+U))}}let G;for(;G=k.pop();)this.isValidLookup(s)||(o=G,s=this.getResource(z,O,G,n))}))})}),{res:s,usedKey:i,exactUsedKey:o,usedLng:d,usedNS:f}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,s,i={}){var o;return(o=this.i18nFormat)!=null&&o.getResource?this.i18nFormat.getResource(e,n,s,i):this.resourceStore.getResource(e,n,s,i)}getUsedParamsDetails(e={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],s=e.replace&&!at(e.replace);let i=s?e.replace:e;if(s&&typeof e.count<"u"&&(i.count=e.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!s){i={...i};for(const o of n)delete i[o]}return i}static hasDefaultValue(e){const n="defaultValue";for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&n===s.substring(0,n.length)&&e[s]!==void 0)return!0;return!1}}class E3{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=hl.create("languageUtils")}getScriptPartFromCode(e){if(e=km(e),!e||e.indexOf("-")<0)return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=km(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(at(e)&&e.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(e)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(s=>{if(n)return;const i=this.formatLanguageCode(s);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&e.forEach(s=>{if(n)return;const i=this.getScriptPartFromCode(s);if(this.isSupportedCode(i))return n=i;const o=this.getLanguagePartFromCode(s);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(d=>{if(d===o)return d;if(!(d.indexOf("-")<0&&o.indexOf("-")<0)&&(d.indexOf("-")>0&&o.indexOf("-")<0&&d.substring(0,d.indexOf("-"))===o||d.indexOf(o)===0&&o.length>1))return d})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),at(e)&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let s=e[n];return s||(s=e[this.getScriptPartFromCode(n)]),s||(s=e[this.formatLanguageCode(n)]),s||(s=e[this.getLanguagePartFromCode(n)]),s||(s=e.default),s||[]}toResolveHierarchy(e,n){const s=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],e),i=[],o=d=>{d&&(this.isSupportedCode(d)?i.push(d):this.logger.warn(`rejecting language code not found in supportedLngs: ${d}`))};return at(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(e))):at(e)&&o(this.formatLanguageCode(e)),s.forEach(d=>{i.indexOf(d)<0&&o(this.formatLanguageCode(d))}),i}}const T3={zero:0,one:1,two:2,few:3,many:4,other:5},R3={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class JR{constructor(e,n={}){this.languageUtils=e,this.options=n,this.logger=hl.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,n={}){const s=km(e==="dev"?"en":e),i=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:s,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let d;try{d=new Intl.PluralRules(s,{type:i})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),R3;if(!e.match(/-|_/))return R3;const p=this.languageUtils.getLanguagePartFromCode(e);d=this.getRule(p,n)}return this.pluralRulesCache[o]=d,d}needsPlural(e,n={}){let s=this.getRule(e,n);return s||(s=this.getRule("dev",n)),(s==null?void 0:s.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,n,s={}){return this.getSuffixes(e,s).map(i=>`${n}${i}`)}getSuffixes(e,n={}){let s=this.getRule(e,n);return s||(s=this.getRule("dev",n)),s?s.resolvedOptions().pluralCategories.sort((i,o)=>T3[i]-T3[o]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(e,n,s={}){const i=this.getRule(e,s);return i?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",n,s))}}const O3=(t,e,n,s=".",i=!0)=>{let o=PR(t,e,n);return!o&&i&&at(n)&&(o=Nb(t,n,s),o===void 0&&(o=Nb(e,n,s))),o},ux=t=>t.replace(/\$/g,"$$$$");class M3{constructor(e={}){var n;this.logger=hl.create("interpolator"),this.options=e,this.format=((n=e==null?void 0:e.interpolation)==null?void 0:n.format)||(s=>s),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:s,useRawValueToEscape:i,prefix:o,prefixEscaped:d,suffix:f,suffixEscaped:p,formatSeparator:y,unescapeSuffix:S,unescapePrefix:b,nestingPrefix:_,nestingPrefixEscaped:j,nestingSuffix:w,nestingSuffixEscaped:T,nestingOptionsSeparator:O,maxReplaces:R,alwaysFormat:M}=e.interpolation;this.escape=n!==void 0?n:VR,this.escapeValue=s!==void 0?s:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=o?Du(o):d||"{{",this.suffix=f?Du(f):p||"}}",this.formatSeparator=y||",",this.unescapePrefix=S?"":b||"-",this.unescapeSuffix=this.unescapePrefix?"":S||"",this.nestingPrefix=_?Du(_):j||Du("$t("),this.nestingSuffix=w?Du(w):T||Du(")"),this.nestingOptionsSeparator=O||",",this.maxReplaces=R||1e3,this.alwaysFormat=M!==void 0?M:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,s)=>(n==null?void 0:n.source)===s?(n.lastIndex=0,n):new RegExp(s,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,n,s,i){var j;let o,d,f;const p=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},y=w=>{if(w.indexOf(this.formatSeparator)<0){const M=O3(n,p,w,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(M,void 0,s,{...i,...n,interpolationkey:w}):M}const T=w.split(this.formatSeparator),O=T.shift().trim(),R=T.join(this.formatSeparator).trim();return this.format(O3(n,p,O,this.options.keySeparator,this.options.ignoreJSONStructure),R,s,{...i,...n,interpolationkey:O})};this.resetRegExp();const S=(i==null?void 0:i.missingInterpolationHandler)||this.options.missingInterpolationHandler,b=((j=i==null?void 0:i.interpolation)==null?void 0:j.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:w=>ux(w)},{regex:this.regexp,safeValue:w=>this.escapeValue?ux(this.escape(w)):ux(w)}].forEach(w=>{for(f=0;o=w.regex.exec(e);){const T=o[1].trim();if(d=y(T),d===void 0)if(typeof S=="function"){const R=S(e,o,i);d=at(R)?R:""}else if(i&&Object.prototype.hasOwnProperty.call(i,T))d="";else if(b){d=o[0];continue}else this.logger.warn(`missed to pass in variable ${T} for interpolating ${e}`),d="";else!at(d)&&!this.useRawValueToEscape&&(d=S3(d));const O=w.safeValue(d);if(e=e.replace(o[0],O),b?(w.regex.lastIndex+=d.length,w.regex.lastIndex-=o[0].length):w.regex.lastIndex=0,f++,f>=this.maxReplaces)break}}),e}nest(e,n,s={}){let i,o,d;const f=(p,y)=>{const S=this.nestingOptionsSeparator;if(p.indexOf(S)<0)return p;const b=p.split(new RegExp(`${Du(S)}[ ]*{`));let _=`{${b[1]}`;p=b[0],_=this.interpolate(_,d);const j=_.match(/'/g),w=_.match(/"/g);(((j==null?void 0:j.length)??0)%2===0&&!w||((w==null?void 0:w.length)??0)%2!==0)&&(_=_.replace(/'/g,'"'));try{d=JSON.parse(_),y&&(d={...y,...d})}catch(T){return this.logger.warn(`failed parsing options string in nesting for key ${p}`,T),`${p}${S}${_}`}return d.defaultValue&&d.defaultValue.indexOf(this.prefix)>-1&&delete d.defaultValue,p};for(;i=this.nestingRegexp.exec(e);){let p=[];d={...s},d=d.replace&&!at(d.replace)?d.replace:d,d.applyPostProcessor=!1,delete d.defaultValue;const y=/{.*}/.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(y!==-1&&(p=i[1].slice(y).split(this.formatSeparator).map(S=>S.trim()).filter(Boolean),i[1]=i[1].slice(0,y)),o=n(f.call(this,i[1].trim(),d),d),o&&i[0]===e&&!at(o))return o;at(o)||(o=S3(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),o=""),p.length&&(o=p.reduce((S,b)=>this.format(S,b,s.lng,{...s,interpolationkey:i[1].trim()}),o.trim())),e=e.replace(i[0],o),this.regexp.lastIndex=0}return e}}const WR=t=>{let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const s=t.split("(");e=s[0].toLowerCase().trim();const i=s[1].substring(0,s[1].length-1);e==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):e==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(d=>{if(d){const[f,...p]=d.split(":"),y=p.join(":").trim().replace(/^'+|'+$/g,""),S=f.trim();n[S]||(n[S]=y),y==="false"&&(n[S]=!1),y==="true"&&(n[S]=!0),isNaN(y)||(n[S]=parseInt(y,10))}})}return{formatName:e,formatOptions:n}},A3=t=>{const e={};return(n,s,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const d=s+JSON.stringify(o);let f=e[d];return f||(f=t(km(s),i),e[d]=f),f(n)}},$R=t=>(e,n,s)=>t(km(n),s)(e);class eO{constructor(e={}){this.logger=hl.create("formatter"),this.options=e,this.init(e)}init(e,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const s=n.cacheInBuiltFormats?A3:$R;this.formats={number:s((i,o)=>{const d=new Intl.NumberFormat(i,{...o});return f=>d.format(f)}),currency:s((i,o)=>{const d=new Intl.NumberFormat(i,{...o,style:"currency"});return f=>d.format(f)}),datetime:s((i,o)=>{const d=new Intl.DateTimeFormat(i,{...o});return f=>d.format(f)}),relativetime:s((i,o)=>{const d=new Intl.RelativeTimeFormat(i,{...o});return f=>d.format(f,o.range||"day")}),list:s((i,o)=>{const d=new Intl.ListFormat(i,{...o});return f=>d.format(f)})}}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=A3(n)}format(e,n,s,i={}){const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(f=>f.indexOf(")")>-1)){const f=o.findIndex(p=>p.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,f)].join(this.formatSeparator)}return o.reduce((f,p)=>{var b;const{formatName:y,formatOptions:S}=WR(p);if(this.formats[y]){let _=f;try{const j=((b=i==null?void 0:i.formatParams)==null?void 0:b[i.interpolationkey])||{},w=j.locale||j.lng||i.locale||i.lng||s;_=this.formats[y](f,w,{...S,...i,...j})}catch(j){this.logger.warn(j)}return _}else this.logger.warn(`there was no format function for ${y}`);return f},e)}}const tO=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class nO extends I1{constructor(e,n,s,i={}){var o,d;super(),this.backend=e,this.store=n,this.services=s,this.languageUtils=s.languageUtils,this.options=i,this.logger=hl.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],(d=(o=this.backend)==null?void 0:o.init)==null||d.call(o,s,i.backend,i)}queueLoad(e,n,s,i){const o={},d={},f={},p={};return e.forEach(y=>{let S=!0;n.forEach(b=>{const _=`${y}|${b}`;!s.reload&&this.store.hasResourceBundle(y,b)?this.state[_]=2:this.state[_]<0||(this.state[_]===1?d[_]===void 0&&(d[_]=!0):(this.state[_]=1,S=!1,d[_]===void 0&&(d[_]=!0),o[_]===void 0&&(o[_]=!0),p[b]===void 0&&(p[b]=!0)))}),S||(f[y]=!0)}),(Object.keys(o).length||Object.keys(d).length)&&this.queue.push({pending:d,pendingCount:Object.keys(d).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(d),toLoadLanguages:Object.keys(f),toLoadNamespaces:Object.keys(p)}}loaded(e,n,s){const i=e.split("|"),o=i[0],d=i[1];n&&this.emit("failedLoading",o,d,n),!n&&s&&this.store.addResourceBundle(o,d,s,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&s&&(this.state[e]=0);const f={};this.queue.forEach(p=>{GR(p.loaded,[o],d),tO(p,e),n&&p.errors.push(n),p.pendingCount===0&&!p.done&&(Object.keys(p.loaded).forEach(y=>{f[y]||(f[y]={});const S=p.loaded[y];S.length&&S.forEach(b=>{f[y][b]===void 0&&(f[y][b]=!0)})}),p.done=!0,p.errors.length?p.callback(p.errors):p.callback())}),this.emit("loaded",f),this.queue=this.queue.filter(p=>!p.done)}read(e,n,s,i=0,o=this.retryTimeout,d){if(!e.length)return d(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:s,tried:i,wait:o,callback:d});return}this.readingCalls++;const f=(y,S)=>{if(this.readingCalls--,this.waitingReads.length>0){const b=this.waitingReads.shift();this.read(b.lng,b.ns,b.fcName,b.tried,b.wait,b.callback)}if(y&&S&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,e,n,s,i+1,o*2,d)},o);return}d(y,S)},p=this.backend[s].bind(this.backend);if(p.length===2){try{const y=p(e,n);y&&typeof y.then=="function"?y.then(S=>f(null,S)).catch(f):f(null,y)}catch(y){f(y)}return}return p(e,n,f)}prepareLoading(e,n,s={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();at(e)&&(e=this.languageUtils.toResolveHierarchy(e)),at(n)&&(n=[n]);const o=this.queueLoad(e,n,s,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(d=>{this.loadOne(d)})}load(e,n,s){this.prepareLoading(e,n,{},s)}reload(e,n,s){this.prepareLoading(e,n,{reload:!0},s)}loadOne(e,n=""){const s=e.split("|"),i=s[0],o=s[1];this.read(i,o,"read",void 0,void 0,(d,f)=>{d&&this.logger.warn(`${n}loading namespace ${o} for language ${i} failed`,d),!d&&f&&this.logger.log(`${n}loaded namespace ${o} for language ${i}`,f),this.loaded(e,d,f)})}saveMissing(e,n,s,i,o,d={},f=()=>{}){var p,y,S,b,_;if((y=(p=this.services)==null?void 0:p.utils)!=null&&y.hasLoadedNamespace&&!((b=(S=this.services)==null?void 0:S.utils)!=null&&b.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${s}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(s==null||s==="")){if((_=this.backend)!=null&&_.create){const j={...d,isUpdate:o},w=this.backend.create.bind(this.backend);if(w.length<6)try{let T;w.length===5?T=w(e,n,s,i,j):T=w(e,n,s,i),T&&typeof T.then=="function"?T.then(O=>f(null,O)).catch(f):f(null,T)}catch(T){f(T)}else w(e,n,s,i,f,j)}!e||!e[0]||this.store.addResource(e[0],n,s,i)}}}const dx=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),at(t[1])&&(e.defaultValue=t[1]),at(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(s=>{e[s]=n[s]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),D3=t=>{var e,n;return at(t.ns)&&(t.ns=[t.ns]),at(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),at(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),((n=(e=t.supportedLngs)==null?void 0:e.indexOf)==null?void 0:n.call(e,"cimode"))<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),typeof t.initImmediate=="boolean"&&(t.initAsync=t.initImmediate),t},K0=()=>{},aO=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})},P6="__i18next_supportNoticeShown",sO=()=>!!(typeof globalThis<"u"&&globalThis[P6]||typeof process<"u"&&v3&&v3.I18NEXT_NO_SUPPORT_NOTICE),rO=()=>{typeof globalThis<"u"&&(globalThis[P6]=!0)},iO=t=>{var e,n,s,i,o,d,f,p,y,S,b,_,j;return!!(((s=(n=(e=t==null?void 0:t.modules)==null?void 0:e.backend)==null?void 0:n.name)==null?void 0:s.indexOf("Locize"))>0||((f=(d=(o=(i=t==null?void 0:t.modules)==null?void 0:i.backend)==null?void 0:o.constructor)==null?void 0:d.name)==null?void 0:f.indexOf("Locize"))>0||(y=(p=t==null?void 0:t.options)==null?void 0:p.backend)!=null&&y.backends&&t.options.backend.backends.some(w=>{var T,O,R;return((T=w==null?void 0:w.name)==null?void 0:T.indexOf("Locize"))>0||((R=(O=w==null?void 0:w.constructor)==null?void 0:O.name)==null?void 0:R.indexOf("Locize"))>0})||(b=(S=t==null?void 0:t.options)==null?void 0:S.backend)!=null&&b.projectId||(j=(_=t==null?void 0:t.options)==null?void 0:_.backend)!=null&&j.backendOptions&&t.options.backend.backendOptions.some(w=>w==null?void 0:w.projectId))};class bm extends I1{constructor(e={},n){if(super(),this.options=D3(e),this.services={},this.logger=hl,this.modules={external:[]},aO(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(e={},n){this.isInitializing=!0,typeof e=="function"&&(n=e,e={}),e.defaultNS==null&&e.ns&&(at(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const s=dx();this.options={...s,...this.options,...D3(e)},this.options.interpolation={...s.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=s.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!iO(this)&&!sO()&&(typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),rO());const i=y=>y?typeof y=="function"?new y:y:null;if(!this.options.isClone){this.modules.logger?hl.init(i(this.modules.logger),this.options):hl.init(null,this.options);let y;this.modules.formatter?y=this.modules.formatter:y=eO;const S=new E3(this.options);this.store=new j3(this.options.resources,this.options);const b=this.services;b.logger=hl,b.resourceStore=this.store,b.languageUtils=S,b.pluralResolver=new JR(S,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==s.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),y&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(b.formatter=i(y),b.formatter.init&&b.formatter.init(b,this.options),this.options.interpolation.format=b.formatter.format.bind(b.formatter)),b.interpolator=new M3(this.options),b.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},b.backendConnector=new nO(i(this.modules.backend),b.resourceStore,b,this.options),b.backendConnector.on("*",(j,...w)=>{this.emit(j,...w)}),this.modules.languageDetector&&(b.languageDetector=i(this.modules.languageDetector),b.languageDetector.init&&b.languageDetector.init(b,this.options.detection,this.options)),this.modules.i18nFormat&&(b.i18nFormat=i(this.modules.i18nFormat),b.i18nFormat.init&&b.i18nFormat.init(this)),this.translator=new O1(this.services,this.options),this.translator.on("*",(j,...w)=>{this.emit(j,...w)}),this.modules.external.forEach(j=>{j.init&&j.init(this)})}if(this.format=this.options.interpolation.format,n||(n=K0),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const y=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);y.length>0&&y[0]!=="dev"&&(this.options.lng=y[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(y=>{this[y]=(...S)=>this.store[y](...S)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(y=>{this[y]=(...S)=>(this.store[y](...S),this)});const f=Fp(),p=()=>{const y=(S,b)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),f.resolve(b),n(S,b)};if(this.languages&&!this.isInitialized)return y(null,this.t.bind(this));this.changeLanguage(this.options.lng,y)};return this.options.resources||!this.options.initAsync?p():setTimeout(p,0),f}loadResources(e,n=K0){var o,d;let s=n;const i=at(e)?e:this.language;if(typeof e=="function"&&(s=e),!this.options.resources||this.options.partialBundledLanguages){if((i==null?void 0:i.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return s();const f=[],p=y=>{if(!y||y==="cimode")return;this.services.languageUtils.toResolveHierarchy(y).forEach(b=>{b!=="cimode"&&f.indexOf(b)<0&&f.push(b)})};i?p(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(S=>p(S)),(d=(o=this.options.preload)==null?void 0:o.forEach)==null||d.call(o,y=>p(y)),this.services.backendConnector.load(f,this.options.ns,y=>{!y&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),s(y)})}else s(null)}reloadResources(e,n,s){const i=Fp();return typeof e=="function"&&(s=e,e=void 0),typeof n=="function"&&(s=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),s||(s=K0),this.services.backendConnector.reload(e,n,o=>{i.resolve(),s(o)}),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&B6.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let n=0;n<this.languages.length;n++){const s=this.languages[n];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,n){this.isLanguageChangingTo=e;const s=Fp();this.emit("languageChanging",e);const i=f=>{this.language=f,this.languages=this.services.languageUtils.toResolveHierarchy(f),this.resolvedLanguage=void 0,this.setResolvedLanguage(f)},o=(f,p)=>{p?this.isLanguageChangingTo===e&&(i(p),this.translator.changeLanguage(p),this.isLanguageChangingTo=void 0,this.emit("languageChanged",p),this.logger.log("languageChanged",p)):this.isLanguageChangingTo=void 0,s.resolve((...y)=>this.t(...y)),n&&n(f,(...y)=>this.t(...y))},d=f=>{var S,b;!e&&!f&&this.services.languageDetector&&(f=[]);const p=at(f)?f:f&&f[0],y=this.store.hasLanguageSomeTranslations(p)?p:this.services.languageUtils.getBestMatchFromCodes(at(f)?[f]:f);y&&(this.language||i(y),this.translator.language||this.translator.changeLanguage(y),(b=(S=this.services.languageDetector)==null?void 0:S.cacheUserLanguage)==null||b.call(S,y)),this.loadResources(y,_=>{o(_,y)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?d(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(d):this.services.languageDetector.detect(d):d(e),s}getFixedT(e,n,s){const i=(o,d,...f)=>{let p;typeof d!="object"?p=this.options.overloadTranslationOptionHandler([o,d].concat(f)):p={...d},p.lng=p.lng||i.lng,p.lngs=p.lngs||i.lngs,p.ns=p.ns||i.ns,p.keyPrefix!==""&&(p.keyPrefix=p.keyPrefix||s||i.keyPrefix);const y={...this.options,...p};typeof p.keyPrefix=="function"&&(p.keyPrefix=kf(p.keyPrefix,y));const S=this.options.keySeparator||".";let b;return p.keyPrefix&&Array.isArray(o)?b=o.map(_=>(typeof _=="function"&&(_=kf(_,y)),`${p.keyPrefix}${S}${_}`)):(typeof o=="function"&&(o=kf(o,y)),b=p.keyPrefix?`${p.keyPrefix}${S}${o}`:o),this.t(b,p)};return at(e)?i.lng=e:i.lngs=e,i.ns=n,i.keyPrefix=s,i}t(...e){var n;return(n=this.translator)==null?void 0:n.translate(...e)}exists(...e){var n;return(n=this.translator)==null?void 0:n.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const s=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const d=(f,p)=>{const y=this.services.backendConnector.state[`${f}|${p}`];return y===-1||y===0||y===2};if(n.precheck){const f=n.precheck(this,d);if(f!==void 0)return f}return!!(this.hasResourceBundle(s,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||d(s,e)&&(!i||d(o,e)))}loadNamespaces(e,n){const s=Fp();return this.options.ns?(at(e)&&(e=[e]),e.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{s.resolve(),n&&n(i)}),s):(n&&n(),Promise.resolve())}loadLanguages(e,n){const s=Fp();at(e)&&(e=[e]);const i=this.options.preload||[],o=e.filter(d=>i.indexOf(d)<0&&this.services.languageUtils.isSupportedCode(d));return o.length?(this.options.preload=i.concat(o),this.loadResources(d=>{s.resolve(),n&&n(d)}),s):(n&&n(),Promise.resolve())}dir(e){var i,o;if(e||(e=this.resolvedLanguage||(((i=this.languages)==null?void 0:i.length)>0?this.languages[0]:this.language)),!e)return"rtl";try{const d=new Intl.Locale(e);if(d&&d.getTextInfo){const f=d.getTextInfo();if(f&&f.direction)return f.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],s=((o=this.services)==null?void 0:o.languageUtils)||new E3(dx());return e.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(s.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},n){const s=new bm(e,n);return s.createInstance=bm.createInstance,s}cloneInstance(e={},n=K0){const s=e.forkResourceStore;s&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},o=new bm(i);if((e.debug!==void 0||e.prefix!==void 0)&&(o.logger=o.logger.clone(e)),["store","services","language"].forEach(f=>{o[f]=this[f]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},s){const f=Object.keys(this.store.data).reduce((p,y)=>(p[y]={...this.store.data[y]},p[y]=Object.keys(p[y]).reduce((S,b)=>(S[b]={...p[y][b]},S),p[y]),p),{});o.store=new j3(f,i),o.services.resourceStore=o.store}if(e.interpolation){const p={...dx().interpolation,...this.options.interpolation,...e.interpolation},y={...i,interpolation:p};o.services.interpolator=new M3(y)}return o.translator=new O1(o.services,i),o.translator.on("*",(f,...p)=>{o.emit(f,...p)}),o.init(i,n),o.translator.options=i,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const vs=bm.createInstance();vs.createInstance;vs.dir;vs.init;vs.loadResources;vs.reloadResources;vs.use;vs.changeLanguage;vs.getFixedT;vs.t;vs.exists;vs.setDefaultNamespace;vs.hasLoadedNamespace;vs.loadNamespaces;vs.loadLanguages;const lO=(t,e,n,s)=>{var o,d,f,p;const i=[n,{code:e,...s||{}}];if((d=(o=t==null?void 0:t.services)==null?void 0:o.logger)!=null&&d.forward)return t.services.logger.forward(i,"warn","react-i18next::",!0);Iu(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),(p=(f=t==null?void 0:t.services)==null?void 0:f.logger)!=null&&p.warn?t.services.logger.warn(...i):console!=null&&console.warn&&console.warn(...i)},z3={},_b=(t,e,n,s)=>{Iu(n)&&z3[n]||(Iu(n)&&(z3[n]=new Date),lO(t,e,n,s))},Y6=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}},Cb=(t,e,n)=>{t.loadNamespaces(e,Y6(t,n))},k3=(t,e,n,s)=>{if(Iu(n)&&(n=[n]),t.options.preload&&t.options.preload.indexOf(e)>-1)return Cb(t,n,s);n.forEach(i=>{t.options.ns.indexOf(i)<0&&t.options.ns.push(i)}),t.loadLanguages(e,Y6(t,s))},oO=(t,e,n={})=>!e.languages||!e.languages.length?(_b(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(t,{lng:n.lng,precheck:(s,i)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&s.services.backendConnector.backend&&s.isLanguageChangingTo&&!i(s.isLanguageChangingTo,t))return!1}}),Iu=t=>typeof t=="string",cO=t=>typeof t=="object"&&t!==null,uO=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,dO={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},fO=t=>dO[t],hO=t=>t.replace(uO,fO);let jb={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:hO,transDefaultProps:void 0};const pO=(t={})=>{jb={...jb,...t}},mO=()=>jb;let V6;const gO=t=>{V6=t},yO=()=>V6,xO={type:"3rdParty",init(t){pO(t.options.react),gO(t)}},bO=D.createContext();class vO{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var fx={exports:{}},hx={};/**
|
|
546
|
-
* @license React
|
|
547
|
-
* use-sync-external-store-shim.production.js
|
|
548
|
-
*
|
|
549
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
550
|
-
*
|
|
551
|
-
* This source code is licensed under the MIT license found in the
|
|
552
|
-
* LICENSE file in the root directory of this source tree.
|
|
553
|
-
*/var L3;function SO(){if(L3)return hx;L3=1;var t=gl();function e(b,_){return b===_&&(b!==0||1/b===1/_)||b!==b&&_!==_}var n=typeof Object.is=="function"?Object.is:e,s=t.useState,i=t.useEffect,o=t.useLayoutEffect,d=t.useDebugValue;function f(b,_){var j=_(),w=s({inst:{value:j,getSnapshot:_}}),T=w[0].inst,O=w[1];return o(function(){T.value=j,T.getSnapshot=_,p(T)&&O({inst:T})},[b,j,_]),i(function(){return p(T)&&O({inst:T}),b(function(){p(T)&&O({inst:T})})},[b]),d(j),j}function p(b){var _=b.getSnapshot;b=b.value;try{var j=_();return!n(b,j)}catch{return!0}}function y(b,_){return _()}var S=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?y:f;return hx.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:S,hx}var U3;function NO(){return U3||(U3=1,fx.exports=SO()),fx.exports}var _O=NO();const CO=(t,e)=>{if(Iu(e))return e;if(cO(e)&&Iu(e.defaultValue))return e.defaultValue;if(typeof t=="function")return"";if(Array.isArray(t)){const n=t[t.length-1];return typeof n=="function"?"":n}return t},jO={t:CO,ready:!1},wO=()=>()=>{},Er=(t,e={})=>{var V,Z,re;const{i18n:n}=e,{i18n:s,defaultNS:i}=D.useContext(bO)||{},o=n||s||yO();o&&!o.reportNamespaces&&(o.reportNamespaces=new vO),o||_b(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const d=D.useMemo(()=>{var ne;return{...mO(),...(ne=o==null?void 0:o.options)==null?void 0:ne.react,...e}},[o,e]),{useSuspense:f,keyPrefix:p}=d,y=i||((V=o==null?void 0:o.options)==null?void 0:V.defaultNS),S=Iu(y)?[y]:y||["translation"],b=D.useMemo(()=>S,S);(re=(Z=o==null?void 0:o.reportNamespaces)==null?void 0:Z.addUsedNamespaces)==null||re.call(Z,b);const _=D.useRef(0),j=D.useCallback(ne=>{if(!o)return wO;const{bindI18n:W,bindI18nStore:ie}=d,ce=()=>{_.current+=1,ne()};return W&&o.on(W,ce),ie&&o.store.on(ie,ce),()=>{W&&W.split(" ").forEach(Y=>o.off(Y,ce)),ie&&ie.split(" ").forEach(Y=>o.store.off(Y,ce))}},[o,d]),w=D.useRef(),T=D.useCallback(()=>{if(!o)return jO;const ne=!!(o.isInitialized||o.initializedStoreOnce)&&b.every(ae=>oO(ae,o,d)),W=e.lng||o.language,ie=_.current,ce=w.current;if(ce&&ce.ready===ne&&ce.lng===W&&ce.keyPrefix===p&&ce.revision===ie)return ce;const $={t:o.getFixedT(W,d.nsMode==="fallback"?b:b[0],p),ready:ne,lng:W,keyPrefix:p,revision:ie};return w.current=$,$},[o,b,p,d,e.lng]),[O,R]=D.useState(0),{t:M,ready:z}=_O.useSyncExternalStore(j,T,T);D.useEffect(()=>{if(o&&!z&&!f){const ne=()=>R(W=>W+1);e.lng?k3(o,e.lng,b,ne):Cb(o,b,ne)}},[o,e.lng,b,z,f,O]);const k=o||{},G=D.useRef(null),P=D.useRef(),L=ne=>{const W=Object.getOwnPropertyDescriptors(ne);W.__original&&delete W.__original;const ie=Object.create(Object.getPrototypeOf(ne),W);if(!Object.prototype.hasOwnProperty.call(ie,"__original"))try{Object.defineProperty(ie,"__original",{value:ne,writable:!1,enumerable:!1,configurable:!1})}catch{}return ie},U=D.useMemo(()=>{const ne=k,W=ne==null?void 0:ne.language;let ie=ne;ne&&(G.current&&G.current.__original===ne?P.current!==W?(ie=L(ne),G.current=ie,P.current=W):ie=G.current:(ie=L(ne),G.current=ie,P.current=W));const ce=!z&&!f?(...$)=>(_b(o,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),M(...$)):M,Y=[ce,ie,z];return Y.t=ce,Y.i18n=ie,Y.ready=z,Y},[M,k,z,k.resolvedLanguage,k.language,k.languages]);if(o&&f&&!z)throw new Promise(ne=>{const W=()=>ne();e.lng?k3(o,e.lng,b,W):Cb(o,b,W)});return U};function Q6(t){return t.map(e=>({id:e.page.id,addonId:e.addonId,label:e.page.label,icon:e.page.icon,path:e.page.path,bundle:e.page.bundle,bundleUrl:e.bundleUrl}))}const q3=new Map;function EO(){const{pagePath:t}=tv(),e=Am(),{data:n}=dt({queryKey:["addon-pages"],queryFn:async()=>{const p=await e.trpc.addonPages.listPages.query();return Q6(p)},staleTime:6e4}),s=n==null?void 0:n.find(p=>p.path===`/addon/${t}`),[i,o]=D.useState(null),[d,f]=D.useState(null);return D.useEffect(()=>{if(!s)return;const p=`${s.addonId}/${s.bundle}`,y=q3.get(p);if(y){o(()=>y);return}f(null),o(null);const S=s.bundleUrl;import(S).then(b=>{const _=b.default;if(typeof _!="function")throw new Error(`Addon page "${s.id}" does not export a default React component`);q3.set(p,_),o(()=>_)}).catch(b=>{console.error(`[AddonPageLoader] Failed to load ${S}:`,b),f(`Failed to load addon page: ${b.message}`)})},[s]),n?s?d?h.jsx("div",{className:"flex items-center justify-center h-full text-red-400 text-sm",children:d}):i?h.jsx(i,{trpc:e.trpc,theme:{isDark:document.documentElement.classList.contains("dark")},navigate:p=>{window.location.href=p}}):h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx("div",{className:"animate-spin h-6 w-6 border-2 border-primary border-t-transparent rounded-full"})}):h.jsx("div",{className:"flex items-center justify-center h-full text-foreground-subtle",children:"Addon page not found"}):h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx("div",{className:"animate-spin h-6 w-6 border-2 border-primary border-t-transparent rounded-full"})})}const TO={dark:JT,light:gR,system:j1},RO={gauge:wT,puzzle:w1,bot:Sb,cpu:zf,terminal:xR,box:BE,wrench:q6,activity:dv,plug:L6};function OO(){const t=yl(),e=xl(),{user:n,logout:s}=uv(),i=NS(),{t:o,i18n:d}=Er(),f=Am(),p=GS(),[y,S]=D.useState(!1),{data:b=0}=dt({queryKey:["updates","count"],queryFn:async()=>(await f.trpc.addons.listUpdates.query()).length,staleTime:3e4,refetchInterval:3e4}),{data:_}=dt({queryKey:["addon-pages"],queryFn:async()=>{const G=await f.trpc.addonPages.listPages.query();return Q6(G)},staleTime:6e4}),j=()=>{s(),e("/login")},w=G=>t.pathname===G||t.pathname.startsWith(G+"/"),T=()=>{const G=d.language==="en"?"it":"en";d.changeLanguage(G)},O=[{label:o("nav.cameras","Cameras"),icon:Lc,path:"/cameras"},{label:o("nav.integrations"),icon:L6,path:"/integrations"},{label:o("nav.timeline","Timeline"),icon:M6,path:"/timeline"},{label:o("nav.pipeline","Pipeline"),icon:X1,path:"/pipeline"}],R=[{label:o("system.addons"),icon:w1,path:"/system/addons"},{label:o("system.agents","Agents & Processes"),icon:E1,path:"/system/agents"},{label:o("system.logs"),icon:Jm,path:"/system/logs"},{label:o("system.users"),icon:RR,path:"/system/users"},{label:o("system.settings"),icon:q6,path:"/system/settings"}],M=(i==null?void 0:i.mode)??"system",z={dark:o("theme.dark"),light:o("theme.light"),system:o("theme.system")},k=h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"flex h-14 items-center px-3 border-b border-border",children:h.jsx("img",{src:(i==null?void 0:i.resolvedMode)==="light"?"/brand/logo-horizontal-light.svg":"/brand/logo-horizontal-dark.svg",alt:"CamStack Admin",className:"h-9"})}),h.jsxs("nav",{className:"flex-1 overflow-y-auto py-3 px-2 space-y-0.5",children:[(()=>{const G=w("/dashboard");return h.jsxs("button",{onClick:()=>{e("/dashboard"),S(!1)},className:`flex w-full items-center gap-2.5 rounded-md px-2.5 py-2 text-[13px] font-medium transition-all ${G?"bg-primary/12 text-primary shadow-sm shadow-primary/5":"text-foreground-subtle hover:bg-surface-hover hover:text-foreground"}`,children:[h.jsx(z6,{className:`h-4 w-4 shrink-0 ${G?"text-primary":""}`}),o("nav.dashboard")]})})(),h.jsx("div",{className:"pt-4 pb-1.5 px-2.5",children:h.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/60",children:o("nav.camerasSection","Cameras")})}),O.map(G=>{const P=G.icon,L=w(G.path);return h.jsxs("button",{onClick:()=>{e(G.path),S(!1)},className:`flex w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-[12px] transition-all ${L?"bg-primary/12 text-primary":"text-foreground-subtle hover:bg-surface-hover hover:text-foreground"}`,children:[h.jsx(P,{className:`h-3.5 w-3.5 shrink-0 ${L?"text-primary":""}`}),G.label]},G.path)}),h.jsx("div",{className:"pt-4 pb-1.5 px-2.5",children:h.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/60",children:o("system.title")})}),R.map(G=>{const P=G.icon,L=w(G.path),U=G.path==="/system/addons";return h.jsxs("button",{onClick:()=>{e(G.path),S(!1)},className:`flex w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-[12px] transition-all ${L?"bg-primary/12 text-primary":"text-foreground-subtle hover:bg-surface-hover hover:text-foreground"}`,children:[h.jsx(P,{className:`h-3.5 w-3.5 shrink-0 ${L?"text-primary":""}`}),h.jsx("span",{className:"flex-1 text-left",children:G.label}),U&&b>0&&h.jsx("span",{className:"ml-auto rounded-full bg-primary px-1.5 py-0.5 text-[9px] font-bold text-primary-foreground leading-none",children:b})]},G.path)}),_&&_.length>0&&h.jsx("div",{className:"pt-4 pb-1.5 px-2.5",children:h.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/60",children:o("nav.addonPages","Addon Pages")})}),_==null?void 0:_.map(G=>{const P=w(G.path),L=RO[G.icon]??w1;return h.jsxs("button",{onClick:()=>{e(G.path),S(!1)},className:`flex w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-[12px] transition-all ${P?"bg-primary/12 text-primary":"text-foreground-subtle hover:bg-surface-hover hover:text-foreground"}`,children:[h.jsx(L,{className:`h-3.5 w-3.5 shrink-0 ${P?"text-primary":""}`}),G.label]},G.id)})]}),h.jsxs("div",{className:"border-t border-border p-2 space-y-0.5",children:[h.jsxs("button",{onClick:T,title:o("language.select"),className:"flex w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-[12px] text-foreground-subtle hover:bg-surface-hover hover:text-foreground transition-colors",children:[h.jsx(kT,{className:"h-3.5 w-3.5 shrink-0"}),h.jsx("span",{children:d.language==="en"?o("language.en"):o("language.it")})]}),h.jsxs("button",{onClick:()=>i==null?void 0:i.toggleMode(),className:"flex w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-[12px] text-foreground-subtle hover:bg-surface-hover hover:text-foreground transition-colors",children:[(()=>{const G=TO[M];return h.jsx(G,{className:"h-3.5 w-3.5"})})(),h.jsx("span",{children:z[M]})]}),h.jsxs("button",{onClick:j,className:"flex w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-[12px] text-foreground-subtle hover:bg-surface-hover hover:text-danger transition-colors",children:[h.jsx(YT,{className:"h-3.5 w-3.5"}),h.jsx("span",{className:"truncate",children:(n==null?void 0:n.username)??"User"})]})]})]});return h.jsxs("div",{className:"flex h-screen bg-background text-foreground",children:[!p&&h.jsx("aside",{className:"flex w-48 flex-col border-r border-border bg-surface/80 backdrop-blur-sm shrink-0",children:k}),p&&h.jsx(ej,{open:y,onClose:()=>S(!1),width:"w-64",children:k}),h.jsxs("div",{className:"flex flex-1 flex-col min-w-0",children:[p&&h.jsxs("header",{className:"flex items-center h-12 border-b border-border px-3 shrink-0 bg-surface/80 backdrop-blur-sm",children:[h.jsx("button",{onClick:()=>S(!0),className:"p-1.5 -ml-1.5 rounded-md hover:bg-surface-hover text-foreground-muted transition-colors","aria-label":"Open menu",children:h.jsx(QT,{className:"h-5 w-5"})}),h.jsx("div",{className:"flex-1 flex justify-center",children:h.jsx("img",{src:(i==null?void 0:i.resolvedMode)==="light"?"/brand/logo-horizontal-light.svg":"/brand/logo-horizontal-dark.svg",alt:"CamStack",className:"h-7"})}),h.jsx("div",{className:"w-8"})]}),h.jsx("main",{className:"flex-1 overflow-auto bg-background",children:h.jsx(HN,{})})]})]})}function MO(){const{login:t}=uv(),e=NS(),n=xl(),[s,i]=D.useState(""),[o,d]=D.useState(""),[f,p]=D.useState(!1),[y,S]=D.useState(""),[b,_]=D.useState(!1),j=async w=>{w.preventDefault(),S(""),_(!0);try{await t(s,o),n("/dashboard",{replace:!0})}catch(T){S(T instanceof Error?T.message:"Login failed")}finally{_(!1)}};return h.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:h.jsxs("div",{className:"w-full max-w-sm",children:[h.jsx("div",{className:"flex justify-center mb-8",children:h.jsx("img",{src:(e==null?void 0:e.resolvedMode)==="light"?"/brand/logo-horizontal-light.svg":"/brand/logo-horizontal-dark.svg",alt:"CamStack Admin",className:"h-12"})}),h.jsxs("form",{onSubmit:j,className:"space-y-4 rounded-xl border border-border bg-surface p-6 shadow-xl shadow-black/10",children:[y&&h.jsx("div",{className:"rounded-md bg-danger/10 border border-danger/20 px-3 py-2 text-xs text-danger",children:y}),h.jsxs("div",{className:"space-y-1.5",children:[h.jsx("label",{className:"text-xs font-medium text-foreground-subtle",children:"Username"}),h.jsx("input",{type:"text",placeholder:"admin",value:s,onChange:w=>i(w.target.value),className:"w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm text-foreground placeholder:text-foreground-disabled focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none transition-all",autoFocus:!0})]}),h.jsxs("div",{className:"space-y-1.5",children:[h.jsx("label",{className:"text-xs font-medium text-foreground-subtle",children:"Password"}),h.jsxs("div",{className:"relative",children:[h.jsx("input",{type:f?"text":"password",placeholder:"Enter password",value:o,onChange:w=>d(w.target.value),className:"w-full rounded-lg border border-border bg-background px-3 py-2.5 pr-10 text-sm text-foreground placeholder:text-foreground-disabled focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none transition-all"}),h.jsx("button",{type:"button",onClick:()=>p(!f),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-foreground-subtle hover:text-foreground transition-colors",tabIndex:-1,children:f?h.jsx(A6,{className:"h-4 w-4"}):h.jsx(uh,{className:"h-4 w-4"})})]})]}),h.jsx("button",{type:"submit",disabled:b||!s||!o,className:"w-full rounded-lg bg-primary px-4 py-2.5 text-sm font-semibold text-primary-foreground shadow-md shadow-primary/20 hover:shadow-lg hover:shadow-primary/30 disabled:opacity-50 disabled:shadow-none transition-all",children:b?h.jsxs("span",{className:"flex items-center justify-center gap-2",children:[h.jsx("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-primary-foreground/30 border-t-primary-foreground"}),"Logging in..."]}):"Log in"})]}),h.jsx("p",{className:"mt-6 text-center text-[10px] text-foreground-subtle/50",children:"CamStack v0.1.0"})]})})}function AO(){const t=xl();return h.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center bg-background text-foreground p-4",children:[h.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-danger/10 mb-4",children:h.jsx(hR,{className:"h-8 w-8 text-danger"})}),h.jsx("h1",{className:"text-xl font-bold",children:"Access Denied"}),h.jsx("p",{className:"mt-2 text-sm text-foreground-subtle",children:"You don't have permission to access this page."}),h.jsx("button",{onClick:()=>t("/dashboard"),className:"mt-6 rounded-lg bg-primary px-5 py-2.5 text-sm font-medium text-primary-foreground shadow-md shadow-primary/20 hover:shadow-lg transition-all",children:"Go to Dashboard"})]})}const xv=new Map;function bv(t){xv.set(t.id,t)}function H3(t){return xv.get(t)}function DO(){return Array.from(xv.values())}function en(){return D.useMemo(()=>Am(),[])}function zO({config:t,size:e}){const n=en(),{data:s,isLoading:i,error:o}=dt({queryKey:["system-info"],queryFn:()=>n.getSystemInfo(),refetchInterval:1e4});if(i)return h.jsxs("div",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[h.jsx(ml,{className:"h-3.5 w-3.5 animate-spin"}),h.jsx("span",{children:"Connecting to server..."})]});if(o)return h.jsxs("div",{className:"flex items-center gap-2 text-xs text-danger",children:[h.jsx(Z1,{className:"h-3.5 w-3.5"}),h.jsx("span",{children:"Unable to reach server"})]});const d=s;return h.jsxs("div",{className:"space-y-2 text-xs",children:[h.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[h.jsx(sT,{className:"h-3.5 w-3.5 text-success"}),h.jsx("span",{className:"text-success font-medium",children:"Online"})]}),h.jsx(X0,{label:"Version",value:String((d==null?void 0:d.version)??"N/A")}),h.jsx(X0,{label:"Uptime",value:kO(d==null?void 0:d.uptime)}),h.jsx(X0,{label:"Memory",value:`${LO(d==null?void 0:d.memoryUsage)} MB`}),h.jsx(X0,{label:"Platform",value:String((d==null?void 0:d.platform)??"N/A")})]})}function X0({label:t,value:e}){return h.jsxs("div",{className:"flex justify-between items-center",children:[h.jsx("span",{className:"text-foreground-subtle",children:t}),h.jsx("span",{className:"text-foreground font-medium tabular-nums",children:e})]})}function kO(t){if(!t)return"N/A";const e=Math.floor(t/3600),n=Math.floor(t%3600/60);return e>0?`${e}h ${n}m`:`${n}m`}function LO(t){return t?(t/1024/1024).toFixed(0):"N/A"}const UO=["class-filter","tracker","sub-detection","recognition","zone-analysis","event-generation","object-snapshot"];function qO({config:t,size:e}){const n=en(),{data:s,isLoading:i,error:o}=dt({queryKey:["pipelines"],queryFn:()=>n.listPipelines(),refetchInterval:5e3});if(i)return h.jsx("div",{className:"text-xs text-foreground-subtle animate-pulse",children:"Loading..."});if(o)return h.jsx("div",{className:"text-xs text-danger",children:"Failed to load pipelines"});const d=s??[];return h.jsxs("div",{className:"space-y-2 text-xs",children:[h.jsxs("div",{className:"flex justify-between text-foreground-subtle",children:[h.jsx("span",{children:"Active pipelines"}),h.jsx("span",{className:"font-medium text-foreground",children:d.length})]}),h.jsx("div",{className:"space-y-0.5",children:UO.map(f=>h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-success shrink-0"}),h.jsx("span",{className:"text-foreground-subtle",children:f})]},f))})]})}function HO(t){if(t<60)return`${Math.floor(t)}s`;if(t<3600)return`${Math.floor(t/60)}m`;const e=Math.floor(t/3600),n=Math.floor(t%3600/60);return`${e}h ${n}m`}function BO({config:t,size:e}){const n=en(),{data:s,isLoading:i,error:o}=dt({queryKey:["system-info"],queryFn:async()=>await n.getSystemInfo(),refetchInterval:3e4}),{data:d}=dt({queryKey:["storage-addons"],queryFn:()=>n.listAddons(),refetchInterval:6e4});if(i)return h.jsx("div",{className:"text-xs text-foreground-subtle animate-pulse",children:"Loading..."});if(o)return h.jsx("div",{className:"text-xs text-danger",children:"Failed to load system info"});const f=d??[];return h.jsxs("div",{className:"space-y-1.5 text-xs",children:[h.jsxs("div",{className:"flex justify-between",children:[h.jsx("span",{className:"text-foreground-subtle",children:"Platform"}),h.jsx("span",{className:"text-foreground font-medium",children:(s==null?void 0:s.platform)??"N/A"})]}),h.jsxs("div",{className:"flex justify-between",children:[h.jsx("span",{className:"text-foreground-subtle",children:"Uptime"}),h.jsx("span",{className:"text-foreground font-medium",children:(s==null?void 0:s.uptime)!=null?HO(s.uptime):"N/A"})]}),h.jsxs("div",{className:"flex justify-between",children:[h.jsx("span",{className:"text-foreground-subtle",children:"Node"}),h.jsx("span",{className:"text-foreground font-medium font-mono",children:(s==null?void 0:s.nodeVersion)??"N/A"})]}),h.jsxs("div",{className:"flex justify-between",children:[h.jsx("span",{className:"text-foreground-subtle",children:"Addons"}),h.jsxs("span",{className:"text-foreground font-medium",children:[f.length," installed"]})]})]})}bv({id:"system-status",name:"System Status",icon:j1,defaultSize:{w:4,h:2},minSize:{w:2,h:2},component:zO});bv({id:"pipeline-stages",name:"Pipeline Stages",icon:LR,defaultSize:{w:4,h:3},minSize:{w:3,h:2},component:qO});bv({id:"storage",name:"Storage",icon:ym,defaultSize:{w:4,h:2},minSize:{w:2,h:2},component:BO});function fh(t){const{margin:e,containerPadding:n,containerWidth:s,cols:i}=t;return(s-e[0]*(i-1)-n[0]*2)/i}function th(t,e,n){return Number.isFinite(t)?Math.round(e*t+Math.max(0,t-1)*n):t}function Zp(t,e,n,s,i,o,d){const{margin:f,containerPadding:p,rowHeight:y}=t,S=fh(t);let b,_,j,w;if(d?(b=Math.round(d.width),_=Math.round(d.height)):(b=th(s,S,f[0]),_=th(i,y,f[1])),o?(j=Math.round(o.top),w=Math.round(o.left)):d?(j=Math.round(d.top),w=Math.round(d.left)):(j=Math.round((y+f[1])*n+p[1]),w=Math.round((S+f[0])*e+p[0])),!o&&!d){if(Number.isFinite(s)){const O=Math.round((S+f[0])*(e+s)+p[0])-w-b;O!==f[0]&&(b+=O-f[0])}if(Number.isFinite(i)){const O=Math.round((y+f[1])*(n+i)+p[1])-j-_;O!==f[1]&&(_+=O-f[1])}}return{top:j,left:w,width:b,height:_}}function GO(t,e,n,s,i){const{margin:o,containerPadding:d,cols:f,rowHeight:p,maxRows:y}=t,S=fh(t);let b=Math.round((n-d[0])/(S+o[0])),_=Math.round((e-d[1])/(p+o[1]));return b=M1(b,0,f-s),_=M1(_,0,y-i),{x:b,y:_}}function F0(t,e,n){const{margin:s,containerPadding:i,rowHeight:o}=t,d=fh(t),f=Math.round((n-i[0])/(d+s[0])),p=Math.round((e-i[1])/(o+s[1]));return{x:f,y:p}}function PO(t,e,n){const{margin:s,rowHeight:i}=t,o=fh(t),d=Math.max(1,Math.round((e+s[0])/(o+s[0]))),f=Math.max(1,Math.round((n+s[1])/(i+s[1])));return{w:d,h:f}}function M1(t,e,n){return Math.max(Math.min(t,n),e)}function vv(t,e){return!(t.i===e.i||t.x+t.w<=e.x||t.x>=e.x+e.w||t.y+t.h<=e.y||t.y>=e.y+e.h)}function Fu(t,e){for(let n=0;n<t.length;n++){const s=t[n];if(s!==void 0&&vv(s,e))return s}}function K6(t,e){return t.filter(n=>vv(n,e))}function YO(t,e){return e==="horizontal"?X6(t):e==="vertical"||e==="wrap"?wb(t):[...t]}function wb(t){return[...t].sort((e,n)=>e.y!==n.y?e.y-n.y:e.x-n.x)}function X6(t){return[...t].sort((e,n)=>e.x!==n.x?e.x-n.x:e.y-n.y)}function J1(t){let e=0;for(let n=0;n<t.length;n++){const s=t[n];if(s!==void 0){const i=s.y+s.h;i>e&&(e=i)}}return e}function Lu(t,e){for(let n=0;n<t.length;n++){const s=t[n];if(s!==void 0&&s.i===e)return s}}function W1(t){return t.filter(e=>e.static===!0)}function Ju(t){return{i:t.i,x:t.x,y:t.y,w:t.w,h:t.h,minW:t.minW,maxW:t.maxW,minH:t.minH,maxH:t.maxH,moved:!!t.moved,static:!!t.static,isDraggable:t.isDraggable,isResizable:t.isResizable,resizeHandles:t.resizeHandles,constraints:t.constraints,isBounded:t.isBounded}}function zc(t){const e=new Array(t.length);for(let n=0;n<t.length;n++){const s=t[n];s!==void 0&&(e[n]=Ju(s))}return e}function VO(t,e){const n=new Array(t.length);for(let s=0;s<t.length;s++){const i=t[s];i!==void 0&&(e.i===i.i?n[s]=e:n[s]=i)}return n}function QO(t,e,n){let s=Lu(t,e);return s?(s=n(Ju(s)),[VO(t,s),s]):[[...t],null]}function Sv(t,e){const n=W1(t);for(let s=0;s<t.length;s++){const i=t[s];if(i!==void 0)if(i.x+i.w>e.cols&&(i.x=e.cols-i.w),i.x<0&&(i.x=0,i.w=e.cols),!i.static)n.push(i);else for(;Fu(n,i);)i.y++}return t}function Uu(t,e,n,s,i,o,d,f,p){if(e.static&&e.isDraggable!==!0)return[...t];if(e.y===s&&e.x===n)return[...t];const y=e.x,S=e.y;typeof n=="number"&&(e.x=n),typeof s=="number"&&(e.y=s),e.moved=!0;let b=YO(t,d);(d==="vertical"&&typeof s=="number"?S>=s:d==="horizontal"&&typeof n=="number"?y>=n:!1)&&(b=b.reverse());const j=K6(b,e),w=j.length>0;if(w&&p)return zc(t);if(w&&o)return e.x=y,e.y=S,e.moved=!1,t;let T=[...t];for(let O=0;O<j.length;O++){const R=j[O];R!==void 0&&(R.moved||(R.static?T=B3(T,R,e,i,d):T=B3(T,e,R,i,d)))}return T}function B3(t,e,n,s,i,o){const d=i==="horizontal",f=i==="vertical",p=e.static;if(s){s=!1;const b={x:d?Math.max(e.x-n.w,0):n.x,y:f?Math.max(e.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},_=Fu(t,b),j=_!==void 0&&_.y+_.h>e.y,w=_!==void 0&&e.x+e.w>_.x;if(!_)return Uu(t,n,d?b.x:void 0,f?b.y:void 0,s,p,i);if(j&&f)return Uu(t,n,void 0,n.y+1,s,p,i);if(j&&i===null)return e.y=n.y,n.y=n.y+n.h,[...t];if(w&&d)return Uu(t,e,n.x,void 0,s,p,i)}const y=d?n.x+1:void 0,S=f?n.y+1:void 0;return y===void 0&&S===void 0?[...t]:Uu(t,n,y,S,s,p,i)}function Af(t,e,n){return Math.max(e,Math.min(n,t))}var KO={name:"gridBounds",constrainPosition(t,e,n,{cols:s,maxRows:i}){return{x:Af(e,0,Math.max(0,s-t.w)),y:Af(n,0,Math.max(0,i-t.h))}},constrainSize(t,e,n,s,{cols:i,maxRows:o}){const d=s==="w"||s==="nw"||s==="sw"?t.x+t.w:i-t.x,f=s==="n"||s==="nw"||s==="ne"?t.y+t.h:o-t.y;return{w:Af(e,1,Math.max(1,d)),h:Af(n,1,Math.max(1,f))}}},XO={name:"minMaxSize",constrainSize(t,e,n){return{w:Af(e,t.minW??1,t.maxW??1/0),h:Af(n,t.minH??1,t.maxH??1/0)}}},F6=[KO,XO];function Z0(t,e,n,s,i){let o={x:n,y:s};for(const d of t)d.constrainPosition&&(o=d.constrainPosition(e,o.x,o.y,i));if(e.constraints)for(const d of e.constraints)d.constrainPosition&&(o=d.constrainPosition(e,o.x,o.y,i));return o}function FO(t,e,n,s,i,o){let d={w:n,h:s};for(const f of t)f.constrainSize&&(d=f.constrainSize(e,d.w,d.h,i,o));if(e.constraints)for(const f of e.constraints)f.constrainSize&&(d=f.constrainSize(e,d.w,d.h,i,o));return d}function Z6({top:t,left:e,width:n,height:s}){const i=`translate(${e}px,${t}px)`;return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:`${n}px`,height:`${s}px`,position:"absolute"}}function ZO({top:t,left:e,width:n,height:s}){return{top:`${t}px`,left:`${e}px`,width:`${n}px`,height:`${s}px`,position:"absolute"}}function G3(t){return t*100+"%"}function IO(t,e,n,s){return t+n>s?e:n}function I6(t,e,n){return t<0?e:n}function JO(t){return Math.max(0,t)}function A1(t){return Math.max(0,t)}var Nv=(t,e,n)=>{const{left:s,height:i,width:o}=e,d=t.top-(i-t.height);return{left:s,width:o,height:I6(d,t.height,i),top:A1(d)}},_v=(t,e,n)=>{const{top:s,left:i,height:o,width:d}=e;return{top:s,height:o,width:IO(t.left,t.width,d,n),left:JO(i)}},Cv=(t,e,n)=>{const{top:s,height:i,width:o}=e,d=t.left+t.width-o;return d<0?{height:i,width:t.left+t.width,top:A1(s),left:0}:{height:i,width:o,top:A1(s),left:d}},jv=(t,e,n)=>{const{top:s,left:i,height:o,width:d}=e;return{width:d,left:i,height:I6(s,t.height,o),top:A1(s)}},WO=(t,e,n)=>Nv(t,_v(t,e,n)),$O=(t,e,n)=>Nv(t,Cv(t,e)),eM=(t,e,n)=>jv(t,_v(t,e,n)),tM=(t,e,n)=>jv(t,Cv(t,e)),nM={n:Nv,ne:WO,e:_v,se:eM,s:jv,sw:tM,w:Cv,nw:$O};function aM(t,e,n,s){const i=nM[t];return i?i(e,{...e,...n},s):n}var sM={type:"transform",scale:1,calcStyle(t){return Z6(t)}},rM=sM,iM={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},lM={enabled:!0,bounded:!1,threshold:3},oM={enabled:!0,handles:["se"]},cM={enabled:!1,defaultItem:{w:1,h:1}};function wv(t,e,n,s,i){const o=s==="x"?"w":"h";e[s]+=1;const d=t.findIndex(p=>p.i===e.i),f=i??W1(t).length>0;for(let p=d+1;p<t.length;p++){const y=t[p];if(y!==void 0&&!y.static){if(!f&&y.y>e.y+e.h)break;vv(e,y)&&wv(t,y,n+e[o],s,f)}}e[s]=n}function uM(t,e,n,s){for(e.x=Math.max(e.x,0),e.y=Math.max(e.y,0),e.y=Math.min(s,e.y);e.y>0&&!Fu(t,e);)e.y--;let i;for(;(i=Fu(t,e))!==void 0;)wv(n,e,i.y+i.h,"y");return e.y=Math.max(e.y,0),e}function dM(t,e,n,s){for(e.x=Math.max(e.x,0),e.y=Math.max(e.y,0);e.x>0&&!Fu(t,e);)e.x--;let i;for(;(i=Fu(t,e))!==void 0;)if(wv(s,e,i.x+i.w,"x"),e.x+e.w>n)for(e.x=n-e.w,e.y++;e.x>0&&!Fu(t,e);)e.x--;return e.x=Math.max(e.x,0),e}var J6={type:"vertical",allowOverlap:!1,compact(t,e){const n=W1(t);let s=J1(n);const i=wb(t),o=new Array(t.length);for(let d=0;d<i.length;d++){const f=i[d];if(f===void 0)continue;let p=Ju(f);p.static||(p=uM(n,p,i,s),s=Math.max(s,p.y+p.h),n.push(p));const y=t.indexOf(f);o[y]=p,p.moved=!1}return o}},W6={type:"horizontal",allowOverlap:!1,compact(t,e){const n=W1(t),s=X6(t),i=new Array(t.length);for(let o=0;o<s.length;o++){const d=s[o];if(d===void 0)continue;let f=Ju(d);f.static||(f=dM(n,f,e,s),n.push(f));const p=t.indexOf(d);i[p]=f,f.moved=!1}return i}},$6={type:null,allowOverlap:!1,compact(t,e){return zc(t)}},fM={...J6,allowOverlap:!0,compact(t,e){return zc(t)}},hM={...W6,allowOverlap:!0,compact(t,e){return zc(t)}},pM={...$6,allowOverlap:!0};function Ev(t,e=!1,n=!1){let s;return e?t==="vertical"?s=fM:t==="horizontal"?s=hM:s=pM:t==="vertical"?s=J6:t==="horizontal"?s=W6:s=$6,n?{...s,preventCollision:n}:s}function e8(t){return Object.keys(t).sort((n,s)=>t[n]-t[s])}function P3(t,e){const n=e8(t);let s=n[0];if(s===void 0)throw new Error("No breakpoints defined");for(let i=1;i<n.length;i++){const o=n[i];if(o===void 0)continue;const d=t[o];e>d&&(s=o)}return s}function Y3(t,e){const n=e[t];if(n===void 0)throw new Error(`ResponsiveReactGridLayout: \`cols\` entry for breakpoint ${String(t)} is missing!`);return n}function px(t,e,n,s,i,o){const d=t[n];if(d)return zc(d);let f=t[s];const p=e8(e),y=p.slice(p.indexOf(n));for(let j=0;j<y.length;j++){const w=y[j];if(w===void 0)continue;const T=t[w];if(T){f=T;break}}const S=zc(f||[]),b=Sv(S,{cols:i});return(typeof o=="object"&&o!==null?o:Ev(o)).compact(b,i)}function I0(t,e){if(Array.isArray(t))return t;const n=t,s=n[e];if(s!==void 0)return s;const i=Object.keys(n);for(const o of i){const d=n[o];if(d!==void 0)return d}return[10,10]}function t8(t){return function(n,s,i,o,d,f,p){return t(n,s,p)}}function $1(t){return function(n,s,i,o){if(!n||!s||typeof n!="object"||typeof s!="object")return t(n,s,i,o);var d=o.get(n),f=o.get(s);if(d&&f)return d===s&&f===n;o.set(n,s),o.set(s,n);var p=t(n,s,i,o);return o.delete(n),o.delete(s),p}}function n8(t,e){var n={};for(var s in t)n[s]=t[s];for(var s in e)n[s]=e[s];return n}function V3(t){return t.constructor===Object||t.constructor==null}function Q3(t){return typeof t.then=="function"}function ey(t,e){return t===e||t!==t&&e!==e}var mM="[object Arguments]",gM="[object Boolean]",yM="[object Date]",xM="[object RegExp]",bM="[object Map]",vM="[object Number]",SM="[object Object]",NM="[object Set]",_M="[object String]",K3=Object.prototype.toString;function ty(t){var e=t.areArraysEqual,n=t.areDatesEqual,s=t.areMapsEqual,i=t.areObjectsEqual,o=t.areRegExpsEqual,d=t.areSetsEqual,f=t.createIsNestedEqual,p=f(y);function y(S,b,_){if(S===b)return!0;if(!S||!b||typeof S!="object"||typeof b!="object")return S!==S&&b!==b;if(V3(S)&&V3(b))return i(S,b,p,_);var j=Array.isArray(S),w=Array.isArray(b);if(j||w)return j===w&&e(S,b,p,_);var T=K3.call(S);return T!==K3.call(b)?!1:T===yM?n(S,b,p,_):T===xM?o(S,b,p,_):T===bM?s(S,b,p,_):T===NM?d(S,b,p,_):T===SM||T===mM?Q3(S)||Q3(b)?!1:i(S,b,p,_):T===gM||T===vM||T===_M?ey(S.valueOf(),b.valueOf()):!1}return y}function a8(t,e,n,s){var i=t.length;if(e.length!==i)return!1;for(;i-- >0;)if(!n(t[i],e[i],i,i,t,e,s))return!1;return!0}var CM=$1(a8);function s8(t,e){return ey(t.valueOf(),e.valueOf())}function r8(t,e,n,s){var i=t.size===e.size;if(!i)return!1;if(!t.size)return!0;var o={},d=0;return t.forEach(function(f,p){if(i){var y=!1,S=0;e.forEach(function(b,_){!y&&!o[S]&&(y=n(p,_,d,S,t,e,s)&&n(f,b,p,_,t,e,s))&&(o[S]=!0),S++}),d++,i=y}}),i}var jM=$1(r8),wM="_owner",EM=Object.prototype.hasOwnProperty;function i8(t,e,n,s){var i=Object.keys(t),o=i.length;if(Object.keys(e).length!==o)return!1;for(var d;o-- >0;){if(d=i[o],d===wM){var f=!!t.$$typeof,p=!!e.$$typeof;if((f||p)&&f!==p)return!1}if(!EM.call(e,d)||!n(t[d],e[d],d,d,t,e,s))return!1}return!0}var TM=$1(i8);function l8(t,e){return t.source===e.source&&t.flags===e.flags}function o8(t,e,n,s){var i=t.size===e.size;if(!i)return!1;if(!t.size)return!0;var o={};return t.forEach(function(d,f){if(i){var p=!1,y=0;e.forEach(function(S,b){!p&&!o[y]&&(p=n(d,S,f,b,t,e,s))&&(o[y]=!0),y++}),i=p}}),i}var RM=$1(o8),c8=Object.freeze({areArraysEqual:a8,areDatesEqual:s8,areMapsEqual:r8,areObjectsEqual:i8,areRegExpsEqual:l8,areSetsEqual:o8,createIsNestedEqual:t8}),u8=Object.freeze({areArraysEqual:CM,areDatesEqual:s8,areMapsEqual:jM,areObjectsEqual:TM,areRegExpsEqual:l8,areSetsEqual:RM,createIsNestedEqual:t8}),OM=ty(c8);function ro(t,e){return OM(t,e,void 0)}ty(n8(c8,{createIsNestedEqual:function(){return ey}}));ty(u8);ty(n8(u8,{createIsNestedEqual:function(){return ey}}));var Ip={exports:{}},mx={},gx={exports:{}},yx,X3;function MM(){if(X3)return yx;X3=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return yx=t,yx}var xx,F3;function AM(){if(F3)return xx;F3=1;var t=MM();function e(){}function n(){}return n.resetWarningCache=e,xx=function(){function s(d,f,p,y,S,b){if(b!==t){var _=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw _.name="Invariant Violation",_}}s.isRequired=s;function i(){return s}var o={array:s,bigint:s,bool:s,func:s,number:s,object:s,string:s,symbol:s,any:s,arrayOf:i,element:s,elementType:s,instanceOf:i,node:s,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:e};return o.PropTypes=o,o},xx}var Z3;function ny(){return Z3||(Z3=1,gx.exports=AM()()),gx.exports}var J0={exports:{}},I3;function DM(){if(I3)return J0.exports;I3=1;function t(n){var s,i,o="";if(typeof n=="string"||typeof n=="number")o+=n;else if(typeof n=="object")if(Array.isArray(n)){var d=n.length;for(s=0;s<d;s++)n[s]&&(i=t(n[s]))&&(o&&(o+=" "),o+=i)}else for(i in n)n[i]&&(o&&(o+=" "),o+=i);return o}function e(){for(var n,s,i=0,o="",d=arguments.length;i<d;i++)(n=arguments[i])&&(s=t(n))&&(o&&(o+=" "),o+=s);return o}return J0.exports=e,J0.exports.clsx=e,J0.exports}var pa={},dc={},J3;function ay(){if(J3)return dc;J3=1,Object.defineProperty(dc,"__esModule",{value:!0}),dc.dontSetMe=i,dc.findInArray=t,dc.int=s,dc.isFunction=e,dc.isNum=n;function t(o,d){for(let f=0,p=o.length;f<p;f++)if(d.apply(d,[o[f],f,o]))return o[f]}function e(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Function]"}function n(o){return typeof o=="number"&&!isNaN(o)}function s(o){return parseInt(o,10)}function i(o,d,f){if(o[d])return new Error(`Invalid prop ${d} passed to ${f} - do not set this, set it on the child.`)}return dc}var fc={},W3;function zM(){if(W3)return fc;W3=1,Object.defineProperty(fc,"__esModule",{value:!0}),fc.browserPrefixToKey=n,fc.browserPrefixToStyle=s,fc.default=void 0,fc.getPrefix=e;const t=["Moz","Webkit","O","ms"];function e(){var f,p;let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const d=(p=(f=window.document)==null?void 0:f.documentElement)==null?void 0:p.style;if(!d||o in d)return"";for(let y=0;y<t.length;y++)if(n(o,t[y])in d)return t[y];return""}function n(o,d){return d?`${d}${i(o)}`:o}function s(o,d){return d?`-${d.toLowerCase()}-${o}`:o}function i(o){let d="",f=!0;for(let p=0;p<o.length;p++)f?(d+=o[p].toUpperCase(),f=!1):o[p]==="-"?f=!0:d+=o[p];return d}return fc.default=e(),fc}var $3;function Tv(){if($3)return pa;$3=1,Object.defineProperty(pa,"__esModule",{value:!0}),pa.addClassName=G,pa.addEvent=d,pa.addUserSelectStyles=M,pa.createCSSTransform=j,pa.createSVGTransform=w,pa.getTouch=O,pa.getTouchIdentifier=R,pa.getTranslation=T,pa.innerHeight=S,pa.innerWidth=b,pa.matchesSelector=i,pa.matchesSelectorAndParentsTo=o,pa.offsetXYFromParent=_,pa.outerHeight=p,pa.outerWidth=y,pa.removeClassName=P,pa.removeEvent=f,pa.scheduleRemoveUserSelectStyles=z;var t=ay(),e=n(zM());function n(L,U){if(typeof WeakMap=="function")var V=new WeakMap,Z=new WeakMap;return(n=function(re,ne){if(!ne&&re&&re.__esModule)return re;var W,ie,ce={__proto__:null,default:re};if(re===null||typeof re!="object"&&typeof re!="function")return ce;if(W=ne?Z:V){if(W.has(re))return W.get(re);W.set(re,ce)}for(const Y in re)Y!=="default"&&{}.hasOwnProperty.call(re,Y)&&((ie=(W=Object.defineProperty)&&Object.getOwnPropertyDescriptor(re,Y))&&(ie.get||ie.set)?W(ce,Y,ie):ce[Y]=re[Y]);return ce})(L,U)}let s="";function i(L,U){return s||(s=(0,t.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(V){return(0,t.isFunction)(L[V])})),(0,t.isFunction)(L[s])?L[s](U):!1}function o(L,U,V){let Z=L;do{if(i(Z,U))return!0;if(Z===V)return!1;Z=Z.parentNode}while(Z);return!1}function d(L,U,V,Z){if(!L)return;const re={capture:!0,...Z};L.addEventListener?L.addEventListener(U,V,re):L.attachEvent?L.attachEvent("on"+U,V):L["on"+U]=V}function f(L,U,V,Z){if(!L)return;const re={capture:!0,...Z};L.removeEventListener?L.removeEventListener(U,V,re):L.detachEvent?L.detachEvent("on"+U,V):L["on"+U]=null}function p(L){let U=L.clientHeight;const V=L.ownerDocument.defaultView.getComputedStyle(L);return U+=(0,t.int)(V.borderTopWidth),U+=(0,t.int)(V.borderBottomWidth),U}function y(L){let U=L.clientWidth;const V=L.ownerDocument.defaultView.getComputedStyle(L);return U+=(0,t.int)(V.borderLeftWidth),U+=(0,t.int)(V.borderRightWidth),U}function S(L){let U=L.clientHeight;const V=L.ownerDocument.defaultView.getComputedStyle(L);return U-=(0,t.int)(V.paddingTop),U-=(0,t.int)(V.paddingBottom),U}function b(L){let U=L.clientWidth;const V=L.ownerDocument.defaultView.getComputedStyle(L);return U-=(0,t.int)(V.paddingLeft),U-=(0,t.int)(V.paddingRight),U}function _(L,U,V){const re=U===U.ownerDocument.body?{left:0,top:0}:U.getBoundingClientRect(),ne=(L.clientX+U.scrollLeft-re.left)/V,W=(L.clientY+U.scrollTop-re.top)/V;return{x:ne,y:W}}function j(L,U){const V=T(L,U,"px");return{[(0,e.browserPrefixToKey)("transform",e.default)]:V}}function w(L,U){return T(L,U,"")}function T(L,U,V){let{x:Z,y:re}=L,ne=`translate(${Z}${V},${re}${V})`;if(U){const W=`${typeof U.x=="string"?U.x:U.x+V}`,ie=`${typeof U.y=="string"?U.y:U.y+V}`;ne=`translate(${W}, ${ie})`+ne}return ne}function O(L,U){return L.targetTouches&&(0,t.findInArray)(L.targetTouches,V=>U===V.identifier)||L.changedTouches&&(0,t.findInArray)(L.changedTouches,V=>U===V.identifier)}function R(L){if(L.targetTouches&&L.targetTouches[0])return L.targetTouches[0].identifier;if(L.changedTouches&&L.changedTouches[0])return L.changedTouches[0].identifier}function M(L){if(!L)return;let U=L.getElementById("react-draggable-style-el");U||(U=L.createElement("style"),U.type="text/css",U.id="react-draggable-style-el",U.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
554
|
-
`,U.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
555
|
-
`,L.getElementsByTagName("head")[0].appendChild(U)),L.body&&G(L.body,"react-draggable-transparent-selection")}function z(L){window.requestAnimationFrame?window.requestAnimationFrame(()=>{k(L)}):k(L)}function k(L){if(L)try{if(L.body&&P(L.body,"react-draggable-transparent-selection"),L.selection)L.selection.empty();else{const U=(L.defaultView||window).getSelection();U&&U.type!=="Caret"&&U.removeAllRanges()}}catch{}}function G(L,U){L.classList?L.classList.add(U):L.className.match(new RegExp(`(?:^|\\s)${U}(?!\\S)`))||(L.className+=` ${U}`)}function P(L,U){L.classList?L.classList.remove(U):L.className=L.className.replace(new RegExp(`(?:^|\\s)${U}(?!\\S)`,"g"),"")}return pa}var cl={},e5;function d8(){if(e5)return cl;e5=1,Object.defineProperty(cl,"__esModule",{value:!0}),cl.canDragX=i,cl.canDragY=o,cl.createCoreData=f,cl.createDraggableData=p,cl.getBoundPosition=n,cl.getControlPosition=d,cl.snapToGrid=s;var t=ay(),e=Tv();function n(b,_,j){if(!b.props.bounds)return[_,j];let{bounds:w}=b.props;w=typeof w=="string"?w:y(w);const T=S(b);if(typeof w=="string"){const{ownerDocument:O}=T,R=O.defaultView;let M;if(w==="parent"?M=T.parentNode:M=T.getRootNode().querySelector(w),!(M instanceof R.HTMLElement))throw new Error('Bounds selector "'+w+'" could not find an element.');const z=M,k=R.getComputedStyle(T),G=R.getComputedStyle(z);w={left:-T.offsetLeft+(0,t.int)(G.paddingLeft)+(0,t.int)(k.marginLeft),top:-T.offsetTop+(0,t.int)(G.paddingTop)+(0,t.int)(k.marginTop),right:(0,e.innerWidth)(z)-(0,e.outerWidth)(T)-T.offsetLeft+(0,t.int)(G.paddingRight)-(0,t.int)(k.marginRight),bottom:(0,e.innerHeight)(z)-(0,e.outerHeight)(T)-T.offsetTop+(0,t.int)(G.paddingBottom)-(0,t.int)(k.marginBottom)}}return(0,t.isNum)(w.right)&&(_=Math.min(_,w.right)),(0,t.isNum)(w.bottom)&&(j=Math.min(j,w.bottom)),(0,t.isNum)(w.left)&&(_=Math.max(_,w.left)),(0,t.isNum)(w.top)&&(j=Math.max(j,w.top)),[_,j]}function s(b,_,j){const w=Math.round(_/b[0])*b[0],T=Math.round(j/b[1])*b[1];return[w,T]}function i(b){return b.props.axis==="both"||b.props.axis==="x"}function o(b){return b.props.axis==="both"||b.props.axis==="y"}function d(b,_,j){const w=typeof _=="number"?(0,e.getTouch)(b,_):null;if(typeof _=="number"&&!w)return null;const T=S(j),O=j.props.offsetParent||T.offsetParent||T.ownerDocument.body;return(0,e.offsetXYFromParent)(w||b,O,j.props.scale)}function f(b,_,j){const w=!(0,t.isNum)(b.lastX),T=S(b);return w?{node:T,deltaX:0,deltaY:0,lastX:_,lastY:j,x:_,y:j}:{node:T,deltaX:_-b.lastX,deltaY:j-b.lastY,lastX:b.lastX,lastY:b.lastY,x:_,y:j}}function p(b,_){const j=b.props.scale;return{node:_.node,x:b.state.x+_.deltaX/j,y:b.state.y+_.deltaY/j,deltaX:_.deltaX/j,deltaY:_.deltaY/j,lastX:b.state.x,lastY:b.state.y}}function y(b){return{left:b.left,top:b.top,right:b.right,bottom:b.bottom}}function S(b){const _=b.findDOMNode();if(!_)throw new Error("<DraggableCore>: Unmounted during event!");return _}return cl}var Jp={},W0={},t5;function f8(){if(t5)return W0;t5=1,Object.defineProperty(W0,"__esModule",{value:!0}),W0.default=t;function t(){}return W0}var n5;function kM(){if(n5)return Jp;n5=1,Object.defineProperty(Jp,"__esModule",{value:!0}),Jp.default=void 0;var t=p(gl()),e=f(ny()),n=f(L1()),s=Tv(),i=d8(),o=ay(),d=f(f8());function f(T){return T&&T.__esModule?T:{default:T}}function p(T,O){if(typeof WeakMap=="function")var R=new WeakMap,M=new WeakMap;return(p=function(z,k){if(!k&&z&&z.__esModule)return z;var G,P,L={__proto__:null,default:z};if(z===null||typeof z!="object"&&typeof z!="function")return L;if(G=k?M:R){if(G.has(z))return G.get(z);G.set(z,L)}for(const U in z)U!=="default"&&{}.hasOwnProperty.call(z,U)&&((P=(G=Object.defineProperty)&&Object.getOwnPropertyDescriptor(z,U))&&(P.get||P.set)?G(L,U,P):L[U]=z[U]);return L})(T,O)}function y(T,O,R){return(O=S(O))in T?Object.defineProperty(T,O,{value:R,enumerable:!0,configurable:!0,writable:!0}):T[O]=R,T}function S(T){var O=b(T,"string");return typeof O=="symbol"?O:O+""}function b(T,O){if(typeof T!="object"||!T)return T;var R=T[Symbol.toPrimitive];if(R!==void 0){var M=R.call(T,O);if(typeof M!="object")return M;throw new TypeError("@@toPrimitive must return a primitive value.")}return(O==="string"?String:Number)(T)}const _={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let j=_.mouse,w=class extends t.Component{constructor(){super(...arguments),y(this,"dragging",!1),y(this,"lastX",NaN),y(this,"lastY",NaN),y(this,"touchIdentifier",null),y(this,"mounted",!1),y(this,"handleDragStart",O=>{if(this.props.onMouseDown(O),!this.props.allowAnyClick&&typeof O.button=="number"&&O.button!==0)return!1;const R=this.findDOMNode();if(!R||!R.ownerDocument||!R.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:M}=R;if(this.props.disabled||!(O.target instanceof M.defaultView.Node)||this.props.handle&&!(0,s.matchesSelectorAndParentsTo)(O.target,this.props.handle,R)||this.props.cancel&&(0,s.matchesSelectorAndParentsTo)(O.target,this.props.cancel,R))return;O.type==="touchstart"&&!this.props.allowMobileScroll&&O.preventDefault();const z=(0,s.getTouchIdentifier)(O);this.touchIdentifier=z;const k=(0,i.getControlPosition)(O,z,this);if(k==null)return;const{x:G,y:P}=k,L=(0,i.createCoreData)(this,G,P);(0,d.default)("DraggableCore: handleDragStart: %j",L),(0,d.default)("calling",this.props.onStart),!(this.props.onStart(O,L)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,s.addUserSelectStyles)(M),this.dragging=!0,this.lastX=G,this.lastY=P,(0,s.addEvent)(M,j.move,this.handleDrag),(0,s.addEvent)(M,j.stop,this.handleDragStop))}),y(this,"handleDrag",O=>{const R=(0,i.getControlPosition)(O,this.touchIdentifier,this);if(R==null)return;let{x:M,y:z}=R;if(Array.isArray(this.props.grid)){let P=M-this.lastX,L=z-this.lastY;if([P,L]=(0,i.snapToGrid)(this.props.grid,P,L),!P&&!L)return;M=this.lastX+P,z=this.lastY+L}const k=(0,i.createCoreData)(this,M,z);if((0,d.default)("DraggableCore: handleDrag: %j",k),this.props.onDrag(O,k)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const L=document.createEvent("MouseEvents");L.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(L)}return}this.lastX=M,this.lastY=z}),y(this,"handleDragStop",O=>{if(!this.dragging)return;const R=(0,i.getControlPosition)(O,this.touchIdentifier,this);if(R==null)return;let{x:M,y:z}=R;if(Array.isArray(this.props.grid)){let L=M-this.lastX||0,U=z-this.lastY||0;[L,U]=(0,i.snapToGrid)(this.props.grid,L,U),M=this.lastX+L,z=this.lastY+U}const k=(0,i.createCoreData)(this,M,z);if(this.props.onStop(O,k)===!1||this.mounted===!1)return!1;const P=this.findDOMNode();P&&this.props.enableUserSelectHack&&(0,s.scheduleRemoveUserSelectStyles)(P.ownerDocument),(0,d.default)("DraggableCore: handleDragStop: %j",k),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,P&&((0,d.default)("DraggableCore: Removing handlers"),(0,s.removeEvent)(P.ownerDocument,j.move,this.handleDrag),(0,s.removeEvent)(P.ownerDocument,j.stop,this.handleDragStop))}),y(this,"onMouseDown",O=>(j=_.mouse,this.handleDragStart(O))),y(this,"onMouseUp",O=>(j=_.mouse,this.handleDragStop(O))),y(this,"onTouchStart",O=>(j=_.touch,this.handleDragStart(O))),y(this,"onTouchEnd",O=>(j=_.touch,this.handleDragStop(O)))}componentDidMount(){this.mounted=!0;const O=this.findDOMNode();O&&(0,s.addEvent)(O,_.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const O=this.findDOMNode();if(O){const{ownerDocument:R}=O;(0,s.removeEvent)(R,_.mouse.move,this.handleDrag),(0,s.removeEvent)(R,_.touch.move,this.handleDrag),(0,s.removeEvent)(R,_.mouse.stop,this.handleDragStop),(0,s.removeEvent)(R,_.touch.stop,this.handleDragStop),(0,s.removeEvent)(O,_.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,s.scheduleRemoveUserSelectStyles)(R)}}findDOMNode(){var O,R,M;return(O=this.props)!=null&&O.nodeRef?(M=(R=this.props)==null?void 0:R.nodeRef)==null?void 0:M.current:n.default.findDOMNode(this)}render(){return t.cloneElement(t.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return Jp.default=w,y(w,"displayName","DraggableCore"),y(w,"propTypes",{allowAnyClick:e.default.bool,allowMobileScroll:e.default.bool,children:e.default.node.isRequired,disabled:e.default.bool,enableUserSelectHack:e.default.bool,offsetParent:function(T,O){if(T[O]&&T[O].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:e.default.arrayOf(e.default.number),handle:e.default.string,cancel:e.default.string,nodeRef:e.default.object,onStart:e.default.func,onDrag:e.default.func,onStop:e.default.func,onMouseDown:e.default.func,scale:e.default.number,className:o.dontSetMe,style:o.dontSetMe,transform:o.dontSetMe}),y(w,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),Jp}var a5;function LM(){return a5||(a5=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return p.default}}),t.default=void 0;var e=b(gl()),n=S(ny()),s=S(L1()),i=DM(),o=Tv(),d=d8(),f=ay(),p=S(kM()),y=S(f8());function S(R){return R&&R.__esModule?R:{default:R}}function b(R,M){if(typeof WeakMap=="function")var z=new WeakMap,k=new WeakMap;return(b=function(G,P){if(!P&&G&&G.__esModule)return G;var L,U,V={__proto__:null,default:G};if(G===null||typeof G!="object"&&typeof G!="function")return V;if(L=P?k:z){if(L.has(G))return L.get(G);L.set(G,V)}for(const Z in G)Z!=="default"&&{}.hasOwnProperty.call(G,Z)&&((U=(L=Object.defineProperty)&&Object.getOwnPropertyDescriptor(G,Z))&&(U.get||U.set)?L(V,Z,U):V[Z]=G[Z]);return V})(R,M)}function _(){return _=Object.assign?Object.assign.bind():function(R){for(var M=1;M<arguments.length;M++){var z=arguments[M];for(var k in z)({}).hasOwnProperty.call(z,k)&&(R[k]=z[k])}return R},_.apply(null,arguments)}function j(R,M,z){return(M=w(M))in R?Object.defineProperty(R,M,{value:z,enumerable:!0,configurable:!0,writable:!0}):R[M]=z,R}function w(R){var M=T(R,"string");return typeof M=="symbol"?M:M+""}function T(R,M){if(typeof R!="object"||!R)return R;var z=R[Symbol.toPrimitive];if(z!==void 0){var k=z.call(R,M);if(typeof k!="object")return k;throw new TypeError("@@toPrimitive must return a primitive value.")}return(M==="string"?String:Number)(R)}class O extends e.Component{static getDerivedStateFromProps(M,z){let{position:k}=M,{prevPropsPosition:G}=z;return k&&(!G||k.x!==G.x||k.y!==G.y)?((0,y.default)("Draggable: getDerivedStateFromProps %j",{position:k,prevPropsPosition:G}),{x:k.x,y:k.y,prevPropsPosition:{...k}}):null}constructor(M){super(M),j(this,"onDragStart",(z,k)=>{if((0,y.default)("Draggable: onDragStart: %j",k),this.props.onStart(z,(0,d.createDraggableData)(this,k))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),j(this,"onDrag",(z,k)=>{if(!this.state.dragging)return!1;(0,y.default)("Draggable: onDrag: %j",k);const G=(0,d.createDraggableData)(this,k),P={x:G.x,y:G.y,slackX:0,slackY:0};if(this.props.bounds){const{x:U,y:V}=P;P.x+=this.state.slackX,P.y+=this.state.slackY;const[Z,re]=(0,d.getBoundPosition)(this,P.x,P.y);P.x=Z,P.y=re,P.slackX=this.state.slackX+(U-P.x),P.slackY=this.state.slackY+(V-P.y),G.x=P.x,G.y=P.y,G.deltaX=P.x-this.state.x,G.deltaY=P.y-this.state.y}if(this.props.onDrag(z,G)===!1)return!1;this.setState(P)}),j(this,"onDragStop",(z,k)=>{if(!this.state.dragging||this.props.onStop(z,(0,d.createDraggableData)(this,k))===!1)return!1;(0,y.default)("Draggable: onDragStop: %j",k);const P={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:U,y:V}=this.props.position;P.x=U,P.y=V}this.setState(P)}),this.state={dragging:!1,dragged:!1,x:M.position?M.position.x:M.defaultPosition.x,y:M.position?M.position.y:M.defaultPosition.y,prevPropsPosition:{...M.position},slackX:0,slackY:0,isElementSVG:!1},M.position&&!(M.onDrag||M.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){var M,z;return((z=(M=this.props)==null?void 0:M.nodeRef)==null?void 0:z.current)??s.default.findDOMNode(this)}render(){const{axis:M,bounds:z,children:k,defaultPosition:G,defaultClassName:P,defaultClassNameDragging:L,defaultClassNameDragged:U,position:V,positionOffset:Z,scale:re,...ne}=this.props;let W={},ie=null;const Y=!!!V||this.state.dragging,$=V||G,ae={x:(0,d.canDragX)(this)&&Y?this.state.x:$.x,y:(0,d.canDragY)(this)&&Y?this.state.y:$.y};this.state.isElementSVG?ie=(0,o.createSVGTransform)(ae,Z):W=(0,o.createCSSTransform)(ae,Z);const Ne=(0,i.clsx)(k.props.className||"",P,{[L]:this.state.dragging,[U]:this.state.dragged});return e.createElement(p.default,_({},ne,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),e.cloneElement(e.Children.only(k),{className:Ne,style:{...k.props.style,...W},transform:ie}))}}t.default=O,j(O,"displayName","Draggable"),j(O,"propTypes",{...p.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:f.dontSetMe,style:f.dontSetMe,transform:f.dontSetMe}),j(O,"defaultProps",{...p.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(mx)),mx}var s5;function Rv(){if(s5)return Ip.exports;s5=1;const{default:t,DraggableCore:e}=LM();return Ip.exports=t,Ip.exports.default=t,Ip.exports.DraggableCore=e,Ip.exports}var UM=Rv(),Wp={exports:{}},$p={},$0={},r5;function qM(){if(r5)return $0;r5=1,$0.__esModule=!0,$0.cloneElement=f;var t=e(gl());function e(p){return p&&p.__esModule?p:{default:p}}function n(p,y){var S=Object.keys(p);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(p);y&&(b=b.filter(function(_){return Object.getOwnPropertyDescriptor(p,_).enumerable})),S.push.apply(S,b)}return S}function s(p){for(var y=1;y<arguments.length;y++){var S=arguments[y]!=null?arguments[y]:{};y%2?n(Object(S),!0).forEach(function(b){i(p,b,S[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(S)):n(Object(S)).forEach(function(b){Object.defineProperty(p,b,Object.getOwnPropertyDescriptor(S,b))})}return p}function i(p,y,S){return(y=o(y))in p?Object.defineProperty(p,y,{value:S,enumerable:!0,configurable:!0,writable:!0}):p[y]=S,p}function o(p){var y=d(p,"string");return typeof y=="symbol"?y:y+""}function d(p,y){if(typeof p!="object"||!p)return p;var S=p[Symbol.toPrimitive];if(S!==void 0){var b=S.call(p,y);if(typeof b!="object")return b;throw new TypeError("@@toPrimitive must return a primitive value.")}return(y==="string"?String:Number)(p)}function f(p,y){return y.style&&p.props.style&&(y.style=s(s({},p.props.style),y.style)),y.className&&p.props.className&&(y.className=`${p.props.className} ${y.className}`),t.default.cloneElement(p,y)}return $0}var em={},i5;function h8(){if(i5)return em;i5=1,em.__esModule=!0,em.resizableProps=void 0;var t=e(ny());Rv();function e(n){return n&&n.__esModule?n:{default:n}}return em.resizableProps={axis:t.default.oneOf(["both","x","y","none"]),className:t.default.string,children:t.default.element.isRequired,draggableOpts:t.default.shape({allowAnyClick:t.default.bool,cancel:t.default.string,children:t.default.node,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:typeof Element<"u"?t.default.instanceOf(Element):t.default.any,grid:t.default.arrayOf(t.default.number),handle:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number}),height:function(){for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];const[o]=s;return o.axis==="both"||o.axis==="y"?t.default.number.isRequired(...s):t.default.number(...s)},handle:t.default.oneOfType([t.default.node,t.default.func]),handleSize:t.default.arrayOf(t.default.number),lockAspectRatio:t.default.bool,maxConstraints:t.default.arrayOf(t.default.number),minConstraints:t.default.arrayOf(t.default.number),onResizeStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,resizeHandles:t.default.arrayOf(t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:t.default.number,width:function(){for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];const[o]=s;return o.axis==="both"||o.axis==="x"?t.default.number.isRequired(...s):t.default.number(...s)}},em}var l5;function p8(){if(l5)return $p;l5=1,$p.__esModule=!0,$p.default=void 0;var t=o(gl()),e=Rv(),n=qM(),s=h8();const i=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function o(T,O){if(typeof WeakMap=="function")var R=new WeakMap,M=new WeakMap;return(o=function(z,k){if(!k&&z&&z.__esModule)return z;var G,P,L={__proto__:null,default:z};if(z===null||typeof z!="object"&&typeof z!="function")return L;if(G=k?M:R){if(G.has(z))return G.get(z);G.set(z,L)}for(const U in z)U!=="default"&&{}.hasOwnProperty.call(z,U)&&((P=(G=Object.defineProperty)&&Object.getOwnPropertyDescriptor(z,U))&&(P.get||P.set)?G(L,U,P):L[U]=z[U]);return L})(T,O)}function d(){return d=Object.assign?Object.assign.bind():function(T){for(var O=1;O<arguments.length;O++){var R=arguments[O];for(var M in R)({}).hasOwnProperty.call(R,M)&&(T[M]=R[M])}return T},d.apply(null,arguments)}function f(T,O){if(T==null)return{};var R,M,z=p(T,O);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(T);for(M=0;M<k.length;M++)R=k[M],O.indexOf(R)===-1&&{}.propertyIsEnumerable.call(T,R)&&(z[R]=T[R])}return z}function p(T,O){if(T==null)return{};var R={};for(var M in T)if({}.hasOwnProperty.call(T,M)){if(O.indexOf(M)!==-1)continue;R[M]=T[M]}return R}function y(T,O){var R=Object.keys(T);if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(T);O&&(M=M.filter(function(z){return Object.getOwnPropertyDescriptor(T,z).enumerable})),R.push.apply(R,M)}return R}function S(T){for(var O=1;O<arguments.length;O++){var R=arguments[O]!=null?arguments[O]:{};O%2?y(Object(R),!0).forEach(function(M){b(T,M,R[M])}):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(R)):y(Object(R)).forEach(function(M){Object.defineProperty(T,M,Object.getOwnPropertyDescriptor(R,M))})}return T}function b(T,O,R){return(O=_(O))in T?Object.defineProperty(T,O,{value:R,enumerable:!0,configurable:!0,writable:!0}):T[O]=R,T}function _(T){var O=j(T,"string");return typeof O=="symbol"?O:O+""}function j(T,O){if(typeof T!="object"||!T)return T;var R=T[Symbol.toPrimitive];if(R!==void 0){var M=R.call(T,O);if(typeof M!="object")return M;throw new TypeError("@@toPrimitive must return a primitive value.")}return(O==="string"?String:Number)(T)}let w=class extends t.Component{constructor(){super(...arguments),this.handleRefs={},this.lastHandleRect=null,this.slack=null,this.lastSize=null}componentWillUnmount(){this.resetData()}resetData(){this.lastHandleRect=this.slack=this.lastSize=null}runConstraints(O,R){const{minConstraints:M,maxConstraints:z,lockAspectRatio:k}=this.props;if(!M&&!z&&!k)return[O,R];if(k){const V=this.props.width/this.props.height,Z=O-this.props.width,re=R-this.props.height;Math.abs(Z)>Math.abs(re*V)?R=O/V:O=R*V}const[G,P]=[O,R];let[L,U]=this.slack||[0,0];return O+=L,R+=U,M&&(O=Math.max(M[0],O),R=Math.max(M[1],R)),z&&(O=Math.min(z[0],O),R=Math.min(z[1],R)),this.slack=[L+(G-O),U+(P-R)],[O,R]}resizeHandler(O,R){return(M,z)=>{var $;let{node:k,deltaX:G,deltaY:P}=z;O==="onResizeStart"&&this.resetData();const L=(this.props.axis==="both"||this.props.axis==="x")&&R!=="n"&&R!=="s",U=(this.props.axis==="both"||this.props.axis==="y")&&R!=="e"&&R!=="w";if(!L&&!U)return;const V=R[0],Z=R[R.length-1],re=k.getBoundingClientRect();if(this.lastHandleRect!=null){if(Z==="w"){const ae=re.left-this.lastHandleRect.left;G+=ae}if(V==="n"){const ae=re.top-this.lastHandleRect.top;P+=ae}}this.lastHandleRect=re,Z==="w"&&(G=-G),V==="n"&&(P=-P);let ne=this.props.width+(L?G/this.props.transformScale:0),W=this.props.height+(U?P/this.props.transformScale:0);[ne,W]=this.runConstraints(ne,W),O==="onResizeStop"&&this.lastSize&&({width:ne,height:W}=this.lastSize);const ie=ne!==this.props.width||W!==this.props.height;O!=="onResizeStop"&&(this.lastSize={width:ne,height:W});const ce=typeof this.props[O]=="function"?this.props[O]:null;ce&&!(O==="onResize"&&!ie)&&(($=M.persist)==null||$.call(M),ce(M,{node:k,size:{width:ne,height:W},handle:R})),O==="onResizeStop"&&this.resetData()}}renderResizeHandle(O,R){const{handle:M}=this.props;if(!M)return t.createElement("span",{className:`react-resizable-handle react-resizable-handle-${O}`,ref:R});if(typeof M=="function")return M(O,R);const z=typeof M.type=="string",k=S({ref:R},z?{}:{handleAxis:O});return t.cloneElement(M,k)}render(){const O=this.props,{children:R,className:M,draggableOpts:z,width:k,height:G,handle:P,handleSize:L,lockAspectRatio:U,axis:V,minConstraints:Z,maxConstraints:re,onResize:ne,onResizeStop:W,onResizeStart:ie,resizeHandles:ce,transformScale:Y}=O,$=f(O,i);return(0,n.cloneElement)(R,S(S({},$),{},{className:`${M?`${M} `:""}react-resizable`,children:[...t.Children.toArray(R.props.children),...ce.map(ae=>{const Ne=this.handleRefs[ae]??(this.handleRefs[ae]=t.createRef());return t.createElement(e.DraggableCore,d({},z,{nodeRef:Ne,key:`resizableHandle-${ae}`,onStop:this.resizeHandler("onResizeStop",ae),onStart:this.resizeHandler("onResizeStart",ae),onDrag:this.resizeHandler("onResize",ae)}),this.renderResizeHandle(ae,Ne))})]}))}};return $p.default=w,w.propTypes=s.resizableProps,w.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},$p}var tm={},o5;function HM(){if(o5)return tm;o5=1,tm.__esModule=!0,tm.default=void 0;var t=d(gl()),e=o(ny()),n=o(p8()),s=h8();const i=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function o(O){return O&&O.__esModule?O:{default:O}}function d(O,R){if(typeof WeakMap=="function")var M=new WeakMap,z=new WeakMap;return(d=function(k,G){if(!G&&k&&k.__esModule)return k;var P,L,U={__proto__:null,default:k};if(k===null||typeof k!="object"&&typeof k!="function")return U;if(P=G?z:M){if(P.has(k))return P.get(k);P.set(k,U)}for(const V in k)V!=="default"&&{}.hasOwnProperty.call(k,V)&&((L=(P=Object.defineProperty)&&Object.getOwnPropertyDescriptor(k,V))&&(L.get||L.set)?P(U,V,L):U[V]=k[V]);return U})(O,R)}function f(){return f=Object.assign?Object.assign.bind():function(O){for(var R=1;R<arguments.length;R++){var M=arguments[R];for(var z in M)({}).hasOwnProperty.call(M,z)&&(O[z]=M[z])}return O},f.apply(null,arguments)}function p(O,R){var M=Object.keys(O);if(Object.getOwnPropertySymbols){var z=Object.getOwnPropertySymbols(O);R&&(z=z.filter(function(k){return Object.getOwnPropertyDescriptor(O,k).enumerable})),M.push.apply(M,z)}return M}function y(O){for(var R=1;R<arguments.length;R++){var M=arguments[R]!=null?arguments[R]:{};R%2?p(Object(M),!0).forEach(function(z){S(O,z,M[z])}):Object.getOwnPropertyDescriptors?Object.defineProperties(O,Object.getOwnPropertyDescriptors(M)):p(Object(M)).forEach(function(z){Object.defineProperty(O,z,Object.getOwnPropertyDescriptor(M,z))})}return O}function S(O,R,M){return(R=b(R))in O?Object.defineProperty(O,R,{value:M,enumerable:!0,configurable:!0,writable:!0}):O[R]=M,O}function b(O){var R=_(O,"string");return typeof R=="symbol"?R:R+""}function _(O,R){if(typeof O!="object"||!O)return O;var M=O[Symbol.toPrimitive];if(M!==void 0){var z=M.call(O,R);if(typeof z!="object")return z;throw new TypeError("@@toPrimitive must return a primitive value.")}return(R==="string"?String:Number)(O)}function j(O,R){if(O==null)return{};var M,z,k=w(O,R);if(Object.getOwnPropertySymbols){var G=Object.getOwnPropertySymbols(O);for(z=0;z<G.length;z++)M=G[z],R.indexOf(M)===-1&&{}.propertyIsEnumerable.call(O,M)&&(k[M]=O[M])}return k}function w(O,R){if(O==null)return{};var M={};for(var z in O)if({}.hasOwnProperty.call(O,z)){if(R.indexOf(z)!==-1)continue;M[z]=O[z]}return M}let T=class extends t.Component{constructor(){super(...arguments),this.state={width:this.props.width,height:this.props.height,propsWidth:this.props.width,propsHeight:this.props.height},this.onResize=(R,M)=>{var k;const{size:z}=M;this.props.onResize?((k=R.persist)==null||k.call(R),this.setState(z,()=>this.props.onResize&&this.props.onResize(R,M))):this.setState(z)}}static getDerivedStateFromProps(R,M){return M.propsWidth!==R.width||M.propsHeight!==R.height?{width:R.width,height:R.height,propsWidth:R.width,propsHeight:R.height}:null}render(){const R=this.props,{handle:M,handleSize:z,onResize:k,onResizeStart:G,onResizeStop:P,draggableOpts:L,minConstraints:U,maxConstraints:V,lockAspectRatio:Z,axis:re,width:ne,height:W,resizeHandles:ie,style:ce,transformScale:Y}=R,$=j(R,i);return t.createElement(n.default,{axis:re,draggableOpts:L,handle:M,handleSize:z,height:this.state.height,lockAspectRatio:Z,maxConstraints:V,minConstraints:U,onResizeStart:G,onResize:this.onResize,onResizeStop:P,resizeHandles:ie,transformScale:Y,width:this.state.width},t.createElement("div",f({},$,{style:y(y({},ce),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}};return tm.default=T,T.propTypes=y(y({},s.resizableProps),{},{children:e.default.element}),tm}var c5;function BM(){return c5||(c5=1,Wp.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Wp.exports.Resizable=p8().default,Wp.exports.ResizableBox=HM().default),Wp.exports}var GM=BM();function u5(t){const{children:e,cols:n,containerWidth:s,margin:i,containerPadding:o,rowHeight:d,maxRows:f,isDraggable:p,isResizable:y,isBounded:S,static:b,useCSSTransforms:_=!0,usePercentages:j=!1,transformScale:w=1,positionStrategy:T,dragThreshold:O=0,droppingPosition:R,className:M="",style:z,handle:k="",cancel:G="",x:P,y:L,w:U,h:V,minW:Z=1,maxW:re=1/0,minH:ne=1,maxH:W=1/0,i:ie,resizeHandles:ce,resizeHandle:Y,constraints:$=F6,layoutItem:ae,layout:Ne=[],onDragStart:me,onDrag:B,onDragStop:I,onResizeStart:fe,onResize:xe,onResizeStop:_e}=t,[Ce,ze]=D.useState(!1),[Ee,we]=D.useState(!1),Vt=D.useRef(null),et=D.useRef({left:0,top:0}),Mt=D.useRef({top:0,left:0,width:0,height:0}),Ht=D.useRef(void 0),En=D.useRef(Ne);En.current=Ne;const Kn=D.useRef(null),Gt=D.useRef(null),fn=D.useRef(!1),ur=D.useRef({x:0,y:0}),Ft=D.useRef(!1),Et=D.useMemo(()=>({cols:n,containerPadding:o,containerWidth:s,margin:i,maxRows:f,rowHeight:d}),[n,o,s,i,f,d]),qn=D.useMemo(()=>({cols:n,maxRows:f,containerWidth:s,containerHeight:0,rowHeight:d,margin:i,layout:[]}),[n,f,s,d,i]),hn=D.useCallback(()=>({...qn,layout:En.current}),[qn]),Zt=D.useMemo(()=>ae??{i:ie,x:P,y:L,w:U,h:V,minW:Z,maxW:re,minH:ne,maxH:W},[ae,ie,P,L,U,V,Z,re,ne,W]),Xn=D.useCallback(yt=>{if(T!=null&&T.calcStyle)return T.calcStyle(yt);if(_)return Z6(yt);const mt=ZO(yt);return j?{...mt,left:G3(yt.left/s),width:G3(yt.width/s)}:mt},[T,_,j,s]),Ss=D.useCallback((yt,{node:mt})=>{if(!me)return;const{offsetParent:Qt}=mt;if(!Qt)return;const At=Qt.getBoundingClientRect(),Hn=mt.getBoundingClientRect(),rn=Hn.left/w,Fn=At.left/w,yn=Hn.top/w,Ra=At.top/w;let oa;if(T!=null&&T.calcDragPosition){const tt=yt;oa=T.calcDragPosition(tt.clientX,tt.clientY,tt.clientX-Hn.left,tt.clientY-Hn.top)}else oa={left:rn-Fn+Qt.scrollLeft,top:yn-Ra+Qt.scrollTop};if(et.current=oa,O>0){const tt=yt;ur.current={x:tt.clientX,y:tt.clientY},fn.current=!0,Ft.current=!1,ze(!0);return}ze(!0);const ls=F0(Et,oa.top,oa.left),{x:Bs,y:qe}=Z0($,Zt,ls.x,ls.y,hn());me(ie,Bs,qe,{e:yt,node:mt,newPosition:oa})},[me,w,Et,T,O,$,Zt,hn,ie]),dr=D.useCallback((yt,{node:mt,deltaX:Qt,deltaY:At})=>{if(!B||!Ce)return;const Hn=yt;if(fn.current&&!Ft.current){const Bs=Hn.clientX-ur.current.x,qe=Hn.clientY-ur.current.y;if(Math.hypot(Bs,qe)<O)return;if(Ft.current=!0,fn.current=!1,me){const Qe=F0(Et,et.current.top,et.current.left),{x:ot,y:xt}=Z0($,Zt,Qe.x,Qe.y,hn());me(ie,ot,xt,{e:yt,node:mt,newPosition:et.current})}}let rn=et.current.top+At,Fn=et.current.left+Qt;if(S){const{offsetParent:Bs}=mt;if(Bs){const qe=Bs.clientHeight-th(V,d,i[1]);rn=M1(rn,0,qe);const tt=fh(Et),Qe=s-th(U,tt,i[0]);Fn=M1(Fn,0,Qe)}}const yn={top:rn,left:Fn};et.current=yn;const Ra=F0(Et,rn,Fn),{x:oa,y:ls}=Z0($,Zt,Ra.x,Ra.y,hn());B(ie,oa,ls,{e:yt,node:mt,newPosition:yn})},[B,me,Ce,O,S,V,d,i,Et,s,U,ie,$,Zt,hn]),Qa=D.useCallback((yt,{node:mt})=>{if(!I||!Ce)return;const Qt=fn.current;if(fn.current=!1,Ft.current=!1,ur.current={x:0,y:0},Qt){ze(!1),et.current={left:0,top:0};return}const{left:At,top:Hn}=et.current,rn={top:Hn,left:At};ze(!1),et.current={left:0,top:0};const Fn=F0(Et,Hn,At),{x:yn,y:Ra}=Z0($,Zt,Fn.x,Fn.y,hn());I(ie,yn,Ra,{e:yt,node:mt,newPosition:rn})},[I,Ce,Et,$,Zt,hn,ie]);Kn.current=Ss,Gt.current=dr;const la=D.useCallback((yt,{node:mt,size:Qt,handle:At},Hn,rn)=>{const Fn=rn==="onResizeStart"?fe:rn==="onResize"?xe:_e;if(!Fn)return;let yn;mt?yn=aM(At,Hn,Qt,s):yn={...Qt,top:Hn.top,left:Hn.left},Mt.current=yn;const Ra=PO(Et,yn.width,yn.height),{w:oa,h:ls}=FO($,Zt,Ra.w,Ra.h,At,hn());Fn(ie,oa,ls,{e:yt.nativeEvent,node:mt,size:yn,handle:At})},[fe,xe,_e,s,Et,ie,$,Zt,hn]),Ea=D.useCallback((yt,mt)=>{we(!0);const Qt=Zp(Et,P,L,U,V),At={...mt,handle:mt.handle};la(yt,At,Qt,"onResizeStart")},[la,Et,P,L,U,V]),rs=D.useCallback((yt,mt)=>{const Qt=Zp(Et,P,L,U,V),At={...mt,handle:mt.handle};la(yt,At,Qt,"onResize")},[la,Et,P,L,U,V]),fr=D.useCallback((yt,mt)=>{we(!1),Mt.current={top:0,left:0,width:0,height:0};const Qt=Zp(Et,P,L,U,V),At={...mt,handle:mt.handle};la(yt,At,Qt,"onResizeStop")},[la,Et,P,L,U,V]);D.useEffect(()=>{var At,Hn;if(!R)return;const yt=Vt.current;if(!yt)return;const mt=Ht.current||{left:0,top:0},Qt=Ce&&(R.left!==mt.left||R.top!==mt.top);if(Ce){if(Qt){const rn=R.left-et.current.left,Fn=R.top-et.current.top,yn={node:yt,deltaX:rn,deltaY:Fn,lastX:et.current.left,lastY:et.current.top,x:R.left,y:R.top};(Hn=Gt.current)==null||Hn.call(Gt,R.e,yn)}}else{const rn={node:yt,deltaX:R.left,deltaY:R.top,lastX:0,lastY:0,x:R.left,y:R.top};(At=Kn.current)==null||At.call(Kn,R.e,rn)}Ht.current=R},[R,Ce,ie]);const Ns=Zp(Et,P,L,U,V,Ce?et.current:null,Ee?Mt.current:null),Hs=$t.Children.only(e),ta=Zp(Et,0,0,1,1),is=[ta.width,ta.height],ba=[1/0,1/0],Ta=Hs.props,Pc=Ta.className,Nl=Ta.style;let _s=$t.cloneElement(Hs,{ref:Vt,className:V1("react-grid-item",Pc,M,{static:b,resizing:Ee,"react-draggable":p,"react-draggable-dragging":Ce,dropping:!!R,cssTransforms:_}),style:{...z,...Nl,...Xn(Ns)}});const hr=Y;return _s=h.jsx(GM.Resizable,{draggableOpts:{disabled:!y},className:y?void 0:"react-resizable-hide",width:Ns.width,height:Ns.height,minConstraints:is,maxConstraints:ba,onResizeStart:Ea,onResize:rs,onResizeStop:fr,transformScale:w,resizeHandles:ce,handle:hr,children:_s}),_s=h.jsx(UM.DraggableCore,{disabled:!p,onStart:Ss,onDrag:dr,onStop:Qa,handle:k,cancel:".react-resizable-handle"+(G?","+G:""),scale:w,nodeRef:Vt,children:_s}),_s}var eo=()=>{},d5="react-grid-layout",m8=!1;try{m8=/firefox/i.test(navigator.userAgent)}catch{}function PM(t,e){const n=$t.Children.toArray(t),s=$t.Children.toArray(e);if(n.length!==s.length)return!1;for(let i=0;i<n.length;i++){const o=n[i],d=s[i];if((o==null?void 0:o.key)!==(d==null?void 0:d.key))return!1}return!0}function f5(t,e,n,s){const i=[],o=new Set;$t.Children.forEach(e,f=>{if(!$t.isValidElement(f)||f.key===null)return;const p=String(f.key);o.add(p);const y=t.find(S=>S.i===p);if(y)i.push(Ju(y));else{const b=f.props["data-grid"];b?i.push({i:p,x:b.x??0,y:b.y??0,w:b.w??1,h:b.h??1,minW:b.minW,maxW:b.maxW,minH:b.minH,maxH:b.maxH,static:b.static,isDraggable:b.isDraggable,isResizable:b.isResizable,resizeHandles:b.resizeHandles,isBounded:b.isBounded}):i.push({i:p,x:0,y:J1(i),w:1,h:1})}});const d=Sv(i,{cols:n});return s.compact(d,n)}function YM(t){const{children:e,width:n,gridConfig:s,dragConfig:i,resizeConfig:o,dropConfig:d,positionStrategy:f=rM,compactor:p,constraints:y=F6,layout:S=[],droppingItem:b,autoSize:_=!0,className:j="",style:w={},innerRef:T,onLayoutChange:O=eo,onDragStart:R=eo,onDrag:M=eo,onDragStop:z=eo,onResizeStart:k=eo,onResize:G=eo,onResizeStop:P=eo,onDrop:L=eo,onDropDragOver:U=eo}=t,V=D.useMemo(()=>({...iM,...s}),[s]),Z=D.useMemo(()=>({...lM,...i}),[i]),re=D.useMemo(()=>({...oM,...o}),[o]),ne=D.useMemo(()=>({...cM,...d}),[d]),{cols:W,rowHeight:ie,maxRows:ce,margin:Y,containerPadding:$}=V,{enabled:ae,bounded:Ne,handle:me,cancel:B,threshold:I}=Z,{enabled:fe,handles:xe,handleComponent:_e}=re,{enabled:Ce,defaultItem:ze,onDragOver:Ee}=ne,we=p??Ev("vertical"),Vt=we.type,et=we.allowOverlap,Mt=we.preventCollision??!1,Ht=D.useMemo(()=>b??{i:"__dropping-elem__",...ze},[b,ze]),En=f.type==="transform",Kn=f.scale,Gt=$??Y,[fn,ur]=D.useState(!1),[Ft,Et]=D.useState(()=>f5(S,e,W,we)),[qn,hn]=D.useState(null),[Zt,Xn]=D.useState(!1),[Ss,dr]=D.useState(null),[Qa,la]=D.useState(),Ea=D.useRef(null),rs=D.useRef(null),fr=D.useRef(null),Ns=D.useRef(0),Hs=D.useRef(Ft),ta=D.useRef(S),is=D.useRef(e),ba=D.useRef(Vt),Ta=D.useRef(Ft);Ta.current=Ft,D.useEffect(()=>{ur(!0),ro(Ft,S)||O(Ft)},[]),D.useEffect(()=>{if(qn||Ss)return;const qe=!ro(S,ta.current),tt=!PM(e,is.current),Qe=Vt!==ba.current;if(qe||tt||Qe){const xt=f5(qe?S:Ft,e,W,we);ro(xt,Ft)||Et(xt)}ta.current=S,is.current=e,ba.current=Vt},[S,e,W,Vt,we,qn,Ss,Ft]),D.useEffect(()=>{if(!qn&&!ro(Ft,Hs.current)){Hs.current=Ft;const qe=Ft.filter(tt=>tt.i!==Ht.i);O(qe)}},[Ft,qn,O,Ht.i]);const Pc=D.useMemo(()=>{if(!_)return;const qe=J1(Ft),tt=Gt[1];return qe*ie+(qe-1)*Y[1]+tt*2+"px"},[_,Ft,ie,Y,Gt]),Nl=D.useCallback((qe,tt,Qe,ot)=>{const xt=Ta.current,Ze=Lu(xt,qe);if(!Ze)return;const ct={w:Ze.w,h:Ze.h,x:Ze.x,y:Ze.y,i:qe};Ea.current=Ju(Ze),fr.current=xt,hn(ct),R(xt,Ze,Ze,null,ot.e,ot.node)},[R]),_s=D.useCallback((qe,tt,Qe,ot)=>{const xt=Ta.current,Ze=Ea.current,ct=Lu(xt,qe);if(!ct)return;const sn={w:ct.w,h:ct.h,x:ct.x,y:ct.y,i:qe},Tt=Uu(xt,ct,tt,Qe,!0,Mt,Vt,W,et);M(Tt,Ze,ct,sn,ot.e,ot.node),Et(we.compact(Tt,W)),hn(sn)},[Mt,Vt,W,et,we,M]),hr=D.useCallback((qe,tt,Qe,ot)=>{if(!qn)return;const xt=Ta.current,Ze=Ea.current,ct=Lu(xt,qe);if(!ct)return;const sn=Uu(xt,ct,tt,Qe,!0,Mt,Vt,W,et),Tt=we.compact(sn,W);z(Tt,Ze,ct,null,ot.e,ot.node);const pn=fr.current;Ea.current=null,fr.current=null,hn(null),Et(Tt),pn&&!ro(pn,Tt)&&O(Tt)},[qn,Mt,Vt,W,et,we,z,O]),yt=D.useCallback((qe,tt,Qe,ot)=>{const xt=Ta.current,Ze=Lu(xt,qe);Ze&&(rs.current=Ju(Ze),fr.current=xt,Xn(!0),k(xt,Ze,Ze,null,ot.e,ot.node))},[k]),mt=D.useCallback((qe,tt,Qe,ot)=>{const xt=Ta.current,Ze=rs.current,{handle:ct}=ot;let sn=!1,Tt,pn;const[Rr,os]=QO(xt,qe,Pt=>(Tt=Pt.x,pn=Pt.y,["sw","w","nw","n","ne"].includes(ct)&&(["sw","nw","w"].includes(ct)&&(Tt=Pt.x+(Pt.w-tt),tt=Pt.x!==Tt&&Tt<0?Pt.w:tt,Tt=Tt<0?0:Tt),["ne","n","nw"].includes(ct)&&(pn=Pt.y+(Pt.h-Qe),Qe=Pt.y!==pn&&pn<0?Pt.h:Qe,pn=pn<0?0:pn),sn=!0),Mt&&!et&&K6(xt,{...Pt,w:tt,h:Qe,x:Tt??Pt.x,y:pn??Pt.y}).filter(mr=>mr.i!==Pt.i).length>0&&(pn=Pt.y,Qe=Pt.h,Tt=Pt.x,tt=Pt.w,sn=!1),Pt.w=tt,Pt.h=Qe,Pt));if(!os)return;let Ka=Rr;sn&&Tt!==void 0&&pn!==void 0&&(Ka=Uu(Rr,os,Tt,pn,!0,Mt,Vt,W,et));const Gs={w:os.w,h:os.h,x:os.x,y:os.y,i:qe,static:!0};G(Ka,Ze,os,Gs,ot.e,ot.node),Et(we.compact(Ka,W)),hn(Gs)},[Mt,Vt,W,et,we,G]),Qt=D.useCallback((qe,tt,Qe,ot)=>{const xt=Ta.current,Ze=rs.current,ct=Lu(xt,qe),sn=we.compact(xt,W);P(sn,Ze,ct??null,null,ot.e,ot.node);const Tt=fr.current;rs.current=null,fr.current=null,hn(null),Xn(!1),Et(sn),Tt&&!ro(Tt,sn)&&O(sn)},[W,we,P,O]),At=D.useCallback(()=>{const qe=Ta.current;if(!qe.some(ot=>ot.i===Ht.i)){dr(null),hn(null),la(void 0);return}const Qe=we.compact(qe.filter(ot=>ot.i!==Ht.i),W);Et(Qe),dr(null),hn(null),la(void 0)},[Ht.i,W,we]),Hn=D.useCallback(qe=>{var Tn;if(qe.preventDefault(),qe.stopPropagation(),m8&&!((Tn=qe.nativeEvent.target)!=null&&Tn.classList.contains(d5)))return!1;const tt=Ee?Ee(qe.nativeEvent):U(qe);if(tt===!1)return Ss&&At(),!1;const{dragOffsetX:Qe=0,dragOffsetY:ot=0,...xt}=tt??{},Ze={...Ht,...xt},ct=qe.currentTarget.getBoundingClientRect(),sn={cols:W,margin:Y,maxRows:ce,rowHeight:ie,containerWidth:n,containerPadding:Gt},Tt=fh(sn),pn=th(Ze.w,Tt,Y[0]),Rr=th(Ze.h,ie,Y[1]),os=pn/2,Ka=Rr/2,Gs=qe.clientX-ct.left+Qe-os,Pt=qe.clientY-ct.top+ot-Ka,pr=Math.max(0,Gs),mr=Math.max(0,Pt),Cs={left:pr/Kn,top:mr/Kn,e:qe.nativeEvent};if(Ss)Qa&&(Qa.left!==Cs.left||Qa.top!==Cs.top)&&la(Cs);else{const js=GO(sn,mr,pr,Ze.w,Ze.h);dr(h.jsx("div",{},Ze.i)),la(Cs),Et([...Ta.current,{...Ze,x:js.x,y:js.y,static:!1,isDraggable:!0}])}},[Ss,Qa,Ht,Ee,U,At,Kn,W,Y,ce,ie,n,Gt]),rn=D.useCallback(qe=>{qe.preventDefault(),qe.stopPropagation(),Ns.current--,Ns.current<0&&(Ns.current=0),Ns.current===0&&At()},[At]),Fn=D.useCallback(qe=>{qe.preventDefault(),qe.stopPropagation(),Ns.current++},[]),yn=D.useCallback(qe=>{qe.preventDefault(),qe.stopPropagation();const tt=Ta.current,Qe=tt.find(ot=>ot.i===Ht.i);Ns.current=0,At(),L(tt,Qe,qe.nativeEvent)},[Ht.i,At,L]),Ra=D.useCallback((qe,tt)=>{if(!qe||!qe.key)return null;const Qe=Lu(Ft,String(qe.key));if(!Qe)return null;const ot=typeof Qe.isDraggable=="boolean"?Qe.isDraggable:!Qe.static&&ae,xt=typeof Qe.isResizable=="boolean"?Qe.isResizable:!Qe.static&&fe,Ze=Qe.resizeHandles||[...xe],ct=ot&&Ne&&Qe.isBounded!==!1,sn=_e;return h.jsx(u5,{containerWidth:n,cols:W,margin:Y,containerPadding:Gt,maxRows:ce,rowHeight:ie,cancel:B,handle:me,onDragStart:Nl,onDrag:_s,onDragStop:hr,onResizeStart:yt,onResize:mt,onResizeStop:Qt,isDraggable:ot,isResizable:xt,isBounded:ct,useCSSTransforms:En&&fn,usePercentages:!fn,transformScale:Kn,positionStrategy:f,dragThreshold:I,w:Qe.w,h:Qe.h,x:Qe.x,y:Qe.y,i:Qe.i,minH:Qe.minH,minW:Qe.minW,maxH:Qe.maxH,maxW:Qe.maxW,static:Qe.static,droppingPosition:tt?Qa:void 0,resizeHandles:Ze,resizeHandle:sn,constraints:y,layoutItem:Qe,layout:Ft,children:qe},Qe.i)},[Ft,n,W,Y,Gt,ce,ie,B,me,Nl,_s,hr,yt,mt,Qt,ae,fe,Ne,En,fn,Kn,f,I,Qa,xe,_e,y]),oa=()=>qn?h.jsx(u5,{w:qn.w,h:qn.h,x:qn.x,y:qn.y,i:qn.i,className:`react-grid-placeholder ${Zt?"placeholder-resizing":""}`,containerWidth:n,cols:W,margin:Y,containerPadding:Gt,maxRows:ce,rowHeight:ie,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:En,transformScale:Kn,constraints:y,layout:Ft,children:h.jsx("div",{})}):null,ls=V1(d5,j),Bs={height:Pc,...w};return h.jsxs("div",{ref:T,className:ls,style:Bs,onDrop:Ce?yn:void 0,onDragLeave:Ce?rn:void 0,onDragEnter:Ce?Fn:void 0,onDragOver:Ce?Hn:void 0,children:[$t.Children.map(e,qe=>$t.isValidElement(qe)?Ra(qe):null),Ce&&Ss&&Ra(Ss,!0),oa()]})}var VM={lg:1200,md:996,sm:768,xs:480,xxs:0},QM={lg:12,md:10,sm:6,xs:4,xxs:2},bx=()=>{};function KM(t,e,n,s){const i=[];$t.Children.forEach(e,d=>{if(!$t.isValidElement(d)||d.key===null)return;const f=String(d.key),p=t.find(y=>y.i===f);if(p)i.push({...p,i:f});else{const S=d.props["data-grid"];S?i.push({i:f,x:S.x??0,y:S.y??0,w:S.w??1,h:S.h??1,minW:S.minW,maxW:S.maxW,minH:S.minH,maxH:S.maxH,static:S.static,isDraggable:S.isDraggable,isResizable:S.isResizable,resizeHandles:S.resizeHandles,isBounded:S.isBounded}):i.push({i:f,x:0,y:J1(i),w:1,h:1})}});const o=Sv(i,{cols:n});return s.compact(o,n)}function XM(t){const{children:e,width:n,breakpoint:s,breakpoints:i=VM,cols:o=QM,layouts:d={},rowHeight:f=150,maxRows:p=1/0,margin:y=[10,10],containerPadding:S=null,compactor:b,onBreakpointChange:_=bx,onLayoutChange:j=bx,onWidthChange:w=bx,...T}=t,O=b??Ev("vertical"),R=O.type,M=O.allowOverlap,z=D.useMemo(()=>s??P3(i,n),[]),k=D.useMemo(()=>Y3(z,o),[z,o]),G=D.useMemo(()=>px(d,i,z,z,k,R),[]),[P,L]=D.useState(z),[U,V]=D.useState(k),[Z,re]=D.useState(G),[ne,W]=D.useState(d),ie=D.useRef(n),ce=D.useRef(s),Y=D.useRef(i),$=D.useRef(o),ae=D.useRef(d),Ne=D.useRef(R),me=D.useRef(ne);D.useEffect(()=>{me.current=ne},[ne]);const B=D.useMemo(()=>ro(d,ae.current)?null:px(d,i,P,P,U,O),[d,i,P,U,O]),I=B??Z;D.useEffect(()=>{B!==null&&(re(B),W(d),me.current=d,ae.current=d)},[B,d]),D.useEffect(()=>{if(R!==Ne.current){const ze=O.compact(zc(I),U),Ee={...me.current,[P]:ze};re(ze),W(Ee),me.current=Ee,j(ze,Ee),Ne.current=R}},[R,O,I,U,M,P,j]),D.useEffect(()=>{const ze=n!==ie.current,Ee=s!==ce.current,we=!ro(i,Y.current),Vt=!ro(o,$.current);if(ze||Ee||we||Vt){const et=s??P3(i,n),Mt=Y3(et,o),Ht=P;if(Ht!==et||we||Vt){const Gt={...me.current};Gt[Ht]||(Gt[Ht]=zc(Z));let fn=px(Gt,i,et,Ht,Mt,O);fn=KM(fn,e,Mt,O),Gt[et]=fn,L(et),V(Mt),re(fn),W(Gt),me.current=Gt,_(et,Mt),j(fn,Gt)}const En=I0(y,et),Kn=S?I0(S,et):null;w(n,En,Mt,Kn),ie.current=n,ce.current=s,Y.current=i,$.current=o}},[n,s,i,o,P,U,Z,e,O,R,M,y,S,_,j,w]);const fe=D.useCallback(ze=>{const we={...me.current,[P]:ze};re(ze),W(we),me.current=we,j(ze,we)},[P,j]),xe=D.useMemo(()=>I0(y,P),[y,P]),_e=D.useMemo(()=>S===null?null:I0(S,P),[S,P]),Ce=D.useMemo(()=>({cols:U,rowHeight:f,maxRows:p,margin:xe,containerPadding:_e}),[U,f,p,xe,_e]);return h.jsx(YM,{...T,width:n,gridConfig:Ce,compactor:O,onLayoutChange:fe,layout:I,children:e})}function FM({block:t,config:e,size:n,onRemove:s,onConfigChange:i}){const[o,d]=D.useState(!1),f=t.component,p=t.icon;return h.jsxs("div",{className:"flex flex-col h-full rounded-lg border border-border bg-surface shadow-sm shadow-black/5 overflow-hidden hover:shadow-md hover:shadow-black/8 transition-shadow",children:[h.jsxs("div",{className:"drag-handle flex items-center h-8 px-2 border-b border-border bg-surface/80 shrink-0 cursor-move group",children:[h.jsx(RT,{className:"h-3 w-3 text-foreground-subtle/30 group-hover:text-foreground-subtle transition-colors mr-1"}),h.jsx(p,{className:"h-3 w-3 text-primary/70 mr-1.5 shrink-0"}),h.jsx("span",{className:"text-[11px] font-semibold text-foreground/80 truncate flex-1",children:t.name}),h.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[t.configSchema&&t.configSchema.length>0&&h.jsx("button",{onClick:y=>{y.stopPropagation(),d(!o)},className:"p-1 rounded-md hover:bg-surface-hover text-foreground-subtle hover:text-foreground transition-colors",children:h.jsx(Wm,{className:"h-3 w-3"})}),h.jsx("button",{onClick:y=>{y.stopPropagation(),s()},className:"p-1 rounded-md hover:bg-danger/10 text-foreground-subtle hover:text-danger transition-colors",children:h.jsx(Oi,{className:"h-3 w-3"})})]})]}),o&&t.configSchema&&h.jsx("div",{className:"p-2.5 border-b border-border bg-background/50 space-y-2",children:t.configSchema.map(y=>{var S;return h.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[h.jsx("span",{className:"text-foreground-subtle w-20 shrink-0",children:y.label}),y.type==="number"&&h.jsx("input",{type:"number",value:e[y.key]??y.defaultValue??"",onChange:b=>i({...e,[y.key]:Number(b.target.value)}),className:"flex-1 rounded-md border border-border bg-surface px-2 py-1 text-foreground text-[11px] focus:border-primary outline-none"}),y.type==="text"&&h.jsx("input",{type:"text",value:e[y.key]??y.defaultValue??"",onChange:b=>i({...e,[y.key]:b.target.value}),className:"flex-1 rounded-md border border-border bg-surface px-2 py-1 text-foreground text-[11px] focus:border-primary outline-none"}),y.type==="boolean"&&h.jsx("input",{type:"checkbox",checked:e[y.key]??y.defaultValue??!1,onChange:b=>i({...e,[y.key]:b.target.checked}),className:"accent-primary"}),y.type==="select"&&h.jsx("select",{value:e[y.key]??y.defaultValue??"",onChange:b=>i({...e,[y.key]:b.target.value}),className:"flex-1 rounded-md border border-border bg-surface px-2 py-1 text-foreground text-[11px] focus:border-primary outline-none",children:(S=y.options)==null?void 0:S.map(b=>h.jsx("option",{value:b.value,children:b.label},b.value))})]},y.key)})}),h.jsx("div",{className:"flex-1 overflow-auto p-3",children:h.jsx(f,{config:e,size:n})})]})}function ZM({open:t,onClose:e,onSelect:n}){if(!t)return null;const s=DO();return h.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:e,children:h.jsxs("div",{className:"w-full max-w-md rounded-xl border border-border bg-surface p-5 shadow-2xl shadow-black/20",onClick:i=>i.stopPropagation(),children:[h.jsxs("div",{className:"flex items-center justify-between mb-4",children:[h.jsx("h2",{className:"text-sm font-semibold text-foreground",children:"Add Block"}),h.jsx("button",{onClick:e,className:"p-1 rounded-md hover:bg-surface-hover text-foreground-subtle hover:text-foreground transition-colors",children:h.jsx(Oi,{className:"h-4 w-4"})})]}),h.jsx("div",{className:"grid grid-cols-2 gap-2",children:s.map(i=>{const o=i.icon;return h.jsxs("button",{onClick:()=>{n(i),e()},className:"flex items-center gap-3 rounded-lg border border-border p-3 text-left hover:bg-surface-hover hover:border-primary/30 transition-all group",children:[h.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-md bg-primary/10 group-hover:bg-primary/15 transition-colors shrink-0",children:h.jsx(o,{className:"h-4 w-4 text-primary"})}),h.jsxs("div",{children:[h.jsx("span",{className:"text-xs font-medium text-foreground block",children:i.name}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle",children:[i.defaultSize.w,"x",i.defaultSize.h]})]})]},i.id)})})]})})}const IM=XM,g8="camstack-dashboard-state",JM={lg:1200,md:996,sm:768,xs:0},WM={lg:12,md:8,sm:4,xs:2};function $M(){try{const t=localStorage.getItem(g8);if(t)return JSON.parse(t)}catch{}return{items:[]}}function eA(t){localStorage.setItem(g8,JSON.stringify(t))}let h5=0;function tA(){const[t,e]=D.useState($M),[n,s]=D.useState(!1),i=GS(),o=D.useCallback(b=>{e(b),eA(b)},[]),d=D.useCallback(b=>{var T;h5++;const _=`${b.id}-${h5}`,j={};(T=b.configSchema)==null||T.forEach(O=>{O.defaultValue!==void 0&&(j[O.key]=O.defaultValue)});const w={i:_,blockId:b.id,x:0,y:1/0,w:b.defaultSize.w,h:b.defaultSize.h,config:j};o({items:[...t.items,w]})},[t,o]),f=D.useCallback(b=>{o({items:t.items.filter(_=>_.i!==b)})},[t,o]),p=D.useCallback((b,_)=>{o({items:t.items.map(j=>j.i===b?{...j,config:_}:j)})},[t,o]),y=D.useCallback(b=>{o({items:t.items.map(_=>{const j=b.find(w=>w.i===_.i);return j?{..._,x:j.x,y:j.y,w:j.w,h:j.h}:_})})},[t,o]),S=t.items.map(b=>{var j,w;const _=H3(b.blockId);return{i:b.i,x:b.x,y:b.y,w:b.w,h:b.h,minW:((j=_==null?void 0:_.minSize)==null?void 0:j.w)??2,minH:((w=_==null?void 0:_.minSize)==null?void 0:w.h)??2}});return h.jsxs("div",{className:"p-4",children:[h.jsxs("div",{className:"flex items-center justify-between mb-4",children:[h.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Dashboard"}),h.jsxs("button",{onClick:()=>s(!0),className:"flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground",children:[h.jsx(po,{className:"h-3.5 w-3.5"}),"Add Block"]})]}),t.items.length===0?h.jsxs("div",{className:"flex flex-col items-center justify-center py-24 text-foreground-subtle",children:[h.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-surface border border-border mb-4",children:h.jsx(z6,{className:"h-8 w-8 text-foreground-subtle/40"})}),h.jsx("p",{className:"text-sm font-medium text-foreground/70",children:"Your dashboard is empty"}),h.jsx("p",{className:"text-xs text-foreground-subtle mt-1 mb-4",children:"Add blocks to monitor your cameras and system"}),h.jsxs("button",{onClick:()=>s(!0),className:"flex items-center gap-1.5 rounded-lg bg-primary px-4 py-2 text-xs font-semibold text-primary-foreground shadow-md shadow-primary/20 hover:shadow-lg transition-all",children:[h.jsx(po,{className:"h-3.5 w-3.5"}),"Add your first block"]})]}):h.jsx(IM,{layouts:{lg:S},breakpoints:JM,cols:WM,rowHeight:60,draggableHandle:".drag-handle",onLayoutChange:y,isResizable:!i,isDraggable:!i,children:t.items.map(b=>{const _=H3(b.blockId);return _?h.jsx("div",{children:h.jsx(FM,{block:_,config:b.config,size:{w:b.w,h:b.h},onRemove:()=>f(b.i),onConfigChange:j=>p(b.i,j)})},b.i):h.jsx("div",{},b.i)})}),h.jsx(ZM,{open:n,onClose:()=>s(!1),onSelect:d})]})}function nA(){return h.jsx(tA,{})}const Eb={frigate:{icon:ZE,color:"#3b82f6",label:"Frigate"},scrypted:{icon:E1,color:"#a855f7",label:"Scrypted"},reolink:{icon:pv,color:"#06b6d4",label:"Reolink"},homeassistant:{icon:AT,color:"#22d3ee",label:"Home Assistant"},rtsp:{icon:b3,color:"#78716c",label:"RTSP"},onvif:{icon:b3,color:"#78716c",label:"ONVIF"}},aA={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"},sA={sm:"h-7 w-7",md:"h-8 w-8",lg:"h-10 w-10"};function sy({type:t,size:e="md",showLabel:n}){const s=Eb[t]??Eb.rtsp,i=s.icon;return h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:`flex items-center justify-center rounded-lg ${sA[e]}`,style:{backgroundColor:`${s.color}15`},children:h.jsx(i,{className:aA[e],style:{color:s.color}})}),n&&h.jsx("span",{className:"text-xs font-medium text-foreground-subtle",children:s.label})]})}function y8(t){var e;return((e=Eb[t])==null?void 0:e.label)??t}const p5={running:{bg:"bg-success/10",text:"text-success",dot:"bg-success",label:"Running"},stopped:{bg:"bg-foreground-subtle/10",text:"text-foreground-subtle",dot:"bg-foreground-subtle",label:"Stopped"},error:{bg:"bg-danger/10",text:"text-danger",dot:"bg-danger",label:"Error"},online:{bg:"bg-success/10",text:"text-success",dot:"bg-success",label:"Online"},offline:{bg:"bg-foreground-subtle/10",text:"text-foreground-subtle",dot:"bg-foreground-subtle",label:"Offline"},idle:{bg:"bg-info/10",text:"text-info",dot:"bg-info",label:"Idle"}};function nh({status:t}){const e=p5[t]??p5.stopped;return h.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-medium ${e.bg} ${e.text}`,children:[h.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${e.dot}`}),e.label]})}const m5={online:{label:"ACTIVE",bg:"bg-success/15",text:"text-success"},running:{label:"ACTIVE",bg:"bg-success/15",text:"text-success"},watching:{label:"WATCHING",bg:"bg-warning/15",text:"text-warning"},idle:{label:"WATCHING",bg:"bg-warning/15",text:"text-warning"},offline:{label:"OFFLINE",bg:"bg-foreground-subtle/10",text:"text-foreground-subtle"},stopped:{label:"OFFLINE",bg:"bg-foreground-subtle/10",text:"text-foreground-subtle"},error:{label:"OFFLINE",bg:"bg-danger/15",text:"text-danger"}};function rA({id:t,name:e,status:n,detectionsToday:s,inferenceMs:i}){const o=xl(),d=m5[n]??m5.offline;return h.jsxs("button",{onClick:()=>o(`/devices/${t}`),className:"group flex flex-col rounded-lg border border-border bg-surface text-left hover:border-primary/30 hover:shadow-md hover:shadow-black/5 transition-all w-full overflow-hidden",children:[h.jsxs("div",{className:"relative aspect-video w-full bg-background flex items-center justify-center",children:[h.jsx(Lc,{className:"h-8 w-8 text-foreground-subtle/20"}),h.jsx("span",{className:`absolute top-2 right-2 inline-flex items-center rounded px-1.5 py-0.5 text-[9px] font-bold tracking-wider ${d.bg} ${d.text}`,children:d.label})]}),h.jsxs("div",{className:"px-3 py-2.5 space-y-1.5",children:[h.jsx("p",{className:"text-xs font-semibold text-foreground truncate group-hover:text-primary transition-colors",children:e}),h.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-foreground-subtle",children:[h.jsxs("span",{className:"inline-flex items-center gap-1",children:[h.jsx(uh,{className:"h-3 w-3"}),s," today"]}),h.jsxs("span",{className:"inline-flex items-center gap-1",children:[h.jsx(dv,{className:"h-3 w-3"}),i,"ms"]})]})]})]})}function iA({providerType:t,providerName:e,providerStatus:n,devices:s}){return h.jsxs("section",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(sy,{type:t,size:"md"}),h.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[h.jsx("h2",{className:"text-sm font-semibold text-foreground truncate",children:e||y8(t)}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle flex-shrink-0",children:[s.length," camera",s.length!==1?"s":""]})]}),h.jsx(nh,{status:n})]}),h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3",children:s.map(i=>h.jsx(rA,{id:i.id,name:i.name,status:i.status,detectionsToday:0,inferenceMs:0},i.id))})]})}function lA(){const{t}=Er(),e=en(),[n,s]=D.useState(""),{data:i,isLoading:o}=dt({queryKey:["devices"],queryFn:()=>e.listDevices(),refetchInterval:5e3}),{data:d,isLoading:f}=dt({queryKey:["providers"],queryFn:()=>e.listProviders()}),p=i??[],y=d??[],S=D.useMemo(()=>{const j=n.toLowerCase();return p.filter(w=>{const T=(w.type??"").toLowerCase(),O=w.capabilities??[];return T==="camera"||T.includes("camera")||O.some(k=>k.toLowerCase().includes("video")||k.toLowerCase().includes("stream"))||!T||T==="—"?j?(w.name??w.id??"").toLowerCase().includes(j):!0:!1})},[p,n]),b=D.useMemo(()=>{const j=new Map;for(const w of S){const T=w.providerId??"";j.has(T)||j.set(T,[]),j.get(T).push(w)}return j},[S]),_=o||f;return h.jsxs("div",{className:"p-6 space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between gap-4",children:[h.jsx("h1",{className:"text-lg font-semibold text-foreground",children:t("nav.cameras","Cameras")}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs("div",{className:"relative",children:[h.jsx(mv,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-foreground-subtle"}),h.jsx("input",{type:"text",value:n,onChange:j=>s(j.target.value),placeholder:"Search cameras...",className:"rounded-lg border border-border bg-surface pl-8 pr-3 py-1.5 text-xs text-foreground placeholder:text-foreground-subtle focus:outline-none focus:border-primary/50 w-48"})]}),h.jsxs("span",{className:"text-[11px] text-foreground-subtle",children:[S.length," camera",S.length!==1?"s":""]})]})]}),_&&h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3",children:[1,2,3,4,5,6].map(j=>h.jsx("div",{className:"aspect-[16/12] rounded-lg border border-border bg-surface animate-pulse"},j))}),!_&&S.length===0&&h.jsxs("div",{className:"flex flex-col items-center py-20 text-foreground-subtle",children:[h.jsx(Lc,{className:"h-12 w-12 mb-4 opacity-20"}),h.jsx("p",{className:"text-sm font-medium text-foreground",children:"No cameras found"}),h.jsx("p",{className:"text-xs mt-1",children:n?"Try a different search term":"Add an integration to discover cameras"})]}),!_&&Array.from(b.entries()).map(([j,w])=>{var O;const T=y.find(R=>R.id===j);return h.jsx(iA,{providerType:(T==null?void 0:T.type)??"rtsp",providerName:(T==null?void 0:T.name)??j,providerStatus:(O=T==null?void 0:T.status)!=null&&O.connected?"running":"stopped",devices:w.map(R=>{var M;return{id:R.id,name:R.name??R.id,status:(M=R.state)!=null&&M.online?"online":"offline"}})},j)})]})}function oA({onSelect:t,onClose:e}){const{t:n}=Er(),s=en(),i=xl(),{data:o,isLoading:d}=dt({queryKey:["provider-types"],queryFn:()=>s.listProviderTypes()});return d?h.jsx("div",{className:"space-y-2 p-2",children:[1,2,3].map(f=>h.jsx("div",{className:"h-14 rounded-lg bg-surface animate-pulse"},f))}):h.jsxs("div",{className:"space-y-2",children:[(o??[]).map(f=>{const p=f.instanceMode==="unique"&&f.existingInstances.length>0;return h.jsxs("button",{onClick:()=>{if(p){const y=f.existingInstances[0].id;e(),i(`/integrations/${y}`)}else t(f.addonId,f.instanceMode,f.discoveryMode)},className:"flex w-full items-center gap-3 rounded-lg border border-border bg-surface p-3 text-left hover:border-foreground-subtle/30 transition-colors",children:[f.iconUrl?h.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg flex-shrink-0",style:{backgroundColor:`${f.color}15`},children:h.jsx("img",{src:f.iconUrl,alt:"",className:"h-5 w-5"})}):h.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg flex-shrink-0",style:{backgroundColor:`${f.color}15`},children:h.jsx("span",{className:"text-sm",style:{color:f.color},children:"◉"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("p",{className:"text-xs font-semibold text-foreground",children:f.name}),f.description&&h.jsx("p",{className:"text-[10px] text-foreground-subtle mt-0.5 truncate",children:f.description})]}),p?h.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-medium text-foreground-subtle",children:[h.jsx(Wm,{className:"h-3 w-3"}),n("integrations.manage")]}):h.jsx(Zu,{className:"h-4 w-4 text-foreground-subtle flex-shrink-0"})]},f.addonId)}),(o??[]).length===0&&h.jsx("div",{className:"py-8 text-center text-xs text-foreground-subtle",children:n("integrations.noProviders")})]})}function cA({tabs:t,active:e,onChange:n}){return h.jsx("div",{className:"flex rounded-lg border border-border bg-surface p-0.5 gap-0.5",children:t.map(s=>h.jsx("button",{type:"button",onClick:()=>n(s.id),className:["flex-1 rounded-md px-3 py-1.5 text-xs font-medium transition-colors",e===s.id?"bg-primary/12 text-primary":"text-foreground-subtle hover:text-foreground hover:bg-surface-hover"].join(" "),children:s.label},s.id))})}function uA(t){const e=t.formats;if(!e)return"";const n=Object.values(e).filter(o=>o!==void 0&&o.sizeMB>0).map(o=>o.sizeMB);if(n.length===0)return"";const s=Math.min(...n),i=Math.max(...n);return s===i?`${s} MB`:`${s}-${i} MB`}function dA(t){return`${t.inputSize.width}x${t.inputSize.height}`}function fA(t){return t.formats?Object.keys(t.formats).filter(e=>t.formats[e]!==void 0):[]}function hA({entry:t,selected:e,onSelect:n,disabled:s}){const i=uA(t),o=dA(t),d=fA(t);return h.jsxs("button",{type:"button",onClick:n,disabled:s,className:["w-full text-left rounded-lg border p-3 transition-all",e?"border-primary bg-primary/5 ring-1 ring-primary/30":"border-border bg-background hover:border-foreground-subtle/40 hover:bg-surface-hover/50",s?"opacity-50 cursor-not-allowed":"cursor-pointer"].join(" "),children:[h.jsx("div",{className:"flex items-start justify-between gap-2",children:h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-xs font-semibold text-foreground truncate",children:t.name}),e&&h.jsx(Im,{className:"h-3.5 w-3.5 text-primary shrink-0"})]}),h.jsx("p",{className:"text-[10px] text-foreground-subtle mt-0.5 line-clamp-2",children:t.description})]})}),h.jsxs("div",{className:"flex items-center gap-3 mt-2 flex-wrap",children:[h.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-foreground-subtle",children:[h.jsx(zf,{className:"h-3 w-3"}),o]}),i&&h.jsx("span",{className:"text-[10px] text-foreground-subtle",children:i}),d.length>0&&h.jsx("div",{className:"flex gap-1",children:d.map(f=>h.jsx("span",{className:"text-[9px] uppercase rounded bg-surface border border-border px-1 py-0.5 text-foreground-subtle font-mono",children:f},f))}),t.labels.length>0&&h.jsxs("span",{className:"text-[10px] text-foreground-subtle",children:[t.labels.length," label",t.labels.length!==1?"s":""]})]})]})}function pA({field:t,value:e,onChange:n,disabled:s}){const i=t.catalog??[],o=i.length>0,d=t.allowCustomPath!==!1||t.allowCustom===!0,f=[...o?[{id:"catalog",label:`Models (${i.length})`}]:[],...d?[{id:"custom",label:"Custom Path"}]:[]],[p,y]=D.useState(o?"catalog":"custom"),S=e==null?"":String(e);return h.jsxs("div",{className:"space-y-3",children:[f.length>1&&h.jsx(cA,{tabs:f,active:p,onChange:y}),p==="catalog"&&o&&h.jsx("div",{className:"space-y-1.5 max-h-[320px] overflow-y-auto pr-1",children:i.map(b=>h.jsx(hA,{entry:b,selected:S===b.id,onSelect:()=>n(b.id),disabled:s||t.disabled},b.id))}),p==="catalog"&&!o&&h.jsxs("div",{className:"rounded-md border border-info/30 bg-info/5 px-3 py-2 flex items-start gap-2",children:[h.jsx(C1,{className:"h-3.5 w-3.5 text-info shrink-0 mt-0.5"}),h.jsx("p",{className:"text-[11px] text-foreground-subtle leading-relaxed",children:"No predefined models available. Use the Custom Path tab to specify a model file path or URL."})]}),p==="custom"&&d&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("input",{type:"text",className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none disabled:opacity-50",placeholder:"Enter path like /data/models/custom.onnx or https://...",value:S,disabled:s||t.disabled,onChange:b=>n(b.target.value)}),t.acceptFormats&&t.acceptFormats.length>0&&h.jsxs("p",{className:"text-[10px] text-foreground-subtle",children:["Accepted formats: ",t.acceptFormats.join(", ")]})]}),(t.compatibilityNote||t.conversionGuideUrl)&&h.jsxs("div",{className:"flex items-start justify-between gap-3 pt-1",children:[t.compatibilityNote&&h.jsxs("p",{className:"flex items-start gap-1 text-[10px] text-foreground-subtle",children:[h.jsx(C1,{className:"h-3 w-3 mt-0.5 shrink-0"}),t.compatibilityNote]}),t.conversionGuideUrl&&h.jsxs("a",{href:t.conversionGuideUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-[11px] text-primary hover:underline shrink-0",children:["How to convert your model",h.jsx(yT,{className:"h-3 w-3"})]})]})]})}const hh="w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none disabled:opacity-50 disabled:cursor-not-allowed",x8="block text-xs font-medium text-foreground mb-1",mA="text-[10px] text-foreground-subtle mt-0.5";function ri({label:t,description:e,required:n,span:s,children:i,translationFn:o}){const d=s===2?"col-span-2":s===3?"col-span-3":s===4?"col-span-4":"col-span-1",f=Wu(t,o),p=Wu(e,o);return h.jsxs("div",{className:d,children:[f!==void 0&&h.jsxs("label",{className:x8,children:[f,n&&h.jsx("span",{className:"text-danger ml-0.5",children:"*"})]}),i,p&&h.jsx("p",{className:mA,children:p})]})}function gA({field:t,value:e,onChange:n,disabled:s,translationFn:i}){return h.jsx(ri,{label:t.label,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsx("input",{type:t.inputType??"text",className:hh,value:e==null?"":String(e),placeholder:t.placeholder,maxLength:t.maxLength,pattern:t.pattern,disabled:s||t.disabled,onChange:o=>n(o.target.value)})})}function yA({field:t,value:e,onChange:n,disabled:s,translationFn:i}){return h.jsx(ri,{label:t.label,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("input",{type:"number",className:hh,value:e==null?"":String(e),placeholder:t.placeholder,min:t.min,max:t.max,step:t.step,disabled:s||t.disabled,onChange:o=>n(o.target.value===""?void 0:Number(o.target.value))}),t.unit&&h.jsx("span",{className:"text-xs text-foreground-subtle whitespace-nowrap",children:t.unit})]})})}function xA({field:t,value:e,onChange:n,disabled:s,translationFn:i}){const o=!!e,d=s||t.disabled;return t.style==="checkbox"?h.jsx(ri,{label:void 0,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[h.jsx("input",{type:"checkbox",className:"h-3.5 w-3.5 rounded border-border accent-primary",checked:o,disabled:d,onChange:f=>n(f.target.checked)}),h.jsx("span",{className:"text-xs font-medium text-foreground",children:Wu(t.label,i)}),t.required&&h.jsx("span",{className:"text-danger",children:"*"})]})}):h.jsx(ri,{label:void 0,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("span",{className:x8+" mb-0",children:[Wu(t.label,i),t.required&&h.jsx("span",{className:"text-danger ml-0.5",children:"*"})]}),h.jsx("button",{type:"button",role:"switch","aria-checked":o,disabled:d,onClick:()=>!d&&n(!o),className:["relative inline-flex h-4 w-8 shrink-0 items-center rounded-full transition-colors duration-150",o?"bg-primary":"bg-foreground-subtle/30",d?"opacity-50 cursor-not-allowed":"cursor-pointer"].join(" "),children:h.jsx("span",{className:["inline-block h-3 w-3 rounded-full bg-white shadow transition-transform duration-150",o?"translate-x-4":"translate-x-0.5"].join(" ")})})]})})}function bA({field:t,value:e,onChange:n,disabled:s,translationFn:i}){return h.jsx(ri,{label:t.label,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsxs("select",{className:hh,value:e==null?"":String(e),disabled:s||t.disabled,onChange:o=>n(o.target.value),children:[!t.required&&h.jsx("option",{value:"",children:"— Select —"}),t.options.map(o=>h.jsx("option",{value:o.value,children:o.label},o.value))]})})}function vA({field:t,value:e,onChange:n,disabled:s,translationFn:i}){const o=Array.isArray(e)?e:[],d=f=>{if(o.includes(f))n(o.filter(p=>p!==f));else{if(t.maxItems!==void 0&&o.length>=t.maxItems)return;n([...o,f])}};return h.jsx(ri,{label:t.label,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsx("div",{className:"flex flex-wrap gap-2",children:t.options.map(f=>{const p=o.includes(f.value);return h.jsxs("label",{className:["flex items-center gap-1.5 rounded-md border px-2 py-1 text-xs cursor-pointer select-none transition-colors",p?"border-primary bg-primary/10 text-primary":"border-border bg-background text-foreground hover:bg-surface",s||t.disabled?"opacity-50 cursor-not-allowed":""].join(" "),children:[h.jsx("input",{type:"checkbox",className:"sr-only",checked:p,disabled:s||t.disabled,onChange:()=>d(f.value)}),f.label]},f.value)})})})}function SA({field:t,value:e,onChange:n,disabled:s,translationFn:i}){const[o,d]=D.useState(!1),f=t.showToggle!==!1;return h.jsx(ri,{label:t.label,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsxs("div",{className:"relative",children:[h.jsx("input",{type:o?"text":"password",className:hh+(f?" pr-9":""),value:e==null?"":String(e),placeholder:t.placeholder,disabled:s||t.disabled,onChange:p=>n(p.target.value)}),f&&h.jsx("button",{type:"button",className:"absolute right-2 top-1/2 -translate-y-1/2 text-foreground-subtle hover:text-foreground",tabIndex:-1,onClick:()=>d(p=>!p),children:o?h.jsx(A6,{className:"h-3.5 w-3.5"}):h.jsx(uh,{className:"h-3.5 w-3.5"})})]})})}function NA({field:t,value:e,onChange:n,disabled:s,translationFn:i}){return h.jsx(ri,{label:t.label,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsx("textarea",{className:hh+" resize-y min-h-[60px]",value:e==null?"":String(e),placeholder:t.placeholder,rows:t.rows??3,maxLength:t.maxLength,disabled:s||t.disabled,onChange:o=>n(o.target.value)})})}function _A({field:t,value:e,onChange:n,disabled:s,translationFn:i}){const o=e==null?t.min:Number(e),d=t.showValue!==!1;return h.jsx(ri,{label:t.label,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("input",{type:"range",className:"flex-1 h-1 accent-primary cursor-pointer disabled:opacity-50",min:t.min,max:t.max,step:t.step??1,value:o,disabled:s||t.disabled,onChange:f=>n(Number(f.target.value))}),d&&h.jsxs("span",{className:"text-xs text-foreground tabular-nums min-w-[2.5rem] text-right",children:[o,t.unit?` ${t.unit}`:""]})]})})}function CA({field:t,value:e,onChange:n,disabled:s,translationFn:i}){const o=Array.isArray(e)?e:[],[d,f]=D.useState(""),p=D.useRef(null),y=D.useCallback(j=>{const w=j.trim();!w||o.includes(w)||t.maxTags!==void 0&&o.length>=t.maxTags||(n([...o,w]),f(""))},[o,t.maxTags,n]),S=j=>n(o.filter(w=>w!==j)),b=j=>{j.key==="Enter"||j.key===","?(j.preventDefault(),y(d)):j.key==="Backspace"&&d===""&&o.length>0&&S(o[o.length-1])},_=s||t.disabled;return h.jsx(ri,{label:t.label,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsxs("div",{className:["flex flex-wrap gap-1.5 rounded-md border border-border bg-background px-2 py-1.5 min-h-[38px] cursor-text","focus-within:border-primary focus-within:ring-1 focus-within:ring-primary/30",_?"opacity-50 cursor-not-allowed":""].join(" "),onClick:()=>{var j;return!_&&((j=p.current)==null?void 0:j.focus())},children:[o.map(j=>h.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-primary/10 px-1.5 py-0.5 text-xs text-primary",children:[j,!_&&h.jsx("button",{type:"button",onClick:()=>S(j),className:"hover:text-danger",children:h.jsx(Oi,{className:"h-2.5 w-2.5"})})]},j)),h.jsx("input",{ref:p,type:"text",className:"flex-1 min-w-[80px] bg-transparent text-sm text-foreground outline-none placeholder:text-foreground-disabled",value:d,placeholder:o.length===0?t.placeholder??"Add tags…":"",disabled:_,list:`tags-suggestions-${t.key}`,onChange:j=>f(j.target.value),onKeyDown:b,onBlur:()=>{d.trim()&&y(d)}}),t.suggestions&&h.jsx("datalist",{id:`tags-suggestions-${t.key}`,children:t.suggestions.map(j=>h.jsx("option",{value:j},j))})]})})}function jA({field:t,value:e,onChange:n,disabled:s,translationFn:i}){const o=e==null?"#000000":String(e);return h.jsxs(ri,{label:t.label,description:t.description,required:t.required,span:t.span,translationFn:i,children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("input",{type:"color",className:"h-9 w-9 rounded-md border border-border bg-background cursor-pointer p-0.5 disabled:opacity-50",value:o,disabled:s||t.disabled,onChange:d=>n(d.target.value)}),h.jsx("input",{type:"text",className:hh+" flex-1 font-mono",value:o,placeholder:"#000000",disabled:s||t.disabled,onChange:d=>n(d.target.value)})]}),t.presets&&t.presets.length>0&&h.jsx("div",{className:"flex gap-1.5 mt-1.5",children:t.presets.map(d=>h.jsx("button",{type:"button",className:"h-5 w-5 rounded-md border border-border hover:scale-110 transition-transform disabled:opacity-50",style:{backgroundColor:d},disabled:s||t.disabled,title:d,onClick:()=>n(d)},d))})]})}function wA({field:t,values:e,onChange:n,disabled:s,translationFn:i}){const[o,d]=D.useState(t.defaultCollapsed??!1),f=t.style==="accordion",p=t.span===2?"col-span-2":t.span===3?"col-span-3":t.span===4?"col-span-4":"col-span-1";return h.jsx("div",{className:p,children:h.jsxs("div",{className:"rounded-lg border border-border bg-surface/50 overflow-hidden",children:[h.jsxs("div",{className:["px-3 py-2 flex items-center justify-between",f?"cursor-pointer hover:bg-surface":""].join(" "),onClick:f?()=>d(y=>!y):void 0,children:[h.jsx("span",{className:"text-xs font-semibold text-foreground",children:Wu(t.label,i)}),f&&h.jsx("span",{className:"text-foreground-subtle text-xs",children:o?"▸":"▾"})]}),!o&&h.jsx("div",{className:"px-3 pb-3 grid grid-cols-2 gap-x-4 gap-y-3",children:t.fields.map(y=>h.jsx(b8,{field:y,values:e,onChange:n,disabled:s,translationFn:i},y.key))})]})})}function EA({field:t,value:e,onChange:n,disabled:s,translationFn:i}){return h.jsx(ri,{label:t.label,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsx(pA,{field:t,value:e,onChange:n,disabled:s})})}function TA({span:t}){const e=t===2?"col-span-2":t===3?"col-span-3":t===4?"col-span-4":"col-span-full";return h.jsx("div",{className:e,children:h.jsx("hr",{className:"border-border"})})}const g5={info:{border:"border-info",bg:"bg-info/5",text:"text-info"},warning:{border:"border-warning",bg:"bg-warning/5",text:"text-warning"},success:{border:"border-success",bg:"bg-success/5",text:"text-success"},danger:{border:"border-danger",bg:"bg-danger/5",text:"text-danger"}};function RA({field:t}){const e=t.variant??"info",n=g5[e]??g5.info;return h.jsx("div",{className:"col-span-full",children:h.jsxs("div",{className:`rounded-md border-l-4 px-3 py-2.5 ${n.border} ${n.bg}`,children:[t.label&&h.jsx("p",{className:`text-xs font-semibold mb-0.5 ${n.text}`,children:t.label}),h.jsx("p",{className:"text-xs text-foreground-subtle leading-relaxed",children:t.content})]})})}function b8({field:t,values:e,onChange:n,disabled:s,translationFn:i}){if("showWhen"in t&&t.showWhen){const f=t.showWhen,p=e[f.field];let y=!0;if(f.equals!==void 0?y=p===f.equals:f.notEquals!==void 0?y=p!==f.notEquals:f.in!==void 0?y=f.in.includes(p):f.notIn!==void 0&&(y=!f.notIn.includes(p)),!y)return null}const o=e[t.key],d=f=>n(t.key,f);switch(t.type){case"text":return h.jsx(gA,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"number":return h.jsx(yA,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"boolean":return h.jsx(xA,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"select":return h.jsx(bA,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"multiselect":return h.jsx(vA,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"password":return h.jsx(SA,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"textarea":return h.jsx(NA,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"slider":return h.jsx(_A,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"tags":return h.jsx(CA,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"color":return h.jsx(jA,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"group":return h.jsx(wA,{field:t,values:e,onChange:n,disabled:s,translationFn:i});case"separator":return h.jsx(TA,{});case"info":return h.jsx(RA,{field:t});case"model-selector":return h.jsx(EA,{field:t,value:o,onChange:d,disabled:s,translationFn:i});default:return null}}function OA(t){return/^[a-zA-Z0-9_]+(\.[a-zA-Z0-9_]+)+$/.test(t)}function Wu(t,e){if(t!==void 0)return e&&OA(t)?e(t):t}function MA({section:t,values:e,onChange:n,disabled:s,translationFn:i}){const[o,d]=D.useState(t.defaultCollapsed??!1),f=t.style==="accordion",p=t.columns??2,y=p===1?"grid-cols-1":p===3?"grid-cols-3":p===4?"grid-cols-4":"grid-cols-2";return h.jsxs("div",{className:"rounded-lg border border-border bg-surface p-4",children:[h.jsxs("div",{className:["flex items-center justify-between mb-3",f?"cursor-pointer":""].join(" "),onClick:f?()=>d(S=>!S):void 0,children:[h.jsxs("div",{children:[h.jsx("h3",{className:"text-xs font-semibold text-foreground-subtle uppercase tracking-wider",children:Wu(t.title,i)}),t.description&&h.jsx("p",{className:"text-[10px] text-foreground-subtle mt-0.5",children:Wu(t.description,i)})]}),f&&h.jsx("span",{className:"text-foreground-subtle text-xs ml-2",children:o?"▸":"▾"})]}),!o&&h.jsx("div",{className:`grid ${y} gap-x-4 gap-y-3`,children:t.fields.map(S=>h.jsx(b8,{field:S,values:e,onChange:n,disabled:s,translationFn:i},S.key))})]})}function ry({schema:t,values:e,onChange:n,disabled:s,translationFn:i}){const o=(d,f)=>{n({...e,[d]:f})};return h.jsx("div",{className:"space-y-4",children:t.sections.map(d=>h.jsx(MA,{section:d,values:e,onChange:o,disabled:s,translationFn:i},d.id))})}function AA({addonId:t,configSchema:e,onSave:n,onBack:s}){const{t:i}=Er(),o=en(),[d,f]=D.useState(""),[p,y]=D.useState({}),[S,b]=D.useState(null),_=jn({mutationFn:()=>o.trpc.providerConfig.testConnection.mutate({type:t,url:String(p.url??""),username:p.username?String(p.username):void 0,password:p.password?String(p.password):void 0}),onSuccess:j=>b(j),onError:j=>b({success:!1,error:String(j)})});return h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-[11px] font-medium text-foreground mb-1",children:i("integrations.integrationName")}),h.jsx("input",{type:"text",value:d,onChange:j=>f(j.target.value),placeholder:i("integrations.integrationNamePlaceholder"),className:"w-full rounded-lg border border-border bg-surface px-3 py-2 text-xs text-foreground placeholder:text-foreground-subtle focus:outline-none focus:border-primary/50"})]}),e&&h.jsx(ry,{schema:e,values:p,onChange:y}),S&&h.jsx("div",{className:`rounded-lg border px-3 py-2 text-xs ${S.success?"border-success/30 bg-success/5 text-success":"border-danger/30 bg-danger/5 text-danger"}`,children:S.success?i("integrations.connectionSuccess"):`${i("integrations.errorPrefix")} ${S.error}`}),h.jsxs("div",{className:"flex items-center justify-between pt-2",children:[h.jsx("button",{onClick:s,className:"rounded-lg border border-border px-3 py-1.5 text-xs text-foreground-subtle hover:text-foreground transition-colors",children:i("integrations.back")}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("button",{onClick:()=>_.mutate(),disabled:_.isPending,className:"rounded-lg border border-border px-3 py-1.5 text-xs text-foreground hover:bg-surface-hover transition-colors disabled:opacity-50",children:_.isPending?i("integrations.testing"):i("integrations.testConnection")}),h.jsx("button",{onClick:()=>n({name:d,config:p}),disabled:!d.trim(),className:"rounded-lg bg-primary px-4 py-1.5 text-xs font-medium text-primary-foreground shadow-sm disabled:opacity-50",children:i("integrations.forward")})]})]})]})}function DA({providerId:t,onImport:e,onSkip:n}){const{t:s}=Er(),i=en(),[o,d]=D.useState(new Set),{data:f,isLoading:p}=dt({queryKey:["discover-devices",t],queryFn:()=>i.discoverDevices(t)});function y(b){d(_=>{const j=new Set(_);return j.has(b)?j.delete(b):j.add(b),j})}if(p)return h.jsxs("div",{className:"flex flex-col items-center py-12",children:[h.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-primary border-t-transparent"}),h.jsx("p",{className:"mt-3 text-xs text-foreground-subtle",children:s("integrations.searchingDevices")})]});const S=f??[];return h.jsxs("div",{className:"space-y-4",children:[h.jsx("p",{className:"text-xs text-foreground-subtle",children:S.length>0?s("integrations.foundDevices",{count:S.length}):s("integrations.noDevicesFound")}),S.length>0&&h.jsx("div",{className:"space-y-1.5 max-h-64 overflow-y-auto",children:S.map(b=>{const _=b.externalId,j=b.name??_,w=o.has(_);return h.jsxs("button",{onClick:()=>y(_),className:`flex w-full items-center gap-3 rounded-lg border p-3 text-left transition-colors ${w?"border-primary/40 bg-primary/5":"border-border bg-surface hover:border-foreground-subtle/30"}`,children:[h.jsx("div",{className:`flex h-5 w-5 items-center justify-center rounded border flex-shrink-0 ${w?"border-primary bg-primary":"border-border"}`,children:w&&h.jsx(Im,{className:"h-3 w-3 text-primary-foreground"})}),h.jsx(Lc,{className:"h-3.5 w-3.5 text-foreground-subtle flex-shrink-0"}),h.jsx("span",{className:"text-xs font-medium text-foreground truncate",children:j})]},_)})}),h.jsxs("div",{className:"flex items-center justify-between pt-2",children:[h.jsx("button",{onClick:n,className:"rounded-lg border border-border px-3 py-1.5 text-xs text-foreground-subtle hover:text-foreground transition-colors",children:s("integrations.skip")}),S.length>0&&h.jsxs("button",{onClick:()=>e(Array.from(o)),disabled:o.size===0,className:"rounded-lg bg-primary px-4 py-1.5 text-xs font-medium text-primary-foreground shadow-sm disabled:opacity-50",children:[s("integrations.importSelected")," (",o.size,")"]})]})]})}function zA({open:t,onClose:e}){const{t:n}=Er(),s=en(),i=xl(),o=ga(),[d,f]=D.useState("picker"),[p,y]=D.useState(null),[S,b]=D.useState(null),[_,j]=D.useState("manual"),{data:w}=dt({queryKey:["addon-config-schema",p],queryFn:()=>s.getAddonConfigSchema(p),enabled:p!=null}),T=jn({mutationFn:U=>s.trpc.providerConfig.addProvider.mutate({id:U.id,type:U.type,name:U.name,...U.config}),onSuccess:()=>o.invalidateQueries({queryKey:["providers"]})}),O=jn({mutationFn:U=>s.adoptDevice(S,U),onSuccess:()=>o.invalidateQueries({queryKey:["devices"]})});async function R(U,V,Z){if(y(U),j(Z),V==="unique"){const re=`${U}-${Date.now()}`;try{await T.mutateAsync({id:re,type:U,name:U,config:{}}),e(),G(),i(`/integrations/${re}`)}catch{}return}f("config")}async function M(U){if(!p)return;const V=`${p}-${Date.now()}`;try{await T.mutateAsync({id:V,type:p,name:U.name,config:U.config}),b(V),_==="auto"||_==="both"?f("discovery"):k(V)}catch{}}async function z(U){for(const V of U)await O.mutateAsync(V);k()}function k(U){const V=U??S??p;e(),G(),V&&i(`/integrations/${V}`)}function G(){f("picker"),y(null),b(null),j("manual")}function P(){e(),G()}if(!t)return null;const L={picker:n("integrations.newIntegration"),config:n("integrations.configureIntegration"),discovery:n("integrations.importDevices")};return h.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[h.jsx("div",{className:"absolute inset-0 bg-black/60",onClick:P}),h.jsxs("div",{className:"relative z-10 w-full max-w-lg rounded-xl border border-border bg-background shadow-2xl",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-border px-5 py-4",children:[h.jsx("h2",{className:"text-sm font-semibold text-foreground",children:L[d]}),h.jsx("button",{onClick:P,className:"rounded-md p-1 text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",children:h.jsx(Oi,{className:"h-4 w-4"})})]}),h.jsxs("div",{className:"px-5 py-4",children:[d==="picker"&&h.jsx(oA,{onSelect:R,onClose:P}),d==="config"&&p&&h.jsx(AA,{addonId:p,configSchema:w??null,onSave:M,onBack:()=>f("picker")}),d==="discovery"&&S&&h.jsx(DA,{providerId:S,onImport:z,onSkip:k})]})]})]})}const kA=[{id:"all",label:"All",icon:x3},{id:"camera",label:"Camera",icon:Lc},{id:"sensor",label:"Sensor",icon:pv},{id:"light",label:"Light",icon:qT},{id:"switch",label:"Switch",icon:vR},{id:"other",label:"Other",icon:x3}];function vx(t){const e=(t.type??"").toLowerCase();return e.includes("camera")||e==="camera"?"camera":e.includes("sensor")?"sensor":e.includes("light")?"light":e.includes("switch")?"switch":e?"other":"camera"}function LA(){const t=en(),e=ga(),n=xl(),[s,i]=D.useState(!1),[o,d]=D.useState(""),[f,p]=D.useState("all"),[y,S]=D.useState("provider"),[b,_]=D.useState(new Set(["__all__"])),{data:j,isLoading:w}=dt({queryKey:["providers"],queryFn:()=>t.listProviders(),refetchInterval:5e3}),{data:T,isLoading:O}=dt({queryKey:["devices"],queryFn:()=>t.listDevices(),refetchInterval:5e3});jn({mutationFn:Z=>t.startProvider(Z),onSuccess:()=>e.invalidateQueries({queryKey:["providers"]})}),jn({mutationFn:Z=>t.stopProvider(Z),onSuccess:()=>e.invalidateQueries({queryKey:["providers"]})});const R=j??[],M=T??[],z=D.useMemo(()=>{const Z=o.toLowerCase();return M.filter(re=>!(f!=="all"&&vx(re)!==f||Z&&!(re.name??re.id??"").toLowerCase().includes(Z)))},[M,f,o]),k=D.useMemo(()=>{var re;const Z=new Map;for(const ne of z){let W;switch(y){case"provider":W=ne.providerId??"unknown";break;case"type":W=vx(ne);break;case"status":W=(re=ne.state)!=null&&re.online?"online":"offline";break}Z.has(W)||Z.set(W,[]),Z.get(W).push(ne)}return Z},[z,y]);function G(Z){_(re=>{const ne=new Set(re);return ne.has(Z)?ne.delete(Z):ne.add(Z),ne})}function P(Z){if(y==="provider"){const re=R.find(ne=>ne.id===Z);return re?re.name??Z:Z}return Z.charAt(0).toUpperCase()+Z.slice(1)}function L(Z){if(y==="provider"){const re=R.find(ne=>ne.id===Z);return(re==null?void 0:re.type)??"rtsp"}return"rtsp"}function U(Z){var re;if(y==="provider"){const ne=R.find(W=>W.id===Z);return(re=ne==null?void 0:ne.status)!=null&&re.connected?"running":"stopped"}return""}const V=w||O;return h.jsxs("div",{className:"p-6 space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between gap-4",children:[h.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Integrations"}),h.jsxs("button",{onClick:()=>i(!0),className:"flex items-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground shadow-sm",children:[h.jsx(po,{className:"h-3.5 w-3.5"}),"New Integration"]})]}),h.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[h.jsxs("div",{className:"relative",children:[h.jsx(mv,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-foreground-subtle"}),h.jsx("input",{type:"text",value:o,onChange:Z=>d(Z.target.value),placeholder:"Search devices...",className:"rounded-lg border border-border bg-surface pl-8 pr-3 py-1.5 text-xs text-foreground placeholder:text-foreground-subtle focus:outline-none focus:border-primary/50 w-48"})]}),h.jsx("div",{className:"flex items-center gap-1",children:kA.map(({id:Z,label:re})=>h.jsx("button",{onClick:()=>p(Z),className:`rounded-full px-2.5 py-1 text-[10px] font-medium transition-colors ${f===Z?"bg-primary/15 text-primary border border-primary/30":"bg-surface border border-border text-foreground-subtle hover:text-foreground"}`,children:re},Z))}),h.jsxs("div",{className:"flex items-center gap-1.5 ml-auto",children:[h.jsx("span",{className:"text-[10px] text-foreground-subtle",children:"Group by:"}),h.jsxs("select",{value:y,onChange:Z=>S(Z.target.value),className:"rounded-lg border border-border bg-surface px-2 py-1 text-[11px] text-foreground focus:outline-none focus:border-primary/50",children:[h.jsx("option",{value:"provider",children:"Provider"}),h.jsx("option",{value:"type",children:"Type"}),h.jsx("option",{value:"status",children:"Status"})]})]})]}),V&&h.jsx("div",{className:"space-y-2",children:[1,2,3].map(Z=>h.jsx("div",{className:"h-14 rounded-lg border border-border bg-surface animate-pulse"},Z))}),!V&&z.length===0&&h.jsxs("div",{className:"flex flex-col items-center py-20 text-foreground-subtle",children:[h.jsx("p",{className:"text-sm",children:"No devices found."}),h.jsx("p",{className:"text-xs mt-1",children:o||f!=="all"?"Try adjusting your filters":"Start an integration to discover devices."})]}),!V&&Array.from(k.entries()).map(([Z,re])=>{const ne=b.has(Z)||b.has("__all__"),W=L(Z),ie=U(Z),ce=y==="provider"?Z:null;return h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsxs("button",{onClick:()=>G(Z),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-surface-hover transition-colors",children:[ne?h.jsx(Mc,{className:"h-3.5 w-3.5 text-foreground-subtle flex-shrink-0"}):h.jsx(Zu,{className:"h-3.5 w-3.5 text-foreground-subtle flex-shrink-0"}),y==="provider"&&h.jsx(sy,{type:W,size:"sm"}),y==="provider"?h.jsx("span",{className:"text-xs font-semibold text-foreground hover:text-primary hover:underline cursor-pointer",onClick:Y=>{Y.stopPropagation(),n(`/integrations/${Z}`)},children:P(Z)}):h.jsx("span",{className:"text-xs font-semibold text-foreground",children:P(Z)}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle",children:[re.length," device",re.length!==1?"s":""]}),ie&&h.jsx(nh,{status:ie}),h.jsx("div",{className:"ml-auto flex items-center gap-1",onClick:Y=>Y.stopPropagation(),children:ce&&h.jsx("button",{className:"p-1.5 rounded-md text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",title:"Provider settings",children:h.jsx(Wm,{className:"h-3.5 w-3.5"})})})]}),ne&&h.jsxs("div",{className:"border-t border-border",children:[h.jsxs("div",{className:"grid grid-cols-[1fr_80px_80px_80px_100px_100px] gap-2 px-4 py-2 text-[10px] font-medium text-foreground-subtle uppercase tracking-wider border-b border-border bg-background",children:[h.jsx("span",{children:"Name"}),h.jsx("span",{children:"Type"}),h.jsx("span",{children:"Status"}),h.jsx("span",{children:"Phase"}),h.jsx("span",{children:"Today"}),h.jsx("span",{children:"Last Event"})]}),re.map(Y=>{var I;const $=Y.id,ae=Y.name??Y.id,Ne=vx(Y),me=(I=Y.state)!=null&&I.online?"online":"offline",B=Y.phase??"—";return h.jsxs("button",{onClick:()=>n(`/devices/${$}`),className:"w-full grid grid-cols-[1fr_80px_80px_80px_100px_100px] gap-2 px-4 py-2.5 text-left hover:bg-surface-hover transition-colors border-b border-border last:border-b-0",children:[h.jsx("span",{className:"text-xs font-medium text-foreground truncate",children:ae}),h.jsx("span",{className:"text-[11px] text-foreground-subtle capitalize",children:Ne}),h.jsx("span",{children:h.jsx(nh,{status:me})}),h.jsx("span",{className:"text-[11px] text-foreground-subtle",children:B}),h.jsx("span",{className:"text-[11px] text-foreground-subtle",children:"—"}),h.jsx("span",{className:"text-[11px] text-foreground-subtle",children:"—"})]},$)})]})]},Z)}),h.jsx(zA,{open:s,onClose:()=>i(!1)})]})}function UA({deviceName:t,snapshotUrl:e,status:n,resolution:s,codec:i,fps:o,lastSnapshot:d}){const{t:f}=Er(),[p,y]=D.useState(!1);return h.jsxs("div",{className:"relative flex-shrink-0",onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),children:[h.jsx("button",{className:"flex h-6 w-6 items-center justify-center rounded text-foreground-subtle hover:bg-surface-hover hover:text-foreground transition-colors",title:f("integrations.preview"),children:h.jsx(uh,{className:"h-3.5 w-3.5"})}),p&&h.jsxs("div",{className:"absolute bottom-full right-0 mb-2 w-72 rounded-lg border border-border bg-surface shadow-lg shadow-black/30 z-50 overflow-hidden",children:[h.jsx("div",{className:"h-40 bg-background flex items-center justify-center",children:e&&n!=="offline"?h.jsx("img",{src:e,alt:t,className:"h-full w-full object-cover",onError:S=>{S.target.style.display="none"}}):h.jsx("span",{className:"text-xs text-foreground-subtle",children:f(n==="offline"?"integrations.snapshotUnavailable":"integrations.noSnapshot")})}),h.jsxs("div",{className:"px-3 py-2 space-y-0.5",children:[h.jsx("p",{className:"text-xs font-semibold text-foreground",children:t}),(s||i||o)&&h.jsx("p",{className:"text-[10px] text-foreground-subtle",children:[i,s,o?`${o}fps`:null].filter(Boolean).join(" · ")}),d&&h.jsxs("p",{className:"text-[10px] text-foreground-subtle",children:[f("integrations.lastSnapshot")," ",d]}),n==="offline"&&h.jsx("p",{className:"text-[10px] text-danger",children:f("integrations.offline")})]})]})]})}function qA({id:t,name:e,status:n,snapshotUrl:s,resolution:i,codec:o,fps:d,lastSnapshot:f}){const p=xl();return h.jsxs("div",{onClick:()=>p(`/devices/${t}`),className:"flex items-center gap-2 rounded-lg border border-border bg-surface px-3 py-2.5 cursor-pointer hover:border-foreground-subtle/30 transition-colors",children:[h.jsx(Lc,{className:"h-3.5 w-3.5 text-foreground-subtle flex-shrink-0"}),h.jsx("span",{className:"text-[11px] font-semibold text-foreground flex-1 truncate",children:e}),h.jsx(UA,{deviceName:e,snapshotUrl:s,status:n,resolution:i,codec:o,fps:d,lastSnapshot:f}),h.jsx("span",{className:`h-1.5 w-1.5 rounded-full flex-shrink-0 ${n==="online"?"bg-success":"bg-danger"}`,title:n==="online"?"Online":"Offline"})]})}function HA({name:t,externalId:e,onImport:n,importing:s}){const{t:i}=Er();return h.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-dashed border-border bg-surface px-3 py-2.5 opacity-70",children:[h.jsx(Lc,{className:"h-3.5 w-3.5 text-foreground-subtle flex-shrink-0"}),h.jsx("span",{className:"text-[11px] font-medium text-foreground flex-1 truncate",children:t}),h.jsx("button",{onClick:()=>n(e),disabled:s,className:"flex-shrink-0 rounded bg-primary/15 border border-primary/25 px-2 py-0.5 text-[9px] font-semibold text-primary hover:bg-primary/25 transition-colors disabled:opacity-50",children:s?"...":i("integrations.import")})]})}function BA({activeDevices:t,discoveredDevices:e,onImport:n,importingIds:s}){const{t:i}=Er(),o=e&&e.length>0;return h.jsxs("div",{className:"space-y-4",children:[t.length>0&&h.jsxs("div",{children:[h.jsxs("p",{className:"text-[10px] font-semibold text-foreground-subtle uppercase tracking-wider mb-2",children:[i("integrations.active")," (",t.length,")"]}),h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-2",children:t.map(d=>h.jsx(qA,{id:d.id,name:d.name,status:d.status,snapshotUrl:d.snapshotUrl},d.id))})]}),t.length===0&&!o&&h.jsxs("div",{className:"flex flex-col items-center py-16 text-foreground-subtle",children:[h.jsx("p",{className:"text-sm",children:i("integrations.noDevices")}),h.jsx("p",{className:"text-xs mt-1",children:i("integrations.addFirstDevice")})]}),o&&h.jsxs("div",{children:[h.jsxs("p",{className:"text-[10px] font-semibold text-foreground-subtle uppercase tracking-wider mb-2",children:[i("integrations.available")," (",e.length,")"]}),h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-2",children:e.map(d=>h.jsx(HA,{name:d.name,externalId:d.externalId,onImport:n??(()=>{}),importing:s==null?void 0:s.has(d.externalId)},d.externalId))})]})]})}function GA({open:t,providerId:e,onClose:n}){const{t:s}=Er(),i=en(),o=ga(),[d,f]=D.useState(""),[p,y]=D.useState(""),[S,b]=D.useState([""]),[_,j]=D.useState({}),w=jn({mutationFn:k=>i.createDevice(e,k),onSuccess:()=>{o.invalidateQueries({queryKey:["devices"]})}}),T=jn({mutationFn:async()=>{const k={};for(let G=0;G<S.length;G++){const P=S[G];if(P.trim())try{await i.trpc.providerConfig.testConnection.mutate({type:"rtsp",url:P}),k[G]={codec:"OK",resolution:"Connected"}}catch(L){k[G]={error:String(L)}}}j(k)}});function O(){b(k=>[...k,""])}function R(k){b(G=>G.filter((P,L)=>L!==k))}function M(k,G){b(P=>P.map((L,U)=>U===k?G:L))}async function z(k){const G={name:d,snapshotUrl:p||void 0,streams:S.filter(P=>P.trim())};await w.mutateAsync(G),k?(f(""),y(""),b([""])):n()}return t?h.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[h.jsx("div",{className:"absolute inset-0 bg-black/60",onClick:n}),h.jsxs("div",{className:"relative z-10 w-full max-w-md rounded-xl border border-border bg-background shadow-2xl",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-border px-5 py-4",children:[h.jsx("h2",{className:"text-sm font-semibold text-foreground",children:s("integrations.addDevice")}),h.jsx("button",{onClick:n,className:"rounded-md p-1 text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",children:h.jsx(Oi,{className:"h-4 w-4"})})]}),h.jsxs("div",{className:"px-5 py-4 space-y-3",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-[11px] font-medium text-foreground mb-1",children:s("integrations.name")}),h.jsx("input",{type:"text",value:d,onChange:k=>f(k.target.value),placeholder:s("integrations.namePlaceholder"),className:"w-full rounded-lg border border-border bg-surface px-3 py-2 text-xs text-foreground placeholder:text-foreground-subtle focus:outline-none focus:border-primary/50"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-[11px] font-medium text-foreground mb-1",children:s("integrations.snapshotUrlOptional")}),h.jsx("input",{type:"text",value:p,onChange:k=>y(k.target.value),placeholder:"http://192.168.1.100/snapshot.jpg",className:"w-full rounded-lg border border-border bg-surface px-3 py-2 text-xs text-foreground placeholder:text-foreground-subtle focus:outline-none focus:border-primary/50"})]}),h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center justify-between mb-1",children:[h.jsx("label",{className:"text-[11px] font-medium text-foreground",children:s("integrations.streamUrls")}),h.jsxs("button",{onClick:O,className:"flex items-center gap-1 text-[10px] text-primary hover:text-primary/80 transition-colors",children:[h.jsx(po,{className:"h-3 w-3"})," ",s("integrations.addStream")]})]}),h.jsx("div",{className:"space-y-2",children:S.map((k,G)=>h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("input",{type:"text",value:k,onChange:P=>M(G,P.target.value),placeholder:"rtsp://192.168.1.100:554/stream1",className:"flex-1 rounded-lg border border-border bg-surface px-3 py-2 text-xs text-foreground placeholder:text-foreground-subtle focus:outline-none focus:border-primary/50"}),S.length>1&&h.jsx("button",{onClick:()=>R(G),className:"rounded-md p-1.5 text-foreground-subtle hover:text-danger hover:bg-danger/10 transition-colors",children:h.jsx(dh,{className:"h-3.5 w-3.5"})})]},G))})]}),Object.keys(_).length>0&&h.jsx("div",{className:"space-y-1",children:Object.entries(_).map(([k,G])=>h.jsx("div",{className:`rounded-lg border px-3 py-1.5 text-[10px] ${G.error?"border-danger/30 bg-danger/5 text-danger":"border-success/30 bg-success/5 text-success"}`,children:G.error?`${s("integrations.stream",{number:Number(k)+1})} ${G.error}`:`${s("integrations.stream",{number:Number(k)+1})} ${G.codec} · ${G.resolution}`},k))})]}),h.jsxs("div",{className:"flex items-center justify-between border-t border-border px-5 py-3",children:[h.jsx("button",{onClick:n,className:"rounded-lg border border-border px-3 py-1.5 text-xs text-foreground-subtle hover:text-foreground transition-colors",children:s("integrations.cancel")}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("button",{onClick:()=>T.mutate(),disabled:S.every(k=>!k.trim())||T.isPending,className:"rounded-lg border border-border px-3 py-1.5 text-xs text-foreground hover:bg-surface-hover transition-colors disabled:opacity-50",children:T.isPending?s("integrations.testing"):s("integrations.test")}),h.jsx("button",{onClick:()=>z(!1),disabled:!d.trim()||S.every(k=>!k.trim())||w.isPending,className:"rounded-l-lg bg-primary px-4 py-1.5 text-xs font-medium text-primary-foreground shadow-sm disabled:opacity-50",children:w.isPending?s("integrations.saving"):s("integrations.save")}),h.jsxs("div",{className:"relative group",children:[h.jsx("button",{disabled:!d.trim()||S.every(k=>!k.trim()),className:"rounded-r-lg border-l border-primary-foreground/20 bg-primary px-2 py-1.5 text-primary-foreground disabled:opacity-50",children:h.jsx(Mc,{className:"h-3 w-3"})}),h.jsx("div",{className:"absolute right-0 bottom-full mb-1 hidden group-hover:block",children:h.jsx("button",{onClick:()=>z(!0),disabled:!d.trim()||S.every(k=>!k.trim()),className:"whitespace-nowrap rounded-lg border border-border bg-surface px-3 py-1.5 text-xs text-foreground shadow-lg hover:bg-surface-hover disabled:opacity-50",children:s("integrations.saveAndNew")})})]})]})]})]})]}):null}function PA(){const{t}=Er(),{integrationId:e}=tv(),n=en(),s=ga(),[i,o]=D.useState(!1),[d,f]=D.useState(!1),{data:p,isLoading:y}=dt({queryKey:["provider",e],queryFn:()=>n.getProvider(e),enabled:!!e}),{data:S}=dt({queryKey:["devices"],queryFn:()=>n.listDevices(),refetchInterval:5e3}),{data:b,refetch:_}=dt({queryKey:["discover-devices",e],queryFn:()=>n.discoverDevices(e),enabled:!!e&&(p==null?void 0:p.discoveryMode)!=="manual"}),j=jn({mutationFn:()=>n.startProvider(e),onSuccess:()=>s.invalidateQueries({queryKey:["provider",e]})}),w=jn({mutationFn:()=>n.stopProvider(e),onSuccess:()=>s.invalidateQueries({queryKey:["provider",e]})}),T=jn({mutationFn:V=>n.adoptDevice(e,V),onSuccess:()=>{s.invalidateQueries({queryKey:["devices"]}),s.invalidateQueries({queryKey:["discover-devices",e]})}}),[O,R]=D.useState(new Set);async function M(V){R(Z=>new Set([...Z,V]));try{await T.mutateAsync(V)}finally{R(Z=>{const re=new Set(Z);return re.delete(V),re})}}if(y)return h.jsxs("div",{className:"p-6",children:[h.jsx("div",{className:"h-16 rounded-lg bg-surface animate-pulse mb-4"}),h.jsx("div",{className:"h-40 rounded-lg bg-surface animate-pulse"})]});if(!p)return h.jsx("div",{className:"flex items-center justify-center py-20 text-foreground-subtle text-sm",children:t("integrations.integrationNotFound")});const k=(S??[]).filter(V=>V.providerId===e).map(V=>{var Z;return{id:V.id,name:V.name??V.id,status:(Z=V.state)!=null&&Z.online?"online":"offline",snapshotUrl:null}}),G=(b??[]).map(V=>({externalId:V.externalId,name:V.name??V.externalId})),P=p.status.connected?"running":"stopped",L=p.discoveryMode!=="manual",U=p.discoveryMode==="manual";return h.jsxs("div",{className:"p-6 space-y-5",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("img",{src:n.getAddonAssetUrl(p.type,"assets/icon.svg"),alt:"",className:"h-8 w-8 rounded-lg",onError:V=>{V.target.style.display="none"}}),h.jsxs("div",{children:[h.jsx("h1",{className:"text-lg font-semibold text-foreground",children:p.name}),h.jsxs("p",{className:"text-[11px] text-foreground-subtle mt-0.5",children:[p.type," · ",k.length," ",t("integrations.devices")]})]}),h.jsx(nh,{status:P})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[L&&h.jsxs("button",{onClick:()=>_(),className:"flex items-center gap-1.5 rounded-lg border border-border bg-surface px-3 py-1.5 text-[11px] text-foreground hover:bg-surface-hover transition-colors",children:[h.jsx(eh,{className:"h-3 w-3"}),t("integrations.rediscover")]}),h.jsxs("button",{onClick:()=>f(!0),className:"flex items-center gap-1.5 rounded-lg border border-border bg-surface px-3 py-1.5 text-[11px] text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",children:[h.jsx(Wm,{className:"h-3 w-3"}),t("integrations.config")]}),P==="running"?h.jsx("button",{onClick:()=>w.mutate(),className:"rounded-lg border border-border bg-surface p-1.5 text-foreground-subtle hover:text-danger hover:bg-danger/10 transition-colors",title:"Stop",children:h.jsx(gv,{className:"h-3.5 w-3.5"})}):h.jsx("button",{onClick:()=>j.mutate(),className:"rounded-lg border border-border bg-surface p-1.5 text-foreground-subtle hover:text-success hover:bg-success/10 transition-colors",title:"Start",children:h.jsx(F1,{className:"h-3.5 w-3.5"})})]})]}),h.jsx(BA,{activeDevices:k,discoveredDevices:L?G:void 0,onImport:M,importingIds:O}),h.jsx("button",{onClick:()=>{U?o(!0):_()},className:"fixed bottom-6 right-6 flex h-12 w-12 items-center justify-center rounded-full bg-primary shadow-lg shadow-primary/30 hover:shadow-primary/40 transition-shadow",title:t(U?"integrations.addDevice":"integrations.rediscover"),children:U?h.jsx(po,{className:"h-5 w-5 text-primary-foreground"}):h.jsx(eh,{className:"h-5 w-5 text-primary-foreground"})}),i&&e&&h.jsx(GA,{open:i,providerId:e,onClose:()=>o(!1)}),d&&h.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:()=>f(!1),children:h.jsxs("div",{className:"rounded-xl border border-border bg-surface p-6 shadow-xl w-80",onClick:V=>V.stopPropagation(),children:[h.jsx("h2",{className:"text-sm font-semibold text-foreground mb-2",children:t("integrations.providerConfig")}),h.jsx("p",{className:"text-[11px] text-foreground-subtle",children:t("integrations.configComingSoon")}),h.jsx("button",{onClick:()=>f(!1),className:"mt-4 w-full rounded-lg bg-primary px-3 py-1.5 text-[11px] text-primary-foreground hover:bg-primary/90 transition-colors",children:"Close"})]})})]})}function YA({label:t,color:e,title:n,style:s}){return h.jsxs("div",{className:"absolute top-1/2 -translate-y-1/2 -translate-x-1/2 z-10 group cursor-pointer",style:s,title:n,children:[h.jsx("div",{className:"h-2.5 w-2.5 rounded-full border-2 border-background shadow-sm transition-transform group-hover:scale-150",style:{backgroundColor:e}}),n&&h.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1.5 hidden group-hover:block z-20 pointer-events-none",children:h.jsxs("div",{className:"bg-surface border border-border rounded px-2 py-1 text-[10px] text-foreground whitespace-nowrap shadow-lg",children:[h.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full mr-1 align-middle",style:{backgroundColor:e}}),t]})})]})}const Sx=36e5;function VA(t){return String(t).padStart(2,"0")}function QA(t){const e=new Date(t);return`${VA(e.getHours())}:00`}function KA({startMs:t,endMs:e,segments:n,events:s,playheadMs:i,onSeek:o}){const d=D.useRef(null),f=e-t,p=D.useCallback(j=>Math.max(0,Math.min(100,(j-t)/f*100)),[t,f]);function y(j){if(!d.current)return;const w=d.current.getBoundingClientRect(),T=Math.max(0,Math.min(1,(j.clientX-w.left)/w.width));o(Math.round(t+T*f))}const S=[],b=Math.floor(t/Sx),_=Math.ceil(e/Sx);for(let j=b;j<=_;j++){const w=j*Sx;w<t||w>e||S.push({percent:p(w),label:QA(w)})}return h.jsxs("div",{className:"select-none",children:[h.jsx("div",{className:"relative h-5 mb-1",children:S.map(({percent:j,label:w})=>h.jsx("span",{className:"absolute -translate-x-1/2 text-[10px] text-foreground-subtle",style:{left:`${j}%`},children:w},w))}),h.jsxs("div",{ref:d,className:"relative h-8 rounded bg-surface-hover cursor-pointer overflow-hidden border border-border",onClick:y,onPointerMove:j=>{j.buttons===1&&y(j)},children:[n.map((j,w)=>{const T=p(j.startMs),O=p(j.endMs)-T;return h.jsx("div",{className:"absolute top-1 bottom-1 rounded-sm bg-success/60",style:{left:`${T}%`,width:`${Math.max(O,.1)}%`}},w)}),s.map(j=>h.jsx(YA,{label:j.label,color:j.color,title:`${j.label} — ${new Date(j.timestampMs).toLocaleTimeString()}`,style:{left:`${p(j.timestampMs)}%`}},j.id)),h.jsx("div",{className:"absolute top-0 bottom-0 w-0.5 bg-danger z-20 pointer-events-none",style:{left:`${p(i)}%`},children:h.jsx("div",{className:"absolute -top-0.5 left-1/2 -translate-x-1/2 w-2.5 h-2.5 bg-danger rotate-45"})})]})]})}const y5={person:"#f59e0b",vehicle:"#3b82f6",car:"#3b82f6",face:"#a855f7",plate:"#ec4899",animal:"#10b981",motion:"#ef4444",unknown:"#6b7280"};function Tb(t){return y5[t.toLowerCase()]??y5.unknown}function XA(t){const e=new Date(t);return e.setHours(0,0,0,0),e.getTime()}function FA(t){return new Date(t).toISOString().slice(0,10)}function ZA(t){return new Date(t+"T00:00:00").getTime()}function IA(t){return[{startMs:t+0*36e5,endMs:t+4*36e5},{startMs:t+6*36e5,endMs:t+10*36e5},{startMs:t+12*36e5,endMs:t+16*36e5},{startMs:t+18*36e5,endMs:t+23*36e5}]}function JA(t){const e=["person","vehicle","face","motion"];return Array.from({length:24},(n,s)=>({id:`placeholder-${s}`,timestampMs:t+Math.floor(Math.random()*24*36e5),label:e[s%e.length],color:Tb(e[s%e.length])})).sort((n,s)=>n.timestampMs-s.timestampMs)}function WA(){var k,G;const{t}=Er(),e=en(),n=XA(new Date),[s,i]=D.useState(n),[o,d]=D.useState(null),[f,p]=D.useState(n+12*36e5),y=s,S=s+24*36e5,{data:b,isLoading:_}=dt({queryKey:["devices"],queryFn:()=>e.listDevices(),staleTime:3e4}),j=b??[],w=D.useMemo(()=>j.filter(L=>{const U=String(L.type??"").toLowerCase(),V=L.capabilities??[];return U==="camera"||U.includes("camera")||V.some(Z=>Z.toLowerCase().includes("video")||Z.toLowerCase().includes("stream"))}).map(L=>({id:String(L.id),name:String(L.name??L.id)})),[j]),T=o??((k=w[0])==null?void 0:k.id)??null,{data:O}=dt({queryKey:["events",T,y],queryFn:()=>T?e.getEvents(T,{limit:200}):Promise.resolve(null),enabled:!!T,staleTime:6e4}),R=D.useMemo(()=>{const P=O,U=Array.isArray(P)?P:P!=null&&typeof P=="object"&&Array.isArray(P.events)?P.events:[];return U.length===0?T?JA(y):[]:U.map((V,Z)=>{const re=String(V.class??V.type??V.label??"unknown").toLowerCase(),ne=typeof V.timestamp=="number"?V.timestamp:y;return{id:String(V.id??Z),timestampMs:ne,label:re,color:Tb(re)}})},[O,T,y]),M=D.useMemo(()=>T?IA(y):[],[T,y]);function z(P){i(L=>L+P*24*36e5),p(L=>L+P*24*36e5)}return h.jsxs("div",{className:"flex flex-col h-full p-6 gap-5 overflow-hidden",children:[h.jsxs("div",{className:"flex items-center justify-between gap-4 shrink-0",children:[h.jsx("h1",{className:"text-lg font-semibold text-foreground",children:t("nav.timeline","Timeline")}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("button",{onClick:()=>z(-1),className:"p-1 rounded hover:bg-surface-hover text-foreground-subtle hover:text-foreground transition-colors",children:h.jsx($E,{className:"h-4 w-4"})}),h.jsxs("div",{className:"relative flex items-center",children:[h.jsx(VE,{className:"absolute left-2 h-3.5 w-3.5 text-foreground-subtle pointer-events-none"}),h.jsx("input",{type:"date",value:FA(s),onChange:P=>{if(P.target.value){const L=ZA(P.target.value);i(L),p(L+12*36e5)}},className:"rounded-lg border border-border bg-surface pl-7 pr-3 py-1.5 text-xs text-foreground focus:outline-none focus:border-primary/50"})]}),h.jsx("button",{onClick:()=>z(1),className:"p-1 rounded hover:bg-surface-hover text-foreground-subtle hover:text-foreground transition-colors",disabled:s>=n,children:h.jsx(Zu,{className:"h-4 w-4"})})]})]}),h.jsxs("div",{className:"flex gap-1.5 shrink-0 overflow-x-auto pb-1",children:[_&&h.jsx("div",{className:"h-8 w-48 rounded-lg bg-surface animate-pulse"}),!_&&w.length===0&&h.jsx("span",{className:"text-xs text-foreground-subtle",children:"No cameras found"}),w.map(P=>{const L=P.id===T;return h.jsx("button",{onClick:()=>d(P.id),className:`shrink-0 rounded-lg px-3 py-1.5 text-[12px] font-medium transition-all border ${L?"bg-primary/12 text-primary border-primary/30":"bg-surface text-foreground-subtle border-border hover:bg-surface-hover hover:text-foreground"}`,children:P.name},P.id)})]}),h.jsxs("div",{className:"relative w-full aspect-video rounded-xl border border-border bg-black shrink-0 overflow-hidden max-h-[45vh]",children:[h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-3 text-foreground-subtle",children:[h.jsx(D6,{className:"h-12 w-12 opacity-20"}),h.jsx("p",{className:"text-sm opacity-50",children:T?`${((G=w.find(P=>P.id===T))==null?void 0:G.name)??T} — seek to play`:"Select a camera"})]}),h.jsx("div",{className:"absolute top-3 left-3 rounded bg-black/60 px-2 py-1 text-[11px] text-white font-mono",children:new Date(f).toLocaleTimeString()})]}),h.jsxs("div",{className:"rounded-xl border border-border bg-surface px-4 pt-3 pb-4 shrink-0",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-4 mb-3",children:[h.jsx("span",{className:"text-[10px] font-semibold text-foreground-subtle uppercase tracking-wider",children:"Timeline"}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"inline-block h-2 w-4 rounded-sm bg-success/60"}),h.jsx("span",{className:"text-[10px] text-foreground-subtle",children:"Recording"})]}),Array.from(new Set(R.map(P=>P.label))).slice(0,5).map(P=>h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full",style:{backgroundColor:Tb(P)}}),h.jsx("span",{className:"text-[10px] text-foreground-subtle capitalize",children:P})]},P))]}),T?h.jsx(KA,{startMs:y,endMs:S,segments:M,events:R,playheadMs:f,onSeek:p}):h.jsx("div",{className:"h-8 rounded bg-surface-hover flex items-center justify-center text-xs text-foreground-subtle",children:"Select a camera to view timeline"})]})]})}function Nx({label:t,value:e,min:n,max:s,step:i=1,unit:o,hint:d,onChange:f}){return h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center justify-between mb-1",children:[h.jsx("label",{className:"text-[10px] font-medium text-foreground-subtle",children:t}),d&&h.jsx("span",{className:"text-[9px] text-foreground-subtle/50",children:d})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("input",{type:"range",className:"flex-1 h-1 accent-primary cursor-pointer",min:n,max:s,step:i,value:e,onChange:p=>f(Number(p.target.value))}),h.jsxs("span",{className:"text-xs text-foreground tabular-nums min-w-[3rem] text-right",children:[e,o?` ${o}`:""]})]})]})}function $A({motionFps:t,detectionFps:e,cooldownMs:n,maxConcurrentInferences:s,onMotionFpsChange:i,onDetectionFpsChange:o,onCooldownMsChange:d,onMaxConcurrentInferencesChange:f}){const p=s===null;return h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-[10px] font-semibold text-foreground uppercase tracking-wider",children:"Orchestrator"}),h.jsx(Nx,{label:"Motion FPS",value:t,min:1,max:15,onChange:i,unit:"fps",hint:"Frame-diff rate"}),h.jsx(Nx,{label:"Detection FPS",value:e,min:1,max:30,onChange:o,unit:"fps",hint:"Inference rate"}),h.jsx(Nx,{label:"Motion Cooldown",value:n/1e3,min:1,max:60,onChange:y=>d(y*1e3),unit:"s",hint:"No motion → idle"}),h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center justify-between mb-1",children:[h.jsx("label",{className:"text-[10px] font-medium text-foreground-subtle",children:"Max Parallel"}),h.jsx("button",{type:"button",onClick:()=>f(p?2:null),className:`text-[9px] font-medium px-1.5 py-0.5 rounded transition-colors ${p?"bg-primary/15 text-primary":"bg-surface text-foreground-subtle hover:text-foreground"}`,children:p?"Auto":"Manual"})]}),p?h.jsx("p",{className:"text-[10px] text-foreground-subtle/60",children:"Auto-detected from hardware (CPU cores, GPU)"}):h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("input",{type:"range",className:"flex-1 h-1 accent-primary cursor-pointer",min:1,max:8,value:s,onChange:y=>f(Number(y.target.value))}),h.jsx("span",{className:"text-xs text-foreground tabular-nums min-w-[3rem] text-right",children:s})]})]})]})}const eD={motionFps:2,detectionFps:5,cooldownMs:1e4,maxConcurrentInferences:null};function tD(){const{t}=Er(),e=en(),[n,s]=D.useState(!0),[i,o]=D.useState(null),[d,f]=D.useState(null),[p,y]=D.useState([]),[S,b]=D.useState([]),[_,j]=D.useState(null),[w,T]=D.useState(eD),[O,R]=D.useState(!1),[M,z]=D.useState(!1),[k,G]=D.useState(!0);D.useEffect(()=>{var ie,ce,Y,$,ae,Ne,me,B,I,fe,xe,_e,Ce,ze,Ee;const W=e.trpc;if(!W){s(!1);return}Promise.all([(Y=(ce=(ie=W.pipeline)==null?void 0:ie.getSchema)==null?void 0:ce.query)==null?void 0:Y.call(ce).catch(()=>null),(Ne=(ae=($=W.inference)==null?void 0:$.getCapabilities)==null?void 0:ae.query)==null?void 0:Ne.call(ae).catch(()=>null),(I=(B=(me=W.pipeline)==null?void 0:me.getGlobalSteps)==null?void 0:B.query)==null?void 0:I.call(B).catch(()=>null),(_e=(xe=(fe=W.pipeline)==null?void 0:fe.getOrchestratorSettings)==null?void 0:xe.query)==null?void 0:_e.call(xe).catch(()=>null),(Ee=(ze=(Ce=W.pipeline)==null?void 0:Ce.listTemplates)==null?void 0:ze.query)==null?void 0:Ee.call(ze).catch(()=>[])]).then(([we,Vt,et,Mt,Ht])=>{we&&o(we),Vt&&f(Vt),et&&y(et),Mt&&T(Mt),b(Ht??[]),s(!1)}).catch(()=>s(!1))},[e]);const P=D.useCallback(W=>{y(W),R(!0)},[]),L=D.useCallback(W=>{if(j(W),W&&i){const ie=S.find(ce=>ce.id===W);if(ie!=null&&ie.steps){const ce=new Map(i.slots.flatMap($=>$.addons.map(ae=>[ae.id,ae]))),Y=$=>{const ae=ce.get($.addonId);return{addonId:$.addonId,addonName:(ae==null?void 0:ae.name)??$.addonId,slot:(ae==null?void 0:ae.slot)??"detector",inputClasses:ae?[...ae.inputClasses]:[],outputClasses:ae?[...ae.outputClasses]:[],enabled:$.enabled??!0,agentId:$.agentId??"hub",runtime:$.runtime??"node",backend:$.backend??"cpu",modelId:$.modelId??(ae==null?void 0:ae.defaultModelId)??"",confidence:$.confidence??(ae==null?void 0:ae.defaultConfidence)??.3,classFilters:$.classFilters?[...$.classFilters]:[],children:($.children??[]).map(Y)}};y(ie.steps.map(Y))}}},[i,S]),U=D.useCallback(async(W,ie)=>{try{const Y=await e.trpc.pipeline.saveTemplate.mutate({name:W,steps:ie});b($=>[Y,...$]),j(Y.id)}catch{}},[e]),V=D.useCallback(async(W,ie)=>{try{const Y=await e.trpc.pipeline.updateTemplate.mutate({id:W,steps:ie});b($=>$.map(ae=>ae.id===W?Y:ae))}catch{}},[e]),Z=D.useCallback(async W=>{try{await e.trpc.pipeline.deleteTemplate.mutate({id:W}),b(ce=>ce.filter(Y=>Y.id!==W)),_===W&&j(null)}catch{}},[e,_]);async function re(){z(!0);try{const W=e.trpc;await Promise.all([W.pipeline.setGlobalSteps.mutate({steps:p}),W.pipeline.setOrchestratorSettings.mutate(w)]),R(!1)}catch{}finally{z(!1)}}function ne(W,ie){T(ce=>({...ce,[W]:ie})),R(!0)}return n?h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx("div",{className:"text-sm text-foreground-subtle animate-pulse",children:"Loading pipeline schema…"})}):!i||!d?h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx("div",{className:"text-sm text-foreground-subtle",children:"Pipeline schema not available. Make sure detection addons are loaded."})}):h.jsxs("div",{className:"flex flex-col lg:flex-row h-full overflow-hidden",children:[h.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[h.jsxs("div",{className:"flex items-center justify-between gap-4 px-6 py-4 border-b border-border shrink-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(X1,{className:"h-4 w-4 text-foreground-subtle"}),h.jsx("h1",{className:"text-lg font-semibold text-foreground",children:t("nav.pipeline","Pipeline Config")})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[O&&h.jsx("span",{className:"text-[10px] text-amber-400 font-medium",children:"Unsaved changes"}),h.jsxs("button",{onClick:re,disabled:!O||M,className:`flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium transition-all ${O&&!M?"bg-primary text-white hover:bg-primary/90":"bg-surface text-foreground-subtle border border-border cursor-not-allowed"}`,children:[h.jsx(U6,{className:"h-3.5 w-3.5"}),M?"Saving…":"Save Pipeline"]})]})]}),h.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-auto p-6",children:h.jsx(uj,{schema:i,capabilities:d,steps:p,onChange:P,templates:S,selectedTemplateId:_,onSelectTemplate:L,onSaveTemplate:U,onUpdateTemplate:V,onDeleteTemplate:Z})})]}),h.jsxs("aside",{className:"w-full lg:w-72 shrink-0 border-t lg:border-t-0 lg:border-l border-border flex flex-col overflow-hidden bg-surface/40",children:[h.jsxs("button",{onClick:()=>G(!k),className:"flex items-center justify-between gap-2 px-4 py-3 border-b border-border text-xs font-semibold text-foreground uppercase tracking-wider hover:bg-surface-hover transition-colors",children:[h.jsx("span",{children:"Settings"}),h.jsx(Mc,{className:`h-3.5 w-3.5 text-foreground-subtle transition-transform ${k?"":"-rotate-90"}`})]}),k&&h.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:h.jsx($A,{motionFps:w.motionFps,detectionFps:w.detectionFps,cooldownMs:w.cooldownMs,maxConcurrentInferences:w.maxConcurrentInferences,onMotionFpsChange:W=>ne("motionFps",W),onDetectionFpsChange:W=>ne("detectionFps",W),onCooldownMsChange:W=>ne("cooldownMs",W),onMaxConcurrentInferencesChange:W=>ne("maxConcurrentInferences",W)})})]})]})}const nD=["WebRTC","HLS","MJPEG","go2rtc"],aD=["BBox","Segm","Zones","Trail"];function sD({deviceName:t,detectionsToday:e,inferenceMs:n,activeTracks:s,storageGb:i}){const[o,d]=D.useState("WebRTC"),[f,p]=D.useState(new Set);function y(S){p(b=>{const _=new Set(b);return _.has(S)?_.delete(S):_.add(S),_})}return h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"relative w-full max-w-[320px] aspect-video bg-background rounded-lg border border-border flex items-center justify-center overflow-hidden",children:[h.jsx(Lc,{className:"h-10 w-10 text-foreground-subtle/20"}),h.jsx("div",{className:"absolute bottom-2 left-2 text-[10px] text-foreground-subtle bg-background/80 rounded px-1.5 py-0.5",children:t})]}),h.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[h.jsx("span",{className:"text-[10px] text-foreground-subtle mr-1 self-center",children:"Source:"}),nD.map(S=>h.jsx("button",{onClick:()=>d(S),className:`rounded-full px-2.5 py-1 text-[10px] font-medium transition-colors ${o===S?"bg-primary/15 text-primary border border-primary/30":"bg-surface border border-border text-foreground-subtle hover:text-foreground"}`,children:S},S))]}),h.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[h.jsx("span",{className:"text-[10px] text-foreground-subtle mr-1 self-center",children:"Overlay:"}),aD.map(S=>{const b=f.has(S);return h.jsx("button",{onClick:()=>y(S),className:`rounded-full px-2.5 py-1 text-[10px] font-medium transition-colors ${b?"bg-info/15 text-info border border-info/30":"bg-surface border border-border text-foreground-subtle hover:text-foreground"}`,children:S},S)})]}),h.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[h.jsx(e1,{icon:uh,label:"Today",value:String(e)}),h.jsx(e1,{icon:dv,label:"Inference",value:`${n}ms`}),h.jsx(e1,{icon:fT,label:"Tracks",value:String(s)}),h.jsx(e1,{icon:ym,label:"Storage",value:`${i.toFixed(1)}GB`})]})]})}function e1({icon:t,label:e,value:n}){return h.jsxs("div",{className:"flex flex-col items-center gap-1 rounded-lg border border-border bg-surface px-2 py-2",children:[h.jsx(t,{className:"h-3.5 w-3.5 text-foreground-subtle"}),h.jsx("span",{className:"text-xs font-semibold text-foreground",children:n}),h.jsx("span",{className:"text-[9px] text-foreground-subtle",children:e})]})}const _x={DETECT:{bg:"bg-success/15",text:"text-success"},PHASE:{bg:"bg-info/15",text:"text-info"},MOTION:{bg:"bg-warning/15",text:"text-warning"},REC:{bg:"bg-danger/15",text:"text-danger"},STATE:{bg:"bg-primary/15",text:"text-primary"},AUDIO:{bg:"bg-purple-500/15",text:"text-purple-400"}};function rD({deviceId:t}){const[e]=D.useState([]);return h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3 py-2",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("span",{className:"relative flex h-2 w-2",children:[h.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-success opacity-75"}),h.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-success"})]}),h.jsx("h3",{className:"text-[11px] font-semibold text-foreground uppercase tracking-wider",children:"Live Events"})]}),h.jsx("button",{title:"Float panel",className:"p-1 rounded hover:bg-surface-hover text-foreground-subtle hover:text-foreground transition-colors",children:h.jsx(_1,{className:"h-3.5 w-3.5"})})]}),h.jsx("div",{className:"flex flex-wrap gap-1.5 px-3 py-2 border-b border-border",children:Object.entries(_x).map(([n,s])=>h.jsx("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[9px] font-medium ${s.bg} ${s.text}`,children:n},n))}),h.jsx("div",{className:"flex-1 overflow-y-auto",children:e.length===0?h.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-foreground-subtle",children:[h.jsx(fv,{className:"h-6 w-6 mb-2 opacity-30"}),h.jsx("p",{className:"text-[11px]",children:"Waiting for events..."}),h.jsx("p",{className:"text-[10px] mt-0.5 opacity-70",children:"Events will stream in real-time"})]}):h.jsx("div",{className:"divide-y divide-border",children:e.map(n=>{const s=_x[n.type]??_x.DETECT;return h.jsxs("div",{className:"px-3 py-2 hover:bg-surface-hover transition-colors",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[9px] font-medium ${s.bg} ${s.text}`,children:n.type}),h.jsx("span",{className:"text-[10px] text-foreground-subtle ml-auto",children:n.timestamp})]}),h.jsx("p",{className:"text-[11px] text-foreground mt-1",children:n.message})]},n.id)})})})]})}const x5={person:{color:"text-success",borderColor:"border-l-success",icon:ER},vehicle:{color:"text-info",borderColor:"border-l-info",icon:XE},animal:{color:"text-warning",borderColor:"border-l-warning",icon:pT},audio:{color:"text-danger",borderColor:"border-l-danger",icon:k6},other:{color:"text-foreground-subtle",borderColor:"border-l-foreground-subtle",icon:fv}};function iD(t){const e=String(t.label??t.type??"").toLowerCase();return e.includes("person")||e.includes("face")?"person":e.includes("vehicle")||e.includes("car")||e.includes("truck")?"vehicle":e.includes("animal")||e.includes("dog")||e.includes("cat")?"animal":e.includes("audio")||e.includes("sound")?"audio":"other"}function lD({deviceId:t}){const e=en(),{data:n,isLoading:s}=dt({queryKey:["events",t],queryFn:()=>e.getEvents(t,{limit:50}),enabled:!!t,refetchInterval:5e3}),i=n??[];return s?h.jsx("div",{className:"space-y-2",children:[1,2,3,4].map(o=>h.jsx("div",{className:"h-16 rounded-lg border border-border bg-surface animate-pulse"},o))}):h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:"Detection Events"}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle",children:[i.length," event",i.length!==1?"s":""]})]}),h.jsx("div",{className:"flex flex-wrap gap-3",children:Object.entries(x5).map(([o,d])=>{const f=d.icon;return h.jsxs("span",{className:`inline-flex items-center gap-1 text-[10px] ${d.color}`,children:[h.jsx(f,{className:"h-3 w-3"}),o]},o)})}),i.length===0?h.jsx("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:h.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-foreground-subtle",children:[h.jsx(fv,{className:"h-8 w-8 mb-3 opacity-30"}),h.jsx("p",{className:"text-sm",children:"No events yet"}),h.jsx("p",{className:"text-xs mt-1 opacity-70",children:"Detection events will appear here as they occur"})]})}):h.jsx("div",{className:"space-y-1.5",children:i.map((o,d)=>{const f=iD(o),p=x5[f],y=p.icon,S=String(o.label??o.type??"Unknown"),b=o.score!=null?Number(o.score):null,_=o.zone?String(o.zone):null,j=o.trackId?String(o.trackId):null,w=o.timestamp?new Date(o.timestamp).toLocaleTimeString("en-GB",{hour12:!1}):"";return h.jsxs("div",{className:`flex items-start gap-3 rounded-lg border border-border border-l-4 ${p.borderColor} bg-surface px-3 py-2.5 hover:bg-surface-hover transition-colors`,children:[h.jsx("div",{className:"h-10 w-10 rounded bg-background flex items-center justify-center flex-shrink-0",children:h.jsx(y,{className:`h-4 w-4 ${p.color}`})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-xs font-medium text-foreground capitalize",children:S}),b!=null&&h.jsxs("span",{className:"text-[9px] bg-surface-hover rounded px-1.5 py-0.5 text-foreground-subtle",children:[(b*100).toFixed(0),"%"]})]}),h.jsxs("div",{className:"flex items-center gap-2 mt-0.5 text-[10px] text-foreground-subtle",children:[j&&h.jsxs("span",{children:["Track: ",j]}),_&&h.jsxs("span",{children:["Zone: ",_]})]})]}),h.jsx("span",{className:"text-[10px] text-foreground-subtle flex-shrink-0",children:w})]},o.id?String(o.id):d)})})]})}function oD({deviceId:t}){const e=en(),[n,s]=D.useState(new Set),{data:i,isLoading:o}=dt({queryKey:["pipeline",t],queryFn:()=>e.bridgeGetPipeline(t),enabled:!!t}),d=i,f=(d==null?void 0:d.video)??[];function p(y){s(S=>{const b=new Set(S);return b.has(y)?b.delete(y):b.add(y),b})}return o?h.jsx("div",{className:"space-y-3",children:[1,2,3].map(y=>h.jsx("div",{className:"h-14 rounded-lg border border-border bg-surface animate-pulse"},y))}):f.length?h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center justify-between mb-3",children:[h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:"Pipeline Steps"}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle",children:[f.length," step",f.length!==1?"s":""," — read-only"]})]}),f.map((y,S)=>{const b=n.has(y.id??String(S)),_=y.id??String(S);return h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsxs("button",{onClick:()=>p(_),className:"w-full flex items-center gap-3 px-4 py-3 text-left hover:bg-surface-hover transition-colors",children:[b?h.jsx(Mc,{className:"h-3.5 w-3.5 text-foreground-subtle flex-shrink-0"}):h.jsx(Zu,{className:"h-3.5 w-3.5 text-foreground-subtle flex-shrink-0"}),h.jsx("span",{className:"text-[10px] text-foreground-subtle w-5",children:S+1}),h.jsx("span",{className:"text-xs font-medium text-foreground flex-1 truncate",children:y.name||y.type||`Step ${S+1}`}),h.jsx("span",{className:"text-[10px] text-foreground-subtle bg-surface-hover rounded px-1.5 py-0.5",children:y.type||"unknown"}),h.jsx("div",{className:`h-2 w-2 rounded-full flex-shrink-0 ${y.enabled!==!1?"bg-success":"bg-foreground-subtle/30"}`})]}),b&&h.jsx("div",{className:"border-t border-border px-4 py-3 bg-background",children:h.jsx("pre",{className:"text-[11px] font-mono text-foreground-subtle whitespace-pre-wrap break-all",children:JSON.stringify(y.config??y,null,2)})})]},_)})]}):h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsx("div",{className:"border-b border-border px-4 py-2.5",children:h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:"Pipeline Config"})}),h.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-foreground-subtle",children:[h.jsx(X1,{className:"h-8 w-8 mb-3 opacity-30"}),h.jsx("p",{className:"text-sm",children:"No pipeline configured"}),h.jsx("p",{className:"text-xs mt-1 opacity-70",children:"Pipeline steps will appear here once configured"})]})]})}function cD(){return h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsx("div",{className:"border-b border-border px-4 py-2.5",children:h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:"Recording Status"})}),h.jsxs("div",{className:"px-4 py-4 flex items-center gap-3",children:[h.jsx("div",{className:"flex items-center justify-center rounded-full p-2 bg-foreground-subtle/10",children:h.jsx(O6,{className:"h-5 w-5 text-foreground-subtle"})}),h.jsxs("div",{children:[h.jsx("p",{className:"text-sm font-medium text-foreground-subtle",children:"Not Recording"}),h.jsx("p",{className:"text-[11px] text-foreground-subtle mt-0.5",children:"No active recording session"})]})]})]}),h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsx("div",{className:"border-b border-border px-4 py-2.5",children:h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:"Recorded Segments"})}),h.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-foreground-subtle",children:[h.jsx(D6,{className:"h-8 w-8 mb-3 opacity-30"}),h.jsx("p",{className:"text-sm",children:"No recorded segments"}),h.jsx("p",{className:"text-xs mt-1 opacity-70",children:"Recorded clips will appear here"})]})]})]})}const uD=Math.PI/180;function dD(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const qu=typeof global<"u"?global:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},ke={_global:qu,version:"10.2.3",isBrowser:dD(),isUnminified:/param/.test((function(t){}).toString()),dblClickWindow:400,getAngle(t){return ke.angleDeg?t*uD:t},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,_renderBackend:"web",legacyTextRendering:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return ke.DD.isDragging},isTransforming(){var t,e;return(e=(t=ke.Transformer)===null||t===void 0?void 0:t.isTransforming())!==null&&e!==void 0?e:!1},isDragReady(){return!!ke.DD.node},releaseCanvasOnDestroy:!0,document:qu.document,_injectGlobal(t){typeof qu.Konva<"u"&&console.error("Several Konva instances detected. It is not recommended to use multiple Konva instances in the same environment."),qu.Konva=t}},ea=t=>{ke[t.prototype.getClassName()]=t};ke._injectGlobal(ke);const fD=`Konva.js unsupported environment.
|
|
556
|
-
|
|
557
|
-
Looks like you are trying to use Konva.js in Node.js environment. because "document" object is undefined.
|
|
558
|
-
|
|
559
|
-
To use Konva.js in Node.js environment, you need to use the "canvas-backend" or "skia-backend" module.
|
|
560
|
-
|
|
561
|
-
bash: npm install canvas
|
|
562
|
-
js: import "konva/canvas-backend";
|
|
563
|
-
|
|
564
|
-
or
|
|
565
|
-
|
|
566
|
-
bash: npm install skia-canvas
|
|
567
|
-
js: import "konva/skia-backend";
|
|
568
|
-
`,b5=()=>{if(typeof document>"u")throw new Error(fD)};class Cr{constructor(e=[1,0,0,1,0,0]){this.dirty=!1,this.m=e&&e.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new Cr(this.m)}copyInto(e){e.m[0]=this.m[0],e.m[1]=this.m[1],e.m[2]=this.m[2],e.m[3]=this.m[3],e.m[4]=this.m[4],e.m[5]=this.m[5]}point(e){const n=this.m;return{x:n[0]*e.x+n[2]*e.y+n[4],y:n[1]*e.x+n[3]*e.y+n[5]}}translate(e,n){return this.m[4]+=this.m[0]*e+this.m[2]*n,this.m[5]+=this.m[1]*e+this.m[3]*n,this}scale(e,n){return this.m[0]*=e,this.m[1]*=e,this.m[2]*=n,this.m[3]*=n,this}rotate(e){const n=Math.cos(e),s=Math.sin(e),i=this.m[0]*n+this.m[2]*s,o=this.m[1]*n+this.m[3]*s,d=this.m[0]*-s+this.m[2]*n,f=this.m[1]*-s+this.m[3]*n;return this.m[0]=i,this.m[1]=o,this.m[2]=d,this.m[3]=f,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(e,n){const s=this.m[0]+this.m[2]*n,i=this.m[1]+this.m[3]*n,o=this.m[2]+this.m[0]*e,d=this.m[3]+this.m[1]*e;return this.m[0]=s,this.m[1]=i,this.m[2]=o,this.m[3]=d,this}multiply(e){const n=this.m[0]*e.m[0]+this.m[2]*e.m[1],s=this.m[1]*e.m[0]+this.m[3]*e.m[1],i=this.m[0]*e.m[2]+this.m[2]*e.m[3],o=this.m[1]*e.m[2]+this.m[3]*e.m[3],d=this.m[0]*e.m[4]+this.m[2]*e.m[5]+this.m[4],f=this.m[1]*e.m[4]+this.m[3]*e.m[5]+this.m[5];return this.m[0]=n,this.m[1]=s,this.m[2]=i,this.m[3]=o,this.m[4]=d,this.m[5]=f,this}invert(){const e=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),n=this.m[3]*e,s=-this.m[1]*e,i=-this.m[2]*e,o=this.m[0]*e,d=e*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),f=e*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=n,this.m[1]=s,this.m[2]=i,this.m[3]=o,this.m[4]=d,this.m[5]=f,this}getMatrix(){return this.m}decompose(){const e=this.m[0],n=this.m[1],s=this.m[2],i=this.m[3],o=this.m[4],d=this.m[5],f=e*i-n*s,p={x:o,y:d,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(e!=0||n!=0){const y=Math.sqrt(e*e+n*n);p.rotation=n>0?Math.acos(e/y):-Math.acos(e/y),p.scaleX=y,p.scaleY=f/y,p.skewX=(e*s+n*i)/f,p.skewY=0}else if(s!=0||i!=0){const y=Math.sqrt(s*s+i*i);p.rotation=Math.PI/2-(i>0?Math.acos(-s/y):-Math.acos(s/y)),p.scaleX=f/y,p.scaleY=y,p.skewX=0,p.skewY=(e*s+n*i)/f}return p.rotation=ee._getRotation(p.rotation),p}}const hD="[object Array]",pD="[object Number]",mD="[object String]",gD="[object Boolean]",yD=Math.PI/180,xD=180/Math.PI,nm="#",bD="",vD="0",SD="Konva warning: ",v5="Konva error: ",ND="rgb(",Cx={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},_D=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/;let t1=[],am=null;const CD=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(t){setTimeout(t,16)},ee={_isElement(t){return!!(t&&t.nodeType==1)},_isFunction(t){return!!(t&&t.constructor&&t.call&&t.apply)},_isPlainObject(t){return!!t&&t.constructor===Object},_isArray(t){return Object.prototype.toString.call(t)===hD},_isNumber(t){return Object.prototype.toString.call(t)===pD&&!isNaN(t)&&isFinite(t)},_isString(t){return Object.prototype.toString.call(t)===mD},_isBoolean(t){return Object.prototype.toString.call(t)===gD},isObject(t){return t instanceof Object},isValidSelector(t){if(typeof t!="string")return!1;const e=t[0];return e==="#"||e==="."||e===e.toUpperCase()},_sign(t){return t===0||t>0?1:-1},requestAnimFrame(t){t1.push(t),t1.length===1&&CD(function(){const e=t1;t1=[],e.forEach(function(n){n()})})},createCanvasElement(){b5();const t=document.createElement("canvas");try{t.style=t.style||{}}catch{}return t},createImageElement(){return b5(),document.createElement("img")},_isInDocument(t){for(;t=t.parentNode;)if(t==document)return!0;return!1},_urlToImage(t,e){const n=ee.createImageElement();n.onload=function(){e(n)},n.src=t},_rgbToHex(t,e,n){return((1<<24)+(t<<16)+(e<<8)+n).toString(16).slice(1)},_hexToRgb(t){t=t.replace(nm,bD);const e=parseInt(t,16);return{r:e>>16&255,g:e>>8&255,b:e&255}},getRandomColor(){let t=(Math.random()*16777215<<0).toString(16);for(;t.length<6;)t=vD+t;return nm+t},isCanvasFarblingActive(){if(am!==null)return am;if(typeof document>"u")return am=!1,!1;const t=this.createCanvasElement();t.width=10,t.height=10;const e=t.getContext("2d",{willReadFrequently:!0});e.clearRect(0,0,10,10),e.fillStyle="#282828",e.fillRect(0,0,10,10);const n=e.getImageData(0,0,10,10).data;let s=!1;for(let i=0;i<100;i++)if(n[i*4]!==40||n[i*4+1]!==40||n[i*4+2]!==40||n[i*4+3]!==255){s=!0;break}return am=s,this.releaseCanvas(t),am},getHitColor(){const t=this.getRandomColor();return this.isCanvasFarblingActive()?this.getSnappedHexColor(t):t},getHitColorKey(t,e,n){return this.isCanvasFarblingActive()&&(t=Math.round(t/5)*5,e=Math.round(e/5)*5,n=Math.round(n/5)*5),nm+this._rgbToHex(t,e,n)},getSnappedHexColor(t){const e=this._hexToRgb(t);return nm+this._rgbToHex(Math.round(e.r/5)*5,Math.round(e.g/5)*5,Math.round(e.b/5)*5)},getRGB(t){let e;return t in Cx?(e=Cx[t],{r:e[0],g:e[1],b:e[2]}):t[0]===nm?this._hexToRgb(t.substring(1)):t.substr(0,4)===ND?(e=_D.exec(t.replace(/ /g,"")),{r:parseInt(e[1],10),g:parseInt(e[2],10),b:parseInt(e[3],10)}):{r:0,g:0,b:0}},colorToRGBA(t){return t=t||"black",ee._namedColorToRBA(t)||ee._hex3ColorToRGBA(t)||ee._hex4ColorToRGBA(t)||ee._hex6ColorToRGBA(t)||ee._hex8ColorToRGBA(t)||ee._rgbColorToRGBA(t)||ee._rgbaColorToRGBA(t)||ee._hslColorToRGBA(t)},_namedColorToRBA(t){const e=Cx[t.toLowerCase()];return e?{r:e[0],g:e[1],b:e[2],a:1}:null},_rgbColorToRGBA(t){if(t.indexOf("rgb(")===0){t=t.match(/rgb\(([^)]+)\)/)[1];const e=t.split(/ *, */).map(Number);return{r:e[0],g:e[1],b:e[2],a:1}}},_rgbaColorToRGBA(t){if(t.indexOf("rgba(")===0){t=t.match(/rgba\(([^)]+)\)/)[1];const e=t.split(/ *, */).map((n,s)=>n.slice(-1)==="%"?s===3?parseInt(n)/100:parseInt(n)/100*255:Number(n));return{r:e[0],g:e[1],b:e[2],a:e[3]}}},_hex8ColorToRGBA(t){if(t[0]==="#"&&t.length===9)return{r:parseInt(t.slice(1,3),16),g:parseInt(t.slice(3,5),16),b:parseInt(t.slice(5,7),16),a:parseInt(t.slice(7,9),16)/255}},_hex6ColorToRGBA(t){if(t[0]==="#"&&t.length===7)return{r:parseInt(t.slice(1,3),16),g:parseInt(t.slice(3,5),16),b:parseInt(t.slice(5,7),16),a:1}},_hex4ColorToRGBA(t){if(t[0]==="#"&&t.length===5)return{r:parseInt(t[1]+t[1],16),g:parseInt(t[2]+t[2],16),b:parseInt(t[3]+t[3],16),a:parseInt(t[4]+t[4],16)/255}},_hex3ColorToRGBA(t){if(t[0]==="#"&&t.length===4)return{r:parseInt(t[1]+t[1],16),g:parseInt(t[2]+t[2],16),b:parseInt(t[3]+t[3],16),a:1}},_hslColorToRGBA(t){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(t)){const[e,...n]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(t),s=Number(n[0])/360,i=Number(n[1])/100,o=Number(n[2])/100;let d,f,p;if(i===0)return p=o*255,{r:Math.round(p),g:Math.round(p),b:Math.round(p),a:1};o<.5?d=o*(1+i):d=o+i-o*i;const y=2*o-d,S=[0,0,0];for(let b=0;b<3;b++)f=s+1/3*-(b-1),f<0&&f++,f>1&&f--,6*f<1?p=y+(d-y)*6*f:2*f<1?p=d:3*f<2?p=y+(d-y)*(2/3-f)*6:p=y,S[b]=p*255;return{r:Math.round(S[0]),g:Math.round(S[1]),b:Math.round(S[2]),a:1}}},haveIntersection(t,e){return!(e.x>t.x+t.width||e.x+e.width<t.x||e.y>t.y+t.height||e.y+e.height<t.y)},cloneObject(t){const e={};for(const n in t)this._isPlainObject(t[n])?e[n]=this.cloneObject(t[n]):this._isArray(t[n])?e[n]=this.cloneArray(t[n]):e[n]=t[n];return e},cloneArray(t){return t.slice(0)},degToRad(t){return t*yD},radToDeg(t){return t*xD},_degToRad(t){return ee.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),ee.degToRad(t)},_radToDeg(t){return ee.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),ee.radToDeg(t)},_getRotation(t){return ke.angleDeg?ee.radToDeg(t):t},_capitalize(t){return t.charAt(0).toUpperCase()+t.slice(1)},throw(t){throw new Error(v5+t)},error(t){console.error(v5+t)},warn(t){ke.showWarnings&&console.warn(SD+t)},each(t,e){for(const n in t)e(n,t[n])},_inRange(t,e,n){return e<=t&&t<n},_getProjectionToSegment(t,e,n,s,i,o){let d,f,p;const y=(t-n)*(t-n)+(e-s)*(e-s);if(y==0)d=t,f=e,p=(i-n)*(i-n)+(o-s)*(o-s);else{const S=((i-t)*(n-t)+(o-e)*(s-e))/y;S<0?(d=t,f=e,p=(t-i)*(t-i)+(e-o)*(e-o)):S>1?(d=n,f=s,p=(n-i)*(n-i)+(s-o)*(s-o)):(d=t+S*(n-t),f=e+S*(s-e),p=(d-i)*(d-i)+(f-o)*(f-o))}return[d,f,p]},_getProjectionToLine(t,e,n){const s=ee.cloneObject(t);let i=Number.MAX_VALUE;return e.forEach(function(o,d){if(!n&&d===e.length-1)return;const f=e[(d+1)%e.length],p=ee._getProjectionToSegment(o.x,o.y,f.x,f.y,t.x,t.y),y=p[0],S=p[1],b=p[2];b<i&&(s.x=y,s.y=S,i=b)}),s},_prepareArrayForTween(t,e,n){const s=[],i=[];if(t.length>e.length){const d=e;e=t,t=d}for(let d=0;d<t.length;d+=2)s.push({x:t[d],y:t[d+1]});for(let d=0;d<e.length;d+=2)i.push({x:e[d],y:e[d+1]});const o=[];return i.forEach(function(d){const f=ee._getProjectionToLine(d,s,n);o.push(f.x),o.push(f.y)}),o},_prepareToStringify(t){let e;t.visitedByCircularReferenceRemoval=!0;for(const n in t)if(t.hasOwnProperty(n)&&t[n]&&typeof t[n]=="object"){if(e=Object.getOwnPropertyDescriptor(t,n),t[n].visitedByCircularReferenceRemoval||ee._isElement(t[n]))if(e.configurable)delete t[n];else return null;else if(ee._prepareToStringify(t[n])===null)if(e.configurable)delete t[n];else return null}return delete t.visitedByCircularReferenceRemoval,t},_assign(t,e){for(const n in e)t[n]=e[n];return t},_getFirstPointerId(t){return t.touches?t.changedTouches[0].identifier:t.pointerId||999},releaseCanvas(...t){ke.releaseCanvasOnDestroy&&t.forEach(e=>{e.width=0,e.height=0})},drawRoundedRectPath(t,e,n,s){let i=e<0?e:0,o=n<0?n:0;e=Math.abs(e),n=Math.abs(n);let d=0,f=0,p=0,y=0;typeof s=="number"?d=f=p=y=Math.min(s,e/2,n/2):(d=Math.min(s[0]||0,e/2,n/2),f=Math.min(s[1]||0,e/2,n/2),y=Math.min(s[2]||0,e/2,n/2),p=Math.min(s[3]||0,e/2,n/2)),t.moveTo(i+d,o),t.lineTo(i+e-f,o),t.arc(i+e-f,o+f,f,Math.PI*3/2,0,!1),t.lineTo(i+e,o+n-y),t.arc(i+e-y,o+n-y,y,0,Math.PI/2,!1),t.lineTo(i+p,o+n),t.arc(i+p,o+n-p,p,Math.PI/2,Math.PI,!1),t.lineTo(i,o+d),t.arc(i+d,o+d,d,Math.PI,Math.PI*3/2,!1)},drawRoundedPolygonPath(t,e,n,s,i){s=Math.abs(s);for(let o=0;o<n;o++){const d=e[(o-1+n)%n],f=e[o],p=e[(o+1)%n],y={x:f.x-d.x,y:f.y-d.y},S={x:p.x-f.x,y:p.y-f.y},b=Math.hypot(y.x,y.y),_=Math.hypot(S.x,S.y);let j;typeof i=="number"?j=i:j=o<i.length?i[o]:0,j=s*Math.cos(Math.PI/n)*Math.min(1,j/s*2);const T={x:y.x/b,y:y.y/b},O={x:S.x/_,y:S.y/_},R={x:f.x-T.x*j,y:f.y-T.y*j},M={x:f.x+O.x*j,y:f.y+O.y*j};o===0?t.moveTo(R.x,R.y):t.lineTo(R.x,R.y),t.arcTo(f.x,f.y,M.x,M.y,j)}}};function jD(t){const e=[],n=t.length,s=ee;for(let i=0;i<n;i++){let o=t[i];s._isNumber(o)?o=Math.round(o*1e3)/1e3:s._isString(o)||(o=o+""),e.push(o)}return e}const S5=",",wD="(",ED=")",TD="([",RD="])",OD=";",MD="()",AD="=",N5=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","roundRect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],DD=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled","filter"],zD=100;let n1=null;function _5(){if(n1!==null)return n1;try{const e=ee.createCanvasElement().getContext("2d");return e?!!e&&"filter"in e:(n1=!1,!1)}catch{return n1=!1,!1}}class iy{constructor(e){this.canvas=e,ke.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(e){e.fillEnabled()&&this._fill(e)}_fill(e){}strokeShape(e){e.hasStroke()&&this._stroke(e)}_stroke(e){}fillStrokeShape(e){e.attrs.fillAfterStrokeEnabled?(this.strokeShape(e),this.fillShape(e)):(this.fillShape(e),this.strokeShape(e))}getTrace(e,n){let s=this.traceArr,i=s.length,o="",d,f,p,y;for(d=0;d<i;d++)f=s[d],p=f.method,p?(y=f.args,o+=p,e?o+=MD:ee._isArray(y[0])?o+=TD+y.join(S5)+RD:(n&&(y=y.map(S=>typeof S=="number"?Math.floor(S):S)),o+=wD+y.join(S5)+ED)):(o+=f.property,e||(o+=AD+f.val)),o+=OD;return o}clearTrace(){this.traceArr=[]}_trace(e){let n=this.traceArr,s;n.push(e),s=n.length,s>=zD&&n.shift()}reset(){const e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}getCanvas(){return this.canvas}clear(e){const n=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,n.getWidth()/n.pixelRatio,n.getHeight()/n.pixelRatio)}_applyLineCap(e){const n=e.attrs.lineCap;n&&this.setAttr("lineCap",n)}_applyOpacity(e){const n=e.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(e){const n=e.attrs.lineJoin;n&&this.setAttr("lineJoin",n)}_applyMiterLimit(e){const n=e.attrs.miterLimit;n!=null&&this.setAttr("miterLimit",n)}setAttr(e,n){this._context[e]=n}arc(e,n,s,i,o,d){this._context.arc(e,n,s,i,o,d)}arcTo(e,n,s,i,o){this._context.arcTo(e,n,s,i,o)}beginPath(){this._context.beginPath()}bezierCurveTo(e,n,s,i,o,d){this._context.bezierCurveTo(e,n,s,i,o,d)}clearRect(e,n,s,i){this._context.clearRect(e,n,s,i)}clip(...e){this._context.clip.apply(this._context,e)}closePath(){this._context.closePath()}createImageData(e,n){const s=arguments;if(s.length===2)return this._context.createImageData(e,n);if(s.length===1)return this._context.createImageData(e)}createLinearGradient(e,n,s,i){return this._context.createLinearGradient(e,n,s,i)}createPattern(e,n){return this._context.createPattern(e,n)}createRadialGradient(e,n,s,i,o,d){return this._context.createRadialGradient(e,n,s,i,o,d)}drawImage(e,n,s,i,o,d,f,p,y){const S=arguments,b=this._context;S.length===3?b.drawImage(e,n,s):S.length===5?b.drawImage(e,n,s,i,o):S.length===9&&b.drawImage(e,n,s,i,o,d,f,p,y)}ellipse(e,n,s,i,o,d,f,p){this._context.ellipse(e,n,s,i,o,d,f,p)}isPointInPath(e,n,s,i){return s?this._context.isPointInPath(s,e,n,i):this._context.isPointInPath(e,n,i)}fill(...e){this._context.fill.apply(this._context,e)}fillRect(e,n,s,i){this._context.fillRect(e,n,s,i)}strokeRect(e,n,s,i){this._context.strokeRect(e,n,s,i)}fillText(e,n,s,i){i?this._context.fillText(e,n,s,i):this._context.fillText(e,n,s)}measureText(e){return this._context.measureText(e)}getImageData(e,n,s,i){return this._context.getImageData(e,n,s,i)}lineTo(e,n){this._context.lineTo(e,n)}moveTo(e,n){this._context.moveTo(e,n)}rect(e,n,s,i){this._context.rect(e,n,s,i)}roundRect(e,n,s,i,o){this._context.roundRect(e,n,s,i,o)}putImageData(e,n,s){this._context.putImageData(e,n,s)}quadraticCurveTo(e,n,s,i){this._context.quadraticCurveTo(e,n,s,i)}restore(){this._context.restore()}rotate(e){this._context.rotate(e)}save(){this._context.save()}scale(e,n){this._context.scale(e,n)}setLineDash(e){this._context.setLineDash?this._context.setLineDash(e):"mozDash"in this._context?this._context.mozDash=e:"webkitLineDash"in this._context&&(this._context.webkitLineDash=e)}getLineDash(){return this._context.getLineDash()}setTransform(e,n,s,i,o,d){this._context.setTransform(e,n,s,i,o,d)}stroke(e){e?this._context.stroke(e):this._context.stroke()}strokeText(e,n,s,i){this._context.strokeText(e,n,s,i)}transform(e,n,s,i,o,d){this._context.transform(e,n,s,i,o,d)}translate(e,n){this._context.translate(e,n)}_enableTrace(){let e=this,n=N5.length,s=this.setAttr,i,o;const d=function(f){let p=e[f],y;e[f]=function(){return o=jD(Array.prototype.slice.call(arguments,0)),y=p.apply(e,arguments),e._trace({method:f,args:o}),y}};for(i=0;i<n;i++)d(N5[i]);e.setAttr=function(){s.apply(e,arguments);const f=arguments[0];let p=arguments[1];(f==="shadowOffsetX"||f==="shadowOffsetY"||f==="shadowBlur")&&(p=p/this.canvas.getPixelRatio()),e._trace({property:f,val:p})}}_applyGlobalCompositeOperation(e){const n=e.attrs.globalCompositeOperation;!n||n==="source-over"||this.setAttr("globalCompositeOperation",n)}}DD.forEach(function(t){Object.defineProperty(iy.prototype,t,{get(){return this._context[t]},set(e){this._context[t]=e}})});class kD extends iy{constructor(e,{willReadFrequently:n=!1}={}){super(e),this._context=e._canvas.getContext("2d",{willReadFrequently:n})}_fillColor(e){const n=e.fill();this.setAttr("fillStyle",n),e._fillFunc(this)}_fillPattern(e){this.setAttr("fillStyle",e._getFillPattern()),e._fillFunc(this)}_fillLinearGradient(e){const n=e._getLinearGradient();n&&(this.setAttr("fillStyle",n),e._fillFunc(this))}_fillRadialGradient(e){const n=e._getRadialGradient();n&&(this.setAttr("fillStyle",n),e._fillFunc(this))}_fill(e){const n=e.fill(),s=e.getFillPriority();if(n&&s==="color"){this._fillColor(e);return}const i=e.getFillPatternImage();if(i&&s==="pattern"){this._fillPattern(e);return}const o=e.getFillLinearGradientColorStops();if(o&&s==="linear-gradient"){this._fillLinearGradient(e);return}const d=e.getFillRadialGradientColorStops();if(d&&s==="radial-gradient"){this._fillRadialGradient(e);return}n?this._fillColor(e):i?this._fillPattern(e):o?this._fillLinearGradient(e):d&&this._fillRadialGradient(e)}_strokeLinearGradient(e){const n=e.getStrokeLinearGradientStartPoint(),s=e.getStrokeLinearGradientEndPoint(),i=e.getStrokeLinearGradientColorStops(),o=this.createLinearGradient(n.x,n.y,s.x,s.y);if(i){for(let d=0;d<i.length;d+=2)o.addColorStop(i[d],i[d+1]);this.setAttr("strokeStyle",o)}}_stroke(e){const n=e.dash(),s=e.getStrokeScaleEnabled();if(e.hasStroke()){if(!s){this.save();const o=this.getCanvas().getPixelRatio();this.setTransform(o,0,0,o,0,0)}this._applyLineCap(e),n&&e.dashEnabled()&&(this.setLineDash(n),this.setAttr("lineDashOffset",e.dashOffset())),this.setAttr("lineWidth",e.strokeWidth()),e.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),e.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(e):this.setAttr("strokeStyle",e.stroke()),e._strokeFunc(this),s||this.restore()}}_applyShadow(e){var n,s,i;const o=(n=e.getShadowRGBA())!==null&&n!==void 0?n:"black",d=(s=e.getShadowBlur())!==null&&s!==void 0?s:5,f=(i=e.getShadowOffset())!==null&&i!==void 0?i:{x:0,y:0},p=e.getAbsoluteScale(),y=this.canvas.getPixelRatio(),S=p.x*y,b=p.y*y;this.setAttr("shadowColor",o),this.setAttr("shadowBlur",d*Math.min(Math.abs(S),Math.abs(b))),this.setAttr("shadowOffsetX",f.x*S),this.setAttr("shadowOffsetY",f.y*b)}}class LD extends iy{constructor(e){super(e),this._context=e._canvas.getContext("2d",{willReadFrequently:!0})}_fill(e){this.save(),this.setAttr("fillStyle",e.colorKey),e._fillFuncHit(this),this.restore()}strokeShape(e){e.hasHitStroke()&&this._stroke(e)}_stroke(e){if(e.hasHitStroke()){const n=e.getStrokeScaleEnabled();if(!n){this.save();const o=this.getCanvas().getPixelRatio();this.setTransform(o,0,0,o,0,0)}this._applyLineCap(e);const s=e.hitStrokeWidth(),i=s==="auto"?e.strokeWidth():s;this.setAttr("lineWidth",i),this.setAttr("strokeStyle",e.colorKey),e._strokeFuncHit(this),n||this.restore()}}}let a1;function UD(){if(a1)return a1;const t=ee.createCanvasElement(),e=t.getContext("2d");return a1=(function(){const n=ke._global.devicePixelRatio||1,s=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return n/s})(),ee.releaseCanvas(t),a1}class Ov{constructor(e){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const s=(e||{}).pixelRatio||ke.pixelRatio||UD();this.pixelRatio=s,this._canvas=ee.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(e){const n=this.pixelRatio;this.pixelRatio=e,this.setSize(this.getWidth()/n,this.getHeight()/n)}setWidth(e){this.width=this._canvas.width=e*this.pixelRatio,this._canvas.style.width=e+"px";const n=this.pixelRatio;this.getContext()._context.scale(n,n)}setHeight(e){this.height=this._canvas.height=e*this.pixelRatio,this._canvas.style.height=e+"px";const n=this.pixelRatio;this.getContext()._context.scale(n,n)}getWidth(){return this.width}getHeight(){return this.height}setSize(e,n){this.setWidth(e||0),this.setHeight(n||0)}toDataURL(e,n){try{return this._canvas.toDataURL(e,n)}catch{try{return this._canvas.toDataURL()}catch(i){return ee.error("Unable to get data URL. "+i.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}class xc extends Ov{constructor(e={width:0,height:0,willReadFrequently:!1}){super(e),this.context=new kD(this,{willReadFrequently:e.willReadFrequently}),this.setSize(e.width,e.height)}}class Mv extends Ov{constructor(e={width:0,height:0}){super(e),this.hitCanvas=!0,this.context=new LD(this),this.setSize(e.width,e.height)}}const Yt={get isDragging(){let t=!1;return Yt._dragElements.forEach(e=>{e.dragStatus==="dragging"&&(t=!0)}),t},justDragged:!1,get node(){let t;return Yt._dragElements.forEach(e=>{t=e.node}),t},_dragElements:new Map,_drag(t){const e=[];Yt._dragElements.forEach((n,s)=>{const{node:i}=n,o=i.getStage();o.setPointersPositions(t),n.pointerId===void 0&&(n.pointerId=ee._getFirstPointerId(t));const d=o._changedPointerPositions.find(f=>f.id===n.pointerId);if(d){if(n.dragStatus!=="dragging"){const f=i.dragDistance();if(Math.max(Math.abs(d.x-n.startPointerPos.x),Math.abs(d.y-n.startPointerPos.y))<f||(i.startDrag({evt:t}),!i.isDragging()))return}i._setDragPosition(t,n),e.push(i)}}),e.forEach(n=>{n.getStage()&&n.fire("dragmove",{type:"dragmove",target:n,evt:t},!0)})},_endDragBefore(t){const e=[];Yt._dragElements.forEach(n=>{const{node:s}=n,i=s.getStage();if(t&&i.setPointersPositions(t),!i._changedPointerPositions.find(f=>f.id===n.pointerId))return;(n.dragStatus==="dragging"||n.dragStatus==="stopped")&&(Yt.justDragged=!0,ke._mouseListenClick=!1,ke._touchListenClick=!1,ke._pointerListenClick=!1,n.dragStatus="stopped");const d=n.node.getLayer()||n.node instanceof ke.Stage&&n.node;d&&e.indexOf(d)===-1&&e.push(d)}),e.forEach(n=>{n.draw()})},_endDragAfter(t){Yt._dragElements.forEach((e,n)=>{e.dragStatus==="stopped"&&e.node.fire("dragend",{type:"dragend",target:e.node,evt:t},!0),e.dragStatus!=="dragging"&&Yt._dragElements.delete(n)})}};ke.isBrowser&&(window.addEventListener("mouseup",Yt._endDragBefore,!0),window.addEventListener("touchend",Yt._endDragBefore,!0),window.addEventListener("touchcancel",Yt._endDragBefore,!0),window.addEventListener("mousemove",Yt._drag),window.addEventListener("touchmove",Yt._drag),window.addEventListener("mouseup",Yt._endDragAfter,!1),window.addEventListener("touchend",Yt._endDragAfter,!1),window.addEventListener("touchcancel",Yt._endDragAfter,!1));function Uc(t){return ee._isString(t)?'"'+t+'"':Object.prototype.toString.call(t)==="[object Number]"||ee._isBoolean(t)?t:Object.prototype.toString.call(t)}function v8(t){return t>255?255:t<0?0:Math.round(t)}function Oe(){if(ke.isUnminified)return function(t,e){return ee._isNumber(t)||ee.warn(Uc(t)+' is a not valid value for "'+e+'" attribute. The value should be a number.'),t}}function ly(t){if(ke.isUnminified)return function(e,n){let s=ee._isNumber(e),i=ee._isArray(e)&&e.length==t;return!s&&!i&&ee.warn(Uc(e)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array<number>('+t+")"),e}}function Av(){if(ke.isUnminified)return function(t,e){return ee._isNumber(t)||t==="auto"||ee.warn(Uc(t)+' is a not valid value for "'+e+'" attribute. The value should be a number or "auto".'),t}}function rd(){if(ke.isUnminified)return function(t,e){return ee._isString(t)||ee.warn(Uc(t)+' is a not valid value for "'+e+'" attribute. The value should be a string.'),t}}function S8(){if(ke.isUnminified)return function(t,e){const n=ee._isString(t),s=Object.prototype.toString.call(t)==="[object CanvasGradient]"||t&&t.addColorStop;return n||s||ee.warn(Uc(t)+' is a not valid value for "'+e+'" attribute. The value should be a string or a native gradient.'),t}}function qD(){if(ke.isUnminified)return function(t,e){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&t instanceof n||(ee._isArray(t)?t.forEach(function(s){ee._isNumber(s)||ee.warn('"'+e+'" attribute has non numeric element '+s+". Make sure that all elements are numbers.")}):ee.warn(Uc(t)+' is a not valid value for "'+e+'" attribute. The value should be a array of numbers.')),t}}function Mi(){if(ke.isUnminified)return function(t,e){return t===!0||t===!1||ee.warn(Uc(t)+' is a not valid value for "'+e+'" attribute. The value should be a boolean.'),t}}function HD(t){if(ke.isUnminified)return function(e,n){return e==null||ee.isObject(e)||ee.warn(Uc(e)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+t),e}}const sm="get",rm="set",K={addGetterSetter(t,e,n,s,i){K.addGetter(t,e,n),K.addSetter(t,e,s,i),K.addOverloadedGetterSetter(t,e)},addGetter(t,e,n){const s=sm+ee._capitalize(e);t.prototype[s]=t.prototype[s]||function(){const i=this.attrs[e];return i===void 0?n:i}},addSetter(t,e,n,s){const i=rm+ee._capitalize(e);t.prototype[i]||K.overWriteSetter(t,e,n,s)},overWriteSetter(t,e,n,s){const i=rm+ee._capitalize(e);t.prototype[i]=function(o){return n&&o!==void 0&&o!==null&&(o=n.call(this,o,e)),this._setAttr(e,o),s&&s.call(this),this}},addComponentsGetterSetter(t,e,n,s,i){const o=n.length,d=ee._capitalize,f=sm+d(e),p=rm+d(e);t.prototype[f]=function(){const S={};for(let b=0;b<o;b++){const _=n[b];S[_]=this.getAttr(e+d(_))}return S};const y=HD(n);t.prototype[p]=function(S){const b=this.attrs[e];s&&(S=s.call(this,S,e)),y&&y.call(this,S,e);for(const _ in S)S.hasOwnProperty(_)&&this._setAttr(e+d(_),S[_]);return S||n.forEach(_=>{this._setAttr(e+d(_),void 0)}),this._fireChangeEvent(e,b,S),i&&i.call(this),this},K.addOverloadedGetterSetter(t,e)},addOverloadedGetterSetter(t,e){const n=ee._capitalize(e),s=rm+n,i=sm+n;t.prototype[e]=function(){return arguments.length?(this[s](arguments[0]),this):this[i]()}},addDeprecatedGetterSetter(t,e,n,s){ee.error("Adding deprecated "+e);const i=sm+ee._capitalize(e),o=e+" property is deprecated and will be removed soon. Look at Konva change log for more information.";t.prototype[i]=function(){ee.error(o);const d=this.attrs[e];return d===void 0?n:d},K.addSetter(t,e,s,function(){ee.error(o)}),K.addOverloadedGetterSetter(t,e)},backCompat(t,e){ee.each(e,function(n,s){const i=t.prototype[s],o=sm+ee._capitalize(n),d=rm+ee._capitalize(n);function f(){i.apply(this,arguments),ee.error('"'+n+'" method is deprecated and will be removed soon. Use ""'+s+'" instead.')}t.prototype[n]=f,t.prototype[o]=f,t.prototype[d]=f})},afterSetFilter(){this._filterUpToDate=!1}};function BD(t){const e=/(\w+)\(([^)]+)\)/g;let n;for(;(n=e.exec(t))!==null;){const[,s,i]=n;switch(s){case"blur":{const o=parseFloat(i.replace("px",""));return function(d){this.blurRadius(o*.5);const f=ke.Filters;f&&f.Blur&&f.Blur.call(this,d)}}case"brightness":{const o=i.includes("%")?parseFloat(i)/100:parseFloat(i);return function(d){this.brightness(o);const f=ke.Filters;f&&f.Brightness&&f.Brightness.call(this,d)}}case"contrast":{const o=parseFloat(i);return function(d){const f=100*(Math.sqrt(o)-1);this.contrast(f);const p=ke.Filters;p&&p.Contrast&&p.Contrast.call(this,d)}}case"grayscale":return function(o){const d=ke.Filters;d&&d.Grayscale&&d.Grayscale.call(this,o)};case"sepia":return function(o){const d=ke.Filters;d&&d.Sepia&&d.Sepia.call(this,o)};case"invert":return function(o){const d=ke.Filters;d&&d.Invert&&d.Invert.call(this,o)};default:ee.warn(`CSS filter "${s}" is not supported in fallback mode. Consider using function filters for better compatibility.`);break}}return()=>{}}const x1="absoluteOpacity",C5="allEventListeners",so="absoluteTransform",j5="absoluteScale",zu="canvas",GD="Change",PD="children",YD="konva",Rb="listening",VD="mouseenter",QD="mouseleave",KD="pointerenter",XD="pointerleave",FD="touchenter",ZD="touchleave",w5="set",E5="Shape",b1=" ",T5="stage",gc="transform",ID="Stage",Ob="visible",JD=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(b1);let WD=1;class De{constructor(e){this._id=WD++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(e),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(e){(e===gc||e===so)&&this._cache.get(e)?this._cache.get(e).dirty=!0:e?this._cache.delete(e):this._cache.clear()}_getCache(e,n){let s=this._cache.get(e);return(s===void 0||(e===gc||e===so)&&s.dirty===!0)&&(s=n.call(this),this._cache.set(e,s)),s}_calculate(e,n,s){if(!this._attachedDepsListeners.get(e)){const i=n.map(o=>o+"Change.konva").join(b1);this.on(i,()=>{this._clearCache(e)}),this._attachedDepsListeners.set(e,!0)}return this._getCache(e,s)}_getCanvasCache(){return this._cache.get(zu)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===so&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(zu)){const{scene:e,filter:n,hit:s}=this._cache.get(zu);ee.releaseCanvas(e._canvas,n._canvas,s._canvas),this._cache.delete(zu)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(e){const n=e||{};let s={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(s=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let i=Math.ceil(n.width||s.width),o=Math.ceil(n.height||s.height),d=n.pixelRatio,f=n.x===void 0?Math.floor(s.x):n.x,p=n.y===void 0?Math.floor(s.y):n.y,y=n.offset||0,S=n.drawBorder||!1,b=n.hitCanvasPixelRatio||1;if(!i||!o){ee.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const _=Math.abs(Math.round(s.x)-f)>.5?1:0,j=Math.abs(Math.round(s.y)-p)>.5?1:0;i+=y*2+_,o+=y*2+j,f-=y,p-=y;const w=new xc({pixelRatio:d,width:i,height:o}),T=new xc({pixelRatio:d,width:0,height:0,willReadFrequently:!0}),O=new Mv({pixelRatio:b,width:i,height:o}),R=w.getContext(),M=O.getContext(),z=new xc({width:w.width/w.pixelRatio+Math.abs(f),height:w.height/w.pixelRatio+Math.abs(p),pixelRatio:w.pixelRatio}),k=z.getContext();return O.isCache=!0,w.isCache=!0,this._cache.delete(zu),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(w.getContext()._context.imageSmoothingEnabled=!1,T.getContext()._context.imageSmoothingEnabled=!1),R.save(),M.save(),k.save(),R.translate(-f,-p),M.translate(-f,-p),k.translate(-f,-p),z.x=f,z.y=p,this._isUnderCache=!0,this._clearSelfAndDescendantCache(x1),this._clearSelfAndDescendantCache(j5),this.drawScene(w,this,z),this.drawHit(O,this),this._isUnderCache=!1,R.restore(),M.restore(),S&&(R.save(),R.beginPath(),R.rect(0,0,i,o),R.closePath(),R.setAttr("strokeStyle","red"),R.setAttr("lineWidth",5),R.stroke(),R.restore()),ee.releaseCanvas(z._canvas),this._cache.set(zu,{scene:w,filter:T,hit:O,x:f,y:p}),this._requestDraw(),this}isCached(){return this._cache.has(zu)}getClientRect(e){throw new Error('abstract "getClientRect" method call')}_transformedRect(e,n){const s=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}];let i=1/0,o=1/0,d=-1/0,f=-1/0;const p=this.getAbsoluteTransform(n);return s.forEach(function(y){const S=p.point(y);i===void 0&&(i=d=S.x,o=f=S.y),i=Math.min(i,S.x),o=Math.min(o,S.y),d=Math.max(d,S.x),f=Math.max(f,S.y)}),{x:i,y:o,width:d-i,height:f-o}}_drawCachedSceneCanvas(e){e.save(),e._applyOpacity(this),e._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();e.translate(n.x,n.y);const s=this._getCachedSceneCanvas(),i=s.pixelRatio;e.drawImage(s._canvas,0,0,s.width/i,s.height/i),e.restore()}_drawCachedHitCanvas(e){const n=this._getCanvasCache(),s=n.hit;e.save(),e.translate(n.x,n.y),e.drawImage(s._canvas,0,0,s.width/s.pixelRatio,s.height/s.pixelRatio),e.restore()}_getCachedSceneCanvas(){let e=this.filters(),n=this._getCanvasCache(),s=n.scene,i=n.filter,o=i.getContext(),d,f,p,y;if(!e||e.length===0)return s;if(this._filterUpToDate)return i;let S=!0;for(let _=0;_<e.length;_++)if(typeof e[_]=="string"&&_5(),typeof e[_]!="string"||!_5()){S=!1;break}const b=s.pixelRatio;if(i.setSize(s.width/s.pixelRatio,s.height/s.pixelRatio),S){const _=e.join(" ");return o.save(),o.setAttr("filter",_),o.drawImage(s._canvas,0,0,s.getWidth()/b,s.getHeight()/b),o.restore(),this._filterUpToDate=!0,i}try{for(d=e.length,o.clear(),o.drawImage(s._canvas,0,0,s.getWidth()/b,s.getHeight()/b),f=o.getImageData(0,0,i.getWidth(),i.getHeight()),p=0;p<d;p++)y=e[p],typeof y=="string"&&(y=BD(y)),y.call(this,f),o.putImageData(f,0,0)}catch(_){ee.error("Unable to apply filter. "+_.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}return this._filterUpToDate=!0,i}on(...e){const n=e[0],s=e[1];if(e[2],this._cache&&this._cache.delete(C5),e.length===3)return this._delegate.apply(this,e);const i=n.split(b1);for(let o=0;o<i.length;o++){const f=i[o].split("."),p=f[0],y=f[1]||"";this.eventListeners[p]||(this.eventListeners[p]=[]),this.eventListeners[p].push({name:y,handler:s})}return this}off(e,n){let s=(e||"").split(b1),i=s.length,o,d,f,p,y,S;if(this._cache&&this._cache.delete(C5),!e)for(d in this.eventListeners)this._off(d);for(o=0;o<i;o++)if(f=s[o],p=f.split("."),y=p[0],S=p[1],y)this.eventListeners[y]&&this._off(y,S,n);else for(d in this.eventListeners)this._off(d,S,n);return this}dispatchEvent(e){const n={target:this,type:e.type,evt:e};return this.fire(e.type,n),this}addEventListener(e,n){return this.on(e,function(s){n.call(this,s.evt)}),this}removeEventListener(e){return this.off(e),this}_delegate(e,n,s){const i=this;return this.on(e,function(o){const d=o.target.findAncestors(n,!0,i);for(let f=0;f<d.length;f++)o=ee.cloneObject(o),o.currentTarget=d[f],s.call(d[f],o)}),this}remove(){return this.isDragging()&&this.stopDrag(),Yt._dragElements.delete(this._id),Yt._dragElements.forEach((e,n)=>{this.isAncestorOf(e.node)&&Yt._dragElements.delete(n)}),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(so),this._clearSelfAndDescendantCache(x1),this._clearSelfAndDescendantCache(j5),this._clearSelfAndDescendantCache(T5),this._clearSelfAndDescendantCache(Ob),this._clearSelfAndDescendantCache(Rb)}_remove(){this._clearCaches();const e=this.getParent();e&&e.children&&(e.children.splice(this.index,1),e._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(e){const n="get"+ee._capitalize(e);return ee._isFunction(this[n])?this[n]():this.attrs[e]}getAncestors(){let e=this.getParent(),n=[];for(;e;)n.push(e),e=e.getParent();return n}getAttrs(){return this.attrs||{}}setAttrs(e){return this._batchTransformChanges(()=>{let n,s;if(!e)return this;for(n in e)n!==PD&&(s=w5+ee._capitalize(n),ee._isFunction(this[s])?this[s](e[n]):this._setAttr(n,e[n]))}),this}isListening(){return this._getCache(Rb,this._isListening)}_isListening(e){if(!this.listening())return!1;const s=this.getParent();return s&&s!==e&&this!==e?s._isListening(e):!0}isVisible(){return this._getCache(Ob,this._isVisible)}_isVisible(e){if(!this.visible())return!1;const s=this.getParent();return s&&s!==e&&this!==e?s._isVisible(e):!0}shouldDrawHit(e,n=!1){if(e)return this._isVisible(e)&&this._isListening(e);const s=this.getLayer();let i=!1;Yt._dragElements.forEach(d=>{d.dragStatus==="dragging"&&(d.node.nodeType==="Stage"||d.node.getLayer()===s)&&(i=!0)});const o=!n&&!ke.hitOnDragEnabled&&(i||ke.isTransforming());return this.isListening()&&this.isVisible()&&!o}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let e=this.getDepth(),n=this,s=0,i,o,d,f;function p(S){for(i=[],o=S.length,d=0;d<o;d++)f=S[d],s++,f.nodeType!==E5&&(i=i.concat(f.getChildren().slice())),f._id===n._id&&(d=o);i.length>0&&i[0].getDepth()<=e&&p(i)}const y=this.getStage();return n.nodeType!==ID&&y&&p(y.getChildren()),s}getDepth(){let e=0,n=this.parent;for(;n;)e++,n=n.parent;return e}_batchTransformChanges(e){this._batchingTransformChange=!0,e(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(gc),this._clearSelfAndDescendantCache(so)),this._needClearTransformCache=!1}setPosition(e){return this._batchTransformChanges(()=>{this.x(e.x),this.y(e.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const e=this.getStage();if(!e)return null;const n=e.getPointerPosition();if(!n)return null;const s=this.getAbsoluteTransform().copy();return s.invert(),s.point(n)}getAbsolutePosition(e){let n=!1,s=this.parent;for(;s;){if(s.isCached()){n=!0;break}s=s.parent}n&&!e&&(e=!0);const i=this.getAbsoluteTransform(e).getMatrix(),o=new Cr,d=this.offset();return o.m=i.slice(),o.translate(d.x,d.y),o.getTranslation()}setAbsolutePosition(e){const{x:n,y:s,...i}=this._clearTransform();this.attrs.x=n,this.attrs.y=s,this._clearCache(gc);const o=this._getAbsoluteTransform().copy();return o.invert(),o.translate(e.x,e.y),e={x:this.attrs.x+o.getTranslation().x,y:this.attrs.y+o.getTranslation().y},this._setTransform(i),this.setPosition({x:e.x,y:e.y}),this._clearCache(gc),this._clearSelfAndDescendantCache(so),this}_setTransform(e){let n;for(n in e)this.attrs[n]=e[n]}_clearTransform(){const e={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,e}move(e){let n=e.x,s=e.y,i=this.x(),o=this.y();return n!==void 0&&(i+=n),s!==void 0&&(o+=s),this.setPosition({x:i,y:o}),this}_eachAncestorReverse(e,n){let s=[],i=this.getParent(),o,d;if(!(n&&n._id===this._id)){for(s.unshift(this);i&&(!n||i._id!==n._id);)s.unshift(i),i=i.parent;for(o=s.length,d=0;d<o;d++)e(s[d])}}rotate(e){return this.rotation(this.rotation()+e),this}moveToTop(){if(!this.parent)return ee.warn("Node has no parent. moveToTop function is ignored."),!1;const e=this.index,n=this.parent.getChildren().length;return e<n-1?(this.parent.children.splice(e,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return ee.warn("Node has no parent. moveUp function is ignored."),!1;const e=this.index,n=this.parent.getChildren().length;return e<n-1?(this.parent.children.splice(e,1),this.parent.children.splice(e+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return ee.warn("Node has no parent. moveDown function is ignored."),!1;const e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return ee.warn("Node has no parent. moveToBottom function is ignored."),!1;const e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(e){if(!this.parent)return ee.warn("Node has no parent. zIndex parameter is ignored."),this;(e<0||e>=this.parent.children.length)&&ee.warn("Unexpected value "+e+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");const n=this.index;return this.parent.children.splice(n,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(x1,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let e=this.opacity();const n=this.getParent();return n&&!n._isUnderCache&&(e*=n.getAbsoluteOpacity()),e}moveTo(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}toObject(){let e=this.getAttrs(),n,s,i,o,d;const f={attrs:{},className:this.getClassName()};for(n in e)s=e[n],d=ee.isObject(s)&&!ee._isPlainObject(s)&&!ee._isArray(s),!d&&(i=typeof this[n]=="function"&&this[n],delete e[n],o=i?i.call(this):null,e[n]=s,o!==s&&(f.attrs[n]=s));return ee._prepareToStringify(f)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(e,n,s){const i=[];n&&this._isMatch(e)&&i.push(this);let o=this.parent;for(;o;){if(o===s)return i;o._isMatch(e)&&i.push(o),o=o.parent}return i}isAncestorOf(e){return!1}findAncestor(e,n,s){return this.findAncestors(e,n,s)[0]}_isMatch(e){if(!e)return!1;if(typeof e=="function")return e(this);let n=e.replace(/ /g,"").split(","),s=n.length,i,o;for(i=0;i<s;i++)if(o=n[i],ee.isValidSelector(o)||(ee.warn('Selector "'+o+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),ee.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),ee.warn("Konva is awesome, right?")),o.charAt(0)==="#"){if(this.id()===o.slice(1))return!0}else if(o.charAt(0)==="."){if(this.hasName(o.slice(1)))return!0}else if(this.className===o||this.nodeType===o)return!0;return!1}getLayer(){const e=this.getParent();return e?e.getLayer():null}getStage(){return this._getCache(T5,this._getStage)}_getStage(){const e=this.getParent();return e?e.getStage():null}fire(e,n={},s){return n.target=n.target||this,s?this._fireAndBubble(e,n):this._fire(e,n),this}getAbsoluteTransform(e){return e?this._getAbsoluteTransform(e):this._getCache(so,this._getAbsoluteTransform)}_getAbsoluteTransform(e){let n;if(e)return n=new Cr,this._eachAncestorReverse(function(s){const i=s.transformsEnabled();i==="all"?n.multiply(s.getTransform()):i==="position"&&n.translate(s.x()-s.offsetX(),s.y()-s.offsetY())},e),n;{n=this._cache.get(so)||new Cr,this.parent?this.parent.getAbsoluteTransform().copyInto(n):n.reset();const s=this.transformsEnabled();if(s==="all")n.multiply(this.getTransform());else if(s==="position"){const i=this.attrs.x||0,o=this.attrs.y||0,d=this.attrs.offsetX||0,f=this.attrs.offsetY||0;n.translate(i-d,o-f)}return n.dirty=!1,n}}getAbsoluteScale(e){let n=this;for(;n;)n._isUnderCache&&(e=n),n=n.getParent();const i=this.getAbsoluteTransform(e).decompose();return{x:i.scaleX,y:i.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(gc,this._getTransform)}_getTransform(){var e,n;const s=this._cache.get(gc)||new Cr;s.reset();const i=this.x(),o=this.y(),d=ke.getAngle(this.rotation()),f=(e=this.attrs.scaleX)!==null&&e!==void 0?e:1,p=(n=this.attrs.scaleY)!==null&&n!==void 0?n:1,y=this.attrs.skewX||0,S=this.attrs.skewY||0,b=this.attrs.offsetX||0,_=this.attrs.offsetY||0;return(i!==0||o!==0)&&s.translate(i,o),d!==0&&s.rotate(d),(y!==0||S!==0)&&s.skew(y,S),(f!==1||p!==1)&&s.scale(f,p),(b!==0||_!==0)&&s.translate(-1*b,-1*_),s.dirty=!1,s}clone(e){let n=ee.cloneObject(this.attrs),s,i,o,d,f;for(s in e)n[s]=e[s];const p=new this.constructor(n);for(s in this.eventListeners)for(i=this.eventListeners[s],o=i.length,d=0;d<o;d++)f=i[d],f.name.indexOf(YD)<0&&(p.eventListeners[s]||(p.eventListeners[s]=[]),p.eventListeners[s].push(f));return p}_toKonvaCanvas(e){e=e||{};const n=this.getClientRect(),s=this.getStage(),i=e.x!==void 0?e.x:Math.floor(n.x),o=e.y!==void 0?e.y:Math.floor(n.y),d=e.pixelRatio||1,f=new xc({width:e.width||Math.ceil(n.width)||(s?s.width():0),height:e.height||Math.ceil(n.height)||(s?s.height():0),pixelRatio:d}),p=f.getContext(),y=new xc({width:f.width/f.pixelRatio+Math.abs(i),height:f.height/f.pixelRatio+Math.abs(o),pixelRatio:f.pixelRatio});return e.imageSmoothingEnabled===!1&&(p._context.imageSmoothingEnabled=!1),p.save(),(i||o)&&p.translate(-1*i,-1*o),this.drawScene(f,void 0,y),p.restore(),f}toCanvas(e){return this._toKonvaCanvas(e)._canvas}toDataURL(e){e=e||{};const n=e.mimeType||null,s=e.quality||null,i=this._toKonvaCanvas(e).toDataURL(n,s);return e.callback&&e.callback(i),i}toImage(e){return new Promise((n,s)=>{try{const i=e==null?void 0:e.callback;i&&delete e.callback,ee._urlToImage(this.toDataURL(e),function(o){n(o),i==null||i(o)})}catch(i){s(i)}})}toBlob(e){return new Promise((n,s)=>{try{const i=e==null?void 0:e.callback;i&&delete e.callback,this.toCanvas(e).toBlob(o=>{n(o),i==null||i(o)},e==null?void 0:e.mimeType,e==null?void 0:e.quality)}catch(i){s(i)}})}setSize(e){return this.width(e.width),this.height(e.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():ke.dragDistance}_off(e,n,s){let i=this.eventListeners[e],o,d,f;for(o=0;o<i.length;o++)if(d=i[o].name,f=i[o].handler,(d!=="konva"||n==="konva")&&(!n||d===n)&&(!s||s===f)){if(i.splice(o,1),i.length===0){delete this.eventListeners[e];break}o--}}_fireChangeEvent(e,n,s){this._fire(e+GD,{oldVal:n,newVal:s})}addName(e){if(!this.hasName(e)){const n=this.name(),s=n?n+" "+e:e;this.name(s)}return this}hasName(e){if(!e)return!1;const n=this.name();return n?(n||"").split(/\s/g).indexOf(e)!==-1:!1}removeName(e){const n=(this.name()||"").split(/\s/g),s=n.indexOf(e);return s!==-1&&(n.splice(s,1),this.name(n.join(" "))),this}setAttr(e,n){const s=this[w5+ee._capitalize(e)];return ee._isFunction(s)?s.call(this,n):this._setAttr(e,n),this}_requestDraw(){if(ke.autoDrawEnabled){const e=this.getLayer()||this.getStage();e==null||e.batchDraw()}}_setAttr(e,n){const s=this.attrs[e];s===n&&!ee.isObject(n)||(n==null?delete this.attrs[e]:this.attrs[e]=n,this._shouldFireChangeEvents&&this._fireChangeEvent(e,s,n),this._requestDraw())}_setComponentAttr(e,n,s){let i;s!==void 0&&(i=this.attrs[e],i||(this.attrs[e]=this.getAttr(e)),this.attrs[e][n]=s,this._fireChangeEvent(e,i,s))}_fireAndBubble(e,n,s){n&&this.nodeType===E5&&(n.target=this);const i=[VD,QD,KD,XD,FD,ZD];if(!(i.indexOf(e)!==-1&&(s&&(this===s||this.isAncestorOf&&this.isAncestorOf(s))||this.nodeType==="Stage"&&!s))){this._fire(e,n);const d=i.indexOf(e)!==-1&&s&&s.isAncestorOf&&s.isAncestorOf(this)&&!s.isAncestorOf(this.parent);(n&&!n.cancelBubble||!n)&&this.parent&&this.parent.isListening()&&!d&&(s&&s.parent?this._fireAndBubble.call(this.parent,e,n,s):this._fireAndBubble.call(this.parent,e,n))}}_getProtoListeners(e){var n,s;const{nodeType:i}=this,o=De.protoListenerMap.get(i)||{};let d=o==null?void 0:o[e];if(d===void 0){d=[];let f=Object.getPrototypeOf(this);for(;f;){const p=(s=(n=f.eventListeners)===null||n===void 0?void 0:n[e])!==null&&s!==void 0?s:[];d.push(...p),f=Object.getPrototypeOf(f)}o[e]=d,De.protoListenerMap.set(i,o)}return d}_fire(e,n){n=n||{},n.currentTarget=this,n.type=e;const s=this._getProtoListeners(e);if(s)for(let o=0;o<s.length;o++)s[o].handler.call(this,n);const i=this.eventListeners[e];if(i)for(let o=0;o<i.length;o++)i[o].handler.call(this,n)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(e){const n=e?e.pointerId:void 0,s=this.getStage(),i=this.getAbsolutePosition();if(!s)return;const o=s._getPointerById(n)||s._changedPointerPositions[0]||i;Yt._dragElements.set(this._id,{node:this,startPointerPos:o,offset:{x:o.x-i.x,y:o.y-i.y},dragStatus:"ready",pointerId:n,startEvent:e})}startDrag(e,n=!0){Yt._dragElements.has(this._id)||this._createDragElement(e);const s=Yt._dragElements.get(this._id);s.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:s.startEvent&&s.startEvent.evt||e&&e.evt},n)}_setDragPosition(e,n){const s=this.getStage()._getPointerById(n.pointerId);if(!s)return;let i={x:s.x-n.offset.x,y:s.y-n.offset.y};const o=this.dragBoundFunc();if(o!==void 0){const d=o.call(this,i,e);d?i=d:ee.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==i.x||this._lastPos.y!==i.y)&&(this.setAbsolutePosition(i),this._requestDraw()),this._lastPos=i}stopDrag(e){const n=Yt._dragElements.get(this._id);n&&(n.dragStatus="stopped"),Yt._endDragBefore(e),Yt._endDragAfter(e)}setDraggable(e){this._setAttr("draggable",e),this._dragChange()}isDragging(){const e=Yt._dragElements.get(this._id);return e?e.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(e){if(!(!(e.evt.button!==void 0)||ke.dragButtons.indexOf(e.evt.button)>=0)||this.isDragging())return;let i=!1;Yt._dragElements.forEach(o=>{this.isAncestorOf(o.node)&&(i=!0)}),i||this._createDragElement(e)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const n=Yt._dragElements.get(this._id),s=n&&n.dragStatus==="dragging",i=n&&n.dragStatus==="ready";s?this.stopDrag():i&&Yt._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(e={x:0,y:0}){const n=this.getStage();if(!n)return!1;const s={x:-e.x,y:-e.y,width:n.width()+2*e.x,height:n.height()+2*e.y};return ee.haveIntersection(s,this.getClientRect())}static create(e,n){return ee._isString(e)&&(e=JSON.parse(e)),this._createNode(e,n)}static _createNode(e,n){let s=De.prototype.getClassName.call(e),i=e.children,o,d,f;n&&(e.attrs.container=n),ke[s]||(ee.warn('Can not find a node with class name "'+s+'". Fallback to "Shape".'),s="Shape");const p=ke[s];if(o=new p(e.attrs),i)for(d=i.length,f=0;f<d;f++)o.add(De._createNode(i[f]));return o}}De.protoListenerMap=new Map;De.prototype.nodeType="Node";De.prototype._attrsAffectingSize=[];De.prototype.eventListeners={};De.prototype.on(JD,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(gc),this._clearSelfAndDescendantCache(so)});De.prototype.on("visibleChange.konva",function(){this._clearSelfAndDescendantCache(Ob)});De.prototype.on("listeningChange.konva",function(){this._clearSelfAndDescendantCache(Rb)});De.prototype.on("opacityChange.konva",function(){this._clearSelfAndDescendantCache(x1)});const gn=K.addGetterSetter;gn(De,"zIndex");gn(De,"absolutePosition");gn(De,"position");gn(De,"x",0,Oe());gn(De,"y",0,Oe());gn(De,"globalCompositeOperation","source-over",rd());gn(De,"opacity",1,Oe());gn(De,"name","",rd());gn(De,"id","",rd());gn(De,"rotation",0,Oe());K.addComponentsGetterSetter(De,"scale",["x","y"]);gn(De,"scaleX",1,Oe());gn(De,"scaleY",1,Oe());K.addComponentsGetterSetter(De,"skew",["x","y"]);gn(De,"skewX",0,Oe());gn(De,"skewY",0,Oe());K.addComponentsGetterSetter(De,"offset",["x","y"]);gn(De,"offsetX",0,Oe());gn(De,"offsetY",0,Oe());gn(De,"dragDistance",void 0,Oe());gn(De,"width",0,Oe());gn(De,"height",0,Oe());gn(De,"listening",!0,Mi());gn(De,"preventDefault",!0,Mi());gn(De,"filters",void 0,function(t){return this._filterUpToDate=!1,t});gn(De,"visible",!0,Mi());gn(De,"transformsEnabled","all",rd());gn(De,"size");gn(De,"dragBoundFunc");gn(De,"draggable",!1,Mi());K.backCompat(De,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});class jr extends De{constructor(){super(...arguments),this.children=[]}getChildren(e){const n=this.children||[];return e?n.filter(e):n}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.destroy()}),this.children=[],this._requestDraw(),this}add(...e){if(e.length===0)return this;if(e.length>1){for(let s=0;s<e.length;s++)this.add(e[s]);return this}const n=e[0];return n.getParent()?(n.moveTo(this),this):(this._validateAdd(n),n.index=this.getChildren().length,n.parent=this,n._clearCaches(),this.getChildren().push(n),this._fire("add",{child:n}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(e){return this._generalFind(e,!1)}findOne(e){const n=this._generalFind(e,!0);return n.length>0?n[0]:void 0}_generalFind(e,n){const s=[];return this._descendants(i=>{const o=i._isMatch(e);return o&&s.push(i),!!(o&&n)}),s}_descendants(e){let n=!1;const s=this.getChildren();for(const i of s){if(n=e(i),n)return!0;if(i.hasChildren()&&(n=i._descendants(e),n))return!0}return!1}toObject(){const e=De.prototype.toObject.call(this);return e.children=[],this.getChildren().forEach(n=>{e.children.push(n.toObject())}),e}isAncestorOf(e){let n=e.getParent();for(;n;){if(n._id===this._id)return!0;n=n.getParent()}return!1}clone(e){const n=De.prototype.clone.call(this,e);return this.getChildren().forEach(function(s){n.add(s.clone())}),n}getAllIntersections(e){const n=[];return this.find("Shape").forEach(s=>{s.isVisible()&&s.intersects(e)&&n.push(s)}),n}_clearSelfAndDescendantCache(e){var n;super._clearSelfAndDescendantCache(e),!this.isCached()&&((n=this.children)===null||n===void 0||n.forEach(function(s){s._clearSelfAndDescendantCache(e)}))}_setChildrenIndices(){var e;(e=this.children)===null||e===void 0||e.forEach(function(n,s){n.index=s}),this._requestDraw()}drawScene(e,n,s){const i=this.getLayer(),o=e||i&&i.getCanvas(),d=o&&o.getContext(),f=this._getCanvasCache(),p=f&&f.scene,y=o&&o.isCache;if(!this.isVisible()&&!y)return this;if(p){d.save();const S=this.getAbsoluteTransform(n).getMatrix();d.transform(S[0],S[1],S[2],S[3],S[4],S[5]),this._drawCachedSceneCanvas(d),d.restore()}else this._drawChildren("drawScene",o,n,s);return this}drawHit(e,n){if(!this.shouldDrawHit(n))return this;const s=this.getLayer(),i=e||s&&s.hitCanvas,o=i&&i.getContext(),d=this._getCanvasCache();if(d&&d.hit){o.save();const p=this.getAbsoluteTransform(n).getMatrix();o.transform(p[0],p[1],p[2],p[3],p[4],p[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",i,n);return this}_drawChildren(e,n,s,i){var o;const d=n&&n.getContext(),f=this.clipWidth(),p=this.clipHeight(),y=this.clipFunc(),S=typeof f=="number"&&typeof p=="number"||y,b=s===this;if(S){d.save();const j=this.getAbsoluteTransform(s);let w=j.getMatrix();d.transform(w[0],w[1],w[2],w[3],w[4],w[5]),d.beginPath();let T;if(y)T=y.call(this,d,this);else{const O=this.clipX(),R=this.clipY();d.rect(O||0,R||0,f,p)}d.clip.apply(d,T),w=j.copy().invert().getMatrix(),d.transform(w[0],w[1],w[2],w[3],w[4],w[5])}const _=!b&&this.globalCompositeOperation()!=="source-over"&&e==="drawScene";_&&(d.save(),d._applyGlobalCompositeOperation(this)),(o=this.children)===null||o===void 0||o.forEach(function(j){j[e](n,s,i)}),_&&d.restore(),S&&d.restore()}getClientRect(e={}){var n;const s=e.skipTransform,i=e.relativeTo;let o,d,f,p,y={x:1/0,y:1/0,width:0,height:0};const S=this;(n=this.children)===null||n===void 0||n.forEach(function(j){if(!j.visible())return;const w=j.getClientRect({relativeTo:S,skipShadow:e.skipShadow,skipStroke:e.skipStroke});w.width===0&&w.height===0||(o===void 0?(o=w.x,d=w.y,f=w.x+w.width,p=w.y+w.height):(o=Math.min(o,w.x),d=Math.min(d,w.y),f=Math.max(f,w.x+w.width),p=Math.max(p,w.y+w.height)))});const b=this.find("Shape");let _=!1;for(let j=0;j<b.length;j++)if(b[j]._isVisible(this)){_=!0;break}return _&&o!==void 0?y={x:o,y:d,width:f-o,height:p-d}:y={x:0,y:0,width:0,height:0},s?y:this._transformedRect(y,i)}}K.addComponentsGetterSetter(jr,"clip",["x","y","width","height"]);K.addGetterSetter(jr,"clipX",void 0,Oe());K.addGetterSetter(jr,"clipY",void 0,Oe());K.addGetterSetter(jr,"clipWidth",void 0,Oe());K.addGetterSetter(jr,"clipHeight",void 0,Oe());K.addGetterSetter(jr,"clipFunc");const Lm=new Map,N8=ke._global.PointerEvent!==void 0;function jx(t){return Lm.get(t)}function Dv(t){return{evt:t,pointerId:t.pointerId}}function _8(t,e){return Lm.get(t)===e}function C8(t,e){vm(t),e.getStage()&&(Lm.set(t,e),N8&&e._fire("gotpointercapture",Dv(new PointerEvent("gotpointercapture"))))}function vm(t,e){const n=Lm.get(t);if(!n)return;const s=n.getStage();s&&s.content,Lm.delete(t),N8&&n._fire("lostpointercapture",Dv(new PointerEvent("lostpointercapture")))}const $D="Stage",ez="string",R5="px",tz="mouseout",j8="mouseleave",w8="mouseover",E8="mouseenter",T8="mousemove",R8="mousedown",O8="mouseup",um="pointermove",dm="pointerdown",Df="pointerup",fm="pointercancel",nz="lostpointercapture",s1="pointerout",hm="pointerleave",r1="pointerover",i1="pointerenter",Mb="contextmenu",M8="touchstart",A8="touchend",D8="touchmove",z8="touchcancel",Ab="wheel",az=5,sz=[[E8,"_pointerenter"],[R8,"_pointerdown"],[T8,"_pointermove"],[O8,"_pointerup"],[j8,"_pointerleave"],[M8,"_pointerdown"],[D8,"_pointermove"],[A8,"_pointerup"],[z8,"_pointercancel"],[w8,"_pointerover"],[Ab,"_wheel"],[Mb,"_contextmenu"],[dm,"_pointerdown"],[um,"_pointermove"],[Df,"_pointerup"],[fm,"_pointercancel"],[hm,"_pointerleave"],[nz,"_lostpointercapture"]],wx={mouse:{[s1]:tz,[hm]:j8,[r1]:w8,[i1]:E8,[um]:T8,[dm]:R8,[Df]:O8,[fm]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[s1]:"touchout",[hm]:"touchleave",[r1]:"touchover",[i1]:"touchenter",[um]:D8,[dm]:M8,[Df]:A8,[fm]:z8,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[s1]:s1,[hm]:hm,[r1]:r1,[i1]:i1,[um]:um,[dm]:dm,[Df]:Df,[fm]:fm,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},pm=t=>t.indexOf("pointer")>=0?"pointer":t.indexOf("touch")>=0?"touch":"mouse",Ef=t=>{const e=pm(t);if(e==="pointer")return ke.pointerEventsEnabled&&wx.pointer;if(e==="touch")return wx.touch;if(e==="mouse")return wx.mouse};function O5(t={}){return(t.clipFunc||t.clipWidth||t.clipHeight)&&ee.warn("Stage does not support clipping. Please use clip for Layers or Groups."),t}const rz="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);",Sm=[];let oy=class extends jr{constructor(e){super(O5(e)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),Sm.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{O5(this.attrs)}),this._checkVisibility()}_validateAdd(e){const n=e.getType()==="Layer",s=e.getType()==="FastLayer";n||s||ee.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const e=this.visible()?"":"none";this.content.style.display=e}setContainer(e){if(typeof e===ez){let n;if(e.charAt(0)==="."){const s=e.slice(1);e=document.getElementsByClassName(s)[0]}else e.charAt(0)!=="#"?n=e:n=e.slice(1),e=document.getElementById(n);if(!e)throw"Can not find container in document with id "+n}return this._setAttr("container",e),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),e.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){const e=this.children,n=e.length;for(let s=0;s<n;s++)e[s].clear();return this}clone(e){return e||(e={}),e.container=typeof document<"u"&&document.createElement("div"),jr.prototype.clone.call(this,e)}destroy(){super.destroy();const e=this.content;e&&ee._isInDocument(e)&&this.container().removeChild(e);const n=Sm.indexOf(this);return n>-1&&Sm.splice(n,1),ee.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const e=this._pointerPositions[0]||this._changedPointerPositions[0];return e?{x:e.x,y:e.y}:(ee.warn(rz),null)}_getPointerById(e){return this._pointerPositions.find(n=>n.id===e)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(e){e={...e},e.x=e.x||0,e.y=e.y||0,e.width=e.width||this.width(),e.height=e.height||this.height();const n=new xc({width:e.width,height:e.height,pixelRatio:e.pixelRatio||1}),s=n.getContext()._context,i=this.children;return(e.x||e.y)&&s.translate(-1*e.x,-1*e.y),i.forEach(function(o){if(!o.isVisible())return;const d=o._toKonvaCanvas(e);s.drawImage(d._canvas,e.x,e.y,d.getWidth()/d.getPixelRatio(),d.getHeight()/d.getPixelRatio())}),n}getIntersection(e){if(!e)return null;const n=this.children,s=n.length,i=s-1;for(let o=i;o>=0;o--){const d=n[o].getIntersection(e);if(d)return d}return null}_resizeDOM(){const e=this.width(),n=this.height();this.content&&(this.content.style.width=e+R5,this.content.style.height=n+R5),this.bufferCanvas.setSize(e,n),this.bufferHitCanvas.setSize(e,n),this.children.forEach(s=>{s.setSize({width:e,height:n}),s.draw()})}add(e,...n){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.add(arguments[i]);return this}super.add(e);const s=this.children.length;return s>az&&ee.warn("The stage has "+s+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),e.setSize({width:this.width(),height:this.height()}),e.draw(),ke.isBrowser&&this.content.appendChild(e.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(e){return _8(e,this)}setPointerCapture(e){C8(e,this)}releaseCapture(e){vm(e)}getLayers(){return this.children}_bindContentEvents(){ke.isBrowser&&sz.forEach(([e,n])=>{this.content.addEventListener(e,s=>{this[n](s)},{passive:!1})})}_pointerenter(e){this.setPointersPositions(e);const n=Ef(e.type);n&&this._fire(n.pointerenter,{evt:e,target:this,currentTarget:this})}_pointerover(e){this.setPointersPositions(e);const n=Ef(e.type);n&&this._fire(n.pointerover,{evt:e,target:this,currentTarget:this})}_getTargetShape(e){let n=this[e+"targetShape"];return n&&!n.getStage()&&(n=null),n}_pointerleave(e){const n=Ef(e.type),s=pm(e.type);if(!n)return;this.setPointersPositions(e);const i=this._getTargetShape(s),o=!(ke.isDragging()||ke.isTransforming())||ke.hitOnDragEnabled;i&&o?(i._fireAndBubble(n.pointerout,{evt:e}),i._fireAndBubble(n.pointerleave,{evt:e}),this._fire(n.pointerleave,{evt:e,target:this,currentTarget:this}),this[s+"targetShape"]=null):o&&(this._fire(n.pointerleave,{evt:e,target:this,currentTarget:this}),this._fire(n.pointerout,{evt:e,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(e){const n=Ef(e.type),s=pm(e.type);if(!n)return;this.setPointersPositions(e);let i=!1;this._changedPointerPositions.forEach(o=>{const d=this.getIntersection(o);if(Yt.justDragged=!1,ke["_"+s+"ListenClick"]=!0,!d||!d.isListening()){this[s+"ClickStartShape"]=void 0;return}ke.capturePointerEventsEnabled&&d.setPointerCapture(o.id),this[s+"ClickStartShape"]=d,d._fireAndBubble(n.pointerdown,{evt:e,pointerId:o.id}),i=!0;const f=e.type.indexOf("touch")>=0;d.preventDefault()&&e.cancelable&&f&&e.preventDefault()}),i||this._fire(n.pointerdown,{evt:e,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(e){const n=Ef(e.type),s=pm(e.type);if(!n)return;const i=e.type.indexOf("touch")>=0||e.pointerType==="touch";if(ke.isDragging()&&Yt.node.preventDefault()&&e.cancelable&&i&&e.preventDefault(),this.setPointersPositions(e),!(!(ke.isDragging()||ke.isTransforming())||ke.hitOnDragEnabled))return;const d={};let f=!1;const p=this._getTargetShape(s);this._changedPointerPositions.forEach(y=>{const S=jx(y.id)||this.getIntersection(y),b=y.id,_={evt:e,pointerId:b},j=p!==S;if(j&&p&&(p._fireAndBubble(n.pointerout,{..._},S),p._fireAndBubble(n.pointerleave,{..._},S)),S){if(d[S._id])return;d[S._id]=!0}S&&S.isListening()?(f=!0,j&&(S._fireAndBubble(n.pointerover,{..._},p),S._fireAndBubble(n.pointerenter,{..._},p),this[s+"targetShape"]=S),S._fireAndBubble(n.pointermove,{..._})):p&&(this._fire(n.pointerover,{evt:e,target:this,currentTarget:this,pointerId:b}),this[s+"targetShape"]=null)}),f||this._fire(n.pointermove,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(e){const n=Ef(e.type),s=pm(e.type);if(!n)return;this.setPointersPositions(e);const i=this[s+"ClickStartShape"],o=this[s+"ClickEndShape"],d={};let f=!1;this._changedPointerPositions.forEach(p=>{const y=jx(p.id)||this.getIntersection(p);if(y){if(y.releaseCapture(p.id),d[y._id])return;d[y._id]=!0}const S=p.id,b={evt:e,pointerId:S};let _=!1;ke["_"+s+"InDblClickWindow"]?(_=!0,clearTimeout(this[s+"DblTimeout"])):Yt.justDragged||(ke["_"+s+"InDblClickWindow"]=!0,clearTimeout(this[s+"DblTimeout"])),this[s+"DblTimeout"]=setTimeout(function(){ke["_"+s+"InDblClickWindow"]=!1},ke.dblClickWindow),y&&y.isListening()?(f=!0,this[s+"ClickEndShape"]=y,y._fireAndBubble(n.pointerup,{...b}),ke["_"+s+"ListenClick"]&&i&&i===y&&(y._fireAndBubble(n.pointerclick,{...b}),_&&o&&o===y&&y._fireAndBubble(n.pointerdblclick,{...b}))):(this[s+"ClickEndShape"]=null,f||(this._fire(n.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),f=!0),ke["_"+s+"ListenClick"]&&this._fire(n.pointerclick,{evt:e,target:this,currentTarget:this,pointerId:S}),_&&this._fire(n.pointerdblclick,{evt:e,target:this,currentTarget:this,pointerId:S}))}),f||this._fire(n.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),ke["_"+s+"ListenClick"]=!1,e.cancelable&&s!=="touch"&&s!=="pointer"&&e.preventDefault()}_contextmenu(e){this.setPointersPositions(e);const n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(Mb,{evt:e}):this._fire(Mb,{evt:e,target:this,currentTarget:this})}_wheel(e){this.setPointersPositions(e);const n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(Ab,{evt:e}):this._fire(Ab,{evt:e,target:this,currentTarget:this})}_pointercancel(e){this.setPointersPositions(e);const n=jx(e.pointerId)||this.getIntersection(this.getPointerPosition());n&&n._fireAndBubble(Df,Dv(e)),vm(e.pointerId)}_lostpointercapture(e){vm(e.pointerId)}setPointersPositions(e){const n=this._getContentPosition();let s=null,i=null;e=e||window.event,e.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(e.touches,o=>{this._pointerPositions.push({id:o.identifier,x:(o.clientX-n.left)/n.scaleX,y:(o.clientY-n.top)/n.scaleY})}),Array.prototype.forEach.call(e.changedTouches||e.touches,o=>{this._changedPointerPositions.push({id:o.identifier,x:(o.clientX-n.left)/n.scaleX,y:(o.clientY-n.top)/n.scaleY})})):(s=(e.clientX-n.left)/n.scaleX,i=(e.clientY-n.top)/n.scaleY,this.pointerPos={x:s,y:i},this._pointerPositions=[{x:s,y:i,id:ee._getFirstPointerId(e)}],this._changedPointerPositions=[{x:s,y:i,id:ee._getFirstPointerId(e)}])}_setPointerPosition(e){ee.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(e)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};const e=this.content.getBoundingClientRect();return{top:e.top,left:e.left,scaleX:e.width/this.content.clientWidth||1,scaleY:e.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new xc({width:this.width(),height:this.height()}),this.bufferHitCanvas=new Mv({pixelRatio:1,width:this.width(),height:this.height()}),!ke.isBrowser)return;const e=this.container();if(!e)throw"Stage has no container. A container is required.";e.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),e.appendChild(this.content),this._resizeDOM()}cache(){return ee.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(e){e.batchDraw()}),this}};oy.prototype.nodeType=$D;ea(oy);K.addGetterSetter(oy,"container");ke.isBrowser&&document.addEventListener("visibilitychange",()=>{Sm.forEach(t=>{t.batchDraw()})});const k8="hasShadow",L8="shadowRGBA",U8="patternImage",q8="linearGradient",H8="radialGradient";let l1;function Ex(){return l1||(l1=ee.createCanvasElement().getContext("2d"),l1)}const Nm={};function iz(t){const e=this.attrs.fillRule;e?t.fill(e):t.fill()}function lz(t){t.stroke()}function oz(t){const e=this.attrs.fillRule;e?t.fill(e):t.fill()}function cz(t){t.stroke()}function uz(){this._clearCache(k8)}function dz(){this._clearCache(L8)}function fz(){this._clearCache(U8)}function hz(){this._clearCache(q8)}function pz(){this._clearCache(H8)}class Te extends De{constructor(e){super(e);let n,s=0;for(;n=ee.getHitColor(),!(n&&!(n in Nm));)if(s++,s>=1e4){ee.warn("Failed to find a unique color key for a shape. Konva may work incorrectly. Most likely your browser is using canvas farbling. Consider disabling it."),n=ee.getRandomColor();break}this.colorKey=n,Nm[n]=this}getContext(){return ee.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return ee.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(k8,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(U8,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const n=Ex().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(n&&n.setTransform){const s=new Cr;s.translate(this.fillPatternX(),this.fillPatternY()),s.rotate(ke.getAngle(this.fillPatternRotation())),s.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),s.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const i=s.getMatrix(),o=typeof DOMMatrix>"u"?{a:i[0],b:i[1],c:i[2],d:i[3],e:i[4],f:i[5]}:new DOMMatrix(i);n.setTransform(o)}return n}}_getLinearGradient(){return this._getCache(q8,this.__getLinearGradient)}__getLinearGradient(){const e=this.fillLinearGradientColorStops();if(e){const n=Ex(),s=this.fillLinearGradientStartPoint(),i=this.fillLinearGradientEndPoint(),o=n.createLinearGradient(s.x,s.y,i.x,i.y);for(let d=0;d<e.length;d+=2)o.addColorStop(e[d],e[d+1]);return o}}_getRadialGradient(){return this._getCache(H8,this.__getRadialGradient)}__getRadialGradient(){const e=this.fillRadialGradientColorStops();if(e){const n=Ex(),s=this.fillRadialGradientStartPoint(),i=this.fillRadialGradientEndPoint(),o=n.createRadialGradient(s.x,s.y,this.fillRadialGradientStartRadius(),i.x,i.y,this.fillRadialGradientEndRadius());for(let d=0;d<e.length;d+=2)o.addColorStop(e[d],e[d+1]);return o}}getShadowRGBA(){return this._getCache(L8,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;const e=ee.colorToRGBA(this.shadowColor());if(e)return"rgba("+e.r+","+e.g+","+e.b+","+e.a*(this.shadowOpacity()||1)+")"}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const e=this.hitStrokeWidth();return e==="auto"?this.hasStroke():this.strokeEnabled()&&!!e}intersects(e){const n=this.getStage();if(!n)return!1;const s=n.bufferHitCanvas;return s.getContext().clear(),this.drawHit(s,void 0,!0),s.context.getImageData(Math.round(e.x),Math.round(e.y),1,1).data[3]>0}destroy(){return De.prototype.destroy.call(this),delete Nm[this.colorKey],delete this.colorKey,this}_useBufferCanvas(e){var n;if(!((n=this.attrs.perfectDrawEnabled)!==null&&n!==void 0?n:!0))return!1;const i=e||this.hasFill(),o=this.hasStroke(),d=this.getAbsoluteOpacity()!==1;if(i&&o&&d)return!0;const f=this.hasShadow(),p=this.shadowForStrokeEnabled();return!!(i&&o&&f&&p)}setStrokeHitEnabled(e){ee.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),e?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){const e=this.size();return{x:this._centroid?-e.width/2:0,y:this._centroid?-e.height/2:0,width:e.width,height:e.height}}getClientRect(e={}){let n=!1,s=this.getParent();for(;s;){if(s.isCached()){n=!0;break}s=s.getParent()}const i=e.skipTransform,o=e.relativeTo||n&&this.getStage()||void 0,d=this.getSelfRect(),p=!e.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,y=d.width+p,S=d.height+p,b=!e.skipShadow&&this.hasShadow(),_=b?this.shadowOffsetX():0,j=b?this.shadowOffsetY():0,w=y+Math.abs(_),T=S+Math.abs(j),O=b&&this.shadowBlur()||0,R=w+O*2,M=T+O*2,z={width:R,height:M,x:-(p/2+O)+Math.min(_,0)+d.x,y:-(p/2+O)+Math.min(j,0)+d.y};return i?z:this._transformedRect(z,o)}drawScene(e,n,s){const i=this.getLayer(),o=e||i.getCanvas(),d=o.getContext(),f=this._getCanvasCache(),p=this.getSceneFunc(),y=this.hasShadow();let S;const b=n===this;if(!this.isVisible()&&!b)return this;if(f){d.save();const _=this.getAbsoluteTransform(n).getMatrix();return d.transform(_[0],_[1],_[2],_[3],_[4],_[5]),this._drawCachedSceneCanvas(d),d.restore(),this}if(!p)return this;if(d.save(),this._useBufferCanvas()){S=this.getStage();const _=s||S.bufferCanvas,j=_.getContext();s?(j.save(),j.setTransform(1,0,0,1,0,0),j.clearRect(0,0,_.width,_.height),j.restore()):j.clear(),j.save(),j._applyLineJoin(this),j._applyMiterLimit(this);const w=this.getAbsoluteTransform(n).getMatrix();j.transform(w[0],w[1],w[2],w[3],w[4],w[5]),p.call(this,j,this),j.restore();const T=_.pixelRatio;y&&d._applyShadow(this),b||(d._applyOpacity(this),d._applyGlobalCompositeOperation(this)),d.drawImage(_._canvas,_.x||0,_.y||0,_.width/T,_.height/T)}else{if(d._applyLineJoin(this),d._applyMiterLimit(this),!b){const _=this.getAbsoluteTransform(n).getMatrix();d.transform(_[0],_[1],_[2],_[3],_[4],_[5]),d._applyOpacity(this),d._applyGlobalCompositeOperation(this)}y&&d._applyShadow(this),p.call(this,d,this)}return d.restore(),this}drawHit(e,n,s=!1){if(!this.shouldDrawHit(n,s))return this;const i=this.getLayer(),o=e||i.hitCanvas,d=o&&o.getContext(),f=this.hitFunc()||this.sceneFunc(),p=this._getCanvasCache(),y=p&&p.hit;if(this.colorKey||ee.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),y){d.save();const b=this.getAbsoluteTransform(n).getMatrix();return d.transform(b[0],b[1],b[2],b[3],b[4],b[5]),this._drawCachedHitCanvas(d),d.restore(),this}if(!f)return this;if(d.save(),d._applyLineJoin(this),d._applyMiterLimit(this),!(this===n)){const b=this.getAbsoluteTransform(n).getMatrix();d.transform(b[0],b[1],b[2],b[3],b[4],b[5])}return f.call(this,d,this),d.restore(),this}drawHitFromCache(e=0){const n=this._getCanvasCache(),s=this._getCachedSceneCanvas(),i=n.hit,o=i.getContext(),d=i.getWidth(),f=i.getHeight();o.clear(),o.drawImage(s._canvas,0,0,d,f);try{const p=o.getImageData(0,0,d,f),y=p.data,S=y.length,b=ee._hexToRgb(this.colorKey);for(let _=0;_<S;_+=4)y[_+3]>e?(y[_]=b.r,y[_+1]=b.g,y[_+2]=b.b,y[_+3]=255):y[_+3]=0;o.putImageData(p,0,0)}catch(p){ee.error("Unable to draw hit graph from cached scene canvas. "+p.message)}return this}hasPointerCapture(e){return _8(e,this)}setPointerCapture(e){C8(e,this)}releaseCapture(e){vm(e)}}Te.prototype._fillFunc=iz;Te.prototype._strokeFunc=lz;Te.prototype._fillFuncHit=oz;Te.prototype._strokeFuncHit=cz;Te.prototype._centroid=!1;Te.prototype.nodeType="Shape";ea(Te);Te.prototype.eventListeners={};Te.prototype.on("shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",uz);Te.prototype.on("shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",dz);Te.prototype.on("fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",fz);Te.prototype.on("fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",hz);Te.prototype.on("fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",pz);K.addGetterSetter(Te,"stroke",void 0,S8());K.addGetterSetter(Te,"strokeWidth",2,Oe());K.addGetterSetter(Te,"fillAfterStrokeEnabled",!1);K.addGetterSetter(Te,"hitStrokeWidth","auto",Av());K.addGetterSetter(Te,"strokeHitEnabled",!0,Mi());K.addGetterSetter(Te,"perfectDrawEnabled",!0,Mi());K.addGetterSetter(Te,"shadowForStrokeEnabled",!0,Mi());K.addGetterSetter(Te,"lineJoin");K.addGetterSetter(Te,"lineCap");K.addGetterSetter(Te,"miterLimit");K.addGetterSetter(Te,"sceneFunc");K.addGetterSetter(Te,"hitFunc");K.addGetterSetter(Te,"dash");K.addGetterSetter(Te,"dashOffset",0,Oe());K.addGetterSetter(Te,"shadowColor",void 0,rd());K.addGetterSetter(Te,"shadowBlur",0,Oe());K.addGetterSetter(Te,"shadowOpacity",1,Oe());K.addComponentsGetterSetter(Te,"shadowOffset",["x","y"]);K.addGetterSetter(Te,"shadowOffsetX",0,Oe());K.addGetterSetter(Te,"shadowOffsetY",0,Oe());K.addGetterSetter(Te,"fillPatternImage");K.addGetterSetter(Te,"fill",void 0,S8());K.addGetterSetter(Te,"fillPatternX",0,Oe());K.addGetterSetter(Te,"fillPatternY",0,Oe());K.addGetterSetter(Te,"fillLinearGradientColorStops");K.addGetterSetter(Te,"strokeLinearGradientColorStops");K.addGetterSetter(Te,"fillRadialGradientStartRadius",0);K.addGetterSetter(Te,"fillRadialGradientEndRadius",0);K.addGetterSetter(Te,"fillRadialGradientColorStops");K.addGetterSetter(Te,"fillPatternRepeat","repeat");K.addGetterSetter(Te,"fillEnabled",!0);K.addGetterSetter(Te,"strokeEnabled",!0);K.addGetterSetter(Te,"shadowEnabled",!0);K.addGetterSetter(Te,"dashEnabled",!0);K.addGetterSetter(Te,"strokeScaleEnabled",!0);K.addGetterSetter(Te,"fillPriority","color");K.addComponentsGetterSetter(Te,"fillPatternOffset",["x","y"]);K.addGetterSetter(Te,"fillPatternOffsetX",0,Oe());K.addGetterSetter(Te,"fillPatternOffsetY",0,Oe());K.addComponentsGetterSetter(Te,"fillPatternScale",["x","y"]);K.addGetterSetter(Te,"fillPatternScaleX",1,Oe());K.addGetterSetter(Te,"fillPatternScaleY",1,Oe());K.addComponentsGetterSetter(Te,"fillLinearGradientStartPoint",["x","y"]);K.addComponentsGetterSetter(Te,"strokeLinearGradientStartPoint",["x","y"]);K.addGetterSetter(Te,"fillLinearGradientStartPointX",0);K.addGetterSetter(Te,"strokeLinearGradientStartPointX",0);K.addGetterSetter(Te,"fillLinearGradientStartPointY",0);K.addGetterSetter(Te,"strokeLinearGradientStartPointY",0);K.addComponentsGetterSetter(Te,"fillLinearGradientEndPoint",["x","y"]);K.addComponentsGetterSetter(Te,"strokeLinearGradientEndPoint",["x","y"]);K.addGetterSetter(Te,"fillLinearGradientEndPointX",0);K.addGetterSetter(Te,"strokeLinearGradientEndPointX",0);K.addGetterSetter(Te,"fillLinearGradientEndPointY",0);K.addGetterSetter(Te,"strokeLinearGradientEndPointY",0);K.addComponentsGetterSetter(Te,"fillRadialGradientStartPoint",["x","y"]);K.addGetterSetter(Te,"fillRadialGradientStartPointX",0);K.addGetterSetter(Te,"fillRadialGradientStartPointY",0);K.addComponentsGetterSetter(Te,"fillRadialGradientEndPoint",["x","y"]);K.addGetterSetter(Te,"fillRadialGradientEndPointX",0);K.addGetterSetter(Te,"fillRadialGradientEndPointY",0);K.addGetterSetter(Te,"fillPatternRotation",0);K.addGetterSetter(Te,"fillRule",void 0,rd());K.backCompat(Te,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});const mz="beforeDraw",gz="draw",B8=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],yz=B8.length;let id=class extends jr{constructor(e){super(e),this.canvas=new xc,this.hitCanvas=new Mv({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(e){return this.getContext().clear(e),this.getHitCanvas().getContext().clear(e),this}setZIndex(e){super.setZIndex(e);const n=this.getStage();return n&&n.content&&(n.content.removeChild(this.getNativeCanvasElement()),e<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[e+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){De.prototype.moveToTop.call(this);const e=this.getStage();return e&&e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!De.prototype.moveUp.call(this))return!1;const n=this.getStage();return!n||!n.content?!1:(n.content.removeChild(this.getNativeCanvasElement()),this.index<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[this.index+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(De.prototype.moveDown.call(this)){const e=this.getStage();if(e){const n=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),n[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(De.prototype.moveToBottom.call(this)){const e=this.getStage();if(e){const n=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),n[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){const e=this.getNativeCanvasElement();return De.prototype.remove.call(this),e&&e.parentNode&&ee._isInDocument(e)&&e.parentNode.removeChild(e),this}getStage(){return this.parent}setSize({width:e,height:n}){return this.canvas.setSize(e,n),this.hitCanvas.setSize(e,n),this._setSmoothEnabled(),this}_validateAdd(e){const n=e.getType();n!=="Group"&&n!=="Shape"&&ee.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(e){return e={...e},e.width=e.width||this.getWidth(),e.height=e.height||this.getHeight(),e.x=e.x!==void 0?e.x:this.x(),e.y=e.y!==void 0?e.y:this.y(),De.prototype._toKonvaCanvas.call(this,e)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){ee.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){ee.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,ee.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(e){if(!this.isListening()||!this.isVisible())return null;let n=1,s=!1;for(;;){for(let i=0;i<yz;i++){const o=B8[i],d=this._getIntersection({x:e.x+o.x*n,y:e.y+o.y*n}),f=d.shape;if(f)return f;if(s=!!d.antialiased,!d.antialiased)break}if(s)n+=1;else return null}}_getIntersection(e){const n=this.hitCanvas.pixelRatio,s=this.hitCanvas.context.getImageData(Math.round(e.x*n),Math.round(e.y*n),1,1).data,i=s[3];if(i===255){const o=ee.getHitColorKey(s[0],s[1],s[2]),d=Nm[o];return d?{shape:d}:{antialiased:!0}}else if(i>0)return{antialiased:!0};return{}}drawScene(e,n,s){const i=this.getLayer(),o=e||i&&i.getCanvas();return this._fire(mz,{node:this}),this.clearBeforeDraw()&&o.getContext().clear(),jr.prototype.drawScene.call(this,o,n,s),this._fire(gz,{node:this}),this}drawHit(e,n){const s=this.getLayer(),i=e||s&&s.hitCanvas;return s&&s.clearBeforeDraw()&&s.getHitCanvas().getContext().clear(),jr.prototype.drawHit.call(this,i,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(e){ee.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(e)}getHitGraphEnabled(e){return ee.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;const e=this.parent;!!this.hitCanvas._canvas.parentNode?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}destroy(){return ee.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};id.prototype.nodeType="Layer";ea(id);K.addGetterSetter(id,"imageSmoothingEnabled",!0);K.addGetterSetter(id,"clearBeforeDraw",!0);K.addGetterSetter(id,"hitGraphEnabled",!0,Mi());class zv extends id{constructor(e){super(e),this.listening(!1),ee.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}zv.prototype.nodeType="FastLayer";ea(zv);let ah=class extends jr{_validateAdd(e){const n=e.getType();n!=="Group"&&n!=="Shape"&&ee.throw("You may only add groups and shapes to groups.")}};ah.prototype.nodeType="Group";ea(ah);const Tx=(function(){return qu.performance&&qu.performance.now?function(){return qu.performance.now()}:function(){return new Date().getTime()}})();class si{constructor(e,n){this.id=si.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:Tx(),frameRate:0},this.func=e,this.setLayers(n)}setLayers(e){let n=[];return e&&(n=Array.isArray(e)?e:[e]),this.layers=n,this}getLayers(){return this.layers}addLayer(e){const n=this.layers,s=n.length;for(let i=0;i<s;i++)if(n[i]._id===e._id)return!1;return this.layers.push(e),!0}isRunning(){const n=si.animations,s=n.length;for(let i=0;i<s;i++)if(n[i].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=Tx(),si._addAnimation(this),this}stop(){return si._removeAnimation(this),this}_updateFrameObject(e){this.frame.timeDiff=e-this.frame.lastTime,this.frame.lastTime=e,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(e){this.animations.push(e),this._handleAnimation()}static _removeAnimation(e){const n=e.id,s=this.animations,i=s.length;for(let o=0;o<i;o++)if(s[o].id===n){this.animations.splice(o,1);break}}static _runFrames(){const e={},n=this.animations;for(let s=0;s<n.length;s++){const i=n[s],o=i.layers,d=i.func;i._updateFrameObject(Tx());const f=o.length;let p;if(d?p=d.call(i,i.frame)!==!1:p=!0,!!p)for(let y=0;y<f;y++){const S=o[y];S._id!==void 0&&(e[S._id]=S)}}for(const s in e)e.hasOwnProperty(s)&&e[s].batchDraw()}static _animationLoop(){const e=si;e.animations.length?(e._runFrames(),ee.requestAnimFrame(e._animationLoop)):e.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,ee.requestAnimFrame(this._animationLoop))}}si.animations=[];si.animIdCounter=0;si.animRunning=!1;const xz={node:1,duration:1,easing:1,onFinish:1,yoyo:1},bz=1,M5=2,A5=3,D5=["fill","stroke","shadowColor"];let vz=0;class Sz{constructor(e,n,s,i,o,d,f){this.prop=e,this.propFunc=n,this.begin=i,this._pos=i,this.duration=d,this._change=0,this.prevPos=0,this.yoyo=f,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=s,this._change=o-this.begin,this.pause()}fire(e){const n=this[e];n&&n()}setTime(e){e>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():e<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=e,this.update())}getTime(){return this._time}setPosition(e){this.prevPos=this._pos,this.propFunc(e),this._pos=e}getPosition(e){return e===void 0&&(e=this._time),this.func(e,this.begin,this._change,this.duration)}play(){this.state=M5,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=A5,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(e){this.pause(),this._time=e,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){const e=this.getTimer()-this._startTime;this.state===M5?this.setTime(e):this.state===A5&&this.setTime(this.duration-e)}pause(){this.state=bz,this.fire("onPause")}getTimer(){return new Date().getTime()}}class _n{constructor(e){const n=this,s=e.node,i=s._id,o=e.easing||_m.Linear,d=!!e.yoyo;let f,p;typeof e.duration>"u"?f=.3:e.duration===0?f=.001:f=e.duration,this.node=s,this._id=vz++;const y=s.getLayer()||(s instanceof ke.Stage?s.getLayers():null);y||ee.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new si(function(){n.tween.onEnterFrame()},y),this.tween=new Sz(p,function(S){n._tweenFunc(S)},o,0,1,f*1e3,d),this._addListeners(),_n.attrs[i]||(_n.attrs[i]={}),_n.attrs[i][this._id]||(_n.attrs[i][this._id]={}),_n.tweens[i]||(_n.tweens[i]={});for(p in e)xz[p]===void 0&&this._addAttr(p,e[p]);this.reset(),this.onFinish=e.onFinish,this.onReset=e.onReset,this.onUpdate=e.onUpdate}_addAttr(e,n){const s=this.node,i=s._id;let o,d,f,p,y;const S=_n.tweens[i][e];S&&delete _n.attrs[i][S][e];let b=s.getAttr(e);if(ee._isArray(n))if(o=[],d=Math.max(n.length,b.length),e==="points"&&n.length!==b.length&&(n.length>b.length?(p=b,b=ee._prepareArrayForTween(b,n,s.closed())):(f=n,n=ee._prepareArrayForTween(n,b,s.closed()))),e.indexOf("fill")===0)for(let _=0;_<d;_++)if(_%2===0)o.push(n[_]-b[_]);else{const j=ee.colorToRGBA(b[_]);y=ee.colorToRGBA(n[_]),b[_]=j,o.push({r:y.r-j.r,g:y.g-j.g,b:y.b-j.b,a:y.a-j.a})}else for(let _=0;_<d;_++)o.push(n[_]-b[_]);else D5.indexOf(e)!==-1?(b=ee.colorToRGBA(b),y=ee.colorToRGBA(n),o={r:y.r-b.r,g:y.g-b.g,b:y.b-b.b,a:y.a-b.a}):o=n-b;_n.attrs[i][this._id][e]={start:b,diff:o,end:n,trueEnd:f,trueStart:p},_n.tweens[i][e]=this._id}_tweenFunc(e){const n=this.node,s=_n.attrs[n._id][this._id];let i,o,d,f,p,y,S,b;for(i in s){if(o=s[i],d=o.start,f=o.diff,b=o.end,ee._isArray(d))if(p=[],S=Math.max(d.length,b.length),i.indexOf("fill")===0)for(y=0;y<S;y++)y%2===0?p.push((d[y]||0)+f[y]*e):p.push("rgba("+Math.round(d[y].r+f[y].r*e)+","+Math.round(d[y].g+f[y].g*e)+","+Math.round(d[y].b+f[y].b*e)+","+(d[y].a+f[y].a*e)+")");else for(y=0;y<S;y++)p.push((d[y]||0)+f[y]*e);else D5.indexOf(i)!==-1?p="rgba("+Math.round(d.r+f.r*e)+","+Math.round(d.g+f.g*e)+","+Math.round(d.b+f.b*e)+","+(d.a+f.a*e)+")":p=d+f*e;n.setAttr(i,p)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{const e=this.node,n=_n.attrs[e._id][this._id];n.points&&n.points.trueEnd&&e.setAttr("points",n.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{const e=this.node,n=_n.attrs[e._id][this._id];n.points&&n.points.trueStart&&e.points(n.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(e){return this.tween.seek(e*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){const e=this.node._id,n=this._id,s=_n.tweens[e];this.pause(),this.anim&&this.anim.stop();for(const i in s)delete _n.tweens[e][i];delete _n.attrs[e][n],_n.tweens[e]&&(Object.keys(_n.tweens[e]).length===0&&delete _n.tweens[e],Object.keys(_n.attrs[e]).length===0&&delete _n.attrs[e])}}_n.attrs={};_n.tweens={};De.prototype.to=function(t){const e=t.onFinish;t.node=this,t.onFinish=function(){this.destroy(),e&&e()},new _n(t).play()};const _m={BackEaseIn(t,e,n,s){return n*(t/=s)*t*((1.70158+1)*t-1.70158)+e},BackEaseOut(t,e,n,s){return n*((t=t/s-1)*t*((1.70158+1)*t+1.70158)+1)+e},BackEaseInOut(t,e,n,s){let i=1.70158;return(t/=s/2)<1?n/2*(t*t*(((i*=1.525)+1)*t-i))+e:n/2*((t-=2)*t*(((i*=1.525)+1)*t+i)+2)+e},ElasticEaseIn(t,e,n,s,i,o){let d=0;return t===0?e:(t/=s)===1?e+n:(o||(o=s*.3),!i||i<Math.abs(n)?(i=n,d=o/4):d=o/(2*Math.PI)*Math.asin(n/i),-(i*Math.pow(2,10*(t-=1))*Math.sin((t*s-d)*(2*Math.PI)/o))+e)},ElasticEaseOut(t,e,n,s,i,o){let d=0;return t===0?e:(t/=s)===1?e+n:(o||(o=s*.3),!i||i<Math.abs(n)?(i=n,d=o/4):d=o/(2*Math.PI)*Math.asin(n/i),i*Math.pow(2,-10*t)*Math.sin((t*s-d)*(2*Math.PI)/o)+n+e)},ElasticEaseInOut(t,e,n,s,i,o){let d=0;return t===0?e:(t/=s/2)===2?e+n:(o||(o=s*(.3*1.5)),!i||i<Math.abs(n)?(i=n,d=o/4):d=o/(2*Math.PI)*Math.asin(n/i),t<1?-.5*(i*Math.pow(2,10*(t-=1))*Math.sin((t*s-d)*(2*Math.PI)/o))+e:i*Math.pow(2,-10*(t-=1))*Math.sin((t*s-d)*(2*Math.PI)/o)*.5+n+e)},BounceEaseOut(t,e,n,s){return(t/=s)<1/2.75?n*(7.5625*t*t)+e:t<2/2.75?n*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?n*(7.5625*(t-=2.25/2.75)*t+.9375)+e:n*(7.5625*(t-=2.625/2.75)*t+.984375)+e},BounceEaseIn(t,e,n,s){return n-_m.BounceEaseOut(s-t,0,n,s)+e},BounceEaseInOut(t,e,n,s){return t<s/2?_m.BounceEaseIn(t*2,0,n,s)*.5+e:_m.BounceEaseOut(t*2-s,0,n,s)*.5+n*.5+e},EaseIn(t,e,n,s){return n*(t/=s)*t+e},EaseOut(t,e,n,s){return-n*(t/=s)*(t-2)+e},EaseInOut(t,e,n,s){return(t/=s/2)<1?n/2*t*t+e:-n/2*(--t*(t-2)-1)+e},StrongEaseIn(t,e,n,s){return n*(t/=s)*t*t*t*t+e},StrongEaseOut(t,e,n,s){return n*((t=t/s-1)*t*t*t*t+1)+e},StrongEaseInOut(t,e,n,s){return(t/=s/2)<1?n/2*t*t*t*t*t+e:n/2*((t-=2)*t*t*t*t+2)+e},Linear(t,e,n,s){return n*t/s+e}},sh=ee._assign(ke,{Util:ee,Transform:Cr,Node:De,Container:jr,Stage:oy,stages:Sm,Layer:id,FastLayer:zv,Group:ah,DD:Yt,Shape:Te,shapes:Nm,Animation:si,Tween:_n,Easings:_m,Context:iy,Canvas:Ov});class mo extends Te{_sceneFunc(e){const n=ke.getAngle(this.angle()),s=this.clockwise();e.beginPath(),e.arc(0,0,this.outerRadius(),0,n,s),e.arc(0,0,this.innerRadius(),n,0,!s),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}getSelfRect(){const e=this.innerRadius(),n=this.outerRadius(),s=this.clockwise(),i=ke.getAngle(s?360-this.angle():this.angle()),o=Math.cos(Math.min(i,Math.PI)),d=1,f=Math.sin(Math.min(Math.max(Math.PI,i),3*Math.PI/2)),p=Math.sin(Math.min(i,Math.PI/2)),y=o*(o>0?e:n),S=d*n,b=f*(f>0?e:n),_=p*(p>0?n:e);return{x:y,y:s?-1*_:b,width:S-y,height:_-b}}}mo.prototype._centroid=!0;mo.prototype.className="Arc";mo.prototype._attrsAffectingSize=["innerRadius","outerRadius","angle","clockwise"];ea(mo);K.addGetterSetter(mo,"innerRadius",0,Oe());K.addGetterSetter(mo,"outerRadius",0,Oe());K.addGetterSetter(mo,"angle",0,Oe());K.addGetterSetter(mo,"clockwise",!1,Mi());function Db(t,e,n,s,i,o,d){const f=Math.sqrt(Math.pow(n-t,2)+Math.pow(s-e,2)),p=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-s,2)),y=d*f/(f+p),S=d*p/(f+p),b=n-y*(i-t),_=s-y*(o-e),j=n+S*(i-t),w=s+S*(o-e);return[b,_,j,w]}function z5(t,e){const n=t.length,s=[];for(let i=2;i<n-2;i+=2){const o=Db(t[i-2],t[i-1],t[i],t[i+1],t[i+2],t[i+3],e);isNaN(o[0])||(s.push(o[0]),s.push(o[1]),s.push(t[i]),s.push(t[i+1]),s.push(o[2]),s.push(o[3]))}return s}function Nz(t){const e=[[t[0],t[2],t[4],t[6]],[t[1],t[3],t[5],t[7]]],n=[];for(const s of e){const i=-3*s[0]+9*s[1]-9*s[2]+3*s[3];if(i!==0){const o=6*s[0]-12*s[1]+6*s[2],d=-3*s[0]+3*s[1],f=o*o-4*i*d;if(f>=0){const p=Math.sqrt(f);n.push((-o+p)/(2*i)),n.push((-o-p)/(2*i))}}}return n.filter(s=>s>0&&s<1).flatMap(s=>e.map(i=>{const o=1-s;return o*o*o*i[0]+3*o*o*s*i[1]+3*o*s*s*i[2]+s*s*s*i[3]}))}let go=class extends Te{constructor(e){super(e),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(e){const n=this.points(),s=n.length,i=this.tension(),o=this.closed(),d=this.bezier();if(!s)return;let f=0;if(e.beginPath(),e.moveTo(n[0],n[1]),i!==0&&s>4){const p=this.getTensionPoints(),y=p.length;for(f=o?0:4,o||e.quadraticCurveTo(p[0],p[1],p[2],p[3]);f<y-2;)e.bezierCurveTo(p[f++],p[f++],p[f++],p[f++],p[f++],p[f++]);o||e.quadraticCurveTo(p[y-2],p[y-1],n[s-2],n[s-1])}else if(d)for(f=2;f<s;)e.bezierCurveTo(n[f++],n[f++],n[f++],n[f++],n[f++],n[f++]);else for(f=2;f<s;f+=2)e.lineTo(n[f],n[f+1]);o?(e.closePath(),e.fillStrokeShape(this)):e.strokeShape(this)}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():z5(this.points(),this.tension())}_getTensionPointsClosed(){const e=this.points(),n=e.length,s=this.tension(),i=Db(e[n-2],e[n-1],e[0],e[1],e[2],e[3],s),o=Db(e[n-4],e[n-3],e[n-2],e[n-1],e[0],e[1],s),d=z5(e,s);return[i[2],i[3]].concat(d).concat([o[0],o[1],e[n-2],e[n-1],o[2],o[3],i[0],i[1],e[0],e[1]])}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){let e=this.points();if(e.length<4)return{x:e[0]||0,y:e[1]||0,width:0,height:0};this.tension()!==0?e=[e[0],e[1],...this._getTensionPoints(),e[e.length-2],e[e.length-1]]:this.bezier()?e=[e[0],e[1],...Nz(this.points()),e[e.length-2],e[e.length-1]]:e=this.points();let n=e[0],s=e[0],i=e[1],o=e[1],d,f;for(let p=0;p<e.length/2;p++)d=e[p*2],f=e[p*2+1],n=Math.min(n,d),s=Math.max(s,d),i=Math.min(i,f),o=Math.max(o,f);return{x:n,y:i,width:s-n,height:o-i}}};go.prototype.className="Line";go.prototype._attrsAffectingSize=["points","bezier","tension"];ea(go);K.addGetterSetter(go,"closed",!1);K.addGetterSetter(go,"bezier",!1);K.addGetterSetter(go,"tension",0,Oe());K.addGetterSetter(go,"points",[],qD());const _z=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],Cz=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],jz=[[1],[1,1],[1,2,1],[1,3,3,1]],k5=(t,e,n)=>{let s,i;const d=n/2;s=0;for(let f=0;f<20;f++)i=d*_z[20][f]+d,s+=Cz[20][f]*wz(t,e,i);return d*s},L5=(t,e,n)=>{n===void 0&&(n=1);const s=t[0]-2*t[1]+t[2],i=e[0]-2*e[1]+e[2],o=2*t[1]-2*t[0],d=2*e[1]-2*e[0],f=4*(s*s+i*i),p=4*(s*o+i*d),y=o*o+d*d;if(f===0)return n*Math.sqrt(Math.pow(t[2]-t[0],2)+Math.pow(e[2]-e[0],2));const S=p/(2*f),b=y/f,_=n+S,j=b-S*S,w=_*_+j>0?Math.sqrt(_*_+j):0,T=S*S+j>0?Math.sqrt(S*S+j):0,O=S+Math.sqrt(S*S+j)!==0?j*Math.log(Math.abs((_+w)/(S+T))):0;return Math.sqrt(f)/2*(_*w-S*T+O)};function wz(t,e,n){const s=zb(1,n,t),i=zb(1,n,e),o=s*s+i*i;return Math.sqrt(o)}const zb=(t,e,n)=>{const s=n.length-1;let i,o;if(s===0)return 0;if(t===0){o=0;for(let d=0;d<=s;d++)o+=jz[s][d]*Math.pow(1-e,s-d)*Math.pow(e,d)*n[d];return o}else{i=new Array(s);for(let d=0;d<s;d++)i[d]=s*(n[d+1]-n[d]);return zb(t-1,e,i)}},U5=(t,e,n)=>{let s=1,i=t/e,o=(t-n(i))/e,d=0;for(;s>.001;){const f=n(i+o),p=Math.abs(t-f)/e;if(p<s)s=p,i+=o;else{const y=n(i-o),S=Math.abs(t-y)/e;S<s?(s=S,i-=o):o/=2}if(d++,d>500)break}return i};class Cn extends Te{constructor(e){super(e),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=Cn.parsePathData(this.data()),this.pathLength=Cn.getPathLength(this.dataArray)}_sceneFunc(e){const n=this.dataArray;e.beginPath();let s=!1;for(let i=0;i<n.length;i++){const o=n[i].command,d=n[i].points;switch(o){case"L":e.lineTo(d[0],d[1]);break;case"M":e.moveTo(d[0],d[1]);break;case"C":e.bezierCurveTo(d[0],d[1],d[2],d[3],d[4],d[5]);break;case"Q":e.quadraticCurveTo(d[0],d[1],d[2],d[3]);break;case"A":const f=d[0],p=d[1],y=d[2],S=d[3],b=d[4],_=d[5],j=d[6],w=d[7],T=y>S?y:S,O=y>S?1:y/S,R=y>S?S/y:1;e.translate(f,p),e.rotate(j),e.scale(O,R),e.arc(0,0,T,b,b+_,1-w),e.scale(1/O,1/R),e.rotate(-j),e.translate(-f,-p);break;case"z":s=!0,e.closePath();break}}!s&&!this.hasFill()?e.strokeShape(this):e.fillStrokeShape(this)}getSelfRect(){let e=[];this.dataArray.forEach(function(p){if(p.command==="A"){const y=p.points[4],S=p.points[5],b=p.points[4]+S;let _=Math.PI/180;if(Math.abs(y-b)<_&&(_=Math.abs(y-b)),S<0)for(let j=y-_;j>b;j-=_){const w=Cn.getPointOnEllipticalArc(p.points[0],p.points[1],p.points[2],p.points[3],j,0);e.push(w.x,w.y)}else for(let j=y+_;j<b;j+=_){const w=Cn.getPointOnEllipticalArc(p.points[0],p.points[1],p.points[2],p.points[3],j,0);e.push(w.x,w.y)}}else if(p.command==="C")for(let y=0;y<=1;y+=.01){const S=Cn.getPointOnCubicBezier(y,p.start.x,p.start.y,p.points[0],p.points[1],p.points[2],p.points[3],p.points[4],p.points[5]);e.push(S.x,S.y)}else e=e.concat(p.points)});let n=e[0],s=e[0],i=e[1],o=e[1],d,f;for(let p=0;p<e.length/2;p++)d=e[p*2],f=e[p*2+1],isNaN(d)||(n=Math.min(n,d),s=Math.max(s,d)),isNaN(f)||(i=Math.min(i,f),o=Math.max(o,f));return{x:n,y:i,width:s-n,height:o-i}}getLength(){return this.pathLength}getPointAtLength(e){return Cn.getPointAtLengthOfDataArray(e,this.dataArray)}static getLineLength(e,n,s,i){return Math.sqrt((s-e)*(s-e)+(i-n)*(i-n))}static getPathLength(e){let n=0;for(let s=0;s<e.length;++s)n+=e[s].pathLength;return n}static getPointAtLengthOfDataArray(e,n){let s,i=0,o=n.length;if(!o)return null;for(;i<o&&e>n[i].pathLength;)e-=n[i].pathLength,++i;if(i===o)return s=n[i-1].points.slice(-2),{x:s[0],y:s[1]};if(e<.01)return n[i].command==="M"?(s=n[i].points.slice(0,2),{x:s[0],y:s[1]}):{x:n[i].start.x,y:n[i].start.y};const d=n[i],f=d.points;switch(d.command){case"L":return Cn.getPointOnLine(e,d.start.x,d.start.y,f[0],f[1]);case"C":return Cn.getPointOnCubicBezier(U5(e,Cn.getPathLength(n),T=>k5([d.start.x,f[0],f[2],f[4]],[d.start.y,f[1],f[3],f[5]],T)),d.start.x,d.start.y,f[0],f[1],f[2],f[3],f[4],f[5]);case"Q":return Cn.getPointOnQuadraticBezier(U5(e,Cn.getPathLength(n),T=>L5([d.start.x,f[0],f[2]],[d.start.y,f[1],f[3]],T)),d.start.x,d.start.y,f[0],f[1],f[2],f[3]);case"A":const p=f[0],y=f[1],S=f[2],b=f[3],_=f[5],j=f[6];let w=f[4];return w+=_*e/d.pathLength,Cn.getPointOnEllipticalArc(p,y,S,b,w,j)}return null}static getPointOnLine(e,n,s,i,o,d,f){d=d??n,f=f??s;const p=this.getLineLength(n,s,i,o);if(p<1e-10)return{x:n,y:s};if(i===n)return{x:d,y:f+(o>s?e:-e)};const y=(o-s)/(i-n),S=Math.sqrt(e*e/(1+y*y))*(i<n?-1:1),b=y*S;if(Math.abs(f-s-y*(d-n))<1e-10)return{x:d+S,y:f+b};const _=((d-n)*(i-n)+(f-s)*(o-s))/(p*p),j=n+_*(i-n),w=s+_*(o-s),T=this.getLineLength(d,f,j,w),O=Math.sqrt(e*e-T*T),R=Math.sqrt(O*O/(1+y*y))*(i<n?-1:1),M=y*R;return{x:j+R,y:w+M}}static getPointOnCubicBezier(e,n,s,i,o,d,f,p,y){function S(O){return O*O*O}function b(O){return 3*O*O*(1-O)}function _(O){return 3*O*(1-O)*(1-O)}function j(O){return(1-O)*(1-O)*(1-O)}const w=p*S(e)+d*b(e)+i*_(e)+n*j(e),T=y*S(e)+f*b(e)+o*_(e)+s*j(e);return{x:w,y:T}}static getPointOnQuadraticBezier(e,n,s,i,o,d,f){function p(j){return j*j}function y(j){return 2*j*(1-j)}function S(j){return(1-j)*(1-j)}const b=d*p(e)+i*y(e)+n*S(e),_=f*p(e)+o*y(e)+s*S(e);return{x:b,y:_}}static getPointOnEllipticalArc(e,n,s,i,o,d){const f=Math.cos(d),p=Math.sin(d),y={x:s*Math.cos(o),y:i*Math.sin(o)};return{x:e+(y.x*f-y.y*p),y:n+(y.x*p+y.y*f)}}static parsePathData(e){if(!e)return[];let n=e;const s=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];n=n.replace(new RegExp(" ","g"),",");for(let b=0;b<s.length;b++)n=n.replace(new RegExp(s[b],"g"),"|"+s[b]);const i=n.split("|"),o=[],d=[];let f=0,p=0;const y=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let S;for(let b=1;b<i.length;b++){let _=i[b],j=_.charAt(0);for(_=_.slice(1),d.length=0;S=y.exec(_);)d.push(S[0]);let w=[],T=j==="A"||j==="a"?0:-1;for(let O=0,R=d.length;O<R;O++){const M=d[O];if(M==="00"){w.push(0,0),T>=0&&(T+=2,T>=7&&(T-=7));continue}if(T>=0){if(T===3){if(/^[01]{2}\d+(?:\.\d+)?$/.test(M)){w.push(parseInt(M[0],10)),w.push(parseInt(M[1],10)),w.push(parseFloat(M.slice(2))),T+=3,T>=7&&(T-=7);continue}if(M==="11"||M==="10"||M==="01"){w.push(parseInt(M[0],10)),w.push(parseInt(M[1],10)),T+=2,T>=7&&(T-=7);continue}if(M==="0"||M==="1"){w.push(parseInt(M,10)),T+=1,T>=7&&(T-=7);continue}}else if(T===4){if(/^[01]\d+(?:\.\d+)?$/.test(M)){w.push(parseInt(M[0],10)),w.push(parseFloat(M.slice(1))),T+=2,T>=7&&(T-=7);continue}if(M==="0"||M==="1"){w.push(parseInt(M,10)),T+=1,T>=7&&(T-=7);continue}}const z=parseFloat(M);isNaN(z)?w.push(0):w.push(z),T+=1,T>=7&&(T-=7)}else{const z=parseFloat(M);isNaN(z)?w.push(0):w.push(z)}}for(;w.length>0&&!isNaN(w[0]);){let O="",R=[];const M=f,z=p;let k,G,P,L,U,V,Z,re,ne,W;switch(j){case"l":f+=w.shift(),p+=w.shift(),O="L",R.push(f,p);break;case"L":f=w.shift(),p=w.shift(),R.push(f,p);break;case"m":const ie=w.shift(),ce=w.shift();if(f+=ie,p+=ce,O="M",o.length>2&&o[o.length-1].command==="z"){for(let Y=o.length-2;Y>=0;Y--)if(o[Y].command==="M"){f=o[Y].points[0]+ie,p=o[Y].points[1]+ce;break}}R.push(f,p),j="l";break;case"M":f=w.shift(),p=w.shift(),O="M",R.push(f,p),j="L";break;case"h":f+=w.shift(),O="L",R.push(f,p);break;case"H":f=w.shift(),O="L",R.push(f,p);break;case"v":p+=w.shift(),O="L",R.push(f,p);break;case"V":p=w.shift(),O="L",R.push(f,p);break;case"C":R.push(w.shift(),w.shift(),w.shift(),w.shift()),f=w.shift(),p=w.shift(),R.push(f,p);break;case"c":R.push(f+w.shift(),p+w.shift(),f+w.shift(),p+w.shift()),f+=w.shift(),p+=w.shift(),O="C",R.push(f,p);break;case"S":G=f,P=p,k=o[o.length-1],k.command==="C"&&(G=f+(f-k.points[2]),P=p+(p-k.points[3])),R.push(G,P,w.shift(),w.shift()),f=w.shift(),p=w.shift(),O="C",R.push(f,p);break;case"s":G=f,P=p,k=o[o.length-1],k.command==="C"&&(G=f+(f-k.points[2]),P=p+(p-k.points[3])),R.push(G,P,f+w.shift(),p+w.shift()),f+=w.shift(),p+=w.shift(),O="C",R.push(f,p);break;case"Q":R.push(w.shift(),w.shift()),f=w.shift(),p=w.shift(),R.push(f,p);break;case"q":R.push(f+w.shift(),p+w.shift()),f+=w.shift(),p+=w.shift(),O="Q",R.push(f,p);break;case"T":G=f,P=p,k=o[o.length-1],k.command==="Q"&&(G=f+(f-k.points[0]),P=p+(p-k.points[1])),f=w.shift(),p=w.shift(),O="Q",R.push(G,P,f,p);break;case"t":G=f,P=p,k=o[o.length-1],k.command==="Q"&&(G=f+(f-k.points[0]),P=p+(p-k.points[1])),f+=w.shift(),p+=w.shift(),O="Q",R.push(G,P,f,p);break;case"A":L=w.shift(),U=w.shift(),V=w.shift(),Z=w.shift(),re=w.shift(),ne=f,W=p,f=w.shift(),p=w.shift(),O="A",R=this.convertEndpointToCenterParameterization(ne,W,f,p,Z,re,L,U,V);break;case"a":L=w.shift(),U=w.shift(),V=w.shift(),Z=w.shift(),re=w.shift(),ne=f,W=p,f+=w.shift(),p+=w.shift(),O="A",R=this.convertEndpointToCenterParameterization(ne,W,f,p,Z,re,L,U,V);break}o.push({command:O||j,points:R,start:{x:M,y:z},pathLength:this.calcLength(M,z,O||j,R)})}(j==="z"||j==="Z")&&o.push({command:"z",points:[],start:void 0,pathLength:0})}return o}static calcLength(e,n,s,i){let o,d,f,p;const y=Cn;switch(s){case"L":return y.getLineLength(e,n,i[0],i[1]);case"C":return k5([e,i[0],i[2],i[4]],[n,i[1],i[3],i[5]],1);case"Q":return L5([e,i[0],i[2]],[n,i[1],i[3]],1);case"A":o=0;const S=i[4],b=i[5],_=i[4]+b;let j=Math.PI/180;if(Math.abs(S-_)<j&&(j=Math.abs(S-_)),d=y.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],S,0),b<0)for(p=S-j;p>_;p-=j)f=y.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],p,0),o+=y.getLineLength(d.x,d.y,f.x,f.y),d=f;else for(p=S+j;p<_;p+=j)f=y.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],p,0),o+=y.getLineLength(d.x,d.y,f.x,f.y),d=f;return f=y.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],_,0),o+=y.getLineLength(d.x,d.y,f.x,f.y),o}return 0}static convertEndpointToCenterParameterization(e,n,s,i,o,d,f,p,y){const S=y*(Math.PI/180),b=Math.cos(S)*(e-s)/2+Math.sin(S)*(n-i)/2,_=-1*Math.sin(S)*(e-s)/2+Math.cos(S)*(n-i)/2,j=b*b/(f*f)+_*_/(p*p);j>1&&(f*=Math.sqrt(j),p*=Math.sqrt(j));let w=Math.sqrt((f*f*(p*p)-f*f*(_*_)-p*p*(b*b))/(f*f*(_*_)+p*p*(b*b)));o===d&&(w*=-1),isNaN(w)&&(w=0);const T=w*f*_/p,O=w*-p*b/f,R=(e+s)/2+Math.cos(S)*T-Math.sin(S)*O,M=(n+i)/2+Math.sin(S)*T+Math.cos(S)*O,z=function(Z){return Math.sqrt(Z[0]*Z[0]+Z[1]*Z[1])},k=function(Z,re){return(Z[0]*re[0]+Z[1]*re[1])/(z(Z)*z(re))},G=function(Z,re){return(Z[0]*re[1]<Z[1]*re[0]?-1:1)*Math.acos(k(Z,re))},P=G([1,0],[(b-T)/f,(_-O)/p]),L=[(b-T)/f,(_-O)/p],U=[(-1*b-T)/f,(-1*_-O)/p];let V=G(L,U);return k(L,U)<=-1&&(V=Math.PI),k(L,U)>=1&&(V=0),d===0&&V>0&&(V=V-2*Math.PI),d===1&&V<0&&(V=V+2*Math.PI),[R,M,f,p,P,V,S,d]}}Cn.prototype.className="Path";Cn.prototype._attrsAffectingSize=["data"];ea(Cn);K.addGetterSetter(Cn,"data");let ld=class extends go{_sceneFunc(e){super._sceneFunc(e);const n=Math.PI*2,s=this.points();let i=s;const o=this.tension()!==0&&s.length>4;o&&(i=this.getTensionPoints());const d=this.pointerLength(),f=s.length;let p,y;if(o){const _=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],s[f-2],s[f-1]],j=Cn.calcLength(i[i.length-4],i[i.length-3],"C",_),w=Cn.getPointOnQuadraticBezier(Math.min(1,1-d/j),_[0],_[1],_[2],_[3],_[4],_[5]);p=s[f-2]-w.x,y=s[f-1]-w.y}else p=s[f-2]-s[f-4],y=s[f-1]-s[f-3];const S=(Math.atan2(y,p)+n)%n,b=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(s[f-2],s[f-1]),e.rotate(S),e.moveTo(0,0),e.lineTo(-d,b/2),e.lineTo(-d,-b/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(s[0],s[1]),o?(p=(i[0]+i[2])/2-s[0],y=(i[1]+i[3])/2-s[1]):(p=s[2]-s[0],y=s[3]-s[1]),e.rotate((Math.atan2(-y,-p)+n)%n),e.moveTo(0,0),e.lineTo(-d,b/2),e.lineTo(-d,-b/2),e.closePath(),e.restore(),this.__fillStroke(e))}__fillStroke(e){const n=this.dashEnabled();n&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),n&&(this.attrs.dashEnabled=!0)}getSelfRect(){const e=super.getSelfRect(),n=this.pointerWidth()/2;return{x:e.x,y:e.y-n,width:e.width,height:e.height+n*2}}};ld.prototype.className="Arrow";ea(ld);K.addGetterSetter(ld,"pointerLength",10,Oe());K.addGetterSetter(ld,"pointerWidth",10,Oe());K.addGetterSetter(ld,"pointerAtBeginning",!1);K.addGetterSetter(ld,"pointerAtEnding",!0);let ph=class extends Te{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius()!==e/2&&this.radius(e/2)}setHeight(e){this.radius()!==e/2&&this.radius(e/2)}};ph.prototype._centroid=!0;ph.prototype.className="Circle";ph.prototype._attrsAffectingSize=["radius"];ea(ph);K.addGetterSetter(ph,"radius",0,Oe());class qc extends Te{_sceneFunc(e){const n=this.radiusX(),s=this.radiusY();e.beginPath(),e.save(),n!==s&&e.scale(1,s/n),e.arc(0,0,n,0,Math.PI*2,!1),e.restore(),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(e){this.radiusX(e/2)}setHeight(e){this.radiusY(e/2)}}qc.prototype.className="Ellipse";qc.prototype._centroid=!0;qc.prototype._attrsAffectingSize=["radiusX","radiusY"];ea(qc);K.addComponentsGetterSetter(qc,"radius",["x","y"]);K.addGetterSetter(qc,"radiusX",0,Oe());K.addGetterSetter(qc,"radiusY",0,Oe());class Tr extends Te{constructor(e){super(e),this._loadListener=()=>{this._requestDraw()},this.on("imageChange.konva",n=>{this._removeImageLoad(n.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const e=this.image();e&&e.complete||e&&e.readyState===4||e&&e.addEventListener&&e.addEventListener("load",this._loadListener)}_removeImageLoad(e){e&&e.removeEventListener&&e.removeEventListener("load",this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(){const e=!!this.cornerRadius(),n=this.hasShadow();return e&&n?!0:super._useBufferCanvas(!0)}_sceneFunc(e){const n=this.getWidth(),s=this.getHeight(),i=this.cornerRadius(),o=this.attrs.image;let d;if(o){const f=this.attrs.cropWidth,p=this.attrs.cropHeight;f&&p?d=[o,this.cropX(),this.cropY(),f,p,0,0,n,s]:d=[o,0,0,n,s]}(this.hasFill()||this.hasStroke()||i)&&(e.beginPath(),i?ee.drawRoundedRectPath(e,n,s,i):e.rect(0,0,n,s),e.closePath(),e.fillStrokeShape(this)),o&&(i&&e.clip(),e.drawImage.apply(e,d))}_hitFunc(e){const n=this.width(),s=this.height(),i=this.cornerRadius();e.beginPath(),i?ee.drawRoundedRectPath(e,n,s,i):e.rect(0,0,n,s),e.closePath(),e.fillStrokeShape(this)}getWidth(){var e,n,s;return(s=(e=this.attrs.width)!==null&&e!==void 0?e:(n=this.image())===null||n===void 0?void 0:n.width)!==null&&s!==void 0?s:0}getHeight(){var e,n,s;return(s=(e=this.attrs.height)!==null&&e!==void 0?e:(n=this.image())===null||n===void 0?void 0:n.height)!==null&&s!==void 0?s:0}static fromURL(e,n,s=null){const i=ee.createImageElement();i.onload=function(){const o=new Tr({image:i});n(o)},i.onerror=s,i.crossOrigin="Anonymous",i.src=e}}Tr.prototype.className="Image";Tr.prototype._attrsAffectingSize=["image"];ea(Tr);K.addGetterSetter(Tr,"cornerRadius",0,ly(4));K.addGetterSetter(Tr,"image");K.addComponentsGetterSetter(Tr,"crop",["x","y","width","height"]);K.addGetterSetter(Tr,"cropX",0,Oe());K.addGetterSetter(Tr,"cropY",0,Oe());K.addGetterSetter(Tr,"cropWidth",0,Oe());K.addGetterSetter(Tr,"cropHeight",0,Oe());const G8=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],Ez="Change.konva",Tz="none",kb="up",Lb="right",Ub="down",qb="left",Rz=G8.length;class kv extends ah{constructor(e){super(e),this.on("add.konva",function(n){this._addListeners(n.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(e){let n=this,s;const i=function(){n._sync()};for(s=0;s<Rz;s++)e.on(G8[s]+Ez,i)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let e=this.getText(),n=this.getTag(),s,i,o,d,f,p,y;if(e&&n){switch(s=e.width(),i=e.height(),o=n.pointerDirection(),d=n.pointerWidth(),y=n.pointerHeight(),f=0,p=0,o){case kb:f=s/2,p=-1*y;break;case Lb:f=s+d,p=i/2;break;case Ub:f=s/2,p=i+y;break;case qb:f=-1*d,p=i/2;break}n.setAttrs({x:-1*f,y:-1*p,width:s,height:i}),e.setAttrs({x:-1*f,y:-1*p})}}}kv.prototype.className="Label";ea(kv);class od extends Te{_sceneFunc(e){const n=this.width(),s=this.height(),i=this.pointerDirection(),o=this.pointerWidth(),d=this.pointerHeight(),f=this.cornerRadius();let p=0,y=0,S=0,b=0;typeof f=="number"?p=y=S=b=Math.min(f,n/2,s/2):(p=Math.min(f[0]||0,n/2,s/2),y=Math.min(f[1]||0,n/2,s/2),b=Math.min(f[2]||0,n/2,s/2),S=Math.min(f[3]||0,n/2,s/2)),e.beginPath(),e.moveTo(p,0),i===kb&&(e.lineTo((n-o)/2,0),e.lineTo(n/2,-1*d),e.lineTo((n+o)/2,0)),e.lineTo(n-y,0),e.arc(n-y,y,y,Math.PI*3/2,0,!1),i===Lb&&(e.lineTo(n,(s-d)/2),e.lineTo(n+o,s/2),e.lineTo(n,(s+d)/2)),e.lineTo(n,s-b),e.arc(n-b,s-b,b,0,Math.PI/2,!1),i===Ub&&(e.lineTo((n+o)/2,s),e.lineTo(n/2,s+d),e.lineTo((n-o)/2,s)),e.lineTo(S,s),e.arc(S,s-S,S,Math.PI/2,Math.PI,!1),i===qb&&(e.lineTo(0,(s+d)/2),e.lineTo(-1*o,s/2),e.lineTo(0,(s-d)/2)),e.lineTo(0,p),e.arc(p,p,p,Math.PI,Math.PI*3/2,!1),e.closePath(),e.fillStrokeShape(this)}getSelfRect(){let e=0,n=0,s=this.pointerWidth(),i=this.pointerHeight(),o=this.pointerDirection(),d=this.width(),f=this.height();return o===kb?(n-=i,f+=i):o===Ub?f+=i:o===qb?(e-=s*1.5,d+=s):o===Lb&&(d+=s*1.5),{x:e,y:n,width:d,height:f}}}od.prototype.className="Tag";ea(od);K.addGetterSetter(od,"pointerDirection",Tz);K.addGetterSetter(od,"pointerWidth",0,Oe());K.addGetterSetter(od,"pointerHeight",0,Oe());K.addGetterSetter(od,"cornerRadius",0,ly(4));class $m extends Te{_sceneFunc(e){const n=this.cornerRadius(),s=this.width(),i=this.height();e.beginPath(),n?ee.drawRoundedRectPath(e,s,i,n):e.rect(0,0,s,i),e.closePath(),e.fillStrokeShape(this)}}$m.prototype.className="Rect";ea($m);K.addGetterSetter($m,"cornerRadius",0,ly(4));class Hc extends Te{_sceneFunc(e){const n=this._getPoints(),s=this.radius(),i=this.sides(),o=this.cornerRadius();if(e.beginPath(),o)ee.drawRoundedPolygonPath(e,n,i,s,o);else{e.moveTo(n[0].x,n[0].y);for(let d=1;d<n.length;d++)e.lineTo(n[d].x,n[d].y)}e.closePath(),e.fillStrokeShape(this)}_getPoints(){const e=this.attrs.sides,n=this.attrs.radius||0,s=[];for(let i=0;i<e;i++)s.push({x:n*Math.sin(i*2*Math.PI/e),y:-1*n*Math.cos(i*2*Math.PI/e)});return s}getSelfRect(){const e=this._getPoints();let n=e[0].x,s=e[0].x,i=e[0].y,o=e[0].y;return e.forEach(d=>{n=Math.min(n,d.x),s=Math.max(s,d.x),i=Math.min(i,d.y),o=Math.max(o,d.y)}),{x:n,y:i,width:s-n,height:o-i}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}Hc.prototype.className="RegularPolygon";Hc.prototype._centroid=!0;Hc.prototype._attrsAffectingSize=["radius"];ea(Hc);K.addGetterSetter(Hc,"radius",0,Oe());K.addGetterSetter(Hc,"sides",0,Oe());K.addGetterSetter(Hc,"cornerRadius",0,ly(4));const q5=Math.PI*2;class cd extends Te{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,q5,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),q5,0,!0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}cd.prototype.className="Ring";cd.prototype._centroid=!0;cd.prototype._attrsAffectingSize=["innerRadius","outerRadius"];ea(cd);K.addGetterSetter(cd,"innerRadius",0,Oe());K.addGetterSetter(cd,"outerRadius",0,Oe());class Sl extends Te{constructor(e){super(e),this._updated=!0,this.anim=new si(()=>{const n=this._updated;return this._updated=!1,n}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(e){const n=this.animation(),s=this.frameIndex(),i=s*4,o=this.animations()[n],d=this.frameOffsets(),f=o[i+0],p=o[i+1],y=o[i+2],S=o[i+3],b=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,y,S),e.closePath(),e.fillStrokeShape(this)),b)if(d){const _=d[n],j=s*2;e.drawImage(b,f,p,y,S,_[j+0],_[j+1],y,S)}else e.drawImage(b,f,p,y,S,0,0,y,S)}_hitFunc(e){const n=this.animation(),s=this.frameIndex(),i=s*4,o=this.animations()[n],d=this.frameOffsets(),f=o[i+2],p=o[i+3];if(e.beginPath(),d){const y=d[n],S=s*2;e.rect(y[S+0],y[S+1],f,p)}else e.rect(0,0,f,p);e.closePath(),e.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){const e=this;this.interval=setInterval(function(){e._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;const e=this.getLayer();this.anim.setLayers(e),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){const e=this.frameIndex(),n=this.animation(),s=this.animations(),i=s[n],o=i.length/4;e<o-1?this.frameIndex(e+1):this.frameIndex(0)}}Sl.prototype.className="Sprite";ea(Sl);K.addGetterSetter(Sl,"animation");K.addGetterSetter(Sl,"animations");K.addGetterSetter(Sl,"frameOffsets");K.addGetterSetter(Sl,"image");K.addGetterSetter(Sl,"frameIndex",0,Oe());K.addGetterSetter(Sl,"frameRate",17,Oe());K.backCompat(Sl,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});class Bc extends Te{_sceneFunc(e){const n=this.innerRadius(),s=this.outerRadius(),i=this.numPoints();e.beginPath(),e.moveTo(0,0-s);for(let o=1;o<i*2;o++){const d=o%2===0?s:n,f=d*Math.sin(o*Math.PI/i),p=-1*d*Math.cos(o*Math.PI/i);e.lineTo(f,p)}e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}Bc.prototype.className="Star";Bc.prototype._centroid=!0;Bc.prototype._attrsAffectingSize=["innerRadius","outerRadius"];ea(Bc);K.addGetterSetter(Bc,"numPoints",5,Oe());K.addGetterSetter(Bc,"innerRadius",0,Oe());K.addGetterSetter(Bc,"outerRadius",0,Oe());function yc(t){return[...t].reduce((e,n,s,i)=>{if(new RegExp("\\p{Emoji}","u").test(n)){const o=i[s+1];o&&new RegExp("\\p{Emoji_Modifier}|\\u200D","u").test(o)?(e.push(n+o),i[s+1]=""):e.push(n)}else new RegExp("\\p{Regional_Indicator}{2}","u").test(n+(i[s+1]||""))?e.push(n+i[s+1]):s>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test(n)?e[e.length-1]+=n:n&&e.push(n);return e},[])}const Tf="auto",Oz="center",P8="inherit",im="justify",Mz="Change.konva",Az="2d",H5="-",Y8="left",Dz="text",zz="Text",kz="top",Lz="bottom",B5="middle",V8="normal",Uz="px ",o1=" ",qz="right",G5="rtl",Hz="word",Bz="char",P5="none",Rx="…",Q8=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],Gz=Q8.length;function Pz(t){return t.split(",").map(e=>{e=e.trim();const n=e.indexOf(" ")>=0,s=e.indexOf('"')>=0||e.indexOf("'")>=0;return n&&!s&&(e=`"${e}"`),e}).join(", ")}let c1;function Ox(){return c1||(c1=ee.createCanvasElement().getContext(Az),c1)}function Yz(t){t.fillText(this._partialText,this._partialTextX,this._partialTextY)}function Vz(t){t.setAttr("miterLimit",2),t.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function Qz(t){return t=t||{},!t.fillLinearGradientColorStops&&!t.fillRadialGradientColorStops&&!t.fillPatternImage&&(t.fill=t.fill||"black"),t}let wn=class extends Te{constructor(e){super(Qz(e)),this._partialTextX=0,this._partialTextY=0;for(let n=0;n<Gz;n++)this.on(Q8[n]+Mz,this._setTextData);this._setTextData()}_sceneFunc(e){var n,s;const i=this.textArr,o=i.length;if(!this.text())return;let d=this.padding(),f=this.fontSize(),p=this.lineHeight()*f,y=this.verticalAlign(),S=this.direction(),b=0,_=this.align(),j=this.getWidth(),w=this.letterSpacing(),T=this.charRenderFunc(),O=this.fill(),R=this.textDecoration(),M=this.underlineOffset(),z=R.indexOf("underline")!==-1,k=R.indexOf("line-through")!==-1,G;S=S===P8?e.direction:S;let P=p/2,L=B5;if(!ke.legacyTextRendering){const U=this.measureSize("M");L="alphabetic";const V=(n=U.fontBoundingBoxAscent)!==null&&n!==void 0?n:U.actualBoundingBoxAscent,Z=(s=U.fontBoundingBoxDescent)!==null&&s!==void 0?s:U.actualBoundingBoxDescent;P=(V-Z)/2+p/2}for(S===G5&&e.setAttr("direction",S),e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",L),e.setAttr("textAlign",Y8),y===B5?b=(this.getHeight()-o*p-d*2)/2:y===Lz&&(b=this.getHeight()-o*p-d*2),e.translate(d,b+d),G=0;G<o;G++){let U=0,V=0;const Z=i[G],re=Z.text,ne=Z.width,W=Z.lastInParagraph;if(e.save(),_===qz?U+=j-ne-d*2:_===Oz&&(U+=(j-ne-d*2)/2),z){e.save(),e.beginPath();const ce=M??(ke.legacyTextRendering?Math.round(f/2):Math.round(f/4)),Y=U,$=P+V+ce;e.moveTo(Y,$);const ae=_===im&&!W?j-d*2:ne;e.lineTo(Y+Math.round(ae),$),e.lineWidth=f/15;const Ne=this._getLinearGradient();e.strokeStyle=Ne||O,e.stroke(),e.restore()}const ie=U;if(S!==G5&&(w!==0||_===im||T)){const ce=re.split(" ").length-1,Y=yc(re);for(let $=0;$<Y.length;$++){const ae=Y[$];if(ae===" "&&!W&&_===im&&(U+=(j-d*2-ne)/ce),this._partialTextX=U,this._partialTextY=P+V,this._partialText=ae,T){e.save();const me=i.slice(0,G).reduce((I,fe)=>I+yc(fe.text).length,0),B=$+me;T({char:ae,index:B,x:U,y:P+V,lineIndex:G,column:$,isLastInLine:W,width:this.measureSize(ae).width,context:e})}e.fillStrokeShape(this),T&&e.restore(),U+=this.measureSize(ae).width+w}}else w!==0&&e.setAttr("letterSpacing",`${w}px`),this._partialTextX=U,this._partialTextY=P+V,this._partialText=re,e.fillStrokeShape(this);if(k){e.save(),e.beginPath();const ce=ke.legacyTextRendering?0:-Math.round(f/4),Y=ie;e.moveTo(Y,P+V+ce);const $=_===im&&!W?j-d*2:ne;e.lineTo(Y+Math.round($),P+V+ce),e.lineWidth=f/15;const ae=this._getLinearGradient();e.strokeStyle=ae||O,e.stroke(),e.restore()}e.restore(),o>1&&(P+=p)}}_hitFunc(e){const n=this.getWidth(),s=this.getHeight();e.beginPath(),e.rect(0,0,n,s),e.closePath(),e.fillStrokeShape(this)}setText(e){const n=ee._isString(e)?e:e==null?"":e+"";return this._setAttr(Dz,n),this}getWidth(){return this.attrs.width===Tf||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===Tf||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return ee.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(e){var n,s,i,o,d,f,p,y,S,b,_;let j=Ox(),w=this.fontSize(),T;j.save(),j.font=this._getContextFont(),T=j.measureText(e),j.restore();const O=w/100;return{actualBoundingBoxAscent:(n=T.actualBoundingBoxAscent)!==null&&n!==void 0?n:71.58203125*O,actualBoundingBoxDescent:(s=T.actualBoundingBoxDescent)!==null&&s!==void 0?s:0,actualBoundingBoxLeft:(i=T.actualBoundingBoxLeft)!==null&&i!==void 0?i:-7.421875*O,actualBoundingBoxRight:(o=T.actualBoundingBoxRight)!==null&&o!==void 0?o:75.732421875*O,alphabeticBaseline:(d=T.alphabeticBaseline)!==null&&d!==void 0?d:0,emHeightAscent:(f=T.emHeightAscent)!==null&&f!==void 0?f:100*O,emHeightDescent:(p=T.emHeightDescent)!==null&&p!==void 0?p:-20*O,fontBoundingBoxAscent:(y=T.fontBoundingBoxAscent)!==null&&y!==void 0?y:91*O,fontBoundingBoxDescent:(S=T.fontBoundingBoxDescent)!==null&&S!==void 0?S:21*O,hangingBaseline:(b=T.hangingBaseline)!==null&&b!==void 0?b:72.80000305175781*O,ideographicBaseline:(_=T.ideographicBaseline)!==null&&_!==void 0?_:-21*O,width:T.width,height:w}}_getContextFont(){return this.fontStyle()+o1+this.fontVariant()+o1+(this.fontSize()+Uz)+Pz(this.fontFamily())}_addTextLine(e){this.align()===im&&(e=e.trim());const s=this._getTextWidth(e);return this.textArr.push({text:e,width:s,lastInParagraph:!1})}_getTextWidth(e){const n=this.letterSpacing(),s=e.length;return Ox().measureText(e).width+n*s}_setTextData(){let e=this.text().split(`
|
|
569
|
-
`),n=+this.fontSize(),s=0,i=this.lineHeight()*n,o=this.attrs.width,d=this.attrs.height,f=o!==Tf&&o!==void 0,p=d!==Tf&&d!==void 0,y=this.padding(),S=o-y*2,b=d-y*2,_=0,j=this.wrap(),w=j!==P5,T=j!==Bz&&w,O=this.ellipsis();this.textArr=[],Ox().font=this._getContextFont();const R=O?this._getTextWidth(Rx):0;for(let M=0,z=e.length;M<z;++M){let k=e[M],G=this._getTextWidth(k);if(f&&G>S)for(;k.length>0;){let P=0,L=yc(k).length,U="",V=0;for(;P<L;){const Z=P+L>>>1,re=yc(k),ne=re.slice(0,Z+1).join(""),W=this._getTextWidth(ne);(O&&p&&_+i>b?W+R:W)<=S?(P=Z+1,U=ne,V=W):L=Z}if(U){if(T){const ne=yc(k),W=yc(U),ie=ne[W.length],ce=ie===o1||ie===H5;let Y;if(ce&&V<=S)Y=W.length;else{const $=W.lastIndexOf(o1),ae=W.lastIndexOf(H5);Y=Math.max($,ae)+1}Y>0&&(P=Y,U=ne.slice(0,P).join(""),V=this._getTextWidth(U))}if(U=U.trimRight(),this._addTextLine(U),s=Math.max(s,V),_+=i,this._shouldHandleEllipsis(_)){this._tryToAddEllipsisToLastLine();break}if(k=yc(k).slice(P).join("").trimLeft(),k.length>0&&(G=this._getTextWidth(k),G<=S)){this._addTextLine(k),_+=i,s=Math.max(s,G);break}}else break}else this._addTextLine(k),_+=i,s=Math.max(s,G),this._shouldHandleEllipsis(_)&&M<z-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),p&&_+i>b)break}this.textHeight=n,this.textWidth=s}_shouldHandleEllipsis(e){const n=+this.fontSize(),s=this.lineHeight()*n,i=this.attrs.height,o=i!==Tf&&i!==void 0,d=this.padding(),f=i-d*2;return!(this.wrap()!==P5)||o&&e+s>f}_tryToAddEllipsisToLastLine(){const e=this.attrs.width,n=e!==Tf&&e!==void 0,s=this.padding(),i=e-s*2,o=this.ellipsis(),d=this.textArr[this.textArr.length-1];!d||!o||(n&&(this._getTextWidth(d.text+Rx)<i||(d.text=d.text.slice(0,d.text.length-3))),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(d.text+Rx))}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const e=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,n=this.hasShadow();return e&&n?!0:super._useBufferCanvas()}};wn.prototype._fillFunc=Yz;wn.prototype._strokeFunc=Vz;wn.prototype.className=zz;wn.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];ea(wn);K.overWriteSetter(wn,"width",Av());K.overWriteSetter(wn,"height",Av());K.addGetterSetter(wn,"direction",P8);K.addGetterSetter(wn,"fontFamily","Arial");K.addGetterSetter(wn,"fontSize",12,Oe());K.addGetterSetter(wn,"fontStyle",V8);K.addGetterSetter(wn,"fontVariant",V8);K.addGetterSetter(wn,"padding",0,Oe());K.addGetterSetter(wn,"align",Y8);K.addGetterSetter(wn,"verticalAlign",kz);K.addGetterSetter(wn,"lineHeight",1,Oe());K.addGetterSetter(wn,"wrap",Hz);K.addGetterSetter(wn,"ellipsis",!1,Mi());K.addGetterSetter(wn,"letterSpacing",0,Oe());K.addGetterSetter(wn,"text","",rd());K.addGetterSetter(wn,"textDecoration","");K.addGetterSetter(wn,"underlineOffset",void 0,Oe());K.addGetterSetter(wn,"charRenderFunc",void 0);const Kz="",K8="normal";function X8(t){t.fillText(this.partialText,0,0)}function F8(t){t.strokeText(this.partialText,0,0)}class Ua extends Te{constructor(e){super(e),this.dummyCanvas=ee.createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute(),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva",this._setTextData),this._setTextData()}_getTextPathLength(){return Cn.getPathLength(this.dataArray)}_getPointAtLength(e){if(!this.attrs.data)return null;const n=this.pathLength;return e>n?null:Cn.getPointAtLengthOfDataArray(e,this.dataArray)}_readDataAttribute(){this.dataArray=Cn.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(e){e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",this.textBaseline()),e.setAttr("textAlign","left"),e.save();const n=this.textDecoration(),s=this.fill(),i=this.fontSize(),o=this.glyphInfo,d=n.indexOf("underline")!==-1,f=n.indexOf("line-through")!==-1;d&&e.beginPath();for(let p=0;p<o.length;p++){e.save();const y=o[p].p0;e.translate(y.x,y.y),e.rotate(o[p].rotation),this.partialText=o[p].text,e.fillStrokeShape(this),d&&(p===0&&e.moveTo(0,i/2+1),e.lineTo(o[p].width,i/2+1)),e.restore()}if(d&&(e.strokeStyle=s,e.lineWidth=i/20,e.stroke()),f){e.beginPath();for(let p=0;p<o.length;p++){e.save();const y=o[p].p0;e.translate(y.x,y.y),e.rotate(o[p].rotation),p===0&&e.moveTo(0,0),e.lineTo(o[p].width,0),e.restore()}e.strokeStyle=s,e.lineWidth=i/20,e.stroke()}e.restore()}_hitFunc(e){e.beginPath();const n=this.glyphInfo;if(n.length>=1){const s=n[0].p0;e.moveTo(s.x,s.y)}for(let s=0;s<n.length;s++){const i=n[s].p1;e.lineTo(i.x,i.y)}e.setAttr("lineWidth",this.fontSize()),e.setAttr("strokeStyle",this.colorKey),e.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return ee.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(e){return wn.prototype.setText.call(this,e)}_getContextFont(){return wn.prototype._getContextFont.call(this)}_getTextSize(e){const s=this.dummyCanvas.getContext("2d");s.save(),s.font=this._getContextFont();const i=s.measureText(e);return s.restore(),{width:i.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const e=yc(this.text()),n=[];let s=0;for(let j=0;j<e.length;j++)n.push({char:e[j],width:this._getTextSize(e[j]).width}),s+=n[j].width;const{width:i,height:o}=this._getTextSize(this.attrs.text);if(this.textWidth=s,this.textHeight=o,this.glyphInfo=[],!this.attrs.data)return null;const d=this.letterSpacing(),f=this.align(),p=this.kerningFunc(),y=Math.max(0,s-i),S=Math.max(this.textWidth+((this.attrs.text||"").length-1)*d,0);let b=0;f==="center"&&(b=Math.max(0,this.pathLength/2-S/2)),f==="right"&&(b=Math.max(0,this.pathLength-S));let _=b;for(let j=0;j<n.length;j++){const w=this._getPointAtLength(_);if(!w)return;const T=n[j].char;let O=n[j].width+d;if(T===" "&&f==="justify"){const L=this.text().split(" ").length-1;O+=(this.pathLength-S)/L}const R=_+O,M=this._getPointAtLength(R>this.pathLength&&R-this.pathLength<=y?this.pathLength:R);if(!M)return;const z=Cn.getLineLength(w.x,w.y,M.x,M.y);let k=0;if(p)try{k=p(n[j-1].char,T)*this.fontSize()}catch{k=0}w.x+=k,M.x+=k,this.textWidth+=k;const G=Cn.getPointOnLine(k+z/2,w.x,w.y,M.x,M.y),P=Math.atan2(M.y-w.y,M.x-w.x);this.glyphInfo.push({transposeX:G.x,transposeY:G.y,text:e[j],rotation:P,p0:w,p1:M,width:z}),_+=O}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};const e=[];this.glyphInfo.forEach(function(y){e.push(y.p0.x),e.push(y.p0.y),e.push(y.p1.x),e.push(y.p1.y)});let n=e[0]||0,s=e[0]||0,i=e[1]||0,o=e[1]||0,d,f;for(let y=0;y<e.length/2;y++)d=e[y*2],f=e[y*2+1],n=Math.min(n,d),s=Math.max(s,d),i=Math.min(i,f),o=Math.max(o,f);const p=this.fontSize();return{x:n-p/2,y:i-p/2,width:s-n+p,height:o-i+p}}destroy(){return ee.releaseCanvas(this.dummyCanvas),super.destroy()}}Ua.prototype._fillFunc=X8;Ua.prototype._strokeFunc=F8;Ua.prototype._fillFuncHit=X8;Ua.prototype._strokeFuncHit=F8;Ua.prototype.className="TextPath";Ua.prototype._attrsAffectingSize=["text","fontSize","data"];ea(Ua);K.addGetterSetter(Ua,"data");K.addGetterSetter(Ua,"fontFamily","Arial");K.addGetterSetter(Ua,"fontSize",12,Oe());K.addGetterSetter(Ua,"fontStyle",K8);K.addGetterSetter(Ua,"align","left");K.addGetterSetter(Ua,"letterSpacing",0,Oe());K.addGetterSetter(Ua,"textBaseline","middle");K.addGetterSetter(Ua,"fontVariant",K8);K.addGetterSetter(Ua,"text",Kz);K.addGetterSetter(Ua,"textDecoration","");K.addGetterSetter(Ua,"kerningFunc",void 0);const Z8="tr-konva",Xz=["resizeEnabledChange","rotateAnchorOffsetChange","rotateAnchorAngleChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(t=>t+`.${Z8}`).join(" "),Y5="nodesRect",Fz=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange","draggableChange"],Zz={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},Iz="ontouchstart"in ke._global;function Jz(t,e,n){if(t==="rotater")return n;e+=ee.degToRad(Zz[t]||0);const s=(ee.radToDeg(e)%360+360)%360;return ee._inRange(s,315+22.5,360)||ee._inRange(s,0,22.5)?"ns-resize":ee._inRange(s,45-22.5,45+22.5)?"nesw-resize":ee._inRange(s,90-22.5,90+22.5)?"ew-resize":ee._inRange(s,135-22.5,135+22.5)?"nwse-resize":ee._inRange(s,180-22.5,180+22.5)?"ns-resize":ee._inRange(s,225-22.5,225+22.5)?"nesw-resize":ee._inRange(s,270-22.5,270+22.5)?"ew-resize":ee._inRange(s,315-22.5,315+22.5)?"nwse-resize":(ee.error("Transformer has unknown angle for cursor detection: "+s),"pointer")}const D1=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function Wz(t){return{x:t.x+t.width/2*Math.cos(t.rotation)+t.height/2*Math.sin(-t.rotation),y:t.y+t.height/2*Math.cos(t.rotation)+t.width/2*Math.sin(t.rotation)}}function I8(t,e,n){const s=n.x+(t.x-n.x)*Math.cos(e)-(t.y-n.y)*Math.sin(e),i=n.y+(t.x-n.x)*Math.sin(e)+(t.y-n.y)*Math.cos(e);return{...t,rotation:t.rotation+e,x:s,y:i}}function $z(t,e){const n=Wz(t);return I8(t,e,n)}function ek(t,e,n){let s=e;for(let i=0;i<t.length;i++){const o=ke.getAngle(t[i]),d=Math.abs(o-e)%(Math.PI*2);Math.min(d,Math.PI*2-d)<n&&(s=o)}return s}let Hb=0;class Lt extends ah{constructor(e){super(e),this._movingAnchorName=null,this._transforming=!1,this._elementsCreated=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(Xz,this.update),this.getNode()&&this.update()}attachTo(e){return this.setNode(e),this}setNode(e){return ee.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([e])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return Z8+this._id}setNodes(e=[]){this._nodes&&this._nodes.length&&this.detach();const n=e.filter(i=>i.isAncestorOf(this)?(ee.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);return this._nodes=e=n,e.length===1&&this.useSingleNodeRotation()?this.rotation(e[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(i=>{const o=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()};if(i._attrsAffectingSize.length){const d=i._attrsAffectingSize.map(f=>f+"Change."+this._getEventNamespace()).join(" ");i.on(d,o)}i.on(Fz.map(d=>d+`.${this._getEventNamespace()}`).join(" "),o),i.on(`absoluteTransformChange.${this._getEventNamespace()}`,o),this._proxyDrag(i)}),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(e){let n;e.on(`dragstart.${this._getEventNamespace()}`,s=>{n=e.getAbsolutePosition(),!this.isDragging()&&e!==this.findOne(".back")&&this.startDrag(s,!1)}),e.on(`dragmove.${this._getEventNamespace()}`,s=>{if(!n)return;const i=e.getAbsolutePosition(),o=i.x-n.x,d=i.y-n.y;this.nodes().forEach(f=>{if(f===e||f.isDragging())return;const p=f.getAbsolutePosition();f.setAbsolutePosition({x:p.x+o,y:p.y+d}),f.startDrag(s)}),n=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(e=>{e.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(Y5),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(Y5,this.__getNodeRect)}__getNodeShape(e,n=this.rotation(),s){const i=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),o=e.getAbsoluteScale(s),d=e.getAbsolutePosition(s),f=i.x*o.x-e.offsetX()*o.x,p=i.y*o.y-e.offsetY()*o.y,y=(ke.getAngle(e.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),S={x:d.x+f*Math.cos(y)+p*Math.sin(-y),y:d.y+p*Math.cos(y)+f*Math.sin(y),width:i.width*o.x,height:i.height*o.y,rotation:y};return I8(S,-ke.getAngle(n),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const n=[];this.nodes().map(y=>{const S=y.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),b=[{x:S.x,y:S.y},{x:S.x+S.width,y:S.y},{x:S.x+S.width,y:S.y+S.height},{x:S.x,y:S.y+S.height}],_=y.getAbsoluteTransform();b.forEach(function(j){const w=_.point(j);n.push(w)})});const s=new Cr;s.rotate(-ke.getAngle(this.rotation()));let i=1/0,o=1/0,d=-1/0,f=-1/0;n.forEach(function(y){const S=s.point(y);i===void 0&&(i=d=S.x,o=f=S.y),i=Math.min(i,S.x),o=Math.min(o,S.y),d=Math.max(d,S.x),f=Math.max(f,S.y)}),s.invert();const p=s.point({x:i,y:o});return{x:p.x,y:p.y,width:d-i,height:f-o,rotation:ke.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),D1.forEach(e=>{this._createAnchor(e)}),this._createAnchor("rotater"),this._elementsCreated=!0}_createAnchor(e){const n=new $m({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:e+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:Iz?10:"auto"}),s=this;n.on("mousedown touchstart",function(i){s._handleMouseDown(i)}),n.on("dragstart",i=>{n.stopDrag(),i.cancelBubble=!0}),n.on("dragend",i=>{i.cancelBubble=!0}),n.on("mouseenter",()=>{const i=ke.getAngle(this.rotation()),o=this.rotateAnchorCursor(),d=Jz(e,i,o);n.getStage().content&&(n.getStage().content.style.cursor=d),this._cursorChange=!0}),n.on("mouseout",()=>{n.getStage().content&&(n.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(n)}_createBack(){const e=new Te({name:"back",width:0,height:0,sceneFunc(n,s){const i=s.getParent(),o=i.padding(),d=s.width(),f=s.height();if(n.beginPath(),n.rect(-o,-o,d+o*2,f+o*2),i.rotateEnabled()&&i.rotateLineVisible()){const p=i.rotateAnchorAngle(),y=i.rotateAnchorOffset(),S=ee.degToRad(p),b=Math.sin(S),_=-Math.cos(S),j=d/2,w=f/2;let T=1/0;_<0?T=Math.min(T,-w/_):_>0&&(T=Math.min(T,(f-w)/_)),b<0?T=Math.min(T,-j/b):b>0&&(T=Math.min(T,(d-j)/b));const O=j+b*T,R=w+_*T,M=ee._sign(f),z=O+b*y*M,k=R+_*y*M;n.moveTo(O,R),n.lineTo(z,k)}n.fillStrokeShape(s)},hitFunc:(n,s)=>{if(!this.shouldOverdrawWholeArea())return;const i=this.padding();n.beginPath(),n.rect(-i,-i,s.width()+i*2,s.height()+i*2),n.fillStrokeShape(s)}});this.add(e),this._proxyDrag(e),e.on("dragstart",n=>{n.cancelBubble=!0}),e.on("dragmove",n=>{n.cancelBubble=!0}),e.on("dragend",n=>{n.cancelBubble=!0}),this.on("dragmove",n=>{this.update()})}_handleMouseDown(e){if(this._transforming)return;this._movingAnchorName=e.target.name().split(" ")[0];const n=this._getNodeRect(),s=n.width,i=n.height,o=Math.sqrt(Math.pow(s,2)+Math.pow(i,2));this.sin=Math.abs(i/o),this.cos=Math.abs(s/o),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;const d=e.target.getAbsolutePosition(),f=e.target.getStage().getPointerPosition();this._anchorDragOffset={x:f.x-d.x,y:f.y-d.y},Hb++,this._fire("transformstart",{evt:e.evt,target:this.getNode()}),this._nodes.forEach(p=>{p._fire("transformstart",{evt:e.evt,target:p})})}_handleMouseMove(e){let n,s,i;const o=this.findOne("."+this._movingAnchorName),d=o.getStage();d.setPointersPositions(e);const f=d.getPointerPosition();let p={x:f.x-this._anchorDragOffset.x,y:f.y-this._anchorDragOffset.y};const y=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(p=this.anchorDragBoundFunc()(y,p,e)),o.setAbsolutePosition(p);const S=o.getAbsolutePosition();if(y.x===S.x&&y.y===S.y)return;if(this._movingAnchorName==="rotater"){const M=this._getNodeRect();n=o.x()-M.width/2,s=-o.y()+M.height/2;const z=ke.getAngle(this.rotateAnchorAngle());let k=Math.atan2(-s,n)+Math.PI/2-z;M.height<0&&(k-=Math.PI);const P=ke.getAngle(this.rotation())+k,L=ke.getAngle(this.rotationSnapTolerance()),V=ek(this.rotationSnaps(),P,L)-M.rotation,Z=$z(M,V);this._fitNodesInto(Z,e);return}const b=this.shiftBehavior();let _;b==="inverted"?_=this.keepRatio()&&!e.shiftKey:b==="none"?_=this.keepRatio():_=this.keepRatio()||e.shiftKey;let j=this.centeredScaling()||e.altKey;if(this._movingAnchorName==="top-left"){if(_){const M=j?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};i=Math.sqrt(Math.pow(M.x-o.x(),2)+Math.pow(M.y-o.y(),2));const z=this.findOne(".top-left").x()>M.x?-1:1,k=this.findOne(".top-left").y()>M.y?-1:1;n=i*this.cos*z,s=i*this.sin*k,this.findOne(".top-left").x(M.x-n),this.findOne(".top-left").y(M.y-s)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(o.y());else if(this._movingAnchorName==="top-right"){if(_){const M=j?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};i=Math.sqrt(Math.pow(o.x()-M.x,2)+Math.pow(M.y-o.y(),2));const z=this.findOne(".top-right").x()<M.x?-1:1,k=this.findOne(".top-right").y()>M.y?-1:1;n=i*this.cos*z,s=i*this.sin*k,this.findOne(".top-right").x(M.x+n),this.findOne(".top-right").y(M.y-s)}var w=o.position();this.findOne(".top-left").y(w.y),this.findOne(".bottom-right").x(w.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(o.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(o.x());else if(this._movingAnchorName==="bottom-left"){if(_){const M=j?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};i=Math.sqrt(Math.pow(M.x-o.x(),2)+Math.pow(o.y()-M.y,2));const z=M.x<o.x()?-1:1,k=o.y()<M.y?-1:1;n=i*this.cos*z,s=i*this.sin*k,o.x(M.x-n),o.y(M.y+s)}w=o.position(),this.findOne(".top-left").x(w.x),this.findOne(".bottom-right").y(w.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(o.y());else if(this._movingAnchorName==="bottom-right"){if(_){const M=j?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};i=Math.sqrt(Math.pow(o.x()-M.x,2)+Math.pow(o.y()-M.y,2));const z=this.findOne(".bottom-right").x()<M.x?-1:1,k=this.findOne(".bottom-right").y()<M.y?-1:1;n=i*this.cos*z,s=i*this.sin*k,this.findOne(".bottom-right").x(M.x+n),this.findOne(".bottom-right").y(M.y+s)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));if(j=this.centeredScaling()||e.altKey,j){const M=this.findOne(".top-left"),z=this.findOne(".bottom-right"),k=M.x(),G=M.y(),P=this.getWidth()-z.x(),L=this.getHeight()-z.y();z.move({x:-k,y:-G}),M.move({x:P,y:L})}const T=this.findOne(".top-left").getAbsolutePosition();n=T.x,s=T.y;const O=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),R=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:n,y:s,width:O,height:R,rotation:ke.getAngle(this.rotation())},e)}_handleMouseUp(e){this._removeEvents(e)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(e){var n;if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));const s=this.getNode();Hb--,this._fire("transformend",{evt:e,target:s}),(n=this.getLayer())===null||n===void 0||n.batchDraw(),s&&this._nodes.forEach(i=>{var o;i._fire("transformend",{evt:e,target:i}),(o=i.getLayer())===null||o===void 0||o.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(e,n){const s=this._getNodeRect(),i=1;if(ee._inRange(e.width,-this.padding()*2-i,i)){this.update();return}if(ee._inRange(e.height,-this.padding()*2-i,i)){this.update();return}const o=new Cr;if(o.rotate(ke.getAngle(this.rotation())),this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("left")>=0){const _=o.point({x:-this.padding()*2,y:0});e.x+=_.x,e.y+=_.y,e.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=_.x,this._anchorDragOffset.y-=_.y}else if(this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("right")>=0){const _=o.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=_.x,this._anchorDragOffset.y-=_.y,e.width+=this.padding()*2}if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("top")>=0){const _=o.point({x:0,y:-this.padding()*2});e.x+=_.x,e.y+=_.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=_.x,this._anchorDragOffset.y-=_.y,e.height+=this.padding()*2}else if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const _=o.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=_.x,this._anchorDragOffset.y-=_.y,e.height+=this.padding()*2}if(this.boundBoxFunc()){const _=this.boundBoxFunc()(s,e);_?e=_:ee.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const d=1e7,f=new Cr;f.translate(s.x,s.y),f.rotate(s.rotation),f.scale(s.width/d,s.height/d);const p=new Cr,y=e.width/d,S=e.height/d;this.flipEnabled()===!1?(p.translate(e.x,e.y),p.rotate(e.rotation),p.translate(e.width<0?e.width:0,e.height<0?e.height:0),p.scale(Math.abs(y),Math.abs(S))):(p.translate(e.x,e.y),p.rotate(e.rotation),p.scale(y,S));const b=p.multiply(f.invert());this._nodes.forEach(_=>{var j;if(!_.getStage())return;const w=_.getParent().getAbsoluteTransform(),T=_.getTransform().copy();T.translate(_.offsetX(),_.offsetY());const O=new Cr;O.multiply(w.copy().invert()).multiply(b).multiply(w).multiply(T);const R=O.decompose();_.setAttrs(R),(j=_.getLayer())===null||j===void 0||j.batchDraw()}),this.rotation(ee._getRotation(e.rotation)),this._nodes.forEach(_=>{this._fire("transform",{evt:n,target:_}),_._fire("transform",{evt:n,target:_})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(e,n){this.findOne(e).setAttrs(n)}update(){var e;const n=this._getNodeRect();this.rotation(ee._getRotation(n.rotation));const s=n.width,i=n.height,o=this.enabledAnchors(),d=this.resizeEnabled(),f=this.padding(),p=this.anchorSize(),y=this.find("._anchor");y.forEach(P=>{P.setAttrs({width:p,height:p,offsetX:p/2,offsetY:p/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:p/2+f,offsetY:p/2+f,visible:d&&o.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:s/2,y:0,offsetY:p/2+f,visible:d&&o.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:s,y:0,offsetX:p/2-f,offsetY:p/2+f,visible:d&&o.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:p/2+f,visible:d&&o.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:s,y:i/2,offsetX:p/2-f,visible:d&&o.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:p/2+f,offsetY:p/2-f,visible:d&&o.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:s/2,y:i,offsetY:p/2-f,visible:d&&o.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:s,y:i,offsetX:p/2-f,offsetY:p/2-f,visible:d&&o.indexOf("bottom-right")>=0});const S=this.rotateAnchorAngle(),b=this.rotateAnchorOffset(),_=ee.degToRad(S),j=Math.sin(_),w=-Math.cos(_),T=s/2,O=i/2;let R=1/0;w<0?R=Math.min(R,-O/w):w>0&&(R=Math.min(R,(i-O)/w)),j<0?R=Math.min(R,-T/j):j>0&&(R=Math.min(R,(s-T)/j));const M=T+j*R,z=O+w*R,k=ee._sign(i);this._batchChangeChild(".rotater",{x:M+j*b*k,y:z+w*b*k-f*w,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:s,height:i,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),draggable:this.nodes().some(P=>P.draggable()),x:0,y:0});const G=this.anchorStyleFunc();G&&y.forEach(P=>{G(P)}),(e=this.getLayer())===null||e===void 0||e.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();const e=this.findOne("."+this._movingAnchorName);e&&e.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),ah.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}add(...e){return this._elementsCreated?(ee.error("You cannot add external nodes to the Transformer. Use tr.nodes([node]) instead."),this):super.add(...e)}toObject(){return De.prototype.toObject.call(this)}clone(e){return De.prototype.clone.call(this,e)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}Lt.isTransforming=()=>Hb>0;function tk(t){return t instanceof Array||ee.warn("enabledAnchors value should be an array"),t instanceof Array&&t.forEach(function(e){D1.indexOf(e)===-1&&ee.warn("Unknown anchor name: "+e+". Available names are: "+D1.join(", "))}),t||[]}Lt.prototype.className="Transformer";ea(Lt);K.addGetterSetter(Lt,"enabledAnchors",D1,tk);K.addGetterSetter(Lt,"flipEnabled",!0,Mi());K.addGetterSetter(Lt,"resizeEnabled",!0);K.addGetterSetter(Lt,"anchorSize",10,Oe());K.addGetterSetter(Lt,"rotateEnabled",!0);K.addGetterSetter(Lt,"rotateLineVisible",!0);K.addGetterSetter(Lt,"rotationSnaps",[]);K.addGetterSetter(Lt,"rotateAnchorOffset",50,Oe());K.addGetterSetter(Lt,"rotateAnchorAngle",0,Oe());K.addGetterSetter(Lt,"rotateAnchorCursor","crosshair");K.addGetterSetter(Lt,"rotationSnapTolerance",5,Oe());K.addGetterSetter(Lt,"borderEnabled",!0);K.addGetterSetter(Lt,"anchorStroke","rgb(0, 161, 255)");K.addGetterSetter(Lt,"anchorStrokeWidth",1,Oe());K.addGetterSetter(Lt,"anchorFill","white");K.addGetterSetter(Lt,"anchorCornerRadius",0,Oe());K.addGetterSetter(Lt,"borderStroke","rgb(0, 161, 255)");K.addGetterSetter(Lt,"borderStrokeWidth",1,Oe());K.addGetterSetter(Lt,"borderDash");K.addGetterSetter(Lt,"keepRatio",!0);K.addGetterSetter(Lt,"shiftBehavior","default");K.addGetterSetter(Lt,"centeredScaling",!1);K.addGetterSetter(Lt,"ignoreStroke",!1);K.addGetterSetter(Lt,"padding",0,Oe());K.addGetterSetter(Lt,"nodes");K.addGetterSetter(Lt,"node");K.addGetterSetter(Lt,"boundBoxFunc");K.addGetterSetter(Lt,"anchorDragBoundFunc");K.addGetterSetter(Lt,"anchorStyleFunc");K.addGetterSetter(Lt,"shouldOverdrawWholeArea",!1);K.addGetterSetter(Lt,"useSingleNodeRotation",!0);K.backCompat(Lt,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class yo extends Te{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.radius(),0,ke.getAngle(this.angle()),this.clockwise()),e.lineTo(0,0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}yo.prototype.className="Wedge";yo.prototype._centroid=!0;yo.prototype._attrsAffectingSize=["radius"];ea(yo);K.addGetterSetter(yo,"radius",0,Oe());K.addGetterSetter(yo,"angle",0,Oe());K.addGetterSetter(yo,"clockwise",!1);K.backCompat(yo,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});function V5(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}const nk=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],ak=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function sk(t,e){const n=t.data,s=t.width,i=t.height;let o,d,f,p,y,S,b,_,j,w,T,O,R,M,z,k,G,P,L,U;const V=e+e+1,Z=s-1,re=i-1,ne=e+1,W=ne*(ne+1)/2,ie=new V5,ce=nk[e],Y=ak[e];let $=null,ae=ie,Ne=null,me=null;for(let B=1;B<V;B++)ae=ae.next=new V5,B===ne&&($=ae);ae.next=ie,f=d=0;for(let B=0;B<i;B++){O=R=M=z=p=y=S=b=0,_=ne*(k=n[d]),j=ne*(G=n[d+1]),w=ne*(P=n[d+2]),T=ne*(L=n[d+3]),p+=W*k,y+=W*G,S+=W*P,b+=W*L,ae=ie;for(let I=0;I<ne;I++)ae.r=k,ae.g=G,ae.b=P,ae.a=L,ae=ae.next;for(let I=1;I<ne;I++)o=d+((Z<I?Z:I)<<2),p+=(ae.r=k=n[o])*(U=ne-I),y+=(ae.g=G=n[o+1])*U,S+=(ae.b=P=n[o+2])*U,b+=(ae.a=L=n[o+3])*U,O+=k,R+=G,M+=P,z+=L,ae=ae.next;Ne=ie,me=$;for(let I=0;I<s;I++)n[d+3]=L=b*ce>>Y,L!==0?(L=255/L,n[d]=(p*ce>>Y)*L,n[d+1]=(y*ce>>Y)*L,n[d+2]=(S*ce>>Y)*L):n[d]=n[d+1]=n[d+2]=0,p-=_,y-=j,S-=w,b-=T,_-=Ne.r,j-=Ne.g,w-=Ne.b,T-=Ne.a,o=f+((o=I+e+1)<Z?o:Z)<<2,O+=Ne.r=n[o],R+=Ne.g=n[o+1],M+=Ne.b=n[o+2],z+=Ne.a=n[o+3],p+=O,y+=R,S+=M,b+=z,Ne=Ne.next,_+=k=me.r,j+=G=me.g,w+=P=me.b,T+=L=me.a,O-=k,R-=G,M-=P,z-=L,me=me.next,d+=4;f+=s}for(let B=0;B<s;B++){R=M=z=O=y=S=b=p=0,d=B<<2,_=ne*(k=n[d]),j=ne*(G=n[d+1]),w=ne*(P=n[d+2]),T=ne*(L=n[d+3]),p+=W*k,y+=W*G,S+=W*P,b+=W*L,ae=ie;for(let fe=0;fe<ne;fe++)ae.r=k,ae.g=G,ae.b=P,ae.a=L,ae=ae.next;let I=s;for(let fe=1;fe<=e;fe++)d=I+B<<2,p+=(ae.r=k=n[d])*(U=ne-fe),y+=(ae.g=G=n[d+1])*U,S+=(ae.b=P=n[d+2])*U,b+=(ae.a=L=n[d+3])*U,O+=k,R+=G,M+=P,z+=L,ae=ae.next,fe<re&&(I+=s);d=B,Ne=ie,me=$;for(let fe=0;fe<i;fe++)o=d<<2,n[o+3]=L=b*ce>>Y,L>0?(L=255/L,n[o]=(p*ce>>Y)*L,n[o+1]=(y*ce>>Y)*L,n[o+2]=(S*ce>>Y)*L):n[o]=n[o+1]=n[o+2]=0,p-=_,y-=j,S-=w,b-=T,_-=Ne.r,j-=Ne.g,w-=Ne.b,T-=Ne.a,o=B+((o=fe+ne)<re?o:re)*s<<2,p+=O+=Ne.r=n[o],y+=R+=Ne.g=n[o+1],S+=M+=Ne.b=n[o+2],b+=z+=Ne.a=n[o+3],Ne=Ne.next,_+=k=me.r,j+=G=me.g,w+=P=me.b,T+=L=me.a,O-=k,R-=G,M-=P,z-=L,me=me.next,d+=s}}const rk=function(e){const n=Math.round(this.blurRadius());n>0&&sk(e,n)};K.addGetterSetter(De,"blurRadius",0,Oe(),K.afterSetFilter);const ik=function(t){const e=this.brightness()*255,n=t.data,s=n.length;for(let i=0;i<s;i+=4)n[i]+=e,n[i+1]+=e,n[i+2]+=e};K.addGetterSetter(De,"brightness",0,Oe(),K.afterSetFilter);const lk=function(t){const e=this.brightness(),n=t.data,s=n.length;for(let i=0;i<s;i+=4)n[i]=Math.min(255,n[i]*e),n[i+1]=Math.min(255,n[i+1]*e),n[i+2]=Math.min(255,n[i+2]*e)},ok=function(t){const e=Math.pow((this.contrast()+100)/100,2),n=t.data,s=n.length;let i=150,o=150,d=150;for(let f=0;f<s;f+=4)i=n[f],o=n[f+1],d=n[f+2],i/=255,i-=.5,i*=e,i+=.5,i*=255,o/=255,o-=.5,o*=e,o+=.5,o*=255,d/=255,d-=.5,d*=e,d+=.5,d*=255,i=i<0?0:i>255?255:i,o=o<0?0:o>255?255:o,d=d<0?0:d>255?255:d,n[f]=i,n[f+1]=o,n[f+2]=d};K.addGetterSetter(De,"contrast",0,Oe(),K.afterSetFilter);const ck=function(t){var e,n,s,i,o,d,f,p,y;const S=t.data,b=t.width,_=t.height,j=Math.min(1,Math.max(0,(n=(e=this.embossStrength)===null||e===void 0?void 0:e.call(this))!==null&&n!==void 0?n:.5)),w=Math.min(1,Math.max(0,(i=(s=this.embossWhiteLevel)===null||s===void 0?void 0:s.call(this))!==null&&i!==void 0?i:.5)),O=(f={"top-left":315,top:270,"top-right":225,right:180,"bottom-right":135,bottom:90,"bottom-left":45,left:0}[(d=(o=this.embossDirection)===null||o===void 0?void 0:o.call(this))!==null&&d!==void 0?d:"top-left"])!==null&&f!==void 0?f:315,R=!!((y=(p=this.embossBlend)===null||p===void 0?void 0:p.call(this))!==null&&y!==void 0&&y),M=j*10,z=w*255,k=O*Math.PI/180,G=Math.cos(k),P=Math.sin(k),L=128/1020*M,U=new Uint8ClampedArray(S),V=new Float32Array(b*_);for(let ie=0,ce=0;ce<S.length;ce+=4,ie++)V[ie]=.2126*U[ce]+.7152*U[ce+1]+.0722*U[ce+2];const Z=[-1,0,1,-2,0,2,-1,0,1],re=[-1,-2,-1,0,0,0,1,2,1],ne=[-b-1,-b,-b+1,-1,0,1,b-1,b,b+1],W=ie=>ie<0?0:ie>255?255:ie;for(let ie=1;ie<_-1;ie++)for(let ce=1;ce<b-1;ce++){const Y=ie*b+ce;let $=0,ae=0;$+=V[Y+ne[0]]*Z[0],ae+=V[Y+ne[0]]*re[0],$+=V[Y+ne[1]]*Z[1],ae+=V[Y+ne[1]]*re[1],$+=V[Y+ne[2]]*Z[2],ae+=V[Y+ne[2]]*re[2],$+=V[Y+ne[3]]*Z[3],ae+=V[Y+ne[3]]*re[3],$+=V[Y+ne[5]]*Z[5],ae+=V[Y+ne[5]]*re[5],$+=V[Y+ne[6]]*Z[6],ae+=V[Y+ne[6]]*re[6],$+=V[Y+ne[7]]*Z[7],ae+=V[Y+ne[7]]*re[7],$+=V[Y+ne[8]]*Z[8],ae+=V[Y+ne[8]]*re[8];const Ne=G*$+P*ae,me=W(z+Ne*L),B=Y*4;if(R){const I=me-z;S[B]=W(U[B]+I),S[B+1]=W(U[B+1]+I),S[B+2]=W(U[B+2]+I),S[B+3]=U[B+3]}else S[B]=S[B+1]=S[B+2]=me,S[B+3]=U[B+3]}for(let ie=0;ie<b;ie++){let ce=ie*4,Y=((_-1)*b+ie)*4;S[ce]=U[ce],S[ce+1]=U[ce+1],S[ce+2]=U[ce+2],S[ce+3]=U[ce+3],S[Y]=U[Y],S[Y+1]=U[Y+1],S[Y+2]=U[Y+2],S[Y+3]=U[Y+3]}for(let ie=1;ie<_-1;ie++){let ce=ie*b*4,Y=(ie*b+(b-1))*4;S[ce]=U[ce],S[ce+1]=U[ce+1],S[ce+2]=U[ce+2],S[ce+3]=U[ce+3],S[Y]=U[Y],S[Y+1]=U[Y+1],S[Y+2]=U[Y+2],S[Y+3]=U[Y+3]}return t};K.addGetterSetter(De,"embossStrength",.5,Oe(),K.afterSetFilter);K.addGetterSetter(De,"embossWhiteLevel",.5,Oe(),K.afterSetFilter);K.addGetterSetter(De,"embossDirection","top-left",void 0,K.afterSetFilter);K.addGetterSetter(De,"embossBlend",!1,void 0,K.afterSetFilter);function Mx(t,e,n,s,i){const o=n-e,d=i-s;if(o===0)return s+d/2;if(d===0)return s;let f=(t-e)/o;return f=d*f+s,f}const uk=function(t){const e=t.data,n=e.length;let s=e[0],i=s,o,d=e[1],f=d,p,y=e[2],S=y,b;const _=this.enhance();if(_===0)return;for(let z=0;z<n;z+=4)o=e[z+0],o<s?s=o:o>i&&(i=o),p=e[z+1],p<d?d=p:p>f&&(f=p),b=e[z+2],b<y?y=b:b>S&&(S=b);i===s&&(i=255,s=0),f===d&&(f=255,d=0),S===y&&(S=255,y=0);let j,w,T,O,R,M;if(_>0)j=i+_*(255-i),w=s-_*(s-0),T=f+_*(255-f),O=d-_*(d-0),R=S+_*(255-S),M=y-_*(y-0);else{const z=(i+s)*.5;j=i+_*(i-z),w=s+_*(s-z);const k=(f+d)*.5;T=f+_*(f-k),O=d+_*(d-k);const G=(S+y)*.5;R=S+_*(S-G),M=y+_*(y-G)}for(let z=0;z<n;z+=4)e[z+0]=Mx(e[z+0],s,i,w,j),e[z+1]=Mx(e[z+1],d,f,O,T),e[z+2]=Mx(e[z+2],y,S,M,R)};K.addGetterSetter(De,"enhance",0,Oe(),K.afterSetFilter);const dk=function(t){const e=t.data,n=e.length;for(let s=0;s<n;s+=4){const i=.34*e[s]+.5*e[s+1]+.16*e[s+2];e[s]=i,e[s+1]=i,e[s+2]=i}};K.addGetterSetter(De,"hue",0,Oe(),K.afterSetFilter);K.addGetterSetter(De,"saturation",0,Oe(),K.afterSetFilter);K.addGetterSetter(De,"luminance",0,Oe(),K.afterSetFilter);const fk=function(t){const e=t.data,n=e.length,s=1,i=Math.pow(2,this.saturation()),o=Math.abs(this.hue()+360)%360,d=this.luminance()*127,f=s*i*Math.cos(o*Math.PI/180),p=s*i*Math.sin(o*Math.PI/180),y=.299*s+.701*f+.167*p,S=.587*s-.587*f+.33*p,b=.114*s-.114*f-.497*p,_=.299*s-.299*f-.328*p,j=.587*s+.413*f+.035*p,w=.114*s-.114*f+.293*p,T=.299*s-.3*f+1.25*p,O=.587*s-.586*f-1.05*p,R=.114*s+.886*f-.2*p;let M,z,k,G;for(let P=0;P<n;P+=4)M=e[P+0],z=e[P+1],k=e[P+2],G=e[P+3],e[P+0]=y*M+S*z+b*k+d,e[P+1]=_*M+j*z+w*k+d,e[P+2]=T*M+O*z+R*k+d,e[P+3]=G},hk=function(t){const e=t.data,n=e.length,s=Math.pow(2,this.value()),i=Math.pow(2,this.saturation()),o=Math.abs(this.hue()+360)%360,d=s*i*Math.cos(o*Math.PI/180),f=s*i*Math.sin(o*Math.PI/180),p=.299*s+.701*d+.167*f,y=.587*s-.587*d+.33*f,S=.114*s-.114*d-.497*f,b=.299*s-.299*d-.328*f,_=.587*s+.413*d+.035*f,j=.114*s-.114*d+.293*f,w=.299*s-.3*d+1.25*f,T=.587*s-.586*d-1.05*f,O=.114*s+.886*d-.2*f;for(let R=0;R<n;R+=4){const M=e[R+0],z=e[R+1],k=e[R+2],G=e[R+3];e[R+0]=p*M+y*z+S*k,e[R+1]=b*M+_*z+j*k,e[R+2]=w*M+T*z+O*k,e[R+3]=G}};K.addGetterSetter(De,"hue",0,Oe(),K.afterSetFilter);K.addGetterSetter(De,"saturation",0,Oe(),K.afterSetFilter);K.addGetterSetter(De,"value",0,Oe(),K.afterSetFilter);const pk=function(t){const e=t.data,n=e.length;for(let s=0;s<n;s+=4)e[s]=255-e[s],e[s+1]=255-e[s+1],e[s+2]=255-e[s+2]},mk=function(t,e,n){const s=t.data,i=e.data,o=t.width,d=t.height,f=n.polarCenterX||o/2,p=n.polarCenterY||d/2;let y=Math.sqrt(f*f+p*p),S=o-f,b=d-p;const _=Math.sqrt(S*S+b*b);y=_>y?_:y;const j=d,w=o,T=360/w*Math.PI/180;for(let O=0;O<w;O+=1){const R=Math.sin(O*T),M=Math.cos(O*T);for(let z=0;z<j;z+=1){S=Math.floor(f+y*z/j*M),b=Math.floor(p+y*z/j*R);let k=(b*o+S)*4;const G=s[k+0],P=s[k+1],L=s[k+2],U=s[k+3];k=(O+z*o)*4,i[k+0]=G,i[k+1]=P,i[k+2]=L,i[k+3]=U}}},gk=function(t,e,n){const s=t.data,i=e.data,o=t.width,d=t.height,f=n.polarCenterX||o/2,p=n.polarCenterY||d/2;let y=Math.sqrt(f*f+p*p),S=o-f,b=d-p;const _=Math.sqrt(S*S+b*b);y=_>y?_:y;const j=d,w=o,T=0;let O,R;for(S=0;S<o;S+=1)for(b=0;b<d;b+=1){const M=S-f,z=b-p,k=Math.sqrt(M*M+z*z)*j/y;let G=(Math.atan2(z,M)*180/Math.PI+360+T)%360;G=G*w/360,O=Math.floor(G),R=Math.floor(k);let P=(R*o+O)*4;const L=s[P+0],U=s[P+1],V=s[P+2],Z=s[P+3];P=(b*o+S)*4,i[P+0]=L,i[P+1]=U,i[P+2]=V,i[P+3]=Z}},yk=function(t){const e=t.width,n=t.height;let s,i,o,d,f,p,y,S,b,_,j=Math.round(this.kaleidoscopePower());const w=Math.round(this.kaleidoscopeAngle()),T=Math.floor(e*(w%360)/360);if(j<1)return;const O=ee.createCanvasElement();O.width=e,O.height=n;const R=O.getContext("2d").getImageData(0,0,e,n);ee.releaseCanvas(O),mk(t,R,{polarCenterX:e/2,polarCenterY:n/2});let M=e/Math.pow(2,j);for(;M<=8;)M=M*2,j-=1;M=Math.ceil(M);let z=M,k=0,G=z,P=1;for(T+M>e&&(k=z,G=0,P=-1),i=0;i<n;i+=1)for(s=k;s!==G;s+=P)o=Math.round(s+T)%e,b=(e*i+o)*4,f=R.data[b+0],p=R.data[b+1],y=R.data[b+2],S=R.data[b+3],_=(e*i+s)*4,R.data[_+0]=f,R.data[_+1]=p,R.data[_+2]=y,R.data[_+3]=S;for(i=0;i<n;i+=1)for(z=Math.floor(M),d=0;d<j;d+=1){for(s=0;s<z+1;s+=1)b=(e*i+s)*4,f=R.data[b+0],p=R.data[b+1],y=R.data[b+2],S=R.data[b+3],_=(e*i+z*2-s-1)*4,R.data[_+0]=f,R.data[_+1]=p,R.data[_+2]=y,R.data[_+3]=S;z*=2}gk(R,t,{})};K.addGetterSetter(De,"kaleidoscopePower",2,Oe(),K.afterSetFilter);K.addGetterSetter(De,"kaleidoscopeAngle",0,Oe(),K.afterSetFilter);function u1(t,e,n){let s=(n*t.width+e)*4;const i=[];return i.push(t.data[s++],t.data[s++],t.data[s++],t.data[s++]),i}function lm(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2))}function xk(t){const e=[0,0,0];for(let n=0;n<t.length;n++)e[0]+=t[n][0],e[1]+=t[n][1],e[2]+=t[n][2];return e[0]/=t.length,e[1]/=t.length,e[2]/=t.length,e}function bk(t,e){const n=u1(t,0,0),s=u1(t,t.width-1,0),i=u1(t,0,t.height-1),o=u1(t,t.width-1,t.height-1),d=e||10;if(lm(n,s)<d&&lm(s,o)<d&&lm(o,i)<d&&lm(i,n)<d){const f=xk([s,n,o,i]),p=[];for(let y=0;y<t.width*t.height;y++){const S=lm(f,[t.data[y*4],t.data[y*4+1],t.data[y*4+2]]);p[y]=S<d?0:255}return p}}function vk(t,e){for(let n=0;n<t.width*t.height;n++)t.data[4*n+3]=e[n]}function Sk(t,e,n){const s=[1,1,1,1,0,1,1,1,1],i=Math.round(Math.sqrt(s.length)),o=Math.floor(i/2),d=[];for(let f=0;f<n;f++)for(let p=0;p<e;p++){const y=f*e+p;let S=0;for(let b=0;b<i;b++)for(let _=0;_<i;_++){const j=f+b-o,w=p+_-o;if(j>=0&&j<n&&w>=0&&w<e){const T=j*e+w,O=s[b*i+_];S+=t[T]*O}}d[y]=S===2040?255:0}return d}function Nk(t,e,n){const s=[1,1,1,1,1,1,1,1,1],i=Math.round(Math.sqrt(s.length)),o=Math.floor(i/2),d=[];for(let f=0;f<n;f++)for(let p=0;p<e;p++){const y=f*e+p;let S=0;for(let b=0;b<i;b++)for(let _=0;_<i;_++){const j=f+b-o,w=p+_-o;if(j>=0&&j<n&&w>=0&&w<e){const T=j*e+w,O=s[b*i+_];S+=t[T]*O}}d[y]=S>=1020?255:0}return d}function _k(t,e,n){const s=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(s.length)),o=Math.floor(i/2),d=[];for(let f=0;f<n;f++)for(let p=0;p<e;p++){const y=f*e+p;let S=0;for(let b=0;b<i;b++)for(let _=0;_<i;_++){const j=f+b-o,w=p+_-o;if(j>=0&&j<n&&w>=0&&w<e){const T=j*e+w,O=s[b*i+_];S+=t[T]*O}}d[y]=S}return d}const Ck=function(t){const e=this.threshold();let n=bk(t,e);return n&&(n=Sk(n,t.width,t.height),n=Nk(n,t.width,t.height),n=_k(n,t.width,t.height),vk(t,n)),t};K.addGetterSetter(De,"threshold",0,Oe(),K.afterSetFilter);const jk=function(t){const e=this.noise()*255,n=t.data,s=n.length,i=e/2;for(let o=0;o<s;o+=4)n[o+0]+=i-2*i*Math.random(),n[o+1]+=i-2*i*Math.random(),n[o+2]+=i-2*i*Math.random()};K.addGetterSetter(De,"noise",.2,Oe(),K.afterSetFilter);const wk=function(t){let e=Math.ceil(this.pixelSize()),n=t.width,s=t.height,i=Math.ceil(n/e),o=Math.ceil(s/e),d=t.data;if(e<=0){ee.error("pixelSize value can not be <= 0");return}for(let f=0;f<i;f+=1)for(let p=0;p<o;p+=1){let y=0,S=0,b=0,_=0;const j=f*e,w=j+e,T=p*e,O=T+e;let R=0;for(let M=j;M<w;M+=1)if(!(M>=n))for(let z=T;z<O;z+=1){if(z>=s)continue;const k=(n*z+M)*4;y+=d[k+0],S+=d[k+1],b+=d[k+2],_+=d[k+3],R+=1}y=y/R,S=S/R,b=b/R,_=_/R;for(let M=j;M<w;M+=1)if(!(M>=n))for(let z=T;z<O;z+=1){if(z>=s)continue;const k=(n*z+M)*4;d[k+0]=y,d[k+1]=S,d[k+2]=b,d[k+3]=_}}};K.addGetterSetter(De,"pixelSize",8,Oe(),K.afterSetFilter);const Ek=function(t){const e=Math.round(this.levels()*254)+1,n=t.data,s=n.length,i=255/e;for(let o=0;o<s;o+=1)n[o]=Math.floor(n[o]/i)*i};K.addGetterSetter(De,"levels",.5,Oe(),K.afterSetFilter);const Tk=function(t){const e=t.data,n=e.length,s=this.red(),i=this.green(),o=this.blue();for(let d=0;d<n;d+=4){const f=(.34*e[d]+.5*e[d+1]+.16*e[d+2])/255;e[d]=f*s,e[d+1]=f*i,e[d+2]=f*o,e[d+3]=e[d+3]}};K.addGetterSetter(De,"red",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});K.addGetterSetter(De,"green",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});K.addGetterSetter(De,"blue",0,v8,K.afterSetFilter);const Rk=function(t){const e=t.data,n=e.length,s=this.red(),i=this.green(),o=this.blue(),d=this.alpha();for(let f=0;f<n;f+=4){const p=1-d;e[f]=s*d+e[f]*p,e[f+1]=i*d+e[f+1]*p,e[f+2]=o*d+e[f+2]*p}};K.addGetterSetter(De,"red",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});K.addGetterSetter(De,"green",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});K.addGetterSetter(De,"blue",0,v8,K.afterSetFilter);K.addGetterSetter(De,"alpha",1,function(t){return this._filterUpToDate=!1,t>1?1:t<0?0:t});const Ok=function(t){const e=t.data,n=e.length;for(let s=0;s<n;s+=4){const i=e[s+0],o=e[s+1],d=e[s+2];e[s+0]=Math.min(255,i*.393+o*.769+d*.189),e[s+1]=Math.min(255,i*.349+o*.686+d*.168),e[s+2]=Math.min(255,i*.272+o*.534+d*.131)}},Mk=function(t){const n=t.data;for(let s=0;s<n.length;s+=4){const i=n[s],o=n[s+1],d=n[s+2];.2126*i+.7152*o+.0722*d>=128&&(n[s]=255-i,n[s+1]=255-o,n[s+2]=255-d)}return t},Ak=function(t){const e=this.threshold()*255,n=t.data,s=n.length;for(let i=0;i<s;i+=1)n[i]=n[i]<e?0:255};K.addGetterSetter(De,"threshold",.5,Oe(),K.afterSetFilter);sh.Util._assign(sh,{Arc:mo,Arrow:ld,Circle:ph,Ellipse:qc,Image:Tr,Label:kv,Tag:od,Line:go,Path:Cn,Rect:$m,RegularPolygon:Hc,Ring:cd,Sprite:Sl,Star:Bc,Text:wn,TextPath:Ua,Transformer:Lt,Wedge:yo,Filters:{Blur:rk,Brightness:lk,Brighten:ik,Contrast:ok,Emboss:ck,Enhance:uk,Grayscale:dk,HSL:fk,HSV:hk,Invert:pk,Kaleidoscope:yk,Mask:Ck,Noise:jk,Pixelate:wk,Posterize:Ek,RGB:Tk,RGBA:Rk,Sepia:Ok,Solarize:Mk,Threshold:Ak}});var Ax={exports:{}},Dx={exports:{}};/**
|
|
570
|
-
* @license React
|
|
571
|
-
* react-reconciler.production.js
|
|
572
|
-
*
|
|
573
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
574
|
-
*
|
|
575
|
-
* This source code is licensed under the MIT license found in the
|
|
576
|
-
* LICENSE file in the root directory of this source tree.
|
|
577
|
-
*/var Q5;function Dk(){return Q5||(Q5=1,(function(t){t.exports=function(e){function n(l,c,g,x){return new Yh(l,c,g,x)}function s(){}function i(l){var c="https://react.dev/errors/"+l;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)c+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+l+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(l){var c=l,g=l;if(l.alternate)for(;c.return;)c=c.return;else{l=c;do c=l,(c.flags&4098)!==0&&(g=c.return),l=c.return;while(l)}return c.tag===3?g:null}function d(l){if(o(l)!==l)throw Error(i(188))}function f(l){var c=l.alternate;if(!c){if(c=o(l),c===null)throw Error(i(188));return c!==l?null:l}for(var g=l,x=c;;){var C=g.return;if(C===null)break;var E=C.alternate;if(E===null){if(x=C.return,x!==null){g=x;continue}break}if(C.child===E.child){for(E=C.child;E;){if(E===g)return d(C),l;if(E===x)return d(C),c;E=E.sibling}throw Error(i(188))}if(g.return!==x.return)g=C,x=E;else{for(var q=!1,F=C.child;F;){if(F===g){q=!0,g=C,x=E;break}if(F===x){q=!0,x=C,g=E;break}F=F.sibling}if(!q){for(F=E.child;F;){if(F===g){q=!0,g=E,x=C;break}if(F===x){q=!0,x=E,g=C;break}F=F.sibling}if(!q)throw Error(i(189))}}if(g.alternate!==x)throw Error(i(190))}if(g.tag!==3)throw Error(i(188));return g.stateNode.current===g?l:c}function p(l){var c=l.tag;if(c===5||c===26||c===27||c===6)return l;for(l=l.child;l!==null;){if(c=p(l),c!==null)return c;l=l.sibling}return null}function y(l){var c=l.tag;if(c===5||c===26||c===27||c===6)return l;for(l=l.child;l!==null;){if(l.tag!==4&&(c=y(l),c!==null))return c;l=l.sibling}return null}function S(l){return l===null||typeof l!="object"?null:(l=gi&&l[gi]||l["@@iterator"],typeof l=="function"?l:null)}function b(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===Qi?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case kl:return"Fragment";case Ul:return"Profiler";case Ll:return"StrictMode";case Qd:return"Suspense";case mi:return"SuspenseList";case fu:return"Activity"}if(typeof l=="object")switch(l.$$typeof){case zl:return"Portal";case Zs:return l.displayName||"Context";case du:return(l._context.displayName||"Context")+".Consumer";case Bo:var c=l.render;return l=l.displayName,l||(l=c.displayName||c.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case Kd:return c=l.displayName||null,c!==null?c:b(l.type)||"Memo";case Ia:c=l._payload,l=l._init;try{return b(l(c))}catch{}}return null}function _(l){return{current:l}}function j(l){0>Pl||(l.current=rf[Pl],rf[Pl]=null,Pl--)}function w(l,c){Pl++,rf[Pl]=l.current,l.current=c}function T(l){return l>>>=0,l===0?32:31-(lf(l)/y0|0)|0}function O(l){var c=l&42;if(c!==0)return c;switch(l&-l){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return l&261888;case 262144:case 524288:case 1048576:case 2097152:return l&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function R(l,c,g){var x=l.pendingLanes;if(x===0)return 0;var C=0,E=l.suspendedLanes,q=l.pingedLanes;l=l.warmLanes;var F=x&134217727;return F!==0?(x=F&~E,x!==0?C=O(x):(q&=F,q!==0?C=O(q):g||(g=F&~l,g!==0&&(C=O(g))))):(F=x&~E,F!==0?C=O(F):q!==0?C=O(q):g||(g=x&~l,g!==0&&(C=O(g)))),C===0?0:c!==0&&c!==C&&(c&E)===0&&(E=C&-C,g=c&-c,E>=g||E===32&&(g&4194048)!==0)?c:C}function M(l,c){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&c)===0}function z(l,c){switch(l){case 1:case 2:case 4:case 8:case 64:return c+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function k(){var l=Xo;return Xo<<=1,(Xo&62914560)===0&&(Xo=4194304),l}function G(l){for(var c=[],g=0;31>g;g++)c.push(l);return c}function P(l,c){l.pendingLanes|=c,c!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function L(l,c,g,x,C,E){var q=l.pendingLanes;l.pendingLanes=g,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=g,l.entangledLanes&=g,l.errorRecoveryDisabledLanes&=g,l.shellSuspendCounter=0;var F=l.entanglements,pe=l.expirationTimes,Se=l.hiddenUpdates;for(g=q&~g;0<g;){var Me=31-ps(g),je=1<<Me;F[Me]=0,pe[Me]=-1;var Ue=Se[Me];if(Ue!==null)for(Se[Me]=null,Me=0;Me<Ue.length;Me++){var st=Ue[Me];st!==null&&(st.lane&=-536870913)}g&=~je}x!==0&&U(l,x,0),E!==0&&C===0&&l.tag!==0&&(l.suspendedLanes|=E&~(q&~c))}function U(l,c,g){l.pendingLanes|=c,l.suspendedLanes&=~c;var x=31-ps(c);l.entangledLanes|=c,l.entanglements[x]=l.entanglements[x]|1073741824|g&261930}function V(l,c){var g=l.entangledLanes|=c;for(l=l.entanglements;g;){var x=31-ps(g),C=1<<x;C&c|l[x]&c&&(l[x]|=c),g&=~C}}function Z(l,c){var g=c&-c;return g=(g&42)!==0?1:re(g),(g&(l.suspendedLanes|c))!==0?0:g}function re(l){switch(l){case 2:l=1;break;case 8:l=4;break;case 32:l=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:l=128;break;case 268435456:l=134217728;break;default:l=0}return l}function ne(l){return l&=-l,2<l?8<l?(l&134217727)!==0?32:268435456:8:2}function W(l){if(typeof Tp=="function"&&v0(l),ms&&typeof ms.setStrictMode=="function")try{ms.setStrictMode(Vl,l)}catch{}}function ie(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}function ce(l){if(hf===void 0)try{throw Error()}catch(g){var c=g.stack.trim().match(/\n( *(at )?)/);hf=c&&c[1]||"",Qr=-1<g.stack.indexOf(`
|
|
578
|
-
at`)?" (<anonymous>)":-1<g.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
579
|
-
`+hf+l+Qr}function Y(l,c){if(!l||Su)return"";Su=!0;var g=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var x={DetermineComponentFrameRoot:function(){try{if(c){var je=function(){throw Error()};if(Object.defineProperty(je.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(je,[])}catch(st){var Ue=st}Reflect.construct(l,[],je)}else{try{je.call()}catch(st){Ue=st}l.call(je.prototype)}}else{try{throw Error()}catch(st){Ue=st}(je=l())&&typeof je.catch=="function"&&je.catch(function(){})}}catch(st){if(st&&Ue&&typeof st.stack=="string")return[st.stack,Ue.stack]}return[null,null]}};x.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var C=Object.getOwnPropertyDescriptor(x.DetermineComponentFrameRoot,"name");C&&C.configurable&&Object.defineProperty(x.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var E=x.DetermineComponentFrameRoot(),q=E[0],F=E[1];if(q&&F){var pe=q.split(`
|
|
580
|
-
`),Se=F.split(`
|
|
581
|
-
`);for(C=x=0;x<pe.length&&!pe[x].includes("DetermineComponentFrameRoot");)x++;for(;C<Se.length&&!Se[C].includes("DetermineComponentFrameRoot");)C++;if(x===pe.length||C===Se.length)for(x=pe.length-1,C=Se.length-1;1<=x&&0<=C&&pe[x]!==Se[C];)C--;for(;1<=x&&0<=C;x--,C--)if(pe[x]!==Se[C]){if(x!==1||C!==1)do if(x--,C--,0>C||pe[x]!==Se[C]){var Me=`
|
|
582
|
-
`+pe[x].replace(" at new "," at ");return l.displayName&&Me.includes("<anonymous>")&&(Me=Me.replace("<anonymous>",l.displayName)),Me}while(1<=x&&0<=C);break}}}finally{Su=!1,Error.prepareStackTrace=g}return(g=l?l.displayName||l.name:"")?ce(g):""}function $(l,c){switch(l.tag){case 26:case 27:case 5:return ce(l.type);case 16:return ce("Lazy");case 13:return l.child!==c&&c!==null?ce("Suspense Fallback"):ce("Suspense");case 19:return ce("SuspenseList");case 0:case 15:return Y(l.type,!1);case 11:return Y(l.type.render,!1);case 1:return Y(l.type,!0);case 31:return ce("Activity");default:return""}}function ae(l){try{var c="",g=null;do c+=$(l,g),g=l,l=l.return;while(l);return c}catch(x){return`
|
|
583
|
-
Error generating stack: `+x.message+`
|
|
584
|
-
`+x.stack}}function Ne(l,c){if(typeof l=="object"&&l!==null){var g=Rp.get(l);return g!==void 0?g:(c={value:l,source:c,stack:ae(c)},Rp.set(l,c),c)}return{value:l,source:c,stack:ae(c)}}function me(l,c){bi[Kr++]=Nu,bi[Kr++]=nn,nn=l,Nu=c}function B(l,c,g){Ws[Ds++]=Ma,Ws[Ds++]=xr,Ws[Ds++]=$s,$s=l;var x=Ma;l=xr;var C=32-ps(x)-1;x&=~(1<<C),g+=1;var E=32-ps(c)+C;if(30<E){var q=C-C%5;E=(x&(1<<q)-1).toString(32),x>>=q,C-=q,Ma=1<<32-ps(c)+C|g<<C|x,xr=E+l}else Ma=1<<E|g<<C|x,xr=l}function I(l){l.return!==null&&(me(l,1),B(l,1,0))}function fe(l){for(;l===nn;)nn=bi[--Kr],bi[Kr]=null,Nu=bi[--Kr],bi[Kr]=null;for(;l===$s;)$s=Ws[--Ds],Ws[Ds]=null,xr=Ws[--Ds],Ws[Ds]=null,Ma=Ws[--Ds],Ws[Ds]=null}function xe(l,c){Ws[Ds++]=Ma,Ws[Ds++]=xr,Ws[Ds++]=$s,Ma=c.id,xr=c.overflow,$s=l}function _e(l,c){w(Aa,c),w(vi,l),w(_a,null),l=Dg(c),j(_a),w(_a,l)}function Ce(){j(_a),j(vi),j(Aa)}function ze(l){l.memoizedState!==null&&w(_u,l);var c=_a.current,g=Yo(c,l.type);c!==g&&(w(vi,l),w(_a,g))}function Ee(l){vi.current===l&&(j(_a),j(vi)),_u.current===l&&(j(_u),Zn?Bl._currentValue=Hl:Bl._currentValue2=Hl)}function we(l){var c=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Kn(Ne(c,l)),pf}function Vt(l,c){if(!vn)throw Error(i(175));r0(l.stateNode,l.type,l.memoizedProps,c,l)||we(l,!0)}function et(l){for(da=l.return;da;)switch(da.tag){case 5:case 31:case 13:Wa=!1;return;case 27:case 3:Wa=!0;return;default:da=da.return}}function Mt(l){if(!vn||l!==da)return!1;if(!Nt)return et(l),Nt=!0,!1;var c=l.tag;if(ua?c!==3&&c!==27&&(c!==5||Ko(l.type)&&!Ja(l.type,l.memoizedProps))&&Sn&&we(l):c!==3&&(c!==5||Ko(l.type)&&!Ja(l.type,l.memoizedProps))&&Sn&&we(l),et(l),c===13){if(!vn)throw Error(i(316));if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(i(317));Sn=yp(l)}else if(c===31){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(i(317));Sn=l0(l)}else Sn=ua&&c===27?Jg(l.type,Sn):da?Ig(l.stateNode):null;return!0}function Ht(){vn&&(Sn=da=null,Nt=!1)}function En(){var l=Xr;return l!==null&&(ys===null?ys=l:ys.push.apply(ys,l),Xr=null),l}function Kn(l){Xr===null?Xr=[l]:Xr.push(l)}function Gt(l,c,g){Zn?(w(er,c._currentValue),c._currentValue=g):(w(er,c._currentValue2),c._currentValue2=g)}function fn(l){var c=er.current;Zn?l._currentValue=c:l._currentValue2=c,j(er)}function ur(l,c,g){for(;l!==null;){var x=l.alternate;if((l.childLanes&c)!==c?(l.childLanes|=c,x!==null&&(x.childLanes|=c)):x!==null&&(x.childLanes&c)!==c&&(x.childLanes|=c),l===g)break;l=l.return}}function Ft(l,c,g,x){var C=l.child;for(C!==null&&(C.return=l);C!==null;){var E=C.dependencies;if(E!==null){var q=C.child;E=E.firstContext;e:for(;E!==null;){var F=E;E=C;for(var pe=0;pe<c.length;pe++)if(F.context===c[pe]){E.lanes|=g,F=E.alternate,F!==null&&(F.lanes|=g),ur(E.return,g,l),x||(q=null);break e}E=F.next}}else if(C.tag===18){if(q=C.return,q===null)throw Error(i(341));q.lanes|=g,E=q.alternate,E!==null&&(E.lanes|=g),ur(q,g,l),q=null}else q=C.child;if(q!==null)q.return=C;else for(q=C;q!==null;){if(q===l){q=null;break}if(C=q.sibling,C!==null){C.return=q.return,q=C;break}q=q.return}C=q}}function Et(l,c,g,x){l=null;for(var C=c,E=!1;C!==null;){if(!E){if((C.flags&524288)!==0)E=!0;else if((C.flags&262144)!==0)break}if(C.tag===10){var q=C.alternate;if(q===null)throw Error(i(387));if(q=q.memoizedProps,q!==null){var F=C.type;Jn(C.pendingProps.value,q.value)||(l!==null?l.push(F):l=[F])}}else if(C===_u.current){if(q=C.alternate,q===null)throw Error(i(387));q.memoizedState.memoizedState!==C.memoizedState.memoizedState&&(l!==null?l.push(Bl):l=[Bl])}C=C.return}l!==null&&Ft(c,l,g,x),c.flags|=262144}function qn(l){for(l=l.firstContext;l!==null;){var c=l.context;if(!Jn(Zn?c._currentValue:c._currentValue2,l.memoizedValue))return!0;l=l.next}return!1}function hn(l){cn=l,br=null,l=l.dependencies,l!==null&&(l.firstContext=null)}function Zt(l){return Ss(cn,l)}function Xn(l,c){return cn===null&&hn(l),Ss(l,c)}function Ss(l,c){var g=Zn?c._currentValue:c._currentValue2;if(c={context:c,memoizedValue:g,next:null},br===null){if(l===null)throw Error(i(308));br=c,l.dependencies={lanes:0,firstContext:c},l.flags|=524288}else br=br.next=c;return g}function dr(){return{controller:new S0,data:new Map,refCount:0}}function Qa(l){l.refCount--,l.refCount===0&&Ca(Ny,function(){l.controller.abort()})}function la(){}function Ea(l){l!==It&&l.next===null&&(It===null?Cu=It=l:It=It.next=l),tr=!0,Pa||(Pa=!0,ba())}function rs(l,c){if(!mf&&tr){mf=!0;do for(var g=!1,x=Cu;x!==null;){if(l!==0){var C=x.pendingLanes;if(C===0)var E=0;else{var q=x.suspendedLanes,F=x.pingedLanes;E=(1<<31-ps(42|l)+1)-1,E&=C&~(q&~F),E=E&201326741?E&201326741|1:E?E|2:0}E!==0&&(g=!0,is(x,E))}else E=_t,E=R(x,x===pt?E:0,x.cancelPendingCommit!==null||x.timeoutHandle!==hs),(E&3)===0||M(x,E)||(g=!0,is(x,E));x=x.next}while(g);mf=!1}}function fr(){Ns()}function Ns(){tr=Pa=!1;var l=0;Ii!==0&&ql()&&(l=Ii);for(var c=Ga(),g=null,x=Cu;x!==null;){var C=x.next,E=Hs(x,c);E===0?(x.next=null,g===null?Cu=C:g.next=C,C===null&&(It=g)):(g=x,(l!==0||(E&3)!==0)&&(tr=!0)),x=C}ra!==0&&ra!==5||rs(l),Ii!==0&&(Ii=0)}function Hs(l,c){for(var g=l.suspendedLanes,x=l.pingedLanes,C=l.expirationTimes,E=l.pendingLanes&-62914561;0<E;){var q=31-ps(E),F=1<<q,pe=C[q];pe===-1?((F&g)===0||(F&x)!==0)&&(C[q]=z(F,c)):pe<=c&&(l.expiredLanes|=F),E&=~F}if(c=pt,g=_t,g=R(l,l===c?g:0,l.cancelPendingCommit!==null||l.timeoutHandle!==hs),x=l.callbackNode,g===0||l===c&&(Wt===2||Wt===9)||l.cancelPendingCommit!==null)return x!==null&&x!==null&&cf(x),l.callbackNode=null,l.callbackPriority=0;if((g&3)===0||M(l,g)){if(c=g&-g,c===l.callbackPriority)return c;switch(x!==null&&cf(x),ne(g)){case 2:case 8:g=b0;break;case 32:g=vu;break;case 268435456:g=df;break;default:g=vu}return x=ta.bind(null,l),g=bu(g,x),l.callbackPriority=c,l.callbackNode=g,c}return x!==null&&x!==null&&cf(x),l.callbackPriority=2,l.callbackNode=null,2}function ta(l,c){if(ra!==0&&ra!==5)return l.callbackNode=null,l.callbackPriority=0,null;var g=l.callbackNode;if(Pr()&&l.callbackNode!==g)return null;var x=_t;return x=R(l,l===pt?x:0,l.cancelPendingCommit!==null||l.timeoutHandle!==hs),x===0?null:(yr(l,x,c),Hs(l,Ga()),l.callbackNode!=null&&l.callbackNode===g?ta.bind(null,l):null)}function is(l,c){if(Pr())return null;yr(l,c,!0)}function ba(){tp?np(function(){(bt&6)!==0?bu(uf,fr):Ns()}):bu(uf,fr)}function Ta(){if(Ii===0){var l=Si;l===0&&(l=of,of<<=1,(of&261888)===0&&(of=256)),Ii=l}return Ii}function Pc(l,c){if(Fo===null){var g=Fo=[];Op=0,Si=Ta(),fa={status:"pending",value:void 0,then:function(x){g.push(x)}}}return Op++,c.then(Nl,Nl),c}function Nl(){if(--Op===0&&Fo!==null){fa!==null&&(fa.status="fulfilled");var l=Fo;Fo=null,Si=0,fa=null;for(var c=0;c<l.length;c++)(0,l[c])()}}function _s(l,c){var g=[],x={status:"pending",value:null,reason:null,then:function(C){g.push(C)}};return l.then(function(){x.status="fulfilled",x.value=c;for(var C=0;C<g.length;C++)(0,g[C])(c)},function(C){for(x.status="rejected",x.reason=C,C=0;C<g.length;C++)(0,g[C])(void 0)}),x}function hr(){var l=Ji.current;return l!==null?l:pt.pooledCache}function yt(l,c){c===null?w(Ji,Ji.current):w(Ji,c.pool)}function mt(){var l=hr();return l===null?null:{parent:Zn?Nn._currentValue:Nn._currentValue2,pool:l}}function Qt(l,c){if(Jn(l,c))return!0;if(typeof l!="object"||l===null||typeof c!="object"||c===null)return!1;var g=Object.keys(l),x=Object.keys(c);if(g.length!==x.length)return!1;for(x=0;x<g.length;x++){var C=g[x];if(!Sy.call(c,C)||!Jn(l[C],c[C]))return!1}return!0}function At(l){return l=l.status,l==="fulfilled"||l==="rejected"}function Hn(l,c,g){switch(g=l[g],g===void 0?l.push(c):g!==c&&(c.then(la,la),c=g),c.status){case"fulfilled":return c.value;case"rejected":throw l=c.reason,yn(l),l;default:if(typeof c.status=="string")c.then(la,la);else{if(l=pt,l!==null&&100<l.shellSuspendCounter)throw Error(i(482));l=c,l.status="pending",l.then(function(x){if(c.status==="pending"){var C=c;C.status="fulfilled",C.value=x}},function(x){if(c.status==="pending"){var C=c;C.status="rejected",C.reason=x}})}switch(c.status){case"fulfilled":return c.value;case"rejected":throw l=c.reason,yn(l),l}throw $a=c,ha}}function rn(l){try{var c=l._init;return c(l._payload)}catch(g){throw g!==null&&typeof g=="object"&&typeof g.then=="function"?($a=g,ha):g}}function Fn(){if($a===null)throw Error(i(459));var l=$a;return $a=null,l}function yn(l){if(l===ha||l===ar)throw Error(i(483))}function Ra(l){var c=Ql;return Ql+=1,Wi===null&&(Wi=[]),Hn(Wi,l,c)}function oa(l,c){c=c.props.ref,l.ref=c!==void 0?c:null}function ls(l,c){throw c.$$typeof===Dl?Error(i(525)):(l=Object.prototype.toString.call(c),Error(i(31,l==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":l)))}function Bs(l){function c(ue,se){if(l){var he=ue.deletions;he===null?(ue.deletions=[se],ue.flags|=16):he.push(se)}}function g(ue,se){if(!l)return null;for(;se!==null;)c(ue,se),se=se.sibling;return null}function x(ue){for(var se=new Map;ue!==null;)ue.key!==null?se.set(ue.key,ue):se.set(ue.index,ue),ue=ue.sibling;return se}function C(ue,se){return ue=Ms(ue,se),ue.index=0,ue.sibling=null,ue}function E(ue,se,he){return ue.index=he,l?(he=ue.alternate,he!==null?(he=he.index,he<se?(ue.flags|=67108866,se):he):(ue.flags|=67108866,se)):(ue.flags|=1048576,se)}function q(ue){return l&&ue.alternate===null&&(ue.flags|=67108866),ue}function F(ue,se,he,Re){return se===null||se.tag!==6?(se=Vh(he,ue.mode,Re),se.return=ue,se):(se=C(se,he),se.return=ue,se)}function pe(ue,se,he,Re){var Fe=he.type;return Fe===kl?Me(ue,se,he.props.children,Re,he.key):se!==null&&(se.elementType===Fe||typeof Fe=="object"&&Fe!==null&&Fe.$$typeof===Ia&&rn(Fe)===se.type)?(se=C(se,he.props),oa(se,he),se.return=ue,se):(se=pi(he.type,he.key,he.props,null,ue.mode,Re),oa(se,he),se.return=ue,se)}function Se(ue,se,he,Re){return se===null||se.tag!==4||se.stateNode.containerInfo!==he.containerInfo||se.stateNode.implementation!==he.implementation?(se=Kh(he,ue.mode,Re),se.return=ue,se):(se=C(se,he.children||[]),se.return=ue,se)}function Me(ue,se,he,Re,Fe){return se===null||se.tag!==7?(se=Fs(he,ue.mode,Re,Fe),se.return=ue,se):(se=C(se,he),se.return=ue,se)}function je(ue,se,he){if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return se=Vh(""+se,ue.mode,he),se.return=ue,se;if(typeof se=="object"&&se!==null){switch(se.$$typeof){case Yr:return he=pi(se.type,se.key,se.props,null,ue.mode,he),oa(he,se),he.return=ue,he;case zl:return se=Kh(se,ue.mode,he),se.return=ue,se;case Ia:return se=rn(se),je(ue,se,he)}if(Ki(se)||S(se))return se=Fs(se,ue.mode,he,null),se.return=ue,se;if(typeof se.then=="function")return je(ue,Ra(se),he);if(se.$$typeof===Zs)return je(ue,Xn(ue,se),he);ls(ue,se)}return null}function Ue(ue,se,he,Re){var Fe=se!==null?se.key:null;if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return Fe!==null?null:F(ue,se,""+he,Re);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case Yr:return he.key===Fe?pe(ue,se,he,Re):null;case zl:return he.key===Fe?Se(ue,se,he,Re):null;case Ia:return he=rn(he),Ue(ue,se,he,Re)}if(Ki(he)||S(he))return Fe!==null?null:Me(ue,se,he,Re,null);if(typeof he.then=="function")return Ue(ue,se,Ra(he),Re);if(he.$$typeof===Zs)return Ue(ue,se,Xn(ue,he),Re);ls(ue,he)}return null}function st(ue,se,he,Re,Fe){if(typeof Re=="string"&&Re!==""||typeof Re=="number"||typeof Re=="bigint")return ue=ue.get(he)||null,F(se,ue,""+Re,Fe);if(typeof Re=="object"&&Re!==null){switch(Re.$$typeof){case Yr:return ue=ue.get(Re.key===null?he:Re.key)||null,pe(se,ue,Re,Fe);case zl:return ue=ue.get(Re.key===null?he:Re.key)||null,Se(se,ue,Re,Fe);case Ia:return Re=rn(Re),st(ue,se,he,Re,Fe)}if(Ki(Re)||S(Re))return ue=ue.get(he)||null,Me(se,ue,Re,Fe,null);if(typeof Re.then=="function")return st(ue,se,he,Ra(Re),Fe);if(Re.$$typeof===Zs)return st(ue,se,he,Xn(se,Re),Fe);ls(se,Re)}return null}function ja(ue,se,he,Re){for(var Fe=null,Ln=null,Ie=se,Dt=se=0,wa=null;Ie!==null&&Dt<he.length;Dt++){Ie.index>Dt?(wa=Ie,Ie=null):wa=Ie.sibling;var Bt=Ue(ue,Ie,he[Dt],Re);if(Bt===null){Ie===null&&(Ie=wa);break}l&&Ie&&Bt.alternate===null&&c(ue,Ie),se=E(Bt,se,Dt),Ln===null?Fe=Bt:Ln.sibling=Bt,Ln=Bt,Ie=wa}if(Dt===he.length)return g(ue,Ie),Nt&&me(ue,Dt),Fe;if(Ie===null){for(;Dt<he.length;Dt++)Ie=je(ue,he[Dt],Re),Ie!==null&&(se=E(Ie,se,Dt),Ln===null?Fe=Ie:Ln.sibling=Ie,Ln=Ie);return Nt&&me(ue,Dt),Fe}for(Ie=x(Ie);Dt<he.length;Dt++)wa=st(Ie,ue,Dt,he[Dt],Re),wa!==null&&(l&&wa.alternate!==null&&Ie.delete(wa.key===null?Dt:wa.key),se=E(wa,se,Dt),Ln===null?Fe=wa:Ln.sibling=wa,Ln=wa);return l&&Ie.forEach(function(ir){return c(ue,ir)}),Nt&&me(ue,Dt),Fe}function nc(ue,se,he,Re){if(he==null)throw Error(i(151));for(var Fe=null,Ln=null,Ie=se,Dt=se=0,wa=null,Bt=he.next();Ie!==null&&!Bt.done;Dt++,Bt=he.next()){Ie.index>Dt?(wa=Ie,Ie=null):wa=Ie.sibling;var ir=Ue(ue,Ie,Bt.value,Re);if(ir===null){Ie===null&&(Ie=wa);break}l&&Ie&&ir.alternate===null&&c(ue,Ie),se=E(ir,se,Dt),Ln===null?Fe=ir:Ln.sibling=ir,Ln=ir,Ie=wa}if(Bt.done)return g(ue,Ie),Nt&&me(ue,Dt),Fe;if(Ie===null){for(;!Bt.done;Dt++,Bt=he.next())Bt=je(ue,Bt.value,Re),Bt!==null&&(se=E(Bt,se,Dt),Ln===null?Fe=Bt:Ln.sibling=Bt,Ln=Bt);return Nt&&me(ue,Dt),Fe}for(Ie=x(Ie);!Bt.done;Dt++,Bt=he.next())Bt=st(Ie,ue,Dt,Bt.value,Re),Bt!==null&&(l&&Bt.alternate!==null&&Ie.delete(Bt.key===null?Dt:Bt.key),se=E(Bt,se,Dt),Ln===null?Fe=Bt:Ln.sibling=Bt,Ln=Bt);return l&&Ie.forEach(function(_y){return c(ue,_y)}),Nt&&me(ue,Dt),Fe}function il(ue,se,he,Re){if(typeof he=="object"&&he!==null&&he.type===kl&&he.key===null&&(he=he.props.children),typeof he=="object"&&he!==null){switch(he.$$typeof){case Yr:e:{for(var Fe=he.key;se!==null;){if(se.key===Fe){if(Fe=he.type,Fe===kl){if(se.tag===7){g(ue,se.sibling),Re=C(se,he.props.children),Re.return=ue,ue=Re;break e}}else if(se.elementType===Fe||typeof Fe=="object"&&Fe!==null&&Fe.$$typeof===Ia&&rn(Fe)===se.type){g(ue,se.sibling),Re=C(se,he.props),oa(Re,he),Re.return=ue,ue=Re;break e}g(ue,se);break}else c(ue,se);se=se.sibling}he.type===kl?(Re=Fs(he.props.children,ue.mode,Re,he.key),Re.return=ue,ue=Re):(Re=pi(he.type,he.key,he.props,null,ue.mode,Re),oa(Re,he),Re.return=ue,ue=Re)}return q(ue);case zl:e:{for(Fe=he.key;se!==null;){if(se.key===Fe)if(se.tag===4&&se.stateNode.containerInfo===he.containerInfo&&se.stateNode.implementation===he.implementation){g(ue,se.sibling),Re=C(se,he.children||[]),Re.return=ue,ue=Re;break e}else{g(ue,se);break}else c(ue,se);se=se.sibling}Re=Kh(he,ue.mode,Re),Re.return=ue,ue=Re}return q(ue);case Ia:return he=rn(he),il(ue,se,he,Re)}if(Ki(he))return ja(ue,se,he,Re);if(S(he)){if(Fe=S(he),typeof Fe!="function")throw Error(i(150));return he=Fe.call(he),nc(ue,se,he,Re)}if(typeof he.then=="function")return il(ue,se,Ra(he),Re);if(he.$$typeof===Zs)return il(ue,se,Xn(ue,he),Re);ls(ue,he)}return typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint"?(he=""+he,se!==null&&se.tag===6?(g(ue,se.sibling),Re=C(se,he),Re.return=ue,ue=Re):(g(ue,se),Re=Vh(he,ue.mode,Re),Re.return=ue,ue=Re),q(ue)):g(ue,se)}return function(ue,se,he,Re){try{Ql=0;var Fe=il(ue,se,he,Re);return Wi=null,Fe}catch(Ie){if(Ie===ha||Ie===ar)throw Ie;var Ln=n(29,Ie,null,ue.mode);return Ln.lanes=Re,Ln.return=ue,Ln}finally{}}}function qe(){for(var l=Zr,c=Kl=Zr=0;c<l;){var g=za[c];za[c++]=null;var x=za[c];za[c++]=null;var C=za[c];za[c++]=null;var E=za[c];if(za[c++]=null,x!==null&&C!==null){var q=x.pending;q===null?C.next=C:(C.next=q.next,q.next=C),x.pending=C}E!==0&&xt(g,C,E)}}function tt(l,c,g,x){za[Zr++]=l,za[Zr++]=c,za[Zr++]=g,za[Zr++]=x,Kl|=x,l.lanes|=x,l=l.alternate,l!==null&&(l.lanes|=x)}function Qe(l,c,g,x){return tt(l,c,g,x),Ze(l)}function ot(l,c){return tt(l,null,null,c),Ze(l)}function xt(l,c,g){l.lanes|=g;var x=l.alternate;x!==null&&(x.lanes|=g);for(var C=!1,E=l.return;E!==null;)E.childLanes|=g,x=E.alternate,x!==null&&(x.childLanes|=g),E.tag===22&&(l=E.stateNode,l===null||l._visibility&1||(C=!0)),l=E,E=E.return;return l.tag===3?(E=l.stateNode,C&&c!==null&&(C=31-ps(g),l=E.hiddenUpdates,x=l[C],x===null?l[C]=[c]:x.push(c),c.lane=g|536870912),E):null}function Ze(l){if(50<Ut)throw Ut=0,Ou=null,Error(i(185));for(var c=l.return;c!==null;)l=c,c=l.return;return l.tag===3?l.stateNode:null}function ct(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function sn(l,c){l=l.updateQueue,c.updateQueue===l&&(c.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,callbacks:null})}function Tt(l){return{lane:l,tag:0,payload:null,callback:null,next:null}}function pn(l,c,g){var x=l.updateQueue;if(x===null)return null;if(x=x.shared,(bt&2)!==0){var C=x.pending;return C===null?c.next=c:(c.next=C.next,C.next=c),x.pending=c,c=Ze(l),xt(l,null,g),c}return tt(l,x,c,g),Ze(l)}function Rr(l,c,g){if(c=c.updateQueue,c!==null&&(c=c.shared,(g&4194048)!==0)){var x=c.lanes;x&=l.pendingLanes,g|=x,c.lanes=g,V(l,g)}}function os(l,c){var g=l.updateQueue,x=l.alternate;if(x!==null&&(x=x.updateQueue,g===x)){var C=null,E=null;if(g=g.firstBaseUpdate,g!==null){do{var q={lane:g.lane,tag:g.tag,payload:g.payload,callback:null,next:null};E===null?C=E=q:E=E.next=q,g=g.next}while(g!==null);E===null?C=E=c:E=E.next=c}else C=E=c;g={baseState:x.baseState,firstBaseUpdate:C,lastBaseUpdate:E,shared:x.shared,callbacks:x.callbacks},l.updateQueue=g;return}l=g.lastBaseUpdate,l===null?g.firstBaseUpdate=c:l.next=c,g.lastBaseUpdate=c}function Ka(){if(yf){var l=fa;if(l!==null)throw l}}function Gs(l,c,g,x){yf=!1;var C=l.updateQueue;zs=!1;var E=C.firstBaseUpdate,q=C.lastBaseUpdate,F=C.shared.pending;if(F!==null){C.shared.pending=null;var pe=F,Se=pe.next;pe.next=null,q===null?E=Se:q.next=Se,q=pe;var Me=l.alternate;Me!==null&&(Me=Me.updateQueue,F=Me.lastBaseUpdate,F!==q&&(F===null?Me.firstBaseUpdate=Se:F.next=Se,Me.lastBaseUpdate=pe))}if(E!==null){var je=C.baseState;q=0,Me=Se=pe=null,F=E;do{var Ue=F.lane&-536870913,st=Ue!==F.lane;if(st?(_t&Ue)===Ue:(x&Ue)===Ue){Ue!==0&&Ue===Si&&(yf=!0),Me!==null&&(Me=Me.next={lane:0,tag:F.tag,payload:F.payload,callback:null,next:null});e:{var ja=l,nc=F;Ue=c;var il=g;switch(nc.tag){case 1:if(ja=nc.payload,typeof ja=="function"){je=ja.call(il,je,Ue);break e}je=ja;break e;case 3:ja.flags=ja.flags&-65537|128;case 0:if(ja=nc.payload,Ue=typeof ja=="function"?ja.call(il,je,Ue):ja,Ue==null)break e;je=Vd({},je,Ue);break e;case 2:zs=!0}}Ue=F.callback,Ue!==null&&(l.flags|=64,st&&(l.flags|=8192),st=C.callbacks,st===null?C.callbacks=[Ue]:st.push(Ue))}else st={lane:Ue,tag:F.tag,payload:F.payload,callback:F.callback,next:null},Me===null?(Se=Me=st,pe=je):Me=Me.next=st,q|=Ue;if(F=F.next,F===null){if(F=C.shared.pending,F===null)break;st=F,F=st.next,st.next=null,C.lastBaseUpdate=st,C.shared.pending=null}}while(!0);Me===null&&(pe=je),C.baseState=pe,C.firstBaseUpdate=Se,C.lastBaseUpdate=Me,E===null&&(C.shared.lanes=0),_i|=q,l.lanes=q,l.memoizedState=je}}function Pt(l,c){if(typeof l!="function")throw Error(i(191,l));l.call(c)}function pr(l,c){var g=l.callbacks;if(g!==null)for(l.callbacks=null,l=0;l<g.length;l++)Pt(g[l],c)}function mr(l,c){l=Jr,w($i,l),w(Xl,c),Jr=l|c.baseLanes}function Cs(){w($i,Jr),w(Xl,Xl.current)}function Tn(){Jr=$i.current,j(Xl),j($i)}function js(l){var c=l.alternate;w(Gn,Gn.current&1),w(gs,l),es===null&&(c===null||Xl.current!==null||c.memoizedState!==null)&&(es=l)}function ud(l){w(Gn,Gn.current),w(gs,l),es===null&&(es=l)}function Ai(l){l.tag===22?(w(Gn,Gn.current),w(gs,l),es===null&&(es=l)):ws()}function ws(){w(Gn,Gn.current),w(gs,gs.current)}function Es(l){j(gs),es===l&&(es=null),j(Gn)}function Yc(l){for(var c=l;c!==null;){if(c.tag===13){var g=c.memoizedState;if(g!==null&&(g=g.dehydrated,g===null||Fi(g)||Wd(g)))return c}else if(c.tag===19&&(c.memoizedProps.revealOrder==="forwards"||c.memoizedProps.revealOrder==="backwards"||c.memoizedProps.revealOrder==="unstable_legacy-backwards"||c.memoizedProps.revealOrder==="together")){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===l)break;for(;c.sibling===null;){if(c.return===null||c.return===l)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}function Rn(){throw Error(i(321))}function mh(l,c){if(c===null)return!1;for(var g=0;g<c.length&&g<l.length;g++)if(!Jn(l[g],c[g]))return!1;return!0}function xo(l,c,g,x,C,E){return Ni=E,it=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,Ke.H=l===null||l.memoizedState===null?Dn:Ir,Rt=!1,E=g(x,C),Rt=!1,ut&&(E=Or(c,g,x,C)),Vc(l),E}function Vc(l){Ke.H=ks;var c=Ve!==null&&Ve.next!==null;if(Ni=0,nt=Ve=it=null,ht=!1,sr=0,vr=null,c)throw Error(i(300));l===null||mn||(l=l.dependencies,l!==null&&qn(l)&&(mn=!0))}function Or(l,c,g,x){it=l;var C=0;do{if(ut&&(vr=null),sr=0,ut=!1,25<=C)throw Error(i(301));if(C+=1,nt=Ve=null,l.updateQueue!=null){var E=l.updateQueue;E.lastEffect=null,E.events=null,E.stores=null,E.memoCache!=null&&(E.memoCache.index=0)}Ke.H=el,E=c(g,x)}while(ut);return E}function Ps(){var l=Ke.H,c=l.useState()[0];return c=typeof c.then=="function"?Ha(c):c,l=l.useState()[0],(Ve!==null?Ve.memoizedState:null)!==l&&(it.flags|=1024),c}function dd(){var l=Ya!==0;return Ya=0,l}function gh(l,c,g){c.updateQueue=l.updateQueue,c.flags&=-2053,l.lanes&=~g}function Qc(l){if(ht){for(l=l.memoizedState;l!==null;){var c=l.queue;c!==null&&(c.pending=null),l=l.next}ht=!1}Ni=0,nt=Ve=it=null,ut=!1,sr=Ya=0,vr=null}function qa(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return nt===null?it.memoizedState=nt=l:nt=nt.next=l,nt}function xn(){if(Ve===null){var l=it.alternate;l=l!==null?l.memoizedState:null}else l=Ve.next;var c=nt===null?it.memoizedState:nt.next;if(c!==null)nt=c,Ve=l;else{if(l===null)throw it.alternate===null?Error(i(467)):Error(i(310));Ve=l,l={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},nt===null?it.memoizedState=nt=l:nt=nt.next=l}return nt}function fd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ha(l){var c=sr;return sr+=1,vr===null&&(vr=[]),l=Hn(vr,l,c),c=it,(nt===null?c.memoizedState:nt.next)===null&&(c=c.alternate,Ke.H=c===null||c.memoizedState===null?Dn:Ir),l}function bo(l){if(l!==null&&typeof l=="object"){if(typeof l.then=="function")return Ha(l);if(l.$$typeof===Zs)return Zt(l)}throw Error(i(438,String(l)))}function hd(l){var c=null,g=it.updateQueue;if(g!==null&&(c=g.memoCache),c==null){var x=it.alternate;x!==null&&(x=x.updateQueue,x!==null&&(x=x.memoCache,x!=null&&(c={data:x.data.map(function(C){return C.slice()}),index:0})))}if(c==null&&(c={data:[],index:0}),g===null&&(g=fd(),it.updateQueue=g),g.memoCache=c,g=c.data[c.index],g===void 0)for(g=c.data[c.index]=Array(l),x=0;x<l;x++)g[x]=Fh;return c.index++,g}function gr(l,c){return typeof c=="function"?c(l):c}function li(l){var c=xn();return pd(c,Ve,l)}function pd(l,c,g){var x=l.queue;if(x===null)throw Error(i(311));x.lastRenderedReducer=g;var C=l.baseQueue,E=x.pending;if(E!==null){if(C!==null){var q=C.next;C.next=E.next,E.next=q}c.baseQueue=C=E,x.pending=null}if(E=l.baseState,C===null)l.memoizedState=E;else{c=C.next;var F=q=null,pe=null,Se=c,Me=!1;do{var je=Se.lane&-536870913;if(je!==Se.lane?(_t&je)===je:(Ni&je)===je){var Ue=Se.revertLane;if(Ue===0)pe!==null&&(pe=pe.next={lane:0,revertLane:0,gesture:null,action:Se.action,hasEagerState:Se.hasEagerState,eagerState:Se.eagerState,next:null}),je===Si&&(Me=!0);else if((Ni&Ue)===Ue){Se=Se.next,Ue===Si&&(Me=!0);continue}else je={lane:0,revertLane:Se.revertLane,gesture:null,action:Se.action,hasEagerState:Se.hasEagerState,eagerState:Se.eagerState,next:null},pe===null?(F=pe=je,q=E):pe=pe.next=je,it.lanes|=Ue,_i|=Ue;je=Se.action,Rt&&g(E,je),E=Se.hasEagerState?Se.eagerState:g(E,je)}else Ue={lane:je,revertLane:Se.revertLane,gesture:Se.gesture,action:Se.action,hasEagerState:Se.hasEagerState,eagerState:Se.eagerState,next:null},pe===null?(F=pe=Ue,q=E):pe=pe.next=Ue,it.lanes|=je,_i|=je;Se=Se.next}while(Se!==null&&Se!==c);if(pe===null?q=E:pe.next=F,!Jn(E,l.memoizedState)&&(mn=!0,Me&&(g=fa,g!==null)))throw g;l.memoizedState=E,l.baseState=q,l.baseQueue=pe,x.lastRenderedState=E}return C===null&&(x.lanes=0),[l.memoizedState,x.dispatch]}function md(l){var c=xn(),g=c.queue;if(g===null)throw Error(i(311));g.lastRenderedReducer=l;var x=g.dispatch,C=g.pending,E=c.memoizedState;if(C!==null){g.pending=null;var q=C=C.next;do E=l(E,q.action),q=q.next;while(q!==C);Jn(E,c.memoizedState)||(mn=!0),c.memoizedState=E,c.baseQueue===null&&(c.baseState=E),g.lastRenderedState=E}return[E,x]}function _l(l,c,g){var x=it,C=xn(),E=Nt;if(E){if(g===void 0)throw Error(i(407));g=g()}else g=c();var q=!Jn((Ve||C).memoizedState,g);if(q&&(C.memoizedState=g,mn=!0),C=C.queue,No(xh.bind(null,x,C,l),[l]),C.getSnapshot!==c||q||nt!==null&&nt.memoizedState.tag&1){if(x.flags|=2048,Ts(9,{destroy:void 0},yh.bind(null,x,C,g,c),null),pt===null)throw Error(i(349));E||(Ni&127)!==0||eg(x,c,g)}return g}function eg(l,c,g){l.flags|=16384,l={getSnapshot:c,value:g},c=it.updateQueue,c===null?(c=fd(),it.updateQueue=c,c.stores=[l]):(g=c.stores,g===null?c.stores=[l]:g.push(l))}function yh(l,c,g,x){c.value=g,c.getSnapshot=x,gd(c)&&tg(l)}function xh(l,c,g){return g(function(){gd(c)&&tg(l)})}function gd(l){var c=l.getSnapshot;l=l.value;try{var g=c();return!Jn(l,g)}catch{return!0}}function tg(l){var c=ot(l,2);c!==null&&Mn(c,l,2)}function bh(l){var c=qa();if(typeof l=="function"){var g=l;if(l=g(),Rt){W(!0);try{g()}finally{W(!1)}}}return c.memoizedState=c.baseState=l,c.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:gr,lastRenderedState:l},c}function Kc(l,c,g,x){return l.baseState=g,pd(l,Ve,typeof x=="function"?x:gr)}function oi(l,c,g,x,C){if(Cd(l))throw Error(i(485));if(l=c.action,l!==null){var E={payload:C,action:l,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(q){E.listeners.push(q)}};Ke.T!==null?g(!0):E.isTransition=!1,x(E),g=c.pending,g===null?(E.next=c.pending=E,yd(c,E)):(E.next=g.next,c.pending=g.next=E)}}function yd(l,c){var g=c.action,x=c.payload,C=l.state;if(c.isTransition){var E=Ke.T,q={};Ke.T=q;try{var F=g(C,x),pe=Ke.S;pe!==null&&pe(q,F),xd(l,c,F)}catch(Se){Di(l,c,Se)}finally{E!==null&&q.types!==null&&(E.types=q.types),Ke.T=E}}else try{E=g(C,x),xd(l,c,E)}catch(Se){Di(l,c,Se)}}function xd(l,c,g){g!==null&&typeof g=="object"&&typeof g.then=="function"?g.then(function(x){Cl(l,c,x)},function(x){return Di(l,c,x)}):Cl(l,c,g)}function Cl(l,c,g){c.status="fulfilled",c.value=g,vh(c),l.state=g,c=l.pending,c!==null&&(g=c.next,g===c?l.pending=null:(g=g.next,c.next=g,yd(l,g)))}function Di(l,c,g){var x=l.pending;if(l.pending=null,x!==null){x=x.next;do c.status="rejected",c.reason=g,vh(c),c=c.next;while(c!==x)}l.action=null}function vh(l){l=l.listeners;for(var c=0;c<l.length;c++)(0,l[c])()}function bd(l,c){return c}function Sh(l,c){if(Nt){var g=pt.formState;if(g!==null){e:{var x=it;if(Nt){if(Sn){var C=Zg(Sn,Wa);if(C){Sn=Ig(C),x=hp(C);break e}}we(x)}x=!1}x&&(c=g[0])}}g=qa(),g.memoizedState=g.baseState=c,x={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bd,lastRenderedState:c},g.queue=x,g=lg.bind(null,it,x),x.dispatch=g,x=bh(!1);var E=_d.bind(null,it,!1,x.queue);return x=qa(),C={state:c,dispatch:null,action:l,pending:null},x.queue=C,g=oi.bind(null,it,C,E,g),C.dispatch=g,x.memoizedState=l,[c,g,!1]}function vo(l){var c=xn();return Mr(c,Ve,l)}function Mr(l,c,g){if(c=pd(l,c,bd)[0],l=li(gr)[0],typeof c=="object"&&c!==null&&typeof c.then=="function")try{var x=Ha(c)}catch(q){throw q===ha?ar:q}else x=c;c=xn();var C=c.queue,E=C.dispatch;return g!==c.memoizedState&&(it.flags|=2048,Ts(9,{destroy:void 0},Nh.bind(null,C,g),null)),[x,E,l]}function Nh(l,c){l.action=c}function So(l){var c=xn(),g=Ve;if(g!==null)return Mr(c,g,l);xn(),c=c.memoizedState,g=xn();var x=g.queue.dispatch;return g.memoizedState=l,[c,x,!1]}function Ts(l,c,g,x){return l={tag:l,create:g,deps:x,inst:c,next:null},c=it.updateQueue,c===null&&(c=fd(),it.updateQueue=c),g=c.lastEffect,g===null?c.lastEffect=l.next=l:(x=g.next,g.next=l,l.next=x,c.lastEffect=l),l}function vd(){return xn().memoizedState}function jl(l,c,g,x){var C=qa();it.flags|=l,C.memoizedState=Ts(1|c,{destroy:void 0},g,x===void 0?null:x)}function Xc(l,c,g,x){var C=xn();x=x===void 0?null:x;var E=C.memoizedState.inst;Ve!==null&&x!==null&&mh(x,Ve.memoizedState.deps)?C.memoizedState=Ts(c,E,g,x):(it.flags|=l,C.memoizedState=Ts(1|c,E,g,x))}function Fc(l,c){jl(8390656,8,l,c)}function No(l,c){Xc(2048,8,l,c)}function ng(l){it.flags|=4;var c=it.updateQueue;if(c===null)c=fd(),it.updateQueue=c,c.events=[l];else{var g=c.events;g===null?c.events=[l]:g.push(l)}}function Xa(l){var c=xn().memoizedState;return ng({ref:c,nextImpl:l}),function(){if((bt&2)!==0)throw Error(i(440));return c.impl.apply(void 0,arguments)}}function zi(l,c){return Xc(4,2,l,c)}function Zc(l,c){return Xc(4,4,l,c)}function _o(l,c){if(typeof c=="function"){l=l();var g=c(l);return function(){typeof g=="function"?g():c(null)}}if(c!=null)return l=l(),c.current=l,function(){c.current=null}}function ag(l,c,g){g=g!=null?g.concat([l]):null,Xc(4,4,_o.bind(null,c,l),g)}function Ic(){}function Sd(l,c){var g=xn();c=c===void 0?null:c;var x=g.memoizedState;return c!==null&&mh(c,x[1])?x[0]:(g.memoizedState=[l,c],l)}function Co(l,c){var g=xn();c=c===void 0?null:c;var x=g.memoizedState;if(c!==null&&mh(c,x[1]))return x[0];if(x=l(),Rt){W(!0);try{l()}finally{W(!1)}}return g.memoizedState=[x,c],x}function jo(l,c,g){return g===void 0||(Ni&1073741824)!==0&&(_t&261930)===0?l.memoizedState=c:(l.memoizedState=g,l=di(),it.lanes|=l,_i|=l,g)}function _h(l,c,g,x){return Jn(g,c)?g:Xl.current!==null?(l=jo(l,g,x),Jn(l,c)||(mn=!0),l):(Ni&42)===0||(Ni&1073741824)!==0&&(_t&261930)===0?(mn=!0,l.memoizedState=g):(l=di(),it.lanes|=l,_i|=l,c)}function sg(l,c,g,x,C){var E=Is();St(E!==0&&8>E?E:8);var q=Ke.T,F={};Ke.T=F,_d(l,!1,c,g);try{var pe=C(),Se=Ke.S;if(Se!==null&&Se(F,pe),pe!==null&&typeof pe=="object"&&typeof pe.then=="function"){var Me=_s(pe,x);Jc(l,c,Me,bn(l))}else Jc(l,c,x,bn(l))}catch(je){Jc(l,c,{then:function(){},status:"rejected",reason:je},bn())}finally{St(E),q!==null&&F.types!==null&&(q.types=F.types),Ke.T=q}}function rg(l){var c=l.memoizedState;if(c!==null)return c;c={memoizedState:Hl,baseState:Hl,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:gr,lastRenderedState:Hl},next:null};var g={};return c.next={memoizedState:g,baseState:g,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:gr,lastRenderedState:g},next:null},l.memoizedState=c,l=l.alternate,l!==null&&(l.memoizedState=c),c}function Ch(){return Zt(Bl)}function Nd(){return xn().memoizedState}function ig(){return xn().memoizedState}function dy(l){for(var c=l.return;c!==null;){switch(c.tag){case 24:case 3:var g=bn();l=Tt(g);var x=pn(c,l,g);x!==null&&(Mn(x,c,g),Rr(x,c,g)),c={cache:dr()},l.payload=c;return}c=c.return}}function fy(l,c,g){var x=bn();g={lane:x,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Cd(l)?og(c,g):(g=Qe(l,c,g,x),g!==null&&(Mn(g,l,x),cg(g,c,x)))}function lg(l,c,g){var x=bn();Jc(l,c,g,x)}function Jc(l,c,g,x){var C={lane:x,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null};if(Cd(l))og(c,C);else{var E=l.alternate;if(l.lanes===0&&(E===null||E.lanes===0)&&(E=c.lastRenderedReducer,E!==null))try{var q=c.lastRenderedState,F=E(q,g);if(C.hasEagerState=!0,C.eagerState=F,Jn(F,q))return tt(l,c,C,0),pt===null&&qe(),!1}catch{}finally{}if(g=Qe(l,c,C,x),g!==null)return Mn(g,l,x),cg(g,c,x),!0}return!1}function _d(l,c,g,x){if(x={lane:2,revertLane:Ta(),gesture:null,action:x,hasEagerState:!1,eagerState:null,next:null},Cd(l)){if(c)throw Error(i(479))}else c=Qe(l,g,x,2),c!==null&&Mn(c,l,2)}function Cd(l){var c=l.alternate;return l===it||c!==null&&c===it}function og(l,c){ut=ht=!0;var g=l.pending;g===null?c.next=c:(c.next=g.next,g.next=c),l.pending=c}function cg(l,c,g){if((g&4194048)!==0){var x=c.lanes;x&=l.pendingLanes,g|=x,c.lanes=g,V(l,g)}}function jh(l,c,g,x){c=l.memoizedState,g=g(x,c),g=g==null?c:Vd({},c,g),l.memoizedState=g,l.lanes===0&&(l.updateQueue.baseState=g)}function jd(l,c,g,x,C,E,q){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(x,E,q):c.prototype&&c.prototype.isPureReactComponent?!Qt(g,x)||!Qt(C,E):!0}function ug(l,c,g,x){l=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(g,x),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(g,x),c.state!==l&&ju.enqueueReplaceState(c,c.state,null)}function wl(l,c){var g=c;if("ref"in c){g={};for(var x in c)x!=="ref"&&(g[x]=c[x])}if(l=l.defaultProps){g===c&&(g=Vd({},g));for(var C in l)g[C]===void 0&&(g[C]=l[C])}return g}function wd(l,c){try{var g=l.onUncaughtError;g(c.value,{componentStack:c.stack})}catch(x){setTimeout(function(){throw x})}}function wh(l,c,g){try{var x=l.onCaughtError;x(g.value,{componentStack:g.stack,errorBoundary:c.tag===1?c.stateNode:null})}catch(C){setTimeout(function(){throw C})}}function Eh(l,c,g){return g=Tt(g),g.tag=3,g.payload={element:null},g.callback=function(){wd(l,c)},g}function dg(l){return l=Tt(l),l.tag=3,l}function fg(l,c,g,x){var C=g.type.getDerivedStateFromError;if(typeof C=="function"){var E=x.value;l.payload=function(){return C(E)},l.callback=function(){wh(c,g,x)}}var q=g.stateNode;q!==null&&typeof q.componentDidCatch=="function"&&(l.callback=function(){wh(c,g,x),typeof C!="function"&&(Ci===null?Ci=new Set([this]):Ci.add(this));var F=x.stack;this.componentDidCatch(x.value,{componentStack:F!==null?F:""})})}function hy(l,c,g,x,C){if(g.flags|=32768,x!==null&&typeof x=="object"&&typeof x.then=="function"){if(c=g.alternate,c!==null&&Et(c,g,C,!0),g=gs.current,g!==null){switch(g.tag){case 31:case 13:return es===null?Lo():g.alternate===null&&kn===0&&(kn=3),g.flags&=-257,g.flags|=65536,g.lanes=C,x===Fr?g.flags|=16384:(c=g.updateQueue,c===null?g.updateQueue=new Set([x]):c.add(x),Ho(l,x,C)),!1;case 22:return g.flags|=65536,x===Fr?g.flags|=16384:(c=g.updateQueue,c===null?(c={transitions:null,markerInstances:null,retryQueue:new Set([x])},g.updateQueue=c):(g=c.retryQueue,g===null?c.retryQueue=new Set([x]):g.add(x)),Ho(l,x,C)),!1}throw Error(i(435,g.tag))}return Ho(l,x,C),Lo(),!1}if(Nt)return c=gs.current,c!==null?((c.flags&65536)===0&&(c.flags|=256),c.flags|=65536,c.lanes=C,x!==pf&&(l=Error(i(422),{cause:x}),Kn(Ne(l,g)))):(x!==pf&&(c=Error(i(423),{cause:x}),Kn(Ne(c,g))),l=l.current.alternate,l.flags|=65536,C&=-C,l.lanes|=C,x=Ne(x,g),C=Eh(l.stateNode,x,C),os(l,C),kn!==4&&(kn=2)),!1;var E=Error(i(520),{cause:x});if(E=Ne(E,g),Eu===null?Eu=[E]:Eu.push(E),kn!==4&&(kn=2),c===null)return!0;x=Ne(x,g),g=c;do{switch(g.tag){case 3:return g.flags|=65536,l=C&-C,g.lanes|=l,l=Eh(g.stateNode,x,l),os(g,l),!1;case 1:if(c=g.type,E=g.stateNode,(g.flags&128)===0&&(typeof c.getDerivedStateFromError=="function"||E!==null&&typeof E.componentDidCatch=="function"&&(Ci===null||!Ci.has(E))))return g.flags|=65536,C&=-C,g.lanes|=C,C=dg(C),fg(C,l,g,x),os(g,C),!1}g=g.return}while(g!==null);return!1}function Oa(l,c,g,x){c.child=l===null?Mp(c,null,g,x):Da(c,l.child,g,x)}function hg(l,c,g,x,C){g=g.render;var E=c.ref;if("ref"in x){var q={};for(var F in x)F!=="ref"&&(q[F]=x[F])}else q=x;return hn(c),x=xo(l,c,g,q,E,C),F=dd(),l!==null&&!mn?(gh(l,c,C),Ar(l,c,C)):(Nt&&F&&I(c),c.flags|=1,Oa(l,c,x,C),c.child)}function pg(l,c,g,x,C){if(l===null){var E=g.type;return typeof E=="function"&&!Ml(E)&&E.defaultProps===void 0&&g.compare===null?(c.tag=15,c.type=E,mg(l,c,E,x,C)):(l=pi(g.type,null,x,c,c.mode,C),l.ref=c.ref,l.return=c,c.child=l)}if(E=l.child,!$c(l,C)){var q=E.memoizedProps;if(g=g.compare,g=g!==null?g:Qt,g(q,x)&&l.ref===c.ref)return Ar(l,c,C)}return c.flags|=1,l=Ms(E,x),l.ref=c.ref,l.return=c,c.child=l}function mg(l,c,g,x,C){if(l!==null){var E=l.memoizedProps;if(Qt(E,x)&&l.ref===c.ref)if(mn=!1,c.pendingProps=x=E,$c(l,C))(l.flags&131072)!==0&&(mn=!0);else return c.lanes=l.lanes,Ar(l,c,C)}return Td(l,c,g,x,C)}function gg(l,c,g,x){var C=x.children,E=l!==null?l.memoizedState:null;if(l===null&&c.stateNode===null&&(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),x.mode==="hidden"){if((c.flags&128)!==0){if(E=E!==null?E.baseLanes|g:g,l!==null){for(x=c.child=l.child,C=0;x!==null;)C=C|x.lanes|x.childLanes,x=x.sibling;x=C&~E}else x=0,c.child=null;return wo(l,c,E,g,x)}if((g&536870912)!==0)c.memoizedState={baseLanes:0,cachePool:null},l!==null&&yt(c,E!==null?E.cachePool:null),E!==null?mr(c,E):Cs(),Ai(c);else return x=c.lanes=536870912,wo(l,c,E!==null?E.baseLanes|g:g,g,x)}else E!==null?(yt(c,E.cachePool),mr(c,E),ws(),c.memoizedState=null):(l!==null&&yt(c,null),Cs(),ws());return Oa(l,c,C,g),c.child}function El(l,c){return l!==null&&l.tag===22||c.stateNode!==null||(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.sibling}function wo(l,c,g,x,C){var E=hr();return E=E===null?null:{parent:Zn?Nn._currentValue:Nn._currentValue2,pool:E},c.memoizedState={baseLanes:g,cachePool:E},l!==null&&yt(c,null),Cs(),Ai(c),l!==null&&Et(l,c,x,!0),c.childLanes=C,null}function Ed(l,c){return c=ki({mode:c.mode,children:c.children},l.mode),c.ref=l.ref,l.child=c,c.return=l,c}function Th(l,c,g){return Da(c,l.child,null,g),l=Ed(c,c.pendingProps),l.flags|=2,Es(c),c.memoizedState=null,l}function yg(l,c,g){var x=c.pendingProps,C=(c.flags&128)!==0;if(c.flags&=-129,l===null){if(Nt){if(x.mode==="hidden")return l=Ed(c,x),c.lanes=536870912,El(null,l);if(ud(c),(l=Sn)?(l=mp(l,Wa),l!==null&&(c.memoizedState={dehydrated:l,treeContext:$s!==null?{id:Ma,overflow:xr}:null,retryLane:536870912,hydrationErrors:null},g=Qh(l),g.return=c,c.child=g,da=c,Sn=null)):l=null,l===null)throw we(c);return c.lanes=536870912,null}return Ed(c,x)}var E=l.memoizedState;if(E!==null){var q=E.dehydrated;if(ud(c),C)if(c.flags&256)c.flags&=-257,c=Th(l,c,g);else if(c.memoizedState!==null)c.child=l.child,c.flags|=128,c=null;else throw Error(i(558));else if(mn||Et(l,c,g,!1),C=(g&l.childLanes)!==0,mn||C){if(x=pt,x!==null&&(q=Z(x,g),q!==0&&q!==E.retryLane))throw E.retryLane=q,ot(l,q),Mn(x,l,q),ts;Lo(),c=Th(l,c,g)}else l=E.treeContext,vn&&(Sn=e0(q),da=c,Nt=!0,Xr=null,Wa=!1,l!==null&&xe(c,l)),c=Ed(c,x),c.flags|=4096;return c}return l=Ms(l.child,{mode:x.mode,children:x.children}),l.ref=c.ref,c.child=l,l.return=c,l}function Wc(l,c){var g=c.ref;if(g===null)l!==null&&l.ref!==null&&(c.flags|=4194816);else{if(typeof g!="function"&&typeof g!="object")throw Error(i(284));(l===null||l.ref!==g)&&(c.flags|=4194816)}}function Td(l,c,g,x,C){return hn(c),g=xo(l,c,g,x,void 0,C),x=dd(),l!==null&&!mn?(gh(l,c,C),Ar(l,c,C)):(Nt&&x&&I(c),c.flags|=1,Oa(l,c,g,C),c.child)}function Rh(l,c,g,x,C,E){return hn(c),c.updateQueue=null,g=Or(c,x,g,C),Vc(l),x=dd(),l!==null&&!mn?(gh(l,c,E),Ar(l,c,E)):(Nt&&x&&I(c),c.flags|=1,Oa(l,c,g,E),c.child)}function Tl(l,c,g,x,C){if(hn(c),c.stateNode===null){var E=Vr,q=g.contextType;typeof q=="object"&&q!==null&&(E=Zt(q)),E=new g(x,E),c.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,E.updater=ju,c.stateNode=E,E._reactInternals=c,E=c.stateNode,E.props=x,E.state=c.memoizedState,E.refs={},ct(c),q=g.contextType,E.context=typeof q=="object"&&q!==null?Zt(q):Vr,E.state=c.memoizedState,q=g.getDerivedStateFromProps,typeof q=="function"&&(jh(c,g,q,x),E.state=c.memoizedState),typeof g.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(q=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),q!==E.state&&ju.enqueueReplaceState(E,E.state,null),Gs(c,x,E,C),Ka(),E.state=c.memoizedState),typeof E.componentDidMount=="function"&&(c.flags|=4194308),x=!0}else if(l===null){E=c.stateNode;var F=c.memoizedProps,pe=wl(g,F);E.props=pe;var Se=E.context,Me=g.contextType;q=Vr,typeof Me=="object"&&Me!==null&&(q=Zt(Me));var je=g.getDerivedStateFromProps;Me=typeof je=="function"||typeof E.getSnapshotBeforeUpdate=="function",F=c.pendingProps!==F,Me||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(F||Se!==q)&&ug(c,E,x,q),zs=!1;var Ue=c.memoizedState;E.state=Ue,Gs(c,x,E,C),Ka(),Se=c.memoizedState,F||Ue!==Se||zs?(typeof je=="function"&&(jh(c,g,je,x),Se=c.memoizedState),(pe=zs||jd(c,g,pe,x,Ue,Se,q))?(Me||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(c.flags|=4194308)):(typeof E.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=x,c.memoizedState=Se),E.props=x,E.state=Se,E.context=q,x=pe):(typeof E.componentDidMount=="function"&&(c.flags|=4194308),x=!1)}else{E=c.stateNode,sn(l,c),q=c.memoizedProps,Me=wl(g,q),E.props=Me,je=c.pendingProps,Ue=E.context,Se=g.contextType,pe=Vr,typeof Se=="object"&&Se!==null&&(pe=Zt(Se)),F=g.getDerivedStateFromProps,(Se=typeof F=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(q!==je||Ue!==pe)&&ug(c,E,x,pe),zs=!1,Ue=c.memoizedState,E.state=Ue,Gs(c,x,E,C),Ka();var st=c.memoizedState;q!==je||Ue!==st||zs||l!==null&&l.dependencies!==null&&qn(l.dependencies)?(typeof F=="function"&&(jh(c,g,F,x),st=c.memoizedState),(Me=zs||jd(c,g,Me,x,Ue,st,pe)||l!==null&&l.dependencies!==null&&qn(l.dependencies))?(Se||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(x,st,pe),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(x,st,pe)),typeof E.componentDidUpdate=="function"&&(c.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof E.componentDidUpdate!="function"||q===l.memoizedProps&&Ue===l.memoizedState||(c.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||q===l.memoizedProps&&Ue===l.memoizedState||(c.flags|=1024),c.memoizedProps=x,c.memoizedState=st),E.props=x,E.state=st,E.context=pe,x=Me):(typeof E.componentDidUpdate!="function"||q===l.memoizedProps&&Ue===l.memoizedState||(c.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||q===l.memoizedProps&&Ue===l.memoizedState||(c.flags|=1024),x=!1)}return E=x,Wc(l,c),x=(c.flags&128)!==0,E||x?(E=c.stateNode,g=x&&typeof g.getDerivedStateFromError!="function"?null:E.render(),c.flags|=1,l!==null&&x?(c.child=Da(c,l.child,null,C),c.child=Da(c,null,g,C)):Oa(l,c,g,C),c.memoizedState=E.state,l=c.child):l=Ar(l,c,C),l}function xg(l,c,g,x){return Ht(),c.flags|=256,Oa(l,c,g,x),c.child}function Oh(l){return{baseLanes:l,cachePool:mt()}}function Mh(l,c,g){return l=l!==null?l.childLanes&~g:0,c&&(l|=ns),l}function Ah(l,c,g){var x=c.pendingProps,C=!1,E=(c.flags&128)!==0,q;if((q=E)||(q=l!==null&&l.memoizedState===null?!1:(Gn.current&2)!==0),q&&(C=!0,c.flags&=-129),q=(c.flags&32)!==0,c.flags&=-33,l===null){if(Nt){if(C?js(c):ws(),(l=Sn)?(l=s0(l,Wa),l!==null&&(c.memoizedState={dehydrated:l,treeContext:$s!==null?{id:Ma,overflow:xr}:null,retryLane:536870912,hydrationErrors:null},g=Qh(l),g.return=c,c.child=g,da=c,Sn=null)):l=null,l===null)throw we(c);return Wd(l)?c.lanes=32:c.lanes=536870912,null}var F=x.children;return x=x.fallback,C?(ws(),C=c.mode,F=ki({mode:"hidden",children:F},C),x=Fs(x,C,g,null),F.return=c,x.return=c,F.sibling=x,c.child=F,x=c.child,x.memoizedState=Oh(g),x.childLanes=Mh(l,q,g),c.memoizedState=Fl,El(null,x)):(js(c),Rd(c,F))}var pe=l.memoizedState;if(pe!==null&&(F=pe.dehydrated,F!==null)){if(E)c.flags&256?(js(c),c.flags&=-257,c=Rl(l,c,g)):c.memoizedState!==null?(ws(),c.child=l.child,c.flags|=128,c=null):(ws(),F=x.fallback,C=c.mode,x=ki({mode:"visible",children:x.children},C),F=Fs(F,C,g,null),F.flags|=2,x.return=c,F.return=c,x.sibling=F,c.child=x,Da(c,l.child,null,g),x=c.child,x.memoizedState=Oh(g),x.childLanes=Mh(l,q,g),c.memoizedState=Fl,c=El(null,x));else if(js(c),Wd(F))q=$d(F).digest,x=Error(i(419)),x.stack="",x.digest=q,Kn({value:x,source:null,stack:null}),c=Rl(l,c,g);else if(mn||Et(l,c,g,!1),q=(g&l.childLanes)!==0,mn||q){if(q=pt,q!==null&&(x=Z(q,g),x!==0&&x!==pe.retryLane))throw pe.retryLane=x,ot(l,x),Mn(q,l,x),ts;Fi(F)||Lo(),c=Rl(l,c,g)}else Fi(F)?(c.flags|=192,c.child=l.child,c=null):(l=pe.treeContext,vn&&(Sn=t0(F),da=c,Nt=!0,Xr=null,Wa=!1,l!==null&&xe(c,l)),c=Rd(c,x.children),c.flags|=4096);return c}return C?(ws(),F=x.fallback,C=c.mode,pe=l.child,E=pe.sibling,x=Ms(pe,{mode:"hidden",children:x.children}),x.subtreeFlags=pe.subtreeFlags&65011712,E!==null?F=Ms(E,F):(F=Fs(F,C,g,null),F.flags|=2),F.return=c,x.return=c,x.sibling=F,c.child=x,El(null,x),x=c.child,F=l.child.memoizedState,F===null?F=Oh(g):(C=F.cachePool,C!==null?(pe=Zn?Nn._currentValue:Nn._currentValue2,C=C.parent!==pe?{parent:pe,pool:pe}:C):C=mt(),F={baseLanes:F.baseLanes|g,cachePool:C}),x.memoizedState=F,x.childLanes=Mh(l,q,g),c.memoizedState=Fl,El(l.child,x)):(js(c),g=l.child,l=g.sibling,g=Ms(g,{mode:"visible",children:x.children}),g.return=c,g.sibling=null,l!==null&&(q=c.deletions,q===null?(c.deletions=[l],c.flags|=16):q.push(l)),c.child=g,c.memoizedState=null,g)}function Rd(l,c){return c=ki({mode:"visible",children:c},l.mode),c.return=l,l.child=c}function ki(l,c){return l=n(22,l,null,c),l.lanes=0,l}function Rl(l,c,g){return Da(c,l.child,null,g),l=Rd(c,c.pendingProps.children),l.flags|=2,c.memoizedState=null,l}function bg(l,c,g){l.lanes|=c;var x=l.alternate;x!==null&&(x.lanes|=c),ur(l.return,c,g)}function Eo(l,c,g,x,C,E){var q=l.memoizedState;q===null?l.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:x,tail:g,tailMode:C,treeForkCount:E}:(q.isBackwards=c,q.rendering=null,q.renderingStartTime=0,q.last=x,q.tail=g,q.tailMode=C,q.treeForkCount=E)}function Dh(l,c,g){var x=c.pendingProps,C=x.revealOrder,E=x.tail;x=x.children;var q=Gn.current,F=(q&2)!==0;if(F?(q=q&1|2,c.flags|=128):q&=1,w(Gn,q),Oa(l,c,x,g),x=Nt?Nu:0,!F&&l!==null&&(l.flags&128)!==0)e:for(l=c.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&bg(l,g,c);else if(l.tag===19)bg(l,g,c);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===c)break e;for(;l.sibling===null;){if(l.return===null||l.return===c)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}switch(C){case"forwards":for(g=c.child,C=null;g!==null;)l=g.alternate,l!==null&&Yc(l)===null&&(C=g),g=g.sibling;g=C,g===null?(C=c.child,c.child=null):(C=g.sibling,g.sibling=null),Eo(c,!1,C,g,E,x);break;case"backwards":case"unstable_legacy-backwards":for(g=null,C=c.child,c.child=null;C!==null;){if(l=C.alternate,l!==null&&Yc(l)===null){c.child=C;break}l=C.sibling,C.sibling=g,g=C,C=l}Eo(c,!0,g,null,E,x);break;case"together":Eo(c,!1,null,null,void 0,x);break;default:c.memoizedState=null}return c.child}function Ar(l,c,g){if(l!==null&&(c.dependencies=l.dependencies),_i|=c.lanes,(g&c.childLanes)===0)if(l!==null){if(Et(l,c,g,!1),(g&c.childLanes)===0)return null}else return null;if(l!==null&&c.child!==l.child)throw Error(i(153));if(c.child!==null){for(l=c.child,g=Ms(l,l.pendingProps),c.child=g,g.return=c;l.sibling!==null;)l=l.sibling,g=g.sibling=Ms(l,l.pendingProps),g.return=c;g.sibling=null}return c.child}function $c(l,c){return(l.lanes&c)!==0?!0:(l=l.dependencies,!!(l!==null&&qn(l)))}function zh(l,c,g){switch(c.tag){case 3:_e(c,c.stateNode.containerInfo),Gt(c,Nn,l.memoizedState.cache),Ht();break;case 27:case 5:ze(c);break;case 4:_e(c,c.stateNode.containerInfo);break;case 10:Gt(c,c.type,c.memoizedProps.value);break;case 31:if(c.memoizedState!==null)return c.flags|=128,ud(c),null;break;case 13:var x=c.memoizedState;if(x!==null)return x.dehydrated!==null?(js(c),c.flags|=128,null):(g&c.child.childLanes)!==0?Ah(l,c,g):(js(c),l=Ar(l,c,g),l!==null?l.sibling:null);js(c);break;case 19:var C=(l.flags&128)!==0;if(x=(g&c.childLanes)!==0,x||(Et(l,c,g,!1),x=(g&c.childLanes)!==0),C){if(x)return Dh(l,c,g);c.flags|=128}if(C=c.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),w(Gn,Gn.current),x)break;return null;case 22:return c.lanes=0,gg(l,c,g,c.pendingProps);case 24:Gt(c,Nn,l.memoizedState.cache)}return Ar(l,c,g)}function kh(l,c,g){if(l!==null)if(l.memoizedProps!==c.pendingProps)mn=!0;else{if(!$c(l,g)&&(c.flags&128)===0)return mn=!1,zh(l,c,g);mn=(l.flags&131072)!==0}else mn=!1,Nt&&(c.flags&1048576)!==0&&B(c,Nu,c.index);switch(c.lanes=0,c.tag){case 16:e:{var x=c.pendingProps;if(l=rn(c.elementType),c.type=l,typeof l=="function")Ml(l)?(x=wl(l,x),c.tag=1,c=Tl(null,c,l,x,g)):(c.tag=0,c=Td(null,c,l,x,g));else{if(l!=null){var C=l.$$typeof;if(C===Bo){c.tag=11,c=hg(null,c,l,x,g);break e}else if(C===Kd){c.tag=14,c=pg(null,c,l,x,g);break e}}throw c=b(l)||l,Error(i(306,c,""))}}return c;case 0:return Td(l,c,c.type,c.pendingProps,g);case 1:return x=c.type,C=wl(x,c.pendingProps),Tl(l,c,x,C,g);case 3:e:{if(_e(c,c.stateNode.containerInfo),l===null)throw Error(i(387));var E=c.pendingProps;C=c.memoizedState,x=C.element,sn(l,c),Gs(c,E,null,g);var q=c.memoizedState;if(E=q.cache,Gt(c,Nn,E),E!==C.cache&&Ft(c,[Nn],g,!0),Ka(),E=q.element,vn&&C.isDehydrated)if(C={element:E,isDehydrated:!1,cache:q.cache},c.updateQueue.baseState=C,c.memoizedState=C,c.flags&256){c=xg(l,c,E,g);break e}else if(E!==x){x=Ne(Error(i(424)),c),Kn(x),c=xg(l,c,E,g);break e}else for(vn&&(Sn=$g(c.stateNode.containerInfo),da=c,Nt=!0,Xr=null,Wa=!0),g=Mp(c,null,E,g),c.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling;else{if(Ht(),E===x){c=Ar(l,c,g);break e}Oa(l,c,E,g)}c=c.child}return c;case 26:if(Js)return Wc(l,c),l===null?(g=vp(c.type,null,c.pendingProps,null))?c.memoizedState=g:Nt||(c.stateNode=af(c.type,c.pendingProps,Aa.current,c)):c.memoizedState=vp(c.type,l.memoizedProps,c.pendingProps,l.memoizedState),null;case 27:if(ua)return ze(c),l===null&&ua&&Nt&&(x=c.stateNode=sf(c.type,c.pendingProps,Aa.current,_a.current,!1),da=c,Wa=!0,Sn=pp(c.type,x,Sn)),Oa(l,c,c.pendingProps.children,g),Wc(l,c),l===null&&(c.flags|=4194304),c.child;case 5:return l===null&&Nt&&(h0(c.type,c.pendingProps,_a.current),(C=x=Sn)&&(x=n0(x,c.type,c.pendingProps,Wa),x!==null?(c.stateNode=x,da=c,Sn=Wg(x),Wa=!1,C=!0):C=!1),C||we(c)),ze(c),C=c.type,E=c.pendingProps,q=l!==null?l.memoizedProps:null,x=E.children,Ja(C,E)?x=null:q!==null&&Ja(C,q)&&(c.flags|=32),c.memoizedState!==null&&(C=xo(l,c,Ps,null,null,g),Zn?Bl._currentValue=C:Bl._currentValue2=C),Wc(l,c),Oa(l,c,x,g),c.child;case 6:return l===null&&Nt&&(bp(c.pendingProps,_a.current),(l=g=Sn)&&(g=a0(g,c.pendingProps,Wa),g!==null?(c.stateNode=g,da=c,Sn=null,l=!0):l=!1),l||we(c)),null;case 13:return Ah(l,c,g);case 4:return _e(c,c.stateNode.containerInfo),x=c.pendingProps,l===null?c.child=Da(c,null,x,g):Oa(l,c,x,g),c.child;case 11:return hg(l,c,c.type,c.pendingProps,g);case 7:return Oa(l,c,c.pendingProps,g),c.child;case 8:return Oa(l,c,c.pendingProps.children,g),c.child;case 12:return Oa(l,c,c.pendingProps.children,g),c.child;case 10:return x=c.pendingProps,Gt(c,c.type,x.value),Oa(l,c,x.children,g),c.child;case 9:return C=c.type._context,x=c.pendingProps.children,hn(c),C=Zt(C),x=x(C),c.flags|=1,Oa(l,c,x,g),c.child;case 14:return pg(l,c,c.type,c.pendingProps,g);case 15:return mg(l,c,c.type,c.pendingProps,g);case 19:return Dh(l,c,g);case 31:return yg(l,c,g);case 22:return gg(l,c,g,c.pendingProps);case 24:return hn(c),x=Zt(Nn),l===null?(C=hr(),C===null&&(C=pt,E=dr(),C.pooledCache=E,E.refCount++,E!==null&&(C.pooledCacheLanes|=g),C=E),c.memoizedState={parent:x,cache:C},ct(c),Gt(c,Nn,C)):((l.lanes&g)!==0&&(sn(l,c),Gs(c,null,null,g),Ka()),C=l.memoizedState,E=c.memoizedState,C.parent!==x?(C={parent:x,cache:x},c.memoizedState=C,c.lanes===0&&(c.memoizedState=c.updateQueue.baseState=C),Gt(c,Nn,x)):(x=E.cache,Gt(c,Nn,x),x!==C.cache&&Ft(c,[Nn],g,!0))),Oa(l,c,c.pendingProps.children,g),c.child;case 29:throw c.pendingProps}throw Error(i(156,c.tag))}function Ys(l){l.flags|=4}function eu(l){As&&(l.flags|=8)}function vg(l,c){if(l!==null&&l.child===c.child)return!1;if((c.flags&16)!==0)return!0;for(l=c.child;l!==null;){if((l.flags&8218)!==0||(l.subtreeFlags&8218)!==0)return!0;l=l.sibling}return!1}function Lh(l,c,g,x){if(wt)for(g=c.child;g!==null;){if(g.tag===5||g.tag===6)pu(l,g.stateNode);else if(!(g.tag===4||ua&&g.tag===27)&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===c)break;for(;g.sibling===null;){if(g.return===null||g.return===c)return;g=g.return}g.sibling.return=g.return,g=g.sibling}else if(As)for(var C=c.child;C!==null;){if(C.tag===5){var E=C.stateNode;g&&x&&(E=Fg(E,C.type,C.memoizedProps)),pu(l,E)}else if(C.tag===6)E=C.stateNode,g&&x&&(E=fp(E,C.memoizedProps)),pu(l,E);else if(C.tag!==4){if(C.tag===22&&C.memoizedState!==null)E=C.child,E!==null&&(E.return=C),Lh(l,C,!0,!0);else if(C.child!==null){C.child.return=C,C=C.child;continue}}if(C===c)break;for(;C.sibling===null;){if(C.return===null||C.return===c)return;C=C.return}C.sibling.return=C.return,C=C.sibling}}function Sg(l,c,g,x){var C=!1;if(As)for(var E=c.child;E!==null;){if(E.tag===5){var q=E.stateNode;g&&x&&(q=Fg(q,E.type,E.memoizedProps)),up(l,q)}else if(E.tag===6)q=E.stateNode,g&&x&&(q=fp(q,E.memoizedProps)),up(l,q);else if(E.tag!==4){if(E.tag===22&&E.memoizedState!==null)C=E.child,C!==null&&(C.return=E),Sg(l,E,!0,!0),C=!0;else if(E.child!==null){E.child.return=E,E=E.child;continue}}if(E===c)break;for(;E.sibling===null;){if(E.return===null||E.return===c)return C;E=E.return}E.sibling.return=E.return,E=E.sibling}return C}function Ng(l,c){if(As&&vg(l,c)){l=c.stateNode;var g=l.containerInfo,x=cp();Sg(x,c,!1,!1),l.pendingChildren=x,Ys(c),Xg(g,x)}}function Uh(l,c,g,x){if(wt)l.memoizedProps!==x&&Ys(c);else if(As){var C=l.stateNode,E=l.memoizedProps;if((l=vg(l,c))||E!==x){var q=_a.current;E=Kg(C,g,E,x,!l,null),E===C?c.stateNode=C:(eu(c),fs(E,g,x,q)&&Ys(c),c.stateNode=E,l&&Lh(E,c,!1,!1))}else c.stateNode=C}}function Fa(l,c,g,x,C){if((l.mode&32)!==0&&(g===null?mu(c,x):Qo(c,g,x))){if(l.flags|=16777216,(C&335544128)===C||Wh(c,x))if(An(l.stateNode,c,x))l.flags|=8192;else if(jt())l.flags|=8192;else throw $a=Fr,gf}else l.flags&=-16777217}function To(l,c){if(Cp(c)){if(l.flags|=16777216,!jp(c))if(jt())l.flags|=8192;else throw $a=Fr,gf}else l.flags&=-16777217}function tu(l,c){c!==null&&(l.flags|=4),l.flags&16384&&(c=l.tag!==22?k():536870912,l.lanes|=c,ec|=c)}function Ro(l,c){if(!Nt)switch(l.tailMode){case"hidden":c=l.tail;for(var g=null;c!==null;)c.alternate!==null&&(g=c),c=c.sibling;g===null?l.tail=null:g.sibling=null;break;case"collapsed":g=l.tail;for(var x=null;g!==null;)g.alternate!==null&&(x=g),g=g.sibling;x===null?c||l.tail===null?l.tail=null:l.tail.sibling=null:x.sibling=null}}function ln(l){var c=l.alternate!==null&&l.alternate.child===l.child,g=0,x=0;if(c)for(var C=l.child;C!==null;)g|=C.lanes|C.childLanes,x|=C.subtreeFlags&65011712,x|=C.flags&65011712,C.return=l,C=C.sibling;else for(C=l.child;C!==null;)g|=C.lanes|C.childLanes,x|=C.subtreeFlags,x|=C.flags,C.return=l,C=C.sibling;return l.subtreeFlags|=x,l.childLanes=g,c}function _g(l,c,g){var x=c.pendingProps;switch(fe(c),c.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ln(c),null;case 1:return ln(c),null;case 3:return g=c.stateNode,x=null,l!==null&&(x=l.memoizedState.cache),c.memoizedState.cache!==x&&(c.flags|=2048),fn(Nn),Ce(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(l===null||l.child===null)&&(Mt(c)?Ys(c):l===null||l.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,En())),Ng(l,c),ln(c),null;case 26:if(Js){var C=c.type,E=c.memoizedState;return l===null?(Ys(c),E!==null?(ln(c),To(c,E)):(ln(c),Fa(c,C,null,x,g))):E?E!==l.memoizedState?(Ys(c),ln(c),To(c,E)):(ln(c),c.flags&=-16777217):(E=l.memoizedProps,wt?E!==x&&Ys(c):Uh(l,c,C,x),ln(c),Fa(c,C,E,x,g)),null}case 27:if(ua){if(Ee(c),g=Aa.current,C=c.type,l!==null&&c.stateNode!=null)wt?l.memoizedProps!==x&&Ys(c):Uh(l,c,C,x);else{if(!x){if(c.stateNode===null)throw Error(i(166));return ln(c),null}l=_a.current,Mt(c)?Vt(c,l):(l=sf(C,x,g,l,!0),c.stateNode=l,Ys(c))}return ln(c),null}case 5:if(Ee(c),C=c.type,l!==null&&c.stateNode!=null)Uh(l,c,C,x);else{if(!x){if(c.stateNode===null)throw Error(i(166));return ln(c),null}if(E=_a.current,Mt(c))Vt(c,E),u0(c.stateNode,C,x,E)&&(c.flags|=64);else{var q=Ih(C,x,Aa.current,E,c);eu(c),Lh(q,c,!1,!1),c.stateNode=q,fs(q,C,x,E)&&Ys(c)}}return ln(c),Fa(c,c.type,l===null?null:l.memoizedProps,c.pendingProps,g),null;case 6:if(l&&c.stateNode!=null)g=l.memoizedProps,wt?g!==x&&Ys(c):As&&(g!==x?(l=Aa.current,g=_a.current,eu(c),c.stateNode=yi(x,l,g,c)):c.stateNode=l.stateNode);else{if(typeof x!="string"&&c.stateNode===null)throw Error(i(166));if(l=Aa.current,g=_a.current,Mt(c)){if(!vn)throw Error(i(176));if(l=c.stateNode,g=c.memoizedProps,x=null,C=da,C!==null)switch(C.tag){case 27:case 5:x=C.memoizedProps}xy(l,g,c,x)||we(c,!0)}else eu(c),c.stateNode=yi(x,l,g,c)}return ln(c),null;case 31:if(g=c.memoizedState,l===null||l.memoizedState!==null){if(x=Mt(c),g!==null){if(l===null){if(!x)throw Error(i(318));if(!vn)throw Error(i(556));if(l=c.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(i(557));gp(l,c)}else Ht(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;ln(c),l=!1}else g=En(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=g),l=!0;if(!l)return c.flags&256?(Es(c),c):(Es(c),null);if((c.flags&128)!==0)throw Error(i(558))}return ln(c),null;case 13:if(x=c.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(C=Mt(c),x!==null&&x.dehydrated!==null){if(l===null){if(!C)throw Error(i(318));if(!vn)throw Error(i(344));if(C=c.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(i(317));i0(C,c)}else Ht(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;ln(c),C=!1}else C=En(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=C),C=!0;if(!C)return c.flags&256?(Es(c),c):(Es(c),null)}return Es(c),(c.flags&128)!==0?(c.lanes=g,c):(g=x!==null,l=l!==null&&l.memoizedState!==null,g&&(x=c.child,C=null,x.alternate!==null&&x.alternate.memoizedState!==null&&x.alternate.memoizedState.cachePool!==null&&(C=x.alternate.memoizedState.cachePool.pool),E=null,x.memoizedState!==null&&x.memoizedState.cachePool!==null&&(E=x.memoizedState.cachePool.pool),E!==C&&(x.flags|=2048)),g!==l&&g&&(c.child.flags|=8192),tu(c,c.updateQueue),ln(c),null);case 4:return Ce(),Ng(l,c),l===null&&tn(c.stateNode.containerInfo),ln(c),null;case 10:return fn(c.type),ln(c),null;case 19:if(j(Gn),x=c.memoizedState,x===null)return ln(c),null;if(C=(c.flags&128)!==0,E=x.rendering,E===null)if(C)Ro(x,!1);else{if(kn!==0||l!==null&&(l.flags&128)!==0)for(l=c.child;l!==null;){if(E=Yc(l),E!==null){for(c.flags|=128,Ro(x,!1),l=E.updateQueue,c.updateQueue=l,tu(c,l),c.subtreeFlags=0,l=g,g=c.child;g!==null;)Gd(g,l),g=g.sibling;return w(Gn,Gn.current&1|2),Nt&&me(c,x.treeForkCount),c.child}l=l.sibling}x.tail!==null&&Ga()>rl&&(c.flags|=128,C=!0,Ro(x,!1),c.lanes=4194304)}else{if(!C)if(l=Yc(E),l!==null){if(c.flags|=128,C=!0,l=l.updateQueue,c.updateQueue=l,tu(c,l),Ro(x,!0),x.tail===null&&x.tailMode==="hidden"&&!E.alternate&&!Nt)return ln(c),null}else 2*Ga()-x.renderingStartTime>rl&&g!==536870912&&(c.flags|=128,C=!0,Ro(x,!1),c.lanes=4194304);x.isBackwards?(E.sibling=c.child,c.child=E):(l=x.last,l!==null?l.sibling=E:c.child=E,x.last=E)}return x.tail!==null?(l=x.tail,x.rendering=l,x.tail=l.sibling,x.renderingStartTime=Ga(),l.sibling=null,g=Gn.current,w(Gn,C?g&1|2:g&1),Nt&&me(c,x.treeForkCount),l):(ln(c),null);case 22:case 23:return Es(c),Tn(),x=c.memoizedState!==null,l!==null?l.memoizedState!==null!==x&&(c.flags|=8192):x&&(c.flags|=8192),x?(g&536870912)!==0&&(c.flags&128)===0&&(ln(c),c.subtreeFlags&6&&(c.flags|=8192)):ln(c),g=c.updateQueue,g!==null&&tu(c,g.retryQueue),g=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),x=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(x=c.memoizedState.cachePool.pool),x!==g&&(c.flags|=2048),l!==null&&j(Ji),null;case 24:return g=null,l!==null&&(g=l.memoizedState.cache),c.memoizedState.cache!==g&&(c.flags|=2048),fn(Nn),ln(c),null;case 25:return null;case 30:return null}throw Error(i(156,c.tag))}function qh(l,c){switch(fe(c),c.tag){case 1:return l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 3:return fn(Nn),Ce(),l=c.flags,(l&65536)!==0&&(l&128)===0?(c.flags=l&-65537|128,c):null;case 26:case 27:case 5:return Ee(c),null;case 31:if(c.memoizedState!==null){if(Es(c),c.alternate===null)throw Error(i(340));Ht()}return l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 13:if(Es(c),l=c.memoizedState,l!==null&&l.dehydrated!==null){if(c.alternate===null)throw Error(i(340));Ht()}return l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 19:return j(Gn),null;case 4:return Ce(),null;case 10:return fn(c.type),null;case 22:case 23:return Es(c),Tn(),l!==null&&j(Ji),l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 24:return fn(Nn),null;case 25:return null;default:return null}}function Cg(l,c){switch(fe(c),c.tag){case 3:fn(Nn),Ce();break;case 26:case 27:case 5:Ee(c);break;case 4:Ce();break;case 31:c.memoizedState!==null&&Es(c);break;case 13:Es(c);break;case 19:j(Gn);break;case 10:fn(c.type);break;case 22:case 23:Es(c),Tn(),l!==null&&j(Ji);break;case 24:fn(Nn)}}function Dr(l,c){try{var g=c.updateQueue,x=g!==null?g.lastEffect:null;if(x!==null){var C=x.next;g=C;do{if((g.tag&l)===l){x=void 0;var E=g.create,q=g.inst;x=E(),q.destroy=x}g=g.next}while(g!==C)}}catch(F){$e(c,c.return,F)}}function zr(l,c,g){try{var x=c.updateQueue,C=x!==null?x.lastEffect:null;if(C!==null){var E=C.next;x=E;do{if((x.tag&l)===l){var q=x.inst,F=q.destroy;if(F!==void 0){q.destroy=void 0,C=c;var pe=g,Se=F;try{Se()}catch(Me){$e(C,pe,Me)}}}x=x.next}while(x!==E)}}catch(Me){$e(c,c.return,Me)}}function Oo(l){var c=l.updateQueue;if(c!==null){var g=l.stateNode;try{pr(c,g)}catch(x){$e(l,l.return,x)}}}function Od(l,c,g){g.props=wl(l.type,l.memoizedProps),g.state=l.memoizedState;try{g.componentWillUnmount()}catch(x){$e(l,c,x)}}function Mo(l,c){try{var g=l.ref;if(g!==null){switch(l.tag){case 26:case 27:case 5:var x=Po(l.stateNode);break;case 30:x=l.stateNode;break;default:x=l.stateNode}typeof g=="function"?l.refCleanup=g(x):g.current=x}}catch(C){$e(l,c,C)}}function Ba(l,c){var g=l.ref,x=l.refCleanup;if(g!==null)if(typeof x=="function")try{x()}catch(C){$e(l,c,C)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof g=="function")try{g(null)}catch(C){$e(l,c,C)}else g.current=null}function Ol(l){var c=l.type,g=l.memoizedProps,x=l.stateNode;try{qg(x,c,g,l)}catch(C){$e(l,l.return,C)}}function nu(l,c,g){try{Hg(l.stateNode,l.type,g,c,l)}catch(x){$e(l,l.return,x)}}function Hh(l){return l.tag===5||l.tag===3||(Js?l.tag===26:!1)||(ua?l.tag===27&&Gl(l.type):!1)||l.tag===4}function ci(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||Hh(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(ua&&l.tag===27&&Gl(l.type)||l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function Md(l,c,g){var x=l.tag;if(x===5||x===6)l=l.stateNode,c?Gg(g,l,c):rp(g,l);else if(x!==4&&(ua&&x===27&&Gl(l.type)&&(g=l.stateNode,c=null),l=l.child,l!==null))for(Md(l,c,g),l=l.sibling;l!==null;)Md(l,c,g),l=l.sibling}function au(l,c,g){var x=l.tag;if(x===5||x===6)l=l.stateNode,c?Bg(g,l,c):sp(g,l);else if(x!==4&&(ua&&x===27&&Gl(l.type)&&(g=l.stateNode),l=l.child,l!==null))for(au(l,c,g),l=l.sibling;l!==null;)au(l,c,g),l=l.sibling}function Bh(l,c,g){l=l.containerInfo;try{dp(l,g)}catch(x){$e(c,c.return,x)}}function jg(l){var c=l.stateNode,g=l.memoizedProps;try{aa(l.type,g,c,l)}catch(x){$e(l,l.return,x)}}function py(l,c){for(Xd(l.containerInfo),Wn=c;Wn!==null;)if(l=Wn,c=l.child,(l.subtreeFlags&1028)!==0&&c!==null)c.return=l,Wn=c;else for(;Wn!==null;){l=Wn;var g=l.alternate;switch(c=l.flags,l.tag){case 0:if((c&4)!==0&&(c=l.updateQueue,c=c!==null?c.events:null,c!==null))for(var x=0;x<c.length;x++){var C=c[x];C.ref.impl=C.nextImpl}break;case 11:case 15:break;case 1:if((c&1024)!==0&&g!==null){c=void 0,x=l,C=g.memoizedProps,g=g.memoizedState;var E=x.stateNode;try{var q=wl(x.type,C);c=E.getSnapshotBeforeUpdate(q,g),E.__reactInternalSnapshotBeforeUpdate=c}catch(F){$e(x,x.return,F)}}break;case 3:(c&1024)!==0&&wt&&op(l.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((c&1024)!==0)throw Error(i(163))}if(c=l.sibling,c!==null){c.return=l.return,Wn=c;break}Wn=l.return}}function wg(l,c,g){var x=g.flags;switch(g.tag){case 0:case 11:case 15:Za(l,g),x&4&&Dr(5,g);break;case 1:if(Za(l,g),x&4)if(l=g.stateNode,c===null)try{l.componentDidMount()}catch(q){$e(g,g.return,q)}else{var C=wl(g.type,c.memoizedProps);c=c.memoizedState;try{l.componentDidUpdate(C,c,l.__reactInternalSnapshotBeforeUpdate)}catch(q){$e(g,g.return,q)}}x&64&&Oo(g),x&512&&Mo(g,g.return);break;case 3:if(Za(l,g),x&64&&(x=g.updateQueue,x!==null)){if(l=null,g.child!==null)switch(g.child.tag){case 27:case 5:l=Po(g.child.stateNode);break;case 1:l=g.child.stateNode}try{pr(x,l)}catch(q){$e(g,g.return,q)}}break;case 27:ua&&c===null&&x&4&&jg(g);case 26:case 5:if(Za(l,g),c===null){if(x&4)Ol(g);else if(x&64){l=g.type,c=g.memoizedProps,C=g.stateNode;try{o0(C,l,c,g)}catch(q){$e(g,g.return,q)}}}x&512&&Mo(g,g.return);break;case 12:Za(l,g);break;case 31:Za(l,g),x&4&&Qs(l,g);break;case 13:Za(l,g),x&4&&ru(l,g),x&64&&(x=g.memoizedState,x!==null&&(x=x.dehydrated,x!==null&&(g=my.bind(null,g),ef(x,g))));break;case 22:if(x=g.memoizedState!==null||Pn,!x){c=c!==null&&c.memoizedState!==null||Yn,C=Pn;var E=Yn;Pn=x,(Yn=c)&&!E?Xs(l,g,(g.subtreeFlags&8772)!==0):Za(l,g),Pn=C,Yn=E}break;case 30:break;default:Za(l,g)}}function Gh(l){var c=l.alternate;c!==null&&(l.alternate=null,Gh(c)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(c=l.stateNode,c!==null&&Fd(c)),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function Vs(l,c,g){for(g=g.child;g!==null;)su(l,c,g),g=g.sibling}function su(l,c,g){if(ms&&typeof ms.onCommitFiberUnmount=="function")try{ms.onCommitFiberUnmount(Vl,g)}catch{}switch(g.tag){case 26:if(Js){Yn||Ba(g,c),Vs(l,c,g),g.memoizedState?Zi(g.memoizedState):g.stateNode&&_p(g.stateNode);break}case 27:if(ua){Yn||Ba(g,c);var x=zn,C=$n;Gl(g.type)&&(zn=g.stateNode,$n=!1),Vs(l,c,g),Na(g.stateNode),zn=x,$n=C;break}case 5:Yn||Ba(g,c);case 6:if(wt){if(x=zn,C=$n,zn=null,Vs(l,c,g),zn=x,$n=C,zn!==null)if($n)try{ip(zn,g.stateNode)}catch(E){$e(g,c,E)}else try{Pg(zn,g.stateNode)}catch(E){$e(g,c,E)}}else Vs(l,c,g);break;case 18:wt&&zn!==null&&($n?tf(zn,g.stateNode):xp(zn,g.stateNode));break;case 4:wt?(x=zn,C=$n,zn=g.stateNode.containerInfo,$n=!0,Vs(l,c,g),zn=x,$n=C):(As&&Bh(g.stateNode,g,cp()),Vs(l,c,g));break;case 0:case 11:case 14:case 15:zr(2,g,c),Yn||zr(4,g,c),Vs(l,c,g);break;case 1:Yn||(Ba(g,c),x=g.stateNode,typeof x.componentWillUnmount=="function"&&Od(g,c,x)),Vs(l,c,g);break;case 21:Vs(l,c,g);break;case 22:Yn=(x=Yn)||g.memoizedState!==null,Vs(l,c,g),Yn=x;break;default:Vs(l,c,g)}}function Qs(l,c){if(vn&&c.memoizedState===null&&(l=c.alternate,l!==null&&(l=l.memoizedState,l!==null))){l=l.dehydrated;try{by(l)}catch(g){$e(c,c.return,g)}}}function ru(l,c){if(vn&&c.memoizedState===null&&(l=c.alternate,l!==null&&(l=l.memoizedState,l!==null&&(l=l.dehydrated,l!==null))))try{vy(l)}catch(g){$e(c,c.return,g)}}function Ks(l){switch(l.tag){case 31:case 13:case 19:var c=l.stateNode;return c===null&&(c=l.stateNode=new Dp),c;case 22:return l=l.stateNode,c=l._retryCache,c===null&&(c=l._retryCache=new Dp),c;default:throw Error(i(435,l.tag))}}function ui(l,c){var g=Ks(l);c.forEach(function(x){if(!g.has(x)){g.add(x);var C=gy.bind(null,l,x);x.then(C,C)}})}function va(l,c){var g=c.deletions;if(g!==null)for(var x=0;x<g.length;x++){var C=g[x],E=l,q=c;if(wt){var F=q;e:for(;F!==null;){switch(F.tag){case 27:if(ua){if(Gl(F.type)){zn=F.stateNode,$n=!1;break e}break}case 5:zn=F.stateNode,$n=!1;break e;case 3:case 4:zn=F.stateNode.containerInfo,$n=!0;break e}F=F.return}if(zn===null)throw Error(i(160));su(E,q,C),zn=null,$n=!1}else su(E,q,C);E=C.alternate,E!==null&&(E.return=null),C.return=null}if(c.subtreeFlags&13886)for(c=c.child;c!==null;)iu(c,l),c=c.sibling}function iu(l,c){var g=l.alternate,x=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:va(c,l),Sa(l),x&4&&(zr(3,l,l.return),Dr(3,l),zr(5,l,l.return));break;case 1:va(c,l),Sa(l),x&512&&(Yn||g===null||Ba(g,g.return)),x&64&&Pn&&(l=l.updateQueue,l!==null&&(x=l.callbacks,x!==null&&(g=l.shared.hiddenCallbacks,l.shared.hiddenCallbacks=g===null?x:g.concat(x))));break;case 26:if(Js){var C=Jt;if(va(c,l),Sa(l),x&512&&(Yn||g===null||Ba(g,g.return)),x&4){x=g!==null?g.memoizedState:null;var E=l.memoizedState;g===null?E===null?l.stateNode===null?l.stateNode=p0(C,l.type,l.memoizedProps,l):Np(C,l.type,l.stateNode):l.stateNode=Sp(C,E,l.memoizedProps):x!==E?(x===null?g.stateNode!==null&&_p(g.stateNode):Zi(x),E===null?Np(C,l.type,l.stateNode):Sp(C,E,l.memoizedProps)):E===null&&l.stateNode!==null&&nu(l,l.memoizedProps,g.memoizedProps)}break}case 27:if(ua){va(c,l),Sa(l),x&512&&(Yn||g===null||Ba(g,g.return)),g!==null&&x&4&&nu(l,l.memoizedProps,g.memoizedProps);break}case 5:if(va(c,l),Sa(l),x&512&&(Yn||g===null||Ba(g,g.return)),wt){if(l.flags&32){C=l.stateNode;try{lp(C)}catch(je){$e(l,l.return,je)}}x&4&&l.stateNode!=null&&(C=l.memoizedProps,nu(l,C,g!==null?g.memoizedProps:C)),x&1024&&(Zo=!0)}else As&&l.alternate!==null&&(l.alternate.stateNode=l.stateNode);break;case 6:if(va(c,l),Sa(l),x&4&&wt){if(l.stateNode===null)throw Error(i(162));x=l.memoizedProps,g=g!==null?g.memoizedProps:x,C=l.stateNode;try{Ug(C,g,x)}catch(je){$e(l,l.return,je)}}break;case 3:if(Js?(m0(),C=Jt,Jt=xu(c.containerInfo),va(c,l),Jt=C):va(c,l),Sa(l),x&4){if(wt&&vn&&g!==null&&g.memoizedState.isDehydrated)try{c0(c.containerInfo)}catch(je){$e(l,l.return,je)}if(As){x=c.containerInfo,g=c.pendingChildren;try{dp(x,g)}catch(je){$e(l,l.return,je)}}}Zo&&(Zo=!1,Ad(l));break;case 4:Js?(g=Jt,Jt=xu(l.stateNode.containerInfo),va(c,l),Sa(l),Jt=g):(va(c,l),Sa(l)),x&4&&As&&Bh(l.stateNode,l,l.stateNode.pendingChildren);break;case 12:va(c,l),Sa(l);break;case 31:va(c,l),Sa(l),x&4&&(x=l.updateQueue,x!==null&&(l.updateQueue=null,ui(l,x)));break;case 13:va(c,l),Sa(l),l.child.flags&8192&&l.memoizedState!==null!=(g!==null&&g.memoizedState!==null)&&(Tu=Ga()),x&4&&(x=l.updateQueue,x!==null&&(l.updateQueue=null,ui(l,x)));break;case 22:C=l.memoizedState!==null;var q=g!==null&&g.memoizedState!==null,F=Pn,pe=Yn;if(Pn=F||C,Yn=pe||q,va(c,l),Yn=pe,Pn=F,Sa(l),x&8192&&(c=l.stateNode,c._visibility=C?c._visibility&-2:c._visibility|1,C&&(g===null||q||Pn||Yn||Li(l)),wt)){e:if(g=null,wt)for(c=l;;){if(c.tag===5||Js&&c.tag===26){if(g===null){q=g=c;try{E=q.stateNode,C?yy(E):Vg(q.stateNode,q.memoizedProps)}catch(je){$e(q,q.return,je)}}}else if(c.tag===6){if(g===null){q=c;try{var Se=q.stateNode;C?Yg(Se):Qg(Se,q.memoizedProps)}catch(je){$e(q,q.return,je)}}}else if(c.tag===18){if(g===null){q=c;try{var Me=q.stateNode;C?d0(Me):f0(q.stateNode)}catch(je){$e(q,q.return,je)}}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===l)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===l)break e;for(;c.sibling===null;){if(c.return===null||c.return===l)break e;g===c&&(g=null),c=c.return}g===c&&(g=null),c.sibling.return=c.return,c=c.sibling}}x&4&&(x=l.updateQueue,x!==null&&(g=x.retryQueue,g!==null&&(x.retryQueue=null,ui(l,g))));break;case 19:va(c,l),Sa(l),x&4&&(x=l.updateQueue,x!==null&&(l.updateQueue=null,ui(l,x)));break;case 30:break;case 21:break;default:va(c,l),Sa(l)}}function Sa(l){var c=l.flags;if(c&2){try{for(var g,x=l.return;x!==null;){if(Hh(x)){g=x;break}x=x.return}if(wt){if(g==null)throw Error(i(160));switch(g.tag){case 27:if(ua){var C=g.stateNode,E=ci(l);au(l,E,C);break}case 5:var q=g.stateNode;g.flags&32&&(lp(q),g.flags&=-33);var F=ci(l);au(l,F,q);break;case 3:case 4:var pe=g.stateNode.containerInfo,Se=ci(l);Md(l,Se,pe);break;default:throw Error(i(161))}}}catch(Me){$e(l,l.return,Me)}l.flags&=-3}c&4096&&(l.flags&=-4097)}function Ad(l){if(l.subtreeFlags&1024)for(l=l.child;l!==null;){var c=l;Ad(c),c.tag===5&&c.flags&1024&&ep(c.stateNode),l=l.sibling}}function Za(l,c){if(c.subtreeFlags&8772)for(c=c.child;c!==null;)wg(l,c.alternate,c),c=c.sibling}function Li(l){for(l=l.child;l!==null;){var c=l;switch(c.tag){case 0:case 11:case 14:case 15:zr(4,c,c.return),Li(c);break;case 1:Ba(c,c.return);var g=c.stateNode;typeof g.componentWillUnmount=="function"&&Od(c,c.return,g),Li(c);break;case 27:ua&&Na(c.stateNode);case 26:case 5:Ba(c,c.return),Li(c);break;case 22:c.memoizedState===null&&Li(c);break;case 30:Li(c);break;default:Li(c)}l=l.sibling}}function Xs(l,c,g){for(g=g&&(c.subtreeFlags&8772)!==0,c=c.child;c!==null;){var x=c.alternate,C=l,E=c,q=E.flags;switch(E.tag){case 0:case 11:case 15:Xs(C,E,g),Dr(4,E);break;case 1:if(Xs(C,E,g),x=E,C=x.stateNode,typeof C.componentDidMount=="function")try{C.componentDidMount()}catch(Se){$e(x,x.return,Se)}if(x=E,C=x.updateQueue,C!==null){var F=x.stateNode;try{var pe=C.shared.hiddenCallbacks;if(pe!==null)for(C.shared.hiddenCallbacks=null,C=0;C<pe.length;C++)Pt(pe[C],F)}catch(Se){$e(x,x.return,Se)}}g&&q&64&&Oo(E),Mo(E,E.return);break;case 27:ua&&jg(E);case 26:case 5:Xs(C,E,g),g&&x===null&&q&4&&Ol(E),Mo(E,E.return);break;case 12:Xs(C,E,g);break;case 31:Xs(C,E,g),g&&q&4&&Qs(C,E);break;case 13:Xs(C,E,g),g&&q&4&&ru(C,E);break;case 22:E.memoizedState===null&&Xs(C,E,g),Mo(E,E.return);break;case 30:break;default:Xs(C,E,g)}c=c.sibling}}function Ui(l,c){var g=null;l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),l=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(l=c.memoizedState.cachePool.pool),l!==g&&(l!=null&&l.refCount++,g!=null&&Qa(g))}function Ph(l,c){l=null,c.alternate!==null&&(l=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==l&&(c.refCount++,l!=null&&Qa(l))}function On(l,c,g,x){if(c.subtreeFlags&10256)for(c=c.child;c!==null;)Dd(l,c,g,x),c=c.sibling}function Dd(l,c,g,x){var C=c.flags;switch(c.tag){case 0:case 11:case 15:On(l,c,g,x),C&2048&&Dr(9,c);break;case 1:On(l,c,g,x);break;case 3:On(l,c,g,x),C&2048&&(l=null,c.alternate!==null&&(l=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==l&&(c.refCount++,l!=null&&Qa(l)));break;case 12:if(C&2048){On(l,c,g,x),l=c.stateNode;try{var E=c.memoizedProps,q=E.id,F=E.onPostCommit;typeof F=="function"&&F(q,c.alternate===null?"mount":"update",l.passiveEffectDuration,-0)}catch(pe){$e(c,c.return,pe)}}else On(l,c,g,x);break;case 31:On(l,c,g,x);break;case 13:On(l,c,g,x);break;case 23:break;case 22:E=c.stateNode,q=c.alternate,c.memoizedState!==null?E._visibility&2?On(l,c,g,x):Ao(l,c):E._visibility&2?On(l,c,g,x):(E._visibility|=2,cs(l,c,g,x,(c.subtreeFlags&10256)!==0||!1)),C&2048&&Ui(q,c);break;case 24:On(l,c,g,x),C&2048&&Ph(c.alternate,c);break;default:On(l,c,g,x)}}function cs(l,c,g,x,C){for(C=C&&((c.subtreeFlags&10256)!==0||!1),c=c.child;c!==null;){var E=l,q=c,F=g,pe=x,Se=q.flags;switch(q.tag){case 0:case 11:case 15:cs(E,q,F,pe,C),Dr(8,q);break;case 23:break;case 22:var Me=q.stateNode;q.memoizedState!==null?Me._visibility&2?cs(E,q,F,pe,C):Ao(E,q):(Me._visibility|=2,cs(E,q,F,pe,C)),C&&Se&2048&&Ui(q.alternate,q);break;case 24:cs(E,q,F,pe,C),C&&Se&2048&&Ph(q.alternate,q);break;default:cs(E,q,F,pe,C)}c=c.sibling}}function Ao(l,c){if(c.subtreeFlags&10256)for(c=c.child;c!==null;){var g=l,x=c,C=x.flags;switch(x.tag){case 22:Ao(g,x),C&2048&&Ui(x.alternate,x);break;case 24:Ao(g,x),C&2048&&Ph(x.alternate,x);break;default:Ao(g,x)}c=c.sibling}}function kr(l,c,g){if(l.subtreeFlags&Ls)for(l=l.child;l!==null;)qi(l,c,g),l=l.sibling}function qi(l,c,g){switch(l.tag){case 26:if(kr(l,c,g),l.flags&Ls)if(l.memoizedState!==null)g0(g,Jt,l.memoizedState,l.memoizedProps);else{var x=l.stateNode,C=l.type;l=l.memoizedProps,((c&335544128)===c||Wh(C,l))&&Zd(g,x,C,l)}break;case 5:kr(l,c,g),l.flags&Ls&&(x=l.stateNode,C=l.type,l=l.memoizedProps,((c&335544128)===c||Wh(C,l))&&Zd(g,x,C,l));break;case 3:case 4:Js?(x=Jt,Jt=xu(l.stateNode.containerInfo),kr(l,c,g),Jt=x):kr(l,c,g);break;case 22:l.memoizedState===null&&(x=l.alternate,x!==null&&x.memoizedState!==null?(x=Ls,Ls=16777216,kr(l,c,g),Ls=x):kr(l,c,g));break;default:kr(l,c,g)}}function zd(l){var c=l.alternate;if(c!==null&&(l=c.child,l!==null)){c.child=null;do c=l.sibling,l.sibling=null,l=c;while(l!==null)}}function Do(l){var c=l.deletions;if((l.flags&16)!==0){if(c!==null)for(var g=0;g<c.length;g++){var x=c[g];Wn=x,Rs(x,l)}zd(l)}if(l.subtreeFlags&10256)for(l=l.child;l!==null;)kd(l),l=l.sibling}function kd(l){switch(l.tag){case 0:case 11:case 15:Do(l),l.flags&2048&&zr(9,l,l.return);break;case 3:Do(l);break;case 12:Do(l);break;case 22:var c=l.stateNode;l.memoizedState!==null&&c._visibility&2&&(l.return===null||l.return.tag!==13)?(c._visibility&=-3,lu(l)):Do(l);break;default:Do(l)}}function lu(l){var c=l.deletions;if((l.flags&16)!==0){if(c!==null)for(var g=0;g<c.length;g++){var x=c[g];Wn=x,Rs(x,l)}zd(l)}for(l=l.child;l!==null;){switch(c=l,c.tag){case 0:case 11:case 15:zr(8,c,c.return),lu(c);break;case 22:g=c.stateNode,g._visibility&2&&(g._visibility&=-3,lu(c));break;default:lu(c)}l=l.sibling}}function Rs(l,c){for(;Wn!==null;){var g=Wn;switch(g.tag){case 0:case 11:case 15:zr(8,g,c);break;case 23:case 22:if(g.memoizedState!==null&&g.memoizedState.cachePool!==null){var x=g.memoizedState.cachePool.pool;x!=null&&x.refCount++}break;case 24:Qa(g.memoizedState.cache)}if(x=g.child,x!==null)x.return=g,Wn=x;else e:for(g=l;Wn!==null;){x=Wn;var C=x.sibling,E=x.return;if(Gh(x),x===g){Wn=null;break e}if(C!==null){C.return=E,Wn=C;break e}Wn=E}}}function Hi(l){var c=rt(l);if(c!=null){if(typeof c.memoizedProps["data-testname"]!="string")throw Error(i(364));return c}if(l=In(l),l===null)throw Error(i(362));return l.stateNode.current}function Bi(l,c){var g=l.tag;switch(c.$$typeof){case rr:if(l.type===c.value)return!0;break;case Jo:e:{for(c=c.value,l=[l,0],g=0;g<l.length;){var x=l[g++],C=x.tag,E=l[g++],q=c[E];if(C!==5&&C!==26&&C!==27||!Xi(x)){for(;q!=null&&Bi(x,q);)E++,q=c[E];if(E===c.length){c=!0;break e}else for(x=x.child;x!==null;)l.push(x,E),x=x.sibling}}c=!1}return c;case Wo:if((g===5||g===26||g===27)&&ap(l.stateNode,c.value))return!0;break;case tl:if((g===5||g===6||g===26||g===27)&&(l=gu(l),l!==null&&0<=l.indexOf(c.value)))return!0;break;case wu:if((g===5||g===26||g===27)&&(l=l.memoizedProps["data-testname"],typeof l=="string"&&l.toLowerCase()===c.value.toLowerCase()))return!0;break;default:throw Error(i(365))}return!1}function zo(l){switch(l.$$typeof){case rr:return"<"+(b(l.value)||"Unknown")+">";case Jo:return":has("+(zo(l)||"")+")";case Wo:return'[role="'+l.value+'"]';case tl:return'"'+l.value+'"';case wu:return'[data-testname="'+l.value+'"]';default:throw Error(i(365))}}function ko(l,c){var g=[];l=[l,0];for(var x=0;x<l.length;){var C=l[x++],E=C.tag,q=l[x++],F=c[q];if(E!==5&&E!==26&&E!==27||!Xi(C)){for(;F!=null&&Bi(C,F);)q++,F=c[q];if(q===c.length)g.push(C);else for(C=C.child;C!==null;)l.push(C,q),C=C.sibling}}return g}function us(l,c){if(!ca)throw Error(i(363));l=Hi(l),l=ko(l,c),c=[],l=Array.from(l);for(var g=0;g<l.length;){var x=l[g++],C=x.tag;if(C===5||C===26||C===27)Xi(x)||c.push(x.stateNode);else for(x=x.child;x!==null;)l.push(x),x=x.sibling}return c}function bn(){return(bt&2)!==0&&_t!==0?_t&-_t:Ke.T!==null?Ta():Vo()}function di(){if(ns===0)if((_t&536870912)===0||Nt){var l=Yl;Yl<<=1,(Yl&3932160)===0&&(Yl=262144),ns=l}else ns=536870912;return l=gs.current,l!==null&&(l.flags|=32),ns}function Mn(l,c,g){(l===pt&&(Wt===2||Wt===9)||l.cancelPendingCommit!==null)&&(Bn(l,0),Ur(l,_t,ns,!1)),P(l,g),((bt&2)===0||l!==pt)&&(l===pt&&((bt&2)===0&&(sl|=g),kn===4&&Ur(l,_t,ns,!1)),Ea(l))}function yr(l,c,g){if((bt&6)!==0)throw Error(i(327));var x=!g&&(c&127)===0&&(c&l.expiredLanes)===0||M(l,c),C=x?Rg(l,c):qr(l,c,!0),E=x;do{if(C===0){nl&&!x&&Ur(l,c,0,!1);break}else{if(g=l.current.alternate,E&&!Eg(g)){C=qr(l,c,!1),E=!1;continue}if(C===2){if(E=c,l.errorRecoveryDisabledLanes&E)var q=0;else q=l.pendingLanes&-536870913,q=q!==0?q:q&536870912?536870912:0;if(q!==0){c=q;e:{var F=l;C=Eu;var pe=vn&&F.current.memoizedState.isDehydrated;if(pe&&(Bn(F,q).flags|=256),q=qr(F,q,!1),q!==2){if(al&&!pe){F.errorRecoveryDisabledLanes|=E,sl|=E,C=4;break e}E=ys,ys=C,E!==null&&(ys===null?ys=E:ys.push.apply(ys,E))}C=q}if(E=!1,C!==2)continue}}if(C===1){Bn(l,0),Ur(l,c,0,!0);break}e:{switch(x=l,E=C,E){case 0:case 1:throw Error(i(345));case 4:if((c&4194048)!==c)break;case 6:Ur(x,c,ns,!Sr);break e;case 2:ys=null;break;case 3:case 5:break;default:throw Error(i(329))}if((c&62914560)===c&&(C=Tu+300-Ga(),10<C)){if(Ur(x,c,ns,!Sr),R(x,0,!0)!==0)break e;Wr=c,x.timeoutHandle=Jh(Lr.bind(null,x,g,ys,Ru,xf,c,ns,sl,ec,Sr,E,"Throttled",-0,0),C);break e}Lr(x,g,ys,Ru,xf,c,ns,sl,ec,Sr,E,null,-0,0)}}break}while(!0);Ea(l)}function Lr(l,c,g,x,C,E,q,F,pe,Se,Me,je,Ue,st){if(l.timeoutHandle=hs,je=c.subtreeFlags,je&8192||(je&16785408)===16785408){je=$h(),qi(c,E,je);var ja=(E&62914560)===E?Tu-Ga():(E&4194048)===E?Il-Ga():0;if(ja=Lg(je,ja),ja!==null){Wr=E,l.cancelPendingCommit=ja(Br.bind(null,l,c,E,g,x,C,q,F,pe,Me,je,null,Ue,st)),Ur(l,E,q,!Se);return}}Br(l,c,E,g,x,C,q,F,pe)}function Eg(l){for(var c=l;;){var g=c.tag;if((g===0||g===11||g===15)&&c.flags&16384&&(g=c.updateQueue,g!==null&&(g=g.stores,g!==null)))for(var x=0;x<g.length;x++){var C=g[x],E=C.getSnapshot;C=C.value;try{if(!Jn(E(),C))return!1}catch{return!1}}if(g=c.child,c.subtreeFlags&16384&&g!==null)g.return=c,c=g;else{if(c===l)break;for(;c.sibling===null;){if(c.return===null||c.return===l)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function Ur(l,c,g,x){c&=~$o,c&=~sl,l.suspendedLanes|=c,l.pingedLanes&=~c,x&&(l.warmLanes|=c),x=l.expirationTimes;for(var C=c;0<C;){var E=31-ps(C),q=1<<E;x[E]=-1,C&=~q}g!==0&&U(l,g,c)}function Ld(){return(bt&6)===0?(rs(0),!1):!0}function Ud(){if(vt!==null){if(Wt===0)var l=vt.return;else l=vt,br=cn=null,Qc(l),Wi=null,Ql=0,l=vt;for(;l!==null;)Cg(l.alternate,l),l=l.return;vt=null}}function Bn(l,c){var g=l.timeoutHandle;g!==hs&&(l.timeoutHandle=hs,kg(g)),g=l.cancelPendingCommit,g!==null&&(l.cancelPendingCommit=null,g()),Wr=0,Ud(),pt=l,vt=g=Ms(l.current,null),_t=c,Wt=0,sa=null,Sr=!1,nl=M(l,c),al=!1,ec=ns=$o=sl=_i=kn=0,ys=Eu=null,xf=!1,(c&8)!==0&&(c|=c&32);var x=l.entangledLanes;if(x!==0)for(l=l.entanglements,x&=c;0<x;){var C=31-ps(x),E=1<<C;c|=l[C],x&=~E}return Jr=c,qe(),g}function on(l,c){it=null,Ke.H=ks,c===ha||c===ar?(c=Fn(),Wt=3):c===gf?(c=Fn(),Wt=4):Wt=c===ts?8:c!==null&&typeof c=="object"&&typeof c.then=="function"?6:1,sa=c,vt===null&&(kn=1,wd(l,Ne(c,l.current)))}function jt(){var l=gs.current;return l===null?!0:(_t&4194048)===_t?es===null:(_t&62914560)===_t||(_t&536870912)!==0?l===es:!1}function fi(){var l=Ke.H;return Ke.H=ks,l===null?ks:l}function Os(){var l=Ke.A;return Ke.A=Io,l}function Lo(){kn=4,Sr||(_t&4194048)!==_t&&gs.current!==null||(nl=!0),(_i&134217727)===0&&(sl&134217727)===0||pt===null||Ur(pt,_t,ns,!1)}function qr(l,c,g){var x=bt;bt|=2;var C=fi(),E=Os();(pt!==l||_t!==c)&&(Ru=null,Bn(l,c)),c=!1;var q=kn;e:do try{if(Wt!==0&&vt!==null){var F=vt,pe=sa;switch(Wt){case 8:Ud(),q=6;break e;case 3:case 2:case 9:case 6:gs.current===null&&(c=!0);var Se=Wt;if(Wt=0,sa=null,Hr(l,F,pe,Se),g&&nl){q=0;break e}break;default:Se=Wt,Wt=0,sa=null,Hr(l,F,pe,Se)}}Tg(),q=kn;break}catch(Me){on(l,Me)}while(!0);return c&&l.shellSuspendCounter++,br=cn=null,bt=x,Ke.H=C,Ke.A=E,vt===null&&(pt=null,_t=0,qe()),q}function Tg(){for(;vt!==null;)Gi(vt)}function Rg(l,c){var g=bt;bt|=2;var x=fi(),C=Os();pt!==l||_t!==c?(Ru=null,rl=Ga()+500,Bn(l,c)):nl=M(l,c);e:do try{if(Wt!==0&&vt!==null){c=vt;var E=sa;t:switch(Wt){case 1:Wt=0,sa=null,Hr(l,c,E,1);break;case 2:case 9:if(At(E)){Wt=0,sa=null,qd(c);break}c=function(){Wt!==2&&Wt!==9||pt!==l||(Wt=7),Ea(l)},E.then(c,c);break e;case 3:Wt=7;break e;case 4:Wt=5;break e;case 7:At(E)?(Wt=0,sa=null,qd(c)):(Wt=0,sa=null,Hr(l,c,E,7));break;case 5:var q=null;switch(vt.tag){case 26:q=vt.memoizedState;case 5:case 27:var F=vt,pe=F.type,Se=F.pendingProps;if(q?jp(q):An(F.stateNode,pe,Se)){Wt=0,sa=null;var Me=F.sibling;if(Me!==null)vt=Me;else{var je=F.return;je!==null?(vt=je,qo(je)):vt=null}break t}}Wt=0,sa=null,Hr(l,c,E,5);break;case 6:Wt=0,sa=null,Hr(l,c,E,6);break;case 8:Ud(),kn=6;break e;default:throw Error(i(462))}}Uo();break}catch(Ue){on(l,Ue)}while(!0);return br=cn=null,Ke.H=x,Ke.A=C,bt=g,vt!==null?0:(pt=null,_t=0,qe(),kn)}function Uo(){for(;vt!==null&&!x0();)Gi(vt)}function Gi(l){var c=kh(l.alternate,l,Jr);l.memoizedProps=l.pendingProps,c===null?qo(l):vt=c}function qd(l){var c=l,g=c.alternate;switch(c.tag){case 15:case 0:c=Rh(g,c,c.pendingProps,c.type,void 0,_t);break;case 11:c=Rh(g,c,c.pendingProps,c.type.render,c.ref,_t);break;case 5:Qc(c);default:Cg(g,c),c=vt=Gd(c,Jr),c=kh(g,c,Jr)}l.memoizedProps=l.pendingProps,c===null?qo(l):vt=c}function Hr(l,c,g,x){br=cn=null,Qc(c),Wi=null,Ql=0;var C=c.return;try{if(hy(l,C,c,g,_t)){kn=1,wd(l,Ne(g,l.current)),vt=null;return}}catch(E){if(C!==null)throw vt=C,E;kn=1,wd(l,Ne(g,l.current)),vt=null;return}c.flags&32768?(Nt||x===1?l=!0:nl||(_t&536870912)!==0?l=!1:(Sr=l=!0,(x===2||x===9||x===3||x===6)&&(x=gs.current,x!==null&&x.tag===13&&(x.flags|=16384))),Pi(c,l)):qo(c)}function qo(l){var c=l;do{if((c.flags&32768)!==0){Pi(c,Sr);return}l=c.return;var g=_g(c.alternate,c,Jr);if(g!==null){vt=g;return}if(c=c.sibling,c!==null){vt=c;return}vt=c=l}while(c!==null);kn===0&&(kn=5)}function Pi(l,c){do{var g=qh(l.alternate,l);if(g!==null){g.flags&=32767,vt=g;return}if(g=l.return,g!==null&&(g.flags|=32768,g.subtreeFlags=0,g.deletions=null),!c&&(l=l.sibling,l!==null)){vt=l;return}vt=l=g}while(l!==null);kn=6,vt=null}function Br(l,c,g,x,C,E,q,F,pe){l.cancelPendingCommit=null;do Pr();while(ra!==0);if((bt&6)!==0)throw Error(i(327));if(c!==null){if(c===l.current)throw Error(i(177));if(E=c.lanes|c.childLanes,E|=Kl,L(l,g,E,q,F,pe),l===pt&&(vt=pt=null,_t=0),Jl=c,ji=l,Wr=g,tc=E,bf=C,zp=x,(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?(l.callbackNode=null,l.callbackPriority=0,na(vu,function(){return ou(),null})):(l.callbackNode=null,l.callbackPriority=0),x=(c.flags&13878)!==0,(c.subtreeFlags&13878)!==0||x){x=Ke.T,Ke.T=null,C=Is(),St(2),q=bt,bt|=4;try{py(l,c,g)}finally{bt=q,St(C),Ke.T=x}}ra=1,hi(),Gr(),Hd()}}function hi(){if(ra===1){ra=0;var l=ji,c=Jl,g=(c.flags&13878)!==0;if((c.subtreeFlags&13878)!==0||g){g=Ke.T,Ke.T=null;var x=Is();St(2);var C=bt;bt|=4;try{iu(c,l),zg(l.containerInfo)}finally{bt=C,St(x),Ke.T=g}}l.current=c,ra=2}}function Gr(){if(ra===2){ra=0;var l=ji,c=Jl,g=(c.flags&8772)!==0;if((c.subtreeFlags&8772)!==0||g){g=Ke.T,Ke.T=null;var x=Is();St(2);var C=bt;bt|=4;try{wg(l,c.alternate,c)}finally{bt=C,St(x),Ke.T=g}}ra=3}}function Hd(){if(ra===4||ra===3){ra=0,Ep();var l=ji,c=Jl,g=Wr,x=zp;(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?ra=5:(ra=0,Jl=ji=null,Bd(l,l.pendingLanes));var C=l.pendingLanes;if(C===0&&(Ci=null),ne(g),c=c.stateNode,ms&&typeof ms.onCommitFiberRoot=="function")try{ms.onCommitFiberRoot(Vl,c,void 0,(c.current.flags&128)===128)}catch{}if(x!==null){c=Ke.T,C=Is(),St(2),Ke.T=null;try{for(var E=l.onRecoverableError,q=0;q<x.length;q++){var F=x[q];E(F.value,{componentStack:F.stack})}}finally{Ke.T=c,St(C)}}(Wr&3)!==0&&Pr(),Ea(l),C=l.pendingLanes,(g&261930)!==0&&(C&42)!==0?l===Ou?Ut++:(Ut=0,Ou=l):Ut=0,vn&&yu(),rs(0)}}function Bd(l,c){(l.pooledCacheLanes&=c)===0&&(c=l.pooledCache,c!=null&&(l.pooledCache=null,Qa(c)))}function Pr(){return hi(),Gr(),Hd(),ou()}function ou(){if(ra!==5)return!1;var l=ji,c=tc;tc=0;var g=ne(Wr),x=32>g?32:g;g=Ke.T;var C=Is();try{St(x),Ke.T=null,x=bf,bf=null;var E=ji,q=Wr;if(ra=0,Jl=ji=null,Wr=0,(bt&6)!==0)throw Error(i(331));var F=bt;if(bt|=4,kd(E.current),Dd(E,E.current,q,x),bt=F,rs(0,!1),ms&&typeof ms.onPostCommitFiberRoot=="function")try{ms.onPostCommitFiberRoot(Vl,E)}catch{}return!0}finally{St(C),Ke.T=g,Bd(l,c)}}function Yi(l,c,g){c=Ne(g,c),c=Eh(l.stateNode,c,2),l=pn(l,c,2),l!==null&&(P(l,2),Ea(l))}function $e(l,c,g){if(l.tag===3)Yi(l,l,g);else for(;c!==null;){if(c.tag===3){Yi(c,l,g);break}else if(c.tag===1){var x=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof x.componentDidCatch=="function"&&(Ci===null||!Ci.has(x))){l=Ne(g,l),g=dg(2),x=pn(c,g,2),x!==null&&(fg(g,x,c,l),P(x,2),Ea(x));break}}c=c.return}}function Ho(l,c,g){var x=l.pingCache;if(x===null){x=l.pingCache=new Us;var C=new Set;x.set(c,C)}else C=x.get(c),C===void 0&&(C=new Set,x.set(c,C));C.has(g)||(al=!0,C.add(g),l=Og.bind(null,l,c,g),c.then(l,l))}function Og(l,c,g){var x=l.pingCache;x!==null&&x.delete(c),l.pingedLanes|=l.suspendedLanes&g,l.warmLanes&=~g,pt===l&&(_t&g)===g&&(kn===4||kn===3&&(_t&62914560)===_t&&300>Ga()-Tu?(bt&2)===0&&Bn(l,0):$o|=g,ec===_t&&(ec=0)),Ea(l)}function Mg(l,c){c===0&&(c=k()),l=ot(l,c),l!==null&&(P(l,c),Ea(l))}function my(l){var c=l.memoizedState,g=0;c!==null&&(g=c.retryLane),Mg(l,g)}function gy(l,c){var g=0;switch(l.tag){case 31:case 13:var x=l.stateNode,C=l.memoizedState;C!==null&&(g=C.retryLane);break;case 19:x=l.stateNode;break;case 22:x=l.stateNode._retryCache;break;default:throw Error(i(314))}x!==null&&x.delete(c),Mg(l,g)}function na(l,c){return bu(l,c)}function Yh(l,c,g,x){this.tag=l,this.key=g,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=x,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ml(l){return l=l.prototype,!(!l||!l.isReactComponent)}function Ms(l,c){var g=l.alternate;return g===null?(g=n(l.tag,c,l.key,l.mode),g.elementType=l.elementType,g.type=l.type,g.stateNode=l.stateNode,g.alternate=l,l.alternate=g):(g.pendingProps=c,g.type=l.type,g.flags=0,g.subtreeFlags=0,g.deletions=null),g.flags=l.flags&65011712,g.childLanes=l.childLanes,g.lanes=l.lanes,g.child=l.child,g.memoizedProps=l.memoizedProps,g.memoizedState=l.memoizedState,g.updateQueue=l.updateQueue,c=l.dependencies,g.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},g.sibling=l.sibling,g.index=l.index,g.ref=l.ref,g.refCleanup=l.refCleanup,g}function Gd(l,c){l.flags&=65011714;var g=l.alternate;return g===null?(l.childLanes=0,l.lanes=c,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=g.childLanes,l.lanes=g.lanes,l.child=g.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=g.memoizedProps,l.memoizedState=g.memoizedState,l.updateQueue=g.updateQueue,l.type=g.type,c=g.dependencies,l.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),l}function pi(l,c,g,x,C,E){var q=0;if(x=l,typeof l=="function")Ml(l)&&(q=1);else if(typeof l=="string")q=Js&&ua?nf(l,g,_a.current)?26:wp(l)?27:5:Js?nf(l,g,_a.current)?26:5:ua&&wp(l)?27:5;else e:switch(l){case fu:return l=n(31,g,c,C),l.elementType=fu,l.lanes=E,l;case kl:return Fs(g.children,C,E,c);case Ll:q=8,C|=24;break;case Ul:return l=n(12,g,c,C|2),l.elementType=Ul,l.lanes=E,l;case Qd:return l=n(13,g,c,C),l.elementType=Qd,l.lanes=E,l;case mi:return l=n(19,g,c,C),l.elementType=mi,l.lanes=E,l;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case Zs:q=10;break e;case du:q=9;break e;case Bo:q=11;break e;case Kd:q=14;break e;case Ia:q=16,x=null;break e}q=29,g=Error(i(130,l===null?"null":typeof l,"")),x=null}return c=n(q,g,c,C),c.elementType=l,c.type=x,c.lanes=E,c}function Fs(l,c,g,x){return l=n(7,l,x,c),l.lanes=g,l}function Vh(l,c,g){return l=n(6,l,null,c),l.lanes=g,l}function Qh(l){var c=n(18,null,null,0);return c.stateNode=l,c}function Kh(l,c,g){return c=n(4,l.children!==null?l.children:[],l.key,c),c.lanes=g,c.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},c}function Ag(l,c,g,x,C,E,q,F,pe){this.tag=1,this.containerInfo=l,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=hs,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=G(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=G(0),this.hiddenUpdates=G(null),this.identifierPrefix=x,this.onUncaughtError=C,this.onCaughtError=E,this.onRecoverableError=q,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=pe,this.incompleteTransitions=new Map}function Vi(l,c,g,x,C,E,q,F,pe,Se,Me,je){return l=new Ag(l,c,g,q,pe,Se,Me,je,F),c=1,E===!0&&(c|=24),E=n(3,null,null,c),l.current=E,E.stateNode=l,c=dr(),c.refCount++,l.pooledCache=c,c.refCount++,E.memoizedState={element:x,isDehydrated:g,cache:c},ct(E),l}function Pd(l){return l?(l=Vr,l):Vr}function cu(l){var c=l._reactInternals;if(c===void 0)throw typeof l.render=="function"?Error(i(188)):(l=Object.keys(l).join(","),Error(i(268,l)));return l=f(c),l=l!==null?p(l):null,l===null?null:Po(l.stateNode)}function Xh(l,c,g,x,C,E){C=Pd(C),x.context===null?x.context=C:x.pendingContext=C,x=Tt(c),x.payload={element:g},E=E===void 0?null:E,E!==null&&(x.callback=E),g=pn(l,x,c),g!==null&&(Mn(g,l,c),Rr(g,l,c))}function Al(l,c){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var g=l.retryLane;l.retryLane=g!==0&&g<c?g:c}}function uu(l,c){Al(l,c),(l=l.alternate)&&Al(l,c)}var ft={},Yd=gl(),ds=Vb(),Vd=Object.assign,Dl=Symbol.for("react.element"),Yr=Symbol.for("react.transitional.element"),zl=Symbol.for("react.portal"),kl=Symbol.for("react.fragment"),Ll=Symbol.for("react.strict_mode"),Ul=Symbol.for("react.profiler"),du=Symbol.for("react.consumer"),Zs=Symbol.for("react.context"),Bo=Symbol.for("react.forward_ref"),Qd=Symbol.for("react.suspense"),mi=Symbol.for("react.suspense_list"),Kd=Symbol.for("react.memo"),Ia=Symbol.for("react.lazy"),fu=Symbol.for("react.activity"),Fh=Symbol.for("react.memo_cache_sentinel"),gi=Symbol.iterator,Qi=Symbol.for("react.client.reference"),Ki=Array.isArray,Ke=Yd.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Zh=e.rendererVersion,hu=e.rendererPackageName,Go=e.extraDevToolsConfig,Po=e.getPublicInstance,Dg=e.getRootHostContext,Yo=e.getChildHostContext,Xd=e.prepareForCommit,zg=e.resetAfterCommit,Ih=e.createInstance;e.cloneMutableInstance;var pu=e.appendInitialChild,fs=e.finalizeInitialChildren,Ja=e.shouldSetTextContent,yi=e.createTextInstance;e.cloneMutableTextInstance;var Jh=e.scheduleTimeout,kg=e.cancelTimeout,hs=e.noTimeout,Zn=e.isPrimaryRenderer;e.warnsIfNotActing;var wt=e.supportsMutation,As=e.supportsPersistence,vn=e.supportsHydration,rt=e.getInstanceFromNode;e.beforeActiveInstanceBlur;var tn=e.preparePortalMount;e.prepareScopeUpdate,e.getInstanceFromScope;var St=e.setCurrentUpdatePriority,Is=e.getCurrentUpdatePriority,Vo=e.resolveUpdatePriority;e.trackSchedulerEvent,e.resolveEventType,e.resolveEventTimeStamp;var ql=e.shouldAttemptEagerTransition,Fd=e.detachDeletedInstance;e.requestPostPaintCallback;var mu=e.maySuspendCommit,Qo=e.maySuspendCommitOnUpdate,Wh=e.maySuspendCommitInSyncRender,An=e.preloadInstance,$h=e.startSuspendingCommit,Zd=e.suspendInstance;e.suspendOnActiveViewTransition;var Lg=e.waitForCommitToBeReady;e.getSuspendedCommitReason;var Hl=e.NotPendingTransition,Bl=e.HostTransitionContext,ep=e.resetFormInstance;e.bindToConsole;var tp=e.supportsMicrotasks,np=e.scheduleMicrotask,ca=e.supportsTestSelectors,In=e.findFiberRoot,Id=e.getBoundingRect,gu=e.getTextContent,Xi=e.isHiddenSubtree,ap=e.matchAccessibilityRole,xi=e.setFocusIfFocusable,Jd=e.setupIntersectionObserver,sp=e.appendChild,rp=e.appendChildToContainer,Ug=e.commitTextUpdate,qg=e.commitMount,Hg=e.commitUpdate,Bg=e.insertBefore,Gg=e.insertInContainerBefore,Pg=e.removeChild,ip=e.removeChildFromContainer,lp=e.resetTextContent,yy=e.hideInstance,Yg=e.hideTextInstance,Vg=e.unhideInstance,Qg=e.unhideTextInstance;e.cancelViewTransitionName,e.cancelRootViewTransitionName,e.restoreRootViewTransitionName,e.cloneRootViewTransitionContainer,e.removeRootViewTransitionClone,e.measureClonedInstance,e.hasInstanceChanged,e.hasInstanceAffectedParent,e.startViewTransition,e.startGestureTransition,e.stopViewTransition,e.getCurrentGestureOffset,e.createViewTransitionInstance;var op=e.clearContainer;e.createFragmentInstance,e.updateFragmentInstanceFiber,e.commitNewChildToFragmentInstance,e.deleteChildFromFragmentInstance;var Kg=e.cloneInstance,cp=e.createContainerChildSet,up=e.appendChildToContainerChildSet,Xg=e.finalizeContainerChildren,dp=e.replaceContainerChildren,Fg=e.cloneHiddenInstance,fp=e.cloneHiddenTextInstance,Fi=e.isSuspenseInstancePending,Wd=e.isSuspenseInstanceFallback,$d=e.getSuspenseInstanceFallbackErrorDetails,ef=e.registerSuspenseInstanceRetry,Zg=e.canHydrateFormStateMarker,hp=e.isFormStateMarkerMatching,Ig=e.getNextHydratableSibling,Jg=e.getNextHydratableSiblingAfterSingleton,Wg=e.getFirstHydratableChild,$g=e.getFirstHydratableChildWithinContainer,e0=e.getFirstHydratableChildWithinActivityInstance,t0=e.getFirstHydratableChildWithinSuspenseInstance,pp=e.getFirstHydratableChildWithinSingleton,n0=e.canHydrateInstance,a0=e.canHydrateTextInstance,mp=e.canHydrateActivityInstance,s0=e.canHydrateSuspenseInstance,r0=e.hydrateInstance,xy=e.hydrateTextInstance,gp=e.hydrateActivityInstance,i0=e.hydrateSuspenseInstance,l0=e.getNextHydratableInstanceAfterActivityInstance,yp=e.getNextHydratableInstanceAfterSuspenseInstance,o0=e.commitHydratedInstance,c0=e.commitHydratedContainer,by=e.commitHydratedActivityInstance,vy=e.commitHydratedSuspenseInstance,u0=e.finalizeHydratedChildren,yu=e.flushHydrationEvents;e.clearActivityBoundary;var xp=e.clearSuspenseBoundary;e.clearActivityBoundaryFromContainer;var tf=e.clearSuspenseBoundaryFromContainer,d0=e.hideDehydratedBoundary,f0=e.unhideDehydratedBoundary,Ko=e.shouldDeleteUnhydratedTailInstances;e.diffHydratedPropsForDevWarnings,e.diffHydratedTextForDevWarnings,e.describeHydratableInstanceForDevWarnings;var h0=e.validateHydratableInstance,bp=e.validateHydratableTextInstance,Js=e.supportsResources,nf=e.isHostHoistableType,xu=e.getHoistableRoot,vp=e.getResource,Sp=e.acquireResource,Zi=e.releaseResource,p0=e.hydrateHoistable,Np=e.mountHoistable,_p=e.unmountHoistable,af=e.createHoistableInstance,m0=e.prepareToCommitHoistables,Cp=e.mayResourceSuspendCommit,jp=e.preloadResource,g0=e.suspendResource,ua=e.supportsSingletons,sf=e.resolveSingletonInstance,aa=e.acquireSingletonInstance,Na=e.releaseSingletonInstance,wp=e.isHostSingletonType,Gl=e.isSingletonScope,rf=[],Pl=-1,Vr={},ps=Math.clz32?Math.clz32:T,lf=Math.log,y0=Math.LN2,of=256,Yl=262144,Xo=4194304,bu=ds.unstable_scheduleCallback,cf=ds.unstable_cancelCallback,x0=ds.unstable_shouldYield,Ep=ds.unstable_requestPaint,Ga=ds.unstable_now,uf=ds.unstable_ImmediatePriority,b0=ds.unstable_UserBlockingPriority,vu=ds.unstable_NormalPriority,df=ds.unstable_IdlePriority,Tp=ds.log,v0=ds.unstable_setDisableYieldValue,Vl=null,ms=null,Jn=typeof Object.is=="function"?Object.is:ie,ff=typeof reportError=="function"?reportError:function(l){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var c=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof l=="object"&&l!==null&&typeof l.message=="string"?String(l.message):String(l),error:l});if(!window.dispatchEvent(c))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",l);return}console.error(l)},Sy=Object.prototype.hasOwnProperty,hf,Qr,Su=!1,Rp=new WeakMap,bi=[],Kr=0,nn=null,Nu=0,Ws=[],Ds=0,$s=null,Ma=1,xr="",_a=_(null),vi=_(null),Aa=_(null),_u=_(null),da=null,Sn=null,Nt=!1,Xr=null,Wa=!1,pf=Error(i(519)),er=_(null),cn=null,br=null,S0=typeof AbortController<"u"?AbortController:function(){var l=[],c=this.signal={aborted:!1,addEventListener:function(g,x){l.push(x)}};this.abort=function(){c.aborted=!0,l.forEach(function(g){return g()})}},Ca=ds.unstable_scheduleCallback,Ny=ds.unstable_NormalPriority,Nn={$$typeof:Zs,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},Cu=null,It=null,Pa=!1,tr=!1,mf=!1,Ii=0,Fo=null,Op=0,Si=0,fa=null,nr=Ke.S;Ke.S=function(l,c){Il=Ga(),typeof c=="object"&&c!==null&&typeof c.then=="function"&&Pc(l,c),nr!==null&&nr(l,c)};var Ji=_(null),ha=Error(i(460)),gf=Error(i(474)),ar=Error(i(542)),Fr={then:function(){}},$a=null,Wi=null,Ql=0,Da=Bs(!0),Mp=Bs(!1),za=[],Zr=0,Kl=0,zs=!1,yf=!1,Xl=_(null),$i=_(0),gs=_(null),es=null,Gn=_(0),Ni=0,it=null,Ve=null,nt=null,ht=!1,ut=!1,Rt=!1,Ya=0,sr=0,vr=null,Ap=0,ks={readContext:Zt,use:bo,useCallback:Rn,useContext:Rn,useEffect:Rn,useImperativeHandle:Rn,useLayoutEffect:Rn,useInsertionEffect:Rn,useMemo:Rn,useReducer:Rn,useRef:Rn,useState:Rn,useDebugValue:Rn,useDeferredValue:Rn,useTransition:Rn,useSyncExternalStore:Rn,useId:Rn,useHostTransitionStatus:Rn,useFormState:Rn,useActionState:Rn,useOptimistic:Rn,useMemoCache:Rn,useCacheRefresh:Rn};ks.useEffectEvent=Rn;var Dn={readContext:Zt,use:bo,useCallback:function(l,c){return qa().memoizedState=[l,c===void 0?null:c],l},useContext:Zt,useEffect:Fc,useImperativeHandle:function(l,c,g){g=g!=null?g.concat([l]):null,jl(4194308,4,_o.bind(null,c,l),g)},useLayoutEffect:function(l,c){return jl(4194308,4,l,c)},useInsertionEffect:function(l,c){jl(4,2,l,c)},useMemo:function(l,c){var g=qa();c=c===void 0?null:c;var x=l();if(Rt){W(!0);try{l()}finally{W(!1)}}return g.memoizedState=[x,c],x},useReducer:function(l,c,g){var x=qa();if(g!==void 0){var C=g(c);if(Rt){W(!0);try{g(c)}finally{W(!1)}}}else C=c;return x.memoizedState=x.baseState=C,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:C},x.queue=l,l=l.dispatch=fy.bind(null,it,l),[x.memoizedState,l]},useRef:function(l){var c=qa();return l={current:l},c.memoizedState=l},useState:function(l){l=bh(l);var c=l.queue,g=lg.bind(null,it,c);return c.dispatch=g,[l.memoizedState,g]},useDebugValue:Ic,useDeferredValue:function(l,c){var g=qa();return jo(g,l,c)},useTransition:function(){var l=bh(!1);return l=sg.bind(null,it,l.queue,!0,!1),qa().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,c,g){var x=it,C=qa();if(Nt){if(g===void 0)throw Error(i(407));g=g()}else{if(g=c(),pt===null)throw Error(i(349));(_t&127)!==0||eg(x,c,g)}C.memoizedState=g;var E={value:g,getSnapshot:c};return C.queue=E,Fc(xh.bind(null,x,E,l),[l]),x.flags|=2048,Ts(9,{destroy:void 0},yh.bind(null,x,E,g,c),null),g},useId:function(){var l=qa(),c=pt.identifierPrefix;if(Nt){var g=xr,x=Ma;g=(x&~(1<<32-ps(x)-1)).toString(32)+g,c="_"+c+"R_"+g,g=Ya++,0<g&&(c+="H"+g.toString(32)),c+="_"}else g=Ap++,c="_"+c+"r_"+g.toString(32)+"_";return l.memoizedState=c},useHostTransitionStatus:Ch,useFormState:Sh,useActionState:Sh,useOptimistic:function(l){var c=qa();c.memoizedState=c.baseState=l;var g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return c.queue=g,c=_d.bind(null,it,!0,g),g.dispatch=c,[l,c]},useMemoCache:hd,useCacheRefresh:function(){return qa().memoizedState=dy.bind(null,it)},useEffectEvent:function(l){var c=qa(),g={impl:l};return c.memoizedState=g,function(){if((bt&2)!==0)throw Error(i(440));return g.impl.apply(void 0,arguments)}}},Ir={readContext:Zt,use:bo,useCallback:Sd,useContext:Zt,useEffect:No,useImperativeHandle:ag,useInsertionEffect:zi,useLayoutEffect:Zc,useMemo:Co,useReducer:li,useRef:vd,useState:function(){return li(gr)},useDebugValue:Ic,useDeferredValue:function(l,c){var g=xn();return _h(g,Ve.memoizedState,l,c)},useTransition:function(){var l=li(gr)[0],c=xn().memoizedState;return[typeof l=="boolean"?l:Ha(l),c]},useSyncExternalStore:_l,useId:Nd,useHostTransitionStatus:Ch,useFormState:vo,useActionState:vo,useOptimistic:function(l,c){var g=xn();return Kc(g,Ve,l,c)},useMemoCache:hd,useCacheRefresh:ig};Ir.useEffectEvent=Xa;var el={readContext:Zt,use:bo,useCallback:Sd,useContext:Zt,useEffect:No,useImperativeHandle:ag,useInsertionEffect:zi,useLayoutEffect:Zc,useMemo:Co,useReducer:md,useRef:vd,useState:function(){return md(gr)},useDebugValue:Ic,useDeferredValue:function(l,c){var g=xn();return Ve===null?jo(g,l,c):_h(g,Ve.memoizedState,l,c)},useTransition:function(){var l=md(gr)[0],c=xn().memoizedState;return[typeof l=="boolean"?l:Ha(l),c]},useSyncExternalStore:_l,useId:Nd,useHostTransitionStatus:Ch,useFormState:So,useActionState:So,useOptimistic:function(l,c){var g=xn();return Ve!==null?Kc(g,Ve,l,c):(g.baseState=l,[l,g.queue.dispatch])},useMemoCache:hd,useCacheRefresh:ig};el.useEffectEvent=Xa;var ju={enqueueSetState:function(l,c,g){l=l._reactInternals;var x=bn(),C=Tt(x);C.payload=c,g!=null&&(C.callback=g),c=pn(l,C,x),c!==null&&(Mn(c,l,x),Rr(c,l,x))},enqueueReplaceState:function(l,c,g){l=l._reactInternals;var x=bn(),C=Tt(x);C.tag=1,C.payload=c,g!=null&&(C.callback=g),c=pn(l,C,x),c!==null&&(Mn(c,l,x),Rr(c,l,x))},enqueueForceUpdate:function(l,c){l=l._reactInternals;var g=bn(),x=Tt(g);x.tag=2,c!=null&&(x.callback=c),c=pn(l,x,g),c!==null&&(Mn(c,l,g),Rr(c,l,g))}},ts=Error(i(461)),mn=!1,Fl={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null},Pn=!1,Yn=!1,Zo=!1,Dp=typeof WeakSet=="function"?WeakSet:Set,Wn=null,zn=null,$n=!1,Jt=null,Ls=8192,Io={getCacheForType:function(l){var c=Zt(Nn),g=c.data.get(l);return g===void 0&&(g=l(),c.data.set(l,g)),g},cacheSignal:function(){return Zt(Nn).controller.signal}},rr=0,Jo=1,Wo=2,wu=3,tl=4;if(typeof Symbol=="function"&&Symbol.for){var Zl=Symbol.for;rr=Zl("selector.component"),Jo=Zl("selector.has_pseudo_class"),Wo=Zl("selector.role"),wu=Zl("selector.test_id"),tl=Zl("selector.text")}var Us=typeof WeakMap=="function"?WeakMap:Map,bt=0,pt=null,vt=null,_t=0,Wt=0,sa=null,Sr=!1,nl=!1,al=!1,Jr=0,kn=0,_i=0,sl=0,$o=0,ns=0,ec=0,Eu=null,ys=null,xf=!1,Tu=0,Il=0,rl=1/0,Ru=null,Ci=null,ra=0,ji=null,Jl=null,Wr=0,tc=0,bf=null,zp=null,Ut=0,Ou=null;return ft.attemptContinuousHydration=function(l){if(l.tag===13||l.tag===31){var c=ot(l,67108864);c!==null&&Mn(c,l,67108864),uu(l,67108864)}},ft.attemptHydrationAtCurrentPriority=function(l){if(l.tag===13||l.tag===31){var c=bn();c=re(c);var g=ot(l,c);g!==null&&Mn(g,l,c),uu(l,c)}},ft.attemptSynchronousHydration=function(l){switch(l.tag){case 3:if(l=l.stateNode,l.current.memoizedState.isDehydrated){var c=O(l.pendingLanes);if(c!==0){for(l.pendingLanes|=2,l.entangledLanes|=2;c;){var g=1<<31-ps(c);l.entanglements[1]|=g,c&=~g}Ea(l),(bt&6)===0&&(rl=Ga()+500,rs(0))}}break;case 31:case 13:c=ot(l,2),c!==null&&Mn(c,l,2),Ld(),uu(l,2)}},ft.batchedUpdates=function(l,c){return l(c)},ft.createComponentSelector=function(l){return{$$typeof:rr,value:l}},ft.createContainer=function(l,c,g,x,C,E,q,F,pe,Se){return Vi(l,c,!1,null,g,x,E,null,q,F,pe,Se)},ft.createHasPseudoClassSelector=function(l){return{$$typeof:Jo,value:l}},ft.createHydrationContainer=function(l,c,g,x,C,E,q,F,pe,Se,Me,je,Ue,st){return l=Vi(g,x,!0,l,C,E,F,st,pe,Se,Me,je),l.context=Pd(null),g=l.current,x=bn(),x=re(x),C=Tt(x),C.callback=c??null,pn(g,C,x),c=x,l.current.lanes=c,P(l,c),Ea(l),l},ft.createPortal=function(l,c,g){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:zl,key:x==null?null:""+x,children:l,containerInfo:c,implementation:g}},ft.createRoleSelector=function(l){return{$$typeof:Wo,value:l}},ft.createTestNameSelector=function(l){return{$$typeof:wu,value:l}},ft.createTextSelector=function(l){return{$$typeof:tl,value:l}},ft.defaultOnCaughtError=function(l){console.error(l)},ft.defaultOnRecoverableError=function(l){ff(l)},ft.defaultOnUncaughtError=function(l){ff(l)},ft.deferredUpdates=function(l){var c=Ke.T,g=Is();try{return St(32),Ke.T=null,l()}finally{St(g),Ke.T=c}},ft.discreteUpdates=function(l,c,g,x,C){var E=Ke.T,q=Is();try{return St(2),Ke.T=null,l(c,g,x,C)}finally{St(q),Ke.T=E,bt===0&&(rl=Ga()+500)}},ft.findAllNodes=us,ft.findBoundingRects=function(l,c){if(!ca)throw Error(i(363));c=us(l,c),l=[];for(var g=0;g<c.length;g++)l.push(Id(c[g]));for(c=l.length-1;0<c;c--){g=l[c];for(var x=g.x,C=x+g.width,E=g.y,q=E+g.height,F=c-1;0<=F;F--)if(c!==F){var pe=l[F],Se=pe.x,Me=Se+pe.width,je=pe.y,Ue=je+pe.height;if(x>=Se&&E>=je&&C<=Me&&q<=Ue){l.splice(c,1);break}else if(x!==Se||g.width!==pe.width||Ue<E||je>q){if(!(E!==je||g.height!==pe.height||Me<x||Se>C)){Se>x&&(pe.width+=Se-x,pe.x=x),Me<C&&(pe.width=C-Se),l.splice(c,1);break}}else{je>E&&(pe.height+=je-E,pe.y=E),Ue<q&&(pe.height=q-je),l.splice(c,1);break}}}return l},ft.findHostInstance=cu,ft.findHostInstanceWithNoPortals=function(l){return l=f(l),l=l!==null?y(l):null,l===null?null:Po(l.stateNode)},ft.findHostInstanceWithWarning=function(l){return cu(l)},ft.flushPassiveEffects=Pr,ft.flushSyncFromReconciler=function(l){var c=bt;bt|=1;var g=Ke.T,x=Is();try{if(St(2),Ke.T=null,l)return l()}finally{St(x),Ke.T=g,bt=c,(bt&6)===0&&rs(0)}},ft.flushSyncWork=Ld,ft.focusWithin=function(l,c){if(!ca)throw Error(i(363));for(l=Hi(l),c=ko(l,c),c=Array.from(c),l=0;l<c.length;){var g=c[l++],x=g.tag;if(!Xi(g)){if((x===5||x===26||x===27)&&xi(g.stateNode))return!0;for(g=g.child;g!==null;)c.push(g),g=g.sibling}}return!1},ft.getFindAllNodesFailureDescription=function(l,c){if(!ca)throw Error(i(363));var g=0,x=[];l=[Hi(l),0];for(var C=0;C<l.length;){var E=l[C++],q=E.tag,F=l[C++],pe=c[F];if((q!==5&&q!==26&&q!==27||!Xi(E))&&(Bi(E,pe)&&(x.push(zo(pe)),F++,F>g&&(g=F)),F<c.length))for(E=E.child;E!==null;)l.push(E,F),E=E.sibling}if(g<c.length){for(l=[];g<c.length;g++)l.push(zo(c[g]));return`findAllNodes was able to match part of the selector:
|
|
585
|
-
`+(x.join(" > ")+`
|
|
586
|
-
|
|
587
|
-
No matching component was found for:
|
|
588
|
-
`)+l.join(" > ")}return null},ft.getPublicRootInstance=function(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 27:case 5:return Po(l.child.stateNode);default:return l.child.stateNode}},ft.injectIntoDevTools=function(){var l={bundleType:0,version:Zh,rendererPackageName:hu,currentDispatcherRef:Ke,reconcilerVersion:"19.2.0"};if(Go!==null&&(l.rendererConfig=Go),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")l=!1;else{var c=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(c.isDisabled||!c.supportsFiber)l=!0;else{try{Vl=c.inject(l),ms=c}catch{}l=!!c.checkDCE}}return l},ft.isAlreadyRendering=function(){return(bt&6)!==0},ft.observeVisibleRects=function(l,c,g,x){if(!ca)throw Error(i(363));l=us(l,c);var C=Jd(l,g,x).disconnect;return{disconnect:function(){C()}}},ft.shouldError=function(){return null},ft.shouldSuspend=function(){return!1},ft.startHostTransition=function(l,c,g,x){if(l.tag!==5)throw Error(i(476));var C=rg(l).queue;sg(l,C,c,Hl,g===null?s:function(){var E=rg(l);return E.next===null&&(E=l.alternate.memoizedState),Jc(l,E.next.queue,{},bn()),g(x)})},ft.updateContainer=function(l,c,g,x){var C=c.current,E=bn();return Xh(C,E,l,c,g,x),E},ft.updateContainerSync=function(l,c,g,x){return Xh(c.current,2,l,c,g,x),2},ft},t.exports.default=t.exports,Object.defineProperty(t.exports,"__esModule",{value:!0})})(Dx)),Dx.exports}var K5;function zk(){return K5||(K5=1,Ax.exports=Dk()),Ax.exports}var kk=zk();const Lk=k1(kk);var zx={exports:{}},to={};/**
|
|
589
|
-
* @license React
|
|
590
|
-
* react-reconciler-constants.production.js
|
|
591
|
-
*
|
|
592
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
593
|
-
*
|
|
594
|
-
* This source code is licensed under the MIT license found in the
|
|
595
|
-
* LICENSE file in the root directory of this source tree.
|
|
596
|
-
*/var X5;function Uk(){return X5||(X5=1,to.ConcurrentRoot=1,to.ContinuousEventPriority=8,to.DefaultEventPriority=32,to.DiscreteEventPriority=2,to.IdleEventPriority=268435456,to.LegacyRoot=0,to.NoEventPriority=0),to}var F5;function qk(){return F5||(F5=1,zx.exports=Uk()),zx.exports}var cy=qk();const Z5={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let I5=!1,J5=!1;const z1=".react-konva-event",Hk=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.
|
|
597
|
-
Position of a node will be changed during drag&drop, so you should update state of the react app as well.
|
|
598
|
-
Consider to add onDragMove or onDragEnd events.
|
|
599
|
-
For more info see: https://github.com/konvajs/react-konva/issues/256
|
|
600
|
-
`,Bk=`ReactKonva: You are using "zIndex" attribute for a Konva node.
|
|
601
|
-
react-konva may get confused with ordering. Just define correct order of elements in your render function of a component.
|
|
602
|
-
For more info see: https://github.com/konvajs/react-konva/issues/194
|
|
603
|
-
`,Gk={};function uy(t,e,n=Gk){if(!I5&&"zIndex"in e&&(console.warn(Bk),I5=!0),!J5&&e.draggable){var s=e.x!==void 0||e.y!==void 0,i=e.onDragEnd||e.onDragMove;s&&!i&&(console.warn(Hk),J5=!0)}for(var o in n)if(!Z5[o]){var d=o.slice(0,2)==="on",f=n[o]!==e[o];if(d&&f){var p=o.substr(2).toLowerCase();p.substr(0,7)==="content"&&(p="content"+p.substr(7,1).toUpperCase()+p.substr(8)),t.off(p,n[o])}var y=!e.hasOwnProperty(o);y&&t.setAttr(o,void 0)}var S=e._useStrictMode,b={},_=!1;const j={};for(var o in e)if(!Z5[o]){var d=o.slice(0,2)==="on",w=n[o]!==e[o];if(d&&w){var p=o.substr(2).toLowerCase();p.substr(0,7)==="content"&&(p="content"+p.substr(7,1).toUpperCase()+p.substr(8)),e[o]&&(j[p]=e[o])}!d&&(e[o]!==n[o]||S&&e[o]!==t.getAttr(o))&&(_=!0,b[o]=e[o])}_&&(t.setAttrs(b),Gc(t));for(var p in j)t.off(p+z1),t.on(p+z1,j[p])}function Gc(t){if(!ke.autoDrawEnabled){var e=t.getLayer()||t.getStage();e&&e.batchDraw()}}var kx=Vb();const J8={},Pk={};sh.Node.prototype._applyProps=uy;let W8=cy.DefaultEventPriority;function Yk(t,e){if(typeof e=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${e}`);return}t.add(e),Gc(t)}function Vk(t,e,n){let s=sh[t];s||(console.error(`Konva has no node with the type ${t}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${t}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),s=sh.Group);const i={},o={};for(var d in e)if(d!=="ref"){var f=d.slice(0,2)==="on";f?o[d]=e[d]:i[d]=e[d]}const p=new s(i);return uy(p,o),p}function Qk(t,e,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${t}"`)}function Kk(t,e,n){return!1}function Xk(t){return t}function Fk(){return null}function Zk(){return null}function Ik(t,e,n,s){return Pk}function Jk(){}function Wk(t){}function $k(t,e){return!1}function eL(){return J8}function tL(){return J8}const nL=setTimeout,aL=clearTimeout,sL=!0,rL=t=>{t()},iL=-1;function lL(t,e){return!1}const oL=!1,cL=!1,uL=!0,dL=!1,fL=!1;function hL(t,e){e.parent===t?e.moveToTop():t.add(e),Gc(t)}function pL(t,e){e.parent===t?e.moveToTop():t.add(e),Gc(t)}function $8(t,e,n){e._remove(),t.add(e),e.setZIndex(n.getZIndex()),Gc(t)}function mL(t,e,n){$8(t,e,n)}function gL(t,e){e.destroy(),e.off(z1),Gc(t)}function yL(t,e){e.destroy(),e.off(z1),Gc(t)}function xL(t,e,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function bL(t,e,n){}function vL(t,e,n,s){uy(t,s,n)}function SL(t){t.hide(),Gc(t)}function NL(t){}function _L(t,e){(e.visible==null||e.visible)&&t.show()}function CL(t,e){}function jL(t){}function wL(){}function EL(){return null}function TL(){}function RL(){}function OL(){return cy.DefaultEventPriority}function ML(){}function AL(){return null}function DL(t){W8=t}function zL(){return W8}function kL(){return cy.DiscreteEventPriority}function LL(){return!1}function UL(){}function qL(){return null}function HL(){return-1.1}function BL(){}function GL(){return!1}function PL(){return!0}function YL(){}function VL(){}function QL(){return null}const KL=null,XL=$t.createContext(null);function FL(){}const ZL=Object.freeze(Object.defineProperty({__proto__:null,HostTransitionContext:XL,NotPendingTransition:KL,afterActiveInstanceBlur:RL,appendChild:hL,appendChildToContainer:pL,appendInitialChild:Yk,beforeActiveInstanceBlur:TL,cancelTimeout:aL,clearContainer:jL,commitMount:bL,commitTextUpdate:xL,commitUpdate:vL,createInstance:Vk,createTextInstance:Qk,detachDeletedInstance:wL,finalizeInitialChildren:Kk,getChildHostContext:tL,getCurrentEventPriority:OL,getCurrentUpdatePriority:zL,getInstanceFromNode:EL,getInstanceFromScope:AL,getPublicInstance:Xk,getRootHostContext:eL,hideInstance:SL,hideTextInstance:NL,idlePriority:kx.unstable_IdlePriority,insertBefore:$8,insertInContainerBefore:mL,isPrimaryRenderer:oL,maySuspendCommit:GL,noTimeout:iL,now:kx.unstable_now,preloadInstance:PL,prepareForCommit:Fk,preparePortalMount:Zk,prepareScopeUpdate:ML,prepareUpdate:Ik,removeChild:gL,removeChildFromContainer:yL,requestPostPaintCallback:BL,resetAfterCommit:Jk,resetFormInstance:FL,resetTextContent:Wk,resolveEventTimeStamp:HL,resolveEventType:qL,resolveUpdatePriority:kL,run:kx.unstable_runWithPriority,scheduleMicrotask:rL,scheduleTimeout:nL,setCurrentUpdatePriority:DL,shouldAttemptEagerTransition:LL,shouldDeprioritizeSubtree:$k,shouldSetTextContent:lL,startSuspendingCommit:YL,supportsHydration:fL,supportsMicrotasks:sL,supportsMutation:uL,supportsPersistence:dL,suspendInstance:VL,trackSchedulerEvent:UL,unhideInstance:_L,unhideTextInstance:CL,waitForCommitToBeReady:QL,warnsIfNotActing:cL},Symbol.toStringTag,{value:"Module"}));function e7(t,e,n){if(!t)return;if(n(t)===!0)return t;let s=t.child;for(;s;){const i=e7(s,e,n);if(i)return i;s=s.sibling}}function t7(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const Lv=t7(D.createContext(null));class n7 extends D.Component{render(){return D.createElement(Lv.Provider,{value:this._reactInternals},this.props.children)}}function IL(){const t=D.useContext(Lv);if(t===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=D.useId();return D.useMemo(()=>{for(const n of[t,t==null?void 0:t.alternate]){if(!n)continue;const s=e7(n,!1,i=>{let o=i.memoizedState;for(;o;){if(o.memoizedState===e)return!0;o=o.next}});if(s)return s}},[t,e])}const JL=Symbol.for("react.context"),WL=t=>t!==null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===JL;function $L(){const t=IL(),[e]=D.useState(()=>new Map);e.clear();let n=t;for(;n;){const s=n.type;WL(s)&&s!==Lv&&!e.has(s)&&e.set(s,D.use(t7(s))),n=n.return}return e}function eU(){const t=$L();return D.useMemo(()=>Array.from(t.keys()).reduce((e,n)=>s=>D.createElement(e,null,D.createElement(n.Provider,{...s,value:t.get(n)})),e=>D.createElement(n7,{...e})),[t])}if($t.version.indexOf("19")===-1)throw new Error("react-konva version 19 is only compatible with React 19. Make sure to have the last version of react-konva and react or downgrade react-konva to version 18.");function tU(t){const e=$t.useRef({});return $t.useLayoutEffect(()=>{e.current=t}),$t.useLayoutEffect(()=>()=>{e.current={}},[]),e.current}const nU=()=>{const t=$t.useRef(0);return $t.useMemo(()=>{t.current++},[]),t.current>1},aU=t=>{const e=$t.useRef(null),n=$t.useRef(null),s=$t.useRef(null),i=tU(t),o=eU(),d=$t.useRef(null),f=S=>{const{forwardedRef:b}=t;b&&(typeof b=="function"?b(S):b.current=S)},p=nU(),y=()=>{var S;f(null),Rf.flushSyncFromReconciler(()=>{Rf.updateContainer(null,s.current,null)}),(S=n.current)==null||S.destroy(),n.current=null};return $t.useLayoutEffect(()=>(d.current&&(clearTimeout(d.current),d.current=null),n.current?f(n.current):(n.current=new sh.Stage({width:t.width,height:t.height,container:e.current}),f(n.current),s.current=Rf.createContainer(n.current,cy.ConcurrentRoot,null,!1,null,"",console.error,console.error,console.error,null),Rf.updateContainer($t.createElement(o,{},t.children),s.current,null,()=>{})),()=>{p?d.current=setTimeout(y,0):y()}),[]),$t.useLayoutEffect(()=>{f(n.current),uy(n.current,t,i),Rf.flushSyncFromReconciler(()=>{Rf.updateContainer($t.createElement(o,{},t.children),s.current,null)})}),$t.createElement("div",{ref:e,id:t.id,accessKey:t.accessKey,className:t.className,role:t.role,style:t.style,tabIndex:t.tabIndex,title:t.title})},Lx="Layer",W5="Group",$5="Circle",ku="Line",sU="Text",rU="Arrow",Rf=Lk(ZL),iU=$t.forwardRef((t,e)=>$t.createElement(n7,{},$t.createElement(aU,{...t,forwardedRef:e})));function om(t,e,n){return{x:t.x*e,y:t.y*n}}function e4(t,e,n){return{x:t.x/e,y:t.y/n}}function t4(t,e,n){return t.flatMap(s=>[s.x*e,s.y*n])}function lU(t,e){return e?"#6366f1":t.color}const n4=16,a4=9;function oU({zones:t,selectedZoneId:e,onSelectZone:n,onZonePointsChange:s,onZoneComplete:i,drawingType:o}){const d=D.useRef(null),[f,p]=D.useState({w:800,h:450}),[y,S]=D.useState([]),[b,_]=D.useState(null);D.useEffect(()=>{const M=d.current;if(!M)return;const z=new ResizeObserver(k=>{const G=k[0];if(G){const{width:P}=G.contentRect;p({w:P,h:P*9/16})}});return z.observe(M),()=>z.disconnect()},[]);const j=o!==null,w=D.useCallback(M=>{if(!j){n(null);return}const z=M.target.getStage();if(!z)return;const k=z.getPointerPosition();if(!k)return;const G=e4(k,f.w,f.h),P=o==="tripwire";if(y.length===0){S([G]);return}if(P&&y.length===1){const L=[...y,G],U={id:crypto.randomUUID(),name:"Tripwire",type:"tripwire",color:"#f59e0b",points:L};i(U),S([]);return}if(y.length>=3&&!P){const L=om(y[0],f.w,f.h);if(Math.hypot(k.x-L.x,k.y-L.y)<12){const V={id:crypto.randomUUID(),name:o==="package-watch"?"Package Watch":"Zone",type:o,color:o==="package-watch"?"#10b981":"#3b82f6",points:y};i(V),S([]);return}}S(L=>[...L,G])},[j,y,f,o,i,n]),T=D.useCallback(M=>{if(!j||o==="tripwire"||y.length<3)return;M.cancelBubble=!0;const z={id:crypto.randomUUID(),name:o==="package-watch"?"Package Watch":"Zone",type:o,color:o==="package-watch"?"#10b981":"#3b82f6",points:y};i(z),S([])},[j,o,y,i]),O=D.useCallback(M=>{const z=M.target.getStage();if(!z)return;const k=z.getPointerPosition();_(k??null)},[]),R=[];for(let M=1;M<n4;M++){const z=f.w/n4*M;R.push(h.jsx(ku,{points:[z,0,z,f.h],stroke:"#ffffff",strokeWidth:.5,opacity:.08},`gv-${M}`))}for(let M=1;M<a4;M++){const z=f.h/a4*M;R.push(h.jsx(ku,{points:[0,z,f.w,z],stroke:"#ffffff",strokeWidth:.5,opacity:.08},`gh-${M}`))}return h.jsxs("div",{ref:d,className:"w-full bg-zinc-900 rounded-lg overflow-hidden",style:{cursor:j?"crosshair":"default"},children:[h.jsxs(iU,{width:f.w,height:f.h,onClick:w,onDblClick:T,onMouseMove:O,children:[h.jsxs(Lx,{children:[h.jsx(ku,{points:[0,0,f.w,0,f.w,f.h,0,f.h,0,0],stroke:"transparent",strokeWidth:0}),R]}),h.jsx(Lx,{children:t.map(M=>{const z=M.id===e,k=lU(M,z),G=t4(M.points,f.w,f.h),P=M.type==="tripwire";return h.jsxs(W5,{onClick:L=>{L.cancelBubble=!0,j||n(M.id)},children:[P?h.jsx(rU,{points:G,stroke:k,strokeWidth:z?3:2,fill:k,pointerLength:10,pointerWidth:8,opacity:z?1:.8}):h.jsx(ku,{points:G,closed:!0,fill:k+"33",stroke:k,strokeWidth:z?2.5:1.5,opacity:z?1:.85}),M.points.length>0&&h.jsx(sU,{x:om(M.points[0],f.w,f.h).x+4,y:om(M.points[0],f.w,f.h).y+4,text:M.name,fontSize:11,fill:k,fontStyle:"bold"}),z&&M.points.map((L,U)=>{const V=om(L,f.w,f.h);return h.jsx($5,{x:V.x,y:V.y,radius:5,fill:k,stroke:"#ffffff",strokeWidth:1.5,draggable:!0,onDragMove:Z=>{const re=e4({x:Z.target.x(),y:Z.target.y()},f.w,f.h),ne=M.points.map((W,ie)=>ie===U?re:W);s(M.id,ne)}},U)})]},M.id)})}),h.jsx(Lx,{children:j&&y.length>0&&h.jsxs(W5,{children:[y.length>=2&&o!=="tripwire"&&h.jsx(ku,{points:t4(y,f.w,f.h),stroke:"#6366f1",strokeWidth:1.5,dash:[6,3],opacity:.8}),y.length===1&&o==="tripwire"&&b&&h.jsx(ku,{points:[y[0].x*f.w,y[0].y*f.h,b.x,b.y],stroke:"#f59e0b",strokeWidth:1.5,dash:[6,3],opacity:.7}),b&&y.length>=1&&o!=="tripwire"&&h.jsx(ku,{points:[y[y.length-1].x*f.w,y[y.length-1].y*f.h,b.x,b.y],stroke:"#6366f1",strokeWidth:1,dash:[4,4],opacity:.5}),y.map((M,z)=>{const k=om(M,f.w,f.h),G=z===0;return h.jsx($5,{x:k.x,y:k.y,radius:G&&y.length>=3?7:4,fill:G&&y.length>=3?"#6366f1":"#ffffff",stroke:"#6366f1",strokeWidth:1.5,opacity:.9},z)})]})})]}),j&&h.jsx("div",{className:"px-3 py-1.5 bg-zinc-800/80 text-[11px] text-zinc-400 border-t border-zinc-700",children:o==="tripwire"?"Click to set start point, click again to complete the tripwire":y.length<3?"Click to add points (min 3). Double-click or click first point to close.":"Continue adding points. Double-click or click first point to close."})]})}const cU={intrusion:"Intrusion","package-watch":"Package",tripwire:"Tripwire"},uU={intrusion:"bg-danger/10 text-danger","package-watch":"bg-success/10 text-success",tripwire:"bg-warning/10 text-warning"};function dU({zones:t,selectedZoneId:e,drawingType:n,onSelectZone:s,onDeleteZone:i,onStartDraw:o,onCancelDraw:d}){return h.jsxs("div",{className:"flex flex-col gap-3",children:[h.jsx("div",{className:"flex flex-col gap-1.5",children:n?h.jsxs("button",{type:"button",onClick:d,className:"w-full flex items-center justify-center gap-1.5 rounded-md border border-warning/40 bg-warning/10 px-3 py-1.5 text-xs font-medium text-warning hover:bg-warning/20 transition-colors",children:[h.jsx(FT,{className:"h-3 w-3"}),"Cancel drawing"]}):h.jsxs(h.Fragment,{children:[h.jsxs("button",{type:"button",onClick:()=>o("intrusion"),className:"w-full flex items-center justify-center gap-1.5 rounded-md border border-border bg-surface px-3 py-1.5 text-xs font-medium text-foreground hover:bg-surface-hover transition-colors",children:[h.jsx(po,{className:"h-3 w-3"}),"Add Zone"]}),h.jsxs("button",{type:"button",onClick:()=>o("tripwire"),className:"w-full flex items-center justify-center gap-1.5 rounded-md border border-border bg-surface px-3 py-1.5 text-xs font-medium text-foreground hover:bg-surface-hover transition-colors",children:[h.jsx(po,{className:"h-3 w-3"}),"Add Tripwire"]})]})}),t.length===0?h.jsx("p",{className:"text-center text-[11px] text-foreground-subtle py-4",children:'No zones yet. Click "Add Zone" or "Add Tripwire" to start.'}):h.jsx("div",{className:"flex flex-col gap-1",children:t.map(f=>{const p=f.id===e;return h.jsxs("div",{className:["flex items-center gap-2 rounded-md border px-2 py-1.5 cursor-pointer transition-colors",p?"border-primary/50 bg-primary/10":"border-border bg-surface hover:bg-surface-hover"].join(" "),onClick:()=>s(p?null:f.id),children:[h.jsx("div",{className:"h-3 w-3 rounded-sm flex-shrink-0",style:{backgroundColor:f.color}}),h.jsx("span",{className:"flex-1 truncate text-xs font-medium text-foreground",children:f.name}),h.jsx("span",{className:`inline-flex items-center rounded-full px-1.5 py-0.5 text-[9px] font-medium flex-shrink-0 ${uU[f.type]}`,children:cU[f.type]}),h.jsxs("div",{className:"flex items-center gap-0.5 flex-shrink-0",children:[h.jsx("button",{type:"button",title:"Select",className:"p-0.5 text-foreground-subtle hover:text-primary rounded transition-colors",onClick:y=>{y.stopPropagation(),s(f.id)},children:h.jsx(eR,{className:"h-3 w-3"})}),h.jsx("button",{type:"button",title:"Delete",className:"p-0.5 text-foreground-subtle hover:text-danger rounded transition-colors",onClick:y=>{y.stopPropagation(),i(f.id)},children:h.jsx(dh,{className:"h-3 w-3"})})]})]},f.id)})})]})}const fU=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#06b6d4","#f97316","#ec4899"],hU=[{value:"intrusion",label:"Intrusion"},{value:"package-watch",label:"Package Watch"},{value:"tripwire",label:"Tripwire"}],Ux="w-full rounded-md border border-border bg-background px-3 py-1.5 text-sm text-foreground focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none";function pU({zone:t,onChange:e,onDelete:n}){return h.jsxs("div",{className:"flex flex-col gap-3",children:[h.jsx("h3",{className:"text-xs font-semibold text-foreground-subtle uppercase tracking-wider",children:"Edit Zone"}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-foreground mb-1",children:"Name"}),h.jsx("input",{type:"text",className:Ux,value:t.name,onChange:s=>e({...t,name:s.target.value}),placeholder:"Zone name"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-foreground mb-1",children:"Type"}),h.jsx("select",{className:Ux,value:t.type,onChange:s=>e({...t,type:s.target.value}),children:hU.map(s=>h.jsx("option",{value:s.value,children:s.label},s.value))})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-foreground mb-1.5",children:"Color"}),h.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:fU.map(s=>h.jsx("button",{type:"button",title:s,className:["h-5 w-5 rounded-md border-2 transition-transform hover:scale-110",t.color===s?"border-white scale-110":"border-transparent"].join(" "),style:{backgroundColor:s},onClick:()=>e({...t,color:s})},s))}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("input",{type:"color",className:"h-7 w-7 rounded border border-border bg-background cursor-pointer p-0.5",value:t.color,onChange:s=>e({...t,color:s.target.value})}),h.jsx("input",{type:"text",className:Ux+" font-mono flex-1",value:t.color,placeholder:"#000000",onChange:s=>e({...t,color:s.target.value})})]})]}),h.jsxs("p",{className:"text-[10px] text-foreground-subtle",children:[t.type==="tripwire"?"Tripwire: 2 points":`Polygon: ${t.points.length} points`,t.points.length>0&&" — drag handles on canvas to reshape"]}),h.jsxs("button",{type:"button",onClick:n,className:"mt-1 flex items-center justify-center gap-1.5 w-full rounded-md border border-danger/40 bg-danger/10 px-3 py-1.5 text-xs font-medium text-danger hover:bg-danger/20 transition-colors",children:[h.jsx(dh,{className:"h-3 w-3"}),"Delete zone"]})]})}function mU(){const[t,e]=D.useState([]),[n,s]=D.useState(null),[i,o]=D.useState(null),d=t.find(_=>_.id===n)??null,f=_=>{e(j=>[...j,_]),s(_.id),o(null)},p=(_,j)=>{e(w=>w.map(T=>T.id===_?{...T,points:j}:T))},y=_=>{e(j=>j.map(w=>w.id===_.id?_:w))},S=_=>{e(j=>j.filter(w=>w.id!==_)),n===_&&s(null)},b=_=>{s(null),o(_)};return h.jsx("div",{className:"space-y-4",children:h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsxs("div",{className:"border-b border-border px-4 py-2.5 flex items-center justify-between",children:[h.jsxs("div",{children:[h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:"Zone Editor"}),h.jsx("p",{className:"text-[11px] text-foreground-subtle mt-0.5",children:"Define detection zones and tripwire lines"})]}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle",children:[t.length," zone",t.length!==1?"s":""]})]}),h.jsxs("div",{className:"flex flex-col lg:flex-row",children:[h.jsx("div",{className:"flex-1 p-4",children:h.jsx(oU,{zones:t,selectedZoneId:n,onSelectZone:s,onZonePointsChange:p,onZoneComplete:f,drawingType:i})}),h.jsxs("div",{className:"w-full lg:w-64 border-t lg:border-t-0 lg:border-l border-border p-4 flex flex-col gap-4",children:[h.jsx(dU,{zones:t,selectedZoneId:n,drawingType:i,onSelectZone:s,onDeleteZone:S,onStartDraw:b,onCancelDraw:()=>o(null)}),d&&!i&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"border-t border-border"}),h.jsx(pU,{zone:d,onChange:y,onDelete:()=>S(d.id)})]})]})]})]})})}function gU(t){return{id:t.id,name:t.packageName??t.id,type:t.slot??"addon",enabled:!0}}function yU({deviceId:t}){const e=en(),{data:n,isLoading:s}=dt({queryKey:["bridge-addons"],queryFn:()=>e.bridgeListAddons()}),o=(n??[]).map(gU),d=o.filter(p=>p.type==="vision"||p.type==="detection"||p.type==="inference");if(s)return h.jsx("div",{className:"space-y-2",children:[1,2,3].map(p=>h.jsx("div",{className:"h-16 rounded-lg border border-border bg-surface animate-pulse"},p))});if(!d.length&&!o.length)return h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsx("div",{className:"border-b border-border px-4 py-2.5",children:h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:"Vision Addons"})}),h.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-foreground-subtle",children:[h.jsx(zm,{className:"h-8 w-8 mb-3 opacity-30"}),h.jsx("p",{className:"text-sm",children:"No vision addons installed"}),h.jsx("p",{className:"text-xs mt-1 opacity-70",children:"Install addons to enable detection and inference"})]})]});const f=d.length>0?d:o;return h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:"Vision Addons"}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle",children:[f.length," addon",f.length!==1?"s":""]})]}),h.jsx("div",{className:"space-y-2",children:f.map(p=>h.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border bg-surface px-4 py-3",children:[h.jsx("div",{className:"flex items-center justify-center rounded-lg h-8 w-8 bg-primary/10 flex-shrink-0",children:h.jsx(zm,{className:"h-4 w-4 text-primary"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("p",{className:"text-xs font-medium text-foreground truncate",children:p.name||p.id}),h.jsxs("p",{className:"text-[10px] text-foreground-subtle",children:[p.type," ",p.version?`v${p.version}`:""]})]}),h.jsx("div",{className:`h-2 w-2 rounded-full flex-shrink-0 ${p.enabled!==!1?"bg-success":"bg-foreground-subtle/30"}`}),h.jsx("button",{className:"p-1.5 rounded-md text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",title:"Settings",children:h.jsx(Wm,{className:"h-3.5 w-3.5"})})]},p.id))})]})}function xU({deviceId:t}){const e=en(),[n,s]=D.useState(null),{data:i}=dt({queryKey:["device",t],queryFn:()=>e.getDevice(t),enabled:!!t}),o=e.serverUrl??window.location.origin,d=[{id:"webrtc",label:"WebRTC",resolution:"Native",codec:"H.264",url:`${o}/webrtc/${t}`},{id:"hls",label:"HLS",resolution:"Native",codec:"H.264",url:`${o}/hls/${t}/index.m3u8`},{id:"mjpeg",label:"MJPEG",resolution:"Scaled",codec:"MJPEG",url:`${o}/mjpeg/${t}`}];async function f(p){try{await navigator.clipboard.writeText(p),s(p),setTimeout(()=>s(null),2e3)}catch{}}return h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsxs("div",{className:"border-b border-border px-4 py-2.5 flex items-center justify-between",children:[h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:"Available Streams"}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle",children:[d.length," streams"]})]}),h.jsx("div",{className:"divide-y divide-border",children:d.map(p=>h.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[h.jsx("div",{className:"flex items-center justify-center rounded-lg h-8 w-8 bg-info/10 flex-shrink-0",children:h.jsx(pv,{className:"h-4 w-4 text-info"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("p",{className:"text-xs font-medium text-foreground",children:p.label}),h.jsx("span",{className:"text-[9px] bg-surface-hover rounded px-1.5 py-0.5 text-foreground-subtle",children:p.resolution}),h.jsx("span",{className:"text-[9px] bg-surface-hover rounded px-1.5 py-0.5 text-foreground-subtle",children:p.codec})]}),h.jsx("p",{className:"text-[10px] font-mono text-foreground-subtle mt-0.5 truncate",children:p.url})]}),h.jsx("button",{onClick:()=>f(p.url),className:"p-1.5 rounded-md text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors flex-shrink-0",title:"Copy URL",children:n===p.url?h.jsx(Im,{className:"h-3.5 w-3.5 text-success"}):h.jsx(cT,{className:"h-3.5 w-3.5"})})]},p.id))})]}),h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsx("div",{className:"border-b border-border px-4 py-2.5",children:h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:"Restreamer"})}),h.jsxs("div",{className:"px-4 py-8 flex flex-col items-center text-center text-foreground-subtle",children:[h.jsx("p",{className:"text-sm",children:"Restreamer URLs"}),h.jsx("p",{className:"text-xs mt-1 opacity-70",children:"Restreamer endpoints will be displayed here when a restreamer is configured"})]})]})]})}function bU(){return h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsxs("div",{className:"border-b border-border px-4 py-2.5 flex items-center justify-between",children:[h.jsxs("div",{children:[h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:"Device Logs"}),h.jsx("p",{className:"text-[11px] text-foreground-subtle mt-0.5",children:"Scoped log stream for this device"})]}),h.jsx("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-info/10 px-2.5 py-0.5 text-[10px] font-medium text-info",children:"Coming with backend integration"})]}),h.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-foreground-subtle",children:[h.jsx(Jm,{className:"h-8 w-8 mb-3 opacity-30"}),h.jsx("p",{className:"text-sm font-medium text-foreground",children:"Device logs"}),h.jsx("p",{className:"text-xs mt-1 opacity-70",children:"Device logs — coming with backend integration"})]})]})}let s4=0;function vU({deviceId:t}){const e=en(),[n,s]=D.useState(""),[i,o]=D.useState([]),d=D.useRef(null),f=jn({mutationFn:b=>e.replEval(b,{type:"device",deviceId:t}),onSuccess:(b,_)=>{const j=typeof b=="string"?b:JSON.stringify(b,null,2);o(w=>[...w,{id:++s4,code:_,result:j,error:!1,ts:new Date().toLocaleTimeString("en-GB",{hour12:!1})}]),s("")},onError:(b,_)=>{const j=b instanceof Error?b.message:String(b);o(w=>[...w,{id:++s4,code:_,result:j,error:!0,ts:new Date().toLocaleTimeString("en-GB",{hour12:!1})}])}});function p(){const b=n.trim();b&&f.mutate(b)}function y(b){(b.metaKey||b.ctrlKey)&&b.key==="Enter"&&(b.preventDefault(),p())}function S(b){var _;s(b),(_=d.current)==null||_.focus()}return h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("p",{className:"text-xs text-foreground-subtle",children:["Scoped to device: ",h.jsx("span",{className:"font-mono text-foreground",children:t})]}),i.length>0&&h.jsxs("button",{onClick:()=>o([]),className:"inline-flex items-center gap-1 text-[10px] text-foreground-subtle hover:text-foreground",children:[h.jsx(dh,{className:"h-3 w-3"}),"Clear history"]})]}),h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3 py-1.5",children:[h.jsx("span",{className:"text-[10px] text-foreground-subtle font-mono",children:"JavaScript — Ctrl+Enter to run"}),h.jsxs("button",{onClick:p,disabled:f.isPending||!n.trim(),className:"inline-flex items-center gap-1.5 rounded px-2.5 py-1 text-[10px] font-medium bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50",children:[h.jsx(F1,{className:"h-3 w-3"}),f.isPending?"Running...":"Execute"]})]}),h.jsx("textarea",{ref:d,value:n,onChange:b=>s(b.target.value),onKeyDown:y,rows:5,placeholder:"// Enter JavaScript code scoped to this device...",className:"w-full resize-y bg-background p-3 font-mono text-xs text-foreground placeholder:text-foreground-subtle focus:outline-none",spellCheck:!1})]}),i.length===0&&h.jsx("div",{className:"text-xs text-foreground-subtle",children:"No evaluations yet"}),i.length>0&&h.jsx("div",{className:"space-y-3",children:[...i].reverse().map(b=>h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsxs("div",{className:"flex items-start justify-between gap-2 border-b border-border bg-background px-3 py-2",children:[h.jsx("pre",{className:"font-mono text-xs text-foreground whitespace-pre-wrap break-all flex-1",children:b.code}),h.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[h.jsx("span",{className:"text-[10px] text-foreground-subtle",children:b.ts}),h.jsx("button",{onClick:()=>S(b.code),title:"Reuse",className:"text-foreground-subtle hover:text-foreground",children:h.jsx(_1,{className:"h-3.5 w-3.5"})})]})]}),h.jsx("pre",{className:`px-3 py-2 font-mono text-xs whitespace-pre-wrap break-all ${b.error?"text-danger":"text-success"}`,children:b.result})]},b.id))})]})}const SU=[{id:"events",label:"Events"},{id:"pipeline",label:"Pipeline"},{id:"recording",label:"Recording"},{id:"zones",label:"Zones"},{id:"addons",label:"Addons"},{id:"streams",label:"Streams"},{id:"logs",label:"Logs"},{id:"repl",label:"REPL"}];function NU(){const{deviceId:t}=tv(),e=en(),[n,s]=D.useState("events"),{data:i,isLoading:o}=dt({queryKey:["device",t],queryFn:()=>e.getDevice(t),enabled:!!t,refetchInterval:5e3}),d=i??{},f=String(d.name??t??"Device"),p=String(d.status??"offline"),y=String(d.providerId??d.provider??"rtsp"),S=String(d.phase??"—"),b=d.priority!=null?String(d.priority):null;function _(){if(!t)return null;switch(n){case"events":return h.jsx(lD,{deviceId:t});case"pipeline":return h.jsx(oD,{deviceId:t});case"recording":return h.jsx(cD,{});case"zones":return h.jsx(mU,{});case"addons":return h.jsx(yU,{deviceId:t});case"streams":return h.jsx(xU,{deviceId:t});case"logs":return h.jsx(bU,{});case"repl":return h.jsx(vU,{deviceId:t});default:return null}}return o?h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"border-b border-border bg-surface px-6 py-4",children:[h.jsx("div",{className:"h-4 w-48 rounded bg-surface-hover animate-pulse mb-3"}),h.jsx("div",{className:"h-8 w-64 rounded bg-surface-hover animate-pulse"})]}),h.jsx("div",{className:"flex-1 p-6",children:h.jsx("div",{className:"h-40 rounded-lg border border-border bg-surface animate-pulse"})})]}):h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"border-b border-border bg-surface px-6 py-4",children:[h.jsxs("nav",{className:"flex items-center gap-1 text-[11px] text-foreground-subtle mb-3",children:[h.jsx(iv,{to:"/cameras",className:"hover:text-foreground transition-colors",children:"Cameras"}),h.jsx(Zu,{className:"h-3 w-3"}),h.jsx("span",{className:"text-foreground-subtle",children:y8(y)}),h.jsx(Zu,{className:"h-3 w-3"}),h.jsx("span",{className:"text-foreground",children:f})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(sy,{type:y,size:"lg"}),h.jsxs("div",{className:"min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("h1",{className:"text-base font-semibold text-foreground truncate",children:f}),h.jsx(nh,{status:p})]}),h.jsxs("div",{className:"flex items-center gap-3 mt-1 text-[10px] text-foreground-subtle",children:[h.jsxs("span",{className:"inline-flex items-center gap-1",children:[h.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${p==="online"||p==="running"?"bg-success":"bg-foreground-subtle/30"}`}),p==="online"||p==="running"?"Online":"Offline"]}),h.jsxs("span",{children:["Phase: ",h.jsx("span",{className:"text-foreground",children:S})]}),b&&h.jsxs("span",{children:["Priority: ",h.jsx("span",{className:"text-foreground",children:b})]})]})]})]})]}),h.jsxs("div",{className:"flex flex-col lg:flex-row border-b border-border",children:[h.jsx("div",{className:"flex-1 p-4 lg:border-r border-border",children:h.jsx("div",{className:"w-full aspect-video lg:aspect-auto",children:h.jsx(sD,{deviceName:f,detectionsToday:0,inferenceMs:0,activeTracks:0,storageGb:0})})}),h.jsx("div",{className:"w-full lg:w-[300px] lg:flex-shrink-0 bg-surface border-t lg:border-t-0 border-border",children:h.jsx(rD,{deviceId:t??""})})]}),h.jsx("div",{className:"border-b border-border bg-surface px-6",children:h.jsx("div",{className:"flex flex-nowrap items-center gap-0 overflow-x-auto",children:SU.map(j=>{const w=n===j.id;return h.jsxs("button",{onClick:()=>s(j.id),className:`relative flex-shrink-0 px-4 py-3 text-xs font-medium transition-colors ${w?"text-primary":"text-foreground-subtle hover:text-foreground"}`,children:[j.label,w&&h.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-0.5 rounded-full bg-primary"})]},j.id)})})}),h.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:_()})]})}const a7=D.createContext(null);function _U(){const t=D.useContext(a7);if(!t)throw new Error("useConfirm must be used within ConfirmDialogProvider");return t.confirm}function CU({children:t}){const[e,n]=D.useState(null),s=D.useCallback(p=>new Promise(y=>{n({...p,resolve:y})}),[]),i=()=>{e==null||e.resolve(!0),n(null)},o=()=>{e==null||e.resolve(!1),n(null)},d={danger:{icon:"text-red-400",button:"bg-red-500 hover:bg-red-600 text-white"},warning:{icon:"text-orange-400",button:"bg-orange-500 hover:bg-orange-600 text-white"},default:{icon:"text-primary",button:"bg-primary hover:bg-primary/90 text-white"}},f=e?d[e.variant??"default"]:d.default;return h.jsxs(a7.Provider,{value:{confirm:s},children:[t,e&&h.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[h.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:o}),h.jsxs("div",{className:"relative z-10 w-full max-w-sm mx-4 rounded-xl border border-border bg-surface shadow-2xl overflow-hidden animate-in fade-in zoom-in-95 duration-150",onClick:p=>p.stopPropagation(),children:[h.jsxs("div",{className:"px-5 pt-5 pb-4",children:[h.jsx("h3",{className:"text-sm font-semibold text-foreground",children:e.title}),h.jsx("p",{className:"mt-2 text-xs text-foreground-subtle leading-relaxed",children:e.message})]}),h.jsxs("div",{className:"flex justify-end gap-2 px-5 py-3 border-t border-border bg-surface-hover/30",children:[h.jsx("button",{type:"button",onClick:o,className:"px-3 py-1.5 text-xs font-medium rounded-md border border-border text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",children:e.cancelLabel??"Cancel"}),h.jsx("button",{type:"button",onClick:i,className:`px-3 py-1.5 text-xs font-medium rounded-md transition-colors ${f.button}`,children:e.confirmLabel??"Confirm"})]})]})]})]})}function jU({packageName:t,currentVersion:e,onInstall:n,onClose:s}){const i=en(),{data:o,isLoading:d}=dt({queryKey:["addon-versions",t],queryFn:()=>i.trpc.addons.getVersions.query({name:t}),staleTime:5*6e4});return h.jsxs("div",{className:"fixed z-50 w-72 rounded-lg border border-border bg-surface shadow-xl overflow-hidden",style:{top:"auto",bottom:"auto"},ref:f=>{var b;if(!f)return;const p=(b=f.parentElement)==null?void 0:b.getBoundingClientRect();if(!p)return;const y=window.innerHeight-p.bottom,S=p.top;y<280&&S>y?(f.style.bottom=`${window.innerHeight-p.top+4}px`,f.style.top="auto"):(f.style.top=`${p.bottom+4}px`,f.style.bottom="auto"),f.style.right=`${window.innerWidth-p.right}px`},onClick:f=>f.stopPropagation(),children:[h.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[h.jsx("span",{className:"text-[10px] uppercase tracking-wide text-foreground-subtle font-medium",children:"Versions"}),h.jsx("button",{type:"button",onClick:s,className:"text-foreground-subtle hover:text-foreground",children:h.jsx(Oi,{className:"h-3 w-3"})})]}),d&&h.jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-[10px] text-foreground-subtle",children:[h.jsx(ml,{className:"h-3.5 w-3.5 animate-spin"}),"Loading versions..."]}),o&&h.jsx("div",{className:"max-h-64 overflow-auto divide-y divide-border",children:o.map(f=>{const p=f.version===e,y=/-(alpha|beta|rc|dev|canary|next)/i.test(f.version);return h.jsxs("div",{className:`flex items-center gap-2 px-3 py-2 text-[11px] ${p?"bg-primary/5":"hover:bg-surface-hover"} transition-colors`,children:[h.jsx("span",{className:`font-mono flex-1 ${p?"text-primary font-semibold":y?"text-amber-400":"text-foreground"}`,children:f.version}),f.distTags.map(S=>h.jsx("span",{className:`text-[9px] rounded-full px-1.5 py-0.5 font-medium ${S==="latest"?"bg-emerald-500/15 text-emerald-400":S==="beta"?"bg-amber-500/15 text-amber-400":"bg-gray-500/15 text-gray-400"}`,children:S},S)),f.deprecated&&h.jsx("span",{className:"text-[9px] text-red-400 line-through",children:"deprecated"}),h.jsx("span",{className:"text-[9px] text-foreground-subtle shrink-0",children:new Date(f.publishedAt).toLocaleDateString()}),p?h.jsx(Im,{className:"h-3 w-3 text-primary shrink-0"}):h.jsx("button",{type:"button",onClick:()=>n(f.version),className:"shrink-0 rounded p-0.5 hover:bg-primary/20 text-foreground-subtle hover:text-primary transition-colors",title:`Install ${f.version}`,children:h.jsx(Dm,{className:"h-3 w-3"})})]},f.version)})}),o&&o.length===0&&h.jsx("div",{className:"py-4 text-center text-[10px] text-foreground-subtle",children:"No versions found"})]})}const r4={error:{icon:hv,color:"text-red-400"},warn:{icon:Z1,color:"text-amber-400"},info:{icon:C1,color:"text-blue-400"},debug:{icon:PE,color:"text-gray-500"}},wU=["all","error","warn","info","debug"];function Uv({scope:t,level:e,limit:n=100,maxHeight:s="max-h-64",showScope:i=!1,onClose:o,className:d}){const f=en(),[p,y]=D.useState(e),[S,b]=D.useState([]),[_,j]=D.useState(!0),w=D.useRef(null),{data:T,isLoading:O}=dt({queryKey:["log-viewer",t,p,n],queryFn:()=>f.trpc.logs.query.query({...t?{scope:t}:{},...p?{level:p}:{},limit:n}),staleTime:3e4});D.useEffect(()=>{b([])},[p,t]),D.useEffect(()=>{const z=f.trpc.logs.subscribe.subscribe({...t?{scope:t}:{},...p?{level:p}:{}},{onData:k=>{b(G=>[...G,k])},onError:k=>{console.error("LogViewer subscription error:",k)}});return()=>{z.unsubscribe()}},[f,t,p]),D.useEffect(()=>{_&&w.current&&w.current.scrollTo({top:0})},[S,_]);const R=D.useMemo(()=>[...[...(T??[]).map(k=>({timestamp:typeof k.timestamp=="string"?k.timestamp:new Date(k.timestamp).toISOString(),level:k.level,message:k.message,scope:k.scope})),...S]].reverse(),[T,S]),M=D.useCallback(z=>{y(z==="all"?void 0:z)},[]);return h.jsxs("div",{className:d,onClick:z=>z.stopPropagation(),children:[h.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-surface-hover/30",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-[10px] uppercase tracking-wide text-foreground-subtle font-medium",children:"Logs"}),h.jsx("div",{className:"flex rounded border border-border overflow-hidden text-[9px]",children:wU.map(z=>h.jsx("button",{type:"button",onClick:()=>M(z),className:`px-1.5 py-0.5 capitalize transition-colors ${z==="all"&&!p||p===z?"bg-primary/10 text-primary":"text-foreground-subtle hover:bg-surface-hover"} ${z!=="all"?"border-l border-border":""}`,children:z},z))}),h.jsxs("button",{type:"button",onClick:()=>{j(z=>!z),!_&&w.current&&w.current.scrollTo({top:0,behavior:"smooth"})},className:`inline-flex items-center gap-1 text-[9px] px-1.5 py-0.5 rounded border transition-colors ${_?"border-border text-foreground-subtle hover:text-foreground":"border-amber-500/30 bg-amber-500/10 text-amber-400"}`,title:_?"Auto-scroll to newest is ON":"Auto-scroll to newest is OFF",children:[h.jsx(R6,{className:"h-2.5 w-2.5"}),_?"Auto":"Paused"]}),S.length>0&&h.jsxs("span",{className:"text-[9px] text-emerald-400 font-medium",children:["+",S.length," live"]})]}),o&&h.jsx("button",{type:"button",onClick:o,className:"text-foreground-subtle hover:text-foreground",children:h.jsx(Oi,{className:"h-3.5 w-3.5"})})]}),h.jsxs("div",{ref:w,className:`${s} overflow-auto font-mono text-[10px]`,children:[O&&h.jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-foreground-subtle",children:[h.jsx(ml,{className:"h-3.5 w-3.5 animate-spin"}),"Loading logs..."]}),!O&&R.length===0&&h.jsx("div",{className:"py-4 text-center text-foreground-subtle",children:"No logs found"}),R.length>0&&h.jsx("table",{className:"w-full",children:h.jsx("tbody",{children:R.map((z,k)=>{var L,U;const G=r4[z.level]??r4.info,P=G.icon;return h.jsxs("tr",{className:"hover:bg-surface-hover/30 border-b border-border/30",children:[h.jsx("td",{className:"px-2 py-1 text-foreground-subtle whitespace-nowrap align-top w-[140px]",children:new Date(z.timestamp).toLocaleTimeString()}),h.jsx("td",{className:`px-1 py-1 align-top w-5 ${G.color}`,children:h.jsx(P,{className:"h-3 w-3"})}),i&&h.jsx("td",{className:"px-2 py-1 text-foreground-subtle align-top truncate max-w-[150px] font-mono",title:(L=z.scope)==null?void 0:L.join(" > "),children:((U=z.scope)==null?void 0:U.join(" > "))??""}),h.jsx("td",{className:"px-2 py-1 text-foreground break-all",children:z.message})]},k)})})})]})]})}const EU={"addon.started":{icon:F1,color:"bg-emerald-500/15 text-emerald-400 border-emerald-500/30",label:"Started"},"addon.installed":{icon:Dm,color:"bg-emerald-500/15 text-emerald-400 border-emerald-500/30",label:"Installed"},"addon.restarted":{icon:eh,color:"bg-blue-500/15 text-blue-400 border-blue-500/30",label:"Restarted"},"addon.updated":{icon:yv,color:"bg-blue-500/15 text-blue-400 border-blue-500/30",label:"Updated"},"addon.stopped":{icon:gv,color:"bg-foreground-subtle/10 text-foreground-subtle border-border",label:"Stopped"},"addon.uninstalled":{icon:dh,color:"bg-foreground-subtle/10 text-foreground-subtle border-border",label:"Uninstalled"},"addon.crashed":{icon:hv,color:"bg-red-500/15 text-red-400 border-red-500/30",label:"Crashed"},"addon.error":{icon:Z1,color:"bg-red-500/15 text-red-400 border-red-500/30",label:"Error"}};function TU(t){return EU[t]??{icon:F1,color:"bg-foreground-subtle/10 text-foreground-subtle border-border",label:t.split(".").pop()??t}}function RU({source:t,category:e,limit:n=50,maxHeight:s="max-h-64",className:i}){const o=en(),[d,f]=D.useState([]),[p,y]=D.useState(!0),S=D.useRef(null),{data:b,isLoading:_}=dt({queryKey:["event-viewer",t,e,n],queryFn:()=>o.trpc.systemEvents.getRecent.query({...t?{source:t}:{},...e?{category:e}:{},limit:n}),staleTime:3e4});D.useEffect(()=>{const T=o.trpc.systemEvents.subscribe.subscribe({...t?{source:t}:{},...e?{category:e}:{}},{onData:O=>{f(R=>[...R,O])},onError:O=>{console.error("EventViewer subscription error:",O)}});return()=>{T.unsubscribe()}},[o,t,e]),D.useEffect(()=>{p&&S.current&&S.current.scrollTo({top:0})},[d,p]);const j=D.useMemo(()=>[...[...b??[],...d]].reverse(),[b,d]),w=T=>T==="addon.crashed"||T==="addon.error";return h.jsxs("div",{className:i,onClick:T=>T.stopPropagation(),children:[h.jsx("div",{className:"flex items-center justify-between px-4 py-2 bg-surface-hover/30",children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-[10px] uppercase tracking-wide text-foreground-subtle font-medium",children:"Events"}),h.jsxs("button",{type:"button",onClick:()=>{y(T=>!T),!p&&S.current&&S.current.scrollTo({top:0,behavior:"smooth"})},className:`inline-flex items-center gap-1 text-[9px] px-1.5 py-0.5 rounded border transition-colors ${p?"border-border text-foreground-subtle hover:text-foreground":"border-amber-500/30 bg-amber-500/10 text-amber-400"}`,children:[h.jsx(R6,{className:"h-2.5 w-2.5"}),p?"Auto":"Paused"]}),d.length>0&&h.jsxs("span",{className:"text-[9px] text-emerald-400 font-medium",children:["+",d.length," live"]})]})}),h.jsxs("div",{ref:S,className:`${s} overflow-auto text-[10px]`,children:[_&&h.jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-foreground-subtle",children:[h.jsx(ml,{className:"h-3.5 w-3.5 animate-spin"}),"Loading events..."]}),!_&&j.length===0&&h.jsx("div",{className:"py-4 text-center text-foreground-subtle",children:"No events found"}),j.length>0&&h.jsx("div",{className:"divide-y divide-border/30",children:j.map(T=>{const O=TU(T.category),R=O.icon,M=w(T.category)?String(T.data.error??""):"",z=T.data.fromVersion&&T.data.toVersion?`${T.data.fromVersion} → ${T.data.toVersion}`:void 0;return h.jsxs("div",{className:"flex items-start gap-2 px-4 py-1.5 hover:bg-surface-hover/30",children:[h.jsx("span",{className:"text-foreground-subtle whitespace-nowrap w-[140px] shrink-0 pt-0.5",children:new Date(T.timestamp).toLocaleTimeString()}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[9px] font-medium ${O.color}`,children:[h.jsx(R,{className:"h-2.5 w-2.5"}),O.label]}),z&&h.jsx("span",{className:"text-[9px] text-foreground-subtle font-mono",children:z})]}),M&&h.jsx("p",{className:"text-red-400 text-[10px] mt-0.5 break-all font-mono",children:M})]})]},T.id)})})]})]})}function OU({isBundle:t,installSource:e}){const n=t?"bg-indigo-500/20 text-indigo-300":"bg-purple-500/20 text-purple-300";return h.jsxs("div",{className:"relative flex-shrink-0",children:[h.jsx("div",{className:`h-9 w-9 rounded-lg flex items-center justify-center ${n}`,children:t?h.jsx(zm,{className:"h-4 w-4"}):h.jsx(w1,{className:"h-4 w-4"})}),e==="workspace"&&h.jsx("span",{className:"absolute -top-1.5 -left-1.5 text-[7px] font-bold leading-none bg-orange-500 text-white px-1 py-0.5 rounded -rotate-12 shadow-sm",children:"DEV"}),e==="npm"&&h.jsx("span",{className:"absolute -top-1 -left-1 w-4 h-4 rounded bg-[#cb3837] flex items-center justify-center -rotate-12 shadow-sm",children:h.jsx("svg",{viewBox:"0 0 780 250",className:"w-[11px] h-[11px]",children:h.jsx("path",{fill:"#fff",d:"M240 250h100V50h100v200h340V0H0v250z"})})}),e==="upload"&&h.jsx("span",{className:"absolute -top-1.5 -left-1.5 flex items-center justify-center h-4 w-4 rounded bg-cyan-500 -rotate-12 shadow-sm",children:h.jsx(yv,{className:"h-2.5 w-2.5 text-white"})})]})}function MU({addonId:t}){const e=en(),n=ga(),{data:s="inherit"}=dt({queryKey:["addon-auto-update",t],queryFn:()=>e.trpc.addons.getAddonAutoUpdate.query({addonId:t}),staleTime:3e4}),i=jn({mutationFn:o=>e.trpc.addons.setAddonAutoUpdate.mutate({addonId:t,channel:o}),onSuccess:()=>{n.invalidateQueries({queryKey:["addon-auto-update",t]})}});return h.jsx("div",{className:"flex rounded-lg border border-border overflow-hidden text-[10px] font-medium",children:["inherit","off","latest","beta"].map(o=>h.jsx("button",{type:"button",onClick:d=>{d.stopPropagation(),i.mutate(o)},disabled:i.isPending,className:`px-2.5 py-1 transition-colors capitalize ${s===o?o==="inherit"?"bg-gray-700/50 text-gray-300":o==="off"?"bg-gray-700 text-gray-200":o==="latest"?"bg-blue-500/20 text-blue-400":"bg-amber-500/20 text-amber-400":"bg-transparent text-foreground-subtle hover:bg-surface-hover"} ${o!=="inherit"?"border-l border-border":""}`,children:o},o))})}function Bb({addon:t,agents:e=[],hideVersion:n,availableUpdate:s,onUpdate:i,isUpdating:o,bundle:d}){var Ce,ze;const[f,p]=D.useState(!1),[y,S]=D.useState(!1),[b,_]=D.useState(!1),[j,w]=D.useState(!1),[T,O]=D.useState("logs"),R=en(),M=ga(),z=_U(),{manifest:k}=t,G=t.installedOn??[],P=!d&&!k.protected&&k.removable!==!1,L=!!d,U=(d==null?void 0:d.displayName)??k.name,V=(d==null?void 0:d.packageName)??k.packageName,Z=(d==null?void 0:d.version)??k.packageVersion??k.version,re=(d==null?void 0:d.installSource)??t.installSource,ne=d?(Ce=d.addons[0])==null?void 0:Ce.manifest.description:k.description,W=!d&&(t.hasConfigSchema||k.components&&k.components.length>0||e.length>=2),{data:ie,isLoading:ce}=dt({queryKey:["addon-config-schema",k.id],queryFn:()=>R.trpc.addons.getConfigSchema.query({addonId:k.id}),enabled:!L&&f&&t.hasConfigSchema,staleTime:6e4}),{data:Y}=dt({queryKey:["addon-config",k.id],queryFn:()=>R.trpc.addons.getConfig.query({addonId:k.id}),enabled:!L&&f&&t.hasConfigSchema,staleTime:3e4}),[$,ae]=D.useState({}),[Ne,me]=D.useState(!1);D.useEffect(()=>{Y&&(ae(Y),me(!1))},[Y]);const B=Ee=>{ae(Ee),me(!0)},I=jn({mutationFn:()=>R.trpc.addons.updateConfig.mutate({addonId:k.id,config:$}),onSuccess:()=>{me(!1),M.invalidateQueries({queryKey:["addon-config",k.id]})}}),fe=jn({mutationFn:()=>(console.log(`[AddonCard] Uninstalling ${k.packageName}`),R.trpc.addons.uninstallPackage.mutate({packageName:k.packageName})),onSuccess:()=>{console.log(`[AddonCard] Uninstalled ${k.packageName}`),M.invalidateQueries({queryKey:["addons"]}),M.invalidateQueries({queryKey:["addon-pages"]}),M.invalidateQueries({queryKey:["capabilities"]})},onError:Ee=>{console.error("[AddonCard] Uninstall failed:",Ee)}}),xe=jn({mutationFn:()=>R.trpc.addons.restartAddon.mutate({addonId:k.id}),onSuccess:()=>{M.invalidateQueries({queryKey:["addons"]})}}),_e=jn({mutationFn:Ee=>R.trpc.addons.installPackage.mutate({packageName:V,version:Ee}),onSuccess:()=>{M.invalidateQueries({queryKey:["addons"]}),M.invalidateQueries({queryKey:["addon-pages"]}),M.invalidateQueries({queryKey:["capabilities"]})}});return h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsxs("div",{className:"flex items-start gap-3 px-4 py-3",children:[h.jsx(OU,{isBundle:L||!!k.components&&k.components.length>1,installSource:re}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-sm font-semibold text-foreground truncate",children:U}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle font-mono shrink-0",children:["(",V,")"]}),L&&h.jsxs("span",{className:"text-[10px] rounded-full bg-primary/10 text-primary px-2 py-0.5 font-medium shrink-0 inline-flex items-center gap-1",children:[h.jsx(zm,{className:"h-3 w-3"}),d.addons.length]})]}),ne&&h.jsx("p",{className:"text-[10px] text-foreground-subtle mt-0.5 line-clamp-1",children:ne})]}),!n&&h.jsxs("div",{className:"relative inline-flex items-center shrink-0 pt-0.5",children:[re!=="workspace"?h.jsxs("button",{type:"button",onClick:Ee=>{Ee.stopPropagation(),_(we=>!we)},className:["inline-flex items-center gap-1 rounded-md px-2 py-1 text-[10px] font-bold font-mono border transition-colors",s?"border-border text-foreground-subtle hover:text-foreground hover:border-primary/30":"border-emerald-500/30 bg-emerald-500/10 text-emerald-400 hover:bg-emerald-500/20"].join(" "),title:"View all versions",children:[Z,h.jsx(Mc,{className:"h-3 w-3 opacity-50"})]}):h.jsx("span",{className:"inline-flex items-center rounded-md px-2 py-1 text-[10px] font-bold font-mono border border-emerald-500/30 bg-emerald-500/10 text-emerald-400",children:Z}),b&&h.jsx(jU,{packageName:V,currentVersion:Z,onInstall:Ee=>{_(!1),_e.mutate(Ee)},onClose:()=>_(!1)})]})]}),!L&&!n&&h.jsxs("div",{className:"flex items-center gap-1 px-4 py-1.5 border-t border-border/50 bg-surface-hover/20",children:[h.jsxs("button",{type:"button",onClick:Ee=>{Ee.stopPropagation(),xe.mutate()},disabled:xe.isPending,className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-[10px] font-medium border border-border text-foreground-subtle hover:text-blue-400 hover:border-blue-500/30 hover:bg-blue-500/10 disabled:opacity-50 transition-colors",children:[h.jsx(eh,{className:`h-3 w-3 ${xe.isPending?"animate-spin":""}`}),"Restart"]}),h.jsxs("button",{type:"button",onClick:Ee=>{Ee.stopPropagation(),w(we=>!we)},className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[10px] font-medium border transition-colors ${j?"border-primary/30 bg-primary/10 text-primary":"border-border text-foreground-subtle hover:text-foreground hover:border-primary/30 hover:bg-primary/10"}`,children:[h.jsx(Jm,{className:"h-3 w-3"}),"Logs"]}),o?h.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-[10px] font-medium border border-blue-500/30 bg-blue-500/10 text-blue-400",children:[h.jsx(ml,{className:"h-3 w-3 animate-spin"}),"Updating..."]}):s&&i?h.jsxs("button",{type:"button",onClick:Ee=>{Ee.stopPropagation(),i()},className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-[10px] font-medium border border-blue-500/30 bg-blue-500/10 text-blue-400 hover:bg-blue-500/20 transition-colors",children:[h.jsx(Dm,{className:"h-3 w-3"}),"Update to ",s]}):null,h.jsx("div",{className:"flex-1"}),P&&h.jsxs("button",{type:"button",onClick:async Ee=>{Ee.stopPropagation(),await z({title:`Uninstall ${k.name}?`,message:"This will remove the addon package and all its data. This action cannot be undone.",confirmLabel:"Uninstall",variant:"danger"})&&fe.mutate()},disabled:fe.isPending,className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-[10px] font-medium border border-border text-foreground-subtle hover:text-red-400 hover:border-red-500/30 hover:bg-red-500/10 disabled:opacity-50 transition-colors",children:[h.jsx(dh,{className:"h-3 w-3"}),fe.isPending?"Removing...":"Uninstall"]}),W&&h.jsx("button",{type:"button",onClick:Ee=>{Ee.stopPropagation(),p(we=>!we)},className:"rounded-md p-1 text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",children:f?h.jsx(_1,{className:"h-3.5 w-3.5"}):h.jsx(Mc,{className:"h-3.5 w-3.5"})})]}),j&&!L&&h.jsxs("div",{className:"border-t border-border",children:[h.jsxs("div",{className:"flex items-center px-4 py-1 bg-surface-hover/20 border-b border-border/50",children:[h.jsxs("div",{className:"flex rounded border border-border overflow-hidden text-[9px]",children:[h.jsx("button",{type:"button",onClick:()=>O("logs"),className:`px-2 py-0.5 transition-colors ${T==="logs"?"bg-primary/10 text-primary":"text-foreground-subtle hover:bg-surface-hover"}`,children:"Logs"}),h.jsx("button",{type:"button",onClick:()=>O("events"),className:`px-2 py-0.5 border-l border-border transition-colors ${T==="events"?"bg-primary/10 text-primary":"text-foreground-subtle hover:bg-surface-hover"}`,children:"Events"})]}),h.jsx("div",{className:"flex-1"}),h.jsx("button",{type:"button",onClick:Ee=>{Ee.stopPropagation(),w(!1)},className:"text-foreground-subtle hover:text-foreground",children:h.jsx(Oi,{className:"h-3.5 w-3.5"})})]}),T==="logs"&&h.jsx(Uv,{scope:[`addon:${k.id}`],maxHeight:"max-h-64"}),T==="events"&&h.jsx(RU,{source:{type:"addon",id:k.id},category:"addon.*",maxHeight:"max-h-64"})]}),L&&h.jsxs(h.Fragment,{children:[h.jsx("button",{type:"button",onClick:()=>p(Ee=>!Ee),className:"w-full flex items-center justify-center border-t border-border py-1 hover:bg-surface-hover/50 transition-colors",children:f?h.jsx(_1,{className:"h-3.5 w-3.5 text-foreground-subtle"}):h.jsx(Mc,{className:"h-3.5 w-3.5 text-foreground-subtle"})}),f&&h.jsx("div",{className:"border-t border-border px-3 py-2 space-y-2",children:d.addons.map(Ee=>h.jsx(Bb,{addon:Ee,agents:e,hideVersion:!0},Ee.manifest.id))})]}),!L&&f&&h.jsxs("div",{className:"border-t border-border px-4 py-3 space-y-4",children:[t.hasConfigSchema&&h.jsxs("div",{children:[ce&&h.jsxs("div",{className:"flex items-center gap-2 text-xs text-foreground-subtle py-2",children:[h.jsx(ml,{className:"h-3.5 w-3.5 animate-spin"}),"Loading configuration..."]}),ie&&((ze=ie.sections)==null?void 0:ze.some(Ee=>{var we;return((we=Ee.fields)==null?void 0:we.length)>0}))&&h.jsxs("div",{className:"space-y-3",children:[h.jsx(ry,{schema:ie,values:$,onChange:B}),Ne&&h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-[10px] text-orange-400",children:"Unsaved changes"}),h.jsxs("button",{type:"button",onClick:Ee=>{Ee.stopPropagation(),I.mutate()},disabled:I.isPending,className:"flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground hover:bg-primary/90 disabled:opacity-50 transition-colors",children:[I.isPending?h.jsx(ml,{className:"h-3 w-3 animate-spin"}):h.jsx(U6,{className:"h-3 w-3"}),I.isPending?"Saving...":"Save"]})]}),I.isError&&h.jsxs("div",{className:"text-[10px] text-red-400",children:["Save failed: ",I.error instanceof Error?I.error.message:"Unknown error"]})]})]}),re!=="workspace"&&h.jsxs("div",{children:[h.jsx("div",{className:"text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2",children:"Auto-Update"}),h.jsx(MU,{addonId:k.id})]}),k.components&&k.components.length>0&&h.jsxs("div",{children:[h.jsxs("div",{className:"text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2",children:["Components (",k.components.length,")"]}),h.jsx("div",{className:"flex flex-wrap gap-1",children:k.components.map(Ee=>h.jsx("span",{className:"text-[10px] rounded bg-background border border-border px-1.5 py-0.5 text-foreground-subtle font-mono",children:Ee},Ee))})]}),e.length>=2&&h.jsxs("div",{children:[h.jsx("div",{className:"text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2",children:"Installed on"}),h.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[G.length===0&&h.jsx("span",{className:"text-[10px] text-foreground-subtle",children:"Hub (local)"}),G.map(Ee=>h.jsx("span",{className:"rounded-full bg-surface-hover border border-border px-2 py-0.5 text-[10px] text-foreground-subtle",children:Ee},Ee)),h.jsxs("div",{className:"relative",children:[h.jsxs("button",{type:"button",onClick:Ee=>{Ee.stopPropagation(),S(we=>!we)},className:"inline-flex items-center gap-1 rounded-full border border-dashed border-border px-2 py-0.5 text-[10px] text-foreground-subtle hover:text-foreground hover:border-primary transition-colors",title:"Install on more agents",children:[h.jsx(po,{className:"h-3 w-3"}),"Add agent"]}),y&&h.jsxs("div",{className:"absolute left-0 top-full mt-1 z-10 min-w-[160px] rounded-md border border-border bg-surface shadow-lg overflow-hidden",children:[e.filter(Ee=>!Ee.isHub&&!G.includes(Ee.name)).map(Ee=>h.jsx("button",{type:"button",onClick:we=>{we.stopPropagation(),S(!1)},className:"w-full text-left px-3 py-1.5 text-[10px] text-foreground hover:bg-surface-hover transition-colors",children:Ee.name},Ee.id)),e.filter(Ee=>!Ee.isHub&&!G.includes(Ee.name)).length===0&&h.jsx("div",{className:"px-3 py-1.5 text-[10px] text-foreground-subtle",children:"No available agents"})]})]})]})]})]})]})}const AU=".tgz,.tar.gz,.zip";function DU({onUploadSuccess:t}){const[e,n]=D.useState(!1),s=D.useRef(null),i=D.useCallback(async d=>{n(!0);const f=new FormData;f.append("file",d);const p=localStorage.getItem("camstack_admin_token")??"";try{(await(await fetch("/api/addons/upload",{method:"POST",headers:{Authorization:`Bearer ${p}`},body:f})).json()).success&&t()}finally{n(!1)}},[t]),o=D.useCallback(d=>{var p;const f=(p=d.target.files)==null?void 0:p[0];f&&i(f),d.target.value=""},[i]);return h.jsxs(h.Fragment,{children:[h.jsx("input",{ref:s,type:"file",accept:AU,onChange:o,className:"hidden"}),h.jsxs("button",{type:"button",onClick:()=>{var d;return(d=s.current)==null?void 0:d.click()},disabled:e,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md bg-surface hover:bg-surface-hover border border-border disabled:opacity-50 transition-colors",children:[e?h.jsx(ml,{className:"w-3.5 h-3.5 animate-spin"}):h.jsx(yv,{className:"w-3.5 h-3.5"}),e?"Uploading...":"Upload"]})]})}function zU(t){return t!=null&&t.manifest?{manifest:{...t.manifest,capabilities:t.manifest.capabilities??[]},enabled:!0,hasConfigSchema:t.hasConfigSchema??!1,source:t.source,installSource:t.installSource,installedOn:[]}:null}function kU(t){const e=new Map,n=[];for(const i of t){const o=i.manifest.packageName;if(!o){n.push(i);continue}const d=e.get(o);d?d.addons.push(i):e.set(o,{packageName:o,displayName:i.manifest.packageDisplayName??i.manifest.name,version:i.manifest.packageVersion,installSource:i.installSource,addons:[i]})}const s=[];for(const i of e.values())i.addons.length>=2?s.push({bundle:i,representative:i.addons[0]}):s.push(i.addons[0]);return s.push(...n),s}function LU(t){return"bundle"in t}function UU({addons:t,agents:e,onRefresh:n,isRefreshing:s}){const i=en(),o=ga(),[d,f]=D.useState(""),p=D.useDeferredValue(d),[y,S]=D.useState(!1),{data:b}=dt({queryKey:["updates"],queryFn:()=>i.trpc.addons.listUpdates.query(),staleTime:5*6e4}),_=D.useMemo(()=>{const L=new Map;for(const U of b??[])L.set(U.name,U.latestVersion);return L},[b]),[j,w]=D.useState(null),T=jn({mutationFn:({name:L,version:U})=>(w(L),i.trpc.addons.updatePackage.mutate({name:L,version:U})),onSuccess:()=>{w(null),o.invalidateQueries({queryKey:["addons"]}),o.invalidateQueries({queryKey:["updates"]})},onError:()=>{w(null)}}),{data:O}=dt({queryKey:["auto-update-settings"],queryFn:()=>i.trpc.addons.getAutoUpdateSettings.query(),staleTime:3e4}),R=jn({mutationFn:L=>i.trpc.addons.applyAutoUpdateToAll.mutate({channel:L}),onSuccess:()=>{o.invalidateQueries({queryKey:["auto-update-settings"]})}}),{data:M,isFetching:z}=dt({queryKey:["addon-search",p],queryFn:()=>i.trpc.addons.searchAvailable.query({query:p||void 0}),enabled:y,staleTime:6e4}),k=jn({mutationFn:async()=>{const L=b??[];for(const U of L)await i.trpc.addons.updatePackage.mutate({name:U.name,version:U.latestVersion})},onSuccess:()=>{o.invalidateQueries({queryKey:["addons"]}),o.invalidateQueries({queryKey:["updates"]})}}),G=jn({mutationFn:L=>i.trpc.addons.installPackage.mutate({packageName:L}),onSuccess:(L,U)=>{o.invalidateQueries({queryKey:["addons"]}),o.invalidateQueries({queryKey:["addon-search"]}),o.invalidateQueries({queryKey:["addon-pages"]}),o.invalidateQueries({queryKey:["capabilities"]}),console.log(`[Addons] Installed ${U}`)},onError:(L,U)=>{console.error(`[Addons] Install failed for ${U}:`,L)}}),P=kU(t);return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border bg-surface px-4 py-2.5",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(eh,{className:"h-3.5 w-3.5 text-foreground-subtle"}),h.jsx("span",{className:"text-xs font-medium text-foreground",children:"Auto-Update"})]}),h.jsx("div",{className:"flex rounded-lg border border-border overflow-hidden text-[10px] font-medium",children:["off","latest","beta"].map(L=>h.jsx("button",{type:"button",onClick:()=>R.mutate(L),disabled:R.isPending,className:`px-3 py-1.5 transition-colors capitalize ${(O==null?void 0:O.channel)===L?L==="off"?"bg-gray-700 text-gray-200":L==="latest"?"bg-blue-500/20 text-blue-400":"bg-amber-500/20 text-amber-400":"bg-transparent text-foreground-subtle hover:bg-surface-hover"} ${L!=="off"?"border-l border-border":""}`,children:L},L))})]}),h.jsxs("div",{className:"flex gap-2",children:[h.jsxs("div",{className:"relative flex-1",children:[h.jsx(mv,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-foreground-subtle"}),h.jsx("input",{type:"text",value:d,onChange:L=>{f(L.target.value),S(!0)},onFocus:()=>S(!0),onBlur:()=>{setTimeout(()=>S(!1),200)},placeholder:"Search addons on npm...",className:"w-full rounded-md border border-border bg-background pl-9 pr-3 py-2 text-xs text-foreground placeholder:text-foreground-subtle focus:outline-none focus:ring-1 focus:ring-primary"}),z&&h.jsx(ml,{className:"absolute right-3 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-foreground-subtle animate-spin"}),y&&M&&M.length>0&&h.jsxs("div",{className:"absolute left-0 right-0 top-full mt-1 z-40 rounded-lg border border-border bg-surface shadow-xl overflow-hidden",children:[h.jsxs("div",{className:"px-3 py-1.5 text-[10px] uppercase tracking-wide text-foreground-subtle border-b border-border",children:["npm results (",M.length,")"]}),h.jsx("div",{className:"max-h-72 overflow-auto divide-y divide-border",children:M.map(L=>h.jsxs("div",{className:"flex items-center gap-3 px-3 py-2 hover:bg-surface-hover transition-colors",children:[h.jsx("div",{className:"w-6 h-6 rounded-md bg-primary/10 flex items-center justify-center text-primary text-[9px] font-bold shrink-0",children:L.name.replace("@camstack/addon-","").charAt(0).toUpperCase()}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-[11px] font-semibold truncate",children:L.name}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle",children:["v",L.version]})]}),L.description&&h.jsx("div",{className:"text-[10px] text-foreground-subtle truncate",children:L.description})]}),L.installed?h.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-[10px] font-medium rounded-md border border-emerald-500/30 bg-emerald-500/10 text-emerald-400 shrink-0",children:[h.jsx(Im,{className:"h-3 w-3"}),L.installedVersion??"Installed"]}):h.jsxs("button",{type:"button",onClick:()=>G.mutate(L.name),disabled:G.isPending,className:"inline-flex items-center gap-1 px-2 py-1 text-[10px] font-medium rounded-md bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50 transition-colors shrink-0",children:[G.isPending?h.jsx(ml,{className:"h-3 w-3 animate-spin"}):h.jsx(Dm,{className:"h-3 w-3"}),"Install"]})]},L.name))})]})]}),h.jsx(DU,{onUploadSuccess:()=>{o.invalidateQueries({queryKey:["addons"]}),n()}}),((b==null?void 0:b.length)??0)>0&&h.jsxs("button",{type:"button",onClick:()=>k.mutate(),disabled:k.isPending,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md bg-blue-500/10 text-blue-400 hover:bg-blue-500/20 border border-blue-500/30 disabled:opacity-50 transition-colors font-medium",children:[h.jsx(Dm,{className:`w-3.5 h-3.5 ${k.isPending?"animate-bounce":""}`}),"Update All (",b.length,")"]}),h.jsxs("button",{type:"button",onClick:n,disabled:s,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md bg-surface hover:bg-surface-hover border border-border disabled:opacity-50 transition-colors",children:[h.jsx(eh,{className:`w-3.5 h-3.5 ${s?"animate-spin":""}`}),"Refresh"]})]}),t.length===0&&h.jsx("div",{className:"text-xs text-foreground-subtle",children:"No addons installed"}),h.jsx("div",{className:"space-y-2",children:P.map(L=>{if(LU(L)){const Z=L.bundle.packageName,re=_.get(Z);return h.jsx(Bb,{addon:L.representative,agents:e,bundle:L.bundle,availableUpdate:re,isUpdating:j===Z,onUpdate:re?()=>T.mutate({name:Z,version:re}):void 0},Z)}const U=L.manifest.packageName,V=_.get(U);return h.jsx(Bb,{addon:L,agents:e,availableUpdate:V,isUpdating:j===U,onUpdate:V?()=>T.mutate({name:L.manifest.packageName,version:V}):void 0},L.manifest.id)})})]})}function qU(){const t=en(),e=ga(),{data:n,isLoading:s,isError:i}=dt({queryKey:["addons","list"],queryFn:()=>t.listAddons()}),{data:o=[]}=dt({queryKey:["agents","list"],queryFn:()=>t.listAgents(),staleTime:3e4}),d=D.useMemo(()=>o.map(y=>({id:y.info.id,name:y.info.name??y.info.id,isHub:y.isHub})),[o]),f=jn({mutationFn:async()=>{await t.trpc.addons.forceRefresh.mutate(),await t.trpc.addons.reloadPackages.mutate()},onSuccess:()=>{e.invalidateQueries({queryKey:["addons"]}),e.invalidateQueries({queryKey:["updates"]})}}),p=(n??[]).map(zU).filter(y=>y!==null);return h.jsxs("div",{className:"p-6 space-y-5",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Addons"}),h.jsx("p",{className:"text-xs text-foreground-subtle mt-0.5",children:"Manage installed addons and explore capability providers."})]}),!s&&!i&&h.jsxs("span",{className:"text-[10px] rounded-full bg-primary/10 text-primary px-2 py-0.5 font-medium",children:[p.length," installed"]})]}),s&&h.jsx("div",{className:"text-xs text-foreground-subtle animate-pulse",children:"Loading…"}),i&&h.jsx("div",{className:"text-xs text-danger",children:"Failed to load addons"}),!s&&!i&&h.jsx(UU,{addons:p,agents:d,onRefresh:()=>f.mutate(),isRefreshing:f.isPending})]})}function Gb(t){return t>=1024?`${(t/1024).toFixed(1)} GB`:`${Math.round(t)} MB`}function HU(t){const e=Math.floor((Date.now()-t)/1e3);if(e<60)return`${e}s`;if(e<3600)return`${Math.floor(e/60)}m`;const n=Math.floor(e/3600),s=Math.floor(e%3600/60);return`${n}h ${s}m`}function BU(t){if(t<60)return`${t}s`;if(t<3600)return`${Math.floor(t/60)}m ${t%60}s`;const e=Math.floor(t/3600),n=Math.floor(t%3600/60);return`${e}h ${n}m`}function GU(t){return new Date(t).toLocaleString("en-GB",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function PU(t){switch(t){case"running":return"bg-green-400";case"stopped":return"bg-foreground-subtle";case"crashed":return"bg-red-400";default:return"bg-foreground-subtle"}}function YU({proc:t,isLast:e}){return h.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-foreground-subtle pl-6 py-1",children:[h.jsx("span",{className:"text-foreground-subtle/40 font-mono select-none",children:e?"└──":"├──"}),h.jsx("span",{className:`h-1.5 w-1.5 rounded-full shrink-0 ${PU(t.state)}`}),h.jsx("span",{className:"font-mono text-foreground truncate",children:t.name}),h.jsxs("span",{className:"text-foreground-subtle/60",children:["PID ",t.pid]}),h.jsxs("span",{children:["CPU ",t.cpuPercent.toFixed(1),"%"]}),h.jsx("span",{children:Gb(t.memoryRss/1024/1024)}),t.uptimeSeconds>0&&h.jsxs("span",{className:"text-foreground-subtle/60",children:["up ",BU(t.uptimeSeconds)]})]})}function VU({entry:t,isSelected:e,onSelectAgent:n}){const[s,i]=D.useState(t.isHub);return h.jsxs("div",{className:"border border-border rounded-lg bg-surface overflow-hidden",children:[h.jsxs("button",{type:"button",className:"w-full flex items-start justify-between gap-3 px-4 py-3 hover:bg-primary/5 transition-colors text-left",onClick:()=>i(o=>!o),children:[h.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s?h.jsx(Mc,{className:"h-3.5 w-3.5 shrink-0 text-foreground-subtle"}):h.jsx(Zu,{className:"h-3.5 w-3.5 shrink-0 text-foreground-subtle"}),h.jsx("span",{className:`h-2.5 w-2.5 rounded-full shrink-0 ${t.state==="running"?"bg-green-400":"bg-red-400"}`}),h.jsx(E1,{className:"h-4 w-4 shrink-0 text-foreground-subtle"}),h.jsxs("div",{className:"min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[h.jsx("span",{className:"text-sm font-semibold text-foreground truncate",children:t.name}),t.isHub&&h.jsx("span",{className:"rounded-full bg-primary/10 text-primary px-2 py-0.5 text-[10px] font-medium shrink-0",children:"HUB"})]}),h.jsxs("div",{className:"flex items-center gap-2 mt-0.5 text-[10px] text-foreground-subtle flex-wrap",children:[t.host&&h.jsx("span",{className:"font-mono",children:t.host}),h.jsxs("span",{children:[t.platform,"/",t.arch]}),h.jsxs("span",{className:"flex items-center gap-1",children:[h.jsx(zf,{className:"h-2.5 w-2.5"}),t.cpuPercent.toFixed(0),"%"]}),h.jsxs("span",{className:"flex items-center gap-1",children:[h.jsx(ym,{className:"h-2.5 w-2.5"}),t.memoryPercent.toFixed(0),"% (",Gb(t.memoryMB),")"]})]})]})]}),h.jsxs("div",{className:"flex items-center gap-2 shrink-0 text-[10px] text-foreground-subtle",children:[h.jsxs("span",{children:["up ",HU(t.connectedSince)]}),t.subProcesses.length>0&&h.jsxs("span",{className:"rounded-full bg-info/10 text-info px-2 py-0.5 font-medium",children:[t.subProcesses.length," proc",t.subProcesses.length!==1?"s":""]}),n&&h.jsxs("button",{type:"button",onClick:o=>{o.stopPropagation(),n(t.isHub?"Hub":t.name)},className:`inline-flex items-center gap-1 rounded-lg border px-2 py-0.5 text-[10px] font-medium transition-colors ${e?"border-primary/30 bg-primary/10 text-primary":"border-border bg-surface text-foreground-subtle hover:text-foreground hover:bg-primary/5"}`,title:"View logs for this agent",children:[h.jsx(Jm,{className:"h-3 w-3"}),"Logs"]})]})]}),!s&&h.jsxs("div",{className:"px-4 pb-2 space-y-1",children:[h.jsx("div",{className:"h-1.5 w-full rounded-full bg-border overflow-hidden",children:h.jsx("div",{className:"h-full rounded-full bg-blue-400 transition-all",style:{width:`${Math.min(100,t.cpuPercent)}%`}})}),h.jsx("div",{className:"h-1.5 w-full rounded-full bg-border overflow-hidden",children:h.jsx("div",{className:"h-full rounded-full bg-purple-400 transition-all",style:{width:`${Math.min(100,t.memoryPercent)}%`}})})]}),s&&h.jsxs("div",{className:"border-t border-border",children:[h.jsxs("div",{className:"px-4 py-2 border-b border-border",children:[h.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-1.5",children:[h.jsx(E1,{className:"h-3 w-3"}),"System Details"]}),h.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-x-4 gap-y-1 text-[10px] text-foreground-subtle",children:[h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx(j1,{className:"h-3 w-3 shrink-0"}),h.jsxs("span",{children:["Platform: ",h.jsx("span",{className:"text-foreground font-medium",children:t.platform})]})]}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx(zf,{className:"h-3 w-3 shrink-0"}),h.jsxs("span",{children:["Arch: ",h.jsx("span",{className:"text-foreground font-medium",children:t.arch})]})]}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx(ym,{className:"h-3 w-3 shrink-0"}),h.jsxs("span",{children:["Memory: ",h.jsx("span",{className:"text-foreground font-medium",children:Gb(t.memoryMB)})]})]}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx(zf,{className:"h-3 w-3 shrink-0"}),h.jsxs("span",{children:["CPU: ",h.jsxs("span",{className:"text-foreground font-medium",children:[t.cpuPercent.toFixed(1),"%"]})]})]}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx(ym,{className:"h-3 w-3 shrink-0"}),h.jsxs("span",{children:["Mem usage: ",h.jsxs("span",{className:"text-foreground font-medium",children:[t.memoryPercent.toFixed(1),"%"]})]})]}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx(M6,{className:"h-3 w-3 shrink-0"}),h.jsxs("span",{children:["Connected: ",h.jsx("span",{className:"text-foreground font-medium",children:GU(t.connectedSince)})]})]})]}),h.jsxs("div",{className:"mt-2 space-y-1",children:[h.jsxs("div",{className:"flex items-center gap-2 text-[9px] text-foreground-subtle",children:[h.jsx("span",{className:"w-8",children:"CPU"}),h.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-border overflow-hidden",children:h.jsx("div",{className:"h-full rounded-full bg-blue-400 transition-all",style:{width:`${Math.min(100,t.cpuPercent)}%`}})}),h.jsxs("span",{className:"w-8 text-right",children:[t.cpuPercent.toFixed(0),"%"]})]}),h.jsxs("div",{className:"flex items-center gap-2 text-[9px] text-foreground-subtle",children:[h.jsx("span",{className:"w-8",children:"MEM"}),h.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-border overflow-hidden",children:h.jsx("div",{className:"h-full rounded-full bg-purple-400 transition-all",style:{width:`${Math.min(100,t.memoryPercent)}%`}})}),h.jsxs("span",{className:"w-8 text-right",children:[t.memoryPercent.toFixed(0),"%"]})]})]})]}),t.installedAddons.length>0&&h.jsxs("div",{className:"px-4 py-2 border-b border-border",children:[h.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-1.5",children:[h.jsx(zm,{className:"h-3 w-3"}),"Installed Addons (",t.installedAddons.length,")"]}),h.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.installedAddons.map(o=>h.jsx("span",{className:"inline-flex rounded-md px-1.5 py-0.5 text-[10px] font-medium bg-primary/10 text-primary",children:o},o))})]}),t.capabilities.length>0&&h.jsxs("div",{className:"px-4 py-2 border-b border-border",children:[h.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-1.5",children:[h.jsx(j1,{className:"h-3 w-3"}),"Capabilities (",t.capabilities.length,")"]}),h.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.capabilities.map(o=>h.jsx("span",{className:"inline-flex rounded-md px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-400",children:o},o))})]}),t.subProcesses.length>0&&h.jsxs("div",{className:"px-4 py-2",children:[h.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-1.5",children:[h.jsx(X1,{className:"h-3 w-3"}),"Sub-Processes (",t.subProcesses.length,")"]}),t.subProcesses.map((o,d)=>h.jsx(YU,{proc:o,isLast:d===t.subProcesses.length-1},o.pid))]}),t.subProcesses.length===0&&t.installedAddons.length===0&&t.capabilities.length===0&&h.jsx("div",{className:"px-4 py-3 text-[10px] text-foreground-subtle italic",children:"No sub-processes or addons reported"})]})]})}function QU({entries:t,isLoading:e,selectedAgentName:n,onSelectAgent:s}){if(e)return h.jsx("div",{className:"text-xs text-foreground-subtle animate-pulse",children:"Loading process tree..."});if(t.length===0)return h.jsx("div",{className:"text-xs text-foreground-subtle italic",children:"No agents connected"});const i=[...t].sort((o,d)=>o.isHub&&!d.isHub?-1:!o.isHub&&d.isHub?1:o.name.localeCompare(d.name));return h.jsx("div",{className:"space-y-2",children:i.map(o=>h.jsx(VU,{entry:o,isSelected:n===o.name,onSelectAgent:s},o.id))})}function KU({agentNames:t,addonNames:e,preselectedAgent:n}){const[s,i]=D.useState(n??"all"),[o,d]=D.useState("all"),f=D.useRef(n);D.useEffect(()=>{n!==f.current&&(i(n??"all"),f.current=n)},[n]);const p=D.useMemo(()=>{const y=[];return s!=="all"&&y.push(s),o!=="all"&&y.push(o),y.length>0?y:void 0},[s,o]);return h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[h.jsx(CT,{className:"h-3.5 w-3.5 text-foreground-subtle shrink-0"}),h.jsxs("select",{value:s,onChange:y=>i(y.target.value),className:"rounded-lg border border-border bg-surface text-xs text-foreground px-2 py-1.5 focus:outline-none focus:ring-1 focus:ring-primary",children:[h.jsx("option",{value:"all",children:"All agents"}),h.jsx("option",{value:"Hub",children:"Hub"}),t.map(y=>h.jsx("option",{value:y,children:y},y))]}),h.jsxs("select",{value:o,onChange:y=>d(y.target.value),className:"rounded-lg border border-border bg-surface text-xs text-foreground px-2 py-1.5 focus:outline-none focus:ring-1 focus:ring-primary",children:[h.jsx("option",{value:"all",children:"All addons"}),e.map(y=>h.jsx("option",{value:y,children:y},y))]})]}),h.jsx("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:h.jsx(Uv,{scope:p,limit:300,maxHeight:"max-h-[400px]",showScope:!0})})]})}function XU(t){const e=t.info??t,n=t.status??{};return{id:String(e.id??t.id??""),name:String(e.name??t.name??""),pid:Number(t.pid??0),state:String(t.state??"running"),cpuPercent:Number(n.cpuPercent??t.cpuPercent??0),memoryPercent:Number(n.memoryPercent??t.memoryPercent??0),memoryMB:Number(e.memoryMB??t.memoryMB??0),isHub:!!(t.isHub??!1),platform:String(e.platform??t.platform??""),arch:String(e.arch??t.arch??""),host:String(e.host??t.host??""),capabilities:e.capabilities??t.capabilities??[],installedAddons:e.installedAddons??t.installedAddons??[],pythonRuntimes:e.pythonRuntimes??t.pythonRuntimes??[],connectedSince:Number(t.connectedSince??Date.now()),subProcesses:FU(t.subProcesses)}}function FU(t){return Array.isArray(t)?t.map(e=>({pid:Number(e.pid??0),name:String(e.name??""),command:String(e.command??""),state:e.state??"running",cpuPercent:Number(e.cpuPercent??0),memoryRss:Number(e.memoryRss??0),uptimeSeconds:Number(e.uptimeSeconds??0)})):[]}function d1({icon:t,label:e,value:n,color:s}){return h.jsxs("div",{className:"rounded-xl border border-border bg-surface px-4 py-3 flex items-center gap-3",children:[h.jsx("div",{className:`flex-shrink-0 h-9 w-9 rounded-lg flex items-center justify-center ${s}`,children:h.jsx(t,{className:"h-4 w-4"})}),h.jsxs("div",{children:[h.jsx("div",{className:"text-xl font-bold text-foreground leading-none",children:n}),h.jsx("div",{className:"text-[10px] text-foreground-subtle mt-0.5",children:e})]})]})}function i4({tab:t,active:e,icon:n,label:s,onClick:i}){return h.jsxs("button",{type:"button",onClick:i,className:`inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium transition-colors ${e?"bg-primary/10 text-primary border border-primary/30":"bg-surface text-foreground-subtle border border-border hover:text-foreground hover:bg-primary/5"}`,children:[h.jsx(n,{className:"h-3.5 w-3.5"}),s]})}function ZU(){const t=en(),e=ga(),[n,s]=D.useState("tree"),[i,o]=D.useState(null),{data:d}=dt({queryKey:["agents","testWorker","status"],queryFn:()=>t.trpc.agents.isTestWorkerRunning.query(),refetchInterval:5e3}),f=(d==null?void 0:d.running)??!1,p=jn({mutationFn:()=>t.trpc.agents.startTestWorker.mutate(),onSuccess:()=>{e.invalidateQueries({queryKey:["agents"]}),e.invalidateQueries({queryKey:["agent"]})}}),y=jn({mutationFn:()=>t.trpc.agents.stopTestWorker.mutate(),onSuccess:()=>{e.invalidateQueries({queryKey:["agents"]}),e.invalidateQueries({queryKey:["agent"]})}}),{data:S=[],isLoading:b}=dt({queryKey:["agent","processTree"],queryFn:()=>t.trpc.agent.processTree.query(),refetchInterval:5e3}),{data:_=[]}=dt({queryKey:["agents","list"],queryFn:()=>t.listAgents(),refetchInterval:5e3}),j=D.useMemo(()=>S.map(XU),[S]),w=j.length,T=j.reduce((z,k)=>z+k.subProcesses.length,0),O=j.reduce((z,k)=>z+k.installedAddons.length,0),R=D.useMemo(()=>j.filter(z=>!z.isHub).map(z=>z.name),[j]),M=D.useMemo(()=>{const z=new Set;for(const k of j)for(const G of k.installedAddons)z.add(G);return[...z].sort()},[j]);return h.jsxs("div",{className:"p-6 space-y-6",children:[h.jsxs("div",{className:"flex items-start justify-between gap-4",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Agents & Process Tree"}),h.jsx("p",{className:"text-xs text-foreground-subtle mt-0.5",children:"Distributed processing agents, sub-processes, and system logs."})]}),h.jsx("div",{className:"shrink-0",children:f?h.jsxs("button",{type:"button",onClick:()=>y.mutate(),disabled:y.isPending,className:"inline-flex items-center gap-1.5 rounded-lg border border-danger/30 bg-danger/10 text-danger px-3 py-1.5 text-xs font-medium hover:bg-danger/20 transition-colors disabled:opacity-50",children:[h.jsx(gv,{className:"h-3.5 w-3.5"}),y.isPending?"Stopping...":"Stop Test Agent"]}):h.jsxs("button",{type:"button",onClick:()=>p.mutate(),disabled:p.isPending,className:"inline-flex items-center gap-1.5 rounded-lg border border-border bg-surface text-foreground-subtle px-3 py-1.5 text-xs font-medium hover:text-foreground hover:bg-primary/5 transition-colors disabled:opacity-50",children:[h.jsx(NT,{className:"h-3.5 w-3.5"}),p.isPending?"Starting...":"Start Test Agent"]})})]}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:[h.jsx(d1,{icon:Sb,label:"Agents online",value:w,color:"bg-green-500/10 text-green-400"}),h.jsx(d1,{icon:zf,label:"Sub-processes",value:T,color:"bg-blue-500/10 text-blue-400"}),h.jsx(d1,{icon:BT,label:"Installed addons",value:O,color:"bg-purple-500/10 text-purple-400"}),h.jsx(d1,{icon:Sb,label:"Capabilities",value:[...new Set(j.flatMap(z=>z.capabilities))].length,color:"bg-cyan-500/10 text-cyan-400"})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(i4,{tab:"tree",active:n==="tree",icon:_R,label:"Process Tree",onClick:()=>s("tree")}),h.jsx(i4,{tab:"logs",active:n==="logs",icon:Jm,label:"Logs",onClick:()=>s("logs")})]}),n==="tree"&&h.jsxs(h.Fragment,{children:[w===0&&!b&&h.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border border-border bg-surface py-12 text-foreground-subtle",children:[h.jsx(DR,{className:"h-8 w-8 mb-2 opacity-40"}),h.jsx("div",{className:"text-sm",children:"No agents connected"}),h.jsxs("div",{className:"text-xs mt-1 opacity-70",children:["Run"," ",h.jsx("code",{className:"font-mono bg-border px-1 rounded",children:"camstack --agent --hub wss://<host>:4443"})," ","to connect one."]})]}),h.jsx(QU,{entries:j,isLoading:b,selectedAgentName:i,onSelectAgent:z=>{o(z),s("logs")}})]}),n==="logs"&&h.jsxs(h.Fragment,{children:[i&&h.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[h.jsx("span",{className:"text-foreground-subtle",children:"Filtered to agent:"}),h.jsx("span",{className:"font-semibold text-foreground",children:i}),h.jsxs("button",{type:"button",onClick:()=>o(null),className:"inline-flex items-center gap-1 rounded-lg border border-border bg-surface px-2 py-1 text-xs text-foreground-subtle hover:text-foreground hover:bg-primary/5 transition-colors",children:[h.jsx(Oi,{className:"h-3 w-3"}),"Clear selection"]})]}),h.jsx(KU,{agentNames:R,addonNames:M,preselectedAgent:i??void 0})]})]})}function IU(){return h.jsxs("div",{className:"p-6 space-y-4",children:[h.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Logs"}),h.jsx("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:h.jsx(Uv,{limit:500,maxHeight:"max-h-[calc(100vh-220px)]",showScope:!0})})]})}const l4={super_admin:"bg-danger/10 text-danger",admin:"bg-primary/10 text-primary",viewer:"bg-foreground-subtle/10 text-foreground-subtle"};function JU(){const t=en(),e=ga(),[n,s]=D.useState(!1),[i,o]=D.useState(""),[d,f]=D.useState(""),[p,y]=D.useState("viewer"),[S,b]=D.useState(null),{data:_,isLoading:j,isError:w}=dt({queryKey:["users"],queryFn:()=>t.listUsers()}),T=jn({mutationFn:()=>t.createUser(i,d,p),onSuccess:()=>{e.invalidateQueries({queryKey:["users"]}),s(!1),o(""),f(""),y("viewer"),b(null)},onError:M=>{b(M instanceof Error?M.message:"Failed to create user")}}),O=_??[];function R(M){return M?new Date(typeof M=="number"?M:String(M)).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}):"—"}return h.jsxs("div",{className:"p-6 space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Users"}),h.jsxs("button",{onClick:()=>s(!0),className:"inline-flex items-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground shadow-sm hover:bg-primary/90",children:[h.jsx(po,{className:"h-3.5 w-3.5"}),"Create User"]})]}),n&&h.jsxs("div",{className:"rounded-lg border border-border bg-surface p-4 space-y-3",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-xs font-medium text-foreground",children:"New User"}),h.jsx("button",{onClick:()=>s(!1),className:"text-foreground-subtle hover:text-foreground",children:h.jsx(Oi,{className:"h-4 w-4"})})]}),h.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[h.jsxs("div",{className:"space-y-1",children:[h.jsx("label",{className:"text-[10px] text-foreground-subtle uppercase tracking-wide",children:"Username"}),h.jsx("input",{type:"text",value:i,onChange:M=>o(M.target.value),placeholder:"john",className:"w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground placeholder:text-foreground-subtle focus:outline-none focus:ring-1 focus:ring-primary"})]}),h.jsxs("div",{className:"space-y-1",children:[h.jsx("label",{className:"text-[10px] text-foreground-subtle uppercase tracking-wide",children:"Password"}),h.jsx("input",{type:"password",value:d,onChange:M=>f(M.target.value),placeholder:"••••••••",className:"w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground placeholder:text-foreground-subtle focus:outline-none focus:ring-1 focus:ring-primary"})]}),h.jsxs("div",{className:"space-y-1",children:[h.jsx("label",{className:"text-[10px] text-foreground-subtle uppercase tracking-wide",children:"Role"}),h.jsxs("select",{value:p,onChange:M=>y(M.target.value),className:"w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary",children:[h.jsx("option",{value:"viewer",children:"Viewer"}),h.jsx("option",{value:"admin",children:"Admin"}),h.jsx("option",{value:"super_admin",children:"Super Admin"})]})]})]}),S&&h.jsx("p",{className:"text-[10px] text-danger",children:S}),h.jsxs("div",{className:"flex justify-end gap-2",children:[h.jsx("button",{onClick:()=>s(!1),className:"rounded px-3 py-1.5 text-xs text-foreground-subtle border border-border hover:text-foreground",children:"Cancel"}),h.jsx("button",{onClick:()=>T.mutate(),disabled:T.isPending||!i||!d,className:"rounded bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50",children:T.isPending?"Creating...":"Create"})]})]}),j&&h.jsx("div",{className:"text-xs text-foreground-subtle animate-pulse",children:"Loading..."}),w&&h.jsx("div",{className:"text-xs text-danger",children:"Failed to load"}),!j&&!w&&O.length===0&&h.jsx("div",{className:"text-xs text-foreground-subtle",children:"No data"}),O.length>0&&h.jsx("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:h.jsxs("table",{className:"w-full text-xs",children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{className:"text-left px-3 py-2 text-foreground-subtle font-medium bg-surface border-b border-border",children:"Username"}),h.jsx("th",{className:"text-left px-3 py-2 text-foreground-subtle font-medium bg-surface border-b border-border",children:"Role"}),h.jsx("th",{className:"text-left px-3 py-2 text-foreground-subtle font-medium bg-surface border-b border-border",children:"Created"})]})}),h.jsx("tbody",{children:O.map(M=>{const z=String(M.role??"viewer"),k=l4[z]??l4.viewer;return h.jsxs("tr",{className:"hover:bg-primary/5",children:[h.jsx("td",{className:"px-3 py-2 text-foreground border-b border-border",children:String(M.username??M.name??"")}),h.jsx("td",{className:"px-3 py-2 text-foreground border-b border-border",children:h.jsx("span",{className:`inline-flex rounded-full px-2 py-0.5 text-[10px] font-medium ${k}`,children:z.replace("_"," ")})}),h.jsx("td",{className:"px-3 py-2 text-foreground border-b border-border text-foreground-subtle",children:R(M.createdAt??M.created_at??M.createdAt)})]},String(M.id??M.username))})})]})})]})}function WU({section:t}){var R,M,z;const e=en(),n=ga(),[s,i]=D.useState(null),[o,d]=D.useState(!1),[f,p]=D.useState(null),y=dt({queryKey:["settings-schema",t],queryFn:()=>e.getSettingsSchema(t),staleTime:1/0}),S=dt({queryKey:["settings",t],queryFn:()=>e.getSettings(t)}),b=(R=y.data)==null?void 0:R.schema,_=((M=y.data)==null?void 0:M.readOnly)??!1,j=((z=S.data)==null?void 0:z.data)??{},w=s??j,T=s!==null,O=jn({mutationFn:k=>e.updateSettings(t,k),onSuccess:()=>{d(!0),p(null),i(null),n.invalidateQueries({queryKey:["settings",t]}),setTimeout(()=>d(!1),2e3)},onError:k=>{p(k instanceof Error?k.message:"Failed to save")}});return y.isLoading||S.isLoading?h.jsx("div",{className:"text-xs text-foreground-subtle animate-pulse py-4",children:"Loading..."}):y.isError||S.isError?h.jsx("div",{className:"text-xs text-danger py-4",children:"Failed to load settings"}):!b||b.sections.length===0?h.jsx("div",{className:"text-xs text-foreground-subtle py-4",children:"No configurable settings for this section."}):h.jsxs("div",{className:"space-y-4",children:[h.jsx(ry,{schema:b,values:w,onChange:k=>i(k),disabled:_}),!_&&h.jsxs("div",{className:"flex items-center justify-end gap-3",children:[o&&h.jsx("span",{className:"text-xs text-success",children:"Saved successfully"}),f&&h.jsx("span",{className:"text-xs text-danger",children:f}),T&&h.jsx("span",{className:"text-[10px] text-orange-400",children:"Unsaved changes"}),h.jsx("button",{type:"button",onClick:()=>O.mutate(w),disabled:O.isPending||!T,className:"rounded-md bg-primary px-4 py-1.5 text-xs font-medium text-white hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:O.isPending?"Saving...":"Save"})]})]})}function $U(){var d;const t=en(),e=dt({queryKey:["settings-schema-all"],queryFn:()=>t.getSettingsSchema(),staleTime:1/0}),n=((d=e.data)==null?void 0:d.tabs)??[],[s,i]=D.useState(null),o=s??(n.length>0?n[0].id:null);return e.isLoading?h.jsx("div",{className:"p-6",children:h.jsx("div",{className:"text-xs text-foreground-subtle animate-pulse",children:"Loading settings..."})}):h.jsxs("div",{className:"p-6 space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Settings"}),h.jsx("span",{className:"text-[10px] rounded-full bg-primary/10 text-primary px-2 py-0.5 font-medium",children:"system"})]}),h.jsx("div",{className:"flex gap-1 border-b border-border overflow-x-auto scrollbar-hide",children:n.map(f=>h.jsx("button",{onClick:()=>i(f.id),className:["px-3 py-1.5 text-xs font-medium rounded-t transition-colors whitespace-nowrap",o===f.id?"text-primary border-b-2 border-primary -mb-px bg-surface":"text-foreground-subtle hover:text-foreground"].join(" "),children:f.label},f.id))}),o&&h.jsx(WU,{section:o},o)]})}const eq={streaming:{icon:MR,label:"Stream"},detection:{icon:uh,label:"Detection"},recording:{icon:O6,label:"Recording"},audio:{icon:k6,label:"Audio"}};function tq({capabilities:t}){return h.jsx("div",{className:"flex items-center gap-1",children:t.map(e=>{const n=eq[e];if(!n)return null;const s=n.icon;return h.jsx("span",{className:"inline-flex items-center gap-1 rounded-md bg-surface-hover px-1.5 py-0.5 text-[10px] text-foreground-subtle",title:n.label,children:h.jsx(s,{className:"h-3 w-3"})},e)})})}function no({title:t,children:e}){return h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsx("div",{className:"border-b border-border px-4 py-2.5",children:h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:t})}),h.jsx("div",{className:"p-4",children:e})]})}function lr({name:t,cssVar:e,hex:n}){const s=e?`var(${e})`:n;return h.jsxs("div",{className:"flex flex-col items-center gap-1.5",children:[h.jsx("div",{className:"h-10 w-10 rounded-lg border border-border shadow-inner",style:{backgroundColor:s}}),h.jsx("span",{className:"text-[10px] text-foreground-subtle text-center leading-tight",children:t})]})}const nq={sections:[{id:"demo",title:"Demo Fields",columns:2,fields:[{key:"name",type:"text",label:"Name",placeholder:"Enter name"},{key:"count",type:"number",label:"Count",min:0,max:100,unit:"items"},{key:"enabled",type:"boolean",label:"Enabled"},{key:"mode",type:"select",label:"Mode",options:[{value:"a",label:"Alpha"},{value:"b",label:"Beta"}]},{key:"tags",type:"tags",label:"Tags",span:2,suggestions:["camera","zone","alert"]},{key:"confidence",type:"slider",label:"Confidence",min:0,max:100,step:5,unit:"%",span:2},{key:"info",type:"info",label:"Note",content:"This is an informational message for the user.",variant:"info"}]}]};function aq(){const[t,e]=D.useState({name:"Example",count:10,enabled:!0,mode:"a",tags:["camera"],confidence:60});return h.jsxs("div",{className:"p-6 space-y-6 max-w-5xl mx-auto",children:[h.jsxs("div",{className:"mb-6",children:[h.jsx("h1",{className:"text-xl font-bold text-foreground",children:"Component Showroom"}),h.jsx("p",{className:"text-sm text-foreground-subtle mt-1",children:"All UI components at a glance"})]}),h.jsx(no,{title:"Typography",children:h.jsxs("div",{className:"space-y-3",children:[h.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Heading 1 — Display title"}),h.jsx("h2",{className:"text-xl font-semibold text-foreground",children:"Heading 2 — Section title"}),h.jsx("h3",{className:"text-base font-semibold text-foreground",children:"Heading 3 — Card title"}),h.jsx("h4",{className:"text-sm font-semibold text-foreground",children:"Heading 4 — Sub-section"}),h.jsx("p",{className:"text-sm text-foreground",children:"Body text — Regular paragraph content goes here. It uses the foreground color."}),h.jsx("p",{className:"text-sm text-foreground-subtle",children:"Subtle text — Secondary/descriptive text with reduced emphasis."}),h.jsx("p",{className:"text-xs text-foreground-subtle uppercase tracking-wider font-semibold",children:"Label / Caption"}),h.jsx("p",{className:"text-xs text-foreground-disabled",children:"Disabled / placeholder text"})]})}),h.jsx(no,{title:"Colors",children:h.jsxs("div",{className:"flex flex-wrap gap-4",children:[h.jsx(lr,{name:"primary",cssVar:"--color-primary"}),h.jsx(lr,{name:"background",cssVar:"--color-background"}),h.jsx(lr,{name:"surface",cssVar:"--color-surface"}),h.jsx(lr,{name:"foreground",cssVar:"--color-foreground"}),h.jsx(lr,{name:"success",cssVar:"--color-success"}),h.jsx(lr,{name:"warning",cssVar:"--color-warning"}),h.jsx(lr,{name:"danger",cssVar:"--color-danger"}),h.jsx(lr,{name:"info",cssVar:"--color-info"}),h.jsx(lr,{name:"border",cssVar:"--color-border"}),h.jsx("div",{className:"w-px"}),h.jsx(lr,{name:"frigate",hex:"#3b82f6"}),h.jsx(lr,{name:"scrypted",hex:"#a855f7"}),h.jsx(lr,{name:"reolink",hex:"#06b6d4"}),h.jsx(lr,{name:"ha",hex:"#22d3ee"}),h.jsx(lr,{name:"rtsp",hex:"#78716c"})]})}),h.jsx(no,{title:"Buttons",children:h.jsxs("div",{className:"flex flex-wrap gap-3",children:[h.jsx("button",{className:"inline-flex items-center gap-1.5 rounded-md bg-primary px-4 py-2 text-sm font-medium text-white hover:opacity-90 transition-opacity",children:"Primary"}),h.jsx("button",{className:"inline-flex items-center gap-1.5 rounded-md border border-border bg-surface px-4 py-2 text-sm font-medium text-foreground hover:bg-surface-hover transition-colors",children:"Secondary"}),h.jsx("button",{className:"inline-flex items-center gap-1.5 rounded-md border border-danger/40 bg-danger/10 px-4 py-2 text-sm font-medium text-danger hover:bg-danger/20 transition-colors",children:"Danger"}),h.jsx("button",{disabled:!0,className:"inline-flex items-center gap-1.5 rounded-md bg-primary px-4 py-2 text-sm font-medium text-white opacity-40 cursor-not-allowed",children:"Disabled"}),h.jsx("button",{className:"inline-flex items-center gap-1.5 rounded-md border border-warning/40 bg-warning/10 px-4 py-2 text-sm font-medium text-warning hover:bg-warning/20 transition-colors",children:"Warning"}),h.jsx("button",{className:"inline-flex items-center gap-1.5 rounded-md border border-success/40 bg-success/10 px-4 py-2 text-sm font-medium text-success hover:bg-success/20 transition-colors",children:"Success"})]})}),h.jsx(no,{title:"Inputs",children:h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-foreground mb-1",children:"Text input"}),h.jsx("input",{type:"text",className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30",placeholder:"Type something..."})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-foreground mb-1",children:"Number input"}),h.jsx("input",{type:"number",className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30",placeholder:"0"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-foreground mb-1",children:"Password input"}),h.jsx("input",{type:"password",className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30",placeholder:"••••••••"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-foreground mb-1",children:"Select"}),h.jsxs("select",{className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30",children:[h.jsx("option",{children:"Option A"}),h.jsx("option",{children:"Option B"}),h.jsx("option",{children:"Option C"})]})]}),h.jsxs("div",{className:"md:col-span-2",children:[h.jsx("label",{className:"block text-xs font-medium text-foreground mb-1",children:"Textarea"}),h.jsx("textarea",{className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30 resize-y min-h-[60px]",placeholder:"Enter multi-line text...",rows:3})]}),h.jsx("div",{children:h.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[h.jsx("input",{type:"checkbox",className:"h-3.5 w-3.5 rounded border-border accent-primary",defaultChecked:!0}),h.jsx("span",{className:"text-xs font-medium text-foreground",children:"Checkbox (checked)"})]})}),h.jsx("div",{children:h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-xs font-medium text-foreground",children:"Toggle switch"}),h.jsx(sq,{})]})}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-foreground mb-1",children:"Slider"}),h.jsx("input",{type:"range",className:"w-full h-1 accent-primary cursor-pointer",min:0,max:100,defaultValue:60})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-foreground mb-1",children:"Tags example"}),h.jsx("div",{className:"flex flex-wrap gap-1.5 rounded-md border border-border bg-background px-2 py-1.5 min-h-[38px]",children:["camera","zone","alert"].map(n=>h.jsx("span",{className:"inline-flex items-center gap-1 rounded-md bg-primary/10 px-1.5 py-0.5 text-xs text-primary",children:n},n))})]})]})}),h.jsx(no,{title:"Badges",children:h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{children:[h.jsx("p",{className:"text-xs text-foreground-subtle mb-2",children:"StatusBadge"}),h.jsx("div",{className:"flex flex-wrap gap-2",children:["running","stopped","error","online","offline","idle"].map(n=>h.jsx(nh,{status:n},n))})]}),h.jsxs("div",{children:[h.jsx("p",{className:"text-xs text-foreground-subtle mb-2",children:"CapabilityBadges"}),h.jsx(tq,{capabilities:["streaming","detection","recording","audio"]})]})]})}),h.jsx(no,{title:"Cards",children:h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[h.jsxs("div",{className:"rounded-lg bg-surface p-4",children:[h.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Surface card"}),h.jsx("p",{className:"text-xs text-foreground-subtle",children:"Uses `bg-surface`. Default card background."})]}),h.jsxs("div",{className:"rounded-lg border border-border bg-surface p-4",children:[h.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Bordered card"}),h.jsx("p",{className:"text-xs text-foreground-subtle",children:"Uses `border border-border bg-surface`."})]}),h.jsxs("div",{className:"rounded-lg border border-primary/30 bg-primary/5 p-4",children:[h.jsx("h3",{className:"text-sm font-semibold text-primary mb-1",children:"Accent card"}),h.jsx("p",{className:"text-xs text-foreground-subtle",children:"Highlighted with primary color."})]}),h.jsxs("div",{className:"rounded-lg bg-background p-4",children:[h.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Background card"}),h.jsx("p",{className:"text-xs text-foreground-subtle",children:"Uses `bg-background`. Inset card."})]})]})}),h.jsx(no,{title:"Provider Icons",children:h.jsx("div",{className:"flex flex-wrap gap-4",children:["frigate","scrypted","reolink","homeassistant","rtsp","onvif"].map(n=>h.jsx(sy,{type:n,size:"lg",showLabel:!0},n))})}),h.jsxs(no,{title:"Form Builder Demo",children:[h.jsx(ry,{schema:nq,values:t,onChange:e}),h.jsxs("details",{className:"mt-3",children:[h.jsx("summary",{className:"text-[10px] text-foreground-subtle cursor-pointer hover:text-foreground",children:"View current values"}),h.jsx("pre",{className:"mt-2 rounded-md bg-background p-3 text-[10px] text-foreground-subtle overflow-auto",children:JSON.stringify(t,null,2)})]})]}),h.jsx(no,{title:"Info Boxes",children:h.jsx("div",{className:"space-y-2",children:[{variant:"info",label:"Info",content:"This is an informational message. Use it for tips and hints."},{variant:"warning",label:"Warning",content:"This action may have side effects. Proceed with caution."},{variant:"success",label:"Success",content:"Operation completed successfully. All systems are green."},{variant:"danger",label:"Danger",content:"This operation is irreversible. Data will be permanently deleted."}].map(({variant:n,label:s,content:i})=>{const d={info:{border:"border-info",bg:"bg-info/5",text:"text-info"},warning:{border:"border-warning",bg:"bg-warning/5",text:"text-warning"},success:{border:"border-success",bg:"bg-success/5",text:"text-success"},danger:{border:"border-danger",bg:"bg-danger/5",text:"text-danger"}}[n];return h.jsxs("div",{className:`rounded-md border-l-4 px-3 py-2.5 ${d.border} ${d.bg}`,children:[h.jsx("p",{className:`text-xs font-semibold mb-0.5 ${d.text}`,children:s}),h.jsx("p",{className:"text-xs text-foreground-subtle leading-relaxed",children:i})]},n)})})})]})}function sq(){const[t,e]=D.useState(!0);return h.jsx("button",{type:"button",role:"switch","aria-checked":t,onClick:()=>e(n=>!n),className:["relative inline-flex h-4 w-8 shrink-0 items-center rounded-full transition-colors duration-150 cursor-pointer",t?"bg-primary":"bg-foreground-subtle/30"].join(" "),children:h.jsx("span",{className:["inline-block h-3 w-3 rounded-full bg-white shadow transition-transform duration-150",t?"translate-x-4":"translate-x-0.5"].join(" ")})})}const o4={info:{bg:"bg-blue-500/10",border:"border-blue-500/30",icon:C1},warning:{bg:"bg-orange-500/10",border:"border-orange-500/30",icon:Z1},critical:{bg:"bg-red-500/10",border:"border-red-500/30",icon:hv}};function rq({toast:t,onDismiss:e}){const n=o4[t.severity]??o4.info,s=n.icon;return D.useEffect(()=>{const i=t.duration??5e3;if(i<=0)return;const o=setTimeout(()=>e(t.id),i);return()=>clearTimeout(o)},[t.id,t.duration,e]),h.jsxs("div",{className:`flex items-start gap-3 px-4 py-3 rounded-lg border ${n.border} ${n.bg} shadow-lg backdrop-blur-sm animate-in slide-in-from-right-5 fade-in duration-200`,children:[h.jsx(s,{className:"h-4 w-4 shrink-0 mt-0.5 text-foreground-subtle"}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"text-xs font-semibold text-foreground",children:t.title}),h.jsx("div",{className:"text-[11px] text-foreground-subtle mt-0.5",children:t.message})]}),h.jsx("button",{type:"button",onClick:()=>e(t.id),className:"shrink-0 p-0.5 rounded hover:bg-surface-hover transition-colors",children:h.jsx(Oi,{className:"h-3.5 w-3.5 text-foreground-subtle"})})]})}function iq(){const[t,e]=D.useState([]),n=en(),s=D.useCallback(i=>{e(o=>o.filter(d=>d.id!==i))},[]);return D.useEffect(()=>{var o;let i=null;try{const d=(o=n.trpc.toast)==null?void 0:o.onToast.subscribe(void 0,{onData:f=>{const p=`toast-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;e(y=>[...y,{...f,id:p,timestamp:Date.now()}])},onError:f=>{console.warn("[ToastContainer] Subscription error:",f)}});i=()=>d==null?void 0:d.unsubscribe()}catch{}return()=>i==null?void 0:i()},[n]),t.length===0?null:h.jsx("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col gap-2 max-w-sm w-full pointer-events-none",children:t.map(i=>h.jsx("div",{className:"pointer-events-auto",children:h.jsx(rq,{toast:i,onDismiss:s})},i.id))})}const lq=new K4({defaultOptions:{queries:{staleTime:3e4,retry:!1,refetchOnWindowFocus:!1}}});function oq(){return h.jsx(N_,{defaultMode:"dark",children:h.jsx(X4,{client:lq,children:h.jsx(CU,{children:h.jsxs(RE,{children:[h.jsx(d_,{children:h.jsxs(GN,{children:[h.jsx(La,{path:"/login",element:h.jsx(MO,{})}),h.jsx(La,{path:"/access-denied",element:h.jsx(AO,{})}),h.jsx(La,{path:"/showroom",element:h.jsx(aq,{})}),h.jsxs(La,{element:h.jsx(Au,{children:h.jsx(OO,{})}),children:[h.jsx(La,{index:!0,element:h.jsx(cb,{to:"/dashboard",replace:!0})}),h.jsx(La,{path:"/dashboard",element:h.jsx(nA,{})}),h.jsx(La,{path:"/cameras",element:h.jsx(lA,{})}),h.jsx(La,{path:"/integrations",element:h.jsx(LA,{})}),h.jsx(La,{path:"/integrations/:integrationId",element:h.jsx(PA,{})}),h.jsx(La,{path:"/timeline",element:h.jsx(WA,{})}),h.jsx(La,{path:"/pipeline",element:h.jsx(tD,{})}),h.jsx(La,{path:"/devices/:deviceId",element:h.jsx(NU,{})}),h.jsx(La,{path:"/system/agents",element:h.jsx(Au,{requiredRole:"admin",children:h.jsx(ZU,{})})}),h.jsx(La,{path:"/system/logs",element:h.jsx(Au,{requiredRole:"admin",children:h.jsx(IU,{})})}),h.jsx(La,{path:"/system/users",element:h.jsx(Au,{requiredRole:"admin",children:h.jsx(JU,{})})}),h.jsx(La,{path:"/system/settings",element:h.jsx(Au,{requiredRole:"admin",children:h.jsx($U,{})})}),h.jsx(La,{path:"/system/addons",element:h.jsx(Au,{requiredRole:"admin",children:h.jsx(qU,{})})}),h.jsx(La,{path:"/addon/:pagePath",element:h.jsx(Au,{requiredRole:"admin",children:h.jsx(EO,{})})})]})]})}),h.jsx(iq,{})]})})})})}const cq={dashboard:"Dashboard",integrations:"Integrations",metrics:"Metrics"},uq={title:"System",addons:"Addons",agents:"Agents",processes:"Processes",logs:"Logs",users:"Users",settings:"Settings",repl:"REPL",models:"Models"},dq={save:"Save",cancel:"Cancel",delete:"Delete",enable:"Enable",disable:"Disable",edit:"Edit",add:"Add",remove:"Remove",confirm:"Confirm",close:"Close",back:"Back",next:"Next",search:"Search",filter:"Filter",reset:"Reset",apply:"Apply",submit:"Submit",loading:"Loading…",error:"Error",success:"Success",warning:"Warning",info:"Info",noData:"No data available",noResults:"No results found",retry:"Retry",refresh:"Refresh",copy:"Copy",copied:"Copied!",yes:"Yes",no:"No"},fq={online:"Online",offline:"Offline",connecting:"Connecting",error:"Error",disabled:"Disabled",enabled:"Enabled",active:"Active",inactive:"Inactive",running:"Running",stopped:"Stopped",pending:"Pending",unknown:"Unknown"},hq={login:"Login",logout:"Logout",username:"Username",password:"Password",signIn:"Sign In",invalidCredentials:"Invalid username or password"},pq={dark:"Dark",light:"Light",system:"System"},mq={select:"Language",en:"English",it:"Italian"},gq={dashboard:{title:"Dashboard",subtitle:"Overview of all devices and their status"},integrations:{title:"Integrations",subtitle:"Manage camera sources and provider connections"},metrics:{title:"Metrics",subtitle:"System performance and usage statistics"},agents:{title:"Agents",subtitle:"Manage distributed processing agents"},addons:{title:"Addons",subtitle:"Extend functionality with addon modules"},settings:{title:"Settings",subtitle:"Configure system-wide preferences"},users:{title:"Users",subtitle:"Manage user accounts and permissions"},logs:{title:"Logs",subtitle:"View system and device logs"}},yq={preview:"Preview",snapshotUnavailable:"Snapshot unavailable",noSnapshot:"No snapshot",lastSnapshot:"Last snapshot:",offline:"Offline",active:"Active",available:"Available",noDevices:"No devices.",addFirstDevice:"Add your first device to get started.",import:"+ Import",noProviders:"No providers available. Install a provider addon.",manage:"Manage",integrationName:"Integration name",integrationNamePlaceholder:"e.g. Garage Server",connectionSuccess:"Connection successful!",errorPrefix:"Error:",back:"Back",testing:"Testing...",testConnection:"Test connection",forward:"Next",searchingDevices:"Searching for devices...",foundDevices:"Found {{count}} devices. Select the ones to import.",noDevicesFound:"No devices found.",skip:"Skip",importSelected:"Import selected",newIntegration:"New Integration",configureIntegration:"Configure Integration",importDevices:"Import Devices",addDevice:"Add device",name:"Name",namePlaceholder:"e.g. Entrance Camera",snapshotUrlOptional:"Snapshot URL (optional)",streamUrls:"Stream URLs",addStream:"Add stream",cancel:"Cancel",saving:"Saving...",save:"Save",saveAndNew:"Save and new",test:"Test",stream:"Stream {{number}}:",devices:"devices",rediscover:"Rediscover",config:"Config",integrationNotFound:"Integration not found.",configComingSoon:"Config coming soon.",providerConfig:"Provider Config"},xq={nav:cq,system:uq,common:dq,status:fq,auth:hq,theme:pq,language:mq,pages:gq,integrations:yq},bq={dashboard:"Dashboard",integrations:"Integrazioni",metrics:"Metriche"},vq={title:"Sistema",addons:"Addon",agents:"Agenti",processes:"Processi",logs:"Log",users:"Utenti",settings:"Impostazioni",repl:"REPL",models:"Modelli"},Sq={save:"Salva",cancel:"Annulla",delete:"Elimina",enable:"Abilita",disable:"Disabilita",edit:"Modifica",add:"Aggiungi",remove:"Rimuovi",confirm:"Conferma",close:"Chiudi",back:"Indietro",next:"Avanti",search:"Cerca",filter:"Filtra",reset:"Reimposta",apply:"Applica",submit:"Invia",loading:"Caricamento…",error:"Errore",success:"Successo",warning:"Avviso",info:"Info",noData:"Nessun dato disponibile",noResults:"Nessun risultato trovato",retry:"Riprova",refresh:"Aggiorna",copy:"Copia",copied:"Copiato!",yes:"Sì",no:"No"},Nq={online:"Online",offline:"Offline",connecting:"Connessione in corso",error:"Errore",disabled:"Disabilitato",enabled:"Abilitato",active:"Attivo",inactive:"Inattivo",running:"In esecuzione",stopped:"Fermato",pending:"In attesa",unknown:"Sconosciuto"},_q={login:"Accesso",logout:"Esci",username:"Nome utente",password:"Password",signIn:"Accedi",invalidCredentials:"Nome utente o password non validi"},Cq={dark:"Scuro",light:"Chiaro",system:"Sistema"},jq={select:"Lingua",en:"Inglese",it:"Italiano"},wq={dashboard:{title:"Dashboard",subtitle:"Panoramica di tutti i dispositivi e il loro stato"},integrations:{title:"Integrazioni",subtitle:"Gestisci le sorgenti video e le connessioni ai provider"},metrics:{title:"Metriche",subtitle:"Statistiche di prestazioni e utilizzo del sistema"},agents:{title:"Agenti",subtitle:"Gestisci gli agenti di elaborazione distribuita"},addons:{title:"Addon",subtitle:"Estendi le funzionalità con moduli addon"},settings:{title:"Impostazioni",subtitle:"Configura le preferenze di sistema"},users:{title:"Utenti",subtitle:"Gestisci gli account utente e i permessi"},logs:{title:"Log",subtitle:"Visualizza i log di sistema e dei dispositivi"}},Eq={preview:"Anteprima",snapshotUnavailable:"Snapshot non disponibile",noSnapshot:"Nessuno snapshot",lastSnapshot:"Ultimo snapshot:",offline:"Offline",active:"Attivi",available:"Disponibili",noDevices:"Nessun dispositivo.",addFirstDevice:"Aggiungi il primo dispositivo per iniziare.",import:"+ Importa",noProviders:"Nessun provider disponibile. Installa un addon provider.",manage:"Gestisci",integrationName:"Nome integrazione",integrationNamePlaceholder:"es. Server Garage",connectionSuccess:"Connessione riuscita!",errorPrefix:"Errore:",back:"Indietro",testing:"Test...",testConnection:"Test connessione",forward:"Avanti",searchingDevices:"Ricerca dispositivi in corso...",foundDevices:"Trovati {{count}} dispositivi. Seleziona quelli da importare.",noDevicesFound:"Nessun dispositivo trovato.",skip:"Salta",importSelected:"Importa selezionati",newIntegration:"Nuova Integrazione",configureIntegration:"Configura Integrazione",importDevices:"Importa Dispositivi",addDevice:"Aggiungi dispositivo",name:"Nome",namePlaceholder:"es. Camera Ingresso",snapshotUrlOptional:"Snapshot URL (opzionale)",streamUrls:"Stream URLs",addStream:"Aggiungi stream",cancel:"Annulla",saving:"Salvataggio...",save:"Salva",saveAndNew:"Salva e nuova",test:"Test",stream:"Stream {{number}}:",devices:"dispositivi",rediscover:"Riscopri",config:"Config",integrationNotFound:"Integrazione non trovata.",configComingSoon:"Config coming soon.",providerConfig:"Provider Config"},Tq={nav:bq,system:vq,common:Sq,status:Nq,auth:_q,theme:Cq,language:jq,pages:wq,integrations:Eq},s7="camstack_language",Rq=localStorage.getItem(s7)??"en";vs.use(xO).init({resources:{en:{translation:xq},it:{translation:Tq}},lng:Rq,fallbackLng:"en",interpolation:{escapeValue:!1}});vs.on("languageChanged",t=>{localStorage.setItem(s7,t)});window.__camstackReact=V7;window.__camstackReactDOM=X7;window.__camstackReactDOMClient=N4;G9();Qb.createRoot(document.getElementById("root")).render(h.jsx(D.StrictMode,{children:h.jsx(oq,{})}));
|