tokmon 0.23.0 → 0.23.2
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/README.md +2 -1
- package/dist/{bootstrap-ink-UD3KDTOB.js → bootstrap-ink-MBN74IBQ.js} +161 -100
- package/dist/{chunk-PGQK7MOE.js → chunk-2AFQKH5O.js} +5 -1
- package/dist/{chunk-HV6AYQDB.js → chunk-RM3ZE44Z.js} +1 -0
- package/dist/{chunk-AON6GE7D.js → chunk-VVJF5H4D.js} +69 -20
- package/dist/cli.js +4 -4
- package/dist/{daemon-AW3YHFSJ.js → daemon-F556JO7S.js} +3 -3
- package/dist/{daemon-handle-EYAXNNKZ.js → daemon-handle-4F4TXGXJ.js} +45 -8
- package/dist/{server-4CDZMLH6.js → server-GBB3CR7Y.js} +2 -2
- package/dist/web/assets/{Area-DGo9K-U3.js → Area-C-Zb5hGY.js} +1 -1
- package/dist/web/assets/{analytics-BOhbhV5Z.js → analytics-kEeE-ogR.js} +2 -2
- package/dist/web/assets/{breakdown-CO04nSN-.js → breakdown-BavE2T8a.js} +1 -1
- package/dist/web/assets/{chart-bNxdfXxA.js → chart-QgM4f2g9.js} +1 -1
- package/dist/web/assets/{explore-sZnmjzAj.js → explore-Buh9XEPv.js} +1 -1
- package/dist/web/assets/index-KD8LkaQs.js +83 -0
- package/dist/web/assets/{models-Cl6D8VVF.js → models-BRG0KFKx.js} +2 -2
- package/dist/web/assets/{overview-C18nvaAK.js → overview-JbfGEJ5u.js} +2 -2
- package/dist/web/assets/{panel-DTjMnHaz.js → panel-OcuPqv_k.js} +1 -1
- package/dist/web/assets/{primitives-Dj_9YxTF.js → primitives-BUmlNFB0.js} +1 -1
- package/dist/web/assets/{settings-sheet-0BGb5Ahv.js → settings-sheet-DVstI_qi.js} +1 -1
- package/dist/web/assets/{share-sheet-BHtt-OmT.js → share-sheet-qAODWbhh.js} +1 -1
- package/dist/web/assets/{timeline-DmzB8Z3W.js → timeline-DoJ5qjNr.js} +1 -1
- package/dist/web/assets/{use-dialog-trap-DeXFtxx8.js → use-dialog-trap-9cAy7Dfu.js} +1 -1
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
- package/dist/web/assets/index-DnDr1VUr.js +0 -83
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./share-sheet-BHtt-OmT.js","./primitives-Dj_9YxTF.js","./chart-bNxdfXxA.js","./Area-DGo9K-U3.js","./use-dialog-trap-DeXFtxx8.js","./overview-C18nvaAK.js","./panel-DTjMnHaz.js","./timeline-DmzB8Z3W.js","./analytics-BOhbhV5Z.js","./breakdown-CO04nSN-.js","./models-Cl6D8VVF.js","./explore-sZnmjzAj.js","./settings-sheet-0BGb5Ahv.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var KC=Object.defineProperty;var QC=(e,t,n)=>t in e?KC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var M=(e,t,n)=>QC(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 u of i)if(u.type==="childList")for(const l of u.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&o(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const u={};return i.integrity&&(u.integrity=i.integrity),i.referrerPolicy&&(u.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?u.credentials="include":i.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(i){if(i.ep)return;i.ep=!0;const u=n(i);fetch(i.href,u)}})();var mF=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function JC(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Bd={exports:{}},Xi={},Vd={exports:{}},Ie={};/**
|
|
3
|
-
* @license React
|
|
4
|
-
* react.production.min.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var Xy;function GC(){if(Xy)return Ie;Xy=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"),u=Symbol.for("react.provider"),l=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),h=Symbol.iterator;function v(T){return T===null||typeof T!="object"?null:(T=h&&T[h]||T["@@iterator"],typeof T=="function"?T:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,k={};function b(T,J,me){this.props=T,this.context=J,this.refs=k,this.updater=me||x}b.prototype.isReactComponent={},b.prototype.setState=function(T,J){if(typeof T!="object"&&typeof T!="function"&&T!=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,T,J,"setState")},b.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function B(){}B.prototype=b.prototype;function _(T,J,me){this.props=T,this.context=J,this.refs=k,this.updater=me||x}var A=_.prototype=new B;A.constructor=_,w(A,b.prototype),A.isPureReactComponent=!0;var P=Array.isArray,L=Object.prototype.hasOwnProperty,F={current:null},$={key:!0,ref:!0,__self:!0,__source:!0};function D(T,J,me){var he,le={},_e=null,Ne=null;if(J!=null)for(he in J.ref!==void 0&&(Ne=J.ref),J.key!==void 0&&(_e=""+J.key),J)L.call(J,he)&&!$.hasOwnProperty(he)&&(le[he]=J[he]);var ke=arguments.length-2;if(ke===1)le.children=me;else if(1<ke){for(var be=Array(ke),at=0;at<ke;at++)be[at]=arguments[at+2];le.children=be}if(T&&T.defaultProps)for(he in ke=T.defaultProps,ke)le[he]===void 0&&(le[he]=ke[he]);return{$$typeof:e,type:T,key:_e,ref:Ne,props:le,_owner:F.current}}function W(T,J){return{$$typeof:e,type:T.type,key:J,ref:T.ref,props:T.props,_owner:T._owner}}function X(T){return typeof T=="object"&&T!==null&&T.$$typeof===e}function Z(T){var J={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(me){return J[me]})}var ue=/\/+/g;function C(T,J){return typeof T=="object"&&T!==null&&T.key!=null?Z(""+T.key):J.toString(36)}function H(T,J,me,he,le){var _e=typeof T;(_e==="undefined"||_e==="boolean")&&(T=null);var Ne=!1;if(T===null)Ne=!0;else switch(_e){case"string":case"number":Ne=!0;break;case"object":switch(T.$$typeof){case e:case t:Ne=!0}}if(Ne)return Ne=T,le=le(Ne),T=he===""?"."+C(Ne,0):he,P(le)?(me="",T!=null&&(me=T.replace(ue,"$&/")+"/"),H(le,J,me,"",function(at){return at})):le!=null&&(X(le)&&(le=W(le,me+(!le.key||Ne&&Ne.key===le.key?"":(""+le.key).replace(ue,"$&/")+"/")+T)),J.push(le)),1;if(Ne=0,he=he===""?".":he+":",P(T))for(var ke=0;ke<T.length;ke++){_e=T[ke];var be=he+C(_e,ke);Ne+=H(_e,J,me,be,le)}else if(be=v(T),typeof be=="function")for(T=be.call(T),ke=0;!(_e=T.next()).done;)_e=_e.value,be=he+C(_e,ke++),Ne+=H(_e,J,me,be,le);else if(_e==="object")throw J=String(T),Error("Objects are not valid as a React child (found: "+(J==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":J)+"). If you meant to render a collection of children, use an array instead.");return Ne}function Y(T,J,me){if(T==null)return T;var he=[],le=0;return H(T,he,"","",function(_e){return J.call(me,_e,le++)}),he}function Q(T){if(T._status===-1){var J=T._result;J=J(),J.then(function(me){(T._status===0||T._status===-1)&&(T._status=1,T._result=me)},function(me){(T._status===0||T._status===-1)&&(T._status=2,T._result=me)}),T._status===-1&&(T._status=0,T._result=J)}if(T._status===1)return T._result.default;throw T._result}var z={current:null},G={transition:null},se={ReactCurrentDispatcher:z,ReactCurrentBatchConfig:G,ReactCurrentOwner:F};function ee(){throw Error("act(...) is not supported in production builds of React.")}return Ie.Children={map:Y,forEach:function(T,J,me){Y(T,function(){J.apply(this,arguments)},me)},count:function(T){var J=0;return Y(T,function(){J++}),J},toArray:function(T){return Y(T,function(J){return J})||[]},only:function(T){if(!X(T))throw Error("React.Children.only expected to receive a single React element child.");return T}},Ie.Component=b,Ie.Fragment=n,Ie.Profiler=i,Ie.PureComponent=_,Ie.StrictMode=o,Ie.Suspense=m,Ie.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=se,Ie.act=ee,Ie.cloneElement=function(T,J,me){if(T==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+T+".");var he=w({},T.props),le=T.key,_e=T.ref,Ne=T._owner;if(J!=null){if(J.ref!==void 0&&(_e=J.ref,Ne=F.current),J.key!==void 0&&(le=""+J.key),T.type&&T.type.defaultProps)var ke=T.type.defaultProps;for(be in J)L.call(J,be)&&!$.hasOwnProperty(be)&&(he[be]=J[be]===void 0&&ke!==void 0?ke[be]:J[be])}var be=arguments.length-2;if(be===1)he.children=me;else if(1<be){ke=Array(be);for(var at=0;at<be;at++)ke[at]=arguments[at+2];he.children=ke}return{$$typeof:e,type:T.type,key:le,ref:_e,props:he,_owner:Ne}},Ie.createContext=function(T){return T={$$typeof:l,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},T.Provider={$$typeof:u,_context:T},T.Consumer=T},Ie.createElement=D,Ie.createFactory=function(T){var J=D.bind(null,T);return J.type=T,J},Ie.createRef=function(){return{current:null}},Ie.forwardRef=function(T){return{$$typeof:d,render:T}},Ie.isValidElement=X,Ie.lazy=function(T){return{$$typeof:y,_payload:{_status:-1,_result:T},_init:Q}},Ie.memo=function(T,J){return{$$typeof:g,type:T,compare:J===void 0?null:J}},Ie.startTransition=function(T){var J=G.transition;G.transition={};try{T()}finally{G.transition=J}},Ie.unstable_act=ee,Ie.useCallback=function(T,J){return z.current.useCallback(T,J)},Ie.useContext=function(T){return z.current.useContext(T)},Ie.useDebugValue=function(){},Ie.useDeferredValue=function(T){return z.current.useDeferredValue(T)},Ie.useEffect=function(T,J){return z.current.useEffect(T,J)},Ie.useId=function(){return z.current.useId()},Ie.useImperativeHandle=function(T,J,me){return z.current.useImperativeHandle(T,J,me)},Ie.useInsertionEffect=function(T,J){return z.current.useInsertionEffect(T,J)},Ie.useLayoutEffect=function(T,J){return z.current.useLayoutEffect(T,J)},Ie.useMemo=function(T,J){return z.current.useMemo(T,J)},Ie.useReducer=function(T,J,me){return z.current.useReducer(T,J,me)},Ie.useRef=function(T){return z.current.useRef(T)},Ie.useState=function(T){return z.current.useState(T)},Ie.useSyncExternalStore=function(T,J,me){return z.current.useSyncExternalStore(T,J,me)},Ie.useTransition=function(){return z.current.useTransition()},Ie.version="18.3.1",Ie}var Zy;function $a(){return Zy||(Zy=1,Vd.exports=GC()),Vd.exports}/**
|
|
11
|
-
* @license React
|
|
12
|
-
* react-jsx-runtime.production.min.js
|
|
13
|
-
*
|
|
14
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the MIT license found in the
|
|
17
|
-
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var ev;function YC(){if(ev)return Xi;ev=1;var e=$a(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function l(d,m,g){var y,h={},v=null,x=null;g!==void 0&&(v=""+g),m.key!==void 0&&(v=""+m.key),m.ref!==void 0&&(x=m.ref);for(y in m)o.call(m,y)&&!u.hasOwnProperty(y)&&(h[y]=m[y]);if(d&&d.defaultProps)for(y in m=d.defaultProps,m)h[y]===void 0&&(h[y]=m[y]);return{$$typeof:t,type:d,key:v,ref:x,props:h,_owner:i.current}}return Xi.Fragment=n,Xi.jsx=l,Xi.jsxs=l,Xi}var tv;function XC(){return tv||(tv=1,Bd.exports=YC()),Bd.exports}var I=XC(),te=$a();const ya=JC(te);var hc={},qd={exports:{}},rn={},Wd={exports:{}},Hd={};/**
|
|
19
|
-
* @license React
|
|
20
|
-
* scheduler.production.min.js
|
|
21
|
-
*
|
|
22
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
23
|
-
*
|
|
24
|
-
* This source code is licensed under the MIT license found in the
|
|
25
|
-
* LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/var nv;function ZC(){return nv||(nv=1,(function(e){function t(G,se){var ee=G.length;G.push(se);e:for(;0<ee;){var T=ee-1>>>1,J=G[T];if(0<i(J,se))G[T]=se,G[ee]=J,ee=T;else break e}}function n(G){return G.length===0?null:G[0]}function o(G){if(G.length===0)return null;var se=G[0],ee=G.pop();if(ee!==se){G[0]=ee;e:for(var T=0,J=G.length,me=J>>>1;T<me;){var he=2*(T+1)-1,le=G[he],_e=he+1,Ne=G[_e];if(0>i(le,ee))_e<J&&0>i(Ne,le)?(G[T]=Ne,G[_e]=ee,T=_e):(G[T]=le,G[he]=ee,T=he);else if(_e<J&&0>i(Ne,ee))G[T]=Ne,G[_e]=ee,T=_e;else break e}}return se}function i(G,se){var ee=G.sortIndex-se.sortIndex;return ee!==0?ee:G.id-se.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var l=Date,d=l.now();e.unstable_now=function(){return l.now()-d}}var m=[],g=[],y=1,h=null,v=3,x=!1,w=!1,k=!1,b=typeof setTimeout=="function"?setTimeout:null,B=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 A(G){for(var se=n(g);se!==null;){if(se.callback===null)o(g);else if(se.startTime<=G)o(g),se.sortIndex=se.expirationTime,t(m,se);else break;se=n(g)}}function P(G){if(k=!1,A(G),!w)if(n(m)!==null)w=!0,Q(L);else{var se=n(g);se!==null&&z(P,se.startTime-G)}}function L(G,se){w=!1,k&&(k=!1,B(D),D=-1),x=!0;var ee=v;try{for(A(se),h=n(m);h!==null&&(!(h.expirationTime>se)||G&&!Z());){var T=h.callback;if(typeof T=="function"){h.callback=null,v=h.priorityLevel;var J=T(h.expirationTime<=se);se=e.unstable_now(),typeof J=="function"?h.callback=J:h===n(m)&&o(m),A(se)}else o(m);h=n(m)}if(h!==null)var me=!0;else{var he=n(g);he!==null&&z(P,he.startTime-se),me=!1}return me}finally{h=null,v=ee,x=!1}}var F=!1,$=null,D=-1,W=5,X=-1;function Z(){return!(e.unstable_now()-X<W)}function ue(){if($!==null){var G=e.unstable_now();X=G;var se=!0;try{se=$(!0,G)}finally{se?C():(F=!1,$=null)}}else F=!1}var C;if(typeof _=="function")C=function(){_(ue)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,Y=H.port2;H.port1.onmessage=ue,C=function(){Y.postMessage(null)}}else C=function(){b(ue,0)};function Q(G){$=G,F||(F=!0,C())}function z(G,se){D=b(function(){G(e.unstable_now())},se)}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(G){G.callback=null},e.unstable_continueExecution=function(){w||x||(w=!0,Q(L))},e.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):W=0<G?Math.floor(1e3/G):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return n(m)},e.unstable_next=function(G){switch(v){case 1:case 2:case 3:var se=3;break;default:se=v}var ee=v;v=se;try{return G()}finally{v=ee}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(G,se){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var ee=v;v=G;try{return se()}finally{v=ee}},e.unstable_scheduleCallback=function(G,se,ee){var T=e.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?T+ee:T):ee=T,G){case 1:var J=-1;break;case 2:J=250;break;case 5:J=1073741823;break;case 4:J=1e4;break;default:J=5e3}return J=ee+J,G={id:y++,callback:se,priorityLevel:G,startTime:ee,expirationTime:J,sortIndex:-1},ee>T?(G.sortIndex=ee,t(g,G),n(m)===null&&G===n(g)&&(k?(B(D),D=-1):k=!0,z(P,ee-T))):(G.sortIndex=J,t(m,G),w||x||(w=!0,Q(L))),G},e.unstable_shouldYield=Z,e.unstable_wrapCallback=function(G){var se=v;return function(){var ee=v;v=se;try{return G.apply(this,arguments)}finally{v=ee}}}})(Hd)),Hd}var rv;function eP(){return rv||(rv=1,Wd.exports=ZC()),Wd.exports}/**
|
|
27
|
-
* @license React
|
|
28
|
-
* react-dom.production.min.js
|
|
29
|
-
*
|
|
30
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
31
|
-
*
|
|
32
|
-
* This source code is licensed under the MIT license found in the
|
|
33
|
-
* LICENSE file in the root directory of this source tree.
|
|
34
|
-
*/var sv;function tP(){if(sv)return rn;sv=1;var e=$a(),t=eP();function n(r){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+r,a=1;a<arguments.length;a++)s+="&args[]="+encodeURIComponent(arguments[a]);return"Minified React error #"+r+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=new Set,i={};function u(r,s){l(r,s),l(r+"Capture",s)}function l(r,s){for(i[r]=s,r=0;r<s.length;r++)o.add(s[r])}var d=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),m=Object.prototype.hasOwnProperty,g=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,y={},h={};function v(r){return m.call(h,r)?!0:m.call(y,r)?!1:g.test(r)?h[r]=!0:(y[r]=!0,!1)}function x(r,s,a,c){if(a!==null&&a.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return c?!1:a!==null?!a.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function w(r,s,a,c){if(s===null||typeof s>"u"||x(r,s,a,c))return!0;if(c)return!1;if(a!==null)switch(a.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function k(r,s,a,c,f,p,S){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=c,this.attributeNamespace=f,this.mustUseProperty=a,this.propertyName=r,this.type=s,this.sanitizeURL=p,this.removeEmptyString=S}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){b[r]=new k(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var s=r[0];b[s]=new k(s,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){b[r]=new k(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){b[r]=new k(r,2,!1,r,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(r){b[r]=new k(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){b[r]=new k(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){b[r]=new k(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){b[r]=new k(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){b[r]=new k(r,5,!1,r.toLowerCase(),null,!1,!1)});var B=/[\-:]([a-z])/g;function _(r){return r[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(r){var s=r.replace(B,_);b[s]=new k(s,1,!1,r,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var s=r.replace(B,_);b[s]=new k(s,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var s=r.replace(B,_);b[s]=new k(s,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){b[r]=new k(r,1,!1,r.toLowerCase(),null,!1,!1)}),b.xlinkHref=new k("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){b[r]=new k(r,1,!1,r.toLowerCase(),null,!0,!0)});function A(r,s,a,c){var f=b.hasOwnProperty(s)?b[s]:null;(f!==null?f.type!==0:c||!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(w(s,a,f,c)&&(a=null),c||f===null?v(s)&&(a===null?r.removeAttribute(s):r.setAttribute(s,""+a)):f.mustUseProperty?r[f.propertyName]=a===null?f.type===3?!1:"":a:(s=f.attributeName,c=f.attributeNamespace,a===null?r.removeAttribute(s):(f=f.type,a=f===3||f===4&&a===!0?"":""+a,c?r.setAttributeNS(c,s,a):r.setAttribute(s,a))))}var P=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,L=Symbol.for("react.element"),F=Symbol.for("react.portal"),$=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),W=Symbol.for("react.profiler"),X=Symbol.for("react.provider"),Z=Symbol.for("react.context"),ue=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),Y=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),z=Symbol.for("react.offscreen"),G=Symbol.iterator;function se(r){return r===null||typeof r!="object"?null:(r=G&&r[G]||r["@@iterator"],typeof r=="function"?r:null)}var ee=Object.assign,T;function J(r){if(T===void 0)try{throw Error()}catch(a){var s=a.stack.trim().match(/\n( *(at )?)/);T=s&&s[1]||""}return`
|
|
35
|
-
`+T+r}var me=!1;function he(r,s){if(!r||me)return"";me=!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(K){var c=K}Reflect.construct(r,[],s)}else{try{s.call()}catch(K){c=K}r.call(s.prototype)}else{try{throw Error()}catch(K){c=K}r()}}catch(K){if(K&&c&&typeof K.stack=="string"){for(var f=K.stack.split(`
|
|
36
|
-
`),p=c.stack.split(`
|
|
37
|
-
`),S=f.length-1,E=p.length-1;1<=S&&0<=E&&f[S]!==p[E];)E--;for(;1<=S&&0<=E;S--,E--)if(f[S]!==p[E]){if(S!==1||E!==1)do if(S--,E--,0>E||f[S]!==p[E]){var R=`
|
|
38
|
-
`+f[S].replace(" at new "," at ");return r.displayName&&R.includes("<anonymous>")&&(R=R.replace("<anonymous>",r.displayName)),R}while(1<=S&&0<=E);break}}}finally{me=!1,Error.prepareStackTrace=a}return(r=r?r.displayName||r.name:"")?J(r):""}function le(r){switch(r.tag){case 5:return J(r.type);case 16:return J("Lazy");case 13:return J("Suspense");case 19:return J("SuspenseList");case 0:case 2:case 15:return r=he(r.type,!1),r;case 11:return r=he(r.type.render,!1),r;case 1:return r=he(r.type,!0),r;default:return""}}function _e(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 $:return"Fragment";case F:return"Portal";case W:return"Profiler";case D:return"StrictMode";case C:return"Suspense";case H:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case Z:return(r.displayName||"Context")+".Consumer";case X:return(r._context.displayName||"Context")+".Provider";case ue:var s=r.render;return r=r.displayName,r||(r=s.displayName||s.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case Y:return s=r.displayName||null,s!==null?s:_e(r.type)||"Memo";case Q:s=r._payload,r=r._init;try{return _e(r(s))}catch{}}return null}function Ne(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 _e(s);case 8:return s===D?"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 ke(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 at(r){var s=be(r)?"checked":"value",a=Object.getOwnPropertyDescriptor(r.constructor.prototype,s),c=""+r[s];if(!r.hasOwnProperty(s)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var f=a.get,p=a.set;return Object.defineProperty(r,s,{configurable:!0,get:function(){return f.call(this)},set:function(S){c=""+S,p.call(this,S)}}),Object.defineProperty(r,s,{enumerable:a.enumerable}),{getValue:function(){return c},setValue:function(S){c=""+S},stopTracking:function(){r._valueTracker=null,delete r[s]}}}}function yr(r){r._valueTracker||(r._valueTracker=at(r))}function Ss(r){if(!r)return!1;var s=r._valueTracker;if(!s)return!0;var a=s.getValue(),c="";return r&&(c=be(r)?r.checked?"true":"false":r.value),r=c,r!==a?(s.setValue(r),!0):!1}function xs(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 co(r,s){var a=s.checked;return ee({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:a??r._wrapperState.initialChecked})}function su(r,s){var a=s.defaultValue==null?"":s.defaultValue,c=s.checked!=null?s.checked:s.defaultChecked;a=ke(s.value!=null?s.value:a),r._wrapperState={initialChecked:c,initialValue:a,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function di(r,s){s=s.checked,s!=null&&A(r,"checked",s,!1)}function lo(r,s){di(r,s);var a=ke(s.value),c=s.type;if(a!=null)c==="number"?(a===0&&r.value===""||r.value!=a)&&(r.value=""+a):r.value!==""+a&&(r.value=""+a);else if(c==="submit"||c==="reset"){r.removeAttribute("value");return}s.hasOwnProperty("value")?ws(r,s.type,a):s.hasOwnProperty("defaultValue")&&ws(r,s.type,ke(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(r.defaultChecked=!!s.defaultChecked)}function vr(r,s,a){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var c=s.type;if(!(c!=="submit"&&c!=="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 ws(r,s,a){(s!=="number"||xs(r.ownerDocument)!==r)&&(a==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+a&&(r.defaultValue=""+a))}var hn=Array.isArray;function Nr(r,s,a,c){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&&c&&(r[a].defaultSelected=!0)}else{for(a=""+ke(a),s=null,f=0;f<r.length;f++){if(r[f].value===a){r[f].selected=!0,c&&(r[f].defaultSelected=!0);return}s!==null||r[f].disabled||(s=r[f])}s!==null&&(s.selected=!0)}}function fo(r,s){if(s.dangerouslySetInnerHTML!=null)throw Error(n(91));return ee({},s,{value:void 0,defaultValue:void 0,children:""+r._wrapperState.initialValue})}function ou(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(hn(a)){if(1<a.length)throw Error(n(93));a=a[0]}s=a}s==null&&(s=""),a=s}r._wrapperState={initialValue:ke(a)}}function hi(r,s){var a=ke(s.value),c=ke(s.defaultValue);a!=null&&(a=""+a,a!==r.value&&(r.value=a),s.defaultValue==null&&r.defaultValue!==a&&(r.defaultValue=a)),c!=null&&(r.defaultValue=""+c)}function $e(r){var s=r.textContent;s===r._wrapperState.initialValue&&s!==""&&s!==null&&(r.value=s)}function Ot(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 Un(r,s){return r==null||r==="http://www.w3.org/1999/xhtml"?Ot(s):r==="http://www.w3.org/2000/svg"&&s==="foreignObject"?"http://www.w3.org/1999/xhtml":r}var ho,dg=(function(r){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(s,a,c,f){MSApp.execUnsafeLocalFunction(function(){return r(s,a,c,f)})}:r})(function(r,s){if(r.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in r)r.innerHTML=s;else{for(ho=ho||document.createElement("div"),ho.innerHTML="<svg>"+s.valueOf().toString()+"</svg>",s=ho.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;s.firstChild;)r.appendChild(s.firstChild)}});function pi(r,s){if(s){var a=r.firstChild;if(a&&a===r.lastChild&&a.nodeType===3){a.nodeValue=s;return}}r.textContent=s}var mi={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},Y_=["Webkit","ms","Moz","O"];Object.keys(mi).forEach(function(r){Y_.forEach(function(s){s=s+r.charAt(0).toUpperCase()+r.substring(1),mi[s]=mi[r]})});function hg(r,s,a){return s==null||typeof s=="boolean"||s===""?"":a||typeof s!="number"||s===0||mi.hasOwnProperty(r)&&mi[r]?(""+s).trim():s+"px"}function pg(r,s){r=r.style;for(var a in s)if(s.hasOwnProperty(a)){var c=a.indexOf("--")===0,f=hg(a,s[a],c);a==="float"&&(a="cssFloat"),c?r.setProperty(a,f):r[a]=f}}var X_=ee({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 Zl(r,s){if(s){if(X_[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 tf=null;function nf(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var rf=null,po=null,mo=null;function mg(r){if(r=$i(r)){if(typeof rf!="function")throw Error(n(280));var s=r.stateNode;s&&(s=Iu(s),rf(r.stateNode,r.type,s))}}function gg(r){po?mo?mo.push(r):mo=[r]:po=r}function yg(){if(po){var r=po,s=mo;if(mo=po=null,mg(r),s)for(r=0;r<s.length;r++)mg(s[r])}}function vg(r,s){return r(s)}function Sg(){}var sf=!1;function xg(r,s,a){if(sf)return r(s,a);sf=!0;try{return vg(r,s,a)}finally{sf=!1,(po!==null||mo!==null)&&(Sg(),yg())}}function gi(r,s){var a=r.stateNode;if(a===null)return null;var c=Iu(a);if(c===null)return null;a=c[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":(c=!c.disabled)||(r=r.type,c=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!c;break e;default:r=!1}if(r)return null;if(a&&typeof a!="function")throw Error(n(231,s,typeof a));return a}var of=!1;if(d)try{var yi={};Object.defineProperty(yi,"passive",{get:function(){of=!0}}),window.addEventListener("test",yi,yi),window.removeEventListener("test",yi,yi)}catch{of=!1}function Z_(r,s,a,c,f,p,S,E,R){var K=Array.prototype.slice.call(arguments,3);try{s.apply(a,K)}catch(oe){this.onError(oe)}}var vi=!1,iu=null,au=!1,af=null,eE={onError:function(r){vi=!0,iu=r}};function tE(r,s,a,c,f,p,S,E,R){vi=!1,iu=null,Z_.apply(eE,arguments)}function nE(r,s,a,c,f,p,S,E,R){if(tE.apply(this,arguments),vi){if(vi){var K=iu;vi=!1,iu=null}else throw Error(n(198));au||(au=!0,af=K)}}function ks(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 wg(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 kg(r){if(ks(r)!==r)throw Error(n(188))}function rE(r){var s=r.alternate;if(!s){if(s=ks(r),s===null)throw Error(n(188));return s!==r?null:r}for(var a=r,c=s;;){var f=a.return;if(f===null)break;var p=f.alternate;if(p===null){if(c=f.return,c!==null){a=c;continue}break}if(f.child===p.child){for(p=f.child;p;){if(p===a)return kg(f),r;if(p===c)return kg(f),s;p=p.sibling}throw Error(n(188))}if(a.return!==c.return)a=f,c=p;else{for(var S=!1,E=f.child;E;){if(E===a){S=!0,a=f,c=p;break}if(E===c){S=!0,c=f,a=p;break}E=E.sibling}if(!S){for(E=p.child;E;){if(E===a){S=!0,a=p,c=f;break}if(E===c){S=!0,c=p,a=f;break}E=E.sibling}if(!S)throw Error(n(189))}}if(a.alternate!==c)throw Error(n(190))}if(a.tag!==3)throw Error(n(188));return a.stateNode.current===a?r:s}function _g(r){return r=rE(r),r!==null?Eg(r):null}function Eg(r){if(r.tag===5||r.tag===6)return r;for(r=r.child;r!==null;){var s=Eg(r);if(s!==null)return s;r=r.sibling}return null}var Cg=t.unstable_scheduleCallback,Pg=t.unstable_cancelCallback,sE=t.unstable_shouldYield,oE=t.unstable_requestPaint,ut=t.unstable_now,iE=t.unstable_getCurrentPriorityLevel,uf=t.unstable_ImmediatePriority,bg=t.unstable_UserBlockingPriority,uu=t.unstable_NormalPriority,aE=t.unstable_LowPriority,Ig=t.unstable_IdlePriority,cu=null,nr=null;function uE(r){if(nr&&typeof nr.onCommitFiberRoot=="function")try{nr.onCommitFiberRoot(cu,r,void 0,(r.current.flags&128)===128)}catch{}}var zn=Math.clz32?Math.clz32:fE,cE=Math.log,lE=Math.LN2;function fE(r){return r>>>=0,r===0?32:31-(cE(r)/lE|0)|0}var lu=64,fu=4194304;function Si(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 du(r,s){var a=r.pendingLanes;if(a===0)return 0;var c=0,f=r.suspendedLanes,p=r.pingedLanes,S=a&268435455;if(S!==0){var E=S&~f;E!==0?c=Si(E):(p&=S,p!==0&&(c=Si(p)))}else S=a&~f,S!==0?c=Si(S):p!==0&&(c=Si(p));if(c===0)return 0;if(s!==0&&s!==c&&(s&f)===0&&(f=c&-c,p=s&-s,f>=p||f===16&&(p&4194240)!==0))return s;if((c&4)!==0&&(c|=a&16),s=r.entangledLanes,s!==0)for(r=r.entanglements,s&=c;0<s;)a=31-zn(s),f=1<<a,c|=r[a],s&=~f;return c}function dE(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 hE(r,s){for(var a=r.suspendedLanes,c=r.pingedLanes,f=r.expirationTimes,p=r.pendingLanes;0<p;){var S=31-zn(p),E=1<<S,R=f[S];R===-1?((E&a)===0||(E&c)!==0)&&(f[S]=dE(E,s)):R<=s&&(r.expiredLanes|=E),p&=~E}}function cf(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function Rg(){var r=lu;return lu<<=1,(lu&4194240)===0&&(lu=64),r}function lf(r){for(var s=[],a=0;31>a;a++)s.push(r);return s}function xi(r,s,a){r.pendingLanes|=s,s!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,s=31-zn(s),r[s]=a}function pE(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 c=r.eventTimes;for(r=r.expirationTimes;0<a;){var f=31-zn(a),p=1<<f;s[f]=0,c[f]=-1,r[f]=-1,a&=~p}}function ff(r,s){var a=r.entangledLanes|=s;for(r=r.entanglements;a;){var c=31-zn(a),f=1<<c;f&s|r[c]&s&&(r[c]|=s),a&=~f}}var Fe=0;function Tg(r){return r&=-r,1<r?4<r?(r&268435455)!==0?16:536870912:4:1}var Og,df,Mg,Lg,Ng,hf=!1,hu=[],Ar=null,jr=null,$r=null,wi=new Map,ki=new Map,Fr=[],mE="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 Ag(r,s){switch(r){case"focusin":case"focusout":Ar=null;break;case"dragenter":case"dragleave":jr=null;break;case"mouseover":case"mouseout":$r=null;break;case"pointerover":case"pointerout":wi.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":ki.delete(s.pointerId)}}function _i(r,s,a,c,f,p){return r===null||r.nativeEvent!==p?(r={blockedOn:s,domEventName:a,eventSystemFlags:c,nativeEvent:p,targetContainers:[f]},s!==null&&(s=$i(s),s!==null&&df(s)),r):(r.eventSystemFlags|=c,s=r.targetContainers,f!==null&&s.indexOf(f)===-1&&s.push(f),r)}function gE(r,s,a,c,f){switch(s){case"focusin":return Ar=_i(Ar,r,s,a,c,f),!0;case"dragenter":return jr=_i(jr,r,s,a,c,f),!0;case"mouseover":return $r=_i($r,r,s,a,c,f),!0;case"pointerover":var p=f.pointerId;return wi.set(p,_i(wi.get(p)||null,r,s,a,c,f)),!0;case"gotpointercapture":return p=f.pointerId,ki.set(p,_i(ki.get(p)||null,r,s,a,c,f)),!0}return!1}function jg(r){var s=_s(r.target);if(s!==null){var a=ks(s);if(a!==null){if(s=a.tag,s===13){if(s=wg(a),s!==null){r.blockedOn=s,Ng(r.priority,function(){Mg(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 pu(r){if(r.blockedOn!==null)return!1;for(var s=r.targetContainers;0<s.length;){var a=mf(r.domEventName,r.eventSystemFlags,s[0],r.nativeEvent);if(a===null){a=r.nativeEvent;var c=new a.constructor(a.type,a);tf=c,a.target.dispatchEvent(c),tf=null}else return s=$i(a),s!==null&&df(s),r.blockedOn=a,!1;s.shift()}return!0}function $g(r,s,a){pu(r)&&a.delete(s)}function yE(){hf=!1,Ar!==null&&pu(Ar)&&(Ar=null),jr!==null&&pu(jr)&&(jr=null),$r!==null&&pu($r)&&($r=null),wi.forEach($g),ki.forEach($g)}function Ei(r,s){r.blockedOn===s&&(r.blockedOn=null,hf||(hf=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,yE)))}function Ci(r){function s(f){return Ei(f,r)}if(0<hu.length){Ei(hu[0],r);for(var a=1;a<hu.length;a++){var c=hu[a];c.blockedOn===r&&(c.blockedOn=null)}}for(Ar!==null&&Ei(Ar,r),jr!==null&&Ei(jr,r),$r!==null&&Ei($r,r),wi.forEach(s),ki.forEach(s),a=0;a<Fr.length;a++)c=Fr[a],c.blockedOn===r&&(c.blockedOn=null);for(;0<Fr.length&&(a=Fr[0],a.blockedOn===null);)jg(a),a.blockedOn===null&&Fr.shift()}var go=P.ReactCurrentBatchConfig,mu=!0;function vE(r,s,a,c){var f=Fe,p=go.transition;go.transition=null;try{Fe=1,pf(r,s,a,c)}finally{Fe=f,go.transition=p}}function SE(r,s,a,c){var f=Fe,p=go.transition;go.transition=null;try{Fe=4,pf(r,s,a,c)}finally{Fe=f,go.transition=p}}function pf(r,s,a,c){if(mu){var f=mf(r,s,a,c);if(f===null)Mf(r,s,c,gu,a),Ag(r,c);else if(gE(f,r,s,a,c))c.stopPropagation();else if(Ag(r,c),s&4&&-1<mE.indexOf(r)){for(;f!==null;){var p=$i(f);if(p!==null&&Og(p),p=mf(r,s,a,c),p===null&&Mf(r,s,c,gu,a),p===f)break;f=p}f!==null&&c.stopPropagation()}else Mf(r,s,c,null,a)}}var gu=null;function mf(r,s,a,c){if(gu=null,r=nf(c),r=_s(r),r!==null)if(s=ks(r),s===null)r=null;else if(a=s.tag,a===13){if(r=wg(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 gu=r,null}function Fg(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(iE()){case uf:return 1;case bg:return 4;case uu:case aE:return 16;case Ig:return 536870912;default:return 16}default:return 16}}var Dr=null,gf=null,yu=null;function Dg(){if(yu)return yu;var r,s=gf,a=s.length,c,f="value"in Dr?Dr.value:Dr.textContent,p=f.length;for(r=0;r<a&&s[r]===f[r];r++);var S=a-r;for(c=1;c<=S&&s[a-c]===f[p-c];c++);return yu=f.slice(r,1<c?1-c:void 0)}function vu(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 Su(){return!0}function Ug(){return!1}function pn(r){function s(a,c,f,p,S){this._reactName=a,this._targetInst=f,this.type=c,this.nativeEvent=p,this.target=S,this.currentTarget=null;for(var E in r)r.hasOwnProperty(E)&&(a=r[E],this[E]=a?a(p):p[E]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?Su:Ug,this.isPropagationStopped=Ug,this}return ee(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=Su)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Su)},persist:function(){},isPersistent:Su}),s}var yo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},yf=pn(yo),Pi=ee({},yo,{view:0,detail:0}),xE=pn(Pi),vf,Sf,bi,xu=ee({},Pi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:wf,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!==bi&&(bi&&r.type==="mousemove"?(vf=r.screenX-bi.screenX,Sf=r.screenY-bi.screenY):Sf=vf=0,bi=r),vf)},movementY:function(r){return"movementY"in r?r.movementY:Sf}}),zg=pn(xu),wE=ee({},xu,{dataTransfer:0}),kE=pn(wE),_E=ee({},Pi,{relatedTarget:0}),xf=pn(_E),EE=ee({},yo,{animationName:0,elapsedTime:0,pseudoElement:0}),CE=pn(EE),PE=ee({},yo,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),bE=pn(PE),IE=ee({},yo,{data:0}),Bg=pn(IE),RE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},TE={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"},OE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ME(r){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(r):(r=OE[r])?!!s[r]:!1}function wf(){return ME}var LE=ee({},Pi,{key:function(r){if(r.key){var s=RE[r.key]||r.key;if(s!=="Unidentified")return s}return r.type==="keypress"?(r=vu(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?TE[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:wf,charCode:function(r){return r.type==="keypress"?vu(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?vu(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),NE=pn(LE),AE=ee({},xu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Vg=pn(AE),jE=ee({},Pi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:wf}),$E=pn(jE),FE=ee({},yo,{propertyName:0,elapsedTime:0,pseudoElement:0}),DE=pn(FE),UE=ee({},xu,{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}),zE=pn(UE),BE=[9,13,27,32],kf=d&&"CompositionEvent"in window,Ii=null;d&&"documentMode"in document&&(Ii=document.documentMode);var VE=d&&"TextEvent"in window&&!Ii,qg=d&&(!kf||Ii&&8<Ii&&11>=Ii),Wg=" ",Hg=!1;function Kg(r,s){switch(r){case"keyup":return BE.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Qg(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var vo=!1;function qE(r,s){switch(r){case"compositionend":return Qg(s);case"keypress":return s.which!==32?null:(Hg=!0,Wg);case"textInput":return r=s.data,r===Wg&&Hg?null:r;default:return null}}function WE(r,s){if(vo)return r==="compositionend"||!kf&&Kg(r,s)?(r=Dg(),yu=gf=Dr=null,vo=!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 qg&&s.locale!=="ko"?null:s.data;default:return null}}var HE={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 Jg(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s==="input"?!!HE[r.type]:s==="textarea"}function Gg(r,s,a,c){gg(c),s=Cu(s,"onChange"),0<s.length&&(a=new yf("onChange","change",null,a,c),r.push({event:a,listeners:s}))}var Ri=null,Ti=null;function KE(r){p0(r,0)}function wu(r){var s=_o(r);if(Ss(s))return r}function QE(r,s){if(r==="change")return s}var Yg=!1;if(d){var _f;if(d){var Ef="oninput"in document;if(!Ef){var Xg=document.createElement("div");Xg.setAttribute("oninput","return;"),Ef=typeof Xg.oninput=="function"}_f=Ef}else _f=!1;Yg=_f&&(!document.documentMode||9<document.documentMode)}function Zg(){Ri&&(Ri.detachEvent("onpropertychange",e0),Ti=Ri=null)}function e0(r){if(r.propertyName==="value"&&wu(Ti)){var s=[];Gg(s,Ti,r,nf(r)),xg(KE,s)}}function JE(r,s,a){r==="focusin"?(Zg(),Ri=s,Ti=a,Ri.attachEvent("onpropertychange",e0)):r==="focusout"&&Zg()}function GE(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return wu(Ti)}function YE(r,s){if(r==="click")return wu(s)}function XE(r,s){if(r==="input"||r==="change")return wu(s)}function ZE(r,s){return r===s&&(r!==0||1/r===1/s)||r!==r&&s!==s}var Bn=typeof Object.is=="function"?Object.is:ZE;function Oi(r,s){if(Bn(r,s))return!0;if(typeof r!="object"||r===null||typeof s!="object"||s===null)return!1;var a=Object.keys(r),c=Object.keys(s);if(a.length!==c.length)return!1;for(c=0;c<a.length;c++){var f=a[c];if(!m.call(s,f)||!Bn(r[f],s[f]))return!1}return!0}function t0(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function n0(r,s){var a=t0(r);r=0;for(var c;a;){if(a.nodeType===3){if(c=r+a.textContent.length,r<=s&&c>=s)return{node:a,offset:s-r};r=c}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=t0(a)}}function r0(r,s){return r&&s?r===s?!0:r&&r.nodeType===3?!1:s&&s.nodeType===3?r0(r,s.parentNode):"contains"in r?r.contains(s):r.compareDocumentPosition?!!(r.compareDocumentPosition(s)&16):!1:!1}function s0(){for(var r=window,s=xs();s instanceof r.HTMLIFrameElement;){try{var a=typeof s.contentWindow.location.href=="string"}catch{a=!1}if(a)r=s.contentWindow;else break;s=xs(r.document)}return s}function Cf(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 eC(r){var s=s0(),a=r.focusedElem,c=r.selectionRange;if(s!==a&&a&&a.ownerDocument&&r0(a.ownerDocument.documentElement,a)){if(c!==null&&Cf(a)){if(s=c.start,r=c.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,p=Math.min(c.start,f);c=c.end===void 0?p:Math.min(c.end,f),!r.extend&&p>c&&(f=c,c=p,p=f),f=n0(a,p);var S=n0(a,c);f&&S&&(r.rangeCount!==1||r.anchorNode!==f.node||r.anchorOffset!==f.offset||r.focusNode!==S.node||r.focusOffset!==S.offset)&&(s=s.createRange(),s.setStart(f.node,f.offset),r.removeAllRanges(),p>c?(r.addRange(s),r.extend(S.node,S.offset)):(s.setEnd(S.node,S.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 tC=d&&"documentMode"in document&&11>=document.documentMode,So=null,Pf=null,Mi=null,bf=!1;function o0(r,s,a){var c=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;bf||So==null||So!==xs(c)||(c=So,"selectionStart"in c&&Cf(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Mi&&Oi(Mi,c)||(Mi=c,c=Cu(Pf,"onSelect"),0<c.length&&(s=new yf("onSelect","select",null,s,a),r.push({event:s,listeners:c}),s.target=So)))}function ku(r,s){var a={};return a[r.toLowerCase()]=s.toLowerCase(),a["Webkit"+r]="webkit"+s,a["Moz"+r]="moz"+s,a}var xo={animationend:ku("Animation","AnimationEnd"),animationiteration:ku("Animation","AnimationIteration"),animationstart:ku("Animation","AnimationStart"),transitionend:ku("Transition","TransitionEnd")},If={},i0={};d&&(i0=document.createElement("div").style,"AnimationEvent"in window||(delete xo.animationend.animation,delete xo.animationiteration.animation,delete xo.animationstart.animation),"TransitionEvent"in window||delete xo.transitionend.transition);function _u(r){if(If[r])return If[r];if(!xo[r])return r;var s=xo[r],a;for(a in s)if(s.hasOwnProperty(a)&&a in i0)return If[r]=s[a];return r}var a0=_u("animationend"),u0=_u("animationiteration"),c0=_u("animationstart"),l0=_u("transitionend"),f0=new Map,d0="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 Ur(r,s){f0.set(r,s),u(s,[r])}for(var Rf=0;Rf<d0.length;Rf++){var Tf=d0[Rf],nC=Tf.toLowerCase(),rC=Tf[0].toUpperCase()+Tf.slice(1);Ur(nC,"on"+rC)}Ur(a0,"onAnimationEnd"),Ur(u0,"onAnimationIteration"),Ur(c0,"onAnimationStart"),Ur("dblclick","onDoubleClick"),Ur("focusin","onFocus"),Ur("focusout","onBlur"),Ur(l0,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),u("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),u("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),u("onBeforeInput",["compositionend","keypress","textInput","paste"]),u("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Li="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(" "),sC=new Set("cancel close invalid load scroll toggle".split(" ").concat(Li));function h0(r,s,a){var c=r.type||"unknown-event";r.currentTarget=a,nE(c,s,void 0,r),r.currentTarget=null}function p0(r,s){s=(s&4)!==0;for(var a=0;a<r.length;a++){var c=r[a],f=c.event;c=c.listeners;e:{var p=void 0;if(s)for(var S=c.length-1;0<=S;S--){var E=c[S],R=E.instance,K=E.currentTarget;if(E=E.listener,R!==p&&f.isPropagationStopped())break e;h0(f,E,K),p=R}else for(S=0;S<c.length;S++){if(E=c[S],R=E.instance,K=E.currentTarget,E=E.listener,R!==p&&f.isPropagationStopped())break e;h0(f,E,K),p=R}}}if(au)throw r=af,au=!1,af=null,r}function He(r,s){var a=s[Ff];a===void 0&&(a=s[Ff]=new Set);var c=r+"__bubble";a.has(c)||(m0(s,r,2,!1),a.add(c))}function Of(r,s,a){var c=0;s&&(c|=4),m0(a,r,c,s)}var Eu="_reactListening"+Math.random().toString(36).slice(2);function Ni(r){if(!r[Eu]){r[Eu]=!0,o.forEach(function(a){a!=="selectionchange"&&(sC.has(a)||Of(a,!1,r),Of(a,!0,r))});var s=r.nodeType===9?r:r.ownerDocument;s===null||s[Eu]||(s[Eu]=!0,Of("selectionchange",!1,s))}}function m0(r,s,a,c){switch(Fg(s)){case 1:var f=vE;break;case 4:f=SE;break;default:f=pf}a=f.bind(null,s,a,r),f=void 0,!of||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(f=!0),c?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 Mf(r,s,a,c,f){var p=c;if((s&1)===0&&(s&2)===0&&c!==null)e:for(;;){if(c===null)return;var S=c.tag;if(S===3||S===4){var E=c.stateNode.containerInfo;if(E===f||E.nodeType===8&&E.parentNode===f)break;if(S===4)for(S=c.return;S!==null;){var R=S.tag;if((R===3||R===4)&&(R=S.stateNode.containerInfo,R===f||R.nodeType===8&&R.parentNode===f))return;S=S.return}for(;E!==null;){if(S=_s(E),S===null)return;if(R=S.tag,R===5||R===6){c=p=S;continue e}E=E.parentNode}}c=c.return}xg(function(){var K=p,oe=nf(a),ie=[];e:{var re=f0.get(r);if(re!==void 0){var fe=yf,pe=r;switch(r){case"keypress":if(vu(a)===0)break e;case"keydown":case"keyup":fe=NE;break;case"focusin":pe="focus",fe=xf;break;case"focusout":pe="blur",fe=xf;break;case"beforeblur":case"afterblur":fe=xf;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":fe=zg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=kE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=$E;break;case a0:case u0:case c0:fe=CE;break;case l0:fe=DE;break;case"scroll":fe=xE;break;case"wheel":fe=zE;break;case"copy":case"cut":case"paste":fe=bE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=Vg}var ge=(s&4)!==0,ct=!ge&&r==="scroll",U=ge?re!==null?re+"Capture":null:re;ge=[];for(var O=K,V;O!==null;){V=O;var ae=V.stateNode;if(V.tag===5&&ae!==null&&(V=ae,U!==null&&(ae=gi(O,U),ae!=null&&ge.push(Ai(O,ae,V)))),ct)break;O=O.return}0<ge.length&&(re=new fe(re,pe,null,a,oe),ie.push({event:re,listeners:ge}))}}if((s&7)===0){e:{if(re=r==="mouseover"||r==="pointerover",fe=r==="mouseout"||r==="pointerout",re&&a!==tf&&(pe=a.relatedTarget||a.fromElement)&&(_s(pe)||pe[Sr]))break e;if((fe||re)&&(re=oe.window===oe?oe:(re=oe.ownerDocument)?re.defaultView||re.parentWindow:window,fe?(pe=a.relatedTarget||a.toElement,fe=K,pe=pe?_s(pe):null,pe!==null&&(ct=ks(pe),pe!==ct||pe.tag!==5&&pe.tag!==6)&&(pe=null)):(fe=null,pe=K),fe!==pe)){if(ge=zg,ae="onMouseLeave",U="onMouseEnter",O="mouse",(r==="pointerout"||r==="pointerover")&&(ge=Vg,ae="onPointerLeave",U="onPointerEnter",O="pointer"),ct=fe==null?re:_o(fe),V=pe==null?re:_o(pe),re=new ge(ae,O+"leave",fe,a,oe),re.target=ct,re.relatedTarget=V,ae=null,_s(oe)===K&&(ge=new ge(U,O+"enter",pe,a,oe),ge.target=V,ge.relatedTarget=ct,ae=ge),ct=ae,fe&&pe)t:{for(ge=fe,U=pe,O=0,V=ge;V;V=wo(V))O++;for(V=0,ae=U;ae;ae=wo(ae))V++;for(;0<O-V;)ge=wo(ge),O--;for(;0<V-O;)U=wo(U),V--;for(;O--;){if(ge===U||U!==null&&ge===U.alternate)break t;ge=wo(ge),U=wo(U)}ge=null}else ge=null;fe!==null&&g0(ie,re,fe,ge,!1),pe!==null&&ct!==null&&g0(ie,ct,pe,ge,!0)}}e:{if(re=K?_o(K):window,fe=re.nodeName&&re.nodeName.toLowerCase(),fe==="select"||fe==="input"&&re.type==="file")var ye=QE;else if(Jg(re))if(Yg)ye=XE;else{ye=GE;var ve=JE}else(fe=re.nodeName)&&fe.toLowerCase()==="input"&&(re.type==="checkbox"||re.type==="radio")&&(ye=YE);if(ye&&(ye=ye(r,K))){Gg(ie,ye,a,oe);break e}ve&&ve(r,re,K),r==="focusout"&&(ve=re._wrapperState)&&ve.controlled&&re.type==="number"&&ws(re,"number",re.value)}switch(ve=K?_o(K):window,r){case"focusin":(Jg(ve)||ve.contentEditable==="true")&&(So=ve,Pf=K,Mi=null);break;case"focusout":Mi=Pf=So=null;break;case"mousedown":bf=!0;break;case"contextmenu":case"mouseup":case"dragend":bf=!1,o0(ie,a,oe);break;case"selectionchange":if(tC)break;case"keydown":case"keyup":o0(ie,a,oe)}var Se;if(kf)e:{switch(r){case"compositionstart":var we="onCompositionStart";break e;case"compositionend":we="onCompositionEnd";break e;case"compositionupdate":we="onCompositionUpdate";break e}we=void 0}else vo?Kg(r,a)&&(we="onCompositionEnd"):r==="keydown"&&a.keyCode===229&&(we="onCompositionStart");we&&(qg&&a.locale!=="ko"&&(vo||we!=="onCompositionStart"?we==="onCompositionEnd"&&vo&&(Se=Dg()):(Dr=oe,gf="value"in Dr?Dr.value:Dr.textContent,vo=!0)),ve=Cu(K,we),0<ve.length&&(we=new Bg(we,r,null,a,oe),ie.push({event:we,listeners:ve}),Se?we.data=Se:(Se=Qg(a),Se!==null&&(we.data=Se)))),(Se=VE?qE(r,a):WE(r,a))&&(K=Cu(K,"onBeforeInput"),0<K.length&&(oe=new Bg("onBeforeInput","beforeinput",null,a,oe),ie.push({event:oe,listeners:K}),oe.data=Se))}p0(ie,s)})}function Ai(r,s,a){return{instance:r,listener:s,currentTarget:a}}function Cu(r,s){for(var a=s+"Capture",c=[];r!==null;){var f=r,p=f.stateNode;f.tag===5&&p!==null&&(f=p,p=gi(r,a),p!=null&&c.unshift(Ai(r,p,f)),p=gi(r,s),p!=null&&c.push(Ai(r,p,f))),r=r.return}return c}function wo(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5);return r||null}function g0(r,s,a,c,f){for(var p=s._reactName,S=[];a!==null&&a!==c;){var E=a,R=E.alternate,K=E.stateNode;if(R!==null&&R===c)break;E.tag===5&&K!==null&&(E=K,f?(R=gi(a,p),R!=null&&S.unshift(Ai(a,R,E))):f||(R=gi(a,p),R!=null&&S.push(Ai(a,R,E)))),a=a.return}S.length!==0&&r.push({event:s,listeners:S})}var oC=/\r\n?/g,iC=/\u0000|\uFFFD/g;function y0(r){return(typeof r=="string"?r:""+r).replace(oC,`
|
|
39
|
-
`).replace(iC,"")}function Pu(r,s,a){if(s=y0(s),y0(r)!==s&&a)throw Error(n(425))}function bu(){}var Lf=null,Nf=null;function Af(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 jf=typeof setTimeout=="function"?setTimeout:void 0,aC=typeof clearTimeout=="function"?clearTimeout:void 0,v0=typeof Promise=="function"?Promise:void 0,uC=typeof queueMicrotask=="function"?queueMicrotask:typeof v0<"u"?function(r){return v0.resolve(null).then(r).catch(cC)}:jf;function cC(r){setTimeout(function(){throw r})}function $f(r,s){var a=s,c=0;do{var f=a.nextSibling;if(r.removeChild(a),f&&f.nodeType===8)if(a=f.data,a==="/$"){if(c===0){r.removeChild(f),Ci(s);return}c--}else a!=="$"&&a!=="$?"&&a!=="$!"||c++;a=f}while(a);Ci(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 S0(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 ko=Math.random().toString(36).slice(2),rr="__reactFiber$"+ko,ji="__reactProps$"+ko,Sr="__reactContainer$"+ko,Ff="__reactEvents$"+ko,lC="__reactListeners$"+ko,fC="__reactHandles$"+ko;function _s(r){var s=r[rr];if(s)return s;for(var a=r.parentNode;a;){if(s=a[Sr]||a[rr]){if(a=s.alternate,s.child!==null||a!==null&&a.child!==null)for(r=S0(r);r!==null;){if(a=r[rr])return a;r=S0(r)}return s}r=a,a=r.parentNode}return null}function $i(r){return r=r[rr]||r[Sr],!r||r.tag!==5&&r.tag!==6&&r.tag!==13&&r.tag!==3?null:r}function _o(r){if(r.tag===5||r.tag===6)return r.stateNode;throw Error(n(33))}function Iu(r){return r[ji]||null}var Df=[],Eo=-1;function Br(r){return{current:r}}function Ke(r){0>Eo||(r.current=Df[Eo],Df[Eo]=null,Eo--)}function Ve(r,s){Eo++,Df[Eo]=r.current,r.current=s}var Vr={},jt=Br(Vr),Xt=Br(!1),Es=Vr;function Co(r,s){var a=r.type.contextTypes;if(!a)return Vr;var c=r.stateNode;if(c&&c.__reactInternalMemoizedUnmaskedChildContext===s)return c.__reactInternalMemoizedMaskedChildContext;var f={},p;for(p in a)f[p]=s[p];return c&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=s,r.__reactInternalMemoizedMaskedChildContext=f),f}function Zt(r){return r=r.childContextTypes,r!=null}function Ru(){Ke(Xt),Ke(jt)}function x0(r,s,a){if(jt.current!==Vr)throw Error(n(168));Ve(jt,s),Ve(Xt,a)}function w0(r,s,a){var c=r.stateNode;if(s=s.childContextTypes,typeof c.getChildContext!="function")return a;c=c.getChildContext();for(var f in c)if(!(f in s))throw Error(n(108,Ne(r)||"Unknown",f));return ee({},a,c)}function Tu(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||Vr,Es=jt.current,Ve(jt,r),Ve(Xt,Xt.current),!0}function k0(r,s,a){var c=r.stateNode;if(!c)throw Error(n(169));a?(r=w0(r,s,Es),c.__reactInternalMemoizedMergedChildContext=r,Ke(Xt),Ke(jt),Ve(jt,r)):Ke(Xt),Ve(Xt,a)}var xr=null,Ou=!1,Uf=!1;function _0(r){xr===null?xr=[r]:xr.push(r)}function dC(r){Ou=!0,_0(r)}function qr(){if(!Uf&&xr!==null){Uf=!0;var r=0,s=Fe;try{var a=xr;for(Fe=1;r<a.length;r++){var c=a[r];do c=c(!0);while(c!==null)}xr=null,Ou=!1}catch(f){throw xr!==null&&(xr=xr.slice(r+1)),Cg(uf,qr),f}finally{Fe=s,Uf=!1}}return null}var Po=[],bo=0,Mu=null,Lu=0,Pn=[],bn=0,Cs=null,wr=1,kr="";function Ps(r,s){Po[bo++]=Lu,Po[bo++]=Mu,Mu=r,Lu=s}function E0(r,s,a){Pn[bn++]=wr,Pn[bn++]=kr,Pn[bn++]=Cs,Cs=r;var c=wr;r=kr;var f=32-zn(c)-1;c&=~(1<<f),a+=1;var p=32-zn(s)+f;if(30<p){var S=f-f%5;p=(c&(1<<S)-1).toString(32),c>>=S,f-=S,wr=1<<32-zn(s)+f|a<<f|c,kr=p+r}else wr=1<<p|a<<f|c,kr=r}function zf(r){r.return!==null&&(Ps(r,1),E0(r,1,0))}function Bf(r){for(;r===Mu;)Mu=Po[--bo],Po[bo]=null,Lu=Po[--bo],Po[bo]=null;for(;r===Cs;)Cs=Pn[--bn],Pn[bn]=null,kr=Pn[--bn],Pn[bn]=null,wr=Pn[--bn],Pn[bn]=null}var mn=null,gn=null,Je=!1,Vn=null;function C0(r,s){var a=On(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 P0(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,mn=r,gn=zr(s.firstChild),!0):!1;case 6:return s=r.pendingProps===""||s.nodeType!==3?null:s,s!==null?(r.stateNode=s,mn=r,gn=null,!0):!1;case 13:return s=s.nodeType!==8?null:s,s!==null?(a=Cs!==null?{id:wr,overflow:kr}:null,r.memoizedState={dehydrated:s,treeContext:a,retryLane:1073741824},a=On(18,null,null,0),a.stateNode=s,a.return=r,r.child=a,mn=r,gn=null,!0):!1;default:return!1}}function Vf(r){return(r.mode&1)!==0&&(r.flags&128)===0}function qf(r){if(Je){var s=gn;if(s){var a=s;if(!P0(r,s)){if(Vf(r))throw Error(n(418));s=zr(a.nextSibling);var c=mn;s&&P0(r,s)?C0(c,a):(r.flags=r.flags&-4097|2,Je=!1,mn=r)}}else{if(Vf(r))throw Error(n(418));r.flags=r.flags&-4097|2,Je=!1,mn=r}}}function b0(r){for(r=r.return;r!==null&&r.tag!==5&&r.tag!==3&&r.tag!==13;)r=r.return;mn=r}function Nu(r){if(r!==mn)return!1;if(!Je)return b0(r),Je=!0,!1;var s;if((s=r.tag!==3)&&!(s=r.tag!==5)&&(s=r.type,s=s!=="head"&&s!=="body"&&!Af(r.type,r.memoizedProps)),s&&(s=gn)){if(Vf(r))throw I0(),Error(n(418));for(;s;)C0(r,s),s=zr(s.nextSibling)}if(b0(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){gn=zr(r.nextSibling);break e}s--}else a!=="$"&&a!=="$!"&&a!=="$?"||s++}r=r.nextSibling}gn=null}}else gn=mn?zr(r.stateNode.nextSibling):null;return!0}function I0(){for(var r=gn;r;)r=zr(r.nextSibling)}function Io(){gn=mn=null,Je=!1}function Wf(r){Vn===null?Vn=[r]:Vn.push(r)}var hC=P.ReactCurrentBatchConfig;function Fi(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 c=a.stateNode}if(!c)throw Error(n(147,r));var f=c,p=""+r;return s!==null&&s.ref!==null&&typeof s.ref=="function"&&s.ref._stringRef===p?s.ref:(s=function(S){var E=f.refs;S===null?delete E[p]:E[p]=S},s._stringRef=p,s)}if(typeof r!="string")throw Error(n(284));if(!a._owner)throw Error(n(290,r))}return r}function Au(r,s){throw r=Object.prototype.toString.call(s),Error(n(31,r==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":r))}function R0(r){var s=r._init;return s(r._payload)}function T0(r){function s(U,O){if(r){var V=U.deletions;V===null?(U.deletions=[O],U.flags|=16):V.push(O)}}function a(U,O){if(!r)return null;for(;O!==null;)s(U,O),O=O.sibling;return null}function c(U,O){for(U=new Map;O!==null;)O.key!==null?U.set(O.key,O):U.set(O.index,O),O=O.sibling;return U}function f(U,O){return U=Xr(U,O),U.index=0,U.sibling=null,U}function p(U,O,V){return U.index=V,r?(V=U.alternate,V!==null?(V=V.index,V<O?(U.flags|=2,O):V):(U.flags|=2,O)):(U.flags|=1048576,O)}function S(U){return r&&U.alternate===null&&(U.flags|=2),U}function E(U,O,V,ae){return O===null||O.tag!==6?(O=jd(V,U.mode,ae),O.return=U,O):(O=f(O,V),O.return=U,O)}function R(U,O,V,ae){var ye=V.type;return ye===$?oe(U,O,V.props.children,ae,V.key):O!==null&&(O.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===Q&&R0(ye)===O.type)?(ae=f(O,V.props),ae.ref=Fi(U,O,V),ae.return=U,ae):(ae=oc(V.type,V.key,V.props,null,U.mode,ae),ae.ref=Fi(U,O,V),ae.return=U,ae)}function K(U,O,V,ae){return O===null||O.tag!==4||O.stateNode.containerInfo!==V.containerInfo||O.stateNode.implementation!==V.implementation?(O=$d(V,U.mode,ae),O.return=U,O):(O=f(O,V.children||[]),O.return=U,O)}function oe(U,O,V,ae,ye){return O===null||O.tag!==7?(O=Ns(V,U.mode,ae,ye),O.return=U,O):(O=f(O,V),O.return=U,O)}function ie(U,O,V){if(typeof O=="string"&&O!==""||typeof O=="number")return O=jd(""+O,U.mode,V),O.return=U,O;if(typeof O=="object"&&O!==null){switch(O.$$typeof){case L:return V=oc(O.type,O.key,O.props,null,U.mode,V),V.ref=Fi(U,null,O),V.return=U,V;case F:return O=$d(O,U.mode,V),O.return=U,O;case Q:var ae=O._init;return ie(U,ae(O._payload),V)}if(hn(O)||se(O))return O=Ns(O,U.mode,V,null),O.return=U,O;Au(U,O)}return null}function re(U,O,V,ae){var ye=O!==null?O.key:null;if(typeof V=="string"&&V!==""||typeof V=="number")return ye!==null?null:E(U,O,""+V,ae);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case L:return V.key===ye?R(U,O,V,ae):null;case F:return V.key===ye?K(U,O,V,ae):null;case Q:return ye=V._init,re(U,O,ye(V._payload),ae)}if(hn(V)||se(V))return ye!==null?null:oe(U,O,V,ae,null);Au(U,V)}return null}function fe(U,O,V,ae,ye){if(typeof ae=="string"&&ae!==""||typeof ae=="number")return U=U.get(V)||null,E(O,U,""+ae,ye);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case L:return U=U.get(ae.key===null?V:ae.key)||null,R(O,U,ae,ye);case F:return U=U.get(ae.key===null?V:ae.key)||null,K(O,U,ae,ye);case Q:var ve=ae._init;return fe(U,O,V,ve(ae._payload),ye)}if(hn(ae)||se(ae))return U=U.get(V)||null,oe(O,U,ae,ye,null);Au(O,ae)}return null}function pe(U,O,V,ae){for(var ye=null,ve=null,Se=O,we=O=0,kt=null;Se!==null&&we<V.length;we++){Se.index>we?(kt=Se,Se=null):kt=Se.sibling;var Ae=re(U,Se,V[we],ae);if(Ae===null){Se===null&&(Se=kt);break}r&&Se&&Ae.alternate===null&&s(U,Se),O=p(Ae,O,we),ve===null?ye=Ae:ve.sibling=Ae,ve=Ae,Se=kt}if(we===V.length)return a(U,Se),Je&&Ps(U,we),ye;if(Se===null){for(;we<V.length;we++)Se=ie(U,V[we],ae),Se!==null&&(O=p(Se,O,we),ve===null?ye=Se:ve.sibling=Se,ve=Se);return Je&&Ps(U,we),ye}for(Se=c(U,Se);we<V.length;we++)kt=fe(Se,U,we,V[we],ae),kt!==null&&(r&&kt.alternate!==null&&Se.delete(kt.key===null?we:kt.key),O=p(kt,O,we),ve===null?ye=kt:ve.sibling=kt,ve=kt);return r&&Se.forEach(function(Zr){return s(U,Zr)}),Je&&Ps(U,we),ye}function ge(U,O,V,ae){var ye=se(V);if(typeof ye!="function")throw Error(n(150));if(V=ye.call(V),V==null)throw Error(n(151));for(var ve=ye=null,Se=O,we=O=0,kt=null,Ae=V.next();Se!==null&&!Ae.done;we++,Ae=V.next()){Se.index>we?(kt=Se,Se=null):kt=Se.sibling;var Zr=re(U,Se,Ae.value,ae);if(Zr===null){Se===null&&(Se=kt);break}r&&Se&&Zr.alternate===null&&s(U,Se),O=p(Zr,O,we),ve===null?ye=Zr:ve.sibling=Zr,ve=Zr,Se=kt}if(Ae.done)return a(U,Se),Je&&Ps(U,we),ye;if(Se===null){for(;!Ae.done;we++,Ae=V.next())Ae=ie(U,Ae.value,ae),Ae!==null&&(O=p(Ae,O,we),ve===null?ye=Ae:ve.sibling=Ae,ve=Ae);return Je&&Ps(U,we),ye}for(Se=c(U,Se);!Ae.done;we++,Ae=V.next())Ae=fe(Se,U,we,Ae.value,ae),Ae!==null&&(r&&Ae.alternate!==null&&Se.delete(Ae.key===null?we:Ae.key),O=p(Ae,O,we),ve===null?ye=Ae:ve.sibling=Ae,ve=Ae);return r&&Se.forEach(function(HC){return s(U,HC)}),Je&&Ps(U,we),ye}function ct(U,O,V,ae){if(typeof V=="object"&&V!==null&&V.type===$&&V.key===null&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case L:e:{for(var ye=V.key,ve=O;ve!==null;){if(ve.key===ye){if(ye=V.type,ye===$){if(ve.tag===7){a(U,ve.sibling),O=f(ve,V.props.children),O.return=U,U=O;break e}}else if(ve.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===Q&&R0(ye)===ve.type){a(U,ve.sibling),O=f(ve,V.props),O.ref=Fi(U,ve,V),O.return=U,U=O;break e}a(U,ve);break}else s(U,ve);ve=ve.sibling}V.type===$?(O=Ns(V.props.children,U.mode,ae,V.key),O.return=U,U=O):(ae=oc(V.type,V.key,V.props,null,U.mode,ae),ae.ref=Fi(U,O,V),ae.return=U,U=ae)}return S(U);case F:e:{for(ve=V.key;O!==null;){if(O.key===ve)if(O.tag===4&&O.stateNode.containerInfo===V.containerInfo&&O.stateNode.implementation===V.implementation){a(U,O.sibling),O=f(O,V.children||[]),O.return=U,U=O;break e}else{a(U,O);break}else s(U,O);O=O.sibling}O=$d(V,U.mode,ae),O.return=U,U=O}return S(U);case Q:return ve=V._init,ct(U,O,ve(V._payload),ae)}if(hn(V))return pe(U,O,V,ae);if(se(V))return ge(U,O,V,ae);Au(U,V)}return typeof V=="string"&&V!==""||typeof V=="number"?(V=""+V,O!==null&&O.tag===6?(a(U,O.sibling),O=f(O,V),O.return=U,U=O):(a(U,O),O=jd(V,U.mode,ae),O.return=U,U=O),S(U)):a(U,O)}return ct}var Ro=T0(!0),O0=T0(!1),ju=Br(null),$u=null,To=null,Hf=null;function Kf(){Hf=To=$u=null}function Qf(r){var s=ju.current;Ke(ju),r._currentValue=s}function Jf(r,s,a){for(;r!==null;){var c=r.alternate;if((r.childLanes&s)!==s?(r.childLanes|=s,c!==null&&(c.childLanes|=s)):c!==null&&(c.childLanes&s)!==s&&(c.childLanes|=s),r===a)break;r=r.return}}function Oo(r,s){$u=r,Hf=To=null,r=r.dependencies,r!==null&&r.firstContext!==null&&((r.lanes&s)!==0&&(en=!0),r.firstContext=null)}function In(r){var s=r._currentValue;if(Hf!==r)if(r={context:r,memoizedValue:s,next:null},To===null){if($u===null)throw Error(n(308));To=r,$u.dependencies={lanes:0,firstContext:r}}else To=To.next=r;return s}var bs=null;function Gf(r){bs===null?bs=[r]:bs.push(r)}function M0(r,s,a,c){var f=s.interleaved;return f===null?(a.next=a,Gf(s)):(a.next=f.next,f.next=a),s.interleaved=a,_r(r,c)}function _r(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 Wr=!1;function Yf(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function L0(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 Er(r,s){return{eventTime:r,lane:s,tag:0,payload:null,callback:null,next:null}}function Hr(r,s,a){var c=r.updateQueue;if(c===null)return null;if(c=c.shared,(Le&2)!==0){var f=c.pending;return f===null?s.next=s:(s.next=f.next,f.next=s),c.pending=s,_r(r,a)}return f=c.interleaved,f===null?(s.next=s,Gf(c)):(s.next=f.next,f.next=s),c.interleaved=s,_r(r,a)}function Fu(r,s,a){if(s=s.updateQueue,s!==null&&(s=s.shared,(a&4194240)!==0)){var c=s.lanes;c&=r.pendingLanes,a|=c,s.lanes=a,ff(r,a)}}function N0(r,s){var a=r.updateQueue,c=r.alternate;if(c!==null&&(c=c.updateQueue,a===c)){var f=null,p=null;if(a=a.firstBaseUpdate,a!==null){do{var S={eventTime:a.eventTime,lane:a.lane,tag:a.tag,payload:a.payload,callback:a.callback,next:null};p===null?f=p=S:p=p.next=S,a=a.next}while(a!==null);p===null?f=p=s:p=p.next=s}else f=p=s;a={baseState:c.baseState,firstBaseUpdate:f,lastBaseUpdate:p,shared:c.shared,effects:c.effects},r.updateQueue=a;return}r=a.lastBaseUpdate,r===null?a.firstBaseUpdate=s:r.next=s,a.lastBaseUpdate=s}function Du(r,s,a,c){var f=r.updateQueue;Wr=!1;var p=f.firstBaseUpdate,S=f.lastBaseUpdate,E=f.shared.pending;if(E!==null){f.shared.pending=null;var R=E,K=R.next;R.next=null,S===null?p=K:S.next=K,S=R;var oe=r.alternate;oe!==null&&(oe=oe.updateQueue,E=oe.lastBaseUpdate,E!==S&&(E===null?oe.firstBaseUpdate=K:E.next=K,oe.lastBaseUpdate=R))}if(p!==null){var ie=f.baseState;S=0,oe=K=R=null,E=p;do{var re=E.lane,fe=E.eventTime;if((c&re)===re){oe!==null&&(oe=oe.next={eventTime:fe,lane:0,tag:E.tag,payload:E.payload,callback:E.callback,next:null});e:{var pe=r,ge=E;switch(re=s,fe=a,ge.tag){case 1:if(pe=ge.payload,typeof pe=="function"){ie=pe.call(fe,ie,re);break e}ie=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=ge.payload,re=typeof pe=="function"?pe.call(fe,ie,re):pe,re==null)break e;ie=ee({},ie,re);break e;case 2:Wr=!0}}E.callback!==null&&E.lane!==0&&(r.flags|=64,re=f.effects,re===null?f.effects=[E]:re.push(E))}else fe={eventTime:fe,lane:re,tag:E.tag,payload:E.payload,callback:E.callback,next:null},oe===null?(K=oe=fe,R=ie):oe=oe.next=fe,S|=re;if(E=E.next,E===null){if(E=f.shared.pending,E===null)break;re=E,E=re.next,re.next=null,f.lastBaseUpdate=re,f.shared.pending=null}}while(!0);if(oe===null&&(R=ie),f.baseState=R,f.firstBaseUpdate=K,f.lastBaseUpdate=oe,s=f.shared.interleaved,s!==null){f=s;do S|=f.lane,f=f.next;while(f!==s)}else p===null&&(f.shared.lanes=0);Ts|=S,r.lanes=S,r.memoizedState=ie}}function A0(r,s,a){if(r=s.effects,s.effects=null,r!==null)for(s=0;s<r.length;s++){var c=r[s],f=c.callback;if(f!==null){if(c.callback=null,c=a,typeof f!="function")throw Error(n(191,f));f.call(c)}}}var Di={},sr=Br(Di),Ui=Br(Di),zi=Br(Di);function Is(r){if(r===Di)throw Error(n(174));return r}function Xf(r,s){switch(Ve(zi,s),Ve(Ui,r),Ve(sr,Di),r=s.nodeType,r){case 9:case 11:s=(s=s.documentElement)?s.namespaceURI:Un(null,"");break;default:r=r===8?s.parentNode:s,s=r.namespaceURI||null,r=r.tagName,s=Un(s,r)}Ke(sr),Ve(sr,s)}function Mo(){Ke(sr),Ke(Ui),Ke(zi)}function j0(r){Is(zi.current);var s=Is(sr.current),a=Un(s,r.type);s!==a&&(Ve(Ui,r),Ve(sr,a))}function Zf(r){Ui.current===r&&(Ke(sr),Ke(Ui))}var Ze=Br(0);function Uu(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 ed=[];function td(){for(var r=0;r<ed.length;r++)ed[r]._workInProgressVersionPrimary=null;ed.length=0}var zu=P.ReactCurrentDispatcher,nd=P.ReactCurrentBatchConfig,Rs=0,et=null,mt=null,xt=null,Bu=!1,Bi=!1,Vi=0,pC=0;function $t(){throw Error(n(321))}function rd(r,s){if(s===null)return!1;for(var a=0;a<s.length&&a<r.length;a++)if(!Bn(r[a],s[a]))return!1;return!0}function sd(r,s,a,c,f,p){if(Rs=p,et=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,zu.current=r===null||r.memoizedState===null?vC:SC,r=a(c,f),Bi){p=0;do{if(Bi=!1,Vi=0,25<=p)throw Error(n(301));p+=1,xt=mt=null,s.updateQueue=null,zu.current=xC,r=a(c,f)}while(Bi)}if(zu.current=Wu,s=mt!==null&&mt.next!==null,Rs=0,xt=mt=et=null,Bu=!1,s)throw Error(n(300));return r}function od(){var r=Vi!==0;return Vi=0,r}function or(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return xt===null?et.memoizedState=xt=r:xt=xt.next=r,xt}function Rn(){if(mt===null){var r=et.alternate;r=r!==null?r.memoizedState:null}else r=mt.next;var s=xt===null?et.memoizedState:xt.next;if(s!==null)xt=s,mt=r;else{if(r===null)throw Error(n(310));mt=r,r={memoizedState:mt.memoizedState,baseState:mt.baseState,baseQueue:mt.baseQueue,queue:mt.queue,next:null},xt===null?et.memoizedState=xt=r:xt=xt.next=r}return xt}function qi(r,s){return typeof s=="function"?s(r):s}function id(r){var s=Rn(),a=s.queue;if(a===null)throw Error(n(311));a.lastRenderedReducer=r;var c=mt,f=c.baseQueue,p=a.pending;if(p!==null){if(f!==null){var S=f.next;f.next=p.next,p.next=S}c.baseQueue=f=p,a.pending=null}if(f!==null){p=f.next,c=c.baseState;var E=S=null,R=null,K=p;do{var oe=K.lane;if((Rs&oe)===oe)R!==null&&(R=R.next={lane:0,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null}),c=K.hasEagerState?K.eagerState:r(c,K.action);else{var ie={lane:oe,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null};R===null?(E=R=ie,S=c):R=R.next=ie,et.lanes|=oe,Ts|=oe}K=K.next}while(K!==null&&K!==p);R===null?S=c:R.next=E,Bn(c,s.memoizedState)||(en=!0),s.memoizedState=c,s.baseState=S,s.baseQueue=R,a.lastRenderedState=c}if(r=a.interleaved,r!==null){f=r;do p=f.lane,et.lanes|=p,Ts|=p,f=f.next;while(f!==r)}else f===null&&(a.lanes=0);return[s.memoizedState,a.dispatch]}function ad(r){var s=Rn(),a=s.queue;if(a===null)throw Error(n(311));a.lastRenderedReducer=r;var c=a.dispatch,f=a.pending,p=s.memoizedState;if(f!==null){a.pending=null;var S=f=f.next;do p=r(p,S.action),S=S.next;while(S!==f);Bn(p,s.memoizedState)||(en=!0),s.memoizedState=p,s.baseQueue===null&&(s.baseState=p),a.lastRenderedState=p}return[p,c]}function $0(){}function F0(r,s){var a=et,c=Rn(),f=s(),p=!Bn(c.memoizedState,f);if(p&&(c.memoizedState=f,en=!0),c=c.queue,ud(z0.bind(null,a,c,r),[r]),c.getSnapshot!==s||p||xt!==null&&xt.memoizedState.tag&1){if(a.flags|=2048,Wi(9,U0.bind(null,a,c,f,s),void 0,null),wt===null)throw Error(n(349));(Rs&30)!==0||D0(a,s,f)}return f}function D0(r,s,a){r.flags|=16384,r={getSnapshot:s,value:a},s=et.updateQueue,s===null?(s={lastEffect:null,stores:null},et.updateQueue=s,s.stores=[r]):(a=s.stores,a===null?s.stores=[r]:a.push(r))}function U0(r,s,a,c){s.value=a,s.getSnapshot=c,B0(s)&&V0(r)}function z0(r,s,a){return a(function(){B0(s)&&V0(r)})}function B0(r){var s=r.getSnapshot;r=r.value;try{var a=s();return!Bn(r,a)}catch{return!0}}function V0(r){var s=_r(r,1);s!==null&&Kn(s,r,1,-1)}function q0(r){var s=or();return typeof r=="function"&&(r=r()),s.memoizedState=s.baseState=r,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:qi,lastRenderedState:r},s.queue=r,r=r.dispatch=yC.bind(null,et,r),[s.memoizedState,r]}function Wi(r,s,a,c){return r={tag:r,create:s,destroy:a,deps:c,next:null},s=et.updateQueue,s===null?(s={lastEffect:null,stores:null},et.updateQueue=s,s.lastEffect=r.next=r):(a=s.lastEffect,a===null?s.lastEffect=r.next=r:(c=a.next,a.next=r,r.next=c,s.lastEffect=r)),r}function W0(){return Rn().memoizedState}function Vu(r,s,a,c){var f=or();et.flags|=r,f.memoizedState=Wi(1|s,a,void 0,c===void 0?null:c)}function qu(r,s,a,c){var f=Rn();c=c===void 0?null:c;var p=void 0;if(mt!==null){var S=mt.memoizedState;if(p=S.destroy,c!==null&&rd(c,S.deps)){f.memoizedState=Wi(s,a,p,c);return}}et.flags|=r,f.memoizedState=Wi(1|s,a,p,c)}function H0(r,s){return Vu(8390656,8,r,s)}function ud(r,s){return qu(2048,8,r,s)}function K0(r,s){return qu(4,2,r,s)}function Q0(r,s){return qu(4,4,r,s)}function J0(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 G0(r,s,a){return a=a!=null?a.concat([r]):null,qu(4,4,J0.bind(null,s,r),a)}function cd(){}function Y0(r,s){var a=Rn();s=s===void 0?null:s;var c=a.memoizedState;return c!==null&&s!==null&&rd(s,c[1])?c[0]:(a.memoizedState=[r,s],r)}function X0(r,s){var a=Rn();s=s===void 0?null:s;var c=a.memoizedState;return c!==null&&s!==null&&rd(s,c[1])?c[0]:(r=r(),a.memoizedState=[r,s],r)}function Z0(r,s,a){return(Rs&21)===0?(r.baseState&&(r.baseState=!1,en=!0),r.memoizedState=a):(Bn(a,s)||(a=Rg(),et.lanes|=a,Ts|=a,r.baseState=!0),s)}function mC(r,s){var a=Fe;Fe=a!==0&&4>a?a:4,r(!0);var c=nd.transition;nd.transition={};try{r(!1),s()}finally{Fe=a,nd.transition=c}}function ey(){return Rn().memoizedState}function gC(r,s,a){var c=Gr(r);if(a={lane:c,action:a,hasEagerState:!1,eagerState:null,next:null},ty(r))ny(s,a);else if(a=M0(r,s,a,c),a!==null){var f=Ht();Kn(a,r,c,f),ry(a,s,c)}}function yC(r,s,a){var c=Gr(r),f={lane:c,action:a,hasEagerState:!1,eagerState:null,next:null};if(ty(r))ny(s,f);else{var p=r.alternate;if(r.lanes===0&&(p===null||p.lanes===0)&&(p=s.lastRenderedReducer,p!==null))try{var S=s.lastRenderedState,E=p(S,a);if(f.hasEagerState=!0,f.eagerState=E,Bn(E,S)){var R=s.interleaved;R===null?(f.next=f,Gf(s)):(f.next=R.next,R.next=f),s.interleaved=f;return}}catch{}finally{}a=M0(r,s,f,c),a!==null&&(f=Ht(),Kn(a,r,c,f),ry(a,s,c))}}function ty(r){var s=r.alternate;return r===et||s!==null&&s===et}function ny(r,s){Bi=Bu=!0;var a=r.pending;a===null?s.next=s:(s.next=a.next,a.next=s),r.pending=s}function ry(r,s,a){if((a&4194240)!==0){var c=s.lanes;c&=r.pendingLanes,a|=c,s.lanes=a,ff(r,a)}}var Wu={readContext:In,useCallback:$t,useContext:$t,useEffect:$t,useImperativeHandle:$t,useInsertionEffect:$t,useLayoutEffect:$t,useMemo:$t,useReducer:$t,useRef:$t,useState:$t,useDebugValue:$t,useDeferredValue:$t,useTransition:$t,useMutableSource:$t,useSyncExternalStore:$t,useId:$t,unstable_isNewReconciler:!1},vC={readContext:In,useCallback:function(r,s){return or().memoizedState=[r,s===void 0?null:s],r},useContext:In,useEffect:H0,useImperativeHandle:function(r,s,a){return a=a!=null?a.concat([r]):null,Vu(4194308,4,J0.bind(null,s,r),a)},useLayoutEffect:function(r,s){return Vu(4194308,4,r,s)},useInsertionEffect:function(r,s){return Vu(4,2,r,s)},useMemo:function(r,s){var a=or();return s=s===void 0?null:s,r=r(),a.memoizedState=[r,s],r},useReducer:function(r,s,a){var c=or();return s=a!==void 0?a(s):s,c.memoizedState=c.baseState=s,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:s},c.queue=r,r=r.dispatch=gC.bind(null,et,r),[c.memoizedState,r]},useRef:function(r){var s=or();return r={current:r},s.memoizedState=r},useState:q0,useDebugValue:cd,useDeferredValue:function(r){return or().memoizedState=r},useTransition:function(){var r=q0(!1),s=r[0];return r=mC.bind(null,r[1]),or().memoizedState=r,[s,r]},useMutableSource:function(){},useSyncExternalStore:function(r,s,a){var c=et,f=or();if(Je){if(a===void 0)throw Error(n(407));a=a()}else{if(a=s(),wt===null)throw Error(n(349));(Rs&30)!==0||D0(c,s,a)}f.memoizedState=a;var p={value:a,getSnapshot:s};return f.queue=p,H0(z0.bind(null,c,p,r),[r]),c.flags|=2048,Wi(9,U0.bind(null,c,p,a,s),void 0,null),a},useId:function(){var r=or(),s=wt.identifierPrefix;if(Je){var a=kr,c=wr;a=(c&~(1<<32-zn(c)-1)).toString(32)+a,s=":"+s+"R"+a,a=Vi++,0<a&&(s+="H"+a.toString(32)),s+=":"}else a=pC++,s=":"+s+"r"+a.toString(32)+":";return r.memoizedState=s},unstable_isNewReconciler:!1},SC={readContext:In,useCallback:Y0,useContext:In,useEffect:ud,useImperativeHandle:G0,useInsertionEffect:K0,useLayoutEffect:Q0,useMemo:X0,useReducer:id,useRef:W0,useState:function(){return id(qi)},useDebugValue:cd,useDeferredValue:function(r){var s=Rn();return Z0(s,mt.memoizedState,r)},useTransition:function(){var r=id(qi)[0],s=Rn().memoizedState;return[r,s]},useMutableSource:$0,useSyncExternalStore:F0,useId:ey,unstable_isNewReconciler:!1},xC={readContext:In,useCallback:Y0,useContext:In,useEffect:ud,useImperativeHandle:G0,useInsertionEffect:K0,useLayoutEffect:Q0,useMemo:X0,useReducer:ad,useRef:W0,useState:function(){return ad(qi)},useDebugValue:cd,useDeferredValue:function(r){var s=Rn();return mt===null?s.memoizedState=r:Z0(s,mt.memoizedState,r)},useTransition:function(){var r=ad(qi)[0],s=Rn().memoizedState;return[r,s]},useMutableSource:$0,useSyncExternalStore:F0,useId:ey,unstable_isNewReconciler:!1};function qn(r,s){if(r&&r.defaultProps){s=ee({},s),r=r.defaultProps;for(var a in r)s[a]===void 0&&(s[a]=r[a]);return s}return s}function ld(r,s,a,c){s=r.memoizedState,a=a(c,s),a=a==null?s:ee({},s,a),r.memoizedState=a,r.lanes===0&&(r.updateQueue.baseState=a)}var Hu={isMounted:function(r){return(r=r._reactInternals)?ks(r)===r:!1},enqueueSetState:function(r,s,a){r=r._reactInternals;var c=Ht(),f=Gr(r),p=Er(c,f);p.payload=s,a!=null&&(p.callback=a),s=Hr(r,p,f),s!==null&&(Kn(s,r,f,c),Fu(s,r,f))},enqueueReplaceState:function(r,s,a){r=r._reactInternals;var c=Ht(),f=Gr(r),p=Er(c,f);p.tag=1,p.payload=s,a!=null&&(p.callback=a),s=Hr(r,p,f),s!==null&&(Kn(s,r,f,c),Fu(s,r,f))},enqueueForceUpdate:function(r,s){r=r._reactInternals;var a=Ht(),c=Gr(r),f=Er(a,c);f.tag=2,s!=null&&(f.callback=s),s=Hr(r,f,c),s!==null&&(Kn(s,r,c,a),Fu(s,r,c))}};function sy(r,s,a,c,f,p,S){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(c,p,S):s.prototype&&s.prototype.isPureReactComponent?!Oi(a,c)||!Oi(f,p):!0}function oy(r,s,a){var c=!1,f=Vr,p=s.contextType;return typeof p=="object"&&p!==null?p=In(p):(f=Zt(s)?Es:jt.current,c=s.contextTypes,p=(c=c!=null)?Co(r,f):Vr),s=new s(a,p),r.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=Hu,r.stateNode=s,s._reactInternals=r,c&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=f,r.__reactInternalMemoizedMaskedChildContext=p),s}function iy(r,s,a,c){r=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(a,c),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(a,c),s.state!==r&&Hu.enqueueReplaceState(s,s.state,null)}function fd(r,s,a,c){var f=r.stateNode;f.props=a,f.state=r.memoizedState,f.refs={},Yf(r);var p=s.contextType;typeof p=="object"&&p!==null?f.context=In(p):(p=Zt(s)?Es:jt.current,f.context=Co(r,p)),f.state=r.memoizedState,p=s.getDerivedStateFromProps,typeof p=="function"&&(ld(r,s,p,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&&Hu.enqueueReplaceState(f,f.state,null),Du(r,a,f,c),f.state=r.memoizedState),typeof f.componentDidMount=="function"&&(r.flags|=4194308)}function Lo(r,s){try{var a="",c=s;do a+=le(c),c=c.return;while(c);var f=a}catch(p){f=`
|
|
40
|
-
Error generating stack: `+p.message+`
|
|
41
|
-
`+p.stack}return{value:r,source:s,stack:f,digest:null}}function dd(r,s,a){return{value:r,source:null,stack:a??null,digest:s??null}}function hd(r,s){try{console.error(s.value)}catch(a){setTimeout(function(){throw a})}}var wC=typeof WeakMap=="function"?WeakMap:Map;function ay(r,s,a){a=Er(-1,a),a.tag=3,a.payload={element:null};var c=s.value;return a.callback=function(){Zu||(Zu=!0,Id=c),hd(r,s)},a}function uy(r,s,a){a=Er(-1,a),a.tag=3;var c=r.type.getDerivedStateFromError;if(typeof c=="function"){var f=s.value;a.payload=function(){return c(f)},a.callback=function(){hd(r,s)}}var p=r.stateNode;return p!==null&&typeof p.componentDidCatch=="function"&&(a.callback=function(){hd(r,s),typeof c!="function"&&(Qr===null?Qr=new Set([this]):Qr.add(this));var S=s.stack;this.componentDidCatch(s.value,{componentStack:S!==null?S:""})}),a}function cy(r,s,a){var c=r.pingCache;if(c===null){c=r.pingCache=new wC;var f=new Set;c.set(s,f)}else f=c.get(s),f===void 0&&(f=new Set,c.set(s,f));f.has(a)||(f.add(a),r=AC.bind(null,r,s,a),s.then(r,r))}function ly(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 fy(r,s,a,c,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=Er(-1,1),s.tag=2,Hr(a,s,1))),a.lanes|=1),r):(r.flags|=65536,r.lanes=f,r)}var kC=P.ReactCurrentOwner,en=!1;function Wt(r,s,a,c){s.child=r===null?O0(s,null,a,c):Ro(s,r.child,a,c)}function dy(r,s,a,c,f){a=a.render;var p=s.ref;return Oo(s,f),c=sd(r,s,a,c,p,f),a=od(),r!==null&&!en?(s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~f,Cr(r,s,f)):(Je&&a&&zf(s),s.flags|=1,Wt(r,s,c,f),s.child)}function hy(r,s,a,c,f){if(r===null){var p=a.type;return typeof p=="function"&&!Ad(p)&&p.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(s.tag=15,s.type=p,py(r,s,p,c,f)):(r=oc(a.type,null,c,s,s.mode,f),r.ref=s.ref,r.return=s,s.child=r)}if(p=r.child,(r.lanes&f)===0){var S=p.memoizedProps;if(a=a.compare,a=a!==null?a:Oi,a(S,c)&&r.ref===s.ref)return Cr(r,s,f)}return s.flags|=1,r=Xr(p,c),r.ref=s.ref,r.return=s,s.child=r}function py(r,s,a,c,f){if(r!==null){var p=r.memoizedProps;if(Oi(p,c)&&r.ref===s.ref)if(en=!1,s.pendingProps=c=p,(r.lanes&f)!==0)(r.flags&131072)!==0&&(en=!0);else return s.lanes=r.lanes,Cr(r,s,f)}return pd(r,s,a,c,f)}function my(r,s,a){var c=s.pendingProps,f=c.children,p=r!==null?r.memoizedState:null;if(c.mode==="hidden")if((s.mode&1)===0)s.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ve(Ao,yn),yn|=a;else{if((a&1073741824)===0)return r=p!==null?p.baseLanes|a:a,s.lanes=s.childLanes=1073741824,s.memoizedState={baseLanes:r,cachePool:null,transitions:null},s.updateQueue=null,Ve(Ao,yn),yn|=r,null;s.memoizedState={baseLanes:0,cachePool:null,transitions:null},c=p!==null?p.baseLanes:a,Ve(Ao,yn),yn|=c}else p!==null?(c=p.baseLanes|a,s.memoizedState=null):c=a,Ve(Ao,yn),yn|=c;return Wt(r,s,f,a),s.child}function gy(r,s){var a=s.ref;(r===null&&a!==null||r!==null&&r.ref!==a)&&(s.flags|=512,s.flags|=2097152)}function pd(r,s,a,c,f){var p=Zt(a)?Es:jt.current;return p=Co(s,p),Oo(s,f),a=sd(r,s,a,c,p,f),c=od(),r!==null&&!en?(s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~f,Cr(r,s,f)):(Je&&c&&zf(s),s.flags|=1,Wt(r,s,a,f),s.child)}function yy(r,s,a,c,f){if(Zt(a)){var p=!0;Tu(s)}else p=!1;if(Oo(s,f),s.stateNode===null)Qu(r,s),oy(s,a,c),fd(s,a,c,f),c=!0;else if(r===null){var S=s.stateNode,E=s.memoizedProps;S.props=E;var R=S.context,K=a.contextType;typeof K=="object"&&K!==null?K=In(K):(K=Zt(a)?Es:jt.current,K=Co(s,K));var oe=a.getDerivedStateFromProps,ie=typeof oe=="function"||typeof S.getSnapshotBeforeUpdate=="function";ie||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(E!==c||R!==K)&&iy(s,S,c,K),Wr=!1;var re=s.memoizedState;S.state=re,Du(s,c,S,f),R=s.memoizedState,E!==c||re!==R||Xt.current||Wr?(typeof oe=="function"&&(ld(s,a,oe,c),R=s.memoizedState),(E=Wr||sy(s,a,E,c,re,R,K))?(ie||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(s.flags|=4194308)):(typeof S.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=c,s.memoizedState=R),S.props=c,S.state=R,S.context=K,c=E):(typeof S.componentDidMount=="function"&&(s.flags|=4194308),c=!1)}else{S=s.stateNode,L0(r,s),E=s.memoizedProps,K=s.type===s.elementType?E:qn(s.type,E),S.props=K,ie=s.pendingProps,re=S.context,R=a.contextType,typeof R=="object"&&R!==null?R=In(R):(R=Zt(a)?Es:jt.current,R=Co(s,R));var fe=a.getDerivedStateFromProps;(oe=typeof fe=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(E!==ie||re!==R)&&iy(s,S,c,R),Wr=!1,re=s.memoizedState,S.state=re,Du(s,c,S,f);var pe=s.memoizedState;E!==ie||re!==pe||Xt.current||Wr?(typeof fe=="function"&&(ld(s,a,fe,c),pe=s.memoizedState),(K=Wr||sy(s,a,K,c,re,pe,R)||!1)?(oe||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(c,pe,R),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(c,pe,R)),typeof S.componentDidUpdate=="function"&&(s.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof S.componentDidUpdate!="function"||E===r.memoizedProps&&re===r.memoizedState||(s.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||E===r.memoizedProps&&re===r.memoizedState||(s.flags|=1024),s.memoizedProps=c,s.memoizedState=pe),S.props=c,S.state=pe,S.context=R,c=K):(typeof S.componentDidUpdate!="function"||E===r.memoizedProps&&re===r.memoizedState||(s.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||E===r.memoizedProps&&re===r.memoizedState||(s.flags|=1024),c=!1)}return md(r,s,a,c,p,f)}function md(r,s,a,c,f,p){gy(r,s);var S=(s.flags&128)!==0;if(!c&&!S)return f&&k0(s,a,!1),Cr(r,s,p);c=s.stateNode,kC.current=s;var E=S&&typeof a.getDerivedStateFromError!="function"?null:c.render();return s.flags|=1,r!==null&&S?(s.child=Ro(s,r.child,null,p),s.child=Ro(s,null,E,p)):Wt(r,s,E,p),s.memoizedState=c.state,f&&k0(s,a,!0),s.child}function vy(r){var s=r.stateNode;s.pendingContext?x0(r,s.pendingContext,s.pendingContext!==s.context):s.context&&x0(r,s.context,!1),Xf(r,s.containerInfo)}function Sy(r,s,a,c,f){return Io(),Wf(f),s.flags|=256,Wt(r,s,a,c),s.child}var gd={dehydrated:null,treeContext:null,retryLane:0};function yd(r){return{baseLanes:r,cachePool:null,transitions:null}}function xy(r,s,a){var c=s.pendingProps,f=Ze.current,p=!1,S=(s.flags&128)!==0,E;if((E=S)||(E=r!==null&&r.memoizedState===null?!1:(f&2)!==0),E?(p=!0,s.flags&=-129):(r===null||r.memoizedState!==null)&&(f|=1),Ve(Ze,f&1),r===null)return qf(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):(S=c.children,r=c.fallback,p?(c=s.mode,p=s.child,S={mode:"hidden",children:S},(c&1)===0&&p!==null?(p.childLanes=0,p.pendingProps=S):p=ic(S,c,0,null),r=Ns(r,c,a,null),p.return=s,r.return=s,p.sibling=r,s.child=p,s.child.memoizedState=yd(a),s.memoizedState=gd,r):vd(s,S));if(f=r.memoizedState,f!==null&&(E=f.dehydrated,E!==null))return _C(r,s,S,c,E,f,a);if(p){p=c.fallback,S=s.mode,f=r.child,E=f.sibling;var R={mode:"hidden",children:c.children};return(S&1)===0&&s.child!==f?(c=s.child,c.childLanes=0,c.pendingProps=R,s.deletions=null):(c=Xr(f,R),c.subtreeFlags=f.subtreeFlags&14680064),E!==null?p=Xr(E,p):(p=Ns(p,S,a,null),p.flags|=2),p.return=s,c.return=s,c.sibling=p,s.child=c,c=p,p=s.child,S=r.child.memoizedState,S=S===null?yd(a):{baseLanes:S.baseLanes|a,cachePool:null,transitions:S.transitions},p.memoizedState=S,p.childLanes=r.childLanes&~a,s.memoizedState=gd,c}return p=r.child,r=p.sibling,c=Xr(p,{mode:"visible",children:c.children}),(s.mode&1)===0&&(c.lanes=a),c.return=s,c.sibling=null,r!==null&&(a=s.deletions,a===null?(s.deletions=[r],s.flags|=16):a.push(r)),s.child=c,s.memoizedState=null,c}function vd(r,s){return s=ic({mode:"visible",children:s},r.mode,0,null),s.return=r,r.child=s}function Ku(r,s,a,c){return c!==null&&Wf(c),Ro(s,r.child,null,a),r=vd(s,s.pendingProps.children),r.flags|=2,s.memoizedState=null,r}function _C(r,s,a,c,f,p,S){if(a)return s.flags&256?(s.flags&=-257,c=dd(Error(n(422))),Ku(r,s,S,c)):s.memoizedState!==null?(s.child=r.child,s.flags|=128,null):(p=c.fallback,f=s.mode,c=ic({mode:"visible",children:c.children},f,0,null),p=Ns(p,f,S,null),p.flags|=2,c.return=s,p.return=s,c.sibling=p,s.child=c,(s.mode&1)!==0&&Ro(s,r.child,null,S),s.child.memoizedState=yd(S),s.memoizedState=gd,p);if((s.mode&1)===0)return Ku(r,s,S,null);if(f.data==="$!"){if(c=f.nextSibling&&f.nextSibling.dataset,c)var E=c.dgst;return c=E,p=Error(n(419)),c=dd(p,c,void 0),Ku(r,s,S,c)}if(E=(S&r.childLanes)!==0,en||E){if(c=wt,c!==null){switch(S&-S){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&(c.suspendedLanes|S))!==0?0:f,f!==0&&f!==p.retryLane&&(p.retryLane=f,_r(r,f),Kn(c,r,f,-1))}return Nd(),c=dd(Error(n(421))),Ku(r,s,S,c)}return f.data==="$?"?(s.flags|=128,s.child=r.child,s=jC.bind(null,r),f._reactRetry=s,null):(r=p.treeContext,gn=zr(f.nextSibling),mn=s,Je=!0,Vn=null,r!==null&&(Pn[bn++]=wr,Pn[bn++]=kr,Pn[bn++]=Cs,wr=r.id,kr=r.overflow,Cs=s),s=vd(s,c.children),s.flags|=4096,s)}function wy(r,s,a){r.lanes|=s;var c=r.alternate;c!==null&&(c.lanes|=s),Jf(r.return,s,a)}function Sd(r,s,a,c,f){var p=r.memoizedState;p===null?r.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:c,tail:a,tailMode:f}:(p.isBackwards=s,p.rendering=null,p.renderingStartTime=0,p.last=c,p.tail=a,p.tailMode=f)}function ky(r,s,a){var c=s.pendingProps,f=c.revealOrder,p=c.tail;if(Wt(r,s,c.children,a),c=Ze.current,(c&2)!==0)c=c&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&&wy(r,a,s);else if(r.tag===19)wy(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}c&=1}if(Ve(Ze,c),(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&&Uu(r)===null&&(f=a),a=a.sibling;a=f,a===null?(f=s.child,s.child=null):(f=a.sibling,a.sibling=null),Sd(s,!1,f,a,p);break;case"backwards":for(a=null,f=s.child,s.child=null;f!==null;){if(r=f.alternate,r!==null&&Uu(r)===null){s.child=f;break}r=f.sibling,f.sibling=a,a=f,f=r}Sd(s,!0,a,null,p);break;case"together":Sd(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function Qu(r,s){(s.mode&1)===0&&r!==null&&(r.alternate=null,s.alternate=null,s.flags|=2)}function Cr(r,s,a){if(r!==null&&(s.dependencies=r.dependencies),Ts|=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=Xr(r,r.pendingProps),s.child=a,a.return=s;r.sibling!==null;)r=r.sibling,a=a.sibling=Xr(r,r.pendingProps),a.return=s;a.sibling=null}return s.child}function EC(r,s,a){switch(s.tag){case 3:vy(s),Io();break;case 5:j0(s);break;case 1:Zt(s.type)&&Tu(s);break;case 4:Xf(s,s.stateNode.containerInfo);break;case 10:var c=s.type._context,f=s.memoizedProps.value;Ve(ju,c._currentValue),c._currentValue=f;break;case 13:if(c=s.memoizedState,c!==null)return c.dehydrated!==null?(Ve(Ze,Ze.current&1),s.flags|=128,null):(a&s.child.childLanes)!==0?xy(r,s,a):(Ve(Ze,Ze.current&1),r=Cr(r,s,a),r!==null?r.sibling:null);Ve(Ze,Ze.current&1);break;case 19:if(c=(a&s.childLanes)!==0,(r.flags&128)!==0){if(c)return ky(r,s,a);s.flags|=128}if(f=s.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),Ve(Ze,Ze.current),c)break;return null;case 22:case 23:return s.lanes=0,my(r,s,a)}return Cr(r,s,a)}var _y,xd,Ey,Cy;_y=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}},xd=function(){},Ey=function(r,s,a,c){var f=r.memoizedProps;if(f!==c){r=s.stateNode,Is(sr.current);var p=null;switch(a){case"input":f=co(r,f),c=co(r,c),p=[];break;case"select":f=ee({},f,{value:void 0}),c=ee({},c,{value:void 0}),p=[];break;case"textarea":f=fo(r,f),c=fo(r,c),p=[];break;default:typeof f.onClick!="function"&&typeof c.onClick=="function"&&(r.onclick=bu)}Zl(a,c);var S;a=null;for(K in f)if(!c.hasOwnProperty(K)&&f.hasOwnProperty(K)&&f[K]!=null)if(K==="style"){var E=f[K];for(S in E)E.hasOwnProperty(S)&&(a||(a={}),a[S]="")}else K!=="dangerouslySetInnerHTML"&&K!=="children"&&K!=="suppressContentEditableWarning"&&K!=="suppressHydrationWarning"&&K!=="autoFocus"&&(i.hasOwnProperty(K)?p||(p=[]):(p=p||[]).push(K,null));for(K in c){var R=c[K];if(E=f!=null?f[K]:void 0,c.hasOwnProperty(K)&&R!==E&&(R!=null||E!=null))if(K==="style")if(E){for(S in E)!E.hasOwnProperty(S)||R&&R.hasOwnProperty(S)||(a||(a={}),a[S]="");for(S in R)R.hasOwnProperty(S)&&E[S]!==R[S]&&(a||(a={}),a[S]=R[S])}else a||(p||(p=[]),p.push(K,a)),a=R;else K==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,E=E?E.__html:void 0,R!=null&&E!==R&&(p=p||[]).push(K,R)):K==="children"?typeof R!="string"&&typeof R!="number"||(p=p||[]).push(K,""+R):K!=="suppressContentEditableWarning"&&K!=="suppressHydrationWarning"&&(i.hasOwnProperty(K)?(R!=null&&K==="onScroll"&&He("scroll",r),p||E===R||(p=[])):(p=p||[]).push(K,R))}a&&(p=p||[]).push("style",a);var K=p;(s.updateQueue=K)&&(s.flags|=4)}},Cy=function(r,s,a,c){a!==c&&(s.flags|=4)};function Hi(r,s){if(!Je)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 c=null;a!==null;)a.alternate!==null&&(c=a),a=a.sibling;c===null?s||r.tail===null?r.tail=null:r.tail.sibling=null:c.sibling=null}}function Ft(r){var s=r.alternate!==null&&r.alternate.child===r.child,a=0,c=0;if(s)for(var f=r.child;f!==null;)a|=f.lanes|f.childLanes,c|=f.subtreeFlags&14680064,c|=f.flags&14680064,f.return=r,f=f.sibling;else for(f=r.child;f!==null;)a|=f.lanes|f.childLanes,c|=f.subtreeFlags,c|=f.flags,f.return=r,f=f.sibling;return r.subtreeFlags|=c,r.childLanes=a,s}function CC(r,s,a){var c=s.pendingProps;switch(Bf(s),s.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ft(s),null;case 1:return Zt(s.type)&&Ru(),Ft(s),null;case 3:return c=s.stateNode,Mo(),Ke(Xt),Ke(jt),td(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(r===null||r.child===null)&&(Nu(s)?s.flags|=4:r===null||r.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Vn!==null&&(Od(Vn),Vn=null))),xd(r,s),Ft(s),null;case 5:Zf(s);var f=Is(zi.current);if(a=s.type,r!==null&&s.stateNode!=null)Ey(r,s,a,c,f),r.ref!==s.ref&&(s.flags|=512,s.flags|=2097152);else{if(!c){if(s.stateNode===null)throw Error(n(166));return Ft(s),null}if(r=Is(sr.current),Nu(s)){c=s.stateNode,a=s.type;var p=s.memoizedProps;switch(c[rr]=s,c[ji]=p,r=(s.mode&1)!==0,a){case"dialog":He("cancel",c),He("close",c);break;case"iframe":case"object":case"embed":He("load",c);break;case"video":case"audio":for(f=0;f<Li.length;f++)He(Li[f],c);break;case"source":He("error",c);break;case"img":case"image":case"link":He("error",c),He("load",c);break;case"details":He("toggle",c);break;case"input":su(c,p),He("invalid",c);break;case"select":c._wrapperState={wasMultiple:!!p.multiple},He("invalid",c);break;case"textarea":ou(c,p),He("invalid",c)}Zl(a,p),f=null;for(var S in p)if(p.hasOwnProperty(S)){var E=p[S];S==="children"?typeof E=="string"?c.textContent!==E&&(p.suppressHydrationWarning!==!0&&Pu(c.textContent,E,r),f=["children",E]):typeof E=="number"&&c.textContent!==""+E&&(p.suppressHydrationWarning!==!0&&Pu(c.textContent,E,r),f=["children",""+E]):i.hasOwnProperty(S)&&E!=null&&S==="onScroll"&&He("scroll",c)}switch(a){case"input":yr(c),vr(c,p,!0);break;case"textarea":yr(c),$e(c);break;case"select":case"option":break;default:typeof p.onClick=="function"&&(c.onclick=bu)}c=f,s.updateQueue=c,c!==null&&(s.flags|=4)}else{S=f.nodeType===9?f:f.ownerDocument,r==="http://www.w3.org/1999/xhtml"&&(r=Ot(a)),r==="http://www.w3.org/1999/xhtml"?a==="script"?(r=S.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild)):typeof c.is=="string"?r=S.createElement(a,{is:c.is}):(r=S.createElement(a),a==="select"&&(S=r,c.multiple?S.multiple=!0:c.size&&(S.size=c.size))):r=S.createElementNS(r,a),r[rr]=s,r[ji]=c,_y(r,s,!1,!1),s.stateNode=r;e:{switch(S=ef(a,c),a){case"dialog":He("cancel",r),He("close",r),f=c;break;case"iframe":case"object":case"embed":He("load",r),f=c;break;case"video":case"audio":for(f=0;f<Li.length;f++)He(Li[f],r);f=c;break;case"source":He("error",r),f=c;break;case"img":case"image":case"link":He("error",r),He("load",r),f=c;break;case"details":He("toggle",r),f=c;break;case"input":su(r,c),f=co(r,c),He("invalid",r);break;case"option":f=c;break;case"select":r._wrapperState={wasMultiple:!!c.multiple},f=ee({},c,{value:void 0}),He("invalid",r);break;case"textarea":ou(r,c),f=fo(r,c),He("invalid",r);break;default:f=c}Zl(a,f),E=f;for(p in E)if(E.hasOwnProperty(p)){var R=E[p];p==="style"?pg(r,R):p==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,R!=null&&dg(r,R)):p==="children"?typeof R=="string"?(a!=="textarea"||R!=="")&&pi(r,R):typeof R=="number"&&pi(r,""+R):p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&p!=="autoFocus"&&(i.hasOwnProperty(p)?R!=null&&p==="onScroll"&&He("scroll",r):R!=null&&A(r,p,R,S))}switch(a){case"input":yr(r),vr(r,c,!1);break;case"textarea":yr(r),$e(r);break;case"option":c.value!=null&&r.setAttribute("value",""+ke(c.value));break;case"select":r.multiple=!!c.multiple,p=c.value,p!=null?Nr(r,!!c.multiple,p,!1):c.defaultValue!=null&&Nr(r,!!c.multiple,c.defaultValue,!0);break;default:typeof f.onClick=="function"&&(r.onclick=bu)}switch(a){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}}c&&(s.flags|=4)}s.ref!==null&&(s.flags|=512,s.flags|=2097152)}return Ft(s),null;case 6:if(r&&s.stateNode!=null)Cy(r,s,r.memoizedProps,c);else{if(typeof c!="string"&&s.stateNode===null)throw Error(n(166));if(a=Is(zi.current),Is(sr.current),Nu(s)){if(c=s.stateNode,a=s.memoizedProps,c[rr]=s,(p=c.nodeValue!==a)&&(r=mn,r!==null))switch(r.tag){case 3:Pu(c.nodeValue,a,(r.mode&1)!==0);break;case 5:r.memoizedProps.suppressHydrationWarning!==!0&&Pu(c.nodeValue,a,(r.mode&1)!==0)}p&&(s.flags|=4)}else c=(a.nodeType===9?a:a.ownerDocument).createTextNode(c),c[rr]=s,s.stateNode=c}return Ft(s),null;case 13:if(Ke(Ze),c=s.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(Je&&gn!==null&&(s.mode&1)!==0&&(s.flags&128)===0)I0(),Io(),s.flags|=98560,p=!1;else if(p=Nu(s),c!==null&&c.dehydrated!==null){if(r===null){if(!p)throw Error(n(318));if(p=s.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(n(317));p[rr]=s}else Io(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Ft(s),p=!1}else Vn!==null&&(Od(Vn),Vn=null),p=!0;if(!p)return s.flags&65536?s:null}return(s.flags&128)!==0?(s.lanes=a,s):(c=c!==null,c!==(r!==null&&r.memoizedState!==null)&&c&&(s.child.flags|=8192,(s.mode&1)!==0&&(r===null||(Ze.current&1)!==0?gt===0&&(gt=3):Nd())),s.updateQueue!==null&&(s.flags|=4),Ft(s),null);case 4:return Mo(),xd(r,s),r===null&&Ni(s.stateNode.containerInfo),Ft(s),null;case 10:return Qf(s.type._context),Ft(s),null;case 17:return Zt(s.type)&&Ru(),Ft(s),null;case 19:if(Ke(Ze),p=s.memoizedState,p===null)return Ft(s),null;if(c=(s.flags&128)!==0,S=p.rendering,S===null)if(c)Hi(p,!1);else{if(gt!==0||r!==null&&(r.flags&128)!==0)for(r=s.child;r!==null;){if(S=Uu(r),S!==null){for(s.flags|=128,Hi(p,!1),c=S.updateQueue,c!==null&&(s.updateQueue=c,s.flags|=4),s.subtreeFlags=0,c=a,a=s.child;a!==null;)p=a,r=c,p.flags&=14680066,S=p.alternate,S===null?(p.childLanes=0,p.lanes=r,p.child=null,p.subtreeFlags=0,p.memoizedProps=null,p.memoizedState=null,p.updateQueue=null,p.dependencies=null,p.stateNode=null):(p.childLanes=S.childLanes,p.lanes=S.lanes,p.child=S.child,p.subtreeFlags=0,p.deletions=null,p.memoizedProps=S.memoizedProps,p.memoizedState=S.memoizedState,p.updateQueue=S.updateQueue,p.type=S.type,r=S.dependencies,p.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),a=a.sibling;return Ve(Ze,Ze.current&1|2),s.child}r=r.sibling}p.tail!==null&&ut()>jo&&(s.flags|=128,c=!0,Hi(p,!1),s.lanes=4194304)}else{if(!c)if(r=Uu(S),r!==null){if(s.flags|=128,c=!0,a=r.updateQueue,a!==null&&(s.updateQueue=a,s.flags|=4),Hi(p,!0),p.tail===null&&p.tailMode==="hidden"&&!S.alternate&&!Je)return Ft(s),null}else 2*ut()-p.renderingStartTime>jo&&a!==1073741824&&(s.flags|=128,c=!0,Hi(p,!1),s.lanes=4194304);p.isBackwards?(S.sibling=s.child,s.child=S):(a=p.last,a!==null?a.sibling=S:s.child=S,p.last=S)}return p.tail!==null?(s=p.tail,p.rendering=s,p.tail=s.sibling,p.renderingStartTime=ut(),s.sibling=null,a=Ze.current,Ve(Ze,c?a&1|2:a&1),s):(Ft(s),null);case 22:case 23:return Ld(),c=s.memoizedState!==null,r!==null&&r.memoizedState!==null!==c&&(s.flags|=8192),c&&(s.mode&1)!==0?(yn&1073741824)!==0&&(Ft(s),s.subtreeFlags&6&&(s.flags|=8192)):Ft(s),null;case 24:return null;case 25:return null}throw Error(n(156,s.tag))}function PC(r,s){switch(Bf(s),s.tag){case 1:return Zt(s.type)&&Ru(),r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 3:return Mo(),Ke(Xt),Ke(jt),td(),r=s.flags,(r&65536)!==0&&(r&128)===0?(s.flags=r&-65537|128,s):null;case 5:return Zf(s),null;case 13:if(Ke(Ze),r=s.memoizedState,r!==null&&r.dehydrated!==null){if(s.alternate===null)throw Error(n(340));Io()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 19:return Ke(Ze),null;case 4:return Mo(),null;case 10:return Qf(s.type._context),null;case 22:case 23:return Ld(),null;case 24:return null;default:return null}}var Ju=!1,Dt=!1,bC=typeof WeakSet=="function"?WeakSet:Set,de=null;function No(r,s){var a=r.ref;if(a!==null)if(typeof a=="function")try{a(null)}catch(c){nt(r,s,c)}else a.current=null}function wd(r,s,a){try{a()}catch(c){nt(r,s,c)}}var Py=!1;function IC(r,s){if(Lf=mu,r=s0(),Cf(r)){if("selectionStart"in r)var a={start:r.selectionStart,end:r.selectionEnd};else e:{a=(a=r.ownerDocument)&&a.defaultView||window;var c=a.getSelection&&a.getSelection();if(c&&c.rangeCount!==0){a=c.anchorNode;var f=c.anchorOffset,p=c.focusNode;c=c.focusOffset;try{a.nodeType,p.nodeType}catch{a=null;break e}var S=0,E=-1,R=-1,K=0,oe=0,ie=r,re=null;t:for(;;){for(var fe;ie!==a||f!==0&&ie.nodeType!==3||(E=S+f),ie!==p||c!==0&&ie.nodeType!==3||(R=S+c),ie.nodeType===3&&(S+=ie.nodeValue.length),(fe=ie.firstChild)!==null;)re=ie,ie=fe;for(;;){if(ie===r)break t;if(re===a&&++K===f&&(E=S),re===p&&++oe===c&&(R=S),(fe=ie.nextSibling)!==null)break;ie=re,re=ie.parentNode}ie=fe}a=E===-1||R===-1?null:{start:E,end:R}}else a=null}a=a||{start:0,end:0}}else a=null;for(Nf={focusedElem:r,selectionRange:a},mu=!1,de=s;de!==null;)if(s=de,r=s.child,(s.subtreeFlags&1028)!==0&&r!==null)r.return=s,de=r;else for(;de!==null;){s=de;try{var pe=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(pe!==null){var ge=pe.memoizedProps,ct=pe.memoizedState,U=s.stateNode,O=U.getSnapshotBeforeUpdate(s.elementType===s.type?ge:qn(s.type,ge),ct);U.__reactInternalSnapshotBeforeUpdate=O}break;case 3:var V=s.stateNode.containerInfo;V.nodeType===1?V.textContent="":V.nodeType===9&&V.documentElement&&V.removeChild(V.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ae){nt(s,s.return,ae)}if(r=s.sibling,r!==null){r.return=s.return,de=r;break}de=s.return}return pe=Py,Py=!1,pe}function Ki(r,s,a){var c=s.updateQueue;if(c=c!==null?c.lastEffect:null,c!==null){var f=c=c.next;do{if((f.tag&r)===r){var p=f.destroy;f.destroy=void 0,p!==void 0&&wd(s,a,p)}f=f.next}while(f!==c)}}function Gu(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 c=a.create;a.destroy=c()}a=a.next}while(a!==s)}}function kd(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 by(r){var s=r.alternate;s!==null&&(r.alternate=null,by(s)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(s=r.stateNode,s!==null&&(delete s[rr],delete s[ji],delete s[Ff],delete s[lC],delete s[fC])),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 Iy(r){return r.tag===5||r.tag===3||r.tag===4}function Ry(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Iy(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 _d(r,s,a){var c=r.tag;if(c===5||c===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=bu));else if(c!==4&&(r=r.child,r!==null))for(_d(r,s,a),r=r.sibling;r!==null;)_d(r,s,a),r=r.sibling}function Ed(r,s,a){var c=r.tag;if(c===5||c===6)r=r.stateNode,s?a.insertBefore(r,s):a.appendChild(r);else if(c!==4&&(r=r.child,r!==null))for(Ed(r,s,a),r=r.sibling;r!==null;)Ed(r,s,a),r=r.sibling}var Mt=null,Wn=!1;function Kr(r,s,a){for(a=a.child;a!==null;)Ty(r,s,a),a=a.sibling}function Ty(r,s,a){if(nr&&typeof nr.onCommitFiberUnmount=="function")try{nr.onCommitFiberUnmount(cu,a)}catch{}switch(a.tag){case 5:Dt||No(a,s);case 6:var c=Mt,f=Wn;Mt=null,Kr(r,s,a),Mt=c,Wn=f,Mt!==null&&(Wn?(r=Mt,a=a.stateNode,r.nodeType===8?r.parentNode.removeChild(a):r.removeChild(a)):Mt.removeChild(a.stateNode));break;case 18:Mt!==null&&(Wn?(r=Mt,a=a.stateNode,r.nodeType===8?$f(r.parentNode,a):r.nodeType===1&&$f(r,a),Ci(r)):$f(Mt,a.stateNode));break;case 4:c=Mt,f=Wn,Mt=a.stateNode.containerInfo,Wn=!0,Kr(r,s,a),Mt=c,Wn=f;break;case 0:case 11:case 14:case 15:if(!Dt&&(c=a.updateQueue,c!==null&&(c=c.lastEffect,c!==null))){f=c=c.next;do{var p=f,S=p.destroy;p=p.tag,S!==void 0&&((p&2)!==0||(p&4)!==0)&&wd(a,s,S),f=f.next}while(f!==c)}Kr(r,s,a);break;case 1:if(!Dt&&(No(a,s),c=a.stateNode,typeof c.componentWillUnmount=="function"))try{c.props=a.memoizedProps,c.state=a.memoizedState,c.componentWillUnmount()}catch(E){nt(a,s,E)}Kr(r,s,a);break;case 21:Kr(r,s,a);break;case 22:a.mode&1?(Dt=(c=Dt)||a.memoizedState!==null,Kr(r,s,a),Dt=c):Kr(r,s,a);break;default:Kr(r,s,a)}}function Oy(r){var s=r.updateQueue;if(s!==null){r.updateQueue=null;var a=r.stateNode;a===null&&(a=r.stateNode=new bC),s.forEach(function(c){var f=$C.bind(null,r,c);a.has(c)||(a.add(c),c.then(f,f))})}}function Hn(r,s){var a=s.deletions;if(a!==null)for(var c=0;c<a.length;c++){var f=a[c];try{var p=r,S=s,E=S;e:for(;E!==null;){switch(E.tag){case 5:Mt=E.stateNode,Wn=!1;break e;case 3:Mt=E.stateNode.containerInfo,Wn=!0;break e;case 4:Mt=E.stateNode.containerInfo,Wn=!0;break e}E=E.return}if(Mt===null)throw Error(n(160));Ty(p,S,f),Mt=null,Wn=!1;var R=f.alternate;R!==null&&(R.return=null),f.return=null}catch(K){nt(f,s,K)}}if(s.subtreeFlags&12854)for(s=s.child;s!==null;)My(s,r),s=s.sibling}function My(r,s){var a=r.alternate,c=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:if(Hn(s,r),ir(r),c&4){try{Ki(3,r,r.return),Gu(3,r)}catch(ge){nt(r,r.return,ge)}try{Ki(5,r,r.return)}catch(ge){nt(r,r.return,ge)}}break;case 1:Hn(s,r),ir(r),c&512&&a!==null&&No(a,a.return);break;case 5:if(Hn(s,r),ir(r),c&512&&a!==null&&No(a,a.return),r.flags&32){var f=r.stateNode;try{pi(f,"")}catch(ge){nt(r,r.return,ge)}}if(c&4&&(f=r.stateNode,f!=null)){var p=r.memoizedProps,S=a!==null?a.memoizedProps:p,E=r.type,R=r.updateQueue;if(r.updateQueue=null,R!==null)try{E==="input"&&p.type==="radio"&&p.name!=null&&di(f,p),ef(E,S);var K=ef(E,p);for(S=0;S<R.length;S+=2){var oe=R[S],ie=R[S+1];oe==="style"?pg(f,ie):oe==="dangerouslySetInnerHTML"?dg(f,ie):oe==="children"?pi(f,ie):A(f,oe,ie,K)}switch(E){case"input":lo(f,p);break;case"textarea":hi(f,p);break;case"select":var re=f._wrapperState.wasMultiple;f._wrapperState.wasMultiple=!!p.multiple;var fe=p.value;fe!=null?Nr(f,!!p.multiple,fe,!1):re!==!!p.multiple&&(p.defaultValue!=null?Nr(f,!!p.multiple,p.defaultValue,!0):Nr(f,!!p.multiple,p.multiple?[]:"",!1))}f[ji]=p}catch(ge){nt(r,r.return,ge)}}break;case 6:if(Hn(s,r),ir(r),c&4){if(r.stateNode===null)throw Error(n(162));f=r.stateNode,p=r.memoizedProps;try{f.nodeValue=p}catch(ge){nt(r,r.return,ge)}}break;case 3:if(Hn(s,r),ir(r),c&4&&a!==null&&a.memoizedState.isDehydrated)try{Ci(s.containerInfo)}catch(ge){nt(r,r.return,ge)}break;case 4:Hn(s,r),ir(r);break;case 13:Hn(s,r),ir(r),f=r.child,f.flags&8192&&(p=f.memoizedState!==null,f.stateNode.isHidden=p,!p||f.alternate!==null&&f.alternate.memoizedState!==null||(bd=ut())),c&4&&Oy(r);break;case 22:if(oe=a!==null&&a.memoizedState!==null,r.mode&1?(Dt=(K=Dt)||oe,Hn(s,r),Dt=K):Hn(s,r),ir(r),c&8192){if(K=r.memoizedState!==null,(r.stateNode.isHidden=K)&&!oe&&(r.mode&1)!==0)for(de=r,oe=r.child;oe!==null;){for(ie=de=oe;de!==null;){switch(re=de,fe=re.child,re.tag){case 0:case 11:case 14:case 15:Ki(4,re,re.return);break;case 1:No(re,re.return);var pe=re.stateNode;if(typeof pe.componentWillUnmount=="function"){c=re,a=re.return;try{s=c,pe.props=s.memoizedProps,pe.state=s.memoizedState,pe.componentWillUnmount()}catch(ge){nt(c,a,ge)}}break;case 5:No(re,re.return);break;case 22:if(re.memoizedState!==null){Ay(ie);continue}}fe!==null?(fe.return=re,de=fe):Ay(ie)}oe=oe.sibling}e:for(oe=null,ie=r;;){if(ie.tag===5){if(oe===null){oe=ie;try{f=ie.stateNode,K?(p=f.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none"):(E=ie.stateNode,R=ie.memoizedProps.style,S=R!=null&&R.hasOwnProperty("display")?R.display:null,E.style.display=hg("display",S))}catch(ge){nt(r,r.return,ge)}}}else if(ie.tag===6){if(oe===null)try{ie.stateNode.nodeValue=K?"":ie.memoizedProps}catch(ge){nt(r,r.return,ge)}}else if((ie.tag!==22&&ie.tag!==23||ie.memoizedState===null||ie===r)&&ie.child!==null){ie.child.return=ie,ie=ie.child;continue}if(ie===r)break e;for(;ie.sibling===null;){if(ie.return===null||ie.return===r)break e;oe===ie&&(oe=null),ie=ie.return}oe===ie&&(oe=null),ie.sibling.return=ie.return,ie=ie.sibling}}break;case 19:Hn(s,r),ir(r),c&4&&Oy(r);break;case 21:break;default:Hn(s,r),ir(r)}}function ir(r){var s=r.flags;if(s&2){try{e:{for(var a=r.return;a!==null;){if(Iy(a)){var c=a;break e}a=a.return}throw Error(n(160))}switch(c.tag){case 5:var f=c.stateNode;c.flags&32&&(pi(f,""),c.flags&=-33);var p=Ry(r);Ed(r,p,f);break;case 3:case 4:var S=c.stateNode.containerInfo,E=Ry(r);_d(r,E,S);break;default:throw Error(n(161))}}catch(R){nt(r,r.return,R)}r.flags&=-3}s&4096&&(r.flags&=-4097)}function RC(r,s,a){de=r,Ly(r)}function Ly(r,s,a){for(var c=(r.mode&1)!==0;de!==null;){var f=de,p=f.child;if(f.tag===22&&c){var S=f.memoizedState!==null||Ju;if(!S){var E=f.alternate,R=E!==null&&E.memoizedState!==null||Dt;E=Ju;var K=Dt;if(Ju=S,(Dt=R)&&!K)for(de=f;de!==null;)S=de,R=S.child,S.tag===22&&S.memoizedState!==null?jy(f):R!==null?(R.return=S,de=R):jy(f);for(;p!==null;)de=p,Ly(p),p=p.sibling;de=f,Ju=E,Dt=K}Ny(r)}else(f.subtreeFlags&8772)!==0&&p!==null?(p.return=f,de=p):Ny(r)}}function Ny(r){for(;de!==null;){var s=de;if((s.flags&8772)!==0){var a=s.alternate;try{if((s.flags&8772)!==0)switch(s.tag){case 0:case 11:case 15:Dt||Gu(5,s);break;case 1:var c=s.stateNode;if(s.flags&4&&!Dt)if(a===null)c.componentDidMount();else{var f=s.elementType===s.type?a.memoizedProps:qn(s.type,a.memoizedProps);c.componentDidUpdate(f,a.memoizedState,c.__reactInternalSnapshotBeforeUpdate)}var p=s.updateQueue;p!==null&&A0(s,p,c);break;case 3:var S=s.updateQueue;if(S!==null){if(a=null,s.child!==null)switch(s.child.tag){case 5:a=s.child.stateNode;break;case 1:a=s.child.stateNode}A0(s,S,a)}break;case 5:var E=s.stateNode;if(a===null&&s.flags&4){a=E;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 K=s.alternate;if(K!==null){var oe=K.memoizedState;if(oe!==null){var ie=oe.dehydrated;ie!==null&&Ci(ie)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Dt||s.flags&512&&kd(s)}catch(re){nt(s,s.return,re)}}if(s===r){de=null;break}if(a=s.sibling,a!==null){a.return=s.return,de=a;break}de=s.return}}function Ay(r){for(;de!==null;){var s=de;if(s===r){de=null;break}var a=s.sibling;if(a!==null){a.return=s.return,de=a;break}de=s.return}}function jy(r){for(;de!==null;){var s=de;try{switch(s.tag){case 0:case 11:case 15:var a=s.return;try{Gu(4,s)}catch(R){nt(s,a,R)}break;case 1:var c=s.stateNode;if(typeof c.componentDidMount=="function"){var f=s.return;try{c.componentDidMount()}catch(R){nt(s,f,R)}}var p=s.return;try{kd(s)}catch(R){nt(s,p,R)}break;case 5:var S=s.return;try{kd(s)}catch(R){nt(s,S,R)}}}catch(R){nt(s,s.return,R)}if(s===r){de=null;break}var E=s.sibling;if(E!==null){E.return=s.return,de=E;break}de=s.return}}var TC=Math.ceil,Yu=P.ReactCurrentDispatcher,Cd=P.ReactCurrentOwner,Tn=P.ReactCurrentBatchConfig,Le=0,wt=null,dt=null,Lt=0,yn=0,Ao=Br(0),gt=0,Qi=null,Ts=0,Xu=0,Pd=0,Ji=null,tn=null,bd=0,jo=1/0,Pr=null,Zu=!1,Id=null,Qr=null,ec=!1,Jr=null,tc=0,Gi=0,Rd=null,nc=-1,rc=0;function Ht(){return(Le&6)!==0?ut():nc!==-1?nc:nc=ut()}function Gr(r){return(r.mode&1)===0?1:(Le&2)!==0&&Lt!==0?Lt&-Lt:hC.transition!==null?(rc===0&&(rc=Rg()),rc):(r=Fe,r!==0||(r=window.event,r=r===void 0?16:Fg(r.type)),r)}function Kn(r,s,a,c){if(50<Gi)throw Gi=0,Rd=null,Error(n(185));xi(r,a,c),((Le&2)===0||r!==wt)&&(r===wt&&((Le&2)===0&&(Xu|=a),gt===4&&Yr(r,Lt)),nn(r,c),a===1&&Le===0&&(s.mode&1)===0&&(jo=ut()+500,Ou&&qr()))}function nn(r,s){var a=r.callbackNode;hE(r,s);var c=du(r,r===wt?Lt:0);if(c===0)a!==null&&Pg(a),r.callbackNode=null,r.callbackPriority=0;else if(s=c&-c,r.callbackPriority!==s){if(a!=null&&Pg(a),s===1)r.tag===0?dC(Fy.bind(null,r)):_0(Fy.bind(null,r)),uC(function(){(Le&6)===0&&qr()}),a=null;else{switch(Tg(c)){case 1:a=uf;break;case 4:a=bg;break;case 16:a=uu;break;case 536870912:a=Ig;break;default:a=uu}a=Hy(a,$y.bind(null,r))}r.callbackPriority=s,r.callbackNode=a}}function $y(r,s){if(nc=-1,rc=0,(Le&6)!==0)throw Error(n(327));var a=r.callbackNode;if($o()&&r.callbackNode!==a)return null;var c=du(r,r===wt?Lt:0);if(c===0)return null;if((c&30)!==0||(c&r.expiredLanes)!==0||s)s=sc(r,c);else{s=c;var f=Le;Le|=2;var p=Uy();(wt!==r||Lt!==s)&&(Pr=null,jo=ut()+500,Ms(r,s));do try{LC();break}catch(E){Dy(r,E)}while(!0);Kf(),Yu.current=p,Le=f,dt!==null?s=0:(wt=null,Lt=0,s=gt)}if(s!==0){if(s===2&&(f=cf(r),f!==0&&(c=f,s=Td(r,f))),s===1)throw a=Qi,Ms(r,0),Yr(r,c),nn(r,ut()),a;if(s===6)Yr(r,c);else{if(f=r.current.alternate,(c&30)===0&&!OC(f)&&(s=sc(r,c),s===2&&(p=cf(r),p!==0&&(c=p,s=Td(r,p))),s===1))throw a=Qi,Ms(r,0),Yr(r,c),nn(r,ut()),a;switch(r.finishedWork=f,r.finishedLanes=c,s){case 0:case 1:throw Error(n(345));case 2:Ls(r,tn,Pr);break;case 3:if(Yr(r,c),(c&130023424)===c&&(s=bd+500-ut(),10<s)){if(du(r,0)!==0)break;if(f=r.suspendedLanes,(f&c)!==c){Ht(),r.pingedLanes|=r.suspendedLanes&f;break}r.timeoutHandle=jf(Ls.bind(null,r,tn,Pr),s);break}Ls(r,tn,Pr);break;case 4:if(Yr(r,c),(c&4194240)===c)break;for(s=r.eventTimes,f=-1;0<c;){var S=31-zn(c);p=1<<S,S=s[S],S>f&&(f=S),c&=~p}if(c=f,c=ut()-c,c=(120>c?120:480>c?480:1080>c?1080:1920>c?1920:3e3>c?3e3:4320>c?4320:1960*TC(c/1960))-c,10<c){r.timeoutHandle=jf(Ls.bind(null,r,tn,Pr),c);break}Ls(r,tn,Pr);break;case 5:Ls(r,tn,Pr);break;default:throw Error(n(329))}}}return nn(r,ut()),r.callbackNode===a?$y.bind(null,r):null}function Td(r,s){var a=Ji;return r.current.memoizedState.isDehydrated&&(Ms(r,s).flags|=256),r=sc(r,s),r!==2&&(s=tn,tn=a,s!==null&&Od(s)),r}function Od(r){tn===null?tn=r:tn.push.apply(tn,r)}function OC(r){for(var s=r;;){if(s.flags&16384){var a=s.updateQueue;if(a!==null&&(a=a.stores,a!==null))for(var c=0;c<a.length;c++){var f=a[c],p=f.getSnapshot;f=f.value;try{if(!Bn(p(),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 Yr(r,s){for(s&=~Pd,s&=~Xu,r.suspendedLanes|=s,r.pingedLanes&=~s,r=r.expirationTimes;0<s;){var a=31-zn(s),c=1<<a;r[a]=-1,s&=~c}}function Fy(r){if((Le&6)!==0)throw Error(n(327));$o();var s=du(r,0);if((s&1)===0)return nn(r,ut()),null;var a=sc(r,s);if(r.tag!==0&&a===2){var c=cf(r);c!==0&&(s=c,a=Td(r,c))}if(a===1)throw a=Qi,Ms(r,0),Yr(r,s),nn(r,ut()),a;if(a===6)throw Error(n(345));return r.finishedWork=r.current.alternate,r.finishedLanes=s,Ls(r,tn,Pr),nn(r,ut()),null}function Md(r,s){var a=Le;Le|=1;try{return r(s)}finally{Le=a,Le===0&&(jo=ut()+500,Ou&&qr())}}function Os(r){Jr!==null&&Jr.tag===0&&(Le&6)===0&&$o();var s=Le;Le|=1;var a=Tn.transition,c=Fe;try{if(Tn.transition=null,Fe=1,r)return r()}finally{Fe=c,Tn.transition=a,Le=s,(Le&6)===0&&qr()}}function Ld(){yn=Ao.current,Ke(Ao)}function Ms(r,s){r.finishedWork=null,r.finishedLanes=0;var a=r.timeoutHandle;if(a!==-1&&(r.timeoutHandle=-1,aC(a)),dt!==null)for(a=dt.return;a!==null;){var c=a;switch(Bf(c),c.tag){case 1:c=c.type.childContextTypes,c!=null&&Ru();break;case 3:Mo(),Ke(Xt),Ke(jt),td();break;case 5:Zf(c);break;case 4:Mo();break;case 13:Ke(Ze);break;case 19:Ke(Ze);break;case 10:Qf(c.type._context);break;case 22:case 23:Ld()}a=a.return}if(wt=r,dt=r=Xr(r.current,null),Lt=yn=s,gt=0,Qi=null,Pd=Xu=Ts=0,tn=Ji=null,bs!==null){for(s=0;s<bs.length;s++)if(a=bs[s],c=a.interleaved,c!==null){a.interleaved=null;var f=c.next,p=a.pending;if(p!==null){var S=p.next;p.next=f,c.next=S}a.pending=c}bs=null}return r}function Dy(r,s){do{var a=dt;try{if(Kf(),zu.current=Wu,Bu){for(var c=et.memoizedState;c!==null;){var f=c.queue;f!==null&&(f.pending=null),c=c.next}Bu=!1}if(Rs=0,xt=mt=et=null,Bi=!1,Vi=0,Cd.current=null,a===null||a.return===null){gt=1,Qi=s,dt=null;break}e:{var p=r,S=a.return,E=a,R=s;if(s=Lt,E.flags|=32768,R!==null&&typeof R=="object"&&typeof R.then=="function"){var K=R,oe=E,ie=oe.tag;if((oe.mode&1)===0&&(ie===0||ie===11||ie===15)){var re=oe.alternate;re?(oe.updateQueue=re.updateQueue,oe.memoizedState=re.memoizedState,oe.lanes=re.lanes):(oe.updateQueue=null,oe.memoizedState=null)}var fe=ly(S);if(fe!==null){fe.flags&=-257,fy(fe,S,E,p,s),fe.mode&1&&cy(p,K,s),s=fe,R=K;var pe=s.updateQueue;if(pe===null){var ge=new Set;ge.add(R),s.updateQueue=ge}else pe.add(R);break e}else{if((s&1)===0){cy(p,K,s),Nd();break e}R=Error(n(426))}}else if(Je&&E.mode&1){var ct=ly(S);if(ct!==null){(ct.flags&65536)===0&&(ct.flags|=256),fy(ct,S,E,p,s),Wf(Lo(R,E));break e}}p=R=Lo(R,E),gt!==4&&(gt=2),Ji===null?Ji=[p]:Ji.push(p),p=S;do{switch(p.tag){case 3:p.flags|=65536,s&=-s,p.lanes|=s;var U=ay(p,R,s);N0(p,U);break e;case 1:E=R;var O=p.type,V=p.stateNode;if((p.flags&128)===0&&(typeof O.getDerivedStateFromError=="function"||V!==null&&typeof V.componentDidCatch=="function"&&(Qr===null||!Qr.has(V)))){p.flags|=65536,s&=-s,p.lanes|=s;var ae=uy(p,E,s);N0(p,ae);break e}}p=p.return}while(p!==null)}By(a)}catch(ye){s=ye,dt===a&&a!==null&&(dt=a=a.return);continue}break}while(!0)}function Uy(){var r=Yu.current;return Yu.current=Wu,r===null?Wu:r}function Nd(){(gt===0||gt===3||gt===2)&&(gt=4),wt===null||(Ts&268435455)===0&&(Xu&268435455)===0||Yr(wt,Lt)}function sc(r,s){var a=Le;Le|=2;var c=Uy();(wt!==r||Lt!==s)&&(Pr=null,Ms(r,s));do try{MC();break}catch(f){Dy(r,f)}while(!0);if(Kf(),Le=a,Yu.current=c,dt!==null)throw Error(n(261));return wt=null,Lt=0,gt}function MC(){for(;dt!==null;)zy(dt)}function LC(){for(;dt!==null&&!sE();)zy(dt)}function zy(r){var s=Wy(r.alternate,r,yn);r.memoizedProps=r.pendingProps,s===null?By(r):dt=s,Cd.current=null}function By(r){var s=r;do{var a=s.alternate;if(r=s.return,(s.flags&32768)===0){if(a=CC(a,s,yn),a!==null){dt=a;return}}else{if(a=PC(a,s),a!==null){a.flags&=32767,dt=a;return}if(r!==null)r.flags|=32768,r.subtreeFlags=0,r.deletions=null;else{gt=6,dt=null;return}}if(s=s.sibling,s!==null){dt=s;return}dt=s=r}while(s!==null);gt===0&&(gt=5)}function Ls(r,s,a){var c=Fe,f=Tn.transition;try{Tn.transition=null,Fe=1,NC(r,s,a,c)}finally{Tn.transition=f,Fe=c}return null}function NC(r,s,a,c){do $o();while(Jr!==null);if((Le&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 p=a.lanes|a.childLanes;if(pE(r,p),r===wt&&(dt=wt=null,Lt=0),(a.subtreeFlags&2064)===0&&(a.flags&2064)===0||ec||(ec=!0,Hy(uu,function(){return $o(),null})),p=(a.flags&15990)!==0,(a.subtreeFlags&15990)!==0||p){p=Tn.transition,Tn.transition=null;var S=Fe;Fe=1;var E=Le;Le|=4,Cd.current=null,IC(r,a),My(a,r),eC(Nf),mu=!!Lf,Nf=Lf=null,r.current=a,RC(a),oE(),Le=E,Fe=S,Tn.transition=p}else r.current=a;if(ec&&(ec=!1,Jr=r,tc=f),p=r.pendingLanes,p===0&&(Qr=null),uE(a.stateNode),nn(r,ut()),s!==null)for(c=r.onRecoverableError,a=0;a<s.length;a++)f=s[a],c(f.value,{componentStack:f.stack,digest:f.digest});if(Zu)throw Zu=!1,r=Id,Id=null,r;return(tc&1)!==0&&r.tag!==0&&$o(),p=r.pendingLanes,(p&1)!==0?r===Rd?Gi++:(Gi=0,Rd=r):Gi=0,qr(),null}function $o(){if(Jr!==null){var r=Tg(tc),s=Tn.transition,a=Fe;try{if(Tn.transition=null,Fe=16>r?16:r,Jr===null)var c=!1;else{if(r=Jr,Jr=null,tc=0,(Le&6)!==0)throw Error(n(331));var f=Le;for(Le|=4,de=r.current;de!==null;){var p=de,S=p.child;if((de.flags&16)!==0){var E=p.deletions;if(E!==null){for(var R=0;R<E.length;R++){var K=E[R];for(de=K;de!==null;){var oe=de;switch(oe.tag){case 0:case 11:case 15:Ki(8,oe,p)}var ie=oe.child;if(ie!==null)ie.return=oe,de=ie;else for(;de!==null;){oe=de;var re=oe.sibling,fe=oe.return;if(by(oe),oe===K){de=null;break}if(re!==null){re.return=fe,de=re;break}de=fe}}}var pe=p.alternate;if(pe!==null){var ge=pe.child;if(ge!==null){pe.child=null;do{var ct=ge.sibling;ge.sibling=null,ge=ct}while(ge!==null)}}de=p}}if((p.subtreeFlags&2064)!==0&&S!==null)S.return=p,de=S;else e:for(;de!==null;){if(p=de,(p.flags&2048)!==0)switch(p.tag){case 0:case 11:case 15:Ki(9,p,p.return)}var U=p.sibling;if(U!==null){U.return=p.return,de=U;break e}de=p.return}}var O=r.current;for(de=O;de!==null;){S=de;var V=S.child;if((S.subtreeFlags&2064)!==0&&V!==null)V.return=S,de=V;else e:for(S=O;de!==null;){if(E=de,(E.flags&2048)!==0)try{switch(E.tag){case 0:case 11:case 15:Gu(9,E)}}catch(ye){nt(E,E.return,ye)}if(E===S){de=null;break e}var ae=E.sibling;if(ae!==null){ae.return=E.return,de=ae;break e}de=E.return}}if(Le=f,qr(),nr&&typeof nr.onPostCommitFiberRoot=="function")try{nr.onPostCommitFiberRoot(cu,r)}catch{}c=!0}return c}finally{Fe=a,Tn.transition=s}}return!1}function Vy(r,s,a){s=Lo(a,s),s=ay(r,s,1),r=Hr(r,s,1),s=Ht(),r!==null&&(xi(r,1,s),nn(r,s))}function nt(r,s,a){if(r.tag===3)Vy(r,r,a);else for(;s!==null;){if(s.tag===3){Vy(s,r,a);break}else if(s.tag===1){var c=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Qr===null||!Qr.has(c))){r=Lo(a,r),r=uy(s,r,1),s=Hr(s,r,1),r=Ht(),s!==null&&(xi(s,1,r),nn(s,r));break}}s=s.return}}function AC(r,s,a){var c=r.pingCache;c!==null&&c.delete(s),s=Ht(),r.pingedLanes|=r.suspendedLanes&a,wt===r&&(Lt&a)===a&&(gt===4||gt===3&&(Lt&130023424)===Lt&&500>ut()-bd?Ms(r,0):Pd|=a),nn(r,s)}function qy(r,s){s===0&&((r.mode&1)===0?s=1:(s=fu,fu<<=1,(fu&130023424)===0&&(fu=4194304)));var a=Ht();r=_r(r,s),r!==null&&(xi(r,s,a),nn(r,a))}function jC(r){var s=r.memoizedState,a=0;s!==null&&(a=s.retryLane),qy(r,a)}function $C(r,s){var a=0;switch(r.tag){case 13:var c=r.stateNode,f=r.memoizedState;f!==null&&(a=f.retryLane);break;case 19:c=r.stateNode;break;default:throw Error(n(314))}c!==null&&c.delete(s),qy(r,a)}var Wy;Wy=function(r,s,a){if(r!==null)if(r.memoizedProps!==s.pendingProps||Xt.current)en=!0;else{if((r.lanes&a)===0&&(s.flags&128)===0)return en=!1,EC(r,s,a);en=(r.flags&131072)!==0}else en=!1,Je&&(s.flags&1048576)!==0&&E0(s,Lu,s.index);switch(s.lanes=0,s.tag){case 2:var c=s.type;Qu(r,s),r=s.pendingProps;var f=Co(s,jt.current);Oo(s,a),f=sd(null,s,c,r,f,a);var p=od();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,Zt(c)?(p=!0,Tu(s)):p=!1,s.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,Yf(s),f.updater=Hu,s.stateNode=f,f._reactInternals=s,fd(s,c,r,a),s=md(null,s,c,!0,p,a)):(s.tag=0,Je&&p&&zf(s),Wt(null,s,f,a),s=s.child),s;case 16:c=s.elementType;e:{switch(Qu(r,s),r=s.pendingProps,f=c._init,c=f(c._payload),s.type=c,f=s.tag=DC(c),r=qn(c,r),f){case 0:s=pd(null,s,c,r,a);break e;case 1:s=yy(null,s,c,r,a);break e;case 11:s=dy(null,s,c,r,a);break e;case 14:s=hy(null,s,c,qn(c.type,r),a);break e}throw Error(n(306,c,""))}return s;case 0:return c=s.type,f=s.pendingProps,f=s.elementType===c?f:qn(c,f),pd(r,s,c,f,a);case 1:return c=s.type,f=s.pendingProps,f=s.elementType===c?f:qn(c,f),yy(r,s,c,f,a);case 3:e:{if(vy(s),r===null)throw Error(n(387));c=s.pendingProps,p=s.memoizedState,f=p.element,L0(r,s),Du(s,c,null,a);var S=s.memoizedState;if(c=S.element,p.isDehydrated)if(p={element:c,isDehydrated:!1,cache:S.cache,pendingSuspenseBoundaries:S.pendingSuspenseBoundaries,transitions:S.transitions},s.updateQueue.baseState=p,s.memoizedState=p,s.flags&256){f=Lo(Error(n(423)),s),s=Sy(r,s,c,a,f);break e}else if(c!==f){f=Lo(Error(n(424)),s),s=Sy(r,s,c,a,f);break e}else for(gn=zr(s.stateNode.containerInfo.firstChild),mn=s,Je=!0,Vn=null,a=O0(s,null,c,a),s.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Io(),c===f){s=Cr(r,s,a);break e}Wt(r,s,c,a)}s=s.child}return s;case 5:return j0(s),r===null&&qf(s),c=s.type,f=s.pendingProps,p=r!==null?r.memoizedProps:null,S=f.children,Af(c,f)?S=null:p!==null&&Af(c,p)&&(s.flags|=32),gy(r,s),Wt(r,s,S,a),s.child;case 6:return r===null&&qf(s),null;case 13:return xy(r,s,a);case 4:return Xf(s,s.stateNode.containerInfo),c=s.pendingProps,r===null?s.child=Ro(s,null,c,a):Wt(r,s,c,a),s.child;case 11:return c=s.type,f=s.pendingProps,f=s.elementType===c?f:qn(c,f),dy(r,s,c,f,a);case 7:return Wt(r,s,s.pendingProps,a),s.child;case 8:return Wt(r,s,s.pendingProps.children,a),s.child;case 12:return Wt(r,s,s.pendingProps.children,a),s.child;case 10:e:{if(c=s.type._context,f=s.pendingProps,p=s.memoizedProps,S=f.value,Ve(ju,c._currentValue),c._currentValue=S,p!==null)if(Bn(p.value,S)){if(p.children===f.children&&!Xt.current){s=Cr(r,s,a);break e}}else for(p=s.child,p!==null&&(p.return=s);p!==null;){var E=p.dependencies;if(E!==null){S=p.child;for(var R=E.firstContext;R!==null;){if(R.context===c){if(p.tag===1){R=Er(-1,a&-a),R.tag=2;var K=p.updateQueue;if(K!==null){K=K.shared;var oe=K.pending;oe===null?R.next=R:(R.next=oe.next,oe.next=R),K.pending=R}}p.lanes|=a,R=p.alternate,R!==null&&(R.lanes|=a),Jf(p.return,a,s),E.lanes|=a;break}R=R.next}}else if(p.tag===10)S=p.type===s.type?null:p.child;else if(p.tag===18){if(S=p.return,S===null)throw Error(n(341));S.lanes|=a,E=S.alternate,E!==null&&(E.lanes|=a),Jf(S,a,s),S=p.sibling}else S=p.child;if(S!==null)S.return=p;else for(S=p;S!==null;){if(S===s){S=null;break}if(p=S.sibling,p!==null){p.return=S.return,S=p;break}S=S.return}p=S}Wt(r,s,f.children,a),s=s.child}return s;case 9:return f=s.type,c=s.pendingProps.children,Oo(s,a),f=In(f),c=c(f),s.flags|=1,Wt(r,s,c,a),s.child;case 14:return c=s.type,f=qn(c,s.pendingProps),f=qn(c.type,f),hy(r,s,c,f,a);case 15:return py(r,s,s.type,s.pendingProps,a);case 17:return c=s.type,f=s.pendingProps,f=s.elementType===c?f:qn(c,f),Qu(r,s),s.tag=1,Zt(c)?(r=!0,Tu(s)):r=!1,Oo(s,a),oy(s,c,f),fd(s,c,f,a),md(null,s,c,!0,r,a);case 19:return ky(r,s,a);case 22:return my(r,s,a)}throw Error(n(156,s.tag))};function Hy(r,s){return Cg(r,s)}function FC(r,s,a,c){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=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function On(r,s,a,c){return new FC(r,s,a,c)}function Ad(r){return r=r.prototype,!(!r||!r.isReactComponent)}function DC(r){if(typeof r=="function")return Ad(r)?1:0;if(r!=null){if(r=r.$$typeof,r===ue)return 11;if(r===Y)return 14}return 2}function Xr(r,s){var a=r.alternate;return a===null?(a=On(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 oc(r,s,a,c,f,p){var S=2;if(c=r,typeof r=="function")Ad(r)&&(S=1);else if(typeof r=="string")S=5;else e:switch(r){case $:return Ns(a.children,f,p,s);case D:S=8,f|=8;break;case W:return r=On(12,a,s,f|2),r.elementType=W,r.lanes=p,r;case C:return r=On(13,a,s,f),r.elementType=C,r.lanes=p,r;case H:return r=On(19,a,s,f),r.elementType=H,r.lanes=p,r;case z:return ic(a,f,p,s);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case X:S=10;break e;case Z:S=9;break e;case ue:S=11;break e;case Y:S=14;break e;case Q:S=16,c=null;break e}throw Error(n(130,r==null?r:typeof r,""))}return s=On(S,a,s,f),s.elementType=r,s.type=c,s.lanes=p,s}function Ns(r,s,a,c){return r=On(7,r,c,s),r.lanes=a,r}function ic(r,s,a,c){return r=On(22,r,c,s),r.elementType=z,r.lanes=a,r.stateNode={isHidden:!1},r}function jd(r,s,a){return r=On(6,r,null,s),r.lanes=a,r}function $d(r,s,a){return s=On(4,r.children!==null?r.children:[],r.key,s),s.lanes=a,s.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},s}function UC(r,s,a,c,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=lf(0),this.expirationTimes=lf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=lf(0),this.identifierPrefix=c,this.onRecoverableError=f,this.mutableSourceEagerHydrationData=null}function Fd(r,s,a,c,f,p,S,E,R){return r=new UC(r,s,a,E,R),s===1?(s=1,p===!0&&(s|=8)):s=0,p=On(3,null,null,s),r.current=p,p.stateNode=r,p.memoizedState={element:c,isDehydrated:a,cache:null,transitions:null,pendingSuspenseBoundaries:null},Yf(p),r}function zC(r,s,a){var c=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:F,key:c==null?null:""+c,children:r,containerInfo:s,implementation:a}}function Ky(r){if(!r)return Vr;r=r._reactInternals;e:{if(ks(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(Zt(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(Zt(a))return w0(r,a,s)}return s}function Qy(r,s,a,c,f,p,S,E,R){return r=Fd(a,c,!0,r,f,p,S,E,R),r.context=Ky(null),a=r.current,c=Ht(),f=Gr(a),p=Er(c,f),p.callback=s??null,Hr(a,p,f),r.current.lanes=f,xi(r,f,c),nn(r,c),r}function ac(r,s,a,c){var f=s.current,p=Ht(),S=Gr(f);return a=Ky(a),s.context===null?s.context=a:s.pendingContext=a,s=Er(p,S),s.payload={element:r},c=c===void 0?null:c,c!==null&&(s.callback=c),r=Hr(f,s,S),r!==null&&(Kn(r,f,S,p),Fu(r,f,S)),S}function uc(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 Jy(r,s){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var a=r.retryLane;r.retryLane=a!==0&&a<s?a:s}}function Dd(r,s){Jy(r,s),(r=r.alternate)&&Jy(r,s)}function BC(){return null}var Gy=typeof reportError=="function"?reportError:function(r){console.error(r)};function Ud(r){this._internalRoot=r}cc.prototype.render=Ud.prototype.render=function(r){var s=this._internalRoot;if(s===null)throw Error(n(409));ac(r,s,null,null)},cc.prototype.unmount=Ud.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var s=r.containerInfo;Os(function(){ac(null,r,null,null)}),s[Sr]=null}};function cc(r){this._internalRoot=r}cc.prototype.unstable_scheduleHydration=function(r){if(r){var s=Lg();r={blockedOn:null,target:r,priority:s};for(var a=0;a<Fr.length&&s!==0&&s<Fr[a].priority;a++);Fr.splice(a,0,r),a===0&&jg(r)}};function zd(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function lc(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11&&(r.nodeType!==8||r.nodeValue!==" react-mount-point-unstable "))}function Yy(){}function VC(r,s,a,c,f){if(f){if(typeof c=="function"){var p=c;c=function(){var K=uc(S);p.call(K)}}var S=Qy(s,c,r,0,null,!1,!1,"",Yy);return r._reactRootContainer=S,r[Sr]=S.current,Ni(r.nodeType===8?r.parentNode:r),Os(),S}for(;f=r.lastChild;)r.removeChild(f);if(typeof c=="function"){var E=c;c=function(){var K=uc(R);E.call(K)}}var R=Fd(r,0,!1,null,null,!1,!1,"",Yy);return r._reactRootContainer=R,r[Sr]=R.current,Ni(r.nodeType===8?r.parentNode:r),Os(function(){ac(s,R,a,c)}),R}function fc(r,s,a,c,f){var p=a._reactRootContainer;if(p){var S=p;if(typeof f=="function"){var E=f;f=function(){var R=uc(S);E.call(R)}}ac(s,S,r,f)}else S=VC(a,s,r,f,c);return uc(S)}Og=function(r){switch(r.tag){case 3:var s=r.stateNode;if(s.current.memoizedState.isDehydrated){var a=Si(s.pendingLanes);a!==0&&(ff(s,a|1),nn(s,ut()),(Le&6)===0&&(jo=ut()+500,qr()))}break;case 13:Os(function(){var c=_r(r,1);if(c!==null){var f=Ht();Kn(c,r,1,f)}}),Dd(r,1)}},df=function(r){if(r.tag===13){var s=_r(r,134217728);if(s!==null){var a=Ht();Kn(s,r,134217728,a)}Dd(r,134217728)}},Mg=function(r){if(r.tag===13){var s=Gr(r),a=_r(r,s);if(a!==null){var c=Ht();Kn(a,r,s,c)}Dd(r,s)}},Lg=function(){return Fe},Ng=function(r,s){var a=Fe;try{return Fe=r,s()}finally{Fe=a}},rf=function(r,s,a){switch(s){case"input":if(lo(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 c=a[s];if(c!==r&&c.form===r.form){var f=Iu(c);if(!f)throw Error(n(90));Ss(c),lo(c,f)}}}break;case"textarea":hi(r,a);break;case"select":s=a.value,s!=null&&Nr(r,!!a.multiple,s,!1)}},vg=Md,Sg=Os;var qC={usingClientEntryPoint:!1,Events:[$i,_o,Iu,gg,yg,Md]},Yi={findFiberByHostInstance:_s,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},WC={bundleType:Yi.bundleType,version:Yi.version,rendererPackageName:Yi.rendererPackageName,rendererConfig:Yi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:P.ReactCurrentDispatcher,findHostInstanceByFiber:function(r){return r=_g(r),r===null?null:r.stateNode},findFiberByHostInstance:Yi.findFiberByHostInstance||BC,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 dc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!dc.isDisabled&&dc.supportsFiber)try{cu=dc.inject(WC),nr=dc}catch{}}return rn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=qC,rn.createPortal=function(r,s){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!zd(s))throw Error(n(200));return zC(r,s,null,a)},rn.createRoot=function(r,s){if(!zd(r))throw Error(n(299));var a=!1,c="",f=Gy;return s!=null&&(s.unstable_strictMode===!0&&(a=!0),s.identifierPrefix!==void 0&&(c=s.identifierPrefix),s.onRecoverableError!==void 0&&(f=s.onRecoverableError)),s=Fd(r,1,!1,null,null,a,!1,c,f),r[Sr]=s.current,Ni(r.nodeType===8?r.parentNode:r),new Ud(s)},rn.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=_g(s),r=r===null?null:r.stateNode,r},rn.flushSync=function(r){return Os(r)},rn.hydrate=function(r,s,a){if(!lc(s))throw Error(n(200));return fc(null,r,s,!0,a)},rn.hydrateRoot=function(r,s,a){if(!zd(r))throw Error(n(405));var c=a!=null&&a.hydratedSources||null,f=!1,p="",S=Gy;if(a!=null&&(a.unstable_strictMode===!0&&(f=!0),a.identifierPrefix!==void 0&&(p=a.identifierPrefix),a.onRecoverableError!==void 0&&(S=a.onRecoverableError)),s=Qy(s,null,r,1,a??null,f,!1,p,S),r[Sr]=s.current,Ni(r),c)for(r=0;r<c.length;r++)a=c[r],f=a._getVersion,f=f(a._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[a,f]:s.mutableSourceEagerHydrationData.push(a,f);return new cc(s)},rn.render=function(r,s,a){if(!lc(s))throw Error(n(200));return fc(null,r,s,!1,a)},rn.unmountComponentAtNode=function(r){if(!lc(r))throw Error(n(40));return r._reactRootContainer?(Os(function(){fc(null,null,r,!1,function(){r._reactRootContainer=null,r[Sr]=null})}),!0):!1},rn.unstable_batchedUpdates=Md,rn.unstable_renderSubtreeIntoContainer=function(r,s,a,c){if(!lc(a))throw Error(n(200));if(r==null||r._reactInternals===void 0)throw Error(n(38));return fc(r,s,a,!1,c)},rn.version="18.3.1-next-f1338f8080-20240426",rn}var ov;function Fx(){if(ov)return qd.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(),qd.exports=tP(),qd.exports}var iv;function nP(){if(iv)return hc;iv=1;var e=Fx();return hc.createRoot=e.createRoot,hc.hydrateRoot=e.hydrateRoot,hc}var rP=nP(),sP={};const Mp=aP();function Ye(e,...t){if(!Mp)return;const n=iP(e,...t);performance.mark(n);try{console.log(e,...t)}catch{console.log(n)}}function oP(e,...t){Mp&&console.warn(e,...t)}function iP(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 aP(){if(typeof window>"u")return(sP.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 uP={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 Fa(e){return`[nuqs] ${uP[e]}
|
|
42
|
-
See https://nuqs.dev/NUQS-${e}`}function cP(e){if(e.size===0)return"";const t=[];for(const[o,i]of e.entries()){const u=o.replace(/#/g,"%23").replace(/&/g,"%26").replace(/\+/g,"%2B").replace(/=/g,"%3D").replace(/\?/g,"%3F");t.push(`${u}=${lP(i)}`)}return"?"+t.join("&")}function lP(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 Gs=te.createContext({useAdapter(){throw new Error(Fa(404))}});Gs.displayName="NuqsAdapterContext";Mp&&typeof window<"u"&&(window.__NuqsAdapterContext&&window.__NuqsAdapterContext!==Gs&&console.error(Fa(303)),window.__NuqsAdapterContext=Gs);function fP(e){return({children:t,defaultOptions:n,processUrlSearchParams:o,...i})=>te.createElement(Gs.Provider,{...i,value:{useAdapter:e,defaultOptions:n,processUrlSearchParams:o}},t)}function dP(e){const t=te.useContext(Gs);if(!("useAdapter"in t))throw new Error(Fa(404));return t.useAdapter(e)}const hP=()=>te.useContext(Gs).defaultOptions,pP=()=>te.useContext(Gs).processUrlSearchParams;function mP(){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 gP(e){return{method:"throttle",timeMs:e}}const la=gP(mP());function yP(e){return e===null||Array.isArray(e)&&e.length===0}function vP(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 Nh(e,t,n){function o(){e(),n.removeEventListener("abort",u)}const i=setTimeout(o,t);function u(){clearTimeout(i),n.removeEventListener("abort",u)}n.addEventListener("abort",u)}function Ah(){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 SP(e,t){let n=t;for(let o=e.length-1;o>=0;o--){const i=e[o];if(!i)continue;const u=n;n=()=>i(u)}n()}function jh(){return new URLSearchParams(location.search)}var Dx=class{constructor(){M(this,"updateMap",new Map);M(this,"options",{history:"replace",scroll:!1,shallow:!0});M(this,"timeMs",la.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=la.timeMs){this.resetQueueOnNextPush&&(this.reset(),this.resetQueueOnNextPush=!1),Ye("[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=jh}){var t;return((t=this.resolvers)==null?void 0:t.promise)??Promise.resolve(e())}flush({getSearchParamsSnapshot:e=jh,rateLimitFactor:t=1,...n},o){if(this.controller??(this.controller=new AbortController),!Number.isFinite(this.timeMs))return Ye("[nuqs gtq] Skipping flush due to throttleMs=Infinity"),Promise.resolve(e());if(this.resolvers)return this.resolvers.promise;this.resolvers=Ah();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 Nh(()=>{const l=performance.now()-this.lastFlushedAt,d=this.timeMs,m=t*Math.max(0,d-l);Ye("[nuqs gtq] Scheduling flush in %f ms. Throttled at %f ms (x%f)",m,d,t),m===0?i():Nh(i,m,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 Ye("[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=la.timeMs,e}applyPendingUpdates(e,t){const{updateUrl:n,getSearchParamsSnapshot:o}=e;let i=o();if(Ye("[nuqs gtq] Applying %d pending update(s) on top of %s",this.updateMap.size,i.toString()),this.updateMap.size===0)return[i,null];const u=Array.from(this.updateMap.entries()),l={...this.options},d=Array.from(this.transitions);e.autoResetQueueOnUpdate&&this.reset(),Ye("[nuqs gtq] Flushing queue %O with options %O",u,l);for(const[m,g]of u)g===null?i.delete(m):i=vP(g,m,i);t&&(i=t(i));try{return SP(d,()=>{n(i,l)}),[i,null]}catch(m){return console.error(Fa(429),u.map(([g])=>g).join(),m),[i,m]}}};const Cc=new Dx;function xP(e,t,n){const o=te.useCallback(()=>{const u=Object.fromEntries(e.map(l=>[l,n(l)]));return[JSON.stringify(u),u]},[e.join(","),n]),i=te.useRef(null);return i.current===null&&(i.current=o()),te.useSyncExternalStore(te.useCallback(u=>{const l=e.map(d=>t(d,u));return()=>l.forEach(d=>d())},[e.join(","),t]),()=>{const[u,l]=o();return i.current[0]===u?i.current[1]:(i.current=[u,l],l)},()=>i.current[1])}var wP=class{constructor(e){M(this,"callback");M(this,"resolvers",Ah());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,Nh(()=>{const n=this.resolvers;try{Ye("[nuqs dq] Flushing debounce queue",e);const o=this.callback(e);Ye("[nuqs dq] Reset debounce queue %O",this.queuedValue),this.queuedValue=void 0,this.resolvers=Ah(),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}},kP=class{constructor(e=new Dx){M(this,"throttleQueue");M(this,"queues",new Map);M(this,"queuedQuerySync",Lp());this.throttleQueue=e}useQueuedQueries(e){return xP(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??jh;return Promise.resolve(l())}const i=e.key;if(!this.queues.has(i)){Ye("[nuqs dqc] Creating debounce queue for `%s`",i);const l=new wP(d=>(this.throttleQueue.push(d),this.throttleQueue.flush(n,o).finally(()=>{var m;((m=this.queues.get(d.key))==null?void 0:m.queuedValue)===void 0&&(Ye("[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)}Ye("[nuqs dqc] Enqueueing debounce update %O",e);const u=this.queues.get(i).push(e,t);return this.queuedQuerySync.emit(i),u}abort(e){var n;const t=this.queues.get(e);return t?(Ye("[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())Ye("[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 Kd=new kP(Cc);function Ux(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 av(e,t,n){return o=>{if(!(t.length===0||t.some(u=>!Ux(o.getAll(u),e.getAll(u)))))return Ye("[nuqs `%s`] no change, returning previous",t.join(","),o),o;const i=zx(e,t,n);return Ye("[nuqs `%s`] subbed search params change\n from %O\n to %O",t.join(","),o,i),i}}function zx(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 _P="__nuqs__",$h=Lp();function EP(e){return function(n,o){const i=new URL(location.href);i.search=cP(n),Ye("[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,_P,i),$h.emit("update",n),o.scroll===!0&&window.scrollTo({top:0})}}const Bx=te.createContext({fullPageNavigationOnShallowFalseUpdates:!1});function CP(e){const{fullPageNavigationOnShallowFalseUpdates:t}=te.useContext(Bx),[n,o]=te.useState(()=>typeof location>"u"?new URLSearchParams:zx(new URLSearchParams(location.search),e,!1));return te.useEffect(()=>{const i=()=>{o(av(new URLSearchParams(location.search),e,!1))},u=l=>{o(av(l,e,!0))};return $h.on("update",u),window.addEventListener("popstate",i),()=>{$h.off("update",u),window.removeEventListener("popstate",i)}},[e.join("&")]),{searchParams:n,updateUrl:te.useMemo(()=>EP(t),[t])}}const PP=fP(CP);function bP({children:e,fullPageNavigationOnShallowFalseUpdates:t=!1,...n}){return te.createElement(Bx.Provider,{value:{fullPageNavigationOnShallowFalseUpdates:t}},te.createElement(PP,{...n,children:e}))}const IP="modulepreload",RP=function(e,t){return new URL(e,t).href},uv={},cr=function(t,n,o){let i=Promise.resolve();if(n&&n.length>0){let l=function(y){return Promise.all(y.map(h=>Promise.resolve(h).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const d=document.getElementsByTagName("link"),m=document.querySelector("meta[property=csp-nonce]"),g=(m==null?void 0:m.nonce)||(m==null?void 0:m.getAttribute("nonce"));i=l(n.map(y=>{if(y=RP(y,o),y in uv)return;uv[y]=!0;const h=y.endsWith(".css"),v=h?'[rel="stylesheet"]':"";if(!!o)for(let k=d.length-1;k>=0;k--){const b=d[k];if(b.href===y&&(!h||b.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${v}`))return;const w=document.createElement("link");if(w.rel=h?"stylesheet":IP,h||(w.as="script"),w.crossOrigin="",w.href=y,g&&w.setAttribute("nonce",g),document.head.appendChild(w),h)return new Promise((k,b)=>{w.addEventListener("load",k),w.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${y}`)))})}))}function u(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"&&u(d.reason);return t().catch(u)})};var sa=typeof window<"u"?te.useLayoutEffect:te.useEffect;function Qd(e){const t=te.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function TP(e,t,n={},o={}){te.useEffect(()=>{if(!e.current||o.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([u])=>{t(u)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,o.disabled,e])}function OP(e){const t=te.useRef(null);return te.useImperativeHandle(e,()=>t.current,[]),t}const Vx=!1;function va(e){return e[e.length-1]}function MP(e){return typeof e=="function"}function Ds(e,t){return MP(e)?e(t):e}const qx=Object.prototype.hasOwnProperty,cv=Object.prototype.propertyIsEnumerable;function Wx(e){for(const t in e)if(qx.call(e,t))return!0;return!1}const LP=()=>Object.create(null),As=(e,t)=>Us(e,t,LP);function Us(e,t,n=()=>({}),o=0){if(e===t)return e;if(o>500)return t;const i=t,u=dv(e)&&dv(i);if(!u&&!(Dc(e)&&Dc(i)))return i;const l=u?e:lv(e);if(!l)return i;const d=u?i:lv(i);if(!d)return i;const m=l.length,g=d.length,y=u?new Array(g):n();let h=0;for(let v=0;v<g;v++){const x=u?v:d[v],w=e[x],k=i[x];if(w===k){y[x]=w,(u?v<m:qx.call(e,x))&&h++;continue}if(w===null||k===null||typeof w!="object"||typeof k!="object"){y[x]=k;continue}const b=Us(w,k,n,o+1);y[x]=b,b===w&&h++}return m===g&&h===m?e:y}function lv(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!cv.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(!cv.call(e,i))return!1;o.push(i)}return o}function Dc(e){if(!fv(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!fv(n)||!n.hasOwnProperty("isPrototypeOf"))}function fv(e){return Object.prototype.toString.call(e)==="[object Object]"}function dv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Bs(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(!Bs(e[o],t[o],n))return!1;return!0}if(Dc(e)&&Dc(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)&&!Bs(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 u=0;for(const l in t)if((!o||t[l]!==void 0)&&(u++,u>i||!Bs(e[l],t[l],n)))return!1;return i===u}return!1}function Jo(e){let t,n;const o=new Promise((i,u)=>{t=i,n=u});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 Sa(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function NP(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function hv(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 NP(t)}const AP=["http:","https:","mailto:","tel:"];function Uc(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function Zi(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+=hv(e.slice(n,i.index))+i[0],n=t.lastIndex;o=o+hv(n?e.slice(n):e);let u=!1;return o.startsWith("//")&&(u=!0,o="/"+o.replace(/^\/+/,"")),{path:o,handledProtocolRelativeURL:u}}function jP(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function $P(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 Tr(){throw new Error("Invariant failed")}function xa(e){const t=new Map;let n,o;const i=u=>{u.next&&(u.prev?(u.prev.next=u.next,u.next.prev=u.prev,u.next=void 0,o&&(o.next=u,u.prev=o)):(u.next.prev=void 0,n=u.next,u.next=void 0,o&&(u.prev=o,o.next=u)),o=u)};return{get(u){const l=t.get(u);if(l)return i(l),l.value},set(u,l){if(t.size>=e&&n){const m=n;t.delete(m.key),m.next&&(n=m.next,m.next.prev=void 0),m===o&&(o=void 0)}const d=t.get(u);if(d)d.value=l,i(d);else{const m={key:u,value:l,prev:o};o&&(o.next=m),o=m,n||(n=m),t.set(u,m)}},clear(){t.clear(),n=void 0,o=void 0}}}const rs=4,Hx=5;function FP(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 Kx(e,t,n=new Uint16Array(6)){const o=e.indexOf("/",t),i=o===-1?e.length:o,u=e.substring(t,i);if(!u||!u.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(u==="$"){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(u.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=FP(u);if(l){const[d,m]=l,g=u.charCodeAt(d+1);if(g===45){if(d+2<u.length&&u.charCodeAt(d+2)===36){const y=d+3,h=m;if(y<h)return n[0]=3,n[1]=t+d,n[2]=t+y,n[3]=t+h,n[4]=t+m+1,n[5]=i,n}}else if(g===36){const y=d+1,h=d+2;return h===m?(n[0]=2,n[1]=t+d,n[2]=t+y,n[3]=t+h,n[4]=t+m+1,n[5]=e.length,n):(n[0]=1,n[1]=t+d,n[2]=t+h,n[3]=t+m,n[4]=t+m+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 dl(e,t,n,o,i,u,l){var m,g,y,h,v,x,w,k,b,B;l==null||l(n);let d=o;{const _=n.fullPath??n.from,A=_.length,P=((m=n.options)==null?void 0:m.caseSensitive)??e,L=((y=(g=n.options)==null?void 0:g.params)==null?void 0:y.parse)??((h=n.options)==null?void 0:h.parseParams);for(;d<A;){const $=Kx(_,d,t);let D;const W=d,X=$[5];switch(d=X+1,u++,$[0]){case 0:{const Z=_.substring($[2],$[3]);if(P){const ue=(v=i.static)==null?void 0:v.get(Z);if(ue)D=ue;else{i.static??(i.static=new Map);const C=zs(n.fullPath??n.from);C.parent=i,C.depth=u,D=C,i.static.set(Z,C)}}else{const ue=Z.toLowerCase(),C=(x=i.staticInsensitive)==null?void 0:x.get(ue);if(C)D=C;else{i.staticInsensitive??(i.staticInsensitive=new Map);const H=zs(n.fullPath??n.from);H.parent=i,H.depth=u,D=H,i.staticInsensitive.set(ue,H)}}break}case 1:{const Z=_.substring(W,$[1]),ue=_.substring($[4],X),C=P&&!!(Z||ue),H=Z?C?Z:Z.toLowerCase():void 0,Y=ue?C?ue:ue.toLowerCase():void 0,Q=!L&&((w=i.dynamic)==null?void 0:w.find(z=>!z.parse&&z.caseSensitive===C&&z.prefix===H&&z.suffix===Y));if(Q)D=Q;else{const z=Gd(1,n.fullPath??n.from,C,H,Y);D=z,z.depth=u,z.parent=i,i.dynamic??(i.dynamic=[]),i.dynamic.push(z)}break}case 3:{const Z=_.substring(W,$[1]),ue=_.substring($[4],X),C=P&&!!(Z||ue),H=Z?C?Z:Z.toLowerCase():void 0,Y=ue?C?ue:ue.toLowerCase():void 0,Q=!L&&((k=i.optional)==null?void 0:k.find(z=>!z.parse&&z.caseSensitive===C&&z.prefix===H&&z.suffix===Y));if(Q)D=Q;else{const z=Gd(3,n.fullPath??n.from,C,H,Y);D=z,z.parent=i,z.depth=u,i.optional??(i.optional=[]),i.optional.push(z)}break}case 2:{const Z=_.substring(W,$[1]),ue=_.substring($[4],X),C=P&&!!(Z||ue),H=Z?C?Z:Z.toLowerCase():void 0,Y=ue?C?ue:ue.toLowerCase():void 0,Q=Gd(2,n.fullPath??n.from,C,H,Y);D=Q,Q.parent=i,Q.depth=u,i.wildcard??(i.wildcard=[]),i.wildcard.push(Q)}}i=D}if(L&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const $=zs(n.fullPath??n.from);$.kind=Hx,$.parent=i,u++,$.depth=u,i.pathless??(i.pathless=[]),i.pathless.push($),i=$}const F=(n.path||!n.children)&&!n.isRoot;if(F&&_.endsWith("/")){const $=zs(n.fullPath??n.from);$.kind=rs,$.parent=i,u++,$.depth=u,i.index=$,i=$}i.parse=L??null,i.priority=((B=(b=n.options)==null?void 0:b.params)==null?void 0:B.priority)??0,F&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const _ of n.children)dl(e,t,_,d,i,u,l)}function Jd(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 ns(e){var t,n,o;if(e.pathless)for(const i of e.pathless)ns(i);if(e.static)for(const i of e.static.values())ns(i);if(e.staticInsensitive)for(const i of e.staticInsensitive.values())ns(i);if((t=e.dynamic)!=null&&t.length){e.dynamic.sort(Jd);for(const i of e.dynamic)ns(i)}if((n=e.optional)!=null&&n.length){e.optional.sort(Jd);for(const i of e.optional)ns(i)}if((o=e.wildcard)!=null&&o.length){e.wildcard.sort(Jd);for(const i of e.wildcard)ns(i)}}function zs(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 Gd(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 DP(e,t){const n=zs("/"),o=new Uint16Array(6);for(const i of e)dl(!1,o,i,1,n,0);ns(n),t.masksTree=n,t.flatCache=xa(1e3)}function UP(e,t){e||(e="/");const n=t.flatCache.get(e);if(n)return n;const o=Np(e,t.masksTree);return t.flatCache.set(e,o),o}function zP(e,t,n,o,i){e||(e="/"),o||(o="/");const u=t?`case\0${e}`:e;let l=i.singleCache.get(u);return l||(l=zs("/"),dl(t,new Uint16Array(6),{from:e},1,l,0),i.singleCache.set(u,l)),Np(o,l,n)}function BP(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 u;try{u=Np(e,t.segmentTree,n)}catch(l){if(l instanceof URIError)u=null;else throw l}return u&&(u.branch=Jx(u.route)),t.matchCache.set(o,u),u}function VP(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function qP(e,t=!1,n){const o=zs(e.fullPath),i=new Uint16Array(6),u={},l={};let d=0;return dl(t,i,e,1,o,0,m=>{if(n==null||n(m,d),m.id in u&&Tr(),u[m.id]=m,d!==0&&m.path){const g=VP(m.fullPath);(!l[g]||m.fullPath.endsWith("/"))&&(l[g]=m)}d++}),ns(o),{processedTree:{segmentTree:o,singleCache:xa(1e3),matchCache:xa(1e3),flatCache:null,masksTree:null},routesById:u,routesByPath:l}}function Np(e,t,n=!1){const o=e.split("/"),i=HP(e,o,t,n);if(!i)return null;const[u]=Qx(e,o,i);return{route:i.node.route,rawParams:u}}function Qx(e,t,n){var y,h,v,x,w,k,b,B,_,A;const o=WP(n.node);let i=null;const u=Object.create(null);let l=((y=n.extract)==null?void 0:y.part)??0,d=((h=n.extract)==null?void 0:h.node)??0,m=((v=n.extract)==null?void 0:v.path)??0,g=((x=n.extract)==null?void 0:x.segment)??0;for(;d<o.length;l++,d++,m++,g++){const P=o[d];if(P.kind===rs)break;if(P.kind===Hx){g--,l--,m--;continue}const L=t[l],F=m;if(L&&(m+=L.length),P.kind===1){i??(i=n.node.fullPath.split("/"));const $=i[g],D=((w=P.prefix)==null?void 0:w.length)??0;if($.charCodeAt(D)===123){const W=((k=P.suffix)==null?void 0:k.length)??0,X=$.substring(D+2,$.length-W-1),Z=L.substring(D,L.length-W);u[X]=decodeURIComponent(Z)}else{const W=$.substring(1);u[W]=decodeURIComponent(L)}}else if(P.kind===3){if(n.skipped&1<<d){l--,m=F-1;continue}i??(i=n.node.fullPath.split("/"));const $=i[g],D=((b=P.prefix)==null?void 0:b.length)??0,W=((B=P.suffix)==null?void 0:B.length)??0,X=$.substring(D+3,$.length-W-1),Z=P.suffix||P.prefix?L.substring(D,L.length-W):L;Z&&(u[X]=decodeURIComponent(Z))}else if(P.kind===2){const $=P,D=e.substring(F+(((_=$.prefix)==null?void 0:_.length)??0),e.length-(((A=$.suffix)==null?void 0:A.length)??0)),W=decodeURIComponent(D);u["*"]=W,u._splat=W;break}}return n.rawParams&&Object.assign(u,n.rawParams),[u,{part:l,node:d,path:m,segment:g}]}function Jx(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function WP(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function HP(e,t,n,o){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!va(t),u=i&&e!=="/",l=t.length-(i?1:0),d=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}];let m=null,g=null;for(;d.length;){const y=d.pop(),{node:h,index:v,skipped:x,depth:w,statics:k,dynamics:b,optionals:B}=y;let{extract:_,rawParams:A}=y;if(h.kind===2&&h.route&&!mc(g,y))continue;if(h.parse){if(!pv(e,t,y))continue;A=y.rawParams,_=y.extract}o&&h.route&&h.kind!==rs&&mc(m,y)&&(m=y);const P=v===l;if(P&&(h.route&&(!u||h.kind===rs||h.kind===2)&&mc(g,y)&&(g=y),!h.optional&&!h.wildcard&&!h.index&&!h.pathless))continue;const L=P?void 0:t[v];let F;if(P&&h.index){const $={node:h.index,index:v,skipped:x,depth:w+1,statics:k,dynamics:b,optionals:B,extract:_,rawParams:A};let D=!0;if(h.index.parse&&(pv(e,t,$)||(D=!1)),D){if(!b&&!B&&!x&&KP(k,l))return $;mc(g,$)&&(g=$)}}if(h.wildcard)for(let $=h.wildcard.length-1;$>=0;$--){const D=h.wildcard[$],{prefix:W,suffix:X}=D;if(!(W&&(P||!(D.caseSensitive?L:F??(F=L.toLowerCase())).startsWith(W)))){if(X){if(P)continue;const Z=t.slice(v).join("/").slice(-X.length);if((D.caseSensitive?Z:Z.toLowerCase())!==X)continue}d.push({node:D,index:l,skipped:x,depth:w+1,statics:k,dynamics:b,optionals:B,extract:_,rawParams:A})}}if(h.optional){const $=x|1<<w,D=w+1;for(let W=h.optional.length-1;W>=0;W--){const X=h.optional[W];d.push({node:X,index:v,skipped:$,depth:D,statics:k,dynamics:b,optionals:B,extract:_,rawParams:A})}if(!P)for(let W=h.optional.length-1;W>=0;W--){const X=h.optional[W],{prefix:Z,suffix:ue}=X;if(Z||ue){const C=X.caseSensitive?L:F??(F=L.toLowerCase());if(Z&&!C.startsWith(Z)||ue&&!C.endsWith(ue))continue}d.push({node:X,index:v+1,skipped:x,depth:D,statics:k,dynamics:b,optionals:B+pc(l,v),extract:_,rawParams:A})}}if(!P&&h.dynamic&&L)for(let $=h.dynamic.length-1;$>=0;$--){const D=h.dynamic[$],{prefix:W,suffix:X}=D;if(W||X){const Z=D.caseSensitive?L:F??(F=L.toLowerCase());if(W&&!Z.startsWith(W)||X&&!Z.endsWith(X))continue}d.push({node:D,index:v+1,skipped:x,depth:w+1,statics:k,dynamics:b+pc(l,v),optionals:B,extract:_,rawParams:A})}if(!P&&h.staticInsensitive){const $=h.staticInsensitive.get(F??(F=L.toLowerCase()));$&&d.push({node:$,index:v+1,skipped:x,depth:w+1,statics:k+pc(l,v),dynamics:b,optionals:B,extract:_,rawParams:A})}if(!P&&h.static){const $=h.static.get(L);$&&d.push({node:$,index:v+1,skipped:x,depth:w+1,statics:k+pc(l,v),dynamics:b,optionals:B,extract:_,rawParams:A})}if(h.pathless){const $=w+1;for(let D=h.pathless.length-1;D>=0;D--){const W=h.pathless[D];d.push({node:W,index:v,skipped:x,depth:$,statics:k,dynamics:b,optionals:B,extract:_,rawParams:A})}}}if(g)return g;if(o&&m){let y=m.index;for(let v=0;v<m.index;v++)y+=t[v].length;const h=y===e.length?"/":e.slice(y);return m.rawParams??(m.rawParams=Object.create(null)),m.rawParams["**"]=decodeURIComponent(h),m}return null}function pc(e,t){return 2**(e-t-1)}function KP(e,t){return e===2**(t-1)-1}function pv(e,t,n){let o,i;try{[o,i]=Qx(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 mc(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===rs)>(e.node.kind===rs)||t.node.kind===rs==(e.node.kind===rs)&&t.depth>e.depth))):!0}function Pc(e){return Ap(e.filter(t=>t!==void 0).join("/"))}function Ap(e){return e.replace(/\/{2,}/g,"/")}function Gx(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Rr(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function Yx(e){return Rr(Gx(e))}function zc(e,t){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function QP(e,t,n){return zc(e,n)===zc(t,n)}function JP({base:e,to:t,trailingSlash:n="never",cache:o}){const i=t.startsWith("/"),u=!i&&t===".";let l;if(o){l=i?t:u?e:e+"\0"+t;const g=o.get(l);if(g)return g}let d;if(u)d=e.split("/");else if(i)d=t.split("/");else{for(d=e.split("/");d.length>1&&va(d)==="";)d.pop();const g=t.split("/");for(let y=0,h=g.length;y<h;y++){const v=g[y];v===""?y?y===h-1&&d.push(v):d=[v]:v===".."?d.pop():v==="."||d.push(v)}}d.length>1&&(va(d)===""?n==="never"&&d.pop():n==="always"&&d.push(""));const m=Ap(d.join("/"))||"/";return l&&o&&o.set(l,m),m}function GP(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,u=>t.get(u)??u)}function Yd(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=>gv(i,n)).join("/"):gv(o,n)}function mv({path:e,params:t,decoder:n,...o}){let i=!1;const u=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:u,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:u,isMissingParams:i};const l=e.length;let d=0,m,g="";for(;d<l;){const y=d;m=Kx(e,y,m);const h=m[5];if(d=h+1,y===h)continue;const v=m[0];if(v===0){g+="/"+e.substring(y,h);continue}if(v===2){const x=t._splat;u._splat=x,u["*"]=x;const w=e.substring(y,m[1]),k=e.substring(m[4],h);if(!x){i=!0,(w||k)&&(g+="/"+w+k);continue}const b=Yd("_splat",t,n);g+="/"+w+b+k;continue}if(v===1){const x=e.substring(m[2],m[3]);!i&&!(x in t)&&(i=!0),u[x]=t[x];const w=e.substring(y,m[1]),k=e.substring(m[4],h),b=Yd(x,t,n)??"undefined";g+="/"+w+b+k;continue}if(v===3){const x=e.substring(m[2],m[3]),w=t[x];if(w==null)continue;u[x]=w;const k=e.substring(y,m[1]),b=e.substring(m[4],h),B=Yd(x,t,n)??"";g+="/"+k+B+b;continue}}return e.endsWith("/")&&(g+="/"),{usedParams:u,interpolatedPath:g||"/",isMissingParams:i}}function gv(e,t){const n=encodeURIComponent(e);return(t==null?void 0:t(n))??n}function zt(e){return(e==null?void 0:e.isNotFound)===!0}function YP(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 Xd(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function XP(e){const t=new URLSearchParams(e),n=Object.create(null);for(const[o,i]of t.entries()){const u=n[o];u==null?n[o]=Xd(i):Array.isArray(u)?u.push(Xd(i)):n[o]=[u,Xd(i)]}return n}const ZP=tb(JSON.parse),eb=nb(JSON.stringify,JSON.parse);function tb(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=XP(t);for(const o in n){const i=n[o];if(typeof i=="string")try{n[o]=e(i)}catch{}}return n}}function nb(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 u=YP(i,o);return u?`?${u}`:""}}const Vs="__root__";function rb(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 on(e){return e instanceof Response&&!!e.options}const Fh=e=>{var t;if(!e.rendered)return e.rendered=!0,(t=e.onReady)==null?void 0:t.call(e)},sb=e=>e.stores.matchesId.get().some(t=>{var n;return(n=e.stores.matchStores.get(t))==null?void 0:n.get()._forcePending}),hl=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),qs=(e,t,n=!0)=>{const o={...e.router.options.context??{}},i=n?t:t-1;for(let u=0;u<=i;u++){const l=e.matches[u];if(!l)continue;const d=e.router.getMatch(l.id);d&&Object.assign(o,d.__routeContext,d.__beforeLoadContext)}return o},yv=(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 u=n?e.matches.findIndex(l=>l.routeId===n):e.firstBadMatchIndex??e.matches.length-1;u<0&&(u=i);for(let l=u;l>=0;l--){const d=e.matches[l];if(e.router.looseRoutesById[d.routeId].options.notFoundComponent)return l}return n?u:i},ss=(e,t,n)=>{var o,i,u;if(!(!on(n)&&!zt(n)))throw on(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:on(n)?"redirected":zt(n)?"notFound":l.status==="pending"?"success":l.status,context:qs(e,t.index),isFetching:!1,error:n})),zt(n)&&!n.routeId&&(n.routeId=t.routeId),(u=t._nonReactive.loadPromise)==null||u.resolve()),on(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},Xx=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},vv=(e,t,n)=>{const o=qs(e,n);e.updateMatch(t,i=>({...i,context:o}))},ea=(e,t,n)=>{var l,d;const{id:o,routeId:i}=e.matches[t],u=e.router.looseRoutesById[i];if(n instanceof Promise)throw n;e.firstBadMatchIndex??(e.firstBadMatchIndex=t),ss(e,e.router.getMatch(o),n);try{(d=(l=u.options).onError)==null||d.call(l,n)}catch(m){n=m,ss(e,e.router.getMatch(o),n)}e.updateMatch(o,m=>{var g,y;return(g=m._nonReactive.beforeLoadPromise)==null||g.resolve(),m._nonReactive.beforeLoadPromise=void 0,(y=m._nonReactive.loadPromise)==null||y.resolve(),{...m,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}}),!e.preload&&!on(n)&&!zt(n)&&(e.serialError??(e.serialError=n))},Zx=(e,t,n,o)=>{var u;if(o._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!hl(e,t)&&(n.options.loader||n.options.beforeLoad||tw(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??((u=e.router.options)==null?void 0:u.defaultPendingComponent))){const l=setTimeout(()=>{Fh(e)},i);o._nonReactive.pendingTimeout=l}},ob=(e,t,n)=>{const o=e.router.getMatch(t);if(!o._nonReactive.beforeLoadPromise&&!o._nonReactive.loaderPromise)return;Zx(e,t,n,o);const i=()=>{const u=e.router.getMatch(t);u.preload&&(u.status==="redirected"||u.status==="notFound")&&ss(e,u,u.error)};return o._nonReactive.beforeLoadPromise?o._nonReactive.beforeLoadPromise.then(i):i()},ib=(e,t,n,o)=>{const i=e.router.getMatch(t);let u=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Jo(()=>{u==null||u.resolve(),u=void 0});const{paramsError:l,searchError:d}=i;l&&ea(e,n,l),d&&ea(e,n,d),Zx(e,t,o,i);const m=new AbortController;let g=!1;const y=()=>{g||(g=!0,e.updateMatch(t,P=>({...P,isFetching:"beforeLoad",fetchCount:P.fetchCount+1,abortController:m})))},h=()=>{var P;(P=i._nonReactive.beforeLoadPromise)==null||P.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,L=>({...L,isFetching:!1}))};if(!o.options.beforeLoad){e.router.batch(()=>{y(),h()});return}i._nonReactive.beforeLoadPromise=Jo();const v={...qs(e,n,!1),...i.__routeContext},{search:x,params:w,cause:k}=i,b=hl(e,t),B={search:x,abortController:m,params:w,preload:b,context:v,location:e.location,navigate:P=>e.router.navigate({...P,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:b?"preload":k,matches:e.matches,routeId:o.id,...e.router.options.additionalContext},_=P=>{if(P===void 0){e.router.batch(()=>{y(),h()});return}(on(P)||zt(P))&&(y(),ea(e,n,P)),e.router.batch(()=>{y(),e.updateMatch(t,L=>({...L,__beforeLoadContext:P})),h()})};let A;try{if(A=o.options.beforeLoad(B),Sa(A))return y(),A.catch(P=>{ea(e,n,P)}).then(_)}catch(P){y(),ea(e,n,P)}_(A)},ab=(e,t)=>{const{id:n,routeId:o}=e.matches[t],i=e.router.looseRoutesById[o],u=()=>d(),l=()=>ib(e,n,t,i),d=()=>{if(Xx(e,n))return;const m=ob(e,n,i);return Sa(m)?m.then(l):l()};return u()},ub=(e,t,n)=>{var u,l,d,m,g,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=(u=n.options).head)==null?void 0:l.call(u,i),(m=(d=n.options).scripts)==null?void 0:m.call(d,i),(y=(g=n.options).headers)==null?void 0:y.call(g,i)]).then(([h,v,x])=>({meta:h==null?void 0:h.meta,links:h==null?void 0:h.links,headScripts:h==null?void 0:h.scripts,headers:x,scripts:v,styles:h==null?void 0:h.styles}))},ew=(e,t,n,o,i)=>{const u=t[o-1],{params:l,loaderDeps:d,abortController:m,cause:g}=e.router.getMatch(n),y=qs(e,o),h=hl(e,n);return{params:l,deps:d,preload:!!h,parentMatchPromise:u,abortController:m,context:y,location:e.location,navigate:v=>e.router.navigate({...v,_fromLocation:e.location}),cause:h?"preload":g,route:i,...e.router.options.additionalContext}},Sv=async(e,t,n,o,i)=>{var u,l,d,m,g;try{const y=e.router.getMatch(n);try{(!(Vx??e.router.isServer)||y.ssr===!0)&&wa(i);const h=i.options.loader,v=typeof h=="function"?h:h==null?void 0:h.handler,x=v==null?void 0:v(ew(e,t,n,o,i)),w=!!v&&Sa(x);if((w||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||y._nonReactive.minPendingPromise)&&e.updateMatch(n,b=>({...b,isFetching:"loader"})),v){const b=w?await x:x;ss(e,e.router.getMatch(n),b),b!==void 0&&e.updateMatch(n,B=>({...B,loaderData:b}))}i._lazyPromise&&await i._lazyPromise;const k=y._nonReactive.minPendingPromise;k&&await k,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,b=>({...b,error:void 0,context:qs(e,o),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(h){let v=h;if((v==null?void 0:v.name)==="AbortError"){if(y.abortController.signal.aborted){(u=y._nonReactive.loaderPromise)==null||u.resolve(),y._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,w=>({...w,status:w.status==="pending"?"success":w.status,isFetching:!1,context:qs(e,o)}));return}const x=y._nonReactive.minPendingPromise;x&&await x,zt(h)&&await((d=(l=i.options.notFoundComponent)==null?void 0:l.preload)==null?void 0:d.call(l)),ss(e,e.router.getMatch(n),h);try{(g=(m=i.options).onError)==null||g.call(m,h)}catch(w){v=w,ss(e,e.router.getMatch(n),w)}!on(v)&&!zt(v)&&await wa(i,["errorComponent"]),e.updateMatch(n,w=>({...w,error:v,context:qs(e,o),status:"error",isFetching:!1}))}}catch(y){const h=e.router.getMatch(n);h&&(h._nonReactive.loaderPromise=void 0),ss(e,h,y)}},cb=async(e,t,n)=>{var x,w,k,b;async function o(B,_,A,P,L){const F=Date.now()-_.updatedAt,$=B?L.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:L.options.staleTime??e.router.options.defaultStaleTime??0,D=L.options.shouldReload,W=typeof D=="function"?D(ew(e,t,i,n,L)):D,{status:X,invalid:Z}=P,ue=F>=$&&(!!e.forceStaleReload||P.cause==="enter"||A!==void 0&&A!==P.id);l=X==="success"&&(Z||(W??ue)),B&&L.options.preload===!1||(l&&!e.sync&&y?(d=!0,(async()=>{var C,H;try{await Sv(e,t,i,n,L);const Y=e.router.getMatch(i);(C=Y._nonReactive.loaderPromise)==null||C.resolve(),(H=Y._nonReactive.loadPromise)==null||H.resolve(),Y._nonReactive.loaderPromise=void 0,Y._nonReactive.loadPromise=void 0}catch(Y){on(Y)&&await e.router.navigate(Y.options)}})()):X!=="success"||l?await Sv(e,t,i,n,L):vv(e,i,n))}const{id:i,routeId:u}=e.matches[n];let l=!1,d=!1;const m=e.router.looseRoutesById[u],g=m.options.loader,y=((typeof g=="function"||g==null?void 0:g.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(Xx(e,i)){if(!e.router.getMatch(i))return e.matches[n];vv(e,i,n)}else{const B=e.router.getMatch(i),_=e.router.stores.matchesId.get()[n],A=((x=_&&e.router.stores.matchStores.get(_)||null)==null?void 0:x.routeId)===u?_:(w=e.router.stores.matches.get().find(L=>L.routeId===u))==null?void 0:w.id,P=hl(e,i);if(B._nonReactive.loaderPromise){if(B.status==="success"&&!e.sync&&!B.preload&&y)return B;await B._nonReactive.loaderPromise;const L=e.router.getMatch(i),F=L._nonReactive.error||L.error;F&&ss(e,L,F),L.status==="pending"&&await o(P,B,A,L,m)}else{const L=P&&!e.router.stores.matchStores.has(i),F=e.router.getMatch(i);F._nonReactive.loaderPromise=Jo(),L!==F.preload&&e.updateMatch(i,$=>({...$,preload:L})),await o(P,B,A,F,m)}}const h=e.router.getMatch(i);d||((k=h._nonReactive.loaderPromise)==null||k.resolve(),(b=h._nonReactive.loadPromise)==null||b.resolve(),h._nonReactive.loadPromise=void 0),clearTimeout(h._nonReactive.pendingTimeout),h._nonReactive.pendingTimeout=void 0,d||(h._nonReactive.loaderPromise=void 0),h._nonReactive.dehydrated=void 0;const v=d?h.isFetching:!1;return v!==h.isFetching||h.invalid!==!1?(e.updateMatch(i,B=>({...B,isFetching:v,invalid:!1})),e.router.getMatch(i)):h};async function xv(e){var v,x;const t=e,n=[];sb(t.router)&&Fh(t);let o;for(let w=0;w<t.matches.length;w++){try{const k=ab(t,w);Sa(k)&&await k}catch(k){if(on(k))throw k;if(zt(k))o=k;else if(!t.preload)throw k;break}if(t.serialError||t.firstBadMatchIndex!=null)break}const i=t.firstBadMatchIndex??t.matches.length,u=o&&!t.preload?yv(t,o):void 0,l=o&&t.preload?0:u!==void 0?Math.min(u+1,i):i;let d,m;for(let w=0;w<l;w++)n.push(cb(t,n,w));try{await Promise.all(n)}catch{const w=await Promise.allSettled(n);for(const k of w){if(k.status!=="rejected")continue;const b=k.reason;if(on(b))throw b;zt(b)?d??(d=b):m??(m=b)}if(m!==void 0)throw m}const g=d??(o&&!t.preload?o:void 0);let y=t.firstBadMatchIndex!==void 0?t.firstBadMatchIndex:t.matches.length-1;if(!g&&o&&t.preload)return t.matches;if(g){const w=yv(t,g);w===void 0&&Tr();const k=t.matches[w],b=t.router.looseRoutesById[k.routeId],B=(v=t.router.options)==null?void 0:v.defaultNotFoundComponent;!b.options.notFoundComponent&&B&&(b.options.notFoundComponent=B),g.routeId=k.routeId;const _=k.routeId===t.router.routeTree.id;t.updateMatch(k.id,A=>({...A,..._?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:g},isFetching:!1})),y=w,await wa(b,["notFoundComponent"])}else if(!t.preload){const w=t.matches[0];w.globalNotFound||(x=t.router.getMatch(w.id))!=null&&x.globalNotFound&&t.updateMatch(w.id,k=>({...k,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const w=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await wa(w,["errorComponent"])}for(let w=0;w<=y;w++){const{id:k,routeId:b}=t.matches[w],B=t.router.looseRoutesById[b];try{const _=ub(t,k,B);if(_){const A=await _;t.updateMatch(k,P=>({...P,...A}))}}catch(_){console.error(`Error executing head for route ${b}:`,_)}}const h=Fh(t);if(Sa(h)&&await h,g)throw g;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function wv(e,t){const n=t.map(o=>{var i,u;return(u=(i=e.options[o])==null?void 0:i.preload)==null?void 0:u.call(i)}).filter(Boolean);if(n.length!==0)return Promise.all(n)}function wa(e,t=bc){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(o=>{const{id:i,...u}=o.options;Object.assign(e.options,u),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const n=()=>e._componentsLoaded?void 0:t===bc?(()=>{if(e._componentsPromise===void 0){const o=wv(e,bc);o?e._componentsPromise=o.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():wv(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function tw(e){var t;for(const n of bc)if((t=e.options[n])!=null&&t.preload)return!0;return!1}const bc=["component","errorComponent","pendingComponent","notFoundComponent"];function lb(e){return{input:({url:t})=>{for(const n of e)t=Dh(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=nw(e[n],t);return t}}}function fb(e){const t=Yx(e.basepath),n=`/${t}`,o=e.caseSensitive?n:n.toLowerCase(),i=`${o}/`;return{input:({url:u})=>{const l=e.caseSensitive?u.pathname:u.pathname.toLowerCase();return l===o?u.pathname="/":l.startsWith(i)&&(u.pathname=u.pathname.slice(n.length)),u},output:({url:u})=>(u.pathname=Pc(["/",t,u.pathname]),u)}}function Dh(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 db(e,t){const{createMutableStore:n,createReadonlyStore:o,batch:i,init:u}=t,l=new Map,d=new Map,m=new Map,g=n(e.status),y=n(e.loadedAt),h=n(e.isLoading),v=n(e.isTransitioning),x=n(e.location),w=n(e.resolvedLocation),k=n(e.statusCode),b=n(e.redirect),B=n([]),_=n([]),A=n([]),P=o(()=>Zd(l,B.get())),L=o(()=>Zd(d,_.get())),F=o(()=>Zd(m,A.get())),$=o(()=>B.get()[0]),D=o(()=>B.get().some(z=>{var G;return((G=l.get(z))==null?void 0:G.get().status)==="pending"})),W=o(()=>{var z;return{locationHref:x.get().href,resolvedLocationHref:(z=w.get())==null?void 0:z.href,status:g.get()}}),X=o(()=>({status:g.get(),loadedAt:y.get(),isLoading:h.get(),isTransitioning:v.get(),matches:P.get(),location:x.get(),resolvedLocation:w.get(),statusCode:k.get(),redirect:b.get()})),Z=xa(64);function ue(z){let G=Z.get(z);return G||(G=o(()=>{const se=B.get();for(const ee of se){const T=l.get(ee);if(T&&T.routeId===z)return T.get()}}),Z.set(z,G)),G}const C={status:g,loadedAt:y,isLoading:h,isTransitioning:v,location:x,resolvedLocation:w,statusCode:k,redirect:b,matchesId:B,pendingIds:_,cachedIds:A,matches:P,pendingMatches:L,cachedMatches:F,firstId:$,hasPending:D,matchRouteDeps:W,matchStores:l,pendingMatchStores:d,cachedMatchStores:m,__store:X,getRouteMatchStore:ue,setMatches:H,setPending:Y,setCached:Q};H(e.matches),u==null||u(C);function H(z){eh(z,l,B,n,i)}function Y(z){eh(z,d,_,n,i)}function Q(z){eh(z,m,A,n,i)}return C}function Zd(e,t){const n=[];for(const o of t){const i=e.get(o);i&&n.push(i.get())}return n}function eh(e,t,n,o,i){const u=e.map(d=>d.id),l=new Set(u);i(()=>{for(const d of t.keys())l.has(d)||t.delete(d);for(const d of e){const m=t.get(d.id);if(!m){const g=o(d);g.routeId=d.routeId,t.set(d.id,g);continue}m.routeId=d.routeId,m.get()!==d&&m.set(d)}$P(n.get(),u)||n.set(u)})}var is="__TSR_index",kv="popstate",_v="beforeunload";function hb(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()},u=async({task:l,navigateOpts:d,...m})=>{var h,v;if((d==null?void 0:d.ignoreBlocker)??!1){l();return}const g=((h=e.getBlockers)==null?void 0:h.call(e))??[],y=m.type==="PUSH"||m.type==="REPLACE";if(typeof document<"u"&&g.length&&y)for(const x of g){const w=ka(m.path,m.state);if(await x.blockerFn({currentLocation:t,nextLocation:w,action:m.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,m)=>{const g=t.state[is];d=Ev(g+1,d),u({task:()=>{e.pushState(l,d),o({type:"PUSH"})},navigateOpts:m,type:"PUSH",path:l,state:d})},replace:(l,d,m)=>{const g=t.state[is];d=Ev(g,d),u({task:()=>{e.replaceState(l,d),o({type:"REPLACE"})},navigateOpts:m,type:"REPLACE",path:l,state:d})},go:(l,d)=>{u({task:()=>{e.go(l),i({type:"GO",index:l})},navigateOpts:d,type:"GO"})},back:l=>{u({task:()=>{e.back((l==null?void 0:l.ignoreBlocker)??!1),i({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{u({task:()=>{e.forward((l==null?void 0:l.ignoreBlocker)??!1),i({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>t.state[is]!==0,createHref:l=>e.createHref(l),block:l=>{var m;if(!e.setBlockers)return()=>{};const d=((m=e.getBlockers)==null?void 0:m.call(e))??[];return e.setBlockers([...d,l]),()=>{var y,h;const g=((y=e.getBlockers)==null?void 0:y.call(e))??[];(h=e.setBlockers)==null||h.call(e,g.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 Ev(e,t){t||(t={});const n=jp();return{...t,key:n,__TSR_key:n,[is]:e}}function rw(e){var D,W;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 u=()=>i,l=X=>i=X,d=(e==null?void 0:e.createHref)??(X=>X),m=(e==null?void 0:e.parseLocation)??(()=>ka(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!((D=t.history.state)!=null&&D.__TSR_key)&&!((W=t.history.state)!=null&&W.key)){const X=jp();t.history.replaceState({[is]:0,key:X,__TSR_key:X},"")}let g=m(),y,h=!1,v=!1,x=!1,w=!1;const k=()=>g;let b,B;const _=()=>{b&&($._ignoreSubscribers=!0,(b.isPush?t.history.pushState:t.history.replaceState)(b.state,"",b.href),$._ignoreSubscribers=!1,b=void 0,B=void 0,y=void 0)},A=(X,Z,ue)=>{const C=d(Z);B||(y=g),g=ka(Z,ue),b={href:C,state:ue,isPush:(b==null?void 0:b.isPush)||X==="push"},B||(B=Promise.resolve().then(()=>_()))},P=X=>{g=m(),$.notify({type:X})},L=async()=>{if(v){v=!1;return}const X=m(),Z=X.state[is]-g.state[is],ue=Z===1,C=Z===-1,H=!ue&&!C||h;h=!1;const Y=H?"GO":C?"BACK":"FORWARD",Q=H?{type:"GO",index:Z}:{type:C?"BACK":"FORWARD"};if(x)x=!1;else{const z=u();if(typeof document<"u"&&z.length){for(const G of z)if(await G.blockerFn({currentLocation:g,nextLocation:X,action:Y})){v=!0,t.history.go(1),$.notify(Q);return}}}g=m(),$.notify(Q)},F=X=>{if(w){w=!1;return}let Z=!1;const ue=u();if(typeof document<"u"&&ue.length)for(const C of ue){const H=C.enableBeforeUnload??!0;if(H===!0){Z=!0;break}if(typeof H=="function"&&H()===!0){Z=!0;break}}if(Z)return X.preventDefault(),X.returnValue=""},$=hb({getLocation:k,getLength:()=>t.history.length,pushState:(X,Z)=>A("push",X,Z),replaceState:(X,Z)=>A("replace",X,Z),back:X=>(X&&(x=!0),w=!0,t.history.back()),forward:X=>{X&&(x=!0),w=!0,t.history.forward()},go:X=>{h=!0,t.history.go(X)},createHref:X=>d(X),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=o,t.removeEventListener(_v,F,{capture:!0}),t.removeEventListener(kv,L)},onBlocked:()=>{y&&g!==y&&(g=y)},getBlockers:u,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(_v,F,{capture:!0}),t.addEventListener(kv,L),t.history.pushState=function(...X){const Z=n.apply(t.history,X);return $._ignoreSubscribers||P("PUSH"),Z},t.history.replaceState=function(...X){const Z=o.apply(t.history,X);return $._ignoreSubscribers||P("REPLACE"),Z},$}function pb(e){const t=typeof document<"u"?window:void 0;return rw({window:t,parseLocation:()=>{const n=t.location.hash.split("#").slice(1),o=n[0]??"/",i=t.location.search,u=n.slice(1);return ka(`${o}${i}${u.length===0?"":`#${u.join("#")}`}`,t.history.state)},createHref:n=>`${t.location.pathname}${t.location.search}#${n}`})}function mb(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function ka(e,t){const n=mb(e),o=n.indexOf("#"),i=n.indexOf("?"),u=jp();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||{[is]:0,key:u,__TSR_key:u}}}function jp(){return(Math.random()+1).toString(36).substring(7)}function Wo(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 Uh=new WeakMap;var gb=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)??"/",u=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=GP(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=rw()),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 h;this.resolvePathCache=xa(1e3),h=this.buildRouteTree(),this.setRoutes(h)}if(!this.stores&&this.latestLocation){const h=this.getStoreConfig(this);this.batch=h.batch,this.stores=db(vb(this.latestLocation),h),Rb(this)}let d=!1;const m=this.options.basepath??"/",g=this.options.rewrite;if(u||i!==m||l!==g){this.basepath=m;const h=[],v=Yx(m);v&&v!=="/"&&h.push(fb({basepath:m})),g&&h.push(g),this.rewrite=h.length===0?void 0:h.length===1?h[0]:lb(h),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=qP(this.routeTree,this.options.caseSensitive,(o,i)=>{o.init({originalIndex:i})});return this.options.routeMasks&&DP(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:m,search:g,hash:y,href:h,state:v})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(m)){const B=this.options.parseSearch(g),_=this.options.stringifySearch(B);return{href:m+_+y,publicHref:m+_+y,pathname:Zi(m).path,external:!1,searchStr:_,search:As(o==null?void 0:o.search,B),hash:Zi(y.slice(1)).path,state:Us(o==null?void 0:o.state,v)}}const x=new URL(h,this.origin),w=Dh(this.rewrite,x),k=this.options.parseSearch(w.search),b=this.options.stringifySearch(k);return w.search=b,{href:w.href.replace(w.origin,""),publicHref:h,pathname:Zi(w.pathname).path,external:!!this.rewrite&&w.origin!==this.origin,searchStr:b,search:As(o==null?void 0:o.search,k),hash:Zi(w.hash.slice(1)).path,state:Us(o==null?void 0:o.state,v)}},u=i(n),{__tempLocation:l,__tempKey:d}=u.state;if(l&&(!d||d===this.tempLocationKey)){const m=i(l);return m.state.key=u.state.key,m.state.__TSR_key=u.state.__TSR_key,delete m.state.__tempLocation,{...m,maskedLocation:u}}return u},this.resolvePathWithBase=(n,o)=>JP({base:n,to:o.includes("//")?Ap(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=>Sb({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=(u={})=>{var Z,ue;const l=u._fromLocation||this.pendingBuiltLocation||this.latestLocation,d=this.matchRoutesLightweight(l);u.from;const m=u.unsafeRelative==="path"?l.pathname:u.from??d.fullPath,g=u.to?`${u.to}`:void 0,y=d.search,h=Object.assign(Object.create(null),d.params),v=(g==null?void 0:g.charCodeAt(0))===47?"/":this.resolvePathWithBase(m,"."),x=g?this.resolvePathWithBase(v,g):v,w=u.params===!1||u.params===null?Object.create(null):(u.params??!0)===!0?h:Object.assign(h,Ds(u.params,h)),k=this.routesByPath[Rr(x)];let b;if(k)b=this.getRouteBranch(k);else if(x.includes("$"))b=[];else{const C=this.getMatchedRoutes(x);b=C.matchedRoutes,this.options.notFoundRoute&&(!C.foundRoute||C.foundRoute.path!=="/"&&C.routeParams["**"])&&(b=[...b,this.options.notFoundRoute])}if(b.length&&Wx(w))for(const C of b){const H=((Z=C.options.params)==null?void 0:Z.stringify)??C.options.stringifyParams;if(H)try{Object.assign(w,H(w))}catch{}}const B=n.leaveParams?x:Zi(mv({path:x,params:w,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let _=y;if(n._includeValidateSearch&&((ue=this.options.search)!=null&&ue.strict)){const C={};b.forEach(H=>{if(H.options.validateSearch)try{Object.assign(C,Ic(H.options.validateSearch,{...C,..._}))}catch{}}),_=C}_=xb({search:_,dest:u,destRoutes:b,_includeValidateSearch:n._includeValidateSearch}),_=As(y,_);const A=this.options.stringifySearch(_),P=u.hash===!0?l.hash:u.hash?Ds(u.hash,l.hash):void 0,L=P?`#${P}`:"";let F=u.state===!0?l.state:u.state?Ds(u.state,l.state):{};F=Us(l.state,F);const $=`${B}${A}${L}`;let D,W,X=!1;if(this.rewrite){const C=new URL($,this.origin),H=nw(this.rewrite,C);D=C.href.replace(C.origin,""),H.origin!==this.origin?(W=H.href,X=!0):W=H.pathname+H.search+H.hash}else D=jP($),W=D;return{publicHref:W,href:D,pathname:B,search:_,searchStr:A,state:F,hash:P??"",external:X,unmaskOnReload:u.unmaskOnReload}},i=(u={},l)=>{const d=o(u);let m=l?o(l):void 0;if(!m){const g=Object.create(null);if(this.options.routeMasks){const y=UP(d.pathname,this.processedTree);if(y){Object.assign(g,y.rawParams);const{from:h,params:v,...x}=y.route,w=v===!1||v===null?Object.create(null):(v??!0)===!0?g:Object.assign(g,Ds(v,g));l={from:n.from,...x,params:w},m=o(l)}}}return m&&(d.maskedLocation=m),d};return n.mask?i(n,{from:n.from,...n.mask}):i(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:o,...i})=>{let u;const l=()=>{const g=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];g.forEach(h=>{i.state[h]=this.latestLocation.state[h]});const y=Bs(i.state,this.latestLocation.state);return g.forEach(h=>{delete i.state[h]}),y},d=Rr(this.latestLocation.href)===Rr(i.href);let m=this.commitLocationPromise;if(this.commitLocationPromise=Jo(()=>{m==null||m.resolve(),m=void 0}),d&&l())this.load();else{let{maskedLocation:g,hashScrollIntoView:y,...h}=i;g&&(h={...g,state:{...g.state,__tempKey:void 0,__tempLocation:{...h,search:h.searchStr,state:{...h.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(h.unmaskOnReload??this.options.unmaskOnReload??!1)&&(h.state.__tempKey=this.tempLocationKey)),h.state.__hashScrollIntoViewOptions=y??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,u=i.replace?"REPLACE":"PUSH",this.history[u==="REPLACE"?"replace":"push"](h.publicHref,h.state,{ignoreBlocker:o})}return this._scroll.next=i.resetScroll??!0,this.history.subscribers.size||this.load(u?{action:{type:u}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:o,hashScrollIntoView:i,viewTransition:u,ignoreBlocker:l,href:d,...m}={})=>{if(d){const h=this.history.location.state.__TSR_index,v=ka(d,{__TSR_index:n?h:h+1}),x=new URL(v.pathname,this.origin);m.to=Dh(this.rewrite,x).pathname,m.search=this.options.parseSearch(v.search),m.hash=v.hash.slice(1)}const g=this.buildLocation({...m,_includeValidateSearch:!0});this.pendingBuiltLocation=g;const y=this.commitLocation({...g,viewTransition:u,replace:n,resetScroll:o,hashScrollIntoView:i,ignoreBlocker:l});return Promise.resolve().then(()=>{this.pendingBuiltLocation===g&&(this.pendingBuiltLocation=void 0)}),y},this.navigate=async({to:n,reloadDocument:o,href:i,publicHref:u,...l})=>{var m,g;let d=!1;if(i)try{new URL(`${i}`),d=!0}catch{}if(d&&!o&&(o=!0),o){if(n!==void 0||!i){const h=this.buildLocation({to:n,...l});i=i??h.publicHref,u=u??h.publicHref}const y=!d&&u?u:i;if(Uc(y,this.protocolAllowlist))return Promise.resolve();if(!l.ignoreBlocker){const h=((g=(m=this.history).getBlockers)==null?void 0:g.call(m))??[];for(const v of h)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(u=>u.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 g;const o=(g=n==null?void 0:n.action)==null?void 0:g.type;let i,u,l;const d=this.stores.resolvedLocation.get()??this.stores.location.get();for(l=new Promise(y=>{this.startTransition(async()=>{var h;try{this.beforeLoad(),o?Uh.set(this.latestLocation,o):Uh.delete(this.latestLocation);const v=this.latestLocation,x=Wo(v,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...x}),this.emit({type:"onBeforeLoad",...x}),await xv({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 _,A;let w=null,k=null,b=null,B=null;this.batch(()=>{const P=this.stores.pendingMatches.get(),L=P.length,F=this.stores.matches.get();w=L?F.filter(W=>!this.stores.pendingMatchStores.has(W.id)):null;const $=new Set;for(const W of this.stores.pendingMatchStores.values())W.routeId&&$.add(W.routeId);const D=new Set;for(const W of this.stores.matchStores.values())W.routeId&&D.add(W.routeId);k=L?F.filter(W=>!$.has(W.routeId)):null,b=L?P.filter(W=>!D.has(W.routeId)):null,B=L?P.filter(W=>D.has(W.routeId)):F,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),L&&(this.stores.setMatches(P),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...w.filter(W=>W.status!=="error"&&W.status!=="notFound"&&W.status!=="redirected")]),this.clearExpiredCache())});for(const[P,L]of[[k,"onLeave"],[b,"onEnter"],[B,"onStay"]])if(P)for(const F of P)(A=(_=this.looseRoutesById[F.routeId].options)[L])==null||A.call(_,F)})})}})}catch(v){on(v)?(i=v,this.navigate({...i.options,replace:!0,ignoreBlocker:!0})):zt(v)&&(u=v);const x=i?i.status:u?404:this.stores.matches.get().some(w=>w.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(x),this.stores.redirect.set(i)})}this.latestLoadPromise===l&&((h=this.commitLocationPromise)==null||h.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),y()})}),this.latestLoadPromise=l,await l;this.latestLoadPromise&&l!==this.latestLoadPromise;)await this.latestLoadPromise;let m;this.hasNotFoundMatch()?m=404:this.stores.matches.get().some(y=>y.status==="error")&&(m=500),m!==void 0&&this.stores.statusCode.set(m)},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 u=this.latestLocation,l=this.stores.resolvedLocation.get(),d=typeof o.types=="function"?o.types(Wo(u,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 u=this.stores.matchStores.get(n);if(u){u.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(m=>m.filter(g=>g!==n)):l.set(d)}})},this.getMatch=n=>{var o,i,u;return((o=this.stores.cachedMatchStores.get(n))==null?void 0:o.get())??((i=this.stores.pendingMatchStores.get(n))==null?void 0:i.get())??((u=this.stores.matchStores.get(n))==null?void 0:u.get())},this.invalidate=n=>{const o=i=>{var u;return((u=n==null?void 0:n.filter)==null?void 0:u.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),u=this.getParsedLocationHref(i);n.options.href=u,n.headers.set("Location",u)}else if(o)try{const i=new URL(o);if(this.origin&&i.origin===this.origin){const u=i.pathname+i.search+i.hash;n.options.href=u,n.headers.set("Location",u)}}catch{}if(n.options.href&&!n.options._builtLocation&&Uc(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 u=this.looseRoutesById[i.routeId];if(!u.options.loader)return!0;const l=(i.preload?u.options.preloadGcTime??this.options.defaultPreloadGcTime:u.options.gcTime??this.options.defaultGcTime)??300*1e3;return i.status==="error"?!0:n-i.updatedAt>=l};this.clearCache({filter:o})},this.loadRouteChunk=wa,this.preloadRoute=async n=>{const o=n._builtLocation??this.buildLocation(n);let i=this.matchRoutes(o,{throwOnError:!0,preload:!0,dest:n});const u=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),l=new Set([...u,...this.stores.cachedIds.get()]),d=i.filter(m=>!l.has(m.id));if(d.length){const m=this.stores.cachedMatches.get();this.stores.setCached([...m,...d])}try{return i=await xv({router:this,matches:i,location:o,preload:!0,updateMatch:(m,g)=>{u.has(m)?i=i.map(y=>y.id===m?g(y):y):this.updateMatch(m,g)}}),i}catch(m){if(on(m))return m.options.reloadDocument?void 0:await this.preloadRoute({...m.options,_fromLocation:o});zt(m)||console.error(m);return}},this.matchRoute=(n,o)=>{const i={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},u=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=zP(u.pathname,(o==null?void 0:o.caseSensitive)??!1,(o==null?void 0:o.fuzzy)??!1,l.pathname,this.processedTree);return!d||n.params&&!Bs(d.rawParams,n.params,{partial:!0})?!1:(o==null?void 0:o.includeSearch)??!0?Bs(l.search,u.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??eb,parseSearch:e.parseSearch??ZP,protocolAllowlist:e.protocolAllowlist??AP}),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=Jx(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,h;const n=this.getMatchedRoutes(e.pathname),{foundRoute:o,routeParams:i}=n;let{matchedRoutes:u}=n,l=!1;(o?o.path!=="/"&&i["**"]:Rr(e.pathname))&&(this.options.notFoundRoute?u=[...u,this.options.notFoundRoute]:l=!0);const d=l?kb(this.options.notFoundMode,u):void 0,m=new Array(u.length),g=new Map;for(const v of this.stores.matchStores.values())v.routeId&&g.set(v.routeId,v.get());for(let v=0;v<u.length;v++){const x=u[v],w=m[v-1];let k,b,B;{const H=(w==null?void 0:w.search)??e.search,Y=(w==null?void 0:w._strictSearch)??void 0;try{const Q=Ic(x.options.validateSearch,{...H})??void 0;k={...H,...Q},b={...Y,...Q},B=void 0}catch(Q){let z=Q;if(Q instanceof Bc||(z=new Bc(Q.message,{cause:Q})),t!=null&&t.throwOnError)throw z;k=H,b={},B=z}}const _=((h=(y=x.options).loaderDeps)==null?void 0:h.call(y,{search:k}))??"",A=_?JSON.stringify(_):"",{interpolatedPath:P,usedParams:L}=mv({path:x.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),F=x.id+P+A,$=this.getMatch(F),D=g.get(x.id),W=($==null?void 0:$._strictParams)??L;let X;if(!$)try{Cv(x,W)}catch(H){if(zt(H)||on(H)?X=H:X=new yb(H.message,{cause:H}),t!=null&&t.throwOnError)throw X}Object.assign(i,W);const Z=D?"stay":"enter";let ue;if($)ue={...$,cause:Z,params:(D==null?void 0:D.params)??i,_strictParams:W,search:As(D?D.search:$.search,k),_strictSearch:b};else{const H=x.options.loader||x.options.beforeLoad||x.lazyFn||tw(x)?"pending":"success";ue={id:F,ssr:x.options.ssr,index:v,routeId:x.id,params:(D==null?void 0:D.params)??i,_strictParams:W,pathname:P,updatedAt:Date.now(),search:D?As(D.search,k):k,_strictSearch:b,searchError:void 0,status:H,isFetching:!1,error:void 0,paramsError:X,__routeContext:void 0,_nonReactive:{loadPromise:Jo()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:Z,loaderDeps:D?Us(D.loaderDeps,_):_,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:x.options.staticData||{},fullPath:x.fullPath}}t!=null&&t.preload||(ue.globalNotFound=d===x.id),ue.searchError=B;const C=this.getParentContext(w);ue.context={...C,...ue.__routeContext,...ue.__beforeLoadContext},m[v]=ue}for(let v=0;v<m.length;v++){const x=m[v],w=this.looseRoutesById[x.routeId],k=this.getMatch(x.id),b=g.get(x.routeId);if(x.params=b?As(b.params,i):i,!k){const B=m[v-1],_=this.getParentContext(B);if(w.options.context){const A={deps:x.loaderDeps,params:x.params,context:_??{},location:e,navigate:P=>this.navigate({...P,_fromLocation:e}),buildLocation:this.buildLocation,cause:x.cause,abortController:x.abortController,preload:!!x.preload,matches:m,routeId:w.id};x.__routeContext=w.options.context(A)??void 0}x.context={..._,...x.__routeContext,...x.__beforeLoadContext}}}return m}matchRoutesLightweight(e){var g;const{matchedRoutes:t,routeParams:n}=this.getMatchedRoutes(e.pathname),o=va(t),i={...e.search};for(const y of t)try{Object.assign(i,Ic(y.options.validateSearch,i))}catch{}const u=va(this.stores.matchesId.get()),l=u&&((g=this.stores.matchStores.get(u))==null?void 0:g.get()),d=l&&l.routeId===o.id&&l.pathname===e.pathname;let m;if(d)m=l.params;else{const y=Object.assign(Object.create(null),n);for(const h of t)try{Cv(h,y)}catch{}m=y}return{matchedRoutes:t,fullPath:o.fullPath,search:i,params:m}}},Bc=class extends Error{},yb=class extends Error{};function vb(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Ic(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Bc("Async validation not supported");if(n.issues)throw new Bc(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 Sb({pathname:e,routesById:t,processedTree:n}){const o=Object.create(null),i=Rr(e);let u;const l=BP(i,n,!0);return l&&(u=l.route,Object.assign(o,l.rawParams)),{matchedRoutes:(l==null?void 0:l.branch)||[t.__root__],routeParams:o,foundRoute:u}}function xb({search:e,dest:t,destRoutes:n,_includeValidateSearch:o}){return wb(n)(e,t,o??!1)}function wb(e){var u;let t,n;const o=[];for(const l of e){const d=l.options;if("search"in d)(u=d.search)!=null&&u.middlewares&&o.push(...d.search.middlewares);else if(d.preSearchFilters||d.postSearchFilters){const g=({search:y,next:h})=>{const v=h(d.preSearchFilters?d.preSearchFilters.reduce((x,w)=>w(x),y):y);return d.postSearchFilters?d.postSearchFilters.reduce((x,w)=>w(x),v):v};o.push(g)}const m=d.validateSearch;if(m){const g=({search:y,next:h,meta:v})=>{const x=h(y);if(n)try{const w=Ic(m,x);if(v&&w)for(const k in w)k in x||(v.defaulted||(v.defaulted=new Map)).set(k,w[k]);return{...x,...w}}catch{}return x};o.push(g)}}const i=(l,d,m)=>{if(l>=o.length){if(!t.search)return{};if(t.search===!0)return d;const y=Ds(t.search,d);return m&&(m.explicit=y),y}const g=(y,h)=>{if(h){const v=m||{};return{search:i(l+1,y,v),meta:v}}return i(l+1,y,m)};return o[l]({search:d,next:g,meta:m})};return function(d,m,g){return t=m,n=g,i(0,d)}}function kb(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 Vs}function Cv(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 _b(){try{return sessionStorage}catch{return}}const Eb="tsr-scroll-restoration-v1_3",Ho=_b();function Cb(){try{return JSON.parse((Ho==null?void 0:Ho.getItem("tsr-scroll-restoration-v1_3"))||"{}")}catch{return{}}}function Pb(){try{Ho==null||Ho.setItem(Eb,JSON.stringify(es))}catch{}}const es=Cb(),Pv="data-scroll-restoration-id",bb=e=>e.state.__TSR_key||e.href;function Ib(e){const t=e.getAttribute(Pv);if(t)return`[${Pv}="${t}"]`;let n="",o=e,i;for(;i=o.parentNode;){let u=1,l=o;for(;l=l.previousElementSibling;)u++;const d=`${o.localName}:nth-child(${u})`;n=n?`${d} > ${n}`:d,o=i}return n}let gc=!1;const zo="window";function zh(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function bv(e){const t=[];for(const n of e){if(n===zo)continue;const o=zh(n);o&&t.push(o)}return t}function Rb(e,t){const n=e.options.scrollRestoration,o=e._scroll;n&&(o.restoring=!0);const i=e.options.getScrollRestorationKey||bb,u=new Map,l=(g,y,h)=>{const v=u.get(g)||{};v.scrollX=y,v.scrollY=h,u.set(g,v)},d=g=>{if(!(gc||!o.restoring))if(g.target===document)l(zo,scrollX,scrollY);else{const y=g.target;l(y,y.scrollLeft,y.scrollTop)}},m=g=>{if(!o.restoring)return;const y=es[g]||(es[g]={});for(const[h,v]of u)h===zo?y[zo]=v:h.isConnected&&(y[Ib(h)]=v)};n&&!o.restoration&&(o.restoration=!0,gc=!1,history.scrollRestoration="manual",document.addEventListener("scroll",d,!0),e.subscribe("onBeforeLoad",g=>{g.fromLocation&&m(i(g.fromLocation)),u.clear()}),addEventListener("pagehide",()=>{m(i(e.stores.resolvedLocation.get()??e.stores.location.get())),Pb()})),!o.reset&&(o.reset=!0,e.subscribe("onRendered",g=>{var b;const y=e.options.scrollRestorationBehavior,h=e.options.scrollToTopSelectors,v=o.next;let x;if(u.clear(),v||(o.next=!0),typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return;const w=i(g.toLocation),k=g.fromLocation&&i(g.fromLocation);if(o.restoring&&k&&k!==w){const B=es[k];if(B){let _=es[w];for(const A in B){if(A===zo){if(v)continue}else{const P=zh(A);if(!P||v&&h&&(x??(x=bv(h)),x.includes(P)))continue}_||(_=es[w]={}),_[A]??(_[A]=B[A])}}}gc=!0;try{const B=g.toLocation.hash,_=g.toLocation.state.__hashScrollIntoViewOptions??!0;let A=!1;if(v){const P=Uh.get(g.toLocation),L=B&&_&&(P==="PUSH"||P==="REPLACE"),F=o.restoring?es[w]:void 0;if(F)for(const $ in F){const{scrollX:D,scrollY:W}=F[$];if($===zo){if(L)continue;scrollTo({top:W,left:D,behavior:y}),A=!0}else{const X=zh($);X&&(X.scrollLeft=D,X.scrollTop=W)}}if(!A&&!B){const $={top:0,left:0,behavior:y};if(scrollTo($),h){x??(x=bv(h));for(const D of x)D.scrollTo($)}}}!A&&B&&_&&((b=document.getElementById(B))==null||b.scrollIntoView(_))}finally{gc=!1}}))}const Tb="Error preloading route! ☝️";var sw=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 m,g;this.originalIndex=t.originalIndex;const n=this.options,o=!(n!=null&&n.path)&&!(n!=null&&n.id);this.parentRoute=(g=(m=this.options).getParentRoute)==null?void 0:g.call(m),o?this._path=Vs:this.parentRoute||Tr();let i=o?Vs:n==null?void 0:n.path;i&&i!=="/"&&(i=Gx(i));const u=(n==null?void 0:n.id)||i;let l=o?Vs:Pc([this.parentRoute.id==="__root__"?"":this.parentRoute.id,u]);i==="__root__"&&(i="/"),l!=="__root__"&&(l=Pc(["/",l]));const d=l==="__root__"?"/":Pc([this.parentRoute.fullPath,i]);this._path=i,this._id=l,this._fullPath=d,this._to=Rr(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=>rb({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.")}},Ob=class extends sw{constructor(e){super(e)}};function $p(e){const t=e.errorComponent??Fp;return I.jsx(Mb,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:o})=>n?te.createElement(t,{error:n,reset:o}):e.children})}var Mb=class extends te.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 Fp({error:e}){const[t,n]=te.useState(!1);return I.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[I.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[I.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),I.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"})]}),I.jsx("div",{style:{height:".25rem"}}),t?I.jsx("div",{children:I.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?I.jsx("code",{children:e.message}):null})}):null]})}function Lb({children:e,fallback:t=null}){return ow()?I.jsx(ya.Fragment,{children:e}):I.jsx(ya.Fragment,{children:t})}function ow(){return ya.useSyncExternalStore(Nb,()=>!0,()=>!1)}function Nb(){return()=>{}}var iw=te.createContext(null);function Cn(e){return te.useContext(iw)}var pl=te.createContext(void 0),Ab=te.createContext(void 0),Ge=(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))(Ge||{});function jb({update:e,notify:t,unwatched:n}){return{link:o,unlink:i,propagate:u,checkDirty:l,shallowPropagate:d};function o(g,y,h){const v=y.depsTail;if(v!==void 0&&v.dep===g)return;const x=v!==void 0?v.nextDep:y.deps;if(x!==void 0&&x.dep===g){x.version=h,y.depsTail=x;return}const w=g.subsTail;if(w!==void 0&&w.version===h&&w.sub===y)return;const k=y.depsTail=g.subsTail={version:h,dep:g,sub:y,prevDep:v,nextDep:x,prevSub:w,nextSub:void 0};x!==void 0&&(x.prevDep=k),v!==void 0?v.nextDep=k:y.deps=k,w!==void 0?w.nextSub=k:g.subs=k}function i(g,y=g.sub){const h=g.dep,v=g.prevDep,x=g.nextDep,w=g.nextSub,k=g.prevSub;return x!==void 0?x.prevDep=v:y.depsTail=v,v!==void 0?v.nextDep=x:y.deps=x,w!==void 0?w.prevSub=k:h.subsTail=k,k!==void 0?k.nextSub=w:(h.subs=w)===void 0&&n(h),x}function u(g){let y=g.nextSub,h;e:do{const v=g.sub;let x=v.flags;if(x&60?x&12?x&4?!(x&48)&&m(g,v)?(v.flags=x|40,x&=1):x=0:v.flags=x&-9|32:x=0:v.flags=x|32,x&2&&t(v),x&1){const w=v.subs;if(w!==void 0){const k=(g=w).nextSub;k!==void 0&&(h={value:y,prev:h},y=k);continue}}if((g=y)!==void 0){y=g.nextSub;continue}for(;h!==void 0;)if(g=h.value,h=h.prev,g!==void 0){y=g.nextSub;continue e}break}while(!0)}function l(g,y){let h,v=0,x=!1;e:do{const w=g.dep,k=w.flags;if(y.flags&16)x=!0;else if((k&17)===17){if(e(w)){const b=w.subs;b.nextSub!==void 0&&d(b),x=!0}}else if((k&33)===33){(g.nextSub!==void 0||g.prevSub!==void 0)&&(h={value:g,prev:h}),g=w.deps,y=w,++v;continue}if(!x){const b=g.nextDep;if(b!==void 0){g=b;continue}}for(;v--;){const b=y.subs,B=b.nextSub!==void 0;if(B?(g=h.value,h=h.prev):g=b,x){if(e(y)){B&&d(b),y=g.sub;continue}x=!1}else y.flags&=-33;y=g.sub;const _=g.nextDep;if(_!==void 0){g=_;continue e}}return x}while(!0)}function d(g){do{const y=g.sub,h=y.flags;(h&48)===32&&(y.flags=h|16,(h&6)===2&&t(y))}while((g=g.nextSub)!==void 0)}function m(g,y){let h=y.depsTail;for(;h!==void 0;){if(h===g)return!0;h=h.prevDep}return!1}}function $b(e,t,n){var u,l,d;const o=typeof e=="object",i=o?e:void 0;return{next:(u=o?e.next:e)==null?void 0:u.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 Bh=[];let Rc=0;const{link:Iv,unlink:Fb,propagate:Db,checkDirty:aw,shallowPropagate:Rv}=jb({update(e){return e._update()},notify(e){Bh[Vh++]=e,e.flags&=~Ge.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Ge.Mutable|Ge.Dirty,Vc(e))}});let yc=0,Vh=0,ar,qh=0;function uw(e){try{++qh,e()}finally{--qh||cw()}}function Vc(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=Fb(n,e)}function cw(){if(!(qh>0)){for(;yc<Vh;){const e=Bh[yc];Bh[yc++]=void 0,e.notify()}yc=0,Vh=0}}function Tv(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?Ge.None:Ge.Mutable,get(){return ar!==void 0&&Iv(i,ar,Rc),i._snapshot},subscribe(u){const l=$b(u),d={current:!1},m=Ub(()=>{var g;i.get(),d.current?(g=l.next)==null||g.call(l,i._snapshot):d.current=!0});return{unsubscribe:()=>{m.stop()}}},_update(u){const l=ar,d=(t==null?void 0:t.compare)??Object.is;if(n)ar=i,++Rc,i.depsTail=void 0;else if(u===void 0)return!1;n&&(i.flags=Ge.Mutable|Ge.RecursedCheck);try{const m=i._snapshot,g=typeof u=="function"?u(m):u===void 0&&n?o(m):u;return m===void 0||!d(m,g)?(i._snapshot=g,!0):!1}finally{ar=l,n&&(i.flags&=~Ge.RecursedCheck),Vc(i)}}};return n?(i.flags=Ge.Mutable|Ge.Dirty,i.get=function(){const u=i.flags;if(u&Ge.Dirty||u&Ge.Pending&&aw(i.deps,i)){if(i._update()){const l=i.subs;l!==void 0&&Rv(l)}}else u&Ge.Pending&&(i.flags=u&~Ge.Pending);return ar!==void 0&&Iv(i,ar,Rc),i._snapshot}):i.set=function(u){if(i._update(u)){const l=i.subs;l!==void 0&&(Db(l),Rv(l),cw())}},i}function Ub(e){const t=()=>{const o=ar;ar=n,++Rc,n.depsTail=void 0,n.flags=Ge.Watching|Ge.RecursedCheck;try{return e()}finally{ar=o,n.flags&=~Ge.RecursedCheck,Vc(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Ge.Watching|Ge.RecursedCheck,notify(){const o=this.flags;o&Ge.Dirty||o&Ge.Pending&&aw(this.deps,this)?t():this.flags=Ge.Watching},stop(){this.flags=Ge.None,this.depsTail=void 0,Vc(this)}};return t(),n}var th={exports:{}},nh={},rh={exports:{}},sh={};/**
|
|
43
|
-
* @license React
|
|
44
|
-
* use-sync-external-store-shim.production.js
|
|
45
|
-
*
|
|
46
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
47
|
-
*
|
|
48
|
-
* This source code is licensed under the MIT license found in the
|
|
49
|
-
* LICENSE file in the root directory of this source tree.
|
|
50
|
-
*/var Ov;function zb(){if(Ov)return sh;Ov=1;var e=$a();function t(h,v){return h===v&&(h!==0||1/h===1/v)||h!==h&&v!==v}var n=typeof Object.is=="function"?Object.is:t,o=e.useState,i=e.useEffect,u=e.useLayoutEffect,l=e.useDebugValue;function d(h,v){var x=v(),w=o({inst:{value:x,getSnapshot:v}}),k=w[0].inst,b=w[1];return u(function(){k.value=x,k.getSnapshot=v,m(k)&&b({inst:k})},[h,x,v]),i(function(){return m(k)&&b({inst:k}),h(function(){m(k)&&b({inst:k})})},[h]),l(x),x}function m(h){var v=h.getSnapshot;h=h.value;try{var x=v();return!n(h,x)}catch{return!0}}function g(h,v){return v()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?g:d;return sh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y,sh}var Mv;function Bb(){return Mv||(Mv=1,rh.exports=zb()),rh.exports}/**
|
|
51
|
-
* @license React
|
|
52
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
53
|
-
*
|
|
54
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
55
|
-
*
|
|
56
|
-
* This source code is licensed under the MIT license found in the
|
|
57
|
-
* LICENSE file in the root directory of this source tree.
|
|
58
|
-
*/var Lv;function Vb(){if(Lv)return nh;Lv=1;var e=$a(),t=Bb();function n(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var o=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,u=e.useRef,l=e.useEffect,d=e.useMemo,m=e.useDebugValue;return nh.useSyncExternalStoreWithSelector=function(g,y,h,v,x){var w=u(null);if(w.current===null){var k={hasValue:!1,value:null};w.current=k}else k=w.current;w=d(function(){function B(F){if(!_){if(_=!0,A=F,F=v(F),x!==void 0&&k.hasValue){var $=k.value;if(x($,F))return P=$}return P=F}if($=P,o(A,F))return $;var D=v(F);return x!==void 0&&x($,D)?(A=F,$):(A=F,P=D)}var _=!1,A,P,L=h===void 0?null:h;return[function(){return B(y())},L===null?void 0:function(){return B(L())}]},[y,h,v,x]);var b=i(g,w[0],w[1]);return l(function(){k.hasValue=!0,k.value=b},[b]),m(b),b},nh}var Nv;function qb(){return Nv||(Nv=1,th.exports=Vb()),th.exports}var Wb=qb();function Hb(e,t){return e===t}function Qt(e,t,n=Hb){const o=te.useCallback(l=>{if(!e)return()=>{};const{unsubscribe:d}=e.subscribe(l);return d},[e]),i=te.useCallback(()=>e==null?void 0:e.get(),[e]);return Wb.useSyncExternalStoreWithSelector(o,i,i,t,n)}var oh={get(){},subscribe(){return{unsubscribe(){}}}};function lw(e,t){const n=te.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=Us(n.current,i):i}}function no(e){const t=Cn(),n=te.useContext(e.from?Ab:pl),o=e.from?t.stores.getRouteMatchStore(e.from):t.stores.matchStores.get(n),i=lw(e,t),u=Qt(o??oh,l=>l?i(l):oh);if(u!==oh)return u;(e.shouldThrow??!0)&&Tr()}function fw(e){return no({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function dw(e){const{select:t,...n}=e;return no({...n,select:o=>t?t(o.loaderDeps):o.loaderDeps})}function hw(e){return no({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 pw(e){return no({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function mw(e){const t=Cn();return te.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 no({...e,select:t=>e.select?e.select(t.context):t.context})}var Kb=Fx();function Qb(e,t){const n=Cn(),o=OP(t),{activeProps:i,inactiveProps:u,activeOptions:l,to:d,preload:m,preloadDelay:g,preloadIntentProximity:y,hashScrollIntoView:h,replace:v,startTransition:x,resetScroll:w,viewTransition:k,children:b,target:B,disabled:_,style:A,className:P,onClick:L,onBlur:F,onFocus:$,onMouseEnter:D,onMouseLeave:W,onTouchStart:X,ignoreBlocker:Z,params:ue,search:C,hash:H,state:Y,mask:Q,reloadDocument:z,unsafeRelative:G,from:se,_fromLocation:ee,...T}=e,J=ow(),me=te.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),he=Qt(n.stores.location,$e=>$e,($e,Ot)=>$e.href===Ot.href),le=te.useMemo(()=>{const $e={_fromLocation:he,...me};return n.buildLocation($e)},[n,he,me]),_e=le.maskedLocation?le.maskedLocation.publicHref:le.publicHref,Ne=le.maskedLocation?le.maskedLocation.external:le.external,ke=te.useMemo(()=>eI(_e,Ne,n.history,_),[_,Ne,_e,n.history]),be=te.useMemo(()=>{if(ke!=null&&ke.external)return Uc(ke.href,n.protocolAllowlist)?void 0:ke.href;if(!tI(d)&&!(typeof d!="string"||d.indexOf(":")===-1))try{return new URL(d),Uc(d,n.protocolAllowlist)?void 0:d}catch{}},[d,ke,n.protocolAllowlist]),at=te.useMemo(()=>{if(be)return!1;if(l!=null&&l.exact){if(!QP(he.pathname,le.pathname,n.basepath))return!1}else{const $e=zc(he.pathname,n.basepath),Ot=zc(le.pathname,n.basepath);if(!($e.startsWith(Ot)&&($e.length===Ot.length||$e[Ot.length]==="/")))return!1}return((l==null?void 0:l.includeSearch)??!0)&&!Bs(he.search,le.search,{partial:!(l!=null&&l.exact),ignoreUndefined:!(l!=null&&l.explicitUndefined)})?!1:l!=null&&l.includeHash?J&&he.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,he,be,J,le.hash,le.pathname,le.search,n.basepath]),yr=at?Ds(i,{})??Jb:ih,Ss=at?ih:Ds(u,{})??ih,xs=[P,yr.className,Ss.className].filter(Boolean).join(" "),co=(A||yr.style||Ss.style)&&{...A,...yr.style,...Ss.style},[su,di]=te.useState(!1),lo=te.useRef(!1),vr=e.reloadDocument||be?!1:m??n.options.defaultPreload,ws=g??n.options.defaultPreloadDelay??0,hn=te.useCallback(()=>{n.preloadRoute({...me,_builtLocation:le}).catch($e=>{console.warn($e),console.warn(Tb)})},[n,me,le]);TP(o,te.useCallback($e=>{$e!=null&&$e.isIntersecting&&hn()},[hn]),Zb,{disabled:!!_||vr!=="viewport"}),te.useEffect(()=>{lo.current||!_&&vr==="render"&&(hn(),lo.current=!0)},[_,hn,vr]);const Nr=$e=>{const Ot=$e.currentTarget.getAttribute("target"),Un=B!==void 0?B:Ot;if(!_&&!nI($e)&&!$e.defaultPrevented&&(!Un||Un==="_self")&&$e.button===0){$e.preventDefault(),Kb.flushSync(()=>{di(!0)});const ho=n.subscribe("onResolved",()=>{ho(),di(!1)});n.navigate({...me,replace:v,resetScroll:w,hashScrollIntoView:h,startTransition:x,viewTransition:k,ignoreBlocker:Z})}};if(be)return{...T,ref:o,href:be,...b&&{children:b},...B&&{target:B},..._&&{disabled:_},...A&&{style:A},...P&&{className:P},...L&&{onClick:L},...F&&{onBlur:F},...$&&{onFocus:$},...D&&{onMouseEnter:D},...W&&{onMouseLeave:W},...X&&{onTouchStart:X}};const fo=$e=>{if(_||vr!=="intent")return;if(!ws){hn();return}const Ot=$e.currentTarget;if(ta.has(Ot))return;const Un=setTimeout(()=>{ta.delete(Ot),hn()},ws);ta.set(Ot,Un)},ou=$e=>{_||vr!=="intent"||hn()},hi=$e=>{if(_||!vr||!ws)return;const Ot=$e.currentTarget,Un=ta.get(Ot);Un&&(clearTimeout(Un),ta.delete(Ot))};return{...T,...yr,...Ss,href:ke==null?void 0:ke.href,ref:o,onClick:Fo([L,Nr]),onBlur:Fo([F,hi]),onFocus:Fo([$,fo]),onMouseEnter:Fo([D,fo]),onMouseLeave:Fo([W,hi]),onTouchStart:Fo([X,ou]),disabled:!!_,target:B,...co&&{style:co},...xs&&{className:xs},..._&&Gb,...at&&Yb,...J&&su&&Xb}}var ih={},Jb={className:"active"},Gb={role:"link","aria-disabled":!0},Yb={"data-status":"active","aria-current":"page"},Xb={"data-transitioning":"transitioning"},ta=new WeakMap,Zb={rootMargin:"100px"},Fo=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function eI(e,t,n,o){if(!o)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function tI(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Dp=te.forwardRef((e,t)=>{const{_asChild:n,...o}=e,{type:i,...u}=Qb(o,t),l=typeof o.children=="function"?o.children({isActive:u["data-status"]==="active"}):o.children;if(!n){const{disabled:d,...m}=u;return te.createElement("a",m,l)}return te.createElement(n,u,l)});function nI(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var rI=class extends sw{constructor(e){super(e),this.useMatch=t=>no({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=>pw({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>hw({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>dw({...t,from:this.id}),this.useLoaderData=t=>fw({...t,from:this.id}),this.useNavigate=()=>mw({from:this.fullPath}),this.Link=ya.forwardRef((t,n)=>I.jsx(Dp,{ref:n,from:this.fullPath,...t}))}};function yw(e){return new rI(e)}var sI=class extends Ob{constructor(e){super(e),this.useMatch=t=>no({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=>pw({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>hw({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>dw({...t,from:this.id}),this.useLoaderData=t=>fw({...t,from:this.id}),this.useNavigate=()=>mw({from:this.fullPath}),this.Link=ya.forwardRef((t,n)=>I.jsx(Dp,{ref:n,from:this.fullPath,...t}))}};function oI(e){return new sI(e)}function iI(e){const t=Cn(),n=`not-found-${Qt(t.stores.location,o=>o.pathname)}-${Qt(t.stores.status,o=>o)}`;return I.jsx($p,{getResetKey:()=>n,onCatch:(o,i)=>{var u;if(zt(o))(u=e.onCatch)==null||u.call(e,o,i);else throw o},errorComponent:({error:o})=>{var i;if(zt(o))return(i=e.fallback)==null?void 0:i.call(e,o);throw o},children:e.children})}function aI(){return I.jsx("p",{children:"Not Found"})}function Bo(e){return I.jsx(I.Fragment,{children:e.children})}function vw(e,t,n){return t.options.notFoundComponent?I.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?I.jsx(e.options.defaultNotFoundComponent,{...n}):I.jsx(aI,{})}function uI(e){return null}function cI(){return uI(Cn()),null}var lI=(e,t)=>e.routeId===t.routeId&&e._displayPending===t._displayPending,fI=(e,t)=>e[0]===t[0]&&e[1]===t[1],Sw=te.memo(function({matchId:t}){const n=Cn(),o=n.stores.matchStores.get(t);o||Tr();const i=Qt(n.stores.loadedAt,l=>l),u=Qt(o,l=>l,lI);return I.jsx(dI,{router:n,matchId:t,resetKey:i,matchState:te.useMemo(()=>{var m;const l=u.routeId,d=(m=n.routesById[l].parentRoute)==null?void 0:m.id;return{routeId:l,ssr:u.ssr,_displayPending:u._displayPending,parentRouteId:d}},[u._displayPending,u.routeId,u.ssr,n.routesById])})});function dI({router:e,matchId:t,resetKey:n,matchState:o}){var w,k;const i=e.routesById[o.routeId],u=i.options.pendingComponent??e.options.defaultPendingComponent,l=u?I.jsx(u,{}):null,d=i.options.errorComponent??e.options.defaultErrorComponent,m=i.options.onCatch??e.options.defaultOnCatch,g=i.isRoot?i.options.notFoundComponent??((w=e.options.notFoundRoute)==null?void 0:w.options.component):i.options.notFoundComponent,y=o.ssr===!1||o.ssr==="data-only",h=(!i.isRoot||i.options.wrapInSuspense||y)&&(i.options.wrapInSuspense??u??(((k=i.options.errorComponent)==null?void 0:k.preload)||y))?te.Suspense:Bo,v=d?$p:Bo,x=g?iI:Bo;return I.jsxs(i.isRoot?i.options.shellComponent??Bo:Bo,{children:[I.jsx(pl.Provider,{value:t,children:I.jsx(h,{fallback:l,children:I.jsx(v,{getResetKey:()=>n,errorComponent:d||Fp,onCatch:(b,B)=>{if(zt(b))throw b.routeId??(b.routeId=o.routeId),b;m==null||m(b,B)},children:I.jsx(x,{fallback:b=>{if(b.routeId??(b.routeId=o.routeId),!g||b.routeId&&b.routeId!==o.routeId||!b.routeId&&!i.isRoot)throw b;return te.createElement(g,b)},children:y||o._displayPending?I.jsx(Lb,{fallback:l,children:I.jsx(Av,{matchId:t})}):I.jsx(Av,{matchId:t})})})})}),o.parentRouteId===Vs?I.jsxs(I.Fragment,{children:[I.jsx(hI,{}),e.options.scrollRestoration&&Vx?I.jsx(cI,{}):null]}):null]})}function hI(){const e=Cn(),t=te.useRef();return sa(()=>{const n=e.stores.resolvedLocation.get(),o=t.current;n&&(!o||o.href!==n.href)&&e.emit({type:"onRendered",...Wo(e.stores.location.get(),o??n)}),t.current=n},[Qt(e.stores.resolvedLocation,n=>n==null?void 0:n.state.__TSR_key),e]),null}var Av=te.memo(function({matchId:t}){const n=Cn(),o=(y,h)=>{var v;return((v=n.getMatch(y.id))==null?void 0:v._nonReactive[h])??y._nonReactive[h]},i=n.stores.matchStores.get(t);i||Tr();const u=Qt(i,y=>y),l=u.routeId,d=n.routesById[l],m=te.useMemo(()=>{var h;const y=(h=n.routesById[l].options.remountDeps??n.options.defaultRemountDeps)==null?void 0:h({routeId:l,loaderDeps:u.loaderDeps,params:u._strictParams,search:u._strictSearch});return y?JSON.stringify(y):void 0},[l,u.loaderDeps,u._strictParams,u._strictSearch,n.options.defaultRemountDeps,n.routesById]),g=te.useMemo(()=>{const y=d.options.component??n.options.defaultComponent;return y?I.jsx(y,{},m):I.jsx(xw,{})},[m,d.options.component,n.options.defaultComponent]);if(u._displayPending)throw o(u,"displayPendingPromise");if(u._forcePending)throw o(u,"minPendingPromise");if(u.status==="pending"){const y=d.options.pendingMinMs??n.options.defaultPendingMinMs;if(y){const h=n.getMatch(u.id);if(h&&!h._nonReactive.minPendingPromise){const v=Jo();h._nonReactive.minPendingPromise=v,setTimeout(()=>{v.resolve(),h._nonReactive.minPendingPromise=void 0},y)}}throw o(u,"loadPromise")}if(u.status==="notFound")return zt(u.error)||Tr(),vw(n,d,u.error);if(u.status==="redirected")throw on(u.error)||Tr(),o(u,"loadPromise");if(u.status==="error")throw u.error;return g}),xw=te.memo(function(){const t=Cn(),n=te.useContext(pl);let o,i=!1,u;{const g=n?t.stores.matchStores.get(n):void 0;[o,i]=Qt(g,y=>[y==null?void 0:y.routeId,(y==null?void 0:y.globalNotFound)??!1],fI),u=Qt(t.stores.matchesId,y=>y[y.findIndex(h=>h===n)+1])}const l=o?t.routesById[o]:void 0,d=t.options.defaultPendingComponent?I.jsx(t.options.defaultPendingComponent,{}):null;if(i)return l||Tr(),vw(t,l,void 0);if(!u)return null;const m=I.jsx(Sw,{matchId:u});return o===Vs?I.jsx(te.Suspense,{fallback:d,children:m}):m});function pI(){const e=Cn(),t=te.useRef({router:e,mounted:!1}),[n,o]=te.useState(!1),i=Qt(e.stores.isLoading,h=>h),u=Qt(e.stores.hasPending,h=>h),l=Qd(i),d=i||n||u,m=Qd(d),g=i||u,y=Qd(g);return e.startTransition=h=>{o(!0),te.startTransition(()=>{h(),o(!1)})},te.useEffect(()=>{const h=e.history.subscribe(e.load),v=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Rr(e.latestLocation.publicHref)!==Rr(v.publicHref)&&e.commitLocation({...v,replace:!0}),()=>{h()}},[e,e.history]),sa(()=>{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]),sa(()=>{l&&!i&&e.emit({type:"onLoad",...Wo(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,e,i]),sa(()=>{y&&!g&&e.emit({type:"onBeforeRouteMount",...Wo(e.stores.location.get(),e.stores.resolvedLocation.get())})},[g,y,e]),sa(()=>{if(m&&!d){const h=Wo(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...h}),uw(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())})}},[d,m,e]),null}function mI(){const e=Cn(),t=e.routesById[Vs].options.pendingComponent??e.options.defaultPendingComponent,n=t?I.jsx(t,{}):null,o=I.jsxs(typeof document<"u"&&e.ssr?Bo:te.Suspense,{fallback:n,children:[I.jsx(pI,{}),I.jsx(gI,{})]});return e.options.InnerWrap?I.jsx(e.options.InnerWrap,{children:o}):o}function gI(){const e=Cn(),t=Qt(e.stores.firstId,i=>i),n=Qt(e.stores.loadedAt,i=>i),o=t?I.jsx(Sw,{matchId:t}):null;return I.jsx(pl.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?o:I.jsx($p,{getResetKey:()=>n,errorComponent:Fp,onCatch:void 0,children:o})})}var yI=e=>({createMutableStore:Tv,createReadonlyStore:Tv,batch:uw}),vI=e=>new SI(e),SI=class extends gb{constructor(e){super(e,yI)}};function xI({router:e,children:t,...n}){Wx(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const o=I.jsx(iw.Provider,{value:e,children:t});return e.options.Wrap?I.jsx(e.options.Wrap,{children:o}):o}function wI({router:e,...t}){return I.jsx(xI,{router:e,...t,children:I.jsx(mI,{})})}function kI(e){const t=Cn({warn:(e==null?void 0:e.router)===void 0}),n=(e==null?void 0:e.router)||t;return Qt(n.stores.__store,lw(e,n))}const ml=["claude","codex","cursor","copilot","pi","opencode","antigravity","gemini","grok"],br={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",knownProviders:[]},_I=["claude","codex","cursor"],ah=["cyan","magenta","green","yellow","blue","red"],jv=[...ml],gF=["cyan","magenta","green","yellow","blue","red","cyanBright","magentaBright","greenBright"],uh={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"}},EI=/[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}/i,CI=/[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}/gi;function PI(e){return typeof e=="string"&&EI.test(e)}function ww(e){return e.replace(CI,"[redacted]")}function yF(e,t=jv.filter(o=>!e.disabledProviders.includes(o)),n){const o=new Set(t),i=new Set,u=new Set,l=new Set,d=new Set,m=[],g=(h,v)=>`${h}:${v&&v!=="~"?v:"~"}`,y=h=>{l.add(h.id),d.add(g(h.providerId,h.homeDir)),m.push(h)};if(e.accounts.forEach((h,v)=>{const x=uh[h.providerId];i.add(h.id),u.add(g(h.providerId,h.homeDir)),y({id:h.id,providerId:h.providerId,name:h.name,homeDir:h.homeDir||"~",color:h.color||x.color,source:"configured",explicitId:h.id,explicitIndex:v})}),n)for(const h of n){if(e.disabledProviders.includes(h.providerId))continue;const v=g(h.providerId,h.homeDir);if(i.has(h.id)||u.has(v)||l.has(h.id)||d.has(v))continue;const x=uh[h.providerId];y({id:h.id,providerId:h.providerId,name:h.name,homeDir:h.homeDir||"~",color:h.color||x.color,source:"auto"})}for(const h of jv){if(e.disabledProviders.includes(h)||!o.has(h))continue;const v=g(h,"~");if(i.has(h)||u.has(v)||l.has(h)||d.has(v))continue;const x=uh[h];y({id:h,providerId:h,name:x.name,homeDir:"~",color:x.color,source:"auto"})}return m}function $v(e,t,n){return typeof e=="number"&&Number.isFinite(e)&&e>=n?e:t}function bI(e){try{return new Intl.DateTimeFormat("en-CA",{timeZone:e}),!0}catch{return!1}}function Fv(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function ch(e){return ml.includes(e)}function II(e,t){try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}function Up(e){const t=[],n=Fv(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=[],u=new Set;o.forEach((h,v)=>{if(!Fv(h)){t.push(`accounts[${v}] was not an object`);return}const x=h.providerId??"claude";if(!ch(x)){t.push(`accounts[${v}].providerId was invalid`);return}const w=typeof h.id=="string"&&h.id.trim()?h.id.trim():"",k=typeof h.name=="string"&&h.name.trim()?h.name.trim():"";if(!w||!k){t.push(`accounts[${v}] was missing id or name`);return}if(u.has(w)){t.push(`accounts[${v}].id was duplicated`);return}u.add(w),i.push({id:w,providerId:x,name:k,homeDir:typeof h.homeDir=="string"&&h.homeDir.trim()?h.homeDir:"~",...typeof h.color=="string"&&h.color.trim()?{color:h.color}:{}})});const l=(Array.isArray(n.disabledProviders)?n.disabledProviders:[]).filter(ch);n.disabledProviders!==void 0&&!Array.isArray(n.disabledProviders)&&t.push("disabledProviders was not an array");const d=Array.isArray(n.knownProviders)?n.knownProviders.filter(ch):n.onboarded===!0?[..._I]:[];n.knownProviders!==void 0&&!Array.isArray(n.knownProviders)&&t.push("knownProviders was not an array");const m=typeof n.activeAccountId=="string"&&(u.has(n.activeAccountId)||ml.includes(n.activeAccountId))?n.activeAccountId:null;n.activeAccountId!==void 0&&n.activeAccountId!==null&&m===null&&t.push("activeAccountId did not match a known account/provider");const g=typeof n.timezone=="string"&&n.timezone.trim()&&bI(n.timezone.trim())?n.timezone.trim():null;n.timezone!==void 0&&n.timezone!==null&&g===null&&t.push("timezone was invalid");const y={...br,revision:typeof n.revision=="number"&&Number.isSafeInteger(n.revision)&&n.revision>=0?n.revision:br.revision,interval:$v(n.interval,br.interval,1),billingInterval:$v(n.billingInterval,br.billingInterval,1),clearScreen:typeof n.clearScreen=="boolean"?n.clearScreen:br.clearScreen,privacyMode:typeof n.privacyMode=="boolean"?n.privacyMode:br.privacyMode,privacyToggleKey:typeof n.privacyToggleKey=="string"&&n.privacyToggleKey.length===1?n.privacyToggleKey:br.privacyToggleKey,timezone:g,accounts:i,activeAccountId:m,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",knownProviders:d};for(const h of Object.keys(br))h in n||t.push(`missing ${h}`);return{config:y,repaired:t.length>0||!II(n,y),reasons:t}}function RI(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"").slice(0,48)}function vF(e,t){const n=RI(e)||"account",o=new Set(t.map(i=>i.id));if(!o.has(n))return n;for(let i=2;i<1e3;i++){const u=`${n}_${i}`;if(!o.has(u))return u}return`${n}_${Date.now()}`}function SF(e){const t=new Set(e.map(n=>n.color).filter(Boolean));for(const n of ah)if(!t.has(n))return n;return ah[e.length%ah.length]}function xF(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 _a="#8d9090",sn={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:_a,grey:_a},TI={claude:sn.green,codex:sn.cyan,cursor:sn.magenta,copilot:sn.white,pi:sn.blue,opencode:sn.yellow,antigravity:sn.red,gemini:sn.greenBright,grok:sn.yellowBright};function OI(e){return e?e.startsWith("#")?e:sn[e]??_a:_a}const wF=OI;function kF(e){return TI[e]??_a}const Dv=["#00d7ff","#00d787","#e6b450","#d75f87","#5f87ff","#af87ff","#5fd7a7","#ff8787","#d7af5f","#87d7ff","#d787d7","#9ee493","#ffb454","#7aa2f7","#bb9af7"],Uv=new Map;function MI(e){const t=Uv.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=Dv[n%Dv.length];return Uv.set(e,o),o}const _F={input:sn.blue,output:sn.green,cacheCreate:sn.yellow,cacheRead:sn.cyan};function zv(e){return e.replace(/^claude-/,"").replace(/^gpt-/,"gpt-").replace(/-\d{8}$/,"").replace(/-latest$/,"")}const Bv=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function EF(e,t={}){if(!Number.isFinite(e))return"$0.00";const n=t.sign&&e>0?"+":"",o=Math.abs(e);return o>=1e5?`${n}$${(e/1e3).toFixed(0)}k`:o>=1e4?`${n}$${(e/1e3).toFixed(1)}k`:o>=1?`${n}$${e.toFixed(2)}`:o>=.01?`${n}$${e.toFixed(3)}`:o===0?"$0.00":`${n}$${e.toFixed(4)}`}function CF(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 PF(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 bF(e){return Number.isFinite(e)?Math.round(e).toLocaleString("en-US"):"0"}function IF(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 RF(e,t=0){return Number.isFinite(e)?`${(e*100).toFixed(t)}%`:"0%"}function LI(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 TF(e){const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(t)return`${Bv[Number(t[2])-1]} ${Number(t[3])}`;const n=/^(\d{4})-(\d{2})$/.exec(e);return n?`${Bv[Number(n[2])-1]} ${n[1]}`:e}function kw(e){return e.input+e.output+e.cacheCreate+e.cacheRead}const zp=864e5,OF=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Bp=e=>{const[t,n,o]=e.split("-").map(Number);return Date.UTC(t,(n||1)-1,o||1)},Vp=e=>new Date(e).toISOString().slice(0,10),NI=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)}},AI=e=>(new Date(e).getUTCDay()+6)%7,MF=e=>{const t=Bp(e);return Vp(t-AI(t)*zp)},jI={period:"all"},_w=[{key:"7d",label:"7 days"},{key:"30d",label:"30 days"},{key:"90d",label:"90 days"},{key:"mtd",label:"month"},{key:"all",label:"6 months"}];function Ew(e){return e.providers.length?new Set(e.providers):null}function $I(e,t){const n=Ew(t);return e.accounts.filter(o=>!(!o.hasUsage||t.account!=="all"&&o.id!==t.account||n&&!n.has(o.providerId)))}function Wh(e){var t,n,o,i,u,l,d,m,g;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=(u=e.billing)==null?void 0:u.activity)==null?void 0:l.series)!=null&&d.length||(g=(m=e.billing)==null?void 0:m.modelSpend)!=null&&g.length))}function FI(e,t){const n=Ew(t);return e.accounts.filter(o=>!(!o.hasUsage&&!Wh(o)||t.account!=="all"&&o.id!==t.account||n&&!n.has(o.providerId)))}function DI(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 Cw(e,t,n){if(!t||e==="all")return null;if(e==="mtd")return NI(n).slice(0,7)+"-01";const o=e==="7d"?7:e==="90d"?90:30;return Vp(Bp(t)-(o-1)*zp)}function LF(e,t,n,o){if(!n||e==="all")return null;const i=Cw(e,n,o);if(t==="daily")return i;const u=t==="monthly"?365:84,l=Vp(Bp(n)-(u-1)*zp);return i&&i<l?i:l}const UI=()=>({cost:0,tokens:0,cacheSavings:0,calls:0}),zI=(e,t,n,o,i)=>{e.cost+=t,e.tokens+=n,e.cacheSavings+=o,e.calls+=i};function BI(){return{totals:UI(),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 VI(e,t,n,o,i){let u=0,l=0,d=0,m=0;for(const h of t.breakdown){if(e.modelOptionSet.add(h.name),i&&!i.has(h.name))continue;const v=kw(h);u+=h.cost,l+=v,d+=h.cacheSavings,m+=h.count,e.tokenComposition.input+=h.input,e.tokenComposition.output+=h.output,e.tokenComposition.cacheCreate+=h.cacheCreate,e.tokenComposition.cacheRead+=h.cacheRead;const x=e.modelAgg.get(h.name)??{cost:0,tokens:0,cacheSavings:0,calls:0};x.cost+=h.cost,x.tokens+=v,x.cacheSavings+=h.cacheSavings,x.calls+=h.count,e.modelAgg.set(h.name,x);let w=e.modelTrend.get(h.name);w||(w=new Map,e.modelTrend.set(h.name,w)),w.set(t.label,(w.get(t.label)??0)+h.cost)}if(i&&m===0&&u===0)return;zI(e.totals,u,l,d,m);const g=e.timelineMap.get(t.label)??{date:t.label,total:0,tokens:0,byProvider:{}};g.total+=u,g.tokens+=l,g.byProvider[n]=(g.byProvider[n]??0)+u,e.timelineMap.set(t.label,g),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+=u,y.tokens+=l,y.calls+=m,e.provAgg.set(n,y)}function qI(e){return[...e.timelineMap.values()].sort((t,n)=>t.date.localeCompare(n.date))}function WI(e,t,n){const o=t.map(i=>i.date);return[...e.modelAgg.entries()].map(([i,u])=>{const l=e.modelTrend.get(i);return{model:i,color:MI(i),cost:u.cost,tokens:u.tokens,cacheSavings:u.cacheSavings,calls:u.calls,share:n>0?u.cost/n:0,tokenShare:e.totals.tokens>0?u.tokens/e.totals.tokens:0,callShare:e.totals.calls>0?u.calls/e.totals.calls:0,trend:o.map(d=>(l==null?void 0:l.get(d))??0)}}).sort((i,u)=>u.cost-i.cost)}function HI(e,t){var _,A,P;const n=e?$I(e,t):[],o=DI(n),i=Cw(t.period,o,(e==null?void 0:e.tz)??""),u=t.models.length?new Set(t.models):null,l=new Map,d=new Map;for(const L of(e==null?void 0:e.providers)??[])l.set(L.id,L.color),d.set(L.id,L.name);const m=BI(),g=L=>!i||L>=i;for(const L of n){m.burnRate+=((_=L.dashboard)==null?void 0:_.burnRate)??0;const F=L.providerId,$=l.get(F)??L.color;for(const D of((A=L.table)==null?void 0:A.daily)??[])g(D.label)&&VI(m,D,F,$,u)}for(const L of m.provAgg.values()){const F=d.get(L.id);F&&(L.name=F)}const y=qI(m);let h=0;const v=y.map(L=>(h+=L.total,{date:L.date,total:h})),x=y.map(L=>({date:L.date,value:m.cacheByDay.get(L.date)??0})),w=new Map;for(const L of n)for(const F of((P=L.table)==null?void 0:P.daily)??[]){if(!g(F.label))continue;const $=u?F.breakdown.filter(W=>u.has(W.name)):F.breakdown;if(u&&$.length===0)continue;let D=w.get(F.label);D||(D={tokens:0,calls:0,cacheSavings:0,models:new Map},w.set(F.label,D));for(const W of $)D.tokens+=kw(W),D.calls+=W.count,D.cacheSavings+=W.cacheSavings,D.models.set(W.name,(D.models.get(W.name)??0)+W.cost)}const k=y.map(L=>{const F=w.get(L.date);return{date:L.date,cost:L.total,tokens:(F==null?void 0:F.tokens)??0,calls:(F==null?void 0:F.calls)??0,cacheSavings:(F==null?void 0:F.cacheSavings)??0,models:F?[...F.models.entries()].map(([$,D])=>({name:$,cost:D})).sort(($,D)=>D.cost-$.cost):[]}}),b=[...m.provAgg.values()].sort((L,F)=>F.cost-L.cost),B=WI(m,y,m.totals.cost);return{filteredAccounts:n,totals:m.totals,burnRate:m.burnRate,timeline:y,cumulative:v,cacheSavingsSeries:x,calendar:k,cardAccounts:e?FI(e,t):[],byProvider:b,byModel:B,tokenComposition:m.tokenComposition,modelOptions:[...m.modelOptionSet].sort(),latestDay:o,rangeStart:i}}function qt({children:e,className:t="size-4",...n}){return I.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 NF=e=>I.jsxs(qt,{...e,children:[I.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"}),I.jsx("circle",{cx:"12",cy:"13",r:"4"})]}),AF=e=>I.jsx(qt,{...e,children:I.jsx("path",{d:"M20 6 9 17l-5-5"})}),jF=e=>I.jsxs(qt,{...e,children:[I.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),I.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),$F=e=>I.jsxs(qt,{...e,children:[I.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),I.jsx("path",{d:"m7 10 5 5 5-5"}),I.jsx("path",{d:"M12 15V3"})]}),FF=e=>I.jsx(qt,{...e,children:I.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"})}),KI=e=>I.jsxs(qt,{...e,children:[I.jsx("path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"}),I.jsx("path",{d:"m16 6-4-4-4 4"}),I.jsx("path",{d:"M12 2v13"})]}),QI=e=>I.jsx(qt,{...e,children:I.jsx("path",{d:"m6 9 6 6 6-6"})}),DF=e=>I.jsxs(qt,{...e,children:[I.jsx("circle",{cx:"11",cy:"11",r:"8"}),I.jsx("path",{d:"m21 21-4.3-4.3"})]}),JI=e=>I.jsxs(qt,{...e,children:[I.jsx("path",{d:"M18 6 6 18"}),I.jsx("path",{d:"m6 6 12 12"})]}),GI=e=>I.jsxs(qt,{...e,children:[I.jsx("circle",{cx:"12",cy:"12",r:"4"}),I.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"})]}),YI=e=>I.jsx(qt,{...e,children:I.jsx("path",{d:"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"})}),XI=e=>I.jsxs(qt,{...e,children:[I.jsx("circle",{cx:"12",cy:"12",r:"3"}),I.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"})]}),UF=e=>I.jsx(qt,{...e,children:I.jsx("path",{d:"M12 5v14M5 12h14"})}),zF=e=>I.jsx(qt,{...e,children:I.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"})}),BF=e=>I.jsxs(qt,{...e,children:[I.jsx("path",{d:"M12 20h9"}),I.jsx("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4z"})]}),VF=e=>I.jsx(qt,{...e,children:I.jsx("path",{d:"m18 15-6-6-6 6"})});function ZI(e,t){return t?ww(e):e}function Vv({value:e,privacyMode:t,className:n,title:o}){const[i,u]=te.useState(!1);return!(t&&PI(e))||i?I.jsx("span",{className:n,title:o??e,children:e}):I.jsx("button",{type:"button",onClick:()=>u(!0),className:`min-w-0 cursor-pointer truncate rounded text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent ${n??""}`,title:"Click to reveal email","aria-label":"Email hidden. Click to reveal.",children:I.jsx("span",{className:"inline-block max-w-full truncate blur-sm transition hover:blur-[2px]",children:ww(e)})})}const qp="focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent";function e2({options:e,value:t,onChange:n,size:o="sm",btnClassName:i,containerClassName:u,ariaLabel:l}){const d="flex items-center overflow-hidden rounded border border-line",m=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",g=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 I.jsx("div",{className:u??d,role:"group","aria-label":l,children:e.map(h=>I.jsx("button",{type:"button","aria-pressed":t===h.value,onClick:()=>n(h.value),className:`${i??m} ${qp} ${t===h.value?g:y}`,children:h.label},String(h.value)))})}function qv({label:e,value:t,children:n}){const[o,i]=te.useState(!1),u=te.useRef(null),l=te.useRef(null),d=te.useRef(null),m=te.useId(),g=(h=!1)=>{i(!1),h&&requestAnimationFrame(()=>{var v;return(v=l.current)==null?void 0:v.focus()})};te.useEffect(()=>{if(!o)return;const h=v=>{u.current&&!u.current.contains(v.target)&&g()};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[o]);const y=h=>{var k;const v=Array.from(((k=d.current)==null?void 0:k.querySelectorAll('[role="menuitem"]:not([disabled])'))??[]),x=v.indexOf(document.activeElement);let w=null;if(h.key==="Escape"){h.preventDefault(),g(!0);return}h.key==="Home"&&(w=0),h.key==="End"&&(w=v.length-1),h.key==="ArrowDown"&&(w=x<0?0:(x+1)%v.length),h.key==="ArrowUp"&&(w=x<0?v.length-1:(x-1+v.length)%v.length),w!==null&&v[w]&&(h.preventDefault(),v[w].focus())};return I.jsxs("div",{ref:u,className:"relative",children:[I.jsxs("button",{ref:l,type:"button","aria-haspopup":"menu","aria-expanded":o,"aria-controls":o?m:void 0,onClick:()=>i(h=>!h),onKeyDown:h=>{h.key!=="ArrowDown"&&h.key!=="ArrowUp"||(h.preventDefault(),i(!0),requestAnimationFrame(()=>{var x,w;const v=(x=d.current)==null?void 0:x.querySelectorAll('[role="menuitem"]:not([disabled])');(w=v==null?void 0:v[h.key==="ArrowDown"?0:v.length-1])==null||w.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 ${qp}`,children:[I.jsxs("span",{className:"text-fg-faint",children:[e,":"]}),I.jsx("span",{className:"text-fg",children:t}),I.jsx(QI,{className:`size-3 transition ${o?"rotate-180":""}`})]}),o&&I.jsx("div",{id:m,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(()=>g(!0))})]})}function Wv({children:e}){return I.jsx("div",{className:"flex flex-col",children:e})}function vc({active:e,onClick:t,children:n}){return I.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 ${qp} ${e?"bg-bg-3 text-fg-bright":"text-fg-dim hover:bg-bg-3 hover:text-fg"}`,children:n})}function t2({snapshot:e,derived:t,filters:n,setFilters:o,privacyMode:i=!0}){const u=(e==null?void 0:e.providers)??[],d=((e==null?void 0:e.accounts)??[]).filter(_=>_.hasUsage),m=new Set(d.map(_=>_.providerId)),g=u.filter(_=>m.has(_.id)),y=new Set(t.cardAccounts.map(_=>_.providerId)),h=u.filter(_=>!m.has(_.id)&&y.has(_.id)),v=n.providers.length?d.filter(_=>n.providers.includes(_.providerId)):d,x=_=>{var A;return((A=u.find(P=>P.id===_))==null?void 0:A.name)??_},w=_=>_.name&&_.name!==x(_.providerId)?`${x(_.providerId)} · ${_.name}`:x(_.providerId),k=d.find(_=>_.id===n.account),b=_=>o(A=>{const P=A.providers.includes(_);return{...A,providers:P?A.providers.filter(L=>L!==_):[...A.providers,_]}}),B=n.providers.length>0||n.models.length>0||n.account!=="all";return I.jsx("div",{className:"border-t border-line bg-bg-0/70",children:I.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:[I.jsx("span",{className:"hidden text-xs text-fg-faint sm:inline",children:"filter:"}),I.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[g.map(_=>{const A=n.providers.includes(_.id),P=n.providers.length>0&&!A;return I.jsxs("button",{type:"button","aria-pressed":A,onClick:()=>b(_.id),className:"flex items-center gap-1.5 rounded border px-2 py-0.5 text-xs transition focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent max-sm:py-1.5",style:{borderColor:A?_.color:"var(--color-line)",color:P?"var(--color-fg-faint)":A?_.color:"var(--color-fg-dim)",background:A?"var(--color-bg-2)":"transparent"},title:A?`hide ${_.name}`:n.providers.length?`add ${_.name}`:`show only ${_.name}`,children:[I.jsx("span",{style:{color:_.color,opacity:P?.4:1},"aria-hidden":!0,children:A?"●":"○"}),_.name]},_.id)}),h.length>0&&I.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:[g.length>0&&I.jsx("span",{className:"text-line-2",children:"|"}),I.jsx("span",{children:"billing-only:"}),h.map(_=>I.jsxs("span",{className:"flex items-center gap-1 text-fg-dim",children:[I.jsx("span",{style:{color:_.color,opacity:.55},"aria-hidden":!0,children:"·"}),_.name]},_.id))]})]}),I.jsxs("div",{className:"flex w-full flex-wrap items-center gap-2 md:ml-auto md:w-auto",children:[v.length>1?I.jsx(qv,{label:"account",value:n.account==="all"?"all":k?ZI(w(k),i):"all",children:_=>I.jsxs(Wv,{children:[I.jsx(vc,{active:n.account==="all",onClick:()=>{o(A=>({...A,account:"all"})),_()},children:"All accounts"}),I.jsx("div",{className:"my-1 h-px bg-line"}),I.jsx("div",{className:"max-h-64 overflow-y-auto",children:v.map(A=>I.jsxs(vc,{active:n.account===A.id,onClick:()=>{o(P=>({...P,account:A.id})),_()},children:[I.jsx("span",{style:{color:A.color},"aria-hidden":!0,children:"●"})," ",I.jsx(Vv,{value:w(A),privacyMode:i,className:"truncate"})]},A.id))})]})}):v.length===1?I.jsxs("span",{className:"rounded border border-line bg-bg-1 px-2 py-1 text-xs text-fg-dim",children:["account: ",I.jsx(Vv,{value:w(v[0]),privacyMode:i,className:"text-fg"})]}):null,I.jsx(qv,{label:"model",value:n.models.length===0?"all":n.models.length===1?zv(n.models[0]):`${n.models.length} models`,children:()=>I.jsxs(Wv,{children:[I.jsx(vc,{active:n.models.length===0,onClick:()=>o(_=>({..._,models:[]})),children:"All models"}),I.jsx("div",{className:"my-1 h-px bg-line"}),I.jsxs("div",{className:"max-h-64 overflow-y-auto",children:[t.modelOptions.length===0&&I.jsx("div",{className:"px-2 py-1 text-xs text-fg-faint",children:"no models in range"}),t.modelOptions.map(_=>{const A=n.models.includes(_);return I.jsxs(vc,{active:A,onClick:()=>o(P=>({...P,models:A?P.models.filter(L=>L!==_):[...P.models,_]})),children:[I.jsx("span",{className:A?"text-accent":"text-fg-faint","aria-hidden":!0,children:A?"◉":"○"})," ",zv(_)]},_)})]})]})}),I.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[I.jsx("span",{className:"text-xs text-fg-faint",children:"range:"}),I.jsx(e2,{options:_w.map(_=>({value:_.key,label:_.key==="mtd"?"MTD":_.key==="all"?"6M":_.key})),value:n.period,onChange:_=>o(A=>({...A,period:_})),size:"sm",ariaLabel:"time range"})]}),B&&I.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-warning/60 hover:text-warning focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent",title:"Clear provider, model & account filters","aria-label":"Clear provider, model and account filters",children:[I.jsx(JI,{className:"size-3","aria-hidden":!0})," clear"]})]})]})})}const n2=te.lazy(()=>cr(()=>import("./share-sheet-BHtt-OmT.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url).then(e=>({default:e.ShareSheet}))),Pw=te.createContext(null),r2=()=>{const e=te.useContext(Pw);if(!e)throw new Error("useShare must be used inside ShareProvider");return e};function s2({children:e}){const[t,n]=te.useState(null);return I.jsxs(Pw.Provider,{value:n,children:[e,t?I.jsx(te.Suspense,{fallback:I.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:I.jsx(n2,{source:t,onClose:()=>n(null)})}):null]})}function o2({derived:e,periodLabel:t,tz:n,version:o}){const i=r2();return I.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] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent max-sm:py-2",title:"Create a shareable image",children:[I.jsx(KI,{className:"size-3.5"}),I.jsx("span",{children:"share"})]})}const Hv=[{key:"overview",label:"overview"},{key:"analytics",label:"analytics"},{key:"models",label:"models"},{key:"explore",label:"explore"}];function i2(e,t){const n=e.providers.filter(u=>t.providers.has(u)),o=e.account==="all"||t.accounts.has(e.account)?e.account:"all",i=t.modelsReady?e.models.filter(u=>t.models.has(u)):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 Wp(e,t,n){try{return e(t)}catch(o){return oP("[nuqs] Error while parsing value `%s`: %O"+(n?" (for key `%s`)":""),t,o,n),null}}function Xn(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),Wp(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 lh=Xn({parse:e=>e,serialize:String});Xn({parse:e=>{const t=parseInt(e);return t==t?t:null},serialize:e=>""+Math.round(e)});Xn({parse:e=>{const t=parseInt(e);return t==t?t-1:null},serialize:e=>""+Math.round(e+1)});Xn({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}});Xn({parse:e=>{const t=parseFloat(e);return t==t?t:null},serialize:String});Xn({parse:e=>e.toLowerCase()==="true",serialize:String});function Hp(e,t){return e.valueOf()===t.valueOf()}Xn({parse:e=>{const t=parseInt(e);return t==t?new Date(t):null},serialize:e=>""+e.valueOf(),eq:Hp});Xn({parse:e=>{const t=new Date(e);return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString(),eq:Hp});Xn({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:Hp});function a2(e){return u2(e)}function u2(e){return Xn({parse:t=>{const n=t;return e.includes(n)?n:null},serialize:String})}function Kv(e,t=","){const n=e.eq??((i,u)=>i===u),o=encodeURIComponent(t);return Xn({parse:i=>i===""?[]:i.split(t).map((u,l)=>Wp(e.parse,u.replaceAll(o,t),`[${l}]`)).filter(u=>u!=null),serialize:i=>i.map(u=>(e.serialize?e.serialize(u):String(u)).replaceAll(t,o)).join(t),eq(i,u){return i===u?!0:i.length!==u.length?!1:i.every((l,d)=>n(l,u[d]))}})}const fh=Lp(),c2={};function l2(e,t={}){const n=te.useId(),o=hP(),i=pP(),{history:u="replace",scroll:l=(o==null?void 0:o.scroll)??!1,shallow:d=(o==null?void 0:o.shallow)??!0,throttleMs:m=la.timeMs,limitUrlUpdates:g=o==null?void 0:o.limitUrlUpdates,clearOnDefault:y=(o==null?void 0:o.clearOnDefault)??!0,startTransition:h,urlKeys:v=c2}=t,x=Object.keys(e).join(","),w=te.useMemo(()=>Object.fromEntries(Object.keys(e).map(D=>[D,v[D]??D])),[x,JSON.stringify(v)]),k=dP(Object.values(w)),b=k.searchParams,B=te.useRef({}),_=te.useMemo(()=>Object.fromEntries(Object.keys(e).map(D=>[D,e[D].defaultValue??null])),[Object.values(e).map(({defaultValue:D})=>D).join(",")]),A=Kd.useQueuedQueries(Object.values(w)),[P,L]=te.useState(()=>dh(e,v,b??new URLSearchParams,A).state),F=te.useRef(P);if(Ye("[nuq+ %s `%s`] render - state: %O, iSP: %s",n,x,P,b),Object.keys(B.current).join("&")!==Object.values(w).join("&")){const{state:D,hasChanged:W}=dh(e,v,b,A,B.current,F.current);W&&(Ye("[nuq+ %s `%s`] State changed: %O",n,x,{state:D,initialSearchParams:b,queuedQueries:A,queryRef:B.current,stateRef:F.current}),F.current=D,L(D)),B.current=Object.fromEntries(Object.entries(w).map(([X,Z])=>{var ue;return[Z,((ue=e[X])==null?void 0:ue.type)==="multi"?b==null?void 0:b.getAll(Z):(b==null?void 0:b.get(Z))??null]}))}te.useEffect(()=>{const{state:D,hasChanged:W}=dh(e,v,b,A,B.current,F.current);W&&(Ye("[nuq+ %s `%s`] State changed: %O",n,x,{state:D,initialSearchParams:b,queuedQueries:A,queryRef:B.current,stateRef:F.current}),F.current=D,L(D))},[Object.values(w).map(D=>`${D}=${b==null?void 0:b.getAll(D)}`).join("&"),JSON.stringify(A)]),te.useEffect(()=>{const D=Object.keys(e).reduce((W,X)=>(W[X]=({state:Z,query:ue})=>{L(C=>{const{defaultValue:H}=e[X],Y=w[X],Q=Z??H??null,z=C[X]??H??null;return Object.is(z,Q)?(Ye("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). no change, skipping, resolved: %O",n,x,Y,Z,H,F.current),C):(F.current={...F.current,[X]:Q},B.current[Y]=ue,Ye("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). updateInternalState, resolved: %O",n,x,Y,Z,H,F.current),F.current)})},W),{});for(const W of Object.keys(e)){const X=w[W];Ye("[nuq+ %s `%s`] Subscribing to sync for `%s`",n,X,x),fh.on(X,D[W])}return()=>{for(const W of Object.keys(e)){const X=w[W];Ye("[nuq+ %s `%s`] Unsubscribing to sync for `%s`",n,X,x),fh.off(X,D[W])}}},[x,w]);const $=te.useCallback((D,W={})=>{var z,G,se,ee,T,J;const X=Object.fromEntries(Object.keys(e).map(me=>[me,null])),Z=typeof D=="function"?D(Qv(F.current,_))??X:D??X;Ye("[nuq+ %s `%s`] setState: %O",n,x,Z);let ue,C=0,H=!1;const Y=[];for(let[me,he]of Object.entries(Z)){const le=e[me],_e=w[me];if(!le||he===void 0)continue;(W.clearOnDefault??le.clearOnDefault??y)&&he!==null&&le.defaultValue!==void 0&&(le.eq??((be,at)=>be===at))(he,le.defaultValue)&&(he=null);const Ne=he===null?null:(le.serialize??String)(he);fh.emit(_e,{state:he,query:Ne});const ke={key:_e,query:Ne,options:{history:W.history??le.history??u,shallow:W.shallow??le.shallow??d,scroll:W.scroll??le.scroll??l,startTransition:W.startTransition??le.startTransition??h}};if(((z=W==null?void 0:W.limitUrlUpdates)==null?void 0:z.method)==="debounce"||(g==null?void 0:g.method)==="debounce"||((G=le.limitUrlUpdates)==null?void 0:G.method)==="debounce"){ke.options.shallow===!0&&console.warn(Fa(422));const be=((se=W==null?void 0:W.limitUrlUpdates)==null?void 0:se.timeMs)??(g==null?void 0:g.timeMs)??((ee=le.limitUrlUpdates)==null?void 0:ee.timeMs)??la.timeMs,at=Kd.push(ke,be,k,i);C<be&&(ue=at,C=be)}else{const be=((T=W==null?void 0:W.limitUrlUpdates)==null?void 0:T.timeMs)??((J=le==null?void 0:le.limitUrlUpdates)==null?void 0:J.timeMs)??(g==null?void 0:g.timeMs)??W.throttleMs??le.throttleMs??m;Y.push(Kd.abort(_e)),Cc.push(ke,be),H=!0}}const Q=Y.reduce((me,he)=>he(me),H?Cc.flush(k,i):Cc.getPendingPromise(k));return ue??Q},[x,u,d,l,m,g==null?void 0:g.method,g==null?void 0:g.timeMs,h,w,k.updateUrl,k.getSearchParamsSnapshot,k.rateLimitFactor,i,_]);return[te.useMemo(()=>Qv(P,_),[P,_]),$]}function dh(e,t,n,o,i,u){let l=!1;const d=Object.entries(e).reduce((m,[g,y])=>{const h=(t==null?void 0:t[g])??g,v=o[h],x=y.type==="multi"?[]:null,w=v===void 0?(y.type==="multi"?n==null?void 0:n.getAll(h):n==null?void 0:n.get(h))??x:v;return i&&u&&Ux(i[h]??x,w)?(m[g]=u[g]??null,m):(l=!0,m[g]=(yP(w)?null:Wp(y.parse,w,h))??null,i&&(i[h]=w),m)},{});if(!l){const m=Object.keys(e),g=Object.keys(u??{});l=m.length!==g.length||m.some(y=>!g.includes(y))}return{state:d,hasChanged:l}}function Qv(e,t){return Object.fromEntries(Object.keys(e).map(n=>[n,e[n]??t[n]??null]))}const f2=["7d","30d","90d","mtd","all"];function d2(){const[e,t]=l2({p:Kv(lh).withDefault([]),m:Kv(lh).withDefault([]),a:lh.withDefault("all"),period:a2(f2).withDefault(jI.period)},{history:"replace"}),n=te.useMemo(()=>({providers:e.p,models:e.m,account:e.a,period:e.period}),[e.p,e.m,e.a,e.period]),o=te.useCallback(i=>{t(u=>{const l={providers:u.p,models:u.m,account:u.a,period:u.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 At=(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}}},h2={pipe(){return At(this,arguments)}},gl=(function(){function e(){}return e.prototype=h2,e})(),ne=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(u){return t(u,n,o)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);const n=arguments;return function(o){return t(o,...n)}}}},Ee=e=>e,ds=e=>()=>e,Kp=ds(!0),bw=ds(!1),yl=ds(void 0),Da=yl;function Iw(e,t,n,o,i,u,l,d,m){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 u(i(o(n(t(e.apply(this,arguments))))))};case 7:return function(){return l(u(i(o(n(t(e.apply(this,arguments)))))))};case 8:return function(){return d(l(u(i(o(n(t(e.apply(this,arguments))))))))};case 9:return function(){return m(d(l(u(i(o(n(t(e.apply(this,arguments)))))))))}}}function hs(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 Hh=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 u=0;u<i.length;u++)t.add(i[u]);o=Object.getPrototypeOf(o)}return t.has("constructor")&&typeof e.constructor=="function"&&n===e.constructor.prototype&&t.delete("constructor"),t},Kh=new WeakSet;function Qp(e){return typeof e=="string"}function Rw(e){return typeof e=="number"}function p2(e){return typeof e=="boolean"}function vl(e){return typeof e=="function"}function m2(e){return e!==void 0}function g2(e){return e!=null}function y2(e){return!1}function Tw(e){return!0}function v2(e){return typeof e=="object"&&e!==null||vl(e)}const Ue=ne(2,(e,t)=>v2(e)&&t in e);function S2(e){return Ue(e,Symbol.iterator)||Qp(e)}const Gt="~effect/interfaces/Hash",ft=e=>{switch(typeof e){case"number":return Jp(e);case"bigint":return Et(e.toString(10));case"boolean":return Et(String(e));case"symbol":return Et(String(e));case"string":return Et(e);case"undefined":return Et("undefined");case"function":case"object":{if(e===null)return Et("null");if(e instanceof Date)return Et(e.toISOString());if(e instanceof RegExp)return Et(e.toString());{if(Kh.has(e))return Qh(e);if(ph.has(e))return ph.get(e);const t=E2(e,()=>x2(e)?e[Gt]():typeof e=="function"?Qh(e):Array.isArray(e)||ArrayBuffer.isView(e)?Ow(e):e instanceof Map?k2(e):e instanceof Set?_2(e):Gp(e));return ph.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`)}},Qh=e=>(hh.has(e)||hh.set(e,Jp(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER))),hh.get(e)),Qn=ne(2,(e,t)=>e*53^t),Sl=e=>e&3221225471|e>>>1&1073741824,x2=e=>Ue(e,Gt),Jp=e=>{if(e!==e)return Et("NaN");if(e===1/0)return Et("Infinity");if(e===-1/0)return Et("-Infinity");let t=e|0;for(t!==e&&(t^=e*4294967295);e>4294967295;)t^=e/=4294967295;return Sl(t)},Et=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return Sl(t)},w2=(e,t)=>{let n=12289;for(const o of t)n^=Qn(ft(o),ft(e[o]));return Sl(n)},Gp=e=>w2(e,Hh(e)),Yp=(e,t)=>n=>{let o=e;for(const i of n)o^=t(i);return Sl(o)},Ow=Yp(6151,ft),k2=Yp(Et("Map"),([e,t])=>Qn(ft(e),ft(t))),_2=Yp(Et("Set"),ft),hh=new WeakMap,ph=new WeakMap,mh=new WeakSet;function E2(e,t){if(mh.has(e))return Et("[Circular]");mh.add(e);const n=t();return mh.delete(e),n}const Yt="~effect/interfaces/Equal";function Sn(){return arguments.length===1?e=>Ys(e,arguments[0]):Ys(arguments[0],arguments[1])}function Ys(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"||Kh.has(e)||Kh.has(t)?!1:b2(e,t,P2)}function C2(e,t,n){const o=gh.has(e),i=yh.has(t);if(o&&i)return!0;if(o||i)return!1;gh.add(e),yh.add(t);const u=n();return gh.delete(e),yh.delete(t),u}const gh=new WeakSet,yh=new WeakSet;function P2(e,t){if(ft(e)!==ft(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=Jv(e),o=Jv(t);if(n!==o)return!1;const i=n&&o;return typeof e=="function"&&!i?!1:C2(e,t,()=>i?e[Yt](t):Array.isArray(e)?!Array.isArray(t)||e.length!==t.length?!1:I2(e,t):ArrayBuffer.isView(e)?!ArrayBuffer.isView(t)||e.byteLength!==t.byteLength?!1:R2(e,t):e instanceof Map?!(t instanceof Map)||e.size!==t.size?!1:M2(e,t):e instanceof Set?!(t instanceof Set)||e.size!==t.size?!1:N2(e,t):T2(e,t))}function b2(e,t,n){let o=Sc.get(e);if(!o)o=new WeakMap,Sc.set(e,o);else if(o.has(t))return o.get(t);const i=n(e,t);o.set(t,i);let u=Sc.get(t);return u||(u=new WeakMap,Sc.set(t,u)),u.set(e,i),i}const Sc=new WeakMap;function I2(e,t){for(let n=0;n<e.length;n++)if(!Ys(e[n],t[n]))return!1;return!0}function R2(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 T2(e,t){const n=Hh(e),o=Hh(t);if(n.size!==o.size)return!1;for(const i of n)if(!o.has(i)||!Ys(e[i],t[i]))return!1;return!0}function O2(e,t){return function(o,i){for(const[u,l]of o){let d=!1;for(const[m,g]of i)if(e(u,m)&&t(l,g)){d=!0;break}if(!d)return!1}return!0}}const M2=O2(Ys,Ys);function L2(e){return function(n,o){for(const i of n){let u=!1;for(const l of o)if(e(i,l)){u=!0;break}if(!u)return!1}return!0}}const N2=L2(Ys),Jv=e=>Ue(e,Yt),A2=()=>Sn,j2=e=>(t,n)=>t===n||e(t,n),$2=(e,t)=>e===t,F2=()=>$2;function D2(e){return j2((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 Mw=e=>e.length>0,xl=Symbol.for("~effect/Redactable"),U2=e=>Ue(e,xl);function wl(e){return U2(e)?Lw(e):e}function Lw(e){var t;return e[xl](((t=globalThis[fa])==null?void 0:t.context)??z2)}const fa="~effect/Fiber/currentFiber",z2={"~effect/Context":{},mapUnsafe:new Map,pipe(){return At(this,arguments)}};function pt(e,t){const n=(t==null?void 0:t.space)??0,o=new WeakSet,i=n?typeof n=="number"?" ".repeat(n):n:"",u=g=>i.repeat(g),l=(g,y)=>{const h=g==null?void 0:g.constructor;return h&&h!==Object.prototype.constructor&&h.name?`${h.name}(${y})`:y},d=g=>{try{return Reflect.ownKeys(g)}catch{return["[ownKeys threw]"]}};function m(g,y=0){if(Array.isArray(g)){if(o.has(g))return Gv;if(o.add(g),!i||g.length<=1)return`[${g.map(v=>m(v,y)).join(",")}]`;const h=g.map(v=>m(v,y+1)).join(`,
|
|
59
|
-
`+u(y+1));return`[
|
|
60
|
-
${u(y+1)}${h}
|
|
61
|
-
${u(y)}]`}if(g instanceof Date)return V2(g);if(!(t!=null&&t.ignoreToString)&&Ue(g,"toString")&&typeof g.toString=="function"&&g.toString!==Object.prototype.toString&&g.toString!==Array.prototype.toString){const h=q2(g);return g instanceof Error&&g.cause?`${h} (cause: ${m(g.cause,y)})`:h}if(typeof g=="string")return JSON.stringify(g);if(typeof g=="number"||g==null||typeof g=="boolean"||typeof g=="symbol")return String(g);if(typeof g=="bigint")return String(g)+"n";if(typeof g=="object"||typeof g=="function"){if(o.has(g))return Gv;if(o.add(g),xl in g)return pt(Lw(g));if(Symbol.iterator in g)return`${g.constructor.name}(${m(Array.from(g),y)})`;const h=d(g);if(!i||h.length<=1){const x=`{${h.map(w=>`${qc(w)}:${m(g[w],y)}`).join(",")}}`;return l(g,x)}const v=`{
|
|
62
|
-
${h.map(x=>`${u(y+1)}${qc(x)}: ${m(g[x],y+1)}`).join(`,
|
|
63
|
-
`)}
|
|
64
|
-
${u(y)}}`;return l(g,v)}return String(g)}return m(e,0)}const Gv="[Circular]";function qc(e){return typeof e=="string"?JSON.stringify(e):String(e)}function B2(e){return e.map(t=>`[${qc(t)}]`).join("")}function V2(e){try{return e.toISOString()}catch{return"Invalid Date"}}function q2(e){try{const t=e.toString();return typeof t=="string"?t:String(t)}catch{return"[toString threw]"}}function Nw(e,t){let n=[];const o=JSON.stringify(e,(i,u)=>typeof u=="object"&&u!==null?n.includes(u)?void 0:n.push(u)&&wl(u):u,t==null?void 0:t.space);return n=void 0,o}const Xs=Symbol.for("nodejs.util.inspect.custom"),Ua=e=>{try{if(Ue(e,"toJSON")&&vl(e.toJSON)&&e.toJSON.length===0)return e.toJSON();if(Array.isArray(e))return e.map(Ua)}catch{return"[toJSON threw]"}return wl(e)},W2=(e,t=2)=>{if(typeof e=="string")return e;try{return typeof e=="object"?H2(e,t):String(e)}catch{return String(e)}},H2=(e,t)=>{let n=[];const o=JSON.stringify(e,(i,u)=>typeof u=="object"&&u!==null?n.includes(u)?void 0:n.push(u)&&wl(u):u,t);return n=void 0,o},Yv={toJSON(){return Ua(this)},[Xs](){return this.toJSON()},toString(){return pt(this.toJSON())}};class kl{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 kl(this.self)}}const Go="~effect/Utils/internal",Aw={[Go]:e=>e()},K2={[Go]:e=>{try{return e()}finally{}}};var xx;const Q2=((xx=Aw[Go](()=>new Error().stack))==null?void 0:xx.includes(Go))===!0,Jt=Q2?Aw[Go]:K2[Go],ps="~effect/Effect",Ea="~effect/Exit",J2={_A:Ee,_E:Ee,_R:Ee},jw=`${ps}/identifier`,Re=`${ps}/args`,It=`${ps}/evaluate`,xn=`${ps}/successCont`,lr=`${ps}/failureCont`,Zs=`${ps}/ensureCont`,$s=Symbol.for("effect/Effect/Yield"),ms={pipe(){return At(this,arguments)},toJSON(){return{...this}},toString(){return pt(this.toJSON(),{ignoreToString:!0,space:2})},[Xs](){return this.toJSON()}},_l={[Symbol.iterator](){return new kl(this)}},G2={..._l,pipe(){return At(this,arguments)}},Y2={[ps]:J2,...ms,[Symbol.iterator](){return new kl(this)},asEffect(){return this},toJSON(){return{_id:"Effect",op:this[jw],...Re in this?{args:this[Re]}:void 0}}},Vt=e=>Ue(e,ps),$w=e=>Ue(e,Ea),Tc="~effect/Cause",Oc="~effect/Cause/Reason",El=e=>Ue(e,Tc),X2=e=>Ue(e,Oc);var wx;class ro{constructor(t){M(this,wx);M(this,"reasons");this[Tc]=Tc,this.reasons=t}pipe(){return At(this,arguments)}toJSON(){return{_id:"Cause",failures:this.reasons.map(t=>t.toJSON())}}toString(){return`Cause(${pt(this.reasons)})`}[(wx=Tc,Xs)](){return this.toJSON()}[Yt](t){return El(t)&&this.reasons.length===t.reasons.length&&this.reasons.every((n,o)=>Sn(n,t.reasons[o]))}[Gt](){return Ow(this.reasons)}}const Xv=new WeakMap;var kx;class Xp{constructor(t,n,o){M(this,kx);M(this,"annotations");M(this,"_tag");if(this[Oc]=Oc,this._tag=t,n!==Cl&&typeof o=="object"&&o!==null&&n.size>0){const i=Xv.get(o);i&&(n=new Map([...i,...n])),Xv.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((u,l)=>{(n==null?void 0:n.overwrite)!==!0&&o.has(l)||o.set(l,u)});const i=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return i.annotations=o,i}pipe(){return At(this,arguments)}toString(){return pt(this)}[(kx=Oc,Xs)](){return this.toString()}}const Cl=new Map;class Fw extends Xp{constructor(n,o=Cl){super("Fail",o,n);M(this,"error");this.error=n}toString(){return`Fail(${pt(this.error)})`}toJSON(){return{_tag:"Fail",error:this.error}}[Yt](n){return Zp(n)&&Sn(this.error,n.error)&&Sn(this.annotations,n.annotations)}[Gt](){return Qn(Et(this._tag))(Qn(ft(this.error))(ft(this.annotations)))}}const Ca=e=>new ro(e),Z2=new ro([]),Dw=e=>new ro([new Fw(e)]);class Uw extends Xp{constructor(n,o=Cl){super("Die",o,n);M(this,"defect");this.defect=n}toString(){return`Die(${pt(this.defect)})`}toJSON(){return{_tag:"Die",defect:this.defect}}[Yt](n){return tR(n)&&Sn(this.defect,n.defect)&&Sn(this.annotations,n.annotations)}[Gt](){return Qn(Et(this._tag))(Qn(ft(this.defect))(ft(this.annotations)))}}const eR=e=>new ro([new Uw(e)]),Jh=ne(e=>El(e[0]),(e,t,n)=>t.mapUnsafe.size===0?e:new ro(e.reasons.map(o=>o.annotate(t,n)))),Zp=e=>e._tag==="Fail",tR=e=>e._tag==="Die",em=e=>e._tag==="Interrupt";function nR(e){return Yo("Effect.evaluate: Not implemented")}const za=e=>({...Y2,[jw]:e.op,[It]:e[It]??nR,[xn]:e[xn],[lr]:e[lr],[Zs]:e[Zs]}),Zn=e=>{const t=za(e);return function(){const n=Object.create(t);return n[Re]=e.single===!1?arguments:arguments[0],n}},zw=e=>{const t={...za(e),[Ea]:Ea,_tag:e.op,get[e.prop](){return this[Re]},toString(){return`${e.op}(${pt(this[Re])})`},toJSON(){return{_id:"Exit",_tag:e.op,[e.prop]:this[Re]}},[Yt](n){return $w(n)&&n._tag===this._tag&&Sn(this[Re],n[Re])},[Gt](){return Qn(Et(e.op),ft(this[Re]))}};return function(n){const o=Object.create(t);return o[Re]=n,o}},ot=zw({op:"Success",prop:"value",[It](e){const t=e.getCont(xn);return t?t[xn](this[Re],e,this):e.yieldWith(this)}}),Pl={key:"effect/Cause/StackTrace"},rR={key:"effect/Cause/InterruptorStackTrace"},An=zw({op:"Failure",prop:"cause",[It](e){let t=this[Re],n=!1;e.currentStackFrame&&(t=Jh(t,{mapUnsafe:new Map([[Pl.key,e.currentStackFrame]])}),n=!0);let o=e.getCont(lr);for(;e.interruptible&&e._interruptedCause&&o;)o=e.getCont(lr);return o?o[lr](t,e,n?void 0:this):e.yieldWith(n?this:An(t))}}),pr=e=>An(Dw(e)),Yo=e=>An(eR(e)),Be=Zn({op:"WithFiber",[It](e){return this[Re](e)}}),sR=(function(){class e extends globalThis.Error{asEffect(){return pr(this)}}return Object.assign(e.prototype,G2),e})(),Bw=(function(){const e=Symbol.for("effect/Data/Error/plainArgs");return class extends sR{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}}}})(),tm=e=>{class t extends Bw{constructor(){super(...arguments);M(this,"_tag",e)}}return t.prototype.name=e,t},Zv="~effect/Cause/NoSuchElementError";var _x,Ex;class oR extends(Ex=tm("NoSuchElementError"),_x=Zv,Ex){constructor(n){super({message:n});M(this,_x,Zv)}}const Pa="~effect/Cause/Done",iR=e=>Ue(e,Pa),Vw={[Pa]:Pa,_tag:"Done",value:void 0},nm=e=>e===void 0?Vw:{[Pa]:Pa,_tag:"Done",value:e},aR=pr(Vw),uR=e=>e===void 0?aR:pr(nm(e)),qw="~effect/data/Option",Ww={[qw]:{_A:e=>e},...ms,..._l},Hw=Object.assign(Object.create(Ww),{_tag:"Some",_op:"Some",[Yt](e){return Kw(e)&&Jw(e)&&Sn(this.value,e.value)},[Gt](){return Qn(ft(this._tag))(ft(this.value))},toString(){return`some(${pt(this.value)})`},toJSON(){return{_id:"Option",_tag:this._tag,value:Ua(this.value)}},asEffect(){return ot(this.value)}});Object.defineProperty(Hw,"valueOrUndefined",{get(){return this.value}});const cR=ft("None"),lR=Object.assign(Object.create(Ww),{_tag:"None",_op:"None",valueOrUndefined:void 0,[Yt](e){return Kw(e)&&Qw(e)},[Gt](){return cR},toString(){return"none()"},toJSON(){return{_id:"Option",_tag:this._tag}},asEffect(){return pr(new oR)}}),Kw=e=>Ue(e,qw),Qw=e=>e._tag==="None",Jw=e=>e._tag==="Some",fR=Object.create(lR),dR=e=>{const t=Object.create(Hw);return t.value=e,t},Gw="~effect/data/Result",Yw={[Gw]:{_A:e=>e,_E:e=>e},...ms,..._l},hR=Object.assign(Object.create(Yw),{_tag:"Success",_op:"Success",[Yt](e){return Xw(e)&&e1(e)&&Sn(this.success,e.success)},[Gt](){return Qn(ft(this._tag))(ft(this.success))},toString(){return`success(${pt(this.success)})`},toJSON(){return{_id:"Result",_tag:this._tag,value:Ua(this.success)}},asEffect(){return ot(this.success)}}),pR=Object.assign(Object.create(Yw),{_tag:"Failure",_op:"Failure",[Yt](e){return Xw(e)&&Zw(e)&&Sn(this.failure,e.failure)},[Gt](){return Qn(ft(this._tag))(ft(this.failure))},toString(){return`failure(${pt(this.failure)})`},toJSON(){return{_id:"Result",_tag:this._tag,failure:Ua(this.failure)}},asEffect(){return pr(this.failure)}}),Xw=e=>Ue(e,Gw),Zw=e=>e._tag==="Failure",e1=e=>e._tag==="Success",mR=e=>{const t=Object.create(pR);return t.failure=e,t},gR=e=>{const t=Object.create(hR);return t.success=e,t};function rm(e){return(t,n)=>t===n?0:e(t,n)}const t1=rm((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),yR=ne(2,(e,t)=>rm((n,o)=>e(t(n),t(o)))),vR=e=>ne(2,(t,n)=>e(t,n)===1),SR=e=>ne(2,(t,n)=>e(t,n)!==-1),xR=e=>ne(2,(t,n)=>t===n||e(t,n)<1?t:n),wR=e=>ne(2,(t,n)=>t===n||e(t,n)>-1?t:n),jn=()=>fR,Me=dR,so=Qw,fs=Jw,kR=ne(2,(e,t)=>so(e)?t():e.value),n1=kR(yl),sm=ne(2,(e,t)=>so(e)?jn():Me(t(e.value))),_R=ne(2,(e,t)=>so(e)?jn():t(e.value)?Me(e.value):jn()),Lr=gR,Jn=mR,Rt=Zw,ER=e1,CR={[Symbol.iterator](){return PR}},PR={next(){return{done:!0,value:void 0}}},bR=()=>CR,IR=ne(2,(e,t)=>Object.hasOwn(e,t)),RR=e=>Object.keys(e),TR=e=>ne(2,(t,n)=>{for(const o of RR(t))if(!IR(n,o)||!e(t[o],n[o]))return!1;return!0}),OR=e=>{const t=TR(e);return(n,o)=>t(n,o)&&t(o,n)},eS=globalThis.Array,dr=e=>eS.isArray(e)?e:eS.from(e),r1=ne(2,(e,t)=>[...e,t]),MR=ne(2,(e,t)=>dr(e).concat(dr(t))),tS=Mw,Wc=Mw;function LR(e,t){return e<0||e>=t.length}const NR=ne(2,(e,t)=>{const n=Math.floor(t);if(LR(n,e))throw new Error(`Index out of bounds: ${n}`);return e[n]}),AR=NR(0),jR=e=>e.slice(1),$R=ne(3,(e,t,n)=>{const o=dr(e),i=dr(t);return Wc(o)?Wc(i)?UR(n)(MR(o,i)):o:i}),FR=ne(2,(e,t)=>$R(e,t,A2())),DR=()=>[],s1=ne(2,(e,t)=>e.map(t)),UR=ne(2,(e,t)=>{const n=dr(e);if(Wc(n)){const o=[AR(n)],i=jR(n);for(const u of i)o.every(l=>!t(u,l))&&o.push(u);return o}return[]}),nS="~effect/Context/Service",Fn=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,zR),Object.defineProperty(o,"stack",{get(){return t.stack}}),arguments.length>0?(o.key=arguments[0],(i=arguments[1])!=null&&i.defaultValue&&(o[Hc]=Hc,o.defaultValue=arguments[1].defaultValue),o):function(u,l){return o.key=u,l!=null&&l.make&&(o.make=l.make),o}},zR={[nS]:nS,...ms,..._l,toJSON(){return{_id:"Service",key:this.key,stack:this.stack}},asEffect(){return(this.asEffect=ds(Be(t=>ot(Ws(t.context,this)))))()},of(e){return e},context(e){return Xo(this,e)},use(e){return Be(t=>e(Ws(t.context,this)))},useSync(e){return Be(t=>ot(e(Ws(t.context,this))))}},Hc="~effect/Context/Reference",o1="~effect/Context",as=e=>{const t=Object.create(BR);return t.mapUnsafe=e,t.mutable=!1,t},BR={...ms,[o1]:{_Services:e=>e},toJSON(){return{_id:"Context",services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[Yt](e){if(!i1(e)||this.mapUnsafe.size!==e.mapUnsafe.size)return!1;for(const t of this.mapUnsafe.keys())if(!e.mapUnsafe.has(t)||!Sn(this.mapUnsafe.get(t),e.mapUnsafe.get(t)))return!1;return!0},[Gt](){return Jp(this.mapUnsafe.size)}},i1=e=>Ue(e,o1),a1=e=>Ue(e,Hc),Gn=()=>VR,VR=as(new Map),Xo=(e,t)=>as(new Map([[e.key,t]])),gs=ne(3,(e,t,n)=>u1(e,o=>{o.set(t.key,n)})),qR=ne(3,(e,t,n)=>e.mapUnsafe.has(t.key)?e.mapUnsafe.get(t.key):a1(t)?Il(t):n()),bl=ne(2,(e,t)=>{if(!e.mapUnsafe.has(t.key)){if(Hc in t)return Il(t);throw HR(t)}return e.mapUnsafe.get(t.key)}),Ws=bl,WR=(e,t)=>e.mapUnsafe.has(t.key)?e.mapUnsafe.get(t.key):Il(t),vh="~effect/Context/defaultValue",Il=e=>vh in e?e[vh]:e[vh]=e.defaultValue(),HR=e=>{const t=new Error(`Service not found${e.key?`: ${String(e.key)}`:""}`);if(e.stack){const n=e.stack.split(`
|
|
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
|
-
`);n.splice(1,3),t.stack=n.join(`
|
|
67
|
-
`)}return t},KR=ne(2,(e,t)=>e.mapUnsafe.has(t.key)?Me(e.mapUnsafe.get(t.key)):a1(t)?Me(Il(t)):jn()),Zo=ne(2,(e,t)=>e.mapUnsafe.size===0?t:t.mapUnsafe.size===0?e:u1(e,n=>{t.mapUnsafe.forEach((o,i)=>n.set(i,o))})),QR=(...e)=>{const t=new Map;for(let n=0;n<e.length;n++)e[n].mapUnsafe.forEach((o,i)=>{t.set(i,o)});return as(t)},u1=(e,t)=>{if(e.mutable)return t(e.mapUnsafe),e;const n=new Map(e.mapUnsafe);return t(n),as(n)},Xe=Fn,Kc="~effect/time/Duration",JR=BigInt(0),c1=BigInt(1e3),GR=BigInt(1e6),YR=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,om=e=>{switch(typeof e){case"number":return ba(e);case"bigint":return oS(e);case"string":{const t=YR.exec(e);if(!t)break;const[n,o,i]=t,u=Number(o);switch(i){case"nano":case"nanos":return oS(BigInt(o));case"micro":case"micros":return sT(BigInt(o));case"milli":case"millis":return ba(u);case"second":case"seconds":return oT(u);case"minute":case"minutes":return iT(u);case"hour":case"hours":return aT(u);case"day":case"days":return uT(u);case"week":case"weeks":return cT(u)}break}case"object":{if(e===null)break;if(Kc in e)return e;if(Array.isArray(e))return e.length!==2||!e.every(Rw)?rS(e):Number.isNaN(e[0])||Number.isNaN(e[1])?im:e[0]===-1/0||e[1]===-1/0?rT:e[0]===1/0||e[1]===1/0?nT:an(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 an(n);let o=BigInt(n)*GR;return t.microseconds&&(o+=BigInt(t.microseconds)*c1),t.nanoseconds&&(o+=BigInt(t.nanoseconds)),an(o)}}return rS(e)},rS=e=>{throw new Error(`Invalid Input: ${e}`)},sS={_tag:"Millis",millis:0},XR={_tag:"Infinity"},ZR={_tag:"NegativeInfinity"},eT={[Kc]:Kc,[Gt](){return Gp(this.value)},[Yt](e){return tT(e)&&pT(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"}}},[Xs](){return this.toJSON()},pipe(){return At(this,arguments)}},an=e=>{const t=Object.create(eT);return typeof e=="number"?isNaN(e)||e===0||Object.is(e,-0)?t.value=sS: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?XR:ZR:e===JR?t.value=sS:t.value={_tag:"Nanos",nanos:e},t},tT=e=>Ue(e,Kc),im=an(0),nT=an(1/0),rT=an(-1/0),oS=e=>an(e),sT=e=>an(e*c1),ba=e=>an(e),oT=e=>an(e*1e3),iT=e=>an(e*6e4),aT=e=>an(e*36e5),uT=e=>an(e*864e5),cT=e=>an(e*6048e5),l1=e=>lT(e,{onMillis:Ee,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))}},lT=ne(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)()}}),f1=ne(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))),d1=rm((e,t)=>f1(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})),fT=(e,t)=>f1(e,t,{onMillis:(n,o)=>n===o,onNanos:(n,o)=>n===o,onInfinity:(n,o)=>n.value._tag===o.value._tag}),dT=xR(d1),hT=wR(d1),pT=ne(2,(e,t)=>fT(e,t)),mT=e=>t=>!Rt(e(t)),gT=e=>t=>t.has(e)?Lr(t):Jn(t),yT=ne(2,(e,t)=>n=>{const o=e(n);return Rt(o)?o:t(o.success)}),h1=ne(2,(e,t)=>n=>{const o=e(n);if(Rt(o))return Jn(n);const i=t(o.success);return Rt(i)?Jn(n):i}),p1=Xe("effect/Scheduler",{defaultValue:()=>new g1}),m1="setImmediate"in globalThis?e=>{const t=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(t)}:e=>{const t=setTimeout(e,0);return()=>clearTimeout(t)};class vT{constructor(){M(this,"buckets",[])}scheduleTask(t,n){const o=this.buckets,i=o.length;let u,l=0;for(;l<i&&!(o[l][0]>n);l++)u=o[l];u&&u[0]===n?u[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 g1{constructor(t="async",n=m1){M(this,"executionMode");M(this,"setImmediate");this.executionMode=t,this.setImmediate=n}shouldYield(t){return t.currentOpCount>=t.maxOpsBeforeYield}makeDispatcher(){return new ST(this.setImmediate)}}class ST{constructor(t=m1){M(this,"tasks",new vT);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 xT=Xe("effect/Scheduler/MaxOpsBeforeYield",{defaultValue:()=>2048}),wT=Xe("effect/Scheduler/PreventSchedulerYield",{defaultValue:()=>!1}),y1="effect/Tracer/ParentSpan";class kT extends Fn()(y1){}const _T=e=>e,Gh=Xe("effect/Tracer/DisablePropagation",{defaultValue:bw}),ET=Xe("effect/Tracer/CurrentTraceLevel",{defaultValue:()=>"Info"}),CT=Xe("effect/Tracer/MinimumTraceLevel",{defaultValue:()=>"All"}),v1="effect/Tracer",PT=Xe(v1,{defaultValue:()=>_T({span:e=>new bT(e)})});class bT{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=n1(t.parent))==null?void 0:n.traceId)??aS(32),this.spanId=aS(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 aS=(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}})(),IT="effect/observability/Metric/FiberRuntimeMetricsKey",RT=Xe("effect/References/CurrentConcurrency",{defaultValue:()=>"unbounded"}),S1=Xe("effect/References/CurrentStackFrame",{defaultValue:yl}),TT=Xe("effect/References/TracerEnabled",{defaultValue:Kp}),x1=Xe("effect/References/TracerTimingEnabled",{defaultValue:Kp}),OT=Xe("effect/References/TracerSpanAnnotations",{defaultValue:()=>({})}),MT=Xe("effect/References/TracerSpanLinks",{defaultValue:()=>[]}),am=Xe("effect/References/CurrentLogAnnotations",{defaultValue:()=>({})}),LT=Xe("effect/References/CurrentLogLevel",{defaultValue:()=>"Info"}),NT=Xe("effect/References/MinimumLogLevel",{defaultValue:()=>"Info"}),AT=Xe("effect/References/CurrentLogSpans",{defaultValue:()=>[]}),jT=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:FT(()=>n.stack)}},$T=e=>t=>{let n;return()=>{if(n!==void 0)return n;const o=t();if(!o)return;const i=o.split(`
|
|
68
|
-
`);if(i[e]!==void 0)return n=i[e].trim(),n}},FT=$T(3),DT="dev";class w1 extends Xp{constructor(n,o=Cl){super("Interrupt",o,"Interrupted");M(this,"fiberId");this.fiberId=n}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:"Interrupt",fiberId:this.fiberId}}[Yt](n){return em(n)&&this.fiberId===n.fiberId&&this.annotations===n.annotations}[Gt](){return Qn(Et(`${this._tag}:${this.fiberId}`))(Qh(this.annotations))}}const UT=e=>new w1(e),um=e=>new ro([new w1(e)]),zT=e=>{const t=e.reasons.find(Zp);return t?Lr(t):Jn(e)},oo=e=>{for(let t=0;t<e.reasons.length;t++){const n=e.reasons[t];if(n._tag==="Fail")return Lr(n.error)}return Jn(e)},BT=e=>e.reasons.some(em),cm=e=>{let t;for(let n=0;n<e.reasons.length;n++){const o=e.reasons[n];o._tag==="Interrupt"&&(t??(t=new Set),o.fiberId!==void 0&&t.add(o.fiberId))}return t?Lr(t):Jn(e)},VT=e=>{const t=cm(e);return Rt(t)?qT:t.success},qT=new Set,WT=e=>e.reasons.length>0&&e.reasons.every(em),HT=ne(2,(e,t)=>{if(e.reasons.length===0)return t;if(t.reasons.length===0)return e;const n=new ro(FR(e.reasons,t.reasons));return Sn(e,n)?e:n}),KT=e=>{const t={Fail:[],Die:[],Interrupt:[]};for(let n=0;n<e.reasons.length;n++)t[e.reasons[n]._tag].push(e.reasons[n]);return t},lm=e=>{const t=KT(e);return t.Fail.length>0?t.Fail[0].error:t.Die.length>0?t.Die[0].defect:t.Interrupt.length>0?new globalThis.Error("All fibers interrupted without error"):new globalThis.Error("Empty cause")},QT=e=>{const t=[],n=[];if(e.reasons.length===0)return t;const o=Error.stackTraceLimit;Error.stackTraceLimit=1;for(const i of e.reasons){if(i._tag==="Interrupt"){n.push(i);continue}t.push(Yh(i._tag==="Die"?i.defect:i.error,i.annotations))}if(t.length===0){const i=new Error("The fiber was interrupted by:");i.name="InterruptCause",i.stack=XT(i,n);const u=new globalThis.Error("All fibers interrupted without error",{cause:i});u.name="InterruptError",u.stack=`${u.name}: ${u.message}`,t.push(Yh(u,n[0].annotations))}return Error.stackTraceLimit=o,t},Yh=(e,t)=>{const n=typeof e;let o;if(e&&n==="object"){if(o=new globalThis.Error(JT(e),{cause:e.cause?Yh(e.cause):void 0}),typeof e.name=="string"&&(o.name=e.name),typeof e.stack=="string")o.stack=YT(e.stack,o,t);else{const i=`${o.name}: ${o.message}`;o.stack=t?k1(i,t):i}for(const i of Object.keys(e))i in o||(o[i]=e[i])}else o=new globalThis.Error(e?n==="string"?e:Nw(e):`Unknown error: ${e}`);return o},JT=e=>{if(typeof e.message=="string")return e.message;if(typeof e.toString=="function"&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString)try{return e.toString()}catch{}return Nw(e)},GT=/\((.*)\)/g,YT=(e,t,n)=>{const o=`${t.name}: ${t.message}`,i=(e.startsWith(o)?e.slice(o.length):e).split(`
|
|
69
|
-
`),u=[o];for(let l=1;l<i.length&&!/(?:Generator\.next|~effect\/Effect)/.test(i[l]);l++)u.push(i[l]);return n?k1(u.join(`
|
|
70
|
-
`),n):u.join(`
|
|
71
|
-
`)},k1=(e,t)=>{const n=t==null?void 0:t.get(Pl.key);return n&&(e=`${e}
|
|
72
|
-
${_1(n)}`),e},XT=(e,t)=>{const n=[`${e.name}: ${e.message}`];for(const o of t){const i=o.fiberId!==void 0?`#${o.fiberId}`:"unknown",u=o.annotations.get(rR.key);n.push(` at fiber (${i})`),u&&n.push(_1(u))}return n.join(`
|
|
73
|
-
`)},_1=e=>{const t=[];let n=e,o=0;for(;n&&o<10;){const i=n.stack();if(i){const u=i.matchAll(GT);let l=!1;for(const[,d]of u)l=!0,t.push(` at ${n.name} (${d})`);l||t.push(` at ${n.name} (${i.replace(/^at /,"")})`)}else t.push(` at ${n.name}`);n=n.parent,o++}return t.join(`
|
|
74
|
-
`)},E1=e=>QT(e).map(t=>t.cause?`${t.stack} {
|
|
75
|
-
${C1(t.cause," ")}
|
|
76
|
-
}`:t.stack).join(`
|
|
77
|
-
`),C1=(e,t)=>{const n=e.stack.split(`
|
|
78
|
-
`);let o=`${t}[cause]: ${n[0]}`;for(let i=1,u=n.length;i<u;i++)o+=`
|
|
79
|
-
${t}${n[i]}`;return e.cause&&(o+=` {
|
|
80
|
-
${C1(e.cause,`${t} `)}
|
|
81
|
-
${t}}`),o},Xh=`~effect/Fiber/${DT}`,ZT={_A:Ee,_E:Ee},eO={id:0},fm=()=>globalThis[fa];var Cx;Cx=Xh;class P1{constructor(t,n=!0){M(this,Cx);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[Xh]=ZT,this.setContext(t),this.id=++eO.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 WR(this.context,t)}addObserver(t){return this._exit?(t(this._exit),Da):(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=um(t);this.currentStackFrame&&(o=Jh(o,Xo(Pl,this.currentStackFrame))),n&&(o=Jh(o,n)),this._interruptedCause=this._interruptedCause?HT(this._interruptedCause,o):o,this.interruptible&&this.evaluate(Nt(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 u=this._yielded;this._yielded=void 0,u()}const n=this.runLoop(t);if(n!==$s){this._exit=n,(i=this.runtimeMetrics)==null||i.recordFiberEnd(this.context,this._exit);for(let u=0;u<this._observers.length;u++)this._observers[u](n);this._observers.length=0}}runLoop(t){const n=globalThis[fa];globalThis[fa]=this;let o=!1,i=t;this.currentOpCount=0;const u=++this.currentLoopCount;try{for(;;){if(this.currentOpCount++,!o&&!this.currentPreventYield&&this.currentScheduler.shouldYield(this)){o=!0;const l=i;i=je(hm,()=>l)}if(i=this.currentTracerContext?this.currentTracerContext(i,this):i[It](this),u!==this.currentLoopCount)return $s;if(i===$s){const l=this._yielded;return Ea in l?(this._yielded=void 0,l):$s}}}catch(l){return Ue(i,It)?this.runLoop(Yo(l)):Yo(`Fiber.runLoop: Not a valid effect: ${String(i)}`)}finally{globalThis[fa]=n}}getCont(t){for(;;){const n=this._stack.pop();if(!n)return;const o=n[Zs]&&n[Zs](this);if(o)return o[t]=o,o;if(n[t])return n}}yieldWith(t){return this._yielded=t,$s}children(){return this._children??(this._children=new Set)}pipe(){return At(this,arguments)}setContext(t){this.context=t;const n=this.getRef(p1);n!==this.currentScheduler&&(this.currentScheduler=n,this._dispatcher=void 0),this.currentSpan=t.mapUnsafe.get(y1),this.currentLogLevel=this.getRef(LT),this.minimumLogLevel=this.getRef(NT),this.currentStackFrame=t.mapUnsafe.get(S1.key),this.maxOpsBeforeYield=this.getRef(xT),this.currentPreventYield=this.getRef(wT),this.runtimeMetrics=t.mapUnsafe.get(IT);const o=t.mapUnsafe.get(v1);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 Rl=e=>{if(!e.currentStackFrame)return;const t=new Map;return t.set(Pl.key,e.currentStackFrame),as(t)},b1=e=>{const t=e;return t._exit?Ce(t._exit):er(n=>t._exit?n(Ce(t._exit)):yt(e.addObserver(o=>n(Ce(o)))))},I1=e=>er(t=>{const n=e[Symbol.iterator](),o=[];let i;function u(){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),u()});return}t(Ce(o))}return u(),yt(()=>i==null?void 0:i())}),dm=e=>Be(t=>tO(e,t.id)),tO=ne(e=>Ue(e[0],Xh),(e,t,n)=>Be(o=>{let i=Rl(o);return i=i&&n?Zo(i,n):i??n,e.interruptUnsafe(t,i),N1(b1(e))})),Qc=e=>Be(t=>{const n=Rl(t);for(const o of e)o.interruptUnsafe(t.id,n);return N1(I1(e))}),Ce=ot,Nt=An,Tl=pr,yt=Zn({op:"Sync",[It](e){const t=this[Re](),n=e.getCont(xn);return n?n[xn](t,e):e.yieldWith(ot(t))}}),St=Zn({op:"Suspend",[It](e){return this[Re]()}}),nO=Zn({op:"Yield",[It](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{t||e.evaluate($n)},this[Re]??0),e.yieldWith(()=>{t=!0})}}),hm=nO(0),rO=e=>Ce(Me(e)),sO=Ce(jn()),Ol=e=>Yo(e),R1=e=>St(()=>Tl(Jt(e))),st=Ce(void 0),oO=e=>T1(function(t,n){Jt(()=>e(n)).then(o=>t(Ce(o)),o=>t(Ol(o)))},e.length!==0),iO=e=>Be(t=>e(t.id)),T1=Zn({op:"Async",single:!1,[It](e){const t=Jt(()=>this[Re][0].bind(e.currentScheduler));let n=!1,o=!1;const i=this[Re][1]?new AbortController:void 0,u=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&&u===void 0||e._stack.push(aO(()=>(n=!0,i==null||i.abort(),u??$n))),$s)}}),aO=Zn({op:"AsyncFinalizer",[Zs](e){e.interruptible&&(e.interruptible=!1,e._stack.push($l))},[lr](e,t){return BT(e)?je(this[Re](),()=>Nt(e)):Nt(e)}}),er=e=>T1(e,e.length>=2),uO=er(Da),cO=(...e)=>St(()=>Ia(e.length===1?e[0]():e[1].call(e[0].self))),O1=(e,...t)=>{const n=t.length===0?function(){return St(()=>Ia(e.apply(this,arguments)))}:function(){let o=St(()=>Ia(e.apply(this,arguments)));for(let i=0;i<t.length;i++)o=t[i](o,...arguments);return o};return M1(e.length,n)},M1=(e,t)=>Object.defineProperty(t,"length",{value:e,configurable:!0}),lO=(e,...t)=>M1(e.length,t.length===0?function(){return uS(()=>e.apply(this,arguments))}:function(){let n=uS(()=>e.apply(this,arguments));for(const o of t)n=o(n);return n}),uS=e=>{try{const t=e();let n;for(;;){const o=t.next(n);if(o.done)return Ce(o.value);const u=o.value.asEffect(),l=u;if(l&&l._tag==="Success"){n=l.value;continue}else{if(l&&l._tag==="Failure")return u;{let d=!0;return St(()=>d?(d=!1,je(u,m=>Ia(t,m))):St(()=>Ia(e())))}}}}catch(t){return Ol(t)}},Ia=Zn({op:"Iterator",single:!1,[xn](e,t){const n=this[Re][0];for(;;){const o=n.next(e);if(o.done)return Ce(o.value);const i=o.value.asEffect();if(wn(i)){if(i._tag==="Failure")return i}else return t._stack.push(this),i;e=i.value}},[It](e){return this[xn](this[Re][1],e)}}),ai=ne(2,(e,t)=>{const n=Ce(t);return je(e,o=>n)}),Ba=ne(2,(e,t)=>je(e,n=>Vt(t)?t:Jt(()=>t(n)))),L1=ne(2,(e,t)=>je(e,n=>ai(Vt(t)?t:Jt(()=>t(n)),n))),N1=e=>je(e,t=>$n),fO=(e,t)=>Be(n=>er(o=>{let i=!1;const u=new Set,l=m=>{i=!0,o(u.size===0?m:je(H1(Qc(u)),()=>m))};let d=0;for(const m of e){if(i)break;const g=d++,y=Dl(n,m,!0,!0,!1);u.add(y),y.addObserver(h=>{u.delete(y);const v=!i;l(h),v&&(t!=null&&t.onWinner)&&t.onWinner({fiber:y,index:g,parentFiber:n})})}return Qc(u)})),A1=ne(e=>Vt(e[1]),(e,t,n)=>fO([e,t],n)),je=ne(2,(e,t)=>{const n=Object.create(dO);return n[Re]=e,n[xn]=t.length!==1?o=>t(o):t,n}),dO=za({op:"OnSuccess",[It](e){return e._stack.push(this),this[Re]}}),wn=e=>Ea in e,hO=ne(2,(e,t)=>wn(e)?e._tag==="Success"?t(e.value):e:je(e,t)),pO=e=>je(e,Ee),vt=ne(2,(e,t)=>je(e,n=>Ce(Jt(()=>t(n))))),mO=ne(2,(e,t)=>wn(e)?kO(e,t):vt(e,t)),gO=ne(2,(e,t)=>wn(e)?_O(e,t):jO(e,t)),yO=ne(2,(e,t)=>wn(e)?EO(e,t):$O(e,t)),vO=ne(2,(e,t)=>{if(wn(e)){if(e._tag==="Success")return e;const n=oo(e.cause);return Rt(n)?e:t(n.success)}return Ll(e,t)}),SO=e=>An(um(e)),pm=e=>e._tag==="Success",xO=e=>e._tag==="Failure",wO=e=>e._tag==="Failure"?Lr(e.cause):Jn(e),$n=ot(void 0),kO=ne(2,(e,t)=>e._tag==="Success"?ot(t(e.value)):e),_O=ne(2,(e,t)=>{if(e._tag==="Success")return e;const n=oo(e.cause);return Rt(n)?e:pr(t(n.success))}),EO=ne(2,(e,t)=>{if(e._tag==="Success")return ot(t.onSuccess(e.value));const n=oo(e.cause);return Rt(n)?e:pr(t.onFailure(n.success))}),CO=ne(2,(e,t)=>pm(e)?t:e),PO=e=>{const t=[];for(const n of e)n._tag==="Failure"&&t.push(...n.cause.reasons);return t.length===0?$n:An(Ca(t))},bO=e=>pm(e)?Me(e.value):jn(),IO=e=>Be(t=>Ce(KR(t.context,e))),Ml=ne(2,(e,t)=>Be(n=>{const o=n.context,i=t(o);return o===i?e:(n.setContext(i),W1(e,()=>{n.setContext(o)}))})),j1=ne(3,(e,t,n)=>Ml(e,o=>{const i=bl(o,t),u=n(i);return i===u?o:gs(o,t,u)})),RO=()=>TO,TO=Be(e=>Ce(e.context)),$1=e=>Be(t=>e(t.context)),Va=ne(2,(e,t)=>wn(e)?e:Ml(e,Zo(t))),qa=function(){return arguments.length===1?ne(2,(e,t)=>cS(e,arguments[0],t)):ne(3,(e,t,n)=>cS(e,t,n)).apply(this,arguments)},cS=(e,t,n)=>Ml(e,o=>o.mapUnsafe.get(t.key)===n?o:gs(o,t,n)),F1=ne(e=>Vt(e[1]),(e,t,n)=>OO(e,t,(o,i)=>[o,i],n)),OO=ne(e=>Vt(e[1]),(e,t,n,o)=>o!=null&&o.concurrent?vt(oM([e,t],{concurrency:2}),([i,u])=>Jt(()=>n(i,u))):je(e,i=>vt(t,u=>Jt(()=>n(i,u))))),MO=ne(e=>Vt(e[0]),(e,t)=>vm({while:Kp,body:ds(t!=null&&t.disableYield?e:je(e,n=>hm)),step:Da})),Wa=ne(2,(e,t)=>{const n=Object.create(LO);return n[Re]=e,n[lr]=t.length!==1?o=>t(o):t,n}),LO=za({op:"OnFailure",[It](e){return e._stack.push(this),this[Re]}}),D1=ne(3,(e,t,n)=>Wa(e,o=>{const i=t(o);return Rt(i)?Nt(i.failure):Jt(()=>n(i.success,o))})),Ll=ne(2,(e,t)=>D1(e,oo,n=>t(n))),NO=ne(2,(e,t)=>Wa(e,n=>Ba(Jt(()=>t(n)),Nt(n)))),AO=ne(e=>Vt(e[0]),(e,t,n,o)=>Wa(e,i=>{const u=oo(i);if(Rt(u))return Nt(u.failure);const l=t(u.success);return Rt(l)?o?Jt(()=>o(l.failure)):Nt(i):Jt(()=>n(l.success))})),jO=ne(2,(e,t)=>Ll(e,n=>R1(()=>t(n)))),$O=ne(2,(e,t)=>mm(e,{onFailure:n=>R1(()=>t.onFailure(n)),onSuccess:n=>yt(()=>t.onSuccess(n))})),FO=e=>Ll(e,Ol),DO=ne(e=>Vt(e[0]),(e,t)=>{if(!(t!=null&&t.log))return mm(e,{onFailure:o=>st,onSuccess:o=>st});const n=ik(t.log===!0?void 0:t.log);return Nl(e,{onFailure(o){const i=zT(o);return Rt(i)?Nt(i.failure):t.message===void 0?n(o):n(t.message,o)},onSuccess:o=>st})}),Sh=e=>BO(e,{onFailure:Jn,onSuccess:Lr}),Nl=ne(2,(e,t)=>{const n=Object.create(UO);return n[Re]=e,n[xn]=t.onSuccess.length!==1?o=>t.onSuccess(o):t.onSuccess,n[lr]=t.onFailure.length!==1?o=>t.onFailure(o):t.onFailure,n}),UO=za({op:"OnSuccessAndFailure",[It](e){return e._stack.push(this),this[Re]}}),mm=ne(2,(e,t)=>Nl(e,{onFailure:n=>{const o=n.reasons.find(Zp);return o?Jt(()=>t.onFailure(o.error)):Nt(n)},onSuccess:t.onSuccess})),zO=ne(2,(e,t)=>mm(e,{onFailure:n=>yt(()=>t.onFailure(n)),onSuccess:n=>yt(()=>t.onSuccess(n))})),BO=ne(2,(e,t)=>{if(wn(e)){if(e._tag==="Success")return ot(t.onSuccess(e.value));const n=oo(e.cause);return Rt(n)?e:ot(t.onFailure(n.success))}return zO(e,t)}),Al=e=>wn(e)?ot(e):VO(e),VO=Zn({op:"Exit",[It](e){return e._stack.push(this),this[Re]},[xn](e,t,n){return Ce(n??ot(e))},[lr](e,t,n){return Ce(n??An(e))}}),qO=ne(2,(e,t)=>Ba(wm(t),e)),U1=ne(2,(e,t)=>A1(e,je(wm(t.duration),t.orElse))),WO=ne(2,(e,t)=>U1(e,{duration:t,orElse:()=>Tl(new IM)})),lS="~effect/Scope",fS="~effect/Scope/Closeable",jl=Fn("effect/Scope"),z1=(e,t)=>St(()=>B1(e,t)??st),B1=(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):HO(e,o,t)},HO=O1(function*(e,t,n){let o=[];const i=[],u=Array.from(t.values()),l=fm();for(let d=u.length-1;d>=0;d--){const m=u[d];e.strategy==="sequential"?o.push(yield*Al(m(n))):i.push(Dl(l,m(n),!0,!0,"inherit"))}return i.length>0&&(o=yield*I1(i)),yield*PO(o)}),KO=(e,t)=>{const n=ym(t);if(e.state._tag==="Closed")return n.state=e.state,n;const o={};return Ra(e,o,i=>z1(n,i)),Ra(n,o,i=>yt(()=>gm(e,o))),n},ei=(e,t)=>St(()=>e.state._tag==="Closed"?t(e.state.exit):(Ra(e,{},t),st)),QO=(e,t)=>ei(e,ds(t)),Ra=(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)},gm=(e,t)=>{e.state._tag==="Open"&&e.state.finalizers.delete(t)},ym=(e="sequential")=>({[fS]:fS,[lS]:lS,strategy:e,state:JO}),JO={_tag:"Empty"},V1=jl.asEffect(),GO=qa(jl),q1=e=>St(()=>{const t=ym();return ys(e(t),n=>St(()=>B1(t,n)??st))}),YO=(e,t,n)=>$1(o=>J1(i=>je(V1,u=>L1(n!=null&&n.interruptible?i(e):e,l=>ei(u,d=>Va(t(l,d),o)))))),W1=Zn({op:"OnExit",single:!1,[It](e){return e._stack.push(this),this[Re][0]},[Zs](e){e.interruptible&&this[Re][2]!==!0&&(e._stack.push($l),e.interruptible=!1)},[xn](e,t,n){n??(n=ot(e));const o=this[Re][1](n);return o?je(o,i=>n):n},[lr](e,t,n){n??(n=An(e));const o=this[Re][1](n);return o?je(o,i=>n):n}}),ys=ne(2,W1),XO=ne(2,(e,t)=>ys(e,n=>t)),ZO=ne(3,(e,t,n)=>ys(e,o=>{const i=t(o);return Rt(i)?st:n(i.success,o)})),eM=ne(2,(e,t)=>ZO(e,wO,t)),tM=ne(3,(e,t,n)=>ys(e,o=>{if(o._tag!=="Failure")return st;const i=t(o.cause);return Rt(i)?st:n(i.success,o.cause)})),nM=ne(2,(e,t)=>tM(cm,t)(e)),rM=Be(e=>Nt(um(e.id))),H1=e=>Be(t=>(t.interruptible&&(t.interruptible=!1,t._stack.push($l)),e)),K1=Zn({op:"SetInterruptible",[Zs](e){if(e.interruptible=this[Re],e._interruptedCause&&e.interruptible)return()=>Nt(e._interruptedCause)}}),$l=K1(!0),sM=K1(!1),Q1=e=>Be(t=>t.interruptible?e:(t.interruptible=!0,t._stack.push(sM),t._interruptedCause?Nt(t._interruptedCause):e)),J1=e=>Be(t=>t.interruptible?(t.interruptible=!1,t._stack.push($l),e(Q1)):e(Ee)),oM=(e,t)=>S2(e)?(t==null?void 0:t.mode)==="result"?Fs(e,Sh,t):Fs(e,Ee,t):t!=null&&t.discard?t.mode==="result"?Fs(Object.values(e),Sh,t):Fs(Object.values(e),Ee,t):St(()=>{const n={};return ai(Fs(Object.entries(e),([o,i])=>vt((t==null?void 0:t.mode)==="result"?Sh(i):i,u=>{n[o]=u}),{discard:!0,concurrency:t==null?void 0:t.concurrency}),n)}),vm=Zn({op:"While",[xn](e,t){return this[Re].step(e),this[Re].while()?(t._stack.push(this),this[Re].body()):$n},[It](e){return this[Re].while()?(e._stack.push(this),this[Re].body()):$n}}),Fs=ne(e=>typeof e[1]=="function",(e,t,n)=>Be(o=>{const i=(n==null?void 0:n.concurrency)==="inherit"?o.getRef(RT):(n==null?void 0:n.concurrency)??1,u=i==="unbounded"?Number.POSITIVE_INFINITY:Math.max(1,i);if(u===1)return iM(e,t,n);const l=dr(e);let d=l.length;if(d===0)return n!=null&&n.discard?st:Ce([]);const m=n!=null&&n.discard?void 0:new Array(d),g=aM({f:t,out:m},l,{concurrency:u});return g?ai(g,m):Ce(m)})),iM=(e,t,n)=>St(()=>{const o=n!=null&&n.discard?void 0:[],i=e[Symbol.iterator]();let u=i.next(),l=0;return ai(vm({while:()=>!u.done,body:()=>t(u.value,l++),step:d=>{o&&o.push(d),u=i.next()}}),o)}),G1=e=>{const t=e.onItem,n=e.step;return(o,i,u)=>{let l=(u==null?void 0:u.start)??0;const d=(u==null?void 0:u.end)??i.length,m=(u==null?void 0:u.concurrency)??1;let g=!1,y,h,v,x=!1,w,k;const b=()=>{let B=!1;for(;!w&&l<d;l++){const _=i[l],A=k??t(o,_,l);if(wn(A)){if(w=n(o,_,A,l),w)break}else{if(m===1)return je(Al(A),P=>(w=n(o,_,P,l),l++,w??b()??st));if(y){k=void 0;const P=Dl(y,A,!0,!0,"inherit");if(P._exit){if(w=n(o,_,P._exit,l),w)break;continue}h?h.add(P):h=new Set([P]);const L=l;if(P.addObserver(F=>{if(h.delete(P),w){if(!x&&F._tag==="Failure")for(const $ of F.cause.reasons)$._tag!=="Interrupt"&&(w._tag==="Failure"?w.cause.reasons.push($):w=An(Ca([$])))}else{const $=n(o,_,F,L);$&&(w=$._tag==="Failure"?An(Ca($.cause.reasons.slice())):$,b())}if(B){const $=b();$&&v($)}else g&&h.size===0&&v(w??st)}),h.size<m)continue;B=!0,l++;return}else return er(P=>{y=fm(),k=A,v=P;const L=b();return L?P(L):St(()=>(w=$n,x=!0,h?Qc(h):st))})}}if(g=!0,w){if(h&&h.size>0){const _=Rl(y);h.forEach(A=>A.interruptUnsafe(y.id,_));return}if(v||w._tag==="Failure")return w}else if(v)if(h)h.size===0&&v(st);else return $n};return b()}},Fl=()=>G1,aM=G1({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)}}),Dl=(e,t,n=!1,o=!1,i=!1)=>{const u=i==="inherit"?e.interruptible:!i,l=new P1(e.context,u);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},Y1=ne(e=>Vt(e[0]),(e,t,n)=>Be(o=>{const i=Dl(o,e,n==null?void 0:n.startImmediately,!0,n==null?void 0:n.uninterruptible);if(!i._exit)if(t.state._tag!=="Closed"){const u={};Ra(t,u,()=>iO(d=>d===i.id?st:dm(i))),i.addObserver(()=>gm(t,u))}else i.interruptUnsafe(o.id,Rl(o));return Ce(i)})),uM=ne(e=>Vt(e[0]),(e,t)=>je(V1,n=>Y1(e,n,t))),Ha=e=>(t,n)=>{const o=new P1(n!=null&&n.scheduler?gs(e,p1,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},cM=ne(2,(e,t)=>{if(e._exit)return e;if(t.state._tag==="Closed")return e.interruptUnsafe(e.id),e;const n={};return Ra(t,n,()=>dm(e)),e.addObserver(()=>gm(t,n)),e}),lM=Ha(Gn()),X1=e=>{const t=Ha(e);return(n,o)=>{const i=t(n,o);return o!=null&&o.onExit&&i.addObserver(o.onExit),u=>i.interruptUnsafe(u)}},fM=X1(Gn()),Sm=e=>{const t=Ha(e);return(n,o)=>{const i=t(n,o);return new Promise(u=>{i.addObserver(l=>u(l))})}},dM=Sm(Gn()),Z1=e=>{const t=Sm(e);return(n,o)=>t(n,o).then(i=>{if(i._tag==="Failure")throw lm(i.cause);return i.value})},hM=Z1(Gn()),xm=e=>{const t=Ha(e);return n=>{var u;if(wn(n))return n;const o=new g1("sync"),i=t(n,{scheduler:o});return(u=i.currentDispatcher)==null||u.flush(),i._exit??Yo(new RM(i))}},pM=xm(Gn()),ek=e=>{const t=xm(e);return n=>{const o=t(n);if(o._tag==="Failure")throw lm(o.cause);return o.value}},mM=ek(Gn()),dS=Ce(!0),hS=Ce(!1);class gM{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]($n)});M(this,"open",Be(t=>this.isOpen?hS:(this.isOpen=!0,this.scheduleUnsafe(t))));M(this,"release",Be(t=>this.isOpen?hS:this.scheduleUnsafe(t)));M(this,"await",er(t=>this.isOpen?t(st):(this.waiters.push(t),yt(()=>{const n=this.waiters.indexOf(t);n!==-1&&this.waiters.splice(n,1)}))));M(this,"close",yt(()=>this.closeUnsafe()));M(this,"whenOpen",t=>je(this.await,()=>t));this.isOpen=t}scheduleUnsafe(t){return this.scheduled||this.waiters.length===0||(this.scheduled=!0,t.currentDispatcher.scheduleTask(this.flushWaiters,0)),dS}openUnsafe(){return this.isOpen?!1:(this.isOpen=!0,this.flushWaiters(),!0)}closeUnsafe(){return this.isOpen?(this.isOpen=!1,!0):!1}}const yM=e=>new gM(e??!1),Zh=BigInt(0),vM={_tag:"Span",spanId:"noop",traceId:"noop",sampled:!1,status:{_tag:"Ended",startTime:Zh,endTime:Zh,exit:$n},attributes:new Map,links:[],kind:"internal",attribute(){},event(){},end(){},addLinks(){}},SM=e=>Object.assign(Object.create(vM),e),tk=e=>e?Ws(e.annotations,Gh)?e._tag==="Span"?tk(n1(e.parent)):jn():Me(e):jn(),nk=(e,t,n)=>{const o=!e.getRef(TT)||(n==null?void 0:n.annotations)&&Ws(n.annotations,Gh),i=(n==null?void 0:n.parent)!==void 0?Me(n.parent):n!=null&&n.root?jn():tk(e.currentSpan);let u;if(o)u=SM({name:t,parent:i,annotations:gs((n==null?void 0:n.annotations)??Gn(),Gh,!0)});else{const l=e.getRef(PT),d=e.getRef(ui),m=e.getRef(x1),g=e.getRef(OT),y=e.getRef(MT),h=(n==null?void 0:n.level)??e.getRef(ET),v=(n==null?void 0:n.links)!==void 0?[...y,...n.links]:y.slice();u=l.span({name:t,parent:i,annotations:(n==null?void 0:n.annotations)??Gn(),links:v,startTime:m?d.currentTimeNanosUnsafe():BigInt(0),kind:(n==null?void 0:n.kind)??"internal",root:(n==null?void 0:n.root)??so(i),sampled:(n==null?void 0:n.sampled)??(fs(i)&&i.value.sampled===!1?!1:!sk(e.getRef(CT),h))});for(const[x,w]of Object.entries(g))u.attribute(x,w);if((n==null?void 0:n.attributes)!==void 0)for(const[x,w]of Object.entries(n.attributes))u.attribute(x,w)}return u},xM=(e,t)=>H1(Be(n=>{const o=bl(n.context,jl),i=nk(n,e,t??{}),u=n.getRef(ui),l=n.getRef(x1);return ai(ei(o,d=>kM(i,d,u,l)),i)})),wM=(e,t)=>(t=typeof t=="function"?t:yl,j1(S1,n=>({name:e,stack:t,parent:n}))),kM=(e,t,n,o)=>yt(()=>{e.status._tag!=="Ended"&&e.end(o?n.currentTimeNanosUnsafe():Zh,t)}),_M=(e,...t)=>{const n=t.length===1?void 0:t[0],o=t[t.length-1];return Be(i=>{const u=nk(i,e,n),l=i.getRef(ui);return ys(Jt(()=>o(u)),d=>yt(()=>{u.status._tag!=="Ended"&&u.end(l.currentTimeNanosUnsafe(),d)}))})},pS=qa(kT),EM=function(){const e=Vt(arguments[0]),t=e?arguments[1]:arguments[0];let n=e?arguments[2]:arguments[1],o=Ee;return t._tag==="Span"&&(n=jT(n),o=wM(t.name,n==null?void 0:n.captureStackTrace)),e?pS(o(arguments[0]),t):i=>pS(o(i),t)},ui=Xe("effect/Clock",{defaultValue:()=>new PM}),CM=2**31-1;class PM{constructor(){M(this,"currentTimeMillis",yt(()=>this.currentTimeMillisUnsafe()));M(this,"currentTimeNanos",yt(()=>this.currentTimeNanosUnsafe()))}currentTimeMillisUnsafe(){return Date.now()}currentTimeNanosUnsafe(){return bM()}sleep(t){const n=l1(t);return n<=0?hm:er(o=>{if(n>CM)return;const i=setTimeout(()=>o(st),n);return yt(()=>clearTimeout(i))})}}const mS=(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))})(),bM=(function(){const e=typeof process=="object"&&"hrtime"in process&&typeof process.hrtime.bigint=="function"?process.hrtime:void 0;if(!e)return mS;const t=mS()-e.bigint();return()=>t+e.bigint()})(),rk=e=>Be(t=>e(t.getRef(ui))),wm=e=>rk(t=>t.sleep(om(e))),gS="~effect/Cause/TimeoutError";var Px,bx;class IM extends(bx=tm("TimeoutError"),Px=gS,bx){constructor(n){super({message:n});M(this,Px,gS)}}const yS="~effect/Cause/AsyncFiberError";var Ix,Rx;class RM extends(Rx=tm("AsyncFiberError"),Ix=yS,Rx){constructor(n){super({message:"An asynchronous Effect was executed with Effect.runSync",fiber:n});M(this,Ix,yS)}}const TM=Xe("effect/Console/CurrentConsole",{defaultValue:()=>globalThis.console}),OM=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}},MM=yR(t1,OM),sk=vR(MM),LM=Xe("effect/Loggers/CurrentLoggers",{defaultValue:()=>new Set([zM,BM])}),NM=Xe("effect/Logger/LogToStderr",{defaultValue:bw}),AM="~effect/Logger",jM={[AM]:{_Message:Ee,_Output:Ee},pipe(){return At(this,arguments)}},ok=e=>{const t=Object.create(jM);return t.log=e,t},$M=e=>e.replace(/[\s="]/g,"_"),FM=(e,t)=>`${$M(e[0])}=${t-e[1]}ms`,ik=e=>(...t)=>{let n;for(let o=0,i=t.length;o<i;o++){const u=t[o];El(u)&&(n?t.splice(o,1):t=t.slice(0,o).concat(t.slice(o+1)),n=n?Ca(n.reasons.concat(u.reasons)):u,o--)}return n===void 0&&(n=Z2),Be(o=>{const i=e??o.currentLogLevel;if(sk(o.minimumLogLevel,i))return st;const u=o.getRef(ui),l=o.getRef(LM);if(l.size>0){const d=new Date(u.currentTimeMillisUnsafe());for(const m of l)m.log({cause:n,fiber:o,date:d,logLevel:i,message:t})}return st})},DM=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")}`,UM=typeof process=="object"&&process!==null&&typeof process.stdout=="object"&&process.stdout!==null;UM&&process.stdout.isTTY;const zM=ok(({cause:e,date:t,fiber:n,logLevel:o,message:i})=>{const u=Array.isArray(i)?i.slice():[i];e.reasons.length>0&&u.push(E1(e));const l=t.getTime(),d=n.getRef(AT);let m="";for(const v of d)m+=` ${FM(v,l)}`;const g=n.getRef(am);Object.keys(g).length>0&&u.push(g);const y=n.getRef(TM);(n.getRef(NM)?y.error:y.log)(`[${DM(t)}] ${o.toUpperCase()} (#${n.id})${m}:`,...u)}),BM=ok(({cause:e,fiber:t,logLevel:n,message:o})=>{const i=t.getRef(ui),u=t.getRef(am),l=t.currentSpan;if(l===void 0||l._tag==="ExternalSpan")return;const d={};for(const[m,g]of Object.entries(u))d[m]=g;d["effect.fiberId"]=t.id,d["effect.logLevel"]=n.toUpperCase(),e.reasons.length>0&&(d["effect.cause"]=E1(e)),l.event(W2(Array.isArray(o)&&o.length===1?o[0]:o),i.currentTimeNanosUnsafe(),d)}),VM=El,qM=X2,ep=Ca,tp=e=>new Fw(e),np=e=>new Uw(e),rp=UT,WM=WT,ak=lm,Ka=oo,HM=VT,KM=cm,km=iR,Hs=uR,QM=$w,xh=ot,da=An,Qa=pr,JM=Yo,GM=SO,uk=$n,YM=pm,ck=xO,XM=bO,ZM="~effect/Deferred",eL={[ZM]:{_A:Ee,_E:Ee},pipe(){return At(this,arguments)}},_m=()=>{const e=Object.create(eL);return e.resumes=void 0,e.effect=void 0,e},Em=e=>er(t=>e.effect?t(e.effect):(e.resumes??(e.resumes=[]),e.resumes.push(t),yt(()=>{const n=e.resumes.indexOf(t);e.resumes.splice(n,1)}))),tL=ne(2,(e,t)=>yt(()=>ha(e,t))),lk=tL,ha=(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},nL=ne(2,(e,t)=>J1(n=>je(Al(n(e)),o=>lk(t,o)))),rL=am,vS=jl,Cm=ym,Jc=GO,sL=ei,oL=QO,Gc=KO,Ul=z1,iL="~effect/Layer",SS="~effect/Layer/MemoMap",aL={[iL]:{_ROut:Ee,_E:Ee,_RIn:Ee},pipe(){return At(this,arguments)}},fk=e=>{const t=Object.create(aL);return t.build=e,t},Pm=e=>fk((t,n)=>{const o=Gc(n);return ys(e(t,o),i=>i._tag==="Failure"?Ul(o,i):st)}),uL=e=>{const t=Pm((n,o)=>n.getOrElseMemoize(t,o,e));return t};class cL{constructor(){M(this,"map",new Map)}get[SS](){return SS}getOrElseMemoize(t,n,o){if(this.map.has(t)){const d=this.map.get(t);return d.observers++,Ba(ei(n,m=>d.finalizer(m)),d.effect)}const i=Cm(),u=_m(),l={observers:1,effect:Em(u),finalizer:d=>St(()=>(l.observers--,l.observers===0?(this.map.delete(t),Ul(i,d)):st))};return this.map.set(t,l),ei(n,l.finalizer).pipe(je(()=>o(this,i)),ys(d=>(l.effect=d,lk(u,d))))}}const bm=()=>new cL,ll=class ll extends Fn()("effect/Layer/CurrentMemoMap"){};M(ll,"getOrCreate",qR(ll,bm));let Ta=ll;const Im=ne(3,(e,t,n)=>qa(vt(e.build(t,n),gs(Ta,t)),Ta,t)),lL=ne(2,(e,t)=>Be(n=>Im(e,Ta.getOrCreate(n.context),t))),Rm=function(){return arguments.length===1?e=>xS(Xo(arguments[0],e)):xS(Xo(arguments[0],arguments[1]))},xS=e=>fk(ds(Ce(e))),sp=function(){return arguments.length===1?e=>wS(arguments[0],e):wS(arguments[0],arguments[1])},wS=(e,t)=>op(vt(t,n=>Xo(e,n))),op=e=>uL((t,n)=>Jc(e,n)),dk=(e,t,n)=>{const o=Gc(n,"parallel");return Fs(e,i=>i.build(t,Gc(o,"sequential")),{concurrency:e.length}).pipe(vt(i=>QR(...i)))},hk=(...e)=>Pm((t,n)=>dk(e,t,n)),fL=(e,t,n)=>Pm((o,i)=>je(Array.isArray(t)?dk(t,o,i):t.build(o,i),u=>e.build(o,i).pipe(Va(u),vt(l=>n(l,u))))),ip=ne(2,(e,t)=>fL(e,t,Ee)),dL=class extends gl{constructor(t){super(),t&&Object.assign(this,t)}},ti=ne(2,(e,t)=>D1(e,mL,n=>t(n))),kS=e=>e.reasons.some(hL),hL=e=>e._tag==="Fail"&&km(e.error),pL=h1(Ka,e=>km(e)?Lr(e):Jn(e)),mL=h1(Ka,e=>km(e)?Lr(e.value):Jn(e)),Tm=ne(2,(e,t)=>Nl(e,{onSuccess:t.onSuccess,onFailure:n=>{const o=pL(n);return Rt(o)?t.onFailure(o.failure):t.onDone(o.success.value)}})),pk="~effect/Schedule",_S=Xe("effect/Schedule/CurrentMetadata",{defaultValue:ds({input:void 0,output:void 0,duration:im,attempt:0,start:0,now:0,elapsed:0,elapsedSincePrevious:0})}),gL={[pk]:{_Out:Ee,_In:Ee,_Env:Ee},pipe(){return At(this,arguments)}},yL=e=>Ue(e,pk),Ja=e=>{const t=Object.create(gL);return t.step=e,t},Om=()=>{let e=0,t,n;return(o,i)=>{n===void 0&&(n=o);const u=o-n,l=t===void 0?0:o-t;return t=o,{input:i,attempt:++e,start:n,now:o,elapsed:u,elapsedSincePrevious:l}}},mk=e=>Ja(vt(e,t=>{const n=Om();return(o,i)=>t(n(o,i))})),eo=e=>Wa(e.step,t=>Ce(()=>Nt(t))),vL=e=>rk(t=>vt(eo(e),n=>{const o=Om();return i=>St(()=>{const u=t.currentTimeMillisUnsafe();return je(n(u,i),([l,d])=>{const m=o(u,i);return m.output=l,m.duration=d,ai(wm(d),m)})})})),SL=ne(2,(e,t)=>xL(e,t,(n,o)=>[n,o])),xL=ne(3,(e,t,n)=>Ja(vt(F1(eo(e),eo(t)),([o,i])=>(u,l)=>Tm(o(u,l),{onSuccess:d=>i(u,l).pipe(vt(m=>[n(d[0],m[0]),hT(d[1],m[1])]),ti(m=>Hs(n(d[0],m)))),onDone:d=>i(u,l).pipe(je(m=>Hs(n(d,m[0]))),ti(m=>Hs(n(d,m)))),onFailure:Nt})))),gk=ne(2,(e,t)=>wL(e,t,(n,o)=>[n,o])),wL=ne(3,(e,t,n)=>Ja(vt(F1(eo(e),eo(t)),([o,i])=>(u,l)=>Tm(o(u,l),{onSuccess:d=>i(u,l).pipe(vt(m=>[n(d[0],m[0]),dT(d[1],m[1])]),ti(m=>Ce([n(d[0],m),d[1]]))),onFailure:Nt,onDone:d=>i(u,l).pipe(vt(m=>[n(d,m[0]),m[1]]),ti(m=>Hs(n(d,m))))})))),yk=(e,t=2)=>{const n=l1(om(e));return mk(Ce(o=>{const i=ba(n*Math.pow(t,o.attempt-1));return Ce([i,i])}))},vk=e=>Ja(vt(eo(e),t=>(n,o)=>Tm(t(n,o),{onSuccess:i=>Ce([o,i[1]]),onFailure:Nt,onDone:()=>Hs(o)}))),kL=e=>Mc(Sk,({attempt:t})=>Ce(t<=e)),Mm=e=>{const t=om(e);return mk(Ce(n=>Ce([n.attempt-1,t])))},Mc=ne(2,(e,t)=>Ja(vt(eo(e),n=>{const o=Om();return(i,u)=>je(n(i,u),l=>{const[d,m]=l,g=t({...o(i,u),output:d,duration:m});return je(Vt(g)?g:Ce(g),y=>y?Ce(l):Hs(d))})}))),Sk=Mm(im),_L=(e,t,n)=>q1(o=>je(n!=null&&n.local?Im(t,bm(),o):lL(t,o),i=>Va(e,i))),EL=ne(e=>Vt(e[0]),(e,t,n)=>i1(t)?Va(e,t):_L(e,Array.isArray(t)?hk(...t):t,n)),CL=ne(3,(e,t,n)=>je(vL(t),o=>{let i=_S.defaultValue(),u;const l=Ll(St(()=>qa(e,_S,i)),d=>(u=d,je(o(d),m=>(i=m,l))));return ti(l,d=>Jt(()=>n(u,d)))})),PL=ne(2,(e,t)=>{const n=typeof t=="function"?t(Ee):yL(t)?t:IL(t);return CL(e,n,Tl)}),bL=vk(Sk),IL=e=>{let t=e.schedule?vk(e.schedule):bL;return e.while&&(t=Mc(t,({input:n})=>{const o=e.while(n);return Vt(o)?o:Ce(o)})),e.until&&(t=Mc(t,({input:n})=>{const o=e.until(n);return Vt(o)?vt(o,i=>!i):Ce(!o)})),e.times!==void 0&&(t=Mc(t,({attempt:n})=>Ce(n<=e.times))),t},Ko=Vt,xk=Fs,wk=vm,RL=oO,it=Ce,Lm=sO,TL=rO,hr=St,vn=yt,rt=st,ES=er,OL=uO,ap=cO,Qe=Tl,ML=Nt,LL=Ol,Yc=Be,kn=je,NL=pO,AL=Ba,jL=L1,CS=Al,vs=vt,Oa=Wa,$L=AO,Lc=FO,FL=NO,DL=PL,UL=DO,zL=WO,BL=U1,VL=qO,kk=A1,qL=Nl,Xc=RO,_k=$1,WL=EL,Ks=Va,HL=IO,KL=Ml,QL=qa,JL=q1,Ek=YO,Ck=XO,GL=eM,Pk=ys,up=rM,Nm=Q1,YL=nM,bk=MO,XL=xM,ZL=_M,PS=EM,eN=Y1,Am=uM,cp=lM,Zc=Ha,tN=X1,nN=fM,pa=hM,rN=Z1,sN=dM,oN=Sm,jm=mM,iN=ek,Ik=pM,aN=xm,Qs=O1,uN=ik("Error"),cN=ne(e=>Ko(e[0]),(e,...t)=>j1(e,rL,n=>{const o={...n};return t.length===1?Object.assign(o,t[0]):o[t[0]]=t[1],o})),Rk=mO,io=gO,Ma=yO,qo=hO,lN=vO,lp=lO;function oa(e,t,n){return t==="__proto__"?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n,e}function Tk(e){return e.checks?e.checks[e.checks.length-1].annotations:e.annotations}function fN(e){return t=>{var n;return(n=Tk(t))==null?void 0:n[e]}}const dN=fN("identifier"),$m=hs(e=>{const t=dN(e);return typeof t=="string"?t:e.getExpected($m)}),hN=e=>e.replace(/[/\\^$*+?.()|[\]{}]/g,"\\$&"),Nc=new WeakMap,Ok="~effect/data/Redacted",pN=e=>Ue(e,Ok),bS=(e,t)=>{const n=Object.create(mN);return Nc.set(n,e),n},mN={[Ok]:{_A:e=>e},label:void 0,...ms,toJSON(){return this.toString()},toString(){return`<redacted${Qp(this.label)?":"+this.label:""}>`},[Gt](){return ft(Nc.get(this))},[Yt](e){return pN(e)&&Sn(Nc.get(this),Nc.get(e))}},fp="~effect/SchemaIssue/Issue";function gN(e){return Ue(e,fp)}var Tx;let mr=(Tx=fp,class{constructor(){M(this,Tx,fp)}toString(){return CN(this)}}),yN=class extends mr{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 vN extends mr{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 Yn extends mr{constructor(n,o){super();M(this,"_tag","Pointer");M(this,"path");M(this,"issue");this.path=n,this.issue=o}}class Mk extends mr{constructor(n){super();M(this,"_tag","MissingKey");M(this,"annotations");this.annotations=n}}class Lk extends mr{constructor(n,o){super();M(this,"_tag","UnexpectedKey");M(this,"ast");M(this,"actual");this.ast=n,this.actual=o}}class Bt extends mr{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 gr extends mr{constructor(n,o){super();M(this,"_tag","InvalidType");M(this,"ast");M(this,"actual");this.ast=n,this.actual=o}}class el extends mr{constructor(n,o){super();M(this,"_tag","InvalidValue");M(this,"actual");M(this,"annotations");this.actual=n,this.annotations=o}}class IS extends mr{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 SN extends mr{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 dp(e,t){if(gN(t))return t;if(typeof t=="string")return new el(Me(e),{message:t});const n=typeof t.issue=="string"?new el(Me(e),{message:t.issue}):t.issue;return new Yn(t.path,n)}function xN(e,t){if(t!==void 0)return typeof t=="boolean"?t?void 0:new el(Me(e)):dp(e,t)}function wN(e,t,n){return Array.isArray(n)?Wc(n)?n.length===1?dp(e,n[0]):new Bt(t,Me(e),s1(n,o=>dp(e,o))):void 0:xN(e,n)}const kN=e=>{const t=La(e);if(t!==void 0)return t;switch(e._tag){case"InvalidType":return hp($m(e.ast),RS(e.actual));case"InvalidValue":return`Invalid data ${RS(e.actual)}`;case"MissingKey":return"Missing key";case"UnexpectedKey":return`Unexpected key with value ${pt(e.actual)}`;case"Forbidden":return"Forbidden operation";case"OneOf":return`Expected exactly one member to match the input ${pt(e.actual)}`}},_N=e=>La(e.issue)??La(e);function hp(e,t){return`Expected ${e}, got ${t}`}function Vo(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:hp(Nk(e.filter),pt(e.actual))}];default:return Vo(e.issue,t,n,o)}}case"Encoding":return Vo(e.issue,t,n,o);case"Pointer":return Vo(e.issue,[...t,...e.path],n,o);case"Composite":return e.issues.flatMap(i=>Vo(i,t,n,o));case"AnyOf":{const i=La(e);if(e.issues.length===0){if(i!==void 0)return[{path:t,message:i}];const u=hp($m(e.ast),pt(e.actual));return[{path:t,message:u}]}return e.issues.flatMap(u=>Vo(u,t,n,o))}default:return[{path:t,message:n(e)}]}}function Nk(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=>Nk(o)).join(" & ")}}function EN(){return e=>Vo(e,[],kN,_N).map(PN).join(`
|
|
82
|
-
`)}const CN=EN();function PN(e){let t=e.message;if(e.path&&e.path.length>0){const n=B2(e.path);t+=`
|
|
83
|
-
at ${n}`}return t}function La(e){switch(e._tag){case"InvalidType":case"OneOf":case"Composite":case"AnyOf":return na(e.ast.annotations);case"InvalidValue":case"Forbidden":return na(e.annotations);case"MissingKey":return na(e.annotations,"messageMissingKey");case"UnexpectedKey":return na(e.ast.annotations,"messageUnexpectedKey");case"Filter":return na(e.filter.annotations);case"Encoding":return La(e.issue)}}function na(e,t="message"){const n=e==null?void 0:e[t];if(typeof n=="string")return n}function RS(e){return so(e)?"no value provided":pt(e.value)}class ni extends gl{constructor(n){super();M(this,"run");this.run=n}map(n){return new ni((o,i)=>this.run(o,i).pipe(Rk(sm(n))))}compose(n){return TS(this)?n:TS(n)?this:new ni((o,i)=>this.run(o,i).pipe(qo(u=>n.run(u,i))))}}const Ak=new ni(it);function TS(e){return e.run===Ak.run}function ri(){return Ak}function cn(e){return bN(sm(e))}function bN(e){return new ni(t=>it(e(t)))}function IN(e){return new ni(t=>{const n=_R(t,m2);return fs(n)?it(n):vs(e,Me)})}function RN(){return cn(globalThis.String)}function jk(){return cn(globalThis.Number)}const pp="~effect/SchemaTransformation/Transformation";var Ox;Ox=pp;const fl=class fl{constructor(t,n){M(this,Ox,pp);M(this,"_tag","Transformation");M(this,"decode");M(this,"encode");this.decode=t,this.encode=n}flip(){return new fl(this.encode,this.decode)}compose(t){return new fl(this.decode.compose(t.decode),t.encode.compose(this.encode))}};let _n=fl;function TN(e){return Ue(e,pp)}const $k=e=>TN(e)?e:new _n(e.decode,e.encode);function zl(e){return new _n(cn(e.decode),cn(e.encode))}const ON=new _n(ri(),ri());function Fm(){return ON}const Fk=new _n(jk(),RN()),Dk=e=>zl({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 ao(e){return t=>t._tag===e}const Uk=ao("Declaration"),MN=ao("Never"),tl=ao("Literal"),LN=ao("UniqueSymbol"),NN=ao("Arrays"),AN=ao("Objects"),jN=ao("Union");class Tt{constructor(t,n){M(this,"to");M(this,"transformation");this.to=t,this.transformation=n}}const $N={};class si{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 OS="~effect/Schema";var Mx;Mx=OS;class fn{constructor(t=void 0,n=void 0,o=void 0,i=void 0){M(this,Mx,OS);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 Ga extends fn{constructor(n,o,i,u,l,d){super(i,u,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)=>so(o)?Lm:Rk(n(o.value,this,i),Me)}recur(n){const o=oi(this.typeParameters,n);return o===this.typeParameters?this:new Ga(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 FN=class extends fn{constructor(){super(...arguments);M(this,"_tag","Null")}getParser(){return ql(this,null)}getExpected(){return"null"}};const Dm=new FN;let DN=class extends fn{constructor(){super(...arguments);M(this,"_tag","Undefined")}getParser(){return ql(this,void 0)}toCodecJson(){return Pt(this,[zk])}getExpected(){return"undefined"}};const zk=new Tt(Dm,new _n(cn(()=>{}),cn(()=>null))),UN=new DN;let zN=class extends fn{constructor(){super(...arguments);M(this,"_tag","Void")}getParser(){return ql(this,void 0)}toCodecJson(){return Pt(this,[zk])}getExpected(){return"void"}};const BN=new zN;let VN=class extends fn{constructor(){super(...arguments);M(this,"_tag","Never")}getParser(){return uo(this,y2)}getExpected(){return"never"}};const qN=new VN;let WN=class extends fn{constructor(){super(...arguments);M(this,"_tag","Any")}getParser(){return uo(this,Tw)}getExpected(){return"any"}};const HN=new WN;let KN=class extends fn{constructor(){super(...arguments);M(this,"_tag","Unknown")}getParser(){return uo(this,Tw)}getExpected(){return"unknown"}};const Um=new KN;let ma=class extends fn{constructor(n,o,i,u,l){super(o,i,u,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 ${pt(n)}`);this.literal=n}getParser(){return ql(this,this.literal)}toCodecJson(){return typeof this.literal=="bigint"?MS(this):this}toCodecStringTree(){return typeof this.literal=="string"?this:MS(this)}getExpected(){return typeof this.literal=="string"?JSON.stringify(this.literal):globalThis.String(this.literal)}};function MS(e){const t=globalThis.String(e.literal);return Pt(e,[new Tt(new ma(t),new _n(cn(()=>e.literal),cn(()=>t)))])}let QN=class extends fn{constructor(){super(...arguments);M(this,"_tag","String")}getParser(){return uo(this,Qp)}getExpected(){return"string"}};const Bk=new QN;let JN=class extends fn{constructor(){super(...arguments);M(this,"_tag","Number")}getParser(){return uo(this,Rw)}toCodecJson(){return this.checks&&(ia(this.checks,"isFinite")||ia(this.checks,"isInt"))?this:Pt(this,[i3])}toCodecStringTree(){return this.checks&&(ia(this.checks,"isFinite")||ia(this.checks,"isInt"))?Pt(this,[y3]):Pt(this,[v3])}getExpected(){return"number"}};function ia(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 ia(n.checks,t)}})}const Vk=new JN;let GN=class extends fn{constructor(){super(...arguments);M(this,"_tag","Boolean")}getParser(){return uo(this,p2)}getExpected(){return"boolean"}};const YN=new GN;class Bl extends fn{constructor(n,o,i,u,l,d,m){super(u,l,d,m);M(this,"_tag","Arrays");M(this,"isMutable");M(this,"elements");M(this,"rest");this.isMutable=n,this.elements=o,this.rest=i;const g=o.findIndex(Or);if(g!==-1&&(o.slice(g+1).some(y=>!Or(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(Or))throw new Error("An optional element cannot follow a rest element. ts(1266)")}getParser(n){const o=this,i=o.elements.map(h=>({ast:h,parser:n(h)})),u=o.rest.map(h=>({ast:h,parser:n(h)})),l=i.length,[d,...m]=u,g=m.length;function y(h,v){return v<l?i[v]:v>=h?m[v-h]:d}return lp(function*(h,v){if(h._tag==="None")return h;const x=h.value;if(!Array.isArray(x))return yield*Qe(new gr(o,h));const w=x.length,k={ast:o,getParser:y,oinput:h,len:w,tailThreshold:ZN(w,l,g),output:new globalThis.Array(w),issues:void 0,options:v},b=zm(v==null?void 0:v.concurrency),B=XN(k,x,{concurrency:b==null?void 0:b.concurrency,end:o.rest.length===0?l:Math.max(w,l+g)});if(B&&(yield*B),o.rest.length===0&&w>l)for(let _=l;_<=w-1;_++){const A=new Yn([_],new Lk(o,x[_]));if(v.errors==="all")k.issues?k.issues.push(A):k.issues=[A];else return yield*Qe(new Bt(o,h,[A]))}return k.issues?yield*Qe(new Bt(o,h,k.issues)):Me(k.output)})}recur(n){const o=oi(this.elements,n),i=oi(this.rest,n);return o===this.elements&&i===this.rest?this:new Bl(this.isMutable,o,i,this.annotations,this.checks,void 0,this.context)}getExpected(){return"array"}}const XN=Fl()({onItem(e,t,n){const o=n<e.len?Me(t):jn();return e.getParser(e.tailThreshold,n).parser(o,e.options)},step(e,t,n,o){var i;if(n._tag==="Failure")return nl(e,e.ast,o,n);if(n.value._tag==="Some")e.output[o]=n.value.value;else{const u=e.getParser(e.tailThreshold,o);if(Or(u.ast))return;const l=new Yn([o],new Mk((i=u.ast.context)==null?void 0:i.annotations));if(e.options.errors==="all")e.issues?e.issues.push(l):e.issues=[l];else return Qa(new Bt(e.ast,e.oinput,[l]))}}});function ZN(e,t,n){return Math.max(t,e-n)}const zm=e=>(e=e==="unbounded"?1/0:e??1,e>1?{concurrency:e}:void 0),nl=(e,t,n,o)=>{const i=Ka(o.cause);if(Rt(i))return o;const u=new Yn([n],i.success);if(e.options.errors==="all")e.issues?e.issues.push(u):e.issues=[u];else return Qa(new Bt(t,e.oinput,[u]))},Bm="[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?",e3=new globalThis.RegExp(`(?:${Bm}|Infinity|-Infinity|NaN)`);function qk(e,t){const n=us(t);switch(n._tag){case"String":return Object.keys(e);case"TemplateLiteral":{const o=h3(n);return Object.keys(e).filter(i=>o.test(i))}case"Symbol":return Object.getOwnPropertySymbols(e);case"Number":return Object.keys(e).filter(o=>e3.test(o));case"Union":return[...new Set(n.types.flatMap(o=>qk(e,o)))];default:return[]}}class Wk{constructor(t,n){M(this,"name");M(this,"type");this.name=t,this.type=n}}class t3{constructor(t,n,o){M(this,"parameter");M(this,"type");M(this,"merge");if(this.parameter=t,this.type=n,this.merge=o,Or(n)&&!r_(n))throw new Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")}}class Vm extends fn{constructor(n,o,i,u,l,d){super(i,u,l,d);M(this,"_tag","Objects");M(this,"propertySignatures");M(this,"indexSignatures");this.propertySignatures=n,this.indexSignatures=o;const m=n.map(g=>g.name).filter((g,y,h)=>h.indexOf(g)!==y);if(m.length>0)throw new Error(`Duplicate identifiers: ${JSON.stringify(m)}. ts(2300)`)}getParser(n){const o=this,i=[],u=new Set,l=[];for(const g of o.propertySignatures)i.push(g.name),u.add(g.name),l.push({ps:g,parser:n(g.type),name:g.name,type:g.type});const d=o.indexSignatures.length;if(o.propertySignatures.length===0&&o.indexSignatures.length===0)return uo(o,g2);const m=d>0?Fl()({onItem:lp(function*(g,[y,h]){const x=n(a_(h.parameter))(Me(y),g.options),w=wn(x)?x:yield*CS(x);if(w._tag==="Failure"){const A=nl(g,o,y,w);A&&(yield*A);return}const k=Me(g.input[y]),B=n(h.type)(k,g.options),_=wn(B)?B:yield*CS(B);if(_._tag==="Failure"){const A=nl(g,o,y,_);A&&(yield*A);return}else if(w.value._tag==="Some"&&_.value._tag==="Some"){const A=w.value.value,P=_.value.value;if(h.merge&&h.merge.decode&&Object.hasOwn(g.out,A)){const[L,F]=h.merge.decode.combine([A,g.out[A]],[A,P]);oa(g.out,L,F)}else oa(g.out,A,P)}}),step:(g,y,h)=>h._tag==="Failure"?h:void 0}):void 0;return lp(function*(g,y){if(g._tag==="None")return g;const h=g.value;if(!(typeof h=="object"&&h!==null&&!Array.isArray(h)))return yield*Qe(new gr(o,g));const v={},x={ast:o,oinput:g,input:h,out:v,issues:void 0,options:y},w=y.errors==="all",k=y.onExcessProperty==="error",b=y.onExcessProperty==="preserve";let B;if(o.indexSignatures.length===0&&(k||b)){B=Reflect.ownKeys(h);for(let P=0;P<B.length;P++){const L=B[P];if(!u.has(L))if(k){const F=new Yn([L],new Lk(o,h[L]));if(w){x.issues?x.issues.push(F):x.issues=[F];continue}else return yield*Qe(new Bt(o,g,[F]))}else oa(v,L,h[L])}}const _=zm(y==null?void 0:y.concurrency),A=n3(x,l,_);if(A&&(yield*A),m){const P=DR();for(let F=0;F<d;F++){const $=o.indexSignatures[F],D=qk(h,$.parameter);for(let W=0;W<D.length;W++){const X=D[W];P.push([X,$])}}const L=m(x,P,_);L&&(yield*L)}if(x.issues)return yield*Qe(new Bt(o,g,x.issues));if(y.propertyOrder==="original"){const P=(B??Reflect.ownKeys(h)).concat(i),L={};for(const F of P)Object.hasOwn(v,F)&&oa(L,F,v[F]);return Me(L)}return Me(v)})}rebuild(n,o){const i=oi(this.propertySignatures,l=>{const d=n(l.type);return d===l.type?l:new Wk(l.name,d)}),u=oi(this.indexSignatures,l=>{var y;const d=n(l.parameter),m=n(l.type),g=o?(y=l.merge)==null?void 0:y.flip():l.merge;return d===l.parameter&&m===l.type&&g===l.merge?l:new t3(d,m,g)});return i===this.propertySignatures&&u===this.indexSignatures?this:new Vm(i,u,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 n3=Fl()({onItem(e,t){const n=Object.hasOwn(e.input,t.name)?Me(e.input[t.name]):jn();return t.parser(n,e.options)},step(e,t,n){var o;if(n._tag==="Failure")return nl(e,e.ast,t.name,n);if(n.value._tag==="Some")oa(e.out,t.name,n.value.value);else if(!Or(t.type)){const i=new Yn([t.name],new Mk((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 Qa(new Bt(e.ast,e.oinput,[i]))}}});function qm(e,t,n){return new Vm(Reflect.ownKeys(e).map(o=>new Wk(o,e[o].ast)),[],n,t)}function Hk(e){return e.ast}function Wm(e,t,n){return new Ya(e.map(Hk),t,void 0,n)}function Kk(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(Kk)));default:return["null","undefined","string","number","boolean","symbol","bigint","object","array","function"]}}function Hm(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(!Or(o)){if(tl(o))return[{key:n.name,literal:o.literal}];if(LN(o))return[{key:n.name,literal:o.symbol}]}return[]});case"Arrays":return e.elements.flatMap((n,o)=>tl(n)&&!Or(n)?[{key:o,literal:n.literal}]:[]);case"Suspend":return Hm(e.thunk())}}const LS=new WeakMap;function r3(e){var n,o;let t=LS.get(e);if(t)return t;t={};for(const i of e){const u=us(i);if(MN(u))continue;const l=Kk(u),d=Hm(u);t.byType??(t.byType={});for(const m of l)((n=t.byType)[m]??(n[m]=[])).push(i);if(d.length>0){t.bySentinel??(t.bySentinel=new Map);for(const{key:m,literal:g}of d){let y=t.bySentinel.get(m);y||t.bySentinel.set(m,y=new Map);let h=y.get(g);h||y.set(g,h=[]),h.push(i)}}else{t.otherwise??(t.otherwise={});for(const m of l)((o=t.otherwise)[m]??(o[m]=[])).push(i)}}return LS.set(e,t),t}function NS(e){return t=>{const n=us(t);return n._tag==="Literal"?n.literal===e:n._tag==="UniqueSymbol"?n.symbol===e:!0}}function s3(e,t){var i,u;const n=r3(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,m]of n.bySentinel)if(Object.hasOwn(e,d)){const g=m.get(e[d]);if(g)return[...g,...l].filter(NS(e))}}return l}return(((u=n.byType)==null?void 0:u[o])??[]).filter(NS(e))}let Ya=class Qk extends fn{constructor(n,o,i,u,l,d){super(i,u,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,u)=>{if(i._tag==="None")return it(i);const l=i.value,d=s3(l,o.types),m={ast:o,recur:n,oinput:i,input:l,out:void 0,successes:[],issues:void 0,options:u},g=zm(u==null?void 0:u.concurrency),y=o3(m,d,g);return y?kn(y,h=>m.out?it(m.out):Qe(new IS(o,l,m.issues??[]))):m.out?it(m.out):Qe(new IS(o,l,m.issues??[]))}}recur(n){const o=oi(this.types,n);return o===this.types?this:new Qk(o,this.mode,this.annotations,this.checks,void 0,this.context)}getExpected(n){var u;const o=(u=this.annotations)==null?void 0:u.expected;if(typeof o=="string")return o;if(this.types.length===0)return"never";const i=this.types.map(l=>{const d=us(l);switch(d._tag){case"Arrays":{const m=d.elements.filter(tl);if(m.length>0)return`${AS(d.isMutable)}[ ${m.map(g=>{var y;return n(g)+jS((y=g.context)==null?void 0:y.isOptional)}).join(", ")}, ... ]`;break}case"Objects":{const m=d.propertySignatures.filter(g=>tl(g.type));if(m.length>0)return`{ ${m.map(g=>{var y,h;return`${AS((y=g.type.context)==null?void 0:y.isMutable)}${qc(g.name)}${jS((h=g.type.context)==null?void 0:h.isOptional)}: ${n(g.type)}`}).join(", ")}, ... }`;break}}return n(d)});return Array.from(new Set(i)).join(" | ")}};const o3=Fl()({onItem(e,t){return e.recur(t)(e.oinput,e.options)},step(e,t,n){if(n._tag==="Failure"){const o=Ka(n.cause);if(Rt(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),Qa(new SN(e.ast,e.input,e.successes));if(e.out=n.value,e.successes.push(t),e.ast.mode==="anyOf")return uk}}}),Jk=new Ya([new ma("Infinity"),new ma("-Infinity"),new ma("NaN")],"anyOf"),i3=new Tt(new Ya([Vk,Jk],"anyOf"),new _n(jk(),cn(e=>globalThis.Number.isFinite(e)?e:globalThis.String(e))));function AS(e){return e?"":"readonly "}function jS(e){return e?"?":""}class rl extends gl{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 rl(this.run,{...this.annotations,...n},this.aborted)}abort(){return new rl(this.run,this.annotations,!0)}and(n,o){return new sl([this,n],o)}}class sl extends gl{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 sl(this.checks,{...this.annotations,...n})}and(n,o){return new sl([this,n],o)}}function Gk(e,t,n=!1){return new rl((o,i,u)=>wN(o,i,e(o,i,u)),t,n)}function a3(e,t){const n=e.source;return Gk(o=>e.test(o),{expected:`a string matching the RegExp ${n}`,meta:{_tag:"isPattern",regExp:e},toArbitraryConstraint:{string:{patterns:[e.source]}},...t})}function Vl(e,t){const n=Object.getOwnPropertyDescriptors(e);return t(n),Object.create(Object.getPrototypeOf(e),n)}function Pt(e,t){return e.encoding===t?e:Vl(e,n=>{n.encoding.value=t})}function Km(e,t){return e.context===t?e:Vl(e,n=>{n.context.value=t})}function Yk(e,t){if(e.checks){const n=e.checks[e.checks.length-1];return Xk(e,r1(e.checks.slice(0,-1),n.annotate(t)))}return Vl(e,n=>{n.annotations.value={...n.annotations.value,...t}})}function Xk(e,t){return e.checks===t?e:Vl(e,n=>{n.checks.value=t})}function Qm(e,t){return Xk(e,e.checks?[...e.checks,...t]:t)}function Zk(e,t){const n=e,o=n[n.length-1],i=t(o.to);return i!==o.to?r1(e.slice(0,e.length-1),new Tt(i,o.transformation)):e}function u3(e){return t=>t.encoding?Pt(t,Zk(t.encoding,e)):t}function c3(e,t,n){const o=new Tt(e,t);return Pt(n,n.encoding?[...n.encoding,o]:[o])}function oi(e,t){let n=!1;const o=new Array(e.length);for(let i=0;i<e.length;i++){const u=e[i],l=t(u);l!==u&&(n=!0),o[i]=l}return n?o:e}function e_(e,t){const n=e.context?new si(e.context.isOptional,e.context.isMutable,e.context.defaultValue,{...e.context.annotations,...t}):new si(!1,!1,void 0,t);return Km(e,n)}const t_=u3(n_);function n_(e){const t=e.context?e.context.isOptional===!1?new si(!0,e.context.isMutable,e.context.defaultValue,e.context.annotations):e.context:new si(!0,!1);return t_(Km(e,t))}function l3(e,t){const n=new _n(IN(t),ri()),o=[new Tt(Um,n)],i=e.context?new si(e.context.isOptional,e.context.isMutable,o,e.context.annotations):new si(!1,!1,o);return Km(e,i)}function f3(e,t,n){return c3(e,n,t)}function Or(e){var t;return((t=e.context)==null?void 0:t.isOptional)??!1}const ol=hs(e=>{var n;if(e.encoding)return ol(Pt(e,void 0));const t=e;return((n=t.recur)==null?void 0:n.call(t,ol))??t}),us=hs(e=>ol(Js(e)));function d3(e,t){const n=t,o=n.length,i=n[o-1],u=[new Tt(Js(Pt(e,void 0)),n[0].transformation.flip())];for(let d=1;d<o;d++)u.unshift(new Tt(Js(n[d-1].to),n[d].transformation.flip()));const l=Js(i.to);return l.encoding?Pt(l,[...l.encoding,...u]):Pt(l,u)}const Js=hs(e=>{var n,o;if(e.encoding)return d3(e,e.encoding);const t=e;return((n=t.flip)==null?void 0:n.call(t,Js))??((o=t.recur)==null?void 0:o.call(t,Js))??t});function r_(e){switch(e._tag){case"Undefined":return!0;case"Union":return e.types.some(r_);default:return!1}}function s_(e,t){return e.encodedParts.map(n=>p3(n,o_(n),t)).join("")}const h3=hs(e=>new globalThis.RegExp(`^${s_(e,!0)}$`));function o_(e){switch(e._tag){case"Literal":return hN(globalThis.String(e.literal));case"String":return m3;case"Number":return Bm;case"BigInt":return S3;case"TemplateLiteral":return s_(e,!1);case"Union":return e.types.map(o_).join("|")}}function p3(e,t,n){if(jN(e)){if(!n)return`(?:${t})`}else if(!n)return t;return`(${t})`}function ql(e,t){const n=TL(t);return o=>o._tag==="None"?Lm:o.value===t?n:Qe(new gr(e,o))}function uo(e,t){return n=>n._tag==="None"?Lm:t(n.value)?it(n):Qe(new gr(e,n))}function i_(e){function t(n){return n.encoding?Pt(n,Zk(n.encoding,t)):e(n)}return hs(t)}const a_=i_(e=>{switch(e._tag){default:return e;case"Number":return e.toCodecStringTree();case"Union":return e.recur(a_)}}),m3="[\\s\\S]*?",$S=new globalThis.RegExp(`^${Bm}$`);function g3(e){return a3($S,{expected:"a string representing a finite number",meta:{_tag:"isStringFinite",regExp:$S},...e})}const u_=Qm(Bk,[g3()]),y3=new Tt(u_,Fk),v3=new Tt(new Ya([u_,Jk],"anyOf"),Fk),S3="-?\\d+";function mp(e,t,n,o,i){for(let u=0;u<e.length;u++){const l=e[u];if(l._tag==="FilterGroup")mp(l.checks,t,n,o,i);else{const d=l.run(t,o,i);if(d&&(n.push(new yN(t,l,d)),l.aborted||(i==null?void 0:i.errors)!=="all"))return}}}const c_="~effect/Schema/Class",x3="~structural";function w3(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 u=Array.isArray(i)?i.every(o):Object.keys(i).every(l=>o(i[l]));return t.delete(i),u&&n.add(i),u}}const k3=new Ga([],()=>(e,t)=>w3(e)?it(e):Qe(new gr(t,Me(e))),{typeConstructor:{_tag:"effect/Json"},generation:{runtime:"Schema.Json",Type:"Schema.Json"},expected:"JSON value",toCodecJson:()=>new Tt(Um,Fm())}),_3=new Tt(Dm,new _n(ri(),cn(()=>null))),E3=new Tt(k3,Fm()),C3=b1,aa=dm,P3=Qc,gp=fm,b3=cM,l_=yM,I3=Symbol.for("effect/MutableList/Empty"),R3=()=>({head:void 0,tail:void 0,length:0}),FS=()=>({array:[],mutable:!0,offset:0,next:void 0}),yp=(e,t)=>{e.tail?e.tail.mutable||(e.tail.next=FS(),e.tail=e.tail.next):e.head=e.tail=FS(),e.tail.array.push(t),e.length++},T3=(e,t)=>O3(e,dr(t),!Array.isArray(t)),O3=(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},Ac=e=>{e.head=e.tail=void 0,e.length=0},f_=(e,t)=>{var u;if(t<=0||!e.head)return[];if(t=Math.min(t,e.length),t===e.length&&((u=e.head)==null?void 0:u.offset)===0&&!e.head.next){const l=e.head.array;return Ac(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&&Ac(e),n;i=i.next}return Ac(e),n},M3=e=>{if(!e.head)return I3;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:Ac(e)),t},L3="~effect/Queue",N3="~effect/Queue/Enqueue",A3="~effect/Queue/Dequeue",wh={_A:Ee,_E:Ee},j3={[L3]:wh,[N3]:wh,[A3]:wh,...ms,toJSON(){return{_id:"effect/Queue",state:this.state._tag,size:V3(this)}}},$3=e=>Be(t=>{const n=Object.create(j3);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=R3(),n.scheduleRunning=!1,n.state={_tag:"Open",takers:new Set,offers:new Set,awaiters:new Set},Ce(n)}),F3=e=>$3({capacity:e}),D3=(e,t)=>St(()=>{if(e.state._tag!=="Open")return Ce(dr(t));const n=U3(e,t);return n.length===0?ot([]):e.strategy==="dropping"?Ce(n):Q3(e,n)}),U3=(e,t)=>{if(e.state._tag!=="Open")return dr(t);if(e.capacity===Number.POSITIVE_INFINITY||e.strategy==="sliding")return T3(e.messages,t),e.strategy==="sliding"&&f_(e.messages,e.messages.length-e.capacity),US(e),[];const n=e.capacity<=0?e.state.takers.size:e.capacity-e.messages.length;if(n===0)return dr(t);const o=[];let i=0;for(const u of t)i<n?yp(e.messages,u):o.push(u),i++;return US(e),o},ua=ne(2,(e,t)=>yt(()=>z3(e,t))),z3=(e,t)=>{if(e.state._tag!=="Open")return!1;const n=An(t),o=CO(n,W3);return e.state.offers.size===0&&e.messages.length===0?(h_(e,o),!0):(e.state={...e.state,_tag:"Closing",exit:o},!0)},DS=e=>ua(e,Dw(nm())),B3=e=>d_(e,1,Number.POSITIVE_INFINITY),d_=(e,t,n)=>St(()=>K3(e,t,n)??Ba(J3(e),d_(e,1,n))),V3=e=>e.state._tag==="Done"?0:e.messages.length,q3=ot(!0),W3=pr(nm()),H3=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($n),e.messages.length===0)break}},US=e=>{e.scheduleRunning||e.state._tag==="Done"||e.state.takers.size===0||(e.scheduleRunning=!0,e.dispatcher.scheduleTask(()=>H3(e),0))},K3=(e,t,n)=>{if(e.state._tag==="Done")return e.state.exit;if(n<=0||t<=0)return ot([]);if(e.capacity<=0&&e.state.offers.size>0){e.capacity=1,kh(e),e.capacity=0;const o=[M3(e.messages)];return kh(e),ot(o)}if(t=Math.min(t,e.capacity||1),t<=e.messages.length){const o=f_(e.messages,n);return kh(e),ot(o)}},Q3=(e,t)=>er(n=>{if(e.state._tag!=="Open")return n(ot(t));const o={_tag:"Array",remaining:t,offset:0,resume:n};return e.state.offers.add(o),yt(()=>{e.state._tag==="Open"&&e.state.offers.delete(o)})}),kh=e=>{if(e.state._tag==="Done")return kS(e.state.exit.cause);if(e.state.offers.size===0)return e.state._tag==="Closing"&&e.messages.length===0?(h_(e,e.state.exit),kS(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")yp(e.messages,n.message),t--,n.resume(q3),e.state.offers.delete(n);else{for(;n.offset<n.remaining.length;n.offset++){if(t===0)return!1;yp(e.messages,n.remaining[n.offset]),t--}n.resume(ot([])),e.state.offers.delete(n)}}return!1},J3=e=>er(t=>e.state._tag==="Done"?t(e.state.exit):(e.state.takers.add(t),yt(()=>{e.state._tag!=="Done"&&e.state.takers.delete(t)}))),h_=(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()},G3="~effect/Channel",Y3={[G3]:{_Env:Ee,_InErr:Ee,_InElem:Ee,_OutErr:Ee,_OutElem:Ee},pipe(){return At(this,arguments)}},Xa=e=>{const t=Object.create(Y3);return t.transform=(n,o)=>Oa(e(n,o),i=>it(ML(i))),t},X3=(e,t)=>Xa((n,o)=>kn(Za(e)(n,o),i=>t(i,o))),Z3=e=>Xa((t,n)=>e),Za=e=>e.transform,eA=e=>Xa((t,n)=>hr(()=>Za(e())(t,n))),tA=e=>Z3(it(B3(e))),nA=ne(2,(e,t)=>X3(e,n=>vn(()=>{let o=0;return vs(n,i=>t(i,o++))}))),rA=e=>Xa((t,n)=>{let o;return it(hr(()=>o||e.pipe(Jc(n),kn(i=>Za(i)(t,n)),kn(i=>o=i))))}),sA=(e,t,n)=>hr(()=>{const o=Cm(),i=Za(e)(Hs(),o);return ti(kn(i,t),it).pipe(Pk(u=>Ul(o,u)))}),oA=ne(2,(e,t)=>Xa((n,o)=>vs(Ks(Za(e)(n,o),t),Ks(t)))),iA=ne(2,(e,t)=>sA(e,n=>bk(kn(n,t),{disableYield:!0}))),ci=e=>e,ca=hs(e=>{var t;switch(e._tag){case"Declaration":{const n=(t=e.annotations)==null?void 0:t[c_];if(vl(n)){const o=n(e.typeParameters),i=ca(o.to);return Pt(e,i===o.to?[o]:[new Tt(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?Pt(ca(n),o):ca(n)});case"Suspend":return e.recur(ca);default:return e}});function Wl(e){const t=ca(ol(e.ast)),n=Jm(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 p_(e){const t=Wl(e);return(n,o)=>XM(Ik(t(n,o)))}function aA(e){const t=Wl(e);return(n,o)=>jm(io(t(n,o),i=>new Error(i.toString(),{cause:i})))}function to(e){return Jm(e.ast)}function uA(e){return fA(to(e))}const cA=uA;function lA(e){return Jm(Js(e.ast))}function Jm(e){const t=jc(e);return(n,o)=>qo(t(Me(n),o??$N),i=>i._tag==="None"?Qe(new el(i)):it(i.value))}function fA(e){return(t,n)=>jm(io(e(t,n),o=>new Error(o.toString(),{cause:o})))}const jc=hs(e=>{var i;let t;const n=(i=Tk(e))==null?void 0:i.parseOptions;if(!e.context&&!e.encoding&&!e.checks)return(u,l)=>(t??(t=e.getParser(jc)),n&&(l={...l,...n}),t(u,l));const o=NN(e)||AN(e)||Uk(e)&&e.typeParameters.length>0;return(u,l)=>{n&&(l={...l,...n});const d=e.encoding;let m;if(d){const y=d,h=y.length;for(let v=h-1;v>=0;v--){const x=y[v],w=x.to,k=jc(w);if(m=m?qo(m,b=>k(b,l)):k(u,l),x.transformation._tag==="Transformation"){const b=x.transformation.decode;m=qo(m,B=>b.run(B,l))}else m=x.transformation.decode(m,l)}m=io(m,v=>new vN(e,u,v))}t??(t=e.getParser(jc));let g=m?qo(m,y=>t(y,l)):t(u,l);if(e.checks&&!(l!=null&&l.disableChecks)){const y=e.checks;(l==null?void 0:l.errors)==="all"&&o&&fs(u)&&(g=lN(g,h=>{const v=[];mp(y.filter(w=>{var k;return(k=w.annotations)==null?void 0:k[x3]}),u.value,v,e,l);const x=tS(v)?h._tag==="Composite"&&h.ast===e?new Bt(e,h.actual,[...h.issues,...v]):new Bt(e,u,[h,...v]):h;return Qe(x)})),g=qo(g,h=>{if(fs(h)){const v=h.value,x=[];if(mp(y,v,x,e,l),tS(x))return Qe(new Bt(e,h,x))}return it(h)})}return g}}),vp="~effect/Schema/Schema",dA={[vp]:vp,pipe(){return At(this,arguments)},annotate(e){return this.rebuild(Yk(this.ast,e))},annotateKey(e){return this.rebuild(e_(this.ast,e))},check(...e){return this.rebuild(Qm(this.ast,e))}};function Gm(e,t){const n=Object.create(dA);return t&&Object.assign(n,t),n.ast=e,n.rebuild=o=>Gm(o,t),n.makeEffect=Iw(Wl(n),io(o=>new Hl(o))),n.make=aA(n),n.makeOption=p_(n),n}const zS="~effect/Schema/SchemaError";var Lx;Lx=zS;class Hl{constructor(t){M(this,Lx,zS);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 hA=mA(pA);function pA(e){switch(e._tag){case"BigInt":case"Symbol":case"UniqueSymbol":return 0;default:return 1}}function mA(e){return t=>{const n=new Map;for(let u=0;u<t.length;u++)n.set(us(t[u]),u);const o=[...t].sort((u,l)=>{u=us(u),l=us(l);const d=e(u),m=e(l);return d!==m?d-m:n.get(u)-n.get(l)});return o.some((u,l)=>u!==t[l])?o:t}}const ga=vp;function Kl(){return(e,t,n)=>We(new Ga(e.map(Hk),o=>t(o.map(i=>We(i))),n))}function m_(e,t){return Kl()([],()=>(n,o)=>e(n)?it(n):Qe(new gr(o,Me(n))),t)}function BS(e){const t=to(e);return(n,o)=>io(t(n,o),i=>new Hl(i))}const gA=cA;function yA(e){const t=lA(e);return(n,o)=>io(t(n,o),i=>new Hl(i))}const vA=yA,We=Gm;function Ym(e){return Ue(e,ga)&&e[ga]===ga}const Kt=ci(e=>We(n_(e.ast),{schema:e})),li=ci(e=>Kt(y_(e)));function un(e){const t=We(new ma(e),{literal:e,transform(n){return t.pipe(al(un(n),{decode:cn(()=>n),encode:cn(()=>e)}))}});return t}const VS=We(qN),qS=We(HN),SA=We(Um),xA=We(Dm),wA=We(UN),xe=We(Bk),Xm=We(Vk),cs=We(YN),il=We(BN);function Zm(e,t){return We(e,{fields:t,mapFields(n,o){const i=n(this.fields);return Zm(qm(i,o!=null&&o.unsafePreserveChecks?this.ast.checks:void 0),i)}})}function Pe(e){return Zm(qm(e,void 0),e)}const bt=ci(e=>We(new Bl(!1,[],[e.ast]),{schema:e})),kA=ci(e=>We(new Bl(!1,[e.ast],[e.ast]),{schema:e}));function g_(e,t){return We(e,{members:t,mapMembers(n,o){const i=n(this.members);return g_(Wm(i,this.ast.mode,o!=null&&o.unsafePreserveChecks?this.ast.checks:void 0),i)}})}function En(e,t){return g_(Wm(e,"anyOf",void 0),e)}function Nn(e){const t=e.map(un);return We(Wm(t,"anyOf",void 0),{literals:e,members:t,mapMembers(n){return En(n(this.members))},pick(n){return Nn(n)},transform(n){return En(t.map((o,i)=>o.transform(n[i])))}})}const ht=ci(e=>En([e,xA])),y_=ci(e=>En([e,wA]));function al(e,t){return n=>We(f3(n.ast,e.ast,t?$k(t):Fm()),{from:n,to:e})}function _A(e){return t=>We(l3(t.ast,e),{schema:t})}function dn(e){return un(e).pipe(_A(it(e)))}function EA(e,t){return Pe({_tag:dn(e),...t})}function CA(e,t){return m_(n=>n instanceof e,t)}function eu(){return(e,t)=>new Tt(e.ast,$k(t))}const eg=Gk;function PA(e){return eg(t=>globalThis.Number.isFinite(t),{expected:"a finite number",meta:{_tag:"isFinite"},toArbitraryConstraint:{number:{noDefaultInfinity:!0,noNaN:!0}},...e})}function bA(e){const t=SR(e.order),n=e.formatter??pt;return(o,i)=>{var u;return eg(l=>t(l,o),{expected:`a value greater than or equal to ${n(o)}`,...(u=e.annotate)==null?void 0:u.call(e,o),...i})}}const v_=bA({order:t1,annotate:e=>({meta:{_tag:"isGreaterThanOrEqualTo",minimum:e},toArbitraryConstraint:{number:{min:e}}})});function IA(e){return eg(t=>globalThis.Number.isSafeInteger(t),{expected:"an integer",meta:{_tag:"isInt"},toArbitraryConstraint:{number:{isInteger:!0}},...e})}function WS(e,t){const n=Kl()([e,t],([o,i])=>(u,l,d)=>{if(!qM(u))return Qe(new gr(l,Me(u)));switch(u._tag){case"Fail":return Ma(to(o)(u.error,d),{onSuccess:tp,onFailure:m=>new Bt(l,Me(u),[new Yn(["error"],m)])});case"Die":return Ma(to(i)(u.defect,d),{onSuccess:np,onFailure:m=>new Bt(l,Me(u),[new Yn(["defect"],m)])});case"Interrupt":return it(u)}},{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])=>eu()(En([Pe({_tag:un("Fail"),error:o}),Pe({_tag:un("Die"),defect:i}),Pe({_tag:un("Interrupt"),fiberId:y_(De)})]),zl({decode:u=>{switch(u._tag){case"Fail":return tp(u.error);case"Die":return np(u.defect);case"Interrupt":return rp(u.fiberId)}},encode:Ee})),toArbitrary:([o,i])=>S_(o,i),toEquivalence:([o,i])=>x_(o,i),toFormatter:([o,i])=>w_(o,i)});return We(n.ast,{error:e,defect:t})}function S_(e,t){return(n,o)=>n.oneof(o!=null&&o.isSuspend?{maxDepth:2,depthIdentifier:"Cause.Failure"}:{},n.constant(rp()),n.integer({min:1}).map(rp),e.map(i=>tp(i)),t.map(i=>np(i)))}function x_(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 w_(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 HS(e,t){const n=Kl()([e,t],([o,i])=>{const u=bt(WS(o,i));return(l,d,m)=>VM(l)?Ma(to(u)(l.reasons,m),{onSuccess:ep,onFailure:g=>new Bt(d,Me(l),[new Yn(["failures"],g)])}):Qe(new gr(d,Me(l)))},{typeConstructor:{_tag:"effect/Cause"},generation:{runtime:"Schema.Cause(?, ?)",Type:"Cause.Cause<?, ?>",importDeclaration:'import * as Cause from "effect/Cause"'},expected:"Cause",toCodec:([o,i])=>eu()(bt(WS(o,i)),zl({decode:ep,encode:({reasons:u})=>u})),toArbitrary:([o,i])=>k_(o,i),toEquivalence:([o,i])=>__(o,i),toFormatter:([o,i])=>E_(o,i)});return We(n.ast,{error:e,defect:t})}function k_(e,t){return(n,o)=>n.array(S_(e,t)(n,o)).map(ep)}function __(e,t){const n=D2(x_(e,t));return(o,i)=>n(o.reasons,i.reasons)}function E_(e,t){const n=w_(e,t);return o=>`Cause([${o.reasons.map(n).join(", ")}])`}const C_=Pe({message:xe,name:Kt(xe),stack:Kt(xe)}),RA=CA(globalThis.Error,{typeConstructor:{_tag:"Error"},generation:{runtime:"Schema.Error",Type:"globalThis.Error"},expected:"Error",toCodecJson:()=>eu()(C_,Dk()),toArbitrary:()=>e=>e.string().map(t=>new globalThis.Error(t))}),KS=new _n(ri(),cn(e=>{try{return JSON.parse(JSON.stringify(e))}catch{return pt(e)}})),tr=En([C_.pipe(al(RA,Dk())),qS.pipe(al(SA.annotate({toCodecJson:()=>eu()(qS,KS),toArbitrary:()=>e=>e.json()}),KS))]);function TA(e,t,n){const o=Kl()([e,t,n],([i,u,l])=>{const d=HS(u,l);return(m,g,y)=>{if(!QM(m))return Qe(new gr(g,Me(m)));switch(m._tag){case"Success":return Ma(to(i)(m.value,y),{onSuccess:xh,onFailure:h=>new Bt(g,Me(m),[new Yn(["value"],h)])});case"Failure":return Ma(to(d)(m.cause,y),{onSuccess:da,onFailure:h=>new Bt(g,Me(m),[new Yn(["cause"],h)])})}}},{typeConstructor:{_tag:"effect/Exit"},generation:{runtime:"Schema.Exit(?, ?, ?)",Type:"Exit.Exit<?, ?, ?>",importDeclaration:'import * as Exit from "effect/Exit"'},expected:"Exit",toCodec:([i,u,l])=>eu()(En([Pe({_tag:un("Success"),value:i}),Pe({_tag:un("Failure"),cause:HS(u,l)})]),zl({decode:d=>d._tag==="Success"?xh(d.value):da(d.cause),encode:d=>YM(d)?{_tag:"Success",value:d.value}:{_tag:"Failure",cause:d.cause}})),toArbitrary:([i,u,l])=>(d,m)=>d.oneof(m!=null&&m.isSuspend?{maxDepth:2,depthIdentifier:"Exit"}:{},i.map(g=>xh(g)),k_(u,l)(d,m).map(g=>da(g))),toEquivalence:([i,u,l])=>{const d=__(u,l);return(m,g)=>{if(m._tag!==g._tag)return!1;switch(m._tag){case"Success":return i(m.value,g.value);case"Failure":return d(m.cause,g.cause)}}},toFormatter:([i,u,l])=>{const d=E_(u,l);return m=>{switch(m._tag){case"Success":return`Exit.Success(${i(m.value)})`;case"Failure":return`Exit.Failure(${d(m.cause)})`}}}});return We(o.ast,{value:e,error:t,defect:n})}const De=Xm.check(PA()),OA=Xm.check(IA()),MA=globalThis.Symbol.for("immer-draftable");function tg(e,t,n,o,i){var m,g,y,h;const u=NA(n,t,o),l=P_(t),d=(h=class extends e{constructor(...[v,x]){v=v??{};const w=n.make(v,x);super({...v,...w},{...x,disableChecks:!0})}get[(y=ga,g=l,m=MA,g)](){return l}static get ast(){return u(this).ast}static pipe(){return At(this,arguments)}static rebuild(v){return u(this).rebuild(v)}static make(v,x){return new this(v,x)}static makeOption(v,x){return p_(u(this))(v??{},x)}static makeEffect(v,x){return io(Wl(u(this))(v??{},x),w=>new Hl(w))}static annotate(v){return this.rebuild(Yk(this.ast,v))}static annotateKey(v){return this.rebuild(e_(this.ast,v))}static check(...v){return this.rebuild(Qm(this.ast,v))}static extend(v){return(x,w)=>{const k={...n.fields,...x};return tg(this,v,Zm(qm(k,n.ast.checks,{identifier:v}),k),w,i)}}static mapFields(v,x){return n.mapFields(v,x)}},M(h,y,ga),M(h,m,!0),M(h,"identifier",t),M(h,"fields",n.fields),h);return i!==void 0&&Object.assign(d.prototype,i(t)),d}function LA(e){return new _n(cn(t=>new e(t)),ri())}function P_(e){return`~effect/Schema/Class/${e}`}function NA(e,t,n){let o;return i=>{if(o===void 0){const u=LA(i),l=We(new Ga([e.ast],()=>(d,m)=>d instanceof i||Ue(d,P_(t))?it(d):Qe(new gr(m,Me(d))),{identifier:t,[c_]:([d])=>new Tt(d,u),toCodec:([d])=>new Tt(d.ast,u),toArbitrary:([d])=>()=>d.map(m=>new i(m)),toFormatter:([d])=>m=>`${i.identifier}(${d(m)})`,"~sentinels":Hm(e.ast),...n}));o=e.pipe(al(l,u))}return o}}function ng(e){return Ym(e)}const AA=e=>(t,n)=>{const o=ng(t)?t:Pe(t);return tg(dL,e,o,n,i=>({toString(){return`${i}(${pt({...this})})`}}))},Dn=e=>(t,n)=>{const o=ng(t)?t:Pe(t);return tg(Bw,e,o,n,u=>({name:u}))},jA=e=>(t,n,o)=>Dn(e)(ng(n)?n.mapFields(i=>({_tag:dn(t),...i}),{unsafePreserveChecks:!0}):EA(t,n),o);function _h(e){return We(b_(e.ast))}const b_=i_(e=>{const t=$A(e,b_);return t!==e&&Or(e)?t_(t):t});function $A(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(vl(i)){const u=Uk(e)?e.typeParameters.map(m=>Gm(us(m))):[],l=i(u),d=t(l.to);return Pt(e,d===l.to?[l]:[new Tt(d,l.transformation)])}return Pt(e,[_3])}case"Unknown":case"ObjectKeyword":return Pt(e,[E3]);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=hA(e.types);return i!==e.types?new Ya(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 FA="~effect/Stream",DA={_R:Ee,_E:Ee,_A:Ee},UA={[FA]:DA,pipe(){return At(this,arguments)}},zA=e=>{const t=Object.create(UA);return t.channel=e,t},BA="~effect/Stream",VA=e=>Ue(e,BA),tu=zA,qA=e=>e.channel,WA=e=>tu(eA(()=>e().channel)),HA=e=>tu(tA(e)),KA=e=>tu(rA(vs(e,qA))),QS=ne(2,(e,t)=>WA(()=>{let n=0;return tu(nA(e.channel,s1(o=>t(o,n++))))})),QA=ne(2,(e,t)=>tu(oA(e.channel,t))),JA=ne(2,(e,t)=>iA(e.channel,n=>{let o=0;return wk({while:()=>o<n.length,body:()=>t(n[o++]),step:Da})})),Sp="~effect/FiberSet",GA=e=>Ue(e,Sp),YA={[Sp]:Sp,[Symbol.iterator](){return this.state._tag==="Closed"?bR():this.state.backing[Symbol.iterator]()},...ms,toJSON(){return{_id:"FiberMap",state:this.state}}},XA=(e,t)=>{const n=Object.create(YA);return n.state={_tag:"Open",backing:e},n.deferred=t,n},ZA=()=>Ek(vn(()=>XA(new Set,_m())),e=>hr(()=>{const t=e.state;if(t._tag==="Closed")return rt;e.state={_tag:"Closed"};const n=t.backing;return P3(n).pipe(nL(e.deferred))})),I_=-1,ej=mT(yT(KM,gT(I_))),tj=ne(e=>GA(e[0]),(e,t,n)=>{if(e.state._tag==="Closed"){t.interruptUnsafe(I_);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),ck(o)&&((n==null?void 0:n.propagateInterruption)===!0?!ej(o.cause):!WM(o.cause))&&ha(e.deferred,o))})}),nj=(function(){let e;return()=>(e===void 0&&(e=cp(up)),e)})(),rj=e=>()=>vs(Xc(),t=>{const n=Zc(t);return(o,i)=>{if(e.state._tag==="Closed")return nj();const u=n(o,i);return tj(e,u),u}}),JS=e=>Em(e.deferred),sj="~effect/interfaces/PrimaryKey",GS="~effect/ManagedRuntime",oj=(e,t)=>{const n=(t==null?void 0:t.memoMap)??bm(),o=Cm("parallel"),i=Gc(o,"sequential"),u={onFiberStart:b3(o)},l=y=>y?{...y,onFiberStart:y.onFiberStart?h=>{u.onFiberStart(h),y.onFiberStart(h)}:u.onFiberStart}:u;let d;const m=Yc(y=>(d||(d=cp(jL(Im(e,n,i),h=>vn(()=>{g.cachedContext=h})),{...u,scheduler:y.currentScheduler})),NL(C3(d)))),g={[GS]:GS,memoMap:n,scope:o,contextEffect:m,cachedContext:void 0,context(){return g.cachedContext===void 0?pa(g.contextEffect):Promise.resolve(g.cachedContext)},dispose(){return pa(g.disposeEffect)},disposeEffect:hr(()=>(g.contextEffect=LL("ManagedRuntime disposed"),g.cachedContext=void 0,Ul(g.scope,uk))),runFork(y,h){return g.cachedContext===void 0?cp(Do(g,y),l(h)):Zc(g.cachedContext)(y,l(h))},runCallback(y,h){return g.cachedContext===void 0?nN(Do(g,y),l(h)):tN(g.cachedContext)(y,l(h))},runSyncExit(y){return g.cachedContext===void 0?Ik(Do(g,y)):aN(g.cachedContext)(y)},runSync(y){return g.cachedContext===void 0?jm(Do(g,y)):iN(g.cachedContext)(y)},runPromiseExit(y,h){return g.cachedContext===void 0?sN(Do(g,y),l(h)):oN(g.cachedContext)(y,l(h))},runPromise(y,h){return g.cachedContext===void 0?pa(Do(g,y),l(h)):rN(g.cachedContext)(y,l(h))}};return g};function Do(e,t){return kn(e.contextEffect,n=>Ks(t,n))}const xp="~effect/rpc/RpcSchema/StreamSchema";function R_(e){return Ue(e,xp)}function T_(e){return R_(e)?Me({success:e.success,error:e.error}):jn()}const ij=m_(VA);function aj(e,t){return We(ij.ast,{[xp]:xp,success:e,error:t})}const YS="~effect/rpc/Rpc",uj={[YS]:YS,pipe(){return At(this,arguments)},setSuccess(e){return ts({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:e,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},setError(e){return ts({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:e,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},setPayload(e){return ts({_tag:this._tag,payloadSchema:Ym(e)?e:Pe(e),successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},middleware(e){return ts({_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 ts({_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 ts({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,middlewares:this.middlewares,annotations:gs(this.annotations,e,t)})},annotateMerge(e){return ts({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,middlewares:this.middlewares,annotations:Zo(this.annotations,e)})}},ts=e=>{function t(){}return Object.setPrototypeOf(t,uj),Object.assign(t,e),t.key=`effect/rpc/Rpc/${e._tag}`,t},fi=(e,t)=>{const n=(t==null?void 0:t.success)??il,o=(t==null?void 0:t.error)??VS,i=(t==null?void 0:t.defect)??tr;let u;return t!=null&&t.primaryKey?u=class extends AA(`effect/rpc/Rpc/${e}`)(t.payload){[sj](){return t.primaryKey(this)}}:u=Ym(t==null?void 0:t.payload)?t==null?void 0:t.payload:t!=null&&t.payload?Pe(t==null?void 0:t.payload):il,ts({_tag:e,payloadSchema:u,successSchema:t!=null&&t.stream?aj(n,o):n,errorSchema:t!=null&&t.stream?VS:o,defectSchema:i,annotations:Gn(),middlewares:new Set})},Eh=new WeakMap,cj=e=>{if(Eh.has(e))return Eh.get(e);const t=e,n=new Set([t.errorSchema]),o=T_(t.successSchema);fs(o)&&n.add(o.value.error);for(const u of t.middlewares)n.add(u.error);const i=TA(fs(o)?il:t.successSchema,En([...n]),t.defectSchema);return Eh.set(e,i),i},lj="~effect/rpc/Rpc/Wrapper",fj=e=>lj in e,XS=Symbol.for("~effect/http/Headers"),Na=Object.create(null);Object.defineProperties(Na,{[XS]:{value:XS},[xl]:{value(e){return mj(this,Ws(e,gj))}},toJSON:{value(){return wl(this)}},[Yt]:{value(e){return hj(this,e)}},[Gt]:{value(){return Gp(this)}},toString:{value:Yv.toString},[Xs]:{value:Yv[Xs]}});const dj=e=>Object.assign(Object.create(Na),e),hj=OR(F2()),rg=Object.create(Na),pj=e=>{if(e===void 0)return rg;if(Symbol.iterator in e){const n=Object.create(Na);for(const[o,i]of e)n[o.toLowerCase()]=i;return n}const t=Object.create(Na);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},ZS=ne(2,(e,t)=>{const n=dj(e);return Object.assign(n,t),n}),mj=ne(2,(e,t)=>{const n={...e},o=i=>{if(typeof i=="string"){const u=i.toLowerCase();u in e&&(n[u]=bS(e[u]))}else for(const u in e)i.test(u)&&(n[u]=bS(e[u]))};if(Array.isArray(t))for(let i=0;i<t.length;i++)o(t[i]);else o(t);return n}),gj=Xe("effect/Headers/CurrentRedactedNames",{defaultValue:()=>["authorization","cookie","set-cookie","x-api-key"]}),yj="~effect/http/HttpClientError";class sg extends Dn(yj)({_tag:dn("HttpError"),kind:Nn(["EncodeError","DecodeError","TransportError","InvalidUrlError","StatusCodeError","EmptyBodyError"]),cause:li(tr)}){static fromHttpClientError(t){return new sg({_tag:"HttpError",kind:t.reason._tag,cause:t.reason})}}const ex="~effect/socket/Socket",og=Fn("effect/socket/Socket"),vj=e=>og.of({[ex]:ex,runRaw:e.runRaw,run:e.run??((t,n)=>e.runRaw(o=>typeof o=="string"?t(Sj.encode(o)):o instanceof Uint8Array?t(o):t(new Uint8Array(o)),n)),runString:e.runString??(e.run?(t,n)=>e.run(o=>t(Ch.decode(o)),n):(t,n)=>e.runRaw(o=>typeof o=="string"?t(o):o instanceof Uint8Array?t(Ch.decode(o)):t(Ch.decode(new Uint8Array(o))),n)),writer:e.writer}),Sj=new TextEncoder,Ch=new TextDecoder,xj="~effect/socket/Socket/CloseEvent",wj=e=>Ue(e,xj),$c="~effect/socket/Socket/SocketError",kj=e=>Ue(e,$c);class O_ extends Dn("effect/socket/Socket/SocketReadError")({_tag:dn("SocketReadError"),cause:tr}){constructor(){super(...arguments);M(this,"message","An error occurred during Read")}}class _j extends Dn("effect/socket/Socket/SocketWriteError")({_tag:dn("SocketWriteError"),cause:tr}){constructor(){super(...arguments);M(this,"message","An error occurred during Write")}}class ul extends Dn("effect/socket/Socket/SocketOpenError")({_tag:dn("SocketOpenError"),kind:Nn(["Unknown","Timeout"]),cause:tr}){get message(){return this.kind==="Timeout"?'timeout waiting for "open"':"An error occurred during Open"}}class cl extends Dn("effect/socket/Socket/SocketCloseError")({_tag:dn("SocketCloseError"),code:Xm,closeReason:li(xe)}){static filterClean(t){return function(n){return Qo.is(n)&&n.reason._tag==="SocketCloseError"&&t(n.reason.code)?Lr(n.reason):Jn(n)}}get message(){return this.closeReason?`${this.code}: ${this.closeReason}`:`${this.code}`}}const M_=En([O_,_j,ul,cl]);var Nx,Ax;class Qo extends(Ax=jA($c)("SocketError",{_tag:dn("SocketError"),reason:M_}),Nx=$c,Ax){constructor(n){var t=(...k4)=>(super(...k4),M(this,Nx,$c),M(this,"message",this.reason.message),this);"cause"in n.reason?t({...n,cause:n.reason.cause}):t(n)}static is(n){return kj(n)}}const Ej=e=>!0;class Cj extends Fn()("~effect/socket/Socket/WebSocket"){}class L_ extends Fn()("@effect/platform/Socket/WebSocketConstructor"){}const Pj=Rm(L_)((e,t)=>new globalThis.WebSocket(e,t)),bj=(e,t)=>L_.use(n=>Ij(Ek((typeof e=="string"?it(e):e).pipe(vs(o=>n(o,t==null?void 0:t.protocols))),o=>vn(()=>o.close(1e3))),t)),Ij=(e,t)=>Yc(n=>{let o;const i=l_(!1),u=n.context,l=(t==null?void 0:t.closeCodeIsError)??Ej,d=(y,h)=>JL(Qs(function*(v){const x=yield*ZA().pipe(Jc(v)),w=yield*Jc(e,v),k=yield*QL(rj(x)(),Cj,w);let b=!1;function B(P){if(P.data instanceof Blob){const F=kn(RL(()=>P.data.arrayBuffer()),$=>{const D=y(new Uint8Array($));return Ko(D)?D:rt});return k(F)}const L=y(P.data);Ko(L)&&k(L)}function _(P){w.removeEventListener("message",B),w.removeEventListener("close",A),ha(x.deferred,Qe(new Qo({reason:b?new O_({cause:P}):new ul({kind:"Unknown",cause:P})})))}function A(P){const L=typeof P.code=="number"?P.code:1001;w.removeEventListener("message",B),w.removeEventListener("error",_),ha(x.deferred,Qe(new Qo({reason:new cl({code:L,closeReason:P.reason})})))}if(w.addEventListener("close",A,{once:!0}),w.addEventListener("error",_,{once:!0}),w.addEventListener("message",B),w.readyState!==1){const P=_m();w.addEventListener("open",()=>{b=!0,ha(P,rt)},{once:!0}),yield*Em(P).pipe(BL({duration:(t==null?void 0:t.openTimeout)??1e4,orElse:()=>Qe(new Qo({reason:new ul({kind:"Timeout",cause:new Error('timeout waiting for "open"')})}))}),kk(JS(x)))}return b=!0,o=w,i.openUnsafe(),h!=null&&h.onOpen&&(yield*h.onOpen),yield*$L(JS(x),cl.filterClean(P=>!l(P)),()=>rt)})).pipe(KL(v=>Zo(u,v)),Ck(vn(()=>{i.closeUnsafe(),o=void 0}))),g=it(y=>i.whenOpen(vn(()=>{const h=o;wj(y)?h.close(y.code,y.reason):h.send(y)})));return it(vj({runRaw:d,writer:g}))}),Rj=Iw(bj,sp(og));class N_ extends Fn()("effect/workers/Transferable/Collector"){}const Tj=()=>{let e=[];const t=i=>{e.push(...i)},n=()=>e,o=()=>{const i=e;return e=[],i};return N_.of({addAllUnsafe:t,addAll:i=>vn(()=>t(i)),readUnsafe:n,read:vn(n),clearUnsafe:o,clear:vn(o)})};class Oj extends Dn("effect/workers/WorkerError/WorkerSpawnError")({_tag:dn("WorkerSpawnError"),message:xe,cause:li(tr)}){}class Mj extends Dn("effect/workers/WorkerError/WorkerSendError")({_tag:dn("WorkerSendError"),message:xe,cause:li(tr)}){}class Lj extends Dn("effect/workers/WorkerError/WorkerReceiveError")({_tag:dn("WorkerReceiveError"),message:xe,cause:li(tr)}){}class Nj extends Dn("effect/workers/WorkerError/WorkerUnknownError")({_tag:dn("WorkerUnknownError"),message:xe,cause:li(tr)}){}const Aj=En([Oj,Mj,Lj,Nj]),Ph="~effect/rpc/RpcClientError";class wp extends Dn("effect/rpc/RpcClientError/RpcClientDefect")({_tag:dn("RpcClientDefect"),message:xe,cause:tr}){}var jx,$x;class tx extends($x=Dn(Ph)({_tag:dn("RpcClientError"),reason:En([Aj,M_,sg,wp])}),jx=Ph,$x){constructor(){super(...arguments);M(this,jx,Ph)}get message(){return`${this.reason._tag}: ${this.reason.message}`}}const xc=e=>typeof e=="bigint"?e:BigInt(e),jj={_tag:"Ping"};var kp;try{kp=new TextDecoder}catch{}var ce,fr,N=0,qe={},Oe,os,Mn=0,ur=0,Ct,Mr,ln=[],Te,nx={useRecords:!1,mapsAsObjects:!0};class A_{}const j_=new A_;j_.name="MessagePack 0xC1";var ls=!1,rx=2,$j;class Aa{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(ce)return B_(()=>(Ep(),this?this.unpack(t,n):Aa.prototype.unpack.call(nx,t,n)));!t.buffer&&t.constructor===ArrayBuffer&&(t=typeof Buffer<"u"?Buffer.from(t):new Uint8Array(t)),typeof n=="object"?(fr=n.end||t.length,N=n.start||0):(N=0,fr=n>-1?n:t.length),ur=0,os=null,Ct=null,ce=t;try{Te=t.dataView||(t.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength))}catch(o){throw ce=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 Aa){if(qe=this,this.structures)return Oe=this.structures,wc(n);(!Oe||Oe.length>0)&&(Oe=[])}else qe=nx,(!Oe||Oe.length>0)&&(Oe=[]);return wc(n)}unpackMultiple(t,n){let o,i=0;try{ls=!0;let u=t.length,l=this?this.unpack(t,u):Ql.unpack(t,u);if(n){if(n(l,i,N)===!1)return;for(;N<u;)if(i=N,n(wc(),i,N)===!1)return}else{for(o=[l];N<u;)i=N,o.push(wc());return o}}catch(u){throw u.lastPosition=i,u.values=o,u}finally{ls=!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 u=t[o];u&&(u.isShared=!0,o>=32&&(u.highByte=o-32>>5))}t.sharedLength=t.length;for(let o in n||[])if(o>=0){let i=t[o],u=n[o];u&&(i&&((t.restoreStructures||(t.restoreStructures=[]))[o]=i),t[o]=u)}return this.structures=t}decode(t,n){return this.unpack(t,n)}}function wc(e){try{if(!qe.trusted&&!ls){let n=Oe.sharedLength||0;n<Oe.length&&(Oe.length=n)}let t;if(qe.randomAccessStructure&&ce[N]<64&&ce[N]>=32&&$j||(t=lt()),Ct&&(N=Ct.postBundlePosition,Ct=null),ls&&(Oe.restoreStructures=null),N==fr)Oe&&Oe.restoreStructures&&sx(),Oe=null,ce=null,Mr&&(Mr=null);else{if(N>fr)throw new Error("Unexpected end of MessagePack data");if(!ls){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&&sx(),Ep(),(t instanceof RangeError||t.message.startsWith("Unexpected end of buffer")||N>fr)&&(t.incomplete=!0),t}}function sx(){for(let e in Oe.restoreStructures)Oe[e]=Oe.restoreStructures[e];Oe.restoreStructures=null}function lt(){let e=ce[N++];if(e<160)if(e<128){if(e<64)return e;{let t=Oe[e&63]||qe.getStructures&&$_()[e&63];return t?(t.read||(t.read=ig(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=D_();o==="__proto__"&&(o="__proto_"),t[o]=lt()}return t}else{let t=new Map;for(let n=0;n<e;n++)t.set(lt(),lt());return t}else{e-=144;let t=new Array(e);for(let n=0;n<e;n++)t[n]=lt();return qe.freezeData?Object.freeze(t):t}else if(e<192){let t=e-160;if(ur>=N)return os.slice(N-Mn,(N+=t)-Mn);if(ur==0&&fr<140){let n=t<16?ag(t):F_(t);if(n!=null)return n}return _p(t)}else{let t;switch(e){case 192:return null;case 193:return Ct?(t=lt(),t>0?Ct[1].slice(Ct.position1,Ct.position1+=t):Ct[0].slice(Ct.position0,Ct.position0-=t)):j_;case 194:return!1;case 195:return!0;case 196:if(t=ce[N++],t===void 0)throw new Error("Unexpected end of buffer");return bh(t);case 197:return t=Te.getUint16(N),N+=2,bh(t);case 198:return t=Te.getUint32(N),N+=4,bh(t);case 199:return js(ce[N++]);case 200:return t=Te.getUint16(N),N+=2,js(t);case 201:return t=Te.getUint32(N),N+=4,js(t);case 202:if(t=Te.getFloat32(N),qe.useFloat32>2){let n=ug[(ce[N]&127)<<1|ce[N+1]>>7];return N+=4,(n*t+(t>0?.5:-.5)>>0)/n}return N+=4,t;case 203:return t=Te.getFloat64(N),N+=8,t;case 204:return ce[N++];case 205:return t=Te.getUint16(N),N+=2,t;case 206:return t=Te.getUint32(N),N+=4,t;case 207:return qe.int64AsType==="number"?(t=Te.getUint32(N)*4294967296,t+=Te.getUint32(N+4)):qe.int64AsType==="string"?t=Te.getBigUint64(N).toString():qe.int64AsType==="auto"?(t=Te.getBigUint64(N),t<=BigInt(2)<<BigInt(52)&&(t=Number(t))):t=Te.getBigUint64(N),N+=8,t;case 208:return Te.getInt8(N++);case 209:return t=Te.getInt16(N),N+=2,t;case 210:return t=Te.getInt32(N),N+=4,t;case 211:return qe.int64AsType==="number"?(t=Te.getInt32(N)*4294967296,t+=Te.getUint32(N+4)):qe.int64AsType==="string"?t=Te.getBigInt64(N).toString():qe.int64AsType==="auto"?(t=Te.getBigInt64(N),t>=BigInt(-2)<<BigInt(52)&&t<=BigInt(2)<<BigInt(52)&&(t=Number(t))):t=Te.getBigInt64(N),N+=8,t;case 212:if(t=ce[N++],t==114)return lx(ce[N++]&63);{let n=ln[t];if(n)return n.read?(N++,n.read(lt())):n.noBuffer?(N++,n()):n(ce.subarray(N,++N));throw new Error("Unknown extension "+t)}case 213:return t=ce[N],t==114?(N++,lx(ce[N++]&63,ce[N++])):js(2);case 214:return js(4);case 215:return js(8);case 216:return js(16);case 217:return t=ce[N++],ur>=N?os.slice(N-Mn,(N+=t)-Mn):Dj(t);case 218:return t=Te.getUint16(N),N+=2,ur>=N?os.slice(N-Mn,(N+=t)-Mn):Uj(t);case 219:return t=Te.getUint32(N),N+=4,ur>=N?os.slice(N-Mn,(N+=t)-Mn):zj(t);case 220:return t=Te.getUint16(N),N+=2,ix(t);case 221:return t=Te.getUint32(N),N+=4,ix(t);case 222:return t=Te.getUint16(N),N+=2,ax(t);case 223:return t=Te.getUint32(N),N+=4,ax(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 Fj=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function ig(e,t){function n(){if(n.count++>rx){let i;try{i=e.read=new Function("r","return function(){return "+(qe.freezeData?"Object.freeze":"")+"({"+e.map(u=>u==="__proto__"?"__proto_:r()":Fj.test(u)?u+":r()":"["+JSON.stringify(u)+"]:r()").join(",")+"})}")(lt)}catch{return rx=1/0,n()}return e.read0=i,e.highByte===0&&(e.read=ox(t,e.read)),i()}let o={};for(let i=0,u=e.length;i<u;i++){let l=e[i];l==="__proto__"&&(l="__proto_"),o[l]=lt()}return qe.freezeData?Object.freeze(o):o}return n.count=0,e.read0=n,e.highByte===0?ox(t,n):n}const ox=(e,t)=>function(){let n=ce[N++];if(n===0)return t();let o=e<32?-(e+(n<<5)):e+(n<<5),i=Oe[o]||$_()[o];if(!i)throw new Error("Record id is not defined for "+o);return i.read||(i.read=ig(i,e)),i.read()};function $_(){let e=B_(()=>(ce=null,qe.getStructures()));return Oe=qe._mergeStructures(e,Oe)}var _p=nu,Dj=nu,Uj=nu,zj=nu;function nu(e){let t;if(e<16&&(t=ag(e)))return t;if(e>64&&kp)return kp.decode(ce.subarray(N,N+=e));const n=N+e,o=[];for(t="";N<n;){const i=ce[N++];if((i&128)===0)o.push(i);else if((i&224)===192){const u=ce[N++]&63,l=(i&31)<<6|u;l<128?o.push(65533):o.push(l)}else if((i&240)===224){const u=ce[N++]&63,l=ce[N++]&63,d=(i&31)<<12|u<<6|l;d<2048||d>=55296&&d<=57343?o.push(65533):o.push(d)}else if((i&248)===240){const u=ce[N++]&63,l=ce[N++]&63,d=ce[N++]&63;let m=(i&7)<<18|u<<12|l<<6|d;m<65536||m>1114111?o.push(65533):(m>65535&&(m-=65536,o.push(m>>>10&1023|55296),m=56320|m&1023),o.push(m))}else o.push(65533);o.length>=4096&&(t+=_t.apply(String,o),o.length=0)}return o.length>0&&(t+=_t.apply(String,o)),t}function ix(e){let t=new Array(e);for(let n=0;n<e;n++)t[n]=lt();return qe.freezeData?Object.freeze(t):t}function ax(e){if(qe.mapsAsObjects){let t={};for(let n=0;n<e;n++){let o=D_();o==="__proto__"&&(o="__proto_"),t[o]=lt()}return t}else{let t=new Map;for(let n=0;n<e;n++)t.set(lt(),lt());return t}}var _t=String.fromCharCode;function F_(e){let t=N,n=new Array(e);for(let o=0;o<e;o++){const i=ce[N++];if((i&128)>0){N=t;return}n[o]=i}return _t.apply(String,n)}function ag(e){if(e<4)if(e<2){if(e===0)return"";{let t=ce[N++];if((t&128)>1){N-=1;return}return _t(t)}}else{let t=ce[N++],n=ce[N++];if((t&128)>0||(n&128)>0){N-=2;return}if(e<3)return _t(t,n);let o=ce[N++];if((o&128)>0){N-=3;return}return _t(t,n,o)}else{let t=ce[N++],n=ce[N++],o=ce[N++],i=ce[N++];if((t&128)>0||(n&128)>0||(o&128)>0||(i&128)>0){N-=4;return}if(e<6){if(e===4)return _t(t,n,o,i);{let u=ce[N++];if((u&128)>0){N-=5;return}return _t(t,n,o,i,u)}}else if(e<8){let u=ce[N++],l=ce[N++];if((u&128)>0||(l&128)>0){N-=6;return}if(e<7)return _t(t,n,o,i,u,l);let d=ce[N++];if((d&128)>0){N-=7;return}return _t(t,n,o,i,u,l,d)}else{let u=ce[N++],l=ce[N++],d=ce[N++],m=ce[N++];if((u&128)>0||(l&128)>0||(d&128)>0||(m&128)>0){N-=8;return}if(e<10){if(e===8)return _t(t,n,o,i,u,l,d,m);{let g=ce[N++];if((g&128)>0){N-=9;return}return _t(t,n,o,i,u,l,d,m,g)}}else if(e<12){let g=ce[N++],y=ce[N++];if((g&128)>0||(y&128)>0){N-=10;return}if(e<11)return _t(t,n,o,i,u,l,d,m,g,y);let h=ce[N++];if((h&128)>0){N-=11;return}return _t(t,n,o,i,u,l,d,m,g,y,h)}else{let g=ce[N++],y=ce[N++],h=ce[N++],v=ce[N++];if((g&128)>0||(y&128)>0||(h&128)>0||(v&128)>0){N-=12;return}if(e<14){if(e===12)return _t(t,n,o,i,u,l,d,m,g,y,h,v);{let x=ce[N++];if((x&128)>0){N-=13;return}return _t(t,n,o,i,u,l,d,m,g,y,h,v,x)}}else{let x=ce[N++],w=ce[N++];if((x&128)>0||(w&128)>0){N-=14;return}if(e<15)return _t(t,n,o,i,u,l,d,m,g,y,h,v,x,w);let k=ce[N++];if((k&128)>0){N-=15;return}return _t(t,n,o,i,u,l,d,m,g,y,h,v,x,w,k)}}}}}function ux(){let e=ce[N++],t;if(e<192)t=e-160;else switch(e){case 217:t=ce[N++];break;case 218:t=Te.getUint16(N),N+=2;break;case 219:t=Te.getUint32(N),N+=4;break;default:throw new Error("Expected string")}return nu(t)}function bh(e){return qe.copyBuffers?Uint8Array.prototype.slice.call(ce,N,N+=e):ce.subarray(N,N+=e)}function js(e){let t=ce[N++];if(ln[t]){let n;return ln[t](ce.subarray(N,n=N+=e),o=>{N=o;try{return lt()}finally{N=n}})}else throw new Error("Unknown extension type "+t)}var cx=new Array(4096);function D_(){let e=ce[N++];if(e>=160&&e<192){if(e=e-160,ur>=N)return os.slice(N-Mn,(N+=e)-Mn);if(!(ur==0&&fr<180))return _p(e)}else return N--,U_(lt());let t=(e<<5^(e>1?Te.getUint16(N):e>0?ce[N]:0))&4095,n=cx[t],o=N,i=N+e-3,u,l=0;if(n&&n.bytes==e){for(;o<i;){if(u=Te.getUint32(o),u!=n[l++]){o=1879048192;break}o+=4}for(i+=3;o<i;)if(u=ce[o++],u!=n[l++]){o=1879048192;break}if(o===i)return N=o,n.string;i-=3,o=N}for(n=[],cx[t]=n,n.bytes=e;o<i;)u=Te.getUint32(o),n.push(u),o+=4;for(i+=3;o<i;)u=ce[o++],n.push(u);let d=e<16?ag(e):F_(e);return d!=null?n.string=d:n.string=_p(e)}function U_(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 lx=(e,t)=>{let n=lt().map(U_),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||ls)&&((Oe.restoreStructures||(Oe.restoreStructures=[]))[e]=i),Oe[e]=n,n.read=ig(n,o),(n.read0||n.read)()};ln[0]=()=>{};ln[0].noBuffer=!0;ln[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=(u,l)=>{let d=l-u;if(d<=40){let h=o.getBigUint64(u);for(let v=u+8;v<l;v+=8)h<<=BigInt(64),h|=o.getBigUint64(v);return h}let m=u+(d>>4<<3),g=i(u,m),y=i(m,l);return g<<BigInt((l-m)*8)|y};n=n<<BigInt((o.byteLength-t)*8)|i(t,o.byteLength)}return n};let fx={Error,EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError,AggregateError:typeof AggregateError=="function"?AggregateError:null};ln[101]=()=>{let e=lt();if(!fx[e[0]]){let t=Error(e[1],{cause:e[2]});return t.name=e[0],t}return fx[e[0]](e[1],{cause:e[2]})};ln[105]=e=>{if(qe.structuredClone===!1)throw new Error("Structured clone extension is disabled");let t=Te.getUint32(N-4);Mr||(Mr=new Map);let n=ce[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)&&ce[N+1]===115?o=new Set:o={};let i={target:o};Mr.set(t,i);let u=lt();if(i.used)Object.assign(o,u);else return i.target=u;if(o instanceof Map)for(let[l,d]of u.entries())o.set(l,d);if(o instanceof Set)for(let l of Array.from(u))o.add(l);return o};ln[112]=e=>{if(qe.structuredClone===!1)throw new Error("Structured clone extension is disabled");let t=Te.getUint32(N-4),n=Mr.get(t);return n.used=!0,n.target};ln[115]=()=>new Set(lt());const z_=["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64","BigInt64","BigUint64"].map(e=>e+"Array");let Bj=typeof globalThis=="object"?globalThis:window;ln[116]=e=>{let t=e[0],n=Uint8Array.prototype.slice.call(e,1).buffer,o=z_[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 Bj[o](n)};ln[120]=()=>{let e=lt();return new RegExp(e[0],e[1])};const Vj=[];ln[98]=e=>{let t=(e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3],n=N;return N+=t-e.length,Ct=Vj,Ct=[ux(),ux()],Ct.position0=0,Ct.position1=0,Ct.postBundlePosition=N,N=n,lt()};ln[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 B_(e){let t=fr,n=N,o=Mn,i=ur,u=os,l=Mr,d=Ct,m=new Uint8Array(ce.slice(0,fr)),g=Oe,y=Oe.slice(0,Oe.length),h=qe,v=ls,x=e();return fr=t,N=n,Mn=o,ur=i,os=u,Mr=l,Ct=d,ce=m,ls=v,Oe=g,Oe.splice(0,Oe.length,...y),qe=h,Te=new DataView(ce.buffer,ce.byteOffset,ce.byteLength),x}function Ep(){ce=null,Mr=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 Ql=new Aa({useRecords:!1});Ql.unpack;Ql.unpackMultiple;Ql.unpack;let qj=new Float32Array(1);new Uint8Array(qj.buffer,0,4);let Fc;try{Fc=new TextEncoder}catch{}let Cp,Pp;const ii=typeof Buffer<"u",kc=ii?function(e){return Buffer.allocUnsafeSlow(e)}:Uint8Array,V_=ii?Buffer:Uint8Array,dx=ii?4294967296:2144337920;let q,ra,ze,j=0,Ut,tt=null,Wj;const Hj=21760,Kj=/[\u0080-\uFFFF]/,Uo=Symbol("record-id");class Qj extends Aa{constructor(t){super(t),this.offset=0;let n,o,i,u,l=V_.prototype.utf8Write?function(C,H){return q.utf8Write(C,H,q.byteLength-H)}:Fc&&Fc.encodeInto?function(C,H){return Fc.encodeInto(C,q.subarray(H)).written}:!1,d=this;t||(t={});let m=t&&t.sequential,g=t.structures||t.saveStructures,y=t.maxSharedStructures;if(y==null&&(y=g?32:0),y>8160)throw new Error("Maximum maxSharedStructure is 8160");t.structuredClone&&t.moreTypes==null&&(this.moreTypes=!0);let h=t.maxOwnStructures;h==null&&(h=g?32:64),!this.structures&&t.useRecords!=!1&&(this.structures=[]);let v=y>32||h+y>64,x=y+64,w=y+h+64;if(w>8256)throw new Error("Maximum maxSharedStructure + maxOwnStructure is 8192");let k=[],b=0,B=0;this.pack=this.encode=function(C,H){if(q||(q=new kc(8192),ze=q.dataView||(q.dataView=new DataView(q.buffer,0,8192)),j=0),Ut=q.length-10,Ut-j<2048?(q=new kc(q.length),ze=q.dataView||(q.dataView=new DataView(q.buffer,0,q.length)),Ut=q.length-10,j=0):j=j+7&2147483640,n=j,H&Zj&&(j+=H&255),u=d.structuredClone?new Map:null,d.bundleStrings&&typeof C!="string"?(tt=[],tt.size=1/0):tt=null,i=d.structures,i){i.uninitialized&&(i=d._mergeStructures(d.getStructures()));let Q=i.sharedLength||0;if(Q>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 z=0;z<Q;z++){let G=i[z];if(!G)continue;let se,ee=i.transitions;for(let T=0,J=G.length;T<J;T++){let me=G[T];se=ee[me],se||(se=ee[me]=Object.create(null)),ee=se}ee[Uo]=z+64}this.lastNamedStructuresLength=Q}m||(i.nextId=Q+64)}o&&(o=!1);let Y;try{d.randomAccessStructure&&!d.readOnlyStructures&&C&&typeof C=="object"?C.constructor===Object?ue(C):C.constructor!==Map&&!Array.isArray(C)&&!Pp.some(z=>C instanceof z)?ue(C.toJSON?C.toJSON():C):P(C):P(C);let Q=tt;if(tt&&px(n,P,0),u&&u.idsToInsert){let z=u.idsToInsert.sort((T,J)=>T.offset>J.offset?1:-1),G=z.length,se=-1;for(;Q&&G>0;){let T=z[--G].offset+n;T<Q.stringsPosition+n&&se===-1&&(se=0),T>Q.position+n?se>=0&&(se+=6):(se>=0&&(ze.setUint32(Q.position+n,ze.getUint32(Q.position+n)+se),se=-1),Q=Q.previous,G++)}se>=0&&Q&&ze.setUint32(Q.position+n,ze.getUint32(Q.position+n)+se),j+=z.length*6,j>Ut&&W(j),d.offset=j;let ee=Jj(q.subarray(n,j),z);return u=null,ee}return d.offset=j,H&Yj?(q.start=n,q.end=j,q):q.subarray(n,j)}catch(Q){throw Y=Q,Q}finally{if(i&&(_(),o&&d.saveStructures)){let Q=i.sharedLength||0,z=q.subarray(n,j),G=Gj(i,d);if(!Y)return d.saveStructures(G,G.isCompatible)===!1?(i.uninitialized=!0,d.pack(C,H)):(d.lastNamedStructuresLength=Q,q.length>1073741824&&(q=null),z)}q.length>1073741824&&(q=null),H&Xj&&(j=n)}};const _=()=>{B<10&&B++;let C=i.sharedLength||0;if(i.length>C&&!m&&(i.length=C),b>1e4)i.transitions=null,B=0,b=0,k.length>0&&(k=[]);else if(k.length>0&&!m){for(let H=0,Y=k.length;H<Y;H++)k[H][Uo]=0;k=[]}},A=C=>{var H=C.length;H<16?q[j++]=144|H:H<65536?(q[j++]=220,q[j++]=H>>8,q[j++]=H&255):(q[j++]=221,ze.setUint32(j,H),j+=4);for(let Y=0;Y<H;Y++)P(C[Y])},P=C=>{j>Ut&&(q=W(j));var H=typeof C,Y;if(H==="string"){let Q=C.length;if(tt&&Q>=4&&Q<4096){if((tt.size+=Q)>Hj){let ee,T=(tt[0]?tt[0].length*3+tt[1].length:0)+10;j+T>Ut&&(q=W(j+T));let J;tt.position?(J=tt,q[j]=200,j+=3,q[j++]=98,ee=j-n,j+=4,px(n,P,0),ze.setUint16(ee+n-3,j-n-ee)):(q[j++]=214,q[j++]=98,ee=j-n,j+=4),tt=["",""],tt.previous=J,tt.size=0,tt.position=ee}let se=Kj.test(C);tt[se?0:1]+=C,q[j++]=193,P(se?-Q:Q);return}let z;Q<32?z=1:Q<256?z=2:Q<65536?z=3:z=5;let G=Q*3;if(j+G>Ut&&(q=W(j+G)),Q<64||!l){let se,ee,T,J=j+z;for(se=0;se<Q;se++)ee=C.charCodeAt(se),ee<128?q[J++]=ee:ee<2048?(q[J++]=ee>>6|192,q[J++]=ee&63|128):(ee&64512)===55296&&((T=C.charCodeAt(se+1))&64512)===56320?(ee=65536+((ee&1023)<<10)+(T&1023),se++,q[J++]=ee>>18|240,q[J++]=ee>>12&63|128,q[J++]=ee>>6&63|128,q[J++]=ee&63|128):(q[J++]=ee>>12|224,q[J++]=ee>>6&63|128,q[J++]=ee&63|128);Y=J-j-z}else Y=l(C,j+z);Y<32?q[j++]=160|Y:Y<256?(z<2&&q.copyWithin(j+2,j+1,j+1+Y),q[j++]=217,q[j++]=Y):Y<65536?(z<3&&q.copyWithin(j+3,j+2,j+2+Y),q[j++]=218,q[j++]=Y>>8,q[j++]=Y&255):(z<5&&q.copyWithin(j+5,j+3,j+3+Y),q[j++]=219,ze.setUint32(j,Y),j+=4),j+=Y}else if(H==="number")if(C>>>0===C)C<32||C<128&&this.useRecords===!1||C<64&&!this.randomAccessStructure?q[j++]=C:C<256?(q[j++]=204,q[j++]=C):C<65536?(q[j++]=205,q[j++]=C>>8,q[j++]=C&255):(q[j++]=206,ze.setUint32(j,C),j+=4);else if(C>>0===C)C>=-32?q[j++]=256+C:C>=-128?(q[j++]=208,q[j++]=C+256):C>=-32768?(q[j++]=209,ze.setInt16(j,C),j+=2):(q[j++]=210,ze.setInt32(j,C),j+=4);else{let Q;if((Q=this.useFloat32)>0&&C<4294967296&&C>=-2147483648){q[j++]=202,ze.setFloat32(j,C);let z;if(Q<4||(z=C*ug[(q[j]&127)<<1|q[j+1]>>7])>>0===z){j+=4;return}else j--}q[j++]=203,ze.setFloat64(j,C),j+=8}else if(H==="object"||H==="function")if(!C)q[j++]=192;else{if(u){let z=u.get(C);if(z){if(!z.id){let G=u.idsToInsert||(u.idsToInsert=[]);z.id=G.push(z)}q[j++]=214,q[j++]=112,ze.setUint32(j,z.id),j+=4;return}else u.set(C,{offset:j-n})}let Q=C.constructor;if(Q===Object)D(C);else if(Q===Array)A(C);else if(Q===Map)if(this.mapAsEmptyObject)q[j++]=128;else{Y=C.size,Y<16?q[j++]=128|Y:Y<65536?(q[j++]=222,q[j++]=Y>>8,q[j++]=Y&255):(q[j++]=223,ze.setUint32(j,Y),j+=4);for(let[z,G]of C)P(z),P(G)}else{for(let z=0,G=Cp.length;z<G;z++){let se=Pp[z];if(C instanceof se){let ee=Cp[z];if(ee.write){ee.type&&(q[j++]=212,q[j++]=ee.type,q[j++]=0);let le=ee.write.call(this,C);le===C?Array.isArray(C)?A(C):D(C):P(le);return}let T=q,J=ze,me=j;q=null;let he;try{he=ee.pack.call(this,C,le=>(q=T,T=null,j+=le,j>Ut&&W(j),{target:q,targetView:ze,position:j-le}),P)}finally{T&&(q=T,ze=J,j=me,Ut=q.length-10)}he&&(he.length+j>Ut&&W(he.length+j),j=hx(he,q,j,ee.type));return}}if(Array.isArray(C))A(C);else{if(C.toJSON){const z=C.toJSON();if(z!==C)return P(z)}if(H==="function")return P(this.writeFunction&&this.writeFunction(C));D(C)}}}else if(H==="boolean")q[j++]=C?195:194;else if(H==="bigint"){if(C<9223372036854776e3&&C>=-9223372036854776e3)q[j++]=211,ze.setBigInt64(j,C);else if(C<18446744073709552e3&&C>0)q[j++]=207,ze.setBigUint64(j,C);else if(this.largeBigIntToFloat)q[j++]=203,ze.setFloat64(j,Number(C));else{if(this.largeBigIntToString)return P(C.toString());if(this.useBigIntExtension||this.moreTypes){let Q=C<0?BigInt(-1):BigInt(0),z;if(C>>BigInt(65536)===Q){let G=BigInt(18446744073709552e3)-BigInt(1),se=[];for(;se.push(C&G),C>>BigInt(63)!==Q;)C>>=BigInt(64);z=new Uint8Array(new BigUint64Array(se).buffer),z.reverse()}else{let G=C<0,se=(G?~C:C).toString(16);if(se.length%2?se="0"+se:parseInt(se.charAt(0),16)>=8&&(se="00"+se),ii)z=Buffer.from(se,"hex");else{z=new Uint8Array(se.length/2);for(let ee=0;ee<z.length;ee++)z[ee]=parseInt(se.slice(ee*2,ee*2+2),16)}if(G)for(let ee=0;ee<z.length;ee++)z[ee]=~z[ee]}z.length+j>Ut&&W(z.length+j),j=hx(z,q,j,66);return}else throw new RangeError(C+" 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(H==="undefined")this.encodeUndefinedAsNil?q[j++]=192:(q[j++]=212,q[j++]=0,q[j++]=0);else throw new Error("Unknown type: "+H)},L=this.variableMapSize||this.coercibleKeyAsNumber||this.skipValues?C=>{let H;if(this.skipValues){H=[];for(let z in C)(typeof C.hasOwnProperty!="function"||C.hasOwnProperty(z))&&!this.skipValues.includes(C[z])&&H.push(z)}else H=Object.keys(C);let Y=H.length;Y<16?q[j++]=128|Y:Y<65536?(q[j++]=222,q[j++]=Y>>8,q[j++]=Y&255):(q[j++]=223,ze.setUint32(j,Y),j+=4);let Q;if(this.coercibleKeyAsNumber)for(let z=0;z<Y;z++){Q=H[z];let G=Number(Q);P(isNaN(G)?Q:G),P(C[Q])}else for(let z=0;z<Y;z++)P(Q=H[z]),P(C[Q])}:C=>{q[j++]=222;let H=j-n;j+=2;let Y=0;for(let Q in C)(typeof C.hasOwnProperty!="function"||C.hasOwnProperty(Q))&&(P(Q),P(C[Q]),Y++);if(Y>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[H+++n]=Y>>8,q[H+n]=Y&255},F=this.useRecords===!1?L:t.progressiveRecords&&!v?C=>{let H,Y=i.transitions||(i.transitions=Object.create(null)),Q=j++-n,z;for(let G in C)if(typeof C.hasOwnProperty!="function"||C.hasOwnProperty(G)){if(H=Y[G],H)Y=H;else{let se=Object.keys(C),ee=Y;Y=i.transitions;let T=0;for(let J=0,me=se.length;J<me;J++){let he=se[J];H=Y[he],H||(H=Y[he]=Object.create(null),T++),Y=H}Q+n+1==j?(j--,X(Y,se,T)):Z(Y,se,Q,T),z=!0,Y=ee[G]}P(C[G])}if(!z){let G=Y[Uo];G?q[Q+n]=G:Z(Y,Object.keys(C),Q,0)}}:C=>{let H,Y=i.transitions||(i.transitions=Object.create(null)),Q=0;for(let G in C)(typeof C.hasOwnProperty!="function"||C.hasOwnProperty(G))&&(H=Y[G],H||(H=Y[G]=Object.create(null),Q++),Y=H);let z=Y[Uo];z?z>=96&&v?(q[j++]=((z-=96)&31)+96,q[j++]=z>>5):q[j++]=z:X(Y,Y.__keys__||Object.keys(C),Q);for(let G in C)(typeof C.hasOwnProperty!="function"||C.hasOwnProperty(G))&&P(C[G])},$=typeof this.useRecords=="function"&&this.useRecords,D=$?C=>{$(C)?F(C):L(C)}:F,W=C=>{let H;if(C>16777216){if(C-n>dx)throw new Error("Packed buffer would be larger than maximum buffer size");H=Math.min(dx,Math.round(Math.max((C-n)*(C>67108864?1.25:2),4194304)/4096)*4096)}else H=(Math.max(C-n<<2,q.length-1)>>12)+1<<12;let Y=new kc(H);return ze=Y.dataView||(Y.dataView=new DataView(Y.buffer,0,H)),C=Math.min(C,q.length),q.copy?q.copy(Y,0,n,C):Y.set(q.slice(n,C)),j-=n,n=0,Ut=Y.length-10,q=Y},X=(C,H,Y)=>{let Q=i.nextId;Q||(Q=64),Q<x&&this.shouldShareStructure&&!this.shouldShareStructure(H)?(Q=i.nextOwnId,Q<w||(Q=x),i.nextOwnId=Q+1):(Q>=w&&(Q=x),i.nextId=Q+1);let z=H.highByte=Q>=96&&v?Q-96>>5:-1;C[Uo]=Q,C.__keys__=H,i[Q-64]=H,Q<x?(H.isShared=!0,i.sharedLength=Q-63,o=!0,z>=0?(q[j++]=(Q&31)+96,q[j++]=z):q[j++]=Q):(z>=0?(q[j++]=213,q[j++]=114,q[j++]=(Q&31)+96,q[j++]=z):(q[j++]=212,q[j++]=114,q[j++]=Q),Y&&(b+=B*Y),k.length>=h&&(k.shift()[Uo]=0),k.push(C),P(H))},Z=(C,H,Y,Q)=>{let z=q,G=j,se=Ut,ee=n;q=ra,j=0,n=0,q||(ra=q=new kc(8192)),Ut=q.length-10,X(C,H,Q),ra=q;let T=j;if(q=z,j=G,Ut=se,n=ee,T>1){let J=j+T-1;J>Ut&&W(J);let me=Y+n;q.copyWithin(me+T,me+1,j),q.set(ra.slice(0,T),me),j=J}else q[Y+n]=ra[0]},ue=C=>{let H=Wj(C,q,n,j,i,W,(Y,Q,z)=>{if(z)return o=!0;j=Q;let G=q;return P(Y),_(),G!==q?{position:j,targetView:ze,target:q}:j},this);if(H===0)return D(C);j=H}}useBuffer(t){q=t,q.dataView||(q.dataView=new DataView(q.buffer,q.byteOffset,q.byteLength)),ze=q.dataView,j=0}set position(t){j=t}get position(){return j}clearSharedData(){this.structures&&(this.structures=[]),this.typedStructs&&(this.typedStructs=[])}}Pp=[Date,Set,Error,RegExp,ArrayBuffer,Object.getPrototypeOf(Uint8Array.prototype).constructor,DataView,A_];Cp=[{pack(e,t,n){let o=e.getTime()/1e3;if((this.useTimestamp32||e.getMilliseconds()===0)&&o>=0&&o<4294967296){let{target:i,targetView:u,position:l}=t(6);i[l++]=214,i[l++]=255,u.setUint32(l,o)}else if(o>0&&o<4294967296){let{target:i,targetView:u,position:l}=t(10);i[l++]=215,i[l++]=255,u.setUint32(l,e.getMilliseconds()*4e6+(o/1e3/4294967296>>0)),u.setUint32(l+4,o)}else if(isNaN(o)){if(this.onInvalidDate)return t(0),n(this.onInvalidDate());let{target:i,targetView:u,position:l}=t(3);i[l++]=212,i[l++]=255,i[l++]=255}else{let{target:i,targetView:u,position:l}=t(15);i[l++]=199,i[l++]=12,i[l++]=255,u.setUint32(l,e.getMilliseconds()*1e6),u.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:u}=t(this.moreTypes?3:0);this.moreTypes&&(i[u++]=212,i[u++]=115,i[u++]=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?Ih(e,16,t):Rh(ii?Buffer.from(e):new Uint8Array(e),t)}},{pack(e,t){let n=e.constructor;n!==V_&&this.moreTypes?Ih(e,z_.indexOf(n.name),t):Rh(e,t)}},{pack(e,t){this.moreTypes?Ih(e,17,t):Rh(ii?Buffer.from(e):new Uint8Array(e),t)}},{pack(e,t){let{target:n,position:o}=t(1);n[o]=193}}];function Ih(e,t,n,o){let i=e.byteLength;if(i+1<256){var{target:u,position:l}=n(4+i);u[l++]=199,u[l++]=i+1}else if(i+1<65536){var{target:u,position:l}=n(5+i);u[l++]=200,u[l++]=i+1>>8,u[l++]=i+1&255}else{var{target:u,position:l,targetView:d}=n(7+i);u[l++]=201,d.setUint32(l,i+1),l+=4}u[l++]=116,u[l++]=t,e.buffer||(e=new Uint8Array(e)),u.set(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),l)}function Rh(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:u}=t(n+5);o[i++]=198,u.setUint32(i,n),i+=4}o.set(e,i)}function hx(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 Jj(e,t){let n,o=t.length*6,i=e.length-o;for(;n=t.pop();){let u=n.offset,l=n.id;e.copyWithin(u+o,u,i),o-=6;let d=u+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=u}return e}function px(e,t,n){if(tt.length>0){ze.setUint32(tt.position+e,j+n-tt.position-e),tt.stringsPosition=j-e;let o=tt;tt=null,t(o[0]),t(o[1])}}function Gj(e,t){return e.isCompatible=n=>{let o=!n||(t.lastNamedStructuresLength||0)===n.length;return o||t._mergeStructures(n),o},e}let q_=new Qj({useRecords:!1});q_.pack;q_.pack;const Yj=512,Xj=1024,Zj=2048;class cg extends Fn()("effect/rpc/RpcSerialization"){}const e$=cg.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)}}}),t$=Rm(cg)(e$),n$=e=>hr(()=>{const t=new Set,n=new Map,o=new Map;let i=(u,l)=>_k(d=>{let m=n.get(u);return m||(m=[],n.set(u,m)),m.push([l,d]),rt});return vs(e((u,l)=>{const d=o.get(u);return d?d(l):i(u,l)},t),u=>({...u,run(l,d){return ap(function*(){t.add(l),o.set(l,d);const m=n.get(l);if(m){n.delete(l);for(const[g,y]of m)yield*Ks(hr(()=>d(g)),y)}return yield*Pk(OL,()=>(t.delete(l),o.delete(l),rt))})}}))});let r$=BigInt(0);const s$=Qs(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,u=(t==null?void 0:t.generateRequestId)??(()=>r$++),l=yield*Xc(),d=Ws(l,vS),m=new Map;let g=!1;yield*oL(d,Yc(_=>(g=!0,y(GM(_.id)))));const y=Qs(function*(_){for(const[A,P]of m)m.delete(A),P._tag==="Queue"?yield*_._tag==="Success"?DS(P.queue):ua(P.queue,_.cause):P.resume(_)}),h=_=>{const A=R_(_.successSchema),P=w(_);return(L,F)=>{const $=F!=null&&F.headers?pj(F.headers):rg,D=(F==null?void 0:F.context)??Gn();if(!A){const X=Z=>v(_,P,Z,_.payloadSchema.make(L),$,D,(F==null?void 0:F.discard)??!1);return i?X(void 0):ZL(`${n}.${_._tag}`,{attributes:t.spanAttributes},X)}const W=x(_,P,_.payloadSchema.make(L),$,(F==null?void 0:F.streamBufferSize)??16,D);return F!=null&&F.asQueue?W:KA(vs(W,HA))}},v=(_,A,P,L,F,$,D)=>Yc(W=>{if(g)return up;const X=u(),Z=A(C=>t.onFromClient({message:C,context:$,discard:D}),{_tag:"Request",id:X,tag:_._tag,payload:L,...P?{traceId:P.traceId,spanId:P.spanId,sampled:P.sampled}:{},headers:ZS(W.getRef(gx),F)});if(D)return Z;let ue;return YL(ES(C=>{const H={_tag:"Effect",rpc:_,context:$,resume(Y){C(Y),ue&&!ue.pollUnsafe()&&W.currentDispatcher.scheduleTask(()=>{ue.interruptUnsafe(W.id)},0)}};m.set(X,H),ue=Z.pipe(P?PS(P,{captureStackTrace:!1}):Ee,Zc(W.context)),ue.addObserver(Y=>{if(Y._tag==="Failure")return C(Y)})}),C=>(m.delete(X),AL(aa(ue),k(X,Array.from(C),$))))}),x=Qs(function*(_,A,P,L,F,$){if(g)return yield*up;const D=i?void 0:yield*XL(`${n}.${_._tag}`,{attributes:t.spanAttributes}),W=gp(),X=u(),Z=bl(W.context,vS);yield*sL(Z,C=>m.has(X)?(m.delete(X),k(X,ck(C)?Array.from(HM(C.cause)):[],$)):rt);const ue=yield*F3(F);return m.set(X,{_tag:"Queue",rpc:_,queue:ue,scope:Z,context:$}),yield*A(C=>t.onFromClient({message:C,context:$,discard:!1}),{_tag:"Request",id:X,tag:_._tag,payload:P,...D?{traceId:D.traceId,spanId:D.spanId,sampled:D.sampled}:{},headers:ZS(W.getRef(gx),L)}).pipe(D?PS(D,{captureStackTrace:!1}):Ee,Oa(C=>ua(ue,C)),Nm,eN(Z,{startImmediately:!0})),ue}),w=_=>{const A=[];for(const P of _.middlewares.values()){const L=l.mapUnsafe.get(`${P.key}/Client`);L&&A.push(L)}return A.length===0?(P,L)=>P(L):function P(L,F,$=A.length-1){return $===-1?L(F):A[$]({rpc:_,request:F,next(D){return P(L,D,$-1)}})}},k=(_,A,P)=>ES(L=>{const F=gp();t.onFromClient({message:{_tag:"Interrupt",requestId:_,interruptors:A},context:P,discard:!1}).pipe(zL(1e3),Zc(F.context)).addObserver(()=>{L(rt)})}),b=_=>{switch(_._tag){case"Chunk":{const A=_.requestId,P=m.get(A);return!P||P._tag!=="Queue"?rt:D3(P.queue,_.values).pipe(o?kn(()=>t.onFromClient({message:{_tag:"Ack",requestId:_.requestId},context:P.context,discard:!1})):Ee,Oa(L=>ua(P.queue,L)))}case"Exit":{const A=_.requestId,P=m.get(A);return P?(m.delete(A),P._tag==="Effect"?(P.resume(_.exit),rt):_.exit._tag==="Success"?DS(P.queue):ua(P.queue,_.exit.cause)):rt}case"Defect":return y(JM(_.defect));case"ClientEnd":return rt}};let B;if(t.flatten){const _=new Map;B=function(P,L,F){let $=_.get(P);return $||($=h(e.requests.get(P)),_.set(P,$)),$(L,F)}}else B={},e.requests.forEach(_=>{B[_._tag]=h(_)});return{client:B,write:b}});let o$=0;const i$=Qs(function*(e,t){const n=o$++,{run:o,send:i,supportsAck:u,supportsTransferables:l}=yield*Jl,d=new Map,{client:m,write:g}=yield*s$(e,{...t,supportsAck:u,onFromClient({message:y}){switch(y._tag){case"Request":{const h=e.requests.get(y.tag),v=l?Tj():void 0,x=gp(),w={rpc:h,context:v?gs(x.context,N_,v):x.context,schemas:a$(h)};return d.set(y.id,w),w.schemas.encodePayload(y.payload).pipe(Ks(w.context),Lc,kn(k=>i(n,{...y,id:String(y.id),payload:k,headers:Object.entries(y.headers)},v&&v.readUnsafe())))}case"Ack":return d.get(y.requestId)?i(n,{_tag:"Ack",requestId:String(y.requestId)}):rt;case"Interrupt":return d.get(y.requestId)?(d.delete(y.requestId),i(n,{_tag:"Interrupt",requestId:String(y.requestId)})):rt;case"Eof":return rt}}});return yield*o(n,y=>{switch(y._tag){case"Chunk":{const h=xc(y.requestId),v=d.get(h);return!v||so(v.schemas.decodeChunk)?rt:v.schemas.decodeChunk.value(y.values).pipe(Ks(v.context),Lc,kn(x=>g({_tag:"Chunk",clientId:0,requestId:xc(y.requestId),values:x})),GL(x=>g({_tag:"Exit",clientId:0,requestId:xc(y.requestId),exit:da(x)})))}case"Exit":{const h=xc(y.requestId),v=d.get(h);return v?(d.delete(h),v.schemas.decodeExit(y.exit).pipe(Ks(v.context),Lc,qL({onSuccess:x=>g({_tag:"Exit",clientId:0,requestId:h,exit:x}),onFailure:x=>g({_tag:"Exit",clientId:0,requestId:h,exit:da(x)})}))):rt}case"Defect":return g({_tag:"Defect",clientId:0,defect:f$(y.defect)});case"ClientProtocolError":{const h=Qa(y.error);return xk(d.keys(),v=>g({_tag:"Exit",clientId:0,requestId:v,exit:h}))}default:return rt}}).pipe(Oa(uN),Nm,Am),m}),mx=new WeakMap,a$=e=>{let t=mx.get(e);if(t!==void 0)return t;const n=T_(e.successSchema);return t={decodeChunk:sm(n,o=>BS(_h(kA(o.success)))),encodePayload:vA(_h(e.payloadSchema)),decodeExit:BS(_h(cj(e)))},mx.set(e,t),t},gx=Xe("effect/rpc/RpcClient/CurrentHeaders",{defaultValue:()=>rg});class Jl extends Fn()("effect/rpc/RpcClient/Protocol"){}M(Jl,"make",n$);const u$=e=>Jl.make(Qs(function*(t,n){const o=yield*og,i=yield*cg,u=yield*HL(bp),l=new Map,d=yield*o.writer;let m=i.makeUnsafe();const g=yield*l$(d(m.encode(jj)));let y;const h=hr(()=>(y=void 0,fs(u)?u.value.onConnect:rt)),v=x=>xk(n,w=>t(w,x));return yield*hr(()=>(m=i.makeUnsafe(),g.reset(),o.runRaw(x=>{try{const w=m.decode(x);if(w.length===0)return;let k=0;return wk({while:()=>k<w.length,body:()=>{const b=w[k++];if(b._tag==="Pong")return g.onPong(),rt;if("requestId"in b){const B=l.get(b.requestId);if(B!==void 0)return b._tag==="Exit"&&l.delete(b.requestId),t(B,b)}return v(b)},step:Da})}catch(w){return v({_tag:"ClientProtocolError",error:new tx({reason:new wp({message:"Error decoding message",cause:w})})})}},{onOpen:h}).pipe(kk(kn(g.timeout,()=>Qe(new Qo({reason:new ul({kind:"Timeout",cause:new Error("ping timeout")})}))))))).pipe(kn(()=>Qe(new Qo({reason:new cl({code:1e3})}))),fs(u)?Ck(u.value.onDisconnect):Ee,FL(x=>{const w=Ka(x),k=ER(w);return k&&w.success.reason._tag==="SocketOpenError"?rt:(y=new tx({reason:k?w.success.reason:new wp({message:"Unknown socket error",cause:ak(x)})}),v({_tag:"ClientProtocolError",error:y}))}),DL((e==null?void 0:e.retryPolicy)??c$),cN({module:"RpcClient",method:"makeProtocolSocket"}),Am),{send(x,w){if(y)return Qe(y);w._tag==="Request"&&l.set(w.id,x);const k=m.encode(w);return k===void 0?rt:Lc(d(k))},supportsAck:!0,supportsTransferables:!1}})),c$=yk(500,1.5).pipe(gk(Mm(5e3))),l$=Qs(function*(e){let t=!0;const n=l_(),o=()=>{t=!0,n.closeUnsafe()},i=()=>{t=!0};return yield*hr(()=>t?(t=!1,e):n.open).pipe(VL("5 seconds"),UL,bk,Nm,Am),{timeout:n.await,reset:o,onPong:i}});class bp extends Fn()("effect/rpc/RpcClient/ConnectionHooks"){}const f$=gA(tr),d$={add(...e){const t=new Map(this.requests);for(const n of e)t.set(n._tag,n);return Ir({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,u]of o.requests)t.set(i,u);for(const[i,u]of o.annotations.mapUnsafe)n.set(i,u)}return Ir({requests:t,annotations:as(n)})},omit(...e){const t=new Map(this.requests);for(const n of e)t.delete(n);return Ir({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 Ir({requests:t,annotations:this.annotations})},toHandlers(e){const t=this;return ap(function*(){const n=yield*Xc(),o=Ko(e)?yield*e:e,i=new Map;for(const[u,l]of Object.entries(o)){const d=t.requests.get(u);i.set(d.key,{tag:d._tag,handler:l,context:n})}return as(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 Ir({requests:t,annotations:this.annotations})},toLayer(e){return op(this.toHandlers(e))},of:Ee,toLayerHandler(e,t){const n=this;return op(ap(function*(){const o=yield*Xc(),i=Ko(t)?yield*t:t,u=new Map,l=n.requests.get(e);return u.set(l.key,{handler:i,context:o}),as(u)}))},accessHandler(e){return _k(t=>{const n=this.requests.get(e),{handler:o,context:i}=t.mapUnsafe.get(n.key);return it((u,l)=>{l.rpc=n;const d=o(u,l),m=fj(d)?d.value:d;return Ko(m)?WL(m,i):QA(m,i)})})},annotate(e,t){return Ir({requests:this.requests,annotations:gs(this.annotations,e,t)})},annotateRpcs(e,t){return this.annotateRpcsMerge(Xo(e,t))},annotateMerge(e){return Ir({requests:this.requests,annotations:Zo(this.annotations,e)})},annotateRpcsMerge(e){const t=new Map;for(const[n,o]of this.requests)t.set(n,o.annotateMerge(Zo(e,o.annotations)));return Ir({requests:t,annotations:this.annotations})}},Ir=e=>Object.assign(function(){},d$,{requests:e.requests,annotations:e.annotations}),h$=(...e)=>Ir({requests:new Map(e.map(t=>[t._tag,t])),annotations:Gn()}),p$="/ws",m$=2,Ln={getConfig:"tokmon.getConfig",setConfig:"tokmon.setConfig",refresh:"tokmon.refresh",browseFs:"tokmon.browseFs",snapshot:"tokmon.snapshot",config:"tokmon.config"},g$=Nn(["all","summary","table","billing","peak"]),ja=Nn(ml),lg=OA.check(v_(0)),Ip=De.check(v_(1)),y$=Pe({id:xe,providerId:ja,name:xe,homeDir:xe,color:Kt(xe)}),W_=Pe({revision:lg,interval:Ip,billingInterval:Ip,clearScreen:cs,privacyMode:cs,privacyToggleKey:xe,timezone:ht(xe),accounts:bt(y$),activeAccountId:ht(xe),disabledProviders:bt(ja),onboarded:cs,dashboardLayout:Nn(["grid","single"]),defaultFocus:Nn(["all","last"]),ascii:Nn(["auto","on","off"]),knownProviders:bt(ja)}),v$=Pe({version:un(m$),capabilities:bt(xe)}),Gl=Pe({protocol:v$,config:W_}),S$=Pe({expectedRevision:lg,config:W_}),x$=Pe({kind:un("conflict"),state:Gl}),w$=Pe({kind:un("persistence"),message:xe}),k$=Pe({name:xe,path:xe,dir:cs}),_$=Pe({path:xe,parent:ht(xe),entries:bt(k$)}),Th=Pe({cost:De,tokens:De,cacheRead:De,cacheSavings:De}),E$=Pe({name:xe,input:De,output:De,cacheCreate:De,cacheRead:De,cacheSavings:De,cost:De,count:De}),Oh=Pe({label:xe,models:bt(xe),input:De,output:De,cacheCreate:De,cacheRead:De,cacheSavings:De,total:De,cost:De,count:De,breakdown:bt(E$)}),C$=Pe({today:Th,week:Th,month:Th,burnRate:De,series:bt(De)}),P$=Pe({daily:bt(Oh),weekly:bt(Oh),monthly:bt(Oh)}),b$=En([Pe({kind:un("percent")}),Pe({kind:un("dollars"),currency:Kt(xe)}),Pe({kind:un("count"),suffix:Kt(xe)})]),I$=Pe({label:xe,used:De,limit:ht(De),format:b$,resetsAt:Kt(ht(xe)),primary:Kt(cs)}),R$=Pe({plan:ht(xe),metrics:bt(I$),error:ht(xe),email:Kt(ht(xe)),displayName:Kt(ht(xe)),activity:Kt(ht(Pe({series:bt(De),summary:xe}))),modelSpend:Kt(ht(bt(Pe({name:xe,usd:De,requests:De}))))}),T$=Pe({id:xe,providerId:ja,name:xe,color:xe,homeDir:ht(xe),hasUsage:cs,hasBilling:cs,email:Kt(ht(xe)),displayName:Kt(ht(xe)),plan:Kt(ht(xe)),dashboard:ht(C$),table:ht(P$),billing:ht(R$),summaryState:Nn(["pending","ready","error"]),billingState:Nn(["pending","ready","error"]),tableState:Nn(["pending","ready","error"])}),O$=Pe({version:xe,generatedAt:lg,tz:xe,intervalMs:Ip,providers:bt(Pe({id:ja,name:xe,color:xe})),accounts:bt(T$),seeded:cs,peak:ht(Pe({state:Nn(["peak","off-peak","weekend"]),label:xe,minutesUntilChange:ht(De)}))}),fg=Pe({}),M$=fi(Ln.getConfig,{payload:fg,success:Gl}),L$=fi(Ln.setConfig,{payload:S$,success:Gl,error:En([x$,w$])}),N$=fi(Ln.refresh,{payload:Pe({scope:g$}),success:il}),A$=fi(Ln.browseFs,{payload:Pe({path:xe}),success:_$}),j$=fi(Ln.snapshot,{payload:fg,success:O$,stream:!0}),$$=fi(Ln.config,{payload:fg,success:Gl,stream:!0}),F$=h$(M$,L$,N$,A$,j$,$$);class _c extends Fn()("tokmon/client/DaemonRpcClient/TokmonRpcClient"){}const D$=new Function("specifier","return import(specifier)");function U$(e,t){const n=typeof window>"u"?void 0:window.location.origin,o=new URL(e,n);if(o.protocol==="http:"?o.protocol="ws:":o.protocol==="https:"&&(o.protocol="wss:"),o.protocol!=="ws:"&&o.protocol!=="wss:")throw new Error(`unsupported daemon RPC protocol: ${o.protocol}`);return o.hash="",o.searchParams.delete("tokmonToken"),o.pathname=p$,t&&o.searchParams.set("wsToken",t),o.toString()}function z$(e){return e==="node"?!0:e==="browser"?!1:typeof window>"u"}async function B$(e,t){return z$(t)?(await D$("@effect/platform-node/NodeSocket")).layerWebSocket(e):Rj(e).pipe(ip(Pj))}function V$(e){const t=e.reconnectBaseDelayMs??250,n=yk(ba(t),1.5).pipe(gk(Mm(ba(2500))));return typeof e.reconnectAttempts=="number"?n.pipe(SL(kL(e.reconnectAttempts))):n}function q$(e,t={}){const n=U$(e,t.wsToken),o=new Set;let i=null,u=null,l=!1;const d=(x,w)=>{var k;(k=t.onConn)==null||k.call(t,x,w)},m=x=>{const w=x??i;(x===void 0||x===i)&&(i=null),u=null,w&&w.runtime.dispose().catch(()=>{})},g=async()=>{const x=await B$(n,t.transport),w=Rm(bp,bp.of({onConnect:vn(()=>{d("live")}),onDisconnect:vn(()=>{l||d("reconnecting")})}));return sp(Jl,u$({retryPolicy:V$(t)})).pipe(ip(hk(x,t$,w)))},y=async()=>{if(l)throw new Error("daemon RPC client is closed");return i||u||(d("connecting"),u=(async()=>{let x;try{const w=await g(),k=sp(_c,i$(F$)).pipe(ip(w));if(x=oj(k),await x.runPromise(_c.asEffect()),l)throw await x.dispose(),new Error("daemon RPC client is closed");return i={runtime:x},i}catch(w){throw u=null,await(x==null?void 0:x.dispose().catch(()=>{})),l||d("error",w),w}})(),u)},h=async x=>{const w=await y();try{return await w.runtime.runPromise(_c.use(k=>x(k)))}catch(k){throw l||(m(w),d("error",k)),k}},v=(x,w)=>{if(l)return()=>{};let k=null,b=!1,B=null;const _=()=>{if(!k)return;const L=k;k=null,o.delete(L),((i==null?void 0:i.runtime.runPromise(aa(L)))??pa(aa(L))).catch(()=>{})},A=()=>{var L;l||b||B||(B=setTimeout(()=>{B=null,P()},t.reconnectBaseDelayMs??250),(L=B.unref)==null||L.call(B))},P=()=>{(async()=>{try{const L=await y();if(l||b)return;k=L.runtime.runFork(_c.use(F=>x(F).pipe(JA($=>vn(()=>{try{w($)}catch{}})))).pipe(Oa(F=>vn(()=>{!l&&!b&&(m(L),d("error",ak(F)),A())})))),o.add(k),k.addObserver(()=>{k&&o.delete(k)})}catch(L){!l&&!b&&(m(),d("error",L),A())}})()};return P(),()=>{b=!0,B&&(clearTimeout(B),B=null),_()}};return{getConfig:()=>h(x=>x[Ln.getConfig]({})).then(x=>x),setConfig:x=>h(w=>w[Ln.setConfig](x)).then(w=>w),refresh:(x="all")=>h(w=>w[Ln.refresh]({scope:x})),browseFs:x=>h(w=>w[Ln.browseFs]({path:x})),subscribeSnapshot:x=>v(w=>w[Ln.snapshot]({}).pipe(QS(k=>k)),x),subscribeConfig:x=>v(w=>w[Ln.config]({}).pipe(QS(k=>k)),x),async close(){if(l)return;l=!0,d("closed");const x=[...o];o.clear();const w=i??await(u==null?void 0:u.catch(()=>null))??null;await Promise.all(x.map(k=>((w==null?void 0:w.runtime.runPromise(aa(k)))??pa(aa(k))).catch(()=>{}))),i=null,u=null,w&&await w.runtime.dispose().catch(()=>{})}}}let Mh=null;const Rp=new Set,yx="tokmon.daemonToken";function W$(){const e=new URLSearchParams(window.location.hash.slice(1)),t=new URLSearchParams(window.location.search);let n=null;try{n=window.sessionStorage.getItem(yx)}catch{}const o=e.get("tokmonToken")??t.get("tokmonToken")??n??void 0;if(o){try{window.sessionStorage.setItem(yx,o)}catch{}e.delete("tokmonToken"),t.delete("tokmonToken");const i=t.size?`?${t.toString()}`:"",u=e.size?`#${e.toString()}`:"";window.history.replaceState(window.history.state,"",`${window.location.pathname}${i}${u}`)}return o}function H$(e){if(e!=="closed")for(const t of Rp)t(e)}function ru(){return Mh||(Mh=q$(window.location.origin,{transport:"browser",wsToken:W$(),onConn:H$})),Mh}function K$(e){return Rp.add(e),()=>{Rp.delete(e)}}function Q$(){const[e,t]=te.useState(null),[n,o]=te.useState("connecting"),i=te.useRef(null);return te.useEffect(()=>{let u=!1;const l=ru(),d=K$(g=>{u||o(g)}),m=l.subscribeSnapshot(g=>{u||(t(g),o("live"))});return i.current=m,()=>{var g;u=!0,d(),(g=i.current)==null||g.call(i),i.current=null}},[]),{snapshot:e,conn:n}}async function o4(){const e=await ru().getConfig();return{...e,config:Up(e.config).config}}async function i4(e,t){const n=await ru().setConfig({config:e,expectedRevision:t});return{...n,config:Up(n.config).config}}async function a4(e){return ru().browseFs(e)}function J$(e){return ru().subscribeConfig(t=>{e({...t,config:Up(t.config).config})})}const H_=()=>Promise.all([cr(()=>import("./overview-C18nvaAK.js"),__vite__mapDeps([5,6,1]),import.meta.url),cr(()=>import("./timeline-DmzB8Z3W.js"),__vite__mapDeps([7,2,6,1,3]),import.meta.url)]).then(([e])=>e),K_=()=>Promise.all([cr(()=>import("./analytics-BOhbhV5Z.js"),__vite__mapDeps([8,6,1]),import.meta.url),cr(()=>import("./breakdown-CO04nSN-.js"),__vite__mapDeps([9,2,6,1]),import.meta.url),cr(()=>import("./timeline-DmzB8Z3W.js"),__vite__mapDeps([7,2,6,1,3]),import.meta.url)]).then(([e])=>e),Q_=()=>Promise.all([cr(()=>import("./models-Cl6D8VVF.js"),__vite__mapDeps([10,6,1]),import.meta.url),cr(()=>import("./breakdown-CO04nSN-.js"),__vite__mapDeps([9,2,6,1]),import.meta.url)]).then(([e])=>e),J_=()=>cr(()=>import("./explore-sZnmjzAj.js"),__vite__mapDeps([11,6]),import.meta.url),G$={overview:H_,analytics:K_,models:Q_,explore:J_},Y$=te.lazy(()=>H_().then(e=>({default:e.OverviewTab}))),X$=te.lazy(()=>K_().then(e=>({default:e.AnalyticsTab}))),Z$=te.lazy(()=>Q_().then(e=>({default:e.ModelsTab}))),eF=te.lazy(()=>J_().then(e=>({default:e.ExploreTab}))),tF=te.lazy(()=>cr(()=>import("./settings-sheet-0BGb5Ahv.js"),__vite__mapDeps([12,4]),import.meta.url).then(e=>({default:e.SettingsSheet}))),vx=e=>{G$[e]()},Tp=e=>`/${e}`,G_=te.createContext(null),Yl=()=>{const e=te.useContext(G_);if(!e)throw new Error("useDashboard outside provider");return e};function nF(e=1e3){const[t,n]=te.useState(()=>Date.now());return te.useEffect(()=>{const o=setInterval(()=>n(Date.now()),e);return()=>clearInterval(o)},[e]),t}function rF(){const[e,t]=te.useState(()=>document.documentElement.classList.contains("light")?"light":"dark");return te.useEffect(()=>{var o;document.documentElement.classList.toggle("light",e==="light"),(o=document.querySelector('meta[name="theme-color"]'))==null||o.setAttribute("content",e==="light"?"#f4f5f5":"#0a0a0a")},[e]),[e,()=>{const o=e==="dark"?"light":"dark";try{localStorage.setItem("tokmon-theme",o)}catch{}t(o)}]}function sF({theme:e,onToggle:t}){return I.jsx("button",{type:"button",onClick:t,title:e==="dark"?"Switch to light":"Switch to dark","aria-label":e==="dark"?"Switch to light theme":"Switch to dark theme",className:"rounded border border-line bg-bg-1 p-1.5 text-fg-dim transition hover:border-line-2 hover:text-fg focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent max-sm:p-2.5",children:e==="dark"?I.jsx(GI,{className:"size-3.5"}):I.jsx(YI,{className:"size-3.5"})})}function oF({conn:e,freshAt:t}){const n=nF(),o=e==="live"?"var(--color-positive)":e==="error"?"var(--color-warning)":"var(--color-cost)",i=t?LI(t,n):null,u=e==="live"?i??"live":e==="connecting"?"connecting…":e==="reconnecting"?i?`reconnecting · ${i}`:"reconnecting…":i?`offline · ${i}`:"offline";return I.jsxs("span",{className:"flex items-center gap-1.5 text-xs",role:"status","aria-live":"polite",children:[I.jsxs("span",{className:"relative flex size-2","aria-hidden":!0,children:[e==="live"&&I.jsx("span",{className:"absolute inline-flex size-full animate-ping rounded-full opacity-60",style:{background:o}}),I.jsx("span",{className:"relative inline-flex size-2 rounded-full",style:{background:o}})]}),I.jsx("span",{className:"inline-block truncate text-fg-dim max-sm:max-w-[7rem]",children:u})]})}function Lh({label:e}){return I.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:[I.jsxs("span",{className:"font-display text-lg text-fg-dim","aria-hidden":!0,children:["tokmon",I.jsx("span",{className:"cursor-blink text-accent",children:"▋"})]}),I.jsx("span",{className:"text-fg-faint",children:e})]})}function iF({onOpen:e}){return I.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 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent max-sm:p-2.5",children:I.jsx(XI,{className:"size-3.5"})})}function aF(){var W,X;const{snapshot:e,conn:t}=Q$(),[n,o]=d2(),[i,u]=rF(),[l,d]=te.useState(!1),[m,g]=te.useState(br.privacyMode);te.useEffect(()=>J$(Z=>g(Z.config.privacyMode)),[]);const y=te.useMemo(()=>HI(e,n),[e,n]),h=((W=_w.find(Z=>Z.key===n.period))==null?void 0:W.label)??n.period,v=n.period==="all"?void 0:h,x=kI({select:Z=>Z.location.pathname}),w=((X=Hv.find(Z=>Tp(Z.key)===x))==null?void 0:X.key)??"overview";te.useEffect(()=>{var Y;if(!e)return;const Z=new Set(e.providers.map(Q=>Q.id)),ue=new Set(e.accounts.map(Q=>Q.id)),C=new Set;for(const Q of e.accounts)for(const z of((Y=Q.table)==null?void 0:Y.monthly)??[])for(const G of z.breakdown)C.add(G.name);const H=i2(n,{providers:Z,accounts:ue,models:C,modelsReady:C.size>0});H!==n&&o(H)},[e,n,o]);const k=(e==null?void 0:e.accounts.filter(Z=>Z.hasUsage))??[],b=k.length>0,B=((e==null?void 0:e.accounts)??[]).some(Wh),_=((e==null?void 0:e.accounts)??[]).some(Z=>Z.hasBilling&&!Wh(Z)),A=b&&k.every(Z=>Z.table!=null),P=te.useRef(!1);te.useEffect(()=>{A&&(P.current=!0)},[A]);const[L,F]=te.useState(!1);te.useEffect(()=>{const Z=setTimeout(()=>F(!0),12e3);return()=>clearTimeout(Z)},[]);const $=!b||A||P.current||L,D=te.useMemo(()=>e?{snapshot:e,filters:n,derived:y,periodLabel:h,scopeLabel:v,privacyMode:m}:null,[e,n,y,h,v,m]);return I.jsxs("div",{className:"min-h-screen",children:[I.jsx("a",{href:"#dashboard-content",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"}),I.jsxs("header",{className:"relative z-30 border-b border-line bg-bg-0/80 backdrop-blur",children:[I.jsxs("div",{className:"mx-auto max-w-[1600px] px-5 2xl:max-w-[1920px]",children:[I.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2 py-3.5",children:[I.jsx("h1",{className:"font-display text-2xl text-fg-bright",children:"TOKMON"}),I.jsxs("span",{className:"hidden text-sm text-fg-faint sm:inline",children:["~/usage ",I.jsx("span",{className:"text-prompt",children:"$"})," ",I.jsx("span",{className:"text-fg-dim",children:w}),I.jsx("span",{className:"cursor-blink text-accent",children:"▋"})]}),I.jsxs("div",{className:"ml-auto flex min-w-0 items-center gap-3",children:[I.jsx(oF,{conn:t,freshAt:(e==null?void 0:e.generatedAt)??null}),I.jsx(iF,{onOpen:()=>d(!0)}),I.jsx(sF,{theme:i,onToggle:u}),$&&(b||B)&&I.jsx(o2,{derived:y,periodLabel:h,tz:(e==null?void 0:e.tz)??"",version:(e==null?void 0:e.version)??""})]})]}),I.jsx("nav",{className:"-mb-px flex items-center gap-1 overflow-x-auto","aria-label":"Dashboard sections",children:Hv.map(Z=>I.jsx(Dp,{to:Tp(Z.key),"aria-current":w===Z.key?"page":void 0,onMouseEnter:()=>vx(Z.key),onFocus:()=>vx(Z.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 ${w===Z.key?"border-accent text-fg-bright":"border-transparent text-fg-faint hover:text-fg-dim"}`,children:Z.label},Z.key))})]}),I.jsx(t2,{snapshot:e,derived:y,filters:n,setFilters:o,privacyMode:m})]}),I.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:[(e==null?void 0:e.seeded)&&I.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:[I.jsx("span",{className:"inline-flex size-2 rounded-full",style:{background:"var(--color-cost)"},"aria-hidden":!0}),"showing cached data — refreshing…"]}),e?!b&&!B?_&&!L&&t!=="error"?I.jsx(Lh,{label:"reading billing…"}):I.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."}):!$||!D?I.jsx(Lh,{label:t==="error"?"connection lost — retrying…":"reading usage history…"}):I.jsx(G_.Provider,{value:D,children:I.jsx(xw,{})}):I.jsx(Lh,{label:t==="error"?"connection lost — retrying…":"reading usage…"})]}),I.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"]}),l?I.jsx(te.Suspense,{fallback:I.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:I.jsx(tF,{snapshot:e,onClose:()=>d(!1)})}):null]})}function Sx(){const{derived:e,periodLabel:t,scopeLabel:n,snapshot:o,privacyMode:i}=Yl();return I.jsx(te.Suspense,{fallback:I.jsx(Xl,{label:"overview"}),children:I.jsx(Y$,{derived:e,periodLabel:t,scopeLabel:n,providers:o.providers,privacyMode:i})})}function uF(){const{derived:e,scopeLabel:t}=Yl();return I.jsx(te.Suspense,{fallback:I.jsx(Xl,{label:"analytics"}),children:I.jsx(X$,{derived:e,scopeLabel:t})})}function cF(){const{derived:e,scopeLabel:t}=Yl();return I.jsx(te.Suspense,{fallback:I.jsx(Xl,{label:"models"}),children:I.jsx(Z$,{derived:e,scopeLabel:t})})}function lF(){const{snapshot:e,filters:t,periodLabel:n,privacyMode:o}=Yl();return I.jsx(te.Suspense,{fallback:I.jsx(Xl,{label:"explore"}),children:I.jsx(eF,{snapshot:e,filters:t,periodLabel:n,privacyMode:o})})}function Xl({label:e}){return I.jsxs("div",{className:"min-h-[50vh] content-center text-center text-sm text-fg-faint",role:"status","aria-live":"polite",children:["Loading ",e,"…"]})}const Op=oI({component:aF}),Ec=(e,t)=>yw({getParentRoute:()=>Op,path:Tp(e),component:t}),fF=Op.addChildren([yw({getParentRoute:()=>Op,path:"/",component:Sx}),Ec("overview",Sx),Ec("analytics",uF),Ec("models",cF),Ec("explore",lF)]),dF=vI({routeTree:fF,history:pb(),defaultViewTransition:!0});function hF(){return I.jsx(wI,{router:dF})}rP.createRoot(document.getElementById("root")).render(I.jsx(te.StrictMode,{children:I.jsx(bP,{children:I.jsx(s2,{children:I.jsx(hF,{})})})}));export{J$ as $,jv as A,SF as B,NF as C,zp as D,uh as E,vF as F,xF as G,bI as H,AF as I,wF as J,yF as K,VF as L,OF as M,QI as N,BF as O,Vv as P,zF as Q,ya as R,e2 as S,_F as T,UF as U,gF as V,a4 as W,JI as X,FF as Y,o4 as Z,cr as _,PF as a,i4 as a0,jF as a1,$F as a2,mF as a3,bF as b,ZI as c,TF as d,CF as e,EF as f,AI as g,Bp as h,Vp as i,I as j,JC as k,RF as l,MI as m,kw as n,$I as o,kF as p,DI as q,te as r,zv as s,LF as t,Cw as u,IF as v,MF as w,r2 as x,KI as y,DF as z};
|