@camstack/addon-admin-ui 0.1.7 → 0.1.10

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.
@@ -0,0 +1,603 @@
1
+ var L7=Object.defineProperty;var g2=t=>{throw TypeError(t)};var U7=(t,e,n)=>e in t?L7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Gp=(t,e,n)=>U7(t,typeof e!="symbol"?e+"":e,n),Py=(t,e,n)=>e.has(t)||g2("Cannot "+n);var Q=(t,e,n)=>(Py(t,e,"read from private field"),n?n.call(t):e.get(t)),qe=(t,e,n)=>e.has(t)?g2("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Me=(t,e,n,s)=>(Py(t,e,"write to private field"),s?s.call(t,n):e.set(t,n),n),Ie=(t,e,n)=>(Py(t,e,"access private method"),n);var U0=(t,e,n,s)=>({set _(i){Me(t,e,i,n)},get _(){return Q(t,e,s)}});function x4(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 Bb(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Yy={exports:{}},Pp={};/**
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 y2;function q7(){if(y2)return Pp;y2=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 Pp.Fragment=e,Pp.jsx=n,Pp.jsxs=n,Pp}var x2;function H7(){return x2||(x2=1,Yy.exports=q7()),Yy.exports}var h=H7(),Vy={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 b2;function B7(){if(b2)return lt;b2=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"),v=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),_=Symbol.iterator;function C(G){return G===null||typeof G!="object"?null:(G=_&&G[_]||G["@@iterator"],typeof G=="function"?G:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,O={};function T(G,W,fe){this.props=G,this.context=W,this.refs=O,this.updater=fe||w}T.prototype.isReactComponent={},T.prototype.setState=function(G,W){if(typeof G!="object"&&typeof G!="function"&&G!=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,G,W,"setState")},T.prototype.forceUpdate=function(G){this.updater.enqueueForceUpdate(this,G,"forceUpdate")};function M(){}M.prototype=T.prototype;function z(G,W,fe){this.props=G,this.context=W,this.refs=O,this.updater=fe||w}var k=z.prototype=new M;k.constructor=z,R(k,T.prototype),k.isPureReactComponent=!0;var P=Array.isArray;function H(){}var L={H:null,A:null,T:null,S:null},U=Object.prototype.hasOwnProperty;function V(G,W,fe){var be=fe.ref;return{$$typeof:t,type:G,key:W,ref:be!==void 0?be:null,props:fe}}function F(G,W){return V(G.type,W,G.props)}function re(G){return typeof G=="object"&&G!==null&&G.$$typeof===t}function ne(G){var W={"=":"=0",":":"=2"};return"$"+G.replace(/[=:]/g,function(fe){return W[fe]})}var I=/\/+/g;function ie(G,W){return typeof G=="object"&&G!==null&&G.key!=null?ne(""+G.key):W.toString(36)}function ce(G){switch(G.status){case"fulfilled":return G.value;case"rejected":throw G.reason;default:switch(typeof G.status=="string"?G.then(H,H):(G.status="pending",G.then(function(W){G.status==="pending"&&(G.status="fulfilled",G.value=W)},function(W){G.status==="pending"&&(G.status="rejected",G.reason=W)})),G.status){case"fulfilled":return G.value;case"rejected":throw G.reason}}throw G}function Y(G,W,fe,be,_e){var me=typeof G;(me==="undefined"||me==="boolean")&&(G=null);var we=!1;if(G===null)we=!0;else switch(me){case"bigint":case"string":case"number":we=!0;break;case"object":switch(G.$$typeof){case t:case e:we=!0;break;case v:return we=G._init,Y(we(G._payload),W,fe,be,_e)}}if(we)return _e=_e(G),we=be===""?"."+ie(G,0):be,P(_e)?(fe="",we!=null&&(fe=we.replace(I,"$&/")+"/"),Y(_e,W,fe,"",function(Vt){return Vt})):_e!=null&&(re(_e)&&(_e=F(_e,fe+(_e.key==null||G&&G.key===_e.key?"":(""+_e.key).replace(I,"$&/")+"/")+we)),W.push(_e)),1;we=0;var nt=be===""?".":be+":";if(P(G))for(var ze=0;ze<G.length;ze++)be=G[ze],me=nt+ie(be,ze),we+=Y(be,W,fe,me,_e);else if(ze=C(G),typeof ze=="function")for(G=ze.call(G),ze=0;!(be=G.next()).done;)be=be.value,me=nt+ie(be,ze++),we+=Y(be,W,fe,me,_e);else if(me==="object"){if(typeof G.then=="function")return Y(ce(G),W,fe,be,_e);throw W=String(G),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(G).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.")}return we}function $(G,W,fe){if(G==null)return G;var be=[],_e=0;return Y(G,be,"","",function(me){return W.call(fe,me,_e++)}),be}function ae(G){if(G._status===-1){var W=G._result;W=W(),W.then(function(fe){(G._status===0||G._status===-1)&&(G._status=1,G._result=fe)},function(fe){(G._status===0||G._status===-1)&&(G._status=2,G._result=fe)}),G._status===-1&&(G._status=0,G._result=W)}if(G._status===1)return G._result.default;throw G._result}var je=typeof reportError=="function"?reportError:function(G){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var W=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof G=="object"&&G!==null&&typeof G.message=="string"?String(G.message):String(G),error:G});if(!window.dispatchEvent(W))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",G);return}console.error(G)},he={map:$,forEach:function(G,W,fe){$(G,function(){W.apply(this,arguments)},fe)},count:function(G){var W=0;return $(G,function(){W++}),W},toArray:function(G){return $(G,function(W){return W})||[]},only:function(G){if(!re(G))throw Error("React.Children.only expected to receive a single React element child.");return G}};return lt.Activity=b,lt.Children=he,lt.Component=T,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(G){return L.H.useMemoCache(G)}},lt.cache=function(G){return function(){return G.apply(null,arguments)}},lt.cacheSignal=function(){return null},lt.cloneElement=function(G,W,fe){if(G==null)throw Error("The argument must be a React element, but you passed "+G+".");var be=R({},G.props),_e=G.key;if(W!=null)for(me in W.key!==void 0&&(_e=""+W.key),W)!U.call(W,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&W.ref===void 0||(be[me]=W[me]);var me=arguments.length-2;if(me===1)be.children=fe;else if(1<me){for(var we=Array(me),nt=0;nt<me;nt++)we[nt]=arguments[nt+2];be.children=we}return V(G.type,_e,be)},lt.createContext=function(G){return G={$$typeof:d,_currentValue:G,_currentValue2:G,_threadCount:0,Provider:null,Consumer:null},G.Provider=G,G.Consumer={$$typeof:o,_context:G},G},lt.createElement=function(G,W,fe){var be,_e={},me=null;if(W!=null)for(be in W.key!==void 0&&(me=""+W.key),W)U.call(W,be)&&be!=="key"&&be!=="__self"&&be!=="__source"&&(_e[be]=W[be]);var we=arguments.length-2;if(we===1)_e.children=fe;else if(1<we){for(var nt=Array(we),ze=0;ze<we;ze++)nt[ze]=arguments[ze+2];_e.children=nt}if(G&&G.defaultProps)for(be in we=G.defaultProps,we)_e[be]===void 0&&(_e[be]=we[be]);return V(G,me,_e)},lt.createRef=function(){return{current:null}},lt.forwardRef=function(G){return{$$typeof:f,render:G}},lt.isValidElement=re,lt.lazy=function(G){return{$$typeof:v,_payload:{_status:-1,_result:G},_init:ae}},lt.memo=function(G,W){return{$$typeof:y,type:G,compare:W===void 0?null:W}},lt.startTransition=function(G){var W=L.T,fe={};L.T=fe;try{var be=G(),_e=L.S;_e!==null&&_e(fe,be),typeof be=="object"&&be!==null&&typeof be.then=="function"&&be.then(H,je)}catch(me){je(me)}finally{W!==null&&fe.types!==null&&(W.types=fe.types),L.T=W}},lt.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},lt.use=function(G){return L.H.use(G)},lt.useActionState=function(G,W,fe){return L.H.useActionState(G,W,fe)},lt.useCallback=function(G,W){return L.H.useCallback(G,W)},lt.useContext=function(G){return L.H.useContext(G)},lt.useDebugValue=function(){},lt.useDeferredValue=function(G,W){return L.H.useDeferredValue(G,W)},lt.useEffect=function(G,W){return L.H.useEffect(G,W)},lt.useEffectEvent=function(G){return L.H.useEffectEvent(G)},lt.useId=function(){return L.H.useId()},lt.useImperativeHandle=function(G,W,fe){return L.H.useImperativeHandle(G,W,fe)},lt.useInsertionEffect=function(G,W){return L.H.useInsertionEffect(G,W)},lt.useLayoutEffect=function(G,W){return L.H.useLayoutEffect(G,W)},lt.useMemo=function(G,W){return L.H.useMemo(G,W)},lt.useOptimistic=function(G,W){return L.H.useOptimistic(G,W)},lt.useReducer=function(G,W,fe){return L.H.useReducer(G,W,fe)},lt.useRef=function(G){return L.H.useRef(G)},lt.useState=function(G){return L.H.useState(G)},lt.useSyncExternalStore=function(G,W,fe){return L.H.useSyncExternalStore(G,W,fe)},lt.useTransition=function(){return L.H.useTransition()},lt.version="19.2.4",lt}var v2;function pl(){return v2||(v2=1,Vy.exports=B7()),Vy.exports}var D=pl();const en=Bb(D),G7=x4({__proto__:null,default:en},[D]);var Qy={exports:{}},Yp={},Ky={exports:{}},Xy={};/**
18
+ * @license React
19
+ * scheduler.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 S2;function P7(){return S2||(S2=1,(function(t){function e(Y,$){var ae=Y.length;Y.push($);e:for(;0<ae;){var je=ae-1>>>1,he=Y[je];if(0<i(he,$))Y[je]=$,Y[ae]=he,ae=je;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 je=0,he=Y.length,G=he>>>1;je<G;){var W=2*(je+1)-1,fe=Y[W],be=W+1,_e=Y[be];if(0>i(fe,ae))be<he&&0>i(_e,fe)?(Y[je]=_e,Y[be]=ae,je=be):(Y[je]=fe,Y[W]=ae,je=W);else if(be<he&&0>i(_e,ae))Y[je]=_e,Y[be]=ae,je=be;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=[],v=1,b=null,_=3,C=!1,w=!1,R=!1,O=!1,T=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 P(Y){if(R=!1,k(Y),!w)if(n(p)!==null)w=!0,H||(H=!0,ne());else{var $=n(y);$!==null&&ce(P,$.startTime-Y)}}var H=!1,L=-1,U=5,V=-1;function F(){return O?!0:!(t.unstable_now()-V<U)}function re(){if(O=!1,H){var Y=t.unstable_now();V=Y;var $=!0;try{e:{w=!1,R&&(R=!1,M(L),L=-1),C=!0;var ae=_;try{t:{for(k(Y),b=n(p);b!==null&&!(b.expirationTime>Y&&F());){var je=b.callback;if(typeof je=="function"){b.callback=null,_=b.priorityLevel;var he=je(b.expirationTime<=Y);if(Y=t.unstable_now(),typeof he=="function"){b.callback=he,k(Y),$=!0;break t}b===n(p)&&s(p),k(Y)}else s(p);b=n(p)}if(b!==null)$=!0;else{var G=n(y);G!==null&&ce(P,G.startTime-Y),$=!1}}break e}finally{b=null,_=ae,C=!1}$=void 0}}finally{$?ne():H=!1}}}var ne;if(typeof z=="function")ne=function(){z(re)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,ie=I.port2;I.port1.onmessage=re,ne=function(){ie.postMessage(null)}}else ne=function(){T(re,0)};function ce(Y,$){L=T(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 je=t.unstable_now();switch(typeof ae=="object"&&ae!==null?(ae=ae.delay,ae=typeof ae=="number"&&0<ae?je+ae:je):ae=je,Y){case 1:var he=-1;break;case 2:he=250;break;case 5:he=1073741823;break;case 4:he=1e4;break;default:he=5e3}return he=ae+he,Y={id:v++,callback:$,priorityLevel:Y,startTime:ae,expirationTime:he,sortIndex:-1},ae>je?(Y.sortIndex=ae,e(y,Y),n(p)===null&&Y===n(y)&&(R?(M(L),L=-1):R=!0,ce(P,ae-je))):(Y.sortIndex=he,e(p,Y),w||C||(w=!0,H||(H=!0,ne()))),Y},t.unstable_shouldYield=F,t.unstable_wrapCallback=function(Y){var $=_;return function(){var ae=_;_=$;try{return Y.apply(this,arguments)}finally{_=ae}}}})(Xy)),Xy}var N2;function Gb(){return N2||(N2=1,Ky.exports=P7()),Ky.exports}var Fy={exports:{}},xs={};/**
26
+ * @license React
27
+ * react-dom.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 _2;function Y7(){if(_2)return xs;_2=1;var t=pl();function e(p){var y="https://react.dev/errors/"+p;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)y+="&args[]="+encodeURIComponent(arguments[v])}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,v){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:v}}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 v=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,v)},xs.flushSync=function(p){var y=d.T,v=s.p;try{if(d.T=null,s.p=2,p)return p()}finally{d.T=y,s.p=v,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 v=y.as,b=f(v,y.crossOrigin),_=typeof y.integrity=="string"?y.integrity:void 0,C=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;v==="style"?s.d.S(p,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:b,integrity:_,fetchPriority:C}):v==="script"&&s.d.X(p,{crossOrigin:b,integrity:_,fetchPriority:C,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 v=f(y.as,y.crossOrigin);s.d.M(p,{crossOrigin:v,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 v=y.as,b=f(v,y.crossOrigin);s.d.L(p,v,{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 v=f(y.as,y.crossOrigin);s.d.m(p,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:v,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,v){return d.H.useFormState(p,y,v)},xs.useFormStatus=function(){return d.H.useHostTransitionStatus()},xs.version="19.2.4",xs}var j2;function Pb(){if(j2)return Fy.exports;j2=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=Y7(),Fy.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 C2;function V7(){if(C2)return Yp;C2=1;var t=Gb(),e=pl(),n=Pb();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 S=u.return;if(S===null)break;var N=S.alternate;if(N===null){if(m=S.return,m!==null){u=m;continue}break}if(S.child===N.child){for(N=S.child;N;){if(N===u)return p(S),a;if(N===m)return p(S),r;N=N.sibling}throw Error(s(188))}if(u.return!==m.return)u=S,m=N;else{for(var A=!1,B=S.child;B;){if(B===u){A=!0,u=S,m=N;break}if(B===m){A=!0,m=S,u=N;break}B=B.sibling}if(!A){for(B=N.child;B;){if(B===u){A=!0,u=N,m=S;break}if(B===m){A=!0,m=N,u=S;break}B=B.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 v(a){var r=a.tag;if(r===5||r===26||r===27||r===6)return a;for(a=a.child;a!==null;){if(r=v(a),r!==null)return r;a=a.sibling}return null}var b=Object.assign,_=Symbol.for("react.element"),C=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),z=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),F=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 I=Symbol.for("react.client.reference");function ie(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===I?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case R:return"Fragment";case T:return"Profiler";case O:return"StrictMode";case P:return"Suspense";case H: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},je=[],he=-1;function G(a){return{current:a}}function W(a){0>he||(a.current=je[he],je[he]=null,he--)}function fe(a,r){he++,je[he]=a.current,a.current=r}var be=G(null),_e=G(null),me=G(null),we=G(null);function nt(a,r){switch(fe(me,r),fe(_e,a),fe(be,null),r.nodeType){case 9:case 11:a=(a=r.documentElement)&&(a=a.namespaceURI)?Hv(a):0;break;default:if(a=r.tagName,r=r.namespaceURI)r=Hv(r),a=Bv(r,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}W(be),fe(be,a)}function ze(){W(be),W(_e),W(me)}function Vt(a){a.memoizedState!==null&&fe(we,a);var r=be.current,u=Bv(r,a.type);r!==u&&(fe(_e,a),fe(be,u))}function $e(a){_e.current===a&&(W(be),W(_e)),we.current===a&&(W(we),Up._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 Qn=!1;function Gt(a,r){if(!a||Qn)return"";Qn=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(r){var Se=function(){throw Error()};if(Object.defineProperty(Se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Se,[])}catch(ye){var de=ye}Reflect.construct(a,[],Se)}else{try{Se.call()}catch(ye){de=ye}a.call(Se.prototype)}}else{try{throw Error()}catch(ye){de=ye}(Se=a())&&typeof Se.catch=="function"&&Se.catch(function(){})}}catch(ye){if(ye&&de&&typeof ye.stack=="string")return[ye.stack,de.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var S=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");S&&S.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var N=m.DetermineComponentFrameRoot(),A=N[0],B=N[1];if(A&&B){var X=A.split(`
44
+ `),oe=B.split(`
45
+ `);for(S=m=0;m<X.length&&!X[m].includes("DetermineComponentFrameRoot");)m++;for(;S<oe.length&&!oe[S].includes("DetermineComponentFrameRoot");)S++;if(m===X.length||S===oe.length)for(m=X.length-1,S=oe.length-1;1<=m&&0<=S&&X[m]!==oe[S];)S--;for(;1<=m&&0<=S;m--,S--)if(X[m]!==oe[S]){if(m!==1||S!==1)do if(m--,S--,0>S||X[m]!==oe[S]){var xe=`
46
+ `+X[m].replace(" at new "," at ");return a.displayName&&xe.includes("<anonymous>")&&(xe=xe.replace("<anonymous>",a.displayName)),xe}while(1<=m&&0<=S);break}}}finally{Qn=!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 Zt=Object.prototype.hasOwnProperty,Et=t.unstable_scheduleCallback,qn=t.unstable_cancelCallback,hn=t.unstable_shouldYield,Jt=t.unstable_requestPaint,Kn=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,ea=null;function is(a){if(typeof fr=="function"&&Ns(a),ea&&typeof ea.setStrictMode=="function")try{ea.setStrictMode(Hs,a)}catch{}}var ba=Math.clz32?Math.clz32:Sl,Ta=Math.log,Pc=Math.LN2;function Sl(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 S=0,N=a.suspendedLanes,A=a.pingedLanes;a=a.warmLanes;var B=m&134217727;return B!==0?(m=B&~N,m!==0?S=mt(m):(A&=B,A!==0?S=mt(A):u||(u=B&~a,u!==0&&(S=mt(u))))):(B=m&~N,B!==0?S=mt(B):A!==0?S=mt(A):u||(u=m&~a,u!==0&&(S=mt(u)))),S===0?0:r!==0&&r!==S&&(r&N)===0&&(N=S&-S,u=r&-r,N>=u||N===32&&(u&4194048)!==0)?r:S}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 Xn(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,S,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 B=a.entanglements,X=a.expirationTimes,oe=a.hiddenUpdates;for(u=A&~u;0<u;){var xe=31-ba(u),Se=1<<xe;B[xe]=0,X[xe]=-1;var de=oe[xe];if(de!==null)for(oe[xe]=null,xe=0;xe<de.length;xe++){var ye=de[xe];ye!==null&&(ye.lane&=-536870913)}u&=~Se}m!==0&&oa(a,m,0),N!==0&&S===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),S=1<<m;S&r|a[m]&r&&(a[m]|=r),u&=~S}}function Bs(a,r){var u=r&-r;return u=(u&42)!==0?1:Ue(u),(u&(a.suspendedLanes|r))!==0?0:u}function Ue(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 et(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function Ve(){var a=$.p;return a!==0?a:(a=window.event,a===void 0?32:c2(a.type))}function ct(a,r){var u=$.p;try{return $.p=a,r()}finally{$.p=u}}var xt=Math.random().toString(36).slice(2),Fe="__reactFiber$"+xt,ut="__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[Fe],delete a[ut],delete a[Tt],delete a[pn],delete a[Rr]}function Pt(a){var r=a[Fe];if(r)return r;for(var u=a.parentNode;u;){if(r=u[sn]||u[Fe]){if(u=r.alternate,r.child!==null||u!==null&&u.child!==null)for(a=Xv(a);a!==null;){if(u=a[Fe])return u;a=Xv(a)}return r}a=u,u=a.parentNode}return null}function pr(a){if(a=a[Fe]||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 js(a){var r=a[os];return r||(r=a[os]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Tn(a){a[Ka]=!0}var Cs=new Set,ud={};function Mi(a,r){ws(a,r),ws(a+"Capture",r)}function ws(a,r){for(ud[a]=r,a=0;a<r.length;a++)Cs.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 hh(a){return Zt.call(Rn,a)?!0:Zt.call(Yc,a)?!1:Es.test(a)?Rn[a]=!0:(Yc[a]=!0,!1)}function xo(a,r,u){if(hh(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 ph(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 S=m.get,N=m.set;return Object.defineProperty(a,r,{configurable:!0,get:function(){return S.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=ph(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,S,N,A,B){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"),S==null&&N!=null&&(a.defaultChecked=!!N),S!=null&&(a.checked=S&&typeof S!="function"&&typeof S!="symbol"),B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"?a.name=""+Ps(B):a.removeAttribute("name")}function hd(a,r,u,m,S,N,A,B){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,B||r===a.value||(a.value=r),a.defaultValue=r}m=m??S,m=typeof m!="function"&&typeof m!="symbol"&&!!m,a.checked=B?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 S=0;S<u.length;S++)r["$"+u[S]]=!0;for(u=0;u<a.length;u++)S=r.hasOwnProperty("$"+a[u].value),a[u].selected!==S&&(a[u].selected=S),S&&m&&(a[u].defaultSelected=!0)}else{for(u=""+Ps(u),r=null,S=0;S<a.length;S++){if(a[S].value===u){a[S].selected=!0,m&&(a[S].defaultSelected=!0);return}r!==null||a[S].disabled||(r=a[S])}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 Nl(a,r){if(r){var u=a.firstChild;if(u&&u===a.lastChild&&u.nodeType===3){u.nodeValue=r;return}}a.textContent=r}var $m=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 mh(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||$m.has(r)?r==="float"?a.cssFloat=u:a[r]=(""+u).trim():a[r]=u+"px"}function gh(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 S in r)m=r[S],r.hasOwnProperty(S)&&u[S]!==m&&mh(a,S,m)}else for(var N in r)r.hasOwnProperty(N)&&mh(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 eg=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"]]),yh=/^[\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 yh.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 _l=null,Ai=null;function xh(a){var r=pr(a);if(r&&(a=r.stateNode)){var u=a[ut]||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 S=m[ut]||null;if(!S)throw Error(s(90));bo(m,S.value,S.defaultValue,S.defaultValue,S.checked,S.defaultChecked,S.type,S.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 bh(a,r,u){if(bd)return a(r,u);bd=!0;try{var m=a(r);return m}finally{if(bd=!1,(_l!==null||Ai!==null)&&(Sr(),_l&&(r=_l,a=Ai,Ai=_l=null,xh(r),a)))for(r=0;r<a.length;r++)xh(a[r])}}function vo(a,r){var u=a.stateNode;if(u===null)return null;var m=u[ut]||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"),vh=!1;if(Mr)try{var So={};Object.defineProperty(So,"passive",{get:function(){vh=!0}}),window.addEventListener("test",So,So),window.removeEventListener("test",So,So)}catch{vh=!1}var Ts=null,vd=null,jl=null;function Xc(){if(jl)return jl;var a,r=vd,u=r.length,m,S="value"in Ts?Ts.value:Ts.textContent,N=S.length;for(a=0;a<u&&r[a]===S[a];a++);var A=u-a;for(m=1;m<=A&&r[u-m]===S[N-m];m++);return jl=S.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 tg(){return!1}function Xa(a){function r(u,m,S,N,A){this._reactName=u,this._targetInst=S,this.type=m,this.nativeEvent=N,this.target=A,this.currentTarget=null;for(var B in a)a.hasOwnProperty(B)&&(u=a[B],this[B]=u?u(N):N[B]);return this.isDefaultPrevented=(N.defaultPrevented!=null?N.defaultPrevented:N.returnValue===!1)?No:tg,this.isPropagationStopped=tg,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 Di={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Zc=Xa(Di),_o=b({},Di,{view:0,detail:0}),ng=Xa(_o),Jc,Sd,jo,Co=b({},_o,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Cd,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!==jo&&(jo&&a.type==="mousemove"?(Jc=a.screenX-jo.screenX,Sd=a.screenY-jo.screenY):Sd=Jc=0,jo=a),Jc)},movementY:function(a){return"movementY"in a?a.movementY:Sd}}),Sh=Xa(Co),ag=b({},Co,{dataTransfer:0}),sg=Xa(ag),Nh=b({},_o,{relatedTarget:0}),Nd=Xa(Nh),rg=b({},Di,{animationName:0,elapsedTime:0,pseudoElement:0}),oy=Xa(rg),cy=b({},Di,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),ig=Xa(cy),Ic=b({},Di,{data:0}),_d=Xa(Ic),jd={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},lg={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"},og={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _h(a){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(a):(a=og[a])?!!r[a]:!1}function Cd(){return _h}var cg=b({},_o,{key:function(a){if(a.key){var r=jd[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"?lg[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Cd,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}}),Cl=Xa(cg),wd=b({},Co,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),jh=Xa(wd),Ch=b({},_o,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Cd}),ug=Xa(Ch),dg=b({},Di,{propertyName:0,elapsedTime:0,pseudoElement:0}),uy=Xa(dg),Oa=b({},Co,{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}),fg=Xa(Oa),hg=b({},Di,{newState:0,oldState:0}),pg=Xa(hg),mg=[9,13,27,32],wl=Mr&&"CompositionEvent"in window,wo=null;Mr&&"documentMode"in document&&(wo=document.documentMode);var Ed=Mr&&"TextEvent"in window&&!wo,wh=Mr&&(!wl||wo&&8<wo&&11>=wo),gg=" ",Wc=!1;function Td(a,r){switch(a){case"keyup":return mg.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Eh(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var El=!1;function yg(a,r){switch(a){case"compositionend":return Eh(r);case"keypress":return r.which!==32?null:(Wc=!0,gg);case"textInput":return a=r.data,a===gg&&Wc?null:a;default:return null}}function Th(a,r){if(El)return a==="compositionend"||!wl&&Td(a,r)?(a=Xc(),jl=vd=Ts=null,El=!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 wh&&r.locale!=="ko"?null:r.data;default:return null}}var Rh={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 Oh(a){var r=a&&a.nodeName&&a.nodeName.toLowerCase();return r==="input"?!!Rh[a.type]:r==="textarea"}function Rd(a,r,u,m){_l?Ai?Ai.push(m):Ai=[m]:_l=m,r=N0(r,"onChange"),0<r.length&&(u=new Zc("onChange","change",null,u,m),a.push({event:u,listeners:r}))}var zi=null,Tl=null;function xg(a){Dv(a,0)}function Eo(a){var r=mr(a);if(qa(r))return a}function Mh(a,r){if(a==="change")return r}var Ar=!1;if(Mr){var $c;if(Mr){var Ah="oninput"in document;if(!Ah){var Dh=document.createElement("div");Dh.setAttribute("oninput","return;"),Ah=typeof Dh.oninput=="function"}$c=Ah}else $c=!1;Ar=$c&&(!document.documentMode||9<document.documentMode)}function Ys(){zi&&(zi.detachEvent("onpropertychange",eu),Tl=zi=null)}function eu(a){if(a.propertyName==="value"&&Eo(Tl)){var r=[];Rd(r,Tl,a,xd(a)),bh(xg,r)}}function bg(a,r,u){a==="focusin"?(Ys(),zi=r,Tl=u,zi.attachEvent("onpropertychange",eu)):a==="focusout"&&Ys()}function zh(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Eo(Tl)}function vg(a,r){if(a==="click")return Eo(r)}function Sg(a,r){if(a==="input"||a==="change")return Eo(r)}function kh(a,r){return a===r&&(a!==0||1/a===1/r)||a!==a&&r!==r}var Fa=typeof Object.is=="function"?Object.is:kh;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 S=u[m];if(!Zt.call(r,S)||!Fa(a[S],r[S]))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 Ng(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 Lh(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 _g=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&&Lh(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=N0(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 Rl={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={},Uh={};Mr&&(Uh=document.createElement("div").style,"AnimationEvent"in window||(delete Rl.animationend.animation,delete Rl.animationiteration.animation,delete Rl.animationstart.animation),"TransitionEvent"in window||delete Rl.transitionend.transition);function ci(a){if(nu[a])return nu[a];if(!Rl[a])return a;var r=Rl[a],u;for(u in r)if(r.hasOwnProperty(u)&&u in Uh)return nu[a]=r[u];return a}var Md=ci("animationend"),au=ci("animationiteration"),qh=ci("animationstart"),jg=ci("transitionrun"),dy=ci("transitionstart"),Cg=ci("transitioncancel"),Hh=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),Mi(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 S=Ks[r];Ks[r++]=null;var N=Ks[r];if(Ks[r++]=null,m!==null&&S!==null){var A=m.pending;A===null?S.next=S:(S.next=A.next,A.next=S),m.pending=S}N!==0&&ki(u,S,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 ki(a,r,u){a.lanes|=u;var m=a.alternate;m!==null&&(m.lanes|=u);for(var S=!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||(S=!0)),a=N,N=N.return;return a.tag===3?(N=a.stateNode,S&&r!==null&&(S=31-ba(u),a=N.hiddenUpdates,m=a[S],m===null?a[S]=[r]:m.push(r),r.lane=u|536870912),N):null}function Xs(a){if(50<el)throw el=0,Fl=null,Error(s(185));for(var r=a.return;r!==null;)a=r,r=a.return;return a.tag===3?a.stateNode:null}var Li={};function Bh(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 Bh(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,S,N){var A=0;if(m=a,typeof a=="function")Dd(a)&&(A=1);else if(typeof a=="string")A=j7(a,u,be.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case V:return a=On(31,u,r,S),a.elementType=V,a.lanes=N,a;case R:return Ui(u.children,S,N,r);case O:A=8,S|=24;break;case T:return a=On(12,u,r,S|2),a.elementType=T,a.lanes=N,a;case P:return a=On(13,u,r,S),a.elementType=P,a.lanes=N,a;case H:return a=On(19,u,r,S),a.elementType=H,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,S),r.elementType=a,r.type=m,r.lanes=N,r}function Ui(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 qi=[],Hi=0,zo=null,ko=0,us=[],bn=0,di=null,Mn=1,yr="";function Lr(a,r){qi[Hi++]=ko,qi[Hi++]=zo,zo=a,ko=r}function wg(a,r,u){us[bn++]=Mn,us[bn++]=yr,us[bn++]=di,di=a;var m=Mn;a=yr;var S=32-ba(m)-1;m&=~(1<<S),u+=1;var N=32-ba(r)+S;if(30<N){var A=S-S%5;N=(m&(1<<A)-1).toString(32),m>>=A,S-=A,Mn=1<<32-ba(r)+S|u<<S|m,yr=N+a}else Mn=1<<N|u<<S|m,yr=a}function Ur(a){a.return!==null&&(Lr(a,1),wg(a,1,0))}function Ld(a){for(;a===zo;)zo=qi[--Hi],qi[Hi]=null,ko=qi[--Hi],qi[Hi]=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,Ct=!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 Eg(a){var r=a.stateNode,u=a.type,m=a.memoizedProps;switch(r[Fe]=a,r[ut]=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||Uv(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 Tg(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(!Ct)return Tg(a),Ct=!0,!1;var r=a.tag,u;if((u=r!==3&&r!==27)&&((u=r===5)&&(u=a.type,u=!(u!=="form"&&u!=="button")||Ey(a.type,a.memoizedProps)),u=!u),u&&on&&qr(a),Tg(a),r===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(s(317));on=Kv(a)}else if(r===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(s(317));on=Kv(a)}else r===27?(r=on,ac(a.type)?(a=Ay,Ay=null,on=a):on=r):on=Bn?$r(a.stateNode.nextSibling):null;return!0}function Bi(){on=Bn=null,Ct=!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=G(null),Gi=null,Br=null;function hi(a,r,u){fe(qo,r._currentValue),r._currentValue=u}function Gr(a){a._currentValue=qo.current,W(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 S=a.child;for(S!==null&&(S.return=a);S!==null;){var N=S.dependencies;if(N!==null){var A=S.child;N=N.firstContext;e:for(;N!==null;){var B=N;N=S;for(var X=0;X<r.length;X++)if(B.context===r[X]){N.lanes|=u,B=N.alternate,B!==null&&(B.lanes|=u),Hd(N.return,u,a),m||(A=null);break e}N=B.next}}else if(S.tag===18){if(A=S.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=S.child;if(A!==null)A.return=S;else for(A=S;A!==null;){if(A===a){A=null;break}if(S=A.sibling,S!==null){S.return=A.return,A=S;break}A=A.return}S=A}}function Pr(a,r,u,m){a=null;for(var S=r,N=!1;S!==null;){if(!N){if((S.flags&524288)!==0)N=!0;else if((S.flags&262144)!==0)break}if(S.tag===10){var A=S.alternate;if(A===null)throw Error(s(387));if(A=A.memoizedProps,A!==null){var B=S.type;Fa(S.pendingProps.value,A.value)||(a!==null?a.push(B):a=[B])}}else if(S===we.current){if(A=S.alternate,A===null)throw Error(s(387));A.memoizedState.memoizedState!==S.memoizedState.memoizedState&&(a!==null?a.push(Up):a=[Up])}S=S.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 Pi(a){Gi=a,Br=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function We(a){return Rg(Gi,a)}function Ho(a,r){return Gi===null&&Pi(a),Rg(a,r)}function Rg(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 Og=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()})}},fy=t.unstable_scheduleCallback,hy=t.unstable_NormalPriority,ta={$$typeof:z,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Gh(){return{controller:new Og,data:new Map,refCount:0}}function Ol(a){a.refCount--,a.refCount===0&&fy(hy,function(){a.controller.abort()})}var Ms=null,Gd=0,pi=0,Fs=null;function Ph(a,r){if(Ms===null){var u=Ms=[];Gd=0,pi=pe(),Fs={status:"pending",value:void 0,then:function(m){u.push(m)}}}return Gd++,r.then(Yh,Yh),r}function Yh(){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 Vh(a,r){var u=[],m={status:"pending",value:null,reason:null,then:function(S){u.push(S)}};return a.then(function(){m.status="fulfilled",m.value=r;for(var S=0;S<u.length;S++)(0,u[S])(r)},function(S){for(m.status="rejected",m.reason=S,S=0;S<u.length;S++)(0,u[S])(void 0)}),m}var Mg=Y.S;Y.S=function(a,r){Mp=Kn(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&Ph(a,r),Mg!==null&&Mg(a,r)};var Yi=G(null);function Pd(){var a=Yi.current;return a!==null?a:tt.pooledCache}function cu(a,r){r===null?fe(Yi,Yi.current):fe(Yi,r.pool)}function Qh(){var a=Pd();return a===null?null:{parent:ta._currentValue,pool:a}}var Ml=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,zl(a),a;default:if(typeof r.status=="string")r.then(oi,oi);else{if(a=tt,a!==null&&100<a.shellSuspendCounter)throw Error(s(482));a=r,a.status="pending",a.then(function(m){if(r.status==="pending"){var S=r;S.status="fulfilled",S.value=m}},function(m){if(r.status==="pending"){var S=r;S.status="rejected",S.reason=m}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw a=r.reason,zl(a),a}throw Yr=r,Ml}}function Al(a){try{var r=a._init;return r(a._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(Yr=u,Ml):u}}var Yr=null;function Dl(){if(Yr===null)throw Error(s(459));var a=Yr;return Yr=null,a}function zl(a){if(a===Ml||a===ft)throw Error(s(483))}var kl=null,Ll=0;function du(a){var r=Ll;return Ll+=1,kl===null&&(kl=[]),Vd(kl,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 S(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 B(te,J,le,ve){return J===null||J.tag!==6?(J=zd(le,te.mode,ve),J.return=te,J):(J=S(J,le),J.return=te,J)}function X(te,J,le,ve){var Ke=le.type;return Ke===R?xe(te,J,le.props.children,ve,le.key):J!==null&&(J.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===U&&Al(Ke)===J.type)?(J=S(J,le.props),Zs(J,le),J.return=te,J):(J=kr(le.type,le.key,le.props,null,te.mode,ve),Zs(J,le),J.return=te,J)}function oe(te,J,le,ve){return J===null||J.tag!==4||J.stateNode.containerInfo!==le.containerInfo||J.stateNode.implementation!==le.implementation?(J=kd(le,te.mode,ve),J.return=te,J):(J=S(J,le.children||[]),J.return=te,J)}function xe(te,J,le,ve,Ke){return J===null||J.tag!==7?(J=Ui(le,te.mode,ve,Ke),J.return=te,J):(J=S(J,le),J.return=te,J)}function Se(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 C: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=Al(J),Se(te,J,le)}if(ce(J)||ne(J))return J=Ui(J,te.mode,le,null),J.return=te,J;if(typeof J.then=="function")return Se(te,du(J),le);if(J.$$typeof===z)return Se(te,Ho(te,J),le);Bo(te,J)}return null}function de(te,J,le,ve){var Ke=J!==null?J.key:null;if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return Ke!==null?null:B(te,J,""+le,ve);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case C:return le.key===Ke?X(te,J,le,ve):null;case w:return le.key===Ke?oe(te,J,le,ve):null;case U:return le=Al(le),de(te,J,le,ve)}if(ce(le)||ne(le))return Ke!==null?null:xe(te,J,le,ve,null);if(typeof le.then=="function")return de(te,J,du(le),ve);if(le.$$typeof===z)return de(te,J,Ho(te,le),ve);Bo(te,le)}return null}function ye(te,J,le,ve,Ke){if(typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint")return te=te.get(le)||null,B(J,te,""+ve,Ke);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case C:return te=te.get(ve.key===null?le:ve.key)||null,X(J,te,ve,Ke);case w:return te=te.get(ve.key===null?le:ve.key)||null,oe(J,te,ve,Ke);case U:return ve=Al(ve),ye(te,J,le,ve,Ke)}if(ce(ve)||ne(ve))return te=te.get(le)||null,xe(J,te,ve,Ke,null);if(typeof ve.then=="function")return ye(te,J,le,du(ve),Ke);if(ve.$$typeof===z)return ye(te,J,le,Ho(J,ve),Ke);Bo(J,ve)}return null}function He(te,J,le,ve){for(var Ke=null,Kt=null,Pe=J,gt=J=0,zt=null;Pe!==null&&gt<le.length;gt++){Pe.index>gt?(zt=Pe,Pe=null):zt=Pe.sibling;var Xt=de(te,Pe,le[gt],ve);if(Xt===null){Pe===null&&(Pe=zt);break}a&&Pe&&Xt.alternate===null&&r(te,Pe),J=N(Xt,J,gt),Kt===null?Ke=Xt:Kt.sibling=Xt,Kt=Xt,Pe=zt}if(gt===le.length)return u(te,Pe),Ct&&Lr(te,gt),Ke;if(Pe===null){for(;gt<le.length;gt++)Pe=Se(te,le[gt],ve),Pe!==null&&(J=N(Pe,J,gt),Kt===null?Ke=Pe:Kt.sibling=Pe,Kt=Pe);return Ct&&Lr(te,gt),Ke}for(Pe=m(Pe);gt<le.length;gt++)zt=ye(Pe,te,gt,le[gt],ve),zt!==null&&(a&&zt.alternate!==null&&Pe.delete(zt.key===null?gt:zt.key),J=N(zt,J,gt),Kt===null?Ke=zt:Kt.sibling=zt,Kt=zt);return a&&Pe.forEach(function(oc){return r(te,oc)}),Ct&&Lr(te,gt),Ke}function Je(te,J,le,ve){if(le==null)throw Error(s(151));for(var Ke=null,Kt=null,Pe=J,gt=J=0,zt=null,Xt=le.next();Pe!==null&&!Xt.done;gt++,Xt=le.next()){Pe.index>gt?(zt=Pe,Pe=null):zt=Pe.sibling;var oc=de(te,Pe,Xt.value,ve);if(oc===null){Pe===null&&(Pe=zt);break}a&&Pe&&oc.alternate===null&&r(te,Pe),J=N(oc,J,gt),Kt===null?Ke=oc:Kt.sibling=oc,Kt=oc,Pe=zt}if(Xt.done)return u(te,Pe),Ct&&Lr(te,gt),Ke;if(Pe===null){for(;!Xt.done;gt++,Xt=le.next())Xt=Se(te,Xt.value,ve),Xt!==null&&(J=N(Xt,J,gt),Kt===null?Ke=Xt:Kt.sibling=Xt,Kt=Xt);return Ct&&Lr(te,gt),Ke}for(Pe=m(Pe);!Xt.done;gt++,Xt=le.next())Xt=ye(Pe,te,gt,Xt.value,ve),Xt!==null&&(a&&Xt.alternate!==null&&Pe.delete(Xt.key===null?gt:Xt.key),J=N(Xt,J,gt),Kt===null?Ke=Xt:Kt.sibling=Xt,Kt=Xt);return a&&Pe.forEach(function(k7){return r(te,k7)}),Ct&&Lr(te,gt),Ke}function dn(te,J,le,ve){if(typeof le=="object"&&le!==null&&le.type===R&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case C:e:{for(var Ke=le.key;J!==null;){if(J.key===Ke){if(Ke=le.type,Ke===R){if(J.tag===7){u(te,J.sibling),ve=S(J,le.props.children),ve.return=te,te=ve;break e}}else if(J.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===U&&Al(Ke)===J.type){u(te,J.sibling),ve=S(J,le.props),Zs(ve,le),ve.return=te,te=ve;break e}u(te,J);break}else r(te,J);J=J.sibling}le.type===R?(ve=Ui(le.props.children,te.mode,ve,le.key),ve.return=te,te=ve):(ve=kr(le.type,le.key,le.props,null,te.mode,ve),Zs(ve,le),ve.return=te,te=ve)}return A(te);case w:e:{for(Ke=le.key;J!==null;){if(J.key===Ke)if(J.tag===4&&J.stateNode.containerInfo===le.containerInfo&&J.stateNode.implementation===le.implementation){u(te,J.sibling),ve=S(J,le.children||[]),ve.return=te,te=ve;break e}else{u(te,J);break}else r(te,J);J=J.sibling}ve=kd(le,te.mode,ve),ve.return=te,te=ve}return A(te);case U:return le=Al(le),dn(te,J,le,ve)}if(ce(le))return He(te,J,le,ve);if(ne(le)){if(Ke=ne(le),typeof Ke!="function")throw Error(s(150));return le=Ke.call(le),Je(te,J,le,ve)}if(typeof le.then=="function")return dn(te,J,du(le),ve);if(le.$$typeof===z)return dn(te,J,Ho(te,le),ve);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),ve=S(J,le),ve.return=te,te=ve):(u(te,J),ve=zd(le,te.mode,ve),ve.return=te,te=ve),A(te)):u(te,J)}return function(te,J,le,ve){try{Ll=0;var Ke=dn(te,J,le,ve);return kl=null,Ke}catch(Pe){if(Pe===Ml||Pe===ft)throw Pe;var Kt=On(29,Pe,null,te.mode);return Kt.lanes=ve,Kt.return=te,Kt}finally{}}}var mi=Qd(!0),Kd=Qd(!1),Ja=!1;function fu(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Kh(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 Vi(a,r,u){var m=a.updateQueue;if(m===null)return null;if(m=m.shared,(Ye&2)!==0){var S=m.pending;return S===null?r.next=r:(r.next=S.next,S.next=r),m.pending=r,r=Xs(a),ki(a,null,u),r}return Sa(a,m,r,u),Xs(a)}function Qi(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 Qe(a,r){var u=a.updateQueue,m=a.alternate;if(m!==null&&(m=m.updateQueue,u===m)){var S=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?S=N=A:N=N.next=A,u=u.next}while(u!==null);N===null?S=N=r:N=N.next=r}else S=N=r;u={baseState:m.baseState,firstBaseUpdate:S,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 Xh=!1;function hu(){if(Xh){var a=Fs;if(a!==null)throw a}}function Go(a,r,u,m){Xh=!1;var S=a.updateQueue;Ja=!1;var N=S.firstBaseUpdate,A=S.lastBaseUpdate,B=S.shared.pending;if(B!==null){S.shared.pending=null;var X=B,oe=X.next;X.next=null,A===null?N=oe:A.next=oe,A=X;var xe=a.alternate;xe!==null&&(xe=xe.updateQueue,B=xe.lastBaseUpdate,B!==A&&(B===null?xe.firstBaseUpdate=oe:B.next=oe,xe.lastBaseUpdate=X))}if(N!==null){var Se=S.baseState;A=0,xe=oe=X=null,B=N;do{var de=B.lane&-536870913,ye=de!==B.lane;if(ye?(dt&de)===de:(m&de)===de){de!==0&&de===pi&&(Xh=!0),xe!==null&&(xe=xe.next={lane:0,tag:B.tag,payload:B.payload,callback:null,next:null});e:{var He=a,Je=B;de=r;var dn=u;switch(Je.tag){case 1:if(He=Je.payload,typeof He=="function"){Se=He.call(dn,Se,de);break e}Se=He;break e;case 3:He.flags=He.flags&-65537|128;case 0:if(He=Je.payload,de=typeof He=="function"?He.call(dn,Se,de):He,de==null)break e;Se=b({},Se,de);break e;case 2:Ja=!0}}de=B.callback,de!==null&&(a.flags|=64,ye&&(a.flags|=8192),ye=S.callbacks,ye===null?S.callbacks=[de]:ye.push(de))}else ye={lane:de,tag:B.tag,payload:B.payload,callback:B.callback,next:null},xe===null?(oe=xe=ye,X=Se):xe=xe.next=ye,A|=de;if(B=B.next,B===null){if(B=S.shared.pending,B===null)break;ye=B,B=ye.next,ye.next=null,S.lastBaseUpdate=ye,S.shared.pending=null}}while(!0);xe===null&&(X=Se),S.baseState=X,S.firstBaseUpdate=oe,S.lastBaseUpdate=xe,N===null&&(S.shared.lanes=0),Jr|=A,a.lanes=A,a.memoizedState=Se}}function Po(a,r){if(typeof a!="function")throw Error(s(191,a));a.call(r)}function Ag(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=G(null),Xd=G(0);function Dg(a,r){a=ks,fe(Xd,a),fe(Yo,r),ks=a|r.baseLanes}function Fh(){fe(Xd,ks),fe(Yo,Yo.current)}function pu(){ks=Xd.current,W(Yo),W(Xd)}var fs=G(null),Ia=null;function yi(a){var r=a.alternate;fe(wt,wt.current&1),fe(fs,a),Ia===null&&(r===null||Yo.current!==null||r.memoizedState!==null)&&(Ia=a)}function Zh(a){fe(wt,wt.current),fe(fs,a),Ia===null&&(Ia=a)}function zg(a){a.tag===22?(fe(wt,wt.current),fe(fs,a),Ia===null&&(Ia=a)):hs()}function hs(){fe(wt,wt.current),fe(fs,fs.current)}function Fn(a){W(fs),Ia===a&&(Ia=null),W(wt)}var wt=G(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||Oy(u)||My(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,Js=!1,Vo=!1,Ul=!1,Fd=0,mu=0,Qo=null,Jh=0;function An(){throw Error(s(321))}function Ih(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,S,N){return vn=N,rt=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,Y.H=a===null||a.memoizedState===null?f0:yp,Ul=!1,N=u(m,S),Ul=!1,Vo&&(N=ql(r,u,m,S)),kg(a),N}function kg(a){Y.H=Ko;var r=tn!==null&&tn.next!==null;if(vn=0,St=tn=rt=null,Js=!1,mu=0,Qo=null,r)throw Error(s(300));a===null||na||(a=a.dependencies,a!==null&&ou(a)&&(na=!0))}function ql(a,r,u,m){rt=a;var S=0;do{if(Vo&&(Qo=null),mu=0,Vo=!1,25<=S)throw Error(s(301));if(S+=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=Is,N=r(u,m)}while(Vo);return N}function Hl(){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 Wh(){var a=Fd!==0;return Fd=0,a}function $h(a,r,u){r.updateQueue=a.updateQueue,r.flags&=-2053,a.lanes&=~u}function ep(a){if(Js){for(a=a.memoizedState;a!==null;){var r=a.queue;r!==null&&(r.pending=null),a=a.next}Js=!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 Zn(){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 Jd(){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?f0:yp),a}function Ki(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return gu(a);if(a.$$typeof===z)return We(a)}throw Error(s(438,String(a)))}function tp(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(S){return S.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),u===null&&(u=Jd(),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]=F;return r.index++,u}function xi(a,r){return typeof r=="function"?r(a):r}function Id(a){var r=Zn();return np(r,tn,a)}function np(a,r,u){var m=a.queue;if(m===null)throw Error(s(311));m.lastRenderedReducer=u;var S=a.baseQueue,N=m.pending;if(N!==null){if(S!==null){var A=S.next;S.next=N.next,N.next=A}r.baseQueue=S=N,m.pending=null}if(N=a.baseState,S===null)a.memoizedState=N;else{r=S.next;var B=A=null,X=null,oe=r,xe=!1;do{var Se=oe.lane&-536870913;if(Se!==oe.lane?(dt&Se)===Se:(vn&Se)===Se){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}),Se===pi&&(xe=!0);else if((vn&de)===de){oe=oe.next,de===pi&&(xe=!0);continue}else Se={lane:0,revertLane:oe.revertLane,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},X===null?(B=X=Se,A=N):X=X.next=Se,rt.lanes|=de,Jr|=de;Se=oe.action,Ul&&u(N,Se),N=oe.hasEagerState?oe.eagerState:u(N,Se)}else de={lane:Se,revertLane:oe.revertLane,gesture:oe.gesture,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},X===null?(B=X=de,A=N):X=X.next=de,rt.lanes|=Se,Jr|=Se;oe=oe.next}while(oe!==null&&oe!==r);if(X===null?A=N:X.next=B,!Fa(N,a.memoizedState)&&(na=!0,xe&&(u=Fs,u!==null)))throw u;a.memoizedState=N,a.baseState=A,a.baseQueue=X,m.lastRenderedState=N}return S===null&&(m.lanes=0),[a.memoizedState,m.dispatch]}function ap(a){var r=Zn(),u=r.queue;if(u===null)throw Error(s(311));u.lastRenderedReducer=a;var m=u.dispatch,S=u.pending,N=r.memoizedState;if(S!==null){u.pending=null;var A=S=S.next;do N=a(N,A.action),A=A.next;while(A!==S);Fa(N,r.memoizedState)||(na=!0),r.memoizedState=N,r.baseQueue===null&&(r.baseState=N),u.lastRenderedState=N}return[N,m]}function Lg(a,r,u){var m=rt,S=Zn(),N=Ct;if(N){if(u===void 0)throw Error(s(407));u=u()}else u=r();var A=!Fa((tn||S).memoizedState,u);if(A&&(S.memoizedState=u,na=!0),S=S.queue,dp(Hg.bind(null,m,S,a),[a]),S.getSnapshot!==r||A||St!==null&&St.memoizedState.tag&1){if(m.flags|=2048,Xi(9,{destroy:void 0},qg.bind(null,m,S,u,r),null),tt===null)throw Error(s(349));N||(vn&127)!==0||Ug(m,r,u)}return u}function Ug(a,r,u){a.flags|=16384,a={getSnapshot:r,value:u},r=rt.updateQueue,r===null?(r=Jd(),rt.updateQueue=r,r.stores=[a]):(u=r.stores,u===null?r.stores=[a]:u.push(a))}function qg(a,r,u,m){r.value=u,r.getSnapshot=m,Bg(r)&&Gg(a)}function Hg(a,r,u){return u(function(){Bg(r)&&Gg(a)})}function Bg(a){var r=a.getSnapshot;a=a.value;try{var u=r();return!Fa(a,u)}catch{return!0}}function Gg(a){var r=Za(a,2);r!==null&&pt(r,a,2)}function sp(a){var r=ca();if(typeof a=="function"){var u=a;if(a=u(),Ul){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 rp(a,r,u,m){return a.baseState=u,np(a,tn,typeof m=="function"?m:xi)}function py(a,r,u,m,S){if(tf(a))throw Error(s(485));if(a=r.action,a!==null){var N={payload:S,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,Pg(r,N)):(N.next=u.next,r.pending=u.next=N)}}function Pg(a,r){var u=r.action,m=r.payload,S=a.state;if(r.isTransition){var N=Y.T,A={};Y.T=A;try{var B=u(S,m),X=Y.S;X!==null&&X(A,B),Yg(a,r,B)}catch(oe){ip(a,r,oe)}finally{N!==null&&A.types!==null&&(N.types=A.types),Y.T=N}}else try{N=u(S,m),Yg(a,r,N)}catch(oe){ip(a,r,oe)}}function Yg(a,r,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(m){Vg(a,r,m)},function(m){return ip(a,r,m)}):Vg(a,r,u)}function Vg(a,r,u){r.status="fulfilled",r.value=u,Qg(r),a.state=u,r=a.pending,r!==null&&(u=r.next,u===r?a.pending=null:(u=u.next,r.next=u,Pg(a,u)))}function ip(a,r,u){var m=a.pending;if(a.pending=null,m!==null){m=m.next;do r.status="rejected",r.reason=u,Qg(r),r=r.next;while(r!==m)}a.action=null}function Qg(a){a=a.listeners;for(var r=0;r<a.length;r++)(0,a[r])()}function lp(a,r){return r}function op(a,r){if(Ct){var u=tt.formState;if(u!==null){e:{var m=rt;if(Ct){if(on){t:{for(var S=on,N=Os;S.nodeType!==8;){if(!N){S=null;break t}if(S=$r(S.nextSibling),S===null){S=null;break t}}N=S.data,S=N==="F!"||N==="F"?S:null}if(S){on=$r(S.nextSibling),m=S.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:lp,lastRenderedState:r},u.queue=m,u=c0.bind(null,rt,m),m.dispatch=u,m=sp(!1),N=gp.bind(null,rt,!1,m.queue),m=ca(),S={state:r,dispatch:null,action:a,pending:null},m.queue=S,u=py.bind(null,rt,S,N,u),S.dispatch=u,m.memoizedState=a,[r,u,!1]}function Kg(a){var r=Zn();return cp(r,tn,a)}function cp(a,r,u){if(r=np(a,r,lp)[0],a=Id(xi)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var m=gu(r)}catch(A){throw A===Ml?ft:A}else m=r;r=Zn();var S=r.queue,N=S.dispatch;return u!==r.memoizedState&&(rt.flags|=2048,Xi(9,{destroy:void 0},Xg.bind(null,S,u),null)),[m,N,a]}function Xg(a,r){a.action=r}function up(a){var r=Zn(),u=tn;if(u!==null)return cp(r,u,a);Zn(),r=r.memoizedState,u=Zn();var m=u.queue.dispatch;return u.memoizedState=a,[r,m,!1]}function Xi(a,r,u,m){return a={tag:a,create:u,deps:m,inst:r,next:null},r=rt.updateQueue,r===null&&(r=Jd(),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 Zn().memoizedState}function $d(a,r,u,m){var S=ca();rt.flags|=a,S.memoizedState=Xi(1|r,{destroy:void 0},u,m===void 0?null:m)}function ef(a,r,u,m){var S=Zn();m=m===void 0?null:m;var N=S.memoizedState.inst;tn!==null&&m!==null&&Ih(m,tn.memoizedState.deps)?S.memoizedState=Xi(r,N,u,m):(rt.flags|=a,S.memoizedState=Xi(1|r,N,u,m))}function Fg(a,r){$d(8390656,8,a,r)}function dp(a,r){ef(2048,8,a,r)}function Zg(a){rt.flags|=4;var r=rt.updateQueue;if(r===null)r=Jd(),rt.updateQueue=r,r.events=[a];else{var u=r.events;u===null?r.events=[a]:u.push(a)}}function Jg(a){var r=Zn().memoizedState;return Zg({ref:r,nextImpl:a}),function(){if((Ye&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function Ig(a,r){return ef(4,2,a,r)}function Wg(a,r){return ef(4,4,a,r)}function $g(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 e0(a,r,u){u=u!=null?u.concat([a]):null,ef(4,4,$g.bind(null,r,a),u)}function fp(){}function t0(a,r){var u=Zn();r=r===void 0?null:r;var m=u.memoizedState;return r!==null&&Ih(r,m[1])?m[0]:(u.memoizedState=[a,r],a)}function n0(a,r){var u=Zn();r=r===void 0?null:r;var m=u.memoizedState;if(r!==null&&Ih(r,m[1]))return m[0];if(m=a(),Ul){is(!0);try{a()}finally{is(!1)}}return u.memoizedState=[m,r],m}function hp(a,r,u){return u===void 0||(vn&1073741824)!==0&&(dt&261930)===0?a.memoizedState=r:(a.memoizedState=u,a=bt(),rt.lanes|=a,Jr|=a,u)}function a0(a,r,u,m){return Fa(u,r)?u:Yo.current!==null?(a=hp(a,u,m),Fa(a,r)||(na=!0),a):(vn&42)===0||(vn&1073741824)!==0&&(dt&261930)===0?(na=!0,a.memoizedState=u):(a=bt(),rt.lanes|=a,Jr|=a,r)}function s0(a,r,u,m,S){var N=$.p;$.p=N!==0&&8>N?N:8;var A=Y.T,B={};Y.T=B,gp(a,!1,r,u);try{var X=S(),oe=Y.S;if(oe!==null&&oe(B,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var xe=Vh(X,m);yu(a,r,xe,Us(a))}else yu(a,r,m,Us(a))}catch(Se){yu(a,r,{then:function(){},status:"rejected",reason:Se},Us())}finally{$.p=N,A!==null&&B.types!==null&&(A.types=B.types),Y.T=A}}function my(){}function pp(a,r,u,m){if(a.tag!==5)throw Error(s(476));var S=r0(a).queue;s0(a,S,r,ae,u===null?my:function(){return i0(a),u(m)})}function r0(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 i0(a){var r=r0(a);r.next===null&&(r=a.alternate.memoizedState),yu(a,r.next.queue,{},Us())}function mp(){return We(Up)}function l0(){return Zn().memoizedState}function o0(){return Zn().memoizedState}function gy(a){for(var r=a.return;r!==null;){switch(r.tag){case 24:case 3:var u=Us();a=gi(u);var m=Vi(r,a,u);m!==null&&(pt(m,r,u),Qi(m,r,u)),r={cache:Gh()},a.payload=r;return}r=r.return}}function yy(a,r,u){var m=Us();u={lane:m,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},tf(a)?u0(r,u):(u=Ad(a,r,u,m),u!==null&&(pt(u,a,m),d0(u,r,m)))}function c0(a,r,u){var m=Us();yu(a,r,u,m)}function yu(a,r,u,m){var S={lane:m,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(tf(a))u0(r,S);else{var N=a.alternate;if(a.lanes===0&&(N===null||N.lanes===0)&&(N=r.lastRenderedReducer,N!==null))try{var A=r.lastRenderedState,B=N(A,u);if(S.hasEagerState=!0,S.eagerState=B,Fa(B,A))return Sa(a,r,S,0),tt===null&&iu(),!1}catch{}finally{}if(u=Ad(a,r,S,m),u!==null)return pt(u,a,m),d0(u,r,m),!0}return!1}function gp(a,r,u,m){if(m={lane:2,revertLane:pe(),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 u0(a,r){Vo=Js=!0;var u=a.pending;u===null?r.next=r:(r.next=u.next,u.next=r),a.pending=r}function d0(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:We,use:Ki,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 f0={readContext:We,use:Ki,useCallback:function(a,r){return ca().memoizedState=[a,r===void 0?null:r],a},useContext:We,useEffect:Fg,useImperativeHandle:function(a,r,u){u=u!=null?u.concat([a]):null,$d(4194308,4,$g.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(Ul){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 S=u(r);if(Ul){is(!0);try{u(r)}finally{is(!1)}}}else S=r;return m.memoizedState=m.baseState=S,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:S},m.queue=a,a=a.dispatch=yy.bind(null,rt,a),[m.memoizedState,a]},useRef:function(a){var r=ca();return a={current:a},r.memoizedState=a},useState:function(a){a=sp(a);var r=a.queue,u=c0.bind(null,rt,r);return r.dispatch=u,[a.memoizedState,u]},useDebugValue:fp,useDeferredValue:function(a,r){var u=ca();return hp(u,a,r)},useTransition:function(){var a=sp(!1);return a=s0.bind(null,rt,a.queue,!0,!1),ca().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,r,u){var m=rt,S=ca();if(Ct){if(u===void 0)throw Error(s(407));u=u()}else{if(u=r(),tt===null)throw Error(s(349));(dt&127)!==0||Ug(m,r,u)}S.memoizedState=u;var N={value:u,getSnapshot:r};return S.queue=N,Fg(Hg.bind(null,m,N,a),[a]),m.flags|=2048,Xi(9,{destroy:void 0},qg.bind(null,m,N,u,r),null),u},useId:function(){var a=ca(),r=tt.identifierPrefix;if(Ct){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=Jh++,r="_"+r+"r_"+u.toString(32)+"_";return a.memoizedState=r},useHostTransitionStatus:mp,useFormState:op,useActionState:op,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=gp.bind(null,rt,!0,u),u.dispatch=r,[a,r]},useMemoCache:tp,useCacheRefresh:function(){return ca().memoizedState=gy.bind(null,rt)},useEffectEvent:function(a){var r=ca(),u={impl:a};return r.memoizedState=u,function(){if((Ye&2)!==0)throw Error(s(440));return u.impl.apply(void 0,arguments)}}},yp={readContext:We,use:Ki,useCallback:t0,useContext:We,useEffect:dp,useImperativeHandle:e0,useInsertionEffect:Ig,useLayoutEffect:Wg,useMemo:n0,useReducer:Id,useRef:Wd,useState:function(){return Id(xi)},useDebugValue:fp,useDeferredValue:function(a,r){var u=Zn();return a0(u,tn.memoizedState,a,r)},useTransition:function(){var a=Id(xi)[0],r=Zn().memoizedState;return[typeof a=="boolean"?a:gu(a),r]},useSyncExternalStore:Lg,useId:l0,useHostTransitionStatus:mp,useFormState:Kg,useActionState:Kg,useOptimistic:function(a,r){var u=Zn();return rp(u,tn,a,r)},useMemoCache:tp,useCacheRefresh:o0};yp.useEffectEvent=Jg;var Is={readContext:We,use:Ki,useCallback:t0,useContext:We,useEffect:dp,useImperativeHandle:e0,useInsertionEffect:Ig,useLayoutEffect:Wg,useMemo:n0,useReducer:ap,useRef:Wd,useState:function(){return ap(xi)},useDebugValue:fp,useDeferredValue:function(a,r){var u=Zn();return tn===null?hp(u,a,r):a0(u,tn.memoizedState,a,r)},useTransition:function(){var a=ap(xi)[0],r=Zn().memoizedState;return[typeof a=="boolean"?a:gu(a),r]},useSyncExternalStore:Lg,useId:l0,useHostTransitionStatus:mp,useFormState:up,useActionState:up,useOptimistic:function(a,r){var u=Zn();return tn!==null?rp(u,tn,a,r):(u.baseState=a,[a,u.queue.dispatch])},useMemoCache:tp,useCacheRefresh:o0};Is.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(),S=gi(m);S.payload=r,u!=null&&(S.callback=u),r=Vi(a,S,m),r!==null&&(pt(r,a,m),Qi(r,a,m))},enqueueReplaceState:function(a,r,u){a=a._reactInternals;var m=Us(),S=gi(m);S.tag=1,S.payload=r,u!=null&&(S.callback=u),r=Vi(a,S,m),r!==null&&(pt(r,a,m),Qi(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=Vi(a,m,u),r!==null&&(pt(r,a,u),Qi(r,a,u))}};function xp(a,r,u,m,S,N,A){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(m,N,A):r.prototype&&r.prototype.isPureReactComponent?!To(u,m)||!To(S,N):!0}function bp(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 Fi(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 S in a)u[S]===void 0&&(u[S]=a[S])}return u}function h0(a){ru(a)}function vp(a){console.error(a)}function Sp(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 p0(a,r,u){try{var m=a.onCaughtError;m(u.value,{componentStack:u.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(S){setTimeout(function(){throw S})}}function Np(a,r,u){return u=gi(u),u.tag=3,u.payload={element:null},u.callback=function(){af(a,r)},u}function _p(a){return a=gi(a),a.tag=3,a}function m0(a,r,u,m){var S=u.type.getDerivedStateFromError;if(typeof S=="function"){var N=m.value;a.payload=function(){return S(N)},a.callback=function(){p0(r,u,m)}}var A=u.stateNode;A!==null&&typeof A.componentDidCatch=="function"&&(a.callback=function(){p0(r,u,m),typeof S!="function"&&(Wn===null?Wn=new Set([this]):Wn.add(this));var B=m.stack;this.componentDidCatch(m.value,{componentStack:B!==null?B:""})})}function ua(a,r,u,m,S){if(u.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(r=u.alternate,r!==null&&Pr(r,u,S,!0),u=fs.current,u!==null){switch(u.tag){case 31:case 13:return Ia===null?$o():u.alternate===null&&Dn===0&&(Dn=3),u.flags&=-257,u.flags|=65536,u.lanes=S,m===Yd?u.flags|=16384:(r=u.updateQueue,r===null?u.updateQueue=new Set([m]):r.add(m),Ou(a,m,S)),!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,S)),!1}throw Error(s(435,u.tag))}return Ou(a,m,S),$o(),!1}if(Ct)return r=fs.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=S,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,S&=-S,a.lanes|=S,m=Rs(m,u),S=Np(a.stateNode,m,S),Qe(a,S),Dn!==4&&(Dn=2)),!1;var N=Error(s(520),{cause:m});if(N=Rs(N,u),Xl===null?Xl=[N]:Xl.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=S&-S,u.lanes|=a,a=Np(u.stateNode,m,a),Qe(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"&&(Wn===null||!Wn.has(N))))return u.flags|=65536,S&=-S,u.lanes|=S,S=_p(S),m0(S,a,u,m),Qe(u,S),!1}u=u.return}while(u!==null);return!1}var sf=Error(s(461)),na=!1;function Na(a,r,u,m){r.child=a===null?Kd(r,null,u,m):mi(r,a.child,u,m)}function jp(a,r,u,m,S){u=u.render;var N=r.ref;if("ref"in m){var A={};for(var B in m)B!=="ref"&&(A[B]=m[B])}else A=m;return Pi(r),m=Zd(a,r,u,A,N,S),B=Wh(),a!==null&&!na?($h(a,r,S),Jn(a,r,S)):(Ct&&B&&Ur(r),r.flags|=1,Na(a,r,m,S),r.child)}function Bl(a,r,u,m,S){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,S)):(a=kr(u.type,null,m,r,r.mode,S),a.ref=r.ref,a.return=r,r.child=a)}if(N=a.child,!ff(a,S)){var A=N.memoizedProps;if(u=u.compare,u=u!==null?u:To,u(A,m)&&a.ref===r.ref)return Jn(a,r,S)}return r.flags|=1,a=cs(N,m),a.ref=r.ref,a.return=r,r.child=a}function rf(a,r,u,m,S){if(a!==null){var N=a.memoizedProps;if(To(N,m)&&a.ref===r.ref)if(na=!1,r.pendingProps=m=N,ff(a,S))(a.flags&131072)!==0&&(na=!0);else return r.lanes=a.lanes,Jn(a,r,S)}return Xo(a,r,u,m,S)}function Gl(a,r,u,m){var S=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,S=0;m!==null;)S=S|m.lanes|m.childLanes,m=m.sibling;m=S&~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?Dg(r,N):Fh(),zg(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),Dg(r,N),hs(),r.memoizedState=null):(a!==null&&cu(r,null),Fh(),hs());return Na(a,r,S,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,S){var N=Pd();return N=N===null?null:{parent:ta._currentValue,pool:N},r.memoizedState={baseLanes:u,cachePool:N},a!==null&&cu(r,null),Fh(),zg(r),a!==null&&Pr(a,r,m,!0),r.childLanes=S,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 g0(a,r,u){return mi(r,a.child,null,u),a=lf(r,r.pendingProps),a.flags|=2,Fn(r),r.memoizedState=null,a}function of(a,r,u){var m=r.pendingProps,S=(r.flags&128)!==0;if(r.flags&=-129,a===null){if(Ct){if(m.mode==="hidden")return a=lf(r,m),r.lanes=536870912,Vr(null,a);if(Zh(r),(a=on)?(a=Qv(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(Zh(r),S)if(r.flags&256)r.flags&=-257,r=g0(a,r,u);else if(r.memoizedState!==null)r.child=a.child,r.flags|=128,r=null;else throw Error(s(558));else if(na||Pr(a,r,u,!1),S=(u&a.childLanes)!==0,na||S){if(m=tt,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=g0(a,r,u)}else a=N.treeContext,on=$r(A.nextSibling),Bn=r,Ct=!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 Pl(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,S){return Pi(r),u=Zd(a,r,u,m,void 0,S),m=Wh(),a!==null&&!na?($h(a,r,S),Jn(a,r,S)):(Ct&&m&&Ur(r),r.flags|=1,Na(a,r,u,S),r.child)}function bu(a,r,u,m,S,N){return Pi(r),r.updateQueue=null,u=ql(r,m,u,S),kg(a),m=Wh(),a!==null&&!na?($h(a,r,N),Jn(a,r,N)):(Ct&&m&&Ur(r),r.flags|=1,Na(a,r,u,N),r.child)}function cf(a,r,u,m,S){if(Pi(r),r.stateNode===null){var N=Li,A=u.contextType;typeof A=="object"&&A!==null&&(N=We(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?We(A):Li,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,S),hu(),N.state=r.memoizedState),typeof N.componentDidMount=="function"&&(r.flags|=4194308),m=!0}else if(a===null){N=r.stateNode;var B=r.memoizedProps,X=Fi(u,B);N.props=X;var oe=N.context,xe=u.contextType;A=Li,typeof xe=="object"&&xe!==null&&(A=We(xe));var Se=u.getDerivedStateFromProps;xe=typeof Se=="function"||typeof N.getSnapshotBeforeUpdate=="function",B=r.pendingProps!==B,xe||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(B||oe!==A)&&bp(r,N,m,A),Ja=!1;var de=r.memoizedState;N.state=de,Go(r,m,N,S),hu(),oe=r.memoizedState,B||de!==oe||Ja?(typeof Se=="function"&&(nf(r,u,Se,m),oe=r.memoizedState),(X=Ja||xp(r,u,X,m,de,oe,A))?(xe||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,Kh(a,r),A=r.memoizedProps,xe=Fi(u,A),N.props=xe,Se=r.pendingProps,de=N.context,oe=u.contextType,X=Li,typeof oe=="object"&&oe!==null&&(X=We(oe)),B=u.getDerivedStateFromProps,(oe=typeof B=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(A!==Se||de!==X)&&bp(r,N,m,X),Ja=!1,de=r.memoizedState,N.state=de,Go(r,m,N,S),hu();var ye=r.memoizedState;A!==Se||de!==ye||Ja||a!==null&&a.dependencies!==null&&ou(a.dependencies)?(typeof B=="function"&&(nf(r,u,B,m),ye=r.memoizedState),(xe=Ja||xp(r,u,xe,m,de,ye,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,ye,X),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(m,ye,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=ye),N.props=m,N.state=ye,N.context=X,m=xe):(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,Pl(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,S),r.child=mi(r,null,u,S)):Na(a,r,u,S),r.memoizedState=N.state,a=r.child):a=Jn(a,r,S),a}function y0(a,r,u,m){return Bi(),r.flags|=256,Na(a,r,u,m),r.child}var Cp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ga(a){return{baseLanes:a,cachePool:Qh()}}function uf(a,r,u){return a=a!==null?a.childLanes&~u:0,r&&(a|=ts),a}function x0(a,r,u){var m=r.pendingProps,S=!1,N=(r.flags&128)!==0,A;if((A=N)||(A=a!==null&&a.memoizedState===null?!1:(wt.current&2)!==0),A&&(S=!0,r.flags&=-129),A=(r.flags&32)!==0,r.flags&=-33,a===null){if(Ct){if(S?yi(r):hs(),(a=on)?(a=Qv(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 My(a)?r.lanes=32:r.lanes=536870912,null}var B=m.children;return m=m.fallback,S?(hs(),S=r.mode,B=df({mode:"hidden",children:B},S),m=Ui(m,S,u,null),B.return=r,m.return=r,B.sibling=m,r.child=B,m=r.child,m.memoizedState=Ga(u),m.childLanes=uf(a,A,u),r.memoizedState=Cp,Vr(null,m)):(yi(r),vu(r,B))}var X=a.memoizedState;if(X!==null&&(B=X.dehydrated,B!==null)){if(N)r.flags&256?(yi(r),r.flags&=-257,r=wp(a,r,u)):r.memoizedState!==null?(hs(),r.child=a.child,r.flags|=128,r=null):(hs(),B=m.fallback,S=r.mode,m=df({mode:"visible",children:m.children},S),B=Ui(B,S,u,null),B.flags|=2,m.return=r,B.return=r,m.sibling=B,r.child=m,mi(r,a.child,null,u),m=r.child,m.memoizedState=Ga(u),m.childLanes=uf(a,A,u),r.memoizedState=Cp,r=Vr(null,m));else if(yi(r),My(B)){if(A=B.nextSibling&&B.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=wp(a,r,u)}else if(na||Pr(a,r,u,!1),A=(u&a.childLanes)!==0,na||A){if(A=tt,A!==null&&(m=Bs(A,u),m!==0&&m!==X.retryLane))throw X.retryLane=m,Za(a,m),pt(A,a,m),sf;Oy(B)||$o(),r=wp(a,r,u)}else Oy(B)?(r.flags|=192,r.child=a.child,r=null):(a=X.treeContext,on=$r(B.nextSibling),Bn=r,Ct=!0,fi=null,Os=!1,a!==null&&Ud(r,a),r=vu(r,m.children),r.flags|=4096);return r}return S?(hs(),B=m.fallback,S=r.mode,X=a.child,oe=X.sibling,m=cs(X,{mode:"hidden",children:m.children}),m.subtreeFlags=X.subtreeFlags&65011712,oe!==null?B=cs(oe,B):(B=Ui(B,S,u,null),B.flags|=2),B.return=r,m.return=r,m.sibling=B,r.child=m,Vr(null,m),m=r.child,B=a.child.memoizedState,B===null?B=Ga(u):(S=B.cachePool,S!==null?(X=ta._currentValue,S=S.parent!==X?{parent:X,pool:X}:S):S=Qh(),B={baseLanes:B.baseLanes|u,cachePool:S}),m.memoizedState=B,m.childLanes=uf(a,A,u),r.memoizedState=Cp,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 wp(a,r,u){return mi(r,a.child,null,u),a=vu(r,r.pendingProps.children),a.flags|=2,r.memoizedState=null,a}function b0(a,r,u){a.lanes|=r;var m=a.alternate;m!==null&&(m.lanes|=r),Hd(a.return,r,u)}function Yl(a,r,u,m,S,N){var A=a.memoizedState;A===null?a.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:m,tail:u,tailMode:S,treeForkCount:N}:(A.isBackwards=r,A.rendering=null,A.renderingStartTime=0,A.last=m,A.tail=u,A.tailMode=S,A.treeForkCount=N)}function ms(a,r,u){var m=r.pendingProps,S=m.revealOrder,N=m.tail;m=m.children;var A=wt.current,B=(A&2)!==0;if(B?(A=A&1|2,r.flags|=128):A&=1,fe(wt,A),Na(a,r,m,u),m=Ct?ko:0,!B&&a!==null&&(a.flags&128)!==0)e:for(a=r.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&b0(a,u,r);else if(a.tag===19)b0(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(S){case"forwards":for(u=r.child,S=null;u!==null;)a=u.alternate,a!==null&&As(a)===null&&(S=u),u=u.sibling;u=S,u===null?(S=r.child,r.child=null):(S=u.sibling,u.sibling=null),Yl(r,!1,S,u,N,m);break;case"backwards":case"unstable_legacy-backwards":for(u=null,S=r.child,r.child=null;S!==null;){if(a=S.alternate,a!==null&&As(a)===null){r.child=S;break}a=S.sibling,S.sibling=u,u=S,S=a}Yl(r,!0,u,null,N,m);break;case"together":Yl(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),Jr|=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 xy(a,r,u){switch(r.tag){case 3:nt(r,r.stateNode.containerInfo),hi(r,ta,a.memoizedState.cache),Bi();break;case 27:case 5:Vt(r);break;case 4:nt(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,Zh(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?x0(a,r,u):(yi(r),a=Jn(a,r,u),a!==null?a.sibling:null);yi(r);break;case 19:var S=(a.flags&128)!==0;if(m=(u&r.childLanes)!==0,m||(Pr(a,r,u,!1),m=(u&r.childLanes)!==0),S){if(m)return ms(a,r,u);r.flags|=128}if(S=r.memoizedState,S!==null&&(S.rendering=null,S.tail=null,S.lastEffect=null),fe(wt,wt.current),m)break;return null;case 22:return r.lanes=0,Gl(a,r,u,r.pendingProps);case 24:hi(r,ta,a.memoizedState.cache)}return Jn(a,r,u)}function hf(a,r,u){if(a!==null)if(a.memoizedProps!==r.pendingProps)na=!0;else{if(!ff(a,u)&&(r.flags&128)===0)return na=!1,xy(a,r,u);na=(a.flags&131072)!==0}else na=!1,Ct&&(r.flags&1048576)!==0&&wg(r,ko,r.index);switch(r.lanes=0,r.tag){case 16:e:{var m=r.pendingProps;if(a=Al(r.elementType),r.type=a,typeof a=="function")Dd(a)?(m=Fi(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 S=a.$$typeof;if(S===k){r.tag=11,r=jp(null,r,a,m,u);break e}else if(S===L){r.tag=14,r=Bl(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,S=Fi(m,r.pendingProps),cf(a,r,m,S,u);case 3:e:{if(nt(r,r.stateNode.containerInfo),a===null)throw Error(s(387));m=r.pendingProps;var N=r.memoizedState;S=N.element,Kh(a,r),Go(r,m,null,u);var A=r.memoizedState;if(m=A.cache,hi(r,ta,m),m!==N.cache&&Bd(r,[ta],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=y0(a,r,m,u);break e}else if(m!==S){S=Rs(Error(s(424)),r),Hr(S),r=y0(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,Ct=!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(Bi(),m===S){r=Jn(a,r,u);break e}Na(a,r,m,u)}r=r.child}return r;case 26:return Pl(a,r),a===null?(u=Iv(r.type,null,r.pendingProps,null))?r.memoizedState=u:Ct||(u=r.type,a=r.pendingProps,m=_0(me.current).createElement(u),m[Fe]=r,m[ut]=a,as(m,u,a),Tn(m),r.stateNode=m):r.memoizedState=Iv(r.type,a.memoizedProps,r.pendingProps,a.memoizedState),null;case 27:return Vt(r),a===null&&Ct&&(m=r.stateNode=Fv(r.type,r.pendingProps,me.current),Bn=r,Os=!0,S=on,ac(r.type)?(Ay=S,on=$r(m.firstChild)):on=S),Na(a,r,r.pendingProps.children,u),Pl(a,r),a===null&&(r.flags|=4194304),r.child;case 5:return a===null&&Ct&&((S=m=on)&&(m=d7(m,r.type,r.pendingProps,Os),m!==null?(r.stateNode=m,Bn=r,on=$r(m.firstChild),Os=!1,S=!0):S=!1),S||qr(r)),Vt(r),S=r.type,N=r.pendingProps,A=a!==null?a.memoizedProps:null,m=N.children,Ey(S,N)?m=null:A!==null&&Ey(S,A)&&(r.flags|=32),r.memoizedState!==null&&(S=Zd(a,r,Hl,null,null,u),Up._currentValue=S),Pl(a,r),Na(a,r,m,u),r.child;case 6:return a===null&&Ct&&((a=u=on)&&(u=f7(u,r.pendingProps,Os),u!==null?(r.stateNode=u,Bn=r,on=null,a=!0):a=!1),a||qr(r)),null;case 13:return x0(a,r,u);case 4:return nt(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 jp(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 S=r.type._context,m=r.pendingProps.children,Pi(r),S=We(S),m=m(S),r.flags|=1,Na(a,r,m,u),r.child;case 14:return Bl(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 Gl(a,r,u,r.pendingProps);case 24:return Pi(r),m=We(ta),a===null?(S=Pd(),S===null&&(S=tt,N=Gh(),S.pooledCache=N,N.refCount++,N!==null&&(S.pooledCacheLanes|=u),S=N),r.memoizedState={parent:m,cache:S},fu(r),hi(r,ta,S)):((a.lanes&u)!==0&&(Kh(a,r),Go(r,null,null,u),hu()),S=a.memoizedState,N=r.memoizedState,S.parent!==m?(S={parent:m,cache:m},r.memoizedState=S,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=S),hi(r,ta,m)):(m=N.cache,hi(r,ta,m),m!==S.cache&&Bd(r,[ta],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,S){if((r=(a.mode&32)!==0)&&(r=!1),r){if(a.flags|=16777216,(S&335544128)===S)if(a.stateNode.complete)a.flags|=8192;else if(kn())a.flags|=8192;else throw Yr=Yd,uu}else a.flags&=-16777217}function Ep(a,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!n2(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(!Ct)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 S=a.child;S!==null;)u|=S.lanes|S.childLanes,m|=S.subtreeFlags&65011712,m|=S.flags&65011712,S.return=a,S=S.sibling;else for(S=a.child;S!==null;)u|=S.lanes|S.childLanes,m|=S.subtreeFlags,m|=S.flags,S.return=a,S=S.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(ta),ze(),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 S=r.type,N=r.memoizedState;return a===null?(Qr(r),N!==null?(nn(r),Ep(r,N)):(nn(r),Su(r,S,null,m,u))):N?N!==a.memoizedState?(Qr(r),nn(r),Ep(r,N)):(nn(r),r.flags&=-16777217):(a=a.memoizedProps,a!==m&&Qr(r),nn(r),Su(r,S,a,m,u)),null;case 27:if($e(r),u=me.current,S=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=be.current,Uo(r)?Eg(r):(a=Fv(S,m,u),r.stateNode=a,Qr(r))}return nn(r),null;case 5:if($e(r),S=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=be.current,Uo(r))Eg(r);else{var A=_0(me.current);switch(N){case 1:N=A.createElementNS("http://www.w3.org/2000/svg",S);break;case 2:N=A.createElementNS("http://www.w3.org/1998/Math/MathML",S);break;default:switch(S){case"svg":N=A.createElementNS("http://www.w3.org/2000/svg",S);break;case"math":N=A.createElementNS("http://www.w3.org/1998/Math/MathML",S);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(S,{is:m.is}):A.createElement(S)}}N[Fe]=r,N[ut]=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,S,m),S){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=me.current,Uo(r)){if(a=r.stateNode,u=r.memoizedProps,m=null,S=Bn,S!==null)switch(S.tag){case 27:case 5:m=S.memoizedProps}a[Fe]=r,a=!!(a.nodeValue===u||m!==null&&m.suppressHydrationWarning===!0||Uv(a.nodeValue,u)),a||qr(r,!0)}else a=_0(a).createTextNode(m),a[Fe]=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[Fe]=r}else Bi(),(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?(Fn(r),r):(Fn(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(S=Uo(r),m!==null&&m.dehydrated!==null){if(a===null){if(!S)throw Error(s(318));if(S=r.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(s(317));S[Fe]=r}else Bi(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;nn(r),S=!1}else S=qd(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=S),S=!0;if(!S)return r.flags&256?(Fn(r),r):(Fn(r),null)}return Fn(r),(r.flags&128)!==0?(r.lanes=u,r):(u=m!==null,a=a!==null&&a.memoizedState!==null,u&&(m=r.child,S=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(S=m.alternate.memoizedState.cachePool.pool),N=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(N=m.memoizedState.cachePool.pool),N!==S&&(m.flags|=2048)),u!==a&&u&&(r.child.flags|=8192),bi(r,r.updateQueue),nn(r),null);case 4:return ze(),a===null&&Ny(r.stateNode.containerInfo),nn(r),null;case 10:return Gr(r.type),nn(r),null;case 19:if(W(wt),m=r.memoizedState,m===null)return nn(r),null;if(S=(r.flags&128)!==0,N=m.rendering,N===null)if(S)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),Ct&&Lr(r,m.treeForkCount),r.child}a=a.sibling}m.tail!==null&&Kn()>In&&(r.flags|=128,S=!0,Kr(m,!1),r.lanes=4194304)}else{if(!S)if(a=As(N),a!==null){if(r.flags|=128,S=!0,a=a.updateQueue,r.updateQueue=a,bi(r,a),Kr(m,!0),m.tail===null&&m.tailMode==="hidden"&&!N.alternate&&!Ct)return nn(r),null}else 2*Kn()-m.renderingStartTime>In&&u!==536870912&&(r.flags|=128,S=!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=Kn(),a.sibling=null,u=wt.current,fe(wt,S?u&1|2:u&1),Ct&&Lr(r,m.treeForkCount),a):(nn(r),null);case 22:case 23:return Fn(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&&W(Yi),null;case 24:return u=null,a!==null&&(u=a.memoizedState.cache),r.memoizedState.cache!==u&&(r.flags|=2048),Gr(ta),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(ta),ze(),a=r.flags,(a&65536)!==0&&(a&128)===0?(r.flags=a&-65537|128,r):null;case 26:case 27:case 5:return $e(r),null;case 31:if(r.memoizedState!==null){if(Fn(r),r.alternate===null)throw Error(s(340));Bi()}return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 13:if(Fn(r),a=r.memoizedState,a!==null&&a.dehydrated!==null){if(r.alternate===null)throw Error(s(340));Bi()}return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 19:return W(wt),null;case 4:return ze(),null;case 10:return Gr(r.type),null;case 22:case 23:return Fn(r),pu(),a!==null&&W(Yi),a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 24:return Gr(ta),null;case 25:return null;default:return null}}function Ds(a,r){switch(Ld(r),r.tag){case 3:Gr(ta),ze();break;case 26:case 27:case 5:$e(r);break;case 4:ze();break;case 31:r.memoizedState!==null&&Fn(r);break;case 13:Fn(r);break;case 19:W(wt);break;case 10:Gr(r.type);break;case 22:case 23:Fn(r),pu(),a!==null&&W(Yi);break;case 24:Gr(ta)}}function $s(a,r){try{var u=r.updateQueue,m=u!==null?u.lastEffect:null;if(m!==null){var S=m.next;u=S;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!==S)}}catch(B){Ut(r,r.return,B)}}function Ma(a,r,u){try{var m=r.updateQueue,S=m!==null?m.lastEffect:null;if(S!==null){var N=S.next;m=N;do{if((m.tag&a)===a){var A=m.inst,B=A.destroy;if(B!==void 0){A.destroy=void 0,S=r;var X=u,oe=B;try{oe()}catch(xe){Ut(S,X,xe)}}}m=m.next}while(m!==N)}}catch(xe){Ut(r,r.return,xe)}}function xr(a){var r=a.updateQueue;if(r!==null){var u=a.stateNode;try{Ag(r,u)}catch(m){Ut(a,a.return,m)}}}function _a(a,r,u){u.props=Fi(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(S){Ut(a,r,S)}}function Aa(a,r){var u=a.ref,m=a.refCleanup;if(u!==null)if(typeof m=="function")try{m()}catch(S){Ut(a,r,S)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(S){Ut(a,r,S)}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(S){Ut(a,a.return,S)}}function da(a,r,u){try{var m=a.stateNode;r7(m,a.type,u,r),m[ut]=r}catch(S){Ut(a,a.return,S)}}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,S=r.attributes;S.length;)r.removeAttributeNode(S[0]);as(r,m,u),r[Fe]=a,r[ut]=u}catch(N){Ut(a,a.return,N)}}var er=!1,cn=!1,br=!1,v0=typeof WeakSet=="function"?WeakSet:Set,ja=null;function by(a,r){if(a=a.containerInfo,Cy=O0,a=Ng(a),Lh(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 S=m.anchorOffset,N=m.focusNode;m=m.focusOffset;try{u.nodeType,N.nodeType}catch{u=null;break e}var A=0,B=-1,X=-1,oe=0,xe=0,Se=a,de=null;t:for(;;){for(var ye;Se!==u||S!==0&&Se.nodeType!==3||(B=A+S),Se!==N||m!==0&&Se.nodeType!==3||(X=A+m),Se.nodeType===3&&(A+=Se.nodeValue.length),(ye=Se.firstChild)!==null;)de=Se,Se=ye;for(;;){if(Se===a)break t;if(de===u&&++oe===S&&(B=A),de===N&&++xe===m&&(X=A),(ye=Se.nextSibling)!==null)break;Se=de,de=Se.parentNode}Se=ye}u=B===-1||X===-1?null:{start:B,end:X}}else u=null}u=u||{start:0,end:0}}else u=null;for(wy={focusedElem:a,selectionRange:u},O0=!1,ja=r;ja!==null;)if(r=ja,a=r.child,(r.subtreeFlags&1028)!==0&&a!==null)a.return=r,ja=a;else for(;ja!==null;){switch(r=ja,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++)S=a[u],S.ref.impl=S.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&N!==null){a=void 0,u=r,S=N.memoizedProps,N=N.memoizedState,m=u.stateNode;try{var He=Fi(u.type,S);a=m.getSnapshotBeforeUpdate(He,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)Ry(a);else if(u===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Ry(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,ja=a;break}ja=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 S=Fi(u.type,r.memoizedProps);r=r.memoizedState;try{a.componentDidUpdate(S,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{Ag(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&&Zi(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),h7(a,u))));break;case 22:if(m=u.memoizedState!==null||er,!m){r=r!==null&&r.memoizedState!==null||cn,S=er;var N=cn;er=m,(cn=r)&&!N?$a(a,u,(u.subtreeFlags&8772)!==0):ar(a,u),er=S,cn=N}break;case 30:break;default:ar(a,u)}}function ju(a){var r=a.alternate;r!==null&&(a.alternate=null,ju(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(ea&&typeof ea.onCommitFiberUnmount=="function")try{ea.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,S=Pa;ac(u.type)&&(It=u.stateNode,Pa=!1),tr(a,r,u),zp(u.stateNode),It=m,Pa=S;break;case 5:cn||Aa(u,r);case 6:if(m=It,S=Pa,It=null,tr(a,r,u),It=m,Pa=S,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,Yv(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,u.stateNode),_f(a)):Yv(It,u.stateNode));break;case 4:m=It,S=Pa,It=u.stateNode.containerInfo,Pa=!0,tr(a,r,u),It=m,Pa=S;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 Zi(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 Tp(a){switch(a.tag){case 31:case 13:case 19:var r=a.stateNode;return r===null&&(r=a.stateNode=new v0),r;case 22:return a=a.stateNode,r=a._retryCache,r===null&&(r=a._retryCache=new v0),r;default:throw Error(s(435,a.tag))}}function Si(a,r){var u=Tp(a);r.forEach(function(m){if(!u.has(m)){u.add(m);var S=x.bind(null,a,m);m.then(S,S)}})}function fa(a,r){var u=r.deletions;if(u!==null)for(var m=0;m<u.length;m++){var S=u[m],N=a,A=r,B=A;e:for(;B!==null;){switch(B.tag){case 27:if(ac(B.type)){It=B.stateNode,Pa=!1;break e}break;case 5:It=B.stateNode,Pa=!1;break e;case 3:case 4:It=B.stateNode.containerInfo,Pa=!0;break e}B=B.return}if(It===null)throw Error(s(160));mf(N,A,S),It=null,Pa=!1,N=S.alternate,N!==null&&(N.return=null),S.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 S=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,S=S.ownerDocument||S;t:switch(m){case"title":N=S.getElementsByTagName("title")[0],(!N||N[Ka]||N[Fe]||N.namespaceURI==="http://www.w3.org/2000/svg"||N.hasAttribute("itemprop"))&&(N=S.createElement(m),S.head.insertBefore(N,S.querySelector("head > title"))),as(N,m,u),N[Fe]=a,Tn(N),m=N;break e;case"link":var A=e2("link","href",S).get(m+(u.href||""));if(A){for(var B=0;B<A.length;B++)if(N=A[B],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(B,1);break t}}N=S.createElement(m),as(N,m,u),S.head.appendChild(N);break;case"meta":if(A=e2("meta","content",S).get(m+(u.content||""))){for(B=0;B<A.length;B++)if(N=A[B],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(B,1);break t}}N=S.createElement(m),as(N,m,u),S.head.appendChild(N);break;default:throw Error(s(468,m))}N[Fe]=a,Tn(N),m=N}a.stateNode=m}else t2(S,a.type,a.stateNode);else a.stateNode=$v(S,m,a.memoizedProps);else N!==m?(N===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):N.count--,m===null?t2(S,a.type,a.stateNode):$v(S,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){S=a.stateNode;try{Nl(S,"")}catch(He){Ut(a,a.return,He)}}m&4&&a.stateNode!=null&&(S=a.memoizedProps,da(a,S,u!==null?u.memoizedProps:S)),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(He){Ut(a,a.return,He)}}break;case 3:if(w0=null,S=nr,nr=j0(r.containerInfo),fa(r,a),nr=S,ha(a),m&4&&u!==null&&u.memoizedState.isDehydrated)try{_f(r.containerInfo)}catch(He){Ut(a,a.return,He)}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=Kn()),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,Si(a,m)));break;case 22:S=a.memoizedState!==null;var X=u!==null&&u.memoizedState!==null,oe=er,xe=cn;if(er=oe||S,cn=xe||X,fa(r,a),cn=xe,er=oe,ha(a),m&8192)e:for(r=a.stateNode,r._visibility=S?r._visibility&-2:r._visibility|1,S&&(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,S)A=N.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none";else{B=X.stateNode;var Se=X.memoizedProps.style,de=Se!=null&&Se.hasOwnProperty("display")?Se.display:null;B.style.display=de==null||typeof de=="boolean"?"":(""+de).trim()}}catch(He){Ut(X,X.return,He)}}}else if(r.tag===6){if(u===null){X=r;try{X.stateNode.nodeValue=S?"":X.memoizedProps}catch(He){Ut(X,X.return,He)}}}else if(r.tag===18){if(u===null){X=r;try{var ye=X.stateNode;S?Vv(ye,!0):Vv(X.stateNode,!1)}catch(He){Ut(X,X.return,He)}}}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 S=u.stateNode,N=Nt(a);Wa(a,N,S);break;case 5:var A=u.stateNode;u.flags&32&&(Nl(A,""),u.flags&=-33);var B=Nt(a);Wa(a,B,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(xe){Ut(a,a.return,xe)}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:zp(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,S=a,N=r,A=N.flags;switch(N.tag){case 0:case 11:case 15:$a(S,N,u),$s(4,N);break;case 1:if($a(S,N,u),m=N,S=m.stateNode,typeof S.componentDidMount=="function")try{S.componentDidMount()}catch(oe){Ut(m,m.return,oe)}if(m=N,S=m.updateQueue,S!==null){var B=m.stateNode;try{var X=S.shared.hiddenCallbacks;if(X!==null)for(S.shared.hiddenCallbacks=null,S=0;S<X.length;S++)Po(X[S],B)}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(S,N,u),u&&m===null&&A&4&&_u(N),vi(N,N.return);break;case 12:$a(S,N,u);break;case 31:$a(S,N,u),u&&A&4&&Zi(S,N);break;case 13:$a(S,N,u),u&&A&4&&Fo(S,N);break;case 22:N.memoizedState===null&&$a(S,N,u),vi(N,N.return);break;case 30:break;default:$a(S,N,u)}r=r.sibling}}function Ii(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&&Ol(u))}function Vl(a,r){a=null,r.alternate!==null&&(a=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==a&&(r.refCount++,a!=null&&Ol(a))}function Da(a,r,u,m){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Rp(a,r,u,m),r=r.sibling}function Rp(a,r,u,m){var S=r.flags;switch(r.tag){case 0:case 11:case 15:Da(a,r,u,m),S&2048&&$s(9,r);break;case 1:Da(a,r,u,m);break;case 3:Da(a,r,u,m),S&2048&&(a=null,r.alternate!==null&&(a=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==a&&(r.refCount++,a!=null&&Ol(a)));break;case 12:if(S&2048){Da(a,r,u,m),a=r.stateNode;try{var N=r.memoizedProps,A=N.id,B=N.onPostCommit;typeof B=="function"&&B(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)),S&2048&&Ii(A,r);break;case 24:Da(a,r,u,m),S&2048&&Vl(r.alternate,r);break;default:Da(a,r,u,m)}}function za(a,r,u,m,S){for(S=S&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var N=a,A=r,B=u,X=m,oe=A.flags;switch(A.tag){case 0:case 11:case 15:za(N,A,B,X,S),$s(8,A);break;case 23:break;case 22:var xe=A.stateNode;A.memoizedState!==null?xe._visibility&2?za(N,A,B,X,S):Zr(N,A):(xe._visibility|=2,za(N,A,B,X,S)),S&&oe&2048&&Ii(A.alternate,A);break;case 24:za(N,A,B,X,S),S&&oe&2048&&Vl(A.alternate,A);break;default:za(N,A,B,X,S)}r=r.sibling}}function Zr(a,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var u=a,m=r,S=m.flags;switch(m.tag){case 22:Zr(u,m),S&2048&&Ii(m.alternate,m);break;case 24:Zr(u,m),S&2048&&Vl(m.alternate,m);break;default:Zr(u,m)}r=r.sibling}}var Ql=8192;function zs(a,r,u){if(a.subtreeFlags&Ql)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&Ql&&a.memoizedState!==null&&C7(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=Ql,Ql=16777216,zs(a,r,u),Ql=m):zs(a,r,u));break;default:zs(a,r,u)}}function Kl(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 Wi(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];ja=m,Gn(m,a)}Kl(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:Wi(a),a.flags&2048&&Ma(9,a,a.return);break;case 3:Wi(a);break;case 12:Wi(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)):Wi(a);break;default:Wi(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];ja=m,Gn(m,a)}Kl(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(;ja!==null;){var u=ja;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:Ol(u.memoizedState.cache)}if(m=u.child,m!==null)m.return=u,ja=m;else e:for(u=a;ja!==null;){m=ja;var S=m.sibling,N=m.return;if(ju(m),m===u){ja=null;break e}if(S!==null){S.return=N,ja=S;break e}ja=N}}}var Ni={getCacheForType:function(a){var r=We(ta),u=r.data.get(a);return u===void 0&&(u=a(),r.data.set(a,u)),u},cacheSignal:function(){return We(ta).controller.signal}},it=typeof WeakMap=="function"?WeakMap:Map,Ye=0,tt=null,ht=null,dt=0,Rt=0,Ya=null,sr=!1,vr=!1,Op=!1,ks=0,Dn=0,Jr=0,$i=0,Cu=0,ts=0,mn=0,Xl=null,Pn=null,Yn=!1,Zo=0,Mp=0,In=1/0,zn=null,Wn=null,Wt=0,Ls=null,Jo=null,rr=0,Io=0,Wo=null,wu=null,el=0,Fl=null;function Us(){return(Ye&2)!==0&&dt!==0?dt&-dt:Y.T!==null?pe():Ve()}function bt(){if(ts===0)if((dt&536870912)===0||Ct){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===tt&&(Rt===2||Rt===9)||a.cancelPendingCommit!==null)&&(nl(a,0),aa(a,dt,ts,!1)),yn(a,u),((Ye&2)===0||a!==tt)&&(a===tt&&((Ye&2)===0&&($i|=u),Dn===4&&aa(a,dt,ts,!1)),Ce(a))}function vt(a,r,u){if((Ye&6)!==0)throw Error(s(327));var m=!u&&(r&127)===0&&(r&a.expiredLanes)===0||At(a,r),S=m?Eu(a,r):ns(a,r,!0),N=m;do{if(S===0){vr&&!m&&aa(a,r,0,!1);break}else{if(u=a.current.alternate,N&&!$t(u)){S=ns(a,r,!1),N=!1;continue}if(S===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 B=a;S=Xl;var X=B.current.memoizedState.isDehydrated;if(X&&(nl(B,A).flags|=256),A=ns(B,A,!1),A!==2){if(Op&&!X){B.errorRecoveryDisabledLanes|=N,$i|=N,S=4;break e}N=Pn,Pn=S,N!==null&&(Pn===null?Pn=N:Pn.push.apply(Pn,N))}S=A}if(N=!1,S!==2)continue}}if(S===1){nl(a,0),aa(a,r,0,!0);break}e:{switch(m=a,N=S,N){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:aa(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&&(S=Zo+300-Kn(),10<S)){if(aa(m,r,ts,!sr),Qt(m,0,!0)!==0)break e;rr=r,m.timeoutHandle=Gv(_t.bind(null,m,u,Pn,zn,Yn,r,ts,$i,mn,sr,N,"Throttled",-0,0),S);break e}_t(m,u,Pn,zn,Yn,r,ts,$i,mn,sr,N,null,-0,0)}}break}while(!0);Ce(a)}function _t(a,r,u,m,S,N,A,B,X,oe,xe,Se,de,ye){if(a.timeoutHandle=-1,Se=r.subtreeFlags,Se&8192||(Se&16785408)===16785408){Se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:oi},yf(r,N,Se);var He=(N&62914560)===N?Zo-Kn():(N&4194048)===N?Mp-Kn():0;if(He=w7(Se,He),He!==null){rr=N,a.cancelPendingCommit=He(ji.bind(null,a,r,N,u,m,S,A,B,X,xe,Se,null,de,ye)),aa(a,N,A,!oe);return}}ji(a,r,N,u,m,S,A,B,X)}function $t(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 S=u[m],N=S.getSnapshot;S=S.value;try{if(!Fa(N(),S))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 aa(a,r,u,m){r&=~Cu,r&=~$i,a.suspendedLanes|=r,a.pingedLanes&=~r,m&&(a.warmLanes|=r),m=a.expirationTimes;for(var S=r;0<S;){var N=31-ba(S),A=1<<N;m[N]=-1,S&=~A}u!==0&&oa(a,u,r)}function Sr(){return(Ye&6)===0?(Le(0),!1):!0}function tl(){if(ht!==null){if(Rt===0)var a=ht.return;else a=ht,Br=Gi=null,ep(a),kl=null,Ll=0,a=ht;for(;a!==null;)Ds(a.alternate,a),a=a.return;ht=null}}function nl(a,r){var u=a.timeoutHandle;u!==-1&&(a.timeoutHandle=-1,o7(u)),u=a.cancelPendingCommit,u!==null&&(a.cancelPendingCommit=null,u()),rr=0,tl(),tt=a,ht=u=cs(a.current,null),dt=r,Rt=0,Ya=null,sr=!1,vr=At(a,r),Op=!1,mn=ts=Cu=$i=Jr=Dn=0,Pn=Xl=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 S=31-ba(m),N=1<<S;r|=a[S],m&=~N}return ks=r,iu(),u}function Ir(a,r){rt=null,Y.H=Ko,r===Ml||r===ft?(r=Dl(),Rt=3):r===uu?(r=Dl(),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:(dt&4194048)===dt?Ia===null:(dt&62914560)===dt||(dt&536870912)!==0?a===Ia:!1}function _i(){var a=Y.H;return Y.H=Ko,a===null?Ko:a}function al(){var a=Y.A;return Y.A=Ni,a}function $o(){Dn=4,sr||(dt&4194048)!==dt&&fs.current!==null||(vr=!0),(Jr&134217727)===0&&($i&134217727)===0||tt===null||aa(tt,dt,ts,!1)}function ns(a,r,u){var m=Ye;Ye|=2;var S=_i(),N=al();(tt!==a||dt!==r)&&(zn=null,nl(a,r)),r=!1;var A=Dn;e:do try{if(Rt!==0&&ht!==null){var B=ht,X=Ya;switch(Rt){case 8:tl(),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,Zl(a,B,X,oe),u&&vr){A=0;break e}break;default:oe=Rt,Rt=0,Ya=null,Zl(a,B,X,oe)}}ec(),A=Dn;break}catch(xe){Ir(a,xe)}while(!0);return r&&a.shellSuspendCounter++,Br=Gi=null,Ye=m,Y.H=S,Y.A=N,ht===null&&(tt=null,dt=0,iu()),A}function ec(){for(;ht!==null;)xf(ht)}function Eu(a,r){var u=Ye;Ye|=2;var m=_i(),S=al();tt!==a||dt!==r?(zn=null,In=Kn()+500,nl(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,Zl(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||tt!==a||(Rt=7),Ce(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,Zl(a,r,N,7));break;case 5:var A=null;switch(ht.tag){case 26:A=ht.memoizedState;case 5:case 27:var B=ht;if(A?n2(A):B.stateNode.complete){Rt=0,Ya=null;var X=B.sibling;if(X!==null)ht=X;else{var oe=B.return;oe!==null?(ht=oe,sl(oe)):ht=null}break t}}Rt=0,Ya=null,Zl(a,r,N,5);break;case 6:Rt=0,Ya=null,Zl(a,r,N,6);break;case 8:tl(),Dn=6;break e;default:throw Error(s(462))}}ys();break}catch(xe){Ir(a,xe)}while(!0);return Br=Gi=null,Y.H=m,Y.A=S,Ye=u,ht!==null?0:(tt=null,dt=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?sl(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,dt);break;case 11:r=bu(u,r,r.pendingProps,r.type.render,r.ref,dt);break;case 5:ep(r);default:Ds(u,r),r=ht=Ao(r,ks),r=hf(u,r,ks)}a.memoizedProps=a.pendingProps,r===null?sl(a):ht=r}function Zl(a,r,u,m){Br=Gi=null,ep(r),kl=null,Ll=0;var S=r.return;try{if(ua(a,S,r,u,dt)){Dn=1,af(a,Rs(u,a.current)),ht=null;return}}catch(N){if(S!==null)throw ht=S,N;Dn=1,af(a,Rs(u,a.current)),ht=null;return}r.flags&32768?(Ct||m===1?a=!0:vr||(dt&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)):sl(r)}function sl(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 ji(a,r,u,m,S,N,A,B,X){a.cancelPendingCommit=null;do tc();while(Wt!==0);if((Ye&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,B,X),a===tt&&(ht=tt=null,dt=0),Jo=r,Ls=a,rr=u,Io=N,Wo=S,wu=m,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,j(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,S=$.p,$.p=2,A=Ye,Ye|=4;try{by(a,r,u)}finally{Ye=A,$.p=S,Y.T=m}}Wt=1,sa(),Ci(),Jl()}}function sa(){if(Wt===1){Wt=0;var a=Ls,r=Jo,u=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||u){u=Y.T,Y.T=null;var m=$.p;$.p=2;var S=Ye;Ye|=4;try{Ji(r,a);var N=wy,A=Ng(a.containerInfo),B=N.focusedElem,X=N.selectionRange;if(A!==B&&B&&B.ownerDocument&&ln(B.ownerDocument.documentElement,B)){if(X!==null&&Lh(B)){var oe=X.start,xe=X.end;if(xe===void 0&&(xe=oe),"selectionStart"in B)B.selectionStart=oe,B.selectionEnd=Math.min(xe,B.value.length);else{var Se=B.ownerDocument||document,de=Se&&Se.defaultView||window;if(de.getSelection){var ye=de.getSelection(),He=B.textContent.length,Je=Math.min(X.start,He),dn=X.end===void 0?Je:Math.min(X.end,He);!ye.extend&&Je>dn&&(A=dn,dn=Je,Je=A);var te=Ro(B,Je),J=Ro(B,dn);if(te&&J&&(ye.rangeCount!==1||ye.anchorNode!==te.node||ye.anchorOffset!==te.offset||ye.focusNode!==J.node||ye.focusOffset!==J.offset)){var le=Se.createRange();le.setStart(te.node,te.offset),ye.removeAllRanges(),Je>dn?(ye.addRange(le),ye.extend(J.node,J.offset)):(le.setEnd(J.node,J.offset),ye.addRange(le))}}}}for(Se=[],ye=B;ye=ye.parentNode;)ye.nodeType===1&&Se.push({element:ye,left:ye.scrollLeft,top:ye.scrollTop});for(typeof B.focus=="function"&&B.focus(),B=0;B<Se.length;B++){var ve=Se[B];ve.element.scrollLeft=ve.left,ve.element.scrollTop=ve.top}}O0=!!Cy,wy=Cy=null}finally{Ye=S,$.p=m,Y.T=u}}a.current=r,Wt=2}}function Ci(){if(Wt===2){Wt=0;var a=Ls,r=Jo,u=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||u){u=Y.T,Y.T=null;var m=$.p;$.p=2;var S=Ye;Ye|=4;try{Nn(a,r.alternate,r)}finally{Ye=S,$.p=m,Y.T=u}}Wt=3}}function Jl(){if(Wt===4||Wt===3){Wt=0,Jt();var a=Ls,r=Jo,u=rr,m=wu;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Wt=5:(Wt=0,Jo=Ls=null,Wr(a,a.pendingLanes));var S=a.pendingLanes;if(S===0&&(Wn=null),et(u),r=r.stateNode,ea&&typeof ea.onCommitFiberRoot=="function")try{ea.onCommitFiberRoot(Hs,r,void 0,(r.current.flags&128)===128)}catch{}if(m!==null){r=Y.T,S=$.p,$.p=2,Y.T=null;try{for(var N=a.onRecoverableError,A=0;A<m.length;A++){var B=m[A];N(B.value,{componentStack:B.stack})}}finally{Y.T=r,$.p=S}}(rr&3)!==0&&tc(),Ce(a),S=a.pendingLanes,(u&261930)!==0&&(S&42)!==0?a===Fl?el++:(el=0,Fl=a):el=0,Le(0)}}function Wr(a,r){(a.pooledCacheLanes&=r)===0&&(r=a.pooledCache,r!=null&&(a.pooledCache=null,Ol(r)))}function tc(){return sa(),Ci(),Jl(),bf()}function bf(){if(Wt!==5)return!1;var a=Ls,r=Io;Io=0;var u=et(rr),m=Y.T,S=$.p;try{$.p=32>u?32:u,Y.T=null,u=Wo,Wo=null;var N=Ls,A=rr;if(Wt=0,Jo=Ls=null,rr=0,(Ye&6)!==0)throw Error(s(331));var B=Ye;if(Ye|=4,gs(N.current),Rp(N,N.current,A,u),Ye=B,Le(0,!1),ea&&typeof ea.onPostCommitFiberRoot=="function")try{ea.onPostCommitFiberRoot(Hs,N)}catch{}return!0}finally{$.p=S,Y.T=m,Wr(a,r)}}function Ap(a,r,u){r=Rs(u,r),r=Np(a.stateNode,r,2),a=Vi(a,r,2),a!==null&&(yn(a,2),Ce(a))}function Ut(a,r,u){if(a.tag===3)Ap(a,a,u);else for(;r!==null;){if(r.tag===3){Ap(r,a,u);break}else if(r.tag===1){var m=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Wn===null||!Wn.has(m))){a=Rs(u,a),u=_p(2),m=Vi(r,u,2),m!==null&&(m0(u,m,r,a),yn(m,2),Ce(m));break}}r=r.return}}function Ou(a,r,u){var m=a.pingCache;if(m===null){m=a.pingCache=new it;var S=new Set;m.set(r,S)}else S=m.get(r),S===void 0&&(S=new Set,m.set(r,S));S.has(u)||(Op=!0,S.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,tt===a&&(dt&u)===u&&(Dn===4||Dn===3&&(dt&62914560)===dt&&300>Kn()-Zo?(Ye&2)===0&&nl(a,0):Cu|=u,mn===dt&&(mn=0)),Ce(a)}function c(a,r){r===0&&(r=rn()),a=Za(a,r),a!==null&&(yn(a,r),Ce(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,S=a.memoizedState;S!==null&&(u=S.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 j(a,r){return Et(a,r)}var E=null,q=null,Z=!1,ge=!1,Ne=!1,Oe=0;function Ce(a){a!==q&&a.next===null&&(q===null?E=q=a:q=q.next=a),ge=!0,Z||(Z=!0,se())}function Le(a,r){if(!Ne&&ge){Ne=!0;do for(var u=!1,m=E;m!==null;){if(a!==0){var S=m.pendingLanes;if(S===0)var N=0;else{var A=m.suspendedLanes,B=m.pingedLanes;N=(1<<31-ba(42|a)+1)-1,N&=S&~(A&~B),N=N&201326741?N&201326741|1:N?N|2:0}N!==0&&(u=!0,ue(m,N))}else N=dt,N=Qt(m,m===tt?N:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(N&3)===0||At(m,N)||(u=!0,ue(m,N));m=m.next}while(u);Ne=!1}}function st(){Ca()}function Ca(){ge=Z=!1;var a=0;Oe!==0&&l7()&&(a=Oe);for(var r=Kn(),u=null,m=E;m!==null;){var S=m.next,N=nc(m,r);N===0?(m.next=null,u===null?E=S:u.next=S,S===null&&(q=u)):(u=m,(a!==0||(N&3)!==0)&&(ge=!0)),m=S}Wt!==0&&Wt!==5||Le(a),Oe!==0&&(Oe=0)}function nc(a,r){for(var u=a.suspendedLanes,m=a.pingedLanes,S=a.expirationTimes,N=a.pendingLanes&-62914561;0<N;){var A=31-ba(N),B=1<<A,X=S[A];X===-1?((B&u)===0||(B&m)!==0)&&(S[A]=Hn(B,r)):X<=r&&(a.expiredLanes|=B),N&=~B}if(r=tt,u=dt,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),et(u)){case 2:case 8:u=Qa;break;case 32:u=la;break;case 268435456:u=rs;break;default:u=la}return m=rl.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 rl(a,r){if(Wt!==0&&Wt!==5)return a.callbackNode=null,a.callbackPriority=0,null;var u=a.callbackNode;if(tc()&&a.callbackNode!==u)return null;var m=dt;return m=Qt(a,a===tt?m:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m===0?null:(vt(a,m,r),nc(a,Kn()),a.callbackNode!=null&&a.callbackNode===u?rl.bind(null,a):null)}function ue(a,r){if(tc())return null;vt(a,r,!0)}function se(){c7(function(){(Ye&6)!==0?Et(dr,st):Ca()})}function pe(){if(Oe===0){var a=pi;a===0&&(a=_s,_s<<=1,(_s&261888)===0&&(_s=256)),Oe=a}return Oe}function Te(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Kc(""+a)}function Xe(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,S){if(r==="submit"&&u&&u.stateNode===S){var N=Te((S[ut]||null).action),A=m.submitter;A&&(r=(r=A[ut]||null)?Te(r.formAction):A.getAttribute("formAction"),r!==null&&(N=r,A=null));var B=new Zc("action","action",null,m,S);a.push({event:B,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(Oe!==0){var X=A?Xe(S,A):new FormData(S);pp(u,{pending:!0,data:X,method:S.method,action:N},null,X)}}else typeof N=="function"&&(B.preventDefault(),X=A?Xe(S,A):new FormData(S),pp(u,{pending:!0,data:X,method:S.method,action:N},N,X))},currentTarget:S}]})}}for(var Ze=0;Ze<su.length;Ze++){var Dt=su[Ze],wa=Dt.toLowerCase(),Bt=Dt[0].toUpperCase()+Dt.slice(1);Qs(wa,"on"+Bt)}Qs(Md,"onAnimationEnd"),Qs(au,"onAnimationIteration"),Qs(qh,"onAnimationStart"),Qs("dblclick","onDoubleClick"),Qs("focusin","onFocus"),Qs("focusout","onBlur"),Qs(jg,"onTransitionRun"),Qs(dy,"onTransitionStart"),Qs(Cg,"onTransitionCancel"),Qs(Hh,"onTransitionEnd"),ws("onMouseEnter",["mouseout","mouseover"]),ws("onMouseLeave",["mouseout","mouseover"]),ws("onPointerEnter",["pointerout","pointerover"]),ws("onPointerLeave",["pointerout","pointerover"]),Mi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Mi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Mi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Mi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Mi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Mi("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(" "),vy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ir));function Dv(a,r){r=(r&4)!==0;for(var u=0;u<a.length;u++){var m=a[u],S=m.event;m=m.listeners;e:{var N=void 0;if(r)for(var A=m.length-1;0<=A;A--){var B=m[A],X=B.instance,oe=B.currentTarget;if(B=B.listener,X!==N&&S.isPropagationStopped())break e;N=B,S.currentTarget=oe;try{N(S)}catch(xe){ru(xe)}S.currentTarget=null,N=X}else for(A=0;A<m.length;A++){if(B=m[A],X=B.instance,oe=B.currentTarget,B=B.listener,X!==N&&S.isPropagationStopped())break e;N=B,S.currentTarget=oe;try{N(S)}catch(xe){ru(xe)}S.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)||(zv(r,a,2,!1),u.add(m))}function Sy(a,r,u){var m=0;r&&(m|=4),zv(u,a,m,r)}var S0="_reactListening"+Math.random().toString(36).slice(2);function Ny(a){if(!a[S0]){a[S0]=!0,Cs.forEach(function(u){u!=="selectionchange"&&(vy.has(u)||Sy(u,!1,a),Sy(u,!0,a))});var r=a.nodeType===9?a:a.ownerDocument;r===null||r[S0]||(r[S0]=!0,Sy("selectionchange",!1,r))}}function zv(a,r,u,m){switch(c2(r)){case 2:var S=R7;break;case 8:S=O7;break;default:S=Uy}u=S.bind(null,r,u,a),S=void 0,!vh||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(S=!0),m?S!==void 0?a.addEventListener(r,u,{capture:!0,passive:S}):a.addEventListener(r,u,!0):S!==void 0?a.addEventListener(r,u,{passive:S}):a.addEventListener(r,u,!1)}function _y(a,r,u,m,S){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 B=m.stateNode.containerInfo;if(B===S)break;if(A===4)for(A=m.return;A!==null;){var X=A.tag;if((X===3||X===4)&&A.stateNode.containerInfo===S)return;A=A.return}for(;B!==null;){if(A=Pt(B),A===null)return;if(X=A.tag,X===5||X===6||X===26||X===27){m=N=A;continue e}B=B.parentNode}}m=m.return}bh(function(){var oe=N,xe=xd(u),Se=[];e:{var de=Vs.get(a);if(de!==void 0){var ye=Zc,He=a;switch(a){case"keypress":if(Fc(u)===0)break e;case"keydown":case"keyup":ye=Cl;break;case"focusin":He="focus",ye=Nd;break;case"focusout":He="blur",ye=Nd;break;case"beforeblur":case"afterblur":ye=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":ye=Sh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ye=sg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ye=ug;break;case Md:case au:case qh:ye=oy;break;case Hh:ye=uy;break;case"scroll":case"scrollend":ye=ng;break;case"wheel":ye=fg;break;case"copy":case"cut":case"paste":ye=ig;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ye=jh;break;case"toggle":case"beforetoggle":ye=pg}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 ve=J;if(le=ve.stateNode,ve=ve.tag,ve!==5&&ve!==26&&ve!==27||le===null||te===null||(ve=vo(J,te),ve!=null&&Je.push(Dp(J,ve,le))),dn)break;J=J.return}0<Je.length&&(de=new ye(de,He,null,u,xe),Se.push({event:de,listeners:Je}))}}if((r&7)===0){e:{if(de=a==="mouseover"||a==="pointerover",ye=a==="mouseout"||a==="pointerout",de&&u!==yd&&(He=u.relatedTarget||u.fromElement)&&(Pt(He)||He[sn]))break e;if((ye||de)&&(de=xe.window===xe?xe:(de=xe.ownerDocument)?de.defaultView||de.parentWindow:window,ye?(He=u.relatedTarget||u.toElement,ye=oe,He=He?Pt(He):null,He!==null&&(dn=o(He),Je=He.tag,He!==dn||Je!==5&&Je!==27&&Je!==6)&&(He=null)):(ye=null,He=oe),ye!==He)){if(Je=Sh,ve="onMouseLeave",te="onMouseEnter",J="mouse",(a==="pointerout"||a==="pointerover")&&(Je=jh,ve="onPointerLeave",te="onPointerEnter",J="pointer"),dn=ye==null?de:mr(ye),le=He==null?de:mr(He),de=new Je(ve,J+"leave",ye,u,xe),de.target=dn,de.relatedTarget=le,ve=null,Pt(xe)===oe&&(Je=new Je(te,J+"enter",He,u,xe),Je.target=le,Je.relatedTarget=dn,ve=Je),dn=ve,ye&&He)t:{for(Je=n7,te=ye,J=He,le=0,ve=te;ve;ve=Je(ve))le++;ve=0;for(var Ke=J;Ke;Ke=Je(Ke))ve++;for(;0<le-ve;)te=Je(te),le--;for(;0<ve-le;)J=Je(J),ve--;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;ye!==null&&kv(Se,de,ye,Je,!1),He!==null&&dn!==null&&kv(Se,dn,He,Je,!0)}}e:{if(de=oe?mr(oe):window,ye=de.nodeName&&de.nodeName.toLowerCase(),ye==="select"||ye==="input"&&de.type==="file")var Kt=Mh;else if(Oh(de))if(Ar)Kt=Sg;else{Kt=zh;var Pe=bg}else ye=de.nodeName,!ye||ye.toLowerCase()!=="input"||de.type!=="checkbox"&&de.type!=="radio"?oe&&gd(oe.elementType)&&(Kt=Mh):Kt=vg;if(Kt&&(Kt=Kt(a,oe))){Rd(Se,Kt,u,xe);break e}Pe&&Pe(a,de,oe),a==="focusout"&&oe&&de.type==="number"&&oe.memoizedProps.value!=null&&gr(de,"number",de.value)}switch(Pe=oe?mr(oe):window,a){case"focusin":(Oh(Pe)||Pe.contentEditable==="true")&&(Dr=Pe,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(Se,u,xe);break;case"selectionchange":if(_g)break;case"keydown":case"keyup":Mo(Se,u,xe)}var gt;if(wl)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 El?Td(a,u)&&(zt="onCompositionEnd"):a==="keydown"&&u.keyCode===229&&(zt="onCompositionStart");zt&&(wh&&u.locale!=="ko"&&(El||zt!=="onCompositionStart"?zt==="onCompositionEnd"&&El&&(gt=Xc()):(Ts=xe,vd="value"in Ts?Ts.value:Ts.textContent,El=!0)),Pe=N0(oe,zt),0<Pe.length&&(zt=new _d(zt,a,null,u,xe),Se.push({event:zt,listeners:Pe}),gt?zt.data=gt:(gt=Eh(u),gt!==null&&(zt.data=gt)))),(gt=Ed?yg(a,u):Th(a,u))&&(zt=N0(oe,"onBeforeInput"),0<zt.length&&(Pe=new _d("onBeforeInput","beforeinput",null,u,xe),Se.push({event:Pe,listeners:zt}),Pe.data=gt)),Ln(Se,a,oe,u,xe)}Dv(Se,r)})}function Dp(a,r,u){return{instance:a,listener:r,currentTarget:u}}function N0(a,r){for(var u=r+"Capture",m=[];a!==null;){var S=a,N=S.stateNode;if(S=S.tag,S!==5&&S!==26&&S!==27||N===null||(S=vo(a,u),S!=null&&m.unshift(Dp(a,S,N)),S=vo(a,r),S!=null&&m.push(Dp(a,S,N))),a.tag===3)return m;a=a.return}return[]}function n7(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function kv(a,r,u,m,S){for(var N=r._reactName,A=[];u!==null&&u!==m;){var B=u,X=B.alternate,oe=B.stateNode;if(B=B.tag,X!==null&&X===m)break;B!==5&&B!==26&&B!==27||oe===null||(X=oe,S?(oe=vo(u,N),oe!=null&&A.unshift(Dp(u,oe,X))):S||(oe=vo(u,N),oe!=null&&A.push(Dp(u,oe,X)))),u=u.return}A.length!==0&&a.push({event:r,listeners:A})}var a7=/\r\n?/g,s7=/\u0000|\uFFFD/g;function Lv(a){return(typeof a=="string"?a:""+a).replace(a7,`
49
+ `).replace(s7,"")}function Uv(a,r){return r=Lv(r),Lv(a)===r}function un(a,r,u,m,S,N){switch(u){case"children":typeof m=="string"?r==="body"||r==="textarea"&&m===""||Nl(a,m):(typeof m=="number"||typeof m=="bigint")&&r!=="body"&&Nl(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":gh(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",S.name,S,null),un(a,r,"formEncType",S.formEncType,S,null),un(a,r,"formMethod",S.formMethod,S,null),un(a,r,"formTarget",S.formTarget,S,null)):(un(a,r,"encType",S.encType,S,null),un(a,r,"method",S.method,S,null),un(a,r,"target",S.target,S,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(S.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=eg.get(u)||u,xo(a,u,m))}}function jy(a,r,u,m,S,N){switch(u){case"style":gh(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(S.children!=null)throw Error(s(60));a.innerHTML=u}}break;case"children":typeof m=="string"?Nl(a,m):(typeof m=="number"||typeof m=="bigint")&&Nl(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"&&(S=u.endsWith("Capture"),r=u.slice(2,S?u.length-7:void 0),N=a[ut]||null,N=N!=null?N[u]:null,typeof N=="function"&&a.removeEventListener(r,N,S),typeof m=="function")){typeof N!="function"&&N!==null&&(u in a?a[u]=null:a.hasAttribute(u)&&a.removeAttribute(u)),a.addEventListener(r,m,S);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,S=!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":S=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:un(a,r,N,A,u,null)}}S&&un(a,r,"srcSet",u.srcSet,u,null),m&&un(a,r,"src",u.src,u,null);return;case"input":Ot("invalid",a);var B=N=A=S=null,X=null,oe=null;for(m in u)if(u.hasOwnProperty(m)){var xe=u[m];if(xe!=null)switch(m){case"name":S=xe;break;case"type":A=xe;break;case"checked":X=xe;break;case"defaultChecked":oe=xe;break;case"value":N=xe;break;case"defaultValue":B=xe;break;case"children":case"dangerouslySetInnerHTML":if(xe!=null)throw Error(s(137,r));break;default:un(a,r,m,xe,u,null)}}hd(a,N,B,X,oe,A,S,!1);return;case"select":Ot("invalid",a),m=A=N=null;for(S in u)if(u.hasOwnProperty(S)&&(B=u[S],B!=null))switch(S){case"value":N=B;break;case"defaultValue":A=B;break;case"multiple":m=B;default:un(a,r,S,B,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=S=m=null;for(A in u)if(u.hasOwnProperty(A)&&(B=u[A],B!=null))switch(A){case"value":m=B;break;case"defaultValue":S=B;break;case"children":N=B;break;case"dangerouslySetInnerHTML":if(B!=null)throw Error(s(91));break;default:un(a,r,A,B,u,null)}md(a,m,S,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(xe in u)u.hasOwnProperty(xe)&&(m=u[xe],m!==void 0&&jy(a,r,xe,m,u,void 0));return}}for(B in u)u.hasOwnProperty(B)&&(m=u[B],m!=null&&un(a,r,B,m,u,null))}function r7(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 S=null,N=null,A=null,B=null,X=null,oe=null,xe=null;for(ye in u){var Se=u[ye];if(u.hasOwnProperty(ye)&&Se!=null)switch(ye){case"checked":break;case"value":break;case"defaultValue":X=Se;default:m.hasOwnProperty(ye)||un(a,r,ye,null,m,Se)}}for(var de in m){var ye=m[de];if(Se=u[de],m.hasOwnProperty(de)&&(ye!=null||Se!=null))switch(de){case"type":N=ye;break;case"name":S=ye;break;case"checked":oe=ye;break;case"defaultChecked":xe=ye;break;case"value":A=ye;break;case"defaultValue":B=ye;break;case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(s(137,r));break;default:ye!==Se&&un(a,r,de,ye,m,Se)}}bo(a,A,B,X,oe,xe,N,S);return;case"select":ye=A=B=de=null;for(N in u)if(X=u[N],u.hasOwnProperty(N)&&X!=null)switch(N){case"value":break;case"multiple":ye=X;default:m.hasOwnProperty(N)||un(a,r,N,null,m,X)}for(S in m)if(N=m[S],X=u[S],m.hasOwnProperty(S)&&(N!=null||X!=null))switch(S){case"value":de=N;break;case"defaultValue":B=N;break;case"multiple":A=N;default:N!==X&&un(a,r,S,N,m,X)}r=B,u=A,m=ye,de!=null?li(a,!!u,de,!1):!!m!=!!u&&(r!=null?li(a,!!u,r,!0):li(a,!!u,u?[]:"",!1));return;case"textarea":ye=de=null;for(B in u)if(S=u[B],u.hasOwnProperty(B)&&S!=null&&!m.hasOwnProperty(B))switch(B){case"value":break;case"children":break;default:un(a,r,B,null,m,S)}for(A in m)if(S=m[A],N=u[A],m.hasOwnProperty(A)&&(S!=null||N!=null))switch(A){case"value":de=S;break;case"defaultValue":ye=S;break;case"children":break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(s(91));break;default:S!==N&&un(a,r,A,S,m,N)}pd(a,de,ye);return;case"option":for(var He in u)if(de=u[He],u.hasOwnProperty(He)&&de!=null&&!m.hasOwnProperty(He))switch(He){case"selected":a.selected=!1;break;default:un(a,r,He,null,m,de)}for(X in m)if(de=m[X],ye=u[X],m.hasOwnProperty(X)&&de!==ye&&(de!=null||ye!=null))switch(X){case"selected":a.selected=de&&typeof de!="function"&&typeof de!="symbol";break;default:un(a,r,X,de,m,ye)}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],ye=u[oe],m.hasOwnProperty(oe)&&de!==ye&&(de!=null||ye!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(s(137,r));break;default:un(a,r,oe,de,m,ye)}return;default:if(gd(r)){for(var dn in u)de=u[dn],u.hasOwnProperty(dn)&&de!==void 0&&!m.hasOwnProperty(dn)&&jy(a,r,dn,void 0,m,de);for(xe in m)de=m[xe],ye=u[xe],!m.hasOwnProperty(xe)||de===ye||de===void 0&&ye===void 0||jy(a,r,xe,de,m,ye);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(Se in m)de=m[Se],ye=u[Se],!m.hasOwnProperty(Se)||de===ye||de==null&&ye==null||un(a,r,Se,de,m,ye)}function qv(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function i7(){if(typeof performance.getEntriesByType=="function"){for(var a=0,r=0,u=performance.getEntriesByType("resource"),m=0;m<u.length;m++){var S=u[m],N=S.transferSize,A=S.initiatorType,B=S.duration;if(N&&B&&qv(A)){for(A=0,B=S.responseEnd,m+=1;m<u.length;m++){var X=u[m],oe=X.startTime;if(oe>B)break;var xe=X.transferSize,Se=X.initiatorType;xe&&qv(Se)&&(X=X.responseEnd,A+=xe*(X<B?1:(B-oe)/(X-oe)))}if(--m,r+=8*(N+A)/(S.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 Cy=null,wy=null;function _0(a){return a.nodeType===9?a:a.ownerDocument}function Hv(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 Bv(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 Ey(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 Ty=null;function l7(){var a=window.event;return a&&a.type==="popstate"?a===Ty?!1:(Ty=a,!0):(Ty=null,!1)}var Gv=typeof setTimeout=="function"?setTimeout:void 0,o7=typeof clearTimeout=="function"?clearTimeout:void 0,Pv=typeof Promise=="function"?Promise:void 0,c7=typeof queueMicrotask=="function"?queueMicrotask:typeof Pv<"u"?function(a){return Pv.resolve(null).then(a).catch(u7)}:Gv;function u7(a){setTimeout(function(){throw a})}function ac(a){return a==="head"}function Yv(a,r){var u=r,m=0;do{var S=u.nextSibling;if(a.removeChild(u),S&&S.nodeType===8)if(u=S.data,u==="/$"||u==="/&"){if(m===0){a.removeChild(S),_f(r);return}m--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")m++;else if(u==="html")zp(a.ownerDocument.documentElement);else if(u==="head"){u=a.ownerDocument.head,zp(u);for(var N=u.firstChild;N;){var A=N.nextSibling,B=N.nodeName;N[Ka]||B==="SCRIPT"||B==="STYLE"||B==="LINK"&&N.rel.toLowerCase()==="stylesheet"||u.removeChild(N),N=A}}else u==="body"&&zp(a.ownerDocument.body);u=S}while(u);_f(r)}function Vv(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 Ry(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":Ry(u),Gs(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}a.removeChild(u)}}function d7(a,r,u,m){for(;a.nodeType===1;){var S=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!==S.rel||a.getAttribute("href")!==(S.href==null||S.href===""?null:S.href)||a.getAttribute("crossorigin")!==(S.crossOrigin==null?null:S.crossOrigin)||a.getAttribute("title")!==(S.title==null?null:S.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(N=a.getAttribute("src"),(N!==(S.src==null?null:S.src)||a.getAttribute("type")!==(S.type==null?null:S.type)||a.getAttribute("crossorigin")!==(S.crossOrigin==null?null:S.crossOrigin))&&N&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(r==="input"&&a.type==="hidden"){var N=S.name==null?null:""+S.name;if(S.type==="hidden"&&a.getAttribute("name")===N)return a}else return a;if(a=$r(a.nextSibling),a===null)break}return null}function f7(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 Qv(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 Oy(a){return a.data==="$?"||a.data==="$~"}function My(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function h7(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 Ay=null;function Kv(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 Xv(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 Fv(a,r,u){switch(r=_0(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 zp(a){for(var r=a.attributes;r.length;)a.removeAttributeNode(r[0]);Gs(a)}var ei=new Map,Zv=new Set;function j0(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var Il=$.d;$.d={f:p7,r:m7,D:g7,C:y7,L:x7,m:b7,X:S7,S:v7,M:N7};function p7(){var a=Il.f(),r=Sr();return a||r}function m7(a){var r=pr(a);r!==null&&r.tag===5&&r.type==="form"?i0(r):Il.r(a)}var vf=typeof document>"u"?null:document;function Jv(a,r,u){var m=vf;if(m&&typeof r=="string"&&r){var S=Ha(r);S='link[rel="'+a+'"][href="'+S+'"]',typeof u=="string"&&(S+='[crossorigin="'+u+'"]'),Zv.has(S)||(Zv.add(S),a={rel:a,crossOrigin:u,href:r},m.querySelector(S)===null&&(r=m.createElement("link"),as(r,"link",a),Tn(r),m.head.appendChild(r)))}}function g7(a){Il.D(a),Jv("dns-prefetch",a,null)}function y7(a,r){Il.C(a,r),Jv("preconnect",a,r)}function x7(a,r,u){Il.L(a,r,u);var m=vf;if(m&&a&&r){var S='link[rel="preload"][as="'+Ha(r)+'"]';r==="image"&&u&&u.imageSrcSet?(S+='[imagesrcset="'+Ha(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(S+='[imagesizes="'+Ha(u.imageSizes)+'"]')):S+='[href="'+Ha(a)+'"]';var N=S;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(S)!==null||r==="style"&&m.querySelector(kp(N))||r==="script"&&m.querySelector(Lp(N))||(r=m.createElement("link"),as(r,"link",a),Tn(r),m.head.appendChild(r)))}}function b7(a,r){Il.m(a,r);var u=vf;if(u&&a){var m=r&&typeof r.as=="string"?r.as:"script",S='link[rel="modulepreload"][as="'+Ha(m)+'"][href="'+Ha(a)+'"]',N=S;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(S)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Lp(N)))return}m=u.createElement("link"),as(m,"link",a),Tn(m),u.head.appendChild(m)}}}function v7(a,r,u){Il.S(a,r,u);var m=vf;if(m&&a){var S=js(m).hoistableStyles,N=Sf(a);r=r||"default";var A=S.get(N);if(!A){var B={loading:0,preload:null};if(A=m.querySelector(kp(N)))B.loading=5;else{a=b({rel:"stylesheet",href:a,"data-precedence":r},u),(u=ei.get(N))&&Dy(a,u);var X=A=m.createElement("link");Tn(X),as(X,"link",a),X._p=new Promise(function(oe,xe){X.onload=oe,X.onerror=xe}),X.addEventListener("load",function(){B.loading|=1}),X.addEventListener("error",function(){B.loading|=2}),B.loading|=4,C0(A,r,m)}A={type:"stylesheet",instance:A,count:1,state:B},S.set(N,A)}}}function S7(a,r){Il.X(a,r);var u=vf;if(u&&a){var m=js(u).hoistableScripts,S=Nf(a),N=m.get(S);N||(N=u.querySelector(Lp(S)),N||(a=b({src:a,async:!0},r),(r=ei.get(S))&&zy(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(S,N))}}function N7(a,r){Il.M(a,r);var u=vf;if(u&&a){var m=js(u).hoistableScripts,S=Nf(a),N=m.get(S);N||(N=u.querySelector(Lp(S)),N||(a=b({src:a,async:!0,type:"module"},r),(r=ei.get(S))&&zy(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(S,N))}}function Iv(a,r,u,m){var S=(S=me.current)?j0(S):null;if(!S)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=js(S).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=js(S).hoistableStyles,A=N.get(a);if(A||(S=S.ownerDocument||S,A={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},N.set(a,A),(N=S.querySelector(kp(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||_7(S,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=js(S).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 kp(a){return'link[rel="stylesheet"]['+a+"]"}function Wv(a){return b({},a,{"data-precedence":a.precedence,precedence:null})}function _7(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 Lp(a){return"script[async]"+a}function $v(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 S=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",S),C0(m,u.precedence,a),r.instance=m;case"stylesheet":S=Sf(u.href);var N=a.querySelector(kp(S));if(N)return r.state.loading|=4,r.instance=N,Tn(N),N;m=Wv(u),(S=ei.get(S))&&Dy(m,S),N=(a.ownerDocument||a).createElement("link"),Tn(N);var A=N;return A._p=new Promise(function(B,X){A.onload=B,A.onerror=X}),as(N,"link",m),r.state.loading|=4,C0(N,u.precedence,a),r.instance=N;case"script":return N=Nf(u.src),(S=a.querySelector(Lp(N)))?(r.instance=S,Tn(S),S):(m=u,(S=ei.get(N))&&(m=b({},u),zy(m,S)),a=a.ownerDocument||a,S=a.createElement("script"),Tn(S),as(S,"link",m),a.head.appendChild(S),r.instance=S);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,C0(m,u.precedence,a));return r.instance}function C0(a,r,u){for(var m=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),S=m.length?m[m.length-1]:null,N=S,A=0;A<m.length;A++){var B=m[A];if(B.dataset.precedence===r)N=B;else if(N!==S)break}N?N.parentNode.insertBefore(a,N.nextSibling):(r=u.nodeType===9?u.head:u,r.insertBefore(a,r.firstChild))}function Dy(a,r){a.crossOrigin==null&&(a.crossOrigin=r.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=r.referrerPolicy),a.title==null&&(a.title=r.title)}function zy(a,r){a.crossOrigin==null&&(a.crossOrigin=r.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=r.referrerPolicy),a.integrity==null&&(a.integrity=r.integrity)}var w0=null;function e2(a,r,u){if(w0===null){var m=new Map,S=w0=new Map;S.set(u,m)}else S=w0,m=S.get(u),m||(m=new Map,S.set(u,m));if(m.has(a))return m;for(m.set(a,null),u=u.getElementsByTagName(a),S=0;S<u.length;S++){var N=u[S];if(!(N[Ka]||N[Fe]||a==="link"&&N.getAttribute("rel")==="stylesheet")&&N.namespaceURI!=="http://www.w3.org/2000/svg"){var A=N.getAttribute(r)||"";A=a+A;var B=m.get(A);B?B.push(N):m.set(A,[N])}}return m}function t2(a,r,u){a=a.ownerDocument||a,a.head.insertBefore(u,r==="title"?a.querySelector("head > title"):null)}function j7(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 n2(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function C7(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 S=Sf(m.href),N=r.querySelector(kp(S));if(N){r=N._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(a.count++,a=E0.bind(a),r.then(a,a)),u.state.loading|=4,u.instance=N,Tn(N);return}N=r.ownerDocument||r,m=Wv(m),(S=ei.get(S))&&Dy(m,S),N=N.createElement("link"),Tn(N);var A=N;A._p=new Promise(function(B,X){A.onload=B,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=E0.bind(a),r.addEventListener("load",u),r.addEventListener("error",u))}}var ky=0;function w7(a,r){return a.stylesheets&&a.count===0&&R0(a,a.stylesheets),0<a.count||0<a.imgCount?function(u){var m=setTimeout(function(){if(a.stylesheets&&R0(a,a.stylesheets),a.unsuspend){var N=a.unsuspend;a.unsuspend=null,N()}},6e4+r);0<a.imgBytes&&ky===0&&(ky=62500*i7());var S=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&R0(a,a.stylesheets),a.unsuspend)){var N=a.unsuspend;a.unsuspend=null,N()}},(a.imgBytes>ky?50:800)+r);return a.unsuspend=u,function(){a.unsuspend=null,clearTimeout(m),clearTimeout(S)}}:null}function E0(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)R0(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var T0=null;function R0(a,r){a.stylesheets=null,a.unsuspend!==null&&(a.count++,T0=new Map,r.forEach(E7,a),T0=null,E0.call(a))}function E7(a,r){if(!(r.state.loading&4)){var u=T0.get(a);if(u)var m=u.get(null);else{u=new Map,T0.set(a,u);for(var S=a.querySelectorAll("link[data-precedence],style[data-precedence]"),N=0;N<S.length;N++){var A=S[N];(A.nodeName==="LINK"||A.getAttribute("media")!=="not all")&&(u.set(A.dataset.precedence,A),m=A)}m&&u.set(null,m)}S=r.instance,A=S.getAttribute("data-precedence"),N=u.get(A)||m,N===m&&u.set(null,S),u.set(A,S),this.count++,m=E0.bind(this),S.addEventListener("load",m),S.addEventListener("error",m),N?N.parentNode.insertBefore(S,N.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(S,a.firstChild)),r.state.loading|=4}}var Up={$$typeof:z,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function T7(a,r,u,m,S,N,A,B,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=Xn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xn(0),this.hiddenUpdates=Xn(null),this.identifierPrefix=m,this.onUncaughtError=S,this.onCaughtError=N,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=X,this.incompleteTransitions=new Map}function a2(a,r,u,m,S,N,A,B,X,oe,xe,Se){return a=new T7(a,r,u,A,X,oe,xe,Se,B),r=1,N===!0&&(r|=24),N=On(3,null,null,r),a.current=N,N.stateNode=a,r=Gh(),r.refCount++,a.pooledCache=r,r.refCount++,N.memoizedState={element:m,isDehydrated:u,cache:r},fu(N),a}function s2(a){return a?(a=Li,a):Li}function r2(a,r,u,m,S,N){S=s2(S),m.context===null?m.context=S:m.pendingContext=S,m=gi(r),m.payload={element:u},N=N===void 0?null:N,N!==null&&(m.callback=N),u=Vi(a,m,r),u!==null&&(pt(u,a,r),Qi(u,a,r))}function i2(a,r){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var u=a.retryLane;a.retryLane=u!==0&&u<r?u:r}}function Ly(a,r){i2(a,r),(a=a.alternate)&&i2(a,r)}function l2(a){if(a.tag===13||a.tag===31){var r=Za(a,67108864);r!==null&&pt(r,a,67108864),Ly(a,67108864)}}function o2(a){if(a.tag===13||a.tag===31){var r=Us();r=Ue(r);var u=Za(a,r);u!==null&&pt(u,a,r),Ly(a,r)}}var O0=!0;function R7(a,r,u,m){var S=Y.T;Y.T=null;var N=$.p;try{$.p=2,Uy(a,r,u,m)}finally{$.p=N,Y.T=S}}function O7(a,r,u,m){var S=Y.T;Y.T=null;var N=$.p;try{$.p=8,Uy(a,r,u,m)}finally{$.p=N,Y.T=S}}function Uy(a,r,u,m){if(O0){var S=qy(m);if(S===null)_y(a,r,m,M0,u),u2(a,m);else if(A7(S,a,r,u,m))m.stopPropagation();else if(u2(a,m),r&4&&-1<M7.indexOf(a)){for(;S!==null;){var N=pr(S);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 B=N;for(B.pendingLanes|=2,B.entangledLanes|=2;A;){var X=1<<31-ba(A);B.entanglements[1]|=X,A&=~X}Ce(N),(Ye&6)===0&&(In=Kn()+500,Le(0))}}break;case 31:case 13:B=Za(N,2),B!==null&&pt(B,N,2),Sr(),Ly(N,2)}if(N=qy(m),N===null&&_y(a,r,m,M0,u),N===S)break;S=N}S!==null&&m.stopPropagation()}else _y(a,r,m,null,u)}}function qy(a){return a=xd(a),Hy(a)}var M0=null;function Hy(a){if(M0=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 M0=a,null}function c2(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 By=!1,sc=null,rc=null,ic=null,qp=new Map,Hp=new Map,lc=[],M7="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 u2(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":qp.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Hp.delete(r.pointerId)}}function Bp(a,r,u,m,S,N){return a===null||a.nativeEvent!==N?(a={blockedOn:r,domEventName:u,eventSystemFlags:m,nativeEvent:N,targetContainers:[S]},r!==null&&(r=pr(r),r!==null&&l2(r)),a):(a.eventSystemFlags|=m,r=a.targetContainers,S!==null&&r.indexOf(S)===-1&&r.push(S),a)}function A7(a,r,u,m,S){switch(r){case"focusin":return sc=Bp(sc,a,r,u,m,S),!0;case"dragenter":return rc=Bp(rc,a,r,u,m,S),!0;case"mouseover":return ic=Bp(ic,a,r,u,m,S),!0;case"pointerover":var N=S.pointerId;return qp.set(N,Bp(qp.get(N)||null,a,r,u,m,S)),!0;case"gotpointercapture":return N=S.pointerId,Hp.set(N,Bp(Hp.get(N)||null,a,r,u,m,S)),!0}return!1}function d2(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,ct(a.priority,function(){o2(u)});return}}else if(r===31){if(r=f(u),r!==null){a.blockedOn=r,ct(a.priority,function(){o2(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 A0(a){if(a.blockedOn!==null)return!1;for(var r=a.targetContainers;0<r.length;){var u=qy(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&&l2(r),a.blockedOn=u,!1;r.shift()}return!0}function f2(a,r,u){A0(a)&&u.delete(r)}function D7(){By=!1,sc!==null&&A0(sc)&&(sc=null),rc!==null&&A0(rc)&&(rc=null),ic!==null&&A0(ic)&&(ic=null),qp.forEach(f2),Hp.forEach(f2)}function D0(a,r){a.blockedOn===r&&(a.blockedOn=null,By||(By=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,D7)))}var z0=null;function h2(a){z0!==a&&(z0=a,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){z0===a&&(z0=null);for(var r=0;r<a.length;r+=3){var u=a[r],m=a[r+1],S=a[r+2];if(typeof m!="function"){if(Hy(m||u)===null)continue;break}var N=pr(u);N!==null&&(a.splice(r,3),r-=3,pp(N,{pending:!0,data:S,method:u.method,action:m},m,S))}}))}function _f(a){function r(X){return D0(X,a)}sc!==null&&D0(sc,a),rc!==null&&D0(rc,a),ic!==null&&D0(ic,a),qp.forEach(r),Hp.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);)d2(u),u.blockedOn===null&&lc.shift();if(u=(a.ownerDocument||a).$$reactFormReplay,u!=null)for(m=0;m<u.length;m+=3){var S=u[m],N=u[m+1],A=S[ut]||null;if(typeof N=="function")A||h2(u);else if(A){var B=null;if(N&&N.hasAttribute("formAction")){if(S=N,A=N[ut]||null)B=A.formAction;else if(Hy(S)!==null)continue}else B=A.action;typeof B=="function"?u[m+1]=B:(u.splice(m,3),m-=3),h2(u)}}}function p2(){function a(N){N.canIntercept&&N.info==="react-transition"&&N.intercept({handler:function(){return new Promise(function(A){return S=A})},focusReset:"manual",scroll:"manual"})}function r(){S!==null&&(S(),S=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,S=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),S!==null&&(S(),S=null)}}}function Gy(a){this._internalRoot=a}k0.prototype.render=Gy.prototype.render=function(a){var r=this._internalRoot;if(r===null)throw Error(s(409));var u=r.current,m=Us();r2(u,m,a,r,null,null)},k0.prototype.unmount=Gy.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var r=a.containerInfo;r2(a.current,2,null,a,null,null),Sr(),r[sn]=null}};function k0(a){this._internalRoot=a}k0.prototype.unstable_scheduleHydration=function(a){if(a){var r=Ve();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&&d2(a)}};var m2=e.version;if(m2!=="19.2.4")throw Error(s(527,m2,"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?v(a):null,a=a===null?null:a.stateNode,a};var z7={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Y,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var L0=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!L0.isDisabled&&L0.supportsFiber)try{Hs=L0.inject(z7),ea=L0}catch{}}return Yp.createRoot=function(a,r){if(!i(a))throw Error(s(299));var u=!1,m="",S=h0,N=vp,A=Sp;return r!=null&&(r.unstable_strictMode===!0&&(u=!0),r.identifierPrefix!==void 0&&(m=r.identifierPrefix),r.onUncaughtError!==void 0&&(S=r.onUncaughtError),r.onCaughtError!==void 0&&(N=r.onCaughtError),r.onRecoverableError!==void 0&&(A=r.onRecoverableError)),r=a2(a,1,!1,null,null,u,m,null,S,N,A,p2),a[sn]=r.current,Ny(a),new Gy(r)},Yp.hydrateRoot=function(a,r,u){if(!i(a))throw Error(s(299));var m=!1,S="",N=h0,A=vp,B=Sp,X=null;return u!=null&&(u.unstable_strictMode===!0&&(m=!0),u.identifierPrefix!==void 0&&(S=u.identifierPrefix),u.onUncaughtError!==void 0&&(N=u.onUncaughtError),u.onCaughtError!==void 0&&(A=u.onCaughtError),u.onRecoverableError!==void 0&&(B=u.onRecoverableError),u.formState!==void 0&&(X=u.formState)),r=a2(a,1,!0,r,u??null,m,S,X,N,A,B,p2),r.context=s2(null),u=r.current,m=Us(),m=Ue(m),S=gi(m),S.callback=null,Vi(u,S,m),u=m,r.current.lanes=u,yn(r,u),Ce(r),a[sn]=r.current,Ny(a),new k0(r)},Yp.version="19.2.4",Yp}var w2;function Q7(){if(w2)return Qy.exports;w2=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(),Qy.exports=V7(),Qy.exports}var Yb=Q7();const K7=Bb(Yb),X7=x4({__proto__:null,default:K7},[Yb]);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,i4,F7=(i4=class extends $u{constructor(){super();qe(this,Hu);qe(this,bc);qe(this,Lf);Me(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),Me(this,bc,void 0))}setEventListener(e){var n;Me(this,Lf,e),(n=Q(this,bc))==null||n.call(this),Me(this,bc,e(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()}))}setFocused(e){Q(this,Hu)!==e&&(Me(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,i4),k1=new F7,Z7={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},vc,Hb,l4,J7=(l4=class{constructor(){qe(this,vc,Z7);qe(this,Hb,!1)}setTimeoutProvider(t){Me(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,Hb=new WeakMap,l4),Rc=new J7;function I7(t){setTimeout(t,0)}var b4=typeof window>"u"||"Deno"in globalThis;function ma(){}function W7(t,e){return typeof t=="function"?t(e):t}function kx(t){return typeof t=="number"&&t>=0&&t!==1/0}function v4(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 Lx(t,e){const{type:n="all",exact:s,fetchStatus:i,predicate:o,queryKey:d,stale:f}=t;if(d){if(s){if(e.queryHash!==Vb(d,e.options))return!1}else if(!If(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 Ux(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(!If(e.options.mutationKey,o))return!1}return!(s&&e.state.status!==s||i&&!i(e))}function Vb(t,e){return((e==null?void 0:e.queryKeyHashFn)||Ac)(t)}function Ac(t){return JSON.stringify(t,(e,n)=>qx(n)?Object.keys(n).sort().reduce((s,i)=>(s[i]=n[i],s),{}):n)}function If(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>If(t[n],e[n])):!1}var $7=Object.prototype.hasOwnProperty;function Vm(t,e,n=0){if(t===e)return t;if(n>500)return e;const s=E2(t)&&E2(e);if(!s&&!(qx(t)&&qx(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 v=0;v<f;v++){const b=s?v:d[v],_=t[b],C=e[b];if(_===C){p[b]=_,(s?v<o:$7.call(t,b))&&y++;continue}if(_===null||C===null||typeof _!="object"||typeof C!="object"){p[b]=C;continue}const w=Vm(_,C,n+1);p[b]=w,w===_&&y++}return o===f&&y===o?t:p}function Nm(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 E2(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function qx(t){if(!T2(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!T2(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function T2(t){return Object.prototype.toString.call(t)==="[object Object]"}function e9(t){return new Promise(e=>{Rc.setTimeout(e,t)})}function Hx(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?Vm(t,e):e}function t9(t){return t}function S4(t,e,n=0){const s=[...t,e];return n&&s.length>n?s.slice(1):s}function n9(t,e,n=0){const s=[e,...t];return n&&s.length>n?s.slice(0,-1):s}var L1=Symbol();function N4(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===L1?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function U1(t,e){return typeof t=="function"?t(...e):!!t}function _4(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=()=>b4;return{isServer(){return t()},setIsServer(e){t=e}}})();function Bx(){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 a9(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 j4(t){return t}function s9(t){return{mutationKey:t.options.mutationKey,state:t.state,...t.options.scope&&{scope:t.options.scope},...t.meta&&{meta:t.meta}}}function r9(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 C4(t){return t.state.isPaused}function w4(t){return t.state.status==="success"}function i9(t){return!0}function l9(t,e={}){var p,y,v,b;const n=e.shouldDehydrateMutation??((p=t.getDefaultOptions().dehydrate)==null?void 0:p.shouldDehydrateMutation)??C4,s=t.getMutationCache().getAll().flatMap(_=>n(_)?[s9(_)]:[]),i=e.shouldDehydrateQuery??((y=t.getDefaultOptions().dehydrate)==null?void 0:y.shouldDehydrateQuery)??w4,o=e.shouldRedactErrors??((v=t.getDefaultOptions().dehydrate)==null?void 0:v.shouldRedactErrors)??i9,d=e.serializeData??((b=t.getDefaultOptions().dehydrate)==null?void 0:b.serializeData)??j4,f=t.getQueryCache().getAll().flatMap(_=>i(_)?[r9(_,d,o)]:[]);return{mutations:s,queries:f}}function Gx(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)??j4,d=e.mutations||[],f=e.queries||[];d.forEach(({state:v,...b})=>{var _,C;s.build(t,{...(_=t.getDefaultOptions().hydrate)==null?void 0:_.mutations,...(C=n==null?void 0:n.defaultOptions)==null?void 0:C.mutations,...b},v)}),f.forEach(({queryKey:v,state:b,queryHash:_,meta:C,promise:w,dehydratedAt:R})=>{var H,L;const O=w?a9(w):void 0,T=b.data===void 0?O==null?void 0:O.data:b.data,M=T===void 0?T:o(T);let z=i.get(_);const k=(z==null?void 0:z.state.status)==="pending",P=(z==null?void 0:z.state.fetchStatus)==="fetching";if(z){const U=O&&R!==void 0&&R>z.state.dataUpdatedAt;if(b.dataUpdatedAt>z.state.dataUpdatedAt||U){const{fetchStatus:V,...F}=b;z.setState({...F,data:M})}}else z=i.build(t,{...(H=t.getDefaultOptions().hydrate)==null?void 0:H.queries,...(L=n==null?void 0:n.defaultOptions)==null?void 0:L.queries,queryKey:v,queryHash:_,meta:C},{...b,data:M,fetchStatus:"idle",status:M!==void 0?"success":b.status});w&&!k&&!P&&(R===void 0||R>z.state.dataUpdatedAt)&&z.fetch(void 0,{initialPromise:Promise.resolve(w).then(o)}).catch(ma)})}var E4=I7;function o9(){let t=[],e=0,n=f=>{f()},s=f=>{f()},i=E4;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=o9(),Uf,Sc,qf,o4,c9=(o4=class extends $u{constructor(){super();qe(this,Uf,!0);qe(this,Sc);qe(this,qf);Me(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),Me(this,Sc,void 0))}setEventListener(e){var n;Me(this,qf,e),(n=Q(this,Sc))==null||n.call(this),Me(this,Sc,e(this.setOnline.bind(this)))}setOnline(e){Q(this,Uf)!==e&&(Me(this,Uf,e),this.listeners.forEach(s=>{s(e)}))}isOnline(){return Q(this,Uf)}},Uf=new WeakMap,Sc=new WeakMap,qf=new WeakMap,o4),_m=new c9;function u9(t){return Math.min(1e3*2**t,3e4)}function T4(t){return(t??"online")==="online"?_m.isOnline():!0}var jm=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function d9(t){return t instanceof jm}function R4(t){let e=!1,n=0,s;const i=Bx(),o=()=>i.status!=="pending",d=R=>{var O;if(!o()){const T=new jm(R);_(T),(O=t.onCancel)==null||O.call(t,T)}},f=()=>{e=!0},p=()=>{e=!1},y=()=>k1.isFocused()&&(t.networkMode==="always"||_m.isOnline())&&t.canRun(),v=()=>T4(t.networkMode)&&t.canRun(),b=R=>{o()||(s==null||s(),i.resolve(R))},_=R=>{o()||(s==null||s(),i.reject(R))},C=()=>new Promise(R=>{var O;s=T=>{(o()||y())&&R(T)},(O=t.onPause)==null||O.call(t)}).then(()=>{var R;s=void 0,o()||(R=t.onContinue)==null||R.call(t)}),w=()=>{if(o())return;let R;const O=n===0?t.initialPromise:void 0;try{R=O??t.fn()}catch(T){R=Promise.reject(T)}Promise.resolve(R).then(b).catch(T=>{var H;if(o())return;const M=t.retry??(Wf.isServer()?0:3),z=t.retryDelay??u9,k=typeof z=="function"?z(n,T):z,P=M===!0||typeof M=="number"&&n<M||typeof M=="function"&&M(n,T);if(e||!P){_(T);return}n++,(H=t.onFail)==null||H.call(t,n,T),e9(k).then(()=>y()?void 0:C()).then(()=>{e?_(T):w()})})};return{promise:i,status:()=>i.status,cancel:d,continue:()=>(s==null||s(),i),cancelRetry:f,continueRetry:p,canStart:v,start:()=>(v()?w():C().then(w),i)}}var Bu,c4,O4=(c4=class{constructor(){qe(this,Bu)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),kx(this.gcTime)&&Me(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)),Me(this,Bu,void 0))}},Bu=new WeakMap,c4),Gu,Hf,ti,Pu,Va,km,Yu,_r,A4,no,u4,M4=(u4=class extends O4{constructor(e){super();qe(this,_r);qe(this,Gu);qe(this,Hf);qe(this,ti);qe(this,Pu);qe(this,Va);qe(this,km);qe(this,Yu);Me(this,Yu,!1),Me(this,km,e.defaultOptions),this.setOptions(e.options),this.observers=[],Me(this,Pu,e.client),Me(this,ti,Q(this,Pu).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Me(this,Gu,O2(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,km),...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=O2(this.options);n.data!==void 0&&(this.setState(R2(n.data,n.dataUpdatedAt)),Me(this,Gu,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Q(this,ti).remove(this)}setData(e,n){const s=Hx(this.state.data,e,this.options);return Ie(this,_r,no).call(this,{data:s,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),s}setState(e,n){Ie(this,_r,no).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===L1||!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:!v4(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)||Ie(this,_r,A4).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||Ie(this,_r,no).call(this,{type:"invalidate"})}async fetch(e,n){var p,y,v,b,_,C,w,R,O,T,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(P=>P.options.queryFn);k&&this.setOptions(k.options)}const s=new AbortController,i=k=>{Object.defineProperty(k,"signal",{enumerable:!0,get:()=>(Me(this,Yu,!0),s.signal)})},o=()=>{const k=N4(this.options,n),H=(()=>{const L={client:Q(this,Pu),queryKey:this.queryKey,meta:this.meta};return i(L),L})();return Me(this,Yu,!1),this.options.persister?this.options.persister(k,H,this):k(H)},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),Me(this,Hf,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((v=f.fetchOptions)==null?void 0:v.meta))&&Ie(this,_r,no).call(this,{type:"fetch",meta:(b=f.fetchOptions)==null?void 0:b.meta}),Me(this,Va,R4({initialPromise:n==null?void 0:n.initialPromise,fn:f.fetchFn,onCancel:k=>{k instanceof jm&&k.revert&&this.setState({...Q(this,Hf),fetchStatus:"idle"}),s.abort()},onFail:(k,P)=>{Ie(this,_r,no).call(this,{type:"failed",failureCount:k,error:P})},onPause:()=>{Ie(this,_r,no).call(this,{type:"pause"})},onContinue:()=>{Ie(this,_r,no).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),(C=(_=Q(this,ti).config).onSuccess)==null||C.call(_,k,this),(R=(w=Q(this,ti).config).onSettled)==null||R.call(w,k,this.state.error,this),k}catch(k){if(k instanceof jm){if(k.silent)return Q(this,Va).promise;if(k.revert){if(this.state.data===void 0)throw k;return this.state.data}}throw Ie(this,_r,no).call(this,{type:"error",error:k}),(T=(O=Q(this,ti).config).onError)==null||T.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,km=new WeakMap,Yu=new WeakMap,_r=new WeakSet,A4=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},no=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,...D4(s.data,this.options),fetchMeta:e.meta??null};case"success":const i={...s,...R2(e.data,e.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Me(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})})},u4);function D4(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:T4(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function R2(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function O2(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,Lm,qs,Vu,Bf,ro,Nc,Um,Gf,Pf,Qu,Ku,_c,Yf,an,lm,Px,Yx,Vx,Qx,Kx,Xx,Fx,z4,d4,sh=(d4=class extends $u{constructor(e,n){super();qe(this,an);qe(this,or);qe(this,qt);qe(this,Lm);qe(this,qs);qe(this,Vu);qe(this,Bf);qe(this,ro);qe(this,Nc);qe(this,Um);qe(this,Gf);qe(this,Pf);qe(this,Qu);qe(this,Ku);qe(this,_c);qe(this,Yf,new Set);this.options=n,Me(this,or,e),Me(this,Nc,null),Me(this,ro,Bx()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Q(this,qt).addObserver(this),M2(Q(this,qt),this.options)?Ie(this,an,lm).call(this):this.updateResult(),Ie(this,an,Qx).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Zx(Q(this,qt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Zx(Q(this,qt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ie(this,an,Kx).call(this),Ie(this,an,Xx).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");Ie(this,an,Fx).call(this),Q(this,qt).setOptions(this.options),n._defaulted&&!Nm(this.options,n)&&Q(this,or).getQueryCache().notify({type:"observerOptionsUpdated",query:Q(this,qt),observer:this});const i=this.hasListeners();i&&A2(Q(this,qt),s,this.options,n)&&Ie(this,an,lm).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)))&&Ie(this,an,Px).call(this);const o=Ie(this,an,Yx).call(this);i&&(Q(this,qt)!==s||ai(this.options.enabled,Q(this,qt))!==ai(n.enabled,Q(this,qt))||o!==Q(this,_c))&&Ie(this,an,Vx).call(this,o)}getOptimisticResult(e){const n=Q(this,or).getQueryCache().build(Q(this,or),e),s=this.createResult(n,e);return h9(this,s)&&(Me(this,qs,s),Me(this,Bf,this.options),Me(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,ro).status==="pending"&&Q(this,ro).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 Ie(this,an,lm).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,Lm),{state:v}=e;let b={...v},_=!1,C;if(n._optimisticResults){const F=this.hasListeners(),re=!F&&M2(e,n),ne=F&&A2(e,s,n,i);(re||ne)&&(b={...b,...D4(v.data,e.options)}),n._optimisticResults==="isRestoring"&&(b.fetchStatus="idle")}let{error:w,errorUpdatedAt:R,status:O}=b;C=b.data;let T=!1;if(n.placeholderData!==void 0&&C===void 0&&O==="pending"){let F;o!=null&&o.isPlaceholderData&&n.placeholderData===(f==null?void 0:f.placeholderData)?(F=o.data,T=!0):F=typeof n.placeholderData=="function"?n.placeholderData((V=Q(this,Pf))==null?void 0:V.state.data,Q(this,Pf)):n.placeholderData,F!==void 0&&(O="success",C=Hx(o==null?void 0:o.data,F,n),_=!0)}if(n.select&&C!==void 0&&!T)if(o&&C===(d==null?void 0:d.data)&&n.select===Q(this,Um))C=Q(this,Gf);else try{Me(this,Um,n.select),C=n.select(C),C=Hx(o==null?void 0:o.data,C,n),Me(this,Gf,C),Me(this,Nc,null)}catch(F){Me(this,Nc,F)}Q(this,Nc)&&(w=Q(this,Nc),C=Q(this,Gf),R=Date.now(),O="error");const M=b.fetchStatus==="fetching",z=O==="pending",k=O==="error",P=z&&M,H=C!==void 0,U={status:O,fetchStatus:b.fetchStatus,isPending:z,isSuccess:O==="success",isError:k,isInitialLoading:P,isLoading:P,data:C,dataUpdatedAt:b.dataUpdatedAt,error:w,errorUpdatedAt:R,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&&!H,isPaused:b.fetchStatus==="paused",isPlaceholderData:_,isRefetchError:k&&H,isStale:Qb(e,n),refetch:this.refetch,promise:Q(this,ro),isEnabled:ai(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const F=U.data!==void 0,re=U.status==="error"&&!F,ne=ce=>{re?ce.reject(U.error):F&&ce.resolve(U.data)},I=()=>{const ce=Me(this,ro,U.promise=Bx());ne(ce)},ie=Q(this,ro);switch(ie.status){case"pending":e.queryHash===s.queryHash&&ne(ie);break;case"fulfilled":(re||U.data!==ie.value)&&I();break;case"rejected":(!re||U.error!==ie.reason)&&I();break}}return U}updateResult(){const e=Q(this,qs),n=this.createResult(Q(this,qt),this.options);if(Me(this,Vu,Q(this,qt).state),Me(this,Bf,this.options),Q(this,Vu).data!==void 0&&Me(this,Pf,Q(this,qt)),Nm(n,e))return;Me(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)})};Ie(this,an,z4).call(this,{listeners:s()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ie(this,an,Qx).call(this)}},or=new WeakMap,qt=new WeakMap,Lm=new WeakMap,qs=new WeakMap,Vu=new WeakMap,Bf=new WeakMap,ro=new WeakMap,Nc=new WeakMap,Um=new WeakMap,Gf=new WeakMap,Pf=new WeakMap,Qu=new WeakMap,Ku=new WeakMap,_c=new WeakMap,Yf=new WeakMap,an=new WeakSet,lm=function(e){Ie(this,an,Fx).call(this);let n=Q(this,qt).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(ma)),n},Px=function(){Ie(this,an,Kx).call(this);const e=Oc(this.options.staleTime,Q(this,qt));if(Wf.isServer()||Q(this,qs).isStale||!kx(e))return;const s=v4(Q(this,qs).dataUpdatedAt,e)+1;Me(this,Qu,Rc.setTimeout(()=>{Q(this,qs).isStale||this.updateResult()},s))},Yx=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Q(this,qt)):this.options.refetchInterval)??!1},Vx=function(e){Ie(this,an,Xx).call(this),Me(this,_c,e),!(Wf.isServer()||ai(this.options.enabled,Q(this,qt))===!1||!kx(Q(this,_c))||Q(this,_c)===0)&&Me(this,Ku,Rc.setInterval(()=>{(this.options.refetchIntervalInBackground||k1.isFocused())&&Ie(this,an,lm).call(this)},Q(this,_c)))},Qx=function(){Ie(this,an,Px).call(this),Ie(this,an,Vx).call(this,Ie(this,an,Yx).call(this))},Kx=function(){Q(this,Qu)&&(Rc.clearTimeout(Q(this,Qu)),Me(this,Qu,void 0))},Xx=function(){Q(this,Ku)&&(Rc.clearInterval(Q(this,Ku)),Me(this,Ku,void 0))},Fx=function(){const e=Q(this,or).getQueryCache().build(Q(this,or),this.options);if(e===Q(this,qt))return;const n=Q(this,qt);Me(this,qt,e),Me(this,Lm,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},z4=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"})})},d4);function f9(t,e){return ai(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function M2(t,e){return f9(t,e)||t.state.data!==void 0&&Zx(t,e,e.refetchOnMount)}function Zx(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&&Qb(t,e)}return!1}function A2(t,e,n,s){return(t!==e||ai(s.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&Qb(t,n)}function Qb(t,e){return ai(e.enabled,t)!==!1&&t.isStaleByTime(Oc(e.staleTime,t))}function h9(t,e){return!Nm(t.getCurrentResult(),e)}function b1(t){return{onFetch:(e,n)=>{var v,b,_,C,w;const s=e.options,i=(_=(b=(v=e.fetchOptions)==null?void 0:v.meta)==null?void 0:b.fetchMore)==null?void 0:_.direction,o=((C=e.state.data)==null?void 0:C.pages)||[],d=((w=e.state.data)==null?void 0:w.pageParams)||[];let f={pages:[],pageParams:[]},p=0;const y=async()=>{let R=!1;const O=z=>{_4(z,()=>e.signal,()=>R=!0)},T=N4(e.options,e.fetchOptions),M=async(z,k,P)=>{if(R)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:P?"backward":"forward",meta:e.options.meta};return O(re),re})(),U=await T(L),{maxPages:V}=e.options,F=P?n9:S4;return{pages:F(z.pages,U,V),pageParams:F(z.pageParams,k,V)}};if(i&&o.length){const z=i==="backward",k=z?k4:Jx,P={pages:o,pageParams:d},H=k(s,P);f=await M(P,H,z)}else{const z=t??o.length;do{const k=p===0?d[0]??s.initialPageParam:Jx(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 R,O;return(O=(R=e.options).persister)==null?void 0:O.call(R,y,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=y}}}function Jx(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 k4(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 p9(t,e){return e?Jx(t,e)!=null:!1}function m9(t,e){return!e||!t.getPreviousPageParam?!1:k4(t,e)!=null}var Kb=class extends sh{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:b1()})}getOptimisticResult(t){return t.behavior=b1(),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,R;const{state:n}=t,s=super.createResult(t,e),{isFetching:i,isRefetching:o,isError:d,isRefetchError:f}=s,p=(R=(w=n.fetchMeta)==null?void 0:w.fetchMore)==null?void 0:R.direction,y=d&&p==="forward",v=i&&p==="forward",b=d&&p==="backward",_=i&&p==="backward";return{...s,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:p9(e,n.data),hasPreviousPage:m9(e,n.data),isFetchNextPageError:y,isFetchingNextPage:v,isFetchPreviousPageError:b,isFetchingPreviousPage:_,isRefetchError:f&&!y&&!b,isRefetching:o&&!v&&!_}}},qm,cl,bs,Xu,ul,hc,f4,L4=(f4=class extends O4{constructor(e){super();qe(this,ul);qe(this,qm);qe(this,cl);qe(this,bs);qe(this,Xu);Me(this,qm,e.client),this.mutationId=e.mutationId,Me(this,bs,e.mutationCache),Me(this,cl,[]),this.state=e.state||U4(),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,cl).includes(e)||(Q(this,cl).push(e),this.clearGcTimeout(),Q(this,bs).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Me(this,cl,Q(this,cl).filter(n=>n!==e)),this.scheduleGc(),Q(this,bs).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){Q(this,cl).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,v,b,_,C,w,R,O,T,M,z,k,P,H,L;const n=()=>{Ie(this,ul,hc).call(this,{type:"continue"})},s={client:Q(this,qm),meta:this.options.meta,mutationKey:this.options.mutationKey};Me(this,Xu,R4({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(new Error("No mutationFn found")),onFail:(U,V)=>{Ie(this,ul,hc).call(this,{type:"failed",failureCount:U,error:V})},onPause:()=>{Ie(this,ul,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{Ie(this,ul,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&&Ie(this,ul,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=(v=this.options).onSuccess)==null?void 0:b.call(v,U,e,this.state.context,s)),await((C=(_=Q(this,bs).config).onSettled)==null?void 0:C.call(_,U,null,this.state.variables,this.state.context,this,s)),await((R=(w=this.options).onSettled)==null?void 0:R.call(w,U,null,e,this.state.context,s)),Ie(this,ul,hc).call(this,{type:"success",data:U}),U}catch(U){try{await((T=(O=Q(this,bs).config).onError)==null?void 0:T.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((P=(k=Q(this,bs).config).onSettled)==null?void 0:P.call(k,void 0,U,this.state.variables,this.state.context,this,s))}catch(V){Promise.reject(V)}try{await((L=(H=this.options).onSettled)==null?void 0:L.call(H,void 0,U,e,this.state.context,s))}catch(V){Promise.reject(V)}throw Ie(this,ul,hc).call(this,{type:"error",error:U}),U}finally{Q(this,bs).runNext(this)}}},qm=new WeakMap,cl=new WeakMap,bs=new WeakMap,Xu=new WeakMap,ul=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,cl).forEach(s=>{s.onMutationUpdate(e)}),Q(this,bs).notify({mutation:this,type:"updated",action:e})})},f4);function U4(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var io,wi,Hm,h4,q4=(h4=class extends $u{constructor(e={}){super();qe(this,io);qe(this,wi);qe(this,Hm);this.config=e,Me(this,io,new Set),Me(this,wi,new Map),Me(this,Hm,0)}build(e,n,s){const i=new L4({client:e,mutationCache:this,mutationId:++U0(this,Hm)._,options:e.defaultMutationOptions(n),state:s});return this.add(i),i}add(e){Q(this,io).add(e);const n=q0(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,io).delete(e)){const n=q0(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=q0(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=q0(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,io).forEach(e=>{this.notify({type:"removed",mutation:e})}),Q(this,io).clear(),Q(this,wi).clear()})}getAll(){return Array.from(Q(this,io))}find(e){const n={exact:!0,...e};return this.getAll().find(s=>Ux(n,s))}findAll(e={}){return this.getAll().filter(n=>Ux(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))))}},io=new WeakMap,wi=new WeakMap,Hm=new WeakMap,h4);function q0(t){var e;return(e=t.options.scope)==null?void 0:e.id}var lo,jc,cr,oo,fo,d1,Ix,p4,H4=(p4=class extends $u{constructor(n,s){super();qe(this,fo);qe(this,lo);qe(this,jc);qe(this,cr);qe(this,oo);Me(this,lo,n),this.setOptions(s),this.bindMethods(),Ie(this,fo,d1).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,lo).defaultMutationOptions(n),Nm(this.options,s)||Q(this,lo).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){Ie(this,fo,d1).call(this),Ie(this,fo,Ix).call(this,n)}getCurrentResult(){return Q(this,jc)}reset(){var n;(n=Q(this,cr))==null||n.removeObserver(this),Me(this,cr,void 0),Ie(this,fo,d1).call(this),Ie(this,fo,Ix).call(this)}mutate(n,s){var i;return Me(this,oo,s),(i=Q(this,cr))==null||i.removeObserver(this),Me(this,cr,Q(this,lo).getMutationCache().build(Q(this,lo),this.options)),Q(this,cr).addObserver(this),Q(this,cr).execute(n)}},lo=new WeakMap,jc=new WeakMap,cr=new WeakMap,oo=new WeakMap,fo=new WeakSet,d1=function(){var s;const n=((s=Q(this,cr))==null?void 0:s.state)??U4();Me(this,jc,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Ix=function(n){Un.batch(()=>{var s,i,o,d,f,p,y,v;if(Q(this,oo)&&this.hasListeners()){const b=Q(this,jc).variables,_=Q(this,jc).context,C={client:Q(this,lo),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(i=(s=Q(this,oo)).onSuccess)==null||i.call(s,n.data,b,_,C)}catch(w){Promise.reject(w)}try{(d=(o=Q(this,oo)).onSettled)==null||d.call(o,n.data,null,b,_,C)}catch(w){Promise.reject(w)}}else if((n==null?void 0:n.type)==="error"){try{(p=(f=Q(this,oo)).onError)==null||p.call(f,n.error,b,_,C)}catch(w){Promise.reject(w)}try{(v=(y=Q(this,oo)).onSettled)==null||v.call(y,void 0,n.error,b,_,C)}catch(w){Promise.reject(w)}}}this.listeners.forEach(b=>{b(Q(this,jc))})})},p4);function D2(t,e){const n=new Set(e);return t.filter(s=>!n.has(s))}function g9(t,e,n){const s=t.slice(0);return s[e]=n,s}var Vf,Nr,Qf,Kf,ni,Cc,Bm,Gm,Pm,Ym,ss,Wx,$x,eb,tb,nb,m4,B4=(m4=class extends $u{constructor(e,n,s){super();qe(this,ss);qe(this,Vf);qe(this,Nr);qe(this,Qf);qe(this,Kf);qe(this,ni);qe(this,Cc);qe(this,Bm);qe(this,Gm);qe(this,Pm);qe(this,Ym,[]);Me(this,Vf,e),Me(this,Kf,s),Me(this,Qf,[]),Me(this,ni,[]),Me(this,Nr,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&Q(this,ni).forEach(e=>{e.subscribe(n=>{Ie(this,ss,tb).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){Me(this,Qf,e),Me(this,Kf,n),Un.batch(()=>{const s=Q(this,ni),i=Ie(this,ss,eb).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,v=y?!0:d.some((b,_)=>{const C=Q(this,Nr)[_];return!C||!Nm(b,C)});!y&&!v||(y&&(Me(this,Ym,i),Me(this,ni,o)),Me(this,Nr,d),this.hasListeners()&&(y&&(D2(s,o).forEach(b=>{b.destroy()}),D2(o,s).forEach(b=>{b.subscribe(_=>{Ie(this,ss,tb).call(this,b,_)})})),Ie(this,ss,nb).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=Ie(this,ss,eb).call(this,e),i=s.map(d=>d.observer.getOptimisticResult(d.defaultedQueryOptions)),o=s.map(d=>d.defaultedQueryOptions.queryHash);return[i,d=>Ie(this,ss,$x).call(this,d??i,n,o),()=>Ie(this,ss,Wx).call(this,i,s)]}},Vf=new WeakMap,Nr=new WeakMap,Qf=new WeakMap,Kf=new WeakMap,ni=new WeakMap,Cc=new WeakMap,Bm=new WeakMap,Gm=new WeakMap,Pm=new WeakMap,Ym=new WeakMap,ss=new WeakSet,Wx=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)})})})},$x=function(e,n,s){if(n){const i=Q(this,Pm),o=s!==void 0&&i!==void 0&&(i.length!==s.length||s.some((d,f)=>d!==i[f]));return(!Q(this,Cc)||Q(this,Nr)!==Q(this,Gm)||o||n!==Q(this,Bm))&&(Me(this,Bm,n),Me(this,Gm,Q(this,Nr)),s!==void 0&&Me(this,Pm,s),Me(this,Cc,Vm(Q(this,Cc),n(e)))),Q(this,Cc)}return e},eb=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 sh(Q(this,Vf),o);s.push({defaultedQueryOptions:o,observer:f})}),s},tb=function(e,n){const s=Q(this,ni).indexOf(e);s!==-1&&(Me(this,Nr,g9(Q(this,Nr),s,n)),Ie(this,ss,nb).call(this))},nb=function(){var e;if(this.hasListeners()){const n=Q(this,Cc),s=Ie(this,ss,Wx).call(this,Q(this,Nr),Q(this,Ym)),i=Ie(this,ss,$x).call(this,s,(e=Q(this,Kf))==null?void 0:e.combine);n!==i&&Un.batch(()=>{this.listeners.forEach(o=>{o(Q(this,Nr))})})}},m4),dl,g4,G4=(g4=class extends $u{constructor(e={}){super();qe(this,dl);this.config=e,Me(this,dl,new Map)}build(e,n,s){const i=n.queryKey,o=n.queryHash??Vb(i,n);let d=this.get(o);return d||(d=new M4({client:e,queryKey:i,queryHash:o,options:e.defaultQueryOptions(n),state:s,defaultOptions:e.getQueryDefaults(i)}),this.add(d)),d}add(e){Q(this,dl).has(e.queryHash)||(Q(this,dl).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=Q(this,dl).get(e.queryHash);n&&(e.destroy(),n===e&&Q(this,dl).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Un.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return Q(this,dl).get(e)}getAll(){return[...Q(this,dl).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(s=>Lx(n,s))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(s=>Lx(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()})})}},dl=new WeakMap,g4),ra,wc,Ec,Xf,Ff,Tc,Zf,Jf,y4,P4=(y4=class{constructor(t={}){qe(this,ra);qe(this,wc);qe(this,Ec);qe(this,Xf);qe(this,Ff);qe(this,Tc);qe(this,Zf);qe(this,Jf);Me(this,ra,t.queryCache||new G4),Me(this,wc,t.mutationCache||new q4),Me(this,Ec,t.defaultOptions||{}),Me(this,Xf,new Map),Me(this,Ff,new Map),Me(this,Tc,0)}mount(){U0(this,Tc)._++,Q(this,Tc)===1&&(Me(this,Zf,k1.subscribe(async t=>{t&&(await this.resumePausedMutations(),Q(this,ra).onFocus())})),Me(this,Jf,_m.subscribe(async t=>{t&&(await this.resumePausedMutations(),Q(this,ra).onOnline())})))}unmount(){var t,e;U0(this,Tc)._--,Q(this,Tc)===0&&((t=Q(this,Zf))==null||t.call(this),Me(this,Zf,void 0),(e=Q(this,Jf))==null||e.call(this),Me(this,Jf,void 0))}isFetching(t){return Q(this,ra).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,ra).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=Q(this,ra).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,ra).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,ra).get(s.queryHash),o=i==null?void 0:i.state.data,d=W7(e,o);if(d!==void 0)return Q(this,ra).build(this,s).setData(d,{...n,manual:!0})}setQueriesData(t,e,n){return Un.batch(()=>Q(this,ra).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,ra).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=Q(this,ra);Un.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=Q(this,ra);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,ra).findAll(t).map(i=>i.cancel(n)));return Promise.all(s).then(ma).catch(ma)}invalidateQueries(t,e={}){return Un.batch(()=>(Q(this,ra).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,ra).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,ra).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=b1(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(ma).catch(ma)}ensureInfiniteQueryData(t){return t.behavior=b1(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return _m.isOnline()?Q(this,wc).resumePausedMutations():Promise.resolve()}getQueryCache(){return Q(this,ra)}getMutationCache(){return Q(this,wc)}getDefaultOptions(){return Q(this,Ec)}setDefaultOptions(t){Me(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=>{If(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=>{If(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=Vb(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===L1&&(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,ra).clear(),Q(this,wc).clear()}},ra=new WeakMap,wc=new WeakMap,Ec=new WeakMap,Xf=new WeakMap,Ff=new WeakMap,Tc=new WeakMap,Zf=new WeakMap,Jf=new WeakMap,y4);function y9({streamFn:t,refetchMode:e="reset",reducer:n=(i,o)=>S4(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=_4({client:i.client,meta:i.meta,queryKey:i.queryKey,pageParam:i.pageParam,direction:i.direction},()=>i.signal,()=>p=!0),v=await t(y),b=d&&e==="replace";for await(const _ of v){if(p)break;b?f=n(f,_):i.client.setQueryData(i.queryKey,C=>n(C===void 0?s:C,_))}return b&&!p&&i.client.setQueryData(i.queryKey,f),i.client.getQueryData(i.queryKey)??s}}var x9=Symbol("dataTagSymbol"),b9=Symbol("dataTagErrorSymbol"),v9=Symbol("unsetMarker"),Xb=D.createContext(void 0),ga=t=>{const e=D.useContext(Xb);if(t)return t;if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Y4=({client:t,children:e})=>(D.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),h.jsx(Xb.Provider,{value:t,children:e})),V4=D.createContext(!1),Fb=()=>D.useContext(V4),S9=V4.Provider;function Q4(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var K4=D.createContext(Q4()),Zb=()=>D.useContext(K4),N9=({children:t})=>{const[e]=D.useState(()=>Q4());return h.jsx(K4.Provider,{value:e,children:typeof t=="function"?t(e):t})},X4=(t,e,n)=>{const s=n!=null&&n.state.error&&typeof t.throwOnError=="function"?U1(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||s)&&(e.isReset()||(t.retryOnMount=!1))},F4=t=>{D.useEffect(()=>{t.clearReset()},[t])},Z4=({result:t,errorResetBoundary:e,throwOnError:n,query:s,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&s&&(i&&t.data===void 0||U1(n,[t.error,s])),Jb=(t,e)=>e.state.data===void 0,J4=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))}},_9=(t,e)=>t.isLoading&&t.isFetching&&!e,ab=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,sb=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function I4({queries:t,...e},n){const s=ga(n),i=Fb(),o=Zb(),d=D.useMemo(()=>t.map(R=>{const O=s.defaultQueryOptions(R);return O._optimisticResults=i?"isRestoring":"optimistic",O}),[t,s,i]);d.forEach(R=>{J4(R);const O=s.getQueryCache().get(R.queryHash);X4(R,o,O)}),F4(o);const[f]=D.useState(()=>new B4(s,d,e)),[p,y,v]=f.getOptimisticResult(d,e.combine),b=!i&&e.subscribed!==!1;D.useSyncExternalStore(D.useCallback(R=>b?f.subscribe(Un.batchCalls(R)):ma,[f,b]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),D.useEffect(()=>{f.setQueries(d,e)},[d,e,f]);const C=p.some((R,O)=>ab(d[O],R))?p.flatMap((R,O)=>{const T=d[O];if(T&&ab(T,R)){const M=new sh(s,T);return sb(T,M,o)}return[]}):[];if(C.length>0)throw Promise.all(C);const w=p.find((R,O)=>{const T=d[O];return T&&Z4({result:R,errorResetBoundary:o,throwOnError:T.throwOnError,query:s.getQueryCache().get(T.queryHash),suspense:T.suspense})});if(w!=null&&w.error)throw w.error;return y(v())}function q1(t,e,n){var _,C,w,R;const s=Fb(),i=Zb(),o=ga(n),d=o.defaultQueryOptions(t);(C=(_=o.getDefaultOptions().queries)==null?void 0:_._experimental_beforeQuery)==null||C.call(_,d);const f=o.getQueryCache().get(d.queryHash);d._optimisticResults=s?"isRestoring":"optimistic",J4(d),X4(d,i,f),F4(i);const p=!o.getQueryCache().get(d.queryHash),[y]=D.useState(()=>new e(o,d)),v=y.getOptimisticResult(d),b=!s&&t.subscribed!==!1;if(D.useSyncExternalStore(D.useCallback(O=>{const T=b?y.subscribe(Un.batchCalls(O)):ma;return y.updateResult(),T},[y,b]),()=>y.getCurrentResult(),()=>y.getCurrentResult()),D.useEffect(()=>{y.setOptions(d)},[d,y]),ab(d,v))throw sb(d,y,i);if(Z4({result:v,errorResetBoundary:i,throwOnError:d.throwOnError,query:f,suspense:d.suspense}))throw v.error;if((R=(w=o.getDefaultOptions().queries)==null?void 0:w._experimental_afterQuery)==null||R.call(w,d,v),d.experimental_prefetchInRender&&!Wf.isServer()&&_9(v,s)){const O=p?sb(d,y,i):f==null?void 0:f.promise;O==null||O.catch(ma).finally(()=>{y.updateResult()})}return d.notifyOnChangeProps?v:y.trackResult(v)}function ot(t,e){return q1(t,sh,e)}function j9(t,e){return q1({...t,enabled:!0,suspense:!0,throwOnError:Jb,placeholderData:void 0},sh,e)}function C9(t,e){return q1({...t,enabled:!0,suspense:!0,throwOnError:Jb},Kb,e)}function w9(t,e){return I4({...t,queries:t.queries.map(n=>({...n,suspense:!0,throwOnError:Jb,enabled:!0,placeholderData:void 0}))},e)}function E9(t,e){const n=ga(e);n.getQueryState(t.queryKey)||n.prefetchQuery(t)}function T9(t,e){const n=ga(e);n.getQueryState(t.queryKey)||n.prefetchInfiniteQuery(t)}function R9(t){return t}function O9(t){return t}var M9=({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=[],v=[];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)&&v.push(b):y.push(b)}if(y.length>0&&Gx(i,{queries:y},o.current),v.length>0)return v}},[i,n]);return D.useEffect(()=>{d&&Gx(i,{queries:d},o.current)},[i,d]),t};function A9(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 D9(t,e){const n=ga(e);return W4({filters:{...t,status:"pending"}},n).length}function z2(t,e){return t.findAll(e.filters).map(n=>e.select?e.select(n):n.state)}function W4(t={},e){const n=ga(e).getMutationCache(),s=D.useRef(t),i=D.useRef(null);return i.current===null&&(i.current=z2(n,t)),D.useEffect(()=>{s.current=t}),D.useSyncExternalStore(D.useCallback(o=>n.subscribe(()=>{const d=Vm(i.current,z2(n,s.current));i.current!==d&&(i.current=d,Un.schedule(o))}),[n]),()=>i.current,()=>i.current)}function Cn(t,e){const n=ga(e),[s]=D.useState(()=>new H4(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&&U1(s.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}function z9(t){return t}function k9(t,e){return q1(t,Kb,e)}const L9=Object.freeze(Object.defineProperty({__proto__:null,CancelledError:jm,HydrationBoundary:M9,InfiniteQueryObserver:Kb,IsRestoringProvider:S9,Mutation:L4,MutationCache:q4,MutationObserver:H4,QueriesObserver:B4,Query:M4,QueryCache:G4,QueryClient:P4,QueryClientContext:Xb,QueryClientProvider:Y4,QueryErrorResetBoundary:N9,QueryObserver:sh,dataTagErrorSymbol:b9,dataTagSymbol:x9,defaultScheduler:E4,defaultShouldDehydrateMutation:C4,defaultShouldDehydrateQuery:w4,dehydrate:l9,environmentManager:Wf,experimental_streamedQuery:y9,focusManager:k1,hashKey:Ac,hydrate:Gx,infiniteQueryOptions:O9,isCancelledError:d9,isServer:b4,keepPreviousData:t9,matchMutation:Ux,matchQuery:Lx,mutationOptions:z9,noop:ma,notifyManager:Un,onlineManager:_m,partialMatchKey:If,queryOptions:R9,replaceEqualDeep:Vm,shouldThrowError:U1,skipToken:L1,timeoutManager:Rc,unsetMarker:v9,useInfiniteQuery:k9,useIsFetching:A9,useIsMutating:D9,useIsRestoring:Fb,useMutation:Cn,useMutationState:W4,usePrefetchInfiniteQuery:T9,usePrefetchQuery:E9,useQueries:I4,useQuery:ot,useQueryClient:ga,useQueryErrorResetBoundary:Zb,useSuspenseInfiniteQuery:C9,useSuspenseQueries:w9,useSuspenseQuery:j9},Symbol.toStringTag,{value:"Module"}));function U9(){window.__camstack={React:en,ReactDOM:X7,ReactQuery:L9}}/**
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 k2="popstate";function L2(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function q9(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 rb("",{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:Cm(i)}return B9(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 H9(){return Math.random().toString(36).substring(2,10)}function U2(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 rb(t,e,n=null,s,i){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?rh(e):e,state:n,key:e&&e.key||s||H9(),unstable_mask:i}}function Cm({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 rh(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 B9(t,e,n,s={}){let{window:i=document.defaultView,v5Compat:o=!1}=s,d=i.history,f="POP",p=null,y=v();y==null&&(y=0,d.replaceState({...d.state,idx:y},""));function v(){return(d.state||{idx:null}).idx}function b(){f="POP";let O=v(),T=O==null?null:O-y;y=O,p&&p({action:f,location:R.location,delta:T})}function _(O,T){f="PUSH";let M=L2(O)?O:rb(R.location,O,T);y=v()+1;let z=U2(M,y),k=R.createHref(M.unstable_mask||M);try{d.pushState(z,"",k)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;i.location.assign(k)}o&&p&&p({action:f,location:R.location,delta:1})}function C(O,T){f="REPLACE";let M=L2(O)?O:rb(R.location,O,T);y=v();let z=U2(M,y),k=R.createHref(M.unstable_mask||M);d.replaceState(z,"",k),o&&p&&p({action:f,location:R.location,delta:0})}function w(O){return G9(O)}let R={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(k2,b),p=O,()=>{i.removeEventListener(k2,b),p=null}},createHref(O){return e(i,O)},createURL:w,encodeLocation(O){let T=w(O);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:_,replace:C,go(O){return d.go(O)}};return R}function G9(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:Cm(t);return s=s.replace(/ $/,"%20"),!e&&s.startsWith("//")&&(s=n+s),new URL(s,n)}function $4(t,e,n="/"){return P9(t,e,n,!1)}function P9(t,e,n,s){let i=typeof e=="string"?rh(e):e,o=ho(i.pathname||"/",n);if(o==null)return null;let d=eS(t);Y9(d);let f=null;for(let p=0;f==null&&p<d.length;++p){let y=eN(o);f=W9(d[p],y,s)}return f}function eS(t,e=[],n=[],s="",i=!1){let o=(d,f,p=i,y)=>{let v={relativePath:y===void 0?d.path||"":y,caseSensitive:d.caseSensitive===!0,childrenIndex:f,route:d};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(s)&&p)return;Vn(v.relativePath.startsWith(s),`Absolute route path "${v.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(s.length)}let b=hl([s,v.relativePath]),_=n.concat(v);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}".`),eS(d.children,e,_,b,p)),!(d.path==null&&!d.index)&&e.push({path:b,score:J9(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 tS(d.path))o(d,f,!0,y)}),e}function tS(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=tS(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 Y9(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:I9(e.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}var V9=/^:[\w-]+$/,Q9=3,K9=2,X9=1,F9=10,Z9=-2,q2=t=>t==="*";function J9(t,e){let n=t.split("/"),s=n.length;return n.some(q2)&&(s+=Z9),e&&(s+=K9),n.filter(i=>!q2(i)).reduce((i,o)=>i+(V9.test(o)?Q9:o===""?X9:F9),s)}function I9(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 W9(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,v=o==="/"?e:e.slice(o.length)||"/",b=v1({path:p.relativePath,caseSensitive:p.caseSensitive,end:y},v),_=p.route;if(!b&&y&&n&&!s[s.length-1].route.index&&(b=v1({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},v)),!b)return null;Object.assign(i,b.params),d.push({params:i,pathname:hl([o,b.pathname]),pathnameBase:sN(hl([o,b.pathnameBase])),route:_}),b.pathnameBase!=="/"&&(o=hl([o,b.pathnameBase]))}return d}function v1(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,s]=$9(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:v,isOptional:b},_)=>{if(v==="*"){let w=f[_]||"";d=o.slice(0,o.length-w.length).replace(/(.)\/+$/,"$1")}const C=f[_];return b&&!C?y[v]=void 0:y[v]=(C||"").replace(/%2F/g,"/"),y},{}),pathname:o,pathnameBase:d,pattern:t}}function $9(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,v)=>{if(s.push({paramName:f,isOptional:p!=null}),p){let b=v.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 eN(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 tN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function nN(t,e="/"){let{pathname:n,search:s="",hash:i=""}=typeof t=="string"?rh(t):t,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=H2(n.substring(1),"/"):o=H2(n,e)):o=e,{pathname:o,search:rN(s),hash:iN(i)}}function H2(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 Zy(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 aN(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function Ib(t){let e=aN(t);return e.map((n,s)=>s===e.length-1?n.pathname:n.pathnameBase)}function H1(t,e,n,s=!1){let i;typeof t=="string"?i=rh(t):(i={...t},Vn(!i.pathname||!i.pathname.includes("?"),Zy("?","pathname","search",i)),Vn(!i.pathname||!i.pathname.includes("#"),Zy("#","pathname","hash",i)),Vn(!i.search||!i.search.includes("#"),Zy("#","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=nN(i,f),y=d&&d!=="/"&&d.endsWith("/"),v=(o||d===".")&&n.endsWith("/");return!p.pathname.endsWith("/")&&(y||v)&&(p.pathname+="/"),p}var hl=t=>t.join("/").replace(/\/\/+/g,"/"),sN=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),rN=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,iN=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,lN=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 oN(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function cN(t){return t.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var nS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function aS(t,e){let n=t;if(typeof n!="string"||!tN.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let s=n,i=!1;if(nS)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 sS=["POST","PUT","PATCH","DELETE"];new Set(sS);var uN=["GET",...sS];new Set(uN);var ih=D.createContext(null);ih.displayName="DataRouter";var B1=D.createContext(null);B1.displayName="DataRouterState";var dN=D.createContext(!1),rS=D.createContext({isTransitioning:!1});rS.displayName="ViewTransition";var fN=D.createContext(new Map);fN.displayName="Fetchers";var hN=D.createContext(null);hN.displayName="Await";var wr=D.createContext(null);wr.displayName="Navigation";var Qm=D.createContext(null);Qm.displayName="Location";var ii=D.createContext({outlet:null,matches:[],isDataRoute:!1});ii.displayName="Route";var Wb=D.createContext(null);Wb.displayName="RouteError";var iS="REACT_ROUTER_ERROR",pN="REDIRECT",mN="ROUTE_ERROR_RESPONSE";function gN(t){if(t.startsWith(`${iS}:${pN}:{`))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 yN(t){if(t.startsWith(`${iS}:${mN}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new lN(e.status,e.statusText,e.data)}catch{}}function xN(t,{relative:e}={}){Vn(lh(),"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}=Km(t,{relative:e}),f=o;return n!=="/"&&(f=o==="/"?n:hl([n,o])),s.createHref({pathname:f,search:d,hash:i})}function lh(){return D.useContext(Qm)!=null}function ml(){return Vn(lh(),"useLocation() may be used only in the context of a <Router> component."),D.useContext(Qm).location}var lS="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function oS(t){D.useContext(wr).static||D.useLayoutEffect(t)}function gl(){let{isDataRoute:t}=D.useContext(ii);return t?DN():bN()}function bN(){Vn(lh(),"useNavigate() may be used only in the context of a <Router> component.");let t=D.useContext(ih),{basename:e,navigator:n}=D.useContext(wr),{matches:s}=D.useContext(ii),{pathname:i}=ml(),o=JSON.stringify(Ib(s)),d=D.useRef(!1);return oS(()=>{d.current=!0}),D.useCallback((p,y={})=>{if(Ei(d.current,lS),!d.current)return;if(typeof p=="number"){n.go(p);return}let v=H1(p,JSON.parse(o),i,y.relative==="path");t==null&&e!=="/"&&(v.pathname=v.pathname==="/"?e:hl([e,v.pathname])),(y.replace?n.replace:n.push)(v,y.state,y)},[e,n,o,i,t])}var vN=D.createContext(null);function SN(t){let e=D.useContext(ii).outlet;return D.useMemo(()=>e&&D.createElement(vN.Provider,{value:t},e),[e,t])}function $b(){let{matches:t}=D.useContext(ii),e=t[t.length-1];return e?e.params:{}}function Km(t,{relative:e}={}){let{matches:n}=D.useContext(ii),{pathname:s}=ml(),i=JSON.stringify(Ib(n));return D.useMemo(()=>H1(t,JSON.parse(i),s,e==="path"),[t,i,s,e])}function NN(t,e){return cS(t,e)}function cS(t,e,n){var O;Vn(lh(),"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 T=y&&y.path||"";dS(f,!y||T.endsWith("*")||T.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${T}">) 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="${T}"> to <Route path="${T==="/"?"*":`${T}/*`}">.`)}let v=ml(),b;if(e){let T=typeof e=="string"?rh(e):e;Vn(p==="/"||((O=T.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 "${T.pathname}" was given in the \`location\` prop.`),b=T}else b=v;let _=b.pathname||"/",C=_;if(p!=="/"){let T=p.replace(/^\//,"").split("/");C="/"+_.replace(/^\//,"").split("/").slice(T.length).join("/")}let w=$4(t,{pathname:C});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 R=EN(w&&w.map(T=>Object.assign({},T,{params:Object.assign({},d,T.params),pathname:hl([p,s.encodeLocation?s.encodeLocation(T.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?p:hl([p,s.encodeLocation?s.encodeLocation(T.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathnameBase])})),i,n);return e&&R?D.createElement(Qm.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...b},navigationType:"POP"}},R):R}function _N(){let t=AN(),e=oN(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 jN=D.createElement(_N,null),uS=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=yN(t.digest);n&&(t=n)}let e=t!==void 0?D.createElement(ii.Provider,{value:this.props.routeContext},D.createElement(Wb.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?D.createElement(CN,{error:t},e):e}};uS.contextType=dN;var Jy=new WeakMap;function CN({children:t,error:e}){let{basename:n}=D.useContext(wr);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let s=gN(e.digest);if(s){let i=Jy.get(e);if(i)throw i;let o=aS(s.location,n);if(nS&&!Jy.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 Jy.set(e,d),d}return D.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return t}function wN({routeContext:t,match:e,children:n}){let s=D.useContext(ih);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 EN(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 v=i.findIndex(b=>b.route.id&&(o==null?void 0:o[b.route.id])!==void 0);Vn(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),i=i.slice(0,Math.min(i.length,v+1))}let d=!1,f=-1;if(n&&s){d=s.renderFallback;for(let v=0;v<i.length;v++){let b=i[v];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(f=v),b.route.id){let{loaderData:_,errors:C}=s,w=b.route.loader&&!_.hasOwnProperty(b.route.id)&&(!C||C[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?(v,b)=>{var _,C;p(v,{location:s.location,params:((C=(_=s.matches)==null?void 0:_[0])==null?void 0:C.params)??{},unstable_pattern:cN(s.matches),errorInfo:b})}:void 0;return i.reduceRight((v,b,_)=>{let C,w=!1,R=null,O=null;s&&(C=o&&b.route.id?o[b.route.id]:void 0,R=b.route.errorElement||jN,d&&(f<0&&_===0?(dS("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 T=e.concat(i.slice(0,_+1)),M=()=>{let z;return C?z=R:w?z=O:b.route.Component?z=D.createElement(b.route.Component,null):b.route.element?z=b.route.element:z=v,D.createElement(wN,{match:b,routeContext:{outlet:v,matches:T,isDataRoute:s!=null},children:z})};return s&&(b.route.ErrorBoundary||b.route.errorElement||_===0)?D.createElement(uS,{location:s.location,revalidation:s.revalidation,component:R,error:C,children:M(),routeContext:{outlet:null,matches:T,isDataRoute:!0},onError:y}):M()},null)}function ev(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function TN(t){let e=D.useContext(ih);return Vn(e,ev(t)),e}function RN(t){let e=D.useContext(B1);return Vn(e,ev(t)),e}function ON(t){let e=D.useContext(ii);return Vn(e,ev(t)),e}function tv(t){let e=ON(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 MN(){return tv("useRouteId")}function AN(){var s;let t=D.useContext(Wb),e=RN("useRouteError"),n=tv("useRouteError");return t!==void 0?t:(s=e.errors)==null?void 0:s[n]}function DN(){let{router:t}=TN("useNavigate"),e=tv("useNavigate"),n=D.useRef(!1);return oS(()=>{n.current=!0}),D.useCallback(async(i,o={})=>{Ei(n.current,lS),n.current&&(typeof i=="number"?await t.navigate(i):await t.navigate(i,{fromRouteId:e,...o}))},[t,e])}var B2={};function dS(t,e,n){!e&&!B2[t]&&(B2[t]=!0,Ei(!1,n))}D.memo(zN);function zN({routes:t,future:e,state:n,isStatic:s,onError:i}){return cS(t,void 0,{state:n,isStatic:s,onError:i})}function ib({to:t,replace:e,state:n,relative:s}){Vn(lh(),"<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}=ml(),f=gl(),p=H1(t,Ib(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 kN(t){return SN(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 LN({basename:t="/",children:e=null,location:n,navigationType:s="POP",navigator:i,static:o=!1,unstable_useTransitions:d}){Vn(!lh(),"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=rh(n));let{pathname:y="/",search:v="",hash:b="",state:_=null,key:C="default",unstable_mask:w}=n,R=D.useMemo(()=>{let O=ho(y,f);return O==null?null:{location:{pathname:O,search:v,hash:b,state:_,key:C,unstable_mask:w},navigationType:s}},[f,y,v,b,_,C,s,w]);return Ei(R!=null,`<Router basename="${f}"> is not able to match the URL "${y}${v}${b}" because it does not start with the basename, so the <Router> won't render anything.`),R==null?null:D.createElement(wr.Provider,{value:p},D.createElement(Qm.Provider,{children:e,value:R}))}function UN({children:t,location:e}){return NN(lb(t),e)}function lb(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,lb(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=lb(s.props.children,o)),n.push(d)}),n}var f1="get",h1="application/x-www-form-urlencoded";function G1(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function qN(t){return G1(t)&&t.tagName.toLowerCase()==="button"}function HN(t){return G1(t)&&t.tagName.toLowerCase()==="form"}function BN(t){return G1(t)&&t.tagName.toLowerCase()==="input"}function GN(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function PN(t,e){return t.button===0&&(!e||e==="_self")&&!GN(t)}var H0=null;function YN(){if(H0===null)try{new FormData(document.createElement("form"),0),H0=!1}catch{H0=!0}return H0}var VN=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Iy(t){return t!=null&&!VN.has(t)?(Ei(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${h1}"`),null):t}function QN(t,e){let n,s,i,o,d;if(HN(t)){let f=t.getAttribute("action");s=f?ho(f,e):null,n=t.getAttribute("method")||f1,i=Iy(t.getAttribute("enctype"))||h1,o=new FormData(t)}else if(qN(t)||BN(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")||f1,i=Iy(t.getAttribute("formenctype"))||Iy(f.getAttribute("enctype"))||h1,o=new FormData(f,t),!YN()){let{name:y,type:v,value:b}=t;if(v==="image"){let _=y?`${y}.`:"";o.append(`${_}x`,"0"),o.append(`${_}y`,"0")}else y&&o.append(y,b)}}else{if(G1(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=f1,s=null,i=h1,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 nv(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function KN(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 XN(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 FN(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 ZN(t,e,n){let s=await Promise.all(t.map(async i=>{let o=e.routes[i.route.id];if(o){let d=await XN(o,n);return d.links?d.links():[]}return[]}));return $N(s.flat(1).filter(FN).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function G2(t,e,n,s,i,o){let d=(p,y)=>n[y]?p.route.id!==n[y].route.id:!0,f=(p,y)=>{var v;return n[y].pathname!==p.pathname||((v=n[y].route.path)==null?void 0:v.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 v=s.routes[p.route.id];if(!v||!v.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 JN(t,e,{includeHydrateFallback:n}={}){return IN(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 IN(t){return[...new Set(t)]}function WN(t){let e={},n=Object.keys(t).sort();for(let s of n)e[s]=t[s];return e}function $N(t,e){let n=new Set;return new Set(e),t.reduce((s,i)=>{let o=JSON.stringify(WN(i));return n.has(o)||(n.add(o),s.push({key:o,link:i})),s},[])}function fS(){let t=D.useContext(ih);return nv(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function e_(){let t=D.useContext(B1);return nv(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var av=D.createContext(void 0);av.displayName="FrameworkContext";function hS(){let t=D.useContext(av);return nv(t,"You must render this element inside a <HydratedRouter> element"),t}function t_(t,e){let n=D.useContext(av),[s,i]=D.useState(!1),[o,d]=D.useState(!1),{onFocus:f,onBlur:p,onMouseEnter:y,onMouseLeave:v,onTouchStart:b}=e,_=D.useRef(null);D.useEffect(()=>{if(t==="render"&&d(!0),t==="viewport"){let R=T=>{T.forEach(M=>{d(M.isIntersecting)})},O=new IntersectionObserver(R,{threshold:.5});return _.current&&O.observe(_.current),()=>{O.disconnect()}}},[t]),D.useEffect(()=>{if(s){let R=setTimeout(()=>{d(!0)},100);return()=>{clearTimeout(R)}}},[s]);let C=()=>{i(!0)},w=()=>{i(!1),d(!1)};return n?t!=="intent"?[o,_,{}]:[o,_,{onFocus:Vp(f,C),onBlur:Vp(p,w),onMouseEnter:Vp(y,C),onMouseLeave:Vp(v,w),onTouchStart:Vp(b,C)}]:[!1,_,{}]}function Vp(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function n_({page:t,...e}){let{router:n}=fS(),s=D.useMemo(()=>$4(n.routes,t,n.basename),[n.routes,t,n.basename]);return s?D.createElement(s_,{page:t,matches:s,...e}):null}function a_(t){let{manifest:e,routeModules:n}=hS(),[s,i]=D.useState([]);return D.useEffect(()=>{let o=!1;return ZN(t,e,n).then(d=>{o||i(d)}),()=>{o=!0}},[t,e,n]),s}function s_({page:t,matches:e,...n}){let s=ml(),{future:i,manifest:o,routeModules:d}=hS(),{basename:f}=fS(),{loaderData:p,matches:y}=e_(),v=D.useMemo(()=>G2(t,e,y,o,s,"data"),[t,e,y,o,s]),b=D.useMemo(()=>G2(t,e,y,o,s,"assets"),[t,e,y,o,s]),_=D.useMemo(()=>{if(t===s.pathname+s.search+s.hash)return[];let R=new Set,O=!1;if(e.forEach(M=>{var k;let z=o.routes[M.route.id];!z||!z.hasLoader||(!v.some(P=>P.route.id===M.route.id)&&M.route.id in p&&((k=d[M.route.id])!=null&&k.shouldRevalidate)||z.hasClientLoader?O=!0:R.add(M.route.id))}),R.size===0)return[];let T=KN(t,f,i.unstable_trailingSlashAwareDataRequests,"data");return O&&R.size>0&&T.searchParams.set("_routes",e.filter(M=>R.has(M.route.id)).map(M=>M.route.id).join(",")),[T.pathname+T.search]},[f,i.unstable_trailingSlashAwareDataRequests,p,s,o,v,e,t,d]),C=D.useMemo(()=>JN(b,o),[b,o]),w=a_(b);return D.createElement(D.Fragment,null,_.map(R=>D.createElement("link",{key:R,rel:"prefetch",as:"fetch",href:R,...n})),C.map(R=>D.createElement("link",{key:R,rel:"modulepreload",href:R,...n})),w.map(({key:R,link:O})=>D.createElement("link",{key:R,nonce:n.nonce,...O,crossOrigin:O.crossOrigin??n.crossOrigin})))}function r_(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var i_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{i_&&(window.__reactRouterVersion="7.13.1")}catch{}function l_({basename:t,children:e,unstable_useTransitions:n,window:s}){let i=D.useRef();i.current==null&&(i.current=q9({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(LN,{basename:t,children:e,location:d.location,navigationType:d.action,navigator:o,unstable_useTransitions:n})}var pS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,sv=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:v,preventScrollReset:b,viewTransition:_,unstable_defaultShouldRevalidate:C,...w},R){let{basename:O,navigator:T,unstable_useTransitions:M}=D.useContext(wr),z=typeof v=="string"&&pS.test(v),k=aS(v,O);v=k.to;let P=xN(v,{relative:i}),H=ml(),L=null;if(f){let ce=H1(f,[],H.unstable_mask?H.unstable_mask.pathname:"/",!0);O!=="/"&&(ce.pathname=ce.pathname==="/"?O:hl([O,ce.pathname])),L=T.createHref(ce)}let[U,V,F]=t_(s,w),re=d_(v,{replace:d,unstable_mask:f,state:p,target:y,preventScrollReset:b,relative:i,viewTransition:_,unstable_defaultShouldRevalidate:C,unstable_useTransitions:M});function ne(ce){e&&e(ce),ce.defaultPrevented||re(ce)}let I=!(k.isExternal||o),ie=D.createElement("a",{...w,...F,href:(I?L:void 0)||k.absoluteURL||P,onClick:I?ne:e,ref:r_(R,V),target:y,"data-discover":!z&&n==="render"?"true":void 0});return U&&!z?D.createElement(D.Fragment,null,ie,D.createElement(n_,{page:P})):ie});sv.displayName="Link";var o_=D.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:s="",end:i=!1,style:o,to:d,viewTransition:f,children:p,...y},v){let b=Km(d,{relative:y.relative}),_=ml(),C=D.useContext(B1),{navigator:w,basename:R}=D.useContext(wr),O=C!=null&&g_(b)&&f===!0,T=w.encodeLocation?w.encodeLocation(b).pathname:b.pathname,M=_.pathname,z=C&&C.navigation&&C.navigation.location?C.navigation.location.pathname:null;n||(M=M.toLowerCase(),z=z?z.toLowerCase():null,T=T.toLowerCase()),z&&R&&(z=ho(z,R)||z);const k=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let P=M===T||!i&&M.startsWith(T)&&M.charAt(k)==="/",H=z!=null&&(z===T||!i&&z.startsWith(T)&&z.charAt(T.length)==="/"),L={isActive:P,isPending:H,isTransitioning:O},U=P?e:void 0,V;typeof s=="function"?V=s(L):V=[s,P?"active":null,H?"pending":null,O?"transitioning":null].filter(Boolean).join(" ");let F=typeof o=="function"?o(L):o;return D.createElement(sv,{...y,"aria-current":U,className:V,ref:v,style:F,to:d,viewTransition:f},typeof p=="function"?p(L):p)});o_.displayName="NavLink";var c_=D.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:s,replace:i,state:o,method:d=f1,action:f,onSubmit:p,relative:y,preventScrollReset:v,viewTransition:b,unstable_defaultShouldRevalidate:_,...C},w)=>{let{unstable_useTransitions:R}=D.useContext(wr),O=p_(),T=m_(f,{relative:y}),M=d.toLowerCase()==="get"?"get":"post",z=typeof f=="string"&&pS.test(f),k=P=>{if(p&&p(P),P.defaultPrevented)return;P.preventDefault();let H=P.nativeEvent.submitter,L=(H==null?void 0:H.getAttribute("formmethod"))||d,U=()=>O(H||P.currentTarget,{fetcherKey:e,method:L,navigate:n,replace:i,state:o,relative:y,preventScrollReset:v,viewTransition:b,unstable_defaultShouldRevalidate:_});R&&n!==!1?D.startTransition(()=>U()):U()};return D.createElement("form",{ref:w,method:M,action:T,onSubmit:s?p:k,...C,"data-discover":!z&&t==="render"?"true":void 0})});c_.displayName="Form";function u_(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function mS(t){let e=D.useContext(ih);return Vn(e,u_(t)),e}function d_(t,{target:e,replace:n,unstable_mask:s,state:i,preventScrollReset:o,relative:d,viewTransition:f,unstable_defaultShouldRevalidate:p,unstable_useTransitions:y}={}){let v=gl(),b=ml(),_=Km(t,{relative:d});return D.useCallback(C=>{if(PN(C,e)){C.preventDefault();let w=n!==void 0?n:Cm(b)===Cm(_),R=()=>v(t,{replace:w,unstable_mask:s,state:i,preventScrollReset:o,relative:d,viewTransition:f,unstable_defaultShouldRevalidate:p});y?D.startTransition(()=>R()):R()}},[b,v,_,n,s,i,e,t,o,d,f,p,y])}var f_=0,h_=()=>`__${String(++f_)}__`;function p_(){let{router:t}=mS("useSubmit"),{basename:e}=D.useContext(wr),n=MN(),s=t.fetch,i=t.navigate;return D.useCallback(async(o,d={})=>{let{action:f,method:p,encType:y,formData:v,body:b}=QN(o,e);if(d.navigate===!1){let _=d.fetcherKey||h_();await s(_,n,d.action||f,{unstable_defaultShouldRevalidate:d.unstable_defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:v,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:v,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 m_(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={...Km(t||".",{relative:e})},d=ml();if(t==null){o.search=d.search;let f=new URLSearchParams(o.search),p=f.getAll("index");if(p.some(v=>v==="")){f.delete("index"),p.filter(b=>b).forEach(b=>f.append("index",b));let v=f.toString();o.search=v?`?${v}`:""}}return(!t||t===".")&&i.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:hl([n,o.pathname])),Cm(o)}function g_(t,{relative:e}={}){let n=D.useContext(rS);Vn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=mS("useViewTransitionState"),i=Km(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 v1(i.pathname,d)!=null||v1(i.pathname,o)!=null}const gS=D.createContext(null),Wy=["dark","light","system"];function yS(){return typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function y_(t,e){if(typeof window>"u")return e;const n=localStorage.getItem(t);return n==="dark"||n==="light"||n==="system"?n:e}function P2(t){return t==="system"?yS():t}function x_({children:t,defaultMode:e="system",storageKey:n="camstack-theme-mode"}){const[s,i]=D.useState(()=>y_(n,e)),[o,d]=D.useState(()=>P2(s)),f=D.useCallback(v=>{i(v),d(P2(v)),typeof window<"u"&&localStorage.setItem(n,v)},[n]),p=D.useCallback(()=>{const b=(Wy.indexOf(s)+1)%Wy.length;f(Wy[b]??"dark")},[s,f]);D.useEffect(()=>{if(typeof document>"u")return;const v=document.documentElement;v.classList.remove("dark","light"),v.classList.add(o)},[s,o]),D.useEffect(()=>{if(typeof window>"u"||s!=="system")return;const v=window.matchMedia("(prefers-color-scheme: dark)"),b=()=>{d(yS())};return v.addEventListener("change",b),()=>v.removeEventListener("change",b)},[s]);const y=D.useMemo(()=>({mode:s,resolvedMode:o,setMode:f,toggleMode:p}),[s,o,f,p]);return h.jsx(gS.Provider,{value:y,children:t})}function xS(){const t=D.useContext(gS);if(!t)throw new Error("useThemeMode must be used within a ThemeProvider");return t}function bS(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=bS(t[e]))&&(s&&(s+=" "),s+=n)}else for(n in t)t[n]&&(s&&(s+=" "),s+=n);return s}function P1(){for(var t,e,n=0,s="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=bS(t))&&(s&&(s+=" "),s+=e);return s}const b_=(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},v_=(t,e)=>({classGroupId:t,validator:e}),vS=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),S1="-",Y2=[],S_="arbitrary..",N_=t=>{const e=j_(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=t;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return __(d);const f=d.split(S1),p=f[0]===""&&f.length>1?1:0;return SS(f,p,e)},getConflictingClassGroupIds:(d,f)=>{if(f){const p=s[d],y=n[d];return p?y?b_(y,p):p:y||Y2}return n[d]||Y2}}},SS=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const i=t[e],o=n.nextPart.get(i);if(o){const y=SS(t,e+1,o);if(y)return y}const d=n.validators;if(d===null)return;const f=e===0?t.join(S1):t.slice(e).join(S1),p=d.length;for(let y=0;y<p;y++){const v=d[y];if(v.validator(f))return v.classGroupId}},__=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?S_+s:void 0})(),j_=t=>{const{theme:e,classGroups:n}=t;return C_(n,e)},C_=(t,e)=>{const n=vS();for(const s in t){const i=t[s];rv(i,n,s,e)}return n},rv=(t,e,n,s)=>{const i=t.length;for(let o=0;o<i;o++){const d=t[o];w_(d,e,n,s)}},w_=(t,e,n,s)=>{if(typeof t=="string"){E_(t,e,n);return}if(typeof t=="function"){T_(t,e,n,s);return}R_(t,e,n,s)},E_=(t,e,n)=>{const s=t===""?e:NS(e,t);s.classGroupId=n},T_=(t,e,n,s)=>{if(O_(t)){rv(t(s),e,n,s);return}e.validators===null&&(e.validators=[]),e.validators.push(v_(n,t))},R_=(t,e,n,s)=>{const i=Object.entries(t),o=i.length;for(let d=0;d<o;d++){const[f,p]=i[d];rv(p,NS(e,f),n,s)}},NS=(t,e)=>{let n=t;const s=e.split(S1),i=s.length;for(let o=0;o<i;o++){const d=s[o];let f=n.nextPart.get(d);f||(f=vS(),n.nextPart.set(d,f)),n=f}return n},O_=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,M_=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)}}},ob="!",V2=":",A_=[],Q2=(t,e,n,s,i)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:s,isExternal:i}),D_=t=>{const{prefix:e,experimentalParseClassName:n}=t;let s=i=>{const o=[];let d=0,f=0,p=0,y;const v=i.length;for(let R=0;R<v;R++){const O=i[R];if(d===0&&f===0){if(O===V2){o.push(i.slice(p,R)),p=R+1;continue}if(O==="/"){y=R;continue}}O==="["?d++:O==="]"?d--:O==="("?f++:O===")"&&f--}const b=o.length===0?i:i.slice(p);let _=b,C=!1;b.endsWith(ob)?(_=b.slice(0,-1),C=!0):b.startsWith(ob)&&(_=b.slice(1),C=!0);const w=y&&y>p?y-p:void 0;return Q2(o,C,_,w)};if(e){const i=e+V2,o=s;s=d=>d.startsWith(i)?o(d.slice(i.length)):Q2(A_,!1,d,void 0,!0)}if(n){const i=s;s=o=>n({className:o,parseClassName:i})}return s},z_=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}},k_=t=>({cache:M_(t.cacheSize),parseClassName:D_(t),sortModifiers:z_(t),...N_(t)}),L_=/\s+/,U_=(t,e)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:i,sortModifiers:o}=e,d=[],f=t.trim().split(L_);let p="";for(let y=f.length-1;y>=0;y-=1){const v=f[y],{isExternal:b,modifiers:_,hasImportantModifier:C,baseClassName:w,maybePostfixModifierPosition:R}=n(v);if(b){p=v+(p.length>0?" "+p:p);continue}let O=!!R,T=s(O?w.substring(0,R):w);if(!T){if(!O){p=v+(p.length>0?" "+p:p);continue}if(T=s(w),!T){p=v+(p.length>0?" "+p:p);continue}O=!1}const M=_.length===0?"":_.length===1?_[0]:o(_).join(":"),z=C?M+ob:M,k=z+T;if(d.indexOf(k)>-1)continue;d.push(k);const P=i(T,O);for(let H=0;H<P.length;++H){const L=P[H];d.push(z+L)}p=v+(p.length>0?" "+p:p)}return p},q_=(...t)=>{let e=0,n,s,i="";for(;e<t.length;)(n=t[e++])&&(s=_S(n))&&(i&&(i+=" "),i+=s);return i},_S=t=>{if(typeof t=="string")return t;let e,n="";for(let s=0;s<t.length;s++)t[s]&&(e=_S(t[s]))&&(n&&(n+=" "),n+=e);return n},H_=(t,...e)=>{let n,s,i,o;const d=p=>{const y=e.reduce((v,b)=>b(v),t());return n=k_(y),s=n.cache.get,i=n.cache.set,o=f,f(p)},f=p=>{const y=s(p);if(y)return y;const v=U_(p,n);return i(p,v),v};return o=d,(...p)=>o(q_(...p))},B_=[],ka=t=>{const e=n=>n[t]||B_;return e.isThemeGetter=!0,e},jS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,CS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,G_=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,P_=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Y_=/\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$/,V_=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Q_=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,K_=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,cc=t=>G_.test(t),jt=t=>!!t&&!Number.isNaN(Number(t)),uc=t=>!!t&&Number.isInteger(Number(t)),$y=t=>t.endsWith("%")&&jt(t.slice(0,-1)),Wl=t=>P_.test(t),wS=()=>!0,X_=t=>Y_.test(t)&&!V_.test(t),iv=()=>!1,F_=t=>Q_.test(t),Z_=t=>K_.test(t),J_=t=>!Be(t)&&!Ge(t),I_=t=>kc(t,RS,iv),Be=t=>jS.test(t),Mu=t=>kc(t,OS,X_),K2=t=>kc(t,rj,jt),W_=t=>kc(t,AS,wS),$_=t=>kc(t,MS,iv),X2=t=>kc(t,ES,iv),ej=t=>kc(t,TS,Z_),B0=t=>kc(t,DS,F_),Ge=t=>CS.test(t),Qp=t=>ed(t,OS),tj=t=>ed(t,MS),F2=t=>ed(t,ES),nj=t=>ed(t,RS),aj=t=>ed(t,TS),G0=t=>ed(t,DS,!0),sj=t=>ed(t,AS,!0),kc=(t,e,n)=>{const s=jS.exec(t);return s?s[1]?e(s[1]):n(s[2]):!1},ed=(t,e,n=!1)=>{const s=CS.exec(t);return s?s[1]?e(s[1]):n:!1},ES=t=>t==="position"||t==="percentage",TS=t=>t==="image"||t==="url",RS=t=>t==="length"||t==="size"||t==="bg-size",OS=t=>t==="length",rj=t=>t==="number",MS=t=>t==="family-name",AS=t=>t==="number"||t==="weight",DS=t=>t==="shadow",ij=()=>{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"),v=ka("shadow"),b=ka("inset-shadow"),_=ka("text-shadow"),C=ka("drop-shadow"),w=ka("blur"),R=ka("perspective"),O=ka("aspect"),T=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"],P=()=>[...k(),Ge,Be],H=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto","contain","none"],U=()=>[Ge,Be,p],V=()=>[cc,"full","auto",...U()],F=()=>[uc,"none","subgrid",Ge,Be],re=()=>["auto",{span:["full",uc,Ge,Be]},uc,Ge,Be],ne=()=>[uc,"auto",Ge,Be],I=()=>["auto","min","max","fr",Ge,Be],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()],je=()=>[cc,"screen","full","lh","dvh","lvh","svh","min","max","fit",...U()],he=()=>[t,Ge,Be],G=()=>[...k(),F2,X2,{position:[Ge,Be]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],fe=()=>["auto","cover","contain",nj,I_,{size:[Ge,Be]}],be=()=>[$y,Qp,Mu],_e=()=>["","none","full",y,Ge,Be],me=()=>["",jt,Qp,Mu],we=()=>["solid","dashed","dotted","double"],nt=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ze=()=>[jt,$y,F2,X2],Vt=()=>["","none",w,Ge,Be],$e=()=>["none",jt,Ge,Be],Mt=()=>["none",jt,Ge,Be],Ht=()=>[jt,Ge,Be],En=()=>[cc,"full",...U()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Wl],breakpoint:[Wl],color:[wS],container:[Wl],"drop-shadow":[Wl],ease:["in","out","in-out"],font:[J_],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Wl],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Wl],shadow:[Wl],spacing:["px",jt],text:[Wl],"text-shadow":[Wl],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",cc,Be,Ge,O]}],container:["container"],columns:[{columns:[jt,Be,Ge,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:P()}],overflow:[{overflow:H()}],"overflow-x":[{"overflow-x":H()}],"overflow-y":[{"overflow-y":H()}],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",Ge,Be]}],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:[jt,cc,"auto","initial","none",Be]}],grow:[{grow:["",jt,Ge,Be]}],shrink:[{shrink:["",jt,Ge,Be]}],order:[{order:[uc,"first","last","none",Ge,Be]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:re()}],"col-start":[{"col-start":ne()}],"col-end":[{"col-end":ne()}],"grid-rows":[{"grid-rows":F()}],"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":I()}],"auto-rows":[{"auto-rows":I()}],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",...je()]}],"min-block-size":[{"min-block":["auto",...je()]}],"max-block-size":[{"max-block":["none",...je()]}],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,Qp,Mu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,sj,W_]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",$y,Be]}],"font-family":[{font:[tj,$_,e]}],"font-features":[{"font-features":[Be]}],"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,Ge,Be]}],"line-clamp":[{"line-clamp":[jt,"none",Ge,K2]}],leading:[{leading:[o,...U()]}],"list-image":[{"list-image":["none",Ge,Be]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ge,Be]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:he()}],"text-color":[{text:he()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...we(),"wavy"]}],"text-decoration-thickness":[{decoration:[jt,"from-font","auto",Ge,Mu]}],"text-decoration-color":[{decoration:he()}],"underline-offset":[{"underline-offset":[jt,"auto",Ge,Be]}],"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",Ge,Be]}],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",Ge,Be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:G()}],"bg-repeat":[{bg:W()}],"bg-size":[{bg:fe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},uc,Ge,Be],radial:["",Ge,Be],conic:[uc,Ge,Be]},aj,ej]}],"bg-color":[{bg:he()}],"gradient-from-pos":[{from:be()}],"gradient-via-pos":[{via:be()}],"gradient-to-pos":[{to:be()}],"gradient-from":[{from:he()}],"gradient-via":[{via:he()}],"gradient-to":[{to:he()}],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:me()}],"border-w-x":[{"border-x":me()}],"border-w-y":[{"border-y":me()}],"border-w-s":[{"border-s":me()}],"border-w-e":[{"border-e":me()}],"border-w-bs":[{"border-bs":me()}],"border-w-be":[{"border-be":me()}],"border-w-t":[{"border-t":me()}],"border-w-r":[{"border-r":me()}],"border-w-b":[{"border-b":me()}],"border-w-l":[{"border-l":me()}],"divide-x":[{"divide-x":me()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":me()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...we(),"hidden","none"]}],"divide-style":[{divide:[...we(),"hidden","none"]}],"border-color":[{border:he()}],"border-color-x":[{"border-x":he()}],"border-color-y":[{"border-y":he()}],"border-color-s":[{"border-s":he()}],"border-color-e":[{"border-e":he()}],"border-color-bs":[{"border-bs":he()}],"border-color-be":[{"border-be":he()}],"border-color-t":[{"border-t":he()}],"border-color-r":[{"border-r":he()}],"border-color-b":[{"border-b":he()}],"border-color-l":[{"border-l":he()}],"divide-color":[{divide:he()}],"outline-style":[{outline:[...we(),"none","hidden"]}],"outline-offset":[{"outline-offset":[jt,Ge,Be]}],"outline-w":[{outline:["",jt,Qp,Mu]}],"outline-color":[{outline:he()}],shadow:[{shadow:["","none",v,G0,B0]}],"shadow-color":[{shadow:he()}],"inset-shadow":[{"inset-shadow":["none",b,G0,B0]}],"inset-shadow-color":[{"inset-shadow":he()}],"ring-w":[{ring:me()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:he()}],"ring-offset-w":[{"ring-offset":[jt,Mu]}],"ring-offset-color":[{"ring-offset":he()}],"inset-ring-w":[{"inset-ring":me()}],"inset-ring-color":[{"inset-ring":he()}],"text-shadow":[{"text-shadow":["none",_,G0,B0]}],"text-shadow-color":[{"text-shadow":he()}],opacity:[{opacity:[jt,Ge,Be]}],"mix-blend":[{"mix-blend":[...nt(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":nt()}],"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":[jt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ze()}],"mask-image-linear-to-pos":[{"mask-linear-to":ze()}],"mask-image-linear-from-color":[{"mask-linear-from":he()}],"mask-image-linear-to-color":[{"mask-linear-to":he()}],"mask-image-t-from-pos":[{"mask-t-from":ze()}],"mask-image-t-to-pos":[{"mask-t-to":ze()}],"mask-image-t-from-color":[{"mask-t-from":he()}],"mask-image-t-to-color":[{"mask-t-to":he()}],"mask-image-r-from-pos":[{"mask-r-from":ze()}],"mask-image-r-to-pos":[{"mask-r-to":ze()}],"mask-image-r-from-color":[{"mask-r-from":he()}],"mask-image-r-to-color":[{"mask-r-to":he()}],"mask-image-b-from-pos":[{"mask-b-from":ze()}],"mask-image-b-to-pos":[{"mask-b-to":ze()}],"mask-image-b-from-color":[{"mask-b-from":he()}],"mask-image-b-to-color":[{"mask-b-to":he()}],"mask-image-l-from-pos":[{"mask-l-from":ze()}],"mask-image-l-to-pos":[{"mask-l-to":ze()}],"mask-image-l-from-color":[{"mask-l-from":he()}],"mask-image-l-to-color":[{"mask-l-to":he()}],"mask-image-x-from-pos":[{"mask-x-from":ze()}],"mask-image-x-to-pos":[{"mask-x-to":ze()}],"mask-image-x-from-color":[{"mask-x-from":he()}],"mask-image-x-to-color":[{"mask-x-to":he()}],"mask-image-y-from-pos":[{"mask-y-from":ze()}],"mask-image-y-to-pos":[{"mask-y-to":ze()}],"mask-image-y-from-color":[{"mask-y-from":he()}],"mask-image-y-to-color":[{"mask-y-to":he()}],"mask-image-radial":[{"mask-radial":[Ge,Be]}],"mask-image-radial-from-pos":[{"mask-radial-from":ze()}],"mask-image-radial-to-pos":[{"mask-radial-to":ze()}],"mask-image-radial-from-color":[{"mask-radial-from":he()}],"mask-image-radial-to-color":[{"mask-radial-to":he()}],"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":[jt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ze()}],"mask-image-conic-to-pos":[{"mask-conic-to":ze()}],"mask-image-conic-from-color":[{"mask-conic-from":he()}],"mask-image-conic-to-color":[{"mask-conic-to":he()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:G()}],"mask-repeat":[{mask:W()}],"mask-size":[{mask:fe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ge,Be]}],filter:[{filter:["","none",Ge,Be]}],blur:[{blur:Vt()}],brightness:[{brightness:[jt,Ge,Be]}],contrast:[{contrast:[jt,Ge,Be]}],"drop-shadow":[{"drop-shadow":["","none",C,G0,B0]}],"drop-shadow-color":[{"drop-shadow":he()}],grayscale:[{grayscale:["",jt,Ge,Be]}],"hue-rotate":[{"hue-rotate":[jt,Ge,Be]}],invert:[{invert:["",jt,Ge,Be]}],saturate:[{saturate:[jt,Ge,Be]}],sepia:[{sepia:["",jt,Ge,Be]}],"backdrop-filter":[{"backdrop-filter":["","none",Ge,Be]}],"backdrop-blur":[{"backdrop-blur":Vt()}],"backdrop-brightness":[{"backdrop-brightness":[jt,Ge,Be]}],"backdrop-contrast":[{"backdrop-contrast":[jt,Ge,Be]}],"backdrop-grayscale":[{"backdrop-grayscale":["",jt,Ge,Be]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[jt,Ge,Be]}],"backdrop-invert":[{"backdrop-invert":["",jt,Ge,Be]}],"backdrop-opacity":[{"backdrop-opacity":[jt,Ge,Be]}],"backdrop-saturate":[{"backdrop-saturate":[jt,Ge,Be]}],"backdrop-sepia":[{"backdrop-sepia":["",jt,Ge,Be]}],"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",Ge,Be]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[jt,"initial",Ge,Be]}],ease:[{ease:["linear","initial",T,Ge,Be]}],delay:[{delay:[jt,Ge,Be]}],animate:[{animate:["none",M,Ge,Be]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[R,Ge,Be]}],"perspective-origin":[{"perspective-origin":P()}],rotate:[{rotate:$e()}],"rotate-x":[{"rotate-x":$e()}],"rotate-y":[{"rotate-y":$e()}],"rotate-z":[{"rotate-z":$e()}],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:[Ge,Be,"","none","gpu","cpu"]}],"transform-origin":[{origin:P()}],"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:he()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:he()}],"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",Ge,Be]}],"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",Ge,Be]}],fill:[{fill:["none",...he()]}],"stroke-w":[{stroke:[jt,Qp,Mu,K2]}],stroke:[{stroke:["none",...he()]}],"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"]}},lj=H_(ij);function ia(...t){return lj(P1(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 zS=(...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 oj=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 cj=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 Z2=t=>{const e=cj(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 uj={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 dj=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 fj=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,...uj,width:e,height:e,stroke:t,strokeWidth:s?Number(n)*24/Number(e):n,className:zS("lucide",i),...!o&&!dj(f)&&{"aria-hidden":"true"},...f},[...d.map(([y,v])=>D.createElement(y,v)),...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(fj,{ref:o,iconNode:e,className:zS(`lucide-${oj(Z2(t))}`,`lucide-${t}`,s),...i}));return n.displayName=Z2(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 hj=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],kS=td("chevron-down",hj);/**
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 pj=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],mj=td("chevron-right",pj);/**
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 gj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],yj=td("circle-plus",gj);/**
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 xj=[["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"}]],bj=td("copy-plus",xj);/**
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 vj=[["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"}]],Sj=td("save",vj);/**
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 Nj=[["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"}]],_j=td("trash-2",Nj);/**
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 jj=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Cj=td("x",jj),J2=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,I2=P1,nd=(t,e)=>n=>{var s;if((e==null?void 0:e.variants)==null)return I2(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 v=n==null?void 0:n[y],b=o==null?void 0:o[y];if(v===null)return null;const _=J2(v)||J2(b);return i[y][_]}),f=n&&Object.entries(n).reduce((y,v)=>{let[b,_]=v;return _===void 0||(y[b]=_),y},{}),p=e==null||(s=e.compoundVariants)===null||s===void 0?void 0:s.reduce((y,v)=>{let{class:b,className:_,...C}=v;return Object.entries(C).every(w=>{let[R,O]=w;return Array.isArray(O)?O.includes({...o,...f}[R]):{...o,...f}[R]===O})?[...y,b,_]:y},[]);return I2(t,d,p,n==null?void 0:n.class,n==null?void 0:n.className)},wj=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"}}),Ej=D.forwardRef(({className:t,variant:e,size:n,...s},i)=>h.jsx("button",{ref:i,className:ia(wj({variant:e,size:n}),t),...s}));Ej.displayName="Button";const Tj=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"}}),Rj=D.forwardRef(({className:t,variant:e,size:n,icon:s,...i},o)=>h.jsx("button",{ref:o,className:ia(Tj({variant:e,size:n}),t),...i,children:h.jsx(s,{className:"h-4 w-4"})}));Rj.displayName="IconButton";const Oj=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"}}),Mj=D.forwardRef(({className:t,variant:e,style:n,...s},i)=>h.jsx("span",{ref:i,className:ia(Oj({variant:e,styleVariant:n}),t),...s}));Mj.displayName="Badge";const Aj=nd("rounded-lg p-3",{variants:{variant:{flat:"bg-surface",bordered:"bg-surface border border-border"}},defaultVariants:{variant:"bordered"}}),Dj=D.forwardRef(({className:t,variant:e,...n},s)=>h.jsx("div",{ref:s,className:ia(Aj({variant:e}),t),...n}));Dj.displayName="Card";const zj=D.forwardRef(({className:t,...e},n)=>h.jsx("label",{ref:n,className:ia("text-[10px] uppercase tracking-wider text-foreground-muted font-medium",t),...e}));zj.displayName="Label";const kj=nd("",{variants:{orientation:{horizontal:"h-px w-full bg-border-subtle",vertical:"w-px h-full bg-border-subtle"}},defaultVariants:{orientation:"horizontal"}}),Lj=D.forwardRef(({className:t,orientation:e,...n},s)=>h.jsx("div",{ref:s,role:"separator",className:ia(kj({orientation:e}),t),...n}));Lj.displayName="Separator";const Uj=D.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:ia("animate-pulse bg-surface-hover rounded-md h-4 w-full",t),...e}));Uj.displayName="Skeleton";const W2=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"}}),qj=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:ia(W2({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:ia(W2({state:e}),t),...i}));qj.displayName="Input";const Hj=D.forwardRef(({className:t,options:e,...n},s)=>h.jsxs("div",{className:"relative w-full",children:[h.jsx("select",{ref:s,className:ia("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(kS,{className:"h-3.5 w-3.5"})})]}));Hj.displayName="Select";const Bj=D.forwardRef(({className:t,...e},n)=>h.jsx("input",{ref:n,type:"checkbox",className:ia("w-3.5 h-3.5 rounded-sm border border-border accent-primary",t),...e}));Bj.displayName="Checkbox";const Gj=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:ia("inline-flex items-center gap-2",t),...i,children:[h.jsx("span",{className:ia("w-8 h-4 rounded-full transition-colors",e?"bg-primary":"bg-surface-hover"),children:h.jsx("span",{className:ia("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})]}));Gj.displayName="Switch";const Pj=D.createContext(null);function Yj(){const t=D.useContext(Pj);if(!t)throw new Error("Dialog compound components must be used within <Dialog>");return t}const Vj=nd("bg-background-elevated border border-border rounded-lg p-4 backdrop:bg-black/50 backdrop:backdrop-blur-sm",{variants:{width:{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"}},defaultVariants:{width:"md"}}),Qj=D.forwardRef(({className:t,width:e,children:n,...s},i)=>{const{open:o,setOpen:d,contentId:f}=Yj(),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 v=b=>{b.target===b.currentTarget&&d(!1)};return h.jsx("dialog",{ref:y,id:f,className:ia(Vj({width:e}),"w-full",t),onClick:v,onClose:()=>d(!1),...s,children:n})});Qj.displayName="DialogContent";D.createContext(null);D.createContext(null);D.createContext(null);D.createContext(null);const Kj=D.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:ia("overflow-auto [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-surface-hover [&::-webkit-scrollbar-thumb]:rounded-full",t),...e}));Kj.displayName="ScrollArea";const Xj={"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"},Fj={detector:"border-l-blue-500",cropper:"border-l-purple-500",classifier:"border-l-lime-500",refiner:"border-l-cyan-500"};function Zj(t,e){return Xj[t]??Fj[e]??"border-l-primary"}const Jj={cpu:"onnx",coreml:"coreml",openvino:"openvino",cuda:"onnx",tensorrt:"onnx","onnx-py":"onnx",pytorch:"pt"};function Ij(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=Jj[o.id]??"onnx",f=i.has(d);return{...o,available:o.available&&f}})}function Wj(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 $j(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 ex({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),v=Zj(t.addonId,t.slot),b=Ij(t.runtime,s,e),_=$j(s);if(!(((O=b.find(T=>T.id===t.backend))==null?void 0:O.available)??!1)&&!f){const T=b.find(M=>M.available);T&&T.id!==t.backend&&queueMicrotask(()=>o({...t,backend:T.id}))}const w=Wj(e,t.runtime,t.backend,s);if(w.length>0&&!w.some(T=>T.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 R(T){T.target.closest(".step-config")||y(M=>!M)}return h.jsx("div",{className:"space-y-2",children:h.jsxs("div",{className:ia("rounded-xl border border-border bg-surface overflow-hidden border-l-4 shadow-sm",v,!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:R,children:[h.jsx("span",{className:"text-foreground-subtle",children:p?h.jsx(kS,{className:"h-4 w-4"}):h.jsx(mj,{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(T=>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:T},T)),t.inputClasses.length>0&&t.outputClasses.length>0&&h.jsx("span",{className:"text-foreground-subtle/40 text-[10px]",children:"→"}),t.outputClasses.map(T=>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:T},T))]})]}),h.jsx("button",{onClick:T=>{T.stopPropagation(),o({...t,enabled:!t.enabled})},className:ia("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:ia("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(P0,{label:"Agent",value:t.agentId,disabled:f,options:[{value:t.agentId||"hub",label:t.agentId||"Hub (local)"}],onChange:T=>o({...t,agentId:T})}),h.jsx(P0,{label:"Runtime",value:t.runtime,disabled:f,options:_.map(T=>({value:T.id,label:T.label,disabled:!T.available})),onChange:T=>o({...t,runtime:T})}),h.jsx(P0,{label:"Backend",value:t.backend,disabled:f,options:b.map(T=>({value:T.id,label:T.label,disabled:!T.available})),onChange:T=>o({...t,backend:T})}),h.jsx(P0,{label:"Model",value:t.modelId,disabled:f,options:w.map(T=>({value:T.id,label:`${T.name}${T.downloaded?" ✓":""}`})),onChange:T=>o({...t,modelId:T})})]}),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:T=>o({...t,confidence:Number(T.target.value)}),className:"w-full accent-primary h-1.5"})]})]})]})})}function P0({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 eC(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(v=>v.addons).find(v=>v.id===d.addonId);let p=d.modelId;if(f&&!f.models.some(v=>v.id===p)){const v=f.defaultModelId;s.push(`Model "${p}" not available for ${d.addonId} — using "${v}"`),p=v}const y=d.children.map(v=>i(v)).filter(v=>v!==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 tC(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 tx(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 nx({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(yj,{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 nC({schema:t,capabilities:e,steps:n,onChange:s,templates:i,selectedTemplateId:o,onSelectTemplate:d,onSaveTemplate:f,onUpdateTemplate:p,onDeleteTemplate:y,readOnly:v=!1,excludeAddons:b=[]}){var $,ae,je,he;const _=D.useMemo(()=>new Set(b),[b]),C=D.useMemo(()=>tC(t),[t]),[w,R]=D.useState([]),O=($=e.platformScores)==null?void 0:$.find(G=>G.available),T=e.runtimes.python.available&&e.runtimes.python.backends.some(G=>G.available),M=(O==null?void 0:O.runtime)??(T?"python":"node"),z=(O==null?void 0:O.backend)??(T?((ae=e.runtimes.python.backends.find(G=>G.available))==null?void 0:ae.id)??"cpu":((je=e.runtimes.node.backends.find(G=>G.available&&G.id!=="cpu"))==null?void 0:je.id)??"cpu"),k=o?JSON.stringify(n)!==JSON.stringify((he=i.find(G=>G.id===o))==null?void 0:he.steps):!1;function P(G){const W=G.target.value||null;if(W){const fe=i.find(be=>be.id===W);if(fe){const be=eC(fe.steps,t);R([...be.warnings])}}else R([]);d(W)}function H(){o&&p(o,n)}function L(){const G=window.prompt("Template name:");G!=null&&G.trim()&&f(G.trim(),n)}function U(){if(!o)return;const G=i.find(W=>W.id===o);G&&window.confirm(`Delete template "${G.name}"?`)&&y(o)}function V(G){s(n.map(W=>W.addonId!==G.addonId?W:F(G)))}function F(G){const W=G.children.some(fe=>fe.enabled||fe.children.some(be=>be.enabled));return{...G,enabled:G.enabled||W,children:G.children.map(fe=>{const be=fe.children.some(_e=>_e.enabled);return{...fe,enabled:fe.enabled||be}})}}function re(G,W){const fe=tx(W,M,z);s(n.map(be=>be.addonId!==G?be:{...be,children:[...be.children,fe]}))}function ne(G){const W=new Set;for(const fe of G){W.add(fe.addonId);for(const _e of fe.children)W.add(_e.addonId);const be=ne(fe.children);for(const _e of be)W.add(_e)}return W}const I=ne(n);function ie(G){const W=C.get(G.addonId);if(!W)return[];const fe=W.childSlots,be=new Set(G.children.map(me=>me.addonId)),_e=[];for(const me of t.slots)if(fe.includes(me.id))for(const we of me.addons){if(be.has(we.id)||_.has(we.id))continue;we.inputClasses.some(ze=>G.outputClasses.includes(ze))&&_e.push(we)}return _e}function ce(G){const W=ie(G);return h.jsxs("div",{className:"space-y-1.5",children:[h.jsx(ex,{step:G,schema:C.get(G.addonId)??null,allSchemas:C,capabilities:e,onChange:V,onDelete:v?void 0:fe=>s(n.filter(be=>be.addonId!==fe)),readOnly:v}),(G.children.length>0||W.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"}),G.children.map(fe=>{const be=ie(fe);return h.jsxs("div",{className:"space-y-1.5",children:[h.jsx(ex,{step:fe,schema:C.get(fe.addonId)??null,allSchemas:C,capabilities:e,depth:1,onChange:_e=>{V({...G,children:G.children.map(me=>me.addonId===_e.addonId?_e:me)})},onDelete:v?void 0:_e=>{V({...G,children:G.children.filter(me=>me.addonId!==_e)})},readOnly:v}),(fe.children.length>0||be.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(ex,{step:_e,schema:C.get(_e.addonId)??null,allSchemas:C,capabilities:e,depth:2,onChange:me=>{V({...G,children:G.children.map(we=>we.addonId===fe.addonId?{...we,children:we.children.map(nt=>nt.addonId===me.addonId?me:nt)}:we)})},onDelete:v?void 0:me=>{V({...G,children:G.children.map(we=>we.addonId===fe.addonId?{...we,children:we.children.filter(nt=>nt.addonId!==me)}:we)})},readOnly:v},_e.addonId)),!v&&be.map(_e=>h.jsx(nx,{addon:_e,onClick:()=>{const me=tx(_e,M,z);V({...G,children:G.children.map(we=>we.addonId===fe.addonId?{...we,children:[...we.children,me]}:we)})}},_e.id))]})]},fe.addonId)}),!v&&W.map(fe=>h.jsx(nx,{addon:fe,onClick:()=>re(G.addonId,fe)},fe.id))]})]},G.addonId)}const Y=t.slots.filter(G=>G.parentSlot===null).sort((G,W)=>G.priority-W.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:P,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(G=>h.jsx("option",{value:G.id,children:G.name},G.id))]})}),k&&h.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-amber-500 shrink-0"}),h.jsx("button",{onClick:H,disabled:!o||v,title:"Save",className:ia("p-2 rounded-lg border border-border transition-colors",o&&!v?"text-foreground-subtle hover:bg-surface-hover":"text-foreground-subtle/30 cursor-not-allowed"),children:h.jsx(Sj,{className:"h-4 w-4"})}),h.jsx("button",{onClick:L,disabled:v,title:"Save As",className:ia("p-2 rounded-lg border border-border transition-colors",v?"text-foreground-subtle/30 cursor-not-allowed":"text-foreground-subtle hover:bg-surface-hover"),children:h.jsx(bj,{className:"h-4 w-4"})}),h.jsx("button",{onClick:U,disabled:!o||v,title:"Delete",className:ia("p-2 rounded-lg border border-border transition-colors",o&&!v?"text-foreground-subtle hover:text-danger":"text-foreground-subtle/30 cursor-not-allowed"),children:h.jsx(_j,{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:()=>R([]),className:"text-amber-400/60 hover:text-amber-400",children:h.jsx(Cj,{className:"h-3.5 w-3.5"})})]}),w.map((G,W)=>h.jsxs("div",{children:["• ",G]},W))]}),Y.map(G=>{const W=n.filter(be=>be.slot===G.id&&!_.has(be.addonId)),fe=G.addons.filter(be=>!I.has(be.id)&&!_.has(be.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: ",G.label]}),W.map(be=>ce(be)),!v&&fe.map(be=>h.jsx(nx,{addon:be,onClick:()=>{s([...n,tx(be,M,z)])}},be.id))]},G.id)})]})}var aC=Object.create,LS=Object.defineProperty,sC=Object.getOwnPropertyDescriptor,US=Object.getOwnPropertyNames,rC=Object.getPrototypeOf,iC=Object.prototype.hasOwnProperty,yl=(t,e)=>function(){return e||(0,t[US(t)[0]])((e={exports:{}}).exports,e),e.exports},lC=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(var i=US(e),o=0,d=i.length,f;o<d;o++)f=i[o],!iC.call(t,f)&&f!==n&&LS(t,f,{get:(p=>e[p]).bind(null,f),enumerable:!(s=sC(e,f))||s.enumerable});return t},ya=(t,e,n)=>(n=t!=null?aC(rC(t)):{},lC(LS(n,"default",{value:t,enumerable:!0}),t)),qS=yl({"../../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}}),oC=yl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(t,e){var n=qS().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}}),cC=yl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(t,e){var n=qS().default,s=oC();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=yl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(t,e){var n=cC();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=yl({"../../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 uC(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(dC,e)}};return e}function dC(t,e){return e(t)}function fC(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=uC(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 HS=(t,...e)=>typeof t=="function"?t(...e):t;ya(ad());function hC(){let t,e;return{promise:new Promise((s,i)=>{t=s,e=i}),resolve:t,reject:e}}async function pC(t){const e=await HS(t.url);if(!t.connectionParams)return e;const s=`${e.includes("?")?"&":"?"}connectionParams=1`;return e+s}async function mC(t,e){const n={method:"connectionParams",data:await HS(t)};return e.encode(n)}ya(ad());var pc=ya(ad());function gC(t){const{promise:e,resolve:n,reject:s}=hC();return t.addEventListener("open",()=>{t.removeEventListener("error",s),n()}),t.addEventListener("error",s),e}function yC(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 xC=class cb{constructor(e){var n;if((0,pc.default)(this,"id",++cb.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",fC(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=++cb.connectCount;const n=pC(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&&yC(s,e.keepAliveOpts),s.addEventListener("close",()=>{e.ws===s&&(e.ws=null)}),await gC(s),e.urlOptions.connectionParams&&s.send(await mC(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)(xC,"connectCount",0);ya(ad());ya(Ti());ya(ad());ya(Ti());ya(Ti());ya(Ti());var bC=yl({"../../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(bC());ya(Ti());var vC=yl({"../../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 v=y;if(typeof y!="function")throw new TypeError("Object is not disposable.");v&&(y=function(){try{v.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,v=0;function b(){for(;p=o.pop();)try{if(!p.a&&v===1)return v=0,o.push(p),Promise.resolve().then(b);if(p.d){var C=p.d.call(p.v);if(p.a)return v|=2,Promise.resolve(C).then(b,_)}else v|=1}catch(w){return _(w)}if(v===1)return y!==i?Promise.reject(y):Promise.resolve();if(y!==i)throw y}function _(C){return y=y!==i?new s(C,y):C,b()}return b()}}}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),BS=yl({"../../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}}),SC=yl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(t,e){var n=BS();function s(i){return new n(i,0)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),NC=yl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(t,e){var n=BS();function s(o){return function(){return new i(o.apply(this,arguments))}}function i(o){var d,f;function p(v,b){try{var _=o[v](b),C=_.value,w=C instanceof n;Promise.resolve(w?C.v:C).then(function(R){if(w){var O=v==="return"?"return":"next";if(!C.k||R.done)return p(O,R);R=o[O](R).value}y(_.done?"return":"normal",R)},function(R){p("throw",R)})}catch(R){y("throw",R)}}function y(v,b){switch(v){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(v,b){return new Promise(function(_,C){var w={key:v,arg:b,resolve:_,reject:C,next:null};f?f=f.next=w:(d=f=w,p(v,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(vC());ya(SC());ya(NC());ya(Ti());class _C{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 GS{constructor(e){this.generateIdentifier=e,this.kv=new _C}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 jC extends GS{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 CC(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 wC(t,e){const n=CC(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 p1(t,e){return t.indexOf(e)!==-1}function $2(t,e){for(let n=0;n<t.length;n++){const s=t[n];if(e(s))return s}}class EC{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return wC(this.transfomers,n=>n.isApplicable(e))}findByName(e){return this.transfomers[e]}}const TC=t=>Object.prototype.toString.call(t).slice(8,-1),PS=t=>typeof t>"u",RC=t=>t===null,wm=t=>typeof t!="object"||t===null||t===Object.prototype?!1:Object.getPrototypeOf(t)===null?!0:Object.getPrototypeOf(t)===Object.prototype,ub=t=>wm(t)&&Object.keys(t).length===0,Dc=t=>Array.isArray(t),OC=t=>typeof t=="string",MC=t=>typeof t=="number"&&!isNaN(t),AC=t=>typeof t=="boolean",DC=t=>t instanceof RegExp,Em=t=>t instanceof Map,Tm=t=>t instanceof Set,YS=t=>TC(t)==="Symbol",zC=t=>t instanceof Date&&!isNaN(t.valueOf()),VS=t=>t instanceof Error,e3=t=>typeof t=="number"&&isNaN(t),kC=t=>AC(t)||RC(t)||PS(t)||MC(t)||OC(t)||YS(t),LC=t=>typeof t=="bigint",UC=t=>t===1/0||t===-1/0,qC=t=>ArrayBuffer.isView(t)&&!(t instanceof DataView),HC=t=>t instanceof URL,db=t=>t.replace(/\\/g,"\\\\").replace(/\./g,"\\."),ax=t=>t.map(String).map(db).join("."),hm=(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 il(t,e,n,s){return{isApplicable:t,annotation:e,transform:n,untransform:s}}const QS=[il(PS,"undefined",()=>null,()=>{}),il(LC,"bigint",t=>t.toString(),t=>typeof BigInt<"u"?BigInt(t):(console.error("Please add a BigInt polyfill."),t)),il(zC,"Date",t=>t.toISOString(),t=>new Date(t)),il(VS,"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}),il(DC,"regexp",t=>""+t,t=>{const e=t.slice(1,t.lastIndexOf("/")),n=t.slice(t.lastIndexOf("/")+1);return new RegExp(e,n)}),il(Tm,"set",t=>[...t.values()],t=>new Set(t)),il(Em,"map",t=>[...t.entries()],t=>new Map(t)),il(t=>e3(t)||UC(t),"number",t=>e3(t)?"NaN":t>0?"Infinity":"-Infinity",Number),il(t=>t===0&&1/t===-1/0,"number",()=>"-0",Number),il(HC,"URL",t=>t.toString(),t=>new URL(t))];function Y1(t,e,n,s){return{isApplicable:t,annotation:e,transform:n,untransform:s}}const KS=Y1((t,e)=>YS(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}),BC=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((t,e)=>(t[e.name]=e,t),{}),XS=Y1(qC,t=>["typed-array",t.constructor.name],t=>[...t],(t,e)=>{const n=BC[e[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(t)});function FS(t,e){return t!=null&&t.constructor?!!e.classRegistry.getIdentifier(t.constructor):!1}const ZS=Y1(FS,(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)}),JS=Y1((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)}),GC=[ZS,KS,JS,XS],t3=(t,e)=>{const n=$2(GC,i=>i.isApplicable(t,e));if(n)return{value:n.transform(t,e),type:n.annotation(t,e)};const s=$2(QS,i=>i.isApplicable(t,e));if(s)return{value:s.transform(t,e),type:s.annotation}},IS={};QS.forEach(t=>{IS[t.annotation]=t});const PC=(t,e,n)=>{if(Dc(e))switch(e[0]){case"symbol":return KS.untransform(t,e,n);case"class":return ZS.untransform(t,e,n);case"custom":return JS.untransform(t,e,n);case"typed-array":return XS.untransform(t,e,n);default:throw new Error("Unknown transformation: "+e)}else{const s=IS[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 WS(t){if(p1(t,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(p1(t,"prototype"))throw new Error("prototype is not allowed as a property");if(p1(t,"constructor"))throw new Error("constructor is not allowed as a property")}const YC=(t,e)=>{WS(e);for(let n=0;n<e.length;n++){const s=e[n];if(Tm(t))t=Of(t,+s);else if(Em(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},fb=(t,e,n)=>{if(WS(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(wm(s))s=s[d];else if(Tm(s)){const f=+d;s=Of(s,f)}else if(Em(s)){if(o===e.length-2)break;const p=+d,y=+e[++o]==0?"key":"value",v=Of(s,p);switch(y){case"key":s=v;break;case"value":s=s.get(v);break}}}const i=e[e.length-1];if(Dc(s)?s[+i]=n(s[+i]):wm(s)&&(s[i]=n(s[i])),Tm(s)){const o=Of(s,+i),d=n(o);o!==d&&(s.delete(o),s.add(d))}if(Em(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},$S=t=>t<1;function hb(t,e,n,s=[]){if(!t)return;const i=$S(n);if(!Dc(t)){$f(t,(f,p)=>hb(f,e,n,[...s,...hm(p,i)]));return}const[o,d]=t;d&&$f(d,(f,p)=>{hb(f,e,n,[...s,...hm(p,i)])}),e(o,s)}function VC(t,e,n,s){return hb(e,(i,o)=>{t=fb(t,o,d=>PC(d,i,s))},n),t}function QC(t,e,n){const s=$S(n);function i(o,d){const f=YC(t,hm(d,s));o.map(p=>hm(p,s)).forEach(p=>{t=fb(t,p,()=>f)})}if(Dc(e)){const[o,d]=e;o.forEach(f=>{t=fb(t,hm(f,s),()=>t)}),d&&$f(d,i)}else $f(e,i);return t}const KC=(t,e)=>wm(t)||Dc(t)||Em(t)||Tm(t)||VS(t)||FS(t,e);function XC(t,e,n){const s=n.get(t);s?s.push(e):n.set(t,[e])}function FC(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(ax):n[ax(o)]=d.map(ax)}),s?ub(n)?[s]:[s,n]:ub(n)?void 0:n}const e6=(t,e,n,s,i=[],o=[],d=new Map)=>{const f=kC(t);if(!f){XC(t,i,e);const C=d.get(t);if(C)return s?{transformedValue:null}:C}if(!KC(t,n)){const C=t3(t,n),w=C?{transformedValue:C.value,annotations:[C.type]}:{transformedValue:t};return f||d.set(t,w),w}if(p1(o,t))return{transformedValue:null};const p=t3(t,n),y=(p==null?void 0:p.value)??t,v=Dc(y)?[]:{},b={};$f(y,(C,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 R=e6(C,e,n,s,[...i,w],[...o,t],d);v[w]=R.transformedValue,Dc(R.annotations)?b[db(w)]=R.annotations:wm(R.annotations)&&$f(R.annotations,(O,T)=>{b[db(w)+"."+T]=O})});const _=ub(b)?{transformedValue:v,annotations:p?[p.type]:void 0}:{transformedValue:v,annotations:p?[p.type,b]:b};return f||d.set(t,_),_};function t6(t){return Object.prototype.toString.call(t).slice(8,-1)}function n3(t){return t6(t)==="Array"}function ZC(t){if(t6(t)!=="Object")return!1;const e=Object.getPrototypeOf(t);return!!e&&e.constructor===Object&&e===Object.prototype}function JC(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 pb(t,e={}){if(n3(t))return t.map(i=>pb(i,e));if(!ZC(t))return t;const n=Object.getOwnPropertyNames(t),s=Object.getOwnPropertySymbols(t);return[...n,...s].reduce((i,o)=>{if(o==="__proto__"||n3(e.props)&&!e.props.includes(o))return i;const d=t[o],f=pb(d,e);return JC(i,o,f,t,e.nonenumerable),i},{})}class kt{constructor({dedupe:e=!1}={}){this.classRegistry=new jC,this.symbolRegistry=new GS(n=>n.description??""),this.customTransformerRegistry=new EC,this.allowedErrorProps=[],this.dedupe=e}serialize(e){const n=new Map,s=e6(e,n,this,this.dedupe),i={json:s.transformedValue};s.annotations&&(i.meta={...i.meta,values:s.annotations});const o=FC(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:pb(s);return i!=null&&i.values&&(o=VC(o,i.values,i.v??0,this)),i!=null&&i.referentialEqualities&&(o=QC(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 IC=Object.create,n6=Object.defineProperty,WC=Object.getOwnPropertyDescriptor,a6=Object.getOwnPropertyNames,$C=Object.getPrototypeOf,ew=Object.prototype.hasOwnProperty,xl=(t,e)=>function(){return e||(0,t[a6(t)[0]])((e={exports:{}}).exports,e),e.exports},tw=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(var i=a6(e),o=0,d=i.length,f;o<d;o++)f=i[o],!ew.call(t,f)&&f!==n&&n6(t,f,{get:(p=>e[p]).bind(null,f),enumerable:!(s=WC(e,f))||s.enumerable});return t},xa=(t,e,n)=>(n=t!=null?IC($C(t)):{},tw(e||!t||!t.__esModule?n6(n,"default",{value:t,enumerable:!0}):n,t)),s6=xl({"../../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}}),nw=xl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(t,e){var n=s6().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}}),aw=xl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(t,e){var n=s6().default,s=nw();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=xl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(t,e){var n=aw();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=xl({"../../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 oh(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(sw,e)}};return e}function sw(t,e){return e(t)}function rw(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 iw(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 oh(f=>(n++,i.push(f),o(),{unsubscribe(){n--,d();const p=i.findIndex(y=>y===f);p>-1&&i.splice(p,1)}}))}}function r6(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=oh(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 lw(t){return oh(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 Rm(t){return!!t&&!Array.isArray(t)&&typeof t=="object"}function ow(){return Object.create(null)}const a3=t=>t();function s3(t=0){return new Promise(e=>setTimeout(e,t))}var cw=Object.create,i6=Object.defineProperty,uw=Object.getOwnPropertyDescriptor,l6=Object.getOwnPropertyNames,dw=Object.getPrototypeOf,fw=Object.prototype.hasOwnProperty,Xm=(t,e)=>function(){return e||(0,t[l6(t)[0]])((e={exports:{}}).exports,e),e.exports},hw=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(var i=l6(e),o=0,d=i.length,f;o<d;o++)f=i[o],!fw.call(t,f)&&f!==n&&i6(t,f,{get:(p=>e[p]).bind(null,f),enumerable:!(s=uw(e,f))||s.enumerable});return t},V1=(t,e,n)=>(n=t!=null?cw(dw(t)):{},hw(i6(n,"default",{value:t,enumerable:!0}),t));const o6=()=>{},r3=t=>{Object.freeze&&Object.freeze(t)};function c6(t,e,n){var s;const i=e.join(".");return(s=n[i])!==null&&s!==void 0||(n[i]=new Proxy(o6,{get(o,d){if(!(typeof d!="string"||d==="then"))return c6(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)}),r3(y.args),r3(y.path),t(y)}})),n[i]}const pw=t=>c6(t,[],ow()),mw=t=>new Proxy(o6,{get(e,n){if(n!=="then")return t(n)}});var u6=Xm({"../../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}}),gw=Xm({"../../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}}),yw=Xm({"../../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=gw();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}}),d6=Xm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(t,e){var n=yw();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}}),lv=Xm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(t,e){var n=d6();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}});V1(lv());V1(d6());var Y0=V1(lv());function xw(t,e){if("error"in t){const s=e.deserialize(t.error);return{ok:!1,error:(0,Y0.default)((0,Y0.default)({},t),{},{error:s})}}return{ok:!0,result:(0,Y0.default)((0,Y0.default)({},t.result),(!t.result.type||t.result.type==="data")&&{type:"data",data:e.deserialize(t.result.data)})}}var sx=class extends Error{constructor(){super("Unable to transform response from server")}};function f6(t,e){let n;try{n=xw(t,e)}catch{throw new sx}if(!n.ok&&(!Rm(n.error.error)||typeof n.error.error.code!="number"))throw new sx;if(n.ok&&!Rm(n.result))throw new sx;return n}V1(lv());var V0=xa(sd(),1),jf=xa(Ri(),1);function bw(t){return t instanceof co}function vw(t){return Rm(t)&&Rm(t.error)&&typeof t.error.code=="number"&&typeof t.error.message=="string"}function Sw(t,e){return typeof t=="string"?t:Rm(t)&&typeof t.message=="string"?t.message:e}var co=class m1 extends Error{constructor(e,n){var s,i;const o=n==null?void 0:n.cause;super(e,{cause:o}),(0,V0.default)(this,"cause",void 0),(0,V0.default)(this,"shape",void 0),(0,V0.default)(this,"data",void 0),(0,V0.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,m1.prototype)}static from(e,n={}){const s=e;return bw(s)?(n.meta&&(s.meta=(0,jf.default)((0,jf.default)({},s.meta),n.meta)),s):vw(s)?new m1(s.error.message,(0,jf.default)((0,jf.default)({},n),{},{result:s,cause:n.cause})):new m1(Sw(s,"Unknown error"),(0,jf.default)((0,jf.default)({},n),{},{cause:s}))}};function h6(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 i3=t=>typeof t=="function";function Nw(t){if(t)return t;if(typeof window<"u"&&i3(window.fetch))return window.fetch;if(typeof globalThis<"u"&&i3(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var pm=xa(Ri());function _w(t){return{url:t.url.toString(),fetch:t.fetch,transformer:h6(t.transformer),methodOverride:t.methodOverride}}function jw(t){const e={};for(let n=0;n<t.length;n++){const s=t[n];e[n]=s}return e}const Cw={query:"GET",mutation:"POST",subscription:"PATCH"};function p6(t){return"input"in t?t.transformer.input.serialize(t.input):jw(t.inputs.map(e=>t.transformer.input.serialize(e)))}const mb=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=p6(t);o!==void 0&&t.methodOverride!=="POST"&&i.push(`input=${encodeURIComponent(JSON.stringify(o))}`)}return i.length&&(s+="?"+i.join("&")),s},ww=t=>{if(t.type==="query"&&t.methodOverride!=="POST")return;const e=p6(t);return e!==void 0?JSON.stringify(e):void 0},Ew=t=>gb((0,pm.default)((0,pm.default)({},t),{},{contentTypeHeader:"application/json",getUrl:mb,getBody:ww}));var Tw=class extends Error{constructor(){const t="AbortError";super(t),this.name=t,this.message=t}};const Rw=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 Tw};async function Ow(t){var e,n;Rw(t.signal);const s=t.getUrl(t),i=t.getBody(t),o=(e=t.methodOverride)!==null&&e!==void 0?e:Cw[t.type],d=await(async()=>{const p=await t.headers();return Symbol.iterator in p?Object.fromEntries(p):p})(),f=(0,pm.default)((0,pm.default)((0,pm.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 Nw(t.fetch)(s,{method:o,signal:t.signal,body:i,headers:f})}async function gb(t){const e={},n=await Ow(t);e.response=n;const s=await n.json();return e.responseJSON=s,{json:s,meta:e}}function Mw(t){return t instanceof Uint8Array||t instanceof Blob}function Aw(t){return t instanceof FormData}var Mf=xa(Ri(),1);const Dw=t=>{if("input"in t){const{input:e}=t;if(Aw(e)){if(t.type!=="mutation"&&t.methodOverride!=="POST")throw new Error("FormData is only supported for mutations");return gb((0,Mf.default)((0,Mf.default)({},t),{},{contentTypeHeader:void 0,getUrl:mb,getBody:()=>e}))}if(Mw(e)){if(t.type!=="mutation"&&t.methodOverride!=="POST")throw new Error("Octet type input is only supported for mutations");return gb((0,Mf.default)((0,Mf.default)({},t),{},{contentTypeHeader:"application/octet-stream",getUrl:mb,getBody:()=>e}))}}return Ew(t)};function zw(t){const e=_w(t);return()=>n=>{const{op:s}=n;return oh(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=Dw((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(v=>{y=v.meta;const b=f6(v.json,e.transformer.output);if(!b.ok){i.error(co.from(b.error,{meta:y}));return}i.next({context:v.meta,result:b.result}),i.complete()}).catch(v=>{i.error(co.from(v,{meta:y}))}),()=>{}})}}xa(Ri(),1);xa(Ri(),1);const kw={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)}},Lw={enabled:!1,closeMs:0},Uw={enabled:!1,pongTimeoutMs:1e3,intervalMs:5e3},qw=t=>t===0?0:Math.min(1e3*2**t,3e4),m6=(t,...e)=>typeof t=="function"?t(...e):t;var Hw=xa(sd(),1),Cf=class g6 extends Error{constructor(e){super(e.message,{cause:e.cause}),this.name="TRPCWebSocketClosedError",Object.setPrototypeOf(this,g6.prototype)}},Bw=class{constructor(t,e){this.onTimeout=t,this.timeoutMs=e,(0,Hw.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 y6(){let t,e;return{promise:new Promise((s,i)=>{t=s,e=i}),resolve:t,reject:e}}async function Gw(t){const e=await m6(t.url);if(!t.connectionParams)return e;const s=`${e.includes("?")?"&":"?"}connectionParams=1`;return e+s}async function Pw(t,e){const n={method:"connectionParams",data:await m6(t)};return e.encode(n)}var l3=xa(sd(),1),Yw=class{constructor(){(0,l3.default)(this,"outgoingRequests",new Array),(0,l3.default)(this,"pendingRequests",{})}register(t,e){const{promise:n,resolve:s}=y6();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 Vw(t){const{promise:e,resolve:n,reject:s}=y6();return t.addEventListener("open",()=>{t.removeEventListener("error",s),n()}),t.addEventListener("error",s),e}function Qw(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 x6=class yb{constructor(e){var n;if((0,mc.default)(this,"id",++yb.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",r6(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=++yb.connectCount;const n=Gw(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&&Qw(s,e.keepAliveOpts),s.addEventListener("close",()=>{e.ws===s&&(e.ws=null)}),await Vw(s),e.urlOptions.connectionParams&&s.send(await Pw(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)(x6,"connectCount",0);function Kw(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 ll=xa(sd(),1),wf=xa(Ri(),1),Xw=class{constructor(t){var e,n;(0,ll.default)(this,"connectionState",void 0),(0,ll.default)(this,"allowReconnect",!1),(0,ll.default)(this,"requestManager",new Yw),(0,ll.default)(this,"activeConnection",void 0),(0,ll.default)(this,"reconnectRetryDelay",void 0),(0,ll.default)(this,"inactivityTimeout",void 0),(0,ll.default)(this,"callbacks",void 0),(0,ll.default)(this,"lazyMode",void 0),(0,ll.default)(this,"encoder",void 0),(0,ll.default)(this,"reconnecting",null),this.encoder=(e=t.experimental_encoder)!==null&&e!==void 0?e:kw,this.callbacks={onOpen:t.onOpen,onClose:t.onClose,onError:t.onError};const s=(0,wf.default)((0,wf.default)({},Lw),t.lazy);this.inactivityTimeout=new Bw(()=>{if(this.requestManager.hasOutgoingRequests()||this.requestManager.hasPendingRequests()){this.inactivityTimeout.reset();return}this.close().catch(()=>null)},s.closeMs),this.activeConnection=new x6({WebSocketPonyfill:t.WebSocket,urlOptions:t,keepAlive:(0,wf.default)((0,wf.default)({},Uw),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:qw,this.lazyMode=s.enabled,this.connectionState=r6({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 Cf({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(co.from(new Cf({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 oh(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 v=f6(y,o.output);if(!v.ok){f.error(co.from(v.error));return}f.next({result:v.result})}}));return()=>{p(),e==="subscription"&&this.activeConnection.isOpen()&&this.send({id:t,method:"subscription.stop"}),i==null||i.removeEventListener("abort",p)}})}get connection(){return Kw(this.activeConnection)}reconnect(t){var e=this;if(this.connectionState.next({type:"state",state:"connecting",error:co.from(t)}),this.reconnecting)return;const n=async s=>{try{await s3(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(co.from(s??new Cf({message:"WebSocket closed",cause:s}))),this.requestManager.delete(o.id))};t.addEventListener("open",()=>{a3(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 Cf({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 Cf({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 Cf({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(),a3(async()=>{n.activeConnection.isOpen()||await n.open(),await s3(0),n.requestManager.hasOutgoingRequests()&&n.send(n.requestManager.flush().map(({message:s})=>s))}).catch(s=>{this.requestManager.delete(t.id),e.error(co.from(s))}),this.requestManager.register(t,e)}};function Fw(t){return new Xw(t)}function Zw(t){const{client:e}=t,n=h6(t.transformer);return()=>({op:s})=>oh(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 rx=xa(sd(),1),o3=xa(Ri(),1),Jw=class{constructor(t){(0,rx.default)(this,"links",void 0),(0,rx.default)(this,"runtime",void 0),(0,rx.default)(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=t.links.map(e=>e(this.runtime))}$request(t){var e;return lw({links:this.links,op:(0,o3.default)((0,o3.default)({},t),{},{context:(e=t.context)!==null&&e!==void 0?e:{},id:++this.requestId})}).pipe(iw())}async requestAsPromise(t){var e=this;try{const n=e.$request(t);return(await rw(n)).result.data}catch(n){throw co.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 Iw=Symbol.for("trpc_untypedClient"),Ww={query:"query",mutate:"mutation",subscribe:"subscription"},$w=t=>Ww[t];function eE(t){const e=pw(({path:n,args:s})=>{const i=[...n],o=$w(i.pop()),d=i.join(".");return t[o](d,...s)});return mw(n=>n===Iw?t:e[n])}function c3(t){const e=new Jw(t);return eE(e)}xa(Ri(),1);xa(Ri(),1);var tE=xl({"../../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(tE(),1);xa(Ri(),1);var nE=xl({"../../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 v=y;if(typeof y!="function")throw new TypeError("Object is not disposable.");v&&(y=function(){try{v.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,v=0;function b(){for(;p=o.pop();)try{if(!p.a&&v===1)return v=0,o.push(p),Promise.resolve().then(b);if(p.d){var C=p.d.call(p.v);if(p.a)return v|=2,Promise.resolve(C).then(b,_)}else v|=1}catch(w){return _(w)}if(v===1)return y!==i?Promise.reject(y):Promise.resolve();if(y!==i)throw y}function _(C){return y=y!==i?new s(C,y):C,b()}return b()}}}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),b6=xl({"../../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}}),aE=xl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(t,e){var n=b6();function s(i){return new n(i,0)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),sE=xl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(t,e){var n=b6();function s(o){return function(){return new i(o.apply(this,arguments))}}function i(o){var d,f;function p(v,b){try{var _=o[v](b),C=_.value,w=C instanceof n;Promise.resolve(w?C.v:C).then(function(R){if(w){var O=v==="return"?"return":"next";if(!C.k||R.done)return p(O,R);R=o[O](R).value}y(_.done?"return":"normal",R)},function(R){p("throw",R)})}catch(R){y("throw",R)}}function y(v,b){switch(v){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(v,b){return new Promise(function(_,C){var w={key:v,arg:b,resolve:_,reject:C,next:null};f?f=f.next=w:(d=f=w,p(v,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(nE(),1);xa(aE(),1);xa(sE(),1);xa(Ri(),1);class rE{constructor(e){Gp(this,"trpc");Gp(this,"serverUrl");Gp(this,"token");Gp(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=Fw({url:o,connectionParams:()=>({token:this.token}),retryDelayMs:()=>2e3}),this.trpc=c3({links:[Zw({client:this.wsClient,transformer:kt})]})}else this.trpc=c3({links:[zw({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 v6=(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))(v6||{});const iE=["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"],lE=["person","people","pedestrian","rider","driver","cyclist","skier","skateboarder","face","hand","head","body"],oE=["vehicle","car","truck","bus","motorcycle","bicycle","van","ambulance","police_car","fire_truck","train","subway","tram","airplane","boat","ship","helicopter"],cE=["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"],uE=["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"],dE=["motion","movement","other"],fE=["package","packet"],hE=["audio"],pE=["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"],mE=["doorbell","ring"],gE=["lock","binary","flood","entry","door","leak","door_open","flooded","entry_open"];({...iE.reduce((t,e)=>({...t,[e]:"animal"}),{}),...lE.reduce((t,e)=>({...t,[e]:"person"}),{}),...oE.reduce((t,e)=>({...t,[e]:"vehicle"}),{}),...dE.reduce((t,e)=>({...t,[e]:"motion"}),{}),...fE.reduce((t,e)=>({...t,[e]:"package"}),{}),...cE.reduce((t,e)=>({...t,[e]:"face"}),{}),...uE.reduce((t,e)=>({...t,[e]:"plate"}),{}),...hE.reduce((t,e)=>({...t,[e]:"audio"}),{}),...pE.reduce((t,e)=>({...t,[e]:"audio"}),{}),...mE.reduce((t,e)=>({...t,[e]:"doorbell"}),{}),...gE.reduce((t,e)=>({...t,[e]:"sensor"}),{})});const yE=Object.values(v6),xE=yE.filter(t=>t!=="motion");[...xE];const bE=["Entry","Light","Switch","Lock","SecuritySystem","Buttons","WindowCovering","Siren","Sensor","Select","Program"];new Set(bE);const vE=["light","switch","input_boolean","cover","lock","alarm_control_panel","input_button","button","input_select","select","siren","media_player","script"];new Set(vE);let g1=null;function Om(){if(!g1){const t=window.location.origin,e=localStorage.getItem("camstack_admin_token")??void 0;g1=new rE({serverUrl:t,token:e})}return g1}function u3(){g1=null}const S6=D.createContext(null);function d3(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 SE({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=d3(f);if(!p||p.exp*1e3<Date.now()){localStorage.removeItem("camstack_admin_token"),i(!1);return}Om().getSystemInfo().then(()=>n(p)).catch(v=>{var _;const b=(_=v==null?void 0:v.data)==null?void 0:_.code;b==="UNAUTHORIZED"||b==="FORBIDDEN"?(localStorage.removeItem("camstack_admin_token"),u3()):n(p)}).finally(()=>i(!1))},[]);const o=D.useCallback(async(f,p)=>{const y=Om(),b=(await y.login(f,p)).token;localStorage.setItem("camstack_admin_token",b),y.setToken(b),n(d3(b))},[]),d=D.useCallback(()=>{localStorage.removeItem("camstack_admin_token"),u3(),n(null)},[]);return h.jsx(S6.Provider,{value:{user:e,loading:s,login:o,logout:d},children:t})}function ov(){const t=D.useContext(S6);if(!t)throw new Error("useAuth must be used within AuthProvider");return t}function Au({children:t,requiredRole:e}){const{user:n,loading:s}=ov();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(ib,{to:"/access-denied",replace:!0}):h.jsx(h.Fragment,{children:t}):h.jsx(ib,{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 NE=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_E=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,s)=>s?s.toUpperCase():n.toLowerCase()),f3=t=>{const e=_E(t);return e.charAt(0).toUpperCase()+e.slice(1)},N6=(...t)=>t.filter((e,n,s)=>!!e&&e.trim()!==""&&s.indexOf(e)===n).join(" ").trim(),jE=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 CE={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 wE=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,...CE,width:e,height:e,stroke:t,strokeWidth:s?Number(n)*24/Number(e):n,className:N6("lucide",i),...!o&&!jE(f)&&{"aria-hidden":"true"},...f},[...d.map(([y,v])=>D.createElement(y,v)),...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 ke=(t,e)=>{const n=D.forwardRef(({className:s,...i},o)=>D.createElement(wE,{ref:o,iconNode:e,className:N6(`lucide-${NE(f3(t))}`,`lucide-${t}`,s),...i}));return n.displayName=f3(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 EE=[["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"}]],cv=ke("activity",EE);/**
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 TE=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],RE=ke("arrow-down-to-line",TE);/**
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 OE=[["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"}]],uv=ke("bell",OE);/**
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 ME=[["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"}]],xb=ke("bot",ME);/**
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 AE=[["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"}]],DE=ke("box",AE);/**
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 zE=[["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"}]],kE=ke("bug",zE);/**
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 LE=[["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"}]],UE=ke("calendar",LE);/**
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=ke("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 HE=[["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"}]],BE=ke("car",HE);/**
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 GE=[["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"}]],PE=ke("cctv",GE);/**
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 YE=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Fm=ke("check",YE);/**
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 VE=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Mc=ke("chevron-down",VE);/**
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 QE=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],KE=ke("chevron-left",QE);/**
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 XE=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Zu=ke("chevron-right",XE);/**
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 FE=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],N1=ke("chevron-up",FE);/**
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 ZE=[["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"}]],_6=ke("circle-alert",ZE);/**
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 JE=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],IE=ke("circle-check-big",JE);/**
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 WE=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],j6=ke("circle-dot",WE);/**
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 $E=[["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"}]],h3=ke("circle-help",$E);/**
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 eT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],C6=ke("clock",eT);/**
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 tT=[["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"}]],nT=ke("copy",tT);/**
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 aT=[["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=ke("cpu",aT);/**
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 sT=[["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"}]],rT=ke("crosshair",sT);/**
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 iT=[["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"}]],lT=ke("dog",iT);/**
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 oT=[["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"}]],_1=ke("download",oT);/**
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 cT=[["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"}]],uT=ke("external-link",cT);/**
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 dT=[["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"}]],w6=ke("eye-off",dT);/**
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 fT=[["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"}]],ch=ke("eye",fT);/**
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 hT=[["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"}]],E6=ke("film",hT);/**
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 pT=[["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"}]],mT=ke("flask-conical",pT);/**
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 gT=[["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"}]],yT=ke("funnel",gT);/**
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 xT=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],bT=ke("gauge",xT);/**
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 vT=[["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"}]],Q1=ke("git-branch",vT);/**
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 ST=[["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"}]],NT=ke("grip-vertical",ST);/**
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 _T=[["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"}]],mm=ke("hard-drive",_T);/**
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 jT=[["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"}]],CT=ke("house",jT);/**
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 wT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],j1=ke("info",wT);/**
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 ET=[["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"}]],TT=ke("languages",ET);/**
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 RT=[["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"}]],T6=ke("layout-dashboard",RT);/**
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 OT=[["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"}]],MT=ke("lightbulb",OT);/**
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 AT=[["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"}]],DT=ke("list-todo",AT);/**
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 zT=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],uo=ke("loader-circle",zT);/**
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 kT=[["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"}]],LT=ke("log-out",kT);/**
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 UT=[["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"}]],R6=ke("mic",UT);/**
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 qT=[["path",{d:"M5 12h14",key:"1ays0h"}]],HT=ke("minus",qT);/**
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 BT=[["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"}]],C1=ke("monitor",BT);/**
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 GT=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],PT=ke("moon",GT);/**
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 YT=[["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"}]],Mm=ke("package",YT);/**
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 VT=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],O6=ke("pause",VT);/**
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 QT=[["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"}]],KT=ke("pencil",QT);/**
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 XT=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],K1=ke("play",XT);/**
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 FT=[["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"}]],M6=ke("plug",FT);/**
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 ZT=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],po=ke("plus",ZT);/**
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 JT=[["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=ke("puzzle",JT);/**
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 IT=[["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"}]],dv=ke("radio",IT);/**
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 WT=[["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"}]],Am=ke("refresh-cw",WT);/**
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 $T=[["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"}]],A6=ke("save",$T);/**
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 eR=[["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"}]],Zm=ke("scroll-text",eR);/**
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 tR=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],fv=ke("search",tR);/**
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 nR=[["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=ke("server",nR);/**
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 aR=[["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"}]],Jm=ke("settings",aR);/**
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 sR=[["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"}]],rR=ke("shield-x",sR);/**
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 iR=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],D6=ke("square",iR);/**
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 lR=[["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"}]],oR=ke("sun",lR);/**
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 cR=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],uR=ke("terminal",cR);/**
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 dR=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],fR=ke("toggle-left",dR);/**
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 hR=[["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"}]],Im=ke("trash-2",hR);/**
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 pR=[["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"}]],mR=ke("tree-pine",pR);/**
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 gR=[["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"}]],hv=ke("triangle-alert",gR);/**
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 yR=[["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"}]],z6=ke("upload",yR);/**
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 xR=[["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"}]],bR=ke("user",xR);/**
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 vR=[["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"}]],SR=ke("users",vR);/**
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 NR=[["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"}]],_R=ke("video",NR);/**
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 jR=[["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"}]],CR=ke("wifi-off",jR);/**
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 wR=[["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"}]],p3=ke("wifi",wR);/**
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 ER=[["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"}]],TR=ke("workflow",ER);/**
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 RR=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],bl=ke("x",RR);/**
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 OR=[["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"}]],k6=ke("wrench",OR);var m3={};const at=t=>typeof t=="string",Kp=()=>{let t,e;const n=new Promise((s,i)=>{t=s,e=i});return n.resolve=t,n.reject=e,n},g3=t=>t==null?"":""+t,MR=(t,e,n)=>{t.forEach(s=>{e[s]&&(n[s]=e[s])})},AR=/###/g,y3=t=>t&&t.indexOf("###")>-1?t.replace(AR,"."):t,x3=t=>!t||at(t),gm=(t,e,n)=>{const s=at(e)?e.split("."):e;let i=0;for(;i<s.length-1;){if(x3(t))return{};const o=y3(s[i]);!t[o]&&n&&(t[o]=new n),Object.prototype.hasOwnProperty.call(t,o)?t=t[o]:t={},++i}return x3(t)?{}:{obj:t,k:y3(s[i])}},b3=(t,e,n)=>{const{obj:s,k:i}=gm(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=gm(t,d,Object);for(;f.obj===void 0&&d.length;)o=`${d[d.length-1]}.${o}`,d=d.slice(0,d.length-1),f=gm(t,d,Object),f!=null&&f.obj&&typeof f.obj[`${f.k}.${o}`]<"u"&&(f.obj=void 0);f.obj[`${f.k}.${o}`]=n},DR=(t,e,n,s)=>{const{obj:i,k:o}=gm(t,e,Object);i[o]=i[o]||[],i[o].push(n)},T1=(t,e)=>{const{obj:n,k:s}=gm(t,e);if(n&&Object.prototype.hasOwnProperty.call(n,s))return n[s]},zR=(t,e,n)=>{const s=T1(t,n);return s!==void 0?s:T1(e,n)},L6=(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]):L6(t[s],e[s],n):t[s]=e[s]);return t},Du=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var kR={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const LR=t=>at(t)?t.replace(/[&<>"'\/]/g,e=>kR[e]):t;class UR{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 qR=[" ",",","?","!",";"],HR=new UR(20),BR=(t,e,n)=>{e=e||"",n=n||"";const s=qR.filter(d=>e.indexOf(d)<0&&n.indexOf(d)<0);if(s.length===0)return!0;const i=HR.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},bb=(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},Dm=t=>t==null?void 0:t.replace(/_/g,"-"),GR={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||GR,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 fl=new R1;class X1{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 v3 extends X1{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,v;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:bb((v=(y=this.data)==null?void 0:y[e])==null?void 0:v[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),b3(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?L6(p,s,o):p={...p,...s},b3(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 U6={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 q6=Symbol("i18next/PATH_KEY");function PR(){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===q6?t:(t.push(i),n=Proxy.revocable(s,e),n.proxy)},Proxy.revocable(Object.create(null),e).proxy}function kf(t,e){const{[q6]:n}=t(PR()),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 S3={},ix=t=>!at(t)&&typeof t!="boolean"&&typeof t!="number";class O1 extends X1{constructor(e,n={}){super(),MR(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=fl.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=ix(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&&!BR(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(I=>typeof I=="function"?kf(I,{...this.options,...i}):String(I));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 v=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;v===void 0&&(v=":");const b=i.lng||this.language,_=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((b==null?void 0:b.toLowerCase())==="cimode")return _?o?{res:`${y}${v}${f}`,usedKey:f,exactUsedKey:f,usedLng:b,usedNS:y,usedParams:this.getUsedParamsDetails(i)}:`${y}${v}${f}`:o?{res:f,usedKey:f,exactUsedKey:f,usedLng:b,usedNS:y,usedParams:this.getUsedParamsDetails(i)}:f;const C=this.resolve(e,i);let w=C==null?void 0:C.res;const R=(C==null?void 0:C.usedKey)||f,O=(C==null?void 0:C.exactUsedKey)||f,T=["[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),P=O1.hasDefaultValue(i),H=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${H}`]||i[`defaultValue${L}`]||i.defaultValue;let F=w;z&&!w&&P&&(F=V);const re=ix(F),ne=Object.prototype.toString.apply(F);if(z&&F&&re&&T.indexOf(ne)<0&&!(at(M)&&Array.isArray(F))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const I=this.options.returnedObjectHandler?this.options.returnedObjectHandler(R,F,{...i,ns:p}):`key '${f} (${this.language})' returned an object instead of string.`;return o?(C.res=I,C.usedParams=this.getUsedParamsDetails(i),C):I}if(d){const I=Array.isArray(F),ie=I?[]:{},ce=I?O:R;for(const Y in F)if(Object.prototype.hasOwnProperty.call(F,Y)){const $=`${ce}${d}${Y}`;P&&!w?ie[Y]=this.translate($,{...i,defaultValue:ix(V)?V[Y]:void 0,joinArrays:!1,ns:p}):ie[Y]=this.translate($,{...i,joinArrays:!1,ns:p}),ie[Y]===$&&(ie[Y]=F[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 I=!1,ie=!1;!this.isValidLookup(w)&&P&&(I=!0,w=V),this.isValidLookup(w)||(ie=!0,w=f);const Y=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&ie?void 0:w,$=P&&V!==w&&this.options.updateMissing;if(ie||I||$){if(this.logger.log($?"updateKey":"missingKey",b,y,f,$?V:w),d){const G=this.resolve(f,{...i,keySeparator:!1});G&&G.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 je=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&je&&je[0])for(let G=0;G<je.length;G++)ae.push(je[G]);else this.options.saveMissingTo==="all"?ae=this.languageUtils.toResolveHierarchy(i.lng||this.language):ae.push(i.lng||this.language);const he=(G,W,fe)=>{var _e;const be=P&&fe!==w?fe:Y;this.options.missingKeyHandler?this.options.missingKeyHandler(G,y,W,be,$,i):(_e=this.backendConnector)!=null&&_e.saveMissing&&this.backendConnector.saveMissing(G,y,W,be,$,i),this.emit("missingKey",G,y,W,w)};this.options.saveMissing&&(this.options.saveMissingPlurals&&k?ae.forEach(G=>{const W=this.pluralResolver.getSuffixes(G,i);U&&i[`defaultValue${this.options.pluralSeparator}zero`]&&W.indexOf(`${this.options.pluralSeparator}zero`)<0&&W.push(`${this.options.pluralSeparator}zero`),W.forEach(fe=>{he([G],f+fe,i[`defaultValue${fe}`]||V)})}):he(ae,f,V))}w=this.extendTranslation(w,e,i,C,s),ie&&w===f&&this.options.appendNamespaceToMissingKey&&(w=`${y}${v}${f}`),(ie||I)&&this.options.parseMissingKeyHandler&&(w=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${y}${v}${f}`:f,I?w:void 0,i))}return o?(C.res=w,C.usedParams=this.getUsedParamsDetails(i),C):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 v=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(v){const C=e.match(this.interpolator.nestingRegexp);b=C&&C.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),v){const C=e.match(this.interpolator.nestingRegexp),w=C&&C.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,(...C)=>(o==null?void 0:o[0])===C[0]&&!s.context?(this.logger.warn(`It seems you are nesting recursively key: ${C[0]} in key: ${n[0]}`),null):this.translate(...C,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=U6.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),v=y.key;i=v;let b=y.namespaces;this.options.fallbackNS&&(b=b.concat(this.options.fallbackNS));const _=n.count!==void 0&&!at(n.count),C=_&&!n.ordinal&&n.count===0,w=n.context!==void 0&&(at(n.context)||typeof n.context=="number")&&n.context!=="",R=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);b.forEach(O=>{var T,M;this.isValidLookup(s)||(f=O,!S3[`${R[0]}-${O}`]&&((T=this.utils)!=null&&T.hasLoadedNamespace)&&!((M=this.utils)!=null&&M.hasLoadedNamespace(f))&&(S3[`${R[0]}-${O}`]=!0,this.logger.warn(`key "${i}" for languages "${R.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!!!")),R.forEach(z=>{var H;if(this.isValidLookup(s))return;d=z;const k=[v];if((H=this.i18nFormat)!=null&&H.addLookupKeys)this.i18nFormat.addLookupKeys(k,v,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(v+L.replace(V,this.options.pluralSeparator)),k.push(v+L),C&&k.push(v+U)),w){const F=`${v}${this.options.contextSeparator||"_"}${n.context}`;k.push(F),_&&(n.ordinal&&L.indexOf(V)===0&&k.push(F+L.replace(V,this.options.pluralSeparator)),k.push(F+L),C&&k.push(F+U))}}let P;for(;P=k.pop();)this.isValidLookup(s)||(o=P,s=this.getResource(z,O,P,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 N3{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=fl.create("languageUtils")}getScriptPartFromCode(e){if(e=Dm(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=Dm(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 _3={zero:0,one:1,two:2,few:3,many:4,other:5},j3={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class YR{constructor(e,n={}){this.languageUtils=e,this.options=n,this.logger=fl.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,n={}){const s=Dm(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!"),j3;if(!e.match(/-|_/))return j3;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)=>_3[i]-_3[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 C3=(t,e,n,s=".",i=!0)=>{let o=zR(t,e,n);return!o&&i&&at(n)&&(o=bb(t,n,s),o===void 0&&(o=bb(e,n,s))),o},lx=t=>t.replace(/\$/g,"$$$$");class w3{constructor(e={}){var n;this.logger=fl.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:v,unescapePrefix:b,nestingPrefix:_,nestingPrefixEscaped:C,nestingSuffix:w,nestingSuffixEscaped:R,nestingOptionsSeparator:O,maxReplaces:T,alwaysFormat:M}=e.interpolation;this.escape=n!==void 0?n:LR,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=v?"":b||"-",this.unescapeSuffix=this.unescapePrefix?"":v||"",this.nestingPrefix=_?Du(_):C||Du("$t("),this.nestingSuffix=w?Du(w):R||Du(")"),this.nestingOptionsSeparator=O||",",this.maxReplaces=T||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 C;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=C3(n,p,w,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(M,void 0,s,{...i,...n,interpolationkey:w}):M}const R=w.split(this.formatSeparator),O=R.shift().trim(),T=R.join(this.formatSeparator).trim();return this.format(C3(n,p,O,this.options.keySeparator,this.options.ignoreJSONStructure),T,s,{...i,...n,interpolationkey:O})};this.resetRegExp();const v=(i==null?void 0:i.missingInterpolationHandler)||this.options.missingInterpolationHandler,b=((C=i==null?void 0:i.interpolation)==null?void 0:C.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:w=>lx(w)},{regex:this.regexp,safeValue:w=>this.escapeValue?lx(this.escape(w)):lx(w)}].forEach(w=>{for(f=0;o=w.regex.exec(e);){const R=o[1].trim();if(d=y(R),d===void 0)if(typeof v=="function"){const T=v(e,o,i);d=at(T)?T:""}else if(i&&Object.prototype.hasOwnProperty.call(i,R))d="";else if(b){d=o[0];continue}else this.logger.warn(`missed to pass in variable ${R} for interpolating ${e}`),d="";else!at(d)&&!this.useRawValueToEscape&&(d=g3(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 v=this.nestingOptionsSeparator;if(p.indexOf(v)<0)return p;const b=p.split(new RegExp(`${Du(v)}[ ]*{`));let _=`{${b[1]}`;p=b[0],_=this.interpolate(_,d);const C=_.match(/'/g),w=_.match(/"/g);(((C==null?void 0:C.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(R){return this.logger.warn(`failed parsing options string in nesting for key ${p}`,R),`${p}${v}${_}`}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(v=>v.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=g3(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),o=""),p.length&&(o=p.reduce((v,b)=>this.format(v,b,s.lng,{...s,interpolationkey:i[1].trim()}),o.trim())),e=e.replace(i[0],o),this.regexp.lastIndex=0}return e}}const VR=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,""),v=f.trim();n[v]||(n[v]=y),y==="false"&&(n[v]=!1),y==="true"&&(n[v]=!0),isNaN(y)||(n[v]=parseInt(y,10))}})}return{formatName:e,formatOptions:n}},E3=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(Dm(s),i),e[d]=f),f(n)}},QR=t=>(e,n,s)=>t(Dm(n),s)(e);class KR{constructor(e={}){this.logger=fl.create("formatter"),this.options=e,this.init(e)}init(e,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const s=n.cacheInBuiltFormats?E3:QR;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()]=E3(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:v}=VR(p);if(this.formats[y]){let _=f;try{const C=((b=i==null?void 0:i.formatParams)==null?void 0:b[i.interpolationkey])||{},w=C.locale||C.lng||i.locale||i.lng||s;_=this.formats[y](f,w,{...v,...i,...C})}catch(C){this.logger.warn(C)}return _}else this.logger.warn(`there was no format function for ${y}`);return f},e)}}const XR=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class FR extends X1{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=fl.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 v=!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,v=!1,d[_]===void 0&&(d[_]=!0),o[_]===void 0&&(o[_]=!0),p[b]===void 0&&(p[b]=!0)))}),v||(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=>{DR(p.loaded,[o],d),XR(p,e),n&&p.errors.push(n),p.pendingCount===0&&!p.done&&(Object.keys(p.loaded).forEach(y=>{f[y]||(f[y]={});const v=p.loaded[y];v.length&&v.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,v)=>{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&&v&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,e,n,s,i+1,o*2,d)},o);return}d(y,v)},p=this.backend[s].bind(this.backend);if(p.length===2){try{const y=p(e,n);y&&typeof y.then=="function"?y.then(v=>f(null,v)).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,v,b,_;if((y=(p=this.services)==null?void 0:p.utils)!=null&&y.hasLoadedNamespace&&!((b=(v=this.services)==null?void 0:v.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 C={...d,isUpdate:o},w=this.backend.create.bind(this.backend);if(w.length<6)try{let R;w.length===5?R=w(e,n,s,i,C):R=w(e,n,s,i),R&&typeof R.then=="function"?R.then(O=>f(null,O)).catch(f):f(null,R)}catch(R){f(R)}else w(e,n,s,i,f,C)}!e||!e[0]||this.store.addResource(e[0],n,s,i)}}}const ox=()=>({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}),T3=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},Q0=()=>{},ZR=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})},H6="__i18next_supportNoticeShown",JR=()=>!!(typeof globalThis<"u"&&globalThis[H6]||typeof process<"u"&&m3&&m3.I18NEXT_NO_SUPPORT_NOTICE),IR=()=>{typeof globalThis<"u"&&(globalThis[H6]=!0)},WR=t=>{var e,n,s,i,o,d,f,p,y,v,b,_,C;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 R,O,T;return((R=w==null?void 0:w.name)==null?void 0:R.indexOf("Locize"))>0||((T=(O=w==null?void 0:w.constructor)==null?void 0:O.name)==null?void 0:T.indexOf("Locize"))>0})||(b=(v=t==null?void 0:t.options)==null?void 0:v.backend)!=null&&b.projectId||(C=(_=t==null?void 0:t.options)==null?void 0:_.backend)!=null&&C.backendOptions&&t.options.backend.backendOptions.some(w=>w==null?void 0:w.projectId))};class ym extends X1{constructor(e={},n){if(super(),this.options=T3(e),this.services={},this.logger=fl,this.modules={external:[]},ZR(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=ox();this.options={...s,...this.options,...T3(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&&!WR(this)&&!JR()&&(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 💙"),IR());const i=y=>y?typeof y=="function"?new y:y:null;if(!this.options.isClone){this.modules.logger?fl.init(i(this.modules.logger),this.options):fl.init(null,this.options);let y;this.modules.formatter?y=this.modules.formatter:y=KR;const v=new N3(this.options);this.store=new v3(this.options.resources,this.options);const b=this.services;b.logger=fl,b.resourceStore=this.store,b.languageUtils=v,b.pluralResolver=new YR(v,{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 w3(this.options),b.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},b.backendConnector=new FR(i(this.modules.backend),b.resourceStore,b,this.options),b.backendConnector.on("*",(C,...w)=>{this.emit(C,...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("*",(C,...w)=>{this.emit(C,...w)}),this.modules.external.forEach(C=>{C.init&&C.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Q0),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]=(...v)=>this.store[y](...v)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(y=>{this[y]=(...v)=>(this.store[y](...v),this)});const f=Kp(),p=()=>{const y=(v,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(v,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=Q0){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(v=>p(v)),(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=Kp();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=Q0),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"&&U6.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=Kp();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 v,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=(v=this.services.languageDetector)==null?void 0:v.cacheUserLanguage)==null||b.call(v,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 v=this.options.keySeparator||".";let b;return p.keyPrefix&&Array.isArray(o)?b=o.map(_=>(typeof _=="function"&&(_=kf(_,y)),`${p.keyPrefix}${v}${_}`)):(typeof o=="function"&&(o=kf(o,y)),b=p.keyPrefix?`${p.keyPrefix}${v}${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=Kp();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=Kp();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 N3(ox());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 ym(e,n);return s.createInstance=ym.createInstance,s}cloneInstance(e={},n=Q0){const s=e.forkResourceStore;s&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},o=new ym(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((v,b)=>(v[b]={...p[y][b]},v),p[y]),p),{});o.store=new v3(f,i),o.services.resourceStore=o.store}if(e.interpolation){const p={...ox().interpolation,...this.options.interpolation,...e.interpolation},y={...i,interpolation:p};o.services.interpolator=new w3(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=ym.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 $R=(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);Ju(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)},R3={},vb=(t,e,n,s)=>{Ju(n)&&R3[n]||(Ju(n)&&(R3[n]=new Date),$R(t,e,n,s))},B6=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}},Sb=(t,e,n)=>{t.loadNamespaces(e,B6(t,n))},O3=(t,e,n,s)=>{if(Ju(n)&&(n=[n]),t.options.preload&&t.options.preload.indexOf(e)>-1)return Sb(t,n,s);n.forEach(i=>{t.options.ns.indexOf(i)<0&&t.options.ns.push(i)}),t.loadLanguages(e,B6(t,s))},eO=(t,e,n={})=>!e.languages||!e.languages.length?(vb(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}}),Ju=t=>typeof t=="string",tO=t=>typeof t=="object"&&t!==null,nO=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,aO={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},sO=t=>aO[t],rO=t=>t.replace(nO,sO);let Nb={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:rO,transDefaultProps:void 0};const iO=(t={})=>{Nb={...Nb,...t}},lO=()=>Nb;let G6;const oO=t=>{G6=t},cO=()=>G6,uO={type:"3rdParty",init(t){iO(t.options.react),oO(t)}},dO=D.createContext();class fO{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var cx={exports:{}},ux={};/**
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 M3;function hO(){if(M3)return ux;M3=1;var t=pl();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 C=_(),w=s({inst:{value:C,getSnapshot:_}}),R=w[0].inst,O=w[1];return o(function(){R.value=C,R.getSnapshot=_,p(R)&&O({inst:R})},[b,C,_]),i(function(){return p(R)&&O({inst:R}),b(function(){p(R)&&O({inst:R})})},[b]),d(C),C}function p(b){var _=b.getSnapshot;b=b.value;try{var C=_();return!n(b,C)}catch{return!0}}function y(b,_){return _()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?y:f;return ux.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:v,ux}var A3;function pO(){return A3||(A3=1,cx.exports=hO()),cx.exports}var mO=pO();const gO=(t,e)=>{if(Ju(e))return e;if(tO(e)&&Ju(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},yO={t:gO,ready:!1},xO=()=>()=>{},Er=(t,e={})=>{var V,F,re;const{i18n:n}=e,{i18n:s,defaultNS:i}=D.useContext(dO)||{},o=n||s||cO();o&&!o.reportNamespaces&&(o.reportNamespaces=new fO),o||vb(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const d=D.useMemo(()=>{var ne;return{...lO(),...(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),v=Ju(y)?[y]:y||["translation"],b=D.useMemo(()=>v,v);(re=(F=o==null?void 0:o.reportNamespaces)==null?void 0:F.addUsedNamespaces)==null||re.call(F,b);const _=D.useRef(0),C=D.useCallback(ne=>{if(!o)return xO;const{bindI18n:I,bindI18nStore:ie}=d,ce=()=>{_.current+=1,ne()};return I&&o.on(I,ce),ie&&o.store.on(ie,ce),()=>{I&&I.split(" ").forEach(Y=>o.off(Y,ce)),ie&&ie.split(" ").forEach(Y=>o.store.off(Y,ce))}},[o,d]),w=D.useRef(),R=D.useCallback(()=>{if(!o)return yO;const ne=!!(o.isInitialized||o.initializedStoreOnce)&&b.every(ae=>eO(ae,o,d)),I=e.lng||o.language,ie=_.current,ce=w.current;if(ce&&ce.ready===ne&&ce.lng===I&&ce.keyPrefix===p&&ce.revision===ie)return ce;const $={t:o.getFixedT(I,d.nsMode==="fallback"?b:b[0],p),ready:ne,lng:I,keyPrefix:p,revision:ie};return w.current=$,$},[o,b,p,d,e.lng]),[O,T]=D.useState(0),{t:M,ready:z}=mO.useSyncExternalStore(C,R,R);D.useEffect(()=>{if(o&&!z&&!f){const ne=()=>T(I=>I+1);e.lng?O3(o,e.lng,b,ne):Sb(o,b,ne)}},[o,e.lng,b,z,f,O]);const k=o||{},P=D.useRef(null),H=D.useRef(),L=ne=>{const I=Object.getOwnPropertyDescriptors(ne);I.__original&&delete I.__original;const ie=Object.create(Object.getPrototypeOf(ne),I);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,I=ne==null?void 0:ne.language;let ie=ne;ne&&(P.current&&P.current.__original===ne?H.current!==I?(ie=L(ne),P.current=ie,H.current=I):ie=P.current:(ie=L(ne),P.current=ie,H.current=I));const ce=!z&&!f?(...$)=>(vb(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 I=()=>ne();e.lng?O3(o,e.lng,b,I):Sb(o,b,I)});return U};function P6(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 D3=new Map;function bO(){const{pagePath:t}=$b(),e=Om(),{data:n}=ot({queryKey:["addon-pages"],queryFn:async()=>{const p=await e.trpc.addonPages.listPages.query();return P6(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=D3.get(p);if(y){o(()=>y);return}f(null),o(null);const v=s.bundleUrl;import(v).then(b=>{const _=b.default;if(typeof _!="function")throw new Error(`Addon page "${s.id}" does not export a default React component`);D3.set(p,_),o(()=>_)}).catch(b=>{console.error(`[AddonPageLoader] Failed to load ${v}:`,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 vO={dark:PT,light:oR,system:C1},SO={gauge:bT,puzzle:w1,bot:xb,cpu:zf,terminal:uR,box:DE,wrench:k6,activity:cv,plug:M6};function NO(){const t=ml(),e=gl(),{user:n,logout:s}=ov(),i=xS(),{t:o,i18n:d}=Er(),f=Om(),{data:p=0}=ot({queryKey:["updates","count"],queryFn:async()=>(await f.trpc.addons.listUpdates.query()).length,staleTime:3e4,refetchInterval:3e4}),{data:y}=ot({queryKey:["addon-pages"],queryFn:async()=>{const T=await f.trpc.addonPages.listPages.query();return P6(T)},staleTime:6e4}),v=()=>{s(),e("/login")},b=T=>t.pathname===T||t.pathname.startsWith(T+"/"),_=()=>{const T=d.language==="en"?"it":"en";d.changeLanguage(T)},C=[{label:o("nav.cameras","Cameras"),icon:Lc,path:"/cameras"},{label:o("nav.integrations"),icon:M6,path:"/integrations"},{label:o("nav.timeline","Timeline"),icon:C6,path:"/timeline"},{label:o("nav.pipeline","Pipeline"),icon:Q1,path:"/pipeline"}],w=[{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:Zm,path:"/system/logs"},{label:o("system.users"),icon:SR,path:"/system/users"},{label:o("system.settings"),icon:k6,path:"/system/settings"}],R=(i==null?void 0:i.mode)??"system",O={dark:o("theme.dark"),light:o("theme.light"),system:o("theme.system")};return h.jsxs("div",{className:"flex h-screen bg-background text-foreground",children:[h.jsxs("aside",{className:"flex w-48 flex-col border-r border-border bg-surface/80 backdrop-blur-sm shrink-0",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 T=b("/dashboard");return h.jsxs("button",{onClick:()=>e("/dashboard"),className:`flex w-full items-center gap-2.5 rounded-md px-2.5 py-2 text-[13px] font-medium transition-all ${T?"bg-primary/12 text-primary shadow-sm shadow-primary/5":"text-foreground-subtle hover:bg-surface-hover hover:text-foreground"}`,children:[h.jsx(T6,{className:`h-4 w-4 shrink-0 ${T?"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")})}),C.map(T=>{const M=T.icon,z=b(T.path);return h.jsxs("button",{onClick:()=>e(T.path),className:`flex w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-[12px] transition-all ${z?"bg-primary/12 text-primary":"text-foreground-subtle hover:bg-surface-hover hover:text-foreground"}`,children:[h.jsx(M,{className:`h-3.5 w-3.5 shrink-0 ${z?"text-primary":""}`}),T.label]},T.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")})}),w.map(T=>{const M=T.icon,z=b(T.path),k=T.path==="/system/addons";return h.jsxs("button",{onClick:()=>e(T.path),className:`flex w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-[12px] transition-all ${z?"bg-primary/12 text-primary":"text-foreground-subtle hover:bg-surface-hover hover:text-foreground"}`,children:[h.jsx(M,{className:`h-3.5 w-3.5 shrink-0 ${z?"text-primary":""}`}),h.jsx("span",{className:"flex-1 text-left",children:T.label}),k&&p>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:p})]},T.path)}),y&&y.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")})}),y==null?void 0:y.map(T=>{const M=b(T.path),z=SO[T.icon]??w1;return h.jsxs("button",{onClick:()=>e(T.path),className:`flex w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-[12px] transition-all ${M?"bg-primary/12 text-primary":"text-foreground-subtle hover:bg-surface-hover hover:text-foreground"}`,children:[h.jsx(z,{className:`h-3.5 w-3.5 shrink-0 ${M?"text-primary":""}`}),T.label]},T.id)})]}),h.jsxs("div",{className:"border-t border-border p-2 space-y-0.5",children:[h.jsxs("button",{onClick:_,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(TT,{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 T=vO[R];return h.jsx(T,{className:"h-3.5 w-3.5"})})(),h.jsx("span",{children:O[R]})]}),h.jsxs("button",{onClick:v,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(LT,{className:"h-3.5 w-3.5"}),h.jsx("span",{className:"truncate",children:(n==null?void 0:n.username)??"User"})]})]})]}),h.jsx("main",{className:"flex-1 overflow-auto bg-background",children:h.jsx(kN,{})})]})}function _O(){const{login:t}=ov(),e=xS(),n=gl(),[s,i]=D.useState(""),[o,d]=D.useState(""),[f,p]=D.useState(!1),[y,v]=D.useState(""),[b,_]=D.useState(!1),C=async w=>{w.preventDefault(),v(""),_(!0);try{await t(s,o),n("/dashboard",{replace:!0})}catch(R){v(R instanceof Error?R.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:C,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(w6,{className:"h-4 w-4"}):h.jsx(ch,{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 jO(){const t=gl();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(rR,{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 pv=new Map;function mv(t){pv.set(t.id,t)}function z3(t){return pv.get(t)}function CO(){return Array.from(pv.values())}function Ft(){return D.useMemo(()=>Om(),[])}function wO({config:t,size:e}){const n=Ft(),{data:s,isLoading:i,error:o}=ot({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(uo,{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(hv,{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(IE,{className:"h-3.5 w-3.5 text-success"}),h.jsx("span",{className:"text-success font-medium",children:"Online"})]}),h.jsx(K0,{label:"Version",value:String((d==null?void 0:d.version)??"N/A")}),h.jsx(K0,{label:"Uptime",value:EO(d==null?void 0:d.uptime)}),h.jsx(K0,{label:"Memory",value:`${TO(d==null?void 0:d.memoryUsage)} MB`}),h.jsx(K0,{label:"Platform",value:String((d==null?void 0:d.platform)??"N/A")})]})}function K0({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 EO(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 TO(t){return t?(t/1024/1024).toFixed(0):"N/A"}const RO=["class-filter","tracker","sub-detection","recognition","zone-analysis","event-generation","object-snapshot"];function OO({config:t,size:e}){const n=Ft(),{data:s,isLoading:i,error:o}=ot({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:RO.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 MO(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 AO({config:t,size:e}){const n=Ft(),{data:s,isLoading:i,error:o}=ot({queryKey:["system-info"],queryFn:async()=>await n.getSystemInfo(),refetchInterval:3e4}),{data:d}=ot({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?MO(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"]})]})]})}mv({id:"system-status",name:"System Status",icon:C1,defaultSize:{w:4,h:2},minSize:{w:2,h:2},component:wO});mv({id:"pipeline-stages",name:"Pipeline Stages",icon:TR,defaultSize:{w:4,h:3},minSize:{w:3,h:2},component:OO});mv({id:"storage",name:"Storage",icon:mm,defaultSize:{w:4,h:2},minSize:{w:2,h:2},component:AO});function uh(t){const{margin:e,containerPadding:n,containerWidth:s,cols:i}=t;return(s-e[0]*(i-1)-n[0]*2)/i}function eh(t,e,n){return Number.isFinite(t)?Math.round(e*t+Math.max(0,t-1)*n):t}function Xp(t,e,n,s,i,o,d){const{margin:f,containerPadding:p,rowHeight:y}=t,v=uh(t);let b,_,C,w;if(d?(b=Math.round(d.width),_=Math.round(d.height)):(b=eh(s,v,f[0]),_=eh(i,y,f[1])),o?(C=Math.round(o.top),w=Math.round(o.left)):d?(C=Math.round(d.top),w=Math.round(d.left)):(C=Math.round((y+f[1])*n+p[1]),w=Math.round((v+f[0])*e+p[0])),!o&&!d){if(Number.isFinite(s)){const O=Math.round((v+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])-C-_;O!==f[1]&&(_+=O-f[1])}}return{top:C,left:w,width:b,height:_}}function DO(t,e,n,s,i){const{margin:o,containerPadding:d,cols:f,rowHeight:p,maxRows:y}=t,v=uh(t);let b=Math.round((n-d[0])/(v+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 X0(t,e,n){const{margin:s,containerPadding:i,rowHeight:o}=t,d=uh(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 zO(t,e,n){const{margin:s,rowHeight:i}=t,o=uh(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 gv(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&&gv(s,e))return s}}function Y6(t,e){return t.filter(n=>gv(n,e))}function kO(t,e){return e==="horizontal"?V6(t):e==="vertical"||e==="wrap"?_b(t):[...t]}function _b(t){return[...t].sort((e,n)=>e.y!==n.y?e.y-n.y:e.x-n.x)}function V6(t){return[...t].sort((e,n)=>e.x!==n.x?e.x-n.x:e.y-n.y)}function F1(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 Z1(t){return t.filter(e=>e.static===!0)}function Iu(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]=Iu(s))}return e}function LO(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 UO(t,e,n){let s=Lu(t,e);return s?(s=n(Iu(s)),[LO(t,s),s]):[[...t],null]}function yv(t,e){const n=Z1(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,v=e.y;typeof n=="number"&&(e.x=n),typeof s=="number"&&(e.y=s),e.moved=!0;let b=kO(t,d);(d==="vertical"&&typeof s=="number"?v>=s:d==="horizontal"&&typeof n=="number"?y>=n:!1)&&(b=b.reverse());const C=Y6(b,e),w=C.length>0;if(w&&p)return zc(t);if(w&&o)return e.x=y,e.y=v,e.moved=!1,t;let R=[...t];for(let O=0;O<C.length;O++){const T=C[O];T!==void 0&&(T.moved||(T.static?R=k3(R,T,e,i,d):R=k3(R,e,T,i,d)))}return R}function k3(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),C=_!==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(C&&f)return Uu(t,n,void 0,n.y+1,s,p,i);if(C&&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,v=f?n.y+1:void 0;return y===void 0&&v===void 0?[...t]:Uu(t,n,y,v,s,p,i)}function Af(t,e,n){return Math.max(e,Math.min(n,t))}var qO={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))}}},HO={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)}}},Q6=[qO,HO];function F0(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 BO(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 K6({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 GO({top:t,left:e,width:n,height:s}){return{top:`${t}px`,left:`${e}px`,width:`${n}px`,height:`${s}px`,position:"absolute"}}function L3(t){return t*100+"%"}function PO(t,e,n,s){return t+n>s?e:n}function X6(t,e,n){return t<0?e:n}function YO(t){return Math.max(0,t)}function A1(t){return Math.max(0,t)}var xv=(t,e,n)=>{const{left:s,height:i,width:o}=e,d=t.top-(i-t.height);return{left:s,width:o,height:X6(d,t.height,i),top:A1(d)}},bv=(t,e,n)=>{const{top:s,left:i,height:o,width:d}=e;return{top:s,height:o,width:PO(t.left,t.width,d,n),left:YO(i)}},vv=(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}},Sv=(t,e,n)=>{const{top:s,left:i,height:o,width:d}=e;return{width:d,left:i,height:X6(s,t.height,o),top:A1(s)}},VO=(t,e,n)=>xv(t,bv(t,e,n)),QO=(t,e,n)=>xv(t,vv(t,e)),KO=(t,e,n)=>Sv(t,bv(t,e,n)),XO=(t,e,n)=>Sv(t,vv(t,e)),FO={n:xv,ne:VO,e:bv,se:KO,s:Sv,sw:XO,w:vv,nw:QO};function ZO(t,e,n,s){const i=FO[t];return i?i(e,{...e,...n},s):n}var JO={type:"transform",scale:1,calcStyle(t){return K6(t)}},IO=JO,WO={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},$O={enabled:!0,bounded:!1,threshold:3},eM={enabled:!0,handles:["se"]},tM={enabled:!1,defaultItem:{w:1,h:1}};function Nv(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??Z1(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;gv(e,y)&&Nv(t,y,n+e[o],s,f)}}e[s]=n}function nM(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;)Nv(n,e,i.y+i.h,"y");return e.y=Math.max(e.y,0),e}function aM(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(Nv(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 F6={type:"vertical",allowOverlap:!1,compact(t,e){const n=Z1(t);let s=F1(n);const i=_b(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=Iu(f);p.static||(p=nM(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}},Z6={type:"horizontal",allowOverlap:!1,compact(t,e){const n=Z1(t),s=V6(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=Iu(d);f.static||(f=aM(n,f,e,s),n.push(f));const p=t.indexOf(d);i[p]=f,f.moved=!1}return i}},J6={type:null,allowOverlap:!1,compact(t,e){return zc(t)}},sM={...F6,allowOverlap:!0,compact(t,e){return zc(t)}},rM={...Z6,allowOverlap:!0,compact(t,e){return zc(t)}},iM={...J6,allowOverlap:!0};function _v(t,e=!1,n=!1){let s;return e?t==="vertical"?s=sM:t==="horizontal"?s=rM:s=iM:t==="vertical"?s=F6:t==="horizontal"?s=Z6:s=J6,n?{...s,preventCollision:n}:s}function I6(t){return Object.keys(t).sort((n,s)=>t[n]-t[s])}function U3(t,e){const n=I6(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 q3(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 dx(t,e,n,s,i,o){const d=t[n];if(d)return zc(d);let f=t[s];const p=I6(e),y=p.slice(p.indexOf(n));for(let C=0;C<y.length;C++){const w=y[C];if(w===void 0)continue;const R=t[w];if(R){f=R;break}}const v=zc(f||[]),b=yv(v,{cols:i});return(typeof o=="object"&&o!==null?o:_v(o)).compact(b,i)}function Z0(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 W6(t){return function(n,s,i,o,d,f,p){return t(n,s,p)}}function J1(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 $6(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 H3(t){return t.constructor===Object||t.constructor==null}function B3(t){return typeof t.then=="function"}function I1(t,e){return t===e||t!==t&&e!==e}var lM="[object Arguments]",oM="[object Boolean]",cM="[object Date]",uM="[object RegExp]",dM="[object Map]",fM="[object Number]",hM="[object Object]",pM="[object Set]",mM="[object String]",G3=Object.prototype.toString;function W1(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(v,b,_){if(v===b)return!0;if(!v||!b||typeof v!="object"||typeof b!="object")return v!==v&&b!==b;if(H3(v)&&H3(b))return i(v,b,p,_);var C=Array.isArray(v),w=Array.isArray(b);if(C||w)return C===w&&e(v,b,p,_);var R=G3.call(v);return R!==G3.call(b)?!1:R===cM?n(v,b,p,_):R===uM?o(v,b,p,_):R===dM?s(v,b,p,_):R===pM?d(v,b,p,_):R===hM||R===lM?B3(v)||B3(b)?!1:i(v,b,p,_):R===oM||R===fM||R===mM?I1(v.valueOf(),b.valueOf()):!1}return y}function e8(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 gM=J1(e8);function t8(t,e){return I1(t.valueOf(),e.valueOf())}function n8(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,v=0;e.forEach(function(b,_){!y&&!o[v]&&(y=n(p,_,d,v,t,e,s)&&n(f,b,p,_,t,e,s))&&(o[v]=!0),v++}),d++,i=y}}),i}var yM=J1(n8),xM="_owner",bM=Object.prototype.hasOwnProperty;function a8(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===xM){var f=!!t.$$typeof,p=!!e.$$typeof;if((f||p)&&f!==p)return!1}if(!bM.call(e,d)||!n(t[d],e[d],d,d,t,e,s))return!1}return!0}var vM=J1(a8);function s8(t,e){return t.source===e.source&&t.flags===e.flags}function r8(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(v,b){!p&&!o[y]&&(p=n(d,v,f,b,t,e,s))&&(o[y]=!0),y++}),i=p}}),i}var SM=J1(r8),i8=Object.freeze({areArraysEqual:e8,areDatesEqual:t8,areMapsEqual:n8,areObjectsEqual:a8,areRegExpsEqual:s8,areSetsEqual:r8,createIsNestedEqual:W6}),l8=Object.freeze({areArraysEqual:gM,areDatesEqual:t8,areMapsEqual:yM,areObjectsEqual:vM,areRegExpsEqual:s8,areSetsEqual:SM,createIsNestedEqual:W6}),NM=W1(i8);function so(t,e){return NM(t,e,void 0)}W1($6(i8,{createIsNestedEqual:function(){return I1}}));W1(l8);W1($6(l8,{createIsNestedEqual:function(){return I1}}));var Fp={exports:{}},fx={},hx={exports:{}},px,P3;function _M(){if(P3)return px;P3=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return px=t,px}var mx,Y3;function jM(){if(Y3)return mx;Y3=1;var t=_M();function e(){}function n(){}return n.resetWarningCache=e,mx=function(){function s(d,f,p,y,v,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},mx}var V3;function $1(){return V3||(V3=1,hx.exports=jM()()),hx.exports}var J0={exports:{}},Q3;function CM(){if(Q3)return J0.exports;Q3=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={},K3;function ey(){if(K3)return dc;K3=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={},X3;function wM(){if(X3)return fc;X3=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 F3;function jv(){if(F3)return pa;F3=1,Object.defineProperty(pa,"__esModule",{value:!0}),pa.addClassName=P,pa.addEvent=d,pa.addUserSelectStyles=M,pa.createCSSTransform=C,pa.createSVGTransform=w,pa.getTouch=O,pa.getTouchIdentifier=T,pa.getTranslation=R,pa.innerHeight=v,pa.innerWidth=b,pa.matchesSelector=i,pa.matchesSelectorAndParentsTo=o,pa.offsetXYFromParent=_,pa.outerHeight=p,pa.outerWidth=y,pa.removeClassName=H,pa.removeEvent=f,pa.scheduleRemoveUserSelectStyles=z;var t=ey(),e=n(wM());function n(L,U){if(typeof WeakMap=="function")var V=new WeakMap,F=new WeakMap;return(n=function(re,ne){if(!ne&&re&&re.__esModule)return re;var I,ie,ce={__proto__:null,default:re};if(re===null||typeof re!="object"&&typeof re!="function")return ce;if(I=ne?F:V){if(I.has(re))return I.get(re);I.set(re,ce)}for(const Y in re)Y!=="default"&&{}.hasOwnProperty.call(re,Y)&&((ie=(I=Object.defineProperty)&&Object.getOwnPropertyDescriptor(re,Y))&&(ie.get||ie.set)?I(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 F=L;do{if(i(F,U))return!0;if(F===V)return!1;F=F.parentNode}while(F);return!1}function d(L,U,V,F){if(!L)return;const re={capture:!0,...F};L.addEventListener?L.addEventListener(U,V,re):L.attachEvent?L.attachEvent("on"+U,V):L["on"+U]=V}function f(L,U,V,F){if(!L)return;const re={capture:!0,...F};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 v(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,I=(L.clientY+U.scrollTop-re.top)/V;return{x:ne,y:I}}function C(L,U){const V=R(L,U,"px");return{[(0,e.browserPrefixToKey)("transform",e.default)]:V}}function w(L,U){return R(L,U,"")}function R(L,U,V){let{x:F,y:re}=L,ne=`translate(${F}${V},${re}${V})`;if(U){const I=`${typeof U.x=="string"?U.x:U.x+V}`,ie=`${typeof U.y=="string"?U.y:U.y+V}`;ne=`translate(${I}, ${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 T(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&&P(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&&H(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 P(L,U){L.classList?L.classList.add(U):L.className.match(new RegExp(`(?:^|\\s)${U}(?!\\S)`))||(L.className+=` ${U}`)}function H(L,U){L.classList?L.classList.remove(U):L.className=L.className.replace(new RegExp(`(?:^|\\s)${U}(?!\\S)`,"g"),"")}return pa}var ol={},Z3;function o8(){if(Z3)return ol;Z3=1,Object.defineProperty(ol,"__esModule",{value:!0}),ol.canDragX=i,ol.canDragY=o,ol.createCoreData=f,ol.createDraggableData=p,ol.getBoundPosition=n,ol.getControlPosition=d,ol.snapToGrid=s;var t=ey(),e=jv();function n(b,_,C){if(!b.props.bounds)return[_,C];let{bounds:w}=b.props;w=typeof w=="string"?w:y(w);const R=v(b);if(typeof w=="string"){const{ownerDocument:O}=R,T=O.defaultView;let M;if(w==="parent"?M=R.parentNode:M=R.getRootNode().querySelector(w),!(M instanceof T.HTMLElement))throw new Error('Bounds selector "'+w+'" could not find an element.');const z=M,k=T.getComputedStyle(R),P=T.getComputedStyle(z);w={left:-R.offsetLeft+(0,t.int)(P.paddingLeft)+(0,t.int)(k.marginLeft),top:-R.offsetTop+(0,t.int)(P.paddingTop)+(0,t.int)(k.marginTop),right:(0,e.innerWidth)(z)-(0,e.outerWidth)(R)-R.offsetLeft+(0,t.int)(P.paddingRight)-(0,t.int)(k.marginRight),bottom:(0,e.innerHeight)(z)-(0,e.outerHeight)(R)-R.offsetTop+(0,t.int)(P.paddingBottom)-(0,t.int)(k.marginBottom)}}return(0,t.isNum)(w.right)&&(_=Math.min(_,w.right)),(0,t.isNum)(w.bottom)&&(C=Math.min(C,w.bottom)),(0,t.isNum)(w.left)&&(_=Math.max(_,w.left)),(0,t.isNum)(w.top)&&(C=Math.max(C,w.top)),[_,C]}function s(b,_,C){const w=Math.round(_/b[0])*b[0],R=Math.round(C/b[1])*b[1];return[w,R]}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,_,C){const w=typeof _=="number"?(0,e.getTouch)(b,_):null;if(typeof _=="number"&&!w)return null;const R=v(C),O=C.props.offsetParent||R.offsetParent||R.ownerDocument.body;return(0,e.offsetXYFromParent)(w||b,O,C.props.scale)}function f(b,_,C){const w=!(0,t.isNum)(b.lastX),R=v(b);return w?{node:R,deltaX:0,deltaY:0,lastX:_,lastY:C,x:_,y:C}:{node:R,deltaX:_-b.lastX,deltaY:C-b.lastY,lastX:b.lastX,lastY:b.lastY,x:_,y:C}}function p(b,_){const C=b.props.scale;return{node:_.node,x:b.state.x+_.deltaX/C,y:b.state.y+_.deltaY/C,deltaX:_.deltaX/C,deltaY:_.deltaY/C,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 v(b){const _=b.findDOMNode();if(!_)throw new Error("<DraggableCore>: Unmounted during event!");return _}return ol}var Zp={},I0={},J3;function c8(){if(J3)return I0;J3=1,Object.defineProperty(I0,"__esModule",{value:!0}),I0.default=t;function t(){}return I0}var I3;function EM(){if(I3)return Zp;I3=1,Object.defineProperty(Zp,"__esModule",{value:!0}),Zp.default=void 0;var t=p(pl()),e=f($1()),n=f(Pb()),s=jv(),i=o8(),o=ey(),d=f(c8());function f(R){return R&&R.__esModule?R:{default:R}}function p(R,O){if(typeof WeakMap=="function")var T=new WeakMap,M=new WeakMap;return(p=function(z,k){if(!k&&z&&z.__esModule)return z;var P,H,L={__proto__:null,default:z};if(z===null||typeof z!="object"&&typeof z!="function")return L;if(P=k?M:T){if(P.has(z))return P.get(z);P.set(z,L)}for(const U in z)U!=="default"&&{}.hasOwnProperty.call(z,U)&&((H=(P=Object.defineProperty)&&Object.getOwnPropertyDescriptor(z,U))&&(H.get||H.set)?P(L,U,H):L[U]=z[U]);return L})(R,O)}function y(R,O,T){return(O=v(O))in R?Object.defineProperty(R,O,{value:T,enumerable:!0,configurable:!0,writable:!0}):R[O]=T,R}function v(R){var O=b(R,"string");return typeof O=="symbol"?O:O+""}function b(R,O){if(typeof R!="object"||!R)return R;var T=R[Symbol.toPrimitive];if(T!==void 0){var M=T.call(R,O);if(typeof M!="object")return M;throw new TypeError("@@toPrimitive must return a primitive value.")}return(O==="string"?String:Number)(R)}const _={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let C=_.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 T=this.findDOMNode();if(!T||!T.ownerDocument||!T.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:M}=T;if(this.props.disabled||!(O.target instanceof M.defaultView.Node)||this.props.handle&&!(0,s.matchesSelectorAndParentsTo)(O.target,this.props.handle,T)||this.props.cancel&&(0,s.matchesSelectorAndParentsTo)(O.target,this.props.cancel,T))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:P,y:H}=k,L=(0,i.createCoreData)(this,P,H);(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=P,this.lastY=H,(0,s.addEvent)(M,C.move,this.handleDrag),(0,s.addEvent)(M,C.stop,this.handleDragStop))}),y(this,"handleDrag",O=>{const T=(0,i.getControlPosition)(O,this.touchIdentifier,this);if(T==null)return;let{x:M,y:z}=T;if(Array.isArray(this.props.grid)){let H=M-this.lastX,L=z-this.lastY;if([H,L]=(0,i.snapToGrid)(this.props.grid,H,L),!H&&!L)return;M=this.lastX+H,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 T=(0,i.getControlPosition)(O,this.touchIdentifier,this);if(T==null)return;let{x:M,y:z}=T;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 H=this.findDOMNode();H&&this.props.enableUserSelectHack&&(0,s.scheduleRemoveUserSelectStyles)(H.ownerDocument),(0,d.default)("DraggableCore: handleDragStop: %j",k),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,H&&((0,d.default)("DraggableCore: Removing handlers"),(0,s.removeEvent)(H.ownerDocument,C.move,this.handleDrag),(0,s.removeEvent)(H.ownerDocument,C.stop,this.handleDragStop))}),y(this,"onMouseDown",O=>(C=_.mouse,this.handleDragStart(O))),y(this,"onMouseUp",O=>(C=_.mouse,this.handleDragStop(O))),y(this,"onTouchStart",O=>(C=_.touch,this.handleDragStart(O))),y(this,"onTouchEnd",O=>(C=_.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:T}=O;(0,s.removeEvent)(T,_.mouse.move,this.handleDrag),(0,s.removeEvent)(T,_.touch.move,this.handleDrag),(0,s.removeEvent)(T,_.mouse.stop,this.handleDragStop),(0,s.removeEvent)(T,_.touch.stop,this.handleDragStop),(0,s.removeEvent)(O,_.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,s.scheduleRemoveUserSelectStyles)(T)}}findDOMNode(){var O,T,M;return(O=this.props)!=null&&O.nodeRef?(M=(T=this.props)==null?void 0:T.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 Zp.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(R,O){if(R[O]&&R[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}),Zp}var W3;function TM(){return W3||(W3=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(pl()),n=v($1()),s=v(Pb()),i=CM(),o=jv(),d=o8(),f=ey(),p=v(EM()),y=v(c8());function v(T){return T&&T.__esModule?T:{default:T}}function b(T,M){if(typeof WeakMap=="function")var z=new WeakMap,k=new WeakMap;return(b=function(P,H){if(!H&&P&&P.__esModule)return P;var L,U,V={__proto__:null,default:P};if(P===null||typeof P!="object"&&typeof P!="function")return V;if(L=H?k:z){if(L.has(P))return L.get(P);L.set(P,V)}for(const F in P)F!=="default"&&{}.hasOwnProperty.call(P,F)&&((U=(L=Object.defineProperty)&&Object.getOwnPropertyDescriptor(P,F))&&(U.get||U.set)?L(V,F,U):V[F]=P[F]);return V})(T,M)}function _(){return _=Object.assign?Object.assign.bind():function(T){for(var M=1;M<arguments.length;M++){var z=arguments[M];for(var k in z)({}).hasOwnProperty.call(z,k)&&(T[k]=z[k])}return T},_.apply(null,arguments)}function C(T,M,z){return(M=w(M))in T?Object.defineProperty(T,M,{value:z,enumerable:!0,configurable:!0,writable:!0}):T[M]=z,T}function w(T){var M=R(T,"string");return typeof M=="symbol"?M:M+""}function R(T,M){if(typeof T!="object"||!T)return T;var z=T[Symbol.toPrimitive];if(z!==void 0){var k=z.call(T,M);if(typeof k!="object")return k;throw new TypeError("@@toPrimitive must return a primitive value.")}return(M==="string"?String:Number)(T)}class O extends e.Component{static getDerivedStateFromProps(M,z){let{position:k}=M,{prevPropsPosition:P}=z;return k&&(!P||k.x!==P.x||k.y!==P.y)?((0,y.default)("Draggable: getDerivedStateFromProps %j",{position:k,prevPropsPosition:P}),{x:k.x,y:k.y,prevPropsPosition:{...k}}):null}constructor(M){super(M),C(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})}),C(this,"onDrag",(z,k)=>{if(!this.state.dragging)return!1;(0,y.default)("Draggable: onDrag: %j",k);const P=(0,d.createDraggableData)(this,k),H={x:P.x,y:P.y,slackX:0,slackY:0};if(this.props.bounds){const{x:U,y:V}=H;H.x+=this.state.slackX,H.y+=this.state.slackY;const[F,re]=(0,d.getBoundPosition)(this,H.x,H.y);H.x=F,H.y=re,H.slackX=this.state.slackX+(U-H.x),H.slackY=this.state.slackY+(V-H.y),P.x=H.x,P.y=H.y,P.deltaX=H.x-this.state.x,P.deltaY=H.y-this.state.y}if(this.props.onDrag(z,P)===!1)return!1;this.setState(H)}),C(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 H={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:U,y:V}=this.props.position;H.x=U,H.y=V}this.setState(H)}),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:P,defaultClassName:H,defaultClassNameDragging:L,defaultClassNameDragged:U,position:V,positionOffset:F,scale:re,...ne}=this.props;let I={},ie=null;const Y=!!!V||this.state.dragging,$=V||P,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,F):I=(0,o.createCSSTransform)(ae,F);const je=(0,i.clsx)(k.props.className||"",H,{[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:je,style:{...k.props.style,...I},transform:ie}))}}t.default=O,C(O,"displayName","Draggable"),C(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}),C(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})})(fx)),fx}var $3;function Cv(){if($3)return Fp.exports;$3=1;const{default:t,DraggableCore:e}=TM();return Fp.exports=t,Fp.exports.default=t,Fp.exports.DraggableCore=e,Fp.exports}var RM=Cv(),Jp={exports:{}},Ip={},W0={},e5;function OM(){if(e5)return W0;e5=1,W0.__esModule=!0,W0.cloneElement=f;var t=e(pl());function e(p){return p&&p.__esModule?p:{default:p}}function n(p,y){var v=Object.keys(p);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(p);y&&(b=b.filter(function(_){return Object.getOwnPropertyDescriptor(p,_).enumerable})),v.push.apply(v,b)}return v}function s(p){for(var y=1;y<arguments.length;y++){var v=arguments[y]!=null?arguments[y]:{};y%2?n(Object(v),!0).forEach(function(b){i(p,b,v[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(v)):n(Object(v)).forEach(function(b){Object.defineProperty(p,b,Object.getOwnPropertyDescriptor(v,b))})}return p}function i(p,y,v){return(y=o(y))in p?Object.defineProperty(p,y,{value:v,enumerable:!0,configurable:!0,writable:!0}):p[y]=v,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 v=p[Symbol.toPrimitive];if(v!==void 0){var b=v.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 W0}var Wp={},t5;function u8(){if(t5)return Wp;t5=1,Wp.__esModule=!0,Wp.resizableProps=void 0;var t=e($1());Cv();function e(n){return n&&n.__esModule?n:{default:n}}return Wp.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)}},Wp}var n5;function d8(){if(n5)return Ip;n5=1,Ip.__esModule=!0,Ip.default=void 0;var t=o(pl()),e=Cv(),n=OM(),s=u8();const i=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function o(R,O){if(typeof WeakMap=="function")var T=new WeakMap,M=new WeakMap;return(o=function(z,k){if(!k&&z&&z.__esModule)return z;var P,H,L={__proto__:null,default:z};if(z===null||typeof z!="object"&&typeof z!="function")return L;if(P=k?M:T){if(P.has(z))return P.get(z);P.set(z,L)}for(const U in z)U!=="default"&&{}.hasOwnProperty.call(z,U)&&((H=(P=Object.defineProperty)&&Object.getOwnPropertyDescriptor(z,U))&&(H.get||H.set)?P(L,U,H):L[U]=z[U]);return L})(R,O)}function d(){return d=Object.assign?Object.assign.bind():function(R){for(var O=1;O<arguments.length;O++){var T=arguments[O];for(var M in T)({}).hasOwnProperty.call(T,M)&&(R[M]=T[M])}return R},d.apply(null,arguments)}function f(R,O){if(R==null)return{};var T,M,z=p(R,O);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(R);for(M=0;M<k.length;M++)T=k[M],O.indexOf(T)===-1&&{}.propertyIsEnumerable.call(R,T)&&(z[T]=R[T])}return z}function p(R,O){if(R==null)return{};var T={};for(var M in R)if({}.hasOwnProperty.call(R,M)){if(O.indexOf(M)!==-1)continue;T[M]=R[M]}return T}function y(R,O){var T=Object.keys(R);if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(R);O&&(M=M.filter(function(z){return Object.getOwnPropertyDescriptor(R,z).enumerable})),T.push.apply(T,M)}return T}function v(R){for(var O=1;O<arguments.length;O++){var T=arguments[O]!=null?arguments[O]:{};O%2?y(Object(T),!0).forEach(function(M){b(R,M,T[M])}):Object.getOwnPropertyDescriptors?Object.defineProperties(R,Object.getOwnPropertyDescriptors(T)):y(Object(T)).forEach(function(M){Object.defineProperty(R,M,Object.getOwnPropertyDescriptor(T,M))})}return R}function b(R,O,T){return(O=_(O))in R?Object.defineProperty(R,O,{value:T,enumerable:!0,configurable:!0,writable:!0}):R[O]=T,R}function _(R){var O=C(R,"string");return typeof O=="symbol"?O:O+""}function C(R,O){if(typeof R!="object"||!R)return R;var T=R[Symbol.toPrimitive];if(T!==void 0){var M=T.call(R,O);if(typeof M!="object")return M;throw new TypeError("@@toPrimitive must return a primitive value.")}return(O==="string"?String:Number)(R)}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,T){const{minConstraints:M,maxConstraints:z,lockAspectRatio:k}=this.props;if(!M&&!z&&!k)return[O,T];if(k){const V=this.props.width/this.props.height,F=O-this.props.width,re=T-this.props.height;Math.abs(F)>Math.abs(re*V)?T=O/V:O=T*V}const[P,H]=[O,T];let[L,U]=this.slack||[0,0];return O+=L,T+=U,M&&(O=Math.max(M[0],O),T=Math.max(M[1],T)),z&&(O=Math.min(z[0],O),T=Math.min(z[1],T)),this.slack=[L+(P-O),U+(H-T)],[O,T]}resizeHandler(O,T){return(M,z)=>{var $;let{node:k,deltaX:P,deltaY:H}=z;O==="onResizeStart"&&this.resetData();const L=(this.props.axis==="both"||this.props.axis==="x")&&T!=="n"&&T!=="s",U=(this.props.axis==="both"||this.props.axis==="y")&&T!=="e"&&T!=="w";if(!L&&!U)return;const V=T[0],F=T[T.length-1],re=k.getBoundingClientRect();if(this.lastHandleRect!=null){if(F==="w"){const ae=re.left-this.lastHandleRect.left;P+=ae}if(V==="n"){const ae=re.top-this.lastHandleRect.top;H+=ae}}this.lastHandleRect=re,F==="w"&&(P=-P),V==="n"&&(H=-H);let ne=this.props.width+(L?P/this.props.transformScale:0),I=this.props.height+(U?H/this.props.transformScale:0);[ne,I]=this.runConstraints(ne,I),O==="onResizeStop"&&this.lastSize&&({width:ne,height:I}=this.lastSize);const ie=ne!==this.props.width||I!==this.props.height;O!=="onResizeStop"&&(this.lastSize={width:ne,height:I});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:I},handle:T})),O==="onResizeStop"&&this.resetData()}}renderResizeHandle(O,T){const{handle:M}=this.props;if(!M)return t.createElement("span",{className:`react-resizable-handle react-resizable-handle-${O}`,ref:T});if(typeof M=="function")return M(O,T);const z=typeof M.type=="string",k=v({ref:T},z?{}:{handleAxis:O});return t.cloneElement(M,k)}render(){const O=this.props,{children:T,className:M,draggableOpts:z,width:k,height:P,handle:H,handleSize:L,lockAspectRatio:U,axis:V,minConstraints:F,maxConstraints:re,onResize:ne,onResizeStop:I,onResizeStart:ie,resizeHandles:ce,transformScale:Y}=O,$=f(O,i);return(0,n.cloneElement)(T,v(v({},$),{},{className:`${M?`${M} `:""}react-resizable`,children:[...t.Children.toArray(T.props.children),...ce.map(ae=>{const je=this.handleRefs[ae]??(this.handleRefs[ae]=t.createRef());return t.createElement(e.DraggableCore,d({},z,{nodeRef:je,key:`resizableHandle-${ae}`,onStop:this.resizeHandler("onResizeStop",ae),onStart:this.resizeHandler("onResizeStart",ae),onDrag:this.resizeHandler("onResize",ae)}),this.renderResizeHandle(ae,je))})]}))}};return Ip.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},Ip}var $p={},a5;function MM(){if(a5)return $p;a5=1,$p.__esModule=!0,$p.default=void 0;var t=d(pl()),e=o($1()),n=o(d8()),s=u8();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,T){if(typeof WeakMap=="function")var M=new WeakMap,z=new WeakMap;return(d=function(k,P){if(!P&&k&&k.__esModule)return k;var H,L,U={__proto__:null,default:k};if(k===null||typeof k!="object"&&typeof k!="function")return U;if(H=P?z:M){if(H.has(k))return H.get(k);H.set(k,U)}for(const V in k)V!=="default"&&{}.hasOwnProperty.call(k,V)&&((L=(H=Object.defineProperty)&&Object.getOwnPropertyDescriptor(k,V))&&(L.get||L.set)?H(U,V,L):U[V]=k[V]);return U})(O,T)}function f(){return f=Object.assign?Object.assign.bind():function(O){for(var T=1;T<arguments.length;T++){var M=arguments[T];for(var z in M)({}).hasOwnProperty.call(M,z)&&(O[z]=M[z])}return O},f.apply(null,arguments)}function p(O,T){var M=Object.keys(O);if(Object.getOwnPropertySymbols){var z=Object.getOwnPropertySymbols(O);T&&(z=z.filter(function(k){return Object.getOwnPropertyDescriptor(O,k).enumerable})),M.push.apply(M,z)}return M}function y(O){for(var T=1;T<arguments.length;T++){var M=arguments[T]!=null?arguments[T]:{};T%2?p(Object(M),!0).forEach(function(z){v(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 v(O,T,M){return(T=b(T))in O?Object.defineProperty(O,T,{value:M,enumerable:!0,configurable:!0,writable:!0}):O[T]=M,O}function b(O){var T=_(O,"string");return typeof T=="symbol"?T:T+""}function _(O,T){if(typeof O!="object"||!O)return O;var M=O[Symbol.toPrimitive];if(M!==void 0){var z=M.call(O,T);if(typeof z!="object")return z;throw new TypeError("@@toPrimitive must return a primitive value.")}return(T==="string"?String:Number)(O)}function C(O,T){if(O==null)return{};var M,z,k=w(O,T);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(O);for(z=0;z<P.length;z++)M=P[z],T.indexOf(M)===-1&&{}.propertyIsEnumerable.call(O,M)&&(k[M]=O[M])}return k}function w(O,T){if(O==null)return{};var M={};for(var z in O)if({}.hasOwnProperty.call(O,z)){if(T.indexOf(z)!==-1)continue;M[z]=O[z]}return M}let R=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=(T,M)=>{var k;const{size:z}=M;this.props.onResize?((k=T.persist)==null||k.call(T),this.setState(z,()=>this.props.onResize&&this.props.onResize(T,M))):this.setState(z)}}static getDerivedStateFromProps(T,M){return M.propsWidth!==T.width||M.propsHeight!==T.height?{width:T.width,height:T.height,propsWidth:T.width,propsHeight:T.height}:null}render(){const T=this.props,{handle:M,handleSize:z,onResize:k,onResizeStart:P,onResizeStop:H,draggableOpts:L,minConstraints:U,maxConstraints:V,lockAspectRatio:F,axis:re,width:ne,height:I,resizeHandles:ie,style:ce,transformScale:Y}=T,$=C(T,i);return t.createElement(n.default,{axis:re,draggableOpts:L,handle:M,handleSize:z,height:this.state.height,lockAspectRatio:F,maxConstraints:V,minConstraints:U,onResizeStart:P,onResize:this.onResize,onResizeStop:H,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 $p.default=R,R.propTypes=y(y({},s.resizableProps),{},{children:e.default.element}),$p}var s5;function AM(){return s5||(s5=1,Jp.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Jp.exports.Resizable=d8().default,Jp.exports.ResizableBox=MM().default),Jp.exports}var DM=AM();function r5(t){const{children:e,cols:n,containerWidth:s,margin:i,containerPadding:o,rowHeight:d,maxRows:f,isDraggable:p,isResizable:y,isBounded:v,static:b,useCSSTransforms:_=!0,usePercentages:C=!1,transformScale:w=1,positionStrategy:R,dragThreshold:O=0,droppingPosition:T,className:M="",style:z,handle:k="",cancel:P="",x:H,y:L,w:U,h:V,minW:F=1,maxW:re=1/0,minH:ne=1,maxH:I=1/0,i:ie,resizeHandles:ce,resizeHandle:Y,constraints:$=Q6,layoutItem:ae,layout:je=[],onDragStart:he,onDrag:G,onDragStop:W,onResizeStart:fe,onResize:be,onResizeStop:_e}=t,[me,we]=D.useState(!1),[nt,ze]=D.useState(!1),Vt=D.useRef(null),$e=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(je);En.current=je;const Qn=D.useRef(null),Gt=D.useRef(null),fn=D.useRef(!1),ur=D.useRef({x:0,y:0}),Zt=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]),Jt=D.useMemo(()=>ae??{i:ie,x:H,y:L,w:U,h:V,minW:F,maxW:re,minH:ne,maxH:I},[ae,ie,H,L,U,V,F,re,ne,I]),Kn=D.useCallback(yt=>{if(R!=null&&R.calcStyle)return R.calcStyle(yt);if(_)return K6(yt);const mt=GO(yt);return C?{...mt,left:L3(yt.left/s),width:L3(yt.width/s)}:mt},[R,_,C,s]),Ss=D.useCallback((yt,{node:mt})=>{if(!he)return;const{offsetParent:Qt}=mt;if(!Qt)return;const At=Qt.getBoundingClientRect(),Hn=mt.getBoundingClientRect(),rn=Hn.left/w,Xn=At.left/w,yn=Hn.top/w,Ra=At.top/w;let oa;if(R!=null&&R.calcDragPosition){const et=yt;oa=R.calcDragPosition(et.clientX,et.clientY,et.clientX-Hn.left,et.clientY-Hn.top)}else oa={left:rn-Xn+Qt.scrollLeft,top:yn-Ra+Qt.scrollTop};if($e.current=oa,O>0){const et=yt;ur.current={x:et.clientX,y:et.clientY},fn.current=!0,Zt.current=!1,we(!0);return}we(!0);const ls=X0(Et,oa.top,oa.left),{x:Bs,y:Ue}=F0($,Jt,ls.x,ls.y,hn());he(ie,Bs,Ue,{e:yt,node:mt,newPosition:oa})},[he,w,Et,R,O,$,Jt,hn,ie]),dr=D.useCallback((yt,{node:mt,deltaX:Qt,deltaY:At})=>{if(!G||!me)return;const Hn=yt;if(fn.current&&!Zt.current){const Bs=Hn.clientX-ur.current.x,Ue=Hn.clientY-ur.current.y;if(Math.hypot(Bs,Ue)<O)return;if(Zt.current=!0,fn.current=!1,he){const Ve=X0(Et,$e.current.top,$e.current.left),{x:ct,y:xt}=F0($,Jt,Ve.x,Ve.y,hn());he(ie,ct,xt,{e:yt,node:mt,newPosition:$e.current})}}let rn=$e.current.top+At,Xn=$e.current.left+Qt;if(v){const{offsetParent:Bs}=mt;if(Bs){const Ue=Bs.clientHeight-eh(V,d,i[1]);rn=M1(rn,0,Ue);const et=uh(Et),Ve=s-eh(U,et,i[0]);Xn=M1(Xn,0,Ve)}}const yn={top:rn,left:Xn};$e.current=yn;const Ra=X0(Et,rn,Xn),{x:oa,y:ls}=F0($,Jt,Ra.x,Ra.y,hn());G(ie,oa,ls,{e:yt,node:mt,newPosition:yn})},[G,he,me,O,v,V,d,i,Et,s,U,ie,$,Jt,hn]),Qa=D.useCallback((yt,{node:mt})=>{if(!W||!me)return;const Qt=fn.current;if(fn.current=!1,Zt.current=!1,ur.current={x:0,y:0},Qt){we(!1),$e.current={left:0,top:0};return}const{left:At,top:Hn}=$e.current,rn={top:Hn,left:At};we(!1),$e.current={left:0,top:0};const Xn=X0(Et,Hn,At),{x:yn,y:Ra}=F0($,Jt,Xn.x,Xn.y,hn());W(ie,yn,Ra,{e:yt,node:mt,newPosition:rn})},[W,me,Et,$,Jt,hn,ie]);Qn.current=Ss,Gt.current=dr;const la=D.useCallback((yt,{node:mt,size:Qt,handle:At},Hn,rn)=>{const Xn=rn==="onResizeStart"?fe:rn==="onResize"?be:_e;if(!Xn)return;let yn;mt?yn=ZO(At,Hn,Qt,s):yn={...Qt,top:Hn.top,left:Hn.left},Mt.current=yn;const Ra=zO(Et,yn.width,yn.height),{w:oa,h:ls}=BO($,Jt,Ra.w,Ra.h,At,hn());Xn(ie,oa,ls,{e:yt.nativeEvent,node:mt,size:yn,handle:At})},[fe,be,_e,s,Et,ie,$,Jt,hn]),Ea=D.useCallback((yt,mt)=>{ze(!0);const Qt=Xp(Et,H,L,U,V),At={...mt,handle:mt.handle};la(yt,At,Qt,"onResizeStart")},[la,Et,H,L,U,V]),rs=D.useCallback((yt,mt)=>{const Qt=Xp(Et,H,L,U,V),At={...mt,handle:mt.handle};la(yt,At,Qt,"onResize")},[la,Et,H,L,U,V]),fr=D.useCallback((yt,mt)=>{ze(!1),Mt.current={top:0,left:0,width:0,height:0};const Qt=Xp(Et,H,L,U,V),At={...mt,handle:mt.handle};la(yt,At,Qt,"onResizeStop")},[la,Et,H,L,U,V]);D.useEffect(()=>{var At,Hn;if(!T)return;const yt=Vt.current;if(!yt)return;const mt=Ht.current||{left:0,top:0},Qt=me&&(T.left!==mt.left||T.top!==mt.top);if(me){if(Qt){const rn=T.left-$e.current.left,Xn=T.top-$e.current.top,yn={node:yt,deltaX:rn,deltaY:Xn,lastX:$e.current.left,lastY:$e.current.top,x:T.left,y:T.top};(Hn=Gt.current)==null||Hn.call(Gt,T.e,yn)}}else{const rn={node:yt,deltaX:T.left,deltaY:T.top,lastX:0,lastY:0,x:T.left,y:T.top};(At=Qn.current)==null||At.call(Qn,T.e,rn)}Ht.current=T},[T,me,ie]);const Ns=Xp(Et,H,L,U,V,me?$e.current:null,nt?Mt.current:null),Hs=en.Children.only(e),ea=Xp(Et,0,0,1,1),is=[ea.width,ea.height],ba=[1/0,1/0],Ta=Hs.props,Pc=Ta.className,Sl=Ta.style;let _s=en.cloneElement(Hs,{ref:Vt,className:P1("react-grid-item",Pc,M,{static:b,resizing:nt,"react-draggable":p,"react-draggable-dragging":me,dropping:!!T,cssTransforms:_}),style:{...z,...Sl,...Kn(Ns)}});const hr=Y;return _s=h.jsx(DM.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(RM.DraggableCore,{disabled:!p,onStart:Ss,onDrag:dr,onStop:Qa,handle:k,cancel:".react-resizable-handle"+(P?","+P:""),scale:w,nodeRef:Vt,children:_s}),_s}var $l=()=>{},i5="react-grid-layout",f8=!1;try{f8=/firefox/i.test(navigator.userAgent)}catch{}function zM(t,e){const n=en.Children.toArray(t),s=en.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 l5(t,e,n,s){const i=[],o=new Set;en.Children.forEach(e,f=>{if(!en.isValidElement(f)||f.key===null)return;const p=String(f.key);o.add(p);const y=t.find(v=>v.i===p);if(y)i.push(Iu(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:F1(i),w:1,h:1})}});const d=yv(i,{cols:n});return s.compact(d,n)}function kM(t){const{children:e,width:n,gridConfig:s,dragConfig:i,resizeConfig:o,dropConfig:d,positionStrategy:f=IO,compactor:p,constraints:y=Q6,layout:v=[],droppingItem:b,autoSize:_=!0,className:C="",style:w={},innerRef:R,onLayoutChange:O=$l,onDragStart:T=$l,onDrag:M=$l,onDragStop:z=$l,onResizeStart:k=$l,onResize:P=$l,onResizeStop:H=$l,onDrop:L=$l,onDropDragOver:U=$l}=t,V=D.useMemo(()=>({...WO,...s}),[s]),F=D.useMemo(()=>({...$O,...i}),[i]),re=D.useMemo(()=>({...eM,...o}),[o]),ne=D.useMemo(()=>({...tM,...d}),[d]),{cols:I,rowHeight:ie,maxRows:ce,margin:Y,containerPadding:$}=V,{enabled:ae,bounded:je,handle:he,cancel:G,threshold:W}=F,{enabled:fe,handles:be,handleComponent:_e}=re,{enabled:me,defaultItem:we,onDragOver:nt}=ne,ze=p??_v("vertical"),Vt=ze.type,$e=ze.allowOverlap,Mt=ze.preventCollision??!1,Ht=D.useMemo(()=>b??{i:"__dropping-elem__",...we},[b,we]),En=f.type==="transform",Qn=f.scale,Gt=$??Y,[fn,ur]=D.useState(!1),[Zt,Et]=D.useState(()=>l5(v,e,I,ze)),[qn,hn]=D.useState(null),[Jt,Kn]=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(Zt),ea=D.useRef(v),is=D.useRef(e),ba=D.useRef(Vt),Ta=D.useRef(Zt);Ta.current=Zt,D.useEffect(()=>{ur(!0),so(Zt,v)||O(Zt)},[]),D.useEffect(()=>{if(qn||Ss)return;const Ue=!so(v,ea.current),et=!zM(e,is.current),Ve=Vt!==ba.current;if(Ue||et||Ve){const xt=l5(Ue?v:Zt,e,I,ze);so(xt,Zt)||Et(xt)}ea.current=v,is.current=e,ba.current=Vt},[v,e,I,Vt,ze,qn,Ss,Zt]),D.useEffect(()=>{if(!qn&&!so(Zt,Hs.current)){Hs.current=Zt;const Ue=Zt.filter(et=>et.i!==Ht.i);O(Ue)}},[Zt,qn,O,Ht.i]);const Pc=D.useMemo(()=>{if(!_)return;const Ue=F1(Zt),et=Gt[1];return Ue*ie+(Ue-1)*Y[1]+et*2+"px"},[_,Zt,ie,Y,Gt]),Sl=D.useCallback((Ue,et,Ve,ct)=>{const xt=Ta.current,Fe=Lu(xt,Ue);if(!Fe)return;const ut={w:Fe.w,h:Fe.h,x:Fe.x,y:Fe.y,i:Ue};Ea.current=Iu(Fe),fr.current=xt,hn(ut),T(xt,Fe,Fe,null,ct.e,ct.node)},[T]),_s=D.useCallback((Ue,et,Ve,ct)=>{const xt=Ta.current,Fe=Ea.current,ut=Lu(xt,Ue);if(!ut)return;const sn={w:ut.w,h:ut.h,x:ut.x,y:ut.y,i:Ue},Tt=Uu(xt,ut,et,Ve,!0,Mt,Vt,I,$e);M(Tt,Fe,ut,sn,ct.e,ct.node),Et(ze.compact(Tt,I)),hn(sn)},[Mt,Vt,I,$e,ze,M]),hr=D.useCallback((Ue,et,Ve,ct)=>{if(!qn)return;const xt=Ta.current,Fe=Ea.current,ut=Lu(xt,Ue);if(!ut)return;const sn=Uu(xt,ut,et,Ve,!0,Mt,Vt,I,$e),Tt=ze.compact(sn,I);z(Tt,Fe,ut,null,ct.e,ct.node);const pn=fr.current;Ea.current=null,fr.current=null,hn(null),Et(Tt),pn&&!so(pn,Tt)&&O(Tt)},[qn,Mt,Vt,I,$e,ze,z,O]),yt=D.useCallback((Ue,et,Ve,ct)=>{const xt=Ta.current,Fe=Lu(xt,Ue);Fe&&(rs.current=Iu(Fe),fr.current=xt,Kn(!0),k(xt,Fe,Fe,null,ct.e,ct.node))},[k]),mt=D.useCallback((Ue,et,Ve,ct)=>{const xt=Ta.current,Fe=rs.current,{handle:ut}=ct;let sn=!1,Tt,pn;const[Rr,os]=UO(xt,Ue,Pt=>(Tt=Pt.x,pn=Pt.y,["sw","w","nw","n","ne"].includes(ut)&&(["sw","nw","w"].includes(ut)&&(Tt=Pt.x+(Pt.w-et),et=Pt.x!==Tt&&Tt<0?Pt.w:et,Tt=Tt<0?0:Tt),["ne","n","nw"].includes(ut)&&(pn=Pt.y+(Pt.h-Ve),Ve=Pt.y!==pn&&pn<0?Pt.h:Ve,pn=pn<0?0:pn),sn=!0),Mt&&!$e&&Y6(xt,{...Pt,w:et,h:Ve,x:Tt??Pt.x,y:pn??Pt.y}).filter(mr=>mr.i!==Pt.i).length>0&&(pn=Pt.y,Ve=Pt.h,Tt=Pt.x,et=Pt.w,sn=!1),Pt.w=et,Pt.h=Ve,Pt));if(!os)return;let Ka=Rr;sn&&Tt!==void 0&&pn!==void 0&&(Ka=Uu(Rr,os,Tt,pn,!0,Mt,Vt,I,$e));const Gs={w:os.w,h:os.h,x:os.x,y:os.y,i:Ue,static:!0};P(Ka,Fe,os,Gs,ct.e,ct.node),Et(ze.compact(Ka,I)),hn(Gs)},[Mt,Vt,I,$e,ze,P]),Qt=D.useCallback((Ue,et,Ve,ct)=>{const xt=Ta.current,Fe=rs.current,ut=Lu(xt,Ue),sn=ze.compact(xt,I);H(sn,Fe,ut??null,null,ct.e,ct.node);const Tt=fr.current;rs.current=null,fr.current=null,hn(null),Kn(!1),Et(sn),Tt&&!so(Tt,sn)&&O(sn)},[I,ze,H,O]),At=D.useCallback(()=>{const Ue=Ta.current;if(!Ue.some(ct=>ct.i===Ht.i)){dr(null),hn(null),la(void 0);return}const Ve=ze.compact(Ue.filter(ct=>ct.i!==Ht.i),I);Et(Ve),dr(null),hn(null),la(void 0)},[Ht.i,I,ze]),Hn=D.useCallback(Ue=>{var Tn;if(Ue.preventDefault(),Ue.stopPropagation(),f8&&!((Tn=Ue.nativeEvent.target)!=null&&Tn.classList.contains(i5)))return!1;const et=nt?nt(Ue.nativeEvent):U(Ue);if(et===!1)return Ss&&At(),!1;const{dragOffsetX:Ve=0,dragOffsetY:ct=0,...xt}=et??{},Fe={...Ht,...xt},ut=Ue.currentTarget.getBoundingClientRect(),sn={cols:I,margin:Y,maxRows:ce,rowHeight:ie,containerWidth:n,containerPadding:Gt},Tt=uh(sn),pn=eh(Fe.w,Tt,Y[0]),Rr=eh(Fe.h,ie,Y[1]),os=pn/2,Ka=Rr/2,Gs=Ue.clientX-ut.left+Ve-os,Pt=Ue.clientY-ut.top+ct-Ka,pr=Math.max(0,Gs),mr=Math.max(0,Pt),js={left:pr/Qn,top:mr/Qn,e:Ue.nativeEvent};if(Ss)Qa&&(Qa.left!==js.left||Qa.top!==js.top)&&la(js);else{const Cs=DO(sn,mr,pr,Fe.w,Fe.h);dr(h.jsx("div",{},Fe.i)),la(js),Et([...Ta.current,{...Fe,x:Cs.x,y:Cs.y,static:!1,isDraggable:!0}])}},[Ss,Qa,Ht,nt,U,At,Qn,I,Y,ce,ie,n,Gt]),rn=D.useCallback(Ue=>{Ue.preventDefault(),Ue.stopPropagation(),Ns.current--,Ns.current<0&&(Ns.current=0),Ns.current===0&&At()},[At]),Xn=D.useCallback(Ue=>{Ue.preventDefault(),Ue.stopPropagation(),Ns.current++},[]),yn=D.useCallback(Ue=>{Ue.preventDefault(),Ue.stopPropagation();const et=Ta.current,Ve=et.find(ct=>ct.i===Ht.i);Ns.current=0,At(),L(et,Ve,Ue.nativeEvent)},[Ht.i,At,L]),Ra=D.useCallback((Ue,et)=>{if(!Ue||!Ue.key)return null;const Ve=Lu(Zt,String(Ue.key));if(!Ve)return null;const ct=typeof Ve.isDraggable=="boolean"?Ve.isDraggable:!Ve.static&&ae,xt=typeof Ve.isResizable=="boolean"?Ve.isResizable:!Ve.static&&fe,Fe=Ve.resizeHandles||[...be],ut=ct&&je&&Ve.isBounded!==!1,sn=_e;return h.jsx(r5,{containerWidth:n,cols:I,margin:Y,containerPadding:Gt,maxRows:ce,rowHeight:ie,cancel:G,handle:he,onDragStart:Sl,onDrag:_s,onDragStop:hr,onResizeStart:yt,onResize:mt,onResizeStop:Qt,isDraggable:ct,isResizable:xt,isBounded:ut,useCSSTransforms:En&&fn,usePercentages:!fn,transformScale:Qn,positionStrategy:f,dragThreshold:W,w:Ve.w,h:Ve.h,x:Ve.x,y:Ve.y,i:Ve.i,minH:Ve.minH,minW:Ve.minW,maxH:Ve.maxH,maxW:Ve.maxW,static:Ve.static,droppingPosition:et?Qa:void 0,resizeHandles:Fe,resizeHandle:sn,constraints:y,layoutItem:Ve,layout:Zt,children:Ue},Ve.i)},[Zt,n,I,Y,Gt,ce,ie,G,he,Sl,_s,hr,yt,mt,Qt,ae,fe,je,En,fn,Qn,f,W,Qa,be,_e,y]),oa=()=>qn?h.jsx(r5,{w:qn.w,h:qn.h,x:qn.x,y:qn.y,i:qn.i,className:`react-grid-placeholder ${Jt?"placeholder-resizing":""}`,containerWidth:n,cols:I,margin:Y,containerPadding:Gt,maxRows:ce,rowHeight:ie,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:En,transformScale:Qn,constraints:y,layout:Zt,children:h.jsx("div",{})}):null,ls=P1(i5,C),Bs={height:Pc,...w};return h.jsxs("div",{ref:R,className:ls,style:Bs,onDrop:me?yn:void 0,onDragLeave:me?rn:void 0,onDragEnter:me?Xn:void 0,onDragOver:me?Hn:void 0,children:[en.Children.map(e,Ue=>en.isValidElement(Ue)?Ra(Ue):null),me&&Ss&&Ra(Ss,!0),oa()]})}var LM={lg:1200,md:996,sm:768,xs:480,xxs:0},UM={lg:12,md:10,sm:6,xs:4,xxs:2},gx=()=>{};function qM(t,e,n,s){const i=[];en.Children.forEach(e,d=>{if(!en.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 v=d.props["data-grid"];v?i.push({i:f,x:v.x??0,y:v.y??0,w:v.w??1,h:v.h??1,minW:v.minW,maxW:v.maxW,minH:v.minH,maxH:v.maxH,static:v.static,isDraggable:v.isDraggable,isResizable:v.isResizable,resizeHandles:v.resizeHandles,isBounded:v.isBounded}):i.push({i:f,x:0,y:F1(i),w:1,h:1})}});const o=yv(i,{cols:n});return s.compact(o,n)}function HM(t){const{children:e,width:n,breakpoint:s,breakpoints:i=LM,cols:o=UM,layouts:d={},rowHeight:f=150,maxRows:p=1/0,margin:y=[10,10],containerPadding:v=null,compactor:b,onBreakpointChange:_=gx,onLayoutChange:C=gx,onWidthChange:w=gx,...R}=t,O=b??_v("vertical"),T=O.type,M=O.allowOverlap,z=D.useMemo(()=>s??U3(i,n),[]),k=D.useMemo(()=>q3(z,o),[z,o]),P=D.useMemo(()=>dx(d,i,z,z,k,T),[]),[H,L]=D.useState(z),[U,V]=D.useState(k),[F,re]=D.useState(P),[ne,I]=D.useState(d),ie=D.useRef(n),ce=D.useRef(s),Y=D.useRef(i),$=D.useRef(o),ae=D.useRef(d),je=D.useRef(T),he=D.useRef(ne);D.useEffect(()=>{he.current=ne},[ne]);const G=D.useMemo(()=>so(d,ae.current)?null:dx(d,i,H,H,U,O),[d,i,H,U,O]),W=G??F;D.useEffect(()=>{G!==null&&(re(G),I(d),he.current=d,ae.current=d)},[G,d]),D.useEffect(()=>{if(T!==je.current){const we=O.compact(zc(W),U),nt={...he.current,[H]:we};re(we),I(nt),he.current=nt,C(we,nt),je.current=T}},[T,O,W,U,M,H,C]),D.useEffect(()=>{const we=n!==ie.current,nt=s!==ce.current,ze=!so(i,Y.current),Vt=!so(o,$.current);if(we||nt||ze||Vt){const $e=s??U3(i,n),Mt=q3($e,o),Ht=H;if(Ht!==$e||ze||Vt){const Gt={...he.current};Gt[Ht]||(Gt[Ht]=zc(F));let fn=dx(Gt,i,$e,Ht,Mt,O);fn=qM(fn,e,Mt,O),Gt[$e]=fn,L($e),V(Mt),re(fn),I(Gt),he.current=Gt,_($e,Mt),C(fn,Gt)}const En=Z0(y,$e),Qn=v?Z0(v,$e):null;w(n,En,Mt,Qn),ie.current=n,ce.current=s,Y.current=i,$.current=o}},[n,s,i,o,H,U,F,e,O,T,M,y,v,_,C,w]);const fe=D.useCallback(we=>{const ze={...he.current,[H]:we};re(we),I(ze),he.current=ze,C(we,ze)},[H,C]),be=D.useMemo(()=>Z0(y,H),[y,H]),_e=D.useMemo(()=>v===null?null:Z0(v,H),[v,H]),me=D.useMemo(()=>({cols:U,rowHeight:f,maxRows:p,margin:be,containerPadding:_e}),[U,f,p,be,_e]);return h.jsx(kM,{...R,width:n,gridConfig:me,compactor:O,onLayoutChange:fe,layout:W,children:e})}function BM({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(NT,{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(Jm,{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(bl,{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 v;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:(v=y.options)==null?void 0:v.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 GM({open:t,onClose:e,onSelect:n}){if(!t)return null;const s=CO();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(bl,{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 PM=HM,h8="camstack-dashboard-state",YM={lg:1200,md:996,sm:768,xs:0},VM={lg:12,md:8,sm:4,xs:2};function QM(){try{const t=localStorage.getItem(h8);if(t)return JSON.parse(t)}catch{}return{items:[]}}function KM(t){localStorage.setItem(h8,JSON.stringify(t))}let o5=0;function XM(){const[t,e]=D.useState(QM),[n,s]=D.useState(!1),i=D.useCallback(v=>{e(v),KM(v)},[]),o=D.useCallback(v=>{var w;o5++;const b=`${v.id}-${o5}`,_={};(w=v.configSchema)==null||w.forEach(R=>{R.defaultValue!==void 0&&(_[R.key]=R.defaultValue)});const C={i:b,blockId:v.id,x:0,y:1/0,w:v.defaultSize.w,h:v.defaultSize.h,config:_};i({items:[...t.items,C]})},[t,i]),d=D.useCallback(v=>{i({items:t.items.filter(b=>b.i!==v)})},[t,i]),f=D.useCallback((v,b)=>{i({items:t.items.map(_=>_.i===v?{..._,config:b}:_)})},[t,i]),p=D.useCallback(v=>{i({items:t.items.map(b=>{const _=v.find(C=>C.i===b.i);return _?{...b,x:_.x,y:_.y,w:_.w,h:_.h}:b})})},[t,i]),y=t.items.map(v=>{var _,C;const b=z3(v.blockId);return{i:v.i,x:v.x,y:v.y,w:v.w,h:v.h,minW:((_=b==null?void 0:b.minSize)==null?void 0:_.w)??2,minH:((C=b==null?void 0:b.minSize)==null?void 0:C.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(T6,{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(PM,{layouts:{lg:y},breakpoints:YM,cols:VM,rowHeight:60,draggableHandle:".drag-handle",onLayoutChange:p,isResizable:!0,isDraggable:!0,children:t.items.map(v=>{const b=z3(v.blockId);return b?h.jsx("div",{children:h.jsx(BM,{block:b,config:v.config,size:{w:v.w,h:v.h},onRemove:()=>d(v.i),onConfigChange:_=>f(v.i,_)})},v.i):h.jsx("div",{},v.i)})}),h.jsx(GM,{open:n,onClose:()=>s(!1),onSelect:o})]})}function FM(){return h.jsx(XM,{})}const jb={frigate:{icon:PE,color:"#3b82f6",label:"Frigate"},scrypted:{icon:E1,color:"#a855f7",label:"Scrypted"},reolink:{icon:dv,color:"#06b6d4",label:"Reolink"},homeassistant:{icon:CT,color:"#22d3ee",label:"Home Assistant"},rtsp:{icon:p3,color:"#78716c",label:"RTSP"},onvif:{icon:p3,color:"#78716c",label:"ONVIF"}},ZM={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"},JM={sm:"h-7 w-7",md:"h-8 w-8",lg:"h-10 w-10"};function ty({type:t,size:e="md",showLabel:n}){const s=jb[t]??jb.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 ${JM[e]}`,style:{backgroundColor:`${s.color}15`},children:h.jsx(i,{className:ZM[e],style:{color:s.color}})}),n&&h.jsx("span",{className:"text-xs font-medium text-foreground-subtle",children:s.label})]})}function p8(t){var e;return((e=jb[t])==null?void 0:e.label)??t}const c5={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 th({status:t}){const e=c5[t]??c5.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 u5={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 IM({id:t,name:e,status:n,detectionsToday:s,inferenceMs:i}){const o=gl(),d=u5[n]??u5.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(ch,{className:"h-3 w-3"}),s," today"]}),h.jsxs("span",{className:"inline-flex items-center gap-1",children:[h.jsx(cv,{className:"h-3 w-3"}),i,"ms"]})]})]})]})}function WM({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(ty,{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||p8(t)}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle flex-shrink-0",children:[s.length," camera",s.length!==1?"s":""]})]}),h.jsx(th,{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(IM,{id:i.id,name:i.name,status:i.status,detectionsToday:0,inferenceMs:0},i.id))})]})}function $M(){const{t}=Er(),e=Ft(),[n,s]=D.useState(""),{data:i,isLoading:o}=ot({queryKey:["devices"],queryFn:()=>e.listDevices(),refetchInterval:5e3}),{data:d,isLoading:f}=ot({queryKey:["providers"],queryFn:()=>e.listProviders()}),p=i??[],y=d??[],v=D.useMemo(()=>{const C=n.toLowerCase();return p.filter(w=>{const R=(w.type??"").toLowerCase(),O=w.capabilities??[];return R==="camera"||R.includes("camera")||O.some(k=>k.toLowerCase().includes("video")||k.toLowerCase().includes("stream"))||!R||R==="—"?C?(w.name??w.id??"").toLowerCase().includes(C):!0:!1})},[p,n]),b=D.useMemo(()=>{const C=new Map;for(const w of v){const R=w.providerId??"";C.has(R)||C.set(R,[]),C.get(R).push(w)}return C},[v]),_=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(fv,{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:C=>s(C.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:[v.length," camera",v.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(C=>h.jsx("div",{className:"aspect-[16/12] rounded-lg border border-border bg-surface animate-pulse"},C))}),!_&&v.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(([C,w])=>{var O;const R=y.find(T=>T.id===C);return h.jsx(WM,{providerType:(R==null?void 0:R.type)??"rtsp",providerName:(R==null?void 0:R.name)??C,providerStatus:(O=R==null?void 0:R.status)!=null&&O.connected?"running":"stopped",devices:w.map(T=>{var M;return{id:T.id,name:T.name??T.id,status:(M=T.state)!=null&&M.online?"online":"offline"}})},C)})]})}function eA({onSelect:t,onClose:e}){const{t:n}=Er(),s=Ft(),i=gl(),{data:o,isLoading:d}=ot({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(Jm,{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 tA({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 nA(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 aA(t){return`${t.inputSize.width}x${t.inputSize.height}`}function sA(t){return t.formats?Object.keys(t.formats).filter(e=>t.formats[e]!==void 0):[]}function rA({entry:t,selected:e,onSelect:n,disabled:s}){const i=nA(t),o=aA(t),d=sA(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(Fm,{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 iA({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"),v=e==null?"":String(e);return h.jsxs("div",{className:"space-y-3",children:[f.length>1&&h.jsx(tA,{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(rA,{entry:b,selected:v===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(j1,{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:v,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(j1,{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(uT,{className:"h-3 w-3"})]})]})]})}const dh="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",m8="block text-xs font-medium text-foreground mb-1",lA="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:m8,children:[f,n&&h.jsx("span",{className:"text-danger ml-0.5",children:"*"})]}),i,p&&h.jsx("p",{className:lA,children:p})]})}function oA({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:dh,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 cA({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:dh,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 uA({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:m8+" 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 dA({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:dh,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 fA({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 hA({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:dh+(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(w6,{className:"h-3.5 w-3.5"}):h.jsx(ch,{className:"h-3.5 w-3.5"})})]})})}function pA({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:dh+" 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 mA({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 gA({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(C=>{const w=C.trim();!w||o.includes(w)||t.maxTags!==void 0&&o.length>=t.maxTags||(n([...o,w]),f(""))},[o,t.maxTags,n]),v=C=>n(o.filter(w=>w!==C)),b=C=>{C.key==="Enter"||C.key===","?(C.preventDefault(),y(d)):C.key==="Backspace"&&d===""&&o.length>0&&v(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 C;return!_&&((C=p.current)==null?void 0:C.focus())},children:[o.map(C=>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:[C,!_&&h.jsx("button",{type:"button",onClick:()=>v(C),className:"hover:text-danger",children:h.jsx(bl,{className:"h-2.5 w-2.5"})})]},C)),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:C=>f(C.target.value),onKeyDown:b,onBlur:()=>{d.trim()&&y(d)}}),t.suggestions&&h.jsx("datalist",{id:`tags-suggestions-${t.key}`,children:t.suggestions.map(C=>h.jsx("option",{value:C},C))})]})})}function yA({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:dh+" 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 xA({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(g8,{field:y,values:e,onChange:n,disabled:s,translationFn:i},y.key))})]})})}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.jsx(iA,{field:t,value:e,onChange:n,disabled:s})})}function vA({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 d5={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 SA({field:t}){const e=t.variant??"info",n=d5[e]??d5.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 g8({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(oA,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"number":return h.jsx(cA,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"boolean":return h.jsx(uA,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"select":return h.jsx(dA,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"multiselect":return h.jsx(fA,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"password":return h.jsx(hA,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"textarea":return h.jsx(pA,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"slider":return h.jsx(mA,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"tags":return h.jsx(gA,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"color":return h.jsx(yA,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"group":return h.jsx(xA,{field:t,values:e,onChange:n,disabled:s,translationFn:i});case"separator":return h.jsx(vA,{});case"info":return h.jsx(SA,{field:t});case"model-selector":return h.jsx(bA,{field:t,value:o,onChange:d,disabled:s,translationFn:i});default:return null}}function NA(t){return/^[a-zA-Z0-9_]+(\.[a-zA-Z0-9_]+)+$/.test(t)}function Wu(t,e){if(t!==void 0)return e&&NA(t)?e(t):t}function _A({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(v=>!v):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(v=>h.jsx(g8,{field:v,values:e,onChange:n,disabled:s,translationFn:i},v.key))})]})}function ny({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(_A,{section:d,values:e,onChange:o,disabled:s,translationFn:i},d.id))})}function jA({addonId:t,configSchema:e,onSave:n,onBack:s}){const{t:i}=Er(),o=Ft(),[d,f]=D.useState(""),[p,y]=D.useState({}),[v,b]=D.useState(null),_=Cn({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:C=>b(C),onError:C=>b({success:!1,error:String(C)})});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:C=>f(C.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(ny,{schema:e,values:p,onChange:y}),v&&h.jsx("div",{className:`rounded-lg border px-3 py-2 text-xs ${v.success?"border-success/30 bg-success/5 text-success":"border-danger/30 bg-danger/5 text-danger"}`,children:v.success?i("integrations.connectionSuccess"):`${i("integrations.errorPrefix")} ${v.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 CA({providerId:t,onImport:e,onSkip:n}){const{t:s}=Er(),i=Ft(),[o,d]=D.useState(new Set),{data:f,isLoading:p}=ot({queryKey:["discover-devices",t],queryFn:()=>i.discoverDevices(t)});function y(b){d(_=>{const C=new Set(_);return C.has(b)?C.delete(b):C.add(b),C})}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 v=f??[];return h.jsxs("div",{className:"space-y-4",children:[h.jsx("p",{className:"text-xs text-foreground-subtle",children:v.length>0?s("integrations.foundDevices",{count:v.length}):s("integrations.noDevicesFound")}),v.length>0&&h.jsx("div",{className:"space-y-1.5 max-h-64 overflow-y-auto",children:v.map(b=>{const _=b.externalId,C=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(Fm,{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:C})]},_)})}),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")}),v.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 wA({open:t,onClose:e}){const{t:n}=Er(),s=Ft(),i=gl(),o=ga(),[d,f]=D.useState("picker"),[p,y]=D.useState(null),[v,b]=D.useState(null),[_,C]=D.useState("manual"),{data:w}=ot({queryKey:["addon-config-schema",p],queryFn:()=>s.getAddonConfigSchema(p),enabled:p!=null}),R=Cn({mutationFn:U=>s.trpc.providerConfig.addProvider.mutate({id:U.id,type:U.type,name:U.name,...U.config}),onSuccess:()=>o.invalidateQueries({queryKey:["providers"]})}),O=Cn({mutationFn:U=>s.adoptDevice(v,U),onSuccess:()=>o.invalidateQueries({queryKey:["devices"]})});async function T(U,V,F){if(y(U),C(F),V==="unique"){const re=`${U}-${Date.now()}`;try{await R.mutateAsync({id:re,type:U,name:U,config:{}}),e(),P(),i(`/integrations/${re}`)}catch{}return}f("config")}async function M(U){if(!p)return;const V=`${p}-${Date.now()}`;try{await R.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??v??p;e(),P(),V&&i(`/integrations/${V}`)}function P(){f("picker"),y(null),b(null),C("manual")}function H(){e(),P()}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:H}),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:H,className:"rounded-md p-1 text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",children:h.jsx(bl,{className:"h-4 w-4"})})]}),h.jsxs("div",{className:"px-5 py-4",children:[d==="picker"&&h.jsx(eA,{onSelect:T,onClose:H}),d==="config"&&p&&h.jsx(jA,{addonId:p,configSchema:w??null,onSave:M,onBack:()=>f("picker")}),d==="discovery"&&v&&h.jsx(CA,{providerId:v,onImport:z,onSkip:k})]})]})]})}const EA=[{id:"all",label:"All",icon:h3},{id:"camera",label:"Camera",icon:Lc},{id:"sensor",label:"Sensor",icon:dv},{id:"light",label:"Light",icon:MT},{id:"switch",label:"Switch",icon:fR},{id:"other",label:"Other",icon:h3}];function yx(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 TA(){const t=Ft(),e=ga(),n=gl(),[s,i]=D.useState(!1),[o,d]=D.useState(""),[f,p]=D.useState("all"),[y,v]=D.useState("provider"),[b,_]=D.useState(new Set(["__all__"])),{data:C,isLoading:w}=ot({queryKey:["providers"],queryFn:()=>t.listProviders(),refetchInterval:5e3}),{data:R,isLoading:O}=ot({queryKey:["devices"],queryFn:()=>t.listDevices(),refetchInterval:5e3});Cn({mutationFn:F=>t.startProvider(F),onSuccess:()=>e.invalidateQueries({queryKey:["providers"]})}),Cn({mutationFn:F=>t.stopProvider(F),onSuccess:()=>e.invalidateQueries({queryKey:["providers"]})});const T=C??[],M=R??[],z=D.useMemo(()=>{const F=o.toLowerCase();return M.filter(re=>!(f!=="all"&&yx(re)!==f||F&&!(re.name??re.id??"").toLowerCase().includes(F)))},[M,f,o]),k=D.useMemo(()=>{var re;const F=new Map;for(const ne of z){let I;switch(y){case"provider":I=ne.providerId??"unknown";break;case"type":I=yx(ne);break;case"status":I=(re=ne.state)!=null&&re.online?"online":"offline";break}F.has(I)||F.set(I,[]),F.get(I).push(ne)}return F},[z,y]);function P(F){_(re=>{const ne=new Set(re);return ne.has(F)?ne.delete(F):ne.add(F),ne})}function H(F){if(y==="provider"){const re=T.find(ne=>ne.id===F);return re?re.name??F:F}return F.charAt(0).toUpperCase()+F.slice(1)}function L(F){if(y==="provider"){const re=T.find(ne=>ne.id===F);return(re==null?void 0:re.type)??"rtsp"}return"rtsp"}function U(F){var re;if(y==="provider"){const ne=T.find(I=>I.id===F);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(fv,{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:F=>d(F.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:EA.map(({id:F,label:re})=>h.jsx("button",{onClick:()=>p(F),className:`rounded-full px-2.5 py-1 text-[10px] font-medium transition-colors ${f===F?"bg-primary/15 text-primary border border-primary/30":"bg-surface border border-border text-foreground-subtle hover:text-foreground"}`,children:re},F))}),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:F=>v(F.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(F=>h.jsx("div",{className:"h-14 rounded-lg border border-border bg-surface animate-pulse"},F))}),!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(([F,re])=>{const ne=b.has(F)||b.has("__all__"),I=L(F),ie=U(F),ce=y==="provider"?F:null;return h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsxs("button",{onClick:()=>P(F),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(ty,{type:I,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/${F}`)},children:H(F)}):h.jsx("span",{className:"text-xs font-semibold text-foreground",children:H(F)}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle",children:[re.length," device",re.length!==1?"s":""]}),ie&&h.jsx(th,{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(Jm,{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 W;const $=Y.id,ae=Y.name??Y.id,je=yx(Y),he=(W=Y.state)!=null&&W.online?"online":"offline",G=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:je}),h.jsx("span",{children:h.jsx(th,{status:he})}),h.jsx("span",{className:"text-[11px] text-foreground-subtle",children:G}),h.jsx("span",{className:"text-[11px] text-foreground-subtle",children:"—"}),h.jsx("span",{className:"text-[11px] text-foreground-subtle",children:"—"})]},$)})]})]},F)}),h.jsx(wA,{open:s,onClose:()=>i(!1)})]})}function RA({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(ch,{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:v=>{v.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 OA({id:t,name:e,status:n,snapshotUrl:s,resolution:i,codec:o,fps:d,lastSnapshot:f}){const p=gl();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(RA,{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 MA({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 AA({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(OA,{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(MA,{name:d.name,externalId:d.externalId,onImport:n??(()=>{}),importing:s==null?void 0:s.has(d.externalId)},d.externalId))})]})]})}function DA({open:t,providerId:e,onClose:n}){const{t:s}=Er(),i=Ft(),o=ga(),[d,f]=D.useState(""),[p,y]=D.useState(""),[v,b]=D.useState([""]),[_,C]=D.useState({}),w=Cn({mutationFn:k=>i.createDevice(e,k),onSuccess:()=>{o.invalidateQueries({queryKey:["devices"]})}}),R=Cn({mutationFn:async()=>{const k={};for(let P=0;P<v.length;P++){const H=v[P];if(H.trim())try{await i.trpc.providerConfig.testConnection.mutate({type:"rtsp",url:H}),k[P]={codec:"OK",resolution:"Connected"}}catch(L){k[P]={error:String(L)}}}C(k)}});function O(){b(k=>[...k,""])}function T(k){b(P=>P.filter((H,L)=>L!==k))}function M(k,P){b(H=>H.map((L,U)=>U===k?P:L))}async function z(k){const P={name:d,snapshotUrl:p||void 0,streams:v.filter(H=>H.trim())};await w.mutateAsync(P),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(bl,{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:v.map((k,P)=>h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("input",{type:"text",value:k,onChange:H=>M(P,H.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"}),v.length>1&&h.jsx("button",{onClick:()=>T(P),className:"rounded-md p-1.5 text-foreground-subtle hover:text-danger hover:bg-danger/10 transition-colors",children:h.jsx(Im,{className:"h-3.5 w-3.5"})})]},P))})]}),Object.keys(_).length>0&&h.jsx("div",{className:"space-y-1",children:Object.entries(_).map(([k,P])=>h.jsx("div",{className:`rounded-lg border px-3 py-1.5 text-[10px] ${P.error?"border-danger/30 bg-danger/5 text-danger":"border-success/30 bg-success/5 text-success"}`,children:P.error?`${s("integrations.stream",{number:Number(k)+1})} ${P.error}`:`${s("integrations.stream",{number:Number(k)+1})} ${P.codec} · ${P.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:()=>R.mutate(),disabled:v.every(k=>!k.trim())||R.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:R.isPending?s("integrations.testing"):s("integrations.test")}),h.jsx("button",{onClick:()=>z(!1),disabled:!d.trim()||v.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()||v.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()||v.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 zA(){const{t}=Er(),{integrationId:e}=$b(),n=Ft(),s=ga(),[i,o]=D.useState(!1),[d,f]=D.useState(!1),{data:p,isLoading:y}=ot({queryKey:["provider",e],queryFn:()=>n.getProvider(e),enabled:!!e}),{data:v}=ot({queryKey:["devices"],queryFn:()=>n.listDevices(),refetchInterval:5e3}),{data:b,refetch:_}=ot({queryKey:["discover-devices",e],queryFn:()=>n.discoverDevices(e),enabled:!!e&&(p==null?void 0:p.discoveryMode)!=="manual"}),C=Cn({mutationFn:()=>n.startProvider(e),onSuccess:()=>s.invalidateQueries({queryKey:["provider",e]})}),w=Cn({mutationFn:()=>n.stopProvider(e),onSuccess:()=>s.invalidateQueries({queryKey:["provider",e]})}),R=Cn({mutationFn:V=>n.adoptDevice(e,V),onSuccess:()=>{s.invalidateQueries({queryKey:["devices"]}),s.invalidateQueries({queryKey:["discover-devices",e]})}}),[O,T]=D.useState(new Set);async function M(V){T(F=>new Set([...F,V]));try{await R.mutateAsync(V)}finally{T(F=>{const re=new Set(F);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=(v??[]).filter(V=>V.providerId===e).map(V=>{var F;return{id:V.id,name:V.name??V.id,status:(F=V.state)!=null&&F.online?"online":"offline",snapshotUrl:null}}),P=(b??[]).map(V=>({externalId:V.externalId,name:V.name??V.externalId})),H=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(th,{status:H})]}),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(Am,{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(Jm,{className:"h-3 w-3"}),t("integrations.config")]}),H==="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(D6,{className:"h-3.5 w-3.5"})}):h.jsx("button",{onClick:()=>C.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(K1,{className:"h-3.5 w-3.5"})})]})]}),h.jsx(AA,{activeDevices:k,discoveredDevices:L?P: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(Am,{className:"h-5 w-5 text-primary-foreground"})}),i&&e&&h.jsx(DA,{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 kA({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 xx=36e5;function LA(t){return String(t).padStart(2,"0")}function UA(t){const e=new Date(t);return`${LA(e.getHours())}:00`}function qA({startMs:t,endMs:e,segments:n,events:s,playheadMs:i,onSeek:o}){const d=D.useRef(null),f=e-t,p=D.useCallback(C=>Math.max(0,Math.min(100,(C-t)/f*100)),[t,f]);function y(C){if(!d.current)return;const w=d.current.getBoundingClientRect(),R=Math.max(0,Math.min(1,(C.clientX-w.left)/w.width));o(Math.round(t+R*f))}const v=[],b=Math.floor(t/xx),_=Math.ceil(e/xx);for(let C=b;C<=_;C++){const w=C*xx;w<t||w>e||v.push({percent:p(w),label:UA(w)})}return h.jsxs("div",{className:"select-none",children:[h.jsx("div",{className:"relative h-5 mb-1",children:v.map(({percent:C,label:w})=>h.jsx("span",{className:"absolute -translate-x-1/2 text-[10px] text-foreground-subtle",style:{left:`${C}%`},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:C=>{C.buttons===1&&y(C)},children:[n.map((C,w)=>{const R=p(C.startMs),O=p(C.endMs)-R;return h.jsx("div",{className:"absolute top-1 bottom-1 rounded-sm bg-success/60",style:{left:`${R}%`,width:`${Math.max(O,.1)}%`}},w)}),s.map(C=>h.jsx(kA,{label:C.label,color:C.color,title:`${C.label} — ${new Date(C.timestampMs).toLocaleTimeString()}`,style:{left:`${p(C.timestampMs)}%`}},C.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 f5={person:"#f59e0b",vehicle:"#3b82f6",car:"#3b82f6",face:"#a855f7",plate:"#ec4899",animal:"#10b981",motion:"#ef4444",unknown:"#6b7280"};function Cb(t){return f5[t.toLowerCase()]??f5.unknown}function HA(t){const e=new Date(t);return e.setHours(0,0,0,0),e.getTime()}function BA(t){return new Date(t).toISOString().slice(0,10)}function GA(t){return new Date(t+"T00:00:00").getTime()}function PA(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 YA(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:Cb(e[s%e.length])})).sort((n,s)=>n.timestampMs-s.timestampMs)}function VA(){var k,P;const{t}=Er(),e=Ft(),n=HA(new Date),[s,i]=D.useState(n),[o,d]=D.useState(null),[f,p]=D.useState(n+12*36e5),y=s,v=s+24*36e5,{data:b,isLoading:_}=ot({queryKey:["devices"],queryFn:()=>e.listDevices(),staleTime:3e4}),C=b??[],w=D.useMemo(()=>C.filter(L=>{const U=String(L.type??"").toLowerCase(),V=L.capabilities??[];return U==="camera"||U.includes("camera")||V.some(F=>F.toLowerCase().includes("video")||F.toLowerCase().includes("stream"))}).map(L=>({id:String(L.id),name:String(L.name??L.id)})),[C]),R=o??((k=w[0])==null?void 0:k.id)??null,{data:O}=ot({queryKey:["events",R,y],queryFn:()=>R?e.getEvents(R,{limit:200}):Promise.resolve(null),enabled:!!R,staleTime:6e4}),T=D.useMemo(()=>{const H=O,U=Array.isArray(H)?H:H!=null&&typeof H=="object"&&Array.isArray(H.events)?H.events:[];return U.length===0?R?YA(y):[]:U.map((V,F)=>{const re=String(V.class??V.type??V.label??"unknown").toLowerCase(),ne=typeof V.timestamp=="number"?V.timestamp:y;return{id:String(V.id??F),timestampMs:ne,label:re,color:Cb(re)}})},[O,R,y]),M=D.useMemo(()=>R?PA(y):[],[R,y]);function z(H){i(L=>L+H*24*36e5),p(L=>L+H*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(KE,{className:"h-4 w-4"})}),h.jsxs("div",{className:"relative flex items-center",children:[h.jsx(UE,{className:"absolute left-2 h-3.5 w-3.5 text-foreground-subtle pointer-events-none"}),h.jsx("input",{type:"date",value:BA(s),onChange:H=>{if(H.target.value){const L=GA(H.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(H=>{const L=H.id===R;return h.jsx("button",{onClick:()=>d(H.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:H.name},H.id)})]}),h.jsxs("div",{className:"relative rounded-xl border border-border bg-black shrink-0 overflow-hidden",style:{aspectRatio:"16/9",maxHeight:"45vh"},children:[h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-3 text-foreground-subtle",children:[h.jsx(E6,{className:"h-12 w-12 opacity-20"}),h.jsx("p",{className:"text-sm opacity-50",children:R?`${((P=w.find(H=>H.id===R))==null?void 0:P.name)??R} — 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 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(T.map(H=>H.label))).slice(0,5).map(H=>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:Cb(H)}}),h.jsx("span",{className:"text-[10px] text-foreground-subtle capitalize",children:H})]},H))]}),R?h.jsx(qA,{startMs:y,endMs:v,segments:M,events:T,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 bx({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 QA({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(bx,{label:"Motion FPS",value:t,min:1,max:15,onChange:i,unit:"fps",hint:"Frame-diff rate"}),h.jsx(bx,{label:"Detection FPS",value:e,min:1,max:30,onChange:o,unit:"fps",hint:"Inference rate"}),h.jsx(bx,{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 KA={motionFps:2,detectionFps:5,cooldownMs:1e4,maxConcurrentInferences:null};function XA(){const{t}=Er(),e=Ft(),[n,s]=D.useState(!0),[i,o]=D.useState(null),[d,f]=D.useState(null),[p,y]=D.useState([]),[v,b]=D.useState([]),[_,C]=D.useState(null),[w,R]=D.useState(KA),[O,T]=D.useState(!1),[M,z]=D.useState(!1),[k,P]=D.useState(!0);D.useEffect(()=>{var ie,ce,Y,$,ae,je,he,G,W,fe,be,_e,me,we,nt;const I=e.trpc;if(!I){s(!1);return}Promise.all([(Y=(ce=(ie=I.pipeline)==null?void 0:ie.getSchema)==null?void 0:ce.query)==null?void 0:Y.call(ce).catch(()=>null),(je=(ae=($=I.inference)==null?void 0:$.getCapabilities)==null?void 0:ae.query)==null?void 0:je.call(ae).catch(()=>null),(W=(G=(he=I.pipeline)==null?void 0:he.getGlobalSteps)==null?void 0:G.query)==null?void 0:W.call(G).catch(()=>null),(_e=(be=(fe=I.pipeline)==null?void 0:fe.getOrchestratorSettings)==null?void 0:be.query)==null?void 0:_e.call(be).catch(()=>null),(nt=(we=(me=I.pipeline)==null?void 0:me.listTemplates)==null?void 0:we.query)==null?void 0:nt.call(we).catch(()=>[])]).then(([ze,Vt,$e,Mt,Ht])=>{ze&&o(ze),Vt&&f(Vt),$e&&y($e),Mt&&R(Mt),b(Ht??[]),s(!1)}).catch(()=>s(!1))},[e]);const H=D.useCallback(I=>{y(I),T(!0)},[]),L=D.useCallback(I=>{if(C(I),I&&i){const ie=v.find(ce=>ce.id===I);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,v]),U=D.useCallback(async(I,ie)=>{try{const Y=await e.trpc.pipeline.saveTemplate.mutate({name:I,steps:ie});b($=>[Y,...$]),C(Y.id)}catch{}},[e]),V=D.useCallback(async(I,ie)=>{try{const Y=await e.trpc.pipeline.updateTemplate.mutate({id:I,steps:ie});b($=>$.map(ae=>ae.id===I?Y:ae))}catch{}},[e]),F=D.useCallback(async I=>{try{await e.trpc.pipeline.deleteTemplate.mutate({id:I}),b(ce=>ce.filter(Y=>Y.id!==I)),_===I&&C(null)}catch{}},[e,_]);async function re(){z(!0);try{const I=e.trpc;await Promise.all([I.pipeline.setGlobalSteps.mutate({steps:p}),I.pipeline.setOrchestratorSettings.mutate(w)]),T(!1)}catch{}finally{z(!1)}}function ne(I,ie){R(ce=>({...ce,[I]:ie})),T(!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 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(Q1,{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(A6,{className:"h-3.5 w-3.5"}),M?"Saving…":"Save Pipeline"]})]})]}),h.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:h.jsx(nC,{schema:i,capabilities:d,steps:p,onChange:H,templates:v,selectedTemplateId:_,onSelectTemplate:L,onSaveTemplate:U,onUpdateTemplate:V,onDeleteTemplate:F})})]}),h.jsxs("aside",{className:"w-72 shrink-0 border-l border-border flex flex-col overflow-hidden bg-surface/40",children:[h.jsxs("button",{onClick:()=>P(!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(QA,{motionFps:w.motionFps,detectionFps:w.detectionFps,cooldownMs:w.cooldownMs,maxConcurrentInferences:w.maxConcurrentInferences,onMotionFpsChange:I=>ne("motionFps",I),onDetectionFpsChange:I=>ne("detectionFps",I),onCooldownMsChange:I=>ne("cooldownMs",I),onMaxConcurrentInferencesChange:I=>ne("maxConcurrentInferences",I)})})]})]})}const FA=["WebRTC","HLS","MJPEG","go2rtc"],ZA=["BBox","Segm","Zones","Trail"];function JA({deviceName:t,detectionsToday:e,inferenceMs:n,activeTracks:s,storageGb:i}){const[o,d]=D.useState("WebRTC"),[f,p]=D.useState(new Set);function y(v){p(b=>{const _=new Set(b);return _.has(v)?_.delete(v):_.add(v),_})}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:"}),FA.map(v=>h.jsx("button",{onClick:()=>d(v),className:`rounded-full px-2.5 py-1 text-[10px] font-medium transition-colors ${o===v?"bg-primary/15 text-primary border border-primary/30":"bg-surface border border-border text-foreground-subtle hover:text-foreground"}`,children:v},v))]}),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:"}),ZA.map(v=>{const b=f.has(v);return h.jsx("button",{onClick:()=>y(v),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:v},v)})]}),h.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[h.jsx($0,{icon:ch,label:"Today",value:String(e)}),h.jsx($0,{icon:cv,label:"Inference",value:`${n}ms`}),h.jsx($0,{icon:rT,label:"Tracks",value:String(s)}),h.jsx($0,{icon:mm,label:"Storage",value:`${i.toFixed(1)}GB`})]})]})}function $0({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 vx={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 IA({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(N1,{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(vx).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(uv,{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=vx[n.type]??vx.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 h5={person:{color:"text-success",borderColor:"border-l-success",icon:bR},vehicle:{color:"text-info",borderColor:"border-l-info",icon:BE},animal:{color:"text-warning",borderColor:"border-l-warning",icon:lT},audio:{color:"text-danger",borderColor:"border-l-danger",icon:R6},other:{color:"text-foreground-subtle",borderColor:"border-l-foreground-subtle",icon:uv}};function WA(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 $A({deviceId:t}){const e=Ft(),{data:n,isLoading:s}=ot({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(h5).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(uv,{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=WA(o),p=h5[f],y=p.icon,v=String(o.label??o.type??"Unknown"),b=o.score!=null?Number(o.score):null,_=o.zone?String(o.zone):null,C=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:v}),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:[C&&h.jsxs("span",{children:["Track: ",C]}),_&&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 eD({deviceId:t}){const e=Ft(),[n,s]=D.useState(new Set),{data:i,isLoading:o}=ot({queryKey:["pipeline",t],queryFn:()=>e.bridgeGetPipeline(t),enabled:!!t}),d=i,f=(d==null?void 0:d.video)??[];function p(y){s(v=>{const b=new Set(v);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,v)=>{const b=n.has(y.id??String(v)),_=y.id??String(v);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:v+1}),h.jsx("span",{className:"text-xs font-medium text-foreground flex-1 truncate",children:y.name||y.type||`Step ${v+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(Q1,{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 tD(){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(j6,{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(E6,{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 nD=Math.PI/180;function aD(){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:{},De={_global:qu,version:"10.2.3",isBrowser:aD(),isUnminified:/param/.test((function(t){}).toString()),dblClickWindow:400,getAngle(t){return De.angleDeg?t*nD: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 De.DD.isDragging},isTransforming(){var t,e;return(e=(t=De.Transformer)===null||t===void 0?void 0:t.isTransforming())!==null&&e!==void 0?e:!1},isDragReady(){return!!De.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}},$n=t=>{De[t.prototype.getClassName()]=t};De._injectGlobal(De);const sD=`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
+ `,p5=()=>{if(typeof document>"u")throw new Error(sD)};class jr{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 jr(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 rD="[object Array]",iD="[object Number]",lD="[object String]",oD="[object Boolean]",cD=Math.PI/180,uD=180/Math.PI,em="#",dD="",fD="0",hD="Konva warning: ",m5="Konva error: ",pD="rgb(",Sx={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]},mD=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/;let e1=[],tm=null;const gD=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)===rD},_isNumber(t){return Object.prototype.toString.call(t)===iD&&!isNaN(t)&&isFinite(t)},_isString(t){return Object.prototype.toString.call(t)===lD},_isBoolean(t){return Object.prototype.toString.call(t)===oD},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){e1.push(t),e1.length===1&&gD(function(){const e=e1;e1=[],e.forEach(function(n){n()})})},createCanvasElement(){p5();const t=document.createElement("canvas");try{t.style=t.style||{}}catch{}return t},createImageElement(){return p5(),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(em,dD);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=fD+t;return em+t},isCanvasFarblingActive(){if(tm!==null)return tm;if(typeof document>"u")return tm=!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 tm=s,this.releaseCanvas(t),tm},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),em+this._rgbToHex(t,e,n)},getSnappedHexColor(t){const e=this._hexToRgb(t);return em+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 Sx?(e=Sx[t],{r:e[0],g:e[1],b:e[2]}):t[0]===em?this._hexToRgb(t.substring(1)):t.substr(0,4)===pD?(e=mD.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=Sx[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,v=[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,v[b]=p*255;return{r:Math.round(v[0]),g:Math.round(v[1]),b:Math.round(v[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*cD},radToDeg(t){return t*uD},_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 De.angleDeg?ee.radToDeg(t):t},_capitalize(t){return t.charAt(0).toUpperCase()+t.slice(1)},throw(t){throw new Error(m5+t)},error(t){console.error(m5+t)},warn(t){De.showWarnings&&console.warn(hD+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 v=((i-t)*(n-t)+(o-e)*(s-e))/y;v<0?(d=t,f=e,p=(t-i)*(t-i)+(e-o)*(e-o)):v>1?(d=n,f=s,p=(n-i)*(n-i)+(s-o)*(s-o)):(d=t+v*(n-t),f=e+v*(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],v=p[1],b=p[2];b<i&&(s.x=y,s.y=v,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){De.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},v={x:p.x-f.x,y:p.y-f.y},b=Math.hypot(y.x,y.y),_=Math.hypot(v.x,v.y);let C;typeof i=="number"?C=i:C=o<i.length?i[o]:0,C=s*Math.cos(Math.PI/n)*Math.min(1,C/s*2);const R={x:y.x/b,y:y.y/b},O={x:v.x/_,y:v.y/_},T={x:f.x-R.x*C,y:f.y-R.y*C},M={x:f.x+O.x*C,y:f.y+O.y*C};o===0?t.moveTo(T.x,T.y):t.lineTo(T.x,T.y),t.arcTo(f.x,f.y,M.x,M.y,C)}}};function yD(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 g5=",",xD="(",bD=")",vD="([",SD="])",ND=";",_D="()",jD="=",y5=["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"],CD=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled","filter"],wD=100;let t1=null;function x5(){if(t1!==null)return t1;try{const e=ee.createCanvasElement().getContext("2d");return e?!!e&&"filter"in e:(t1=!1,!1)}catch{return t1=!1,!1}}class ay{constructor(e){this.canvas=e,De.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+=_D:ee._isArray(y[0])?o+=vD+y.join(g5)+SD:(n&&(y=y.map(v=>typeof v=="number"?Math.floor(v):v)),o+=xD+y.join(g5)+bD)):(o+=f.property,e||(o+=jD+f.val)),o+=ND;return o}clearTrace(){this.traceArr=[]}_trace(e){let n=this.traceArr,s;n.push(e),s=n.length,s>=wD&&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 v=arguments,b=this._context;v.length===3?b.drawImage(e,n,s):v.length===5?b.drawImage(e,n,s,i,o):v.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=y5.length,s=this.setAttr,i,o;const d=function(f){let p=e[f],y;e[f]=function(){return o=yD(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(y5[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)}}CD.forEach(function(t){Object.defineProperty(ay.prototype,t,{get(){return this._context[t]},set(e){this._context[t]=e}})});class ED extends ay{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(),v=p.x*y,b=p.y*y;this.setAttr("shadowColor",o),this.setAttr("shadowBlur",d*Math.min(Math.abs(v),Math.abs(b))),this.setAttr("shadowOffsetX",f.x*v),this.setAttr("shadowOffsetY",f.y*b)}}class TD extends ay{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 n1;function RD(){if(n1)return n1;const t=ee.createCanvasElement(),e=t.getContext("2d");return n1=(function(){const n=De._global.devicePixelRatio||1,s=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return n/s})(),ee.releaseCanvas(t),n1}class wv{constructor(e){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const s=(e||{}).pixelRatio||De.pixelRatio||RD();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 wv{constructor(e={width:0,height:0,willReadFrequently:!1}){super(e),this.context=new ED(this,{willReadFrequently:e.willReadFrequently}),this.setSize(e.width,e.height)}}class Ev extends wv{constructor(e={width:0,height:0}){super(e),this.hitCanvas=!0,this.context=new TD(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,De._mouseListenClick=!1,De._touchListenClick=!1,De._pointerListenClick=!1,n.dragStatus="stopped");const d=n.node.getLayer()||n.node instanceof De.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)})}};De.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 y8(t){return t>255?255:t<0?0:Math.round(t)}function Re(){if(De.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 sy(t){if(De.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 Tv(){if(De.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(De.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 x8(){if(De.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 OD(){if(De.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 Oi(){if(De.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 MD(t){if(De.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 nm="get",am="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=nm+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=am+ee._capitalize(e);t.prototype[i]||K.overWriteSetter(t,e,n,s)},overWriteSetter(t,e,n,s){const i=am+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=nm+d(e),p=am+d(e);t.prototype[f]=function(){const v={};for(let b=0;b<o;b++){const _=n[b];v[_]=this.getAttr(e+d(_))}return v};const y=MD(n);t.prototype[p]=function(v){const b=this.attrs[e];s&&(v=s.call(this,v,e)),y&&y.call(this,v,e);for(const _ in v)v.hasOwnProperty(_)&&this._setAttr(e+d(_),v[_]);return v||n.forEach(_=>{this._setAttr(e+d(_),void 0)}),this._fireChangeEvent(e,b,v),i&&i.call(this),this},K.addOverloadedGetterSetter(t,e)},addOverloadedGetterSetter(t,e){const n=ee._capitalize(e),s=am+n,i=nm+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=nm+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=nm+ee._capitalize(n),d=am+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 AD(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=De.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=De.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=De.Filters;p&&p.Contrast&&p.Contrast.call(this,d)}}case"grayscale":return function(o){const d=De.Filters;d&&d.Grayscale&&d.Grayscale.call(this,o)};case"sepia":return function(o){const d=De.Filters;d&&d.Sepia&&d.Sepia.call(this,o)};case"invert":return function(o){const d=De.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 y1="absoluteOpacity",b5="allEventListeners",ao="absoluteTransform",v5="absoluteScale",zu="canvas",DD="Change",zD="children",kD="konva",wb="listening",LD="mouseenter",UD="mouseleave",qD="pointerenter",HD="pointerleave",BD="touchenter",GD="touchleave",S5="set",N5="Shape",x1=" ",_5="stage",gc="transform",PD="Stage",Eb="visible",YD=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(x1);let VD=1;class Ae{constructor(e){this._id=VD++,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===ao)&&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===ao)&&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(x1);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===ao&&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,v=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,C=Math.abs(Math.round(s.y)-p)>.5?1:0;i+=y*2+_,o+=y*2+C,f-=y,p-=y;const w=new xc({pixelRatio:d,width:i,height:o}),R=new xc({pixelRatio:d,width:0,height:0,willReadFrequently:!0}),O=new Ev({pixelRatio:b,width:i,height:o}),T=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,R.getContext()._context.imageSmoothingEnabled=!1),T.save(),M.save(),k.save(),T.translate(-f,-p),M.translate(-f,-p),k.translate(-f,-p),z.x=f,z.y=p,this._isUnderCache=!0,this._clearSelfAndDescendantCache(y1),this._clearSelfAndDescendantCache(v5),this.drawScene(w,this,z),this.drawHit(O,this),this._isUnderCache=!1,T.restore(),M.restore(),v&&(T.save(),T.beginPath(),T.rect(0,0,i,o),T.closePath(),T.setAttr("strokeStyle","red"),T.setAttr("lineWidth",5),T.stroke(),T.restore()),ee.releaseCanvas(z._canvas),this._cache.set(zu,{scene:w,filter:R,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 v=p.point(y);i===void 0&&(i=d=v.x,o=f=v.y),i=Math.min(i,v.x),o=Math.min(o,v.y),d=Math.max(d,v.x),f=Math.max(f,v.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 v=!0;for(let _=0;_<e.length;_++)if(typeof e[_]=="string"&&x5(),typeof e[_]!="string"||!x5()){v=!1;break}const b=s.pixelRatio;if(i.setSize(s.width/s.pixelRatio,s.height/s.pixelRatio),v){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=AD(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(b5),e.length===3)return this._delegate.apply(this,e);const i=n.split(x1);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(x1),i=s.length,o,d,f,p,y,v;if(this._cache&&this._cache.delete(b5),!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],v=p[1],y)this.eventListeners[y]&&this._off(y,v,n);else for(d in this.eventListeners)this._off(d,v,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(ao),this._clearSelfAndDescendantCache(y1),this._clearSelfAndDescendantCache(v5),this._clearSelfAndDescendantCache(_5),this._clearSelfAndDescendantCache(Eb),this._clearSelfAndDescendantCache(wb)}_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!==zD&&(s=S5+ee._capitalize(n),ee._isFunction(this[s])?this[s](e[n]):this._setAttr(n,e[n]))}),this}isListening(){return this._getCache(wb,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(Eb,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&&!De.hitOnDragEnabled&&(i||De.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(v){for(i=[],o=v.length,d=0;d<o;d++)f=v[d],s++,f.nodeType!==N5&&(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!==PD&&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(ao)),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 jr,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(ao),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(y1,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(_5,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(ao,this._getAbsoluteTransform)}_getAbsoluteTransform(e){let n;if(e)return n=new jr,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(ao)||new jr,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 jr;s.reset();const i=this.x(),o=this.y(),d=De.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,v=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||v!==0)&&s.skew(y,v),(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(kD)<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():De.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+DD,{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[S5+ee._capitalize(e)];return ee._isFunction(s)?s.call(this,n):this._setAttr(e,n),this}_requestDraw(){if(De.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===N5&&(n.target=this);const i=[LD,UD,qD,HD,BD,GD];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=Ae.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,Ae.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)||De.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=Ae.prototype.getClassName.call(e),i=e.children,o,d,f;n&&(e.attrs.container=n),De[s]||(ee.warn('Can not find a node with class name "'+s+'". Fallback to "Shape".'),s="Shape");const p=De[s];if(o=new p(e.attrs),i)for(d=i.length,f=0;f<d;f++)o.add(Ae._createNode(i[f]));return o}}Ae.protoListenerMap=new Map;Ae.prototype.nodeType="Node";Ae.prototype._attrsAffectingSize=[];Ae.prototype.eventListeners={};Ae.prototype.on(YD,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(gc),this._clearSelfAndDescendantCache(ao)});Ae.prototype.on("visibleChange.konva",function(){this._clearSelfAndDescendantCache(Eb)});Ae.prototype.on("listeningChange.konva",function(){this._clearSelfAndDescendantCache(wb)});Ae.prototype.on("opacityChange.konva",function(){this._clearSelfAndDescendantCache(y1)});const gn=K.addGetterSetter;gn(Ae,"zIndex");gn(Ae,"absolutePosition");gn(Ae,"position");gn(Ae,"x",0,Re());gn(Ae,"y",0,Re());gn(Ae,"globalCompositeOperation","source-over",rd());gn(Ae,"opacity",1,Re());gn(Ae,"name","",rd());gn(Ae,"id","",rd());gn(Ae,"rotation",0,Re());K.addComponentsGetterSetter(Ae,"scale",["x","y"]);gn(Ae,"scaleX",1,Re());gn(Ae,"scaleY",1,Re());K.addComponentsGetterSetter(Ae,"skew",["x","y"]);gn(Ae,"skewX",0,Re());gn(Ae,"skewY",0,Re());K.addComponentsGetterSetter(Ae,"offset",["x","y"]);gn(Ae,"offsetX",0,Re());gn(Ae,"offsetY",0,Re());gn(Ae,"dragDistance",void 0,Re());gn(Ae,"width",0,Re());gn(Ae,"height",0,Re());gn(Ae,"listening",!0,Oi());gn(Ae,"preventDefault",!0,Oi());gn(Ae,"filters",void 0,function(t){return this._filterUpToDate=!1,t});gn(Ae,"visible",!0,Oi());gn(Ae,"transformsEnabled","all",rd());gn(Ae,"size");gn(Ae,"dragBoundFunc");gn(Ae,"draggable",!1,Oi());K.backCompat(Ae,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});class Cr extends Ae{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=Ae.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=Ae.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 v=this.getAbsoluteTransform(n).getMatrix();d.transform(v[0],v[1],v[2],v[3],v[4],v[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(),v=typeof f=="number"&&typeof p=="number"||y,b=s===this;if(v){d.save();const C=this.getAbsoluteTransform(s);let w=C.getMatrix();d.transform(w[0],w[1],w[2],w[3],w[4],w[5]),d.beginPath();let R;if(y)R=y.call(this,d,this);else{const O=this.clipX(),T=this.clipY();d.rect(O||0,T||0,f,p)}d.clip.apply(d,R),w=C.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(C){C[e](n,s,i)}),_&&d.restore(),v&&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 v=this;(n=this.children)===null||n===void 0||n.forEach(function(C){if(!C.visible())return;const w=C.getClientRect({relativeTo:v,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 C=0;C<b.length;C++)if(b[C]._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(Cr,"clip",["x","y","width","height"]);K.addGetterSetter(Cr,"clipX",void 0,Re());K.addGetterSetter(Cr,"clipY",void 0,Re());K.addGetterSetter(Cr,"clipWidth",void 0,Re());K.addGetterSetter(Cr,"clipHeight",void 0,Re());K.addGetterSetter(Cr,"clipFunc");const zm=new Map,b8=De._global.PointerEvent!==void 0;function Nx(t){return zm.get(t)}function Rv(t){return{evt:t,pointerId:t.pointerId}}function v8(t,e){return zm.get(t)===e}function S8(t,e){xm(t),e.getStage()&&(zm.set(t,e),b8&&e._fire("gotpointercapture",Rv(new PointerEvent("gotpointercapture"))))}function xm(t,e){const n=zm.get(t);if(!n)return;const s=n.getStage();s&&s.content,zm.delete(t),b8&&n._fire("lostpointercapture",Rv(new PointerEvent("lostpointercapture")))}const QD="Stage",KD="string",j5="px",XD="mouseout",N8="mouseleave",_8="mouseover",j8="mouseenter",C8="mousemove",w8="mousedown",E8="mouseup",om="pointermove",cm="pointerdown",Df="pointerup",um="pointercancel",FD="lostpointercapture",a1="pointerout",dm="pointerleave",s1="pointerover",r1="pointerenter",Tb="contextmenu",T8="touchstart",R8="touchend",O8="touchmove",M8="touchcancel",Rb="wheel",ZD=5,JD=[[j8,"_pointerenter"],[w8,"_pointerdown"],[C8,"_pointermove"],[E8,"_pointerup"],[N8,"_pointerleave"],[T8,"_pointerdown"],[O8,"_pointermove"],[R8,"_pointerup"],[M8,"_pointercancel"],[_8,"_pointerover"],[Rb,"_wheel"],[Tb,"_contextmenu"],[cm,"_pointerdown"],[om,"_pointermove"],[Df,"_pointerup"],[um,"_pointercancel"],[dm,"_pointerleave"],[FD,"_lostpointercapture"]],_x={mouse:{[a1]:XD,[dm]:N8,[s1]:_8,[r1]:j8,[om]:C8,[cm]:w8,[Df]:E8,[um]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[a1]:"touchout",[dm]:"touchleave",[s1]:"touchover",[r1]:"touchenter",[om]:O8,[cm]:T8,[Df]:R8,[um]:M8,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[a1]:a1,[dm]:dm,[s1]:s1,[r1]:r1,[om]:om,[cm]:cm,[Df]:Df,[um]:um,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},fm=t=>t.indexOf("pointer")>=0?"pointer":t.indexOf("touch")>=0?"touch":"mouse",Ef=t=>{const e=fm(t);if(e==="pointer")return De.pointerEventsEnabled&&_x.pointer;if(e==="touch")return _x.touch;if(e==="mouse")return _x.mouse};function C5(t={}){return(t.clipFunc||t.clipWidth||t.clipHeight)&&ee.warn("Stage does not support clipping. Please use clip for Layers or Groups."),t}const ID="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);",bm=[];let ry=class extends Cr{constructor(e){super(C5(e)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),bm.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{C5(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===KD){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"),Cr.prototype.clone.call(this,e)}destroy(){super.destroy();const e=this.content;e&&ee._isInDocument(e)&&this.container().removeChild(e);const n=bm.indexOf(this);return n>-1&&bm.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(ID),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+j5,this.content.style.height=n+j5),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>ZD&&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(),De.isBrowser&&this.content.appendChild(e.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(e){return v8(e,this)}setPointerCapture(e){S8(e,this)}releaseCapture(e){xm(e)}getLayers(){return this.children}_bindContentEvents(){De.isBrowser&&JD.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=fm(e.type);if(!n)return;this.setPointersPositions(e);const i=this._getTargetShape(s),o=!(De.isDragging()||De.isTransforming())||De.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=fm(e.type);if(!n)return;this.setPointersPositions(e);let i=!1;this._changedPointerPositions.forEach(o=>{const d=this.getIntersection(o);if(Yt.justDragged=!1,De["_"+s+"ListenClick"]=!0,!d||!d.isListening()){this[s+"ClickStartShape"]=void 0;return}De.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=fm(e.type);if(!n)return;const i=e.type.indexOf("touch")>=0||e.pointerType==="touch";if(De.isDragging()&&Yt.node.preventDefault()&&e.cancelable&&i&&e.preventDefault(),this.setPointersPositions(e),!(!(De.isDragging()||De.isTransforming())||De.hitOnDragEnabled))return;const d={};let f=!1;const p=this._getTargetShape(s);this._changedPointerPositions.forEach(y=>{const v=Nx(y.id)||this.getIntersection(y),b=y.id,_={evt:e,pointerId:b},C=p!==v;if(C&&p&&(p._fireAndBubble(n.pointerout,{..._},v),p._fireAndBubble(n.pointerleave,{..._},v)),v){if(d[v._id])return;d[v._id]=!0}v&&v.isListening()?(f=!0,C&&(v._fireAndBubble(n.pointerover,{..._},p),v._fireAndBubble(n.pointerenter,{..._},p),this[s+"targetShape"]=v),v._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=fm(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=Nx(p.id)||this.getIntersection(p);if(y){if(y.releaseCapture(p.id),d[y._id])return;d[y._id]=!0}const v=p.id,b={evt:e,pointerId:v};let _=!1;De["_"+s+"InDblClickWindow"]?(_=!0,clearTimeout(this[s+"DblTimeout"])):Yt.justDragged||(De["_"+s+"InDblClickWindow"]=!0,clearTimeout(this[s+"DblTimeout"])),this[s+"DblTimeout"]=setTimeout(function(){De["_"+s+"InDblClickWindow"]=!1},De.dblClickWindow),y&&y.isListening()?(f=!0,this[s+"ClickEndShape"]=y,y._fireAndBubble(n.pointerup,{...b}),De["_"+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),De["_"+s+"ListenClick"]&&this._fire(n.pointerclick,{evt:e,target:this,currentTarget:this,pointerId:v}),_&&this._fire(n.pointerdblclick,{evt:e,target:this,currentTarget:this,pointerId:v}))}),f||this._fire(n.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),De["_"+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(Tb,{evt:e}):this._fire(Tb,{evt:e,target:this,currentTarget:this})}_wheel(e){this.setPointersPositions(e);const n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(Rb,{evt:e}):this._fire(Rb,{evt:e,target:this,currentTarget:this})}_pointercancel(e){this.setPointersPositions(e);const n=Nx(e.pointerId)||this.getIntersection(this.getPointerPosition());n&&n._fireAndBubble(Df,Rv(e)),xm(e.pointerId)}_lostpointercapture(e){xm(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 Ev({pixelRatio:1,width:this.width(),height:this.height()}),!De.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}};ry.prototype.nodeType=QD;$n(ry);K.addGetterSetter(ry,"container");De.isBrowser&&document.addEventListener("visibilitychange",()=>{bm.forEach(t=>{t.batchDraw()})});const A8="hasShadow",D8="shadowRGBA",z8="patternImage",k8="linearGradient",L8="radialGradient";let i1;function jx(){return i1||(i1=ee.createCanvasElement().getContext("2d"),i1)}const vm={};function WD(t){const e=this.attrs.fillRule;e?t.fill(e):t.fill()}function $D(t){t.stroke()}function ez(t){const e=this.attrs.fillRule;e?t.fill(e):t.fill()}function tz(t){t.stroke()}function nz(){this._clearCache(A8)}function az(){this._clearCache(D8)}function sz(){this._clearCache(z8)}function rz(){this._clearCache(k8)}function iz(){this._clearCache(L8)}class Ee extends Ae{constructor(e){super(e);let n,s=0;for(;n=ee.getHitColor(),!(n&&!(n in vm));)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,vm[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(A8,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(z8,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const n=jx().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(n&&n.setTransform){const s=new jr;s.translate(this.fillPatternX(),this.fillPatternY()),s.rotate(De.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(k8,this.__getLinearGradient)}__getLinearGradient(){const e=this.fillLinearGradientColorStops();if(e){const n=jx(),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(L8,this.__getRadialGradient)}__getRadialGradient(){const e=this.fillRadialGradientColorStops();if(e){const n=jx(),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(D8,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 Ae.prototype.destroy.call(this),delete vm[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,v=d.height+p,b=!e.skipShadow&&this.hasShadow(),_=b?this.shadowOffsetX():0,C=b?this.shadowOffsetY():0,w=y+Math.abs(_),R=v+Math.abs(C),O=b&&this.shadowBlur()||0,T=w+O*2,M=R+O*2,z={width:T,height:M,x:-(p/2+O)+Math.min(_,0)+d.x,y:-(p/2+O)+Math.min(C,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 v;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()){v=this.getStage();const _=s||v.bufferCanvas,C=_.getContext();s?(C.save(),C.setTransform(1,0,0,1,0,0),C.clearRect(0,0,_.width,_.height),C.restore()):C.clear(),C.save(),C._applyLineJoin(this),C._applyMiterLimit(this);const w=this.getAbsoluteTransform(n).getMatrix();C.transform(w[0],w[1],w[2],w[3],w[4],w[5]),p.call(this,C,this),C.restore();const R=_.pixelRatio;y&&d._applyShadow(this),b||(d._applyOpacity(this),d._applyGlobalCompositeOperation(this)),d.drawImage(_._canvas,_.x||0,_.y||0,_.width/R,_.height/R)}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,v=y.length,b=ee._hexToRgb(this.colorKey);for(let _=0;_<v;_+=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 v8(e,this)}setPointerCapture(e){S8(e,this)}releaseCapture(e){xm(e)}}Ee.prototype._fillFunc=WD;Ee.prototype._strokeFunc=$D;Ee.prototype._fillFuncHit=ez;Ee.prototype._strokeFuncHit=tz;Ee.prototype._centroid=!1;Ee.prototype.nodeType="Shape";$n(Ee);Ee.prototype.eventListeners={};Ee.prototype.on("shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",nz);Ee.prototype.on("shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",az);Ee.prototype.on("fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",sz);Ee.prototype.on("fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",rz);Ee.prototype.on("fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",iz);K.addGetterSetter(Ee,"stroke",void 0,x8());K.addGetterSetter(Ee,"strokeWidth",2,Re());K.addGetterSetter(Ee,"fillAfterStrokeEnabled",!1);K.addGetterSetter(Ee,"hitStrokeWidth","auto",Tv());K.addGetterSetter(Ee,"strokeHitEnabled",!0,Oi());K.addGetterSetter(Ee,"perfectDrawEnabled",!0,Oi());K.addGetterSetter(Ee,"shadowForStrokeEnabled",!0,Oi());K.addGetterSetter(Ee,"lineJoin");K.addGetterSetter(Ee,"lineCap");K.addGetterSetter(Ee,"miterLimit");K.addGetterSetter(Ee,"sceneFunc");K.addGetterSetter(Ee,"hitFunc");K.addGetterSetter(Ee,"dash");K.addGetterSetter(Ee,"dashOffset",0,Re());K.addGetterSetter(Ee,"shadowColor",void 0,rd());K.addGetterSetter(Ee,"shadowBlur",0,Re());K.addGetterSetter(Ee,"shadowOpacity",1,Re());K.addComponentsGetterSetter(Ee,"shadowOffset",["x","y"]);K.addGetterSetter(Ee,"shadowOffsetX",0,Re());K.addGetterSetter(Ee,"shadowOffsetY",0,Re());K.addGetterSetter(Ee,"fillPatternImage");K.addGetterSetter(Ee,"fill",void 0,x8());K.addGetterSetter(Ee,"fillPatternX",0,Re());K.addGetterSetter(Ee,"fillPatternY",0,Re());K.addGetterSetter(Ee,"fillLinearGradientColorStops");K.addGetterSetter(Ee,"strokeLinearGradientColorStops");K.addGetterSetter(Ee,"fillRadialGradientStartRadius",0);K.addGetterSetter(Ee,"fillRadialGradientEndRadius",0);K.addGetterSetter(Ee,"fillRadialGradientColorStops");K.addGetterSetter(Ee,"fillPatternRepeat","repeat");K.addGetterSetter(Ee,"fillEnabled",!0);K.addGetterSetter(Ee,"strokeEnabled",!0);K.addGetterSetter(Ee,"shadowEnabled",!0);K.addGetterSetter(Ee,"dashEnabled",!0);K.addGetterSetter(Ee,"strokeScaleEnabled",!0);K.addGetterSetter(Ee,"fillPriority","color");K.addComponentsGetterSetter(Ee,"fillPatternOffset",["x","y"]);K.addGetterSetter(Ee,"fillPatternOffsetX",0,Re());K.addGetterSetter(Ee,"fillPatternOffsetY",0,Re());K.addComponentsGetterSetter(Ee,"fillPatternScale",["x","y"]);K.addGetterSetter(Ee,"fillPatternScaleX",1,Re());K.addGetterSetter(Ee,"fillPatternScaleY",1,Re());K.addComponentsGetterSetter(Ee,"fillLinearGradientStartPoint",["x","y"]);K.addComponentsGetterSetter(Ee,"strokeLinearGradientStartPoint",["x","y"]);K.addGetterSetter(Ee,"fillLinearGradientStartPointX",0);K.addGetterSetter(Ee,"strokeLinearGradientStartPointX",0);K.addGetterSetter(Ee,"fillLinearGradientStartPointY",0);K.addGetterSetter(Ee,"strokeLinearGradientStartPointY",0);K.addComponentsGetterSetter(Ee,"fillLinearGradientEndPoint",["x","y"]);K.addComponentsGetterSetter(Ee,"strokeLinearGradientEndPoint",["x","y"]);K.addGetterSetter(Ee,"fillLinearGradientEndPointX",0);K.addGetterSetter(Ee,"strokeLinearGradientEndPointX",0);K.addGetterSetter(Ee,"fillLinearGradientEndPointY",0);K.addGetterSetter(Ee,"strokeLinearGradientEndPointY",0);K.addComponentsGetterSetter(Ee,"fillRadialGradientStartPoint",["x","y"]);K.addGetterSetter(Ee,"fillRadialGradientStartPointX",0);K.addGetterSetter(Ee,"fillRadialGradientStartPointY",0);K.addComponentsGetterSetter(Ee,"fillRadialGradientEndPoint",["x","y"]);K.addGetterSetter(Ee,"fillRadialGradientEndPointX",0);K.addGetterSetter(Ee,"fillRadialGradientEndPointY",0);K.addGetterSetter(Ee,"fillPatternRotation",0);K.addGetterSetter(Ee,"fillRule",void 0,rd());K.backCompat(Ee,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});const lz="beforeDraw",oz="draw",U8=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],cz=U8.length;let id=class extends Cr{constructor(e){super(e),this.canvas=new xc,this.hitCanvas=new Ev({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(){Ae.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(!Ae.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(Ae.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(Ae.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 Ae.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(),Ae.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<cz;i++){const o=U8[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=vm[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(lz,{node:this}),this.clearBeforeDraw()&&o.getContext().clear(),Cr.prototype.drawScene.call(this,o,n,s),this._fire(oz,{node:this}),this}drawHit(e,n){const s=this.getLayer(),i=e||s&&s.hitCanvas;return s&&s.clearBeforeDraw()&&s.getHitCanvas().getContext().clear(),Cr.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";$n(id);K.addGetterSetter(id,"imageSmoothingEnabled",!0);K.addGetterSetter(id,"clearBeforeDraw",!0);K.addGetterSetter(id,"hitGraphEnabled",!0,Oi());class Ov extends id{constructor(e){super(e),this.listening(!1),ee.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}Ov.prototype.nodeType="FastLayer";$n(Ov);let nh=class extends Cr{_validateAdd(e){const n=e.getType();n!=="Group"&&n!=="Shape"&&ee.throw("You may only add groups and shapes to groups.")}};nh.prototype.nodeType="Group";$n(nh);const Cx=(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:Cx(),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=Cx(),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(Cx());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 v=o[y];v._id!==void 0&&(e[v._id]=v)}}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 uz={node:1,duration:1,easing:1,onFinish:1,yoyo:1},dz=1,w5=2,E5=3,T5=["fill","stroke","shadowColor"];let fz=0;class hz{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=w5,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=E5,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===w5?this.setTime(e):this.state===E5&&this.setTime(this.duration-e)}pause(){this.state=dz,this.fire("onPause")}getTimer(){return new Date().getTime()}}class _n{constructor(e){const n=this,s=e.node,i=s._id,o=e.easing||Sm.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=fz++;const y=s.getLayer()||(s instanceof De.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 hz(p,function(v){n._tweenFunc(v)},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)uz[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 v=_n.tweens[i][e];v&&delete _n.attrs[i][v][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 C=ee.colorToRGBA(b[_]);y=ee.colorToRGBA(n[_]),b[_]=C,o.push({r:y.r-C.r,g:y.g-C.g,b:y.b-C.b,a:y.a-C.a})}else for(let _=0;_<d;_++)o.push(n[_]-b[_]);else T5.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,v,b;for(i in s){if(o=s[i],d=o.start,f=o.diff,b=o.end,ee._isArray(d))if(p=[],v=Math.max(d.length,b.length),i.indexOf("fill")===0)for(y=0;y<v;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<v;y++)p.push((d[y]||0)+f[y]*e);else T5.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={};Ae.prototype.to=function(t){const e=t.onFinish;t.node=this,t.onFinish=function(){this.destroy(),e&&e()},new _n(t).play()};const Sm={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-Sm.BounceEaseOut(s-t,0,n,s)+e},BounceEaseInOut(t,e,n,s){return t<s/2?Sm.BounceEaseIn(t*2,0,n,s)*.5+e:Sm.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}},ah=ee._assign(De,{Util:ee,Transform:jr,Node:Ae,Container:Cr,Stage:ry,stages:bm,Layer:id,FastLayer:Ov,Group:nh,DD:Yt,Shape:Ee,shapes:vm,Animation:si,Tween:_n,Easings:Sm,Context:ay,Canvas:wv});class mo extends Ee{_sceneFunc(e){const n=De.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=De.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),v=d*n,b=f*(f>0?e:n),_=p*(p>0?n:e);return{x:y,y:s?-1*_:b,width:v-y,height:_-b}}}mo.prototype._centroid=!0;mo.prototype.className="Arc";mo.prototype._attrsAffectingSize=["innerRadius","outerRadius","angle","clockwise"];$n(mo);K.addGetterSetter(mo,"innerRadius",0,Re());K.addGetterSetter(mo,"outerRadius",0,Re());K.addGetterSetter(mo,"angle",0,Re());K.addGetterSetter(mo,"clockwise",!1,Oi());function Ob(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),v=d*p/(f+p),b=n-y*(i-t),_=s-y*(o-e),C=n+v*(i-t),w=s+v*(o-e);return[b,_,C,w]}function R5(t,e){const n=t.length,s=[];for(let i=2;i<n-2;i+=2){const o=Ob(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 pz(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 Ee{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():R5(this.points(),this.tension())}_getTensionPointsClosed(){const e=this.points(),n=e.length,s=this.tension(),i=Ob(e[n-2],e[n-1],e[0],e[1],e[2],e[3],s),o=Ob(e[n-4],e[n-3],e[n-2],e[n-1],e[0],e[1],s),d=R5(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],...pz(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"];$n(go);K.addGetterSetter(go,"closed",!1);K.addGetterSetter(go,"bezier",!1);K.addGetterSetter(go,"tension",0,Re());K.addGetterSetter(go,"points",[],OD());const mz=[[],[],[-.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]],gz=[[],[],[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]],yz=[[1],[1,1],[1,2,1],[1,3,3,1]],O5=(t,e,n)=>{let s,i;const d=n/2;s=0;for(let f=0;f<20;f++)i=d*mz[20][f]+d,s+=gz[20][f]*xz(t,e,i);return d*s},M5=(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 v=p/(2*f),b=y/f,_=n+v,C=b-v*v,w=_*_+C>0?Math.sqrt(_*_+C):0,R=v*v+C>0?Math.sqrt(v*v+C):0,O=v+Math.sqrt(v*v+C)!==0?C*Math.log(Math.abs((_+w)/(v+R))):0;return Math.sqrt(f)/2*(_*w-v*R+O)};function xz(t,e,n){const s=Mb(1,n,t),i=Mb(1,n,e),o=s*s+i*i;return Math.sqrt(o)}const Mb=(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+=yz[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 Mb(t-1,e,i)}},A5=(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),v=Math.abs(t-y)/e;v<s?(s=v,i-=o):o/=2}if(d++,d>500)break}return i};class jn extends Ee{constructor(e){super(e),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=jn.parsePathData(this.data()),this.pathLength=jn.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],v=d[3],b=d[4],_=d[5],C=d[6],w=d[7],R=y>v?y:v,O=y>v?1:y/v,T=y>v?v/y:1;e.translate(f,p),e.rotate(C),e.scale(O,T),e.arc(0,0,R,b,b+_,1-w),e.scale(1/O,1/T),e.rotate(-C),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],v=p.points[5],b=p.points[4]+v;let _=Math.PI/180;if(Math.abs(y-b)<_&&(_=Math.abs(y-b)),v<0)for(let C=y-_;C>b;C-=_){const w=jn.getPointOnEllipticalArc(p.points[0],p.points[1],p.points[2],p.points[3],C,0);e.push(w.x,w.y)}else for(let C=y+_;C<b;C+=_){const w=jn.getPointOnEllipticalArc(p.points[0],p.points[1],p.points[2],p.points[3],C,0);e.push(w.x,w.y)}}else if(p.command==="C")for(let y=0;y<=1;y+=.01){const v=jn.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(v.x,v.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 jn.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 jn.getPointOnLine(e,d.start.x,d.start.y,f[0],f[1]);case"C":return jn.getPointOnCubicBezier(A5(e,jn.getPathLength(n),R=>O5([d.start.x,f[0],f[2],f[4]],[d.start.y,f[1],f[3],f[5]],R)),d.start.x,d.start.y,f[0],f[1],f[2],f[3],f[4],f[5]);case"Q":return jn.getPointOnQuadraticBezier(A5(e,jn.getPathLength(n),R=>M5([d.start.x,f[0],f[2]],[d.start.y,f[1],f[3]],R)),d.start.x,d.start.y,f[0],f[1],f[2],f[3]);case"A":const p=f[0],y=f[1],v=f[2],b=f[3],_=f[5],C=f[6];let w=f[4];return w+=_*e/d.pathLength,jn.getPointOnEllipticalArc(p,y,v,b,w,C)}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),v=Math.sqrt(e*e/(1+y*y))*(i<n?-1:1),b=y*v;if(Math.abs(f-s-y*(d-n))<1e-10)return{x:d+v,y:f+b};const _=((d-n)*(i-n)+(f-s)*(o-s))/(p*p),C=n+_*(i-n),w=s+_*(o-s),R=this.getLineLength(d,f,C,w),O=Math.sqrt(e*e-R*R),T=Math.sqrt(O*O/(1+y*y))*(i<n?-1:1),M=y*T;return{x:C+T,y:w+M}}static getPointOnCubicBezier(e,n,s,i,o,d,f,p,y){function v(O){return O*O*O}function b(O){return 3*O*O*(1-O)}function _(O){return 3*O*(1-O)*(1-O)}function C(O){return(1-O)*(1-O)*(1-O)}const w=p*v(e)+d*b(e)+i*_(e)+n*C(e),R=y*v(e)+f*b(e)+o*_(e)+s*C(e);return{x:w,y:R}}static getPointOnQuadraticBezier(e,n,s,i,o,d,f){function p(C){return C*C}function y(C){return 2*C*(1-C)}function v(C){return(1-C)*(1-C)}const b=d*p(e)+i*y(e)+n*v(e),_=f*p(e)+o*y(e)+s*v(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 v;for(let b=1;b<i.length;b++){let _=i[b],C=_.charAt(0);for(_=_.slice(1),d.length=0;v=y.exec(_);)d.push(v[0]);let w=[],R=C==="A"||C==="a"?0:-1;for(let O=0,T=d.length;O<T;O++){const M=d[O];if(M==="00"){w.push(0,0),R>=0&&(R+=2,R>=7&&(R-=7));continue}if(R>=0){if(R===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))),R+=3,R>=7&&(R-=7);continue}if(M==="11"||M==="10"||M==="01"){w.push(parseInt(M[0],10)),w.push(parseInt(M[1],10)),R+=2,R>=7&&(R-=7);continue}if(M==="0"||M==="1"){w.push(parseInt(M,10)),R+=1,R>=7&&(R-=7);continue}}else if(R===4){if(/^[01]\d+(?:\.\d+)?$/.test(M)){w.push(parseInt(M[0],10)),w.push(parseFloat(M.slice(1))),R+=2,R>=7&&(R-=7);continue}if(M==="0"||M==="1"){w.push(parseInt(M,10)),R+=1,R>=7&&(R-=7);continue}}const z=parseFloat(M);isNaN(z)?w.push(0):w.push(z),R+=1,R>=7&&(R-=7)}else{const z=parseFloat(M);isNaN(z)?w.push(0):w.push(z)}}for(;w.length>0&&!isNaN(w[0]);){let O="",T=[];const M=f,z=p;let k,P,H,L,U,V,F,re,ne,I;switch(C){case"l":f+=w.shift(),p+=w.shift(),O="L",T.push(f,p);break;case"L":f=w.shift(),p=w.shift(),T.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}}T.push(f,p),C="l";break;case"M":f=w.shift(),p=w.shift(),O="M",T.push(f,p),C="L";break;case"h":f+=w.shift(),O="L",T.push(f,p);break;case"H":f=w.shift(),O="L",T.push(f,p);break;case"v":p+=w.shift(),O="L",T.push(f,p);break;case"V":p=w.shift(),O="L",T.push(f,p);break;case"C":T.push(w.shift(),w.shift(),w.shift(),w.shift()),f=w.shift(),p=w.shift(),T.push(f,p);break;case"c":T.push(f+w.shift(),p+w.shift(),f+w.shift(),p+w.shift()),f+=w.shift(),p+=w.shift(),O="C",T.push(f,p);break;case"S":P=f,H=p,k=o[o.length-1],k.command==="C"&&(P=f+(f-k.points[2]),H=p+(p-k.points[3])),T.push(P,H,w.shift(),w.shift()),f=w.shift(),p=w.shift(),O="C",T.push(f,p);break;case"s":P=f,H=p,k=o[o.length-1],k.command==="C"&&(P=f+(f-k.points[2]),H=p+(p-k.points[3])),T.push(P,H,f+w.shift(),p+w.shift()),f+=w.shift(),p+=w.shift(),O="C",T.push(f,p);break;case"Q":T.push(w.shift(),w.shift()),f=w.shift(),p=w.shift(),T.push(f,p);break;case"q":T.push(f+w.shift(),p+w.shift()),f+=w.shift(),p+=w.shift(),O="Q",T.push(f,p);break;case"T":P=f,H=p,k=o[o.length-1],k.command==="Q"&&(P=f+(f-k.points[0]),H=p+(p-k.points[1])),f=w.shift(),p=w.shift(),O="Q",T.push(P,H,f,p);break;case"t":P=f,H=p,k=o[o.length-1],k.command==="Q"&&(P=f+(f-k.points[0]),H=p+(p-k.points[1])),f+=w.shift(),p+=w.shift(),O="Q",T.push(P,H,f,p);break;case"A":L=w.shift(),U=w.shift(),V=w.shift(),F=w.shift(),re=w.shift(),ne=f,I=p,f=w.shift(),p=w.shift(),O="A",T=this.convertEndpointToCenterParameterization(ne,I,f,p,F,re,L,U,V);break;case"a":L=w.shift(),U=w.shift(),V=w.shift(),F=w.shift(),re=w.shift(),ne=f,I=p,f+=w.shift(),p+=w.shift(),O="A",T=this.convertEndpointToCenterParameterization(ne,I,f,p,F,re,L,U,V);break}o.push({command:O||C,points:T,start:{x:M,y:z},pathLength:this.calcLength(M,z,O||C,T)})}(C==="z"||C==="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=jn;switch(s){case"L":return y.getLineLength(e,n,i[0],i[1]);case"C":return O5([e,i[0],i[2],i[4]],[n,i[1],i[3],i[5]],1);case"Q":return M5([e,i[0],i[2]],[n,i[1],i[3]],1);case"A":o=0;const v=i[4],b=i[5],_=i[4]+b;let C=Math.PI/180;if(Math.abs(v-_)<C&&(C=Math.abs(v-_)),d=y.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],v,0),b<0)for(p=v-C;p>_;p-=C)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=v+C;p<_;p+=C)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 v=y*(Math.PI/180),b=Math.cos(v)*(e-s)/2+Math.sin(v)*(n-i)/2,_=-1*Math.sin(v)*(e-s)/2+Math.cos(v)*(n-i)/2,C=b*b/(f*f)+_*_/(p*p);C>1&&(f*=Math.sqrt(C),p*=Math.sqrt(C));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 R=w*f*_/p,O=w*-p*b/f,T=(e+s)/2+Math.cos(v)*R-Math.sin(v)*O,M=(n+i)/2+Math.sin(v)*R+Math.cos(v)*O,z=function(F){return Math.sqrt(F[0]*F[0]+F[1]*F[1])},k=function(F,re){return(F[0]*re[0]+F[1]*re[1])/(z(F)*z(re))},P=function(F,re){return(F[0]*re[1]<F[1]*re[0]?-1:1)*Math.acos(k(F,re))},H=P([1,0],[(b-R)/f,(_-O)/p]),L=[(b-R)/f,(_-O)/p],U=[(-1*b-R)/f,(-1*_-O)/p];let V=P(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),[T,M,f,p,H,V,v,d]}}jn.prototype.className="Path";jn.prototype._attrsAffectingSize=["data"];$n(jn);K.addGetterSetter(jn,"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]],C=jn.calcLength(i[i.length-4],i[i.length-3],"C",_),w=jn.getPointOnQuadraticBezier(Math.min(1,1-d/C),_[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 v=(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(v),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";$n(ld);K.addGetterSetter(ld,"pointerLength",10,Re());K.addGetterSetter(ld,"pointerWidth",10,Re());K.addGetterSetter(ld,"pointerAtBeginning",!1);K.addGetterSetter(ld,"pointerAtEnding",!0);let fh=class extends Ee{_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)}};fh.prototype._centroid=!0;fh.prototype.className="Circle";fh.prototype._attrsAffectingSize=["radius"];$n(fh);K.addGetterSetter(fh,"radius",0,Re());class qc extends Ee{_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"];$n(qc);K.addComponentsGetterSetter(qc,"radius",["x","y"]);K.addGetterSetter(qc,"radiusX",0,Re());K.addGetterSetter(qc,"radiusY",0,Re());class Tr extends Ee{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"];$n(Tr);K.addGetterSetter(Tr,"cornerRadius",0,sy(4));K.addGetterSetter(Tr,"image");K.addComponentsGetterSetter(Tr,"crop",["x","y","width","height"]);K.addGetterSetter(Tr,"cropX",0,Re());K.addGetterSetter(Tr,"cropY",0,Re());K.addGetterSetter(Tr,"cropWidth",0,Re());K.addGetterSetter(Tr,"cropHeight",0,Re());const q8=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],bz="Change.konva",vz="none",Ab="up",Db="right",zb="down",kb="left",Sz=q8.length;class Mv extends nh{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<Sz;s++)e.on(q8[s]+bz,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 Ab:f=s/2,p=-1*y;break;case Db:f=s+d,p=i/2;break;case zb:f=s/2,p=i+y;break;case kb: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})}}}Mv.prototype.className="Label";$n(Mv);class od extends Ee{_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,v=0,b=0;typeof f=="number"?p=y=v=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),v=Math.min(f[3]||0,n/2,s/2)),e.beginPath(),e.moveTo(p,0),i===Ab&&(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===Db&&(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===zb&&(e.lineTo((n+o)/2,s),e.lineTo(n/2,s+d),e.lineTo((n-o)/2,s)),e.lineTo(v,s),e.arc(v,s-v,v,Math.PI/2,Math.PI,!1),i===kb&&(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===Ab?(n-=i,f+=i):o===zb?f+=i:o===kb?(e-=s*1.5,d+=s):o===Db&&(d+=s*1.5),{x:e,y:n,width:d,height:f}}}od.prototype.className="Tag";$n(od);K.addGetterSetter(od,"pointerDirection",vz);K.addGetterSetter(od,"pointerWidth",0,Re());K.addGetterSetter(od,"pointerHeight",0,Re());K.addGetterSetter(od,"cornerRadius",0,sy(4));class Wm extends Ee{_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)}}Wm.prototype.className="Rect";$n(Wm);K.addGetterSetter(Wm,"cornerRadius",0,sy(4));class Hc extends Ee{_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"];$n(Hc);K.addGetterSetter(Hc,"radius",0,Re());K.addGetterSetter(Hc,"sides",0,Re());K.addGetterSetter(Hc,"cornerRadius",0,sy(4));const D5=Math.PI*2;class cd extends Ee{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,D5,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),D5,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"];$n(cd);K.addGetterSetter(cd,"innerRadius",0,Re());K.addGetterSetter(cd,"outerRadius",0,Re());class vl extends Ee{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],v=o[i+3],b=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,y,v),e.closePath(),e.fillStrokeShape(this)),b)if(d){const _=d[n],C=s*2;e.drawImage(b,f,p,y,v,_[C+0],_[C+1],y,v)}else e.drawImage(b,f,p,y,v,0,0,y,v)}_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],v=s*2;e.rect(y[v+0],y[v+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)}}vl.prototype.className="Sprite";$n(vl);K.addGetterSetter(vl,"animation");K.addGetterSetter(vl,"animations");K.addGetterSetter(vl,"frameOffsets");K.addGetterSetter(vl,"image");K.addGetterSetter(vl,"frameIndex",0,Re());K.addGetterSetter(vl,"frameRate",17,Re());K.backCompat(vl,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});class Bc extends Ee{_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"];$n(Bc);K.addGetterSetter(Bc,"numPoints",5,Re());K.addGetterSetter(Bc,"innerRadius",0,Re());K.addGetterSetter(Bc,"outerRadius",0,Re());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",Nz="center",H8="inherit",sm="justify",_z="Change.konva",jz="2d",z5="-",B8="left",Cz="text",wz="Text",Ez="top",Tz="bottom",k5="middle",G8="normal",Rz="px ",l1=" ",Oz="right",L5="rtl",Mz="word",Az="char",U5="none",wx="…",P8=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],Dz=P8.length;function zz(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 o1;function Ex(){return o1||(o1=ee.createCanvasElement().getContext(jz),o1)}function kz(t){t.fillText(this._partialText,this._partialTextX,this._partialTextY)}function Lz(t){t.setAttr("miterLimit",2),t.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function Uz(t){return t=t||{},!t.fillLinearGradientColorStops&&!t.fillRadialGradientColorStops&&!t.fillPatternImage&&(t.fill=t.fill||"black"),t}let wn=class extends Ee{constructor(e){super(Uz(e)),this._partialTextX=0,this._partialTextY=0;for(let n=0;n<Dz;n++)this.on(P8[n]+_z,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(),v=this.direction(),b=0,_=this.align(),C=this.getWidth(),w=this.letterSpacing(),R=this.charRenderFunc(),O=this.fill(),T=this.textDecoration(),M=this.underlineOffset(),z=T.indexOf("underline")!==-1,k=T.indexOf("line-through")!==-1,P;v=v===H8?e.direction:v;let H=p/2,L=k5;if(!De.legacyTextRendering){const U=this.measureSize("M");L="alphabetic";const V=(n=U.fontBoundingBoxAscent)!==null&&n!==void 0?n:U.actualBoundingBoxAscent,F=(s=U.fontBoundingBoxDescent)!==null&&s!==void 0?s:U.actualBoundingBoxDescent;H=(V-F)/2+p/2}for(v===L5&&e.setAttr("direction",v),e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",L),e.setAttr("textAlign",B8),y===k5?b=(this.getHeight()-o*p-d*2)/2:y===Tz&&(b=this.getHeight()-o*p-d*2),e.translate(d,b+d),P=0;P<o;P++){let U=0,V=0;const F=i[P],re=F.text,ne=F.width,I=F.lastInParagraph;if(e.save(),_===Oz?U+=C-ne-d*2:_===Nz&&(U+=(C-ne-d*2)/2),z){e.save(),e.beginPath();const ce=M??(De.legacyTextRendering?Math.round(f/2):Math.round(f/4)),Y=U,$=H+V+ce;e.moveTo(Y,$);const ae=_===sm&&!I?C-d*2:ne;e.lineTo(Y+Math.round(ae),$),e.lineWidth=f/15;const je=this._getLinearGradient();e.strokeStyle=je||O,e.stroke(),e.restore()}const ie=U;if(v!==L5&&(w!==0||_===sm||R)){const ce=re.split(" ").length-1,Y=yc(re);for(let $=0;$<Y.length;$++){const ae=Y[$];if(ae===" "&&!I&&_===sm&&(U+=(C-d*2-ne)/ce),this._partialTextX=U,this._partialTextY=H+V,this._partialText=ae,R){e.save();const he=i.slice(0,P).reduce((W,fe)=>W+yc(fe.text).length,0),G=$+he;R({char:ae,index:G,x:U,y:H+V,lineIndex:P,column:$,isLastInLine:I,width:this.measureSize(ae).width,context:e})}e.fillStrokeShape(this),R&&e.restore(),U+=this.measureSize(ae).width+w}}else w!==0&&e.setAttr("letterSpacing",`${w}px`),this._partialTextX=U,this._partialTextY=H+V,this._partialText=re,e.fillStrokeShape(this);if(k){e.save(),e.beginPath();const ce=De.legacyTextRendering?0:-Math.round(f/4),Y=ie;e.moveTo(Y,H+V+ce);const $=_===sm&&!I?C-d*2:ne;e.lineTo(Y+Math.round($),H+V+ce),e.lineWidth=f/15;const ae=this._getLinearGradient();e.strokeStyle=ae||O,e.stroke(),e.restore()}e.restore(),o>1&&(H+=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(Cz,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,v,b,_;let C=Ex(),w=this.fontSize(),R;C.save(),C.font=this._getContextFont(),R=C.measureText(e),C.restore();const O=w/100;return{actualBoundingBoxAscent:(n=R.actualBoundingBoxAscent)!==null&&n!==void 0?n:71.58203125*O,actualBoundingBoxDescent:(s=R.actualBoundingBoxDescent)!==null&&s!==void 0?s:0,actualBoundingBoxLeft:(i=R.actualBoundingBoxLeft)!==null&&i!==void 0?i:-7.421875*O,actualBoundingBoxRight:(o=R.actualBoundingBoxRight)!==null&&o!==void 0?o:75.732421875*O,alphabeticBaseline:(d=R.alphabeticBaseline)!==null&&d!==void 0?d:0,emHeightAscent:(f=R.emHeightAscent)!==null&&f!==void 0?f:100*O,emHeightDescent:(p=R.emHeightDescent)!==null&&p!==void 0?p:-20*O,fontBoundingBoxAscent:(y=R.fontBoundingBoxAscent)!==null&&y!==void 0?y:91*O,fontBoundingBoxDescent:(v=R.fontBoundingBoxDescent)!==null&&v!==void 0?v:21*O,hangingBaseline:(b=R.hangingBaseline)!==null&&b!==void 0?b:72.80000305175781*O,ideographicBaseline:(_=R.ideographicBaseline)!==null&&_!==void 0?_:-21*O,width:R.width,height:w}}_getContextFont(){return this.fontStyle()+l1+this.fontVariant()+l1+(this.fontSize()+Rz)+zz(this.fontFamily())}_addTextLine(e){this.align()===sm&&(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 Ex().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(),v=o-y*2,b=d-y*2,_=0,C=this.wrap(),w=C!==U5,R=C!==Az&&w,O=this.ellipsis();this.textArr=[],Ex().font=this._getContextFont();const T=O?this._getTextWidth(wx):0;for(let M=0,z=e.length;M<z;++M){let k=e[M],P=this._getTextWidth(k);if(f&&P>v)for(;k.length>0;){let H=0,L=yc(k).length,U="",V=0;for(;H<L;){const F=H+L>>>1,re=yc(k),ne=re.slice(0,F+1).join(""),I=this._getTextWidth(ne);(O&&p&&_+i>b?I+T:I)<=v?(H=F+1,U=ne,V=I):L=F}if(U){if(R){const ne=yc(k),I=yc(U),ie=ne[I.length],ce=ie===l1||ie===z5;let Y;if(ce&&V<=v)Y=I.length;else{const $=I.lastIndexOf(l1),ae=I.lastIndexOf(z5);Y=Math.max($,ae)+1}Y>0&&(H=Y,U=ne.slice(0,H).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(H).join("").trimLeft(),k.length>0&&(P=this._getTextWidth(k),P<=v)){this._addTextLine(k),_+=i,s=Math.max(s,P);break}}else break}else this._addTextLine(k),_+=i,s=Math.max(s,P),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()!==U5)||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+wx)<i||(d.text=d.text.slice(0,d.text.length-3))),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(d.text+wx))}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=kz;wn.prototype._strokeFunc=Lz;wn.prototype.className=wz;wn.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];$n(wn);K.overWriteSetter(wn,"width",Tv());K.overWriteSetter(wn,"height",Tv());K.addGetterSetter(wn,"direction",H8);K.addGetterSetter(wn,"fontFamily","Arial");K.addGetterSetter(wn,"fontSize",12,Re());K.addGetterSetter(wn,"fontStyle",G8);K.addGetterSetter(wn,"fontVariant",G8);K.addGetterSetter(wn,"padding",0,Re());K.addGetterSetter(wn,"align",B8);K.addGetterSetter(wn,"verticalAlign",Ez);K.addGetterSetter(wn,"lineHeight",1,Re());K.addGetterSetter(wn,"wrap",Mz);K.addGetterSetter(wn,"ellipsis",!1,Oi());K.addGetterSetter(wn,"letterSpacing",0,Re());K.addGetterSetter(wn,"text","",rd());K.addGetterSetter(wn,"textDecoration","");K.addGetterSetter(wn,"underlineOffset",void 0,Re());K.addGetterSetter(wn,"charRenderFunc",void 0);const qz="",Y8="normal";function V8(t){t.fillText(this.partialText,0,0)}function Q8(t){t.strokeText(this.partialText,0,0)}class Ua extends Ee{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 jn.getPathLength(this.dataArray)}_getPointAtLength(e){if(!this.attrs.data)return null;const n=this.pathLength;return e>n?null:jn.getPointAtLengthOfDataArray(e,this.dataArray)}_readDataAttribute(){this.dataArray=jn.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 C=0;C<e.length;C++)n.push({char:e[C],width:this._getTextSize(e[C]).width}),s+=n[C].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),v=Math.max(this.textWidth+((this.attrs.text||"").length-1)*d,0);let b=0;f==="center"&&(b=Math.max(0,this.pathLength/2-v/2)),f==="right"&&(b=Math.max(0,this.pathLength-v));let _=b;for(let C=0;C<n.length;C++){const w=this._getPointAtLength(_);if(!w)return;const R=n[C].char;let O=n[C].width+d;if(R===" "&&f==="justify"){const L=this.text().split(" ").length-1;O+=(this.pathLength-v)/L}const T=_+O,M=this._getPointAtLength(T>this.pathLength&&T-this.pathLength<=y?this.pathLength:T);if(!M)return;const z=jn.getLineLength(w.x,w.y,M.x,M.y);let k=0;if(p)try{k=p(n[C-1].char,R)*this.fontSize()}catch{k=0}w.x+=k,M.x+=k,this.textWidth+=k;const P=jn.getPointOnLine(k+z/2,w.x,w.y,M.x,M.y),H=Math.atan2(M.y-w.y,M.x-w.x);this.glyphInfo.push({transposeX:P.x,transposeY:P.y,text:e[C],rotation:H,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=V8;Ua.prototype._strokeFunc=Q8;Ua.prototype._fillFuncHit=V8;Ua.prototype._strokeFuncHit=Q8;Ua.prototype.className="TextPath";Ua.prototype._attrsAffectingSize=["text","fontSize","data"];$n(Ua);K.addGetterSetter(Ua,"data");K.addGetterSetter(Ua,"fontFamily","Arial");K.addGetterSetter(Ua,"fontSize",12,Re());K.addGetterSetter(Ua,"fontStyle",Y8);K.addGetterSetter(Ua,"align","left");K.addGetterSetter(Ua,"letterSpacing",0,Re());K.addGetterSetter(Ua,"textBaseline","middle");K.addGetterSetter(Ua,"fontVariant",Y8);K.addGetterSetter(Ua,"text",qz);K.addGetterSetter(Ua,"textDecoration","");K.addGetterSetter(Ua,"kerningFunc",void 0);const K8="tr-konva",Hz=["resizeEnabledChange","rotateAnchorOffsetChange","rotateAnchorAngleChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(t=>t+`.${K8}`).join(" "),q5="nodesRect",Bz=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange","draggableChange"],Gz={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},Pz="ontouchstart"in De._global;function Yz(t,e,n){if(t==="rotater")return n;e+=ee.degToRad(Gz[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 Vz(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 X8(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 Qz(t,e){const n=Vz(t);return X8(t,e,n)}function Kz(t,e,n){let s=e;for(let i=0;i<t.length;i++){const o=De.getAngle(t[i]),d=Math.abs(o-e)%(Math.PI*2);Math.min(d,Math.PI*2-d)<n&&(s=o)}return s}let Lb=0;class Lt extends nh{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(Hz,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 K8+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(Bz.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(q5),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(q5,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=(De.getAngle(e.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),v={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 X8(v,-De.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 v=y.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),b=[{x:v.x,y:v.y},{x:v.x+v.width,y:v.y},{x:v.x+v.width,y:v.y+v.height},{x:v.x,y:v.y+v.height}],_=y.getAbsoluteTransform();b.forEach(function(C){const w=_.point(C);n.push(w)})});const s=new jr;s.rotate(-De.getAngle(this.rotation()));let i=1/0,o=1/0,d=-1/0,f=-1/0;n.forEach(function(y){const v=s.point(y);i===void 0&&(i=d=v.x,o=f=v.y),i=Math.min(i,v.x),o=Math.min(o,v.y),d=Math.max(d,v.x),f=Math.max(f,v.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:De.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 Wm({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:e+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:Pz?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=De.getAngle(this.rotation()),o=this.rotateAnchorCursor(),d=Yz(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 Ee({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(),v=ee.degToRad(p),b=Math.sin(v),_=-Math.cos(v),C=d/2,w=f/2;let R=1/0;_<0?R=Math.min(R,-w/_):_>0&&(R=Math.min(R,(f-w)/_)),b<0?R=Math.min(R,-C/b):b>0&&(R=Math.min(R,(d-C)/b));const O=C+b*R,T=w+_*R,M=ee._sign(f),z=O+b*y*M,k=T+_*y*M;n.moveTo(O,T),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},Lb++,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 v=o.getAbsolutePosition();if(y.x===v.x&&y.y===v.y)return;if(this._movingAnchorName==="rotater"){const M=this._getNodeRect();n=o.x()-M.width/2,s=-o.y()+M.height/2;const z=De.getAngle(this.rotateAnchorAngle());let k=Math.atan2(-s,n)+Math.PI/2-z;M.height<0&&(k-=Math.PI);const H=De.getAngle(this.rotation())+k,L=De.getAngle(this.rotationSnapTolerance()),V=Kz(this.rotationSnaps(),H,L)-M.rotation,F=Qz(M,V);this._fitNodesInto(F,e);return}const b=this.shiftBehavior();let _;b==="inverted"?_=this.keepRatio()&&!e.shiftKey:b==="none"?_=this.keepRatio():_=this.keepRatio()||e.shiftKey;let C=this.centeredScaling()||e.altKey;if(this._movingAnchorName==="top-left"){if(_){const M=C?{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=C?{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=C?{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=C?{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(C=this.centeredScaling()||e.altKey,C){const M=this.findOne(".top-left"),z=this.findOne(".bottom-right"),k=M.x(),P=M.y(),H=this.getWidth()-z.x(),L=this.getHeight()-z.y();z.move({x:-k,y:-P}),M.move({x:H,y:L})}const R=this.findOne(".top-left").getAbsolutePosition();n=R.x,s=R.y;const O=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),T=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:n,y:s,width:O,height:T,rotation:De.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();Lb--,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 jr;if(o.rotate(De.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 jr;f.translate(s.x,s.y),f.rotate(s.rotation),f.scale(s.width/d,s.height/d);const p=new jr,y=e.width/d,v=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(v))):(p.translate(e.x,e.y),p.rotate(e.rotation),p.scale(y,v));const b=p.multiply(f.invert());this._nodes.forEach(_=>{var C;if(!_.getStage())return;const w=_.getParent().getAbsoluteTransform(),R=_.getTransform().copy();R.translate(_.offsetX(),_.offsetY());const O=new jr;O.multiply(w.copy().invert()).multiply(b).multiply(w).multiply(R);const T=O.decompose();_.setAttrs(T),(C=_.getLayer())===null||C===void 0||C.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(H=>{H.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 v=this.rotateAnchorAngle(),b=this.rotateAnchorOffset(),_=ee.degToRad(v),C=Math.sin(_),w=-Math.cos(_),R=s/2,O=i/2;let T=1/0;w<0?T=Math.min(T,-O/w):w>0&&(T=Math.min(T,(i-O)/w)),C<0?T=Math.min(T,-R/C):C>0&&(T=Math.min(T,(s-R)/C));const M=R+C*T,z=O+w*T,k=ee._sign(i);this._batchChangeChild(".rotater",{x:M+C*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(H=>H.draggable()),x:0,y:0});const P=this.anchorStyleFunc();P&&y.forEach(H=>{P(H)}),(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=""),nh.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 Ae.prototype.toObject.call(this)}clone(e){return Ae.prototype.clone.call(this,e)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}Lt.isTransforming=()=>Lb>0;function Xz(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";$n(Lt);K.addGetterSetter(Lt,"enabledAnchors",D1,Xz);K.addGetterSetter(Lt,"flipEnabled",!0,Oi());K.addGetterSetter(Lt,"resizeEnabled",!0);K.addGetterSetter(Lt,"anchorSize",10,Re());K.addGetterSetter(Lt,"rotateEnabled",!0);K.addGetterSetter(Lt,"rotateLineVisible",!0);K.addGetterSetter(Lt,"rotationSnaps",[]);K.addGetterSetter(Lt,"rotateAnchorOffset",50,Re());K.addGetterSetter(Lt,"rotateAnchorAngle",0,Re());K.addGetterSetter(Lt,"rotateAnchorCursor","crosshair");K.addGetterSetter(Lt,"rotationSnapTolerance",5,Re());K.addGetterSetter(Lt,"borderEnabled",!0);K.addGetterSetter(Lt,"anchorStroke","rgb(0, 161, 255)");K.addGetterSetter(Lt,"anchorStrokeWidth",1,Re());K.addGetterSetter(Lt,"anchorFill","white");K.addGetterSetter(Lt,"anchorCornerRadius",0,Re());K.addGetterSetter(Lt,"borderStroke","rgb(0, 161, 255)");K.addGetterSetter(Lt,"borderStrokeWidth",1,Re());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,Re());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 Ee{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.radius(),0,De.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"];$n(yo);K.addGetterSetter(yo,"radius",0,Re());K.addGetterSetter(yo,"angle",0,Re());K.addGetterSetter(yo,"clockwise",!1);K.backCompat(yo,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});function H5(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}const Fz=[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],Zz=[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 Jz(t,e){const n=t.data,s=t.width,i=t.height;let o,d,f,p,y,v,b,_,C,w,R,O,T,M,z,k,P,H,L,U;const V=e+e+1,F=s-1,re=i-1,ne=e+1,I=ne*(ne+1)/2,ie=new H5,ce=Fz[e],Y=Zz[e];let $=null,ae=ie,je=null,he=null;for(let G=1;G<V;G++)ae=ae.next=new H5,G===ne&&($=ae);ae.next=ie,f=d=0;for(let G=0;G<i;G++){O=T=M=z=p=y=v=b=0,_=ne*(k=n[d]),C=ne*(P=n[d+1]),w=ne*(H=n[d+2]),R=ne*(L=n[d+3]),p+=I*k,y+=I*P,v+=I*H,b+=I*L,ae=ie;for(let W=0;W<ne;W++)ae.r=k,ae.g=P,ae.b=H,ae.a=L,ae=ae.next;for(let W=1;W<ne;W++)o=d+((F<W?F:W)<<2),p+=(ae.r=k=n[o])*(U=ne-W),y+=(ae.g=P=n[o+1])*U,v+=(ae.b=H=n[o+2])*U,b+=(ae.a=L=n[o+3])*U,O+=k,T+=P,M+=H,z+=L,ae=ae.next;je=ie,he=$;for(let W=0;W<s;W++)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]=(v*ce>>Y)*L):n[d]=n[d+1]=n[d+2]=0,p-=_,y-=C,v-=w,b-=R,_-=je.r,C-=je.g,w-=je.b,R-=je.a,o=f+((o=W+e+1)<F?o:F)<<2,O+=je.r=n[o],T+=je.g=n[o+1],M+=je.b=n[o+2],z+=je.a=n[o+3],p+=O,y+=T,v+=M,b+=z,je=je.next,_+=k=he.r,C+=P=he.g,w+=H=he.b,R+=L=he.a,O-=k,T-=P,M-=H,z-=L,he=he.next,d+=4;f+=s}for(let G=0;G<s;G++){T=M=z=O=y=v=b=p=0,d=G<<2,_=ne*(k=n[d]),C=ne*(P=n[d+1]),w=ne*(H=n[d+2]),R=ne*(L=n[d+3]),p+=I*k,y+=I*P,v+=I*H,b+=I*L,ae=ie;for(let fe=0;fe<ne;fe++)ae.r=k,ae.g=P,ae.b=H,ae.a=L,ae=ae.next;let W=s;for(let fe=1;fe<=e;fe++)d=W+G<<2,p+=(ae.r=k=n[d])*(U=ne-fe),y+=(ae.g=P=n[d+1])*U,v+=(ae.b=H=n[d+2])*U,b+=(ae.a=L=n[d+3])*U,O+=k,T+=P,M+=H,z+=L,ae=ae.next,fe<re&&(W+=s);d=G,je=ie,he=$;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]=(v*ce>>Y)*L):n[o]=n[o+1]=n[o+2]=0,p-=_,y-=C,v-=w,b-=R,_-=je.r,C-=je.g,w-=je.b,R-=je.a,o=G+((o=fe+ne)<re?o:re)*s<<2,p+=O+=je.r=n[o],y+=T+=je.g=n[o+1],v+=M+=je.b=n[o+2],b+=z+=je.a=n[o+3],je=je.next,_+=k=he.r,C+=P=he.g,w+=H=he.b,R+=L=he.a,O-=k,T-=P,M-=H,z-=L,he=he.next,d+=s}}const Iz=function(e){const n=Math.round(this.blurRadius());n>0&&Jz(e,n)};K.addGetterSetter(Ae,"blurRadius",0,Re(),K.afterSetFilter);const Wz=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(Ae,"brightness",0,Re(),K.afterSetFilter);const $z=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)},ek=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(Ae,"contrast",0,Re(),K.afterSetFilter);const tk=function(t){var e,n,s,i,o,d,f,p,y;const v=t.data,b=t.width,_=t.height,C=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,T=!!((y=(p=this.embossBlend)===null||p===void 0?void 0:p.call(this))!==null&&y!==void 0&&y),M=C*10,z=w*255,k=O*Math.PI/180,P=Math.cos(k),H=Math.sin(k),L=128/1020*M,U=new Uint8ClampedArray(v),V=new Float32Array(b*_);for(let ie=0,ce=0;ce<v.length;ce+=4,ie++)V[ie]=.2126*U[ce]+.7152*U[ce+1]+.0722*U[ce+2];const F=[-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],I=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]]*F[0],ae+=V[Y+ne[0]]*re[0],$+=V[Y+ne[1]]*F[1],ae+=V[Y+ne[1]]*re[1],$+=V[Y+ne[2]]*F[2],ae+=V[Y+ne[2]]*re[2],$+=V[Y+ne[3]]*F[3],ae+=V[Y+ne[3]]*re[3],$+=V[Y+ne[5]]*F[5],ae+=V[Y+ne[5]]*re[5],$+=V[Y+ne[6]]*F[6],ae+=V[Y+ne[6]]*re[6],$+=V[Y+ne[7]]*F[7],ae+=V[Y+ne[7]]*re[7],$+=V[Y+ne[8]]*F[8],ae+=V[Y+ne[8]]*re[8];const je=P*$+H*ae,he=I(z+je*L),G=Y*4;if(T){const W=he-z;v[G]=I(U[G]+W),v[G+1]=I(U[G+1]+W),v[G+2]=I(U[G+2]+W),v[G+3]=U[G+3]}else v[G]=v[G+1]=v[G+2]=he,v[G+3]=U[G+3]}for(let ie=0;ie<b;ie++){let ce=ie*4,Y=((_-1)*b+ie)*4;v[ce]=U[ce],v[ce+1]=U[ce+1],v[ce+2]=U[ce+2],v[ce+3]=U[ce+3],v[Y]=U[Y],v[Y+1]=U[Y+1],v[Y+2]=U[Y+2],v[Y+3]=U[Y+3]}for(let ie=1;ie<_-1;ie++){let ce=ie*b*4,Y=(ie*b+(b-1))*4;v[ce]=U[ce],v[ce+1]=U[ce+1],v[ce+2]=U[ce+2],v[ce+3]=U[ce+3],v[Y]=U[Y],v[Y+1]=U[Y+1],v[Y+2]=U[Y+2],v[Y+3]=U[Y+3]}return t};K.addGetterSetter(Ae,"embossStrength",.5,Re(),K.afterSetFilter);K.addGetterSetter(Ae,"embossWhiteLevel",.5,Re(),K.afterSetFilter);K.addGetterSetter(Ae,"embossDirection","top-left",void 0,K.afterSetFilter);K.addGetterSetter(Ae,"embossBlend",!1,void 0,K.afterSetFilter);function Tx(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 nk=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],v=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>v&&(v=b);i===s&&(i=255,s=0),f===d&&(f=255,d=0),v===y&&(v=255,y=0);let C,w,R,O,T,M;if(_>0)C=i+_*(255-i),w=s-_*(s-0),R=f+_*(255-f),O=d-_*(d-0),T=v+_*(255-v),M=y-_*(y-0);else{const z=(i+s)*.5;C=i+_*(i-z),w=s+_*(s-z);const k=(f+d)*.5;R=f+_*(f-k),O=d+_*(d-k);const P=(v+y)*.5;T=v+_*(v-P),M=y+_*(y-P)}for(let z=0;z<n;z+=4)e[z+0]=Tx(e[z+0],s,i,w,C),e[z+1]=Tx(e[z+1],d,f,O,R),e[z+2]=Tx(e[z+2],y,v,M,T)};K.addGetterSetter(Ae,"enhance",0,Re(),K.afterSetFilter);const ak=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(Ae,"hue",0,Re(),K.afterSetFilter);K.addGetterSetter(Ae,"saturation",0,Re(),K.afterSetFilter);K.addGetterSetter(Ae,"luminance",0,Re(),K.afterSetFilter);const sk=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,v=.587*s-.587*f+.33*p,b=.114*s-.114*f-.497*p,_=.299*s-.299*f-.328*p,C=.587*s+.413*f+.035*p,w=.114*s-.114*f+.293*p,R=.299*s-.3*f+1.25*p,O=.587*s-.586*f-1.05*p,T=.114*s+.886*f-.2*p;let M,z,k,P;for(let H=0;H<n;H+=4)M=e[H+0],z=e[H+1],k=e[H+2],P=e[H+3],e[H+0]=y*M+v*z+b*k+d,e[H+1]=_*M+C*z+w*k+d,e[H+2]=R*M+O*z+T*k+d,e[H+3]=P},rk=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,v=.114*s-.114*d-.497*f,b=.299*s-.299*d-.328*f,_=.587*s+.413*d+.035*f,C=.114*s-.114*d+.293*f,w=.299*s-.3*d+1.25*f,R=.587*s-.586*d-1.05*f,O=.114*s+.886*d-.2*f;for(let T=0;T<n;T+=4){const M=e[T+0],z=e[T+1],k=e[T+2],P=e[T+3];e[T+0]=p*M+y*z+v*k,e[T+1]=b*M+_*z+C*k,e[T+2]=w*M+R*z+O*k,e[T+3]=P}};K.addGetterSetter(Ae,"hue",0,Re(),K.afterSetFilter);K.addGetterSetter(Ae,"saturation",0,Re(),K.afterSetFilter);K.addGetterSetter(Ae,"value",0,Re(),K.afterSetFilter);const ik=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]},lk=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),v=o-f,b=d-p;const _=Math.sqrt(v*v+b*b);y=_>y?_:y;const C=d,w=o,R=360/w*Math.PI/180;for(let O=0;O<w;O+=1){const T=Math.sin(O*R),M=Math.cos(O*R);for(let z=0;z<C;z+=1){v=Math.floor(f+y*z/C*M),b=Math.floor(p+y*z/C*T);let k=(b*o+v)*4;const P=s[k+0],H=s[k+1],L=s[k+2],U=s[k+3];k=(O+z*o)*4,i[k+0]=P,i[k+1]=H,i[k+2]=L,i[k+3]=U}}},ok=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),v=o-f,b=d-p;const _=Math.sqrt(v*v+b*b);y=_>y?_:y;const C=d,w=o,R=0;let O,T;for(v=0;v<o;v+=1)for(b=0;b<d;b+=1){const M=v-f,z=b-p,k=Math.sqrt(M*M+z*z)*C/y;let P=(Math.atan2(z,M)*180/Math.PI+360+R)%360;P=P*w/360,O=Math.floor(P),T=Math.floor(k);let H=(T*o+O)*4;const L=s[H+0],U=s[H+1],V=s[H+2],F=s[H+3];H=(b*o+v)*4,i[H+0]=L,i[H+1]=U,i[H+2]=V,i[H+3]=F}},ck=function(t){const e=t.width,n=t.height;let s,i,o,d,f,p,y,v,b,_,C=Math.round(this.kaleidoscopePower());const w=Math.round(this.kaleidoscopeAngle()),R=Math.floor(e*(w%360)/360);if(C<1)return;const O=ee.createCanvasElement();O.width=e,O.height=n;const T=O.getContext("2d").getImageData(0,0,e,n);ee.releaseCanvas(O),lk(t,T,{polarCenterX:e/2,polarCenterY:n/2});let M=e/Math.pow(2,C);for(;M<=8;)M=M*2,C-=1;M=Math.ceil(M);let z=M,k=0,P=z,H=1;for(R+M>e&&(k=z,P=0,H=-1),i=0;i<n;i+=1)for(s=k;s!==P;s+=H)o=Math.round(s+R)%e,b=(e*i+o)*4,f=T.data[b+0],p=T.data[b+1],y=T.data[b+2],v=T.data[b+3],_=(e*i+s)*4,T.data[_+0]=f,T.data[_+1]=p,T.data[_+2]=y,T.data[_+3]=v;for(i=0;i<n;i+=1)for(z=Math.floor(M),d=0;d<C;d+=1){for(s=0;s<z+1;s+=1)b=(e*i+s)*4,f=T.data[b+0],p=T.data[b+1],y=T.data[b+2],v=T.data[b+3],_=(e*i+z*2-s-1)*4,T.data[_+0]=f,T.data[_+1]=p,T.data[_+2]=y,T.data[_+3]=v;z*=2}ok(T,t,{})};K.addGetterSetter(Ae,"kaleidoscopePower",2,Re(),K.afterSetFilter);K.addGetterSetter(Ae,"kaleidoscopeAngle",0,Re(),K.afterSetFilter);function c1(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 rm(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 uk(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 dk(t,e){const n=c1(t,0,0),s=c1(t,t.width-1,0),i=c1(t,0,t.height-1),o=c1(t,t.width-1,t.height-1),d=e||10;if(rm(n,s)<d&&rm(s,o)<d&&rm(o,i)<d&&rm(i,n)<d){const f=uk([s,n,o,i]),p=[];for(let y=0;y<t.width*t.height;y++){const v=rm(f,[t.data[y*4],t.data[y*4+1],t.data[y*4+2]]);p[y]=v<d?0:255}return p}}function fk(t,e){for(let n=0;n<t.width*t.height;n++)t.data[4*n+3]=e[n]}function hk(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 v=0;for(let b=0;b<i;b++)for(let _=0;_<i;_++){const C=f+b-o,w=p+_-o;if(C>=0&&C<n&&w>=0&&w<e){const R=C*e+w,O=s[b*i+_];v+=t[R]*O}}d[y]=v===2040?255:0}return d}function pk(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 v=0;for(let b=0;b<i;b++)for(let _=0;_<i;_++){const C=f+b-o,w=p+_-o;if(C>=0&&C<n&&w>=0&&w<e){const R=C*e+w,O=s[b*i+_];v+=t[R]*O}}d[y]=v>=1020?255:0}return d}function mk(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 v=0;for(let b=0;b<i;b++)for(let _=0;_<i;_++){const C=f+b-o,w=p+_-o;if(C>=0&&C<n&&w>=0&&w<e){const R=C*e+w,O=s[b*i+_];v+=t[R]*O}}d[y]=v}return d}const gk=function(t){const e=this.threshold();let n=dk(t,e);return n&&(n=hk(n,t.width,t.height),n=pk(n,t.width,t.height),n=mk(n,t.width,t.height),fk(t,n)),t};K.addGetterSetter(Ae,"threshold",0,Re(),K.afterSetFilter);const yk=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(Ae,"noise",.2,Re(),K.afterSetFilter);const xk=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,v=0,b=0,_=0;const C=f*e,w=C+e,R=p*e,O=R+e;let T=0;for(let M=C;M<w;M+=1)if(!(M>=n))for(let z=R;z<O;z+=1){if(z>=s)continue;const k=(n*z+M)*4;y+=d[k+0],v+=d[k+1],b+=d[k+2],_+=d[k+3],T+=1}y=y/T,v=v/T,b=b/T,_=_/T;for(let M=C;M<w;M+=1)if(!(M>=n))for(let z=R;z<O;z+=1){if(z>=s)continue;const k=(n*z+M)*4;d[k+0]=y,d[k+1]=v,d[k+2]=b,d[k+3]=_}}};K.addGetterSetter(Ae,"pixelSize",8,Re(),K.afterSetFilter);const bk=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(Ae,"levels",.5,Re(),K.afterSetFilter);const vk=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(Ae,"red",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});K.addGetterSetter(Ae,"green",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});K.addGetterSetter(Ae,"blue",0,y8,K.afterSetFilter);const Sk=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(Ae,"red",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});K.addGetterSetter(Ae,"green",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});K.addGetterSetter(Ae,"blue",0,y8,K.afterSetFilter);K.addGetterSetter(Ae,"alpha",1,function(t){return this._filterUpToDate=!1,t>1?1:t<0?0:t});const Nk=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)}},_k=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},jk=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(Ae,"threshold",.5,Re(),K.afterSetFilter);ah.Util._assign(ah,{Arc:mo,Arrow:ld,Circle:fh,Ellipse:qc,Image:Tr,Label:Mv,Tag:od,Line:go,Path:jn,Rect:Wm,RegularPolygon:Hc,Ring:cd,Sprite:vl,Star:Bc,Text:wn,TextPath:Ua,Transformer:Lt,Wedge:yo,Filters:{Blur:Iz,Brightness:$z,Brighten:Wz,Contrast:ek,Emboss:tk,Enhance:nk,Grayscale:ak,HSL:sk,HSV:rk,Invert:ik,Kaleidoscope:ck,Mask:gk,Noise:yk,Pixelate:xk,Posterize:bk,RGB:vk,RGBA:Sk,Sepia:Nk,Solarize:_k,Threshold:jk}});var Rx={exports:{}},Ox={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 B5;function Ck(){return B5||(B5=1,(function(t){t.exports=function(e){function n(l,c,g,x){return new Gh(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 j=g.return;if(j===null)break;var E=j.alternate;if(E===null){if(x=j.return,x!==null){g=x;continue}break}if(j.child===E.child){for(E=j.child;E;){if(E===g)return d(j),l;if(E===x)return d(j),c;E=E.sibling}throw Error(i(188))}if(g.return!==x.return)g=j,x=E;else{for(var q=!1,Z=j.child;Z;){if(Z===g){q=!0,g=j,x=E;break}if(Z===x){q=!0,x=j,g=E;break}Z=Z.sibling}if(!q){for(Z=E.child;Z;){if(Z===g){q=!0,g=E,x=j;break}if(Z===x){q=!0,x=E,g=j;break}Z=Z.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 v(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===Vi?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case zl:return"Fragment";case Ll:return"Profiler";case kl:return"StrictMode";case Qd:return"Suspense";case mi:return"SuspenseList";case fu:return"Activity"}if(typeof l=="object")switch(l.$$typeof){case Dl: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 Ja:c=l._payload,l=l._init;try{return b(l(c))}catch{}}return null}function _(l){return{current:l}}function C(l){0>Gl||(l.current=rf[Gl],rf[Gl]=null,Gl--)}function w(l,c){Gl++,rf[Gl]=l.current,l.current=c}function R(l){return l>>>=0,l===0?32:31-(lf(l)/g0|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 T(l,c,g){var x=l.pendingLanes;if(x===0)return 0;var j=0,E=l.suspendedLanes,q=l.pingedLanes;l=l.warmLanes;var Z=x&134217727;return Z!==0?(x=Z&~E,x!==0?j=O(x):(q&=Z,q!==0?j=O(q):g||(g=Z&~l,g!==0&&(j=O(g))))):(Z=x&~E,Z!==0?j=O(Z):q!==0?j=O(q):g||(g=x&~l,g!==0&&(j=O(g)))),j===0?0:c!==0&&c!==j&&(c&E)===0&&(E=j&-j,g=c&-c,E>=g||E===32&&(g&4194048)!==0)?c:j}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 P(l){for(var c=[],g=0;31>g;g++)c.push(l);return c}function H(l,c){l.pendingLanes|=c,c!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function L(l,c,g,x,j,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 Z=l.entanglements,ge=l.expirationTimes,Ne=l.hiddenUpdates;for(g=q&~g;0<g;){var Oe=31-ps(g),Ce=1<<Oe;Z[Oe]=0,ge[Oe]=-1;var Le=Ne[Oe];if(Le!==null)for(Ne[Oe]=null,Oe=0;Oe<Le.length;Oe++){var st=Le[Oe];st!==null&&(st.lane&=-536870913)}g&=~Ce}x!==0&&U(l,x,0),E!==0&&j===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),j=1<<x;j&c|l[x]&c&&(l[x]|=c),g&=~j}}function F(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 I(l){if(typeof wp=="function"&&b0(l),ms&&typeof ms.setStrictMode=="function")try{ms.setStrictMode(Yl,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 Ce=function(){throw Error()};if(Object.defineProperty(Ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ce,[])}catch(st){var Le=st}Reflect.construct(l,[],Ce)}else{try{Ce.call()}catch(st){Le=st}l.call(Ce.prototype)}}else{try{throw Error()}catch(st){Le=st}(Ce=l())&&typeof Ce.catch=="function"&&Ce.catch(function(){})}}catch(st){if(st&&Le&&typeof st.stack=="string")return[st.stack,Le.stack]}return[null,null]}};x.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var j=Object.getOwnPropertyDescriptor(x.DetermineComponentFrameRoot,"name");j&&j.configurable&&Object.defineProperty(x.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var E=x.DetermineComponentFrameRoot(),q=E[0],Z=E[1];if(q&&Z){var ge=q.split(`
580
+ `),Ne=Z.split(`
581
+ `);for(j=x=0;x<ge.length&&!ge[x].includes("DetermineComponentFrameRoot");)x++;for(;j<Ne.length&&!Ne[j].includes("DetermineComponentFrameRoot");)j++;if(x===ge.length||j===Ne.length)for(x=ge.length-1,j=Ne.length-1;1<=x&&0<=j&&ge[x]!==Ne[j];)j--;for(;1<=x&&0<=j;x--,j--)if(ge[x]!==Ne[j]){if(x!==1||j!==1)do if(x--,j--,0>j||ge[x]!==Ne[j]){var Oe=`
582
+ `+ge[x].replace(" at new "," at ");return l.displayName&&Oe.includes("<anonymous>")&&(Oe=Oe.replace("<anonymous>",l.displayName)),Oe}while(1<=x&&0<=j);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 je(l,c){if(typeof l=="object"&&l!==null){var g=Ep.get(l);return g!==void 0?g:(c={value:l,source:c,stack:ae(c)},Ep.set(l,c),c)}return{value:l,source:c,stack:ae(c)}}function he(l,c){bi[Kr++]=Nu,bi[Kr++]=nn,nn=l,Nu=c}function G(l,c,g){Ws[Ds++]=Ma,Ws[Ds++]=xr,Ws[Ds++]=$s,$s=l;var x=Ma;l=xr;var j=32-ps(x)-1;x&=~(1<<j),g+=1;var E=32-ps(c)+j;if(30<E){var q=j-j%5;E=(x&(1<<q)-1).toString(32),x>>=q,j-=q,Ma=1<<32-ps(c)+j|g<<j|x,xr=E+l}else Ma=1<<E|g<<j|x,xr=l}function W(l){l.return!==null&&(he(l,1),G(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 be(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=Ag(c),C(_a),w(_a,l)}function me(){C(_a),C(vi),C(Aa)}function we(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 nt(l){vi.current===l&&(C(_a),C(vi)),_u.current===l&&(C(_u),Fn?Hl._currentValue=ql:Hl._currentValue2=ql)}function ze(l){var c=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Qn(je(c,l)),pf}function Vt(l,c){if(!vn)throw Error(i(175));s0(l.stateNode,l.type,l.memoizedProps,c,l)||ze(l,!0)}function $e(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 $e(l),Nt=!0,!1;var c=l.tag;if(ua?c!==3&&c!==27&&(c!==5||Ko(l.type)&&!Ia(l.type,l.memoizedProps))&&Sn&&ze(l):c!==3&&(c!==5||Ko(l.type)&&!Ia(l.type,l.memoizedProps))&&Sn&&ze(l),$e(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=mp(l)}else if(c===31){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(i(317));Sn=i0(l)}else Sn=ua&&c===27?Jg(l.type,Sn):da?Zg(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 Qn(l){Xr===null?Xr=[l]:Xr.push(l)}function Gt(l,c,g){Fn?(w(er,c._currentValue),c._currentValue=g):(w(er,c._currentValue2),c._currentValue2=g)}function fn(l){var c=er.current;Fn?l._currentValue=c:l._currentValue2=c,C(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 Zt(l,c,g,x){var j=l.child;for(j!==null&&(j.return=l);j!==null;){var E=j.dependencies;if(E!==null){var q=j.child;E=E.firstContext;e:for(;E!==null;){var Z=E;E=j;for(var ge=0;ge<c.length;ge++)if(Z.context===c[ge]){E.lanes|=g,Z=E.alternate,Z!==null&&(Z.lanes|=g),ur(E.return,g,l),x||(q=null);break e}E=Z.next}}else if(j.tag===18){if(q=j.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=j.child;if(q!==null)q.return=j;else for(q=j;q!==null;){if(q===l){q=null;break}if(j=q.sibling,j!==null){j.return=q.return,q=j;break}q=q.return}j=q}}function Et(l,c,g,x){l=null;for(var j=c,E=!1;j!==null;){if(!E){if((j.flags&524288)!==0)E=!0;else if((j.flags&262144)!==0)break}if(j.tag===10){var q=j.alternate;if(q===null)throw Error(i(387));if(q=q.memoizedProps,q!==null){var Z=j.type;Jn(j.pendingProps.value,q.value)||(l!==null?l.push(Z):l=[Z])}}else if(j===_u.current){if(q=j.alternate,q===null)throw Error(i(387));q.memoizedState.memoizedState!==j.memoizedState.memoizedState&&(l!==null?l.push(Hl):l=[Hl])}j=j.return}l!==null&&Zt(c,l,g,x),c.flags|=262144}function qn(l){for(l=l.firstContext;l!==null;){var c=l.context;if(!Jn(Fn?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 Jt(l){return Ss(cn,l)}function Kn(l,c){return cn===null&&hn(l),Ss(l,c)}function Ss(l,c){var g=Fn?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 v0,data:new Map,refCount:0}}function Qa(l){l.refCount--,l.refCount===0&&ja(by,function(){l.controller.abort()})}function la(){}function Ea(l){l!==It&&l.next===null&&(It===null?ju=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=ju;x!==null;){if(l!==0){var j=x.pendingLanes;if(j===0)var E=0;else{var q=x.suspendedLanes,Z=x.pingedLanes;E=(1<<31-ps(42|l)+1)-1,E&=j&~(q&~Z),E=E&201326741?E&201326741|1:E?E|2:0}E!==0&&(g=!0,is(x,E))}else E=_t,E=T(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;Zi!==0&&Ul()&&(l=Zi);for(var c=Ga(),g=null,x=ju;x!==null;){var j=x.next,E=Hs(x,c);E===0?(x.next=null,g===null?ju=j:g.next=j,j===null&&(It=g)):(g=x,(l!==0||(E&3)!==0)&&(tr=!0)),x=j}sa!==0&&sa!==5||rs(l),Zi!==0&&(Zi=0)}function Hs(l,c){for(var g=l.suspendedLanes,x=l.pingedLanes,j=l.expirationTimes,E=l.pendingLanes&-62914561;0<E;){var q=31-ps(E),Z=1<<q,ge=j[q];ge===-1?((Z&g)===0||(Z&x)!==0)&&(j[q]=z(Z,c)):ge<=c&&(l.expiredLanes|=Z),E&=~Z}if(c=pt,g=_t,g=T(l,l===c?g:0,l.cancelPendingCommit!==null||l.timeoutHandle!==hs),x=l.callbackNode,g===0||l===c&&($t===2||$t===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=x0;break;case 32:g=vu;break;case 268435456:g=df;break;default:g=vu}return x=ea.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 ea(l,c){if(sa!==0&&sa!==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=T(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?ea.bind(null,l):null)}function is(l,c){if(Pr())return null;yr(l,c,!0)}function ba(){$h?ep(function(){(bt&6)!==0?bu(uf,fr):Ns()}):bu(uf,fr)}function Ta(){if(Zi===0){var l=Si;l===0&&(l=of,of<<=1,(of&261888)===0&&(of=256)),Zi=l}return Zi}function Pc(l,c){if(Fo===null){var g=Fo=[];Tp=0,Si=Ta(),fa={status:"pending",value:void 0,then:function(x){g.push(x)}}}return Tp++,c.then(Sl,Sl),c}function Sl(){if(--Tp===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(j){g.push(j)}};return l.then(function(){x.status="fulfilled",x.value=c;for(var j=0;j<g.length;j++)(0,g[j])(c)},function(j){for(x.status="rejected",x.reason=j,j=0;j<g.length;j++)(0,g[j])(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:Fn?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 j=g[x];if(!xy.call(c,j)||!Jn(l[j],c[j]))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 j=c;j.status="fulfilled",j.value=x}},function(x){if(c.status==="pending"){var j=c;j.status="rejected",j.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 Xn(){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=Vl;return Vl+=1,Ii===null&&(Ii=[]),Hn(Ii,l,c)}function oa(l,c){c=c.props.ref,l.ref=c!==void 0?c:null}function ls(l,c){throw c.$$typeof===Al?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 pe=ue.deletions;pe===null?(ue.deletions=[se],ue.flags|=16):pe.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 j(ue,se){return ue=Ms(ue,se),ue.index=0,ue.sibling=null,ue}function E(ue,se,pe){return ue.index=pe,l?(pe=ue.alternate,pe!==null?(pe=pe.index,pe<se?(ue.flags|=67108866,se):pe):(ue.flags|=67108866,se)):(ue.flags|=1048576,se)}function q(ue){return l&&ue.alternate===null&&(ue.flags|=67108866),ue}function Z(ue,se,pe,Te){return se===null||se.tag!==6?(se=Ph(pe,ue.mode,Te),se.return=ue,se):(se=j(se,pe),se.return=ue,se)}function ge(ue,se,pe,Te){var Xe=pe.type;return Xe===zl?Oe(ue,se,pe.props.children,Te,pe.key):se!==null&&(se.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===Ja&&rn(Xe)===se.type)?(se=j(se,pe.props),oa(se,pe),se.return=ue,se):(se=pi(pe.type,pe.key,pe.props,null,ue.mode,Te),oa(se,pe),se.return=ue,se)}function Ne(ue,se,pe,Te){return se===null||se.tag!==4||se.stateNode.containerInfo!==pe.containerInfo||se.stateNode.implementation!==pe.implementation?(se=Vh(pe,ue.mode,Te),se.return=ue,se):(se=j(se,pe.children||[]),se.return=ue,se)}function Oe(ue,se,pe,Te,Xe){return se===null||se.tag!==7?(se=Fs(pe,ue.mode,Te,Xe),se.return=ue,se):(se=j(se,pe),se.return=ue,se)}function Ce(ue,se,pe){if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return se=Ph(""+se,ue.mode,pe),se.return=ue,se;if(typeof se=="object"&&se!==null){switch(se.$$typeof){case Yr:return pe=pi(se.type,se.key,se.props,null,ue.mode,pe),oa(pe,se),pe.return=ue,pe;case Dl:return se=Vh(se,ue.mode,pe),se.return=ue,se;case Ja:return se=rn(se),Ce(ue,se,pe)}if(Qi(se)||v(se))return se=Fs(se,ue.mode,pe,null),se.return=ue,se;if(typeof se.then=="function")return Ce(ue,Ra(se),pe);if(se.$$typeof===Zs)return Ce(ue,Kn(ue,se),pe);ls(ue,se)}return null}function Le(ue,se,pe,Te){var Xe=se!==null?se.key:null;if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return Xe!==null?null:Z(ue,se,""+pe,Te);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case Yr:return pe.key===Xe?ge(ue,se,pe,Te):null;case Dl:return pe.key===Xe?Ne(ue,se,pe,Te):null;case Ja:return pe=rn(pe),Le(ue,se,pe,Te)}if(Qi(pe)||v(pe))return Xe!==null?null:Oe(ue,se,pe,Te,null);if(typeof pe.then=="function")return Le(ue,se,Ra(pe),Te);if(pe.$$typeof===Zs)return Le(ue,se,Kn(ue,pe),Te);ls(ue,pe)}return null}function st(ue,se,pe,Te,Xe){if(typeof Te=="string"&&Te!==""||typeof Te=="number"||typeof Te=="bigint")return ue=ue.get(pe)||null,Z(se,ue,""+Te,Xe);if(typeof Te=="object"&&Te!==null){switch(Te.$$typeof){case Yr:return ue=ue.get(Te.key===null?pe:Te.key)||null,ge(se,ue,Te,Xe);case Dl:return ue=ue.get(Te.key===null?pe:Te.key)||null,Ne(se,ue,Te,Xe);case Ja:return Te=rn(Te),st(ue,se,pe,Te,Xe)}if(Qi(Te)||v(Te))return ue=ue.get(pe)||null,Oe(se,ue,Te,Xe,null);if(typeof Te.then=="function")return st(ue,se,pe,Ra(Te),Xe);if(Te.$$typeof===Zs)return st(ue,se,pe,Kn(se,Te),Xe);ls(se,Te)}return null}function Ca(ue,se,pe,Te){for(var Xe=null,Ln=null,Ze=se,Dt=se=0,wa=null;Ze!==null&&Dt<pe.length;Dt++){Ze.index>Dt?(wa=Ze,Ze=null):wa=Ze.sibling;var Bt=Le(ue,Ze,pe[Dt],Te);if(Bt===null){Ze===null&&(Ze=wa);break}l&&Ze&&Bt.alternate===null&&c(ue,Ze),se=E(Bt,se,Dt),Ln===null?Xe=Bt:Ln.sibling=Bt,Ln=Bt,Ze=wa}if(Dt===pe.length)return g(ue,Ze),Nt&&he(ue,Dt),Xe;if(Ze===null){for(;Dt<pe.length;Dt++)Ze=Ce(ue,pe[Dt],Te),Ze!==null&&(se=E(Ze,se,Dt),Ln===null?Xe=Ze:Ln.sibling=Ze,Ln=Ze);return Nt&&he(ue,Dt),Xe}for(Ze=x(Ze);Dt<pe.length;Dt++)wa=st(Ze,ue,Dt,pe[Dt],Te),wa!==null&&(l&&wa.alternate!==null&&Ze.delete(wa.key===null?Dt:wa.key),se=E(wa,se,Dt),Ln===null?Xe=wa:Ln.sibling=wa,Ln=wa);return l&&Ze.forEach(function(ir){return c(ue,ir)}),Nt&&he(ue,Dt),Xe}function nc(ue,se,pe,Te){if(pe==null)throw Error(i(151));for(var Xe=null,Ln=null,Ze=se,Dt=se=0,wa=null,Bt=pe.next();Ze!==null&&!Bt.done;Dt++,Bt=pe.next()){Ze.index>Dt?(wa=Ze,Ze=null):wa=Ze.sibling;var ir=Le(ue,Ze,Bt.value,Te);if(ir===null){Ze===null&&(Ze=wa);break}l&&Ze&&ir.alternate===null&&c(ue,Ze),se=E(ir,se,Dt),Ln===null?Xe=ir:Ln.sibling=ir,Ln=ir,Ze=wa}if(Bt.done)return g(ue,Ze),Nt&&he(ue,Dt),Xe;if(Ze===null){for(;!Bt.done;Dt++,Bt=pe.next())Bt=Ce(ue,Bt.value,Te),Bt!==null&&(se=E(Bt,se,Dt),Ln===null?Xe=Bt:Ln.sibling=Bt,Ln=Bt);return Nt&&he(ue,Dt),Xe}for(Ze=x(Ze);!Bt.done;Dt++,Bt=pe.next())Bt=st(Ze,ue,Dt,Bt.value,Te),Bt!==null&&(l&&Bt.alternate!==null&&Ze.delete(Bt.key===null?Dt:Bt.key),se=E(Bt,se,Dt),Ln===null?Xe=Bt:Ln.sibling=Bt,Ln=Bt);return l&&Ze.forEach(function(vy){return c(ue,vy)}),Nt&&he(ue,Dt),Xe}function rl(ue,se,pe,Te){if(typeof pe=="object"&&pe!==null&&pe.type===zl&&pe.key===null&&(pe=pe.props.children),typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case Yr:e:{for(var Xe=pe.key;se!==null;){if(se.key===Xe){if(Xe=pe.type,Xe===zl){if(se.tag===7){g(ue,se.sibling),Te=j(se,pe.props.children),Te.return=ue,ue=Te;break e}}else if(se.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===Ja&&rn(Xe)===se.type){g(ue,se.sibling),Te=j(se,pe.props),oa(Te,pe),Te.return=ue,ue=Te;break e}g(ue,se);break}else c(ue,se);se=se.sibling}pe.type===zl?(Te=Fs(pe.props.children,ue.mode,Te,pe.key),Te.return=ue,ue=Te):(Te=pi(pe.type,pe.key,pe.props,null,ue.mode,Te),oa(Te,pe),Te.return=ue,ue=Te)}return q(ue);case Dl:e:{for(Xe=pe.key;se!==null;){if(se.key===Xe)if(se.tag===4&&se.stateNode.containerInfo===pe.containerInfo&&se.stateNode.implementation===pe.implementation){g(ue,se.sibling),Te=j(se,pe.children||[]),Te.return=ue,ue=Te;break e}else{g(ue,se);break}else c(ue,se);se=se.sibling}Te=Vh(pe,ue.mode,Te),Te.return=ue,ue=Te}return q(ue);case Ja:return pe=rn(pe),rl(ue,se,pe,Te)}if(Qi(pe))return Ca(ue,se,pe,Te);if(v(pe)){if(Xe=v(pe),typeof Xe!="function")throw Error(i(150));return pe=Xe.call(pe),nc(ue,se,pe,Te)}if(typeof pe.then=="function")return rl(ue,se,Ra(pe),Te);if(pe.$$typeof===Zs)return rl(ue,se,Kn(ue,pe),Te);ls(ue,pe)}return typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint"?(pe=""+pe,se!==null&&se.tag===6?(g(ue,se.sibling),Te=j(se,pe),Te.return=ue,ue=Te):(g(ue,se),Te=Ph(pe,ue.mode,Te),Te.return=ue,ue=Te),q(ue)):g(ue,se)}return function(ue,se,pe,Te){try{Vl=0;var Xe=rl(ue,se,pe,Te);return Ii=null,Xe}catch(Ze){if(Ze===ha||Ze===ar)throw Ze;var Ln=n(29,Ze,null,ue.mode);return Ln.lanes=Te,Ln.return=ue,Ln}finally{}}}function Ue(){for(var l=Zr,c=Ql=Zr=0;c<l;){var g=za[c];za[c++]=null;var x=za[c];za[c++]=null;var j=za[c];za[c++]=null;var E=za[c];if(za[c++]=null,x!==null&&j!==null){var q=x.pending;q===null?j.next=j:(j.next=q.next,q.next=j),x.pending=j}E!==0&&xt(g,j,E)}}function et(l,c,g,x){za[Zr++]=l,za[Zr++]=c,za[Zr++]=g,za[Zr++]=x,Ql|=x,l.lanes|=x,l=l.alternate,l!==null&&(l.lanes|=x)}function Ve(l,c,g,x){return et(l,c,g,x),Fe(l)}function ct(l,c){return et(l,null,null,c),Fe(l)}function xt(l,c,g){l.lanes|=g;var x=l.alternate;x!==null&&(x.lanes|=g);for(var j=!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||(j=!0)),l=E,E=E.return;return l.tag===3?(E=l.stateNode,j&&c!==null&&(j=31-ps(g),l=E.hiddenUpdates,x=l[j],x===null?l[j]=[c]:x.push(c),c.lane=g|536870912),E):null}function Fe(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 ut(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 j=x.pending;return j===null?c.next=c:(c.next=j.next,j.next=c),x.pending=c,c=Fe(l),xt(l,null,g),c}return et(l,x,c,g),Fe(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 j=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?j=E=q:E=E.next=q,g=g.next}while(g!==null);E===null?j=E=c:E=E.next=c}else j=E=c;g={baseState:x.baseState,firstBaseUpdate:j,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 j=l.updateQueue;zs=!1;var E=j.firstBaseUpdate,q=j.lastBaseUpdate,Z=j.shared.pending;if(Z!==null){j.shared.pending=null;var ge=Z,Ne=ge.next;ge.next=null,q===null?E=Ne:q.next=Ne,q=ge;var Oe=l.alternate;Oe!==null&&(Oe=Oe.updateQueue,Z=Oe.lastBaseUpdate,Z!==q&&(Z===null?Oe.firstBaseUpdate=Ne:Z.next=Ne,Oe.lastBaseUpdate=ge))}if(E!==null){var Ce=j.baseState;q=0,Oe=Ne=ge=null,Z=E;do{var Le=Z.lane&-536870913,st=Le!==Z.lane;if(st?(_t&Le)===Le:(x&Le)===Le){Le!==0&&Le===Si&&(yf=!0),Oe!==null&&(Oe=Oe.next={lane:0,tag:Z.tag,payload:Z.payload,callback:null,next:null});e:{var Ca=l,nc=Z;Le=c;var rl=g;switch(nc.tag){case 1:if(Ca=nc.payload,typeof Ca=="function"){Ce=Ca.call(rl,Ce,Le);break e}Ce=Ca;break e;case 3:Ca.flags=Ca.flags&-65537|128;case 0:if(Ca=nc.payload,Le=typeof Ca=="function"?Ca.call(rl,Ce,Le):Ca,Le==null)break e;Ce=Vd({},Ce,Le);break e;case 2:zs=!0}}Le=Z.callback,Le!==null&&(l.flags|=64,st&&(l.flags|=8192),st=j.callbacks,st===null?j.callbacks=[Le]:st.push(Le))}else st={lane:Le,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null},Oe===null?(Ne=Oe=st,ge=Ce):Oe=Oe.next=st,q|=Le;if(Z=Z.next,Z===null){if(Z=j.shared.pending,Z===null)break;st=Z,Z=st.next,st.next=null,j.lastBaseUpdate=st,j.shared.pending=null}}while(!0);Oe===null&&(ge=Ce),j.baseState=ge,j.firstBaseUpdate=Ne,j.lastBaseUpdate=Oe,E===null&&(j.shared.lanes=0),_i|=q,l.lanes=q,l.memoizedState=Ce}}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=Ir,w(Wi,l),w(Kl,c),Ir=l|c.baseLanes}function js(){w(Wi,Ir),w(Kl,Kl.current)}function Tn(){Ir=Wi.current,C(Kl),C(Wi)}function Cs(l){var c=l.alternate;w(Gn,Gn.current&1),w(gs,l),es===null&&(c===null||Kl.current!==null||c.memoizedState!==null)&&(es=l)}function ud(l){w(Gn,Gn.current),w(gs,l),es===null&&(es=l)}function Mi(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){C(gs),es===l&&(es=null),C(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||Xi(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 hh(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,j,E){return Ni=E,it=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,Qe.H=l===null||l.memoizedState===null?Dn:Jr,Rt=!1,E=g(x,j),Rt=!1,dt&&(E=Or(c,g,x,j)),Vc(l),E}function Vc(l){Qe.H=ks;var c=Ye!==null&&Ye.next!==null;if(Ni=0,tt=Ye=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 j=0;do{if(dt&&(vr=null),sr=0,dt=!1,25<=j)throw Error(i(301));if(j+=1,tt=Ye=null,l.updateQueue!=null){var E=l.updateQueue;E.lastEffect=null,E.events=null,E.stores=null,E.memoCache!=null&&(E.memoCache.index=0)}Qe.H=$i,E=c(g,x)}while(dt);return E}function Ps(){var l=Qe.H,c=l.useState()[0];return c=typeof c.then=="function"?Ha(c):c,l=l.useState()[0],(Ye!==null?Ye.memoizedState:null)!==l&&(it.flags|=1024),c}function dd(){var l=Ya!==0;return Ya=0,l}function ph(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,tt=Ye=it=null,dt=!1,sr=Ya=0,vr=null}function qa(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tt===null?it.memoizedState=tt=l:tt=tt.next=l,tt}function xn(){if(Ye===null){var l=it.alternate;l=l!==null?l.memoizedState:null}else l=Ye.next;var c=tt===null?it.memoizedState:tt.next;if(c!==null)tt=c,Ye=l;else{if(l===null)throw it.alternate===null?Error(i(467)):Error(i(310));Ye=l,l={memoizedState:Ye.memoizedState,baseState:Ye.baseState,baseQueue:Ye.baseQueue,queue:Ye.queue,next:null},tt===null?it.memoizedState=tt=l:tt=tt.next=l}return tt}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,(tt===null?c.memoizedState:tt.next)===null&&(c=c.alternate,Qe.H=c===null||c.memoizedState===null?Dn:Jr),l}function bo(l){if(l!==null&&typeof l=="object"){if(typeof l.then=="function")return Ha(l);if(l.$$typeof===Zs)return Jt(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(j){return j.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]=Kh;return c.index++,g}function gr(l,c){return typeof c=="function"?c(l):c}function li(l){var c=xn();return pd(c,Ye,l)}function pd(l,c,g){var x=l.queue;if(x===null)throw Error(i(311));x.lastRenderedReducer=g;var j=l.baseQueue,E=x.pending;if(E!==null){if(j!==null){var q=j.next;j.next=E.next,E.next=q}c.baseQueue=j=E,x.pending=null}if(E=l.baseState,j===null)l.memoizedState=E;else{c=j.next;var Z=q=null,ge=null,Ne=c,Oe=!1;do{var Ce=Ne.lane&-536870913;if(Ce!==Ne.lane?(_t&Ce)===Ce:(Ni&Ce)===Ce){var Le=Ne.revertLane;if(Le===0)ge!==null&&(ge=ge.next={lane:0,revertLane:0,gesture:null,action:Ne.action,hasEagerState:Ne.hasEagerState,eagerState:Ne.eagerState,next:null}),Ce===Si&&(Oe=!0);else if((Ni&Le)===Le){Ne=Ne.next,Le===Si&&(Oe=!0);continue}else Ce={lane:0,revertLane:Ne.revertLane,gesture:null,action:Ne.action,hasEagerState:Ne.hasEagerState,eagerState:Ne.eagerState,next:null},ge===null?(Z=ge=Ce,q=E):ge=ge.next=Ce,it.lanes|=Le,_i|=Le;Ce=Ne.action,Rt&&g(E,Ce),E=Ne.hasEagerState?Ne.eagerState:g(E,Ce)}else Le={lane:Ce,revertLane:Ne.revertLane,gesture:Ne.gesture,action:Ne.action,hasEagerState:Ne.hasEagerState,eagerState:Ne.eagerState,next:null},ge===null?(Z=ge=Le,q=E):ge=ge.next=Le,it.lanes|=Ce,_i|=Ce;Ne=Ne.next}while(Ne!==null&&Ne!==c);if(ge===null?q=E:ge.next=Z,!Jn(E,l.memoizedState)&&(mn=!0,Oe&&(g=fa,g!==null)))throw g;l.memoizedState=E,l.baseState=q,l.baseQueue=ge,x.lastRenderedState=E}return j===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,j=g.pending,E=c.memoizedState;if(j!==null){g.pending=null;var q=j=j.next;do E=l(E,q.action),q=q.next;while(q!==j);Jn(E,c.memoizedState)||(mn=!0),c.memoizedState=E,c.baseQueue===null&&(c.baseState=E),g.lastRenderedState=E}return[E,x]}function Nl(l,c,g){var x=it,j=xn(),E=Nt;if(E){if(g===void 0)throw Error(i(407));g=g()}else g=c();var q=!Jn((Ye||j).memoizedState,g);if(q&&(j.memoizedState=g,mn=!0),j=j.queue,No(gh.bind(null,x,j,l),[l]),j.getSnapshot!==c||q||tt!==null&&tt.memoizedState.tag&1){if(x.flags|=2048,Ts(9,{destroy:void 0},mh.bind(null,x,j,g,c),null),pt===null)throw Error(i(349));E||(Ni&127)!==0||$m(x,c,g)}return g}function $m(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 mh(l,c,g,x){c.value=g,c.getSnapshot=x,gd(c)&&eg(l)}function gh(l,c,g){return g(function(){gd(c)&&eg(l)})}function gd(l){var c=l.getSnapshot;l=l.value;try{var g=c();return!Jn(l,g)}catch{return!0}}function eg(l){var c=ct(l,2);c!==null&&Mn(c,l,2)}function yh(l){var c=qa();if(typeof l=="function"){var g=l;if(l=g(),Rt){I(!0);try{g()}finally{I(!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,Ye,typeof x=="function"?x:gr)}function oi(l,c,g,x,j){if(jd(l))throw Error(i(485));if(l=c.action,l!==null){var E={payload:j,action:l,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(q){E.listeners.push(q)}};Qe.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,j=l.state;if(c.isTransition){var E=Qe.T,q={};Qe.T=q;try{var Z=g(j,x),ge=Qe.S;ge!==null&&ge(q,Z),xd(l,c,Z)}catch(Ne){Ai(l,c,Ne)}finally{E!==null&&q.types!==null&&(E.types=q.types),Qe.T=E}}else try{E=g(j,x),xd(l,c,E)}catch(Ne){Ai(l,c,Ne)}}function xd(l,c,g){g!==null&&typeof g=="object"&&typeof g.then=="function"?g.then(function(x){_l(l,c,x)},function(x){return Ai(l,c,x)}):_l(l,c,g)}function _l(l,c,g){c.status="fulfilled",c.value=g,xh(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 Ai(l,c,g){var x=l.pending;if(l.pending=null,x!==null){x=x.next;do c.status="rejected",c.reason=g,xh(c),c=c.next;while(c!==x)}l.action=null}function xh(l){l=l.listeners;for(var c=0;c<l.length;c++)(0,l[c])()}function bd(l,c){return c}function bh(l,c){if(Nt){var g=pt.formState;if(g!==null){e:{var x=it;if(Nt){if(Sn){var j=Fg(Sn,Wa);if(j){Sn=Zg(j),x=dp(j);break e}}ze(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=ig.bind(null,it,x),x.dispatch=g,x=yh(!1);var E=_d.bind(null,it,!1,x.queue);return x=qa(),j={state:c,dispatch:null,action:l,pending:null},x.queue=j,g=oi.bind(null,it,j,E,g),j.dispatch=g,x.memoizedState=l,[c,g,!1]}function vo(l){var c=xn();return Mr(c,Ye,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 j=c.queue,E=j.dispatch;return g!==c.memoizedState&&(it.flags|=2048,Ts(9,{destroy:void 0},vh.bind(null,j,g),null)),[x,E,l]}function vh(l,c){l.action=c}function So(l){var c=xn(),g=Ye;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 j=qa();it.flags|=l,j.memoizedState=Ts(1|c,{destroy:void 0},g,x===void 0?null:x)}function Xc(l,c,g,x){var j=xn();x=x===void 0?null:x;var E=j.memoizedState.inst;Ye!==null&&x!==null&&hh(x,Ye.memoizedState.deps)?j.memoizedState=Ts(c,E,g,x):(it.flags|=l,j.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 tg(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 tg({ref:c,nextImpl:l}),function(){if((bt&2)!==0)throw Error(i(440));return c.impl.apply(void 0,arguments)}}function Di(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 ng(l,c,g){g=g!=null?g.concat([l]):null,Xc(4,4,_o.bind(null,c,l),g)}function Jc(){}function Sd(l,c){var g=xn();c=c===void 0?null:c;var x=g.memoizedState;return c!==null&&hh(c,x[1])?x[0]:(g.memoizedState=[l,c],l)}function jo(l,c){var g=xn();c=c===void 0?null:c;var x=g.memoizedState;if(c!==null&&hh(c,x[1]))return x[0];if(x=l(),Rt){I(!0);try{l()}finally{I(!1)}}return g.memoizedState=[x,c],x}function Co(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 Sh(l,c,g,x){return Jn(g,c)?g:Kl.current!==null?(l=Co(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 ag(l,c,g,x,j){var E=Js();St(E!==0&&8>E?E:8);var q=Qe.T,Z={};Qe.T=Z,_d(l,!1,c,g);try{var ge=j(),Ne=Qe.S;if(Ne!==null&&Ne(Z,ge),ge!==null&&typeof ge=="object"&&typeof ge.then=="function"){var Oe=_s(ge,x);Ic(l,c,Oe,bn(l))}else Ic(l,c,x,bn(l))}catch(Ce){Ic(l,c,{then:function(){},status:"rejected",reason:Ce},bn())}finally{St(E),q!==null&&Z.types!==null&&(q.types=Z.types),Qe.T=q}}function sg(l){var c=l.memoizedState;if(c!==null)return c;c={memoizedState:ql,baseState:ql,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:gr,lastRenderedState:ql},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 Nh(){return Jt(Hl)}function Nd(){return xn().memoizedState}function rg(){return xn().memoizedState}function oy(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 cy(l,c,g){var x=bn();g={lane:x,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},jd(l)?lg(c,g):(g=Ve(l,c,g,x),g!==null&&(Mn(g,l,x),og(g,c,x)))}function ig(l,c,g){var x=bn();Ic(l,c,g,x)}function Ic(l,c,g,x){var j={lane:x,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null};if(jd(l))lg(c,j);else{var E=l.alternate;if(l.lanes===0&&(E===null||E.lanes===0)&&(E=c.lastRenderedReducer,E!==null))try{var q=c.lastRenderedState,Z=E(q,g);if(j.hasEagerState=!0,j.eagerState=Z,Jn(Z,q))return et(l,c,j,0),pt===null&&Ue(),!1}catch{}finally{}if(g=Ve(l,c,j,x),g!==null)return Mn(g,l,x),og(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},jd(l)){if(c)throw Error(i(479))}else c=Ve(l,g,x,2),c!==null&&Mn(c,l,2)}function jd(l){var c=l.alternate;return l===it||c!==null&&c===it}function lg(l,c){dt=ht=!0;var g=l.pending;g===null?c.next=c:(c.next=g.next,g.next=c),l.pending=c}function og(l,c,g){if((g&4194048)!==0){var x=c.lanes;x&=l.pendingLanes,g|=x,c.lanes=g,V(l,g)}}function _h(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 Cd(l,c,g,x,j,E,q){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(x,E,q):c.prototype&&c.prototype.isPureReactComponent?!Qt(g,x)||!Qt(j,E):!0}function cg(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&&Cu.enqueueReplaceState(c,c.state,null)}function Cl(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 j in l)g[j]===void 0&&(g[j]=l[j])}return g}function wd(l,c){try{var g=l.onUncaughtError;g(c.value,{componentStack:c.stack})}catch(x){setTimeout(function(){throw x})}}function jh(l,c,g){try{var x=l.onCaughtError;x(g.value,{componentStack:g.stack,errorBoundary:c.tag===1?c.stateNode:null})}catch(j){setTimeout(function(){throw j})}}function Ch(l,c,g){return g=Tt(g),g.tag=3,g.payload={element:null},g.callback=function(){wd(l,c)},g}function ug(l){return l=Tt(l),l.tag=3,l}function dg(l,c,g,x){var j=g.type.getDerivedStateFromError;if(typeof j=="function"){var E=x.value;l.payload=function(){return j(E)},l.callback=function(){jh(c,g,x)}}var q=g.stateNode;q!==null&&typeof q.componentDidCatch=="function"&&(l.callback=function(){jh(c,g,x),typeof j!="function"&&(ji===null?ji=new Set([this]):ji.add(this));var Z=x.stack;this.componentDidCatch(x.value,{componentStack:Z!==null?Z:""})})}function uy(l,c,g,x,j){if(g.flags|=32768,x!==null&&typeof x=="object"&&typeof x.then=="function"){if(c=g.alternate,c!==null&&Et(c,g,j,!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=j,x===Fr?g.flags|=16384:(c=g.updateQueue,c===null?g.updateQueue=new Set([x]):c.add(x),Ho(l,x,j)),!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,j)),!1}throw Error(i(435,g.tag))}return Ho(l,x,j),Lo(),!1}if(Nt)return c=gs.current,c!==null?((c.flags&65536)===0&&(c.flags|=256),c.flags|=65536,c.lanes=j,x!==pf&&(l=Error(i(422),{cause:x}),Qn(je(l,g)))):(x!==pf&&(c=Error(i(423),{cause:x}),Qn(je(c,g))),l=l.current.alternate,l.flags|=65536,j&=-j,l.lanes|=j,x=je(x,g),j=Ch(l.stateNode,x,j),os(l,j),kn!==4&&(kn=2)),!1;var E=Error(i(520),{cause:x});if(E=je(E,g),Eu===null?Eu=[E]:Eu.push(E),kn!==4&&(kn=2),c===null)return!0;x=je(x,g),g=c;do{switch(g.tag){case 3:return g.flags|=65536,l=j&-j,g.lanes|=l,l=Ch(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"&&(ji===null||!ji.has(E))))return g.flags|=65536,j&=-j,g.lanes|=j,j=ug(j),dg(j,l,g,x),os(g,j),!1}g=g.return}while(g!==null);return!1}function Oa(l,c,g,x){c.child=l===null?Rp(c,null,g,x):Da(c,l.child,g,x)}function fg(l,c,g,x,j){g=g.render;var E=c.ref;if("ref"in x){var q={};for(var Z in x)Z!=="ref"&&(q[Z]=x[Z])}else q=x;return hn(c),x=xo(l,c,g,q,E,j),Z=dd(),l!==null&&!mn?(ph(l,c,j),Ar(l,c,j)):(Nt&&Z&&W(c),c.flags|=1,Oa(l,c,x,j),c.child)}function hg(l,c,g,x,j){if(l===null){var E=g.type;return typeof E=="function"&&!Ol(E)&&E.defaultProps===void 0&&g.compare===null?(c.tag=15,c.type=E,pg(l,c,E,x,j)):(l=pi(g.type,null,x,c,c.mode,j),l.ref=c.ref,l.return=c,c.child=l)}if(E=l.child,!$c(l,j)){var q=E.memoizedProps;if(g=g.compare,g=g!==null?g:Qt,g(q,x)&&l.ref===c.ref)return Ar(l,c,j)}return c.flags|=1,l=Ms(E,x),l.ref=c.ref,l.return=c,c.child=l}function pg(l,c,g,x,j){if(l!==null){var E=l.memoizedProps;if(Qt(E,x)&&l.ref===c.ref)if(mn=!1,c.pendingProps=x=E,$c(l,j))(l.flags&131072)!==0&&(mn=!0);else return c.lanes=l.lanes,Ar(l,c,j)}return Td(l,c,g,x,j)}function mg(l,c,g,x){var j=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,j=0;x!==null;)j=j|x.lanes|x.childLanes,x=x.sibling;x=j&~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):js(),Mi(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),js(),ws());return Oa(l,c,j,g),c.child}function wl(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,j){var E=hr();return E=E===null?null:{parent:Fn?Nn._currentValue:Nn._currentValue2,pool:E},c.memoizedState={baseLanes:g,cachePool:E},l!==null&&yt(c,null),js(),Mi(c),l!==null&&Et(l,c,x,!0),c.childLanes=j,null}function Ed(l,c){return c=zi({mode:c.mode,children:c.children},l.mode),c.ref=l.ref,l.child=c,c.return=l,c}function wh(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 gg(l,c,g){var x=c.pendingProps,j=(c.flags&128)!==0;if(c.flags&=-129,l===null){if(Nt){if(x.mode==="hidden")return l=Ed(c,x),c.lanes=536870912,wl(null,l);if(ud(c),(l=Sn)?(l=hp(l,Wa),l!==null&&(c.memoizedState={dehydrated:l,treeContext:$s!==null?{id:Ma,overflow:xr}:null,retryLane:536870912,hydrationErrors:null},g=Yh(l),g.return=c,c.child=g,da=c,Sn=null)):l=null,l===null)throw ze(c);return c.lanes=536870912,null}return Ed(c,x)}var E=l.memoizedState;if(E!==null){var q=E.dehydrated;if(ud(c),j)if(c.flags&256)c.flags&=-257,c=wh(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),j=(g&l.childLanes)!==0,mn||j){if(x=pt,x!==null&&(q=F(x,g),q!==0&&q!==E.retryLane))throw E.retryLane=q,ct(l,q),Mn(x,l,q),ts;Lo(),c=wh(l,c,g)}else l=E.treeContext,vn&&(Sn=$g(q),da=c,Nt=!0,Xr=null,Wa=!1,l!==null&&be(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,j){return hn(c),g=xo(l,c,g,x,void 0,j),x=dd(),l!==null&&!mn?(ph(l,c,j),Ar(l,c,j)):(Nt&&x&&W(c),c.flags|=1,Oa(l,c,g,j),c.child)}function Eh(l,c,g,x,j,E){return hn(c),c.updateQueue=null,g=Or(c,x,g,j),Vc(l),x=dd(),l!==null&&!mn?(ph(l,c,E),Ar(l,c,E)):(Nt&&x&&W(c),c.flags|=1,Oa(l,c,g,E),c.child)}function El(l,c,g,x,j){if(hn(c),c.stateNode===null){var E=Vr,q=g.contextType;typeof q=="object"&&q!==null&&(E=Jt(q)),E=new g(x,E),c.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,E.updater=Cu,c.stateNode=E,E._reactInternals=c,E=c.stateNode,E.props=x,E.state=c.memoizedState,E.refs={},ut(c),q=g.contextType,E.context=typeof q=="object"&&q!==null?Jt(q):Vr,E.state=c.memoizedState,q=g.getDerivedStateFromProps,typeof q=="function"&&(_h(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&&Cu.enqueueReplaceState(E,E.state,null),Gs(c,x,E,j),Ka(),E.state=c.memoizedState),typeof E.componentDidMount=="function"&&(c.flags|=4194308),x=!0}else if(l===null){E=c.stateNode;var Z=c.memoizedProps,ge=Cl(g,Z);E.props=ge;var Ne=E.context,Oe=g.contextType;q=Vr,typeof Oe=="object"&&Oe!==null&&(q=Jt(Oe));var Ce=g.getDerivedStateFromProps;Oe=typeof Ce=="function"||typeof E.getSnapshotBeforeUpdate=="function",Z=c.pendingProps!==Z,Oe||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(Z||Ne!==q)&&cg(c,E,x,q),zs=!1;var Le=c.memoizedState;E.state=Le,Gs(c,x,E,j),Ka(),Ne=c.memoizedState,Z||Le!==Ne||zs?(typeof Ce=="function"&&(_h(c,g,Ce,x),Ne=c.memoizedState),(ge=zs||Cd(c,g,ge,x,Le,Ne,q))?(Oe||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=Ne),E.props=x,E.state=Ne,E.context=q,x=ge):(typeof E.componentDidMount=="function"&&(c.flags|=4194308),x=!1)}else{E=c.stateNode,sn(l,c),q=c.memoizedProps,Oe=Cl(g,q),E.props=Oe,Ce=c.pendingProps,Le=E.context,Ne=g.contextType,ge=Vr,typeof Ne=="object"&&Ne!==null&&(ge=Jt(Ne)),Z=g.getDerivedStateFromProps,(Ne=typeof Z=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(q!==Ce||Le!==ge)&&cg(c,E,x,ge),zs=!1,Le=c.memoizedState,E.state=Le,Gs(c,x,E,j),Ka();var st=c.memoizedState;q!==Ce||Le!==st||zs||l!==null&&l.dependencies!==null&&qn(l.dependencies)?(typeof Z=="function"&&(_h(c,g,Z,x),st=c.memoizedState),(Oe=zs||Cd(c,g,Oe,x,Le,st,ge)||l!==null&&l.dependencies!==null&&qn(l.dependencies))?(Ne||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(x,st,ge),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(x,st,ge)),typeof E.componentDidUpdate=="function"&&(c.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof E.componentDidUpdate!="function"||q===l.memoizedProps&&Le===l.memoizedState||(c.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||q===l.memoizedProps&&Le===l.memoizedState||(c.flags|=1024),c.memoizedProps=x,c.memoizedState=st),E.props=x,E.state=st,E.context=ge,x=Oe):(typeof E.componentDidUpdate!="function"||q===l.memoizedProps&&Le===l.memoizedState||(c.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||q===l.memoizedProps&&Le===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,j),c.child=Da(c,null,g,j)):Oa(l,c,g,j),c.memoizedState=E.state,l=c.child):l=Ar(l,c,j),l}function yg(l,c,g,x){return Ht(),c.flags|=256,Oa(l,c,g,x),c.child}function Th(l){return{baseLanes:l,cachePool:mt()}}function Rh(l,c,g){return l=l!==null?l.childLanes&~g:0,c&&(l|=ns),l}function Oh(l,c,g){var x=c.pendingProps,j=!1,E=(c.flags&128)!==0,q;if((q=E)||(q=l!==null&&l.memoizedState===null?!1:(Gn.current&2)!==0),q&&(j=!0,c.flags&=-129),q=(c.flags&32)!==0,c.flags&=-33,l===null){if(Nt){if(j?Cs(c):ws(),(l=Sn)?(l=a0(l,Wa),l!==null&&(c.memoizedState={dehydrated:l,treeContext:$s!==null?{id:Ma,overflow:xr}:null,retryLane:536870912,hydrationErrors:null},g=Yh(l),g.return=c,c.child=g,da=c,Sn=null)):l=null,l===null)throw ze(c);return Wd(l)?c.lanes=32:c.lanes=536870912,null}var Z=x.children;return x=x.fallback,j?(ws(),j=c.mode,Z=zi({mode:"hidden",children:Z},j),x=Fs(x,j,g,null),Z.return=c,x.return=c,Z.sibling=x,c.child=Z,x=c.child,x.memoizedState=Th(g),x.childLanes=Rh(l,q,g),c.memoizedState=Xl,wl(null,x)):(Cs(c),Rd(c,Z))}var ge=l.memoizedState;if(ge!==null&&(Z=ge.dehydrated,Z!==null)){if(E)c.flags&256?(Cs(c),c.flags&=-257,c=Tl(l,c,g)):c.memoizedState!==null?(ws(),c.child=l.child,c.flags|=128,c=null):(ws(),Z=x.fallback,j=c.mode,x=zi({mode:"visible",children:x.children},j),Z=Fs(Z,j,g,null),Z.flags|=2,x.return=c,Z.return=c,x.sibling=Z,c.child=x,Da(c,l.child,null,g),x=c.child,x.memoizedState=Th(g),x.childLanes=Rh(l,q,g),c.memoizedState=Xl,c=wl(null,x));else if(Cs(c),Wd(Z))q=$d(Z).digest,x=Error(i(419)),x.stack="",x.digest=q,Qn({value:x,source:null,stack:null}),c=Tl(l,c,g);else if(mn||Et(l,c,g,!1),q=(g&l.childLanes)!==0,mn||q){if(q=pt,q!==null&&(x=F(q,g),x!==0&&x!==ge.retryLane))throw ge.retryLane=x,ct(l,x),Mn(q,l,x),ts;Xi(Z)||Lo(),c=Tl(l,c,g)}else Xi(Z)?(c.flags|=192,c.child=l.child,c=null):(l=ge.treeContext,vn&&(Sn=e0(Z),da=c,Nt=!0,Xr=null,Wa=!1,l!==null&&be(c,l)),c=Rd(c,x.children),c.flags|=4096);return c}return j?(ws(),Z=x.fallback,j=c.mode,ge=l.child,E=ge.sibling,x=Ms(ge,{mode:"hidden",children:x.children}),x.subtreeFlags=ge.subtreeFlags&65011712,E!==null?Z=Ms(E,Z):(Z=Fs(Z,j,g,null),Z.flags|=2),Z.return=c,x.return=c,x.sibling=Z,c.child=x,wl(null,x),x=c.child,Z=l.child.memoizedState,Z===null?Z=Th(g):(j=Z.cachePool,j!==null?(ge=Fn?Nn._currentValue:Nn._currentValue2,j=j.parent!==ge?{parent:ge,pool:ge}:j):j=mt(),Z={baseLanes:Z.baseLanes|g,cachePool:j}),x.memoizedState=Z,x.childLanes=Rh(l,q,g),c.memoizedState=Xl,wl(l.child,x)):(Cs(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=zi({mode:"visible",children:c},l.mode),c.return=l,l.child=c}function zi(l,c){return l=n(22,l,null,c),l.lanes=0,l}function Tl(l,c,g){return Da(c,l.child,null,g),l=Rd(c,c.pendingProps.children),l.flags|=2,c.memoizedState=null,l}function xg(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,j,E){var q=l.memoizedState;q===null?l.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:x,tail:g,tailMode:j,treeForkCount:E}:(q.isBackwards=c,q.rendering=null,q.renderingStartTime=0,q.last=x,q.tail=g,q.tailMode=j,q.treeForkCount=E)}function Mh(l,c,g){var x=c.pendingProps,j=x.revealOrder,E=x.tail;x=x.children;var q=Gn.current,Z=(q&2)!==0;if(Z?(q=q&1|2,c.flags|=128):q&=1,w(Gn,q),Oa(l,c,x,g),x=Nt?Nu:0,!Z&&l!==null&&(l.flags&128)!==0)e:for(l=c.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&xg(l,g,c);else if(l.tag===19)xg(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(j){case"forwards":for(g=c.child,j=null;g!==null;)l=g.alternate,l!==null&&Yc(l)===null&&(j=g),g=g.sibling;g=j,g===null?(j=c.child,c.child=null):(j=g.sibling,g.sibling=null),Eo(c,!1,j,g,E,x);break;case"backwards":case"unstable_legacy-backwards":for(g=null,j=c.child,c.child=null;j!==null;){if(l=j.alternate,l!==null&&Yc(l)===null){c.child=j;break}l=j.sibling,j.sibling=g,g=j,j=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 Ah(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:we(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?(Cs(c),c.flags|=128,null):(g&c.child.childLanes)!==0?Oh(l,c,g):(Cs(c),l=Ar(l,c,g),l!==null?l.sibling:null);Cs(c);break;case 19:var j=(l.flags&128)!==0;if(x=(g&c.childLanes)!==0,x||(Et(l,c,g,!1),x=(g&c.childLanes)!==0),j){if(x)return Mh(l,c,g);c.flags|=128}if(j=c.memoizedState,j!==null&&(j.rendering=null,j.tail=null,j.lastEffect=null),w(Gn,Gn.current),x)break;return null;case 22:return c.lanes=0,mg(l,c,g,c.pendingProps);case 24:Gt(c,Nn,l.memoizedState.cache)}return Ar(l,c,g)}function Dh(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,Ah(l,c,g);mn=(l.flags&131072)!==0}else mn=!1,Nt&&(c.flags&1048576)!==0&&G(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")Ol(l)?(x=Cl(l,x),c.tag=1,c=El(null,c,l,x,g)):(c.tag=0,c=Td(null,c,l,x,g));else{if(l!=null){var j=l.$$typeof;if(j===Bo){c.tag=11,c=fg(null,c,l,x,g);break e}else if(j===Kd){c.tag=14,c=hg(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,j=Cl(x,c.pendingProps),El(l,c,x,j,g);case 3:e:{if(_e(c,c.stateNode.containerInfo),l===null)throw Error(i(387));var E=c.pendingProps;j=c.memoizedState,x=j.element,sn(l,c),Gs(c,E,null,g);var q=c.memoizedState;if(E=q.cache,Gt(c,Nn,E),E!==j.cache&&Zt(c,[Nn],g,!0),Ka(),E=q.element,vn&&j.isDehydrated)if(j={element:E,isDehydrated:!1,cache:q.cache},c.updateQueue.baseState=j,c.memoizedState=j,c.flags&256){c=yg(l,c,E,g);break e}else if(E!==x){x=je(Error(i(424)),c),Qn(x),c=yg(l,c,E,g);break e}else for(vn&&(Sn=Wg(c.stateNode.containerInfo),da=c,Nt=!0,Xr=null,Wa=!0),g=Rp(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(Is)return Wc(l,c),l===null?(g=xp(c.type,null,c.pendingProps,null))?c.memoizedState=g:Nt||(c.stateNode=af(c.type,c.pendingProps,Aa.current,c)):c.memoizedState=xp(c.type,l.memoizedProps,c.pendingProps,l.memoizedState),null;case 27:if(ua)return we(c),l===null&&ua&&Nt&&(x=c.stateNode=sf(c.type,c.pendingProps,Aa.current,_a.current,!1),da=c,Wa=!0,Sn=fp(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&&(f0(c.type,c.pendingProps,_a.current),(j=x=Sn)&&(x=t0(x,c.type,c.pendingProps,Wa),x!==null?(c.stateNode=x,da=c,Sn=Ig(x),Wa=!1,j=!0):j=!1),j||ze(c)),we(c),j=c.type,E=c.pendingProps,q=l!==null?l.memoizedProps:null,x=E.children,Ia(j,E)?x=null:q!==null&&Ia(j,q)&&(c.flags|=32),c.memoizedState!==null&&(j=xo(l,c,Ps,null,null,g),Fn?Hl._currentValue=j:Hl._currentValue2=j),Wc(l,c),Oa(l,c,x,g),c.child;case 6:return l===null&&Nt&&(yp(c.pendingProps,_a.current),(l=g=Sn)&&(g=n0(g,c.pendingProps,Wa),g!==null?(c.stateNode=g,da=c,Sn=null,l=!0):l=!1),l||ze(c)),null;case 13:return Oh(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 fg(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 j=c.type._context,x=c.pendingProps.children,hn(c),j=Jt(j),x=x(j),c.flags|=1,Oa(l,c,x,g),c.child;case 14:return hg(l,c,c.type,c.pendingProps,g);case 15:return pg(l,c,c.type,c.pendingProps,g);case 19:return Mh(l,c,g);case 31:return gg(l,c,g);case 22:return mg(l,c,g,c.pendingProps);case 24:return hn(c),x=Jt(Nn),l===null?(j=hr(),j===null&&(j=pt,E=dr(),j.pooledCache=E,E.refCount++,E!==null&&(j.pooledCacheLanes|=g),j=E),c.memoizedState={parent:x,cache:j},ut(c),Gt(c,Nn,j)):((l.lanes&g)!==0&&(sn(l,c),Gs(c,null,null,g),Ka()),j=l.memoizedState,E=c.memoizedState,j.parent!==x?(j={parent:x,cache:x},c.memoizedState=j,c.lanes===0&&(c.memoizedState=c.updateQueue.baseState=j),Gt(c,Nn,x)):(x=E.cache,Gt(c,Nn,x),x!==j.cache&&Zt(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 bg(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 zh(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 j=c.child;j!==null;){if(j.tag===5){var E=j.stateNode;g&&x&&(E=Xg(E,j.type,j.memoizedProps)),pu(l,E)}else if(j.tag===6)E=j.stateNode,g&&x&&(E=up(E,j.memoizedProps)),pu(l,E);else if(j.tag!==4){if(j.tag===22&&j.memoizedState!==null)E=j.child,E!==null&&(E.return=j),zh(l,j,!0,!0);else if(j.child!==null){j.child.return=j,j=j.child;continue}}if(j===c)break;for(;j.sibling===null;){if(j.return===null||j.return===c)return;j=j.return}j.sibling.return=j.return,j=j.sibling}}function vg(l,c,g,x){var j=!1;if(As)for(var E=c.child;E!==null;){if(E.tag===5){var q=E.stateNode;g&&x&&(q=Xg(q,E.type,E.memoizedProps)),op(l,q)}else if(E.tag===6)q=E.stateNode,g&&x&&(q=up(q,E.memoizedProps)),op(l,q);else if(E.tag!==4){if(E.tag===22&&E.memoizedState!==null)j=E.child,j!==null&&(j.return=E),vg(l,E,!0,!0),j=!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 j;E=E.return}E.sibling.return=E.return,E=E.sibling}return j}function Sg(l,c){if(As&&bg(l,c)){l=c.stateNode;var g=l.containerInfo,x=lp();vg(x,c,!1,!1),l.pendingChildren=x,Ys(c),Kg(g,x)}}function kh(l,c,g,x){if(wt)l.memoizedProps!==x&&Ys(c);else if(As){var j=l.stateNode,E=l.memoizedProps;if((l=bg(l,c))||E!==x){var q=_a.current;E=Qg(j,g,E,x,!l,null),E===j?c.stateNode=j:(eu(c),fs(E,g,x,q)&&Ys(c),c.stateNode=E,l&&zh(E,c,!1,!1))}else c.stateNode=j}}function Fa(l,c,g,x,j){if((l.mode&32)!==0&&(g===null?mu(c,x):Qo(c,g,x))){if(l.flags|=16777216,(j&335544128)===j||Jh(c,x))if(An(l.stateNode,c,x))l.flags|=8192;else if(Ct())l.flags|=8192;else throw $a=Fr,gf}else l.flags&=-16777217}function To(l,c){if(Np(c)){if(l.flags|=16777216,!_p(c))if(Ct())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 j=l.child;j!==null;)g|=j.lanes|j.childLanes,x|=j.subtreeFlags&65011712,x|=j.flags&65011712,j.return=l,j=j.sibling;else for(j=l.child;j!==null;)g|=j.lanes|j.childLanes,x|=j.subtreeFlags,x|=j.flags,j.return=l,j=j.sibling;return l.subtreeFlags|=x,l.childLanes=g,c}function Ng(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),me(),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())),Sg(l,c),ln(c),null;case 26:if(Is){var j=c.type,E=c.memoizedState;return l===null?(Ys(c),E!==null?(ln(c),To(c,E)):(ln(c),Fa(c,j,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):kh(l,c,j,x),ln(c),Fa(c,j,E,x,g)),null}case 27:if(ua){if(nt(c),g=Aa.current,j=c.type,l!==null&&c.stateNode!=null)wt?l.memoizedProps!==x&&Ys(c):kh(l,c,j,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(j,x,g,l,!0),c.stateNode=l,Ys(c))}return ln(c),null}case 5:if(nt(c),j=c.type,l!==null&&c.stateNode!=null)kh(l,c,j,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),c0(c.stateNode,j,x,E)&&(c.flags|=64);else{var q=Fh(j,x,Aa.current,E,c);eu(c),zh(q,c,!1,!1),c.stateNode=q,fs(q,j,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,j=da,j!==null)switch(j.tag){case 27:case 5:x=j.memoizedProps}my(l,g,c,x)||ze(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));pp(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(j=Mt(c),x!==null&&x.dehydrated!==null){if(l===null){if(!j)throw Error(i(318));if(!vn)throw Error(i(344));if(j=c.memoizedState,j=j!==null?j.dehydrated:null,!j)throw Error(i(317));r0(j,c)}else Ht(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;ln(c),j=!1}else j=En(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=j),j=!0;if(!j)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,j=null,x.alternate!==null&&x.alternate.memoizedState!==null&&x.alternate.memoizedState.cachePool!==null&&(j=x.alternate.memoizedState.cachePool.pool),E=null,x.memoizedState!==null&&x.memoizedState.cachePool!==null&&(E=x.memoizedState.cachePool.pool),E!==j&&(x.flags|=2048)),g!==l&&g&&(c.child.flags|=8192),tu(c,c.updateQueue),ln(c),null);case 4:return me(),Sg(l,c),l===null&&tn(c.stateNode.containerInfo),ln(c),null;case 10:return fn(c.type),ln(c),null;case 19:if(C(Gn),x=c.memoizedState,x===null)return ln(c),null;if(j=(c.flags&128)!==0,E=x.rendering,E===null)if(j)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&&he(c,x.treeForkCount),c.child}l=l.sibling}x.tail!==null&&Ga()>sl&&(c.flags|=128,j=!0,Ro(x,!1),c.lanes=4194304)}else{if(!j)if(l=Yc(E),l!==null){if(c.flags|=128,j=!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>sl&&g!==536870912&&(c.flags|=128,j=!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,j?g&1|2:g&1),Nt&&he(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&&C(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 Lh(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),me(),l=c.flags,(l&65536)!==0&&(l&128)===0?(c.flags=l&-65537|128,c):null;case 26:case 27:case 5:return nt(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 C(Gn),null;case 4:return me(),null;case 10:return fn(c.type),null;case 22:case 23:return Es(c),Tn(),l!==null&&C(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 _g(l,c){switch(fe(c),c.tag){case 3:fn(Nn),me();break;case 26:case 27:case 5:nt(c);break;case 4:me();break;case 31:c.memoizedState!==null&&Es(c);break;case 13:Es(c);break;case 19:C(Gn);break;case 10:fn(c.type);break;case 22:case 23:Es(c),Tn(),l!==null&&C(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 j=x.next;g=j;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!==j)}}catch(Z){We(c,c.return,Z)}}function zr(l,c,g){try{var x=c.updateQueue,j=x!==null?x.lastEffect:null;if(j!==null){var E=j.next;x=E;do{if((x.tag&l)===l){var q=x.inst,Z=q.destroy;if(Z!==void 0){q.destroy=void 0,j=c;var ge=g,Ne=Z;try{Ne()}catch(Oe){We(j,ge,Oe)}}}x=x.next}while(x!==E)}}catch(Oe){We(c,c.return,Oe)}}function Oo(l){var c=l.updateQueue;if(c!==null){var g=l.stateNode;try{pr(c,g)}catch(x){We(l,l.return,x)}}}function Od(l,c,g){g.props=Cl(l.type,l.memoizedProps),g.state=l.memoizedState;try{g.componentWillUnmount()}catch(x){We(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(j){We(l,c,j)}}function Ba(l,c){var g=l.ref,x=l.refCleanup;if(g!==null)if(typeof x=="function")try{x()}catch(j){We(l,c,j)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof g=="function")try{g(null)}catch(j){We(l,c,j)}else g.current=null}function Rl(l){var c=l.type,g=l.memoizedProps,x=l.stateNode;try{Ug(x,c,g,l)}catch(j){We(l,l.return,j)}}function nu(l,c,g){try{qg(l.stateNode,l.type,g,c,l)}catch(x){We(l,l.return,x)}}function Uh(l){return l.tag===5||l.tag===3||(Is?l.tag===26:!1)||(ua?l.tag===27&&Bl(l.type):!1)||l.tag===4}function ci(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||Uh(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&&Bl(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?Bg(g,l,c):ap(g,l);else if(x!==4&&(ua&&x===27&&Bl(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?Hg(g,l,c):np(g,l);else if(x!==4&&(ua&&x===27&&Bl(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 qh(l,c,g){l=l.containerInfo;try{cp(l,g)}catch(x){We(c,c.return,x)}}function jg(l){var c=l.stateNode,g=l.memoizedProps;try{na(l.type,g,c,l)}catch(x){We(l,l.return,x)}}function dy(l,c){for(Xd(l.containerInfo),In=c;In!==null;)if(l=In,c=l.child,(l.subtreeFlags&1028)!==0&&c!==null)c.return=l,In=c;else for(;In!==null;){l=In;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 j=c[x];j.ref.impl=j.nextImpl}break;case 11:case 15:break;case 1:if((c&1024)!==0&&g!==null){c=void 0,x=l,j=g.memoizedProps,g=g.memoizedState;var E=x.stateNode;try{var q=Cl(x.type,j);c=E.getSnapshotBeforeUpdate(q,g),E.__reactInternalSnapshotBeforeUpdate=c}catch(Z){We(x,x.return,Z)}}break;case 3:(c&1024)!==0&&wt&&ip(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,In=c;break}In=l.return}}function Cg(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){We(g,g.return,q)}else{var j=Cl(g.type,c.memoizedProps);c=c.memoizedState;try{l.componentDidUpdate(j,c,l.__reactInternalSnapshotBeforeUpdate)}catch(q){We(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){We(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)Rl(g);else if(x&64){l=g.type,c=g.memoizedProps,j=g.stateNode;try{l0(j,l,c,g)}catch(q){We(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=fy.bind(null,g),ef(x,g))));break;case 22:if(x=g.memoizedState!==null||Pn,!x){c=c!==null&&c.memoizedState!==null||Yn,j=Pn;var E=Yn;Pn=x,(Yn=c)&&!E?Xs(l,g,(g.subtreeFlags&8772)!==0):Za(l,g),Pn=j,Yn=E}break;case 30:break;default:Za(l,g)}}function Hh(l){var c=l.alternate;c!==null&&(l.alternate=null,Hh(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(Yl,g)}catch{}switch(g.tag){case 26:if(Is){Yn||Ba(g,c),Vs(l,c,g),g.memoizedState?Fi(g.memoizedState):g.stateNode&&Sp(g.stateNode);break}case 27:if(ua){Yn||Ba(g,c);var x=zn,j=Wn;Bl(g.type)&&(zn=g.stateNode,Wn=!1),Vs(l,c,g),Na(g.stateNode),zn=x,Wn=j;break}case 5:Yn||Ba(g,c);case 6:if(wt){if(x=zn,j=Wn,zn=null,Vs(l,c,g),zn=x,Wn=j,zn!==null)if(Wn)try{sp(zn,g.stateNode)}catch(E){We(g,c,E)}else try{Gg(zn,g.stateNode)}catch(E){We(g,c,E)}}else Vs(l,c,g);break;case 18:wt&&zn!==null&&(Wn?tf(zn,g.stateNode):gp(zn,g.stateNode));break;case 4:wt?(x=zn,j=Wn,zn=g.stateNode.containerInfo,Wn=!0,Vs(l,c,g),zn=x,Wn=j):(As&&qh(g.stateNode,g,lp()),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{gy(l)}catch(g){We(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{yy(l)}catch(g){We(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 Mp),c;case 22:return l=l.stateNode,c=l._retryCache,c===null&&(c=l._retryCache=new Mp),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 j=hy.bind(null,l,x);x.then(j,j)}})}function va(l,c){var g=c.deletions;if(g!==null)for(var x=0;x<g.length;x++){var j=g[x],E=l,q=c;if(wt){var Z=q;e:for(;Z!==null;){switch(Z.tag){case 27:if(ua){if(Bl(Z.type)){zn=Z.stateNode,Wn=!1;break e}break}case 5:zn=Z.stateNode,Wn=!1;break e;case 3:case 4:zn=Z.stateNode.containerInfo,Wn=!0;break e}Z=Z.return}if(zn===null)throw Error(i(160));su(E,q,j),zn=null,Wn=!1}else su(E,q,j);E=j.alternate,E!==null&&(E.return=null),j.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(Is){var j=Wt;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=h0(j,l.type,l.memoizedProps,l):vp(j,l.type,l.stateNode):l.stateNode=bp(j,E,l.memoizedProps):x!==E?(x===null?g.stateNode!==null&&Sp(g.stateNode):Fi(x),E===null?vp(j,l.type,l.stateNode):bp(j,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){j=l.stateNode;try{rp(j)}catch(Ce){We(l,l.return,Ce)}}x&4&&l.stateNode!=null&&(j=l.memoizedProps,nu(l,j,g!==null?g.memoizedProps:j)),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,j=l.stateNode;try{Lg(j,g,x)}catch(Ce){We(l,l.return,Ce)}}break;case 3:if(Is?(p0(),j=Wt,Wt=xu(c.containerInfo),va(c,l),Wt=j):va(c,l),Sa(l),x&4){if(wt&&vn&&g!==null&&g.memoizedState.isDehydrated)try{o0(c.containerInfo)}catch(Ce){We(l,l.return,Ce)}if(As){x=c.containerInfo,g=c.pendingChildren;try{cp(x,g)}catch(Ce){We(l,l.return,Ce)}}}Zo&&(Zo=!1,Ad(l));break;case 4:Is?(g=Wt,Wt=xu(l.stateNode.containerInfo),va(c,l),Sa(l),Wt=g):(va(c,l),Sa(l)),x&4&&As&&qh(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:j=l.memoizedState!==null;var q=g!==null&&g.memoizedState!==null,Z=Pn,ge=Yn;if(Pn=Z||j,Yn=ge||q,va(c,l),Yn=ge,Pn=Z,Sa(l),x&8192&&(c=l.stateNode,c._visibility=j?c._visibility&-2:c._visibility|1,j&&(g===null||q||Pn||Yn||ki(l)),wt)){e:if(g=null,wt)for(c=l;;){if(c.tag===5||Is&&c.tag===26){if(g===null){q=g=c;try{E=q.stateNode,j?py(E):Yg(q.stateNode,q.memoizedProps)}catch(Ce){We(q,q.return,Ce)}}}else if(c.tag===6){if(g===null){q=c;try{var Ne=q.stateNode;j?Pg(Ne):Vg(Ne,q.memoizedProps)}catch(Ce){We(q,q.return,Ce)}}}else if(c.tag===18){if(g===null){q=c;try{var Oe=q.stateNode;j?u0(Oe):d0(q.stateNode)}catch(Ce){We(q,q.return,Ce)}}}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(Uh(x)){g=x;break}x=x.return}if(wt){if(g==null)throw Error(i(160));switch(g.tag){case 27:if(ua){var j=g.stateNode,E=ci(l);au(l,E,j);break}case 5:var q=g.stateNode;g.flags&32&&(rp(q),g.flags&=-33);var Z=ci(l);au(l,Z,q);break;case 3:case 4:var ge=g.stateNode.containerInfo,Ne=ci(l);Md(l,Ne,ge);break;default:throw Error(i(161))}}}catch(Oe){We(l,l.return,Oe)}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&&Wh(c.stateNode),l=l.sibling}}function Za(l,c){if(c.subtreeFlags&8772)for(c=c.child;c!==null;)Cg(l,c.alternate,c),c=c.sibling}function ki(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),ki(c);break;case 1:Ba(c,c.return);var g=c.stateNode;typeof g.componentWillUnmount=="function"&&Od(c,c.return,g),ki(c);break;case 27:ua&&Na(c.stateNode);case 26:case 5:Ba(c,c.return),ki(c);break;case 22:c.memoizedState===null&&ki(c);break;case 30:ki(c);break;default:ki(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,j=l,E=c,q=E.flags;switch(E.tag){case 0:case 11:case 15:Xs(j,E,g),Dr(4,E);break;case 1:if(Xs(j,E,g),x=E,j=x.stateNode,typeof j.componentDidMount=="function")try{j.componentDidMount()}catch(Ne){We(x,x.return,Ne)}if(x=E,j=x.updateQueue,j!==null){var Z=x.stateNode;try{var ge=j.shared.hiddenCallbacks;if(ge!==null)for(j.shared.hiddenCallbacks=null,j=0;j<ge.length;j++)Pt(ge[j],Z)}catch(Ne){We(x,x.return,Ne)}}g&&q&64&&Oo(E),Mo(E,E.return);break;case 27:ua&&jg(E);case 26:case 5:Xs(j,E,g),g&&x===null&&q&4&&Rl(E),Mo(E,E.return);break;case 12:Xs(j,E,g);break;case 31:Xs(j,E,g),g&&q&4&&Qs(j,E);break;case 13:Xs(j,E,g),g&&q&4&&ru(j,E);break;case 22:E.memoizedState===null&&Xs(j,E,g),Mo(E,E.return);break;case 30:break;default:Xs(j,E,g)}c=c.sibling}}function Li(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 Bh(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 j=c.flags;switch(c.tag){case 0:case 11:case 15:On(l,c,g,x),j&2048&&Dr(9,c);break;case 1:On(l,c,g,x);break;case 3:On(l,c,g,x),j&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(j&2048){On(l,c,g,x),l=c.stateNode;try{var E=c.memoizedProps,q=E.id,Z=E.onPostCommit;typeof Z=="function"&&Z(q,c.alternate===null?"mount":"update",l.passiveEffectDuration,-0)}catch(ge){We(c,c.return,ge)}}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)),j&2048&&Li(q,c);break;case 24:On(l,c,g,x),j&2048&&Bh(c.alternate,c);break;default:On(l,c,g,x)}}function cs(l,c,g,x,j){for(j=j&&((c.subtreeFlags&10256)!==0||!1),c=c.child;c!==null;){var E=l,q=c,Z=g,ge=x,Ne=q.flags;switch(q.tag){case 0:case 11:case 15:cs(E,q,Z,ge,j),Dr(8,q);break;case 23:break;case 22:var Oe=q.stateNode;q.memoizedState!==null?Oe._visibility&2?cs(E,q,Z,ge,j):Ao(E,q):(Oe._visibility|=2,cs(E,q,Z,ge,j)),j&&Ne&2048&&Li(q.alternate,q);break;case 24:cs(E,q,Z,ge,j),j&&Ne&2048&&Bh(q.alternate,q);break;default:cs(E,q,Z,ge,j)}c=c.sibling}}function Ao(l,c){if(c.subtreeFlags&10256)for(c=c.child;c!==null;){var g=l,x=c,j=x.flags;switch(x.tag){case 22:Ao(g,x),j&2048&&Li(x.alternate,x);break;case 24:Ao(g,x),j&2048&&Bh(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;)Ui(l,c,g),l=l.sibling}function Ui(l,c,g){switch(l.tag){case 26:if(kr(l,c,g),l.flags&Ls)if(l.memoizedState!==null)m0(g,Wt,l.memoizedState,l.memoizedProps);else{var x=l.stateNode,j=l.type;l=l.memoizedProps,((c&335544128)===c||Jh(j,l))&&Zd(g,x,j,l)}break;case 5:kr(l,c,g),l.flags&Ls&&(x=l.stateNode,j=l.type,l=l.memoizedProps,((c&335544128)===c||Jh(j,l))&&Zd(g,x,j,l));break;case 3:case 4:Is?(x=Wt,Wt=xu(l.stateNode.containerInfo),kr(l,c,g),Wt=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];In=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];In=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(;In!==null;){var g=In;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,In=x;else e:for(g=l;In!==null;){x=In;var j=x.sibling,E=x.return;if(Hh(x),x===g){In=null;break e}if(j!==null){j.return=E,In=j;break e}In=E}}}function qi(l){var c=rt(l);if(c!=null){if(typeof c.memoizedProps["data-testname"]!="string")throw Error(i(364));return c}if(l=Zn(l),l===null)throw Error(i(362));return l.stateNode.current}function Hi(l,c){var g=l.tag;switch(c.$$typeof){case rr:if(l.type===c.value)return!0;break;case Io:e:{for(c=c.value,l=[l,0],g=0;g<l.length;){var x=l[g++],j=x.tag,E=l[g++],q=c[E];if(j!==5&&j!==26&&j!==27||!Ki(x)){for(;q!=null&&Hi(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)&&tp(l.stateNode,c.value))return!0;break;case el: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 Io:return":has("+(zo(l)||"")+")";case Wo:return'[role="'+l.value+'"]';case el: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 j=l[x++],E=j.tag,q=l[x++],Z=c[q];if(E!==5&&E!==26&&E!==27||!Ki(j)){for(;Z!=null&&Hi(j,Z);)q++,Z=c[q];if(q===c.length)g.push(j);else for(j=j.child;j!==null;)l.push(j,q),j=j.sibling}}return g}function us(l,c){if(!ca)throw Error(i(363));l=qi(l),l=ko(l,c),c=[],l=Array.from(l);for(var g=0;g<l.length;){var x=l[g++],j=x.tag;if(j===5||j===26||j===27)Ki(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:Qe.T!==null?Ta():Vo()}function di(){if(ns===0)if((_t&536870912)===0||Nt){var l=Pl;Pl<<=1,(Pl&3932160)===0&&(Pl=262144),ns=l}else ns=536870912;return l=gs.current,l!==null&&(l.flags|=32),ns}function Mn(l,c,g){(l===pt&&($t===2||$t===9)||l.cancelPendingCommit!==null)&&(Bn(l,0),Ur(l,_t,ns,!1)),H(l,g),((bt&2)===0||l!==pt)&&(l===pt&&((bt&2)===0&&(al|=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),j=x?Tg(l,c):qr(l,c,!0),E=x;do{if(j===0){tl&&!x&&Ur(l,c,0,!1);break}else{if(g=l.current.alternate,E&&!wg(g)){j=qr(l,c,!1),E=!1;continue}if(j===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 Z=l;j=Eu;var ge=vn&&Z.current.memoizedState.isDehydrated;if(ge&&(Bn(Z,q).flags|=256),q=qr(Z,q,!1),q!==2){if(nl&&!ge){Z.errorRecoveryDisabledLanes|=E,al|=E,j=4;break e}E=ys,ys=j,E!==null&&(ys===null?ys=E:ys.push.apply(ys,E))}j=q}if(E=!1,j!==2)continue}}if(j===1){Bn(l,0),Ur(l,c,0,!0);break}e:{switch(x=l,E=j,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&&(j=Tu+300-Ga(),10<j)){if(Ur(x,c,ns,!Sr),T(x,0,!0)!==0)break e;Wr=c,x.timeoutHandle=Zh(Lr.bind(null,x,g,ys,Ru,xf,c,ns,al,ec,Sr,E,"Throttled",-0,0),j);break e}Lr(x,g,ys,Ru,xf,c,ns,al,ec,Sr,E,null,-0,0)}}break}while(!0);Ea(l)}function Lr(l,c,g,x,j,E,q,Z,ge,Ne,Oe,Ce,Le,st){if(l.timeoutHandle=hs,Ce=c.subtreeFlags,Ce&8192||(Ce&16785408)===16785408){Ce=Ih(),Ui(c,E,Ce);var Ca=(E&62914560)===E?Tu-Ga():(E&4194048)===E?Zl-Ga():0;if(Ca=kg(Ce,Ca),Ca!==null){Wr=E,l.cancelPendingCommit=Ca(Br.bind(null,l,c,E,g,x,j,q,Z,ge,Oe,Ce,null,Le,st)),Ur(l,E,q,!Ne);return}}Br(l,c,E,g,x,j,q,Z,ge)}function wg(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 j=g[x],E=j.getSnapshot;j=j.value;try{if(!Jn(E(),j))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&=~al,l.suspendedLanes|=c,l.pingedLanes&=~c,x&&(l.warmLanes|=c),x=l.expirationTimes;for(var j=c;0<j;){var E=31-ps(j),q=1<<E;x[E]=-1,j&=~q}g!==0&&U(l,g,c)}function Ld(){return(bt&6)===0?(rs(0),!1):!0}function Ud(){if(vt!==null){if($t===0)var l=vt.return;else l=vt,br=cn=null,Qc(l),Ii=null,Vl=0,l=vt;for(;l!==null;)_g(l.alternate,l),l=l.return;vt=null}}function Bn(l,c){var g=l.timeoutHandle;g!==hs&&(l.timeoutHandle=hs,zg(g)),g=l.cancelPendingCommit,g!==null&&(l.cancelPendingCommit=null,g()),Wr=0,Ud(),pt=l,vt=g=Ms(l.current,null),_t=c,$t=0,aa=null,Sr=!1,tl=M(l,c),nl=!1,ec=ns=$o=al=_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 j=31-ps(x),E=1<<j;c|=l[j],x&=~E}return Ir=c,Ue(),g}function on(l,c){it=null,Qe.H=ks,c===ha||c===ar?(c=Xn(),$t=3):c===gf?(c=Xn(),$t=4):$t=c===ts?8:c!==null&&typeof c=="object"&&typeof c.then=="function"?6:1,aa=c,vt===null&&(kn=1,wd(l,je(c,l.current)))}function Ct(){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=Qe.H;return Qe.H=ks,l===null?ks:l}function Os(){var l=Qe.A;return Qe.A=Jo,l}function Lo(){kn=4,Sr||(_t&4194048)!==_t&&gs.current!==null||(tl=!0),(_i&134217727)===0&&(al&134217727)===0||pt===null||Ur(pt,_t,ns,!1)}function qr(l,c,g){var x=bt;bt|=2;var j=fi(),E=Os();(pt!==l||_t!==c)&&(Ru=null,Bn(l,c)),c=!1;var q=kn;e:do try{if($t!==0&&vt!==null){var Z=vt,ge=aa;switch($t){case 8:Ud(),q=6;break e;case 3:case 2:case 9:case 6:gs.current===null&&(c=!0);var Ne=$t;if($t=0,aa=null,Hr(l,Z,ge,Ne),g&&tl){q=0;break e}break;default:Ne=$t,$t=0,aa=null,Hr(l,Z,ge,Ne)}}Eg(),q=kn;break}catch(Oe){on(l,Oe)}while(!0);return c&&l.shellSuspendCounter++,br=cn=null,bt=x,Qe.H=j,Qe.A=E,vt===null&&(pt=null,_t=0,Ue()),q}function Eg(){for(;vt!==null;)Bi(vt)}function Tg(l,c){var g=bt;bt|=2;var x=fi(),j=Os();pt!==l||_t!==c?(Ru=null,sl=Ga()+500,Bn(l,c)):tl=M(l,c);e:do try{if($t!==0&&vt!==null){c=vt;var E=aa;t:switch($t){case 1:$t=0,aa=null,Hr(l,c,E,1);break;case 2:case 9:if(At(E)){$t=0,aa=null,qd(c);break}c=function(){$t!==2&&$t!==9||pt!==l||($t=7),Ea(l)},E.then(c,c);break e;case 3:$t=7;break e;case 4:$t=5;break e;case 7:At(E)?($t=0,aa=null,qd(c)):($t=0,aa=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 Z=vt,ge=Z.type,Ne=Z.pendingProps;if(q?_p(q):An(Z.stateNode,ge,Ne)){$t=0,aa=null;var Oe=Z.sibling;if(Oe!==null)vt=Oe;else{var Ce=Z.return;Ce!==null?(vt=Ce,qo(Ce)):vt=null}break t}}$t=0,aa=null,Hr(l,c,E,5);break;case 6:$t=0,aa=null,Hr(l,c,E,6);break;case 8:Ud(),kn=6;break e;default:throw Error(i(462))}}Uo();break}catch(Le){on(l,Le)}while(!0);return br=cn=null,Qe.H=x,Qe.A=j,bt=g,vt!==null?0:(pt=null,_t=0,Ue(),kn)}function Uo(){for(;vt!==null&&!y0();)Bi(vt)}function Bi(l){var c=Dh(l.alternate,l,Ir);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=Eh(g,c,c.pendingProps,c.type,void 0,_t);break;case 11:c=Eh(g,c,c.pendingProps,c.type.render,c.ref,_t);break;case 5:Qc(c);default:_g(g,c),c=vt=Gd(c,Ir),c=Dh(g,c,Ir)}l.memoizedProps=l.pendingProps,c===null?qo(l):vt=c}function Hr(l,c,g,x){br=cn=null,Qc(c),Ii=null,Vl=0;var j=c.return;try{if(uy(l,j,c,g,_t)){kn=1,wd(l,je(g,l.current)),vt=null;return}}catch(E){if(j!==null)throw vt=j,E;kn=1,wd(l,je(g,l.current)),vt=null;return}c.flags&32768?(Nt||x===1?l=!0:tl||(_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))),Gi(c,l)):qo(c)}function qo(l){var c=l;do{if((c.flags&32768)!==0){Gi(c,Sr);return}l=c.return;var g=Ng(c.alternate,c,Ir);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 Gi(l,c){do{var g=Lh(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,j,E,q,Z,ge){l.cancelPendingCommit=null;do Pr();while(sa!==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|=Ql,L(l,g,E,q,Z,ge),l===pt&&(vt=pt=null,_t=0),Jl=c,Ci=l,Wr=g,tc=E,bf=j,Ap=x,(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?(l.callbackNode=null,l.callbackPriority=0,ta(vu,function(){return ou(),null})):(l.callbackNode=null,l.callbackPriority=0),x=(c.flags&13878)!==0,(c.subtreeFlags&13878)!==0||x){x=Qe.T,Qe.T=null,j=Js(),St(2),q=bt,bt|=4;try{dy(l,c,g)}finally{bt=q,St(j),Qe.T=x}}sa=1,hi(),Gr(),Hd()}}function hi(){if(sa===1){sa=0;var l=Ci,c=Jl,g=(c.flags&13878)!==0;if((c.subtreeFlags&13878)!==0||g){g=Qe.T,Qe.T=null;var x=Js();St(2);var j=bt;bt|=4;try{iu(c,l),Dg(l.containerInfo)}finally{bt=j,St(x),Qe.T=g}}l.current=c,sa=2}}function Gr(){if(sa===2){sa=0;var l=Ci,c=Jl,g=(c.flags&8772)!==0;if((c.subtreeFlags&8772)!==0||g){g=Qe.T,Qe.T=null;var x=Js();St(2);var j=bt;bt|=4;try{Cg(l,c.alternate,c)}finally{bt=j,St(x),Qe.T=g}}sa=3}}function Hd(){if(sa===4||sa===3){sa=0,Cp();var l=Ci,c=Jl,g=Wr,x=Ap;(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?sa=5:(sa=0,Jl=Ci=null,Bd(l,l.pendingLanes));var j=l.pendingLanes;if(j===0&&(ji=null),ne(g),c=c.stateNode,ms&&typeof ms.onCommitFiberRoot=="function")try{ms.onCommitFiberRoot(Yl,c,void 0,(c.current.flags&128)===128)}catch{}if(x!==null){c=Qe.T,j=Js(),St(2),Qe.T=null;try{for(var E=l.onRecoverableError,q=0;q<x.length;q++){var Z=x[q];E(Z.value,{componentStack:Z.stack})}}finally{Qe.T=c,St(j)}}(Wr&3)!==0&&Pr(),Ea(l),j=l.pendingLanes,(g&261930)!==0&&(j&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(sa!==5)return!1;var l=Ci,c=tc;tc=0;var g=ne(Wr),x=32>g?32:g;g=Qe.T;var j=Js();try{St(x),Qe.T=null,x=bf,bf=null;var E=Ci,q=Wr;if(sa=0,Jl=Ci=null,Wr=0,(bt&6)!==0)throw Error(i(331));var Z=bt;if(bt|=4,kd(E.current),Dd(E,E.current,q,x),bt=Z,rs(0,!1),ms&&typeof ms.onPostCommitFiberRoot=="function")try{ms.onPostCommitFiberRoot(Yl,E)}catch{}return!0}finally{St(j),Qe.T=g,Bd(l,c)}}function Pi(l,c,g){c=je(g,c),c=Ch(l.stateNode,c,2),l=pn(l,c,2),l!==null&&(H(l,2),Ea(l))}function We(l,c,g){if(l.tag===3)Pi(l,l,g);else for(;c!==null;){if(c.tag===3){Pi(c,l,g);break}else if(c.tag===1){var x=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof x.componentDidCatch=="function"&&(ji===null||!ji.has(x))){l=je(g,l),g=ug(2),x=pn(c,g,2),x!==null&&(dg(g,x,c,l),H(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 j=new Set;x.set(c,j)}else j=x.get(c),j===void 0&&(j=new Set,x.set(c,j));j.has(g)||(nl=!0,j.add(g),l=Rg.bind(null,l,c,g),c.then(l,l))}function Rg(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 Og(l,c){c===0&&(c=k()),l=ct(l,c),l!==null&&(H(l,c),Ea(l))}function fy(l){var c=l.memoizedState,g=0;c!==null&&(g=c.retryLane),Og(l,g)}function hy(l,c){var g=0;switch(l.tag){case 31:case 13:var x=l.stateNode,j=l.memoizedState;j!==null&&(g=j.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),Og(l,g)}function ta(l,c){return bu(l,c)}function Gh(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 Ol(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,j,E){var q=0;if(x=l,typeof l=="function")Ol(l)&&(q=1);else if(typeof l=="string")q=Is&&ua?nf(l,g,_a.current)?26:jp(l)?27:5:Is?nf(l,g,_a.current)?26:5:ua&&jp(l)?27:5;else e:switch(l){case fu:return l=n(31,g,c,j),l.elementType=fu,l.lanes=E,l;case zl:return Fs(g.children,j,E,c);case kl:q=8,j|=24;break;case Ll:return l=n(12,g,c,j|2),l.elementType=Ll,l.lanes=E,l;case Qd:return l=n(13,g,c,j),l.elementType=Qd,l.lanes=E,l;case mi:return l=n(19,g,c,j),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 Ja: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,j),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 Ph(l,c,g){return l=n(6,l,null,c),l.lanes=g,l}function Yh(l){var c=n(18,null,null,0);return c.stateNode=l,c}function Vh(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 Mg(l,c,g,x,j,E,q,Z,ge){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=P(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=P(0),this.hiddenUpdates=P(null),this.identifierPrefix=x,this.onUncaughtError=j,this.onCaughtError=E,this.onRecoverableError=q,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ge,this.incompleteTransitions=new Map}function Yi(l,c,g,x,j,E,q,Z,ge,Ne,Oe,Ce){return l=new Mg(l,c,g,q,ge,Ne,Oe,Ce,Z),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},ut(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 Qh(l,c,g,x,j,E){j=Pd(j),x.context===null?x.context=j:x.pendingContext=j,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 Ml(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){Ml(l,c),(l=l.alternate)&&Ml(l,c)}var ft={},Yd=pl(),ds=Gb(),Vd=Object.assign,Al=Symbol.for("react.element"),Yr=Symbol.for("react.transitional.element"),Dl=Symbol.for("react.portal"),zl=Symbol.for("react.fragment"),kl=Symbol.for("react.strict_mode"),Ll=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"),Ja=Symbol.for("react.lazy"),fu=Symbol.for("react.activity"),Kh=Symbol.for("react.memo_cache_sentinel"),gi=Symbol.iterator,Vi=Symbol.for("react.client.reference"),Qi=Array.isArray,Qe=Yd.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Xh=e.rendererVersion,hu=e.rendererPackageName,Go=e.extraDevToolsConfig,Po=e.getPublicInstance,Ag=e.getRootHostContext,Yo=e.getChildHostContext,Xd=e.prepareForCommit,Dg=e.resetAfterCommit,Fh=e.createInstance;e.cloneMutableInstance;var pu=e.appendInitialChild,fs=e.finalizeInitialChildren,Ia=e.shouldSetTextContent,yi=e.createTextInstance;e.cloneMutableTextInstance;var Zh=e.scheduleTimeout,zg=e.cancelTimeout,hs=e.noTimeout,Fn=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,Js=e.getCurrentUpdatePriority,Vo=e.resolveUpdatePriority;e.trackSchedulerEvent,e.resolveEventType,e.resolveEventTimeStamp;var Ul=e.shouldAttemptEagerTransition,Fd=e.detachDeletedInstance;e.requestPostPaintCallback;var mu=e.maySuspendCommit,Qo=e.maySuspendCommitOnUpdate,Jh=e.maySuspendCommitInSyncRender,An=e.preloadInstance,Ih=e.startSuspendingCommit,Zd=e.suspendInstance;e.suspendOnActiveViewTransition;var kg=e.waitForCommitToBeReady;e.getSuspendedCommitReason;var ql=e.NotPendingTransition,Hl=e.HostTransitionContext,Wh=e.resetFormInstance;e.bindToConsole;var $h=e.supportsMicrotasks,ep=e.scheduleMicrotask,ca=e.supportsTestSelectors,Zn=e.findFiberRoot,Jd=e.getBoundingRect,gu=e.getTextContent,Ki=e.isHiddenSubtree,tp=e.matchAccessibilityRole,xi=e.setFocusIfFocusable,Id=e.setupIntersectionObserver,np=e.appendChild,ap=e.appendChildToContainer,Lg=e.commitTextUpdate,Ug=e.commitMount,qg=e.commitUpdate,Hg=e.insertBefore,Bg=e.insertInContainerBefore,Gg=e.removeChild,sp=e.removeChildFromContainer,rp=e.resetTextContent,py=e.hideInstance,Pg=e.hideTextInstance,Yg=e.unhideInstance,Vg=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 ip=e.clearContainer;e.createFragmentInstance,e.updateFragmentInstanceFiber,e.commitNewChildToFragmentInstance,e.deleteChildFromFragmentInstance;var Qg=e.cloneInstance,lp=e.createContainerChildSet,op=e.appendChildToContainerChildSet,Kg=e.finalizeContainerChildren,cp=e.replaceContainerChildren,Xg=e.cloneHiddenInstance,up=e.cloneHiddenTextInstance,Xi=e.isSuspenseInstancePending,Wd=e.isSuspenseInstanceFallback,$d=e.getSuspenseInstanceFallbackErrorDetails,ef=e.registerSuspenseInstanceRetry,Fg=e.canHydrateFormStateMarker,dp=e.isFormStateMarkerMatching,Zg=e.getNextHydratableSibling,Jg=e.getNextHydratableSiblingAfterSingleton,Ig=e.getFirstHydratableChild,Wg=e.getFirstHydratableChildWithinContainer,$g=e.getFirstHydratableChildWithinActivityInstance,e0=e.getFirstHydratableChildWithinSuspenseInstance,fp=e.getFirstHydratableChildWithinSingleton,t0=e.canHydrateInstance,n0=e.canHydrateTextInstance,hp=e.canHydrateActivityInstance,a0=e.canHydrateSuspenseInstance,s0=e.hydrateInstance,my=e.hydrateTextInstance,pp=e.hydrateActivityInstance,r0=e.hydrateSuspenseInstance,i0=e.getNextHydratableInstanceAfterActivityInstance,mp=e.getNextHydratableInstanceAfterSuspenseInstance,l0=e.commitHydratedInstance,o0=e.commitHydratedContainer,gy=e.commitHydratedActivityInstance,yy=e.commitHydratedSuspenseInstance,c0=e.finalizeHydratedChildren,yu=e.flushHydrationEvents;e.clearActivityBoundary;var gp=e.clearSuspenseBoundary;e.clearActivityBoundaryFromContainer;var tf=e.clearSuspenseBoundaryFromContainer,u0=e.hideDehydratedBoundary,d0=e.unhideDehydratedBoundary,Ko=e.shouldDeleteUnhydratedTailInstances;e.diffHydratedPropsForDevWarnings,e.diffHydratedTextForDevWarnings,e.describeHydratableInstanceForDevWarnings;var f0=e.validateHydratableInstance,yp=e.validateHydratableTextInstance,Is=e.supportsResources,nf=e.isHostHoistableType,xu=e.getHoistableRoot,xp=e.getResource,bp=e.acquireResource,Fi=e.releaseResource,h0=e.hydrateHoistable,vp=e.mountHoistable,Sp=e.unmountHoistable,af=e.createHoistableInstance,p0=e.prepareToCommitHoistables,Np=e.mayResourceSuspendCommit,_p=e.preloadResource,m0=e.suspendResource,ua=e.supportsSingletons,sf=e.resolveSingletonInstance,na=e.acquireSingletonInstance,Na=e.releaseSingletonInstance,jp=e.isHostSingletonType,Bl=e.isSingletonScope,rf=[],Gl=-1,Vr={},ps=Math.clz32?Math.clz32:R,lf=Math.log,g0=Math.LN2,of=256,Pl=262144,Xo=4194304,bu=ds.unstable_scheduleCallback,cf=ds.unstable_cancelCallback,y0=ds.unstable_shouldYield,Cp=ds.unstable_requestPaint,Ga=ds.unstable_now,uf=ds.unstable_ImmediatePriority,x0=ds.unstable_UserBlockingPriority,vu=ds.unstable_NormalPriority,df=ds.unstable_IdlePriority,wp=ds.log,b0=ds.unstable_setDisableYieldValue,Yl=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)},xy=Object.prototype.hasOwnProperty,hf,Qr,Su=!1,Ep=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,v0=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()})}},ja=ds.unstable_scheduleCallback,by=ds.unstable_NormalPriority,Nn={$$typeof:Zs,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},ju=null,It=null,Pa=!1,tr=!1,mf=!1,Zi=0,Fo=null,Tp=0,Si=0,fa=null,nr=Qe.S;Qe.S=function(l,c){Zl=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,Ii=null,Vl=0,Da=Bs(!0),Rp=Bs(!1),za=[],Zr=0,Ql=0,zs=!1,yf=!1,Kl=_(null),Wi=_(0),gs=_(null),es=null,Gn=_(0),Ni=0,it=null,Ye=null,tt=null,ht=!1,dt=!1,Rt=!1,Ya=0,sr=0,vr=null,Op=0,ks={readContext:Jt,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:Jt,use:bo,useCallback:function(l,c){return qa().memoizedState=[l,c===void 0?null:c],l},useContext:Jt,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){I(!0);try{l()}finally{I(!1)}}return g.memoizedState=[x,c],x},useReducer:function(l,c,g){var x=qa();if(g!==void 0){var j=g(c);if(Rt){I(!0);try{g(c)}finally{I(!1)}}}else j=c;return x.memoizedState=x.baseState=j,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:j},x.queue=l,l=l.dispatch=cy.bind(null,it,l),[x.memoizedState,l]},useRef:function(l){var c=qa();return l={current:l},c.memoizedState=l},useState:function(l){l=yh(l);var c=l.queue,g=ig.bind(null,it,c);return c.dispatch=g,[l.memoizedState,g]},useDebugValue:Jc,useDeferredValue:function(l,c){var g=qa();return Co(g,l,c)},useTransition:function(){var l=yh(!1);return l=ag.bind(null,it,l.queue,!0,!1),qa().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,c,g){var x=it,j=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||$m(x,c,g)}j.memoizedState=g;var E={value:g,getSnapshot:c};return j.queue=E,Fc(gh.bind(null,x,E,l),[l]),x.flags|=2048,Ts(9,{destroy:void 0},mh.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=Op++,c="_"+c+"r_"+g.toString(32)+"_";return l.memoizedState=c},useHostTransitionStatus:Nh,useFormState:bh,useActionState:bh,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=oy.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)}}},Jr={readContext:Jt,use:bo,useCallback:Sd,useContext:Jt,useEffect:No,useImperativeHandle:ng,useInsertionEffect:Di,useLayoutEffect:Zc,useMemo:jo,useReducer:li,useRef:vd,useState:function(){return li(gr)},useDebugValue:Jc,useDeferredValue:function(l,c){var g=xn();return Sh(g,Ye.memoizedState,l,c)},useTransition:function(){var l=li(gr)[0],c=xn().memoizedState;return[typeof l=="boolean"?l:Ha(l),c]},useSyncExternalStore:Nl,useId:Nd,useHostTransitionStatus:Nh,useFormState:vo,useActionState:vo,useOptimistic:function(l,c){var g=xn();return Kc(g,Ye,l,c)},useMemoCache:hd,useCacheRefresh:rg};Jr.useEffectEvent=Xa;var $i={readContext:Jt,use:bo,useCallback:Sd,useContext:Jt,useEffect:No,useImperativeHandle:ng,useInsertionEffect:Di,useLayoutEffect:Zc,useMemo:jo,useReducer:md,useRef:vd,useState:function(){return md(gr)},useDebugValue:Jc,useDeferredValue:function(l,c){var g=xn();return Ye===null?Co(g,l,c):Sh(g,Ye.memoizedState,l,c)},useTransition:function(){var l=md(gr)[0],c=xn().memoizedState;return[typeof l=="boolean"?l:Ha(l),c]},useSyncExternalStore:Nl,useId:Nd,useHostTransitionStatus:Nh,useFormState:So,useActionState:So,useOptimistic:function(l,c){var g=xn();return Ye!==null?Kc(g,Ye,l,c):(g.baseState=l,[l,g.queue.dispatch])},useMemoCache:hd,useCacheRefresh:rg};$i.useEffectEvent=Xa;var Cu={enqueueSetState:function(l,c,g){l=l._reactInternals;var x=bn(),j=Tt(x);j.payload=c,g!=null&&(j.callback=g),c=pn(l,j,x),c!==null&&(Mn(c,l,x),Rr(c,l,x))},enqueueReplaceState:function(l,c,g){l=l._reactInternals;var x=bn(),j=Tt(x);j.tag=1,j.payload=c,g!=null&&(j.callback=g),c=pn(l,j,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,Xl={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null},Pn=!1,Yn=!1,Zo=!1,Mp=typeof WeakSet=="function"?WeakSet:Set,In=null,zn=null,Wn=!1,Wt=null,Ls=8192,Jo={getCacheForType:function(l){var c=Jt(Nn),g=c.data.get(l);return g===void 0&&(g=l(),c.data.set(l,g)),g},cacheSignal:function(){return Jt(Nn).controller.signal}},rr=0,Io=1,Wo=2,wu=3,el=4;if(typeof Symbol=="function"&&Symbol.for){var Fl=Symbol.for;rr=Fl("selector.component"),Io=Fl("selector.has_pseudo_class"),Wo=Fl("selector.role"),wu=Fl("selector.test_id"),el=Fl("selector.text")}var Us=typeof WeakMap=="function"?WeakMap:Map,bt=0,pt=null,vt=null,_t=0,$t=0,aa=null,Sr=!1,tl=!1,nl=!1,Ir=0,kn=0,_i=0,al=0,$o=0,ns=0,ec=0,Eu=null,ys=null,xf=!1,Tu=0,Zl=0,sl=1/0,Ru=null,ji=null,sa=0,Ci=null,Jl=null,Wr=0,tc=0,bf=null,Ap=null,Ut=0,Ou=null;return ft.attemptContinuousHydration=function(l){if(l.tag===13||l.tag===31){var c=ct(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=ct(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&&(sl=Ga()+500,rs(0))}}break;case 31:case 13:c=ct(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,j,E,q,Z,ge,Ne){return Yi(l,c,!1,null,g,x,E,null,q,Z,ge,Ne)},ft.createHasPseudoClassSelector=function(l){return{$$typeof:Io,value:l}},ft.createHydrationContainer=function(l,c,g,x,j,E,q,Z,ge,Ne,Oe,Ce,Le,st){return l=Yi(g,x,!0,l,j,E,Z,st,ge,Ne,Oe,Ce),l.context=Pd(null),g=l.current,x=bn(),x=re(x),j=Tt(x),j.callback=c??null,pn(g,j,x),c=x,l.current.lanes=c,H(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:Dl,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:el,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=Qe.T,g=Js();try{return St(32),Qe.T=null,l()}finally{St(g),Qe.T=c}},ft.discreteUpdates=function(l,c,g,x,j){var E=Qe.T,q=Js();try{return St(2),Qe.T=null,l(c,g,x,j)}finally{St(q),Qe.T=E,bt===0&&(sl=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(Jd(c[g]));for(c=l.length-1;0<c;c--){g=l[c];for(var x=g.x,j=x+g.width,E=g.y,q=E+g.height,Z=c-1;0<=Z;Z--)if(c!==Z){var ge=l[Z],Ne=ge.x,Oe=Ne+ge.width,Ce=ge.y,Le=Ce+ge.height;if(x>=Ne&&E>=Ce&&j<=Oe&&q<=Le){l.splice(c,1);break}else if(x!==Ne||g.width!==ge.width||Le<E||Ce>q){if(!(E!==Ce||g.height!==ge.height||Oe<x||Ne>j)){Ne>x&&(ge.width+=Ne-x,ge.x=x),Oe<j&&(ge.width=j-Ne),l.splice(c,1);break}}else{Ce>E&&(ge.height+=Ce-E,ge.y=E),Le<q&&(ge.height=q-Ce),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=Qe.T,x=Js();try{if(St(2),Qe.T=null,l)return l()}finally{St(x),Qe.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=qi(l),c=ko(l,c),c=Array.from(c),l=0;l<c.length;){var g=c[l++],x=g.tag;if(!Ki(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=[qi(l),0];for(var j=0;j<l.length;){var E=l[j++],q=E.tag,Z=l[j++],ge=c[Z];if((q!==5&&q!==26&&q!==27||!Ki(E))&&(Hi(E,ge)&&(x.push(zo(ge)),Z++,Z>g&&(g=Z)),Z<c.length))for(E=E.child;E!==null;)l.push(E,Z),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:Xh,rendererPackageName:hu,currentDispatcherRef:Qe,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{Yl=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 j=Id(l,g,x).disconnect;return{disconnect:function(){j()}}},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 j=sg(l).queue;ag(l,j,c,ql,g===null?s:function(){var E=sg(l);return E.next===null&&(E=l.alternate.memoizedState),Ic(l,E.next.queue,{},bn()),g(x)})},ft.updateContainer=function(l,c,g,x){var j=c.current,E=bn();return Qh(j,E,l,c,g,x),E},ft.updateContainerSync=function(l,c,g,x){return Qh(c.current,2,l,c,g,x),2},ft},t.exports.default=t.exports,Object.defineProperty(t.exports,"__esModule",{value:!0})})(Ox)),Ox.exports}var G5;function wk(){return G5||(G5=1,Rx.exports=Ck()),Rx.exports}var Ek=wk();const Tk=Bb(Ek);var Mx={exports:{}},eo={};/**
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 P5;function Rk(){return P5||(P5=1,eo.ConcurrentRoot=1,eo.ContinuousEventPriority=8,eo.DefaultEventPriority=32,eo.DiscreteEventPriority=2,eo.IdleEventPriority=268435456,eo.LegacyRoot=0,eo.NoEventPriority=0),eo}var Y5;function Ok(){return Y5||(Y5=1,Mx.exports=Rk()),Mx.exports}var iy=Ok();const V5={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let Q5=!1,K5=!1;const z1=".react-konva-event",Mk=`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
+ `,Ak=`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
+ `,Dk={};function ly(t,e,n=Dk){if(!Q5&&"zIndex"in e&&(console.warn(Ak),Q5=!0),!K5&&e.draggable){var s=e.x!==void 0||e.y!==void 0,i=e.onDragEnd||e.onDragMove;s&&!i&&(console.warn(Mk),K5=!0)}for(var o in n)if(!V5[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 v=e._useStrictMode,b={},_=!1;const C={};for(var o in e)if(!V5[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]&&(C[p]=e[o])}!d&&(e[o]!==n[o]||v&&e[o]!==t.getAttr(o))&&(_=!0,b[o]=e[o])}_&&(t.setAttrs(b),Gc(t));for(var p in C)t.off(p+z1),t.on(p+z1,C[p])}function Gc(t){if(!De.autoDrawEnabled){var e=t.getLayer()||t.getStage();e&&e.batchDraw()}}var Ax=Gb();const F8={},zk={};ah.Node.prototype._applyProps=ly;let Z8=iy.DefaultEventPriority;function kk(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 Lk(t,e,n){let s=ah[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=ah.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 ly(p,o),p}function Uk(t,e,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${t}"`)}function qk(t,e,n){return!1}function Hk(t){return t}function Bk(){return null}function Gk(){return null}function Pk(t,e,n,s){return zk}function Yk(){}function Vk(t){}function Qk(t,e){return!1}function Kk(){return F8}function Xk(){return F8}const Fk=setTimeout,Zk=clearTimeout,Jk=!0,Ik=t=>{t()},Wk=-1;function $k(t,e){return!1}const eL=!1,tL=!1,nL=!0,aL=!1,sL=!1;function rL(t,e){e.parent===t?e.moveToTop():t.add(e),Gc(t)}function iL(t,e){e.parent===t?e.moveToTop():t.add(e),Gc(t)}function J8(t,e,n){e._remove(),t.add(e),e.setZIndex(n.getZIndex()),Gc(t)}function lL(t,e,n){J8(t,e,n)}function oL(t,e){e.destroy(),e.off(z1),Gc(t)}function cL(t,e){e.destroy(),e.off(z1),Gc(t)}function uL(t,e,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function dL(t,e,n){}function fL(t,e,n,s){ly(t,s,n)}function hL(t){t.hide(),Gc(t)}function pL(t){}function mL(t,e){(e.visible==null||e.visible)&&t.show()}function gL(t,e){}function yL(t){}function xL(){}function bL(){return null}function vL(){}function SL(){}function NL(){return iy.DefaultEventPriority}function _L(){}function jL(){return null}function CL(t){Z8=t}function wL(){return Z8}function EL(){return iy.DiscreteEventPriority}function TL(){return!1}function RL(){}function OL(){return null}function ML(){return-1.1}function AL(){}function DL(){return!1}function zL(){return!0}function kL(){}function LL(){}function UL(){return null}const qL=null,HL=en.createContext(null);function BL(){}const GL=Object.freeze(Object.defineProperty({__proto__:null,HostTransitionContext:HL,NotPendingTransition:qL,afterActiveInstanceBlur:SL,appendChild:rL,appendChildToContainer:iL,appendInitialChild:kk,beforeActiveInstanceBlur:vL,cancelTimeout:Zk,clearContainer:yL,commitMount:dL,commitTextUpdate:uL,commitUpdate:fL,createInstance:Lk,createTextInstance:Uk,detachDeletedInstance:xL,finalizeInitialChildren:qk,getChildHostContext:Xk,getCurrentEventPriority:NL,getCurrentUpdatePriority:wL,getInstanceFromNode:bL,getInstanceFromScope:jL,getPublicInstance:Hk,getRootHostContext:Kk,hideInstance:hL,hideTextInstance:pL,idlePriority:Ax.unstable_IdlePriority,insertBefore:J8,insertInContainerBefore:lL,isPrimaryRenderer:eL,maySuspendCommit:DL,noTimeout:Wk,now:Ax.unstable_now,preloadInstance:zL,prepareForCommit:Bk,preparePortalMount:Gk,prepareScopeUpdate:_L,prepareUpdate:Pk,removeChild:oL,removeChildFromContainer:cL,requestPostPaintCallback:AL,resetAfterCommit:Yk,resetFormInstance:BL,resetTextContent:Vk,resolveEventTimeStamp:ML,resolveEventType:OL,resolveUpdatePriority:EL,run:Ax.unstable_runWithPriority,scheduleMicrotask:Ik,scheduleTimeout:Fk,setCurrentUpdatePriority:CL,shouldAttemptEagerTransition:TL,shouldDeprioritizeSubtree:Qk,shouldSetTextContent:$k,startSuspendingCommit:kL,supportsHydration:sL,supportsMicrotasks:Jk,supportsMutation:nL,supportsPersistence:aL,suspendInstance:LL,trackSchedulerEvent:RL,unhideInstance:mL,unhideTextInstance:gL,waitForCommitToBeReady:UL,warnsIfNotActing:tL},Symbol.toStringTag,{value:"Module"}));function I8(t,e,n){if(!t)return;if(n(t)===!0)return t;let s=t.child;for(;s;){const i=I8(s,e,n);if(i)return i;s=s.sibling}}function W8(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const Av=W8(D.createContext(null));class $8 extends D.Component{render(){return D.createElement(Av.Provider,{value:this._reactInternals},this.props.children)}}function PL(){const t=D.useContext(Av);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=I8(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 YL=Symbol.for("react.context"),VL=t=>t!==null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===YL;function QL(){const t=PL(),[e]=D.useState(()=>new Map);e.clear();let n=t;for(;n;){const s=n.type;VL(s)&&s!==Av&&!e.has(s)&&e.set(s,D.use(W8(s))),n=n.return}return e}function KL(){const t=QL();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($8,{...e})),[t])}if(en.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 XL(t){const e=en.useRef({});return en.useLayoutEffect(()=>{e.current=t}),en.useLayoutEffect(()=>()=>{e.current={}},[]),e.current}const FL=()=>{const t=en.useRef(0);return en.useMemo(()=>{t.current++},[]),t.current>1},ZL=t=>{const e=en.useRef(null),n=en.useRef(null),s=en.useRef(null),i=XL(t),o=KL(),d=en.useRef(null),f=v=>{const{forwardedRef:b}=t;b&&(typeof b=="function"?b(v):b.current=v)},p=FL(),y=()=>{var v;f(null),Rf.flushSyncFromReconciler(()=>{Rf.updateContainer(null,s.current,null)}),(v=n.current)==null||v.destroy(),n.current=null};return en.useLayoutEffect(()=>(d.current&&(clearTimeout(d.current),d.current=null),n.current?f(n.current):(n.current=new ah.Stage({width:t.width,height:t.height,container:e.current}),f(n.current),s.current=Rf.createContainer(n.current,iy.ConcurrentRoot,null,!1,null,"",console.error,console.error,console.error,null),Rf.updateContainer(en.createElement(o,{},t.children),s.current,null,()=>{})),()=>{p?d.current=setTimeout(y,0):y()}),[]),en.useLayoutEffect(()=>{f(n.current),ly(n.current,t,i),Rf.flushSyncFromReconciler(()=>{Rf.updateContainer(en.createElement(o,{},t.children),s.current,null)})}),en.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})},Dx="Layer",X5="Group",F5="Circle",ku="Line",JL="Text",IL="Arrow",Rf=Tk(GL),WL=en.forwardRef((t,e)=>en.createElement($8,{},en.createElement(ZL,{...t,forwardedRef:e})));function im(t,e,n){return{x:t.x*e,y:t.y*n}}function Z5(t,e,n){return{x:t.x/e,y:t.y/n}}function J5(t,e,n){return t.flatMap(s=>[s.x*e,s.y*n])}function $L(t,e){return e?"#6366f1":t.color}const I5=16,W5=9;function eU({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,v]=D.useState([]),[b,_]=D.useState(null);D.useEffect(()=>{const M=d.current;if(!M)return;const z=new ResizeObserver(k=>{const P=k[0];if(P){const{width:H}=P.contentRect;p({w:H,h:H*9/16})}});return z.observe(M),()=>z.disconnect()},[]);const C=o!==null,w=D.useCallback(M=>{if(!C){n(null);return}const z=M.target.getStage();if(!z)return;const k=z.getPointerPosition();if(!k)return;const P=Z5(k,f.w,f.h),H=o==="tripwire";if(y.length===0){v([P]);return}if(H&&y.length===1){const L=[...y,P],U={id:crypto.randomUUID(),name:"Tripwire",type:"tripwire",color:"#f59e0b",points:L};i(U),v([]);return}if(y.length>=3&&!H){const L=im(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),v([]);return}}v(L=>[...L,P])},[C,y,f,o,i,n]),R=D.useCallback(M=>{if(!C||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),v([])},[C,o,y,i]),O=D.useCallback(M=>{const z=M.target.getStage();if(!z)return;const k=z.getPointerPosition();_(k??null)},[]),T=[];for(let M=1;M<I5;M++){const z=f.w/I5*M;T.push(h.jsx(ku,{points:[z,0,z,f.h],stroke:"#ffffff",strokeWidth:.5,opacity:.08},`gv-${M}`))}for(let M=1;M<W5;M++){const z=f.h/W5*M;T.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:C?"crosshair":"default"},children:[h.jsxs(WL,{width:f.w,height:f.h,onClick:w,onDblClick:R,onMouseMove:O,children:[h.jsxs(Dx,{children:[h.jsx(ku,{points:[0,0,f.w,0,f.w,f.h,0,f.h,0,0],stroke:"transparent",strokeWidth:0}),T]}),h.jsx(Dx,{children:t.map(M=>{const z=M.id===e,k=$L(M,z),P=J5(M.points,f.w,f.h),H=M.type==="tripwire";return h.jsxs(X5,{onClick:L=>{L.cancelBubble=!0,C||n(M.id)},children:[H?h.jsx(IL,{points:P,stroke:k,strokeWidth:z?3:2,fill:k,pointerLength:10,pointerWidth:8,opacity:z?1:.8}):h.jsx(ku,{points:P,closed:!0,fill:k+"33",stroke:k,strokeWidth:z?2.5:1.5,opacity:z?1:.85}),M.points.length>0&&h.jsx(JL,{x:im(M.points[0],f.w,f.h).x+4,y:im(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=im(L,f.w,f.h);return h.jsx(F5,{x:V.x,y:V.y,radius:5,fill:k,stroke:"#ffffff",strokeWidth:1.5,draggable:!0,onDragMove:F=>{const re=Z5({x:F.target.x(),y:F.target.y()},f.w,f.h),ne=M.points.map((I,ie)=>ie===U?re:I);s(M.id,ne)}},U)})]},M.id)})}),h.jsx(Dx,{children:C&&y.length>0&&h.jsxs(X5,{children:[y.length>=2&&o!=="tripwire"&&h.jsx(ku,{points:J5(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=im(M,f.w,f.h),P=z===0;return h.jsx(F5,{x:k.x,y:k.y,radius:P&&y.length>=3?7:4,fill:P&&y.length>=3?"#6366f1":"#ffffff",stroke:"#6366f1",strokeWidth:1.5,opacity:.9},z)})]})})]}),C&&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 tU={intrusion:"Intrusion","package-watch":"Package",tripwire:"Tripwire"},nU={intrusion:"bg-danger/10 text-danger","package-watch":"bg-success/10 text-success",tripwire:"bg-warning/10 text-warning"};function aU({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(HT,{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 ${nU[f.type]}`,children:tU[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(KT,{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(Im,{className:"h-3 w-3"})})]})]},f.id)})})]})}const sU=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#06b6d4","#f97316","#ec4899"],rU=[{value:"intrusion",label:"Intrusion"},{value:"package-watch",label:"Package Watch"},{value:"tripwire",label:"Tripwire"}],zx="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 iU({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:zx,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:zx,value:t.type,onChange:s=>e({...t,type:s.target.value}),children:rU.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:sU.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:zx+" 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(Im,{className:"h-3 w-3"}),"Delete zone"]})]})}function lU(){const[t,e]=D.useState([]),[n,s]=D.useState(null),[i,o]=D.useState(null),d=t.find(_=>_.id===n)??null,f=_=>{e(C=>[...C,_]),s(_.id),o(null)},p=(_,C)=>{e(w=>w.map(R=>R.id===_?{...R,points:C}:R))},y=_=>{e(C=>C.map(w=>w.id===_.id?_:w))},v=_=>{e(C=>C.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(eU,{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(aU,{zones:t,selectedZoneId:n,drawingType:i,onSelectZone:s,onDeleteZone:v,onStartDraw:b,onCancelDraw:()=>o(null)}),d&&!i&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"border-t border-border"}),h.jsx(iU,{zone:d,onChange:y,onDelete:()=>v(d.id)})]})]})]})]})})}function oU(t){return{id:t.id,name:t.packageName??t.id,type:t.slot??"addon",enabled:!0}}function cU({deviceId:t}){const e=Ft(),{data:n,isLoading:s}=ot({queryKey:["bridge-addons"],queryFn:()=>e.bridgeListAddons()}),o=(n??[]).map(oU),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(Mm,{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(Mm,{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(Jm,{className:"h-3.5 w-3.5"})})]},p.id))})]})}function uU({deviceId:t}){const e=Ft(),[n,s]=D.useState(null),{data:i}=ot({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(dv,{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(Fm,{className:"h-3.5 w-3.5 text-success"}):h.jsx(nT,{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 dU(){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(Zm,{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 $5=0;function fU({deviceId:t}){const e=Ft(),[n,s]=D.useState(""),[i,o]=D.useState([]),d=D.useRef(null),f=Cn({mutationFn:b=>e.replEval(b,{type:"device",deviceId:t}),onSuccess:(b,_)=>{const C=typeof b=="string"?b:JSON.stringify(b,null,2);o(w=>[...w,{id:++$5,code:_,result:C,error:!1,ts:new Date().toLocaleTimeString("en-GB",{hour12:!1})}]),s("")},onError:(b,_)=>{const C=b instanceof Error?b.message:String(b);o(w=>[...w,{id:++$5,code:_,result:C,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 v(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(Im,{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(K1,{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:()=>v(b.code),title:"Reuse",className:"text-foreground-subtle hover:text-foreground",children:h.jsx(N1,{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 hU=[{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 pU(){const{deviceId:t}=$b(),e=Ft(),[n,s]=D.useState("events"),{data:i,isLoading:o}=ot({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"),v=String(d.phase??"—"),b=d.priority!=null?String(d.priority):null;function _(){if(!t)return null;switch(n){case"events":return h.jsx($A,{deviceId:t});case"pipeline":return h.jsx(eD,{deviceId:t});case"recording":return h.jsx(tD,{});case"zones":return h.jsx(lU,{});case"addons":return h.jsx(cU,{deviceId:t});case"streams":return h.jsx(uU,{deviceId:t});case"logs":return h.jsx(dU,{});case"repl":return h.jsx(fU,{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(sv,{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:p8(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(ty,{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(th,{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:v})]}),b&&h.jsxs("span",{children:["Priority: ",h.jsx("span",{className:"text-foreground",children:b})]})]})]})]})]}),h.jsxs("div",{className:"flex border-b border-border",children:[h.jsx("div",{className:"flex-1 p-4 border-r border-border",children:h.jsx(JA,{deviceName:f,detectionsToday:0,inferenceMs:0,activeTracks:0,storageGb:0})}),h.jsx("div",{className:"w-[300px] flex-shrink-0 bg-surface",children:h.jsx(IA,{deviceId:t??""})})]}),h.jsx("div",{className:"border-b border-border bg-surface px-6",children:h.jsx("div",{className:"flex items-center gap-0 overflow-x-auto",children:hU.map(C=>{const w=n===C.id;return h.jsxs("button",{onClick:()=>s(C.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:[C.label,w&&h.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-0.5 rounded-full bg-primary"})]},C.id)})})}),h.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:_()})]})}const e7=D.createContext(null);function mU(){const t=D.useContext(e7);if(!t)throw new Error("useConfirm must be used within ConfirmDialogProvider");return t.confirm}function gU({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(e7.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 yU({packageName:t,currentVersion:e,onInstall:n,onClose:s}){const i=Ft(),{data:o,isLoading:d}=ot({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,v=p.top;y<280&&v>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(bl,{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(uo,{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(v=>h.jsx("span",{className:`text-[9px] rounded-full px-1.5 py-0.5 font-medium ${v==="latest"?"bg-emerald-500/15 text-emerald-400":v==="beta"?"bg-amber-500/15 text-amber-400":"bg-gray-500/15 text-gray-400"}`,children:v},v)),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(Fm,{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(_1,{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 e4={error:{icon:_6,color:"text-red-400"},warn:{icon:hv,color:"text-amber-400"},info:{icon:j1,color:"text-blue-400"},debug:{icon:kE,color:"text-gray-500"}},xU=["all","error","warn","info","debug"];function bU({addonId:t,onClose:e}){const n=Ft(),[s,i]=D.useState(void 0),[o]=D.useState(100),[d,f]=D.useState([]),[p,y]=D.useState(!1),v=D.useRef(null),{data:b,isLoading:_}=ot({queryKey:["addon-logs",t,s,o],queryFn:()=>n.trpc.addons.getLogs.query({addonId:t,limit:o,level:s}),staleTime:3e4});D.useEffect(()=>{f([])},[s]),D.useEffect(()=>{const R=n.trpc.addons.onAddonLogs.subscribe({addonId:t,level:s},{onData:O=>{f(T=>[...T,O])},onError:O=>{console.error("Log subscription error:",O)}});return()=>{R.unsubscribe()}},[n,t,s]),D.useEffect(()=>{!p&&v.current&&(v.current.scrollTop=v.current.scrollHeight)},[d,p]);const C=[...(b??[]).map(R=>({timestamp:typeof R.timestamp=="string"?R.timestamp:new Date(R.timestamp).toISOString(),level:R.level,message:R.message,scope:R.scope})),...d],w=D.useCallback(R=>{i(R==="all"?void 0:R)},[]);return h.jsxs("div",{className:"border-t border-border",onClick:R=>R.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:xU.map(R=>h.jsx("button",{type:"button",onClick:()=>w(R),className:`px-1.5 py-0.5 capitalize transition-colors ${R==="all"&&!s||s===R?"bg-primary/10 text-primary":"text-foreground-subtle hover:bg-surface-hover"} ${R!=="all"?"border-l border-border":""}`,children:R},R))}),h.jsxs("button",{type:"button",onClick:()=>y(R=>!R),className:`inline-flex items-center gap-1 text-[9px] px-1.5 py-0.5 rounded border transition-colors ${p?"border-amber-500/30 bg-amber-500/10 text-amber-400":"border-border text-foreground-subtle hover:text-foreground"}`,title:p?"Resume auto-scroll":"Pause auto-scroll",children:[p?h.jsx(K1,{className:"h-2.5 w-2.5"}):h.jsx(O6,{className:"h-2.5 w-2.5"}),p?"Paused":"Live"]}),d.length>0&&h.jsxs("span",{className:"text-[9px] text-emerald-400 font-medium",children:["+",d.length," live"]})]}),h.jsx("button",{type:"button",onClick:e,className:"text-foreground-subtle hover:text-foreground",children:h.jsx(bl,{className:"h-3.5 w-3.5"})})]}),h.jsxs("div",{ref:v,className:"max-h-64 overflow-auto font-mono text-[10px]",children:[_&&h.jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-foreground-subtle",children:[h.jsx(uo,{className:"h-3.5 w-3.5 animate-spin"}),"Loading logs..."]}),!_&&C.length===0&&h.jsx("div",{className:"py-4 text-center text-foreground-subtle",children:"No logs found"}),C.length>0&&h.jsx("table",{className:"w-full",children:h.jsx("tbody",{children:C.map((R,O)=>{const T=e4[R.level]??e4.info,M=T.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(R.timestamp).toLocaleTimeString()}),h.jsx("td",{className:`px-1 py-1 align-top w-5 ${T.color}`,children:h.jsx(M,{className:"h-3 w-3"})}),h.jsx("td",{className:"px-2 py-1 text-foreground break-all",children:R.message})]},O)})})})]})]})}function vU({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(Mm,{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(z6,{className:"h-2.5 w-2.5 text-white"})})]})}function SU({addonId:t}){const e=Ft(),n=ga(),{data:s="inherit"}=ot({queryKey:["addon-auto-update",t],queryFn:()=>e.trpc.addons.getAddonAutoUpdate.query({addonId:t}),staleTime:3e4}),i=Cn({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 Ub({addon:t,agents:e=[],hideVersion:n,availableUpdate:s,onUpdate:i,isUpdating:o,bundle:d}){var be,_e;const[f,p]=D.useState(!1),[y,v]=D.useState(!1),[b,_]=D.useState(!1),[C,w]=D.useState(!1),R=Ft(),O=ga(),T=mU(),{manifest:M}=t,z=t.installedOn??[],k=!d&&!M.protected&&M.removable!==!1,P=!!d,H=(d==null?void 0:d.displayName)??M.name,L=(d==null?void 0:d.packageName)??M.packageName,U=(d==null?void 0:d.version)??M.packageVersion??M.version,V=(d==null?void 0:d.installSource)??t.installSource,F=d?(be=d.addons[0])==null?void 0:be.manifest.description:M.description,re=!d&&(t.hasConfigSchema||M.components&&M.components.length>0||e.length>=2),{data:ne,isLoading:I}=ot({queryKey:["addon-config-schema",M.id],queryFn:()=>R.trpc.addons.getConfigSchema.query({addonId:M.id}),enabled:!P&&f&&t.hasConfigSchema,staleTime:6e4}),{data:ie}=ot({queryKey:["addon-config",M.id],queryFn:()=>R.trpc.addons.getConfig.query({addonId:M.id}),enabled:!P&&f&&t.hasConfigSchema,staleTime:3e4}),[ce,Y]=D.useState({}),[$,ae]=D.useState(!1);D.useEffect(()=>{ie&&(Y(ie),ae(!1))},[ie]);const je=me=>{Y(me),ae(!0)},he=Cn({mutationFn:()=>R.trpc.addons.updateConfig.mutate({addonId:M.id,config:ce}),onSuccess:()=>{ae(!1),O.invalidateQueries({queryKey:["addon-config",M.id]})}}),G=Cn({mutationFn:()=>(console.log(`[AddonCard] Uninstalling ${M.packageName}`),R.trpc.addons.uninstallPackage.mutate({packageName:M.packageName})),onSuccess:()=>{console.log(`[AddonCard] Uninstalled ${M.packageName}`),O.invalidateQueries({queryKey:["addons"]}),O.invalidateQueries({queryKey:["addon-pages"]}),O.invalidateQueries({queryKey:["capabilities"]})},onError:me=>{console.error("[AddonCard] Uninstall failed:",me)}}),W=Cn({mutationFn:()=>R.trpc.addons.restartAddon.mutate({addonId:M.id}),onSuccess:()=>{O.invalidateQueries({queryKey:["addons"]})}}),fe=Cn({mutationFn:me=>R.trpc.addons.installPackage.mutate({packageName:L,version:me}),onSuccess:()=>{O.invalidateQueries({queryKey:["addons"]}),O.invalidateQueries({queryKey:["addon-pages"]}),O.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(vU,{isBundle:P||!!M.components&&M.components.length>1,installSource:V}),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:H}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle font-mono shrink-0",children:["(",L,")"]}),P&&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(Mm,{className:"h-3 w-3"}),d.addons.length]})]}),F&&h.jsx("p",{className:"text-[10px] text-foreground-subtle mt-0.5 line-clamp-1",children:F})]}),!n&&h.jsxs("div",{className:"relative inline-flex items-center shrink-0 pt-0.5",children:[V!=="workspace"?h.jsxs("button",{type:"button",onClick:me=>{me.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:[U,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:U}),b&&h.jsx(yU,{packageName:L,currentVersion:U,onInstall:me=>{_(!1),fe.mutate(me)},onClose:()=>_(!1)})]})]}),!P&&!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:me=>{me.stopPropagation(),W.mutate()},disabled:W.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(Am,{className:`h-3 w-3 ${W.isPending?"animate-spin":""}`}),"Restart"]}),h.jsxs("button",{type:"button",onClick:me=>{me.stopPropagation(),w(we=>!we)},className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[10px] font-medium border transition-colors ${C?"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(Zm,{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(uo,{className:"h-3 w-3 animate-spin"}),"Updating..."]}):s&&i?h.jsxs("button",{type:"button",onClick:me=>{me.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(_1,{className:"h-3 w-3"}),"Update to ",s]}):null,h.jsx("div",{className:"flex-1"}),k&&h.jsxs("button",{type:"button",onClick:async me=>{me.stopPropagation(),await T({title:`Uninstall ${M.name}?`,message:"This will remove the addon package and all its data. This action cannot be undone.",confirmLabel:"Uninstall",variant:"danger"})&&G.mutate()},disabled:G.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(Im,{className:"h-3 w-3"}),G.isPending?"Removing...":"Uninstall"]}),re&&h.jsx("button",{type:"button",onClick:me=>{me.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(N1,{className:"h-3.5 w-3.5"}):h.jsx(Mc,{className:"h-3.5 w-3.5"})})]}),C&&!P&&h.jsx(bU,{addonId:M.id,onClose:()=>w(!1)}),P&&h.jsxs(h.Fragment,{children:[h.jsx("button",{type:"button",onClick:()=>p(me=>!me),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(N1,{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(me=>h.jsx(Ub,{addon:me,agents:e,hideVersion:!0},me.manifest.id))})]}),!P&&f&&h.jsxs("div",{className:"border-t border-border px-4 py-3 space-y-4",children:[t.hasConfigSchema&&h.jsxs("div",{children:[I&&h.jsxs("div",{className:"flex items-center gap-2 text-xs text-foreground-subtle py-2",children:[h.jsx(uo,{className:"h-3.5 w-3.5 animate-spin"}),"Loading configuration..."]}),ne&&((_e=ne.sections)==null?void 0:_e.some(me=>{var we;return((we=me.fields)==null?void 0:we.length)>0}))&&h.jsxs("div",{className:"space-y-3",children:[h.jsx(ny,{schema:ne,values:ce,onChange:je}),$&&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:me=>{me.stopPropagation(),he.mutate()},disabled:he.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:[he.isPending?h.jsx(uo,{className:"h-3 w-3 animate-spin"}):h.jsx(A6,{className:"h-3 w-3"}),he.isPending?"Saving...":"Save"]})]}),he.isError&&h.jsxs("div",{className:"text-[10px] text-red-400",children:["Save failed: ",he.error instanceof Error?he.error.message:"Unknown error"]})]})]}),V!=="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(SU,{addonId:M.id})]}),M.components&&M.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 (",M.components.length,")"]}),h.jsx("div",{className:"flex flex-wrap gap-1",children:M.components.map(me=>h.jsx("span",{className:"text-[10px] rounded bg-background border border-border px-1.5 py-0.5 text-foreground-subtle font-mono",children:me},me))})]}),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:[z.length===0&&h.jsx("span",{className:"text-[10px] text-foreground-subtle",children:"Hub (local)"}),z.map(me=>h.jsx("span",{className:"rounded-full bg-surface-hover border border-border px-2 py-0.5 text-[10px] text-foreground-subtle",children:me},me)),h.jsxs("div",{className:"relative",children:[h.jsxs("button",{type:"button",onClick:me=>{me.stopPropagation(),v(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(me=>!me.isHub&&!z.includes(me.name)).map(me=>h.jsx("button",{type:"button",onClick:we=>{we.stopPropagation(),v(!1)},className:"w-full text-left px-3 py-1.5 text-[10px] text-foreground hover:bg-surface-hover transition-colors",children:me.name},me.id)),e.filter(me=>!me.isHub&&!z.includes(me.name)).length===0&&h.jsx("div",{className:"px-3 py-1.5 text-[10px] text-foreground-subtle",children:"No available agents"})]})]})]})]})]})]})}const NU=".tgz,.tar.gz,.zip";function _U({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:NU,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(uo,{className:"w-3.5 h-3.5 animate-spin"}):h.jsx(z6,{className:"w-3.5 h-3.5"}),e?"Uploading...":"Upload"]})]})}function jU(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 CU(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 wU(t){return"bundle"in t}function EU({addons:t,agents:e,onRefresh:n,isRefreshing:s}){const i=Ft(),o=ga(),[d,f]=D.useState(""),p=D.useDeferredValue(d),[y,v]=D.useState(!1),{data:b}=ot({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]),[C,w]=D.useState(null),R=Cn({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}=ot({queryKey:["auto-update-settings"],queryFn:()=>i.trpc.addons.getAutoUpdateSettings.query(),staleTime:3e4}),T=Cn({mutationFn:L=>i.trpc.addons.applyAutoUpdateToAll.mutate({channel:L}),onSuccess:()=>{o.invalidateQueries({queryKey:["auto-update-settings"]})}}),{data:M,isFetching:z}=ot({queryKey:["addon-search",p],queryFn:()=>i.trpc.addons.searchAvailable.query({query:p||void 0}),enabled:y,staleTime:6e4}),k=Cn({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"]})}}),P=Cn({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)}}),H=CU(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(Am,{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:()=>T.mutate(L),disabled:T.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(fv,{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),v(!0)},onFocus:()=>v(!0),onBlur:()=>{setTimeout(()=>v(!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(uo,{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(Fm,{className:"h-3 w-3"}),L.installedVersion??"Installed"]}):h.jsxs("button",{type:"button",onClick:()=>P.mutate(L.name),disabled:P.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:[P.isPending?h.jsx(uo,{className:"h-3 w-3 animate-spin"}):h.jsx(_1,{className:"h-3 w-3"}),"Install"]})]},L.name))})]})]}),h.jsx(_U,{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(_1,{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(Am,{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:H.map(L=>{if(wU(L)){const F=L.bundle.packageName,re=_.get(F);return h.jsx(Ub,{addon:L.representative,agents:e,bundle:L.bundle,availableUpdate:re,isUpdating:C===F,onUpdate:re?()=>R.mutate({name:F,version:re}):void 0},F)}const U=L.manifest.packageName,V=_.get(U);return h.jsx(Ub,{addon:L,agents:e,availableUpdate:V,isUpdating:C===U,onUpdate:V?()=>R.mutate({name:L.manifest.packageName,version:V}):void 0},L.manifest.id)})})]})}function TU(){const t=Ft(),e=ga(),{data:n,isLoading:s,isError:i}=ot({queryKey:["addons","list"],queryFn:()=>t.listAddons()}),{data:o=[]}=ot({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=Cn({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(jU).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(EU,{addons:p,agents:d,onRefresh:()=>f.mutate(),isRefreshing:f.isPending})]})}function qb(t){return t>=1024?`${(t/1024).toFixed(1)} GB`:`${Math.round(t)} MB`}function RU(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 OU(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 MU(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 AU(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 DU({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 ${AU(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:qb(t.memoryRss/1024/1024)}),t.uptimeSeconds>0&&h.jsxs("span",{className:"text-foreground-subtle/60",children:["up ",OU(t.uptimeSeconds)]})]})}function zU({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(mm,{className:"h-2.5 w-2.5"}),t.memoryPercent.toFixed(0),"% (",qb(t.memoryMB),")"]})]})]})]}),h.jsxs("div",{className:"flex items-center gap-2 shrink-0 text-[10px] text-foreground-subtle",children:[h.jsxs("span",{children:["up ",RU(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(Zm,{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(C1,{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(mm,{className:"h-3 w-3 shrink-0"}),h.jsxs("span",{children:["Memory: ",h.jsx("span",{className:"text-foreground font-medium",children:qb(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(mm,{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(C6,{className:"h-3 w-3 shrink-0"}),h.jsxs("span",{children:["Connected: ",h.jsx("span",{className:"text-foreground font-medium",children:MU(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(Mm,{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(C1,{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(Q1,{className:"h-3 w-3"}),"Sub-Processes (",t.subProcesses.length,")"]}),t.subProcesses.map((o,d)=>h.jsx(DU,{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 kU({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(zU,{entry:o,isSelected:n===o.name,onSelectAgent:s},o.id))})}const t4={debug:{badge:"bg-foreground-subtle/10 text-foreground-subtle",text:"text-foreground-subtle"},info:{badge:"bg-info/10 text-info",text:"text-info"},warn:{badge:"bg-warning/10 text-warning",text:"text-warning"},error:{badge:"bg-danger/10 text-danger",text:"text-danger"}};function LU({agentNames:t,addonNames:e,preselectedAgent:n}){const s=Ft(),[i,o]=D.useState("all"),[d,f]=D.useState(n??"all"),[p,y]=D.useState("all"),v=D.useRef(n);D.useEffect(()=>{n!==v.current&&(f(n??"all"),v.current=n)},[n]);const[b,_]=D.useState(!0),C=D.useRef(null),w=D.useMemo(()=>{const H=[];return d!=="all"&&H.push(d),p!=="all"&&H.push(p),H.length>0?H:void 0},[d,p]),{data:R,isLoading:O,isError:T}=ot({queryKey:["agent-logs",i,d,p],queryFn:()=>s.getLogs({...i!=="all"?{level:i}:{},limit:300,...w?{scope:w}:{}}),refetchInterval:3e3}),M=R??[],z=D.useMemo(()=>[...M].reverse(),[M]);D.useEffect(()=>{var H;b&&((H=C.current)==null||H.scrollTo({top:0,behavior:"smooth"}))},[z,b]);const k=D.useCallback(()=>{const H=C.current;if(!H)return;const L=H.scrollTop<40;_(L)},[]);function P(H){return H?new Date(typeof H=="number"?H:String(H)).toLocaleTimeString("en-GB",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3}):"--"}return h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[h.jsx(yT,{className:"h-3.5 w-3.5 text-foreground-subtle shrink-0"}),h.jsxs("select",{value:d,onChange:H=>f(H.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(H=>h.jsx("option",{value:H,children:H},H))]}),h.jsxs("select",{value:p,onChange:H=>y(H.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(H=>h.jsx("option",{value:H,children:H},H))]}),h.jsxs("select",{value:i,onChange:H=>o(H.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 levels"}),h.jsx("option",{value:"debug",children:"Debug"}),h.jsx("option",{value:"info",children:"Info"}),h.jsx("option",{value:"warn",children:"Warn"}),h.jsx("option",{value:"error",children:"Error"})]}),h.jsxs("button",{type:"button",onClick:()=>{var L;const H=!b;_(H),H&&((L=C.current)==null||L.scrollTo({top:0,behavior:"smooth"}))},className:`inline-flex items-center gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs font-medium transition-colors ${b?"border-primary/30 bg-primary/10 text-primary":"border-border bg-surface text-foreground-subtle hover:text-foreground"}`,children:[h.jsx(RE,{className:"h-3.5 w-3.5"}),"Auto-scroll: ",b?"ON":"OFF"]})]}),O&&h.jsx("div",{className:"text-xs text-foreground-subtle animate-pulse",children:"Loading logs..."}),T&&h.jsx("div",{className:"text-xs text-danger",children:"Failed to load logs"}),!O&&!T&&z.length===0&&h.jsx("div",{className:"text-xs text-foreground-subtle italic",children:"No logs match the current filters"}),z.length>0&&h.jsx("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:h.jsx("div",{ref:C,onScroll:k,className:"max-h-[400px] overflow-y-auto",children:h.jsxs("table",{className:"w-full text-[10px]",children:[h.jsx("thead",{className:"sticky top-0",children:h.jsxs("tr",{children:[h.jsx("th",{className:"text-left px-2.5 py-1.5 text-foreground-subtle font-medium bg-surface border-b border-border w-24",children:"Time"}),h.jsx("th",{className:"text-left px-2.5 py-1.5 text-foreground-subtle font-medium bg-surface border-b border-border w-14",children:"Level"}),h.jsx("th",{className:"text-left px-2.5 py-1.5 text-foreground-subtle font-medium bg-surface border-b border-border w-28",children:"Scope"}),h.jsx("th",{className:"text-left px-2.5 py-1.5 text-foreground-subtle font-medium bg-surface border-b border-border",children:"Message"})]})}),h.jsx("tbody",{children:z.map((H,L)=>{const U=String(H.level??"info").toLowerCase(),V=t4[U]??t4.info,F=String(H.message??H.msg??H.text??""),re=Array.isArray(H.scope)?H.scope.join(" > "):String(H.scope??"");return h.jsxs("tr",{className:"hover:bg-primary/5",children:[h.jsx("td",{className:"px-2.5 py-1 text-foreground-subtle border-b border-border font-mono whitespace-nowrap",children:P(H.timestamp??H.ts??H.time)}),h.jsx("td",{className:"px-2.5 py-1 border-b border-border",children:h.jsx("span",{className:`inline-flex rounded-full px-1.5 py-0.5 text-[9px] font-medium uppercase ${V.badge}`,children:U})}),h.jsx("td",{className:"px-2.5 py-1 border-b border-border text-foreground-subtle font-mono truncate max-w-[180px]",title:re,children:re||"--"}),h.jsx("td",{className:`px-2.5 py-1 border-b border-border font-mono ${V.text} break-all`,children:F})]},L)})})]})})})]})}function UU(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:qU(t.subProcesses)}}function qU(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 u1({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 n4({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 HU(){const t=Ft(),e=ga(),[n,s]=D.useState("tree"),[i,o]=D.useState(null),{data:d}=ot({queryKey:["agents","testWorker","status"],queryFn:()=>t.trpc.agents.isTestWorkerRunning.query(),refetchInterval:5e3}),f=(d==null?void 0:d.running)??!1,p=Cn({mutationFn:()=>t.trpc.agents.startTestWorker.mutate(),onSuccess:()=>{e.invalidateQueries({queryKey:["agents"]}),e.invalidateQueries({queryKey:["agent"]})}}),y=Cn({mutationFn:()=>t.trpc.agents.stopTestWorker.mutate(),onSuccess:()=>{e.invalidateQueries({queryKey:["agents"]}),e.invalidateQueries({queryKey:["agent"]})}}),{data:v=[],isLoading:b}=ot({queryKey:["agent","processTree"],queryFn:()=>t.trpc.agent.processTree.query(),refetchInterval:5e3}),{data:_=[]}=ot({queryKey:["agents","list"],queryFn:()=>t.listAgents(),refetchInterval:5e3}),C=D.useMemo(()=>v.map(UU),[v]),w=C.length,R=C.reduce((z,k)=>z+k.subProcesses.length,0),O=C.reduce((z,k)=>z+k.installedAddons.length,0),T=D.useMemo(()=>C.filter(z=>!z.isHub).map(z=>z.name),[C]),M=D.useMemo(()=>{const z=new Set;for(const k of C)for(const P of k.installedAddons)z.add(P);return[...z].sort()},[C]);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(D6,{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(mT,{className:"h-3.5 w-3.5"}),p.isPending?"Starting...":"Start Test Agent"]})})]}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-4 gap-3",children:[h.jsx(u1,{icon:xb,label:"Agents online",value:w,color:"bg-green-500/10 text-green-400"}),h.jsx(u1,{icon:zf,label:"Sub-processes",value:R,color:"bg-blue-500/10 text-blue-400"}),h.jsx(u1,{icon:DT,label:"Installed addons",value:O,color:"bg-purple-500/10 text-purple-400"}),h.jsx(u1,{icon:xb,label:"Capabilities",value:[...new Set(C.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(n4,{tab:"tree",active:n==="tree",icon:mR,label:"Process Tree",onClick:()=>s("tree")}),h.jsx(n4,{tab:"logs",active:n==="logs",icon:Zm,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(CR,{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(kU,{entries:C,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(bl,{className:"h-3 w-3"}),"Clear selection"]})]}),h.jsx(LU,{agentNames:T,addonNames:M,preselectedAgent:i??void 0})]})]})}const a4={debug:{badge:"bg-foreground-subtle/10 text-foreground-subtle",text:"text-foreground-subtle"},info:{badge:"bg-info/10 text-info",text:"text-info"},warn:{badge:"bg-warning/10 text-warning",text:"text-warning"},error:{badge:"bg-danger/10 text-danger",text:"text-danger"}};function BU(){const t=Ft(),[e,n]=D.useState("all"),[s,i]=D.useState(!1),o=D.useRef(null),{data:d,isLoading:f,isError:p}=ot({queryKey:["logs",e],queryFn:()=>t.getLogs(e!=="all"?{level:e,limit:500}:{limit:500}),refetchInterval:s?!1:3e3}),y=d??[],v=D.useMemo(()=>[...y].reverse(),[y]);D.useEffect(()=>{var _;s||(_=o.current)==null||_.scrollIntoView({behavior:"smooth"})},[v,s]);function b(_){return _?new Date(typeof _=="number"?_:String(_)).toLocaleTimeString("en-GB",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3}):"—"}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:"Logs"}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("select",{value:e,onChange:_=>n(_.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 levels"}),h.jsx("option",{value:"debug",children:"Debug"}),h.jsx("option",{value:"info",children:"Info"}),h.jsx("option",{value:"warn",children:"Warn"}),h.jsx("option",{value:"error",children:"Error"})]}),h.jsxs("button",{onClick:()=>i(_=>!_),className:`inline-flex items-center gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs font-medium transition-colors ${s?"border-primary/30 bg-primary/10 text-primary hover:bg-primary/20":"border-border bg-surface text-foreground-subtle hover:text-foreground"}`,children:[s?h.jsx(K1,{className:"h-3.5 w-3.5"}):h.jsx(O6,{className:"h-3.5 w-3.5"}),s?"Resume":"Pause"]})]})]}),f&&h.jsx("div",{className:"text-xs text-foreground-subtle animate-pulse",children:"Loading..."}),p&&h.jsx("div",{className:"text-xs text-danger",children:"Failed to load"}),!f&&!p&&v.length===0&&h.jsx("div",{className:"text-xs text-foreground-subtle",children:"No data"}),v.length>0&&h.jsx("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:h.jsxs("div",{className:"max-h-[calc(100vh-220px)] overflow-y-auto",children:[h.jsx("div",{ref:o}),h.jsxs("table",{className:"w-full text-xs",children:[h.jsx("thead",{className:"sticky top-0",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 w-36",children:"Time"}),h.jsx("th",{className:"text-left px-3 py-2 text-foreground-subtle font-medium bg-surface border-b border-border w-16",children:"Level"}),h.jsx("th",{className:"text-left px-3 py-2 text-foreground-subtle font-medium bg-surface border-b border-border",children:"Message"})]})}),h.jsx("tbody",{children:v.map((_,C)=>{const w=String(_.level??"info").toLowerCase(),R=a4[w]??a4.info,O=String(_.message??_.msg??_.text??"");return h.jsxs("tr",{className:"hover:bg-primary/5",children:[h.jsx("td",{className:"px-3 py-1.5 text-foreground-subtle border-b border-border font-mono whitespace-nowrap",children:b(_.timestamp??_.ts??_.time)}),h.jsx("td",{className:"px-3 py-1.5 border-b border-border",children:h.jsx("span",{className:`inline-flex rounded-full px-2 py-0.5 text-[10px] font-medium uppercase ${R.badge}`,children:w})}),h.jsx("td",{className:`px-3 py-1.5 border-b border-border font-mono ${R.text} break-all`,children:O})]},C)})})]})]})})]})}const s4={super_admin:"bg-danger/10 text-danger",admin:"bg-primary/10 text-primary",viewer:"bg-foreground-subtle/10 text-foreground-subtle"};function GU(){const t=Ft(),e=ga(),[n,s]=D.useState(!1),[i,o]=D.useState(""),[d,f]=D.useState(""),[p,y]=D.useState("viewer"),[v,b]=D.useState(null),{data:_,isLoading:C,isError:w}=ot({queryKey:["users"],queryFn:()=>t.listUsers()}),R=Cn({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 T(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(bl,{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"})]})]})]}),v&&h.jsx("p",{className:"text-[10px] text-danger",children:v}),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:()=>R.mutate(),disabled:R.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:R.isPending?"Creating...":"Create"})]})]}),C&&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"}),!C&&!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=s4[z]??s4.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:T(M.createdAt??M.created_at??M.createdAt)})]},String(M.id??M.username))})})]})})]})}function PU({section:t}){var T,M,z;const e=Ft(),n=ga(),[s,i]=D.useState(null),[o,d]=D.useState(!1),[f,p]=D.useState(null),y=ot({queryKey:["settings-schema",t],queryFn:()=>e.getSettingsSchema(t),staleTime:1/0}),v=ot({queryKey:["settings",t],queryFn:()=>e.getSettings(t)}),b=(T=y.data)==null?void 0:T.schema,_=((M=y.data)==null?void 0:M.readOnly)??!1,C=((z=v.data)==null?void 0:z.data)??{},w=s??C,R=s!==null,O=Cn({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||v.isLoading?h.jsx("div",{className:"text-xs text-foreground-subtle animate-pulse py-4",children:"Loading..."}):y.isError||v.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(ny,{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}),R&&h.jsx("span",{className:"text-[10px] text-orange-400",children:"Unsaved changes"}),h.jsx("button",{type:"button",onClick:()=>O.mutate(w),disabled:O.isPending||!R,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 YU(){var d;const t=Ft(),e=ot({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(PU,{section:o},o)]})}const VU={streaming:{icon:_R,label:"Stream"},detection:{icon:ch,label:"Detection"},recording:{icon:j6,label:"Recording"},audio:{icon:R6,label:"Audio"}};function QU({capabilities:t}){return h.jsx("div",{className:"flex items-center gap-1",children:t.map(e=>{const n=VU[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 to({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 KU={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 XU(){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(to,{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(to,{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(to,{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(to,{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(FU,{})]})}),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(to,{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(th,{status:n},n))})]}),h.jsxs("div",{children:[h.jsx("p",{className:"text-xs text-foreground-subtle mb-2",children:"CapabilityBadges"}),h.jsx(QU,{capabilities:["streaming","detection","recording","audio"]})]})]})}),h.jsx(to,{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(to,{title:"Provider Icons",children:h.jsx("div",{className:"flex flex-wrap gap-4",children:["frigate","scrypted","reolink","homeassistant","rtsp","onvif"].map(n=>h.jsx(ty,{type:n,size:"lg",showLabel:!0},n))})}),h.jsxs(to,{title:"Form Builder Demo",children:[h.jsx(ny,{schema:KU,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(to,{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 FU(){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 r4={info:{bg:"bg-blue-500/10",border:"border-blue-500/30",icon:j1},warning:{bg:"bg-orange-500/10",border:"border-orange-500/30",icon:hv},critical:{bg:"bg-red-500/10",border:"border-red-500/30",icon:_6}};function ZU({toast:t,onDismiss:e}){const n=r4[t.severity]??r4.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(bl,{className:"h-3.5 w-3.5 text-foreground-subtle"})})]})}function JU(){const[t,e]=D.useState([]),n=Ft(),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(ZU,{toast:i,onDismiss:s})},i.id))})}const IU=new P4({defaultOptions:{queries:{staleTime:3e4,retry:!1,refetchOnWindowFocus:!1}}});function WU(){return h.jsx(x_,{defaultMode:"dark",children:h.jsx(Y4,{client:IU,children:h.jsx(gU,{children:h.jsxs(SE,{children:[h.jsx(l_,{children:h.jsxs(UN,{children:[h.jsx(La,{path:"/login",element:h.jsx(_O,{})}),h.jsx(La,{path:"/access-denied",element:h.jsx(jO,{})}),h.jsx(La,{path:"/showroom",element:h.jsx(XU,{})}),h.jsxs(La,{element:h.jsx(Au,{children:h.jsx(NO,{})}),children:[h.jsx(La,{index:!0,element:h.jsx(ib,{to:"/dashboard",replace:!0})}),h.jsx(La,{path:"/dashboard",element:h.jsx(FM,{})}),h.jsx(La,{path:"/cameras",element:h.jsx($M,{})}),h.jsx(La,{path:"/integrations",element:h.jsx(TA,{})}),h.jsx(La,{path:"/integrations/:integrationId",element:h.jsx(zA,{})}),h.jsx(La,{path:"/timeline",element:h.jsx(VA,{})}),h.jsx(La,{path:"/pipeline",element:h.jsx(XA,{})}),h.jsx(La,{path:"/devices/:deviceId",element:h.jsx(pU,{})}),h.jsx(La,{path:"/system/agents",element:h.jsx(Au,{requiredRole:"admin",children:h.jsx(HU,{})})}),h.jsx(La,{path:"/system/logs",element:h.jsx(Au,{requiredRole:"admin",children:h.jsx(BU,{})})}),h.jsx(La,{path:"/system/users",element:h.jsx(Au,{requiredRole:"admin",children:h.jsx(GU,{})})}),h.jsx(La,{path:"/system/settings",element:h.jsx(Au,{requiredRole:"admin",children:h.jsx(YU,{})})}),h.jsx(La,{path:"/system/addons",element:h.jsx(Au,{requiredRole:"admin",children:h.jsx(TU,{})})}),h.jsx(La,{path:"/addon/:pagePath",element:h.jsx(Au,{requiredRole:"admin",children:h.jsx(bO,{})})})]})]})}),h.jsx(JU,{})]})})})})}const $U={dashboard:"Dashboard",integrations:"Integrations",metrics:"Metrics"},eq={title:"System",addons:"Addons",agents:"Agents",processes:"Processes",logs:"Logs",users:"Users",settings:"Settings",repl:"REPL",models:"Models"},tq={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"},nq={online:"Online",offline:"Offline",connecting:"Connecting",error:"Error",disabled:"Disabled",enabled:"Enabled",active:"Active",inactive:"Inactive",running:"Running",stopped:"Stopped",pending:"Pending",unknown:"Unknown"},aq={login:"Login",logout:"Logout",username:"Username",password:"Password",signIn:"Sign In",invalidCredentials:"Invalid username or password"},sq={dark:"Dark",light:"Light",system:"System"},rq={select:"Language",en:"English",it:"Italian"},iq={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"}},lq={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"},oq={nav:$U,system:eq,common:tq,status:nq,auth:aq,theme:sq,language:rq,pages:iq,integrations:lq},cq={dashboard:"Dashboard",integrations:"Integrazioni",metrics:"Metriche"},uq={title:"Sistema",addons:"Addon",agents:"Agenti",processes:"Processi",logs:"Log",users:"Utenti",settings:"Impostazioni",repl:"REPL",models:"Modelli"},dq={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"},fq={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"},hq={login:"Accesso",logout:"Esci",username:"Nome utente",password:"Password",signIn:"Accedi",invalidCredentials:"Nome utente o password non validi"},pq={dark:"Scuro",light:"Chiaro",system:"Sistema"},mq={select:"Lingua",en:"Inglese",it:"Italiano"},gq={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"}},yq={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"},xq={nav:cq,system:uq,common:dq,status:fq,auth:hq,theme:pq,language:mq,pages:gq,integrations:yq},t7="camstack_language",bq=localStorage.getItem(t7)??"en";vs.use(uO).init({resources:{en:{translation:oq},it:{translation:xq}},lng:bq,fallbackLng:"en",interpolation:{escapeValue:!1}});vs.on("languageChanged",t=>{localStorage.setItem(t7,t)});window.__camstackReact=G7;U9();Yb.createRoot(document.getElementById("root")).render(h.jsx(D.StrictMode,{children:h.jsx(WU,{})}));