@tokenbuddy/tokenbuddy 1.0.21 → 1.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.d.ts.map +1 -1
- package/dist/src/cli.js +12 -0
- package/dist/src/cli.js.map +1 -1
- package/package.json +1 -1
- package/src/cli.ts +15 -0
- package/static/ui/assets/index-BbKhGBef.js +236 -0
- package/static/ui/assets/index-BbKhGBef.js.map +1 -0
- package/static/ui/assets/index-Cew0KSjk.css +1 -0
- package/static/ui/index.html +2 -2
- package/tests/tokenbuddy.test.ts +6 -0
- package/static/ui/assets/index-BBuXE99D.js +0 -216
- package/static/ui/assets/index-BBuXE99D.js.map +0 -1
- package/static/ui/assets/index-yD_hcuW8.css +0 -1
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
var qb=Object.defineProperty;var cv=a=>{throw TypeError(a)};var Qb=(a,i,r)=>i in a?qb(a,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[i]=r;var pd=(a,i,r)=>Qb(a,typeof i!="symbol"?i+"":i,r),vd=(a,i,r)=>i.has(a)||cv("Cannot "+r);var N=(a,i,r)=>(vd(a,i,"read from private field"),r?r.call(a):i.get(a)),ce=(a,i,r)=>i.has(a)?cv("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(a):i.set(a,r),te=(a,i,r,u)=>(vd(a,i,"write to private field"),u?u.call(a,r):i.set(a,r),r),ye=(a,i,r)=>(vd(a,i,"access private method"),r);var Ao=(a,i,r,u)=>({set _(d){te(a,i,d,r)},get _(){return N(a,i,u)}});(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))u(d);new MutationObserver(d=>{for(const m of d)if(m.type==="childList")for(const h of m.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&u(h)}).observe(document,{childList:!0,subtree:!0});function r(d){const m={};return d.integrity&&(m.integrity=d.integrity),d.referrerPolicy&&(m.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?m.credentials="include":d.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function u(d){if(d.ep)return;d.ep=!0;const m=r(d);fetch(d.href,m)}})();var xd={exports:{}},Br={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var dv;function Yb(){if(dv)return Br;dv=1;var a=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function r(u,d,m){var h=null;if(m!==void 0&&(h=""+m),d.key!==void 0&&(h=""+d.key),"key"in d){m={};for(var x in d)x!=="key"&&(m[x]=d[x])}else m=d;return d=m.ref,{$$typeof:a,type:u,key:h,ref:d!==void 0?d:null,props:m}}return Br.Fragment=i,Br.jsx=r,Br.jsxs=r,Br}var fv;function Gb(){return fv||(fv=1,xd.exports=Yb()),xd.exports}var s=Gb(),yd={exports:{}},he={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var mv;function Kb(){if(mv)return he;mv=1;var a=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),h=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),E=Symbol.iterator;function C(M){return M===null||typeof M!="object"?null:(M=E&&M[E]||M["@@iterator"],typeof M=="function"?M:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},z=Object.assign,U={};function D(M,_,Z){this.props=M,this.context=_,this.refs=U,this.updater=Z||A}D.prototype.isReactComponent={},D.prototype.setState=function(M,_){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,_,"setState")},D.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function G(){}G.prototype=D.prototype;function K(M,_,Z){this.props=M,this.context=_,this.refs=U,this.updater=Z||A}var L=K.prototype=new G;L.constructor=K,z(L,D.prototype),L.isPureReactComponent=!0;var V=Array.isArray;function I(){}var J={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function le(M,_,Z){var P=Z.ref;return{$$typeof:a,type:M,key:_,ref:P!==void 0?P:null,props:Z}}function oe(M,_){return le(M.type,_,M.props)}function F(M){return typeof M=="object"&&M!==null&&M.$$typeof===a}function me(M){var _={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(Z){return _[Z]})}var pe=/\/+/g;function Ee(M,_){return typeof M=="object"&&M!==null&&M.key!=null?me(""+M.key):_.toString(36)}function ue(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(I,I):(M.status="pending",M.then(function(_){M.status==="pending"&&(M.status="fulfilled",M.value=_)},function(_){M.status==="pending"&&(M.status="rejected",M.reason=_)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function B(M,_,Z,P,X){var ae=typeof M;(ae==="undefined"||ae==="boolean")&&(M=null);var W=!1;if(M===null)W=!0;else switch(ae){case"bigint":case"string":case"number":W=!0;break;case"object":switch(M.$$typeof){case a:case i:W=!0;break;case g:return W=M._init,B(W(M._payload),_,Z,P,X)}}if(W)return X=X(M),W=P===""?"."+Ee(M,0):P,V(X)?(Z="",W!=null&&(Z=W.replace(pe,"$&/")+"/"),B(X,_,Z,"",function(bl){return bl})):X!=null&&(F(X)&&(X=oe(X,Z+(X.key==null||M&&M.key===X.key?"":(""+X.key).replace(pe,"$&/")+"/")+W)),_.push(X)),1;W=0;var Ae=P===""?".":P+":";if(V(M))for(var Oe=0;Oe<M.length;Oe++)P=M[Oe],ae=Ae+Ee(P,Oe),W+=B(P,_,Z,ae,X);else if(Oe=C(M),typeof Oe=="function")for(M=Oe.call(M),Oe=0;!(P=M.next()).done;)P=P.value,ae=Ae+Ee(P,Oe++),W+=B(P,_,Z,ae,X);else if(ae==="object"){if(typeof M.then=="function")return B(ue(M),_,Z,P,X);throw _=String(M),Error("Objects are not valid as a React child (found: "+(_==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":_)+"). If you meant to render a collection of children, use an array instead.")}return W}function $(M,_,Z){if(M==null)return M;var P=[],X=0;return B(M,P,"","",function(ae){return _.call(Z,ae,X++)}),P}function re(M){if(M._status===-1){var _=M._result;_=_(),_.then(function(Z){(M._status===0||M._status===-1)&&(M._status=1,M._result=Z)},function(Z){(M._status===0||M._status===-1)&&(M._status=2,M._result=Z)}),M._status===-1&&(M._status=0,M._result=_)}if(M._status===1)return M._result.default;throw M._result}var be=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var _=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(_))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},ge={map:$,forEach:function(M,_,Z){$(M,function(){_.apply(this,arguments)},Z)},count:function(M){var _=0;return $(M,function(){_++}),_},toArray:function(M){return $(M,function(_){return _})||[]},only:function(M){if(!F(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return he.Activity=b,he.Children=ge,he.Component=D,he.Fragment=r,he.Profiler=d,he.PureComponent=K,he.StrictMode=u,he.Suspense=p,he.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=J,he.__COMPILER_RUNTIME={__proto__:null,c:function(M){return J.H.useMemoCache(M)}},he.cache=function(M){return function(){return M.apply(null,arguments)}},he.cacheSignal=function(){return null},he.cloneElement=function(M,_,Z){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var P=z({},M.props),X=M.key;if(_!=null)for(ae in _.key!==void 0&&(X=""+_.key),_)!ee.call(_,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&_.ref===void 0||(P[ae]=_[ae]);var ae=arguments.length-2;if(ae===1)P.children=Z;else if(1<ae){for(var W=Array(ae),Ae=0;Ae<ae;Ae++)W[Ae]=arguments[Ae+2];P.children=W}return le(M.type,X,P)},he.createContext=function(M){return M={$$typeof:h,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:m,_context:M},M},he.createElement=function(M,_,Z){var P,X={},ae=null;if(_!=null)for(P in _.key!==void 0&&(ae=""+_.key),_)ee.call(_,P)&&P!=="key"&&P!=="__self"&&P!=="__source"&&(X[P]=_[P]);var W=arguments.length-2;if(W===1)X.children=Z;else if(1<W){for(var Ae=Array(W),Oe=0;Oe<W;Oe++)Ae[Oe]=arguments[Oe+2];X.children=Ae}if(M&&M.defaultProps)for(P in W=M.defaultProps,W)X[P]===void 0&&(X[P]=W[P]);return le(M,ae,X)},he.createRef=function(){return{current:null}},he.forwardRef=function(M){return{$$typeof:x,render:M}},he.isValidElement=F,he.lazy=function(M){return{$$typeof:g,_payload:{_status:-1,_result:M},_init:re}},he.memo=function(M,_){return{$$typeof:v,type:M,compare:_===void 0?null:_}},he.startTransition=function(M){var _=J.T,Z={};J.T=Z;try{var P=M(),X=J.S;X!==null&&X(Z,P),typeof P=="object"&&P!==null&&typeof P.then=="function"&&P.then(I,be)}catch(ae){be(ae)}finally{_!==null&&Z.types!==null&&(_.types=Z.types),J.T=_}},he.unstable_useCacheRefresh=function(){return J.H.useCacheRefresh()},he.use=function(M){return J.H.use(M)},he.useActionState=function(M,_,Z){return J.H.useActionState(M,_,Z)},he.useCallback=function(M,_){return J.H.useCallback(M,_)},he.useContext=function(M){return J.H.useContext(M)},he.useDebugValue=function(){},he.useDeferredValue=function(M,_){return J.H.useDeferredValue(M,_)},he.useEffect=function(M,_){return J.H.useEffect(M,_)},he.useEffectEvent=function(M){return J.H.useEffectEvent(M)},he.useId=function(){return J.H.useId()},he.useImperativeHandle=function(M,_,Z){return J.H.useImperativeHandle(M,_,Z)},he.useInsertionEffect=function(M,_){return J.H.useInsertionEffect(M,_)},he.useLayoutEffect=function(M,_){return J.H.useLayoutEffect(M,_)},he.useMemo=function(M,_){return J.H.useMemo(M,_)},he.useOptimistic=function(M,_){return J.H.useOptimistic(M,_)},he.useReducer=function(M,_,Z){return J.H.useReducer(M,_,Z)},he.useRef=function(M){return J.H.useRef(M)},he.useState=function(M){return J.H.useState(M)},he.useSyncExternalStore=function(M,_,Z){return J.H.useSyncExternalStore(M,_,Z)},he.useTransition=function(){return J.H.useTransition()},he.version="19.2.7",he}var hv;function tf(){return hv||(hv=1,yd.exports=Kb()),yd.exports}var j=tf(),bd={exports:{}},Hr={},gd={exports:{}},jd={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var pv;function Xb(){return pv||(pv=1,(function(a){function i(B,$){var re=B.length;B.push($);e:for(;0<re;){var be=re-1>>>1,ge=B[be];if(0<d(ge,$))B[be]=$,B[re]=ge,re=be;else break e}}function r(B){return B.length===0?null:B[0]}function u(B){if(B.length===0)return null;var $=B[0],re=B.pop();if(re!==$){B[0]=re;e:for(var be=0,ge=B.length,M=ge>>>1;be<M;){var _=2*(be+1)-1,Z=B[_],P=_+1,X=B[P];if(0>d(Z,re))P<ge&&0>d(X,Z)?(B[be]=X,B[P]=re,be=P):(B[be]=Z,B[_]=re,be=_);else if(P<ge&&0>d(X,re))B[be]=X,B[P]=re,be=P;else break e}}return $}function d(B,$){var re=B.sortIndex-$.sortIndex;return re!==0?re:B.id-$.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;a.unstable_now=function(){return m.now()}}else{var h=Date,x=h.now();a.unstable_now=function(){return h.now()-x}}var p=[],v=[],g=1,b=null,E=3,C=!1,A=!1,z=!1,U=!1,D=typeof setTimeout=="function"?setTimeout:null,G=typeof clearTimeout=="function"?clearTimeout:null,K=typeof setImmediate<"u"?setImmediate:null;function L(B){for(var $=r(v);$!==null;){if($.callback===null)u(v);else if($.startTime<=B)u(v),$.sortIndex=$.expirationTime,i(p,$);else break;$=r(v)}}function V(B){if(z=!1,L(B),!A)if(r(p)!==null)A=!0,I||(I=!0,me());else{var $=r(v);$!==null&&ue(V,$.startTime-B)}}var I=!1,J=-1,ee=5,le=-1;function oe(){return U?!0:!(a.unstable_now()-le<ee)}function F(){if(U=!1,I){var B=a.unstable_now();le=B;var $=!0;try{e:{A=!1,z&&(z=!1,G(J),J=-1),C=!0;var re=E;try{t:{for(L(B),b=r(p);b!==null&&!(b.expirationTime>B&&oe());){var be=b.callback;if(typeof be=="function"){b.callback=null,E=b.priorityLevel;var ge=be(b.expirationTime<=B);if(B=a.unstable_now(),typeof ge=="function"){b.callback=ge,L(B),$=!0;break t}b===r(p)&&u(p),L(B)}else u(p);b=r(p)}if(b!==null)$=!0;else{var M=r(v);M!==null&&ue(V,M.startTime-B),$=!1}}break e}finally{b=null,E=re,C=!1}$=void 0}}finally{$?me():I=!1}}}var me;if(typeof K=="function")me=function(){K(F)};else if(typeof MessageChannel<"u"){var pe=new MessageChannel,Ee=pe.port2;pe.port1.onmessage=F,me=function(){Ee.postMessage(null)}}else me=function(){D(F,0)};function ue(B,$){J=D(function(){B(a.unstable_now())},$)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(B){B.callback=null},a.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ee=0<B?Math.floor(1e3/B):5},a.unstable_getCurrentPriorityLevel=function(){return E},a.unstable_next=function(B){switch(E){case 1:case 2:case 3:var $=3;break;default:$=E}var re=E;E=$;try{return B()}finally{E=re}},a.unstable_requestPaint=function(){U=!0},a.unstable_runWithPriority=function(B,$){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var re=E;E=B;try{return $()}finally{E=re}},a.unstable_scheduleCallback=function(B,$,re){var be=a.unstable_now();switch(typeof re=="object"&&re!==null?(re=re.delay,re=typeof re=="number"&&0<re?be+re:be):re=be,B){case 1:var ge=-1;break;case 2:ge=250;break;case 5:ge=1073741823;break;case 4:ge=1e4;break;default:ge=5e3}return ge=re+ge,B={id:g++,callback:$,priorityLevel:B,startTime:re,expirationTime:ge,sortIndex:-1},re>be?(B.sortIndex=re,i(v,B),r(p)===null&&B===r(v)&&(z?(G(J),J=-1):z=!0,ue(V,re-be))):(B.sortIndex=ge,i(p,B),A||C||(A=!0,I||(I=!0,me()))),B},a.unstable_shouldYield=oe,a.unstable_wrapCallback=function(B){var $=E;return function(){var re=E;E=$;try{return B.apply(this,arguments)}finally{E=re}}}})(jd)),jd}var vv;function Vb(){return vv||(vv=1,gd.exports=Xb()),gd.exports}var Sd={exports:{}},yt={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var xv;function Zb(){if(xv)return yt;xv=1;var a=tf();function i(p){var v="https://react.dev/errors/"+p;if(1<arguments.length){v+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)v+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+p+"; visit "+v+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var u={d:{f:r,r:function(){throw Error(i(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},d=Symbol.for("react.portal");function m(p,v,g){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:b==null?null:""+b,children:p,containerInfo:v,implementation:g}}var h=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function x(p,v){if(p==="font")return"";if(typeof v=="string")return v==="use-credentials"?v:""}return yt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,yt.createPortal=function(p,v){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!v||v.nodeType!==1&&v.nodeType!==9&&v.nodeType!==11)throw Error(i(299));return m(p,v,null,g)},yt.flushSync=function(p){var v=h.T,g=u.p;try{if(h.T=null,u.p=2,p)return p()}finally{h.T=v,u.p=g,u.d.f()}},yt.preconnect=function(p,v){typeof p=="string"&&(v?(v=v.crossOrigin,v=typeof v=="string"?v==="use-credentials"?v:"":void 0):v=null,u.d.C(p,v))},yt.prefetchDNS=function(p){typeof p=="string"&&u.d.D(p)},yt.preinit=function(p,v){if(typeof p=="string"&&v&&typeof v.as=="string"){var g=v.as,b=x(g,v.crossOrigin),E=typeof v.integrity=="string"?v.integrity:void 0,C=typeof v.fetchPriority=="string"?v.fetchPriority:void 0;g==="style"?u.d.S(p,typeof v.precedence=="string"?v.precedence:void 0,{crossOrigin:b,integrity:E,fetchPriority:C}):g==="script"&&u.d.X(p,{crossOrigin:b,integrity:E,fetchPriority:C,nonce:typeof v.nonce=="string"?v.nonce:void 0})}},yt.preinitModule=function(p,v){if(typeof p=="string")if(typeof v=="object"&&v!==null){if(v.as==null||v.as==="script"){var g=x(v.as,v.crossOrigin);u.d.M(p,{crossOrigin:g,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0})}}else v==null&&u.d.M(p)},yt.preload=function(p,v){if(typeof p=="string"&&typeof v=="object"&&v!==null&&typeof v.as=="string"){var g=v.as,b=x(g,v.crossOrigin);u.d.L(p,g,{crossOrigin:b,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0,type:typeof v.type=="string"?v.type:void 0,fetchPriority:typeof v.fetchPriority=="string"?v.fetchPriority:void 0,referrerPolicy:typeof v.referrerPolicy=="string"?v.referrerPolicy:void 0,imageSrcSet:typeof v.imageSrcSet=="string"?v.imageSrcSet:void 0,imageSizes:typeof v.imageSizes=="string"?v.imageSizes:void 0,media:typeof v.media=="string"?v.media:void 0})}},yt.preloadModule=function(p,v){if(typeof p=="string")if(v){var g=x(v.as,v.crossOrigin);u.d.m(p,{as:typeof v.as=="string"&&v.as!=="script"?v.as:void 0,crossOrigin:g,integrity:typeof v.integrity=="string"?v.integrity:void 0})}else u.d.m(p)},yt.requestFormReset=function(p){u.d.r(p)},yt.unstable_batchedUpdates=function(p,v){return p(v)},yt.useFormState=function(p,v,g){return h.H.useFormState(p,v,g)},yt.useFormStatus=function(){return h.H.useHostTransitionStatus()},yt.version="19.2.7",yt}var yv;function $b(){if(yv)return Sd.exports;yv=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(i){console.error(i)}}return a(),Sd.exports=Zb(),Sd.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var bv;function Jb(){if(bv)return Hr;bv=1;var a=Vb(),i=tf(),r=$b();function u(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)t+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function m(e){var t=e,l=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(l=t.return),e=t.return;while(e)}return t.tag===3?l:null}function h(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function x(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(m(e)!==e)throw Error(u(188))}function v(e){var t=e.alternate;if(!t){if(t=m(e),t===null)throw Error(u(188));return t!==e?null:e}for(var l=e,n=t;;){var o=l.return;if(o===null)break;var c=o.alternate;if(c===null){if(n=o.return,n!==null){l=n;continue}break}if(o.child===c.child){for(c=o.child;c;){if(c===l)return p(o),e;if(c===n)return p(o),t;c=c.sibling}throw Error(u(188))}if(l.return!==n.return)l=o,n=c;else{for(var f=!1,y=o.child;y;){if(y===l){f=!0,l=o,n=c;break}if(y===n){f=!0,n=o,l=c;break}y=y.sibling}if(!f){for(y=c.child;y;){if(y===l){f=!0,l=c,n=o;break}if(y===n){f=!0,n=c,l=o;break}y=y.sibling}if(!f)throw Error(u(189))}}if(l.alternate!==n)throw Error(u(190))}if(l.tag!==3)throw Error(u(188));return l.stateNode.current===l?e:t}function g(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=g(e),t!==null)return t;e=e.sibling}return null}var b=Object.assign,E=Symbol.for("react.element"),C=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),z=Symbol.for("react.fragment"),U=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),G=Symbol.for("react.consumer"),K=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),ee=Symbol.for("react.lazy"),le=Symbol.for("react.activity"),oe=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function me(e){return e===null||typeof e!="object"?null:(e=F&&e[F]||e["@@iterator"],typeof e=="function"?e:null)}var pe=Symbol.for("react.client.reference");function Ee(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===pe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case z:return"Fragment";case D:return"Profiler";case U:return"StrictMode";case V:return"Suspense";case I:return"SuspenseList";case le:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case A:return"Portal";case K:return e.displayName||"Context";case G:return(e._context.displayName||"Context")+".Consumer";case L:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case J:return t=e.displayName||null,t!==null?t:Ee(e.type)||"Memo";case ee:t=e._payload,e=e._init;try{return Ee(e(t))}catch{}}return null}var ue=Array.isArray,B=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},be=[],ge=-1;function M(e){return{current:e}}function _(e){0>ge||(e.current=be[ge],be[ge]=null,ge--)}function Z(e,t){ge++,be[ge]=e.current,e.current=t}var P=M(null),X=M(null),ae=M(null),W=M(null);function Ae(e,t){switch(Z(ae,t),Z(X,e),Z(P,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?_p(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=_p(t),e=kp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}_(P),Z(P,e)}function Oe(){_(P),_(X),_(ae)}function bl(e){e.memoizedState!==null&&Z(W,e);var t=P.current,l=kp(t,e.type);t!==l&&(Z(X,e),Z(P,l))}function ia(e){X.current===e&&(_(P),_(X)),W.current===e&&(_(W),_r._currentValue=re)}var En,At;function ft(e){if(En===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);En=t&&t[1]||"",At=-1<l.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+En+e+At}var An=!1;function ra(e,t){if(!e||An)return"";An=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var Y=function(){throw Error()};if(Object.defineProperty(Y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Y,[])}catch(H){var k=H}Reflect.construct(e,[],Y)}else{try{Y.call()}catch(H){k=H}e.call(Y.prototype)}}else{try{throw Error()}catch(H){k=H}(Y=e())&&typeof Y.catch=="function"&&Y.catch(function(){})}}catch(H){if(H&&k&&typeof H.stack=="string")return[H.stack,k.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=n.DetermineComponentFrameRoot(),f=c[0],y=c[1];if(f&&y){var S=f.split(`
|
|
44
|
+
`),O=y.split(`
|
|
45
|
+
`);for(o=n=0;n<S.length&&!S[n].includes("DetermineComponentFrameRoot");)n++;for(;o<O.length&&!O[o].includes("DetermineComponentFrameRoot");)o++;if(n===S.length||o===O.length)for(n=S.length-1,o=O.length-1;1<=n&&0<=o&&S[n]!==O[o];)o--;for(;1<=n&&0<=o;n--,o--)if(S[n]!==O[o]){if(n!==1||o!==1)do if(n--,o--,0>o||S[n]!==O[o]){var q=`
|
|
46
|
+
`+S[n].replace(" at new "," at ");return e.displayName&&q.includes("<anonymous>")&&(q=q.replace("<anonymous>",e.displayName)),q}while(1<=n&&0<=o);break}}}finally{An=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?ft(l):""}function tu(e,t){switch(e.tag){case 26:case 27:case 5:return ft(e.type);case 16:return ft("Lazy");case 13:return e.child!==t&&t!==null?ft("Suspense Fallback"):ft("Suspense");case 19:return ft("SuspenseList");case 0:case 15:return ra(e.type,!1);case 11:return ra(e.type.render,!1);case 1:return ra(e.type,!0);case 31:return ft("Activity");default:return""}}function zn(e){try{var t="",l=null;do t+=tu(e,l),l=e,e=e.return;while(e);return t}catch(n){return`
|
|
47
|
+
Error generating stack: `+n.message+`
|
|
48
|
+
`+n.stack}}var gl=Object.prototype.hasOwnProperty,Va=a.unstable_scheduleCallback,sa=a.unstable_cancelCallback,ss=a.unstable_shouldYield,os=a.unstable_requestPaint,Nt=a.unstable_now,lu=a.unstable_getCurrentPriorityLevel,us=a.unstable_ImmediatePriority,cs=a.unstable_UserBlockingPriority,Rn=a.unstable_NormalPriority,au=a.unstable_LowPriority,ds=a.unstable_IdlePriority,nu=a.log,iu=a.unstable_setDisableYieldValue,Za=null,Mt=null;function jl(e){if(typeof nu=="function"&&iu(e),Mt&&typeof Mt.setStrictMode=="function")try{Mt.setStrictMode(Za,e)}catch{}}var wt=Math.clz32?Math.clz32:hs,fs=Math.log,ms=Math.LN2;function hs(e){return e>>>=0,e===0?32:31-(fs(e)/ms|0)|0}var $a=256,Ja=262144,Fa=4194304;function Sl(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Wa(e,t,l){var n=e.pendingLanes;if(n===0)return 0;var o=0,c=e.suspendedLanes,f=e.pingedLanes;e=e.warmLanes;var y=n&134217727;return y!==0?(n=y&~c,n!==0?o=Sl(n):(f&=y,f!==0?o=Sl(f):l||(l=y&~e,l!==0&&(o=Sl(l))))):(y=n&~c,y!==0?o=Sl(y):f!==0?o=Sl(f):l||(l=n&~e,l!==0&&(o=Sl(l)))),o===0?0:t!==0&&t!==o&&(t&c)===0&&(c=o&-o,l=t&-t,c>=l||c===32&&(l&4194048)!==0)?t:o}function oa(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ps(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ki(){var e=Fa;return Fa<<=1,(Fa&62914560)===0&&(Fa=4194304),e}function On(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function ie(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Qe(e,t,l,n,o,c){var f=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var y=e.entanglements,S=e.expirationTimes,O=e.hiddenUpdates;for(l=f&~l;0<l;){var q=31-wt(l),Y=1<<q;y[q]=0,S[q]=-1;var k=O[q];if(k!==null)for(O[q]=null,q=0;q<k.length;q++){var H=k[q];H!==null&&(H.lane&=-536870913)}l&=~Y}n!==0&&Lt(e,n,0),c!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=c&~(f&~t))}function Lt(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-wt(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|l&261930}function ua(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var n=31-wt(l),o=1<<n;o&t|e[n]&t&&(e[n]|=t),l&=~o}}function Xi(e,t){var l=t&-t;return l=(l&42)!==0?1:_n(l),(l&(e.suspendedLanes|t))!==0?0:l}function _n(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function kn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Vi(){var e=$.p;return e!==0?e:(e=window.event,e===void 0?32:av(e.type))}function Zi(e,t){var l=$.p;try{return $.p=e,t()}finally{$.p=l}}var ot=Math.random().toString(36).slice(2),Ye="__reactFiber$"+ot,et="__reactProps$"+ot,Dn="__reactContainer$"+ot,ru="__reactEvents$"+ot,A0="__reactListeners$"+ot,z0="__reactHandles$"+ot,gf="__reactResources$"+ot,$i="__reactMarker$"+ot;function su(e){delete e[Ye],delete e[et],delete e[ru],delete e[A0],delete e[z0]}function Un(e){var t=e[Ye];if(t)return t;for(var l=e.parentNode;l;){if(t=l[Dn]||l[Ye]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=Qp(e);e!==null;){if(l=e[Ye])return l;e=Qp(e)}return t}e=l,l=e.parentNode}return null}function Bn(e){if(e=e[Ye]||e[Dn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ji(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function Hn(e){var t=e[gf];return t||(t=e[gf]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ut(e){e[$i]=!0}var jf=new Set,Sf={};function Pa(e,t){Ln(e,t),Ln(e+"Capture",t)}function Ln(e,t){for(Sf[e]=t,e=0;e<t.length;e++)jf.add(t[e])}var R0=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Nf={},Mf={};function O0(e){return gl.call(Mf,e)?!0:gl.call(Nf,e)?!1:R0.test(e)?Mf[e]=!0:(Nf[e]=!0,!1)}function vs(e,t,l){if(O0(t))if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+l)}}function xs(e,t,l){if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+l)}}function Ol(e,t,l,n){if(n===null)e.removeAttribute(l);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(t,l,""+n)}}function Ft(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function wf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function _0(e,t,l){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,c=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(f){l=""+f,c.call(this,f)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return l},setValue:function(f){l=""+f},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ou(e){if(!e._valueTracker){var t=wf(e)?"checked":"value";e._valueTracker=_0(e,t,""+e[t])}}function Cf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),n="";return e&&(n=wf(e)?e.checked?"true":"false":e.value),e=n,e!==l?(t.setValue(e),!0):!1}function ys(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var k0=/[\n"\\]/g;function Wt(e){return e.replace(k0,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function uu(e,t,l,n,o,c,f,y){e.name="",f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.type=f:e.removeAttribute("type"),t!=null?f==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ft(t)):e.value!==""+Ft(t)&&(e.value=""+Ft(t)):f!=="submit"&&f!=="reset"||e.removeAttribute("value"),t!=null?cu(e,f,Ft(t)):l!=null?cu(e,f,Ft(l)):n!=null&&e.removeAttribute("value"),o==null&&c!=null&&(e.defaultChecked=!!c),o!=null&&(e.checked=o&&typeof o!="function"&&typeof o!="symbol"),y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.name=""+Ft(y):e.removeAttribute("name")}function Tf(e,t,l,n,o,c,f,y){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||l!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){ou(e);return}l=l!=null?""+Ft(l):"",t=t!=null?""+Ft(t):l,y||t===e.value||(e.value=t),e.defaultValue=t}n=n??o,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=y?e.checked:!!n,e.defaultChecked=!!n,f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.name=f),ou(e)}function cu(e,t,l){t==="number"&&ys(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function qn(e,t,l,n){if(e=e.options,t){t={};for(var o=0;o<l.length;o++)t["$"+l[o]]=!0;for(l=0;l<e.length;l++)o=t.hasOwnProperty("$"+e[l].value),e[l].selected!==o&&(e[l].selected=o),o&&n&&(e[l].defaultSelected=!0)}else{for(l=""+Ft(l),t=null,o=0;o<e.length;o++){if(e[o].value===l){e[o].selected=!0,n&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Ef(e,t,l){if(t!=null&&(t=""+Ft(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+Ft(l):""}function Af(e,t,l,n){if(t==null){if(n!=null){if(l!=null)throw Error(u(92));if(ue(n)){if(1<n.length)throw Error(u(93));n=n[0]}l=n}l==null&&(l=""),t=l}l=Ft(t),e.defaultValue=l,n=e.textContent,n===l&&n!==""&&n!==null&&(e.value=n),ou(e)}function Qn(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var D0=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function zf(e,t,l){var n=t.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,l):typeof l!="number"||l===0||D0.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function Rf(e,t,l){if(t!=null&&typeof t!="object")throw Error(u(62));if(e=e.style,l!=null){for(var n in l)!l.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var o in t)n=t[o],t.hasOwnProperty(o)&&l[o]!==n&&zf(e,o,n)}else for(var c in t)t.hasOwnProperty(c)&&zf(e,c,t[c])}function du(e){if(e.indexOf("-")===-1)return!1;switch(e){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 U0=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),B0=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function bs(e){return B0.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function _l(){}var fu=null;function mu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Yn=null,Gn=null;function Of(e){var t=Bn(e);if(t&&(e=t.stateNode)){var l=e[et]||null;e:switch(e=t.stateNode,t.type){case"input":if(uu(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),t=l.name,l.type==="radio"&&t!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Wt(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var n=l[t];if(n!==e&&n.form===e.form){var o=n[et]||null;if(!o)throw Error(u(90));uu(n,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(t=0;t<l.length;t++)n=l[t],n.form===e.form&&Cf(n)}break e;case"textarea":Ef(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&qn(e,!!l.multiple,t,!1)}}}var hu=!1;function _f(e,t,l){if(hu)return e(t,l);hu=!0;try{var n=e(t);return n}finally{if(hu=!1,(Yn!==null||Gn!==null)&&(ro(),Yn&&(t=Yn,e=Gn,Gn=Yn=null,Of(t),e)))for(t=0;t<e.length;t++)Of(e[t])}}function Fi(e,t){var l=e.stateNode;if(l===null)return null;var n=l[et]||null;if(n===null)return null;l=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(u(231,t,typeof l));return l}var kl=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),pu=!1;if(kl)try{var Wi={};Object.defineProperty(Wi,"passive",{get:function(){pu=!0}}),window.addEventListener("test",Wi,Wi),window.removeEventListener("test",Wi,Wi)}catch{pu=!1}var ca=null,vu=null,gs=null;function kf(){if(gs)return gs;var e,t=vu,l=t.length,n,o="value"in ca?ca.value:ca.textContent,c=o.length;for(e=0;e<l&&t[e]===o[e];e++);var f=l-e;for(n=1;n<=f&&t[l-n]===o[c-n];n++);return gs=o.slice(e,1<n?1-n:void 0)}function js(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ss(){return!0}function Df(){return!1}function zt(e){function t(l,n,o,c,f){this._reactName=l,this._targetInst=o,this.type=n,this.nativeEvent=c,this.target=f,this.currentTarget=null;for(var y in e)e.hasOwnProperty(y)&&(l=e[y],this[y]=l?l(c):c[y]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?Ss:Df,this.isPropagationStopped=Df,this}return b(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Ss)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Ss)},persist:function(){},isPersistent:Ss}),t}var Ia={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ns=zt(Ia),Pi=b({},Ia,{view:0,detail:0}),H0=zt(Pi),xu,yu,Ii,Ms=b({},Pi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:gu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ii&&(Ii&&e.type==="mousemove"?(xu=e.screenX-Ii.screenX,yu=e.screenY-Ii.screenY):yu=xu=0,Ii=e),xu)},movementY:function(e){return"movementY"in e?e.movementY:yu}}),Uf=zt(Ms),L0=b({},Ms,{dataTransfer:0}),q0=zt(L0),Q0=b({},Pi,{relatedTarget:0}),bu=zt(Q0),Y0=b({},Ia,{animationName:0,elapsedTime:0,pseudoElement:0}),G0=zt(Y0),K0=b({},Ia,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),X0=zt(K0),V0=b({},Ia,{data:0}),Bf=zt(V0),Z0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$0={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"},J0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function F0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=J0[e])?!!t[e]:!1}function gu(){return F0}var W0=b({},Pi,{key:function(e){if(e.key){var t=Z0[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=js(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?$0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:gu,charCode:function(e){return e.type==="keypress"?js(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?js(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),P0=zt(W0),I0=b({},Ms,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Hf=zt(I0),ey=b({},Pi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:gu}),ty=zt(ey),ly=b({},Ia,{propertyName:0,elapsedTime:0,pseudoElement:0}),ay=zt(ly),ny=b({},Ms,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),iy=zt(ny),ry=b({},Ia,{newState:0,oldState:0}),sy=zt(ry),oy=[9,13,27,32],ju=kl&&"CompositionEvent"in window,er=null;kl&&"documentMode"in document&&(er=document.documentMode);var uy=kl&&"TextEvent"in window&&!er,Lf=kl&&(!ju||er&&8<er&&11>=er),qf=" ",Qf=!1;function Yf(e,t){switch(e){case"keyup":return oy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Gf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Kn=!1;function cy(e,t){switch(e){case"compositionend":return Gf(t);case"keypress":return t.which!==32?null:(Qf=!0,qf);case"textInput":return e=t.data,e===qf&&Qf?null:e;default:return null}}function dy(e,t){if(Kn)return e==="compositionend"||!ju&&Yf(e,t)?(e=kf(),gs=vu=ca=null,Kn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Lf&&t.locale!=="ko"?null:t.data;default:return null}}var fy={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 Kf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!fy[e.type]:t==="textarea"}function Xf(e,t,l,n){Yn?Gn?Gn.push(n):Gn=[n]:Yn=n,t=ho(t,"onChange"),0<t.length&&(l=new Ns("onChange","change",null,l,n),e.push({event:l,listeners:t}))}var tr=null,lr=null;function my(e){Tp(e,0)}function ws(e){var t=Ji(e);if(Cf(t))return e}function Vf(e,t){if(e==="change")return t}var Zf=!1;if(kl){var Su;if(kl){var Nu="oninput"in document;if(!Nu){var $f=document.createElement("div");$f.setAttribute("oninput","return;"),Nu=typeof $f.oninput=="function"}Su=Nu}else Su=!1;Zf=Su&&(!document.documentMode||9<document.documentMode)}function Jf(){tr&&(tr.detachEvent("onpropertychange",Ff),lr=tr=null)}function Ff(e){if(e.propertyName==="value"&&ws(lr)){var t=[];Xf(t,lr,e,mu(e)),_f(my,t)}}function hy(e,t,l){e==="focusin"?(Jf(),tr=t,lr=l,tr.attachEvent("onpropertychange",Ff)):e==="focusout"&&Jf()}function py(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ws(lr)}function vy(e,t){if(e==="click")return ws(t)}function xy(e,t){if(e==="input"||e==="change")return ws(t)}function yy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var qt=typeof Object.is=="function"?Object.is:yy;function ar(e,t){if(qt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var l=Object.keys(e),n=Object.keys(t);if(l.length!==n.length)return!1;for(n=0;n<l.length;n++){var o=l[n];if(!gl.call(t,o)||!qt(e[o],t[o]))return!1}return!0}function Wf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Pf(e,t){var l=Wf(e);e=0;for(var n;l;){if(l.nodeType===3){if(n=e+l.textContent.length,e<=t&&n>=t)return{node:l,offset:t-e};e=n}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Wf(l)}}function If(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?If(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function em(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ys(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=ys(e.document)}return t}function Mu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var by=kl&&"documentMode"in document&&11>=document.documentMode,Xn=null,wu=null,nr=null,Cu=!1;function tm(e,t,l){var n=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Cu||Xn==null||Xn!==ys(n)||(n=Xn,"selectionStart"in n&&Mu(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),nr&&ar(nr,n)||(nr=n,n=ho(wu,"onSelect"),0<n.length&&(t=new Ns("onSelect","select",null,t,l),e.push({event:t,listeners:n}),t.target=Xn)))}function en(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var Vn={animationend:en("Animation","AnimationEnd"),animationiteration:en("Animation","AnimationIteration"),animationstart:en("Animation","AnimationStart"),transitionrun:en("Transition","TransitionRun"),transitionstart:en("Transition","TransitionStart"),transitioncancel:en("Transition","TransitionCancel"),transitionend:en("Transition","TransitionEnd")},Tu={},lm={};kl&&(lm=document.createElement("div").style,"AnimationEvent"in window||(delete Vn.animationend.animation,delete Vn.animationiteration.animation,delete Vn.animationstart.animation),"TransitionEvent"in window||delete Vn.transitionend.transition);function tn(e){if(Tu[e])return Tu[e];if(!Vn[e])return e;var t=Vn[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in lm)return Tu[e]=t[l];return e}var am=tn("animationend"),nm=tn("animationiteration"),im=tn("animationstart"),gy=tn("transitionrun"),jy=tn("transitionstart"),Sy=tn("transitioncancel"),rm=tn("transitionend"),sm=new Map,Eu="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Eu.push("scrollEnd");function ol(e,t){sm.set(e,t),Pa(t,[e])}var Cs=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Pt=[],Zn=0,Au=0;function Ts(){for(var e=Zn,t=Au=Zn=0;t<e;){var l=Pt[t];Pt[t++]=null;var n=Pt[t];Pt[t++]=null;var o=Pt[t];Pt[t++]=null;var c=Pt[t];if(Pt[t++]=null,n!==null&&o!==null){var f=n.pending;f===null?o.next=o:(o.next=f.next,f.next=o),n.pending=o}c!==0&&om(l,o,c)}}function Es(e,t,l,n){Pt[Zn++]=e,Pt[Zn++]=t,Pt[Zn++]=l,Pt[Zn++]=n,Au|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function zu(e,t,l,n){return Es(e,t,l,n),As(e)}function ln(e,t){return Es(e,null,null,t),As(e)}function om(e,t,l){e.lanes|=l;var n=e.alternate;n!==null&&(n.lanes|=l);for(var o=!1,c=e.return;c!==null;)c.childLanes|=l,n=c.alternate,n!==null&&(n.childLanes|=l),c.tag===22&&(e=c.stateNode,e===null||e._visibility&1||(o=!0)),e=c,c=c.return;return e.tag===3?(c=e.stateNode,o&&t!==null&&(o=31-wt(l),e=c.hiddenUpdates,n=e[o],n===null?e[o]=[t]:n.push(t),t.lane=l|536870912),c):null}function As(e){if(50<Cr)throw Cr=0,Lc=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var $n={};function Ny(e,t,l,n){this.tag=e,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qt(e,t,l,n){return new Ny(e,t,l,n)}function Ru(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Dl(e,t){var l=e.alternate;return l===null?(l=Qt(e.tag,t,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=t,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&65011712,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,t=e.dependencies,l.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function um(e,t){e.flags&=65011714;var l=e.alternate;return l===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,t=l.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function zs(e,t,l,n,o,c){var f=0;if(n=e,typeof e=="function")Ru(e)&&(f=1);else if(typeof e=="string")f=Eb(e,l,P.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case le:return e=Qt(31,l,t,o),e.elementType=le,e.lanes=c,e;case z:return an(l.children,o,c,t);case U:f=8,o|=24;break;case D:return e=Qt(12,l,t,o|2),e.elementType=D,e.lanes=c,e;case V:return e=Qt(13,l,t,o),e.elementType=V,e.lanes=c,e;case I:return e=Qt(19,l,t,o),e.elementType=I,e.lanes=c,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case K:f=10;break e;case G:f=9;break e;case L:f=11;break e;case J:f=14;break e;case ee:f=16,n=null;break e}f=29,l=Error(u(130,e===null?"null":typeof e,"")),n=null}return t=Qt(f,l,t,o),t.elementType=e,t.type=n,t.lanes=c,t}function an(e,t,l,n){return e=Qt(7,e,n,t),e.lanes=l,e}function Ou(e,t,l){return e=Qt(6,e,null,t),e.lanes=l,e}function cm(e){var t=Qt(18,null,null,0);return t.stateNode=e,t}function _u(e,t,l){return t=Qt(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var dm=new WeakMap;function It(e,t){if(typeof e=="object"&&e!==null){var l=dm.get(e);return l!==void 0?l:(t={value:e,source:t,stack:zn(t)},dm.set(e,t),t)}return{value:e,source:t,stack:zn(t)}}var Jn=[],Fn=0,Rs=null,ir=0,el=[],tl=0,da=null,Nl=1,Ml="";function Ul(e,t){Jn[Fn++]=ir,Jn[Fn++]=Rs,Rs=e,ir=t}function fm(e,t,l){el[tl++]=Nl,el[tl++]=Ml,el[tl++]=da,da=e;var n=Nl;e=Ml;var o=32-wt(n)-1;n&=~(1<<o),l+=1;var c=32-wt(t)+o;if(30<c){var f=o-o%5;c=(n&(1<<f)-1).toString(32),n>>=f,o-=f,Nl=1<<32-wt(t)+o|l<<o|n,Ml=c+e}else Nl=1<<c|l<<o|n,Ml=e}function ku(e){e.return!==null&&(Ul(e,1),fm(e,1,0))}function Du(e){for(;e===Rs;)Rs=Jn[--Fn],Jn[Fn]=null,ir=Jn[--Fn],Jn[Fn]=null;for(;e===da;)da=el[--tl],el[tl]=null,Ml=el[--tl],el[tl]=null,Nl=el[--tl],el[tl]=null}function mm(e,t){el[tl++]=Nl,el[tl++]=Ml,el[tl++]=da,Nl=t.id,Ml=t.overflow,da=e}var mt=null,Xe=null,we=!1,fa=null,ll=!1,Uu=Error(u(519));function ma(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw rr(It(t,e)),Uu}function hm(e){var t=e.stateNode,l=e.type,n=e.memoizedProps;switch(t[Ye]=e,t[et]=n,l){case"dialog":Se("cancel",t),Se("close",t);break;case"iframe":case"object":case"embed":Se("load",t);break;case"video":case"audio":for(l=0;l<Er.length;l++)Se(Er[l],t);break;case"source":Se("error",t);break;case"img":case"image":case"link":Se("error",t),Se("load",t);break;case"details":Se("toggle",t);break;case"input":Se("invalid",t),Tf(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":Se("invalid",t);break;case"textarea":Se("invalid",t),Af(t,n.value,n.defaultValue,n.children)}l=n.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||t.textContent===""+l||n.suppressHydrationWarning===!0||Rp(t.textContent,l)?(n.popover!=null&&(Se("beforetoggle",t),Se("toggle",t)),n.onScroll!=null&&Se("scroll",t),n.onScrollEnd!=null&&Se("scrollend",t),n.onClick!=null&&(t.onclick=_l),t=!0):t=!1,t||ma(e,!0)}function pm(e){for(mt=e.return;mt;)switch(mt.tag){case 5:case 31:case 13:ll=!1;return;case 27:case 3:ll=!0;return;default:mt=mt.return}}function Wn(e){if(e!==mt)return!1;if(!we)return pm(e),we=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||ed(e.type,e.memoizedProps)),l=!l),l&&Xe&&ma(e),pm(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Xe=qp(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Xe=qp(e)}else t===27?(t=Xe,Ta(e.type)?(e=id,id=null,Xe=e):Xe=t):Xe=mt?nl(e.stateNode.nextSibling):null;return!0}function nn(){Xe=mt=null,we=!1}function Bu(){var e=fa;return e!==null&&(kt===null?kt=e:kt.push.apply(kt,e),fa=null),e}function rr(e){fa===null?fa=[e]:fa.push(e)}var Hu=M(null),rn=null,Bl=null;function ha(e,t,l){Z(Hu,t._currentValue),t._currentValue=l}function Hl(e){e._currentValue=Hu.current,_(Hu)}function Lu(e,t,l){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===l)break;e=e.return}}function qu(e,t,l,n){var o=e.child;for(o!==null&&(o.return=e);o!==null;){var c=o.dependencies;if(c!==null){var f=o.child;c=c.firstContext;e:for(;c!==null;){var y=c;c=o;for(var S=0;S<t.length;S++)if(y.context===t[S]){c.lanes|=l,y=c.alternate,y!==null&&(y.lanes|=l),Lu(c.return,l,e),n||(f=null);break e}c=y.next}}else if(o.tag===18){if(f=o.return,f===null)throw Error(u(341));f.lanes|=l,c=f.alternate,c!==null&&(c.lanes|=l),Lu(f,l,e),f=null}else f=o.child;if(f!==null)f.return=o;else for(f=o;f!==null;){if(f===e){f=null;break}if(o=f.sibling,o!==null){o.return=f.return,f=o;break}f=f.return}o=f}}function Pn(e,t,l,n){e=null;for(var o=t,c=!1;o!==null;){if(!c){if((o.flags&524288)!==0)c=!0;else if((o.flags&262144)!==0)break}if(o.tag===10){var f=o.alternate;if(f===null)throw Error(u(387));if(f=f.memoizedProps,f!==null){var y=o.type;qt(o.pendingProps.value,f.value)||(e!==null?e.push(y):e=[y])}}else if(o===W.current){if(f=o.alternate,f===null)throw Error(u(387));f.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e!==null?e.push(_r):e=[_r])}o=o.return}e!==null&&qu(t,e,l,n),t.flags|=262144}function Os(e){for(e=e.firstContext;e!==null;){if(!qt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function sn(e){rn=e,Bl=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ht(e){return vm(rn,e)}function _s(e,t){return rn===null&&sn(e),vm(e,t)}function vm(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},Bl===null){if(e===null)throw Error(u(308));Bl=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Bl=Bl.next=t;return l}var My=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(l,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(l){return l()})}},wy=a.unstable_scheduleCallback,Cy=a.unstable_NormalPriority,tt={$$typeof:K,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Qu(){return{controller:new My,data:new Map,refCount:0}}function sr(e){e.refCount--,e.refCount===0&&wy(Cy,function(){e.controller.abort()})}var or=null,Yu=0,In=0,ei=null;function Ty(e,t){if(or===null){var l=or=[];Yu=0,In=Xc(),ei={status:"pending",value:void 0,then:function(n){l.push(n)}}}return Yu++,t.then(xm,xm),t}function xm(){if(--Yu===0&&or!==null){ei!==null&&(ei.status="fulfilled");var e=or;or=null,In=0,ei=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ey(e,t){var l=[],n={status:"pending",value:null,reason:null,then:function(o){l.push(o)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var o=0;o<l.length;o++)(0,l[o])(t)},function(o){for(n.status="rejected",n.reason=o,o=0;o<l.length;o++)(0,l[o])(void 0)}),n}var ym=B.S;B.S=function(e,t){tp=Nt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Ty(e,t),ym!==null&&ym(e,t)};var on=M(null);function Gu(){var e=on.current;return e!==null?e:Ge.pooledCache}function ks(e,t){t===null?Z(on,on.current):Z(on,t.pool)}function bm(){var e=Gu();return e===null?null:{parent:tt._currentValue,pool:e}}var ti=Error(u(460)),Ku=Error(u(474)),Ds=Error(u(542)),Us={then:function(){}};function gm(e){return e=e.status,e==="fulfilled"||e==="rejected"}function jm(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(_l,_l),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Nm(e),e;default:if(typeof t.status=="string")t.then(_l,_l);else{if(e=Ge,e!==null&&100<e.shellSuspendCounter)throw Error(u(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var o=t;o.status="fulfilled",o.value=n}},function(n){if(t.status==="pending"){var o=t;o.status="rejected",o.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Nm(e),e}throw cn=t,ti}}function un(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(cn=l,ti):l}}var cn=null;function Sm(){if(cn===null)throw Error(u(459));var e=cn;return cn=null,e}function Nm(e){if(e===ti||e===Ds)throw Error(u(483))}var li=null,ur=0;function Bs(e){var t=ur;return ur+=1,li===null&&(li=[]),jm(li,e,t)}function cr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Hs(e,t){throw t.$$typeof===E?Error(u(525)):(e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Mm(e){function t(T,w){if(e){var R=T.deletions;R===null?(T.deletions=[w],T.flags|=16):R.push(w)}}function l(T,w){if(!e)return null;for(;w!==null;)t(T,w),w=w.sibling;return null}function n(T){for(var w=new Map;T!==null;)T.key!==null?w.set(T.key,T):w.set(T.index,T),T=T.sibling;return w}function o(T,w){return T=Dl(T,w),T.index=0,T.sibling=null,T}function c(T,w,R){return T.index=R,e?(R=T.alternate,R!==null?(R=R.index,R<w?(T.flags|=67108866,w):R):(T.flags|=67108866,w)):(T.flags|=1048576,w)}function f(T){return e&&T.alternate===null&&(T.flags|=67108866),T}function y(T,w,R,Q){return w===null||w.tag!==6?(w=Ou(R,T.mode,Q),w.return=T,w):(w=o(w,R),w.return=T,w)}function S(T,w,R,Q){var de=R.type;return de===z?q(T,w,R.props.children,Q,R.key):w!==null&&(w.elementType===de||typeof de=="object"&&de!==null&&de.$$typeof===ee&&un(de)===w.type)?(w=o(w,R.props),cr(w,R),w.return=T,w):(w=zs(R.type,R.key,R.props,null,T.mode,Q),cr(w,R),w.return=T,w)}function O(T,w,R,Q){return w===null||w.tag!==4||w.stateNode.containerInfo!==R.containerInfo||w.stateNode.implementation!==R.implementation?(w=_u(R,T.mode,Q),w.return=T,w):(w=o(w,R.children||[]),w.return=T,w)}function q(T,w,R,Q,de){return w===null||w.tag!==7?(w=an(R,T.mode,Q,de),w.return=T,w):(w=o(w,R),w.return=T,w)}function Y(T,w,R){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return w=Ou(""+w,T.mode,R),w.return=T,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case C:return R=zs(w.type,w.key,w.props,null,T.mode,R),cr(R,w),R.return=T,R;case A:return w=_u(w,T.mode,R),w.return=T,w;case ee:return w=un(w),Y(T,w,R)}if(ue(w)||me(w))return w=an(w,T.mode,R,null),w.return=T,w;if(typeof w.then=="function")return Y(T,Bs(w),R);if(w.$$typeof===K)return Y(T,_s(T,w),R);Hs(T,w)}return null}function k(T,w,R,Q){var de=w!==null?w.key:null;if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return de!==null?null:y(T,w,""+R,Q);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case C:return R.key===de?S(T,w,R,Q):null;case A:return R.key===de?O(T,w,R,Q):null;case ee:return R=un(R),k(T,w,R,Q)}if(ue(R)||me(R))return de!==null?null:q(T,w,R,Q,null);if(typeof R.then=="function")return k(T,w,Bs(R),Q);if(R.$$typeof===K)return k(T,w,_s(T,R),Q);Hs(T,R)}return null}function H(T,w,R,Q,de){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return T=T.get(R)||null,y(w,T,""+Q,de);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case C:return T=T.get(Q.key===null?R:Q.key)||null,S(w,T,Q,de);case A:return T=T.get(Q.key===null?R:Q.key)||null,O(w,T,Q,de);case ee:return Q=un(Q),H(T,w,R,Q,de)}if(ue(Q)||me(Q))return T=T.get(R)||null,q(w,T,Q,de,null);if(typeof Q.then=="function")return H(T,w,R,Bs(Q),de);if(Q.$$typeof===K)return H(T,w,R,_s(w,Q),de);Hs(w,Q)}return null}function ne(T,w,R,Q){for(var de=null,ze=null,se=w,xe=w=0,Me=null;se!==null&&xe<R.length;xe++){se.index>xe?(Me=se,se=null):Me=se.sibling;var Re=k(T,se,R[xe],Q);if(Re===null){se===null&&(se=Me);break}e&&se&&Re.alternate===null&&t(T,se),w=c(Re,w,xe),ze===null?de=Re:ze.sibling=Re,ze=Re,se=Me}if(xe===R.length)return l(T,se),we&&Ul(T,xe),de;if(se===null){for(;xe<R.length;xe++)se=Y(T,R[xe],Q),se!==null&&(w=c(se,w,xe),ze===null?de=se:ze.sibling=se,ze=se);return we&&Ul(T,xe),de}for(se=n(se);xe<R.length;xe++)Me=H(se,T,xe,R[xe],Q),Me!==null&&(e&&Me.alternate!==null&&se.delete(Me.key===null?xe:Me.key),w=c(Me,w,xe),ze===null?de=Me:ze.sibling=Me,ze=Me);return e&&se.forEach(function(Oa){return t(T,Oa)}),we&&Ul(T,xe),de}function fe(T,w,R,Q){if(R==null)throw Error(u(151));for(var de=null,ze=null,se=w,xe=w=0,Me=null,Re=R.next();se!==null&&!Re.done;xe++,Re=R.next()){se.index>xe?(Me=se,se=null):Me=se.sibling;var Oa=k(T,se,Re.value,Q);if(Oa===null){se===null&&(se=Me);break}e&&se&&Oa.alternate===null&&t(T,se),w=c(Oa,w,xe),ze===null?de=Oa:ze.sibling=Oa,ze=Oa,se=Me}if(Re.done)return l(T,se),we&&Ul(T,xe),de;if(se===null){for(;!Re.done;xe++,Re=R.next())Re=Y(T,Re.value,Q),Re!==null&&(w=c(Re,w,xe),ze===null?de=Re:ze.sibling=Re,ze=Re);return we&&Ul(T,xe),de}for(se=n(se);!Re.done;xe++,Re=R.next())Re=H(se,T,xe,Re.value,Q),Re!==null&&(e&&Re.alternate!==null&&se.delete(Re.key===null?xe:Re.key),w=c(Re,w,xe),ze===null?de=Re:ze.sibling=Re,ze=Re);return e&&se.forEach(function(Lb){return t(T,Lb)}),we&&Ul(T,xe),de}function Le(T,w,R,Q){if(typeof R=="object"&&R!==null&&R.type===z&&R.key===null&&(R=R.props.children),typeof R=="object"&&R!==null){switch(R.$$typeof){case C:e:{for(var de=R.key;w!==null;){if(w.key===de){if(de=R.type,de===z){if(w.tag===7){l(T,w.sibling),Q=o(w,R.props.children),Q.return=T,T=Q;break e}}else if(w.elementType===de||typeof de=="object"&&de!==null&&de.$$typeof===ee&&un(de)===w.type){l(T,w.sibling),Q=o(w,R.props),cr(Q,R),Q.return=T,T=Q;break e}l(T,w);break}else t(T,w);w=w.sibling}R.type===z?(Q=an(R.props.children,T.mode,Q,R.key),Q.return=T,T=Q):(Q=zs(R.type,R.key,R.props,null,T.mode,Q),cr(Q,R),Q.return=T,T=Q)}return f(T);case A:e:{for(de=R.key;w!==null;){if(w.key===de)if(w.tag===4&&w.stateNode.containerInfo===R.containerInfo&&w.stateNode.implementation===R.implementation){l(T,w.sibling),Q=o(w,R.children||[]),Q.return=T,T=Q;break e}else{l(T,w);break}else t(T,w);w=w.sibling}Q=_u(R,T.mode,Q),Q.return=T,T=Q}return f(T);case ee:return R=un(R),Le(T,w,R,Q)}if(ue(R))return ne(T,w,R,Q);if(me(R)){if(de=me(R),typeof de!="function")throw Error(u(150));return R=de.call(R),fe(T,w,R,Q)}if(typeof R.then=="function")return Le(T,w,Bs(R),Q);if(R.$$typeof===K)return Le(T,w,_s(T,R),Q);Hs(T,R)}return typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint"?(R=""+R,w!==null&&w.tag===6?(l(T,w.sibling),Q=o(w,R),Q.return=T,T=Q):(l(T,w),Q=Ou(R,T.mode,Q),Q.return=T,T=Q),f(T)):l(T,w)}return function(T,w,R,Q){try{ur=0;var de=Le(T,w,R,Q);return li=null,de}catch(se){if(se===ti||se===Ds)throw se;var ze=Qt(29,se,null,T.mode);return ze.lanes=Q,ze.return=T,ze}finally{}}}var dn=Mm(!0),wm=Mm(!1),pa=!1;function Xu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Vu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function va(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function xa(e,t,l){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(_e&2)!==0){var o=n.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),n.pending=t,t=As(e),om(e,null,l),t}return Es(e,n,t,l),As(e)}function dr(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,l|=n,t.lanes=l,ua(e,l)}}function Zu(e,t){var l=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,l===n)){var o=null,c=null;if(l=l.firstBaseUpdate,l!==null){do{var f={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};c===null?o=c=f:c=c.next=f,l=l.next}while(l!==null);c===null?o=c=t:c=c.next=t}else o=c=t;l={baseState:n.baseState,firstBaseUpdate:o,lastBaseUpdate:c,shared:n.shared,callbacks:n.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var $u=!1;function fr(){if($u){var e=ei;if(e!==null)throw e}}function mr(e,t,l,n){$u=!1;var o=e.updateQueue;pa=!1;var c=o.firstBaseUpdate,f=o.lastBaseUpdate,y=o.shared.pending;if(y!==null){o.shared.pending=null;var S=y,O=S.next;S.next=null,f===null?c=O:f.next=O,f=S;var q=e.alternate;q!==null&&(q=q.updateQueue,y=q.lastBaseUpdate,y!==f&&(y===null?q.firstBaseUpdate=O:y.next=O,q.lastBaseUpdate=S))}if(c!==null){var Y=o.baseState;f=0,q=O=S=null,y=c;do{var k=y.lane&-536870913,H=k!==y.lane;if(H?(Ne&k)===k:(n&k)===k){k!==0&&k===In&&($u=!0),q!==null&&(q=q.next={lane:0,tag:y.tag,payload:y.payload,callback:null,next:null});e:{var ne=e,fe=y;k=t;var Le=l;switch(fe.tag){case 1:if(ne=fe.payload,typeof ne=="function"){Y=ne.call(Le,Y,k);break e}Y=ne;break e;case 3:ne.flags=ne.flags&-65537|128;case 0:if(ne=fe.payload,k=typeof ne=="function"?ne.call(Le,Y,k):ne,k==null)break e;Y=b({},Y,k);break e;case 2:pa=!0}}k=y.callback,k!==null&&(e.flags|=64,H&&(e.flags|=8192),H=o.callbacks,H===null?o.callbacks=[k]:H.push(k))}else H={lane:k,tag:y.tag,payload:y.payload,callback:y.callback,next:null},q===null?(O=q=H,S=Y):q=q.next=H,f|=k;if(y=y.next,y===null){if(y=o.shared.pending,y===null)break;H=y,y=H.next,H.next=null,o.lastBaseUpdate=H,o.shared.pending=null}}while(!0);q===null&&(S=Y),o.baseState=S,o.firstBaseUpdate=O,o.lastBaseUpdate=q,c===null&&(o.shared.lanes=0),Sa|=f,e.lanes=f,e.memoizedState=Y}}function Cm(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function Tm(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)Cm(l[e],t)}var ai=M(null),Ls=M(0);function Em(e,t){e=Zl,Z(Ls,e),Z(ai,t),Zl=e|t.baseLanes}function Ju(){Z(Ls,Zl),Z(ai,ai.current)}function Fu(){Zl=Ls.current,_(ai),_(Ls)}var Yt=M(null),al=null;function ya(e){var t=e.alternate;Z(Pe,Pe.current&1),Z(Yt,e),al===null&&(t===null||ai.current!==null||t.memoizedState!==null)&&(al=e)}function Wu(e){Z(Pe,Pe.current),Z(Yt,e),al===null&&(al=e)}function Am(e){e.tag===22?(Z(Pe,Pe.current),Z(Yt,e),al===null&&(al=e)):ba()}function ba(){Z(Pe,Pe.current),Z(Yt,Yt.current)}function Gt(e){_(Yt),al===e&&(al=null),_(Pe)}var Pe=M(0);function qs(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||ad(l)||nd(l)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ll=0,ve=null,Be=null,lt=null,Qs=!1,ni=!1,fn=!1,Ys=0,hr=0,ii=null,Ay=0;function Je(){throw Error(u(321))}function Pu(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!qt(e[l],t[l]))return!1;return!0}function Iu(e,t,l,n,o,c){return Ll=c,ve=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,B.H=e===null||e.memoizedState===null?fh:hc,fn=!1,c=l(n,o),fn=!1,ni&&(c=Rm(t,l,n,o)),zm(e),c}function zm(e){B.H=xr;var t=Be!==null&&Be.next!==null;if(Ll=0,lt=Be=ve=null,Qs=!1,hr=0,ii=null,t)throw Error(u(300));e===null||at||(e=e.dependencies,e!==null&&Os(e)&&(at=!0))}function Rm(e,t,l,n){ve=e;var o=0;do{if(ni&&(ii=null),hr=0,ni=!1,25<=o)throw Error(u(301));if(o+=1,lt=Be=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}B.H=mh,c=t(l,n)}while(ni);return c}function zy(){var e=B.H,t=e.useState()[0];return t=typeof t.then=="function"?pr(t):t,e=e.useState()[0],(Be!==null?Be.memoizedState:null)!==e&&(ve.flags|=1024),t}function ec(){var e=Ys!==0;return Ys=0,e}function tc(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function lc(e){if(Qs){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Qs=!1}Ll=0,lt=Be=ve=null,ni=!1,hr=Ys=0,ii=null}function Ct(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lt===null?ve.memoizedState=lt=e:lt=lt.next=e,lt}function Ie(){if(Be===null){var e=ve.alternate;e=e!==null?e.memoizedState:null}else e=Be.next;var t=lt===null?ve.memoizedState:lt.next;if(t!==null)lt=t,Be=e;else{if(e===null)throw ve.alternate===null?Error(u(467)):Error(u(310));Be=e,e={memoizedState:Be.memoizedState,baseState:Be.baseState,baseQueue:Be.baseQueue,queue:Be.queue,next:null},lt===null?ve.memoizedState=lt=e:lt=lt.next=e}return lt}function Gs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function pr(e){var t=hr;return hr+=1,ii===null&&(ii=[]),e=jm(ii,e,t),t=ve,(lt===null?t.memoizedState:lt.next)===null&&(t=t.alternate,B.H=t===null||t.memoizedState===null?fh:hc),e}function Ks(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return pr(e);if(e.$$typeof===K)return ht(e)}throw Error(u(438,String(e)))}function ac(e){var t=null,l=ve.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var n=ve.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(o){return o.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=Gs(),ve.updateQueue=l),l.memoCache=t,l=t.data[t.index],l===void 0)for(l=t.data[t.index]=Array(e),n=0;n<e;n++)l[n]=oe;return t.index++,l}function ql(e,t){return typeof t=="function"?t(e):t}function Xs(e){var t=Ie();return nc(t,Be,e)}function nc(e,t,l){var n=e.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=l;var o=e.baseQueue,c=n.pending;if(c!==null){if(o!==null){var f=o.next;o.next=c.next,c.next=f}t.baseQueue=o=c,n.pending=null}if(c=e.baseState,o===null)e.memoizedState=c;else{t=o.next;var y=f=null,S=null,O=t,q=!1;do{var Y=O.lane&-536870913;if(Y!==O.lane?(Ne&Y)===Y:(Ll&Y)===Y){var k=O.revertLane;if(k===0)S!==null&&(S=S.next={lane:0,revertLane:0,gesture:null,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null}),Y===In&&(q=!0);else if((Ll&k)===k){O=O.next,k===In&&(q=!0);continue}else Y={lane:0,revertLane:O.revertLane,gesture:null,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null},S===null?(y=S=Y,f=c):S=S.next=Y,ve.lanes|=k,Sa|=k;Y=O.action,fn&&l(c,Y),c=O.hasEagerState?O.eagerState:l(c,Y)}else k={lane:Y,revertLane:O.revertLane,gesture:O.gesture,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null},S===null?(y=S=k,f=c):S=S.next=k,ve.lanes|=Y,Sa|=Y;O=O.next}while(O!==null&&O!==t);if(S===null?f=c:S.next=y,!qt(c,e.memoizedState)&&(at=!0,q&&(l=ei,l!==null)))throw l;e.memoizedState=c,e.baseState=f,e.baseQueue=S,n.lastRenderedState=c}return o===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function ic(e){var t=Ie(),l=t.queue;if(l===null)throw Error(u(311));l.lastRenderedReducer=e;var n=l.dispatch,o=l.pending,c=t.memoizedState;if(o!==null){l.pending=null;var f=o=o.next;do c=e(c,f.action),f=f.next;while(f!==o);qt(c,t.memoizedState)||(at=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),l.lastRenderedState=c}return[c,n]}function Om(e,t,l){var n=ve,o=Ie(),c=we;if(c){if(l===void 0)throw Error(u(407));l=l()}else l=t();var f=!qt((Be||o).memoizedState,l);if(f&&(o.memoizedState=l,at=!0),o=o.queue,oc(Dm.bind(null,n,o,e),[e]),o.getSnapshot!==t||f||lt!==null&<.memoizedState.tag&1){if(n.flags|=2048,ri(9,{destroy:void 0},km.bind(null,n,o,l,t),null),Ge===null)throw Error(u(349));c||(Ll&127)!==0||_m(n,t,l)}return l}function _m(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=ve.updateQueue,t===null?(t=Gs(),ve.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function km(e,t,l,n){t.value=l,t.getSnapshot=n,Um(t)&&Bm(e)}function Dm(e,t,l){return l(function(){Um(t)&&Bm(e)})}function Um(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!qt(e,l)}catch{return!0}}function Bm(e){var t=ln(e,2);t!==null&&Dt(t,e,2)}function rc(e){var t=Ct();if(typeof e=="function"){var l=e;if(e=l(),fn){jl(!0);try{l()}finally{jl(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ql,lastRenderedState:e},t}function Hm(e,t,l,n){return e.baseState=l,nc(e,Be,typeof n=="function"?n:ql)}function Ry(e,t,l,n,o){if($s(e))throw Error(u(485));if(e=t.action,e!==null){var c={payload:o,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(f){c.listeners.push(f)}};B.T!==null?l(!0):c.isTransition=!1,n(c),l=t.pending,l===null?(c.next=t.pending=c,Lm(t,c)):(c.next=l.next,t.pending=l.next=c)}}function Lm(e,t){var l=t.action,n=t.payload,o=e.state;if(t.isTransition){var c=B.T,f={};B.T=f;try{var y=l(o,n),S=B.S;S!==null&&S(f,y),qm(e,t,y)}catch(O){sc(e,t,O)}finally{c!==null&&f.types!==null&&(c.types=f.types),B.T=c}}else try{c=l(o,n),qm(e,t,c)}catch(O){sc(e,t,O)}}function qm(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(n){Qm(e,t,n)},function(n){return sc(e,t,n)}):Qm(e,t,l)}function Qm(e,t,l){t.status="fulfilled",t.value=l,Ym(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,Lm(e,l)))}function sc(e,t,l){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=l,Ym(t),t=t.next;while(t!==n)}e.action=null}function Ym(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Gm(e,t){return t}function Km(e,t){if(we){var l=Ge.formState;if(l!==null){e:{var n=ve;if(we){if(Xe){t:{for(var o=Xe,c=ll;o.nodeType!==8;){if(!c){o=null;break t}if(o=nl(o.nextSibling),o===null){o=null;break t}}c=o.data,o=c==="F!"||c==="F"?o:null}if(o){Xe=nl(o.nextSibling),n=o.data==="F!";break e}}ma(n)}n=!1}n&&(t=l[0])}}return l=Ct(),l.memoizedState=l.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gm,lastRenderedState:t},l.queue=n,l=uh.bind(null,ve,n),n.dispatch=l,n=rc(!1),c=mc.bind(null,ve,!1,n.queue),n=Ct(),o={state:t,dispatch:null,action:e,pending:null},n.queue=o,l=Ry.bind(null,ve,o,c,l),o.dispatch=l,n.memoizedState=e,[t,l,!1]}function Xm(e){var t=Ie();return Vm(t,Be,e)}function Vm(e,t,l){if(t=nc(e,t,Gm)[0],e=Xs(ql)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=pr(t)}catch(f){throw f===ti?Ds:f}else n=t;t=Ie();var o=t.queue,c=o.dispatch;return l!==t.memoizedState&&(ve.flags|=2048,ri(9,{destroy:void 0},Oy.bind(null,o,l),null)),[n,c,e]}function Oy(e,t){e.action=t}function Zm(e){var t=Ie(),l=Be;if(l!==null)return Vm(t,l,e);Ie(),t=t.memoizedState,l=Ie();var n=l.queue.dispatch;return l.memoizedState=e,[t,n,!1]}function ri(e,t,l,n){return e={tag:e,create:l,deps:n,inst:t,next:null},t=ve.updateQueue,t===null&&(t=Gs(),ve.updateQueue=t),l=t.lastEffect,l===null?t.lastEffect=e.next=e:(n=l.next,l.next=e,e.next=n,t.lastEffect=e),e}function $m(){return Ie().memoizedState}function Vs(e,t,l,n){var o=Ct();ve.flags|=e,o.memoizedState=ri(1|t,{destroy:void 0},l,n===void 0?null:n)}function Zs(e,t,l,n){var o=Ie();n=n===void 0?null:n;var c=o.memoizedState.inst;Be!==null&&n!==null&&Pu(n,Be.memoizedState.deps)?o.memoizedState=ri(t,c,l,n):(ve.flags|=e,o.memoizedState=ri(1|t,c,l,n))}function Jm(e,t){Vs(8390656,8,e,t)}function oc(e,t){Zs(2048,8,e,t)}function _y(e){ve.flags|=4;var t=ve.updateQueue;if(t===null)t=Gs(),ve.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function Fm(e){var t=Ie().memoizedState;return _y({ref:t,nextImpl:e}),function(){if((_e&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function Wm(e,t){return Zs(4,2,e,t)}function Pm(e,t){return Zs(4,4,e,t)}function Im(e,t){if(typeof t=="function"){e=e();var l=t(e);return function(){typeof l=="function"?l():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function eh(e,t,l){l=l!=null?l.concat([e]):null,Zs(4,4,Im.bind(null,t,e),l)}function uc(){}function th(e,t){var l=Ie();t=t===void 0?null:t;var n=l.memoizedState;return t!==null&&Pu(t,n[1])?n[0]:(l.memoizedState=[e,t],e)}function lh(e,t){var l=Ie();t=t===void 0?null:t;var n=l.memoizedState;if(t!==null&&Pu(t,n[1]))return n[0];if(n=e(),fn){jl(!0);try{e()}finally{jl(!1)}}return l.memoizedState=[n,t],n}function cc(e,t,l){return l===void 0||(Ll&1073741824)!==0&&(Ne&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=ap(),ve.lanes|=e,Sa|=e,l)}function ah(e,t,l,n){return qt(l,t)?l:ai.current!==null?(e=cc(e,l,n),qt(e,t)||(at=!0),e):(Ll&42)===0||(Ll&1073741824)!==0&&(Ne&261930)===0?(at=!0,e.memoizedState=l):(e=ap(),ve.lanes|=e,Sa|=e,t)}function nh(e,t,l,n,o){var c=$.p;$.p=c!==0&&8>c?c:8;var f=B.T,y={};B.T=y,mc(e,!1,t,l);try{var S=o(),O=B.S;if(O!==null&&O(y,S),S!==null&&typeof S=="object"&&typeof S.then=="function"){var q=Ey(S,n);vr(e,t,q,Vt(e))}else vr(e,t,n,Vt(e))}catch(Y){vr(e,t,{then:function(){},status:"rejected",reason:Y},Vt())}finally{$.p=c,f!==null&&y.types!==null&&(f.types=y.types),B.T=f}}function ky(){}function dc(e,t,l,n){if(e.tag!==5)throw Error(u(476));var o=ih(e).queue;nh(e,o,t,re,l===null?ky:function(){return rh(e),l(n)})}function ih(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ql,lastRenderedState:re},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ql,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function rh(e){var t=ih(e);t.next===null&&(t=e.alternate.memoizedState),vr(e,t.next.queue,{},Vt())}function fc(){return ht(_r)}function sh(){return Ie().memoizedState}function oh(){return Ie().memoizedState}function Dy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=Vt();e=va(l);var n=xa(t,e,l);n!==null&&(Dt(n,t,l),dr(n,t,l)),t={cache:Qu()},e.payload=t;return}t=t.return}}function Uy(e,t,l){var n=Vt();l={lane:n,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},$s(e)?ch(t,l):(l=zu(e,t,l,n),l!==null&&(Dt(l,e,n),dh(l,t,n)))}function uh(e,t,l){var n=Vt();vr(e,t,l,n)}function vr(e,t,l,n){var o={lane:n,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if($s(e))ch(t,o);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var f=t.lastRenderedState,y=c(f,l);if(o.hasEagerState=!0,o.eagerState=y,qt(y,f))return Es(e,t,o,0),Ge===null&&Ts(),!1}catch{}finally{}if(l=zu(e,t,o,n),l!==null)return Dt(l,e,n),dh(l,t,n),!0}return!1}function mc(e,t,l,n){if(n={lane:2,revertLane:Xc(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},$s(e)){if(t)throw Error(u(479))}else t=zu(e,l,n,2),t!==null&&Dt(t,e,2)}function $s(e){var t=e.alternate;return e===ve||t!==null&&t===ve}function ch(e,t){ni=Qs=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function dh(e,t,l){if((l&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,l|=n,t.lanes=l,ua(e,l)}}var xr={readContext:ht,use:Ks,useCallback:Je,useContext:Je,useEffect:Je,useImperativeHandle:Je,useLayoutEffect:Je,useInsertionEffect:Je,useMemo:Je,useReducer:Je,useRef:Je,useState:Je,useDebugValue:Je,useDeferredValue:Je,useTransition:Je,useSyncExternalStore:Je,useId:Je,useHostTransitionStatus:Je,useFormState:Je,useActionState:Je,useOptimistic:Je,useMemoCache:Je,useCacheRefresh:Je};xr.useEffectEvent=Je;var fh={readContext:ht,use:Ks,useCallback:function(e,t){return Ct().memoizedState=[e,t===void 0?null:t],e},useContext:ht,useEffect:Jm,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Vs(4194308,4,Im.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Vs(4194308,4,e,t)},useInsertionEffect:function(e,t){Vs(4,2,e,t)},useMemo:function(e,t){var l=Ct();t=t===void 0?null:t;var n=e();if(fn){jl(!0);try{e()}finally{jl(!1)}}return l.memoizedState=[n,t],n},useReducer:function(e,t,l){var n=Ct();if(l!==void 0){var o=l(t);if(fn){jl(!0);try{l(t)}finally{jl(!1)}}}else o=t;return n.memoizedState=n.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},n.queue=e,e=e.dispatch=Uy.bind(null,ve,e),[n.memoizedState,e]},useRef:function(e){var t=Ct();return e={current:e},t.memoizedState=e},useState:function(e){e=rc(e);var t=e.queue,l=uh.bind(null,ve,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:uc,useDeferredValue:function(e,t){var l=Ct();return cc(l,e,t)},useTransition:function(){var e=rc(!1);return e=nh.bind(null,ve,e.queue,!0,!1),Ct().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var n=ve,o=Ct();if(we){if(l===void 0)throw Error(u(407));l=l()}else{if(l=t(),Ge===null)throw Error(u(349));(Ne&127)!==0||_m(n,t,l)}o.memoizedState=l;var c={value:l,getSnapshot:t};return o.queue=c,Jm(Dm.bind(null,n,c,e),[e]),n.flags|=2048,ri(9,{destroy:void 0},km.bind(null,n,c,l,t),null),l},useId:function(){var e=Ct(),t=Ge.identifierPrefix;if(we){var l=Ml,n=Nl;l=(n&~(1<<32-wt(n)-1)).toString(32)+l,t="_"+t+"R_"+l,l=Ys++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=Ay++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:fc,useFormState:Km,useActionState:Km,useOptimistic:function(e){var t=Ct();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=mc.bind(null,ve,!0,l),l.dispatch=t,[e,t]},useMemoCache:ac,useCacheRefresh:function(){return Ct().memoizedState=Dy.bind(null,ve)},useEffectEvent:function(e){var t=Ct(),l={impl:e};return t.memoizedState=l,function(){if((_e&2)!==0)throw Error(u(440));return l.impl.apply(void 0,arguments)}}},hc={readContext:ht,use:Ks,useCallback:th,useContext:ht,useEffect:oc,useImperativeHandle:eh,useInsertionEffect:Wm,useLayoutEffect:Pm,useMemo:lh,useReducer:Xs,useRef:$m,useState:function(){return Xs(ql)},useDebugValue:uc,useDeferredValue:function(e,t){var l=Ie();return ah(l,Be.memoizedState,e,t)},useTransition:function(){var e=Xs(ql)[0],t=Ie().memoizedState;return[typeof e=="boolean"?e:pr(e),t]},useSyncExternalStore:Om,useId:sh,useHostTransitionStatus:fc,useFormState:Xm,useActionState:Xm,useOptimistic:function(e,t){var l=Ie();return Hm(l,Be,e,t)},useMemoCache:ac,useCacheRefresh:oh};hc.useEffectEvent=Fm;var mh={readContext:ht,use:Ks,useCallback:th,useContext:ht,useEffect:oc,useImperativeHandle:eh,useInsertionEffect:Wm,useLayoutEffect:Pm,useMemo:lh,useReducer:ic,useRef:$m,useState:function(){return ic(ql)},useDebugValue:uc,useDeferredValue:function(e,t){var l=Ie();return Be===null?cc(l,e,t):ah(l,Be.memoizedState,e,t)},useTransition:function(){var e=ic(ql)[0],t=Ie().memoizedState;return[typeof e=="boolean"?e:pr(e),t]},useSyncExternalStore:Om,useId:sh,useHostTransitionStatus:fc,useFormState:Zm,useActionState:Zm,useOptimistic:function(e,t){var l=Ie();return Be!==null?Hm(l,Be,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:ac,useCacheRefresh:oh};mh.useEffectEvent=Fm;function pc(e,t,l,n){t=e.memoizedState,l=l(n,t),l=l==null?t:b({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var vc={enqueueSetState:function(e,t,l){e=e._reactInternals;var n=Vt(),o=va(n);o.payload=t,l!=null&&(o.callback=l),t=xa(e,o,n),t!==null&&(Dt(t,e,n),dr(t,e,n))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var n=Vt(),o=va(n);o.tag=1,o.payload=t,l!=null&&(o.callback=l),t=xa(e,o,n),t!==null&&(Dt(t,e,n),dr(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=Vt(),n=va(l);n.tag=2,t!=null&&(n.callback=t),t=xa(e,n,l),t!==null&&(Dt(t,e,l),dr(t,e,l))}};function hh(e,t,l,n,o,c,f){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,c,f):t.prototype&&t.prototype.isPureReactComponent?!ar(l,n)||!ar(o,c):!0}function ph(e,t,l,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(l,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(l,n),t.state!==e&&vc.enqueueReplaceState(t,t.state,null)}function mn(e,t){var l=t;if("ref"in t){l={};for(var n in t)n!=="ref"&&(l[n]=t[n])}if(e=e.defaultProps){l===t&&(l=b({},l));for(var o in e)l[o]===void 0&&(l[o]=e[o])}return l}function vh(e){Cs(e)}function xh(e){console.error(e)}function yh(e){Cs(e)}function Js(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function bh(e,t,l){try{var n=e.onCaughtError;n(l.value,{componentStack:l.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function xc(e,t,l){return l=va(l),l.tag=3,l.payload={element:null},l.callback=function(){Js(e,t)},l}function gh(e){return e=va(e),e.tag=3,e}function jh(e,t,l,n){var o=l.type.getDerivedStateFromError;if(typeof o=="function"){var c=n.value;e.payload=function(){return o(c)},e.callback=function(){bh(t,l,n)}}var f=l.stateNode;f!==null&&typeof f.componentDidCatch=="function"&&(e.callback=function(){bh(t,l,n),typeof o!="function"&&(Na===null?Na=new Set([this]):Na.add(this));var y=n.stack;this.componentDidCatch(n.value,{componentStack:y!==null?y:""})})}function By(e,t,l,n,o){if(l.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=l.alternate,t!==null&&Pn(t,l,o,!0),l=Yt.current,l!==null){switch(l.tag){case 31:case 13:return al===null?so():l.alternate===null&&Fe===0&&(Fe=3),l.flags&=-257,l.flags|=65536,l.lanes=o,n===Us?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([n]):t.add(n),Yc(e,n,o)),!1;case 22:return l.flags|=65536,n===Us?l.flags|=16384:(t=l.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},l.updateQueue=t):(l=t.retryQueue,l===null?t.retryQueue=new Set([n]):l.add(n)),Yc(e,n,o)),!1}throw Error(u(435,l.tag))}return Yc(e,n,o),so(),!1}if(we)return t=Yt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,n!==Uu&&(e=Error(u(422),{cause:n}),rr(It(e,l)))):(n!==Uu&&(t=Error(u(423),{cause:n}),rr(It(t,l))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,n=It(n,l),o=xc(e.stateNode,n,o),Zu(e,o),Fe!==4&&(Fe=2)),!1;var c=Error(u(520),{cause:n});if(c=It(c,l),wr===null?wr=[c]:wr.push(c),Fe!==4&&(Fe=2),t===null)return!0;n=It(n,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=o&-o,l.lanes|=e,e=xc(l.stateNode,n,e),Zu(l,e),!1;case 1:if(t=l.type,c=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(Na===null||!Na.has(c))))return l.flags|=65536,o&=-o,l.lanes|=o,o=gh(o),jh(o,e,l,n),Zu(l,o),!1}l=l.return}while(l!==null);return!1}var yc=Error(u(461)),at=!1;function pt(e,t,l,n){t.child=e===null?wm(t,null,l,n):dn(t,e.child,l,n)}function Sh(e,t,l,n,o){l=l.render;var c=t.ref;if("ref"in n){var f={};for(var y in n)y!=="ref"&&(f[y]=n[y])}else f=n;return sn(t),n=Iu(e,t,l,f,c,o),y=ec(),e!==null&&!at?(tc(e,t,o),Ql(e,t,o)):(we&&y&&ku(t),t.flags|=1,pt(e,t,n,o),t.child)}function Nh(e,t,l,n,o){if(e===null){var c=l.type;return typeof c=="function"&&!Ru(c)&&c.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=c,Mh(e,t,c,n,o)):(e=zs(l.type,null,n,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!Cc(e,o)){var f=c.memoizedProps;if(l=l.compare,l=l!==null?l:ar,l(f,n)&&e.ref===t.ref)return Ql(e,t,o)}return t.flags|=1,e=Dl(c,n),e.ref=t.ref,e.return=t,t.child=e}function Mh(e,t,l,n,o){if(e!==null){var c=e.memoizedProps;if(ar(c,n)&&e.ref===t.ref)if(at=!1,t.pendingProps=n=c,Cc(e,o))(e.flags&131072)!==0&&(at=!0);else return t.lanes=e.lanes,Ql(e,t,o)}return bc(e,t,l,n,o)}function wh(e,t,l,n){var o=n.children,c=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if((t.flags&128)!==0){if(c=c!==null?c.baseLanes|l:l,e!==null){for(n=t.child=e.child,o=0;n!==null;)o=o|n.lanes|n.childLanes,n=n.sibling;n=o&~c}else n=0,t.child=null;return Ch(e,t,c,l,n)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ks(t,c!==null?c.cachePool:null),c!==null?Em(t,c):Ju(),Am(t);else return n=t.lanes=536870912,Ch(e,t,c!==null?c.baseLanes|l:l,l,n)}else c!==null?(ks(t,c.cachePool),Em(t,c),ba(),t.memoizedState=null):(e!==null&&ks(t,null),Ju(),ba());return pt(e,t,o,l),t.child}function yr(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Ch(e,t,l,n,o){var c=Gu();return c=c===null?null:{parent:tt._currentValue,pool:c},t.memoizedState={baseLanes:l,cachePool:c},e!==null&&ks(t,null),Ju(),Am(t),e!==null&&Pn(e,t,n,!0),t.childLanes=o,null}function Fs(e,t){return t=Ps({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Th(e,t,l){return dn(t,e.child,null,l),e=Fs(t,t.pendingProps),e.flags|=2,Gt(t),t.memoizedState=null,e}function Hy(e,t,l){var n=t.pendingProps,o=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(we){if(n.mode==="hidden")return e=Fs(t,n),t.lanes=536870912,yr(null,e);if(Wu(t),(e=Xe)?(e=Lp(e,ll),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:da!==null?{id:Nl,overflow:Ml}:null,retryLane:536870912,hydrationErrors:null},l=cm(e),l.return=t,t.child=l,mt=t,Xe=null)):e=null,e===null)throw ma(t);return t.lanes=536870912,null}return Fs(t,n)}var c=e.memoizedState;if(c!==null){var f=c.dehydrated;if(Wu(t),o)if(t.flags&256)t.flags&=-257,t=Th(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if(at||Pn(e,t,l,!1),o=(l&e.childLanes)!==0,at||o){if(n=Ge,n!==null&&(f=Xi(n,l),f!==0&&f!==c.retryLane))throw c.retryLane=f,ln(e,f),Dt(n,e,f),yc;so(),t=Th(e,t,l)}else e=c.treeContext,Xe=nl(f.nextSibling),mt=t,we=!0,fa=null,ll=!1,e!==null&&mm(t,e),t=Fs(t,n),t.flags|=4096;return t}return e=Dl(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ws(e,t){var l=t.ref;if(l===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(u(284));(e===null||e.ref!==l)&&(t.flags|=4194816)}}function bc(e,t,l,n,o){return sn(t),l=Iu(e,t,l,n,void 0,o),n=ec(),e!==null&&!at?(tc(e,t,o),Ql(e,t,o)):(we&&n&&ku(t),t.flags|=1,pt(e,t,l,o),t.child)}function Eh(e,t,l,n,o,c){return sn(t),t.updateQueue=null,l=Rm(t,n,l,o),zm(e),n=ec(),e!==null&&!at?(tc(e,t,c),Ql(e,t,c)):(we&&n&&ku(t),t.flags|=1,pt(e,t,l,c),t.child)}function Ah(e,t,l,n,o){if(sn(t),t.stateNode===null){var c=$n,f=l.contextType;typeof f=="object"&&f!==null&&(c=ht(f)),c=new l(n,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=vc,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=n,c.state=t.memoizedState,c.refs={},Xu(t),f=l.contextType,c.context=typeof f=="object"&&f!==null?ht(f):$n,c.state=t.memoizedState,f=l.getDerivedStateFromProps,typeof f=="function"&&(pc(t,l,f,n),c.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(f=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),f!==c.state&&vc.enqueueReplaceState(c,c.state,null),mr(t,n,c,o),fr(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){c=t.stateNode;var y=t.memoizedProps,S=mn(l,y);c.props=S;var O=c.context,q=l.contextType;f=$n,typeof q=="object"&&q!==null&&(f=ht(q));var Y=l.getDerivedStateFromProps;q=typeof Y=="function"||typeof c.getSnapshotBeforeUpdate=="function",y=t.pendingProps!==y,q||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(y||O!==f)&&ph(t,c,n,f),pa=!1;var k=t.memoizedState;c.state=k,mr(t,n,c,o),fr(),O=t.memoizedState,y||k!==O||pa?(typeof Y=="function"&&(pc(t,l,Y,n),O=t.memoizedState),(S=pa||hh(t,l,S,n,k,O,f))?(q||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=O),c.props=n,c.state=O,c.context=f,n=S):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{c=t.stateNode,Vu(e,t),f=t.memoizedProps,q=mn(l,f),c.props=q,Y=t.pendingProps,k=c.context,O=l.contextType,S=$n,typeof O=="object"&&O!==null&&(S=ht(O)),y=l.getDerivedStateFromProps,(O=typeof y=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(f!==Y||k!==S)&&ph(t,c,n,S),pa=!1,k=t.memoizedState,c.state=k,mr(t,n,c,o),fr();var H=t.memoizedState;f!==Y||k!==H||pa||e!==null&&e.dependencies!==null&&Os(e.dependencies)?(typeof y=="function"&&(pc(t,l,y,n),H=t.memoizedState),(q=pa||hh(t,l,q,n,k,H,S)||e!==null&&e.dependencies!==null&&Os(e.dependencies))?(O||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(n,H,S),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(n,H,S)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||f===e.memoizedProps&&k===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&k===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=H),c.props=n,c.state=H,c.context=S,n=q):(typeof c.componentDidUpdate!="function"||f===e.memoizedProps&&k===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&k===e.memoizedState||(t.flags|=1024),n=!1)}return c=n,Ws(e,t),n=(t.flags&128)!==0,c||n?(c=t.stateNode,l=n&&typeof l.getDerivedStateFromError!="function"?null:c.render(),t.flags|=1,e!==null&&n?(t.child=dn(t,e.child,null,o),t.child=dn(t,null,l,o)):pt(e,t,l,o),t.memoizedState=c.state,e=t.child):e=Ql(e,t,o),e}function zh(e,t,l,n){return nn(),t.flags|=256,pt(e,t,l,n),t.child}var gc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function jc(e){return{baseLanes:e,cachePool:bm()}}function Sc(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=Xt),e}function Rh(e,t,l){var n=t.pendingProps,o=!1,c=(t.flags&128)!==0,f;if((f=c)||(f=e!==null&&e.memoizedState===null?!1:(Pe.current&2)!==0),f&&(o=!0,t.flags&=-129),f=(t.flags&32)!==0,t.flags&=-33,e===null){if(we){if(o?ya(t):ba(),(e=Xe)?(e=Lp(e,ll),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:da!==null?{id:Nl,overflow:Ml}:null,retryLane:536870912,hydrationErrors:null},l=cm(e),l.return=t,t.child=l,mt=t,Xe=null)):e=null,e===null)throw ma(t);return nd(e)?t.lanes=32:t.lanes=536870912,null}var y=n.children;return n=n.fallback,o?(ba(),o=t.mode,y=Ps({mode:"hidden",children:y},o),n=an(n,o,l,null),y.return=t,n.return=t,y.sibling=n,t.child=y,n=t.child,n.memoizedState=jc(l),n.childLanes=Sc(e,f,l),t.memoizedState=gc,yr(null,n)):(ya(t),Nc(t,y))}var S=e.memoizedState;if(S!==null&&(y=S.dehydrated,y!==null)){if(c)t.flags&256?(ya(t),t.flags&=-257,t=Mc(e,t,l)):t.memoizedState!==null?(ba(),t.child=e.child,t.flags|=128,t=null):(ba(),y=n.fallback,o=t.mode,n=Ps({mode:"visible",children:n.children},o),y=an(y,o,l,null),y.flags|=2,n.return=t,y.return=t,n.sibling=y,t.child=n,dn(t,e.child,null,l),n=t.child,n.memoizedState=jc(l),n.childLanes=Sc(e,f,l),t.memoizedState=gc,t=yr(null,n));else if(ya(t),nd(y)){if(f=y.nextSibling&&y.nextSibling.dataset,f)var O=f.dgst;f=O,n=Error(u(419)),n.stack="",n.digest=f,rr({value:n,source:null,stack:null}),t=Mc(e,t,l)}else if(at||Pn(e,t,l,!1),f=(l&e.childLanes)!==0,at||f){if(f=Ge,f!==null&&(n=Xi(f,l),n!==0&&n!==S.retryLane))throw S.retryLane=n,ln(e,n),Dt(f,e,n),yc;ad(y)||so(),t=Mc(e,t,l)}else ad(y)?(t.flags|=192,t.child=e.child,t=null):(e=S.treeContext,Xe=nl(y.nextSibling),mt=t,we=!0,fa=null,ll=!1,e!==null&&mm(t,e),t=Nc(t,n.children),t.flags|=4096);return t}return o?(ba(),y=n.fallback,o=t.mode,S=e.child,O=S.sibling,n=Dl(S,{mode:"hidden",children:n.children}),n.subtreeFlags=S.subtreeFlags&65011712,O!==null?y=Dl(O,y):(y=an(y,o,l,null),y.flags|=2),y.return=t,n.return=t,n.sibling=y,t.child=n,yr(null,n),n=t.child,y=e.child.memoizedState,y===null?y=jc(l):(o=y.cachePool,o!==null?(S=tt._currentValue,o=o.parent!==S?{parent:S,pool:S}:o):o=bm(),y={baseLanes:y.baseLanes|l,cachePool:o}),n.memoizedState=y,n.childLanes=Sc(e,f,l),t.memoizedState=gc,yr(e.child,n)):(ya(t),l=e.child,e=l.sibling,l=Dl(l,{mode:"visible",children:n.children}),l.return=t,l.sibling=null,e!==null&&(f=t.deletions,f===null?(t.deletions=[e],t.flags|=16):f.push(e)),t.child=l,t.memoizedState=null,l)}function Nc(e,t){return t=Ps({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ps(e,t){return e=Qt(22,e,null,t),e.lanes=0,e}function Mc(e,t,l){return dn(t,e.child,null,l),e=Nc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Oh(e,t,l){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Lu(e.return,t,l)}function wc(e,t,l,n,o,c){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:l,tailMode:o,treeForkCount:c}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=n,f.tail=l,f.tailMode=o,f.treeForkCount=c)}function _h(e,t,l){var n=t.pendingProps,o=n.revealOrder,c=n.tail;n=n.children;var f=Pe.current,y=(f&2)!==0;if(y?(f=f&1|2,t.flags|=128):f&=1,Z(Pe,f),pt(e,t,n,l),n=we?ir:0,!y&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Oh(e,l,t);else if(e.tag===19)Oh(e,l,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(o){case"forwards":for(l=t.child,o=null;l!==null;)e=l.alternate,e!==null&&qs(e)===null&&(o=l),l=l.sibling;l=o,l===null?(o=t.child,t.child=null):(o=l.sibling,l.sibling=null),wc(t,!1,o,l,c,n);break;case"backwards":case"unstable_legacy-backwards":for(l=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&qs(e)===null){t.child=o;break}e=o.sibling,o.sibling=l,l=o,o=e}wc(t,!0,l,null,c,n);break;case"together":wc(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function Ql(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),Sa|=t.lanes,(l&t.childLanes)===0)if(e!==null){if(Pn(e,t,l,!1),(l&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,l=Dl(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=Dl(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function Cc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Os(e)))}function Ly(e,t,l){switch(t.tag){case 3:Ae(t,t.stateNode.containerInfo),ha(t,tt,e.memoizedState.cache),nn();break;case 27:case 5:bl(t);break;case 4:Ae(t,t.stateNode.containerInfo);break;case 10:ha(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Wu(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(ya(t),t.flags|=128,null):(l&t.child.childLanes)!==0?Rh(e,t,l):(ya(t),e=Ql(e,t,l),e!==null?e.sibling:null);ya(t);break;case 19:var o=(e.flags&128)!==0;if(n=(l&t.childLanes)!==0,n||(Pn(e,t,l,!1),n=(l&t.childLanes)!==0),o){if(n)return _h(e,t,l);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Z(Pe,Pe.current),n)break;return null;case 22:return t.lanes=0,wh(e,t,l,t.pendingProps);case 24:ha(t,tt,e.memoizedState.cache)}return Ql(e,t,l)}function kh(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)at=!0;else{if(!Cc(e,l)&&(t.flags&128)===0)return at=!1,Ly(e,t,l);at=(e.flags&131072)!==0}else at=!1,we&&(t.flags&1048576)!==0&&fm(t,ir,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=un(t.elementType),t.type=e,typeof e=="function")Ru(e)?(n=mn(e,n),t.tag=1,t=Ah(null,t,e,n,l)):(t.tag=0,t=bc(null,t,e,n,l));else{if(e!=null){var o=e.$$typeof;if(o===L){t.tag=11,t=Sh(null,t,e,n,l);break e}else if(o===J){t.tag=14,t=Nh(null,t,e,n,l);break e}}throw t=Ee(e)||e,Error(u(306,t,""))}}return t;case 0:return bc(e,t,t.type,t.pendingProps,l);case 1:return n=t.type,o=mn(n,t.pendingProps),Ah(e,t,n,o,l);case 3:e:{if(Ae(t,t.stateNode.containerInfo),e===null)throw Error(u(387));n=t.pendingProps;var c=t.memoizedState;o=c.element,Vu(e,t),mr(t,n,null,l);var f=t.memoizedState;if(n=f.cache,ha(t,tt,n),n!==c.cache&&qu(t,[tt],l,!0),fr(),n=f.element,c.isDehydrated)if(c={element:n,isDehydrated:!1,cache:f.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=zh(e,t,n,l);break e}else if(n!==o){o=It(Error(u(424)),t),rr(o),t=zh(e,t,n,l);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Xe=nl(e.firstChild),mt=t,we=!0,fa=null,ll=!0,l=wm(t,null,n,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(nn(),n===o){t=Ql(e,t,l);break e}pt(e,t,n,l)}t=t.child}return t;case 26:return Ws(e,t),e===null?(l=Xp(t.type,null,t.pendingProps,null))?t.memoizedState=l:we||(l=t.type,e=t.pendingProps,n=po(ae.current).createElement(l),n[Ye]=t,n[et]=e,vt(n,l,e),ut(n),t.stateNode=n):t.memoizedState=Xp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return bl(t),e===null&&we&&(n=t.stateNode=Yp(t.type,t.pendingProps,ae.current),mt=t,ll=!0,o=Xe,Ta(t.type)?(id=o,Xe=nl(n.firstChild)):Xe=o),pt(e,t,t.pendingProps.children,l),Ws(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&we&&((o=n=Xe)&&(n=pb(n,t.type,t.pendingProps,ll),n!==null?(t.stateNode=n,mt=t,Xe=nl(n.firstChild),ll=!1,o=!0):o=!1),o||ma(t)),bl(t),o=t.type,c=t.pendingProps,f=e!==null?e.memoizedProps:null,n=c.children,ed(o,c)?n=null:f!==null&&ed(o,f)&&(t.flags|=32),t.memoizedState!==null&&(o=Iu(e,t,zy,null,null,l),_r._currentValue=o),Ws(e,t),pt(e,t,n,l),t.child;case 6:return e===null&&we&&((e=l=Xe)&&(l=vb(l,t.pendingProps,ll),l!==null?(t.stateNode=l,mt=t,Xe=null,e=!0):e=!1),e||ma(t)),null;case 13:return Rh(e,t,l);case 4:return Ae(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=dn(t,null,n,l):pt(e,t,n,l),t.child;case 11:return Sh(e,t,t.type,t.pendingProps,l);case 7:return pt(e,t,t.pendingProps,l),t.child;case 8:return pt(e,t,t.pendingProps.children,l),t.child;case 12:return pt(e,t,t.pendingProps.children,l),t.child;case 10:return n=t.pendingProps,ha(t,t.type,n.value),pt(e,t,n.children,l),t.child;case 9:return o=t.type._context,n=t.pendingProps.children,sn(t),o=ht(o),n=n(o),t.flags|=1,pt(e,t,n,l),t.child;case 14:return Nh(e,t,t.type,t.pendingProps,l);case 15:return Mh(e,t,t.type,t.pendingProps,l);case 19:return _h(e,t,l);case 31:return Hy(e,t,l);case 22:return wh(e,t,l,t.pendingProps);case 24:return sn(t),n=ht(tt),e===null?(o=Gu(),o===null&&(o=Ge,c=Qu(),o.pooledCache=c,c.refCount++,c!==null&&(o.pooledCacheLanes|=l),o=c),t.memoizedState={parent:n,cache:o},Xu(t),ha(t,tt,o)):((e.lanes&l)!==0&&(Vu(e,t),mr(t,null,null,l),fr()),o=e.memoizedState,c=t.memoizedState,o.parent!==n?(o={parent:n,cache:n},t.memoizedState=o,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=o),ha(t,tt,n)):(n=c.cache,ha(t,tt,n),n!==o.cache&&qu(t,[tt],l,!0))),pt(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function Yl(e){e.flags|=4}function Tc(e,t,l,n,o){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(o&335544128)===o)if(e.stateNode.complete)e.flags|=8192;else if(sp())e.flags|=8192;else throw cn=Us,Ku}else e.flags&=-16777217}function Dh(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Fp(t))if(sp())e.flags|=8192;else throw cn=Us,Ku}function Is(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ki():536870912,e.lanes|=t,ci|=t)}function br(e,t){if(!we)switch(e.tailMode){case"hidden":t=e.tail;for(var l=null;t!==null;)t.alternate!==null&&(l=t),t=t.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var n=null;l!==null;)l.alternate!==null&&(n=l),l=l.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Ve(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,n=0;if(t)for(var o=e.child;o!==null;)l|=o.lanes|o.childLanes,n|=o.subtreeFlags&65011712,n|=o.flags&65011712,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)l|=o.lanes|o.childLanes,n|=o.subtreeFlags,n|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=n,e.childLanes=l,t}function qy(e,t,l){var n=t.pendingProps;switch(Du(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ve(t),null;case 1:return Ve(t),null;case 3:return l=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Hl(tt),Oe(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Wn(t)?Yl(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Bu())),Ve(t),null;case 26:var o=t.type,c=t.memoizedState;return e===null?(Yl(t),c!==null?(Ve(t),Dh(t,c)):(Ve(t),Tc(t,o,null,n,l))):c?c!==e.memoizedState?(Yl(t),Ve(t),Dh(t,c)):(Ve(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&Yl(t),Ve(t),Tc(t,o,e,n,l)),null;case 27:if(ia(t),l=ae.current,o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Yl(t);else{if(!n){if(t.stateNode===null)throw Error(u(166));return Ve(t),null}e=P.current,Wn(t)?hm(t):(e=Yp(o,n,l),t.stateNode=e,Yl(t))}return Ve(t),null;case 5:if(ia(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Yl(t);else{if(!n){if(t.stateNode===null)throw Error(u(166));return Ve(t),null}if(c=P.current,Wn(t))hm(t);else{var f=po(ae.current);switch(c){case 1:c=f.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:c=f.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":c=f.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":c=f.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":c=f.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof n.is=="string"?f.createElement("select",{is:n.is}):f.createElement("select"),n.multiple?c.multiple=!0:n.size&&(c.size=n.size);break;default:c=typeof n.is=="string"?f.createElement(o,{is:n.is}):f.createElement(o)}}c[Ye]=t,c[et]=n;e:for(f=t.child;f!==null;){if(f.tag===5||f.tag===6)c.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}t.stateNode=c;e:switch(vt(c,o,n),o){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&Yl(t)}}return Ve(t),Tc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&Yl(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(u(166));if(e=ae.current,Wn(t)){if(e=t.stateNode,l=t.memoizedProps,n=null,o=mt,o!==null)switch(o.tag){case 27:case 5:n=o.memoizedProps}e[Ye]=t,e=!!(e.nodeValue===l||n!==null&&n.suppressHydrationWarning===!0||Rp(e.nodeValue,l)),e||ma(t,!0)}else e=po(e).createTextNode(n),e[Ye]=t,t.stateNode=e}return Ve(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(n=Wn(t),l!==null){if(e===null){if(!n)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[Ye]=t}else nn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ve(t),e=!1}else l=Bu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(Gt(t),t):(Gt(t),null);if((t.flags&128)!==0)throw Error(u(558))}return Ve(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=Wn(t),n!==null&&n.dehydrated!==null){if(e===null){if(!o)throw Error(u(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(u(317));o[Ye]=t}else nn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ve(t),o=!1}else o=Bu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(Gt(t),t):(Gt(t),null)}return Gt(t),(t.flags&128)!==0?(t.lanes=l,t):(l=n!==null,e=e!==null&&e.memoizedState!==null,l&&(n=t.child,o=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(o=n.alternate.memoizedState.cachePool.pool),c=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(c=n.memoizedState.cachePool.pool),c!==o&&(n.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),Is(t,t.updateQueue),Ve(t),null);case 4:return Oe(),e===null&&Jc(t.stateNode.containerInfo),Ve(t),null;case 10:return Hl(t.type),Ve(t),null;case 19:if(_(Pe),n=t.memoizedState,n===null)return Ve(t),null;if(o=(t.flags&128)!==0,c=n.rendering,c===null)if(o)br(n,!1);else{if(Fe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=qs(e),c!==null){for(t.flags|=128,br(n,!1),e=c.updateQueue,t.updateQueue=e,Is(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)um(l,e),l=l.sibling;return Z(Pe,Pe.current&1|2),we&&Ul(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&Nt()>no&&(t.flags|=128,o=!0,br(n,!1),t.lanes=4194304)}else{if(!o)if(e=qs(c),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,Is(t,e),br(n,!0),n.tail===null&&n.tailMode==="hidden"&&!c.alternate&&!we)return Ve(t),null}else 2*Nt()-n.renderingStartTime>no&&l!==536870912&&(t.flags|=128,o=!0,br(n,!1),t.lanes=4194304);n.isBackwards?(c.sibling=t.child,t.child=c):(e=n.last,e!==null?e.sibling=c:t.child=c,n.last=c)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=Nt(),e.sibling=null,l=Pe.current,Z(Pe,o?l&1|2:l&1),we&&Ul(t,n.treeForkCount),e):(Ve(t),null);case 22:case 23:return Gt(t),Fu(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(l&536870912)!==0&&(t.flags&128)===0&&(Ve(t),t.subtreeFlags&6&&(t.flags|=8192)):Ve(t),l=t.updateQueue,l!==null&&Is(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==l&&(t.flags|=2048),e!==null&&_(on),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Hl(tt),Ve(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function Qy(e,t){switch(Du(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Hl(tt),Oe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ia(t),null;case 31:if(t.memoizedState!==null){if(Gt(t),t.alternate===null)throw Error(u(340));nn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Gt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));nn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return _(Pe),null;case 4:return Oe(),null;case 10:return Hl(t.type),null;case 22:case 23:return Gt(t),Fu(),e!==null&&_(on),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Hl(tt),null;case 25:return null;default:return null}}function Uh(e,t){switch(Du(t),t.tag){case 3:Hl(tt),Oe();break;case 26:case 27:case 5:ia(t);break;case 4:Oe();break;case 31:t.memoizedState!==null&&Gt(t);break;case 13:Gt(t);break;case 19:_(Pe);break;case 10:Hl(t.type);break;case 22:case 23:Gt(t),Fu(),e!==null&&_(on);break;case 24:Hl(tt)}}function gr(e,t){try{var l=t.updateQueue,n=l!==null?l.lastEffect:null;if(n!==null){var o=n.next;l=o;do{if((l.tag&e)===e){n=void 0;var c=l.create,f=l.inst;n=c(),f.destroy=n}l=l.next}while(l!==o)}}catch(y){Ue(t,t.return,y)}}function ga(e,t,l){try{var n=t.updateQueue,o=n!==null?n.lastEffect:null;if(o!==null){var c=o.next;n=c;do{if((n.tag&e)===e){var f=n.inst,y=f.destroy;if(y!==void 0){f.destroy=void 0,o=t;var S=l,O=y;try{O()}catch(q){Ue(o,S,q)}}}n=n.next}while(n!==c)}}catch(q){Ue(t,t.return,q)}}function Bh(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{Tm(t,l)}catch(n){Ue(e,e.return,n)}}}function Hh(e,t,l){l.props=mn(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(n){Ue(e,t,n)}}function jr(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof l=="function"?e.refCleanup=l(n):l.current=n}}catch(o){Ue(e,t,o)}}function wl(e,t){var l=e.ref,n=e.refCleanup;if(l!==null)if(typeof n=="function")try{n()}catch(o){Ue(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(o){Ue(e,t,o)}else l.current=null}function Lh(e){var t=e.type,l=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break e;case"img":l.src?n.src=l.src:l.srcSet&&(n.srcset=l.srcSet)}}catch(o){Ue(e,e.return,o)}}function Ec(e,t,l){try{var n=e.stateNode;ub(n,e.type,l,t),n[et]=t}catch(o){Ue(e,e.return,o)}}function qh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ta(e.type)||e.tag===4}function Ac(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||qh(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ta(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function zc(e,t,l){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=_l));else if(n!==4&&(n===27&&Ta(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(zc(e,t,l),e=e.sibling;e!==null;)zc(e,t,l),e=e.sibling}function eo(e,t,l){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(n!==4&&(n===27&&Ta(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(eo(e,t,l),e=e.sibling;e!==null;)eo(e,t,l),e=e.sibling}function Qh(e){var t=e.stateNode,l=e.memoizedProps;try{for(var n=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);vt(t,n,l),t[Ye]=e,t[et]=l}catch(c){Ue(e,e.return,c)}}var Gl=!1,nt=!1,Rc=!1,Yh=typeof WeakSet=="function"?WeakSet:Set,ct=null;function Yy(e,t){if(e=e.containerInfo,Pc=So,e=em(e),Mu(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var n=l.getSelection&&l.getSelection();if(n&&n.rangeCount!==0){l=n.anchorNode;var o=n.anchorOffset,c=n.focusNode;n=n.focusOffset;try{l.nodeType,c.nodeType}catch{l=null;break e}var f=0,y=-1,S=-1,O=0,q=0,Y=e,k=null;t:for(;;){for(var H;Y!==l||o!==0&&Y.nodeType!==3||(y=f+o),Y!==c||n!==0&&Y.nodeType!==3||(S=f+n),Y.nodeType===3&&(f+=Y.nodeValue.length),(H=Y.firstChild)!==null;)k=Y,Y=H;for(;;){if(Y===e)break t;if(k===l&&++O===o&&(y=f),k===c&&++q===n&&(S=f),(H=Y.nextSibling)!==null)break;Y=k,k=Y.parentNode}Y=H}l=y===-1||S===-1?null:{start:y,end:S}}else l=null}l=l||{start:0,end:0}}else l=null;for(Ic={focusedElem:e,selectionRange:l},So=!1,ct=t;ct!==null;)if(t=ct,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ct=e;else for(;ct!==null;){switch(t=ct,c=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l<e.length;l++)o=e[l],o.ref.impl=o.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&c!==null){e=void 0,l=t,o=c.memoizedProps,c=c.memoizedState,n=l.stateNode;try{var ne=mn(l.type,o);e=n.getSnapshotBeforeUpdate(ne,c),n.__reactInternalSnapshotBeforeUpdate=e}catch(fe){Ue(l,l.return,fe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)ld(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":ld(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(u(163))}if(e=t.sibling,e!==null){e.return=t.return,ct=e;break}ct=t.return}}function Gh(e,t,l){var n=l.flags;switch(l.tag){case 0:case 11:case 15:Xl(e,l),n&4&&gr(5,l);break;case 1:if(Xl(e,l),n&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(f){Ue(l,l.return,f)}else{var o=mn(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(f){Ue(l,l.return,f)}}n&64&&Bh(l),n&512&&jr(l,l.return);break;case 3:if(Xl(e,l),n&64&&(e=l.updateQueue,e!==null)){if(t=null,l.child!==null)switch(l.child.tag){case 27:case 5:t=l.child.stateNode;break;case 1:t=l.child.stateNode}try{Tm(e,t)}catch(f){Ue(l,l.return,f)}}break;case 27:t===null&&n&4&&Qh(l);case 26:case 5:Xl(e,l),t===null&&n&4&&Lh(l),n&512&&jr(l,l.return);break;case 12:Xl(e,l);break;case 31:Xl(e,l),n&4&&Vh(e,l);break;case 13:Xl(e,l),n&4&&Zh(e,l),n&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=Wy.bind(null,l),xb(e,l))));break;case 22:if(n=l.memoizedState!==null||Gl,!n){t=t!==null&&t.memoizedState!==null||nt,o=Gl;var c=nt;Gl=n,(nt=t)&&!c?Vl(e,l,(l.subtreeFlags&8772)!==0):Xl(e,l),Gl=o,nt=c}break;case 30:break;default:Xl(e,l)}}function Kh(e){var t=e.alternate;t!==null&&(e.alternate=null,Kh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&su(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Ze=null,Rt=!1;function Kl(e,t,l){for(l=l.child;l!==null;)Xh(e,t,l),l=l.sibling}function Xh(e,t,l){if(Mt&&typeof Mt.onCommitFiberUnmount=="function")try{Mt.onCommitFiberUnmount(Za,l)}catch{}switch(l.tag){case 26:nt||wl(l,t),Kl(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:nt||wl(l,t);var n=Ze,o=Rt;Ta(l.type)&&(Ze=l.stateNode,Rt=!1),Kl(e,t,l),zr(l.stateNode),Ze=n,Rt=o;break;case 5:nt||wl(l,t);case 6:if(n=Ze,o=Rt,Ze=null,Kl(e,t,l),Ze=n,Rt=o,Ze!==null)if(Rt)try{(Ze.nodeType===9?Ze.body:Ze.nodeName==="HTML"?Ze.ownerDocument.body:Ze).removeChild(l.stateNode)}catch(c){Ue(l,t,c)}else try{Ze.removeChild(l.stateNode)}catch(c){Ue(l,t,c)}break;case 18:Ze!==null&&(Rt?(e=Ze,Bp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),yi(e)):Bp(Ze,l.stateNode));break;case 4:n=Ze,o=Rt,Ze=l.stateNode.containerInfo,Rt=!0,Kl(e,t,l),Ze=n,Rt=o;break;case 0:case 11:case 14:case 15:ga(2,l,t),nt||ga(4,l,t),Kl(e,t,l);break;case 1:nt||(wl(l,t),n=l.stateNode,typeof n.componentWillUnmount=="function"&&Hh(l,t,n)),Kl(e,t,l);break;case 21:Kl(e,t,l);break;case 22:nt=(n=nt)||l.memoizedState!==null,Kl(e,t,l),nt=n;break;default:Kl(e,t,l)}}function Vh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{yi(e)}catch(l){Ue(t,t.return,l)}}}function Zh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{yi(e)}catch(l){Ue(t,t.return,l)}}function Gy(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Yh),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Yh),t;default:throw Error(u(435,e.tag))}}function to(e,t){var l=Gy(e);t.forEach(function(n){if(!l.has(n)){l.add(n);var o=Py.bind(null,e,n);n.then(o,o)}})}function Ot(e,t){var l=t.deletions;if(l!==null)for(var n=0;n<l.length;n++){var o=l[n],c=e,f=t,y=f;e:for(;y!==null;){switch(y.tag){case 27:if(Ta(y.type)){Ze=y.stateNode,Rt=!1;break e}break;case 5:Ze=y.stateNode,Rt=!1;break e;case 3:case 4:Ze=y.stateNode.containerInfo,Rt=!0;break e}y=y.return}if(Ze===null)throw Error(u(160));Xh(c,f,o),Ze=null,Rt=!1,c=o.alternate,c!==null&&(c.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)$h(t,e),t=t.sibling}var ul=null;function $h(e,t){var l=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ot(t,e),_t(e),n&4&&(ga(3,e,e.return),gr(3,e),ga(5,e,e.return));break;case 1:Ot(t,e),_t(e),n&512&&(nt||l===null||wl(l,l.return)),n&64&&Gl&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?n:l.concat(n))));break;case 26:var o=ul;if(Ot(t,e),_t(e),n&512&&(nt||l===null||wl(l,l.return)),n&4){var c=l!==null?l.memoizedState:null;if(n=e.memoizedState,l===null)if(n===null)if(e.stateNode===null){e:{n=e.type,l=e.memoizedProps,o=o.ownerDocument||o;t:switch(n){case"title":c=o.getElementsByTagName("title")[0],(!c||c[$i]||c[Ye]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=o.createElement(n),o.head.insertBefore(c,o.querySelector("head > title"))),vt(c,n,l),c[Ye]=e,ut(c),n=c;break e;case"link":var f=$p("link","href",o).get(n+(l.href||""));if(f){for(var y=0;y<f.length;y++)if(c=f[y],c.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&c.getAttribute("rel")===(l.rel==null?null:l.rel)&&c.getAttribute("title")===(l.title==null?null:l.title)&&c.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){f.splice(y,1);break t}}c=o.createElement(n),vt(c,n,l),o.head.appendChild(c);break;case"meta":if(f=$p("meta","content",o).get(n+(l.content||""))){for(y=0;y<f.length;y++)if(c=f[y],c.getAttribute("content")===(l.content==null?null:""+l.content)&&c.getAttribute("name")===(l.name==null?null:l.name)&&c.getAttribute("property")===(l.property==null?null:l.property)&&c.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&c.getAttribute("charset")===(l.charSet==null?null:l.charSet)){f.splice(y,1);break t}}c=o.createElement(n),vt(c,n,l),o.head.appendChild(c);break;default:throw Error(u(468,n))}c[Ye]=e,ut(c),n=c}e.stateNode=n}else Jp(o,e.type,e.stateNode);else e.stateNode=Zp(o,n,e.memoizedProps);else c!==n?(c===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):c.count--,n===null?Jp(o,e.type,e.stateNode):Zp(o,n,e.memoizedProps)):n===null&&e.stateNode!==null&&Ec(e,e.memoizedProps,l.memoizedProps)}break;case 27:Ot(t,e),_t(e),n&512&&(nt||l===null||wl(l,l.return)),l!==null&&n&4&&Ec(e,e.memoizedProps,l.memoizedProps);break;case 5:if(Ot(t,e),_t(e),n&512&&(nt||l===null||wl(l,l.return)),e.flags&32){o=e.stateNode;try{Qn(o,"")}catch(ne){Ue(e,e.return,ne)}}n&4&&e.stateNode!=null&&(o=e.memoizedProps,Ec(e,o,l!==null?l.memoizedProps:o)),n&1024&&(Rc=!0);break;case 6:if(Ot(t,e),_t(e),n&4){if(e.stateNode===null)throw Error(u(162));n=e.memoizedProps,l=e.stateNode;try{l.nodeValue=n}catch(ne){Ue(e,e.return,ne)}}break;case 3:if(yo=null,o=ul,ul=vo(t.containerInfo),Ot(t,e),ul=o,_t(e),n&4&&l!==null&&l.memoizedState.isDehydrated)try{yi(t.containerInfo)}catch(ne){Ue(e,e.return,ne)}Rc&&(Rc=!1,Jh(e));break;case 4:n=ul,ul=vo(e.stateNode.containerInfo),Ot(t,e),_t(e),ul=n;break;case 12:Ot(t,e),_t(e);break;case 31:Ot(t,e),_t(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,to(e,n)));break;case 13:Ot(t,e),_t(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(ao=Nt()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,to(e,n)));break;case 22:o=e.memoizedState!==null;var S=l!==null&&l.memoizedState!==null,O=Gl,q=nt;if(Gl=O||o,nt=q||S,Ot(t,e),nt=q,Gl=O,_t(e),n&8192)e:for(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,o&&(l===null||S||Gl||nt||hn(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){S=l=t;try{if(c=S.stateNode,o)f=c.style,typeof f.setProperty=="function"?f.setProperty("display","none","important"):f.display="none";else{y=S.stateNode;var Y=S.memoizedProps.style,k=Y!=null&&Y.hasOwnProperty("display")?Y.display:null;y.style.display=k==null||typeof k=="boolean"?"":(""+k).trim()}}catch(ne){Ue(S,S.return,ne)}}}else if(t.tag===6){if(l===null){S=t;try{S.stateNode.nodeValue=o?"":S.memoizedProps}catch(ne){Ue(S,S.return,ne)}}}else if(t.tag===18){if(l===null){S=t;try{var H=S.stateNode;o?Hp(H,!0):Hp(S.stateNode,!1)}catch(ne){Ue(S,S.return,ne)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;l===t&&(l=null),t=t.return}l===t&&(l=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(l=n.retryQueue,l!==null&&(n.retryQueue=null,to(e,l))));break;case 19:Ot(t,e),_t(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,to(e,n)));break;case 30:break;case 21:break;default:Ot(t,e),_t(e)}}function _t(e){var t=e.flags;if(t&2){try{for(var l,n=e.return;n!==null;){if(qh(n)){l=n;break}n=n.return}if(l==null)throw Error(u(160));switch(l.tag){case 27:var o=l.stateNode,c=Ac(e);eo(e,c,o);break;case 5:var f=l.stateNode;l.flags&32&&(Qn(f,""),l.flags&=-33);var y=Ac(e);eo(e,y,f);break;case 3:case 4:var S=l.stateNode.containerInfo,O=Ac(e);zc(e,O,S);break;default:throw Error(u(161))}}catch(q){Ue(e,e.return,q)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Jh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Jh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Xl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Gh(e,t.alternate,t),t=t.sibling}function hn(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ga(4,t,t.return),hn(t);break;case 1:wl(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&Hh(t,t.return,l),hn(t);break;case 27:zr(t.stateNode);case 26:case 5:wl(t,t.return),hn(t);break;case 22:t.memoizedState===null&&hn(t);break;case 30:hn(t);break;default:hn(t)}e=e.sibling}}function Vl(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,o=e,c=t,f=c.flags;switch(c.tag){case 0:case 11:case 15:Vl(o,c,l),gr(4,c);break;case 1:if(Vl(o,c,l),n=c,o=n.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(O){Ue(n,n.return,O)}if(n=c,o=n.updateQueue,o!==null){var y=n.stateNode;try{var S=o.shared.hiddenCallbacks;if(S!==null)for(o.shared.hiddenCallbacks=null,o=0;o<S.length;o++)Cm(S[o],y)}catch(O){Ue(n,n.return,O)}}l&&f&64&&Bh(c),jr(c,c.return);break;case 27:Qh(c);case 26:case 5:Vl(o,c,l),l&&n===null&&f&4&&Lh(c),jr(c,c.return);break;case 12:Vl(o,c,l);break;case 31:Vl(o,c,l),l&&f&4&&Vh(o,c);break;case 13:Vl(o,c,l),l&&f&4&&Zh(o,c);break;case 22:c.memoizedState===null&&Vl(o,c,l),jr(c,c.return);break;case 30:break;default:Vl(o,c,l)}t=t.sibling}}function Oc(e,t){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&sr(l))}function _c(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&sr(e))}function cl(e,t,l,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Fh(e,t,l,n),t=t.sibling}function Fh(e,t,l,n){var o=t.flags;switch(t.tag){case 0:case 11:case 15:cl(e,t,l,n),o&2048&&gr(9,t);break;case 1:cl(e,t,l,n);break;case 3:cl(e,t,l,n),o&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&sr(e)));break;case 12:if(o&2048){cl(e,t,l,n),e=t.stateNode;try{var c=t.memoizedProps,f=c.id,y=c.onPostCommit;typeof y=="function"&&y(f,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(S){Ue(t,t.return,S)}}else cl(e,t,l,n);break;case 31:cl(e,t,l,n);break;case 13:cl(e,t,l,n);break;case 23:break;case 22:c=t.stateNode,f=t.alternate,t.memoizedState!==null?c._visibility&2?cl(e,t,l,n):Sr(e,t):c._visibility&2?cl(e,t,l,n):(c._visibility|=2,si(e,t,l,n,(t.subtreeFlags&10256)!==0||!1)),o&2048&&Oc(f,t);break;case 24:cl(e,t,l,n),o&2048&&_c(t.alternate,t);break;default:cl(e,t,l,n)}}function si(e,t,l,n,o){for(o=o&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,f=t,y=l,S=n,O=f.flags;switch(f.tag){case 0:case 11:case 15:si(c,f,y,S,o),gr(8,f);break;case 23:break;case 22:var q=f.stateNode;f.memoizedState!==null?q._visibility&2?si(c,f,y,S,o):Sr(c,f):(q._visibility|=2,si(c,f,y,S,o)),o&&O&2048&&Oc(f.alternate,f);break;case 24:si(c,f,y,S,o),o&&O&2048&&_c(f.alternate,f);break;default:si(c,f,y,S,o)}t=t.sibling}}function Sr(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var l=e,n=t,o=n.flags;switch(n.tag){case 22:Sr(l,n),o&2048&&Oc(n.alternate,n);break;case 24:Sr(l,n),o&2048&&_c(n.alternate,n);break;default:Sr(l,n)}t=t.sibling}}var Nr=8192;function oi(e,t,l){if(e.subtreeFlags&Nr)for(e=e.child;e!==null;)Wh(e,t,l),e=e.sibling}function Wh(e,t,l){switch(e.tag){case 26:oi(e,t,l),e.flags&Nr&&e.memoizedState!==null&&Ab(l,ul,e.memoizedState,e.memoizedProps);break;case 5:oi(e,t,l);break;case 3:case 4:var n=ul;ul=vo(e.stateNode.containerInfo),oi(e,t,l),ul=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=Nr,Nr=16777216,oi(e,t,l),Nr=n):oi(e,t,l));break;default:oi(e,t,l)}}function Ph(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Mr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var n=t[l];ct=n,ep(n,e)}Ph(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ih(e),e=e.sibling}function Ih(e){switch(e.tag){case 0:case 11:case 15:Mr(e),e.flags&2048&&ga(9,e,e.return);break;case 3:Mr(e);break;case 12:Mr(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,lo(e)):Mr(e);break;default:Mr(e)}}function lo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var n=t[l];ct=n,ep(n,e)}Ph(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ga(8,t,t.return),lo(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,lo(t));break;default:lo(t)}e=e.sibling}}function ep(e,t){for(;ct!==null;){var l=ct;switch(l.tag){case 0:case 11:case 15:ga(8,l,t);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var n=l.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:sr(l.memoizedState.cache)}if(n=l.child,n!==null)n.return=l,ct=n;else e:for(l=e;ct!==null;){n=ct;var o=n.sibling,c=n.return;if(Kh(n),n===l){ct=null;break e}if(o!==null){o.return=c,ct=o;break e}ct=c}}}var Ky={getCacheForType:function(e){var t=ht(tt),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return ht(tt).controller.signal}},Xy=typeof WeakMap=="function"?WeakMap:Map,_e=0,Ge=null,je=null,Ne=0,De=0,Kt=null,ja=!1,ui=!1,kc=!1,Zl=0,Fe=0,Sa=0,pn=0,Dc=0,Xt=0,ci=0,wr=null,kt=null,Uc=!1,ao=0,tp=0,no=1/0,io=null,Na=null,it=0,Ma=null,di=null,$l=0,Bc=0,Hc=null,lp=null,Cr=0,Lc=null;function Vt(){return(_e&2)!==0&&Ne!==0?Ne&-Ne:B.T!==null?Xc():Vi()}function ap(){if(Xt===0)if((Ne&536870912)===0||we){var e=Ja;Ja<<=1,(Ja&3932160)===0&&(Ja=262144),Xt=e}else Xt=536870912;return e=Yt.current,e!==null&&(e.flags|=32),Xt}function Dt(e,t,l){(e===Ge&&(De===2||De===9)||e.cancelPendingCommit!==null)&&(fi(e,0),wa(e,Ne,Xt,!1)),ie(e,l),((_e&2)===0||e!==Ge)&&(e===Ge&&((_e&2)===0&&(pn|=l),Fe===4&&wa(e,Ne,Xt,!1)),Cl(e))}function np(e,t,l){if((_e&6)!==0)throw Error(u(327));var n=!l&&(t&127)===0&&(t&e.expiredLanes)===0||oa(e,t),o=n?$y(e,t):Qc(e,t,!0),c=n;do{if(o===0){ui&&!n&&wa(e,t,0,!1);break}else{if(l=e.current.alternate,c&&!Vy(l)){o=Qc(e,t,!1),c=!1;continue}if(o===2){if(c=t,e.errorRecoveryDisabledLanes&c)var f=0;else f=e.pendingLanes&-536870913,f=f!==0?f:f&536870912?536870912:0;if(f!==0){t=f;e:{var y=e;o=wr;var S=y.current.memoizedState.isDehydrated;if(S&&(fi(y,f).flags|=256),f=Qc(y,f,!1),f!==2){if(kc&&!S){y.errorRecoveryDisabledLanes|=c,pn|=c,o=4;break e}c=kt,kt=o,c!==null&&(kt===null?kt=c:kt.push.apply(kt,c))}o=f}if(c=!1,o!==2)continue}}if(o===1){fi(e,0),wa(e,t,0,!0);break}e:{switch(n=e,c=o,c){case 0:case 1:throw Error(u(345));case 4:if((t&4194048)!==t)break;case 6:wa(n,t,Xt,!ja);break e;case 2:kt=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(o=ao+300-Nt(),10<o)){if(wa(n,t,Xt,!ja),Wa(n,0,!0)!==0)break e;$l=t,n.timeoutHandle=Dp(ip.bind(null,n,l,kt,io,Uc,t,Xt,pn,ci,ja,c,"Throttled",-0,0),o);break e}ip(n,l,kt,io,Uc,t,Xt,pn,ci,ja,c,null,-0,0)}}break}while(!0);Cl(e)}function ip(e,t,l,n,o,c,f,y,S,O,q,Y,k,H){if(e.timeoutHandle=-1,Y=t.subtreeFlags,Y&8192||(Y&16785408)===16785408){Y={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:_l},Wh(t,c,Y);var ne=(c&62914560)===c?ao-Nt():(c&4194048)===c?tp-Nt():0;if(ne=zb(Y,ne),ne!==null){$l=c,e.cancelPendingCommit=ne(mp.bind(null,e,t,c,l,n,o,f,y,S,q,Y,null,k,H)),wa(e,c,f,!O);return}}mp(e,t,c,l,n,o,f,y,S)}function Vy(e){for(var t=e;;){var l=t.tag;if((l===0||l===11||l===15)&&t.flags&16384&&(l=t.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var n=0;n<l.length;n++){var o=l[n],c=o.getSnapshot;o=o.value;try{if(!qt(c(),o))return!1}catch{return!1}}if(l=t.child,t.subtreeFlags&16384&&l!==null)l.return=t,t=l;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function wa(e,t,l,n){t&=~Dc,t&=~pn,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var o=t;0<o;){var c=31-wt(o),f=1<<c;n[c]=-1,o&=~f}l!==0&&Lt(e,l,t)}function ro(){return(_e&6)===0?(Tr(0),!1):!0}function qc(){if(je!==null){if(De===0)var e=je.return;else e=je,Bl=rn=null,lc(e),li=null,ur=0,e=je;for(;e!==null;)Uh(e.alternate,e),e=e.return;je=null}}function fi(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,fb(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),$l=0,qc(),Ge=e,je=l=Dl(e.current,null),Ne=t,De=0,Kt=null,ja=!1,ui=oa(e,t),kc=!1,ci=Xt=Dc=pn=Sa=Fe=0,kt=wr=null,Uc=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var o=31-wt(n),c=1<<o;t|=e[o],n&=~c}return Zl=t,Ts(),l}function rp(e,t){ve=null,B.H=xr,t===ti||t===Ds?(t=Sm(),De=3):t===Ku?(t=Sm(),De=4):De=t===yc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Kt=t,je===null&&(Fe=1,Js(e,It(t,e.current)))}function sp(){var e=Yt.current;return e===null?!0:(Ne&4194048)===Ne?al===null:(Ne&62914560)===Ne||(Ne&536870912)!==0?e===al:!1}function op(){var e=B.H;return B.H=xr,e===null?xr:e}function up(){var e=B.A;return B.A=Ky,e}function so(){Fe=4,ja||(Ne&4194048)!==Ne&&Yt.current!==null||(ui=!0),(Sa&134217727)===0&&(pn&134217727)===0||Ge===null||wa(Ge,Ne,Xt,!1)}function Qc(e,t,l){var n=_e;_e|=2;var o=op(),c=up();(Ge!==e||Ne!==t)&&(io=null,fi(e,t)),t=!1;var f=Fe;e:do try{if(De!==0&&je!==null){var y=je,S=Kt;switch(De){case 8:qc(),f=6;break e;case 3:case 2:case 9:case 6:Yt.current===null&&(t=!0);var O=De;if(De=0,Kt=null,mi(e,y,S,O),l&&ui){f=0;break e}break;default:O=De,De=0,Kt=null,mi(e,y,S,O)}}Zy(),f=Fe;break}catch(q){rp(e,q)}while(!0);return t&&e.shellSuspendCounter++,Bl=rn=null,_e=n,B.H=o,B.A=c,je===null&&(Ge=null,Ne=0,Ts()),f}function Zy(){for(;je!==null;)cp(je)}function $y(e,t){var l=_e;_e|=2;var n=op(),o=up();Ge!==e||Ne!==t?(io=null,no=Nt()+500,fi(e,t)):ui=oa(e,t);e:do try{if(De!==0&&je!==null){t=je;var c=Kt;t:switch(De){case 1:De=0,Kt=null,mi(e,t,c,1);break;case 2:case 9:if(gm(c)){De=0,Kt=null,dp(t);break}t=function(){De!==2&&De!==9||Ge!==e||(De=7),Cl(e)},c.then(t,t);break e;case 3:De=7;break e;case 4:De=5;break e;case 7:gm(c)?(De=0,Kt=null,dp(t)):(De=0,Kt=null,mi(e,t,c,7));break;case 5:var f=null;switch(je.tag){case 26:f=je.memoizedState;case 5:case 27:var y=je;if(f?Fp(f):y.stateNode.complete){De=0,Kt=null;var S=y.sibling;if(S!==null)je=S;else{var O=y.return;O!==null?(je=O,oo(O)):je=null}break t}}De=0,Kt=null,mi(e,t,c,5);break;case 6:De=0,Kt=null,mi(e,t,c,6);break;case 8:qc(),Fe=6;break e;default:throw Error(u(462))}}Jy();break}catch(q){rp(e,q)}while(!0);return Bl=rn=null,B.H=n,B.A=o,_e=l,je!==null?0:(Ge=null,Ne=0,Ts(),Fe)}function Jy(){for(;je!==null&&!ss();)cp(je)}function cp(e){var t=kh(e.alternate,e,Zl);e.memoizedProps=e.pendingProps,t===null?oo(e):je=t}function dp(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=Eh(l,t,t.pendingProps,t.type,void 0,Ne);break;case 11:t=Eh(l,t,t.pendingProps,t.type.render,t.ref,Ne);break;case 5:lc(t);default:Uh(l,t),t=je=um(t,Zl),t=kh(l,t,Zl)}e.memoizedProps=e.pendingProps,t===null?oo(e):je=t}function mi(e,t,l,n){Bl=rn=null,lc(t),li=null,ur=0;var o=t.return;try{if(By(e,o,t,l,Ne)){Fe=1,Js(e,It(l,e.current)),je=null;return}}catch(c){if(o!==null)throw je=o,c;Fe=1,Js(e,It(l,e.current)),je=null;return}t.flags&32768?(we||n===1?e=!0:ui||(Ne&536870912)!==0?e=!1:(ja=e=!0,(n===2||n===9||n===3||n===6)&&(n=Yt.current,n!==null&&n.tag===13&&(n.flags|=16384))),fp(t,e)):oo(t)}function oo(e){var t=e;do{if((t.flags&32768)!==0){fp(t,ja);return}e=t.return;var l=qy(t.alternate,t,Zl);if(l!==null){je=l;return}if(t=t.sibling,t!==null){je=t;return}je=t=e}while(t!==null);Fe===0&&(Fe=5)}function fp(e,t){do{var l=Qy(e.alternate,e);if(l!==null){l.flags&=32767,je=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){je=e;return}je=e=l}while(e!==null);Fe=6,je=null}function mp(e,t,l,n,o,c,f,y,S){e.cancelPendingCommit=null;do uo();while(it!==0);if((_e&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));if(c=t.lanes|t.childLanes,c|=Au,Qe(e,l,c,f,y,S),e===Ge&&(je=Ge=null,Ne=0),di=t,Ma=e,$l=l,Bc=c,Hc=o,lp=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Iy(Rn,function(){return yp(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=B.T,B.T=null,o=$.p,$.p=2,f=_e,_e|=4;try{Yy(e,t,l)}finally{_e=f,$.p=o,B.T=n}}it=1,hp(),pp(),vp()}}function hp(){if(it===1){it=0;var e=Ma,t=di,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=B.T,B.T=null;var n=$.p;$.p=2;var o=_e;_e|=4;try{$h(t,e);var c=Ic,f=em(e.containerInfo),y=c.focusedElem,S=c.selectionRange;if(f!==y&&y&&y.ownerDocument&&If(y.ownerDocument.documentElement,y)){if(S!==null&&Mu(y)){var O=S.start,q=S.end;if(q===void 0&&(q=O),"selectionStart"in y)y.selectionStart=O,y.selectionEnd=Math.min(q,y.value.length);else{var Y=y.ownerDocument||document,k=Y&&Y.defaultView||window;if(k.getSelection){var H=k.getSelection(),ne=y.textContent.length,fe=Math.min(S.start,ne),Le=S.end===void 0?fe:Math.min(S.end,ne);!H.extend&&fe>Le&&(f=Le,Le=fe,fe=f);var T=Pf(y,fe),w=Pf(y,Le);if(T&&w&&(H.rangeCount!==1||H.anchorNode!==T.node||H.anchorOffset!==T.offset||H.focusNode!==w.node||H.focusOffset!==w.offset)){var R=Y.createRange();R.setStart(T.node,T.offset),H.removeAllRanges(),fe>Le?(H.addRange(R),H.extend(w.node,w.offset)):(R.setEnd(w.node,w.offset),H.addRange(R))}}}}for(Y=[],H=y;H=H.parentNode;)H.nodeType===1&&Y.push({element:H,left:H.scrollLeft,top:H.scrollTop});for(typeof y.focus=="function"&&y.focus(),y=0;y<Y.length;y++){var Q=Y[y];Q.element.scrollLeft=Q.left,Q.element.scrollTop=Q.top}}So=!!Pc,Ic=Pc=null}finally{_e=o,$.p=n,B.T=l}}e.current=t,it=2}}function pp(){if(it===2){it=0;var e=Ma,t=di,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=B.T,B.T=null;var n=$.p;$.p=2;var o=_e;_e|=4;try{Gh(e,t.alternate,t)}finally{_e=o,$.p=n,B.T=l}}it=3}}function vp(){if(it===4||it===3){it=0,os();var e=Ma,t=di,l=$l,n=lp;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?it=5:(it=0,di=Ma=null,xp(e,e.pendingLanes));var o=e.pendingLanes;if(o===0&&(Na=null),kn(l),t=t.stateNode,Mt&&typeof Mt.onCommitFiberRoot=="function")try{Mt.onCommitFiberRoot(Za,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=B.T,o=$.p,$.p=2,B.T=null;try{for(var c=e.onRecoverableError,f=0;f<n.length;f++){var y=n[f];c(y.value,{componentStack:y.stack})}}finally{B.T=t,$.p=o}}($l&3)!==0&&uo(),Cl(e),o=e.pendingLanes,(l&261930)!==0&&(o&42)!==0?e===Lc?Cr++:(Cr=0,Lc=e):Cr=0,Tr(0)}}function xp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,sr(t)))}function uo(){return hp(),pp(),vp(),yp()}function yp(){if(it!==5)return!1;var e=Ma,t=Bc;Bc=0;var l=kn($l),n=B.T,o=$.p;try{$.p=32>l?32:l,B.T=null,l=Hc,Hc=null;var c=Ma,f=$l;if(it=0,di=Ma=null,$l=0,(_e&6)!==0)throw Error(u(331));var y=_e;if(_e|=4,Ih(c.current),Fh(c,c.current,f,l),_e=y,Tr(0,!1),Mt&&typeof Mt.onPostCommitFiberRoot=="function")try{Mt.onPostCommitFiberRoot(Za,c)}catch{}return!0}finally{$.p=o,B.T=n,xp(e,t)}}function bp(e,t,l){t=It(l,t),t=xc(e.stateNode,t,2),e=xa(e,t,2),e!==null&&(ie(e,2),Cl(e))}function Ue(e,t,l){if(e.tag===3)bp(e,e,l);else for(;t!==null;){if(t.tag===3){bp(t,e,l);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Na===null||!Na.has(n))){e=It(l,e),l=gh(2),n=xa(t,l,2),n!==null&&(jh(l,n,t,e),ie(n,2),Cl(n));break}}t=t.return}}function Yc(e,t,l){var n=e.pingCache;if(n===null){n=e.pingCache=new Xy;var o=new Set;n.set(t,o)}else o=n.get(t),o===void 0&&(o=new Set,n.set(t,o));o.has(l)||(kc=!0,o.add(l),e=Fy.bind(null,e,t,l),t.then(e,e))}function Fy(e,t,l){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Ge===e&&(Ne&l)===l&&(Fe===4||Fe===3&&(Ne&62914560)===Ne&&300>Nt()-ao?(_e&2)===0&&fi(e,0):Dc|=l,ci===Ne&&(ci=0)),Cl(e)}function gp(e,t){t===0&&(t=Ki()),e=ln(e,t),e!==null&&(ie(e,t),Cl(e))}function Wy(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),gp(e,l)}function Py(e,t){var l=0;switch(e.tag){case 31:case 13:var n=e.stateNode,o=e.memoizedState;o!==null&&(l=o.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(u(314))}n!==null&&n.delete(t),gp(e,l)}function Iy(e,t){return Va(e,t)}var co=null,hi=null,Gc=!1,fo=!1,Kc=!1,Ca=0;function Cl(e){e!==hi&&e.next===null&&(hi===null?co=hi=e:hi=hi.next=e),fo=!0,Gc||(Gc=!0,tb())}function Tr(e,t){if(!Kc&&fo){Kc=!0;do for(var l=!1,n=co;n!==null;){if(e!==0){var o=n.pendingLanes;if(o===0)var c=0;else{var f=n.suspendedLanes,y=n.pingedLanes;c=(1<<31-wt(42|e)+1)-1,c&=o&~(f&~y),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(l=!0,Mp(n,c))}else c=Ne,c=Wa(n,n===Ge?c:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(c&3)===0||oa(n,c)||(l=!0,Mp(n,c));n=n.next}while(l);Kc=!1}}function eb(){jp()}function jp(){fo=Gc=!1;var e=0;Ca!==0&&db()&&(e=Ca);for(var t=Nt(),l=null,n=co;n!==null;){var o=n.next,c=Sp(n,t);c===0?(n.next=null,l===null?co=o:l.next=o,o===null&&(hi=l)):(l=n,(e!==0||(c&3)!==0)&&(fo=!0)),n=o}it!==0&&it!==5||Tr(e),Ca!==0&&(Ca=0)}function Sp(e,t){for(var l=e.suspendedLanes,n=e.pingedLanes,o=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var f=31-wt(c),y=1<<f,S=o[f];S===-1?((y&l)===0||(y&n)!==0)&&(o[f]=ps(y,t)):S<=t&&(e.expiredLanes|=y),c&=~y}if(t=Ge,l=Ne,l=Wa(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,l===0||e===t&&(De===2||De===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&sa(n),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||oa(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(n!==null&&sa(n),kn(l)){case 2:case 8:l=cs;break;case 32:l=Rn;break;case 268435456:l=ds;break;default:l=Rn}return n=Np.bind(null,e),l=Va(l,n),e.callbackPriority=t,e.callbackNode=l,t}return n!==null&&n!==null&&sa(n),e.callbackPriority=2,e.callbackNode=null,2}function Np(e,t){if(it!==0&&it!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(uo()&&e.callbackNode!==l)return null;var n=Ne;return n=Wa(e,e===Ge?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(np(e,n,t),Sp(e,Nt()),e.callbackNode!=null&&e.callbackNode===l?Np.bind(null,e):null)}function Mp(e,t){if(uo())return null;np(e,t,!0)}function tb(){mb(function(){(_e&6)!==0?Va(us,eb):jp()})}function Xc(){if(Ca===0){var e=In;e===0&&(e=$a,$a<<=1,($a&261888)===0&&($a=256)),Ca=e}return Ca}function wp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:bs(""+e)}function Cp(e,t){var l=t.ownerDocument.createElement("input");return l.name=t.name,l.value=t.value,e.id&&l.setAttribute("form",e.id),t.parentNode.insertBefore(l,t),e=new FormData(e),l.parentNode.removeChild(l),e}function lb(e,t,l,n,o){if(t==="submit"&&l&&l.stateNode===o){var c=wp((o[et]||null).action),f=n.submitter;f&&(t=(t=f[et]||null)?wp(t.formAction):f.getAttribute("formAction"),t!==null&&(c=t,f=null));var y=new Ns("action","action",null,n,o);e.push({event:y,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Ca!==0){var S=f?Cp(o,f):new FormData(o);dc(l,{pending:!0,data:S,method:o.method,action:c},null,S)}}else typeof c=="function"&&(y.preventDefault(),S=f?Cp(o,f):new FormData(o),dc(l,{pending:!0,data:S,method:o.method,action:c},c,S))},currentTarget:o}]})}}for(var Vc=0;Vc<Eu.length;Vc++){var Zc=Eu[Vc],ab=Zc.toLowerCase(),nb=Zc[0].toUpperCase()+Zc.slice(1);ol(ab,"on"+nb)}ol(am,"onAnimationEnd"),ol(nm,"onAnimationIteration"),ol(im,"onAnimationStart"),ol("dblclick","onDoubleClick"),ol("focusin","onFocus"),ol("focusout","onBlur"),ol(gy,"onTransitionRun"),ol(jy,"onTransitionStart"),ol(Sy,"onTransitionCancel"),ol(rm,"onTransitionEnd"),Ln("onMouseEnter",["mouseout","mouseover"]),Ln("onMouseLeave",["mouseout","mouseover"]),Ln("onPointerEnter",["pointerout","pointerover"]),Ln("onPointerLeave",["pointerout","pointerover"]),Pa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Pa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Pa("onBeforeInput",["compositionend","keypress","textInput","paste"]),Pa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Pa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Pa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Er="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(" "),ib=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Er));function Tp(e,t){t=(t&4)!==0;for(var l=0;l<e.length;l++){var n=e[l],o=n.event;n=n.listeners;e:{var c=void 0;if(t)for(var f=n.length-1;0<=f;f--){var y=n[f],S=y.instance,O=y.currentTarget;if(y=y.listener,S!==c&&o.isPropagationStopped())break e;c=y,o.currentTarget=O;try{c(o)}catch(q){Cs(q)}o.currentTarget=null,c=S}else for(f=0;f<n.length;f++){if(y=n[f],S=y.instance,O=y.currentTarget,y=y.listener,S!==c&&o.isPropagationStopped())break e;c=y,o.currentTarget=O;try{c(o)}catch(q){Cs(q)}o.currentTarget=null,c=S}}}}function Se(e,t){var l=t[ru];l===void 0&&(l=t[ru]=new Set);var n=e+"__bubble";l.has(n)||(Ep(t,e,2,!1),l.add(n))}function $c(e,t,l){var n=0;t&&(n|=4),Ep(l,e,n,t)}var mo="_reactListening"+Math.random().toString(36).slice(2);function Jc(e){if(!e[mo]){e[mo]=!0,jf.forEach(function(l){l!=="selectionchange"&&(ib.has(l)||$c(l,!1,e),$c(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[mo]||(t[mo]=!0,$c("selectionchange",!1,t))}}function Ep(e,t,l,n){switch(av(t)){case 2:var o=_b;break;case 8:o=kb;break;default:o=cd}l=o.bind(null,t,l,e),o=void 0,!pu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),n?o!==void 0?e.addEventListener(t,l,{capture:!0,passive:o}):e.addEventListener(t,l,!0):o!==void 0?e.addEventListener(t,l,{passive:o}):e.addEventListener(t,l,!1)}function Fc(e,t,l,n,o){var c=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var f=n.tag;if(f===3||f===4){var y=n.stateNode.containerInfo;if(y===o)break;if(f===4)for(f=n.return;f!==null;){var S=f.tag;if((S===3||S===4)&&f.stateNode.containerInfo===o)return;f=f.return}for(;y!==null;){if(f=Un(y),f===null)return;if(S=f.tag,S===5||S===6||S===26||S===27){n=c=f;continue e}y=y.parentNode}}n=n.return}_f(function(){var O=c,q=mu(l),Y=[];e:{var k=sm.get(e);if(k!==void 0){var H=Ns,ne=e;switch(e){case"keypress":if(js(l)===0)break e;case"keydown":case"keyup":H=P0;break;case"focusin":ne="focus",H=bu;break;case"focusout":ne="blur",H=bu;break;case"beforeblur":case"afterblur":H=bu;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":H=Uf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":H=q0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":H=ty;break;case am:case nm:case im:H=G0;break;case rm:H=ay;break;case"scroll":case"scrollend":H=H0;break;case"wheel":H=iy;break;case"copy":case"cut":case"paste":H=X0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":H=Hf;break;case"toggle":case"beforetoggle":H=sy}var fe=(t&4)!==0,Le=!fe&&(e==="scroll"||e==="scrollend"),T=fe?k!==null?k+"Capture":null:k;fe=[];for(var w=O,R;w!==null;){var Q=w;if(R=Q.stateNode,Q=Q.tag,Q!==5&&Q!==26&&Q!==27||R===null||T===null||(Q=Fi(w,T),Q!=null&&fe.push(Ar(w,Q,R))),Le)break;w=w.return}0<fe.length&&(k=new H(k,ne,null,l,q),Y.push({event:k,listeners:fe}))}}if((t&7)===0){e:{if(k=e==="mouseover"||e==="pointerover",H=e==="mouseout"||e==="pointerout",k&&l!==fu&&(ne=l.relatedTarget||l.fromElement)&&(Un(ne)||ne[Dn]))break e;if((H||k)&&(k=q.window===q?q:(k=q.ownerDocument)?k.defaultView||k.parentWindow:window,H?(ne=l.relatedTarget||l.toElement,H=O,ne=ne?Un(ne):null,ne!==null&&(Le=m(ne),fe=ne.tag,ne!==Le||fe!==5&&fe!==27&&fe!==6)&&(ne=null)):(H=null,ne=O),H!==ne)){if(fe=Uf,Q="onMouseLeave",T="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(fe=Hf,Q="onPointerLeave",T="onPointerEnter",w="pointer"),Le=H==null?k:Ji(H),R=ne==null?k:Ji(ne),k=new fe(Q,w+"leave",H,l,q),k.target=Le,k.relatedTarget=R,Q=null,Un(q)===O&&(fe=new fe(T,w+"enter",ne,l,q),fe.target=R,fe.relatedTarget=Le,Q=fe),Le=Q,H&&ne)t:{for(fe=rb,T=H,w=ne,R=0,Q=T;Q;Q=fe(Q))R++;Q=0;for(var de=w;de;de=fe(de))Q++;for(;0<R-Q;)T=fe(T),R--;for(;0<Q-R;)w=fe(w),Q--;for(;R--;){if(T===w||w!==null&&T===w.alternate){fe=T;break t}T=fe(T),w=fe(w)}fe=null}else fe=null;H!==null&&Ap(Y,k,H,fe,!1),ne!==null&&Le!==null&&Ap(Y,Le,ne,fe,!0)}}e:{if(k=O?Ji(O):window,H=k.nodeName&&k.nodeName.toLowerCase(),H==="select"||H==="input"&&k.type==="file")var ze=Vf;else if(Kf(k))if(Zf)ze=xy;else{ze=py;var se=hy}else H=k.nodeName,!H||H.toLowerCase()!=="input"||k.type!=="checkbox"&&k.type!=="radio"?O&&du(O.elementType)&&(ze=Vf):ze=vy;if(ze&&(ze=ze(e,O))){Xf(Y,ze,l,q);break e}se&&se(e,k,O),e==="focusout"&&O&&k.type==="number"&&O.memoizedProps.value!=null&&cu(k,"number",k.value)}switch(se=O?Ji(O):window,e){case"focusin":(Kf(se)||se.contentEditable==="true")&&(Xn=se,wu=O,nr=null);break;case"focusout":nr=wu=Xn=null;break;case"mousedown":Cu=!0;break;case"contextmenu":case"mouseup":case"dragend":Cu=!1,tm(Y,l,q);break;case"selectionchange":if(by)break;case"keydown":case"keyup":tm(Y,l,q)}var xe;if(ju)e:{switch(e){case"compositionstart":var Me="onCompositionStart";break e;case"compositionend":Me="onCompositionEnd";break e;case"compositionupdate":Me="onCompositionUpdate";break e}Me=void 0}else Kn?Yf(e,l)&&(Me="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(Me="onCompositionStart");Me&&(Lf&&l.locale!=="ko"&&(Kn||Me!=="onCompositionStart"?Me==="onCompositionEnd"&&Kn&&(xe=kf()):(ca=q,vu="value"in ca?ca.value:ca.textContent,Kn=!0)),se=ho(O,Me),0<se.length&&(Me=new Bf(Me,e,null,l,q),Y.push({event:Me,listeners:se}),xe?Me.data=xe:(xe=Gf(l),xe!==null&&(Me.data=xe)))),(xe=uy?cy(e,l):dy(e,l))&&(Me=ho(O,"onBeforeInput"),0<Me.length&&(se=new Bf("onBeforeInput","beforeinput",null,l,q),Y.push({event:se,listeners:Me}),se.data=xe)),lb(Y,e,O,l,q)}Tp(Y,t)})}function Ar(e,t,l){return{instance:e,listener:t,currentTarget:l}}function ho(e,t){for(var l=t+"Capture",n=[];e!==null;){var o=e,c=o.stateNode;if(o=o.tag,o!==5&&o!==26&&o!==27||c===null||(o=Fi(e,l),o!=null&&n.unshift(Ar(e,o,c)),o=Fi(e,t),o!=null&&n.push(Ar(e,o,c))),e.tag===3)return n;e=e.return}return[]}function rb(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Ap(e,t,l,n,o){for(var c=t._reactName,f=[];l!==null&&l!==n;){var y=l,S=y.alternate,O=y.stateNode;if(y=y.tag,S!==null&&S===n)break;y!==5&&y!==26&&y!==27||O===null||(S=O,o?(O=Fi(l,c),O!=null&&f.unshift(Ar(l,O,S))):o||(O=Fi(l,c),O!=null&&f.push(Ar(l,O,S)))),l=l.return}f.length!==0&&e.push({event:t,listeners:f})}var sb=/\r\n?/g,ob=/\u0000|\uFFFD/g;function zp(e){return(typeof e=="string"?e:""+e).replace(sb,`
|
|
49
|
+
`).replace(ob,"")}function Rp(e,t){return t=zp(t),zp(e)===t}function He(e,t,l,n,o,c){switch(l){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||Qn(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&Qn(e,""+n);break;case"className":xs(e,"class",n);break;case"tabIndex":xs(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":xs(e,l,n);break;case"style":Rf(e,n,c);break;case"data":if(t!=="object"){xs(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||l!=="href")){e.removeAttribute(l);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(l);break}n=bs(""+n),e.setAttribute(l,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof c=="function"&&(l==="formAction"?(t!=="input"&&He(e,t,"name",o.name,o,null),He(e,t,"formEncType",o.formEncType,o,null),He(e,t,"formMethod",o.formMethod,o,null),He(e,t,"formTarget",o.formTarget,o,null)):(He(e,t,"encType",o.encType,o,null),He(e,t,"method",o.method,o,null),He(e,t,"target",o.target,o,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(l);break}n=bs(""+n),e.setAttribute(l,n);break;case"onClick":n!=null&&(e.onclick=_l);break;case"onScroll":n!=null&&Se("scroll",e);break;case"onScrollEnd":n!=null&&Se("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(u(61));if(l=n.__html,l!=null){if(o.children!=null)throw Error(u(60));e.innerHTML=l}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}l=bs(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(l,""+n):e.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":n===!0?e.setAttribute(l,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(l,n):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(l,n):e.removeAttribute(l);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(l):e.setAttribute(l,n);break;case"popover":Se("beforetoggle",e),Se("toggle",e),vs(e,"popover",n);break;case"xlinkActuate":Ol(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":Ol(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":Ol(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":Ol(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":Ol(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":Ol(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":Ol(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":Ol(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":Ol(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":vs(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=U0.get(l)||l,vs(e,l,n))}}function Wc(e,t,l,n,o,c){switch(l){case"style":Rf(e,n,c);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(u(61));if(l=n.__html,l!=null){if(o.children!=null)throw Error(u(60));e.innerHTML=l}}break;case"children":typeof n=="string"?Qn(e,n):(typeof n=="number"||typeof n=="bigint")&&Qn(e,""+n);break;case"onScroll":n!=null&&Se("scroll",e);break;case"onScrollEnd":n!=null&&Se("scrollend",e);break;case"onClick":n!=null&&(e.onclick=_l);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Sf.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(o=l.endsWith("Capture"),t=l.slice(2,o?l.length-7:void 0),c=e[et]||null,c=c!=null?c[l]:null,typeof c=="function"&&e.removeEventListener(t,c,o),typeof n=="function")){typeof c!="function"&&c!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(t,n,o);break e}l in e?e[l]=n:n===!0?e.setAttribute(l,""):vs(e,l,n)}}}function vt(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Se("error",e),Se("load",e);var n=!1,o=!1,c;for(c in l)if(l.hasOwnProperty(c)){var f=l[c];if(f!=null)switch(c){case"src":n=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:He(e,t,c,f,l,null)}}o&&He(e,t,"srcSet",l.srcSet,l,null),n&&He(e,t,"src",l.src,l,null);return;case"input":Se("invalid",e);var y=c=f=o=null,S=null,O=null;for(n in l)if(l.hasOwnProperty(n)){var q=l[n];if(q!=null)switch(n){case"name":o=q;break;case"type":f=q;break;case"checked":S=q;break;case"defaultChecked":O=q;break;case"value":c=q;break;case"defaultValue":y=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(u(137,t));break;default:He(e,t,n,q,l,null)}}Tf(e,c,y,S,O,f,o,!1);return;case"select":Se("invalid",e),n=f=c=null;for(o in l)if(l.hasOwnProperty(o)&&(y=l[o],y!=null))switch(o){case"value":c=y;break;case"defaultValue":f=y;break;case"multiple":n=y;default:He(e,t,o,y,l,null)}t=c,l=f,e.multiple=!!n,t!=null?qn(e,!!n,t,!1):l!=null&&qn(e,!!n,l,!0);return;case"textarea":Se("invalid",e),c=o=n=null;for(f in l)if(l.hasOwnProperty(f)&&(y=l[f],y!=null))switch(f){case"value":n=y;break;case"defaultValue":o=y;break;case"children":c=y;break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(u(91));break;default:He(e,t,f,y,l,null)}Af(e,n,o,c);return;case"option":for(S in l)if(l.hasOwnProperty(S)&&(n=l[S],n!=null))switch(S){case"selected":e.selected=n&&typeof n!="function"&&typeof n!="symbol";break;default:He(e,t,S,n,l,null)}return;case"dialog":Se("beforetoggle",e),Se("toggle",e),Se("cancel",e),Se("close",e);break;case"iframe":case"object":Se("load",e);break;case"video":case"audio":for(n=0;n<Er.length;n++)Se(Er[n],e);break;case"image":Se("error",e),Se("load",e);break;case"details":Se("toggle",e);break;case"embed":case"source":case"link":Se("error",e),Se("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(O in l)if(l.hasOwnProperty(O)&&(n=l[O],n!=null))switch(O){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:He(e,t,O,n,l,null)}return;default:if(du(t)){for(q in l)l.hasOwnProperty(q)&&(n=l[q],n!==void 0&&Wc(e,t,q,n,l,void 0));return}}for(y in l)l.hasOwnProperty(y)&&(n=l[y],n!=null&&He(e,t,y,n,l,null))}function ub(e,t,l,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var o=null,c=null,f=null,y=null,S=null,O=null,q=null;for(H in l){var Y=l[H];if(l.hasOwnProperty(H)&&Y!=null)switch(H){case"checked":break;case"value":break;case"defaultValue":S=Y;default:n.hasOwnProperty(H)||He(e,t,H,null,n,Y)}}for(var k in n){var H=n[k];if(Y=l[k],n.hasOwnProperty(k)&&(H!=null||Y!=null))switch(k){case"type":c=H;break;case"name":o=H;break;case"checked":O=H;break;case"defaultChecked":q=H;break;case"value":f=H;break;case"defaultValue":y=H;break;case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(u(137,t));break;default:H!==Y&&He(e,t,k,H,n,Y)}}uu(e,f,y,S,O,q,c,o);return;case"select":H=f=y=k=null;for(c in l)if(S=l[c],l.hasOwnProperty(c)&&S!=null)switch(c){case"value":break;case"multiple":H=S;default:n.hasOwnProperty(c)||He(e,t,c,null,n,S)}for(o in n)if(c=n[o],S=l[o],n.hasOwnProperty(o)&&(c!=null||S!=null))switch(o){case"value":k=c;break;case"defaultValue":y=c;break;case"multiple":f=c;default:c!==S&&He(e,t,o,c,n,S)}t=y,l=f,n=H,k!=null?qn(e,!!l,k,!1):!!n!=!!l&&(t!=null?qn(e,!!l,t,!0):qn(e,!!l,l?[]:"",!1));return;case"textarea":H=k=null;for(y in l)if(o=l[y],l.hasOwnProperty(y)&&o!=null&&!n.hasOwnProperty(y))switch(y){case"value":break;case"children":break;default:He(e,t,y,null,n,o)}for(f in n)if(o=n[f],c=l[f],n.hasOwnProperty(f)&&(o!=null||c!=null))switch(f){case"value":k=o;break;case"defaultValue":H=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(u(91));break;default:o!==c&&He(e,t,f,o,n,c)}Ef(e,k,H);return;case"option":for(var ne in l)if(k=l[ne],l.hasOwnProperty(ne)&&k!=null&&!n.hasOwnProperty(ne))switch(ne){case"selected":e.selected=!1;break;default:He(e,t,ne,null,n,k)}for(S in n)if(k=n[S],H=l[S],n.hasOwnProperty(S)&&k!==H&&(k!=null||H!=null))switch(S){case"selected":e.selected=k&&typeof k!="function"&&typeof k!="symbol";break;default:He(e,t,S,k,n,H)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var fe in l)k=l[fe],l.hasOwnProperty(fe)&&k!=null&&!n.hasOwnProperty(fe)&&He(e,t,fe,null,n,k);for(O in n)if(k=n[O],H=l[O],n.hasOwnProperty(O)&&k!==H&&(k!=null||H!=null))switch(O){case"children":case"dangerouslySetInnerHTML":if(k!=null)throw Error(u(137,t));break;default:He(e,t,O,k,n,H)}return;default:if(du(t)){for(var Le in l)k=l[Le],l.hasOwnProperty(Le)&&k!==void 0&&!n.hasOwnProperty(Le)&&Wc(e,t,Le,void 0,n,k);for(q in n)k=n[q],H=l[q],!n.hasOwnProperty(q)||k===H||k===void 0&&H===void 0||Wc(e,t,q,k,n,H);return}}for(var T in l)k=l[T],l.hasOwnProperty(T)&&k!=null&&!n.hasOwnProperty(T)&&He(e,t,T,null,n,k);for(Y in n)k=n[Y],H=l[Y],!n.hasOwnProperty(Y)||k===H||k==null&&H==null||He(e,t,Y,k,n,H)}function Op(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function cb(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,l=performance.getEntriesByType("resource"),n=0;n<l.length;n++){var o=l[n],c=o.transferSize,f=o.initiatorType,y=o.duration;if(c&&y&&Op(f)){for(f=0,y=o.responseEnd,n+=1;n<l.length;n++){var S=l[n],O=S.startTime;if(O>y)break;var q=S.transferSize,Y=S.initiatorType;q&&Op(Y)&&(S=S.responseEnd,f+=q*(S<y?1:(y-O)/(S-O)))}if(--n,t+=8*(c+f)/(o.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Pc=null,Ic=null;function po(e){return e.nodeType===9?e:e.ownerDocument}function _p(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function kp(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function ed(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var td=null;function db(){var e=window.event;return e&&e.type==="popstate"?e===td?!1:(td=e,!0):(td=null,!1)}var Dp=typeof setTimeout=="function"?setTimeout:void 0,fb=typeof clearTimeout=="function"?clearTimeout:void 0,Up=typeof Promise=="function"?Promise:void 0,mb=typeof queueMicrotask=="function"?queueMicrotask:typeof Up<"u"?function(e){return Up.resolve(null).then(e).catch(hb)}:Dp;function hb(e){setTimeout(function(){throw e})}function Ta(e){return e==="head"}function Bp(e,t){var l=t,n=0;do{var o=l.nextSibling;if(e.removeChild(l),o&&o.nodeType===8)if(l=o.data,l==="/$"||l==="/&"){if(n===0){e.removeChild(o),yi(t);return}n--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")n++;else if(l==="html")zr(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,zr(l);for(var c=l.firstChild;c;){var f=c.nextSibling,y=c.nodeName;c[$i]||y==="SCRIPT"||y==="STYLE"||y==="LINK"&&c.rel.toLowerCase()==="stylesheet"||l.removeChild(c),c=f}}else l==="body"&&zr(e.ownerDocument.body);l=o}while(l);yi(t)}function Hp(e,t){var l=e;e=0;do{var n=l.nextSibling;if(l.nodeType===1?t?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(t?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),n&&n.nodeType===8)if(l=n.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=n}while(l)}function ld(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var l=t;switch(t=t.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":ld(l),su(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function pb(e,t,l,n){for(;e.nodeType===1;){var o=l;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[$i])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(c=e.getAttribute("rel"),c==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(c!==o.rel||e.getAttribute("href")!==(o.href==null||o.href===""?null:o.href)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin)||e.getAttribute("title")!==(o.title==null?null:o.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(c=e.getAttribute("src"),(c!==(o.src==null?null:o.src)||e.getAttribute("type")!==(o.type==null?null:o.type)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin))&&c&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var c=o.name==null?null:""+o.name;if(o.type==="hidden"&&e.getAttribute("name")===c)return e}else return e;if(e=nl(e.nextSibling),e===null)break}return null}function vb(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=nl(e.nextSibling),e===null))return null;return e}function Lp(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=nl(e.nextSibling),e===null))return null;return e}function ad(e){return e.data==="$?"||e.data==="$~"}function nd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function xb(e,t){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||l.readyState!=="loading")t();else{var n=function(){t(),l.removeEventListener("DOMContentLoaded",n)};l.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function nl(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var id=null;function qp(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return nl(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function Qp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(t===0)return e;t--}else l!=="/$"&&l!=="/&"||t++}e=e.previousSibling}return null}function Yp(e,t,l){switch(t=po(l),e){case"html":if(e=t.documentElement,!e)throw Error(u(452));return e;case"head":if(e=t.head,!e)throw Error(u(453));return e;case"body":if(e=t.body,!e)throw Error(u(454));return e;default:throw Error(u(451))}}function zr(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);su(e)}var il=new Map,Gp=new Set;function vo(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Jl=$.d;$.d={f:yb,r:bb,D:gb,C:jb,L:Sb,m:Nb,X:wb,S:Mb,M:Cb};function yb(){var e=Jl.f(),t=ro();return e||t}function bb(e){var t=Bn(e);t!==null&&t.tag===5&&t.type==="form"?rh(t):Jl.r(e)}var pi=typeof document>"u"?null:document;function Kp(e,t,l){var n=pi;if(n&&typeof t=="string"&&t){var o=Wt(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof l=="string"&&(o+='[crossorigin="'+l+'"]'),Gp.has(o)||(Gp.add(o),e={rel:e,crossOrigin:l,href:t},n.querySelector(o)===null&&(t=n.createElement("link"),vt(t,"link",e),ut(t),n.head.appendChild(t)))}}function gb(e){Jl.D(e),Kp("dns-prefetch",e,null)}function jb(e,t){Jl.C(e,t),Kp("preconnect",e,t)}function Sb(e,t,l){Jl.L(e,t,l);var n=pi;if(n&&e&&t){var o='link[rel="preload"][as="'+Wt(t)+'"]';t==="image"&&l&&l.imageSrcSet?(o+='[imagesrcset="'+Wt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(o+='[imagesizes="'+Wt(l.imageSizes)+'"]')):o+='[href="'+Wt(e)+'"]';var c=o;switch(t){case"style":c=vi(e);break;case"script":c=xi(e)}il.has(c)||(e=b({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),il.set(c,e),n.querySelector(o)!==null||t==="style"&&n.querySelector(Rr(c))||t==="script"&&n.querySelector(Or(c))||(t=n.createElement("link"),vt(t,"link",e),ut(t),n.head.appendChild(t)))}}function Nb(e,t){Jl.m(e,t);var l=pi;if(l&&e){var n=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+Wt(n)+'"][href="'+Wt(e)+'"]',c=o;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=xi(e)}if(!il.has(c)&&(e=b({rel:"modulepreload",href:e},t),il.set(c,e),l.querySelector(o)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Or(c)))return}n=l.createElement("link"),vt(n,"link",e),ut(n),l.head.appendChild(n)}}}function Mb(e,t,l){Jl.S(e,t,l);var n=pi;if(n&&e){var o=Hn(n).hoistableStyles,c=vi(e);t=t||"default";var f=o.get(c);if(!f){var y={loading:0,preload:null};if(f=n.querySelector(Rr(c)))y.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},l),(l=il.get(c))&&rd(e,l);var S=f=n.createElement("link");ut(S),vt(S,"link",e),S._p=new Promise(function(O,q){S.onload=O,S.onerror=q}),S.addEventListener("load",function(){y.loading|=1}),S.addEventListener("error",function(){y.loading|=2}),y.loading|=4,xo(f,t,n)}f={type:"stylesheet",instance:f,count:1,state:y},o.set(c,f)}}}function wb(e,t){Jl.X(e,t);var l=pi;if(l&&e){var n=Hn(l).hoistableScripts,o=xi(e),c=n.get(o);c||(c=l.querySelector(Or(o)),c||(e=b({src:e,async:!0},t),(t=il.get(o))&&sd(e,t),c=l.createElement("script"),ut(c),vt(c,"link",e),l.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},n.set(o,c))}}function Cb(e,t){Jl.M(e,t);var l=pi;if(l&&e){var n=Hn(l).hoistableScripts,o=xi(e),c=n.get(o);c||(c=l.querySelector(Or(o)),c||(e=b({src:e,async:!0,type:"module"},t),(t=il.get(o))&&sd(e,t),c=l.createElement("script"),ut(c),vt(c,"link",e),l.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},n.set(o,c))}}function Xp(e,t,l,n){var o=(o=ae.current)?vo(o):null;if(!o)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=vi(l.href),l=Hn(o).hoistableStyles,n=l.get(t),n||(n={type:"style",instance:null,count:0,state:null},l.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=vi(l.href);var c=Hn(o).hoistableStyles,f=c.get(e);if(f||(o=o.ownerDocument||o,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,f),(c=o.querySelector(Rr(e)))&&!c._p&&(f.instance=c,f.state.loading=5),il.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},il.set(e,l),c||Tb(o,e,l,f.state))),t&&n===null)throw Error(u(528,""));return f}if(t&&n!==null)throw Error(u(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=xi(l),l=Hn(o).hoistableScripts,n=l.get(t),n||(n={type:"script",instance:null,count:0,state:null},l.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function vi(e){return'href="'+Wt(e)+'"'}function Rr(e){return'link[rel="stylesheet"]['+e+"]"}function Vp(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function Tb(e,t,l,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),vt(t,"link",l),ut(t),e.head.appendChild(t))}function xi(e){return'[src="'+Wt(e)+'"]'}function Or(e){return"script[async]"+e}function Zp(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+Wt(l.href)+'"]');if(n)return t.instance=n,ut(n),n;var o=b({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),ut(n),vt(n,"style",o),xo(n,l.precedence,e),t.instance=n;case"stylesheet":o=vi(l.href);var c=e.querySelector(Rr(o));if(c)return t.state.loading|=4,t.instance=c,ut(c),c;n=Vp(l),(o=il.get(o))&&rd(n,o),c=(e.ownerDocument||e).createElement("link"),ut(c);var f=c;return f._p=new Promise(function(y,S){f.onload=y,f.onerror=S}),vt(c,"link",n),t.state.loading|=4,xo(c,l.precedence,e),t.instance=c;case"script":return c=xi(l.src),(o=e.querySelector(Or(c)))?(t.instance=o,ut(o),o):(n=l,(o=il.get(c))&&(n=b({},l),sd(n,o)),e=e.ownerDocument||e,o=e.createElement("script"),ut(o),vt(o,"link",n),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,xo(n,l.precedence,e));return t.instance}function xo(e,t,l){for(var n=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=n.length?n[n.length-1]:null,c=o,f=0;f<n.length;f++){var y=n[f];if(y.dataset.precedence===t)c=y;else if(c!==o)break}c?c.parentNode.insertBefore(e,c.nextSibling):(t=l.nodeType===9?l.head:l,t.insertBefore(e,t.firstChild))}function rd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function sd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var yo=null;function $p(e,t,l){if(yo===null){var n=new Map,o=yo=new Map;o.set(l,n)}else o=yo,n=o.get(l),n||(n=new Map,o.set(l,n));if(n.has(e))return n;for(n.set(e,null),l=l.getElementsByTagName(e),o=0;o<l.length;o++){var c=l[o];if(!(c[$i]||c[Ye]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var f=c.getAttribute(t)||"";f=e+f;var y=n.get(f);y?y.push(c):n.set(f,[c])}}return n}function Jp(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function Eb(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Fp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Ab(e,t,l,n){if(l.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var o=vi(n.href),c=t.querySelector(Rr(o));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=bo.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=c,ut(c);return}c=t.ownerDocument||t,n=Vp(n),(o=il.get(o))&&rd(n,o),c=c.createElement("link"),ut(c);var f=c;f._p=new Promise(function(y,S){f.onload=y,f.onerror=S}),vt(c,"link",n),l.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=bo.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var od=0;function zb(e,t){return e.stylesheets&&e.count===0&&jo(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var n=setTimeout(function(){if(e.stylesheets&&jo(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&od===0&&(od=62500*cb());var o=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&jo(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>od?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(o)}}:null}function bo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)jo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var go=null;function jo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,go=new Map,t.forEach(Rb,e),go=null,bo.call(e))}function Rb(e,t){if(!(t.state.loading&4)){var l=go.get(e);if(l)var n=l.get(null);else{l=new Map,go.set(e,l);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<o.length;c++){var f=o[c];(f.nodeName==="LINK"||f.getAttribute("media")!=="not all")&&(l.set(f.dataset.precedence,f),n=f)}n&&l.set(null,n)}o=t.instance,f=o.getAttribute("data-precedence"),c=l.get(f)||n,c===n&&l.set(null,o),l.set(f,o),this.count++,n=bo.bind(this),o.addEventListener("load",n),o.addEventListener("error",n),c?c.parentNode.insertBefore(o,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(o,e.firstChild)),t.state.loading|=4}}var _r={$$typeof:K,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function Ob(e,t,l,n,o,c,f,y,S){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=On(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=On(0),this.hiddenUpdates=On(null),this.identifierPrefix=n,this.onUncaughtError=o,this.onCaughtError=c,this.onRecoverableError=f,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=S,this.incompleteTransitions=new Map}function Wp(e,t,l,n,o,c,f,y,S,O,q,Y){return e=new Ob(e,t,l,f,S,O,q,Y,y),t=1,c===!0&&(t|=24),c=Qt(3,null,null,t),e.current=c,c.stateNode=e,t=Qu(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:n,isDehydrated:l,cache:t},Xu(c),e}function Pp(e){return e?(e=$n,e):$n}function Ip(e,t,l,n,o,c){o=Pp(o),n.context===null?n.context=o:n.pendingContext=o,n=va(t),n.payload={element:l},c=c===void 0?null:c,c!==null&&(n.callback=c),l=xa(e,n,t),l!==null&&(Dt(l,e,t),dr(l,e,t))}function ev(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function ud(e,t){ev(e,t),(e=e.alternate)&&ev(e,t)}function tv(e){if(e.tag===13||e.tag===31){var t=ln(e,67108864);t!==null&&Dt(t,e,67108864),ud(e,67108864)}}function lv(e){if(e.tag===13||e.tag===31){var t=Vt();t=_n(t);var l=ln(e,t);l!==null&&Dt(l,e,t),ud(e,t)}}var So=!0;function _b(e,t,l,n){var o=B.T;B.T=null;var c=$.p;try{$.p=2,cd(e,t,l,n)}finally{$.p=c,B.T=o}}function kb(e,t,l,n){var o=B.T;B.T=null;var c=$.p;try{$.p=8,cd(e,t,l,n)}finally{$.p=c,B.T=o}}function cd(e,t,l,n){if(So){var o=dd(n);if(o===null)Fc(e,t,n,No,l),nv(e,n);else if(Ub(o,e,t,l,n))n.stopPropagation();else if(nv(e,n),t&4&&-1<Db.indexOf(e)){for(;o!==null;){var c=Bn(o);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var f=Sl(c.pendingLanes);if(f!==0){var y=c;for(y.pendingLanes|=2,y.entangledLanes|=2;f;){var S=1<<31-wt(f);y.entanglements[1]|=S,f&=~S}Cl(c),(_e&6)===0&&(no=Nt()+500,Tr(0))}}break;case 31:case 13:y=ln(c,2),y!==null&&Dt(y,c,2),ro(),ud(c,2)}if(c=dd(n),c===null&&Fc(e,t,n,No,l),c===o)break;o=c}o!==null&&n.stopPropagation()}else Fc(e,t,n,null,l)}}function dd(e){return e=mu(e),fd(e)}var No=null;function fd(e){if(No=null,e=Un(e),e!==null){var t=m(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=h(t),e!==null)return e;e=null}else if(l===31){if(e=x(t),e!==null)return e;e=null}else if(l===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return No=e,null}function av(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(lu()){case us:return 2;case cs:return 8;case Rn:case au:return 32;case ds:return 268435456;default:return 32}default:return 32}}var md=!1,Ea=null,Aa=null,za=null,kr=new Map,Dr=new Map,Ra=[],Db="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function nv(e,t){switch(e){case"focusin":case"focusout":Ea=null;break;case"dragenter":case"dragleave":Aa=null;break;case"mouseover":case"mouseout":za=null;break;case"pointerover":case"pointerout":kr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Dr.delete(t.pointerId)}}function Ur(e,t,l,n,o,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:l,eventSystemFlags:n,nativeEvent:c,targetContainers:[o]},t!==null&&(t=Bn(t),t!==null&&tv(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function Ub(e,t,l,n,o){switch(t){case"focusin":return Ea=Ur(Ea,e,t,l,n,o),!0;case"dragenter":return Aa=Ur(Aa,e,t,l,n,o),!0;case"mouseover":return za=Ur(za,e,t,l,n,o),!0;case"pointerover":var c=o.pointerId;return kr.set(c,Ur(kr.get(c)||null,e,t,l,n,o)),!0;case"gotpointercapture":return c=o.pointerId,Dr.set(c,Ur(Dr.get(c)||null,e,t,l,n,o)),!0}return!1}function iv(e){var t=Un(e.target);if(t!==null){var l=m(t);if(l!==null){if(t=l.tag,t===13){if(t=h(l),t!==null){e.blockedOn=t,Zi(e.priority,function(){lv(l)});return}}else if(t===31){if(t=x(l),t!==null){e.blockedOn=t,Zi(e.priority,function(){lv(l)});return}}else if(t===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Mo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=dd(e.nativeEvent);if(l===null){l=e.nativeEvent;var n=new l.constructor(l.type,l);fu=n,l.target.dispatchEvent(n),fu=null}else return t=Bn(l),t!==null&&tv(t),e.blockedOn=l,!1;t.shift()}return!0}function rv(e,t,l){Mo(e)&&l.delete(t)}function Bb(){md=!1,Ea!==null&&Mo(Ea)&&(Ea=null),Aa!==null&&Mo(Aa)&&(Aa=null),za!==null&&Mo(za)&&(za=null),kr.forEach(rv),Dr.forEach(rv)}function wo(e,t){e.blockedOn===t&&(e.blockedOn=null,md||(md=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,Bb)))}var Co=null;function sv(e){Co!==e&&(Co=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){Co===e&&(Co=null);for(var t=0;t<e.length;t+=3){var l=e[t],n=e[t+1],o=e[t+2];if(typeof n!="function"){if(fd(n||l)===null)continue;break}var c=Bn(l);c!==null&&(e.splice(t,3),t-=3,dc(c,{pending:!0,data:o,method:l.method,action:n},n,o))}}))}function yi(e){function t(S){return wo(S,e)}Ea!==null&&wo(Ea,e),Aa!==null&&wo(Aa,e),za!==null&&wo(za,e),kr.forEach(t),Dr.forEach(t);for(var l=0;l<Ra.length;l++){var n=Ra[l];n.blockedOn===e&&(n.blockedOn=null)}for(;0<Ra.length&&(l=Ra[0],l.blockedOn===null);)iv(l),l.blockedOn===null&&Ra.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(n=0;n<l.length;n+=3){var o=l[n],c=l[n+1],f=o[et]||null;if(typeof c=="function")f||sv(l);else if(f){var y=null;if(c&&c.hasAttribute("formAction")){if(o=c,f=c[et]||null)y=f.formAction;else if(fd(o)!==null)continue}else y=f.action;typeof y=="function"?l[n+1]=y:(l.splice(n,3),n-=3),sv(l)}}}function ov(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(f){return o=f})},focusReset:"manual",scroll:"manual"})}function t(){o!==null&&(o(),o=null),n||setTimeout(l,20)}function l(){if(!n&&!navigation.transition){var c=navigation.currentEntry;c&&c.url!=null&&navigation.navigate(c.url,{state:c.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,o=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(l,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),o!==null&&(o(),o=null)}}}function hd(e){this._internalRoot=e}To.prototype.render=hd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var l=t.current,n=Vt();Ip(l,n,e,t,null,null)},To.prototype.unmount=hd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ip(e.current,2,null,e,null,null),ro(),t[Dn]=null}};function To(e){this._internalRoot=e}To.prototype.unstable_scheduleHydration=function(e){if(e){var t=Vi();e={blockedOn:null,target:e,priority:t};for(var l=0;l<Ra.length&&t!==0&&t<Ra[l].priority;l++);Ra.splice(l,0,e),l===0&&iv(e)}};var uv=i.version;if(uv!=="19.2.7")throw Error(u(527,uv,"19.2.7"));$.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=v(t),e=e!==null?g(e):null,e=e===null?null:e.stateNode,e};var Hb={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Eo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Eo.isDisabled&&Eo.supportsFiber)try{Za=Eo.inject(Hb),Mt=Eo}catch{}}return Hr.createRoot=function(e,t){if(!d(e))throw Error(u(299));var l=!1,n="",o=vh,c=xh,f=yh;return t!=null&&(t.unstable_strictMode===!0&&(l=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(f=t.onRecoverableError)),t=Wp(e,1,!1,null,null,l,n,null,o,c,f,ov),e[Dn]=t.current,Jc(e),new hd(t)},Hr.hydrateRoot=function(e,t,l){if(!d(e))throw Error(u(299));var n=!1,o="",c=vh,f=xh,y=yh,S=null;return l!=null&&(l.unstable_strictMode===!0&&(n=!0),l.identifierPrefix!==void 0&&(o=l.identifierPrefix),l.onUncaughtError!==void 0&&(c=l.onUncaughtError),l.onCaughtError!==void 0&&(f=l.onCaughtError),l.onRecoverableError!==void 0&&(y=l.onRecoverableError),l.formState!==void 0&&(S=l.formState)),t=Wp(e,1,!0,t,l??null,n,o,S,c,f,y,ov),t.context=Pp(null),l=t.current,n=Vt(),n=_n(n),o=va(n),o.callback=null,xa(l,o,n),l=n,t.current.lanes=l,ie(t,l),Cl(t),e[Dn]=t.current,Jc(e),new To(t)},Hr.version="19.2.7",Hr}var gv;function Fb(){if(gv)return bd.exports;gv=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(i){console.error(i)}}return a(),bd.exports=Jb(),bd.exports}var Wb=Fb();/**
|
|
50
|
+
* react-router v7.17.0
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/var jv="popstate";function Sv(a){return typeof a=="object"&&a!=null&&"pathname"in a&&"search"in a&&"hash"in a&&"state"in a&&"key"in a}function Pb(a={}){function i(u,d){var v;let m=(v=d.state)==null?void 0:v.masked,{pathname:h,search:x,hash:p}=m||u.location;return Od("",{pathname:h,search:x,hash:p},d.state&&d.state.usr||null,d.state&&d.state.key||"default",m?{pathname:u.location.pathname,search:u.location.search,hash:u.location.hash}:void 0)}function r(u,d){return typeof d=="string"?d:Kr(d)}return eg(i,r,null,a)}function $e(a,i){if(a===!1||a===null||typeof a>"u")throw new Error(i)}function zl(a,i){if(!a){typeof console<"u"&&console.warn(i);try{throw new Error(i)}catch{}}}function Ib(){return Math.random().toString(36).substring(2,10)}function Nv(a,i){return{usr:a.state,key:a.key,idx:i,masked:a.mask?{pathname:a.pathname,search:a.search,hash:a.hash}:void 0}}function Od(a,i,r=null,u,d){return{pathname:typeof a=="string"?a:a.pathname,search:"",hash:"",...typeof i=="string"?Li(i):i,state:r,key:i&&i.key||u||Ib(),mask:d}}function Kr({pathname:a="/",search:i="",hash:r=""}){return i&&i!=="?"&&(a+=i.charAt(0)==="?"?i:"?"+i),r&&r!=="#"&&(a+=r.charAt(0)==="#"?r:"#"+r),a}function Li(a){let i={};if(a){let r=a.indexOf("#");r>=0&&(i.hash=a.substring(r),a=a.substring(0,r));let u=a.indexOf("?");u>=0&&(i.search=a.substring(u),a=a.substring(0,u)),a&&(i.pathname=a)}return i}function eg(a,i,r,u={}){let{window:d=document.defaultView,v5Compat:m=!1}=u,h=d.history,x="POP",p=null,v=g();v==null&&(v=0,h.replaceState({...h.state,idx:v},""));function g(){return(h.state||{idx:null}).idx}function b(){x="POP";let U=g(),D=U==null?null:U-v;v=U,p&&p({action:x,location:z.location,delta:D})}function E(U,D){x="PUSH";let G=Sv(U)?U:Od(z.location,U,D);v=g()+1;let K=Nv(G,v),L=z.createHref(G.mask||G);try{h.pushState(K,"",L)}catch(V){if(V instanceof DOMException&&V.name==="DataCloneError")throw V;d.location.assign(L)}m&&p&&p({action:x,location:z.location,delta:1})}function C(U,D){x="REPLACE";let G=Sv(U)?U:Od(z.location,U,D);v=g();let K=Nv(G,v),L=z.createHref(G.mask||G);h.replaceState(K,"",L),m&&p&&p({action:x,location:z.location,delta:0})}function A(U){return tg(d,U)}let z={get action(){return x},get location(){return a(d,h)},listen(U){if(p)throw new Error("A history only accepts one active listener");return d.addEventListener(jv,b),p=U,()=>{d.removeEventListener(jv,b),p=null}},createHref(U){return i(d,U)},createURL:A,encodeLocation(U){let D=A(U);return{pathname:D.pathname,search:D.search,hash:D.hash}},push:E,replace:C,go(U){return h.go(U)}};return z}function tg(a,i,r=!1){let u="http://localhost";a&&(u=a.location.origin!=="null"?a.location.origin:a.location.href),$e(u,"No window.location.(origin|href) available to create URL");let d=typeof i=="string"?i:Kr(i);return d=d.replace(/ $/,"%20"),!r&&d.startsWith("//")&&(d=u+d),new URL(d,u)}function hx(a,i,r="/"){return lg(a,i,r,!1)}function lg(a,i,r,u,d){let m=typeof i=="string"?Li(i):i,h=la(m.pathname||"/",r);if(h==null)return null;let x=ag(a),p=null,v=pg(h);for(let g=0;p==null&&g<x.length;++g)p=mg(x[g],v,u);return p}function ag(a){let i=px(a);return ng(i),i}function px(a,i=[],r=[],u="",d=!1){let m=(h,x,p=d,v)=>{let g={relativePath:v===void 0?h.path||"":v,caseSensitive:h.caseSensitive===!0,childrenIndex:x,route:h};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(u)&&p)return;$e(g.relativePath.startsWith(u),`Absolute route path "${g.relativePath}" nested under path "${u}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(u.length)}let b=ml([u,g.relativePath]),E=r.concat(g);h.children&&h.children.length>0&&($e(h.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),px(h.children,i,E,b,p)),!(h.path==null&&!h.index)&&i.push({path:b,score:dg(b,h.index),routesMeta:E})};return a.forEach((h,x)=>{var p;if(h.path===""||!((p=h.path)!=null&&p.includes("?")))m(h,x);else for(let v of vx(h.path))m(h,x,!0,v)}),i}function vx(a){let i=a.split("/");if(i.length===0)return[];let[r,...u]=i,d=r.endsWith("?"),m=r.replace(/\?$/,"");if(u.length===0)return d?[m,""]:[m];let h=vx(u.join("/")),x=[];return x.push(...h.map(p=>p===""?m:[m,p].join("/"))),d&&x.push(...h),x.map(p=>a.startsWith("/")&&p===""?"/":p)}function ng(a){a.sort((i,r)=>i.score!==r.score?r.score-i.score:fg(i.routesMeta.map(u=>u.childrenIndex),r.routesMeta.map(u=>u.childrenIndex)))}var ig=/^:[\w-]+$/,rg=3,sg=2,og=1,ug=10,cg=-2,Mv=a=>a==="*";function dg(a,i){let r=a.split("/"),u=r.length;return r.some(Mv)&&(u+=cg),i&&(u+=sg),r.filter(d=>!Mv(d)).reduce((d,m)=>d+(ig.test(m)?rg:m===""?og:ug),u)}function fg(a,i){return a.length===i.length&&a.slice(0,-1).every((u,d)=>u===i[d])?a[a.length-1]-i[i.length-1]:0}function mg(a,i,r=!1){let{routesMeta:u}=a,d={},m="/",h=[];for(let x=0;x<u.length;++x){let p=u[x],v=x===u.length-1,g=m==="/"?i:i.slice(m.length)||"/",b=qo({path:p.relativePath,caseSensitive:p.caseSensitive,end:v},g),E=p.route;if(!b&&v&&r&&!u[u.length-1].route.index&&(b=qo({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},g)),!b)return null;Object.assign(d,b.params),h.push({params:d,pathname:ml([m,b.pathname]),pathnameBase:bg(ml([m,b.pathnameBase])),route:E}),b.pathnameBase!=="/"&&(m=ml([m,b.pathnameBase]))}return h}function qo(a,i){typeof a=="string"&&(a={path:a,caseSensitive:!1,end:!0});let[r,u]=hg(a.path,a.caseSensitive,a.end),d=i.match(r);if(!d)return null;let m=d[0],h=m.replace(/(.)\/+$/,"$1"),x=d.slice(1);return{params:u.reduce((v,{paramName:g,isOptional:b},E)=>{if(g==="*"){let A=x[E]||"";h=m.slice(0,m.length-A.length).replace(/(.)\/+$/,"$1")}const C=x[E];return b&&!C?v[g]=void 0:v[g]=(C||"").replace(/%2F/g,"/"),v},{}),pathname:m,pathnameBase:h,pattern:a}}function hg(a,i=!1,r=!0){zl(a==="*"||!a.endsWith("*")||a.endsWith("/*"),`Route path "${a}" will be treated as if it were "${a.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${a.replace(/\*$/,"/*")}".`);let u=[],d="^"+a.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(h,x,p,v,g)=>{if(u.push({paramName:x,isOptional:p!=null}),p){let b=g.charAt(v+h.length);return b&&b!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return a.endsWith("*")?(u.push({paramName:"*"}),d+=a==="*"||a==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?d+="\\/*$":a!==""&&a!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,i?void 0:"i"),u]}function pg(a){try{return a.split("/").map(i=>decodeURIComponent(i).replace(/\//g,"%2F")).join("/")}catch(i){return zl(!1,`The URL path "${a}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${i}).`),a}}function la(a,i){if(i==="/")return a;if(!a.toLowerCase().startsWith(i.toLowerCase()))return null;let r=i.endsWith("/")?i.length-1:i.length,u=a.charAt(r);return u&&u!=="/"?null:a.slice(r)||"/"}var vg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function xg(a,i="/"){let{pathname:r,search:u="",hash:d=""}=typeof a=="string"?Li(a):a,m;return r?(r=yx(r),r.startsWith("/")?m=wv(r.substring(1),"/"):m=wv(r,i)):m=i,{pathname:m,search:gg(u),hash:jg(d)}}function wv(a,i){let r=Qo(i).split("/");return a.split("/").forEach(d=>{d===".."?r.length>1&&r.pop():d!=="."&&r.push(d)}),r.length>1?r.join("/"):"/"}function Nd(a,i,r,u){return`Cannot include a '${a}' character in a manually specified \`to.${i}\` field [${JSON.stringify(u)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function yg(a){return a.filter((i,r)=>r===0||i.route.path&&i.route.path.length>0)}function xx(a){let i=yg(a);return i.map((r,u)=>u===i.length-1?r.pathname:r.pathnameBase)}function lf(a,i,r,u=!1){let d;typeof a=="string"?d=Li(a):(d={...a},$e(!d.pathname||!d.pathname.includes("?"),Nd("?","pathname","search",d)),$e(!d.pathname||!d.pathname.includes("#"),Nd("#","pathname","hash",d)),$e(!d.search||!d.search.includes("#"),Nd("#","search","hash",d)));let m=a===""||d.pathname==="",h=m?"/":d.pathname,x;if(h==null)x=r;else{let b=i.length-1;if(!u&&h.startsWith("..")){let E=h.split("/");for(;E[0]==="..";)E.shift(),b-=1;d.pathname=E.join("/")}x=b>=0?i[b]:"/"}let p=xg(d,x),v=h&&h!=="/"&&h.endsWith("/"),g=(m||h===".")&&r.endsWith("/");return!p.pathname.endsWith("/")&&(v||g)&&(p.pathname+="/"),p}var yx=a=>a.replace(/\/\/+/g,"/"),ml=a=>yx(a.join("/")),Qo=a=>a.replace(/\/+$/,""),bg=a=>Qo(a).replace(/^\/*/,"/"),gg=a=>!a||a==="?"?"":a.startsWith("?")?a:"?"+a,jg=a=>!a||a==="#"?"":a.startsWith("#")?a:"#"+a,Sg=class{constructor(a,i,r,u=!1){this.status=a,this.statusText=i||"",this.internal=u,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Ng(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.internal=="boolean"&&"data"in a}function Mg(a){let i=a.map(r=>r.route.path).filter(Boolean);return ml(i)||"/"}var bx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function gx(a,i){let r=a;if(typeof r!="string"||!vg.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let u=r,d=!1;if(bx)try{let m=new URL(window.location.href),h=r.startsWith("//")?new URL(m.protocol+r):new URL(r),x=la(h.pathname,i);h.origin===m.origin&&x!=null?r=x+h.search+h.hash:d=!0}catch{zl(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:u,isExternal:d,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var jx=["POST","PUT","PATCH","DELETE"];new Set(jx);var wg=["GET",...jx];new Set(wg);var qi=j.createContext(null);qi.displayName="DataRouter";var Zo=j.createContext(null);Zo.displayName="DataRouterState";var Sx=j.createContext(!1);function Cg(){return j.useContext(Sx)}var Nx=j.createContext({isTransitioning:!1});Nx.displayName="ViewTransition";var Tg=j.createContext(new Map);Tg.displayName="Fetchers";var Eg=j.createContext(null);Eg.displayName="Await";var sl=j.createContext(null);sl.displayName="Navigation";var ts=j.createContext(null);ts.displayName="Location";var aa=j.createContext({outlet:null,matches:[],isDataRoute:!1});aa.displayName="Route";var af=j.createContext(null);af.displayName="RouteError";var Mx="REACT_ROUTER_ERROR",Ag="REDIRECT",zg="ROUTE_ERROR_RESPONSE";function Rg(a){if(a.startsWith(`${Mx}:${Ag}:{`))try{let i=JSON.parse(a.slice(28));if(typeof i=="object"&&i&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.location=="string"&&typeof i.reloadDocument=="boolean"&&typeof i.replace=="boolean")return i}catch{}}function Og(a){if(a.startsWith(`${Mx}:${zg}:{`))try{let i=JSON.parse(a.slice(40));if(typeof i=="object"&&i&&typeof i.status=="number"&&typeof i.statusText=="string")return new Sg(i.status,i.statusText,i.data)}catch{}}function _g(a,{relative:i}={}){$e(ls(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:u}=j.useContext(sl),{hash:d,pathname:m,search:h}=as(a,{relative:i}),x=m;return r!=="/"&&(x=m==="/"?r:ml([r,m])),u.createHref({pathname:x,search:h,hash:d})}function ls(){return j.useContext(ts)!=null}function na(){return $e(ls(),"useLocation() may be used only in the context of a <Router> component."),j.useContext(ts).location}var wx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Cx(a){j.useContext(sl).static||j.useLayoutEffect(a)}function kg(){let{isDataRoute:a}=j.useContext(aa);return a?Zg():Dg()}function Dg(){$e(ls(),"useNavigate() may be used only in the context of a <Router> component.");let a=j.useContext(qi),{basename:i,navigator:r}=j.useContext(sl),{matches:u}=j.useContext(aa),{pathname:d}=na(),m=JSON.stringify(xx(u)),h=j.useRef(!1);return Cx(()=>{h.current=!0}),j.useCallback((p,v={})=>{if(zl(h.current,wx),!h.current)return;if(typeof p=="number"){r.go(p);return}let g=lf(p,JSON.parse(m),d,v.relative==="path");a==null&&i!=="/"&&(g.pathname=g.pathname==="/"?i:ml([i,g.pathname])),(v.replace?r.replace:r.push)(g,v.state,v)},[i,r,m,d,a])}j.createContext(null);function as(a,{relative:i}={}){let{matches:r}=j.useContext(aa),{pathname:u}=na(),d=JSON.stringify(xx(r));return j.useMemo(()=>lf(a,JSON.parse(d),u,i==="path"),[a,d,u,i])}function Ug(a,i){return Tx(a,i)}function Tx(a,i,r){var U;$e(ls(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:u}=j.useContext(sl),{matches:d}=j.useContext(aa),m=d[d.length-1],h=m?m.params:{},x=m?m.pathname:"/",p=m?m.pathnameBase:"/",v=m&&m.route;{let D=v&&v.path||"";Ax(x,!v||D.endsWith("*")||D.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${x}" (under <Route path="${D}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
59
|
+
|
|
60
|
+
Please change the parent <Route path="${D}"> to <Route path="${D==="/"?"*":`${D}/*`}">.`)}let g=na(),b;if(i){let D=typeof i=="string"?Li(i):i;$e(p==="/"||((U=D.pathname)==null?void 0:U.startsWith(p)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${D.pathname}" was given in the \`location\` prop.`),b=D}else b=g;let E=b.pathname||"/",C=E;if(p!=="/"){let D=p.replace(/^\//,"").split("/");C="/"+E.replace(/^\//,"").split("/").slice(D.length).join("/")}let A=r&&r.state.matches.length?r.state.matches.map(D=>Object.assign(D,{route:r.manifest[D.route.id]||D.route})):hx(a,{pathname:C});zl(v||A!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),zl(A==null||A[A.length-1].route.element!==void 0||A[A.length-1].route.Component!==void 0||A[A.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let z=Qg(A&&A.map(D=>Object.assign({},D,{params:Object.assign({},h,D.params),pathname:ml([p,u.encodeLocation?u.encodeLocation(D.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:D.pathname]),pathnameBase:D.pathnameBase==="/"?p:ml([p,u.encodeLocation?u.encodeLocation(D.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:D.pathnameBase])})),d,r);return i&&z?j.createElement(ts.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...b},navigationType:"POP"}},z):z}function Bg(){let a=Vg(),i=Ng(a)?`${a.status} ${a.statusText}`:a instanceof Error?a.message:JSON.stringify(a),r=a instanceof Error?a.stack:null,u="rgba(200,200,200, 0.5)",d={padding:"0.5rem",backgroundColor:u},m={padding:"2px 4px",backgroundColor:u},h=null;return console.error("Error handled by React Router default ErrorBoundary:",a),h=j.createElement(j.Fragment,null,j.createElement("p",null,"💿 Hey developer 👋"),j.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",j.createElement("code",{style:m},"ErrorBoundary")," or"," ",j.createElement("code",{style:m},"errorElement")," prop on your route.")),j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},i),r?j.createElement("pre",{style:d},r):null,h)}var Hg=j.createElement(Bg,null),Ex=class extends j.Component{constructor(a){super(a),this.state={location:a.location,revalidation:a.revalidation,error:a.error}}static getDerivedStateFromError(a){return{error:a}}static getDerivedStateFromProps(a,i){return i.location!==a.location||i.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:i.error,location:i.location,revalidation:a.revalidation||i.revalidation}}componentDidCatch(a,i){this.props.onError?this.props.onError(a,i):console.error("React Router caught the following error during render",a)}render(){let a=this.state.error;if(this.context&&typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){const r=Og(a.digest);r&&(a=r)}let i=a!==void 0?j.createElement(aa.Provider,{value:this.props.routeContext},j.createElement(af.Provider,{value:a,children:this.props.component})):this.props.children;return this.context?j.createElement(Lg,{error:a},i):i}};Ex.contextType=Sx;var Md=new WeakMap;function Lg({children:a,error:i}){let{basename:r}=j.useContext(sl);if(typeof i=="object"&&i&&"digest"in i&&typeof i.digest=="string"){let u=Rg(i.digest);if(u){let d=Md.get(i);if(d)throw d;let m=gx(u.location,r);if(bx&&!Md.get(i))if(m.isExternal||u.reloadDocument)window.location.href=m.absoluteURL||m.to;else{const h=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(m.to,{replace:u.replace}));throw Md.set(i,h),h}return j.createElement("meta",{httpEquiv:"refresh",content:`0;url=${m.absoluteURL||m.to}`})}}return a}function qg({routeContext:a,match:i,children:r}){let u=j.useContext(qi);return u&&u.static&&u.staticContext&&(i.route.errorElement||i.route.ErrorBoundary)&&(u.staticContext._deepestRenderedBoundaryId=i.route.id),j.createElement(aa.Provider,{value:a},r)}function Qg(a,i=[],r){let u=r==null?void 0:r.state;if(a==null){if(!u)return null;if(u.errors)a=u.matches;else if(i.length===0&&!u.initialized&&u.matches.length>0)a=u.matches;else return null}let d=a,m=u==null?void 0:u.errors;if(m!=null){let g=d.findIndex(b=>b.route.id&&(m==null?void 0:m[b.route.id])!==void 0);$e(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(m).join(",")}`),d=d.slice(0,Math.min(d.length,g+1))}let h=!1,x=-1;if(r&&u){h=u.renderFallback;for(let g=0;g<d.length;g++){let b=d[g];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(x=g),b.route.id){let{loaderData:E,errors:C}=u,A=b.route.loader&&!E.hasOwnProperty(b.route.id)&&(!C||C[b.route.id]===void 0);if(b.route.lazy||A){r.isStatic&&(h=!0),x>=0?d=d.slice(0,x+1):d=[d[0]];break}}}}let p=r==null?void 0:r.onError,v=u&&p?(g,b)=>{var E,C;p(g,{location:u.location,params:((C=(E=u.matches)==null?void 0:E[0])==null?void 0:C.params)??{},pattern:Mg(u.matches),errorInfo:b})}:void 0;return d.reduceRight((g,b,E)=>{let C,A=!1,z=null,U=null;u&&(C=m&&b.route.id?m[b.route.id]:void 0,z=b.route.errorElement||Hg,h&&(x<0&&E===0?(Ax("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),A=!0,U=null):x===E&&(A=!0,U=b.route.hydrateFallbackElement||null)));let D=i.concat(d.slice(0,E+1)),G=()=>{let K;return C?K=z:A?K=U:b.route.Component?K=j.createElement(b.route.Component,null):b.route.element?K=b.route.element:K=g,j.createElement(qg,{match:b,routeContext:{outlet:g,matches:D,isDataRoute:u!=null},children:K})};return u&&(b.route.ErrorBoundary||b.route.errorElement||E===0)?j.createElement(Ex,{location:u.location,revalidation:u.revalidation,component:z,error:C,children:G(),routeContext:{outlet:null,matches:D,isDataRoute:!0},onError:v}):G()},null)}function nf(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Yg(a){let i=j.useContext(qi);return $e(i,nf(a)),i}function Gg(a){let i=j.useContext(Zo);return $e(i,nf(a)),i}function Kg(a){let i=j.useContext(aa);return $e(i,nf(a)),i}function rf(a){let i=Kg(a),r=i.matches[i.matches.length-1];return $e(r.route.id,`${a} can only be used on routes that contain a unique "id"`),r.route.id}function Xg(){return rf("useRouteId")}function Vg(){var u;let a=j.useContext(af),i=Gg("useRouteError"),r=rf("useRouteError");return a!==void 0?a:(u=i.errors)==null?void 0:u[r]}function Zg(){let{router:a}=Yg("useNavigate"),i=rf("useNavigate"),r=j.useRef(!1);return Cx(()=>{r.current=!0}),j.useCallback(async(d,m={})=>{zl(r.current,wx),r.current&&(typeof d=="number"?await a.navigate(d):await a.navigate(d,{fromRouteId:i,...m}))},[a,i])}var Cv={};function Ax(a,i,r){!i&&!Cv[a]&&(Cv[a]=!0,zl(!1,r))}j.memo($g);function $g({routes:a,manifest:i,future:r,state:u,isStatic:d,onError:m}){return Tx(a,void 0,{manifest:i,state:u,isStatic:d,onError:m})}function Ni(a){$e(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Jg({basename:a="/",children:i=null,location:r,navigationType:u="POP",navigator:d,static:m=!1,useTransitions:h}){$e(!ls(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let x=a.replace(/^\/*/,"/"),p=j.useMemo(()=>({basename:x,navigator:d,static:m,useTransitions:h,future:{}}),[x,d,m,h]);typeof r=="string"&&(r=Li(r));let{pathname:v="/",search:g="",hash:b="",state:E=null,key:C="default",mask:A}=r,z=j.useMemo(()=>{let U=la(v,x);return U==null?null:{location:{pathname:U,search:g,hash:b,state:E,key:C,mask:A},navigationType:u}},[x,v,g,b,E,C,u,A]);return zl(z!=null,`<Router basename="${x}"> is not able to match the URL "${v}${g}${b}" because it does not start with the basename, so the <Router> won't render anything.`),z==null?null:j.createElement(sl.Provider,{value:p},j.createElement(ts.Provider,{children:i,value:z}))}function Fg({children:a,location:i}){return Ug(_d(a),i)}function _d(a,i=[]){let r=[];return j.Children.forEach(a,(u,d)=>{if(!j.isValidElement(u))return;let m=[...i,d];if(u.type===j.Fragment){r.push.apply(r,_d(u.props.children,m));return}$e(u.type===Ni,`[${typeof u.type=="string"?u.type:u.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),$e(!u.props.index||!u.props.children,"An index route cannot have child routes.");let h={id:u.props.id||m.join("-"),caseSensitive:u.props.caseSensitive,element:u.props.element,Component:u.props.Component,index:u.props.index,path:u.props.path,middleware:u.props.middleware,loader:u.props.loader,action:u.props.action,hydrateFallbackElement:u.props.hydrateFallbackElement,HydrateFallback:u.props.HydrateFallback,errorElement:u.props.errorElement,ErrorBoundary:u.props.ErrorBoundary,hasErrorBoundary:u.props.hasErrorBoundary===!0||u.props.ErrorBoundary!=null||u.props.errorElement!=null,shouldRevalidate:u.props.shouldRevalidate,handle:u.props.handle,lazy:u.props.lazy};u.props.children&&(h.children=_d(u.props.children,m)),r.push(h)}),r}var Uo="get",Bo="application/x-www-form-urlencoded";function $o(a){return typeof HTMLElement<"u"&&a instanceof HTMLElement}function Wg(a){return $o(a)&&a.tagName.toLowerCase()==="button"}function Pg(a){return $o(a)&&a.tagName.toLowerCase()==="form"}function Ig(a){return $o(a)&&a.tagName.toLowerCase()==="input"}function e1(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}function t1(a,i){return a.button===0&&(!i||i==="_self")&&!e1(a)}var zo=null;function l1(){if(zo===null)try{new FormData(document.createElement("form"),0),zo=!1}catch{zo=!0}return zo}var a1=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function wd(a){return a!=null&&!a1.has(a)?(zl(!1,`"${a}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Bo}"`),null):a}function n1(a,i){let r,u,d,m,h;if(Pg(a)){let x=a.getAttribute("action");u=x?la(x,i):null,r=a.getAttribute("method")||Uo,d=wd(a.getAttribute("enctype"))||Bo,m=new FormData(a)}else if(Wg(a)||Ig(a)&&(a.type==="submit"||a.type==="image")){let x=a.form;if(x==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=a.getAttribute("formaction")||x.getAttribute("action");if(u=p?la(p,i):null,r=a.getAttribute("formmethod")||x.getAttribute("method")||Uo,d=wd(a.getAttribute("formenctype"))||wd(x.getAttribute("enctype"))||Bo,m=new FormData(x,a),!l1()){let{name:v,type:g,value:b}=a;if(g==="image"){let E=v?`${v}.`:"";m.append(`${E}x`,"0"),m.append(`${E}y`,"0")}else v&&m.append(v,b)}}else{if($o(a))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Uo,u=null,d=Bo,h=a}return m&&d==="text/plain"&&(h=m,m=void 0),{action:u,method:r.toLowerCase(),encType:d,formData:m,body:h}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function sf(a,i){if(a===!1||a===null||typeof a>"u")throw new Error(i)}function zx(a,i,r,u){let d=typeof a=="string"?new URL(a,typeof window>"u"?"server://singlefetch/":window.location.origin):a;return r?d.pathname.endsWith("/")?d.pathname=`${d.pathname}_.${u}`:d.pathname=`${d.pathname}.${u}`:d.pathname==="/"?d.pathname=`_root.${u}`:i&&la(d.pathname,i)==="/"?d.pathname=`${Qo(i)}/_root.${u}`:d.pathname=`${Qo(d.pathname)}.${u}`,d}async function i1(a,i){if(a.id in i)return i[a.id];try{let r=await import(a.module);return i[a.id]=r,r}catch(r){return console.error(`Error loading route module \`${a.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function r1(a){return a==null?!1:a.href==null?a.rel==="preload"&&typeof a.imageSrcSet=="string"&&typeof a.imageSizes=="string":typeof a.rel=="string"&&typeof a.href=="string"}async function s1(a,i,r){let u=await Promise.all(a.map(async d=>{let m=i.routes[d.route.id];if(m){let h=await i1(m,r);return h.links?h.links():[]}return[]}));return d1(u.flat(1).filter(r1).filter(d=>d.rel==="stylesheet"||d.rel==="preload").map(d=>d.rel==="stylesheet"?{...d,rel:"prefetch",as:"style"}:{...d,rel:"prefetch"}))}function Tv(a,i,r,u,d,m){let h=(p,v)=>r[v]?p.route.id!==r[v].route.id:!0,x=(p,v)=>{var g;return r[v].pathname!==p.pathname||((g=r[v].route.path)==null?void 0:g.endsWith("*"))&&r[v].params["*"]!==p.params["*"]};return m==="assets"?i.filter((p,v)=>h(p,v)||x(p,v)):m==="data"?i.filter((p,v)=>{var b;let g=u.routes[p.route.id];if(!g||!g.hasLoader)return!1;if(h(p,v)||x(p,v))return!0;if(p.route.shouldRevalidate){let E=p.route.shouldRevalidate({currentUrl:new URL(d.pathname+d.search+d.hash,window.origin),currentParams:((b=r[0])==null?void 0:b.params)||{},nextUrl:new URL(a,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof E=="boolean")return E}return!0}):[]}function o1(a,i,{includeHydrateFallback:r}={}){return u1(a.map(u=>{let d=i.routes[u.route.id];if(!d)return[];let m=[d.module];return d.clientActionModule&&(m=m.concat(d.clientActionModule)),d.clientLoaderModule&&(m=m.concat(d.clientLoaderModule)),r&&d.hydrateFallbackModule&&(m=m.concat(d.hydrateFallbackModule)),d.imports&&(m=m.concat(d.imports)),m}).flat(1))}function u1(a){return[...new Set(a)]}function c1(a){let i={},r=Object.keys(a).sort();for(let u of r)i[u]=a[u];return i}function d1(a,i){let r=new Set;return new Set(i),a.reduce((u,d)=>{let m=JSON.stringify(c1(d));return r.has(m)||(r.add(m),u.push({key:m,link:d})),u},[])}function of(){let a=j.useContext(qi);return sf(a,"You must render this element inside a <DataRouterContext.Provider> element"),a}function f1(){let a=j.useContext(Zo);return sf(a,"You must render this element inside a <DataRouterStateContext.Provider> element"),a}var uf=j.createContext(void 0);uf.displayName="FrameworkContext";function cf(){let a=j.useContext(uf);return sf(a,"You must render this element inside a <HydratedRouter> element"),a}function m1(a,i){let r=j.useContext(uf),[u,d]=j.useState(!1),[m,h]=j.useState(!1),{onFocus:x,onBlur:p,onMouseEnter:v,onMouseLeave:g,onTouchStart:b}=i,E=j.useRef(null);j.useEffect(()=>{if(a==="render"&&h(!0),a==="viewport"){let z=D=>{D.forEach(G=>{h(G.isIntersecting)})},U=new IntersectionObserver(z,{threshold:.5});return E.current&&U.observe(E.current),()=>{U.disconnect()}}},[a]),j.useEffect(()=>{if(u){let z=setTimeout(()=>{h(!0)},100);return()=>{clearTimeout(z)}}},[u]);let C=()=>{d(!0)},A=()=>{d(!1),h(!1)};return r?a!=="intent"?[m,E,{}]:[m,E,{onFocus:Lr(x,C),onBlur:Lr(p,A),onMouseEnter:Lr(v,C),onMouseLeave:Lr(g,A),onTouchStart:Lr(b,C)}]:[!1,E,{}]}function Lr(a,i){return r=>{a&&a(r),r.defaultPrevented||i(r)}}function h1({page:a,...i}){let r=Cg(),{router:u}=of(),d=j.useMemo(()=>hx(u.routes,a,u.basename),[u.routes,a,u.basename]);return d?r?j.createElement(v1,{page:a,matches:d,...i}):j.createElement(x1,{page:a,matches:d,...i}):null}function p1(a){let{manifest:i,routeModules:r}=cf(),[u,d]=j.useState([]);return j.useEffect(()=>{let m=!1;return s1(a,i,r).then(h=>{m||d(h)}),()=>{m=!0}},[a,i,r]),u}function v1({page:a,matches:i,...r}){let u=na(),{future:d}=cf(),{basename:m}=of(),h=j.useMemo(()=>{if(a===u.pathname+u.search+u.hash)return[];let x=zx(a,m,d.v8_trailingSlashAwareDataRequests,"rsc"),p=!1,v=[];for(let g of i)typeof g.route.shouldRevalidate=="function"?p=!0:v.push(g.route.id);return p&&v.length>0&&x.searchParams.set("_routes",v.join(",")),[x.pathname+x.search]},[m,d.v8_trailingSlashAwareDataRequests,a,u,i]);return j.createElement(j.Fragment,null,h.map(x=>j.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...r})))}function x1({page:a,matches:i,...r}){let u=na(),{future:d,manifest:m,routeModules:h}=cf(),{basename:x}=of(),{loaderData:p,matches:v}=f1(),g=j.useMemo(()=>Tv(a,i,v,m,u,"data"),[a,i,v,m,u]),b=j.useMemo(()=>Tv(a,i,v,m,u,"assets"),[a,i,v,m,u]),E=j.useMemo(()=>{if(a===u.pathname+u.search+u.hash)return[];let z=new Set,U=!1;if(i.forEach(G=>{var L;let K=m.routes[G.route.id];!K||!K.hasLoader||(!g.some(V=>V.route.id===G.route.id)&&G.route.id in p&&((L=h[G.route.id])!=null&&L.shouldRevalidate)||K.hasClientLoader?U=!0:z.add(G.route.id))}),z.size===0)return[];let D=zx(a,x,d.v8_trailingSlashAwareDataRequests,"data");return U&&z.size>0&&D.searchParams.set("_routes",i.filter(G=>z.has(G.route.id)).map(G=>G.route.id).join(",")),[D.pathname+D.search]},[x,d.v8_trailingSlashAwareDataRequests,p,u,m,g,i,a,h]),C=j.useMemo(()=>o1(b,m),[b,m]),A=p1(b);return j.createElement(j.Fragment,null,E.map(z=>j.createElement("link",{key:z,rel:"prefetch",as:"fetch",href:z,...r})),C.map(z=>j.createElement("link",{key:z,rel:"modulepreload",href:z,...r})),A.map(({key:z,link:U})=>j.createElement("link",{key:z,nonce:r.nonce,...U,crossOrigin:U.crossOrigin??r.crossOrigin})))}function y1(...a){return i=>{a.forEach(r=>{typeof r=="function"?r(i):r!=null&&(r.current=i)})}}var b1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{b1&&(window.__reactRouterVersion="7.17.0")}catch{}function g1({basename:a,children:i,useTransitions:r,window:u}){let d=j.useRef();d.current==null&&(d.current=Pb({window:u,v5Compat:!0}));let m=d.current,[h,x]=j.useState({action:m.action,location:m.location}),p=j.useCallback(v=>{r===!1?x(v):j.startTransition(()=>x(v))},[r]);return j.useLayoutEffect(()=>m.listen(p),[m,p]),j.createElement(Jg,{basename:a,children:i,location:h.location,navigationType:h.action,navigator:m,useTransitions:r})}var Rx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ns=j.forwardRef(function({onClick:i,discover:r="render",prefetch:u="none",relative:d,reloadDocument:m,replace:h,mask:x,state:p,target:v,to:g,preventScrollReset:b,viewTransition:E,defaultShouldRevalidate:C,...A},z){let{basename:U,navigator:D,useTransitions:G}=j.useContext(sl),K=typeof g=="string"&&Rx.test(g),L=gx(g,U);g=L.to;let V=_g(g,{relative:d}),I=na(),J=null;if(x){let ue=lf(x,[],I.mask?I.mask.pathname:"/",!0);U!=="/"&&(ue.pathname=ue.pathname==="/"?U:ml([U,ue.pathname])),J=D.createHref(ue)}let[ee,le,oe]=m1(u,A),F=N1(g,{replace:h,mask:x,state:p,target:v,preventScrollReset:b,relative:d,viewTransition:E,defaultShouldRevalidate:C,useTransitions:G});function me(ue){i&&i(ue),ue.defaultPrevented||F(ue)}let pe=!(L.isExternal||m),Ee=j.createElement("a",{...A,...oe,href:(pe?J:void 0)||L.absoluteURL||V,onClick:pe?me:i,ref:y1(z,le),target:v,"data-discover":!K&&r==="render"?"true":void 0});return ee&&!K?j.createElement(j.Fragment,null,Ee,j.createElement(h1,{page:V})):Ee});ns.displayName="Link";var df=j.forwardRef(function({"aria-current":i="page",caseSensitive:r=!1,className:u="",end:d=!1,style:m,to:h,viewTransition:x,children:p,...v},g){let b=as(h,{relative:v.relative}),E=na(),C=j.useContext(Zo),{navigator:A,basename:z}=j.useContext(sl),U=C!=null&&E1(b)&&x===!0,D=A.encodeLocation?A.encodeLocation(b).pathname:b.pathname,G=E.pathname,K=C&&C.navigation&&C.navigation.location?C.navigation.location.pathname:null;r||(G=G.toLowerCase(),K=K?K.toLowerCase():null,D=D.toLowerCase()),K&&z&&(K=la(K,z)||K);const L=D!=="/"&&D.endsWith("/")?D.length-1:D.length;let V=G===D||!d&&G.startsWith(D)&&G.charAt(L)==="/",I=K!=null&&(K===D||!d&&K.startsWith(D)&&K.charAt(D.length)==="/"),J={isActive:V,isPending:I,isTransitioning:U},ee=V?i:void 0,le;typeof u=="function"?le=u(J):le=[u,V?"active":null,I?"pending":null,U?"transitioning":null].filter(Boolean).join(" ");let oe=typeof m=="function"?m(J):m;return j.createElement(ns,{...v,"aria-current":ee,className:le,ref:g,style:oe,to:h,viewTransition:x},typeof p=="function"?p(J):p)});df.displayName="NavLink";var j1=j.forwardRef(({discover:a="render",fetcherKey:i,navigate:r,reloadDocument:u,replace:d,state:m,method:h=Uo,action:x,onSubmit:p,relative:v,preventScrollReset:g,viewTransition:b,defaultShouldRevalidate:E,...C},A)=>{let{useTransitions:z}=j.useContext(sl),U=C1(),D=T1(x,{relative:v}),G=h.toLowerCase()==="get"?"get":"post",K=typeof x=="string"&&Rx.test(x),L=V=>{if(p&&p(V),V.defaultPrevented)return;V.preventDefault();let I=V.nativeEvent.submitter,J=(I==null?void 0:I.getAttribute("formmethod"))||h,ee=()=>U(I||V.currentTarget,{fetcherKey:i,method:J,navigate:r,replace:d,state:m,relative:v,preventScrollReset:g,viewTransition:b,defaultShouldRevalidate:E});z&&r!==!1?j.startTransition(()=>ee()):ee()};return j.createElement("form",{ref:A,method:G,action:D,onSubmit:u?p:L,...C,"data-discover":!K&&a==="render"?"true":void 0})});j1.displayName="Form";function S1(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ox(a){let i=j.useContext(qi);return $e(i,S1(a)),i}function N1(a,{target:i,replace:r,mask:u,state:d,preventScrollReset:m,relative:h,viewTransition:x,defaultShouldRevalidate:p,useTransitions:v}={}){let g=kg(),b=na(),E=as(a,{relative:h});return j.useCallback(C=>{if(t1(C,i)){C.preventDefault();let A=r!==void 0?r:Kr(b)===Kr(E),z=()=>g(a,{replace:A,mask:u,state:d,preventScrollReset:m,relative:h,viewTransition:x,defaultShouldRevalidate:p});v?j.startTransition(()=>z()):z()}},[b,g,E,r,u,d,i,a,m,h,x,p,v])}var M1=0,w1=()=>`__${String(++M1)}__`;function C1(){let{router:a}=Ox("useSubmit"),{basename:i}=j.useContext(sl),r=Xg(),u=a.fetch,d=a.navigate;return j.useCallback(async(m,h={})=>{let{action:x,method:p,encType:v,formData:g,body:b}=n1(m,i);if(h.navigate===!1){let E=h.fetcherKey||w1();await u(E,r,h.action||x,{defaultShouldRevalidate:h.defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:g,body:b,formMethod:h.method||p,formEncType:h.encType||v,flushSync:h.flushSync})}else await d(h.action||x,{defaultShouldRevalidate:h.defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:g,body:b,formMethod:h.method||p,formEncType:h.encType||v,replace:h.replace,state:h.state,fromRouteId:r,flushSync:h.flushSync,viewTransition:h.viewTransition})},[u,d,i,r])}function T1(a,{relative:i}={}){let{basename:r}=j.useContext(sl),u=j.useContext(aa);$e(u,"useFormAction must be used inside a RouteContext");let[d]=u.matches.slice(-1),m={...as(a||".",{relative:i})},h=na();if(a==null){m.search=h.search;let x=new URLSearchParams(m.search),p=x.getAll("index");if(p.some(g=>g==="")){x.delete("index"),p.filter(b=>b).forEach(b=>x.append("index",b));let g=x.toString();m.search=g?`?${g}`:""}}return(!a||a===".")&&d.route.index&&(m.search=m.search?m.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(m.pathname=m.pathname==="/"?r:ml([r,m.pathname])),Kr(m)}function E1(a,{relative:i}={}){let r=j.useContext(Nx);$e(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:u}=Ox("useViewTransitionState"),d=as(a,{relative:i});if(!r.isTransitioning)return!1;let m=la(r.currentLocation.pathname,u)||r.currentLocation.pathname,h=la(r.nextLocation.pathname,u)||r.nextLocation.pathname;return qo(d.pathname,h)!=null||qo(d.pathname,m)!=null}var Qi=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(a){return this.listeners.add(a),this.onSubscribe(),()=>{this.listeners.delete(a),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},yn,ka,wi,ax,A1=(ax=class extends Qi{constructor(){super();ce(this,yn);ce(this,ka);ce(this,wi);te(this,wi,i=>{if(typeof window<"u"&&window.addEventListener){const r=()=>i();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){N(this,ka)||this.setEventListener(N(this,wi))}onUnsubscribe(){var i;this.hasListeners()||((i=N(this,ka))==null||i.call(this),te(this,ka,void 0))}setEventListener(i){var r;te(this,wi,i),(r=N(this,ka))==null||r.call(this),te(this,ka,i(u=>{typeof u=="boolean"?this.setFocused(u):this.onFocus()}))}setFocused(i){N(this,yn)!==i&&(te(this,yn,i),this.onFocus())}onFocus(){const i=this.isFocused();this.listeners.forEach(r=>{r(i)})}isFocused(){var i;return typeof N(this,yn)=="boolean"?N(this,yn):((i=globalThis.document)==null?void 0:i.visibilityState)!=="hidden"}},yn=new WeakMap,ka=new WeakMap,wi=new WeakMap,ax),ff=new A1,z1={setTimeout:(a,i)=>setTimeout(a,i),clearTimeout:a=>clearTimeout(a),setInterval:(a,i)=>setInterval(a,i),clearInterval:a=>clearInterval(a)},Da,ef,nx,R1=(nx=class{constructor(){ce(this,Da,z1);ce(this,ef,!1)}setTimeoutProvider(a){te(this,Da,a)}setTimeout(a,i){return N(this,Da).setTimeout(a,i)}clearTimeout(a){N(this,Da).clearTimeout(a)}setInterval(a,i){return N(this,Da).setInterval(a,i)}clearInterval(a){N(this,Da).clearInterval(a)}},Da=new WeakMap,ef=new WeakMap,nx),xn=new R1;function O1(a){setTimeout(a,0)}var _1=typeof window>"u"||"Deno"in globalThis;function Et(){}function k1(a,i){return typeof a=="function"?a(i):a}function kd(a){return typeof a=="number"&&a>=0&&a!==1/0}function _x(a,i){return Math.max(a+(i||0)-Date.now(),0)}function Ga(a,i){return typeof a=="function"?a(i):a}function $t(a,i){return typeof a=="function"?a(i):a}function Ev(a,i){const{type:r="all",exact:u,fetchStatus:d,predicate:m,queryKey:h,stale:x}=a;if(h){if(u){if(i.queryHash!==mf(h,i.options))return!1}else if(!Xr(i.queryKey,h))return!1}if(r!=="all"){const p=i.isActive();if(r==="active"&&!p||r==="inactive"&&p)return!1}return!(typeof x=="boolean"&&i.isStale()!==x||d&&d!==i.state.fetchStatus||m&&!m(i))}function Av(a,i){const{exact:r,status:u,predicate:d,mutationKey:m}=a;if(m){if(!i.options.mutationKey)return!1;if(r){if(Tn(i.options.mutationKey)!==Tn(m))return!1}else if(!Xr(i.options.mutationKey,m))return!1}return!(u&&i.state.status!==u||d&&!d(i))}function mf(a,i){return((i==null?void 0:i.queryKeyHashFn)||Tn)(a)}function Tn(a){return JSON.stringify(a,(i,r)=>Dd(r)?Object.keys(r).sort().reduce((u,d)=>(u[d]=r[d],u),{}):r)}function Xr(a,i){return a===i?!0:typeof a!=typeof i?!1:a&&i&&typeof a=="object"&&typeof i=="object"?Object.keys(i).every(r=>Xr(a[r],i[r])):!1}var D1=Object.prototype.hasOwnProperty;function kx(a,i,r=0){if(a===i)return a;if(r>500)return i;const u=zv(a)&&zv(i);if(!u&&!(Dd(a)&&Dd(i)))return i;const m=(u?a:Object.keys(a)).length,h=u?i:Object.keys(i),x=h.length,p=u?new Array(x):{};let v=0;for(let g=0;g<x;g++){const b=u?g:h[g],E=a[b],C=i[b];if(E===C){p[b]=E,(u?g<m:D1.call(a,b))&&v++;continue}if(E===null||C===null||typeof E!="object"||typeof C!="object"){p[b]=C;continue}const A=kx(E,C,r+1);p[b]=A,A===E&&v++}return m===x&&v===m?a:p}function Yo(a,i){if(!i||Object.keys(a).length!==Object.keys(i).length)return!1;for(const r in a)if(a[r]!==i[r])return!1;return!0}function zv(a){return Array.isArray(a)&&a.length===Object.keys(a).length}function Dd(a){if(!Rv(a))return!1;const i=a.constructor;if(i===void 0)return!0;const r=i.prototype;return!(!Rv(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(a)!==Object.prototype)}function Rv(a){return Object.prototype.toString.call(a)==="[object Object]"}function U1(a){return new Promise(i=>{xn.setTimeout(i,a)})}function Ud(a,i,r){return typeof r.structuralSharing=="function"?r.structuralSharing(a,i):r.structuralSharing!==!1?kx(a,i):i}function B1(a,i,r=0){const u=[...a,i];return r&&u.length>r?u.slice(1):u}function H1(a,i,r=0){const u=[i,...a];return r&&u.length>r?u.slice(0,-1):u}var hf=Symbol();function Dx(a,i){return!a.queryFn&&(i!=null&&i.initialPromise)?()=>i.initialPromise:!a.queryFn||a.queryFn===hf?()=>Promise.reject(new Error(`Missing queryFn: '${a.queryHash}'`)):a.queryFn}function pf(a,i){return typeof a=="function"?a(...i):!!a}function L1(a,i,r){let u=!1,d;return Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(d??(d=i()),u||(u=!0,d.aborted?r():d.addEventListener("abort",r,{once:!0})),d)}),a}var Vr=(()=>{let a=()=>_1;return{isServer(){return a()},setIsServer(i){a=i}}})();function Bd(){let a,i;const r=new Promise((d,m)=>{a=d,i=m});r.status="pending",r.catch(()=>{});function u(d){Object.assign(r,d),delete r.resolve,delete r.reject}return r.resolve=d=>{u({status:"fulfilled",value:d}),a(d)},r.reject=d=>{u({status:"rejected",reason:d}),i(d)},r}var q1=O1;function Q1(){let a=[],i=0,r=x=>{x()},u=x=>{x()},d=q1;const m=x=>{i?a.push(x):d(()=>{r(x)})},h=()=>{const x=a;a=[],x.length&&d(()=>{u(()=>{x.forEach(p=>{r(p)})})})};return{batch:x=>{let p;i++;try{p=x()}finally{i--,i||h()}return p},batchCalls:x=>(...p)=>{m(()=>{x(...p)})},schedule:m,setNotifyFunction:x=>{r=x},setBatchNotifyFunction:x=>{u=x},setScheduler:x=>{d=x}}}var rt=Q1(),Ci,Ua,Ti,ix,Y1=(ix=class extends Qi{constructor(){super();ce(this,Ci,!0);ce(this,Ua);ce(this,Ti);te(this,Ti,i=>{if(typeof window<"u"&&window.addEventListener){const r=()=>i(!0),u=()=>i(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",u,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",u)}}})}onSubscribe(){N(this,Ua)||this.setEventListener(N(this,Ti))}onUnsubscribe(){var i;this.hasListeners()||((i=N(this,Ua))==null||i.call(this),te(this,Ua,void 0))}setEventListener(i){var r;te(this,Ti,i),(r=N(this,Ua))==null||r.call(this),te(this,Ua,i(this.setOnline.bind(this)))}setOnline(i){N(this,Ci)!==i&&(te(this,Ci,i),this.listeners.forEach(u=>{u(i)}))}isOnline(){return N(this,Ci)}},Ci=new WeakMap,Ua=new WeakMap,Ti=new WeakMap,ix),Go=new Y1;function G1(a){return Math.min(1e3*2**a,3e4)}function Ux(a){return(a??"online")==="online"?Go.isOnline():!0}var Hd=class extends Error{constructor(a){super("CancelledError"),this.revert=a==null?void 0:a.revert,this.silent=a==null?void 0:a.silent}};function Bx(a){let i=!1,r=0,u;const d=Bd(),m=()=>d.status!=="pending",h=z=>{var U;if(!m()){const D=new Hd(z);E(D),(U=a.onCancel)==null||U.call(a,D)}},x=()=>{i=!0},p=()=>{i=!1},v=()=>ff.isFocused()&&(a.networkMode==="always"||Go.isOnline())&&a.canRun(),g=()=>Ux(a.networkMode)&&a.canRun(),b=z=>{m()||(u==null||u(),d.resolve(z))},E=z=>{m()||(u==null||u(),d.reject(z))},C=()=>new Promise(z=>{var U;u=D=>{(m()||v())&&z(D)},(U=a.onPause)==null||U.call(a)}).then(()=>{var z;u=void 0,m()||(z=a.onContinue)==null||z.call(a)}),A=()=>{if(m())return;let z;const U=r===0?a.initialPromise:void 0;try{z=U??a.fn()}catch(D){z=Promise.reject(D)}Promise.resolve(z).then(b).catch(D=>{var I;if(m())return;const G=a.retry??(Vr.isServer()?0:3),K=a.retryDelay??G1,L=typeof K=="function"?K(r,D):K,V=G===!0||typeof G=="number"&&r<G||typeof G=="function"&&G(r,D);if(i||!V){E(D);return}r++,(I=a.onFail)==null||I.call(a,r,D),U1(L).then(()=>v()?void 0:C()).then(()=>{i?E(D):A()})})};return{promise:d,status:()=>d.status,cancel:h,continue:()=>(u==null||u(),d),cancelRetry:x,continueRetry:p,canStart:g,start:()=>(g()?A():C().then(A),d)}}var bn,rx,Hx=(rx=class{constructor(){ce(this,bn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),kd(this.gcTime)&&te(this,bn,xn.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(a){this.gcTime=Math.max(this.gcTime||0,a??(Vr.isServer()?1/0:300*1e3))}clearGcTimeout(){N(this,bn)!==void 0&&(xn.clearTimeout(N(this,bn)),te(this,bn,void 0))}},bn=new WeakMap,rx);function K1(a){return{onFetch:(i,r)=>{var g,b,E,C,A;const u=i.options,d=(E=(b=(g=i.fetchOptions)==null?void 0:g.meta)==null?void 0:b.fetchMore)==null?void 0:E.direction,m=((C=i.state.data)==null?void 0:C.pages)||[],h=((A=i.state.data)==null?void 0:A.pageParams)||[];let x={pages:[],pageParams:[]},p=0;const v=async()=>{let z=!1;const U=K=>{L1(K,()=>i.signal,()=>z=!0)},D=Dx(i.options,i.fetchOptions),G=async(K,L,V)=>{if(z)return Promise.reject(i.signal.reason);if(L==null&&K.pages.length)return Promise.resolve(K);const J=(()=>{const F={client:i.client,queryKey:i.queryKey,pageParam:L,direction:V?"backward":"forward",meta:i.options.meta};return U(F),F})(),ee=await D(J),{maxPages:le}=i.options,oe=V?H1:B1;return{pages:oe(K.pages,ee,le),pageParams:oe(K.pageParams,L,le)}};if(d&&m.length){const K=d==="backward",L=K?X1:Ov,V={pages:m,pageParams:h},I=L(u,V);x=await G(V,I,K)}else{const K=a??m.length;do{const L=p===0?h[0]??u.initialPageParam:Ov(u,x);if(p>0&&L==null)break;x=await G(x,L),p++}while(p<K)}return x};i.options.persister?i.fetchFn=()=>{var z,U;return(U=(z=i.options).persister)==null?void 0:U.call(z,v,{client:i.client,queryKey:i.queryKey,meta:i.options.meta,signal:i.signal},r)}:i.fetchFn=v}}}function Ov(a,{pages:i,pageParams:r}){const u=i.length-1;return i.length>0?a.getNextPageParam(i[u],i,r[u],r):void 0}function X1(a,{pages:i,pageParams:r}){var u;return i.length>0?(u=a.getPreviousPageParam)==null?void 0:u.call(a,i[0],i,r[0],r):void 0}var Ei,gn,Ai,rl,jn,dt,Fr,Sn,Zt,Lx,Fl,sx,V1=(sx=class extends Hx{constructor(i){super();ce(this,Zt);ce(this,Ei);ce(this,gn);ce(this,Ai);ce(this,rl);ce(this,jn);ce(this,dt);ce(this,Fr);ce(this,Sn);te(this,Sn,!1),te(this,Fr,i.defaultOptions),this.setOptions(i.options),this.observers=[],te(this,jn,i.client),te(this,rl,N(this,jn).getQueryCache()),this.queryKey=i.queryKey,this.queryHash=i.queryHash,te(this,gn,kv(this.options)),this.state=i.state??N(this,gn),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return N(this,Ei)}get promise(){var i;return(i=N(this,dt))==null?void 0:i.promise}setOptions(i){if(this.options={...N(this,Fr),...i},i!=null&&i._type&&te(this,Ei,i._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=kv(this.options);r.data!==void 0&&(this.setState(_v(r.data,r.dataUpdatedAt)),te(this,gn,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&N(this,rl).remove(this)}setData(i,r){const u=Ud(this.state.data,i,this.options);return ye(this,Zt,Fl).call(this,{data:u,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),u}setState(i){ye(this,Zt,Fl).call(this,{type:"setState",state:i})}cancel(i){var u,d;const r=(u=N(this,dt))==null?void 0:u.promise;return(d=N(this,dt))==null||d.cancel(i),r?r.then(Et).catch(Et):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return N(this,gn)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(i=>$t(i.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===hf||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(i=>Ga(i.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(i=>i.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(i=0){return this.state.data===void 0?!0:i==="static"?!1:this.state.isInvalidated?!0:!_x(this.state.dataUpdatedAt,i)}onFocus(){var r;const i=this.observers.find(u=>u.shouldFetchOnWindowFocus());i==null||i.refetch({cancelRefetch:!1}),(r=N(this,dt))==null||r.continue()}onOnline(){var r;const i=this.observers.find(u=>u.shouldFetchOnReconnect());i==null||i.refetch({cancelRefetch:!1}),(r=N(this,dt))==null||r.continue()}addObserver(i){this.observers.includes(i)||(this.observers.push(i),this.clearGcTimeout(),N(this,rl).notify({type:"observerAdded",query:this,observer:i}))}removeObserver(i){this.observers.includes(i)&&(this.observers=this.observers.filter(r=>r!==i),this.observers.length||(N(this,dt)&&(N(this,Sn)||ye(this,Zt,Lx).call(this)?N(this,dt).cancel({revert:!0}):N(this,dt).cancelRetry()),this.scheduleGc()),N(this,rl).notify({type:"observerRemoved",query:this,observer:i}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ye(this,Zt,Fl).call(this,{type:"invalidate"})}async fetch(i,r){var v,g,b,E,C,A,z,U,D,G,K;if(this.state.fetchStatus!=="idle"&&((v=N(this,dt))==null?void 0:v.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(N(this,dt))return N(this,dt).continueRetry(),N(this,dt).promise}if(i&&this.setOptions(i),!this.options.queryFn){const L=this.observers.find(V=>V.options.queryFn);L&&this.setOptions(L.options)}const u=new AbortController,d=L=>{Object.defineProperty(L,"signal",{enumerable:!0,get:()=>(te(this,Sn,!0),u.signal)})},m=()=>{const L=Dx(this.options,r),I=(()=>{const J={client:N(this,jn),queryKey:this.queryKey,meta:this.meta};return d(J),J})();return te(this,Sn,!1),this.options.persister?this.options.persister(L,I,this):L(I)},x=(()=>{const L={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:N(this,jn),state:this.state,fetchFn:m};return d(L),L})(),p=N(this,Ei)==="infinite"?K1(this.options.pages):this.options.behavior;p==null||p.onFetch(x,this),te(this,Ai,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((g=x.fetchOptions)==null?void 0:g.meta))&&ye(this,Zt,Fl).call(this,{type:"fetch",meta:(b=x.fetchOptions)==null?void 0:b.meta}),te(this,dt,Bx({initialPromise:r==null?void 0:r.initialPromise,fn:x.fetchFn,onCancel:L=>{L instanceof Hd&&L.revert&&this.setState({...N(this,Ai),fetchStatus:"idle"}),u.abort()},onFail:(L,V)=>{ye(this,Zt,Fl).call(this,{type:"failed",failureCount:L,error:V})},onPause:()=>{ye(this,Zt,Fl).call(this,{type:"pause"})},onContinue:()=>{ye(this,Zt,Fl).call(this,{type:"continue"})},retry:x.options.retry,retryDelay:x.options.retryDelay,networkMode:x.options.networkMode,canRun:()=>!0}));try{const L=await N(this,dt).start();if(L===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(L),(C=(E=N(this,rl).config).onSuccess)==null||C.call(E,L,this),(z=(A=N(this,rl).config).onSettled)==null||z.call(A,L,this.state.error,this),L}catch(L){if(L instanceof Hd){if(L.silent)return N(this,dt).promise;if(L.revert){if(this.state.data===void 0)throw L;return this.state.data}}throw ye(this,Zt,Fl).call(this,{type:"error",error:L}),(D=(U=N(this,rl).config).onError)==null||D.call(U,L,this),(K=(G=N(this,rl).config).onSettled)==null||K.call(G,this.state.data,L,this),L}finally{this.scheduleGc()}}},Ei=new WeakMap,gn=new WeakMap,Ai=new WeakMap,rl=new WeakMap,jn=new WeakMap,dt=new WeakMap,Fr=new WeakMap,Sn=new WeakMap,Zt=new WeakSet,Lx=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Fl=function(i){const r=u=>{switch(i.type){case"failed":return{...u,fetchFailureCount:i.failureCount,fetchFailureReason:i.error};case"pause":return{...u,fetchStatus:"paused"};case"continue":return{...u,fetchStatus:"fetching"};case"fetch":return{...u,...qx(u.data,this.options),fetchMeta:i.meta??null};case"success":const d={...u,..._v(i.data,i.dataUpdatedAt),dataUpdateCount:u.dataUpdateCount+1,...!i.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return te(this,Ai,i.manual?d:void 0),d;case"error":const m=i.error;return{...u,error:m,errorUpdateCount:u.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:u.fetchFailureCount+1,fetchFailureReason:m,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...u,isInvalidated:!0};case"setState":return{...u,...i.state}}};this.state=r(this.state),rt.batch(()=>{this.observers.forEach(u=>{u.onQueryUpdate()}),N(this,rl).notify({query:this,type:"updated",action:i})})},sx);function qx(a,i){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ux(i.networkMode)?"fetching":"paused",...a===void 0&&{error:null,status:"pending"}}}function _v(a,i){return{data:a,dataUpdatedAt:i??Date.now(),error:null,isInvalidated:!1,status:"success"}}function kv(a){const i=typeof a.initialData=="function"?a.initialData():a.initialData,r=i!==void 0,u=r?typeof a.initialDataUpdatedAt=="function"?a.initialDataUpdatedAt():a.initialDataUpdatedAt:0;return{data:i,dataUpdateCount:0,dataUpdatedAt:r?u??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Ut,Ce,Wr,Tt,Nn,zi,Wl,Ba,Pr,Ri,Oi,Mn,wn,Ha,_i,ke,Gr,Ld,qd,Qd,Yd,Gd,Kd,Xd,Qx,ox,Z1=(ox=class extends Qi{constructor(i,r){super();ce(this,ke);ce(this,Ut);ce(this,Ce);ce(this,Wr);ce(this,Tt);ce(this,Nn);ce(this,zi);ce(this,Wl);ce(this,Ba);ce(this,Pr);ce(this,Ri);ce(this,Oi);ce(this,Mn);ce(this,wn);ce(this,Ha);ce(this,_i,new Set);this.options=r,te(this,Ut,i),te(this,Ba,null),te(this,Wl,Bd()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(N(this,Ce).addObserver(this),Dv(N(this,Ce),this.options)?ye(this,ke,Gr).call(this):this.updateResult(),ye(this,ke,Yd).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Vd(N(this,Ce),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Vd(N(this,Ce),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ye(this,ke,Gd).call(this),ye(this,ke,Kd).call(this),N(this,Ce).removeObserver(this)}setOptions(i){const r=this.options,u=N(this,Ce);if(this.options=N(this,Ut).defaultQueryOptions(i),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof $t(this.options.enabled,N(this,Ce))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ye(this,ke,Xd).call(this),N(this,Ce).setOptions(this.options),r._defaulted&&!Yo(this.options,r)&&N(this,Ut).getQueryCache().notify({type:"observerOptionsUpdated",query:N(this,Ce),observer:this});const d=this.hasListeners();d&&Uv(N(this,Ce),u,this.options,r)&&ye(this,ke,Gr).call(this),this.updateResult(),d&&(N(this,Ce)!==u||$t(this.options.enabled,N(this,Ce))!==$t(r.enabled,N(this,Ce))||Ga(this.options.staleTime,N(this,Ce))!==Ga(r.staleTime,N(this,Ce)))&&ye(this,ke,Ld).call(this);const m=ye(this,ke,qd).call(this);d&&(N(this,Ce)!==u||$t(this.options.enabled,N(this,Ce))!==$t(r.enabled,N(this,Ce))||m!==N(this,Ha))&&ye(this,ke,Qd).call(this,m)}getOptimisticResult(i){const r=N(this,Ut).getQueryCache().build(N(this,Ut),i),u=this.createResult(r,i);return J1(this,u)&&(te(this,Tt,u),te(this,zi,this.options),te(this,Nn,N(this,Ce).state)),u}getCurrentResult(){return N(this,Tt)}trackResult(i,r){return new Proxy(i,{get:(u,d)=>(this.trackProp(d),r==null||r(d),d==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&N(this,Wl).status==="pending"&&N(this,Wl).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(u,d))})}trackProp(i){N(this,_i).add(i)}getCurrentQuery(){return N(this,Ce)}refetch({...i}={}){return this.fetch({...i})}fetchOptimistic(i){const r=N(this,Ut).defaultQueryOptions(i),u=N(this,Ut).getQueryCache().build(N(this,Ut),r);return u.fetch().then(()=>this.createResult(u,r))}fetch(i){return ye(this,ke,Gr).call(this,{...i,cancelRefetch:i.cancelRefetch??!0}).then(()=>(this.updateResult(),N(this,Tt)))}createResult(i,r){var le;const u=N(this,Ce),d=this.options,m=N(this,Tt),h=N(this,Nn),x=N(this,zi),v=i!==u?i.state:N(this,Wr),{state:g}=i;let b={...g},E=!1,C;if(r._optimisticResults){const oe=this.hasListeners(),F=!oe&&Dv(i,r),me=oe&&Uv(i,u,r,d);(F||me)&&(b={...b,...qx(g.data,i.options)}),r._optimisticResults==="isRestoring"&&(b.fetchStatus="idle")}let{error:A,errorUpdatedAt:z,status:U}=b;C=b.data;let D=!1;if(r.placeholderData!==void 0&&C===void 0&&U==="pending"){let oe;m!=null&&m.isPlaceholderData&&r.placeholderData===(x==null?void 0:x.placeholderData)?(oe=m.data,D=!0):oe=typeof r.placeholderData=="function"?r.placeholderData((le=N(this,Oi))==null?void 0:le.state.data,N(this,Oi)):r.placeholderData,oe!==void 0&&(U="success",C=Ud(m==null?void 0:m.data,oe,r),E=!0)}if(r.select&&C!==void 0&&!D)if(m&&C===(h==null?void 0:h.data)&&r.select===N(this,Pr))C=N(this,Ri);else try{te(this,Pr,r.select),C=r.select(C),C=Ud(m==null?void 0:m.data,C,r),te(this,Ri,C),te(this,Ba,null)}catch(oe){te(this,Ba,oe)}N(this,Ba)&&(A=N(this,Ba),C=N(this,Ri),z=Date.now(),U="error");const G=b.fetchStatus==="fetching",K=U==="pending",L=U==="error",V=K&&G,I=C!==void 0,ee={status:U,fetchStatus:b.fetchStatus,isPending:K,isSuccess:U==="success",isError:L,isInitialLoading:V,isLoading:V,data:C,dataUpdatedAt:b.dataUpdatedAt,error:A,errorUpdatedAt:z,failureCount:b.fetchFailureCount,failureReason:b.fetchFailureReason,errorUpdateCount:b.errorUpdateCount,isFetched:i.isFetched(),isFetchedAfterMount:b.dataUpdateCount>v.dataUpdateCount||b.errorUpdateCount>v.errorUpdateCount,isFetching:G,isRefetching:G&&!K,isLoadingError:L&&!I,isPaused:b.fetchStatus==="paused",isPlaceholderData:E,isRefetchError:L&&I,isStale:vf(i,r),refetch:this.refetch,promise:N(this,Wl),isEnabled:$t(r.enabled,i)!==!1};if(this.options.experimental_prefetchInRender){const oe=ee.data!==void 0,F=ee.status==="error"&&!oe,me=ue=>{F?ue.reject(ee.error):oe&&ue.resolve(ee.data)},pe=()=>{const ue=te(this,Wl,ee.promise=Bd());me(ue)},Ee=N(this,Wl);switch(Ee.status){case"pending":i.queryHash===u.queryHash&&me(Ee);break;case"fulfilled":(F||ee.data!==Ee.value)&&pe();break;case"rejected":(!F||ee.error!==Ee.reason)&&pe();break}}return ee}updateResult(){const i=N(this,Tt),r=this.createResult(N(this,Ce),this.options);if(te(this,Nn,N(this,Ce).state),te(this,zi,this.options),N(this,Nn).data!==void 0&&te(this,Oi,N(this,Ce)),Yo(r,i))return;te(this,Tt,r);const u=()=>{if(!i)return!0;const{notifyOnChangeProps:d}=this.options,m=typeof d=="function"?d():d;if(m==="all"||!m&&!N(this,_i).size)return!0;const h=new Set(m??N(this,_i));return this.options.throwOnError&&h.add("error"),Object.keys(N(this,Tt)).some(x=>{const p=x;return N(this,Tt)[p]!==i[p]&&h.has(p)})};ye(this,ke,Qx).call(this,{listeners:u()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ye(this,ke,Yd).call(this)}},Ut=new WeakMap,Ce=new WeakMap,Wr=new WeakMap,Tt=new WeakMap,Nn=new WeakMap,zi=new WeakMap,Wl=new WeakMap,Ba=new WeakMap,Pr=new WeakMap,Ri=new WeakMap,Oi=new WeakMap,Mn=new WeakMap,wn=new WeakMap,Ha=new WeakMap,_i=new WeakMap,ke=new WeakSet,Gr=function(i){ye(this,ke,Xd).call(this);let r=N(this,Ce).fetch(this.options,i);return i!=null&&i.throwOnError||(r=r.catch(Et)),r},Ld=function(){ye(this,ke,Gd).call(this);const i=Ga(this.options.staleTime,N(this,Ce));if(Vr.isServer()||N(this,Tt).isStale||!kd(i))return;const u=_x(N(this,Tt).dataUpdatedAt,i)+1;te(this,Mn,xn.setTimeout(()=>{N(this,Tt).isStale||this.updateResult()},u))},qd=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(N(this,Ce)):this.options.refetchInterval)??!1},Qd=function(i){ye(this,ke,Kd).call(this),te(this,Ha,i),!(Vr.isServer()||$t(this.options.enabled,N(this,Ce))===!1||!kd(N(this,Ha))||N(this,Ha)===0)&&te(this,wn,xn.setInterval(()=>{(this.options.refetchIntervalInBackground||ff.isFocused())&&ye(this,ke,Gr).call(this)},N(this,Ha)))},Yd=function(){ye(this,ke,Ld).call(this),ye(this,ke,Qd).call(this,ye(this,ke,qd).call(this))},Gd=function(){N(this,Mn)!==void 0&&(xn.clearTimeout(N(this,Mn)),te(this,Mn,void 0))},Kd=function(){N(this,wn)!==void 0&&(xn.clearInterval(N(this,wn)),te(this,wn,void 0))},Xd=function(){const i=N(this,Ut).getQueryCache().build(N(this,Ut),this.options);if(i===N(this,Ce))return;const r=N(this,Ce);te(this,Ce,i),te(this,Wr,i.state),this.hasListeners()&&(r==null||r.removeObserver(this),i.addObserver(this))},Qx=function(i){rt.batch(()=>{i.listeners&&this.listeners.forEach(r=>{r(N(this,Tt))}),N(this,Ut).getQueryCache().notify({query:N(this,Ce),type:"observerResultsUpdated"})})},ox);function $1(a,i){return $t(i.enabled,a)!==!1&&a.state.data===void 0&&!(a.state.status==="error"&&$t(i.retryOnMount,a)===!1)}function Dv(a,i){return $1(a,i)||a.state.data!==void 0&&Vd(a,i,i.refetchOnMount)}function Vd(a,i,r){if($t(i.enabled,a)!==!1&&Ga(i.staleTime,a)!=="static"){const u=typeof r=="function"?r(a):r;return u==="always"||u!==!1&&vf(a,i)}return!1}function Uv(a,i,r,u){return(a!==i||$t(u.enabled,a)===!1)&&(!r.suspense||a.state.status!=="error")&&vf(a,r)}function vf(a,i){return $t(i.enabled,a)!==!1&&a.isStaleByTime(Ga(i.staleTime,a))}function J1(a,i){return!Yo(a.getCurrentResult(),i)}var Ir,Tl,bt,Cn,El,_a,ux,F1=(ux=class extends Hx{constructor(i){super();ce(this,El);ce(this,Ir);ce(this,Tl);ce(this,bt);ce(this,Cn);te(this,Ir,i.client),this.mutationId=i.mutationId,te(this,bt,i.mutationCache),te(this,Tl,[]),this.state=i.state||Yx(),this.setOptions(i.options),this.scheduleGc()}setOptions(i){this.options=i,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(i){N(this,Tl).includes(i)||(N(this,Tl).push(i),this.clearGcTimeout(),N(this,bt).notify({type:"observerAdded",mutation:this,observer:i}))}removeObserver(i){te(this,Tl,N(this,Tl).filter(r=>r!==i)),this.scheduleGc(),N(this,bt).notify({type:"observerRemoved",mutation:this,observer:i})}optionalRemove(){N(this,Tl).length||(this.state.status==="pending"?this.scheduleGc():N(this,bt).remove(this))}continue(){var i;return((i=N(this,Cn))==null?void 0:i.continue())??this.execute(this.state.variables)}async execute(i){var h,x,p,v,g,b,E,C,A,z,U,D,G,K,L,V,I,J;const r=()=>{ye(this,El,_a).call(this,{type:"continue"})},u={client:N(this,Ir),meta:this.options.meta,mutationKey:this.options.mutationKey};te(this,Cn,Bx({fn:()=>this.options.mutationFn?this.options.mutationFn(i,u):Promise.reject(new Error("No mutationFn found")),onFail:(ee,le)=>{ye(this,El,_a).call(this,{type:"failed",failureCount:ee,error:le})},onPause:()=>{ye(this,El,_a).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>N(this,bt).canRun(this)}));const d=this.state.status==="pending",m=!N(this,Cn).canStart();try{if(d)r();else{ye(this,El,_a).call(this,{type:"pending",variables:i,isPaused:m}),N(this,bt).config.onMutate&&await N(this,bt).config.onMutate(i,this,u);const le=await((x=(h=this.options).onMutate)==null?void 0:x.call(h,i,u));le!==this.state.context&&ye(this,El,_a).call(this,{type:"pending",context:le,variables:i,isPaused:m})}const ee=await N(this,Cn).start();return await((v=(p=N(this,bt).config).onSuccess)==null?void 0:v.call(p,ee,i,this.state.context,this,u)),await((b=(g=this.options).onSuccess)==null?void 0:b.call(g,ee,i,this.state.context,u)),await((C=(E=N(this,bt).config).onSettled)==null?void 0:C.call(E,ee,null,this.state.variables,this.state.context,this,u)),await((z=(A=this.options).onSettled)==null?void 0:z.call(A,ee,null,i,this.state.context,u)),ye(this,El,_a).call(this,{type:"success",data:ee}),ee}catch(ee){try{await((D=(U=N(this,bt).config).onError)==null?void 0:D.call(U,ee,i,this.state.context,this,u))}catch(le){Promise.reject(le)}try{await((K=(G=this.options).onError)==null?void 0:K.call(G,ee,i,this.state.context,u))}catch(le){Promise.reject(le)}try{await((V=(L=N(this,bt).config).onSettled)==null?void 0:V.call(L,void 0,ee,this.state.variables,this.state.context,this,u))}catch(le){Promise.reject(le)}try{await((J=(I=this.options).onSettled)==null?void 0:J.call(I,void 0,ee,i,this.state.context,u))}catch(le){Promise.reject(le)}throw ye(this,El,_a).call(this,{type:"error",error:ee}),ee}finally{N(this,bt).runNext(this)}}},Ir=new WeakMap,Tl=new WeakMap,bt=new WeakMap,Cn=new WeakMap,El=new WeakSet,_a=function(i){const r=u=>{switch(i.type){case"failed":return{...u,failureCount:i.failureCount,failureReason:i.error};case"pause":return{...u,isPaused:!0};case"continue":return{...u,isPaused:!1};case"pending":return{...u,context:i.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:i.isPaused,status:"pending",variables:i.variables,submittedAt:Date.now()};case"success":return{...u,data:i.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...u,data:void 0,error:i.error,failureCount:u.failureCount+1,failureReason:i.error,isPaused:!1,status:"error"}}};this.state=r(this.state),rt.batch(()=>{N(this,Tl).forEach(u=>{u.onMutationUpdate(i)}),N(this,bt).notify({mutation:this,type:"updated",action:i})})},ux);function Yx(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Pl,dl,es,cx,W1=(cx=class extends Qi{constructor(i={}){super();ce(this,Pl);ce(this,dl);ce(this,es);this.config=i,te(this,Pl,new Set),te(this,dl,new Map),te(this,es,0)}build(i,r,u){const d=new F1({client:i,mutationCache:this,mutationId:++Ao(this,es)._,options:i.defaultMutationOptions(r),state:u});return this.add(d),d}add(i){N(this,Pl).add(i);const r=Ro(i);if(typeof r=="string"){const u=N(this,dl).get(r);u?u.push(i):N(this,dl).set(r,[i])}this.notify({type:"added",mutation:i})}remove(i){if(N(this,Pl).delete(i)){const r=Ro(i);if(typeof r=="string"){const u=N(this,dl).get(r);if(u)if(u.length>1){const d=u.indexOf(i);d!==-1&&u.splice(d,1)}else u[0]===i&&N(this,dl).delete(r)}}this.notify({type:"removed",mutation:i})}canRun(i){const r=Ro(i);if(typeof r=="string"){const u=N(this,dl).get(r),d=u==null?void 0:u.find(m=>m.state.status==="pending");return!d||d===i}else return!0}runNext(i){var u;const r=Ro(i);if(typeof r=="string"){const d=(u=N(this,dl).get(r))==null?void 0:u.find(m=>m!==i&&m.state.isPaused);return(d==null?void 0:d.continue())??Promise.resolve()}else return Promise.resolve()}clear(){rt.batch(()=>{N(this,Pl).forEach(i=>{this.notify({type:"removed",mutation:i})}),N(this,Pl).clear(),N(this,dl).clear()})}getAll(){return Array.from(N(this,Pl))}find(i){const r={exact:!0,...i};return this.getAll().find(u=>Av(r,u))}findAll(i={}){return this.getAll().filter(r=>Av(i,r))}notify(i){rt.batch(()=>{this.listeners.forEach(r=>{r(i)})})}resumePausedMutations(){const i=this.getAll().filter(r=>r.state.isPaused);return rt.batch(()=>Promise.all(i.map(r=>r.continue().catch(Et))))}},Pl=new WeakMap,dl=new WeakMap,es=new WeakMap,cx);function Ro(a){var i;return(i=a.options.scope)==null?void 0:i.id}var Il,La,Bt,ea,ta,Ho,Zd,dx,P1=(dx=class extends Qi{constructor(r,u){super();ce(this,ta);ce(this,Il);ce(this,La);ce(this,Bt);ce(this,ea);te(this,Il,r),this.setOptions(u),this.bindMethods(),ye(this,ta,Ho).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var d;const u=this.options;this.options=N(this,Il).defaultMutationOptions(r),Yo(this.options,u)||N(this,Il).getMutationCache().notify({type:"observerOptionsUpdated",mutation:N(this,Bt),observer:this}),u!=null&&u.mutationKey&&this.options.mutationKey&&Tn(u.mutationKey)!==Tn(this.options.mutationKey)?this.reset():((d=N(this,Bt))==null?void 0:d.state.status)==="pending"&&N(this,Bt).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=N(this,Bt))==null||r.removeObserver(this)}onMutationUpdate(r){ye(this,ta,Ho).call(this),ye(this,ta,Zd).call(this,r)}getCurrentResult(){return N(this,La)}reset(){var r;(r=N(this,Bt))==null||r.removeObserver(this),te(this,Bt,void 0),ye(this,ta,Ho).call(this),ye(this,ta,Zd).call(this)}mutate(r,u){var d;return te(this,ea,u),(d=N(this,Bt))==null||d.removeObserver(this),te(this,Bt,N(this,Il).getMutationCache().build(N(this,Il),this.options)),N(this,Bt).addObserver(this),N(this,Bt).execute(r)}},Il=new WeakMap,La=new WeakMap,Bt=new WeakMap,ea=new WeakMap,ta=new WeakSet,Ho=function(){var u;const r=((u=N(this,Bt))==null?void 0:u.state)??Yx();te(this,La,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},Zd=function(r){rt.batch(()=>{var u,d,m,h,x,p,v,g;if(N(this,ea)&&this.hasListeners()){const b=N(this,La).variables,E=N(this,La).context,C={client:N(this,Il),meta:this.options.meta,mutationKey:this.options.mutationKey};if((r==null?void 0:r.type)==="success"){try{(d=(u=N(this,ea)).onSuccess)==null||d.call(u,r.data,b,E,C)}catch(A){Promise.reject(A)}try{(h=(m=N(this,ea)).onSettled)==null||h.call(m,r.data,null,b,E,C)}catch(A){Promise.reject(A)}}else if((r==null?void 0:r.type)==="error"){try{(p=(x=N(this,ea)).onError)==null||p.call(x,r.error,b,E,C)}catch(A){Promise.reject(A)}try{(g=(v=N(this,ea)).onSettled)==null||g.call(v,void 0,r.error,b,E,C)}catch(A){Promise.reject(A)}}}this.listeners.forEach(b=>{b(N(this,La))})})},dx),Al,fx,I1=(fx=class extends Qi{constructor(i={}){super();ce(this,Al);this.config=i,te(this,Al,new Map)}build(i,r,u){const d=r.queryKey,m=r.queryHash??mf(d,r);let h=this.get(m);return h||(h=new V1({client:i,queryKey:d,queryHash:m,options:i.defaultQueryOptions(r),state:u,defaultOptions:i.getQueryDefaults(d)}),this.add(h)),h}add(i){N(this,Al).has(i.queryHash)||(N(this,Al).set(i.queryHash,i),this.notify({type:"added",query:i}))}remove(i){const r=N(this,Al).get(i.queryHash);r&&(i.destroy(),r===i&&N(this,Al).delete(i.queryHash),this.notify({type:"removed",query:i}))}clear(){rt.batch(()=>{this.getAll().forEach(i=>{this.remove(i)})})}get(i){return N(this,Al).get(i)}getAll(){return[...N(this,Al).values()]}find(i){const r={exact:!0,...i};return this.getAll().find(u=>Ev(r,u))}findAll(i={}){const r=this.getAll();return Object.keys(i).length>0?r.filter(u=>Ev(i,u)):r}notify(i){rt.batch(()=>{this.listeners.forEach(r=>{r(i)})})}onFocus(){rt.batch(()=>{this.getAll().forEach(i=>{i.onFocus()})})}onOnline(){rt.batch(()=>{this.getAll().forEach(i=>{i.onOnline()})})}},Al=new WeakMap,fx),We,qa,Qa,ki,Di,Ya,Ui,Bi,mx,e2=(mx=class{constructor(a={}){ce(this,We);ce(this,qa);ce(this,Qa);ce(this,ki);ce(this,Di);ce(this,Ya);ce(this,Ui);ce(this,Bi);te(this,We,a.queryCache||new I1),te(this,qa,a.mutationCache||new W1),te(this,Qa,a.defaultOptions||{}),te(this,ki,new Map),te(this,Di,new Map),te(this,Ya,0)}mount(){Ao(this,Ya)._++,N(this,Ya)===1&&(te(this,Ui,ff.subscribe(async a=>{a&&(await this.resumePausedMutations(),N(this,We).onFocus())})),te(this,Bi,Go.subscribe(async a=>{a&&(await this.resumePausedMutations(),N(this,We).onOnline())})))}unmount(){var a,i;Ao(this,Ya)._--,N(this,Ya)===0&&((a=N(this,Ui))==null||a.call(this),te(this,Ui,void 0),(i=N(this,Bi))==null||i.call(this),te(this,Bi,void 0))}isFetching(a){return N(this,We).findAll({...a,fetchStatus:"fetching"}).length}isMutating(a){return N(this,qa).findAll({...a,status:"pending"}).length}getQueryData(a){var r;const i=this.defaultQueryOptions({queryKey:a});return(r=N(this,We).get(i.queryHash))==null?void 0:r.state.data}ensureQueryData(a){const i=this.defaultQueryOptions(a),r=N(this,We).build(this,i),u=r.state.data;return u===void 0?this.fetchQuery(a):(a.revalidateIfStale&&r.isStaleByTime(Ga(i.staleTime,r))&&this.prefetchQuery(i),Promise.resolve(u))}getQueriesData(a){return N(this,We).findAll(a).map(({queryKey:i,state:r})=>{const u=r.data;return[i,u]})}setQueryData(a,i,r){const u=this.defaultQueryOptions({queryKey:a}),d=N(this,We).get(u.queryHash),m=d==null?void 0:d.state.data,h=k1(i,m);if(h!==void 0)return N(this,We).build(this,u).setData(h,{...r,manual:!0})}setQueriesData(a,i,r){return rt.batch(()=>N(this,We).findAll(a).map(({queryKey:u})=>[u,this.setQueryData(u,i,r)]))}getQueryState(a){var r;const i=this.defaultQueryOptions({queryKey:a});return(r=N(this,We).get(i.queryHash))==null?void 0:r.state}removeQueries(a){const i=N(this,We);rt.batch(()=>{i.findAll(a).forEach(r=>{i.remove(r)})})}resetQueries(a,i){const r=N(this,We);return rt.batch(()=>(r.findAll(a).forEach(u=>{u.reset()}),this.refetchQueries({type:"active",...a},i)))}cancelQueries(a,i={}){const r={revert:!0,...i},u=rt.batch(()=>N(this,We).findAll(a).map(d=>d.cancel(r)));return Promise.all(u).then(Et).catch(Et)}invalidateQueries(a,i={}){return rt.batch(()=>(N(this,We).findAll(a).forEach(r=>{r.invalidate()}),(a==null?void 0:a.refetchType)==="none"?Promise.resolve():this.refetchQueries({...a,type:(a==null?void 0:a.refetchType)??(a==null?void 0:a.type)??"active"},i)))}refetchQueries(a,i={}){const r={...i,cancelRefetch:i.cancelRefetch??!0},u=rt.batch(()=>N(this,We).findAll(a).filter(d=>!d.isDisabled()&&!d.isStatic()).map(d=>{let m=d.fetch(void 0,r);return r.throwOnError||(m=m.catch(Et)),d.state.fetchStatus==="paused"?Promise.resolve():m}));return Promise.all(u).then(Et)}fetchQuery(a){const i=this.defaultQueryOptions(a);i.retry===void 0&&(i.retry=!1);const r=N(this,We).build(this,i);return r.isStaleByTime(Ga(i.staleTime,r))?r.fetch(i):Promise.resolve(r.state.data)}prefetchQuery(a){return this.fetchQuery(a).then(Et).catch(Et)}fetchInfiniteQuery(a){return a._type="infinite",this.fetchQuery(a)}prefetchInfiniteQuery(a){return this.fetchInfiniteQuery(a).then(Et).catch(Et)}ensureInfiniteQueryData(a){return a._type="infinite",this.ensureQueryData(a)}resumePausedMutations(){return Go.isOnline()?N(this,qa).resumePausedMutations():Promise.resolve()}getQueryCache(){return N(this,We)}getMutationCache(){return N(this,qa)}getDefaultOptions(){return N(this,Qa)}setDefaultOptions(a){te(this,Qa,a)}setQueryDefaults(a,i){N(this,ki).set(Tn(a),{queryKey:a,defaultOptions:i})}getQueryDefaults(a){const i=[...N(this,ki).values()],r={};return i.forEach(u=>{Xr(a,u.queryKey)&&Object.assign(r,u.defaultOptions)}),r}setMutationDefaults(a,i){N(this,Di).set(Tn(a),{mutationKey:a,defaultOptions:i})}getMutationDefaults(a){const i=[...N(this,Di).values()],r={};return i.forEach(u=>{Xr(a,u.mutationKey)&&Object.assign(r,u.defaultOptions)}),r}defaultQueryOptions(a){if(a._defaulted)return a;const i={...N(this,Qa).queries,...this.getQueryDefaults(a.queryKey),...a,_defaulted:!0};return i.queryHash||(i.queryHash=mf(i.queryKey,i)),i.refetchOnReconnect===void 0&&(i.refetchOnReconnect=i.networkMode!=="always"),i.throwOnError===void 0&&(i.throwOnError=!!i.suspense),!i.networkMode&&i.persister&&(i.networkMode="offlineFirst"),i.queryFn===hf&&(i.enabled=!1),i}defaultMutationOptions(a){return a!=null&&a._defaulted?a:{...N(this,Qa).mutations,...(a==null?void 0:a.mutationKey)&&this.getMutationDefaults(a.mutationKey),...a,_defaulted:!0}}clear(){N(this,We).clear(),N(this,qa).clear()}},We=new WeakMap,qa=new WeakMap,Qa=new WeakMap,ki=new WeakMap,Di=new WeakMap,Ya=new WeakMap,Ui=new WeakMap,Bi=new WeakMap,mx),Gx=j.createContext(void 0),is=a=>{const i=j.useContext(Gx);if(!i)throw new Error("No QueryClient set, use QueryClientProvider to set one");return i},t2=({client:a,children:i})=>(j.useEffect(()=>(a.mount(),()=>{a.unmount()}),[a]),s.jsx(Gx.Provider,{value:a,children:i})),Kx=j.createContext(!1),l2=()=>j.useContext(Kx);Kx.Provider;function a2(){let a=!1;return{clearReset:()=>{a=!1},reset:()=>{a=!0},isReset:()=>a}}var n2=j.createContext(a2()),i2=()=>j.useContext(n2),r2=(a,i,r)=>{const u=r!=null&&r.state.error&&typeof a.throwOnError=="function"?pf(a.throwOnError,[r.state.error,r]):a.throwOnError;(a.suspense||a.experimental_prefetchInRender||u)&&(i.isReset()||(a.retryOnMount=!1))},s2=a=>{j.useEffect(()=>{a.clearReset()},[a])},o2=({result:a,errorResetBoundary:i,throwOnError:r,query:u,suspense:d})=>a.isError&&!i.isReset()&&!a.isFetching&&u&&(d&&a.data===void 0||pf(r,[a.error,u])),u2=a=>{if(a.suspense){const r=d=>d==="static"?d:Math.max(d??1e3,1e3),u=a.staleTime;a.staleTime=typeof u=="function"?(...d)=>r(u(...d)):r(u),typeof a.gcTime=="number"&&(a.gcTime=Math.max(a.gcTime,1e3))}},c2=(a,i)=>a.isLoading&&a.isFetching&&!i,d2=(a,i)=>(a==null?void 0:a.suspense)&&i.isPending,Bv=(a,i,r)=>i.fetchOptimistic(a).catch(()=>{r.clearReset()});function f2(a,i,r){var C,A,z,U;const u=l2(),d=i2(),m=is(),h=m.defaultQueryOptions(a);(A=(C=m.getDefaultOptions().queries)==null?void 0:C._experimental_beforeQuery)==null||A.call(C,h);const x=m.getQueryCache().get(h.queryHash),p=a.subscribed!==!1;h._optimisticResults=u?"isRestoring":p?"optimistic":void 0,u2(h),r2(h,d,x),s2(d);const v=!m.getQueryCache().get(h.queryHash),[g]=j.useState(()=>new i(m,h)),b=g.getOptimisticResult(h),E=!u&&p;if(j.useSyncExternalStore(j.useCallback(D=>{const G=E?g.subscribe(rt.batchCalls(D)):Et;return g.updateResult(),G},[g,E]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),j.useEffect(()=>{g.setOptions(h)},[h,g]),d2(h,b))throw Bv(h,g,d);if(o2({result:b,errorResetBoundary:d,throwOnError:h.throwOnError,query:x,suspense:h.suspense}))throw b.error;if((U=(z=m.getDefaultOptions().queries)==null?void 0:z._experimental_afterQuery)==null||U.call(z,h,b),h.experimental_prefetchInRender&&!Vr.isServer()&&c2(b,u)){const D=v?Bv(h,g,d):x==null?void 0:x.promise;D==null||D.catch(Et).finally(()=>{g.updateResult()})}return h.notifyOnChangeProps?b:g.trackResult(b)}function xl(a,i){return f2(a,Z1)}function Yi(a,i){const r=is(),[u]=j.useState(()=>new P1(r,a));j.useEffect(()=>{u.setOptions(a)},[u,a]);const d=j.useSyncExternalStore(j.useCallback(h=>u.subscribe(rt.batchCalls(h)),[u]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),m=j.useCallback((h,x)=>{u.mutate(h,x).catch(Et)},[u]);if(d.error&&pf(u.options.throwOnError,[d.error]))throw d.error;return{...d,mutate:m,mutateAsync:d.mutate}}/**
|
|
61
|
+
* @license lucide-react v1.17.0 - ISC
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the ISC license.
|
|
64
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
+
*/const Xx=(...a)=>a.filter((i,r,u)=>!!i&&i.trim()!==""&&u.indexOf(i)===r).join(" ").trim();/**
|
|
66
|
+
* @license lucide-react v1.17.0 - ISC
|
|
67
|
+
*
|
|
68
|
+
* This source code is licensed under the ISC license.
|
|
69
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
+
*/const m2=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
71
|
+
* @license lucide-react v1.17.0 - ISC
|
|
72
|
+
*
|
|
73
|
+
* This source code is licensed under the ISC license.
|
|
74
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
+
*/const h2=a=>a.replace(/^([A-Z])|[\s-_]+(\w)/g,(i,r,u)=>u?u.toUpperCase():r.toLowerCase());/**
|
|
76
|
+
* @license lucide-react v1.17.0 - ISC
|
|
77
|
+
*
|
|
78
|
+
* This source code is licensed under the ISC license.
|
|
79
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
+
*/const Hv=a=>{const i=h2(a);return i.charAt(0).toUpperCase()+i.slice(1)};/**
|
|
81
|
+
* @license lucide-react v1.17.0 - ISC
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the ISC license.
|
|
84
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
+
*/var Cd={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
86
|
+
* @license lucide-react v1.17.0 - ISC
|
|
87
|
+
*
|
|
88
|
+
* This source code is licensed under the ISC license.
|
|
89
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
+
*/const p2=a=>{for(const i in a)if(i.startsWith("aria-")||i==="role"||i==="title")return!0;return!1},v2=j.createContext({}),x2=()=>j.useContext(v2),y2=j.forwardRef(({color:a,size:i,strokeWidth:r,absoluteStrokeWidth:u,className:d="",children:m,iconNode:h,...x},p)=>{const{size:v=24,strokeWidth:g=2,absoluteStrokeWidth:b=!1,color:E="currentColor",className:C=""}=x2()??{},A=u??b?Number(r??g)*24/Number(i??v):r??g;return j.createElement("svg",{ref:p,...Cd,width:i??v??Cd.width,height:i??v??Cd.height,stroke:a??E,strokeWidth:A,className:Xx("lucide",C,d),...!m&&!p2(x)&&{"aria-hidden":"true"},...x},[...h.map(([z,U])=>j.createElement(z,U)),...Array.isArray(m)?m:[m]])});/**
|
|
91
|
+
* @license lucide-react v1.17.0 - ISC
|
|
92
|
+
*
|
|
93
|
+
* This source code is licensed under the ISC license.
|
|
94
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
+
*/const qe=(a,i)=>{const r=j.forwardRef(({className:u,...d},m)=>j.createElement(y2,{ref:m,iconNode:i,className:Xx(`lucide-${m2(Hv(a))}`,`lucide-${a}`,u),...d}));return r.displayName=Hv(a),r};/**
|
|
96
|
+
* @license lucide-react v1.17.0 - ISC
|
|
97
|
+
*
|
|
98
|
+
* This source code is licensed under the ISC license.
|
|
99
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
+
*/const b2=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Lv=qe("activity",b2);/**
|
|
101
|
+
* @license lucide-react v1.17.0 - ISC
|
|
102
|
+
*
|
|
103
|
+
* This source code is licensed under the ISC license.
|
|
104
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
+
*/const g2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Jo=qe("arrow-right",g2);/**
|
|
106
|
+
* @license lucide-react v1.17.0 - ISC
|
|
107
|
+
*
|
|
108
|
+
* This source code is licensed under the ISC license.
|
|
109
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
+
*/const j2=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],qv=qe("boxes",j2);/**
|
|
111
|
+
* @license lucide-react v1.17.0 - ISC
|
|
112
|
+
*
|
|
113
|
+
* This source code is licensed under the ISC license.
|
|
114
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
+
*/const S2=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Jt=qe("check",S2);/**
|
|
116
|
+
* @license lucide-react v1.17.0 - ISC
|
|
117
|
+
*
|
|
118
|
+
* This source code is licensed under the ISC license.
|
|
119
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
+
*/const N2=[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]],$d=qe("circle-dashed",N2);/**
|
|
121
|
+
* @license lucide-react v1.17.0 - ISC
|
|
122
|
+
*
|
|
123
|
+
* This source code is licensed under the ISC license.
|
|
124
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
+
*/const M2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]],w2=qe("clock-3",M2);/**
|
|
126
|
+
* @license lucide-react v1.17.0 - ISC
|
|
127
|
+
*
|
|
128
|
+
* This source code is licensed under the ISC license.
|
|
129
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
+
*/const C2=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],T2=qe("copy",C2);/**
|
|
131
|
+
* @license lucide-react v1.17.0 - ISC
|
|
132
|
+
*
|
|
133
|
+
* This source code is licensed under the ISC license.
|
|
134
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
+
*/const E2=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],A2=qe("cpu",E2);/**
|
|
136
|
+
* @license lucide-react v1.17.0 - ISC
|
|
137
|
+
*
|
|
138
|
+
* This source code is licensed under the ISC license.
|
|
139
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
+
*/const z2=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],Hi=qe("credit-card",z2);/**
|
|
141
|
+
* @license lucide-react v1.17.0 - ISC
|
|
142
|
+
*
|
|
143
|
+
* This source code is licensed under the ISC license.
|
|
144
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
+
*/const R2=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],O2=qe("database",R2);/**
|
|
146
|
+
* @license lucide-react v1.17.0 - ISC
|
|
147
|
+
*
|
|
148
|
+
* This source code is licensed under the ISC license.
|
|
149
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
+
*/const _2=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],Vx=qe("git-branch",_2);/**
|
|
151
|
+
* @license lucide-react v1.17.0 - ISC
|
|
152
|
+
*
|
|
153
|
+
* This source code is licensed under the ISC license.
|
|
154
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
+
*/const k2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],D2=qe("globe",k2);/**
|
|
156
|
+
* @license lucide-react v1.17.0 - ISC
|
|
157
|
+
*
|
|
158
|
+
* This source code is licensed under the ISC license.
|
|
159
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
+
*/const U2=[["path",{d:"M10 18v-7",key:"wt116b"}],["path",{d:"M11.119 2.205a2 2 0 0 1 1.762 0l7.84 3.846A.5.5 0 0 1 20.5 7h-17a.5.5 0 0 1-.22-.949z",key:"yxxwt6"}],["path",{d:"M14 18v-7",key:"vav6t3"}],["path",{d:"M18 18v-7",key:"aexdmj"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M6 18v-7",key:"1ivflk"}]],B2=qe("landmark",U2);/**
|
|
161
|
+
* @license lucide-react v1.17.0 - ISC
|
|
162
|
+
*
|
|
163
|
+
* This source code is licensed under the ISC license.
|
|
164
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
+
*/const H2=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],jt=qe("loader-circle",H2);/**
|
|
166
|
+
* @license lucide-react v1.17.0 - ISC
|
|
167
|
+
*
|
|
168
|
+
* This source code is licensed under the ISC license.
|
|
169
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
+
*/const L2=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],q2=qe("lock-keyhole",L2);/**
|
|
171
|
+
* @license lucide-react v1.17.0 - ISC
|
|
172
|
+
*
|
|
173
|
+
* This source code is licensed under the ISC license.
|
|
174
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
+
*/const Q2=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],Y2=qe("network",Q2);/**
|
|
176
|
+
* @license lucide-react v1.17.0 - ISC
|
|
177
|
+
*
|
|
178
|
+
* This source code is licensed under the ISC license.
|
|
179
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
+
*/const G2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Jd=qe("plus",G2);/**
|
|
181
|
+
* @license lucide-react v1.17.0 - ISC
|
|
182
|
+
*
|
|
183
|
+
* This source code is licensed under the ISC license.
|
|
184
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
+
*/const K2=[["path",{d:"M13 16H8",key:"wsln4y"}],["path",{d:"M14 8H8",key:"1l3xfs"}],["path",{d:"M16 12H8",key:"1fr5h0"}],["path",{d:"M4 3a1 1 0 0 1 1-1 1.3 1.3 0 0 1 .7.2l.933.6a1.3 1.3 0 0 0 1.4 0l.934-.6a1.3 1.3 0 0 1 1.4 0l.933.6a1.3 1.3 0 0 0 1.4 0l.933-.6a1.3 1.3 0 0 1 1.4 0l.934.6a1.3 1.3 0 0 0 1.4 0l.933-.6A1.3 1.3 0 0 1 19 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1 1.3 1.3 0 0 1-.7-.2l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.934.6a1.3 1.3 0 0 1-1.4 0l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-1.4 0l-.934-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-.7.2 1 1 0 0 1-1-1z",key:"ycz6yz"}]],X2=qe("receipt-text",K2);/**
|
|
186
|
+
* @license lucide-react v1.17.0 - ISC
|
|
187
|
+
*
|
|
188
|
+
* This source code is licensed under the ISC license.
|
|
189
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
+
*/const V2=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Z2=qe("refresh-cw",V2);/**
|
|
191
|
+
* @license lucide-react v1.17.0 - ISC
|
|
192
|
+
*
|
|
193
|
+
* This source code is licensed under the ISC license.
|
|
194
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
+
*/const $2=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Fo=qe("search",$2);/**
|
|
196
|
+
* @license lucide-react v1.17.0 - ISC
|
|
197
|
+
*
|
|
198
|
+
* This source code is licensed under the ISC license.
|
|
199
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
+
*/const J2=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],F2=qe("settings-2",J2);/**
|
|
201
|
+
* @license lucide-react v1.17.0 - ISC
|
|
202
|
+
*
|
|
203
|
+
* This source code is licensed under the ISC license.
|
|
204
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
+
*/const W2=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],P2=qe("shield-check",W2);/**
|
|
206
|
+
* @license lucide-react v1.17.0 - ISC
|
|
207
|
+
*
|
|
208
|
+
* This source code is licensed under the ISC license.
|
|
209
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
+
*/const I2=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],ej=qe("smartphone",I2);/**
|
|
211
|
+
* @license lucide-react v1.17.0 - ISC
|
|
212
|
+
*
|
|
213
|
+
* This source code is licensed under the ISC license.
|
|
214
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
+
*/const tj=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],Zx=qe("timer",tj);/**
|
|
216
|
+
* @license lucide-react v1.17.0 - ISC
|
|
217
|
+
*
|
|
218
|
+
* This source code is licensed under the ISC license.
|
|
219
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
+
*/const lj=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],$x=qe("trash-2",lj);/**
|
|
221
|
+
* @license lucide-react v1.17.0 - ISC
|
|
222
|
+
*
|
|
223
|
+
* This source code is licensed under the ISC license.
|
|
224
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
+
*/const aj=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],nj=qe("trending-up",aj);/**
|
|
226
|
+
* @license lucide-react v1.17.0 - ISC
|
|
227
|
+
*
|
|
228
|
+
* This source code is licensed under the ISC license.
|
|
229
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
+
*/const ij=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2",key:"4125el"}],["path",{d:"M3 11h3c.8 0 1.6.3 2.1.9l1.1.9c1.6 1.6 4.1 1.6 5.7 0l1.1-.9c.5-.5 1.3-.9 2.1-.9H21",key:"1dpki6"}]],vn=qe("wallet-cards",ij);/**
|
|
231
|
+
* @license lucide-react v1.17.0 - ISC
|
|
232
|
+
*
|
|
233
|
+
* This source code is licensed under the ISC license.
|
|
234
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
+
*/const rj=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Zr=qe("x",rj);class Jx extends Error{constructor(r,u,d){super(r);pd(this,"status");pd(this,"code");this.status=u,this.code=d}}async function yl(a){var r,u;const i=await fetch(a);if(!i.ok){const d=await i.json().catch(()=>({}));throw new Jx(((r=d.error)==null?void 0:r.message)??`${a} returned ${i.status}`,i.status,(u=d.error)==null?void 0:u.code)}return i.json()}async function Xa(a,i,r){var d,m;const u=await fetch(i,{method:a,headers:r?{"content-type":"application/json"}:void 0,body:r?JSON.stringify(r):void 0});if(!u.ok){const h=await u.json().catch(()=>({}));throw new Jx(((d=h.error)==null?void 0:d.message)??`${a} ${i} returned ${u.status}`,u.status,(m=h.error)==null?void 0:m.code)}return u.json()}function Wo(){return xl({queryKey:["ledger","inferences"],queryFn:()=>yl("/ledger/inferences"),refetchInterval:1e4})}function sj(){return xl({queryKey:["ledger","purchases"],queryFn:()=>yl("/ledger/purchases"),refetchInterval:1e4})}function Fx(){return xl({queryKey:["payments"],queryFn:()=>yl("/payments"),refetchInterval:1e4})}function Wx(){const a=is();return Yi({mutationFn:()=>Xa("POST","/payments/clawtip/activate"),onSuccess:()=>{a.invalidateQueries({queryKey:["payments"]})}})}function Px(){return Yi({mutationFn:()=>Xa("POST","/payments/clawtip/recharge")})}function Ix(){return xl({queryKey:["routing","strategy"],queryFn:()=>yl("/routing/strategy")})}function e0(){const a=is();return Yi({mutationFn:i=>Xa("PUT","/routing/strategy",i),onSuccess:()=>{a.invalidateQueries({queryKey:["routing","strategy"]})}})}function oj(a){const i=new URLSearchParams;for(const[r,u]of Object.entries(a))u!=null&&u!==""&&i.set(r,uj(u));return xl({queryKey:["routing","preview",i.toString()],queryFn:()=>yl(`/routing/preview?${i.toString()}`),enabled:!1})}function uj(a){return Array.isArray(a)?a.join(","):typeof a=="object"&&a!==null?Object.entries(a).map(([i,r])=>`${i}:${r}`).join(","):String(a)}function t0(){return xl({queryKey:["sellers"],queryFn:()=>yl("/sellers"),refetchInterval:3e4})}function xf(){return xl({queryKey:["models"],queryFn:()=>yl("/models"),refetchInterval:3e4})}function cj(){return xl({queryKey:["prewarm","focus-set"],queryFn:()=>yl("/v1.2/prewarm").then(a=>({ok:!0,focusSet:a.focusSet??[],source:"historical"}))})}async function Lo(a){const i=Array.isArray(a)?{models:a}:a;return Xa("PUT","/prewarm/focus-set",i)}function l0(){return xl({queryKey:["status"],queryFn:()=>yl("/status"),refetchInterval:5e3})}function St({children:a,className:i=""}){return s.jsx("div",{className:["rounded-[var(--radius-xl)] border border-[var(--color-line-2)] bg-white shadow-[var(--shadow-panel)]",i].join(" "),children:a})}function rs({tone:a="lavender",children:i}){const r={lavender:"bg-[var(--color-lavender)] text-[var(--color-primary)]",green:"bg-[var(--color-success-soft)] text-[var(--color-success)]",amber:"bg-[var(--color-warning-soft)] text-[var(--color-warning)]",red:"bg-[var(--color-danger-soft)] text-[var(--color-danger)]",blue:"bg-[var(--color-tokens-soft)] text-[var(--color-tokens)]",gray:"bg-slate-100 text-slate-600"};return s.jsxs("span",{className:["inline-flex items-center gap-1.5 text-[0.78rem] font-medium px-2.5 py-0.5 rounded-[var(--radius-pill)]",r[a]??r.lavender].join(" "),children:[s.jsx("span",{className:"size-1.5 rounded-full bg-current"}),i]})}const Te="—",Ht=a=>a<10?`0${a}`:`${a}`;function pl(a,i={}){if(!Number.isFinite(a))return Te;const r=a;return i.compact===!1||r<1e4?Math.round(r).toLocaleString("en-US"):r<1e6?`${(r/1e3).toFixed(1)}K`:r<1e9?`${(r/1e6).toFixed(1)}M`:`${(r/1e9).toFixed(2)}B`}function $r(a,i,r={}){const u=r.separator??" / ";return`In ${pl(a,r)}${u}Out ${pl(i,r)}`}function dj(a,i){return!Number.isFinite(a)&&!Number.isFinite(i)?Te:`Input ${Ke(a)} / Output ${Ke(i)}`}function Ke(a){return Number.isFinite(a)?Math.round(a).toLocaleString("en-US"):Te}function st(a,i={}){if(!Number.isFinite(a))return Te;const r=Math.abs(a/1e6),u=i.digits??(i.ledger&&r<.01?6:4),d=`$${(a/1e6).toFixed(u)}`;return i.signed&&a>=0?`+${d}`:d}function fj(a,i,r={}){return!Number.isFinite(a)&&!Number.isFinite(i)?Te:`${st(a,r)} / ${st(i,r)}`}function xt(a){if(!Number.isFinite(a))return Te;const i=Math.max(0,Math.round(a));return i<1e3?`${i}ms`:`${(i/1e3).toFixed(2)}s`}function yf(a){return Number.isFinite(a)?`${Math.round(a*100)}%`:Te}function a0(a){if(!Number.isFinite(a))return Te;const i=Math.max(0,1-a);return yf(i)}function n0(a,i){return fj(a,i,{digits:4})}function Rl(a){return a?a.trim().toLowerCase().replaceAll("_"," "):Te}function Ka(a){const i=Rl(a);return i==="ok"||i==="online"||i==="configured"||i==="settled"||i==="completed"||i==="success"||i==="active"||i==="healthy"?"green":i==="fallback"||i==="pending"||i==="degraded"||i==="preview"?"amber":i==="failed"||i==="error"||i==="canceled"||i==="unhealthy"||i==="offline"?"red":i==="running"?"blue":"gray"}function Jr(a,i=32){return a?a.length>i?`${a.slice(0,i)}...`:a:Te}function mj(a){return a?a.startsWith("tbs-")&&a.length>10?a.slice(0,10):a.length<=12?a:a.slice(0,12):Te}function i0(a){if(!a)return Te;const i=new Date(a);if(Number.isNaN(i.getTime()))return Te;const r=new Date,u=i.getFullYear()===r.getFullYear()&&i.getMonth()===r.getMonth()&&i.getDate()===r.getDate(),d=`${Ht(i.getHours())}:${Ht(i.getMinutes())}`;return u?d:`${Ht(i.getMonth()+1)}/${Ht(i.getDate())} ${d}`}function vl(a){if(!a)return Te;const i=new Date(a);return Number.isNaN(i.getTime())?Te:`${i.getFullYear()}-${Ht(i.getMonth()+1)}-${Ht(i.getDate())} ${Ht(i.getHours())}:${Ht(i.getMinutes())}:${Ht(i.getSeconds())}`}function r0(a){if(!a)return Te;const i=new Date(a);return Number.isNaN(i.getTime())?Te:`${i.getFullYear()}/${Ht(i.getMonth()+1)}/${Ht(i.getDate())} ${Ht(i.getHours())}:${Ht(i.getMinutes())}:${Ht(i.getSeconds())}`}function hj(a){return i0(a)}function s0({inferences:a,modelsResponse:i,sellersResponse:r,previewPlan:u,activeModelId:d}){const m=xj(i,r),h=[...a].sort(jj),x=new Map,p=new Map;let v=0,g=0,b=0;for(const C of h){const A=C.modelId||Te,z=C.sellerKey||Te,U=fl(C.promptTokens)??0,D=fl(C.completionTokens)??0,G=U+D,K=fl(C.billedMicros)??0;v+=1,g+=G,b+=K;const L=x.get(A)??yj(A);L.entries.push(C),L.requestCount+=1,L.inputTokens+=U,L.outputTokens+=D,L.totalSpendMicros+=K,L.touchedSellers.add(z),L.sellerCounts.set(z,(L.sellerCounts.get(z)??0)+1),L.fallbackCount+=fl(C.fallbackCount)??0;const V=fl(C.ttftMs);V!==void 0&&(L.ttftTotal+=V,L.ttftCount+=1);const I=fl(C.durationMs);I!==void 0&&(L.durationTotal+=I,L.durationCount+=1),x.set(A,L);const J=p.get(z)??{requestCount:0,totalTokens:0};J.requestCount+=1,J.totalTokens+=G,p.set(z,J)}const E=Array.from(x.values()).map(C=>pj(C,p,m)).sort(Sj);if(E.length===0){const C=vj(d,u,m);C&&E.push(C)}return{rows:E,totalRequests:v,totalTokens:g,totalSpendMicros:b}}function pj(a,i,r){const u=a.entries[a.entries.length-1],d=(u==null?void 0:u.sellerKey)||Te,m=o0(d,r),h=a.sellerCounts.get(d)??0,x=i.get(d),p=r.modelsBySellerAndModel.get(`${d}\0${a.modelId}`);return{source:"ledger",modelId:a.modelId,currentSellerId:d,currentSellerName:m.name,currentSellerUrl:m.url,currentSellerStatus:m.status,currentSellerPaymentMethods:m.paymentMethods,sellerDiscount:m.discount,sellerServiceFee:m.serviceFee,sellerModelCount:m.modelCount,requestCount:a.requestCount,currentSellerModelRequests:h,currentSellerRequests:(x==null?void 0:x.requestCount)??h,inputTokens:a.inputTokens,outputTokens:a.outputTokens,totalTokens:a.inputTokens+a.outputTokens,currentSellerTokens:(x==null?void 0:x.totalTokens)??0,totalSpendMicros:a.totalSpendMicros,avgTtftMs:Qv(a.ttftTotal,a.ttftCount),avgDurationMs:Qv(a.durationTotal,a.durationCount),lastTtftMs:fl(u==null?void 0:u.ttftMs),lastDurationMs:fl(u==null?void 0:u.durationMs),selectedAt:bj(a.entries,d),lastSellerSwitchAt:gj(a.entries),lastAccessAt:u==null?void 0:u.createdAt,lastRequestId:u==null?void 0:u.requestId,lastStatus:u==null?void 0:u.status,routeReason:u==null?void 0:u.routeReason,upstreamStatus:u==null?void 0:u.upstreamStatus,fallbackCount:a.fallbackCount,falloverChain:(u==null?void 0:u.falloverChain)??[],touchedSellerCount:a.touchedSellers.size,inputPriceMicrosPer1m:p==null?void 0:p.inputPriceMicrosPer1m,outputPriceMicrosPer1m:p==null?void 0:p.outputPriceMicrosPer1m}}function vj(a,i,r){var p,v,g;const u=(p=i==null?void 0:i.routes)==null?void 0:p[0];if(!u||!a)return;const d=o0(u.seller.id,r,u),m=fl(u.metrics.ttftMs)??fl(u.metrics.avgLatencyMs),h=fl(u.metrics.avgInferenceMs),x=r.modelsBySellerAndModel.get(`${u.seller.id}\0${a}`);return{source:"preview",modelId:a,currentSellerId:u.seller.id,currentSellerName:d.name,currentSellerUrl:d.url,currentSellerStatus:d.status,currentSellerPaymentMethods:d.paymentMethods,sellerDiscount:d.discount,sellerServiceFee:d.serviceFee,sellerModelCount:d.modelCount,requestCount:0,currentSellerModelRequests:0,currentSellerRequests:0,inputTokens:0,outputTokens:0,totalTokens:0,currentSellerTokens:0,totalSpendMicros:0,avgTtftMs:m,avgDurationMs:h,lastTtftMs:m,lastDurationMs:h,routeReason:i.reason??i.sourceReason??"Preview route",fallbackCount:0,falloverChain:((v=i.routes)==null?void 0:v.map(b=>b.seller.id))??[],touchedSellerCount:((g=i.routes)==null?void 0:g.length)??1,inputPriceMicrosPer1m:x==null?void 0:x.inputPriceMicrosPer1m,outputPriceMicrosPer1m:x==null?void 0:x.outputPriceMicrosPer1m}}function xj(a,i){const r=new Map;for(const u of(a==null?void 0:a.data)??[]){const d=r.get(u.sellerId)??new Set;d.add(u.id),r.set(u.sellerId,d)}return{registryById:new Map(((i==null?void 0:i.sellers)??[]).map(u=>[u.id,u])),catalogById:new Map(((a==null?void 0:a.sellers)??[]).map(u=>[u.id,u])),modelsBySellerAndModel:new Map(((a==null?void 0:a.data)??[]).map(u=>[`${u.sellerId}\0${u.id}`,u])),modelCountsBySellerId:new Map(Array.from(r.entries()).map(([u,d])=>[u,d.size]))}}function yj(a){return{modelId:a,entries:[],sellerCounts:new Map,touchedSellers:new Set,requestCount:0,inputTokens:0,outputTokens:0,totalSpendMicros:0,ttftTotal:0,ttftCount:0,durationTotal:0,durationCount:0,fallbackCount:0}}function bj(a,i){var r;for(let u=a.length-1;u>=0;u-=1){const d=a[u];if(d.sellerKey!==i)return(r=a[u+1])==null?void 0:r.createdAt;if(u===0)return d.createdAt}}function gj(a){let i;for(let r=1;r<a.length;r+=1)a[r].sellerKey!==a[r-1].sellerKey&&(i=a[r].createdAt);return i}function o0(a,i,r){const u=i.catalogById.get(a),d=i.registryById.get(a),m=(r==null?void 0:r.metrics.discountRatio)??(u==null?void 0:u.discountRatio);return{name:Nj((r==null?void 0:r.seller.name)??(u==null?void 0:u.name)??(d==null?void 0:d.name)??a),url:(r==null?void 0:r.seller.url)??(u==null?void 0:u.url)??(d==null?void 0:d.url),status:(u==null?void 0:u.status)??(d==null?void 0:d.status)??Te,paymentMethods:(u==null?void 0:u.paymentMethods)??(d==null?void 0:d.paymentMethods)??(r==null?void 0:r.seller.paymentMethods)??[],discount:a0(m),serviceFee:yf(u==null?void 0:u.serviceFeeRatio),modelCount:(u==null?void 0:u.modelCount)??i.modelCountsBySellerId.get(a)}}function jj(a,i){return Ko(a.createdAt)-Ko(i.createdAt)}function Sj(a,i){return Ko(i.lastAccessAt)-Ko(a.lastAccessAt)}function Ko(a){if(!a)return 0;const i=new Date(a).getTime();return Number.isNaN(i)?0:i}function Qv(a,i){return i>0?a/i:void 0}function fl(a){return Number.isFinite(a)?a:void 0}function Nj(a){var i;return((i=a.split("(")[0])==null?void 0:i.trim())||a}function Yv(){var oe,F,me,pe,Ee,ue,B,$,re,be,ge,M,_,Z,P,X,ae;const[a,i]=j.useState(null),r=l0(),u=Ix(),d=Fx(),m=Wx(),h=Px(),x=d.refetch,p=m.reset,v=Wo(),g=t0(),b=xf(),E=((oe=v.data)==null?void 0:oe.inferences)??[],C=((F=d.data)==null?void 0:F.payments)??[],A=new Set((((me=b.data)==null?void 0:me.data)??[]).map(W=>W.id)).size,z=((pe=g.data)==null?void 0:pe.sellers.length)??((ue=(Ee=b.data)==null?void 0:Ee.sellers)==null?void 0:ue.length)??0,U=j.useMemo(()=>Dj(E),[E]),D=j.useMemo(()=>Uj(C,E),[E,C]),G=j.useMemo(()=>s0({inferences:E,modelsResponse:b.data,sellersResponse:g.data}),[E,b.data,g.data]),L=C.some(W=>hl(W.method)==="clawtip"&&(W.enabled||d0(W.config,"walletConfigPresent")))||((B=m.data)==null?void 0:B.walletConfigPresent)===!0,V=(($=r.data)==null?void 0:$.status)==="running"&&!r.isError,I=new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),J=((re=u.data)==null?void 0:re.strategy.mode)??((be=r.data)==null?void 0:be.sellerRoutingMode)??Te,ee=((ge=u.data)==null?void 0:ge.strategy.scorer)??((M=r.data)==null?void 0:M.sellerRoutingScorer)??Te,le=()=>{i(null),m.reset(),h.reset()};return j.useEffect(()=>{if((a==null?void 0:a.kind)!=="activate"||hl(a.method)!=="clawtip"||L)return;const W=window.setInterval(()=>{x()},1500);return()=>window.clearInterval(W)},[L,a==null?void 0:a.kind,a==null?void 0:a.method,x]),j.useEffect(()=>{(a==null?void 0:a.kind)==="activate"&&hl(a.method)==="clawtip"&&L&&(i(null),p())},[L,a==null?void 0:a.kind,a==null?void 0:a.method,p]),s.jsxs("div",{className:"min-w-0 overflow-x-hidden space-y-3",children:[s.jsxs("section",{className:"grid grid-cols-2 gap-2.5 md:grid-cols-3 xl:grid-cols-6",children:[s.jsx(gi,{to:"/routing",icon:s.jsx(Vx,{className:"size-4"}),label:"Router",value:J,note:`${ee} scorer`,tone:"router"}),s.jsx(gi,{to:"/ledger",icon:s.jsx(Lv,{className:"size-4"}),label:"Today requests",value:Ke(U.todayRequestCount),note:`${Ke(U.totalRequestCount)} total`,tone:"requests"}),s.jsx(gi,{to:"/ledger",icon:s.jsx(Hi,{className:"size-4"}),label:"Spend today",value:st(U.todaySpendMicros,{digits:4}),note:`${st(U.totalSpendMicros,{digits:4})} total`,tone:"spend"}),s.jsx(gi,{to:"/ledger",icon:s.jsx(qv,{className:"size-4"}),label:"Today tokens",value:pl(U.todayInputTokens+U.todayOutputTokens),note:$r(U.todayInputTokens,U.todayOutputTokens),tone:"tokens"}),s.jsx(gi,{to:"/ledger",icon:s.jsx(Lv,{className:"size-4"}),label:"Total tokens",value:pl(U.inputTokens+U.outputTokens),note:$r(U.inputTokens,U.outputTokens),tone:"tokens"}),s.jsx(gi,{to:"/routing",icon:s.jsx(qv,{className:"size-4"}),label:"Models / Sellers",value:`${A}`,note:`${z} sellers`,tone:"inventory"})]}),s.jsx("section",{className:"grid min-w-0 gap-3",children:s.jsxs("div",{className:"min-w-0 space-y-3",children:[s.jsx(Mj,{rows:G.rows,totalRequests:G.totalRequests,totalTokens:G.totalTokens}),s.jsxs(St,{className:"p-3.5",children:[s.jsx("div",{className:"flex items-start justify-between gap-4",children:s.jsx("div",{children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("h2",{className:"text-[1rem] font-semibold text-[var(--color-ink)]",children:"Payment management"}),s.jsx(rs,{tone:C.some(W=>W.enabled)?"green":"amber",children:C.some(W=>W.enabled)?"configured":"not configured"})]})})}),s.jsx("div",{className:"mt-2 min-w-0 overflow-hidden rounded-[10px] border border-[var(--color-line-2)] bg-white",children:D.map(W=>s.jsx(Cj,{...W,onActivate:()=>{i({kind:"activate",method:W.method}),W.method==="clawtip"&&m.mutate()},onRecharge:()=>{i({kind:"recharge",method:W.method}),W.method==="clawtip"&&h.mutate()}},W.method))})]}),s.jsxs(St,{className:"p-3",children:[s.jsxs("div",{className:"mb-2 flex min-w-0 flex-col gap-2",children:[s.jsx("div",{className:"flex min-w-0 flex-wrap items-center justify-between gap-2",children:s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx(nj,{className:"size-4 shrink-0 text-[var(--color-purple)]"}),s.jsx("h2",{className:"truncate text-[1rem] font-semibold text-[var(--color-ink)]",children:"TokenUsage"})]})}),s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2.5 gap-y-1 text-[0.7rem] text-[var(--color-muted)]",children:[U.modelUsage.map(W=>s.jsx(Oj,{model:W.model,color:W.color},W.model)),s.jsx(Gv,{label:"in"}),s.jsx(Gv,{label:"out",dashed:!0})]})]}),s.jsxs("div",{className:"grid min-w-0 gap-3 sm:grid-cols-[minmax(0,1fr)_190px]",children:[s.jsx(Aj,{days:U.days,series:U.modelUsage}),s.jsxs("div",{className:"grid gap-3",children:[s.jsx(zj,{days:U.days,values:U.cost,total:st(U.weeklySpendMicros)}),s.jsx(Rj,{values:U.thirtyDaySpend,total:st(U.totalSpendMicros)})]})]})]})]})}),s.jsx(_j,{checkedAt:I,healthy:V,pid:(_=r.data)==null?void 0:_.pid,status:(Z=r.data)==null?void 0:Z.status,proxyPort:(P=r.data)==null?void 0:P.proxyPort,controlPort:(X=r.data)==null?void 0:X.controlPort,registryUrl:(ae=r.data)==null?void 0:ae.sellerRegistryUrl}),a?s.jsx(Ej,{modal:a,methods:D,qr:a.kind==="activate"?m.data:h.data,loading:a.kind==="activate"?m.isPending:h.isPending,error:a.kind==="activate"?m.error:h.error,onClose:le}):null]})}function Mj({rows:a,totalRequests:i,totalTokens:r}){var d;const u=a.slice(0,3);return s.jsxs(St,{className:"overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-[var(--color-line-2)] px-3.5 py-3",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx(Vx,{className:"size-4 shrink-0 text-[var(--color-purple)]"}),s.jsx("h2",{className:"truncate text-[1rem] font-semibold text-[var(--color-ink)]",children:"Recent model routes"})]}),s.jsx(ns,{to:"/routing",className:"shrink-0 rounded-[8px] border border-[var(--color-lavender-2)] bg-[var(--color-lavender)] px-2.5 py-1.5 text-[0.72rem] font-semibold text-[var(--color-purple)] transition hover:bg-white",children:"Details"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-2 border-b border-[var(--color-line-2)] bg-[var(--color-page)]/55 px-3.5 py-2 sm:grid-cols-4",children:[s.jsx(Oo,{label:"Req",value:Ke(i)}),s.jsx(Oo,{label:"Token",value:pl(r)}),s.jsx(Oo,{label:"Models",value:Ke(a.length)}),s.jsx(Oo,{label:"Latest",value:i0((d=a[0])==null?void 0:d.lastAccessAt)})]}),u.length>0?s.jsx("div",{className:"divide-y divide-[var(--color-line-2)]",children:u.map(m=>s.jsx(wj,{row:m},`${m.modelId}-${m.currentSellerId}`))}):s.jsx("div",{className:"px-3.5 py-7 text-center text-[0.82rem] text-[var(--color-muted)]",children:"No model traffic yet."})]})}function Oo({label:a,value:i}){return s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-[0.65rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:a}),s.jsx("div",{className:"mt-0.5 truncate font-mono text-[0.88rem] font-semibold text-[var(--color-ink)]",children:i})]})}function wj({row:a}){const i=a.lastSellerSwitchAt??a.selectedAt;return s.jsxs("div",{className:"grid min-w-0 gap-3 px-3.5 py-3 lg:grid-cols-[minmax(0,1.05fr)_minmax(0,2fr)] lg:items-center",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"truncate font-mono text-[0.84rem] font-semibold text-[var(--color-ink)]",title:a.modelId,children:a.modelId}),s.jsxs("div",{className:"mt-0.5 flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-[0.72rem] text-[var(--color-muted)]",children:[s.jsx("span",{className:"truncate",children:a.currentSellerName}),s.jsx("span",{className:"font-mono",children:a.currentSellerStatus})]})]}),s.jsxs("div",{className:"grid min-w-0 grid-cols-2 gap-1.5 sm:grid-cols-3 lg:grid-cols-6",children:[s.jsx(bi,{label:"In",value:pl(a.inputTokens),tone:"tokens",title:`Input tokens: ${Ke(a.inputTokens)}`}),s.jsx(bi,{label:"Out",value:pl(a.outputTokens),tone:"success",title:`Output tokens: ${Ke(a.outputTokens)}`}),s.jsx(bi,{label:"TTFT",value:xt(a.lastTtftMs??a.avgTtftMs),tone:"router",title:`Time to first token: ${xt(a.lastTtftMs??a.avgTtftMs)}`}),s.jsx(bi,{label:"Total",value:xt(a.lastDurationMs??a.avgDurationMs),tone:"slate",title:`Total inference duration: ${xt(a.lastDurationMs??a.avgDurationMs)}`}),s.jsx(bi,{label:"Disc",value:a.sellerDiscount,tone:"success",title:`Seller discount: ${a.sellerDiscount}`}),s.jsx(bi,{label:"Switch",value:hj(i),tone:"slate",title:`Last seller switch: ${vl(i)}`})]})]})}function bi({label:a,value:i,tone:r,title:u}){const d={router:"bg-[var(--color-lavender)] text-[var(--color-router)]",success:"bg-[var(--color-success-soft)] text-[var(--color-success)]",warning:"bg-[var(--color-warning-soft)] text-[var(--color-warning)]",tokens:"bg-[var(--color-tokens-soft)] text-[var(--color-tokens)]",slate:"bg-slate-50 text-slate-700"}[r];return s.jsxs("div",{className:["min-w-0 rounded-[var(--radius-md)] px-2 py-1",d].join(" "),title:u??`${a}: ${i}`,children:[s.jsx("div",{className:"text-[0.58rem] font-semibold uppercase tracking-wider opacity-70",children:a}),s.jsx("div",{className:"truncate font-mono text-[0.76rem] font-semibold",children:i})]})}function gi({to:a,icon:i,label:r,value:u,note:d,tone:m}){const h={router:{card:"border border-[var(--color-hairline-strong)] bg-white shadow-[var(--shadow-panel-strong)] hover:border-[var(--color-primary)] before:bg-[var(--color-router)]",icon:"bg-[var(--color-lavender)] text-[var(--color-router)]",label:"text-[var(--color-router)]",value:"text-[var(--color-ink)]",note:"text-[var(--color-muted)]"},requests:{card:"border border-[var(--color-hairline)] bg-white shadow-[var(--shadow-panel)] hover:border-[var(--color-success)] before:bg-[var(--color-success)]",icon:"bg-[var(--color-success-soft)] text-[var(--color-success)]",label:"text-[var(--color-success)]",value:"text-[var(--color-ink)]",note:"text-[var(--color-muted)]"},spend:{card:"border border-[var(--color-spend-border)] bg-[var(--color-spend-soft)] shadow-[var(--shadow-panel)] hover:border-[var(--color-spend)] before:bg-[var(--color-spend)]",icon:"bg-white text-[var(--color-spend)]",label:"text-[var(--color-spend)]",value:"text-[var(--color-ink)]",note:"text-[var(--color-spend)]"},tokens:{card:"border border-[var(--color-tokens-border)] bg-[var(--color-tokens-soft)] shadow-[var(--shadow-panel)] hover:border-[var(--color-tokens)] before:bg-[var(--color-tokens)]",icon:"bg-white text-[var(--color-tokens)]",label:"text-[var(--color-tokens)]",value:"text-[var(--color-ink)]",note:"text-[var(--color-tokens)]"},inventory:{card:"border border-[var(--color-inventory-border)] bg-[var(--color-inventory-soft)] shadow-[var(--shadow-panel)] hover:border-[var(--color-inventory)] before:bg-[var(--color-inventory)]",icon:"bg-white text-[var(--color-inventory)]",label:"text-[var(--color-inventory)]",value:"text-[var(--color-ink)]",note:"text-[var(--color-inventory)]"}}[m];return s.jsxs(ns,{to:a,"aria-label":`Open ${r}`,className:["relative block min-h-[94px] overflow-hidden rounded-[var(--radius-xl)] p-3 transition before:absolute before:inset-y-0 before:left-0 before:w-1 hover:-translate-y-0.5 focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)]",h.card].join(" "),children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:`grid size-7 place-items-center rounded-[var(--radius-md)] ${h.icon}`,children:i}),s.jsx("span",{className:["text-right text-[0.66rem] font-semibold uppercase leading-3 tracking-[0.08em]",h.label].join(" "),children:r})]}),s.jsx("div",{className:["mt-2 text-[1.25rem] font-semibold leading-none tracking-tight",h.value].join(" "),children:u}),s.jsx("div",{className:["mt-1.5 truncate text-[0.72rem] font-medium",h.note].join(" "),children:d})]})}function Cj({name:a,method:i,balance:r,status:u,note:d,action:m,icon:h,balanceHidden:x,onActivate:p,onRecharge:v}){const g=u==="Bound",b=g&&x&&hl(i)==="clawtip";return s.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_74px_82px] items-center gap-2 border-b border-[var(--color-line-2)] px-2 py-2.5 last:border-b-0 sm:grid-cols-[minmax(0,1fr)_96px_92px] sm:gap-3 sm:px-3",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[s.jsx(Tj,{method:i,icon:h,bound:g}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"truncate font-semibold text-[var(--color-ink)]",children:a}),d?s.jsx("div",{className:"mt-0.5 truncate text-[0.74rem] text-[var(--color-muted)]",children:d}):null]})})]}),b?s.jsxs("button",{type:"button",className:"inline-flex w-fit items-center gap-1 rounded-[7px] border border-[var(--color-lavender-2)] bg-[var(--color-lavender)] px-2 py-1 font-mono text-[0.82rem] font-semibold text-[var(--color-purple)] transition hover:border-[var(--color-purple)] hover:bg-white active:translate-y-px",onClick:v,"aria-label":"Scan with JD app to view ClawTip wallet balance",title:"Scan with JD app to view wallet balance",children:[s.jsx(q2,{className:"size-3.5"}),"••••"]}):s.jsx("div",{className:"font-mono text-[0.9rem] font-semibold text-[var(--color-ink)]",children:r}),s.jsx("button",{className:"rounded-[8px] bg-[var(--color-purple)] px-2.5 py-1.5 text-[0.76rem] font-semibold text-white shadow-[0_8px_18px_rgba(124,61,240,0.16)] transition hover:bg-[#6e32dc] active:translate-y-px",onClick:g?v:p,"aria-label":m,title:`${m} ${a}`,children:m})]})}function Tj({method:a,icon:i,bound:r}){return hl(a)==="clawtip"?s.jsx("div",{className:"grid size-8 shrink-0 place-items-center rounded-[8px] border border-red-100 bg-[#e1251b] font-mono text-[0.72rem] font-black uppercase tracking-tight text-white shadow-[0_8px_18px_rgba(225,37,27,0.16)]","aria-label":"JD wallet",title:"JD wallet",children:"JD"}):s.jsx("div",{className:["grid size-8 shrink-0 place-items-center rounded-[8px] text-[0.8rem] font-bold",r?"bg-[var(--color-lavender)] text-[var(--color-purple)]":"bg-[var(--color-page)] text-[var(--color-muted)]"].join(" "),children:i})}function Ej({modal:a,methods:i,qr:r,loading:u,error:d,onClose:m}){const h=a.kind==="recharge",x=i.find(z=>z.method===a.method),p=h&&hl(a.method)==="clawtip",v=Td(x==null?void 0:x.config,"resourceUrl"),g=Td(x==null?void 0:x.config,"walletConfigPath"),b=Td(x==null?void 0:x.config,"orderNo"),E=(r==null?void 0:r.walletConfigPresent)===!0||d0(x==null?void 0:x.config,"walletConfigPresent"),C=!h&&!!(r!=null&&r.qrImageUrl)&&!E&&!d,A=(x==null?void 0:x.name)??u0(a.method);return s.jsx("div",{className:"fixed inset-0 z-30 grid place-items-center overflow-y-auto bg-[rgba(32,26,56,0.28)] px-4 py-6",children:s.jsxs("div",{className:"w-full max-w-[820px] rounded-[14px] bg-white p-5 shadow-[0_20px_56px_rgba(32,26,56,0.20)] sm:p-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-[1.05rem] font-semibold text-[var(--color-ink)]",children:p?"ClawTip wallet QR":h?`Recharge ${A}`:`Activate ${A}`}),s.jsx("p",{className:"mt-1 text-[0.82rem] leading-5 text-[var(--color-muted)]",children:p?"Scan with JD app to view wallet balance or recharge.":h?"Load the fixed ClawTip recharge QR from static assets.":"Reuse the tb init ClawTip flow and wait for wallet binding."})]}),s.jsx("button",{className:"rounded-[7px] p-1.5 text-[var(--color-muted)] transition hover:bg-[var(--color-page)]",onClick:m,"aria-label":"Close payment modal",children:s.jsx(Zr,{className:"size-4"})})]}),s.jsxs("div",{className:"mt-5 flex flex-col gap-4",children:[s.jsx("div",{className:"mx-auto grid min-h-[320px] w-full max-w-[720px] place-items-center overflow-hidden rounded-[12px] border border-[var(--color-line-2)] bg-[var(--color-page)] p-3 sm:min-h-[560px] sm:p-4",children:r!=null&&r.qrImageUrl?s.jsx("img",{className:"max-h-[72vh] w-full object-contain",src:r.qrImageUrl,alt:`${A} ${h?"recharge":"activation"} QR code`}):s.jsxs("div",{className:"flex flex-col items-center gap-2 px-3 text-center text-[0.78rem] leading-5 text-[var(--color-muted)]",children:[u?s.jsx(jt,{className:"size-5 animate-spin text-[var(--color-purple)]"}):null,s.jsx("span",{children:u?"Generating ClawTip QR...":"QR image unavailable"})]})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[s.jsx(qr,{label:"Method",value:A}),s.jsx(qr,{label:"Wallet",value:E?"bound":"waiting",warn:!E}),r!=null&&r.orderNo||b?s.jsx(qr,{label:"Order",value:(r==null?void 0:r.orderNo)??b??""}):null,r!=null&&r.walletConfigPath||g?s.jsx(qr,{label:"Config",value:Hj((r==null?void 0:r.walletConfigPath)??g??"")}):null,r!=null&&r.clawtipId?s.jsx(qr,{label:"Device",value:r.clawtipId}):null]}),d?s.jsx("div",{className:"rounded-[8px] border border-rose-100 bg-rose-50 px-3 py-2 text-[0.78rem] leading-5 text-rose-700",children:d instanceof Error?d.message:String(d)}):null,r!=null&&r.qrImageUrl?s.jsx("div",{className:"rounded-[8px] border border-emerald-100 bg-emerald-50 px-3 py-2 text-[0.78rem] leading-5 text-emerald-800",children:h?"Scan with JD app to view wallet balance or recharge.":s.jsxs("span",{className:"flex items-start gap-2",children:[C?s.jsx(jt,{className:"mt-0.5 size-4 shrink-0 animate-spin"}):null,s.jsx("span",{children:E?"Wallet bound. Closing...":"Scan with JD app. TokenBuddy is waiting for the local wallet config."})]})}):null,r!=null&&r.resourceUrl||v?s.jsx("a",{className:"block rounded-[8px] border border-[var(--color-line-2)] bg-white px-3 py-2 font-mono text-[0.75rem] text-[var(--color-purple)] transition hover:bg-[var(--color-lavender)]",href:(r==null?void 0:r.resourceUrl)??v,target:"_blank",rel:"noreferrer",children:c0((r==null?void 0:r.resourceUrl)??v??"")}):!(r!=null&&r.qrImageUrl)&&!u&&!d?s.jsxs("div",{className:"rounded-[8px] border border-amber-100 bg-amber-50 px-3 py-2 text-[0.78rem] leading-5 text-amber-800",children:["No recharge link is available from the daemon. Run ",s.jsx("span",{className:"font-mono",children:"tb init"})," to bind this payment method."]}):null]})]})]})})}function Aj({days:a,series:i}){const d={top:14,right:18,bottom:26,left:26},m=i.flatMap(v=>[...v.input,...v.output]),h=Math.max(1,...m),x=v=>d.left+v*(680-d.left-d.right)/Math.max(1,a.length-1),p=v=>d.top+(1-v/h)*(150-d.top-d.bottom);return s.jsx("div",{className:"rounded-[var(--radius-lg)] border border-[var(--color-line-2)] bg-white px-3 py-1.5",children:s.jsxs("svg",{className:"h-[160px] w-full",viewBox:"0 0 680 150",role:"img","aria-label":"Daily model input and output usage lines",children:[[.25,.5,.75,1].map(v=>s.jsx("line",{x1:d.left,x2:680-d.right,y1:d.top+(1-v)*(150-d.top-d.bottom),y2:d.top+(1-v)*(150-d.top-d.bottom),stroke:"var(--color-chart-grid)",strokeWidth:"1"},v)),a.map((v,g)=>s.jsx("text",{x:x(g),y:143,textAnchor:"middle",className:"fill-[var(--color-muted)] text-[10px]",children:v},v)),i.map(v=>s.jsxs("g",{children:[s.jsx("path",{d:Fd(v.input.map((g,b)=>[x(b),p(g)])),fill:"none",stroke:v.color,strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"}),s.jsx("path",{d:Fd(v.output.map((g,b)=>[x(b),p(g)])),fill:"none",stroke:v.color,strokeWidth:"2.4",strokeDasharray:"5 5",strokeLinecap:"round",strokeLinejoin:"round",opacity:"0.75"}),v.input.map((g,b)=>s.jsx("circle",{cx:x(b),cy:p(g),r:"2.7",fill:v.color},`${v.model}-input-${b}`)),v.output.map((g,b)=>s.jsx("circle",{cx:x(b),cy:p(g),r:"2.2",fill:"#fff",stroke:v.color,strokeWidth:"1.8"},`${v.model}-output-${b}`))]},v.model)),i.length===0?s.jsx("text",{x:680/2,y:150/2,textAnchor:"middle",className:"fill-[var(--color-muted)] text-[12px]",children:"No token usage yet"}):null]})})}function zj({days:a,values:i,total:r}){const m={top:10,right:8,bottom:16,left:8},h=Math.max(1,...i),x=v=>m.left+v*(190-m.left-m.right)/Math.max(1,i.length-1),p=v=>m.top+(1-v/h)*(72-m.top-m.bottom);return s.jsxs("div",{className:"rounded-[var(--radius-lg)] border border-[var(--color-line-2)] bg-white px-3 py-1.5",children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[s.jsx("span",{className:"text-[0.74rem] font-semibold text-[var(--color-ink)]",children:"Cost curve"}),s.jsx("span",{className:"font-mono text-[0.74rem] text-[var(--color-muted)]",children:r})]}),s.jsxs("svg",{className:"h-[66px] w-full",viewBox:"0 0 190 72",role:"img","aria-label":"Daily cost curve",children:[s.jsx("path",{d:Fd(i.map((v,g)=>[x(g),p(v)])),fill:"none",stroke:"var(--color-chart-cost)",strokeWidth:"3",strokeLinecap:"round"}),i.map((v,g)=>s.jsx("circle",{cx:x(g),cy:p(v),r:"2.4",fill:"var(--color-chart-cost)"},a[g]))]})]})}function Rj({values:a,total:i}){const r=Math.max(1,...a);return s.jsxs("div",{className:"rounded-[var(--radius-lg)] border border-[var(--color-line-2)] bg-white px-3 py-1.5",children:[s.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[s.jsx("span",{className:"text-[0.74rem] font-semibold text-[var(--color-ink)]",children:"30 day spend"}),s.jsx("span",{className:"font-mono text-[0.74rem] text-[var(--color-muted)]",children:i})]}),s.jsx("div",{className:"flex h-[60px] items-end gap-1",children:a.map((u,d)=>s.jsx("span",{className:"flex-1 rounded-t-[3px] bg-[var(--color-tokens)]/75",style:{height:`${Math.max(8,u/r*100)}%`}},d))})]})}function Fd(a){return a.length===0?"":a.length===1?`M ${a[0][0]} ${a[0][1]}`:a.reduce((i,r,u)=>{if(u===0)return`M ${r[0]} ${r[1]}`;const d=a[u-1],m=(d[0]+r[0])/2;return`${i} C ${m} ${d[1]}, ${m} ${r[1]}, ${r[0]} ${r[1]}`},"")}function Oj({model:a,color:i}){return s.jsxs("span",{className:"inline-flex min-w-0 max-w-[9rem] items-center gap-1.5 rounded-[7px] border border-[var(--color-line-2)] bg-white px-1.5 py-0.5",title:a,children:[s.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:i}}),s.jsx("span",{className:"truncate font-mono text-[0.68rem]",children:a})]})}function Gv({label:a,dashed:i=!1}){return s.jsxs("span",{className:"inline-flex items-center gap-1 rounded-[7px] border border-[var(--color-line-2)] bg-white px-1.5 py-0.5",children:[s.jsx("span",{className:["h-px w-4 border-t border-[var(--color-ink)]",i?"border-dashed":""].join(" ")}),s.jsx("span",{className:"font-mono text-[0.68rem]",children:a})]})}function qr({label:a,value:i,warn:r=!1}){return s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx("div",{className:"text-[0.78rem] text-[var(--color-muted)]",children:a}),s.jsx("div",{className:["font-mono text-[0.94rem] font-semibold",r?"text-amber-700":"text-[var(--color-ink)]"].join(" "),children:i})]})}function _j({checkedAt:a,healthy:i,pid:r,status:u,proxyPort:d,controlPort:m,registryUrl:h}){const x=[{icon:s.jsx(A2,{className:"size-3"}),label:"Daemon",value:r?`pid ${r}`:u??Te,tone:i?"green":"amber"},{icon:s.jsx(Y2,{className:"size-3"}),label:"Proxy",value:d?`:${d}`:Te,tone:"blue"},{icon:s.jsx(F2,{className:"size-3"}),label:"Control",value:m?`:${m}`:Te,tone:"router"},{icon:s.jsx(D2,{className:"size-3"}),label:"Registry",value:h?c0(h):Te,tone:"spend"}];return s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2 rounded-[var(--radius-xl)] border border-[var(--color-line-2)] bg-white px-3 py-2 shadow-[var(--shadow-chip)]",children:[s.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-[var(--radius-md)] border border-[var(--color-line-2)] bg-white px-2.5 py-1 text-[0.72rem] font-medium text-[var(--color-muted)]",children:[s.jsx(Z2,{className:"size-3.5"}),a]}),x.map(p=>s.jsx(kj,{...p},p.label))]})}function kj({icon:a,label:i,value:r,tone:u}){const d={green:"bg-[var(--color-success-soft)] text-[var(--color-success)]",blue:"bg-[var(--color-tokens-soft)] text-[var(--color-tokens)]",router:"bg-[var(--color-lavender)] text-[var(--color-router)]",spend:"bg-[var(--color-spend-soft)] text-[var(--color-spend)]",amber:"bg-[var(--color-warning-soft)] text-[var(--color-warning)]"}[u];return s.jsxs("div",{className:"inline-flex min-w-0 max-w-full items-center gap-2 rounded-[var(--radius-md)] border border-[var(--color-line-2)] bg-white px-2.5 py-1",children:[s.jsx("span",{className:["grid size-5 shrink-0 place-items-center rounded-[var(--radius-sm)]",d].join(" "),children:a}),s.jsx("span",{className:"text-[0.72rem] font-semibold text-[var(--color-ink)]",children:i}),s.jsx("span",{className:"min-w-0 truncate font-mono text-[0.72rem] text-[var(--color-muted)]",children:r})]})}function Dj(a){const i=Kv(7),r=Kv(30),u=Wd(new Date),d=new Set(i.map(L=>L.key)),m=new Map(r.map((L,V)=>[L.key,V])),h=["var(--color-chart-input)","var(--color-spend)","var(--color-chart-cost)","var(--color-inventory)"],x=new Map,p=i.map(()=>0),v=r.map(()=>0);let g=0,b=0,E=0,C=0,A=0,z=0,U=0,D=0,G=0;for(const L of a){const V=Wd(new Date(L.createdAt)),I=L.billedMicros??0,J=L.promptTokens??0,ee=L.completionTokens??0;G+=1,b+=I,C+=J,A+=ee,V===u&&(D+=1,g+=I,z+=J,U+=ee);const le=i.findIndex(F=>F.key===V);if(le>=0){E+=I,p[le]+=I/1e6;const F=x.get(L.modelId)??{input:i.map(()=>0),output:i.map(()=>0),total:0};F.input[le]+=J,F.output[le]+=ee,F.total+=J+ee,x.set(L.modelId,F)}else d.has(V)&&(E+=I);const oe=m.get(V);oe!==void 0&&(v[oe]+=I/1e6)}const K=Array.from(x.entries()).sort((L,V)=>V[1].total-L[1].total).slice(0,4).map(([L,V],I)=>({model:L,color:h[I%h.length],input:V.input,output:V.output}));return{days:i.map(L=>L.label),modelUsage:K,cost:p,thirtyDaySpend:v,todaySpendMicros:g,totalSpendMicros:b,weeklySpendMicros:E,inputTokens:C,outputTokens:A,todayInputTokens:z,todayOutputTokens:U,todayRequestCount:D,totalRequestCount:G}}function Uj(a,i){const r=new Map;for(const u of[...i].sort((d,m)=>d.createdAt.localeCompare(m.createdAt)))!u.paymentMethod||u.balanceSnapshotMicros===void 0||r.set(hl(u.paymentMethod),u.balanceSnapshotMicros);return[...a].filter(u=>hl(u.method)!=="mock").sort((u,d)=>Number(d.isDefault)-Number(u.isDefault)||u.method.localeCompare(d.method)).map(u=>{const d=hl(u.method),m=u.enabled||!!(u.config&&Object.keys(u.config).length>0),h=r.get(d),x=d==="clawtip";return{name:u0(u.method),method:u.method,balance:x?"••••":st(h),status:u.enabled?"Bound":"Available",note:m?u.isDefault?"Default wallet":"Configured":"Not bound",action:u.enabled?"Recharge":"Activate",icon:Bj(u.method),balanceHidden:x,config:u.config}})}function Kv(a){const i=[],r=new Intl.DateTimeFormat("en",{weekday:"short"});for(let u=a-1;u>=0;u-=1){const d=new Date;d.setHours(0,0,0,0),d.setDate(d.getDate()-u),i.push({key:Wd(d),label:r.format(d)})}return i}function Wd(a){if(Number.isNaN(a.getTime()))return"";const i=a.getFullYear(),r=String(a.getMonth()+1).padStart(2,"0"),u=String(a.getDate()).padStart(2,"0");return`${i}-${r}-${u}`}function u0(a){const i=hl(a);return i==="clawtip"?"ClawTip":i==="alipay-agent"?"Alipay Agent Payment":i==="wechat-pay"?"WeChat Pay":i==="coinbase-smart-wallet"?"Coinbase Smart Wallet":a.split(/[-_\s]+/).filter(Boolean).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")}function Bj(a){const i=hl(a);return i==="clawtip"?"C":i==="wechat-pay"?"W":i==="alipay-agent"?"A":i.charAt(0).toUpperCase()||"P"}function hl(a){return a.trim().toLowerCase()}function c0(a){try{const i=new URL(a),r=i.pathname==="/"?"":i.pathname;return`${i.host}${r}`.slice(0,34)}catch{return a.length>34?`${a.slice(0,31)}...`:a}}function Hj(a){const i=a.split("/");return i.length<=3?a:`.../${i.slice(-2).join("/")}`}function Td(a,i){const r=a==null?void 0:a[i];return typeof r=="string"&&r.length>0?r:void 0}function d0(a,i){return(a==null?void 0:a[i])===!0}const Lj=[{value:"fullAuto",label:"Full auto",help:"Choose from all compatible sellers for each model."},{value:"fixedSet",label:"Fixed set",help:"Choose automatically within your selected seller set."},{value:"fixed",label:"Fixed",help:"Pin one fixed seller for each model."}],qj=[{value:"balanced",label:"Balanced",help:"Balance reliability, speed, and cost."},{value:"speed",label:"Speed first",help:"Prioritize low TTFT and high throughput."},{value:"discount",label:"Cost first",help:"Prioritize discount and available balance."}];function Qj(){var ge,M,_,Z,P;const a=Ix(),i=e0(),r=t0(),u=xf(),d=cj(),m=Wo(),[h,x]=j.useState({mode:"fullAuto",scorer:"balanced"}),[p,v]=j.useState([]),[g,b]=j.useState(""),[E,C]=j.useState(null),[A,z]=j.useState(null),U=oj({...h,modelId:g}),D=u.data,G=((ge=r.data)==null?void 0:ge.sellers)??[],K=((M=d.data)==null?void 0:M.focusSet)??[],L=j.useMemo(()=>Ij((D==null?void 0:D.data)??[],K),[K,D==null?void 0:D.data]),V=tS(U.data),I=j.useMemo(()=>eS(G,D,(V==null?void 0:V.routes)??[]),[D,V==null?void 0:V.routes,G]),J=j.useMemo(()=>p.map(X=>L.find(ae=>ae.id===X)).filter(p0),[L,p]),ee=h.sellerIds??[],le=h.fixedByModel??{},oe=J.length,F=J.filter(X=>h.mode==="fixed"?!!le[X.id]:h.mode==="fixedSet"?ee.length>0:!0).length,me=j.useMemo(()=>{var X;return s0({inferences:((X=m.data)==null?void 0:X.inferences)??[],modelsResponse:D,sellersResponse:r.data,previewPlan:V,activeModelId:g})},[g,(_=m.data)==null?void 0:_.inferences,D,V,r.data]);j.useEffect(()=>{var X;(X=a.data)!=null&&X.strategy&&x(a.data.strategy)},[(Z=a.data)==null?void 0:Z.strategy]),j.useEffect(()=>{if(p.length>0||L.length===0)return;const X=K.filter(W=>L.some(Ae=>Ae.id===W)),ae=X.length>0?X:L.slice(0,2).map(W=>W.id);v(ae),b(ae[0]??"")},[K,L,p.length]),j.useEffect(()=>{!g||p.includes(g)||b(p[0]??"")},[g,p]),j.useEffect(()=>{g&&U.refetch()},[g,h.mode,h.scorer,h.sellerId,(P=h.sellerIds)==null?void 0:P.join(","),rS(h.fixedByModel)]);async function pe(X){x(X),C(null);try{await i.mutateAsync(X)}catch(ae){C(ae instanceof Error?ae.message:String(ae))}}function Ee(X){v(ae=>{if(ae.includes(X)){const Ae=ae.filter(Oe=>Oe!==X);return g===X&&b(Ae[0]??""),Lo(Ae).catch(()=>{}),Ae}b(X);const W=[...ae,X];return Lo(W).catch(()=>{}),W})}function ue(X){v(ae=>{const W=ae.filter(Ae=>Ae!==X);return g===X&&b(W[0]??""),Lo(W).catch(()=>{}),W})}function B(X){const ae=lS({...h,mode:X},I,g);pe(ae)}function $(X){pe({...h,scorer:X})}function re(X,ae){const W=h.sellerIds??[],Ae=W.includes(ae)?W.filter(Oe=>Oe!==ae):[...W,ae];pe({...h,mode:"fixedSet",sellerIds:Ae,sellerId:void 0})}function be(X,ae){const W={...h.fixedByModel??{},[X]:ae};pe({...h,mode:"fixed",fixedByModel:W,sellerId:void 0,sellerIds:void 0}),b(X),z(null)}return s.jsxs("div",{className:"space-y-5",children:[s.jsx("section",{children:s.jsxs(St,{className:"p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 border-b border-[var(--color-line-2)] px-4 py-3",children:[s.jsx("div",{className:"min-w-0 flex-1",children:s.jsx("div",{className:"text-[0.78rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:"Models"})}),s.jsxs("button",{type:"button",onClick:()=>z({kind:"models"}),className:"inline-flex items-center gap-1.5 rounded-[8px] bg-[var(--color-purple)] px-3 py-1.5 text-[0.78rem] font-semibold text-white hover:bg-[var(--color-purple-2)]","aria-label":"Add",title:"Add models","data-testid":"routing-add-models",children:[s.jsx(Jd,{size:14}),"Add"]})]}),s.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[J.map(X=>{const ae=g===X.id,W=X.sellerCount>0;return s.jsxs("div",{className:["inline-flex min-h-9 items-center gap-2 rounded-[9px] border px-3 py-1.5 transition-colors",W?"border-[var(--color-lavender-2)] bg-[var(--color-lavender)] text-[var(--color-purple)] hover:border-[var(--color-purple)] hover:bg-white":"border-rose-200 bg-rose-50 text-rose-700 hover:bg-white",ae?"ring-2 ring-[var(--color-lavender-2)] ring-offset-1 ring-offset-white":""].join(" "),children:[s.jsx("button",{type:"button",onClick:()=>b(X.id),className:"flex items-center text-left",children:s.jsx("span",{className:["font-mono text-[0.82rem] font-semibold",W?"text-[var(--color-purple)]":"text-rose-700"].join(" "),children:X.id})}),s.jsx("button",{type:"button",onClick:()=>ue(X.id),className:["inline-flex size-5 items-center justify-center rounded-[6px]",W?"text-[var(--color-purple)]/70 hover:bg-white hover:text-[var(--color-purple)]":"text-rose-700/70 hover:bg-white hover:text-rose-700"].join(" "),"aria-label":`Remove ${X.id}`,children:s.jsx($x,{size:12})})]},X.id)}),J.length===0?s.jsx("div",{className:"px-4 py-8 text-center text-[0.88rem] text-[var(--color-muted)]",children:"No models yet. Click Add to add common models."}):null,d.isError?s.jsx("div",{className:"px-3 py-2 text-[0.82rem] text-amber-700",children:"Focus models could not be saved."}):null]})]})}),s.jsx("section",{children:s.jsx(St,{className:"overflow-hidden",children:s.jsxs("div",{className:"p-5",children:[s.jsxs("div",{className:"mb-4 flex items-center justify-between gap-3",children:[s.jsx("div",{className:"text-[0.78rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:"Strategy"}),s.jsxs("div",{className:"text-[0.78rem] text-[var(--color-muted)]",children:[F,"/",Math.max(oe,1)," configured"]})]}),a.isLoading||r.isLoading||u.isLoading?s.jsx("div",{className:"mb-3 rounded-[10px] border border-[var(--color-line-2)] bg-white px-3 py-2 text-[0.82rem] text-[var(--color-muted)]",children:"Loading routing data..."}):null,a.isError||r.isError||u.isError?s.jsx("div",{className:"mb-3 rounded-[10px] border border-rose-100 bg-rose-50 px-3 py-2 text-[0.82rem] text-rose-700",children:"Some routing data could not be loaded. Check that tb-proxyd is running."}):null,E?s.jsx("div",{className:"mb-3 rounded-[10px] border border-rose-100 bg-rose-50 px-3 py-2 text-[0.82rem] text-rose-700",children:E}):null,s.jsx("div",{className:"mb-5 grid grid-cols-1 gap-2 md:grid-cols-3",children:Lj.map(X=>s.jsx(Fj,{active:h.mode===X.value,title:X.label,description:X.help,onClick:()=>B(X.value)},X.value))}),s.jsx("div",{className:"rounded-[14px] border border-[var(--color-line-2)] bg-white p-4",children:s.jsx(Yj,{mode:h.mode,scorer:h.scorer,selectedModels:J,fixedSetSellers:ee,fixedByModel:le,sellers:I,activeModelId:g,onScorerChange:$,onOpenSellerPicker:z,onToggleFixedSetSeller:re})})]})})}),s.jsx(Gj,{summary:me}),(A==null?void 0:A.kind)==="models"?s.jsx($j,{models:L,selectedModelIds:p,onClose:()=>z(null),onToggle:Ee}):null,(A==null?void 0:A.kind)==="sellers"?s.jsx(Jj,{modelId:A.modelId,selection:A.selection,selectedSellerIds:A.selection==="single"?le[A.modelId]?[le[A.modelId]]:[]:ee,scorer:h.scorer,sellers:I,onClose:()=>z(null),onToggle:X=>{A.selection==="single"?be(A.modelId,X):re(A.modelId,X)}}):null]})}function Yj({mode:a,scorer:i,selectedModels:r,fixedSetSellers:u,fixedByModel:d,sellers:m,activeModelId:h,onScorerChange:x,onOpenSellerPicker:p,onToggleFixedSetSeller:v}){var E;const g=oS(r,h),b=(E=g[0])==null?void 0:E.id;return a==="fullAuto"?s.jsx("div",{children:s.jsx(Xv,{scorer:i,onChange:x})}):a==="fixedSet"?s.jsxs("div",{className:"space-y-3",children:[s.jsx(Xv,{scorer:i,onChange:x}),s.jsx(Vj,{modelId:b,sellers:m,sellerIds:u,onChoose:C=>p({kind:"sellers",modelId:C,selection:"multi"}),onRemove:C=>{b&&v(b,C)}})]}):s.jsx("div",{className:"space-y-3",children:s.jsx(Zj,{selectedModels:g,activeModelId:h,resolveValue:C=>iS(d[C],m),onChoose:C=>p({kind:"sellers",modelId:C,selection:"single"})})})}function Gj({summary:a}){return s.jsx("section",{children:s.jsxs(St,{className:"overflow-hidden",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-b border-[var(--color-line-2)] px-4 py-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-[0.78rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:"Model route activity"}),s.jsxs("div",{className:"mt-0.5 font-mono text-[0.74rem] text-[var(--color-muted)]",children:[Ke(a.totalRequests)," requests · ",pl(a.totalTokens)," tokens · ",st(a.totalSpendMicros,{digits:4})]})]}),s.jsxs("div",{className:"rounded-[8px] border border-[var(--color-line-2)] bg-white px-2.5 py-1.5 font-mono text-[0.74rem] text-[var(--color-muted)]",children:[Ke(a.rows.length)," models"]})]}),s.jsxs("div",{className:"divide-y divide-[var(--color-line-2)] bg-white xl:hidden",children:[a.rows.map(i=>s.jsx(Kj,{row:i},`${i.source}-${i.modelId}-${i.currentSellerId}`)),a.rows.length===0?s.jsx("div",{className:"px-4 py-8 text-center text-[var(--color-muted)]",children:"No model traffic yet."}):null]}),s.jsx("div",{className:"hidden min-w-0 max-w-full overflow-x-auto xl:block",children:s.jsxs("table",{className:"w-full min-w-[1180px] border-collapse text-left text-[0.82rem]",children:[s.jsx("thead",{className:"bg-white/70 text-[0.68rem] uppercase tracking-wider text-[var(--color-muted)]",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-4 py-2.5 font-semibold",children:"MODEL"}),s.jsx("th",{className:"px-4 py-2.5 font-semibold",children:"NODE"}),s.jsx("th",{className:"px-4 py-2.5 text-right font-semibold",children:"REQ"}),s.jsx("th",{className:"px-4 py-2.5 text-right font-semibold",children:"DISC"}),s.jsx("th",{className:"px-4 py-2.5 text-right font-semibold",children:"TTFT"}),s.jsx("th",{className:"px-4 py-2.5 text-right font-semibold",children:"TOKEN"}),s.jsx("th",{className:"px-4 py-2.5 font-semibold",children:"SWITCH"}),s.jsx("th",{className:"px-4 py-2.5 font-semibold",children:"TIME"})]})}),s.jsxs("tbody",{className:"divide-y divide-[var(--color-line-2)] bg-white",children:[a.rows.map(i=>s.jsx(Xj,{row:i},`${i.source}-${i.modelId}-${i.currentSellerId}`)),a.rows.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:8,className:"px-4 py-8 text-center text-[var(--color-muted)]",children:"No model traffic yet."})}):null]})]})})]})})}function Kj({row:a}){return s.jsxs("article",{className:"px-4 py-3",children:[s.jsxs("div",{className:"flex min-w-0 flex-wrap items-start justify-between gap-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"truncate font-mono text-[0.92rem] font-semibold text-[var(--color-ink)]",title:a.modelId,children:a.modelId}),s.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1.5",children:[s.jsx(Mi,{tone:a.source==="ledger"?"green":"amber",children:a.source}),a.lastStatus?s.jsx(Mi,{tone:Ka(a.lastStatus),children:Rl(a.lastStatus)}):null,a.upstreamStatus?s.jsx(Mi,{tone:Ka(a.upstreamStatus),children:Rl(a.upstreamStatus)}):null]}),a.routeReason?s.jsx("div",{className:"mt-1 truncate text-[0.72rem] text-[var(--color-muted)]",title:a.routeReason,children:a.routeReason}):null]}),s.jsxs("div",{className:"min-w-0 text-right",children:[s.jsx("div",{className:"truncate font-semibold text-[var(--color-purple)]",title:a.currentSellerId,children:a.currentSellerName}),s.jsx("div",{className:"mt-0.5 truncate font-mono text-[0.72rem] text-[var(--color-muted)]",title:a.currentSellerId,children:a.currentSellerId}),s.jsx("div",{className:"mt-1 text-[0.72rem] text-[var(--color-muted)]",children:a.currentSellerPaymentMethods.length>0?a.currentSellerPaymentMethods.join(", "):Te})]})]}),s.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 sm:grid-cols-3",children:[s.jsx(ji,{label:"Node stats",value:Ke(a.currentSellerRequests),detail:`${Ke(a.sellerModelCount)} models · ${Ke(a.touchedSellerCount)} nodes`}),s.jsx(ji,{label:"Discount",value:a.sellerDiscount,detail:`fee ${a.sellerServiceFee} · ${n0(a.inputPriceMicrosPer1m,a.outputPriceMicrosPer1m)}`,tone:"green"}),s.jsx(ji,{label:"Speed",value:xt(a.lastTtftMs??a.avgTtftMs),detail:`${xt(a.lastDurationMs??a.avgDurationMs)} total`}),s.jsx(ji,{label:"Tokens",value:pl(a.totalTokens),detail:`${$r(a.inputTokens,a.outputTokens)} · ${st(a.totalSpendMicros,{digits:4})}`}),s.jsx(ji,{label:"Switch",value:vl(a.selectedAt),compact:!0}),s.jsx(ji,{label:"Last access",value:vl(a.lastAccessAt),detail:a.lastRequestId??void 0,compact:!0})]})]})}function ji({label:a,value:i,detail:r,tone:u="default",compact:d=!1}){return s.jsxs("div",{className:"min-w-0 rounded-[9px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-2.5 py-2",children:[s.jsx("div",{className:"text-[0.62rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:a}),s.jsx("div",{className:["mt-1 min-w-0 truncate font-mono font-semibold",d?"text-[0.72rem]":"text-[0.88rem]",u==="green"?"text-emerald-700":"text-[var(--color-ink)]"].join(" "),title:i,children:i}),r?s.jsx("div",{className:"mt-0.5 truncate text-[0.68rem] text-[var(--color-muted)]",title:r,children:r}):null]})}function Xj({row:a}){return s.jsxs("tr",{className:"align-top transition hover:bg-[var(--color-lavender)]/25",children:[s.jsxs("td",{className:"px-4 py-3",children:[s.jsx("div",{className:"max-w-[230px] truncate font-mono text-[0.84rem] font-semibold text-[var(--color-ink)]",title:a.modelId,children:a.modelId}),s.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1.5",children:[s.jsx(Mi,{tone:a.source==="ledger"?"green":"amber",children:a.source}),a.lastStatus?s.jsx(Mi,{tone:Ka(a.lastStatus),children:Rl(a.lastStatus)}):null,a.upstreamStatus?s.jsx(Mi,{tone:Ka(a.upstreamStatus),children:Rl(a.upstreamStatus)}):null]}),a.routeReason?s.jsx("div",{className:"mt-1 max-w-[240px] truncate text-[0.72rem] text-[var(--color-muted)]",title:a.routeReason,children:a.routeReason}):null]}),s.jsxs("td",{className:"px-4 py-3",children:[s.jsx("div",{className:"max-w-[210px] truncate font-semibold text-[var(--color-purple)]",title:a.currentSellerId,children:a.currentSellerName}),s.jsx("div",{className:"mt-0.5 max-w-[210px] truncate font-mono text-[0.72rem] text-[var(--color-muted)]",title:a.currentSellerId,children:mj(a.currentSellerId)}),s.jsx("div",{className:"mt-1 text-[0.72rem] text-[var(--color-muted)]",children:a.currentSellerPaymentMethods.length>0?a.currentSellerPaymentMethods.join(", "):Te})]}),s.jsxs("td",{className:"px-4 py-3 text-right",children:[s.jsx("div",{className:"font-mono text-[0.84rem] font-semibold text-[var(--color-ink)]",children:Ke(a.currentSellerRequests)}),s.jsx("div",{className:"mt-0.5 text-[0.72rem] text-[var(--color-muted)]",children:"node requests"}),s.jsxs("div",{className:"mt-0.5 font-mono text-[0.72rem] text-[var(--color-muted)]",children:[Ke(a.sellerModelCount)," models · ",Ke(a.touchedSellerCount)," nodes"]})]}),s.jsxs("td",{className:"px-4 py-3 text-right",children:[s.jsx("div",{className:"font-mono text-[0.84rem] font-semibold text-emerald-700",children:a.sellerDiscount}),s.jsxs("div",{className:"mt-0.5 text-[0.72rem] text-[var(--color-muted)]",children:["fee ",a.sellerServiceFee]}),s.jsx("div",{className:"mt-0.5 font-mono text-[0.72rem] text-[var(--color-muted)]",children:n0(a.inputPriceMicrosPer1m,a.outputPriceMicrosPer1m)})]}),s.jsxs("td",{className:"px-4 py-3 text-right",children:[s.jsx("div",{className:"font-mono text-[0.84rem] font-semibold text-[var(--color-ink)]",children:xt(a.lastTtftMs??a.avgTtftMs)}),s.jsx("div",{className:"mt-0.5 text-[0.72rem] text-[var(--color-muted)]",children:"TTFT"}),s.jsxs("div",{className:"mt-0.5 font-mono text-[0.72rem] text-[var(--color-muted)]",children:[xt(a.lastDurationMs??a.avgDurationMs)," total"]})]}),s.jsxs("td",{className:"px-4 py-3 text-right",children:[s.jsx("div",{className:"font-mono text-[0.84rem] font-semibold text-[var(--color-ink)]",children:pl(a.totalTokens)}),s.jsx("div",{className:"mt-0.5 text-[0.72rem] text-[var(--color-muted)]",children:$r(a.inputTokens,a.outputTokens)}),s.jsx("div",{className:"mt-0.5 font-mono text-[0.72rem] text-[var(--color-muted)]",children:st(a.totalSpendMicros,{digits:4})})]}),s.jsx("td",{className:"whitespace-nowrap px-4 py-3 font-mono text-[0.74rem] text-[var(--color-muted)]",children:vl(a.selectedAt)}),s.jsxs("td",{className:"whitespace-nowrap px-4 py-3",children:[s.jsx("div",{className:"font-mono text-[0.74rem] text-[var(--color-muted)]",children:vl(a.lastAccessAt)}),a.lastRequestId?s.jsx("div",{className:"mt-1 max-w-[160px] truncate font-mono text-[0.68rem] text-[var(--color-faint)]",title:a.lastRequestId,children:a.lastRequestId}):null]})]})}function Mi({tone:a,children:i}){const r={green:"bg-emerald-50 text-emerald-700",amber:"bg-amber-50 text-amber-700",red:"bg-rose-50 text-rose-700",blue:"bg-blue-50 text-blue-700",gray:"bg-slate-100 text-slate-600"}[a];return s.jsx("span",{className:["rounded-full px-2 py-0.5 text-[0.66rem] font-semibold uppercase",r].join(" "),children:i})}function Xv({scorer:a,onChange:i}){return s.jsx("div",{className:"rounded-[12px] border border-[var(--color-line-2)] bg-white p-1.5",children:s.jsx("div",{className:"grid grid-cols-1 gap-1.5 md:grid-cols-3",children:qj.map(r=>s.jsxs("button",{type:"button",onClick:()=>i(r.value),"aria-label":`Routing scorer: ${r.label}`,className:["flex min-h-14 items-center gap-2 rounded-[9px] px-3 py-2 text-left transition-colors",a===r.value?"bg-[var(--color-lavender)] text-[var(--color-ink)]":"text-[var(--color-muted)] hover:bg-[var(--color-lavender)]/40"].join(" "),children:[s.jsx(Po,{active:a===r.value,fixed:!0}),s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:"block text-[0.86rem] font-semibold",children:r.label}),s.jsx("span",{className:"block truncate text-[0.72rem] text-[var(--color-muted)]",children:r.help})]})]},r.value))})})}function Vj({modelId:a,sellers:i,sellerIds:r,onChoose:u,onRemove:d}){if(!a)return s.jsx("div",{className:"rounded-[12px] border border-[var(--color-line-2)] bg-white px-3 py-4 text-[0.86rem] text-[var(--color-muted)]",children:"Add models before configuring a seller set."});const m=r.map(h=>i.find(x=>x.id===h)).filter(p0);return s.jsxs("div",{className:"overflow-hidden rounded-[12px] border border-[var(--color-line-2)] bg-white",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-3 border-b border-[var(--color-line-2)] bg-white/70 px-3 py-2.5",children:[s.jsx("div",{className:"min-w-0 flex-1",children:s.jsx("div",{className:"text-[0.78rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:"Sellers"})}),s.jsx("button",{type:"button",onClick:()=>u(a),className:"rounded-[8px] border border-[var(--color-lavender-2)] bg-[var(--color-lavender)] px-3 py-1.5 text-[0.78rem] font-semibold text-[var(--color-purple)] hover:bg-white","aria-label":`Add sellers to fixed set for ${a}`,children:"Add sellers"})]}),m.length>0?s.jsx("div",{className:"min-w-0 max-w-full overflow-x-auto",children:s.jsxs("table",{className:"w-full border-collapse text-left text-[0.82rem]",children:[s.jsx("thead",{className:"bg-white/70 text-[0.68rem] uppercase tracking-wider text-[var(--color-muted)]",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-3 py-2 font-semibold",children:"Seller"}),s.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Discount"}),s.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Markup fee"}),s.jsx("th",{className:"px-3 py-2 font-semibold",children:"Payment"}),s.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"TTFT"}),s.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Tok/s"}),s.jsx("th",{className:"w-10 px-3 py-2 font-semibold"})]})}),s.jsx("tbody",{className:"divide-y divide-[var(--color-line-2)] bg-white",children:m.map(h=>s.jsxs("tr",{children:[s.jsx("td",{className:"px-3 py-2.5 font-semibold text-[var(--color-ink)]",children:h.name}),s.jsxs("td",{className:"whitespace-nowrap px-3 py-2.5 text-right",children:[s.jsx("div",{className:"font-mono font-semibold text-[var(--color-purple)]",children:h.discount}),s.jsx("div",{className:"mt-0.5 font-mono text-[0.72rem] text-[var(--color-muted)]",children:h.price})]}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono text-[var(--color-ink)]",children:h.markupFee}),s.jsx("td",{className:"px-3 py-2.5 text-[var(--color-muted)]",children:h.paymentMethods.join(", ")}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono text-[var(--color-ink)]",children:xt(h.latencyMs)}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono text-[var(--color-ink)]",children:Ke(h.tokensPerSecond)}),s.jsx("td",{className:"px-3 py-2.5 text-right",children:s.jsx("button",{type:"button",onClick:()=>d(h.id),className:"inline-flex size-7 items-center justify-center rounded-[7px] text-[var(--color-muted)] hover:bg-rose-50 hover:text-rose-700","aria-label":`Remove ${h.name}`,children:s.jsx($x,{size:14})})})]},h.id))})]})}):s.jsx("div",{className:"px-3 py-8 text-center text-[0.86rem] text-[var(--color-muted)]",children:"No sellers yet. Click Add sellers to build the fixed set."})]})}function Zj({selectedModels:a,activeModelId:i,resolveValue:r,onChoose:u}){return a.length===0?s.jsx("div",{className:"rounded-[12px] border border-[var(--color-line-2)] bg-white px-3 py-4 text-[0.86rem] text-[var(--color-muted)]",children:"Add models before configuring sellers."}):s.jsx("div",{className:"divide-y divide-[var(--color-line-2)] rounded-[12px] border border-[var(--color-line-2)] bg-white",children:a.map(d=>s.jsxs("div",{className:["flex flex-wrap items-center gap-3 px-3 py-3",i===d.id?"bg-[var(--color-lavender)]/55":""].join(" "),children:[s.jsx("div",{className:"min-w-0 flex-1",children:s.jsx("div",{className:"truncate font-mono text-[0.88rem] font-semibold text-[var(--color-ink)]",children:d.id})}),s.jsxs("div",{className:"min-w-0 flex items-center gap-2",children:[s.jsx("button",{type:"button",onClick:()=>u(d.id),className:"max-w-[240px] truncate rounded-[8px] border border-[var(--color-lavender-2)] bg-[var(--color-lavender)] px-3 py-1.5 text-[0.78rem] font-semibold text-[var(--color-purple)] hover:bg-white","aria-label":`Choose seller for ${d.id}`,children:r(d.id)}),s.jsx("button",{type:"button",onClick:()=>u(d.id),className:"rounded-[8px] border border-[var(--color-line-2)] bg-white px-3 py-1.5 text-[0.78rem] font-semibold text-[var(--color-muted)] hover:border-[var(--color-lavender-2)] hover:text-[var(--color-purple)]","aria-label":`Reselect seller for ${d.id}`,children:"Reselect"})]})]},d.id))})}function $j({models:a,selectedModelIds:i,onClose:r,onToggle:u}){const[d,m]=j.useState(""),h=a.filter(x=>h0(d,[x.id,x.paymentMethod,x.enabled?"enabled":"not enabled"]));return s.jsxs(f0,{title:"Add models",onClose:r,children:[s.jsx(m0,{value:d,onChange:m,placeholder:"Search models or payment"}),s.jsx("div",{className:"mt-3 overflow-hidden rounded-[12px] border border-[var(--color-line-2)]",children:s.jsxs("table",{className:"w-full border-collapse text-left text-[0.84rem]",children:[s.jsx("thead",{className:"bg-white/70 text-[0.7rem] uppercase tracking-wider text-[var(--color-muted)]",children:s.jsxs("tr",{children:[s.jsx("th",{className:"w-10 px-3 py-2 font-semibold"}),s.jsx("th",{className:"px-3 py-2 font-semibold",children:"Model"}),s.jsx("th",{className:"px-3 py-2 font-semibold",children:"Payment"}),s.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Sellers"})]})}),s.jsxs("tbody",{className:"divide-y divide-[var(--color-line-2)] bg-white",children:[h.map(x=>{const p=i.includes(x.id);return s.jsxs("tr",{onClick:()=>u(x.id),className:["cursor-pointer",p?"bg-[var(--color-lavender)]/70":"hover:bg-[var(--color-lavender)]/35",x.enabled?"":"opacity-60"].join(" "),children:[s.jsx("td",{className:"px-3 py-2.5",children:s.jsx(Po,{active:p,fixed:!1})}),s.jsx("td",{className:"px-3 py-2.5 font-mono font-semibold text-[var(--color-ink)]",children:x.id}),s.jsx("td",{className:"px-3 py-2.5",children:s.jsx(Wj,{enabled:x.enabled,paymentMethod:x.paymentMethod})}),s.jsx("td",{className:"px-3 py-2.5 text-right text-[var(--color-muted)]",children:x.sellerCount})]},x.id)}),h.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:4,className:"px-3 py-8 text-center text-[var(--color-muted)]",children:"No models found."})}):null]})]})}),s.jsx("div",{className:"mt-3 flex items-center justify-end border-t border-[var(--color-line-2)] pt-3",children:s.jsx("button",{type:"button",onClick:r,"aria-label":"Done","data-testid":"routing-model-picker-done",className:"inline-flex h-9 items-center justify-center rounded-[8px] bg-[var(--color-ink)] px-3 text-[0.82rem] font-semibold text-white transition hover:bg-[var(--color-purple)]",children:"Done"})})]})}function Jj({modelId:a,selection:i,selectedSellerIds:r,scorer:u,sellers:d,onClose:m,onToggle:h}){const[x,p]=j.useState(""),g=Pj(d.filter(b=>b.coverageModelIds.includes(a)),[a],u).filter(b=>h0(x,[b.name,b.id,b.paymentMethods.join(" "),b.health,b.notes.join(" ")]));return s.jsxs(f0,{title:`Choose seller · ${a}`,onClose:m,children:[s.jsx(m0,{value:x,onChange:p,placeholder:"Search sellers, payment, notes"}),s.jsx("div",{className:"mt-3 overflow-hidden rounded-[12px] border border-[var(--color-line-2)]",children:s.jsxs("table",{className:"w-full border-collapse text-left text-[0.82rem]",children:[s.jsx("thead",{className:"bg-white/70 text-[0.7rem] uppercase tracking-wider text-[var(--color-muted)]",children:s.jsxs("tr",{children:[s.jsx("th",{className:"w-10 px-3 py-2 font-semibold"}),s.jsx("th",{className:"px-3 py-2 font-semibold",children:"Seller"}),s.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Discount"}),s.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Markup fee"}),s.jsx("th",{className:"px-3 py-2 font-semibold",children:"Payment"}),s.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"TTFT"}),s.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Tok/s"})]})}),s.jsxs("tbody",{className:"divide-y divide-[var(--color-line-2)] bg-white",children:[g.map(b=>{const E=r.includes(b.id);return s.jsxs("tr",{onClick:()=>h(b.id),className:["cursor-pointer",E?"bg-[var(--color-lavender)]/70":"hover:bg-[var(--color-lavender)]/35"].join(" "),children:[s.jsx("td",{className:"px-3 py-2.5",children:s.jsx(Po,{active:E,fixed:i==="single"})}),s.jsx("td",{className:"px-3 py-2.5 font-semibold text-[var(--color-ink)]",children:b.name}),s.jsxs("td",{className:"whitespace-nowrap px-3 py-2.5 text-right",children:[s.jsx("div",{className:"font-mono font-semibold text-[var(--color-purple)]",children:b.discount}),s.jsx("div",{className:"mt-0.5 font-mono text-[0.72rem] text-[var(--color-muted)]",children:b.price})]}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono text-[var(--color-ink)]",children:b.markupFee}),s.jsx("td",{className:"px-3 py-2.5 text-[var(--color-muted)]",children:b.paymentMethods.join(", ")}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono text-[var(--color-ink)]",children:xt(b.latencyMs)}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono text-[var(--color-ink)]",children:Ke(b.tokensPerSecond)})]},b.id)}),g.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:7,className:"px-3 py-8 text-center text-[var(--color-muted)]",children:"No sellers found."})}):null]})]})})]})}function f0({title:a,children:i,onClose:r}){return s.jsx("div",{className:"fixed inset-0 z-30 flex items-center justify-center bg-[#201a38]/35 px-4 py-6 backdrop-blur-sm",children:s.jsxs("div",{className:"max-h-[86dvh] w-full max-w-[820px] overflow-hidden rounded-[14px] border border-[var(--color-line-2)] bg-white shadow-[0_24px_70px_rgba(32,26,56,0.22)]",children:[s.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--color-line-2)] px-5 py-4",children:[s.jsx("div",{className:"min-w-0 flex-1 truncate text-[1rem] font-semibold text-[var(--color-ink)]",children:a}),s.jsx("button",{type:"button",onClick:r,className:"inline-flex size-8 items-center justify-center rounded-[8px] text-[var(--color-muted)] hover:bg-[var(--color-lavender)] hover:text-[var(--color-purple)]","aria-label":"Close",children:s.jsx(Zr,{size:16})})]}),s.jsx("div",{className:"max-h-[calc(86dvh-65px)] overflow-auto p-4",children:i})]})})}function Fj({active:a,title:i,description:r,onClick:u}){return s.jsxs("button",{type:"button",onClick:u,"aria-label":`Set ${i} routing mode`,className:["min-h-[86px] rounded-[12px] border px-3 py-2.5 text-left transition-all",a?"border-[var(--color-lavender-2)] bg-[var(--color-lavender)] text-[var(--color-ink)]":"border-[var(--color-line-2)] bg-white text-[var(--color-muted)] hover:border-[var(--color-line)]"].join(" "),children:[s.jsxs("span",{className:"flex items-center gap-2 font-mono text-[0.86rem] font-semibold",children:[s.jsx(Po,{active:a,fixed:!0}),i]}),s.jsx("span",{className:"mt-1.5 block text-[0.74rem] leading-snug text-[var(--color-muted)]",children:r})]})}function Wj({enabled:a,paymentMethod:i}){return s.jsxs("span",{className:["inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[0.72rem] ring-1",a?"bg-emerald-50 text-emerald-700 ring-emerald-100":"bg-slate-100 text-slate-500 ring-slate-200"].join(" "),children:[a?s.jsx(P2,{size:12}):s.jsx($d,{size:12}),i," ",a?"enabled":"not enabled"]})}function Po({active:a,fixed:i}){return s.jsx("span",{className:["inline-flex size-5 shrink-0 items-center justify-center border",i?"rounded-full":"rounded-[6px]",a?"border-[var(--color-purple)] bg-[var(--color-purple)] text-white":"border-[var(--color-line)] bg-white text-transparent"].join(" "),children:s.jsx(Jt,{size:13,strokeWidth:2.4})})}function Pj(a,i,r){return[...a].sort((u,d)=>{const m=Vv(u,i),h=Vv(d,i);return m!==h?h-m:r==="speed"?nS(u.latencyMs,d.latencyMs):r==="discount"?Number.parseInt(d.discount,10)-Number.parseInt(u.discount,10):d.healthScore-u.healthScore})}function Ij(a,i){const r=new Map;for(const d of a){const m=r.get(d.id)??{sellerIds:new Set,paymentMethods:new Set};m.sellerIds.add(d.sellerId);for(const h of d.paymentMethods)m.paymentMethods.add(h);r.set(d.id,m)}const u=new Map(i.map((d,m)=>[d,m]));return Array.from(r.entries()).map(([d,m])=>({id:d,paymentMethod:Array.from(m.paymentMethods)[0]??Te,enabled:m.sellerIds.size>0,sellerCount:m.sellerIds.size})).sort((d,m)=>{const h=u.get(d.id),x=u.get(m.id);return h!==void 0||x!==void 0?(h??9999)-(x??9999):d.id.localeCompare(m.id)})}function eS(a,i,r){const u=(i==null?void 0:i.data)??[],d=new Map(((i==null?void 0:i.sellers)??[]).map(h=>[h.id,h])),m=new Map(r.map(h=>[h.seller.id,h]));return a.map((h,x)=>{var A;const p=m.get(h.id),v=d.get(h.id),g=Array.from(new Set(u.filter(z=>z.sellerId===h.id).map(z=>z.id))),b=(p==null?void 0:p.metrics.ttftMs)??(p==null?void 0:p.metrics.avgLatencyMs),E=p==null?void 0:p.metrics.healthScore,C=(p==null?void 0:p.metrics.discountRatio)??(v==null?void 0:v.discountRatio);return{id:h.id,name:sS(h.name??(v==null?void 0:v.name)??h.id),endpoint:h.url,health:(v==null?void 0:v.status)==="error"||(v==null?void 0:v.status)==="manifest_unavailable"||h.status==="failed"?"offline":h.status==="degraded"?"degraded":"online",healthScore:Number.isFinite(E)?Math.round(E):0,coverageModelIds:g,paymentMethods:(v==null?void 0:v.paymentMethods)??h.paymentMethods??[],discount:a0(C),markupFee:yf(v==null?void 0:v.serviceFeeRatio),price:p?"preview":"registry",latencyMs:Number.isFinite(b)?Math.round(b):void 0,tokensPerSecond:void 0,notes:[((A=h.supportedProtocols)==null?void 0:A.join(", "))||"no protocols",`registry #${x+1}`]}})}function tS(a){if(a)return a.plan??{routes:a.routes,mode:a.mode,scorer:a.scorer,reason:a.reason}}function lS(a,i,r){var u,d;if(a.mode==="fixed"){const m={...a.fixedByModel??{}},h=((u=aS(i,r))==null?void 0:u.id)||((d=i[0])==null?void 0:d.id);return r&&!m[r]&&h&&(m[r]=h),{mode:"fixed",scorer:a.scorer,fixedByModel:m}}if(a.mode==="fixedSet"){const m=a.sellerIds&&a.sellerIds.length>0?a.sellerIds:i.filter(h=>!r||h.coverageModelIds.includes(r)).slice(0,2).map(h=>h.id);return{mode:"fixedSet",scorer:a.scorer,sellerIds:m}}return{mode:"fullAuto",scorer:a.scorer}}function aS(a,i){return a.find(r=>!i||r.coverageModelIds.includes(i))}function Vv(a,i){return i.length===0?a.coverageModelIds.length:i.filter(r=>a.coverageModelIds.includes(r)).length}function nS(a,i){const r=Number.isFinite(a),u=Number.isFinite(i);return r&&u?a-i:r?-1:u?1:0}function iS(a,i){var r;return a?((r=i.find(u=>u.id===a))==null?void 0:r.name)??a:"Not selected"}function rS(a){return Object.entries(a??{}).sort(([i],[r])=>i.localeCompare(r)).map(([i,r])=>`${i}:${r}`).join(",")}function sS(a){var i;return((i=a.split("(")[0])==null?void 0:i.trim())||a}function m0({value:a,onChange:i,placeholder:r}){return s.jsxs("label",{className:"flex items-center gap-2 rounded-[12px] border border-[var(--color-line-2)] bg-white px-3 py-2 text-[0.84rem] text-[var(--color-muted)]",children:[s.jsx(Fo,{size:15}),s.jsx("input",{name:"routing-search",value:a,onChange:u=>i(u.target.value),placeholder:r,className:"min-w-0 flex-1 bg-transparent font-mono text-[0.84rem] text-[var(--color-ink)] outline-none placeholder:text-[var(--color-faint)]"})]})}function h0(a,i){const r=a.trim().toLowerCase();return r?i.some(u=>u.toLowerCase().includes(r)):!0}function oS(a,i){return i?[...a].sort((r,u)=>r.id===i?-1:u.id===i?1:0):a}function p0(a){return a!==void 0}function v0({totalItems:a,pageSize:i,page:r,onPageChange:u,onPageSizeChange:d,pageSizeOptions:m=[25,50,100]}){const h=Math.max(1,Math.ceil(a/i)),x=j.useMemo(()=>uS(r,h),[r,h]);if(a===0)return null;const p=(r-1)*i+1,v=Math.min(r*i,a);return s.jsxs("div",{className:"flex flex-col gap-3 border-t border-[var(--color-line-2)] bg-[var(--color-page)]/60 px-4 py-3 text-[0.85rem] lg:flex-row lg:items-center lg:justify-between",children:[s.jsxs("div",{className:"text-[var(--color-muted)]",children:["Showing ",s.jsx("span",{className:"font-mono font-semibold text-[var(--color-ink)]",children:p}),"-",s.jsx("span",{className:"font-mono font-semibold text-[var(--color-ink)]",children:v})," of"," ",s.jsx("span",{className:"font-mono font-semibold text-[var(--color-ink)]",children:a})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("label",{className:"text-[0.78rem] text-[var(--color-muted)]",children:"Rows"}),s.jsx("select",{className:"bg-[var(--color-card)] border border-[var(--color-line-2)] rounded px-1.5 py-0.5 text-[0.85rem] text-[var(--color-ink)] focus:outline-none focus:border-[var(--color-purple)]",value:i,onChange:g=>{const b=Math.max(1,Number(g.target.value)||25);d==null||d(b),u(1)},children:m.map(g=>s.jsx("option",{value:g,children:g},g))}),s.jsxs("div",{className:"ml-2 flex items-center gap-1",children:[s.jsx("button",{type:"button",disabled:r<=1,onClick:()=>u(1),className:"px-2 py-0.5 rounded border border-[var(--color-line-2)] text-[var(--color-ink)] disabled:opacity-40 disabled:cursor-not-allowed hover:bg-[var(--color-lavender)]/40",title:"First page","aria-label":"First page",children:"«"}),s.jsx("button",{type:"button",disabled:r<=1,onClick:()=>u(r-1),className:"px-2 py-0.5 rounded border border-[var(--color-line-2)] text-[var(--color-ink)] disabled:opacity-40 disabled:cursor-not-allowed hover:bg-[var(--color-lavender)]/40",title:"Previous page","aria-label":"Previous page",children:"‹"}),x.map((g,b)=>g==="…"?s.jsx("span",{className:"px-1.5 text-[var(--color-muted)]",children:"…"},`gap-${b}`):s.jsx("button",{type:"button",onClick:()=>u(g),"aria-label":`Page ${g}`,"aria-current":g===r?"page":void 0,className:g===r?"px-2.5 py-0.5 rounded bg-[var(--color-purple)] text-white font-medium":"px-2.5 py-0.5 rounded border border-[var(--color-line-2)] text-[var(--color-ink)] hover:bg-[var(--color-lavender)]/40",children:g},g)),s.jsx("button",{type:"button",disabled:r>=h,onClick:()=>u(r+1),className:"px-2 py-0.5 rounded border border-[var(--color-line-2)] text-[var(--color-ink)] disabled:opacity-40 disabled:cursor-not-allowed hover:bg-[var(--color-lavender)]/40",title:"Next page","aria-label":"Next page",children:"›"}),s.jsx("button",{type:"button",disabled:r>=h,onClick:()=>u(h),className:"px-2 py-0.5 rounded border border-[var(--color-line-2)] text-[var(--color-ink)] disabled:opacity-40 disabled:cursor-not-allowed hover:bg-[var(--color-lavender)]/40",title:"Last page","aria-label":"Last page",children:"»"}),s.jsx("span",{className:"ml-2 text-[0.78rem] text-[var(--color-muted)]",children:"Go to"}),s.jsx("input",{type:"number",min:1,max:h,defaultValue:r,"aria-label":"Go to page",onKeyDown:g=>{if(g.key==="Enter"){const b=Math.max(1,Math.min(h,Number(g.target.value)||1));u(b)}},className:"w-14 bg-[var(--color-card)] border border-[var(--color-line-2)] rounded px-1.5 py-0.5 text-[0.85rem] text-[var(--color-ink)] text-center focus:outline-none focus:border-[var(--color-purple)]"}),s.jsx("span",{className:"text-[0.78rem] text-[var(--color-muted)]",children:"page"})]})]})]})}function uS(a,i){if(i<=7)return Array.from({length:i},(d,m)=>m+1);const r=[],u=d=>{r[r.length-1]!==d&&r.push(d)};u(1),a>4&&u("…");for(let d=Math.max(2,a-1);d<=Math.min(i-1,a+1);d++)u(d);return a<i-3&&u("…"),u(i),r}function cS(){var ge,M;const a=Wo(),i=sj(),[r,u]=j.useState("inferences"),[d,m]=j.useState(""),[h,x]=j.useState("all"),[p,v]=j.useState("all"),[g,b]=j.useState("all"),[E,C]=j.useState("all"),[A,z]=j.useState(1),[U,D]=j.useState(1),[G,K]=j.useState(25),[L,V]=j.useState(null),[I,J]=j.useState(null),ee=a.isLoading||i.isLoading,le=((ge=a.data)==null?void 0:ge.inferences)??[],oe=((M=i.data)==null?void 0:M.purchases)??[],F=d.trim().toLowerCase(),me=j.useMemo(()=>vS(le,oe),[le,oe]),pe=j.useMemo(()=>xS(le),[le]),Ee=j.useMemo(()=>yS(oe),[oe]),ue=j.useMemo(()=>le.filter(_=>h!=="all"&&_.status!==h||p!=="all"&&_.modelId!==p?!1:bS(_,F)).sort((_,Z)=>Z.createdAt.localeCompare(_.createdAt)),[le,p,h,F]),B=j.useMemo(()=>oe.filter(_=>g!=="all"&&_.status!==g||E!=="all"&&_.paymentMethod!==E?!1:gS(_,F)).sort((_,Z)=>Z.createdAt.localeCompare(_.createdAt)),[oe,E,g,F]),$=j.useMemo(()=>$v(ue,A,G),[ue,A,G]),re=j.useMemo(()=>$v(B,U,G),[B,U,G]),be=a.isError||i.isError;return j.useEffect(()=>{const _=Math.max(1,Math.ceil(ue.length/G));A>_&&z(_)},[ue.length,A,G]),j.useEffect(()=>{const _=Math.max(1,Math.ceil(B.length/G));U>_&&D(_)},[B.length,G,U]),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("section",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:[s.jsx(_o,{icon:s.jsx(X2,{className:"size-5"}),label:"Inference spend",value:st(me.inferenceSpendMicros,{digits:4}),detail:`${Ke(me.inferenceCount)} requests`,tone:"spend"}),s.jsx(_o,{icon:s.jsx(O2,{className:"size-5"}),label:"Token usage",value:pl(me.inputTokens+me.outputTokens),detail:$r(me.inputTokens,me.outputTokens),tone:"tokens"}),s.jsx(_o,{icon:s.jsx(vn,{className:"size-5"}),label:"Purchase credit",value:st(me.purchaseCreditMicros,{digits:4}),detail:`${Ke(me.settledPurchases)} settled`,tone:"credit"}),s.jsx(_o,{icon:s.jsx(w2,{className:"size-5"}),label:"Average response",value:xt(me.averageDurationMs),detail:"Completed inference time",tone:"latency"})]}),s.jsxs(St,{className:"overflow-hidden p-0",children:[s.jsxs("div",{className:"border-b border-[var(--color-line-2)] bg-white px-4 py-3",children:[s.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between",children:[s.jsx("div",{children:s.jsx("h1",{className:"text-[1.05rem] font-semibold text-[var(--color-ink)]",children:"Usage details"})}),s.jsxs("div",{className:"grid grid-cols-2 overflow-hidden rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] p-1",children:[s.jsx(Zv,{label:"Inferences",active:r==="inferences",count:ue.length,onClick:()=>u("inferences"),children:"Inferences"}),s.jsx(Zv,{label:"Purchases",active:r==="purchases",count:B.length,onClick:()=>u("purchases"),children:"Purchases"})]})]}),s.jsxs("div",{className:"mt-3 grid gap-2 lg:grid-cols-[minmax(220px,1fr)_160px_200px]",children:[s.jsxs("label",{className:"relative block",children:[s.jsx(Fo,{className:"pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-[var(--color-muted)]"}),s.jsx("input",{className:"h-9 w-full rounded-[8px] border border-[var(--color-line-2)] bg-white pl-9 pr-3 text-[0.86rem] text-[var(--color-ink)] outline-none transition placeholder:text-[var(--color-muted)] focus:border-[var(--color-purple)]",value:d,placeholder:r==="inferences"?"Search request, model, seller...":"Search purchase, method, seller...",onChange:_=>{m(_.target.value),z(1),D(1)}})]}),r==="inferences"?s.jsxs(s.Fragment,{children:[s.jsx(ko,{label:"Status",value:h,options:pe.statuses,onChange:_=>{x(_),z(1)}}),s.jsx(ko,{label:"Model",value:p,options:pe.models,onChange:_=>{v(_),z(1)}})]}):s.jsxs(s.Fragment,{children:[s.jsx(ko,{label:"Status",value:g,options:Ee.statuses,onChange:_=>{b(_),D(1)}}),s.jsx(ko,{label:"Method",value:E,options:Ee.methods,onChange:_=>{C(_),D(1)}})]})]})]}),be?s.jsx("div",{className:"border-b border-rose-100 bg-rose-50 px-4 py-3 text-[0.86rem] text-rose-700",children:"Ledger data could not be loaded. The local daemon may be offline or missing ledger endpoints."}):null,ee?s.jsx(pS,{}):r==="inferences"?s.jsx(dS,{entries:$,total:ue.length,page:A,pageSize:G,openId:L,onToggle:_=>V(L===_?null:_),onPageChange:z,onPageSizeChange:_=>{K(_),z(1),D(1)}}):s.jsx(fS,{entries:re,total:B.length,page:U,pageSize:G,openId:I,onToggle:_=>J(I===_?null:_),onPageChange:D,onPageSizeChange:_=>{K(_),z(1),D(1)}})]})]})}function _o({icon:a,label:i,value:r,detail:u,tone:d}){const m={spend:{card:"border-[#cceee6] bg-[#e8fbf7]",icon:"bg-white text-[#0f766e]",label:"text-[#0f766e]",value:"text-[#201a38]",accent:"bg-[#0f766e]"},tokens:{card:"border-[#d9e7ff] bg-[#eaf2ff]",icon:"bg-white text-[#2563eb]",label:"text-[#2563eb]",value:"text-[#201a38]",accent:"bg-[#2563eb]"},credit:{card:"border-[#dff8ec] bg-[#e8fff6]",icon:"bg-white text-emerald-700",label:"text-emerald-700",value:"text-[#201a38]",accent:"bg-emerald-500"},latency:{card:"border-[#f8d5de] bg-[#fff0f3]",icon:"bg-white text-[#ef5b78]",label:"text-[#ef5b78]",value:"text-[#201a38]",accent:"bg-[#ef5b78]"}}[d];return s.jsxs(St,{className:["relative flex min-h-[7rem] items-center gap-4 overflow-hidden px-4 py-4",m.card].join(" "),children:[s.jsx("div",{className:["absolute inset-y-0 left-0 w-1",m.accent].join(" ")}),s.jsx("div",{className:["grid size-11 shrink-0 place-items-center rounded-[10px] shadow-sm",m.icon].join(" "),children:a}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:["text-[0.72rem] font-bold uppercase tracking-[0.08em]",m.label].join(" "),children:i}),s.jsx("div",{className:["mt-1 truncate font-mono text-[1.55rem] font-bold leading-none tracking-normal",m.value].join(" "),children:r}),s.jsx("div",{className:"mt-2 truncate text-[0.76rem] font-medium text-[var(--color-muted)]",children:u})]})]})}function Zv({label:a,active:i,count:r,onClick:u,children:d}){return s.jsxs("button",{type:"button",onClick:u,"aria-label":`${a} ledger records, ${Ke(r)} records`,className:["inline-flex h-8 items-center justify-center gap-2 rounded-[8px] px-3 text-[0.82rem] font-semibold transition",i?"bg-white text-[var(--color-ink)] shadow-sm":"text-[var(--color-muted)] hover:text-[var(--color-ink)]"].join(" "),children:[s.jsx("span",{children:d}),s.jsx("span",{className:"font-mono text-[0.76rem]",children:Ke(r)})]})}function ko({label:a,value:i,options:r,onChange:u}){return s.jsxs("label",{className:"grid gap-1",children:[s.jsx("span",{className:"sr-only",children:a}),s.jsxs("select",{"aria-label":a,className:"h-9 rounded-[8px] border border-[var(--color-line-2)] bg-white px-3 text-[0.86rem] text-[var(--color-ink)] outline-none transition focus:border-[var(--color-purple)]",value:i,onChange:d=>u(d.target.value),children:[s.jsxs("option",{value:"all",children:["All ",a.toLowerCase()]}),r.map(d=>s.jsx("option",{value:d,children:d},d))]})]})}function dS({entries:a,total:i,page:r,pageSize:u,openId:d,onToggle:m,onPageChange:h,onPageSizeChange:x}){return i===0?s.jsx(g0,{label:"inference records"}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"divide-y divide-[var(--color-line-2)] bg-white xl:hidden",children:a.map(p=>s.jsx(mS,{entry:p,open:d===p.requestId,onToggle:()=>m(p.requestId)},p.requestId))}),s.jsx("div",{className:"hidden min-w-0 max-w-full overflow-x-auto xl:block",children:s.jsxs("table",{className:"w-full min-w-[1080px] text-[0.86rem]",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"bg-[var(--color-page)]/70 text-left text-[0.7rem] font-semibold uppercase tracking-[0.08em] text-[var(--color-muted)]",children:[s.jsx("th",{className:"px-4 py-2.5",children:"TIME"}),s.jsx("th",{className:"px-4 py-2.5",children:"REQ"}),s.jsx("th",{className:"px-4 py-2.5",children:"MODEL"}),s.jsx("th",{className:"px-4 py-2.5",children:"SELLER"}),s.jsx("th",{className:"px-4 py-2.5 text-right",children:"TOKEN"}),s.jsx("th",{className:"px-4 py-2.5 text-right",children:"COST"}),s.jsx("th",{className:"px-4 py-2.5 text-right",children:"TTFT"}),s.jsx("th",{className:"px-4 py-2.5 text-right",children:"TOTAL"}),s.jsx("th",{className:"px-4 py-2.5",children:"STATUS"})]})}),a.map(p=>s.jsxs("tbody",{children:[s.jsxs("tr",{onClick:()=>m(p.requestId),className:"cursor-pointer border-t border-[var(--color-line-2)] transition hover:bg-[var(--color-lavender)]/25",children:[s.jsx("td",{className:"whitespace-nowrap px-4 py-3 font-mono text-[0.76rem] text-[var(--color-muted)]",children:r0(p.createdAt)}),s.jsx("td",{className:"px-4 py-3",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Io,{tone:"purple",children:s.jsx(Zx,{className:"size-4"})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"max-w-[180px] truncate font-mono text-[0.78rem] font-semibold text-[var(--color-ink)]",children:p.requestId}),s.jsx("div",{className:"mt-0.5 max-w-[180px] truncate text-[0.72rem] text-[var(--color-muted)]",children:p.endpoint})]})]})}),s.jsx("td",{className:"max-w-[190px] truncate px-4 py-3 text-[var(--color-ink)]",children:p.modelId}),s.jsx("td",{className:"px-4 py-3 font-mono text-[0.78rem] text-[var(--color-text)]",children:p.sellerKey}),s.jsxs("td",{className:"px-4 py-3 text-right font-mono text-[0.82rem]",children:[s.jsx("div",{children:Ke(p.promptTokens)}),s.jsx("div",{className:"text-[0.72rem] text-[var(--color-muted)]",children:Ke(p.completionTokens)})]}),s.jsx("td",{className:"px-4 py-3 text-right font-mono text-[0.82rem] font-semibold text-[var(--color-ink)]",children:st(p.billedMicros,{ledger:!0})}),s.jsx("td",{className:"px-4 py-3 text-right font-mono text-[0.82rem] text-[var(--color-muted)]",children:xt(p.ttftMs)}),s.jsx("td",{className:"px-4 py-3 text-right font-mono text-[0.82rem] text-[var(--color-muted)]",children:xt(p.durationMs)}),s.jsx("td",{className:"px-4 py-3",children:s.jsx(rs,{tone:Ka(p.status),children:Rl(p.status)})})]}),d===p.requestId?s.jsx("tr",{children:s.jsx("td",{colSpan:9,className:"border-t border-[var(--color-line-2)] bg-[var(--color-page)]/70 px-5 py-4",children:s.jsx(x0,{entry:p})})}):null]},p.requestId))]})}),s.jsx(v0,{totalItems:i,pageSize:u,page:r,onPageChange:h,onPageSizeChange:x})]})}function fS({entries:a,total:i,page:r,pageSize:u,openId:d,onToggle:m,onPageChange:h,onPageSizeChange:x}){return i===0?s.jsx(g0,{label:"purchase records"}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"divide-y divide-[var(--color-line-2)] bg-white xl:hidden",children:a.map(p=>s.jsx(hS,{entry:p,open:d===p.purchaseId,onToggle:()=>m(p.purchaseId)},p.purchaseId))}),s.jsx("div",{className:"hidden min-w-0 max-w-full overflow-x-auto xl:block",children:s.jsxs("table",{className:"w-full min-w-[980px] text-[0.86rem]",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"bg-[var(--color-page)]/70 text-left text-[0.7rem] font-semibold uppercase tracking-[0.08em] text-[var(--color-muted)]",children:[s.jsx("th",{className:"px-4 py-2.5",children:"When"}),s.jsx("th",{className:"px-4 py-2.5",children:"Purchase"}),s.jsx("th",{className:"px-4 py-2.5",children:"Payment method"}),s.jsx("th",{className:"px-4 py-2.5",children:"Model"}),s.jsx("th",{className:"px-4 py-2.5",children:"Seller"}),s.jsx("th",{className:"px-4 py-2.5 text-right",children:"Credit"}),s.jsx("th",{className:"px-4 py-2.5",children:"Status"})]})}),a.map(p=>s.jsxs("tbody",{children:[s.jsxs("tr",{onClick:()=>m(p.purchaseId),className:"cursor-pointer border-t border-[var(--color-line-2)] transition hover:bg-[var(--color-lavender)]/25",children:[s.jsx("td",{className:"whitespace-nowrap px-4 py-3 font-mono text-[0.76rem] text-[var(--color-muted)]",children:r0(p.createdAt)}),s.jsx("td",{className:"px-4 py-3",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Io,{tone:"green",children:s.jsx(Hi,{className:"size-4"})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"max-w-[210px] truncate font-mono text-[0.78rem] font-semibold text-[var(--color-ink)]",children:p.purchaseId}),s.jsx("div",{className:"mt-0.5 max-w-[210px] truncate text-[0.72rem] text-[var(--color-muted)]",children:Jr(p.paymentReferenceHash)})]})]})}),s.jsx("td",{className:"px-4 py-3 text-[var(--color-ink)]",children:p.paymentMethod}),s.jsx("td",{className:"max-w-[180px] truncate px-4 py-3 text-[var(--color-ink)]",children:p.modelId}),s.jsx("td",{className:"px-4 py-3 font-mono text-[0.78rem] text-[var(--color-text)]",children:p.sellerKey}),s.jsx("td",{className:"px-4 py-3 text-right font-mono text-[0.82rem] font-semibold text-emerald-700",children:st(p.creditMicros,{digits:4,signed:!0})}),s.jsx("td",{className:"px-4 py-3",children:s.jsx(rs,{tone:Ka(p.status),children:Rl(p.status)})})]}),d===p.purchaseId?s.jsx("tr",{children:s.jsx("td",{colSpan:7,className:"border-t border-[var(--color-line-2)] bg-[var(--color-page)]/70 px-5 py-4",children:s.jsx(y0,{entry:p})})}):null]},p.purchaseId))]})}),s.jsx(v0,{totalItems:i,pageSize:u,page:r,onPageChange:h,onPageSizeChange:x})]})}function mS({entry:a,open:i,onToggle:r}){return s.jsxs("article",{className:"px-4 py-3",children:[s.jsx("button",{type:"button",onClick:r,"aria-expanded":i,"aria-label":`Inference ${a.requestId}`,className:"block w-full text-left",children:s.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[s.jsx(Io,{tone:"purple",children:s.jsx(Zx,{className:"size-4"})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex min-w-0 flex-wrap items-start justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"truncate font-mono text-[0.84rem] font-semibold text-[var(--color-ink)]",title:a.requestId,children:a.requestId}),s.jsx("div",{className:"mt-0.5 truncate text-[0.72rem] text-[var(--color-muted)]",title:a.endpoint,children:a.endpoint})]}),s.jsx(rs,{tone:Ka(a.status),children:Rl(a.status)})]}),s.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 sm:grid-cols-4",children:[s.jsx(gt,{label:"Time",value:vl(a.createdAt),compact:!0}),s.jsx(gt,{label:"Model",value:a.modelId}),s.jsx(gt,{label:"Seller",value:a.sellerKey}),s.jsx(gt,{label:"Cost",value:st(a.billedMicros,{ledger:!0}),tone:"strong"}),s.jsx(gt,{label:"In",value:Ke(a.promptTokens)}),s.jsx(gt,{label:"Out",value:Ke(a.completionTokens)}),s.jsx(gt,{label:"TTFT",value:xt(a.ttftMs)}),s.jsx(gt,{label:"Total",value:xt(a.durationMs)}),s.jsx(gt,{label:"Route",value:a.routeReason??Te})]})]})]})}),i?s.jsx("div",{className:"mt-3 rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-3",children:s.jsx(x0,{entry:a})}):null]})}function hS({entry:a,open:i,onToggle:r}){return s.jsxs("article",{className:"px-4 py-3",children:[s.jsx("button",{type:"button",onClick:r,"aria-expanded":i,"aria-label":`Purchase ${a.purchaseId}`,className:"block w-full text-left",children:s.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[s.jsx(Io,{tone:"green",children:s.jsx(Hi,{className:"size-4"})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex min-w-0 flex-wrap items-start justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"truncate font-mono text-[0.84rem] font-semibold text-[var(--color-ink)]",title:a.purchaseId,children:a.purchaseId}),s.jsx("div",{className:"mt-0.5 truncate text-[0.72rem] text-[var(--color-muted)]",title:a.paymentReferenceHash??void 0,children:Jr(a.paymentReferenceHash)})]}),s.jsx(rs,{tone:Ka(a.status),children:Rl(a.status)})]}),s.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 sm:grid-cols-4",children:[s.jsx(gt,{label:"Time",value:vl(a.createdAt),compact:!0}),s.jsx(gt,{label:"Method",value:a.paymentMethod}),s.jsx(gt,{label:"Model",value:a.modelId}),s.jsx(gt,{label:"Seller",value:a.sellerKey}),s.jsx(gt,{label:"Credit",value:st(a.creditMicros,{digits:4,signed:!0}),tone:"green"}),s.jsx(gt,{label:"Currency",value:a.currency}),s.jsx(gt,{label:"Completed",value:vl(a.completedAt),compact:!0})]})]})]})}),i?s.jsx("div",{className:"mt-3 rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-3",children:s.jsx(y0,{entry:a})}):null]})}function gt({label:a,value:i,tone:r="default",compact:u=!1}){return s.jsxs("div",{className:"min-w-0 rounded-[9px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-2.5 py-2",children:[s.jsx("div",{className:"text-[0.62rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:a}),s.jsx("div",{className:["mt-1 truncate font-mono font-semibold",u?"text-[0.7rem]":"text-[0.84rem]",r==="green"?"text-emerald-700":r==="strong"?"text-[var(--color-ink)]":"text-[var(--color-text)]"].join(" "),title:i,children:i})]})}function Io({tone:a,children:i}){return s.jsx("div",{className:["grid size-9 shrink-0 place-items-center rounded-lg border",a==="purple"?"border-[var(--color-lavender-2)] bg-[var(--color-lavender)] text-[var(--color-purple)]":"border-emerald-100 bg-emerald-50 text-emerald-700"].join(" "),children:i})}function x0({entry:a}){return s.jsx(b0,{rows:[["Request ID",a.requestId],["Created",vl(a.createdAt)],["Endpoint",a.endpoint],["Payment method",a.paymentMethod??Te],["Route",`${a.routeReason??Te} -> ${a.sellerKey}`],["Fallback chain",a.falloverChain&&a.falloverChain.length>0?a.falloverChain.join(" -> "):Te],["Upstream status",Rl(a.upstreamStatus)],["TTFT / total",`${xt(a.ttftMs)} / ${xt(a.durationMs)}`],["Input / output tokens",dj(a.promptTokens,a.completionTokens)],["Billed",st(a.billedMicros,{ledger:!0})],["Balance after",st(a.balanceSnapshotMicros,{digits:4})],["Prompt hash",Jr(a.promptHash)],["Response hash",Jr(a.responseHash)],["Price version",a.priceVersion??Te]]})}function y0({entry:a}){return s.jsx(b0,{rows:[["Purchase ID",a.purchaseId],["Created",vl(a.createdAt)],["Completed",vl(a.completedAt)],["Payment method",a.paymentMethod],["Payment reference",Jr(a.paymentReferenceHash)],["Credit",st(a.creditMicros,{digits:4})],["Credit micros",Ke(a.creditMicros)],["Currency",a.currency],["Seller",a.sellerKey],["Model",a.modelId]]})}function b0({rows:a}){return s.jsx("div",{className:"grid gap-x-4 gap-y-2 text-[0.84rem] sm:grid-cols-[150px_minmax(0,1fr)]",children:a.map(([i,r])=>s.jsxs("div",{className:"contents",children:[s.jsx("div",{className:"text-[var(--color-muted)]",children:i}),s.jsx("div",{className:"min-w-0 break-all font-mono text-[0.8rem] text-[var(--color-ink)]",children:r})]},i))})}function pS(){return s.jsx("div",{className:"space-y-2 px-4 py-4",children:Array.from({length:7},(a,i)=>s.jsx("div",{className:"h-12 rounded-lg bg-[var(--color-lavender)]/35"},i))})}function g0({label:a}){return s.jsxs("div",{className:"flex min-h-[220px] flex-col items-center justify-center px-6 py-10 text-center",children:[s.jsx("div",{className:"grid size-12 place-items-center rounded-xl border border-[var(--color-line-2)] bg-[var(--color-page)] text-[var(--color-purple)]",children:s.jsx(Fo,{className:"size-5"})}),s.jsxs("div",{className:"mt-4 font-semibold text-[var(--color-ink)]",children:["No matching ",a]}),s.jsx("div",{className:"mt-1 max-w-[360px] text-[0.86rem] text-[var(--color-muted)]",children:"Adjust the query or filters to inspect another slice of the local ledger."})]})}function vS(a,i){const r=a.reduce((p,v)=>p+(v.billedMicros??0),0),u=i.reduce((p,v)=>p+v.creditMicros,0),d=a.reduce((p,v)=>p+(v.promptTokens??0),0),m=a.reduce((p,v)=>p+(v.completionTokens??0),0),h=a.map(p=>p.durationMs).filter(p=>p!==void 0),x=h.length===0?void 0:h.reduce((p,v)=>p+v,0)/h.length;return{inferenceCount:a.length,inferenceSpendMicros:r,purchaseCreditMicros:u,inputTokens:d,outputTokens:m,settledPurchases:i.filter(p=>jS(p.status)).length,averageDurationMs:x}}function xS(a){return{statuses:Xo(a.map(i=>i.status)),models:Xo(a.map(i=>i.modelId))}}function yS(a){return{statuses:Xo(a.map(i=>i.status)),methods:Xo(a.map(i=>i.paymentMethod))}}function Xo(a){return Array.from(new Set(a.filter(Boolean))).sort((i,r)=>i.localeCompare(r))}function bS(a,i){return i?[a.requestId,a.sellerKey,a.modelId,a.endpoint,a.status,a.paymentMethod,a.routeReason,a.upstreamStatus].some(r=>r==null?void 0:r.toLowerCase().includes(i)):!0}function gS(a,i){return i?[a.purchaseId,a.sellerKey,a.modelId,a.paymentMethod,a.status,a.currency,a.paymentReferenceHash].some(r=>r==null?void 0:r.toLowerCase().includes(i)):!0}function $v(a,i,r){const u=(i-1)*r;return a.slice(u,u+r)}function jS(a){return a==="settled"||a==="active"||a==="completed"||a==="success"}function SS(){return xl({queryKey:["init","state"],queryFn:()=>yl("/init/state"),refetchInterval:1e4})}async function NS(a){return Xa("POST","/init/complete",void 0)}function MS(){return Yi({mutationFn:()=>Xa("POST","/init/doctor/run")})}function wS(){return xl({queryKey:["providers","status"],queryFn:()=>yl("/providers/status"),refetchInterval:1e4})}function CS(){return Yi({mutationFn:a=>Xa("POST","/providers/install/preview",a)})}function TS(){const a=is();return Yi({mutationFn:i=>Xa("POST","/providers/install/apply",i),onSuccess:()=>{a.invalidateQueries({queryKey:["providers","status"]}),a.invalidateQueries({queryKey:["init","state"]})}})}const ES=[{value:"fullAuto",title:"全自动",body:"自动选择可用供应商。"},{value:"fixedSet",title:"固定供应商组",body:"在指定供应商组内切换。"},{value:"fixed",title:"固定供应商",body:"始终使用指定供应商。"}],AS=[{value:"balanced",title:"平衡模式",body:"综合速度、价格、健康度、余额。"},{value:"speed",title:"速度优先",body:"优先选择更快、吞吐量更高供应商。"},{value:"discount",title:"成本优先",body:"优先选择更低成本供应商。"}],Jv=[{index:1,label:"选择模型",value:"默认模型"},{index:2,label:"绑定钱包",value:"支付方式"},{index:3,label:"配置策略",value:"路由规则"},{index:4,label:"配置工具",value:"终端接入"}],zS=[{method:"wechat-pay",name:"WeChat Pay",detail:"微信支付入口预留"},{method:"alipay-agent",name:"Alipay Agent Payment",detail:"代理支付入口预留"},{method:"coinbase-smart-wallet",name:"Coinbase Smart Wallet",detail:"USDC 钱包入口预留"}],RS=["GPT","Claude","Gemini","DeepSeek","Kimi","Qwen","MiniMax","GLM","Doubao","Grok"];function OS(a){const i=new URLSearchParams(a);return i.has("verifyPaymentMethods")?2:(i.has("verifyPickerDom")||i.has("verifyNoIntro")||i.has("verifyCompact"),1)}function _S(){var fs,ms,hs,$a,Ja,Fa,Sl,Wa,oa,ps,Ki,On;const[a,i]=j.useState(()=>OS(typeof window>"u"?"":window.location.search)),[r,u]=j.useState([]),[d,m]=j.useState(!1),[h,x]=j.useState(),[p,v]=j.useState(!1),[g,b]=j.useState(!1),[E,C]=j.useState("fullAuto"),[A,z]=j.useState("balanced"),[U,D]=j.useState(""),[G,K]=j.useState([]),[L,V]=j.useState(),[I,J]=j.useState(""),[ee,le]=j.useState([]),[oe,F]=j.useState({}),[me,pe]=j.useState(),[Ee,ue]=j.useState(),[B,$]=j.useState(!1),[re,be]=j.useState(null),[ge,M]=j.useState(!1),[_,Z]=j.useState(),P=SS(),X=l0(),ae=e0(),W=Fx(),Ae=wS(),Oe=Wx(),bl=Px(),ia=CS(),En=TS(),At=MS(),ft=xf(),An=Wo(),ra=j.useMemo(()=>{var ie;return BS(((ie=ft.data)==null?void 0:ie.data)??[])},[(fs=ft.data)==null?void 0:fs.data]),tu=j.useMemo(()=>{var ie,Qe,Lt;return IS(((ie=ft.data)==null?void 0:ie.sellers)??[],((Qe=ft.data)==null?void 0:Qe.data)??[],((Lt=An.data)==null?void 0:Lt.inferences)??[])},[(ms=An.data)==null?void 0:ms.inferences,(hs=ft.data)==null?void 0:hs.data,($a=ft.data)==null?void 0:$a.sellers]),zn=j.useMemo(()=>{var ie;return HS(ra,r,((ie=P.data)==null?void 0:ie.recommendedModels)??[])},[(Ja=P.data)==null?void 0:Ja.recommendedModels,ra,r]),gl=j.useMemo(()=>r.length>0?r:zn.map(ie=>ie.id),[zn,r]),Va=`http://127.0.0.1:${((Fa=X.data)==null?void 0:Fa.proxyPort)??((Sl=P.data)==null?void 0:Sl.runtime.proxyPort)??17821}`,sa=j.useMemo(()=>{var ie;return(((ie=Ae.data)==null?void 0:ie.clients)??[]).filter(Qe=>Qe.id!=="custom"&&Qe.detected)},[(Wa=Ae.data)==null?void 0:Wa.clients]),ss=((oa=W.data)==null?void 0:oa.payments.filter(ie=>ie.enabled&&eu(ie.method)!=="mock"))??[],os=j.useMemo(()=>iN(E,A,U,G),[U,G,E,A]),Nt=rN({serviceReady:((ps=X.data)==null?void 0:ps.status)==="running",modelCount:ra.length,routingMode:E,paymentReady:ss.length>0,configuredTools:((Ki=Ae.data)==null?void 0:Ki.summary.configuredCount)??0}),lu=((On=At.data)==null?void 0:On.checks.map(sN))??Nt;j.useEffect(()=>{p||!P.data||(u(P.data.focusSet),v(!0))},[P.data,p]),j.useEffect(()=>{I||r.length===0||J(r[0])},[I,r]),j.useEffect(()=>{g||sa.length===0||(le(sa.filter(ie=>!ie.configured).map(ie=>ie.id)),b(!0))},[g,sa]),j.useEffect(()=>{a!==5||At.data||At.error||At.isPending||At.mutate()},[a,At]),j.useEffect(()=>{var Lt;const ie=ua=>{ua.preventDefault(),be(ua),Z("浏览器已经允许直接安装 TokenBuddy。")},Qe=()=>{M(!0),be(null),Z("TokenBuddy 桌面应用已安装。")};return window.addEventListener("beforeinstallprompt",ie),window.addEventListener("appinstalled",Qe),(Lt=window.matchMedia)!=null&&Lt.call(window,"(display-mode: standalone)").matches&&M(!0),()=>{window.removeEventListener("beforeinstallprompt",ie),window.removeEventListener("appinstalled",Qe)}},[]);const us=ie=>{x(void 0),u(Qe=>Qe.includes(ie)?Qe.filter(Lt=>Lt!==ie):[...Qe,ie])},cs=async()=>{m(!0),x(void 0);try{await Lo(r),x("关注模型已保存。后续工具配置会优先参考这些模型。")}catch(ie){x(`保存失败:${ie instanceof Error?ie.message:String(ie)}`)}finally{m(!1)}},Rn=async()=>{if(V(void 0),!os){V(E==="fixed"?"请选择一个固定供应商。":"请至少选择一个供应商。");return}try{await ae.mutateAsync(os),V("供应商路由策略已保存。"),i(4)}catch(ie){V(`保存失败:${ie instanceof Error?ie.message:String(ie)}`)}},au=async()=>{try{await Oe.mutateAsync()}catch{}},ds=async()=>{try{await bl.mutateAsync()}catch{}},nu=async()=>{pe(void 0);const ie=I||gl[0];if(!ie){pe("请先选择一个默认模型。");return}if(ee.length===0){pe("请选择至少一个要安装的终端工具。");return}try{await ia.mutateAsync({providers:ee,proxyUrl:Va,model:ie,providerSelections:tx(ee,oe,gl,ie)}),pe("已生成安装预览。确认无误后可以写入配置。")}catch(Qe){pe(`预览失败:${Qe instanceof Error?Qe.message:String(Qe)}`)}},iu=async()=>{pe(void 0);const ie=I||gl[0];if(!ie){pe("请先选择一个默认模型。");return}if(ee.length===0){pe("请选择至少一个要安装的终端工具。");return}try{const Qe=await En.mutateAsync({providers:ee,proxyUrl:Va,model:ie,providerSelections:tx(ee,oe,gl,ie)});pe(`已写入 ${Qe.applied.length} 个配置文件。`),i(5)}catch(Qe){pe(`安装失败:${Qe instanceof Error?Qe.message:String(Qe)}`)}},Za=()=>{X.refetch(),P.refetch(),W.refetch(),Ae.refetch(),ft.refetch(),At.mutate()},Mt=async()=>{ue(void 0),$(!0);try{await NS(),ue("初始化已标记完成。你可以把 TokenBuddy 安装成桌面应用,之后从系统应用入口打开。"),P.refetch()}catch(ie){ue(`完成失败:${ie instanceof Error?ie.message:String(ie)}`)}finally{$(!1)}},jl=async()=>{if(!re){Z("请在浏览器地址栏右侧或菜单里选择“安装应用”。");return}try{Z(void 0),await re.prompt();const ie=await re.userChoice;if(be(null),ie.outcome==="accepted"){M(!0),Z("TokenBuddy 桌面应用已安装。");return}Z("你可以稍后继续使用浏览器安装入口。")}catch(ie){Z(`安装未完成:${ie instanceof Error?ie.message:String(ie)}`)}},wt=(()=>{var ie,Qe,Lt,ua,Xi,_n,kn,Vi,Zi;return a<=1?s.jsx(DS,{commonModels:zn,allModels:ra,loading:ft.isLoading,error:ft.error,selectedModels:r,saving:d,saveMessage:h,onToggleModel:us,onSave:cs,onContinue:()=>i(2)}):a===2?s.jsx(ZS,{payments:((ie=W.data)==null?void 0:ie.payments)??[],enabledPaymentCount:ss.length,loading:W.isLoading,qrUrl:(Qe=Oe.data)==null?void 0:Qe.qrImageUrl,rechargeQrUrl:(Lt=bl.data)==null?void 0:Lt.qrImageUrl,walletConfigPresent:(ua=Oe.data)==null?void 0:ua.walletConfigPresent,error:Oe.error,rechargeError:bl.error,binding:Oe.isPending,rechargeLoading:bl.isPending,onBind:au,onLoadRecharge:ds,onRefreshPayments:()=>{W.refetch()},onBack:()=>i(1),onContinue:()=>i(3)}):a===3?s.jsx(XS,{mode:E,scorer:A,sellers:tu,fixedSellerId:U,fixedSetSellerIds:G,saving:ae.isPending,message:L,onModeChange:C,onScorerChange:z,onFixedSellerChange:D,onToggleFixedSetSeller:ot=>{K(Ye=>Ye.includes(ot)?Ye.filter(et=>et!==ot):[...Ye,ot])},onSave:Rn,onBack:()=>i(2)}):a===4?s.jsx(JS,{clients:((Xi=Ae.data)==null?void 0:Xi.clients)??[],candidates:sa,loading:Ae.isLoading,selectedProviders:ee,selectedModel:I||gl[0]||"",modelOptions:gl,providerSelections:oe,proxyUrl:Va,previewChanges:(_n=ia.data)==null?void 0:_n.changes,applying:En.isPending,previewing:ia.isPending,message:me,onToggleProvider:ot=>{le(Ye=>Ye.includes(ot)?Ye.filter(et=>et!==ot):[...Ye,ot])},onModelChange:J,onProviderSelectionChange:(ot,Ye)=>{F(et=>({...et,[ot]:Ye}))},onPreview:nu,onInstall:iu,onBack:()=>i(3)}):a===5?s.jsx(WS,{items:lu,status:(kn=At.data)==null?void 0:kn.status,generatedAt:(Vi=At.data)==null?void 0:Vi.generatedAt,running:At.isPending,error:At.error,onRefresh:Za,onBack:()=>i(4),onContinue:()=>i(6)}):s.jsx(PS,{complete:((Zi=P.data)==null?void 0:Zi.setup.status)==="completed",message:Ee,installMessage:_,canInstall:!!re,installed:ge,saving:B,onBack:()=>i(5),onComplete:Mt,onInstall:jl})})();return s.jsxs("div",{className:"min-w-0 space-y-3",children:[s.jsx(kS,{activeStep:a,onSelect:i}),s.jsx("div",{className:"min-w-0",children:wt})]})}function kS({activeStep:a,onSelect:i}){return s.jsx("nav",{"aria-label":"初始化步骤",className:"rounded-[12px] border border-[var(--color-line-2)] bg-white p-2.5 shadow-[0_8px_22px_rgba(60,41,112,0.045)]",children:s.jsx("div",{className:"flex items-stretch gap-2 overflow-x-auto",children:Jv.map(r=>{const u=a===r.index,d=a>r.index;return s.jsxs(j.Fragment,{children:[s.jsxs("button",{type:"button",onClick:()=>i(r.index),"aria-current":u?"step":void 0,className:["relative flex min-w-[190px] flex-1 items-center gap-2 rounded-[8px] px-3 py-2 text-left transition",u?"bg-[var(--color-lavender)] ring-1 ring-[var(--color-lavender-2)]":"hover:bg-[var(--color-page)]"].join(" "),children:[s.jsx("span",{className:["grid size-6 shrink-0 place-items-center rounded-full border bg-white",u?"border-[var(--color-purple)] text-[var(--color-purple)] shadow-[0_0_0_3px_rgba(124,61,240,0.1)]":"",d?"border-emerald-200 bg-emerald-50 text-emerald-700":"",!u&&!d?"border-[var(--color-line-2)] text-[var(--color-muted)]":""].join(" "),children:d?s.jsx(Jt,{className:"size-3.5"}):s.jsx("span",{className:"size-1.5 rounded-full bg-current"})}),s.jsxs("span",{className:"min-w-0",children:[s.jsxs("span",{className:["block font-mono text-[0.62rem] font-black uppercase tracking-[0.08em]",u?"text-[var(--color-purple)]":"text-[var(--color-muted)]"].join(" "),children:["STEP ",r.index,":"]}),s.jsx("span",{className:["mt-0.5 block text-[0.82rem] font-semibold",u?"text-[var(--color-purple)]":"text-[var(--color-ink)]"].join(" "),children:r.label}),s.jsx("span",{className:"block truncate text-[0.7rem] text-[var(--color-muted)]",children:r.value})]})]}),r.index<Jv.length?s.jsx("div",{className:"hidden min-w-8 items-center justify-center text-[var(--color-purple)]/70 sm:flex",children:s.jsx(Jo,{className:"size-5",strokeWidth:2.6})}):null]},r.index)})})})}function Gi({index:a,title:i,detail:r,meta:u,action:d}){return s.jsxs("div",{className:"flex flex-col gap-2.5 border-b border-[var(--color-line-2)] pb-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsx("div",{className:"min-w-0",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:"rounded-[7px] bg-[var(--color-lavender)] px-2 py-0.5 font-mono text-[0.68rem] font-semibold text-[var(--color-purple)]",children:String(a).padStart(2,"0")}),s.jsx("div",{className:"text-[0.92rem] font-semibold text-[var(--color-ink)]",children:i}),r?s.jsx("span",{className:"text-[0.74rem] text-[var(--color-muted)]",children:r}):null,u?s.jsx("span",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5 font-mono text-[0.68rem] text-[var(--color-muted)]",children:u}):null]})}),d?s.jsx("div",{className:"shrink-0",children:d}):null]})}function DS({commonModels:a,allModels:i,loading:r,error:u,selectedModels:d,saving:m,saveMessage:h,onToggleModel:x,onSave:p,onContinue:v}){const[g,b]=j.useState(!1),E=d.map(C=>i.find(A=>A.id===C)??{id:C,sellerCount:0,protocols:[],paymentMethods:[]});return s.jsxs("div",{className:"space-y-3",children:[s.jsxs(St,{className:"p-3",children:[s.jsx(Gi,{index:1,title:"模型访问",detail:"默认和高频模型",meta:`${d.length} selected`,action:s.jsxs("button",{type:"button",disabled:r||!!u,onClick:()=>b(!0),className:"inline-flex h-8 shrink-0 items-center justify-center gap-1.5 rounded-[8px] bg-[var(--color-purple)] px-2.5 text-[0.78rem] font-semibold text-white transition hover:bg-[var(--color-purple-2)] disabled:cursor-not-allowed disabled:opacity-45",children:[s.jsx(Jd,{className:"size-3.5"}),"添加模型"]})}),u?s.jsxs("div",{className:"mt-3 rounded-[10px] bg-rose-50 px-3 py-2 text-[0.84rem] leading-6 text-rose-700",children:["模型目录加载失败:",u instanceof Error?u.message:String(u)]}):null,E.length===0?s.jsxs("button",{type:"button",disabled:r||!!u,onClick:()=>b(!0),className:"mt-3 flex min-h-[72px] w-full items-center gap-3 rounded-[10px] border border-dashed border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-3 text-left transition hover:border-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:[s.jsx("span",{className:"grid size-8 shrink-0 place-items-center rounded-[8px] bg-white text-[var(--color-purple)]",children:s.jsx(Jd,{className:"size-4"})}),s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:"block text-[0.86rem] font-semibold text-[var(--color-ink)]",children:"添加可能使用到的模型"}),s.jsx("span",{className:"mt-0.5 block text-[0.76rem] text-[var(--color-muted)]",children:"至少选择一个模型后才能保存并继续。"})]})]}):s.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:E.map(C=>s.jsxs("div",{className:"inline-flex min-h-9 max-w-full items-center gap-2 rounded-[9px] border border-[var(--color-lavender-2)] bg-[var(--color-lavender)] px-3 py-1.5",children:[s.jsx("span",{className:"truncate font-mono text-[0.82rem] font-semibold text-[var(--color-purple)]",children:C.id}),s.jsx("span",{className:"rounded-full bg-white/70 px-2 py-0.5 text-[0.68rem] font-semibold text-emerald-700",children:"可用"}),s.jsx("button",{type:"button",onClick:()=>x(C.id),className:"inline-flex size-5 items-center justify-center rounded-[6px] text-[var(--color-purple)]/70 hover:bg-white hover:text-[var(--color-purple)]","aria-label":`Remove ${C.id}`,children:s.jsx(Zr,{className:"size-3"})})]},C.id))}),s.jsxs("div",{className:"mt-3 flex flex-col gap-2.5 border-t border-[var(--color-line-2)] pt-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsxs("div",{className:"min-h-5 text-[0.8rem] leading-5 text-[var(--color-muted)]",children:[r?s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[s.jsx(jt,{className:"size-3.5 animate-spin text-[var(--color-purple)]"})," loading catalog"]}):null,!r&&!u&&d.length===0?s.jsx("span",{children:"请选择至少一个可能使用的模型。"}):null,h?s.jsx("div",{className:"mt-1 font-medium text-[var(--color-ink)]",children:h}):null]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsxs("button",{type:"button",disabled:m||d.length===0,onClick:p,className:"inline-flex h-9 shrink-0 items-center justify-center gap-2 rounded-[8px] bg-[var(--color-ink)] px-3 text-[0.82rem] font-semibold text-white transition hover:bg-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:[m?s.jsx(jt,{className:"size-3.5 animate-spin"}):null,"保存"]}),s.jsxs("button",{type:"button",disabled:d.length===0,onClick:v,className:"inline-flex h-9 shrink-0 items-center justify-center gap-1.5 rounded-[8px] border border-[var(--color-line-2)] bg-white px-3 text-[0.82rem] font-semibold text-[var(--color-ink)] transition hover:border-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:["下一步",s.jsx(Jo,{className:"size-3.5"})]})]})]})]}),g?s.jsx(US,{models:a,allModels:i,selectedModelIds:d,onToggle:x,onClose:()=>b(!1)}):null]})}function US({models:a,allModels:i,selectedModelIds:r,onToggle:u,onClose:d}){const[m,h]=j.useState("common"),[x,p]=j.useState(""),v=x.trim(),g=m==="common"?a:v?QS(i,v):[],b=m==="common"?"没有可用的推荐模型。":"输入关键词搜索全部可用模型。",E=[{id:"common",label:"推荐模型",hint:"直接勾选"},{id:"all",label:"搜索添加",hint:"全部模型"}];return s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-[rgba(32,26,56,0.22)] px-3 py-6 backdrop-blur-sm",children:s.jsxs("div",{className:"flex max-h-full w-full max-w-[720px] flex-col overflow-hidden rounded-[14px] border border-[var(--color-line-2)] bg-white shadow-[0_24px_80px_rgba(32,26,56,0.22)]",children:[s.jsxs("div",{className:"flex items-start gap-3 border-b border-[var(--color-line-2)] px-4 py-3",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("div",{className:"text-[0.72rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:"Select models"}),s.jsx("h2",{className:"mt-0.5 text-[1rem] font-semibold text-[var(--color-ink)]",children:"选择可能使用到的模型"}),s.jsx("div",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:"推荐模型直接勾选;搜索添加用于查找平台全部模型。"})]}),s.jsxs("div",{className:"mt-0.5 rounded-full bg-[var(--color-lavender)] px-2.5 py-1 font-mono text-[0.72rem] font-semibold text-[var(--color-purple)]",children:[r.length," selected"]}),s.jsx("button",{type:"button",onClick:d,className:"inline-flex size-8 items-center justify-center rounded-[8px] border border-[var(--color-line-2)] text-[var(--color-muted)] hover:text-[var(--color-ink)]","aria-label":"Close model picker",children:s.jsx(Zr,{className:"size-4"})})]}),s.jsxs("div",{className:"border-b border-[var(--color-line-2)] px-4 py-2.5",children:[s.jsx("div",{className:"mb-2 text-[0.72rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:"已选模型"}),r.length===0?s.jsx("div",{className:"rounded-[9px] border border-dashed border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-2 text-[0.78rem] text-[var(--color-muted)]",children:"还没有选择模型。"}):s.jsx("div",{className:"flex max-h-[92px] flex-wrap gap-1.5 overflow-y-auto pr-1",children:r.map(C=>s.jsxs("span",{className:"inline-flex max-w-full items-center gap-1.5 rounded-[8px] border border-[var(--color-lavender-2)] bg-[var(--color-lavender)] px-2 py-1",children:[s.jsx("span",{className:"max-w-[220px] truncate font-mono text-[0.72rem] font-semibold text-[var(--color-purple)]",children:C}),s.jsx("button",{type:"button",onClick:()=>u(C),className:"inline-flex size-4 items-center justify-center rounded-[5px] text-[var(--color-purple)]/70 hover:bg-white hover:text-[var(--color-purple)]","aria-label":`Remove ${C}`,children:s.jsx(Zr,{className:"size-3"})})]},C))})]}),s.jsxs("div",{className:"border-b border-[var(--color-line-2)] p-3",children:[s.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:E.map(C=>{const A=m===C.id;return s.jsxs("button",{type:"button",onClick:()=>h(C.id),className:["rounded-[9px] border px-3 py-2 text-left transition",A?"border-[var(--color-purple)] bg-[var(--color-lavender)]":"border-[var(--color-line-2)] bg-white hover:border-[var(--color-lavender-2)]"].join(" "),children:[s.jsx("span",{className:["block text-[0.84rem] font-semibold",A?"text-[var(--color-purple)]":"text-[var(--color-ink)]"].join(" "),children:C.label}),s.jsx("span",{className:"mt-0.5 block text-[0.72rem] text-[var(--color-muted)]",children:C.hint})]},C.id)})}),m==="all"?s.jsxs("label",{className:"relative mt-3 block",children:[s.jsx(Fo,{className:"pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-[var(--color-muted)]"}),s.jsx("input",{value:x,onChange:C=>p(C.target.value),placeholder:"搜索平台全部模型...",className:"h-10 w-full rounded-[9px] border border-[var(--color-line-2)] bg-white pl-9 pr-3 text-[0.88rem] text-[var(--color-ink)] outline-none transition placeholder:text-[var(--color-muted)] focus:border-[var(--color-purple)]"})]}):null]}),s.jsx("div",{className:"min-h-0 max-h-[320px] overflow-y-auto p-3",children:g.length===0?s.jsx("div",{className:"rounded-[12px] border border-dashed border-[var(--color-line-2)] bg-[var(--color-page)] px-4 py-8 text-center text-[0.86rem] text-[var(--color-muted)]",children:b}):s.jsx("div",{className:"grid gap-2",children:g.map(C=>{const A=r.includes(C.id);return s.jsxs("button",{type:"button",onClick:()=>u(C.id),"aria-pressed":A,className:["flex items-center gap-3 rounded-[10px] border px-3 py-2 text-left transition",A?"border-[var(--color-purple)] bg-[var(--color-lavender)]":"border-[var(--color-line-2)] bg-white hover:border-[var(--color-lavender-2)]"].join(" "),children:[s.jsx("span",{className:["grid size-6 shrink-0 place-items-center rounded-[7px] border",A?"border-[var(--color-purple)] bg-[var(--color-purple)] text-white":"border-[var(--color-line-2)] bg-white text-transparent"].join(" "),children:s.jsx(Jt,{className:"size-3.5"})}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate font-mono text-[0.88rem] font-semibold text-[var(--color-ink)]",children:C.id}),s.jsxs("span",{className:"mt-1 flex flex-wrap gap-1.5 text-[0.72rem] text-[var(--color-muted)]",children:[s.jsx("span",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5",children:bf(C.id)}),s.jsx("span",{className:"rounded-full bg-emerald-50 px-2 py-0.5 font-semibold text-emerald-700",children:"可用"}),Pd(C.paymentMethods)?s.jsx("span",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5",children:Pd(C.paymentMethods)}):null]})]}),s.jsx("span",{className:["rounded-[7px] px-2 py-1 text-[0.72rem] font-semibold",A?"bg-[var(--color-purple)] text-white":"bg-[var(--color-page)] text-[var(--color-muted)]"].join(" "),children:A?"已选择":"选择"})]},C.id)})})}),s.jsxs("div",{className:"flex flex-col gap-2 border-t border-[var(--color-line-2)] bg-white px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsxs("div",{className:"text-[0.8rem] leading-5 text-[var(--color-muted)]",children:["已选择 ",s.jsx("span",{className:"font-mono font-semibold text-[var(--color-ink)]",children:r.length})," 个模型"]}),s.jsxs("button",{type:"button",onClick:d,"aria-label":"Done",title:"Done selecting models",className:"inline-flex h-9 items-center justify-center gap-1.5 rounded-[8px] bg-[var(--color-ink)] px-3 text-[0.82rem] font-semibold text-white transition hover:bg-[var(--color-purple)]",children:["完成选择",s.jsx(Jt,{className:"size-3.5"})]})]})]})})}function BS(a){const i=new Map;for(const r of a){const u=i.get(r.id)??{sellers:new Set,protocols:new Set,paymentMethods:new Set};u.sellers.add(r.sellerId);for(const d of r.supportedProtocols)u.protocols.add(d);for(const d of r.paymentMethods)u.paymentMethods.add(d);i.set(r.id,u)}return Array.from(i.entries()).map(([r,u])=>({id:r,sellerCount:u.sellers.size,protocols:Array.from(u.protocols).sort(),paymentMethods:Array.from(u.paymentMethods).sort()})).sort((r,u)=>u.sellerCount!==r.sellerCount?u.sellerCount-r.sellerCount:r.id.localeCompare(u.id))}function HS(a,i,r){const u=LS(a,r);if(u.length>0)return u.slice(0,14);const d=new Set(i),m=new Map;for(const p of i){const v=a.find(g=>g.id===p);v&&m.set(v.id,v)}const h=a.map(p=>({model:p,rank:YS(p.id)})).filter(p=>p.rank<100).sort((p,v)=>p.rank!==v.rank?p.rank-v.rank:v.model.sellerCount!==p.model.sellerCount?v.model.sellerCount-p.model.sellerCount:p.model.id.localeCompare(v.model.id)),x=new Map;for(const p of h){const v=bf(p.model.id),g=x.get(v)??[];g.push(p),x.set(v,g)}for(const p of RS){const v=p==="GPT"?3:p==="Claude"||p==="Gemini"?2:1;for(const g of(x.get(p)??[]).slice(0,v))m.set(g.model.id,g.model)}for(const p of h){if(m.size>=14)break;d.has(p.model.id)||m.set(p.model.id,p.model)}return Array.from(m.values()).slice(0,14)}function LS(a,i){const r=new Map;for(const u of i){const d=qS(a,u,r);d&&r.set(d.id,d)}return Array.from(r.values())}function qS(a,i,r){const u=Ed(i);if(!u)return;const d=a.find(m=>Ed(m.id)===u&&!r.has(m.id));return d||a.find(m=>{if(r.has(m.id))return!1;const h=Ed(m.id);return h.includes(u)||u.includes(h)})}function Ed(a){return a.trim().toLowerCase().replace(/_/g,"-")}function QS(a,i){const r=i.trim().toLowerCase();return r?a.filter(u=>[u.id,bf(u.id),...u.paymentMethods].some(d=>d.toLowerCase().includes(r))):a}function YS(a){const i=a.toLowerCase();return i.includes("gpt-5.5")||i.includes("gpt-5-5")||i.includes("gpt-5_5")?0:i.includes("gpt-5.4")||i.includes("gpt-5-4")||i.includes("gpt-5_4")?1:i.includes("gpt-5")||i.includes("gpt-latest")||i.includes("openai/gpt")?2:i.includes("claude")&&(i.includes("4.8")||i.includes("4-8"))?3:i.includes("claude")&&i.includes("opus")?4:i.includes("claude")&&i.includes("sonnet")?5:i.includes("claude")?6:i.includes("gemini")&&(i.includes("3.1")||i.includes("3-1"))?7:i.includes("gemini")&&i.includes("pro")?8:i.includes("gemini")?9:i.includes("deepseek")?10:i.includes("kimi")||i.includes("moonshot")?11:i.includes("qwen")||i.includes("tongyi")?12:i.includes("minimax")?13:i.includes("glm")||i.includes("zhipu")?14:i.includes("doubao")||i.includes("bytedance")?15:i.includes("grok")?16:100}function bf(a){const i=a.toLowerCase();return i.includes("gpt")||i.includes("openai")?"GPT":i.includes("claude")||i.includes("anthropic")?"Claude":i.includes("gemini")||i.includes("google")?"Gemini":i.includes("deepseek")?"DeepSeek":i.includes("kimi")||i.includes("moonshot")?"Kimi":i.includes("qwen")||i.includes("tongyi")?"Qwen":i.includes("minimax")?"MiniMax":i.includes("glm")||i.includes("zhipu")?"GLM":i.includes("doubao")||i.includes("bytedance")?"Doubao":i.includes("grok")?"Grok":"Common"}function Pd(a){return a.length===0?"":`${GS(a.map(KS)).join("、")}`}function GS(a){return Array.from(new Set(a))}function KS(a){const i=eu(a);return i.includes("x402")?"X402":i.includes("clawtip")?"ClawTip":i.includes("wallet")?"钱包":i.includes("mock")||i.includes("test")?"测试":"其它"}function eu(a){return a.trim().toLowerCase()}function XS({mode:a,scorer:i,sellers:r,fixedSellerId:u,fixedSetSellerIds:d,saving:m,message:h,onModeChange:x,onScorerChange:p,onFixedSellerChange:v,onToggleFixedSetSeller:g,onSave:b,onBack:E}){const C=a!=="fullAuto";return s.jsxs("div",{className:"space-y-3",children:[s.jsxs(St,{className:"p-3",children:[s.jsx(Gi,{index:3,title:"配置策略",detail:"路由规则",meta:`${T0(a)} / ${fN(i)}`}),s.jsxs("div",{className:"mt-3 grid gap-3 xl:grid-cols-2",children:[s.jsxs("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] p-2.5",children:[s.jsx("div",{className:"mb-2 text-[0.78rem] font-semibold text-[var(--color-ink)]",children:"路由模式"}),s.jsx("div",{className:"grid gap-2",children:ES.map(A=>s.jsxs("button",{type:"button",onClick:()=>x(A.value),className:["rounded-[9px] border bg-white p-2.5 text-left transition",a===A.value?"border-[var(--color-purple)] bg-[var(--color-lavender)]":"border-[var(--color-line-2)] bg-white hover:border-[var(--color-lavender-2)]"].join(" "),children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:["grid size-5 place-items-center rounded-full border",a===A.value?"border-[var(--color-purple)] bg-[var(--color-purple)] text-white":"border-[var(--color-line-2)] text-transparent"].join(" "),children:s.jsx(Jt,{className:"size-3"})}),s.jsx("span",{className:"text-[0.84rem] font-semibold text-[var(--color-ink)]",children:A.title})]}),s.jsx("p",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:A.body})]},A.value))})]}),s.jsxs("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] p-2.5",children:[s.jsx("div",{className:"mb-2 text-[0.78rem] font-semibold text-[var(--color-ink)]",children:"优化目标"}),s.jsx("div",{className:"grid gap-2",children:AS.map(A=>s.jsxs("button",{type:"button",onClick:()=>p(A.value),className:["rounded-[9px] border bg-white p-2.5 text-left transition",i===A.value?"border-[var(--color-purple)] bg-[var(--color-lavender)]":"border-[var(--color-line-2)] bg-white hover:border-[var(--color-lavender-2)]"].join(" "),children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:["grid size-5 place-items-center rounded-full border",i===A.value?"border-[var(--color-purple)] bg-[var(--color-purple)] text-white":"border-[var(--color-line-2)] text-transparent"].join(" "),children:s.jsx(Jt,{className:"size-3"})}),s.jsx("span",{className:"text-[0.84rem] font-semibold text-[var(--color-ink)]",children:A.title})]}),s.jsx("p",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:A.body})]},A.value))})]})]}),C?s.jsxs("div",{className:"mt-3 rounded-[10px] border border-[var(--color-line-2)] bg-white p-3",children:[s.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[s.jsx("div",{className:"text-[0.8rem] font-semibold text-[var(--color-ink)]",children:"选择供应商"}),s.jsx("div",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5 text-[0.72rem] text-[var(--color-muted)]",children:a==="fixed"?u?"已选择 1 个":"尚未选择":`已选择 ${d.length} 个`})]}),r.length===0?s.jsx("div",{className:"mt-2 rounded-[9px] border border-dashed border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-3 text-[0.8rem] leading-5 text-[var(--color-muted)]",children:"正在等待供应商目录。你也可以先返回上一步确认模型目录是否已经加载完成。"}):s.jsx(VS,{mode:a,sellers:r,fixedSellerId:u,fixedSetSellerIds:d,onFixedSellerChange:v,onToggleFixedSetSeller:g})]}):s.jsx("div",{className:"mt-3 rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-2 text-[0.8rem] leading-5 text-[var(--color-muted)]",children:"当前是全自动模式,TokenBuddy 会根据模型、供应商健康度、速度、价格和余额状态自动规划调用路径。"})]}),s.jsx(j0,{backLabel:"上一步:绑定钱包",nextLabel:"下一步:配置工具",saving:m,message:h,onBack:E,onNext:b})]})}function VS({mode:a,sellers:i,fixedSellerId:r,fixedSetSellerIds:u,onFixedSellerChange:d,onToggleFixedSetSeller:m}){const[h,x]=j.useState({key:"status",direction:"asc"}),p=j.useMemo(()=>S0(i,h),[i,h]),v=b=>{x(E=>({key:b,direction:E.key===b&&E.direction==="asc"?"desc":"asc"}))},g=b=>{if(a==="fixed"){d(b);return}m(b)};return s.jsx("div",{className:"mt-2 overflow-hidden rounded-[9px] border border-[var(--color-line-2)]",children:s.jsx("div",{className:"max-h-[300px] overflow-auto",children:s.jsxs("table",{className:"min-w-[760px] w-full border-collapse text-left text-[0.78rem]",children:[s.jsx("thead",{className:"sticky top-0 z-10 border-b border-[var(--color-line-2)] bg-[var(--color-page)] text-[0.68rem] uppercase tracking-wider text-[var(--color-muted)]",children:s.jsxs("tr",{children:[s.jsx("th",{className:"w-12 px-2 py-2 font-semibold",children:"选"}),s.jsx(Si,{label:"供应商",sortKey:"name",sort:h,onSort:v}),s.jsx(Si,{label:"状态",sortKey:"status",sort:h,onSort:v}),s.jsx(Si,{label:"模型",sortKey:"models",sort:h,onSort:v,align:"right"}),s.jsx(Si,{label:"价格",sortKey:"price",sort:h,onSort:v}),s.jsx(Si,{label:"折扣",sortKey:"discount",sort:h,onSort:v,align:"right"}),s.jsx(Si,{label:"响应",sortKey:"speed",sort:h,onSort:v,align:"right"}),s.jsx("th",{className:"px-3 py-2 font-semibold",children:"支付"})]})}),s.jsx("tbody",{className:"divide-y divide-[var(--color-line-2)] bg-white",children:p.map(b=>{const E=a==="fixed"?r===b.id:u.includes(b.id);return s.jsxs("tr",{onClick:()=>g(b.id),className:["cursor-pointer transition hover:bg-[var(--color-lavender)]/45",E?"bg-[var(--color-lavender)]/70":"bg-white"].join(" "),children:[s.jsx("td",{className:"px-2 py-2.5",children:s.jsx("span",{className:["grid size-5 place-items-center rounded-full border",E?"border-[var(--color-purple)] bg-[var(--color-purple)] text-white":"border-[var(--color-line-2)] text-transparent"].join(" "),children:s.jsx(Jt,{className:"size-3"})})}),s.jsxs("td",{className:"max-w-[210px] px-3 py-2.5",children:[s.jsx("div",{className:"truncate font-semibold text-[var(--color-ink)]",children:b.name}),s.jsx("div",{className:"mt-0.5 truncate font-mono text-[0.68rem] text-[var(--color-muted)]",children:b.id})]}),s.jsx("td",{className:"px-3 py-2.5",children:s.jsx("span",{className:["inline-flex whitespace-nowrap rounded-full px-2 py-0.5 text-[0.7rem] font-semibold",hN(b.status)].join(" "),children:mN(b.status)})}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono font-semibold text-[var(--color-ink)]",children:b.modelCount}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 font-mono text-[0.72rem] text-[var(--color-ink)]",children:tN(b.minInputPriceMicrosPer1m,b.minOutputPriceMicrosPer1m)}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono font-semibold text-[var(--color-purple)]",children:lN(b.discountRatio)}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono text-[var(--color-ink)]",children:aN(b.avgResponseMs,b.avgTtftMs)}),s.jsx("td",{className:"max-w-[150px] px-3 py-2.5",children:s.jsx("div",{className:"truncate text-[0.72rem] text-[var(--color-muted)]",children:Pd(b.paymentMethods)||"—"})})]},b.id)})})]})})})}function Si({label:a,sortKey:i,sort:r,align:u="left",onSort:d}){const m=r.key===i,h=m?r.direction==="asc"?"↑":"↓":"↕";return s.jsx("th",{className:["px-3 py-2 font-semibold",u==="right"?"text-right":"text-left"].join(" "),children:s.jsxs("button",{type:"button",onClick:()=>d(i),className:["inline-flex items-center gap-1 rounded-[6px] px-1.5 py-1 transition hover:bg-white",u==="right"?"justify-end":"justify-start",m?"text-[var(--color-purple)]":"text-[var(--color-muted)]"].join(" "),children:[s.jsx("span",{children:a}),s.jsx("span",{className:"font-mono text-[0.66rem]",children:h})]})})}function ZS({payments:a,enabledPaymentCount:i,loading:r,qrUrl:u,rechargeQrUrl:d,walletConfigPresent:m,error:h,rechargeError:x,binding:p,rechargeLoading:v,onBind:g,onLoadRecharge:b,onRefreshPayments:E,onBack:C,onContinue:A}){const[z,U]=j.useState("clawtip"),[D,G]=j.useState(!1),[K,L]=j.useState(!1),V=a.find(ue=>eu(ue.method)==="clawtip"),I=!!(V!=null&&V.enabled||m||$S(V==null?void 0:V.config,"walletConfigPresent")),J=D&&I,ee=[{method:"clawtip",name:"ClawTip",detail:"JD App 扫码 / 微支付",status:I?"已绑定":"可绑定",available:!0},...zS.map(ue=>({...ue,status:"Coming soon",available:!1}))],le=ee.find(ue=>ue.method===z)??ee[0],oe=le.method==="clawtip",F=oe&&I&&!J,me=J||F||D,pe=()=>{G(!0),g()},Ee=()=>{L(!0),b()};return j.useEffect(()=>{if(!oe||!D||I)return;const ue=window.setInterval(E,1500);return()=>window.clearInterval(ue)},[D,I,E,oe]),j.useEffect(()=>{!F||d||v||K||(L(!0),b())},[b,v,d,K,F]),s.jsxs("div",{className:"space-y-3",children:[s.jsxs(St,{className:"p-3",children:[s.jsx(Gi,{index:2,title:"选择支付方式",detail:"钱包和充值通道",meta:r?"checking":`${i} active`,action:oe&&F?s.jsxs("button",{type:"button",disabled:v,onClick:Ee,className:"inline-flex h-8 items-center justify-center gap-1.5 rounded-[8px] bg-[var(--color-ink)] px-2.5 text-[0.78rem] font-semibold text-white transition hover:bg-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:[v?s.jsx(jt,{className:"size-3.5 animate-spin"}):s.jsx(Hi,{className:"size-3.5"}),"刷新充值码"]}):oe&&D&&!I?s.jsxs("button",{type:"button",disabled:p,onClick:pe,className:"inline-flex h-8 items-center justify-center gap-1.5 rounded-[8px] bg-[var(--color-ink)] px-2.5 text-[0.78rem] font-semibold text-white transition hover:bg-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:[p?s.jsx(jt,{className:"size-3.5 animate-spin"}):s.jsx(vn,{className:"size-3.5"}),"重新生成"]}):oe?null:s.jsx("span",{className:"inline-flex h-8 items-center rounded-[8px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-2.5 font-mono text-[0.72rem] font-semibold text-[var(--color-muted)]",children:"Coming soon"})}),s.jsxs("div",{className:"mt-3 grid gap-3 lg:grid-cols-[minmax(0,300px)_minmax(0,1fr)]",children:[s.jsx("div",{className:"grid content-start gap-2",children:ee.map(ue=>{const B=ue.method===le.method;return s.jsxs("button",{type:"button",onClick:()=>U(ue.method),"aria-pressed":B,className:["grid min-h-[64px] grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 rounded-[10px] border px-3 py-2 text-left transition",B?"border-[var(--color-purple)] bg-[var(--color-lavender)] shadow-[0_8px_22px_rgba(124,61,240,0.08)]":"border-[var(--color-line-2)] bg-white hover:bg-[var(--color-page)]"].join(" "),children:[s.jsx("span",{className:["grid size-9 shrink-0 place-items-center rounded-[9px] border",B?"border-[var(--color-lavender-2)] bg-white text-[var(--color-purple)]":"border-[var(--color-line-2)] bg-[var(--color-page)] text-[var(--color-muted)]"].join(" "),children:Fv(ue.method)}),s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:"block truncate text-[0.86rem] font-semibold text-[var(--color-ink)]",children:ue.name}),s.jsx("span",{className:"mt-0.5 block truncate text-[0.73rem] text-[var(--color-muted)]",children:ue.detail})]}),s.jsx("span",{className:["rounded-full px-2 py-0.5 text-[0.68rem] font-semibold",ue.available?"bg-emerald-50 text-emerald-700":"bg-[var(--color-page)] text-[var(--color-muted)]"].join(" "),children:ue.status})]},ue.method)})}),oe?me?s.jsx("div",{className:"flex min-h-[360px] items-center justify-center rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] p-4",children:J?s.jsx("div",{className:"grid size-full min-h-[320px] place-items-center rounded-[10px] border border-emerald-100 bg-emerald-50 px-4 py-5 text-center",children:s.jsxs("div",{children:[s.jsx(Jt,{className:"mx-auto size-8 text-emerald-700"}),s.jsx("div",{className:"mt-3 text-[0.92rem] font-semibold text-emerald-900",children:"绑定成功"}),s.jsx("div",{className:"mt-1 text-[0.78rem] leading-5 text-emerald-800",children:"ClawTip 钱包已经写入本机配置,可以继续配置路由策略。"})]})}):F?d?s.jsx("img",{src:d,alt:"ClawTip 充值二维码",className:"max-h-[340px] w-full max-w-[340px] rounded-[10px] border border-[var(--color-line-2)] bg-white p-3 object-contain shadow-[0_12px_28px_rgba(15,23,42,0.1)]"}):s.jsx("div",{className:"grid size-full min-h-[320px] place-items-center rounded-[10px] border border-dashed border-[var(--color-line-2)] bg-white px-3 py-4 text-center",children:s.jsxs("div",{children:[v?s.jsx(jt,{className:"mx-auto size-6 animate-spin text-[var(--color-purple)]"}):s.jsx(Hi,{className:"mx-auto size-6 text-[var(--color-purple)]"}),s.jsx("div",{className:"mt-2 text-[0.84rem] font-semibold text-[var(--color-ink)]",children:v?"正在加载充值码":"充值码未加载"}),s.jsx("button",{type:"button",disabled:v,onClick:Ee,className:"mt-3 inline-flex h-8 items-center justify-center rounded-[8px] bg-[var(--color-ink)] px-3 text-[0.78rem] font-semibold text-white transition hover:bg-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:"重新加载"})]})}):D&&u?s.jsx("img",{src:u,alt:"ClawTip 钱包绑定二维码",className:"max-h-[340px] w-full max-w-[340px] rounded-[10px] border border-[var(--color-line-2)] bg-white p-3 object-contain shadow-[0_12px_28px_rgba(15,23,42,0.1)]"}):D?s.jsx("div",{className:"grid size-full min-h-[320px] place-items-center rounded-[10px] border border-dashed border-[var(--color-line-2)] bg-white px-3 py-4 text-center",children:s.jsxs("div",{children:[p?s.jsx(jt,{className:"mx-auto size-6 animate-spin text-[var(--color-purple)]"}):s.jsx(vn,{className:"mx-auto size-6 text-[var(--color-purple)]"}),s.jsx("div",{className:"mt-2 text-[0.84rem] font-semibold text-[var(--color-ink)]",children:p?"正在生成绑定码":"等待绑定码"}),s.jsx("div",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:"生成后使用京东 App 扫码绑定。"})]})}):s.jsx("div",{className:"grid size-full min-h-[320px] place-items-center rounded-[10px] border border-dashed border-[var(--color-line-2)] bg-white px-4 py-5 text-center",children:s.jsxs("div",{className:"max-w-[260px]",children:[s.jsx(vn,{className:"mx-auto size-7 text-[var(--color-purple)]"}),s.jsx("div",{className:"mt-3 text-[0.9rem] font-semibold text-[var(--color-ink)]",children:"ClawTip 尚未绑定"}),s.jsx("div",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:"开始后沿用 tb init 的 ClawTip 绑定流程。"}),s.jsxs("button",{type:"button",disabled:p,onClick:pe,className:"mt-4 inline-flex h-9 items-center justify-center gap-1.5 rounded-[8px] bg-[var(--color-ink)] px-3 text-[0.82rem] font-semibold text-white transition hover:bg-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:[p?s.jsx(jt,{className:"size-3.5 animate-spin"}):s.jsx(vn,{className:"size-3.5"}),"开始绑定"]})]})})}):s.jsxs("div",{className:"flex min-h-[120px] flex-col justify-center rounded-[10px] border border-dashed border-[var(--color-line-2)] bg-[var(--color-page)] px-4 py-4 sm:flex-row sm:items-center sm:justify-between",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-[0.86rem] font-semibold text-[var(--color-ink)]",children:"ClawTip 尚未绑定"}),s.jsx("div",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:"开始后沿用 tb init 的 ClawTip 绑定流程。"})]}),s.jsxs("button",{type:"button",disabled:p,onClick:pe,className:"mt-3 inline-flex h-9 shrink-0 items-center justify-center gap-1.5 rounded-[8px] bg-[var(--color-ink)] px-3 text-[0.82rem] font-semibold text-white transition hover:bg-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45 sm:mt-0",children:[p?s.jsx(jt,{className:"size-3.5 animate-spin"}):s.jsx(vn,{className:"size-3.5"}),"开始绑定"]})]}):s.jsx("div",{className:"grid min-h-[220px] place-items-center rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] p-4 text-center",children:s.jsxs("div",{className:"max-w-[360px]",children:[s.jsx("span",{className:"mx-auto grid size-11 place-items-center rounded-[12px] border border-[var(--color-line-2)] bg-white text-[var(--color-purple)]",children:Fv(le.method)}),s.jsx("div",{className:"mt-3 text-[0.92rem] font-semibold text-[var(--color-ink)]",children:le.name}),s.jsxs("div",{className:"mt-1 text-[0.78rem] leading-5 text-[var(--color-muted)]",children:[le.detail,"。当前版本先通过 ClawTip 完成钱包绑定,后续会在这里接入更多支付流程。"]}),s.jsx("div",{className:"mt-3 inline-flex rounded-full bg-white px-3 py-1 font-mono text-[0.7rem] font-semibold text-[var(--color-muted)]",children:"Coming soon"})]})})]}),oe&&!I&&D&&h?s.jsxs("div",{className:"mt-3 rounded-[10px] bg-rose-50 px-3 py-2 text-[0.84rem] leading-6 text-rose-700",children:["生成二维码失败:",h instanceof Error?h.message:String(h)]}):null,oe&&F&&x?s.jsxs("div",{className:"mt-3 rounded-[10px] bg-rose-50 px-3 py-2 text-[0.84rem] leading-6 text-rose-700",children:["加载充值二维码失败:",x instanceof Error?x.message:String(x)]}):null]}),s.jsx(j0,{backLabel:"上一步:模型访问",nextLabel:"下一步:配置策略",message:i>0?"支付方式已可用,可以继续配置路由策略。":"如果你暂时跳过绑定,后续首次购买模型额度时仍需要完成支付配置。",onBack:C,onNext:A})]})}function Fv(a){const i=eu(a);return i==="wechat-pay"?s.jsx(ej,{className:"size-4"}):i==="alipay-agent"?s.jsx(B2,{className:"size-4"}):i==="coinbase-smart-wallet"?s.jsx(Hi,{className:"size-4"}):s.jsx(vn,{className:"size-4"})}function $S(a,i){const r=a==null?void 0:a[i];return r===!0||r==="true"||r===1||r==="1"}function JS({clients:a,candidates:i,loading:r,selectedProviders:u,selectedModel:d,modelOptions:m,providerSelections:h,proxyUrl:x,previewChanges:p,applying:v,previewing:g,message:b,onToggleProvider:E,onModelChange:C,onProviderSelectionChange:A,onPreview:z,onInstall:U,onBack:D}){var oe;const G=new Set(i.map(F=>F.id)),K=i.length,L=a.find(F=>F.id==="custom")??w0(x),V=[...a.filter(F=>F.id!=="custom"),{...L,name:"其他工具"}],I=((oe=V[0])==null?void 0:oe.id)??"custom",[J,ee]=j.useState(I),le=V.find(F=>F.id===J)??V[0]??L;return j.useEffect(()=>{var F;V.some(me=>me.id===J)||ee(((F=V[0])==null?void 0:F.id)??"custom")},[J,V]),s.jsxs("div",{className:"space-y-3",children:[s.jsxs(St,{className:"p-3",children:[s.jsx(Gi,{index:4,title:"配置工具",detail:"终端接入",meta:`${u.length} selected / ${K} detected`,action:r?s.jsx(jt,{className:"size-4 animate-spin text-[var(--color-purple)]"}):null}),s.jsxs("div",{className:"mt-3 grid gap-3 xl:grid-cols-[minmax(0,320px)_minmax(0,1fr)]",children:[s.jsxs("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] p-2.5",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("div",{className:"text-[0.8rem] font-semibold text-[var(--color-ink)]",children:"工具"}),s.jsxs("div",{className:"rounded-full bg-white px-2 py-0.5 text-[0.72rem] text-[var(--color-muted)]",children:[a.length," tools"]})]}),s.jsx("div",{className:"mt-2 grid max-h-[380px] gap-2 overflow-y-auto pr-1",children:V.map(F=>{const me=F.id!=="custom"&&G.has(F.id),pe=u.includes(F.id),Ee=le.id===F.id;return s.jsx("button",{type:"button",onClick:()=>ee(F.id),className:["rounded-[10px] border p-2.5 text-left transition",Ee?"border-[var(--color-purple)] bg-white shadow-[0_10px_24px_rgba(60,41,112,0.08)]":"border-[var(--color-line-2)] bg-white/70 hover:border-[var(--color-lavender-2)]"].join(" "),children:s.jsxs("div",{className:"flex items-start gap-2.5",children:[s.jsx("span",{className:["mt-0.5 grid size-6 shrink-0 place-items-center rounded-[8px] border text-[0.72rem] font-semibold",Ee?"border-[var(--color-purple)] bg-[var(--color-lavender)] text-[var(--color-purple)]":"border-[var(--color-line-2)] bg-white text-[var(--color-muted)]"].join(" "),children:nN(F.name)}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx("div",{className:"truncate text-[0.84rem] font-semibold text-[var(--color-ink)]",children:F.name}),pe?s.jsx("span",{className:"rounded-full bg-emerald-50 px-1.5 py-0.5 text-[0.66rem] font-semibold text-emerald-700",children:"安装"}):null]}),s.jsxs("div",{className:"mt-1 flex flex-wrap gap-1.5 text-[0.68rem] text-[var(--color-muted)]",children:[s.jsx("span",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5",children:E0(F)}),F.commandName?s.jsx("span",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5",children:F.commandName}):null,F.id==="custom"?s.jsx("span",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5",children:"复制配置"}):null]})]}),F.id!=="custom"?s.jsx("span",{"aria-hidden":"true",className:["mt-0.5 grid size-5 shrink-0 place-items-center rounded-full border",pe?"border-[var(--color-purple)] bg-[var(--color-purple)] text-white":"border-[var(--color-line-2)] text-transparent",me?"":"opacity-45"].join(" "),children:s.jsx(Jt,{className:"size-3"})}):null]})},F.id)})})]}),s.jsx("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-white p-3",children:s.jsx(FS,{client:le,selected:u.includes(le.id),installable:le.id!=="custom"&&G.has(le.id),selectedModel:d,modelOptions:m,providerSelections:h,proxyUrl:x,onToggleInstall:()=>E(le.id),onModelChange:C,onProviderSelectionChange:A})})]}),p?s.jsxs("div",{className:"mt-3 rounded-[10px] border border-[var(--color-line-2)] bg-white p-3",children:[s.jsx("div",{className:"text-[0.8rem] font-semibold text-[var(--color-ink)]",children:"配置文件变更"}),p.length===0?s.jsx("div",{className:"mt-2 rounded-[9px] border border-dashed border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-3 text-[0.8rem] text-[var(--color-muted)]",children:"没有需要写入的配置变更。"}):s.jsx("div",{className:"mt-2 grid max-h-[180px] gap-2 overflow-y-auto pr-1",children:p.map(F=>s.jsxs("div",{className:"rounded-[9px] border border-[var(--color-line-2)] bg-white p-2.5",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[0.78rem] font-semibold text-[var(--color-ink)]",children:[s.jsx("span",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5",children:pN(F.action)}),s.jsx("span",{children:F.providerId})]}),s.jsx("div",{className:"mt-1 truncate font-mono text-[0.72rem] text-[var(--color-muted)]",children:F.path}),s.jsx("div",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:F.summary})]},`${F.providerId}:${F.path}:${F.summary}`))})]}):null]}),s.jsxs(St,{className:"flex flex-col gap-3 p-3 lg:flex-row lg:items-center lg:justify-between",children:[s.jsx("div",{className:"text-[0.84rem] leading-6 text-[var(--color-muted)]",children:b?s.jsx("div",{className:"mt-1 font-medium text-[var(--color-ink)]",children:b}):null}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx("button",{type:"button",onClick:D,className:"inline-flex h-9 items-center justify-center rounded-[8px] border border-[var(--color-line-2)] bg-white px-3 text-[0.82rem] font-semibold text-[var(--color-muted)] transition hover:text-[var(--color-ink)]",children:"上一步:配置策略"}),s.jsxs("button",{type:"button",disabled:g||u.length===0,onClick:z,className:"inline-flex h-9 items-center justify-center gap-2 rounded-[8px] border border-[var(--color-line-2)] bg-white px-3 text-[0.82rem] font-semibold text-[var(--color-ink)] transition hover:border-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:[g?s.jsx(jt,{className:"size-4 animate-spin"}):null,"预览安装"]}),s.jsxs("button",{type:"button",disabled:v||u.length===0,onClick:U,className:"inline-flex h-9 items-center justify-center gap-2 rounded-[8px] bg-[var(--color-ink)] px-3 text-[0.82rem] font-semibold text-white transition hover:bg-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:[v?s.jsx(jt,{className:"size-4 animate-spin"}):null,"写入配置"]})]})]})]})}function FS({client:a,selected:i,installable:r,selectedModel:u,modelOptions:d,providerSelections:m,proxyUrl:h,onToggleInstall:x,onModelChange:p,onProviderSelectionChange:v}){var E,C,A;if(a.id==="custom"){const z=a.manualConfig??w0(h).manualConfig;return s.jsxs("div",{className:"space-y-3",children:[s.jsx(Ad,{client:a,selected:!1,installable:!1}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Yr,{label:"OpenAI base URL",value:(z==null?void 0:z.openaiBaseUrl)??C0(h)}),s.jsx(Yr,{label:"Anthropic base URL",value:(z==null?void 0:z.anthropicBaseUrl)??h}),s.jsx(Yr,{label:"API key",value:(z==null?void 0:z.apiKey)??"TOKENBUDDY_PROXY"})]}),s.jsx("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-2 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:"其他工具只需要填入本地推理服务接口和 key,不会写入本机配置文件。"})]})}if(a.id==="claude-code"){const z=M0(m[a.id],d,u),U=(G,K)=>{v(a.id,{...z,fallbackModel:z.fallbackModel||K||u,roles:{...z.roles,[G]:K?{upstreamModel:K,displayName:K}:void 0}})},D=G=>{v(a.id,{...z,fallbackModel:G}),p(G)};return s.jsxs("div",{className:"space-y-3",children:[s.jsx(Ad,{client:a,selected:i,installable:r,onToggleInstall:x}),s.jsxs("div",{className:"grid gap-2 lg:grid-cols-2",children:[s.jsx(Qr,{label:"Fallback",value:z.fallbackModel??u,modelOptions:d,onChange:D}),s.jsx(Qr,{label:"Haiku",value:((E=z.roles.haiku)==null?void 0:E.upstreamModel)??"",modelOptions:d,onChange:G=>U("haiku",G)}),s.jsx(Qr,{label:"Sonnet",value:((C=z.roles.sonnet)==null?void 0:C.upstreamModel)??"",modelOptions:d,onChange:G=>U("sonnet",G)}),s.jsx(Qr,{label:"Opus",value:((A=z.roles.opus)==null?void 0:A.upstreamModel)??"",modelOptions:d,onChange:G=>U("opus",G)})]}),s.jsx("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-2 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:"Claude Code 会把 Haiku、Sonnet、Opus 三种客户端模型映射到你选择的上游模型。"})]})}const g=N0(a.id,m[a.id],u),b=z=>{p(z),v(a.id,{selectionKind:"single-model",protocolPreference:Id(a.id),defaultModel:z})};return s.jsxs("div",{className:"space-y-3",children:[s.jsx(Ad,{client:a,selected:i,installable:r,onToggleInstall:x}),s.jsx(Qr,{label:"模型",value:g.defaultModel,modelOptions:d,onChange:b}),s.jsxs("div",{className:"grid gap-2 lg:grid-cols-2",children:[s.jsx(Yr,{label:"Proxy URL",value:h,compact:!0}),s.jsx(Yr,{label:"API key",value:"TOKENBUDDY_PROXY",compact:!0})]}),a.configPath?s.jsx("div",{className:"truncate rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-2 font-mono text-[0.72rem] text-[var(--color-muted)]",children:a.configPath}):null]})}function Ad({client:a,selected:i,installable:r,onToggleInstall:u}){return s.jsxs("div",{className:"flex flex-col gap-2 border-b border-[var(--color-line-2)] pb-3 sm:flex-row sm:items-start sm:justify-between",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("div",{className:"text-[0.9rem] font-semibold text-[var(--color-ink)]",children:a.name}),s.jsx("span",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5 text-[0.7rem] text-[var(--color-muted)]",children:E0(a)})]}),s.jsx("div",{className:"mt-1 text-[0.74rem] leading-5 text-[var(--color-muted)]",children:a.reason})]}),a.id!=="custom"?s.jsxs("button",{type:"button",disabled:!r,onClick:u,className:["inline-flex h-8 shrink-0 items-center justify-center gap-1.5 rounded-[8px] px-2.5 text-[0.78rem] font-semibold transition disabled:cursor-not-allowed disabled:opacity-45",i?"bg-[var(--color-purple)] text-white hover:bg-[var(--color-purple-2)]":"border border-[var(--color-line-2)] bg-white text-[var(--color-ink)] hover:border-[var(--color-purple)]"].join(" "),children:[s.jsx(Jt,{className:"size-3.5"}),i?"已加入安装":"加入安装"]}):null]})}function Qr({label:a,value:i,modelOptions:r,onChange:u}){return s.jsxs("label",{className:"block",children:[s.jsx("span",{className:"text-[0.74rem] font-semibold text-[var(--color-muted)]",children:a}),s.jsxs("select",{value:i,onChange:d=>u(d.target.value),className:"mt-1 h-9 w-full rounded-[8px] border border-[var(--color-line-2)] bg-white px-2.5 text-[0.82rem] text-[var(--color-ink)] outline-none focus:border-[var(--color-purple)]",children:[s.jsx("option",{value:"",children:"请选择模型"}),r.map(d=>s.jsx("option",{value:d,children:d},d))]})]})}function Yr({label:a,value:i,compact:r=!1}){const[u,d]=j.useState(!1),m=async()=>{try{await navigator.clipboard.writeText(i),d(!0),window.setTimeout(()=>d(!1),1200)}catch{d(!1)}};return s.jsxs("div",{className:["rounded-[10px] border border-[var(--color-line-2)] bg-white px-3 py-2",r?"min-w-0":""].join(" "),children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("div",{className:"text-[0.72rem] font-semibold text-[var(--color-muted)]",children:a}),s.jsxs("button",{type:"button",onClick:m,className:"inline-flex h-7 items-center justify-center gap-1 rounded-[7px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-2 text-[0.7rem] font-semibold text-[var(--color-ink)] transition hover:border-[var(--color-purple)]",children:[s.jsx(T2,{className:"size-3"}),u?"已复制":"复制"]})]}),s.jsx("div",{className:"mt-1 truncate font-mono text-[0.76rem] text-[var(--color-ink)]",children:i})]})}function WS({items:a,status:i,generatedAt:r,running:u,error:d,onRefresh:m,onBack:h,onContinue:x}){return s.jsx("div",{className:"space-y-3",children:s.jsxs(St,{className:"p-3",children:[s.jsx(Gi,{index:5,title:"验证网关",detail:"本机状态",meta:u?"checking":lx(i),action:s.jsxs("button",{type:"button",disabled:u,onClick:m,className:"inline-flex h-8 items-center justify-center gap-1.5 rounded-[8px] border border-[var(--color-line-2)] bg-white px-2.5 text-[0.78rem] font-semibold text-[var(--color-ink)] transition hover:border-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:[u?s.jsx(jt,{className:"size-3.5 animate-spin"}):s.jsx($d,{className:"size-3.5"}),"刷新"]})}),s.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2 text-[0.76rem] text-[var(--color-muted)]",children:[s.jsx("span",{className:["rounded-full px-2 py-0.5 font-semibold",oN(i)].join(" "),children:u?"正在检查":lx(i)}),r?s.jsxs("span",{children:["检查时间:",new Date(r).toLocaleString()]}):s.jsx("span",{children:"等待后端检查。"})]}),d?s.jsxs("div",{className:"mt-3 rounded-[10px] bg-rose-50 px-3 py-2 text-[0.82rem] leading-6 text-rose-700",children:["检查失败:",d instanceof Error?d.message:String(d)]}):null,s.jsx("div",{className:"mt-3 grid gap-2 xl:grid-cols-2",children:a.map(p=>s.jsxs("div",{className:"flex gap-2.5 rounded-[10px] border border-[var(--color-line-2)] bg-white p-2.5",children:[s.jsx("span",{className:["mt-0.5 grid size-6 shrink-0 place-items-center rounded-full",cN(p.status)].join(" "),children:p.ok?s.jsx(Jt,{className:"size-3.5"}):s.jsx($d,{className:"size-3.5"})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-[0.82rem] font-semibold text-[var(--color-ink)]",children:[p.title,s.jsx("span",{className:["rounded-full px-1.5 py-0.5 text-[0.68rem]",dN(p.status)].join(" "),children:uN(p.status)})]}),s.jsx("div",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:p.body})]})]},p.title))}),s.jsxs("div",{className:"mt-3 flex flex-col gap-2 border-t border-[var(--color-line-2)] pt-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsx("div",{className:"text-[0.78rem] leading-5 text-[var(--color-muted)]",children:"发现异常时返回对应步骤补齐配置。"}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx("button",{type:"button",onClick:h,className:"inline-flex h-9 items-center justify-center rounded-[8px] border border-[var(--color-line-2)] bg-white px-3 text-[0.82rem] font-semibold text-[var(--color-muted)] transition hover:text-[var(--color-ink)]",children:"上一步"}),s.jsxs("button",{type:"button",onClick:x,className:"inline-flex h-9 items-center justify-center gap-1.5 rounded-[8px] bg-[var(--color-ink)] px-3 text-[0.82rem] font-semibold text-white transition hover:bg-[var(--color-purple)]",children:["下一步",s.jsx(Jo,{className:"size-3.5"})]})]})]})]})})}function PS({complete:a,message:i,installMessage:r,canInstall:u,installed:d,saving:m,onBack:h,onComplete:x,onInstall:p}){return s.jsx("div",{className:"space-y-3",children:s.jsxs(St,{className:"p-3",children:[s.jsx(Gi,{index:6,title:a?"初始化完成":"桌面应用",detail:d?"已安装":"可选安装",meta:a?"complete":d?"installed":"optional",action:s.jsxs("button",{type:"button",disabled:d,onClick:p,className:"inline-flex h-8 shrink-0 items-center justify-center gap-1.5 rounded-[8px] bg-[var(--color-ink)] px-2.5 text-[0.78rem] font-semibold text-white transition hover:bg-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:[s.jsx(Jt,{className:"size-3.5"}),d?"已安装":"安装应用"]})}),s.jsxs("div",{className:"mt-3 grid gap-3 xl:grid-cols-[minmax(0,290px)_minmax(0,1fr)]",children:[s.jsxs("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] p-3",children:[s.jsx("div",{className:"text-[0.84rem] font-semibold text-[var(--color-ink)]",children:d?"TokenBuddy 桌面应用已安装":u?"浏览器支持直接安装":"可从浏览器菜单安装"}),s.jsx("div",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:d?"你可以从系统应用入口打开 TokenBuddy。":u?"点击右上角安装按钮并确认浏览器弹窗。":"在地址栏右侧或浏览器菜单中找到安装应用入口。"}),r?s.jsx("div",{className:"mt-2 text-[0.78rem] font-medium text-[var(--color-ink)]",children:r}):null]}),s.jsx("div",{className:"grid gap-2 lg:grid-cols-3",children:[{title:"安装入口",body:"地址栏或浏览器菜单。"},{title:"应用名称",body:"TokenBuddy。"},{title:"本地服务",body:"继续由 tb-proxyd 提供。"}].map((v,g)=>s.jsxs("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-white p-2.5",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"grid size-5 place-items-center rounded-full bg-[var(--color-lavender)] font-mono text-[0.68rem] font-semibold text-[var(--color-purple)]",children:g+1}),s.jsx("span",{className:"text-[0.8rem] font-semibold text-[var(--color-ink)]",children:v.title})]}),s.jsx("div",{className:"mt-1 text-[0.74rem] leading-5 text-[var(--color-muted)]",children:v.body})]},v.title))})]}),s.jsxs("div",{className:"mt-3 flex flex-col gap-2 border-t border-[var(--color-line-2)] pt-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsx("div",{className:"text-[0.78rem] leading-5 text-[var(--color-muted)]",children:i?s.jsx("span",{className:"font-medium text-[var(--color-ink)]",children:i}):"完成后可以进入控制台。"}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx("button",{type:"button",onClick:h,className:"inline-flex h-9 items-center justify-center rounded-[8px] border border-[var(--color-line-2)] bg-white px-3 text-[0.82rem] font-semibold text-[var(--color-muted)] transition hover:text-[var(--color-ink)]",children:"上一步"}),s.jsxs("button",{type:"button",disabled:m||a,onClick:x,className:"inline-flex h-9 items-center justify-center gap-1.5 rounded-[8px] bg-[var(--color-ink)] px-3 text-[0.82rem] font-semibold text-white transition hover:bg-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:[m?s.jsx(jt,{className:"size-3.5 animate-spin"}):s.jsx(Jt,{className:"size-3.5"}),a?"已完成":"完成初始化"]}),s.jsx(ns,{to:"/overview",className:"inline-flex h-9 items-center justify-center rounded-[8px] border border-[var(--color-line-2)] bg-white px-3 text-[0.82rem] font-semibold text-[var(--color-ink)] transition hover:border-[var(--color-purple)]",children:"进入控制台"})]})]})]})})}function j0({backLabel:a,nextLabel:i,saving:r=!1,message:u,onBack:d,onNext:m}){return s.jsxs(St,{className:"flex flex-col gap-2.5 p-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsx("div",{className:"text-[0.78rem] leading-5 text-[var(--color-muted)]",children:u??"配置完成后继续下一步。"}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx("button",{type:"button",onClick:d,className:"inline-flex h-9 items-center justify-center rounded-[8px] border border-[var(--color-line-2)] bg-white px-3 text-[0.82rem] font-semibold text-[var(--color-muted)] transition hover:text-[var(--color-ink)]",children:a}),s.jsxs("button",{type:"button",disabled:r,onClick:m,className:"inline-flex h-9 items-center justify-center gap-1.5 rounded-[8px] bg-[var(--color-ink)] px-3 text-[0.82rem] font-semibold text-white transition hover:bg-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:[r?s.jsx(jt,{className:"size-3.5 animate-spin"}):null,i,r?null:s.jsx(Jo,{className:"size-3.5"})]})]})]})}function IS(a,i,r){const u=new Map;for(const h of i){const x=u.get(h.sellerId)??{modelIds:new Set,protocols:new Set,paymentMethods:new Set,responseMsSamples:[],ttftMsSamples:[]};x.modelIds.add(h.id);for(const p of h.supportedProtocols)x.protocols.add(p);for(const p of h.paymentMethods)x.paymentMethods.add(p);x.minInputPriceMicrosPer1m=Pv(x.minInputPriceMicrosPer1m,h.inputPriceMicrosPer1m),x.minOutputPriceMicrosPer1m=Pv(x.minOutputPriceMicrosPer1m,h.outputPriceMicrosPer1m),u.set(h.sellerId,x)}for(const h of r){const x=h.sellerKey;if(!x)continue;const p=u.get(x)??{modelIds:new Set,protocols:new Set,paymentMethods:new Set,responseMsSamples:[],ttftMsSamples:[]};Number.isFinite(h.durationMs)&&p.responseMsSamples.push(h.durationMs),Number.isFinite(h.ttftMs)&&p.ttftMsSamples.push(h.ttftMs),u.set(x,p)}const d=a.map(h=>{const x=u.get(h.id);return{id:h.id,name:Iv(h.name??h.manifestSellerId??h.id),status:h.status,modelCount:h.modelCount??(x==null?void 0:x.modelIds.size)??0,protocols:h.supportedProtocols??Array.from((x==null?void 0:x.protocols)??[]),paymentMethods:h.paymentMethods??Array.from((x==null?void 0:x.paymentMethods)??[]),discountRatio:h.discountRatio,serviceFeeRatio:h.serviceFeeRatio,minInputPriceMicrosPer1m:x==null?void 0:x.minInputPriceMicrosPer1m,minOutputPriceMicrosPer1m:x==null?void 0:x.minOutputPriceMicrosPer1m,avgResponseMs:Do((x==null?void 0:x.responseMsSamples)??[]),avgTtftMs:Do((x==null?void 0:x.ttftMsSamples)??[])}}),m=new Set(d.map(h=>h.id));for(const[h,x]of u.entries()){if(m.has(h))continue;const p=i.find(v=>v.sellerId===h);d.push({id:h,name:Iv((p==null?void 0:p.sellerName)??h),status:"unknown",modelCount:x.modelIds.size,protocols:Array.from(x.protocols).sort(),paymentMethods:Array.from(x.paymentMethods).sort(),minInputPriceMicrosPer1m:x.minInputPriceMicrosPer1m,minOutputPriceMicrosPer1m:x.minOutputPriceMicrosPer1m,avgResponseMs:Do(x.responseMsSamples),avgTtftMs:Do(x.ttftMsSamples)})}return S0(d,{key:"status",direction:"asc"})}function S0(a,i){const r=i.direction==="asc"?1:-1;return[...a].sort((u,d)=>{const m=eN(u,d,i.key);if(m!==0)return m*r;const h=Vo(u.status)-Vo(d.status);return h!==0?h:d.modelCount!==u.modelCount?d.modelCount-u.modelCount:u.name.localeCompare(d.name)})}function eN(a,i,r){return r==="status"?Vo(a.status)-Vo(i.status):r==="name"?a.name.localeCompare(i.name):r==="models"?a.modelCount-i.modelCount:r==="price"?zd(Wv(a),Wv(i)):r==="discount"?zd(a.discountRatio,i.discountRatio):zd(a.avgResponseMs??a.avgTtftMs,i.avgResponseMs??i.avgTtftMs)}function Wv(a){if(!(!Number.isFinite(a.minInputPriceMicrosPer1m)&&!Number.isFinite(a.minOutputPriceMicrosPer1m)))return(a.minInputPriceMicrosPer1m??0)+(a.minOutputPriceMicrosPer1m??0)}function Pv(a,i){const r=Number.isFinite(a),u=Number.isFinite(i);if(r&&u)return Math.min(a,i);if(r)return a;if(u)return i}function Do(a){const i=a.filter(r=>Number.isFinite(r));if(i.length!==0)return i.reduce((r,u)=>r+u,0)/i.length}function zd(a,i){const r=Number.isFinite(a),u=Number.isFinite(i);return r&&u?a-i:r?-1:u?1:0}function Iv(a){var i;return((i=a.split("(")[0])==null?void 0:i.trim())||a}function tN(a,i){return!Number.isFinite(a)&&!Number.isFinite(i)?"-":`I ${ex(a)} / O ${ex(i)}`}function ex(a){if(!Number.isFinite(a))return"-";const i=a/1e6;return`$${i>=1?i.toFixed(2):i.toFixed(4)}`}function lN(a){if(!Number.isFinite(a))return"-";const i=a;if(i<=0)return"free";const r=Math.max(0,1-i);return r>=.01?`${Math.round(r*100)}% off`:`x${i.toFixed(2)}`}function aN(a,i){return!Number.isFinite(a)&&!Number.isFinite(i)?"-":Number.isFinite(a)&&Number.isFinite(i)?`${Math.round(a)}ms / T ${Math.round(i)}ms`:Number.isFinite(a)?`${Math.round(a)}ms`:`T ${Math.round(i)}ms`}function tx(a,i,r,u){const d=u||r[0]||"",m={};for(const h of a)h!=="custom"&&(m[h]=h==="claude-code"?M0(i[h],r,d):N0(h,i[h],d));return m}function N0(a,i,r){return(i==null?void 0:i.selectionKind)==="single-model"?{...i,protocolPreference:i.protocolPreference??Id(a),defaultModel:i.defaultModel||r}:{selectionKind:"single-model",protocolPreference:Id(a),defaultModel:r}}function M0(a,i,r){var m;const u=(a==null?void 0:a.selectionKind)==="claude-role-mapping"?(m=a.roles.sonnet)==null?void 0:m.upstreamModel:void 0,d=r||u||i[0]||"";return(a==null?void 0:a.selectionKind)==="claude-role-mapping"?{...a,protocolPreference:"messages",fallbackModel:a.fallbackModel||d,roles:{...a.roles,sonnet:a.roles.sonnet??(d?{upstreamModel:d,displayName:d}:void 0)}}:{selectionKind:"claude-role-mapping",protocolPreference:"messages",fallbackModel:d,roles:{sonnet:d?{upstreamModel:d,displayName:d}:void 0}}}function Id(a){if(a==="codex")return"responses";if(a==="claude-code"||a==="claude-desktop")return"messages";if(["openclaw","opencode","hermes"].includes(a))return"chat_completions"}function w0(a){return{id:"custom",name:"其他工具",status:"manual",detected:!0,configured:!1,reason:"复制本地推理服务接口到任意 OpenAI 或 Anthropic 兼容客户端。",manualConfig:{openaiBaseUrl:C0(a),anthropicBaseUrl:a,apiKey:"TOKENBUDDY_PROXY"}}}function C0(a){const i=a.replace(/\/+$/,"");return i.endsWith("/v1")?i:`${i}/v1`}function nN(a){const i=a.trim();return i?i.slice(0,1).toUpperCase():"?"}function iN(a,i,r,u){if(a==="fixed"){const d=r.trim();return d?{mode:a,scorer:i,sellerId:d}:void 0}if(a==="fixedSet"){const d=Array.from(new Set(u.map(m=>m.trim()).filter(Boolean)));return d.length===0?void 0:{mode:a,scorer:i,sellerIds:d}}return{mode:a,scorer:i}}function rN({serviceReady:a,modelCount:i,routingMode:r,paymentReady:u,configuredTools:d}){return[{title:a?"本地网关正在运行":"本地网关尚未就绪",body:a?"控制台服务和本地代理已经响应。":"请确认 tb-proxyd 已启动,并等待控制台刷新状态。",ok:a,status:a?"passed":"failed",details:[]},{title:i>0?"模型目录已加载":"模型目录尚未加载",body:i>0?`已发现 ${i} 个可用模型。`:"请检查供应商注册表或网络连接。",ok:i>0,status:i>0?"passed":"failed",details:[]},{title:"路由策略已选择",body:`当前策略为${T0(r)},TokenBuddy 会按这个策略规划供应商。`,ok:!!r,status:r?"passed":"failed",details:[]},{title:u?"支付方式可用":"支付方式尚未可用",body:u?"已经检测到至少一个可用支付方式。":"请完成 ClawTip 绑定,或稍后在支付页面补充配置。",ok:u,status:u?"passed":"warning",details:[]},{title:d>0?"终端工具已接入":"终端工具尚未接入",body:d>0?`已经写入 ${d} 个终端工具配置。`:"如果你还没有安装终端工具,可以稍后再执行接入。",ok:d>0,status:d>0?"passed":"warning",details:[]}]}function sN(a){return{title:a.label,body:a.message,ok:a.status==="passed"||a.status==="skipped",status:a.status,details:a.details}}function lx(a){return a==="passed"?"全部通过":a==="warning"?"存在警告":a==="failed"?"需要修复":"等待检查"}function oN(a){return a==="passed"?"bg-emerald-50 text-emerald-700":a==="warning"?"bg-amber-50 text-amber-700":a==="failed"?"bg-rose-50 text-rose-700":"bg-[var(--color-page)] text-[var(--color-muted)]"}function uN(a){return a==="passed"?"通过":a==="warning"?"警告":a==="failed"?"失败":"已跳过"}function cN(a){return a==="passed"?"bg-emerald-50 text-emerald-700":a==="failed"?"bg-rose-50 text-rose-700":a==="skipped"?"bg-slate-100 text-slate-600":"bg-amber-50 text-amber-700"}function dN(a){return a==="passed"?"bg-emerald-50 text-emerald-700":a==="failed"?"bg-rose-50 text-rose-700":a==="skipped"?"bg-slate-100 text-slate-600":"bg-amber-50 text-amber-700"}function T0(a){return a==="fixed"?"固定供应商":a==="fixedSet"?"固定供应商组":"全自动"}function fN(a){return a==="speed"?"速度优先":a==="discount"?"成本优先":"平衡模式"}function mN(a){const i=a.toLowerCase();return["ok","healthy","active","available"].includes(i)?"状态正常":["error","failed","unavailable"].includes(i)?"状态异常":["unknown","pending"].includes(i)?"等待检测":`状态:${a}`}function hN(a){const i=a.toLowerCase();return["ok","healthy","active","available"].includes(i)?"bg-emerald-50 text-emerald-700":["error","failed","unavailable"].includes(i)?"bg-rose-50 text-rose-700":"bg-amber-50 text-amber-700"}function Vo(a){const i=a.toLowerCase();return["ok","healthy","active","available"].includes(i)?0:["unknown","pending"].includes(i)?1:2}function E0(a){return a.configured?"已配置":a.status==="installed"?"已安装":a.status==="manual"?"需要手动配置":a.detected?"已检测到":"未检测到"}function pN(a){return a==="create"?"创建":"更新"}function vN(){return s.jsxs("div",{className:"min-h-full",children:[s.jsxs("nav",{"aria-label":"Primary",className:"sticky top-0 z-10 flex h-12 items-center gap-2 border-b border-[var(--color-line-2)] bg-[var(--color-page)]/95 px-3 backdrop-blur sm:gap-5 sm:px-6",children:[s.jsxs(df,{to:"/overview","aria-label":"TokenBuddy home",className:"group inline-flex shrink-0 items-center rounded-[var(--radius-md)] px-1 py-1.5 focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)]",children:[s.jsx("span",{className:"font-mono text-[0.86rem] font-bold uppercase tracking-[0.14em] text-[var(--color-ink)]",children:"tokenbuddy"}),s.jsx("span",{className:"ml-1.5 inline-block size-1.5 rounded-full bg-[var(--color-primary)] shadow-[0_0_0_3px_rgba(124,61,240,0.18)]","aria-hidden":!0})]}),s.jsxs("div",{className:"ml-auto flex min-w-0 gap-0.5 sm:gap-1",children:[s.jsx(Rd,{to:"/overview",children:"Overview"}),s.jsx(Rd,{to:"/routing",children:"Routing"}),s.jsx(Rd,{to:"/ledger",children:"Ledger"})]})]}),s.jsx("main",{className:"mx-auto max-w-[1180px] px-3 py-5 sm:px-6 sm:py-7",children:s.jsxs(Fg,{children:[s.jsx(Ni,{path:"/",element:s.jsx(Yv,{})}),s.jsx(Ni,{path:"/overview",element:s.jsx(Yv,{})}),s.jsx(Ni,{path:"/init",element:s.jsx(_S,{})}),s.jsx(Ni,{path:"/routing",element:s.jsx(Qj,{})}),s.jsx(Ni,{path:"/ledger",element:s.jsx(cS,{})})]})})]})}function Rd({to:a,children:i}){return s.jsx(df,{to:a,className:({isActive:r})=>["rounded-[var(--radius-md)] px-2 py-1.5 text-[0.82rem] font-medium transition-colors sm:px-3.5 sm:text-[0.92rem]",r?"font-semibold text-[var(--color-ink)] underline decoration-[var(--color-primary)] decoration-2 underline-offset-[10px]":"text-[var(--color-muted)] hover:text-[var(--color-ink)]"].join(" "),children:i})}function xN(){!("serviceWorker"in navigator)||window.location.port==="5173"||window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(()=>{})})}const yN=new e2({defaultOptions:{queries:{staleTime:5e3,refetchOnWindowFocus:!1,retry:1}}});Wb.createRoot(document.getElementById("root")).render(s.jsx(j.StrictMode,{children:s.jsx(t2,{client:yN,children:s.jsx(g1,{children:s.jsx(vN,{})})})}));xN();
|
|
236
|
+
//# sourceMappingURL=index-BbKhGBef.js.map
|