tokmon 0.28.5 → 0.28.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{bootstrap-ink-RXSGXK7H.js → bootstrap-ink-PYYVQAYP.js} +25 -9
- package/dist/{chunk-NNQGZNX4.js → chunk-23NB5Z6V.js} +64 -9
- package/dist/{chunk-KLRDULRC.js → chunk-6E2OJCIQ.js} +4 -4
- package/dist/{chunk-TN6V7XSL.js → chunk-BZFDTIFV.js} +32 -10
- package/dist/{chunk-CFKUZCMB.js → chunk-DESEB73E.js} +7 -6
- package/dist/{chunk-5B3XCEMC.js → chunk-MMAKKTCU.js} +2 -1
- package/dist/{chunk-HNWEJ6MS.js → chunk-O7ORALKA.js} +2 -0
- package/dist/{chunk-6YJ5H3JT.js → chunk-RY24UHMK.js} +2 -2
- package/dist/{chunk-EEMD2PXA.js → chunk-UON47FYF.js} +11 -3
- package/dist/{cli-command-4XXKT32M.js → cli-command-MW6EBLNA.js} +17 -8
- package/dist/cli.js +6 -6
- package/dist/{config-3DGZ47F7.js → config-JEDXAKPZ.js} +1 -1
- package/dist/{daemon-D42FZQC5.js → daemon-XB6ZORTE.js} +6 -6
- package/dist/daemon-handle-4WDYZBVL.js +11 -0
- package/dist/server-LNFK5MRX.js +12 -0
- package/dist/web/assets/{Area-DSOnmPHW.js → Area-BqyvRn2x.js} +1 -1
- package/dist/web/assets/{analytics-CQcXEq3U.js → analytics-B6QwqU9g.js} +2 -2
- package/dist/web/assets/{breakdown-DLwDPWvA.js → breakdown-DYnVKScr.js} +1 -1
- package/dist/web/assets/{button-D767RAip.js → button-CnT5g-Jl.js} +1 -1
- package/dist/web/assets/{chart-CylR-9UK.js → chart-Duz9D-nH.js} +1 -1
- package/dist/web/assets/{explore-jBA0FMUo.js → explore-P2EolJrt.js} +1 -1
- package/dist/web/assets/{index-DMNfKjk7.js → index-9hkGpa7j.js} +12 -12
- package/dist/web/assets/{models-B4X_VrrZ.js → models-8B4FBxr7.js} +2 -2
- package/dist/web/assets/{overview-E1xtkiJT.js → overview-DXA_HAsw.js} +2 -2
- package/dist/web/assets/{panel-Cna_MX7C.js → panel-gxLFBb8y.js} +1 -1
- package/dist/web/assets/settings-sheet-CJJl-3Gw.js +1 -0
- package/dist/web/assets/{share-sheet-BBs3U9QV.js → share-sheet-CXdyA1ga.js} +1 -1
- package/dist/web/assets/{timeline-DAOfy1yc.js → timeline-CzC85trW.js} +1 -1
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
- package/dist/daemon-handle-RHIX5OYY.js +0 -11
- package/dist/server-BNZCKS2A.js +0 -12
- package/dist/web/assets/settings-sheet-Uba9f8CS.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./share-sheet-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./share-sheet-CXdyA1ga.js","./button-CnT5g-Jl.js","./chart-Duz9D-nH.js","./Area-BqyvRn2x.js","./overview-DXA_HAsw.js","./panel-gxLFBb8y.js","./timeline-CzC85trW.js","./analytics-B6QwqU9g.js","./breakdown-DYnVKScr.js","./models-8B4FBxr7.js","./explore-P2EolJrt.js","./settings-sheet-CJJl-3Gw.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var Wb=Object.defineProperty;var Hb=(e,t,n)=>t in e?Wb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var M=(e,t,n)=>Hb(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))o(i);new MutationObserver(i=>{for(const c of i)if(c.type==="childList")for(const l of c.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&o(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const c={};return i.integrity&&(c.integrity=i.integrity),i.referrerPolicy&&(c.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?c.credentials="include":i.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function o(i){if(i.ep)return;i.ep=!0;const c=n(i);fetch(i.href,c)}})();var E$=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Kb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var lh={exports:{}},la={},fh={exports:{}},Te={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react.production.min.js
|
|
@@ -7,7 +7,7 @@ var Wb=Object.defineProperty;var Hb=(e,t,n)=>t in e?Wb(e,t,{enumerable:!0,config
|
|
|
7
7
|
*
|
|
8
8
|
* This source code is licensed under the MIT license found in the
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var Fv;function Qb(){if(Fv)return Te;Fv=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),l=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.iterator;function v(I){return I===null||typeof I!="object"?null:(I=g&&I[g]||I["@@iterator"],typeof I=="function"?I:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,E={};function P(I,Z,pe){this.props=I,this.context=Z,this.refs=E,this.updater=pe||w}P.prototype.isReactComponent={},P.prototype.setState=function(I,Z){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,Z,"setState")},P.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function H(){}H.prototype=P.prototype;function _(I,Z,pe){this.props=I,this.context=Z,this.refs=E,this.updater=pe||w}var O=_.prototype=new H;O.constructor=_,S(O,P.prototype),O.isPureReactComponent=!0;var C=Array.isArray,D=Object.prototype.hasOwnProperty,T={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};function $(I,Z,pe){var me,le={},
|
|
10
|
+
*/var Fv;function Qb(){if(Fv)return Te;Fv=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),l=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.iterator;function v(I){return I===null||typeof I!="object"?null:(I=g&&I[g]||I["@@iterator"],typeof I=="function"?I:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,E={};function P(I,Z,pe){this.props=I,this.context=Z,this.refs=E,this.updater=pe||w}P.prototype.isReactComponent={},P.prototype.setState=function(I,Z){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,Z,"setState")},P.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function H(){}H.prototype=P.prototype;function _(I,Z,pe){this.props=I,this.context=Z,this.refs=E,this.updater=pe||w}var O=_.prototype=new H;O.constructor=_,S(O,P.prototype),O.isPureReactComponent=!0;var C=Array.isArray,D=Object.prototype.hasOwnProperty,T={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};function $(I,Z,pe){var me,le={},Fe=null,fe=null;if(Z!=null)for(me in Z.ref!==void 0&&(fe=Z.ref),Z.key!==void 0&&(Fe=""+Z.key),Z)D.call(Z,me)&&!L.hasOwnProperty(me)&&(le[me]=Z[me]);var xe=arguments.length-2;if(xe===1)le.children=pe;else if(1<xe){for(var be=Array(xe),Ve=0;Ve<xe;Ve++)be[Ve]=arguments[Ve+2];le.children=be}if(I&&I.defaultProps)for(me in xe=I.defaultProps,xe)le[me]===void 0&&(le[me]=xe[me]);return{$$typeof:e,type:I,key:Fe,ref:fe,props:le,_owner:T.current}}function q(I,Z){return{$$typeof:e,type:I.type,key:Z,ref:I.ref,props:I.props,_owner:I._owner}}function ee(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function se(I){var Z={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(pe){return Z[pe]})}var K=/\/+/g;function k(I,Z){return typeof I=="object"&&I!==null&&I.key!=null?se(""+I.key):Z.toString(36)}function U(I,Z,pe,me,le){var Fe=typeof I;(Fe==="undefined"||Fe==="boolean")&&(I=null);var fe=!1;if(I===null)fe=!0;else switch(Fe){case"string":case"number":fe=!0;break;case"object":switch(I.$$typeof){case e:case t:fe=!0}}if(fe)return fe=I,le=le(fe),I=me===""?"."+k(fe,0):me,C(le)?(pe="",I!=null&&(pe=I.replace(K,"$&/")+"/"),U(le,Z,pe,"",function(Ve){return Ve})):le!=null&&(ee(le)&&(le=q(le,pe+(!le.key||fe&&fe.key===le.key?"":(""+le.key).replace(K,"$&/")+"/")+I)),Z.push(le)),1;if(fe=0,me=me===""?".":me+":",C(I))for(var xe=0;xe<I.length;xe++){Fe=I[xe];var be=me+k(Fe,xe);fe+=U(Fe,Z,pe,be,le)}else if(be=v(I),typeof be=="function")for(I=be.call(I),xe=0;!(Fe=I.next()).done;)Fe=Fe.value,be=me+k(Fe,xe++),fe+=U(Fe,Z,pe,be,le);else if(Fe==="object")throw Z=String(I),Error("Objects are not valid as a React child (found: "+(Z==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":Z)+"). If you meant to render a collection of children, use an array instead.");return fe}function V(I,Z,pe){if(I==null)return I;var me=[],le=0;return U(I,me,"","",function(Fe){return Z.call(pe,Fe,le++)}),me}function J(I){if(I._status===-1){var Z=I._result;Z=Z(),Z.then(function(pe){(I._status===0||I._status===-1)&&(I._status=1,I._result=pe)},function(pe){(I._status===0||I._status===-1)&&(I._status=2,I._result=pe)}),I._status===-1&&(I._status=0,I._result=Z)}if(I._status===1)return I._result.default;throw I._result}var B={current:null},X={transition:null},ne={ReactCurrentDispatcher:B,ReactCurrentBatchConfig:X,ReactCurrentOwner:T};function te(){throw Error("act(...) is not supported in production builds of React.")}return Te.Children={map:V,forEach:function(I,Z,pe){V(I,function(){Z.apply(this,arguments)},pe)},count:function(I){var Z=0;return V(I,function(){Z++}),Z},toArray:function(I){return V(I,function(Z){return Z})||[]},only:function(I){if(!ee(I))throw Error("React.Children.only expected to receive a single React element child.");return I}},Te.Component=P,Te.Fragment=n,Te.Profiler=i,Te.PureComponent=_,Te.StrictMode=o,Te.Suspense=h,Te.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ne,Te.act=te,Te.cloneElement=function(I,Z,pe){if(I==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+I+".");var me=S({},I.props),le=I.key,Fe=I.ref,fe=I._owner;if(Z!=null){if(Z.ref!==void 0&&(Fe=Z.ref,fe=T.current),Z.key!==void 0&&(le=""+Z.key),I.type&&I.type.defaultProps)var xe=I.type.defaultProps;for(be in Z)D.call(Z,be)&&!L.hasOwnProperty(be)&&(me[be]=Z[be]===void 0&&xe!==void 0?xe[be]:Z[be])}var be=arguments.length-2;if(be===1)me.children=pe;else if(1<be){xe=Array(be);for(var Ve=0;Ve<be;Ve++)xe[Ve]=arguments[Ve+2];me.children=xe}return{$$typeof:e,type:I.type,key:le,ref:Fe,props:me,_owner:fe}},Te.createContext=function(I){return I={$$typeof:l,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},I.Provider={$$typeof:c,_context:I},I.Consumer=I},Te.createElement=$,Te.createFactory=function(I){var Z=$.bind(null,I);return Z.type=I,Z},Te.createRef=function(){return{current:null}},Te.forwardRef=function(I){return{$$typeof:d,render:I}},Te.isValidElement=ee,Te.lazy=function(I){return{$$typeof:y,_payload:{_status:-1,_result:I},_init:J}},Te.memo=function(I,Z){return{$$typeof:p,type:I,compare:Z===void 0?null:Z}},Te.startTransition=function(I){var Z=X.transition;X.transition={};try{I()}finally{X.transition=Z}},Te.unstable_act=te,Te.useCallback=function(I,Z){return B.current.useCallback(I,Z)},Te.useContext=function(I){return B.current.useContext(I)},Te.useDebugValue=function(){},Te.useDeferredValue=function(I){return B.current.useDeferredValue(I)},Te.useEffect=function(I,Z){return B.current.useEffect(I,Z)},Te.useId=function(){return B.current.useId()},Te.useImperativeHandle=function(I,Z,pe){return B.current.useImperativeHandle(I,Z,pe)},Te.useInsertionEffect=function(I,Z){return B.current.useInsertionEffect(I,Z)},Te.useLayoutEffect=function(I,Z){return B.current.useLayoutEffect(I,Z)},Te.useMemo=function(I,Z){return B.current.useMemo(I,Z)},Te.useReducer=function(I,Z,pe){return B.current.useReducer(I,Z,pe)},Te.useRef=function(I){return B.current.useRef(I)},Te.useState=function(I){return B.current.useState(I)},Te.useSyncExternalStore=function(I,Z,pe){return B.current.useSyncExternalStore(I,Z,pe)},Te.useTransition=function(){return B.current.useTransition()},Te.version="18.3.1",Te}var Iv;function Qa(){return Iv||(Iv=1,fh.exports=Qb()),fh.exports}/**
|
|
11
11
|
* @license React
|
|
12
12
|
* react-jsx-runtime.production.min.js
|
|
13
13
|
*
|
|
@@ -23,7 +23,7 @@ var Wb=Object.defineProperty;var Hb=(e,t,n)=>t in e?Wb(e,t,{enumerable:!0,config
|
|
|
23
23
|
*
|
|
24
24
|
* This source code is licensed under the MIT license found in the
|
|
25
25
|
* LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/var Av;function Yb(){return Av||(Av=1,(function(e){function t(X,ne){var te=X.length;X.push(ne);e:for(;0<te;){var I=te-1>>>1,Z=X[I];if(0<i(Z,ne))X[I]=ne,X[te]=Z,te=I;else break e}}function n(X){return X.length===0?null:X[0]}function o(X){if(X.length===0)return null;var ne=X[0],te=X.pop();if(te!==ne){X[0]=te;e:for(var I=0,Z=X.length,pe=Z>>>1;I<pe;){var me=2*(I+1)-1,le=X[me],
|
|
26
|
+
*/var Av;function Yb(){return Av||(Av=1,(function(e){function t(X,ne){var te=X.length;X.push(ne);e:for(;0<te;){var I=te-1>>>1,Z=X[I];if(0<i(Z,ne))X[I]=ne,X[te]=Z,te=I;else break e}}function n(X){return X.length===0?null:X[0]}function o(X){if(X.length===0)return null;var ne=X[0],te=X.pop();if(te!==ne){X[0]=te;e:for(var I=0,Z=X.length,pe=Z>>>1;I<pe;){var me=2*(I+1)-1,le=X[me],Fe=me+1,fe=X[Fe];if(0>i(le,te))Fe<Z&&0>i(fe,le)?(X[I]=fe,X[Fe]=te,I=Fe):(X[I]=le,X[me]=te,I=me);else if(Fe<Z&&0>i(fe,te))X[I]=fe,X[Fe]=te,I=Fe;else break e}}return ne}function i(X,ne){var te=X.sortIndex-ne.sortIndex;return te!==0?te:X.id-ne.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var l=Date,d=l.now();e.unstable_now=function(){return l.now()-d}}var h=[],p=[],y=1,g=null,v=3,w=!1,S=!1,E=!1,P=typeof setTimeout=="function"?setTimeout:null,H=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function O(X){for(var ne=n(p);ne!==null;){if(ne.callback===null)o(p);else if(ne.startTime<=X)o(p),ne.sortIndex=ne.expirationTime,t(h,ne);else break;ne=n(p)}}function C(X){if(E=!1,O(X),!S)if(n(h)!==null)S=!0,J(D);else{var ne=n(p);ne!==null&&B(C,ne.startTime-X)}}function D(X,ne){S=!1,E&&(E=!1,H($),$=-1),w=!0;var te=v;try{for(O(ne),g=n(h);g!==null&&(!(g.expirationTime>ne)||X&&!se());){var I=g.callback;if(typeof I=="function"){g.callback=null,v=g.priorityLevel;var Z=I(g.expirationTime<=ne);ne=e.unstable_now(),typeof Z=="function"?g.callback=Z:g===n(h)&&o(h),O(ne)}else o(h);g=n(h)}if(g!==null)var pe=!0;else{var me=n(p);me!==null&&B(C,me.startTime-ne),pe=!1}return pe}finally{g=null,v=te,w=!1}}var T=!1,L=null,$=-1,q=5,ee=-1;function se(){return!(e.unstable_now()-ee<q)}function K(){if(L!==null){var X=e.unstable_now();ee=X;var ne=!0;try{ne=L(!0,X)}finally{ne?k():(T=!1,L=null)}}else T=!1}var k;if(typeof _=="function")k=function(){_(K)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,V=U.port2;U.port1.onmessage=K,k=function(){V.postMessage(null)}}else k=function(){P(K,0)};function J(X){L=X,T||(T=!0,k())}function B(X,ne){$=P(function(){X(e.unstable_now())},ne)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(X){X.callback=null},e.unstable_continueExecution=function(){S||w||(S=!0,J(D))},e.unstable_forceFrameRate=function(X){0>X||125<X?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):q=0<X?Math.floor(1e3/X):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return n(h)},e.unstable_next=function(X){switch(v){case 1:case 2:case 3:var ne=3;break;default:ne=v}var te=v;v=ne;try{return X()}finally{v=te}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(X,ne){switch(X){case 1:case 2:case 3:case 4:case 5:break;default:X=3}var te=v;v=X;try{return ne()}finally{v=te}},e.unstable_scheduleCallback=function(X,ne,te){var I=e.unstable_now();switch(typeof te=="object"&&te!==null?(te=te.delay,te=typeof te=="number"&&0<te?I+te:I):te=I,X){case 1:var Z=-1;break;case 2:Z=250;break;case 5:Z=1073741823;break;case 4:Z=1e4;break;default:Z=5e3}return Z=te+Z,X={id:y++,callback:ne,priorityLevel:X,startTime:te,expirationTime:Z,sortIndex:-1},te>I?(X.sortIndex=te,t(p,X),n(h)===null&&X===n(p)&&(E?(H($),$=-1):E=!0,B(C,te-I))):(X.sortIndex=Z,t(h,X),S||w||(S=!0,J(D))),X},e.unstable_shouldYield=se,e.unstable_wrapCallback=function(X){var ne=v;return function(){var te=v;v=ne;try{return X.apply(this,arguments)}finally{v=te}}}})(mh)),mh}var Mv;function Xb(){return Mv||(Mv=1,hh.exports=Yb()),hh.exports}/**
|
|
27
27
|
* @license React
|
|
28
28
|
* react-dom.production.min.js
|
|
29
29
|
*
|
|
@@ -35,11 +35,11 @@ var Wb=Object.defineProperty;var Hb=(e,t,n)=>t in e?Wb(e,t,{enumerable:!0,config
|
|
|
35
35
|
`+I+r}var pe=!1;function me(r,s){if(!r||pe)return"";pe=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(s)if(s=function(){throw Error()},Object.defineProperty(s.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(s,[])}catch(G){var u=G}Reflect.construct(r,[],s)}else{try{s.call()}catch(G){u=G}r.call(s.prototype)}else{try{throw Error()}catch(G){u=G}r()}}catch(G){if(G&&u&&typeof G.stack=="string"){for(var f=G.stack.split(`
|
|
36
36
|
`),m=u.stack.split(`
|
|
37
37
|
`),x=f.length-1,b=m.length-1;1<=x&&0<=b&&f[x]!==m[b];)b--;for(;1<=x&&0<=b;x--,b--)if(f[x]!==m[b]){if(x!==1||b!==1)do if(x--,b--,0>b||f[x]!==m[b]){var R=`
|
|
38
|
-
`+f[x].replace(" at new "," at ");return r.displayName&&R.includes("<anonymous>")&&(R=R.replace("<anonymous>",r.displayName)),R}while(1<=x&&0<=b);break}}}finally{pe=!1,Error.prepareStackTrace=a}return(r=r?r.displayName||r.name:"")?Z(r):""}function le(r){switch(r.tag){case 5:return Z(r.type);case 16:return Z("Lazy");case 13:return Z("Suspense");case 19:return Z("SuspenseList");case 0:case 2:case 15:return r=me(r.type,!1),r;case 11:return r=me(r.type.render,!1),r;case 1:return r=me(r.type,!0),r;default:return""}}function Pe(r){if(r==null)return null;if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case L:return"Fragment";case T:return"Portal";case q:return"Profiler";case $:return"StrictMode";case k:return"Suspense";case U:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case se:return(r.displayName||"Context")+".Consumer";case ee:return(r._context.displayName||"Context")+".Provider";case K:var s=r.render;return r=r.displayName,r||(r=s.displayName||s.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case V:return s=r.displayName||null,s!==null?s:Pe(r.type)||"Memo";case J:s=r._payload,r=r._init;try{return Pe(r(s))}catch{}}return null}function fe(r){var s=r.type;switch(r.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return r=s.render,r=r.displayName||r.name||"",s.displayName||(r!==""?"ForwardRef("+r+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Pe(s);case 8:return s===$?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function xe(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function be(r){var s=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Ve(r){var s=be(r)?"checked":"value",a=Object.getOwnPropertyDescriptor(r.constructor.prototype,s),u=""+r[s];if(!r.hasOwnProperty(s)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var f=a.get,m=a.set;return Object.defineProperty(r,s,{configurable:!0,get:function(){return f.call(this)},set:function(x){u=""+x,m.call(this,x)}}),Object.defineProperty(r,s,{enumerable:a.enumerable}),{getValue:function(){return u},setValue:function(x){u=""+x},stopTracking:function(){r._valueTracker=null,delete r[s]}}}}function on(r){r._valueTracker||(r._valueTracker=Ve(r))}function xn(r){if(!r)return!1;var s=r._valueTracker;if(!s)return!0;var a=s.getValue(),u="";return r&&(u=be(r)?r.checked?"true":"false":r.value),r=u,r!==a?(s.setValue(r),!0):!1}function br(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}function Wr(r,s){var a=s.checked;return te({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:a??r._wrapperState.initialChecked})}function mc(r,s){var a=s.defaultValue==null?"":s.defaultValue,u=s.checked!=null?s.checked:s.defaultChecked;a=xe(s.value!=null?s.value:a),r._wrapperState={initialChecked:u,initialValue:a,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function _i(r,s){s=s.checked,s!=null&&O(r,"checked",s,!1)}function wo(r,s){_i(r,s);var a=xe(s.value),u=s.type;if(a!=null)u==="number"?(a===0&&r.value===""||r.value!=a)&&(r.value=""+a):r.value!==""+a&&(r.value=""+a);else if(u==="submit"||u==="reset"){r.removeAttribute("value");return}s.hasOwnProperty("value")?As(r,s.type,a):s.hasOwnProperty("defaultValue")&&As(r,s.type,xe(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(r.defaultChecked=!!s.defaultChecked)}function Pr(r,s,a){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var u=s.type;if(!(u!=="submit"&&u!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+r._wrapperState.initialValue,a||s===r.value||(r.value=s),r.defaultValue=s}a=r.name,a!==""&&(r.name=""),r.defaultChecked=!!r._wrapperState.initialChecked,a!==""&&(r.name=a)}function As(r,s,a){(s!=="number"||br(r.ownerDocument)!==r)&&(a==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+a&&(r.defaultValue=""+a))}var wn=Array.isArray;function Hr(r,s,a,u){if(r=r.options,s){s={};for(var f=0;f<a.length;f++)s["$"+a[f]]=!0;for(a=0;a<r.length;a++)f=s.hasOwnProperty("$"+r[a].value),r[a].selected!==f&&(r[a].selected=f),f&&u&&(r[a].defaultSelected=!0)}else{for(a=""+xe(a),s=null,f=0;f<r.length;f++){if(r[f].value===a){r[f].selected=!0,u&&(r[f].defaultSelected=!0);return}s!==null||r[f].disabled||(s=r[f])}s!==null&&(s.selected=!0)}}function ko(r,s){if(s.dangerouslySetInnerHTML!=null)throw Error(n(91));return te({},s,{value:void 0,defaultValue:void 0,children:""+r._wrapperState.initialValue})}function pc(r,s){var a=s.value;if(a==null){if(a=s.children,s=s.defaultValue,a!=null){if(s!=null)throw Error(n(92));if(wn(a)){if(1<a.length)throw Error(n(93));a=a[0]}s=a}s==null&&(s=""),a=s}r._wrapperState={initialValue:xe(a)}}function Ci(r,s){var a=xe(s.value),u=xe(s.defaultValue);a!=null&&(a=""+a,a!==r.value&&(r.value=a),s.defaultValue==null&&r.defaultValue!==a&&(r.defaultValue=a)),u!=null&&(r.defaultValue=""+u)}function Be(r){var s=r.textContent;s===r._wrapperState.initialValue&&s!==""&&s!==null&&(r.value=s)}function Lt(r){switch(r){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Hn(r,s){return r==null||r==="http://www.w3.org/1999/xhtml"?Lt(s):r==="http://www.w3.org/2000/svg"&&s==="foreignObject"?"http://www.w3.org/1999/xhtml":r}var Eo,zg=(function(r){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(s,a,u,f){MSApp.execUnsafeLocalFunction(function(){return r(s,a,u,f)})}:r})(function(r,s){if(r.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in r)r.innerHTML=s;else{for(Eo=Eo||document.createElement("div"),Eo.innerHTML="<svg>"+s.valueOf().toString()+"</svg>",s=Eo.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;s.firstChild;)r.appendChild(s.firstChild)}});function bi(r,s){if(s){var a=r.firstChild;if(a&&a===r.lastChild&&a.nodeType===3){a.nodeValue=s;return}}r.textContent=s}var Pi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},J_=["Webkit","ms","Moz","O"];Object.keys(Pi).forEach(function(r){J_.forEach(function(s){s=s+r.charAt(0).toUpperCase()+r.substring(1),Pi[s]=Pi[r]})});function Vg(r,s,a){return s==null||typeof s=="boolean"||s===""?"":a||typeof s!="number"||s===0||Pi.hasOwnProperty(r)&&Pi[r]?(""+s).trim():s+"px"}function qg(r,s){r=r.style;for(var a in s)if(s.hasOwnProperty(a)){var u=a.indexOf("--")===0,f=Vg(a,s[a],u);a==="float"&&(a="cssFloat"),u?r.setProperty(a,f):r[a]=f}}var G_=te({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function kf(r,s){if(s){if(G_[r]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(n(137,r));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(n(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(n(61))}if(s.style!=null&&typeof s.style!="object")throw Error(n(62))}}function Ef(r,s){if(r.indexOf("-")===-1)return typeof s.is=="string";switch(r){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 _f=null;function Cf(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var bf=null,_o=null,Co=null;function Wg(r){if(r=Ji(r)){if(typeof bf!="function")throw Error(n(280));var s=r.stateNode;s&&(s=jc(s),bf(r.stateNode,r.type,s))}}function Hg(r){_o?Co?Co.push(r):Co=[r]:_o=r}function Kg(){if(_o){var r=_o,s=Co;if(Co=_o=null,Wg(r),s)for(r=0;r<s.length;r++)Wg(s[r])}}function Qg(r,s){return r(s)}function Jg(){}var Pf=!1;function Gg(r,s,a){if(Pf)return r(s,a);Pf=!0;try{return Qg(r,s,a)}finally{Pf=!1,(_o!==null||Co!==null)&&(Jg(),Kg())}}function Fi(r,s){var a=r.stateNode;if(a===null)return null;var u=jc(a);if(u===null)return null;a=u[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(r=r.type,u=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!u;break e;default:r=!1}if(r)return null;if(a&&typeof a!="function")throw Error(n(231,s,typeof a));return a}var Ff=!1;if(d)try{var Ii={};Object.defineProperty(Ii,"passive",{get:function(){Ff=!0}}),window.addEventListener("test",Ii,Ii),window.removeEventListener("test",Ii,Ii)}catch{Ff=!1}function Y_(r,s,a,u,f,m,x,b,R){var G=Array.prototype.slice.call(arguments,3);try{s.apply(a,G)}catch(ie){this.onError(ie)}}var Ri=!1,gc=null,yc=!1,If=null,X_={onError:function(r){Ri=!0,gc=r}};function Z_(r,s,a,u,f,m,x,b,R){Ri=!1,gc=null,Y_.apply(X_,arguments)}function eC(r,s,a,u,f,m,x,b,R){if(Z_.apply(this,arguments),Ri){if(Ri){var G=gc;Ri=!1,gc=null}else throw Error(n(198));yc||(yc=!0,If=G)}}function Ms(r){var s=r,a=r;if(r.alternate)for(;s.return;)s=s.return;else{r=s;do s=r,(s.flags&4098)!==0&&(a=s.return),r=s.return;while(r)}return s.tag===3?a:null}function Yg(r){if(r.tag===13){var s=r.memoizedState;if(s===null&&(r=r.alternate,r!==null&&(s=r.memoizedState)),s!==null)return s.dehydrated}return null}function Xg(r){if(Ms(r)!==r)throw Error(n(188))}function tC(r){var s=r.alternate;if(!s){if(s=Ms(r),s===null)throw Error(n(188));return s!==r?null:r}for(var a=r,u=s;;){var f=a.return;if(f===null)break;var m=f.alternate;if(m===null){if(u=f.return,u!==null){a=u;continue}break}if(f.child===m.child){for(m=f.child;m;){if(m===a)return Xg(f),r;if(m===u)return Xg(f),s;m=m.sibling}throw Error(n(188))}if(a.return!==u.return)a=f,u=m;else{for(var x=!1,b=f.child;b;){if(b===a){x=!0,a=f,u=m;break}if(b===u){x=!0,u=f,a=m;break}b=b.sibling}if(!x){for(b=m.child;b;){if(b===a){x=!0,a=m,u=f;break}if(b===u){x=!0,u=m,a=f;break}b=b.sibling}if(!x)throw Error(n(189))}}if(a.alternate!==u)throw Error(n(190))}if(a.tag!==3)throw Error(n(188));return a.stateNode.current===a?r:s}function Zg(r){return r=tC(r),r!==null?e0(r):null}function e0(r){if(r.tag===5||r.tag===6)return r;for(r=r.child;r!==null;){var s=e0(r);if(s!==null)return s;r=r.sibling}return null}var t0=t.unstable_scheduleCallback,n0=t.unstable_cancelCallback,nC=t.unstable_shouldYield,rC=t.unstable_requestPaint,ft=t.unstable_now,sC=t.unstable_getCurrentPriorityLevel,Rf=t.unstable_ImmediatePriority,r0=t.unstable_UserBlockingPriority,vc=t.unstable_NormalPriority,oC=t.unstable_LowPriority,s0=t.unstable_IdlePriority,Sc=null,lr=null;function iC(r){if(lr&&typeof lr.onCommitFiberRoot=="function")try{lr.onCommitFiberRoot(Sc,r,void 0,(r.current.flags&128)===128)}catch{}}var Kn=Math.clz32?Math.clz32:uC,aC=Math.log,cC=Math.LN2;function uC(r){return r>>>=0,r===0?32:31-(aC(r)/cC|0)|0}var xc=64,wc=4194304;function Ti(r){switch(r&-r){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: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&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return r&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return r}}function kc(r,s){var a=r.pendingLanes;if(a===0)return 0;var u=0,f=r.suspendedLanes,m=r.pingedLanes,x=a&268435455;if(x!==0){var b=x&~f;b!==0?u=Ti(b):(m&=x,m!==0&&(u=Ti(m)))}else x=a&~f,x!==0?u=Ti(x):m!==0&&(u=Ti(m));if(u===0)return 0;if(s!==0&&s!==u&&(s&f)===0&&(f=u&-u,m=s&-s,f>=m||f===16&&(m&4194240)!==0))return s;if((u&4)!==0&&(u|=a&16),s=r.entangledLanes,s!==0)for(r=r.entanglements,s&=u;0<s;)a=31-Kn(s),f=1<<a,u|=r[a],s&=~f;return u}function lC(r,s){switch(r){case 1:case 2:case 4:return s+250;case 8:case 16:case 32:case 64: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 s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function fC(r,s){for(var a=r.suspendedLanes,u=r.pingedLanes,f=r.expirationTimes,m=r.pendingLanes;0<m;){var x=31-Kn(m),b=1<<x,R=f[x];R===-1?((b&a)===0||(b&u)!==0)&&(f[x]=lC(b,s)):R<=s&&(r.expiredLanes|=b),m&=~b}}function Tf(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function o0(){var r=xc;return xc<<=1,(xc&4194240)===0&&(xc=64),r}function Af(r){for(var s=[],a=0;31>a;a++)s.push(r);return s}function Ai(r,s,a){r.pendingLanes|=s,s!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,s=31-Kn(s),r[s]=a}function dC(r,s){var a=r.pendingLanes&~s;r.pendingLanes=s,r.suspendedLanes=0,r.pingedLanes=0,r.expiredLanes&=s,r.mutableReadLanes&=s,r.entangledLanes&=s,s=r.entanglements;var u=r.eventTimes;for(r=r.expirationTimes;0<a;){var f=31-Kn(a),m=1<<f;s[f]=0,u[f]=-1,r[f]=-1,a&=~m}}function Mf(r,s){var a=r.entangledLanes|=s;for(r=r.entanglements;a;){var u=31-Kn(a),f=1<<u;f&s|r[u]&s&&(r[u]|=s),a&=~f}}var ze=0;function i0(r){return r&=-r,1<r?4<r?(r&268435455)!==0?16:536870912:4:1}var a0,Lf,c0,u0,l0,Of=!1,Ec=[],Kr=null,Qr=null,Jr=null,Mi=new Map,Li=new Map,Gr=[],hC="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 submit".split(" ");function f0(r,s){switch(r){case"focusin":case"focusout":Kr=null;break;case"dragenter":case"dragleave":Qr=null;break;case"mouseover":case"mouseout":Jr=null;break;case"pointerover":case"pointerout":Mi.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Li.delete(s.pointerId)}}function Oi(r,s,a,u,f,m){return r===null||r.nativeEvent!==m?(r={blockedOn:s,domEventName:a,eventSystemFlags:u,nativeEvent:m,targetContainers:[f]},s!==null&&(s=Ji(s),s!==null&&Lf(s)),r):(r.eventSystemFlags|=u,s=r.targetContainers,f!==null&&s.indexOf(f)===-1&&s.push(f),r)}function mC(r,s,a,u,f){switch(s){case"focusin":return Kr=Oi(Kr,r,s,a,u,f),!0;case"dragenter":return Qr=Oi(Qr,r,s,a,u,f),!0;case"mouseover":return Jr=Oi(Jr,r,s,a,u,f),!0;case"pointerover":var m=f.pointerId;return Mi.set(m,Oi(Mi.get(m)||null,r,s,a,u,f)),!0;case"gotpointercapture":return m=f.pointerId,Li.set(m,Oi(Li.get(m)||null,r,s,a,u,f)),!0}return!1}function d0(r){var s=Ls(r.target);if(s!==null){var a=Ms(s);if(a!==null){if(s=a.tag,s===13){if(s=Yg(a),s!==null){r.blockedOn=s,l0(r.priority,function(){c0(a)});return}}else if(s===3&&a.stateNode.current.memoizedState.isDehydrated){r.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}r.blockedOn=null}function _c(r){if(r.blockedOn!==null)return!1;for(var s=r.targetContainers;0<s.length;){var a=Df(r.domEventName,r.eventSystemFlags,s[0],r.nativeEvent);if(a===null){a=r.nativeEvent;var u=new a.constructor(a.type,a);_f=u,a.target.dispatchEvent(u),_f=null}else return s=Ji(a),s!==null&&Lf(s),r.blockedOn=a,!1;s.shift()}return!0}function h0(r,s,a){_c(r)&&a.delete(s)}function pC(){Of=!1,Kr!==null&&_c(Kr)&&(Kr=null),Qr!==null&&_c(Qr)&&(Qr=null),Jr!==null&&_c(Jr)&&(Jr=null),Mi.forEach(h0),Li.forEach(h0)}function Ni(r,s){r.blockedOn===s&&(r.blockedOn=null,Of||(Of=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,pC)))}function Di(r){function s(f){return Ni(f,r)}if(0<Ec.length){Ni(Ec[0],r);for(var a=1;a<Ec.length;a++){var u=Ec[a];u.blockedOn===r&&(u.blockedOn=null)}}for(Kr!==null&&Ni(Kr,r),Qr!==null&&Ni(Qr,r),Jr!==null&&Ni(Jr,r),Mi.forEach(s),Li.forEach(s),a=0;a<Gr.length;a++)u=Gr[a],u.blockedOn===r&&(u.blockedOn=null);for(;0<Gr.length&&(a=Gr[0],a.blockedOn===null);)d0(a),a.blockedOn===null&&Gr.shift()}var bo=C.ReactCurrentBatchConfig,Cc=!0;function gC(r,s,a,u){var f=ze,m=bo.transition;bo.transition=null;try{ze=1,Nf(r,s,a,u)}finally{ze=f,bo.transition=m}}function yC(r,s,a,u){var f=ze,m=bo.transition;bo.transition=null;try{ze=4,Nf(r,s,a,u)}finally{ze=f,bo.transition=m}}function Nf(r,s,a,u){if(Cc){var f=Df(r,s,a,u);if(f===null)ed(r,s,u,bc,a),f0(r,u);else if(mC(f,r,s,a,u))u.stopPropagation();else if(f0(r,u),s&4&&-1<hC.indexOf(r)){for(;f!==null;){var m=Ji(f);if(m!==null&&a0(m),m=Df(r,s,a,u),m===null&&ed(r,s,u,bc,a),m===f)break;f=m}f!==null&&u.stopPropagation()}else ed(r,s,u,null,a)}}var bc=null;function Df(r,s,a,u){if(bc=null,r=Cf(u),r=Ls(r),r!==null)if(s=Ms(r),s===null)r=null;else if(a=s.tag,a===13){if(r=Yg(s),r!==null)return r;r=null}else if(a===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;r=null}else s!==r&&(r=null);return bc=r,null}function m0(r){switch(r){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(sC()){case Rf:return 1;case r0:return 4;case vc:case oC:return 16;case s0:return 536870912;default:return 16}default:return 16}}var Yr=null,jf=null,Pc=null;function p0(){if(Pc)return Pc;var r,s=jf,a=s.length,u,f="value"in Yr?Yr.value:Yr.textContent,m=f.length;for(r=0;r<a&&s[r]===f[r];r++);var x=a-r;for(u=1;u<=x&&s[a-u]===f[m-u];u++);return Pc=f.slice(r,1<u?1-u:void 0)}function Fc(r){var s=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&s===13&&(r=13)):r=s,r===10&&(r=13),32<=r||r===13?r:0}function Ic(){return!0}function g0(){return!1}function kn(r){function s(a,u,f,m,x){this._reactName=a,this._targetInst=f,this.type=u,this.nativeEvent=m,this.target=x,this.currentTarget=null;for(var b in r)r.hasOwnProperty(b)&&(a=r[b],this[b]=a?a(m):m[b]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?Ic:g0,this.isPropagationStopped=g0,this}return te(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Ic)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Ic)},persist:function(){},isPersistent:Ic}),s}var Po={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$f=kn(Po),ji=te({},Po,{view:0,detail:0}),vC=kn(ji),Uf,Bf,$i,Rc=te({},ji,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vf,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==$i&&($i&&r.type==="mousemove"?(Uf=r.screenX-$i.screenX,Bf=r.screenY-$i.screenY):Bf=Uf=0,$i=r),Uf)},movementY:function(r){return"movementY"in r?r.movementY:Bf}}),y0=kn(Rc),SC=te({},Rc,{dataTransfer:0}),xC=kn(SC),wC=te({},ji,{relatedTarget:0}),zf=kn(wC),kC=te({},Po,{animationName:0,elapsedTime:0,pseudoElement:0}),EC=kn(kC),_C=te({},Po,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),CC=kn(_C),bC=te({},Po,{data:0}),v0=kn(bC),PC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},FC={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"},IC={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function RC(r){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(r):(r=IC[r])?!!s[r]:!1}function Vf(){return RC}var TC=te({},ji,{key:function(r){if(r.key){var s=PC[r.key]||r.key;if(s!=="Unidentified")return s}return r.type==="keypress"?(r=Fc(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?FC[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vf,charCode:function(r){return r.type==="keypress"?Fc(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Fc(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),AC=kn(TC),MC=te({},Rc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),S0=kn(MC),LC=te({},ji,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vf}),OC=kn(LC),NC=te({},Po,{propertyName:0,elapsedTime:0,pseudoElement:0}),DC=kn(NC),jC=te({},Rc,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),$C=kn(jC),UC=[9,13,27,32],qf=d&&"CompositionEvent"in window,Ui=null;d&&"documentMode"in document&&(Ui=document.documentMode);var BC=d&&"TextEvent"in window&&!Ui,x0=d&&(!qf||Ui&&8<Ui&&11>=Ui),w0=" ",k0=!1;function E0(r,s){switch(r){case"keyup":return UC.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _0(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Fo=!1;function zC(r,s){switch(r){case"compositionend":return _0(s);case"keypress":return s.which!==32?null:(k0=!0,w0);case"textInput":return r=s.data,r===w0&&k0?null:r;default:return null}}function VC(r,s){if(Fo)return r==="compositionend"||!qf&&E0(r,s)?(r=p0(),Pc=jf=Yr=null,Fo=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return x0&&s.locale!=="ko"?null:s.data;default:return null}}var qC={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 C0(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s==="input"?!!qC[r.type]:s==="textarea"}function b0(r,s,a,u){Hg(u),s=Oc(s,"onChange"),0<s.length&&(a=new $f("onChange","change",null,a,u),r.push({event:a,listeners:s}))}var Bi=null,zi=null;function WC(r){q0(r,0)}function Tc(r){var s=Mo(r);if(xn(s))return r}function HC(r,s){if(r==="change")return s}var P0=!1;if(d){var Wf;if(d){var Hf="oninput"in document;if(!Hf){var F0=document.createElement("div");F0.setAttribute("oninput","return;"),Hf=typeof F0.oninput=="function"}Wf=Hf}else Wf=!1;P0=Wf&&(!document.documentMode||9<document.documentMode)}function I0(){Bi&&(Bi.detachEvent("onpropertychange",R0),zi=Bi=null)}function R0(r){if(r.propertyName==="value"&&Tc(zi)){var s=[];b0(s,zi,r,Cf(r)),Gg(WC,s)}}function KC(r,s,a){r==="focusin"?(I0(),Bi=s,zi=a,Bi.attachEvent("onpropertychange",R0)):r==="focusout"&&I0()}function QC(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Tc(zi)}function JC(r,s){if(r==="click")return Tc(s)}function GC(r,s){if(r==="input"||r==="change")return Tc(s)}function YC(r,s){return r===s&&(r!==0||1/r===1/s)||r!==r&&s!==s}var Qn=typeof Object.is=="function"?Object.is:YC;function Vi(r,s){if(Qn(r,s))return!0;if(typeof r!="object"||r===null||typeof s!="object"||s===null)return!1;var a=Object.keys(r),u=Object.keys(s);if(a.length!==u.length)return!1;for(u=0;u<a.length;u++){var f=a[u];if(!h.call(s,f)||!Qn(r[f],s[f]))return!1}return!0}function T0(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function A0(r,s){var a=T0(r);r=0;for(var u;a;){if(a.nodeType===3){if(u=r+a.textContent.length,r<=s&&u>=s)return{node:a,offset:s-r};r=u}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=T0(a)}}function M0(r,s){return r&&s?r===s?!0:r&&r.nodeType===3?!1:s&&s.nodeType===3?M0(r,s.parentNode):"contains"in r?r.contains(s):r.compareDocumentPosition?!!(r.compareDocumentPosition(s)&16):!1:!1}function L0(){for(var r=window,s=br();s instanceof r.HTMLIFrameElement;){try{var a=typeof s.contentWindow.location.href=="string"}catch{a=!1}if(a)r=s.contentWindow;else break;s=br(r.document)}return s}function Kf(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s&&(s==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||s==="textarea"||r.contentEditable==="true")}function XC(r){var s=L0(),a=r.focusedElem,u=r.selectionRange;if(s!==a&&a&&a.ownerDocument&&M0(a.ownerDocument.documentElement,a)){if(u!==null&&Kf(a)){if(s=u.start,r=u.end,r===void 0&&(r=s),"selectionStart"in a)a.selectionStart=s,a.selectionEnd=Math.min(r,a.value.length);else if(r=(s=a.ownerDocument||document)&&s.defaultView||window,r.getSelection){r=r.getSelection();var f=a.textContent.length,m=Math.min(u.start,f);u=u.end===void 0?m:Math.min(u.end,f),!r.extend&&m>u&&(f=u,u=m,m=f),f=A0(a,m);var x=A0(a,u);f&&x&&(r.rangeCount!==1||r.anchorNode!==f.node||r.anchorOffset!==f.offset||r.focusNode!==x.node||r.focusOffset!==x.offset)&&(s=s.createRange(),s.setStart(f.node,f.offset),r.removeAllRanges(),m>u?(r.addRange(s),r.extend(x.node,x.offset)):(s.setEnd(x.node,x.offset),r.addRange(s)))}}for(s=[],r=a;r=r.parentNode;)r.nodeType===1&&s.push({element:r,left:r.scrollLeft,top:r.scrollTop});for(typeof a.focus=="function"&&a.focus(),a=0;a<s.length;a++)r=s[a],r.element.scrollLeft=r.left,r.element.scrollTop=r.top}}var ZC=d&&"documentMode"in document&&11>=document.documentMode,Io=null,Qf=null,qi=null,Jf=!1;function O0(r,s,a){var u=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Jf||Io==null||Io!==br(u)||(u=Io,"selectionStart"in u&&Kf(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),qi&&Vi(qi,u)||(qi=u,u=Oc(Qf,"onSelect"),0<u.length&&(s=new $f("onSelect","select",null,s,a),r.push({event:s,listeners:u}),s.target=Io)))}function Ac(r,s){var a={};return a[r.toLowerCase()]=s.toLowerCase(),a["Webkit"+r]="webkit"+s,a["Moz"+r]="moz"+s,a}var Ro={animationend:Ac("Animation","AnimationEnd"),animationiteration:Ac("Animation","AnimationIteration"),animationstart:Ac("Animation","AnimationStart"),transitionend:Ac("Transition","TransitionEnd")},Gf={},N0={};d&&(N0=document.createElement("div").style,"AnimationEvent"in window||(delete Ro.animationend.animation,delete Ro.animationiteration.animation,delete Ro.animationstart.animation),"TransitionEvent"in window||delete Ro.transitionend.transition);function Mc(r){if(Gf[r])return Gf[r];if(!Ro[r])return r;var s=Ro[r],a;for(a in s)if(s.hasOwnProperty(a)&&a in N0)return Gf[r]=s[a];return r}var D0=Mc("animationend"),j0=Mc("animationiteration"),$0=Mc("animationstart"),U0=Mc("transitionend"),B0=new Map,z0="abort auxClick 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(" ");function Xr(r,s){B0.set(r,s),c(s,[r])}for(var Yf=0;Yf<z0.length;Yf++){var Xf=z0[Yf],eb=Xf.toLowerCase(),tb=Xf[0].toUpperCase()+Xf.slice(1);Xr(eb,"on"+tb)}Xr(D0,"onAnimationEnd"),Xr(j0,"onAnimationIteration"),Xr($0,"onAnimationStart"),Xr("dblclick","onDoubleClick"),Xr("focusin","onFocus"),Xr("focusout","onBlur"),Xr(U0,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wi="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(" "),nb=new Set("cancel close invalid load scroll toggle".split(" ").concat(Wi));function V0(r,s,a){var u=r.type||"unknown-event";r.currentTarget=a,eC(u,s,void 0,r),r.currentTarget=null}function q0(r,s){s=(s&4)!==0;for(var a=0;a<r.length;a++){var u=r[a],f=u.event;u=u.listeners;e:{var m=void 0;if(s)for(var x=u.length-1;0<=x;x--){var b=u[x],R=b.instance,G=b.currentTarget;if(b=b.listener,R!==m&&f.isPropagationStopped())break e;V0(f,b,G),m=R}else for(x=0;x<u.length;x++){if(b=u[x],R=b.instance,G=b.currentTarget,b=b.listener,R!==m&&f.isPropagationStopped())break e;V0(f,b,G),m=R}}}if(yc)throw r=If,yc=!1,If=null,r}function Ye(r,s){var a=s[id];a===void 0&&(a=s[id]=new Set);var u=r+"__bubble";a.has(u)||(W0(s,r,2,!1),a.add(u))}function Zf(r,s,a){var u=0;s&&(u|=4),W0(a,r,u,s)}var Lc="_reactListening"+Math.random().toString(36).slice(2);function Hi(r){if(!r[Lc]){r[Lc]=!0,o.forEach(function(a){a!=="selectionchange"&&(nb.has(a)||Zf(a,!1,r),Zf(a,!0,r))});var s=r.nodeType===9?r:r.ownerDocument;s===null||s[Lc]||(s[Lc]=!0,Zf("selectionchange",!1,s))}}function W0(r,s,a,u){switch(m0(s)){case 1:var f=gC;break;case 4:f=yC;break;default:f=Nf}a=f.bind(null,s,a,r),f=void 0,!Ff||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(f=!0),u?f!==void 0?r.addEventListener(s,a,{capture:!0,passive:f}):r.addEventListener(s,a,!0):f!==void 0?r.addEventListener(s,a,{passive:f}):r.addEventListener(s,a,!1)}function ed(r,s,a,u,f){var m=u;if((s&1)===0&&(s&2)===0&&u!==null)e:for(;;){if(u===null)return;var x=u.tag;if(x===3||x===4){var b=u.stateNode.containerInfo;if(b===f||b.nodeType===8&&b.parentNode===f)break;if(x===4)for(x=u.return;x!==null;){var R=x.tag;if((R===3||R===4)&&(R=x.stateNode.containerInfo,R===f||R.nodeType===8&&R.parentNode===f))return;x=x.return}for(;b!==null;){if(x=Ls(b),x===null)return;if(R=x.tag,R===5||R===6){u=m=x;continue e}b=b.parentNode}}u=u.return}Gg(function(){var G=m,ie=Cf(a),ae=[];e:{var oe=B0.get(r);if(oe!==void 0){var he=$f,ye=r;switch(r){case"keypress":if(Fc(a)===0)break e;case"keydown":case"keyup":he=AC;break;case"focusin":ye="focus",he=zf;break;case"focusout":ye="blur",he=zf;break;case"beforeblur":case"afterblur":he=zf;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":he=y0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=xC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=OC;break;case D0:case j0:case $0:he=EC;break;case U0:he=DC;break;case"scroll":he=vC;break;case"wheel":he=$C;break;case"copy":case"cut":case"paste":he=CC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=S0}var ve=(s&4)!==0,dt=!ve&&r==="scroll",z=ve?oe!==null?oe+"Capture":null:oe;ve=[];for(var A=G,W;A!==null;){W=A;var ce=W.stateNode;if(W.tag===5&&ce!==null&&(W=ce,z!==null&&(ce=Fi(A,z),ce!=null&&ve.push(Ki(A,ce,W)))),dt)break;A=A.return}0<ve.length&&(oe=new he(oe,ye,null,a,ie),ae.push({event:oe,listeners:ve}))}}if((s&7)===0){e:{if(oe=r==="mouseover"||r==="pointerover",he=r==="mouseout"||r==="pointerout",oe&&a!==_f&&(ye=a.relatedTarget||a.fromElement)&&(Ls(ye)||ye[Fr]))break e;if((he||oe)&&(oe=ie.window===ie?ie:(oe=ie.ownerDocument)?oe.defaultView||oe.parentWindow:window,he?(ye=a.relatedTarget||a.toElement,he=G,ye=ye?Ls(ye):null,ye!==null&&(dt=Ms(ye),ye!==dt||ye.tag!==5&&ye.tag!==6)&&(ye=null)):(he=null,ye=G),he!==ye)){if(ve=y0,ce="onMouseLeave",z="onMouseEnter",A="mouse",(r==="pointerout"||r==="pointerover")&&(ve=S0,ce="onPointerLeave",z="onPointerEnter",A="pointer"),dt=he==null?oe:Mo(he),W=ye==null?oe:Mo(ye),oe=new ve(ce,A+"leave",he,a,ie),oe.target=dt,oe.relatedTarget=W,ce=null,Ls(ie)===G&&(ve=new ve(z,A+"enter",ye,a,ie),ve.target=W,ve.relatedTarget=dt,ce=ve),dt=ce,he&&ye)t:{for(ve=he,z=ye,A=0,W=ve;W;W=To(W))A++;for(W=0,ce=z;ce;ce=To(ce))W++;for(;0<A-W;)ve=To(ve),A--;for(;0<W-A;)z=To(z),W--;for(;A--;){if(ve===z||z!==null&&ve===z.alternate)break t;ve=To(ve),z=To(z)}ve=null}else ve=null;he!==null&&H0(ae,oe,he,ve,!1),ye!==null&&dt!==null&&H0(ae,dt,ye,ve,!0)}}e:{if(oe=G?Mo(G):window,he=oe.nodeName&&oe.nodeName.toLowerCase(),he==="select"||he==="input"&&oe.type==="file")var Se=HC;else if(C0(oe))if(P0)Se=GC;else{Se=QC;var we=KC}else(he=oe.nodeName)&&he.toLowerCase()==="input"&&(oe.type==="checkbox"||oe.type==="radio")&&(Se=JC);if(Se&&(Se=Se(r,G))){b0(ae,Se,a,ie);break e}we&&we(r,oe,G),r==="focusout"&&(we=oe._wrapperState)&&we.controlled&&oe.type==="number"&&As(oe,"number",oe.value)}switch(we=G?Mo(G):window,r){case"focusin":(C0(we)||we.contentEditable==="true")&&(Io=we,Qf=G,qi=null);break;case"focusout":qi=Qf=Io=null;break;case"mousedown":Jf=!0;break;case"contextmenu":case"mouseup":case"dragend":Jf=!1,O0(ae,a,ie);break;case"selectionchange":if(ZC)break;case"keydown":case"keyup":O0(ae,a,ie)}var ke;if(qf)e:{switch(r){case"compositionstart":var Ce="onCompositionStart";break e;case"compositionend":Ce="onCompositionEnd";break e;case"compositionupdate":Ce="onCompositionUpdate";break e}Ce=void 0}else Fo?E0(r,a)&&(Ce="onCompositionEnd"):r==="keydown"&&a.keyCode===229&&(Ce="onCompositionStart");Ce&&(x0&&a.locale!=="ko"&&(Fo||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&Fo&&(ke=p0()):(Yr=ie,jf="value"in Yr?Yr.value:Yr.textContent,Fo=!0)),we=Oc(G,Ce),0<we.length&&(Ce=new v0(Ce,r,null,a,ie),ae.push({event:Ce,listeners:we}),ke?Ce.data=ke:(ke=_0(a),ke!==null&&(Ce.data=ke)))),(ke=BC?zC(r,a):VC(r,a))&&(G=Oc(G,"onBeforeInput"),0<G.length&&(ie=new v0("onBeforeInput","beforeinput",null,a,ie),ae.push({event:ie,listeners:G}),ie.data=ke))}q0(ae,s)})}function Ki(r,s,a){return{instance:r,listener:s,currentTarget:a}}function Oc(r,s){for(var a=s+"Capture",u=[];r!==null;){var f=r,m=f.stateNode;f.tag===5&&m!==null&&(f=m,m=Fi(r,a),m!=null&&u.unshift(Ki(r,m,f)),m=Fi(r,s),m!=null&&u.push(Ki(r,m,f))),r=r.return}return u}function To(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5);return r||null}function H0(r,s,a,u,f){for(var m=s._reactName,x=[];a!==null&&a!==u;){var b=a,R=b.alternate,G=b.stateNode;if(R!==null&&R===u)break;b.tag===5&&G!==null&&(b=G,f?(R=Fi(a,m),R!=null&&x.unshift(Ki(a,R,b))):f||(R=Fi(a,m),R!=null&&x.push(Ki(a,R,b)))),a=a.return}x.length!==0&&r.push({event:s,listeners:x})}var rb=/\r\n?/g,sb=/\u0000|\uFFFD/g;function K0(r){return(typeof r=="string"?r:""+r).replace(rb,`
|
|
39
|
-
`).replace(sb,"")}function Nc(r,s,a){if(s=K0(s),K0(r)!==s&&a)throw Error(n(425))}function Dc(){}var td=null,nd=null;function rd(r,s){return r==="textarea"||r==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var sd=typeof setTimeout=="function"?setTimeout:void 0,ob=typeof clearTimeout=="function"?clearTimeout:void 0,Q0=typeof Promise=="function"?Promise:void 0,ib=typeof queueMicrotask=="function"?queueMicrotask:typeof Q0<"u"?function(r){return Q0.resolve(null).then(r).catch(ab)}:sd;function ab(r){setTimeout(function(){throw r})}function od(r,s){var a=s,u=0;do{var f=a.nextSibling;if(r.removeChild(a),f&&f.nodeType===8)if(a=f.data,a==="/$"){if(u===0){r.removeChild(f),Di(s);return}u--}else a!=="$"&&a!=="$?"&&a!=="$!"||u++;a=f}while(a);Di(s)}function Zr(r){for(;r!=null;r=r.nextSibling){var s=r.nodeType;if(s===1||s===3)break;if(s===8){if(s=r.data,s==="$"||s==="$!"||s==="$?")break;if(s==="/$")return null}}return r}function J0(r){r=r.previousSibling;for(var s=0;r;){if(r.nodeType===8){var a=r.data;if(a==="$"||a==="$!"||a==="$?"){if(s===0)return r;s--}else a==="/$"&&s++}r=r.previousSibling}return null}var Ao=Math.random().toString(36).slice(2),fr="__reactFiber$"+Ao,Qi="__reactProps$"+Ao,Fr="__reactContainer$"+Ao,id="__reactEvents$"+Ao,cb="__reactListeners$"+Ao,ub="__reactHandles$"+Ao;function Ls(r){var s=r[fr];if(s)return s;for(var a=r.parentNode;a;){if(s=a[Fr]||a[fr]){if(a=s.alternate,s.child!==null||a!==null&&a.child!==null)for(r=J0(r);r!==null;){if(a=r[fr])return a;r=J0(r)}return s}r=a,a=r.parentNode}return null}function Ji(r){return r=r[fr]||r[Fr],!r||r.tag!==5&&r.tag!==6&&r.tag!==13&&r.tag!==3?null:r}function Mo(r){if(r.tag===5||r.tag===6)return r.stateNode;throw Error(n(33))}function jc(r){return r[Qi]||null}var ad=[],Lo=-1;function es(r){return{current:r}}function Xe(r){0>Lo||(r.current=ad[Lo],ad[Lo]=null,Lo--)}function Ke(r,s){Lo++,ad[Lo]=r.current,r.current=s}var ts={},Ut=es(ts),an=es(!1),Os=ts;function Oo(r,s){var a=r.type.contextTypes;if(!a)return ts;var u=r.stateNode;if(u&&u.__reactInternalMemoizedUnmaskedChildContext===s)return u.__reactInternalMemoizedMaskedChildContext;var f={},m;for(m in a)f[m]=s[m];return u&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=s,r.__reactInternalMemoizedMaskedChildContext=f),f}function cn(r){return r=r.childContextTypes,r!=null}function $c(){Xe(an),Xe(Ut)}function G0(r,s,a){if(Ut.current!==ts)throw Error(n(168));Ke(Ut,s),Ke(an,a)}function Y0(r,s,a){var u=r.stateNode;if(s=s.childContextTypes,typeof u.getChildContext!="function")return a;u=u.getChildContext();for(var f in u)if(!(f in s))throw Error(n(108,fe(r)||"Unknown",f));return te({},a,u)}function Uc(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||ts,Os=Ut.current,Ke(Ut,r),Ke(an,an.current),!0}function X0(r,s,a){var u=r.stateNode;if(!u)throw Error(n(169));a?(r=Y0(r,s,Os),u.__reactInternalMemoizedMergedChildContext=r,Xe(an),Xe(Ut),Ke(Ut,r)):Xe(an),Ke(an,a)}var Ir=null,Bc=!1,cd=!1;function Z0(r){Ir===null?Ir=[r]:Ir.push(r)}function lb(r){Bc=!0,Z0(r)}function ns(){if(!cd&&Ir!==null){cd=!0;var r=0,s=ze;try{var a=Ir;for(ze=1;r<a.length;r++){var u=a[r];do u=u(!0);while(u!==null)}Ir=null,Bc=!1}catch(f){throw Ir!==null&&(Ir=Ir.slice(r+1)),t0(Rf,ns),f}finally{ze=s,cd=!1}}return null}var No=[],Do=0,zc=null,Vc=0,Mn=[],Ln=0,Ns=null,Rr=1,Tr="";function Ds(r,s){No[Do++]=Vc,No[Do++]=zc,zc=r,Vc=s}function ey(r,s,a){Mn[Ln++]=Rr,Mn[Ln++]=Tr,Mn[Ln++]=Ns,Ns=r;var u=Rr;r=Tr;var f=32-Kn(u)-1;u&=~(1<<f),a+=1;var m=32-Kn(s)+f;if(30<m){var x=f-f%5;m=(u&(1<<x)-1).toString(32),u>>=x,f-=x,Rr=1<<32-Kn(s)+f|a<<f|u,Tr=m+r}else Rr=1<<m|a<<f|u,Tr=r}function ud(r){r.return!==null&&(Ds(r,1),ey(r,1,0))}function ld(r){for(;r===zc;)zc=No[--Do],No[Do]=null,Vc=No[--Do],No[Do]=null;for(;r===Ns;)Ns=Mn[--Ln],Mn[Ln]=null,Tr=Mn[--Ln],Mn[Ln]=null,Rr=Mn[--Ln],Mn[Ln]=null}var En=null,_n=null,Ze=!1,Jn=null;function ty(r,s){var a=jn(5,null,null,0);a.elementType="DELETED",a.stateNode=s,a.return=r,s=r.deletions,s===null?(r.deletions=[a],r.flags|=16):s.push(a)}function ny(r,s){switch(r.tag){case 5:var a=r.type;return s=s.nodeType!==1||a.toLowerCase()!==s.nodeName.toLowerCase()?null:s,s!==null?(r.stateNode=s,En=r,_n=Zr(s.firstChild),!0):!1;case 6:return s=r.pendingProps===""||s.nodeType!==3?null:s,s!==null?(r.stateNode=s,En=r,_n=null,!0):!1;case 13:return s=s.nodeType!==8?null:s,s!==null?(a=Ns!==null?{id:Rr,overflow:Tr}:null,r.memoizedState={dehydrated:s,treeContext:a,retryLane:1073741824},a=jn(18,null,null,0),a.stateNode=s,a.return=r,r.child=a,En=r,_n=null,!0):!1;default:return!1}}function fd(r){return(r.mode&1)!==0&&(r.flags&128)===0}function dd(r){if(Ze){var s=_n;if(s){var a=s;if(!ny(r,s)){if(fd(r))throw Error(n(418));s=Zr(a.nextSibling);var u=En;s&&ny(r,s)?ty(u,a):(r.flags=r.flags&-4097|2,Ze=!1,En=r)}}else{if(fd(r))throw Error(n(418));r.flags=r.flags&-4097|2,Ze=!1,En=r}}}function ry(r){for(r=r.return;r!==null&&r.tag!==5&&r.tag!==3&&r.tag!==13;)r=r.return;En=r}function qc(r){if(r!==En)return!1;if(!Ze)return ry(r),Ze=!0,!1;var s;if((s=r.tag!==3)&&!(s=r.tag!==5)&&(s=r.type,s=s!=="head"&&s!=="body"&&!rd(r.type,r.memoizedProps)),s&&(s=_n)){if(fd(r))throw sy(),Error(n(418));for(;s;)ty(r,s),s=Zr(s.nextSibling)}if(ry(r),r.tag===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(n(317));e:{for(r=r.nextSibling,s=0;r;){if(r.nodeType===8){var a=r.data;if(a==="/$"){if(s===0){_n=Zr(r.nextSibling);break e}s--}else a!=="$"&&a!=="$!"&&a!=="$?"||s++}r=r.nextSibling}_n=null}}else _n=En?Zr(r.stateNode.nextSibling):null;return!0}function sy(){for(var r=_n;r;)r=Zr(r.nextSibling)}function jo(){_n=En=null,Ze=!1}function hd(r){Jn===null?Jn=[r]:Jn.push(r)}var fb=C.ReactCurrentBatchConfig;function Gi(r,s,a){if(r=a.ref,r!==null&&typeof r!="function"&&typeof r!="object"){if(a._owner){if(a=a._owner,a){if(a.tag!==1)throw Error(n(309));var u=a.stateNode}if(!u)throw Error(n(147,r));var f=u,m=""+r;return s!==null&&s.ref!==null&&typeof s.ref=="function"&&s.ref._stringRef===m?s.ref:(s=function(x){var b=f.refs;x===null?delete b[m]:b[m]=x},s._stringRef=m,s)}if(typeof r!="string")throw Error(n(284));if(!a._owner)throw Error(n(290,r))}return r}function Wc(r,s){throw r=Object.prototype.toString.call(s),Error(n(31,r==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":r))}function oy(r){var s=r._init;return s(r._payload)}function iy(r){function s(z,A){if(r){var W=z.deletions;W===null?(z.deletions=[A],z.flags|=16):W.push(A)}}function a(z,A){if(!r)return null;for(;A!==null;)s(z,A),A=A.sibling;return null}function u(z,A){for(z=new Map;A!==null;)A.key!==null?z.set(A.key,A):z.set(A.index,A),A=A.sibling;return z}function f(z,A){return z=ls(z,A),z.index=0,z.sibling=null,z}function m(z,A,W){return z.index=W,r?(W=z.alternate,W!==null?(W=W.index,W<A?(z.flags|=2,A):W):(z.flags|=2,A)):(z.flags|=1048576,A)}function x(z){return r&&z.alternate===null&&(z.flags|=2),z}function b(z,A,W,ce){return A===null||A.tag!==6?(A=sh(W,z.mode,ce),A.return=z,A):(A=f(A,W),A.return=z,A)}function R(z,A,W,ce){var Se=W.type;return Se===L?ie(z,A,W.props.children,ce,W.key):A!==null&&(A.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===J&&oy(Se)===A.type)?(ce=f(A,W.props),ce.ref=Gi(z,A,W),ce.return=z,ce):(ce=pu(W.type,W.key,W.props,null,z.mode,ce),ce.ref=Gi(z,A,W),ce.return=z,ce)}function G(z,A,W,ce){return A===null||A.tag!==4||A.stateNode.containerInfo!==W.containerInfo||A.stateNode.implementation!==W.implementation?(A=oh(W,z.mode,ce),A.return=z,A):(A=f(A,W.children||[]),A.return=z,A)}function ie(z,A,W,ce,Se){return A===null||A.tag!==7?(A=Ws(W,z.mode,ce,Se),A.return=z,A):(A=f(A,W),A.return=z,A)}function ae(z,A,W){if(typeof A=="string"&&A!==""||typeof A=="number")return A=sh(""+A,z.mode,W),A.return=z,A;if(typeof A=="object"&&A!==null){switch(A.$$typeof){case D:return W=pu(A.type,A.key,A.props,null,z.mode,W),W.ref=Gi(z,null,A),W.return=z,W;case T:return A=oh(A,z.mode,W),A.return=z,A;case J:var ce=A._init;return ae(z,ce(A._payload),W)}if(wn(A)||ne(A))return A=Ws(A,z.mode,W,null),A.return=z,A;Wc(z,A)}return null}function oe(z,A,W,ce){var Se=A!==null?A.key:null;if(typeof W=="string"&&W!==""||typeof W=="number")return Se!==null?null:b(z,A,""+W,ce);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case D:return W.key===Se?R(z,A,W,ce):null;case T:return W.key===Se?G(z,A,W,ce):null;case J:return Se=W._init,oe(z,A,Se(W._payload),ce)}if(wn(W)||ne(W))return Se!==null?null:ie(z,A,W,ce,null);Wc(z,W)}return null}function he(z,A,W,ce,Se){if(typeof ce=="string"&&ce!==""||typeof ce=="number")return z=z.get(W)||null,b(A,z,""+ce,Se);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case D:return z=z.get(ce.key===null?W:ce.key)||null,R(A,z,ce,Se);case T:return z=z.get(ce.key===null?W:ce.key)||null,G(A,z,ce,Se);case J:var we=ce._init;return he(z,A,W,we(ce._payload),Se)}if(wn(ce)||ne(ce))return z=z.get(W)||null,ie(A,z,ce,Se,null);Wc(A,ce)}return null}function ye(z,A,W,ce){for(var Se=null,we=null,ke=A,Ce=A=0,bt=null;ke!==null&&Ce<W.length;Ce++){ke.index>Ce?(bt=ke,ke=null):bt=ke.sibling;var je=oe(z,ke,W[Ce],ce);if(je===null){ke===null&&(ke=bt);break}r&&ke&&je.alternate===null&&s(z,ke),A=m(je,A,Ce),we===null?Se=je:we.sibling=je,we=je,ke=bt}if(Ce===W.length)return a(z,ke),Ze&&Ds(z,Ce),Se;if(ke===null){for(;Ce<W.length;Ce++)ke=ae(z,W[Ce],ce),ke!==null&&(A=m(ke,A,Ce),we===null?Se=ke:we.sibling=ke,we=ke);return Ze&&Ds(z,Ce),Se}for(ke=u(z,ke);Ce<W.length;Ce++)bt=he(ke,z,Ce,W[Ce],ce),bt!==null&&(r&&bt.alternate!==null&&ke.delete(bt.key===null?Ce:bt.key),A=m(bt,A,Ce),we===null?Se=bt:we.sibling=bt,we=bt);return r&&ke.forEach(function(fs){return s(z,fs)}),Ze&&Ds(z,Ce),Se}function ve(z,A,W,ce){var Se=ne(W);if(typeof Se!="function")throw Error(n(150));if(W=Se.call(W),W==null)throw Error(n(151));for(var we=Se=null,ke=A,Ce=A=0,bt=null,je=W.next();ke!==null&&!je.done;Ce++,je=W.next()){ke.index>Ce?(bt=ke,ke=null):bt=ke.sibling;var fs=oe(z,ke,je.value,ce);if(fs===null){ke===null&&(ke=bt);break}r&&ke&&fs.alternate===null&&s(z,ke),A=m(fs,A,Ce),we===null?Se=fs:we.sibling=fs,we=fs,ke=bt}if(je.done)return a(z,ke),Ze&&Ds(z,Ce),Se;if(ke===null){for(;!je.done;Ce++,je=W.next())je=ae(z,je.value,ce),je!==null&&(A=m(je,A,Ce),we===null?Se=je:we.sibling=je,we=je);return Ze&&Ds(z,Ce),Se}for(ke=u(z,ke);!je.done;Ce++,je=W.next())je=he(ke,z,Ce,je.value,ce),je!==null&&(r&&je.alternate!==null&&ke.delete(je.key===null?Ce:je.key),A=m(je,A,Ce),we===null?Se=je:we.sibling=je,we=je);return r&&ke.forEach(function(qb){return s(z,qb)}),Ze&&Ds(z,Ce),Se}function dt(z,A,W,ce){if(typeof W=="object"&&W!==null&&W.type===L&&W.key===null&&(W=W.props.children),typeof W=="object"&&W!==null){switch(W.$$typeof){case D:e:{for(var Se=W.key,we=A;we!==null;){if(we.key===Se){if(Se=W.type,Se===L){if(we.tag===7){a(z,we.sibling),A=f(we,W.props.children),A.return=z,z=A;break e}}else if(we.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===J&&oy(Se)===we.type){a(z,we.sibling),A=f(we,W.props),A.ref=Gi(z,we,W),A.return=z,z=A;break e}a(z,we);break}else s(z,we);we=we.sibling}W.type===L?(A=Ws(W.props.children,z.mode,ce,W.key),A.return=z,z=A):(ce=pu(W.type,W.key,W.props,null,z.mode,ce),ce.ref=Gi(z,A,W),ce.return=z,z=ce)}return x(z);case T:e:{for(we=W.key;A!==null;){if(A.key===we)if(A.tag===4&&A.stateNode.containerInfo===W.containerInfo&&A.stateNode.implementation===W.implementation){a(z,A.sibling),A=f(A,W.children||[]),A.return=z,z=A;break e}else{a(z,A);break}else s(z,A);A=A.sibling}A=oh(W,z.mode,ce),A.return=z,z=A}return x(z);case J:return we=W._init,dt(z,A,we(W._payload),ce)}if(wn(W))return ye(z,A,W,ce);if(ne(W))return ve(z,A,W,ce);Wc(z,W)}return typeof W=="string"&&W!==""||typeof W=="number"?(W=""+W,A!==null&&A.tag===6?(a(z,A.sibling),A=f(A,W),A.return=z,z=A):(a(z,A),A=sh(W,z.mode,ce),A.return=z,z=A),x(z)):a(z,A)}return dt}var $o=iy(!0),ay=iy(!1),Hc=es(null),Kc=null,Uo=null,md=null;function pd(){md=Uo=Kc=null}function gd(r){var s=Hc.current;Xe(Hc),r._currentValue=s}function yd(r,s,a){for(;r!==null;){var u=r.alternate;if((r.childLanes&s)!==s?(r.childLanes|=s,u!==null&&(u.childLanes|=s)):u!==null&&(u.childLanes&s)!==s&&(u.childLanes|=s),r===a)break;r=r.return}}function Bo(r,s){Kc=r,md=Uo=null,r=r.dependencies,r!==null&&r.firstContext!==null&&((r.lanes&s)!==0&&(un=!0),r.firstContext=null)}function On(r){var s=r._currentValue;if(md!==r)if(r={context:r,memoizedValue:s,next:null},Uo===null){if(Kc===null)throw Error(n(308));Uo=r,Kc.dependencies={lanes:0,firstContext:r}}else Uo=Uo.next=r;return s}var js=null;function vd(r){js===null?js=[r]:js.push(r)}function cy(r,s,a,u){var f=s.interleaved;return f===null?(a.next=a,vd(s)):(a.next=f.next,f.next=a),s.interleaved=a,Ar(r,u)}function Ar(r,s){r.lanes|=s;var a=r.alternate;for(a!==null&&(a.lanes|=s),a=r,r=r.return;r!==null;)r.childLanes|=s,a=r.alternate,a!==null&&(a.childLanes|=s),a=r,r=r.return;return a.tag===3?a.stateNode:null}var rs=!1;function Sd(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function uy(r,s){r=r.updateQueue,s.updateQueue===r&&(s.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,effects:r.effects})}function Mr(r,s){return{eventTime:r,lane:s,tag:0,payload:null,callback:null,next:null}}function ss(r,s,a){var u=r.updateQueue;if(u===null)return null;if(u=u.shared,(De&2)!==0){var f=u.pending;return f===null?s.next=s:(s.next=f.next,f.next=s),u.pending=s,Ar(r,a)}return f=u.interleaved,f===null?(s.next=s,vd(u)):(s.next=f.next,f.next=s),u.interleaved=s,Ar(r,a)}function Qc(r,s,a){if(s=s.updateQueue,s!==null&&(s=s.shared,(a&4194240)!==0)){var u=s.lanes;u&=r.pendingLanes,a|=u,s.lanes=a,Mf(r,a)}}function ly(r,s){var a=r.updateQueue,u=r.alternate;if(u!==null&&(u=u.updateQueue,a===u)){var f=null,m=null;if(a=a.firstBaseUpdate,a!==null){do{var x={eventTime:a.eventTime,lane:a.lane,tag:a.tag,payload:a.payload,callback:a.callback,next:null};m===null?f=m=x:m=m.next=x,a=a.next}while(a!==null);m===null?f=m=s:m=m.next=s}else f=m=s;a={baseState:u.baseState,firstBaseUpdate:f,lastBaseUpdate:m,shared:u.shared,effects:u.effects},r.updateQueue=a;return}r=a.lastBaseUpdate,r===null?a.firstBaseUpdate=s:r.next=s,a.lastBaseUpdate=s}function Jc(r,s,a,u){var f=r.updateQueue;rs=!1;var m=f.firstBaseUpdate,x=f.lastBaseUpdate,b=f.shared.pending;if(b!==null){f.shared.pending=null;var R=b,G=R.next;R.next=null,x===null?m=G:x.next=G,x=R;var ie=r.alternate;ie!==null&&(ie=ie.updateQueue,b=ie.lastBaseUpdate,b!==x&&(b===null?ie.firstBaseUpdate=G:b.next=G,ie.lastBaseUpdate=R))}if(m!==null){var ae=f.baseState;x=0,ie=G=R=null,b=m;do{var oe=b.lane,he=b.eventTime;if((u&oe)===oe){ie!==null&&(ie=ie.next={eventTime:he,lane:0,tag:b.tag,payload:b.payload,callback:b.callback,next:null});e:{var ye=r,ve=b;switch(oe=s,he=a,ve.tag){case 1:if(ye=ve.payload,typeof ye=="function"){ae=ye.call(he,ae,oe);break e}ae=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=ve.payload,oe=typeof ye=="function"?ye.call(he,ae,oe):ye,oe==null)break e;ae=te({},ae,oe);break e;case 2:rs=!0}}b.callback!==null&&b.lane!==0&&(r.flags|=64,oe=f.effects,oe===null?f.effects=[b]:oe.push(b))}else he={eventTime:he,lane:oe,tag:b.tag,payload:b.payload,callback:b.callback,next:null},ie===null?(G=ie=he,R=ae):ie=ie.next=he,x|=oe;if(b=b.next,b===null){if(b=f.shared.pending,b===null)break;oe=b,b=oe.next,oe.next=null,f.lastBaseUpdate=oe,f.shared.pending=null}}while(!0);if(ie===null&&(R=ae),f.baseState=R,f.firstBaseUpdate=G,f.lastBaseUpdate=ie,s=f.shared.interleaved,s!==null){f=s;do x|=f.lane,f=f.next;while(f!==s)}else m===null&&(f.shared.lanes=0);Bs|=x,r.lanes=x,r.memoizedState=ae}}function fy(r,s,a){if(r=s.effects,s.effects=null,r!==null)for(s=0;s<r.length;s++){var u=r[s],f=u.callback;if(f!==null){if(u.callback=null,u=a,typeof f!="function")throw Error(n(191,f));f.call(u)}}}var Yi={},dr=es(Yi),Xi=es(Yi),Zi=es(Yi);function $s(r){if(r===Yi)throw Error(n(174));return r}function xd(r,s){switch(Ke(Zi,s),Ke(Xi,r),Ke(dr,Yi),r=s.nodeType,r){case 9:case 11:s=(s=s.documentElement)?s.namespaceURI:Hn(null,"");break;default:r=r===8?s.parentNode:s,s=r.namespaceURI||null,r=r.tagName,s=Hn(s,r)}Xe(dr),Ke(dr,s)}function zo(){Xe(dr),Xe(Xi),Xe(Zi)}function dy(r){$s(Zi.current);var s=$s(dr.current),a=Hn(s,r.type);s!==a&&(Ke(Xi,r),Ke(dr,a))}function wd(r){Xi.current===r&&(Xe(dr),Xe(Xi))}var st=es(0);function Gc(r){for(var s=r;s!==null;){if(s.tag===13){var a=s.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||a.data==="$!"))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var kd=[];function Ed(){for(var r=0;r<kd.length;r++)kd[r]._workInProgressVersionPrimary=null;kd.length=0}var Yc=C.ReactCurrentDispatcher,_d=C.ReactCurrentBatchConfig,Us=0,ot=null,St=null,_t=null,Xc=!1,ea=!1,ta=0,db=0;function Bt(){throw Error(n(321))}function Cd(r,s){if(s===null)return!1;for(var a=0;a<s.length&&a<r.length;a++)if(!Qn(r[a],s[a]))return!1;return!0}function bd(r,s,a,u,f,m){if(Us=m,ot=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,Yc.current=r===null||r.memoizedState===null?gb:yb,r=a(u,f),ea){m=0;do{if(ea=!1,ta=0,25<=m)throw Error(n(301));m+=1,_t=St=null,s.updateQueue=null,Yc.current=vb,r=a(u,f)}while(ea)}if(Yc.current=tu,s=St!==null&&St.next!==null,Us=0,_t=St=ot=null,Xc=!1,s)throw Error(n(300));return r}function Pd(){var r=ta!==0;return ta=0,r}function hr(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _t===null?ot.memoizedState=_t=r:_t=_t.next=r,_t}function Nn(){if(St===null){var r=ot.alternate;r=r!==null?r.memoizedState:null}else r=St.next;var s=_t===null?ot.memoizedState:_t.next;if(s!==null)_t=s,St=r;else{if(r===null)throw Error(n(310));St=r,r={memoizedState:St.memoizedState,baseState:St.baseState,baseQueue:St.baseQueue,queue:St.queue,next:null},_t===null?ot.memoizedState=_t=r:_t=_t.next=r}return _t}function na(r,s){return typeof s=="function"?s(r):s}function Fd(r){var s=Nn(),a=s.queue;if(a===null)throw Error(n(311));a.lastRenderedReducer=r;var u=St,f=u.baseQueue,m=a.pending;if(m!==null){if(f!==null){var x=f.next;f.next=m.next,m.next=x}u.baseQueue=f=m,a.pending=null}if(f!==null){m=f.next,u=u.baseState;var b=x=null,R=null,G=m;do{var ie=G.lane;if((Us&ie)===ie)R!==null&&(R=R.next={lane:0,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),u=G.hasEagerState?G.eagerState:r(u,G.action);else{var ae={lane:ie,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null};R===null?(b=R=ae,x=u):R=R.next=ae,ot.lanes|=ie,Bs|=ie}G=G.next}while(G!==null&&G!==m);R===null?x=u:R.next=b,Qn(u,s.memoizedState)||(un=!0),s.memoizedState=u,s.baseState=x,s.baseQueue=R,a.lastRenderedState=u}if(r=a.interleaved,r!==null){f=r;do m=f.lane,ot.lanes|=m,Bs|=m,f=f.next;while(f!==r)}else f===null&&(a.lanes=0);return[s.memoizedState,a.dispatch]}function Id(r){var s=Nn(),a=s.queue;if(a===null)throw Error(n(311));a.lastRenderedReducer=r;var u=a.dispatch,f=a.pending,m=s.memoizedState;if(f!==null){a.pending=null;var x=f=f.next;do m=r(m,x.action),x=x.next;while(x!==f);Qn(m,s.memoizedState)||(un=!0),s.memoizedState=m,s.baseQueue===null&&(s.baseState=m),a.lastRenderedState=m}return[m,u]}function hy(){}function my(r,s){var a=ot,u=Nn(),f=s(),m=!Qn(u.memoizedState,f);if(m&&(u.memoizedState=f,un=!0),u=u.queue,Rd(yy.bind(null,a,u,r),[r]),u.getSnapshot!==s||m||_t!==null&&_t.memoizedState.tag&1){if(a.flags|=2048,ra(9,gy.bind(null,a,u,f,s),void 0,null),Ct===null)throw Error(n(349));(Us&30)!==0||py(a,s,f)}return f}function py(r,s,a){r.flags|=16384,r={getSnapshot:s,value:a},s=ot.updateQueue,s===null?(s={lastEffect:null,stores:null},ot.updateQueue=s,s.stores=[r]):(a=s.stores,a===null?s.stores=[r]:a.push(r))}function gy(r,s,a,u){s.value=a,s.getSnapshot=u,vy(s)&&Sy(r)}function yy(r,s,a){return a(function(){vy(s)&&Sy(r)})}function vy(r){var s=r.getSnapshot;r=r.value;try{var a=s();return!Qn(r,a)}catch{return!0}}function Sy(r){var s=Ar(r,1);s!==null&&Zn(s,r,1,-1)}function xy(r){var s=hr();return typeof r=="function"&&(r=r()),s.memoizedState=s.baseState=r,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:na,lastRenderedState:r},s.queue=r,r=r.dispatch=pb.bind(null,ot,r),[s.memoizedState,r]}function ra(r,s,a,u){return r={tag:r,create:s,destroy:a,deps:u,next:null},s=ot.updateQueue,s===null?(s={lastEffect:null,stores:null},ot.updateQueue=s,s.lastEffect=r.next=r):(a=s.lastEffect,a===null?s.lastEffect=r.next=r:(u=a.next,a.next=r,r.next=u,s.lastEffect=r)),r}function wy(){return Nn().memoizedState}function Zc(r,s,a,u){var f=hr();ot.flags|=r,f.memoizedState=ra(1|s,a,void 0,u===void 0?null:u)}function eu(r,s,a,u){var f=Nn();u=u===void 0?null:u;var m=void 0;if(St!==null){var x=St.memoizedState;if(m=x.destroy,u!==null&&Cd(u,x.deps)){f.memoizedState=ra(s,a,m,u);return}}ot.flags|=r,f.memoizedState=ra(1|s,a,m,u)}function ky(r,s){return Zc(8390656,8,r,s)}function Rd(r,s){return eu(2048,8,r,s)}function Ey(r,s){return eu(4,2,r,s)}function _y(r,s){return eu(4,4,r,s)}function Cy(r,s){if(typeof s=="function")return r=r(),s(r),function(){s(null)};if(s!=null)return r=r(),s.current=r,function(){s.current=null}}function by(r,s,a){return a=a!=null?a.concat([r]):null,eu(4,4,Cy.bind(null,s,r),a)}function Td(){}function Py(r,s){var a=Nn();s=s===void 0?null:s;var u=a.memoizedState;return u!==null&&s!==null&&Cd(s,u[1])?u[0]:(a.memoizedState=[r,s],r)}function Fy(r,s){var a=Nn();s=s===void 0?null:s;var u=a.memoizedState;return u!==null&&s!==null&&Cd(s,u[1])?u[0]:(r=r(),a.memoizedState=[r,s],r)}function Iy(r,s,a){return(Us&21)===0?(r.baseState&&(r.baseState=!1,un=!0),r.memoizedState=a):(Qn(a,s)||(a=o0(),ot.lanes|=a,Bs|=a,r.baseState=!0),s)}function hb(r,s){var a=ze;ze=a!==0&&4>a?a:4,r(!0);var u=_d.transition;_d.transition={};try{r(!1),s()}finally{ze=a,_d.transition=u}}function Ry(){return Nn().memoizedState}function mb(r,s,a){var u=cs(r);if(a={lane:u,action:a,hasEagerState:!1,eagerState:null,next:null},Ty(r))Ay(s,a);else if(a=cy(r,s,a,u),a!==null){var f=Yt();Zn(a,r,u,f),My(a,s,u)}}function pb(r,s,a){var u=cs(r),f={lane:u,action:a,hasEagerState:!1,eagerState:null,next:null};if(Ty(r))Ay(s,f);else{var m=r.alternate;if(r.lanes===0&&(m===null||m.lanes===0)&&(m=s.lastRenderedReducer,m!==null))try{var x=s.lastRenderedState,b=m(x,a);if(f.hasEagerState=!0,f.eagerState=b,Qn(b,x)){var R=s.interleaved;R===null?(f.next=f,vd(s)):(f.next=R.next,R.next=f),s.interleaved=f;return}}catch{}finally{}a=cy(r,s,f,u),a!==null&&(f=Yt(),Zn(a,r,u,f),My(a,s,u))}}function Ty(r){var s=r.alternate;return r===ot||s!==null&&s===ot}function Ay(r,s){ea=Xc=!0;var a=r.pending;a===null?s.next=s:(s.next=a.next,a.next=s),r.pending=s}function My(r,s,a){if((a&4194240)!==0){var u=s.lanes;u&=r.pendingLanes,a|=u,s.lanes=a,Mf(r,a)}}var tu={readContext:On,useCallback:Bt,useContext:Bt,useEffect:Bt,useImperativeHandle:Bt,useInsertionEffect:Bt,useLayoutEffect:Bt,useMemo:Bt,useReducer:Bt,useRef:Bt,useState:Bt,useDebugValue:Bt,useDeferredValue:Bt,useTransition:Bt,useMutableSource:Bt,useSyncExternalStore:Bt,useId:Bt,unstable_isNewReconciler:!1},gb={readContext:On,useCallback:function(r,s){return hr().memoizedState=[r,s===void 0?null:s],r},useContext:On,useEffect:ky,useImperativeHandle:function(r,s,a){return a=a!=null?a.concat([r]):null,Zc(4194308,4,Cy.bind(null,s,r),a)},useLayoutEffect:function(r,s){return Zc(4194308,4,r,s)},useInsertionEffect:function(r,s){return Zc(4,2,r,s)},useMemo:function(r,s){var a=hr();return s=s===void 0?null:s,r=r(),a.memoizedState=[r,s],r},useReducer:function(r,s,a){var u=hr();return s=a!==void 0?a(s):s,u.memoizedState=u.baseState=s,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:s},u.queue=r,r=r.dispatch=mb.bind(null,ot,r),[u.memoizedState,r]},useRef:function(r){var s=hr();return r={current:r},s.memoizedState=r},useState:xy,useDebugValue:Td,useDeferredValue:function(r){return hr().memoizedState=r},useTransition:function(){var r=xy(!1),s=r[0];return r=hb.bind(null,r[1]),hr().memoizedState=r,[s,r]},useMutableSource:function(){},useSyncExternalStore:function(r,s,a){var u=ot,f=hr();if(Ze){if(a===void 0)throw Error(n(407));a=a()}else{if(a=s(),Ct===null)throw Error(n(349));(Us&30)!==0||py(u,s,a)}f.memoizedState=a;var m={value:a,getSnapshot:s};return f.queue=m,ky(yy.bind(null,u,m,r),[r]),u.flags|=2048,ra(9,gy.bind(null,u,m,a,s),void 0,null),a},useId:function(){var r=hr(),s=Ct.identifierPrefix;if(Ze){var a=Tr,u=Rr;a=(u&~(1<<32-Kn(u)-1)).toString(32)+a,s=":"+s+"R"+a,a=ta++,0<a&&(s+="H"+a.toString(32)),s+=":"}else a=db++,s=":"+s+"r"+a.toString(32)+":";return r.memoizedState=s},unstable_isNewReconciler:!1},yb={readContext:On,useCallback:Py,useContext:On,useEffect:Rd,useImperativeHandle:by,useInsertionEffect:Ey,useLayoutEffect:_y,useMemo:Fy,useReducer:Fd,useRef:wy,useState:function(){return Fd(na)},useDebugValue:Td,useDeferredValue:function(r){var s=Nn();return Iy(s,St.memoizedState,r)},useTransition:function(){var r=Fd(na)[0],s=Nn().memoizedState;return[r,s]},useMutableSource:hy,useSyncExternalStore:my,useId:Ry,unstable_isNewReconciler:!1},vb={readContext:On,useCallback:Py,useContext:On,useEffect:Rd,useImperativeHandle:by,useInsertionEffect:Ey,useLayoutEffect:_y,useMemo:Fy,useReducer:Id,useRef:wy,useState:function(){return Id(na)},useDebugValue:Td,useDeferredValue:function(r){var s=Nn();return St===null?s.memoizedState=r:Iy(s,St.memoizedState,r)},useTransition:function(){var r=Id(na)[0],s=Nn().memoizedState;return[r,s]},useMutableSource:hy,useSyncExternalStore:my,useId:Ry,unstable_isNewReconciler:!1};function Gn(r,s){if(r&&r.defaultProps){s=te({},s),r=r.defaultProps;for(var a in r)s[a]===void 0&&(s[a]=r[a]);return s}return s}function Ad(r,s,a,u){s=r.memoizedState,a=a(u,s),a=a==null?s:te({},s,a),r.memoizedState=a,r.lanes===0&&(r.updateQueue.baseState=a)}var nu={isMounted:function(r){return(r=r._reactInternals)?Ms(r)===r:!1},enqueueSetState:function(r,s,a){r=r._reactInternals;var u=Yt(),f=cs(r),m=Mr(u,f);m.payload=s,a!=null&&(m.callback=a),s=ss(r,m,f),s!==null&&(Zn(s,r,f,u),Qc(s,r,f))},enqueueReplaceState:function(r,s,a){r=r._reactInternals;var u=Yt(),f=cs(r),m=Mr(u,f);m.tag=1,m.payload=s,a!=null&&(m.callback=a),s=ss(r,m,f),s!==null&&(Zn(s,r,f,u),Qc(s,r,f))},enqueueForceUpdate:function(r,s){r=r._reactInternals;var a=Yt(),u=cs(r),f=Mr(a,u);f.tag=2,s!=null&&(f.callback=s),s=ss(r,f,u),s!==null&&(Zn(s,r,u,a),Qc(s,r,u))}};function Ly(r,s,a,u,f,m,x){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(u,m,x):s.prototype&&s.prototype.isPureReactComponent?!Vi(a,u)||!Vi(f,m):!0}function Oy(r,s,a){var u=!1,f=ts,m=s.contextType;return typeof m=="object"&&m!==null?m=On(m):(f=cn(s)?Os:Ut.current,u=s.contextTypes,m=(u=u!=null)?Oo(r,f):ts),s=new s(a,m),r.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=nu,r.stateNode=s,s._reactInternals=r,u&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=f,r.__reactInternalMemoizedMaskedChildContext=m),s}function Ny(r,s,a,u){r=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(a,u),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(a,u),s.state!==r&&nu.enqueueReplaceState(s,s.state,null)}function Md(r,s,a,u){var f=r.stateNode;f.props=a,f.state=r.memoizedState,f.refs={},Sd(r);var m=s.contextType;typeof m=="object"&&m!==null?f.context=On(m):(m=cn(s)?Os:Ut.current,f.context=Oo(r,m)),f.state=r.memoizedState,m=s.getDerivedStateFromProps,typeof m=="function"&&(Ad(r,s,m,a),f.state=r.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(s=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),s!==f.state&&nu.enqueueReplaceState(f,f.state,null),Jc(r,a,f,u),f.state=r.memoizedState),typeof f.componentDidMount=="function"&&(r.flags|=4194308)}function Vo(r,s){try{var a="",u=s;do a+=le(u),u=u.return;while(u);var f=a}catch(m){f=`
|
|
38
|
+
`+f[x].replace(" at new "," at ");return r.displayName&&R.includes("<anonymous>")&&(R=R.replace("<anonymous>",r.displayName)),R}while(1<=x&&0<=b);break}}}finally{pe=!1,Error.prepareStackTrace=a}return(r=r?r.displayName||r.name:"")?Z(r):""}function le(r){switch(r.tag){case 5:return Z(r.type);case 16:return Z("Lazy");case 13:return Z("Suspense");case 19:return Z("SuspenseList");case 0:case 2:case 15:return r=me(r.type,!1),r;case 11:return r=me(r.type.render,!1),r;case 1:return r=me(r.type,!0),r;default:return""}}function Fe(r){if(r==null)return null;if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case L:return"Fragment";case T:return"Portal";case q:return"Profiler";case $:return"StrictMode";case k:return"Suspense";case U:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case se:return(r.displayName||"Context")+".Consumer";case ee:return(r._context.displayName||"Context")+".Provider";case K:var s=r.render;return r=r.displayName,r||(r=s.displayName||s.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case V:return s=r.displayName||null,s!==null?s:Fe(r.type)||"Memo";case J:s=r._payload,r=r._init;try{return Fe(r(s))}catch{}}return null}function fe(r){var s=r.type;switch(r.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return r=s.render,r=r.displayName||r.name||"",s.displayName||(r!==""?"ForwardRef("+r+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Fe(s);case 8:return s===$?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function xe(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function be(r){var s=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Ve(r){var s=be(r)?"checked":"value",a=Object.getOwnPropertyDescriptor(r.constructor.prototype,s),u=""+r[s];if(!r.hasOwnProperty(s)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var f=a.get,m=a.set;return Object.defineProperty(r,s,{configurable:!0,get:function(){return f.call(this)},set:function(x){u=""+x,m.call(this,x)}}),Object.defineProperty(r,s,{enumerable:a.enumerable}),{getValue:function(){return u},setValue:function(x){u=""+x},stopTracking:function(){r._valueTracker=null,delete r[s]}}}}function on(r){r._valueTracker||(r._valueTracker=Ve(r))}function xn(r){if(!r)return!1;var s=r._valueTracker;if(!s)return!0;var a=s.getValue(),u="";return r&&(u=be(r)?r.checked?"true":"false":r.value),r=u,r!==a?(s.setValue(r),!0):!1}function br(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}function Wr(r,s){var a=s.checked;return te({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:a??r._wrapperState.initialChecked})}function mc(r,s){var a=s.defaultValue==null?"":s.defaultValue,u=s.checked!=null?s.checked:s.defaultChecked;a=xe(s.value!=null?s.value:a),r._wrapperState={initialChecked:u,initialValue:a,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function _i(r,s){s=s.checked,s!=null&&O(r,"checked",s,!1)}function wo(r,s){_i(r,s);var a=xe(s.value),u=s.type;if(a!=null)u==="number"?(a===0&&r.value===""||r.value!=a)&&(r.value=""+a):r.value!==""+a&&(r.value=""+a);else if(u==="submit"||u==="reset"){r.removeAttribute("value");return}s.hasOwnProperty("value")?As(r,s.type,a):s.hasOwnProperty("defaultValue")&&As(r,s.type,xe(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(r.defaultChecked=!!s.defaultChecked)}function Pr(r,s,a){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var u=s.type;if(!(u!=="submit"&&u!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+r._wrapperState.initialValue,a||s===r.value||(r.value=s),r.defaultValue=s}a=r.name,a!==""&&(r.name=""),r.defaultChecked=!!r._wrapperState.initialChecked,a!==""&&(r.name=a)}function As(r,s,a){(s!=="number"||br(r.ownerDocument)!==r)&&(a==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+a&&(r.defaultValue=""+a))}var wn=Array.isArray;function Hr(r,s,a,u){if(r=r.options,s){s={};for(var f=0;f<a.length;f++)s["$"+a[f]]=!0;for(a=0;a<r.length;a++)f=s.hasOwnProperty("$"+r[a].value),r[a].selected!==f&&(r[a].selected=f),f&&u&&(r[a].defaultSelected=!0)}else{for(a=""+xe(a),s=null,f=0;f<r.length;f++){if(r[f].value===a){r[f].selected=!0,u&&(r[f].defaultSelected=!0);return}s!==null||r[f].disabled||(s=r[f])}s!==null&&(s.selected=!0)}}function ko(r,s){if(s.dangerouslySetInnerHTML!=null)throw Error(n(91));return te({},s,{value:void 0,defaultValue:void 0,children:""+r._wrapperState.initialValue})}function pc(r,s){var a=s.value;if(a==null){if(a=s.children,s=s.defaultValue,a!=null){if(s!=null)throw Error(n(92));if(wn(a)){if(1<a.length)throw Error(n(93));a=a[0]}s=a}s==null&&(s=""),a=s}r._wrapperState={initialValue:xe(a)}}function Ci(r,s){var a=xe(s.value),u=xe(s.defaultValue);a!=null&&(a=""+a,a!==r.value&&(r.value=a),s.defaultValue==null&&r.defaultValue!==a&&(r.defaultValue=a)),u!=null&&(r.defaultValue=""+u)}function Be(r){var s=r.textContent;s===r._wrapperState.initialValue&&s!==""&&s!==null&&(r.value=s)}function Lt(r){switch(r){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Hn(r,s){return r==null||r==="http://www.w3.org/1999/xhtml"?Lt(s):r==="http://www.w3.org/2000/svg"&&s==="foreignObject"?"http://www.w3.org/1999/xhtml":r}var Eo,zg=(function(r){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(s,a,u,f){MSApp.execUnsafeLocalFunction(function(){return r(s,a,u,f)})}:r})(function(r,s){if(r.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in r)r.innerHTML=s;else{for(Eo=Eo||document.createElement("div"),Eo.innerHTML="<svg>"+s.valueOf().toString()+"</svg>",s=Eo.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;s.firstChild;)r.appendChild(s.firstChild)}});function bi(r,s){if(s){var a=r.firstChild;if(a&&a===r.lastChild&&a.nodeType===3){a.nodeValue=s;return}}r.textContent=s}var Pi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},J_=["Webkit","ms","Moz","O"];Object.keys(Pi).forEach(function(r){J_.forEach(function(s){s=s+r.charAt(0).toUpperCase()+r.substring(1),Pi[s]=Pi[r]})});function Vg(r,s,a){return s==null||typeof s=="boolean"||s===""?"":a||typeof s!="number"||s===0||Pi.hasOwnProperty(r)&&Pi[r]?(""+s).trim():s+"px"}function qg(r,s){r=r.style;for(var a in s)if(s.hasOwnProperty(a)){var u=a.indexOf("--")===0,f=Vg(a,s[a],u);a==="float"&&(a="cssFloat"),u?r.setProperty(a,f):r[a]=f}}var G_=te({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function kf(r,s){if(s){if(G_[r]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(n(137,r));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(n(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(n(61))}if(s.style!=null&&typeof s.style!="object")throw Error(n(62))}}function Ef(r,s){if(r.indexOf("-")===-1)return typeof s.is=="string";switch(r){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 _f=null;function Cf(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var bf=null,_o=null,Co=null;function Wg(r){if(r=Ji(r)){if(typeof bf!="function")throw Error(n(280));var s=r.stateNode;s&&(s=jc(s),bf(r.stateNode,r.type,s))}}function Hg(r){_o?Co?Co.push(r):Co=[r]:_o=r}function Kg(){if(_o){var r=_o,s=Co;if(Co=_o=null,Wg(r),s)for(r=0;r<s.length;r++)Wg(s[r])}}function Qg(r,s){return r(s)}function Jg(){}var Pf=!1;function Gg(r,s,a){if(Pf)return r(s,a);Pf=!0;try{return Qg(r,s,a)}finally{Pf=!1,(_o!==null||Co!==null)&&(Jg(),Kg())}}function Fi(r,s){var a=r.stateNode;if(a===null)return null;var u=jc(a);if(u===null)return null;a=u[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(r=r.type,u=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!u;break e;default:r=!1}if(r)return null;if(a&&typeof a!="function")throw Error(n(231,s,typeof a));return a}var Ff=!1;if(d)try{var Ii={};Object.defineProperty(Ii,"passive",{get:function(){Ff=!0}}),window.addEventListener("test",Ii,Ii),window.removeEventListener("test",Ii,Ii)}catch{Ff=!1}function Y_(r,s,a,u,f,m,x,b,R){var G=Array.prototype.slice.call(arguments,3);try{s.apply(a,G)}catch(ie){this.onError(ie)}}var Ri=!1,gc=null,yc=!1,If=null,X_={onError:function(r){Ri=!0,gc=r}};function Z_(r,s,a,u,f,m,x,b,R){Ri=!1,gc=null,Y_.apply(X_,arguments)}function eC(r,s,a,u,f,m,x,b,R){if(Z_.apply(this,arguments),Ri){if(Ri){var G=gc;Ri=!1,gc=null}else throw Error(n(198));yc||(yc=!0,If=G)}}function Ms(r){var s=r,a=r;if(r.alternate)for(;s.return;)s=s.return;else{r=s;do s=r,(s.flags&4098)!==0&&(a=s.return),r=s.return;while(r)}return s.tag===3?a:null}function Yg(r){if(r.tag===13){var s=r.memoizedState;if(s===null&&(r=r.alternate,r!==null&&(s=r.memoizedState)),s!==null)return s.dehydrated}return null}function Xg(r){if(Ms(r)!==r)throw Error(n(188))}function tC(r){var s=r.alternate;if(!s){if(s=Ms(r),s===null)throw Error(n(188));return s!==r?null:r}for(var a=r,u=s;;){var f=a.return;if(f===null)break;var m=f.alternate;if(m===null){if(u=f.return,u!==null){a=u;continue}break}if(f.child===m.child){for(m=f.child;m;){if(m===a)return Xg(f),r;if(m===u)return Xg(f),s;m=m.sibling}throw Error(n(188))}if(a.return!==u.return)a=f,u=m;else{for(var x=!1,b=f.child;b;){if(b===a){x=!0,a=f,u=m;break}if(b===u){x=!0,u=f,a=m;break}b=b.sibling}if(!x){for(b=m.child;b;){if(b===a){x=!0,a=m,u=f;break}if(b===u){x=!0,u=m,a=f;break}b=b.sibling}if(!x)throw Error(n(189))}}if(a.alternate!==u)throw Error(n(190))}if(a.tag!==3)throw Error(n(188));return a.stateNode.current===a?r:s}function Zg(r){return r=tC(r),r!==null?e0(r):null}function e0(r){if(r.tag===5||r.tag===6)return r;for(r=r.child;r!==null;){var s=e0(r);if(s!==null)return s;r=r.sibling}return null}var t0=t.unstable_scheduleCallback,n0=t.unstable_cancelCallback,nC=t.unstable_shouldYield,rC=t.unstable_requestPaint,ft=t.unstable_now,sC=t.unstable_getCurrentPriorityLevel,Rf=t.unstable_ImmediatePriority,r0=t.unstable_UserBlockingPriority,vc=t.unstable_NormalPriority,oC=t.unstable_LowPriority,s0=t.unstable_IdlePriority,Sc=null,lr=null;function iC(r){if(lr&&typeof lr.onCommitFiberRoot=="function")try{lr.onCommitFiberRoot(Sc,r,void 0,(r.current.flags&128)===128)}catch{}}var Kn=Math.clz32?Math.clz32:uC,aC=Math.log,cC=Math.LN2;function uC(r){return r>>>=0,r===0?32:31-(aC(r)/cC|0)|0}var xc=64,wc=4194304;function Ti(r){switch(r&-r){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: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&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return r&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return r}}function kc(r,s){var a=r.pendingLanes;if(a===0)return 0;var u=0,f=r.suspendedLanes,m=r.pingedLanes,x=a&268435455;if(x!==0){var b=x&~f;b!==0?u=Ti(b):(m&=x,m!==0&&(u=Ti(m)))}else x=a&~f,x!==0?u=Ti(x):m!==0&&(u=Ti(m));if(u===0)return 0;if(s!==0&&s!==u&&(s&f)===0&&(f=u&-u,m=s&-s,f>=m||f===16&&(m&4194240)!==0))return s;if((u&4)!==0&&(u|=a&16),s=r.entangledLanes,s!==0)for(r=r.entanglements,s&=u;0<s;)a=31-Kn(s),f=1<<a,u|=r[a],s&=~f;return u}function lC(r,s){switch(r){case 1:case 2:case 4:return s+250;case 8:case 16:case 32:case 64: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 s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function fC(r,s){for(var a=r.suspendedLanes,u=r.pingedLanes,f=r.expirationTimes,m=r.pendingLanes;0<m;){var x=31-Kn(m),b=1<<x,R=f[x];R===-1?((b&a)===0||(b&u)!==0)&&(f[x]=lC(b,s)):R<=s&&(r.expiredLanes|=b),m&=~b}}function Tf(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function o0(){var r=xc;return xc<<=1,(xc&4194240)===0&&(xc=64),r}function Af(r){for(var s=[],a=0;31>a;a++)s.push(r);return s}function Ai(r,s,a){r.pendingLanes|=s,s!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,s=31-Kn(s),r[s]=a}function dC(r,s){var a=r.pendingLanes&~s;r.pendingLanes=s,r.suspendedLanes=0,r.pingedLanes=0,r.expiredLanes&=s,r.mutableReadLanes&=s,r.entangledLanes&=s,s=r.entanglements;var u=r.eventTimes;for(r=r.expirationTimes;0<a;){var f=31-Kn(a),m=1<<f;s[f]=0,u[f]=-1,r[f]=-1,a&=~m}}function Mf(r,s){var a=r.entangledLanes|=s;for(r=r.entanglements;a;){var u=31-Kn(a),f=1<<u;f&s|r[u]&s&&(r[u]|=s),a&=~f}}var ze=0;function i0(r){return r&=-r,1<r?4<r?(r&268435455)!==0?16:536870912:4:1}var a0,Lf,c0,u0,l0,Of=!1,Ec=[],Kr=null,Qr=null,Jr=null,Mi=new Map,Li=new Map,Gr=[],hC="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 submit".split(" ");function f0(r,s){switch(r){case"focusin":case"focusout":Kr=null;break;case"dragenter":case"dragleave":Qr=null;break;case"mouseover":case"mouseout":Jr=null;break;case"pointerover":case"pointerout":Mi.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Li.delete(s.pointerId)}}function Oi(r,s,a,u,f,m){return r===null||r.nativeEvent!==m?(r={blockedOn:s,domEventName:a,eventSystemFlags:u,nativeEvent:m,targetContainers:[f]},s!==null&&(s=Ji(s),s!==null&&Lf(s)),r):(r.eventSystemFlags|=u,s=r.targetContainers,f!==null&&s.indexOf(f)===-1&&s.push(f),r)}function mC(r,s,a,u,f){switch(s){case"focusin":return Kr=Oi(Kr,r,s,a,u,f),!0;case"dragenter":return Qr=Oi(Qr,r,s,a,u,f),!0;case"mouseover":return Jr=Oi(Jr,r,s,a,u,f),!0;case"pointerover":var m=f.pointerId;return Mi.set(m,Oi(Mi.get(m)||null,r,s,a,u,f)),!0;case"gotpointercapture":return m=f.pointerId,Li.set(m,Oi(Li.get(m)||null,r,s,a,u,f)),!0}return!1}function d0(r){var s=Ls(r.target);if(s!==null){var a=Ms(s);if(a!==null){if(s=a.tag,s===13){if(s=Yg(a),s!==null){r.blockedOn=s,l0(r.priority,function(){c0(a)});return}}else if(s===3&&a.stateNode.current.memoizedState.isDehydrated){r.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}r.blockedOn=null}function _c(r){if(r.blockedOn!==null)return!1;for(var s=r.targetContainers;0<s.length;){var a=Df(r.domEventName,r.eventSystemFlags,s[0],r.nativeEvent);if(a===null){a=r.nativeEvent;var u=new a.constructor(a.type,a);_f=u,a.target.dispatchEvent(u),_f=null}else return s=Ji(a),s!==null&&Lf(s),r.blockedOn=a,!1;s.shift()}return!0}function h0(r,s,a){_c(r)&&a.delete(s)}function pC(){Of=!1,Kr!==null&&_c(Kr)&&(Kr=null),Qr!==null&&_c(Qr)&&(Qr=null),Jr!==null&&_c(Jr)&&(Jr=null),Mi.forEach(h0),Li.forEach(h0)}function Ni(r,s){r.blockedOn===s&&(r.blockedOn=null,Of||(Of=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,pC)))}function Di(r){function s(f){return Ni(f,r)}if(0<Ec.length){Ni(Ec[0],r);for(var a=1;a<Ec.length;a++){var u=Ec[a];u.blockedOn===r&&(u.blockedOn=null)}}for(Kr!==null&&Ni(Kr,r),Qr!==null&&Ni(Qr,r),Jr!==null&&Ni(Jr,r),Mi.forEach(s),Li.forEach(s),a=0;a<Gr.length;a++)u=Gr[a],u.blockedOn===r&&(u.blockedOn=null);for(;0<Gr.length&&(a=Gr[0],a.blockedOn===null);)d0(a),a.blockedOn===null&&Gr.shift()}var bo=C.ReactCurrentBatchConfig,Cc=!0;function gC(r,s,a,u){var f=ze,m=bo.transition;bo.transition=null;try{ze=1,Nf(r,s,a,u)}finally{ze=f,bo.transition=m}}function yC(r,s,a,u){var f=ze,m=bo.transition;bo.transition=null;try{ze=4,Nf(r,s,a,u)}finally{ze=f,bo.transition=m}}function Nf(r,s,a,u){if(Cc){var f=Df(r,s,a,u);if(f===null)ed(r,s,u,bc,a),f0(r,u);else if(mC(f,r,s,a,u))u.stopPropagation();else if(f0(r,u),s&4&&-1<hC.indexOf(r)){for(;f!==null;){var m=Ji(f);if(m!==null&&a0(m),m=Df(r,s,a,u),m===null&&ed(r,s,u,bc,a),m===f)break;f=m}f!==null&&u.stopPropagation()}else ed(r,s,u,null,a)}}var bc=null;function Df(r,s,a,u){if(bc=null,r=Cf(u),r=Ls(r),r!==null)if(s=Ms(r),s===null)r=null;else if(a=s.tag,a===13){if(r=Yg(s),r!==null)return r;r=null}else if(a===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;r=null}else s!==r&&(r=null);return bc=r,null}function m0(r){switch(r){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(sC()){case Rf:return 1;case r0:return 4;case vc:case oC:return 16;case s0:return 536870912;default:return 16}default:return 16}}var Yr=null,jf=null,Pc=null;function p0(){if(Pc)return Pc;var r,s=jf,a=s.length,u,f="value"in Yr?Yr.value:Yr.textContent,m=f.length;for(r=0;r<a&&s[r]===f[r];r++);var x=a-r;for(u=1;u<=x&&s[a-u]===f[m-u];u++);return Pc=f.slice(r,1<u?1-u:void 0)}function Fc(r){var s=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&s===13&&(r=13)):r=s,r===10&&(r=13),32<=r||r===13?r:0}function Ic(){return!0}function g0(){return!1}function kn(r){function s(a,u,f,m,x){this._reactName=a,this._targetInst=f,this.type=u,this.nativeEvent=m,this.target=x,this.currentTarget=null;for(var b in r)r.hasOwnProperty(b)&&(a=r[b],this[b]=a?a(m):m[b]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?Ic:g0,this.isPropagationStopped=g0,this}return te(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Ic)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Ic)},persist:function(){},isPersistent:Ic}),s}var Po={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$f=kn(Po),ji=te({},Po,{view:0,detail:0}),vC=kn(ji),Uf,Bf,$i,Rc=te({},ji,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vf,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==$i&&($i&&r.type==="mousemove"?(Uf=r.screenX-$i.screenX,Bf=r.screenY-$i.screenY):Bf=Uf=0,$i=r),Uf)},movementY:function(r){return"movementY"in r?r.movementY:Bf}}),y0=kn(Rc),SC=te({},Rc,{dataTransfer:0}),xC=kn(SC),wC=te({},ji,{relatedTarget:0}),zf=kn(wC),kC=te({},Po,{animationName:0,elapsedTime:0,pseudoElement:0}),EC=kn(kC),_C=te({},Po,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),CC=kn(_C),bC=te({},Po,{data:0}),v0=kn(bC),PC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},FC={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"},IC={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function RC(r){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(r):(r=IC[r])?!!s[r]:!1}function Vf(){return RC}var TC=te({},ji,{key:function(r){if(r.key){var s=PC[r.key]||r.key;if(s!=="Unidentified")return s}return r.type==="keypress"?(r=Fc(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?FC[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vf,charCode:function(r){return r.type==="keypress"?Fc(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Fc(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),AC=kn(TC),MC=te({},Rc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),S0=kn(MC),LC=te({},ji,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vf}),OC=kn(LC),NC=te({},Po,{propertyName:0,elapsedTime:0,pseudoElement:0}),DC=kn(NC),jC=te({},Rc,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),$C=kn(jC),UC=[9,13,27,32],qf=d&&"CompositionEvent"in window,Ui=null;d&&"documentMode"in document&&(Ui=document.documentMode);var BC=d&&"TextEvent"in window&&!Ui,x0=d&&(!qf||Ui&&8<Ui&&11>=Ui),w0=" ",k0=!1;function E0(r,s){switch(r){case"keyup":return UC.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _0(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Fo=!1;function zC(r,s){switch(r){case"compositionend":return _0(s);case"keypress":return s.which!==32?null:(k0=!0,w0);case"textInput":return r=s.data,r===w0&&k0?null:r;default:return null}}function VC(r,s){if(Fo)return r==="compositionend"||!qf&&E0(r,s)?(r=p0(),Pc=jf=Yr=null,Fo=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return x0&&s.locale!=="ko"?null:s.data;default:return null}}var qC={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 C0(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s==="input"?!!qC[r.type]:s==="textarea"}function b0(r,s,a,u){Hg(u),s=Oc(s,"onChange"),0<s.length&&(a=new $f("onChange","change",null,a,u),r.push({event:a,listeners:s}))}var Bi=null,zi=null;function WC(r){q0(r,0)}function Tc(r){var s=Mo(r);if(xn(s))return r}function HC(r,s){if(r==="change")return s}var P0=!1;if(d){var Wf;if(d){var Hf="oninput"in document;if(!Hf){var F0=document.createElement("div");F0.setAttribute("oninput","return;"),Hf=typeof F0.oninput=="function"}Wf=Hf}else Wf=!1;P0=Wf&&(!document.documentMode||9<document.documentMode)}function I0(){Bi&&(Bi.detachEvent("onpropertychange",R0),zi=Bi=null)}function R0(r){if(r.propertyName==="value"&&Tc(zi)){var s=[];b0(s,zi,r,Cf(r)),Gg(WC,s)}}function KC(r,s,a){r==="focusin"?(I0(),Bi=s,zi=a,Bi.attachEvent("onpropertychange",R0)):r==="focusout"&&I0()}function QC(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Tc(zi)}function JC(r,s){if(r==="click")return Tc(s)}function GC(r,s){if(r==="input"||r==="change")return Tc(s)}function YC(r,s){return r===s&&(r!==0||1/r===1/s)||r!==r&&s!==s}var Qn=typeof Object.is=="function"?Object.is:YC;function Vi(r,s){if(Qn(r,s))return!0;if(typeof r!="object"||r===null||typeof s!="object"||s===null)return!1;var a=Object.keys(r),u=Object.keys(s);if(a.length!==u.length)return!1;for(u=0;u<a.length;u++){var f=a[u];if(!h.call(s,f)||!Qn(r[f],s[f]))return!1}return!0}function T0(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function A0(r,s){var a=T0(r);r=0;for(var u;a;){if(a.nodeType===3){if(u=r+a.textContent.length,r<=s&&u>=s)return{node:a,offset:s-r};r=u}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=T0(a)}}function M0(r,s){return r&&s?r===s?!0:r&&r.nodeType===3?!1:s&&s.nodeType===3?M0(r,s.parentNode):"contains"in r?r.contains(s):r.compareDocumentPosition?!!(r.compareDocumentPosition(s)&16):!1:!1}function L0(){for(var r=window,s=br();s instanceof r.HTMLIFrameElement;){try{var a=typeof s.contentWindow.location.href=="string"}catch{a=!1}if(a)r=s.contentWindow;else break;s=br(r.document)}return s}function Kf(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s&&(s==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||s==="textarea"||r.contentEditable==="true")}function XC(r){var s=L0(),a=r.focusedElem,u=r.selectionRange;if(s!==a&&a&&a.ownerDocument&&M0(a.ownerDocument.documentElement,a)){if(u!==null&&Kf(a)){if(s=u.start,r=u.end,r===void 0&&(r=s),"selectionStart"in a)a.selectionStart=s,a.selectionEnd=Math.min(r,a.value.length);else if(r=(s=a.ownerDocument||document)&&s.defaultView||window,r.getSelection){r=r.getSelection();var f=a.textContent.length,m=Math.min(u.start,f);u=u.end===void 0?m:Math.min(u.end,f),!r.extend&&m>u&&(f=u,u=m,m=f),f=A0(a,m);var x=A0(a,u);f&&x&&(r.rangeCount!==1||r.anchorNode!==f.node||r.anchorOffset!==f.offset||r.focusNode!==x.node||r.focusOffset!==x.offset)&&(s=s.createRange(),s.setStart(f.node,f.offset),r.removeAllRanges(),m>u?(r.addRange(s),r.extend(x.node,x.offset)):(s.setEnd(x.node,x.offset),r.addRange(s)))}}for(s=[],r=a;r=r.parentNode;)r.nodeType===1&&s.push({element:r,left:r.scrollLeft,top:r.scrollTop});for(typeof a.focus=="function"&&a.focus(),a=0;a<s.length;a++)r=s[a],r.element.scrollLeft=r.left,r.element.scrollTop=r.top}}var ZC=d&&"documentMode"in document&&11>=document.documentMode,Io=null,Qf=null,qi=null,Jf=!1;function O0(r,s,a){var u=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Jf||Io==null||Io!==br(u)||(u=Io,"selectionStart"in u&&Kf(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),qi&&Vi(qi,u)||(qi=u,u=Oc(Qf,"onSelect"),0<u.length&&(s=new $f("onSelect","select",null,s,a),r.push({event:s,listeners:u}),s.target=Io)))}function Ac(r,s){var a={};return a[r.toLowerCase()]=s.toLowerCase(),a["Webkit"+r]="webkit"+s,a["Moz"+r]="moz"+s,a}var Ro={animationend:Ac("Animation","AnimationEnd"),animationiteration:Ac("Animation","AnimationIteration"),animationstart:Ac("Animation","AnimationStart"),transitionend:Ac("Transition","TransitionEnd")},Gf={},N0={};d&&(N0=document.createElement("div").style,"AnimationEvent"in window||(delete Ro.animationend.animation,delete Ro.animationiteration.animation,delete Ro.animationstart.animation),"TransitionEvent"in window||delete Ro.transitionend.transition);function Mc(r){if(Gf[r])return Gf[r];if(!Ro[r])return r;var s=Ro[r],a;for(a in s)if(s.hasOwnProperty(a)&&a in N0)return Gf[r]=s[a];return r}var D0=Mc("animationend"),j0=Mc("animationiteration"),$0=Mc("animationstart"),U0=Mc("transitionend"),B0=new Map,z0="abort auxClick 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(" ");function Xr(r,s){B0.set(r,s),c(s,[r])}for(var Yf=0;Yf<z0.length;Yf++){var Xf=z0[Yf],eb=Xf.toLowerCase(),tb=Xf[0].toUpperCase()+Xf.slice(1);Xr(eb,"on"+tb)}Xr(D0,"onAnimationEnd"),Xr(j0,"onAnimationIteration"),Xr($0,"onAnimationStart"),Xr("dblclick","onDoubleClick"),Xr("focusin","onFocus"),Xr("focusout","onBlur"),Xr(U0,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wi="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(" "),nb=new Set("cancel close invalid load scroll toggle".split(" ").concat(Wi));function V0(r,s,a){var u=r.type||"unknown-event";r.currentTarget=a,eC(u,s,void 0,r),r.currentTarget=null}function q0(r,s){s=(s&4)!==0;for(var a=0;a<r.length;a++){var u=r[a],f=u.event;u=u.listeners;e:{var m=void 0;if(s)for(var x=u.length-1;0<=x;x--){var b=u[x],R=b.instance,G=b.currentTarget;if(b=b.listener,R!==m&&f.isPropagationStopped())break e;V0(f,b,G),m=R}else for(x=0;x<u.length;x++){if(b=u[x],R=b.instance,G=b.currentTarget,b=b.listener,R!==m&&f.isPropagationStopped())break e;V0(f,b,G),m=R}}}if(yc)throw r=If,yc=!1,If=null,r}function Ye(r,s){var a=s[id];a===void 0&&(a=s[id]=new Set);var u=r+"__bubble";a.has(u)||(W0(s,r,2,!1),a.add(u))}function Zf(r,s,a){var u=0;s&&(u|=4),W0(a,r,u,s)}var Lc="_reactListening"+Math.random().toString(36).slice(2);function Hi(r){if(!r[Lc]){r[Lc]=!0,o.forEach(function(a){a!=="selectionchange"&&(nb.has(a)||Zf(a,!1,r),Zf(a,!0,r))});var s=r.nodeType===9?r:r.ownerDocument;s===null||s[Lc]||(s[Lc]=!0,Zf("selectionchange",!1,s))}}function W0(r,s,a,u){switch(m0(s)){case 1:var f=gC;break;case 4:f=yC;break;default:f=Nf}a=f.bind(null,s,a,r),f=void 0,!Ff||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(f=!0),u?f!==void 0?r.addEventListener(s,a,{capture:!0,passive:f}):r.addEventListener(s,a,!0):f!==void 0?r.addEventListener(s,a,{passive:f}):r.addEventListener(s,a,!1)}function ed(r,s,a,u,f){var m=u;if((s&1)===0&&(s&2)===0&&u!==null)e:for(;;){if(u===null)return;var x=u.tag;if(x===3||x===4){var b=u.stateNode.containerInfo;if(b===f||b.nodeType===8&&b.parentNode===f)break;if(x===4)for(x=u.return;x!==null;){var R=x.tag;if((R===3||R===4)&&(R=x.stateNode.containerInfo,R===f||R.nodeType===8&&R.parentNode===f))return;x=x.return}for(;b!==null;){if(x=Ls(b),x===null)return;if(R=x.tag,R===5||R===6){u=m=x;continue e}b=b.parentNode}}u=u.return}Gg(function(){var G=m,ie=Cf(a),ae=[];e:{var oe=B0.get(r);if(oe!==void 0){var he=$f,ye=r;switch(r){case"keypress":if(Fc(a)===0)break e;case"keydown":case"keyup":he=AC;break;case"focusin":ye="focus",he=zf;break;case"focusout":ye="blur",he=zf;break;case"beforeblur":case"afterblur":he=zf;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":he=y0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=xC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=OC;break;case D0:case j0:case $0:he=EC;break;case U0:he=DC;break;case"scroll":he=vC;break;case"wheel":he=$C;break;case"copy":case"cut":case"paste":he=CC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=S0}var ve=(s&4)!==0,dt=!ve&&r==="scroll",z=ve?oe!==null?oe+"Capture":null:oe;ve=[];for(var A=G,W;A!==null;){W=A;var ce=W.stateNode;if(W.tag===5&&ce!==null&&(W=ce,z!==null&&(ce=Fi(A,z),ce!=null&&ve.push(Ki(A,ce,W)))),dt)break;A=A.return}0<ve.length&&(oe=new he(oe,ye,null,a,ie),ae.push({event:oe,listeners:ve}))}}if((s&7)===0){e:{if(oe=r==="mouseover"||r==="pointerover",he=r==="mouseout"||r==="pointerout",oe&&a!==_f&&(ye=a.relatedTarget||a.fromElement)&&(Ls(ye)||ye[Fr]))break e;if((he||oe)&&(oe=ie.window===ie?ie:(oe=ie.ownerDocument)?oe.defaultView||oe.parentWindow:window,he?(ye=a.relatedTarget||a.toElement,he=G,ye=ye?Ls(ye):null,ye!==null&&(dt=Ms(ye),ye!==dt||ye.tag!==5&&ye.tag!==6)&&(ye=null)):(he=null,ye=G),he!==ye)){if(ve=y0,ce="onMouseLeave",z="onMouseEnter",A="mouse",(r==="pointerout"||r==="pointerover")&&(ve=S0,ce="onPointerLeave",z="onPointerEnter",A="pointer"),dt=he==null?oe:Mo(he),W=ye==null?oe:Mo(ye),oe=new ve(ce,A+"leave",he,a,ie),oe.target=dt,oe.relatedTarget=W,ce=null,Ls(ie)===G&&(ve=new ve(z,A+"enter",ye,a,ie),ve.target=W,ve.relatedTarget=dt,ce=ve),dt=ce,he&&ye)t:{for(ve=he,z=ye,A=0,W=ve;W;W=To(W))A++;for(W=0,ce=z;ce;ce=To(ce))W++;for(;0<A-W;)ve=To(ve),A--;for(;0<W-A;)z=To(z),W--;for(;A--;){if(ve===z||z!==null&&ve===z.alternate)break t;ve=To(ve),z=To(z)}ve=null}else ve=null;he!==null&&H0(ae,oe,he,ve,!1),ye!==null&&dt!==null&&H0(ae,dt,ye,ve,!0)}}e:{if(oe=G?Mo(G):window,he=oe.nodeName&&oe.nodeName.toLowerCase(),he==="select"||he==="input"&&oe.type==="file")var Se=HC;else if(C0(oe))if(P0)Se=GC;else{Se=QC;var ke=KC}else(he=oe.nodeName)&&he.toLowerCase()==="input"&&(oe.type==="checkbox"||oe.type==="radio")&&(Se=JC);if(Se&&(Se=Se(r,G))){b0(ae,Se,a,ie);break e}ke&&ke(r,oe,G),r==="focusout"&&(ke=oe._wrapperState)&&ke.controlled&&oe.type==="number"&&As(oe,"number",oe.value)}switch(ke=G?Mo(G):window,r){case"focusin":(C0(ke)||ke.contentEditable==="true")&&(Io=ke,Qf=G,qi=null);break;case"focusout":qi=Qf=Io=null;break;case"mousedown":Jf=!0;break;case"contextmenu":case"mouseup":case"dragend":Jf=!1,O0(ae,a,ie);break;case"selectionchange":if(ZC)break;case"keydown":case"keyup":O0(ae,a,ie)}var Ee;if(qf)e:{switch(r){case"compositionstart":var Ce="onCompositionStart";break e;case"compositionend":Ce="onCompositionEnd";break e;case"compositionupdate":Ce="onCompositionUpdate";break e}Ce=void 0}else Fo?E0(r,a)&&(Ce="onCompositionEnd"):r==="keydown"&&a.keyCode===229&&(Ce="onCompositionStart");Ce&&(x0&&a.locale!=="ko"&&(Fo||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&Fo&&(Ee=p0()):(Yr=ie,jf="value"in Yr?Yr.value:Yr.textContent,Fo=!0)),ke=Oc(G,Ce),0<ke.length&&(Ce=new v0(Ce,r,null,a,ie),ae.push({event:Ce,listeners:ke}),Ee?Ce.data=Ee:(Ee=_0(a),Ee!==null&&(Ce.data=Ee)))),(Ee=BC?zC(r,a):VC(r,a))&&(G=Oc(G,"onBeforeInput"),0<G.length&&(ie=new v0("onBeforeInput","beforeinput",null,a,ie),ae.push({event:ie,listeners:G}),ie.data=Ee))}q0(ae,s)})}function Ki(r,s,a){return{instance:r,listener:s,currentTarget:a}}function Oc(r,s){for(var a=s+"Capture",u=[];r!==null;){var f=r,m=f.stateNode;f.tag===5&&m!==null&&(f=m,m=Fi(r,a),m!=null&&u.unshift(Ki(r,m,f)),m=Fi(r,s),m!=null&&u.push(Ki(r,m,f))),r=r.return}return u}function To(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5);return r||null}function H0(r,s,a,u,f){for(var m=s._reactName,x=[];a!==null&&a!==u;){var b=a,R=b.alternate,G=b.stateNode;if(R!==null&&R===u)break;b.tag===5&&G!==null&&(b=G,f?(R=Fi(a,m),R!=null&&x.unshift(Ki(a,R,b))):f||(R=Fi(a,m),R!=null&&x.push(Ki(a,R,b)))),a=a.return}x.length!==0&&r.push({event:s,listeners:x})}var rb=/\r\n?/g,sb=/\u0000|\uFFFD/g;function K0(r){return(typeof r=="string"?r:""+r).replace(rb,`
|
|
39
|
+
`).replace(sb,"")}function Nc(r,s,a){if(s=K0(s),K0(r)!==s&&a)throw Error(n(425))}function Dc(){}var td=null,nd=null;function rd(r,s){return r==="textarea"||r==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var sd=typeof setTimeout=="function"?setTimeout:void 0,ob=typeof clearTimeout=="function"?clearTimeout:void 0,Q0=typeof Promise=="function"?Promise:void 0,ib=typeof queueMicrotask=="function"?queueMicrotask:typeof Q0<"u"?function(r){return Q0.resolve(null).then(r).catch(ab)}:sd;function ab(r){setTimeout(function(){throw r})}function od(r,s){var a=s,u=0;do{var f=a.nextSibling;if(r.removeChild(a),f&&f.nodeType===8)if(a=f.data,a==="/$"){if(u===0){r.removeChild(f),Di(s);return}u--}else a!=="$"&&a!=="$?"&&a!=="$!"||u++;a=f}while(a);Di(s)}function Zr(r){for(;r!=null;r=r.nextSibling){var s=r.nodeType;if(s===1||s===3)break;if(s===8){if(s=r.data,s==="$"||s==="$!"||s==="$?")break;if(s==="/$")return null}}return r}function J0(r){r=r.previousSibling;for(var s=0;r;){if(r.nodeType===8){var a=r.data;if(a==="$"||a==="$!"||a==="$?"){if(s===0)return r;s--}else a==="/$"&&s++}r=r.previousSibling}return null}var Ao=Math.random().toString(36).slice(2),fr="__reactFiber$"+Ao,Qi="__reactProps$"+Ao,Fr="__reactContainer$"+Ao,id="__reactEvents$"+Ao,cb="__reactListeners$"+Ao,ub="__reactHandles$"+Ao;function Ls(r){var s=r[fr];if(s)return s;for(var a=r.parentNode;a;){if(s=a[Fr]||a[fr]){if(a=s.alternate,s.child!==null||a!==null&&a.child!==null)for(r=J0(r);r!==null;){if(a=r[fr])return a;r=J0(r)}return s}r=a,a=r.parentNode}return null}function Ji(r){return r=r[fr]||r[Fr],!r||r.tag!==5&&r.tag!==6&&r.tag!==13&&r.tag!==3?null:r}function Mo(r){if(r.tag===5||r.tag===6)return r.stateNode;throw Error(n(33))}function jc(r){return r[Qi]||null}var ad=[],Lo=-1;function es(r){return{current:r}}function Xe(r){0>Lo||(r.current=ad[Lo],ad[Lo]=null,Lo--)}function Ke(r,s){Lo++,ad[Lo]=r.current,r.current=s}var ts={},Ut=es(ts),an=es(!1),Os=ts;function Oo(r,s){var a=r.type.contextTypes;if(!a)return ts;var u=r.stateNode;if(u&&u.__reactInternalMemoizedUnmaskedChildContext===s)return u.__reactInternalMemoizedMaskedChildContext;var f={},m;for(m in a)f[m]=s[m];return u&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=s,r.__reactInternalMemoizedMaskedChildContext=f),f}function cn(r){return r=r.childContextTypes,r!=null}function $c(){Xe(an),Xe(Ut)}function G0(r,s,a){if(Ut.current!==ts)throw Error(n(168));Ke(Ut,s),Ke(an,a)}function Y0(r,s,a){var u=r.stateNode;if(s=s.childContextTypes,typeof u.getChildContext!="function")return a;u=u.getChildContext();for(var f in u)if(!(f in s))throw Error(n(108,fe(r)||"Unknown",f));return te({},a,u)}function Uc(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||ts,Os=Ut.current,Ke(Ut,r),Ke(an,an.current),!0}function X0(r,s,a){var u=r.stateNode;if(!u)throw Error(n(169));a?(r=Y0(r,s,Os),u.__reactInternalMemoizedMergedChildContext=r,Xe(an),Xe(Ut),Ke(Ut,r)):Xe(an),Ke(an,a)}var Ir=null,Bc=!1,cd=!1;function Z0(r){Ir===null?Ir=[r]:Ir.push(r)}function lb(r){Bc=!0,Z0(r)}function ns(){if(!cd&&Ir!==null){cd=!0;var r=0,s=ze;try{var a=Ir;for(ze=1;r<a.length;r++){var u=a[r];do u=u(!0);while(u!==null)}Ir=null,Bc=!1}catch(f){throw Ir!==null&&(Ir=Ir.slice(r+1)),t0(Rf,ns),f}finally{ze=s,cd=!1}}return null}var No=[],Do=0,zc=null,Vc=0,Mn=[],Ln=0,Ns=null,Rr=1,Tr="";function Ds(r,s){No[Do++]=Vc,No[Do++]=zc,zc=r,Vc=s}function ey(r,s,a){Mn[Ln++]=Rr,Mn[Ln++]=Tr,Mn[Ln++]=Ns,Ns=r;var u=Rr;r=Tr;var f=32-Kn(u)-1;u&=~(1<<f),a+=1;var m=32-Kn(s)+f;if(30<m){var x=f-f%5;m=(u&(1<<x)-1).toString(32),u>>=x,f-=x,Rr=1<<32-Kn(s)+f|a<<f|u,Tr=m+r}else Rr=1<<m|a<<f|u,Tr=r}function ud(r){r.return!==null&&(Ds(r,1),ey(r,1,0))}function ld(r){for(;r===zc;)zc=No[--Do],No[Do]=null,Vc=No[--Do],No[Do]=null;for(;r===Ns;)Ns=Mn[--Ln],Mn[Ln]=null,Tr=Mn[--Ln],Mn[Ln]=null,Rr=Mn[--Ln],Mn[Ln]=null}var En=null,_n=null,et=!1,Jn=null;function ty(r,s){var a=jn(5,null,null,0);a.elementType="DELETED",a.stateNode=s,a.return=r,s=r.deletions,s===null?(r.deletions=[a],r.flags|=16):s.push(a)}function ny(r,s){switch(r.tag){case 5:var a=r.type;return s=s.nodeType!==1||a.toLowerCase()!==s.nodeName.toLowerCase()?null:s,s!==null?(r.stateNode=s,En=r,_n=Zr(s.firstChild),!0):!1;case 6:return s=r.pendingProps===""||s.nodeType!==3?null:s,s!==null?(r.stateNode=s,En=r,_n=null,!0):!1;case 13:return s=s.nodeType!==8?null:s,s!==null?(a=Ns!==null?{id:Rr,overflow:Tr}:null,r.memoizedState={dehydrated:s,treeContext:a,retryLane:1073741824},a=jn(18,null,null,0),a.stateNode=s,a.return=r,r.child=a,En=r,_n=null,!0):!1;default:return!1}}function fd(r){return(r.mode&1)!==0&&(r.flags&128)===0}function dd(r){if(et){var s=_n;if(s){var a=s;if(!ny(r,s)){if(fd(r))throw Error(n(418));s=Zr(a.nextSibling);var u=En;s&&ny(r,s)?ty(u,a):(r.flags=r.flags&-4097|2,et=!1,En=r)}}else{if(fd(r))throw Error(n(418));r.flags=r.flags&-4097|2,et=!1,En=r}}}function ry(r){for(r=r.return;r!==null&&r.tag!==5&&r.tag!==3&&r.tag!==13;)r=r.return;En=r}function qc(r){if(r!==En)return!1;if(!et)return ry(r),et=!0,!1;var s;if((s=r.tag!==3)&&!(s=r.tag!==5)&&(s=r.type,s=s!=="head"&&s!=="body"&&!rd(r.type,r.memoizedProps)),s&&(s=_n)){if(fd(r))throw sy(),Error(n(418));for(;s;)ty(r,s),s=Zr(s.nextSibling)}if(ry(r),r.tag===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(n(317));e:{for(r=r.nextSibling,s=0;r;){if(r.nodeType===8){var a=r.data;if(a==="/$"){if(s===0){_n=Zr(r.nextSibling);break e}s--}else a!=="$"&&a!=="$!"&&a!=="$?"||s++}r=r.nextSibling}_n=null}}else _n=En?Zr(r.stateNode.nextSibling):null;return!0}function sy(){for(var r=_n;r;)r=Zr(r.nextSibling)}function jo(){_n=En=null,et=!1}function hd(r){Jn===null?Jn=[r]:Jn.push(r)}var fb=C.ReactCurrentBatchConfig;function Gi(r,s,a){if(r=a.ref,r!==null&&typeof r!="function"&&typeof r!="object"){if(a._owner){if(a=a._owner,a){if(a.tag!==1)throw Error(n(309));var u=a.stateNode}if(!u)throw Error(n(147,r));var f=u,m=""+r;return s!==null&&s.ref!==null&&typeof s.ref=="function"&&s.ref._stringRef===m?s.ref:(s=function(x){var b=f.refs;x===null?delete b[m]:b[m]=x},s._stringRef=m,s)}if(typeof r!="string")throw Error(n(284));if(!a._owner)throw Error(n(290,r))}return r}function Wc(r,s){throw r=Object.prototype.toString.call(s),Error(n(31,r==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":r))}function oy(r){var s=r._init;return s(r._payload)}function iy(r){function s(z,A){if(r){var W=z.deletions;W===null?(z.deletions=[A],z.flags|=16):W.push(A)}}function a(z,A){if(!r)return null;for(;A!==null;)s(z,A),A=A.sibling;return null}function u(z,A){for(z=new Map;A!==null;)A.key!==null?z.set(A.key,A):z.set(A.index,A),A=A.sibling;return z}function f(z,A){return z=ls(z,A),z.index=0,z.sibling=null,z}function m(z,A,W){return z.index=W,r?(W=z.alternate,W!==null?(W=W.index,W<A?(z.flags|=2,A):W):(z.flags|=2,A)):(z.flags|=1048576,A)}function x(z){return r&&z.alternate===null&&(z.flags|=2),z}function b(z,A,W,ce){return A===null||A.tag!==6?(A=sh(W,z.mode,ce),A.return=z,A):(A=f(A,W),A.return=z,A)}function R(z,A,W,ce){var Se=W.type;return Se===L?ie(z,A,W.props.children,ce,W.key):A!==null&&(A.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===J&&oy(Se)===A.type)?(ce=f(A,W.props),ce.ref=Gi(z,A,W),ce.return=z,ce):(ce=pu(W.type,W.key,W.props,null,z.mode,ce),ce.ref=Gi(z,A,W),ce.return=z,ce)}function G(z,A,W,ce){return A===null||A.tag!==4||A.stateNode.containerInfo!==W.containerInfo||A.stateNode.implementation!==W.implementation?(A=oh(W,z.mode,ce),A.return=z,A):(A=f(A,W.children||[]),A.return=z,A)}function ie(z,A,W,ce,Se){return A===null||A.tag!==7?(A=Ws(W,z.mode,ce,Se),A.return=z,A):(A=f(A,W),A.return=z,A)}function ae(z,A,W){if(typeof A=="string"&&A!==""||typeof A=="number")return A=sh(""+A,z.mode,W),A.return=z,A;if(typeof A=="object"&&A!==null){switch(A.$$typeof){case D:return W=pu(A.type,A.key,A.props,null,z.mode,W),W.ref=Gi(z,null,A),W.return=z,W;case T:return A=oh(A,z.mode,W),A.return=z,A;case J:var ce=A._init;return ae(z,ce(A._payload),W)}if(wn(A)||ne(A))return A=Ws(A,z.mode,W,null),A.return=z,A;Wc(z,A)}return null}function oe(z,A,W,ce){var Se=A!==null?A.key:null;if(typeof W=="string"&&W!==""||typeof W=="number")return Se!==null?null:b(z,A,""+W,ce);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case D:return W.key===Se?R(z,A,W,ce):null;case T:return W.key===Se?G(z,A,W,ce):null;case J:return Se=W._init,oe(z,A,Se(W._payload),ce)}if(wn(W)||ne(W))return Se!==null?null:ie(z,A,W,ce,null);Wc(z,W)}return null}function he(z,A,W,ce,Se){if(typeof ce=="string"&&ce!==""||typeof ce=="number")return z=z.get(W)||null,b(A,z,""+ce,Se);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case D:return z=z.get(ce.key===null?W:ce.key)||null,R(A,z,ce,Se);case T:return z=z.get(ce.key===null?W:ce.key)||null,G(A,z,ce,Se);case J:var ke=ce._init;return he(z,A,W,ke(ce._payload),Se)}if(wn(ce)||ne(ce))return z=z.get(W)||null,ie(A,z,ce,Se,null);Wc(A,ce)}return null}function ye(z,A,W,ce){for(var Se=null,ke=null,Ee=A,Ce=A=0,bt=null;Ee!==null&&Ce<W.length;Ce++){Ee.index>Ce?(bt=Ee,Ee=null):bt=Ee.sibling;var je=oe(z,Ee,W[Ce],ce);if(je===null){Ee===null&&(Ee=bt);break}r&&Ee&&je.alternate===null&&s(z,Ee),A=m(je,A,Ce),ke===null?Se=je:ke.sibling=je,ke=je,Ee=bt}if(Ce===W.length)return a(z,Ee),et&&Ds(z,Ce),Se;if(Ee===null){for(;Ce<W.length;Ce++)Ee=ae(z,W[Ce],ce),Ee!==null&&(A=m(Ee,A,Ce),ke===null?Se=Ee:ke.sibling=Ee,ke=Ee);return et&&Ds(z,Ce),Se}for(Ee=u(z,Ee);Ce<W.length;Ce++)bt=he(Ee,z,Ce,W[Ce],ce),bt!==null&&(r&&bt.alternate!==null&&Ee.delete(bt.key===null?Ce:bt.key),A=m(bt,A,Ce),ke===null?Se=bt:ke.sibling=bt,ke=bt);return r&&Ee.forEach(function(fs){return s(z,fs)}),et&&Ds(z,Ce),Se}function ve(z,A,W,ce){var Se=ne(W);if(typeof Se!="function")throw Error(n(150));if(W=Se.call(W),W==null)throw Error(n(151));for(var ke=Se=null,Ee=A,Ce=A=0,bt=null,je=W.next();Ee!==null&&!je.done;Ce++,je=W.next()){Ee.index>Ce?(bt=Ee,Ee=null):bt=Ee.sibling;var fs=oe(z,Ee,je.value,ce);if(fs===null){Ee===null&&(Ee=bt);break}r&&Ee&&fs.alternate===null&&s(z,Ee),A=m(fs,A,Ce),ke===null?Se=fs:ke.sibling=fs,ke=fs,Ee=bt}if(je.done)return a(z,Ee),et&&Ds(z,Ce),Se;if(Ee===null){for(;!je.done;Ce++,je=W.next())je=ae(z,je.value,ce),je!==null&&(A=m(je,A,Ce),ke===null?Se=je:ke.sibling=je,ke=je);return et&&Ds(z,Ce),Se}for(Ee=u(z,Ee);!je.done;Ce++,je=W.next())je=he(Ee,z,Ce,je.value,ce),je!==null&&(r&&je.alternate!==null&&Ee.delete(je.key===null?Ce:je.key),A=m(je,A,Ce),ke===null?Se=je:ke.sibling=je,ke=je);return r&&Ee.forEach(function(qb){return s(z,qb)}),et&&Ds(z,Ce),Se}function dt(z,A,W,ce){if(typeof W=="object"&&W!==null&&W.type===L&&W.key===null&&(W=W.props.children),typeof W=="object"&&W!==null){switch(W.$$typeof){case D:e:{for(var Se=W.key,ke=A;ke!==null;){if(ke.key===Se){if(Se=W.type,Se===L){if(ke.tag===7){a(z,ke.sibling),A=f(ke,W.props.children),A.return=z,z=A;break e}}else if(ke.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===J&&oy(Se)===ke.type){a(z,ke.sibling),A=f(ke,W.props),A.ref=Gi(z,ke,W),A.return=z,z=A;break e}a(z,ke);break}else s(z,ke);ke=ke.sibling}W.type===L?(A=Ws(W.props.children,z.mode,ce,W.key),A.return=z,z=A):(ce=pu(W.type,W.key,W.props,null,z.mode,ce),ce.ref=Gi(z,A,W),ce.return=z,z=ce)}return x(z);case T:e:{for(ke=W.key;A!==null;){if(A.key===ke)if(A.tag===4&&A.stateNode.containerInfo===W.containerInfo&&A.stateNode.implementation===W.implementation){a(z,A.sibling),A=f(A,W.children||[]),A.return=z,z=A;break e}else{a(z,A);break}else s(z,A);A=A.sibling}A=oh(W,z.mode,ce),A.return=z,z=A}return x(z);case J:return ke=W._init,dt(z,A,ke(W._payload),ce)}if(wn(W))return ye(z,A,W,ce);if(ne(W))return ve(z,A,W,ce);Wc(z,W)}return typeof W=="string"&&W!==""||typeof W=="number"?(W=""+W,A!==null&&A.tag===6?(a(z,A.sibling),A=f(A,W),A.return=z,z=A):(a(z,A),A=sh(W,z.mode,ce),A.return=z,z=A),x(z)):a(z,A)}return dt}var $o=iy(!0),ay=iy(!1),Hc=es(null),Kc=null,Uo=null,md=null;function pd(){md=Uo=Kc=null}function gd(r){var s=Hc.current;Xe(Hc),r._currentValue=s}function yd(r,s,a){for(;r!==null;){var u=r.alternate;if((r.childLanes&s)!==s?(r.childLanes|=s,u!==null&&(u.childLanes|=s)):u!==null&&(u.childLanes&s)!==s&&(u.childLanes|=s),r===a)break;r=r.return}}function Bo(r,s){Kc=r,md=Uo=null,r=r.dependencies,r!==null&&r.firstContext!==null&&((r.lanes&s)!==0&&(un=!0),r.firstContext=null)}function On(r){var s=r._currentValue;if(md!==r)if(r={context:r,memoizedValue:s,next:null},Uo===null){if(Kc===null)throw Error(n(308));Uo=r,Kc.dependencies={lanes:0,firstContext:r}}else Uo=Uo.next=r;return s}var js=null;function vd(r){js===null?js=[r]:js.push(r)}function cy(r,s,a,u){var f=s.interleaved;return f===null?(a.next=a,vd(s)):(a.next=f.next,f.next=a),s.interleaved=a,Ar(r,u)}function Ar(r,s){r.lanes|=s;var a=r.alternate;for(a!==null&&(a.lanes|=s),a=r,r=r.return;r!==null;)r.childLanes|=s,a=r.alternate,a!==null&&(a.childLanes|=s),a=r,r=r.return;return a.tag===3?a.stateNode:null}var rs=!1;function Sd(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function uy(r,s){r=r.updateQueue,s.updateQueue===r&&(s.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,effects:r.effects})}function Mr(r,s){return{eventTime:r,lane:s,tag:0,payload:null,callback:null,next:null}}function ss(r,s,a){var u=r.updateQueue;if(u===null)return null;if(u=u.shared,(De&2)!==0){var f=u.pending;return f===null?s.next=s:(s.next=f.next,f.next=s),u.pending=s,Ar(r,a)}return f=u.interleaved,f===null?(s.next=s,vd(u)):(s.next=f.next,f.next=s),u.interleaved=s,Ar(r,a)}function Qc(r,s,a){if(s=s.updateQueue,s!==null&&(s=s.shared,(a&4194240)!==0)){var u=s.lanes;u&=r.pendingLanes,a|=u,s.lanes=a,Mf(r,a)}}function ly(r,s){var a=r.updateQueue,u=r.alternate;if(u!==null&&(u=u.updateQueue,a===u)){var f=null,m=null;if(a=a.firstBaseUpdate,a!==null){do{var x={eventTime:a.eventTime,lane:a.lane,tag:a.tag,payload:a.payload,callback:a.callback,next:null};m===null?f=m=x:m=m.next=x,a=a.next}while(a!==null);m===null?f=m=s:m=m.next=s}else f=m=s;a={baseState:u.baseState,firstBaseUpdate:f,lastBaseUpdate:m,shared:u.shared,effects:u.effects},r.updateQueue=a;return}r=a.lastBaseUpdate,r===null?a.firstBaseUpdate=s:r.next=s,a.lastBaseUpdate=s}function Jc(r,s,a,u){var f=r.updateQueue;rs=!1;var m=f.firstBaseUpdate,x=f.lastBaseUpdate,b=f.shared.pending;if(b!==null){f.shared.pending=null;var R=b,G=R.next;R.next=null,x===null?m=G:x.next=G,x=R;var ie=r.alternate;ie!==null&&(ie=ie.updateQueue,b=ie.lastBaseUpdate,b!==x&&(b===null?ie.firstBaseUpdate=G:b.next=G,ie.lastBaseUpdate=R))}if(m!==null){var ae=f.baseState;x=0,ie=G=R=null,b=m;do{var oe=b.lane,he=b.eventTime;if((u&oe)===oe){ie!==null&&(ie=ie.next={eventTime:he,lane:0,tag:b.tag,payload:b.payload,callback:b.callback,next:null});e:{var ye=r,ve=b;switch(oe=s,he=a,ve.tag){case 1:if(ye=ve.payload,typeof ye=="function"){ae=ye.call(he,ae,oe);break e}ae=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=ve.payload,oe=typeof ye=="function"?ye.call(he,ae,oe):ye,oe==null)break e;ae=te({},ae,oe);break e;case 2:rs=!0}}b.callback!==null&&b.lane!==0&&(r.flags|=64,oe=f.effects,oe===null?f.effects=[b]:oe.push(b))}else he={eventTime:he,lane:oe,tag:b.tag,payload:b.payload,callback:b.callback,next:null},ie===null?(G=ie=he,R=ae):ie=ie.next=he,x|=oe;if(b=b.next,b===null){if(b=f.shared.pending,b===null)break;oe=b,b=oe.next,oe.next=null,f.lastBaseUpdate=oe,f.shared.pending=null}}while(!0);if(ie===null&&(R=ae),f.baseState=R,f.firstBaseUpdate=G,f.lastBaseUpdate=ie,s=f.shared.interleaved,s!==null){f=s;do x|=f.lane,f=f.next;while(f!==s)}else m===null&&(f.shared.lanes=0);Bs|=x,r.lanes=x,r.memoizedState=ae}}function fy(r,s,a){if(r=s.effects,s.effects=null,r!==null)for(s=0;s<r.length;s++){var u=r[s],f=u.callback;if(f!==null){if(u.callback=null,u=a,typeof f!="function")throw Error(n(191,f));f.call(u)}}}var Yi={},dr=es(Yi),Xi=es(Yi),Zi=es(Yi);function $s(r){if(r===Yi)throw Error(n(174));return r}function xd(r,s){switch(Ke(Zi,s),Ke(Xi,r),Ke(dr,Yi),r=s.nodeType,r){case 9:case 11:s=(s=s.documentElement)?s.namespaceURI:Hn(null,"");break;default:r=r===8?s.parentNode:s,s=r.namespaceURI||null,r=r.tagName,s=Hn(s,r)}Xe(dr),Ke(dr,s)}function zo(){Xe(dr),Xe(Xi),Xe(Zi)}function dy(r){$s(Zi.current);var s=$s(dr.current),a=Hn(s,r.type);s!==a&&(Ke(Xi,r),Ke(dr,a))}function wd(r){Xi.current===r&&(Xe(dr),Xe(Xi))}var st=es(0);function Gc(r){for(var s=r;s!==null;){if(s.tag===13){var a=s.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||a.data==="$!"))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var kd=[];function Ed(){for(var r=0;r<kd.length;r++)kd[r]._workInProgressVersionPrimary=null;kd.length=0}var Yc=C.ReactCurrentDispatcher,_d=C.ReactCurrentBatchConfig,Us=0,ot=null,St=null,_t=null,Xc=!1,ea=!1,ta=0,db=0;function Bt(){throw Error(n(321))}function Cd(r,s){if(s===null)return!1;for(var a=0;a<s.length&&a<r.length;a++)if(!Qn(r[a],s[a]))return!1;return!0}function bd(r,s,a,u,f,m){if(Us=m,ot=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,Yc.current=r===null||r.memoizedState===null?gb:yb,r=a(u,f),ea){m=0;do{if(ea=!1,ta=0,25<=m)throw Error(n(301));m+=1,_t=St=null,s.updateQueue=null,Yc.current=vb,r=a(u,f)}while(ea)}if(Yc.current=tu,s=St!==null&&St.next!==null,Us=0,_t=St=ot=null,Xc=!1,s)throw Error(n(300));return r}function Pd(){var r=ta!==0;return ta=0,r}function hr(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _t===null?ot.memoizedState=_t=r:_t=_t.next=r,_t}function Nn(){if(St===null){var r=ot.alternate;r=r!==null?r.memoizedState:null}else r=St.next;var s=_t===null?ot.memoizedState:_t.next;if(s!==null)_t=s,St=r;else{if(r===null)throw Error(n(310));St=r,r={memoizedState:St.memoizedState,baseState:St.baseState,baseQueue:St.baseQueue,queue:St.queue,next:null},_t===null?ot.memoizedState=_t=r:_t=_t.next=r}return _t}function na(r,s){return typeof s=="function"?s(r):s}function Fd(r){var s=Nn(),a=s.queue;if(a===null)throw Error(n(311));a.lastRenderedReducer=r;var u=St,f=u.baseQueue,m=a.pending;if(m!==null){if(f!==null){var x=f.next;f.next=m.next,m.next=x}u.baseQueue=f=m,a.pending=null}if(f!==null){m=f.next,u=u.baseState;var b=x=null,R=null,G=m;do{var ie=G.lane;if((Us&ie)===ie)R!==null&&(R=R.next={lane:0,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),u=G.hasEagerState?G.eagerState:r(u,G.action);else{var ae={lane:ie,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null};R===null?(b=R=ae,x=u):R=R.next=ae,ot.lanes|=ie,Bs|=ie}G=G.next}while(G!==null&&G!==m);R===null?x=u:R.next=b,Qn(u,s.memoizedState)||(un=!0),s.memoizedState=u,s.baseState=x,s.baseQueue=R,a.lastRenderedState=u}if(r=a.interleaved,r!==null){f=r;do m=f.lane,ot.lanes|=m,Bs|=m,f=f.next;while(f!==r)}else f===null&&(a.lanes=0);return[s.memoizedState,a.dispatch]}function Id(r){var s=Nn(),a=s.queue;if(a===null)throw Error(n(311));a.lastRenderedReducer=r;var u=a.dispatch,f=a.pending,m=s.memoizedState;if(f!==null){a.pending=null;var x=f=f.next;do m=r(m,x.action),x=x.next;while(x!==f);Qn(m,s.memoizedState)||(un=!0),s.memoizedState=m,s.baseQueue===null&&(s.baseState=m),a.lastRenderedState=m}return[m,u]}function hy(){}function my(r,s){var a=ot,u=Nn(),f=s(),m=!Qn(u.memoizedState,f);if(m&&(u.memoizedState=f,un=!0),u=u.queue,Rd(yy.bind(null,a,u,r),[r]),u.getSnapshot!==s||m||_t!==null&&_t.memoizedState.tag&1){if(a.flags|=2048,ra(9,gy.bind(null,a,u,f,s),void 0,null),Ct===null)throw Error(n(349));(Us&30)!==0||py(a,s,f)}return f}function py(r,s,a){r.flags|=16384,r={getSnapshot:s,value:a},s=ot.updateQueue,s===null?(s={lastEffect:null,stores:null},ot.updateQueue=s,s.stores=[r]):(a=s.stores,a===null?s.stores=[r]:a.push(r))}function gy(r,s,a,u){s.value=a,s.getSnapshot=u,vy(s)&&Sy(r)}function yy(r,s,a){return a(function(){vy(s)&&Sy(r)})}function vy(r){var s=r.getSnapshot;r=r.value;try{var a=s();return!Qn(r,a)}catch{return!0}}function Sy(r){var s=Ar(r,1);s!==null&&Zn(s,r,1,-1)}function xy(r){var s=hr();return typeof r=="function"&&(r=r()),s.memoizedState=s.baseState=r,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:na,lastRenderedState:r},s.queue=r,r=r.dispatch=pb.bind(null,ot,r),[s.memoizedState,r]}function ra(r,s,a,u){return r={tag:r,create:s,destroy:a,deps:u,next:null},s=ot.updateQueue,s===null?(s={lastEffect:null,stores:null},ot.updateQueue=s,s.lastEffect=r.next=r):(a=s.lastEffect,a===null?s.lastEffect=r.next=r:(u=a.next,a.next=r,r.next=u,s.lastEffect=r)),r}function wy(){return Nn().memoizedState}function Zc(r,s,a,u){var f=hr();ot.flags|=r,f.memoizedState=ra(1|s,a,void 0,u===void 0?null:u)}function eu(r,s,a,u){var f=Nn();u=u===void 0?null:u;var m=void 0;if(St!==null){var x=St.memoizedState;if(m=x.destroy,u!==null&&Cd(u,x.deps)){f.memoizedState=ra(s,a,m,u);return}}ot.flags|=r,f.memoizedState=ra(1|s,a,m,u)}function ky(r,s){return Zc(8390656,8,r,s)}function Rd(r,s){return eu(2048,8,r,s)}function Ey(r,s){return eu(4,2,r,s)}function _y(r,s){return eu(4,4,r,s)}function Cy(r,s){if(typeof s=="function")return r=r(),s(r),function(){s(null)};if(s!=null)return r=r(),s.current=r,function(){s.current=null}}function by(r,s,a){return a=a!=null?a.concat([r]):null,eu(4,4,Cy.bind(null,s,r),a)}function Td(){}function Py(r,s){var a=Nn();s=s===void 0?null:s;var u=a.memoizedState;return u!==null&&s!==null&&Cd(s,u[1])?u[0]:(a.memoizedState=[r,s],r)}function Fy(r,s){var a=Nn();s=s===void 0?null:s;var u=a.memoizedState;return u!==null&&s!==null&&Cd(s,u[1])?u[0]:(r=r(),a.memoizedState=[r,s],r)}function Iy(r,s,a){return(Us&21)===0?(r.baseState&&(r.baseState=!1,un=!0),r.memoizedState=a):(Qn(a,s)||(a=o0(),ot.lanes|=a,Bs|=a,r.baseState=!0),s)}function hb(r,s){var a=ze;ze=a!==0&&4>a?a:4,r(!0);var u=_d.transition;_d.transition={};try{r(!1),s()}finally{ze=a,_d.transition=u}}function Ry(){return Nn().memoizedState}function mb(r,s,a){var u=cs(r);if(a={lane:u,action:a,hasEagerState:!1,eagerState:null,next:null},Ty(r))Ay(s,a);else if(a=cy(r,s,a,u),a!==null){var f=Xt();Zn(a,r,u,f),My(a,s,u)}}function pb(r,s,a){var u=cs(r),f={lane:u,action:a,hasEagerState:!1,eagerState:null,next:null};if(Ty(r))Ay(s,f);else{var m=r.alternate;if(r.lanes===0&&(m===null||m.lanes===0)&&(m=s.lastRenderedReducer,m!==null))try{var x=s.lastRenderedState,b=m(x,a);if(f.hasEagerState=!0,f.eagerState=b,Qn(b,x)){var R=s.interleaved;R===null?(f.next=f,vd(s)):(f.next=R.next,R.next=f),s.interleaved=f;return}}catch{}finally{}a=cy(r,s,f,u),a!==null&&(f=Xt(),Zn(a,r,u,f),My(a,s,u))}}function Ty(r){var s=r.alternate;return r===ot||s!==null&&s===ot}function Ay(r,s){ea=Xc=!0;var a=r.pending;a===null?s.next=s:(s.next=a.next,a.next=s),r.pending=s}function My(r,s,a){if((a&4194240)!==0){var u=s.lanes;u&=r.pendingLanes,a|=u,s.lanes=a,Mf(r,a)}}var tu={readContext:On,useCallback:Bt,useContext:Bt,useEffect:Bt,useImperativeHandle:Bt,useInsertionEffect:Bt,useLayoutEffect:Bt,useMemo:Bt,useReducer:Bt,useRef:Bt,useState:Bt,useDebugValue:Bt,useDeferredValue:Bt,useTransition:Bt,useMutableSource:Bt,useSyncExternalStore:Bt,useId:Bt,unstable_isNewReconciler:!1},gb={readContext:On,useCallback:function(r,s){return hr().memoizedState=[r,s===void 0?null:s],r},useContext:On,useEffect:ky,useImperativeHandle:function(r,s,a){return a=a!=null?a.concat([r]):null,Zc(4194308,4,Cy.bind(null,s,r),a)},useLayoutEffect:function(r,s){return Zc(4194308,4,r,s)},useInsertionEffect:function(r,s){return Zc(4,2,r,s)},useMemo:function(r,s){var a=hr();return s=s===void 0?null:s,r=r(),a.memoizedState=[r,s],r},useReducer:function(r,s,a){var u=hr();return s=a!==void 0?a(s):s,u.memoizedState=u.baseState=s,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:s},u.queue=r,r=r.dispatch=mb.bind(null,ot,r),[u.memoizedState,r]},useRef:function(r){var s=hr();return r={current:r},s.memoizedState=r},useState:xy,useDebugValue:Td,useDeferredValue:function(r){return hr().memoizedState=r},useTransition:function(){var r=xy(!1),s=r[0];return r=hb.bind(null,r[1]),hr().memoizedState=r,[s,r]},useMutableSource:function(){},useSyncExternalStore:function(r,s,a){var u=ot,f=hr();if(et){if(a===void 0)throw Error(n(407));a=a()}else{if(a=s(),Ct===null)throw Error(n(349));(Us&30)!==0||py(u,s,a)}f.memoizedState=a;var m={value:a,getSnapshot:s};return f.queue=m,ky(yy.bind(null,u,m,r),[r]),u.flags|=2048,ra(9,gy.bind(null,u,m,a,s),void 0,null),a},useId:function(){var r=hr(),s=Ct.identifierPrefix;if(et){var a=Tr,u=Rr;a=(u&~(1<<32-Kn(u)-1)).toString(32)+a,s=":"+s+"R"+a,a=ta++,0<a&&(s+="H"+a.toString(32)),s+=":"}else a=db++,s=":"+s+"r"+a.toString(32)+":";return r.memoizedState=s},unstable_isNewReconciler:!1},yb={readContext:On,useCallback:Py,useContext:On,useEffect:Rd,useImperativeHandle:by,useInsertionEffect:Ey,useLayoutEffect:_y,useMemo:Fy,useReducer:Fd,useRef:wy,useState:function(){return Fd(na)},useDebugValue:Td,useDeferredValue:function(r){var s=Nn();return Iy(s,St.memoizedState,r)},useTransition:function(){var r=Fd(na)[0],s=Nn().memoizedState;return[r,s]},useMutableSource:hy,useSyncExternalStore:my,useId:Ry,unstable_isNewReconciler:!1},vb={readContext:On,useCallback:Py,useContext:On,useEffect:Rd,useImperativeHandle:by,useInsertionEffect:Ey,useLayoutEffect:_y,useMemo:Fy,useReducer:Id,useRef:wy,useState:function(){return Id(na)},useDebugValue:Td,useDeferredValue:function(r){var s=Nn();return St===null?s.memoizedState=r:Iy(s,St.memoizedState,r)},useTransition:function(){var r=Id(na)[0],s=Nn().memoizedState;return[r,s]},useMutableSource:hy,useSyncExternalStore:my,useId:Ry,unstable_isNewReconciler:!1};function Gn(r,s){if(r&&r.defaultProps){s=te({},s),r=r.defaultProps;for(var a in r)s[a]===void 0&&(s[a]=r[a]);return s}return s}function Ad(r,s,a,u){s=r.memoizedState,a=a(u,s),a=a==null?s:te({},s,a),r.memoizedState=a,r.lanes===0&&(r.updateQueue.baseState=a)}var nu={isMounted:function(r){return(r=r._reactInternals)?Ms(r)===r:!1},enqueueSetState:function(r,s,a){r=r._reactInternals;var u=Xt(),f=cs(r),m=Mr(u,f);m.payload=s,a!=null&&(m.callback=a),s=ss(r,m,f),s!==null&&(Zn(s,r,f,u),Qc(s,r,f))},enqueueReplaceState:function(r,s,a){r=r._reactInternals;var u=Xt(),f=cs(r),m=Mr(u,f);m.tag=1,m.payload=s,a!=null&&(m.callback=a),s=ss(r,m,f),s!==null&&(Zn(s,r,f,u),Qc(s,r,f))},enqueueForceUpdate:function(r,s){r=r._reactInternals;var a=Xt(),u=cs(r),f=Mr(a,u);f.tag=2,s!=null&&(f.callback=s),s=ss(r,f,u),s!==null&&(Zn(s,r,u,a),Qc(s,r,u))}};function Ly(r,s,a,u,f,m,x){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(u,m,x):s.prototype&&s.prototype.isPureReactComponent?!Vi(a,u)||!Vi(f,m):!0}function Oy(r,s,a){var u=!1,f=ts,m=s.contextType;return typeof m=="object"&&m!==null?m=On(m):(f=cn(s)?Os:Ut.current,u=s.contextTypes,m=(u=u!=null)?Oo(r,f):ts),s=new s(a,m),r.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=nu,r.stateNode=s,s._reactInternals=r,u&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=f,r.__reactInternalMemoizedMaskedChildContext=m),s}function Ny(r,s,a,u){r=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(a,u),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(a,u),s.state!==r&&nu.enqueueReplaceState(s,s.state,null)}function Md(r,s,a,u){var f=r.stateNode;f.props=a,f.state=r.memoizedState,f.refs={},Sd(r);var m=s.contextType;typeof m=="object"&&m!==null?f.context=On(m):(m=cn(s)?Os:Ut.current,f.context=Oo(r,m)),f.state=r.memoizedState,m=s.getDerivedStateFromProps,typeof m=="function"&&(Ad(r,s,m,a),f.state=r.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(s=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),s!==f.state&&nu.enqueueReplaceState(f,f.state,null),Jc(r,a,f,u),f.state=r.memoizedState),typeof f.componentDidMount=="function"&&(r.flags|=4194308)}function Vo(r,s){try{var a="",u=s;do a+=le(u),u=u.return;while(u);var f=a}catch(m){f=`
|
|
40
40
|
Error generating stack: `+m.message+`
|
|
41
|
-
`+m.stack}return{value:r,source:s,stack:f,digest:null}}function Ld(r,s,a){return{value:r,source:null,stack:a??null,digest:s??null}}function Od(r,s){try{console.error(s.value)}catch(a){setTimeout(function(){throw a})}}var Sb=typeof WeakMap=="function"?WeakMap:Map;function Dy(r,s,a){a=Mr(-1,a),a.tag=3,a.payload={element:null};var u=s.value;return a.callback=function(){uu||(uu=!0,Gd=u),Od(r,s)},a}function jy(r,s,a){a=Mr(-1,a),a.tag=3;var u=r.type.getDerivedStateFromError;if(typeof u=="function"){var f=s.value;a.payload=function(){return u(f)},a.callback=function(){Od(r,s)}}var m=r.stateNode;return m!==null&&typeof m.componentDidCatch=="function"&&(a.callback=function(){Od(r,s),typeof u!="function"&&(is===null?is=new Set([this]):is.add(this));var x=s.stack;this.componentDidCatch(s.value,{componentStack:x!==null?x:""})}),a}function $y(r,s,a){var u=r.pingCache;if(u===null){u=r.pingCache=new Sb;var f=new Set;u.set(s,f)}else f=u.get(s),f===void 0&&(f=new Set,u.set(s,f));f.has(a)||(f.add(a),r=Mb.bind(null,r,s,a),s.then(r,r))}function Uy(r){do{var s;if((s=r.tag===13)&&(s=r.memoizedState,s=s!==null?s.dehydrated!==null:!0),s)return r;r=r.return}while(r!==null);return null}function By(r,s,a,u,f){return(r.mode&1)===0?(r===s?r.flags|=65536:(r.flags|=128,a.flags|=131072,a.flags&=-52805,a.tag===1&&(a.alternate===null?a.tag=17:(s=Mr(-1,1),s.tag=2,ss(a,s,1))),a.lanes|=1),r):(r.flags|=65536,r.lanes=f,r)}var xb=C.ReactCurrentOwner,un=!1;function Gt(r,s,a,u){s.child=r===null?ay(s,null,a,u):$o(s,r.child,a,u)}function zy(r,s,a,u,f){a=a.render;var m=s.ref;return Bo(s,f),u=bd(r,s,a,u,m,f),a=Pd(),r!==null&&!un?(s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~f,Lr(r,s,f)):(Ze&&a&&ud(s),s.flags|=1,Gt(r,s,u,f),s.child)}function Vy(r,s,a,u,f){if(r===null){var m=a.type;return typeof m=="function"&&!rh(m)&&m.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(s.tag=15,s.type=m,qy(r,s,m,u,f)):(r=pu(a.type,null,u,s,s.mode,f),r.ref=s.ref,r.return=s,s.child=r)}if(m=r.child,(r.lanes&f)===0){var x=m.memoizedProps;if(a=a.compare,a=a!==null?a:Vi,a(x,u)&&r.ref===s.ref)return Lr(r,s,f)}return s.flags|=1,r=ls(m,u),r.ref=s.ref,r.return=s,s.child=r}function qy(r,s,a,u,f){if(r!==null){var m=r.memoizedProps;if(Vi(m,u)&&r.ref===s.ref)if(un=!1,s.pendingProps=u=m,(r.lanes&f)!==0)(r.flags&131072)!==0&&(un=!0);else return s.lanes=r.lanes,Lr(r,s,f)}return Nd(r,s,a,u,f)}function Wy(r,s,a){var u=s.pendingProps,f=u.children,m=r!==null?r.memoizedState:null;if(u.mode==="hidden")if((s.mode&1)===0)s.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ke(Wo,Cn),Cn|=a;else{if((a&1073741824)===0)return r=m!==null?m.baseLanes|a:a,s.lanes=s.childLanes=1073741824,s.memoizedState={baseLanes:r,cachePool:null,transitions:null},s.updateQueue=null,Ke(Wo,Cn),Cn|=r,null;s.memoizedState={baseLanes:0,cachePool:null,transitions:null},u=m!==null?m.baseLanes:a,Ke(Wo,Cn),Cn|=u}else m!==null?(u=m.baseLanes|a,s.memoizedState=null):u=a,Ke(Wo,Cn),Cn|=u;return Gt(r,s,f,a),s.child}function Hy(r,s){var a=s.ref;(r===null&&a!==null||r!==null&&r.ref!==a)&&(s.flags|=512,s.flags|=2097152)}function Nd(r,s,a,u,f){var m=cn(a)?Os:Ut.current;return m=Oo(s,m),Bo(s,f),a=bd(r,s,a,u,m,f),u=Pd(),r!==null&&!un?(s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~f,Lr(r,s,f)):(Ze&&u&&ud(s),s.flags|=1,Gt(r,s,a,f),s.child)}function Ky(r,s,a,u,f){if(cn(a)){var m=!0;Uc(s)}else m=!1;if(Bo(s,f),s.stateNode===null)su(r,s),Oy(s,a,u),Md(s,a,u,f),u=!0;else if(r===null){var x=s.stateNode,b=s.memoizedProps;x.props=b;var R=x.context,G=a.contextType;typeof G=="object"&&G!==null?G=On(G):(G=cn(a)?Os:Ut.current,G=Oo(s,G));var ie=a.getDerivedStateFromProps,ae=typeof ie=="function"||typeof x.getSnapshotBeforeUpdate=="function";ae||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(b!==u||R!==G)&&Ny(s,x,u,G),rs=!1;var oe=s.memoizedState;x.state=oe,Jc(s,u,x,f),R=s.memoizedState,b!==u||oe!==R||an.current||rs?(typeof ie=="function"&&(Ad(s,a,ie,u),R=s.memoizedState),(b=rs||Ly(s,a,b,u,oe,R,G))?(ae||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(s.flags|=4194308)):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=u,s.memoizedState=R),x.props=u,x.state=R,x.context=G,u=b):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),u=!1)}else{x=s.stateNode,uy(r,s),b=s.memoizedProps,G=s.type===s.elementType?b:Gn(s.type,b),x.props=G,ae=s.pendingProps,oe=x.context,R=a.contextType,typeof R=="object"&&R!==null?R=On(R):(R=cn(a)?Os:Ut.current,R=Oo(s,R));var he=a.getDerivedStateFromProps;(ie=typeof he=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(b!==ae||oe!==R)&&Ny(s,x,u,R),rs=!1,oe=s.memoizedState,x.state=oe,Jc(s,u,x,f);var ye=s.memoizedState;b!==ae||oe!==ye||an.current||rs?(typeof he=="function"&&(Ad(s,a,he,u),ye=s.memoizedState),(G=rs||Ly(s,a,G,u,oe,ye,R)||!1)?(ie||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(u,ye,R),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(u,ye,R)),typeof x.componentDidUpdate=="function"&&(s.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof x.componentDidUpdate!="function"||b===r.memoizedProps&&oe===r.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||b===r.memoizedProps&&oe===r.memoizedState||(s.flags|=1024),s.memoizedProps=u,s.memoizedState=ye),x.props=u,x.state=ye,x.context=R,u=G):(typeof x.componentDidUpdate!="function"||b===r.memoizedProps&&oe===r.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||b===r.memoizedProps&&oe===r.memoizedState||(s.flags|=1024),u=!1)}return Dd(r,s,a,u,m,f)}function Dd(r,s,a,u,f,m){Hy(r,s);var x=(s.flags&128)!==0;if(!u&&!x)return f&&X0(s,a,!1),Lr(r,s,m);u=s.stateNode,xb.current=s;var b=x&&typeof a.getDerivedStateFromError!="function"?null:u.render();return s.flags|=1,r!==null&&x?(s.child=$o(s,r.child,null,m),s.child=$o(s,null,b,m)):Gt(r,s,b,m),s.memoizedState=u.state,f&&X0(s,a,!0),s.child}function Qy(r){var s=r.stateNode;s.pendingContext?G0(r,s.pendingContext,s.pendingContext!==s.context):s.context&&G0(r,s.context,!1),xd(r,s.containerInfo)}function Jy(r,s,a,u,f){return jo(),hd(f),s.flags|=256,Gt(r,s,a,u),s.child}var jd={dehydrated:null,treeContext:null,retryLane:0};function $d(r){return{baseLanes:r,cachePool:null,transitions:null}}function Gy(r,s,a){var u=s.pendingProps,f=st.current,m=!1,x=(s.flags&128)!==0,b;if((b=x)||(b=r!==null&&r.memoizedState===null?!1:(f&2)!==0),b?(m=!0,s.flags&=-129):(r===null||r.memoizedState!==null)&&(f|=1),Ke(st,f&1),r===null)return dd(s),r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null)?((s.mode&1)===0?s.lanes=1:r.data==="$!"?s.lanes=8:s.lanes=1073741824,null):(x=u.children,r=u.fallback,m?(u=s.mode,m=s.child,x={mode:"hidden",children:x},(u&1)===0&&m!==null?(m.childLanes=0,m.pendingProps=x):m=gu(x,u,0,null),r=Ws(r,u,a,null),m.return=s,r.return=s,m.sibling=r,s.child=m,s.child.memoizedState=$d(a),s.memoizedState=jd,r):Ud(s,x));if(f=r.memoizedState,f!==null&&(b=f.dehydrated,b!==null))return wb(r,s,x,u,b,f,a);if(m){m=u.fallback,x=s.mode,f=r.child,b=f.sibling;var R={mode:"hidden",children:u.children};return(x&1)===0&&s.child!==f?(u=s.child,u.childLanes=0,u.pendingProps=R,s.deletions=null):(u=ls(f,R),u.subtreeFlags=f.subtreeFlags&14680064),b!==null?m=ls(b,m):(m=Ws(m,x,a,null),m.flags|=2),m.return=s,u.return=s,u.sibling=m,s.child=u,u=m,m=s.child,x=r.child.memoizedState,x=x===null?$d(a):{baseLanes:x.baseLanes|a,cachePool:null,transitions:x.transitions},m.memoizedState=x,m.childLanes=r.childLanes&~a,s.memoizedState=jd,u}return m=r.child,r=m.sibling,u=ls(m,{mode:"visible",children:u.children}),(s.mode&1)===0&&(u.lanes=a),u.return=s,u.sibling=null,r!==null&&(a=s.deletions,a===null?(s.deletions=[r],s.flags|=16):a.push(r)),s.child=u,s.memoizedState=null,u}function Ud(r,s){return s=gu({mode:"visible",children:s},r.mode,0,null),s.return=r,r.child=s}function ru(r,s,a,u){return u!==null&&hd(u),$o(s,r.child,null,a),r=Ud(s,s.pendingProps.children),r.flags|=2,s.memoizedState=null,r}function wb(r,s,a,u,f,m,x){if(a)return s.flags&256?(s.flags&=-257,u=Ld(Error(n(422))),ru(r,s,x,u)):s.memoizedState!==null?(s.child=r.child,s.flags|=128,null):(m=u.fallback,f=s.mode,u=gu({mode:"visible",children:u.children},f,0,null),m=Ws(m,f,x,null),m.flags|=2,u.return=s,m.return=s,u.sibling=m,s.child=u,(s.mode&1)!==0&&$o(s,r.child,null,x),s.child.memoizedState=$d(x),s.memoizedState=jd,m);if((s.mode&1)===0)return ru(r,s,x,null);if(f.data==="$!"){if(u=f.nextSibling&&f.nextSibling.dataset,u)var b=u.dgst;return u=b,m=Error(n(419)),u=Ld(m,u,void 0),ru(r,s,x,u)}if(b=(x&r.childLanes)!==0,un||b){if(u=Ct,u!==null){switch(x&-x){case 4:f=2;break;case 16:f=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:f=32;break;case 536870912:f=268435456;break;default:f=0}f=(f&(u.suspendedLanes|x))!==0?0:f,f!==0&&f!==m.retryLane&&(m.retryLane=f,Ar(r,f),Zn(u,r,f,-1))}return nh(),u=Ld(Error(n(421))),ru(r,s,x,u)}return f.data==="$?"?(s.flags|=128,s.child=r.child,s=Lb.bind(null,r),f._reactRetry=s,null):(r=m.treeContext,_n=Zr(f.nextSibling),En=s,Ze=!0,Jn=null,r!==null&&(Mn[Ln++]=Rr,Mn[Ln++]=Tr,Mn[Ln++]=Ns,Rr=r.id,Tr=r.overflow,Ns=s),s=Ud(s,u.children),s.flags|=4096,s)}function Yy(r,s,a){r.lanes|=s;var u=r.alternate;u!==null&&(u.lanes|=s),yd(r.return,s,a)}function Bd(r,s,a,u,f){var m=r.memoizedState;m===null?r.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:u,tail:a,tailMode:f}:(m.isBackwards=s,m.rendering=null,m.renderingStartTime=0,m.last=u,m.tail=a,m.tailMode=f)}function Xy(r,s,a){var u=s.pendingProps,f=u.revealOrder,m=u.tail;if(Gt(r,s,u.children,a),u=st.current,(u&2)!==0)u=u&1|2,s.flags|=128;else{if(r!==null&&(r.flags&128)!==0)e:for(r=s.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&Yy(r,a,s);else if(r.tag===19)Yy(r,a,s);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===s)break e;for(;r.sibling===null;){if(r.return===null||r.return===s)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}u&=1}if(Ke(st,u),(s.mode&1)===0)s.memoizedState=null;else switch(f){case"forwards":for(a=s.child,f=null;a!==null;)r=a.alternate,r!==null&&Gc(r)===null&&(f=a),a=a.sibling;a=f,a===null?(f=s.child,s.child=null):(f=a.sibling,a.sibling=null),Bd(s,!1,f,a,m);break;case"backwards":for(a=null,f=s.child,s.child=null;f!==null;){if(r=f.alternate,r!==null&&Gc(r)===null){s.child=f;break}r=f.sibling,f.sibling=a,a=f,f=r}Bd(s,!0,a,null,m);break;case"together":Bd(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function su(r,s){(s.mode&1)===0&&r!==null&&(r.alternate=null,s.alternate=null,s.flags|=2)}function Lr(r,s,a){if(r!==null&&(s.dependencies=r.dependencies),Bs|=s.lanes,(a&s.childLanes)===0)return null;if(r!==null&&s.child!==r.child)throw Error(n(153));if(s.child!==null){for(r=s.child,a=ls(r,r.pendingProps),s.child=a,a.return=s;r.sibling!==null;)r=r.sibling,a=a.sibling=ls(r,r.pendingProps),a.return=s;a.sibling=null}return s.child}function kb(r,s,a){switch(s.tag){case 3:Qy(s),jo();break;case 5:dy(s);break;case 1:cn(s.type)&&Uc(s);break;case 4:xd(s,s.stateNode.containerInfo);break;case 10:var u=s.type._context,f=s.memoizedProps.value;Ke(Hc,u._currentValue),u._currentValue=f;break;case 13:if(u=s.memoizedState,u!==null)return u.dehydrated!==null?(Ke(st,st.current&1),s.flags|=128,null):(a&s.child.childLanes)!==0?Gy(r,s,a):(Ke(st,st.current&1),r=Lr(r,s,a),r!==null?r.sibling:null);Ke(st,st.current&1);break;case 19:if(u=(a&s.childLanes)!==0,(r.flags&128)!==0){if(u)return Xy(r,s,a);s.flags|=128}if(f=s.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),Ke(st,st.current),u)break;return null;case 22:case 23:return s.lanes=0,Wy(r,s,a)}return Lr(r,s,a)}var Zy,zd,ev,tv;Zy=function(r,s){for(var a=s.child;a!==null;){if(a.tag===5||a.tag===6)r.appendChild(a.stateNode);else if(a.tag!==4&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===s)break;for(;a.sibling===null;){if(a.return===null||a.return===s)return;a=a.return}a.sibling.return=a.return,a=a.sibling}},zd=function(){},ev=function(r,s,a,u){var f=r.memoizedProps;if(f!==u){r=s.stateNode,$s(dr.current);var m=null;switch(a){case"input":f=Wr(r,f),u=Wr(r,u),m=[];break;case"select":f=te({},f,{value:void 0}),u=te({},u,{value:void 0}),m=[];break;case"textarea":f=ko(r,f),u=ko(r,u),m=[];break;default:typeof f.onClick!="function"&&typeof u.onClick=="function"&&(r.onclick=Dc)}kf(a,u);var x;a=null;for(G in f)if(!u.hasOwnProperty(G)&&f.hasOwnProperty(G)&&f[G]!=null)if(G==="style"){var b=f[G];for(x in b)b.hasOwnProperty(x)&&(a||(a={}),a[x]="")}else G!=="dangerouslySetInnerHTML"&&G!=="children"&&G!=="suppressContentEditableWarning"&&G!=="suppressHydrationWarning"&&G!=="autoFocus"&&(i.hasOwnProperty(G)?m||(m=[]):(m=m||[]).push(G,null));for(G in u){var R=u[G];if(b=f!=null?f[G]:void 0,u.hasOwnProperty(G)&&R!==b&&(R!=null||b!=null))if(G==="style")if(b){for(x in b)!b.hasOwnProperty(x)||R&&R.hasOwnProperty(x)||(a||(a={}),a[x]="");for(x in R)R.hasOwnProperty(x)&&b[x]!==R[x]&&(a||(a={}),a[x]=R[x])}else a||(m||(m=[]),m.push(G,a)),a=R;else G==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,b=b?b.__html:void 0,R!=null&&b!==R&&(m=m||[]).push(G,R)):G==="children"?typeof R!="string"&&typeof R!="number"||(m=m||[]).push(G,""+R):G!=="suppressContentEditableWarning"&&G!=="suppressHydrationWarning"&&(i.hasOwnProperty(G)?(R!=null&&G==="onScroll"&&Ye("scroll",r),m||b===R||(m=[])):(m=m||[]).push(G,R))}a&&(m=m||[]).push("style",a);var G=m;(s.updateQueue=G)&&(s.flags|=4)}},tv=function(r,s,a,u){a!==u&&(s.flags|=4)};function sa(r,s){if(!Ze)switch(r.tailMode){case"hidden":s=r.tail;for(var a=null;s!==null;)s.alternate!==null&&(a=s),s=s.sibling;a===null?r.tail=null:a.sibling=null;break;case"collapsed":a=r.tail;for(var u=null;a!==null;)a.alternate!==null&&(u=a),a=a.sibling;u===null?s||r.tail===null?r.tail=null:r.tail.sibling=null:u.sibling=null}}function zt(r){var s=r.alternate!==null&&r.alternate.child===r.child,a=0,u=0;if(s)for(var f=r.child;f!==null;)a|=f.lanes|f.childLanes,u|=f.subtreeFlags&14680064,u|=f.flags&14680064,f.return=r,f=f.sibling;else for(f=r.child;f!==null;)a|=f.lanes|f.childLanes,u|=f.subtreeFlags,u|=f.flags,f.return=r,f=f.sibling;return r.subtreeFlags|=u,r.childLanes=a,s}function Eb(r,s,a){var u=s.pendingProps;switch(ld(s),s.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return zt(s),null;case 1:return cn(s.type)&&$c(),zt(s),null;case 3:return u=s.stateNode,zo(),Xe(an),Xe(Ut),Ed(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(r===null||r.child===null)&&(qc(s)?s.flags|=4:r===null||r.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Jn!==null&&(Zd(Jn),Jn=null))),zd(r,s),zt(s),null;case 5:wd(s);var f=$s(Zi.current);if(a=s.type,r!==null&&s.stateNode!=null)ev(r,s,a,u,f),r.ref!==s.ref&&(s.flags|=512,s.flags|=2097152);else{if(!u){if(s.stateNode===null)throw Error(n(166));return zt(s),null}if(r=$s(dr.current),qc(s)){u=s.stateNode,a=s.type;var m=s.memoizedProps;switch(u[fr]=s,u[Qi]=m,r=(s.mode&1)!==0,a){case"dialog":Ye("cancel",u),Ye("close",u);break;case"iframe":case"object":case"embed":Ye("load",u);break;case"video":case"audio":for(f=0;f<Wi.length;f++)Ye(Wi[f],u);break;case"source":Ye("error",u);break;case"img":case"image":case"link":Ye("error",u),Ye("load",u);break;case"details":Ye("toggle",u);break;case"input":mc(u,m),Ye("invalid",u);break;case"select":u._wrapperState={wasMultiple:!!m.multiple},Ye("invalid",u);break;case"textarea":pc(u,m),Ye("invalid",u)}kf(a,m),f=null;for(var x in m)if(m.hasOwnProperty(x)){var b=m[x];x==="children"?typeof b=="string"?u.textContent!==b&&(m.suppressHydrationWarning!==!0&&Nc(u.textContent,b,r),f=["children",b]):typeof b=="number"&&u.textContent!==""+b&&(m.suppressHydrationWarning!==!0&&Nc(u.textContent,b,r),f=["children",""+b]):i.hasOwnProperty(x)&&b!=null&&x==="onScroll"&&Ye("scroll",u)}switch(a){case"input":on(u),Pr(u,m,!0);break;case"textarea":on(u),Be(u);break;case"select":case"option":break;default:typeof m.onClick=="function"&&(u.onclick=Dc)}u=f,s.updateQueue=u,u!==null&&(s.flags|=4)}else{x=f.nodeType===9?f:f.ownerDocument,r==="http://www.w3.org/1999/xhtml"&&(r=Lt(a)),r==="http://www.w3.org/1999/xhtml"?a==="script"?(r=x.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild)):typeof u.is=="string"?r=x.createElement(a,{is:u.is}):(r=x.createElement(a),a==="select"&&(x=r,u.multiple?x.multiple=!0:u.size&&(x.size=u.size))):r=x.createElementNS(r,a),r[fr]=s,r[Qi]=u,Zy(r,s,!1,!1),s.stateNode=r;e:{switch(x=Ef(a,u),a){case"dialog":Ye("cancel",r),Ye("close",r),f=u;break;case"iframe":case"object":case"embed":Ye("load",r),f=u;break;case"video":case"audio":for(f=0;f<Wi.length;f++)Ye(Wi[f],r);f=u;break;case"source":Ye("error",r),f=u;break;case"img":case"image":case"link":Ye("error",r),Ye("load",r),f=u;break;case"details":Ye("toggle",r),f=u;break;case"input":mc(r,u),f=Wr(r,u),Ye("invalid",r);break;case"option":f=u;break;case"select":r._wrapperState={wasMultiple:!!u.multiple},f=te({},u,{value:void 0}),Ye("invalid",r);break;case"textarea":pc(r,u),f=ko(r,u),Ye("invalid",r);break;default:f=u}kf(a,f),b=f;for(m in b)if(b.hasOwnProperty(m)){var R=b[m];m==="style"?qg(r,R):m==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,R!=null&&zg(r,R)):m==="children"?typeof R=="string"?(a!=="textarea"||R!=="")&&bi(r,R):typeof R=="number"&&bi(r,""+R):m!=="suppressContentEditableWarning"&&m!=="suppressHydrationWarning"&&m!=="autoFocus"&&(i.hasOwnProperty(m)?R!=null&&m==="onScroll"&&Ye("scroll",r):R!=null&&O(r,m,R,x))}switch(a){case"input":on(r),Pr(r,u,!1);break;case"textarea":on(r),Be(r);break;case"option":u.value!=null&&r.setAttribute("value",""+xe(u.value));break;case"select":r.multiple=!!u.multiple,m=u.value,m!=null?Hr(r,!!u.multiple,m,!1):u.defaultValue!=null&&Hr(r,!!u.multiple,u.defaultValue,!0);break;default:typeof f.onClick=="function"&&(r.onclick=Dc)}switch(a){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}}u&&(s.flags|=4)}s.ref!==null&&(s.flags|=512,s.flags|=2097152)}return zt(s),null;case 6:if(r&&s.stateNode!=null)tv(r,s,r.memoizedProps,u);else{if(typeof u!="string"&&s.stateNode===null)throw Error(n(166));if(a=$s(Zi.current),$s(dr.current),qc(s)){if(u=s.stateNode,a=s.memoizedProps,u[fr]=s,(m=u.nodeValue!==a)&&(r=En,r!==null))switch(r.tag){case 3:Nc(u.nodeValue,a,(r.mode&1)!==0);break;case 5:r.memoizedProps.suppressHydrationWarning!==!0&&Nc(u.nodeValue,a,(r.mode&1)!==0)}m&&(s.flags|=4)}else u=(a.nodeType===9?a:a.ownerDocument).createTextNode(u),u[fr]=s,s.stateNode=u}return zt(s),null;case 13:if(Xe(st),u=s.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(Ze&&_n!==null&&(s.mode&1)!==0&&(s.flags&128)===0)sy(),jo(),s.flags|=98560,m=!1;else if(m=qc(s),u!==null&&u.dehydrated!==null){if(r===null){if(!m)throw Error(n(318));if(m=s.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(n(317));m[fr]=s}else jo(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;zt(s),m=!1}else Jn!==null&&(Zd(Jn),Jn=null),m=!0;if(!m)return s.flags&65536?s:null}return(s.flags&128)!==0?(s.lanes=a,s):(u=u!==null,u!==(r!==null&&r.memoizedState!==null)&&u&&(s.child.flags|=8192,(s.mode&1)!==0&&(r===null||(st.current&1)!==0?xt===0&&(xt=3):nh())),s.updateQueue!==null&&(s.flags|=4),zt(s),null);case 4:return zo(),zd(r,s),r===null&&Hi(s.stateNode.containerInfo),zt(s),null;case 10:return gd(s.type._context),zt(s),null;case 17:return cn(s.type)&&$c(),zt(s),null;case 19:if(Xe(st),m=s.memoizedState,m===null)return zt(s),null;if(u=(s.flags&128)!==0,x=m.rendering,x===null)if(u)sa(m,!1);else{if(xt!==0||r!==null&&(r.flags&128)!==0)for(r=s.child;r!==null;){if(x=Gc(r),x!==null){for(s.flags|=128,sa(m,!1),u=x.updateQueue,u!==null&&(s.updateQueue=u,s.flags|=4),s.subtreeFlags=0,u=a,a=s.child;a!==null;)m=a,r=u,m.flags&=14680066,x=m.alternate,x===null?(m.childLanes=0,m.lanes=r,m.child=null,m.subtreeFlags=0,m.memoizedProps=null,m.memoizedState=null,m.updateQueue=null,m.dependencies=null,m.stateNode=null):(m.childLanes=x.childLanes,m.lanes=x.lanes,m.child=x.child,m.subtreeFlags=0,m.deletions=null,m.memoizedProps=x.memoizedProps,m.memoizedState=x.memoizedState,m.updateQueue=x.updateQueue,m.type=x.type,r=x.dependencies,m.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),a=a.sibling;return Ke(st,st.current&1|2),s.child}r=r.sibling}m.tail!==null&&ft()>Ho&&(s.flags|=128,u=!0,sa(m,!1),s.lanes=4194304)}else{if(!u)if(r=Gc(x),r!==null){if(s.flags|=128,u=!0,a=r.updateQueue,a!==null&&(s.updateQueue=a,s.flags|=4),sa(m,!0),m.tail===null&&m.tailMode==="hidden"&&!x.alternate&&!Ze)return zt(s),null}else 2*ft()-m.renderingStartTime>Ho&&a!==1073741824&&(s.flags|=128,u=!0,sa(m,!1),s.lanes=4194304);m.isBackwards?(x.sibling=s.child,s.child=x):(a=m.last,a!==null?a.sibling=x:s.child=x,m.last=x)}return m.tail!==null?(s=m.tail,m.rendering=s,m.tail=s.sibling,m.renderingStartTime=ft(),s.sibling=null,a=st.current,Ke(st,u?a&1|2:a&1),s):(zt(s),null);case 22:case 23:return th(),u=s.memoizedState!==null,r!==null&&r.memoizedState!==null!==u&&(s.flags|=8192),u&&(s.mode&1)!==0?(Cn&1073741824)!==0&&(zt(s),s.subtreeFlags&6&&(s.flags|=8192)):zt(s),null;case 24:return null;case 25:return null}throw Error(n(156,s.tag))}function _b(r,s){switch(ld(s),s.tag){case 1:return cn(s.type)&&$c(),r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 3:return zo(),Xe(an),Xe(Ut),Ed(),r=s.flags,(r&65536)!==0&&(r&128)===0?(s.flags=r&-65537|128,s):null;case 5:return wd(s),null;case 13:if(Xe(st),r=s.memoizedState,r!==null&&r.dehydrated!==null){if(s.alternate===null)throw Error(n(340));jo()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 19:return Xe(st),null;case 4:return zo(),null;case 10:return gd(s.type._context),null;case 22:case 23:return th(),null;case 24:return null;default:return null}}var ou=!1,Vt=!1,Cb=typeof WeakSet=="function"?WeakSet:Set,ge=null;function qo(r,s){var a=r.ref;if(a!==null)if(typeof a=="function")try{a(null)}catch(u){at(r,s,u)}else a.current=null}function Vd(r,s,a){try{a()}catch(u){at(r,s,u)}}var nv=!1;function bb(r,s){if(td=Cc,r=L0(),Kf(r)){if("selectionStart"in r)var a={start:r.selectionStart,end:r.selectionEnd};else e:{a=(a=r.ownerDocument)&&a.defaultView||window;var u=a.getSelection&&a.getSelection();if(u&&u.rangeCount!==0){a=u.anchorNode;var f=u.anchorOffset,m=u.focusNode;u=u.focusOffset;try{a.nodeType,m.nodeType}catch{a=null;break e}var x=0,b=-1,R=-1,G=0,ie=0,ae=r,oe=null;t:for(;;){for(var he;ae!==a||f!==0&&ae.nodeType!==3||(b=x+f),ae!==m||u!==0&&ae.nodeType!==3||(R=x+u),ae.nodeType===3&&(x+=ae.nodeValue.length),(he=ae.firstChild)!==null;)oe=ae,ae=he;for(;;){if(ae===r)break t;if(oe===a&&++G===f&&(b=x),oe===m&&++ie===u&&(R=x),(he=ae.nextSibling)!==null)break;ae=oe,oe=ae.parentNode}ae=he}a=b===-1||R===-1?null:{start:b,end:R}}else a=null}a=a||{start:0,end:0}}else a=null;for(nd={focusedElem:r,selectionRange:a},Cc=!1,ge=s;ge!==null;)if(s=ge,r=s.child,(s.subtreeFlags&1028)!==0&&r!==null)r.return=s,ge=r;else for(;ge!==null;){s=ge;try{var ye=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(ye!==null){var ve=ye.memoizedProps,dt=ye.memoizedState,z=s.stateNode,A=z.getSnapshotBeforeUpdate(s.elementType===s.type?ve:Gn(s.type,ve),dt);z.__reactInternalSnapshotBeforeUpdate=A}break;case 3:var W=s.stateNode.containerInfo;W.nodeType===1?W.textContent="":W.nodeType===9&&W.documentElement&&W.removeChild(W.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ce){at(s,s.return,ce)}if(r=s.sibling,r!==null){r.return=s.return,ge=r;break}ge=s.return}return ye=nv,nv=!1,ye}function oa(r,s,a){var u=s.updateQueue;if(u=u!==null?u.lastEffect:null,u!==null){var f=u=u.next;do{if((f.tag&r)===r){var m=f.destroy;f.destroy=void 0,m!==void 0&&Vd(s,a,m)}f=f.next}while(f!==u)}}function iu(r,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var a=s=s.next;do{if((a.tag&r)===r){var u=a.create;a.destroy=u()}a=a.next}while(a!==s)}}function qd(r){var s=r.ref;if(s!==null){var a=r.stateNode;switch(r.tag){case 5:r=a;break;default:r=a}typeof s=="function"?s(r):s.current=r}}function rv(r){var s=r.alternate;s!==null&&(r.alternate=null,rv(s)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(s=r.stateNode,s!==null&&(delete s[fr],delete s[Qi],delete s[id],delete s[cb],delete s[ub])),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}function sv(r){return r.tag===5||r.tag===3||r.tag===4}function ov(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||sv(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Wd(r,s,a){var u=r.tag;if(u===5||u===6)r=r.stateNode,s?a.nodeType===8?a.parentNode.insertBefore(r,s):a.insertBefore(r,s):(a.nodeType===8?(s=a.parentNode,s.insertBefore(r,a)):(s=a,s.appendChild(r)),a=a._reactRootContainer,a!=null||s.onclick!==null||(s.onclick=Dc));else if(u!==4&&(r=r.child,r!==null))for(Wd(r,s,a),r=r.sibling;r!==null;)Wd(r,s,a),r=r.sibling}function Hd(r,s,a){var u=r.tag;if(u===5||u===6)r=r.stateNode,s?a.insertBefore(r,s):a.appendChild(r);else if(u!==4&&(r=r.child,r!==null))for(Hd(r,s,a),r=r.sibling;r!==null;)Hd(r,s,a),r=r.sibling}var Ot=null,Yn=!1;function os(r,s,a){for(a=a.child;a!==null;)iv(r,s,a),a=a.sibling}function iv(r,s,a){if(lr&&typeof lr.onCommitFiberUnmount=="function")try{lr.onCommitFiberUnmount(Sc,a)}catch{}switch(a.tag){case 5:Vt||qo(a,s);case 6:var u=Ot,f=Yn;Ot=null,os(r,s,a),Ot=u,Yn=f,Ot!==null&&(Yn?(r=Ot,a=a.stateNode,r.nodeType===8?r.parentNode.removeChild(a):r.removeChild(a)):Ot.removeChild(a.stateNode));break;case 18:Ot!==null&&(Yn?(r=Ot,a=a.stateNode,r.nodeType===8?od(r.parentNode,a):r.nodeType===1&&od(r,a),Di(r)):od(Ot,a.stateNode));break;case 4:u=Ot,f=Yn,Ot=a.stateNode.containerInfo,Yn=!0,os(r,s,a),Ot=u,Yn=f;break;case 0:case 11:case 14:case 15:if(!Vt&&(u=a.updateQueue,u!==null&&(u=u.lastEffect,u!==null))){f=u=u.next;do{var m=f,x=m.destroy;m=m.tag,x!==void 0&&((m&2)!==0||(m&4)!==0)&&Vd(a,s,x),f=f.next}while(f!==u)}os(r,s,a);break;case 1:if(!Vt&&(qo(a,s),u=a.stateNode,typeof u.componentWillUnmount=="function"))try{u.props=a.memoizedProps,u.state=a.memoizedState,u.componentWillUnmount()}catch(b){at(a,s,b)}os(r,s,a);break;case 21:os(r,s,a);break;case 22:a.mode&1?(Vt=(u=Vt)||a.memoizedState!==null,os(r,s,a),Vt=u):os(r,s,a);break;default:os(r,s,a)}}function av(r){var s=r.updateQueue;if(s!==null){r.updateQueue=null;var a=r.stateNode;a===null&&(a=r.stateNode=new Cb),s.forEach(function(u){var f=Ob.bind(null,r,u);a.has(u)||(a.add(u),u.then(f,f))})}}function Xn(r,s){var a=s.deletions;if(a!==null)for(var u=0;u<a.length;u++){var f=a[u];try{var m=r,x=s,b=x;e:for(;b!==null;){switch(b.tag){case 5:Ot=b.stateNode,Yn=!1;break e;case 3:Ot=b.stateNode.containerInfo,Yn=!0;break e;case 4:Ot=b.stateNode.containerInfo,Yn=!0;break e}b=b.return}if(Ot===null)throw Error(n(160));iv(m,x,f),Ot=null,Yn=!1;var R=f.alternate;R!==null&&(R.return=null),f.return=null}catch(G){at(f,s,G)}}if(s.subtreeFlags&12854)for(s=s.child;s!==null;)cv(s,r),s=s.sibling}function cv(r,s){var a=r.alternate,u=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:if(Xn(s,r),mr(r),u&4){try{oa(3,r,r.return),iu(3,r)}catch(ve){at(r,r.return,ve)}try{oa(5,r,r.return)}catch(ve){at(r,r.return,ve)}}break;case 1:Xn(s,r),mr(r),u&512&&a!==null&&qo(a,a.return);break;case 5:if(Xn(s,r),mr(r),u&512&&a!==null&&qo(a,a.return),r.flags&32){var f=r.stateNode;try{bi(f,"")}catch(ve){at(r,r.return,ve)}}if(u&4&&(f=r.stateNode,f!=null)){var m=r.memoizedProps,x=a!==null?a.memoizedProps:m,b=r.type,R=r.updateQueue;if(r.updateQueue=null,R!==null)try{b==="input"&&m.type==="radio"&&m.name!=null&&_i(f,m),Ef(b,x);var G=Ef(b,m);for(x=0;x<R.length;x+=2){var ie=R[x],ae=R[x+1];ie==="style"?qg(f,ae):ie==="dangerouslySetInnerHTML"?zg(f,ae):ie==="children"?bi(f,ae):O(f,ie,ae,G)}switch(b){case"input":wo(f,m);break;case"textarea":Ci(f,m);break;case"select":var oe=f._wrapperState.wasMultiple;f._wrapperState.wasMultiple=!!m.multiple;var he=m.value;he!=null?Hr(f,!!m.multiple,he,!1):oe!==!!m.multiple&&(m.defaultValue!=null?Hr(f,!!m.multiple,m.defaultValue,!0):Hr(f,!!m.multiple,m.multiple?[]:"",!1))}f[Qi]=m}catch(ve){at(r,r.return,ve)}}break;case 6:if(Xn(s,r),mr(r),u&4){if(r.stateNode===null)throw Error(n(162));f=r.stateNode,m=r.memoizedProps;try{f.nodeValue=m}catch(ve){at(r,r.return,ve)}}break;case 3:if(Xn(s,r),mr(r),u&4&&a!==null&&a.memoizedState.isDehydrated)try{Di(s.containerInfo)}catch(ve){at(r,r.return,ve)}break;case 4:Xn(s,r),mr(r);break;case 13:Xn(s,r),mr(r),f=r.child,f.flags&8192&&(m=f.memoizedState!==null,f.stateNode.isHidden=m,!m||f.alternate!==null&&f.alternate.memoizedState!==null||(Jd=ft())),u&4&&av(r);break;case 22:if(ie=a!==null&&a.memoizedState!==null,r.mode&1?(Vt=(G=Vt)||ie,Xn(s,r),Vt=G):Xn(s,r),mr(r),u&8192){if(G=r.memoizedState!==null,(r.stateNode.isHidden=G)&&!ie&&(r.mode&1)!==0)for(ge=r,ie=r.child;ie!==null;){for(ae=ge=ie;ge!==null;){switch(oe=ge,he=oe.child,oe.tag){case 0:case 11:case 14:case 15:oa(4,oe,oe.return);break;case 1:qo(oe,oe.return);var ye=oe.stateNode;if(typeof ye.componentWillUnmount=="function"){u=oe,a=oe.return;try{s=u,ye.props=s.memoizedProps,ye.state=s.memoizedState,ye.componentWillUnmount()}catch(ve){at(u,a,ve)}}break;case 5:qo(oe,oe.return);break;case 22:if(oe.memoizedState!==null){fv(ae);continue}}he!==null?(he.return=oe,ge=he):fv(ae)}ie=ie.sibling}e:for(ie=null,ae=r;;){if(ae.tag===5){if(ie===null){ie=ae;try{f=ae.stateNode,G?(m=f.style,typeof m.setProperty=="function"?m.setProperty("display","none","important"):m.display="none"):(b=ae.stateNode,R=ae.memoizedProps.style,x=R!=null&&R.hasOwnProperty("display")?R.display:null,b.style.display=Vg("display",x))}catch(ve){at(r,r.return,ve)}}}else if(ae.tag===6){if(ie===null)try{ae.stateNode.nodeValue=G?"":ae.memoizedProps}catch(ve){at(r,r.return,ve)}}else if((ae.tag!==22&&ae.tag!==23||ae.memoizedState===null||ae===r)&&ae.child!==null){ae.child.return=ae,ae=ae.child;continue}if(ae===r)break e;for(;ae.sibling===null;){if(ae.return===null||ae.return===r)break e;ie===ae&&(ie=null),ae=ae.return}ie===ae&&(ie=null),ae.sibling.return=ae.return,ae=ae.sibling}}break;case 19:Xn(s,r),mr(r),u&4&&av(r);break;case 21:break;default:Xn(s,r),mr(r)}}function mr(r){var s=r.flags;if(s&2){try{e:{for(var a=r.return;a!==null;){if(sv(a)){var u=a;break e}a=a.return}throw Error(n(160))}switch(u.tag){case 5:var f=u.stateNode;u.flags&32&&(bi(f,""),u.flags&=-33);var m=ov(r);Hd(r,m,f);break;case 3:case 4:var x=u.stateNode.containerInfo,b=ov(r);Wd(r,b,x);break;default:throw Error(n(161))}}catch(R){at(r,r.return,R)}r.flags&=-3}s&4096&&(r.flags&=-4097)}function Pb(r,s,a){ge=r,uv(r)}function uv(r,s,a){for(var u=(r.mode&1)!==0;ge!==null;){var f=ge,m=f.child;if(f.tag===22&&u){var x=f.memoizedState!==null||ou;if(!x){var b=f.alternate,R=b!==null&&b.memoizedState!==null||Vt;b=ou;var G=Vt;if(ou=x,(Vt=R)&&!G)for(ge=f;ge!==null;)x=ge,R=x.child,x.tag===22&&x.memoizedState!==null?dv(f):R!==null?(R.return=x,ge=R):dv(f);for(;m!==null;)ge=m,uv(m),m=m.sibling;ge=f,ou=b,Vt=G}lv(r)}else(f.subtreeFlags&8772)!==0&&m!==null?(m.return=f,ge=m):lv(r)}}function lv(r){for(;ge!==null;){var s=ge;if((s.flags&8772)!==0){var a=s.alternate;try{if((s.flags&8772)!==0)switch(s.tag){case 0:case 11:case 15:Vt||iu(5,s);break;case 1:var u=s.stateNode;if(s.flags&4&&!Vt)if(a===null)u.componentDidMount();else{var f=s.elementType===s.type?a.memoizedProps:Gn(s.type,a.memoizedProps);u.componentDidUpdate(f,a.memoizedState,u.__reactInternalSnapshotBeforeUpdate)}var m=s.updateQueue;m!==null&&fy(s,m,u);break;case 3:var x=s.updateQueue;if(x!==null){if(a=null,s.child!==null)switch(s.child.tag){case 5:a=s.child.stateNode;break;case 1:a=s.child.stateNode}fy(s,x,a)}break;case 5:var b=s.stateNode;if(a===null&&s.flags&4){a=b;var R=s.memoizedProps;switch(s.type){case"button":case"input":case"select":case"textarea":R.autoFocus&&a.focus();break;case"img":R.src&&(a.src=R.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(s.memoizedState===null){var G=s.alternate;if(G!==null){var ie=G.memoizedState;if(ie!==null){var ae=ie.dehydrated;ae!==null&&Di(ae)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Vt||s.flags&512&&qd(s)}catch(oe){at(s,s.return,oe)}}if(s===r){ge=null;break}if(a=s.sibling,a!==null){a.return=s.return,ge=a;break}ge=s.return}}function fv(r){for(;ge!==null;){var s=ge;if(s===r){ge=null;break}var a=s.sibling;if(a!==null){a.return=s.return,ge=a;break}ge=s.return}}function dv(r){for(;ge!==null;){var s=ge;try{switch(s.tag){case 0:case 11:case 15:var a=s.return;try{iu(4,s)}catch(R){at(s,a,R)}break;case 1:var u=s.stateNode;if(typeof u.componentDidMount=="function"){var f=s.return;try{u.componentDidMount()}catch(R){at(s,f,R)}}var m=s.return;try{qd(s)}catch(R){at(s,m,R)}break;case 5:var x=s.return;try{qd(s)}catch(R){at(s,x,R)}}}catch(R){at(s,s.return,R)}if(s===r){ge=null;break}var b=s.sibling;if(b!==null){b.return=s.return,ge=b;break}ge=s.return}}var Fb=Math.ceil,au=C.ReactCurrentDispatcher,Kd=C.ReactCurrentOwner,Dn=C.ReactCurrentBatchConfig,De=0,Ct=null,yt=null,Nt=0,Cn=0,Wo=es(0),xt=0,ia=null,Bs=0,cu=0,Qd=0,aa=null,ln=null,Jd=0,Ho=1/0,Or=null,uu=!1,Gd=null,is=null,lu=!1,as=null,fu=0,ca=0,Yd=null,du=-1,hu=0;function Yt(){return(De&6)!==0?ft():du!==-1?du:du=ft()}function cs(r){return(r.mode&1)===0?1:(De&2)!==0&&Nt!==0?Nt&-Nt:fb.transition!==null?(hu===0&&(hu=o0()),hu):(r=ze,r!==0||(r=window.event,r=r===void 0?16:m0(r.type)),r)}function Zn(r,s,a,u){if(50<ca)throw ca=0,Yd=null,Error(n(185));Ai(r,a,u),((De&2)===0||r!==Ct)&&(r===Ct&&((De&2)===0&&(cu|=a),xt===4&&us(r,Nt)),fn(r,u),a===1&&De===0&&(s.mode&1)===0&&(Ho=ft()+500,Bc&&ns()))}function fn(r,s){var a=r.callbackNode;fC(r,s);var u=kc(r,r===Ct?Nt:0);if(u===0)a!==null&&n0(a),r.callbackNode=null,r.callbackPriority=0;else if(s=u&-u,r.callbackPriority!==s){if(a!=null&&n0(a),s===1)r.tag===0?lb(mv.bind(null,r)):Z0(mv.bind(null,r)),ib(function(){(De&6)===0&&ns()}),a=null;else{switch(i0(u)){case 1:a=Rf;break;case 4:a=r0;break;case 16:a=vc;break;case 536870912:a=s0;break;default:a=vc}a=kv(a,hv.bind(null,r))}r.callbackPriority=s,r.callbackNode=a}}function hv(r,s){if(du=-1,hu=0,(De&6)!==0)throw Error(n(327));var a=r.callbackNode;if(Ko()&&r.callbackNode!==a)return null;var u=kc(r,r===Ct?Nt:0);if(u===0)return null;if((u&30)!==0||(u&r.expiredLanes)!==0||s)s=mu(r,u);else{s=u;var f=De;De|=2;var m=gv();(Ct!==r||Nt!==s)&&(Or=null,Ho=ft()+500,Vs(r,s));do try{Tb();break}catch(b){pv(r,b)}while(!0);pd(),au.current=m,De=f,yt!==null?s=0:(Ct=null,Nt=0,s=xt)}if(s!==0){if(s===2&&(f=Tf(r),f!==0&&(u=f,s=Xd(r,f))),s===1)throw a=ia,Vs(r,0),us(r,u),fn(r,ft()),a;if(s===6)us(r,u);else{if(f=r.current.alternate,(u&30)===0&&!Ib(f)&&(s=mu(r,u),s===2&&(m=Tf(r),m!==0&&(u=m,s=Xd(r,m))),s===1))throw a=ia,Vs(r,0),us(r,u),fn(r,ft()),a;switch(r.finishedWork=f,r.finishedLanes=u,s){case 0:case 1:throw Error(n(345));case 2:qs(r,ln,Or);break;case 3:if(us(r,u),(u&130023424)===u&&(s=Jd+500-ft(),10<s)){if(kc(r,0)!==0)break;if(f=r.suspendedLanes,(f&u)!==u){Yt(),r.pingedLanes|=r.suspendedLanes&f;break}r.timeoutHandle=sd(qs.bind(null,r,ln,Or),s);break}qs(r,ln,Or);break;case 4:if(us(r,u),(u&4194240)===u)break;for(s=r.eventTimes,f=-1;0<u;){var x=31-Kn(u);m=1<<x,x=s[x],x>f&&(f=x),u&=~m}if(u=f,u=ft()-u,u=(120>u?120:480>u?480:1080>u?1080:1920>u?1920:3e3>u?3e3:4320>u?4320:1960*Fb(u/1960))-u,10<u){r.timeoutHandle=sd(qs.bind(null,r,ln,Or),u);break}qs(r,ln,Or);break;case 5:qs(r,ln,Or);break;default:throw Error(n(329))}}}return fn(r,ft()),r.callbackNode===a?hv.bind(null,r):null}function Xd(r,s){var a=aa;return r.current.memoizedState.isDehydrated&&(Vs(r,s).flags|=256),r=mu(r,s),r!==2&&(s=ln,ln=a,s!==null&&Zd(s)),r}function Zd(r){ln===null?ln=r:ln.push.apply(ln,r)}function Ib(r){for(var s=r;;){if(s.flags&16384){var a=s.updateQueue;if(a!==null&&(a=a.stores,a!==null))for(var u=0;u<a.length;u++){var f=a[u],m=f.getSnapshot;f=f.value;try{if(!Qn(m(),f))return!1}catch{return!1}}}if(a=s.child,s.subtreeFlags&16384&&a!==null)a.return=s,s=a;else{if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function us(r,s){for(s&=~Qd,s&=~cu,r.suspendedLanes|=s,r.pingedLanes&=~s,r=r.expirationTimes;0<s;){var a=31-Kn(s),u=1<<a;r[a]=-1,s&=~u}}function mv(r){if((De&6)!==0)throw Error(n(327));Ko();var s=kc(r,0);if((s&1)===0)return fn(r,ft()),null;var a=mu(r,s);if(r.tag!==0&&a===2){var u=Tf(r);u!==0&&(s=u,a=Xd(r,u))}if(a===1)throw a=ia,Vs(r,0),us(r,s),fn(r,ft()),a;if(a===6)throw Error(n(345));return r.finishedWork=r.current.alternate,r.finishedLanes=s,qs(r,ln,Or),fn(r,ft()),null}function eh(r,s){var a=De;De|=1;try{return r(s)}finally{De=a,De===0&&(Ho=ft()+500,Bc&&ns())}}function zs(r){as!==null&&as.tag===0&&(De&6)===0&&Ko();var s=De;De|=1;var a=Dn.transition,u=ze;try{if(Dn.transition=null,ze=1,r)return r()}finally{ze=u,Dn.transition=a,De=s,(De&6)===0&&ns()}}function th(){Cn=Wo.current,Xe(Wo)}function Vs(r,s){r.finishedWork=null,r.finishedLanes=0;var a=r.timeoutHandle;if(a!==-1&&(r.timeoutHandle=-1,ob(a)),yt!==null)for(a=yt.return;a!==null;){var u=a;switch(ld(u),u.tag){case 1:u=u.type.childContextTypes,u!=null&&$c();break;case 3:zo(),Xe(an),Xe(Ut),Ed();break;case 5:wd(u);break;case 4:zo();break;case 13:Xe(st);break;case 19:Xe(st);break;case 10:gd(u.type._context);break;case 22:case 23:th()}a=a.return}if(Ct=r,yt=r=ls(r.current,null),Nt=Cn=s,xt=0,ia=null,Qd=cu=Bs=0,ln=aa=null,js!==null){for(s=0;s<js.length;s++)if(a=js[s],u=a.interleaved,u!==null){a.interleaved=null;var f=u.next,m=a.pending;if(m!==null){var x=m.next;m.next=f,u.next=x}a.pending=u}js=null}return r}function pv(r,s){do{var a=yt;try{if(pd(),Yc.current=tu,Xc){for(var u=ot.memoizedState;u!==null;){var f=u.queue;f!==null&&(f.pending=null),u=u.next}Xc=!1}if(Us=0,_t=St=ot=null,ea=!1,ta=0,Kd.current=null,a===null||a.return===null){xt=1,ia=s,yt=null;break}e:{var m=r,x=a.return,b=a,R=s;if(s=Nt,b.flags|=32768,R!==null&&typeof R=="object"&&typeof R.then=="function"){var G=R,ie=b,ae=ie.tag;if((ie.mode&1)===0&&(ae===0||ae===11||ae===15)){var oe=ie.alternate;oe?(ie.updateQueue=oe.updateQueue,ie.memoizedState=oe.memoizedState,ie.lanes=oe.lanes):(ie.updateQueue=null,ie.memoizedState=null)}var he=Uy(x);if(he!==null){he.flags&=-257,By(he,x,b,m,s),he.mode&1&&$y(m,G,s),s=he,R=G;var ye=s.updateQueue;if(ye===null){var ve=new Set;ve.add(R),s.updateQueue=ve}else ye.add(R);break e}else{if((s&1)===0){$y(m,G,s),nh();break e}R=Error(n(426))}}else if(Ze&&b.mode&1){var dt=Uy(x);if(dt!==null){(dt.flags&65536)===0&&(dt.flags|=256),By(dt,x,b,m,s),hd(Vo(R,b));break e}}m=R=Vo(R,b),xt!==4&&(xt=2),aa===null?aa=[m]:aa.push(m),m=x;do{switch(m.tag){case 3:m.flags|=65536,s&=-s,m.lanes|=s;var z=Dy(m,R,s);ly(m,z);break e;case 1:b=R;var A=m.type,W=m.stateNode;if((m.flags&128)===0&&(typeof A.getDerivedStateFromError=="function"||W!==null&&typeof W.componentDidCatch=="function"&&(is===null||!is.has(W)))){m.flags|=65536,s&=-s,m.lanes|=s;var ce=jy(m,b,s);ly(m,ce);break e}}m=m.return}while(m!==null)}vv(a)}catch(Se){s=Se,yt===a&&a!==null&&(yt=a=a.return);continue}break}while(!0)}function gv(){var r=au.current;return au.current=tu,r===null?tu:r}function nh(){(xt===0||xt===3||xt===2)&&(xt=4),Ct===null||(Bs&268435455)===0&&(cu&268435455)===0||us(Ct,Nt)}function mu(r,s){var a=De;De|=2;var u=gv();(Ct!==r||Nt!==s)&&(Or=null,Vs(r,s));do try{Rb();break}catch(f){pv(r,f)}while(!0);if(pd(),De=a,au.current=u,yt!==null)throw Error(n(261));return Ct=null,Nt=0,xt}function Rb(){for(;yt!==null;)yv(yt)}function Tb(){for(;yt!==null&&!nC();)yv(yt)}function yv(r){var s=wv(r.alternate,r,Cn);r.memoizedProps=r.pendingProps,s===null?vv(r):yt=s,Kd.current=null}function vv(r){var s=r;do{var a=s.alternate;if(r=s.return,(s.flags&32768)===0){if(a=Eb(a,s,Cn),a!==null){yt=a;return}}else{if(a=_b(a,s),a!==null){a.flags&=32767,yt=a;return}if(r!==null)r.flags|=32768,r.subtreeFlags=0,r.deletions=null;else{xt=6,yt=null;return}}if(s=s.sibling,s!==null){yt=s;return}yt=s=r}while(s!==null);xt===0&&(xt=5)}function qs(r,s,a){var u=ze,f=Dn.transition;try{Dn.transition=null,ze=1,Ab(r,s,a,u)}finally{Dn.transition=f,ze=u}return null}function Ab(r,s,a,u){do Ko();while(as!==null);if((De&6)!==0)throw Error(n(327));a=r.finishedWork;var f=r.finishedLanes;if(a===null)return null;if(r.finishedWork=null,r.finishedLanes=0,a===r.current)throw Error(n(177));r.callbackNode=null,r.callbackPriority=0;var m=a.lanes|a.childLanes;if(dC(r,m),r===Ct&&(yt=Ct=null,Nt=0),(a.subtreeFlags&2064)===0&&(a.flags&2064)===0||lu||(lu=!0,kv(vc,function(){return Ko(),null})),m=(a.flags&15990)!==0,(a.subtreeFlags&15990)!==0||m){m=Dn.transition,Dn.transition=null;var x=ze;ze=1;var b=De;De|=4,Kd.current=null,bb(r,a),cv(a,r),XC(nd),Cc=!!td,nd=td=null,r.current=a,Pb(a),rC(),De=b,ze=x,Dn.transition=m}else r.current=a;if(lu&&(lu=!1,as=r,fu=f),m=r.pendingLanes,m===0&&(is=null),iC(a.stateNode),fn(r,ft()),s!==null)for(u=r.onRecoverableError,a=0;a<s.length;a++)f=s[a],u(f.value,{componentStack:f.stack,digest:f.digest});if(uu)throw uu=!1,r=Gd,Gd=null,r;return(fu&1)!==0&&r.tag!==0&&Ko(),m=r.pendingLanes,(m&1)!==0?r===Yd?ca++:(ca=0,Yd=r):ca=0,ns(),null}function Ko(){if(as!==null){var r=i0(fu),s=Dn.transition,a=ze;try{if(Dn.transition=null,ze=16>r?16:r,as===null)var u=!1;else{if(r=as,as=null,fu=0,(De&6)!==0)throw Error(n(331));var f=De;for(De|=4,ge=r.current;ge!==null;){var m=ge,x=m.child;if((ge.flags&16)!==0){var b=m.deletions;if(b!==null){for(var R=0;R<b.length;R++){var G=b[R];for(ge=G;ge!==null;){var ie=ge;switch(ie.tag){case 0:case 11:case 15:oa(8,ie,m)}var ae=ie.child;if(ae!==null)ae.return=ie,ge=ae;else for(;ge!==null;){ie=ge;var oe=ie.sibling,he=ie.return;if(rv(ie),ie===G){ge=null;break}if(oe!==null){oe.return=he,ge=oe;break}ge=he}}}var ye=m.alternate;if(ye!==null){var ve=ye.child;if(ve!==null){ye.child=null;do{var dt=ve.sibling;ve.sibling=null,ve=dt}while(ve!==null)}}ge=m}}if((m.subtreeFlags&2064)!==0&&x!==null)x.return=m,ge=x;else e:for(;ge!==null;){if(m=ge,(m.flags&2048)!==0)switch(m.tag){case 0:case 11:case 15:oa(9,m,m.return)}var z=m.sibling;if(z!==null){z.return=m.return,ge=z;break e}ge=m.return}}var A=r.current;for(ge=A;ge!==null;){x=ge;var W=x.child;if((x.subtreeFlags&2064)!==0&&W!==null)W.return=x,ge=W;else e:for(x=A;ge!==null;){if(b=ge,(b.flags&2048)!==0)try{switch(b.tag){case 0:case 11:case 15:iu(9,b)}}catch(Se){at(b,b.return,Se)}if(b===x){ge=null;break e}var ce=b.sibling;if(ce!==null){ce.return=b.return,ge=ce;break e}ge=b.return}}if(De=f,ns(),lr&&typeof lr.onPostCommitFiberRoot=="function")try{lr.onPostCommitFiberRoot(Sc,r)}catch{}u=!0}return u}finally{ze=a,Dn.transition=s}}return!1}function Sv(r,s,a){s=Vo(a,s),s=Dy(r,s,1),r=ss(r,s,1),s=Yt(),r!==null&&(Ai(r,1,s),fn(r,s))}function at(r,s,a){if(r.tag===3)Sv(r,r,a);else for(;s!==null;){if(s.tag===3){Sv(s,r,a);break}else if(s.tag===1){var u=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(is===null||!is.has(u))){r=Vo(a,r),r=jy(s,r,1),s=ss(s,r,1),r=Yt(),s!==null&&(Ai(s,1,r),fn(s,r));break}}s=s.return}}function Mb(r,s,a){var u=r.pingCache;u!==null&&u.delete(s),s=Yt(),r.pingedLanes|=r.suspendedLanes&a,Ct===r&&(Nt&a)===a&&(xt===4||xt===3&&(Nt&130023424)===Nt&&500>ft()-Jd?Vs(r,0):Qd|=a),fn(r,s)}function xv(r,s){s===0&&((r.mode&1)===0?s=1:(s=wc,wc<<=1,(wc&130023424)===0&&(wc=4194304)));var a=Yt();r=Ar(r,s),r!==null&&(Ai(r,s,a),fn(r,a))}function Lb(r){var s=r.memoizedState,a=0;s!==null&&(a=s.retryLane),xv(r,a)}function Ob(r,s){var a=0;switch(r.tag){case 13:var u=r.stateNode,f=r.memoizedState;f!==null&&(a=f.retryLane);break;case 19:u=r.stateNode;break;default:throw Error(n(314))}u!==null&&u.delete(s),xv(r,a)}var wv;wv=function(r,s,a){if(r!==null)if(r.memoizedProps!==s.pendingProps||an.current)un=!0;else{if((r.lanes&a)===0&&(s.flags&128)===0)return un=!1,kb(r,s,a);un=(r.flags&131072)!==0}else un=!1,Ze&&(s.flags&1048576)!==0&&ey(s,Vc,s.index);switch(s.lanes=0,s.tag){case 2:var u=s.type;su(r,s),r=s.pendingProps;var f=Oo(s,Ut.current);Bo(s,a),f=bd(null,s,u,r,f,a);var m=Pd();return s.flags|=1,typeof f=="object"&&f!==null&&typeof f.render=="function"&&f.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,cn(u)?(m=!0,Uc(s)):m=!1,s.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,Sd(s),f.updater=nu,s.stateNode=f,f._reactInternals=s,Md(s,u,r,a),s=Dd(null,s,u,!0,m,a)):(s.tag=0,Ze&&m&&ud(s),Gt(null,s,f,a),s=s.child),s;case 16:u=s.elementType;e:{switch(su(r,s),r=s.pendingProps,f=u._init,u=f(u._payload),s.type=u,f=s.tag=Db(u),r=Gn(u,r),f){case 0:s=Nd(null,s,u,r,a);break e;case 1:s=Ky(null,s,u,r,a);break e;case 11:s=zy(null,s,u,r,a);break e;case 14:s=Vy(null,s,u,Gn(u.type,r),a);break e}throw Error(n(306,u,""))}return s;case 0:return u=s.type,f=s.pendingProps,f=s.elementType===u?f:Gn(u,f),Nd(r,s,u,f,a);case 1:return u=s.type,f=s.pendingProps,f=s.elementType===u?f:Gn(u,f),Ky(r,s,u,f,a);case 3:e:{if(Qy(s),r===null)throw Error(n(387));u=s.pendingProps,m=s.memoizedState,f=m.element,uy(r,s),Jc(s,u,null,a);var x=s.memoizedState;if(u=x.element,m.isDehydrated)if(m={element:u,isDehydrated:!1,cache:x.cache,pendingSuspenseBoundaries:x.pendingSuspenseBoundaries,transitions:x.transitions},s.updateQueue.baseState=m,s.memoizedState=m,s.flags&256){f=Vo(Error(n(423)),s),s=Jy(r,s,u,a,f);break e}else if(u!==f){f=Vo(Error(n(424)),s),s=Jy(r,s,u,a,f);break e}else for(_n=Zr(s.stateNode.containerInfo.firstChild),En=s,Ze=!0,Jn=null,a=ay(s,null,u,a),s.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(jo(),u===f){s=Lr(r,s,a);break e}Gt(r,s,u,a)}s=s.child}return s;case 5:return dy(s),r===null&&dd(s),u=s.type,f=s.pendingProps,m=r!==null?r.memoizedProps:null,x=f.children,rd(u,f)?x=null:m!==null&&rd(u,m)&&(s.flags|=32),Hy(r,s),Gt(r,s,x,a),s.child;case 6:return r===null&&dd(s),null;case 13:return Gy(r,s,a);case 4:return xd(s,s.stateNode.containerInfo),u=s.pendingProps,r===null?s.child=$o(s,null,u,a):Gt(r,s,u,a),s.child;case 11:return u=s.type,f=s.pendingProps,f=s.elementType===u?f:Gn(u,f),zy(r,s,u,f,a);case 7:return Gt(r,s,s.pendingProps,a),s.child;case 8:return Gt(r,s,s.pendingProps.children,a),s.child;case 12:return Gt(r,s,s.pendingProps.children,a),s.child;case 10:e:{if(u=s.type._context,f=s.pendingProps,m=s.memoizedProps,x=f.value,Ke(Hc,u._currentValue),u._currentValue=x,m!==null)if(Qn(m.value,x)){if(m.children===f.children&&!an.current){s=Lr(r,s,a);break e}}else for(m=s.child,m!==null&&(m.return=s);m!==null;){var b=m.dependencies;if(b!==null){x=m.child;for(var R=b.firstContext;R!==null;){if(R.context===u){if(m.tag===1){R=Mr(-1,a&-a),R.tag=2;var G=m.updateQueue;if(G!==null){G=G.shared;var ie=G.pending;ie===null?R.next=R:(R.next=ie.next,ie.next=R),G.pending=R}}m.lanes|=a,R=m.alternate,R!==null&&(R.lanes|=a),yd(m.return,a,s),b.lanes|=a;break}R=R.next}}else if(m.tag===10)x=m.type===s.type?null:m.child;else if(m.tag===18){if(x=m.return,x===null)throw Error(n(341));x.lanes|=a,b=x.alternate,b!==null&&(b.lanes|=a),yd(x,a,s),x=m.sibling}else x=m.child;if(x!==null)x.return=m;else for(x=m;x!==null;){if(x===s){x=null;break}if(m=x.sibling,m!==null){m.return=x.return,x=m;break}x=x.return}m=x}Gt(r,s,f.children,a),s=s.child}return s;case 9:return f=s.type,u=s.pendingProps.children,Bo(s,a),f=On(f),u=u(f),s.flags|=1,Gt(r,s,u,a),s.child;case 14:return u=s.type,f=Gn(u,s.pendingProps),f=Gn(u.type,f),Vy(r,s,u,f,a);case 15:return qy(r,s,s.type,s.pendingProps,a);case 17:return u=s.type,f=s.pendingProps,f=s.elementType===u?f:Gn(u,f),su(r,s),s.tag=1,cn(u)?(r=!0,Uc(s)):r=!1,Bo(s,a),Oy(s,u,f),Md(s,u,f,a),Dd(null,s,u,!0,r,a);case 19:return Xy(r,s,a);case 22:return Wy(r,s,a)}throw Error(n(156,s.tag))};function kv(r,s){return t0(r,s)}function Nb(r,s,a,u){this.tag=r,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jn(r,s,a,u){return new Nb(r,s,a,u)}function rh(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Db(r){if(typeof r=="function")return rh(r)?1:0;if(r!=null){if(r=r.$$typeof,r===K)return 11;if(r===V)return 14}return 2}function ls(r,s){var a=r.alternate;return a===null?(a=jn(r.tag,s,r.key,r.mode),a.elementType=r.elementType,a.type=r.type,a.stateNode=r.stateNode,a.alternate=r,r.alternate=a):(a.pendingProps=s,a.type=r.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=r.flags&14680064,a.childLanes=r.childLanes,a.lanes=r.lanes,a.child=r.child,a.memoizedProps=r.memoizedProps,a.memoizedState=r.memoizedState,a.updateQueue=r.updateQueue,s=r.dependencies,a.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},a.sibling=r.sibling,a.index=r.index,a.ref=r.ref,a}function pu(r,s,a,u,f,m){var x=2;if(u=r,typeof r=="function")rh(r)&&(x=1);else if(typeof r=="string")x=5;else e:switch(r){case L:return Ws(a.children,f,m,s);case $:x=8,f|=8;break;case q:return r=jn(12,a,s,f|2),r.elementType=q,r.lanes=m,r;case k:return r=jn(13,a,s,f),r.elementType=k,r.lanes=m,r;case U:return r=jn(19,a,s,f),r.elementType=U,r.lanes=m,r;case B:return gu(a,f,m,s);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case ee:x=10;break e;case se:x=9;break e;case K:x=11;break e;case V:x=14;break e;case J:x=16,u=null;break e}throw Error(n(130,r==null?r:typeof r,""))}return s=jn(x,a,s,f),s.elementType=r,s.type=u,s.lanes=m,s}function Ws(r,s,a,u){return r=jn(7,r,u,s),r.lanes=a,r}function gu(r,s,a,u){return r=jn(22,r,u,s),r.elementType=B,r.lanes=a,r.stateNode={isHidden:!1},r}function sh(r,s,a){return r=jn(6,r,null,s),r.lanes=a,r}function oh(r,s,a){return s=jn(4,r.children!==null?r.children:[],r.key,s),s.lanes=a,s.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},s}function jb(r,s,a,u,f){this.tag=s,this.containerInfo=r,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Af(0),this.expirationTimes=Af(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Af(0),this.identifierPrefix=u,this.onRecoverableError=f,this.mutableSourceEagerHydrationData=null}function ih(r,s,a,u,f,m,x,b,R){return r=new jb(r,s,a,b,R),s===1?(s=1,m===!0&&(s|=8)):s=0,m=jn(3,null,null,s),r.current=m,m.stateNode=r,m.memoizedState={element:u,isDehydrated:a,cache:null,transitions:null,pendingSuspenseBoundaries:null},Sd(m),r}function $b(r,s,a){var u=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:u==null?null:""+u,children:r,containerInfo:s,implementation:a}}function Ev(r){if(!r)return ts;r=r._reactInternals;e:{if(Ms(r)!==r||r.tag!==1)throw Error(n(170));var s=r;do{switch(s.tag){case 3:s=s.stateNode.context;break e;case 1:if(cn(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break e}}s=s.return}while(s!==null);throw Error(n(171))}if(r.tag===1){var a=r.type;if(cn(a))return Y0(r,a,s)}return s}function _v(r,s,a,u,f,m,x,b,R){return r=ih(a,u,!0,r,f,m,x,b,R),r.context=Ev(null),a=r.current,u=Yt(),f=cs(a),m=Mr(u,f),m.callback=s??null,ss(a,m,f),r.current.lanes=f,Ai(r,f,u),fn(r,u),r}function yu(r,s,a,u){var f=s.current,m=Yt(),x=cs(f);return a=Ev(a),s.context===null?s.context=a:s.pendingContext=a,s=Mr(m,x),s.payload={element:r},u=u===void 0?null:u,u!==null&&(s.callback=u),r=ss(f,s,x),r!==null&&(Zn(r,f,x,m),Qc(r,f,x)),x}function vu(r){if(r=r.current,!r.child)return null;switch(r.child.tag){case 5:return r.child.stateNode;default:return r.child.stateNode}}function Cv(r,s){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var a=r.retryLane;r.retryLane=a!==0&&a<s?a:s}}function ah(r,s){Cv(r,s),(r=r.alternate)&&Cv(r,s)}function Ub(){return null}var bv=typeof reportError=="function"?reportError:function(r){console.error(r)};function ch(r){this._internalRoot=r}Su.prototype.render=ch.prototype.render=function(r){var s=this._internalRoot;if(s===null)throw Error(n(409));yu(r,s,null,null)},Su.prototype.unmount=ch.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var s=r.containerInfo;zs(function(){yu(null,r,null,null)}),s[Fr]=null}};function Su(r){this._internalRoot=r}Su.prototype.unstable_scheduleHydration=function(r){if(r){var s=u0();r={blockedOn:null,target:r,priority:s};for(var a=0;a<Gr.length&&s!==0&&s<Gr[a].priority;a++);Gr.splice(a,0,r),a===0&&d0(r)}};function uh(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function xu(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11&&(r.nodeType!==8||r.nodeValue!==" react-mount-point-unstable "))}function Pv(){}function Bb(r,s,a,u,f){if(f){if(typeof u=="function"){var m=u;u=function(){var G=vu(x);m.call(G)}}var x=_v(s,u,r,0,null,!1,!1,"",Pv);return r._reactRootContainer=x,r[Fr]=x.current,Hi(r.nodeType===8?r.parentNode:r),zs(),x}for(;f=r.lastChild;)r.removeChild(f);if(typeof u=="function"){var b=u;u=function(){var G=vu(R);b.call(G)}}var R=ih(r,0,!1,null,null,!1,!1,"",Pv);return r._reactRootContainer=R,r[Fr]=R.current,Hi(r.nodeType===8?r.parentNode:r),zs(function(){yu(s,R,a,u)}),R}function wu(r,s,a,u,f){var m=a._reactRootContainer;if(m){var x=m;if(typeof f=="function"){var b=f;f=function(){var R=vu(x);b.call(R)}}yu(s,x,r,f)}else x=Bb(a,s,r,f,u);return vu(x)}a0=function(r){switch(r.tag){case 3:var s=r.stateNode;if(s.current.memoizedState.isDehydrated){var a=Ti(s.pendingLanes);a!==0&&(Mf(s,a|1),fn(s,ft()),(De&6)===0&&(Ho=ft()+500,ns()))}break;case 13:zs(function(){var u=Ar(r,1);if(u!==null){var f=Yt();Zn(u,r,1,f)}}),ah(r,1)}},Lf=function(r){if(r.tag===13){var s=Ar(r,134217728);if(s!==null){var a=Yt();Zn(s,r,134217728,a)}ah(r,134217728)}},c0=function(r){if(r.tag===13){var s=cs(r),a=Ar(r,s);if(a!==null){var u=Yt();Zn(a,r,s,u)}ah(r,s)}},u0=function(){return ze},l0=function(r,s){var a=ze;try{return ze=r,s()}finally{ze=a}},bf=function(r,s,a){switch(s){case"input":if(wo(r,a),s=a.name,a.type==="radio"&&s!=null){for(a=r;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll("input[name="+JSON.stringify(""+s)+'][type="radio"]'),s=0;s<a.length;s++){var u=a[s];if(u!==r&&u.form===r.form){var f=jc(u);if(!f)throw Error(n(90));xn(u),wo(u,f)}}}break;case"textarea":Ci(r,a);break;case"select":s=a.value,s!=null&&Hr(r,!!a.multiple,s,!1)}},Qg=eh,Jg=zs;var zb={usingClientEntryPoint:!1,Events:[Ji,Mo,jc,Hg,Kg,eh]},ua={findFiberByHostInstance:Ls,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Vb={bundleType:ua.bundleType,version:ua.version,rendererPackageName:ua.rendererPackageName,rendererConfig:ua.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(r){return r=Zg(r),r===null?null:r.stateNode},findFiberByHostInstance:ua.findFiberByHostInstance||Ub,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ku=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ku.isDisabled&&ku.supportsFiber)try{Sc=ku.inject(Vb),lr=ku}catch{}}return dn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=zb,dn.createPortal=function(r,s){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!uh(s))throw Error(n(200));return $b(r,s,null,a)},dn.createRoot=function(r,s){if(!uh(r))throw Error(n(299));var a=!1,u="",f=bv;return s!=null&&(s.unstable_strictMode===!0&&(a=!0),s.identifierPrefix!==void 0&&(u=s.identifierPrefix),s.onRecoverableError!==void 0&&(f=s.onRecoverableError)),s=ih(r,1,!1,null,null,a,!1,u,f),r[Fr]=s.current,Hi(r.nodeType===8?r.parentNode:r),new ch(s)},dn.findDOMNode=function(r){if(r==null)return null;if(r.nodeType===1)return r;var s=r._reactInternals;if(s===void 0)throw typeof r.render=="function"?Error(n(188)):(r=Object.keys(r).join(","),Error(n(268,r)));return r=Zg(s),r=r===null?null:r.stateNode,r},dn.flushSync=function(r){return zs(r)},dn.hydrate=function(r,s,a){if(!xu(s))throw Error(n(200));return wu(null,r,s,!0,a)},dn.hydrateRoot=function(r,s,a){if(!uh(r))throw Error(n(405));var u=a!=null&&a.hydratedSources||null,f=!1,m="",x=bv;if(a!=null&&(a.unstable_strictMode===!0&&(f=!0),a.identifierPrefix!==void 0&&(m=a.identifierPrefix),a.onRecoverableError!==void 0&&(x=a.onRecoverableError)),s=_v(s,null,r,1,a??null,f,!1,m,x),r[Fr]=s.current,Hi(r),u)for(r=0;r<u.length;r++)a=u[r],f=a._getVersion,f=f(a._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[a,f]:s.mutableSourceEagerHydrationData.push(a,f);return new Su(s)},dn.render=function(r,s,a){if(!xu(s))throw Error(n(200));return wu(null,r,s,!1,a)},dn.unmountComponentAtNode=function(r){if(!xu(r))throw Error(n(40));return r._reactRootContainer?(zs(function(){wu(null,null,r,!1,function(){r._reactRootContainer=null,r[Fr]=null})}),!0):!1},dn.unstable_batchedUpdates=eh,dn.unstable_renderSubtreeIntoContainer=function(r,s,a,u){if(!xu(a))throw Error(n(200));if(r==null||r._reactInternals===void 0)throw Error(n(38));return wu(r,s,a,!1,u)},dn.version="18.3.1-next-f1338f8080-20240426",dn}var Ov;function vw(){if(Ov)return dh.exports;Ov=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),dh.exports=Zb(),dh.exports}var Nv;function e2(){if(Nv)return Eu;Nv=1;var e=vw();return Eu.createRoot=e.createRoot,Eu.hydrateRoot=e.hydrateRoot,Eu}var t2=e2(),n2={};const up=o2();function tt(e,...t){if(!up)return;const n=s2(e,...t);performance.mark(n);try{console.log(e,...t)}catch{console.log(n)}}function r2(e,...t){up&&console.warn(e,...t)}function s2(e,...t){return e.replace(/%[sfdO]/g,n=>{const o=t.shift();return n==="%O"&&o?JSON.stringify(o).replace(/"([^"]+)":/g,"$1:"):String(o)})}function o2(){if(typeof window>"u")return(n2.DEBUG||"").includes("nuqs");try{const e="nuqs-localStorage-test";if(typeof localStorage>"u")return!1;localStorage.setItem(e,e);const t=localStorage.getItem(e)===e;return localStorage.removeItem(e),t&&(localStorage.getItem("debug")||"").includes("nuqs")}catch{return!1}}const i2={303:"Multiple adapter contexts detected. This might happen in monorepos.",404:"nuqs requires an adapter to work with your framework.",409:"Multiple versions of the library are loaded. This may lead to unexpected behavior. Currently using `%s`, but `%s` (via the %s adapter) was about to load on top.",414:"Max safe URL length exceeded. Some browsers may not be able to accept this URL. Consider limiting the amount of state stored in the URL.",422:"Invalid options combination: `limitUrlUpdates: debounce` should be used in SSR scenarios, with `shallow: false`",429:"URL update rate-limited by the browser. Consider increasing `throttleMs` for key(s) `%s`. %O",500:"Empty search params cache. Search params can't be accessed in Layouts.",501:"Search params cache already populated. Have you called `parse` twice?"};function Ja(e){return`[nuqs] ${i2[e]}
|
|
42
|
-
See https://nuqs.dev/NUQS-${e}`}function a2(e){if(e.size===0)return"";const t=[];for(const[o,i]of e.entries()){const c=o.replace(/#/g,"%23").replace(/&/g,"%26").replace(/\+/g,"%2B").replace(/=/g,"%3D").replace(/\?/g,"%3F");t.push(`${c}=${c2(i)}`)}return"?"+t.join("&")}function c2(e){return e.replace(/%/g,"%25").replace(/\+/g,"%2B").replace(/ /g,"+").replace(/#/g,"%23").replace(/&/g,"%26").replace(/"/g,"%22").replace(/'/g,"%27").replace(/`/g,"%60").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/[\x00-\x1F]/g,t=>encodeURIComponent(t))}const ao=Y.createContext({useAdapter(){throw new Error(Ja(404))}});ao.displayName="NuqsAdapterContext";up&&typeof window<"u"&&(window.__NuqsAdapterContext&&window.__NuqsAdapterContext!==ao&&console.error(Ja(303)),window.__NuqsAdapterContext=ao);function u2(e){return({children:t,defaultOptions:n,processUrlSearchParams:o,...i})=>Y.createElement(ao.Provider,{...i,value:{useAdapter:e,defaultOptions:n,processUrlSearchParams:o}},t)}function l2(e){const t=Y.useContext(ao);if(!("useAdapter"in t))throw new Error(Ja(404));return t.useAdapter(e)}const f2=()=>Y.useContext(ao).defaultOptions,d2=()=>Y.useContext(ao).processUrlSearchParams;function h2(){var e;if(typeof window>"u"||!window.GestureEvent)return 50;try{const t=(e=navigator.userAgent)==null?void 0:e.match(/version\/([\d\.]+) safari/i);return parseFloat(t[1])>=17?120:320}catch{return 320}}function m2(e){return{method:"throttle",timeMs:e}}const Ea=m2(h2());function p2(e){return e===null||Array.isArray(e)&&e.length===0}function g2(e,t,n){if(typeof e=="string")n.set(t,e);else{n.delete(t);for(const o of e)n.append(t,o);n.has(t)||n.set(t,"")}return n}function lp(){const e=new Map;return{on(t,n){const o=e.get(t)||[];return o.push(n),e.set(t,o),()=>this.off(t,n)},off(t,n){const o=e.get(t);o&&e.set(t,o.filter(i=>i!==n))},emit(t,n){var o;(o=e.get(t))==null||o.forEach(i=>i(n))}}}function rm(e,t,n){function o(){e(),n.removeEventListener("abort",c)}const i=setTimeout(o,t);function c(){clearTimeout(i),n.removeEventListener("abort",c)}n.addEventListener("abort",c)}function sm(){const e=Promise;if(Promise.hasOwnProperty("withResolvers"))return Promise.withResolvers();let t=()=>{},n=()=>{};return{promise:new e((o,i)=>{t=o,n=i}),resolve:t,reject:n}}function y2(e,t){let n=t;for(let o=e.length-1;o>=0;o--){const i=e[o];if(!i)continue;const c=n;n=()=>i(c)}n()}function om(){return new URLSearchParams(location.search)}var Sw=class{constructor(){M(this,"updateMap",new Map);M(this,"options",{history:"replace",scroll:!1,shallow:!0});M(this,"timeMs",Ea.timeMs);M(this,"transitions",new Set);M(this,"resolvers",null);M(this,"controller",null);M(this,"lastFlushedAt",0);M(this,"resetQueueOnNextPush",!1)}push({key:e,query:t,options:n},o=Ea.timeMs){this.resetQueueOnNextPush&&(this.reset(),this.resetQueueOnNextPush=!1),tt("[nuqs gtq] Enqueueing %s=%s %O",e,t,n),this.updateMap.set(e,t),n.history==="push"&&(this.options.history="push"),n.scroll&&(this.options.scroll=!0),n.shallow===!1&&(this.options.shallow=!1),n.startTransition&&this.transitions.add(n.startTransition),(!Number.isFinite(this.timeMs)||o>this.timeMs)&&(this.timeMs=o)}getQueuedQuery(e){return this.updateMap.get(e)}getPendingPromise({getSearchParamsSnapshot:e=om}){var t;return((t=this.resolvers)==null?void 0:t.promise)??Promise.resolve(e())}flush({getSearchParamsSnapshot:e=om,rateLimitFactor:t=1,...n},o){if(this.controller??(this.controller=new AbortController),!Number.isFinite(this.timeMs))return tt("[nuqs gtq] Skipping flush due to throttleMs=Infinity"),Promise.resolve(e());if(this.resolvers)return this.resolvers.promise;this.resolvers=sm();const i=()=>{this.lastFlushedAt=performance.now();const[l,d]=this.applyPendingUpdates({...n,autoResetQueueOnUpdate:n.autoResetQueueOnUpdate??!0,getSearchParamsSnapshot:e},o);d===null?(this.resolvers.resolve(l),this.resetQueueOnNextPush=!0):this.resolvers.reject(l),this.resolvers=null};return rm(()=>{const l=performance.now()-this.lastFlushedAt,d=this.timeMs,h=t*Math.max(0,d-l);tt("[nuqs gtq] Scheduling flush in %f ms. Throttled at %f ms (x%f)",h,d,t),h===0?i():rm(i,h,this.controller.signal)},0,this.controller.signal),this.resolvers.promise}abort(){var e,t;return(e=this.controller)==null||e.abort(),this.controller=new AbortController,(t=this.resolvers)==null||t.resolve(new URLSearchParams),this.resolvers=null,this.reset()}reset(){const e=Array.from(this.updateMap.keys());return tt("[nuqs gtq] Resetting queue %s",JSON.stringify(Object.fromEntries(this.updateMap))),this.updateMap.clear(),this.transitions.clear(),this.options={history:"replace",scroll:!1,shallow:!0},this.timeMs=Ea.timeMs,e}applyPendingUpdates(e,t){const{updateUrl:n,getSearchParamsSnapshot:o}=e;let i=o();if(tt("[nuqs gtq] Applying %d pending update(s) on top of %s",this.updateMap.size,i.toString()),this.updateMap.size===0)return[i,null];const c=Array.from(this.updateMap.entries()),l={...this.options},d=Array.from(this.transitions);e.autoResetQueueOnUpdate&&this.reset(),tt("[nuqs gtq] Flushing queue %O with options %O",c,l);for(const[h,p]of c)p===null?i.delete(h):i=g2(p,h,i);t&&(i=t(i));try{return y2(d,()=>{n(i,l)}),[i,null]}catch(h){return console.error(Ja(429),c.map(([p])=>p).join(),h),[i,h]}}};const Nu=new Sw;function v2(e,t,n){const o=Y.useCallback(()=>{const c=Object.fromEntries(e.map(l=>[l,n(l)]));return[JSON.stringify(c),c]},[e.join(","),n]),i=Y.useRef(null);return i.current===null&&(i.current=o()),Y.useSyncExternalStore(Y.useCallback(c=>{const l=e.map(d=>t(d,c));return()=>l.forEach(d=>d())},[e.join(","),t]),()=>{const[c,l]=o();return i.current[0]===c?i.current[1]:(i.current=[c,l],l)},()=>i.current[1])}var S2=class{constructor(e){M(this,"callback");M(this,"resolvers",sm());M(this,"controller",new AbortController);M(this,"queuedValue");this.callback=e}abort(){this.controller.abort(),this.queuedValue=void 0}push(e,t){return this.queuedValue=e,this.controller.abort(),this.controller=new AbortController,rm(()=>{const n=this.resolvers;try{tt("[nuqs dq] Flushing debounce queue",e);const o=this.callback(e);tt("[nuqs dq] Reset debounce queue %O",this.queuedValue),this.queuedValue=void 0,this.resolvers=sm(),o.then(i=>n.resolve(i)).catch(i=>n.reject(i))}catch(o){this.queuedValue=void 0,n.reject(o)}},t,this.controller.signal),this.resolvers.promise}},x2=class{constructor(e=new Sw){M(this,"throttleQueue");M(this,"queues",new Map);M(this,"queuedQuerySync",lp());this.throttleQueue=e}useQueuedQueries(e){return v2(e,(t,n)=>this.queuedQuerySync.on(t,n),t=>this.getQueuedQuery(t))}push(e,t,n,o){if(!Number.isFinite(t)){const l=n.getSearchParamsSnapshot??om;return Promise.resolve(l())}const i=e.key;if(!this.queues.has(i)){tt("[nuqs dqc] Creating debounce queue for `%s`",i);const l=new S2(d=>(this.throttleQueue.push(d),this.throttleQueue.flush(n,o).finally(()=>{var h;((h=this.queues.get(d.key))==null?void 0:h.queuedValue)===void 0&&(tt("[nuqs dqc] Cleaning up empty queue for `%s`",d.key),this.queues.delete(d.key)),this.queuedQuerySync.emit(d.key)})));this.queues.set(i,l)}tt("[nuqs dqc] Enqueueing debounce update %O",e);const c=this.queues.get(i).push(e,t);return this.queuedQuerySync.emit(i),c}abort(e){var n;const t=this.queues.get(e);return t?(tt("[nuqs dqc] Aborting debounce queue %s=%s",e,(n=t.queuedValue)==null?void 0:n.query),this.queues.delete(e),t.abort(),this.queuedQuerySync.emit(e),o=>(o.then(t.resolvers.resolve,t.resolvers.reject),o)):o=>o}abortAll(){var e;for(const[t,n]of this.queues.entries())tt("[nuqs dqc] Aborting debounce queue %s=%s",t,(e=n.queuedValue)==null?void 0:e.query),n.abort(),n.resolvers.resolve(new URLSearchParams),this.queuedQuerySync.emit(t);this.queues.clear()}getQueuedQuery(e){var n,o;const t=(o=(n=this.queues.get(e))==null?void 0:n.queuedValue)==null?void 0:o.query;return t!==void 0?t:this.throttleQueue.getQueuedQuery(e)}};const ph=new x2(Nu);function xw(e,t){return e===t?!0:e===null||t===null||typeof e=="string"||typeof t=="string"||e.length!==t.length?!1:e.every((n,o)=>n===t[o])}function Dv(e,t,n){return o=>{if(!(t.length===0||t.some(c=>!xw(o.getAll(c),e.getAll(c)))))return tt("[nuqs `%s`] no change, returning previous",t.join(","),o),o;const i=ww(e,t,n);return tt("[nuqs `%s`] subbed search params change\n from %O\n to %O",t.join(","),o,i),i}}function ww(e,t,n){if(t.length===0)return e;const o=n?new URLSearchParams(e):e;for(const i of e.keys())t.includes(i)||o.delete(i);return o}const w2="__nuqs__",im=lp();function k2(e){return function(n,o){const i=new URL(location.href);i.search=a2(n),tt("[nuqs react] Updating url: %s",i),e&&o.shallow===!1?(o.history==="push"?location.assign:location.replace).call(location,i):(o.history==="push"?history.pushState:history.replaceState).call(history,history.state,w2,i),im.emit("update",n),o.scroll===!0&&window.scrollTo({top:0})}}const kw=Y.createContext({fullPageNavigationOnShallowFalseUpdates:!1});function E2(e){const{fullPageNavigationOnShallowFalseUpdates:t}=Y.useContext(kw),[n,o]=Y.useState(()=>typeof location>"u"?new URLSearchParams:ww(new URLSearchParams(location.search),e,!1));return Y.useEffect(()=>{const i=()=>{o(Dv(new URLSearchParams(location.search),e,!1))},c=l=>{o(Dv(l,e,!0))};return im.on("update",c),window.addEventListener("popstate",i),()=>{im.off("update",c),window.removeEventListener("popstate",i)}},[e.join("&")]),{searchParams:n,updateUrl:Y.useMemo(()=>k2(t),[t])}}const _2=u2(E2);function C2({children:e,fullPageNavigationOnShallowFalseUpdates:t=!1,...n}){return Y.createElement(kw.Provider,{value:{fullPageNavigationOnShallowFalseUpdates:t}},Y.createElement(_2,{...n,children:e}))}const b2="modulepreload",P2=function(e,t){return new URL(e,t).href},jv={},yr=function(t,n,o){let i=Promise.resolve();if(n&&n.length>0){let l=function(y){return Promise.all(y.map(g=>Promise.resolve(g).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const d=document.getElementsByTagName("link"),h=document.querySelector("meta[property=csp-nonce]"),p=(h==null?void 0:h.nonce)||(h==null?void 0:h.getAttribute("nonce"));i=l(n.map(y=>{if(y=P2(y,o),y in jv)return;jv[y]=!0;const g=y.endsWith(".css"),v=g?'[rel="stylesheet"]':"";if(!!o)for(let E=d.length-1;E>=0;E--){const P=d[E];if(P.href===y&&(!g||P.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${v}`))return;const S=document.createElement("link");if(S.rel=g?"stylesheet":b2,g||(S.as="script"),S.crossOrigin="",S.href=y,p&&S.setAttribute("nonce",p),document.head.appendChild(S),g)return new Promise((E,P)=>{S.addEventListener("load",E),S.addEventListener("error",()=>P(new Error(`Unable to preload CSS for ${y}`)))})}))}function c(l){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=l,window.dispatchEvent(d),!d.defaultPrevented)throw l}return i.then(l=>{for(const d of l||[])d.status==="rejected"&&c(d.reason);return t().catch(c)})};var va=typeof window<"u"?Y.useLayoutEffect:Y.useEffect;function gh(e){const t=Y.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function F2(e,t,n={},o={}){Y.useEffect(()=>{if(!e.current||o.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([c])=>{t(c)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,o.disabled,e])}function I2(e){const t=Y.useRef(null);return Y.useImperativeHandle(e,()=>t.current,[]),t}const Ew=!1;function Ra(e){return e[e.length-1]}function R2(e){return typeof e=="function"}function Gs(e,t){return R2(e)?e(t):e}const _w=Object.prototype.hasOwnProperty,$v=Object.prototype.propertyIsEnumerable;function Cw(e){for(const t in e)if(_w.call(e,t))return!0;return!1}const T2=()=>Object.create(null),Hs=(e,t)=>Ys(e,t,T2);function Ys(e,t,n=()=>({}),o=0){if(e===t)return e;if(o>500)return t;const i=t,c=zv(e)&&zv(i);if(!c&&!(Xu(e)&&Xu(i)))return i;const l=c?e:Uv(e);if(!l)return i;const d=c?i:Uv(i);if(!d)return i;const h=l.length,p=d.length,y=c?new Array(p):n();let g=0;for(let v=0;v<p;v++){const w=c?v:d[v],S=e[w],E=i[w];if(S===E){y[w]=S,(c?v<h:_w.call(e,w))&&g++;continue}if(S===null||E===null||typeof S!="object"||typeof E!="object"){y[w]=E;continue}const P=Ys(S,E,n,o+1);y[w]=P,P===S&&g++}return h===p&&g===h?e:y}function Uv(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!$v.call(e,i))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const o=t;for(const i of n){if(!$v.call(e,i))return!1;o.push(i)}return o}function Xu(e){if(!Bv(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!Bv(n)||!n.hasOwnProperty("isPrototypeOf"))}function Bv(e){return Object.prototype.toString.call(e)==="[object Object]"}function zv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function eo(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let o=0,i=e.length;o<i;o++)if(!eo(e[o],t[o],n))return!1;return!0}if(Xu(e)&&Xu(t)){const o=(n==null?void 0:n.ignoreUndefined)??!0;if(n!=null&&n.partial){for(const l in t)if((!o||t[l]!==void 0)&&!eo(e[l],t[l],n))return!1;return!0}let i=0;if(!o)i=Object.keys(e).length;else for(const l in e)e[l]!==void 0&&i++;let c=0;for(const l in t)if((!o||t[l]!==void 0)&&(c++,c>i||!eo(e[l],t[l],n)))return!1;return i===c}return!1}function ci(e){let t,n;const o=new Promise((i,c)=>{t=i,n=c});return o.status="pending",o.resolve=i=>{o.status="resolved",o.value=i,t(i),e==null||e(i)},o.reject=i=>{o.status="rejected",n(i)},o}function Ta(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function A2(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function Vv(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return A2(t)}const M2=["http:","https:","mailto:","tel:"];function Zu(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function fa(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,o="",i;for(;(i=t.exec(e))!==null;)o+=Vv(e.slice(n,i.index))+i[0],n=t.lastIndex;o=o+Vv(n?e.slice(n):e);let c=!1;return o.startsWith("//")&&(c=!0,o="/"+o.replace(/^\/+/,"")),{path:o,handledProtocolRelativeURL:c}}function L2(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function O2(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Br(){throw new Error("Invariant failed")}function Aa(e){const t=new Map;let n,o;const i=c=>{c.next&&(c.prev?(c.prev.next=c.next,c.next.prev=c.prev,c.next=void 0,o&&(o.next=c,c.prev=o)):(c.next.prev=void 0,n=c.next,c.next=void 0,o&&(c.prev=o,o.next=c)),o=c)};return{get(c){const l=t.get(c);if(l)return i(l),l.value},set(c,l){if(t.size>=e&&n){const h=n;t.delete(h.key),h.next&&(n=h.next,h.next.prev=void 0),h===o&&(o=void 0)}const d=t.get(c);if(d)d.value=l,i(d);else{const h={key:c,value:l,prev:o};o&&(o.next=h),o=h,n||(n=h),t.set(c,h)}},clear(){t.clear(),n=void 0,o=void 0}}}const ps=4,bw=5;function N2(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function Pw(e,t,n=new Uint16Array(6)){const o=e.indexOf("/",t),i=o===-1?e.length:o,c=e.substring(t,i);if(!c||!c.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(c==="$"){const d=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=d,n[4]=d,n[5]=d,n}if(c.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;const l=N2(c);if(l){const[d,h]=l,p=c.charCodeAt(d+1);if(p===45){if(d+2<c.length&&c.charCodeAt(d+2)===36){const y=d+3,g=h;if(y<g)return n[0]=3,n[1]=t+d,n[2]=t+y,n[3]=t+g,n[4]=t+h+1,n[5]=i,n}}else if(p===36){const y=d+1,g=d+2;return g===h?(n[0]=2,n[1]=t+d,n[2]=t+y,n[3]=t+g,n[4]=t+h+1,n[5]=e.length,n):(n[0]=1,n[1]=t+d,n[2]=t+g,n[3]=t+h,n[4]=t+h+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function Tl(e,t,n,o,i,c,l){var h,p,y,g,v,w,S,E,P,H;l==null||l(n);let d=o;{const _=n.fullPath??n.from,O=_.length,C=((h=n.options)==null?void 0:h.caseSensitive)??e,D=((y=(p=n.options)==null?void 0:p.params)==null?void 0:y.parse)??((g=n.options)==null?void 0:g.parseParams);for(;d<O;){const L=Pw(_,d,t);let $;const q=d,ee=L[5];switch(d=ee+1,c++,L[0]){case 0:{const se=_.substring(L[2],L[3]);if(C){const K=(v=i.static)==null?void 0:v.get(se);if(K)$=K;else{i.static??(i.static=new Map);const k=Xs(n.fullPath??n.from);k.parent=i,k.depth=c,$=k,i.static.set(se,k)}}else{const K=se.toLowerCase(),k=(w=i.staticInsensitive)==null?void 0:w.get(K);if(k)$=k;else{i.staticInsensitive??(i.staticInsensitive=new Map);const U=Xs(n.fullPath??n.from);U.parent=i,U.depth=c,$=U,i.staticInsensitive.set(K,U)}}break}case 1:{const se=_.substring(q,L[1]),K=_.substring(L[4],ee),k=C&&!!(se||K),U=se?k?se:se.toLowerCase():void 0,V=K?k?K:K.toLowerCase():void 0,J=!D&&((S=i.dynamic)==null?void 0:S.find(B=>!B.parse&&B.caseSensitive===k&&B.prefix===U&&B.suffix===V));if(J)$=J;else{const B=vh(1,n.fullPath??n.from,k,U,V);$=B,B.depth=c,B.parent=i,i.dynamic??(i.dynamic=[]),i.dynamic.push(B)}break}case 3:{const se=_.substring(q,L[1]),K=_.substring(L[4],ee),k=C&&!!(se||K),U=se?k?se:se.toLowerCase():void 0,V=K?k?K:K.toLowerCase():void 0,J=!D&&((E=i.optional)==null?void 0:E.find(B=>!B.parse&&B.caseSensitive===k&&B.prefix===U&&B.suffix===V));if(J)$=J;else{const B=vh(3,n.fullPath??n.from,k,U,V);$=B,B.parent=i,B.depth=c,i.optional??(i.optional=[]),i.optional.push(B)}break}case 2:{const se=_.substring(q,L[1]),K=_.substring(L[4],ee),k=C&&!!(se||K),U=se?k?se:se.toLowerCase():void 0,V=K?k?K:K.toLowerCase():void 0,J=vh(2,n.fullPath??n.from,k,U,V);$=J,J.parent=i,J.depth=c,i.wildcard??(i.wildcard=[]),i.wildcard.push(J)}}i=$}if(D&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const L=Xs(n.fullPath??n.from);L.kind=bw,L.parent=i,c++,L.depth=c,i.pathless??(i.pathless=[]),i.pathless.push(L),i=L}const T=(n.path||!n.children)&&!n.isRoot;if(T&&_.endsWith("/")){const L=Xs(n.fullPath??n.from);L.kind=ps,L.parent=i,c++,L.depth=c,i.index=L,i=L}i.parse=D??null,i.priority=((H=(P=n.options)==null?void 0:P.params)==null?void 0:H.priority)??0,T&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const _ of n.children)Tl(e,t,_,d,i,c,l)}function yh(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function ms(e){var t,n,o;if(e.pathless)for(const i of e.pathless)ms(i);if(e.static)for(const i of e.static.values())ms(i);if(e.staticInsensitive)for(const i of e.staticInsensitive.values())ms(i);if((t=e.dynamic)!=null&&t.length){e.dynamic.sort(yh);for(const i of e.dynamic)ms(i)}if((n=e.optional)!=null&&n.length){e.optional.sort(yh);for(const i of e.optional)ms(i)}if((o=e.wildcard)!=null&&o.length){e.wildcard.sort(yh);for(const i of e.wildcard)ms(i)}}function Xs(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function vh(e,t,n,o,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:o,suffix:i}}function D2(e,t){const n=Xs("/"),o=new Uint16Array(6);for(const i of e)Tl(!1,o,i,1,n,0);ms(n),t.masksTree=n,t.flatCache=Aa(1e3)}function j2(e,t){e||(e="/");const n=t.flatCache.get(e);if(n)return n;const o=fp(e,t.masksTree);return t.flatCache.set(e,o),o}function $2(e,t,n,o,i){e||(e="/"),o||(o="/");const c=t?`case\0${e}`:e;let l=i.singleCache.get(c);return l||(l=Xs("/"),Tl(t,new Uint16Array(6),{from:e},1,l,0),i.singleCache.set(c,l)),fp(o,l,n)}function U2(e,t,n=!1){const o=n?e:`nofuzz\0${e}`,i=t.matchCache.get(o);if(i!==void 0)return i;e||(e="/");let c;try{c=fp(e,t.segmentTree,n)}catch(l){if(l instanceof URIError)c=null;else throw l}return c&&(c.branch=Iw(c.route)),t.matchCache.set(o,c),c}function B2(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function z2(e,t=!1,n){const o=Xs(e.fullPath),i=new Uint16Array(6),c={},l={};let d=0;return Tl(t,i,e,1,o,0,h=>{if(n==null||n(h,d),h.id in c&&Br(),c[h.id]=h,d!==0&&h.path){const p=B2(h.fullPath);(!l[p]||h.fullPath.endsWith("/"))&&(l[p]=h)}d++}),ms(o),{processedTree:{segmentTree:o,singleCache:Aa(1e3),matchCache:Aa(1e3),flatCache:null,masksTree:null},routesById:c,routesByPath:l}}function fp(e,t,n=!1){const o=e.split("/"),i=q2(e,o,t,n);if(!i)return null;const[c]=Fw(e,o,i);return{route:i.node.route,rawParams:c}}function Fw(e,t,n){var y,g,v,w,S,E,P,H,_,O;const o=V2(n.node);let i=null;const c=Object.create(null);let l=((y=n.extract)==null?void 0:y.part)??0,d=((g=n.extract)==null?void 0:g.node)??0,h=((v=n.extract)==null?void 0:v.path)??0,p=((w=n.extract)==null?void 0:w.segment)??0;for(;d<o.length;l++,d++,h++,p++){const C=o[d];if(C.kind===ps)break;if(C.kind===bw){p--,l--,h--;continue}const D=t[l],T=h;if(D&&(h+=D.length),C.kind===1){i??(i=n.node.fullPath.split("/"));const L=i[p],$=((S=C.prefix)==null?void 0:S.length)??0;if(L.charCodeAt($)===123){const q=((E=C.suffix)==null?void 0:E.length)??0,ee=L.substring($+2,L.length-q-1),se=D.substring($,D.length-q);c[ee]=decodeURIComponent(se)}else{const q=L.substring(1);c[q]=decodeURIComponent(D)}}else if(C.kind===3){if(n.skipped&1<<d){l--,h=T-1;continue}i??(i=n.node.fullPath.split("/"));const L=i[p],$=((P=C.prefix)==null?void 0:P.length)??0,q=((H=C.suffix)==null?void 0:H.length)??0,ee=L.substring($+3,L.length-q-1),se=C.suffix||C.prefix?D.substring($,D.length-q):D;se&&(c[ee]=decodeURIComponent(se))}else if(C.kind===2){const L=C,$=e.substring(T+(((_=L.prefix)==null?void 0:_.length)??0),e.length-(((O=L.suffix)==null?void 0:O.length)??0)),q=decodeURIComponent($);c["*"]=q,c._splat=q;break}}return n.rawParams&&Object.assign(c,n.rawParams),[c,{part:l,node:d,path:h,segment:p}]}function Iw(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function V2(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function q2(e,t,n,o){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!Ra(t),c=i&&e!=="/",l=t.length-(i?1:0),d=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}];let h=null,p=null;for(;d.length;){const y=d.pop(),{node:g,index:v,skipped:w,depth:S,statics:E,dynamics:P,optionals:H}=y;let{extract:_,rawParams:O}=y;if(g.kind===2&&g.route&&!Cu(p,y))continue;if(g.parse){if(!qv(e,t,y))continue;O=y.rawParams,_=y.extract}o&&g.route&&g.kind!==ps&&Cu(h,y)&&(h=y);const C=v===l;if(C&&(g.route&&(!c||g.kind===ps||g.kind===2)&&Cu(p,y)&&(p=y),!g.optional&&!g.wildcard&&!g.index&&!g.pathless))continue;const D=C?void 0:t[v];let T;if(C&&g.index){const L={node:g.index,index:v,skipped:w,depth:S+1,statics:E,dynamics:P,optionals:H,extract:_,rawParams:O};let $=!0;if(g.index.parse&&(qv(e,t,L)||($=!1)),$){if(!P&&!H&&!w&&W2(E,l))return L;Cu(p,L)&&(p=L)}}if(g.wildcard)for(let L=g.wildcard.length-1;L>=0;L--){const $=g.wildcard[L],{prefix:q,suffix:ee}=$;if(!(q&&(C||!($.caseSensitive?D:T??(T=D.toLowerCase())).startsWith(q)))){if(ee){if(C)continue;const se=t.slice(v).join("/").slice(-ee.length);if(($.caseSensitive?se:se.toLowerCase())!==ee)continue}d.push({node:$,index:l,skipped:w,depth:S+1,statics:E,dynamics:P,optionals:H,extract:_,rawParams:O})}}if(g.optional){const L=w|1<<S,$=S+1;for(let q=g.optional.length-1;q>=0;q--){const ee=g.optional[q];d.push({node:ee,index:v,skipped:L,depth:$,statics:E,dynamics:P,optionals:H,extract:_,rawParams:O})}if(!C)for(let q=g.optional.length-1;q>=0;q--){const ee=g.optional[q],{prefix:se,suffix:K}=ee;if(se||K){const k=ee.caseSensitive?D:T??(T=D.toLowerCase());if(se&&!k.startsWith(se)||K&&!k.endsWith(K))continue}d.push({node:ee,index:v+1,skipped:w,depth:$,statics:E,dynamics:P,optionals:H+_u(l,v),extract:_,rawParams:O})}}if(!C&&g.dynamic&&D)for(let L=g.dynamic.length-1;L>=0;L--){const $=g.dynamic[L],{prefix:q,suffix:ee}=$;if(q||ee){const se=$.caseSensitive?D:T??(T=D.toLowerCase());if(q&&!se.startsWith(q)||ee&&!se.endsWith(ee))continue}d.push({node:$,index:v+1,skipped:w,depth:S+1,statics:E,dynamics:P+_u(l,v),optionals:H,extract:_,rawParams:O})}if(!C&&g.staticInsensitive){const L=g.staticInsensitive.get(T??(T=D.toLowerCase()));L&&d.push({node:L,index:v+1,skipped:w,depth:S+1,statics:E+_u(l,v),dynamics:P,optionals:H,extract:_,rawParams:O})}if(!C&&g.static){const L=g.static.get(D);L&&d.push({node:L,index:v+1,skipped:w,depth:S+1,statics:E+_u(l,v),dynamics:P,optionals:H,extract:_,rawParams:O})}if(g.pathless){const L=S+1;for(let $=g.pathless.length-1;$>=0;$--){const q=g.pathless[$];d.push({node:q,index:v,skipped:w,depth:L,statics:E,dynamics:P,optionals:H,extract:_,rawParams:O})}}}if(p)return p;if(o&&h){let y=h.index;for(let v=0;v<h.index;v++)y+=t[v].length;const g=y===e.length?"/":e.slice(y);return h.rawParams??(h.rawParams=Object.create(null)),h.rawParams["**"]=decodeURIComponent(g),h}return null}function _u(e,t){return 2**(e-t-1)}function W2(e,t){return e===2**(t-1)-1}function qv(e,t,n){let o,i;try{[o,i]=Fw(e,t,n)}catch{return null}if(n.rawParams=o,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(o)===!1)return null}catch{}return!0}function Cu(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===ps)>(e.node.kind===ps)||t.node.kind===ps==(e.node.kind===ps)&&t.depth>e.depth))):!0}function Du(e){return dp(e.filter(t=>t!==void 0).join("/"))}function dp(e){return e.replace(/\/{2,}/g,"/")}function Rw(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function $r(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function Tw(e){return $r(Rw(e))}function el(e,t){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function H2(e,t,n){return el(e,n)===el(t,n)}function K2({base:e,to:t,trailingSlash:n="never",cache:o}){const i=t.startsWith("/"),c=!i&&t===".";let l;if(o){l=i?t:c?e:e+"\0"+t;const p=o.get(l);if(p)return p}let d;if(c)d=e.split("/");else if(i)d=t.split("/");else{for(d=e.split("/");d.length>1&&Ra(d)==="";)d.pop();const p=t.split("/");for(let y=0,g=p.length;y<g;y++){const v=p[y];v===""?y?y===g-1&&d.push(v):d=[v]:v===".."?d.pop():v==="."||d.push(v)}}d.length>1&&(Ra(d)===""?n==="never"&&d.pop():n==="always"&&d.push(""));const h=dp(d.join("/"))||"/";return l&&o&&o.set(l,h),h}function Q2(e){const t=new Map(e.map(i=>[encodeURIComponent(i),i])),n=Array.from(t.keys()).map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),o=new RegExp(n,"g");return i=>i.replace(o,c=>t.get(c)??c)}function Sh(e,t,n){const o=t[e];return typeof o!="string"?o:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(o)?o:o.split("/").map(i=>Hv(i,n)).join("/"):Hv(o,n)}function Wv({path:e,params:t,decoder:n,...o}){let i=!1;const c=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:c,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:c,isMissingParams:i};const l=e.length;let d=0,h,p="";for(;d<l;){const y=d;h=Pw(e,y,h);const g=h[5];if(d=g+1,y===g)continue;const v=h[0];if(v===0){p+="/"+e.substring(y,g);continue}if(v===2){const w=t._splat;c._splat=w,c["*"]=w;const S=e.substring(y,h[1]),E=e.substring(h[4],g);if(!w){i=!0,(S||E)&&(p+="/"+S+E);continue}const P=Sh("_splat",t,n);p+="/"+S+P+E;continue}if(v===1){const w=e.substring(h[2],h[3]);!i&&!(w in t)&&(i=!0),c[w]=t[w];const S=e.substring(y,h[1]),E=e.substring(h[4],g),P=Sh(w,t,n)??"undefined";p+="/"+S+P+E;continue}if(v===3){const w=e.substring(h[2],h[3]),S=t[w];if(S==null)continue;c[w]=S;const E=e.substring(y,h[1]),P=e.substring(h[4],g),H=Sh(w,t,n)??"";p+="/"+E+H+P;continue}}return e.endsWith("/")&&(p+="/"),{usedParams:c,interpolatedPath:p||"/",isMissingParams:i}}function Hv(e,t){const n=encodeURIComponent(e);return(t==null?void 0:t(n))??n}function Ht(e){return(e==null?void 0:e.isNotFound)===!0}function J2(e,t=String){const n=new URLSearchParams;for(const o in e){const i=e[o];i!==void 0&&n.set(o,t(i))}return n.toString()}function xh(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function G2(e){const t=new URLSearchParams(e),n=Object.create(null);for(const[o,i]of t.entries()){const c=n[o];c==null?n[o]=xh(i):Array.isArray(c)?c.push(xh(i)):n[o]=[c,xh(i)]}return n}const Y2=Z2(JSON.parse),X2=eP(JSON.stringify,JSON.parse);function Z2(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=G2(t);for(const o in n){const i=n[o];if(typeof i=="string")try{n[o]=e(i)}catch{}}return n}}function eP(e,t){const n=typeof t=="function";function o(i){if(typeof i=="object"&&i!==null)try{return e(i)}catch{}else if(n&&typeof i=="string")try{return t(i),e(i)}catch{}return i}return i=>{const c=J2(i,o);return c?`?${c}`:""}}const to="__root__";function tP(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function mn(e){return e instanceof Response&&!!e.options}const am=e=>{var t;if(!e.rendered)return e.rendered=!0,(t=e.onReady)==null?void 0:t.call(e)},nP=e=>e.stores.matchesId.get().some(t=>{var n;return(n=e.stores.matchStores.get(t))==null?void 0:n.get()._forcePending}),Al=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),no=(e,t,n=!0)=>{const o={...e.router.options.context??{}},i=n?t:t-1;for(let c=0;c<=i;c++){const l=e.matches[c];if(!l)continue;const d=e.router.getMatch(l.id);d&&Object.assign(o,d.__routeContext,d.__beforeLoadContext)}return o},Kv=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,o=e.matches.findIndex(l=>l.routeId===e.router.routeTree.id),i=o>=0?o:0;let c=n?e.matches.findIndex(l=>l.routeId===n):e.firstBadMatchIndex??e.matches.length-1;c<0&&(c=i);for(let l=c;l>=0;l--){const d=e.matches[l];if(e.router.looseRoutesById[d.routeId].options.notFoundComponent)return l}return n?c:i},gs=(e,t,n)=>{var o,i,c;if(!(!mn(n)&&!Ht(n)))throw mn(n)&&n.redirectHandled&&!n.options.reloadDocument||(t&&((o=t._nonReactive.beforeLoadPromise)==null||o.resolve(),(i=t._nonReactive.loaderPromise)==null||i.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,l=>({...l,status:mn(n)?"redirected":Ht(n)?"notFound":l.status==="pending"?"success":l.status,context:no(e,t.index),isFetching:!1,error:n})),Ht(n)&&!n.routeId&&(n.routeId=t.routeId),(c=t._nonReactive.loadPromise)==null||c.resolve()),mn(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},Aw=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Qv=(e,t,n)=>{const o=no(e,n);e.updateMatch(t,i=>({...i,context:o}))},da=(e,t,n)=>{var l,d;const{id:o,routeId:i}=e.matches[t],c=e.router.looseRoutesById[i];if(n instanceof Promise)throw n;e.firstBadMatchIndex??(e.firstBadMatchIndex=t),gs(e,e.router.getMatch(o),n);try{(d=(l=c.options).onError)==null||d.call(l,n)}catch(h){n=h,gs(e,e.router.getMatch(o),n)}e.updateMatch(o,h=>{var p,y;return(p=h._nonReactive.beforeLoadPromise)==null||p.resolve(),h._nonReactive.beforeLoadPromise=void 0,(y=h._nonReactive.loadPromise)==null||y.resolve(),{...h,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}}),!e.preload&&!mn(n)&&!Ht(n)&&(e.serialError??(e.serialError=n))},Mw=(e,t,n,o)=>{var c;if(o._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Al(e,t)&&(n.options.loader||n.options.beforeLoad||Ow(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??((c=e.router.options)==null?void 0:c.defaultPendingComponent))){const l=setTimeout(()=>{am(e)},i);o._nonReactive.pendingTimeout=l}},rP=(e,t,n)=>{const o=e.router.getMatch(t);if(!o._nonReactive.beforeLoadPromise&&!o._nonReactive.loaderPromise)return;Mw(e,t,n,o);const i=()=>{const c=e.router.getMatch(t);c.preload&&(c.status==="redirected"||c.status==="notFound")&&gs(e,c,c.error)};return o._nonReactive.beforeLoadPromise?o._nonReactive.beforeLoadPromise.then(i):i()},sP=(e,t,n,o)=>{const i=e.router.getMatch(t);let c=i._nonReactive.loadPromise;i._nonReactive.loadPromise=ci(()=>{c==null||c.resolve(),c=void 0});const{paramsError:l,searchError:d}=i;l&&da(e,n,l),d&&da(e,n,d),Mw(e,t,o,i);const h=new AbortController;let p=!1;const y=()=>{p||(p=!0,e.updateMatch(t,C=>({...C,isFetching:"beforeLoad",fetchCount:C.fetchCount+1,abortController:h})))},g=()=>{var C;(C=i._nonReactive.beforeLoadPromise)==null||C.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,D=>({...D,isFetching:!1}))};if(!o.options.beforeLoad){e.router.batch(()=>{y(),g()});return}i._nonReactive.beforeLoadPromise=ci();const v={...no(e,n,!1),...i.__routeContext},{search:w,params:S,cause:E}=i,P=Al(e,t),H={search:w,abortController:h,params:S,preload:P,context:v,location:e.location,navigate:C=>e.router.navigate({...C,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:P?"preload":E,matches:e.matches,routeId:o.id,...e.router.options.additionalContext},_=C=>{if(C===void 0){e.router.batch(()=>{y(),g()});return}(mn(C)||Ht(C))&&(y(),da(e,n,C)),e.router.batch(()=>{y(),e.updateMatch(t,D=>({...D,__beforeLoadContext:C})),g()})};let O;try{if(O=o.options.beforeLoad(H),Ta(O))return y(),O.catch(C=>{da(e,n,C)}).then(_)}catch(C){y(),da(e,n,C)}_(O)},oP=(e,t)=>{const{id:n,routeId:o}=e.matches[t],i=e.router.looseRoutesById[o],c=()=>d(),l=()=>sP(e,n,t,i),d=()=>{if(Aw(e,n))return;const h=rP(e,n,i);return Ta(h)?h.then(l):l()};return c()},iP=(e,t,n)=>{var c,l,d,h,p,y;const o=e.router.getMatch(t);if(!o||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const i={ssr:e.router.options.ssr,matches:e.matches,match:o,params:o.params,loaderData:o.loaderData};return Promise.all([(l=(c=n.options).head)==null?void 0:l.call(c,i),(h=(d=n.options).scripts)==null?void 0:h.call(d,i),(y=(p=n.options).headers)==null?void 0:y.call(p,i)]).then(([g,v,w])=>({meta:g==null?void 0:g.meta,links:g==null?void 0:g.links,headScripts:g==null?void 0:g.scripts,headers:w,scripts:v,styles:g==null?void 0:g.styles}))},Lw=(e,t,n,o,i)=>{const c=t[o-1],{params:l,loaderDeps:d,abortController:h,cause:p}=e.router.getMatch(n),y=no(e,o),g=Al(e,n);return{params:l,deps:d,preload:!!g,parentMatchPromise:c,abortController:h,context:y,location:e.location,navigate:v=>e.router.navigate({...v,_fromLocation:e.location}),cause:g?"preload":p,route:i,...e.router.options.additionalContext}},Jv=async(e,t,n,o,i)=>{var c,l,d,h,p;try{const y=e.router.getMatch(n);try{(!(Ew??e.router.isServer)||y.ssr===!0)&&Ma(i);const g=i.options.loader,v=typeof g=="function"?g:g==null?void 0:g.handler,w=v==null?void 0:v(Lw(e,t,n,o,i)),S=!!v&&Ta(w);if((S||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||y._nonReactive.minPendingPromise)&&e.updateMatch(n,P=>({...P,isFetching:"loader"})),v){const P=S?await w:w;gs(e,e.router.getMatch(n),P),P!==void 0&&e.updateMatch(n,H=>({...H,loaderData:P}))}i._lazyPromise&&await i._lazyPromise;const E=y._nonReactive.minPendingPromise;E&&await E,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,P=>({...P,error:void 0,context:no(e,o),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(g){let v=g;if((v==null?void 0:v.name)==="AbortError"){if(y.abortController.signal.aborted){(c=y._nonReactive.loaderPromise)==null||c.resolve(),y._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,S=>({...S,status:S.status==="pending"?"success":S.status,isFetching:!1,context:no(e,o)}));return}const w=y._nonReactive.minPendingPromise;w&&await w,Ht(g)&&await((d=(l=i.options.notFoundComponent)==null?void 0:l.preload)==null?void 0:d.call(l)),gs(e,e.router.getMatch(n),g);try{(p=(h=i.options).onError)==null||p.call(h,g)}catch(S){v=S,gs(e,e.router.getMatch(n),S)}!mn(v)&&!Ht(v)&&await Ma(i,["errorComponent"]),e.updateMatch(n,S=>({...S,error:v,context:no(e,o),status:"error",isFetching:!1}))}}catch(y){const g=e.router.getMatch(n);g&&(g._nonReactive.loaderPromise=void 0),gs(e,g,y)}},aP=async(e,t,n)=>{var w,S,E,P;async function o(H,_,O,C,D){const T=Date.now()-_.updatedAt,L=H?D.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:D.options.staleTime??e.router.options.defaultStaleTime??0,$=D.options.shouldReload,q=typeof $=="function"?$(Lw(e,t,i,n,D)):$,{status:ee,invalid:se}=C,K=T>=L&&(!!e.forceStaleReload||C.cause==="enter"||O!==void 0&&O!==C.id);l=ee==="success"&&(se||(q??K)),H&&D.options.preload===!1||(l&&!e.sync&&y?(d=!0,(async()=>{var k,U;try{await Jv(e,t,i,n,D);const V=e.router.getMatch(i);(k=V._nonReactive.loaderPromise)==null||k.resolve(),(U=V._nonReactive.loadPromise)==null||U.resolve(),V._nonReactive.loaderPromise=void 0,V._nonReactive.loadPromise=void 0}catch(V){mn(V)&&await e.router.navigate(V.options)}})()):ee!=="success"||l?await Jv(e,t,i,n,D):Qv(e,i,n))}const{id:i,routeId:c}=e.matches[n];let l=!1,d=!1;const h=e.router.looseRoutesById[c],p=h.options.loader,y=((typeof p=="function"||p==null?void 0:p.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(Aw(e,i)){if(!e.router.getMatch(i))return e.matches[n];Qv(e,i,n)}else{const H=e.router.getMatch(i),_=e.router.stores.matchesId.get()[n],O=((w=_&&e.router.stores.matchStores.get(_)||null)==null?void 0:w.routeId)===c?_:(S=e.router.stores.matches.get().find(D=>D.routeId===c))==null?void 0:S.id,C=Al(e,i);if(H._nonReactive.loaderPromise){if(H.status==="success"&&!e.sync&&!H.preload&&y)return H;await H._nonReactive.loaderPromise;const D=e.router.getMatch(i),T=D._nonReactive.error||D.error;T&&gs(e,D,T),D.status==="pending"&&await o(C,H,O,D,h)}else{const D=C&&!e.router.stores.matchStores.has(i),T=e.router.getMatch(i);T._nonReactive.loaderPromise=ci(),D!==T.preload&&e.updateMatch(i,L=>({...L,preload:D})),await o(C,H,O,T,h)}}const g=e.router.getMatch(i);d||((E=g._nonReactive.loaderPromise)==null||E.resolve(),(P=g._nonReactive.loadPromise)==null||P.resolve(),g._nonReactive.loadPromise=void 0),clearTimeout(g._nonReactive.pendingTimeout),g._nonReactive.pendingTimeout=void 0,d||(g._nonReactive.loaderPromise=void 0),g._nonReactive.dehydrated=void 0;const v=d?g.isFetching:!1;return v!==g.isFetching||g.invalid!==!1?(e.updateMatch(i,H=>({...H,isFetching:v,invalid:!1})),e.router.getMatch(i)):g};async function Gv(e){var v,w;const t=e,n=[];nP(t.router)&&am(t);let o;for(let S=0;S<t.matches.length;S++){try{const E=oP(t,S);Ta(E)&&await E}catch(E){if(mn(E))throw E;if(Ht(E))o=E;else if(!t.preload)throw E;break}if(t.serialError||t.firstBadMatchIndex!=null)break}const i=t.firstBadMatchIndex??t.matches.length,c=o&&!t.preload?Kv(t,o):void 0,l=o&&t.preload?0:c!==void 0?Math.min(c+1,i):i;let d,h;for(let S=0;S<l;S++)n.push(aP(t,n,S));try{await Promise.all(n)}catch{const S=await Promise.allSettled(n);for(const E of S){if(E.status!=="rejected")continue;const P=E.reason;if(mn(P))throw P;Ht(P)?d??(d=P):h??(h=P)}if(h!==void 0)throw h}const p=d??(o&&!t.preload?o:void 0);let y=t.firstBadMatchIndex!==void 0?t.firstBadMatchIndex:t.matches.length-1;if(!p&&o&&t.preload)return t.matches;if(p){const S=Kv(t,p);S===void 0&&Br();const E=t.matches[S],P=t.router.looseRoutesById[E.routeId],H=(v=t.router.options)==null?void 0:v.defaultNotFoundComponent;!P.options.notFoundComponent&&H&&(P.options.notFoundComponent=H),p.routeId=E.routeId;const _=E.routeId===t.router.routeTree.id;t.updateMatch(E.id,O=>({...O,..._?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:p},isFetching:!1})),y=S,await Ma(P,["notFoundComponent"])}else if(!t.preload){const S=t.matches[0];S.globalNotFound||(w=t.router.getMatch(S.id))!=null&&w.globalNotFound&&t.updateMatch(S.id,E=>({...E,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const S=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Ma(S,["errorComponent"])}for(let S=0;S<=y;S++){const{id:E,routeId:P}=t.matches[S],H=t.router.looseRoutesById[P];try{const _=iP(t,E,H);if(_){const O=await _;t.updateMatch(E,C=>({...C,...O}))}}catch(_){console.error(`Error executing head for route ${P}:`,_)}}const g=am(t);if(Ta(g)&&await g,p)throw p;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function Yv(e,t){const n=t.map(o=>{var i,c;return(c=(i=e.options[o])==null?void 0:i.preload)==null?void 0:c.call(i)}).filter(Boolean);if(n.length!==0)return Promise.all(n)}function Ma(e,t=ju){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(o=>{const{id:i,...c}=o.options;Object.assign(e.options,c),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const n=()=>e._componentsLoaded?void 0:t===ju?(()=>{if(e._componentsPromise===void 0){const o=Yv(e,ju);o?e._componentsPromise=o.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Yv(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function Ow(e){var t;for(const n of ju)if((t=e.options[n])!=null&&t.preload)return!0;return!1}const ju=["component","errorComponent","pendingComponent","notFoundComponent"];function cP(e){return{input:({url:t})=>{for(const n of e)t=cm(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Nw(e[n],t);return t}}}function uP(e){const t=Tw(e.basepath),n=`/${t}`,o=e.caseSensitive?n:n.toLowerCase(),i=`${o}/`;return{input:({url:c})=>{const l=e.caseSensitive?c.pathname:c.pathname.toLowerCase();return l===o?c.pathname="/":l.startsWith(i)&&(c.pathname=c.pathname.slice(n.length)),c},output:({url:c})=>(c.pathname=Du(["/",t,c.pathname]),c)}}function cm(e,t){var o;const n=(o=e==null?void 0:e.input)==null?void 0:o.call(e,{url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function Nw(e,t){var o;const n=(o=e==null?void 0:e.output)==null?void 0:o.call(e,{url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function lP(e,t){const{createMutableStore:n,createReadonlyStore:o,batch:i,init:c}=t,l=new Map,d=new Map,h=new Map,p=n(e.status),y=n(e.loadedAt),g=n(e.isLoading),v=n(e.isTransitioning),w=n(e.location),S=n(e.resolvedLocation),E=n(e.statusCode),P=n(e.redirect),H=n([]),_=n([]),O=n([]),C=o(()=>wh(l,H.get())),D=o(()=>wh(d,_.get())),T=o(()=>wh(h,O.get())),L=o(()=>H.get()[0]),$=o(()=>H.get().some(B=>{var X;return((X=l.get(B))==null?void 0:X.get().status)==="pending"})),q=o(()=>{var B;return{locationHref:w.get().href,resolvedLocationHref:(B=S.get())==null?void 0:B.href,status:p.get()}}),ee=o(()=>({status:p.get(),loadedAt:y.get(),isLoading:g.get(),isTransitioning:v.get(),matches:C.get(),location:w.get(),resolvedLocation:S.get(),statusCode:E.get(),redirect:P.get()})),se=Aa(64);function K(B){let X=se.get(B);return X||(X=o(()=>{const ne=H.get();for(const te of ne){const I=l.get(te);if(I&&I.routeId===B)return I.get()}}),se.set(B,X)),X}const k={status:p,loadedAt:y,isLoading:g,isTransitioning:v,location:w,resolvedLocation:S,statusCode:E,redirect:P,matchesId:H,pendingIds:_,cachedIds:O,matches:C,pendingMatches:D,cachedMatches:T,firstId:L,hasPending:$,matchRouteDeps:q,matchStores:l,pendingMatchStores:d,cachedMatchStores:h,__store:ee,getRouteMatchStore:K,setMatches:U,setPending:V,setCached:J};U(e.matches),c==null||c(k);function U(B){kh(B,l,H,n,i)}function V(B){kh(B,d,_,n,i)}function J(B){kh(B,h,O,n,i)}return k}function wh(e,t){const n=[];for(const o of t){const i=e.get(o);i&&n.push(i.get())}return n}function kh(e,t,n,o,i){const c=e.map(d=>d.id),l=new Set(c);i(()=>{for(const d of t.keys())l.has(d)||t.delete(d);for(const d of e){const h=t.get(d.id);if(!h){const p=o(d);p.routeId=d.routeId,t.set(d.id,p);continue}h.routeId=d.routeId,h.get()!==d&&h.set(d)}O2(n.get(),c)||n.set(c)})}var vs="__TSR_index",Xv="popstate",Zv="beforeunload";function fP(e){let t=e.getLocation();const n=new Set,o=l=>{t=e.getLocation(),n.forEach(d=>d({location:t,action:l}))},i=l=>{e.notifyOnIndexChange??!0?o(l):t=e.getLocation()},c=async({task:l,navigateOpts:d,...h})=>{var g,v;if((d==null?void 0:d.ignoreBlocker)??!1){l();return}const p=((g=e.getBlockers)==null?void 0:g.call(e))??[],y=h.type==="PUSH"||h.type==="REPLACE";if(typeof document<"u"&&p.length&&y)for(const w of p){const S=La(h.path,h.state);if(await w.blockerFn({currentLocation:t,nextLocation:S,action:h.type})){(v=e.onBlocked)==null||v.call(e);return}}l()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:l=>(n.add(l),()=>{n.delete(l)}),push:(l,d,h)=>{const p=t.state[vs];d=eS(p+1,d),c({task:()=>{e.pushState(l,d),o({type:"PUSH"})},navigateOpts:h,type:"PUSH",path:l,state:d})},replace:(l,d,h)=>{const p=t.state[vs];d=eS(p,d),c({task:()=>{e.replaceState(l,d),o({type:"REPLACE"})},navigateOpts:h,type:"REPLACE",path:l,state:d})},go:(l,d)=>{c({task:()=>{e.go(l),i({type:"GO",index:l})},navigateOpts:d,type:"GO"})},back:l=>{c({task:()=>{e.back((l==null?void 0:l.ignoreBlocker)??!1),i({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{c({task:()=>{e.forward((l==null?void 0:l.ignoreBlocker)??!1),i({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>t.state[vs]!==0,createHref:l=>e.createHref(l),block:l=>{var h;if(!e.setBlockers)return()=>{};const d=((h=e.getBlockers)==null?void 0:h.call(e))??[];return e.setBlockers([...d,l]),()=>{var y,g;const p=((y=e.getBlockers)==null?void 0:y.call(e))??[];(g=e.setBlockers)==null||g.call(e,p.filter(v=>v!==l))}},flush:()=>{var l;return(l=e.flush)==null?void 0:l.call(e)},destroy:()=>{var l;return(l=e.destroy)==null?void 0:l.call(e)},notify:o}}function eS(e,t){t||(t={});const n=hp();return{...t,key:n,__TSR_key:n,[vs]:e}}function Dw(e){var $,q;const t=(e==null?void 0:e.window)??(typeof document<"u"?window:void 0),n=t.history.pushState,o=t.history.replaceState;let i=[];const c=()=>i,l=ee=>i=ee,d=(e==null?void 0:e.createHref)??(ee=>ee),h=(e==null?void 0:e.parseLocation)??(()=>La(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!(($=t.history.state)!=null&&$.__TSR_key)&&!((q=t.history.state)!=null&&q.key)){const ee=hp();t.history.replaceState({[vs]:0,key:ee,__TSR_key:ee},"")}let p=h(),y,g=!1,v=!1,w=!1,S=!1;const E=()=>p;let P,H;const _=()=>{P&&(L._ignoreSubscribers=!0,(P.isPush?t.history.pushState:t.history.replaceState)(P.state,"",P.href),L._ignoreSubscribers=!1,P=void 0,H=void 0,y=void 0)},O=(ee,se,K)=>{const k=d(se);H||(y=p),p=La(se,K),P={href:k,state:K,isPush:(P==null?void 0:P.isPush)||ee==="push"},H||(H=Promise.resolve().then(()=>_()))},C=ee=>{p=h(),L.notify({type:ee})},D=async()=>{if(v){v=!1;return}const ee=h(),se=ee.state[vs]-p.state[vs],K=se===1,k=se===-1,U=!K&&!k||g;g=!1;const V=U?"GO":k?"BACK":"FORWARD",J=U?{type:"GO",index:se}:{type:k?"BACK":"FORWARD"};if(w)w=!1;else{const B=c();if(typeof document<"u"&&B.length){for(const X of B)if(await X.blockerFn({currentLocation:p,nextLocation:ee,action:V})){v=!0,t.history.go(1),L.notify(J);return}}}p=h(),L.notify(J)},T=ee=>{if(S){S=!1;return}let se=!1;const K=c();if(typeof document<"u"&&K.length)for(const k of K){const U=k.enableBeforeUnload??!0;if(U===!0){se=!0;break}if(typeof U=="function"&&U()===!0){se=!0;break}}if(se)return ee.preventDefault(),ee.returnValue=""},L=fP({getLocation:E,getLength:()=>t.history.length,pushState:(ee,se)=>O("push",ee,se),replaceState:(ee,se)=>O("replace",ee,se),back:ee=>(ee&&(w=!0),S=!0,t.history.back()),forward:ee=>{ee&&(w=!0),S=!0,t.history.forward()},go:ee=>{g=!0,t.history.go(ee)},createHref:ee=>d(ee),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=o,t.removeEventListener(Zv,T,{capture:!0}),t.removeEventListener(Xv,D)},onBlocked:()=>{y&&p!==y&&(p=y)},getBlockers:c,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(Zv,T,{capture:!0}),t.addEventListener(Xv,D),t.history.pushState=function(...ee){const se=n.apply(t.history,ee);return L._ignoreSubscribers||C("PUSH"),se},t.history.replaceState=function(...ee){const se=o.apply(t.history,ee);return L._ignoreSubscribers||C("REPLACE"),se},L}function dP(e){const t=typeof document<"u"?window:void 0;return Dw({window:t,parseLocation:()=>{const n=t.location.hash.split("#").slice(1),o=n[0]??"/",i=t.location.search,c=n.slice(1);return La(`${o}${i}${c.length===0?"":`#${c.join("#")}`}`,t.history.state)},createHref:n=>`${t.location.pathname}${t.location.search}#${n}`})}function hP(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function La(e,t){const n=hP(e),o=n.indexOf("#"),i=n.indexOf("?"),c=hp();return{href:n,pathname:n.substring(0,o>0?i>0?Math.min(o,i):o:i>0?i:n.length),hash:o>-1?n.substring(o):"",search:i>-1?n.slice(i,o===-1?void 0:o):"",state:t||{[vs]:0,key:c,__TSR_key:c}}}function hp(){return(Math.random()+1).toString(36).substring(7)}function ri(e,t){const n=t,o=e;return{fromLocation:n,toLocation:o,pathChanged:(n==null?void 0:n.pathname)!==o.pathname,hrefChanged:(n==null?void 0:n.href)!==o.href,hashChanged:(n==null?void 0:n.hash)!==o.hash}}const um=new WeakMap;var mP=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.startTransition=n=>n(),this.update=n=>{var y;const o=this.options,i=this.basepath??(o==null?void 0:o.basepath)??"/",c=this.basepath===void 0,l=o==null?void 0:o.rewrite;if(this.options={...o,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Q2(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Dw()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let g;this.resolvePathCache=Aa(1e3),g=this.buildRouteTree(),this.setRoutes(g)}if(!this.stores&&this.latestLocation){const g=this.getStoreConfig(this);this.batch=g.batch,this.stores=lP(gP(this.latestLocation),g),PP(this)}let d=!1;const h=this.options.basepath??"/",p=this.options.rewrite;if(c||i!==h||l!==p){this.basepath=h;const g=[],v=Tw(h);v&&v!=="/"&&g.push(uP({basepath:h})),p&&g.push(p),this.rewrite=g.length===0?void 0:g.length===1?g[0]:cP(g),this.history&&this.updateLatestLocation(),d=!0}d&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof((y=window.CSS)==null?void 0:y.supports)=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a))"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=z2(this.routeTree,this.options.caseSensitive,(o,i)=>{o.init({originalIndex:i})});return this.options.routeMasks&&D2(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,o)=>{const i={eventType:n,fn:o};return this.subscribers.add(i),()=>{this.subscribers.delete(i)}},this.emit=n=>{this.subscribers.forEach(o=>{o.eventType===n.type&&o.fn(n)})},this.parseLocation=(n,o)=>{const i=({pathname:h,search:p,hash:y,href:g,state:v})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(h)){const H=this.options.parseSearch(p),_=this.options.stringifySearch(H);return{href:h+_+y,publicHref:h+_+y,pathname:fa(h).path,external:!1,searchStr:_,search:Hs(o==null?void 0:o.search,H),hash:fa(y.slice(1)).path,state:Ys(o==null?void 0:o.state,v)}}const w=new URL(g,this.origin),S=cm(this.rewrite,w),E=this.options.parseSearch(S.search),P=this.options.stringifySearch(E);return S.search=P,{href:S.href.replace(S.origin,""),publicHref:g,pathname:fa(S.pathname).path,external:!!this.rewrite&&S.origin!==this.origin,searchStr:P,search:Hs(o==null?void 0:o.search,E),hash:fa(S.hash.slice(1)).path,state:Ys(o==null?void 0:o.state,v)}},c=i(n),{__tempLocation:l,__tempKey:d}=c.state;if(l&&(!d||d===this.tempLocationKey)){const h=i(l);return h.state.key=c.state.key,h.state.__TSR_key=c.state.__TSR_key,delete h.state.__tempLocation,{...h,maskedLocation:c}}return c},this.resolvePathWithBase=(n,o)=>K2({base:n,to:o.includes("//")?dp(o):o,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,o,i)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:o},i):this.matchRoutesInternal(n,o),this.getMatchedRoutes=n=>yP({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const o=this.getMatch(n);o&&(o.abortController.abort(),clearTimeout(o._nonReactive.pendingTimeout),o._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(n=>{this.cancelMatch(n)}),this.stores.matchesId.get().forEach(n=>{var i;if(this.stores.pendingMatchStores.has(n))return;const o=(i=this.stores.matchStores.get(n))==null?void 0:i.get();o&&(o.status==="pending"||o.isFetching==="loader")&&this.cancelMatch(n)})},this.buildLocation=n=>{const o=(c={})=>{var se,K;const l=c._fromLocation||this.pendingBuiltLocation||this.latestLocation,d=this.matchRoutesLightweight(l);c.from;const h=c.unsafeRelative==="path"?l.pathname:c.from??d.fullPath,p=c.to?`${c.to}`:void 0,y=d.search,g=Object.assign(Object.create(null),d.params),v=(p==null?void 0:p.charCodeAt(0))===47?"/":this.resolvePathWithBase(h,"."),w=p?this.resolvePathWithBase(v,p):v,S=c.params===!1||c.params===null?Object.create(null):(c.params??!0)===!0?g:Object.assign(g,Gs(c.params,g)),E=this.routesByPath[$r(w)];let P;if(E)P=this.getRouteBranch(E);else if(w.includes("$"))P=[];else{const k=this.getMatchedRoutes(w);P=k.matchedRoutes,this.options.notFoundRoute&&(!k.foundRoute||k.foundRoute.path!=="/"&&k.routeParams["**"])&&(P=[...P,this.options.notFoundRoute])}if(P.length&&Cw(S))for(const k of P){const U=((se=k.options.params)==null?void 0:se.stringify)??k.options.stringifyParams;if(U)try{Object.assign(S,U(S))}catch{}}const H=n.leaveParams?w:fa(Wv({path:w,params:S,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let _=y;if(n._includeValidateSearch&&((K=this.options.search)!=null&&K.strict)){const k={};P.forEach(U=>{if(U.options.validateSearch)try{Object.assign(k,$u(U.options.validateSearch,{...k,..._}))}catch{}}),_=k}_=vP({search:_,dest:c,destRoutes:P,_includeValidateSearch:n._includeValidateSearch}),_=Hs(y,_);const O=this.options.stringifySearch(_),C=c.hash===!0?l.hash:c.hash?Gs(c.hash,l.hash):void 0,D=C?`#${C}`:"";let T=c.state===!0?l.state:c.state?Gs(c.state,l.state):{};T=Ys(l.state,T);const L=`${H}${O}${D}`;let $,q,ee=!1;if(this.rewrite){const k=new URL(L,this.origin),U=Nw(this.rewrite,k);$=k.href.replace(k.origin,""),U.origin!==this.origin?(q=U.href,ee=!0):q=U.pathname+U.search+U.hash}else $=L2(L),q=$;return{publicHref:q,href:$,pathname:H,search:_,searchStr:O,state:T,hash:C??"",external:ee,unmaskOnReload:c.unmaskOnReload}},i=(c={},l)=>{const d=o(c);let h=l?o(l):void 0;if(!h){const p=Object.create(null);if(this.options.routeMasks){const y=j2(d.pathname,this.processedTree);if(y){Object.assign(p,y.rawParams);const{from:g,params:v,...w}=y.route,S=v===!1||v===null?Object.create(null):(v??!0)===!0?p:Object.assign(p,Gs(v,p));l={from:n.from,...w,params:S},h=o(l)}}}return h&&(d.maskedLocation=h),d};return n.mask?i(n,{from:n.from,...n.mask}):i(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:o,...i})=>{let c;const l=()=>{const p=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];p.forEach(g=>{i.state[g]=this.latestLocation.state[g]});const y=eo(i.state,this.latestLocation.state);return p.forEach(g=>{delete i.state[g]}),y},d=$r(this.latestLocation.href)===$r(i.href);let h=this.commitLocationPromise;if(this.commitLocationPromise=ci(()=>{h==null||h.resolve(),h=void 0}),d&&l())this.load();else{let{maskedLocation:p,hashScrollIntoView:y,...g}=i;p&&(g={...p,state:{...p.state,__tempKey:void 0,__tempLocation:{...g,search:g.searchStr,state:{...g.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(g.unmaskOnReload??this.options.unmaskOnReload??!1)&&(g.state.__tempKey=this.tempLocationKey)),g.state.__hashScrollIntoViewOptions=y??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,c=i.replace?"REPLACE":"PUSH",this.history[c==="REPLACE"?"replace":"push"](g.publicHref,g.state,{ignoreBlocker:o})}return this._scroll.next=i.resetScroll??!0,this.history.subscribers.size||this.load(c?{action:{type:c}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:o,hashScrollIntoView:i,viewTransition:c,ignoreBlocker:l,href:d,...h}={})=>{if(d){const g=this.history.location.state.__TSR_index,v=La(d,{__TSR_index:n?g:g+1}),w=new URL(v.pathname,this.origin);h.to=cm(this.rewrite,w).pathname,h.search=this.options.parseSearch(v.search),h.hash=v.hash.slice(1)}const p=this.buildLocation({...h,_includeValidateSearch:!0});this.pendingBuiltLocation=p;const y=this.commitLocation({...p,viewTransition:c,replace:n,resetScroll:o,hashScrollIntoView:i,ignoreBlocker:l});return Promise.resolve().then(()=>{this.pendingBuiltLocation===p&&(this.pendingBuiltLocation=void 0)}),y},this.navigate=async({to:n,reloadDocument:o,href:i,publicHref:c,...l})=>{var h,p;let d=!1;if(i)try{new URL(`${i}`),d=!0}catch{}if(d&&!o&&(o=!0),o){if(n!==void 0||!i){const g=this.buildLocation({to:n,...l});i=i??g.publicHref,c=c??g.publicHref}const y=!d&&c?c:i;if(Zu(y,this.protocolAllowlist))return Promise.resolve();if(!l.ignoreBlocker){const g=((p=(h=this.history).getBlockers)==null?void 0:p.call(h))??[];for(const v of g)if(v!=null&&v.blockerFn&&await v.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return l.replace?window.location.replace(y):window.location.href=y,Promise.resolve()}return this.buildAndCommitLocation({...l,href:i,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation),o=this.stores.cachedMatches.get().filter(i=>!n.some(c=>c.id===i.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(n),this.stores.setCached(o)})},this.load=async n=>{var p;const o=(p=n==null?void 0:n.action)==null?void 0:p.type;let i,c,l;const d=this.stores.resolvedLocation.get()??this.stores.location.get();for(l=new Promise(y=>{this.startTransition(async()=>{var g;try{this.beforeLoad(),o?um.set(this.latestLocation,o):um.delete(this.latestLocation);const v=this.latestLocation,w=ri(v,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...w}),this.emit({type:"onBeforeLoad",...w}),await Gv({router:this,sync:n==null?void 0:n.sync,forceStaleReload:d.href===v.href,matches:this.stores.pendingMatches.get(),location:v,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{var _,O;let S=null,E=null,P=null,H=null;this.batch(()=>{const C=this.stores.pendingMatches.get(),D=C.length,T=this.stores.matches.get();S=D?T.filter(q=>!this.stores.pendingMatchStores.has(q.id)):null;const L=new Set;for(const q of this.stores.pendingMatchStores.values())q.routeId&&L.add(q.routeId);const $=new Set;for(const q of this.stores.matchStores.values())q.routeId&&$.add(q.routeId);E=D?T.filter(q=>!L.has(q.routeId)):null,P=D?C.filter(q=>!$.has(q.routeId)):null,H=D?C.filter(q=>$.has(q.routeId)):T,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),D&&(this.stores.setMatches(C),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...S.filter(q=>q.status!=="error"&&q.status!=="notFound"&&q.status!=="redirected")]),this.clearExpiredCache())});for(const[C,D]of[[E,"onLeave"],[P,"onEnter"],[H,"onStay"]])if(C)for(const T of C)(O=(_=this.looseRoutesById[T.routeId].options)[D])==null||O.call(_,T)})})}})}catch(v){mn(v)?(i=v,this.navigate({...i.options,replace:!0,ignoreBlocker:!0})):Ht(v)&&(c=v);const w=i?i.status:c?404:this.stores.matches.get().some(S=>S.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(w),this.stores.redirect.set(i)})}this.latestLoadPromise===l&&((g=this.commitLocationPromise)==null||g.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),y()})}),this.latestLoadPromise=l,await l;this.latestLoadPromise&&l!==this.latestLoadPromise;)await this.latestLoadPromise;let h;this.hasNotFoundMatch()?h=404:this.stores.matches.get().some(y=>y.status==="error")&&(h=500),h!==void 0&&this.stores.statusCode.set(h)},this.startViewTransition=n=>{const o=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,o&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let i;if(typeof o=="object"&&this.isViewTransitionTypesSupported){const c=this.latestLocation,l=this.stores.resolvedLocation.get(),d=typeof o.types=="function"?o.types(ri(c,l)):o.types;if(d===!1){n();return}i={update:n,types:d}}else i=n;document.startViewTransition(i)}else n()},this.updateMatch=(n,o)=>{this.startTransition(()=>{const i=this.stores.pendingMatchStores.get(n);if(i){i.set(o);return}const c=this.stores.matchStores.get(n);if(c){c.set(o);return}const l=this.stores.cachedMatchStores.get(n);if(l){const d=o(l.get());d.status==="redirected"?this.stores.cachedMatchStores.delete(n)&&this.stores.cachedIds.set(h=>h.filter(p=>p!==n)):l.set(d)}})},this.getMatch=n=>{var o,i,c;return((o=this.stores.cachedMatchStores.get(n))==null?void 0:o.get())??((i=this.stores.pendingMatchStores.get(n))==null?void 0:i.get())??((c=this.stores.matchStores.get(n))==null?void 0:c.get())},this.invalidate=n=>{const o=i=>{var c;return((c=n==null?void 0:n.filter)==null?void 0:c.call(n,i))??!0?{...i,invalid:!0,...n!=null&&n.forcePending||i.status==="error"||i.status==="notFound"?{status:"pending",error:void 0}:void 0}:i};return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(o)),this.stores.setCached(this.stores.cachedMatches.get().map(o)),this.stores.setPending(this.stores.pendingMatches.get().map(o))}),this.shouldViewTransition=!1,this.load({sync:n==null?void 0:n.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const o=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const i=n.options._builtLocation??this.buildLocation(n.options),c=this.getParsedLocationHref(i);n.options.href=c,n.headers.set("Location",c)}else if(o)try{const i=new URL(o);if(this.origin&&i.origin===this.origin){const c=i.pathname+i.search+i.hash;n.options.href=c,n.headers.set("Location",c)}}catch{}if(n.options.href&&!n.options._builtLocation&&Zu(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const o=n==null?void 0:n.filter;o!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(i=>!o(i))):this.stores.setCached([])},this.clearExpiredCache=()=>{const n=Date.now(),o=i=>{const c=this.looseRoutesById[i.routeId];if(!c.options.loader)return!0;const l=(i.preload?c.options.preloadGcTime??this.options.defaultPreloadGcTime:c.options.gcTime??this.options.defaultGcTime)??300*1e3;return i.status==="error"?!0:n-i.updatedAt>=l};this.clearCache({filter:o})},this.loadRouteChunk=Ma,this.preloadRoute=async n=>{const o=n._builtLocation??this.buildLocation(n);let i=this.matchRoutes(o,{throwOnError:!0,preload:!0,dest:n});const c=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),l=new Set([...c,...this.stores.cachedIds.get()]),d=i.filter(h=>!l.has(h.id));if(d.length){const h=this.stores.cachedMatches.get();this.stores.setCached([...h,...d])}try{return i=await Gv({router:this,matches:i,location:o,preload:!0,updateMatch:(h,p)=>{c.has(h)?i=i.map(y=>y.id===h?p(y):y):this.updateMatch(h,p)}}),i}catch(h){if(mn(h))return h.options.reloadDocument?void 0:await this.preloadRoute({...h.options,_fromLocation:o});Ht(h)||console.error(h);return}},this.matchRoute=(n,o)=>{const i={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},c=this.buildLocation(i);if(o!=null&&o.pending&&this.stores.status.get()!=="pending")return!1;const l=((o==null?void 0:o.pending)===void 0?!this.stores.isLoading.get():o.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),d=$2(c.pathname,(o==null?void 0:o.caseSensitive)??!1,(o==null?void 0:o.fuzzy)??!1,l.pathname,this.processedTree);return!d||n.params&&!eo(d.rawParams,n.params,{partial:!0})?!1:(o==null?void 0:o.includeSearch)??!0?eo(l.search,c.search,{partial:!0})?d.rawParams:!1:d.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(n=>n.status==="notFound"||n.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??X2,parseSearch:e.parseSearch??Y2,protocolAllowlist:e.protocolAllowlist??M2}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;const o=this.options.notFoundRoute;o&&(o.init({originalIndex:99999999999}),this.routesById[o.id]=o)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=Iw(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e!=null&&e.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){var y,g;const n=this.getMatchedRoutes(e.pathname),{foundRoute:o,routeParams:i}=n;let{matchedRoutes:c}=n,l=!1;(o?o.path!=="/"&&i["**"]:$r(e.pathname))&&(this.options.notFoundRoute?c=[...c,this.options.notFoundRoute]:l=!0);const d=l?xP(this.options.notFoundMode,c):void 0,h=new Array(c.length),p=new Map;for(const v of this.stores.matchStores.values())v.routeId&&p.set(v.routeId,v.get());for(let v=0;v<c.length;v++){const w=c[v],S=h[v-1];let E,P,H;{const U=(S==null?void 0:S.search)??e.search,V=(S==null?void 0:S._strictSearch)??void 0;try{const J=$u(w.options.validateSearch,{...U})??void 0;E={...U,...J},P={...V,...J},H=void 0}catch(J){let B=J;if(J instanceof tl||(B=new tl(J.message,{cause:J})),t!=null&&t.throwOnError)throw B;E=U,P={},H=B}}const _=((g=(y=w.options).loaderDeps)==null?void 0:g.call(y,{search:E}))??"",O=_?JSON.stringify(_):"",{interpolatedPath:C,usedParams:D}=Wv({path:w.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),T=w.id+C+O,L=this.getMatch(T),$=p.get(w.id),q=(L==null?void 0:L._strictParams)??D;let ee;if(!L)try{tS(w,q)}catch(U){if(Ht(U)||mn(U)?ee=U:ee=new pP(U.message,{cause:U}),t!=null&&t.throwOnError)throw ee}Object.assign(i,q);const se=$?"stay":"enter";let K;if(L)K={...L,cause:se,params:($==null?void 0:$.params)??i,_strictParams:q,search:Hs($?$.search:L.search,E),_strictSearch:P};else{const U=w.options.loader||w.options.beforeLoad||w.lazyFn||Ow(w)?"pending":"success";K={id:T,ssr:w.options.ssr,index:v,routeId:w.id,params:($==null?void 0:$.params)??i,_strictParams:q,pathname:C,updatedAt:Date.now(),search:$?Hs($.search,E):E,_strictSearch:P,searchError:void 0,status:U,isFetching:!1,error:void 0,paramsError:ee,__routeContext:void 0,_nonReactive:{loadPromise:ci()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:se,loaderDeps:$?Ys($.loaderDeps,_):_,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:w.options.staticData||{},fullPath:w.fullPath}}t!=null&&t.preload||(K.globalNotFound=d===w.id),K.searchError=H;const k=this.getParentContext(S);K.context={...k,...K.__routeContext,...K.__beforeLoadContext},h[v]=K}for(let v=0;v<h.length;v++){const w=h[v],S=this.looseRoutesById[w.routeId],E=this.getMatch(w.id),P=p.get(w.routeId);if(w.params=P?Hs(P.params,i):i,!E){const H=h[v-1],_=this.getParentContext(H);if(S.options.context){const O={deps:w.loaderDeps,params:w.params,context:_??{},location:e,navigate:C=>this.navigate({...C,_fromLocation:e}),buildLocation:this.buildLocation,cause:w.cause,abortController:w.abortController,preload:!!w.preload,matches:h,routeId:S.id};w.__routeContext=S.options.context(O)??void 0}w.context={..._,...w.__routeContext,...w.__beforeLoadContext}}}return h}matchRoutesLightweight(e){var p;const{matchedRoutes:t,routeParams:n}=this.getMatchedRoutes(e.pathname),o=Ra(t),i={...e.search};for(const y of t)try{Object.assign(i,$u(y.options.validateSearch,i))}catch{}const c=Ra(this.stores.matchesId.get()),l=c&&((p=this.stores.matchStores.get(c))==null?void 0:p.get()),d=l&&l.routeId===o.id&&l.pathname===e.pathname;let h;if(d)h=l.params;else{const y=Object.assign(Object.create(null),n);for(const g of t)try{tS(g,y)}catch{}h=y}return{matchedRoutes:t,fullPath:o.fullPath,search:i,params:h}}},tl=class extends Error{},pP=class extends Error{};function gP(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function $u(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new tl("Async validation not supported");if(n.issues)throw new tl(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function yP({pathname:e,routesById:t,processedTree:n}){const o=Object.create(null),i=$r(e);let c;const l=U2(i,n,!0);return l&&(c=l.route,Object.assign(o,l.rawParams)),{matchedRoutes:(l==null?void 0:l.branch)||[t.__root__],routeParams:o,foundRoute:c}}function vP({search:e,dest:t,destRoutes:n,_includeValidateSearch:o}){return SP(n)(e,t,o??!1)}function SP(e){var c;let t,n;const o=[];for(const l of e){const d=l.options;if("search"in d)(c=d.search)!=null&&c.middlewares&&o.push(...d.search.middlewares);else if(d.preSearchFilters||d.postSearchFilters){const p=({search:y,next:g})=>{const v=g(d.preSearchFilters?d.preSearchFilters.reduce((w,S)=>S(w),y):y);return d.postSearchFilters?d.postSearchFilters.reduce((w,S)=>S(w),v):v};o.push(p)}const h=d.validateSearch;if(h){const p=({search:y,next:g,meta:v})=>{const w=g(y);if(n)try{const S=$u(h,w);if(v&&S)for(const E in S)E in w||(v.defaulted||(v.defaulted=new Map)).set(E,S[E]);return{...w,...S}}catch{}return w};o.push(p)}}const i=(l,d,h)=>{if(l>=o.length){if(!t.search)return{};if(t.search===!0)return d;const y=Gs(t.search,d);return h&&(h.explicit=y),y}const p=(y,g)=>{if(g){const v=h||{};return{search:i(l+1,y,v),meta:v}}return i(l+1,y,h)};return o[l]({search:d,next:p,meta:h})};return function(d,h,p){return t=h,n=p,i(0,d)}}function xP(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const o=t[n];if(o.children)return o.id}return to}function tS(e,t){var o;const n=((o=e.options.params)==null?void 0:o.parse)??e.options.parseParams;if(n){const i=n(t);if(i===!1)throw new Error("Route params.parse returned false for a matched route");Object.assign(t,i)}}function wP(){try{return sessionStorage}catch{return}}const kP="tsr-scroll-restoration-v1_3",si=wP();function EP(){try{return JSON.parse((si==null?void 0:si.getItem("tsr-scroll-restoration-v1_3"))||"{}")}catch{return{}}}function _P(){try{si==null||si.setItem(kP,JSON.stringify(ds))}catch{}}const ds=EP(),nS="data-scroll-restoration-id",CP=e=>e.state.__TSR_key||e.href;function bP(e){const t=e.getAttribute(nS);if(t)return`[${nS}="${t}"]`;let n="",o=e,i;for(;i=o.parentNode;){let c=1,l=o;for(;l=l.previousElementSibling;)c++;const d=`${o.localName}:nth-child(${c})`;n=n?`${d} > ${n}`:d,o=i}return n}let bu=!1;const Zo="window";function lm(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function rS(e){const t=[];for(const n of e){if(n===Zo)continue;const o=lm(n);o&&t.push(o)}return t}function PP(e,t){const n=e.options.scrollRestoration,o=e._scroll;n&&(o.restoring=!0);const i=e.options.getScrollRestorationKey||CP,c=new Map,l=(p,y,g)=>{const v=c.get(p)||{};v.scrollX=y,v.scrollY=g,c.set(p,v)},d=p=>{if(!(bu||!o.restoring))if(p.target===document)l(Zo,scrollX,scrollY);else{const y=p.target;l(y,y.scrollLeft,y.scrollTop)}},h=p=>{if(!o.restoring)return;const y=ds[p]||(ds[p]={});for(const[g,v]of c)g===Zo?y[Zo]=v:g.isConnected&&(y[bP(g)]=v)};n&&!o.restoration&&(o.restoration=!0,bu=!1,history.scrollRestoration="manual",document.addEventListener("scroll",d,!0),e.subscribe("onBeforeLoad",p=>{p.fromLocation&&h(i(p.fromLocation)),c.clear()}),addEventListener("pagehide",()=>{h(i(e.stores.resolvedLocation.get()??e.stores.location.get())),_P()})),!o.reset&&(o.reset=!0,e.subscribe("onRendered",p=>{var P;const y=e.options.scrollRestorationBehavior,g=e.options.scrollToTopSelectors,v=o.next;let w;if(c.clear(),v||(o.next=!0),typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return;const S=i(p.toLocation),E=p.fromLocation&&i(p.fromLocation);if(o.restoring&&E&&E!==S){const H=ds[E];if(H){let _=ds[S];for(const O in H){if(O===Zo){if(v)continue}else{const C=lm(O);if(!C||v&&g&&(w??(w=rS(g)),w.includes(C)))continue}_||(_=ds[S]={}),_[O]??(_[O]=H[O])}}}bu=!0;try{const H=p.toLocation.hash,_=p.toLocation.state.__hashScrollIntoViewOptions??!0;let O=!1;if(v){const C=um.get(p.toLocation),D=H&&_&&(C==="PUSH"||C==="REPLACE"),T=o.restoring?ds[S]:void 0;if(T)for(const L in T){const{scrollX:$,scrollY:q}=T[L];if(L===Zo){if(D)continue;scrollTo({top:q,left:$,behavior:y}),O=!0}else{const ee=lm(L);ee&&(ee.scrollLeft=$,ee.scrollTop=q)}}if(!O&&!H){const L={top:0,left:0,behavior:y};if(scrollTo(L),g){w??(w=rS(g));for(const $ of w)$.scrollTo(L)}}}!O&&H&&_&&((P=document.getElementById(H))==null||P.scrollIntoView(_))}finally{bu=!1}}))}const FP="Error preloading route! ☝️";var jw=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=t=>{var h,p;this.originalIndex=t.originalIndex;const n=this.options,o=!(n!=null&&n.path)&&!(n!=null&&n.id);this.parentRoute=(p=(h=this.options).getParentRoute)==null?void 0:p.call(h),o?this._path=to:this.parentRoute||Br();let i=o?to:n==null?void 0:n.path;i&&i!=="/"&&(i=Rw(i));const c=(n==null?void 0:n.id)||i;let l=o?to:Du([this.parentRoute.id==="__root__"?"":this.parentRoute.id,c]);i==="__root__"&&(i="/"),l!=="__root__"&&(l=Du(["/",l]));const d=l==="__root__"?"/":Du([this.parentRoute.fullPath,i]);this._path=i,this._id=l,this._fullPath=d,this._to=$r(d)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>tP({from:this.fullPath,...t}),this.options=e||{},this.isRoot=!(e!=null&&e.getParentRoute),e!=null&&e.id&&(e!=null&&e.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}},IP=class extends jw{constructor(e){super(e)}};function mp(e){const t=e.errorComponent??pp;return F.jsx(RP,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:o})=>n?Y.createElement(t,{error:n,reset:o}):e.children})}var RP=class extends Y.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){const n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function pp({error:e}){const[t,n]=Y.useState(!1);return F.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[F.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[F.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),F.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(o=>!o),children:t?"Hide Error":"Show Error"})]}),F.jsx("div",{style:{height:".25rem"}}),t?F.jsx("div",{children:F.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?F.jsx("code",{children:e.message}):null})}):null]})}function TP({children:e,fallback:t=null}){return $w()?F.jsx(Ia.Fragment,{children:e}):F.jsx(Ia.Fragment,{children:t})}function $w(){return Ia.useSyncExternalStore(AP,()=>!0,()=>!1)}function AP(){return()=>{}}var Uw=Y.createContext(null);function An(e){return Y.useContext(Uw)}var Ml=Y.createContext(void 0),MP=Y.createContext(void 0),et=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(et||{});function LP({update:e,notify:t,unwatched:n}){return{link:o,unlink:i,propagate:c,checkDirty:l,shallowPropagate:d};function o(p,y,g){const v=y.depsTail;if(v!==void 0&&v.dep===p)return;const w=v!==void 0?v.nextDep:y.deps;if(w!==void 0&&w.dep===p){w.version=g,y.depsTail=w;return}const S=p.subsTail;if(S!==void 0&&S.version===g&&S.sub===y)return;const E=y.depsTail=p.subsTail={version:g,dep:p,sub:y,prevDep:v,nextDep:w,prevSub:S,nextSub:void 0};w!==void 0&&(w.prevDep=E),v!==void 0?v.nextDep=E:y.deps=E,S!==void 0?S.nextSub=E:p.subs=E}function i(p,y=p.sub){const g=p.dep,v=p.prevDep,w=p.nextDep,S=p.nextSub,E=p.prevSub;return w!==void 0?w.prevDep=v:y.depsTail=v,v!==void 0?v.nextDep=w:y.deps=w,S!==void 0?S.prevSub=E:g.subsTail=E,E!==void 0?E.nextSub=S:(g.subs=S)===void 0&&n(g),w}function c(p){let y=p.nextSub,g;e:do{const v=p.sub;let w=v.flags;if(w&60?w&12?w&4?!(w&48)&&h(p,v)?(v.flags=w|40,w&=1):w=0:v.flags=w&-9|32:w=0:v.flags=w|32,w&2&&t(v),w&1){const S=v.subs;if(S!==void 0){const E=(p=S).nextSub;E!==void 0&&(g={value:y,prev:g},y=E);continue}}if((p=y)!==void 0){y=p.nextSub;continue}for(;g!==void 0;)if(p=g.value,g=g.prev,p!==void 0){y=p.nextSub;continue e}break}while(!0)}function l(p,y){let g,v=0,w=!1;e:do{const S=p.dep,E=S.flags;if(y.flags&16)w=!0;else if((E&17)===17){if(e(S)){const P=S.subs;P.nextSub!==void 0&&d(P),w=!0}}else if((E&33)===33){(p.nextSub!==void 0||p.prevSub!==void 0)&&(g={value:p,prev:g}),p=S.deps,y=S,++v;continue}if(!w){const P=p.nextDep;if(P!==void 0){p=P;continue}}for(;v--;){const P=y.subs,H=P.nextSub!==void 0;if(H?(p=g.value,g=g.prev):p=P,w){if(e(y)){H&&d(P),y=p.sub;continue}w=!1}else y.flags&=-33;y=p.sub;const _=p.nextDep;if(_!==void 0){p=_;continue e}}return w}while(!0)}function d(p){do{const y=p.sub,g=y.flags;(g&48)===32&&(y.flags=g|16,(g&6)===2&&t(y))}while((p=p.nextSub)!==void 0)}function h(p,y){let g=y.depsTail;for(;g!==void 0;){if(g===p)return!0;g=g.prevDep}return!1}}function OP(e,t,n){var c,l,d;const o=typeof e=="object",i=o?e:void 0;return{next:(c=o?e.next:e)==null?void 0:c.bind(i),error:(l=o?e.error:t)==null?void 0:l.bind(i),complete:(d=o?e.complete:n)==null?void 0:d.bind(i)}}const fm=[];let Uu=0;const{link:sS,unlink:NP,propagate:DP,checkDirty:Bw,shallowPropagate:oS}=LP({update(e){return e._update()},notify(e){fm[dm++]=e,e.flags&=~et.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=et.Mutable|et.Dirty,nl(e))}});let Pu=0,dm=0,pr,hm=0;function zw(e){try{++hm,e()}finally{--hm||Vw()}}function nl(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=NP(n,e)}function Vw(){if(!(hm>0)){for(;Pu<dm;){const e=fm[Pu];fm[Pu++]=void 0,e.notify()}Pu=0,dm=0}}function iS(e,t){const n=typeof e=="function",o=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?et.None:et.Mutable,get(){return pr!==void 0&&sS(i,pr,Uu),i._snapshot},subscribe(c){const l=OP(c),d={current:!1},h=jP(()=>{var p;i.get(),d.current?(p=l.next)==null||p.call(l,i._snapshot):d.current=!0});return{unsubscribe:()=>{h.stop()}}},_update(c){const l=pr,d=(t==null?void 0:t.compare)??Object.is;if(n)pr=i,++Uu,i.depsTail=void 0;else if(c===void 0)return!1;n&&(i.flags=et.Mutable|et.RecursedCheck);try{const h=i._snapshot,p=typeof c=="function"?c(h):c===void 0&&n?o(h):c;return h===void 0||!d(h,p)?(i._snapshot=p,!0):!1}finally{pr=l,n&&(i.flags&=~et.RecursedCheck),nl(i)}}};return n?(i.flags=et.Mutable|et.Dirty,i.get=function(){const c=i.flags;if(c&et.Dirty||c&et.Pending&&Bw(i.deps,i)){if(i._update()){const l=i.subs;l!==void 0&&oS(l)}}else c&et.Pending&&(i.flags=c&~et.Pending);return pr!==void 0&&sS(i,pr,Uu),i._snapshot}):i.set=function(c){if(i._update(c)){const l=i.subs;l!==void 0&&(DP(l),oS(l),Vw())}},i}function jP(e){const t=()=>{const o=pr;pr=n,++Uu,n.depsTail=void 0,n.flags=et.Watching|et.RecursedCheck;try{return e()}finally{pr=o,n.flags&=~et.RecursedCheck,nl(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:et.Watching|et.RecursedCheck,notify(){const o=this.flags;o&et.Dirty||o&et.Pending&&Bw(this.deps,this)?t():this.flags=et.Watching},stop(){this.flags=et.None,this.depsTail=void 0,nl(this)}};return t(),n}var Eh={exports:{}},_h={},Ch={exports:{}},bh={};/**
|
|
41
|
+
`+m.stack}return{value:r,source:s,stack:f,digest:null}}function Ld(r,s,a){return{value:r,source:null,stack:a??null,digest:s??null}}function Od(r,s){try{console.error(s.value)}catch(a){setTimeout(function(){throw a})}}var Sb=typeof WeakMap=="function"?WeakMap:Map;function Dy(r,s,a){a=Mr(-1,a),a.tag=3,a.payload={element:null};var u=s.value;return a.callback=function(){uu||(uu=!0,Gd=u),Od(r,s)},a}function jy(r,s,a){a=Mr(-1,a),a.tag=3;var u=r.type.getDerivedStateFromError;if(typeof u=="function"){var f=s.value;a.payload=function(){return u(f)},a.callback=function(){Od(r,s)}}var m=r.stateNode;return m!==null&&typeof m.componentDidCatch=="function"&&(a.callback=function(){Od(r,s),typeof u!="function"&&(is===null?is=new Set([this]):is.add(this));var x=s.stack;this.componentDidCatch(s.value,{componentStack:x!==null?x:""})}),a}function $y(r,s,a){var u=r.pingCache;if(u===null){u=r.pingCache=new Sb;var f=new Set;u.set(s,f)}else f=u.get(s),f===void 0&&(f=new Set,u.set(s,f));f.has(a)||(f.add(a),r=Mb.bind(null,r,s,a),s.then(r,r))}function Uy(r){do{var s;if((s=r.tag===13)&&(s=r.memoizedState,s=s!==null?s.dehydrated!==null:!0),s)return r;r=r.return}while(r!==null);return null}function By(r,s,a,u,f){return(r.mode&1)===0?(r===s?r.flags|=65536:(r.flags|=128,a.flags|=131072,a.flags&=-52805,a.tag===1&&(a.alternate===null?a.tag=17:(s=Mr(-1,1),s.tag=2,ss(a,s,1))),a.lanes|=1),r):(r.flags|=65536,r.lanes=f,r)}var xb=C.ReactCurrentOwner,un=!1;function Yt(r,s,a,u){s.child=r===null?ay(s,null,a,u):$o(s,r.child,a,u)}function zy(r,s,a,u,f){a=a.render;var m=s.ref;return Bo(s,f),u=bd(r,s,a,u,m,f),a=Pd(),r!==null&&!un?(s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~f,Lr(r,s,f)):(et&&a&&ud(s),s.flags|=1,Yt(r,s,u,f),s.child)}function Vy(r,s,a,u,f){if(r===null){var m=a.type;return typeof m=="function"&&!rh(m)&&m.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(s.tag=15,s.type=m,qy(r,s,m,u,f)):(r=pu(a.type,null,u,s,s.mode,f),r.ref=s.ref,r.return=s,s.child=r)}if(m=r.child,(r.lanes&f)===0){var x=m.memoizedProps;if(a=a.compare,a=a!==null?a:Vi,a(x,u)&&r.ref===s.ref)return Lr(r,s,f)}return s.flags|=1,r=ls(m,u),r.ref=s.ref,r.return=s,s.child=r}function qy(r,s,a,u,f){if(r!==null){var m=r.memoizedProps;if(Vi(m,u)&&r.ref===s.ref)if(un=!1,s.pendingProps=u=m,(r.lanes&f)!==0)(r.flags&131072)!==0&&(un=!0);else return s.lanes=r.lanes,Lr(r,s,f)}return Nd(r,s,a,u,f)}function Wy(r,s,a){var u=s.pendingProps,f=u.children,m=r!==null?r.memoizedState:null;if(u.mode==="hidden")if((s.mode&1)===0)s.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ke(Wo,Cn),Cn|=a;else{if((a&1073741824)===0)return r=m!==null?m.baseLanes|a:a,s.lanes=s.childLanes=1073741824,s.memoizedState={baseLanes:r,cachePool:null,transitions:null},s.updateQueue=null,Ke(Wo,Cn),Cn|=r,null;s.memoizedState={baseLanes:0,cachePool:null,transitions:null},u=m!==null?m.baseLanes:a,Ke(Wo,Cn),Cn|=u}else m!==null?(u=m.baseLanes|a,s.memoizedState=null):u=a,Ke(Wo,Cn),Cn|=u;return Yt(r,s,f,a),s.child}function Hy(r,s){var a=s.ref;(r===null&&a!==null||r!==null&&r.ref!==a)&&(s.flags|=512,s.flags|=2097152)}function Nd(r,s,a,u,f){var m=cn(a)?Os:Ut.current;return m=Oo(s,m),Bo(s,f),a=bd(r,s,a,u,m,f),u=Pd(),r!==null&&!un?(s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~f,Lr(r,s,f)):(et&&u&&ud(s),s.flags|=1,Yt(r,s,a,f),s.child)}function Ky(r,s,a,u,f){if(cn(a)){var m=!0;Uc(s)}else m=!1;if(Bo(s,f),s.stateNode===null)su(r,s),Oy(s,a,u),Md(s,a,u,f),u=!0;else if(r===null){var x=s.stateNode,b=s.memoizedProps;x.props=b;var R=x.context,G=a.contextType;typeof G=="object"&&G!==null?G=On(G):(G=cn(a)?Os:Ut.current,G=Oo(s,G));var ie=a.getDerivedStateFromProps,ae=typeof ie=="function"||typeof x.getSnapshotBeforeUpdate=="function";ae||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(b!==u||R!==G)&&Ny(s,x,u,G),rs=!1;var oe=s.memoizedState;x.state=oe,Jc(s,u,x,f),R=s.memoizedState,b!==u||oe!==R||an.current||rs?(typeof ie=="function"&&(Ad(s,a,ie,u),R=s.memoizedState),(b=rs||Ly(s,a,b,u,oe,R,G))?(ae||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(s.flags|=4194308)):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=u,s.memoizedState=R),x.props=u,x.state=R,x.context=G,u=b):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),u=!1)}else{x=s.stateNode,uy(r,s),b=s.memoizedProps,G=s.type===s.elementType?b:Gn(s.type,b),x.props=G,ae=s.pendingProps,oe=x.context,R=a.contextType,typeof R=="object"&&R!==null?R=On(R):(R=cn(a)?Os:Ut.current,R=Oo(s,R));var he=a.getDerivedStateFromProps;(ie=typeof he=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(b!==ae||oe!==R)&&Ny(s,x,u,R),rs=!1,oe=s.memoizedState,x.state=oe,Jc(s,u,x,f);var ye=s.memoizedState;b!==ae||oe!==ye||an.current||rs?(typeof he=="function"&&(Ad(s,a,he,u),ye=s.memoizedState),(G=rs||Ly(s,a,G,u,oe,ye,R)||!1)?(ie||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(u,ye,R),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(u,ye,R)),typeof x.componentDidUpdate=="function"&&(s.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof x.componentDidUpdate!="function"||b===r.memoizedProps&&oe===r.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||b===r.memoizedProps&&oe===r.memoizedState||(s.flags|=1024),s.memoizedProps=u,s.memoizedState=ye),x.props=u,x.state=ye,x.context=R,u=G):(typeof x.componentDidUpdate!="function"||b===r.memoizedProps&&oe===r.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||b===r.memoizedProps&&oe===r.memoizedState||(s.flags|=1024),u=!1)}return Dd(r,s,a,u,m,f)}function Dd(r,s,a,u,f,m){Hy(r,s);var x=(s.flags&128)!==0;if(!u&&!x)return f&&X0(s,a,!1),Lr(r,s,m);u=s.stateNode,xb.current=s;var b=x&&typeof a.getDerivedStateFromError!="function"?null:u.render();return s.flags|=1,r!==null&&x?(s.child=$o(s,r.child,null,m),s.child=$o(s,null,b,m)):Yt(r,s,b,m),s.memoizedState=u.state,f&&X0(s,a,!0),s.child}function Qy(r){var s=r.stateNode;s.pendingContext?G0(r,s.pendingContext,s.pendingContext!==s.context):s.context&&G0(r,s.context,!1),xd(r,s.containerInfo)}function Jy(r,s,a,u,f){return jo(),hd(f),s.flags|=256,Yt(r,s,a,u),s.child}var jd={dehydrated:null,treeContext:null,retryLane:0};function $d(r){return{baseLanes:r,cachePool:null,transitions:null}}function Gy(r,s,a){var u=s.pendingProps,f=st.current,m=!1,x=(s.flags&128)!==0,b;if((b=x)||(b=r!==null&&r.memoizedState===null?!1:(f&2)!==0),b?(m=!0,s.flags&=-129):(r===null||r.memoizedState!==null)&&(f|=1),Ke(st,f&1),r===null)return dd(s),r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null)?((s.mode&1)===0?s.lanes=1:r.data==="$!"?s.lanes=8:s.lanes=1073741824,null):(x=u.children,r=u.fallback,m?(u=s.mode,m=s.child,x={mode:"hidden",children:x},(u&1)===0&&m!==null?(m.childLanes=0,m.pendingProps=x):m=gu(x,u,0,null),r=Ws(r,u,a,null),m.return=s,r.return=s,m.sibling=r,s.child=m,s.child.memoizedState=$d(a),s.memoizedState=jd,r):Ud(s,x));if(f=r.memoizedState,f!==null&&(b=f.dehydrated,b!==null))return wb(r,s,x,u,b,f,a);if(m){m=u.fallback,x=s.mode,f=r.child,b=f.sibling;var R={mode:"hidden",children:u.children};return(x&1)===0&&s.child!==f?(u=s.child,u.childLanes=0,u.pendingProps=R,s.deletions=null):(u=ls(f,R),u.subtreeFlags=f.subtreeFlags&14680064),b!==null?m=ls(b,m):(m=Ws(m,x,a,null),m.flags|=2),m.return=s,u.return=s,u.sibling=m,s.child=u,u=m,m=s.child,x=r.child.memoizedState,x=x===null?$d(a):{baseLanes:x.baseLanes|a,cachePool:null,transitions:x.transitions},m.memoizedState=x,m.childLanes=r.childLanes&~a,s.memoizedState=jd,u}return m=r.child,r=m.sibling,u=ls(m,{mode:"visible",children:u.children}),(s.mode&1)===0&&(u.lanes=a),u.return=s,u.sibling=null,r!==null&&(a=s.deletions,a===null?(s.deletions=[r],s.flags|=16):a.push(r)),s.child=u,s.memoizedState=null,u}function Ud(r,s){return s=gu({mode:"visible",children:s},r.mode,0,null),s.return=r,r.child=s}function ru(r,s,a,u){return u!==null&&hd(u),$o(s,r.child,null,a),r=Ud(s,s.pendingProps.children),r.flags|=2,s.memoizedState=null,r}function wb(r,s,a,u,f,m,x){if(a)return s.flags&256?(s.flags&=-257,u=Ld(Error(n(422))),ru(r,s,x,u)):s.memoizedState!==null?(s.child=r.child,s.flags|=128,null):(m=u.fallback,f=s.mode,u=gu({mode:"visible",children:u.children},f,0,null),m=Ws(m,f,x,null),m.flags|=2,u.return=s,m.return=s,u.sibling=m,s.child=u,(s.mode&1)!==0&&$o(s,r.child,null,x),s.child.memoizedState=$d(x),s.memoizedState=jd,m);if((s.mode&1)===0)return ru(r,s,x,null);if(f.data==="$!"){if(u=f.nextSibling&&f.nextSibling.dataset,u)var b=u.dgst;return u=b,m=Error(n(419)),u=Ld(m,u,void 0),ru(r,s,x,u)}if(b=(x&r.childLanes)!==0,un||b){if(u=Ct,u!==null){switch(x&-x){case 4:f=2;break;case 16:f=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:f=32;break;case 536870912:f=268435456;break;default:f=0}f=(f&(u.suspendedLanes|x))!==0?0:f,f!==0&&f!==m.retryLane&&(m.retryLane=f,Ar(r,f),Zn(u,r,f,-1))}return nh(),u=Ld(Error(n(421))),ru(r,s,x,u)}return f.data==="$?"?(s.flags|=128,s.child=r.child,s=Lb.bind(null,r),f._reactRetry=s,null):(r=m.treeContext,_n=Zr(f.nextSibling),En=s,et=!0,Jn=null,r!==null&&(Mn[Ln++]=Rr,Mn[Ln++]=Tr,Mn[Ln++]=Ns,Rr=r.id,Tr=r.overflow,Ns=s),s=Ud(s,u.children),s.flags|=4096,s)}function Yy(r,s,a){r.lanes|=s;var u=r.alternate;u!==null&&(u.lanes|=s),yd(r.return,s,a)}function Bd(r,s,a,u,f){var m=r.memoizedState;m===null?r.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:u,tail:a,tailMode:f}:(m.isBackwards=s,m.rendering=null,m.renderingStartTime=0,m.last=u,m.tail=a,m.tailMode=f)}function Xy(r,s,a){var u=s.pendingProps,f=u.revealOrder,m=u.tail;if(Yt(r,s,u.children,a),u=st.current,(u&2)!==0)u=u&1|2,s.flags|=128;else{if(r!==null&&(r.flags&128)!==0)e:for(r=s.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&Yy(r,a,s);else if(r.tag===19)Yy(r,a,s);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===s)break e;for(;r.sibling===null;){if(r.return===null||r.return===s)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}u&=1}if(Ke(st,u),(s.mode&1)===0)s.memoizedState=null;else switch(f){case"forwards":for(a=s.child,f=null;a!==null;)r=a.alternate,r!==null&&Gc(r)===null&&(f=a),a=a.sibling;a=f,a===null?(f=s.child,s.child=null):(f=a.sibling,a.sibling=null),Bd(s,!1,f,a,m);break;case"backwards":for(a=null,f=s.child,s.child=null;f!==null;){if(r=f.alternate,r!==null&&Gc(r)===null){s.child=f;break}r=f.sibling,f.sibling=a,a=f,f=r}Bd(s,!0,a,null,m);break;case"together":Bd(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function su(r,s){(s.mode&1)===0&&r!==null&&(r.alternate=null,s.alternate=null,s.flags|=2)}function Lr(r,s,a){if(r!==null&&(s.dependencies=r.dependencies),Bs|=s.lanes,(a&s.childLanes)===0)return null;if(r!==null&&s.child!==r.child)throw Error(n(153));if(s.child!==null){for(r=s.child,a=ls(r,r.pendingProps),s.child=a,a.return=s;r.sibling!==null;)r=r.sibling,a=a.sibling=ls(r,r.pendingProps),a.return=s;a.sibling=null}return s.child}function kb(r,s,a){switch(s.tag){case 3:Qy(s),jo();break;case 5:dy(s);break;case 1:cn(s.type)&&Uc(s);break;case 4:xd(s,s.stateNode.containerInfo);break;case 10:var u=s.type._context,f=s.memoizedProps.value;Ke(Hc,u._currentValue),u._currentValue=f;break;case 13:if(u=s.memoizedState,u!==null)return u.dehydrated!==null?(Ke(st,st.current&1),s.flags|=128,null):(a&s.child.childLanes)!==0?Gy(r,s,a):(Ke(st,st.current&1),r=Lr(r,s,a),r!==null?r.sibling:null);Ke(st,st.current&1);break;case 19:if(u=(a&s.childLanes)!==0,(r.flags&128)!==0){if(u)return Xy(r,s,a);s.flags|=128}if(f=s.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),Ke(st,st.current),u)break;return null;case 22:case 23:return s.lanes=0,Wy(r,s,a)}return Lr(r,s,a)}var Zy,zd,ev,tv;Zy=function(r,s){for(var a=s.child;a!==null;){if(a.tag===5||a.tag===6)r.appendChild(a.stateNode);else if(a.tag!==4&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===s)break;for(;a.sibling===null;){if(a.return===null||a.return===s)return;a=a.return}a.sibling.return=a.return,a=a.sibling}},zd=function(){},ev=function(r,s,a,u){var f=r.memoizedProps;if(f!==u){r=s.stateNode,$s(dr.current);var m=null;switch(a){case"input":f=Wr(r,f),u=Wr(r,u),m=[];break;case"select":f=te({},f,{value:void 0}),u=te({},u,{value:void 0}),m=[];break;case"textarea":f=ko(r,f),u=ko(r,u),m=[];break;default:typeof f.onClick!="function"&&typeof u.onClick=="function"&&(r.onclick=Dc)}kf(a,u);var x;a=null;for(G in f)if(!u.hasOwnProperty(G)&&f.hasOwnProperty(G)&&f[G]!=null)if(G==="style"){var b=f[G];for(x in b)b.hasOwnProperty(x)&&(a||(a={}),a[x]="")}else G!=="dangerouslySetInnerHTML"&&G!=="children"&&G!=="suppressContentEditableWarning"&&G!=="suppressHydrationWarning"&&G!=="autoFocus"&&(i.hasOwnProperty(G)?m||(m=[]):(m=m||[]).push(G,null));for(G in u){var R=u[G];if(b=f!=null?f[G]:void 0,u.hasOwnProperty(G)&&R!==b&&(R!=null||b!=null))if(G==="style")if(b){for(x in b)!b.hasOwnProperty(x)||R&&R.hasOwnProperty(x)||(a||(a={}),a[x]="");for(x in R)R.hasOwnProperty(x)&&b[x]!==R[x]&&(a||(a={}),a[x]=R[x])}else a||(m||(m=[]),m.push(G,a)),a=R;else G==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,b=b?b.__html:void 0,R!=null&&b!==R&&(m=m||[]).push(G,R)):G==="children"?typeof R!="string"&&typeof R!="number"||(m=m||[]).push(G,""+R):G!=="suppressContentEditableWarning"&&G!=="suppressHydrationWarning"&&(i.hasOwnProperty(G)?(R!=null&&G==="onScroll"&&Ye("scroll",r),m||b===R||(m=[])):(m=m||[]).push(G,R))}a&&(m=m||[]).push("style",a);var G=m;(s.updateQueue=G)&&(s.flags|=4)}},tv=function(r,s,a,u){a!==u&&(s.flags|=4)};function sa(r,s){if(!et)switch(r.tailMode){case"hidden":s=r.tail;for(var a=null;s!==null;)s.alternate!==null&&(a=s),s=s.sibling;a===null?r.tail=null:a.sibling=null;break;case"collapsed":a=r.tail;for(var u=null;a!==null;)a.alternate!==null&&(u=a),a=a.sibling;u===null?s||r.tail===null?r.tail=null:r.tail.sibling=null:u.sibling=null}}function zt(r){var s=r.alternate!==null&&r.alternate.child===r.child,a=0,u=0;if(s)for(var f=r.child;f!==null;)a|=f.lanes|f.childLanes,u|=f.subtreeFlags&14680064,u|=f.flags&14680064,f.return=r,f=f.sibling;else for(f=r.child;f!==null;)a|=f.lanes|f.childLanes,u|=f.subtreeFlags,u|=f.flags,f.return=r,f=f.sibling;return r.subtreeFlags|=u,r.childLanes=a,s}function Eb(r,s,a){var u=s.pendingProps;switch(ld(s),s.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return zt(s),null;case 1:return cn(s.type)&&$c(),zt(s),null;case 3:return u=s.stateNode,zo(),Xe(an),Xe(Ut),Ed(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(r===null||r.child===null)&&(qc(s)?s.flags|=4:r===null||r.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Jn!==null&&(Zd(Jn),Jn=null))),zd(r,s),zt(s),null;case 5:wd(s);var f=$s(Zi.current);if(a=s.type,r!==null&&s.stateNode!=null)ev(r,s,a,u,f),r.ref!==s.ref&&(s.flags|=512,s.flags|=2097152);else{if(!u){if(s.stateNode===null)throw Error(n(166));return zt(s),null}if(r=$s(dr.current),qc(s)){u=s.stateNode,a=s.type;var m=s.memoizedProps;switch(u[fr]=s,u[Qi]=m,r=(s.mode&1)!==0,a){case"dialog":Ye("cancel",u),Ye("close",u);break;case"iframe":case"object":case"embed":Ye("load",u);break;case"video":case"audio":for(f=0;f<Wi.length;f++)Ye(Wi[f],u);break;case"source":Ye("error",u);break;case"img":case"image":case"link":Ye("error",u),Ye("load",u);break;case"details":Ye("toggle",u);break;case"input":mc(u,m),Ye("invalid",u);break;case"select":u._wrapperState={wasMultiple:!!m.multiple},Ye("invalid",u);break;case"textarea":pc(u,m),Ye("invalid",u)}kf(a,m),f=null;for(var x in m)if(m.hasOwnProperty(x)){var b=m[x];x==="children"?typeof b=="string"?u.textContent!==b&&(m.suppressHydrationWarning!==!0&&Nc(u.textContent,b,r),f=["children",b]):typeof b=="number"&&u.textContent!==""+b&&(m.suppressHydrationWarning!==!0&&Nc(u.textContent,b,r),f=["children",""+b]):i.hasOwnProperty(x)&&b!=null&&x==="onScroll"&&Ye("scroll",u)}switch(a){case"input":on(u),Pr(u,m,!0);break;case"textarea":on(u),Be(u);break;case"select":case"option":break;default:typeof m.onClick=="function"&&(u.onclick=Dc)}u=f,s.updateQueue=u,u!==null&&(s.flags|=4)}else{x=f.nodeType===9?f:f.ownerDocument,r==="http://www.w3.org/1999/xhtml"&&(r=Lt(a)),r==="http://www.w3.org/1999/xhtml"?a==="script"?(r=x.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild)):typeof u.is=="string"?r=x.createElement(a,{is:u.is}):(r=x.createElement(a),a==="select"&&(x=r,u.multiple?x.multiple=!0:u.size&&(x.size=u.size))):r=x.createElementNS(r,a),r[fr]=s,r[Qi]=u,Zy(r,s,!1,!1),s.stateNode=r;e:{switch(x=Ef(a,u),a){case"dialog":Ye("cancel",r),Ye("close",r),f=u;break;case"iframe":case"object":case"embed":Ye("load",r),f=u;break;case"video":case"audio":for(f=0;f<Wi.length;f++)Ye(Wi[f],r);f=u;break;case"source":Ye("error",r),f=u;break;case"img":case"image":case"link":Ye("error",r),Ye("load",r),f=u;break;case"details":Ye("toggle",r),f=u;break;case"input":mc(r,u),f=Wr(r,u),Ye("invalid",r);break;case"option":f=u;break;case"select":r._wrapperState={wasMultiple:!!u.multiple},f=te({},u,{value:void 0}),Ye("invalid",r);break;case"textarea":pc(r,u),f=ko(r,u),Ye("invalid",r);break;default:f=u}kf(a,f),b=f;for(m in b)if(b.hasOwnProperty(m)){var R=b[m];m==="style"?qg(r,R):m==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,R!=null&&zg(r,R)):m==="children"?typeof R=="string"?(a!=="textarea"||R!=="")&&bi(r,R):typeof R=="number"&&bi(r,""+R):m!=="suppressContentEditableWarning"&&m!=="suppressHydrationWarning"&&m!=="autoFocus"&&(i.hasOwnProperty(m)?R!=null&&m==="onScroll"&&Ye("scroll",r):R!=null&&O(r,m,R,x))}switch(a){case"input":on(r),Pr(r,u,!1);break;case"textarea":on(r),Be(r);break;case"option":u.value!=null&&r.setAttribute("value",""+xe(u.value));break;case"select":r.multiple=!!u.multiple,m=u.value,m!=null?Hr(r,!!u.multiple,m,!1):u.defaultValue!=null&&Hr(r,!!u.multiple,u.defaultValue,!0);break;default:typeof f.onClick=="function"&&(r.onclick=Dc)}switch(a){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}}u&&(s.flags|=4)}s.ref!==null&&(s.flags|=512,s.flags|=2097152)}return zt(s),null;case 6:if(r&&s.stateNode!=null)tv(r,s,r.memoizedProps,u);else{if(typeof u!="string"&&s.stateNode===null)throw Error(n(166));if(a=$s(Zi.current),$s(dr.current),qc(s)){if(u=s.stateNode,a=s.memoizedProps,u[fr]=s,(m=u.nodeValue!==a)&&(r=En,r!==null))switch(r.tag){case 3:Nc(u.nodeValue,a,(r.mode&1)!==0);break;case 5:r.memoizedProps.suppressHydrationWarning!==!0&&Nc(u.nodeValue,a,(r.mode&1)!==0)}m&&(s.flags|=4)}else u=(a.nodeType===9?a:a.ownerDocument).createTextNode(u),u[fr]=s,s.stateNode=u}return zt(s),null;case 13:if(Xe(st),u=s.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(et&&_n!==null&&(s.mode&1)!==0&&(s.flags&128)===0)sy(),jo(),s.flags|=98560,m=!1;else if(m=qc(s),u!==null&&u.dehydrated!==null){if(r===null){if(!m)throw Error(n(318));if(m=s.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(n(317));m[fr]=s}else jo(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;zt(s),m=!1}else Jn!==null&&(Zd(Jn),Jn=null),m=!0;if(!m)return s.flags&65536?s:null}return(s.flags&128)!==0?(s.lanes=a,s):(u=u!==null,u!==(r!==null&&r.memoizedState!==null)&&u&&(s.child.flags|=8192,(s.mode&1)!==0&&(r===null||(st.current&1)!==0?xt===0&&(xt=3):nh())),s.updateQueue!==null&&(s.flags|=4),zt(s),null);case 4:return zo(),zd(r,s),r===null&&Hi(s.stateNode.containerInfo),zt(s),null;case 10:return gd(s.type._context),zt(s),null;case 17:return cn(s.type)&&$c(),zt(s),null;case 19:if(Xe(st),m=s.memoizedState,m===null)return zt(s),null;if(u=(s.flags&128)!==0,x=m.rendering,x===null)if(u)sa(m,!1);else{if(xt!==0||r!==null&&(r.flags&128)!==0)for(r=s.child;r!==null;){if(x=Gc(r),x!==null){for(s.flags|=128,sa(m,!1),u=x.updateQueue,u!==null&&(s.updateQueue=u,s.flags|=4),s.subtreeFlags=0,u=a,a=s.child;a!==null;)m=a,r=u,m.flags&=14680066,x=m.alternate,x===null?(m.childLanes=0,m.lanes=r,m.child=null,m.subtreeFlags=0,m.memoizedProps=null,m.memoizedState=null,m.updateQueue=null,m.dependencies=null,m.stateNode=null):(m.childLanes=x.childLanes,m.lanes=x.lanes,m.child=x.child,m.subtreeFlags=0,m.deletions=null,m.memoizedProps=x.memoizedProps,m.memoizedState=x.memoizedState,m.updateQueue=x.updateQueue,m.type=x.type,r=x.dependencies,m.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),a=a.sibling;return Ke(st,st.current&1|2),s.child}r=r.sibling}m.tail!==null&&ft()>Ho&&(s.flags|=128,u=!0,sa(m,!1),s.lanes=4194304)}else{if(!u)if(r=Gc(x),r!==null){if(s.flags|=128,u=!0,a=r.updateQueue,a!==null&&(s.updateQueue=a,s.flags|=4),sa(m,!0),m.tail===null&&m.tailMode==="hidden"&&!x.alternate&&!et)return zt(s),null}else 2*ft()-m.renderingStartTime>Ho&&a!==1073741824&&(s.flags|=128,u=!0,sa(m,!1),s.lanes=4194304);m.isBackwards?(x.sibling=s.child,s.child=x):(a=m.last,a!==null?a.sibling=x:s.child=x,m.last=x)}return m.tail!==null?(s=m.tail,m.rendering=s,m.tail=s.sibling,m.renderingStartTime=ft(),s.sibling=null,a=st.current,Ke(st,u?a&1|2:a&1),s):(zt(s),null);case 22:case 23:return th(),u=s.memoizedState!==null,r!==null&&r.memoizedState!==null!==u&&(s.flags|=8192),u&&(s.mode&1)!==0?(Cn&1073741824)!==0&&(zt(s),s.subtreeFlags&6&&(s.flags|=8192)):zt(s),null;case 24:return null;case 25:return null}throw Error(n(156,s.tag))}function _b(r,s){switch(ld(s),s.tag){case 1:return cn(s.type)&&$c(),r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 3:return zo(),Xe(an),Xe(Ut),Ed(),r=s.flags,(r&65536)!==0&&(r&128)===0?(s.flags=r&-65537|128,s):null;case 5:return wd(s),null;case 13:if(Xe(st),r=s.memoizedState,r!==null&&r.dehydrated!==null){if(s.alternate===null)throw Error(n(340));jo()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 19:return Xe(st),null;case 4:return zo(),null;case 10:return gd(s.type._context),null;case 22:case 23:return th(),null;case 24:return null;default:return null}}var ou=!1,Vt=!1,Cb=typeof WeakSet=="function"?WeakSet:Set,ge=null;function qo(r,s){var a=r.ref;if(a!==null)if(typeof a=="function")try{a(null)}catch(u){at(r,s,u)}else a.current=null}function Vd(r,s,a){try{a()}catch(u){at(r,s,u)}}var nv=!1;function bb(r,s){if(td=Cc,r=L0(),Kf(r)){if("selectionStart"in r)var a={start:r.selectionStart,end:r.selectionEnd};else e:{a=(a=r.ownerDocument)&&a.defaultView||window;var u=a.getSelection&&a.getSelection();if(u&&u.rangeCount!==0){a=u.anchorNode;var f=u.anchorOffset,m=u.focusNode;u=u.focusOffset;try{a.nodeType,m.nodeType}catch{a=null;break e}var x=0,b=-1,R=-1,G=0,ie=0,ae=r,oe=null;t:for(;;){for(var he;ae!==a||f!==0&&ae.nodeType!==3||(b=x+f),ae!==m||u!==0&&ae.nodeType!==3||(R=x+u),ae.nodeType===3&&(x+=ae.nodeValue.length),(he=ae.firstChild)!==null;)oe=ae,ae=he;for(;;){if(ae===r)break t;if(oe===a&&++G===f&&(b=x),oe===m&&++ie===u&&(R=x),(he=ae.nextSibling)!==null)break;ae=oe,oe=ae.parentNode}ae=he}a=b===-1||R===-1?null:{start:b,end:R}}else a=null}a=a||{start:0,end:0}}else a=null;for(nd={focusedElem:r,selectionRange:a},Cc=!1,ge=s;ge!==null;)if(s=ge,r=s.child,(s.subtreeFlags&1028)!==0&&r!==null)r.return=s,ge=r;else for(;ge!==null;){s=ge;try{var ye=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(ye!==null){var ve=ye.memoizedProps,dt=ye.memoizedState,z=s.stateNode,A=z.getSnapshotBeforeUpdate(s.elementType===s.type?ve:Gn(s.type,ve),dt);z.__reactInternalSnapshotBeforeUpdate=A}break;case 3:var W=s.stateNode.containerInfo;W.nodeType===1?W.textContent="":W.nodeType===9&&W.documentElement&&W.removeChild(W.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ce){at(s,s.return,ce)}if(r=s.sibling,r!==null){r.return=s.return,ge=r;break}ge=s.return}return ye=nv,nv=!1,ye}function oa(r,s,a){var u=s.updateQueue;if(u=u!==null?u.lastEffect:null,u!==null){var f=u=u.next;do{if((f.tag&r)===r){var m=f.destroy;f.destroy=void 0,m!==void 0&&Vd(s,a,m)}f=f.next}while(f!==u)}}function iu(r,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var a=s=s.next;do{if((a.tag&r)===r){var u=a.create;a.destroy=u()}a=a.next}while(a!==s)}}function qd(r){var s=r.ref;if(s!==null){var a=r.stateNode;switch(r.tag){case 5:r=a;break;default:r=a}typeof s=="function"?s(r):s.current=r}}function rv(r){var s=r.alternate;s!==null&&(r.alternate=null,rv(s)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(s=r.stateNode,s!==null&&(delete s[fr],delete s[Qi],delete s[id],delete s[cb],delete s[ub])),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}function sv(r){return r.tag===5||r.tag===3||r.tag===4}function ov(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||sv(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Wd(r,s,a){var u=r.tag;if(u===5||u===6)r=r.stateNode,s?a.nodeType===8?a.parentNode.insertBefore(r,s):a.insertBefore(r,s):(a.nodeType===8?(s=a.parentNode,s.insertBefore(r,a)):(s=a,s.appendChild(r)),a=a._reactRootContainer,a!=null||s.onclick!==null||(s.onclick=Dc));else if(u!==4&&(r=r.child,r!==null))for(Wd(r,s,a),r=r.sibling;r!==null;)Wd(r,s,a),r=r.sibling}function Hd(r,s,a){var u=r.tag;if(u===5||u===6)r=r.stateNode,s?a.insertBefore(r,s):a.appendChild(r);else if(u!==4&&(r=r.child,r!==null))for(Hd(r,s,a),r=r.sibling;r!==null;)Hd(r,s,a),r=r.sibling}var Ot=null,Yn=!1;function os(r,s,a){for(a=a.child;a!==null;)iv(r,s,a),a=a.sibling}function iv(r,s,a){if(lr&&typeof lr.onCommitFiberUnmount=="function")try{lr.onCommitFiberUnmount(Sc,a)}catch{}switch(a.tag){case 5:Vt||qo(a,s);case 6:var u=Ot,f=Yn;Ot=null,os(r,s,a),Ot=u,Yn=f,Ot!==null&&(Yn?(r=Ot,a=a.stateNode,r.nodeType===8?r.parentNode.removeChild(a):r.removeChild(a)):Ot.removeChild(a.stateNode));break;case 18:Ot!==null&&(Yn?(r=Ot,a=a.stateNode,r.nodeType===8?od(r.parentNode,a):r.nodeType===1&&od(r,a),Di(r)):od(Ot,a.stateNode));break;case 4:u=Ot,f=Yn,Ot=a.stateNode.containerInfo,Yn=!0,os(r,s,a),Ot=u,Yn=f;break;case 0:case 11:case 14:case 15:if(!Vt&&(u=a.updateQueue,u!==null&&(u=u.lastEffect,u!==null))){f=u=u.next;do{var m=f,x=m.destroy;m=m.tag,x!==void 0&&((m&2)!==0||(m&4)!==0)&&Vd(a,s,x),f=f.next}while(f!==u)}os(r,s,a);break;case 1:if(!Vt&&(qo(a,s),u=a.stateNode,typeof u.componentWillUnmount=="function"))try{u.props=a.memoizedProps,u.state=a.memoizedState,u.componentWillUnmount()}catch(b){at(a,s,b)}os(r,s,a);break;case 21:os(r,s,a);break;case 22:a.mode&1?(Vt=(u=Vt)||a.memoizedState!==null,os(r,s,a),Vt=u):os(r,s,a);break;default:os(r,s,a)}}function av(r){var s=r.updateQueue;if(s!==null){r.updateQueue=null;var a=r.stateNode;a===null&&(a=r.stateNode=new Cb),s.forEach(function(u){var f=Ob.bind(null,r,u);a.has(u)||(a.add(u),u.then(f,f))})}}function Xn(r,s){var a=s.deletions;if(a!==null)for(var u=0;u<a.length;u++){var f=a[u];try{var m=r,x=s,b=x;e:for(;b!==null;){switch(b.tag){case 5:Ot=b.stateNode,Yn=!1;break e;case 3:Ot=b.stateNode.containerInfo,Yn=!0;break e;case 4:Ot=b.stateNode.containerInfo,Yn=!0;break e}b=b.return}if(Ot===null)throw Error(n(160));iv(m,x,f),Ot=null,Yn=!1;var R=f.alternate;R!==null&&(R.return=null),f.return=null}catch(G){at(f,s,G)}}if(s.subtreeFlags&12854)for(s=s.child;s!==null;)cv(s,r),s=s.sibling}function cv(r,s){var a=r.alternate,u=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:if(Xn(s,r),mr(r),u&4){try{oa(3,r,r.return),iu(3,r)}catch(ve){at(r,r.return,ve)}try{oa(5,r,r.return)}catch(ve){at(r,r.return,ve)}}break;case 1:Xn(s,r),mr(r),u&512&&a!==null&&qo(a,a.return);break;case 5:if(Xn(s,r),mr(r),u&512&&a!==null&&qo(a,a.return),r.flags&32){var f=r.stateNode;try{bi(f,"")}catch(ve){at(r,r.return,ve)}}if(u&4&&(f=r.stateNode,f!=null)){var m=r.memoizedProps,x=a!==null?a.memoizedProps:m,b=r.type,R=r.updateQueue;if(r.updateQueue=null,R!==null)try{b==="input"&&m.type==="radio"&&m.name!=null&&_i(f,m),Ef(b,x);var G=Ef(b,m);for(x=0;x<R.length;x+=2){var ie=R[x],ae=R[x+1];ie==="style"?qg(f,ae):ie==="dangerouslySetInnerHTML"?zg(f,ae):ie==="children"?bi(f,ae):O(f,ie,ae,G)}switch(b){case"input":wo(f,m);break;case"textarea":Ci(f,m);break;case"select":var oe=f._wrapperState.wasMultiple;f._wrapperState.wasMultiple=!!m.multiple;var he=m.value;he!=null?Hr(f,!!m.multiple,he,!1):oe!==!!m.multiple&&(m.defaultValue!=null?Hr(f,!!m.multiple,m.defaultValue,!0):Hr(f,!!m.multiple,m.multiple?[]:"",!1))}f[Qi]=m}catch(ve){at(r,r.return,ve)}}break;case 6:if(Xn(s,r),mr(r),u&4){if(r.stateNode===null)throw Error(n(162));f=r.stateNode,m=r.memoizedProps;try{f.nodeValue=m}catch(ve){at(r,r.return,ve)}}break;case 3:if(Xn(s,r),mr(r),u&4&&a!==null&&a.memoizedState.isDehydrated)try{Di(s.containerInfo)}catch(ve){at(r,r.return,ve)}break;case 4:Xn(s,r),mr(r);break;case 13:Xn(s,r),mr(r),f=r.child,f.flags&8192&&(m=f.memoizedState!==null,f.stateNode.isHidden=m,!m||f.alternate!==null&&f.alternate.memoizedState!==null||(Jd=ft())),u&4&&av(r);break;case 22:if(ie=a!==null&&a.memoizedState!==null,r.mode&1?(Vt=(G=Vt)||ie,Xn(s,r),Vt=G):Xn(s,r),mr(r),u&8192){if(G=r.memoizedState!==null,(r.stateNode.isHidden=G)&&!ie&&(r.mode&1)!==0)for(ge=r,ie=r.child;ie!==null;){for(ae=ge=ie;ge!==null;){switch(oe=ge,he=oe.child,oe.tag){case 0:case 11:case 14:case 15:oa(4,oe,oe.return);break;case 1:qo(oe,oe.return);var ye=oe.stateNode;if(typeof ye.componentWillUnmount=="function"){u=oe,a=oe.return;try{s=u,ye.props=s.memoizedProps,ye.state=s.memoizedState,ye.componentWillUnmount()}catch(ve){at(u,a,ve)}}break;case 5:qo(oe,oe.return);break;case 22:if(oe.memoizedState!==null){fv(ae);continue}}he!==null?(he.return=oe,ge=he):fv(ae)}ie=ie.sibling}e:for(ie=null,ae=r;;){if(ae.tag===5){if(ie===null){ie=ae;try{f=ae.stateNode,G?(m=f.style,typeof m.setProperty=="function"?m.setProperty("display","none","important"):m.display="none"):(b=ae.stateNode,R=ae.memoizedProps.style,x=R!=null&&R.hasOwnProperty("display")?R.display:null,b.style.display=Vg("display",x))}catch(ve){at(r,r.return,ve)}}}else if(ae.tag===6){if(ie===null)try{ae.stateNode.nodeValue=G?"":ae.memoizedProps}catch(ve){at(r,r.return,ve)}}else if((ae.tag!==22&&ae.tag!==23||ae.memoizedState===null||ae===r)&&ae.child!==null){ae.child.return=ae,ae=ae.child;continue}if(ae===r)break e;for(;ae.sibling===null;){if(ae.return===null||ae.return===r)break e;ie===ae&&(ie=null),ae=ae.return}ie===ae&&(ie=null),ae.sibling.return=ae.return,ae=ae.sibling}}break;case 19:Xn(s,r),mr(r),u&4&&av(r);break;case 21:break;default:Xn(s,r),mr(r)}}function mr(r){var s=r.flags;if(s&2){try{e:{for(var a=r.return;a!==null;){if(sv(a)){var u=a;break e}a=a.return}throw Error(n(160))}switch(u.tag){case 5:var f=u.stateNode;u.flags&32&&(bi(f,""),u.flags&=-33);var m=ov(r);Hd(r,m,f);break;case 3:case 4:var x=u.stateNode.containerInfo,b=ov(r);Wd(r,b,x);break;default:throw Error(n(161))}}catch(R){at(r,r.return,R)}r.flags&=-3}s&4096&&(r.flags&=-4097)}function Pb(r,s,a){ge=r,uv(r)}function uv(r,s,a){for(var u=(r.mode&1)!==0;ge!==null;){var f=ge,m=f.child;if(f.tag===22&&u){var x=f.memoizedState!==null||ou;if(!x){var b=f.alternate,R=b!==null&&b.memoizedState!==null||Vt;b=ou;var G=Vt;if(ou=x,(Vt=R)&&!G)for(ge=f;ge!==null;)x=ge,R=x.child,x.tag===22&&x.memoizedState!==null?dv(f):R!==null?(R.return=x,ge=R):dv(f);for(;m!==null;)ge=m,uv(m),m=m.sibling;ge=f,ou=b,Vt=G}lv(r)}else(f.subtreeFlags&8772)!==0&&m!==null?(m.return=f,ge=m):lv(r)}}function lv(r){for(;ge!==null;){var s=ge;if((s.flags&8772)!==0){var a=s.alternate;try{if((s.flags&8772)!==0)switch(s.tag){case 0:case 11:case 15:Vt||iu(5,s);break;case 1:var u=s.stateNode;if(s.flags&4&&!Vt)if(a===null)u.componentDidMount();else{var f=s.elementType===s.type?a.memoizedProps:Gn(s.type,a.memoizedProps);u.componentDidUpdate(f,a.memoizedState,u.__reactInternalSnapshotBeforeUpdate)}var m=s.updateQueue;m!==null&&fy(s,m,u);break;case 3:var x=s.updateQueue;if(x!==null){if(a=null,s.child!==null)switch(s.child.tag){case 5:a=s.child.stateNode;break;case 1:a=s.child.stateNode}fy(s,x,a)}break;case 5:var b=s.stateNode;if(a===null&&s.flags&4){a=b;var R=s.memoizedProps;switch(s.type){case"button":case"input":case"select":case"textarea":R.autoFocus&&a.focus();break;case"img":R.src&&(a.src=R.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(s.memoizedState===null){var G=s.alternate;if(G!==null){var ie=G.memoizedState;if(ie!==null){var ae=ie.dehydrated;ae!==null&&Di(ae)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Vt||s.flags&512&&qd(s)}catch(oe){at(s,s.return,oe)}}if(s===r){ge=null;break}if(a=s.sibling,a!==null){a.return=s.return,ge=a;break}ge=s.return}}function fv(r){for(;ge!==null;){var s=ge;if(s===r){ge=null;break}var a=s.sibling;if(a!==null){a.return=s.return,ge=a;break}ge=s.return}}function dv(r){for(;ge!==null;){var s=ge;try{switch(s.tag){case 0:case 11:case 15:var a=s.return;try{iu(4,s)}catch(R){at(s,a,R)}break;case 1:var u=s.stateNode;if(typeof u.componentDidMount=="function"){var f=s.return;try{u.componentDidMount()}catch(R){at(s,f,R)}}var m=s.return;try{qd(s)}catch(R){at(s,m,R)}break;case 5:var x=s.return;try{qd(s)}catch(R){at(s,x,R)}}}catch(R){at(s,s.return,R)}if(s===r){ge=null;break}var b=s.sibling;if(b!==null){b.return=s.return,ge=b;break}ge=s.return}}var Fb=Math.ceil,au=C.ReactCurrentDispatcher,Kd=C.ReactCurrentOwner,Dn=C.ReactCurrentBatchConfig,De=0,Ct=null,vt=null,Nt=0,Cn=0,Wo=es(0),xt=0,ia=null,Bs=0,cu=0,Qd=0,aa=null,ln=null,Jd=0,Ho=1/0,Or=null,uu=!1,Gd=null,is=null,lu=!1,as=null,fu=0,ca=0,Yd=null,du=-1,hu=0;function Xt(){return(De&6)!==0?ft():du!==-1?du:du=ft()}function cs(r){return(r.mode&1)===0?1:(De&2)!==0&&Nt!==0?Nt&-Nt:fb.transition!==null?(hu===0&&(hu=o0()),hu):(r=ze,r!==0||(r=window.event,r=r===void 0?16:m0(r.type)),r)}function Zn(r,s,a,u){if(50<ca)throw ca=0,Yd=null,Error(n(185));Ai(r,a,u),((De&2)===0||r!==Ct)&&(r===Ct&&((De&2)===0&&(cu|=a),xt===4&&us(r,Nt)),fn(r,u),a===1&&De===0&&(s.mode&1)===0&&(Ho=ft()+500,Bc&&ns()))}function fn(r,s){var a=r.callbackNode;fC(r,s);var u=kc(r,r===Ct?Nt:0);if(u===0)a!==null&&n0(a),r.callbackNode=null,r.callbackPriority=0;else if(s=u&-u,r.callbackPriority!==s){if(a!=null&&n0(a),s===1)r.tag===0?lb(mv.bind(null,r)):Z0(mv.bind(null,r)),ib(function(){(De&6)===0&&ns()}),a=null;else{switch(i0(u)){case 1:a=Rf;break;case 4:a=r0;break;case 16:a=vc;break;case 536870912:a=s0;break;default:a=vc}a=kv(a,hv.bind(null,r))}r.callbackPriority=s,r.callbackNode=a}}function hv(r,s){if(du=-1,hu=0,(De&6)!==0)throw Error(n(327));var a=r.callbackNode;if(Ko()&&r.callbackNode!==a)return null;var u=kc(r,r===Ct?Nt:0);if(u===0)return null;if((u&30)!==0||(u&r.expiredLanes)!==0||s)s=mu(r,u);else{s=u;var f=De;De|=2;var m=gv();(Ct!==r||Nt!==s)&&(Or=null,Ho=ft()+500,Vs(r,s));do try{Tb();break}catch(b){pv(r,b)}while(!0);pd(),au.current=m,De=f,vt!==null?s=0:(Ct=null,Nt=0,s=xt)}if(s!==0){if(s===2&&(f=Tf(r),f!==0&&(u=f,s=Xd(r,f))),s===1)throw a=ia,Vs(r,0),us(r,u),fn(r,ft()),a;if(s===6)us(r,u);else{if(f=r.current.alternate,(u&30)===0&&!Ib(f)&&(s=mu(r,u),s===2&&(m=Tf(r),m!==0&&(u=m,s=Xd(r,m))),s===1))throw a=ia,Vs(r,0),us(r,u),fn(r,ft()),a;switch(r.finishedWork=f,r.finishedLanes=u,s){case 0:case 1:throw Error(n(345));case 2:qs(r,ln,Or);break;case 3:if(us(r,u),(u&130023424)===u&&(s=Jd+500-ft(),10<s)){if(kc(r,0)!==0)break;if(f=r.suspendedLanes,(f&u)!==u){Xt(),r.pingedLanes|=r.suspendedLanes&f;break}r.timeoutHandle=sd(qs.bind(null,r,ln,Or),s);break}qs(r,ln,Or);break;case 4:if(us(r,u),(u&4194240)===u)break;for(s=r.eventTimes,f=-1;0<u;){var x=31-Kn(u);m=1<<x,x=s[x],x>f&&(f=x),u&=~m}if(u=f,u=ft()-u,u=(120>u?120:480>u?480:1080>u?1080:1920>u?1920:3e3>u?3e3:4320>u?4320:1960*Fb(u/1960))-u,10<u){r.timeoutHandle=sd(qs.bind(null,r,ln,Or),u);break}qs(r,ln,Or);break;case 5:qs(r,ln,Or);break;default:throw Error(n(329))}}}return fn(r,ft()),r.callbackNode===a?hv.bind(null,r):null}function Xd(r,s){var a=aa;return r.current.memoizedState.isDehydrated&&(Vs(r,s).flags|=256),r=mu(r,s),r!==2&&(s=ln,ln=a,s!==null&&Zd(s)),r}function Zd(r){ln===null?ln=r:ln.push.apply(ln,r)}function Ib(r){for(var s=r;;){if(s.flags&16384){var a=s.updateQueue;if(a!==null&&(a=a.stores,a!==null))for(var u=0;u<a.length;u++){var f=a[u],m=f.getSnapshot;f=f.value;try{if(!Qn(m(),f))return!1}catch{return!1}}}if(a=s.child,s.subtreeFlags&16384&&a!==null)a.return=s,s=a;else{if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function us(r,s){for(s&=~Qd,s&=~cu,r.suspendedLanes|=s,r.pingedLanes&=~s,r=r.expirationTimes;0<s;){var a=31-Kn(s),u=1<<a;r[a]=-1,s&=~u}}function mv(r){if((De&6)!==0)throw Error(n(327));Ko();var s=kc(r,0);if((s&1)===0)return fn(r,ft()),null;var a=mu(r,s);if(r.tag!==0&&a===2){var u=Tf(r);u!==0&&(s=u,a=Xd(r,u))}if(a===1)throw a=ia,Vs(r,0),us(r,s),fn(r,ft()),a;if(a===6)throw Error(n(345));return r.finishedWork=r.current.alternate,r.finishedLanes=s,qs(r,ln,Or),fn(r,ft()),null}function eh(r,s){var a=De;De|=1;try{return r(s)}finally{De=a,De===0&&(Ho=ft()+500,Bc&&ns())}}function zs(r){as!==null&&as.tag===0&&(De&6)===0&&Ko();var s=De;De|=1;var a=Dn.transition,u=ze;try{if(Dn.transition=null,ze=1,r)return r()}finally{ze=u,Dn.transition=a,De=s,(De&6)===0&&ns()}}function th(){Cn=Wo.current,Xe(Wo)}function Vs(r,s){r.finishedWork=null,r.finishedLanes=0;var a=r.timeoutHandle;if(a!==-1&&(r.timeoutHandle=-1,ob(a)),vt!==null)for(a=vt.return;a!==null;){var u=a;switch(ld(u),u.tag){case 1:u=u.type.childContextTypes,u!=null&&$c();break;case 3:zo(),Xe(an),Xe(Ut),Ed();break;case 5:wd(u);break;case 4:zo();break;case 13:Xe(st);break;case 19:Xe(st);break;case 10:gd(u.type._context);break;case 22:case 23:th()}a=a.return}if(Ct=r,vt=r=ls(r.current,null),Nt=Cn=s,xt=0,ia=null,Qd=cu=Bs=0,ln=aa=null,js!==null){for(s=0;s<js.length;s++)if(a=js[s],u=a.interleaved,u!==null){a.interleaved=null;var f=u.next,m=a.pending;if(m!==null){var x=m.next;m.next=f,u.next=x}a.pending=u}js=null}return r}function pv(r,s){do{var a=vt;try{if(pd(),Yc.current=tu,Xc){for(var u=ot.memoizedState;u!==null;){var f=u.queue;f!==null&&(f.pending=null),u=u.next}Xc=!1}if(Us=0,_t=St=ot=null,ea=!1,ta=0,Kd.current=null,a===null||a.return===null){xt=1,ia=s,vt=null;break}e:{var m=r,x=a.return,b=a,R=s;if(s=Nt,b.flags|=32768,R!==null&&typeof R=="object"&&typeof R.then=="function"){var G=R,ie=b,ae=ie.tag;if((ie.mode&1)===0&&(ae===0||ae===11||ae===15)){var oe=ie.alternate;oe?(ie.updateQueue=oe.updateQueue,ie.memoizedState=oe.memoizedState,ie.lanes=oe.lanes):(ie.updateQueue=null,ie.memoizedState=null)}var he=Uy(x);if(he!==null){he.flags&=-257,By(he,x,b,m,s),he.mode&1&&$y(m,G,s),s=he,R=G;var ye=s.updateQueue;if(ye===null){var ve=new Set;ve.add(R),s.updateQueue=ve}else ye.add(R);break e}else{if((s&1)===0){$y(m,G,s),nh();break e}R=Error(n(426))}}else if(et&&b.mode&1){var dt=Uy(x);if(dt!==null){(dt.flags&65536)===0&&(dt.flags|=256),By(dt,x,b,m,s),hd(Vo(R,b));break e}}m=R=Vo(R,b),xt!==4&&(xt=2),aa===null?aa=[m]:aa.push(m),m=x;do{switch(m.tag){case 3:m.flags|=65536,s&=-s,m.lanes|=s;var z=Dy(m,R,s);ly(m,z);break e;case 1:b=R;var A=m.type,W=m.stateNode;if((m.flags&128)===0&&(typeof A.getDerivedStateFromError=="function"||W!==null&&typeof W.componentDidCatch=="function"&&(is===null||!is.has(W)))){m.flags|=65536,s&=-s,m.lanes|=s;var ce=jy(m,b,s);ly(m,ce);break e}}m=m.return}while(m!==null)}vv(a)}catch(Se){s=Se,vt===a&&a!==null&&(vt=a=a.return);continue}break}while(!0)}function gv(){var r=au.current;return au.current=tu,r===null?tu:r}function nh(){(xt===0||xt===3||xt===2)&&(xt=4),Ct===null||(Bs&268435455)===0&&(cu&268435455)===0||us(Ct,Nt)}function mu(r,s){var a=De;De|=2;var u=gv();(Ct!==r||Nt!==s)&&(Or=null,Vs(r,s));do try{Rb();break}catch(f){pv(r,f)}while(!0);if(pd(),De=a,au.current=u,vt!==null)throw Error(n(261));return Ct=null,Nt=0,xt}function Rb(){for(;vt!==null;)yv(vt)}function Tb(){for(;vt!==null&&!nC();)yv(vt)}function yv(r){var s=wv(r.alternate,r,Cn);r.memoizedProps=r.pendingProps,s===null?vv(r):vt=s,Kd.current=null}function vv(r){var s=r;do{var a=s.alternate;if(r=s.return,(s.flags&32768)===0){if(a=Eb(a,s,Cn),a!==null){vt=a;return}}else{if(a=_b(a,s),a!==null){a.flags&=32767,vt=a;return}if(r!==null)r.flags|=32768,r.subtreeFlags=0,r.deletions=null;else{xt=6,vt=null;return}}if(s=s.sibling,s!==null){vt=s;return}vt=s=r}while(s!==null);xt===0&&(xt=5)}function qs(r,s,a){var u=ze,f=Dn.transition;try{Dn.transition=null,ze=1,Ab(r,s,a,u)}finally{Dn.transition=f,ze=u}return null}function Ab(r,s,a,u){do Ko();while(as!==null);if((De&6)!==0)throw Error(n(327));a=r.finishedWork;var f=r.finishedLanes;if(a===null)return null;if(r.finishedWork=null,r.finishedLanes=0,a===r.current)throw Error(n(177));r.callbackNode=null,r.callbackPriority=0;var m=a.lanes|a.childLanes;if(dC(r,m),r===Ct&&(vt=Ct=null,Nt=0),(a.subtreeFlags&2064)===0&&(a.flags&2064)===0||lu||(lu=!0,kv(vc,function(){return Ko(),null})),m=(a.flags&15990)!==0,(a.subtreeFlags&15990)!==0||m){m=Dn.transition,Dn.transition=null;var x=ze;ze=1;var b=De;De|=4,Kd.current=null,bb(r,a),cv(a,r),XC(nd),Cc=!!td,nd=td=null,r.current=a,Pb(a),rC(),De=b,ze=x,Dn.transition=m}else r.current=a;if(lu&&(lu=!1,as=r,fu=f),m=r.pendingLanes,m===0&&(is=null),iC(a.stateNode),fn(r,ft()),s!==null)for(u=r.onRecoverableError,a=0;a<s.length;a++)f=s[a],u(f.value,{componentStack:f.stack,digest:f.digest});if(uu)throw uu=!1,r=Gd,Gd=null,r;return(fu&1)!==0&&r.tag!==0&&Ko(),m=r.pendingLanes,(m&1)!==0?r===Yd?ca++:(ca=0,Yd=r):ca=0,ns(),null}function Ko(){if(as!==null){var r=i0(fu),s=Dn.transition,a=ze;try{if(Dn.transition=null,ze=16>r?16:r,as===null)var u=!1;else{if(r=as,as=null,fu=0,(De&6)!==0)throw Error(n(331));var f=De;for(De|=4,ge=r.current;ge!==null;){var m=ge,x=m.child;if((ge.flags&16)!==0){var b=m.deletions;if(b!==null){for(var R=0;R<b.length;R++){var G=b[R];for(ge=G;ge!==null;){var ie=ge;switch(ie.tag){case 0:case 11:case 15:oa(8,ie,m)}var ae=ie.child;if(ae!==null)ae.return=ie,ge=ae;else for(;ge!==null;){ie=ge;var oe=ie.sibling,he=ie.return;if(rv(ie),ie===G){ge=null;break}if(oe!==null){oe.return=he,ge=oe;break}ge=he}}}var ye=m.alternate;if(ye!==null){var ve=ye.child;if(ve!==null){ye.child=null;do{var dt=ve.sibling;ve.sibling=null,ve=dt}while(ve!==null)}}ge=m}}if((m.subtreeFlags&2064)!==0&&x!==null)x.return=m,ge=x;else e:for(;ge!==null;){if(m=ge,(m.flags&2048)!==0)switch(m.tag){case 0:case 11:case 15:oa(9,m,m.return)}var z=m.sibling;if(z!==null){z.return=m.return,ge=z;break e}ge=m.return}}var A=r.current;for(ge=A;ge!==null;){x=ge;var W=x.child;if((x.subtreeFlags&2064)!==0&&W!==null)W.return=x,ge=W;else e:for(x=A;ge!==null;){if(b=ge,(b.flags&2048)!==0)try{switch(b.tag){case 0:case 11:case 15:iu(9,b)}}catch(Se){at(b,b.return,Se)}if(b===x){ge=null;break e}var ce=b.sibling;if(ce!==null){ce.return=b.return,ge=ce;break e}ge=b.return}}if(De=f,ns(),lr&&typeof lr.onPostCommitFiberRoot=="function")try{lr.onPostCommitFiberRoot(Sc,r)}catch{}u=!0}return u}finally{ze=a,Dn.transition=s}}return!1}function Sv(r,s,a){s=Vo(a,s),s=Dy(r,s,1),r=ss(r,s,1),s=Xt(),r!==null&&(Ai(r,1,s),fn(r,s))}function at(r,s,a){if(r.tag===3)Sv(r,r,a);else for(;s!==null;){if(s.tag===3){Sv(s,r,a);break}else if(s.tag===1){var u=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(is===null||!is.has(u))){r=Vo(a,r),r=jy(s,r,1),s=ss(s,r,1),r=Xt(),s!==null&&(Ai(s,1,r),fn(s,r));break}}s=s.return}}function Mb(r,s,a){var u=r.pingCache;u!==null&&u.delete(s),s=Xt(),r.pingedLanes|=r.suspendedLanes&a,Ct===r&&(Nt&a)===a&&(xt===4||xt===3&&(Nt&130023424)===Nt&&500>ft()-Jd?Vs(r,0):Qd|=a),fn(r,s)}function xv(r,s){s===0&&((r.mode&1)===0?s=1:(s=wc,wc<<=1,(wc&130023424)===0&&(wc=4194304)));var a=Xt();r=Ar(r,s),r!==null&&(Ai(r,s,a),fn(r,a))}function Lb(r){var s=r.memoizedState,a=0;s!==null&&(a=s.retryLane),xv(r,a)}function Ob(r,s){var a=0;switch(r.tag){case 13:var u=r.stateNode,f=r.memoizedState;f!==null&&(a=f.retryLane);break;case 19:u=r.stateNode;break;default:throw Error(n(314))}u!==null&&u.delete(s),xv(r,a)}var wv;wv=function(r,s,a){if(r!==null)if(r.memoizedProps!==s.pendingProps||an.current)un=!0;else{if((r.lanes&a)===0&&(s.flags&128)===0)return un=!1,kb(r,s,a);un=(r.flags&131072)!==0}else un=!1,et&&(s.flags&1048576)!==0&&ey(s,Vc,s.index);switch(s.lanes=0,s.tag){case 2:var u=s.type;su(r,s),r=s.pendingProps;var f=Oo(s,Ut.current);Bo(s,a),f=bd(null,s,u,r,f,a);var m=Pd();return s.flags|=1,typeof f=="object"&&f!==null&&typeof f.render=="function"&&f.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,cn(u)?(m=!0,Uc(s)):m=!1,s.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,Sd(s),f.updater=nu,s.stateNode=f,f._reactInternals=s,Md(s,u,r,a),s=Dd(null,s,u,!0,m,a)):(s.tag=0,et&&m&&ud(s),Yt(null,s,f,a),s=s.child),s;case 16:u=s.elementType;e:{switch(su(r,s),r=s.pendingProps,f=u._init,u=f(u._payload),s.type=u,f=s.tag=Db(u),r=Gn(u,r),f){case 0:s=Nd(null,s,u,r,a);break e;case 1:s=Ky(null,s,u,r,a);break e;case 11:s=zy(null,s,u,r,a);break e;case 14:s=Vy(null,s,u,Gn(u.type,r),a);break e}throw Error(n(306,u,""))}return s;case 0:return u=s.type,f=s.pendingProps,f=s.elementType===u?f:Gn(u,f),Nd(r,s,u,f,a);case 1:return u=s.type,f=s.pendingProps,f=s.elementType===u?f:Gn(u,f),Ky(r,s,u,f,a);case 3:e:{if(Qy(s),r===null)throw Error(n(387));u=s.pendingProps,m=s.memoizedState,f=m.element,uy(r,s),Jc(s,u,null,a);var x=s.memoizedState;if(u=x.element,m.isDehydrated)if(m={element:u,isDehydrated:!1,cache:x.cache,pendingSuspenseBoundaries:x.pendingSuspenseBoundaries,transitions:x.transitions},s.updateQueue.baseState=m,s.memoizedState=m,s.flags&256){f=Vo(Error(n(423)),s),s=Jy(r,s,u,a,f);break e}else if(u!==f){f=Vo(Error(n(424)),s),s=Jy(r,s,u,a,f);break e}else for(_n=Zr(s.stateNode.containerInfo.firstChild),En=s,et=!0,Jn=null,a=ay(s,null,u,a),s.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(jo(),u===f){s=Lr(r,s,a);break e}Yt(r,s,u,a)}s=s.child}return s;case 5:return dy(s),r===null&&dd(s),u=s.type,f=s.pendingProps,m=r!==null?r.memoizedProps:null,x=f.children,rd(u,f)?x=null:m!==null&&rd(u,m)&&(s.flags|=32),Hy(r,s),Yt(r,s,x,a),s.child;case 6:return r===null&&dd(s),null;case 13:return Gy(r,s,a);case 4:return xd(s,s.stateNode.containerInfo),u=s.pendingProps,r===null?s.child=$o(s,null,u,a):Yt(r,s,u,a),s.child;case 11:return u=s.type,f=s.pendingProps,f=s.elementType===u?f:Gn(u,f),zy(r,s,u,f,a);case 7:return Yt(r,s,s.pendingProps,a),s.child;case 8:return Yt(r,s,s.pendingProps.children,a),s.child;case 12:return Yt(r,s,s.pendingProps.children,a),s.child;case 10:e:{if(u=s.type._context,f=s.pendingProps,m=s.memoizedProps,x=f.value,Ke(Hc,u._currentValue),u._currentValue=x,m!==null)if(Qn(m.value,x)){if(m.children===f.children&&!an.current){s=Lr(r,s,a);break e}}else for(m=s.child,m!==null&&(m.return=s);m!==null;){var b=m.dependencies;if(b!==null){x=m.child;for(var R=b.firstContext;R!==null;){if(R.context===u){if(m.tag===1){R=Mr(-1,a&-a),R.tag=2;var G=m.updateQueue;if(G!==null){G=G.shared;var ie=G.pending;ie===null?R.next=R:(R.next=ie.next,ie.next=R),G.pending=R}}m.lanes|=a,R=m.alternate,R!==null&&(R.lanes|=a),yd(m.return,a,s),b.lanes|=a;break}R=R.next}}else if(m.tag===10)x=m.type===s.type?null:m.child;else if(m.tag===18){if(x=m.return,x===null)throw Error(n(341));x.lanes|=a,b=x.alternate,b!==null&&(b.lanes|=a),yd(x,a,s),x=m.sibling}else x=m.child;if(x!==null)x.return=m;else for(x=m;x!==null;){if(x===s){x=null;break}if(m=x.sibling,m!==null){m.return=x.return,x=m;break}x=x.return}m=x}Yt(r,s,f.children,a),s=s.child}return s;case 9:return f=s.type,u=s.pendingProps.children,Bo(s,a),f=On(f),u=u(f),s.flags|=1,Yt(r,s,u,a),s.child;case 14:return u=s.type,f=Gn(u,s.pendingProps),f=Gn(u.type,f),Vy(r,s,u,f,a);case 15:return qy(r,s,s.type,s.pendingProps,a);case 17:return u=s.type,f=s.pendingProps,f=s.elementType===u?f:Gn(u,f),su(r,s),s.tag=1,cn(u)?(r=!0,Uc(s)):r=!1,Bo(s,a),Oy(s,u,f),Md(s,u,f,a),Dd(null,s,u,!0,r,a);case 19:return Xy(r,s,a);case 22:return Wy(r,s,a)}throw Error(n(156,s.tag))};function kv(r,s){return t0(r,s)}function Nb(r,s,a,u){this.tag=r,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jn(r,s,a,u){return new Nb(r,s,a,u)}function rh(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Db(r){if(typeof r=="function")return rh(r)?1:0;if(r!=null){if(r=r.$$typeof,r===K)return 11;if(r===V)return 14}return 2}function ls(r,s){var a=r.alternate;return a===null?(a=jn(r.tag,s,r.key,r.mode),a.elementType=r.elementType,a.type=r.type,a.stateNode=r.stateNode,a.alternate=r,r.alternate=a):(a.pendingProps=s,a.type=r.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=r.flags&14680064,a.childLanes=r.childLanes,a.lanes=r.lanes,a.child=r.child,a.memoizedProps=r.memoizedProps,a.memoizedState=r.memoizedState,a.updateQueue=r.updateQueue,s=r.dependencies,a.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},a.sibling=r.sibling,a.index=r.index,a.ref=r.ref,a}function pu(r,s,a,u,f,m){var x=2;if(u=r,typeof r=="function")rh(r)&&(x=1);else if(typeof r=="string")x=5;else e:switch(r){case L:return Ws(a.children,f,m,s);case $:x=8,f|=8;break;case q:return r=jn(12,a,s,f|2),r.elementType=q,r.lanes=m,r;case k:return r=jn(13,a,s,f),r.elementType=k,r.lanes=m,r;case U:return r=jn(19,a,s,f),r.elementType=U,r.lanes=m,r;case B:return gu(a,f,m,s);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case ee:x=10;break e;case se:x=9;break e;case K:x=11;break e;case V:x=14;break e;case J:x=16,u=null;break e}throw Error(n(130,r==null?r:typeof r,""))}return s=jn(x,a,s,f),s.elementType=r,s.type=u,s.lanes=m,s}function Ws(r,s,a,u){return r=jn(7,r,u,s),r.lanes=a,r}function gu(r,s,a,u){return r=jn(22,r,u,s),r.elementType=B,r.lanes=a,r.stateNode={isHidden:!1},r}function sh(r,s,a){return r=jn(6,r,null,s),r.lanes=a,r}function oh(r,s,a){return s=jn(4,r.children!==null?r.children:[],r.key,s),s.lanes=a,s.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},s}function jb(r,s,a,u,f){this.tag=s,this.containerInfo=r,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Af(0),this.expirationTimes=Af(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Af(0),this.identifierPrefix=u,this.onRecoverableError=f,this.mutableSourceEagerHydrationData=null}function ih(r,s,a,u,f,m,x,b,R){return r=new jb(r,s,a,b,R),s===1?(s=1,m===!0&&(s|=8)):s=0,m=jn(3,null,null,s),r.current=m,m.stateNode=r,m.memoizedState={element:u,isDehydrated:a,cache:null,transitions:null,pendingSuspenseBoundaries:null},Sd(m),r}function $b(r,s,a){var u=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:u==null?null:""+u,children:r,containerInfo:s,implementation:a}}function Ev(r){if(!r)return ts;r=r._reactInternals;e:{if(Ms(r)!==r||r.tag!==1)throw Error(n(170));var s=r;do{switch(s.tag){case 3:s=s.stateNode.context;break e;case 1:if(cn(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break e}}s=s.return}while(s!==null);throw Error(n(171))}if(r.tag===1){var a=r.type;if(cn(a))return Y0(r,a,s)}return s}function _v(r,s,a,u,f,m,x,b,R){return r=ih(a,u,!0,r,f,m,x,b,R),r.context=Ev(null),a=r.current,u=Xt(),f=cs(a),m=Mr(u,f),m.callback=s??null,ss(a,m,f),r.current.lanes=f,Ai(r,f,u),fn(r,u),r}function yu(r,s,a,u){var f=s.current,m=Xt(),x=cs(f);return a=Ev(a),s.context===null?s.context=a:s.pendingContext=a,s=Mr(m,x),s.payload={element:r},u=u===void 0?null:u,u!==null&&(s.callback=u),r=ss(f,s,x),r!==null&&(Zn(r,f,x,m),Qc(r,f,x)),x}function vu(r){if(r=r.current,!r.child)return null;switch(r.child.tag){case 5:return r.child.stateNode;default:return r.child.stateNode}}function Cv(r,s){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var a=r.retryLane;r.retryLane=a!==0&&a<s?a:s}}function ah(r,s){Cv(r,s),(r=r.alternate)&&Cv(r,s)}function Ub(){return null}var bv=typeof reportError=="function"?reportError:function(r){console.error(r)};function ch(r){this._internalRoot=r}Su.prototype.render=ch.prototype.render=function(r){var s=this._internalRoot;if(s===null)throw Error(n(409));yu(r,s,null,null)},Su.prototype.unmount=ch.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var s=r.containerInfo;zs(function(){yu(null,r,null,null)}),s[Fr]=null}};function Su(r){this._internalRoot=r}Su.prototype.unstable_scheduleHydration=function(r){if(r){var s=u0();r={blockedOn:null,target:r,priority:s};for(var a=0;a<Gr.length&&s!==0&&s<Gr[a].priority;a++);Gr.splice(a,0,r),a===0&&d0(r)}};function uh(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function xu(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11&&(r.nodeType!==8||r.nodeValue!==" react-mount-point-unstable "))}function Pv(){}function Bb(r,s,a,u,f){if(f){if(typeof u=="function"){var m=u;u=function(){var G=vu(x);m.call(G)}}var x=_v(s,u,r,0,null,!1,!1,"",Pv);return r._reactRootContainer=x,r[Fr]=x.current,Hi(r.nodeType===8?r.parentNode:r),zs(),x}for(;f=r.lastChild;)r.removeChild(f);if(typeof u=="function"){var b=u;u=function(){var G=vu(R);b.call(G)}}var R=ih(r,0,!1,null,null,!1,!1,"",Pv);return r._reactRootContainer=R,r[Fr]=R.current,Hi(r.nodeType===8?r.parentNode:r),zs(function(){yu(s,R,a,u)}),R}function wu(r,s,a,u,f){var m=a._reactRootContainer;if(m){var x=m;if(typeof f=="function"){var b=f;f=function(){var R=vu(x);b.call(R)}}yu(s,x,r,f)}else x=Bb(a,s,r,f,u);return vu(x)}a0=function(r){switch(r.tag){case 3:var s=r.stateNode;if(s.current.memoizedState.isDehydrated){var a=Ti(s.pendingLanes);a!==0&&(Mf(s,a|1),fn(s,ft()),(De&6)===0&&(Ho=ft()+500,ns()))}break;case 13:zs(function(){var u=Ar(r,1);if(u!==null){var f=Xt();Zn(u,r,1,f)}}),ah(r,1)}},Lf=function(r){if(r.tag===13){var s=Ar(r,134217728);if(s!==null){var a=Xt();Zn(s,r,134217728,a)}ah(r,134217728)}},c0=function(r){if(r.tag===13){var s=cs(r),a=Ar(r,s);if(a!==null){var u=Xt();Zn(a,r,s,u)}ah(r,s)}},u0=function(){return ze},l0=function(r,s){var a=ze;try{return ze=r,s()}finally{ze=a}},bf=function(r,s,a){switch(s){case"input":if(wo(r,a),s=a.name,a.type==="radio"&&s!=null){for(a=r;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll("input[name="+JSON.stringify(""+s)+'][type="radio"]'),s=0;s<a.length;s++){var u=a[s];if(u!==r&&u.form===r.form){var f=jc(u);if(!f)throw Error(n(90));xn(u),wo(u,f)}}}break;case"textarea":Ci(r,a);break;case"select":s=a.value,s!=null&&Hr(r,!!a.multiple,s,!1)}},Qg=eh,Jg=zs;var zb={usingClientEntryPoint:!1,Events:[Ji,Mo,jc,Hg,Kg,eh]},ua={findFiberByHostInstance:Ls,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Vb={bundleType:ua.bundleType,version:ua.version,rendererPackageName:ua.rendererPackageName,rendererConfig:ua.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(r){return r=Zg(r),r===null?null:r.stateNode},findFiberByHostInstance:ua.findFiberByHostInstance||Ub,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ku=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ku.isDisabled&&ku.supportsFiber)try{Sc=ku.inject(Vb),lr=ku}catch{}}return dn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=zb,dn.createPortal=function(r,s){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!uh(s))throw Error(n(200));return $b(r,s,null,a)},dn.createRoot=function(r,s){if(!uh(r))throw Error(n(299));var a=!1,u="",f=bv;return s!=null&&(s.unstable_strictMode===!0&&(a=!0),s.identifierPrefix!==void 0&&(u=s.identifierPrefix),s.onRecoverableError!==void 0&&(f=s.onRecoverableError)),s=ih(r,1,!1,null,null,a,!1,u,f),r[Fr]=s.current,Hi(r.nodeType===8?r.parentNode:r),new ch(s)},dn.findDOMNode=function(r){if(r==null)return null;if(r.nodeType===1)return r;var s=r._reactInternals;if(s===void 0)throw typeof r.render=="function"?Error(n(188)):(r=Object.keys(r).join(","),Error(n(268,r)));return r=Zg(s),r=r===null?null:r.stateNode,r},dn.flushSync=function(r){return zs(r)},dn.hydrate=function(r,s,a){if(!xu(s))throw Error(n(200));return wu(null,r,s,!0,a)},dn.hydrateRoot=function(r,s,a){if(!uh(r))throw Error(n(405));var u=a!=null&&a.hydratedSources||null,f=!1,m="",x=bv;if(a!=null&&(a.unstable_strictMode===!0&&(f=!0),a.identifierPrefix!==void 0&&(m=a.identifierPrefix),a.onRecoverableError!==void 0&&(x=a.onRecoverableError)),s=_v(s,null,r,1,a??null,f,!1,m,x),r[Fr]=s.current,Hi(r),u)for(r=0;r<u.length;r++)a=u[r],f=a._getVersion,f=f(a._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[a,f]:s.mutableSourceEagerHydrationData.push(a,f);return new Su(s)},dn.render=function(r,s,a){if(!xu(s))throw Error(n(200));return wu(null,r,s,!1,a)},dn.unmountComponentAtNode=function(r){if(!xu(r))throw Error(n(40));return r._reactRootContainer?(zs(function(){wu(null,null,r,!1,function(){r._reactRootContainer=null,r[Fr]=null})}),!0):!1},dn.unstable_batchedUpdates=eh,dn.unstable_renderSubtreeIntoContainer=function(r,s,a,u){if(!xu(a))throw Error(n(200));if(r==null||r._reactInternals===void 0)throw Error(n(38));return wu(r,s,a,!1,u)},dn.version="18.3.1-next-f1338f8080-20240426",dn}var Ov;function vw(){if(Ov)return dh.exports;Ov=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),dh.exports=Zb(),dh.exports}var Nv;function e2(){if(Nv)return Eu;Nv=1;var e=vw();return Eu.createRoot=e.createRoot,Eu.hydrateRoot=e.hydrateRoot,Eu}var t2=e2(),n2={};const up=o2();function nt(e,...t){if(!up)return;const n=s2(e,...t);performance.mark(n);try{console.log(e,...t)}catch{console.log(n)}}function r2(e,...t){up&&console.warn(e,...t)}function s2(e,...t){return e.replace(/%[sfdO]/g,n=>{const o=t.shift();return n==="%O"&&o?JSON.stringify(o).replace(/"([^"]+)":/g,"$1:"):String(o)})}function o2(){if(typeof window>"u")return(n2.DEBUG||"").includes("nuqs");try{const e="nuqs-localStorage-test";if(typeof localStorage>"u")return!1;localStorage.setItem(e,e);const t=localStorage.getItem(e)===e;return localStorage.removeItem(e),t&&(localStorage.getItem("debug")||"").includes("nuqs")}catch{return!1}}const i2={303:"Multiple adapter contexts detected. This might happen in monorepos.",404:"nuqs requires an adapter to work with your framework.",409:"Multiple versions of the library are loaded. This may lead to unexpected behavior. Currently using `%s`, but `%s` (via the %s adapter) was about to load on top.",414:"Max safe URL length exceeded. Some browsers may not be able to accept this URL. Consider limiting the amount of state stored in the URL.",422:"Invalid options combination: `limitUrlUpdates: debounce` should be used in SSR scenarios, with `shallow: false`",429:"URL update rate-limited by the browser. Consider increasing `throttleMs` for key(s) `%s`. %O",500:"Empty search params cache. Search params can't be accessed in Layouts.",501:"Search params cache already populated. Have you called `parse` twice?"};function Ja(e){return`[nuqs] ${i2[e]}
|
|
42
|
+
See https://nuqs.dev/NUQS-${e}`}function a2(e){if(e.size===0)return"";const t=[];for(const[o,i]of e.entries()){const c=o.replace(/#/g,"%23").replace(/&/g,"%26").replace(/\+/g,"%2B").replace(/=/g,"%3D").replace(/\?/g,"%3F");t.push(`${c}=${c2(i)}`)}return"?"+t.join("&")}function c2(e){return e.replace(/%/g,"%25").replace(/\+/g,"%2B").replace(/ /g,"+").replace(/#/g,"%23").replace(/&/g,"%26").replace(/"/g,"%22").replace(/'/g,"%27").replace(/`/g,"%60").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/[\x00-\x1F]/g,t=>encodeURIComponent(t))}const ao=Y.createContext({useAdapter(){throw new Error(Ja(404))}});ao.displayName="NuqsAdapterContext";up&&typeof window<"u"&&(window.__NuqsAdapterContext&&window.__NuqsAdapterContext!==ao&&console.error(Ja(303)),window.__NuqsAdapterContext=ao);function u2(e){return({children:t,defaultOptions:n,processUrlSearchParams:o,...i})=>Y.createElement(ao.Provider,{...i,value:{useAdapter:e,defaultOptions:n,processUrlSearchParams:o}},t)}function l2(e){const t=Y.useContext(ao);if(!("useAdapter"in t))throw new Error(Ja(404));return t.useAdapter(e)}const f2=()=>Y.useContext(ao).defaultOptions,d2=()=>Y.useContext(ao).processUrlSearchParams;function h2(){var e;if(typeof window>"u"||!window.GestureEvent)return 50;try{const t=(e=navigator.userAgent)==null?void 0:e.match(/version\/([\d\.]+) safari/i);return parseFloat(t[1])>=17?120:320}catch{return 320}}function m2(e){return{method:"throttle",timeMs:e}}const Ea=m2(h2());function p2(e){return e===null||Array.isArray(e)&&e.length===0}function g2(e,t,n){if(typeof e=="string")n.set(t,e);else{n.delete(t);for(const o of e)n.append(t,o);n.has(t)||n.set(t,"")}return n}function lp(){const e=new Map;return{on(t,n){const o=e.get(t)||[];return o.push(n),e.set(t,o),()=>this.off(t,n)},off(t,n){const o=e.get(t);o&&e.set(t,o.filter(i=>i!==n))},emit(t,n){var o;(o=e.get(t))==null||o.forEach(i=>i(n))}}}function rm(e,t,n){function o(){e(),n.removeEventListener("abort",c)}const i=setTimeout(o,t);function c(){clearTimeout(i),n.removeEventListener("abort",c)}n.addEventListener("abort",c)}function sm(){const e=Promise;if(Promise.hasOwnProperty("withResolvers"))return Promise.withResolvers();let t=()=>{},n=()=>{};return{promise:new e((o,i)=>{t=o,n=i}),resolve:t,reject:n}}function y2(e,t){let n=t;for(let o=e.length-1;o>=0;o--){const i=e[o];if(!i)continue;const c=n;n=()=>i(c)}n()}function om(){return new URLSearchParams(location.search)}var Sw=class{constructor(){M(this,"updateMap",new Map);M(this,"options",{history:"replace",scroll:!1,shallow:!0});M(this,"timeMs",Ea.timeMs);M(this,"transitions",new Set);M(this,"resolvers",null);M(this,"controller",null);M(this,"lastFlushedAt",0);M(this,"resetQueueOnNextPush",!1)}push({key:e,query:t,options:n},o=Ea.timeMs){this.resetQueueOnNextPush&&(this.reset(),this.resetQueueOnNextPush=!1),nt("[nuqs gtq] Enqueueing %s=%s %O",e,t,n),this.updateMap.set(e,t),n.history==="push"&&(this.options.history="push"),n.scroll&&(this.options.scroll=!0),n.shallow===!1&&(this.options.shallow=!1),n.startTransition&&this.transitions.add(n.startTransition),(!Number.isFinite(this.timeMs)||o>this.timeMs)&&(this.timeMs=o)}getQueuedQuery(e){return this.updateMap.get(e)}getPendingPromise({getSearchParamsSnapshot:e=om}){var t;return((t=this.resolvers)==null?void 0:t.promise)??Promise.resolve(e())}flush({getSearchParamsSnapshot:e=om,rateLimitFactor:t=1,...n},o){if(this.controller??(this.controller=new AbortController),!Number.isFinite(this.timeMs))return nt("[nuqs gtq] Skipping flush due to throttleMs=Infinity"),Promise.resolve(e());if(this.resolvers)return this.resolvers.promise;this.resolvers=sm();const i=()=>{this.lastFlushedAt=performance.now();const[l,d]=this.applyPendingUpdates({...n,autoResetQueueOnUpdate:n.autoResetQueueOnUpdate??!0,getSearchParamsSnapshot:e},o);d===null?(this.resolvers.resolve(l),this.resetQueueOnNextPush=!0):this.resolvers.reject(l),this.resolvers=null};return rm(()=>{const l=performance.now()-this.lastFlushedAt,d=this.timeMs,h=t*Math.max(0,d-l);nt("[nuqs gtq] Scheduling flush in %f ms. Throttled at %f ms (x%f)",h,d,t),h===0?i():rm(i,h,this.controller.signal)},0,this.controller.signal),this.resolvers.promise}abort(){var e,t;return(e=this.controller)==null||e.abort(),this.controller=new AbortController,(t=this.resolvers)==null||t.resolve(new URLSearchParams),this.resolvers=null,this.reset()}reset(){const e=Array.from(this.updateMap.keys());return nt("[nuqs gtq] Resetting queue %s",JSON.stringify(Object.fromEntries(this.updateMap))),this.updateMap.clear(),this.transitions.clear(),this.options={history:"replace",scroll:!1,shallow:!0},this.timeMs=Ea.timeMs,e}applyPendingUpdates(e,t){const{updateUrl:n,getSearchParamsSnapshot:o}=e;let i=o();if(nt("[nuqs gtq] Applying %d pending update(s) on top of %s",this.updateMap.size,i.toString()),this.updateMap.size===0)return[i,null];const c=Array.from(this.updateMap.entries()),l={...this.options},d=Array.from(this.transitions);e.autoResetQueueOnUpdate&&this.reset(),nt("[nuqs gtq] Flushing queue %O with options %O",c,l);for(const[h,p]of c)p===null?i.delete(h):i=g2(p,h,i);t&&(i=t(i));try{return y2(d,()=>{n(i,l)}),[i,null]}catch(h){return console.error(Ja(429),c.map(([p])=>p).join(),h),[i,h]}}};const Nu=new Sw;function v2(e,t,n){const o=Y.useCallback(()=>{const c=Object.fromEntries(e.map(l=>[l,n(l)]));return[JSON.stringify(c),c]},[e.join(","),n]),i=Y.useRef(null);return i.current===null&&(i.current=o()),Y.useSyncExternalStore(Y.useCallback(c=>{const l=e.map(d=>t(d,c));return()=>l.forEach(d=>d())},[e.join(","),t]),()=>{const[c,l]=o();return i.current[0]===c?i.current[1]:(i.current=[c,l],l)},()=>i.current[1])}var S2=class{constructor(e){M(this,"callback");M(this,"resolvers",sm());M(this,"controller",new AbortController);M(this,"queuedValue");this.callback=e}abort(){this.controller.abort(),this.queuedValue=void 0}push(e,t){return this.queuedValue=e,this.controller.abort(),this.controller=new AbortController,rm(()=>{const n=this.resolvers;try{nt("[nuqs dq] Flushing debounce queue",e);const o=this.callback(e);nt("[nuqs dq] Reset debounce queue %O",this.queuedValue),this.queuedValue=void 0,this.resolvers=sm(),o.then(i=>n.resolve(i)).catch(i=>n.reject(i))}catch(o){this.queuedValue=void 0,n.reject(o)}},t,this.controller.signal),this.resolvers.promise}},x2=class{constructor(e=new Sw){M(this,"throttleQueue");M(this,"queues",new Map);M(this,"queuedQuerySync",lp());this.throttleQueue=e}useQueuedQueries(e){return v2(e,(t,n)=>this.queuedQuerySync.on(t,n),t=>this.getQueuedQuery(t))}push(e,t,n,o){if(!Number.isFinite(t)){const l=n.getSearchParamsSnapshot??om;return Promise.resolve(l())}const i=e.key;if(!this.queues.has(i)){nt("[nuqs dqc] Creating debounce queue for `%s`",i);const l=new S2(d=>(this.throttleQueue.push(d),this.throttleQueue.flush(n,o).finally(()=>{var h;((h=this.queues.get(d.key))==null?void 0:h.queuedValue)===void 0&&(nt("[nuqs dqc] Cleaning up empty queue for `%s`",d.key),this.queues.delete(d.key)),this.queuedQuerySync.emit(d.key)})));this.queues.set(i,l)}nt("[nuqs dqc] Enqueueing debounce update %O",e);const c=this.queues.get(i).push(e,t);return this.queuedQuerySync.emit(i),c}abort(e){var n;const t=this.queues.get(e);return t?(nt("[nuqs dqc] Aborting debounce queue %s=%s",e,(n=t.queuedValue)==null?void 0:n.query),this.queues.delete(e),t.abort(),this.queuedQuerySync.emit(e),o=>(o.then(t.resolvers.resolve,t.resolvers.reject),o)):o=>o}abortAll(){var e;for(const[t,n]of this.queues.entries())nt("[nuqs dqc] Aborting debounce queue %s=%s",t,(e=n.queuedValue)==null?void 0:e.query),n.abort(),n.resolvers.resolve(new URLSearchParams),this.queuedQuerySync.emit(t);this.queues.clear()}getQueuedQuery(e){var n,o;const t=(o=(n=this.queues.get(e))==null?void 0:n.queuedValue)==null?void 0:o.query;return t!==void 0?t:this.throttleQueue.getQueuedQuery(e)}};const ph=new x2(Nu);function xw(e,t){return e===t?!0:e===null||t===null||typeof e=="string"||typeof t=="string"||e.length!==t.length?!1:e.every((n,o)=>n===t[o])}function Dv(e,t,n){return o=>{if(!(t.length===0||t.some(c=>!xw(o.getAll(c),e.getAll(c)))))return nt("[nuqs `%s`] no change, returning previous",t.join(","),o),o;const i=ww(e,t,n);return nt("[nuqs `%s`] subbed search params change\n from %O\n to %O",t.join(","),o,i),i}}function ww(e,t,n){if(t.length===0)return e;const o=n?new URLSearchParams(e):e;for(const i of e.keys())t.includes(i)||o.delete(i);return o}const w2="__nuqs__",im=lp();function k2(e){return function(n,o){const i=new URL(location.href);i.search=a2(n),nt("[nuqs react] Updating url: %s",i),e&&o.shallow===!1?(o.history==="push"?location.assign:location.replace).call(location,i):(o.history==="push"?history.pushState:history.replaceState).call(history,history.state,w2,i),im.emit("update",n),o.scroll===!0&&window.scrollTo({top:0})}}const kw=Y.createContext({fullPageNavigationOnShallowFalseUpdates:!1});function E2(e){const{fullPageNavigationOnShallowFalseUpdates:t}=Y.useContext(kw),[n,o]=Y.useState(()=>typeof location>"u"?new URLSearchParams:ww(new URLSearchParams(location.search),e,!1));return Y.useEffect(()=>{const i=()=>{o(Dv(new URLSearchParams(location.search),e,!1))},c=l=>{o(Dv(l,e,!0))};return im.on("update",c),window.addEventListener("popstate",i),()=>{im.off("update",c),window.removeEventListener("popstate",i)}},[e.join("&")]),{searchParams:n,updateUrl:Y.useMemo(()=>k2(t),[t])}}const _2=u2(E2);function C2({children:e,fullPageNavigationOnShallowFalseUpdates:t=!1,...n}){return Y.createElement(kw.Provider,{value:{fullPageNavigationOnShallowFalseUpdates:t}},Y.createElement(_2,{...n,children:e}))}const b2="modulepreload",P2=function(e,t){return new URL(e,t).href},jv={},yr=function(t,n,o){let i=Promise.resolve();if(n&&n.length>0){let l=function(y){return Promise.all(y.map(g=>Promise.resolve(g).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const d=document.getElementsByTagName("link"),h=document.querySelector("meta[property=csp-nonce]"),p=(h==null?void 0:h.nonce)||(h==null?void 0:h.getAttribute("nonce"));i=l(n.map(y=>{if(y=P2(y,o),y in jv)return;jv[y]=!0;const g=y.endsWith(".css"),v=g?'[rel="stylesheet"]':"";if(!!o)for(let E=d.length-1;E>=0;E--){const P=d[E];if(P.href===y&&(!g||P.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${v}`))return;const S=document.createElement("link");if(S.rel=g?"stylesheet":b2,g||(S.as="script"),S.crossOrigin="",S.href=y,p&&S.setAttribute("nonce",p),document.head.appendChild(S),g)return new Promise((E,P)=>{S.addEventListener("load",E),S.addEventListener("error",()=>P(new Error(`Unable to preload CSS for ${y}`)))})}))}function c(l){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=l,window.dispatchEvent(d),!d.defaultPrevented)throw l}return i.then(l=>{for(const d of l||[])d.status==="rejected"&&c(d.reason);return t().catch(c)})};var va=typeof window<"u"?Y.useLayoutEffect:Y.useEffect;function gh(e){const t=Y.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function F2(e,t,n={},o={}){Y.useEffect(()=>{if(!e.current||o.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([c])=>{t(c)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,o.disabled,e])}function I2(e){const t=Y.useRef(null);return Y.useImperativeHandle(e,()=>t.current,[]),t}const Ew=!1;function Ra(e){return e[e.length-1]}function R2(e){return typeof e=="function"}function Gs(e,t){return R2(e)?e(t):e}const _w=Object.prototype.hasOwnProperty,$v=Object.prototype.propertyIsEnumerable;function Cw(e){for(const t in e)if(_w.call(e,t))return!0;return!1}const T2=()=>Object.create(null),Hs=(e,t)=>Ys(e,t,T2);function Ys(e,t,n=()=>({}),o=0){if(e===t)return e;if(o>500)return t;const i=t,c=zv(e)&&zv(i);if(!c&&!(Xu(e)&&Xu(i)))return i;const l=c?e:Uv(e);if(!l)return i;const d=c?i:Uv(i);if(!d)return i;const h=l.length,p=d.length,y=c?new Array(p):n();let g=0;for(let v=0;v<p;v++){const w=c?v:d[v],S=e[w],E=i[w];if(S===E){y[w]=S,(c?v<h:_w.call(e,w))&&g++;continue}if(S===null||E===null||typeof S!="object"||typeof E!="object"){y[w]=E;continue}const P=Ys(S,E,n,o+1);y[w]=P,P===S&&g++}return h===p&&g===h?e:y}function Uv(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!$v.call(e,i))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const o=t;for(const i of n){if(!$v.call(e,i))return!1;o.push(i)}return o}function Xu(e){if(!Bv(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!Bv(n)||!n.hasOwnProperty("isPrototypeOf"))}function Bv(e){return Object.prototype.toString.call(e)==="[object Object]"}function zv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function eo(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let o=0,i=e.length;o<i;o++)if(!eo(e[o],t[o],n))return!1;return!0}if(Xu(e)&&Xu(t)){const o=(n==null?void 0:n.ignoreUndefined)??!0;if(n!=null&&n.partial){for(const l in t)if((!o||t[l]!==void 0)&&!eo(e[l],t[l],n))return!1;return!0}let i=0;if(!o)i=Object.keys(e).length;else for(const l in e)e[l]!==void 0&&i++;let c=0;for(const l in t)if((!o||t[l]!==void 0)&&(c++,c>i||!eo(e[l],t[l],n)))return!1;return i===c}return!1}function ci(e){let t,n;const o=new Promise((i,c)=>{t=i,n=c});return o.status="pending",o.resolve=i=>{o.status="resolved",o.value=i,t(i),e==null||e(i)},o.reject=i=>{o.status="rejected",n(i)},o}function Ta(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function A2(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function Vv(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return A2(t)}const M2=["http:","https:","mailto:","tel:"];function Zu(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function fa(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,o="",i;for(;(i=t.exec(e))!==null;)o+=Vv(e.slice(n,i.index))+i[0],n=t.lastIndex;o=o+Vv(n?e.slice(n):e);let c=!1;return o.startsWith("//")&&(c=!0,o="/"+o.replace(/^\/+/,"")),{path:o,handledProtocolRelativeURL:c}}function L2(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function O2(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Br(){throw new Error("Invariant failed")}function Aa(e){const t=new Map;let n,o;const i=c=>{c.next&&(c.prev?(c.prev.next=c.next,c.next.prev=c.prev,c.next=void 0,o&&(o.next=c,c.prev=o)):(c.next.prev=void 0,n=c.next,c.next=void 0,o&&(c.prev=o,o.next=c)),o=c)};return{get(c){const l=t.get(c);if(l)return i(l),l.value},set(c,l){if(t.size>=e&&n){const h=n;t.delete(h.key),h.next&&(n=h.next,h.next.prev=void 0),h===o&&(o=void 0)}const d=t.get(c);if(d)d.value=l,i(d);else{const h={key:c,value:l,prev:o};o&&(o.next=h),o=h,n||(n=h),t.set(c,h)}},clear(){t.clear(),n=void 0,o=void 0}}}const ps=4,bw=5;function N2(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function Pw(e,t,n=new Uint16Array(6)){const o=e.indexOf("/",t),i=o===-1?e.length:o,c=e.substring(t,i);if(!c||!c.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(c==="$"){const d=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=d,n[4]=d,n[5]=d,n}if(c.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;const l=N2(c);if(l){const[d,h]=l,p=c.charCodeAt(d+1);if(p===45){if(d+2<c.length&&c.charCodeAt(d+2)===36){const y=d+3,g=h;if(y<g)return n[0]=3,n[1]=t+d,n[2]=t+y,n[3]=t+g,n[4]=t+h+1,n[5]=i,n}}else if(p===36){const y=d+1,g=d+2;return g===h?(n[0]=2,n[1]=t+d,n[2]=t+y,n[3]=t+g,n[4]=t+h+1,n[5]=e.length,n):(n[0]=1,n[1]=t+d,n[2]=t+g,n[3]=t+h,n[4]=t+h+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function Tl(e,t,n,o,i,c,l){var h,p,y,g,v,w,S,E,P,H;l==null||l(n);let d=o;{const _=n.fullPath??n.from,O=_.length,C=((h=n.options)==null?void 0:h.caseSensitive)??e,D=((y=(p=n.options)==null?void 0:p.params)==null?void 0:y.parse)??((g=n.options)==null?void 0:g.parseParams);for(;d<O;){const L=Pw(_,d,t);let $;const q=d,ee=L[5];switch(d=ee+1,c++,L[0]){case 0:{const se=_.substring(L[2],L[3]);if(C){const K=(v=i.static)==null?void 0:v.get(se);if(K)$=K;else{i.static??(i.static=new Map);const k=Xs(n.fullPath??n.from);k.parent=i,k.depth=c,$=k,i.static.set(se,k)}}else{const K=se.toLowerCase(),k=(w=i.staticInsensitive)==null?void 0:w.get(K);if(k)$=k;else{i.staticInsensitive??(i.staticInsensitive=new Map);const U=Xs(n.fullPath??n.from);U.parent=i,U.depth=c,$=U,i.staticInsensitive.set(K,U)}}break}case 1:{const se=_.substring(q,L[1]),K=_.substring(L[4],ee),k=C&&!!(se||K),U=se?k?se:se.toLowerCase():void 0,V=K?k?K:K.toLowerCase():void 0,J=!D&&((S=i.dynamic)==null?void 0:S.find(B=>!B.parse&&B.caseSensitive===k&&B.prefix===U&&B.suffix===V));if(J)$=J;else{const B=vh(1,n.fullPath??n.from,k,U,V);$=B,B.depth=c,B.parent=i,i.dynamic??(i.dynamic=[]),i.dynamic.push(B)}break}case 3:{const se=_.substring(q,L[1]),K=_.substring(L[4],ee),k=C&&!!(se||K),U=se?k?se:se.toLowerCase():void 0,V=K?k?K:K.toLowerCase():void 0,J=!D&&((E=i.optional)==null?void 0:E.find(B=>!B.parse&&B.caseSensitive===k&&B.prefix===U&&B.suffix===V));if(J)$=J;else{const B=vh(3,n.fullPath??n.from,k,U,V);$=B,B.parent=i,B.depth=c,i.optional??(i.optional=[]),i.optional.push(B)}break}case 2:{const se=_.substring(q,L[1]),K=_.substring(L[4],ee),k=C&&!!(se||K),U=se?k?se:se.toLowerCase():void 0,V=K?k?K:K.toLowerCase():void 0,J=vh(2,n.fullPath??n.from,k,U,V);$=J,J.parent=i,J.depth=c,i.wildcard??(i.wildcard=[]),i.wildcard.push(J)}}i=$}if(D&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const L=Xs(n.fullPath??n.from);L.kind=bw,L.parent=i,c++,L.depth=c,i.pathless??(i.pathless=[]),i.pathless.push(L),i=L}const T=(n.path||!n.children)&&!n.isRoot;if(T&&_.endsWith("/")){const L=Xs(n.fullPath??n.from);L.kind=ps,L.parent=i,c++,L.depth=c,i.index=L,i=L}i.parse=D??null,i.priority=((H=(P=n.options)==null?void 0:P.params)==null?void 0:H.priority)??0,T&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const _ of n.children)Tl(e,t,_,d,i,c,l)}function yh(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function ms(e){var t,n,o;if(e.pathless)for(const i of e.pathless)ms(i);if(e.static)for(const i of e.static.values())ms(i);if(e.staticInsensitive)for(const i of e.staticInsensitive.values())ms(i);if((t=e.dynamic)!=null&&t.length){e.dynamic.sort(yh);for(const i of e.dynamic)ms(i)}if((n=e.optional)!=null&&n.length){e.optional.sort(yh);for(const i of e.optional)ms(i)}if((o=e.wildcard)!=null&&o.length){e.wildcard.sort(yh);for(const i of e.wildcard)ms(i)}}function Xs(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function vh(e,t,n,o,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:o,suffix:i}}function D2(e,t){const n=Xs("/"),o=new Uint16Array(6);for(const i of e)Tl(!1,o,i,1,n,0);ms(n),t.masksTree=n,t.flatCache=Aa(1e3)}function j2(e,t){e||(e="/");const n=t.flatCache.get(e);if(n)return n;const o=fp(e,t.masksTree);return t.flatCache.set(e,o),o}function $2(e,t,n,o,i){e||(e="/"),o||(o="/");const c=t?`case\0${e}`:e;let l=i.singleCache.get(c);return l||(l=Xs("/"),Tl(t,new Uint16Array(6),{from:e},1,l,0),i.singleCache.set(c,l)),fp(o,l,n)}function U2(e,t,n=!1){const o=n?e:`nofuzz\0${e}`,i=t.matchCache.get(o);if(i!==void 0)return i;e||(e="/");let c;try{c=fp(e,t.segmentTree,n)}catch(l){if(l instanceof URIError)c=null;else throw l}return c&&(c.branch=Iw(c.route)),t.matchCache.set(o,c),c}function B2(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function z2(e,t=!1,n){const o=Xs(e.fullPath),i=new Uint16Array(6),c={},l={};let d=0;return Tl(t,i,e,1,o,0,h=>{if(n==null||n(h,d),h.id in c&&Br(),c[h.id]=h,d!==0&&h.path){const p=B2(h.fullPath);(!l[p]||h.fullPath.endsWith("/"))&&(l[p]=h)}d++}),ms(o),{processedTree:{segmentTree:o,singleCache:Aa(1e3),matchCache:Aa(1e3),flatCache:null,masksTree:null},routesById:c,routesByPath:l}}function fp(e,t,n=!1){const o=e.split("/"),i=q2(e,o,t,n);if(!i)return null;const[c]=Fw(e,o,i);return{route:i.node.route,rawParams:c}}function Fw(e,t,n){var y,g,v,w,S,E,P,H,_,O;const o=V2(n.node);let i=null;const c=Object.create(null);let l=((y=n.extract)==null?void 0:y.part)??0,d=((g=n.extract)==null?void 0:g.node)??0,h=((v=n.extract)==null?void 0:v.path)??0,p=((w=n.extract)==null?void 0:w.segment)??0;for(;d<o.length;l++,d++,h++,p++){const C=o[d];if(C.kind===ps)break;if(C.kind===bw){p--,l--,h--;continue}const D=t[l],T=h;if(D&&(h+=D.length),C.kind===1){i??(i=n.node.fullPath.split("/"));const L=i[p],$=((S=C.prefix)==null?void 0:S.length)??0;if(L.charCodeAt($)===123){const q=((E=C.suffix)==null?void 0:E.length)??0,ee=L.substring($+2,L.length-q-1),se=D.substring($,D.length-q);c[ee]=decodeURIComponent(se)}else{const q=L.substring(1);c[q]=decodeURIComponent(D)}}else if(C.kind===3){if(n.skipped&1<<d){l--,h=T-1;continue}i??(i=n.node.fullPath.split("/"));const L=i[p],$=((P=C.prefix)==null?void 0:P.length)??0,q=((H=C.suffix)==null?void 0:H.length)??0,ee=L.substring($+3,L.length-q-1),se=C.suffix||C.prefix?D.substring($,D.length-q):D;se&&(c[ee]=decodeURIComponent(se))}else if(C.kind===2){const L=C,$=e.substring(T+(((_=L.prefix)==null?void 0:_.length)??0),e.length-(((O=L.suffix)==null?void 0:O.length)??0)),q=decodeURIComponent($);c["*"]=q,c._splat=q;break}}return n.rawParams&&Object.assign(c,n.rawParams),[c,{part:l,node:d,path:h,segment:p}]}function Iw(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function V2(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function q2(e,t,n,o){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!Ra(t),c=i&&e!=="/",l=t.length-(i?1:0),d=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}];let h=null,p=null;for(;d.length;){const y=d.pop(),{node:g,index:v,skipped:w,depth:S,statics:E,dynamics:P,optionals:H}=y;let{extract:_,rawParams:O}=y;if(g.kind===2&&g.route&&!Cu(p,y))continue;if(g.parse){if(!qv(e,t,y))continue;O=y.rawParams,_=y.extract}o&&g.route&&g.kind!==ps&&Cu(h,y)&&(h=y);const C=v===l;if(C&&(g.route&&(!c||g.kind===ps||g.kind===2)&&Cu(p,y)&&(p=y),!g.optional&&!g.wildcard&&!g.index&&!g.pathless))continue;const D=C?void 0:t[v];let T;if(C&&g.index){const L={node:g.index,index:v,skipped:w,depth:S+1,statics:E,dynamics:P,optionals:H,extract:_,rawParams:O};let $=!0;if(g.index.parse&&(qv(e,t,L)||($=!1)),$){if(!P&&!H&&!w&&W2(E,l))return L;Cu(p,L)&&(p=L)}}if(g.wildcard)for(let L=g.wildcard.length-1;L>=0;L--){const $=g.wildcard[L],{prefix:q,suffix:ee}=$;if(!(q&&(C||!($.caseSensitive?D:T??(T=D.toLowerCase())).startsWith(q)))){if(ee){if(C)continue;const se=t.slice(v).join("/").slice(-ee.length);if(($.caseSensitive?se:se.toLowerCase())!==ee)continue}d.push({node:$,index:l,skipped:w,depth:S+1,statics:E,dynamics:P,optionals:H,extract:_,rawParams:O})}}if(g.optional){const L=w|1<<S,$=S+1;for(let q=g.optional.length-1;q>=0;q--){const ee=g.optional[q];d.push({node:ee,index:v,skipped:L,depth:$,statics:E,dynamics:P,optionals:H,extract:_,rawParams:O})}if(!C)for(let q=g.optional.length-1;q>=0;q--){const ee=g.optional[q],{prefix:se,suffix:K}=ee;if(se||K){const k=ee.caseSensitive?D:T??(T=D.toLowerCase());if(se&&!k.startsWith(se)||K&&!k.endsWith(K))continue}d.push({node:ee,index:v+1,skipped:w,depth:$,statics:E,dynamics:P,optionals:H+_u(l,v),extract:_,rawParams:O})}}if(!C&&g.dynamic&&D)for(let L=g.dynamic.length-1;L>=0;L--){const $=g.dynamic[L],{prefix:q,suffix:ee}=$;if(q||ee){const se=$.caseSensitive?D:T??(T=D.toLowerCase());if(q&&!se.startsWith(q)||ee&&!se.endsWith(ee))continue}d.push({node:$,index:v+1,skipped:w,depth:S+1,statics:E,dynamics:P+_u(l,v),optionals:H,extract:_,rawParams:O})}if(!C&&g.staticInsensitive){const L=g.staticInsensitive.get(T??(T=D.toLowerCase()));L&&d.push({node:L,index:v+1,skipped:w,depth:S+1,statics:E+_u(l,v),dynamics:P,optionals:H,extract:_,rawParams:O})}if(!C&&g.static){const L=g.static.get(D);L&&d.push({node:L,index:v+1,skipped:w,depth:S+1,statics:E+_u(l,v),dynamics:P,optionals:H,extract:_,rawParams:O})}if(g.pathless){const L=S+1;for(let $=g.pathless.length-1;$>=0;$--){const q=g.pathless[$];d.push({node:q,index:v,skipped:w,depth:L,statics:E,dynamics:P,optionals:H,extract:_,rawParams:O})}}}if(p)return p;if(o&&h){let y=h.index;for(let v=0;v<h.index;v++)y+=t[v].length;const g=y===e.length?"/":e.slice(y);return h.rawParams??(h.rawParams=Object.create(null)),h.rawParams["**"]=decodeURIComponent(g),h}return null}function _u(e,t){return 2**(e-t-1)}function W2(e,t){return e===2**(t-1)-1}function qv(e,t,n){let o,i;try{[o,i]=Fw(e,t,n)}catch{return null}if(n.rawParams=o,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(o)===!1)return null}catch{}return!0}function Cu(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===ps)>(e.node.kind===ps)||t.node.kind===ps==(e.node.kind===ps)&&t.depth>e.depth))):!0}function Du(e){return dp(e.filter(t=>t!==void 0).join("/"))}function dp(e){return e.replace(/\/{2,}/g,"/")}function Rw(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function $r(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function Tw(e){return $r(Rw(e))}function el(e,t){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function H2(e,t,n){return el(e,n)===el(t,n)}function K2({base:e,to:t,trailingSlash:n="never",cache:o}){const i=t.startsWith("/"),c=!i&&t===".";let l;if(o){l=i?t:c?e:e+"\0"+t;const p=o.get(l);if(p)return p}let d;if(c)d=e.split("/");else if(i)d=t.split("/");else{for(d=e.split("/");d.length>1&&Ra(d)==="";)d.pop();const p=t.split("/");for(let y=0,g=p.length;y<g;y++){const v=p[y];v===""?y?y===g-1&&d.push(v):d=[v]:v===".."?d.pop():v==="."||d.push(v)}}d.length>1&&(Ra(d)===""?n==="never"&&d.pop():n==="always"&&d.push(""));const h=dp(d.join("/"))||"/";return l&&o&&o.set(l,h),h}function Q2(e){const t=new Map(e.map(i=>[encodeURIComponent(i),i])),n=Array.from(t.keys()).map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),o=new RegExp(n,"g");return i=>i.replace(o,c=>t.get(c)??c)}function Sh(e,t,n){const o=t[e];return typeof o!="string"?o:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(o)?o:o.split("/").map(i=>Hv(i,n)).join("/"):Hv(o,n)}function Wv({path:e,params:t,decoder:n,...o}){let i=!1;const c=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:c,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:c,isMissingParams:i};const l=e.length;let d=0,h,p="";for(;d<l;){const y=d;h=Pw(e,y,h);const g=h[5];if(d=g+1,y===g)continue;const v=h[0];if(v===0){p+="/"+e.substring(y,g);continue}if(v===2){const w=t._splat;c._splat=w,c["*"]=w;const S=e.substring(y,h[1]),E=e.substring(h[4],g);if(!w){i=!0,(S||E)&&(p+="/"+S+E);continue}const P=Sh("_splat",t,n);p+="/"+S+P+E;continue}if(v===1){const w=e.substring(h[2],h[3]);!i&&!(w in t)&&(i=!0),c[w]=t[w];const S=e.substring(y,h[1]),E=e.substring(h[4],g),P=Sh(w,t,n)??"undefined";p+="/"+S+P+E;continue}if(v===3){const w=e.substring(h[2],h[3]),S=t[w];if(S==null)continue;c[w]=S;const E=e.substring(y,h[1]),P=e.substring(h[4],g),H=Sh(w,t,n)??"";p+="/"+E+H+P;continue}}return e.endsWith("/")&&(p+="/"),{usedParams:c,interpolatedPath:p||"/",isMissingParams:i}}function Hv(e,t){const n=encodeURIComponent(e);return(t==null?void 0:t(n))??n}function Kt(e){return(e==null?void 0:e.isNotFound)===!0}function J2(e,t=String){const n=new URLSearchParams;for(const o in e){const i=e[o];i!==void 0&&n.set(o,t(i))}return n.toString()}function xh(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function G2(e){const t=new URLSearchParams(e),n=Object.create(null);for(const[o,i]of t.entries()){const c=n[o];c==null?n[o]=xh(i):Array.isArray(c)?c.push(xh(i)):n[o]=[c,xh(i)]}return n}const Y2=Z2(JSON.parse),X2=eP(JSON.stringify,JSON.parse);function Z2(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=G2(t);for(const o in n){const i=n[o];if(typeof i=="string")try{n[o]=e(i)}catch{}}return n}}function eP(e,t){const n=typeof t=="function";function o(i){if(typeof i=="object"&&i!==null)try{return e(i)}catch{}else if(n&&typeof i=="string")try{return t(i),e(i)}catch{}return i}return i=>{const c=J2(i,o);return c?`?${c}`:""}}const to="__root__";function tP(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function mn(e){return e instanceof Response&&!!e.options}const am=e=>{var t;if(!e.rendered)return e.rendered=!0,(t=e.onReady)==null?void 0:t.call(e)},nP=e=>e.stores.matchesId.get().some(t=>{var n;return(n=e.stores.matchStores.get(t))==null?void 0:n.get()._forcePending}),Al=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),no=(e,t,n=!0)=>{const o={...e.router.options.context??{}},i=n?t:t-1;for(let c=0;c<=i;c++){const l=e.matches[c];if(!l)continue;const d=e.router.getMatch(l.id);d&&Object.assign(o,d.__routeContext,d.__beforeLoadContext)}return o},Kv=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,o=e.matches.findIndex(l=>l.routeId===e.router.routeTree.id),i=o>=0?o:0;let c=n?e.matches.findIndex(l=>l.routeId===n):e.firstBadMatchIndex??e.matches.length-1;c<0&&(c=i);for(let l=c;l>=0;l--){const d=e.matches[l];if(e.router.looseRoutesById[d.routeId].options.notFoundComponent)return l}return n?c:i},gs=(e,t,n)=>{var o,i,c;if(!(!mn(n)&&!Kt(n)))throw mn(n)&&n.redirectHandled&&!n.options.reloadDocument||(t&&((o=t._nonReactive.beforeLoadPromise)==null||o.resolve(),(i=t._nonReactive.loaderPromise)==null||i.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,l=>({...l,status:mn(n)?"redirected":Kt(n)?"notFound":l.status==="pending"?"success":l.status,context:no(e,t.index),isFetching:!1,error:n})),Kt(n)&&!n.routeId&&(n.routeId=t.routeId),(c=t._nonReactive.loadPromise)==null||c.resolve()),mn(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},Aw=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Qv=(e,t,n)=>{const o=no(e,n);e.updateMatch(t,i=>({...i,context:o}))},da=(e,t,n)=>{var l,d;const{id:o,routeId:i}=e.matches[t],c=e.router.looseRoutesById[i];if(n instanceof Promise)throw n;e.firstBadMatchIndex??(e.firstBadMatchIndex=t),gs(e,e.router.getMatch(o),n);try{(d=(l=c.options).onError)==null||d.call(l,n)}catch(h){n=h,gs(e,e.router.getMatch(o),n)}e.updateMatch(o,h=>{var p,y;return(p=h._nonReactive.beforeLoadPromise)==null||p.resolve(),h._nonReactive.beforeLoadPromise=void 0,(y=h._nonReactive.loadPromise)==null||y.resolve(),{...h,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}}),!e.preload&&!mn(n)&&!Kt(n)&&(e.serialError??(e.serialError=n))},Mw=(e,t,n,o)=>{var c;if(o._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Al(e,t)&&(n.options.loader||n.options.beforeLoad||Ow(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??((c=e.router.options)==null?void 0:c.defaultPendingComponent))){const l=setTimeout(()=>{am(e)},i);o._nonReactive.pendingTimeout=l}},rP=(e,t,n)=>{const o=e.router.getMatch(t);if(!o._nonReactive.beforeLoadPromise&&!o._nonReactive.loaderPromise)return;Mw(e,t,n,o);const i=()=>{const c=e.router.getMatch(t);c.preload&&(c.status==="redirected"||c.status==="notFound")&&gs(e,c,c.error)};return o._nonReactive.beforeLoadPromise?o._nonReactive.beforeLoadPromise.then(i):i()},sP=(e,t,n,o)=>{const i=e.router.getMatch(t);let c=i._nonReactive.loadPromise;i._nonReactive.loadPromise=ci(()=>{c==null||c.resolve(),c=void 0});const{paramsError:l,searchError:d}=i;l&&da(e,n,l),d&&da(e,n,d),Mw(e,t,o,i);const h=new AbortController;let p=!1;const y=()=>{p||(p=!0,e.updateMatch(t,C=>({...C,isFetching:"beforeLoad",fetchCount:C.fetchCount+1,abortController:h})))},g=()=>{var C;(C=i._nonReactive.beforeLoadPromise)==null||C.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,D=>({...D,isFetching:!1}))};if(!o.options.beforeLoad){e.router.batch(()=>{y(),g()});return}i._nonReactive.beforeLoadPromise=ci();const v={...no(e,n,!1),...i.__routeContext},{search:w,params:S,cause:E}=i,P=Al(e,t),H={search:w,abortController:h,params:S,preload:P,context:v,location:e.location,navigate:C=>e.router.navigate({...C,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:P?"preload":E,matches:e.matches,routeId:o.id,...e.router.options.additionalContext},_=C=>{if(C===void 0){e.router.batch(()=>{y(),g()});return}(mn(C)||Kt(C))&&(y(),da(e,n,C)),e.router.batch(()=>{y(),e.updateMatch(t,D=>({...D,__beforeLoadContext:C})),g()})};let O;try{if(O=o.options.beforeLoad(H),Ta(O))return y(),O.catch(C=>{da(e,n,C)}).then(_)}catch(C){y(),da(e,n,C)}_(O)},oP=(e,t)=>{const{id:n,routeId:o}=e.matches[t],i=e.router.looseRoutesById[o],c=()=>d(),l=()=>sP(e,n,t,i),d=()=>{if(Aw(e,n))return;const h=rP(e,n,i);return Ta(h)?h.then(l):l()};return c()},iP=(e,t,n)=>{var c,l,d,h,p,y;const o=e.router.getMatch(t);if(!o||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const i={ssr:e.router.options.ssr,matches:e.matches,match:o,params:o.params,loaderData:o.loaderData};return Promise.all([(l=(c=n.options).head)==null?void 0:l.call(c,i),(h=(d=n.options).scripts)==null?void 0:h.call(d,i),(y=(p=n.options).headers)==null?void 0:y.call(p,i)]).then(([g,v,w])=>({meta:g==null?void 0:g.meta,links:g==null?void 0:g.links,headScripts:g==null?void 0:g.scripts,headers:w,scripts:v,styles:g==null?void 0:g.styles}))},Lw=(e,t,n,o,i)=>{const c=t[o-1],{params:l,loaderDeps:d,abortController:h,cause:p}=e.router.getMatch(n),y=no(e,o),g=Al(e,n);return{params:l,deps:d,preload:!!g,parentMatchPromise:c,abortController:h,context:y,location:e.location,navigate:v=>e.router.navigate({...v,_fromLocation:e.location}),cause:g?"preload":p,route:i,...e.router.options.additionalContext}},Jv=async(e,t,n,o,i)=>{var c,l,d,h,p;try{const y=e.router.getMatch(n);try{(!(Ew??e.router.isServer)||y.ssr===!0)&&Ma(i);const g=i.options.loader,v=typeof g=="function"?g:g==null?void 0:g.handler,w=v==null?void 0:v(Lw(e,t,n,o,i)),S=!!v&&Ta(w);if((S||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||y._nonReactive.minPendingPromise)&&e.updateMatch(n,P=>({...P,isFetching:"loader"})),v){const P=S?await w:w;gs(e,e.router.getMatch(n),P),P!==void 0&&e.updateMatch(n,H=>({...H,loaderData:P}))}i._lazyPromise&&await i._lazyPromise;const E=y._nonReactive.minPendingPromise;E&&await E,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,P=>({...P,error:void 0,context:no(e,o),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(g){let v=g;if((v==null?void 0:v.name)==="AbortError"){if(y.abortController.signal.aborted){(c=y._nonReactive.loaderPromise)==null||c.resolve(),y._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,S=>({...S,status:S.status==="pending"?"success":S.status,isFetching:!1,context:no(e,o)}));return}const w=y._nonReactive.minPendingPromise;w&&await w,Kt(g)&&await((d=(l=i.options.notFoundComponent)==null?void 0:l.preload)==null?void 0:d.call(l)),gs(e,e.router.getMatch(n),g);try{(p=(h=i.options).onError)==null||p.call(h,g)}catch(S){v=S,gs(e,e.router.getMatch(n),S)}!mn(v)&&!Kt(v)&&await Ma(i,["errorComponent"]),e.updateMatch(n,S=>({...S,error:v,context:no(e,o),status:"error",isFetching:!1}))}}catch(y){const g=e.router.getMatch(n);g&&(g._nonReactive.loaderPromise=void 0),gs(e,g,y)}},aP=async(e,t,n)=>{var w,S,E,P;async function o(H,_,O,C,D){const T=Date.now()-_.updatedAt,L=H?D.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:D.options.staleTime??e.router.options.defaultStaleTime??0,$=D.options.shouldReload,q=typeof $=="function"?$(Lw(e,t,i,n,D)):$,{status:ee,invalid:se}=C,K=T>=L&&(!!e.forceStaleReload||C.cause==="enter"||O!==void 0&&O!==C.id);l=ee==="success"&&(se||(q??K)),H&&D.options.preload===!1||(l&&!e.sync&&y?(d=!0,(async()=>{var k,U;try{await Jv(e,t,i,n,D);const V=e.router.getMatch(i);(k=V._nonReactive.loaderPromise)==null||k.resolve(),(U=V._nonReactive.loadPromise)==null||U.resolve(),V._nonReactive.loaderPromise=void 0,V._nonReactive.loadPromise=void 0}catch(V){mn(V)&&await e.router.navigate(V.options)}})()):ee!=="success"||l?await Jv(e,t,i,n,D):Qv(e,i,n))}const{id:i,routeId:c}=e.matches[n];let l=!1,d=!1;const h=e.router.looseRoutesById[c],p=h.options.loader,y=((typeof p=="function"||p==null?void 0:p.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(Aw(e,i)){if(!e.router.getMatch(i))return e.matches[n];Qv(e,i,n)}else{const H=e.router.getMatch(i),_=e.router.stores.matchesId.get()[n],O=((w=_&&e.router.stores.matchStores.get(_)||null)==null?void 0:w.routeId)===c?_:(S=e.router.stores.matches.get().find(D=>D.routeId===c))==null?void 0:S.id,C=Al(e,i);if(H._nonReactive.loaderPromise){if(H.status==="success"&&!e.sync&&!H.preload&&y)return H;await H._nonReactive.loaderPromise;const D=e.router.getMatch(i),T=D._nonReactive.error||D.error;T&&gs(e,D,T),D.status==="pending"&&await o(C,H,O,D,h)}else{const D=C&&!e.router.stores.matchStores.has(i),T=e.router.getMatch(i);T._nonReactive.loaderPromise=ci(),D!==T.preload&&e.updateMatch(i,L=>({...L,preload:D})),await o(C,H,O,T,h)}}const g=e.router.getMatch(i);d||((E=g._nonReactive.loaderPromise)==null||E.resolve(),(P=g._nonReactive.loadPromise)==null||P.resolve(),g._nonReactive.loadPromise=void 0),clearTimeout(g._nonReactive.pendingTimeout),g._nonReactive.pendingTimeout=void 0,d||(g._nonReactive.loaderPromise=void 0),g._nonReactive.dehydrated=void 0;const v=d?g.isFetching:!1;return v!==g.isFetching||g.invalid!==!1?(e.updateMatch(i,H=>({...H,isFetching:v,invalid:!1})),e.router.getMatch(i)):g};async function Gv(e){var v,w;const t=e,n=[];nP(t.router)&&am(t);let o;for(let S=0;S<t.matches.length;S++){try{const E=oP(t,S);Ta(E)&&await E}catch(E){if(mn(E))throw E;if(Kt(E))o=E;else if(!t.preload)throw E;break}if(t.serialError||t.firstBadMatchIndex!=null)break}const i=t.firstBadMatchIndex??t.matches.length,c=o&&!t.preload?Kv(t,o):void 0,l=o&&t.preload?0:c!==void 0?Math.min(c+1,i):i;let d,h;for(let S=0;S<l;S++)n.push(aP(t,n,S));try{await Promise.all(n)}catch{const S=await Promise.allSettled(n);for(const E of S){if(E.status!=="rejected")continue;const P=E.reason;if(mn(P))throw P;Kt(P)?d??(d=P):h??(h=P)}if(h!==void 0)throw h}const p=d??(o&&!t.preload?o:void 0);let y=t.firstBadMatchIndex!==void 0?t.firstBadMatchIndex:t.matches.length-1;if(!p&&o&&t.preload)return t.matches;if(p){const S=Kv(t,p);S===void 0&&Br();const E=t.matches[S],P=t.router.looseRoutesById[E.routeId],H=(v=t.router.options)==null?void 0:v.defaultNotFoundComponent;!P.options.notFoundComponent&&H&&(P.options.notFoundComponent=H),p.routeId=E.routeId;const _=E.routeId===t.router.routeTree.id;t.updateMatch(E.id,O=>({...O,..._?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:p},isFetching:!1})),y=S,await Ma(P,["notFoundComponent"])}else if(!t.preload){const S=t.matches[0];S.globalNotFound||(w=t.router.getMatch(S.id))!=null&&w.globalNotFound&&t.updateMatch(S.id,E=>({...E,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const S=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Ma(S,["errorComponent"])}for(let S=0;S<=y;S++){const{id:E,routeId:P}=t.matches[S],H=t.router.looseRoutesById[P];try{const _=iP(t,E,H);if(_){const O=await _;t.updateMatch(E,C=>({...C,...O}))}}catch(_){console.error(`Error executing head for route ${P}:`,_)}}const g=am(t);if(Ta(g)&&await g,p)throw p;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function Yv(e,t){const n=t.map(o=>{var i,c;return(c=(i=e.options[o])==null?void 0:i.preload)==null?void 0:c.call(i)}).filter(Boolean);if(n.length!==0)return Promise.all(n)}function Ma(e,t=ju){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(o=>{const{id:i,...c}=o.options;Object.assign(e.options,c),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const n=()=>e._componentsLoaded?void 0:t===ju?(()=>{if(e._componentsPromise===void 0){const o=Yv(e,ju);o?e._componentsPromise=o.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Yv(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function Ow(e){var t;for(const n of ju)if((t=e.options[n])!=null&&t.preload)return!0;return!1}const ju=["component","errorComponent","pendingComponent","notFoundComponent"];function cP(e){return{input:({url:t})=>{for(const n of e)t=cm(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Nw(e[n],t);return t}}}function uP(e){const t=Tw(e.basepath),n=`/${t}`,o=e.caseSensitive?n:n.toLowerCase(),i=`${o}/`;return{input:({url:c})=>{const l=e.caseSensitive?c.pathname:c.pathname.toLowerCase();return l===o?c.pathname="/":l.startsWith(i)&&(c.pathname=c.pathname.slice(n.length)),c},output:({url:c})=>(c.pathname=Du(["/",t,c.pathname]),c)}}function cm(e,t){var o;const n=(o=e==null?void 0:e.input)==null?void 0:o.call(e,{url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function Nw(e,t){var o;const n=(o=e==null?void 0:e.output)==null?void 0:o.call(e,{url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function lP(e,t){const{createMutableStore:n,createReadonlyStore:o,batch:i,init:c}=t,l=new Map,d=new Map,h=new Map,p=n(e.status),y=n(e.loadedAt),g=n(e.isLoading),v=n(e.isTransitioning),w=n(e.location),S=n(e.resolvedLocation),E=n(e.statusCode),P=n(e.redirect),H=n([]),_=n([]),O=n([]),C=o(()=>wh(l,H.get())),D=o(()=>wh(d,_.get())),T=o(()=>wh(h,O.get())),L=o(()=>H.get()[0]),$=o(()=>H.get().some(B=>{var X;return((X=l.get(B))==null?void 0:X.get().status)==="pending"})),q=o(()=>{var B;return{locationHref:w.get().href,resolvedLocationHref:(B=S.get())==null?void 0:B.href,status:p.get()}}),ee=o(()=>({status:p.get(),loadedAt:y.get(),isLoading:g.get(),isTransitioning:v.get(),matches:C.get(),location:w.get(),resolvedLocation:S.get(),statusCode:E.get(),redirect:P.get()})),se=Aa(64);function K(B){let X=se.get(B);return X||(X=o(()=>{const ne=H.get();for(const te of ne){const I=l.get(te);if(I&&I.routeId===B)return I.get()}}),se.set(B,X)),X}const k={status:p,loadedAt:y,isLoading:g,isTransitioning:v,location:w,resolvedLocation:S,statusCode:E,redirect:P,matchesId:H,pendingIds:_,cachedIds:O,matches:C,pendingMatches:D,cachedMatches:T,firstId:L,hasPending:$,matchRouteDeps:q,matchStores:l,pendingMatchStores:d,cachedMatchStores:h,__store:ee,getRouteMatchStore:K,setMatches:U,setPending:V,setCached:J};U(e.matches),c==null||c(k);function U(B){kh(B,l,H,n,i)}function V(B){kh(B,d,_,n,i)}function J(B){kh(B,h,O,n,i)}return k}function wh(e,t){const n=[];for(const o of t){const i=e.get(o);i&&n.push(i.get())}return n}function kh(e,t,n,o,i){const c=e.map(d=>d.id),l=new Set(c);i(()=>{for(const d of t.keys())l.has(d)||t.delete(d);for(const d of e){const h=t.get(d.id);if(!h){const p=o(d);p.routeId=d.routeId,t.set(d.id,p);continue}h.routeId=d.routeId,h.get()!==d&&h.set(d)}O2(n.get(),c)||n.set(c)})}var vs="__TSR_index",Xv="popstate",Zv="beforeunload";function fP(e){let t=e.getLocation();const n=new Set,o=l=>{t=e.getLocation(),n.forEach(d=>d({location:t,action:l}))},i=l=>{e.notifyOnIndexChange??!0?o(l):t=e.getLocation()},c=async({task:l,navigateOpts:d,...h})=>{var g,v;if((d==null?void 0:d.ignoreBlocker)??!1){l();return}const p=((g=e.getBlockers)==null?void 0:g.call(e))??[],y=h.type==="PUSH"||h.type==="REPLACE";if(typeof document<"u"&&p.length&&y)for(const w of p){const S=La(h.path,h.state);if(await w.blockerFn({currentLocation:t,nextLocation:S,action:h.type})){(v=e.onBlocked)==null||v.call(e);return}}l()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:l=>(n.add(l),()=>{n.delete(l)}),push:(l,d,h)=>{const p=t.state[vs];d=eS(p+1,d),c({task:()=>{e.pushState(l,d),o({type:"PUSH"})},navigateOpts:h,type:"PUSH",path:l,state:d})},replace:(l,d,h)=>{const p=t.state[vs];d=eS(p,d),c({task:()=>{e.replaceState(l,d),o({type:"REPLACE"})},navigateOpts:h,type:"REPLACE",path:l,state:d})},go:(l,d)=>{c({task:()=>{e.go(l),i({type:"GO",index:l})},navigateOpts:d,type:"GO"})},back:l=>{c({task:()=>{e.back((l==null?void 0:l.ignoreBlocker)??!1),i({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{c({task:()=>{e.forward((l==null?void 0:l.ignoreBlocker)??!1),i({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>t.state[vs]!==0,createHref:l=>e.createHref(l),block:l=>{var h;if(!e.setBlockers)return()=>{};const d=((h=e.getBlockers)==null?void 0:h.call(e))??[];return e.setBlockers([...d,l]),()=>{var y,g;const p=((y=e.getBlockers)==null?void 0:y.call(e))??[];(g=e.setBlockers)==null||g.call(e,p.filter(v=>v!==l))}},flush:()=>{var l;return(l=e.flush)==null?void 0:l.call(e)},destroy:()=>{var l;return(l=e.destroy)==null?void 0:l.call(e)},notify:o}}function eS(e,t){t||(t={});const n=hp();return{...t,key:n,__TSR_key:n,[vs]:e}}function Dw(e){var $,q;const t=(e==null?void 0:e.window)??(typeof document<"u"?window:void 0),n=t.history.pushState,o=t.history.replaceState;let i=[];const c=()=>i,l=ee=>i=ee,d=(e==null?void 0:e.createHref)??(ee=>ee),h=(e==null?void 0:e.parseLocation)??(()=>La(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!(($=t.history.state)!=null&&$.__TSR_key)&&!((q=t.history.state)!=null&&q.key)){const ee=hp();t.history.replaceState({[vs]:0,key:ee,__TSR_key:ee},"")}let p=h(),y,g=!1,v=!1,w=!1,S=!1;const E=()=>p;let P,H;const _=()=>{P&&(L._ignoreSubscribers=!0,(P.isPush?t.history.pushState:t.history.replaceState)(P.state,"",P.href),L._ignoreSubscribers=!1,P=void 0,H=void 0,y=void 0)},O=(ee,se,K)=>{const k=d(se);H||(y=p),p=La(se,K),P={href:k,state:K,isPush:(P==null?void 0:P.isPush)||ee==="push"},H||(H=Promise.resolve().then(()=>_()))},C=ee=>{p=h(),L.notify({type:ee})},D=async()=>{if(v){v=!1;return}const ee=h(),se=ee.state[vs]-p.state[vs],K=se===1,k=se===-1,U=!K&&!k||g;g=!1;const V=U?"GO":k?"BACK":"FORWARD",J=U?{type:"GO",index:se}:{type:k?"BACK":"FORWARD"};if(w)w=!1;else{const B=c();if(typeof document<"u"&&B.length){for(const X of B)if(await X.blockerFn({currentLocation:p,nextLocation:ee,action:V})){v=!0,t.history.go(1),L.notify(J);return}}}p=h(),L.notify(J)},T=ee=>{if(S){S=!1;return}let se=!1;const K=c();if(typeof document<"u"&&K.length)for(const k of K){const U=k.enableBeforeUnload??!0;if(U===!0){se=!0;break}if(typeof U=="function"&&U()===!0){se=!0;break}}if(se)return ee.preventDefault(),ee.returnValue=""},L=fP({getLocation:E,getLength:()=>t.history.length,pushState:(ee,se)=>O("push",ee,se),replaceState:(ee,se)=>O("replace",ee,se),back:ee=>(ee&&(w=!0),S=!0,t.history.back()),forward:ee=>{ee&&(w=!0),S=!0,t.history.forward()},go:ee=>{g=!0,t.history.go(ee)},createHref:ee=>d(ee),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=o,t.removeEventListener(Zv,T,{capture:!0}),t.removeEventListener(Xv,D)},onBlocked:()=>{y&&p!==y&&(p=y)},getBlockers:c,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(Zv,T,{capture:!0}),t.addEventListener(Xv,D),t.history.pushState=function(...ee){const se=n.apply(t.history,ee);return L._ignoreSubscribers||C("PUSH"),se},t.history.replaceState=function(...ee){const se=o.apply(t.history,ee);return L._ignoreSubscribers||C("REPLACE"),se},L}function dP(e){const t=typeof document<"u"?window:void 0;return Dw({window:t,parseLocation:()=>{const n=t.location.hash.split("#").slice(1),o=n[0]??"/",i=t.location.search,c=n.slice(1);return La(`${o}${i}${c.length===0?"":`#${c.join("#")}`}`,t.history.state)},createHref:n=>`${t.location.pathname}${t.location.search}#${n}`})}function hP(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function La(e,t){const n=hP(e),o=n.indexOf("#"),i=n.indexOf("?"),c=hp();return{href:n,pathname:n.substring(0,o>0?i>0?Math.min(o,i):o:i>0?i:n.length),hash:o>-1?n.substring(o):"",search:i>-1?n.slice(i,o===-1?void 0:o):"",state:t||{[vs]:0,key:c,__TSR_key:c}}}function hp(){return(Math.random()+1).toString(36).substring(7)}function ri(e,t){const n=t,o=e;return{fromLocation:n,toLocation:o,pathChanged:(n==null?void 0:n.pathname)!==o.pathname,hrefChanged:(n==null?void 0:n.href)!==o.href,hashChanged:(n==null?void 0:n.hash)!==o.hash}}const um=new WeakMap;var mP=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.startTransition=n=>n(),this.update=n=>{var y;const o=this.options,i=this.basepath??(o==null?void 0:o.basepath)??"/",c=this.basepath===void 0,l=o==null?void 0:o.rewrite;if(this.options={...o,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Q2(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Dw()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let g;this.resolvePathCache=Aa(1e3),g=this.buildRouteTree(),this.setRoutes(g)}if(!this.stores&&this.latestLocation){const g=this.getStoreConfig(this);this.batch=g.batch,this.stores=lP(gP(this.latestLocation),g),PP(this)}let d=!1;const h=this.options.basepath??"/",p=this.options.rewrite;if(c||i!==h||l!==p){this.basepath=h;const g=[],v=Tw(h);v&&v!=="/"&&g.push(uP({basepath:h})),p&&g.push(p),this.rewrite=g.length===0?void 0:g.length===1?g[0]:cP(g),this.history&&this.updateLatestLocation(),d=!0}d&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof((y=window.CSS)==null?void 0:y.supports)=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a))"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=z2(this.routeTree,this.options.caseSensitive,(o,i)=>{o.init({originalIndex:i})});return this.options.routeMasks&&D2(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,o)=>{const i={eventType:n,fn:o};return this.subscribers.add(i),()=>{this.subscribers.delete(i)}},this.emit=n=>{this.subscribers.forEach(o=>{o.eventType===n.type&&o.fn(n)})},this.parseLocation=(n,o)=>{const i=({pathname:h,search:p,hash:y,href:g,state:v})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(h)){const H=this.options.parseSearch(p),_=this.options.stringifySearch(H);return{href:h+_+y,publicHref:h+_+y,pathname:fa(h).path,external:!1,searchStr:_,search:Hs(o==null?void 0:o.search,H),hash:fa(y.slice(1)).path,state:Ys(o==null?void 0:o.state,v)}}const w=new URL(g,this.origin),S=cm(this.rewrite,w),E=this.options.parseSearch(S.search),P=this.options.stringifySearch(E);return S.search=P,{href:S.href.replace(S.origin,""),publicHref:g,pathname:fa(S.pathname).path,external:!!this.rewrite&&S.origin!==this.origin,searchStr:P,search:Hs(o==null?void 0:o.search,E),hash:fa(S.hash.slice(1)).path,state:Ys(o==null?void 0:o.state,v)}},c=i(n),{__tempLocation:l,__tempKey:d}=c.state;if(l&&(!d||d===this.tempLocationKey)){const h=i(l);return h.state.key=c.state.key,h.state.__TSR_key=c.state.__TSR_key,delete h.state.__tempLocation,{...h,maskedLocation:c}}return c},this.resolvePathWithBase=(n,o)=>K2({base:n,to:o.includes("//")?dp(o):o,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,o,i)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:o},i):this.matchRoutesInternal(n,o),this.getMatchedRoutes=n=>yP({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const o=this.getMatch(n);o&&(o.abortController.abort(),clearTimeout(o._nonReactive.pendingTimeout),o._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(n=>{this.cancelMatch(n)}),this.stores.matchesId.get().forEach(n=>{var i;if(this.stores.pendingMatchStores.has(n))return;const o=(i=this.stores.matchStores.get(n))==null?void 0:i.get();o&&(o.status==="pending"||o.isFetching==="loader")&&this.cancelMatch(n)})},this.buildLocation=n=>{const o=(c={})=>{var se,K;const l=c._fromLocation||this.pendingBuiltLocation||this.latestLocation,d=this.matchRoutesLightweight(l);c.from;const h=c.unsafeRelative==="path"?l.pathname:c.from??d.fullPath,p=c.to?`${c.to}`:void 0,y=d.search,g=Object.assign(Object.create(null),d.params),v=(p==null?void 0:p.charCodeAt(0))===47?"/":this.resolvePathWithBase(h,"."),w=p?this.resolvePathWithBase(v,p):v,S=c.params===!1||c.params===null?Object.create(null):(c.params??!0)===!0?g:Object.assign(g,Gs(c.params,g)),E=this.routesByPath[$r(w)];let P;if(E)P=this.getRouteBranch(E);else if(w.includes("$"))P=[];else{const k=this.getMatchedRoutes(w);P=k.matchedRoutes,this.options.notFoundRoute&&(!k.foundRoute||k.foundRoute.path!=="/"&&k.routeParams["**"])&&(P=[...P,this.options.notFoundRoute])}if(P.length&&Cw(S))for(const k of P){const U=((se=k.options.params)==null?void 0:se.stringify)??k.options.stringifyParams;if(U)try{Object.assign(S,U(S))}catch{}}const H=n.leaveParams?w:fa(Wv({path:w,params:S,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let _=y;if(n._includeValidateSearch&&((K=this.options.search)!=null&&K.strict)){const k={};P.forEach(U=>{if(U.options.validateSearch)try{Object.assign(k,$u(U.options.validateSearch,{...k,..._}))}catch{}}),_=k}_=vP({search:_,dest:c,destRoutes:P,_includeValidateSearch:n._includeValidateSearch}),_=Hs(y,_);const O=this.options.stringifySearch(_),C=c.hash===!0?l.hash:c.hash?Gs(c.hash,l.hash):void 0,D=C?`#${C}`:"";let T=c.state===!0?l.state:c.state?Gs(c.state,l.state):{};T=Ys(l.state,T);const L=`${H}${O}${D}`;let $,q,ee=!1;if(this.rewrite){const k=new URL(L,this.origin),U=Nw(this.rewrite,k);$=k.href.replace(k.origin,""),U.origin!==this.origin?(q=U.href,ee=!0):q=U.pathname+U.search+U.hash}else $=L2(L),q=$;return{publicHref:q,href:$,pathname:H,search:_,searchStr:O,state:T,hash:C??"",external:ee,unmaskOnReload:c.unmaskOnReload}},i=(c={},l)=>{const d=o(c);let h=l?o(l):void 0;if(!h){const p=Object.create(null);if(this.options.routeMasks){const y=j2(d.pathname,this.processedTree);if(y){Object.assign(p,y.rawParams);const{from:g,params:v,...w}=y.route,S=v===!1||v===null?Object.create(null):(v??!0)===!0?p:Object.assign(p,Gs(v,p));l={from:n.from,...w,params:S},h=o(l)}}}return h&&(d.maskedLocation=h),d};return n.mask?i(n,{from:n.from,...n.mask}):i(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:o,...i})=>{let c;const l=()=>{const p=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];p.forEach(g=>{i.state[g]=this.latestLocation.state[g]});const y=eo(i.state,this.latestLocation.state);return p.forEach(g=>{delete i.state[g]}),y},d=$r(this.latestLocation.href)===$r(i.href);let h=this.commitLocationPromise;if(this.commitLocationPromise=ci(()=>{h==null||h.resolve(),h=void 0}),d&&l())this.load();else{let{maskedLocation:p,hashScrollIntoView:y,...g}=i;p&&(g={...p,state:{...p.state,__tempKey:void 0,__tempLocation:{...g,search:g.searchStr,state:{...g.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(g.unmaskOnReload??this.options.unmaskOnReload??!1)&&(g.state.__tempKey=this.tempLocationKey)),g.state.__hashScrollIntoViewOptions=y??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,c=i.replace?"REPLACE":"PUSH",this.history[c==="REPLACE"?"replace":"push"](g.publicHref,g.state,{ignoreBlocker:o})}return this._scroll.next=i.resetScroll??!0,this.history.subscribers.size||this.load(c?{action:{type:c}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:o,hashScrollIntoView:i,viewTransition:c,ignoreBlocker:l,href:d,...h}={})=>{if(d){const g=this.history.location.state.__TSR_index,v=La(d,{__TSR_index:n?g:g+1}),w=new URL(v.pathname,this.origin);h.to=cm(this.rewrite,w).pathname,h.search=this.options.parseSearch(v.search),h.hash=v.hash.slice(1)}const p=this.buildLocation({...h,_includeValidateSearch:!0});this.pendingBuiltLocation=p;const y=this.commitLocation({...p,viewTransition:c,replace:n,resetScroll:o,hashScrollIntoView:i,ignoreBlocker:l});return Promise.resolve().then(()=>{this.pendingBuiltLocation===p&&(this.pendingBuiltLocation=void 0)}),y},this.navigate=async({to:n,reloadDocument:o,href:i,publicHref:c,...l})=>{var h,p;let d=!1;if(i)try{new URL(`${i}`),d=!0}catch{}if(d&&!o&&(o=!0),o){if(n!==void 0||!i){const g=this.buildLocation({to:n,...l});i=i??g.publicHref,c=c??g.publicHref}const y=!d&&c?c:i;if(Zu(y,this.protocolAllowlist))return Promise.resolve();if(!l.ignoreBlocker){const g=((p=(h=this.history).getBlockers)==null?void 0:p.call(h))??[];for(const v of g)if(v!=null&&v.blockerFn&&await v.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return l.replace?window.location.replace(y):window.location.href=y,Promise.resolve()}return this.buildAndCommitLocation({...l,href:i,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation),o=this.stores.cachedMatches.get().filter(i=>!n.some(c=>c.id===i.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(n),this.stores.setCached(o)})},this.load=async n=>{var p;const o=(p=n==null?void 0:n.action)==null?void 0:p.type;let i,c,l;const d=this.stores.resolvedLocation.get()??this.stores.location.get();for(l=new Promise(y=>{this.startTransition(async()=>{var g;try{this.beforeLoad(),o?um.set(this.latestLocation,o):um.delete(this.latestLocation);const v=this.latestLocation,w=ri(v,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...w}),this.emit({type:"onBeforeLoad",...w}),await Gv({router:this,sync:n==null?void 0:n.sync,forceStaleReload:d.href===v.href,matches:this.stores.pendingMatches.get(),location:v,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{var _,O;let S=null,E=null,P=null,H=null;this.batch(()=>{const C=this.stores.pendingMatches.get(),D=C.length,T=this.stores.matches.get();S=D?T.filter(q=>!this.stores.pendingMatchStores.has(q.id)):null;const L=new Set;for(const q of this.stores.pendingMatchStores.values())q.routeId&&L.add(q.routeId);const $=new Set;for(const q of this.stores.matchStores.values())q.routeId&&$.add(q.routeId);E=D?T.filter(q=>!L.has(q.routeId)):null,P=D?C.filter(q=>!$.has(q.routeId)):null,H=D?C.filter(q=>$.has(q.routeId)):T,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),D&&(this.stores.setMatches(C),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...S.filter(q=>q.status!=="error"&&q.status!=="notFound"&&q.status!=="redirected")]),this.clearExpiredCache())});for(const[C,D]of[[E,"onLeave"],[P,"onEnter"],[H,"onStay"]])if(C)for(const T of C)(O=(_=this.looseRoutesById[T.routeId].options)[D])==null||O.call(_,T)})})}})}catch(v){mn(v)?(i=v,this.navigate({...i.options,replace:!0,ignoreBlocker:!0})):Kt(v)&&(c=v);const w=i?i.status:c?404:this.stores.matches.get().some(S=>S.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(w),this.stores.redirect.set(i)})}this.latestLoadPromise===l&&((g=this.commitLocationPromise)==null||g.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),y()})}),this.latestLoadPromise=l,await l;this.latestLoadPromise&&l!==this.latestLoadPromise;)await this.latestLoadPromise;let h;this.hasNotFoundMatch()?h=404:this.stores.matches.get().some(y=>y.status==="error")&&(h=500),h!==void 0&&this.stores.statusCode.set(h)},this.startViewTransition=n=>{const o=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,o&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let i;if(typeof o=="object"&&this.isViewTransitionTypesSupported){const c=this.latestLocation,l=this.stores.resolvedLocation.get(),d=typeof o.types=="function"?o.types(ri(c,l)):o.types;if(d===!1){n();return}i={update:n,types:d}}else i=n;document.startViewTransition(i)}else n()},this.updateMatch=(n,o)=>{this.startTransition(()=>{const i=this.stores.pendingMatchStores.get(n);if(i){i.set(o);return}const c=this.stores.matchStores.get(n);if(c){c.set(o);return}const l=this.stores.cachedMatchStores.get(n);if(l){const d=o(l.get());d.status==="redirected"?this.stores.cachedMatchStores.delete(n)&&this.stores.cachedIds.set(h=>h.filter(p=>p!==n)):l.set(d)}})},this.getMatch=n=>{var o,i,c;return((o=this.stores.cachedMatchStores.get(n))==null?void 0:o.get())??((i=this.stores.pendingMatchStores.get(n))==null?void 0:i.get())??((c=this.stores.matchStores.get(n))==null?void 0:c.get())},this.invalidate=n=>{const o=i=>{var c;return((c=n==null?void 0:n.filter)==null?void 0:c.call(n,i))??!0?{...i,invalid:!0,...n!=null&&n.forcePending||i.status==="error"||i.status==="notFound"?{status:"pending",error:void 0}:void 0}:i};return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(o)),this.stores.setCached(this.stores.cachedMatches.get().map(o)),this.stores.setPending(this.stores.pendingMatches.get().map(o))}),this.shouldViewTransition=!1,this.load({sync:n==null?void 0:n.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const o=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const i=n.options._builtLocation??this.buildLocation(n.options),c=this.getParsedLocationHref(i);n.options.href=c,n.headers.set("Location",c)}else if(o)try{const i=new URL(o);if(this.origin&&i.origin===this.origin){const c=i.pathname+i.search+i.hash;n.options.href=c,n.headers.set("Location",c)}}catch{}if(n.options.href&&!n.options._builtLocation&&Zu(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const o=n==null?void 0:n.filter;o!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(i=>!o(i))):this.stores.setCached([])},this.clearExpiredCache=()=>{const n=Date.now(),o=i=>{const c=this.looseRoutesById[i.routeId];if(!c.options.loader)return!0;const l=(i.preload?c.options.preloadGcTime??this.options.defaultPreloadGcTime:c.options.gcTime??this.options.defaultGcTime)??300*1e3;return i.status==="error"?!0:n-i.updatedAt>=l};this.clearCache({filter:o})},this.loadRouteChunk=Ma,this.preloadRoute=async n=>{const o=n._builtLocation??this.buildLocation(n);let i=this.matchRoutes(o,{throwOnError:!0,preload:!0,dest:n});const c=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),l=new Set([...c,...this.stores.cachedIds.get()]),d=i.filter(h=>!l.has(h.id));if(d.length){const h=this.stores.cachedMatches.get();this.stores.setCached([...h,...d])}try{return i=await Gv({router:this,matches:i,location:o,preload:!0,updateMatch:(h,p)=>{c.has(h)?i=i.map(y=>y.id===h?p(y):y):this.updateMatch(h,p)}}),i}catch(h){if(mn(h))return h.options.reloadDocument?void 0:await this.preloadRoute({...h.options,_fromLocation:o});Kt(h)||console.error(h);return}},this.matchRoute=(n,o)=>{const i={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},c=this.buildLocation(i);if(o!=null&&o.pending&&this.stores.status.get()!=="pending")return!1;const l=((o==null?void 0:o.pending)===void 0?!this.stores.isLoading.get():o.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),d=$2(c.pathname,(o==null?void 0:o.caseSensitive)??!1,(o==null?void 0:o.fuzzy)??!1,l.pathname,this.processedTree);return!d||n.params&&!eo(d.rawParams,n.params,{partial:!0})?!1:(o==null?void 0:o.includeSearch)??!0?eo(l.search,c.search,{partial:!0})?d.rawParams:!1:d.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(n=>n.status==="notFound"||n.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??X2,parseSearch:e.parseSearch??Y2,protocolAllowlist:e.protocolAllowlist??M2}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;const o=this.options.notFoundRoute;o&&(o.init({originalIndex:99999999999}),this.routesById[o.id]=o)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=Iw(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e!=null&&e.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){var y,g;const n=this.getMatchedRoutes(e.pathname),{foundRoute:o,routeParams:i}=n;let{matchedRoutes:c}=n,l=!1;(o?o.path!=="/"&&i["**"]:$r(e.pathname))&&(this.options.notFoundRoute?c=[...c,this.options.notFoundRoute]:l=!0);const d=l?xP(this.options.notFoundMode,c):void 0,h=new Array(c.length),p=new Map;for(const v of this.stores.matchStores.values())v.routeId&&p.set(v.routeId,v.get());for(let v=0;v<c.length;v++){const w=c[v],S=h[v-1];let E,P,H;{const U=(S==null?void 0:S.search)??e.search,V=(S==null?void 0:S._strictSearch)??void 0;try{const J=$u(w.options.validateSearch,{...U})??void 0;E={...U,...J},P={...V,...J},H=void 0}catch(J){let B=J;if(J instanceof tl||(B=new tl(J.message,{cause:J})),t!=null&&t.throwOnError)throw B;E=U,P={},H=B}}const _=((g=(y=w.options).loaderDeps)==null?void 0:g.call(y,{search:E}))??"",O=_?JSON.stringify(_):"",{interpolatedPath:C,usedParams:D}=Wv({path:w.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),T=w.id+C+O,L=this.getMatch(T),$=p.get(w.id),q=(L==null?void 0:L._strictParams)??D;let ee;if(!L)try{tS(w,q)}catch(U){if(Kt(U)||mn(U)?ee=U:ee=new pP(U.message,{cause:U}),t!=null&&t.throwOnError)throw ee}Object.assign(i,q);const se=$?"stay":"enter";let K;if(L)K={...L,cause:se,params:($==null?void 0:$.params)??i,_strictParams:q,search:Hs($?$.search:L.search,E),_strictSearch:P};else{const U=w.options.loader||w.options.beforeLoad||w.lazyFn||Ow(w)?"pending":"success";K={id:T,ssr:w.options.ssr,index:v,routeId:w.id,params:($==null?void 0:$.params)??i,_strictParams:q,pathname:C,updatedAt:Date.now(),search:$?Hs($.search,E):E,_strictSearch:P,searchError:void 0,status:U,isFetching:!1,error:void 0,paramsError:ee,__routeContext:void 0,_nonReactive:{loadPromise:ci()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:se,loaderDeps:$?Ys($.loaderDeps,_):_,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:w.options.staticData||{},fullPath:w.fullPath}}t!=null&&t.preload||(K.globalNotFound=d===w.id),K.searchError=H;const k=this.getParentContext(S);K.context={...k,...K.__routeContext,...K.__beforeLoadContext},h[v]=K}for(let v=0;v<h.length;v++){const w=h[v],S=this.looseRoutesById[w.routeId],E=this.getMatch(w.id),P=p.get(w.routeId);if(w.params=P?Hs(P.params,i):i,!E){const H=h[v-1],_=this.getParentContext(H);if(S.options.context){const O={deps:w.loaderDeps,params:w.params,context:_??{},location:e,navigate:C=>this.navigate({...C,_fromLocation:e}),buildLocation:this.buildLocation,cause:w.cause,abortController:w.abortController,preload:!!w.preload,matches:h,routeId:S.id};w.__routeContext=S.options.context(O)??void 0}w.context={..._,...w.__routeContext,...w.__beforeLoadContext}}}return h}matchRoutesLightweight(e){var p;const{matchedRoutes:t,routeParams:n}=this.getMatchedRoutes(e.pathname),o=Ra(t),i={...e.search};for(const y of t)try{Object.assign(i,$u(y.options.validateSearch,i))}catch{}const c=Ra(this.stores.matchesId.get()),l=c&&((p=this.stores.matchStores.get(c))==null?void 0:p.get()),d=l&&l.routeId===o.id&&l.pathname===e.pathname;let h;if(d)h=l.params;else{const y=Object.assign(Object.create(null),n);for(const g of t)try{tS(g,y)}catch{}h=y}return{matchedRoutes:t,fullPath:o.fullPath,search:i,params:h}}},tl=class extends Error{},pP=class extends Error{};function gP(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function $u(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new tl("Async validation not supported");if(n.issues)throw new tl(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function yP({pathname:e,routesById:t,processedTree:n}){const o=Object.create(null),i=$r(e);let c;const l=U2(i,n,!0);return l&&(c=l.route,Object.assign(o,l.rawParams)),{matchedRoutes:(l==null?void 0:l.branch)||[t.__root__],routeParams:o,foundRoute:c}}function vP({search:e,dest:t,destRoutes:n,_includeValidateSearch:o}){return SP(n)(e,t,o??!1)}function SP(e){var c;let t,n;const o=[];for(const l of e){const d=l.options;if("search"in d)(c=d.search)!=null&&c.middlewares&&o.push(...d.search.middlewares);else if(d.preSearchFilters||d.postSearchFilters){const p=({search:y,next:g})=>{const v=g(d.preSearchFilters?d.preSearchFilters.reduce((w,S)=>S(w),y):y);return d.postSearchFilters?d.postSearchFilters.reduce((w,S)=>S(w),v):v};o.push(p)}const h=d.validateSearch;if(h){const p=({search:y,next:g,meta:v})=>{const w=g(y);if(n)try{const S=$u(h,w);if(v&&S)for(const E in S)E in w||(v.defaulted||(v.defaulted=new Map)).set(E,S[E]);return{...w,...S}}catch{}return w};o.push(p)}}const i=(l,d,h)=>{if(l>=o.length){if(!t.search)return{};if(t.search===!0)return d;const y=Gs(t.search,d);return h&&(h.explicit=y),y}const p=(y,g)=>{if(g){const v=h||{};return{search:i(l+1,y,v),meta:v}}return i(l+1,y,h)};return o[l]({search:d,next:p,meta:h})};return function(d,h,p){return t=h,n=p,i(0,d)}}function xP(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const o=t[n];if(o.children)return o.id}return to}function tS(e,t){var o;const n=((o=e.options.params)==null?void 0:o.parse)??e.options.parseParams;if(n){const i=n(t);if(i===!1)throw new Error("Route params.parse returned false for a matched route");Object.assign(t,i)}}function wP(){try{return sessionStorage}catch{return}}const kP="tsr-scroll-restoration-v1_3",si=wP();function EP(){try{return JSON.parse((si==null?void 0:si.getItem("tsr-scroll-restoration-v1_3"))||"{}")}catch{return{}}}function _P(){try{si==null||si.setItem(kP,JSON.stringify(ds))}catch{}}const ds=EP(),nS="data-scroll-restoration-id",CP=e=>e.state.__TSR_key||e.href;function bP(e){const t=e.getAttribute(nS);if(t)return`[${nS}="${t}"]`;let n="",o=e,i;for(;i=o.parentNode;){let c=1,l=o;for(;l=l.previousElementSibling;)c++;const d=`${o.localName}:nth-child(${c})`;n=n?`${d} > ${n}`:d,o=i}return n}let bu=!1;const Zo="window";function lm(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function rS(e){const t=[];for(const n of e){if(n===Zo)continue;const o=lm(n);o&&t.push(o)}return t}function PP(e,t){const n=e.options.scrollRestoration,o=e._scroll;n&&(o.restoring=!0);const i=e.options.getScrollRestorationKey||CP,c=new Map,l=(p,y,g)=>{const v=c.get(p)||{};v.scrollX=y,v.scrollY=g,c.set(p,v)},d=p=>{if(!(bu||!o.restoring))if(p.target===document)l(Zo,scrollX,scrollY);else{const y=p.target;l(y,y.scrollLeft,y.scrollTop)}},h=p=>{if(!o.restoring)return;const y=ds[p]||(ds[p]={});for(const[g,v]of c)g===Zo?y[Zo]=v:g.isConnected&&(y[bP(g)]=v)};n&&!o.restoration&&(o.restoration=!0,bu=!1,history.scrollRestoration="manual",document.addEventListener("scroll",d,!0),e.subscribe("onBeforeLoad",p=>{p.fromLocation&&h(i(p.fromLocation)),c.clear()}),addEventListener("pagehide",()=>{h(i(e.stores.resolvedLocation.get()??e.stores.location.get())),_P()})),!o.reset&&(o.reset=!0,e.subscribe("onRendered",p=>{var P;const y=e.options.scrollRestorationBehavior,g=e.options.scrollToTopSelectors,v=o.next;let w;if(c.clear(),v||(o.next=!0),typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return;const S=i(p.toLocation),E=p.fromLocation&&i(p.fromLocation);if(o.restoring&&E&&E!==S){const H=ds[E];if(H){let _=ds[S];for(const O in H){if(O===Zo){if(v)continue}else{const C=lm(O);if(!C||v&&g&&(w??(w=rS(g)),w.includes(C)))continue}_||(_=ds[S]={}),_[O]??(_[O]=H[O])}}}bu=!0;try{const H=p.toLocation.hash,_=p.toLocation.state.__hashScrollIntoViewOptions??!0;let O=!1;if(v){const C=um.get(p.toLocation),D=H&&_&&(C==="PUSH"||C==="REPLACE"),T=o.restoring?ds[S]:void 0;if(T)for(const L in T){const{scrollX:$,scrollY:q}=T[L];if(L===Zo){if(D)continue;scrollTo({top:q,left:$,behavior:y}),O=!0}else{const ee=lm(L);ee&&(ee.scrollLeft=$,ee.scrollTop=q)}}if(!O&&!H){const L={top:0,left:0,behavior:y};if(scrollTo(L),g){w??(w=rS(g));for(const $ of w)$.scrollTo(L)}}}!O&&H&&_&&((P=document.getElementById(H))==null||P.scrollIntoView(_))}finally{bu=!1}}))}const FP="Error preloading route! ☝️";var jw=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=t=>{var h,p;this.originalIndex=t.originalIndex;const n=this.options,o=!(n!=null&&n.path)&&!(n!=null&&n.id);this.parentRoute=(p=(h=this.options).getParentRoute)==null?void 0:p.call(h),o?this._path=to:this.parentRoute||Br();let i=o?to:n==null?void 0:n.path;i&&i!=="/"&&(i=Rw(i));const c=(n==null?void 0:n.id)||i;let l=o?to:Du([this.parentRoute.id==="__root__"?"":this.parentRoute.id,c]);i==="__root__"&&(i="/"),l!=="__root__"&&(l=Du(["/",l]));const d=l==="__root__"?"/":Du([this.parentRoute.fullPath,i]);this._path=i,this._id=l,this._fullPath=d,this._to=$r(d)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>tP({from:this.fullPath,...t}),this.options=e||{},this.isRoot=!(e!=null&&e.getParentRoute),e!=null&&e.id&&(e!=null&&e.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}},IP=class extends jw{constructor(e){super(e)}};function mp(e){const t=e.errorComponent??pp;return F.jsx(RP,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:o})=>n?Y.createElement(t,{error:n,reset:o}):e.children})}var RP=class extends Y.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){const n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function pp({error:e}){const[t,n]=Y.useState(!1);return F.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[F.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[F.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),F.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(o=>!o),children:t?"Hide Error":"Show Error"})]}),F.jsx("div",{style:{height:".25rem"}}),t?F.jsx("div",{children:F.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?F.jsx("code",{children:e.message}):null})}):null]})}function TP({children:e,fallback:t=null}){return $w()?F.jsx(Ia.Fragment,{children:e}):F.jsx(Ia.Fragment,{children:t})}function $w(){return Ia.useSyncExternalStore(AP,()=>!0,()=>!1)}function AP(){return()=>{}}var Uw=Y.createContext(null);function An(e){return Y.useContext(Uw)}var Ml=Y.createContext(void 0),MP=Y.createContext(void 0),tt=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(tt||{});function LP({update:e,notify:t,unwatched:n}){return{link:o,unlink:i,propagate:c,checkDirty:l,shallowPropagate:d};function o(p,y,g){const v=y.depsTail;if(v!==void 0&&v.dep===p)return;const w=v!==void 0?v.nextDep:y.deps;if(w!==void 0&&w.dep===p){w.version=g,y.depsTail=w;return}const S=p.subsTail;if(S!==void 0&&S.version===g&&S.sub===y)return;const E=y.depsTail=p.subsTail={version:g,dep:p,sub:y,prevDep:v,nextDep:w,prevSub:S,nextSub:void 0};w!==void 0&&(w.prevDep=E),v!==void 0?v.nextDep=E:y.deps=E,S!==void 0?S.nextSub=E:p.subs=E}function i(p,y=p.sub){const g=p.dep,v=p.prevDep,w=p.nextDep,S=p.nextSub,E=p.prevSub;return w!==void 0?w.prevDep=v:y.depsTail=v,v!==void 0?v.nextDep=w:y.deps=w,S!==void 0?S.prevSub=E:g.subsTail=E,E!==void 0?E.nextSub=S:(g.subs=S)===void 0&&n(g),w}function c(p){let y=p.nextSub,g;e:do{const v=p.sub;let w=v.flags;if(w&60?w&12?w&4?!(w&48)&&h(p,v)?(v.flags=w|40,w&=1):w=0:v.flags=w&-9|32:w=0:v.flags=w|32,w&2&&t(v),w&1){const S=v.subs;if(S!==void 0){const E=(p=S).nextSub;E!==void 0&&(g={value:y,prev:g},y=E);continue}}if((p=y)!==void 0){y=p.nextSub;continue}for(;g!==void 0;)if(p=g.value,g=g.prev,p!==void 0){y=p.nextSub;continue e}break}while(!0)}function l(p,y){let g,v=0,w=!1;e:do{const S=p.dep,E=S.flags;if(y.flags&16)w=!0;else if((E&17)===17){if(e(S)){const P=S.subs;P.nextSub!==void 0&&d(P),w=!0}}else if((E&33)===33){(p.nextSub!==void 0||p.prevSub!==void 0)&&(g={value:p,prev:g}),p=S.deps,y=S,++v;continue}if(!w){const P=p.nextDep;if(P!==void 0){p=P;continue}}for(;v--;){const P=y.subs,H=P.nextSub!==void 0;if(H?(p=g.value,g=g.prev):p=P,w){if(e(y)){H&&d(P),y=p.sub;continue}w=!1}else y.flags&=-33;y=p.sub;const _=p.nextDep;if(_!==void 0){p=_;continue e}}return w}while(!0)}function d(p){do{const y=p.sub,g=y.flags;(g&48)===32&&(y.flags=g|16,(g&6)===2&&t(y))}while((p=p.nextSub)!==void 0)}function h(p,y){let g=y.depsTail;for(;g!==void 0;){if(g===p)return!0;g=g.prevDep}return!1}}function OP(e,t,n){var c,l,d;const o=typeof e=="object",i=o?e:void 0;return{next:(c=o?e.next:e)==null?void 0:c.bind(i),error:(l=o?e.error:t)==null?void 0:l.bind(i),complete:(d=o?e.complete:n)==null?void 0:d.bind(i)}}const fm=[];let Uu=0;const{link:sS,unlink:NP,propagate:DP,checkDirty:Bw,shallowPropagate:oS}=LP({update(e){return e._update()},notify(e){fm[dm++]=e,e.flags&=~tt.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=tt.Mutable|tt.Dirty,nl(e))}});let Pu=0,dm=0,pr,hm=0;function zw(e){try{++hm,e()}finally{--hm||Vw()}}function nl(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=NP(n,e)}function Vw(){if(!(hm>0)){for(;Pu<dm;){const e=fm[Pu];fm[Pu++]=void 0,e.notify()}Pu=0,dm=0}}function iS(e,t){const n=typeof e=="function",o=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?tt.None:tt.Mutable,get(){return pr!==void 0&&sS(i,pr,Uu),i._snapshot},subscribe(c){const l=OP(c),d={current:!1},h=jP(()=>{var p;i.get(),d.current?(p=l.next)==null||p.call(l,i._snapshot):d.current=!0});return{unsubscribe:()=>{h.stop()}}},_update(c){const l=pr,d=(t==null?void 0:t.compare)??Object.is;if(n)pr=i,++Uu,i.depsTail=void 0;else if(c===void 0)return!1;n&&(i.flags=tt.Mutable|tt.RecursedCheck);try{const h=i._snapshot,p=typeof c=="function"?c(h):c===void 0&&n?o(h):c;return h===void 0||!d(h,p)?(i._snapshot=p,!0):!1}finally{pr=l,n&&(i.flags&=~tt.RecursedCheck),nl(i)}}};return n?(i.flags=tt.Mutable|tt.Dirty,i.get=function(){const c=i.flags;if(c&tt.Dirty||c&tt.Pending&&Bw(i.deps,i)){if(i._update()){const l=i.subs;l!==void 0&&oS(l)}}else c&tt.Pending&&(i.flags=c&~tt.Pending);return pr!==void 0&&sS(i,pr,Uu),i._snapshot}):i.set=function(c){if(i._update(c)){const l=i.subs;l!==void 0&&(DP(l),oS(l),Vw())}},i}function jP(e){const t=()=>{const o=pr;pr=n,++Uu,n.depsTail=void 0,n.flags=tt.Watching|tt.RecursedCheck;try{return e()}finally{pr=o,n.flags&=~tt.RecursedCheck,nl(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:tt.Watching|tt.RecursedCheck,notify(){const o=this.flags;o&tt.Dirty||o&tt.Pending&&Bw(this.deps,this)?t():this.flags=tt.Watching},stop(){this.flags=tt.None,this.depsTail=void 0,nl(this)}};return t(),n}var Eh={exports:{}},_h={},Ch={exports:{}},bh={};/**
|
|
43
43
|
* @license React
|
|
44
44
|
* use-sync-external-store-shim.production.js
|
|
45
45
|
*
|
|
@@ -55,13 +55,13 @@ Error generating stack: `+m.message+`
|
|
|
55
55
|
*
|
|
56
56
|
* This source code is licensed under the MIT license found in the
|
|
57
57
|
* LICENSE file in the root directory of this source tree.
|
|
58
|
-
*/var uS;function BP(){if(uS)return _h;uS=1;var e=Qa(),t=UP();function n(p,y){return p===y&&(p!==0||1/p===1/y)||p!==p&&y!==y}var o=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,c=e.useRef,l=e.useEffect,d=e.useMemo,h=e.useDebugValue;return _h.useSyncExternalStoreWithSelector=function(p,y,g,v,w){var S=c(null);if(S.current===null){var E={hasValue:!1,value:null};S.current=E}else E=S.current;S=d(function(){function H(T){if(!_){if(_=!0,O=T,T=v(T),w!==void 0&&E.hasValue){var L=E.value;if(w(L,T))return C=L}return C=T}if(L=C,o(O,T))return L;var $=v(T);return w!==void 0&&w(L,$)?(O=T,L):(O=T,C=$)}var _=!1,O,C,D=g===void 0?null:g;return[function(){return H(y())},D===null?void 0:function(){return H(D())}]},[y,g,v,w]);var P=i(p,S[0],S[1]);return l(function(){E.hasValue=!0,E.value=P},[P]),h(P),P},_h}var lS;function zP(){return lS||(lS=1,Eh.exports=BP()),Eh.exports}var VP=zP();function qP(e,t){return e===t}function en(e,t,n=qP){const o=Y.useCallback(l=>{if(!e)return()=>{};const{unsubscribe:d}=e.subscribe(l);return d},[e]),i=Y.useCallback(()=>e==null?void 0:e.get(),[e]);return VP.useSyncExternalStoreWithSelector(o,i,i,t,n)}var Ph={get(){},subscribe(){return{unsubscribe(){}}}};function qw(e,t){const n=Y.useRef();return o=>{const i=e!=null&&e.select?e.select(o):o;return(e==null?void 0:e.structuralSharing)??t.options.defaultStructuralSharing?n.current=Ys(n.current,i):i}}function mo(e){const t=An(),n=Y.useContext(e.from?MP:Ml),o=e.from?t.stores.getRouteMatchStore(e.from):t.stores.matchStores.get(n),i=qw(e,t),c=en(o??Ph,l=>l?i(l):Ph);if(c!==Ph)return c;(e.shouldThrow??!0)&&Br()}function Ww(e){return mo({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Hw(e){const{select:t,...n}=e;return mo({...n,select:o=>t?t(o.loaderDeps):o.loaderDeps})}function Kw(e){return mo({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Qw(e){return mo({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Jw(e){const t=An();return Y.useCallback(n=>t.navigate({...n,from:n.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,t])}function Gw(e){return mo({...e,select:t=>e.select?e.select(t.context):t.context})}var WP=vw();function HP(e,t){const n=An(),o=I2(t),{activeProps:i,inactiveProps:c,activeOptions:l,to:d,preload:h,preloadDelay:p,preloadIntentProximity:y,hashScrollIntoView:g,replace:v,startTransition:w,resetScroll:S,viewTransition:E,children:P,target:H,disabled:_,style:O,className:C,onClick:D,onBlur:T,onFocus:L,onMouseEnter:$,onMouseLeave:q,onTouchStart:ee,ignoreBlocker:se,params:K,search:k,hash:U,state:V,mask:J,reloadDocument:B,unsafeRelative:X,from:ne,_fromLocation:te,...I}=e,Z=$w(),pe=Y.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),me=en(n.stores.location,Be=>Be,(Be,Lt)=>Be.href===Lt.href),le=Y.useMemo(()=>{const Be={_fromLocation:me,...pe};return n.buildLocation(Be)},[n,me,pe]),Pe=le.maskedLocation?le.maskedLocation.publicHref:le.publicHref,fe=le.maskedLocation?le.maskedLocation.external:le.external,xe=Y.useMemo(()=>XP(Pe,fe,n.history,_),[_,fe,Pe,n.history]),be=Y.useMemo(()=>{if(xe!=null&&xe.external)return Zu(xe.href,n.protocolAllowlist)?void 0:xe.href;if(!ZP(d)&&!(typeof d!="string"||d.indexOf(":")===-1))try{return new URL(d),Zu(d,n.protocolAllowlist)?void 0:d}catch{}},[d,xe,n.protocolAllowlist]),Ve=Y.useMemo(()=>{if(be)return!1;if(l!=null&&l.exact){if(!H2(me.pathname,le.pathname,n.basepath))return!1}else{const Be=el(me.pathname,n.basepath),Lt=el(le.pathname,n.basepath);if(!(Be.startsWith(Lt)&&(Be.length===Lt.length||Be[Lt.length]==="/")))return!1}return((l==null?void 0:l.includeSearch)??!0)&&!eo(me.search,le.search,{partial:!(l!=null&&l.exact),ignoreUndefined:!(l!=null&&l.explicitUndefined)})?!1:l!=null&&l.includeHash?Z&&me.hash===le.hash:!0},[l==null?void 0:l.exact,l==null?void 0:l.explicitUndefined,l==null?void 0:l.includeHash,l==null?void 0:l.includeSearch,me,be,Z,le.hash,le.pathname,le.search,n.basepath]),on=Ve?Gs(i,{})??KP:Fh,xn=Ve?Fh:Gs(c,{})??Fh,br=[C,on.className,xn.className].filter(Boolean).join(" "),Wr=(O||on.style||xn.style)&&{...O,...on.style,...xn.style},[mc,_i]=Y.useState(!1),wo=Y.useRef(!1),Pr=e.reloadDocument||be?!1:h??n.options.defaultPreload,As=p??n.options.defaultPreloadDelay??0,wn=Y.useCallback(()=>{n.preloadRoute({...pe,_builtLocation:le}).catch(Be=>{console.warn(Be),console.warn(FP)})},[n,pe,le]);F2(o,Y.useCallback(Be=>{Be!=null&&Be.isIntersecting&&wn()},[wn]),YP,{disabled:!!_||Pr!=="viewport"}),Y.useEffect(()=>{wo.current||!_&&Pr==="render"&&(wn(),wo.current=!0)},[_,wn,Pr]);const Hr=Be=>{const Lt=Be.currentTarget.getAttribute("target"),Hn=H!==void 0?H:Lt;if(!_&&!eF(Be)&&!Be.defaultPrevented&&(!Hn||Hn==="_self")&&Be.button===0){Be.preventDefault(),WP.flushSync(()=>{_i(!0)});const Eo=n.subscribe("onResolved",()=>{Eo(),_i(!1)});n.navigate({...pe,replace:v,resetScroll:S,hashScrollIntoView:g,startTransition:w,viewTransition:E,ignoreBlocker:se})}};if(be)return{...I,ref:o,href:be,...P&&{children:P},...H&&{target:H},..._&&{disabled:_},...O&&{style:O},...C&&{className:C},...D&&{onClick:D},...T&&{onBlur:T},...L&&{onFocus:L},...$&&{onMouseEnter:$},...q&&{onMouseLeave:q},...ee&&{onTouchStart:ee}};const ko=Be=>{if(_||Pr!=="intent")return;if(!As){wn();return}const Lt=Be.currentTarget;if(ha.has(Lt))return;const Hn=setTimeout(()=>{ha.delete(Lt),wn()},As);ha.set(Lt,Hn)},pc=Be=>{_||Pr!=="intent"||wn()},Ci=Be=>{if(_||!Pr||!As)return;const Lt=Be.currentTarget,Hn=ha.get(Lt);Hn&&(clearTimeout(Hn),ha.delete(Lt))};return{...I,...on,...xn,href:xe==null?void 0:xe.href,ref:o,onClick:Qo([D,Hr]),onBlur:Qo([T,Ci]),onFocus:Qo([L,ko]),onMouseEnter:Qo([$,ko]),onMouseLeave:Qo([q,Ci]),onTouchStart:Qo([ee,pc]),disabled:!!_,target:H,...Wr&&{style:Wr},...br&&{className:br},..._&&QP,...Ve&&JP,...Z&&mc&&GP}}var Fh={},KP={className:"active"},QP={role:"link","aria-disabled":!0},JP={"data-status":"active","aria-current":"page"},GP={"data-transitioning":"transitioning"},ha=new WeakMap,YP={rootMargin:"100px"},Qo=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function XP(e,t,n,o){if(!o)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function ZP(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var gp=Y.forwardRef((e,t)=>{const{_asChild:n,...o}=e,{type:i,...c}=HP(o,t),l=typeof o.children=="function"?o.children({isActive:c["data-status"]==="active"}):o.children;if(!n){const{disabled:d,...h}=c;return Y.createElement("a",h,l)}return Y.createElement(n,c,l)});function eF(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var tF=class extends jw{constructor(e){super(e),this.useMatch=t=>mo({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>Gw({...t,from:this.id}),this.useSearch=t=>Qw({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>Kw({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Hw({...t,from:this.id}),this.useLoaderData=t=>Ww({...t,from:this.id}),this.useNavigate=()=>Jw({from:this.fullPath}),this.Link=Ia.forwardRef((t,n)=>F.jsx(gp,{ref:n,from:this.fullPath,...t}))}};function Yw(e){return new tF(e)}var nF=class extends IP{constructor(e){super(e),this.useMatch=t=>mo({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>Gw({...t,from:this.id}),this.useSearch=t=>Qw({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>Kw({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Hw({...t,from:this.id}),this.useLoaderData=t=>Ww({...t,from:this.id}),this.useNavigate=()=>Jw({from:this.fullPath}),this.Link=Ia.forwardRef((t,n)=>F.jsx(gp,{ref:n,from:this.fullPath,...t}))}};function rF(e){return new nF(e)}function sF(e){const t=An(),n=`not-found-${en(t.stores.location,o=>o.pathname)}-${en(t.stores.status,o=>o)}`;return F.jsx(mp,{getResetKey:()=>n,onCatch:(o,i)=>{var c;if(Ht(o))(c=e.onCatch)==null||c.call(e,o,i);else throw o},errorComponent:({error:o})=>{var i;if(Ht(o))return(i=e.fallback)==null?void 0:i.call(e,o);throw o},children:e.children})}function oF(){return F.jsx("p",{children:"Not Found"})}function ei(e){return F.jsx(F.Fragment,{children:e.children})}function Xw(e,t,n){return t.options.notFoundComponent?F.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?F.jsx(e.options.defaultNotFoundComponent,{...n}):F.jsx(oF,{})}function iF(e){return null}function aF(){return iF(An()),null}var cF=(e,t)=>e.routeId===t.routeId&&e._displayPending===t._displayPending,uF=(e,t)=>e[0]===t[0]&&e[1]===t[1],Zw=Y.memo(function({matchId:t}){const n=An(),o=n.stores.matchStores.get(t);o||Br();const i=en(n.stores.loadedAt,l=>l),c=en(o,l=>l,cF);return F.jsx(lF,{router:n,matchId:t,resetKey:i,matchState:Y.useMemo(()=>{var h;const l=c.routeId,d=(h=n.routesById[l].parentRoute)==null?void 0:h.id;return{routeId:l,ssr:c.ssr,_displayPending:c._displayPending,parentRouteId:d}},[c._displayPending,c.routeId,c.ssr,n.routesById])})});function lF({router:e,matchId:t,resetKey:n,matchState:o}){var S,E;const i=e.routesById[o.routeId],c=i.options.pendingComponent??e.options.defaultPendingComponent,l=c?F.jsx(c,{}):null,d=i.options.errorComponent??e.options.defaultErrorComponent,h=i.options.onCatch??e.options.defaultOnCatch,p=i.isRoot?i.options.notFoundComponent??((S=e.options.notFoundRoute)==null?void 0:S.options.component):i.options.notFoundComponent,y=o.ssr===!1||o.ssr==="data-only",g=(!i.isRoot||i.options.wrapInSuspense||y)&&(i.options.wrapInSuspense??c??(((E=i.options.errorComponent)==null?void 0:E.preload)||y))?Y.Suspense:ei,v=d?mp:ei,w=p?sF:ei;return F.jsxs(i.isRoot?i.options.shellComponent??ei:ei,{children:[F.jsx(Ml.Provider,{value:t,children:F.jsx(g,{fallback:l,children:F.jsx(v,{getResetKey:()=>n,errorComponent:d||pp,onCatch:(P,H)=>{if(Ht(P))throw P.routeId??(P.routeId=o.routeId),P;h==null||h(P,H)},children:F.jsx(w,{fallback:P=>{if(P.routeId??(P.routeId=o.routeId),!p||P.routeId&&P.routeId!==o.routeId||!P.routeId&&!i.isRoot)throw P;return Y.createElement(p,P)},children:y||o._displayPending?F.jsx(TP,{fallback:l,children:F.jsx(fS,{matchId:t})}):F.jsx(fS,{matchId:t})})})})}),o.parentRouteId===to?F.jsxs(F.Fragment,{children:[F.jsx(fF,{}),e.options.scrollRestoration&&Ew?F.jsx(aF,{}):null]}):null]})}function fF(){const e=An(),t=Y.useRef();return va(()=>{const n=e.stores.resolvedLocation.get(),o=t.current;n&&(!o||o.href!==n.href)&&e.emit({type:"onRendered",...ri(e.stores.location.get(),o??n)}),t.current=n},[en(e.stores.resolvedLocation,n=>n==null?void 0:n.state.__TSR_key),e]),null}var fS=Y.memo(function({matchId:t}){const n=An(),o=(y,g)=>{var v;return((v=n.getMatch(y.id))==null?void 0:v._nonReactive[g])??y._nonReactive[g]},i=n.stores.matchStores.get(t);i||Br();const c=en(i,y=>y),l=c.routeId,d=n.routesById[l],h=Y.useMemo(()=>{var g;const y=(g=n.routesById[l].options.remountDeps??n.options.defaultRemountDeps)==null?void 0:g({routeId:l,loaderDeps:c.loaderDeps,params:c._strictParams,search:c._strictSearch});return y?JSON.stringify(y):void 0},[l,c.loaderDeps,c._strictParams,c._strictSearch,n.options.defaultRemountDeps,n.routesById]),p=Y.useMemo(()=>{const y=d.options.component??n.options.defaultComponent;return y?F.jsx(y,{},h):F.jsx(e1,{})},[h,d.options.component,n.options.defaultComponent]);if(c._displayPending)throw o(c,"displayPendingPromise");if(c._forcePending)throw o(c,"minPendingPromise");if(c.status==="pending"){const y=d.options.pendingMinMs??n.options.defaultPendingMinMs;if(y){const g=n.getMatch(c.id);if(g&&!g._nonReactive.minPendingPromise){const v=ci();g._nonReactive.minPendingPromise=v,setTimeout(()=>{v.resolve(),g._nonReactive.minPendingPromise=void 0},y)}}throw o(c,"loadPromise")}if(c.status==="notFound")return Ht(c.error)||Br(),Xw(n,d,c.error);if(c.status==="redirected")throw mn(c.error)||Br(),o(c,"loadPromise");if(c.status==="error")throw c.error;return p}),e1=Y.memo(function(){const t=An(),n=Y.useContext(Ml);let o,i=!1,c;{const p=n?t.stores.matchStores.get(n):void 0;[o,i]=en(p,y=>[y==null?void 0:y.routeId,(y==null?void 0:y.globalNotFound)??!1],uF),c=en(t.stores.matchesId,y=>y[y.findIndex(g=>g===n)+1])}const l=o?t.routesById[o]:void 0,d=t.options.defaultPendingComponent?F.jsx(t.options.defaultPendingComponent,{}):null;if(i)return l||Br(),Xw(t,l,void 0);if(!c)return null;const h=F.jsx(Zw,{matchId:c});return o===to?F.jsx(Y.Suspense,{fallback:d,children:h}):h});function dF(){const e=An(),t=Y.useRef({router:e,mounted:!1}),[n,o]=Y.useState(!1),i=en(e.stores.isLoading,g=>g),c=en(e.stores.hasPending,g=>g),l=gh(i),d=i||n||c,h=gh(d),p=i||c,y=gh(p);return e.startTransition=g=>{o(!0),Y.startTransition(()=>{g(),o(!1)})},Y.useEffect(()=>{const g=e.history.subscribe(e.load),v=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return $r(e.latestLocation.publicHref)!==$r(v.publicHref)&&e.commitLocation({...v,replace:!0}),()=>{g()}},[e,e.history]),va(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(v){console.error(v)}})()},[e]),va(()=>{l&&!i&&e.emit({type:"onLoad",...ri(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,e,i]),va(()=>{y&&!p&&e.emit({type:"onBeforeRouteMount",...ri(e.stores.location.get(),e.stores.resolvedLocation.get())})},[p,y,e]),va(()=>{if(h&&!d){const g=ri(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...g}),zw(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())})}},[d,h,e]),null}function hF(){const e=An(),t=e.routesById[to].options.pendingComponent??e.options.defaultPendingComponent,n=t?F.jsx(t,{}):null,o=F.jsxs(typeof document<"u"&&e.ssr?ei:Y.Suspense,{fallback:n,children:[F.jsx(dF,{}),F.jsx(mF,{})]});return e.options.InnerWrap?F.jsx(e.options.InnerWrap,{children:o}):o}function mF(){const e=An(),t=en(e.stores.firstId,i=>i),n=en(e.stores.loadedAt,i=>i),o=t?F.jsx(Zw,{matchId:t}):null;return F.jsx(Ml.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?o:F.jsx(mp,{getResetKey:()=>n,errorComponent:pp,onCatch:void 0,children:o})})}var pF=e=>({createMutableStore:iS,createReadonlyStore:iS,batch:zw}),gF=e=>new yF(e),yF=class extends mP{constructor(e){super(e,pF)}};function vF({router:e,children:t,...n}){Cw(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const o=F.jsx(Uw.Provider,{value:e,children:t});return e.options.Wrap?F.jsx(e.options.Wrap,{children:o}):o}function SF({router:e,...t}){return F.jsx(vF,{router:e,...t,children:F.jsx(hF,{})})}function xF(e){const t=An({warn:(e==null?void 0:e.router)===void 0}),n=(e==null?void 0:e.router)||t;return en(n.stores.__store,qw(e,n))}const Ll=["claude","codex","cursor","copilot","pi","opencode","antigravity","gemini","grok"],yp=["vscode","monokai","dracula","github","nord","one-dark-pro","solarized","tokyo-night","catppuccin","midnight","forest","sunset","cyberpunk","synthwave","luxury","minimal"],mm={vscode:{name:"VS Code",light:{name:"Light+",primary:"#007ACC",background:"#FFFFFF",foreground:"#333333",card:"#F3F3F3",cardForeground:"#1E1E1E",border:"#E5E5E5",accent:"#0066BF",accentForeground:"#FFFFFF",muted:"#F6F6F6",mutedForeground:"#6E6E6E"},dark:{name:"Dark+",primary:"#007ACC",background:"#1E1E1E",foreground:"#CCCCCC",card:"#252526",cardForeground:"#CCCCCC",border:"#3E3E42",accent:"#0E639C",accentForeground:"#FFFFFF",muted:"#2D2D30",mutedForeground:"#858585"}},monokai:{name:"Monokai",light:{name:"Monokai Light",primary:"#A6E22E",background:"#F8F8F2",foreground:"#272822",card:"#E6E6E0",cardForeground:"#272822",border:"#C4C4B8",accent:"#66D9EF",accentForeground:"#272822",muted:"#E6E6E0",mutedForeground:"#75715E"},dark:{name:"Monokai",primary:"#A6E22E",background:"#272822",foreground:"#F8F8F2",card:"#3E3D32",cardForeground:"#F8F8F2",border:"#75715E",accent:"#66D9EF",accentForeground:"#272822",muted:"#49483E",mutedForeground:"#75715E"}},dracula:{name:"Dracula",light:{name:"Dracula Light",primary:"#BD93F9",background:"#F8F8F2",foreground:"#282A36",card:"#E6E6E0",cardForeground:"#282A36",border:"#C4C4B8",accent:"#FF79C6",accentForeground:"#282A36",muted:"#E6E6E0",mutedForeground:"#6272A4"},dark:{name:"Dracula",primary:"#BD93F9",background:"#282A36",foreground:"#F8F8F2",card:"#343746",cardForeground:"#F8F8F2",border:"#44475A",accent:"#FF79C6",accentForeground:"#282A36",muted:"#44475A",mutedForeground:"#6272A4"}},github:{name:"GitHub",light:{name:"GitHub Light",primary:"#0969DA",background:"#FFFFFF",foreground:"#24292F",card:"#F6F8FA",cardForeground:"#24292F",border:"#D0D7DE",accent:"#0969DA",accentForeground:"#FFFFFF",muted:"#F6F8FA",mutedForeground:"#57606A"},dark:{name:"GitHub Dark",primary:"#58A6FF",background:"#0D1117",foreground:"#C9D1D9",card:"#161B22",cardForeground:"#C9D1D9",border:"#30363D",accent:"#1F6FEB",accentForeground:"#FFFFFF",muted:"#161B22",mutedForeground:"#8B949E"}},nord:{name:"Nord",light:{name:"Nord Light",primary:"#5E81AC",background:"#ECEFF4",foreground:"#2E3440",card:"#E5E9F0",cardForeground:"#2E3440",border:"#D8DEE9",accent:"#88C0D0",accentForeground:"#2E3440",muted:"#E5E9F0",mutedForeground:"#4C566A"},dark:{name:"Nord",primary:"#88C0D0",background:"#2E3440",foreground:"#D8DEE9",card:"#3B4252",cardForeground:"#E5E9F0",border:"#434C5E",accent:"#5E81AC",accentForeground:"#ECEFF4",muted:"#434C5E",mutedForeground:"#88C0D0"}},"one-dark-pro":{name:"One Dark Pro",light:{name:"One Light Pro",primary:"#528BFF",background:"#FAFAFA",foreground:"#383A42",card:"#F0F0F0",cardForeground:"#383A42",border:"#E0E0E0",accent:"#61AFEF",accentForeground:"#FAFAFA",muted:"#F0F0F0",mutedForeground:"#5C6370"},dark:{name:"One Dark Pro",primary:"#61AFEF",background:"#282C34",foreground:"#ABB2BF",card:"#2C313C",cardForeground:"#ABB2BF",border:"#3E4451",accent:"#528BFF",accentForeground:"#FFFFFF",muted:"#3E4451",mutedForeground:"#5C6370"}},solarized:{name:"Solarized",light:{name:"Solarized Light",primary:"#268BD2",background:"#FDF6E3",foreground:"#657B83",card:"#EEE8D5",cardForeground:"#586E75",border:"#93A1A1",accent:"#2AA198",accentForeground:"#FDF6E3",muted:"#FDF6E3",mutedForeground:"#839496"},dark:{name:"Solarized Dark",primary:"#268BD2",background:"#002B36",foreground:"#839496",card:"#073642",cardForeground:"#93A1A1",border:"#586E75",accent:"#2AA198",accentForeground:"#FDF6E3",muted:"#073642",mutedForeground:"#657B83"}},"tokyo-night":{name:"Tokyo Night",light:{name:"Tokyo Night Day",primary:"#2E7DE9",background:"#E1E2E7",foreground:"#343B58",card:"#D5D6DB",cardForeground:"#343B58",border:"#9699A3",accent:"#7AA2F7",accentForeground:"#343B58",muted:"#D5D6DB",mutedForeground:"#565F89"},dark:{name:"Tokyo Night",primary:"#7AA2F7",background:"#1A1B26",foreground:"#C0CAF5",card:"#24283B",cardForeground:"#C0CAF5",border:"#414868",accent:"#BB9AF7",accentForeground:"#1A1B26",muted:"#2F3549",mutedForeground:"#565F89"}},catppuccin:{name:"Catppuccin",light:{name:"Catppuccin Latte",primary:"#1E66F5",background:"#EFF1F5",foreground:"#4C4F69",card:"#E6E9EF",cardForeground:"#4C4F69",border:"#BCC0CC",accent:"#EA76CB",accentForeground:"#EFF1F5",muted:"#E6E9EF",mutedForeground:"#6C6F85"},dark:{name:"Catppuccin Mocha",primary:"#89B4FA",background:"#1E1E2E",foreground:"#CDD6F4",card:"#313244",cardForeground:"#CDD6F4",border:"#45475A",accent:"#F38BA8",accentForeground:"#1E1E2E",muted:"#313244",mutedForeground:"#6C7086"}},midnight:{name:"Midnight",light:{name:"Midnight Light",primary:"#3B82F6",background:"#F8FAFC",foreground:"#0F172A",card:"#E2E8F0",cardForeground:"#0F172A",border:"#CBD5E1",accent:"#1D4ED8",accentForeground:"#F8FAFC",muted:"#E2E8F0",mutedForeground:"#64748B"},dark:{name:"Midnight",primary:"#3B82F6",background:"#0F172A",foreground:"#F8FAFC",card:"#1E293B",cardForeground:"#F8FAFC",border:"#334155",accent:"#1D4ED8",accentForeground:"#FFFFFF",muted:"#1E293B",mutedForeground:"#94A3B8"}},forest:{name:"Forest",light:{name:"Forest Light",primary:"#22C55E",background:"#F0FDF4",foreground:"#052E16",card:"#DCFCE7",cardForeground:"#052E16",border:"#BBF7D0",accent:"#15803D",accentForeground:"#F0FDF4",muted:"#DCFCE7",mutedForeground:"#166534"},dark:{name:"Forest",primary:"#22C55E",background:"#052E16",foreground:"#DCFCE7",card:"#14532D",cardForeground:"#DCFCE7",border:"#166534",accent:"#15803D",accentForeground:"#FFFFFF",muted:"#14532D",mutedForeground:"#86EFAC"}},sunset:{name:"Sunset",light:{name:"Sunset Light",primary:"#F97316",background:"#FFF7ED",foreground:"#431407",card:"#FFEDD5",cardForeground:"#431407",border:"#FED7AA",accent:"#EA580C",accentForeground:"#FFF7ED",muted:"#FFEDD5",mutedForeground:"#9A3412"},dark:{name:"Sunset",primary:"#F97316",background:"#431407",foreground:"#FFEDD5",card:"#7C2D12",cardForeground:"#FFEDD5",border:"#9A3412",accent:"#EA580C",accentForeground:"#FFFFFF",muted:"#7C2D12",mutedForeground:"#FDBA74"}},cyberpunk:{name:"Cyberpunk",light:{name:"Cyberpunk Light",primary:"#F472B6",background:"#FFFFFF",foreground:"#000000",card:"#F3F4F6",cardForeground:"#000000",border:"#E5E7EB",accent:"#E879F9",accentForeground:"#000000",muted:"#F3F4F6",mutedForeground:"#22D3EE"},dark:{name:"Cyberpunk",primary:"#F472B6",background:"#000000",foreground:"#22D3EE",card:"#111111",cardForeground:"#E879F9",border:"#F472B6",accent:"#FFFF00",accentForeground:"#000000",muted:"#111111",mutedForeground:"#22D3EE"}},synthwave:{name:"Synthwave",light:{name:"Synthwave Light",primary:"#D946EF",background:"#FAF5FF",foreground:"#2A0A3B",card:"#F3E8FF",cardForeground:"#2A0A3B",border:"#E9D5FF",accent:"#06B6D4",accentForeground:"#FAF5FF",muted:"#F3E8FF",mutedForeground:"#C026D3"},dark:{name:"Synthwave",primary:"#D946EF",background:"#2A0A3B",foreground:"#F5D0FE",card:"#4A1D66",cardForeground:"#F5D0FE",border:"#C026D3",accent:"#06B6D4",accentForeground:"#FFFFFF",muted:"#4A1D66",mutedForeground:"#E879F9"}},luxury:{name:"Luxury",light:{name:"Luxury Light",primary:"#D4AF37",background:"#FAFAF9",foreground:"#1C1917",card:"#F5F5F4",cardForeground:"#1C1917",border:"#E7E5E4",accent:"#B45309",accentForeground:"#FAFAF9",muted:"#F5F5F4",mutedForeground:"#78716C"},dark:{name:"Luxury",primary:"#D4AF37",background:"#1C1917",foreground:"#E7E5E4",card:"#292524",cardForeground:"#D4AF37",border:"#78716C",accent:"#B45309",accentForeground:"#FFFFFF",muted:"#292524",mutedForeground:"#A8A29E"}},minimal:{name:"Minimal",light:{name:"Minimal",primary:"#18181B",background:"#FFFFFF",foreground:"#18181B",card:"#FFFFFF",cardForeground:"#18181B",border:"#E4E4E7",accent:"#F4F4F5",accentForeground:"#18181B",muted:"#FAFAFA",mutedForeground:"#71717A"},dark:{name:"Minimal Dark",primary:"#FAFAFA",background:"#18181B",foreground:"#FAFAFA",card:"#27272A",cardForeground:"#FAFAFA",border:"#3F3F46",accent:"#27272A",accentForeground:"#FAFAFA",muted:"#27272A",mutedForeground:"#A1A1AA"}}},vp=["tokmon","phosphor",...yp],t1=[...vp,"custom"],wF={vscode:"VS Code Light+ and Dark+",monokai:"Classic editor green and cyan",dracula:"Purple and pink on deep slate",github:"GitHub light and dark",nord:"Arctic blue-gray palette","one-dark-pro":"Atom-inspired editor palette",solarized:"Precision blue and teal","tokyo-night":"Cool blue and violet",catppuccin:"Latte and Mocha palettes",midnight:"Deep navy and bright blue",forest:"Natural green surfaces",sunset:"Warm orange and earth tones",cyberpunk:"Neon cyan, pink, and yellow",synthwave:"Purple and electric cyan",luxury:"Gold on warm neutrals",minimal:"High-contrast monochrome"},dS=[{id:"tokmon",name:"Tokmon",hint:"Calm system utility",darkOnly:!1,custom:!1},{id:"phosphor",name:"Phosphor",hint:"Black terminal green",darkOnly:!0,custom:!1},...yp.map(e=>({id:e,name:mm[e].name,hint:wF[e],darkOnly:!1,custom:!1})),{id:"custom",name:"Custom",hint:"Your shared palette",darkOnly:!1,custom:!0}];function kF(e){return typeof e=="string"&&t1.includes(e)}function EF(e){return typeof e=="string"&&vp.includes(e)}function _F(e){return dS.find(t=>t.id===e)??dS[0]}function n1(e){return _F(e).darkOnly}const CF=["canvas","panel","inset","insetStrong","chrome","line","lineStrong","lineFaint","text","textDim","textFaint","textStrong","accent","cost","positive"],oi=Object.freeze({version:1,mode:"auto",preset:"tokmon",terminal:"ansi"}),r1={canvas:"#0a0a0a",panel:"#101011",inset:"#161617",insetStrong:"#1d1d1e",chrome:"#1e1f22",line:"#262627",lineStrong:"#343435",lineFaint:"#1a1a1b",text:"#d4d6d6",textDim:"#8d9090",textFaint:"#585b5b",textStrong:"#f3f5f5",accent:"#79be7e",cost:"#d9c074",positive:"#6caa71",ok:"#79be7e",warn:"#e0b84c",crit:"#e5584b",unknown:"#8d9090"},s1={canvas:"#f4f5f5",panel:"#ffffff",inset:"#eceeee",insetStrong:"#e1e4e4",chrome:"#f4f5f5",line:"#d4d9d9",lineStrong:"#bcc2c2",lineFaint:"#e7eaea",text:"#2b2e2e",textDim:"#5a6060",textFaint:"#979d9d",textStrong:"#0d1010",accent:"#2f8f57",cost:"#9a7b1c",positive:"#2f8f57",ok:"#2f8f57",warn:"#9a7b1c",crit:"#b0403a",unknown:"#5a6060"},bF={canvas:"#000000",panel:"#050705",inset:"#0a0f0b",insetStrong:"#101710",chrome:"#070b08",line:"#1a2a1e",lineStrong:"#2c4634",lineFaint:"#101812",text:"#c6f7d3",textDim:"#7fc98d",textFaint:"#4c7d57",textStrong:"#eafff0",accent:"#35f38a",cost:"#ffd24a",positive:"#35f38a",ok:"#35f38a",warn:"#ffc44d",crit:"#ff6b5b",unknown:"#7fc98d"},PF={canvas:"#f3f5f0",panel:"#ffffff",inset:"#e8ede7",insetStrong:"#dce5dc",chrome:"#f3f5f0",line:"#cad7ca",lineStrong:"#a9bca9",lineFaint:"#e4ebe4",text:"#0b2610",textDim:"#426b49",textFaint:"#748c78",textStrong:"#031507",accent:"#128a2e",cost:"#826500",positive:"#128a2e",ok:"#128a2e",warn:"#826500",crit:"#b23a32",unknown:"#5c705f"},FF=/^#[0-9a-f]{6}$/i;function er(e){return typeof e=="string"&&FF.test(e)?e.toLowerCase():null}function pm(e){return[Number.parseInt(e.slice(1,3),16),Number.parseInt(e.slice(3,5),16),Number.parseInt(e.slice(5,7),16)]}function Ih(e){return Math.round(Math.max(0,Math.min(255,e))).toString(16).padStart(2,"0")}function Ur(e,t,n){const[o,i,c]=pm(e),[l,d,h]=pm(t),p=Math.max(0,Math.min(1,n));return`#${Ih(o+(l-o)*p)}${Ih(i+(d-i)*p)}${Ih(c+(h-c)*p)}`}function hS(e){const t=er(e);if(!t)throw new TypeError("expected a #RRGGBB color");const n=pm(t).map(o=>{const i=o/255;return i<=.04045?i/12.92:((i+.055)/1.055)**2.4});return .2126*n[0]+.7152*n[1]+.0722*n[2]}function Zs(e,t){const n=hS(e),o=hS(t);return(Math.max(n,o)+.05)/(Math.min(n,o)+.05)}function Nr(e,t,n,o){const i=er(e);if(t.every(h=>Zs(i,h)>=n))return i;const c=[o,"#000000","#ffffff"].reduce((h,p)=>Math.min(...t.map(y=>Zs(p,y)))>Math.min(...t.map(y=>Zs(h,y)))?p:h);let l=0,d=1;for(let h=0;h<16;h++){const p=(l+d)/2,y=Ur(i,c,p);t.every(g=>Zs(y,g)>=n)?d=p:l=p}return Ur(i,c,d)}function mS(e,t){const n=er(e.background),o=er(e.card),i=er(e.foreground),c=t==="dark"?"#ffffff":"#000000",l=Nr(i,[n,o],4.5,c),d=Nr(e.cardForeground,[n,o],4.5,c),h=Nr(e.mutedForeground,[n],3,l),p=Nr(e.primary,[n,o],3,l),y=Nr(e.accent,[o],3,l),g=Nr(e.primary,[o],3,l),v=t==="dark"?r1:s1;return{canvas:n,panel:o,inset:er(e.muted),insetStrong:Ur(e.muted,e.foreground,.08),chrome:n,line:er(e.border),lineStrong:Ur(e.border,e.foreground,.18),lineFaint:Ur(e.background,e.border,.5),text:l,textDim:h,textFaint:er(e.mutedForeground),textStrong:d,accent:p,cost:y,positive:g,ok:Nr(v.ok,[o],3,l),warn:Nr(v.warn,[o],3,l),crit:Nr(v.crit,[o],3,l),unknown:h}}const IF=Object.fromEntries(yp.map(e=>[e,{light:mS(mm[e].light,"light"),dark:mS(mm[e].dark,"dark")}])),gm={tokmon:{light:s1,dark:r1},phosphor:{light:PF,dark:bF},...IF},RF=[["text","canvas",4.5],["text","panel",4.5],["textStrong","canvas",4.5],["textStrong","panel",4.5],["textDim","canvas",3],["accent","canvas",3],["accent","panel",3],["cost","panel",3],["positive","panel",3],["ok","panel",3],["warn","panel",3],["crit","panel",3]];function o1(e){return RF.flatMap(([t,n,o])=>{const i=Zs(e[t],e[n]);return i+Number.EPSILON<o?[{foreground:t,background:n,minimum:o,actual:i}]:[]})}function ym(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function pS(e,t,n,o){if(!ym(e))return e!==void 0&&o.push(`custom.${t} was not an object`),{};const i={};for(const c of CF){if(!(c in e))continue;const l=er(e[c]);l?i[c]=l:o.push(`custom.${t}.${c} was not a #RRGGBB color`)}for(;;){const c={...n,...i},l=o1(c)[0];if(!l)break;const d=l.foreground,h=l.background;if(d in i)delete i[d],o.push(`custom.${t}.${d} did not meet WCAG contrast`);else if(h in i)delete i[h],o.push(`custom.${t}.${h} did not meet WCAG contrast`);else break}return i}function i1(e){const t=[],n=ym(e)?e:{};n!==e&&e!==void 0&&t.push("appearance was not an object");const o=n.mode==="light"||n.mode==="dark"||n.mode==="auto"?n.mode:oi.mode;n.mode!==void 0&&n.mode!==o&&t.push("appearance.mode was invalid");const i=kF(n.preset)?n.preset:oi.preset;n.preset!==void 0&&n.preset!==i&&t.push("appearance.preset was invalid");const c=n.terminal==="dark"||n.terminal==="light"||n.terminal==="off"||n.terminal==="ansi"?n.terminal:oi.terminal;n.terminal!==void 0&&n.terminal!==c&&t.push("appearance.terminal was invalid"),n.version!==void 0&&n.version!==1&&t.push("appearance.version was invalid");let l;if(i==="custom"||n.custom!==void 0){const h=ym(n.custom)?n.custom:{};n.custom!==void 0&&h!==n.custom&&t.push("appearance.custom was not an object");const p=EF(h.base)?h.base:"tokmon";h.base!==void 0&&h.base!==p&&t.push("custom.base was invalid"),l={base:p,light:pS(h.light,"light",gm[p].light,t),dark:pS(h.dark,"dark",gm[p].dark,t)}}const d={version:1,mode:o,preset:i,terminal:c,...l?{custom:l}:{}};return{appearance:d,repaired:t.length>0||JSON.stringify(n)!==JSON.stringify(d),reasons:t}}function TF(e){return i1(e).appearance}function AF(e){return{...e,card:Ur(e.panel,e.text,.06),cardHover:Ur(e.panel,e.text,.1),divider:e.line,track:Ur(e.panel,e.text,.1),accentTint:Ur(e.panel,e.accent,.14),accentOn:Zs(e.accent,"#000000")>=Zs(e.accent,"#ffffff")?"#000000":"#ffffff",focusRing:e.accent}}function a1(e,t="dark"){var h,p;const n=TF(e),o=n.mode==="auto"?t:n.mode,i=n1(n.preset)?"dark":o,c=n.preset==="custom"?((h=n.custom)==null?void 0:h.base)??"tokmon":n.preset,l=gm[c][i],d=n.preset==="custom"?((p=n.custom)==null?void 0:p[i])??{}:{};return{mode:i,tokens:AF({...l,...d})}}const c1=[7,14,30];function MF(e,t){const n=Array.isArray(e)?e:t&&typeof t=="string"&&t.trim()?[t]:[];return rl(n,2)}function rl(e,t){if(!Array.isArray(e))return[];const n=new Set,o=[];for(const i of e){if(typeof i!="string")continue;const c=i.trim();if(!(!c||n.has(c))&&(n.add(c),o.push(c),o.length>=t))break}return o}const LF=2;function OF(e,t,n=Number.POSITIVE_INFINITY){return rl(e.filter(o=>t.has(o)),n)}function _$(e,t,n,o=Number.POSITIVE_INFINITY){const i=OF(e,n,o);return i.includes(t)?i.filter(c=>c!==t):!n.has(t)||i.length>=o?i:[...i,t]}function C$(e,t,n){const o=[...e],i=o.indexOf(t),c=i+n;return i<0||c<0||c>=o.length||([o[i],o[c]]=[o[c],o[i]]),o}const Zt={enabled:!0,showMenuBarText:!0,displayMetric:"smartHeadroom",pollIntervalSec:30,activeTimeoutMin:10,graceMin:30,promotionHoldMin:5,lowWatermarkPct:20,criticalWatermarkPct:5,pinnedAccount:null,pins:[],pinnedProviders:[],launchAtLogin:!1,theme:"dark"},NF=32,Sp={expandedProviders:[],graphRangeDays:14},xp={enabled:!0,disabledProviders:[],excludedAccounts:[]},bn={revision:0,interval:2,billingInterval:5,clearScreen:!0,privacyMode:!0,privacyToggleKey:"p",timezone:null,accounts:[],activeAccountId:null,disabledProviders:[],onboarded:!1,dashboardLayout:"grid",defaultFocus:"all",ascii:"auto",allowNetworkAccess:!1,allowedHosts:[],resetDisplay:"relative",knownProviders:[],appearance:{...oi},accountDetection:{...xp},tray:{...Zt},desktop:{...Sp}},DF=["claude","codex","cursor"],Rh=["cyan","magenta","green","yellow","blue","red"],gS=[...Ll],b$=["cyan","magenta","green","yellow","blue","red","cyanBright","magentaBright","greenBright"],Fu={claude:{name:"Claude",color:"green"},codex:{name:"Codex",color:"cyan"},cursor:{name:"Cursor",color:"magenta"},copilot:{name:"Copilot",color:"white"},pi:{name:"Pi",color:"blue"},opencode:{name:"opencode",color:"yellow"},antigravity:{name:"Antigravity",color:"red"},gemini:{name:"Gemini",color:"greenBright"},grok:{name:"Grok",color:"yellowBright"}},jF=/[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}/i,$F=/[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}/gi;function UF(e){return typeof e=="string"&&jF.test(e)}function u1(e){return e.replace($F,"[redacted]")}function P$(e,t=gS.filter(o=>!e.disabledProviders.includes(o)),n){const o=new Set(t),i=new Set,c=new Set,l=new Set,d=new Set,h=[],p=e.accountDetection.enabled,y=new Set(e.accountDetection.disabledProviders),g=(S,E)=>`${S}:${E&&E!=="~"?E:"~"}`,v=new Set(e.accountDetection.excludedAccounts.map(S=>g(S.providerId,S.homeDir))),w=S=>{l.add(S.id),d.add(g(S.providerId,S.homeDir)),h.push(S)};if(e.accounts.forEach((S,E)=>{const P=Fu[S.providerId];i.add(S.id),c.add(g(S.providerId,S.homeDir)),w({id:S.id,providerId:S.providerId,name:S.name,homeDir:S.homeDir||"~",color:S.color||P.color,source:"configured",explicitId:S.id,explicitIndex:E})}),n)for(const S of n){if(!p||y.has(S.providerId)||e.disabledProviders.includes(S.providerId))continue;const E=g(S.providerId,S.homeDir);if(v.has(E)||i.has(S.id)||c.has(E)||l.has(S.id)||d.has(E))continue;const P=Fu[S.providerId];w({id:S.id,providerId:S.providerId,name:S.name,homeDir:S.homeDir||"~",color:S.color||P.color,source:"auto"})}for(const S of gS){if(!p||y.has(S)||e.disabledProviders.includes(S)||!o.has(S))continue;const E=g(S,"~");if(v.has(E)||i.has(S)||c.has(E)||l.has(S)||d.has(E))continue;const P=Fu[S];w({id:S,providerId:S,name:P.name,homeDir:"~",color:P.color,source:"auto"})}for(const S of e.accountDetection.excludedAccounts){if(c.has(g(S.providerId,S.homeDir)))continue;const E=Fu[S.providerId];w({id:`ignored:${S.providerId}:${S.homeDir}`,providerId:S.providerId,name:`${E.name} account`,homeDir:S.homeDir,color:E.color,source:"ignored",excludedRef:S})}return h}function F$(e,t){return e.enabled&&!e.disabledProviders.includes(t)}function I$(e,t,n){const o=e.disabledProviders.filter(i=>i!==t);return{...e,disabledProviders:n?o:[...o,t]}}function R$(e,t,n){const o=t.homeDir.trim()||"~",i=l=>l.providerId===t.providerId&&l.homeDir===o,c=e.excludedAccounts.filter(l=>!i(l));return{...e,excludedAccounts:n?[...c,{providerId:t.providerId,homeDir:o}]:c}}function yS(e,t,n){return typeof e=="number"&&Number.isFinite(e)&&e>=n?e:t}function Jo(e,t,n,o){return typeof e=="number"&&Number.isFinite(e)&&e>=n&&e<=o?e:t}function BF(e){try{return new Intl.DateTimeFormat("en-CA",{timeZone:e}),!0}catch{return!1}}function Dr(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function ma(e){return Ll.includes(e)}function pa(e,t){try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}function zF(e){if(typeof e!="string")return null;const t=e.trim();if(!t)return null;try{const n=new URL(`http://${t}`);if(n.username||n.password||n.port||n.pathname!=="/"||n.search||n.hash)return null;const o=n.hostname.toLowerCase().replace(/\.$/,"");return!o||o.length>253||o.includes("*")||o.split(".").some(c=>!c||c.length>63||!/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/.test(c))?null:o}catch{return null}}function VF(e){if(!Array.isArray(e))return[];const t=e.map(zF).filter(n=>n!==null);return[...new Set(t)]}function l1(e){const t=[],n=Dr(e)?e:{};n!==e&&t.push("config root was not an object");const o=Array.isArray(n.accounts)?n.accounts:[];!Array.isArray(n.accounts)&&n.accounts!==void 0&&t.push("accounts was not an array");const i=[],c=new Set;o.forEach((T,L)=>{if(!Dr(T)){t.push(`accounts[${L}] was not an object`);return}const $=T.providerId??"claude";if(!ma($)){t.push(`accounts[${L}].providerId was invalid`);return}const q=typeof T.id=="string"&&T.id.trim()?T.id.trim():"",ee=typeof T.name=="string"&&T.name.trim()?T.name.trim():"";if(!q||!ee){t.push(`accounts[${L}] was missing id or name`);return}if(c.has(q)){t.push(`accounts[${L}].id was duplicated`);return}c.add(q),i.push({id:q,providerId:$,name:ee,homeDir:typeof T.homeDir=="string"&&T.homeDir.trim()?T.homeDir:"~",...typeof T.color=="string"&&T.color.trim()?{color:T.color}:{}})});const l=(Array.isArray(n.disabledProviders)?n.disabledProviders:[]).filter(ma);n.disabledProviders!==void 0&&!Array.isArray(n.disabledProviders)&&t.push("disabledProviders was not an array");const d=Array.isArray(n.knownProviders)?n.knownProviders.filter(ma):n.onboarded===!0?[...DF]:[];n.knownProviders!==void 0&&!Array.isArray(n.knownProviders)&&t.push("knownProviders was not an array");const h=VF(n.allowedHosts);n.allowedHosts!==void 0&&!pa(n.allowedHosts,h)&&t.push("allowedHosts contained invalid or duplicate hostnames");const p=i1(n.appearance);n.appearance!==void 0&&p.repaired&&t.push(...p.reasons);const y=Dr(n.accountDetection)?n.accountDetection:{};n.accountDetection!==void 0&&!Dr(n.accountDetection)&&t.push("accountDetection was not an object");const g=Array.isArray(y.disabledProviders)?[...new Set(y.disabledProviders.filter(ma))]:[],v=[],w=new Set;Array.isArray(y.excludedAccounts)?y.excludedAccounts.forEach((T,L)=>{if(!Dr(T)||!ma(T.providerId)||typeof T.homeDir!="string"||!T.homeDir.trim()){t.push(`accountDetection.excludedAccounts[${L}] was invalid`);return}const $=T.homeDir.trim(),q=`${T.providerId}:${$}`;w.has(q)||(w.add(q),v.push({providerId:T.providerId,homeDir:$}))}):y.excludedAccounts!==void 0&&t.push("accountDetection.excludedAccounts was not an array");const S={enabled:typeof y.enabled=="boolean"?y.enabled:xp.enabled,disabledProviders:g,excludedAccounts:v};n.accountDetection!==void 0&&!pa(n.accountDetection,S)&&t.push("accountDetection contained invalid settings");const E=Dr(n.tray)?n.tray:{};n.tray!==void 0&&!Dr(n.tray)&&t.push("tray was not an object");const P={enabled:typeof E.enabled=="boolean"?E.enabled:Zt.enabled,showMenuBarText:typeof E.showMenuBarText=="boolean"?E.showMenuBarText:Zt.showMenuBarText,displayMetric:E.displayMetric==="tightestRemaining"||E.displayMetric==="smartHeadroom"?E.displayMetric:Zt.displayMetric,pollIntervalSec:Jo(E.pollIntervalSec,Zt.pollIntervalSec,1,86400),activeTimeoutMin:Jo(E.activeTimeoutMin,Zt.activeTimeoutMin,1,1440),graceMin:Jo(E.graceMin,Zt.graceMin,1,10080),promotionHoldMin:Jo(E.promotionHoldMin,Zt.promotionHoldMin,0,1440),lowWatermarkPct:Jo(E.lowWatermarkPct,Zt.lowWatermarkPct,0,100),criticalWatermarkPct:Jo(E.criticalWatermarkPct,Zt.criticalWatermarkPct,0,100),pinnedAccount:typeof E.pinnedAccount=="string"&&E.pinnedAccount.trim()?E.pinnedAccount.trim():null,pins:MF(E.pins,typeof E.pinnedAccount=="string"?E.pinnedAccount:null),pinnedProviders:rl(E.pinnedProviders,LF),launchAtLogin:typeof E.launchAtLogin=="boolean"?E.launchAtLogin:Zt.launchAtLogin,theme:E.theme==="dark"?E.theme:Zt.theme};P.graceMin<P.activeTimeoutMin&&(P.graceMin=Math.max(Zt.graceMin,P.activeTimeoutMin)),P.criticalWatermarkPct>P.lowWatermarkPct&&(P.criticalWatermarkPct=Math.min(Zt.criticalWatermarkPct,P.lowWatermarkPct)),n.tray!==void 0&&!pa(n.tray,P)&&t.push("tray contained invalid settings");const H=Dr(n.desktop)?n.desktop:{};n.desktop!==void 0&&!Dr(n.desktop)&&t.push("desktop was not an object");const _={expandedProviders:rl(H.expandedProviders,NF),graphRangeDays:c1.includes(H.graphRangeDays)?H.graphRangeDays:Sp.graphRangeDays};n.desktop!==void 0&&!pa(n.desktop,_)&&t.push("desktop contained invalid settings");const O=typeof n.activeAccountId=="string"&&(c.has(n.activeAccountId)||Ll.includes(n.activeAccountId))?n.activeAccountId:null;n.activeAccountId!==void 0&&n.activeAccountId!==null&&O===null&&t.push("activeAccountId did not match a known account/provider");const C=typeof n.timezone=="string"&&n.timezone.trim()&&BF(n.timezone.trim())?n.timezone.trim():null;n.timezone!==void 0&&n.timezone!==null&&C===null&&t.push("timezone was invalid");const D={...bn,revision:typeof n.revision=="number"&&Number.isSafeInteger(n.revision)&&n.revision>=0?n.revision:bn.revision,interval:yS(n.interval,bn.interval,1),billingInterval:yS(n.billingInterval,bn.billingInterval,1),clearScreen:typeof n.clearScreen=="boolean"?n.clearScreen:bn.clearScreen,privacyMode:typeof n.privacyMode=="boolean"?n.privacyMode:bn.privacyMode,privacyToggleKey:typeof n.privacyToggleKey=="string"&&n.privacyToggleKey.length===1?n.privacyToggleKey:bn.privacyToggleKey,timezone:C,accounts:i,activeAccountId:O,disabledProviders:l,onboarded:n.onboarded===!0,dashboardLayout:n.dashboardLayout==="single"?"single":"grid",defaultFocus:n.defaultFocus==="last"?"last":"all",ascii:n.ascii==="on"?"on":n.ascii==="off"?"off":"auto",allowNetworkAccess:n.allowNetworkAccess===!0,allowedHosts:h,resetDisplay:n.resetDisplay==="absolute"?"absolute":"relative",knownProviders:d,appearance:p.appearance,accountDetection:S,tray:P,desktop:_};for(const T of Object.keys(bn))T in n||t.push(`missing ${T}`);return{config:D,repaired:t.length>0||!pa(n,D),reasons:t}}function qF(e){try{return l1(e).config}catch{return{...bn,appearance:{...oi},accountDetection:{...xp},tray:{...Zt},desktop:{...Sp}}}}function WF(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"").slice(0,48)}function T$(e,t){const n=WF(e)||"account",o=new Set(t.map(i=>i.id));if(!o.has(n))return n;for(let i=2;i<1e3;i++){const c=`${n}_${i}`;if(!o.has(c))return c}return`${n}_${Date.now()}`}function A$(e){const t=new Set(e.map(n=>n.color).filter(Boolean));for(const n of Rh)if(!t.has(n))return n;return Rh[e.length%Rh.length]}function M$(e){return e?e.replace(/\x1b\][\s\S]*?(?:\x07|\x1b\\)/g,"").replace(/\x1b\[[0-?]*[ -/]*[@-~]/g,"").replace(/\x1bO./g,"").replace(/\x1b/g,"").replace(/[\x00-\x1f\x7f-\x9f]/g,"").replace(/\[20[01]~/g,""):""}const HF=e=>Math.max(0,Math.min(100,e));function L$(e){return e===null||!Number.isFinite(e)?null:HF(100-e)}function O$(e){return e===null||!Number.isFinite(e)?"unknown":e<=10?"crit":e<=25?"warn":"ok"}function KF(e,t){const n=e.identity;return n?[n.title,n.subtitle].filter(i=>!!(i!=null&&i.trim())).filter((i,c,l)=>l.indexOf(i)===c).filter(i=>i.toLocaleLowerCase()!==t.toLocaleLowerCase()).join(" · ")||n.title||t:e.name||t}function N$(e,t,n,o){return n?{draft:e,revision:t,conflict:t!==null&&o.config.revision>t}:t!==null&&o.config.revision<t?{draft:e,revision:t,conflict:!1}:{draft:o.config,revision:o.config.revision,conflict:!1}}function wp(e){var t;if(e&&typeof e=="object"){const n=e;if(n.kind==="conflict"){const o=n.state,i=(t=o==null?void 0:o.config)==null?void 0:t.revision;return{message:typeof i=="number"?`configuration changed elsewhere (daemon revision ${i})`:"settings changed elsewhere; reload before saving",conflictState:o!=null&&o.config&&typeof i=="number"?o:null}}if(n.kind==="persistence"&&typeof n.message=="string")return{message:n.message,conflictState:null}}return{message:e instanceof Error?e.message:"config update failed",conflictState:null}}const jt=(e,t)=>{switch(t.length){case 0:return e;case 1:return t[0](e);case 2:return t[1](t[0](e));case 3:return t[2](t[1](t[0](e)));case 4:return t[3](t[2](t[1](t[0](e))));case 5:return t[4](t[3](t[2](t[1](t[0](e)))));case 6:return t[5](t[4](t[3](t[2](t[1](t[0](e))))));case 7:return t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))));case 8:return t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e))))))));case 9:return t[8](t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))))));default:{let n=e;for(let o=0,i=t.length;o<i;o++)n=t[o](n);return n}}},QF={pipe(){return jt(this,arguments)}},Ol=(function(){function e(){}return e.prototype=QF,e})(),re=function(e,t){if(typeof e=="function")return function(){return e(arguments)?t.apply(this,arguments):n=>t(n,...arguments)};switch(e){case 0:case 1:throw new RangeError(`Invalid arity ${e}`);case 2:return function(n,o){return arguments.length>=2?t(n,o):function(i){return t(i,n)}};case 3:return function(n,o,i){return arguments.length>=3?t(n,o,i):function(c){return t(c,n,o)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);const n=arguments;return function(o){return t(o,...n)}}}},Ie=e=>e,_s=e=>()=>e,kp=_s(!0),f1=_s(!1),Nl=_s(void 0),Ga=Nl;function d1(e,t,n,o,i,c,l,d,h){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return o(n(t(e.apply(this,arguments))))};case 5:return function(){return i(o(n(t(e.apply(this,arguments)))))};case 6:return function(){return c(i(o(n(t(e.apply(this,arguments))))))};case 7:return function(){return l(c(i(o(n(t(e.apply(this,arguments)))))))};case 8:return function(){return d(l(c(i(o(n(t(e.apply(this,arguments))))))))};case 9:return function(){return h(d(l(c(i(o(n(t(e.apply(this,arguments)))))))))}}}function Cs(e){const t=new WeakMap;return n=>{if(t.has(n))return t.get(n);const o=e(n);return t.set(n,o),o}}const vm=e=>{const t=new Set(Reflect.ownKeys(e));if(e.constructor===Object)return t;e instanceof Error&&t.delete("stack");const n=Object.getPrototypeOf(e);let o=n;for(;o!==null&&o!==Object.prototype;){const i=Reflect.ownKeys(o);for(let c=0;c<i.length;c++)t.add(i[c]);o=Object.getPrototypeOf(o)}return t.has("constructor")&&typeof e.constructor=="function"&&n===e.constructor.prototype&&t.delete("constructor"),t},Sm=new WeakSet;function Ep(e){return typeof e=="string"}function h1(e){return typeof e=="number"}function JF(e){return typeof e=="boolean"}function Dl(e){return typeof e=="function"}function GF(e){return e!==void 0}function YF(e){return e!=null}function XF(e){return!1}function m1(e){return!0}function ZF(e){return typeof e=="object"&&e!==null||Dl(e)}const Ue=re(2,(e,t)=>ZF(e)&&t in e);function eI(e){return Ue(e,Symbol.iterator)||Ep(e)}const rn="~effect/interfaces/Hash",pt=e=>{switch(typeof e){case"number":return _p(e);case"bigint":return Ft(e.toString(10));case"boolean":return Ft(String(e));case"symbol":return Ft(String(e));case"string":return Ft(e);case"undefined":return Ft("undefined");case"function":case"object":{if(e===null)return Ft("null");if(e instanceof Date)return Ft(e.toISOString());if(e instanceof RegExp)return Ft(e.toString());{if(Sm.has(e))return xm(e);if(Ah.has(e))return Ah.get(e);const t=oI(e,()=>tI(e)?e[rn]():typeof e=="function"?xm(e):Array.isArray(e)||ArrayBuffer.isView(e)?p1(e):e instanceof Map?rI(e):e instanceof Set?sI(e):Cp(e));return Ah.set(e,t),t}}default:throw new Error(`BUG: unhandled typeof ${typeof e} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},xm=e=>(Th.has(e)||Th.set(e,_p(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER))),Th.get(e)),nr=re(2,(e,t)=>e*53^t),jl=e=>e&3221225471|e>>>1&1073741824,tI=e=>Ue(e,rn),_p=e=>{if(e!==e)return Ft("NaN");if(e===1/0)return Ft("Infinity");if(e===-1/0)return Ft("-Infinity");let t=e|0;for(t!==e&&(t^=e*4294967295);e>4294967295;)t^=e/=4294967295;return jl(t)},Ft=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return jl(t)},nI=(e,t)=>{let n=12289;for(const o of t)n^=nr(pt(o),pt(e[o]));return jl(n)},Cp=e=>nI(e,vm(e)),bp=(e,t)=>n=>{let o=e;for(const i of n)o^=t(i);return jl(o)},p1=bp(6151,pt),rI=bp(Ft("Map"),([e,t])=>nr(pt(e),pt(t))),sI=bp(Ft("Set"),pt),Th=new WeakMap,Ah=new WeakMap,Mh=new WeakSet;function oI(e,t){if(Mh.has(e))return Ft("[Circular]");Mh.add(e);const n=t();return Mh.delete(e),n}const sn="~effect/interfaces/Equal";function Pn(){return arguments.length===1?e=>co(e,arguments[0]):co(arguments[0],arguments[1])}function co(e,t){if(e===t)return!0;if(e==null||t==null)return!1;const n=typeof e;return n!==typeof t?!1:n==="number"&&e!==e&&t!==t?!0:n!=="object"&&n!=="function"||Sm.has(e)||Sm.has(t)?!1:cI(e,t,aI)}function iI(e,t,n){const o=Lh.has(e),i=Oh.has(t);if(o&&i)return!0;if(o||i)return!1;Lh.add(e),Oh.add(t);const c=n();return Lh.delete(e),Oh.delete(t),c}const Lh=new WeakSet,Oh=new WeakSet;function aI(e,t){if(pt(e)!==pt(t))return!1;if(e instanceof Date)return t instanceof Date?e.toISOString()===t.toISOString():!1;if(e instanceof RegExp)return t instanceof RegExp?e.toString()===t.toString():!1;const n=vS(e),o=vS(t);if(n!==o)return!1;const i=n&&o;return typeof e=="function"&&!i?!1:iI(e,t,()=>i?e[sn](t):Array.isArray(e)?!Array.isArray(t)||e.length!==t.length?!1:uI(e,t):ArrayBuffer.isView(e)?!ArrayBuffer.isView(t)||e.byteLength!==t.byteLength?!1:lI(e,t):e instanceof Map?!(t instanceof Map)||e.size!==t.size?!1:hI(e,t):e instanceof Set?!(t instanceof Set)||e.size!==t.size?!1:pI(e,t):fI(e,t))}function cI(e,t,n){let o=Iu.get(e);if(!o)o=new WeakMap,Iu.set(e,o);else if(o.has(t))return o.get(t);const i=n(e,t);o.set(t,i);let c=Iu.get(t);return c||(c=new WeakMap,Iu.set(t,c)),c.set(e,i),i}const Iu=new WeakMap;function uI(e,t){for(let n=0;n<e.length;n++)if(!co(e[n],t[n]))return!1;return!0}function lI(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function fI(e,t){const n=vm(e),o=vm(t);if(n.size!==o.size)return!1;for(const i of n)if(!o.has(i)||!co(e[i],t[i]))return!1;return!0}function dI(e,t){return function(o,i){for(const[c,l]of o){let d=!1;for(const[h,p]of i)if(e(c,h)&&t(l,p)){d=!0;break}if(!d)return!1}return!0}}const hI=dI(co,co);function mI(e){return function(n,o){for(const i of n){let c=!1;for(const l of o)if(e(i,l)){c=!0;break}if(!c)return!1}return!0}}const pI=mI(co),vS=e=>Ue(e,sn),gI=()=>Pn,yI=e=>(t,n)=>t===n||e(t,n),vI=(e,t)=>e===t,SI=()=>vI;function xI(e){return yI((t,n)=>{if(t.length!==n.length)return!1;for(let o=0;o<t.length;o++)if(!e(t[o],n[o]))return!1;return!0})}const g1=e=>e.length>0,$l=Symbol.for("~effect/Redactable"),wI=e=>Ue(e,$l);function Ul(e){return wI(e)?y1(e):e}function y1(e){var t;return e[$l](((t=globalThis[_a])==null?void 0:t.context)??kI)}const _a="~effect/Fiber/currentFiber",kI={"~effect/Context":{},mapUnsafe:new Map,pipe(){return jt(this,arguments)}};function gt(e,t){const n=(t==null?void 0:t.space)??0,o=new WeakSet,i=n?typeof n=="number"?" ".repeat(n):n:"",c=p=>i.repeat(p),l=(p,y)=>{const g=p==null?void 0:p.constructor;return g&&g!==Object.prototype.constructor&&g.name?`${g.name}(${y})`:y},d=p=>{try{return Reflect.ownKeys(p)}catch{return["[ownKeys threw]"]}};function h(p,y=0){if(Array.isArray(p)){if(o.has(p))return SS;if(o.add(p),!i||p.length<=1)return`[${p.map(v=>h(v,y)).join(",")}]`;const g=p.map(v=>h(v,y+1)).join(`,
|
|
58
|
+
*/var uS;function BP(){if(uS)return _h;uS=1;var e=Qa(),t=UP();function n(p,y){return p===y&&(p!==0||1/p===1/y)||p!==p&&y!==y}var o=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,c=e.useRef,l=e.useEffect,d=e.useMemo,h=e.useDebugValue;return _h.useSyncExternalStoreWithSelector=function(p,y,g,v,w){var S=c(null);if(S.current===null){var E={hasValue:!1,value:null};S.current=E}else E=S.current;S=d(function(){function H(T){if(!_){if(_=!0,O=T,T=v(T),w!==void 0&&E.hasValue){var L=E.value;if(w(L,T))return C=L}return C=T}if(L=C,o(O,T))return L;var $=v(T);return w!==void 0&&w(L,$)?(O=T,L):(O=T,C=$)}var _=!1,O,C,D=g===void 0?null:g;return[function(){return H(y())},D===null?void 0:function(){return H(D())}]},[y,g,v,w]);var P=i(p,S[0],S[1]);return l(function(){E.hasValue=!0,E.value=P},[P]),h(P),P},_h}var lS;function zP(){return lS||(lS=1,Eh.exports=BP()),Eh.exports}var VP=zP();function qP(e,t){return e===t}function en(e,t,n=qP){const o=Y.useCallback(l=>{if(!e)return()=>{};const{unsubscribe:d}=e.subscribe(l);return d},[e]),i=Y.useCallback(()=>e==null?void 0:e.get(),[e]);return VP.useSyncExternalStoreWithSelector(o,i,i,t,n)}var Ph={get(){},subscribe(){return{unsubscribe(){}}}};function qw(e,t){const n=Y.useRef();return o=>{const i=e!=null&&e.select?e.select(o):o;return(e==null?void 0:e.structuralSharing)??t.options.defaultStructuralSharing?n.current=Ys(n.current,i):i}}function mo(e){const t=An(),n=Y.useContext(e.from?MP:Ml),o=e.from?t.stores.getRouteMatchStore(e.from):t.stores.matchStores.get(n),i=qw(e,t),c=en(o??Ph,l=>l?i(l):Ph);if(c!==Ph)return c;(e.shouldThrow??!0)&&Br()}function Ww(e){return mo({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Hw(e){const{select:t,...n}=e;return mo({...n,select:o=>t?t(o.loaderDeps):o.loaderDeps})}function Kw(e){return mo({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Qw(e){return mo({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Jw(e){const t=An();return Y.useCallback(n=>t.navigate({...n,from:n.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,t])}function Gw(e){return mo({...e,select:t=>e.select?e.select(t.context):t.context})}var WP=vw();function HP(e,t){const n=An(),o=I2(t),{activeProps:i,inactiveProps:c,activeOptions:l,to:d,preload:h,preloadDelay:p,preloadIntentProximity:y,hashScrollIntoView:g,replace:v,startTransition:w,resetScroll:S,viewTransition:E,children:P,target:H,disabled:_,style:O,className:C,onClick:D,onBlur:T,onFocus:L,onMouseEnter:$,onMouseLeave:q,onTouchStart:ee,ignoreBlocker:se,params:K,search:k,hash:U,state:V,mask:J,reloadDocument:B,unsafeRelative:X,from:ne,_fromLocation:te,...I}=e,Z=$w(),pe=Y.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),me=en(n.stores.location,Be=>Be,(Be,Lt)=>Be.href===Lt.href),le=Y.useMemo(()=>{const Be={_fromLocation:me,...pe};return n.buildLocation(Be)},[n,me,pe]),Fe=le.maskedLocation?le.maskedLocation.publicHref:le.publicHref,fe=le.maskedLocation?le.maskedLocation.external:le.external,xe=Y.useMemo(()=>XP(Fe,fe,n.history,_),[_,fe,Fe,n.history]),be=Y.useMemo(()=>{if(xe!=null&&xe.external)return Zu(xe.href,n.protocolAllowlist)?void 0:xe.href;if(!ZP(d)&&!(typeof d!="string"||d.indexOf(":")===-1))try{return new URL(d),Zu(d,n.protocolAllowlist)?void 0:d}catch{}},[d,xe,n.protocolAllowlist]),Ve=Y.useMemo(()=>{if(be)return!1;if(l!=null&&l.exact){if(!H2(me.pathname,le.pathname,n.basepath))return!1}else{const Be=el(me.pathname,n.basepath),Lt=el(le.pathname,n.basepath);if(!(Be.startsWith(Lt)&&(Be.length===Lt.length||Be[Lt.length]==="/")))return!1}return((l==null?void 0:l.includeSearch)??!0)&&!eo(me.search,le.search,{partial:!(l!=null&&l.exact),ignoreUndefined:!(l!=null&&l.explicitUndefined)})?!1:l!=null&&l.includeHash?Z&&me.hash===le.hash:!0},[l==null?void 0:l.exact,l==null?void 0:l.explicitUndefined,l==null?void 0:l.includeHash,l==null?void 0:l.includeSearch,me,be,Z,le.hash,le.pathname,le.search,n.basepath]),on=Ve?Gs(i,{})??KP:Fh,xn=Ve?Fh:Gs(c,{})??Fh,br=[C,on.className,xn.className].filter(Boolean).join(" "),Wr=(O||on.style||xn.style)&&{...O,...on.style,...xn.style},[mc,_i]=Y.useState(!1),wo=Y.useRef(!1),Pr=e.reloadDocument||be?!1:h??n.options.defaultPreload,As=p??n.options.defaultPreloadDelay??0,wn=Y.useCallback(()=>{n.preloadRoute({...pe,_builtLocation:le}).catch(Be=>{console.warn(Be),console.warn(FP)})},[n,pe,le]);F2(o,Y.useCallback(Be=>{Be!=null&&Be.isIntersecting&&wn()},[wn]),YP,{disabled:!!_||Pr!=="viewport"}),Y.useEffect(()=>{wo.current||!_&&Pr==="render"&&(wn(),wo.current=!0)},[_,wn,Pr]);const Hr=Be=>{const Lt=Be.currentTarget.getAttribute("target"),Hn=H!==void 0?H:Lt;if(!_&&!eF(Be)&&!Be.defaultPrevented&&(!Hn||Hn==="_self")&&Be.button===0){Be.preventDefault(),WP.flushSync(()=>{_i(!0)});const Eo=n.subscribe("onResolved",()=>{Eo(),_i(!1)});n.navigate({...pe,replace:v,resetScroll:S,hashScrollIntoView:g,startTransition:w,viewTransition:E,ignoreBlocker:se})}};if(be)return{...I,ref:o,href:be,...P&&{children:P},...H&&{target:H},..._&&{disabled:_},...O&&{style:O},...C&&{className:C},...D&&{onClick:D},...T&&{onBlur:T},...L&&{onFocus:L},...$&&{onMouseEnter:$},...q&&{onMouseLeave:q},...ee&&{onTouchStart:ee}};const ko=Be=>{if(_||Pr!=="intent")return;if(!As){wn();return}const Lt=Be.currentTarget;if(ha.has(Lt))return;const Hn=setTimeout(()=>{ha.delete(Lt),wn()},As);ha.set(Lt,Hn)},pc=Be=>{_||Pr!=="intent"||wn()},Ci=Be=>{if(_||!Pr||!As)return;const Lt=Be.currentTarget,Hn=ha.get(Lt);Hn&&(clearTimeout(Hn),ha.delete(Lt))};return{...I,...on,...xn,href:xe==null?void 0:xe.href,ref:o,onClick:Qo([D,Hr]),onBlur:Qo([T,Ci]),onFocus:Qo([L,ko]),onMouseEnter:Qo([$,ko]),onMouseLeave:Qo([q,Ci]),onTouchStart:Qo([ee,pc]),disabled:!!_,target:H,...Wr&&{style:Wr},...br&&{className:br},..._&&QP,...Ve&&JP,...Z&&mc&&GP}}var Fh={},KP={className:"active"},QP={role:"link","aria-disabled":!0},JP={"data-status":"active","aria-current":"page"},GP={"data-transitioning":"transitioning"},ha=new WeakMap,YP={rootMargin:"100px"},Qo=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function XP(e,t,n,o){if(!o)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function ZP(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var gp=Y.forwardRef((e,t)=>{const{_asChild:n,...o}=e,{type:i,...c}=HP(o,t),l=typeof o.children=="function"?o.children({isActive:c["data-status"]==="active"}):o.children;if(!n){const{disabled:d,...h}=c;return Y.createElement("a",h,l)}return Y.createElement(n,c,l)});function eF(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var tF=class extends jw{constructor(e){super(e),this.useMatch=t=>mo({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>Gw({...t,from:this.id}),this.useSearch=t=>Qw({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>Kw({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Hw({...t,from:this.id}),this.useLoaderData=t=>Ww({...t,from:this.id}),this.useNavigate=()=>Jw({from:this.fullPath}),this.Link=Ia.forwardRef((t,n)=>F.jsx(gp,{ref:n,from:this.fullPath,...t}))}};function Yw(e){return new tF(e)}var nF=class extends IP{constructor(e){super(e),this.useMatch=t=>mo({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>Gw({...t,from:this.id}),this.useSearch=t=>Qw({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>Kw({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Hw({...t,from:this.id}),this.useLoaderData=t=>Ww({...t,from:this.id}),this.useNavigate=()=>Jw({from:this.fullPath}),this.Link=Ia.forwardRef((t,n)=>F.jsx(gp,{ref:n,from:this.fullPath,...t}))}};function rF(e){return new nF(e)}function sF(e){const t=An(),n=`not-found-${en(t.stores.location,o=>o.pathname)}-${en(t.stores.status,o=>o)}`;return F.jsx(mp,{getResetKey:()=>n,onCatch:(o,i)=>{var c;if(Kt(o))(c=e.onCatch)==null||c.call(e,o,i);else throw o},errorComponent:({error:o})=>{var i;if(Kt(o))return(i=e.fallback)==null?void 0:i.call(e,o);throw o},children:e.children})}function oF(){return F.jsx("p",{children:"Not Found"})}function ei(e){return F.jsx(F.Fragment,{children:e.children})}function Xw(e,t,n){return t.options.notFoundComponent?F.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?F.jsx(e.options.defaultNotFoundComponent,{...n}):F.jsx(oF,{})}function iF(e){return null}function aF(){return iF(An()),null}var cF=(e,t)=>e.routeId===t.routeId&&e._displayPending===t._displayPending,uF=(e,t)=>e[0]===t[0]&&e[1]===t[1],Zw=Y.memo(function({matchId:t}){const n=An(),o=n.stores.matchStores.get(t);o||Br();const i=en(n.stores.loadedAt,l=>l),c=en(o,l=>l,cF);return F.jsx(lF,{router:n,matchId:t,resetKey:i,matchState:Y.useMemo(()=>{var h;const l=c.routeId,d=(h=n.routesById[l].parentRoute)==null?void 0:h.id;return{routeId:l,ssr:c.ssr,_displayPending:c._displayPending,parentRouteId:d}},[c._displayPending,c.routeId,c.ssr,n.routesById])})});function lF({router:e,matchId:t,resetKey:n,matchState:o}){var S,E;const i=e.routesById[o.routeId],c=i.options.pendingComponent??e.options.defaultPendingComponent,l=c?F.jsx(c,{}):null,d=i.options.errorComponent??e.options.defaultErrorComponent,h=i.options.onCatch??e.options.defaultOnCatch,p=i.isRoot?i.options.notFoundComponent??((S=e.options.notFoundRoute)==null?void 0:S.options.component):i.options.notFoundComponent,y=o.ssr===!1||o.ssr==="data-only",g=(!i.isRoot||i.options.wrapInSuspense||y)&&(i.options.wrapInSuspense??c??(((E=i.options.errorComponent)==null?void 0:E.preload)||y))?Y.Suspense:ei,v=d?mp:ei,w=p?sF:ei;return F.jsxs(i.isRoot?i.options.shellComponent??ei:ei,{children:[F.jsx(Ml.Provider,{value:t,children:F.jsx(g,{fallback:l,children:F.jsx(v,{getResetKey:()=>n,errorComponent:d||pp,onCatch:(P,H)=>{if(Kt(P))throw P.routeId??(P.routeId=o.routeId),P;h==null||h(P,H)},children:F.jsx(w,{fallback:P=>{if(P.routeId??(P.routeId=o.routeId),!p||P.routeId&&P.routeId!==o.routeId||!P.routeId&&!i.isRoot)throw P;return Y.createElement(p,P)},children:y||o._displayPending?F.jsx(TP,{fallback:l,children:F.jsx(fS,{matchId:t})}):F.jsx(fS,{matchId:t})})})})}),o.parentRouteId===to?F.jsxs(F.Fragment,{children:[F.jsx(fF,{}),e.options.scrollRestoration&&Ew?F.jsx(aF,{}):null]}):null]})}function fF(){const e=An(),t=Y.useRef();return va(()=>{const n=e.stores.resolvedLocation.get(),o=t.current;n&&(!o||o.href!==n.href)&&e.emit({type:"onRendered",...ri(e.stores.location.get(),o??n)}),t.current=n},[en(e.stores.resolvedLocation,n=>n==null?void 0:n.state.__TSR_key),e]),null}var fS=Y.memo(function({matchId:t}){const n=An(),o=(y,g)=>{var v;return((v=n.getMatch(y.id))==null?void 0:v._nonReactive[g])??y._nonReactive[g]},i=n.stores.matchStores.get(t);i||Br();const c=en(i,y=>y),l=c.routeId,d=n.routesById[l],h=Y.useMemo(()=>{var g;const y=(g=n.routesById[l].options.remountDeps??n.options.defaultRemountDeps)==null?void 0:g({routeId:l,loaderDeps:c.loaderDeps,params:c._strictParams,search:c._strictSearch});return y?JSON.stringify(y):void 0},[l,c.loaderDeps,c._strictParams,c._strictSearch,n.options.defaultRemountDeps,n.routesById]),p=Y.useMemo(()=>{const y=d.options.component??n.options.defaultComponent;return y?F.jsx(y,{},h):F.jsx(e1,{})},[h,d.options.component,n.options.defaultComponent]);if(c._displayPending)throw o(c,"displayPendingPromise");if(c._forcePending)throw o(c,"minPendingPromise");if(c.status==="pending"){const y=d.options.pendingMinMs??n.options.defaultPendingMinMs;if(y){const g=n.getMatch(c.id);if(g&&!g._nonReactive.minPendingPromise){const v=ci();g._nonReactive.minPendingPromise=v,setTimeout(()=>{v.resolve(),g._nonReactive.minPendingPromise=void 0},y)}}throw o(c,"loadPromise")}if(c.status==="notFound")return Kt(c.error)||Br(),Xw(n,d,c.error);if(c.status==="redirected")throw mn(c.error)||Br(),o(c,"loadPromise");if(c.status==="error")throw c.error;return p}),e1=Y.memo(function(){const t=An(),n=Y.useContext(Ml);let o,i=!1,c;{const p=n?t.stores.matchStores.get(n):void 0;[o,i]=en(p,y=>[y==null?void 0:y.routeId,(y==null?void 0:y.globalNotFound)??!1],uF),c=en(t.stores.matchesId,y=>y[y.findIndex(g=>g===n)+1])}const l=o?t.routesById[o]:void 0,d=t.options.defaultPendingComponent?F.jsx(t.options.defaultPendingComponent,{}):null;if(i)return l||Br(),Xw(t,l,void 0);if(!c)return null;const h=F.jsx(Zw,{matchId:c});return o===to?F.jsx(Y.Suspense,{fallback:d,children:h}):h});function dF(){const e=An(),t=Y.useRef({router:e,mounted:!1}),[n,o]=Y.useState(!1),i=en(e.stores.isLoading,g=>g),c=en(e.stores.hasPending,g=>g),l=gh(i),d=i||n||c,h=gh(d),p=i||c,y=gh(p);return e.startTransition=g=>{o(!0),Y.startTransition(()=>{g(),o(!1)})},Y.useEffect(()=>{const g=e.history.subscribe(e.load),v=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return $r(e.latestLocation.publicHref)!==$r(v.publicHref)&&e.commitLocation({...v,replace:!0}),()=>{g()}},[e,e.history]),va(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(v){console.error(v)}})()},[e]),va(()=>{l&&!i&&e.emit({type:"onLoad",...ri(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,e,i]),va(()=>{y&&!p&&e.emit({type:"onBeforeRouteMount",...ri(e.stores.location.get(),e.stores.resolvedLocation.get())})},[p,y,e]),va(()=>{if(h&&!d){const g=ri(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...g}),zw(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())})}},[d,h,e]),null}function hF(){const e=An(),t=e.routesById[to].options.pendingComponent??e.options.defaultPendingComponent,n=t?F.jsx(t,{}):null,o=F.jsxs(typeof document<"u"&&e.ssr?ei:Y.Suspense,{fallback:n,children:[F.jsx(dF,{}),F.jsx(mF,{})]});return e.options.InnerWrap?F.jsx(e.options.InnerWrap,{children:o}):o}function mF(){const e=An(),t=en(e.stores.firstId,i=>i),n=en(e.stores.loadedAt,i=>i),o=t?F.jsx(Zw,{matchId:t}):null;return F.jsx(Ml.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?o:F.jsx(mp,{getResetKey:()=>n,errorComponent:pp,onCatch:void 0,children:o})})}var pF=e=>({createMutableStore:iS,createReadonlyStore:iS,batch:zw}),gF=e=>new yF(e),yF=class extends mP{constructor(e){super(e,pF)}};function vF({router:e,children:t,...n}){Cw(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const o=F.jsx(Uw.Provider,{value:e,children:t});return e.options.Wrap?F.jsx(e.options.Wrap,{children:o}):o}function SF({router:e,...t}){return F.jsx(vF,{router:e,...t,children:F.jsx(hF,{})})}function xF(e){const t=An({warn:(e==null?void 0:e.router)===void 0}),n=(e==null?void 0:e.router)||t;return en(n.stores.__store,qw(e,n))}const Ll=["claude","codex","cursor","copilot","pi","opencode","antigravity","gemini","grok"],yp=["vscode","monokai","dracula","github","nord","one-dark-pro","solarized","tokyo-night","catppuccin","midnight","forest","sunset","cyberpunk","synthwave","luxury","minimal"],mm={vscode:{name:"VS Code",light:{name:"Light+",primary:"#007ACC",background:"#FFFFFF",foreground:"#333333",card:"#F3F3F3",cardForeground:"#1E1E1E",border:"#E5E5E5",accent:"#0066BF",accentForeground:"#FFFFFF",muted:"#F6F6F6",mutedForeground:"#6E6E6E"},dark:{name:"Dark+",primary:"#007ACC",background:"#1E1E1E",foreground:"#CCCCCC",card:"#252526",cardForeground:"#CCCCCC",border:"#3E3E42",accent:"#0E639C",accentForeground:"#FFFFFF",muted:"#2D2D30",mutedForeground:"#858585"}},monokai:{name:"Monokai",light:{name:"Monokai Light",primary:"#A6E22E",background:"#F8F8F2",foreground:"#272822",card:"#E6E6E0",cardForeground:"#272822",border:"#C4C4B8",accent:"#66D9EF",accentForeground:"#272822",muted:"#E6E6E0",mutedForeground:"#75715E"},dark:{name:"Monokai",primary:"#A6E22E",background:"#272822",foreground:"#F8F8F2",card:"#3E3D32",cardForeground:"#F8F8F2",border:"#75715E",accent:"#66D9EF",accentForeground:"#272822",muted:"#49483E",mutedForeground:"#75715E"}},dracula:{name:"Dracula",light:{name:"Dracula Light",primary:"#BD93F9",background:"#F8F8F2",foreground:"#282A36",card:"#E6E6E0",cardForeground:"#282A36",border:"#C4C4B8",accent:"#FF79C6",accentForeground:"#282A36",muted:"#E6E6E0",mutedForeground:"#6272A4"},dark:{name:"Dracula",primary:"#BD93F9",background:"#282A36",foreground:"#F8F8F2",card:"#343746",cardForeground:"#F8F8F2",border:"#44475A",accent:"#FF79C6",accentForeground:"#282A36",muted:"#44475A",mutedForeground:"#6272A4"}},github:{name:"GitHub",light:{name:"GitHub Light",primary:"#0969DA",background:"#FFFFFF",foreground:"#24292F",card:"#F6F8FA",cardForeground:"#24292F",border:"#D0D7DE",accent:"#0969DA",accentForeground:"#FFFFFF",muted:"#F6F8FA",mutedForeground:"#57606A"},dark:{name:"GitHub Dark",primary:"#58A6FF",background:"#0D1117",foreground:"#C9D1D9",card:"#161B22",cardForeground:"#C9D1D9",border:"#30363D",accent:"#1F6FEB",accentForeground:"#FFFFFF",muted:"#161B22",mutedForeground:"#8B949E"}},nord:{name:"Nord",light:{name:"Nord Light",primary:"#5E81AC",background:"#ECEFF4",foreground:"#2E3440",card:"#E5E9F0",cardForeground:"#2E3440",border:"#D8DEE9",accent:"#88C0D0",accentForeground:"#2E3440",muted:"#E5E9F0",mutedForeground:"#4C566A"},dark:{name:"Nord",primary:"#88C0D0",background:"#2E3440",foreground:"#D8DEE9",card:"#3B4252",cardForeground:"#E5E9F0",border:"#434C5E",accent:"#5E81AC",accentForeground:"#ECEFF4",muted:"#434C5E",mutedForeground:"#88C0D0"}},"one-dark-pro":{name:"One Dark Pro",light:{name:"One Light Pro",primary:"#528BFF",background:"#FAFAFA",foreground:"#383A42",card:"#F0F0F0",cardForeground:"#383A42",border:"#E0E0E0",accent:"#61AFEF",accentForeground:"#FAFAFA",muted:"#F0F0F0",mutedForeground:"#5C6370"},dark:{name:"One Dark Pro",primary:"#61AFEF",background:"#282C34",foreground:"#ABB2BF",card:"#2C313C",cardForeground:"#ABB2BF",border:"#3E4451",accent:"#528BFF",accentForeground:"#FFFFFF",muted:"#3E4451",mutedForeground:"#5C6370"}},solarized:{name:"Solarized",light:{name:"Solarized Light",primary:"#268BD2",background:"#FDF6E3",foreground:"#657B83",card:"#EEE8D5",cardForeground:"#586E75",border:"#93A1A1",accent:"#2AA198",accentForeground:"#FDF6E3",muted:"#FDF6E3",mutedForeground:"#839496"},dark:{name:"Solarized Dark",primary:"#268BD2",background:"#002B36",foreground:"#839496",card:"#073642",cardForeground:"#93A1A1",border:"#586E75",accent:"#2AA198",accentForeground:"#FDF6E3",muted:"#073642",mutedForeground:"#657B83"}},"tokyo-night":{name:"Tokyo Night",light:{name:"Tokyo Night Day",primary:"#2E7DE9",background:"#E1E2E7",foreground:"#343B58",card:"#D5D6DB",cardForeground:"#343B58",border:"#9699A3",accent:"#7AA2F7",accentForeground:"#343B58",muted:"#D5D6DB",mutedForeground:"#565F89"},dark:{name:"Tokyo Night",primary:"#7AA2F7",background:"#1A1B26",foreground:"#C0CAF5",card:"#24283B",cardForeground:"#C0CAF5",border:"#414868",accent:"#BB9AF7",accentForeground:"#1A1B26",muted:"#2F3549",mutedForeground:"#565F89"}},catppuccin:{name:"Catppuccin",light:{name:"Catppuccin Latte",primary:"#1E66F5",background:"#EFF1F5",foreground:"#4C4F69",card:"#E6E9EF",cardForeground:"#4C4F69",border:"#BCC0CC",accent:"#EA76CB",accentForeground:"#EFF1F5",muted:"#E6E9EF",mutedForeground:"#6C6F85"},dark:{name:"Catppuccin Mocha",primary:"#89B4FA",background:"#1E1E2E",foreground:"#CDD6F4",card:"#313244",cardForeground:"#CDD6F4",border:"#45475A",accent:"#F38BA8",accentForeground:"#1E1E2E",muted:"#313244",mutedForeground:"#6C7086"}},midnight:{name:"Midnight",light:{name:"Midnight Light",primary:"#3B82F6",background:"#F8FAFC",foreground:"#0F172A",card:"#E2E8F0",cardForeground:"#0F172A",border:"#CBD5E1",accent:"#1D4ED8",accentForeground:"#F8FAFC",muted:"#E2E8F0",mutedForeground:"#64748B"},dark:{name:"Midnight",primary:"#3B82F6",background:"#0F172A",foreground:"#F8FAFC",card:"#1E293B",cardForeground:"#F8FAFC",border:"#334155",accent:"#1D4ED8",accentForeground:"#FFFFFF",muted:"#1E293B",mutedForeground:"#94A3B8"}},forest:{name:"Forest",light:{name:"Forest Light",primary:"#22C55E",background:"#F0FDF4",foreground:"#052E16",card:"#DCFCE7",cardForeground:"#052E16",border:"#BBF7D0",accent:"#15803D",accentForeground:"#F0FDF4",muted:"#DCFCE7",mutedForeground:"#166534"},dark:{name:"Forest",primary:"#22C55E",background:"#052E16",foreground:"#DCFCE7",card:"#14532D",cardForeground:"#DCFCE7",border:"#166534",accent:"#15803D",accentForeground:"#FFFFFF",muted:"#14532D",mutedForeground:"#86EFAC"}},sunset:{name:"Sunset",light:{name:"Sunset Light",primary:"#F97316",background:"#FFF7ED",foreground:"#431407",card:"#FFEDD5",cardForeground:"#431407",border:"#FED7AA",accent:"#EA580C",accentForeground:"#FFF7ED",muted:"#FFEDD5",mutedForeground:"#9A3412"},dark:{name:"Sunset",primary:"#F97316",background:"#431407",foreground:"#FFEDD5",card:"#7C2D12",cardForeground:"#FFEDD5",border:"#9A3412",accent:"#EA580C",accentForeground:"#FFFFFF",muted:"#7C2D12",mutedForeground:"#FDBA74"}},cyberpunk:{name:"Cyberpunk",light:{name:"Cyberpunk Light",primary:"#F472B6",background:"#FFFFFF",foreground:"#000000",card:"#F3F4F6",cardForeground:"#000000",border:"#E5E7EB",accent:"#E879F9",accentForeground:"#000000",muted:"#F3F4F6",mutedForeground:"#22D3EE"},dark:{name:"Cyberpunk",primary:"#F472B6",background:"#000000",foreground:"#22D3EE",card:"#111111",cardForeground:"#E879F9",border:"#F472B6",accent:"#FFFF00",accentForeground:"#000000",muted:"#111111",mutedForeground:"#22D3EE"}},synthwave:{name:"Synthwave",light:{name:"Synthwave Light",primary:"#D946EF",background:"#FAF5FF",foreground:"#2A0A3B",card:"#F3E8FF",cardForeground:"#2A0A3B",border:"#E9D5FF",accent:"#06B6D4",accentForeground:"#FAF5FF",muted:"#F3E8FF",mutedForeground:"#C026D3"},dark:{name:"Synthwave",primary:"#D946EF",background:"#2A0A3B",foreground:"#F5D0FE",card:"#4A1D66",cardForeground:"#F5D0FE",border:"#C026D3",accent:"#06B6D4",accentForeground:"#FFFFFF",muted:"#4A1D66",mutedForeground:"#E879F9"}},luxury:{name:"Luxury",light:{name:"Luxury Light",primary:"#D4AF37",background:"#FAFAF9",foreground:"#1C1917",card:"#F5F5F4",cardForeground:"#1C1917",border:"#E7E5E4",accent:"#B45309",accentForeground:"#FAFAF9",muted:"#F5F5F4",mutedForeground:"#78716C"},dark:{name:"Luxury",primary:"#D4AF37",background:"#1C1917",foreground:"#E7E5E4",card:"#292524",cardForeground:"#D4AF37",border:"#78716C",accent:"#B45309",accentForeground:"#FFFFFF",muted:"#292524",mutedForeground:"#A8A29E"}},minimal:{name:"Minimal",light:{name:"Minimal",primary:"#18181B",background:"#FFFFFF",foreground:"#18181B",card:"#FFFFFF",cardForeground:"#18181B",border:"#E4E4E7",accent:"#F4F4F5",accentForeground:"#18181B",muted:"#FAFAFA",mutedForeground:"#71717A"},dark:{name:"Minimal Dark",primary:"#FAFAFA",background:"#18181B",foreground:"#FAFAFA",card:"#27272A",cardForeground:"#FAFAFA",border:"#3F3F46",accent:"#27272A",accentForeground:"#FAFAFA",muted:"#27272A",mutedForeground:"#A1A1AA"}}},vp=["tokmon","phosphor",...yp],t1=[...vp,"custom"],wF={vscode:"VS Code Light+ and Dark+",monokai:"Classic editor green and cyan",dracula:"Purple and pink on deep slate",github:"GitHub light and dark",nord:"Arctic blue-gray palette","one-dark-pro":"Atom-inspired editor palette",solarized:"Precision blue and teal","tokyo-night":"Cool blue and violet",catppuccin:"Latte and Mocha palettes",midnight:"Deep navy and bright blue",forest:"Natural green surfaces",sunset:"Warm orange and earth tones",cyberpunk:"Neon cyan, pink, and yellow",synthwave:"Purple and electric cyan",luxury:"Gold on warm neutrals",minimal:"High-contrast monochrome"},dS=[{id:"tokmon",name:"Tokmon",hint:"Calm system utility",darkOnly:!1,custom:!1},{id:"phosphor",name:"Phosphor",hint:"Black terminal green",darkOnly:!0,custom:!1},...yp.map(e=>({id:e,name:mm[e].name,hint:wF[e],darkOnly:!1,custom:!1})),{id:"custom",name:"Custom",hint:"Your shared palette",darkOnly:!1,custom:!0}];function kF(e){return typeof e=="string"&&t1.includes(e)}function EF(e){return typeof e=="string"&&vp.includes(e)}function _F(e){return dS.find(t=>t.id===e)??dS[0]}function n1(e){return _F(e).darkOnly}const CF=["canvas","panel","inset","insetStrong","chrome","line","lineStrong","lineFaint","text","textDim","textFaint","textStrong","accent","cost","positive"],oi=Object.freeze({version:1,mode:"auto",preset:"tokmon",terminal:"ansi"}),r1={canvas:"#0a0a0a",panel:"#101011",inset:"#161617",insetStrong:"#1d1d1e",chrome:"#1e1f22",line:"#262627",lineStrong:"#343435",lineFaint:"#1a1a1b",text:"#d4d6d6",textDim:"#8d9090",textFaint:"#585b5b",textStrong:"#f3f5f5",accent:"#79be7e",cost:"#d9c074",positive:"#6caa71",ok:"#79be7e",warn:"#e0b84c",crit:"#e5584b",unknown:"#8d9090"},s1={canvas:"#f4f5f5",panel:"#ffffff",inset:"#eceeee",insetStrong:"#e1e4e4",chrome:"#f4f5f5",line:"#d4d9d9",lineStrong:"#bcc2c2",lineFaint:"#e7eaea",text:"#2b2e2e",textDim:"#5a6060",textFaint:"#979d9d",textStrong:"#0d1010",accent:"#2f8f57",cost:"#9a7b1c",positive:"#2f8f57",ok:"#2f8f57",warn:"#9a7b1c",crit:"#b0403a",unknown:"#5a6060"},bF={canvas:"#000000",panel:"#050705",inset:"#0a0f0b",insetStrong:"#101710",chrome:"#070b08",line:"#1a2a1e",lineStrong:"#2c4634",lineFaint:"#101812",text:"#c6f7d3",textDim:"#7fc98d",textFaint:"#4c7d57",textStrong:"#eafff0",accent:"#35f38a",cost:"#ffd24a",positive:"#35f38a",ok:"#35f38a",warn:"#ffc44d",crit:"#ff6b5b",unknown:"#7fc98d"},PF={canvas:"#f3f5f0",panel:"#ffffff",inset:"#e8ede7",insetStrong:"#dce5dc",chrome:"#f3f5f0",line:"#cad7ca",lineStrong:"#a9bca9",lineFaint:"#e4ebe4",text:"#0b2610",textDim:"#426b49",textFaint:"#748c78",textStrong:"#031507",accent:"#128a2e",cost:"#826500",positive:"#128a2e",ok:"#128a2e",warn:"#826500",crit:"#b23a32",unknown:"#5c705f"},FF=/^#[0-9a-f]{6}$/i;function er(e){return typeof e=="string"&&FF.test(e)?e.toLowerCase():null}function pm(e){return[Number.parseInt(e.slice(1,3),16),Number.parseInt(e.slice(3,5),16),Number.parseInt(e.slice(5,7),16)]}function Ih(e){return Math.round(Math.max(0,Math.min(255,e))).toString(16).padStart(2,"0")}function Ur(e,t,n){const[o,i,c]=pm(e),[l,d,h]=pm(t),p=Math.max(0,Math.min(1,n));return`#${Ih(o+(l-o)*p)}${Ih(i+(d-i)*p)}${Ih(c+(h-c)*p)}`}function hS(e){const t=er(e);if(!t)throw new TypeError("expected a #RRGGBB color");const n=pm(t).map(o=>{const i=o/255;return i<=.04045?i/12.92:((i+.055)/1.055)**2.4});return .2126*n[0]+.7152*n[1]+.0722*n[2]}function Zs(e,t){const n=hS(e),o=hS(t);return(Math.max(n,o)+.05)/(Math.min(n,o)+.05)}function Nr(e,t,n,o){const i=er(e);if(t.every(h=>Zs(i,h)>=n))return i;const c=[o,"#000000","#ffffff"].reduce((h,p)=>Math.min(...t.map(y=>Zs(p,y)))>Math.min(...t.map(y=>Zs(h,y)))?p:h);let l=0,d=1;for(let h=0;h<16;h++){const p=(l+d)/2,y=Ur(i,c,p);t.every(g=>Zs(y,g)>=n)?d=p:l=p}return Ur(i,c,d)}function mS(e,t){const n=er(e.background),o=er(e.card),i=er(e.foreground),c=t==="dark"?"#ffffff":"#000000",l=Nr(i,[n,o],4.5,c),d=Nr(e.cardForeground,[n,o],4.5,c),h=Nr(e.mutedForeground,[n],3,l),p=Nr(e.primary,[n,o],3,l),y=Nr(e.accent,[o],3,l),g=Nr(e.primary,[o],3,l),v=t==="dark"?r1:s1;return{canvas:n,panel:o,inset:er(e.muted),insetStrong:Ur(e.muted,e.foreground,.08),chrome:n,line:er(e.border),lineStrong:Ur(e.border,e.foreground,.18),lineFaint:Ur(e.background,e.border,.5),text:l,textDim:h,textFaint:er(e.mutedForeground),textStrong:d,accent:p,cost:y,positive:g,ok:Nr(v.ok,[o],3,l),warn:Nr(v.warn,[o],3,l),crit:Nr(v.crit,[o],3,l),unknown:h}}const IF=Object.fromEntries(yp.map(e=>[e,{light:mS(mm[e].light,"light"),dark:mS(mm[e].dark,"dark")}])),gm={tokmon:{light:s1,dark:r1},phosphor:{light:PF,dark:bF},...IF},RF=[["text","canvas",4.5],["text","panel",4.5],["textStrong","canvas",4.5],["textStrong","panel",4.5],["textDim","canvas",3],["accent","canvas",3],["accent","panel",3],["cost","panel",3],["positive","panel",3],["ok","panel",3],["warn","panel",3],["crit","panel",3]];function o1(e){return RF.flatMap(([t,n,o])=>{const i=Zs(e[t],e[n]);return i+Number.EPSILON<o?[{foreground:t,background:n,minimum:o,actual:i}]:[]})}function ym(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function pS(e,t,n,o){if(!ym(e))return e!==void 0&&o.push(`custom.${t} was not an object`),{};const i={};for(const c of CF){if(!(c in e))continue;const l=er(e[c]);l?i[c]=l:o.push(`custom.${t}.${c} was not a #RRGGBB color`)}for(;;){const c={...n,...i},l=o1(c)[0];if(!l)break;const d=l.foreground,h=l.background;if(d in i)delete i[d],o.push(`custom.${t}.${d} did not meet WCAG contrast`);else if(h in i)delete i[h],o.push(`custom.${t}.${h} did not meet WCAG contrast`);else break}return i}function i1(e){const t=[],n=ym(e)?e:{};n!==e&&e!==void 0&&t.push("appearance was not an object");const o=n.mode==="light"||n.mode==="dark"||n.mode==="auto"?n.mode:oi.mode;n.mode!==void 0&&n.mode!==o&&t.push("appearance.mode was invalid");const i=kF(n.preset)?n.preset:oi.preset;n.preset!==void 0&&n.preset!==i&&t.push("appearance.preset was invalid");const c=n.terminal==="dark"||n.terminal==="light"||n.terminal==="off"||n.terminal==="ansi"?n.terminal:oi.terminal;n.terminal!==void 0&&n.terminal!==c&&t.push("appearance.terminal was invalid"),n.version!==void 0&&n.version!==1&&t.push("appearance.version was invalid");let l;if(i==="custom"||n.custom!==void 0){const h=ym(n.custom)?n.custom:{};n.custom!==void 0&&h!==n.custom&&t.push("appearance.custom was not an object");const p=EF(h.base)?h.base:"tokmon";h.base!==void 0&&h.base!==p&&t.push("custom.base was invalid"),l={base:p,light:pS(h.light,"light",gm[p].light,t),dark:pS(h.dark,"dark",gm[p].dark,t)}}const d={version:1,mode:o,preset:i,terminal:c,...l?{custom:l}:{}};return{appearance:d,repaired:t.length>0||JSON.stringify(n)!==JSON.stringify(d),reasons:t}}function TF(e){return i1(e).appearance}function AF(e){return{...e,card:Ur(e.panel,e.text,.06),cardHover:Ur(e.panel,e.text,.1),divider:e.line,track:Ur(e.panel,e.text,.1),accentTint:Ur(e.panel,e.accent,.14),accentOn:Zs(e.accent,"#000000")>=Zs(e.accent,"#ffffff")?"#000000":"#ffffff",focusRing:e.accent}}function a1(e,t="dark"){var h,p;const n=TF(e),o=n.mode==="auto"?t:n.mode,i=n1(n.preset)?"dark":o,c=n.preset==="custom"?((h=n.custom)==null?void 0:h.base)??"tokmon":n.preset,l=gm[c][i],d=n.preset==="custom"?((p=n.custom)==null?void 0:p[i])??{}:{};return{mode:i,tokens:AF({...l,...d})}}const c1=[7,14,30];function MF(e,t){const n=Array.isArray(e)?e:t&&typeof t=="string"&&t.trim()?[t]:[];return rl(n,2)}function rl(e,t){if(!Array.isArray(e))return[];const n=new Set,o=[];for(const i of e){if(typeof i!="string")continue;const c=i.trim();if(!(!c||n.has(c))&&(n.add(c),o.push(c),o.length>=t))break}return o}const LF=2;function OF(e,t,n=Number.POSITIVE_INFINITY){return rl(e.filter(o=>t.has(o)),n)}function _$(e,t,n,o=Number.POSITIVE_INFINITY){const i=OF(e,n,o);return i.includes(t)?i.filter(c=>c!==t):!n.has(t)||i.length>=o?i:[...i,t]}function C$(e,t,n){const o=[...e],i=o.indexOf(t),c=i+n;return i<0||c<0||c>=o.length||([o[i],o[c]]=[o[c],o[i]]),o}const Wt={enabled:!0,showMenuBarText:!0,menuBarValue:"usage",displayMetric:"smartHeadroom",pollIntervalSec:30,activeTimeoutMin:10,graceMin:30,promotionHoldMin:5,lowWatermarkPct:20,criticalWatermarkPct:5,pinnedAccount:null,pins:[],pinnedProviders:[],launchAtLogin:!1,theme:"dark"},NF=32,Sp={expandedProviders:[],graphRangeDays:14},xp={enabled:!0,disabledProviders:[],excludedAccounts:[]},bn={revision:0,interval:2,billingInterval:5,clearScreen:!0,privacyMode:!0,privacyToggleKey:"p",timezone:null,accounts:[],activeAccountId:null,disabledProviders:[],onboarded:!1,dashboardLayout:"grid",defaultFocus:"all",ascii:"auto",allowNetworkAccess:!1,allowedHosts:[],resetDisplay:"relative",knownProviders:[],appearance:{...oi},accountDetection:{...xp},tray:{...Wt},desktop:{...Sp}},DF=["claude","codex","cursor"],Rh=["cyan","magenta","green","yellow","blue","red"],gS=[...Ll],b$=["cyan","magenta","green","yellow","blue","red","cyanBright","magentaBright","greenBright"],Fu={claude:{name:"Claude",color:"green"},codex:{name:"Codex",color:"cyan"},cursor:{name:"Cursor",color:"magenta"},copilot:{name:"Copilot",color:"white"},pi:{name:"Pi",color:"blue"},opencode:{name:"opencode",color:"yellow"},antigravity:{name:"Antigravity",color:"red"},gemini:{name:"Gemini",color:"greenBright"},grok:{name:"Grok",color:"yellowBright"}},jF=/[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}/i,$F=/[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}/gi;function UF(e){return typeof e=="string"&&jF.test(e)}function u1(e){return e.replace($F,"[redacted]")}function P$(e,t=gS.filter(o=>!e.disabledProviders.includes(o)),n){const o=new Set(t),i=new Set,c=new Set,l=new Set,d=new Set,h=[],p=e.accountDetection.enabled,y=new Set(e.accountDetection.disabledProviders),g=(S,E)=>`${S}:${E&&E!=="~"?E:"~"}`,v=new Set(e.accountDetection.excludedAccounts.map(S=>g(S.providerId,S.homeDir))),w=S=>{l.add(S.id),d.add(g(S.providerId,S.homeDir)),h.push(S)};if(e.accounts.forEach((S,E)=>{const P=Fu[S.providerId];i.add(S.id),c.add(g(S.providerId,S.homeDir)),w({id:S.id,providerId:S.providerId,name:S.name,homeDir:S.homeDir||"~",color:S.color||P.color,source:"configured",explicitId:S.id,explicitIndex:E})}),n)for(const S of n){if(!p||y.has(S.providerId)||e.disabledProviders.includes(S.providerId))continue;const E=g(S.providerId,S.homeDir);if(v.has(E)||i.has(S.id)||c.has(E)||l.has(S.id)||d.has(E))continue;const P=Fu[S.providerId];w({id:S.id,providerId:S.providerId,name:S.name,homeDir:S.homeDir||"~",color:S.color||P.color,source:"auto"})}for(const S of gS){if(!p||y.has(S)||e.disabledProviders.includes(S)||!o.has(S))continue;const E=g(S,"~");if(v.has(E)||i.has(S)||c.has(E)||l.has(S)||d.has(E))continue;const P=Fu[S];w({id:S,providerId:S,name:P.name,homeDir:"~",color:P.color,source:"auto"})}for(const S of e.accountDetection.excludedAccounts){if(c.has(g(S.providerId,S.homeDir)))continue;const E=Fu[S.providerId];w({id:`ignored:${S.providerId}:${S.homeDir}`,providerId:S.providerId,name:`${E.name} account`,homeDir:S.homeDir,color:E.color,source:"ignored",excludedRef:S})}return h}function F$(e,t){return e.enabled&&!e.disabledProviders.includes(t)}function I$(e,t,n){const o=e.disabledProviders.filter(i=>i!==t);return{...e,disabledProviders:n?o:[...o,t]}}function R$(e,t,n){const o=t.homeDir.trim()||"~",i=l=>l.providerId===t.providerId&&l.homeDir===o,c=e.excludedAccounts.filter(l=>!i(l));return{...e,excludedAccounts:n?[...c,{providerId:t.providerId,homeDir:o}]:c}}function yS(e,t,n){return typeof e=="number"&&Number.isFinite(e)&&e>=n?e:t}function Jo(e,t,n,o){return typeof e=="number"&&Number.isFinite(e)&&e>=n&&e<=o?e:t}function BF(e){try{return new Intl.DateTimeFormat("en-CA",{timeZone:e}),!0}catch{return!1}}function Dr(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function ma(e){return Ll.includes(e)}function pa(e,t){try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}function zF(e){if(typeof e!="string")return null;const t=e.trim();if(!t)return null;try{const n=new URL(`http://${t}`);if(n.username||n.password||n.port||n.pathname!=="/"||n.search||n.hash)return null;const o=n.hostname.toLowerCase().replace(/\.$/,"");return!o||o.length>253||o.includes("*")||o.split(".").some(c=>!c||c.length>63||!/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/.test(c))?null:o}catch{return null}}function VF(e){if(!Array.isArray(e))return[];const t=e.map(zF).filter(n=>n!==null);return[...new Set(t)]}function l1(e){const t=[],n=Dr(e)?e:{};n!==e&&t.push("config root was not an object");const o=Array.isArray(n.accounts)?n.accounts:[];!Array.isArray(n.accounts)&&n.accounts!==void 0&&t.push("accounts was not an array");const i=[],c=new Set;o.forEach((T,L)=>{if(!Dr(T)){t.push(`accounts[${L}] was not an object`);return}const $=T.providerId??"claude";if(!ma($)){t.push(`accounts[${L}].providerId was invalid`);return}const q=typeof T.id=="string"&&T.id.trim()?T.id.trim():"",ee=typeof T.name=="string"&&T.name.trim()?T.name.trim():"";if(!q||!ee){t.push(`accounts[${L}] was missing id or name`);return}if(c.has(q)){t.push(`accounts[${L}].id was duplicated`);return}c.add(q),i.push({id:q,providerId:$,name:ee,homeDir:typeof T.homeDir=="string"&&T.homeDir.trim()?T.homeDir:"~",...typeof T.color=="string"&&T.color.trim()?{color:T.color}:{}})});const l=(Array.isArray(n.disabledProviders)?n.disabledProviders:[]).filter(ma);n.disabledProviders!==void 0&&!Array.isArray(n.disabledProviders)&&t.push("disabledProviders was not an array");const d=Array.isArray(n.knownProviders)?n.knownProviders.filter(ma):n.onboarded===!0?[...DF]:[];n.knownProviders!==void 0&&!Array.isArray(n.knownProviders)&&t.push("knownProviders was not an array");const h=VF(n.allowedHosts);n.allowedHosts!==void 0&&!pa(n.allowedHosts,h)&&t.push("allowedHosts contained invalid or duplicate hostnames");const p=i1(n.appearance);n.appearance!==void 0&&p.repaired&&t.push(...p.reasons);const y=Dr(n.accountDetection)?n.accountDetection:{};n.accountDetection!==void 0&&!Dr(n.accountDetection)&&t.push("accountDetection was not an object");const g=Array.isArray(y.disabledProviders)?[...new Set(y.disabledProviders.filter(ma))]:[],v=[],w=new Set;Array.isArray(y.excludedAccounts)?y.excludedAccounts.forEach((T,L)=>{if(!Dr(T)||!ma(T.providerId)||typeof T.homeDir!="string"||!T.homeDir.trim()){t.push(`accountDetection.excludedAccounts[${L}] was invalid`);return}const $=T.homeDir.trim(),q=`${T.providerId}:${$}`;w.has(q)||(w.add(q),v.push({providerId:T.providerId,homeDir:$}))}):y.excludedAccounts!==void 0&&t.push("accountDetection.excludedAccounts was not an array");const S={enabled:typeof y.enabled=="boolean"?y.enabled:xp.enabled,disabledProviders:g,excludedAccounts:v};n.accountDetection!==void 0&&!pa(n.accountDetection,S)&&t.push("accountDetection contained invalid settings");const E=Dr(n.tray)?n.tray:{};n.tray!==void 0&&!Dr(n.tray)&&t.push("tray was not an object");const P={enabled:typeof E.enabled=="boolean"?E.enabled:Wt.enabled,showMenuBarText:typeof E.showMenuBarText=="boolean"?E.showMenuBarText:Wt.showMenuBarText,menuBarValue:E.menuBarValue==="todayTokens"||E.menuBarValue==="usage"?E.menuBarValue:Wt.menuBarValue,displayMetric:E.displayMetric==="tightestRemaining"||E.displayMetric==="smartHeadroom"?E.displayMetric:Wt.displayMetric,pollIntervalSec:Jo(E.pollIntervalSec,Wt.pollIntervalSec,1,86400),activeTimeoutMin:Jo(E.activeTimeoutMin,Wt.activeTimeoutMin,1,1440),graceMin:Jo(E.graceMin,Wt.graceMin,1,10080),promotionHoldMin:Jo(E.promotionHoldMin,Wt.promotionHoldMin,0,1440),lowWatermarkPct:Jo(E.lowWatermarkPct,Wt.lowWatermarkPct,0,100),criticalWatermarkPct:Jo(E.criticalWatermarkPct,Wt.criticalWatermarkPct,0,100),pinnedAccount:typeof E.pinnedAccount=="string"&&E.pinnedAccount.trim()?E.pinnedAccount.trim():null,pins:MF(E.pins,typeof E.pinnedAccount=="string"?E.pinnedAccount:null),pinnedProviders:rl(E.pinnedProviders,LF),launchAtLogin:typeof E.launchAtLogin=="boolean"?E.launchAtLogin:Wt.launchAtLogin,theme:E.theme==="dark"?E.theme:Wt.theme};P.graceMin<P.activeTimeoutMin&&(P.graceMin=Math.max(Wt.graceMin,P.activeTimeoutMin)),P.criticalWatermarkPct>P.lowWatermarkPct&&(P.criticalWatermarkPct=Math.min(Wt.criticalWatermarkPct,P.lowWatermarkPct)),n.tray!==void 0&&!pa(n.tray,P)&&t.push("tray contained invalid settings");const H=Dr(n.desktop)?n.desktop:{};n.desktop!==void 0&&!Dr(n.desktop)&&t.push("desktop was not an object");const _={expandedProviders:rl(H.expandedProviders,NF),graphRangeDays:c1.includes(H.graphRangeDays)?H.graphRangeDays:Sp.graphRangeDays};n.desktop!==void 0&&!pa(n.desktop,_)&&t.push("desktop contained invalid settings");const O=typeof n.activeAccountId=="string"&&(c.has(n.activeAccountId)||Ll.includes(n.activeAccountId))?n.activeAccountId:null;n.activeAccountId!==void 0&&n.activeAccountId!==null&&O===null&&t.push("activeAccountId did not match a known account/provider");const C=typeof n.timezone=="string"&&n.timezone.trim()&&BF(n.timezone.trim())?n.timezone.trim():null;n.timezone!==void 0&&n.timezone!==null&&C===null&&t.push("timezone was invalid");const D={...bn,revision:typeof n.revision=="number"&&Number.isSafeInteger(n.revision)&&n.revision>=0?n.revision:bn.revision,interval:yS(n.interval,bn.interval,1),billingInterval:yS(n.billingInterval,bn.billingInterval,1),clearScreen:typeof n.clearScreen=="boolean"?n.clearScreen:bn.clearScreen,privacyMode:typeof n.privacyMode=="boolean"?n.privacyMode:bn.privacyMode,privacyToggleKey:typeof n.privacyToggleKey=="string"&&n.privacyToggleKey.length===1?n.privacyToggleKey:bn.privacyToggleKey,timezone:C,accounts:i,activeAccountId:O,disabledProviders:l,onboarded:n.onboarded===!0,dashboardLayout:n.dashboardLayout==="single"?"single":"grid",defaultFocus:n.defaultFocus==="last"?"last":"all",ascii:n.ascii==="on"?"on":n.ascii==="off"?"off":"auto",allowNetworkAccess:n.allowNetworkAccess===!0,allowedHosts:h,resetDisplay:n.resetDisplay==="absolute"?"absolute":"relative",knownProviders:d,appearance:p.appearance,accountDetection:S,tray:P,desktop:_};for(const T of Object.keys(bn))T in n||t.push(`missing ${T}`);return{config:D,repaired:t.length>0||!pa(n,D),reasons:t}}function qF(e){try{return l1(e).config}catch{return{...bn,appearance:{...oi},accountDetection:{...xp},tray:{...Wt},desktop:{...Sp}}}}function WF(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"").slice(0,48)}function T$(e,t){const n=WF(e)||"account",o=new Set(t.map(i=>i.id));if(!o.has(n))return n;for(let i=2;i<1e3;i++){const c=`${n}_${i}`;if(!o.has(c))return c}return`${n}_${Date.now()}`}function A$(e){const t=new Set(e.map(n=>n.color).filter(Boolean));for(const n of Rh)if(!t.has(n))return n;return Rh[e.length%Rh.length]}function M$(e){return e?e.replace(/\x1b\][\s\S]*?(?:\x07|\x1b\\)/g,"").replace(/\x1b\[[0-?]*[ -/]*[@-~]/g,"").replace(/\x1bO./g,"").replace(/\x1b/g,"").replace(/[\x00-\x1f\x7f-\x9f]/g,"").replace(/\[20[01]~/g,""):""}const HF=e=>Math.max(0,Math.min(100,e));function L$(e){return e===null||!Number.isFinite(e)?null:HF(100-e)}function O$(e){return e===null||!Number.isFinite(e)?"unknown":e<=10?"crit":e<=25?"warn":"ok"}function KF(e,t){const n=e.identity;return n?[n.title,n.subtitle].filter(i=>!!(i!=null&&i.trim())).filter((i,c,l)=>l.indexOf(i)===c).filter(i=>i.toLocaleLowerCase()!==t.toLocaleLowerCase()).join(" · ")||n.title||t:e.name||t}function N$(e,t,n,o){return n?{draft:e,revision:t,conflict:t!==null&&o.config.revision>t}:t!==null&&o.config.revision<t?{draft:e,revision:t,conflict:!1}:{draft:o.config,revision:o.config.revision,conflict:!1}}function wp(e){var t;if(e&&typeof e=="object"){const n=e;if(n.kind==="conflict"){const o=n.state,i=(t=o==null?void 0:o.config)==null?void 0:t.revision;return{message:typeof i=="number"?`configuration changed elsewhere (daemon revision ${i})`:"settings changed elsewhere; reload before saving",conflictState:o!=null&&o.config&&typeof i=="number"?o:null}}if(n.kind==="persistence"&&typeof n.message=="string")return{message:n.message,conflictState:null}}return{message:e instanceof Error?e.message:"config update failed",conflictState:null}}const jt=(e,t)=>{switch(t.length){case 0:return e;case 1:return t[0](e);case 2:return t[1](t[0](e));case 3:return t[2](t[1](t[0](e)));case 4:return t[3](t[2](t[1](t[0](e))));case 5:return t[4](t[3](t[2](t[1](t[0](e)))));case 6:return t[5](t[4](t[3](t[2](t[1](t[0](e))))));case 7:return t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))));case 8:return t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e))))))));case 9:return t[8](t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))))));default:{let n=e;for(let o=0,i=t.length;o<i;o++)n=t[o](n);return n}}},QF={pipe(){return jt(this,arguments)}},Ol=(function(){function e(){}return e.prototype=QF,e})(),re=function(e,t){if(typeof e=="function")return function(){return e(arguments)?t.apply(this,arguments):n=>t(n,...arguments)};switch(e){case 0:case 1:throw new RangeError(`Invalid arity ${e}`);case 2:return function(n,o){return arguments.length>=2?t(n,o):function(i){return t(i,n)}};case 3:return function(n,o,i){return arguments.length>=3?t(n,o,i):function(c){return t(c,n,o)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);const n=arguments;return function(o){return t(o,...n)}}}},Ie=e=>e,_s=e=>()=>e,kp=_s(!0),f1=_s(!1),Nl=_s(void 0),Ga=Nl;function d1(e,t,n,o,i,c,l,d,h){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return o(n(t(e.apply(this,arguments))))};case 5:return function(){return i(o(n(t(e.apply(this,arguments)))))};case 6:return function(){return c(i(o(n(t(e.apply(this,arguments))))))};case 7:return function(){return l(c(i(o(n(t(e.apply(this,arguments)))))))};case 8:return function(){return d(l(c(i(o(n(t(e.apply(this,arguments))))))))};case 9:return function(){return h(d(l(c(i(o(n(t(e.apply(this,arguments)))))))))}}}function Cs(e){const t=new WeakMap;return n=>{if(t.has(n))return t.get(n);const o=e(n);return t.set(n,o),o}}const vm=e=>{const t=new Set(Reflect.ownKeys(e));if(e.constructor===Object)return t;e instanceof Error&&t.delete("stack");const n=Object.getPrototypeOf(e);let o=n;for(;o!==null&&o!==Object.prototype;){const i=Reflect.ownKeys(o);for(let c=0;c<i.length;c++)t.add(i[c]);o=Object.getPrototypeOf(o)}return t.has("constructor")&&typeof e.constructor=="function"&&n===e.constructor.prototype&&t.delete("constructor"),t},Sm=new WeakSet;function Ep(e){return typeof e=="string"}function h1(e){return typeof e=="number"}function JF(e){return typeof e=="boolean"}function Dl(e){return typeof e=="function"}function GF(e){return e!==void 0}function YF(e){return e!=null}function XF(e){return!1}function m1(e){return!0}function ZF(e){return typeof e=="object"&&e!==null||Dl(e)}const Ue=re(2,(e,t)=>ZF(e)&&t in e);function eI(e){return Ue(e,Symbol.iterator)||Ep(e)}const rn="~effect/interfaces/Hash",gt=e=>{switch(typeof e){case"number":return _p(e);case"bigint":return Ft(e.toString(10));case"boolean":return Ft(String(e));case"symbol":return Ft(String(e));case"string":return Ft(e);case"undefined":return Ft("undefined");case"function":case"object":{if(e===null)return Ft("null");if(e instanceof Date)return Ft(e.toISOString());if(e instanceof RegExp)return Ft(e.toString());{if(Sm.has(e))return xm(e);if(Ah.has(e))return Ah.get(e);const t=oI(e,()=>tI(e)?e[rn]():typeof e=="function"?xm(e):Array.isArray(e)||ArrayBuffer.isView(e)?p1(e):e instanceof Map?rI(e):e instanceof Set?sI(e):Cp(e));return Ah.set(e,t),t}}default:throw new Error(`BUG: unhandled typeof ${typeof e} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},xm=e=>(Th.has(e)||Th.set(e,_p(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER))),Th.get(e)),nr=re(2,(e,t)=>e*53^t),jl=e=>e&3221225471|e>>>1&1073741824,tI=e=>Ue(e,rn),_p=e=>{if(e!==e)return Ft("NaN");if(e===1/0)return Ft("Infinity");if(e===-1/0)return Ft("-Infinity");let t=e|0;for(t!==e&&(t^=e*4294967295);e>4294967295;)t^=e/=4294967295;return jl(t)},Ft=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return jl(t)},nI=(e,t)=>{let n=12289;for(const o of t)n^=nr(gt(o),gt(e[o]));return jl(n)},Cp=e=>nI(e,vm(e)),bp=(e,t)=>n=>{let o=e;for(const i of n)o^=t(i);return jl(o)},p1=bp(6151,gt),rI=bp(Ft("Map"),([e,t])=>nr(gt(e),gt(t))),sI=bp(Ft("Set"),gt),Th=new WeakMap,Ah=new WeakMap,Mh=new WeakSet;function oI(e,t){if(Mh.has(e))return Ft("[Circular]");Mh.add(e);const n=t();return Mh.delete(e),n}const sn="~effect/interfaces/Equal";function Pn(){return arguments.length===1?e=>co(e,arguments[0]):co(arguments[0],arguments[1])}function co(e,t){if(e===t)return!0;if(e==null||t==null)return!1;const n=typeof e;return n!==typeof t?!1:n==="number"&&e!==e&&t!==t?!0:n!=="object"&&n!=="function"||Sm.has(e)||Sm.has(t)?!1:cI(e,t,aI)}function iI(e,t,n){const o=Lh.has(e),i=Oh.has(t);if(o&&i)return!0;if(o||i)return!1;Lh.add(e),Oh.add(t);const c=n();return Lh.delete(e),Oh.delete(t),c}const Lh=new WeakSet,Oh=new WeakSet;function aI(e,t){if(gt(e)!==gt(t))return!1;if(e instanceof Date)return t instanceof Date?e.toISOString()===t.toISOString():!1;if(e instanceof RegExp)return t instanceof RegExp?e.toString()===t.toString():!1;const n=vS(e),o=vS(t);if(n!==o)return!1;const i=n&&o;return typeof e=="function"&&!i?!1:iI(e,t,()=>i?e[sn](t):Array.isArray(e)?!Array.isArray(t)||e.length!==t.length?!1:uI(e,t):ArrayBuffer.isView(e)?!ArrayBuffer.isView(t)||e.byteLength!==t.byteLength?!1:lI(e,t):e instanceof Map?!(t instanceof Map)||e.size!==t.size?!1:hI(e,t):e instanceof Set?!(t instanceof Set)||e.size!==t.size?!1:pI(e,t):fI(e,t))}function cI(e,t,n){let o=Iu.get(e);if(!o)o=new WeakMap,Iu.set(e,o);else if(o.has(t))return o.get(t);const i=n(e,t);o.set(t,i);let c=Iu.get(t);return c||(c=new WeakMap,Iu.set(t,c)),c.set(e,i),i}const Iu=new WeakMap;function uI(e,t){for(let n=0;n<e.length;n++)if(!co(e[n],t[n]))return!1;return!0}function lI(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function fI(e,t){const n=vm(e),o=vm(t);if(n.size!==o.size)return!1;for(const i of n)if(!o.has(i)||!co(e[i],t[i]))return!1;return!0}function dI(e,t){return function(o,i){for(const[c,l]of o){let d=!1;for(const[h,p]of i)if(e(c,h)&&t(l,p)){d=!0;break}if(!d)return!1}return!0}}const hI=dI(co,co);function mI(e){return function(n,o){for(const i of n){let c=!1;for(const l of o)if(e(i,l)){c=!0;break}if(!c)return!1}return!0}}const pI=mI(co),vS=e=>Ue(e,sn),gI=()=>Pn,yI=e=>(t,n)=>t===n||e(t,n),vI=(e,t)=>e===t,SI=()=>vI;function xI(e){return yI((t,n)=>{if(t.length!==n.length)return!1;for(let o=0;o<t.length;o++)if(!e(t[o],n[o]))return!1;return!0})}const g1=e=>e.length>0,$l=Symbol.for("~effect/Redactable"),wI=e=>Ue(e,$l);function Ul(e){return wI(e)?y1(e):e}function y1(e){var t;return e[$l](((t=globalThis[_a])==null?void 0:t.context)??kI)}const _a="~effect/Fiber/currentFiber",kI={"~effect/Context":{},mapUnsafe:new Map,pipe(){return jt(this,arguments)}};function yt(e,t){const n=(t==null?void 0:t.space)??0,o=new WeakSet,i=n?typeof n=="number"?" ".repeat(n):n:"",c=p=>i.repeat(p),l=(p,y)=>{const g=p==null?void 0:p.constructor;return g&&g!==Object.prototype.constructor&&g.name?`${g.name}(${y})`:y},d=p=>{try{return Reflect.ownKeys(p)}catch{return["[ownKeys threw]"]}};function h(p,y=0){if(Array.isArray(p)){if(o.has(p))return SS;if(o.add(p),!i||p.length<=1)return`[${p.map(v=>h(v,y)).join(",")}]`;const g=p.map(v=>h(v,y+1)).join(`,
|
|
59
59
|
`+c(y+1));return`[
|
|
60
60
|
${c(y+1)}${g}
|
|
61
|
-
${c(y)}]`}if(p instanceof Date)return _I(p);if(!(t!=null&&t.ignoreToString)&&Ue(p,"toString")&&typeof p.toString=="function"&&p.toString!==Object.prototype.toString&&p.toString!==Array.prototype.toString){const g=CI(p);return p instanceof Error&&p.cause?`${g} (cause: ${h(p.cause,y)})`:g}if(typeof p=="string")return JSON.stringify(p);if(typeof p=="number"||p==null||typeof p=="boolean"||typeof p=="symbol")return String(p);if(typeof p=="bigint")return String(p)+"n";if(typeof p=="object"||typeof p=="function"){if(o.has(p))return SS;if(o.add(p),$l in p)return
|
|
61
|
+
${c(y)}]`}if(p instanceof Date)return _I(p);if(!(t!=null&&t.ignoreToString)&&Ue(p,"toString")&&typeof p.toString=="function"&&p.toString!==Object.prototype.toString&&p.toString!==Array.prototype.toString){const g=CI(p);return p instanceof Error&&p.cause?`${g} (cause: ${h(p.cause,y)})`:g}if(typeof p=="string")return JSON.stringify(p);if(typeof p=="number"||p==null||typeof p=="boolean"||typeof p=="symbol")return String(p);if(typeof p=="bigint")return String(p)+"n";if(typeof p=="object"||typeof p=="function"){if(o.has(p))return SS;if(o.add(p),$l in p)return yt(y1(p));if(Symbol.iterator in p)return`${p.constructor.name}(${h(Array.from(p),y)})`;const g=d(p);if(!i||g.length<=1){const w=`{${g.map(S=>`${sl(S)}:${h(p[S],y)}`).join(",")}}`;return l(p,w)}const v=`{
|
|
62
62
|
${g.map(w=>`${c(y+1)}${sl(w)}: ${h(p[w],y+1)}`).join(`,
|
|
63
63
|
`)}
|
|
64
|
-
${c(y)}}`;return l(p,v)}return String(p)}return h(e,0)}const SS="[Circular]";function sl(e){return typeof e=="string"?JSON.stringify(e):String(e)}function EI(e){return e.map(t=>`[${sl(t)}]`).join("")}function _I(e){try{return e.toISOString()}catch{return"Invalid Date"}}function CI(e){try{const t=e.toString();return typeof t=="string"?t:String(t)}catch{return"[toString threw]"}}function v1(e,t){let n=[];const o=JSON.stringify(e,(i,c)=>typeof c=="object"&&c!==null?n.includes(c)?void 0:n.push(c)&&Ul(c):c,t==null?void 0:t.space);return n=void 0,o}const uo=Symbol.for("nodejs.util.inspect.custom"),Ya=e=>{try{if(Ue(e,"toJSON")&&Dl(e.toJSON)&&e.toJSON.length===0)return e.toJSON();if(Array.isArray(e))return e.map(Ya)}catch{return"[toJSON threw]"}return Ul(e)},bI=(e,t=2)=>{if(typeof e=="string")return e;try{return typeof e=="object"?PI(e,t):String(e)}catch{return String(e)}},PI=(e,t)=>{let n=[];const o=JSON.stringify(e,(i,c)=>typeof c=="object"&&c!==null?n.includes(c)?void 0:n.push(c)&&Ul(c):c,t);return n=void 0,o},xS={toJSON(){return Ya(this)},[uo](){return this.toJSON()},toString(){return gt(this.toJSON())}};class Bl{constructor(t){M(this,"called",!1);M(this,"self");this.self=t}next(t){return this.called?{value:t,done:!0}:(this.called=!0,{value:this.self,done:!1})}[Symbol.iterator](){return new Bl(this.self)}}const ui="~effect/Utils/internal",S1={[ui]:e=>e()},FI={[ui]:e=>{try{return e()}finally{}}};var ew;const II=((ew=S1[ui](()=>new Error().stack))==null?void 0:ew.includes(ui))===!0,tn=II?S1[ui]:FI[ui],bs="~effect/Effect",Oa="~effect/Exit",RI={_A:Ie,_E:Ie,_R:Ie},x1=`${bs}/identifier`,Ae=`${bs}/args`,Tt=`${bs}/evaluate`,Fn=`${bs}/successCont`,vr=`${bs}/failureCont`,lo=`${bs}/ensureCont`,Qs=Symbol.for("effect/Effect/Yield"),Ps={pipe(){return jt(this,arguments)},toJSON(){return{...this}},toString(){return gt(this.toJSON(),{ignoreToString:!0,space:2})},[uo](){return this.toJSON()}},zl={[Symbol.iterator](){return new Bl(this)}},TI={...zl,pipe(){return jt(this,arguments)}},AI={[bs]:RI,...Ps,[Symbol.iterator](){return new Bl(this)},asEffect(){return this},toJSON(){return{_id:"Effect",op:this[x1],...Ae in this?{args:this[Ae]}:void 0}}},Qt=e=>Ue(e,bs),w1=e=>Ue(e,Oa),Bu="~effect/Cause",zu="~effect/Cause/Reason",Vl=e=>Ue(e,Bu),MI=e=>Ue(e,zu);var tw;class po{constructor(t){M(this,tw);M(this,"reasons");this[Bu]=Bu,this.reasons=t}pipe(){return jt(this,arguments)}toJSON(){return{_id:"Cause",failures:this.reasons.map(t=>t.toJSON())}}toString(){return`Cause(${gt(this.reasons)})`}[(tw=Bu,uo)](){return this.toJSON()}[sn](t){return Vl(t)&&this.reasons.length===t.reasons.length&&this.reasons.every((n,o)=>Pn(n,t.reasons[o]))}[rn](){return p1(this.reasons)}}const wS=new WeakMap;var nw;class Pp{constructor(t,n,o){M(this,nw);M(this,"annotations");M(this,"_tag");if(this[zu]=zu,this._tag=t,n!==ql&&typeof o=="object"&&o!==null&&n.size>0){const i=wS.get(o);i&&(n=new Map([...i,...n])),wS.set(o,n)}this.annotations=n}annotate(t,n){if(t.mapUnsafe.size===0)return this;const o=new Map(this.annotations);t.mapUnsafe.forEach((c,l)=>{(n==null?void 0:n.overwrite)!==!0&&o.has(l)||o.set(l,c)});const i=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return i.annotations=o,i}pipe(){return jt(this,arguments)}toString(){return gt(this)}[(nw=zu,uo)](){return this.toString()}}const ql=new Map;class k1 extends Pp{constructor(n,o=ql){super("Fail",o,n);M(this,"error");this.error=n}toString(){return`Fail(${gt(this.error)})`}toJSON(){return{_tag:"Fail",error:this.error}}[sn](n){return Fp(n)&&Pn(this.error,n.error)&&Pn(this.annotations,n.annotations)}[rn](){return nr(Ft(this._tag))(nr(pt(this.error))(pt(this.annotations)))}}const Na=e=>new po(e),LI=new po([]),E1=e=>new po([new k1(e)]);class _1 extends Pp{constructor(n,o=ql){super("Die",o,n);M(this,"defect");this.defect=n}toString(){return`Die(${gt(this.defect)})`}toJSON(){return{_tag:"Die",defect:this.defect}}[sn](n){return NI(n)&&Pn(this.defect,n.defect)&&Pn(this.annotations,n.annotations)}[rn](){return nr(Ft(this._tag))(nr(pt(this.defect))(pt(this.annotations)))}}const OI=e=>new po([new _1(e)]),wm=re(e=>Vl(e[0]),(e,t,n)=>t.mapUnsafe.size===0?e:new po(e.reasons.map(o=>o.annotate(t,n)))),Fp=e=>e._tag==="Fail",NI=e=>e._tag==="Die",Ip=e=>e._tag==="Interrupt";function DI(e){return li("Effect.evaluate: Not implemented")}const Xa=e=>({...AI,[x1]:e.op,[Tt]:e[Tt]??DI,[Fn]:e[Fn],[vr]:e[vr],[lo]:e[lo]}),ir=e=>{const t=Xa(e);return function(){const n=Object.create(t);return n[Ae]=e.single===!1?arguments:arguments[0],n}},C1=e=>{const t={...Xa(e),[Oa]:Oa,_tag:e.op,get[e.prop](){return this[Ae]},toString(){return`${e.op}(${gt(this[Ae])})`},toJSON(){return{_id:"Exit",_tag:e.op,[e.prop]:this[Ae]}},[sn](n){return w1(n)&&n._tag===this._tag&&Pn(this[Ae],n[Ae])},[rn](){return nr(Ft(e.op),pt(this[Ae]))}};return function(n){const o=Object.create(t);return o[Ae]=n,o}},ut=C1({op:"Success",prop:"value",[Tt](e){const t=e.getCont(Fn);return t?t[Fn](this[Ae],e,this):e.yieldWith(this)}}),Wl={key:"effect/Cause/StackTrace"},jI={key:"effect/Cause/InterruptorStackTrace"},Bn=C1({op:"Failure",prop:"cause",[Tt](e){let t=this[Ae],n=!1;e.currentStackFrame&&(t=wm(t,{mapUnsafe:new Map([[Wl.key,e.currentStackFrame]])}),n=!0);let o=e.getCont(vr);for(;e.interruptible&&e._interruptedCause&&o;)o=e.getCont(vr);return o?o[vr](t,e,n?void 0:this):e.yieldWith(n?this:Bn(t))}}),Er=e=>Bn(E1(e)),li=e=>Bn(OI(e)),He=ir({op:"WithFiber",[Tt](e){return this[Ae](e)}}),$I=(function(){class e extends globalThis.Error{asEffect(){return Er(this)}}return Object.assign(e.prototype,TI),e})(),b1=(function(){const e=Symbol.for("effect/Data/Error/plainArgs");return class extends $I{constructor(n){super(n==null?void 0:n.message,n!=null&&n.cause?{cause:n.cause}:void 0),n&&(Object.assign(this,n),Object.defineProperty(this,e,{value:n,enumerable:!1}))}toJSON(){return{...this[e],...this}}}})(),Rp=e=>{class t extends b1{constructor(){super(...arguments);M(this,"_tag",e)}}return t.prototype.name=e,t},kS="~effect/Cause/NoSuchElementError";var rw,sw;class UI extends(sw=Rp("NoSuchElementError"),rw=kS,sw){constructor(n){super({message:n});M(this,rw,kS)}}const Da="~effect/Cause/Done",BI=e=>Ue(e,Da),P1={[Da]:Da,_tag:"Done",value:void 0},Tp=e=>e===void 0?P1:{[Da]:Da,_tag:"Done",value:e},zI=Er(P1),VI=e=>e===void 0?zI:Er(Tp(e)),F1="~effect/data/Option",I1={[F1]:{_A:e=>e},...Ps,...zl},R1=Object.assign(Object.create(I1),{_tag:"Some",_op:"Some",[sn](e){return T1(e)&&M1(e)&&Pn(this.value,e.value)},[rn](){return nr(pt(this._tag))(pt(this.value))},toString(){return`some(${gt(this.value)})`},toJSON(){return{_id:"Option",_tag:this._tag,value:Ya(this.value)}},asEffect(){return ut(this.value)}});Object.defineProperty(R1,"valueOrUndefined",{get(){return this.value}});const qI=pt("None"),WI=Object.assign(Object.create(I1),{_tag:"None",_op:"None",valueOrUndefined:void 0,[sn](e){return T1(e)&&A1(e)},[rn](){return qI},toString(){return"none()"},toJSON(){return{_id:"Option",_tag:this._tag}},asEffect(){return Er(new UI)}}),T1=e=>Ue(e,F1),A1=e=>e._tag==="None",M1=e=>e._tag==="Some",HI=Object.create(WI),KI=e=>{const t=Object.create(R1);return t.value=e,t},L1="~effect/data/Result",O1={[L1]:{_A:e=>e,_E:e=>e},...Ps,...zl},QI=Object.assign(Object.create(O1),{_tag:"Success",_op:"Success",[sn](e){return N1(e)&&j1(e)&&Pn(this.success,e.success)},[rn](){return nr(pt(this._tag))(pt(this.success))},toString(){return`success(${gt(this.success)})`},toJSON(){return{_id:"Result",_tag:this._tag,value:Ya(this.success)}},asEffect(){return ut(this.success)}}),JI=Object.assign(Object.create(O1),{_tag:"Failure",_op:"Failure",[sn](e){return N1(e)&&D1(e)&&Pn(this.failure,e.failure)},[rn](){return nr(pt(this._tag))(pt(this.failure))},toString(){return`failure(${gt(this.failure)})`},toJSON(){return{_id:"Result",_tag:this._tag,failure:Ya(this.failure)}},asEffect(){return Er(this.failure)}}),N1=e=>Ue(e,L1),D1=e=>e._tag==="Failure",j1=e=>e._tag==="Success",GI=e=>{const t=Object.create(JI);return t.failure=e,t},YI=e=>{const t=Object.create(QI);return t.success=e,t};function Ap(e){return(t,n)=>t===n?0:e(t,n)}const Mp=Ap((e,t)=>globalThis.Number.isNaN(e)&&globalThis.Number.isNaN(t)?0:globalThis.Number.isNaN(e)?-1:globalThis.Number.isNaN(t)?1:e<t?-1:1),XI=re(2,(e,t)=>Ap((n,o)=>e(t(n),t(o)))),ZI=e=>re(2,(t,n)=>e(t,n)===-1),$1=e=>re(2,(t,n)=>e(t,n)===1),eR=e=>re(2,(t,n)=>e(t,n)!==1),U1=e=>re(2,(t,n)=>e(t,n)!==-1),tR=e=>re(2,(t,n)=>t===n||e(t,n)<1?t:n),zn=()=>HI,Ne=KI,go=A1,ks=M1,nR=re(2,(e,t)=>go(e)?t():e.value),B1=nR(Nl),Lp=re(2,(e,t)=>go(e)?zn():Ne(t(e.value))),rR=re(2,(e,t)=>go(e)?zn():t(e.value)?Ne(e.value):zn()),qr=YI,rr=GI,At=D1,sR=j1,oR={[Symbol.iterator](){return iR}},iR={next(){return{done:!0,value:void 0}}},aR=()=>oR,cR=re(2,(e,t)=>Object.hasOwn(e,t)),uR=e=>Object.keys(e),lR=e=>re(2,(t,n)=>{for(const o of uR(t))if(!cR(n,o)||!e(t[o],n[o]))return!1;return!0}),fR=e=>{const t=lR(e);return(n,o)=>t(n,o)&&t(o,n)},ES=globalThis.Array,xr=e=>ES.isArray(e)?e:ES.from(e),z1=re(2,(e,t)=>[...e,t]),dR=re(2,(e,t)=>xr(e).concat(xr(t))),_S=g1,ol=g1;function hR(e,t){return e<0||e>=t.length}const mR=re(2,(e,t)=>{const n=Math.floor(t);if(hR(n,e))throw new Error(`Index out of bounds: ${n}`);return e[n]}),pR=mR(0),gR=e=>e.slice(1),yR=re(3,(e,t,n)=>{const o=xr(e),i=xr(t);return ol(o)?ol(i)?xR(n)(dR(o,i)):o:i}),vR=re(2,(e,t)=>yR(e,t,gI())),SR=()=>[],V1=re(2,(e,t)=>e.map(t)),xR=re(2,(e,t)=>{const n=xr(e);if(ol(n)){const o=[pR(n)],i=gR(n);for(const c of i)o.every(l=>!t(c,l))&&o.push(c);return o}return[]}),CS="~effect/Context/Service",qn=function(){var i;const e=Error.stackTraceLimit;Error.stackTraceLimit=2;const t=new Error;Error.stackTraceLimit=e;function n(){}const o=n;return Object.setPrototypeOf(o,wR),Object.defineProperty(o,"stack",{get(){return t.stack}}),arguments.length>0?(o.key=arguments[0],(i=arguments[1])!=null&&i.defaultValue&&(o[il]=il,o.defaultValue=arguments[1].defaultValue),o):function(c,l){return o.key=c,l!=null&&l.make&&(o.make=l.make),o}},wR={[CS]:CS,...Ps,...zl,toJSON(){return{_id:"Service",key:this.key,stack:this.stack}},asEffect(){return(this.asEffect=_s(He(t=>ut(ro(t.context,this)))))()},of(e){return e},context(e){return fi(this,e)},use(e){return He(t=>e(ro(t.context,this)))},useSync(e){return He(t=>ut(e(ro(t.context,this))))}},il="~effect/Context/Reference",q1="~effect/Context",Ss=e=>{const t=Object.create(kR);return t.mapUnsafe=e,t.mutable=!1,t},kR={...Ps,[q1]:{_Services:e=>e},toJSON(){return{_id:"Context",services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[sn](e){if(!W1(e)||this.mapUnsafe.size!==e.mapUnsafe.size)return!1;for(const t of this.mapUnsafe.keys())if(!e.mapUnsafe.has(t)||!Pn(this.mapUnsafe.get(t),e.mapUnsafe.get(t)))return!1;return!0},[rn](){return _p(this.mapUnsafe.size)}},W1=e=>Ue(e,q1),H1=e=>Ue(e,il),sr=()=>ER,ER=Ss(new Map),fi=(e,t)=>Ss(new Map([[e.key,t]])),Fs=re(3,(e,t,n)=>K1(e,o=>{o.set(t.key,n)})),_R=re(3,(e,t,n)=>e.mapUnsafe.has(t.key)?e.mapUnsafe.get(t.key):H1(t)?Kl(t):n()),Hl=re(2,(e,t)=>{if(!e.mapUnsafe.has(t.key)){if(il in t)return Kl(t);throw bR(t)}return e.mapUnsafe.get(t.key)}),ro=Hl,CR=(e,t)=>e.mapUnsafe.has(t.key)?e.mapUnsafe.get(t.key):Kl(t),Nh="~effect/Context/defaultValue",Kl=e=>Nh in e?e[Nh]:e[Nh]=e.defaultValue(),bR=e=>{const t=new Error(`Service not found${e.key?`: ${String(e.key)}`:""}`);if(e.stack){const n=e.stack.split(`
|
|
64
|
+
${c(y)}}`;return l(p,v)}return String(p)}return h(e,0)}const SS="[Circular]";function sl(e){return typeof e=="string"?JSON.stringify(e):String(e)}function EI(e){return e.map(t=>`[${sl(t)}]`).join("")}function _I(e){try{return e.toISOString()}catch{return"Invalid Date"}}function CI(e){try{const t=e.toString();return typeof t=="string"?t:String(t)}catch{return"[toString threw]"}}function v1(e,t){let n=[];const o=JSON.stringify(e,(i,c)=>typeof c=="object"&&c!==null?n.includes(c)?void 0:n.push(c)&&Ul(c):c,t==null?void 0:t.space);return n=void 0,o}const uo=Symbol.for("nodejs.util.inspect.custom"),Ya=e=>{try{if(Ue(e,"toJSON")&&Dl(e.toJSON)&&e.toJSON.length===0)return e.toJSON();if(Array.isArray(e))return e.map(Ya)}catch{return"[toJSON threw]"}return Ul(e)},bI=(e,t=2)=>{if(typeof e=="string")return e;try{return typeof e=="object"?PI(e,t):String(e)}catch{return String(e)}},PI=(e,t)=>{let n=[];const o=JSON.stringify(e,(i,c)=>typeof c=="object"&&c!==null?n.includes(c)?void 0:n.push(c)&&Ul(c):c,t);return n=void 0,o},xS={toJSON(){return Ya(this)},[uo](){return this.toJSON()},toString(){return yt(this.toJSON())}};class Bl{constructor(t){M(this,"called",!1);M(this,"self");this.self=t}next(t){return this.called?{value:t,done:!0}:(this.called=!0,{value:this.self,done:!1})}[Symbol.iterator](){return new Bl(this.self)}}const ui="~effect/Utils/internal",S1={[ui]:e=>e()},FI={[ui]:e=>{try{return e()}finally{}}};var ew;const II=((ew=S1[ui](()=>new Error().stack))==null?void 0:ew.includes(ui))===!0,tn=II?S1[ui]:FI[ui],bs="~effect/Effect",Oa="~effect/Exit",RI={_A:Ie,_E:Ie,_R:Ie},x1=`${bs}/identifier`,Ae=`${bs}/args`,Tt=`${bs}/evaluate`,Fn=`${bs}/successCont`,vr=`${bs}/failureCont`,lo=`${bs}/ensureCont`,Qs=Symbol.for("effect/Effect/Yield"),Ps={pipe(){return jt(this,arguments)},toJSON(){return{...this}},toString(){return yt(this.toJSON(),{ignoreToString:!0,space:2})},[uo](){return this.toJSON()}},zl={[Symbol.iterator](){return new Bl(this)}},TI={...zl,pipe(){return jt(this,arguments)}},AI={[bs]:RI,...Ps,[Symbol.iterator](){return new Bl(this)},asEffect(){return this},toJSON(){return{_id:"Effect",op:this[x1],...Ae in this?{args:this[Ae]}:void 0}}},Jt=e=>Ue(e,bs),w1=e=>Ue(e,Oa),Bu="~effect/Cause",zu="~effect/Cause/Reason",Vl=e=>Ue(e,Bu),MI=e=>Ue(e,zu);var tw;class po{constructor(t){M(this,tw);M(this,"reasons");this[Bu]=Bu,this.reasons=t}pipe(){return jt(this,arguments)}toJSON(){return{_id:"Cause",failures:this.reasons.map(t=>t.toJSON())}}toString(){return`Cause(${yt(this.reasons)})`}[(tw=Bu,uo)](){return this.toJSON()}[sn](t){return Vl(t)&&this.reasons.length===t.reasons.length&&this.reasons.every((n,o)=>Pn(n,t.reasons[o]))}[rn](){return p1(this.reasons)}}const wS=new WeakMap;var nw;class Pp{constructor(t,n,o){M(this,nw);M(this,"annotations");M(this,"_tag");if(this[zu]=zu,this._tag=t,n!==ql&&typeof o=="object"&&o!==null&&n.size>0){const i=wS.get(o);i&&(n=new Map([...i,...n])),wS.set(o,n)}this.annotations=n}annotate(t,n){if(t.mapUnsafe.size===0)return this;const o=new Map(this.annotations);t.mapUnsafe.forEach((c,l)=>{(n==null?void 0:n.overwrite)!==!0&&o.has(l)||o.set(l,c)});const i=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return i.annotations=o,i}pipe(){return jt(this,arguments)}toString(){return yt(this)}[(nw=zu,uo)](){return this.toString()}}const ql=new Map;class k1 extends Pp{constructor(n,o=ql){super("Fail",o,n);M(this,"error");this.error=n}toString(){return`Fail(${yt(this.error)})`}toJSON(){return{_tag:"Fail",error:this.error}}[sn](n){return Fp(n)&&Pn(this.error,n.error)&&Pn(this.annotations,n.annotations)}[rn](){return nr(Ft(this._tag))(nr(gt(this.error))(gt(this.annotations)))}}const Na=e=>new po(e),LI=new po([]),E1=e=>new po([new k1(e)]);class _1 extends Pp{constructor(n,o=ql){super("Die",o,n);M(this,"defect");this.defect=n}toString(){return`Die(${yt(this.defect)})`}toJSON(){return{_tag:"Die",defect:this.defect}}[sn](n){return NI(n)&&Pn(this.defect,n.defect)&&Pn(this.annotations,n.annotations)}[rn](){return nr(Ft(this._tag))(nr(gt(this.defect))(gt(this.annotations)))}}const OI=e=>new po([new _1(e)]),wm=re(e=>Vl(e[0]),(e,t,n)=>t.mapUnsafe.size===0?e:new po(e.reasons.map(o=>o.annotate(t,n)))),Fp=e=>e._tag==="Fail",NI=e=>e._tag==="Die",Ip=e=>e._tag==="Interrupt";function DI(e){return li("Effect.evaluate: Not implemented")}const Xa=e=>({...AI,[x1]:e.op,[Tt]:e[Tt]??DI,[Fn]:e[Fn],[vr]:e[vr],[lo]:e[lo]}),ir=e=>{const t=Xa(e);return function(){const n=Object.create(t);return n[Ae]=e.single===!1?arguments:arguments[0],n}},C1=e=>{const t={...Xa(e),[Oa]:Oa,_tag:e.op,get[e.prop](){return this[Ae]},toString(){return`${e.op}(${yt(this[Ae])})`},toJSON(){return{_id:"Exit",_tag:e.op,[e.prop]:this[Ae]}},[sn](n){return w1(n)&&n._tag===this._tag&&Pn(this[Ae],n[Ae])},[rn](){return nr(Ft(e.op),gt(this[Ae]))}};return function(n){const o=Object.create(t);return o[Ae]=n,o}},ut=C1({op:"Success",prop:"value",[Tt](e){const t=e.getCont(Fn);return t?t[Fn](this[Ae],e,this):e.yieldWith(this)}}),Wl={key:"effect/Cause/StackTrace"},jI={key:"effect/Cause/InterruptorStackTrace"},Bn=C1({op:"Failure",prop:"cause",[Tt](e){let t=this[Ae],n=!1;e.currentStackFrame&&(t=wm(t,{mapUnsafe:new Map([[Wl.key,e.currentStackFrame]])}),n=!0);let o=e.getCont(vr);for(;e.interruptible&&e._interruptedCause&&o;)o=e.getCont(vr);return o?o[vr](t,e,n?void 0:this):e.yieldWith(n?this:Bn(t))}}),Er=e=>Bn(E1(e)),li=e=>Bn(OI(e)),He=ir({op:"WithFiber",[Tt](e){return this[Ae](e)}}),$I=(function(){class e extends globalThis.Error{asEffect(){return Er(this)}}return Object.assign(e.prototype,TI),e})(),b1=(function(){const e=Symbol.for("effect/Data/Error/plainArgs");return class extends $I{constructor(n){super(n==null?void 0:n.message,n!=null&&n.cause?{cause:n.cause}:void 0),n&&(Object.assign(this,n),Object.defineProperty(this,e,{value:n,enumerable:!1}))}toJSON(){return{...this[e],...this}}}})(),Rp=e=>{class t extends b1{constructor(){super(...arguments);M(this,"_tag",e)}}return t.prototype.name=e,t},kS="~effect/Cause/NoSuchElementError";var rw,sw;class UI extends(sw=Rp("NoSuchElementError"),rw=kS,sw){constructor(n){super({message:n});M(this,rw,kS)}}const Da="~effect/Cause/Done",BI=e=>Ue(e,Da),P1={[Da]:Da,_tag:"Done",value:void 0},Tp=e=>e===void 0?P1:{[Da]:Da,_tag:"Done",value:e},zI=Er(P1),VI=e=>e===void 0?zI:Er(Tp(e)),F1="~effect/data/Option",I1={[F1]:{_A:e=>e},...Ps,...zl},R1=Object.assign(Object.create(I1),{_tag:"Some",_op:"Some",[sn](e){return T1(e)&&M1(e)&&Pn(this.value,e.value)},[rn](){return nr(gt(this._tag))(gt(this.value))},toString(){return`some(${yt(this.value)})`},toJSON(){return{_id:"Option",_tag:this._tag,value:Ya(this.value)}},asEffect(){return ut(this.value)}});Object.defineProperty(R1,"valueOrUndefined",{get(){return this.value}});const qI=gt("None"),WI=Object.assign(Object.create(I1),{_tag:"None",_op:"None",valueOrUndefined:void 0,[sn](e){return T1(e)&&A1(e)},[rn](){return qI},toString(){return"none()"},toJSON(){return{_id:"Option",_tag:this._tag}},asEffect(){return Er(new UI)}}),T1=e=>Ue(e,F1),A1=e=>e._tag==="None",M1=e=>e._tag==="Some",HI=Object.create(WI),KI=e=>{const t=Object.create(R1);return t.value=e,t},L1="~effect/data/Result",O1={[L1]:{_A:e=>e,_E:e=>e},...Ps,...zl},QI=Object.assign(Object.create(O1),{_tag:"Success",_op:"Success",[sn](e){return N1(e)&&j1(e)&&Pn(this.success,e.success)},[rn](){return nr(gt(this._tag))(gt(this.success))},toString(){return`success(${yt(this.success)})`},toJSON(){return{_id:"Result",_tag:this._tag,value:Ya(this.success)}},asEffect(){return ut(this.success)}}),JI=Object.assign(Object.create(O1),{_tag:"Failure",_op:"Failure",[sn](e){return N1(e)&&D1(e)&&Pn(this.failure,e.failure)},[rn](){return nr(gt(this._tag))(gt(this.failure))},toString(){return`failure(${yt(this.failure)})`},toJSON(){return{_id:"Result",_tag:this._tag,failure:Ya(this.failure)}},asEffect(){return Er(this.failure)}}),N1=e=>Ue(e,L1),D1=e=>e._tag==="Failure",j1=e=>e._tag==="Success",GI=e=>{const t=Object.create(JI);return t.failure=e,t},YI=e=>{const t=Object.create(QI);return t.success=e,t};function Ap(e){return(t,n)=>t===n?0:e(t,n)}const Mp=Ap((e,t)=>globalThis.Number.isNaN(e)&&globalThis.Number.isNaN(t)?0:globalThis.Number.isNaN(e)?-1:globalThis.Number.isNaN(t)?1:e<t?-1:1),XI=re(2,(e,t)=>Ap((n,o)=>e(t(n),t(o)))),ZI=e=>re(2,(t,n)=>e(t,n)===-1),$1=e=>re(2,(t,n)=>e(t,n)===1),eR=e=>re(2,(t,n)=>e(t,n)!==1),U1=e=>re(2,(t,n)=>e(t,n)!==-1),tR=e=>re(2,(t,n)=>t===n||e(t,n)<1?t:n),zn=()=>HI,Ne=KI,go=A1,ks=M1,nR=re(2,(e,t)=>go(e)?t():e.value),B1=nR(Nl),Lp=re(2,(e,t)=>go(e)?zn():Ne(t(e.value))),rR=re(2,(e,t)=>go(e)?zn():t(e.value)?Ne(e.value):zn()),qr=YI,rr=GI,At=D1,sR=j1,oR={[Symbol.iterator](){return iR}},iR={next(){return{done:!0,value:void 0}}},aR=()=>oR,cR=re(2,(e,t)=>Object.hasOwn(e,t)),uR=e=>Object.keys(e),lR=e=>re(2,(t,n)=>{for(const o of uR(t))if(!cR(n,o)||!e(t[o],n[o]))return!1;return!0}),fR=e=>{const t=lR(e);return(n,o)=>t(n,o)&&t(o,n)},ES=globalThis.Array,xr=e=>ES.isArray(e)?e:ES.from(e),z1=re(2,(e,t)=>[...e,t]),dR=re(2,(e,t)=>xr(e).concat(xr(t))),_S=g1,ol=g1;function hR(e,t){return e<0||e>=t.length}const mR=re(2,(e,t)=>{const n=Math.floor(t);if(hR(n,e))throw new Error(`Index out of bounds: ${n}`);return e[n]}),pR=mR(0),gR=e=>e.slice(1),yR=re(3,(e,t,n)=>{const o=xr(e),i=xr(t);return ol(o)?ol(i)?xR(n)(dR(o,i)):o:i}),vR=re(2,(e,t)=>yR(e,t,gI())),SR=()=>[],V1=re(2,(e,t)=>e.map(t)),xR=re(2,(e,t)=>{const n=xr(e);if(ol(n)){const o=[pR(n)],i=gR(n);for(const c of i)o.every(l=>!t(c,l))&&o.push(c);return o}return[]}),CS="~effect/Context/Service",qn=function(){var i;const e=Error.stackTraceLimit;Error.stackTraceLimit=2;const t=new Error;Error.stackTraceLimit=e;function n(){}const o=n;return Object.setPrototypeOf(o,wR),Object.defineProperty(o,"stack",{get(){return t.stack}}),arguments.length>0?(o.key=arguments[0],(i=arguments[1])!=null&&i.defaultValue&&(o[il]=il,o.defaultValue=arguments[1].defaultValue),o):function(c,l){return o.key=c,l!=null&&l.make&&(o.make=l.make),o}},wR={[CS]:CS,...Ps,...zl,toJSON(){return{_id:"Service",key:this.key,stack:this.stack}},asEffect(){return(this.asEffect=_s(He(t=>ut(ro(t.context,this)))))()},of(e){return e},context(e){return fi(this,e)},use(e){return He(t=>e(ro(t.context,this)))},useSync(e){return He(t=>ut(e(ro(t.context,this))))}},il="~effect/Context/Reference",q1="~effect/Context",Ss=e=>{const t=Object.create(kR);return t.mapUnsafe=e,t.mutable=!1,t},kR={...Ps,[q1]:{_Services:e=>e},toJSON(){return{_id:"Context",services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[sn](e){if(!W1(e)||this.mapUnsafe.size!==e.mapUnsafe.size)return!1;for(const t of this.mapUnsafe.keys())if(!e.mapUnsafe.has(t)||!Pn(this.mapUnsafe.get(t),e.mapUnsafe.get(t)))return!1;return!0},[rn](){return _p(this.mapUnsafe.size)}},W1=e=>Ue(e,q1),H1=e=>Ue(e,il),sr=()=>ER,ER=Ss(new Map),fi=(e,t)=>Ss(new Map([[e.key,t]])),Fs=re(3,(e,t,n)=>K1(e,o=>{o.set(t.key,n)})),_R=re(3,(e,t,n)=>e.mapUnsafe.has(t.key)?e.mapUnsafe.get(t.key):H1(t)?Kl(t):n()),Hl=re(2,(e,t)=>{if(!e.mapUnsafe.has(t.key)){if(il in t)return Kl(t);throw bR(t)}return e.mapUnsafe.get(t.key)}),ro=Hl,CR=(e,t)=>e.mapUnsafe.has(t.key)?e.mapUnsafe.get(t.key):Kl(t),Nh="~effect/Context/defaultValue",Kl=e=>Nh in e?e[Nh]:e[Nh]=e.defaultValue(),bR=e=>{const t=new Error(`Service not found${e.key?`: ${String(e.key)}`:""}`);if(e.stack){const n=e.stack.split(`
|
|
65
65
|
`);if(n.length>2){const o=n[2].match(/at (.*)/);o&&(t.message=t.message+` (defined at ${o[1]})`)}}if(t.stack){const n=t.stack.split(`
|
|
66
66
|
`);n.splice(1,3),t.stack=n.join(`
|
|
67
67
|
`)}return t},PR=re(2,(e,t)=>e.mapUnsafe.has(t.key)?Ne(e.mapUnsafe.get(t.key)):H1(t)?Ne(Kl(t)):zn()),di=re(2,(e,t)=>e.mapUnsafe.size===0?t:t.mapUnsafe.size===0?e:K1(e,n=>{t.mapUnsafe.forEach((o,i)=>n.set(i,o))})),FR=(...e)=>{const t=new Map;for(let n=0;n<e.length;n++)e[n].mapUnsafe.forEach((o,i)=>{t.set(i,o)});return Ss(t)},K1=(e,t)=>{if(e.mutable)return t(e.mapUnsafe),e;const n=new Map(e.mapUnsafe);return t(n),Ss(n)},rt=qn,al="~effect/time/Duration",IR=BigInt(0),Q1=BigInt(1e3),RR=BigInt(1e6),TR=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,Op=e=>{switch(typeof e){case"number":return ja(e);case"bigint":return FS(e);case"string":{const t=TR.exec(e);if(!t)break;const[n,o,i]=t,c=Number(o);switch(i){case"nano":case"nanos":return FS(BigInt(o));case"micro":case"micros":return jR(BigInt(o));case"milli":case"millis":return ja(c);case"second":case"seconds":return $R(c);case"minute":case"minutes":return UR(c);case"hour":case"hours":return BR(c);case"day":case"days":return zR(c);case"week":case"weeks":return VR(c)}break}case"object":{if(e===null)break;if(al in e)return e;if(Array.isArray(e))return e.length!==2||!e.every(h1)?bS(e):Number.isNaN(e[0])||Number.isNaN(e[1])?Np:e[0]===-1/0||e[1]===-1/0?DR:e[0]===1/0||e[1]===1/0?NR:pn(BigInt(Math.round(e[0]*1e9))+BigInt(Math.round(e[1])));const t=e;let n=0;if(t.weeks&&(n+=t.weeks*6048e5),t.days&&(n+=t.days*864e5),t.hours&&(n+=t.hours*36e5),t.minutes&&(n+=t.minutes*6e4),t.seconds&&(n+=t.seconds*1e3),t.milliseconds&&(n+=t.milliseconds),!t.microseconds&&!t.nanoseconds)return pn(n);let o=BigInt(n)*RR;return t.microseconds&&(o+=BigInt(t.microseconds)*Q1),t.nanoseconds&&(o+=BigInt(t.nanoseconds)),pn(o)}}return bS(e)},bS=e=>{throw new Error(`Invalid Input: ${e}`)},PS={_tag:"Millis",millis:0},AR={_tag:"Infinity"},MR={_tag:"NegativeInfinity"},LR={[al]:al,[rn](){return Cp(this.value)},[sn](e){return OR(e)&&QR(this,e)},toString(){switch(this.value._tag){case"Infinity":return"Infinity";case"NegativeInfinity":return"-Infinity";case"Nanos":return`${this.value.nanos} nanos`;case"Millis":return`${this.value.millis} millis`}},toJSON(){switch(this.value._tag){case"Millis":return{_id:"Duration",_tag:"Millis",millis:this.value.millis};case"Nanos":return{_id:"Duration",_tag:"Nanos",nanos:String(this.value.nanos)};case"Infinity":return{_id:"Duration",_tag:"Infinity"};case"NegativeInfinity":return{_id:"Duration",_tag:"NegativeInfinity"}}},[uo](){return this.toJSON()},pipe(){return jt(this,arguments)}},pn=e=>{const t=Object.create(LR);return typeof e=="number"?isNaN(e)||e===0||Object.is(e,-0)?t.value=PS:Number.isFinite(e)?Number.isInteger(e)?t.value={_tag:"Millis",millis:e}:t.value={_tag:"Nanos",nanos:BigInt(Math.round(e*1e6))}:t.value=e>0?AR:MR:e===IR?t.value=PS:t.value={_tag:"Nanos",nanos:e},t},OR=e=>Ue(e,al),Np=pn(0),NR=pn(1/0),DR=pn(-1/0),FS=e=>pn(e),jR=e=>pn(e*Q1),ja=e=>pn(e),$R=e=>pn(e*1e3),UR=e=>pn(e*6e4),BR=e=>pn(e*36e5),zR=e=>pn(e*864e5),VR=e=>pn(e*6048e5),J1=e=>qR(e,{onMillis:Ie,onNanos:t=>Number(t)/1e6,onInfinity:()=>1/0,onNegativeInfinity:()=>-1/0}),IS=e=>{switch(e.value._tag){case"Infinity":case"NegativeInfinity":throw new Error("Cannot convert infinite duration to nanos");case"Nanos":return e.value.nanos;case"Millis":return BigInt(Math.round(e.value.millis*1e6))}},qR=re(2,(e,t)=>{switch(e.value._tag){case"Millis":return t.onMillis(e.value.millis);case"Nanos":return t.onNanos(e.value.nanos);case"Infinity":return t.onInfinity();case"NegativeInfinity":return(t.onNegativeInfinity??t.onInfinity)()}}),G1=re(3,(e,t,n)=>e.value._tag==="Infinity"||e.value._tag==="NegativeInfinity"||t.value._tag==="Infinity"||t.value._tag==="NegativeInfinity"?n.onInfinity(e,t):e.value._tag==="Millis"?t.value._tag==="Millis"?n.onMillis(e.value.millis,t.value.millis):n.onNanos(IS(e),t.value.nanos):n.onNanos(e.value.nanos,IS(t))),WR=Ap((e,t)=>G1(e,t,{onMillis:(n,o)=>n<o?-1:n>o?1:0,onNanos:(n,o)=>n<o?-1:n>o?1:0,onInfinity:(n,o)=>n.value._tag===o.value._tag?0:n.value._tag==="Infinity"?1:n.value._tag==="NegativeInfinity"||o.value._tag==="Infinity"?-1:1})),HR=(e,t)=>G1(e,t,{onMillis:(n,o)=>n===o,onNanos:(n,o)=>n===o,onInfinity:(n,o)=>n.value._tag===o.value._tag}),KR=tR(WR),QR=re(2,(e,t)=>HR(e,t)),JR=e=>t=>!At(e(t)),GR=e=>t=>t.has(e)?qr(t):rr(t),YR=re(2,(e,t)=>n=>{const o=e(n);return At(o)?o:t(o.success)}),Y1=re(2,(e,t)=>n=>{const o=e(n);if(At(o))return rr(n);const i=t(o.success);return At(i)?rr(n):i}),X1=rt("effect/Scheduler",{defaultValue:()=>new ek}),Z1="setImmediate"in globalThis?e=>{const t=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(t)}:e=>{const t=setTimeout(e,0);return()=>clearTimeout(t)};class XR{constructor(){M(this,"buckets",[])}scheduleTask(t,n){const o=this.buckets,i=o.length;let c,l=0;for(;l<i&&!(o[l][0]>n);l++)c=o[l];c&&c[0]===n?c[1].push(t):l===i?o.push([n,[t]]):o.splice(l,0,[n,[t]])}drain(){const t=this.buckets;return this.buckets=[],t}}class ek{constructor(t="async",n=Z1){M(this,"executionMode");M(this,"setImmediate");this.executionMode=t,this.setImmediate=n}shouldYield(t){return t.currentOpCount>=t.maxOpsBeforeYield}makeDispatcher(){return new ZR(this.setImmediate)}}class ZR{constructor(t=Z1){M(this,"tasks",new XR);M(this,"running");M(this,"setImmediate");M(this,"afterScheduled",()=>{this.running=void 0,this.runTasks()});this.setImmediate=t}scheduleTask(t,n){this.tasks.scheduleTask(t,n),this.running===void 0&&(this.running=this.setImmediate(this.afterScheduled))}runTasks(){const t=this.tasks.drain();for(let n=0;n<t.length;n++){const o=t[n][1];for(let i=0;i<o.length;i++)o[i]()}}flush(){for(;this.tasks.buckets.length>0;)this.running!==void 0&&(this.running(),this.running=void 0),this.runTasks()}}const eT=rt("effect/Scheduler/MaxOpsBeforeYield",{defaultValue:()=>2048}),tT=rt("effect/Scheduler/PreventSchedulerYield",{defaultValue:()=>!1}),tk="effect/Tracer/ParentSpan";class nT extends qn()(tk){}const rT=e=>e,km=rt("effect/Tracer/DisablePropagation",{defaultValue:f1}),sT=rt("effect/Tracer/CurrentTraceLevel",{defaultValue:()=>"Info"}),oT=rt("effect/Tracer/MinimumTraceLevel",{defaultValue:()=>"All"}),nk="effect/Tracer",iT=rt(nk,{defaultValue:()=>rT({span:e=>new aT(e)})});class aT{constructor(t){M(this,"_tag","Span");M(this,"spanId");M(this,"traceId","native");M(this,"sampled");M(this,"name");M(this,"parent");M(this,"annotations");M(this,"links");M(this,"startTime");M(this,"kind");M(this,"status");M(this,"attributes");M(this,"events",[]);var n;this.name=t.name,this.parent=t.parent,this.annotations=t.annotations,this.links=t.links,this.startTime=t.startTime,this.kind=t.kind,this.sampled=t.sampled,this.status={_tag:"Started",startTime:t.startTime},this.attributes=new Map,this.traceId=((n=B1(t.parent))==null?void 0:n.traceId)??RS(32),this.spanId=RS(16)}end(t,n){this.status={_tag:"Ended",endTime:t,exit:n,startTime:this.status.startTime}}attribute(t,n){this.attributes.set(t,n)}event(t,n,o){this.events.push([t,n,o??{}])}addLinks(t){this.links.push(...t)}}const RS=(function(){const e="abcdef0123456789",t=e.length;return function(n){let o="";for(let i=0;i<n;i++)o+=e.charAt(Math.floor(Math.random()*t));return o}})(),cT="effect/observability/Metric/FiberRuntimeMetricsKey",uT=rt("effect/References/CurrentConcurrency",{defaultValue:()=>"unbounded"}),rk=rt("effect/References/CurrentStackFrame",{defaultValue:Nl}),lT=rt("effect/References/TracerEnabled",{defaultValue:kp}),sk=rt("effect/References/TracerTimingEnabled",{defaultValue:kp}),fT=rt("effect/References/TracerSpanAnnotations",{defaultValue:()=>({})}),dT=rt("effect/References/TracerSpanLinks",{defaultValue:()=>[]}),Dp=rt("effect/References/CurrentLogAnnotations",{defaultValue:()=>({})}),hT=rt("effect/References/CurrentLogLevel",{defaultValue:()=>"Info"}),mT=rt("effect/References/MinimumLogLevel",{defaultValue:()=>"Info"}),pT=rt("effect/References/CurrentLogSpans",{defaultValue:()=>[]}),gT=e=>{if((e==null?void 0:e.captureStackTrace)===!1)return e;if((e==null?void 0:e.captureStackTrace)!==void 0&&typeof e.captureStackTrace!="boolean")return e;const t=Error.stackTraceLimit;Error.stackTraceLimit=3;const n=new Error;return Error.stackTraceLimit=t,{...e,captureStackTrace:vT(()=>n.stack)}},yT=e=>t=>{let n;return()=>{if(n!==void 0)return n;const o=t();if(!o)return;const i=o.split(`
|
|
@@ -78,6 +78,6 @@ ${uk(t.cause," ")}
|
|
|
78
78
|
`);let o=`${t}[cause]: ${n[0]}`;for(let i=1,c=n.length;i<c;i++)o+=`
|
|
79
79
|
${t}${n[i]}`;return e.cause&&(o+=` {
|
|
80
80
|
${uk(e.cause,`${t} `)}
|
|
81
|
-
${t}}`),o},_m=`~effect/Fiber/${ST}`,MT={_A:Ie,_E:Ie},LT={id:0},Bp=()=>globalThis[_a];var ow;ow=_m;class lk{constructor(t,n=!0){M(this,ow);M(this,"id");M(this,"interruptible");M(this,"currentOpCount");M(this,"currentLoopCount");M(this,"_stack");M(this,"_observers");M(this,"_exit");M(this,"_currentExit");M(this,"_children");M(this,"_interruptedCause");M(this,"_yielded");M(this,"context");M(this,"currentScheduler");M(this,"currentTracerContext");M(this,"currentSpan");M(this,"currentLogLevel");M(this,"minimumLogLevel");M(this,"currentStackFrame");M(this,"runtimeMetrics");M(this,"maxOpsBeforeYield");M(this,"currentPreventYield");M(this,"_dispatcher");this[_m]=MT,this.setContext(t),this.id=++LT.id,this.currentOpCount=0,this.currentLoopCount=0,this.interruptible=n,this._stack=[],this._observers=[],this._exit=void 0,this._children=void 0,this._interruptedCause=void 0,this._yielded=void 0}get currentDispatcher(){return this._dispatcher??(this._dispatcher=this.currentScheduler.makeDispatcher())}getRef(t){return CR(this.context,t)}addObserver(t){return this._exit?(t(this._exit),Ga):(this._observers.push(t),()=>{const n=this._observers.indexOf(t);n>=0&&this._observers.splice(n,1)})}interruptUnsafe(t,n){if(this._exit)return;let o=jp(t);this.currentStackFrame&&(o=wm(o,fi(Wl,this.currentStackFrame))),n&&(o=wm(o,n)),this._interruptedCause=this._interruptedCause?bT(this._interruptedCause,o):o,this.interruptible&&this.evaluate(Jt(this._interruptedCause))}pollUnsafe(){return this._exit}evaluate(t){var o,i;if((o=this.runtimeMetrics)==null||o.recordFiberStart(this.context),this._exit)return;if(this._yielded!==void 0){const c=this._yielded;this._yielded=void 0,c()}const n=this.runLoop(t);if(n!==Qs){this._exit=n,(i=this.runtimeMetrics)==null||i.recordFiberEnd(this.context,this._exit);for(let c=0;c<this._observers.length;c++)this._observers[c](n);this._observers.length=0}}runLoop(t){const n=globalThis[_a];globalThis[_a]=this;let o=!1,i=t;this.currentOpCount=0;const c=++this.currentLoopCount;try{for(;;){if(this.currentOpCount++,!o&&!this.currentPreventYield&&this.currentScheduler.shouldYield(this)){o=!0;const l=i;i=$e(Vp,()=>l)}if(i=this.currentTracerContext?this.currentTracerContext(i,this):i[Tt](this),c!==this.currentLoopCount)return Qs;if(i===Qs){const l=this._yielded;return Oa in l?(this._yielded=void 0,l):Qs}}}catch(l){return Ue(i,Tt)?this.runLoop(li(l)):li(`Fiber.runLoop: Not a valid effect: ${String(i)}`)}finally{globalThis[_a]=n}}getCont(t){for(;;){const n=this._stack.pop();if(!n)return;const o=n[lo]&&n[lo](this);if(o)return o[t]=o,o;if(n[t])return n}}yieldWith(t){return this._yielded=t,Qs}children(){return this._children??(this._children=new Set)}pipe(){return jt(this,arguments)}setContext(t){this.context=t;const n=this.getRef(X1);n!==this.currentScheduler&&(this.currentScheduler=n,this._dispatcher=void 0),this.currentSpan=t.mapUnsafe.get(tk),this.currentLogLevel=this.getRef(hT),this.minimumLogLevel=this.getRef(mT),this.currentStackFrame=t.mapUnsafe.get(rk.key),this.maxOpsBeforeYield=this.getRef(eT),this.currentPreventYield=this.getRef(tT),this.runtimeMetrics=t.mapUnsafe.get(cT);const o=t.mapUnsafe.get(nk);this.currentTracerContext=o?o.context:void 0}get currentSpanLocal(){var t;return((t=this.currentSpan)==null?void 0:t._tag)==="Span"?this.currentSpan:void 0}}const Ql=e=>{if(!e.currentStackFrame)return;const t=new Map;return t.set(Wl.key,e.currentStackFrame),Ss(t)},fk=e=>{const t=e;return t._exit?Re(t._exit):ar(n=>t._exit?n(Re(t._exit)):kt(e.addObserver(o=>n(Re(o)))))},dk=e=>ar(t=>{const n=e[Symbol.iterator](),o=[];let i;function c(){let l=n.next();for(;!l.done;){if(l.value._exit){o.push(l.value._exit),l=n.next();continue}i=l.value.addObserver(d=>{o.push(d),c()});return}t(Re(o))}return c(),kt(()=>i==null?void 0:i())}),zp=e=>He(t=>OT(e,t.id)),OT=re(e=>Ue(e[0],_m),(e,t,n)=>He(o=>{let i=Ql(o);return i=i&&n?di(i,n):i??n,e.interruptUnsafe(t,i),vk(fk(e))})),cl=e=>He(t=>{const n=Ql(t);for(const o of e)o.interruptUnsafe(t.id,n);return vk(dk(e))}),Re=ut,Jt=Bn,Jl=Er,kt=ir({op:"Sync",[Tt](e){const t=this[Ae](),n=e.getCont(Fn);return n?n[Fn](t,e):e.yieldWith(ut(t))}}),Et=ir({op:"Suspend",[Tt](e){return this[Ae]()}}),NT=ir({op:"Yield",[Tt](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{t||e.evaluate(Vn)},this[Ae]??0),e.yieldWith(()=>{t=!0})}}),Vp=NT(0),DT=e=>Re(Ne(e)),jT=Re(zn()),Gl=e=>li(e),hk=e=>Et(()=>Jl(tn(e))),ct=Re(void 0),$T=e=>mk(function(t,n){tn(()=>e(n)).then(o=>t(Re(o)),o=>t(Gl(o)))},e.length!==0),UT=e=>He(t=>e(t.id)),mk=ir({op:"Async",single:!1,[Tt](e){const t=tn(()=>this[Ae][0].bind(e.currentScheduler));let n=!1,o=!1;const i=this[Ae][1]?new AbortController:void 0,c=t(l=>{n||(n=!0,o?e.evaluate(l):o=l)},i==null?void 0:i.signal);return o!==!1?o:(o=!0,e._yielded=()=>{n=!0},i===void 0&&c===void 0||e._stack.push(BT(()=>(n=!0,i==null||i.abort(),c??Vn))),Qs)}}),BT=ir({op:"AsyncFinalizer",[lo](e){e.interruptible&&(e.interruptible=!1,e._stack.push(nf))},[vr](e,t){return kT(e)?$e(this[Ae](),()=>Jt(e)):Jt(e)}}),ar=e=>mk(e,e.length>=2),zT=ar(Ga),VT=(...e)=>Et(()=>$a(e.length===1?e[0]():e[1].call(e[0].self))),pk=(e,...t)=>{const n=t.length===0?function(){return Et(()=>$a(e.apply(this,arguments)))}:function(){let o=Et(()=>$a(e.apply(this,arguments)));for(let i=0;i<t.length;i++)o=t[i](o,...arguments);return o};return gk(e.length,n)},gk=(e,t)=>Object.defineProperty(t,"length",{value:e,configurable:!0}),qT=(e,...t)=>gk(e.length,t.length===0?function(){return TS(()=>e.apply(this,arguments))}:function(){let n=TS(()=>e.apply(this,arguments));for(const o of t)n=o(n);return n}),TS=e=>{try{const t=e();let n;for(;;){const o=t.next(n);if(o.done)return Re(o.value);const c=o.value.asEffect(),l=c;if(l&&l._tag==="Success"){n=l.value;continue}else{if(l&&l._tag==="Failure")return c;{let d=!0;return Et(()=>d?(d=!1,$e(c,h=>$a(t,h))):Et(()=>$a(e())))}}}}catch(t){return Gl(t)}},$a=ir({op:"Iterator",single:!1,[Fn](e,t){const n=this[Ae][0];for(;;){const o=n.next(e);if(o.done)return Re(o.value);const i=o.value.asEffect();if(In(i)){if(i._tag==="Failure")return i}else return t._stack.push(this),i;e=i.value}},[Tt](e){return this[Fn](this[Ae][1],e)}}),Si=re(2,(e,t)=>{const n=Re(t);return $e(e,o=>n)}),Za=re(2,(e,t)=>$e(e,n=>Qt(t)?t:tn(()=>t(n)))),yk=re(2,(e,t)=>$e(e,n=>Si(Qt(t)?t:tn(()=>t(n)),n))),vk=e=>$e(e,t=>Vn),WT=(e,t)=>He(n=>ar(o=>{let i=!1;const c=new Set,l=h=>{i=!0,o(c.size===0?h:$e(Ik(cl(c)),()=>h))};let d=0;for(const h of e){if(i)break;const p=d++,y=sf(n,h,!0,!0,!1);c.add(y),y.addObserver(g=>{c.delete(y);const v=!i;l(g),v&&(t!=null&&t.onWinner)&&t.onWinner({fiber:y,index:p,parentFiber:n})})}return cl(c)})),Sk=re(e=>Qt(e[1]),(e,t,n)=>WT([e,t],n)),$e=re(2,(e,t)=>{const n=Object.create(HT);return n[Ae]=e,n[Fn]=t.length!==1?o=>t(o):t,n}),HT=Xa({op:"OnSuccess",[Tt](e){return e._stack.push(this),this[Ae]}}),In=e=>Oa in e,KT=re(2,(e,t)=>In(e)?e._tag==="Success"?t(e.value):e:$e(e,t)),QT=e=>$e(e,Ie),Dt=re(2,(e,t)=>$e(e,n=>Re(tn(()=>t(n))))),JT=re(2,(e,t)=>In(e)?nA(e,t):Dt(e,t)),GT=re(2,(e,t)=>In(e)?rA(e,t):yA(e,t)),YT=re(2,(e,t)=>In(e)?sA(e,t):vA(e,t)),XT=re(2,(e,t)=>{if(In(e)){if(e._tag==="Success")return e;const n=yo(e.cause);return At(n)?e:t(n.success)}return Xl(e,t)}),ZT=e=>Bn(jp(e)),qp=e=>e._tag==="Success",eA=e=>e._tag==="Failure",tA=e=>e._tag==="Failure"?qr(e.cause):rr(e),Vn=ut(void 0),nA=re(2,(e,t)=>e._tag==="Success"?ut(t(e.value)):e),rA=re(2,(e,t)=>{if(e._tag==="Success")return e;const n=yo(e.cause);return At(n)?e:Er(t(n.success))}),sA=re(2,(e,t)=>{if(e._tag==="Success")return ut(t.onSuccess(e.value));const n=yo(e.cause);return At(n)?e:Er(t.onFailure(n.success))}),oA=re(2,(e,t)=>qp(e)?t:e),iA=e=>{const t=[];for(const n of e)n._tag==="Failure"&&t.push(...n.cause.reasons);return t.length===0?Vn:Bn(Na(t))},aA=e=>qp(e)?Ne(e.value):zn(),cA=e=>He(t=>Re(PR(t.context,e))),Yl=re(2,(e,t)=>He(n=>{const o=n.context,i=t(o);return o===i?e:(n.setContext(i),Fk(e,()=>{n.setContext(o)}))})),xk=re(3,(e,t,n)=>Yl(e,o=>{const i=Hl(o,t),c=n(i);return i===c?o:Fs(o,t,c)})),uA=()=>lA,lA=He(e=>Re(e.context)),wk=e=>He(t=>e(t.context)),ec=re(2,(e,t)=>In(e)?e:Yl(e,di(t))),tc=function(){return arguments.length===1?re(2,(e,t)=>AS(e,arguments[0],t)):re(3,(e,t,n)=>AS(e,t,n)).apply(this,arguments)},AS=(e,t,n)=>Yl(e,o=>o.mapUnsafe.get(t.key)===n?o:Fs(o,t,n)),fA=re(e=>Qt(e[1]),(e,t,n)=>dA(e,t,(o,i)=>[o,i],n)),dA=re(e=>Qt(e[1]),(e,t,n,o)=>o!=null&&o.concurrent?Dt(UA([e,t],{concurrency:2}),([i,c])=>tn(()=>n(i,c))):$e(e,i=>Dt(t,c=>tn(()=>n(i,c))))),hA=re(e=>Qt(e[0]),(e,t)=>Qp({while:kp,body:_s(t!=null&&t.disableYield?e:$e(e,n=>Vp)),step:Ga})),nc=re(2,(e,t)=>{const n=Object.create(mA);return n[Ae]=e,n[vr]=t.length!==1?o=>t(o):t,n}),mA=Xa({op:"OnFailure",[Tt](e){return e._stack.push(this),this[Ae]}}),kk=re(3,(e,t,n)=>nc(e,o=>{const i=t(o);return At(i)?Jt(i.failure):tn(()=>n(i.success,o))})),Xl=re(2,(e,t)=>kk(e,yo,n=>t(n))),pA=re(2,(e,t)=>nc(e,n=>Za(tn(()=>t(n)),Jt(n)))),gA=re(e=>Qt(e[0]),(e,t,n,o)=>nc(e,i=>{const c=yo(i);if(At(c))return Jt(c.failure);const l=t(c.success);return At(l)?o?tn(()=>o(l.failure)):Jt(i):tn(()=>n(l.success))})),yA=re(2,(e,t)=>Xl(e,n=>hk(()=>t(n)))),vA=re(2,(e,t)=>Wp(e,{onFailure:n=>hk(()=>t.onFailure(n)),onSuccess:n=>kt(()=>t.onSuccess(n))})),SA=e=>Xl(e,Gl),xA=re(e=>Qt(e[0]),(e,t)=>{if(!(t!=null&&t.log))return Wp(e,{onFailure:o=>ct,onSuccess:o=>ct});const n=Vk(t.log===!0?void 0:t.log);return Zl(e,{onFailure(o){const i=wT(o);return At(i)?Jt(i.failure):t.message===void 0?n(o):n(t.message,o)},onSuccess:o=>ct})}),Dh=e=>EA(e,{onFailure:rr,onSuccess:qr}),Zl=re(2,(e,t)=>{const n=Object.create(wA);return n[Ae]=e,n[Fn]=t.onSuccess.length!==1?o=>t.onSuccess(o):t.onSuccess,n[vr]=t.onFailure.length!==1?o=>t.onFailure(o):t.onFailure,n}),wA=Xa({op:"OnSuccessAndFailure",[Tt](e){return e._stack.push(this),this[Ae]}}),Wp=re(2,(e,t)=>Zl(e,{onFailure:n=>{const o=n.reasons.find(Fp);return o?tn(()=>t.onFailure(o.error)):Jt(n)},onSuccess:t.onSuccess})),kA=re(2,(e,t)=>Wp(e,{onFailure:n=>kt(()=>t.onFailure(n)),onSuccess:n=>kt(()=>t.onSuccess(n))})),EA=re(2,(e,t)=>{if(In(e)){if(e._tag==="Success")return ut(t.onSuccess(e.value));const n=yo(e.cause);return At(n)?e:ut(t.onFailure(n.success))}return kA(e,t)}),ef=e=>In(e)?ut(e):_A(e),_A=ir({op:"Exit",[Tt](e){return e._stack.push(this),this[Ae]},[Fn](e,t,n){return Re(n??ut(e))},[vr](e,t,n){return Re(n??Bn(e))}}),CA=re(2,(e,t)=>Za(Yp(t),e)),Ek=re(2,(e,t)=>Sk(e,$e(Yp(t.duration),t.orElse))),bA=re(2,(e,t)=>Ek(e,{duration:t,orElse:()=>Jl(new uM)})),MS="~effect/Scope",LS="~effect/Scope/Closeable",tf=qn("effect/Scope"),_k=(e,t)=>Et(()=>Ck(e,t)??ct),Ck=(e,t)=>{if(e.state._tag==="Closed")return;const n={_tag:"Closed",exit:t};if(e.state._tag==="Empty"){e.state=n;return}const{finalizers:o}=e.state;if(e.state=n,o.size!==0)return o.size===1?o.values().next().value(t):PA(e,o,t)},PA=pk(function*(e,t,n){let o=[];const i=[],c=Array.from(t.values()),l=Bp();for(let d=c.length-1;d>=0;d--){const h=c[d];e.strategy==="sequential"?o.push(yield*ef(h(n))):i.push(sf(l,h(n),!0,!0,"inherit"))}return i.length>0&&(o=yield*dk(i)),yield*iA(o)}),FA=(e,t)=>{const n=Kp(t);if(e.state._tag==="Closed")return n.state=e.state,n;const o={};return Ua(e,o,i=>_k(n,i)),Ua(n,o,i=>kt(()=>Hp(e,o))),n},hi=(e,t)=>Et(()=>e.state._tag==="Closed"?t(e.state.exit):(Ua(e,{},t),ct)),IA=(e,t)=>hi(e,_s(t)),Ua=(e,t,n)=>{e.state._tag==="Empty"?e.state={_tag:"Open",finalizers:new Map([[t,n]])}:e.state._tag==="Open"&&e.state.finalizers.set(t,n)},Hp=(e,t)=>{e.state._tag==="Open"&&e.state.finalizers.delete(t)},Kp=(e="sequential")=>({[LS]:LS,[MS]:MS,strategy:e,state:RA}),RA={_tag:"Empty"},bk=tf.asEffect(),TA=tc(tf),Pk=e=>Et(()=>{const t=Kp();return Is(e(t),n=>Et(()=>Ck(t,n)??ct))}),AA=(e,t,n)=>wk(o=>Ak(i=>$e(bk,c=>yk(n!=null&&n.interruptible?i(e):e,l=>hi(c,d=>ec(t(l,d),o)))))),Fk=ir({op:"OnExit",single:!1,[Tt](e){return e._stack.push(this),this[Ae][0]},[lo](e){e.interruptible&&this[Ae][2]!==!0&&(e._stack.push(nf),e.interruptible=!1)},[Fn](e,t,n){n??(n=ut(e));const o=this[Ae][1](n);return o?$e(o,i=>n):n},[vr](e,t,n){n??(n=Bn(e));const o=this[Ae][1](n);return o?$e(o,i=>n):n}}),Is=re(2,Fk),MA=re(2,(e,t)=>Is(e,n=>t)),LA=re(3,(e,t,n)=>Is(e,o=>{const i=t(o);return At(i)?ct:n(i.success,o)})),OA=re(2,(e,t)=>LA(e,tA,t)),NA=re(3,(e,t,n)=>Is(e,o=>{if(o._tag!=="Failure")return ct;const i=t(o.cause);return At(i)?ct:n(i.success,o.cause)})),DA=re(2,(e,t)=>NA($p,t)(e)),jA=He(e=>Jt(jp(e.id))),Ik=e=>He(t=>(t.interruptible&&(t.interruptible=!1,t._stack.push(nf)),e)),Rk=ir({op:"SetInterruptible",[lo](e){if(e.interruptible=this[Ae],e._interruptedCause&&e.interruptible)return()=>Jt(e._interruptedCause)}}),nf=Rk(!0),$A=Rk(!1),Tk=e=>He(t=>t.interruptible?e:(t.interruptible=!0,t._stack.push($A),t._interruptedCause?Jt(t._interruptedCause):e)),Ak=e=>He(t=>t.interruptible?(t.interruptible=!1,t._stack.push(nf),e(Tk)):e(Ie)),UA=(e,t)=>eI(e)?(t==null?void 0:t.mode)==="result"?Js(e,Dh,t):Js(e,Ie,t):t!=null&&t.discard?t.mode==="result"?Js(Object.values(e),Dh,t):Js(Object.values(e),Ie,t):Et(()=>{const n={};return Si(Js(Object.entries(e),([o,i])=>Dt((t==null?void 0:t.mode)==="result"?Dh(i):i,c=>{n[o]=c}),{discard:!0,concurrency:t==null?void 0:t.concurrency}),n)}),Qp=ir({op:"While",[Fn](e,t){return this[Ae].step(e),this[Ae].while()?(t._stack.push(this),this[Ae].body()):Vn},[Tt](e){return this[Ae].while()?(e._stack.push(this),this[Ae].body()):Vn}}),Js=re(e=>typeof e[1]=="function",(e,t,n)=>He(o=>{const i=(n==null?void 0:n.concurrency)==="inherit"?o.getRef(uT):(n==null?void 0:n.concurrency)??1,c=i==="unbounded"?Number.POSITIVE_INFINITY:Math.max(1,i);if(c===1)return BA(e,t,n);const l=xr(e);let d=l.length;if(d===0)return n!=null&&n.discard?ct:Re([]);const h=n!=null&&n.discard?void 0:new Array(d),p=zA({f:t,out:h},l,{concurrency:c});return p?Si(p,h):Re(h)})),BA=(e,t,n)=>Et(()=>{const o=n!=null&&n.discard?void 0:[],i=e[Symbol.iterator]();let c=i.next(),l=0;return Si(Qp({while:()=>!c.done,body:()=>t(c.value,l++),step:d=>{o&&o.push(d),c=i.next()}}),o)}),Mk=e=>{const t=e.onItem,n=e.step;return(o,i,c)=>{let l=(c==null?void 0:c.start)??0;const d=(c==null?void 0:c.end)??i.length,h=(c==null?void 0:c.concurrency)??1;let p=!1,y,g,v,w=!1,S,E;const P=()=>{let H=!1;for(;!S&&l<d;l++){const _=i[l],O=E??t(o,_,l);if(In(O)){if(S=n(o,_,O,l),S)break}else{if(h===1)return $e(ef(O),C=>(S=n(o,_,C,l),l++,S??P()??ct));if(y){E=void 0;const C=sf(y,O,!0,!0,"inherit");if(C._exit){if(S=n(o,_,C._exit,l),S)break;continue}g?g.add(C):g=new Set([C]);const D=l;if(C.addObserver(T=>{if(g.delete(C),S){if(!w&&T._tag==="Failure")for(const L of T.cause.reasons)L._tag!=="Interrupt"&&(S._tag==="Failure"?S.cause.reasons.push(L):S=Bn(Na([L])))}else{const L=n(o,_,T,D);L&&(S=L._tag==="Failure"?Bn(Na(L.cause.reasons.slice())):L,P())}if(H){const L=P();L&&v(L)}else p&&g.size===0&&v(S??ct)}),g.size<h)continue;H=!0,l++;return}else return ar(C=>{y=Bp(),E=O,v=C;const D=P();return D?C(D):Et(()=>(S=Vn,w=!0,g?cl(g):ct))})}}if(p=!0,S){if(g&&g.size>0){const _=Ql(y);g.forEach(O=>O.interruptUnsafe(y.id,_));return}if(v||S._tag==="Failure")return S}else if(v)if(g)g.size===0&&v(ct);else return Vn};return P()}},rf=()=>Mk,zA=Mk({onItem(e,t,n){return e.f(t,n)},step(e,t,n,o){if(n._tag==="Failure")return n;e.out&&(e.out[o]=n.value)}}),sf=(e,t,n=!1,o=!1,i=!1)=>{const c=i==="inherit"?e.interruptible:!i,l=new lk(e.context,c);return n?l.evaluate(t):e.currentDispatcher.scheduleTask(()=>l.evaluate(t),0),!o&&!l._exit&&(e.children().add(l),l.addObserver(()=>e._children.delete(l))),l},Lk=re(e=>Qt(e[0]),(e,t,n)=>He(o=>{const i=sf(o,e,n==null?void 0:n.startImmediately,!0,n==null?void 0:n.uninterruptible);if(!i._exit)if(t.state._tag!=="Closed"){const c={};Ua(t,c,()=>UT(d=>d===i.id?ct:zp(i))),i.addObserver(()=>Hp(t,c))}else i.interruptUnsafe(o.id,Ql(o));return Re(i)})),VA=re(e=>Qt(e[0]),(e,t)=>$e(bk,n=>Lk(e,n,t))),rc=e=>(t,n)=>{const o=new lk(n!=null&&n.scheduler?Fs(e,X1,n.scheduler):e,(n==null?void 0:n.uninterruptible)!==!0);if(o.evaluate(t),o._exit)return o;if(n!=null&&n.signal)if(n.signal.aborted)o.interruptUnsafe();else{const i=()=>o.interruptUnsafe();n.signal.addEventListener("abort",i,{once:!0}),o.addObserver(()=>n.signal.removeEventListener("abort",i))}return n!=null&&n.onFiberStart&&n.onFiberStart(o),o},qA=re(2,(e,t)=>{if(e._exit)return e;if(t.state._tag==="Closed")return e.interruptUnsafe(e.id),e;const n={};return Ua(t,n,()=>zp(e)),e.addObserver(()=>Hp(t,n)),e}),WA=rc(sr()),Ok=e=>{const t=rc(e);return(n,o)=>{const i=t(n,o);return o!=null&&o.onExit&&i.addObserver(o.onExit),c=>i.interruptUnsafe(c)}},HA=Ok(sr()),Jp=e=>{const t=rc(e);return(n,o)=>{const i=t(n,o);return new Promise(c=>{i.addObserver(l=>c(l))})}},KA=Jp(sr()),Nk=e=>{const t=Jp(e);return(n,o)=>t(n,o).then(i=>{if(i._tag==="Failure")throw Up(i.cause);return i.value})},QA=Nk(sr()),Gp=e=>{const t=rc(e);return n=>{var c;if(In(n))return n;const o=new ek("sync"),i=t(n,{scheduler:o});return(c=i.currentDispatcher)==null||c.flush(),i._exit??li(new lM(i))}},JA=Gp(sr()),Dk=e=>{const t=Gp(e);return n=>{const o=t(n);if(o._tag==="Failure")throw Up(o.cause);return o.value}},GA=Dk(sr()),OS=Re(!0),NS=Re(!1);class YA{constructor(t){M(this,"waiters",[]);M(this,"scheduled",!1);M(this,"isOpen");M(this,"flushWaiters",()=>{this.scheduled=!1;const t=this.waiters;this.waiters=[];for(let n=0;n<t.length;n++)t[n](Vn)});M(this,"open",He(t=>this.isOpen?NS:(this.isOpen=!0,this.scheduleUnsafe(t))));M(this,"release",He(t=>this.isOpen?NS:this.scheduleUnsafe(t)));M(this,"await",ar(t=>this.isOpen?t(ct):(this.waiters.push(t),kt(()=>{const n=this.waiters.indexOf(t);n!==-1&&this.waiters.splice(n,1)}))));M(this,"close",kt(()=>this.closeUnsafe()));M(this,"whenOpen",t=>$e(this.await,()=>t));this.isOpen=t}scheduleUnsafe(t){return this.scheduled||this.waiters.length===0||(this.scheduled=!0,t.currentDispatcher.scheduleTask(this.flushWaiters,0)),OS}openUnsafe(){return this.isOpen?!1:(this.isOpen=!0,this.flushWaiters(),!0)}closeUnsafe(){return this.isOpen?(this.isOpen=!1,!0):!1}}const XA=e=>new YA(e??!1),Cm=BigInt(0),ZA={_tag:"Span",spanId:"noop",traceId:"noop",sampled:!1,status:{_tag:"Ended",startTime:Cm,endTime:Cm,exit:Vn},attributes:new Map,links:[],kind:"internal",attribute(){},event(){},end(){},addLinks(){}},eM=e=>Object.assign(Object.create(ZA),e),jk=e=>e?ro(e.annotations,km)?e._tag==="Span"?jk(B1(e.parent)):zn():Ne(e):zn(),$k=(e,t,n)=>{const o=!e.getRef(lT)||(n==null?void 0:n.annotations)&&ro(n.annotations,km),i=(n==null?void 0:n.parent)!==void 0?Ne(n.parent):n!=null&&n.root?zn():jk(e.currentSpan);let c;if(o)c=eM({name:t,parent:i,annotations:Fs((n==null?void 0:n.annotations)??sr(),km,!0)});else{const l=e.getRef(iT),d=e.getRef(xi),h=e.getRef(sk),p=e.getRef(fT),y=e.getRef(dT),g=(n==null?void 0:n.level)??e.getRef(sT),v=(n==null?void 0:n.links)!==void 0?[...y,...n.links]:y.slice();c=l.span({name:t,parent:i,annotations:(n==null?void 0:n.annotations)??sr(),links:v,startTime:h?d.currentTimeNanosUnsafe():BigInt(0),kind:(n==null?void 0:n.kind)??"internal",root:(n==null?void 0:n.root)??go(i),sampled:(n==null?void 0:n.sampled)??(ks(i)&&i.value.sampled===!1?!1:!Bk(e.getRef(oT),g))});for(const[w,S]of Object.entries(p))c.attribute(w,S);if((n==null?void 0:n.attributes)!==void 0)for(const[w,S]of Object.entries(n.attributes))c.attribute(w,S)}return c},tM=(e,t)=>Ik(He(n=>{const o=Hl(n.context,tf),i=$k(n,e,t??{}),c=n.getRef(xi),l=n.getRef(sk);return Si(hi(o,d=>rM(i,d,c,l)),i)})),nM=(e,t)=>(t=typeof t=="function"?t:Nl,xk(rk,n=>({name:e,stack:t,parent:n}))),rM=(e,t,n,o)=>kt(()=>{e.status._tag!=="Ended"&&e.end(o?n.currentTimeNanosUnsafe():Cm,t)}),sM=(e,...t)=>{const n=t.length===1?void 0:t[0],o=t[t.length-1];return He(i=>{const c=$k(i,e,n),l=i.getRef(xi);return Is(tn(()=>o(c)),d=>kt(()=>{c.status._tag!=="Ended"&&c.end(l.currentTimeNanosUnsafe(),d)}))})},DS=tc(nT),oM=function(){const e=Qt(arguments[0]),t=e?arguments[1]:arguments[0];let n=e?arguments[2]:arguments[1],o=Ie;return t._tag==="Span"&&(n=gT(n),o=nM(t.name,n==null?void 0:n.captureStackTrace)),e?DS(o(arguments[0]),t):i=>DS(o(i),t)},xi=rt("effect/Clock",{defaultValue:()=>new aM}),iM=2**31-1;class aM{constructor(){M(this,"currentTimeMillis",kt(()=>this.currentTimeMillisUnsafe()));M(this,"currentTimeNanos",kt(()=>this.currentTimeNanosUnsafe()))}currentTimeMillisUnsafe(){return Date.now()}currentTimeNanosUnsafe(){return cM()}sleep(t){const n=J1(t);return n<=0?Vp:ar(o=>{if(n>iM)return;const i=setTimeout(()=>o(ct),n);return kt(()=>clearTimeout(i))})}}const jS=(function(){const e=BigInt(1e6);if(typeof performance>"u"||typeof performance.now>"u")return()=>BigInt(Date.now())*e;if(typeof performance.timeOrigin=="number"&&performance.timeOrigin===0)return()=>BigInt(Math.round(performance.now()*1e6));const t=BigInt(Date.now())*e-BigInt(Math.round(performance.now()*1e6));return()=>t+BigInt(Math.round(performance.now()*1e6))})(),cM=(function(){const e=typeof process=="object"&&"hrtime"in process&&typeof process.hrtime.bigint=="function"?process.hrtime:void 0;if(!e)return jS;const t=jS()-e.bigint();return()=>t+e.bigint()})(),Uk=e=>He(t=>e(t.getRef(xi))),Yp=e=>Uk(t=>t.sleep(Op(e))),$S="~effect/Cause/TimeoutError";var iw,aw;class uM extends(aw=Rp("TimeoutError"),iw=$S,aw){constructor(n){super({message:n});M(this,iw,$S)}}const US="~effect/Cause/AsyncFiberError";var cw,uw;class lM extends(uw=Rp("AsyncFiberError"),cw=US,uw){constructor(n){super({message:"An asynchronous Effect was executed with Effect.runSync",fiber:n});M(this,cw,US)}}const fM=rt("effect/Console/CurrentConsole",{defaultValue:()=>globalThis.console}),dM=e=>{switch(e){case"All":return Number.MIN_SAFE_INTEGER;case"Fatal":return 5e4;case"Error":return 4e4;case"Warn":return 3e4;case"Info":return 2e4;case"Debug":return 1e4;case"Trace":return 0;case"None":return Number.MAX_SAFE_INTEGER}},hM=XI(Mp,dM),Bk=$1(hM),mM=rt("effect/Loggers/CurrentLoggers",{defaultValue:()=>new Set([kM,EM])}),pM=rt("effect/Logger/LogToStderr",{defaultValue:f1}),gM="~effect/Logger",yM={[gM]:{_Message:Ie,_Output:Ie},pipe(){return jt(this,arguments)}},zk=e=>{const t=Object.create(yM);return t.log=e,t},vM=e=>e.replace(/[\s="]/g,"_"),SM=(e,t)=>`${vM(e[0])}=${t-e[1]}ms`,Vk=e=>(...t)=>{let n;for(let o=0,i=t.length;o<i;o++){const c=t[o];Vl(c)&&(n?t.splice(o,1):t=t.slice(0,o).concat(t.slice(o+1)),n=n?Na(n.reasons.concat(c.reasons)):c,o--)}return n===void 0&&(n=LI),He(o=>{const i=e??o.currentLogLevel;if(Bk(o.minimumLogLevel,i))return ct;const c=o.getRef(xi),l=o.getRef(mM);if(l.size>0){const d=new Date(c.currentTimeMillisUnsafe());for(const h of l)h.log({cause:n,fiber:o,date:d,logLevel:i,message:t})}return ct})},xM=e=>`${e.getHours().toString().padStart(2,"0")}:${e.getMinutes().toString().padStart(2,"0")}:${e.getSeconds().toString().padStart(2,"0")}.${e.getMilliseconds().toString().padStart(3,"0")}`,wM=typeof process=="object"&&process!==null&&typeof process.stdout=="object"&&process.stdout!==null;wM&&process.stdout.isTTY;const kM=zk(({cause:e,date:t,fiber:n,logLevel:o,message:i})=>{const c=Array.isArray(i)?i.slice():[i];e.reasons.length>0&&c.push(ck(e));const l=t.getTime(),d=n.getRef(pT);let h="";for(const v of d)h+=` ${SM(v,l)}`;const p=n.getRef(Dp);Object.keys(p).length>0&&c.push(p);const y=n.getRef(fM);(n.getRef(pM)?y.error:y.log)(`[${xM(t)}] ${o.toUpperCase()} (#${n.id})${h}:`,...c)}),EM=zk(({cause:e,fiber:t,logLevel:n,message:o})=>{const i=t.getRef(xi),c=t.getRef(Dp),l=t.currentSpan;if(l===void 0||l._tag==="ExternalSpan")return;const d={};for(const[h,p]of Object.entries(c))d[h]=p;d["effect.fiberId"]=t.id,d["effect.logLevel"]=n.toUpperCase(),e.reasons.length>0&&(d["effect.cause"]=ck(e)),l.event(bI(Array.isArray(o)&&o.length===1?o[0]:o),i.currentTimeNanosUnsafe(),d)}),_M=Vl,CM=MI,bm=Na,Pm=e=>new k1(e),Fm=e=>new _1(e),Im=xT,bM=CT,qk=Up,sc=yo,PM=ET,FM=$p,Xp=BI,of=VI,IM=w1,jh=ut,Ca=Bn,oc=Er,RM=li,TM=ZT,Wk=Vn,Hk=qp,Kk=eA,AM=aA,MM="~effect/Deferred",LM={[MM]:{_A:Ie,_E:Ie},pipe(){return jt(this,arguments)}},Zp=()=>{const e=Object.create(LM);return e.resumes=void 0,e.effect=void 0,e},eg=e=>ar(t=>e.effect?t(e.effect):(e.resumes??(e.resumes=[]),e.resumes.push(t),kt(()=>{const n=e.resumes.indexOf(t);e.resumes.splice(n,1)}))),OM=re(2,(e,t)=>kt(()=>ba(e,t))),Qk=OM,ba=(e,t)=>{if(e.effect)return!1;if(e.effect=t,e.resumes){for(let n=0;n<e.resumes.length;n++)e.resumes[n](t);e.resumes=void 0}return!0},NM=re(2,(e,t)=>Ak(n=>$e(ef(n(e)),o=>Qk(t,o)))),DM=Dp,BS=tf,tg=Kp,ul=TA,jM=hi,$M=IA,ll=FA,af=_k,UM="~effect/Layer",zS="~effect/Layer/MemoMap",BM={[UM]:{_ROut:Ie,_E:Ie,_RIn:Ie},pipe(){return jt(this,arguments)}},Jk=e=>{const t=Object.create(BM);return t.build=e,t},ng=e=>Jk((t,n)=>{const o=ll(n);return Is(e(t,o),i=>i._tag==="Failure"?af(o,i):ct)}),zM=e=>{const t=ng((n,o)=>n.getOrElseMemoize(t,o,e));return t};class VM{constructor(){M(this,"map",new Map)}get[zS](){return zS}getOrElseMemoize(t,n,o){if(this.map.has(t)){const d=this.map.get(t);return d.observers++,Za(hi(n,h=>d.finalizer(h)),d.effect)}const i=tg(),c=Zp(),l={observers:1,effect:eg(c),finalizer:d=>Et(()=>(l.observers--,l.observers===0?(this.map.delete(t),af(i,d)):ct))};return this.map.set(t,l),hi(n,l.finalizer).pipe($e(()=>o(this,i)),Is(d=>(l.effect=d,Qk(c,d))))}}const rg=()=>new VM,Il=class Il extends qn()("effect/Layer/CurrentMemoMap"){};M(Il,"getOrCreate",_R(Il,rg));let Ba=Il;const sg=re(3,(e,t,n)=>tc(Dt(e.build(t,n),Fs(Ba,t)),Ba,t)),qM=re(2,(e,t)=>He(n=>sg(e,Ba.getOrCreate(n.context),t))),og=function(){return arguments.length===1?e=>VS(fi(arguments[0],e)):VS(fi(arguments[0],arguments[1]))},VS=e=>Jk(_s(Re(e))),Rm=function(){return arguments.length===1?e=>qS(arguments[0],e):qS(arguments[0],arguments[1])},qS=(e,t)=>Tm(Dt(t,n=>fi(e,n))),Tm=e=>zM((t,n)=>ul(e,n)),Gk=(e,t,n)=>{const o=ll(n,"parallel");return Js(e,i=>i.build(t,ll(o,"sequential")),{concurrency:e.length}).pipe(Dt(i=>FR(...i)))},Yk=(...e)=>ng((t,n)=>Gk(e,t,n)),WM=(e,t,n)=>ng((o,i)=>$e(Array.isArray(t)?Gk(t,o,i):t.build(o,i),c=>e.build(o,i).pipe(ec(c),Dt(l=>n(l,c))))),Am=re(2,(e,t)=>WM(e,t,Ie)),HM=class extends Ol{constructor(t){super(),t&&Object.assign(this,t)}},fl=re(2,(e,t)=>kk(e,JM,n=>t(n))),WS=e=>e.reasons.some(KM),KM=e=>e._tag==="Fail"&&Xp(e.error),QM=Y1(sc,e=>Xp(e)?qr(e):rr(e)),JM=Y1(sc,e=>Xp(e)?qr(e.value):rr(e)),Xk=re(2,(e,t)=>Zl(e,{onSuccess:t.onSuccess,onFailure:n=>{const o=QM(n);return At(o)?t.onFailure(o.failure):t.onDone(o.success.value)}})),Zk="~effect/Schedule",HS=rt("effect/Schedule/CurrentMetadata",{defaultValue:_s({input:void 0,output:void 0,duration:Np,attempt:0,start:0,now:0,elapsed:0,elapsedSincePrevious:0})}),GM={[Zk]:{_Out:Ie,_In:Ie,_Env:Ie},pipe(){return jt(this,arguments)}},YM=e=>Ue(e,Zk),cf=e=>{const t=Object.create(GM);return t.step=e,t},ig=()=>{let e=0,t,n;return(o,i)=>{n===void 0&&(n=o);const c=o-n,l=t===void 0?0:o-t;return t=o,{input:i,attempt:++e,start:n,now:o,elapsed:c,elapsedSincePrevious:l}}},eE=e=>cf(Dt(e,t=>{const n=ig();return(o,i)=>t(n(o,i))})),za=e=>nc(e.step,t=>Re(()=>Jt(t))),XM=e=>Uk(t=>Dt(za(e),n=>{const o=ig();return i=>Et(()=>{const c=t.currentTimeMillisUnsafe();return $e(n(c,i),([l,d])=>{const h=o(c,i);return h.output=l,h.duration=d,Si(Yp(d),h)})})})),ZM=re(2,(e,t)=>eL(e,t,(n,o)=>[n,o])),eL=re(3,(e,t,n)=>cf(Dt(fA(za(e),za(t)),([o,i])=>(c,l)=>Xk(o(c,l),{onSuccess:d=>i(c,l).pipe(Dt(h=>[n(d[0],h[0]),KR(d[1],h[1])]),fl(h=>Re([n(d[0],h),d[1]]))),onFailure:Jt,onDone:d=>i(c,l).pipe(Dt(h=>[n(d,h[0]),h[1]]),fl(h=>of(n(d,h))))})))),tL=(e,t=2)=>{const n=J1(Op(e));return eE(Re(o=>{const i=ja(n*Math.pow(t,o.attempt-1));return Re([i,i])}))},tE=e=>cf(Dt(za(e),t=>(n,o)=>Xk(t(n,o),{onSuccess:i=>Re([o,i[1]]),onFailure:Jt,onDone:()=>of(o)}))),nL=e=>Vu(rE,({attempt:t})=>Re(t<=e)),nE=e=>{const t=Op(e);return eE(Re(n=>Re([n.attempt-1,t])))},Vu=re(2,(e,t)=>cf(Dt(za(e),n=>{const o=ig();return(i,c)=>$e(n(i,c),l=>{const[d,h]=l,p=t({...o(i,c),output:d,duration:h});return $e(Qt(p)?p:Re(p),y=>y?Re(l):of(d))})}))),rE=nE(Np),rL=(e,t,n)=>Pk(o=>$e(n!=null&&n.local?sg(t,rg(),o):qM(t,o),i=>ec(e,i))),sL=re(e=>Qt(e[0]),(e,t,n)=>W1(t)?ec(e,t):rL(e,Array.isArray(t)?Yk(...t):t,n)),oL=re(3,(e,t,n)=>$e(XM(t),o=>{let i=HS.defaultValue(),c;const l=Xl(Et(()=>tc(e,HS,i)),d=>(c=d,$e(o(d),h=>(i=h,l))));return fl(l,d=>tn(()=>n(c,d)))})),iL=re(2,(e,t)=>{const n=typeof t=="function"?t(Ie):YM(t)?t:cL(t);return oL(e,n,Jl)}),aL=tE(rE),cL=e=>{let t=e.schedule?tE(e.schedule):aL;return e.while&&(t=Vu(t,({input:n})=>{const o=e.while(n);return Qt(o)?o:Re(o)})),e.until&&(t=Vu(t,({input:n})=>{const o=e.until(n);return Qt(o)?Dt(o,i=>!i):Re(!o)})),e.times!==void 0&&(t=Vu(t,({attempt:n})=>Re(n<=e.times))),t},ii=Qt,sE=Js,oE=Qp,uL=$T,lt=Re,ag=jT,lL=DT,wr=Et,Un=kt,ht=ct,KS=ar,fL=zT,Mm=VT,Je=Jl,dL=Jt,hL=Gl,dl=He,Rn=$e,mL=QT,pL=Za,gL=yk,QS=ef,Rs=Dt,hl=nc,yL=gA,qu=SA,vL=pA,SL=iL,xL=xA,wL=bA,iE=Ek,kL=CA,aE=Sk,EL=Zl,ml=uA,cE=wk,_L=sL,so=ec,CL=cA,bL=Yl,PL=tc,FL=Pk,uE=AA,lE=MA,IL=OA,fE=Is,Lm=jA,cg=Tk,RL=DA,dE=hA,TL=tM,AL=sM,JS=oM,ML=Lk,ug=VA,Om=WA,pl=rc,LL=Ok,OL=HA,Wu=QA,NL=Nk,DL=KA,jL=Jp,lg=GA,$L=Dk,hE=JA,UL=Gp,oo=pk,BL=Vk("Error"),zL=re(e=>ii(e[0]),(e,...t)=>xk(e,DM,n=>{const o={...n};return t.length===1?Object.assign(o,t[0]):o[t[0]]=t[1],o})),mE=JT,vo=GT,Va=YT,ni=KT,VL=XT,Nm=qT;function Sa(e,t,n){return t==="__proto__"?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n,e}function pE(e){return e.checks?e.checks[e.checks.length-1].annotations:e.annotations}function qL(e){return t=>{var n;return(n=pE(t))==null?void 0:n[e]}}const WL=qL("identifier"),fg=Cs(e=>{const t=WL(e);return typeof t=="string"?t:e.getExpected(fg)}),HL=e=>e.replace(/[/\\^$*+?.()|[\]{}]/g,"\\$&"),Hu=new WeakMap,gE="~effect/data/Redacted",KL=e=>Ue(e,gE),GS=(e,t)=>{const n=Object.create(QL);return Hu.set(n,e),n},QL={[gE]:{_A:e=>e},label:void 0,...Ps,toJSON(){return this.toString()},toString(){return`<redacted${Ep(this.label)?":"+this.label:""}>`},[rn](){return pt(Hu.get(this))},[sn](e){return KL(e)&&Pn(Hu.get(this),Hu.get(e))}},Dm="~effect/SchemaIssue/Issue";function JL(e){return Ue(e,Dm)}var lw;let _r=(lw=Dm,class{constructor(){M(this,lw,Dm)}toString(){return s3(this)}}),GL=class extends _r{constructor(n,o,i){super();M(this,"_tag","Filter");M(this,"actual");M(this,"filter");M(this,"issue");this.actual=n,this.filter=o,this.issue=i}};class YL extends _r{constructor(n,o,i){super();M(this,"_tag","Encoding");M(this,"ast");M(this,"actual");M(this,"issue");this.ast=n,this.actual=o,this.issue=i}}class or extends _r{constructor(n,o){super();M(this,"_tag","Pointer");M(this,"path");M(this,"issue");this.path=n,this.issue=o}}class yE extends _r{constructor(n){super();M(this,"_tag","MissingKey");M(this,"annotations");this.annotations=n}}class vE extends _r{constructor(n,o){super();M(this,"_tag","UnexpectedKey");M(this,"ast");M(this,"actual");this.ast=n,this.actual=o}}class Kt extends _r{constructor(n,o,i){super();M(this,"_tag","Composite");M(this,"ast");M(this,"actual");M(this,"issues");this.ast=n,this.actual=o,this.issues=i}}class Cr extends _r{constructor(n,o){super();M(this,"_tag","InvalidType");M(this,"ast");M(this,"actual");this.ast=n,this.actual=o}}class gl extends _r{constructor(n,o){super();M(this,"_tag","InvalidValue");M(this,"actual");M(this,"annotations");this.actual=n,this.annotations=o}}class YS extends _r{constructor(n,o,i){super();M(this,"_tag","AnyOf");M(this,"ast");M(this,"actual");M(this,"issues");this.ast=n,this.actual=o,this.issues=i}}class XL extends _r{constructor(n,o,i){super();M(this,"_tag","OneOf");M(this,"ast");M(this,"actual");M(this,"successes");this.ast=n,this.actual=o,this.successes=i}}function jm(e,t){if(JL(t))return t;if(typeof t=="string")return new gl(Ne(e),{message:t});const n=typeof t.issue=="string"?new gl(Ne(e),{message:t.issue}):t.issue;return new or(t.path,n)}function ZL(e,t){if(t!==void 0)return typeof t=="boolean"?t?void 0:new gl(Ne(e)):jm(e,t)}function e3(e,t,n){return Array.isArray(n)?ol(n)?n.length===1?jm(e,n[0]):new Kt(t,Ne(e),V1(n,o=>jm(e,o))):void 0:ZL(e,n)}const t3=e=>{const t=qa(e);if(t!==void 0)return t;switch(e._tag){case"InvalidType":return $m(fg(e.ast),XS(e.actual));case"InvalidValue":return`Invalid data ${XS(e.actual)}`;case"MissingKey":return"Missing key";case"UnexpectedKey":return`Unexpected key with value ${gt(e.actual)}`;case"Forbidden":return"Forbidden operation";case"OneOf":return`Expected exactly one member to match the input ${gt(e.actual)}`}},n3=e=>qa(e.issue)??qa(e);function $m(e,t){return`Expected ${e}, got ${t}`}function ti(e,t,n,o){switch(e._tag){case"Filter":{const i=o(e);if(i!==void 0)return[{path:t,message:i}];switch(e.issue._tag){case"InvalidValue":return[{path:t,message:$m(SE(e.filter),gt(e.actual))}];default:return ti(e.issue,t,n,o)}}case"Encoding":return ti(e.issue,t,n,o);case"Pointer":return ti(e.issue,[...t,...e.path],n,o);case"Composite":return e.issues.flatMap(i=>ti(i,t,n,o));case"AnyOf":{const i=qa(e);if(e.issues.length===0){if(i!==void 0)return[{path:t,message:i}];const c=$m(fg(e.ast),gt(e.actual));return[{path:t,message:c}]}return e.issues.flatMap(c=>ti(c,t,n,o))}default:return[{path:t,message:n(e)}]}}function SE(e){var n;const t=(n=e.annotations)==null?void 0:n.expected;if(typeof t=="string")return t;switch(e._tag){case"Filter":return"<filter>";case"FilterGroup":return e.checks.map(o=>SE(o)).join(" & ")}}function r3(){return e=>ti(e,[],t3,n3).map(o3).join(`
|
|
81
|
+
${t}}`),o},_m=`~effect/Fiber/${ST}`,MT={_A:Ie,_E:Ie},LT={id:0},Bp=()=>globalThis[_a];var ow;ow=_m;class lk{constructor(t,n=!0){M(this,ow);M(this,"id");M(this,"interruptible");M(this,"currentOpCount");M(this,"currentLoopCount");M(this,"_stack");M(this,"_observers");M(this,"_exit");M(this,"_currentExit");M(this,"_children");M(this,"_interruptedCause");M(this,"_yielded");M(this,"context");M(this,"currentScheduler");M(this,"currentTracerContext");M(this,"currentSpan");M(this,"currentLogLevel");M(this,"minimumLogLevel");M(this,"currentStackFrame");M(this,"runtimeMetrics");M(this,"maxOpsBeforeYield");M(this,"currentPreventYield");M(this,"_dispatcher");this[_m]=MT,this.setContext(t),this.id=++LT.id,this.currentOpCount=0,this.currentLoopCount=0,this.interruptible=n,this._stack=[],this._observers=[],this._exit=void 0,this._children=void 0,this._interruptedCause=void 0,this._yielded=void 0}get currentDispatcher(){return this._dispatcher??(this._dispatcher=this.currentScheduler.makeDispatcher())}getRef(t){return CR(this.context,t)}addObserver(t){return this._exit?(t(this._exit),Ga):(this._observers.push(t),()=>{const n=this._observers.indexOf(t);n>=0&&this._observers.splice(n,1)})}interruptUnsafe(t,n){if(this._exit)return;let o=jp(t);this.currentStackFrame&&(o=wm(o,fi(Wl,this.currentStackFrame))),n&&(o=wm(o,n)),this._interruptedCause=this._interruptedCause?bT(this._interruptedCause,o):o,this.interruptible&&this.evaluate(Gt(this._interruptedCause))}pollUnsafe(){return this._exit}evaluate(t){var o,i;if((o=this.runtimeMetrics)==null||o.recordFiberStart(this.context),this._exit)return;if(this._yielded!==void 0){const c=this._yielded;this._yielded=void 0,c()}const n=this.runLoop(t);if(n!==Qs){this._exit=n,(i=this.runtimeMetrics)==null||i.recordFiberEnd(this.context,this._exit);for(let c=0;c<this._observers.length;c++)this._observers[c](n);this._observers.length=0}}runLoop(t){const n=globalThis[_a];globalThis[_a]=this;let o=!1,i=t;this.currentOpCount=0;const c=++this.currentLoopCount;try{for(;;){if(this.currentOpCount++,!o&&!this.currentPreventYield&&this.currentScheduler.shouldYield(this)){o=!0;const l=i;i=$e(Vp,()=>l)}if(i=this.currentTracerContext?this.currentTracerContext(i,this):i[Tt](this),c!==this.currentLoopCount)return Qs;if(i===Qs){const l=this._yielded;return Oa in l?(this._yielded=void 0,l):Qs}}}catch(l){return Ue(i,Tt)?this.runLoop(li(l)):li(`Fiber.runLoop: Not a valid effect: ${String(i)}`)}finally{globalThis[_a]=n}}getCont(t){for(;;){const n=this._stack.pop();if(!n)return;const o=n[lo]&&n[lo](this);if(o)return o[t]=o,o;if(n[t])return n}}yieldWith(t){return this._yielded=t,Qs}children(){return this._children??(this._children=new Set)}pipe(){return jt(this,arguments)}setContext(t){this.context=t;const n=this.getRef(X1);n!==this.currentScheduler&&(this.currentScheduler=n,this._dispatcher=void 0),this.currentSpan=t.mapUnsafe.get(tk),this.currentLogLevel=this.getRef(hT),this.minimumLogLevel=this.getRef(mT),this.currentStackFrame=t.mapUnsafe.get(rk.key),this.maxOpsBeforeYield=this.getRef(eT),this.currentPreventYield=this.getRef(tT),this.runtimeMetrics=t.mapUnsafe.get(cT);const o=t.mapUnsafe.get(nk);this.currentTracerContext=o?o.context:void 0}get currentSpanLocal(){var t;return((t=this.currentSpan)==null?void 0:t._tag)==="Span"?this.currentSpan:void 0}}const Ql=e=>{if(!e.currentStackFrame)return;const t=new Map;return t.set(Wl.key,e.currentStackFrame),Ss(t)},fk=e=>{const t=e;return t._exit?Re(t._exit):ar(n=>t._exit?n(Re(t._exit)):kt(e.addObserver(o=>n(Re(o)))))},dk=e=>ar(t=>{const n=e[Symbol.iterator](),o=[];let i;function c(){let l=n.next();for(;!l.done;){if(l.value._exit){o.push(l.value._exit),l=n.next();continue}i=l.value.addObserver(d=>{o.push(d),c()});return}t(Re(o))}return c(),kt(()=>i==null?void 0:i())}),zp=e=>He(t=>OT(e,t.id)),OT=re(e=>Ue(e[0],_m),(e,t,n)=>He(o=>{let i=Ql(o);return i=i&&n?di(i,n):i??n,e.interruptUnsafe(t,i),vk(fk(e))})),cl=e=>He(t=>{const n=Ql(t);for(const o of e)o.interruptUnsafe(t.id,n);return vk(dk(e))}),Re=ut,Gt=Bn,Jl=Er,kt=ir({op:"Sync",[Tt](e){const t=this[Ae](),n=e.getCont(Fn);return n?n[Fn](t,e):e.yieldWith(ut(t))}}),Et=ir({op:"Suspend",[Tt](e){return this[Ae]()}}),NT=ir({op:"Yield",[Tt](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{t||e.evaluate(Vn)},this[Ae]??0),e.yieldWith(()=>{t=!0})}}),Vp=NT(0),DT=e=>Re(Ne(e)),jT=Re(zn()),Gl=e=>li(e),hk=e=>Et(()=>Jl(tn(e))),ct=Re(void 0),$T=e=>mk(function(t,n){tn(()=>e(n)).then(o=>t(Re(o)),o=>t(Gl(o)))},e.length!==0),UT=e=>He(t=>e(t.id)),mk=ir({op:"Async",single:!1,[Tt](e){const t=tn(()=>this[Ae][0].bind(e.currentScheduler));let n=!1,o=!1;const i=this[Ae][1]?new AbortController:void 0,c=t(l=>{n||(n=!0,o?e.evaluate(l):o=l)},i==null?void 0:i.signal);return o!==!1?o:(o=!0,e._yielded=()=>{n=!0},i===void 0&&c===void 0||e._stack.push(BT(()=>(n=!0,i==null||i.abort(),c??Vn))),Qs)}}),BT=ir({op:"AsyncFinalizer",[lo](e){e.interruptible&&(e.interruptible=!1,e._stack.push(nf))},[vr](e,t){return kT(e)?$e(this[Ae](),()=>Gt(e)):Gt(e)}}),ar=e=>mk(e,e.length>=2),zT=ar(Ga),VT=(...e)=>Et(()=>$a(e.length===1?e[0]():e[1].call(e[0].self))),pk=(e,...t)=>{const n=t.length===0?function(){return Et(()=>$a(e.apply(this,arguments)))}:function(){let o=Et(()=>$a(e.apply(this,arguments)));for(let i=0;i<t.length;i++)o=t[i](o,...arguments);return o};return gk(e.length,n)},gk=(e,t)=>Object.defineProperty(t,"length",{value:e,configurable:!0}),qT=(e,...t)=>gk(e.length,t.length===0?function(){return TS(()=>e.apply(this,arguments))}:function(){let n=TS(()=>e.apply(this,arguments));for(const o of t)n=o(n);return n}),TS=e=>{try{const t=e();let n;for(;;){const o=t.next(n);if(o.done)return Re(o.value);const c=o.value.asEffect(),l=c;if(l&&l._tag==="Success"){n=l.value;continue}else{if(l&&l._tag==="Failure")return c;{let d=!0;return Et(()=>d?(d=!1,$e(c,h=>$a(t,h))):Et(()=>$a(e())))}}}}catch(t){return Gl(t)}},$a=ir({op:"Iterator",single:!1,[Fn](e,t){const n=this[Ae][0];for(;;){const o=n.next(e);if(o.done)return Re(o.value);const i=o.value.asEffect();if(In(i)){if(i._tag==="Failure")return i}else return t._stack.push(this),i;e=i.value}},[Tt](e){return this[Fn](this[Ae][1],e)}}),Si=re(2,(e,t)=>{const n=Re(t);return $e(e,o=>n)}),Za=re(2,(e,t)=>$e(e,n=>Jt(t)?t:tn(()=>t(n)))),yk=re(2,(e,t)=>$e(e,n=>Si(Jt(t)?t:tn(()=>t(n)),n))),vk=e=>$e(e,t=>Vn),WT=(e,t)=>He(n=>ar(o=>{let i=!1;const c=new Set,l=h=>{i=!0,o(c.size===0?h:$e(Ik(cl(c)),()=>h))};let d=0;for(const h of e){if(i)break;const p=d++,y=sf(n,h,!0,!0,!1);c.add(y),y.addObserver(g=>{c.delete(y);const v=!i;l(g),v&&(t!=null&&t.onWinner)&&t.onWinner({fiber:y,index:p,parentFiber:n})})}return cl(c)})),Sk=re(e=>Jt(e[1]),(e,t,n)=>WT([e,t],n)),$e=re(2,(e,t)=>{const n=Object.create(HT);return n[Ae]=e,n[Fn]=t.length!==1?o=>t(o):t,n}),HT=Xa({op:"OnSuccess",[Tt](e){return e._stack.push(this),this[Ae]}}),In=e=>Oa in e,KT=re(2,(e,t)=>In(e)?e._tag==="Success"?t(e.value):e:$e(e,t)),QT=e=>$e(e,Ie),Dt=re(2,(e,t)=>$e(e,n=>Re(tn(()=>t(n))))),JT=re(2,(e,t)=>In(e)?nA(e,t):Dt(e,t)),GT=re(2,(e,t)=>In(e)?rA(e,t):yA(e,t)),YT=re(2,(e,t)=>In(e)?sA(e,t):vA(e,t)),XT=re(2,(e,t)=>{if(In(e)){if(e._tag==="Success")return e;const n=yo(e.cause);return At(n)?e:t(n.success)}return Xl(e,t)}),ZT=e=>Bn(jp(e)),qp=e=>e._tag==="Success",eA=e=>e._tag==="Failure",tA=e=>e._tag==="Failure"?qr(e.cause):rr(e),Vn=ut(void 0),nA=re(2,(e,t)=>e._tag==="Success"?ut(t(e.value)):e),rA=re(2,(e,t)=>{if(e._tag==="Success")return e;const n=yo(e.cause);return At(n)?e:Er(t(n.success))}),sA=re(2,(e,t)=>{if(e._tag==="Success")return ut(t.onSuccess(e.value));const n=yo(e.cause);return At(n)?e:Er(t.onFailure(n.success))}),oA=re(2,(e,t)=>qp(e)?t:e),iA=e=>{const t=[];for(const n of e)n._tag==="Failure"&&t.push(...n.cause.reasons);return t.length===0?Vn:Bn(Na(t))},aA=e=>qp(e)?Ne(e.value):zn(),cA=e=>He(t=>Re(PR(t.context,e))),Yl=re(2,(e,t)=>He(n=>{const o=n.context,i=t(o);return o===i?e:(n.setContext(i),Fk(e,()=>{n.setContext(o)}))})),xk=re(3,(e,t,n)=>Yl(e,o=>{const i=Hl(o,t),c=n(i);return i===c?o:Fs(o,t,c)})),uA=()=>lA,lA=He(e=>Re(e.context)),wk=e=>He(t=>e(t.context)),ec=re(2,(e,t)=>In(e)?e:Yl(e,di(t))),tc=function(){return arguments.length===1?re(2,(e,t)=>AS(e,arguments[0],t)):re(3,(e,t,n)=>AS(e,t,n)).apply(this,arguments)},AS=(e,t,n)=>Yl(e,o=>o.mapUnsafe.get(t.key)===n?o:Fs(o,t,n)),fA=re(e=>Jt(e[1]),(e,t,n)=>dA(e,t,(o,i)=>[o,i],n)),dA=re(e=>Jt(e[1]),(e,t,n,o)=>o!=null&&o.concurrent?Dt(UA([e,t],{concurrency:2}),([i,c])=>tn(()=>n(i,c))):$e(e,i=>Dt(t,c=>tn(()=>n(i,c))))),hA=re(e=>Jt(e[0]),(e,t)=>Qp({while:kp,body:_s(t!=null&&t.disableYield?e:$e(e,n=>Vp)),step:Ga})),nc=re(2,(e,t)=>{const n=Object.create(mA);return n[Ae]=e,n[vr]=t.length!==1?o=>t(o):t,n}),mA=Xa({op:"OnFailure",[Tt](e){return e._stack.push(this),this[Ae]}}),kk=re(3,(e,t,n)=>nc(e,o=>{const i=t(o);return At(i)?Gt(i.failure):tn(()=>n(i.success,o))})),Xl=re(2,(e,t)=>kk(e,yo,n=>t(n))),pA=re(2,(e,t)=>nc(e,n=>Za(tn(()=>t(n)),Gt(n)))),gA=re(e=>Jt(e[0]),(e,t,n,o)=>nc(e,i=>{const c=yo(i);if(At(c))return Gt(c.failure);const l=t(c.success);return At(l)?o?tn(()=>o(l.failure)):Gt(i):tn(()=>n(l.success))})),yA=re(2,(e,t)=>Xl(e,n=>hk(()=>t(n)))),vA=re(2,(e,t)=>Wp(e,{onFailure:n=>hk(()=>t.onFailure(n)),onSuccess:n=>kt(()=>t.onSuccess(n))})),SA=e=>Xl(e,Gl),xA=re(e=>Jt(e[0]),(e,t)=>{if(!(t!=null&&t.log))return Wp(e,{onFailure:o=>ct,onSuccess:o=>ct});const n=Vk(t.log===!0?void 0:t.log);return Zl(e,{onFailure(o){const i=wT(o);return At(i)?Gt(i.failure):t.message===void 0?n(o):n(t.message,o)},onSuccess:o=>ct})}),Dh=e=>EA(e,{onFailure:rr,onSuccess:qr}),Zl=re(2,(e,t)=>{const n=Object.create(wA);return n[Ae]=e,n[Fn]=t.onSuccess.length!==1?o=>t.onSuccess(o):t.onSuccess,n[vr]=t.onFailure.length!==1?o=>t.onFailure(o):t.onFailure,n}),wA=Xa({op:"OnSuccessAndFailure",[Tt](e){return e._stack.push(this),this[Ae]}}),Wp=re(2,(e,t)=>Zl(e,{onFailure:n=>{const o=n.reasons.find(Fp);return o?tn(()=>t.onFailure(o.error)):Gt(n)},onSuccess:t.onSuccess})),kA=re(2,(e,t)=>Wp(e,{onFailure:n=>kt(()=>t.onFailure(n)),onSuccess:n=>kt(()=>t.onSuccess(n))})),EA=re(2,(e,t)=>{if(In(e)){if(e._tag==="Success")return ut(t.onSuccess(e.value));const n=yo(e.cause);return At(n)?e:ut(t.onFailure(n.success))}return kA(e,t)}),ef=e=>In(e)?ut(e):_A(e),_A=ir({op:"Exit",[Tt](e){return e._stack.push(this),this[Ae]},[Fn](e,t,n){return Re(n??ut(e))},[vr](e,t,n){return Re(n??Bn(e))}}),CA=re(2,(e,t)=>Za(Yp(t),e)),Ek=re(2,(e,t)=>Sk(e,$e(Yp(t.duration),t.orElse))),bA=re(2,(e,t)=>Ek(e,{duration:t,orElse:()=>Jl(new uM)})),MS="~effect/Scope",LS="~effect/Scope/Closeable",tf=qn("effect/Scope"),_k=(e,t)=>Et(()=>Ck(e,t)??ct),Ck=(e,t)=>{if(e.state._tag==="Closed")return;const n={_tag:"Closed",exit:t};if(e.state._tag==="Empty"){e.state=n;return}const{finalizers:o}=e.state;if(e.state=n,o.size!==0)return o.size===1?o.values().next().value(t):PA(e,o,t)},PA=pk(function*(e,t,n){let o=[];const i=[],c=Array.from(t.values()),l=Bp();for(let d=c.length-1;d>=0;d--){const h=c[d];e.strategy==="sequential"?o.push(yield*ef(h(n))):i.push(sf(l,h(n),!0,!0,"inherit"))}return i.length>0&&(o=yield*dk(i)),yield*iA(o)}),FA=(e,t)=>{const n=Kp(t);if(e.state._tag==="Closed")return n.state=e.state,n;const o={};return Ua(e,o,i=>_k(n,i)),Ua(n,o,i=>kt(()=>Hp(e,o))),n},hi=(e,t)=>Et(()=>e.state._tag==="Closed"?t(e.state.exit):(Ua(e,{},t),ct)),IA=(e,t)=>hi(e,_s(t)),Ua=(e,t,n)=>{e.state._tag==="Empty"?e.state={_tag:"Open",finalizers:new Map([[t,n]])}:e.state._tag==="Open"&&e.state.finalizers.set(t,n)},Hp=(e,t)=>{e.state._tag==="Open"&&e.state.finalizers.delete(t)},Kp=(e="sequential")=>({[LS]:LS,[MS]:MS,strategy:e,state:RA}),RA={_tag:"Empty"},bk=tf.asEffect(),TA=tc(tf),Pk=e=>Et(()=>{const t=Kp();return Is(e(t),n=>Et(()=>Ck(t,n)??ct))}),AA=(e,t,n)=>wk(o=>Ak(i=>$e(bk,c=>yk(n!=null&&n.interruptible?i(e):e,l=>hi(c,d=>ec(t(l,d),o)))))),Fk=ir({op:"OnExit",single:!1,[Tt](e){return e._stack.push(this),this[Ae][0]},[lo](e){e.interruptible&&this[Ae][2]!==!0&&(e._stack.push(nf),e.interruptible=!1)},[Fn](e,t,n){n??(n=ut(e));const o=this[Ae][1](n);return o?$e(o,i=>n):n},[vr](e,t,n){n??(n=Bn(e));const o=this[Ae][1](n);return o?$e(o,i=>n):n}}),Is=re(2,Fk),MA=re(2,(e,t)=>Is(e,n=>t)),LA=re(3,(e,t,n)=>Is(e,o=>{const i=t(o);return At(i)?ct:n(i.success,o)})),OA=re(2,(e,t)=>LA(e,tA,t)),NA=re(3,(e,t,n)=>Is(e,o=>{if(o._tag!=="Failure")return ct;const i=t(o.cause);return At(i)?ct:n(i.success,o.cause)})),DA=re(2,(e,t)=>NA($p,t)(e)),jA=He(e=>Gt(jp(e.id))),Ik=e=>He(t=>(t.interruptible&&(t.interruptible=!1,t._stack.push(nf)),e)),Rk=ir({op:"SetInterruptible",[lo](e){if(e.interruptible=this[Ae],e._interruptedCause&&e.interruptible)return()=>Gt(e._interruptedCause)}}),nf=Rk(!0),$A=Rk(!1),Tk=e=>He(t=>t.interruptible?e:(t.interruptible=!0,t._stack.push($A),t._interruptedCause?Gt(t._interruptedCause):e)),Ak=e=>He(t=>t.interruptible?(t.interruptible=!1,t._stack.push(nf),e(Tk)):e(Ie)),UA=(e,t)=>eI(e)?(t==null?void 0:t.mode)==="result"?Js(e,Dh,t):Js(e,Ie,t):t!=null&&t.discard?t.mode==="result"?Js(Object.values(e),Dh,t):Js(Object.values(e),Ie,t):Et(()=>{const n={};return Si(Js(Object.entries(e),([o,i])=>Dt((t==null?void 0:t.mode)==="result"?Dh(i):i,c=>{n[o]=c}),{discard:!0,concurrency:t==null?void 0:t.concurrency}),n)}),Qp=ir({op:"While",[Fn](e,t){return this[Ae].step(e),this[Ae].while()?(t._stack.push(this),this[Ae].body()):Vn},[Tt](e){return this[Ae].while()?(e._stack.push(this),this[Ae].body()):Vn}}),Js=re(e=>typeof e[1]=="function",(e,t,n)=>He(o=>{const i=(n==null?void 0:n.concurrency)==="inherit"?o.getRef(uT):(n==null?void 0:n.concurrency)??1,c=i==="unbounded"?Number.POSITIVE_INFINITY:Math.max(1,i);if(c===1)return BA(e,t,n);const l=xr(e);let d=l.length;if(d===0)return n!=null&&n.discard?ct:Re([]);const h=n!=null&&n.discard?void 0:new Array(d),p=zA({f:t,out:h},l,{concurrency:c});return p?Si(p,h):Re(h)})),BA=(e,t,n)=>Et(()=>{const o=n!=null&&n.discard?void 0:[],i=e[Symbol.iterator]();let c=i.next(),l=0;return Si(Qp({while:()=>!c.done,body:()=>t(c.value,l++),step:d=>{o&&o.push(d),c=i.next()}}),o)}),Mk=e=>{const t=e.onItem,n=e.step;return(o,i,c)=>{let l=(c==null?void 0:c.start)??0;const d=(c==null?void 0:c.end)??i.length,h=(c==null?void 0:c.concurrency)??1;let p=!1,y,g,v,w=!1,S,E;const P=()=>{let H=!1;for(;!S&&l<d;l++){const _=i[l],O=E??t(o,_,l);if(In(O)){if(S=n(o,_,O,l),S)break}else{if(h===1)return $e(ef(O),C=>(S=n(o,_,C,l),l++,S??P()??ct));if(y){E=void 0;const C=sf(y,O,!0,!0,"inherit");if(C._exit){if(S=n(o,_,C._exit,l),S)break;continue}g?g.add(C):g=new Set([C]);const D=l;if(C.addObserver(T=>{if(g.delete(C),S){if(!w&&T._tag==="Failure")for(const L of T.cause.reasons)L._tag!=="Interrupt"&&(S._tag==="Failure"?S.cause.reasons.push(L):S=Bn(Na([L])))}else{const L=n(o,_,T,D);L&&(S=L._tag==="Failure"?Bn(Na(L.cause.reasons.slice())):L,P())}if(H){const L=P();L&&v(L)}else p&&g.size===0&&v(S??ct)}),g.size<h)continue;H=!0,l++;return}else return ar(C=>{y=Bp(),E=O,v=C;const D=P();return D?C(D):Et(()=>(S=Vn,w=!0,g?cl(g):ct))})}}if(p=!0,S){if(g&&g.size>0){const _=Ql(y);g.forEach(O=>O.interruptUnsafe(y.id,_));return}if(v||S._tag==="Failure")return S}else if(v)if(g)g.size===0&&v(ct);else return Vn};return P()}},rf=()=>Mk,zA=Mk({onItem(e,t,n){return e.f(t,n)},step(e,t,n,o){if(n._tag==="Failure")return n;e.out&&(e.out[o]=n.value)}}),sf=(e,t,n=!1,o=!1,i=!1)=>{const c=i==="inherit"?e.interruptible:!i,l=new lk(e.context,c);return n?l.evaluate(t):e.currentDispatcher.scheduleTask(()=>l.evaluate(t),0),!o&&!l._exit&&(e.children().add(l),l.addObserver(()=>e._children.delete(l))),l},Lk=re(e=>Jt(e[0]),(e,t,n)=>He(o=>{const i=sf(o,e,n==null?void 0:n.startImmediately,!0,n==null?void 0:n.uninterruptible);if(!i._exit)if(t.state._tag!=="Closed"){const c={};Ua(t,c,()=>UT(d=>d===i.id?ct:zp(i))),i.addObserver(()=>Hp(t,c))}else i.interruptUnsafe(o.id,Ql(o));return Re(i)})),VA=re(e=>Jt(e[0]),(e,t)=>$e(bk,n=>Lk(e,n,t))),rc=e=>(t,n)=>{const o=new lk(n!=null&&n.scheduler?Fs(e,X1,n.scheduler):e,(n==null?void 0:n.uninterruptible)!==!0);if(o.evaluate(t),o._exit)return o;if(n!=null&&n.signal)if(n.signal.aborted)o.interruptUnsafe();else{const i=()=>o.interruptUnsafe();n.signal.addEventListener("abort",i,{once:!0}),o.addObserver(()=>n.signal.removeEventListener("abort",i))}return n!=null&&n.onFiberStart&&n.onFiberStart(o),o},qA=re(2,(e,t)=>{if(e._exit)return e;if(t.state._tag==="Closed")return e.interruptUnsafe(e.id),e;const n={};return Ua(t,n,()=>zp(e)),e.addObserver(()=>Hp(t,n)),e}),WA=rc(sr()),Ok=e=>{const t=rc(e);return(n,o)=>{const i=t(n,o);return o!=null&&o.onExit&&i.addObserver(o.onExit),c=>i.interruptUnsafe(c)}},HA=Ok(sr()),Jp=e=>{const t=rc(e);return(n,o)=>{const i=t(n,o);return new Promise(c=>{i.addObserver(l=>c(l))})}},KA=Jp(sr()),Nk=e=>{const t=Jp(e);return(n,o)=>t(n,o).then(i=>{if(i._tag==="Failure")throw Up(i.cause);return i.value})},QA=Nk(sr()),Gp=e=>{const t=rc(e);return n=>{var c;if(In(n))return n;const o=new ek("sync"),i=t(n,{scheduler:o});return(c=i.currentDispatcher)==null||c.flush(),i._exit??li(new lM(i))}},JA=Gp(sr()),Dk=e=>{const t=Gp(e);return n=>{const o=t(n);if(o._tag==="Failure")throw Up(o.cause);return o.value}},GA=Dk(sr()),OS=Re(!0),NS=Re(!1);class YA{constructor(t){M(this,"waiters",[]);M(this,"scheduled",!1);M(this,"isOpen");M(this,"flushWaiters",()=>{this.scheduled=!1;const t=this.waiters;this.waiters=[];for(let n=0;n<t.length;n++)t[n](Vn)});M(this,"open",He(t=>this.isOpen?NS:(this.isOpen=!0,this.scheduleUnsafe(t))));M(this,"release",He(t=>this.isOpen?NS:this.scheduleUnsafe(t)));M(this,"await",ar(t=>this.isOpen?t(ct):(this.waiters.push(t),kt(()=>{const n=this.waiters.indexOf(t);n!==-1&&this.waiters.splice(n,1)}))));M(this,"close",kt(()=>this.closeUnsafe()));M(this,"whenOpen",t=>$e(this.await,()=>t));this.isOpen=t}scheduleUnsafe(t){return this.scheduled||this.waiters.length===0||(this.scheduled=!0,t.currentDispatcher.scheduleTask(this.flushWaiters,0)),OS}openUnsafe(){return this.isOpen?!1:(this.isOpen=!0,this.flushWaiters(),!0)}closeUnsafe(){return this.isOpen?(this.isOpen=!1,!0):!1}}const XA=e=>new YA(e??!1),Cm=BigInt(0),ZA={_tag:"Span",spanId:"noop",traceId:"noop",sampled:!1,status:{_tag:"Ended",startTime:Cm,endTime:Cm,exit:Vn},attributes:new Map,links:[],kind:"internal",attribute(){},event(){},end(){},addLinks(){}},eM=e=>Object.assign(Object.create(ZA),e),jk=e=>e?ro(e.annotations,km)?e._tag==="Span"?jk(B1(e.parent)):zn():Ne(e):zn(),$k=(e,t,n)=>{const o=!e.getRef(lT)||(n==null?void 0:n.annotations)&&ro(n.annotations,km),i=(n==null?void 0:n.parent)!==void 0?Ne(n.parent):n!=null&&n.root?zn():jk(e.currentSpan);let c;if(o)c=eM({name:t,parent:i,annotations:Fs((n==null?void 0:n.annotations)??sr(),km,!0)});else{const l=e.getRef(iT),d=e.getRef(xi),h=e.getRef(sk),p=e.getRef(fT),y=e.getRef(dT),g=(n==null?void 0:n.level)??e.getRef(sT),v=(n==null?void 0:n.links)!==void 0?[...y,...n.links]:y.slice();c=l.span({name:t,parent:i,annotations:(n==null?void 0:n.annotations)??sr(),links:v,startTime:h?d.currentTimeNanosUnsafe():BigInt(0),kind:(n==null?void 0:n.kind)??"internal",root:(n==null?void 0:n.root)??go(i),sampled:(n==null?void 0:n.sampled)??(ks(i)&&i.value.sampled===!1?!1:!Bk(e.getRef(oT),g))});for(const[w,S]of Object.entries(p))c.attribute(w,S);if((n==null?void 0:n.attributes)!==void 0)for(const[w,S]of Object.entries(n.attributes))c.attribute(w,S)}return c},tM=(e,t)=>Ik(He(n=>{const o=Hl(n.context,tf),i=$k(n,e,t??{}),c=n.getRef(xi),l=n.getRef(sk);return Si(hi(o,d=>rM(i,d,c,l)),i)})),nM=(e,t)=>(t=typeof t=="function"?t:Nl,xk(rk,n=>({name:e,stack:t,parent:n}))),rM=(e,t,n,o)=>kt(()=>{e.status._tag!=="Ended"&&e.end(o?n.currentTimeNanosUnsafe():Cm,t)}),sM=(e,...t)=>{const n=t.length===1?void 0:t[0],o=t[t.length-1];return He(i=>{const c=$k(i,e,n),l=i.getRef(xi);return Is(tn(()=>o(c)),d=>kt(()=>{c.status._tag!=="Ended"&&c.end(l.currentTimeNanosUnsafe(),d)}))})},DS=tc(nT),oM=function(){const e=Jt(arguments[0]),t=e?arguments[1]:arguments[0];let n=e?arguments[2]:arguments[1],o=Ie;return t._tag==="Span"&&(n=gT(n),o=nM(t.name,n==null?void 0:n.captureStackTrace)),e?DS(o(arguments[0]),t):i=>DS(o(i),t)},xi=rt("effect/Clock",{defaultValue:()=>new aM}),iM=2**31-1;class aM{constructor(){M(this,"currentTimeMillis",kt(()=>this.currentTimeMillisUnsafe()));M(this,"currentTimeNanos",kt(()=>this.currentTimeNanosUnsafe()))}currentTimeMillisUnsafe(){return Date.now()}currentTimeNanosUnsafe(){return cM()}sleep(t){const n=J1(t);return n<=0?Vp:ar(o=>{if(n>iM)return;const i=setTimeout(()=>o(ct),n);return kt(()=>clearTimeout(i))})}}const jS=(function(){const e=BigInt(1e6);if(typeof performance>"u"||typeof performance.now>"u")return()=>BigInt(Date.now())*e;if(typeof performance.timeOrigin=="number"&&performance.timeOrigin===0)return()=>BigInt(Math.round(performance.now()*1e6));const t=BigInt(Date.now())*e-BigInt(Math.round(performance.now()*1e6));return()=>t+BigInt(Math.round(performance.now()*1e6))})(),cM=(function(){const e=typeof process=="object"&&"hrtime"in process&&typeof process.hrtime.bigint=="function"?process.hrtime:void 0;if(!e)return jS;const t=jS()-e.bigint();return()=>t+e.bigint()})(),Uk=e=>He(t=>e(t.getRef(xi))),Yp=e=>Uk(t=>t.sleep(Op(e))),$S="~effect/Cause/TimeoutError";var iw,aw;class uM extends(aw=Rp("TimeoutError"),iw=$S,aw){constructor(n){super({message:n});M(this,iw,$S)}}const US="~effect/Cause/AsyncFiberError";var cw,uw;class lM extends(uw=Rp("AsyncFiberError"),cw=US,uw){constructor(n){super({message:"An asynchronous Effect was executed with Effect.runSync",fiber:n});M(this,cw,US)}}const fM=rt("effect/Console/CurrentConsole",{defaultValue:()=>globalThis.console}),dM=e=>{switch(e){case"All":return Number.MIN_SAFE_INTEGER;case"Fatal":return 5e4;case"Error":return 4e4;case"Warn":return 3e4;case"Info":return 2e4;case"Debug":return 1e4;case"Trace":return 0;case"None":return Number.MAX_SAFE_INTEGER}},hM=XI(Mp,dM),Bk=$1(hM),mM=rt("effect/Loggers/CurrentLoggers",{defaultValue:()=>new Set([kM,EM])}),pM=rt("effect/Logger/LogToStderr",{defaultValue:f1}),gM="~effect/Logger",yM={[gM]:{_Message:Ie,_Output:Ie},pipe(){return jt(this,arguments)}},zk=e=>{const t=Object.create(yM);return t.log=e,t},vM=e=>e.replace(/[\s="]/g,"_"),SM=(e,t)=>`${vM(e[0])}=${t-e[1]}ms`,Vk=e=>(...t)=>{let n;for(let o=0,i=t.length;o<i;o++){const c=t[o];Vl(c)&&(n?t.splice(o,1):t=t.slice(0,o).concat(t.slice(o+1)),n=n?Na(n.reasons.concat(c.reasons)):c,o--)}return n===void 0&&(n=LI),He(o=>{const i=e??o.currentLogLevel;if(Bk(o.minimumLogLevel,i))return ct;const c=o.getRef(xi),l=o.getRef(mM);if(l.size>0){const d=new Date(c.currentTimeMillisUnsafe());for(const h of l)h.log({cause:n,fiber:o,date:d,logLevel:i,message:t})}return ct})},xM=e=>`${e.getHours().toString().padStart(2,"0")}:${e.getMinutes().toString().padStart(2,"0")}:${e.getSeconds().toString().padStart(2,"0")}.${e.getMilliseconds().toString().padStart(3,"0")}`,wM=typeof process=="object"&&process!==null&&typeof process.stdout=="object"&&process.stdout!==null;wM&&process.stdout.isTTY;const kM=zk(({cause:e,date:t,fiber:n,logLevel:o,message:i})=>{const c=Array.isArray(i)?i.slice():[i];e.reasons.length>0&&c.push(ck(e));const l=t.getTime(),d=n.getRef(pT);let h="";for(const v of d)h+=` ${SM(v,l)}`;const p=n.getRef(Dp);Object.keys(p).length>0&&c.push(p);const y=n.getRef(fM);(n.getRef(pM)?y.error:y.log)(`[${xM(t)}] ${o.toUpperCase()} (#${n.id})${h}:`,...c)}),EM=zk(({cause:e,fiber:t,logLevel:n,message:o})=>{const i=t.getRef(xi),c=t.getRef(Dp),l=t.currentSpan;if(l===void 0||l._tag==="ExternalSpan")return;const d={};for(const[h,p]of Object.entries(c))d[h]=p;d["effect.fiberId"]=t.id,d["effect.logLevel"]=n.toUpperCase(),e.reasons.length>0&&(d["effect.cause"]=ck(e)),l.event(bI(Array.isArray(o)&&o.length===1?o[0]:o),i.currentTimeNanosUnsafe(),d)}),_M=Vl,CM=MI,bm=Na,Pm=e=>new k1(e),Fm=e=>new _1(e),Im=xT,bM=CT,qk=Up,sc=yo,PM=ET,FM=$p,Xp=BI,of=VI,IM=w1,jh=ut,Ca=Bn,oc=Er,RM=li,TM=ZT,Wk=Vn,Hk=qp,Kk=eA,AM=aA,MM="~effect/Deferred",LM={[MM]:{_A:Ie,_E:Ie},pipe(){return jt(this,arguments)}},Zp=()=>{const e=Object.create(LM);return e.resumes=void 0,e.effect=void 0,e},eg=e=>ar(t=>e.effect?t(e.effect):(e.resumes??(e.resumes=[]),e.resumes.push(t),kt(()=>{const n=e.resumes.indexOf(t);e.resumes.splice(n,1)}))),OM=re(2,(e,t)=>kt(()=>ba(e,t))),Qk=OM,ba=(e,t)=>{if(e.effect)return!1;if(e.effect=t,e.resumes){for(let n=0;n<e.resumes.length;n++)e.resumes[n](t);e.resumes=void 0}return!0},NM=re(2,(e,t)=>Ak(n=>$e(ef(n(e)),o=>Qk(t,o)))),DM=Dp,BS=tf,tg=Kp,ul=TA,jM=hi,$M=IA,ll=FA,af=_k,UM="~effect/Layer",zS="~effect/Layer/MemoMap",BM={[UM]:{_ROut:Ie,_E:Ie,_RIn:Ie},pipe(){return jt(this,arguments)}},Jk=e=>{const t=Object.create(BM);return t.build=e,t},ng=e=>Jk((t,n)=>{const o=ll(n);return Is(e(t,o),i=>i._tag==="Failure"?af(o,i):ct)}),zM=e=>{const t=ng((n,o)=>n.getOrElseMemoize(t,o,e));return t};class VM{constructor(){M(this,"map",new Map)}get[zS](){return zS}getOrElseMemoize(t,n,o){if(this.map.has(t)){const d=this.map.get(t);return d.observers++,Za(hi(n,h=>d.finalizer(h)),d.effect)}const i=tg(),c=Zp(),l={observers:1,effect:eg(c),finalizer:d=>Et(()=>(l.observers--,l.observers===0?(this.map.delete(t),af(i,d)):ct))};return this.map.set(t,l),hi(n,l.finalizer).pipe($e(()=>o(this,i)),Is(d=>(l.effect=d,Qk(c,d))))}}const rg=()=>new VM,Il=class Il extends qn()("effect/Layer/CurrentMemoMap"){};M(Il,"getOrCreate",_R(Il,rg));let Ba=Il;const sg=re(3,(e,t,n)=>tc(Dt(e.build(t,n),Fs(Ba,t)),Ba,t)),qM=re(2,(e,t)=>He(n=>sg(e,Ba.getOrCreate(n.context),t))),og=function(){return arguments.length===1?e=>VS(fi(arguments[0],e)):VS(fi(arguments[0],arguments[1]))},VS=e=>Jk(_s(Re(e))),Rm=function(){return arguments.length===1?e=>qS(arguments[0],e):qS(arguments[0],arguments[1])},qS=(e,t)=>Tm(Dt(t,n=>fi(e,n))),Tm=e=>zM((t,n)=>ul(e,n)),Gk=(e,t,n)=>{const o=ll(n,"parallel");return Js(e,i=>i.build(t,ll(o,"sequential")),{concurrency:e.length}).pipe(Dt(i=>FR(...i)))},Yk=(...e)=>ng((t,n)=>Gk(e,t,n)),WM=(e,t,n)=>ng((o,i)=>$e(Array.isArray(t)?Gk(t,o,i):t.build(o,i),c=>e.build(o,i).pipe(ec(c),Dt(l=>n(l,c))))),Am=re(2,(e,t)=>WM(e,t,Ie)),HM=class extends Ol{constructor(t){super(),t&&Object.assign(this,t)}},fl=re(2,(e,t)=>kk(e,JM,n=>t(n))),WS=e=>e.reasons.some(KM),KM=e=>e._tag==="Fail"&&Xp(e.error),QM=Y1(sc,e=>Xp(e)?qr(e):rr(e)),JM=Y1(sc,e=>Xp(e)?qr(e.value):rr(e)),Xk=re(2,(e,t)=>Zl(e,{onSuccess:t.onSuccess,onFailure:n=>{const o=QM(n);return At(o)?t.onFailure(o.failure):t.onDone(o.success.value)}})),Zk="~effect/Schedule",HS=rt("effect/Schedule/CurrentMetadata",{defaultValue:_s({input:void 0,output:void 0,duration:Np,attempt:0,start:0,now:0,elapsed:0,elapsedSincePrevious:0})}),GM={[Zk]:{_Out:Ie,_In:Ie,_Env:Ie},pipe(){return jt(this,arguments)}},YM=e=>Ue(e,Zk),cf=e=>{const t=Object.create(GM);return t.step=e,t},ig=()=>{let e=0,t,n;return(o,i)=>{n===void 0&&(n=o);const c=o-n,l=t===void 0?0:o-t;return t=o,{input:i,attempt:++e,start:n,now:o,elapsed:c,elapsedSincePrevious:l}}},eE=e=>cf(Dt(e,t=>{const n=ig();return(o,i)=>t(n(o,i))})),za=e=>nc(e.step,t=>Re(()=>Gt(t))),XM=e=>Uk(t=>Dt(za(e),n=>{const o=ig();return i=>Et(()=>{const c=t.currentTimeMillisUnsafe();return $e(n(c,i),([l,d])=>{const h=o(c,i);return h.output=l,h.duration=d,Si(Yp(d),h)})})})),ZM=re(2,(e,t)=>eL(e,t,(n,o)=>[n,o])),eL=re(3,(e,t,n)=>cf(Dt(fA(za(e),za(t)),([o,i])=>(c,l)=>Xk(o(c,l),{onSuccess:d=>i(c,l).pipe(Dt(h=>[n(d[0],h[0]),KR(d[1],h[1])]),fl(h=>Re([n(d[0],h),d[1]]))),onFailure:Gt,onDone:d=>i(c,l).pipe(Dt(h=>[n(d,h[0]),h[1]]),fl(h=>of(n(d,h))))})))),tL=(e,t=2)=>{const n=J1(Op(e));return eE(Re(o=>{const i=ja(n*Math.pow(t,o.attempt-1));return Re([i,i])}))},tE=e=>cf(Dt(za(e),t=>(n,o)=>Xk(t(n,o),{onSuccess:i=>Re([o,i[1]]),onFailure:Gt,onDone:()=>of(o)}))),nL=e=>Vu(rE,({attempt:t})=>Re(t<=e)),nE=e=>{const t=Op(e);return eE(Re(n=>Re([n.attempt-1,t])))},Vu=re(2,(e,t)=>cf(Dt(za(e),n=>{const o=ig();return(i,c)=>$e(n(i,c),l=>{const[d,h]=l,p=t({...o(i,c),output:d,duration:h});return $e(Jt(p)?p:Re(p),y=>y?Re(l):of(d))})}))),rE=nE(Np),rL=(e,t,n)=>Pk(o=>$e(n!=null&&n.local?sg(t,rg(),o):qM(t,o),i=>ec(e,i))),sL=re(e=>Jt(e[0]),(e,t,n)=>W1(t)?ec(e,t):rL(e,Array.isArray(t)?Yk(...t):t,n)),oL=re(3,(e,t,n)=>$e(XM(t),o=>{let i=HS.defaultValue(),c;const l=Xl(Et(()=>tc(e,HS,i)),d=>(c=d,$e(o(d),h=>(i=h,l))));return fl(l,d=>tn(()=>n(c,d)))})),iL=re(2,(e,t)=>{const n=typeof t=="function"?t(Ie):YM(t)?t:cL(t);return oL(e,n,Jl)}),aL=tE(rE),cL=e=>{let t=e.schedule?tE(e.schedule):aL;return e.while&&(t=Vu(t,({input:n})=>{const o=e.while(n);return Jt(o)?o:Re(o)})),e.until&&(t=Vu(t,({input:n})=>{const o=e.until(n);return Jt(o)?Dt(o,i=>!i):Re(!o)})),e.times!==void 0&&(t=Vu(t,({attempt:n})=>Re(n<=e.times))),t},ii=Jt,sE=Js,oE=Qp,uL=$T,lt=Re,ag=jT,lL=DT,wr=Et,Un=kt,ht=ct,KS=ar,fL=zT,Mm=VT,Je=Jl,dL=Gt,hL=Gl,dl=He,Rn=$e,mL=QT,pL=Za,gL=yk,QS=ef,Rs=Dt,hl=nc,yL=gA,qu=SA,vL=pA,SL=iL,xL=xA,wL=bA,iE=Ek,kL=CA,aE=Sk,EL=Zl,ml=uA,cE=wk,_L=sL,so=ec,CL=cA,bL=Yl,PL=tc,FL=Pk,uE=AA,lE=MA,IL=OA,fE=Is,Lm=jA,cg=Tk,RL=DA,dE=hA,TL=tM,AL=sM,JS=oM,ML=Lk,ug=VA,Om=WA,pl=rc,LL=Ok,OL=HA,Wu=QA,NL=Nk,DL=KA,jL=Jp,lg=GA,$L=Dk,hE=JA,UL=Gp,oo=pk,BL=Vk("Error"),zL=re(e=>ii(e[0]),(e,...t)=>xk(e,DM,n=>{const o={...n};return t.length===1?Object.assign(o,t[0]):o[t[0]]=t[1],o})),mE=JT,vo=GT,Va=YT,ni=KT,VL=XT,Nm=qT;function Sa(e,t,n){return t==="__proto__"?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n,e}function pE(e){return e.checks?e.checks[e.checks.length-1].annotations:e.annotations}function qL(e){return t=>{var n;return(n=pE(t))==null?void 0:n[e]}}const WL=qL("identifier"),fg=Cs(e=>{const t=WL(e);return typeof t=="string"?t:e.getExpected(fg)}),HL=e=>e.replace(/[/\\^$*+?.()|[\]{}]/g,"\\$&"),Hu=new WeakMap,gE="~effect/data/Redacted",KL=e=>Ue(e,gE),GS=(e,t)=>{const n=Object.create(QL);return Hu.set(n,e),n},QL={[gE]:{_A:e=>e},label:void 0,...Ps,toJSON(){return this.toString()},toString(){return`<redacted${Ep(this.label)?":"+this.label:""}>`},[rn](){return gt(Hu.get(this))},[sn](e){return KL(e)&&Pn(Hu.get(this),Hu.get(e))}},Dm="~effect/SchemaIssue/Issue";function JL(e){return Ue(e,Dm)}var lw;let _r=(lw=Dm,class{constructor(){M(this,lw,Dm)}toString(){return s3(this)}}),GL=class extends _r{constructor(n,o,i){super();M(this,"_tag","Filter");M(this,"actual");M(this,"filter");M(this,"issue");this.actual=n,this.filter=o,this.issue=i}};class YL extends _r{constructor(n,o,i){super();M(this,"_tag","Encoding");M(this,"ast");M(this,"actual");M(this,"issue");this.ast=n,this.actual=o,this.issue=i}}class or extends _r{constructor(n,o){super();M(this,"_tag","Pointer");M(this,"path");M(this,"issue");this.path=n,this.issue=o}}class yE extends _r{constructor(n){super();M(this,"_tag","MissingKey");M(this,"annotations");this.annotations=n}}class vE extends _r{constructor(n,o){super();M(this,"_tag","UnexpectedKey");M(this,"ast");M(this,"actual");this.ast=n,this.actual=o}}class Qt extends _r{constructor(n,o,i){super();M(this,"_tag","Composite");M(this,"ast");M(this,"actual");M(this,"issues");this.ast=n,this.actual=o,this.issues=i}}class Cr extends _r{constructor(n,o){super();M(this,"_tag","InvalidType");M(this,"ast");M(this,"actual");this.ast=n,this.actual=o}}class gl extends _r{constructor(n,o){super();M(this,"_tag","InvalidValue");M(this,"actual");M(this,"annotations");this.actual=n,this.annotations=o}}class YS extends _r{constructor(n,o,i){super();M(this,"_tag","AnyOf");M(this,"ast");M(this,"actual");M(this,"issues");this.ast=n,this.actual=o,this.issues=i}}class XL extends _r{constructor(n,o,i){super();M(this,"_tag","OneOf");M(this,"ast");M(this,"actual");M(this,"successes");this.ast=n,this.actual=o,this.successes=i}}function jm(e,t){if(JL(t))return t;if(typeof t=="string")return new gl(Ne(e),{message:t});const n=typeof t.issue=="string"?new gl(Ne(e),{message:t.issue}):t.issue;return new or(t.path,n)}function ZL(e,t){if(t!==void 0)return typeof t=="boolean"?t?void 0:new gl(Ne(e)):jm(e,t)}function e3(e,t,n){return Array.isArray(n)?ol(n)?n.length===1?jm(e,n[0]):new Qt(t,Ne(e),V1(n,o=>jm(e,o))):void 0:ZL(e,n)}const t3=e=>{const t=qa(e);if(t!==void 0)return t;switch(e._tag){case"InvalidType":return $m(fg(e.ast),XS(e.actual));case"InvalidValue":return`Invalid data ${XS(e.actual)}`;case"MissingKey":return"Missing key";case"UnexpectedKey":return`Unexpected key with value ${yt(e.actual)}`;case"Forbidden":return"Forbidden operation";case"OneOf":return`Expected exactly one member to match the input ${yt(e.actual)}`}},n3=e=>qa(e.issue)??qa(e);function $m(e,t){return`Expected ${e}, got ${t}`}function ti(e,t,n,o){switch(e._tag){case"Filter":{const i=o(e);if(i!==void 0)return[{path:t,message:i}];switch(e.issue._tag){case"InvalidValue":return[{path:t,message:$m(SE(e.filter),yt(e.actual))}];default:return ti(e.issue,t,n,o)}}case"Encoding":return ti(e.issue,t,n,o);case"Pointer":return ti(e.issue,[...t,...e.path],n,o);case"Composite":return e.issues.flatMap(i=>ti(i,t,n,o));case"AnyOf":{const i=qa(e);if(e.issues.length===0){if(i!==void 0)return[{path:t,message:i}];const c=$m(fg(e.ast),yt(e.actual));return[{path:t,message:c}]}return e.issues.flatMap(c=>ti(c,t,n,o))}default:return[{path:t,message:n(e)}]}}function SE(e){var n;const t=(n=e.annotations)==null?void 0:n.expected;if(typeof t=="string")return t;switch(e._tag){case"Filter":return"<filter>";case"FilterGroup":return e.checks.map(o=>SE(o)).join(" & ")}}function r3(){return e=>ti(e,[],t3,n3).map(o3).join(`
|
|
82
82
|
`)}const s3=r3();function o3(e){let t=e.message;if(e.path&&e.path.length>0){const n=EI(e.path);t+=`
|
|
83
|
-
at ${n}`}return t}function qa(e){switch(e._tag){case"InvalidType":case"OneOf":case"Composite":case"AnyOf":return ga(e.ast.annotations);case"InvalidValue":case"Forbidden":return ga(e.annotations);case"MissingKey":return ga(e.annotations,"messageMissingKey");case"UnexpectedKey":return ga(e.ast.annotations,"messageUnexpectedKey");case"Filter":return ga(e.filter.annotations);case"Encoding":return qa(e.issue)}}function ga(e,t="message"){const n=e==null?void 0:e[t];if(typeof n=="string")return n}function XS(e){return go(e)?"no value provided":gt(e.value)}class mi extends Ol{constructor(n){super();M(this,"run");this.run=n}map(n){return new mi((o,i)=>this.run(o,i).pipe(mE(Lp(n))))}compose(n){return ZS(this)?n:ZS(n)?this:new mi((o,i)=>this.run(o,i).pipe(ni(c=>n.run(c,i))))}}const xE=new mi(lt);function ZS(e){return e.run===xE.run}function pi(){return xE}function gn(e){return i3(Lp(e))}function i3(e){return new mi(t=>lt(e(t)))}function a3(e){return new mi(t=>{const n=rR(t,GF);return ks(n)?lt(n):Rs(e,Ne)})}function c3(){return gn(globalThis.String)}function wE(){return gn(globalThis.Number)}const Um="~effect/SchemaTransformation/Transformation";var fw;fw=Um;const Rl=class Rl{constructor(t,n){M(this,fw,Um);M(this,"_tag","Transformation");M(this,"decode");M(this,"encode");this.decode=t,this.encode=n}flip(){return new Rl(this.encode,this.decode)}compose(t){return new Rl(this.decode.compose(t.decode),t.encode.compose(this.encode))}};let Tn=Rl;function u3(e){return Ue(e,Um)}const kE=e=>u3(e)?e:new Tn(e.decode,e.encode);function uf(e){return new Tn(gn(e.decode),gn(e.encode))}const l3=new Tn(pi(),pi());function dg(){return l3}const EE=new Tn(wE(),c3()),_E=e=>uf({decode:t=>{const n=new Error(t.message);return typeof t.name=="string"&&t.name!=="Error"&&(n.name=t.name),typeof t.stack=="string"&&(n.stack=t.stack),n},encode:t=>{const n={name:t.name,message:t.message};return e!=null&&e.includeStack&&typeof t.stack=="string"&&(n.stack=t.stack),n}});function So(e){return t=>t._tag===e}const CE=So("Declaration"),f3=So("Never"),yl=So("Literal"),d3=So("UniqueSymbol"),h3=So("Arrays"),m3=So("Objects"),p3=So("Union");class Mt{constructor(t,n){M(this,"to");M(this,"transformation");this.to=t,this.transformation=n}}const g3={};class gi{constructor(t,n,o=void 0,i=void 0){M(this,"isOptional");M(this,"isMutable");M(this,"defaultValue");M(this,"annotations");this.isOptional=t,this.isMutable=n,this.defaultValue=o,this.annotations=i}}const ex="~effect/Schema";var dw;dw=ex;class vn{constructor(t=void 0,n=void 0,o=void 0,i=void 0){M(this,dw,ex);M(this,"annotations");M(this,"checks");M(this,"encoding");M(this,"context");this.annotations=t,this.checks=n,this.encoding=o,this.context=i}toString(){return`<${this._tag}>`}}class ic extends vn{constructor(n,o,i,c,l,d){super(i,c,l,d);M(this,"_tag","Declaration");M(this,"typeParameters");M(this,"run");this.typeParameters=n,this.run=o}getParser(){const n=this.run(this.typeParameters);return(o,i)=>go(o)?ag:mE(n(o.value,this,i),Ne)}recur(n){const o=yi(this.typeParameters,n);return o===this.typeParameters?this:new ic(o,this.run,this.annotations,this.checks,void 0,this.context)}getExpected(){var o;const n=(o=this.annotations)==null?void 0:o.expected;return typeof n=="string"?n:"<Declaration>"}}let y3=class extends vn{constructor(){super(...arguments);M(this,"_tag","Null")}getParser(){return df(this,null)}getExpected(){return"null"}};const hg=new y3;let v3=class extends vn{constructor(){super(...arguments);M(this,"_tag","Undefined")}getParser(){return df(this,void 0)}toCodecJson(){return Rt(this,[bE])}getExpected(){return"undefined"}};const bE=new Mt(hg,new Tn(gn(()=>{}),gn(()=>null))),S3=new v3;let x3=class extends vn{constructor(){super(...arguments);M(this,"_tag","Void")}getParser(){return df(this,void 0)}toCodecJson(){return Rt(this,[bE])}getExpected(){return"void"}};const w3=new x3;let k3=class extends vn{constructor(){super(...arguments);M(this,"_tag","Never")}getParser(){return xo(this,XF)}getExpected(){return"never"}};const E3=new k3;let _3=class extends vn{constructor(){super(...arguments);M(this,"_tag","Any")}getParser(){return xo(this,m1)}getExpected(){return"any"}};const C3=new _3;let b3=class extends vn{constructor(){super(...arguments);M(this,"_tag","Unknown")}getParser(){return xo(this,m1)}getExpected(){return"unknown"}};const mg=new b3;let Pa=class extends vn{constructor(n,o,i,c,l){super(o,i,c,l);M(this,"_tag","Literal");M(this,"literal");if(typeof n=="number"&&!globalThis.Number.isFinite(n))throw new Error(`A numeric literal must be finite, got ${gt(n)}`);this.literal=n}getParser(){return df(this,this.literal)}toCodecJson(){return typeof this.literal=="bigint"?tx(this):this}toCodecStringTree(){return typeof this.literal=="string"?this:tx(this)}getExpected(){return typeof this.literal=="string"?JSON.stringify(this.literal):globalThis.String(this.literal)}};function tx(e){const t=globalThis.String(e.literal);return Rt(e,[new Mt(new Pa(t),new Tn(gn(()=>e.literal),gn(()=>t)))])}let P3=class extends vn{constructor(){super(...arguments);M(this,"_tag","String")}getParser(){return xo(this,Ep)}getExpected(){return"string"}};const PE=new P3;let F3=class extends vn{constructor(){super(...arguments);M(this,"_tag","Number")}getParser(){return xo(this,h1)}toCodecJson(){return this.checks&&(xa(this.checks,"isFinite")||xa(this.checks,"isInt"))?this:Rt(this,[$3])}toCodecStringTree(){return this.checks&&(xa(this.checks,"isFinite")||xa(this.checks,"isInt"))?Rt(this,[J3]):Rt(this,[G3])}getExpected(){return"number"}};function xa(e,t){return e.some(n=>{var o,i;switch(n._tag){case"Filter":return((i=(o=n.annotations)==null?void 0:o.meta)==null?void 0:i._tag)===t;case"FilterGroup":return xa(n.checks,t)}})}const FE=new F3;let I3=class extends vn{constructor(){super(...arguments);M(this,"_tag","Boolean")}getParser(){return xo(this,JF)}getExpected(){return"boolean"}};const R3=new I3;class lf extends vn{constructor(n,o,i,c,l,d,h){super(c,l,d,h);M(this,"_tag","Arrays");M(this,"isMutable");M(this,"elements");M(this,"rest");this.isMutable=n,this.elements=o,this.rest=i;const p=o.findIndex(zr);if(p!==-1&&(o.slice(p+1).some(y=>!zr(y))||i.length>1))throw new Error("A required element cannot follow an optional element. ts(1257)");if(i.length>1&&i.slice(1).some(zr))throw new Error("An optional element cannot follow a rest element. ts(1266)")}getParser(n){const o=this,i=o.elements.map(g=>({ast:g,parser:n(g)})),c=o.rest.map(g=>({ast:g,parser:n(g)})),l=i.length,[d,...h]=c,p=h.length;function y(g,v){return v<l?i[v]:v>=g?h[v-g]:d}return Nm(function*(g,v){if(g._tag==="None")return g;const w=g.value;if(!Array.isArray(w))return yield*Je(new Cr(o,g));const S=w.length,E={ast:o,getParser:y,oinput:g,len:S,tailThreshold:A3(S,l,p),output:new globalThis.Array(S),issues:void 0,options:v},P=pg(v==null?void 0:v.concurrency),H=T3(E,w,{concurrency:P==null?void 0:P.concurrency,end:o.rest.length===0?l:Math.max(S,l+p)});if(H&&(yield*H),o.rest.length===0&&S>l)for(let _=l;_<=S-1;_++){const O=new or([_],new vE(o,w[_]));if(v.errors==="all")E.issues?E.issues.push(O):E.issues=[O];else return yield*Je(new Kt(o,g,[O]))}return E.issues?yield*Je(new Kt(o,g,E.issues)):Ne(E.output)})}recur(n){const o=yi(this.elements,n),i=yi(this.rest,n);return o===this.elements&&i===this.rest?this:new lf(this.isMutable,o,i,this.annotations,this.checks,void 0,this.context)}getExpected(){return"array"}}const T3=rf()({onItem(e,t,n){const o=n<e.len?Ne(t):zn();return e.getParser(e.tailThreshold,n).parser(o,e.options)},step(e,t,n,o){var i;if(n._tag==="Failure")return vl(e,e.ast,o,n);if(n.value._tag==="Some")e.output[o]=n.value.value;else{const c=e.getParser(e.tailThreshold,o);if(zr(c.ast))return;const l=new or([o],new yE((i=c.ast.context)==null?void 0:i.annotations));if(e.options.errors==="all")e.issues?e.issues.push(l):e.issues=[l];else return oc(new Kt(e.ast,e.oinput,[l]))}}});function A3(e,t,n){return Math.max(t,e-n)}const pg=e=>(e=e==="unbounded"?1/0:e??1,e>1?{concurrency:e}:void 0),vl=(e,t,n,o)=>{const i=sc(o.cause);if(At(i))return o;const c=new or([n],i.success);if(e.options.errors==="all")e.issues?e.issues.push(c):e.issues=[c];else return oc(new Kt(t,e.oinput,[c]))},gg="[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?",M3=new globalThis.RegExp(`(?:${gg}|Infinity|-Infinity|NaN)`);function IE(e,t){const n=xs(t);switch(n._tag){case"String":return Object.keys(e);case"TemplateLiteral":{const o=W3(n);return Object.keys(e).filter(i=>o.test(i))}case"Symbol":return Object.getOwnPropertySymbols(e);case"Number":return Object.keys(e).filter(o=>M3.test(o));case"Union":return[...new Set(n.types.flatMap(o=>IE(e,o)))];default:return[]}}class RE{constructor(t,n){M(this,"name");M(this,"type");this.name=t,this.type=n}}class L3{constructor(t,n,o){M(this,"parameter");M(this,"type");M(this,"merge");if(this.parameter=t,this.type=n,this.merge=o,zr(n)&&!VE(n))throw new Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")}}class yg extends vn{constructor(n,o,i,c,l,d){super(i,c,l,d);M(this,"_tag","Objects");M(this,"propertySignatures");M(this,"indexSignatures");this.propertySignatures=n,this.indexSignatures=o;const h=n.map(p=>p.name).filter((p,y,g)=>g.indexOf(p)!==y);if(h.length>0)throw new Error(`Duplicate identifiers: ${JSON.stringify(h)}. ts(2300)`)}getParser(n){const o=this,i=[],c=new Set,l=[];for(const p of o.propertySignatures)i.push(p.name),c.add(p.name),l.push({ps:p,parser:n(p.type),name:p.name,type:p.type});const d=o.indexSignatures.length;if(o.propertySignatures.length===0&&o.indexSignatures.length===0)return xo(o,YF);const h=d>0?rf()({onItem:Nm(function*(p,[y,g]){const w=n(KE(g.parameter))(Ne(y),p.options),S=In(w)?w:yield*QS(w);if(S._tag==="Failure"){const O=vl(p,o,y,S);O&&(yield*O);return}const E=Ne(p.input[y]),H=n(g.type)(E,p.options),_=In(H)?H:yield*QS(H);if(_._tag==="Failure"){const O=vl(p,o,y,_);O&&(yield*O);return}else if(S.value._tag==="Some"&&_.value._tag==="Some"){const O=S.value.value,C=_.value.value;if(g.merge&&g.merge.decode&&Object.hasOwn(p.out,O)){const[D,T]=g.merge.decode.combine([O,p.out[O]],[O,C]);Sa(p.out,D,T)}else Sa(p.out,O,C)}}),step:(p,y,g)=>g._tag==="Failure"?g:void 0}):void 0;return Nm(function*(p,y){if(p._tag==="None")return p;const g=p.value;if(!(typeof g=="object"&&g!==null&&!Array.isArray(g)))return yield*Je(new Cr(o,p));const v={},w={ast:o,oinput:p,input:g,out:v,issues:void 0,options:y},S=y.errors==="all",E=y.onExcessProperty==="error",P=y.onExcessProperty==="preserve";let H;if(o.indexSignatures.length===0&&(E||P)){H=Reflect.ownKeys(g);for(let C=0;C<H.length;C++){const D=H[C];if(!c.has(D))if(E){const T=new or([D],new vE(o,g[D]));if(S){w.issues?w.issues.push(T):w.issues=[T];continue}else return yield*Je(new Kt(o,p,[T]))}else Sa(v,D,g[D])}}const _=pg(y==null?void 0:y.concurrency),O=O3(w,l,_);if(O&&(yield*O),h){const C=SR();for(let T=0;T<d;T++){const L=o.indexSignatures[T],$=IE(g,L.parameter);for(let q=0;q<$.length;q++){const ee=$[q];C.push([ee,L])}}const D=h(w,C,_);D&&(yield*D)}if(w.issues)return yield*Je(new Kt(o,p,w.issues));if(y.propertyOrder==="original"){const C=(H??Reflect.ownKeys(g)).concat(i),D={};for(const T of C)Object.hasOwn(v,T)&&Sa(D,T,v[T]);return Ne(D)}return Ne(v)})}rebuild(n,o){const i=yi(this.propertySignatures,l=>{const d=n(l.type);return d===l.type?l:new RE(l.name,d)}),c=yi(this.indexSignatures,l=>{var y;const d=n(l.parameter),h=n(l.type),p=o?(y=l.merge)==null?void 0:y.flip():l.merge;return d===l.parameter&&h===l.type&&p===l.merge?l:new L3(d,h,p)});return i===this.propertySignatures&&c===this.indexSignatures?this:new yg(i,c,this.annotations,this.checks,void 0,this.context)}flip(n){return this.rebuild(n,!0)}recur(n){return this.rebuild(n,!1)}getExpected(){return this.propertySignatures.length===0&&this.indexSignatures.length===0?"object | array":"object"}}const O3=rf()({onItem(e,t){const n=Object.hasOwn(e.input,t.name)?Ne(e.input[t.name]):zn();return t.parser(n,e.options)},step(e,t,n){var o;if(n._tag==="Failure")return vl(e,e.ast,t.name,n);if(n.value._tag==="Some")Sa(e.out,t.name,n.value.value);else if(!zr(t.type)){const i=new or([t.name],new yE((o=t.type.context)==null?void 0:o.annotations));if(e.options.errors==="all"){e.issues?e.issues.push(i):e.issues=[i];return}else return oc(new Kt(e.ast,e.oinput,[i]))}}});function vg(e,t,n){return new yg(Reflect.ownKeys(e).map(o=>new RE(o,e[o].ast)),[],n,t)}function TE(e){return e.ast}function Sg(e,t,n){return new ac(e.map(TE),t,void 0,n)}function AE(e){switch(e._tag){case"Null":return["null"];case"Undefined":case"Void":return["undefined"];case"String":case"TemplateLiteral":return["string"];case"Number":return["number"];case"Boolean":return["boolean"];case"Symbol":case"UniqueSymbol":return["symbol"];case"BigInt":return["bigint"];case"Arrays":return["array"];case"ObjectKeyword":return["object","array","function"];case"Objects":return e.propertySignatures.length||e.indexSignatures.length?["object"]:["object","array"];case"Enum":return Array.from(new Set(e.enums.map(([,t])=>typeof t)));case"Literal":return[typeof e.literal];case"Union":return Array.from(new Set(e.types.flatMap(AE)));default:return["null","undefined","string","number","boolean","symbol","bigint","object","array","function"]}}function xg(e){var t;switch(e._tag){default:return[];case"Declaration":{const n=(t=e.annotations)==null?void 0:t["~sentinels"];return Array.isArray(n)?n:[]}case"Objects":return e.propertySignatures.flatMap(n=>{const o=n.type;if(!zr(o)){if(yl(o))return[{key:n.name,literal:o.literal}];if(d3(o))return[{key:n.name,literal:o.symbol}]}return[]});case"Arrays":return e.elements.flatMap((n,o)=>yl(n)&&!zr(n)?[{key:o,literal:n.literal}]:[]);case"Suspend":return xg(e.thunk())}}const nx=new WeakMap;function N3(e){var n,o;let t=nx.get(e);if(t)return t;t={};for(const i of e){const c=xs(i);if(f3(c))continue;const l=AE(c),d=xg(c);t.byType??(t.byType={});for(const h of l)((n=t.byType)[h]??(n[h]=[])).push(i);if(d.length>0){t.bySentinel??(t.bySentinel=new Map);for(const{key:h,literal:p}of d){let y=t.bySentinel.get(h);y||t.bySentinel.set(h,y=new Map);let g=y.get(p);g||y.set(p,g=[]),g.push(i)}}else{t.otherwise??(t.otherwise={});for(const h of l)((o=t.otherwise)[h]??(o[h]=[])).push(i)}}return nx.set(e,t),t}function rx(e){return t=>{const n=xs(t);return n._tag==="Literal"?n.literal===e:n._tag==="UniqueSymbol"?n.symbol===e:!0}}function D3(e,t){var i,c;const n=N3(t),o=e===null?"null":Array.isArray(e)?"array":typeof e;if(n.bySentinel){const l=((i=n.otherwise)==null?void 0:i[o])??[];if(o==="object"||o==="array"){for(const[d,h]of n.bySentinel)if(Object.hasOwn(e,d)){const p=h.get(e[d]);if(p)return[...p,...l].filter(rx(e))}}return l}return(((c=n.byType)==null?void 0:c[o])??[]).filter(rx(e))}let ac=class ME extends vn{constructor(n,o,i,c,l,d){super(i,c,l,d);M(this,"_tag","Union");M(this,"types");M(this,"mode");this.types=n,this.mode=o}getParser(n){const o=this;return(i,c)=>{if(i._tag==="None")return lt(i);const l=i.value,d=D3(l,o.types),h={ast:o,recur:n,oinput:i,input:l,out:void 0,successes:[],issues:void 0,options:c},p=pg(c==null?void 0:c.concurrency),y=j3(h,d,p);return y?Rn(y,g=>h.out?lt(h.out):Je(new YS(o,l,h.issues??[]))):h.out?lt(h.out):Je(new YS(o,l,h.issues??[]))}}recur(n){const o=yi(this.types,n);return o===this.types?this:new ME(o,this.mode,this.annotations,this.checks,void 0,this.context)}getExpected(n){var c;const o=(c=this.annotations)==null?void 0:c.expected;if(typeof o=="string")return o;if(this.types.length===0)return"never";const i=this.types.map(l=>{const d=xs(l);switch(d._tag){case"Arrays":{const h=d.elements.filter(yl);if(h.length>0)return`${sx(d.isMutable)}[ ${h.map(p=>{var y;return n(p)+ox((y=p.context)==null?void 0:y.isOptional)}).join(", ")}, ... ]`;break}case"Objects":{const h=d.propertySignatures.filter(p=>yl(p.type));if(h.length>0)return`{ ${h.map(p=>{var y,g;return`${sx((y=p.type.context)==null?void 0:y.isMutable)}${sl(p.name)}${ox((g=p.type.context)==null?void 0:g.isOptional)}: ${n(p.type)}`}).join(", ")}, ... }`;break}}return n(d)});return Array.from(new Set(i)).join(" | ")}};const j3=rf()({onItem(e,t){return e.recur(t)(e.oinput,e.options)},step(e,t,n){if(n._tag==="Failure"){const o=sc(n.cause);if(At(o))return n;e.issues?e.issues.push(o.success):e.issues=[o.success]}else{if(e.out&&e.ast.mode==="oneOf")return e.successes.push(t),oc(new XL(e.ast,e.input,e.successes));if(e.out=n.value,e.successes.push(t),e.ast.mode==="anyOf")return Wk}}}),LE=new ac([new Pa("Infinity"),new Pa("-Infinity"),new Pa("NaN")],"anyOf"),$3=new Mt(new ac([FE,LE],"anyOf"),new Tn(wE(),gn(e=>globalThis.Number.isFinite(e)?e:globalThis.String(e))));function sx(e){return e?"":"readonly "}function ox(e){return e?"?":""}class Sl extends Ol{constructor(n,o=void 0,i=!1){super();M(this,"_tag","Filter");M(this,"run");M(this,"annotations");M(this,"aborted");this.run=n,this.annotations=o,this.aborted=i}annotate(n){return new Sl(this.run,{...this.annotations,...n},this.aborted)}abort(){return new Sl(this.run,this.annotations,!0)}and(n,o){return new xl([this,n],o)}}class xl extends Ol{constructor(n,o=void 0){super();M(this,"_tag","FilterGroup");M(this,"checks");M(this,"annotations");this.checks=n,this.annotations=o}annotate(n){return new xl(this.checks,{...this.annotations,...n})}and(n,o){return new xl([this,n],o)}}function OE(e,t,n=!1){return new Sl((o,i,c)=>e3(o,i,e(o,i,c)),t,n)}function NE(e,t){const n=e.source;return OE(o=>e.test(o),{expected:`a string matching the RegExp ${n}`,meta:{_tag:"isPattern",regExp:e},toArbitraryConstraint:{string:{patterns:[e.source]}},...t})}function ff(e,t){const n=Object.getOwnPropertyDescriptors(e);return t(n),Object.create(Object.getPrototypeOf(e),n)}function Rt(e,t){return e.encoding===t?e:ff(e,n=>{n.encoding.value=t})}function wg(e,t){return e.context===t?e:ff(e,n=>{n.context.value=t})}function DE(e,t){if(e.checks){const n=e.checks[e.checks.length-1];return jE(e,z1(e.checks.slice(0,-1),n.annotate(t)))}return ff(e,n=>{n.annotations.value={...n.annotations.value,...t}})}function jE(e,t){return e.checks===t?e:ff(e,n=>{n.checks.value=t})}function kg(e,t){return jE(e,e.checks?[...e.checks,...t]:t)}function $E(e,t){const n=e,o=n[n.length-1],i=t(o.to);return i!==o.to?z1(e.slice(0,e.length-1),new Mt(i,o.transformation)):e}function U3(e){return t=>t.encoding?Rt(t,$E(t.encoding,e)):t}function B3(e,t,n){const o=new Mt(e,t);return Rt(n,n.encoding?[...n.encoding,o]:[o])}function yi(e,t){let n=!1;const o=new Array(e.length);for(let i=0;i<e.length;i++){const c=e[i],l=t(c);l!==c&&(n=!0),o[i]=l}return n?o:e}function UE(e,t){const n=e.context?new gi(e.context.isOptional,e.context.isMutable,e.context.defaultValue,{...e.context.annotations,...t}):new gi(!1,!1,void 0,t);return wg(e,n)}const BE=U3(zE);function zE(e){const t=e.context?e.context.isOptional===!1?new gi(!0,e.context.isMutable,e.context.defaultValue,e.context.annotations):e.context:new gi(!0,!1);return BE(wg(e,t))}function z3(e,t){const n=new Tn(a3(t),pi()),o=[new Mt(mg,n)],i=e.context?new gi(e.context.isOptional,e.context.isMutable,o,e.context.annotations):new gi(!1,!1,o);return wg(e,i)}function V3(e,t,n){return B3(e,n,t)}function zr(e){var t;return((t=e.context)==null?void 0:t.isOptional)??!1}const wl=Cs(e=>{var n;if(e.encoding)return wl(Rt(e,void 0));const t=e;return((n=t.recur)==null?void 0:n.call(t,wl))??t}),xs=Cs(e=>wl(io(e)));function q3(e,t){const n=t,o=n.length,i=n[o-1],c=[new Mt(io(Rt(e,void 0)),n[0].transformation.flip())];for(let d=1;d<o;d++)c.unshift(new Mt(io(n[d-1].to),n[d].transformation.flip()));const l=io(i.to);return l.encoding?Rt(l,[...l.encoding,...c]):Rt(l,c)}const io=Cs(e=>{var n,o;if(e.encoding)return q3(e,e.encoding);const t=e;return((n=t.flip)==null?void 0:n.call(t,io))??((o=t.recur)==null?void 0:o.call(t,io))??t});function VE(e){switch(e._tag){case"Undefined":return!0;case"Union":return e.types.some(VE);default:return!1}}function qE(e,t){return e.encodedParts.map(n=>H3(n,WE(n),t)).join("")}const W3=Cs(e=>new globalThis.RegExp(`^${qE(e,!0)}$`));function WE(e){switch(e._tag){case"Literal":return HL(globalThis.String(e.literal));case"String":return K3;case"Number":return gg;case"BigInt":return Y3;case"TemplateLiteral":return qE(e,!1);case"Union":return e.types.map(WE).join("|")}}function H3(e,t,n){if(p3(e)){if(!n)return`(?:${t})`}else if(!n)return t;return`(${t})`}function df(e,t){const n=lL(t);return o=>o._tag==="None"?ag:o.value===t?n:Je(new Cr(e,o))}function xo(e,t){return n=>n._tag==="None"?ag:t(n.value)?lt(n):Je(new Cr(e,n))}function HE(e){function t(n){return n.encoding?Rt(n,$E(n.encoding,t)):e(n)}return Cs(t)}const KE=HE(e=>{switch(e._tag){default:return e;case"Number":return e.toCodecStringTree();case"Union":return e.recur(KE)}}),K3="[\\s\\S]*?",ix=new globalThis.RegExp(`^${gg}$`);function Q3(e){return NE(ix,{expected:"a string representing a finite number",meta:{_tag:"isStringFinite",regExp:ix},...e})}const QE=kg(PE,[Q3()]),J3=new Mt(QE,EE),G3=new Mt(new ac([QE,LE],"anyOf"),EE),Y3="-?\\d+";function Bm(e,t,n,o,i){for(let c=0;c<e.length;c++){const l=e[c];if(l._tag==="FilterGroup")Bm(l.checks,t,n,o,i);else{const d=l.run(t,o,i);if(d&&(n.push(new GL(t,l,d)),l.aborted||(i==null?void 0:i.errors)!=="all"))return}}}const JE="~effect/Schema/Class",X3="~structural";function Z3(e){const t=new Set,n=new Set;return o(e);function o(i){if(i===null||typeof i=="string"||typeof i=="boolean")return!0;if(typeof i=="number")return globalThis.Number.isFinite(i);if(typeof i!="object"||i===void 0||t.has(i))return!1;if(n.has(i))return!0;t.add(i);const c=Array.isArray(i)?i.every(o):Object.keys(i).every(l=>o(i[l]));return t.delete(i),c&&n.add(i),c}}const eO=new ic([],()=>(e,t)=>Z3(e)?lt(e):Je(new Cr(t,Ne(e))),{typeConstructor:{_tag:"effect/Json"},generation:{runtime:"Schema.Json",Type:"Schema.Json"},expected:"JSON value",toCodecJson:()=>new Mt(mg,dg())}),tO=new Mt(hg,new Tn(pi(),gn(()=>null))),nO=new Mt(eO,dg()),rO=fk,GE=zp,sO=cl,zm=Bp,oO=qA,YE=XA,iO=Symbol.for("effect/MutableList/Empty"),aO=()=>({head:void 0,tail:void 0,length:0}),ax=()=>({array:[],mutable:!0,offset:0,next:void 0}),Vm=(e,t)=>{e.tail?e.tail.mutable||(e.tail.next=ax(),e.tail=e.tail.next):e.head=e.tail=ax(),e.tail.array.push(t),e.length++},cO=(e,t)=>uO(e,xr(t),!Array.isArray(t)),uO=(e,t,n=!1)=>{if(t.length===0)return 0;const o={array:t,mutable:n,offset:0,next:void 0};return e.head?e.tail=e.tail.next=o:e.head=e.tail=o,e.length+=t.length,t.length},Ku=e=>{e.head=e.tail=void 0,e.length=0},XE=(e,t)=>{var c;if(t<=0||!e.head)return[];if(t=Math.min(t,e.length),t===e.length&&((c=e.head)==null?void 0:c.offset)===0&&!e.head.next){const l=e.head.array;return Ku(e),l}const n=new Array(t);let o=0,i=e.head;for(;i;){for(;i.offset<i.array.length;)if(n[o++]=i.array[i.offset],i.mutable&&(i.array[i.offset]=void 0),i.offset++,o===t)return e.head=i,e.length-=t,e.length===0&&Ku(e),n;i=i.next}return Ku(e),n},lO=e=>{if(!e.head)return iO;const t=e.head.array[e.head.offset];return e.head.mutable&&(e.head.array[e.head.offset]=void 0),e.head.offset++,e.length--,e.head.offset===e.head.array.length&&(e.head.next?e.head=e.head.next:Ku(e)),t},fO="~effect/Queue",dO="~effect/Queue/Enqueue",hO="~effect/Queue/Dequeue",$h={_A:Ie,_E:Ie},mO={[fO]:$h,[dO]:$h,[hO]:$h,...Ps,toJSON(){return{_id:"effect/Queue",state:this.state._tag,size:wO(this)}}},pO=e=>He(t=>{const n=Object.create(mO);return n.dispatcher=t.currentDispatcher,n.capacity=(e==null?void 0:e.capacity)??Number.POSITIVE_INFINITY,n.strategy=(e==null?void 0:e.strategy)??"suspend",n.messages=aO(),n.scheduleRunning=!1,n.state={_tag:"Open",takers:new Set,offers:new Set,awaiters:new Set},Re(n)}),gO=e=>pO({capacity:e}),yO=(e,t)=>Et(()=>{if(e.state._tag!=="Open")return Re(xr(t));const n=vO(e,t);return n.length===0?ut([]):e.strategy==="dropping"?Re(n):bO(e,n)}),vO=(e,t)=>{if(e.state._tag!=="Open")return xr(t);if(e.capacity===Number.POSITIVE_INFINITY||e.strategy==="sliding")return cO(e.messages,t),e.strategy==="sliding"&&XE(e.messages,e.messages.length-e.capacity),ux(e),[];const n=e.capacity<=0?e.state.takers.size:e.capacity-e.messages.length;if(n===0)return xr(t);const o=[];let i=0;for(const c of t)i<n?Vm(e.messages,c):o.push(c),i++;return ux(e),o},wa=re(2,(e,t)=>kt(()=>SO(e,t))),SO=(e,t)=>{if(e.state._tag!=="Open")return!1;const n=Bn(t),o=oA(n,EO);return e.state.offers.size===0&&e.messages.length===0?(e_(e,o),!0):(e.state={...e.state,_tag:"Closing",exit:o},!0)},cx=e=>wa(e,E1(Tp())),xO=e=>ZE(e,1,Number.POSITIVE_INFINITY),ZE=(e,t,n)=>Et(()=>CO(e,t,n)??Za(PO(e),ZE(e,1,n))),wO=e=>e.state._tag==="Done"?0:e.messages.length,kO=ut(!0),EO=Er(Tp()),_O=e=>{if(e.scheduleRunning=!1,!(e.state._tag==="Done"||e.state.takers.size===0)){for(const t of e.state.takers)if(e.state.takers.delete(t),t(Vn),e.messages.length===0)break}},ux=e=>{e.scheduleRunning||e.state._tag==="Done"||e.state.takers.size===0||(e.scheduleRunning=!0,e.dispatcher.scheduleTask(()=>_O(e),0))},CO=(e,t,n)=>{if(e.state._tag==="Done")return e.state.exit;if(n<=0||t<=0)return ut([]);if(e.capacity<=0&&e.state.offers.size>0){e.capacity=1,Uh(e),e.capacity=0;const o=[lO(e.messages)];return Uh(e),ut(o)}if(t=Math.min(t,e.capacity||1),t<=e.messages.length){const o=XE(e.messages,n);return Uh(e),ut(o)}},bO=(e,t)=>ar(n=>{if(e.state._tag!=="Open")return n(ut(t));const o={_tag:"Array",remaining:t,offset:0,resume:n};return e.state.offers.add(o),kt(()=>{e.state._tag==="Open"&&e.state.offers.delete(o)})}),Uh=e=>{if(e.state._tag==="Done")return WS(e.state.exit.cause);if(e.state.offers.size===0)return e.state._tag==="Closing"&&e.messages.length===0?(e_(e,e.state.exit),WS(e.state.exit.cause)):!1;let t=e.capacity-e.messages.length;for(const n of e.state.offers){if(t===0)break;if(n._tag==="Single")Vm(e.messages,n.message),t--,n.resume(kO),e.state.offers.delete(n);else{for(;n.offset<n.remaining.length;n.offset++){if(t===0)return!1;Vm(e.messages,n.remaining[n.offset]),t--}n.resume(ut([])),e.state.offers.delete(n)}}return!1},PO=e=>ar(t=>e.state._tag==="Done"?t(e.state.exit):(e.state.takers.add(t),kt(()=>{e.state._tag!=="Done"&&e.state.takers.delete(t)}))),e_=(e,t)=>{if(e.state._tag==="Done")return;const n=e.state;e.state={_tag:"Done",exit:t};for(const o of n.takers)o(t);n.takers.clear();for(const o of n.awaiters)o(t);n.awaiters.clear()},FO="~effect/Channel",IO={[FO]:{_Env:Ie,_InErr:Ie,_InElem:Ie,_OutErr:Ie,_OutElem:Ie},pipe(){return jt(this,arguments)}},cc=e=>{const t=Object.create(IO);return t.transform=(n,o)=>hl(e(n,o),i=>lt(dL(i))),t},RO=(e,t)=>cc((n,o)=>Rn(uc(e)(n,o),i=>t(i,o))),TO=e=>cc((t,n)=>e),uc=e=>e.transform,AO=e=>cc((t,n)=>wr(()=>uc(e())(t,n))),MO=e=>TO(lt(xO(e))),LO=re(2,(e,t)=>RO(e,n=>Un(()=>{let o=0;return Rs(n,i=>t(i,o++))}))),OO=e=>cc((t,n)=>{let o;return lt(wr(()=>o||e.pipe(ul(n),Rn(i=>uc(i)(t,n)),Rn(i=>o=i))))}),NO=(e,t,n)=>wr(()=>{const o=tg(),i=uc(e)(of(),o);return fl(Rn(i,t),lt).pipe(fE(c=>af(o,c)))}),DO=re(2,(e,t)=>cc((n,o)=>Rs(so(uc(e)(n,o),t),so(t)))),jO=re(2,(e,t)=>NO(e,n=>dE(Rn(n,t),{disableYield:!0}))),wi=e=>e,ka=Cs(e=>{var t;switch(e._tag){case"Declaration":{const n=(t=e.annotations)==null?void 0:t[JE];if(Dl(n)){const o=n(e.typeParameters),i=ka(o.to);return Rt(e,i===o.to?[o]:[new Mt(i,o.transformation)])}return e}case"Objects":case"Arrays":return e.recur(n=>{var i;const o=(i=n.context)==null?void 0:i.defaultValue;return o?Rt(ka(n),o):ka(n)});case"Suspend":return e.recur(ka);default:return e}});function hf(e){const t=ka(wl(e.ast)),n=Eg(t);return(o,i)=>n(o,i!=null&&i.disableChecks?i!=null&&i.parseOptions?{...i.parseOptions,disableChecks:!0}:{disableChecks:!0}:i==null?void 0:i.parseOptions)}function t_(e){const t=hf(e);return(n,o)=>AM(hE(t(n,o)))}function $O(e){const t=hf(e);return(n,o)=>lg(vo(t(n,o),i=>new Error(i.toString(),{cause:i})))}function fo(e){return Eg(e.ast)}function UO(e){return VO(fo(e))}const BO=UO;function zO(e){return Eg(io(e.ast))}function Eg(e){const t=Qu(e);return(n,o)=>ni(t(Ne(n),o??g3),i=>i._tag==="None"?Je(new gl(i)):lt(i.value))}function VO(e){return(t,n)=>lg(vo(e(t,n),o=>new Error(o.toString(),{cause:o})))}const Qu=Cs(e=>{var i;let t;const n=(i=pE(e))==null?void 0:i.parseOptions;if(!e.context&&!e.encoding&&!e.checks)return(c,l)=>(t??(t=e.getParser(Qu)),n&&(l={...l,...n}),t(c,l));const o=h3(e)||m3(e)||CE(e)&&e.typeParameters.length>0;return(c,l)=>{n&&(l={...l,...n});const d=e.encoding;let h;if(d){const y=d,g=y.length;for(let v=g-1;v>=0;v--){const w=y[v],S=w.to,E=Qu(S);if(h=h?ni(h,P=>E(P,l)):E(c,l),w.transformation._tag==="Transformation"){const P=w.transformation.decode;h=ni(h,H=>P.run(H,l))}else h=w.transformation.decode(h,l)}h=vo(h,v=>new YL(e,c,v))}t??(t=e.getParser(Qu));let p=h?ni(h,y=>t(y,l)):t(c,l);if(e.checks&&!(l!=null&&l.disableChecks)){const y=e.checks;(l==null?void 0:l.errors)==="all"&&o&&ks(c)&&(p=VL(p,g=>{const v=[];Bm(y.filter(S=>{var E;return(E=S.annotations)==null?void 0:E[X3]}),c.value,v,e,l);const w=_S(v)?g._tag==="Composite"&&g.ast===e?new Kt(e,g.actual,[...g.issues,...v]):new Kt(e,c,[g,...v]):g;return Je(w)})),p=ni(p,g=>{if(ks(g)){const v=g.value,w=[];if(Bm(y,v,w,e,l),_S(w))return Je(new Kt(e,g,w))}return lt(g)})}return p}}),qm="~effect/Schema/Schema",qO={[qm]:qm,pipe(){return jt(this,arguments)},annotate(e){return this.rebuild(DE(this.ast,e))},annotateKey(e){return this.rebuild(UE(this.ast,e))},check(...e){return this.rebuild(kg(this.ast,e))}};function _g(e,t){const n=Object.create(qO);return t&&Object.assign(n,t),n.ast=e,n.rebuild=o=>_g(o,t),n.makeEffect=d1(hf(n),vo(o=>new mf(o))),n.make=$O(n),n.makeOption=t_(n),n}const Wm="~effect/Schema/SchemaError";var hw;hw=Wm;class mf{constructor(t){M(this,hw,Wm);M(this,"_tag","SchemaError");M(this,"name","SchemaError");M(this,"issue");this.issue=t}get message(){return this.issue.toString()}toString(){return`SchemaError(${this.message})`}}const WO=KO(HO);function HO(e){switch(e._tag){case"BigInt":case"Symbol":case"UniqueSymbol":return 0;default:return 1}}function KO(e){return t=>{const n=new Map;for(let c=0;c<t.length;c++)n.set(xs(t[c]),c);const o=[...t].sort((c,l)=>{c=xs(c),l=xs(l);const d=e(c),h=e(l);return d!==h?d-h:n.get(c)-n.get(l)});return o.some((c,l)=>c!==t[l])?o:t}}const Fa=qm;function pf(){return(e,t,n)=>Ge(new ic(e.map(TE),o=>t(o.map(i=>Ge(i))),n))}function n_(e,t){return pf()([],()=>(n,o)=>e(n)?lt(n):Je(new Cr(o,Ne(n))),t)}function QO(e){return Ue(e,Wm)}function lx(e){const t=fo(e);return(n,o)=>vo(t(n,o),i=>new mf(i))}const JO=BO;function GO(e){const t=zO(e);return(n,o)=>vo(t(n,o),i=>new mf(i))}const YO=GO,Ge=_g;function Cg(e){return Ue(e,Fa)&&e[Fa]===Fa}const Ee=wi(e=>Ge(zE(e.ast),{schema:e})),ki=wi(e=>Ee(s_(e)));function vt(e){const t=Ge(new Pa(e),{literal:e,transform(n){return t.pipe(El(vt(n),{decode:gn(()=>n),encode:gn(()=>e)}))}});return t}const fx=Ge(E3),dx=Ge(C3),XO=Ge(mg),ZO=Ge(hg),eN=Ge(S3),de=Ge(PE),bg=Ge(FE),wt=Ge(R3),kl=Ge(w3);function Pg(e,t){return Ge(e,{fields:t,mapFields(n,o){const i=n(this.fields);return Pg(vg(i,o!=null&&o.unsafePreserveChecks?this.ast.checks:void 0),i)}})}function _e(e){return Pg(vg(e,void 0),e)}const We=wi(e=>Ge(new lf(!1,[],[e.ast]),{schema:e})),tN=wi(e=>Ge(new lf(!1,[e.ast],[e.ast]),{schema:e}));function r_(e,t){return Ge(e,{members:t,mapMembers(n,o){const i=n(this.members);return r_(Sg(i,this.ast.mode,o!=null&&o.unsafePreserveChecks?this.ast.checks:void 0),i)}})}function nn(e,t){return r_(Sg(e,"anyOf",void 0),e)}function nt(e){const t=e.map(vt);return Ge(Sg(t,"anyOf",void 0),{literals:e,members:t,mapMembers(n){return nn(n(this.members))},pick(n){return nt(n)},transform(n){return nn(t.map((o,i)=>o.transform(n[i])))}})}const Le=wi(e=>nn([e,ZO])),s_=wi(e=>nn([e,eN]));function El(e,t){return n=>Ge(V3(n.ast,e.ast,t?kE(t):dg()),{from:n,to:e})}function nN(e){return t=>Ge(z3(t.ast,e),{schema:t})}function Sn(e){return vt(e).pipe(nN(lt(e)))}function rN(e,t){return _e({_tag:Sn(e),...t})}function sN(e,t){return n_(n=>n instanceof e,t)}function lc(){return(e,t)=>new Mt(e.ast,kE(t))}const gf=OE,oN=NE;function iN(e){return gf(t=>globalThis.Number.isFinite(t),{expected:"a finite number",meta:{_tag:"isFinite"},toArbitraryConstraint:{number:{noDefaultInfinity:!0,noNaN:!0}},...e})}function aN(e){const t=U1(e.order),n=e.formatter??gt;return(o,i)=>{var c;return gf(l=>t(l,o),{expected:`a value greater than or equal to ${n(o)}`,...(c=e.annotate)==null?void 0:c.call(e,o),...i})}}function cN(e){const t=U1(e.order),n=$1(e.order),o=eR(e.order),i=ZI(e.order),c=e.formatter??gt;return(l,d)=>{var y;const h=l.exclusiveMinimum?n:t,p=l.exclusiveMaximum?i:o;return gf(g=>h(g,l.minimum)&&p(g,l.maximum),{expected:`a value between ${c(l.minimum)}${l.exclusiveMinimum?" (excluded)":""} and ${c(l.maximum)}${l.exclusiveMaximum?" (excluded)":""}`,...(y=e.annotate)==null?void 0:y.call(e,l),...d})}}const o_=aN({order:Mp,annotate:e=>({meta:{_tag:"isGreaterThanOrEqualTo",minimum:e},toArbitraryConstraint:{number:{min:e}}})}),Go=cN({order:Mp,annotate:e=>({meta:{_tag:"isBetween",...e},toArbitraryConstraint:{number:{min:e.minimum,max:e.maximum,...e.exclusiveMinimum&&{minExcluded:!0},...e.exclusiveMaximum&&{maxExcluded:!0}}}})});function uN(e){return gf(t=>globalThis.Number.isSafeInteger(t),{expected:"an integer",meta:{_tag:"isInt"},toArbitraryConstraint:{number:{isInteger:!0}},...e})}function hx(e,t){const n=pf()([e,t],([o,i])=>(c,l,d)=>{if(!CM(c))return Je(new Cr(l,Ne(c)));switch(c._tag){case"Fail":return Va(fo(o)(c.error,d),{onSuccess:Pm,onFailure:h=>new Kt(l,Ne(c),[new or(["error"],h)])});case"Die":return Va(fo(i)(c.defect,d),{onSuccess:Fm,onFailure:h=>new Kt(l,Ne(c),[new or(["defect"],h)])});case"Interrupt":return lt(c)}},{typeConstructor:{_tag:"effect/Cause/Failure"},generation:{runtime:"Schema.CauseReason(?, ?)",Type:"Cause.Failure<?, ?>",importDeclaration:'import * as Cause from "effect/Cause"'},expected:"Cause.Failure",toCodec:([o,i])=>lc()(nn([_e({_tag:vt("Fail"),error:o}),_e({_tag:vt("Die"),defect:i}),_e({_tag:vt("Interrupt"),fiberId:s_(Fe)})]),uf({decode:c=>{switch(c._tag){case"Fail":return Pm(c.error);case"Die":return Fm(c.defect);case"Interrupt":return Im(c.fiberId)}},encode:Ie})),toArbitrary:([o,i])=>i_(o,i),toEquivalence:([o,i])=>a_(o,i),toFormatter:([o,i])=>c_(o,i)});return Ge(n.ast,{error:e,defect:t})}function i_(e,t){return(n,o)=>n.oneof(o!=null&&o.isSuspend?{maxDepth:2,depthIdentifier:"Cause.Failure"}:{},n.constant(Im()),n.integer({min:1}).map(Im),e.map(i=>Pm(i)),t.map(i=>Fm(i)))}function a_(e,t){return(n,o)=>{if(n._tag!==o._tag)return!1;switch(n._tag){case"Fail":return e(n.error,o.error);case"Die":return t(n.defect,o.defect);case"Interrupt":return n.fiberId===o.fiberId}}}function c_(e,t){return n=>{switch(n._tag){case"Fail":return`Fail(${e(n.error)})`;case"Die":return`Die(${t(n.defect)})`;case"Interrupt":return"Interrupt"}}}function mx(e,t){const n=pf()([e,t],([o,i])=>{const c=We(hx(o,i));return(l,d,h)=>_M(l)?Va(fo(c)(l.reasons,h),{onSuccess:bm,onFailure:p=>new Kt(d,Ne(l),[new or(["failures"],p)])}):Je(new Cr(d,Ne(l)))},{typeConstructor:{_tag:"effect/Cause"},generation:{runtime:"Schema.Cause(?, ?)",Type:"Cause.Cause<?, ?>",importDeclaration:'import * as Cause from "effect/Cause"'},expected:"Cause",toCodec:([o,i])=>lc()(We(hx(o,i)),uf({decode:bm,encode:({reasons:c})=>c})),toArbitrary:([o,i])=>u_(o,i),toEquivalence:([o,i])=>l_(o,i),toFormatter:([o,i])=>f_(o,i)});return Ge(n.ast,{error:e,defect:t})}function u_(e,t){return(n,o)=>n.array(i_(e,t)(n,o)).map(bm)}function l_(e,t){const n=xI(a_(e,t));return(o,i)=>n(o.reasons,i.reasons)}function f_(e,t){const n=c_(e,t);return o=>`Cause([${o.reasons.map(n).join(", ")}])`}const d_=_e({message:de,name:Ee(de),stack:Ee(de)}),lN=sN(globalThis.Error,{typeConstructor:{_tag:"Error"},generation:{runtime:"Schema.Error",Type:"globalThis.Error"},expected:"Error",toCodecJson:()=>lc()(d_,_E()),toArbitrary:()=>e=>e.string().map(t=>new globalThis.Error(t))}),px=new Tn(pi(),gn(e=>{try{return JSON.parse(JSON.stringify(e))}catch{return gt(e)}})),cr=nn([d_.pipe(El(lN,_E())),dx.pipe(El(XO.annotate({toCodecJson:()=>lc()(dx,px),toArbitrary:()=>e=>e.json()}),px))]);function fN(e,t,n){const o=pf()([e,t,n],([i,c,l])=>{const d=mx(c,l);return(h,p,y)=>{if(!IM(h))return Je(new Cr(p,Ne(h)));switch(h._tag){case"Success":return Va(fo(i)(h.value,y),{onSuccess:jh,onFailure:g=>new Kt(p,Ne(h),[new or(["value"],g)])});case"Failure":return Va(fo(d)(h.cause,y),{onSuccess:Ca,onFailure:g=>new Kt(p,Ne(h),[new or(["cause"],g)])})}}},{typeConstructor:{_tag:"effect/Exit"},generation:{runtime:"Schema.Exit(?, ?, ?)",Type:"Exit.Exit<?, ?, ?>",importDeclaration:'import * as Exit from "effect/Exit"'},expected:"Exit",toCodec:([i,c,l])=>lc()(nn([_e({_tag:vt("Success"),value:i}),_e({_tag:vt("Failure"),cause:mx(c,l)})]),uf({decode:d=>d._tag==="Success"?jh(d.value):Ca(d.cause),encode:d=>Hk(d)?{_tag:"Success",value:d.value}:{_tag:"Failure",cause:d.cause}})),toArbitrary:([i,c,l])=>(d,h)=>d.oneof(h!=null&&h.isSuspend?{maxDepth:2,depthIdentifier:"Exit"}:{},i.map(p=>jh(p)),u_(c,l)(d,h).map(p=>Ca(p))),toEquivalence:([i,c,l])=>{const d=l_(c,l);return(h,p)=>{if(h._tag!==p._tag)return!1;switch(h._tag){case"Success":return i(h.value,p.value);case"Failure":return d(h.cause,p.cause)}}},toFormatter:([i,c,l])=>{const d=f_(c,l);return h=>{switch(h._tag){case"Success":return`Exit.Success(${i(h.value)})`;case"Failure":return`Exit.Failure(${d(h.cause)})`}}}});return Ge(o.ast,{value:e,error:t,defect:n})}const Fe=bg.check(iN()),dN=bg.check(uN()),hN=globalThis.Symbol.for("immer-draftable");function Fg(e,t,n,o,i){var h,p,y,g;const c=pN(n,t,o),l=h_(t),d=(g=class extends e{constructor(...[v,w]){v=v??{};const S=n.make(v,w);super({...v,...S},{...w,disableChecks:!0})}get[(y=Fa,p=l,h=hN,p)](){return l}static get ast(){return c(this).ast}static pipe(){return jt(this,arguments)}static rebuild(v){return c(this).rebuild(v)}static make(v,w){return new this(v,w)}static makeOption(v,w){return t_(c(this))(v??{},w)}static makeEffect(v,w){return vo(hf(c(this))(v??{},w),S=>new mf(S))}static annotate(v){return this.rebuild(DE(this.ast,v))}static annotateKey(v){return this.rebuild(UE(this.ast,v))}static check(...v){return this.rebuild(kg(this.ast,v))}static extend(v){return(w,S)=>{const E={...n.fields,...w};return Fg(this,v,Pg(vg(E,n.ast.checks,{identifier:v}),E),S,i)}}static mapFields(v,w){return n.mapFields(v,w)}},M(g,y,Fa),M(g,h,!0),M(g,"identifier",t),M(g,"fields",n.fields),g);return i!==void 0&&Object.assign(d.prototype,i(t)),d}function mN(e){return new Tn(gn(t=>new e(t)),pi())}function h_(e){return`~effect/Schema/Class/${e}`}function pN(e,t,n){let o;return i=>{if(o===void 0){const c=mN(i),l=Ge(new ic([e.ast],()=>(d,h)=>d instanceof i||Ue(d,h_(t))?lt(d):Je(new Cr(h,Ne(d))),{identifier:t,[JE]:([d])=>new Mt(d,c),toCodec:([d])=>new Mt(d.ast,c),toArbitrary:([d])=>()=>d.map(h=>new i(h)),toFormatter:([d])=>h=>`${i.identifier}(${d(h)})`,"~sentinels":xg(e.ast),...n}));o=e.pipe(El(l,c))}return o}}function Ig(e){return Cg(e)}const gN=e=>(t,n)=>{const o=Ig(t)?t:_e(t);return Fg(HM,e,o,n,i=>({toString(){return`${i}(${gt({...this})})`}}))},Wn=e=>(t,n)=>{const o=Ig(t)?t:_e(t);return Fg(b1,e,o,n,c=>({name:c}))},yf=e=>(t,n,o)=>Wn(e??t)(Ig(n)?n.mapFields(i=>({_tag:Sn(t),...i}),{unsafePreserveChecks:!0}):rN(t,n),o);function Bh(e){return Ge(m_(e.ast))}const m_=HE(e=>{const t=yN(e,m_);return t!==e&&zr(e)?BE(t):t});function yN(e,t){var n,o;switch(e._tag){case"Declaration":{const i=((n=e.annotations)==null?void 0:n.toCodecJson)??((o=e.annotations)==null?void 0:o.toCodec);if(Dl(i)){const c=CE(e)?e.typeParameters.map(h=>_g(xs(h))):[],l=i(c),d=t(l.to);return Rt(e,d===l.to?[l]:[new Mt(d,l.transformation)])}return Rt(e,[tO])}case"Unknown":case"ObjectKeyword":return Rt(e,[nO]);case"Undefined":case"Void":case"Literal":case"Number":return e.toCodecJson();case"UniqueSymbol":case"Symbol":case"BigInt":return e.toCodecStringTree();case"Objects":{if(e.propertySignatures.some(i=>typeof i.name!="string"))throw new globalThis.Error("Objects property names must be strings",{cause:e});return e.recur(t)}case"Union":{const i=WO(e.types);return i!==e.types?new ac(i,e.mode,e.annotations,e.checks,e.encoding,e.context).recur(t):e.recur(t)}case"Arrays":case"Suspend":return e.recur(t)}return e}const vN="~effect/Stream",SN={_R:Ie,_E:Ie,_A:Ie},xN={[vN]:SN,pipe(){return jt(this,arguments)}},wN=e=>{const t=Object.create(xN);return t.channel=e,t},kN="~effect/Stream",EN=e=>Ue(e,kN),fc=wN,_N=e=>e.channel,CN=e=>fc(AO(()=>e().channel)),bN=e=>fc(MO(e)),PN=e=>fc(OO(Rs(e,_N))),gx=re(2,(e,t)=>CN(()=>{let n=0;return fc(LO(e.channel,V1(o=>t(o,n++))))})),FN=re(2,(e,t)=>fc(DO(e.channel,t))),IN=re(2,(e,t)=>jO(e.channel,n=>{let o=0;return oE({while:()=>o<n.length,body:()=>t(n[o++]),step:Ga})})),Hm="~effect/FiberSet",RN=e=>Ue(e,Hm),TN={[Hm]:Hm,[Symbol.iterator](){return this.state._tag==="Closed"?aR():this.state.backing[Symbol.iterator]()},...Ps,toJSON(){return{_id:"FiberMap",state:this.state}}},AN=(e,t)=>{const n=Object.create(TN);return n.state={_tag:"Open",backing:e},n.deferred=t,n},MN=()=>uE(Un(()=>AN(new Set,Zp())),e=>wr(()=>{const t=e.state;if(t._tag==="Closed")return ht;e.state={_tag:"Closed"};const n=t.backing;return sO(n).pipe(NM(e.deferred))})),p_=-1,LN=JR(YR(FM,GR(p_))),ON=re(e=>RN(e[0]),(e,t,n)=>{if(e.state._tag==="Closed"){t.interruptUnsafe(p_);return}else if(e.state.backing.has(t))return;e.state.backing.add(t),t.addObserver(o=>{e.state._tag!=="Closed"&&(e.state.backing.delete(t),Kk(o)&&((n==null?void 0:n.propagateInterruption)===!0?!LN(o.cause):!bM(o.cause))&&ba(e.deferred,o))})}),NN=(function(){let e;return()=>(e===void 0&&(e=Om(Lm)),e)})(),DN=e=>()=>Rs(ml(),t=>{const n=pl(t);return(o,i)=>{if(e.state._tag==="Closed")return NN();const c=n(o,i);return ON(e,c),c}}),yx=e=>eg(e.deferred),jN="~effect/interfaces/PrimaryKey",vx="~effect/ManagedRuntime",$N=(e,t)=>{const n=(t==null?void 0:t.memoMap)??rg(),o=tg("parallel"),i=ll(o,"sequential"),c={onFiberStart:oO(o)},l=y=>y?{...y,onFiberStart:y.onFiberStart?g=>{c.onFiberStart(g),y.onFiberStart(g)}:c.onFiberStart}:c;let d;const h=dl(y=>(d||(d=Om(gL(sg(e,n,i),g=>Un(()=>{p.cachedContext=g})),{...c,scheduler:y.currentScheduler})),mL(rO(d)))),p={[vx]:vx,memoMap:n,scope:o,contextEffect:h,cachedContext:void 0,context(){return p.cachedContext===void 0?Wu(p.contextEffect):Promise.resolve(p.cachedContext)},dispose(){return Wu(p.disposeEffect)},disposeEffect:wr(()=>(p.contextEffect=hL("ManagedRuntime disposed"),p.cachedContext=void 0,af(p.scope,Wk))),runFork(y,g){return p.cachedContext===void 0?Om(Yo(p,y),l(g)):pl(p.cachedContext)(y,l(g))},runCallback(y,g){return p.cachedContext===void 0?OL(Yo(p,y),l(g)):LL(p.cachedContext)(y,l(g))},runSyncExit(y){return p.cachedContext===void 0?hE(Yo(p,y)):UL(p.cachedContext)(y)},runSync(y){return p.cachedContext===void 0?lg(Yo(p,y)):$L(p.cachedContext)(y)},runPromiseExit(y,g){return p.cachedContext===void 0?DL(Yo(p,y),l(g)):jL(p.cachedContext)(y,l(g))},runPromise(y,g){return p.cachedContext===void 0?Wu(Yo(p,y),l(g)):NL(p.cachedContext)(y,l(g))}};return p};function Yo(e,t){return Rn(e.contextEffect,n=>so(t,n))}const Km="~effect/rpc/RpcSchema/StreamSchema";function g_(e){return Ue(e,Km)}function y_(e){return g_(e)?Ne({success:e.success,error:e.error}):zn()}const UN=n_(EN);function BN(e,t){return Ge(UN.ast,{[Km]:Km,success:e,error:t})}const Sx="~effect/rpc/Rpc",zN={[Sx]:Sx,pipe(){return jt(this,arguments)},setSuccess(e){return hs({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:e,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},setError(e){return hs({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:e,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},setPayload(e){return hs({_tag:this._tag,payloadSchema:Cg(e)?e:_e(e),successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},middleware(e){return hs({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:new Set([...this.middlewares,e])})},prefix(e){return hs({_tag:`${e}${this._tag}`,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},annotate(e,t){return hs({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,middlewares:this.middlewares,annotations:Fs(this.annotations,e,t)})},annotateMerge(e){return hs({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,middlewares:this.middlewares,annotations:di(this.annotations,e)})}},hs=e=>{function t(){}return Object.setPrototypeOf(t,zN),Object.assign(t,e),t.key=`effect/rpc/Rpc/${e._tag}`,t},Ei=(e,t)=>{const n=(t==null?void 0:t.success)??kl,o=(t==null?void 0:t.error)??fx,i=(t==null?void 0:t.defect)??cr;let c;return t!=null&&t.primaryKey?c=class extends gN(`effect/rpc/Rpc/${e}`)(t.payload){[jN](){return t.primaryKey(this)}}:c=Cg(t==null?void 0:t.payload)?t==null?void 0:t.payload:t!=null&&t.payload?_e(t==null?void 0:t.payload):kl,hs({_tag:e,payloadSchema:c,successSchema:t!=null&&t.stream?BN(n,o):n,errorSchema:t!=null&&t.stream?fx:o,defectSchema:i,annotations:sr(),middlewares:new Set})},zh=new WeakMap,VN=e=>{if(zh.has(e))return zh.get(e);const t=e,n=new Set([t.errorSchema]),o=y_(t.successSchema);ks(o)&&n.add(o.value.error);for(const c of t.middlewares)n.add(c.error);const i=fN(ks(o)?kl:t.successSchema,nn([...n]),t.defectSchema);return zh.set(e,i),i},qN="~effect/rpc/Rpc/Wrapper",WN=e=>qN in e,HN={add(...e){const t=new Map(this.requests);for(const n of e)t.set(n._tag,n);return jr({requests:t,annotations:this.annotations})},merge(...e){const t=new Map(this.requests),n=new Map(this.annotations.mapUnsafe);for(const o of e){for(const[i,c]of o.requests)t.set(i,c);for(const[i,c]of o.annotations.mapUnsafe)n.set(i,c)}return jr({requests:t,annotations:Ss(n)})},omit(...e){const t=new Map(this.requests);for(const n of e)t.delete(n);return jr({requests:t,annotations:this.annotations})},middleware(e){const t=new Map;for(const[n,o]of this.requests)t.set(n,o.middleware(e));return jr({requests:t,annotations:this.annotations})},toHandlers(e){const t=this;return Mm(function*(){const n=yield*ml(),o=ii(e)?yield*e:e,i=new Map;for(const[c,l]of Object.entries(o)){const d=t.requests.get(c);i.set(d.key,{tag:d._tag,handler:l,context:n})}return Ss(i)})},prefix(e){const t=new Map;for(const n of this.requests.values()){const o=n.prefix(e);t.set(o._tag,o)}return jr({requests:t,annotations:this.annotations})},toLayer(e){return Tm(this.toHandlers(e))},of:Ie,toLayerHandler(e,t){const n=this;return Tm(Mm(function*(){const o=yield*ml(),i=ii(t)?yield*t:t,c=new Map,l=n.requests.get(e);return c.set(l.key,{handler:i,context:o}),Ss(c)}))},accessHandler(e){return cE(t=>{const n=this.requests.get(e),{handler:o,context:i}=t.mapUnsafe.get(n.key);return lt((c,l)=>{l.rpc=n;const d=o(c,l),h=WN(d)?d.value:d;return ii(h)?_L(h,i):FN(h,i)})})},annotate(e,t){return jr({requests:this.requests,annotations:Fs(this.annotations,e,t)})},annotateRpcs(e,t){return this.annotateRpcsMerge(fi(e,t))},annotateMerge(e){return jr({requests:this.requests,annotations:di(this.annotations,e)})},annotateRpcsMerge(e){const t=new Map;for(const[n,o]of this.requests)t.set(n,o.annotateMerge(di(e,o.annotations)));return jr({requests:t,annotations:this.annotations})}},jr=e=>Object.assign(function(){},HN,{requests:e.requests,annotations:e.annotations}),KN=(...e)=>jr({requests:new Map(e.map(t=>[t._tag,t])),annotations:sr()}),QN="/ws",JN=4,Wt={getConfig:"tokmon.getConfig",setConfig:"tokmon.setConfig",refresh:"tokmon.refresh",browseFs:"tokmon.browseFs",snapshot:"tokmon.snapshot",config:"tokmon.config"},GN=nt(["all","summary","table","billing","peak"]),ho=nt(Ll),tr=dN.check(o_(0)),_l=Fe.check(o_(1)),YN=_e({id:de,providerId:ho,name:de,homeDir:de,color:Ee(de)}),XN=_e({enabled:wt,showMenuBarText:wt,displayMetric:nt(["smartHeadroom","tightestRemaining"]),pollIntervalSec:Fe.check(Go({minimum:1,maximum:86400})),activeTimeoutMin:Fe.check(Go({minimum:1,maximum:1440})),graceMin:Fe.check(Go({minimum:1,maximum:10080})),promotionHoldMin:Fe.check(Go({minimum:0,maximum:1440})),lowWatermarkPct:Fe.check(Go({minimum:0,maximum:100})),criticalWatermarkPct:Fe.check(Go({minimum:0,maximum:100})),pinnedAccount:Le(de),pins:We(de),pinnedProviders:Ee(We(de)),launchAtLogin:wt,theme:vt("dark")}),ZN=_e({expandedProviders:We(de),graphRangeDays:Ee(nt(c1))}),eD=_e({enabled:wt,disabledProviders:We(ho),excludedAccounts:We(_e({providerId:ho,homeDir:de}))}),Xt=de.check(oN(/^#[0-9a-f]{6}$/i)),xx=_e({canvas:Ee(Xt),panel:Ee(Xt),inset:Ee(Xt),insetStrong:Ee(Xt),chrome:Ee(Xt),line:Ee(Xt),lineStrong:Ee(Xt),lineFaint:Ee(Xt),text:Ee(Xt),textDim:Ee(Xt),textFaint:Ee(Xt),textStrong:Ee(Xt),accent:Ee(Xt),cost:Ee(Xt),positive:Ee(Xt)}),tD=_e({version:vt(1),mode:nt(["auto","light","dark"]),preset:nt(t1),terminal:nt(["ansi","dark","light","off"]),custom:Ee(_e({base:nt(vp),light:xx,dark:xx}))}),v_=_e({revision:tr,interval:_l,billingInterval:_l,clearScreen:wt,privacyMode:wt,privacyToggleKey:de,timezone:Le(de),accounts:We(YN),activeAccountId:Le(de),disabledProviders:We(ho),onboarded:wt,dashboardLayout:nt(["grid","single"]),defaultFocus:nt(["all","last"]),ascii:nt(["auto","on","off"]),allowNetworkAccess:wt,allowedHosts:We(de),resetDisplay:nt(["relative","absolute"]),knownProviders:We(ho),appearance:Ee(tD),accountDetection:Ee(eD),tray:Ee(XN),desktop:Ee(ZN)}),nD=_e({version:vt(JN),capabilities:We(de)}),dc=_e({protocol:nD,config:v_}),rD=_e({expectedRevision:tr,config:v_}),sD=_e({kind:vt("conflict"),state:dc});class Qm extends yf()("ConfigUpdateConflictFailure",{kind:vt("conflict"),state:dc}){}const oD=_e({kind:vt("persistence"),message:de});class iD extends yf()("ConfigPersistenceFailure",{kind:vt("persistence"),message:de}){}const aD=nn([Qm,sD]),cD=nn([iD,oD]);class uD extends yf()("RefreshFailure",{kind:vt("refresh"),message:de}){}const lD=_e({name:de,path:de,dir:wt}),fD=_e({path:de,parent:Le(de),entries:We(lD)}),Vh=_e({cost:Fe,tokens:Fe,input:Fe,cacheRead:Fe,cacheSavings:Fe}),dD=_e({name:de,input:Fe,output:Fe,cacheCreate:Fe,cacheRead:Fe,cacheSavings:Fe,cost:Fe,count:Fe}),qh=_e({label:de,models:We(de),input:Fe,output:Fe,cacheCreate:Fe,cacheRead:Fe,cacheSavings:Fe,total:Fe,cost:Fe,count:Fe,breakdown:We(dD)}),hD=_e({today:Vh,week:Vh,month:Vh,burnRate:Fe,series:We(Fe),lastActivityAt:Le(tr)}),mD=_e({daily:We(qh),weekly:We(qh),monthly:We(qh)}),pD=nn([_e({kind:vt("percent")}),_e({kind:vt("dollars"),currency:Ee(de)}),_e({kind:vt("count"),suffix:Ee(de)})]),gD=_e({key:Ee(de),role:Ee(nt(["session","weekly","model","other","unbounded"])),modelId:Ee(Le(de)),active:Ee(wt),label:de,used:Fe,limit:Le(Fe),format:pD,resetsAt:Ee(Le(de)),primary:Ee(wt)}),S_=nt(["session","weekly","model","other","unbounded"]),yD=_e({title:de,subtitle:Le(de),accessibleLabel:de,redacted:wt}),vD=_e({key:de,label:de,role:S_,modelId:Le(de),usedPct:Le(Fe),remainingPct:Le(Fe),resetsAt:Le(tr),bounded:wt,primary:wt,active:wt,displayOrder:tr,valueText:de}),SD=_e({key:de,label:de,role:S_,remainingPct:Fe,included:wt,reason:nt(["session","active-model","weekly-cap","primary","fallback-floor"])}),x_=_e({value:Le(Fe),unit:vt("index-100"),mode:nt(["smart","single-window","fallback-floor","unavailable"]),basis:nt(["active","idle-runway","unavailable"]),representativeAccountId:Le(de),activeAccountIds:We(de),factors:We(SD),explanation:de}),xD=_e({plan:Le(de),metrics:We(gD),error:Le(de),email:Ee(Le(de)),displayName:Ee(Le(de)),activity:Ee(Le(_e({series:We(Fe),summary:de}))),modelSpend:Ee(Le(We(_e({name:de,usd:Fe,requests:Fe})))),asOfMs:Ee(tr)}),wD=_e({id:de,providerId:ho,name:de,color:de,homeDir:Le(de),hasUsage:wt,hasBilling:wt,email:Ee(Le(de)),displayName:Ee(Le(de)),identity:Ee(yD),quotas:Ee(We(vD)),headroom:Ee(x_),plan:Ee(Le(de)),lastActivityAt:Le(tr),dashboard:Le(hD),table:Le(mD),billing:Le(xD),summaryState:nt(["pending","ready","error"]),billingState:nt(["pending","ready","error"]),tableState:nt(["pending","ready","error"]),summaryUpdatedAt:Ee(Le(tr)),billingUpdatedAt:Ee(Le(tr)),tableUpdatedAt:Ee(Le(tr))}),kD=_e({version:de,generatedAt:tr,tz:de,intervalMs:_l,billingIntervalMs:Ee(_l),providers:We(_e({id:ho,name:de,color:de,headroom:Ee(x_)})),accounts:We(wD),seeded:wt,peak:Le(_e({state:nt(["peak","off-peak","weekend"]),label:de,minutesUntilChange:Le(Fe),changesAt:Ee(Le(de))}))}),Rg=_e({}),ED=Ei(Wt.getConfig,{payload:Rg,success:dc}),_D=Ei(Wt.setConfig,{payload:rD,success:dc,error:nn([aD,cD])}),CD=Ei(Wt.refresh,{payload:_e({scope:GN}),success:kl,error:uD}),bD=Ei(Wt.browseFs,{payload:_e({path:de}),success:fD}),PD=Ei(Wt.snapshot,{payload:Rg,success:kD,stream:!0}),FD=Ei(Wt.config,{payload:Rg,success:dc,stream:!0}),ID=KN(ED,_D,CD,bD,PD,FD);function RD(e){if(!e||typeof e!="object")return!1;const t=e;return t.isContentEditable?!0:typeof t.tagName=="string"&&["INPUT","TEXTAREA","SELECT"].includes(t.tagName.toUpperCase())}function TD(e,t){return t.length===1&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&!e.shiftKey&&!e.repeat&&!e.editable&&!RD(e.target)&&e.key.toLowerCase()===t.toLowerCase()}const Wa="#8d9090",hn={green:"#6caa71",greenBright:"#79be7e",cyan:"#7ccbcd",cyanBright:"#84dde0",blue:"#6d96b4",blueBright:"#67b5ed",magenta:"#bd7bcd",magentaBright:"#d389e5",yellow:"#c4ac62",yellowBright:"#d9c074",red:"#b45648",redBright:"#cf6a5a",white:"#dee5eb",whiteBright:"#f3f5f5",gray:Wa,grey:Wa},AD={claude:hn.green,codex:hn.cyan,cursor:hn.magenta,copilot:hn.white,pi:hn.blue,opencode:hn.yellow,antigravity:hn.red,gemini:hn.greenBright,grok:hn.yellowBright};function MD(e){return e?e.startsWith("#")?e:hn[e]??Wa:Wa}const X$=MD;function Z$(e){return AD[e]??Wa}const wx=["#00d7ff","#00d787","#e6b450","#d75f87","#5f87ff","#af87ff","#5fd7a7","#ff8787","#d7af5f","#87d7ff","#d787d7","#9ee493","#ffb454","#7aa2f7","#bb9af7"],kx=new Map;function LD(e){const t=kx.get(e);if(t)return t;let n=0;for(let i=0;i<e.length;i++)n=n*31+e.charCodeAt(i)>>>0;const o=wx[n%wx.length];return kx.set(e,o),o}const e6={input:hn.blue,output:hn.green,cacheCreate:hn.yellow,cacheRead:hn.cyan};function Ex(e){return e.replace(/^claude-/,"").replace(/^gpt-/,"gpt-").replace(/-\d{8}$/,"").replace(/-latest$/,"")}const _x=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function t6(e,t={}){if(!Number.isFinite(e))return"$0.00";const n=t.sign&&e>0?"+":"",o=Math.abs(e);if(o>=1e5)return`${n}$${(e/1e3).toFixed(0)}k`;if(o>=1e4)return`${n}$${(e/1e3).toFixed(1)}k`;if(o>=1){const i=e<0?"-":"";return`${n}${i}$${o.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}return o>=.01?`${n}$${e.toFixed(3)}`:o===0?"$0.00":`${n}$${e.toFixed(4)}`}function n6(e){if(!Number.isFinite(e))return"$0";const t=Math.abs(e);return t>=1e6?`$${(e/1e6).toFixed(1).replace(/\.0$/,"")}M`:t>=1e3?`$${(e/1e3).toFixed(1).replace(/\.0$/,"")}k`:t>=1?`$${Math.round(e)}`:t===0?"$0":`$${e.toFixed(2)}`}function r6(e){if(!Number.isFinite(e)||e===0)return"0";const t=Math.abs(e);return t>=1e9?`${(e/1e9).toFixed(2)}B`:t>=1e6?`${(e/1e6).toFixed(2)}M`:t>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}function s6(e){return Number.isFinite(e)?Math.round(e).toLocaleString("en-US"):"0"}function o6(e){if(!Number.isFinite(e))return"0";const t=Math.abs(e);return t>=1e6?`${(e/1e6).toFixed(1)}M`:t>=1e4?`${Math.round(e/1e3)}k`:Math.round(e).toLocaleString("en-US")}function i6(e,t=0){return Number.isFinite(e)?`${(e*100).toFixed(t)}%`:"0%"}function OD(e,t){const n=Math.max(0,Math.round((t-e)/1e3));if(n<2)return"just now";if(n<60)return`${n}s ago`;const o=Math.round(n/60);if(o<60)return`${o}m ago`;const i=Math.round(o/60);return i<24?`${i}h ago`:`${Math.round(i/24)}d ago`}function a6(e){const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(t)return`${_x[Number(t[2])-1]} ${Number(t[3])}`;const n=/^(\d{4})-(\d{2})$/.exec(e);return n?`${_x[Number(n[2])-1]} ${n[1]}`:e}function ND(e){if(!Number.isFinite(e)||e<=0)return null;const t=Math.max(1,Math.ceil(e/6e4));return{days:Math.floor(t/1440),hours:Math.floor(t%1440/60),minutes:t%60,totalMinutes:t}}function DD(e,t=Date.now()){const n=ND(new Date(e).getTime()-t);return n?n.days>0?`${n.days}d ${n.hours}h`:n.hours>0?`${n.hours}h ${n.minutes}m`:`${n.minutes}m`:"now"}function jD(e,t,n=Date.now(),o){const i=Date.parse(e);return Number.isFinite(i)?t==="relative"?DD(e,n):new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZone:o}).format(new Date(i)):e}function w_(e){return e.input+e.output+e.cacheCreate+e.cacheRead}const Tg=864e5,c6=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Cl=e=>{const[t,n,o]=e.split("-").map(Number);return Date.UTC(t,(n||1)-1,o||1)},bl=e=>new Date(e).toISOString().slice(0,10),$D=e=>{try{return new Intl.DateTimeFormat("en-CA",{timeZone:e||void 0,year:"numeric",month:"2-digit",day:"2-digit"}).format(new Date)}catch{return new Date().toISOString().slice(0,10)}},UD=e=>(new Date(e).getUTCDay()+6)%7,u6=e=>{const t=Cl(e);return bl(t-UD(t)*Tg)},BD={period:"6m"},Ag=[{key:"7d",label:"7 days",shortLabel:"7d"},{key:"30d",label:"30 days",shortLabel:"30d"},{key:"90d",label:"90 days",shortLabel:"90d"},{key:"mtd",label:"month to date",shortLabel:"MTD"},{key:"6m",label:"6 months",shortLabel:"6M"},{key:"all",label:"all time",shortLabel:"All"}];function k_(e){return e.providers.length?new Set(e.providers):null}function zD(e,t){const n=k_(t);return e.accounts.filter(o=>!(!o.hasUsage||t.account!=="all"&&o.id!==t.account||n&&!n.has(o.providerId)))}function Jm(e){var t,n,o,i,c,l,d,h,p;return!!(e.hasBilling&&((n=(t=e.billing)==null?void 0:t.metrics)!=null&&n.length||(o=e.billing)!=null&&o.plan||(i=e.billing)!=null&&i.error||(d=(l=(c=e.billing)==null?void 0:c.activity)==null?void 0:l.series)!=null&&d.length||(p=(h=e.billing)==null?void 0:h.modelSpend)!=null&&p.length))}function VD(e,t){const n=k_(t);return e.accounts.filter(o=>!(!o.hasUsage&&!Jm(o)||t.account!=="all"&&o.id!==t.account||n&&!n.has(o.providerId)))}function qD(e){var n;let t=null;for(const o of e)for(const i of((n=o.table)==null?void 0:n.daily)??[])(!t||i.label>t)&&(t=i.label);return t}function E_(e,t,n){if(!t||e==="all")return null;if(e==="mtd")return $D(n).slice(0,7)+"-01";if(e==="6m"){const i=new Date(Cl(t)),c=i.getUTCMonth()-6,l=i.getUTCFullYear()+Math.floor(c/12),d=(c%12+12)%12,h=new Date(Date.UTC(l,d+1,0)).getUTCDate();return bl(Date.UTC(l,d,Math.min(i.getUTCDate(),h)))}const o=e==="7d"?7:e==="90d"?90:30;return bl(Cl(t)-(o-1)*Tg)}function l6(e,t,n,o){if(!n||e==="all")return null;const i=E_(e,n,o);if(t==="daily")return i;const c=t==="monthly"?365:84,l=bl(Cl(n)-(c-1)*Tg);return i&&i<l?i:l}function WD(e,t){const n=KF(e,t);return n.toLocaleLowerCase()===t.toLocaleLowerCase()?t:`${t} · ${n}`}const HD=()=>({cost:0,tokens:0,cacheSavings:0,calls:0}),KD=(e,t,n,o,i)=>{e.cost+=t,e.tokens+=n,e.cacheSavings+=o,e.calls+=i};function QD(){return{totals:HD(),burnRate:0,timelineMap:new Map,cacheByDay:new Map,provAgg:new Map,modelAgg:new Map,modelTrend:new Map,modelOptionSet:new Set,tokenComposition:{input:0,output:0,cacheCreate:0,cacheRead:0}}}function JD(e,t,n,o,i){let c=0,l=0,d=0,h=0;for(const g of t.breakdown){if(e.modelOptionSet.add(g.name),i&&!i.has(g.name))continue;const v=w_(g);c+=g.cost,l+=v,d+=g.cacheSavings,h+=g.count,e.tokenComposition.input+=g.input,e.tokenComposition.output+=g.output,e.tokenComposition.cacheCreate+=g.cacheCreate,e.tokenComposition.cacheRead+=g.cacheRead;const w=e.modelAgg.get(g.name)??{cost:0,tokens:0,cacheSavings:0,calls:0};w.cost+=g.cost,w.tokens+=v,w.cacheSavings+=g.cacheSavings,w.calls+=g.count,e.modelAgg.set(g.name,w);let S=e.modelTrend.get(g.name);S||(S=new Map,e.modelTrend.set(g.name,S)),S.set(t.label,(S.get(t.label)??0)+g.cost)}if(i&&h===0&&c===0)return;KD(e.totals,c,l,d,h);const p=e.timelineMap.get(t.label)??{date:t.label,total:0,tokens:0,byProvider:{}};p.total+=c,p.tokens+=l,p.byProvider[n]=(p.byProvider[n]??0)+c,e.timelineMap.set(t.label,p),e.cacheByDay.set(t.label,(e.cacheByDay.get(t.label)??0)+d);const y=e.provAgg.get(n)??{id:n,name:n,color:o,cost:0,tokens:0,calls:0};y.cost+=c,y.tokens+=l,y.calls+=h,e.provAgg.set(n,y)}function GD(e){return[...e.timelineMap.values()].sort((t,n)=>t.date.localeCompare(n.date))}function YD(e,t,n){const o=t.map(i=>i.date);return[...e.modelAgg.entries()].map(([i,c])=>{const l=e.modelTrend.get(i);return{model:i,color:LD(i),cost:c.cost,tokens:c.tokens,cacheSavings:c.cacheSavings,calls:c.calls,share:n>0?c.cost/n:0,tokenShare:e.totals.tokens>0?c.tokens/e.totals.tokens:0,callShare:e.totals.calls>0?c.calls/e.totals.calls:0,trend:o.map(d=>(l==null?void 0:l.get(d))??0)}}).sort((i,c)=>c.cost-i.cost)}function XD(e,t){var _,O,C;const n=e?zD(e,t):[],o=qD(n),i=E_(t.period,o,(e==null?void 0:e.tz)??""),c=t.models.length?new Set(t.models):null,l=new Map,d=new Map;for(const D of(e==null?void 0:e.providers)??[])l.set(D.id,D.color),d.set(D.id,D.name);const h=QD(),p=D=>!i||D>=i;for(const D of n){h.burnRate+=((_=D.dashboard)==null?void 0:_.burnRate)??0;const T=D.providerId,L=l.get(T)??D.color;for(const $ of((O=D.table)==null?void 0:O.daily)??[])p($.label)&&JD(h,$,T,L,c)}for(const D of h.provAgg.values()){const T=d.get(D.id);T&&(D.name=T)}const y=GD(h);let g=0;const v=y.map(D=>(g+=D.total,{date:D.date,total:g})),w=y.map(D=>({date:D.date,value:h.cacheByDay.get(D.date)??0})),S=new Map;for(const D of n)for(const T of((C=D.table)==null?void 0:C.daily)??[]){if(!p(T.label))continue;const L=c?T.breakdown.filter(q=>c.has(q.name)):T.breakdown;if(c&&L.length===0)continue;let $=S.get(T.label);$||($={tokens:0,calls:0,cacheSavings:0,models:new Map},S.set(T.label,$));for(const q of L)$.tokens+=w_(q),$.calls+=q.count,$.cacheSavings+=q.cacheSavings,$.models.set(q.name,($.models.get(q.name)??0)+q.cost)}const E=y.map(D=>{const T=S.get(D.date);return{date:D.date,cost:D.total,tokens:(T==null?void 0:T.tokens)??0,calls:(T==null?void 0:T.calls)??0,cacheSavings:(T==null?void 0:T.cacheSavings)??0,models:T?[...T.models.entries()].map(([L,$])=>({name:L,cost:$})).sort((L,$)=>$.cost-L.cost):[]}}),P=[...h.provAgg.values()].sort((D,T)=>T.cost-D.cost),H=YD(h,y,h.totals.cost);return{filteredAccounts:n,totals:h.totals,burnRate:h.burnRate,timeline:y,cumulative:v,cacheSavingsSeries:w,calendar:E,cardAccounts:e?VD(e,t):[],byProvider:P,byModel:H,tokenComposition:h.tokenComposition,modelOptions:[...h.modelOptionSet].sort(),latestDay:o,rangeStart:i}}function $t({children:e,className:t="size-4",...n}){return F.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round",className:t,"aria-hidden":!0,...n,children:e})}const f6=e=>F.jsxs($t,{...e,children:[F.jsx("path",{d:"M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"}),F.jsx("circle",{cx:"12",cy:"13",r:"4"})]}),d6=e=>F.jsx($t,{...e,children:F.jsx("path",{d:"M20 6 9 17l-5-5"})}),h6=e=>F.jsxs($t,{...e,children:[F.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),F.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),m6=e=>F.jsxs($t,{...e,children:[F.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),F.jsx("path",{d:"m7 10 5 5 5-5"}),F.jsx("path",{d:"M12 15V3"})]}),p6=e=>F.jsx($t,{...e,children:F.jsx("path",{d:"M3 6.5A2.5 2.5 0 0 1 5.5 4H9l2 2h7.5A2.5 2.5 0 0 1 21 8.5v8A2.5 2.5 0 0 1 18.5 19h-13A2.5 2.5 0 0 1 3 16.5z"})}),ZD=e=>F.jsxs($t,{...e,children:[F.jsx("path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"}),F.jsx("path",{d:"m16 6-4-4-4 4"}),F.jsx("path",{d:"M12 2v13"})]}),e4=e=>F.jsx($t,{...e,children:F.jsx("path",{d:"m6 9 6 6 6-6"})}),g6=e=>F.jsxs($t,{...e,children:[F.jsx("circle",{cx:"11",cy:"11",r:"8"}),F.jsx("path",{d:"m21 21-4.3-4.3"})]}),t4=e=>F.jsxs($t,{...e,children:[F.jsx("path",{d:"M18 6 6 18"}),F.jsx("path",{d:"m6 6 12 12"})]}),n4=e=>F.jsxs($t,{...e,children:[F.jsx("circle",{cx:"12",cy:"12",r:"4"}),F.jsx("path",{d:"M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"})]}),r4=e=>F.jsx($t,{...e,children:F.jsx("path",{d:"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"})}),s4=e=>F.jsxs($t,{...e,children:[F.jsx("circle",{cx:"12",cy:"12",r:"3"}),F.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),o4=e=>F.jsxs($t,{...e,children:[F.jsx("path",{d:"M20 6v5h-5"}),F.jsx("path",{d:"M4 18v-5h5"}),F.jsx("path",{d:"M18.7 9A7 7 0 0 0 6.3 6.3L4 8"}),F.jsx("path",{d:"M5.3 15A7 7 0 0 0 17.7 17.7L20 16"})]}),y6=e=>F.jsx($t,{...e,children:F.jsx("path",{d:"M12 5v14M5 12h14"})}),v6=e=>F.jsx($t,{...e,children:F.jsx("path",{d:"M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m3 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"})}),S6=e=>F.jsxs($t,{...e,children:[F.jsx("path",{d:"M12 20h9"}),F.jsx("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4z"})]}),x6=e=>F.jsx($t,{...e,children:F.jsx("path",{d:"m18 15-6-6-6 6"})}),kr="focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent",Wh=["▁","▂","▃","▄","▅","▆","▇","█"];function w6({data:e,color:t="var(--color-accent)",className:n=""}){const o=Wh.length-1,i=Math.max(...e,0),c=Math.min(...e,0),l=i>0&&c===i;return F.jsx("span",{className:`font-mono leading-none ${n}`,style:{color:t},"aria-hidden":!0,children:e.length===0?"·":l?Wh[Math.floor(o/2)].repeat(e.length):e.map(d=>Wh[i<=0?0:Math.max(0,Math.min(o,Math.floor(d/i*(o+.999))))]).join("")})}function k6({label:e,value:t,sub:n,valueClass:o="text-fg-bright"}){return F.jsxs("div",{children:[F.jsx("div",{className:"font-display text-[10px] uppercase tracking-wide text-fg-faint",children:e}),F.jsx("div",{className:`tnum mt-1 text-xl ${o}`,children:t}),n!=null&&F.jsx("div",{className:"mt-0.5 text-xs text-fg-dim",children:n})]})}function E6({children:e}){return F.jsx("div",{className:"flex h-full min-h-24 items-center justify-center text-center text-xs text-fg-faint",children:e})}function i4(e,t){return t?u1(e):e}function Cx({value:e,privacyMode:t,className:n,title:o}){const[i,c]=Y.useState(!1);return!(t&&UF(e))||i?F.jsx("span",{className:n,title:o??e,children:e}):F.jsx("button",{type:"button",onClick:()=>c(!0),className:`min-w-0 cursor-pointer truncate rounded text-left ${kr} ${n??""}`,title:"Click to reveal email","aria-label":"Email hidden. Click to reveal.",children:F.jsx("span",{className:"inline-block max-w-full truncate blur-sm transition hover:blur-[2px]",children:u1(e)})})}function a4({options:e,value:t,onChange:n,size:o="sm",btnClassName:i,containerClassName:c,ariaLabel:l}){const d="flex items-center overflow-hidden rounded border border-line",h=o==="xs"?"px-1.5 py-0.5 text-[10px] transition max-sm:py-1.5":"px-2 py-1 text-xs transition max-sm:py-2",p=o==="xs"?"bg-bg-3 text-accent":"bg-bg-2 text-accent",y=o==="xs"?"text-fg-faint hover:text-fg":"text-fg-dim hover:text-fg";return F.jsx("div",{className:c??d,role:"radiogroup","aria-label":l,children:e.map(g=>F.jsx("button",{type:"button",role:"radio","aria-checked":t===g.value,onClick:()=>n(g.value),className:`${i??h} ${kr} ${t===g.value?p:y}`,children:g.label},String(g.value)))})}function bx({label:e,value:t,children:n}){const[o,i]=Y.useState(!1),c=Y.useRef(null),l=Y.useRef(null),d=Y.useRef(null),h=Y.useId(),p=(g=!1)=>{i(!1),g&&requestAnimationFrame(()=>{var v;return(v=l.current)==null?void 0:v.focus()})};Y.useEffect(()=>{if(!o)return;const g=v=>{c.current&&!c.current.contains(v.target)&&p()};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[o]);const y=g=>{var E;const v=Array.from(((E=d.current)==null?void 0:E.querySelectorAll('[role="menuitem"]:not([disabled])'))??[]),w=v.indexOf(document.activeElement);let S=null;if(g.key==="Escape"){g.preventDefault(),p(!0);return}g.key==="Home"&&(S=0),g.key==="End"&&(S=v.length-1),g.key==="ArrowDown"&&(S=w<0?0:(w+1)%v.length),g.key==="ArrowUp"&&(S=w<0?v.length-1:(w-1+v.length)%v.length),S!==null&&v[S]&&(g.preventDefault(),v[S].focus())};return F.jsxs("div",{ref:c,className:"relative",children:[F.jsxs("button",{ref:l,type:"button","aria-haspopup":"menu","aria-expanded":o,"aria-controls":o?h:void 0,onClick:()=>i(g=>!g),onKeyDown:g=>{g.key!=="ArrowDown"&&g.key!=="ArrowUp"||(g.preventDefault(),i(!0),requestAnimationFrame(()=>{var w,S;const v=(w=d.current)==null?void 0:w.querySelectorAll('[role="menuitem"]:not([disabled])');(S=v==null?void 0:v[g.key==="ArrowDown"?0:v.length-1])==null||S.focus()}))},className:`flex items-center gap-1.5 rounded border border-line bg-bg-1 px-2 py-1 text-xs text-fg-dim transition hover:border-line-2 hover:text-fg max-sm:py-2 ${kr}`,children:[F.jsxs("span",{className:"text-fg-faint",children:[e,":"]}),F.jsx("span",{className:"text-fg",children:t}),F.jsx(e4,{className:`size-3 transition ${o?"rotate-180":""}`})]}),o&&F.jsx("div",{id:h,ref:d,role:"menu",onKeyDown:y,className:"absolute right-0 z-50 mt-1 min-w-44 max-w-[calc(100vw-2.5rem)] rounded-md border border-line-2 bg-bg-2 p-1 shadow-xl",children:n(()=>p(!0))})]})}function Px({children:e}){return F.jsx("div",{className:"flex flex-col",children:e})}function Ru({active:e,onClick:t,children:n}){return F.jsx("button",{type:"button",role:"menuitem",onClick:t,className:`flex min-w-0 items-center gap-2 rounded px-2 py-1 text-left text-xs transition ${kr} ${e?"bg-bg-3 text-fg-bright":"text-fg-dim hover:bg-bg-3 hover:text-fg"}`,children:n})}function c4({snapshot:e,derived:t,filters:n,setFilters:o,privacyMode:i=!0}){const c=(e==null?void 0:e.providers)??[],d=((e==null?void 0:e.accounts)??[]).filter(_=>_.hasUsage),h=new Set(d.map(_=>_.providerId)),p=c.filter(_=>h.has(_.id)),y=new Set(t.cardAccounts.map(_=>_.providerId)),g=c.filter(_=>!h.has(_.id)&&y.has(_.id)),v=n.providers.length?d.filter(_=>n.providers.includes(_.providerId)):d,w=_=>{var O;return((O=c.find(C=>C.id===_))==null?void 0:O.name)??_},S=_=>WD(_,w(_.providerId)),E=d.find(_=>_.id===n.account),P=_=>o(O=>{const C=O.providers.includes(_);return{...O,providers:C?O.providers.filter(D=>D!==_):[...O.providers,_]}}),H=n.providers.length>0||n.models.length>0||n.account!=="all";return F.jsx("div",{className:"border-t border-line bg-bg-0/70",children:F.jsxs("div",{className:"mx-auto flex max-w-[1600px] flex-wrap items-center gap-x-4 gap-y-2 px-5 py-2.5 2xl:max-w-[1920px]",children:[F.jsx("span",{className:"hidden text-xs text-fg-faint sm:inline",children:"filter:"}),F.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[p.map(_=>{const O=n.providers.includes(_.id),C=n.providers.length>0&&!O;return F.jsxs("button",{type:"button","aria-pressed":O,onClick:()=>P(_.id),className:`flex items-center gap-1.5 rounded border px-2 py-0.5 text-xs transition max-sm:py-1.5 ${kr}`,style:{borderColor:O?_.color:"var(--color-line)",color:C?"var(--color-fg-faint)":O?_.color:"var(--color-fg-dim)",background:O?"var(--color-bg-2)":"transparent"},title:O?`hide ${_.name}`:n.providers.length?`add ${_.name}`:`show only ${_.name}`,children:[F.jsx("span",{style:{color:_.color,opacity:C?.4:1},"aria-hidden":!0,children:O?"●":"○"}),_.name]},_.id)}),g.length>0&&F.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-fg-faint",title:"Billing-only providers — shown as cards with plan & quota; no usage timeline to filter",children:[p.length>0&&F.jsx("span",{className:"text-line-2",children:"|"}),F.jsx("span",{children:"billing-only:"}),g.map(_=>F.jsxs("span",{className:"flex items-center gap-1 text-fg-dim",children:[F.jsx("span",{style:{color:_.color,opacity:.55},"aria-hidden":!0,children:"·"}),_.name]},_.id))]})]}),F.jsxs("div",{className:"flex w-full flex-wrap items-center gap-2 md:ml-auto md:w-auto",children:[v.length>1?F.jsx(bx,{label:"account",value:n.account==="all"?"all":E?i4(S(E),i):"all",children:_=>F.jsxs(Px,{children:[F.jsx(Ru,{active:n.account==="all",onClick:()=>{o(O=>({...O,account:"all"})),_()},children:"All accounts"}),F.jsx("div",{className:"my-1 h-px bg-line"}),F.jsx("div",{className:"max-h-64 overflow-y-auto",children:v.map(O=>F.jsxs(Ru,{active:n.account===O.id,onClick:()=>{o(C=>({...C,account:O.id})),_()},children:[F.jsx("span",{style:{color:O.color},"aria-hidden":!0,children:"●"})," ",F.jsx(Cx,{value:S(O),privacyMode:i,className:"truncate"})]},O.id))})]})}):v.length===1?F.jsxs("span",{className:"rounded border border-line bg-bg-1 px-2 py-1 text-xs text-fg-dim",children:["account: ",F.jsx(Cx,{value:S(v[0]),privacyMode:i,className:"text-fg"})]}):null,F.jsx(bx,{label:"model",value:n.models.length===0?"all":n.models.length===1?Ex(n.models[0]):`${n.models.length} models`,children:()=>F.jsxs(Px,{children:[F.jsx(Ru,{active:n.models.length===0,onClick:()=>o(_=>({..._,models:[]})),children:"All models"}),F.jsx("div",{className:"my-1 h-px bg-line"}),F.jsxs("div",{className:"max-h-64 overflow-y-auto",children:[t.modelOptions.length===0&&F.jsx("div",{className:"px-2 py-1 text-xs text-fg-faint",children:"no models in range"}),t.modelOptions.map(_=>{const O=n.models.includes(_);return F.jsxs(Ru,{active:O,onClick:()=>o(C=>({...C,models:O?C.models.filter(D=>D!==_):[...C.models,_]})),children:[F.jsx("span",{className:O?"text-accent":"text-fg-faint","aria-hidden":!0,children:O?"◉":"○"})," ",Ex(_)]},_)})]})]})}),F.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[F.jsx("span",{className:"text-xs text-fg-faint",children:"range:"}),F.jsx(a4,{options:Ag.map(_=>({value:_.key,label:_.shortLabel})),value:n.period,onChange:_=>o(O=>({...O,period:_})),size:"sm",ariaLabel:"time range"})]}),H&&F.jsxs("button",{type:"button",onClick:()=>o(_=>({..._,providers:[],models:[],account:"all"})),className:`flex items-center gap-1 rounded border border-line bg-bg-1 px-2 py-1 text-xs text-fg-faint transition hover:border-line-2 hover:text-fg ${kr}`,title:"Clear provider, model & account filters","aria-label":"Clear provider, model and account filters",children:[F.jsx(t4,{className:"size-3","aria-hidden":!0})," clear"]})]})]})})}const u4=Y.lazy(()=>yr(()=>import("./share-sheet-BBs3U9QV.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(e=>({default:e.ShareSheet}))),__=Y.createContext(null),l4=()=>{const e=Y.useContext(__);if(!e)throw new Error("useShare must be used inside ShareProvider");return e};function f4({children:e}){const[t,n]=Y.useState(null);return F.jsxs(__.Provider,{value:n,children:[e,t?F.jsx(Y.Suspense,{fallback:F.jsx("div",{className:"fixed inset-0 z-[60] grid place-items-center bg-bg-0/70 text-sm text-fg-dim",role:"status","aria-live":"polite",children:"Preparing share preview…"}),children:F.jsx(u4,{source:t,onClose:()=>n(null)})}):null]})}function d4({derived:e,periodLabel:t,tz:n,version:o}){const i=l4();return F.jsxs("button",{type:"button",onClick:()=>i({kind:"summary",derived:e,periodLabel:t,tz:n,version:o}),className:`flex items-center gap-1.5 rounded border border-line bg-bg-1 px-2.5 py-1 text-xs text-fg-dim transition hover:border-accent/60 hover:text-accent active:scale-[0.97] max-sm:py-2 ${kr}`,title:"Create a shareable image",children:[F.jsx(ZD,{className:"size-3.5"}),F.jsx("span",{children:"share"})]})}const Fx=[{key:"overview",label:"overview"},{key:"analytics",label:"analytics"},{key:"models",label:"models"},{key:"explore",label:"explore"}];function h4(e=1e3){const[t,n]=Y.useState(()=>Date.now());return Y.useEffect(()=>{const o=setInterval(()=>n(Date.now()),e);return()=>clearInterval(o)},[e]),t}function m4({mode:e,resolvedMode:t,disabled:n,onToggle:o}){const i=e==="auto"?"light":e==="light"?"dark":"auto";return F.jsxs("button",{type:"button",onClick:o,disabled:n,title:`Theme: ${e}${e==="auto"?` (${t})`:""}. Switch to ${i}`,"aria-label":`Theme mode ${e}${e==="auto"?`, currently ${t}`:""}; switch to ${i}`,className:`relative rounded border border-line bg-bg-1 p-1.5 text-fg-dim transition hover:border-line-2 hover:text-fg disabled:opacity-40 max-sm:p-2.5 ${kr}`,children:[t==="dark"?F.jsx(n4,{className:"size-3.5"}):F.jsx(r4,{className:"size-3.5"}),e==="auto"&&F.jsx("span",{className:"absolute -right-1 -top-1 text-[8px] font-bold text-accent","aria-hidden":!0,children:"A"})]})}function p4({conn:e,freshAt:t}){const n=h4(),o=e==="live"?"var(--color-ok)":e==="error"?"var(--color-critical)":"var(--color-warning)",i=t?OD(t,n):null,c=e==="live"?i??"live":e==="connecting"?"connecting…":e==="reconnecting"?i?`reconnecting · ${i}`:"reconnecting…":i?`offline · ${i}`:"offline";return F.jsxs("span",{className:"flex items-center gap-1.5 text-xs",role:"status","aria-live":"polite",children:[F.jsxs("span",{className:"relative flex size-2","aria-hidden":!0,children:[e==="live"&&F.jsx("span",{className:"absolute inline-flex size-full animate-ping rounded-full opacity-60",style:{background:o}}),F.jsx("span",{className:"relative inline-flex size-2 rounded-full",style:{background:o}})]}),F.jsx("span",{className:"inline-block truncate text-fg-dim max-sm:max-w-[7rem]",children:c})]})}function Hh({label:e}){return F.jsxs("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-2 text-sm text-fg-dim",role:"status","aria-live":"polite",children:[F.jsxs("span",{className:"font-display text-lg text-fg-dim","aria-hidden":!0,children:["tokmon",F.jsx("span",{className:"cursor-blink text-accent",children:"▋"})]}),F.jsx("span",{className:"text-fg-faint",children:e})]})}function Kh(e,t){return e==="error"||e==="reconnecting"?"Connection lost — waiting for the local tokmon daemon…":t}function g4(){const e=document.getElementById("dashboard-content");e&&(e.scrollIntoView({block:"start"}),requestAnimationFrame(()=>e.focus({preventScroll:!0})))}function y4({onOpen:e}){return F.jsx("button",{type:"button",onClick:e,title:"Settings","aria-label":"Open settings",className:`rounded border border-line bg-bg-1 p-1.5 text-fg-dim transition hover:border-line-2 hover:text-fg max-sm:p-2.5 ${kr}`,children:F.jsx(s4,{className:"size-3.5"})})}function v4({phase:e,onRefresh:t}){const n=e==="refreshing"?"refreshing…":e==="success"?"updated":e==="error"?"refresh failed":"refresh";return F.jsxs("button",{type:"button",onClick:t,disabled:e==="refreshing",title:"Refresh all data (R)","aria-label":"Refresh all data",className:`flex items-center gap-1.5 rounded border border-line bg-bg-1 px-2 py-1.5 text-xs text-fg-dim transition hover:border-line-2 hover:text-fg disabled:cursor-wait ${kr}`,children:[F.jsx(o4,{className:`size-3.5 ${e==="refreshing"?"animate-spin motion-reduce:animate-none":""}`}),F.jsx("span",{className:e==="error"?"text-critical":"",children:n})]})}function S4({peak:e,resetDisplay:t,tz:n}){const o=e.state==="peak"?"var(--color-warning)":"var(--color-positive)",i=e.changesAt??(e.minutesUntilChange!=null?new Date(Date.now()+e.minutesUntilChange*6e4).toISOString():null);return F.jsxs("span",{className:"hidden items-center gap-1 text-xs text-fg-dim lg:flex",children:[F.jsx("span",{"aria-hidden":!0,style:{color:o},children:"●"}),F.jsx("span",{style:{color:o},children:e.label}),i&&F.jsxs("span",{className:"tnum text-fg-faint",children:["(",jD(i,t,Date.now(),n),")"]})]})}function x4(e,t){const n=e.providers.filter(c=>t.providers.has(c)),o=e.account==="all"||t.accounts.has(e.account)?e.account:"all",i=t.modelsReady?e.models.filter(c=>t.models.has(c)):e.models;return n.length===e.providers.length&&i.length===e.models.length&&o===e.account?e:{...e,providers:n,account:o,models:i}}function Mg(e,t,n){try{return e(t)}catch(o){return r2("[nuqs] Error while parsing value `%s`: %O"+(n?" (for key `%s`)":""),t,o,n),null}}function ur(e){function t(n){if(typeof n>"u")return null;let o="";if(Array.isArray(n)){if(n[0]===void 0)return null;o=n[0]}return typeof n=="string"&&(o=n),Mg(e.parse,o)}return{type:"single",eq:(n,o)=>n===o,...e,parseServerSide:t,withDefault(n){return{...this,defaultValue:n,parseServerSide(o){return t(o)??n}}},withOptions(n){return{...this,...n}}}}const Qh=ur({parse:e=>e,serialize:String});ur({parse:e=>{const t=parseInt(e);return t==t?t:null},serialize:e=>""+Math.round(e)});ur({parse:e=>{const t=parseInt(e);return t==t?t-1:null},serialize:e=>""+Math.round(e+1)});ur({parse:e=>{const t=parseInt(e,16);return t==t?t:null},serialize:e=>{const t=Math.round(e).toString(16);return(t.length&1?"0":"")+t}});ur({parse:e=>{const t=parseFloat(e);return t==t?t:null},serialize:String});ur({parse:e=>e.toLowerCase()==="true",serialize:String});function Lg(e,t){return e.valueOf()===t.valueOf()}ur({parse:e=>{const t=parseInt(e);return t==t?new Date(t):null},serialize:e=>""+e.valueOf(),eq:Lg});ur({parse:e=>{const t=new Date(e);return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString(),eq:Lg});ur({parse:e=>{const t=new Date(e.slice(0,10));return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString().slice(0,10),eq:Lg});function w4(e){return k4(e)}function k4(e){return ur({parse:t=>{const n=t;return e.includes(n)?n:null},serialize:String})}function Ix(e,t=","){const n=e.eq??((i,c)=>i===c),o=encodeURIComponent(t);return ur({parse:i=>i===""?[]:i.split(t).map((c,l)=>Mg(e.parse,c.replaceAll(o,t),`[${l}]`)).filter(c=>c!=null),serialize:i=>i.map(c=>(e.serialize?e.serialize(c):String(c)).replaceAll(t,o)).join(t),eq(i,c){return i===c?!0:i.length!==c.length?!1:i.every((l,d)=>n(l,c[d]))}})}const Jh=lp(),E4={};function _4(e,t={}){const n=Y.useId(),o=f2(),i=d2(),{history:c="replace",scroll:l=(o==null?void 0:o.scroll)??!1,shallow:d=(o==null?void 0:o.shallow)??!0,throttleMs:h=Ea.timeMs,limitUrlUpdates:p=o==null?void 0:o.limitUrlUpdates,clearOnDefault:y=(o==null?void 0:o.clearOnDefault)??!0,startTransition:g,urlKeys:v=E4}=t,w=Object.keys(e).join(","),S=Y.useMemo(()=>Object.fromEntries(Object.keys(e).map($=>[$,v[$]??$])),[w,JSON.stringify(v)]),E=l2(Object.values(S)),P=E.searchParams,H=Y.useRef({}),_=Y.useMemo(()=>Object.fromEntries(Object.keys(e).map($=>[$,e[$].defaultValue??null])),[Object.values(e).map(({defaultValue:$})=>$).join(",")]),O=ph.useQueuedQueries(Object.values(S)),[C,D]=Y.useState(()=>Gh(e,v,P??new URLSearchParams,O).state),T=Y.useRef(C);if(tt("[nuq+ %s `%s`] render - state: %O, iSP: %s",n,w,C,P),Object.keys(H.current).join("&")!==Object.values(S).join("&")){const{state:$,hasChanged:q}=Gh(e,v,P,O,H.current,T.current);q&&(tt("[nuq+ %s `%s`] State changed: %O",n,w,{state:$,initialSearchParams:P,queuedQueries:O,queryRef:H.current,stateRef:T.current}),T.current=$,D($)),H.current=Object.fromEntries(Object.entries(S).map(([ee,se])=>{var K;return[se,((K=e[ee])==null?void 0:K.type)==="multi"?P==null?void 0:P.getAll(se):(P==null?void 0:P.get(se))??null]}))}Y.useEffect(()=>{const{state:$,hasChanged:q}=Gh(e,v,P,O,H.current,T.current);q&&(tt("[nuq+ %s `%s`] State changed: %O",n,w,{state:$,initialSearchParams:P,queuedQueries:O,queryRef:H.current,stateRef:T.current}),T.current=$,D($))},[Object.values(S).map($=>`${$}=${P==null?void 0:P.getAll($)}`).join("&"),JSON.stringify(O)]),Y.useEffect(()=>{const $=Object.keys(e).reduce((q,ee)=>(q[ee]=({state:se,query:K})=>{D(k=>{const{defaultValue:U}=e[ee],V=S[ee],J=se??U??null,B=k[ee]??U??null;return Object.is(B,J)?(tt("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). no change, skipping, resolved: %O",n,w,V,se,U,T.current),k):(T.current={...T.current,[ee]:J},H.current[V]=K,tt("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). updateInternalState, resolved: %O",n,w,V,se,U,T.current),T.current)})},q),{});for(const q of Object.keys(e)){const ee=S[q];tt("[nuq+ %s `%s`] Subscribing to sync for `%s`",n,ee,w),Jh.on(ee,$[q])}return()=>{for(const q of Object.keys(e)){const ee=S[q];tt("[nuq+ %s `%s`] Unsubscribing to sync for `%s`",n,ee,w),Jh.off(ee,$[q])}}},[w,S]);const L=Y.useCallback(($,q={})=>{var B,X,ne,te,I,Z;const ee=Object.fromEntries(Object.keys(e).map(pe=>[pe,null])),se=typeof $=="function"?$(Rx(T.current,_))??ee:$??ee;tt("[nuq+ %s `%s`] setState: %O",n,w,se);let K,k=0,U=!1;const V=[];for(let[pe,me]of Object.entries(se)){const le=e[pe],Pe=S[pe];if(!le||me===void 0)continue;(q.clearOnDefault??le.clearOnDefault??y)&&me!==null&&le.defaultValue!==void 0&&(le.eq??((be,Ve)=>be===Ve))(me,le.defaultValue)&&(me=null);const fe=me===null?null:(le.serialize??String)(me);Jh.emit(Pe,{state:me,query:fe});const xe={key:Pe,query:fe,options:{history:q.history??le.history??c,shallow:q.shallow??le.shallow??d,scroll:q.scroll??le.scroll??l,startTransition:q.startTransition??le.startTransition??g}};if(((B=q==null?void 0:q.limitUrlUpdates)==null?void 0:B.method)==="debounce"||(p==null?void 0:p.method)==="debounce"||((X=le.limitUrlUpdates)==null?void 0:X.method)==="debounce"){xe.options.shallow===!0&&console.warn(Ja(422));const be=((ne=q==null?void 0:q.limitUrlUpdates)==null?void 0:ne.timeMs)??(p==null?void 0:p.timeMs)??((te=le.limitUrlUpdates)==null?void 0:te.timeMs)??Ea.timeMs,Ve=ph.push(xe,be,E,i);k<be&&(K=Ve,k=be)}else{const be=((I=q==null?void 0:q.limitUrlUpdates)==null?void 0:I.timeMs)??((Z=le==null?void 0:le.limitUrlUpdates)==null?void 0:Z.timeMs)??(p==null?void 0:p.timeMs)??q.throttleMs??le.throttleMs??h;V.push(ph.abort(Pe)),Nu.push(xe,be),U=!0}}const J=V.reduce((pe,me)=>me(pe),U?Nu.flush(E,i):Nu.getPendingPromise(E));return K??J},[w,c,d,l,h,p==null?void 0:p.method,p==null?void 0:p.timeMs,g,S,E.updateUrl,E.getSearchParamsSnapshot,E.rateLimitFactor,i,_]);return[Y.useMemo(()=>Rx(C,_),[C,_]),L]}function Gh(e,t,n,o,i,c){let l=!1;const d=Object.entries(e).reduce((h,[p,y])=>{const g=(t==null?void 0:t[p])??p,v=o[g],w=y.type==="multi"?[]:null,S=v===void 0?(y.type==="multi"?n==null?void 0:n.getAll(g):n==null?void 0:n.get(g))??w:v;return i&&c&&xw(i[g]??w,S)?(h[p]=c[p]??null,h):(l=!0,h[p]=(p2(S)?null:Mg(y.parse,S,g))??null,i&&(i[g]=S),h)},{});if(!l){const h=Object.keys(e),p=Object.keys(c??{});l=h.length!==p.length||h.some(y=>!p.includes(y))}return{state:d,hasChanged:l}}function Rx(e,t){return Object.fromEntries(Object.keys(e).map(n=>[n,e[n]??t[n]??null]))}function C4(){const[e,t]=_4({p:Ix(Qh).withDefault([]),m:Ix(Qh).withDefault([]),a:Qh.withDefault("all"),period:w4(Ag.map(i=>i.key)).withDefault(BD.period)},{history:"replace"}),n=Y.useMemo(()=>({providers:e.p,models:e.m,account:e.a,period:e.period}),[e.p,e.m,e.a,e.period]),o=Y.useCallback(i=>{t(c=>{const l={providers:c.p,models:c.m,account:c.a,period:c.period},d=typeof i=="function"?i(l):i;return{p:d.providers,m:d.models,a:d.account,period:d.period}})},[t]);return[n,o]}const Tx=Symbol.for("~effect/http/Headers"),Ha=Object.create(null);Object.defineProperties(Ha,{[Tx]:{value:Tx},[$l]:{value(e){return I4(this,ro(e,R4))}},toJSON:{value(){return Ul(this)}},[sn]:{value(e){return P4(this,e)}},[rn]:{value(){return Cp(this)}},toString:{value:xS.toString},[uo]:{value:xS[uo]}});const b4=e=>Object.assign(Object.create(Ha),e),P4=fR(SI()),Og=Object.create(Ha),F4=e=>{if(e===void 0)return Og;if(Symbol.iterator in e){const n=Object.create(Ha);for(const[o,i]of e)n[o.toLowerCase()]=i;return n}const t=Object.create(Ha);for(const[n,o]of Object.entries(e))Array.isArray(o)?t[n.toLowerCase()]=o.join(", "):o!==void 0&&(t[n.toLowerCase()]=o);return t},Ax=re(2,(e,t)=>{const n=b4(e);return Object.assign(n,t),n}),I4=re(2,(e,t)=>{const n={...e},o=i=>{if(typeof i=="string"){const c=i.toLowerCase();c in e&&(n[c]=GS(e[c]))}else for(const c in e)i.test(c)&&(n[c]=GS(e[c]))};if(Array.isArray(t))for(let i=0;i<t.length;i++)o(t[i]);else o(t);return n}),R4=rt("effect/Headers/CurrentRedactedNames",{defaultValue:()=>["authorization","cookie","set-cookie","x-api-key"]}),T4="~effect/http/HttpClientError";class Ng extends Wn(T4)({_tag:Sn("HttpError"),kind:nt(["EncodeError","DecodeError","TransportError","InvalidUrlError","StatusCodeError","EmptyBodyError"]),cause:ki(cr)}){static fromHttpClientError(t){return new Ng({_tag:"HttpError",kind:t.reason._tag,cause:t.reason})}}const Mx="~effect/socket/Socket",Dg=qn("effect/socket/Socket"),A4=e=>Dg.of({[Mx]:Mx,runRaw:e.runRaw,run:e.run??((t,n)=>e.runRaw(o=>typeof o=="string"?t(M4.encode(o)):o instanceof Uint8Array?t(o):t(new Uint8Array(o)),n)),runString:e.runString??(e.run?(t,n)=>e.run(o=>t(Yh.decode(o)),n):(t,n)=>e.runRaw(o=>typeof o=="string"?t(o):o instanceof Uint8Array?t(Yh.decode(o)):t(Yh.decode(new Uint8Array(o))),n)),writer:e.writer}),M4=new TextEncoder,Yh=new TextDecoder,L4="~effect/socket/Socket/CloseEvent",O4=e=>Ue(e,L4),Ju="~effect/socket/Socket/SocketError",N4=e=>Ue(e,Ju);class C_ extends Wn("effect/socket/Socket/SocketReadError")({_tag:Sn("SocketReadError"),cause:cr}){constructor(){super(...arguments);M(this,"message","An error occurred during Read")}}class D4 extends Wn("effect/socket/Socket/SocketWriteError")({_tag:Sn("SocketWriteError"),cause:cr}){constructor(){super(...arguments);M(this,"message","An error occurred during Write")}}class Pl extends Wn("effect/socket/Socket/SocketOpenError")({_tag:Sn("SocketOpenError"),kind:nt(["Unknown","Timeout"]),cause:cr}){get message(){return this.kind==="Timeout"?'timeout waiting for "open"':"An error occurred during Open"}}class Fl extends Wn("effect/socket/Socket/SocketCloseError")({_tag:Sn("SocketCloseError"),code:bg,closeReason:ki(de)}){static filterClean(t){return function(n){return ai.is(n)&&n.reason._tag==="SocketCloseError"&&t(n.reason.code)?qr(n.reason):rr(n)}}get message(){return this.closeReason?`${this.code}: ${this.closeReason}`:`${this.code}`}}const b_=nn([C_,D4,Pl,Fl]);var mw,pw;class ai extends(pw=yf(Ju)("SocketError",{_tag:Sn("SocketError"),reason:b_}),mw=Ju,pw){constructor(n){var t=(...B6)=>(super(...B6),M(this,mw,Ju),M(this,"message",this.reason.message),this);"cause"in n.reason?t({...n,cause:n.reason.cause}):t(n)}static is(n){return N4(n)}}const j4=e=>!0;class $4 extends qn()("~effect/socket/Socket/WebSocket"){}class P_ extends qn()("@effect/platform/Socket/WebSocketConstructor"){}const U4=og(P_)((e,t)=>new globalThis.WebSocket(e,t)),B4=(e,t)=>P_.use(n=>z4(uE((typeof e=="string"?lt(e):e).pipe(Rs(o=>n(o,t==null?void 0:t.protocols))),o=>Un(()=>o.close(1e3))),t)),z4=(e,t)=>dl(n=>{let o;const i=YE(!1),c=n.context,l=(t==null?void 0:t.closeCodeIsError)??j4,d=(y,g)=>FL(oo(function*(v){const w=yield*MN().pipe(ul(v)),S=yield*ul(e,v),E=yield*PL(DN(w)(),$4,S);let P=!1;function H(C){if(C.data instanceof Blob){const T=Rn(uL(()=>C.data.arrayBuffer()),L=>{const $=y(new Uint8Array(L));return ii($)?$:ht});return E(T)}const D=y(C.data);ii(D)&&E(D)}function _(C){S.removeEventListener("message",H),S.removeEventListener("close",O),ba(w.deferred,Je(new ai({reason:P?new C_({cause:C}):new Pl({kind:"Unknown",cause:C})})))}function O(C){const D=typeof C.code=="number"?C.code:1001;S.removeEventListener("message",H),S.removeEventListener("error",_),ba(w.deferred,Je(new ai({reason:new Fl({code:D,closeReason:C.reason})})))}if(S.addEventListener("close",O,{once:!0}),S.addEventListener("error",_,{once:!0}),S.addEventListener("message",H),S.readyState!==1){const C=Zp();S.addEventListener("open",()=>{P=!0,ba(C,ht)},{once:!0}),yield*eg(C).pipe(iE({duration:(t==null?void 0:t.openTimeout)??1e4,orElse:()=>Je(new ai({reason:new Pl({kind:"Timeout",cause:new Error('timeout waiting for "open"')})}))}),aE(yx(w)))}return P=!0,o=S,i.openUnsafe(),g!=null&&g.onOpen&&(yield*g.onOpen),yield*yL(yx(w),Fl.filterClean(C=>!l(C)),()=>ht)})).pipe(bL(v=>di(c,v)),lE(Un(()=>{i.closeUnsafe(),o=void 0}))),p=lt(y=>i.whenOpen(Un(()=>{const g=o;O4(y)?g.close(y.code,y.reason):g.send(y)})));return lt(A4({runRaw:d,writer:p}))}),V4=d1(B4,Rm(Dg));class F_ extends qn()("effect/workers/Transferable/Collector"){}const q4=()=>{let e=[];const t=i=>{e.push(...i)},n=()=>e,o=()=>{const i=e;return e=[],i};return F_.of({addAllUnsafe:t,addAll:i=>Un(()=>t(i)),readUnsafe:n,read:Un(n),clearUnsafe:o,clear:Un(o)})};class W4 extends Wn("effect/workers/WorkerError/WorkerSpawnError")({_tag:Sn("WorkerSpawnError"),message:de,cause:ki(cr)}){}class H4 extends Wn("effect/workers/WorkerError/WorkerSendError")({_tag:Sn("WorkerSendError"),message:de,cause:ki(cr)}){}class K4 extends Wn("effect/workers/WorkerError/WorkerReceiveError")({_tag:Sn("WorkerReceiveError"),message:de,cause:ki(cr)}){}class Q4 extends Wn("effect/workers/WorkerError/WorkerUnknownError")({_tag:Sn("WorkerUnknownError"),message:de,cause:ki(cr)}){}const J4=nn([W4,H4,K4,Q4]),Xh="~effect/rpc/RpcClientError";class Gm extends Wn("effect/rpc/RpcClientError/RpcClientDefect")({_tag:Sn("RpcClientDefect"),message:de,cause:cr}){}var gw,yw;class Ym extends(yw=Wn(Xh)({_tag:Sn("RpcClientError"),reason:nn([J4,b_,Ng,Gm])}),gw=Xh,yw){constructor(){super(...arguments);M(this,gw,Xh)}get message(){return`${this.reason._tag}: ${this.reason.message}`}}const Tu=e=>typeof e=="bigint"?e:BigInt(e),G4={_tag:"Ping"};var Xm;try{Xm=new TextDecoder}catch{}var ue,Sr,N=0,Qe={},Oe,ys,$n=0,gr=0,It,Vr,yn=[],Me,Lx={useRecords:!1,mapsAsObjects:!0};class I_{}const R_=new I_;R_.name="MessagePack 0xC1";var ws=!1,Ox=2,Y4;class Ka{constructor(t){t&&(t.useRecords===!1&&t.mapsAsObjects===void 0&&(t.mapsAsObjects=!0),t.sequential&&t.trusted!==!1&&(t.trusted=!0,!t.structures&&t.useRecords!=!1&&(t.structures=[],t.maxSharedStructures||(t.maxSharedStructures=0))),t.structures?t.structures.sharedLength=t.structures.length:t.getStructures&&((t.structures=[]).uninitialized=!0,t.structures.sharedLength=0),t.int64AsNumber&&(t.int64AsType="number")),Object.assign(this,t)}unpack(t,n){if(ue)return N_(()=>(ep(),this?this.unpack(t,n):Ka.prototype.unpack.call(Lx,t,n)));!t.buffer&&t.constructor===ArrayBuffer&&(t=typeof Buffer<"u"?Buffer.from(t):new Uint8Array(t)),typeof n=="object"?(Sr=n.end||t.length,N=n.start||0):(N=0,Sr=n>-1?n:t.length),gr=0,ys=null,It=null,ue=t;try{Me=t.dataView||(t.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength))}catch(o){throw ue=null,t instanceof Uint8Array?o:new Error("Source must be a Uint8Array or Buffer but was a "+(t&&typeof t=="object"?t.constructor.name:typeof t))}if(this instanceof Ka){if(Qe=this,this.structures)return Oe=this.structures,Au(n);(!Oe||Oe.length>0)&&(Oe=[])}else Qe=Lx,(!Oe||Oe.length>0)&&(Oe=[]);return Au(n)}unpackMultiple(t,n){let o,i=0;try{ws=!0;let c=t.length,l=this?this.unpack(t,c):vf.unpack(t,c);if(n){if(n(l,i,N)===!1)return;for(;N<c;)if(i=N,n(Au(),i,N)===!1)return}else{for(o=[l];N<c;)i=N,o.push(Au());return o}}catch(c){throw c.lastPosition=i,c.values=o,c}finally{ws=!1,ep()}}_mergeStructures(t,n){t=t||[],Object.isFrozen(t)&&(t=t.map(o=>o.slice(0)));for(let o=0,i=t.length;o<i;o++){let c=t[o];c&&(c.isShared=!0,o>=32&&(c.highByte=o-32>>5))}t.sharedLength=t.length;for(let o in n||[])if(o>=0){let i=t[o],c=n[o];c&&(i&&((t.restoreStructures||(t.restoreStructures=[]))[o]=i),t[o]=c)}return this.structures=t}decode(t,n){return this.unpack(t,n)}}function Au(e){try{if(!Qe.trusted&&!ws){let n=Oe.sharedLength||0;n<Oe.length&&(Oe.length=n)}let t;if(Qe.randomAccessStructure&&ue[N]<64&&ue[N]>=32&&Y4||(t=mt()),It&&(N=It.postBundlePosition,It=null),ws&&(Oe.restoreStructures=null),N==Sr)Oe&&Oe.restoreStructures&&Nx(),Oe=null,ue=null,Vr&&(Vr=null);else{if(N>Sr)throw new Error("Unexpected end of MessagePack data");if(!ws){let n;try{n=JSON.stringify(t,(o,i)=>typeof i=="bigint"?`${i}n`:i).slice(0,100)}catch(o){n="(JSON view not available "+o+")"}throw new Error("Data read, but end of buffer not reached "+n)}}return t}catch(t){throw Oe&&Oe.restoreStructures&&Nx(),ep(),(t instanceof RangeError||t.message.startsWith("Unexpected end of buffer")||N>Sr)&&(t.incomplete=!0),t}}function Nx(){for(let e in Oe.restoreStructures)Oe[e]=Oe.restoreStructures[e];Oe.restoreStructures=null}function mt(){let e=ue[N++];if(e<160)if(e<128){if(e<64)return e;{let t=Oe[e&63]||Qe.getStructures&&T_()[e&63];return t?(t.read||(t.read=jg(t,e&63)),t.read()):e}}else if(e<144)if(e-=128,Qe.mapsAsObjects){let t={};for(let n=0;n<e;n++){let o=M_();o==="__proto__"&&(o="__proto_"),t[o]=mt()}return t}else{let t=new Map;for(let n=0;n<e;n++)t.set(mt(),mt());return t}else{e-=144;let t=new Array(e);for(let n=0;n<e;n++)t[n]=mt();return Qe.freezeData?Object.freeze(t):t}else if(e<192){let t=e-160;if(gr>=N)return ys.slice(N-$n,(N+=t)-$n);if(gr==0&&Sr<140){let n=t<16?$g(t):A_(t);if(n!=null)return n}return Zm(t)}else{let t;switch(e){case 192:return null;case 193:return It?(t=mt(),t>0?It[1].slice(It.position1,It.position1+=t):It[0].slice(It.position0,It.position0-=t)):R_;case 194:return!1;case 195:return!0;case 196:if(t=ue[N++],t===void 0)throw new Error("Unexpected end of buffer");return Zh(t);case 197:return t=Me.getUint16(N),N+=2,Zh(t);case 198:return t=Me.getUint32(N),N+=4,Zh(t);case 199:return Ks(ue[N++]);case 200:return t=Me.getUint16(N),N+=2,Ks(t);case 201:return t=Me.getUint32(N),N+=4,Ks(t);case 202:if(t=Me.getFloat32(N),Qe.useFloat32>2){let n=Ug[(ue[N]&127)<<1|ue[N+1]>>7];return N+=4,(n*t+(t>0?.5:-.5)>>0)/n}return N+=4,t;case 203:return t=Me.getFloat64(N),N+=8,t;case 204:return ue[N++];case 205:return t=Me.getUint16(N),N+=2,t;case 206:return t=Me.getUint32(N),N+=4,t;case 207:return Qe.int64AsType==="number"?(t=Me.getUint32(N)*4294967296,t+=Me.getUint32(N+4)):Qe.int64AsType==="string"?t=Me.getBigUint64(N).toString():Qe.int64AsType==="auto"?(t=Me.getBigUint64(N),t<=BigInt(2)<<BigInt(52)&&(t=Number(t))):t=Me.getBigUint64(N),N+=8,t;case 208:return Me.getInt8(N++);case 209:return t=Me.getInt16(N),N+=2,t;case 210:return t=Me.getInt32(N),N+=4,t;case 211:return Qe.int64AsType==="number"?(t=Me.getInt32(N)*4294967296,t+=Me.getUint32(N+4)):Qe.int64AsType==="string"?t=Me.getBigInt64(N).toString():Qe.int64AsType==="auto"?(t=Me.getBigInt64(N),t>=BigInt(-2)<<BigInt(52)&&t<=BigInt(2)<<BigInt(52)&&(t=Number(t))):t=Me.getBigInt64(N),N+=8,t;case 212:if(t=ue[N++],t==114)return zx(ue[N++]&63);{let n=yn[t];if(n)return n.read?(N++,n.read(mt())):n.noBuffer?(N++,n()):n(ue.subarray(N,++N));throw new Error("Unknown extension "+t)}case 213:return t=ue[N],t==114?(N++,zx(ue[N++]&63,ue[N++])):Ks(2);case 214:return Ks(4);case 215:return Ks(8);case 216:return Ks(16);case 217:return t=ue[N++],gr>=N?ys.slice(N-$n,(N+=t)-$n):Z4(t);case 218:return t=Me.getUint16(N),N+=2,gr>=N?ys.slice(N-$n,(N+=t)-$n):ej(t);case 219:return t=Me.getUint32(N),N+=4,gr>=N?ys.slice(N-$n,(N+=t)-$n):tj(t);case 220:return t=Me.getUint16(N),N+=2,jx(t);case 221:return t=Me.getUint32(N),N+=4,jx(t);case 222:return t=Me.getUint16(N),N+=2,$x(t);case 223:return t=Me.getUint32(N),N+=4,$x(t);default:if(e>=224)return e-256;if(e===void 0){let n=new Error("Unexpected end of MessagePack data");throw n.incomplete=!0,n}throw new Error("Unknown MessagePack token "+e)}}}const X4=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function jg(e,t){function n(){if(n.count++>Ox){let i;try{i=e.read=new Function("r","return function(){return "+(Qe.freezeData?"Object.freeze":"")+"({"+e.map(c=>c==="__proto__"?"__proto_:r()":X4.test(c)?c+":r()":"["+JSON.stringify(c)+"]:r()").join(",")+"})}")(mt)}catch{return Ox=1/0,n()}return e.read0=i,e.highByte===0&&(e.read=Dx(t,e.read)),i()}let o={};for(let i=0,c=e.length;i<c;i++){let l=e[i];l==="__proto__"&&(l="__proto_"),o[l]=mt()}return Qe.freezeData?Object.freeze(o):o}return n.count=0,e.read0=n,e.highByte===0?Dx(t,n):n}const Dx=(e,t)=>function(){let n=ue[N++];if(n===0)return t();let o=e<32?-(e+(n<<5)):e+(n<<5),i=Oe[o]||T_()[o];if(!i)throw new Error("Record id is not defined for "+o);return i.read||(i.read=jg(i,e)),i.read()};function T_(){let e=N_(()=>(ue=null,Qe.getStructures()));return Oe=Qe._mergeStructures(e,Oe)}var Zm=hc,Z4=hc,ej=hc,tj=hc;function hc(e){let t;if(e<16&&(t=$g(e)))return t;if(e>64&&Xm)return Xm.decode(ue.subarray(N,N+=e));const n=N+e,o=[];for(t="";N<n;){const i=ue[N++];if((i&128)===0)o.push(i);else if((i&224)===192){const c=ue[N++]&63,l=(i&31)<<6|c;l<128?o.push(65533):o.push(l)}else if((i&240)===224){const c=ue[N++]&63,l=ue[N++]&63,d=(i&31)<<12|c<<6|l;d<2048||d>=55296&&d<=57343?o.push(65533):o.push(d)}else if((i&248)===240){const c=ue[N++]&63,l=ue[N++]&63,d=ue[N++]&63;let h=(i&7)<<18|c<<12|l<<6|d;h<65536||h>1114111?o.push(65533):(h>65535&&(h-=65536,o.push(h>>>10&1023|55296),h=56320|h&1023),o.push(h))}else o.push(65533);o.length>=4096&&(t+=Pt.apply(String,o),o.length=0)}return o.length>0&&(t+=Pt.apply(String,o)),t}function jx(e){let t=new Array(e);for(let n=0;n<e;n++)t[n]=mt();return Qe.freezeData?Object.freeze(t):t}function $x(e){if(Qe.mapsAsObjects){let t={};for(let n=0;n<e;n++){let o=M_();o==="__proto__"&&(o="__proto_"),t[o]=mt()}return t}else{let t=new Map;for(let n=0;n<e;n++)t.set(mt(),mt());return t}}var Pt=String.fromCharCode;function A_(e){let t=N,n=new Array(e);for(let o=0;o<e;o++){const i=ue[N++];if((i&128)>0){N=t;return}n[o]=i}return Pt.apply(String,n)}function $g(e){if(e<4)if(e<2){if(e===0)return"";{let t=ue[N++];if((t&128)>1){N-=1;return}return Pt(t)}}else{let t=ue[N++],n=ue[N++];if((t&128)>0||(n&128)>0){N-=2;return}if(e<3)return Pt(t,n);let o=ue[N++];if((o&128)>0){N-=3;return}return Pt(t,n,o)}else{let t=ue[N++],n=ue[N++],o=ue[N++],i=ue[N++];if((t&128)>0||(n&128)>0||(o&128)>0||(i&128)>0){N-=4;return}if(e<6){if(e===4)return Pt(t,n,o,i);{let c=ue[N++];if((c&128)>0){N-=5;return}return Pt(t,n,o,i,c)}}else if(e<8){let c=ue[N++],l=ue[N++];if((c&128)>0||(l&128)>0){N-=6;return}if(e<7)return Pt(t,n,o,i,c,l);let d=ue[N++];if((d&128)>0){N-=7;return}return Pt(t,n,o,i,c,l,d)}else{let c=ue[N++],l=ue[N++],d=ue[N++],h=ue[N++];if((c&128)>0||(l&128)>0||(d&128)>0||(h&128)>0){N-=8;return}if(e<10){if(e===8)return Pt(t,n,o,i,c,l,d,h);{let p=ue[N++];if((p&128)>0){N-=9;return}return Pt(t,n,o,i,c,l,d,h,p)}}else if(e<12){let p=ue[N++],y=ue[N++];if((p&128)>0||(y&128)>0){N-=10;return}if(e<11)return Pt(t,n,o,i,c,l,d,h,p,y);let g=ue[N++];if((g&128)>0){N-=11;return}return Pt(t,n,o,i,c,l,d,h,p,y,g)}else{let p=ue[N++],y=ue[N++],g=ue[N++],v=ue[N++];if((p&128)>0||(y&128)>0||(g&128)>0||(v&128)>0){N-=12;return}if(e<14){if(e===12)return Pt(t,n,o,i,c,l,d,h,p,y,g,v);{let w=ue[N++];if((w&128)>0){N-=13;return}return Pt(t,n,o,i,c,l,d,h,p,y,g,v,w)}}else{let w=ue[N++],S=ue[N++];if((w&128)>0||(S&128)>0){N-=14;return}if(e<15)return Pt(t,n,o,i,c,l,d,h,p,y,g,v,w,S);let E=ue[N++];if((E&128)>0){N-=15;return}return Pt(t,n,o,i,c,l,d,h,p,y,g,v,w,S,E)}}}}}function Ux(){let e=ue[N++],t;if(e<192)t=e-160;else switch(e){case 217:t=ue[N++];break;case 218:t=Me.getUint16(N),N+=2;break;case 219:t=Me.getUint32(N),N+=4;break;default:throw new Error("Expected string")}return hc(t)}function Zh(e){return Qe.copyBuffers?Uint8Array.prototype.slice.call(ue,N,N+=e):ue.subarray(N,N+=e)}function Ks(e){let t=ue[N++];if(yn[t]){let n;return yn[t](ue.subarray(N,n=N+=e),o=>{N=o;try{return mt()}finally{N=n}})}else throw new Error("Unknown extension type "+t)}var Bx=new Array(4096);function M_(){let e=ue[N++];if(e>=160&&e<192){if(e=e-160,gr>=N)return ys.slice(N-$n,(N+=e)-$n);if(!(gr==0&&Sr<180))return Zm(e)}else return N--,L_(mt());let t=(e<<5^(e>1?Me.getUint16(N):e>0?ue[N]:0))&4095,n=Bx[t],o=N,i=N+e-3,c,l=0;if(n&&n.bytes==e){for(;o<i;){if(c=Me.getUint32(o),c!=n[l++]){o=1879048192;break}o+=4}for(i+=3;o<i;)if(c=ue[o++],c!=n[l++]){o=1879048192;break}if(o===i)return N=o,n.string;i-=3,o=N}for(n=[],Bx[t]=n,n.bytes=e;o<i;)c=Me.getUint32(o),n.push(c),o+=4;for(i+=3;o<i;)c=ue[o++],n.push(c);let d=e<16?$g(e):A_(e);return d!=null?n.string=d:n.string=Zm(e)}function L_(e){if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return e.toString();if(e==null)return e+"";if(Qe.allowArraysInMapKeys&&Array.isArray(e)&&e.flat().every(t=>["string","number","boolean","bigint"].includes(typeof t)))return e.flat().toString();throw new Error(`Invalid property type for record: ${typeof e}`)}const zx=(e,t)=>{let n=mt().map(L_),o=e;t!==void 0&&(e=e<32?-((t<<5)+e):(t<<5)+e,n.highByte=t);let i=Oe[e];return i&&(i.isShared||ws)&&((Oe.restoreStructures||(Oe.restoreStructures=[]))[e]=i),Oe[e]=n,n.read=jg(n,o),(n.read0||n.read)()};yn[0]=()=>{};yn[0].noBuffer=!0;yn[66]=e=>{let t=e.byteLength%8||8,n=BigInt(e[0]&128?e[0]-256:e[0]);for(let o=1;o<t;o++)n<<=BigInt(8),n+=BigInt(e[o]);if(e.byteLength!==t){let o=new DataView(e.buffer,e.byteOffset,e.byteLength),i=(c,l)=>{let d=l-c;if(d<=40){let g=o.getBigUint64(c);for(let v=c+8;v<l;v+=8)g<<=BigInt(64),g|=o.getBigUint64(v);return g}let h=c+(d>>4<<3),p=i(c,h),y=i(h,l);return p<<BigInt((l-h)*8)|y};n=n<<BigInt((o.byteLength-t)*8)|i(t,o.byteLength)}return n};let Vx={Error,EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError,AggregateError:typeof AggregateError=="function"?AggregateError:null};yn[101]=()=>{let e=mt();if(!Vx[e[0]]){let t=Error(e[1],{cause:e[2]});return t.name=e[0],t}return Vx[e[0]](e[1],{cause:e[2]})};yn[105]=e=>{if(Qe.structuredClone===!1)throw new Error("Structured clone extension is disabled");let t=Me.getUint32(N-4);Vr||(Vr=new Map);let n=ue[N],o;n>=144&&n<160||n==220||n==221?o=[]:n>=128&&n<144||n==222||n==223?o=new Map:(n>=199&&n<=201||n>=212&&n<=216)&&ue[N+1]===115?o=new Set:o={};let i={target:o};Vr.set(t,i);let c=mt();if(i.used)Object.assign(o,c);else return i.target=c;if(o instanceof Map)for(let[l,d]of c.entries())o.set(l,d);if(o instanceof Set)for(let l of Array.from(c))o.add(l);return o};yn[112]=e=>{if(Qe.structuredClone===!1)throw new Error("Structured clone extension is disabled");let t=Me.getUint32(N-4),n=Vr.get(t);return n.used=!0,n.target};yn[115]=()=>new Set(mt());const O_=["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64","BigInt64","BigUint64"].map(e=>e+"Array");let nj=typeof globalThis=="object"?globalThis:window;yn[116]=e=>{let t=e[0],n=Uint8Array.prototype.slice.call(e,1).buffer,o=O_[t];if(!o){if(t===16)return n;if(t===17)return new DataView(n);throw new Error("Could not find typed array for code "+t)}return new nj[o](n)};yn[120]=()=>{let e=mt();return new RegExp(e[0],e[1])};const rj=[];yn[98]=e=>{let t=(e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3],n=N;return N+=t-e.length,It=rj,It=[Ux(),Ux()],It.position0=0,It.position1=0,It.postBundlePosition=N,N=n,mt()};yn[255]=e=>e.length==4?new Date((e[0]*16777216+(e[1]<<16)+(e[2]<<8)+e[3])*1e3):e.length==8?new Date(((e[0]<<22)+(e[1]<<14)+(e[2]<<6)+(e[3]>>2))/1e6+((e[3]&3)*4294967296+e[4]*16777216+(e[5]<<16)+(e[6]<<8)+e[7])*1e3):e.length==12?new Date(((e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3])/1e6+((e[4]&128?-281474976710656:0)+e[6]*1099511627776+e[7]*4294967296+e[8]*16777216+(e[9]<<16)+(e[10]<<8)+e[11])*1e3):new Date("invalid");function N_(e){let t=Sr,n=N,o=$n,i=gr,c=ys,l=Vr,d=It,h=new Uint8Array(ue.slice(0,Sr)),p=Oe,y=Oe.slice(0,Oe.length),g=Qe,v=ws,w=e();return Sr=t,N=n,$n=o,gr=i,ys=c,Vr=l,It=d,ue=h,ws=v,Oe=p,Oe.splice(0,Oe.length,...y),Qe=g,Me=new DataView(ue.buffer,ue.byteOffset,ue.byteLength),w}function ep(){ue=null,Vr=null,Oe=null}const Ug=new Array(147);for(let e=0;e<256;e++)Ug[e]=+("1e"+Math.floor(45.15-e*.30103));var vf=new Ka({useRecords:!1});vf.unpack;vf.unpackMultiple;vf.unpack;let sj=new Float32Array(1);new Uint8Array(sj.buffer,0,4);let Gu;try{Gu=new TextEncoder}catch{}let tp,np;const vi=typeof Buffer<"u",Mu=vi?function(e){return Buffer.allocUnsafeSlow(e)}:Uint8Array,D_=vi?Buffer:Uint8Array,qx=vi?4294967296:2144337920;let Q,ya,qe,j=0,qt,it=null,oj;const ij=21760,aj=/[\u0080-\uFFFF]/,Xo=Symbol("record-id");class cj extends Ka{constructor(t){super(t),this.offset=0;let n,o,i,c,l=D_.prototype.utf8Write?function(k,U){return Q.utf8Write(k,U,Q.byteLength-U)}:Gu&&Gu.encodeInto?function(k,U){return Gu.encodeInto(k,Q.subarray(U)).written}:!1,d=this;t||(t={});let h=t&&t.sequential,p=t.structures||t.saveStructures,y=t.maxSharedStructures;if(y==null&&(y=p?32:0),y>8160)throw new Error("Maximum maxSharedStructure is 8160");t.structuredClone&&t.moreTypes==null&&(this.moreTypes=!0);let g=t.maxOwnStructures;g==null&&(g=p?32:64),!this.structures&&t.useRecords!=!1&&(this.structures=[]);let v=y>32||g+y>64,w=y+64,S=y+g+64;if(S>8256)throw new Error("Maximum maxSharedStructure + maxOwnStructure is 8192");let E=[],P=0,H=0;this.pack=this.encode=function(k,U){if(Q||(Q=new Mu(8192),qe=Q.dataView||(Q.dataView=new DataView(Q.buffer,0,8192)),j=0),qt=Q.length-10,qt-j<2048?(Q=new Mu(Q.length),qe=Q.dataView||(Q.dataView=new DataView(Q.buffer,0,Q.length)),qt=Q.length-10,j=0):j=j+7&2147483640,n=j,U&hj&&(j+=U&255),c=d.structuredClone?new Map:null,d.bundleStrings&&typeof k!="string"?(it=[],it.size=1/0):it=null,i=d.structures,i){i.uninitialized&&(i=d._mergeStructures(d.getStructures()));let J=i.sharedLength||0;if(J>y)throw new Error("Shared structures is larger than maximum shared structures, try increasing maxSharedStructures to "+i.sharedLength);if(!i.transitions){i.transitions=Object.create(null);for(let B=0;B<J;B++){let X=i[B];if(!X)continue;let ne,te=i.transitions;for(let I=0,Z=X.length;I<Z;I++){let pe=X[I];ne=te[pe],ne||(ne=te[pe]=Object.create(null)),te=ne}te[Xo]=B+64}this.lastNamedStructuresLength=J}h||(i.nextId=J+64)}o&&(o=!1);let V;try{d.randomAccessStructure&&!d.readOnlyStructures&&k&&typeof k=="object"?k.constructor===Object?K(k):k.constructor!==Map&&!Array.isArray(k)&&!np.some(B=>k instanceof B)?K(k.toJSON?k.toJSON():k):C(k):C(k);let J=it;if(it&&Hx(n,C,0),c&&c.idsToInsert){let B=c.idsToInsert.sort((I,Z)=>I.offset>Z.offset?1:-1),X=B.length,ne=-1;for(;J&&X>0;){let I=B[--X].offset+n;I<J.stringsPosition+n&&ne===-1&&(ne=0),I>J.position+n?ne>=0&&(ne+=6):(ne>=0&&(qe.setUint32(J.position+n,qe.getUint32(J.position+n)+ne),ne=-1),J=J.previous,X++)}ne>=0&&J&&qe.setUint32(J.position+n,qe.getUint32(J.position+n)+ne),j+=B.length*6,j>qt&&q(j),d.offset=j;let te=uj(Q.subarray(n,j),B);return c=null,te}return d.offset=j,U&fj?(Q.start=n,Q.end=j,Q):Q.subarray(n,j)}catch(J){throw V=J,J}finally{if(i&&(_(),o&&d.saveStructures)){let J=i.sharedLength||0,B=Q.subarray(n,j),X=lj(i,d);if(!V)return d.saveStructures(X,X.isCompatible)===!1?(i.uninitialized=!0,d.pack(k,U)):(d.lastNamedStructuresLength=J,Q.length>1073741824&&(Q=null),B)}Q.length>1073741824&&(Q=null),U&dj&&(j=n)}};const _=()=>{H<10&&H++;let k=i.sharedLength||0;if(i.length>k&&!h&&(i.length=k),P>1e4)i.transitions=null,H=0,P=0,E.length>0&&(E=[]);else if(E.length>0&&!h){for(let U=0,V=E.length;U<V;U++)E[U][Xo]=0;E=[]}},O=k=>{var U=k.length;U<16?Q[j++]=144|U:U<65536?(Q[j++]=220,Q[j++]=U>>8,Q[j++]=U&255):(Q[j++]=221,qe.setUint32(j,U),j+=4);for(let V=0;V<U;V++)C(k[V])},C=k=>{j>qt&&(Q=q(j));var U=typeof k,V;if(U==="string"){let J=k.length;if(it&&J>=4&&J<4096){if((it.size+=J)>ij){let te,I=(it[0]?it[0].length*3+it[1].length:0)+10;j+I>qt&&(Q=q(j+I));let Z;it.position?(Z=it,Q[j]=200,j+=3,Q[j++]=98,te=j-n,j+=4,Hx(n,C,0),qe.setUint16(te+n-3,j-n-te)):(Q[j++]=214,Q[j++]=98,te=j-n,j+=4),it=["",""],it.previous=Z,it.size=0,it.position=te}let ne=aj.test(k);it[ne?0:1]+=k,Q[j++]=193,C(ne?-J:J);return}let B;J<32?B=1:J<256?B=2:J<65536?B=3:B=5;let X=J*3;if(j+X>qt&&(Q=q(j+X)),J<64||!l){let ne,te,I,Z=j+B;for(ne=0;ne<J;ne++)te=k.charCodeAt(ne),te<128?Q[Z++]=te:te<2048?(Q[Z++]=te>>6|192,Q[Z++]=te&63|128):(te&64512)===55296&&((I=k.charCodeAt(ne+1))&64512)===56320?(te=65536+((te&1023)<<10)+(I&1023),ne++,Q[Z++]=te>>18|240,Q[Z++]=te>>12&63|128,Q[Z++]=te>>6&63|128,Q[Z++]=te&63|128):(Q[Z++]=te>>12|224,Q[Z++]=te>>6&63|128,Q[Z++]=te&63|128);V=Z-j-B}else V=l(k,j+B);V<32?Q[j++]=160|V:V<256?(B<2&&Q.copyWithin(j+2,j+1,j+1+V),Q[j++]=217,Q[j++]=V):V<65536?(B<3&&Q.copyWithin(j+3,j+2,j+2+V),Q[j++]=218,Q[j++]=V>>8,Q[j++]=V&255):(B<5&&Q.copyWithin(j+5,j+3,j+3+V),Q[j++]=219,qe.setUint32(j,V),j+=4),j+=V}else if(U==="number")if(k>>>0===k)k<32||k<128&&this.useRecords===!1||k<64&&!this.randomAccessStructure?Q[j++]=k:k<256?(Q[j++]=204,Q[j++]=k):k<65536?(Q[j++]=205,Q[j++]=k>>8,Q[j++]=k&255):(Q[j++]=206,qe.setUint32(j,k),j+=4);else if(k>>0===k)k>=-32?Q[j++]=256+k:k>=-128?(Q[j++]=208,Q[j++]=k+256):k>=-32768?(Q[j++]=209,qe.setInt16(j,k),j+=2):(Q[j++]=210,qe.setInt32(j,k),j+=4);else{let J;if((J=this.useFloat32)>0&&k<4294967296&&k>=-2147483648){Q[j++]=202,qe.setFloat32(j,k);let B;if(J<4||(B=k*Ug[(Q[j]&127)<<1|Q[j+1]>>7])>>0===B){j+=4;return}else j--}Q[j++]=203,qe.setFloat64(j,k),j+=8}else if(U==="object"||U==="function")if(!k)Q[j++]=192;else{if(c){let B=c.get(k);if(B){if(!B.id){let X=c.idsToInsert||(c.idsToInsert=[]);B.id=X.push(B)}Q[j++]=214,Q[j++]=112,qe.setUint32(j,B.id),j+=4;return}else c.set(k,{offset:j-n})}let J=k.constructor;if(J===Object)$(k);else if(J===Array)O(k);else if(J===Map)if(this.mapAsEmptyObject)Q[j++]=128;else{V=k.size,V<16?Q[j++]=128|V:V<65536?(Q[j++]=222,Q[j++]=V>>8,Q[j++]=V&255):(Q[j++]=223,qe.setUint32(j,V),j+=4);for(let[B,X]of k)C(B),C(X)}else{for(let B=0,X=tp.length;B<X;B++){let ne=np[B];if(k instanceof ne){let te=tp[B];if(te.write){te.type&&(Q[j++]=212,Q[j++]=te.type,Q[j++]=0);let le=te.write.call(this,k);le===k?Array.isArray(k)?O(k):$(k):C(le);return}let I=Q,Z=qe,pe=j;Q=null;let me;try{me=te.pack.call(this,k,le=>(Q=I,I=null,j+=le,j>qt&&q(j),{target:Q,targetView:qe,position:j-le}),C)}finally{I&&(Q=I,qe=Z,j=pe,qt=Q.length-10)}me&&(me.length+j>qt&&q(me.length+j),j=Wx(me,Q,j,te.type));return}}if(Array.isArray(k))O(k);else{if(k.toJSON){const B=k.toJSON();if(B!==k)return C(B)}if(U==="function")return C(this.writeFunction&&this.writeFunction(k));$(k)}}}else if(U==="boolean")Q[j++]=k?195:194;else if(U==="bigint"){if(k<9223372036854776e3&&k>=-9223372036854776e3)Q[j++]=211,qe.setBigInt64(j,k);else if(k<18446744073709552e3&&k>0)Q[j++]=207,qe.setBigUint64(j,k);else if(this.largeBigIntToFloat)Q[j++]=203,qe.setFloat64(j,Number(k));else{if(this.largeBigIntToString)return C(k.toString());if(this.useBigIntExtension||this.moreTypes){let J=k<0?BigInt(-1):BigInt(0),B;if(k>>BigInt(65536)===J){let X=BigInt(18446744073709552e3)-BigInt(1),ne=[];for(;ne.push(k&X),k>>BigInt(63)!==J;)k>>=BigInt(64);B=new Uint8Array(new BigUint64Array(ne).buffer),B.reverse()}else{let X=k<0,ne=(X?~k:k).toString(16);if(ne.length%2?ne="0"+ne:parseInt(ne.charAt(0),16)>=8&&(ne="00"+ne),vi)B=Buffer.from(ne,"hex");else{B=new Uint8Array(ne.length/2);for(let te=0;te<B.length;te++)B[te]=parseInt(ne.slice(te*2,te*2+2),16)}if(X)for(let te=0;te<B.length;te++)B[te]=~B[te]}B.length+j>qt&&q(B.length+j),j=Wx(B,Q,j,66);return}else throw new RangeError(k+" was too large to fit in MessagePack 64-bit integer format, use useBigIntExtension, or set largeBigIntToFloat to convert to float-64, or set largeBigIntToString to convert to string")}j+=8}else if(U==="undefined")this.encodeUndefinedAsNil?Q[j++]=192:(Q[j++]=212,Q[j++]=0,Q[j++]=0);else throw new Error("Unknown type: "+U)},D=this.variableMapSize||this.coercibleKeyAsNumber||this.skipValues?k=>{let U;if(this.skipValues){U=[];for(let B in k)(typeof k.hasOwnProperty!="function"||k.hasOwnProperty(B))&&!this.skipValues.includes(k[B])&&U.push(B)}else U=Object.keys(k);let V=U.length;V<16?Q[j++]=128|V:V<65536?(Q[j++]=222,Q[j++]=V>>8,Q[j++]=V&255):(Q[j++]=223,qe.setUint32(j,V),j+=4);let J;if(this.coercibleKeyAsNumber)for(let B=0;B<V;B++){J=U[B];let X=Number(J);C(isNaN(X)?J:X),C(k[J])}else for(let B=0;B<V;B++)C(J=U[B]),C(k[J])}:k=>{Q[j++]=222;let U=j-n;j+=2;let V=0;for(let J in k)(typeof k.hasOwnProperty!="function"||k.hasOwnProperty(J))&&(C(J),C(k[J]),V++);if(V>65535)throw new Error('Object is too large to serialize with fast 16-bit map size, use the "variableMapSize" option to serialize this object');Q[U+++n]=V>>8,Q[U+n]=V&255},T=this.useRecords===!1?D:t.progressiveRecords&&!v?k=>{let U,V=i.transitions||(i.transitions=Object.create(null)),J=j++-n,B;for(let X in k)if(typeof k.hasOwnProperty!="function"||k.hasOwnProperty(X)){if(U=V[X],U)V=U;else{let ne=Object.keys(k),te=V;V=i.transitions;let I=0;for(let Z=0,pe=ne.length;Z<pe;Z++){let me=ne[Z];U=V[me],U||(U=V[me]=Object.create(null),I++),V=U}J+n+1==j?(j--,ee(V,ne,I)):se(V,ne,J,I),B=!0,V=te[X]}C(k[X])}if(!B){let X=V[Xo];X?Q[J+n]=X:se(V,Object.keys(k),J,0)}}:k=>{let U,V=i.transitions||(i.transitions=Object.create(null)),J=0;for(let X in k)(typeof k.hasOwnProperty!="function"||k.hasOwnProperty(X))&&(U=V[X],U||(U=V[X]=Object.create(null),J++),V=U);let B=V[Xo];B?B>=96&&v?(Q[j++]=((B-=96)&31)+96,Q[j++]=B>>5):Q[j++]=B:ee(V,V.__keys__||Object.keys(k),J);for(let X in k)(typeof k.hasOwnProperty!="function"||k.hasOwnProperty(X))&&C(k[X])},L=typeof this.useRecords=="function"&&this.useRecords,$=L?k=>{L(k)?T(k):D(k)}:T,q=k=>{let U;if(k>16777216){if(k-n>qx)throw new Error("Packed buffer would be larger than maximum buffer size");U=Math.min(qx,Math.round(Math.max((k-n)*(k>67108864?1.25:2),4194304)/4096)*4096)}else U=(Math.max(k-n<<2,Q.length-1)>>12)+1<<12;let V=new Mu(U);return qe=V.dataView||(V.dataView=new DataView(V.buffer,0,U)),k=Math.min(k,Q.length),Q.copy?Q.copy(V,0,n,k):V.set(Q.slice(n,k)),j-=n,n=0,qt=V.length-10,Q=V},ee=(k,U,V)=>{let J=i.nextId;J||(J=64),J<w&&this.shouldShareStructure&&!this.shouldShareStructure(U)?(J=i.nextOwnId,J<S||(J=w),i.nextOwnId=J+1):(J>=S&&(J=w),i.nextId=J+1);let B=U.highByte=J>=96&&v?J-96>>5:-1;k[Xo]=J,k.__keys__=U,i[J-64]=U,J<w?(U.isShared=!0,i.sharedLength=J-63,o=!0,B>=0?(Q[j++]=(J&31)+96,Q[j++]=B):Q[j++]=J):(B>=0?(Q[j++]=213,Q[j++]=114,Q[j++]=(J&31)+96,Q[j++]=B):(Q[j++]=212,Q[j++]=114,Q[j++]=J),V&&(P+=H*V),E.length>=g&&(E.shift()[Xo]=0),E.push(k),C(U))},se=(k,U,V,J)=>{let B=Q,X=j,ne=qt,te=n;Q=ya,j=0,n=0,Q||(ya=Q=new Mu(8192)),qt=Q.length-10,ee(k,U,J),ya=Q;let I=j;if(Q=B,j=X,qt=ne,n=te,I>1){let Z=j+I-1;Z>qt&&q(Z);let pe=V+n;Q.copyWithin(pe+I,pe+1,j),Q.set(ya.slice(0,I),pe),j=Z}else Q[V+n]=ya[0]},K=k=>{let U=oj(k,Q,n,j,i,q,(V,J,B)=>{if(B)return o=!0;j=J;let X=Q;return C(V),_(),X!==Q?{position:j,targetView:qe,target:Q}:j},this);if(U===0)return $(k);j=U}}useBuffer(t){Q=t,Q.dataView||(Q.dataView=new DataView(Q.buffer,Q.byteOffset,Q.byteLength)),qe=Q.dataView,j=0}set position(t){j=t}get position(){return j}clearSharedData(){this.structures&&(this.structures=[]),this.typedStructs&&(this.typedStructs=[])}}np=[Date,Set,Error,RegExp,ArrayBuffer,Object.getPrototypeOf(Uint8Array.prototype).constructor,DataView,I_];tp=[{pack(e,t,n){let o=e.getTime()/1e3;if((this.useTimestamp32||e.getMilliseconds()===0)&&o>=0&&o<4294967296){let{target:i,targetView:c,position:l}=t(6);i[l++]=214,i[l++]=255,c.setUint32(l,o)}else if(o>0&&o<4294967296){let{target:i,targetView:c,position:l}=t(10);i[l++]=215,i[l++]=255,c.setUint32(l,e.getMilliseconds()*4e6+(o/1e3/4294967296>>0)),c.setUint32(l+4,o)}else if(isNaN(o)){if(this.onInvalidDate)return t(0),n(this.onInvalidDate());let{target:i,targetView:c,position:l}=t(3);i[l++]=212,i[l++]=255,i[l++]=255}else{let{target:i,targetView:c,position:l}=t(15);i[l++]=199,i[l++]=12,i[l++]=255,c.setUint32(l,e.getMilliseconds()*1e6),c.setBigInt64(l+4,BigInt(Math.floor(o)))}}},{pack(e,t,n){if(this.setAsEmptyObject)return t(0),n({});let o=Array.from(e),{target:i,position:c}=t(this.moreTypes?3:0);this.moreTypes&&(i[c++]=212,i[c++]=115,i[c++]=0),n(o)}},{pack(e,t,n){let{target:o,position:i}=t(this.moreTypes?3:0);this.moreTypes&&(o[i++]=212,o[i++]=101,o[i++]=0),n([e.name,e.message,e.cause])}},{pack(e,t,n){let{target:o,position:i}=t(this.moreTypes?3:0);this.moreTypes&&(o[i++]=212,o[i++]=120,o[i++]=0),n([e.source,e.flags])}},{pack(e,t){this.moreTypes?em(e,16,t):tm(vi?Buffer.from(e):new Uint8Array(e),t)}},{pack(e,t){let n=e.constructor;n!==D_&&this.moreTypes?em(e,O_.indexOf(n.name),t):tm(e,t)}},{pack(e,t){this.moreTypes?em(e,17,t):tm(vi?Buffer.from(e):new Uint8Array(e),t)}},{pack(e,t){let{target:n,position:o}=t(1);n[o]=193}}];function em(e,t,n,o){let i=e.byteLength;if(i+1<256){var{target:c,position:l}=n(4+i);c[l++]=199,c[l++]=i+1}else if(i+1<65536){var{target:c,position:l}=n(5+i);c[l++]=200,c[l++]=i+1>>8,c[l++]=i+1&255}else{var{target:c,position:l,targetView:d}=n(7+i);c[l++]=201,d.setUint32(l,i+1),l+=4}c[l++]=116,c[l++]=t,e.buffer||(e=new Uint8Array(e)),c.set(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),l)}function tm(e,t){let n=e.byteLength;var o,i;if(n<256){var{target:o,position:i}=t(n+2);o[i++]=196,o[i++]=n}else if(n<65536){var{target:o,position:i}=t(n+3);o[i++]=197,o[i++]=n>>8,o[i++]=n&255}else{var{target:o,position:i,targetView:c}=t(n+5);o[i++]=198,c.setUint32(i,n),i+=4}o.set(e,i)}function Wx(e,t,n,o){let i=e.length;switch(i){case 1:t[n++]=212;break;case 2:t[n++]=213;break;case 4:t[n++]=214;break;case 8:t[n++]=215;break;case 16:t[n++]=216;break;default:i<256?(t[n++]=199,t[n++]=i):i<65536?(t[n++]=200,t[n++]=i>>8,t[n++]=i&255):(t[n++]=201,t[n++]=i>>24,t[n++]=i>>16&255,t[n++]=i>>8&255,t[n++]=i&255)}return t[n++]=o,t.set(e,n),n+=i,n}function uj(e,t){let n,o=t.length*6,i=e.length-o;for(;n=t.pop();){let c=n.offset,l=n.id;e.copyWithin(c+o,c,i),o-=6;let d=c+o;e[d++]=214,e[d++]=105,e[d++]=l>>24,e[d++]=l>>16&255,e[d++]=l>>8&255,e[d++]=l&255,i=c}return e}function Hx(e,t,n){if(it.length>0){qe.setUint32(it.position+e,j+n-it.position-e),it.stringsPosition=j-e;let o=it;it=null,t(o[0]),t(o[1])}}function lj(e,t){return e.isCompatible=n=>{let o=!n||(t.lastNamedStructuresLength||0)===n.length;return o||t._mergeStructures(n),o},e}let j_=new cj({useRecords:!1});j_.pack;j_.pack;const fj=512,dj=1024,hj=2048;class Bg extends qn()("effect/rpc/RpcSerialization"){}const mj=Bg.of({contentType:"application/json",includesFraming:!1,makeUnsafe:()=>{const e=new TextDecoder;return{decode:t=>{const n=JSON.parse(typeof t=="string"?t:e.decode(t));return Array.isArray(n)?n:[n]},encode:t=>JSON.stringify(t)}}}),pj=og(Bg)(mj),gj=e=>wr(()=>{const t=new Set,n=new Map,o=new Map;let i=(c,l)=>cE(d=>{let h=n.get(c);return h||(h=[],n.set(c,h)),h.push([l,d]),ht});return Rs(e((c,l)=>{const d=o.get(c);return d?d(l):i(c,l)},t),c=>({...c,run(l,d){return Mm(function*(){t.add(l),o.set(l,d);const h=n.get(l);if(h){n.delete(l);for(const[p,y]of h)yield*so(wr(()=>d(p)),y)}return yield*fE(fL,()=>(t.delete(l),o.delete(l),ht))})}}))});let yj=BigInt(0);const vj=oo(function*(e,t){const n=(t==null?void 0:t.spanPrefix)??"RpcClient",o=(t==null?void 0:t.supportsAck)??!0,i=(t==null?void 0:t.disableTracing)??!1,c=(t==null?void 0:t.generateRequestId)??(()=>yj++),l=yield*ml(),d=ro(l,BS),h=new Map;let p=!1;yield*$M(d,dl(_=>(p=!0,y(TM(_.id)))));const y=oo(function*(_){for(const[O,C]of h)h.delete(O),C._tag==="Queue"?yield*_._tag==="Success"?cx(C.queue):wa(C.queue,_.cause):C.resume(_)}),g=_=>{const O=g_(_.successSchema),C=S(_);return(D,T)=>{const L=T!=null&&T.headers?F4(T.headers):Og,$=(T==null?void 0:T.context)??sr();if(!O){const ee=se=>v(_,C,se,_.payloadSchema.make(D),L,$,(T==null?void 0:T.discard)??!1);return i?ee(void 0):AL(`${n}.${_._tag}`,{attributes:t.spanAttributes},ee)}const q=w(_,C,_.payloadSchema.make(D),L,(T==null?void 0:T.streamBufferSize)??16,$);return T!=null&&T.asQueue?q:PN(Rs(q,bN))}},v=(_,O,C,D,T,L,$)=>dl(q=>{if(p)return Lm;const ee=c(),se=O(k=>t.onFromClient({message:k,context:L,discard:$}),{_tag:"Request",id:ee,tag:_._tag,payload:D,...C?{traceId:C.traceId,spanId:C.spanId,sampled:C.sampled}:{},headers:Ax(q.getRef(Qx),T)});if($)return se;let K;return RL(KS(k=>{const U={_tag:"Effect",rpc:_,context:L,resume(V){k(V),K&&!K.pollUnsafe()&&q.currentDispatcher.scheduleTask(()=>{K.interruptUnsafe(q.id)},0)}};h.set(ee,U),K=se.pipe(C?JS(C,{captureStackTrace:!1}):Ie,pl(q.context)),K.addObserver(V=>{if(V._tag==="Failure")return k(V)})}),k=>(h.delete(ee),pL(GE(K),E(ee,Array.from(k),L))))}),w=oo(function*(_,O,C,D,T,L){if(p)return yield*Lm;const $=i?void 0:yield*TL(`${n}.${_._tag}`,{attributes:t.spanAttributes}),q=zm(),ee=c(),se=Hl(q.context,BS);yield*jM(se,k=>h.has(ee)?(h.delete(ee),E(ee,Kk(k)?Array.from(PM(k.cause)):[],L)):ht);const K=yield*gO(T);return h.set(ee,{_tag:"Queue",rpc:_,queue:K,scope:se,context:L}),yield*O(k=>t.onFromClient({message:k,context:L,discard:!1}),{_tag:"Request",id:ee,tag:_._tag,payload:C,...$?{traceId:$.traceId,spanId:$.spanId,sampled:$.sampled}:{},headers:Ax(q.getRef(Qx),D)}).pipe($?JS($,{captureStackTrace:!1}):Ie,hl(k=>wa(K,k)),cg,ML(se,{startImmediately:!0})),K}),S=_=>{const O=[];for(const C of _.middlewares.values()){const D=l.mapUnsafe.get(`${C.key}/Client`);D&&O.push(D)}return O.length===0?(C,D)=>C(D):function C(D,T,L=O.length-1){return L===-1?D(T):O[L]({rpc:_,request:T,next($){return C(D,$,L-1)}})}},E=(_,O,C)=>KS(D=>{const T=zm();t.onFromClient({message:{_tag:"Interrupt",requestId:_,interruptors:O},context:C,discard:!1}).pipe(wL(1e3),pl(T.context)).addObserver(()=>{D(ht)})}),P=_=>{switch(_._tag){case"Chunk":{const O=_.requestId,C=h.get(O);return!C||C._tag!=="Queue"?ht:yO(C.queue,_.values).pipe(o?Rn(()=>t.onFromClient({message:{_tag:"Ack",requestId:_.requestId},context:C.context,discard:!1})):Ie,hl(D=>wa(C.queue,D)))}case"Exit":{const O=_.requestId,C=h.get(O);return C?(h.delete(O),C._tag==="Effect"?(C.resume(_.exit),ht):_.exit._tag==="Success"?cx(C.queue):wa(C.queue,_.exit.cause)):ht}case"Defect":return y(RM(_.defect));case"ClientEnd":return ht}};let H;if(t.flatten){const _=new Map;H=function(C,D,T){let L=_.get(C);return L||(L=g(e.requests.get(C)),_.set(C,L)),L(D,T)}}else H={},e.requests.forEach(_=>{H[_._tag]=g(_)});return{client:H,write:P}});let Sj=0;const xj=oo(function*(e,t){const n=Sj++,{run:o,send:i,supportsAck:c,supportsTransferables:l}=yield*Sf,d=new Map,{client:h,write:p}=yield*vj(e,{...t,supportsAck:c,onFromClient({message:y}){switch(y._tag){case"Request":{const g=e.requests.get(y.tag),v=l?q4():void 0,w=zm(),S={rpc:g,context:v?Fs(w.context,F_,v):w.context,schemas:wj(g)};return d.set(y.id,S),S.schemas.encodePayload(y.payload).pipe(so(S.context),qu,Rn(E=>i(n,{...y,id:String(y.id),payload:E,headers:Object.entries(y.headers)},v&&v.readUnsafe())))}case"Ack":return d.get(y.requestId)?i(n,{_tag:"Ack",requestId:String(y.requestId)}):ht;case"Interrupt":return d.get(y.requestId)?(d.delete(y.requestId),i(n,{_tag:"Interrupt",requestId:String(y.requestId)})):ht;case"Eof":return ht}}});return yield*o(n,y=>{switch(y._tag){case"Chunk":{const g=Tu(y.requestId),v=d.get(g);return!v||go(v.schemas.decodeChunk)?ht:v.schemas.decodeChunk.value(y.values).pipe(so(v.context),qu,Rn(w=>p({_tag:"Chunk",clientId:0,requestId:Tu(y.requestId),values:w})),IL(w=>p({_tag:"Exit",clientId:0,requestId:Tu(y.requestId),exit:Ca(w)})))}case"Exit":{const g=Tu(y.requestId),v=d.get(g);return v?(d.delete(g),v.schemas.decodeExit(y.exit).pipe(so(v.context),qu,EL({onSuccess:w=>p({_tag:"Exit",clientId:0,requestId:g,exit:w}),onFailure:w=>p({_tag:"Exit",clientId:0,requestId:g,exit:Ca(w)})}))):ht}case"Defect":return p({_tag:"Defect",clientId:0,defect:Cj(y.defect)});case"ClientProtocolError":{const g=oc(y.error);return sE(d.keys(),v=>p({_tag:"Exit",clientId:0,requestId:v,exit:g}))}default:return ht}}).pipe(hl(BL),cg,ug),h}),Kx=new WeakMap,wj=e=>{let t=Kx.get(e);if(t!==void 0)return t;const n=y_(e.successSchema);return t={decodeChunk:Lp(n,o=>lx(Bh(tN(o.success)))),encodePayload:YO(Bh(e.payloadSchema)),decodeExit:lx(Bh(VN(e)))},Kx.set(e,t),t},Qx=rt("effect/rpc/RpcClient/CurrentHeaders",{defaultValue:()=>Og});class Sf extends qn()("effect/rpc/RpcClient/Protocol"){}M(Sf,"make",gj);const kj=e=>Sf.make(oo(function*(t,n){const o=yield*Dg,i=yield*Bg,c=yield*CL(rp),l=new Map,d=yield*o.writer;let h=i.makeUnsafe();const p=yield*_j(d(h.encode(G4)));let y;const g=wr(()=>(y=void 0,ks(c)?c.value.onConnect:ht)),v=w=>sE(n,S=>t(S,w));return yield*wr(()=>(h=i.makeUnsafe(),p.reset(),o.runRaw(w=>{try{const S=h.decode(w);if(S.length===0)return;let E=0;return oE({while:()=>E<S.length,body:()=>{const P=S[E++];if(P._tag==="Pong")return p.onPong(),ht;if("requestId"in P){const H=l.get(P.requestId);if(H!==void 0)return P._tag==="Exit"&&l.delete(P.requestId),t(H,P)}return v(P)},step:Ga})}catch(S){return v({_tag:"ClientProtocolError",error:new Ym({reason:new Gm({message:"Error decoding message",cause:S})})})}},{onOpen:g}).pipe(aE(Rn(p.timeout,()=>Je(new ai({reason:new Pl({kind:"Timeout",cause:new Error("ping timeout")})}))))))).pipe(Rn(()=>Je(new ai({reason:new Fl({code:1e3})}))),ks(c)?lE(c.value.onDisconnect):Ie,vL(w=>{const S=sc(w),E=sR(S);return y=new Ym({reason:E?S.success.reason:new Gm({message:"Unknown socket error",cause:qk(w)})}),v({_tag:"ClientProtocolError",error:y})}),SL((e==null?void 0:e.retryPolicy)??Ej),zL({module:"RpcClient",method:"makeProtocolSocket"}),ug),{send(w,S){if(y)return Je(y);S._tag==="Request"&&l.set(S.id,w);const E=h.encode(S);return E===void 0?ht:qu(d(E))},supportsAck:!0,supportsTransferables:!1}})),Ej=tL(500,1.5).pipe(ZM(nE(5e3))),_j=oo(function*(e){let t=!0;const n=YE(),o=()=>{t=!0,n.closeUnsafe()},i=()=>{t=!0};return yield*wr(()=>t?(t=!1,e):n.open).pipe(kL("5 seconds"),xL,dE,cg,ug),{timeout:n.await,reset:o,onPong:i}});class rp extends qn()("effect/rpc/RpcClient/ConnectionHooks"){}const Cj=JO(cr);class $_ extends Error{constructor(t="daemon RPC connection closed"){super(t),this.name="DaemonRpcConnectionError"}}class bj extends Error{constructor(t,n){super(`${t} timed out after ${n}ms`),this.method=t,this.timeoutMs=n,this.name="DaemonRpcRequestTimeoutError"}}class Lu extends qn()("tokmon/client/DaemonRpcClient/TokmonRpcClient"){}const Pj=new Function("specifier","return import(specifier)");function Jx(){let e=!1,t;return{promise:new Promise(o=>{t=o}),resolve:o=>{e||(e=!0,t(o))}}}function Fj(e){const t=typeof window>"u"?void 0:window.location.origin,n=new URL(e,t);if(n.protocol==="http:"?n.protocol="ws:":n.protocol==="https:"&&(n.protocol="wss:"),n.protocol!=="ws:"&&n.protocol!=="wss:")throw new Error(`unsupported daemon RPC protocol: ${n.protocol}`);return n.hash="",n.searchParams.delete("tokmonToken"),n.searchParams.delete("wsToken"),n.pathname=QN,n.toString()}function Ij(e){return e==="node"?!0:e==="browser"?!1:typeof window>"u"}async function Rj(e,t,n){const o={openTimeout:ja(n)};return Ij(t)?(await Pj("@effect/platform-node/NodeSocket")).layerWebSocket(e,o):V4(e,o).pipe(Am(U4))}function Yu(e){return{protocol:{version:e.protocol.version,capabilities:[...e.protocol.capabilities]},config:qF(e.config)}}function Tj(e){const t=o=>o?{...o,activeAccountIds:[...o.activeAccountIds],factors:o.factors.map(i=>({...i}))}:void 0,n=o=>o.map(i=>({...i,models:[...i.models],breakdown:i.breakdown.map(c=>({...c}))}));return{...e,providers:e.providers.map(o=>({...o,headroom:t(o.headroom)})),accounts:e.accounts.map(o=>{var i;return{...o,identity:o.identity?{...o.identity}:void 0,quotas:(i=o.quotas)==null?void 0:i.map(c=>({...c})),headroom:t(o.headroom),dashboard:o.dashboard?{...o.dashboard,today:{...o.dashboard.today},week:{...o.dashboard.week},month:{...o.dashboard.month},series:[...o.dashboard.series]}:null,table:o.table?{daily:n(o.table.daily),weekly:n(o.table.weekly),monthly:n(o.table.monthly)}:null,billing:o.billing?{...o.billing,metrics:o.billing.metrics.map(c=>({...c,format:{...c.format}})),activity:o.billing.activity?{...o.billing.activity,series:[...o.billing.activity.series]}:o.billing.activity,modelSpend:o.billing.modelSpend==null?o.billing.modelSpend:o.billing.modelSpend.map(c=>({...c}))}:null,summaryUpdatedAt:o.summaryUpdatedAt??null,billingUpdatedAt:o.billingUpdatedAt??null,tableUpdatedAt:o.tableUpdatedAt??null}}),peak:e.peak?{...e.peak}:null}}function Aj(e){if(!e||typeof e!="object"||e.kind!=="conflict")return e;const t=e.state;if(!t)return e;const n=Yu(t);return e instanceof Qm?new Qm({kind:"conflict",state:n}):{...e,state:n}}function Mj(e){return e instanceof Ym||QO(e)}async function Lj(e,t,n){let o=null;try{await Promise.race([e.promise,t.promise.then(i=>Promise.reject(i)),new Promise((i,c)=>{var l;o=setTimeout(()=>c(new $_(`daemon RPC connection timed out after ${n}ms`)),n),(l=o.unref)==null||l.call(o)})])}finally{o&&clearTimeout(o)}}function Oj(e,t={}){const n=Fj(e),o=Math.max(1,t.requestTimeoutMs??3e4),i=Math.max(1,t.reconnectBaseDelayMs??250),c=new Set;let l=null,d=null,h=null,p=null,y=null,g=0,v=!1,w=!1;const S=K=>{if(t.onSubscriberError){try{t.onSubscriberError(K)}catch(k){console.error("[tokmon] daemon RPC subscriber error reporter failed",k)}return}console.error("[tokmon] daemon RPC subscriber failed",K)},E=(K,k)=>{var U;try{(U=t.onConn)==null||U.call(t,K,k)}catch(V){S(V)}},P=()=>{y&&(clearTimeout(y),y=null)},H=K=>{const k=K.fiber;return K.fiber=null,K.owner=null,k?Wu(GE(k)).catch(()=>{}):Promise.resolve()},_=K=>(K.active=!1,c.delete(K),K.watchdogTimer&&(clearInterval(K.watchdogTimer),K.watchdogTimer=null),H(K)),O=()=>{var k;if(w||c.size===0||y||l||d||typeof t.reconnectAttempts=="number"&&g>=t.reconnectAttempts)return;const K=Math.min(2500,i*1.5**g);y=setTimeout(()=>{y=null,g++,ee()},K),(k=y.unref)==null||k.call(y)},C=(K,k,U)=>{K.invalidated||(K.invalidated=!0,l===K&&(l=null),K.runtime.dispose().catch(()=>{}),w||E(k,U),O())},D=async(K,k)=>{const U=await Rj(n,t.transport,o),V=og(rp,rp.of({onConnect:Un(()=>{K.resolve()}),onDisconnect:Un(()=>{k.resolve(new $_)})}));return Rm(Sf,kj({retryPolicy:nL(0)})).pipe(Am(Yk(U,pj,V)))},T=async()=>{if(w)throw new Error("daemon RPC client is closed");if(l)return l;if(d)return d;E(v?"reconnecting":"connecting");const K=(async()=>{let k=null;try{const U=Jx(),V=Jx(),J=await D(U,V),B=Rm(Lu,xj(ID)).pipe(Am(J));if(k=$N(B),h=k,await k.runPromise(Lu.asEffect()),await Lj(U,V,o),w)throw new Error("daemon RPC client is closed");const X={runtime:k,disconnected:V.promise,invalidated:!1};return l=X,h=null,v=!0,g=0,E("live"),X.disconnected.then(ne=>{C(X,"reconnecting",ne)}),q(X),X}catch(U){throw h===k&&(h=null),await(k==null?void 0:k.dispose().catch(()=>{})),w||E("error",U),U}})();d=K;try{return await K}finally{d===K&&(d=null)}},L=async(K,k)=>{const U=await T();try{return await U.runtime.runPromise(Lu.use(V=>k(V)).pipe(iE({duration:ja(o),orElse:()=>Je(new bj(K,o))})))}catch(V){const J=Aj(V);throw!w&&Mj(J)&&C(U,"error",J),J}},$=(K,k)=>{if(w||!K.active||K.fiber||k.invalidated)return;K.lastValueAt=Date.now(),K.staleAfterMs=t.snapshotStaleFloorMs??9e4,K.owner=k;const U=k.runtime.runFork(Lu.use(V=>K.streamFor(V).pipe(IN(J=>Un(()=>{K.lastValueAt=Date.now(),K.staleAfterFor&&(K.staleAfterMs=K.staleAfterFor(J));try{K.onValue(J)}catch(B){S(B)}})))));K.fiber=U,U.addObserver(V=>{K.fiber===U&&(K.fiber=null),K.owner===k&&(K.owner=null),!(w||!K.active||k.invalidated)&&(Hk(V)?C(k,"reconnecting"):C(k,"error",qk(V.cause)))})},q=K=>{for(const k of c)$(k,K)};function ee(){w||c.size===0||p||(p=T().then(()=>{}).catch(()=>{O()}).finally(()=>{p=null}))}const se=(K,k,U)=>{var J,B;if(w)return()=>{};const V={streamFor:K,onValue:k,staleAfterFor:U,active:!0,fiber:null,owner:null,watchdogTimer:null,lastValueAt:0,staleAfterMs:Number.POSITIVE_INFINITY};if(c.add(V),U){const X=Math.min(5e3,Math.max(10,(t.snapshotStaleFloorMs??9e4)/2));V.watchdogTimer=setInterval(()=>{!V.fiber||!V.owner||V.lastValueAt===0||Date.now()-V.lastValueAt<=V.staleAfterMs||(V.lastValueAt=Date.now(),C(V.owner,"reconnecting"))},X),(B=(J=V.watchdogTimer).unref)==null||B.call(J)}return l?$(V,l):ee(),()=>{_(V),c.size===0&&P()}};return{getConfig:()=>L(Wt.getConfig,K=>K[Wt.getConfig]({})).then(Yu),setConfig:K=>L(Wt.setConfig,k=>k[Wt.setConfig](K)).then(Yu),refresh:(K="all")=>L(Wt.refresh,k=>k[Wt.refresh]({scope:K})),browseFs:K=>L(Wt.browseFs,k=>k[Wt.browseFs]({path:K})),subscribeSnapshot:K=>se(k=>k[Wt.snapshot]({}).pipe(gx(Tj)),K,k=>Math.max(t.snapshotStaleFloorMs??9e4,k.intervalMs*3)),subscribeConfig:K=>se(k=>k[Wt.config]({}).pipe(gx(Yu)),K),async close(){if(w)return;w=!0,E("closed"),P();const K=[...c].map(_);c.clear();const k=l;l=null,await(h==null?void 0:h.dispose().catch(()=>{})),await Promise.all(K),await(k==null?void 0:k.runtime.dispose().catch(()=>{})),await(d==null?void 0:d.catch(()=>{})),h=null,d=null,p=null}}}let nm=null;const sp=new Set;function Nj(e,t,n){const o=new URLSearchParams(t);o.delete("tokmonToken");let i=n.replace(/^#/,"");if(!i.startsWith("/"))i=new URLSearchParams(i).has("tokmonToken")?"/":i;else{const d=i.indexOf("#");if(d!==-1){const p=new URLSearchParams(i.slice(d+1));p.has("tokmonToken")&&(p.delete("tokmonToken"),i=`${i.slice(0,d)}${p.size?`#${p.toString()}`:""}`)}const h=i.indexOf("?");if(h!==-1){const p=new URLSearchParams(i.slice(h+1));p.delete("tokmonToken"),i=`${i.slice(0,h)}${p.size?`?${p.toString()}`:""}`}}const c=o.size?`?${o.toString()}`:"",l=i?`#${i}`:"";return`${e}${c}${l}`}if(typeof window<"u"){const e=`${window.location.pathname}${window.location.search}${window.location.hash}`,t=Nj(window.location.pathname,window.location.search,window.location.hash);t!==e&&window.history.replaceState(window.history.state,"",t)}function Dj(e){for(const t of sp)t(e)}function jj(e){e!=="closed"&&Dj(e)}function Ts(){return nm||(nm=Oj(window.location.origin,{transport:"browser",onConn:jj})),nm}function $j(e){return sp.add(e),()=>{sp.delete(e)}}function Uj(){const[e,t]=Y.useState(null),[n,o]=Y.useState("connecting"),i=Y.useRef(null);return Y.useEffect(()=>{let c=!1,l=null;const d=Ts();return l=$j(h=>{c||o(h)}),i.current=d.subscribeSnapshot(h=>{c||(t(h),o("live"))}),()=>{var h;c=!0,l==null||l(),(h=i.current)==null||h.call(i),i.current=null}},[]),{snapshot:e,conn:n}}function Es(e){return{...e,config:l1(e.config).config}}async function Bj(){return Es(await Ts().getConfig())}async function op(e,t,n=Ts()){return Es(await n.setConfig({config:e,expectedRevision:t}))}async function zj(e,t=Ts()){const n=Es(e),o=!n.config.privacyMode;try{return await op({...n.config,privacyMode:o},n.config.revision,t)}catch(i){const c=wp(i).conflictState;if(!c)throw i;const l=Es(c);return l.config.privacyMode===o?l:op({...l.config,privacyMode:o},l.config.revision,t)}}async function Vj(e,t,n=Ts()){const o=Es(e),i=c=>op({...c.config,appearance:{...c.config.appearance,mode:t}},c.config.revision,n);try{return await i(o)}catch(c){const l=wp(c).conflictState;if(!l)throw c;const d=Es(l);return d.config.appearance.mode===t?d:i(d)}}function qj(e){const t=wp(e).conflictState;return t?Es(t):null}async function _6(e){return Ts().browseFs(e)}function U_(e){return Ts().subscribeConfig(t=>{e(Es(t))})}async function Wj(){return Ts().refresh("all")}function Hj(e){if(e.key.toLowerCase()!=="r"||e.metaKey||e.ctrlKey||e.altKey)return!1;const t=e.target;return t?t.isContentEditable?!1:!t.tagName||!["INPUT","TEXTAREA","SELECT"].includes(t.tagName):!0}const Kj="tokmon-theme-cache-v1",Qj=1,Jj={canvas:"--color-bg-0",panel:"--color-bg-1",inset:"--color-bg-2",insetStrong:"--color-bg-3",line:"--color-line",lineStrong:"--color-line-2",lineFaint:"--color-line-faint",text:"--color-fg",textDim:"--color-fg-dim",textFaint:"--color-fg-faint",textStrong:"--color-fg-bright",accent:"--color-accent",cost:"--color-cost",positive:"--color-positive",ok:"--color-ok",warn:"--color-warning",crit:"--color-critical",unknown:"--color-unknown",card:"--color-card",cardHover:"--color-card-hover",divider:"--color-divider",track:"--color-track",accentTint:"--color-accent-tint",accentOn:"--color-accent-on",focusRing:"--color-focus-ring"};function Gj(e,t){const n=a1(e,t?"dark":"light");return{appearance:e,...n}}function B_(e){return Object.fromEntries(Object.entries(Jj).map(([t,n])=>[n,e[t]]))}function Yj(e,t){e.classList.toggle("light",t.mode==="light"),e.classList.toggle("dark",t.mode==="dark"),e.dataset.themeMode=t.mode,e.dataset.themePreset=t.appearance.preset;for(const[n,o]of Object.entries(B_(t.tokens)))e.style.setProperty(n,o)}function Xj(e){return JSON.stringify({version:Qj,mode:e.mode,preset:e.appearance.preset,vars:B_(e.tokens)})}function Zj(e,t){var n,o;document.documentElement.style.colorScheme=e,(n=document.querySelector('meta[name="color-scheme"]'))==null||n.setAttribute("content",e),(o=document.querySelector('meta[name="theme-color"]'))==null||o.setAttribute("content",t)}function e$(e){try{localStorage.setItem(Kj,Xj(e))}catch{}}function t$(e){return e==="auto"?"light":e==="light"?"dark":"auto"}function C6(e){return e.preset!=="custom"||!e.custom?[]:["light","dark"].flatMap(t=>{var d;const n=((d=e.custom)==null?void 0:d[t])??{},i=Object.entries(n).filter(h=>er(h[1])===null).map(([h])=>({mode:t,keys:[h],message:"Use #RRGGBB."})),c=Object.fromEntries(Object.entries(n).filter(([,h])=>er(h)!==null)),l=a1({...e,preset:"custom",mode:t,custom:{base:e.custom.base,light:{},dark:{}}},t).tokens;for(const h of o1({...l,...c}))i.push({mode:t,keys:[h.foreground,h.background],message:`${h.foreground} needs ${h.minimum}:1 contrast on ${h.background}.`});return i})}const z_=Y.createContext(null);function n$(e){const t=window.matchMedia("(prefers-color-scheme: dark)"),n=o=>e(o.matches);return t.addEventListener("change",n),e(t.matches),()=>t.removeEventListener("change",n)}function r$({children:e}){const[t,n]=Y.useState(null),[o,i]=Y.useState(null),[c,l]=Y.useState(()=>window.matchMedia("(prefers-color-scheme: dark)").matches),d=Y.useRef(null),h=Y.useCallback(w=>{d.current=w,n(w)},[]);Y.useEffect(()=>n$(l),[]),Y.useEffect(()=>{let w=!0;Bj().then(E=>{w&&h(E)}).catch(()=>{});const S=U_(E=>{w&&h(E)});return()=>{w=!1,S()}},[h]);const p=o??(t==null?void 0:t.config.appearance)??oi,y=Y.useMemo(()=>Gj(p,c),[p,c]);Y.useEffect(()=>{!t&&!o||(Yj(document.documentElement,y),Zj(y.mode,y.tokens.canvas),o||e$(y))},[o,y,t]);const g=Y.useCallback(async()=>{const w=d.current;if(!w)return;const S=t$(w.config.appearance.mode);try{h(await Vj(w,S))}catch{}},[h]),v=Y.useMemo(()=>({appearance:p,resolved:y,ready:t!==null,setPreview:i,commit:w=>{i(null),h(w)},toggleMode:g}),[h,p,y,t,g]);return F.jsx(z_.Provider,{value:v,children:e})}function s$(){const e=Y.useContext(z_);if(!e)throw new Error("useTheme must be used inside ThemeProvider");return e}const Gx=[100,86,72,58,46,92,78,64,52,82,68,56];function ip(e){return`color-mix(in oklab, var(--color-accent) ${Gx[e%Gx.length]}%, var(--color-fg-dim))`}function V_(e){return e==="phosphor"}function b6(e,t,n){return V_(e)?ip(t):n}function o$(e,t){return V_(t.preset)?{...e,byProvider:e.byProvider.map((n,o)=>({...n,color:ip(o)})),byModel:e.byModel.map((n,o)=>({...n,color:ip(o)}))}:e}const q_=()=>Promise.all([yr(()=>import("./overview-E1xtkiJT.js"),__vite__mapDeps([4,5]),import.meta.url),yr(()=>import("./timeline-DAOfy1yc.js"),__vite__mapDeps([6,2,5,3]),import.meta.url)]).then(([e])=>e),W_=()=>Promise.all([yr(()=>import("./analytics-CQcXEq3U.js"),__vite__mapDeps([7,5]),import.meta.url),yr(()=>import("./breakdown-DLwDPWvA.js"),__vite__mapDeps([8,2,5]),import.meta.url),yr(()=>import("./timeline-DAOfy1yc.js"),__vite__mapDeps([6,2,5,3]),import.meta.url)]).then(([e])=>e),H_=()=>Promise.all([yr(()=>import("./models-B4X_VrrZ.js"),__vite__mapDeps([9,5]),import.meta.url),yr(()=>import("./breakdown-DLwDPWvA.js"),__vite__mapDeps([8,2,5]),import.meta.url)]).then(([e])=>e),K_=()=>yr(()=>import("./explore-jBA0FMUo.js"),__vite__mapDeps([10,5]),import.meta.url),i$={overview:q_,analytics:W_,models:H_,explore:K_},a$=Y.lazy(()=>q_().then(e=>({default:e.OverviewTab}))),c$=Y.lazy(()=>W_().then(e=>({default:e.AnalyticsTab}))),u$=Y.lazy(()=>H_().then(e=>({default:e.ModelsTab}))),l$=Y.lazy(()=>K_().then(e=>({default:e.ExploreTab}))),f$=Y.lazy(()=>yr(()=>import("./settings-sheet-Uba9f8CS.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>({default:e.SettingsSheet}))),Yx=e=>{i$[e]()},ap=e=>`/${e}`,Q_=Y.createContext(null),xf=()=>{const e=Y.useContext(Q_);if(!e)throw new Error("useDashboard outside provider");return e};function d$(){var le,Pe;const{snapshot:e,conn:t}=Uj(),[n,o]=C4(),i=s$(),[c,l]=Y.useState(!1),[d,h]=Y.useState(bn.privacyMode),[p,y]=Y.useState(bn.privacyToggleKey),[g,v]=Y.useState(bn.allowNetworkAccess),[w,S]=Y.useState(bn.resetDisplay),[E,P]=Y.useState("idle"),H=Y.useRef(null),_=Y.useRef(null),O=Y.useRef(null),C=Y.useRef(null),D=Y.useRef(null),T=Y.useCallback(fe=>{O.current=fe,h(C.current??fe.config.privacyMode),y(fe.config.privacyToggleKey),v(fe.config.allowNetworkAccess),S(fe.config.resetDisplay)},[]);Y.useEffect(()=>{if(t==="live")return U_(T)},[T,t]);const L=Y.useCallback(()=>{if(H.current)return;D.current&&clearTimeout(D.current),P("refreshing");const fe=Wj().then(()=>P("success")).catch(()=>P("error")).finally(()=>{H.current=null,D.current=setTimeout(()=>P("idle"),3e3)});H.current=fe},[]),$=Y.useCallback(()=>{if(_.current)return;const fe=O.current;if(!fe)return;const xe=!fe.config.privacyMode;C.current=xe,h(xe);const be=zj(fe).then(Ve=>{C.current=null,T(Ve)}).catch(Ve=>{C.current=null;const on=qj(Ve);T(on??O.current??fe)}).finally(()=>{_.current=null});_.current=be.then(()=>{})},[T]);Y.useEffect(()=>{if(t!=="live"||c)return;const fe=xe=>{if(TD(xe,p)){xe.preventDefault(),$();return}Hj(xe)&&(xe.preventDefault(),L())};return window.addEventListener("keydown",fe),()=>window.removeEventListener("keydown",fe)},[t,p,$,L,c]),Y.useEffect(()=>()=>{D.current&&clearTimeout(D.current)},[]);const q=Y.useMemo(()=>XD(e,n),[e,n]),ee=Y.useMemo(()=>o$(q,i.appearance),[q,i.appearance]),se=((le=Ag.find(fe=>fe.key===n.period))==null?void 0:le.label)??n.period,K=n.period==="all"?void 0:se,k=xF({select:fe=>fe.location.pathname}),U=((Pe=Fx.find(fe=>ap(fe.key)===k))==null?void 0:Pe.key)??"overview";Y.useEffect(()=>{var on;if(!e)return;const fe=new Set(e.providers.map(xn=>xn.id)),xe=new Set(e.accounts.map(xn=>xn.id)),be=new Set;for(const xn of e.accounts)for(const br of((on=xn.table)==null?void 0:on.monthly)??[])for(const Wr of br.breakdown)be.add(Wr.name);const Ve=x4(n,{providers:fe,accounts:xe,models:be,modelsReady:be.size>0});Ve!==n&&o(Ve)},[e,n,o]);const V=(e==null?void 0:e.accounts.filter(fe=>fe.hasUsage))??[],J=V.length>0,B=((e==null?void 0:e.accounts)??[]).some(Jm),X=((e==null?void 0:e.accounts)??[]).some(fe=>fe.hasBilling&&!Jm(fe)),ne=J&&V.every(fe=>fe.table!=null),te=Y.useRef(!1);Y.useEffect(()=>{ne&&(te.current=!0)},[ne]);const[I,Z]=Y.useState(!1);Y.useEffect(()=>{const fe=setTimeout(()=>Z(!0),12e3);return()=>clearTimeout(fe)},[]);const pe=!J||ne||te.current||I,me=Y.useMemo(()=>e?{snapshot:e,filters:n,derived:ee,periodLabel:se,scopeLabel:K,privacyMode:d,resetDisplay:w}:null,[e,n,ee,se,K,d,w]);return F.jsxs("div",{className:"min-h-screen",children:[F.jsx("button",{type:"button",onClick:g4,className:"fixed left-3 top-3 z-[100] -translate-y-20 rounded bg-bg-2 px-3 py-2 text-sm text-fg-bright shadow-lg transition-transform focus-visible:translate-y-0 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",children:"Skip to dashboard"}),F.jsxs("header",{className:"relative z-30 border-b border-line bg-bg-0/80 backdrop-blur",children:[F.jsxs("div",{className:"mx-auto max-w-[1600px] px-5 2xl:max-w-[1920px]",children:[F.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2 py-3.5",children:[F.jsx("h1",{className:"font-display text-2xl text-fg-bright",children:"TOKMON"}),F.jsxs("span",{className:"hidden text-sm text-fg-faint sm:inline",children:["~/usage ",F.jsx("span",{className:"text-prompt",children:"$"})," ",F.jsx("span",{className:"text-fg-dim",children:U}),F.jsx("span",{className:"cursor-blink text-accent",children:"▋"})]}),F.jsxs("div",{className:"ml-auto flex min-w-0 items-center gap-3",children:[(e==null?void 0:e.peak)&&F.jsx(S4,{peak:e.peak,resetDisplay:w,tz:e.tz}),F.jsx(p4,{conn:t,freshAt:(e==null?void 0:e.generatedAt)??null}),t==="live"&&F.jsx(v4,{phase:E,onRefresh:L}),t==="live"&&F.jsx(y4,{onOpen:()=>l(!0)}),F.jsx(m4,{mode:i.appearance.mode,resolvedMode:i.resolved.mode,disabled:!i.ready||n1(i.appearance.preset),onToggle:()=>{i.toggleMode()}}),pe&&(J||B)&&F.jsx(d4,{derived:ee,periodLabel:se,tz:(e==null?void 0:e.tz)??"",version:(e==null?void 0:e.version)??""})]})]}),F.jsx("nav",{className:"-mb-px flex items-center gap-1 overflow-x-auto","aria-label":"Dashboard sections",children:Fx.map(fe=>F.jsx(gp,{to:ap(fe.key),"aria-current":U===fe.key?"page":void 0,onMouseEnter:()=>Yx(fe.key),onFocus:()=>Yx(fe.key),className:`relative shrink-0 border-b-2 px-3 py-2 font-display text-xs uppercase tracking-wider transition focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-accent ${U===fe.key?"border-accent text-fg-bright":"border-transparent text-fg-faint hover:text-fg-dim"}`,children:fe.label},fe.key))})]}),F.jsx(c4,{snapshot:e,derived:ee,filters:n,setFilters:o,privacyMode:d})]}),F.jsxs("main",{id:"dashboard-content",tabIndex:-1,className:"mx-auto max-w-[1600px] px-5 2xl:max-w-[1920px] py-5 focus:outline-none",children:[g&&F.jsx("div",{className:"mb-4 rounded border border-critical/60 bg-critical/10 px-3 py-2 text-xs text-critical",role:"alert",children:"Unsafe network access is enabled. This dashboard may be reachable from your LAN after the daemon restarts."}),e&&t!=="live"&&F.jsx("div",{className:"mb-4 rounded border border-line bg-bg-1 px-3 py-2 text-xs text-fg-dim",role:"status","aria-live":"polite",children:Kh(t,"Reconnecting…")}),(e==null?void 0:e.seeded)&&F.jsxs("div",{className:"mb-4 flex items-center gap-2 rounded border border-line bg-bg-1 px-3 py-1.5 text-xs text-fg-dim",role:"status","aria-live":"polite",children:[F.jsx("span",{className:"inline-flex size-2 rounded-full",style:{background:"var(--color-cost)"},"aria-hidden":!0}),"showing cached data — refreshing…"]}),e?!J&&!B?X&&!I&&t!=="error"?F.jsx(Hh,{label:"reading billing…"}):F.jsx("div",{className:"rounded-md border border-line bg-bg-1 p-8 text-center text-sm text-fg-dim",children:"No providers detected. Open tokmon, enable a provider, then refresh."}):!pe||!me?F.jsx(Hh,{label:Kh(t,"reading usage history…")}):F.jsx(Q_.Provider,{value:me,children:F.jsx(e1,{})}):F.jsx(Hh,{label:Kh(t,"reading usage…")})]}),F.jsxs("footer",{className:"mx-auto max-w-[1600px] px-5 2xl:max-w-[1920px] py-6 text-center text-[11px] text-fg-faint",children:["tokmon",e!=null&&e.version?` v${e.version}`:""," · by David Ilie · live LLM usage dashboard"]}),c?F.jsx(Y.Suspense,{fallback:F.jsx("div",{className:"fixed inset-0 z-[60] grid place-items-center bg-bg-0/70 text-sm text-fg-dim",role:"status","aria-live":"polite",children:"Opening settings…"}),children:F.jsx(f$,{snapshot:e,onClose:()=>l(!1)})}):null]})}function Xx(){const{derived:e,periodLabel:t,scopeLabel:n,snapshot:o,privacyMode:i,resetDisplay:c}=xf();return F.jsx(Y.Suspense,{fallback:F.jsx(wf,{label:"overview"}),children:F.jsx(a$,{derived:e,periodLabel:t,scopeLabel:n,providers:o.providers,privacyMode:i,resetDisplay:c,tz:o.tz})})}function h$(){const{derived:e,scopeLabel:t}=xf();return F.jsx(Y.Suspense,{fallback:F.jsx(wf,{label:"analytics"}),children:F.jsx(c$,{derived:e,scopeLabel:t})})}function m$(){const{derived:e,scopeLabel:t}=xf();return F.jsx(Y.Suspense,{fallback:F.jsx(wf,{label:"models"}),children:F.jsx(u$,{derived:e,scopeLabel:t})})}function p$(){const{snapshot:e,filters:t,periodLabel:n,privacyMode:o}=xf();return F.jsx(Y.Suspense,{fallback:F.jsx(wf,{label:"explore"}),children:F.jsx(l$,{snapshot:e,filters:t,periodLabel:n,privacyMode:o})})}function wf({label:e}){return F.jsxs("div",{className:"min-h-[50vh] content-center text-center text-sm text-fg-faint",role:"status","aria-live":"polite",children:["Loading ",e,"…"]})}const cp=rF({component:d$}),Ou=(e,t)=>Yw({getParentRoute:()=>cp,path:ap(e),component:t}),g$=cp.addChildren([Yw({getParentRoute:()=>cp,path:"/",component:Xx}),Ou("overview",Xx),Ou("analytics",h$),Ou("models",m$),Ou("explore",p$)]),y$=gF({routeTree:g$,history:dP(),defaultViewTransition:!0});function v$(){return F.jsx(SF,{router:y$})}const Zx="tokmon.preloadReloadAt",S$=3e4;function x$(e,t){return!Number.isFinite(e)||t-e>=S$}function w$(){const e=t=>{t.preventDefault();let n=Number.NaN;try{n=Number(window.sessionStorage.getItem(Zx))}catch{}const o=Date.now();if(x$(n,o)){try{window.sessionStorage.setItem(Zx,String(o))}catch{}window.location.reload()}};return window.addEventListener("vite:preloadError",e),()=>window.removeEventListener("vite:preloadError",e)}w$();t2.createRoot(document.getElementById("root")).render(F.jsx(Y.StrictMode,{children:F.jsx(C2,{children:F.jsx(r$,{children:F.jsx(f4,{children:F.jsx(v$,{})})})})}));export{F$ as $,zD as A,qD as B,l6 as C,Tg as D,E6 as E,kr as F,u6 as G,E_ as H,o6 as I,l4 as J,ZD as K,g6 as L,c6 as M,f6 as N,gS as O,Cx as P,A$ as Q,Ia as R,w6 as S,e6 as T,Fu as U,T$ as V,M$ as W,t4 as X,BF as Y,zF as Z,yr as _,V_ as a,X$ as a0,d6 as a1,I$ as a2,P$ as a3,x6 as a4,e4 as a5,S6 as a6,v6 as a7,o4 as a8,R$ as a9,E$ as aA,y6 as aa,b$ as ab,_6 as ac,p6 as ad,OF as ae,c1 as af,LF as ag,_$ as ah,C$ as ai,a1 as aj,C6 as ak,n1 as al,dS as am,_F as an,EF as ao,vp as ap,er as aq,N$ as ar,Bj as as,U_ as at,op as au,wp as av,Gj as aw,B_ as ax,h6 as ay,m6 as az,r6 as b,s6 as c,b6 as d,KF as e,t6 as f,L$ as g,Ex as h,i4 as i,F as j,jD as k,a6 as l,n6 as m,a4 as n,UD as o,Z$ as p,Cl as q,Y as r,O$ as s,bl as t,s$ as u,k6 as v,LD as w,Kb as x,i6 as y,w_ as z};
|
|
83
|
+
at ${n}`}return t}function qa(e){switch(e._tag){case"InvalidType":case"OneOf":case"Composite":case"AnyOf":return ga(e.ast.annotations);case"InvalidValue":case"Forbidden":return ga(e.annotations);case"MissingKey":return ga(e.annotations,"messageMissingKey");case"UnexpectedKey":return ga(e.ast.annotations,"messageUnexpectedKey");case"Filter":return ga(e.filter.annotations);case"Encoding":return qa(e.issue)}}function ga(e,t="message"){const n=e==null?void 0:e[t];if(typeof n=="string")return n}function XS(e){return go(e)?"no value provided":yt(e.value)}class mi extends Ol{constructor(n){super();M(this,"run");this.run=n}map(n){return new mi((o,i)=>this.run(o,i).pipe(mE(Lp(n))))}compose(n){return ZS(this)?n:ZS(n)?this:new mi((o,i)=>this.run(o,i).pipe(ni(c=>n.run(c,i))))}}const xE=new mi(lt);function ZS(e){return e.run===xE.run}function pi(){return xE}function gn(e){return i3(Lp(e))}function i3(e){return new mi(t=>lt(e(t)))}function a3(e){return new mi(t=>{const n=rR(t,GF);return ks(n)?lt(n):Rs(e,Ne)})}function c3(){return gn(globalThis.String)}function wE(){return gn(globalThis.Number)}const Um="~effect/SchemaTransformation/Transformation";var fw;fw=Um;const Rl=class Rl{constructor(t,n){M(this,fw,Um);M(this,"_tag","Transformation");M(this,"decode");M(this,"encode");this.decode=t,this.encode=n}flip(){return new Rl(this.encode,this.decode)}compose(t){return new Rl(this.decode.compose(t.decode),t.encode.compose(this.encode))}};let Tn=Rl;function u3(e){return Ue(e,Um)}const kE=e=>u3(e)?e:new Tn(e.decode,e.encode);function uf(e){return new Tn(gn(e.decode),gn(e.encode))}const l3=new Tn(pi(),pi());function dg(){return l3}const EE=new Tn(wE(),c3()),_E=e=>uf({decode:t=>{const n=new Error(t.message);return typeof t.name=="string"&&t.name!=="Error"&&(n.name=t.name),typeof t.stack=="string"&&(n.stack=t.stack),n},encode:t=>{const n={name:t.name,message:t.message};return e!=null&&e.includeStack&&typeof t.stack=="string"&&(n.stack=t.stack),n}});function So(e){return t=>t._tag===e}const CE=So("Declaration"),f3=So("Never"),yl=So("Literal"),d3=So("UniqueSymbol"),h3=So("Arrays"),m3=So("Objects"),p3=So("Union");class Mt{constructor(t,n){M(this,"to");M(this,"transformation");this.to=t,this.transformation=n}}const g3={};class gi{constructor(t,n,o=void 0,i=void 0){M(this,"isOptional");M(this,"isMutable");M(this,"defaultValue");M(this,"annotations");this.isOptional=t,this.isMutable=n,this.defaultValue=o,this.annotations=i}}const ex="~effect/Schema";var dw;dw=ex;class vn{constructor(t=void 0,n=void 0,o=void 0,i=void 0){M(this,dw,ex);M(this,"annotations");M(this,"checks");M(this,"encoding");M(this,"context");this.annotations=t,this.checks=n,this.encoding=o,this.context=i}toString(){return`<${this._tag}>`}}class ic extends vn{constructor(n,o,i,c,l,d){super(i,c,l,d);M(this,"_tag","Declaration");M(this,"typeParameters");M(this,"run");this.typeParameters=n,this.run=o}getParser(){const n=this.run(this.typeParameters);return(o,i)=>go(o)?ag:mE(n(o.value,this,i),Ne)}recur(n){const o=yi(this.typeParameters,n);return o===this.typeParameters?this:new ic(o,this.run,this.annotations,this.checks,void 0,this.context)}getExpected(){var o;const n=(o=this.annotations)==null?void 0:o.expected;return typeof n=="string"?n:"<Declaration>"}}let y3=class extends vn{constructor(){super(...arguments);M(this,"_tag","Null")}getParser(){return df(this,null)}getExpected(){return"null"}};const hg=new y3;let v3=class extends vn{constructor(){super(...arguments);M(this,"_tag","Undefined")}getParser(){return df(this,void 0)}toCodecJson(){return Rt(this,[bE])}getExpected(){return"undefined"}};const bE=new Mt(hg,new Tn(gn(()=>{}),gn(()=>null))),S3=new v3;let x3=class extends vn{constructor(){super(...arguments);M(this,"_tag","Void")}getParser(){return df(this,void 0)}toCodecJson(){return Rt(this,[bE])}getExpected(){return"void"}};const w3=new x3;let k3=class extends vn{constructor(){super(...arguments);M(this,"_tag","Never")}getParser(){return xo(this,XF)}getExpected(){return"never"}};const E3=new k3;let _3=class extends vn{constructor(){super(...arguments);M(this,"_tag","Any")}getParser(){return xo(this,m1)}getExpected(){return"any"}};const C3=new _3;let b3=class extends vn{constructor(){super(...arguments);M(this,"_tag","Unknown")}getParser(){return xo(this,m1)}getExpected(){return"unknown"}};const mg=new b3;let Pa=class extends vn{constructor(n,o,i,c,l){super(o,i,c,l);M(this,"_tag","Literal");M(this,"literal");if(typeof n=="number"&&!globalThis.Number.isFinite(n))throw new Error(`A numeric literal must be finite, got ${yt(n)}`);this.literal=n}getParser(){return df(this,this.literal)}toCodecJson(){return typeof this.literal=="bigint"?tx(this):this}toCodecStringTree(){return typeof this.literal=="string"?this:tx(this)}getExpected(){return typeof this.literal=="string"?JSON.stringify(this.literal):globalThis.String(this.literal)}};function tx(e){const t=globalThis.String(e.literal);return Rt(e,[new Mt(new Pa(t),new Tn(gn(()=>e.literal),gn(()=>t)))])}let P3=class extends vn{constructor(){super(...arguments);M(this,"_tag","String")}getParser(){return xo(this,Ep)}getExpected(){return"string"}};const PE=new P3;let F3=class extends vn{constructor(){super(...arguments);M(this,"_tag","Number")}getParser(){return xo(this,h1)}toCodecJson(){return this.checks&&(xa(this.checks,"isFinite")||xa(this.checks,"isInt"))?this:Rt(this,[$3])}toCodecStringTree(){return this.checks&&(xa(this.checks,"isFinite")||xa(this.checks,"isInt"))?Rt(this,[J3]):Rt(this,[G3])}getExpected(){return"number"}};function xa(e,t){return e.some(n=>{var o,i;switch(n._tag){case"Filter":return((i=(o=n.annotations)==null?void 0:o.meta)==null?void 0:i._tag)===t;case"FilterGroup":return xa(n.checks,t)}})}const FE=new F3;let I3=class extends vn{constructor(){super(...arguments);M(this,"_tag","Boolean")}getParser(){return xo(this,JF)}getExpected(){return"boolean"}};const R3=new I3;class lf extends vn{constructor(n,o,i,c,l,d,h){super(c,l,d,h);M(this,"_tag","Arrays");M(this,"isMutable");M(this,"elements");M(this,"rest");this.isMutable=n,this.elements=o,this.rest=i;const p=o.findIndex(zr);if(p!==-1&&(o.slice(p+1).some(y=>!zr(y))||i.length>1))throw new Error("A required element cannot follow an optional element. ts(1257)");if(i.length>1&&i.slice(1).some(zr))throw new Error("An optional element cannot follow a rest element. ts(1266)")}getParser(n){const o=this,i=o.elements.map(g=>({ast:g,parser:n(g)})),c=o.rest.map(g=>({ast:g,parser:n(g)})),l=i.length,[d,...h]=c,p=h.length;function y(g,v){return v<l?i[v]:v>=g?h[v-g]:d}return Nm(function*(g,v){if(g._tag==="None")return g;const w=g.value;if(!Array.isArray(w))return yield*Je(new Cr(o,g));const S=w.length,E={ast:o,getParser:y,oinput:g,len:S,tailThreshold:A3(S,l,p),output:new globalThis.Array(S),issues:void 0,options:v},P=pg(v==null?void 0:v.concurrency),H=T3(E,w,{concurrency:P==null?void 0:P.concurrency,end:o.rest.length===0?l:Math.max(S,l+p)});if(H&&(yield*H),o.rest.length===0&&S>l)for(let _=l;_<=S-1;_++){const O=new or([_],new vE(o,w[_]));if(v.errors==="all")E.issues?E.issues.push(O):E.issues=[O];else return yield*Je(new Qt(o,g,[O]))}return E.issues?yield*Je(new Qt(o,g,E.issues)):Ne(E.output)})}recur(n){const o=yi(this.elements,n),i=yi(this.rest,n);return o===this.elements&&i===this.rest?this:new lf(this.isMutable,o,i,this.annotations,this.checks,void 0,this.context)}getExpected(){return"array"}}const T3=rf()({onItem(e,t,n){const o=n<e.len?Ne(t):zn();return e.getParser(e.tailThreshold,n).parser(o,e.options)},step(e,t,n,o){var i;if(n._tag==="Failure")return vl(e,e.ast,o,n);if(n.value._tag==="Some")e.output[o]=n.value.value;else{const c=e.getParser(e.tailThreshold,o);if(zr(c.ast))return;const l=new or([o],new yE((i=c.ast.context)==null?void 0:i.annotations));if(e.options.errors==="all")e.issues?e.issues.push(l):e.issues=[l];else return oc(new Qt(e.ast,e.oinput,[l]))}}});function A3(e,t,n){return Math.max(t,e-n)}const pg=e=>(e=e==="unbounded"?1/0:e??1,e>1?{concurrency:e}:void 0),vl=(e,t,n,o)=>{const i=sc(o.cause);if(At(i))return o;const c=new or([n],i.success);if(e.options.errors==="all")e.issues?e.issues.push(c):e.issues=[c];else return oc(new Qt(t,e.oinput,[c]))},gg="[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?",M3=new globalThis.RegExp(`(?:${gg}|Infinity|-Infinity|NaN)`);function IE(e,t){const n=xs(t);switch(n._tag){case"String":return Object.keys(e);case"TemplateLiteral":{const o=W3(n);return Object.keys(e).filter(i=>o.test(i))}case"Symbol":return Object.getOwnPropertySymbols(e);case"Number":return Object.keys(e).filter(o=>M3.test(o));case"Union":return[...new Set(n.types.flatMap(o=>IE(e,o)))];default:return[]}}class RE{constructor(t,n){M(this,"name");M(this,"type");this.name=t,this.type=n}}class L3{constructor(t,n,o){M(this,"parameter");M(this,"type");M(this,"merge");if(this.parameter=t,this.type=n,this.merge=o,zr(n)&&!VE(n))throw new Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")}}class yg extends vn{constructor(n,o,i,c,l,d){super(i,c,l,d);M(this,"_tag","Objects");M(this,"propertySignatures");M(this,"indexSignatures");this.propertySignatures=n,this.indexSignatures=o;const h=n.map(p=>p.name).filter((p,y,g)=>g.indexOf(p)!==y);if(h.length>0)throw new Error(`Duplicate identifiers: ${JSON.stringify(h)}. ts(2300)`)}getParser(n){const o=this,i=[],c=new Set,l=[];for(const p of o.propertySignatures)i.push(p.name),c.add(p.name),l.push({ps:p,parser:n(p.type),name:p.name,type:p.type});const d=o.indexSignatures.length;if(o.propertySignatures.length===0&&o.indexSignatures.length===0)return xo(o,YF);const h=d>0?rf()({onItem:Nm(function*(p,[y,g]){const w=n(KE(g.parameter))(Ne(y),p.options),S=In(w)?w:yield*QS(w);if(S._tag==="Failure"){const O=vl(p,o,y,S);O&&(yield*O);return}const E=Ne(p.input[y]),H=n(g.type)(E,p.options),_=In(H)?H:yield*QS(H);if(_._tag==="Failure"){const O=vl(p,o,y,_);O&&(yield*O);return}else if(S.value._tag==="Some"&&_.value._tag==="Some"){const O=S.value.value,C=_.value.value;if(g.merge&&g.merge.decode&&Object.hasOwn(p.out,O)){const[D,T]=g.merge.decode.combine([O,p.out[O]],[O,C]);Sa(p.out,D,T)}else Sa(p.out,O,C)}}),step:(p,y,g)=>g._tag==="Failure"?g:void 0}):void 0;return Nm(function*(p,y){if(p._tag==="None")return p;const g=p.value;if(!(typeof g=="object"&&g!==null&&!Array.isArray(g)))return yield*Je(new Cr(o,p));const v={},w={ast:o,oinput:p,input:g,out:v,issues:void 0,options:y},S=y.errors==="all",E=y.onExcessProperty==="error",P=y.onExcessProperty==="preserve";let H;if(o.indexSignatures.length===0&&(E||P)){H=Reflect.ownKeys(g);for(let C=0;C<H.length;C++){const D=H[C];if(!c.has(D))if(E){const T=new or([D],new vE(o,g[D]));if(S){w.issues?w.issues.push(T):w.issues=[T];continue}else return yield*Je(new Qt(o,p,[T]))}else Sa(v,D,g[D])}}const _=pg(y==null?void 0:y.concurrency),O=O3(w,l,_);if(O&&(yield*O),h){const C=SR();for(let T=0;T<d;T++){const L=o.indexSignatures[T],$=IE(g,L.parameter);for(let q=0;q<$.length;q++){const ee=$[q];C.push([ee,L])}}const D=h(w,C,_);D&&(yield*D)}if(w.issues)return yield*Je(new Qt(o,p,w.issues));if(y.propertyOrder==="original"){const C=(H??Reflect.ownKeys(g)).concat(i),D={};for(const T of C)Object.hasOwn(v,T)&&Sa(D,T,v[T]);return Ne(D)}return Ne(v)})}rebuild(n,o){const i=yi(this.propertySignatures,l=>{const d=n(l.type);return d===l.type?l:new RE(l.name,d)}),c=yi(this.indexSignatures,l=>{var y;const d=n(l.parameter),h=n(l.type),p=o?(y=l.merge)==null?void 0:y.flip():l.merge;return d===l.parameter&&h===l.type&&p===l.merge?l:new L3(d,h,p)});return i===this.propertySignatures&&c===this.indexSignatures?this:new yg(i,c,this.annotations,this.checks,void 0,this.context)}flip(n){return this.rebuild(n,!0)}recur(n){return this.rebuild(n,!1)}getExpected(){return this.propertySignatures.length===0&&this.indexSignatures.length===0?"object | array":"object"}}const O3=rf()({onItem(e,t){const n=Object.hasOwn(e.input,t.name)?Ne(e.input[t.name]):zn();return t.parser(n,e.options)},step(e,t,n){var o;if(n._tag==="Failure")return vl(e,e.ast,t.name,n);if(n.value._tag==="Some")Sa(e.out,t.name,n.value.value);else if(!zr(t.type)){const i=new or([t.name],new yE((o=t.type.context)==null?void 0:o.annotations));if(e.options.errors==="all"){e.issues?e.issues.push(i):e.issues=[i];return}else return oc(new Qt(e.ast,e.oinput,[i]))}}});function vg(e,t,n){return new yg(Reflect.ownKeys(e).map(o=>new RE(o,e[o].ast)),[],n,t)}function TE(e){return e.ast}function Sg(e,t,n){return new ac(e.map(TE),t,void 0,n)}function AE(e){switch(e._tag){case"Null":return["null"];case"Undefined":case"Void":return["undefined"];case"String":case"TemplateLiteral":return["string"];case"Number":return["number"];case"Boolean":return["boolean"];case"Symbol":case"UniqueSymbol":return["symbol"];case"BigInt":return["bigint"];case"Arrays":return["array"];case"ObjectKeyword":return["object","array","function"];case"Objects":return e.propertySignatures.length||e.indexSignatures.length?["object"]:["object","array"];case"Enum":return Array.from(new Set(e.enums.map(([,t])=>typeof t)));case"Literal":return[typeof e.literal];case"Union":return Array.from(new Set(e.types.flatMap(AE)));default:return["null","undefined","string","number","boolean","symbol","bigint","object","array","function"]}}function xg(e){var t;switch(e._tag){default:return[];case"Declaration":{const n=(t=e.annotations)==null?void 0:t["~sentinels"];return Array.isArray(n)?n:[]}case"Objects":return e.propertySignatures.flatMap(n=>{const o=n.type;if(!zr(o)){if(yl(o))return[{key:n.name,literal:o.literal}];if(d3(o))return[{key:n.name,literal:o.symbol}]}return[]});case"Arrays":return e.elements.flatMap((n,o)=>yl(n)&&!zr(n)?[{key:o,literal:n.literal}]:[]);case"Suspend":return xg(e.thunk())}}const nx=new WeakMap;function N3(e){var n,o;let t=nx.get(e);if(t)return t;t={};for(const i of e){const c=xs(i);if(f3(c))continue;const l=AE(c),d=xg(c);t.byType??(t.byType={});for(const h of l)((n=t.byType)[h]??(n[h]=[])).push(i);if(d.length>0){t.bySentinel??(t.bySentinel=new Map);for(const{key:h,literal:p}of d){let y=t.bySentinel.get(h);y||t.bySentinel.set(h,y=new Map);let g=y.get(p);g||y.set(p,g=[]),g.push(i)}}else{t.otherwise??(t.otherwise={});for(const h of l)((o=t.otherwise)[h]??(o[h]=[])).push(i)}}return nx.set(e,t),t}function rx(e){return t=>{const n=xs(t);return n._tag==="Literal"?n.literal===e:n._tag==="UniqueSymbol"?n.symbol===e:!0}}function D3(e,t){var i,c;const n=N3(t),o=e===null?"null":Array.isArray(e)?"array":typeof e;if(n.bySentinel){const l=((i=n.otherwise)==null?void 0:i[o])??[];if(o==="object"||o==="array"){for(const[d,h]of n.bySentinel)if(Object.hasOwn(e,d)){const p=h.get(e[d]);if(p)return[...p,...l].filter(rx(e))}}return l}return(((c=n.byType)==null?void 0:c[o])??[]).filter(rx(e))}let ac=class ME extends vn{constructor(n,o,i,c,l,d){super(i,c,l,d);M(this,"_tag","Union");M(this,"types");M(this,"mode");this.types=n,this.mode=o}getParser(n){const o=this;return(i,c)=>{if(i._tag==="None")return lt(i);const l=i.value,d=D3(l,o.types),h={ast:o,recur:n,oinput:i,input:l,out:void 0,successes:[],issues:void 0,options:c},p=pg(c==null?void 0:c.concurrency),y=j3(h,d,p);return y?Rn(y,g=>h.out?lt(h.out):Je(new YS(o,l,h.issues??[]))):h.out?lt(h.out):Je(new YS(o,l,h.issues??[]))}}recur(n){const o=yi(this.types,n);return o===this.types?this:new ME(o,this.mode,this.annotations,this.checks,void 0,this.context)}getExpected(n){var c;const o=(c=this.annotations)==null?void 0:c.expected;if(typeof o=="string")return o;if(this.types.length===0)return"never";const i=this.types.map(l=>{const d=xs(l);switch(d._tag){case"Arrays":{const h=d.elements.filter(yl);if(h.length>0)return`${sx(d.isMutable)}[ ${h.map(p=>{var y;return n(p)+ox((y=p.context)==null?void 0:y.isOptional)}).join(", ")}, ... ]`;break}case"Objects":{const h=d.propertySignatures.filter(p=>yl(p.type));if(h.length>0)return`{ ${h.map(p=>{var y,g;return`${sx((y=p.type.context)==null?void 0:y.isMutable)}${sl(p.name)}${ox((g=p.type.context)==null?void 0:g.isOptional)}: ${n(p.type)}`}).join(", ")}, ... }`;break}}return n(d)});return Array.from(new Set(i)).join(" | ")}};const j3=rf()({onItem(e,t){return e.recur(t)(e.oinput,e.options)},step(e,t,n){if(n._tag==="Failure"){const o=sc(n.cause);if(At(o))return n;e.issues?e.issues.push(o.success):e.issues=[o.success]}else{if(e.out&&e.ast.mode==="oneOf")return e.successes.push(t),oc(new XL(e.ast,e.input,e.successes));if(e.out=n.value,e.successes.push(t),e.ast.mode==="anyOf")return Wk}}}),LE=new ac([new Pa("Infinity"),new Pa("-Infinity"),new Pa("NaN")],"anyOf"),$3=new Mt(new ac([FE,LE],"anyOf"),new Tn(wE(),gn(e=>globalThis.Number.isFinite(e)?e:globalThis.String(e))));function sx(e){return e?"":"readonly "}function ox(e){return e?"?":""}class Sl extends Ol{constructor(n,o=void 0,i=!1){super();M(this,"_tag","Filter");M(this,"run");M(this,"annotations");M(this,"aborted");this.run=n,this.annotations=o,this.aborted=i}annotate(n){return new Sl(this.run,{...this.annotations,...n},this.aborted)}abort(){return new Sl(this.run,this.annotations,!0)}and(n,o){return new xl([this,n],o)}}class xl extends Ol{constructor(n,o=void 0){super();M(this,"_tag","FilterGroup");M(this,"checks");M(this,"annotations");this.checks=n,this.annotations=o}annotate(n){return new xl(this.checks,{...this.annotations,...n})}and(n,o){return new xl([this,n],o)}}function OE(e,t,n=!1){return new Sl((o,i,c)=>e3(o,i,e(o,i,c)),t,n)}function NE(e,t){const n=e.source;return OE(o=>e.test(o),{expected:`a string matching the RegExp ${n}`,meta:{_tag:"isPattern",regExp:e},toArbitraryConstraint:{string:{patterns:[e.source]}},...t})}function ff(e,t){const n=Object.getOwnPropertyDescriptors(e);return t(n),Object.create(Object.getPrototypeOf(e),n)}function Rt(e,t){return e.encoding===t?e:ff(e,n=>{n.encoding.value=t})}function wg(e,t){return e.context===t?e:ff(e,n=>{n.context.value=t})}function DE(e,t){if(e.checks){const n=e.checks[e.checks.length-1];return jE(e,z1(e.checks.slice(0,-1),n.annotate(t)))}return ff(e,n=>{n.annotations.value={...n.annotations.value,...t}})}function jE(e,t){return e.checks===t?e:ff(e,n=>{n.checks.value=t})}function kg(e,t){return jE(e,e.checks?[...e.checks,...t]:t)}function $E(e,t){const n=e,o=n[n.length-1],i=t(o.to);return i!==o.to?z1(e.slice(0,e.length-1),new Mt(i,o.transformation)):e}function U3(e){return t=>t.encoding?Rt(t,$E(t.encoding,e)):t}function B3(e,t,n){const o=new Mt(e,t);return Rt(n,n.encoding?[...n.encoding,o]:[o])}function yi(e,t){let n=!1;const o=new Array(e.length);for(let i=0;i<e.length;i++){const c=e[i],l=t(c);l!==c&&(n=!0),o[i]=l}return n?o:e}function UE(e,t){const n=e.context?new gi(e.context.isOptional,e.context.isMutable,e.context.defaultValue,{...e.context.annotations,...t}):new gi(!1,!1,void 0,t);return wg(e,n)}const BE=U3(zE);function zE(e){const t=e.context?e.context.isOptional===!1?new gi(!0,e.context.isMutable,e.context.defaultValue,e.context.annotations):e.context:new gi(!0,!1);return BE(wg(e,t))}function z3(e,t){const n=new Tn(a3(t),pi()),o=[new Mt(mg,n)],i=e.context?new gi(e.context.isOptional,e.context.isMutable,o,e.context.annotations):new gi(!1,!1,o);return wg(e,i)}function V3(e,t,n){return B3(e,n,t)}function zr(e){var t;return((t=e.context)==null?void 0:t.isOptional)??!1}const wl=Cs(e=>{var n;if(e.encoding)return wl(Rt(e,void 0));const t=e;return((n=t.recur)==null?void 0:n.call(t,wl))??t}),xs=Cs(e=>wl(io(e)));function q3(e,t){const n=t,o=n.length,i=n[o-1],c=[new Mt(io(Rt(e,void 0)),n[0].transformation.flip())];for(let d=1;d<o;d++)c.unshift(new Mt(io(n[d-1].to),n[d].transformation.flip()));const l=io(i.to);return l.encoding?Rt(l,[...l.encoding,...c]):Rt(l,c)}const io=Cs(e=>{var n,o;if(e.encoding)return q3(e,e.encoding);const t=e;return((n=t.flip)==null?void 0:n.call(t,io))??((o=t.recur)==null?void 0:o.call(t,io))??t});function VE(e){switch(e._tag){case"Undefined":return!0;case"Union":return e.types.some(VE);default:return!1}}function qE(e,t){return e.encodedParts.map(n=>H3(n,WE(n),t)).join("")}const W3=Cs(e=>new globalThis.RegExp(`^${qE(e,!0)}$`));function WE(e){switch(e._tag){case"Literal":return HL(globalThis.String(e.literal));case"String":return K3;case"Number":return gg;case"BigInt":return Y3;case"TemplateLiteral":return qE(e,!1);case"Union":return e.types.map(WE).join("|")}}function H3(e,t,n){if(p3(e)){if(!n)return`(?:${t})`}else if(!n)return t;return`(${t})`}function df(e,t){const n=lL(t);return o=>o._tag==="None"?ag:o.value===t?n:Je(new Cr(e,o))}function xo(e,t){return n=>n._tag==="None"?ag:t(n.value)?lt(n):Je(new Cr(e,n))}function HE(e){function t(n){return n.encoding?Rt(n,$E(n.encoding,t)):e(n)}return Cs(t)}const KE=HE(e=>{switch(e._tag){default:return e;case"Number":return e.toCodecStringTree();case"Union":return e.recur(KE)}}),K3="[\\s\\S]*?",ix=new globalThis.RegExp(`^${gg}$`);function Q3(e){return NE(ix,{expected:"a string representing a finite number",meta:{_tag:"isStringFinite",regExp:ix},...e})}const QE=kg(PE,[Q3()]),J3=new Mt(QE,EE),G3=new Mt(new ac([QE,LE],"anyOf"),EE),Y3="-?\\d+";function Bm(e,t,n,o,i){for(let c=0;c<e.length;c++){const l=e[c];if(l._tag==="FilterGroup")Bm(l.checks,t,n,o,i);else{const d=l.run(t,o,i);if(d&&(n.push(new GL(t,l,d)),l.aborted||(i==null?void 0:i.errors)!=="all"))return}}}const JE="~effect/Schema/Class",X3="~structural";function Z3(e){const t=new Set,n=new Set;return o(e);function o(i){if(i===null||typeof i=="string"||typeof i=="boolean")return!0;if(typeof i=="number")return globalThis.Number.isFinite(i);if(typeof i!="object"||i===void 0||t.has(i))return!1;if(n.has(i))return!0;t.add(i);const c=Array.isArray(i)?i.every(o):Object.keys(i).every(l=>o(i[l]));return t.delete(i),c&&n.add(i),c}}const eO=new ic([],()=>(e,t)=>Z3(e)?lt(e):Je(new Cr(t,Ne(e))),{typeConstructor:{_tag:"effect/Json"},generation:{runtime:"Schema.Json",Type:"Schema.Json"},expected:"JSON value",toCodecJson:()=>new Mt(mg,dg())}),tO=new Mt(hg,new Tn(pi(),gn(()=>null))),nO=new Mt(eO,dg()),rO=fk,GE=zp,sO=cl,zm=Bp,oO=qA,YE=XA,iO=Symbol.for("effect/MutableList/Empty"),aO=()=>({head:void 0,tail:void 0,length:0}),ax=()=>({array:[],mutable:!0,offset:0,next:void 0}),Vm=(e,t)=>{e.tail?e.tail.mutable||(e.tail.next=ax(),e.tail=e.tail.next):e.head=e.tail=ax(),e.tail.array.push(t),e.length++},cO=(e,t)=>uO(e,xr(t),!Array.isArray(t)),uO=(e,t,n=!1)=>{if(t.length===0)return 0;const o={array:t,mutable:n,offset:0,next:void 0};return e.head?e.tail=e.tail.next=o:e.head=e.tail=o,e.length+=t.length,t.length},Ku=e=>{e.head=e.tail=void 0,e.length=0},XE=(e,t)=>{var c;if(t<=0||!e.head)return[];if(t=Math.min(t,e.length),t===e.length&&((c=e.head)==null?void 0:c.offset)===0&&!e.head.next){const l=e.head.array;return Ku(e),l}const n=new Array(t);let o=0,i=e.head;for(;i;){for(;i.offset<i.array.length;)if(n[o++]=i.array[i.offset],i.mutable&&(i.array[i.offset]=void 0),i.offset++,o===t)return e.head=i,e.length-=t,e.length===0&&Ku(e),n;i=i.next}return Ku(e),n},lO=e=>{if(!e.head)return iO;const t=e.head.array[e.head.offset];return e.head.mutable&&(e.head.array[e.head.offset]=void 0),e.head.offset++,e.length--,e.head.offset===e.head.array.length&&(e.head.next?e.head=e.head.next:Ku(e)),t},fO="~effect/Queue",dO="~effect/Queue/Enqueue",hO="~effect/Queue/Dequeue",$h={_A:Ie,_E:Ie},mO={[fO]:$h,[dO]:$h,[hO]:$h,...Ps,toJSON(){return{_id:"effect/Queue",state:this.state._tag,size:wO(this)}}},pO=e=>He(t=>{const n=Object.create(mO);return n.dispatcher=t.currentDispatcher,n.capacity=(e==null?void 0:e.capacity)??Number.POSITIVE_INFINITY,n.strategy=(e==null?void 0:e.strategy)??"suspend",n.messages=aO(),n.scheduleRunning=!1,n.state={_tag:"Open",takers:new Set,offers:new Set,awaiters:new Set},Re(n)}),gO=e=>pO({capacity:e}),yO=(e,t)=>Et(()=>{if(e.state._tag!=="Open")return Re(xr(t));const n=vO(e,t);return n.length===0?ut([]):e.strategy==="dropping"?Re(n):bO(e,n)}),vO=(e,t)=>{if(e.state._tag!=="Open")return xr(t);if(e.capacity===Number.POSITIVE_INFINITY||e.strategy==="sliding")return cO(e.messages,t),e.strategy==="sliding"&&XE(e.messages,e.messages.length-e.capacity),ux(e),[];const n=e.capacity<=0?e.state.takers.size:e.capacity-e.messages.length;if(n===0)return xr(t);const o=[];let i=0;for(const c of t)i<n?Vm(e.messages,c):o.push(c),i++;return ux(e),o},wa=re(2,(e,t)=>kt(()=>SO(e,t))),SO=(e,t)=>{if(e.state._tag!=="Open")return!1;const n=Bn(t),o=oA(n,EO);return e.state.offers.size===0&&e.messages.length===0?(e_(e,o),!0):(e.state={...e.state,_tag:"Closing",exit:o},!0)},cx=e=>wa(e,E1(Tp())),xO=e=>ZE(e,1,Number.POSITIVE_INFINITY),ZE=(e,t,n)=>Et(()=>CO(e,t,n)??Za(PO(e),ZE(e,1,n))),wO=e=>e.state._tag==="Done"?0:e.messages.length,kO=ut(!0),EO=Er(Tp()),_O=e=>{if(e.scheduleRunning=!1,!(e.state._tag==="Done"||e.state.takers.size===0)){for(const t of e.state.takers)if(e.state.takers.delete(t),t(Vn),e.messages.length===0)break}},ux=e=>{e.scheduleRunning||e.state._tag==="Done"||e.state.takers.size===0||(e.scheduleRunning=!0,e.dispatcher.scheduleTask(()=>_O(e),0))},CO=(e,t,n)=>{if(e.state._tag==="Done")return e.state.exit;if(n<=0||t<=0)return ut([]);if(e.capacity<=0&&e.state.offers.size>0){e.capacity=1,Uh(e),e.capacity=0;const o=[lO(e.messages)];return Uh(e),ut(o)}if(t=Math.min(t,e.capacity||1),t<=e.messages.length){const o=XE(e.messages,n);return Uh(e),ut(o)}},bO=(e,t)=>ar(n=>{if(e.state._tag!=="Open")return n(ut(t));const o={_tag:"Array",remaining:t,offset:0,resume:n};return e.state.offers.add(o),kt(()=>{e.state._tag==="Open"&&e.state.offers.delete(o)})}),Uh=e=>{if(e.state._tag==="Done")return WS(e.state.exit.cause);if(e.state.offers.size===0)return e.state._tag==="Closing"&&e.messages.length===0?(e_(e,e.state.exit),WS(e.state.exit.cause)):!1;let t=e.capacity-e.messages.length;for(const n of e.state.offers){if(t===0)break;if(n._tag==="Single")Vm(e.messages,n.message),t--,n.resume(kO),e.state.offers.delete(n);else{for(;n.offset<n.remaining.length;n.offset++){if(t===0)return!1;Vm(e.messages,n.remaining[n.offset]),t--}n.resume(ut([])),e.state.offers.delete(n)}}return!1},PO=e=>ar(t=>e.state._tag==="Done"?t(e.state.exit):(e.state.takers.add(t),kt(()=>{e.state._tag!=="Done"&&e.state.takers.delete(t)}))),e_=(e,t)=>{if(e.state._tag==="Done")return;const n=e.state;e.state={_tag:"Done",exit:t};for(const o of n.takers)o(t);n.takers.clear();for(const o of n.awaiters)o(t);n.awaiters.clear()},FO="~effect/Channel",IO={[FO]:{_Env:Ie,_InErr:Ie,_InElem:Ie,_OutErr:Ie,_OutElem:Ie},pipe(){return jt(this,arguments)}},cc=e=>{const t=Object.create(IO);return t.transform=(n,o)=>hl(e(n,o),i=>lt(dL(i))),t},RO=(e,t)=>cc((n,o)=>Rn(uc(e)(n,o),i=>t(i,o))),TO=e=>cc((t,n)=>e),uc=e=>e.transform,AO=e=>cc((t,n)=>wr(()=>uc(e())(t,n))),MO=e=>TO(lt(xO(e))),LO=re(2,(e,t)=>RO(e,n=>Un(()=>{let o=0;return Rs(n,i=>t(i,o++))}))),OO=e=>cc((t,n)=>{let o;return lt(wr(()=>o||e.pipe(ul(n),Rn(i=>uc(i)(t,n)),Rn(i=>o=i))))}),NO=(e,t,n)=>wr(()=>{const o=tg(),i=uc(e)(of(),o);return fl(Rn(i,t),lt).pipe(fE(c=>af(o,c)))}),DO=re(2,(e,t)=>cc((n,o)=>Rs(so(uc(e)(n,o),t),so(t)))),jO=re(2,(e,t)=>NO(e,n=>dE(Rn(n,t),{disableYield:!0}))),wi=e=>e,ka=Cs(e=>{var t;switch(e._tag){case"Declaration":{const n=(t=e.annotations)==null?void 0:t[JE];if(Dl(n)){const o=n(e.typeParameters),i=ka(o.to);return Rt(e,i===o.to?[o]:[new Mt(i,o.transformation)])}return e}case"Objects":case"Arrays":return e.recur(n=>{var i;const o=(i=n.context)==null?void 0:i.defaultValue;return o?Rt(ka(n),o):ka(n)});case"Suspend":return e.recur(ka);default:return e}});function hf(e){const t=ka(wl(e.ast)),n=Eg(t);return(o,i)=>n(o,i!=null&&i.disableChecks?i!=null&&i.parseOptions?{...i.parseOptions,disableChecks:!0}:{disableChecks:!0}:i==null?void 0:i.parseOptions)}function t_(e){const t=hf(e);return(n,o)=>AM(hE(t(n,o)))}function $O(e){const t=hf(e);return(n,o)=>lg(vo(t(n,o),i=>new Error(i.toString(),{cause:i})))}function fo(e){return Eg(e.ast)}function UO(e){return VO(fo(e))}const BO=UO;function zO(e){return Eg(io(e.ast))}function Eg(e){const t=Qu(e);return(n,o)=>ni(t(Ne(n),o??g3),i=>i._tag==="None"?Je(new gl(i)):lt(i.value))}function VO(e){return(t,n)=>lg(vo(e(t,n),o=>new Error(o.toString(),{cause:o})))}const Qu=Cs(e=>{var i;let t;const n=(i=pE(e))==null?void 0:i.parseOptions;if(!e.context&&!e.encoding&&!e.checks)return(c,l)=>(t??(t=e.getParser(Qu)),n&&(l={...l,...n}),t(c,l));const o=h3(e)||m3(e)||CE(e)&&e.typeParameters.length>0;return(c,l)=>{n&&(l={...l,...n});const d=e.encoding;let h;if(d){const y=d,g=y.length;for(let v=g-1;v>=0;v--){const w=y[v],S=w.to,E=Qu(S);if(h=h?ni(h,P=>E(P,l)):E(c,l),w.transformation._tag==="Transformation"){const P=w.transformation.decode;h=ni(h,H=>P.run(H,l))}else h=w.transformation.decode(h,l)}h=vo(h,v=>new YL(e,c,v))}t??(t=e.getParser(Qu));let p=h?ni(h,y=>t(y,l)):t(c,l);if(e.checks&&!(l!=null&&l.disableChecks)){const y=e.checks;(l==null?void 0:l.errors)==="all"&&o&&ks(c)&&(p=VL(p,g=>{const v=[];Bm(y.filter(S=>{var E;return(E=S.annotations)==null?void 0:E[X3]}),c.value,v,e,l);const w=_S(v)?g._tag==="Composite"&&g.ast===e?new Qt(e,g.actual,[...g.issues,...v]):new Qt(e,c,[g,...v]):g;return Je(w)})),p=ni(p,g=>{if(ks(g)){const v=g.value,w=[];if(Bm(y,v,w,e,l),_S(w))return Je(new Qt(e,g,w))}return lt(g)})}return p}}),qm="~effect/Schema/Schema",qO={[qm]:qm,pipe(){return jt(this,arguments)},annotate(e){return this.rebuild(DE(this.ast,e))},annotateKey(e){return this.rebuild(UE(this.ast,e))},check(...e){return this.rebuild(kg(this.ast,e))}};function _g(e,t){const n=Object.create(qO);return t&&Object.assign(n,t),n.ast=e,n.rebuild=o=>_g(o,t),n.makeEffect=d1(hf(n),vo(o=>new mf(o))),n.make=$O(n),n.makeOption=t_(n),n}const Wm="~effect/Schema/SchemaError";var hw;hw=Wm;class mf{constructor(t){M(this,hw,Wm);M(this,"_tag","SchemaError");M(this,"name","SchemaError");M(this,"issue");this.issue=t}get message(){return this.issue.toString()}toString(){return`SchemaError(${this.message})`}}const WO=KO(HO);function HO(e){switch(e._tag){case"BigInt":case"Symbol":case"UniqueSymbol":return 0;default:return 1}}function KO(e){return t=>{const n=new Map;for(let c=0;c<t.length;c++)n.set(xs(t[c]),c);const o=[...t].sort((c,l)=>{c=xs(c),l=xs(l);const d=e(c),h=e(l);return d!==h?d-h:n.get(c)-n.get(l)});return o.some((c,l)=>c!==t[l])?o:t}}const Fa=qm;function pf(){return(e,t,n)=>Ge(new ic(e.map(TE),o=>t(o.map(i=>Ge(i))),n))}function n_(e,t){return pf()([],()=>(n,o)=>e(n)?lt(n):Je(new Cr(o,Ne(n))),t)}function QO(e){return Ue(e,Wm)}function lx(e){const t=fo(e);return(n,o)=>vo(t(n,o),i=>new mf(i))}const JO=BO;function GO(e){const t=zO(e);return(n,o)=>vo(t(n,o),i=>new mf(i))}const YO=GO,Ge=_g;function Cg(e){return Ue(e,Fa)&&e[Fa]===Fa}const we=wi(e=>Ge(zE(e.ast),{schema:e})),ki=wi(e=>we(s_(e)));function pt(e){const t=Ge(new Pa(e),{literal:e,transform(n){return t.pipe(El(pt(n),{decode:gn(()=>n),encode:gn(()=>e)}))}});return t}const fx=Ge(E3),dx=Ge(C3),XO=Ge(mg),ZO=Ge(hg),eN=Ge(S3),de=Ge(PE),bg=Ge(FE),wt=Ge(R3),kl=Ge(w3);function Pg(e,t){return Ge(e,{fields:t,mapFields(n,o){const i=n(this.fields);return Pg(vg(i,o!=null&&o.unsafePreserveChecks?this.ast.checks:void 0),i)}})}function _e(e){return Pg(vg(e,void 0),e)}const We=wi(e=>Ge(new lf(!1,[],[e.ast]),{schema:e})),tN=wi(e=>Ge(new lf(!1,[e.ast],[e.ast]),{schema:e}));function r_(e,t){return Ge(e,{members:t,mapMembers(n,o){const i=n(this.members);return r_(Sg(i,this.ast.mode,o!=null&&o.unsafePreserveChecks?this.ast.checks:void 0),i)}})}function nn(e,t){return r_(Sg(e,"anyOf",void 0),e)}function Ze(e){const t=e.map(pt);return Ge(Sg(t,"anyOf",void 0),{literals:e,members:t,mapMembers(n){return nn(n(this.members))},pick(n){return Ze(n)},transform(n){return nn(t.map((o,i)=>o.transform(n[i])))}})}const Me=wi(e=>nn([e,ZO])),s_=wi(e=>nn([e,eN]));function El(e,t){return n=>Ge(V3(n.ast,e.ast,t?kE(t):dg()),{from:n,to:e})}function nN(e){return t=>Ge(z3(t.ast,e),{schema:t})}function Sn(e){return pt(e).pipe(nN(lt(e)))}function rN(e,t){return _e({_tag:Sn(e),...t})}function sN(e,t){return n_(n=>n instanceof e,t)}function lc(){return(e,t)=>new Mt(e.ast,kE(t))}const gf=OE,oN=NE;function iN(e){return gf(t=>globalThis.Number.isFinite(t),{expected:"a finite number",meta:{_tag:"isFinite"},toArbitraryConstraint:{number:{noDefaultInfinity:!0,noNaN:!0}},...e})}function aN(e){const t=U1(e.order),n=e.formatter??yt;return(o,i)=>{var c;return gf(l=>t(l,o),{expected:`a value greater than or equal to ${n(o)}`,...(c=e.annotate)==null?void 0:c.call(e,o),...i})}}function cN(e){const t=U1(e.order),n=$1(e.order),o=eR(e.order),i=ZI(e.order),c=e.formatter??yt;return(l,d)=>{var y;const h=l.exclusiveMinimum?n:t,p=l.exclusiveMaximum?i:o;return gf(g=>h(g,l.minimum)&&p(g,l.maximum),{expected:`a value between ${c(l.minimum)}${l.exclusiveMinimum?" (excluded)":""} and ${c(l.maximum)}${l.exclusiveMaximum?" (excluded)":""}`,...(y=e.annotate)==null?void 0:y.call(e,l),...d})}}const o_=aN({order:Mp,annotate:e=>({meta:{_tag:"isGreaterThanOrEqualTo",minimum:e},toArbitraryConstraint:{number:{min:e}}})}),Go=cN({order:Mp,annotate:e=>({meta:{_tag:"isBetween",...e},toArbitraryConstraint:{number:{min:e.minimum,max:e.maximum,...e.exclusiveMinimum&&{minExcluded:!0},...e.exclusiveMaximum&&{maxExcluded:!0}}}})});function uN(e){return gf(t=>globalThis.Number.isSafeInteger(t),{expected:"an integer",meta:{_tag:"isInt"},toArbitraryConstraint:{number:{isInteger:!0}},...e})}function hx(e,t){const n=pf()([e,t],([o,i])=>(c,l,d)=>{if(!CM(c))return Je(new Cr(l,Ne(c)));switch(c._tag){case"Fail":return Va(fo(o)(c.error,d),{onSuccess:Pm,onFailure:h=>new Qt(l,Ne(c),[new or(["error"],h)])});case"Die":return Va(fo(i)(c.defect,d),{onSuccess:Fm,onFailure:h=>new Qt(l,Ne(c),[new or(["defect"],h)])});case"Interrupt":return lt(c)}},{typeConstructor:{_tag:"effect/Cause/Failure"},generation:{runtime:"Schema.CauseReason(?, ?)",Type:"Cause.Failure<?, ?>",importDeclaration:'import * as Cause from "effect/Cause"'},expected:"Cause.Failure",toCodec:([o,i])=>lc()(nn([_e({_tag:pt("Fail"),error:o}),_e({_tag:pt("Die"),defect:i}),_e({_tag:pt("Interrupt"),fiberId:s_(Pe)})]),uf({decode:c=>{switch(c._tag){case"Fail":return Pm(c.error);case"Die":return Fm(c.defect);case"Interrupt":return Im(c.fiberId)}},encode:Ie})),toArbitrary:([o,i])=>i_(o,i),toEquivalence:([o,i])=>a_(o,i),toFormatter:([o,i])=>c_(o,i)});return Ge(n.ast,{error:e,defect:t})}function i_(e,t){return(n,o)=>n.oneof(o!=null&&o.isSuspend?{maxDepth:2,depthIdentifier:"Cause.Failure"}:{},n.constant(Im()),n.integer({min:1}).map(Im),e.map(i=>Pm(i)),t.map(i=>Fm(i)))}function a_(e,t){return(n,o)=>{if(n._tag!==o._tag)return!1;switch(n._tag){case"Fail":return e(n.error,o.error);case"Die":return t(n.defect,o.defect);case"Interrupt":return n.fiberId===o.fiberId}}}function c_(e,t){return n=>{switch(n._tag){case"Fail":return`Fail(${e(n.error)})`;case"Die":return`Die(${t(n.defect)})`;case"Interrupt":return"Interrupt"}}}function mx(e,t){const n=pf()([e,t],([o,i])=>{const c=We(hx(o,i));return(l,d,h)=>_M(l)?Va(fo(c)(l.reasons,h),{onSuccess:bm,onFailure:p=>new Qt(d,Ne(l),[new or(["failures"],p)])}):Je(new Cr(d,Ne(l)))},{typeConstructor:{_tag:"effect/Cause"},generation:{runtime:"Schema.Cause(?, ?)",Type:"Cause.Cause<?, ?>",importDeclaration:'import * as Cause from "effect/Cause"'},expected:"Cause",toCodec:([o,i])=>lc()(We(hx(o,i)),uf({decode:bm,encode:({reasons:c})=>c})),toArbitrary:([o,i])=>u_(o,i),toEquivalence:([o,i])=>l_(o,i),toFormatter:([o,i])=>f_(o,i)});return Ge(n.ast,{error:e,defect:t})}function u_(e,t){return(n,o)=>n.array(i_(e,t)(n,o)).map(bm)}function l_(e,t){const n=xI(a_(e,t));return(o,i)=>n(o.reasons,i.reasons)}function f_(e,t){const n=c_(e,t);return o=>`Cause([${o.reasons.map(n).join(", ")}])`}const d_=_e({message:de,name:we(de),stack:we(de)}),lN=sN(globalThis.Error,{typeConstructor:{_tag:"Error"},generation:{runtime:"Schema.Error",Type:"globalThis.Error"},expected:"Error",toCodecJson:()=>lc()(d_,_E()),toArbitrary:()=>e=>e.string().map(t=>new globalThis.Error(t))}),px=new Tn(pi(),gn(e=>{try{return JSON.parse(JSON.stringify(e))}catch{return yt(e)}})),cr=nn([d_.pipe(El(lN,_E())),dx.pipe(El(XO.annotate({toCodecJson:()=>lc()(dx,px),toArbitrary:()=>e=>e.json()}),px))]);function fN(e,t,n){const o=pf()([e,t,n],([i,c,l])=>{const d=mx(c,l);return(h,p,y)=>{if(!IM(h))return Je(new Cr(p,Ne(h)));switch(h._tag){case"Success":return Va(fo(i)(h.value,y),{onSuccess:jh,onFailure:g=>new Qt(p,Ne(h),[new or(["value"],g)])});case"Failure":return Va(fo(d)(h.cause,y),{onSuccess:Ca,onFailure:g=>new Qt(p,Ne(h),[new or(["cause"],g)])})}}},{typeConstructor:{_tag:"effect/Exit"},generation:{runtime:"Schema.Exit(?, ?, ?)",Type:"Exit.Exit<?, ?, ?>",importDeclaration:'import * as Exit from "effect/Exit"'},expected:"Exit",toCodec:([i,c,l])=>lc()(nn([_e({_tag:pt("Success"),value:i}),_e({_tag:pt("Failure"),cause:mx(c,l)})]),uf({decode:d=>d._tag==="Success"?jh(d.value):Ca(d.cause),encode:d=>Hk(d)?{_tag:"Success",value:d.value}:{_tag:"Failure",cause:d.cause}})),toArbitrary:([i,c,l])=>(d,h)=>d.oneof(h!=null&&h.isSuspend?{maxDepth:2,depthIdentifier:"Exit"}:{},i.map(p=>jh(p)),u_(c,l)(d,h).map(p=>Ca(p))),toEquivalence:([i,c,l])=>{const d=l_(c,l);return(h,p)=>{if(h._tag!==p._tag)return!1;switch(h._tag){case"Success":return i(h.value,p.value);case"Failure":return d(h.cause,p.cause)}}},toFormatter:([i,c,l])=>{const d=f_(c,l);return h=>{switch(h._tag){case"Success":return`Exit.Success(${i(h.value)})`;case"Failure":return`Exit.Failure(${d(h.cause)})`}}}});return Ge(o.ast,{value:e,error:t,defect:n})}const Pe=bg.check(iN()),dN=bg.check(uN()),hN=globalThis.Symbol.for("immer-draftable");function Fg(e,t,n,o,i){var h,p,y,g;const c=pN(n,t,o),l=h_(t),d=(g=class extends e{constructor(...[v,w]){v=v??{};const S=n.make(v,w);super({...v,...S},{...w,disableChecks:!0})}get[(y=Fa,p=l,h=hN,p)](){return l}static get ast(){return c(this).ast}static pipe(){return jt(this,arguments)}static rebuild(v){return c(this).rebuild(v)}static make(v,w){return new this(v,w)}static makeOption(v,w){return t_(c(this))(v??{},w)}static makeEffect(v,w){return vo(hf(c(this))(v??{},w),S=>new mf(S))}static annotate(v){return this.rebuild(DE(this.ast,v))}static annotateKey(v){return this.rebuild(UE(this.ast,v))}static check(...v){return this.rebuild(kg(this.ast,v))}static extend(v){return(w,S)=>{const E={...n.fields,...w};return Fg(this,v,Pg(vg(E,n.ast.checks,{identifier:v}),E),S,i)}}static mapFields(v,w){return n.mapFields(v,w)}},M(g,y,Fa),M(g,h,!0),M(g,"identifier",t),M(g,"fields",n.fields),g);return i!==void 0&&Object.assign(d.prototype,i(t)),d}function mN(e){return new Tn(gn(t=>new e(t)),pi())}function h_(e){return`~effect/Schema/Class/${e}`}function pN(e,t,n){let o;return i=>{if(o===void 0){const c=mN(i),l=Ge(new ic([e.ast],()=>(d,h)=>d instanceof i||Ue(d,h_(t))?lt(d):Je(new Cr(h,Ne(d))),{identifier:t,[JE]:([d])=>new Mt(d,c),toCodec:([d])=>new Mt(d.ast,c),toArbitrary:([d])=>()=>d.map(h=>new i(h)),toFormatter:([d])=>h=>`${i.identifier}(${d(h)})`,"~sentinels":xg(e.ast),...n}));o=e.pipe(El(l,c))}return o}}function Ig(e){return Cg(e)}const gN=e=>(t,n)=>{const o=Ig(t)?t:_e(t);return Fg(HM,e,o,n,i=>({toString(){return`${i}(${yt({...this})})`}}))},Wn=e=>(t,n)=>{const o=Ig(t)?t:_e(t);return Fg(b1,e,o,n,c=>({name:c}))},yf=e=>(t,n,o)=>Wn(e??t)(Ig(n)?n.mapFields(i=>({_tag:Sn(t),...i}),{unsafePreserveChecks:!0}):rN(t,n),o);function Bh(e){return Ge(m_(e.ast))}const m_=HE(e=>{const t=yN(e,m_);return t!==e&&zr(e)?BE(t):t});function yN(e,t){var n,o;switch(e._tag){case"Declaration":{const i=((n=e.annotations)==null?void 0:n.toCodecJson)??((o=e.annotations)==null?void 0:o.toCodec);if(Dl(i)){const c=CE(e)?e.typeParameters.map(h=>_g(xs(h))):[],l=i(c),d=t(l.to);return Rt(e,d===l.to?[l]:[new Mt(d,l.transformation)])}return Rt(e,[tO])}case"Unknown":case"ObjectKeyword":return Rt(e,[nO]);case"Undefined":case"Void":case"Literal":case"Number":return e.toCodecJson();case"UniqueSymbol":case"Symbol":case"BigInt":return e.toCodecStringTree();case"Objects":{if(e.propertySignatures.some(i=>typeof i.name!="string"))throw new globalThis.Error("Objects property names must be strings",{cause:e});return e.recur(t)}case"Union":{const i=WO(e.types);return i!==e.types?new ac(i,e.mode,e.annotations,e.checks,e.encoding,e.context).recur(t):e.recur(t)}case"Arrays":case"Suspend":return e.recur(t)}return e}const vN="~effect/Stream",SN={_R:Ie,_E:Ie,_A:Ie},xN={[vN]:SN,pipe(){return jt(this,arguments)}},wN=e=>{const t=Object.create(xN);return t.channel=e,t},kN="~effect/Stream",EN=e=>Ue(e,kN),fc=wN,_N=e=>e.channel,CN=e=>fc(AO(()=>e().channel)),bN=e=>fc(MO(e)),PN=e=>fc(OO(Rs(e,_N))),gx=re(2,(e,t)=>CN(()=>{let n=0;return fc(LO(e.channel,V1(o=>t(o,n++))))})),FN=re(2,(e,t)=>fc(DO(e.channel,t))),IN=re(2,(e,t)=>jO(e.channel,n=>{let o=0;return oE({while:()=>o<n.length,body:()=>t(n[o++]),step:Ga})})),Hm="~effect/FiberSet",RN=e=>Ue(e,Hm),TN={[Hm]:Hm,[Symbol.iterator](){return this.state._tag==="Closed"?aR():this.state.backing[Symbol.iterator]()},...Ps,toJSON(){return{_id:"FiberMap",state:this.state}}},AN=(e,t)=>{const n=Object.create(TN);return n.state={_tag:"Open",backing:e},n.deferred=t,n},MN=()=>uE(Un(()=>AN(new Set,Zp())),e=>wr(()=>{const t=e.state;if(t._tag==="Closed")return ht;e.state={_tag:"Closed"};const n=t.backing;return sO(n).pipe(NM(e.deferred))})),p_=-1,LN=JR(YR(FM,GR(p_))),ON=re(e=>RN(e[0]),(e,t,n)=>{if(e.state._tag==="Closed"){t.interruptUnsafe(p_);return}else if(e.state.backing.has(t))return;e.state.backing.add(t),t.addObserver(o=>{e.state._tag!=="Closed"&&(e.state.backing.delete(t),Kk(o)&&((n==null?void 0:n.propagateInterruption)===!0?!LN(o.cause):!bM(o.cause))&&ba(e.deferred,o))})}),NN=(function(){let e;return()=>(e===void 0&&(e=Om(Lm)),e)})(),DN=e=>()=>Rs(ml(),t=>{const n=pl(t);return(o,i)=>{if(e.state._tag==="Closed")return NN();const c=n(o,i);return ON(e,c),c}}),yx=e=>eg(e.deferred),jN="~effect/interfaces/PrimaryKey",vx="~effect/ManagedRuntime",$N=(e,t)=>{const n=(t==null?void 0:t.memoMap)??rg(),o=tg("parallel"),i=ll(o,"sequential"),c={onFiberStart:oO(o)},l=y=>y?{...y,onFiberStart:y.onFiberStart?g=>{c.onFiberStart(g),y.onFiberStart(g)}:c.onFiberStart}:c;let d;const h=dl(y=>(d||(d=Om(gL(sg(e,n,i),g=>Un(()=>{p.cachedContext=g})),{...c,scheduler:y.currentScheduler})),mL(rO(d)))),p={[vx]:vx,memoMap:n,scope:o,contextEffect:h,cachedContext:void 0,context(){return p.cachedContext===void 0?Wu(p.contextEffect):Promise.resolve(p.cachedContext)},dispose(){return Wu(p.disposeEffect)},disposeEffect:wr(()=>(p.contextEffect=hL("ManagedRuntime disposed"),p.cachedContext=void 0,af(p.scope,Wk))),runFork(y,g){return p.cachedContext===void 0?Om(Yo(p,y),l(g)):pl(p.cachedContext)(y,l(g))},runCallback(y,g){return p.cachedContext===void 0?OL(Yo(p,y),l(g)):LL(p.cachedContext)(y,l(g))},runSyncExit(y){return p.cachedContext===void 0?hE(Yo(p,y)):UL(p.cachedContext)(y)},runSync(y){return p.cachedContext===void 0?lg(Yo(p,y)):$L(p.cachedContext)(y)},runPromiseExit(y,g){return p.cachedContext===void 0?DL(Yo(p,y),l(g)):jL(p.cachedContext)(y,l(g))},runPromise(y,g){return p.cachedContext===void 0?Wu(Yo(p,y),l(g)):NL(p.cachedContext)(y,l(g))}};return p};function Yo(e,t){return Rn(e.contextEffect,n=>so(t,n))}const Km="~effect/rpc/RpcSchema/StreamSchema";function g_(e){return Ue(e,Km)}function y_(e){return g_(e)?Ne({success:e.success,error:e.error}):zn()}const UN=n_(EN);function BN(e,t){return Ge(UN.ast,{[Km]:Km,success:e,error:t})}const Sx="~effect/rpc/Rpc",zN={[Sx]:Sx,pipe(){return jt(this,arguments)},setSuccess(e){return hs({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:e,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},setError(e){return hs({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:e,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},setPayload(e){return hs({_tag:this._tag,payloadSchema:Cg(e)?e:_e(e),successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},middleware(e){return hs({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:new Set([...this.middlewares,e])})},prefix(e){return hs({_tag:`${e}${this._tag}`,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},annotate(e,t){return hs({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,middlewares:this.middlewares,annotations:Fs(this.annotations,e,t)})},annotateMerge(e){return hs({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,middlewares:this.middlewares,annotations:di(this.annotations,e)})}},hs=e=>{function t(){}return Object.setPrototypeOf(t,zN),Object.assign(t,e),t.key=`effect/rpc/Rpc/${e._tag}`,t},Ei=(e,t)=>{const n=(t==null?void 0:t.success)??kl,o=(t==null?void 0:t.error)??fx,i=(t==null?void 0:t.defect)??cr;let c;return t!=null&&t.primaryKey?c=class extends gN(`effect/rpc/Rpc/${e}`)(t.payload){[jN](){return t.primaryKey(this)}}:c=Cg(t==null?void 0:t.payload)?t==null?void 0:t.payload:t!=null&&t.payload?_e(t==null?void 0:t.payload):kl,hs({_tag:e,payloadSchema:c,successSchema:t!=null&&t.stream?BN(n,o):n,errorSchema:t!=null&&t.stream?fx:o,defectSchema:i,annotations:sr(),middlewares:new Set})},zh=new WeakMap,VN=e=>{if(zh.has(e))return zh.get(e);const t=e,n=new Set([t.errorSchema]),o=y_(t.successSchema);ks(o)&&n.add(o.value.error);for(const c of t.middlewares)n.add(c.error);const i=fN(ks(o)?kl:t.successSchema,nn([...n]),t.defectSchema);return zh.set(e,i),i},qN="~effect/rpc/Rpc/Wrapper",WN=e=>qN in e,HN={add(...e){const t=new Map(this.requests);for(const n of e)t.set(n._tag,n);return jr({requests:t,annotations:this.annotations})},merge(...e){const t=new Map(this.requests),n=new Map(this.annotations.mapUnsafe);for(const o of e){for(const[i,c]of o.requests)t.set(i,c);for(const[i,c]of o.annotations.mapUnsafe)n.set(i,c)}return jr({requests:t,annotations:Ss(n)})},omit(...e){const t=new Map(this.requests);for(const n of e)t.delete(n);return jr({requests:t,annotations:this.annotations})},middleware(e){const t=new Map;for(const[n,o]of this.requests)t.set(n,o.middleware(e));return jr({requests:t,annotations:this.annotations})},toHandlers(e){const t=this;return Mm(function*(){const n=yield*ml(),o=ii(e)?yield*e:e,i=new Map;for(const[c,l]of Object.entries(o)){const d=t.requests.get(c);i.set(d.key,{tag:d._tag,handler:l,context:n})}return Ss(i)})},prefix(e){const t=new Map;for(const n of this.requests.values()){const o=n.prefix(e);t.set(o._tag,o)}return jr({requests:t,annotations:this.annotations})},toLayer(e){return Tm(this.toHandlers(e))},of:Ie,toLayerHandler(e,t){const n=this;return Tm(Mm(function*(){const o=yield*ml(),i=ii(t)?yield*t:t,c=new Map,l=n.requests.get(e);return c.set(l.key,{handler:i,context:o}),Ss(c)}))},accessHandler(e){return cE(t=>{const n=this.requests.get(e),{handler:o,context:i}=t.mapUnsafe.get(n.key);return lt((c,l)=>{l.rpc=n;const d=o(c,l),h=WN(d)?d.value:d;return ii(h)?_L(h,i):FN(h,i)})})},annotate(e,t){return jr({requests:this.requests,annotations:Fs(this.annotations,e,t)})},annotateRpcs(e,t){return this.annotateRpcsMerge(fi(e,t))},annotateMerge(e){return jr({requests:this.requests,annotations:di(this.annotations,e)})},annotateRpcsMerge(e){const t=new Map;for(const[n,o]of this.requests)t.set(n,o.annotateMerge(di(e,o.annotations)));return jr({requests:t,annotations:this.annotations})}},jr=e=>Object.assign(function(){},HN,{requests:e.requests,annotations:e.annotations}),KN=(...e)=>jr({requests:new Map(e.map(t=>[t._tag,t])),annotations:sr()}),QN="/ws",JN=4,Ht={getConfig:"tokmon.getConfig",setConfig:"tokmon.setConfig",refresh:"tokmon.refresh",browseFs:"tokmon.browseFs",snapshot:"tokmon.snapshot",config:"tokmon.config"},GN=Ze(["all","summary","table","billing","peak"]),ho=Ze(Ll),tr=dN.check(o_(0)),_l=Pe.check(o_(1)),YN=_e({id:de,providerId:ho,name:de,homeDir:de,color:we(de)}),XN=_e({enabled:wt,showMenuBarText:wt,menuBarValue:we(Ze(["usage","todayTokens"])),displayMetric:Ze(["smartHeadroom","tightestRemaining"]),pollIntervalSec:Pe.check(Go({minimum:1,maximum:86400})),activeTimeoutMin:Pe.check(Go({minimum:1,maximum:1440})),graceMin:Pe.check(Go({minimum:1,maximum:10080})),promotionHoldMin:Pe.check(Go({minimum:0,maximum:1440})),lowWatermarkPct:Pe.check(Go({minimum:0,maximum:100})),criticalWatermarkPct:Pe.check(Go({minimum:0,maximum:100})),pinnedAccount:Me(de),pins:We(de),pinnedProviders:we(We(de)),launchAtLogin:wt,theme:pt("dark")}),ZN=_e({expandedProviders:We(de),graphRangeDays:we(Ze(c1))}),eD=_e({enabled:wt,disabledProviders:We(ho),excludedAccounts:We(_e({providerId:ho,homeDir:de}))}),Zt=de.check(oN(/^#[0-9a-f]{6}$/i)),xx=_e({canvas:we(Zt),panel:we(Zt),inset:we(Zt),insetStrong:we(Zt),chrome:we(Zt),line:we(Zt),lineStrong:we(Zt),lineFaint:we(Zt),text:we(Zt),textDim:we(Zt),textFaint:we(Zt),textStrong:we(Zt),accent:we(Zt),cost:we(Zt),positive:we(Zt)}),tD=_e({version:pt(1),mode:Ze(["auto","light","dark"]),preset:Ze(t1),terminal:Ze(["ansi","dark","light","off"]),custom:we(_e({base:Ze(vp),light:xx,dark:xx}))}),v_=_e({revision:tr,interval:_l,billingInterval:_l,clearScreen:wt,privacyMode:wt,privacyToggleKey:de,timezone:Me(de),accounts:We(YN),activeAccountId:Me(de),disabledProviders:We(ho),onboarded:wt,dashboardLayout:Ze(["grid","single"]),defaultFocus:Ze(["all","last"]),ascii:Ze(["auto","on","off"]),allowNetworkAccess:wt,allowedHosts:We(de),resetDisplay:Ze(["relative","absolute"]),knownProviders:We(ho),appearance:we(tD),accountDetection:we(eD),tray:we(XN),desktop:we(ZN)}),nD=_e({version:pt(JN),capabilities:We(de)}),dc=_e({protocol:nD,config:v_}),rD=_e({expectedRevision:tr,config:v_}),sD=_e({kind:pt("conflict"),state:dc});class Qm extends yf()("ConfigUpdateConflictFailure",{kind:pt("conflict"),state:dc}){}const oD=_e({kind:pt("persistence"),message:de});class iD extends yf()("ConfigPersistenceFailure",{kind:pt("persistence"),message:de}){}const aD=nn([Qm,sD]),cD=nn([iD,oD]);class uD extends yf()("RefreshFailure",{kind:pt("refresh"),message:de}){}const lD=_e({name:de,path:de,dir:wt}),fD=_e({path:de,parent:Me(de),entries:We(lD)}),Vh=_e({cost:Pe,tokens:Pe,input:Pe,cacheRead:Pe,cacheSavings:Pe}),dD=_e({name:de,input:Pe,output:Pe,cacheCreate:Pe,cacheRead:Pe,cacheSavings:Pe,cost:Pe,count:Pe}),qh=_e({label:de,models:We(de),input:Pe,output:Pe,cacheCreate:Pe,cacheRead:Pe,cacheSavings:Pe,total:Pe,cost:Pe,count:Pe,breakdown:We(dD)}),hD=_e({today:Vh,week:Vh,month:Vh,burnRate:Pe,series:We(Pe),lastActivityAt:Me(tr)}),mD=_e({daily:We(qh),weekly:We(qh),monthly:We(qh)}),pD=nn([_e({kind:pt("percent")}),_e({kind:pt("dollars"),currency:we(de)}),_e({kind:pt("count"),suffix:we(de)})]),gD=_e({key:we(de),role:we(Ze(["session","weekly","model","other","unbounded"])),modelId:we(Me(de)),active:we(wt),label:de,used:Pe,limit:Me(Pe),format:pD,resetsAt:we(Me(de)),primary:we(wt)}),S_=Ze(["session","weekly","model","other","unbounded"]),yD=_e({title:de,subtitle:Me(de),accessibleLabel:de,redacted:wt}),vD=_e({key:de,label:de,role:S_,modelId:Me(de),usedPct:Me(Pe),remainingPct:Me(Pe),resetsAt:Me(tr),bounded:wt,primary:wt,active:wt,displayOrder:tr,valueText:de,value:we(_e({kind:pt("money"),used:Pe,limit:Me(Pe),remaining:Me(Pe),currency:de}))}),SD=_e({key:de,label:de,role:S_,remainingPct:Pe,included:wt,reason:Ze(["session","active-model","weekly-cap","primary","fallback-floor"])}),x_=_e({value:Me(Pe),unit:pt("index-100"),mode:Ze(["smart","single-window","fallback-floor","unavailable"]),basis:Ze(["active","idle-runway","unavailable"]),representativeAccountId:Me(de),activeAccountIds:We(de),factors:We(SD),explanation:de}),xD=_e({plan:Me(de),metrics:We(gD),error:Me(de),email:we(Me(de)),displayName:we(Me(de)),activity:we(Me(_e({series:We(Pe),summary:de}))),modelSpend:we(Me(We(_e({name:de,usd:Pe,requests:Pe})))),asOfMs:we(tr)}),wD=_e({id:de,providerId:ho,name:de,color:de,homeDir:Me(de),hasUsage:wt,hasBilling:wt,email:we(Me(de)),displayName:we(Me(de)),identity:we(yD),quotas:we(We(vD)),headroom:we(x_),plan:we(Me(de)),lastActivityAt:Me(tr),dashboard:Me(hD),table:Me(mD),billing:Me(xD),summaryState:Ze(["pending","ready","error"]),billingState:Ze(["pending","ready","error"]),tableState:Ze(["pending","ready","error"]),summaryUpdatedAt:we(Me(tr)),billingUpdatedAt:we(Me(tr)),tableUpdatedAt:we(Me(tr))}),kD=_e({version:de,generatedAt:tr,tz:de,intervalMs:_l,billingIntervalMs:we(_l),providers:We(_e({id:ho,name:de,color:de,headroom:we(x_)})),accounts:We(wD),seeded:wt,peak:Me(_e({state:Ze(["peak","off-peak","weekend"]),label:de,minutesUntilChange:Me(Pe),changesAt:we(Me(de))}))}),Rg=_e({}),ED=Ei(Ht.getConfig,{payload:Rg,success:dc}),_D=Ei(Ht.setConfig,{payload:rD,success:dc,error:nn([aD,cD])}),CD=Ei(Ht.refresh,{payload:_e({scope:GN}),success:kl,error:uD}),bD=Ei(Ht.browseFs,{payload:_e({path:de}),success:fD}),PD=Ei(Ht.snapshot,{payload:Rg,success:kD,stream:!0}),FD=Ei(Ht.config,{payload:Rg,success:dc,stream:!0}),ID=KN(ED,_D,CD,bD,PD,FD);function RD(e){if(!e||typeof e!="object")return!1;const t=e;return t.isContentEditable?!0:typeof t.tagName=="string"&&["INPUT","TEXTAREA","SELECT"].includes(t.tagName.toUpperCase())}function TD(e,t){return t.length===1&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&!e.shiftKey&&!e.repeat&&!e.editable&&!RD(e.target)&&e.key.toLowerCase()===t.toLowerCase()}const Wa="#8d9090",hn={green:"#6caa71",greenBright:"#79be7e",cyan:"#7ccbcd",cyanBright:"#84dde0",blue:"#6d96b4",blueBright:"#67b5ed",magenta:"#bd7bcd",magentaBright:"#d389e5",yellow:"#c4ac62",yellowBright:"#d9c074",red:"#b45648",redBright:"#cf6a5a",white:"#dee5eb",whiteBright:"#f3f5f5",gray:Wa,grey:Wa},AD={claude:hn.green,codex:hn.cyan,cursor:hn.magenta,copilot:hn.white,pi:hn.blue,opencode:hn.yellow,antigravity:hn.red,gemini:hn.greenBright,grok:hn.yellowBright};function MD(e){return e?e.startsWith("#")?e:hn[e]??Wa:Wa}const X$=MD;function Z$(e){return AD[e]??Wa}const wx=["#00d7ff","#00d787","#e6b450","#d75f87","#5f87ff","#af87ff","#5fd7a7","#ff8787","#d7af5f","#87d7ff","#d787d7","#9ee493","#ffb454","#7aa2f7","#bb9af7"],kx=new Map;function LD(e){const t=kx.get(e);if(t)return t;let n=0;for(let i=0;i<e.length;i++)n=n*31+e.charCodeAt(i)>>>0;const o=wx[n%wx.length];return kx.set(e,o),o}const e6={input:hn.blue,output:hn.green,cacheCreate:hn.yellow,cacheRead:hn.cyan};function Ex(e){return e.replace(/^claude-/,"").replace(/^gpt-/,"gpt-").replace(/-\d{8}$/,"").replace(/-latest$/,"")}const _x=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function t6(e,t={}){if(!Number.isFinite(e))return"$0.00";const n=t.sign&&e>0?"+":"",o=Math.abs(e);if(o>=1e5)return`${n}$${(e/1e3).toFixed(0)}k`;if(o>=1e4)return`${n}$${(e/1e3).toFixed(1)}k`;if(o>=1){const i=e<0?"-":"";return`${n}${i}$${o.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}return o>=.01?`${n}$${e.toFixed(3)}`:o===0?"$0.00":`${n}$${e.toFixed(4)}`}function n6(e){if(!Number.isFinite(e))return"$0";const t=Math.abs(e);return t>=1e6?`$${(e/1e6).toFixed(1).replace(/\.0$/,"")}M`:t>=1e3?`$${(e/1e3).toFixed(1).replace(/\.0$/,"")}k`:t>=1?`$${Math.round(e)}`:t===0?"$0":`$${e.toFixed(2)}`}function r6(e){if(!Number.isFinite(e)||e===0)return"0";const t=Math.abs(e);return t>=1e9?`${(e/1e9).toFixed(2)}B`:t>=1e6?`${(e/1e6).toFixed(2)}M`:t>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}function s6(e){return Number.isFinite(e)?Math.round(e).toLocaleString("en-US"):"0"}function o6(e){if(!Number.isFinite(e))return"0";const t=Math.abs(e);return t>=1e6?`${(e/1e6).toFixed(1)}M`:t>=1e4?`${Math.round(e/1e3)}k`:Math.round(e).toLocaleString("en-US")}function i6(e,t=0){return Number.isFinite(e)?`${(e*100).toFixed(t)}%`:"0%"}function OD(e,t){const n=Math.max(0,Math.round((t-e)/1e3));if(n<2)return"just now";if(n<60)return`${n}s ago`;const o=Math.round(n/60);if(o<60)return`${o}m ago`;const i=Math.round(o/60);return i<24?`${i}h ago`:`${Math.round(i/24)}d ago`}function a6(e){const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(t)return`${_x[Number(t[2])-1]} ${Number(t[3])}`;const n=/^(\d{4})-(\d{2})$/.exec(e);return n?`${_x[Number(n[2])-1]} ${n[1]}`:e}function ND(e){if(!Number.isFinite(e)||e<=0)return null;const t=Math.max(1,Math.ceil(e/6e4));return{days:Math.floor(t/1440),hours:Math.floor(t%1440/60),minutes:t%60,totalMinutes:t}}function DD(e,t=Date.now()){const n=ND(new Date(e).getTime()-t);return n?n.days>0?`${n.days}d ${n.hours}h`:n.hours>0?`${n.hours}h ${n.minutes}m`:`${n.minutes}m`:"now"}function jD(e,t,n=Date.now(),o){const i=Date.parse(e);return Number.isFinite(i)?t==="relative"?DD(e,n):new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZone:o}).format(new Date(i)):e}function w_(e){return e.input+e.output+e.cacheCreate+e.cacheRead}const Tg=864e5,c6=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Cl=e=>{const[t,n,o]=e.split("-").map(Number);return Date.UTC(t,(n||1)-1,o||1)},bl=e=>new Date(e).toISOString().slice(0,10),$D=e=>{try{return new Intl.DateTimeFormat("en-CA",{timeZone:e||void 0,year:"numeric",month:"2-digit",day:"2-digit"}).format(new Date)}catch{return new Date().toISOString().slice(0,10)}},UD=e=>(new Date(e).getUTCDay()+6)%7,u6=e=>{const t=Cl(e);return bl(t-UD(t)*Tg)},BD={period:"6m"},Ag=[{key:"7d",label:"7 days",shortLabel:"7d"},{key:"30d",label:"30 days",shortLabel:"30d"},{key:"90d",label:"90 days",shortLabel:"90d"},{key:"mtd",label:"month to date",shortLabel:"MTD"},{key:"6m",label:"6 months",shortLabel:"6M"},{key:"all",label:"all time",shortLabel:"All"}];function k_(e){return e.providers.length?new Set(e.providers):null}function zD(e,t){const n=k_(t);return e.accounts.filter(o=>!(!o.hasUsage||t.account!=="all"&&o.id!==t.account||n&&!n.has(o.providerId)))}function Jm(e){var t,n,o,i,c,l,d,h,p;return!!(e.hasBilling&&((n=(t=e.billing)==null?void 0:t.metrics)!=null&&n.length||(o=e.billing)!=null&&o.plan||(i=e.billing)!=null&&i.error||(d=(l=(c=e.billing)==null?void 0:c.activity)==null?void 0:l.series)!=null&&d.length||(p=(h=e.billing)==null?void 0:h.modelSpend)!=null&&p.length))}function VD(e,t){const n=k_(t);return e.accounts.filter(o=>!(!o.hasUsage&&!Jm(o)||t.account!=="all"&&o.id!==t.account||n&&!n.has(o.providerId)))}function qD(e){var n;let t=null;for(const o of e)for(const i of((n=o.table)==null?void 0:n.daily)??[])(!t||i.label>t)&&(t=i.label);return t}function E_(e,t,n){if(!t||e==="all")return null;if(e==="mtd")return $D(n).slice(0,7)+"-01";if(e==="6m"){const i=new Date(Cl(t)),c=i.getUTCMonth()-6,l=i.getUTCFullYear()+Math.floor(c/12),d=(c%12+12)%12,h=new Date(Date.UTC(l,d+1,0)).getUTCDate();return bl(Date.UTC(l,d,Math.min(i.getUTCDate(),h)))}const o=e==="7d"?7:e==="90d"?90:30;return bl(Cl(t)-(o-1)*Tg)}function l6(e,t,n,o){if(!n||e==="all")return null;const i=E_(e,n,o);if(t==="daily")return i;const c=t==="monthly"?365:84,l=bl(Cl(n)-(c-1)*Tg);return i&&i<l?i:l}function WD(e,t){const n=KF(e,t);return n.toLocaleLowerCase()===t.toLocaleLowerCase()?t:`${t} · ${n}`}const HD=()=>({cost:0,tokens:0,cacheSavings:0,calls:0}),KD=(e,t,n,o,i)=>{e.cost+=t,e.tokens+=n,e.cacheSavings+=o,e.calls+=i};function QD(){return{totals:HD(),burnRate:0,timelineMap:new Map,cacheByDay:new Map,provAgg:new Map,modelAgg:new Map,modelTrend:new Map,modelOptionSet:new Set,tokenComposition:{input:0,output:0,cacheCreate:0,cacheRead:0}}}function JD(e,t,n,o,i){let c=0,l=0,d=0,h=0;for(const g of t.breakdown){if(e.modelOptionSet.add(g.name),i&&!i.has(g.name))continue;const v=w_(g);c+=g.cost,l+=v,d+=g.cacheSavings,h+=g.count,e.tokenComposition.input+=g.input,e.tokenComposition.output+=g.output,e.tokenComposition.cacheCreate+=g.cacheCreate,e.tokenComposition.cacheRead+=g.cacheRead;const w=e.modelAgg.get(g.name)??{cost:0,tokens:0,cacheSavings:0,calls:0};w.cost+=g.cost,w.tokens+=v,w.cacheSavings+=g.cacheSavings,w.calls+=g.count,e.modelAgg.set(g.name,w);let S=e.modelTrend.get(g.name);S||(S=new Map,e.modelTrend.set(g.name,S)),S.set(t.label,(S.get(t.label)??0)+g.cost)}if(i&&h===0&&c===0)return;KD(e.totals,c,l,d,h);const p=e.timelineMap.get(t.label)??{date:t.label,total:0,tokens:0,byProvider:{}};p.total+=c,p.tokens+=l,p.byProvider[n]=(p.byProvider[n]??0)+c,e.timelineMap.set(t.label,p),e.cacheByDay.set(t.label,(e.cacheByDay.get(t.label)??0)+d);const y=e.provAgg.get(n)??{id:n,name:n,color:o,cost:0,tokens:0,calls:0};y.cost+=c,y.tokens+=l,y.calls+=h,e.provAgg.set(n,y)}function GD(e){return[...e.timelineMap.values()].sort((t,n)=>t.date.localeCompare(n.date))}function YD(e,t,n){const o=t.map(i=>i.date);return[...e.modelAgg.entries()].map(([i,c])=>{const l=e.modelTrend.get(i);return{model:i,color:LD(i),cost:c.cost,tokens:c.tokens,cacheSavings:c.cacheSavings,calls:c.calls,share:n>0?c.cost/n:0,tokenShare:e.totals.tokens>0?c.tokens/e.totals.tokens:0,callShare:e.totals.calls>0?c.calls/e.totals.calls:0,trend:o.map(d=>(l==null?void 0:l.get(d))??0)}}).sort((i,c)=>c.cost-i.cost)}function XD(e,t){var _,O,C;const n=e?zD(e,t):[],o=qD(n),i=E_(t.period,o,(e==null?void 0:e.tz)??""),c=t.models.length?new Set(t.models):null,l=new Map,d=new Map;for(const D of(e==null?void 0:e.providers)??[])l.set(D.id,D.color),d.set(D.id,D.name);const h=QD(),p=D=>!i||D>=i;for(const D of n){h.burnRate+=((_=D.dashboard)==null?void 0:_.burnRate)??0;const T=D.providerId,L=l.get(T)??D.color;for(const $ of((O=D.table)==null?void 0:O.daily)??[])p($.label)&&JD(h,$,T,L,c)}for(const D of h.provAgg.values()){const T=d.get(D.id);T&&(D.name=T)}const y=GD(h);let g=0;const v=y.map(D=>(g+=D.total,{date:D.date,total:g})),w=y.map(D=>({date:D.date,value:h.cacheByDay.get(D.date)??0})),S=new Map;for(const D of n)for(const T of((C=D.table)==null?void 0:C.daily)??[]){if(!p(T.label))continue;const L=c?T.breakdown.filter(q=>c.has(q.name)):T.breakdown;if(c&&L.length===0)continue;let $=S.get(T.label);$||($={tokens:0,calls:0,cacheSavings:0,models:new Map},S.set(T.label,$));for(const q of L)$.tokens+=w_(q),$.calls+=q.count,$.cacheSavings+=q.cacheSavings,$.models.set(q.name,($.models.get(q.name)??0)+q.cost)}const E=y.map(D=>{const T=S.get(D.date);return{date:D.date,cost:D.total,tokens:(T==null?void 0:T.tokens)??0,calls:(T==null?void 0:T.calls)??0,cacheSavings:(T==null?void 0:T.cacheSavings)??0,models:T?[...T.models.entries()].map(([L,$])=>({name:L,cost:$})).sort((L,$)=>$.cost-L.cost):[]}}),P=[...h.provAgg.values()].sort((D,T)=>T.cost-D.cost),H=YD(h,y,h.totals.cost);return{filteredAccounts:n,totals:h.totals,burnRate:h.burnRate,timeline:y,cumulative:v,cacheSavingsSeries:w,calendar:E,cardAccounts:e?VD(e,t):[],byProvider:P,byModel:H,tokenComposition:h.tokenComposition,modelOptions:[...h.modelOptionSet].sort(),latestDay:o,rangeStart:i}}function $t({children:e,className:t="size-4",...n}){return F.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round",className:t,"aria-hidden":!0,...n,children:e})}const f6=e=>F.jsxs($t,{...e,children:[F.jsx("path",{d:"M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"}),F.jsx("circle",{cx:"12",cy:"13",r:"4"})]}),d6=e=>F.jsx($t,{...e,children:F.jsx("path",{d:"M20 6 9 17l-5-5"})}),h6=e=>F.jsxs($t,{...e,children:[F.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),F.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),m6=e=>F.jsxs($t,{...e,children:[F.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),F.jsx("path",{d:"m7 10 5 5 5-5"}),F.jsx("path",{d:"M12 15V3"})]}),p6=e=>F.jsx($t,{...e,children:F.jsx("path",{d:"M3 6.5A2.5 2.5 0 0 1 5.5 4H9l2 2h7.5A2.5 2.5 0 0 1 21 8.5v8A2.5 2.5 0 0 1 18.5 19h-13A2.5 2.5 0 0 1 3 16.5z"})}),ZD=e=>F.jsxs($t,{...e,children:[F.jsx("path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"}),F.jsx("path",{d:"m16 6-4-4-4 4"}),F.jsx("path",{d:"M12 2v13"})]}),e4=e=>F.jsx($t,{...e,children:F.jsx("path",{d:"m6 9 6 6 6-6"})}),g6=e=>F.jsxs($t,{...e,children:[F.jsx("circle",{cx:"11",cy:"11",r:"8"}),F.jsx("path",{d:"m21 21-4.3-4.3"})]}),t4=e=>F.jsxs($t,{...e,children:[F.jsx("path",{d:"M18 6 6 18"}),F.jsx("path",{d:"m6 6 12 12"})]}),n4=e=>F.jsxs($t,{...e,children:[F.jsx("circle",{cx:"12",cy:"12",r:"4"}),F.jsx("path",{d:"M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"})]}),r4=e=>F.jsx($t,{...e,children:F.jsx("path",{d:"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"})}),s4=e=>F.jsxs($t,{...e,children:[F.jsx("circle",{cx:"12",cy:"12",r:"3"}),F.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),o4=e=>F.jsxs($t,{...e,children:[F.jsx("path",{d:"M20 6v5h-5"}),F.jsx("path",{d:"M4 18v-5h5"}),F.jsx("path",{d:"M18.7 9A7 7 0 0 0 6.3 6.3L4 8"}),F.jsx("path",{d:"M5.3 15A7 7 0 0 0 17.7 17.7L20 16"})]}),y6=e=>F.jsx($t,{...e,children:F.jsx("path",{d:"M12 5v14M5 12h14"})}),v6=e=>F.jsx($t,{...e,children:F.jsx("path",{d:"M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m3 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"})}),S6=e=>F.jsxs($t,{...e,children:[F.jsx("path",{d:"M12 20h9"}),F.jsx("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4z"})]}),x6=e=>F.jsx($t,{...e,children:F.jsx("path",{d:"m18 15-6-6-6 6"})}),kr="focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent",Wh=["▁","▂","▃","▄","▅","▆","▇","█"];function w6({data:e,color:t="var(--color-accent)",className:n=""}){const o=Wh.length-1,i=Math.max(...e,0),c=Math.min(...e,0),l=i>0&&c===i;return F.jsx("span",{className:`font-mono leading-none ${n}`,style:{color:t},"aria-hidden":!0,children:e.length===0?"·":l?Wh[Math.floor(o/2)].repeat(e.length):e.map(d=>Wh[i<=0?0:Math.max(0,Math.min(o,Math.floor(d/i*(o+.999))))]).join("")})}function k6({label:e,value:t,sub:n,valueClass:o="text-fg-bright"}){return F.jsxs("div",{children:[F.jsx("div",{className:"font-display text-[10px] uppercase tracking-wide text-fg-faint",children:e}),F.jsx("div",{className:`tnum mt-1 text-xl ${o}`,children:t}),n!=null&&F.jsx("div",{className:"mt-0.5 text-xs text-fg-dim",children:n})]})}function E6({children:e}){return F.jsx("div",{className:"flex h-full min-h-24 items-center justify-center text-center text-xs text-fg-faint",children:e})}function i4(e,t){return t?u1(e):e}function Cx({value:e,privacyMode:t,className:n,title:o}){const[i,c]=Y.useState(!1);return!(t&&UF(e))||i?F.jsx("span",{className:n,title:o??e,children:e}):F.jsx("button",{type:"button",onClick:()=>c(!0),className:`min-w-0 cursor-pointer truncate rounded text-left ${kr} ${n??""}`,title:"Click to reveal email","aria-label":"Email hidden. Click to reveal.",children:F.jsx("span",{className:"inline-block max-w-full truncate blur-sm transition hover:blur-[2px]",children:u1(e)})})}function a4({options:e,value:t,onChange:n,size:o="sm",btnClassName:i,containerClassName:c,ariaLabel:l}){const d="flex items-center overflow-hidden rounded border border-line",h=o==="xs"?"px-1.5 py-0.5 text-[10px] transition max-sm:py-1.5":"px-2 py-1 text-xs transition max-sm:py-2",p=o==="xs"?"bg-bg-3 text-accent":"bg-bg-2 text-accent",y=o==="xs"?"text-fg-faint hover:text-fg":"text-fg-dim hover:text-fg";return F.jsx("div",{className:c??d,role:"radiogroup","aria-label":l,children:e.map(g=>F.jsx("button",{type:"button",role:"radio","aria-checked":t===g.value,onClick:()=>n(g.value),className:`${i??h} ${kr} ${t===g.value?p:y}`,children:g.label},String(g.value)))})}function bx({label:e,value:t,children:n}){const[o,i]=Y.useState(!1),c=Y.useRef(null),l=Y.useRef(null),d=Y.useRef(null),h=Y.useId(),p=(g=!1)=>{i(!1),g&&requestAnimationFrame(()=>{var v;return(v=l.current)==null?void 0:v.focus()})};Y.useEffect(()=>{if(!o)return;const g=v=>{c.current&&!c.current.contains(v.target)&&p()};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[o]);const y=g=>{var E;const v=Array.from(((E=d.current)==null?void 0:E.querySelectorAll('[role="menuitem"]:not([disabled])'))??[]),w=v.indexOf(document.activeElement);let S=null;if(g.key==="Escape"){g.preventDefault(),p(!0);return}g.key==="Home"&&(S=0),g.key==="End"&&(S=v.length-1),g.key==="ArrowDown"&&(S=w<0?0:(w+1)%v.length),g.key==="ArrowUp"&&(S=w<0?v.length-1:(w-1+v.length)%v.length),S!==null&&v[S]&&(g.preventDefault(),v[S].focus())};return F.jsxs("div",{ref:c,className:"relative",children:[F.jsxs("button",{ref:l,type:"button","aria-haspopup":"menu","aria-expanded":o,"aria-controls":o?h:void 0,onClick:()=>i(g=>!g),onKeyDown:g=>{g.key!=="ArrowDown"&&g.key!=="ArrowUp"||(g.preventDefault(),i(!0),requestAnimationFrame(()=>{var w,S;const v=(w=d.current)==null?void 0:w.querySelectorAll('[role="menuitem"]:not([disabled])');(S=v==null?void 0:v[g.key==="ArrowDown"?0:v.length-1])==null||S.focus()}))},className:`flex items-center gap-1.5 rounded border border-line bg-bg-1 px-2 py-1 text-xs text-fg-dim transition hover:border-line-2 hover:text-fg max-sm:py-2 ${kr}`,children:[F.jsxs("span",{className:"text-fg-faint",children:[e,":"]}),F.jsx("span",{className:"text-fg",children:t}),F.jsx(e4,{className:`size-3 transition ${o?"rotate-180":""}`})]}),o&&F.jsx("div",{id:h,ref:d,role:"menu",onKeyDown:y,className:"absolute right-0 z-50 mt-1 min-w-44 max-w-[calc(100vw-2.5rem)] rounded-md border border-line-2 bg-bg-2 p-1 shadow-xl",children:n(()=>p(!0))})]})}function Px({children:e}){return F.jsx("div",{className:"flex flex-col",children:e})}function Ru({active:e,onClick:t,children:n}){return F.jsx("button",{type:"button",role:"menuitem",onClick:t,className:`flex min-w-0 items-center gap-2 rounded px-2 py-1 text-left text-xs transition ${kr} ${e?"bg-bg-3 text-fg-bright":"text-fg-dim hover:bg-bg-3 hover:text-fg"}`,children:n})}function c4({snapshot:e,derived:t,filters:n,setFilters:o,privacyMode:i=!0}){const c=(e==null?void 0:e.providers)??[],d=((e==null?void 0:e.accounts)??[]).filter(_=>_.hasUsage),h=new Set(d.map(_=>_.providerId)),p=c.filter(_=>h.has(_.id)),y=new Set(t.cardAccounts.map(_=>_.providerId)),g=c.filter(_=>!h.has(_.id)&&y.has(_.id)),v=n.providers.length?d.filter(_=>n.providers.includes(_.providerId)):d,w=_=>{var O;return((O=c.find(C=>C.id===_))==null?void 0:O.name)??_},S=_=>WD(_,w(_.providerId)),E=d.find(_=>_.id===n.account),P=_=>o(O=>{const C=O.providers.includes(_);return{...O,providers:C?O.providers.filter(D=>D!==_):[...O.providers,_]}}),H=n.providers.length>0||n.models.length>0||n.account!=="all";return F.jsx("div",{className:"border-t border-line bg-bg-0/70",children:F.jsxs("div",{className:"mx-auto flex max-w-[1600px] flex-wrap items-center gap-x-4 gap-y-2 px-5 py-2.5 2xl:max-w-[1920px]",children:[F.jsx("span",{className:"hidden text-xs text-fg-faint sm:inline",children:"filter:"}),F.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[p.map(_=>{const O=n.providers.includes(_.id),C=n.providers.length>0&&!O;return F.jsxs("button",{type:"button","aria-pressed":O,onClick:()=>P(_.id),className:`flex items-center gap-1.5 rounded border px-2 py-0.5 text-xs transition max-sm:py-1.5 ${kr}`,style:{borderColor:O?_.color:"var(--color-line)",color:C?"var(--color-fg-faint)":O?_.color:"var(--color-fg-dim)",background:O?"var(--color-bg-2)":"transparent"},title:O?`hide ${_.name}`:n.providers.length?`add ${_.name}`:`show only ${_.name}`,children:[F.jsx("span",{style:{color:_.color,opacity:C?.4:1},"aria-hidden":!0,children:O?"●":"○"}),_.name]},_.id)}),g.length>0&&F.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-fg-faint",title:"Billing-only providers — shown as cards with plan & quota; no usage timeline to filter",children:[p.length>0&&F.jsx("span",{className:"text-line-2",children:"|"}),F.jsx("span",{children:"billing-only:"}),g.map(_=>F.jsxs("span",{className:"flex items-center gap-1 text-fg-dim",children:[F.jsx("span",{style:{color:_.color,opacity:.55},"aria-hidden":!0,children:"·"}),_.name]},_.id))]})]}),F.jsxs("div",{className:"flex w-full flex-wrap items-center gap-2 md:ml-auto md:w-auto",children:[v.length>1?F.jsx(bx,{label:"account",value:n.account==="all"?"all":E?i4(S(E),i):"all",children:_=>F.jsxs(Px,{children:[F.jsx(Ru,{active:n.account==="all",onClick:()=>{o(O=>({...O,account:"all"})),_()},children:"All accounts"}),F.jsx("div",{className:"my-1 h-px bg-line"}),F.jsx("div",{className:"max-h-64 overflow-y-auto",children:v.map(O=>F.jsxs(Ru,{active:n.account===O.id,onClick:()=>{o(C=>({...C,account:O.id})),_()},children:[F.jsx("span",{style:{color:O.color},"aria-hidden":!0,children:"●"})," ",F.jsx(Cx,{value:S(O),privacyMode:i,className:"truncate"})]},O.id))})]})}):v.length===1?F.jsxs("span",{className:"rounded border border-line bg-bg-1 px-2 py-1 text-xs text-fg-dim",children:["account: ",F.jsx(Cx,{value:S(v[0]),privacyMode:i,className:"text-fg"})]}):null,F.jsx(bx,{label:"model",value:n.models.length===0?"all":n.models.length===1?Ex(n.models[0]):`${n.models.length} models`,children:()=>F.jsxs(Px,{children:[F.jsx(Ru,{active:n.models.length===0,onClick:()=>o(_=>({..._,models:[]})),children:"All models"}),F.jsx("div",{className:"my-1 h-px bg-line"}),F.jsxs("div",{className:"max-h-64 overflow-y-auto",children:[t.modelOptions.length===0&&F.jsx("div",{className:"px-2 py-1 text-xs text-fg-faint",children:"no models in range"}),t.modelOptions.map(_=>{const O=n.models.includes(_);return F.jsxs(Ru,{active:O,onClick:()=>o(C=>({...C,models:O?C.models.filter(D=>D!==_):[...C.models,_]})),children:[F.jsx("span",{className:O?"text-accent":"text-fg-faint","aria-hidden":!0,children:O?"◉":"○"})," ",Ex(_)]},_)})]})]})}),F.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[F.jsx("span",{className:"text-xs text-fg-faint",children:"range:"}),F.jsx(a4,{options:Ag.map(_=>({value:_.key,label:_.shortLabel})),value:n.period,onChange:_=>o(O=>({...O,period:_})),size:"sm",ariaLabel:"time range"})]}),H&&F.jsxs("button",{type:"button",onClick:()=>o(_=>({..._,providers:[],models:[],account:"all"})),className:`flex items-center gap-1 rounded border border-line bg-bg-1 px-2 py-1 text-xs text-fg-faint transition hover:border-line-2 hover:text-fg ${kr}`,title:"Clear provider, model & account filters","aria-label":"Clear provider, model and account filters",children:[F.jsx(t4,{className:"size-3","aria-hidden":!0})," clear"]})]})]})})}const u4=Y.lazy(()=>yr(()=>import("./share-sheet-CXdyA1ga.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(e=>({default:e.ShareSheet}))),__=Y.createContext(null),l4=()=>{const e=Y.useContext(__);if(!e)throw new Error("useShare must be used inside ShareProvider");return e};function f4({children:e}){const[t,n]=Y.useState(null);return F.jsxs(__.Provider,{value:n,children:[e,t?F.jsx(Y.Suspense,{fallback:F.jsx("div",{className:"fixed inset-0 z-[60] grid place-items-center bg-bg-0/70 text-sm text-fg-dim",role:"status","aria-live":"polite",children:"Preparing share preview…"}),children:F.jsx(u4,{source:t,onClose:()=>n(null)})}):null]})}function d4({derived:e,periodLabel:t,tz:n,version:o}){const i=l4();return F.jsxs("button",{type:"button",onClick:()=>i({kind:"summary",derived:e,periodLabel:t,tz:n,version:o}),className:`flex items-center gap-1.5 rounded border border-line bg-bg-1 px-2.5 py-1 text-xs text-fg-dim transition hover:border-accent/60 hover:text-accent active:scale-[0.97] max-sm:py-2 ${kr}`,title:"Create a shareable image",children:[F.jsx(ZD,{className:"size-3.5"}),F.jsx("span",{children:"share"})]})}const Fx=[{key:"overview",label:"overview"},{key:"analytics",label:"analytics"},{key:"models",label:"models"},{key:"explore",label:"explore"}];function h4(e=1e3){const[t,n]=Y.useState(()=>Date.now());return Y.useEffect(()=>{const o=setInterval(()=>n(Date.now()),e);return()=>clearInterval(o)},[e]),t}function m4({mode:e,resolvedMode:t,disabled:n,onToggle:o}){const i=e==="auto"?"light":e==="light"?"dark":"auto";return F.jsxs("button",{type:"button",onClick:o,disabled:n,title:`Theme: ${e}${e==="auto"?` (${t})`:""}. Switch to ${i}`,"aria-label":`Theme mode ${e}${e==="auto"?`, currently ${t}`:""}; switch to ${i}`,className:`relative rounded border border-line bg-bg-1 p-1.5 text-fg-dim transition hover:border-line-2 hover:text-fg disabled:opacity-40 max-sm:p-2.5 ${kr}`,children:[t==="dark"?F.jsx(n4,{className:"size-3.5"}):F.jsx(r4,{className:"size-3.5"}),e==="auto"&&F.jsx("span",{className:"absolute -right-1 -top-1 text-[8px] font-bold text-accent","aria-hidden":!0,children:"A"})]})}function p4({conn:e,freshAt:t}){const n=h4(),o=e==="live"?"var(--color-ok)":e==="error"?"var(--color-critical)":"var(--color-warning)",i=t?OD(t,n):null,c=e==="live"?i??"live":e==="connecting"?"connecting…":e==="reconnecting"?i?`reconnecting · ${i}`:"reconnecting…":i?`offline · ${i}`:"offline";return F.jsxs("span",{className:"flex items-center gap-1.5 text-xs",role:"status","aria-live":"polite",children:[F.jsxs("span",{className:"relative flex size-2","aria-hidden":!0,children:[e==="live"&&F.jsx("span",{className:"absolute inline-flex size-full animate-ping rounded-full opacity-60",style:{background:o}}),F.jsx("span",{className:"relative inline-flex size-2 rounded-full",style:{background:o}})]}),F.jsx("span",{className:"inline-block truncate text-fg-dim max-sm:max-w-[7rem]",children:c})]})}function Hh({label:e}){return F.jsxs("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-2 text-sm text-fg-dim",role:"status","aria-live":"polite",children:[F.jsxs("span",{className:"font-display text-lg text-fg-dim","aria-hidden":!0,children:["tokmon",F.jsx("span",{className:"cursor-blink text-accent",children:"▋"})]}),F.jsx("span",{className:"text-fg-faint",children:e})]})}function Kh(e,t){return e==="error"||e==="reconnecting"?"Connection lost — waiting for the local tokmon daemon…":t}function g4(){const e=document.getElementById("dashboard-content");e&&(e.scrollIntoView({block:"start"}),requestAnimationFrame(()=>e.focus({preventScroll:!0})))}function y4({onOpen:e}){return F.jsx("button",{type:"button",onClick:e,title:"Settings","aria-label":"Open settings",className:`rounded border border-line bg-bg-1 p-1.5 text-fg-dim transition hover:border-line-2 hover:text-fg max-sm:p-2.5 ${kr}`,children:F.jsx(s4,{className:"size-3.5"})})}function v4({phase:e,onRefresh:t}){const n=e==="refreshing"?"refreshing…":e==="success"?"updated":e==="error"?"refresh failed":"refresh";return F.jsxs("button",{type:"button",onClick:t,disabled:e==="refreshing",title:"Refresh all data (R)","aria-label":"Refresh all data",className:`flex items-center gap-1.5 rounded border border-line bg-bg-1 px-2 py-1.5 text-xs text-fg-dim transition hover:border-line-2 hover:text-fg disabled:cursor-wait ${kr}`,children:[F.jsx(o4,{className:`size-3.5 ${e==="refreshing"?"animate-spin motion-reduce:animate-none":""}`}),F.jsx("span",{className:e==="error"?"text-critical":"",children:n})]})}function S4({peak:e,resetDisplay:t,tz:n}){const o=e.state==="peak"?"var(--color-warning)":"var(--color-positive)",i=e.changesAt??(e.minutesUntilChange!=null?new Date(Date.now()+e.minutesUntilChange*6e4).toISOString():null);return F.jsxs("span",{className:"hidden items-center gap-1 text-xs text-fg-dim lg:flex",children:[F.jsx("span",{"aria-hidden":!0,style:{color:o},children:"●"}),F.jsx("span",{style:{color:o},children:e.label}),i&&F.jsxs("span",{className:"tnum text-fg-faint",children:["(",jD(i,t,Date.now(),n),")"]})]})}function x4(e,t){const n=e.providers.filter(c=>t.providers.has(c)),o=e.account==="all"||t.accounts.has(e.account)?e.account:"all",i=t.modelsReady?e.models.filter(c=>t.models.has(c)):e.models;return n.length===e.providers.length&&i.length===e.models.length&&o===e.account?e:{...e,providers:n,account:o,models:i}}function Mg(e,t,n){try{return e(t)}catch(o){return r2("[nuqs] Error while parsing value `%s`: %O"+(n?" (for key `%s`)":""),t,o,n),null}}function ur(e){function t(n){if(typeof n>"u")return null;let o="";if(Array.isArray(n)){if(n[0]===void 0)return null;o=n[0]}return typeof n=="string"&&(o=n),Mg(e.parse,o)}return{type:"single",eq:(n,o)=>n===o,...e,parseServerSide:t,withDefault(n){return{...this,defaultValue:n,parseServerSide(o){return t(o)??n}}},withOptions(n){return{...this,...n}}}}const Qh=ur({parse:e=>e,serialize:String});ur({parse:e=>{const t=parseInt(e);return t==t?t:null},serialize:e=>""+Math.round(e)});ur({parse:e=>{const t=parseInt(e);return t==t?t-1:null},serialize:e=>""+Math.round(e+1)});ur({parse:e=>{const t=parseInt(e,16);return t==t?t:null},serialize:e=>{const t=Math.round(e).toString(16);return(t.length&1?"0":"")+t}});ur({parse:e=>{const t=parseFloat(e);return t==t?t:null},serialize:String});ur({parse:e=>e.toLowerCase()==="true",serialize:String});function Lg(e,t){return e.valueOf()===t.valueOf()}ur({parse:e=>{const t=parseInt(e);return t==t?new Date(t):null},serialize:e=>""+e.valueOf(),eq:Lg});ur({parse:e=>{const t=new Date(e);return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString(),eq:Lg});ur({parse:e=>{const t=new Date(e.slice(0,10));return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString().slice(0,10),eq:Lg});function w4(e){return k4(e)}function k4(e){return ur({parse:t=>{const n=t;return e.includes(n)?n:null},serialize:String})}function Ix(e,t=","){const n=e.eq??((i,c)=>i===c),o=encodeURIComponent(t);return ur({parse:i=>i===""?[]:i.split(t).map((c,l)=>Mg(e.parse,c.replaceAll(o,t),`[${l}]`)).filter(c=>c!=null),serialize:i=>i.map(c=>(e.serialize?e.serialize(c):String(c)).replaceAll(t,o)).join(t),eq(i,c){return i===c?!0:i.length!==c.length?!1:i.every((l,d)=>n(l,c[d]))}})}const Jh=lp(),E4={};function _4(e,t={}){const n=Y.useId(),o=f2(),i=d2(),{history:c="replace",scroll:l=(o==null?void 0:o.scroll)??!1,shallow:d=(o==null?void 0:o.shallow)??!0,throttleMs:h=Ea.timeMs,limitUrlUpdates:p=o==null?void 0:o.limitUrlUpdates,clearOnDefault:y=(o==null?void 0:o.clearOnDefault)??!0,startTransition:g,urlKeys:v=E4}=t,w=Object.keys(e).join(","),S=Y.useMemo(()=>Object.fromEntries(Object.keys(e).map($=>[$,v[$]??$])),[w,JSON.stringify(v)]),E=l2(Object.values(S)),P=E.searchParams,H=Y.useRef({}),_=Y.useMemo(()=>Object.fromEntries(Object.keys(e).map($=>[$,e[$].defaultValue??null])),[Object.values(e).map(({defaultValue:$})=>$).join(",")]),O=ph.useQueuedQueries(Object.values(S)),[C,D]=Y.useState(()=>Gh(e,v,P??new URLSearchParams,O).state),T=Y.useRef(C);if(nt("[nuq+ %s `%s`] render - state: %O, iSP: %s",n,w,C,P),Object.keys(H.current).join("&")!==Object.values(S).join("&")){const{state:$,hasChanged:q}=Gh(e,v,P,O,H.current,T.current);q&&(nt("[nuq+ %s `%s`] State changed: %O",n,w,{state:$,initialSearchParams:P,queuedQueries:O,queryRef:H.current,stateRef:T.current}),T.current=$,D($)),H.current=Object.fromEntries(Object.entries(S).map(([ee,se])=>{var K;return[se,((K=e[ee])==null?void 0:K.type)==="multi"?P==null?void 0:P.getAll(se):(P==null?void 0:P.get(se))??null]}))}Y.useEffect(()=>{const{state:$,hasChanged:q}=Gh(e,v,P,O,H.current,T.current);q&&(nt("[nuq+ %s `%s`] State changed: %O",n,w,{state:$,initialSearchParams:P,queuedQueries:O,queryRef:H.current,stateRef:T.current}),T.current=$,D($))},[Object.values(S).map($=>`${$}=${P==null?void 0:P.getAll($)}`).join("&"),JSON.stringify(O)]),Y.useEffect(()=>{const $=Object.keys(e).reduce((q,ee)=>(q[ee]=({state:se,query:K})=>{D(k=>{const{defaultValue:U}=e[ee],V=S[ee],J=se??U??null,B=k[ee]??U??null;return Object.is(B,J)?(nt("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). no change, skipping, resolved: %O",n,w,V,se,U,T.current),k):(T.current={...T.current,[ee]:J},H.current[V]=K,nt("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). updateInternalState, resolved: %O",n,w,V,se,U,T.current),T.current)})},q),{});for(const q of Object.keys(e)){const ee=S[q];nt("[nuq+ %s `%s`] Subscribing to sync for `%s`",n,ee,w),Jh.on(ee,$[q])}return()=>{for(const q of Object.keys(e)){const ee=S[q];nt("[nuq+ %s `%s`] Unsubscribing to sync for `%s`",n,ee,w),Jh.off(ee,$[q])}}},[w,S]);const L=Y.useCallback(($,q={})=>{var B,X,ne,te,I,Z;const ee=Object.fromEntries(Object.keys(e).map(pe=>[pe,null])),se=typeof $=="function"?$(Rx(T.current,_))??ee:$??ee;nt("[nuq+ %s `%s`] setState: %O",n,w,se);let K,k=0,U=!1;const V=[];for(let[pe,me]of Object.entries(se)){const le=e[pe],Fe=S[pe];if(!le||me===void 0)continue;(q.clearOnDefault??le.clearOnDefault??y)&&me!==null&&le.defaultValue!==void 0&&(le.eq??((be,Ve)=>be===Ve))(me,le.defaultValue)&&(me=null);const fe=me===null?null:(le.serialize??String)(me);Jh.emit(Fe,{state:me,query:fe});const xe={key:Fe,query:fe,options:{history:q.history??le.history??c,shallow:q.shallow??le.shallow??d,scroll:q.scroll??le.scroll??l,startTransition:q.startTransition??le.startTransition??g}};if(((B=q==null?void 0:q.limitUrlUpdates)==null?void 0:B.method)==="debounce"||(p==null?void 0:p.method)==="debounce"||((X=le.limitUrlUpdates)==null?void 0:X.method)==="debounce"){xe.options.shallow===!0&&console.warn(Ja(422));const be=((ne=q==null?void 0:q.limitUrlUpdates)==null?void 0:ne.timeMs)??(p==null?void 0:p.timeMs)??((te=le.limitUrlUpdates)==null?void 0:te.timeMs)??Ea.timeMs,Ve=ph.push(xe,be,E,i);k<be&&(K=Ve,k=be)}else{const be=((I=q==null?void 0:q.limitUrlUpdates)==null?void 0:I.timeMs)??((Z=le==null?void 0:le.limitUrlUpdates)==null?void 0:Z.timeMs)??(p==null?void 0:p.timeMs)??q.throttleMs??le.throttleMs??h;V.push(ph.abort(Fe)),Nu.push(xe,be),U=!0}}const J=V.reduce((pe,me)=>me(pe),U?Nu.flush(E,i):Nu.getPendingPromise(E));return K??J},[w,c,d,l,h,p==null?void 0:p.method,p==null?void 0:p.timeMs,g,S,E.updateUrl,E.getSearchParamsSnapshot,E.rateLimitFactor,i,_]);return[Y.useMemo(()=>Rx(C,_),[C,_]),L]}function Gh(e,t,n,o,i,c){let l=!1;const d=Object.entries(e).reduce((h,[p,y])=>{const g=(t==null?void 0:t[p])??p,v=o[g],w=y.type==="multi"?[]:null,S=v===void 0?(y.type==="multi"?n==null?void 0:n.getAll(g):n==null?void 0:n.get(g))??w:v;return i&&c&&xw(i[g]??w,S)?(h[p]=c[p]??null,h):(l=!0,h[p]=(p2(S)?null:Mg(y.parse,S,g))??null,i&&(i[g]=S),h)},{});if(!l){const h=Object.keys(e),p=Object.keys(c??{});l=h.length!==p.length||h.some(y=>!p.includes(y))}return{state:d,hasChanged:l}}function Rx(e,t){return Object.fromEntries(Object.keys(e).map(n=>[n,e[n]??t[n]??null]))}function C4(){const[e,t]=_4({p:Ix(Qh).withDefault([]),m:Ix(Qh).withDefault([]),a:Qh.withDefault("all"),period:w4(Ag.map(i=>i.key)).withDefault(BD.period)},{history:"replace"}),n=Y.useMemo(()=>({providers:e.p,models:e.m,account:e.a,period:e.period}),[e.p,e.m,e.a,e.period]),o=Y.useCallback(i=>{t(c=>{const l={providers:c.p,models:c.m,account:c.a,period:c.period},d=typeof i=="function"?i(l):i;return{p:d.providers,m:d.models,a:d.account,period:d.period}})},[t]);return[n,o]}const Tx=Symbol.for("~effect/http/Headers"),Ha=Object.create(null);Object.defineProperties(Ha,{[Tx]:{value:Tx},[$l]:{value(e){return I4(this,ro(e,R4))}},toJSON:{value(){return Ul(this)}},[sn]:{value(e){return P4(this,e)}},[rn]:{value(){return Cp(this)}},toString:{value:xS.toString},[uo]:{value:xS[uo]}});const b4=e=>Object.assign(Object.create(Ha),e),P4=fR(SI()),Og=Object.create(Ha),F4=e=>{if(e===void 0)return Og;if(Symbol.iterator in e){const n=Object.create(Ha);for(const[o,i]of e)n[o.toLowerCase()]=i;return n}const t=Object.create(Ha);for(const[n,o]of Object.entries(e))Array.isArray(o)?t[n.toLowerCase()]=o.join(", "):o!==void 0&&(t[n.toLowerCase()]=o);return t},Ax=re(2,(e,t)=>{const n=b4(e);return Object.assign(n,t),n}),I4=re(2,(e,t)=>{const n={...e},o=i=>{if(typeof i=="string"){const c=i.toLowerCase();c in e&&(n[c]=GS(e[c]))}else for(const c in e)i.test(c)&&(n[c]=GS(e[c]))};if(Array.isArray(t))for(let i=0;i<t.length;i++)o(t[i]);else o(t);return n}),R4=rt("effect/Headers/CurrentRedactedNames",{defaultValue:()=>["authorization","cookie","set-cookie","x-api-key"]}),T4="~effect/http/HttpClientError";class Ng extends Wn(T4)({_tag:Sn("HttpError"),kind:Ze(["EncodeError","DecodeError","TransportError","InvalidUrlError","StatusCodeError","EmptyBodyError"]),cause:ki(cr)}){static fromHttpClientError(t){return new Ng({_tag:"HttpError",kind:t.reason._tag,cause:t.reason})}}const Mx="~effect/socket/Socket",Dg=qn("effect/socket/Socket"),A4=e=>Dg.of({[Mx]:Mx,runRaw:e.runRaw,run:e.run??((t,n)=>e.runRaw(o=>typeof o=="string"?t(M4.encode(o)):o instanceof Uint8Array?t(o):t(new Uint8Array(o)),n)),runString:e.runString??(e.run?(t,n)=>e.run(o=>t(Yh.decode(o)),n):(t,n)=>e.runRaw(o=>typeof o=="string"?t(o):o instanceof Uint8Array?t(Yh.decode(o)):t(Yh.decode(new Uint8Array(o))),n)),writer:e.writer}),M4=new TextEncoder,Yh=new TextDecoder,L4="~effect/socket/Socket/CloseEvent",O4=e=>Ue(e,L4),Ju="~effect/socket/Socket/SocketError",N4=e=>Ue(e,Ju);class C_ extends Wn("effect/socket/Socket/SocketReadError")({_tag:Sn("SocketReadError"),cause:cr}){constructor(){super(...arguments);M(this,"message","An error occurred during Read")}}class D4 extends Wn("effect/socket/Socket/SocketWriteError")({_tag:Sn("SocketWriteError"),cause:cr}){constructor(){super(...arguments);M(this,"message","An error occurred during Write")}}class Pl extends Wn("effect/socket/Socket/SocketOpenError")({_tag:Sn("SocketOpenError"),kind:Ze(["Unknown","Timeout"]),cause:cr}){get message(){return this.kind==="Timeout"?'timeout waiting for "open"':"An error occurred during Open"}}class Fl extends Wn("effect/socket/Socket/SocketCloseError")({_tag:Sn("SocketCloseError"),code:bg,closeReason:ki(de)}){static filterClean(t){return function(n){return ai.is(n)&&n.reason._tag==="SocketCloseError"&&t(n.reason.code)?qr(n.reason):rr(n)}}get message(){return this.closeReason?`${this.code}: ${this.closeReason}`:`${this.code}`}}const b_=nn([C_,D4,Pl,Fl]);var mw,pw;class ai extends(pw=yf(Ju)("SocketError",{_tag:Sn("SocketError"),reason:b_}),mw=Ju,pw){constructor(n){var t=(...B6)=>(super(...B6),M(this,mw,Ju),M(this,"message",this.reason.message),this);"cause"in n.reason?t({...n,cause:n.reason.cause}):t(n)}static is(n){return N4(n)}}const j4=e=>!0;class $4 extends qn()("~effect/socket/Socket/WebSocket"){}class P_ extends qn()("@effect/platform/Socket/WebSocketConstructor"){}const U4=og(P_)((e,t)=>new globalThis.WebSocket(e,t)),B4=(e,t)=>P_.use(n=>z4(uE((typeof e=="string"?lt(e):e).pipe(Rs(o=>n(o,t==null?void 0:t.protocols))),o=>Un(()=>o.close(1e3))),t)),z4=(e,t)=>dl(n=>{let o;const i=YE(!1),c=n.context,l=(t==null?void 0:t.closeCodeIsError)??j4,d=(y,g)=>FL(oo(function*(v){const w=yield*MN().pipe(ul(v)),S=yield*ul(e,v),E=yield*PL(DN(w)(),$4,S);let P=!1;function H(C){if(C.data instanceof Blob){const T=Rn(uL(()=>C.data.arrayBuffer()),L=>{const $=y(new Uint8Array(L));return ii($)?$:ht});return E(T)}const D=y(C.data);ii(D)&&E(D)}function _(C){S.removeEventListener("message",H),S.removeEventListener("close",O),ba(w.deferred,Je(new ai({reason:P?new C_({cause:C}):new Pl({kind:"Unknown",cause:C})})))}function O(C){const D=typeof C.code=="number"?C.code:1001;S.removeEventListener("message",H),S.removeEventListener("error",_),ba(w.deferred,Je(new ai({reason:new Fl({code:D,closeReason:C.reason})})))}if(S.addEventListener("close",O,{once:!0}),S.addEventListener("error",_,{once:!0}),S.addEventListener("message",H),S.readyState!==1){const C=Zp();S.addEventListener("open",()=>{P=!0,ba(C,ht)},{once:!0}),yield*eg(C).pipe(iE({duration:(t==null?void 0:t.openTimeout)??1e4,orElse:()=>Je(new ai({reason:new Pl({kind:"Timeout",cause:new Error('timeout waiting for "open"')})}))}),aE(yx(w)))}return P=!0,o=S,i.openUnsafe(),g!=null&&g.onOpen&&(yield*g.onOpen),yield*yL(yx(w),Fl.filterClean(C=>!l(C)),()=>ht)})).pipe(bL(v=>di(c,v)),lE(Un(()=>{i.closeUnsafe(),o=void 0}))),p=lt(y=>i.whenOpen(Un(()=>{const g=o;O4(y)?g.close(y.code,y.reason):g.send(y)})));return lt(A4({runRaw:d,writer:p}))}),V4=d1(B4,Rm(Dg));class F_ extends qn()("effect/workers/Transferable/Collector"){}const q4=()=>{let e=[];const t=i=>{e.push(...i)},n=()=>e,o=()=>{const i=e;return e=[],i};return F_.of({addAllUnsafe:t,addAll:i=>Un(()=>t(i)),readUnsafe:n,read:Un(n),clearUnsafe:o,clear:Un(o)})};class W4 extends Wn("effect/workers/WorkerError/WorkerSpawnError")({_tag:Sn("WorkerSpawnError"),message:de,cause:ki(cr)}){}class H4 extends Wn("effect/workers/WorkerError/WorkerSendError")({_tag:Sn("WorkerSendError"),message:de,cause:ki(cr)}){}class K4 extends Wn("effect/workers/WorkerError/WorkerReceiveError")({_tag:Sn("WorkerReceiveError"),message:de,cause:ki(cr)}){}class Q4 extends Wn("effect/workers/WorkerError/WorkerUnknownError")({_tag:Sn("WorkerUnknownError"),message:de,cause:ki(cr)}){}const J4=nn([W4,H4,K4,Q4]),Xh="~effect/rpc/RpcClientError";class Gm extends Wn("effect/rpc/RpcClientError/RpcClientDefect")({_tag:Sn("RpcClientDefect"),message:de,cause:cr}){}var gw,yw;class Ym extends(yw=Wn(Xh)({_tag:Sn("RpcClientError"),reason:nn([J4,b_,Ng,Gm])}),gw=Xh,yw){constructor(){super(...arguments);M(this,gw,Xh)}get message(){return`${this.reason._tag}: ${this.reason.message}`}}const Tu=e=>typeof e=="bigint"?e:BigInt(e),G4={_tag:"Ping"};var Xm;try{Xm=new TextDecoder}catch{}var ue,Sr,N=0,Qe={},Oe,ys,$n=0,gr=0,It,Vr,yn=[],Le,Lx={useRecords:!1,mapsAsObjects:!0};class I_{}const R_=new I_;R_.name="MessagePack 0xC1";var ws=!1,Ox=2,Y4;class Ka{constructor(t){t&&(t.useRecords===!1&&t.mapsAsObjects===void 0&&(t.mapsAsObjects=!0),t.sequential&&t.trusted!==!1&&(t.trusted=!0,!t.structures&&t.useRecords!=!1&&(t.structures=[],t.maxSharedStructures||(t.maxSharedStructures=0))),t.structures?t.structures.sharedLength=t.structures.length:t.getStructures&&((t.structures=[]).uninitialized=!0,t.structures.sharedLength=0),t.int64AsNumber&&(t.int64AsType="number")),Object.assign(this,t)}unpack(t,n){if(ue)return N_(()=>(ep(),this?this.unpack(t,n):Ka.prototype.unpack.call(Lx,t,n)));!t.buffer&&t.constructor===ArrayBuffer&&(t=typeof Buffer<"u"?Buffer.from(t):new Uint8Array(t)),typeof n=="object"?(Sr=n.end||t.length,N=n.start||0):(N=0,Sr=n>-1?n:t.length),gr=0,ys=null,It=null,ue=t;try{Le=t.dataView||(t.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength))}catch(o){throw ue=null,t instanceof Uint8Array?o:new Error("Source must be a Uint8Array or Buffer but was a "+(t&&typeof t=="object"?t.constructor.name:typeof t))}if(this instanceof Ka){if(Qe=this,this.structures)return Oe=this.structures,Au(n);(!Oe||Oe.length>0)&&(Oe=[])}else Qe=Lx,(!Oe||Oe.length>0)&&(Oe=[]);return Au(n)}unpackMultiple(t,n){let o,i=0;try{ws=!0;let c=t.length,l=this?this.unpack(t,c):vf.unpack(t,c);if(n){if(n(l,i,N)===!1)return;for(;N<c;)if(i=N,n(Au(),i,N)===!1)return}else{for(o=[l];N<c;)i=N,o.push(Au());return o}}catch(c){throw c.lastPosition=i,c.values=o,c}finally{ws=!1,ep()}}_mergeStructures(t,n){t=t||[],Object.isFrozen(t)&&(t=t.map(o=>o.slice(0)));for(let o=0,i=t.length;o<i;o++){let c=t[o];c&&(c.isShared=!0,o>=32&&(c.highByte=o-32>>5))}t.sharedLength=t.length;for(let o in n||[])if(o>=0){let i=t[o],c=n[o];c&&(i&&((t.restoreStructures||(t.restoreStructures=[]))[o]=i),t[o]=c)}return this.structures=t}decode(t,n){return this.unpack(t,n)}}function Au(e){try{if(!Qe.trusted&&!ws){let n=Oe.sharedLength||0;n<Oe.length&&(Oe.length=n)}let t;if(Qe.randomAccessStructure&&ue[N]<64&&ue[N]>=32&&Y4||(t=mt()),It&&(N=It.postBundlePosition,It=null),ws&&(Oe.restoreStructures=null),N==Sr)Oe&&Oe.restoreStructures&&Nx(),Oe=null,ue=null,Vr&&(Vr=null);else{if(N>Sr)throw new Error("Unexpected end of MessagePack data");if(!ws){let n;try{n=JSON.stringify(t,(o,i)=>typeof i=="bigint"?`${i}n`:i).slice(0,100)}catch(o){n="(JSON view not available "+o+")"}throw new Error("Data read, but end of buffer not reached "+n)}}return t}catch(t){throw Oe&&Oe.restoreStructures&&Nx(),ep(),(t instanceof RangeError||t.message.startsWith("Unexpected end of buffer")||N>Sr)&&(t.incomplete=!0),t}}function Nx(){for(let e in Oe.restoreStructures)Oe[e]=Oe.restoreStructures[e];Oe.restoreStructures=null}function mt(){let e=ue[N++];if(e<160)if(e<128){if(e<64)return e;{let t=Oe[e&63]||Qe.getStructures&&T_()[e&63];return t?(t.read||(t.read=jg(t,e&63)),t.read()):e}}else if(e<144)if(e-=128,Qe.mapsAsObjects){let t={};for(let n=0;n<e;n++){let o=M_();o==="__proto__"&&(o="__proto_"),t[o]=mt()}return t}else{let t=new Map;for(let n=0;n<e;n++)t.set(mt(),mt());return t}else{e-=144;let t=new Array(e);for(let n=0;n<e;n++)t[n]=mt();return Qe.freezeData?Object.freeze(t):t}else if(e<192){let t=e-160;if(gr>=N)return ys.slice(N-$n,(N+=t)-$n);if(gr==0&&Sr<140){let n=t<16?$g(t):A_(t);if(n!=null)return n}return Zm(t)}else{let t;switch(e){case 192:return null;case 193:return It?(t=mt(),t>0?It[1].slice(It.position1,It.position1+=t):It[0].slice(It.position0,It.position0-=t)):R_;case 194:return!1;case 195:return!0;case 196:if(t=ue[N++],t===void 0)throw new Error("Unexpected end of buffer");return Zh(t);case 197:return t=Le.getUint16(N),N+=2,Zh(t);case 198:return t=Le.getUint32(N),N+=4,Zh(t);case 199:return Ks(ue[N++]);case 200:return t=Le.getUint16(N),N+=2,Ks(t);case 201:return t=Le.getUint32(N),N+=4,Ks(t);case 202:if(t=Le.getFloat32(N),Qe.useFloat32>2){let n=Ug[(ue[N]&127)<<1|ue[N+1]>>7];return N+=4,(n*t+(t>0?.5:-.5)>>0)/n}return N+=4,t;case 203:return t=Le.getFloat64(N),N+=8,t;case 204:return ue[N++];case 205:return t=Le.getUint16(N),N+=2,t;case 206:return t=Le.getUint32(N),N+=4,t;case 207:return Qe.int64AsType==="number"?(t=Le.getUint32(N)*4294967296,t+=Le.getUint32(N+4)):Qe.int64AsType==="string"?t=Le.getBigUint64(N).toString():Qe.int64AsType==="auto"?(t=Le.getBigUint64(N),t<=BigInt(2)<<BigInt(52)&&(t=Number(t))):t=Le.getBigUint64(N),N+=8,t;case 208:return Le.getInt8(N++);case 209:return t=Le.getInt16(N),N+=2,t;case 210:return t=Le.getInt32(N),N+=4,t;case 211:return Qe.int64AsType==="number"?(t=Le.getInt32(N)*4294967296,t+=Le.getUint32(N+4)):Qe.int64AsType==="string"?t=Le.getBigInt64(N).toString():Qe.int64AsType==="auto"?(t=Le.getBigInt64(N),t>=BigInt(-2)<<BigInt(52)&&t<=BigInt(2)<<BigInt(52)&&(t=Number(t))):t=Le.getBigInt64(N),N+=8,t;case 212:if(t=ue[N++],t==114)return zx(ue[N++]&63);{let n=yn[t];if(n)return n.read?(N++,n.read(mt())):n.noBuffer?(N++,n()):n(ue.subarray(N,++N));throw new Error("Unknown extension "+t)}case 213:return t=ue[N],t==114?(N++,zx(ue[N++]&63,ue[N++])):Ks(2);case 214:return Ks(4);case 215:return Ks(8);case 216:return Ks(16);case 217:return t=ue[N++],gr>=N?ys.slice(N-$n,(N+=t)-$n):Z4(t);case 218:return t=Le.getUint16(N),N+=2,gr>=N?ys.slice(N-$n,(N+=t)-$n):ej(t);case 219:return t=Le.getUint32(N),N+=4,gr>=N?ys.slice(N-$n,(N+=t)-$n):tj(t);case 220:return t=Le.getUint16(N),N+=2,jx(t);case 221:return t=Le.getUint32(N),N+=4,jx(t);case 222:return t=Le.getUint16(N),N+=2,$x(t);case 223:return t=Le.getUint32(N),N+=4,$x(t);default:if(e>=224)return e-256;if(e===void 0){let n=new Error("Unexpected end of MessagePack data");throw n.incomplete=!0,n}throw new Error("Unknown MessagePack token "+e)}}}const X4=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function jg(e,t){function n(){if(n.count++>Ox){let i;try{i=e.read=new Function("r","return function(){return "+(Qe.freezeData?"Object.freeze":"")+"({"+e.map(c=>c==="__proto__"?"__proto_:r()":X4.test(c)?c+":r()":"["+JSON.stringify(c)+"]:r()").join(",")+"})}")(mt)}catch{return Ox=1/0,n()}return e.read0=i,e.highByte===0&&(e.read=Dx(t,e.read)),i()}let o={};for(let i=0,c=e.length;i<c;i++){let l=e[i];l==="__proto__"&&(l="__proto_"),o[l]=mt()}return Qe.freezeData?Object.freeze(o):o}return n.count=0,e.read0=n,e.highByte===0?Dx(t,n):n}const Dx=(e,t)=>function(){let n=ue[N++];if(n===0)return t();let o=e<32?-(e+(n<<5)):e+(n<<5),i=Oe[o]||T_()[o];if(!i)throw new Error("Record id is not defined for "+o);return i.read||(i.read=jg(i,e)),i.read()};function T_(){let e=N_(()=>(ue=null,Qe.getStructures()));return Oe=Qe._mergeStructures(e,Oe)}var Zm=hc,Z4=hc,ej=hc,tj=hc;function hc(e){let t;if(e<16&&(t=$g(e)))return t;if(e>64&&Xm)return Xm.decode(ue.subarray(N,N+=e));const n=N+e,o=[];for(t="";N<n;){const i=ue[N++];if((i&128)===0)o.push(i);else if((i&224)===192){const c=ue[N++]&63,l=(i&31)<<6|c;l<128?o.push(65533):o.push(l)}else if((i&240)===224){const c=ue[N++]&63,l=ue[N++]&63,d=(i&31)<<12|c<<6|l;d<2048||d>=55296&&d<=57343?o.push(65533):o.push(d)}else if((i&248)===240){const c=ue[N++]&63,l=ue[N++]&63,d=ue[N++]&63;let h=(i&7)<<18|c<<12|l<<6|d;h<65536||h>1114111?o.push(65533):(h>65535&&(h-=65536,o.push(h>>>10&1023|55296),h=56320|h&1023),o.push(h))}else o.push(65533);o.length>=4096&&(t+=Pt.apply(String,o),o.length=0)}return o.length>0&&(t+=Pt.apply(String,o)),t}function jx(e){let t=new Array(e);for(let n=0;n<e;n++)t[n]=mt();return Qe.freezeData?Object.freeze(t):t}function $x(e){if(Qe.mapsAsObjects){let t={};for(let n=0;n<e;n++){let o=M_();o==="__proto__"&&(o="__proto_"),t[o]=mt()}return t}else{let t=new Map;for(let n=0;n<e;n++)t.set(mt(),mt());return t}}var Pt=String.fromCharCode;function A_(e){let t=N,n=new Array(e);for(let o=0;o<e;o++){const i=ue[N++];if((i&128)>0){N=t;return}n[o]=i}return Pt.apply(String,n)}function $g(e){if(e<4)if(e<2){if(e===0)return"";{let t=ue[N++];if((t&128)>1){N-=1;return}return Pt(t)}}else{let t=ue[N++],n=ue[N++];if((t&128)>0||(n&128)>0){N-=2;return}if(e<3)return Pt(t,n);let o=ue[N++];if((o&128)>0){N-=3;return}return Pt(t,n,o)}else{let t=ue[N++],n=ue[N++],o=ue[N++],i=ue[N++];if((t&128)>0||(n&128)>0||(o&128)>0||(i&128)>0){N-=4;return}if(e<6){if(e===4)return Pt(t,n,o,i);{let c=ue[N++];if((c&128)>0){N-=5;return}return Pt(t,n,o,i,c)}}else if(e<8){let c=ue[N++],l=ue[N++];if((c&128)>0||(l&128)>0){N-=6;return}if(e<7)return Pt(t,n,o,i,c,l);let d=ue[N++];if((d&128)>0){N-=7;return}return Pt(t,n,o,i,c,l,d)}else{let c=ue[N++],l=ue[N++],d=ue[N++],h=ue[N++];if((c&128)>0||(l&128)>0||(d&128)>0||(h&128)>0){N-=8;return}if(e<10){if(e===8)return Pt(t,n,o,i,c,l,d,h);{let p=ue[N++];if((p&128)>0){N-=9;return}return Pt(t,n,o,i,c,l,d,h,p)}}else if(e<12){let p=ue[N++],y=ue[N++];if((p&128)>0||(y&128)>0){N-=10;return}if(e<11)return Pt(t,n,o,i,c,l,d,h,p,y);let g=ue[N++];if((g&128)>0){N-=11;return}return Pt(t,n,o,i,c,l,d,h,p,y,g)}else{let p=ue[N++],y=ue[N++],g=ue[N++],v=ue[N++];if((p&128)>0||(y&128)>0||(g&128)>0||(v&128)>0){N-=12;return}if(e<14){if(e===12)return Pt(t,n,o,i,c,l,d,h,p,y,g,v);{let w=ue[N++];if((w&128)>0){N-=13;return}return Pt(t,n,o,i,c,l,d,h,p,y,g,v,w)}}else{let w=ue[N++],S=ue[N++];if((w&128)>0||(S&128)>0){N-=14;return}if(e<15)return Pt(t,n,o,i,c,l,d,h,p,y,g,v,w,S);let E=ue[N++];if((E&128)>0){N-=15;return}return Pt(t,n,o,i,c,l,d,h,p,y,g,v,w,S,E)}}}}}function Ux(){let e=ue[N++],t;if(e<192)t=e-160;else switch(e){case 217:t=ue[N++];break;case 218:t=Le.getUint16(N),N+=2;break;case 219:t=Le.getUint32(N),N+=4;break;default:throw new Error("Expected string")}return hc(t)}function Zh(e){return Qe.copyBuffers?Uint8Array.prototype.slice.call(ue,N,N+=e):ue.subarray(N,N+=e)}function Ks(e){let t=ue[N++];if(yn[t]){let n;return yn[t](ue.subarray(N,n=N+=e),o=>{N=o;try{return mt()}finally{N=n}})}else throw new Error("Unknown extension type "+t)}var Bx=new Array(4096);function M_(){let e=ue[N++];if(e>=160&&e<192){if(e=e-160,gr>=N)return ys.slice(N-$n,(N+=e)-$n);if(!(gr==0&&Sr<180))return Zm(e)}else return N--,L_(mt());let t=(e<<5^(e>1?Le.getUint16(N):e>0?ue[N]:0))&4095,n=Bx[t],o=N,i=N+e-3,c,l=0;if(n&&n.bytes==e){for(;o<i;){if(c=Le.getUint32(o),c!=n[l++]){o=1879048192;break}o+=4}for(i+=3;o<i;)if(c=ue[o++],c!=n[l++]){o=1879048192;break}if(o===i)return N=o,n.string;i-=3,o=N}for(n=[],Bx[t]=n,n.bytes=e;o<i;)c=Le.getUint32(o),n.push(c),o+=4;for(i+=3;o<i;)c=ue[o++],n.push(c);let d=e<16?$g(e):A_(e);return d!=null?n.string=d:n.string=Zm(e)}function L_(e){if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return e.toString();if(e==null)return e+"";if(Qe.allowArraysInMapKeys&&Array.isArray(e)&&e.flat().every(t=>["string","number","boolean","bigint"].includes(typeof t)))return e.flat().toString();throw new Error(`Invalid property type for record: ${typeof e}`)}const zx=(e,t)=>{let n=mt().map(L_),o=e;t!==void 0&&(e=e<32?-((t<<5)+e):(t<<5)+e,n.highByte=t);let i=Oe[e];return i&&(i.isShared||ws)&&((Oe.restoreStructures||(Oe.restoreStructures=[]))[e]=i),Oe[e]=n,n.read=jg(n,o),(n.read0||n.read)()};yn[0]=()=>{};yn[0].noBuffer=!0;yn[66]=e=>{let t=e.byteLength%8||8,n=BigInt(e[0]&128?e[0]-256:e[0]);for(let o=1;o<t;o++)n<<=BigInt(8),n+=BigInt(e[o]);if(e.byteLength!==t){let o=new DataView(e.buffer,e.byteOffset,e.byteLength),i=(c,l)=>{let d=l-c;if(d<=40){let g=o.getBigUint64(c);for(let v=c+8;v<l;v+=8)g<<=BigInt(64),g|=o.getBigUint64(v);return g}let h=c+(d>>4<<3),p=i(c,h),y=i(h,l);return p<<BigInt((l-h)*8)|y};n=n<<BigInt((o.byteLength-t)*8)|i(t,o.byteLength)}return n};let Vx={Error,EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError,AggregateError:typeof AggregateError=="function"?AggregateError:null};yn[101]=()=>{let e=mt();if(!Vx[e[0]]){let t=Error(e[1],{cause:e[2]});return t.name=e[0],t}return Vx[e[0]](e[1],{cause:e[2]})};yn[105]=e=>{if(Qe.structuredClone===!1)throw new Error("Structured clone extension is disabled");let t=Le.getUint32(N-4);Vr||(Vr=new Map);let n=ue[N],o;n>=144&&n<160||n==220||n==221?o=[]:n>=128&&n<144||n==222||n==223?o=new Map:(n>=199&&n<=201||n>=212&&n<=216)&&ue[N+1]===115?o=new Set:o={};let i={target:o};Vr.set(t,i);let c=mt();if(i.used)Object.assign(o,c);else return i.target=c;if(o instanceof Map)for(let[l,d]of c.entries())o.set(l,d);if(o instanceof Set)for(let l of Array.from(c))o.add(l);return o};yn[112]=e=>{if(Qe.structuredClone===!1)throw new Error("Structured clone extension is disabled");let t=Le.getUint32(N-4),n=Vr.get(t);return n.used=!0,n.target};yn[115]=()=>new Set(mt());const O_=["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64","BigInt64","BigUint64"].map(e=>e+"Array");let nj=typeof globalThis=="object"?globalThis:window;yn[116]=e=>{let t=e[0],n=Uint8Array.prototype.slice.call(e,1).buffer,o=O_[t];if(!o){if(t===16)return n;if(t===17)return new DataView(n);throw new Error("Could not find typed array for code "+t)}return new nj[o](n)};yn[120]=()=>{let e=mt();return new RegExp(e[0],e[1])};const rj=[];yn[98]=e=>{let t=(e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3],n=N;return N+=t-e.length,It=rj,It=[Ux(),Ux()],It.position0=0,It.position1=0,It.postBundlePosition=N,N=n,mt()};yn[255]=e=>e.length==4?new Date((e[0]*16777216+(e[1]<<16)+(e[2]<<8)+e[3])*1e3):e.length==8?new Date(((e[0]<<22)+(e[1]<<14)+(e[2]<<6)+(e[3]>>2))/1e6+((e[3]&3)*4294967296+e[4]*16777216+(e[5]<<16)+(e[6]<<8)+e[7])*1e3):e.length==12?new Date(((e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3])/1e6+((e[4]&128?-281474976710656:0)+e[6]*1099511627776+e[7]*4294967296+e[8]*16777216+(e[9]<<16)+(e[10]<<8)+e[11])*1e3):new Date("invalid");function N_(e){let t=Sr,n=N,o=$n,i=gr,c=ys,l=Vr,d=It,h=new Uint8Array(ue.slice(0,Sr)),p=Oe,y=Oe.slice(0,Oe.length),g=Qe,v=ws,w=e();return Sr=t,N=n,$n=o,gr=i,ys=c,Vr=l,It=d,ue=h,ws=v,Oe=p,Oe.splice(0,Oe.length,...y),Qe=g,Le=new DataView(ue.buffer,ue.byteOffset,ue.byteLength),w}function ep(){ue=null,Vr=null,Oe=null}const Ug=new Array(147);for(let e=0;e<256;e++)Ug[e]=+("1e"+Math.floor(45.15-e*.30103));var vf=new Ka({useRecords:!1});vf.unpack;vf.unpackMultiple;vf.unpack;let sj=new Float32Array(1);new Uint8Array(sj.buffer,0,4);let Gu;try{Gu=new TextEncoder}catch{}let tp,np;const vi=typeof Buffer<"u",Mu=vi?function(e){return Buffer.allocUnsafeSlow(e)}:Uint8Array,D_=vi?Buffer:Uint8Array,qx=vi?4294967296:2144337920;let Q,ya,qe,j=0,qt,it=null,oj;const ij=21760,aj=/[\u0080-\uFFFF]/,Xo=Symbol("record-id");class cj extends Ka{constructor(t){super(t),this.offset=0;let n,o,i,c,l=D_.prototype.utf8Write?function(k,U){return Q.utf8Write(k,U,Q.byteLength-U)}:Gu&&Gu.encodeInto?function(k,U){return Gu.encodeInto(k,Q.subarray(U)).written}:!1,d=this;t||(t={});let h=t&&t.sequential,p=t.structures||t.saveStructures,y=t.maxSharedStructures;if(y==null&&(y=p?32:0),y>8160)throw new Error("Maximum maxSharedStructure is 8160");t.structuredClone&&t.moreTypes==null&&(this.moreTypes=!0);let g=t.maxOwnStructures;g==null&&(g=p?32:64),!this.structures&&t.useRecords!=!1&&(this.structures=[]);let v=y>32||g+y>64,w=y+64,S=y+g+64;if(S>8256)throw new Error("Maximum maxSharedStructure + maxOwnStructure is 8192");let E=[],P=0,H=0;this.pack=this.encode=function(k,U){if(Q||(Q=new Mu(8192),qe=Q.dataView||(Q.dataView=new DataView(Q.buffer,0,8192)),j=0),qt=Q.length-10,qt-j<2048?(Q=new Mu(Q.length),qe=Q.dataView||(Q.dataView=new DataView(Q.buffer,0,Q.length)),qt=Q.length-10,j=0):j=j+7&2147483640,n=j,U&hj&&(j+=U&255),c=d.structuredClone?new Map:null,d.bundleStrings&&typeof k!="string"?(it=[],it.size=1/0):it=null,i=d.structures,i){i.uninitialized&&(i=d._mergeStructures(d.getStructures()));let J=i.sharedLength||0;if(J>y)throw new Error("Shared structures is larger than maximum shared structures, try increasing maxSharedStructures to "+i.sharedLength);if(!i.transitions){i.transitions=Object.create(null);for(let B=0;B<J;B++){let X=i[B];if(!X)continue;let ne,te=i.transitions;for(let I=0,Z=X.length;I<Z;I++){let pe=X[I];ne=te[pe],ne||(ne=te[pe]=Object.create(null)),te=ne}te[Xo]=B+64}this.lastNamedStructuresLength=J}h||(i.nextId=J+64)}o&&(o=!1);let V;try{d.randomAccessStructure&&!d.readOnlyStructures&&k&&typeof k=="object"?k.constructor===Object?K(k):k.constructor!==Map&&!Array.isArray(k)&&!np.some(B=>k instanceof B)?K(k.toJSON?k.toJSON():k):C(k):C(k);let J=it;if(it&&Hx(n,C,0),c&&c.idsToInsert){let B=c.idsToInsert.sort((I,Z)=>I.offset>Z.offset?1:-1),X=B.length,ne=-1;for(;J&&X>0;){let I=B[--X].offset+n;I<J.stringsPosition+n&&ne===-1&&(ne=0),I>J.position+n?ne>=0&&(ne+=6):(ne>=0&&(qe.setUint32(J.position+n,qe.getUint32(J.position+n)+ne),ne=-1),J=J.previous,X++)}ne>=0&&J&&qe.setUint32(J.position+n,qe.getUint32(J.position+n)+ne),j+=B.length*6,j>qt&&q(j),d.offset=j;let te=uj(Q.subarray(n,j),B);return c=null,te}return d.offset=j,U&fj?(Q.start=n,Q.end=j,Q):Q.subarray(n,j)}catch(J){throw V=J,J}finally{if(i&&(_(),o&&d.saveStructures)){let J=i.sharedLength||0,B=Q.subarray(n,j),X=lj(i,d);if(!V)return d.saveStructures(X,X.isCompatible)===!1?(i.uninitialized=!0,d.pack(k,U)):(d.lastNamedStructuresLength=J,Q.length>1073741824&&(Q=null),B)}Q.length>1073741824&&(Q=null),U&dj&&(j=n)}};const _=()=>{H<10&&H++;let k=i.sharedLength||0;if(i.length>k&&!h&&(i.length=k),P>1e4)i.transitions=null,H=0,P=0,E.length>0&&(E=[]);else if(E.length>0&&!h){for(let U=0,V=E.length;U<V;U++)E[U][Xo]=0;E=[]}},O=k=>{var U=k.length;U<16?Q[j++]=144|U:U<65536?(Q[j++]=220,Q[j++]=U>>8,Q[j++]=U&255):(Q[j++]=221,qe.setUint32(j,U),j+=4);for(let V=0;V<U;V++)C(k[V])},C=k=>{j>qt&&(Q=q(j));var U=typeof k,V;if(U==="string"){let J=k.length;if(it&&J>=4&&J<4096){if((it.size+=J)>ij){let te,I=(it[0]?it[0].length*3+it[1].length:0)+10;j+I>qt&&(Q=q(j+I));let Z;it.position?(Z=it,Q[j]=200,j+=3,Q[j++]=98,te=j-n,j+=4,Hx(n,C,0),qe.setUint16(te+n-3,j-n-te)):(Q[j++]=214,Q[j++]=98,te=j-n,j+=4),it=["",""],it.previous=Z,it.size=0,it.position=te}let ne=aj.test(k);it[ne?0:1]+=k,Q[j++]=193,C(ne?-J:J);return}let B;J<32?B=1:J<256?B=2:J<65536?B=3:B=5;let X=J*3;if(j+X>qt&&(Q=q(j+X)),J<64||!l){let ne,te,I,Z=j+B;for(ne=0;ne<J;ne++)te=k.charCodeAt(ne),te<128?Q[Z++]=te:te<2048?(Q[Z++]=te>>6|192,Q[Z++]=te&63|128):(te&64512)===55296&&((I=k.charCodeAt(ne+1))&64512)===56320?(te=65536+((te&1023)<<10)+(I&1023),ne++,Q[Z++]=te>>18|240,Q[Z++]=te>>12&63|128,Q[Z++]=te>>6&63|128,Q[Z++]=te&63|128):(Q[Z++]=te>>12|224,Q[Z++]=te>>6&63|128,Q[Z++]=te&63|128);V=Z-j-B}else V=l(k,j+B);V<32?Q[j++]=160|V:V<256?(B<2&&Q.copyWithin(j+2,j+1,j+1+V),Q[j++]=217,Q[j++]=V):V<65536?(B<3&&Q.copyWithin(j+3,j+2,j+2+V),Q[j++]=218,Q[j++]=V>>8,Q[j++]=V&255):(B<5&&Q.copyWithin(j+5,j+3,j+3+V),Q[j++]=219,qe.setUint32(j,V),j+=4),j+=V}else if(U==="number")if(k>>>0===k)k<32||k<128&&this.useRecords===!1||k<64&&!this.randomAccessStructure?Q[j++]=k:k<256?(Q[j++]=204,Q[j++]=k):k<65536?(Q[j++]=205,Q[j++]=k>>8,Q[j++]=k&255):(Q[j++]=206,qe.setUint32(j,k),j+=4);else if(k>>0===k)k>=-32?Q[j++]=256+k:k>=-128?(Q[j++]=208,Q[j++]=k+256):k>=-32768?(Q[j++]=209,qe.setInt16(j,k),j+=2):(Q[j++]=210,qe.setInt32(j,k),j+=4);else{let J;if((J=this.useFloat32)>0&&k<4294967296&&k>=-2147483648){Q[j++]=202,qe.setFloat32(j,k);let B;if(J<4||(B=k*Ug[(Q[j]&127)<<1|Q[j+1]>>7])>>0===B){j+=4;return}else j--}Q[j++]=203,qe.setFloat64(j,k),j+=8}else if(U==="object"||U==="function")if(!k)Q[j++]=192;else{if(c){let B=c.get(k);if(B){if(!B.id){let X=c.idsToInsert||(c.idsToInsert=[]);B.id=X.push(B)}Q[j++]=214,Q[j++]=112,qe.setUint32(j,B.id),j+=4;return}else c.set(k,{offset:j-n})}let J=k.constructor;if(J===Object)$(k);else if(J===Array)O(k);else if(J===Map)if(this.mapAsEmptyObject)Q[j++]=128;else{V=k.size,V<16?Q[j++]=128|V:V<65536?(Q[j++]=222,Q[j++]=V>>8,Q[j++]=V&255):(Q[j++]=223,qe.setUint32(j,V),j+=4);for(let[B,X]of k)C(B),C(X)}else{for(let B=0,X=tp.length;B<X;B++){let ne=np[B];if(k instanceof ne){let te=tp[B];if(te.write){te.type&&(Q[j++]=212,Q[j++]=te.type,Q[j++]=0);let le=te.write.call(this,k);le===k?Array.isArray(k)?O(k):$(k):C(le);return}let I=Q,Z=qe,pe=j;Q=null;let me;try{me=te.pack.call(this,k,le=>(Q=I,I=null,j+=le,j>qt&&q(j),{target:Q,targetView:qe,position:j-le}),C)}finally{I&&(Q=I,qe=Z,j=pe,qt=Q.length-10)}me&&(me.length+j>qt&&q(me.length+j),j=Wx(me,Q,j,te.type));return}}if(Array.isArray(k))O(k);else{if(k.toJSON){const B=k.toJSON();if(B!==k)return C(B)}if(U==="function")return C(this.writeFunction&&this.writeFunction(k));$(k)}}}else if(U==="boolean")Q[j++]=k?195:194;else if(U==="bigint"){if(k<9223372036854776e3&&k>=-9223372036854776e3)Q[j++]=211,qe.setBigInt64(j,k);else if(k<18446744073709552e3&&k>0)Q[j++]=207,qe.setBigUint64(j,k);else if(this.largeBigIntToFloat)Q[j++]=203,qe.setFloat64(j,Number(k));else{if(this.largeBigIntToString)return C(k.toString());if(this.useBigIntExtension||this.moreTypes){let J=k<0?BigInt(-1):BigInt(0),B;if(k>>BigInt(65536)===J){let X=BigInt(18446744073709552e3)-BigInt(1),ne=[];for(;ne.push(k&X),k>>BigInt(63)!==J;)k>>=BigInt(64);B=new Uint8Array(new BigUint64Array(ne).buffer),B.reverse()}else{let X=k<0,ne=(X?~k:k).toString(16);if(ne.length%2?ne="0"+ne:parseInt(ne.charAt(0),16)>=8&&(ne="00"+ne),vi)B=Buffer.from(ne,"hex");else{B=new Uint8Array(ne.length/2);for(let te=0;te<B.length;te++)B[te]=parseInt(ne.slice(te*2,te*2+2),16)}if(X)for(let te=0;te<B.length;te++)B[te]=~B[te]}B.length+j>qt&&q(B.length+j),j=Wx(B,Q,j,66);return}else throw new RangeError(k+" was too large to fit in MessagePack 64-bit integer format, use useBigIntExtension, or set largeBigIntToFloat to convert to float-64, or set largeBigIntToString to convert to string")}j+=8}else if(U==="undefined")this.encodeUndefinedAsNil?Q[j++]=192:(Q[j++]=212,Q[j++]=0,Q[j++]=0);else throw new Error("Unknown type: "+U)},D=this.variableMapSize||this.coercibleKeyAsNumber||this.skipValues?k=>{let U;if(this.skipValues){U=[];for(let B in k)(typeof k.hasOwnProperty!="function"||k.hasOwnProperty(B))&&!this.skipValues.includes(k[B])&&U.push(B)}else U=Object.keys(k);let V=U.length;V<16?Q[j++]=128|V:V<65536?(Q[j++]=222,Q[j++]=V>>8,Q[j++]=V&255):(Q[j++]=223,qe.setUint32(j,V),j+=4);let J;if(this.coercibleKeyAsNumber)for(let B=0;B<V;B++){J=U[B];let X=Number(J);C(isNaN(X)?J:X),C(k[J])}else for(let B=0;B<V;B++)C(J=U[B]),C(k[J])}:k=>{Q[j++]=222;let U=j-n;j+=2;let V=0;for(let J in k)(typeof k.hasOwnProperty!="function"||k.hasOwnProperty(J))&&(C(J),C(k[J]),V++);if(V>65535)throw new Error('Object is too large to serialize with fast 16-bit map size, use the "variableMapSize" option to serialize this object');Q[U+++n]=V>>8,Q[U+n]=V&255},T=this.useRecords===!1?D:t.progressiveRecords&&!v?k=>{let U,V=i.transitions||(i.transitions=Object.create(null)),J=j++-n,B;for(let X in k)if(typeof k.hasOwnProperty!="function"||k.hasOwnProperty(X)){if(U=V[X],U)V=U;else{let ne=Object.keys(k),te=V;V=i.transitions;let I=0;for(let Z=0,pe=ne.length;Z<pe;Z++){let me=ne[Z];U=V[me],U||(U=V[me]=Object.create(null),I++),V=U}J+n+1==j?(j--,ee(V,ne,I)):se(V,ne,J,I),B=!0,V=te[X]}C(k[X])}if(!B){let X=V[Xo];X?Q[J+n]=X:se(V,Object.keys(k),J,0)}}:k=>{let U,V=i.transitions||(i.transitions=Object.create(null)),J=0;for(let X in k)(typeof k.hasOwnProperty!="function"||k.hasOwnProperty(X))&&(U=V[X],U||(U=V[X]=Object.create(null),J++),V=U);let B=V[Xo];B?B>=96&&v?(Q[j++]=((B-=96)&31)+96,Q[j++]=B>>5):Q[j++]=B:ee(V,V.__keys__||Object.keys(k),J);for(let X in k)(typeof k.hasOwnProperty!="function"||k.hasOwnProperty(X))&&C(k[X])},L=typeof this.useRecords=="function"&&this.useRecords,$=L?k=>{L(k)?T(k):D(k)}:T,q=k=>{let U;if(k>16777216){if(k-n>qx)throw new Error("Packed buffer would be larger than maximum buffer size");U=Math.min(qx,Math.round(Math.max((k-n)*(k>67108864?1.25:2),4194304)/4096)*4096)}else U=(Math.max(k-n<<2,Q.length-1)>>12)+1<<12;let V=new Mu(U);return qe=V.dataView||(V.dataView=new DataView(V.buffer,0,U)),k=Math.min(k,Q.length),Q.copy?Q.copy(V,0,n,k):V.set(Q.slice(n,k)),j-=n,n=0,qt=V.length-10,Q=V},ee=(k,U,V)=>{let J=i.nextId;J||(J=64),J<w&&this.shouldShareStructure&&!this.shouldShareStructure(U)?(J=i.nextOwnId,J<S||(J=w),i.nextOwnId=J+1):(J>=S&&(J=w),i.nextId=J+1);let B=U.highByte=J>=96&&v?J-96>>5:-1;k[Xo]=J,k.__keys__=U,i[J-64]=U,J<w?(U.isShared=!0,i.sharedLength=J-63,o=!0,B>=0?(Q[j++]=(J&31)+96,Q[j++]=B):Q[j++]=J):(B>=0?(Q[j++]=213,Q[j++]=114,Q[j++]=(J&31)+96,Q[j++]=B):(Q[j++]=212,Q[j++]=114,Q[j++]=J),V&&(P+=H*V),E.length>=g&&(E.shift()[Xo]=0),E.push(k),C(U))},se=(k,U,V,J)=>{let B=Q,X=j,ne=qt,te=n;Q=ya,j=0,n=0,Q||(ya=Q=new Mu(8192)),qt=Q.length-10,ee(k,U,J),ya=Q;let I=j;if(Q=B,j=X,qt=ne,n=te,I>1){let Z=j+I-1;Z>qt&&q(Z);let pe=V+n;Q.copyWithin(pe+I,pe+1,j),Q.set(ya.slice(0,I),pe),j=Z}else Q[V+n]=ya[0]},K=k=>{let U=oj(k,Q,n,j,i,q,(V,J,B)=>{if(B)return o=!0;j=J;let X=Q;return C(V),_(),X!==Q?{position:j,targetView:qe,target:Q}:j},this);if(U===0)return $(k);j=U}}useBuffer(t){Q=t,Q.dataView||(Q.dataView=new DataView(Q.buffer,Q.byteOffset,Q.byteLength)),qe=Q.dataView,j=0}set position(t){j=t}get position(){return j}clearSharedData(){this.structures&&(this.structures=[]),this.typedStructs&&(this.typedStructs=[])}}np=[Date,Set,Error,RegExp,ArrayBuffer,Object.getPrototypeOf(Uint8Array.prototype).constructor,DataView,I_];tp=[{pack(e,t,n){let o=e.getTime()/1e3;if((this.useTimestamp32||e.getMilliseconds()===0)&&o>=0&&o<4294967296){let{target:i,targetView:c,position:l}=t(6);i[l++]=214,i[l++]=255,c.setUint32(l,o)}else if(o>0&&o<4294967296){let{target:i,targetView:c,position:l}=t(10);i[l++]=215,i[l++]=255,c.setUint32(l,e.getMilliseconds()*4e6+(o/1e3/4294967296>>0)),c.setUint32(l+4,o)}else if(isNaN(o)){if(this.onInvalidDate)return t(0),n(this.onInvalidDate());let{target:i,targetView:c,position:l}=t(3);i[l++]=212,i[l++]=255,i[l++]=255}else{let{target:i,targetView:c,position:l}=t(15);i[l++]=199,i[l++]=12,i[l++]=255,c.setUint32(l,e.getMilliseconds()*1e6),c.setBigInt64(l+4,BigInt(Math.floor(o)))}}},{pack(e,t,n){if(this.setAsEmptyObject)return t(0),n({});let o=Array.from(e),{target:i,position:c}=t(this.moreTypes?3:0);this.moreTypes&&(i[c++]=212,i[c++]=115,i[c++]=0),n(o)}},{pack(e,t,n){let{target:o,position:i}=t(this.moreTypes?3:0);this.moreTypes&&(o[i++]=212,o[i++]=101,o[i++]=0),n([e.name,e.message,e.cause])}},{pack(e,t,n){let{target:o,position:i}=t(this.moreTypes?3:0);this.moreTypes&&(o[i++]=212,o[i++]=120,o[i++]=0),n([e.source,e.flags])}},{pack(e,t){this.moreTypes?em(e,16,t):tm(vi?Buffer.from(e):new Uint8Array(e),t)}},{pack(e,t){let n=e.constructor;n!==D_&&this.moreTypes?em(e,O_.indexOf(n.name),t):tm(e,t)}},{pack(e,t){this.moreTypes?em(e,17,t):tm(vi?Buffer.from(e):new Uint8Array(e),t)}},{pack(e,t){let{target:n,position:o}=t(1);n[o]=193}}];function em(e,t,n,o){let i=e.byteLength;if(i+1<256){var{target:c,position:l}=n(4+i);c[l++]=199,c[l++]=i+1}else if(i+1<65536){var{target:c,position:l}=n(5+i);c[l++]=200,c[l++]=i+1>>8,c[l++]=i+1&255}else{var{target:c,position:l,targetView:d}=n(7+i);c[l++]=201,d.setUint32(l,i+1),l+=4}c[l++]=116,c[l++]=t,e.buffer||(e=new Uint8Array(e)),c.set(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),l)}function tm(e,t){let n=e.byteLength;var o,i;if(n<256){var{target:o,position:i}=t(n+2);o[i++]=196,o[i++]=n}else if(n<65536){var{target:o,position:i}=t(n+3);o[i++]=197,o[i++]=n>>8,o[i++]=n&255}else{var{target:o,position:i,targetView:c}=t(n+5);o[i++]=198,c.setUint32(i,n),i+=4}o.set(e,i)}function Wx(e,t,n,o){let i=e.length;switch(i){case 1:t[n++]=212;break;case 2:t[n++]=213;break;case 4:t[n++]=214;break;case 8:t[n++]=215;break;case 16:t[n++]=216;break;default:i<256?(t[n++]=199,t[n++]=i):i<65536?(t[n++]=200,t[n++]=i>>8,t[n++]=i&255):(t[n++]=201,t[n++]=i>>24,t[n++]=i>>16&255,t[n++]=i>>8&255,t[n++]=i&255)}return t[n++]=o,t.set(e,n),n+=i,n}function uj(e,t){let n,o=t.length*6,i=e.length-o;for(;n=t.pop();){let c=n.offset,l=n.id;e.copyWithin(c+o,c,i),o-=6;let d=c+o;e[d++]=214,e[d++]=105,e[d++]=l>>24,e[d++]=l>>16&255,e[d++]=l>>8&255,e[d++]=l&255,i=c}return e}function Hx(e,t,n){if(it.length>0){qe.setUint32(it.position+e,j+n-it.position-e),it.stringsPosition=j-e;let o=it;it=null,t(o[0]),t(o[1])}}function lj(e,t){return e.isCompatible=n=>{let o=!n||(t.lastNamedStructuresLength||0)===n.length;return o||t._mergeStructures(n),o},e}let j_=new cj({useRecords:!1});j_.pack;j_.pack;const fj=512,dj=1024,hj=2048;class Bg extends qn()("effect/rpc/RpcSerialization"){}const mj=Bg.of({contentType:"application/json",includesFraming:!1,makeUnsafe:()=>{const e=new TextDecoder;return{decode:t=>{const n=JSON.parse(typeof t=="string"?t:e.decode(t));return Array.isArray(n)?n:[n]},encode:t=>JSON.stringify(t)}}}),pj=og(Bg)(mj),gj=e=>wr(()=>{const t=new Set,n=new Map,o=new Map;let i=(c,l)=>cE(d=>{let h=n.get(c);return h||(h=[],n.set(c,h)),h.push([l,d]),ht});return Rs(e((c,l)=>{const d=o.get(c);return d?d(l):i(c,l)},t),c=>({...c,run(l,d){return Mm(function*(){t.add(l),o.set(l,d);const h=n.get(l);if(h){n.delete(l);for(const[p,y]of h)yield*so(wr(()=>d(p)),y)}return yield*fE(fL,()=>(t.delete(l),o.delete(l),ht))})}}))});let yj=BigInt(0);const vj=oo(function*(e,t){const n=(t==null?void 0:t.spanPrefix)??"RpcClient",o=(t==null?void 0:t.supportsAck)??!0,i=(t==null?void 0:t.disableTracing)??!1,c=(t==null?void 0:t.generateRequestId)??(()=>yj++),l=yield*ml(),d=ro(l,BS),h=new Map;let p=!1;yield*$M(d,dl(_=>(p=!0,y(TM(_.id)))));const y=oo(function*(_){for(const[O,C]of h)h.delete(O),C._tag==="Queue"?yield*_._tag==="Success"?cx(C.queue):wa(C.queue,_.cause):C.resume(_)}),g=_=>{const O=g_(_.successSchema),C=S(_);return(D,T)=>{const L=T!=null&&T.headers?F4(T.headers):Og,$=(T==null?void 0:T.context)??sr();if(!O){const ee=se=>v(_,C,se,_.payloadSchema.make(D),L,$,(T==null?void 0:T.discard)??!1);return i?ee(void 0):AL(`${n}.${_._tag}`,{attributes:t.spanAttributes},ee)}const q=w(_,C,_.payloadSchema.make(D),L,(T==null?void 0:T.streamBufferSize)??16,$);return T!=null&&T.asQueue?q:PN(Rs(q,bN))}},v=(_,O,C,D,T,L,$)=>dl(q=>{if(p)return Lm;const ee=c(),se=O(k=>t.onFromClient({message:k,context:L,discard:$}),{_tag:"Request",id:ee,tag:_._tag,payload:D,...C?{traceId:C.traceId,spanId:C.spanId,sampled:C.sampled}:{},headers:Ax(q.getRef(Qx),T)});if($)return se;let K;return RL(KS(k=>{const U={_tag:"Effect",rpc:_,context:L,resume(V){k(V),K&&!K.pollUnsafe()&&q.currentDispatcher.scheduleTask(()=>{K.interruptUnsafe(q.id)},0)}};h.set(ee,U),K=se.pipe(C?JS(C,{captureStackTrace:!1}):Ie,pl(q.context)),K.addObserver(V=>{if(V._tag==="Failure")return k(V)})}),k=>(h.delete(ee),pL(GE(K),E(ee,Array.from(k),L))))}),w=oo(function*(_,O,C,D,T,L){if(p)return yield*Lm;const $=i?void 0:yield*TL(`${n}.${_._tag}`,{attributes:t.spanAttributes}),q=zm(),ee=c(),se=Hl(q.context,BS);yield*jM(se,k=>h.has(ee)?(h.delete(ee),E(ee,Kk(k)?Array.from(PM(k.cause)):[],L)):ht);const K=yield*gO(T);return h.set(ee,{_tag:"Queue",rpc:_,queue:K,scope:se,context:L}),yield*O(k=>t.onFromClient({message:k,context:L,discard:!1}),{_tag:"Request",id:ee,tag:_._tag,payload:C,...$?{traceId:$.traceId,spanId:$.spanId,sampled:$.sampled}:{},headers:Ax(q.getRef(Qx),D)}).pipe($?JS($,{captureStackTrace:!1}):Ie,hl(k=>wa(K,k)),cg,ML(se,{startImmediately:!0})),K}),S=_=>{const O=[];for(const C of _.middlewares.values()){const D=l.mapUnsafe.get(`${C.key}/Client`);D&&O.push(D)}return O.length===0?(C,D)=>C(D):function C(D,T,L=O.length-1){return L===-1?D(T):O[L]({rpc:_,request:T,next($){return C(D,$,L-1)}})}},E=(_,O,C)=>KS(D=>{const T=zm();t.onFromClient({message:{_tag:"Interrupt",requestId:_,interruptors:O},context:C,discard:!1}).pipe(wL(1e3),pl(T.context)).addObserver(()=>{D(ht)})}),P=_=>{switch(_._tag){case"Chunk":{const O=_.requestId,C=h.get(O);return!C||C._tag!=="Queue"?ht:yO(C.queue,_.values).pipe(o?Rn(()=>t.onFromClient({message:{_tag:"Ack",requestId:_.requestId},context:C.context,discard:!1})):Ie,hl(D=>wa(C.queue,D)))}case"Exit":{const O=_.requestId,C=h.get(O);return C?(h.delete(O),C._tag==="Effect"?(C.resume(_.exit),ht):_.exit._tag==="Success"?cx(C.queue):wa(C.queue,_.exit.cause)):ht}case"Defect":return y(RM(_.defect));case"ClientEnd":return ht}};let H;if(t.flatten){const _=new Map;H=function(C,D,T){let L=_.get(C);return L||(L=g(e.requests.get(C)),_.set(C,L)),L(D,T)}}else H={},e.requests.forEach(_=>{H[_._tag]=g(_)});return{client:H,write:P}});let Sj=0;const xj=oo(function*(e,t){const n=Sj++,{run:o,send:i,supportsAck:c,supportsTransferables:l}=yield*Sf,d=new Map,{client:h,write:p}=yield*vj(e,{...t,supportsAck:c,onFromClient({message:y}){switch(y._tag){case"Request":{const g=e.requests.get(y.tag),v=l?q4():void 0,w=zm(),S={rpc:g,context:v?Fs(w.context,F_,v):w.context,schemas:wj(g)};return d.set(y.id,S),S.schemas.encodePayload(y.payload).pipe(so(S.context),qu,Rn(E=>i(n,{...y,id:String(y.id),payload:E,headers:Object.entries(y.headers)},v&&v.readUnsafe())))}case"Ack":return d.get(y.requestId)?i(n,{_tag:"Ack",requestId:String(y.requestId)}):ht;case"Interrupt":return d.get(y.requestId)?(d.delete(y.requestId),i(n,{_tag:"Interrupt",requestId:String(y.requestId)})):ht;case"Eof":return ht}}});return yield*o(n,y=>{switch(y._tag){case"Chunk":{const g=Tu(y.requestId),v=d.get(g);return!v||go(v.schemas.decodeChunk)?ht:v.schemas.decodeChunk.value(y.values).pipe(so(v.context),qu,Rn(w=>p({_tag:"Chunk",clientId:0,requestId:Tu(y.requestId),values:w})),IL(w=>p({_tag:"Exit",clientId:0,requestId:Tu(y.requestId),exit:Ca(w)})))}case"Exit":{const g=Tu(y.requestId),v=d.get(g);return v?(d.delete(g),v.schemas.decodeExit(y.exit).pipe(so(v.context),qu,EL({onSuccess:w=>p({_tag:"Exit",clientId:0,requestId:g,exit:w}),onFailure:w=>p({_tag:"Exit",clientId:0,requestId:g,exit:Ca(w)})}))):ht}case"Defect":return p({_tag:"Defect",clientId:0,defect:Cj(y.defect)});case"ClientProtocolError":{const g=oc(y.error);return sE(d.keys(),v=>p({_tag:"Exit",clientId:0,requestId:v,exit:g}))}default:return ht}}).pipe(hl(BL),cg,ug),h}),Kx=new WeakMap,wj=e=>{let t=Kx.get(e);if(t!==void 0)return t;const n=y_(e.successSchema);return t={decodeChunk:Lp(n,o=>lx(Bh(tN(o.success)))),encodePayload:YO(Bh(e.payloadSchema)),decodeExit:lx(Bh(VN(e)))},Kx.set(e,t),t},Qx=rt("effect/rpc/RpcClient/CurrentHeaders",{defaultValue:()=>Og});class Sf extends qn()("effect/rpc/RpcClient/Protocol"){}M(Sf,"make",gj);const kj=e=>Sf.make(oo(function*(t,n){const o=yield*Dg,i=yield*Bg,c=yield*CL(rp),l=new Map,d=yield*o.writer;let h=i.makeUnsafe();const p=yield*_j(d(h.encode(G4)));let y;const g=wr(()=>(y=void 0,ks(c)?c.value.onConnect:ht)),v=w=>sE(n,S=>t(S,w));return yield*wr(()=>(h=i.makeUnsafe(),p.reset(),o.runRaw(w=>{try{const S=h.decode(w);if(S.length===0)return;let E=0;return oE({while:()=>E<S.length,body:()=>{const P=S[E++];if(P._tag==="Pong")return p.onPong(),ht;if("requestId"in P){const H=l.get(P.requestId);if(H!==void 0)return P._tag==="Exit"&&l.delete(P.requestId),t(H,P)}return v(P)},step:Ga})}catch(S){return v({_tag:"ClientProtocolError",error:new Ym({reason:new Gm({message:"Error decoding message",cause:S})})})}},{onOpen:g}).pipe(aE(Rn(p.timeout,()=>Je(new ai({reason:new Pl({kind:"Timeout",cause:new Error("ping timeout")})}))))))).pipe(Rn(()=>Je(new ai({reason:new Fl({code:1e3})}))),ks(c)?lE(c.value.onDisconnect):Ie,vL(w=>{const S=sc(w),E=sR(S);return y=new Ym({reason:E?S.success.reason:new Gm({message:"Unknown socket error",cause:qk(w)})}),v({_tag:"ClientProtocolError",error:y})}),SL((e==null?void 0:e.retryPolicy)??Ej),zL({module:"RpcClient",method:"makeProtocolSocket"}),ug),{send(w,S){if(y)return Je(y);S._tag==="Request"&&l.set(S.id,w);const E=h.encode(S);return E===void 0?ht:qu(d(E))},supportsAck:!0,supportsTransferables:!1}})),Ej=tL(500,1.5).pipe(ZM(nE(5e3))),_j=oo(function*(e){let t=!0;const n=YE(),o=()=>{t=!0,n.closeUnsafe()},i=()=>{t=!0};return yield*wr(()=>t?(t=!1,e):n.open).pipe(kL("5 seconds"),xL,dE,cg,ug),{timeout:n.await,reset:o,onPong:i}});class rp extends qn()("effect/rpc/RpcClient/ConnectionHooks"){}const Cj=JO(cr);class $_ extends Error{constructor(t="daemon RPC connection closed"){super(t),this.name="DaemonRpcConnectionError"}}class bj extends Error{constructor(t,n){super(`${t} timed out after ${n}ms`),this.method=t,this.timeoutMs=n,this.name="DaemonRpcRequestTimeoutError"}}class Lu extends qn()("tokmon/client/DaemonRpcClient/TokmonRpcClient"){}const Pj=new Function("specifier","return import(specifier)");function Jx(){let e=!1,t;return{promise:new Promise(o=>{t=o}),resolve:o=>{e||(e=!0,t(o))}}}function Fj(e){const t=typeof window>"u"?void 0:window.location.origin,n=new URL(e,t);if(n.protocol==="http:"?n.protocol="ws:":n.protocol==="https:"&&(n.protocol="wss:"),n.protocol!=="ws:"&&n.protocol!=="wss:")throw new Error(`unsupported daemon RPC protocol: ${n.protocol}`);return n.hash="",n.searchParams.delete("tokmonToken"),n.searchParams.delete("wsToken"),n.pathname=QN,n.toString()}function Ij(e){return e==="node"?!0:e==="browser"?!1:typeof window>"u"}async function Rj(e,t,n){const o={openTimeout:ja(n)};return Ij(t)?(await Pj("@effect/platform-node/NodeSocket")).layerWebSocket(e,o):V4(e,o).pipe(Am(U4))}function Yu(e){return{protocol:{version:e.protocol.version,capabilities:[...e.protocol.capabilities]},config:qF(e.config)}}function Tj(e){const t=o=>o?{...o,activeAccountIds:[...o.activeAccountIds],factors:o.factors.map(i=>({...i}))}:void 0,n=o=>o.map(i=>({...i,models:[...i.models],breakdown:i.breakdown.map(c=>({...c}))}));return{...e,providers:e.providers.map(o=>({...o,headroom:t(o.headroom)})),accounts:e.accounts.map(o=>{var i;return{...o,identity:o.identity?{...o.identity}:void 0,quotas:(i=o.quotas)==null?void 0:i.map(c=>({...c})),headroom:t(o.headroom),dashboard:o.dashboard?{...o.dashboard,today:{...o.dashboard.today},week:{...o.dashboard.week},month:{...o.dashboard.month},series:[...o.dashboard.series]}:null,table:o.table?{daily:n(o.table.daily),weekly:n(o.table.weekly),monthly:n(o.table.monthly)}:null,billing:o.billing?{...o.billing,metrics:o.billing.metrics.map(c=>({...c,format:{...c.format}})),activity:o.billing.activity?{...o.billing.activity,series:[...o.billing.activity.series]}:o.billing.activity,modelSpend:o.billing.modelSpend==null?o.billing.modelSpend:o.billing.modelSpend.map(c=>({...c}))}:null,summaryUpdatedAt:o.summaryUpdatedAt??null,billingUpdatedAt:o.billingUpdatedAt??null,tableUpdatedAt:o.tableUpdatedAt??null}}),peak:e.peak?{...e.peak}:null}}function Aj(e){if(!e||typeof e!="object"||e.kind!=="conflict")return e;const t=e.state;if(!t)return e;const n=Yu(t);return e instanceof Qm?new Qm({kind:"conflict",state:n}):{...e,state:n}}function Mj(e){return e instanceof Ym||QO(e)}async function Lj(e,t,n){let o=null;try{await Promise.race([e.promise,t.promise.then(i=>Promise.reject(i)),new Promise((i,c)=>{var l;o=setTimeout(()=>c(new $_(`daemon RPC connection timed out after ${n}ms`)),n),(l=o.unref)==null||l.call(o)})])}finally{o&&clearTimeout(o)}}function Oj(e,t={}){const n=Fj(e),o=Math.max(1,t.requestTimeoutMs??3e4),i=Math.max(1,t.reconnectBaseDelayMs??250),c=new Set;let l=null,d=null,h=null,p=null,y=null,g=0,v=!1,w=!1;const S=K=>{if(t.onSubscriberError){try{t.onSubscriberError(K)}catch(k){console.error("[tokmon] daemon RPC subscriber error reporter failed",k)}return}console.error("[tokmon] daemon RPC subscriber failed",K)},E=(K,k)=>{var U;try{(U=t.onConn)==null||U.call(t,K,k)}catch(V){S(V)}},P=()=>{y&&(clearTimeout(y),y=null)},H=K=>{const k=K.fiber;return K.fiber=null,K.owner=null,k?Wu(GE(k)).catch(()=>{}):Promise.resolve()},_=K=>(K.active=!1,c.delete(K),K.watchdogTimer&&(clearInterval(K.watchdogTimer),K.watchdogTimer=null),H(K)),O=()=>{var k;if(w||c.size===0||y||l||d||typeof t.reconnectAttempts=="number"&&g>=t.reconnectAttempts)return;const K=Math.min(2500,i*1.5**g);y=setTimeout(()=>{y=null,g++,ee()},K),(k=y.unref)==null||k.call(y)},C=(K,k,U)=>{K.invalidated||(K.invalidated=!0,l===K&&(l=null),K.runtime.dispose().catch(()=>{}),w||E(k,U),O())},D=async(K,k)=>{const U=await Rj(n,t.transport,o),V=og(rp,rp.of({onConnect:Un(()=>{K.resolve()}),onDisconnect:Un(()=>{k.resolve(new $_)})}));return Rm(Sf,kj({retryPolicy:nL(0)})).pipe(Am(Yk(U,pj,V)))},T=async()=>{if(w)throw new Error("daemon RPC client is closed");if(l)return l;if(d)return d;E(v?"reconnecting":"connecting");const K=(async()=>{let k=null;try{const U=Jx(),V=Jx(),J=await D(U,V),B=Rm(Lu,xj(ID)).pipe(Am(J));if(k=$N(B),h=k,await k.runPromise(Lu.asEffect()),await Lj(U,V,o),w)throw new Error("daemon RPC client is closed");const X={runtime:k,disconnected:V.promise,invalidated:!1};return l=X,h=null,v=!0,g=0,E("live"),X.disconnected.then(ne=>{C(X,"reconnecting",ne)}),q(X),X}catch(U){throw h===k&&(h=null),await(k==null?void 0:k.dispose().catch(()=>{})),w||E("error",U),U}})();d=K;try{return await K}finally{d===K&&(d=null)}},L=async(K,k)=>{const U=await T();try{return await U.runtime.runPromise(Lu.use(V=>k(V)).pipe(iE({duration:ja(o),orElse:()=>Je(new bj(K,o))})))}catch(V){const J=Aj(V);throw!w&&Mj(J)&&C(U,"error",J),J}},$=(K,k)=>{if(w||!K.active||K.fiber||k.invalidated)return;K.lastValueAt=Date.now(),K.staleAfterMs=t.snapshotStaleFloorMs??9e4,K.owner=k;const U=k.runtime.runFork(Lu.use(V=>K.streamFor(V).pipe(IN(J=>Un(()=>{K.lastValueAt=Date.now(),K.staleAfterFor&&(K.staleAfterMs=K.staleAfterFor(J));try{K.onValue(J)}catch(B){S(B)}})))));K.fiber=U,U.addObserver(V=>{K.fiber===U&&(K.fiber=null),K.owner===k&&(K.owner=null),!(w||!K.active||k.invalidated)&&(Hk(V)?C(k,"reconnecting"):C(k,"error",qk(V.cause)))})},q=K=>{for(const k of c)$(k,K)};function ee(){w||c.size===0||p||(p=T().then(()=>{}).catch(()=>{O()}).finally(()=>{p=null}))}const se=(K,k,U)=>{var J,B;if(w)return()=>{};const V={streamFor:K,onValue:k,staleAfterFor:U,active:!0,fiber:null,owner:null,watchdogTimer:null,lastValueAt:0,staleAfterMs:Number.POSITIVE_INFINITY};if(c.add(V),U){const X=Math.min(5e3,Math.max(10,(t.snapshotStaleFloorMs??9e4)/2));V.watchdogTimer=setInterval(()=>{!V.fiber||!V.owner||V.lastValueAt===0||Date.now()-V.lastValueAt<=V.staleAfterMs||(V.lastValueAt=Date.now(),C(V.owner,"reconnecting"))},X),(B=(J=V.watchdogTimer).unref)==null||B.call(J)}return l?$(V,l):ee(),()=>{_(V),c.size===0&&P()}};return{getConfig:()=>L(Ht.getConfig,K=>K[Ht.getConfig]({})).then(Yu),setConfig:K=>L(Ht.setConfig,k=>k[Ht.setConfig](K)).then(Yu),refresh:(K="all")=>L(Ht.refresh,k=>k[Ht.refresh]({scope:K})),browseFs:K=>L(Ht.browseFs,k=>k[Ht.browseFs]({path:K})),subscribeSnapshot:K=>se(k=>k[Ht.snapshot]({}).pipe(gx(Tj)),K,k=>Math.max(t.snapshotStaleFloorMs??9e4,k.intervalMs*3)),subscribeConfig:K=>se(k=>k[Ht.config]({}).pipe(gx(Yu)),K),async close(){if(w)return;w=!0,E("closed"),P();const K=[...c].map(_);c.clear();const k=l;l=null,await(h==null?void 0:h.dispose().catch(()=>{})),await Promise.all(K),await(k==null?void 0:k.runtime.dispose().catch(()=>{})),await(d==null?void 0:d.catch(()=>{})),h=null,d=null,p=null}}}let nm=null;const sp=new Set;function Nj(e,t,n){const o=new URLSearchParams(t);o.delete("tokmonToken");let i=n.replace(/^#/,"");if(!i.startsWith("/"))i=new URLSearchParams(i).has("tokmonToken")?"/":i;else{const d=i.indexOf("#");if(d!==-1){const p=new URLSearchParams(i.slice(d+1));p.has("tokmonToken")&&(p.delete("tokmonToken"),i=`${i.slice(0,d)}${p.size?`#${p.toString()}`:""}`)}const h=i.indexOf("?");if(h!==-1){const p=new URLSearchParams(i.slice(h+1));p.delete("tokmonToken"),i=`${i.slice(0,h)}${p.size?`?${p.toString()}`:""}`}}const c=o.size?`?${o.toString()}`:"",l=i?`#${i}`:"";return`${e}${c}${l}`}if(typeof window<"u"){const e=`${window.location.pathname}${window.location.search}${window.location.hash}`,t=Nj(window.location.pathname,window.location.search,window.location.hash);t!==e&&window.history.replaceState(window.history.state,"",t)}function Dj(e){for(const t of sp)t(e)}function jj(e){e!=="closed"&&Dj(e)}function Ts(){return nm||(nm=Oj(window.location.origin,{transport:"browser",onConn:jj})),nm}function $j(e){return sp.add(e),()=>{sp.delete(e)}}function Uj(){const[e,t]=Y.useState(null),[n,o]=Y.useState("connecting"),i=Y.useRef(null);return Y.useEffect(()=>{let c=!1,l=null;const d=Ts();return l=$j(h=>{c||o(h)}),i.current=d.subscribeSnapshot(h=>{c||(t(h),o("live"))}),()=>{var h;c=!0,l==null||l(),(h=i.current)==null||h.call(i),i.current=null}},[]),{snapshot:e,conn:n}}function Es(e){return{...e,config:l1(e.config).config}}async function Bj(){return Es(await Ts().getConfig())}async function op(e,t,n=Ts()){return Es(await n.setConfig({config:e,expectedRevision:t}))}async function zj(e,t=Ts()){const n=Es(e),o=!n.config.privacyMode;try{return await op({...n.config,privacyMode:o},n.config.revision,t)}catch(i){const c=wp(i).conflictState;if(!c)throw i;const l=Es(c);return l.config.privacyMode===o?l:op({...l.config,privacyMode:o},l.config.revision,t)}}async function Vj(e,t,n=Ts()){const o=Es(e),i=c=>op({...c.config,appearance:{...c.config.appearance,mode:t}},c.config.revision,n);try{return await i(o)}catch(c){const l=wp(c).conflictState;if(!l)throw c;const d=Es(l);return d.config.appearance.mode===t?d:i(d)}}function qj(e){const t=wp(e).conflictState;return t?Es(t):null}async function _6(e){return Ts().browseFs(e)}function U_(e){return Ts().subscribeConfig(t=>{e(Es(t))})}async function Wj(){return Ts().refresh("all")}function Hj(e){if(e.key.toLowerCase()!=="r"||e.metaKey||e.ctrlKey||e.altKey)return!1;const t=e.target;return t?t.isContentEditable?!1:!t.tagName||!["INPUT","TEXTAREA","SELECT"].includes(t.tagName):!0}const Kj="tokmon-theme-cache-v1",Qj=1,Jj={canvas:"--color-bg-0",panel:"--color-bg-1",inset:"--color-bg-2",insetStrong:"--color-bg-3",line:"--color-line",lineStrong:"--color-line-2",lineFaint:"--color-line-faint",text:"--color-fg",textDim:"--color-fg-dim",textFaint:"--color-fg-faint",textStrong:"--color-fg-bright",accent:"--color-accent",cost:"--color-cost",positive:"--color-positive",ok:"--color-ok",warn:"--color-warning",crit:"--color-critical",unknown:"--color-unknown",card:"--color-card",cardHover:"--color-card-hover",divider:"--color-divider",track:"--color-track",accentTint:"--color-accent-tint",accentOn:"--color-accent-on",focusRing:"--color-focus-ring"};function Gj(e,t){const n=a1(e,t?"dark":"light");return{appearance:e,...n}}function B_(e){return Object.fromEntries(Object.entries(Jj).map(([t,n])=>[n,e[t]]))}function Yj(e,t){e.classList.toggle("light",t.mode==="light"),e.classList.toggle("dark",t.mode==="dark"),e.dataset.themeMode=t.mode,e.dataset.themePreset=t.appearance.preset;for(const[n,o]of Object.entries(B_(t.tokens)))e.style.setProperty(n,o)}function Xj(e){return JSON.stringify({version:Qj,mode:e.mode,preset:e.appearance.preset,vars:B_(e.tokens)})}function Zj(e,t){var n,o;document.documentElement.style.colorScheme=e,(n=document.querySelector('meta[name="color-scheme"]'))==null||n.setAttribute("content",e),(o=document.querySelector('meta[name="theme-color"]'))==null||o.setAttribute("content",t)}function e$(e){try{localStorage.setItem(Kj,Xj(e))}catch{}}function t$(e){return e==="auto"?"light":e==="light"?"dark":"auto"}function C6(e){return e.preset!=="custom"||!e.custom?[]:["light","dark"].flatMap(t=>{var d;const n=((d=e.custom)==null?void 0:d[t])??{},i=Object.entries(n).filter(h=>er(h[1])===null).map(([h])=>({mode:t,keys:[h],message:"Use #RRGGBB."})),c=Object.fromEntries(Object.entries(n).filter(([,h])=>er(h)!==null)),l=a1({...e,preset:"custom",mode:t,custom:{base:e.custom.base,light:{},dark:{}}},t).tokens;for(const h of o1({...l,...c}))i.push({mode:t,keys:[h.foreground,h.background],message:`${h.foreground} needs ${h.minimum}:1 contrast on ${h.background}.`});return i})}const z_=Y.createContext(null);function n$(e){const t=window.matchMedia("(prefers-color-scheme: dark)"),n=o=>e(o.matches);return t.addEventListener("change",n),e(t.matches),()=>t.removeEventListener("change",n)}function r$({children:e}){const[t,n]=Y.useState(null),[o,i]=Y.useState(null),[c,l]=Y.useState(()=>window.matchMedia("(prefers-color-scheme: dark)").matches),d=Y.useRef(null),h=Y.useCallback(w=>{d.current=w,n(w)},[]);Y.useEffect(()=>n$(l),[]),Y.useEffect(()=>{let w=!0;Bj().then(E=>{w&&h(E)}).catch(()=>{});const S=U_(E=>{w&&h(E)});return()=>{w=!1,S()}},[h]);const p=o??(t==null?void 0:t.config.appearance)??oi,y=Y.useMemo(()=>Gj(p,c),[p,c]);Y.useEffect(()=>{!t&&!o||(Yj(document.documentElement,y),Zj(y.mode,y.tokens.canvas),o||e$(y))},[o,y,t]);const g=Y.useCallback(async()=>{const w=d.current;if(!w)return;const S=t$(w.config.appearance.mode);try{h(await Vj(w,S))}catch{}},[h]),v=Y.useMemo(()=>({appearance:p,resolved:y,ready:t!==null,setPreview:i,commit:w=>{i(null),h(w)},toggleMode:g}),[h,p,y,t,g]);return F.jsx(z_.Provider,{value:v,children:e})}function s$(){const e=Y.useContext(z_);if(!e)throw new Error("useTheme must be used inside ThemeProvider");return e}const Gx=[100,86,72,58,46,92,78,64,52,82,68,56];function ip(e){return`color-mix(in oklab, var(--color-accent) ${Gx[e%Gx.length]}%, var(--color-fg-dim))`}function V_(e){return e==="phosphor"}function b6(e,t,n){return V_(e)?ip(t):n}function o$(e,t){return V_(t.preset)?{...e,byProvider:e.byProvider.map((n,o)=>({...n,color:ip(o)})),byModel:e.byModel.map((n,o)=>({...n,color:ip(o)}))}:e}const q_=()=>Promise.all([yr(()=>import("./overview-DXA_HAsw.js"),__vite__mapDeps([4,5]),import.meta.url),yr(()=>import("./timeline-CzC85trW.js"),__vite__mapDeps([6,2,5,3]),import.meta.url)]).then(([e])=>e),W_=()=>Promise.all([yr(()=>import("./analytics-B6QwqU9g.js"),__vite__mapDeps([7,5]),import.meta.url),yr(()=>import("./breakdown-DYnVKScr.js"),__vite__mapDeps([8,2,5]),import.meta.url),yr(()=>import("./timeline-CzC85trW.js"),__vite__mapDeps([6,2,5,3]),import.meta.url)]).then(([e])=>e),H_=()=>Promise.all([yr(()=>import("./models-8B4FBxr7.js"),__vite__mapDeps([9,5]),import.meta.url),yr(()=>import("./breakdown-DYnVKScr.js"),__vite__mapDeps([8,2,5]),import.meta.url)]).then(([e])=>e),K_=()=>yr(()=>import("./explore-P2EolJrt.js"),__vite__mapDeps([10,5]),import.meta.url),i$={overview:q_,analytics:W_,models:H_,explore:K_},a$=Y.lazy(()=>q_().then(e=>({default:e.OverviewTab}))),c$=Y.lazy(()=>W_().then(e=>({default:e.AnalyticsTab}))),u$=Y.lazy(()=>H_().then(e=>({default:e.ModelsTab}))),l$=Y.lazy(()=>K_().then(e=>({default:e.ExploreTab}))),f$=Y.lazy(()=>yr(()=>import("./settings-sheet-CJJl-3Gw.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>({default:e.SettingsSheet}))),Yx=e=>{i$[e]()},ap=e=>`/${e}`,Q_=Y.createContext(null),xf=()=>{const e=Y.useContext(Q_);if(!e)throw new Error("useDashboard outside provider");return e};function d$(){var le,Fe;const{snapshot:e,conn:t}=Uj(),[n,o]=C4(),i=s$(),[c,l]=Y.useState(!1),[d,h]=Y.useState(bn.privacyMode),[p,y]=Y.useState(bn.privacyToggleKey),[g,v]=Y.useState(bn.allowNetworkAccess),[w,S]=Y.useState(bn.resetDisplay),[E,P]=Y.useState("idle"),H=Y.useRef(null),_=Y.useRef(null),O=Y.useRef(null),C=Y.useRef(null),D=Y.useRef(null),T=Y.useCallback(fe=>{O.current=fe,h(C.current??fe.config.privacyMode),y(fe.config.privacyToggleKey),v(fe.config.allowNetworkAccess),S(fe.config.resetDisplay)},[]);Y.useEffect(()=>{if(t==="live")return U_(T)},[T,t]);const L=Y.useCallback(()=>{if(H.current)return;D.current&&clearTimeout(D.current),P("refreshing");const fe=Wj().then(()=>P("success")).catch(()=>P("error")).finally(()=>{H.current=null,D.current=setTimeout(()=>P("idle"),3e3)});H.current=fe},[]),$=Y.useCallback(()=>{if(_.current)return;const fe=O.current;if(!fe)return;const xe=!fe.config.privacyMode;C.current=xe,h(xe);const be=zj(fe).then(Ve=>{C.current=null,T(Ve)}).catch(Ve=>{C.current=null;const on=qj(Ve);T(on??O.current??fe)}).finally(()=>{_.current=null});_.current=be.then(()=>{})},[T]);Y.useEffect(()=>{if(t!=="live"||c)return;const fe=xe=>{if(TD(xe,p)){xe.preventDefault(),$();return}Hj(xe)&&(xe.preventDefault(),L())};return window.addEventListener("keydown",fe),()=>window.removeEventListener("keydown",fe)},[t,p,$,L,c]),Y.useEffect(()=>()=>{D.current&&clearTimeout(D.current)},[]);const q=Y.useMemo(()=>XD(e,n),[e,n]),ee=Y.useMemo(()=>o$(q,i.appearance),[q,i.appearance]),se=((le=Ag.find(fe=>fe.key===n.period))==null?void 0:le.label)??n.period,K=n.period==="all"?void 0:se,k=xF({select:fe=>fe.location.pathname}),U=((Fe=Fx.find(fe=>ap(fe.key)===k))==null?void 0:Fe.key)??"overview";Y.useEffect(()=>{var on;if(!e)return;const fe=new Set(e.providers.map(xn=>xn.id)),xe=new Set(e.accounts.map(xn=>xn.id)),be=new Set;for(const xn of e.accounts)for(const br of((on=xn.table)==null?void 0:on.monthly)??[])for(const Wr of br.breakdown)be.add(Wr.name);const Ve=x4(n,{providers:fe,accounts:xe,models:be,modelsReady:be.size>0});Ve!==n&&o(Ve)},[e,n,o]);const V=(e==null?void 0:e.accounts.filter(fe=>fe.hasUsage))??[],J=V.length>0,B=((e==null?void 0:e.accounts)??[]).some(Jm),X=((e==null?void 0:e.accounts)??[]).some(fe=>fe.hasBilling&&!Jm(fe)),ne=J&&V.every(fe=>fe.table!=null),te=Y.useRef(!1);Y.useEffect(()=>{ne&&(te.current=!0)},[ne]);const[I,Z]=Y.useState(!1);Y.useEffect(()=>{const fe=setTimeout(()=>Z(!0),12e3);return()=>clearTimeout(fe)},[]);const pe=!J||ne||te.current||I,me=Y.useMemo(()=>e?{snapshot:e,filters:n,derived:ee,periodLabel:se,scopeLabel:K,privacyMode:d,resetDisplay:w}:null,[e,n,ee,se,K,d,w]);return F.jsxs("div",{className:"min-h-screen",children:[F.jsx("button",{type:"button",onClick:g4,className:"fixed left-3 top-3 z-[100] -translate-y-20 rounded bg-bg-2 px-3 py-2 text-sm text-fg-bright shadow-lg transition-transform focus-visible:translate-y-0 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",children:"Skip to dashboard"}),F.jsxs("header",{className:"relative z-30 border-b border-line bg-bg-0/80 backdrop-blur",children:[F.jsxs("div",{className:"mx-auto max-w-[1600px] px-5 2xl:max-w-[1920px]",children:[F.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2 py-3.5",children:[F.jsx("h1",{className:"font-display text-2xl text-fg-bright",children:"TOKMON"}),F.jsxs("span",{className:"hidden text-sm text-fg-faint sm:inline",children:["~/usage ",F.jsx("span",{className:"text-prompt",children:"$"})," ",F.jsx("span",{className:"text-fg-dim",children:U}),F.jsx("span",{className:"cursor-blink text-accent",children:"▋"})]}),F.jsxs("div",{className:"ml-auto flex min-w-0 items-center gap-3",children:[(e==null?void 0:e.peak)&&F.jsx(S4,{peak:e.peak,resetDisplay:w,tz:e.tz}),F.jsx(p4,{conn:t,freshAt:(e==null?void 0:e.generatedAt)??null}),t==="live"&&F.jsx(v4,{phase:E,onRefresh:L}),t==="live"&&F.jsx(y4,{onOpen:()=>l(!0)}),F.jsx(m4,{mode:i.appearance.mode,resolvedMode:i.resolved.mode,disabled:!i.ready||n1(i.appearance.preset),onToggle:()=>{i.toggleMode()}}),pe&&(J||B)&&F.jsx(d4,{derived:ee,periodLabel:se,tz:(e==null?void 0:e.tz)??"",version:(e==null?void 0:e.version)??""})]})]}),F.jsx("nav",{className:"-mb-px flex items-center gap-1 overflow-x-auto","aria-label":"Dashboard sections",children:Fx.map(fe=>F.jsx(gp,{to:ap(fe.key),"aria-current":U===fe.key?"page":void 0,onMouseEnter:()=>Yx(fe.key),onFocus:()=>Yx(fe.key),className:`relative shrink-0 border-b-2 px-3 py-2 font-display text-xs uppercase tracking-wider transition focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-accent ${U===fe.key?"border-accent text-fg-bright":"border-transparent text-fg-faint hover:text-fg-dim"}`,children:fe.label},fe.key))})]}),F.jsx(c4,{snapshot:e,derived:ee,filters:n,setFilters:o,privacyMode:d})]}),F.jsxs("main",{id:"dashboard-content",tabIndex:-1,className:"mx-auto max-w-[1600px] px-5 2xl:max-w-[1920px] py-5 focus:outline-none",children:[g&&F.jsx("div",{className:"mb-4 rounded border border-critical/60 bg-critical/10 px-3 py-2 text-xs text-critical",role:"alert",children:"Unsafe network access is enabled. This dashboard may be reachable from your LAN after the daemon restarts."}),e&&t!=="live"&&F.jsx("div",{className:"mb-4 rounded border border-line bg-bg-1 px-3 py-2 text-xs text-fg-dim",role:"status","aria-live":"polite",children:Kh(t,"Reconnecting…")}),(e==null?void 0:e.seeded)&&F.jsxs("div",{className:"mb-4 flex items-center gap-2 rounded border border-line bg-bg-1 px-3 py-1.5 text-xs text-fg-dim",role:"status","aria-live":"polite",children:[F.jsx("span",{className:"inline-flex size-2 rounded-full",style:{background:"var(--color-cost)"},"aria-hidden":!0}),"showing cached data — refreshing…"]}),e?!J&&!B?X&&!I&&t!=="error"?F.jsx(Hh,{label:"reading billing…"}):F.jsx("div",{className:"rounded-md border border-line bg-bg-1 p-8 text-center text-sm text-fg-dim",children:"No providers detected. Open tokmon, enable a provider, then refresh."}):!pe||!me?F.jsx(Hh,{label:Kh(t,"reading usage history…")}):F.jsx(Q_.Provider,{value:me,children:F.jsx(e1,{})}):F.jsx(Hh,{label:Kh(t,"reading usage…")})]}),F.jsxs("footer",{className:"mx-auto max-w-[1600px] px-5 2xl:max-w-[1920px] py-6 text-center text-[11px] text-fg-faint",children:["tokmon",e!=null&&e.version?` v${e.version}`:""," · by David Ilie · live LLM usage dashboard"]}),c?F.jsx(Y.Suspense,{fallback:F.jsx("div",{className:"fixed inset-0 z-[60] grid place-items-center bg-bg-0/70 text-sm text-fg-dim",role:"status","aria-live":"polite",children:"Opening settings…"}),children:F.jsx(f$,{snapshot:e,onClose:()=>l(!1)})}):null]})}function Xx(){const{derived:e,periodLabel:t,scopeLabel:n,snapshot:o,privacyMode:i,resetDisplay:c}=xf();return F.jsx(Y.Suspense,{fallback:F.jsx(wf,{label:"overview"}),children:F.jsx(a$,{derived:e,periodLabel:t,scopeLabel:n,providers:o.providers,privacyMode:i,resetDisplay:c,tz:o.tz})})}function h$(){const{derived:e,scopeLabel:t}=xf();return F.jsx(Y.Suspense,{fallback:F.jsx(wf,{label:"analytics"}),children:F.jsx(c$,{derived:e,scopeLabel:t})})}function m$(){const{derived:e,scopeLabel:t}=xf();return F.jsx(Y.Suspense,{fallback:F.jsx(wf,{label:"models"}),children:F.jsx(u$,{derived:e,scopeLabel:t})})}function p$(){const{snapshot:e,filters:t,periodLabel:n,privacyMode:o}=xf();return F.jsx(Y.Suspense,{fallback:F.jsx(wf,{label:"explore"}),children:F.jsx(l$,{snapshot:e,filters:t,periodLabel:n,privacyMode:o})})}function wf({label:e}){return F.jsxs("div",{className:"min-h-[50vh] content-center text-center text-sm text-fg-faint",role:"status","aria-live":"polite",children:["Loading ",e,"…"]})}const cp=rF({component:d$}),Ou=(e,t)=>Yw({getParentRoute:()=>cp,path:ap(e),component:t}),g$=cp.addChildren([Yw({getParentRoute:()=>cp,path:"/",component:Xx}),Ou("overview",Xx),Ou("analytics",h$),Ou("models",m$),Ou("explore",p$)]),y$=gF({routeTree:g$,history:dP(),defaultViewTransition:!0});function v$(){return F.jsx(SF,{router:y$})}const Zx="tokmon.preloadReloadAt",S$=3e4;function x$(e,t){return!Number.isFinite(e)||t-e>=S$}function w$(){const e=t=>{t.preventDefault();let n=Number.NaN;try{n=Number(window.sessionStorage.getItem(Zx))}catch{}const o=Date.now();if(x$(n,o)){try{window.sessionStorage.setItem(Zx,String(o))}catch{}window.location.reload()}};return window.addEventListener("vite:preloadError",e),()=>window.removeEventListener("vite:preloadError",e)}w$();t2.createRoot(document.getElementById("root")).render(F.jsx(Y.StrictMode,{children:F.jsx(C2,{children:F.jsx(r$,{children:F.jsx(f4,{children:F.jsx(v$,{})})})})}));export{F$ as $,zD as A,qD as B,l6 as C,Tg as D,E6 as E,kr as F,u6 as G,E_ as H,o6 as I,l4 as J,ZD as K,g6 as L,c6 as M,f6 as N,gS as O,Cx as P,A$ as Q,Ia as R,w6 as S,e6 as T,Fu as U,T$ as V,M$ as W,t4 as X,BF as Y,zF as Z,yr as _,V_ as a,X$ as a0,d6 as a1,I$ as a2,P$ as a3,x6 as a4,e4 as a5,S6 as a6,v6 as a7,o4 as a8,R$ as a9,E$ as aA,y6 as aa,b$ as ab,_6 as ac,p6 as ad,OF as ae,c1 as af,LF as ag,_$ as ah,C$ as ai,a1 as aj,C6 as ak,n1 as al,dS as am,_F as an,EF as ao,vp as ap,er as aq,N$ as ar,Bj as as,U_ as at,op as au,wp as av,Gj as aw,B_ as ax,h6 as ay,m6 as az,r6 as b,s6 as c,b6 as d,KF as e,t6 as f,L$ as g,Ex as h,i4 as i,F as j,jD as k,a6 as l,n6 as m,a4 as n,UD as o,Z$ as p,Cl as q,Y as r,O$ as s,bl as t,s$ as u,k6 as v,LD as w,Kb as x,i6 as y,w_ as z};
|