ldrouter 1.16.2 → 1.16.3
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/CHANGELOG.md +9 -38
- package/README.md +1 -23
- package/dist/server/app.js +1 -10
- package/dist/server/auth/middleware.js +1 -37
- package/dist/server/db/index.js +0 -5
- package/dist/server/db/migrate.js +5 -38
- package/dist/server/db/schema.js +3 -44
- package/dist/server/errors.js +11 -0
- package/dist/server/gateway/runner.js +64 -126
- package/dist/server/protocols/anthropic.js +5 -3
- package/dist/server/protocols/canonical.js +29 -8
- package/dist/server/providers/index.js +25 -8
- package/dist/server/routes/admin/auth.js +1 -4
- package/dist/server/routes/admin/combos.js +98 -48
- package/dist/server/routes/admin/models.js +34 -24
- package/dist/server/routes/admin/providers.js +20 -63
- package/dist/server/routes/admin/requests.js +0 -1
- package/dist/server/routes/admin.js +0 -12
- package/dist/server/routes/gateway/anthropic.js +3 -3
- package/dist/server/routes/gateway/openai.js +5 -5
- package/dist/server/routing/capabilities.js +73 -14
- package/dist/server/routing/combo.js +20 -39
- package/dist/server/routing/resolver.js +16 -11
- package/dist/server/upstream/client.js +55 -61
- package/dist/web/assets/index-C5h2WXK5.css +1 -0
- package/dist/web/assets/index-CRnoua24.js +335 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -5
- package/dist/server/db/repositories/codex-accounts.js +0 -187
- package/dist/server/providers/codex-autostart.js +0 -98
- package/dist/server/providers/codex-import.js +0 -156
- package/dist/server/providers/codex-oauth.js +0 -77
- package/dist/server/providers/codex-refresh.js +0 -165
- package/dist/server/providers/codex-usage.js +0 -192
- package/dist/server/providers/codex.js +0 -186
- package/dist/server/routes/admin/codex.js +0 -331
- package/dist/web/assets/index-Coy-u6h8.css +0 -1
- package/dist/web/assets/index-qDG5c6aL.js +0 -386
- package/migrations/0005_codex_accounts.sql +0 -105
- package/migrations/0006_codex_usage.sql +0 -9
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
var yx=n=>{throw TypeError(n)};var bx=(n,l,o)=>l.has(n)||yx("Cannot "+o);var Kt=(n,l,o)=>(bx(n,l,"read from private field"),o?o.call(n):l.get(n)),Sx=(n,l,o)=>l.has(n)?yx("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(n):l.set(n,o),pf=(n,l,o,i)=>(bx(n,l,"write to private field"),i?i.call(n,o):l.set(n,o),o);function nj(n,l){for(var o=0;o<l.length;o++){const i=l[o];if(typeof i!="string"&&!Array.isArray(i)){for(const u in i)if(u!=="default"&&!(u in n)){const d=Object.getOwnPropertyDescriptor(i,u);d&&Object.defineProperty(n,u,d.get?d:{enumerable:!0,get:()=>i[u]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))i(u);new MutationObserver(u=>{for(const d of u)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&i(h)}).observe(document,{childList:!0,subtree:!0});function o(u){const d={};return u.integrity&&(d.integrity=u.integrity),u.referrerPolicy&&(d.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?d.credentials="include":u.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function i(u){if(u.ep)return;u.ep=!0;const d=o(u);fetch(u.href,d)}})();function xh(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var gf={exports:{}},yo={};/**
|
|
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 wx;function aj(){if(wx)return yo;wx=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function o(i,u,d){var h=null;if(d!==void 0&&(h=""+d),u.key!==void 0&&(h=""+u.key),"key"in u){d={};for(var p in u)p!=="key"&&(d[p]=u[p])}else d=u;return u=d.ref,{$$typeof:n,type:i,key:h,ref:u!==void 0?u:null,props:d}}return yo.Fragment=l,yo.jsx=o,yo.jsxs=o,yo}var jx;function lj(){return jx||(jx=1,gf.exports=aj()),gf.exports}var s=lj(),vf={exports:{}},De={};/**
|
|
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 Cx;function rj(){if(Cx)return De;Cx=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),h=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),S=Symbol.iterator;function w(_){return _===null||typeof _!="object"?null:(_=S&&_[S]||_["@@iterator"],typeof _=="function"?_:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,j={};function R(_,P,Q){this.props=_,this.context=P,this.refs=j,this.updater=Q||C}R.prototype.isReactComponent={},R.prototype.setState=function(_,P){if(typeof _!="object"&&typeof _!="function"&&_!=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,_,P,"setState")},R.prototype.forceUpdate=function(_){this.updater.enqueueForceUpdate(this,_,"forceUpdate")};function A(){}A.prototype=R.prototype;function T(_,P,Q){this.props=_,this.context=P,this.refs=j,this.updater=Q||C}var D=T.prototype=new A;D.constructor=T,E(D,R.prototype),D.isPureReactComponent=!0;var O=Array.isArray;function M(){}var B={H:null,A:null,T:null,S:null},z=Object.prototype.hasOwnProperty;function K(_,P,Q){var re=Q.ref;return{$$typeof:n,type:_,key:P,ref:re!==void 0?re:null,props:Q}}function oe(_,P){return K(_.type,P,_.props)}function X(_){return typeof _=="object"&&_!==null&&_.$$typeof===n}function q(_){var P={"=":"=0",":":"=2"};return"$"+_.replace(/[=:]/g,function(Q){return P[Q]})}var le=/\/+/g;function J(_,P){return typeof _=="object"&&_!==null&&_.key!=null?q(""+_.key):P.toString(36)}function ce(_){switch(_.status){case"fulfilled":return _.value;case"rejected":throw _.reason;default:switch(typeof _.status=="string"?_.then(M,M):(_.status="pending",_.then(function(P){_.status==="pending"&&(_.status="fulfilled",_.value=P)},function(P){_.status==="pending"&&(_.status="rejected",_.reason=P)})),_.status){case"fulfilled":return _.value;case"rejected":throw _.reason}}throw _}function U(_,P,Q,re,fe){var be=typeof _;(be==="undefined"||be==="boolean")&&(_=null);var G=!1;if(_===null)G=!0;else switch(be){case"bigint":case"string":case"number":G=!0;break;case"object":switch(_.$$typeof){case n:case l:G=!0;break;case x:return G=_._init,U(G(_._payload),P,Q,re,fe)}}if(G)return fe=fe(_),G=re===""?"."+J(_,0):re,O(fe)?(Q="",G!=null&&(Q=G.replace(le,"$&/")+"/"),U(fe,P,Q,"",function(Ce){return Ce})):fe!=null&&(X(fe)&&(fe=oe(fe,Q+(fe.key==null||_&&_.key===fe.key?"":(""+fe.key).replace(le,"$&/")+"/")+G)),P.push(fe)),1;G=0;var ie=re===""?".":re+":";if(O(_))for(var me=0;me<_.length;me++)re=_[me],be=ie+J(re,me),G+=U(re,P,Q,be,fe);else if(me=w(_),typeof me=="function")for(_=me.call(_),me=0;!(re=_.next()).done;)re=re.value,be=ie+J(re,me++),G+=U(re,P,Q,be,fe);else if(be==="object"){if(typeof _.then=="function")return U(ce(_),P,Q,re,fe);throw P=String(_),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(_).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return G}function Y(_,P,Q){if(_==null)return _;var re=[],fe=0;return U(_,re,"","",function(be){return P.call(Q,be,fe++)}),re}function ae(_){if(_._status===-1){var P=_._result;P=P(),P.then(function(Q){(_._status===0||_._status===-1)&&(_._status=1,_._result=Q)},function(Q){(_._status===0||_._status===-1)&&(_._status=2,_._result=Q)}),_._status===-1&&(_._status=0,_._result=P)}if(_._status===1)return _._result.default;throw _._result}var W=typeof reportError=="function"?reportError:function(_){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof _=="object"&&_!==null&&typeof _.message=="string"?String(_.message):String(_),error:_});if(!window.dispatchEvent(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",_);return}console.error(_)},te={map:Y,forEach:function(_,P,Q){Y(_,function(){P.apply(this,arguments)},Q)},count:function(_){var P=0;return Y(_,function(){P++}),P},toArray:function(_){return Y(_,function(P){return P})||[]},only:function(_){if(!X(_))throw Error("React.Children.only expected to receive a single React element child.");return _}};return De.Activity=y,De.Children=te,De.Component=R,De.Fragment=o,De.Profiler=u,De.PureComponent=T,De.StrictMode=i,De.Suspense=g,De.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,De.__COMPILER_RUNTIME={__proto__:null,c:function(_){return B.H.useMemoCache(_)}},De.cache=function(_){return function(){return _.apply(null,arguments)}},De.cacheSignal=function(){return null},De.cloneElement=function(_,P,Q){if(_==null)throw Error("The argument must be a React element, but you passed "+_+".");var re=E({},_.props),fe=_.key;if(P!=null)for(be in P.key!==void 0&&(fe=""+P.key),P)!z.call(P,be)||be==="key"||be==="__self"||be==="__source"||be==="ref"&&P.ref===void 0||(re[be]=P[be]);var be=arguments.length-2;if(be===1)re.children=Q;else if(1<be){for(var G=Array(be),ie=0;ie<be;ie++)G[ie]=arguments[ie+2];re.children=G}return K(_.type,fe,re)},De.createContext=function(_){return _={$$typeof:h,_currentValue:_,_currentValue2:_,_threadCount:0,Provider:null,Consumer:null},_.Provider=_,_.Consumer={$$typeof:d,_context:_},_},De.createElement=function(_,P,Q){var re,fe={},be=null;if(P!=null)for(re in P.key!==void 0&&(be=""+P.key),P)z.call(P,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(fe[re]=P[re]);var G=arguments.length-2;if(G===1)fe.children=Q;else if(1<G){for(var ie=Array(G),me=0;me<G;me++)ie[me]=arguments[me+2];fe.children=ie}if(_&&_.defaultProps)for(re in G=_.defaultProps,G)fe[re]===void 0&&(fe[re]=G[re]);return K(_,be,fe)},De.createRef=function(){return{current:null}},De.forwardRef=function(_){return{$$typeof:p,render:_}},De.isValidElement=X,De.lazy=function(_){return{$$typeof:x,_payload:{_status:-1,_result:_},_init:ae}},De.memo=function(_,P){return{$$typeof:v,type:_,compare:P===void 0?null:P}},De.startTransition=function(_){var P=B.T,Q={};B.T=Q;try{var re=_(),fe=B.S;fe!==null&&fe(Q,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(M,W)}catch(be){W(be)}finally{P!==null&&Q.types!==null&&(P.types=Q.types),B.T=P}},De.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},De.use=function(_){return B.H.use(_)},De.useActionState=function(_,P,Q){return B.H.useActionState(_,P,Q)},De.useCallback=function(_,P){return B.H.useCallback(_,P)},De.useContext=function(_){return B.H.useContext(_)},De.useDebugValue=function(){},De.useDeferredValue=function(_,P){return B.H.useDeferredValue(_,P)},De.useEffect=function(_,P){return B.H.useEffect(_,P)},De.useEffectEvent=function(_){return B.H.useEffectEvent(_)},De.useId=function(){return B.H.useId()},De.useImperativeHandle=function(_,P,Q){return B.H.useImperativeHandle(_,P,Q)},De.useInsertionEffect=function(_,P){return B.H.useInsertionEffect(_,P)},De.useLayoutEffect=function(_,P){return B.H.useLayoutEffect(_,P)},De.useMemo=function(_,P){return B.H.useMemo(_,P)},De.useOptimistic=function(_,P){return B.H.useOptimistic(_,P)},De.useReducer=function(_,P,Q){return B.H.useReducer(_,P,Q)},De.useRef=function(_){return B.H.useRef(_)},De.useState=function(_){return B.H.useState(_)},De.useSyncExternalStore=function(_,P,Q){return B.H.useSyncExternalStore(_,P,Q)},De.useTransition=function(){return B.H.useTransition()},De.version="19.2.8",De}var Ex;function yh(){return Ex||(Ex=1,vf.exports=rj()),vf.exports}var m=yh();const ue=xh(m),vs=nj({__proto__:null,default:ue},[m]);var xf={exports:{}},bo={},yf={exports:{}},bf={};/**
|
|
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 Nx;function sj(){return Nx||(Nx=1,(function(n){function l(U,Y){var ae=U.length;U.push(Y);e:for(;0<ae;){var W=ae-1>>>1,te=U[W];if(0<u(te,Y))U[W]=Y,U[ae]=te,ae=W;else break e}}function o(U){return U.length===0?null:U[0]}function i(U){if(U.length===0)return null;var Y=U[0],ae=U.pop();if(ae!==Y){U[0]=ae;e:for(var W=0,te=U.length,_=te>>>1;W<_;){var P=2*(W+1)-1,Q=U[P],re=P+1,fe=U[re];if(0>u(Q,ae))re<te&&0>u(fe,Q)?(U[W]=fe,U[re]=ae,W=re):(U[W]=Q,U[P]=ae,W=P);else if(re<te&&0>u(fe,ae))U[W]=fe,U[re]=ae,W=re;else break e}}return Y}function u(U,Y){var ae=U.sortIndex-Y.sortIndex;return ae!==0?ae:U.id-Y.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;n.unstable_now=function(){return d.now()}}else{var h=Date,p=h.now();n.unstable_now=function(){return h.now()-p}}var g=[],v=[],x=1,y=null,S=3,w=!1,C=!1,E=!1,j=!1,R=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function D(U){for(var Y=o(v);Y!==null;){if(Y.callback===null)i(v);else if(Y.startTime<=U)i(v),Y.sortIndex=Y.expirationTime,l(g,Y);else break;Y=o(v)}}function O(U){if(E=!1,D(U),!C)if(o(g)!==null)C=!0,M||(M=!0,q());else{var Y=o(v);Y!==null&&ce(O,Y.startTime-U)}}var M=!1,B=-1,z=5,K=-1;function oe(){return j?!0:!(n.unstable_now()-K<z)}function X(){if(j=!1,M){var U=n.unstable_now();K=U;var Y=!0;try{e:{C=!1,E&&(E=!1,A(B),B=-1),w=!0;var ae=S;try{t:{for(D(U),y=o(g);y!==null&&!(y.expirationTime>U&&oe());){var W=y.callback;if(typeof W=="function"){y.callback=null,S=y.priorityLevel;var te=W(y.expirationTime<=U);if(U=n.unstable_now(),typeof te=="function"){y.callback=te,D(U),Y=!0;break t}y===o(g)&&i(g),D(U)}else i(g);y=o(g)}if(y!==null)Y=!0;else{var _=o(v);_!==null&&ce(O,_.startTime-U),Y=!1}}break e}finally{y=null,S=ae,w=!1}Y=void 0}}finally{Y?q():M=!1}}}var q;if(typeof T=="function")q=function(){T(X)};else if(typeof MessageChannel<"u"){var le=new MessageChannel,J=le.port2;le.port1.onmessage=X,q=function(){J.postMessage(null)}}else q=function(){R(X,0)};function ce(U,Y){B=R(function(){U(n.unstable_now())},Y)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(U){U.callback=null},n.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<U?Math.floor(1e3/U):5},n.unstable_getCurrentPriorityLevel=function(){return S},n.unstable_next=function(U){switch(S){case 1:case 2:case 3:var Y=3;break;default:Y=S}var ae=S;S=Y;try{return U()}finally{S=ae}},n.unstable_requestPaint=function(){j=!0},n.unstable_runWithPriority=function(U,Y){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var ae=S;S=U;try{return Y()}finally{S=ae}},n.unstable_scheduleCallback=function(U,Y,ae){var W=n.unstable_now();switch(typeof ae=="object"&&ae!==null?(ae=ae.delay,ae=typeof ae=="number"&&0<ae?W+ae:W):ae=W,U){case 1:var te=-1;break;case 2:te=250;break;case 5:te=1073741823;break;case 4:te=1e4;break;default:te=5e3}return te=ae+te,U={id:x++,callback:Y,priorityLevel:U,startTime:ae,expirationTime:te,sortIndex:-1},ae>W?(U.sortIndex=ae,l(v,U),o(g)===null&&U===o(v)&&(E?(A(B),B=-1):E=!0,ce(O,ae-W))):(U.sortIndex=te,l(g,U),C||w||(C=!0,M||(M=!0,q()))),U},n.unstable_shouldYield=oe,n.unstable_wrapCallback=function(U){var Y=S;return function(){var ae=S;S=Y;try{return U.apply(this,arguments)}finally{S=ae}}}})(bf)),bf}var Rx;function oj(){return Rx||(Rx=1,yf.exports=sj()),yf.exports}var Sf={exports:{}},Xt={};/**
|
|
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 Tx;function ij(){if(Tx)return Xt;Tx=1;var n=yh();function l(g){var v="https://react.dev/errors/"+g;if(1<arguments.length){v+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)v+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+g+"; visit "+v+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var i={d:{f:o,r:function(){throw Error(l(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},u=Symbol.for("react.portal");function d(g,v,x){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:y==null?null:""+y,children:g,containerInfo:v,implementation:x}}var h=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(g,v){if(g==="font")return"";if(typeof v=="string")return v==="use-credentials"?v:""}return Xt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Xt.createPortal=function(g,v){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!v||v.nodeType!==1&&v.nodeType!==9&&v.nodeType!==11)throw Error(l(299));return d(g,v,null,x)},Xt.flushSync=function(g){var v=h.T,x=i.p;try{if(h.T=null,i.p=2,g)return g()}finally{h.T=v,i.p=x,i.d.f()}},Xt.preconnect=function(g,v){typeof g=="string"&&(v?(v=v.crossOrigin,v=typeof v=="string"?v==="use-credentials"?v:"":void 0):v=null,i.d.C(g,v))},Xt.prefetchDNS=function(g){typeof g=="string"&&i.d.D(g)},Xt.preinit=function(g,v){if(typeof g=="string"&&v&&typeof v.as=="string"){var x=v.as,y=p(x,v.crossOrigin),S=typeof v.integrity=="string"?v.integrity:void 0,w=typeof v.fetchPriority=="string"?v.fetchPriority:void 0;x==="style"?i.d.S(g,typeof v.precedence=="string"?v.precedence:void 0,{crossOrigin:y,integrity:S,fetchPriority:w}):x==="script"&&i.d.X(g,{crossOrigin:y,integrity:S,fetchPriority:w,nonce:typeof v.nonce=="string"?v.nonce:void 0})}},Xt.preinitModule=function(g,v){if(typeof g=="string")if(typeof v=="object"&&v!==null){if(v.as==null||v.as==="script"){var x=p(v.as,v.crossOrigin);i.d.M(g,{crossOrigin:x,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0})}}else v==null&&i.d.M(g)},Xt.preload=function(g,v){if(typeof g=="string"&&typeof v=="object"&&v!==null&&typeof v.as=="string"){var x=v.as,y=p(x,v.crossOrigin);i.d.L(g,x,{crossOrigin:y,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})}},Xt.preloadModule=function(g,v){if(typeof g=="string")if(v){var x=p(v.as,v.crossOrigin);i.d.m(g,{as:typeof v.as=="string"&&v.as!=="script"?v.as:void 0,crossOrigin:x,integrity:typeof v.integrity=="string"?v.integrity:void 0})}else i.d.m(g)},Xt.requestFormReset=function(g){i.d.r(g)},Xt.unstable_batchedUpdates=function(g,v){return g(v)},Xt.useFormState=function(g,v,x){return h.H.useFormState(g,v,x)},Xt.useFormStatus=function(){return h.H.useHostTransitionStatus()},Xt.version="19.2.8",Xt}var Ax;function wy(){if(Ax)return Sf.exports;Ax=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),Sf.exports=ij(),Sf.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 Mx;function cj(){if(Mx)return bo;Mx=1;var n=oj(),l=yh(),o=wy();function i(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}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 u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a: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 p(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 g(e){if(d(e)!==e)throw Error(i(188))}function v(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(i(188));return t!==e?null:e}for(var a=e,r=t;;){var c=a.return;if(c===null)break;var f=c.alternate;if(f===null){if(r=c.return,r!==null){a=r;continue}break}if(c.child===f.child){for(f=c.child;f;){if(f===a)return g(c),e;if(f===r)return g(c),t;f=f.sibling}throw Error(i(188))}if(a.return!==r.return)a=c,r=f;else{for(var b=!1,N=c.child;N;){if(N===a){b=!0,a=c,r=f;break}if(N===r){b=!0,r=c,a=f;break}N=N.sibling}if(!b){for(N=f.child;N;){if(N===a){b=!0,a=f,r=c;break}if(N===r){b=!0,r=f,a=c;break}N=N.sibling}if(!b)throw Error(i(189))}}if(a.alternate!==r)throw Error(i(190))}if(a.tag!==3)throw Error(i(188));return a.stateNode.current===a?e:t}function x(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=x(e),t!==null)return t;e=e.sibling}return null}var y=Object.assign,S=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),T=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),K=Symbol.for("react.activity"),oe=Symbol.for("react.memo_cache_sentinel"),X=Symbol.iterator;function q(e){return e===null||typeof e!="object"?null:(e=X&&e[X]||e["@@iterator"],typeof e=="function"?e:null)}var le=Symbol.for("react.client.reference");function J(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===le?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case R:return"Profiler";case j:return"StrictMode";case O:return"Suspense";case M:return"SuspenseList";case K:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case C:return"Portal";case T:return e.displayName||"Context";case A:return(e._context.displayName||"Context")+".Consumer";case D:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case B:return t=e.displayName||null,t!==null?t:J(e.type)||"Memo";case z:t=e._payload,e=e._init;try{return J(e(t))}catch{}}return null}var ce=Array.isArray,U=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},W=[],te=-1;function _(e){return{current:e}}function P(e){0>te||(e.current=W[te],W[te]=null,te--)}function Q(e,t){te++,W[te]=e.current,e.current=t}var re=_(null),fe=_(null),be=_(null),G=_(null);function ie(e,t){switch(Q(be,t),Q(fe,e),Q(re,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Iv(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Iv(t),e=Vv(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}P(re),Q(re,e)}function me(){P(re),P(fe),P(be)}function Ce(e){e.memoizedState!==null&&Q(G,e);var t=re.current,a=Vv(t,e.type);t!==a&&(Q(fe,e),Q(re,a))}function Me(e){fe.current===e&&(P(re),P(fe)),G.current===e&&(P(G),po._currentValue=ae)}var Ae,Le;function pt(e){if(Ae===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Ae=t&&t[1]||"",Le=-1<a.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+Ae+e+Le}var gt=!1;function se(e,t){if(!e||gt)return"";gt=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var ne=function(){throw Error()};if(Object.defineProperty(ne.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ne,[])}catch(F){var $=F}Reflect.construct(e,[],ne)}else{try{ne.call()}catch(F){$=F}e.call(ne.prototype)}}else{try{throw Error()}catch(F){$=F}(ne=e())&&typeof ne.catch=="function"&&ne.catch(function(){})}}catch(F){if(F&&$&&typeof F.stack=="string")return[F.stack,$.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=r.DetermineComponentFrameRoot(),b=f[0],N=f[1];if(b&&N){var k=b.split(`
|
|
44
|
+
`),V=N.split(`
|
|
45
|
+
`);for(c=r=0;r<k.length&&!k[r].includes("DetermineComponentFrameRoot");)r++;for(;c<V.length&&!V[c].includes("DetermineComponentFrameRoot");)c++;if(r===k.length||c===V.length)for(r=k.length-1,c=V.length-1;1<=r&&0<=c&&k[r]!==V[c];)c--;for(;1<=r&&0<=c;r--,c--)if(k[r]!==V[c]){if(r!==1||c!==1)do if(r--,c--,0>c||k[r]!==V[c]){var Z=`
|
|
46
|
+
`+k[r].replace(" at new "," at ");return e.displayName&&Z.includes("<anonymous>")&&(Z=Z.replace("<anonymous>",e.displayName)),Z}while(1<=r&&0<=c);break}}}finally{gt=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?pt(a):""}function Ue(e,t){switch(e.tag){case 26:case 27:case 5:return pt(e.type);case 16:return pt("Lazy");case 13:return e.child!==t&&t!==null?pt("Suspense Fallback"):pt("Suspense");case 19:return pt("SuspenseList");case 0:case 15:return se(e.type,!1);case 11:return se(e.type.render,!1);case 1:return se(e.type,!0);case 31:return pt("Activity");default:return""}}function Ye(e){try{var t="",a=null;do t+=Ue(e,a),a=e,e=e.return;while(e);return t}catch(r){return`
|
|
47
|
+
Error generating stack: `+r.message+`
|
|
48
|
+
`+r.stack}}var Ht=Object.prototype.hasOwnProperty,Ft=n.unstable_scheduleCallback,bn=n.unstable_cancelCallback,ea=n.unstable_shouldYield,Qt=n.unstable_requestPaint,St=n.unstable_now,Sn=n.unstable_getCurrentPriorityLevel,Ct=n.unstable_ImmediatePriority,Zt=n.unstable_UserBlockingPriority,Ra=n.unstable_NormalPriority,Ts=n.unstable_LowPriority,Yl=n.unstable_IdlePriority,eu=n.log,Io=n.unstable_setDisableYieldValue,Ta=null,Et=null;function ta(e){if(typeof eu=="function"&&Io(e),Et&&typeof Et.setStrictMode=="function")try{Et.setStrictMode(Ta,e)}catch{}}var Nt=Math.clz32?Math.clz32:Vo,tu=Math.log,nu=Math.LN2;function Vo(e){return e>>>=0,e===0?32:31-(tu(e)/nu|0)|0}var $l=256,wr=262144,il=4194304;function $t(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 jr(e,t,a){var r=e.pendingLanes;if(r===0)return 0;var c=0,f=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var N=r&134217727;return N!==0?(r=N&~f,r!==0?c=$t(r):(b&=N,b!==0?c=$t(b):a||(a=N&~e,a!==0&&(c=$t(a))))):(N=r&~f,N!==0?c=$t(N):b!==0?c=$t(b):a||(a=r&~e,a!==0&&(c=$t(a)))),c===0?0:t!==0&&t!==c&&(t&f)===0&&(f=c&-c,a=t&-t,f>=a||f===32&&(a&4194048)!==0)?t:c}function Te(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Qe(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 ct(){var e=il;return il<<=1,(il&62914560)===0&&(il=4194304),e}function Jt(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Pt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function da(e,t,a,r,c,f){var b=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var N=e.entanglements,k=e.expirationTimes,V=e.hiddenUpdates;for(a=b&~a;0<a;){var Z=31-Nt(a),ne=1<<Z;N[Z]=0,k[Z]=-1;var $=V[Z];if($!==null)for(V[Z]=null,Z=0;Z<$.length;Z++){var F=$[Z];F!==null&&(F.lane&=-536870913)}a&=~ne}r!==0&&fa(e,r,0),f!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=f&~(b&~t))}function fa(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Nt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|a&261930}function tn(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-Nt(a),c=1<<r;c&t|e[r]&t&&(e[r]|=t),a&=~c}}function na(e,t){var a=t&-t;return a=(a&42)!==0?1:au(a),(a&(e.suspendedLanes|t))!==0?0:a}function au(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 lu(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Rm(){var e=Y.p;return e!==0?e:(e=window.event,e===void 0?32:fx(e.type))}function Tm(e,t){var a=Y.p;try{return Y.p=e,t()}finally{Y.p=a}}var cl=Math.random().toString(36).slice(2),qt="__reactFiber$"+cl,nn="__reactProps$"+cl,Cr="__reactContainer$"+cl,ru="__reactEvents$"+cl,Y1="__reactListeners$"+cl,$1="__reactHandles$"+cl,Am="__reactResources$"+cl,As="__reactMarker$"+cl;function su(e){delete e[qt],delete e[nn],delete e[ru],delete e[Y1],delete e[$1]}function Er(e){var t=e[qt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[Cr]||a[qt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Qv(e);e!==null;){if(a=e[qt])return a;e=Qv(e)}return t}e=a,a=e.parentNode}return null}function Nr(e){if(e=e[qt]||e[Cr]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ms(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Rr(e){var t=e[Am];return t||(t=e[Am]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function zt(e){e[As]=!0}var Mm=new Set,Dm={};function Kl(e,t){Tr(e,t),Tr(e+"Capture",t)}function Tr(e,t){for(Dm[e]=t,e=0;e<t.length;e++)Mm.add(t[e])}var K1=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]*$"),_m={},Om={};function X1(e){return Ht.call(Om,e)?!0:Ht.call(_m,e)?!1:K1.test(e)?Om[e]=!0:(_m[e]=!0,!1)}function Go(e,t,a){if(X1(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function Yo(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function Aa(e,t,a,r){if(r===null)e.removeAttribute(a);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+r)}}function Ln(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function km(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function F1(e,t,a){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var c=r.get,f=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(b){a=""+b,f.call(this,b)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(b){a=""+b},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ou(e){if(!e._valueTracker){var t=km(e)?"checked":"value";e._valueTracker=F1(e,t,""+e[t])}}function zm(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=km(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}function $o(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 Q1=/[\n"\\]/g;function Un(e){return e.replace(Q1,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function iu(e,t,a,r,c,f,b,N){e.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.type=b:e.removeAttribute("type"),t!=null?b==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ln(t)):e.value!==""+Ln(t)&&(e.value=""+Ln(t)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),t!=null?cu(e,b,Ln(t)):a!=null?cu(e,b,Ln(a)):r!=null&&e.removeAttribute("value"),c==null&&f!=null&&(e.defaultChecked=!!f),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?e.name=""+Ln(N):e.removeAttribute("name")}function Lm(e,t,a,r,c,f,b,N){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||a!=null){if(!(f!=="submit"&&f!=="reset"||t!=null)){ou(e);return}a=a!=null?""+Ln(a):"",t=t!=null?""+Ln(t):a,N||t===e.value||(e.value=t),e.defaultValue=t}r=r??c,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=N?e.checked:!!r,e.defaultChecked=!!r,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b),ou(e)}function cu(e,t,a){t==="number"&&$o(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Ar(e,t,a,r){if(e=e.options,t){t={};for(var c=0;c<a.length;c++)t["$"+a[c]]=!0;for(a=0;a<e.length;a++)c=t.hasOwnProperty("$"+e[a].value),e[a].selected!==c&&(e[a].selected=c),c&&r&&(e[a].defaultSelected=!0)}else{for(a=""+Ln(a),t=null,c=0;c<e.length;c++){if(e[c].value===a){e[c].selected=!0,r&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function Um(e,t,a){if(t!=null&&(t=""+Ln(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Ln(a):""}function Bm(e,t,a,r){if(t==null){if(r!=null){if(a!=null)throw Error(i(92));if(ce(r)){if(1<r.length)throw Error(i(93));r=r[0]}a=r}a==null&&(a=""),t=a}a=Ln(t),e.defaultValue=a,r=e.textContent,r===a&&r!==""&&r!==null&&(e.value=r),ou(e)}function Mr(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var Z1=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 Hm(e,t,a){var r=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,a):typeof a!="number"||a===0||Z1.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Pm(e,t,a){if(t!=null&&typeof t!="object")throw Error(i(62));if(e=e.style,a!=null){for(var r in a)!a.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var c in t)r=t[c],t.hasOwnProperty(c)&&a[c]!==r&&Hm(e,c,r)}else for(var f in t)t.hasOwnProperty(f)&&Hm(e,f,t[f])}function uu(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 J1=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"]]),W1=/^[\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 Ko(e){return W1.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ma(){}var du=null;function fu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Dr=null,_r=null;function qm(e){var t=Nr(e);if(t&&(e=t.stateNode)){var a=e[nn]||null;e:switch(e=t.stateNode,t.type){case"input":if(iu(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Un(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var r=a[t];if(r!==e&&r.form===e.form){var c=r[nn]||null;if(!c)throw Error(i(90));iu(r,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<a.length;t++)r=a[t],r.form===e.form&&zm(r)}break e;case"textarea":Um(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Ar(e,!!a.multiple,t,!1)}}}var hu=!1;function Im(e,t,a){if(hu)return e(t,a);hu=!0;try{var r=e(t);return r}finally{if(hu=!1,(Dr!==null||_r!==null)&&(ki(),Dr&&(t=Dr,e=_r,_r=Dr=null,qm(t),e)))for(t=0;t<e.length;t++)qm(e[t])}}function Ds(e,t){var a=e.stateNode;if(a===null)return null;var r=a[nn]||null;if(r===null)return null;a=r[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":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(i(231,t,typeof a));return a}var Da=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),mu=!1;if(Da)try{var _s={};Object.defineProperty(_s,"passive",{get:function(){mu=!0}}),window.addEventListener("test",_s,_s),window.removeEventListener("test",_s,_s)}catch{mu=!1}var ul=null,pu=null,Xo=null;function Vm(){if(Xo)return Xo;var e,t=pu,a=t.length,r,c="value"in ul?ul.value:ul.textContent,f=c.length;for(e=0;e<a&&t[e]===c[e];e++);var b=a-e;for(r=1;r<=b&&t[a-r]===c[f-r];r++);return Xo=c.slice(e,1<r?1-r:void 0)}function Fo(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 Qo(){return!0}function Gm(){return!1}function an(e){function t(a,r,c,f,b){this._reactName=a,this._targetInst=c,this.type=r,this.nativeEvent=f,this.target=b,this.currentTarget=null;for(var N in e)e.hasOwnProperty(N)&&(a=e[N],this[N]=a?a(f):f[N]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?Qo:Gm,this.isPropagationStopped=Gm,this}return y(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Qo)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Qo)},persist:function(){},isPersistent:Qo}),t}var Xl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Zo=an(Xl),Os=y({},Xl,{view:0,detail:0}),eS=an(Os),gu,vu,ks,Jo=y({},Os,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:yu,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!==ks&&(ks&&e.type==="mousemove"?(gu=e.screenX-ks.screenX,vu=e.screenY-ks.screenY):vu=gu=0,ks=e),gu)},movementY:function(e){return"movementY"in e?e.movementY:vu}}),Ym=an(Jo),tS=y({},Jo,{dataTransfer:0}),nS=an(tS),aS=y({},Os,{relatedTarget:0}),xu=an(aS),lS=y({},Xl,{animationName:0,elapsedTime:0,pseudoElement:0}),rS=an(lS),sS=y({},Xl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),oS=an(sS),iS=y({},Xl,{data:0}),$m=an(iS),cS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},uS={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"},dS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function fS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=dS[e])?!!t[e]:!1}function yu(){return fS}var hS=y({},Os,{key:function(e){if(e.key){var t=cS[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Fo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?uS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:yu,charCode:function(e){return e.type==="keypress"?Fo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Fo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),mS=an(hS),pS=y({},Jo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Km=an(pS),gS=y({},Os,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:yu}),vS=an(gS),xS=y({},Xl,{propertyName:0,elapsedTime:0,pseudoElement:0}),yS=an(xS),bS=y({},Jo,{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}),SS=an(bS),wS=y({},Xl,{newState:0,oldState:0}),jS=an(wS),CS=[9,13,27,32],bu=Da&&"CompositionEvent"in window,zs=null;Da&&"documentMode"in document&&(zs=document.documentMode);var ES=Da&&"TextEvent"in window&&!zs,Xm=Da&&(!bu||zs&&8<zs&&11>=zs),Fm=" ",Qm=!1;function Zm(e,t){switch(e){case"keyup":return CS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Jm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Or=!1;function NS(e,t){switch(e){case"compositionend":return Jm(t);case"keypress":return t.which!==32?null:(Qm=!0,Fm);case"textInput":return e=t.data,e===Fm&&Qm?null:e;default:return null}}function RS(e,t){if(Or)return e==="compositionend"||!bu&&Zm(e,t)?(e=Vm(),Xo=pu=ul=null,Or=!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 Xm&&t.locale!=="ko"?null:t.data;default:return null}}var TS={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 Wm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!TS[e.type]:t==="textarea"}function ep(e,t,a,r){Dr?_r?_r.push(r):_r=[r]:Dr=r,t=qi(t,"onChange"),0<t.length&&(a=new Zo("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var Ls=null,Us=null;function AS(e){Lv(e,0)}function Wo(e){var t=Ms(e);if(zm(t))return e}function tp(e,t){if(e==="change")return t}var np=!1;if(Da){var Su;if(Da){var wu="oninput"in document;if(!wu){var ap=document.createElement("div");ap.setAttribute("oninput","return;"),wu=typeof ap.oninput=="function"}Su=wu}else Su=!1;np=Su&&(!document.documentMode||9<document.documentMode)}function lp(){Ls&&(Ls.detachEvent("onpropertychange",rp),Us=Ls=null)}function rp(e){if(e.propertyName==="value"&&Wo(Us)){var t=[];ep(t,Us,e,fu(e)),Im(AS,t)}}function MS(e,t,a){e==="focusin"?(lp(),Ls=t,Us=a,Ls.attachEvent("onpropertychange",rp)):e==="focusout"&&lp()}function DS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Wo(Us)}function _S(e,t){if(e==="click")return Wo(t)}function OS(e,t){if(e==="input"||e==="change")return Wo(t)}function kS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var wn=typeof Object.is=="function"?Object.is:kS;function Bs(e,t){if(wn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),r=Object.keys(t);if(a.length!==r.length)return!1;for(r=0;r<a.length;r++){var c=a[r];if(!Ht.call(t,c)||!wn(e[c],t[c]))return!1}return!0}function sp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function op(e,t){var a=sp(e);e=0;for(var r;a;){if(a.nodeType===3){if(r=e+a.textContent.length,e<=t&&r>=t)return{node:a,offset:t-e};e=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=sp(a)}}function ip(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ip(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function cp(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=$o(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=$o(e.document)}return t}function ju(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 zS=Da&&"documentMode"in document&&11>=document.documentMode,kr=null,Cu=null,Hs=null,Eu=!1;function up(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Eu||kr==null||kr!==$o(r)||(r=kr,"selectionStart"in r&&ju(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Hs&&Bs(Hs,r)||(Hs=r,r=qi(Cu,"onSelect"),0<r.length&&(t=new Zo("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=kr)))}function Fl(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var zr={animationend:Fl("Animation","AnimationEnd"),animationiteration:Fl("Animation","AnimationIteration"),animationstart:Fl("Animation","AnimationStart"),transitionrun:Fl("Transition","TransitionRun"),transitionstart:Fl("Transition","TransitionStart"),transitioncancel:Fl("Transition","TransitionCancel"),transitionend:Fl("Transition","TransitionEnd")},Nu={},dp={};Da&&(dp=document.createElement("div").style,"AnimationEvent"in window||(delete zr.animationend.animation,delete zr.animationiteration.animation,delete zr.animationstart.animation),"TransitionEvent"in window||delete zr.transitionend.transition);function Ql(e){if(Nu[e])return Nu[e];if(!zr[e])return e;var t=zr[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in dp)return Nu[e]=t[a];return e}var fp=Ql("animationend"),hp=Ql("animationiteration"),mp=Ql("animationstart"),LS=Ql("transitionrun"),US=Ql("transitionstart"),BS=Ql("transitioncancel"),pp=Ql("transitionend"),gp=new Map,Ru="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(" ");Ru.push("scrollEnd");function aa(e,t){gp.set(e,t),Kl(t,[e])}var ei=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)},Bn=[],Lr=0,Tu=0;function ti(){for(var e=Lr,t=Tu=Lr=0;t<e;){var a=Bn[t];Bn[t++]=null;var r=Bn[t];Bn[t++]=null;var c=Bn[t];Bn[t++]=null;var f=Bn[t];if(Bn[t++]=null,r!==null&&c!==null){var b=r.pending;b===null?c.next=c:(c.next=b.next,b.next=c),r.pending=c}f!==0&&vp(a,c,f)}}function ni(e,t,a,r){Bn[Lr++]=e,Bn[Lr++]=t,Bn[Lr++]=a,Bn[Lr++]=r,Tu|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Au(e,t,a,r){return ni(e,t,a,r),ai(e)}function Zl(e,t){return ni(e,null,null,t),ai(e)}function vp(e,t,a){e.lanes|=a;var r=e.alternate;r!==null&&(r.lanes|=a);for(var c=!1,f=e.return;f!==null;)f.childLanes|=a,r=f.alternate,r!==null&&(r.childLanes|=a),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(c=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,c&&t!==null&&(c=31-Nt(a),e=f.hiddenUpdates,r=e[c],r===null?e[c]=[t]:r.push(t),t.lane=a|536870912),f):null}function ai(e){if(50<oo)throw oo=0,Bd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ur={};function HS(e,t,a,r){this.tag=e,this.key=a,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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jn(e,t,a,r){return new HS(e,t,a,r)}function Mu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _a(e,t){var a=e.alternate;return a===null?(a=jn(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function xp(e,t){e.flags&=65011714;var a=e.alternate;return a===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=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function li(e,t,a,r,c,f){var b=0;if(r=e,typeof e=="function")Mu(e)&&(b=1);else if(typeof e=="string")b=Gw(e,a,re.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case K:return e=jn(31,a,t,c),e.elementType=K,e.lanes=f,e;case E:return Jl(a.children,c,f,t);case j:b=8,c|=24;break;case R:return e=jn(12,a,t,c|2),e.elementType=R,e.lanes=f,e;case O:return e=jn(13,a,t,c),e.elementType=O,e.lanes=f,e;case M:return e=jn(19,a,t,c),e.elementType=M,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case T:b=10;break e;case A:b=9;break e;case D:b=11;break e;case B:b=14;break e;case z:b=16,r=null;break e}b=29,a=Error(i(130,e===null?"null":typeof e,"")),r=null}return t=jn(b,a,t,c),t.elementType=e,t.type=r,t.lanes=f,t}function Jl(e,t,a,r){return e=jn(7,e,r,t),e.lanes=a,e}function Du(e,t,a){return e=jn(6,e,null,t),e.lanes=a,e}function yp(e){var t=jn(18,null,null,0);return t.stateNode=e,t}function _u(e,t,a){return t=jn(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var bp=new WeakMap;function Hn(e,t){if(typeof e=="object"&&e!==null){var a=bp.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Ye(t)},bp.set(e,t),t)}return{value:e,source:t,stack:Ye(t)}}var Br=[],Hr=0,ri=null,Ps=0,Pn=[],qn=0,dl=null,ha=1,ma="";function Oa(e,t){Br[Hr++]=Ps,Br[Hr++]=ri,ri=e,Ps=t}function Sp(e,t,a){Pn[qn++]=ha,Pn[qn++]=ma,Pn[qn++]=dl,dl=e;var r=ha;e=ma;var c=32-Nt(r)-1;r&=~(1<<c),a+=1;var f=32-Nt(t)+c;if(30<f){var b=c-c%5;f=(r&(1<<b)-1).toString(32),r>>=b,c-=b,ha=1<<32-Nt(t)+c|a<<c|r,ma=f+e}else ha=1<<f|a<<c|r,ma=e}function Ou(e){e.return!==null&&(Oa(e,1),Sp(e,1,0))}function ku(e){for(;e===ri;)ri=Br[--Hr],Br[Hr]=null,Ps=Br[--Hr],Br[Hr]=null;for(;e===dl;)dl=Pn[--qn],Pn[qn]=null,ma=Pn[--qn],Pn[qn]=null,ha=Pn[--qn],Pn[qn]=null}function wp(e,t){Pn[qn++]=ha,Pn[qn++]=ma,Pn[qn++]=dl,ha=t.id,ma=t.overflow,dl=e}var It=null,ft=null,Ve=!1,fl=null,In=!1,zu=Error(i(519));function hl(e){var t=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw qs(Hn(t,e)),zu}function jp(e){var t=e.stateNode,a=e.type,r=e.memoizedProps;switch(t[qt]=e,t[nn]=r,a){case"dialog":He("cancel",t),He("close",t);break;case"iframe":case"object":case"embed":He("load",t);break;case"video":case"audio":for(a=0;a<co.length;a++)He(co[a],t);break;case"source":He("error",t);break;case"img":case"image":case"link":He("error",t),He("load",t);break;case"details":He("toggle",t);break;case"input":He("invalid",t),Lm(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":He("invalid",t);break;case"textarea":He("invalid",t),Bm(t,r.value,r.defaultValue,r.children)}a=r.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||r.suppressHydrationWarning===!0||Pv(t.textContent,a)?(r.popover!=null&&(He("beforetoggle",t),He("toggle",t)),r.onScroll!=null&&He("scroll",t),r.onScrollEnd!=null&&He("scrollend",t),r.onClick!=null&&(t.onclick=Ma),t=!0):t=!1,t||hl(e,!0)}function Cp(e){for(It=e.return;It;)switch(It.tag){case 5:case 31:case 13:In=!1;return;case 27:case 3:In=!0;return;default:It=It.return}}function Pr(e){if(e!==It)return!1;if(!Ve)return Cp(e),Ve=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Wd(e.type,e.memoizedProps)),a=!a),a&&ft&&hl(e),Cp(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));ft=Fv(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));ft=Fv(e)}else t===27?(t=ft,Rl(e.type)?(e=lf,lf=null,ft=e):ft=t):ft=It?Gn(e.stateNode.nextSibling):null;return!0}function Wl(){ft=It=null,Ve=!1}function Lu(){var e=fl;return e!==null&&(on===null?on=e:on.push.apply(on,e),fl=null),e}function qs(e){fl===null?fl=[e]:fl.push(e)}var Uu=_(null),er=null,ka=null;function ml(e,t,a){Q(Uu,t._currentValue),t._currentValue=a}function za(e){e._currentValue=Uu.current,P(Uu)}function Bu(e,t,a){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===a)break;e=e.return}}function Hu(e,t,a,r){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var f=c.dependencies;if(f!==null){var b=c.child;f=f.firstContext;e:for(;f!==null;){var N=f;f=c;for(var k=0;k<t.length;k++)if(N.context===t[k]){f.lanes|=a,N=f.alternate,N!==null&&(N.lanes|=a),Bu(f.return,a,e),r||(b=null);break e}f=N.next}}else if(c.tag===18){if(b=c.return,b===null)throw Error(i(341));b.lanes|=a,f=b.alternate,f!==null&&(f.lanes|=a),Bu(b,a,e),b=null}else b=c.child;if(b!==null)b.return=c;else for(b=c;b!==null;){if(b===e){b=null;break}if(c=b.sibling,c!==null){c.return=b.return,b=c;break}b=b.return}c=b}}function qr(e,t,a,r){e=null;for(var c=t,f=!1;c!==null;){if(!f){if((c.flags&524288)!==0)f=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var b=c.alternate;if(b===null)throw Error(i(387));if(b=b.memoizedProps,b!==null){var N=c.type;wn(c.pendingProps.value,b.value)||(e!==null?e.push(N):e=[N])}}else if(c===G.current){if(b=c.alternate,b===null)throw Error(i(387));b.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(po):e=[po])}c=c.return}e!==null&&Hu(t,e,a,r),t.flags|=262144}function si(e){for(e=e.firstContext;e!==null;){if(!wn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function tr(e){er=e,ka=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Vt(e){return Ep(er,e)}function oi(e,t){return er===null&&tr(e),Ep(e,t)}function Ep(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},ka===null){if(e===null)throw Error(i(308));ka=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ka=ka.next=t;return a}var PS=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},qS=n.unstable_scheduleCallback,IS=n.unstable_NormalPriority,Rt={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Pu(){return{controller:new PS,data:new Map,refCount:0}}function Is(e){e.refCount--,e.refCount===0&&qS(IS,function(){e.controller.abort()})}var Vs=null,qu=0,Ir=0,Vr=null;function VS(e,t){if(Vs===null){var a=Vs=[];qu=0,Ir=Gd(),Vr={status:"pending",value:void 0,then:function(r){a.push(r)}}}return qu++,t.then(Np,Np),t}function Np(){if(--qu===0&&Vs!==null){Vr!==null&&(Vr.status="fulfilled");var e=Vs;Vs=null,Ir=0,Vr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function GS(e,t){var a=[],r={status:"pending",value:null,reason:null,then:function(c){a.push(c)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var c=0;c<a.length;c++)(0,a[c])(t)},function(c){for(r.status="rejected",r.reason=c,c=0;c<a.length;c++)(0,a[c])(void 0)}),r}var Rp=U.S;U.S=function(e,t){uv=St(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&VS(e,t),Rp!==null&&Rp(e,t)};var nr=_(null);function Iu(){var e=nr.current;return e!==null?e:ut.pooledCache}function ii(e,t){t===null?Q(nr,nr.current):Q(nr,t.pool)}function Tp(){var e=Iu();return e===null?null:{parent:Rt._currentValue,pool:e}}var Gr=Error(i(460)),Vu=Error(i(474)),ci=Error(i(542)),ui={then:function(){}};function Ap(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Mp(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Ma,Ma),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,_p(e),e;default:if(typeof t.status=="string")t.then(Ma,Ma);else{if(e=ut,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=r}},function(r){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,_p(e),e}throw lr=t,Gr}}function ar(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(lr=a,Gr):a}}var lr=null;function Dp(){if(lr===null)throw Error(i(459));var e=lr;return lr=null,e}function _p(e){if(e===Gr||e===ci)throw Error(i(483))}var Yr=null,Gs=0;function di(e){var t=Gs;return Gs+=1,Yr===null&&(Yr=[]),Mp(Yr,e,t)}function Ys(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function fi(e,t){throw t.$$typeof===S?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Op(e){function t(H,L){if(e){var I=H.deletions;I===null?(H.deletions=[L],H.flags|=16):I.push(L)}}function a(H,L){if(!e)return null;for(;L!==null;)t(H,L),L=L.sibling;return null}function r(H){for(var L=new Map;H!==null;)H.key!==null?L.set(H.key,H):L.set(H.index,H),H=H.sibling;return L}function c(H,L){return H=_a(H,L),H.index=0,H.sibling=null,H}function f(H,L,I){return H.index=I,e?(I=H.alternate,I!==null?(I=I.index,I<L?(H.flags|=67108866,L):I):(H.flags|=67108866,L)):(H.flags|=1048576,L)}function b(H){return e&&H.alternate===null&&(H.flags|=67108866),H}function N(H,L,I,ee){return L===null||L.tag!==6?(L=Du(I,H.mode,ee),L.return=H,L):(L=c(L,I),L.return=H,L)}function k(H,L,I,ee){var we=I.type;return we===E?Z(H,L,I.props.children,ee,I.key):L!==null&&(L.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===z&&ar(we)===L.type)?(L=c(L,I.props),Ys(L,I),L.return=H,L):(L=li(I.type,I.key,I.props,null,H.mode,ee),Ys(L,I),L.return=H,L)}function V(H,L,I,ee){return L===null||L.tag!==4||L.stateNode.containerInfo!==I.containerInfo||L.stateNode.implementation!==I.implementation?(L=_u(I,H.mode,ee),L.return=H,L):(L=c(L,I.children||[]),L.return=H,L)}function Z(H,L,I,ee,we){return L===null||L.tag!==7?(L=Jl(I,H.mode,ee,we),L.return=H,L):(L=c(L,I),L.return=H,L)}function ne(H,L,I){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return L=Du(""+L,H.mode,I),L.return=H,L;if(typeof L=="object"&&L!==null){switch(L.$$typeof){case w:return I=li(L.type,L.key,L.props,null,H.mode,I),Ys(I,L),I.return=H,I;case C:return L=_u(L,H.mode,I),L.return=H,L;case z:return L=ar(L),ne(H,L,I)}if(ce(L)||q(L))return L=Jl(L,H.mode,I,null),L.return=H,L;if(typeof L.then=="function")return ne(H,di(L),I);if(L.$$typeof===T)return ne(H,oi(H,L),I);fi(H,L)}return null}function $(H,L,I,ee){var we=L!==null?L.key:null;if(typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint")return we!==null?null:N(H,L,""+I,ee);if(typeof I=="object"&&I!==null){switch(I.$$typeof){case w:return I.key===we?k(H,L,I,ee):null;case C:return I.key===we?V(H,L,I,ee):null;case z:return I=ar(I),$(H,L,I,ee)}if(ce(I)||q(I))return we!==null?null:Z(H,L,I,ee,null);if(typeof I.then=="function")return $(H,L,di(I),ee);if(I.$$typeof===T)return $(H,L,oi(H,I),ee);fi(H,I)}return null}function F(H,L,I,ee,we){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return H=H.get(I)||null,N(L,H,""+ee,we);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case w:return H=H.get(ee.key===null?I:ee.key)||null,k(L,H,ee,we);case C:return H=H.get(ee.key===null?I:ee.key)||null,V(L,H,ee,we);case z:return ee=ar(ee),F(H,L,I,ee,we)}if(ce(ee)||q(ee))return H=H.get(I)||null,Z(L,H,ee,we,null);if(typeof ee.then=="function")return F(H,L,I,di(ee),we);if(ee.$$typeof===T)return F(H,L,I,oi(L,ee),we);fi(L,ee)}return null}function ve(H,L,I,ee){for(var we=null,$e=null,ye=L,ke=L=0,Ie=null;ye!==null&&ke<I.length;ke++){ye.index>ke?(Ie=ye,ye=null):Ie=ye.sibling;var Ke=$(H,ye,I[ke],ee);if(Ke===null){ye===null&&(ye=Ie);break}e&&ye&&Ke.alternate===null&&t(H,ye),L=f(Ke,L,ke),$e===null?we=Ke:$e.sibling=Ke,$e=Ke,ye=Ie}if(ke===I.length)return a(H,ye),Ve&&Oa(H,ke),we;if(ye===null){for(;ke<I.length;ke++)ye=ne(H,I[ke],ee),ye!==null&&(L=f(ye,L,ke),$e===null?we=ye:$e.sibling=ye,$e=ye);return Ve&&Oa(H,ke),we}for(ye=r(ye);ke<I.length;ke++)Ie=F(ye,H,ke,I[ke],ee),Ie!==null&&(e&&Ie.alternate!==null&&ye.delete(Ie.key===null?ke:Ie.key),L=f(Ie,L,ke),$e===null?we=Ie:$e.sibling=Ie,$e=Ie);return e&&ye.forEach(function(_l){return t(H,_l)}),Ve&&Oa(H,ke),we}function Ne(H,L,I,ee){if(I==null)throw Error(i(151));for(var we=null,$e=null,ye=L,ke=L=0,Ie=null,Ke=I.next();ye!==null&&!Ke.done;ke++,Ke=I.next()){ye.index>ke?(Ie=ye,ye=null):Ie=ye.sibling;var _l=$(H,ye,Ke.value,ee);if(_l===null){ye===null&&(ye=Ie);break}e&&ye&&_l.alternate===null&&t(H,ye),L=f(_l,L,ke),$e===null?we=_l:$e.sibling=_l,$e=_l,ye=Ie}if(Ke.done)return a(H,ye),Ve&&Oa(H,ke),we;if(ye===null){for(;!Ke.done;ke++,Ke=I.next())Ke=ne(H,Ke.value,ee),Ke!==null&&(L=f(Ke,L,ke),$e===null?we=Ke:$e.sibling=Ke,$e=Ke);return Ve&&Oa(H,ke),we}for(ye=r(ye);!Ke.done;ke++,Ke=I.next())Ke=F(ye,H,ke,Ke.value,ee),Ke!==null&&(e&&Ke.alternate!==null&&ye.delete(Ke.key===null?ke:Ke.key),L=f(Ke,L,ke),$e===null?we=Ke:$e.sibling=Ke,$e=Ke);return e&&ye.forEach(function(tj){return t(H,tj)}),Ve&&Oa(H,ke),we}function st(H,L,I,ee){if(typeof I=="object"&&I!==null&&I.type===E&&I.key===null&&(I=I.props.children),typeof I=="object"&&I!==null){switch(I.$$typeof){case w:e:{for(var we=I.key;L!==null;){if(L.key===we){if(we=I.type,we===E){if(L.tag===7){a(H,L.sibling),ee=c(L,I.props.children),ee.return=H,H=ee;break e}}else if(L.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===z&&ar(we)===L.type){a(H,L.sibling),ee=c(L,I.props),Ys(ee,I),ee.return=H,H=ee;break e}a(H,L);break}else t(H,L);L=L.sibling}I.type===E?(ee=Jl(I.props.children,H.mode,ee,I.key),ee.return=H,H=ee):(ee=li(I.type,I.key,I.props,null,H.mode,ee),Ys(ee,I),ee.return=H,H=ee)}return b(H);case C:e:{for(we=I.key;L!==null;){if(L.key===we)if(L.tag===4&&L.stateNode.containerInfo===I.containerInfo&&L.stateNode.implementation===I.implementation){a(H,L.sibling),ee=c(L,I.children||[]),ee.return=H,H=ee;break e}else{a(H,L);break}else t(H,L);L=L.sibling}ee=_u(I,H.mode,ee),ee.return=H,H=ee}return b(H);case z:return I=ar(I),st(H,L,I,ee)}if(ce(I))return ve(H,L,I,ee);if(q(I)){if(we=q(I),typeof we!="function")throw Error(i(150));return I=we.call(I),Ne(H,L,I,ee)}if(typeof I.then=="function")return st(H,L,di(I),ee);if(I.$$typeof===T)return st(H,L,oi(H,I),ee);fi(H,I)}return typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint"?(I=""+I,L!==null&&L.tag===6?(a(H,L.sibling),ee=c(L,I),ee.return=H,H=ee):(a(H,L),ee=Du(I,H.mode,ee),ee.return=H,H=ee),b(H)):a(H,L)}return function(H,L,I,ee){try{Gs=0;var we=st(H,L,I,ee);return Yr=null,we}catch(ye){if(ye===Gr||ye===ci)throw ye;var $e=jn(29,ye,null,H.mode);return $e.lanes=ee,$e.return=H,$e}finally{}}}var rr=Op(!0),kp=Op(!1),pl=!1;function Gu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Yu(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 gl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function vl(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Fe&2)!==0){var c=r.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),r.pending=t,t=ai(e),vp(e,null,a),t}return ni(e,r,t,a),ai(e)}function $s(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,tn(e,a)}}function $u(e,t){var a=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var c=null,f=null;if(a=a.firstBaseUpdate,a!==null){do{var b={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};f===null?c=f=b:f=f.next=b,a=a.next}while(a!==null);f===null?c=f=t:f=f.next=t}else c=f=t;a={baseState:r.baseState,firstBaseUpdate:c,lastBaseUpdate:f,shared:r.shared,callbacks:r.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Ku=!1;function Ks(){if(Ku){var e=Vr;if(e!==null)throw e}}function Xs(e,t,a,r){Ku=!1;var c=e.updateQueue;pl=!1;var f=c.firstBaseUpdate,b=c.lastBaseUpdate,N=c.shared.pending;if(N!==null){c.shared.pending=null;var k=N,V=k.next;k.next=null,b===null?f=V:b.next=V,b=k;var Z=e.alternate;Z!==null&&(Z=Z.updateQueue,N=Z.lastBaseUpdate,N!==b&&(N===null?Z.firstBaseUpdate=V:N.next=V,Z.lastBaseUpdate=k))}if(f!==null){var ne=c.baseState;b=0,Z=V=k=null,N=f;do{var $=N.lane&-536870913,F=$!==N.lane;if(F?(qe&$)===$:(r&$)===$){$!==0&&$===Ir&&(Ku=!0),Z!==null&&(Z=Z.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var ve=e,Ne=N;$=t;var st=a;switch(Ne.tag){case 1:if(ve=Ne.payload,typeof ve=="function"){ne=ve.call(st,ne,$);break e}ne=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=Ne.payload,$=typeof ve=="function"?ve.call(st,ne,$):ve,$==null)break e;ne=y({},ne,$);break e;case 2:pl=!0}}$=N.callback,$!==null&&(e.flags|=64,F&&(e.flags|=8192),F=c.callbacks,F===null?c.callbacks=[$]:F.push($))}else F={lane:$,tag:N.tag,payload:N.payload,callback:N.callback,next:null},Z===null?(V=Z=F,k=ne):Z=Z.next=F,b|=$;if(N=N.next,N===null){if(N=c.shared.pending,N===null)break;F=N,N=F.next,F.next=null,c.lastBaseUpdate=F,c.shared.pending=null}}while(!0);Z===null&&(k=ne),c.baseState=k,c.firstBaseUpdate=V,c.lastBaseUpdate=Z,f===null&&(c.shared.lanes=0),wl|=b,e.lanes=b,e.memoizedState=ne}}function zp(e,t){if(typeof e!="function")throw Error(i(191,e));e.call(t)}function Lp(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)zp(a[e],t)}var $r=_(null),hi=_(0);function Up(e,t){e=Ga,Q(hi,e),Q($r,t),Ga=e|t.baseLanes}function Xu(){Q(hi,Ga),Q($r,$r.current)}function Fu(){Ga=hi.current,P($r),P(hi)}var Cn=_(null),Vn=null;function xl(e){var t=e.alternate;Q(wt,wt.current&1),Q(Cn,e),Vn===null&&(t===null||$r.current!==null||t.memoizedState!==null)&&(Vn=e)}function Qu(e){Q(wt,wt.current),Q(Cn,e),Vn===null&&(Vn=e)}function Bp(e){e.tag===22?(Q(wt,wt.current),Q(Cn,e),Vn===null&&(Vn=e)):yl()}function yl(){Q(wt,wt.current),Q(Cn,Cn.current)}function En(e){P(Cn),Vn===e&&(Vn=null),P(wt)}var wt=_(0);function mi(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||nf(a)||af(a)))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 La=0,_e=null,lt=null,Tt=null,pi=!1,Kr=!1,sr=!1,gi=0,Fs=0,Xr=null,YS=0;function yt(){throw Error(i(321))}function Zu(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!wn(e[a],t[a]))return!1;return!0}function Ju(e,t,a,r,c,f){return La=f,_e=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?Sg:hd,sr=!1,f=a(r,c),sr=!1,Kr&&(f=Pp(t,a,r,c)),Hp(e),f}function Hp(e){U.H=Js;var t=lt!==null&<.next!==null;if(La=0,Tt=lt=_e=null,pi=!1,Fs=0,Xr=null,t)throw Error(i(300));e===null||At||(e=e.dependencies,e!==null&&si(e)&&(At=!0))}function Pp(e,t,a,r){_e=e;var c=0;do{if(Kr&&(Xr=null),Fs=0,Kr=!1,25<=c)throw Error(i(301));if(c+=1,Tt=lt=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}U.H=wg,f=t(a,r)}while(Kr);return f}function $S(){var e=U.H,t=e.useState()[0];return t=typeof t.then=="function"?Qs(t):t,e=e.useState()[0],(lt!==null?lt.memoizedState:null)!==e&&(_e.flags|=1024),t}function Wu(){var e=gi!==0;return gi=0,e}function ed(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function td(e){if(pi){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}pi=!1}La=0,Tt=lt=_e=null,Kr=!1,Fs=gi=0,Xr=null}function Wt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tt===null?_e.memoizedState=Tt=e:Tt=Tt.next=e,Tt}function jt(){if(lt===null){var e=_e.alternate;e=e!==null?e.memoizedState:null}else e=lt.next;var t=Tt===null?_e.memoizedState:Tt.next;if(t!==null)Tt=t,lt=e;else{if(e===null)throw _e.alternate===null?Error(i(467)):Error(i(310));lt=e,e={memoizedState:lt.memoizedState,baseState:lt.baseState,baseQueue:lt.baseQueue,queue:lt.queue,next:null},Tt===null?_e.memoizedState=Tt=e:Tt=Tt.next=e}return Tt}function vi(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Qs(e){var t=Fs;return Fs+=1,Xr===null&&(Xr=[]),e=Mp(Xr,e,t),t=_e,(Tt===null?t.memoizedState:Tt.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?Sg:hd),e}function xi(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Qs(e);if(e.$$typeof===T)return Vt(e)}throw Error(i(438,String(e)))}function nd(e){var t=null,a=_e.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var r=_e.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=vi(),_e.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),r=0;r<e;r++)a[r]=oe;return t.index++,a}function Ua(e,t){return typeof t=="function"?t(e):t}function yi(e){var t=jt();return ad(t,lt,e)}function ad(e,t,a){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=a;var c=e.baseQueue,f=r.pending;if(f!==null){if(c!==null){var b=c.next;c.next=f.next,f.next=b}t.baseQueue=c=f,r.pending=null}if(f=e.baseState,c===null)e.memoizedState=f;else{t=c.next;var N=b=null,k=null,V=t,Z=!1;do{var ne=V.lane&-536870913;if(ne!==V.lane?(qe&ne)===ne:(La&ne)===ne){var $=V.revertLane;if($===0)k!==null&&(k=k.next={lane:0,revertLane:0,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null}),ne===Ir&&(Z=!0);else if((La&$)===$){V=V.next,$===Ir&&(Z=!0);continue}else ne={lane:0,revertLane:V.revertLane,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},k===null?(N=k=ne,b=f):k=k.next=ne,_e.lanes|=$,wl|=$;ne=V.action,sr&&a(f,ne),f=V.hasEagerState?V.eagerState:a(f,ne)}else $={lane:ne,revertLane:V.revertLane,gesture:V.gesture,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},k===null?(N=k=$,b=f):k=k.next=$,_e.lanes|=ne,wl|=ne;V=V.next}while(V!==null&&V!==t);if(k===null?b=f:k.next=N,!wn(f,e.memoizedState)&&(At=!0,Z&&(a=Vr,a!==null)))throw a;e.memoizedState=f,e.baseState=b,e.baseQueue=k,r.lastRenderedState=f}return c===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function ld(e){var t=jt(),a=t.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=e;var r=a.dispatch,c=a.pending,f=t.memoizedState;if(c!==null){a.pending=null;var b=c=c.next;do f=e(f,b.action),b=b.next;while(b!==c);wn(f,t.memoizedState)||(At=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),a.lastRenderedState=f}return[f,r]}function qp(e,t,a){var r=_e,c=jt(),f=Ve;if(f){if(a===void 0)throw Error(i(407));a=a()}else a=t();var b=!wn((lt||c).memoizedState,a);if(b&&(c.memoizedState=a,At=!0),c=c.queue,od(Gp.bind(null,r,c,e),[e]),c.getSnapshot!==t||b||Tt!==null&&Tt.memoizedState.tag&1){if(r.flags|=2048,Fr(9,{destroy:void 0},Vp.bind(null,r,c,a,t),null),ut===null)throw Error(i(349));f||(La&127)!==0||Ip(r,t,a)}return a}function Ip(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=_e.updateQueue,t===null?(t=vi(),_e.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Vp(e,t,a,r){t.value=a,t.getSnapshot=r,Yp(t)&&$p(e)}function Gp(e,t,a){return a(function(){Yp(t)&&$p(e)})}function Yp(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!wn(e,a)}catch{return!0}}function $p(e){var t=Zl(e,2);t!==null&&cn(t,e,2)}function rd(e){var t=Wt();if(typeof e=="function"){var a=e;if(e=a(),sr){ta(!0);try{a()}finally{ta(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ua,lastRenderedState:e},t}function Kp(e,t,a,r){return e.baseState=a,ad(e,lt,typeof r=="function"?r:Ua)}function KS(e,t,a,r,c){if(wi(e))throw Error(i(485));if(e=t.action,e!==null){var f={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){f.listeners.push(b)}};U.T!==null?a(!0):f.isTransition=!1,r(f),a=t.pending,a===null?(f.next=t.pending=f,Xp(t,f)):(f.next=a.next,t.pending=a.next=f)}}function Xp(e,t){var a=t.action,r=t.payload,c=e.state;if(t.isTransition){var f=U.T,b={};U.T=b;try{var N=a(c,r),k=U.S;k!==null&&k(b,N),Fp(e,t,N)}catch(V){sd(e,t,V)}finally{f!==null&&b.types!==null&&(f.types=b.types),U.T=f}}else try{f=a(c,r),Fp(e,t,f)}catch(V){sd(e,t,V)}}function Fp(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(r){Qp(e,t,r)},function(r){return sd(e,t,r)}):Qp(e,t,a)}function Qp(e,t,a){t.status="fulfilled",t.value=a,Zp(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Xp(e,a)))}function sd(e,t,a){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=a,Zp(t),t=t.next;while(t!==r)}e.action=null}function Zp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Jp(e,t){return t}function Wp(e,t){if(Ve){var a=ut.formState;if(a!==null){e:{var r=_e;if(Ve){if(ft){t:{for(var c=ft,f=In;c.nodeType!==8;){if(!f){c=null;break t}if(c=Gn(c.nextSibling),c===null){c=null;break t}}f=c.data,c=f==="F!"||f==="F"?c:null}if(c){ft=Gn(c.nextSibling),r=c.data==="F!";break e}}hl(r)}r=!1}r&&(t=a[0])}}return a=Wt(),a.memoizedState=a.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Jp,lastRenderedState:t},a.queue=r,a=xg.bind(null,_e,r),r.dispatch=a,r=rd(!1),f=fd.bind(null,_e,!1,r.queue),r=Wt(),c={state:t,dispatch:null,action:e,pending:null},r.queue=c,a=KS.bind(null,_e,c,f,a),c.dispatch=a,r.memoizedState=e,[t,a,!1]}function eg(e){var t=jt();return tg(t,lt,e)}function tg(e,t,a){if(t=ad(e,t,Jp)[0],e=yi(Ua)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Qs(t)}catch(b){throw b===Gr?ci:b}else r=t;t=jt();var c=t.queue,f=c.dispatch;return a!==t.memoizedState&&(_e.flags|=2048,Fr(9,{destroy:void 0},XS.bind(null,c,a),null)),[r,f,e]}function XS(e,t){e.action=t}function ng(e){var t=jt(),a=lt;if(a!==null)return tg(t,a,e);jt(),t=t.memoizedState,a=jt();var r=a.queue.dispatch;return a.memoizedState=e,[t,r,!1]}function Fr(e,t,a,r){return e={tag:e,create:a,deps:r,inst:t,next:null},t=_e.updateQueue,t===null&&(t=vi(),_e.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(r=a.next,a.next=e,e.next=r,t.lastEffect=e),e}function ag(){return jt().memoizedState}function bi(e,t,a,r){var c=Wt();_e.flags|=e,c.memoizedState=Fr(1|t,{destroy:void 0},a,r===void 0?null:r)}function Si(e,t,a,r){var c=jt();r=r===void 0?null:r;var f=c.memoizedState.inst;lt!==null&&r!==null&&Zu(r,lt.memoizedState.deps)?c.memoizedState=Fr(t,f,a,r):(_e.flags|=e,c.memoizedState=Fr(1|t,f,a,r))}function lg(e,t){bi(8390656,8,e,t)}function od(e,t){Si(2048,8,e,t)}function FS(e){_e.flags|=4;var t=_e.updateQueue;if(t===null)t=vi(),_e.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function rg(e){var t=jt().memoizedState;return FS({ref:t,nextImpl:e}),function(){if((Fe&2)!==0)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function sg(e,t){return Si(4,2,e,t)}function og(e,t){return Si(4,4,e,t)}function ig(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function cg(e,t,a){a=a!=null?a.concat([e]):null,Si(4,4,ig.bind(null,t,e),a)}function id(){}function ug(e,t){var a=jt();t=t===void 0?null:t;var r=a.memoizedState;return t!==null&&Zu(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function dg(e,t){var a=jt();t=t===void 0?null:t;var r=a.memoizedState;if(t!==null&&Zu(t,r[1]))return r[0];if(r=e(),sr){ta(!0);try{e()}finally{ta(!1)}}return a.memoizedState=[r,t],r}function cd(e,t,a){return a===void 0||(La&1073741824)!==0&&(qe&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=fv(),_e.lanes|=e,wl|=e,a)}function fg(e,t,a,r){return wn(a,t)?a:$r.current!==null?(e=cd(e,a,r),wn(e,t)||(At=!0),e):(La&42)===0||(La&1073741824)!==0&&(qe&261930)===0?(At=!0,e.memoizedState=a):(e=fv(),_e.lanes|=e,wl|=e,t)}function hg(e,t,a,r,c){var f=Y.p;Y.p=f!==0&&8>f?f:8;var b=U.T,N={};U.T=N,fd(e,!1,t,a);try{var k=c(),V=U.S;if(V!==null&&V(N,k),k!==null&&typeof k=="object"&&typeof k.then=="function"){var Z=GS(k,r);Zs(e,t,Z,Tn(e))}else Zs(e,t,r,Tn(e))}catch(ne){Zs(e,t,{then:function(){},status:"rejected",reason:ne},Tn())}finally{Y.p=f,b!==null&&N.types!==null&&(b.types=N.types),U.T=b}}function QS(){}function ud(e,t,a,r){if(e.tag!==5)throw Error(i(476));var c=mg(e).queue;hg(e,c,t,ae,a===null?QS:function(){return pg(e),a(r)})}function mg(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ua,lastRenderedState:ae},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ua,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function pg(e){var t=mg(e);t.next===null&&(t=e.alternate.memoizedState),Zs(e,t.next.queue,{},Tn())}function dd(){return Vt(po)}function gg(){return jt().memoizedState}function vg(){return jt().memoizedState}function ZS(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Tn();e=gl(a);var r=vl(t,e,a);r!==null&&(cn(r,t,a),$s(r,t,a)),t={cache:Pu()},e.payload=t;return}t=t.return}}function JS(e,t,a){var r=Tn();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},wi(e)?yg(t,a):(a=Au(e,t,a,r),a!==null&&(cn(a,e,r),bg(a,t,r)))}function xg(e,t,a){var r=Tn();Zs(e,t,a,r)}function Zs(e,t,a,r){var c={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(wi(e))yg(t,c);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var b=t.lastRenderedState,N=f(b,a);if(c.hasEagerState=!0,c.eagerState=N,wn(N,b))return ni(e,t,c,0),ut===null&&ti(),!1}catch{}finally{}if(a=Au(e,t,c,r),a!==null)return cn(a,e,r),bg(a,t,r),!0}return!1}function fd(e,t,a,r){if(r={lane:2,revertLane:Gd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},wi(e)){if(t)throw Error(i(479))}else t=Au(e,a,r,2),t!==null&&cn(t,e,2)}function wi(e){var t=e.alternate;return e===_e||t!==null&&t===_e}function yg(e,t){Kr=pi=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function bg(e,t,a){if((a&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,tn(e,a)}}var Js={readContext:Vt,use:xi,useCallback:yt,useContext:yt,useEffect:yt,useImperativeHandle:yt,useLayoutEffect:yt,useInsertionEffect:yt,useMemo:yt,useReducer:yt,useRef:yt,useState:yt,useDebugValue:yt,useDeferredValue:yt,useTransition:yt,useSyncExternalStore:yt,useId:yt,useHostTransitionStatus:yt,useFormState:yt,useActionState:yt,useOptimistic:yt,useMemoCache:yt,useCacheRefresh:yt};Js.useEffectEvent=yt;var Sg={readContext:Vt,use:xi,useCallback:function(e,t){return Wt().memoizedState=[e,t===void 0?null:t],e},useContext:Vt,useEffect:lg,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,bi(4194308,4,ig.bind(null,t,e),a)},useLayoutEffect:function(e,t){return bi(4194308,4,e,t)},useInsertionEffect:function(e,t){bi(4,2,e,t)},useMemo:function(e,t){var a=Wt();t=t===void 0?null:t;var r=e();if(sr){ta(!0);try{e()}finally{ta(!1)}}return a.memoizedState=[r,t],r},useReducer:function(e,t,a){var r=Wt();if(a!==void 0){var c=a(t);if(sr){ta(!0);try{a(t)}finally{ta(!1)}}}else c=t;return r.memoizedState=r.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},r.queue=e,e=e.dispatch=JS.bind(null,_e,e),[r.memoizedState,e]},useRef:function(e){var t=Wt();return e={current:e},t.memoizedState=e},useState:function(e){e=rd(e);var t=e.queue,a=xg.bind(null,_e,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:id,useDeferredValue:function(e,t){var a=Wt();return cd(a,e,t)},useTransition:function(){var e=rd(!1);return e=hg.bind(null,_e,e.queue,!0,!1),Wt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var r=_e,c=Wt();if(Ve){if(a===void 0)throw Error(i(407));a=a()}else{if(a=t(),ut===null)throw Error(i(349));(qe&127)!==0||Ip(r,t,a)}c.memoizedState=a;var f={value:a,getSnapshot:t};return c.queue=f,lg(Gp.bind(null,r,f,e),[e]),r.flags|=2048,Fr(9,{destroy:void 0},Vp.bind(null,r,f,a,t),null),a},useId:function(){var e=Wt(),t=ut.identifierPrefix;if(Ve){var a=ma,r=ha;a=(r&~(1<<32-Nt(r)-1)).toString(32)+a,t="_"+t+"R_"+a,a=gi++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=YS++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:dd,useFormState:Wp,useActionState:Wp,useOptimistic:function(e){var t=Wt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=fd.bind(null,_e,!0,a),a.dispatch=t,[e,t]},useMemoCache:nd,useCacheRefresh:function(){return Wt().memoizedState=ZS.bind(null,_e)},useEffectEvent:function(e){var t=Wt(),a={impl:e};return t.memoizedState=a,function(){if((Fe&2)!==0)throw Error(i(440));return a.impl.apply(void 0,arguments)}}},hd={readContext:Vt,use:xi,useCallback:ug,useContext:Vt,useEffect:od,useImperativeHandle:cg,useInsertionEffect:sg,useLayoutEffect:og,useMemo:dg,useReducer:yi,useRef:ag,useState:function(){return yi(Ua)},useDebugValue:id,useDeferredValue:function(e,t){var a=jt();return fg(a,lt.memoizedState,e,t)},useTransition:function(){var e=yi(Ua)[0],t=jt().memoizedState;return[typeof e=="boolean"?e:Qs(e),t]},useSyncExternalStore:qp,useId:gg,useHostTransitionStatus:dd,useFormState:eg,useActionState:eg,useOptimistic:function(e,t){var a=jt();return Kp(a,lt,e,t)},useMemoCache:nd,useCacheRefresh:vg};hd.useEffectEvent=rg;var wg={readContext:Vt,use:xi,useCallback:ug,useContext:Vt,useEffect:od,useImperativeHandle:cg,useInsertionEffect:sg,useLayoutEffect:og,useMemo:dg,useReducer:ld,useRef:ag,useState:function(){return ld(Ua)},useDebugValue:id,useDeferredValue:function(e,t){var a=jt();return lt===null?cd(a,e,t):fg(a,lt.memoizedState,e,t)},useTransition:function(){var e=ld(Ua)[0],t=jt().memoizedState;return[typeof e=="boolean"?e:Qs(e),t]},useSyncExternalStore:qp,useId:gg,useHostTransitionStatus:dd,useFormState:ng,useActionState:ng,useOptimistic:function(e,t){var a=jt();return lt!==null?Kp(a,lt,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:nd,useCacheRefresh:vg};wg.useEffectEvent=rg;function md(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:y({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var pd={enqueueSetState:function(e,t,a){e=e._reactInternals;var r=Tn(),c=gl(r);c.payload=t,a!=null&&(c.callback=a),t=vl(e,c,r),t!==null&&(cn(t,e,r),$s(t,e,r))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=Tn(),c=gl(r);c.tag=1,c.payload=t,a!=null&&(c.callback=a),t=vl(e,c,r),t!==null&&(cn(t,e,r),$s(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Tn(),r=gl(a);r.tag=2,t!=null&&(r.callback=t),t=vl(e,r,a),t!==null&&(cn(t,e,a),$s(t,e,a))}};function jg(e,t,a,r,c,f,b){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,f,b):t.prototype&&t.prototype.isPureReactComponent?!Bs(a,r)||!Bs(c,f):!0}function Cg(e,t,a,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,r),t.state!==e&&pd.enqueueReplaceState(t,t.state,null)}function or(e,t){var a=t;if("ref"in t){a={};for(var r in t)r!=="ref"&&(a[r]=t[r])}if(e=e.defaultProps){a===t&&(a=y({},a));for(var c in e)a[c]===void 0&&(a[c]=e[c])}return a}function Eg(e){ei(e)}function Ng(e){console.error(e)}function Rg(e){ei(e)}function ji(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function Tg(e,t,a){try{var r=e.onCaughtError;r(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function gd(e,t,a){return a=gl(a),a.tag=3,a.payload={element:null},a.callback=function(){ji(e,t)},a}function Ag(e){return e=gl(e),e.tag=3,e}function Mg(e,t,a,r){var c=a.type.getDerivedStateFromError;if(typeof c=="function"){var f=r.value;e.payload=function(){return c(f)},e.callback=function(){Tg(t,a,r)}}var b=a.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){Tg(t,a,r),typeof c!="function"&&(jl===null?jl=new Set([this]):jl.add(this));var N=r.stack;this.componentDidCatch(r.value,{componentStack:N!==null?N:""})})}function WS(e,t,a,r,c){if(a.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=a.alternate,t!==null&&qr(t,a,c,!0),a=Cn.current,a!==null){switch(a.tag){case 31:case 13:return Vn===null?zi():a.alternate===null&&bt===0&&(bt=3),a.flags&=-257,a.flags|=65536,a.lanes=c,r===ui?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([r]):t.add(r),qd(e,r,c)),!1;case 22:return a.flags|=65536,r===ui?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([r]):a.add(r)),qd(e,r,c)),!1}throw Error(i(435,a.tag))}return qd(e,r,c),zi(),!1}if(Ve)return t=Cn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,r!==zu&&(e=Error(i(422),{cause:r}),qs(Hn(e,a)))):(r!==zu&&(t=Error(i(423),{cause:r}),qs(Hn(t,a))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,r=Hn(r,a),c=gd(e.stateNode,r,c),$u(e,c),bt!==4&&(bt=2)),!1;var f=Error(i(520),{cause:r});if(f=Hn(f,a),so===null?so=[f]:so.push(f),bt!==4&&(bt=2),t===null)return!0;r=Hn(r,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=c&-c,a.lanes|=e,e=gd(a.stateNode,r,e),$u(a,e),!1;case 1:if(t=a.type,f=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(jl===null||!jl.has(f))))return a.flags|=65536,c&=-c,a.lanes|=c,c=Ag(c),Mg(c,e,a,r),$u(a,c),!1}a=a.return}while(a!==null);return!1}var vd=Error(i(461)),At=!1;function Gt(e,t,a,r){t.child=e===null?kp(t,null,a,r):rr(t,e.child,a,r)}function Dg(e,t,a,r,c){a=a.render;var f=t.ref;if("ref"in r){var b={};for(var N in r)N!=="ref"&&(b[N]=r[N])}else b=r;return tr(t),r=Ju(e,t,a,b,f,c),N=Wu(),e!==null&&!At?(ed(e,t,c),Ba(e,t,c)):(Ve&&N&&Ou(t),t.flags|=1,Gt(e,t,r,c),t.child)}function _g(e,t,a,r,c){if(e===null){var f=a.type;return typeof f=="function"&&!Mu(f)&&f.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=f,Og(e,t,f,r,c)):(e=li(a.type,null,r,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!Ed(e,c)){var b=f.memoizedProps;if(a=a.compare,a=a!==null?a:Bs,a(b,r)&&e.ref===t.ref)return Ba(e,t,c)}return t.flags|=1,e=_a(f,r),e.ref=t.ref,e.return=t,t.child=e}function Og(e,t,a,r,c){if(e!==null){var f=e.memoizedProps;if(Bs(f,r)&&e.ref===t.ref)if(At=!1,t.pendingProps=r=f,Ed(e,c))(e.flags&131072)!==0&&(At=!0);else return t.lanes=e.lanes,Ba(e,t,c)}return xd(e,t,a,r,c)}function kg(e,t,a,r){var c=r.children,f=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(f=f!==null?f.baseLanes|a:a,e!==null){for(r=t.child=e.child,c=0;r!==null;)c=c|r.lanes|r.childLanes,r=r.sibling;r=c&~f}else r=0,t.child=null;return zg(e,t,f,a,r)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ii(t,f!==null?f.cachePool:null),f!==null?Up(t,f):Xu(),Bp(t);else return r=t.lanes=536870912,zg(e,t,f!==null?f.baseLanes|a:a,a,r)}else f!==null?(ii(t,f.cachePool),Up(t,f),yl(),t.memoizedState=null):(e!==null&&ii(t,null),Xu(),yl());return Gt(e,t,c,a),t.child}function Ws(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function zg(e,t,a,r,c){var f=Iu();return f=f===null?null:{parent:Rt._currentValue,pool:f},t.memoizedState={baseLanes:a,cachePool:f},e!==null&&ii(t,null),Xu(),Bp(t),e!==null&&qr(e,t,r,!0),t.childLanes=c,null}function Ci(e,t){return t=Ni({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Lg(e,t,a){return rr(t,e.child,null,a),e=Ci(t,t.pendingProps),e.flags|=2,En(t),t.memoizedState=null,e}function ew(e,t,a){var r=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ve){if(r.mode==="hidden")return e=Ci(t,r),t.lanes=536870912,Ws(null,e);if(Qu(t),(e=ft)?(e=Xv(e,In),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:dl!==null?{id:ha,overflow:ma}:null,retryLane:536870912,hydrationErrors:null},a=yp(e),a.return=t,t.child=a,It=t,ft=null)):e=null,e===null)throw hl(t);return t.lanes=536870912,null}return Ci(t,r)}var f=e.memoizedState;if(f!==null){var b=f.dehydrated;if(Qu(t),c)if(t.flags&256)t.flags&=-257,t=Lg(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(At||qr(e,t,a,!1),c=(a&e.childLanes)!==0,At||c){if(r=ut,r!==null&&(b=na(r,a),b!==0&&b!==f.retryLane))throw f.retryLane=b,Zl(e,b),cn(r,e,b),vd;zi(),t=Lg(e,t,a)}else e=f.treeContext,ft=Gn(b.nextSibling),It=t,Ve=!0,fl=null,In=!1,e!==null&&wp(t,e),t=Ci(t,r),t.flags|=4096;return t}return e=_a(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ei(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(i(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function xd(e,t,a,r,c){return tr(t),a=Ju(e,t,a,r,void 0,c),r=Wu(),e!==null&&!At?(ed(e,t,c),Ba(e,t,c)):(Ve&&r&&Ou(t),t.flags|=1,Gt(e,t,a,c),t.child)}function Ug(e,t,a,r,c,f){return tr(t),t.updateQueue=null,a=Pp(t,r,a,c),Hp(e),r=Wu(),e!==null&&!At?(ed(e,t,f),Ba(e,t,f)):(Ve&&r&&Ou(t),t.flags|=1,Gt(e,t,a,f),t.child)}function Bg(e,t,a,r,c){if(tr(t),t.stateNode===null){var f=Ur,b=a.contextType;typeof b=="object"&&b!==null&&(f=Vt(b)),f=new a(r,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=pd,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=r,f.state=t.memoizedState,f.refs={},Gu(t),b=a.contextType,f.context=typeof b=="object"&&b!==null?Vt(b):Ur,f.state=t.memoizedState,b=a.getDerivedStateFromProps,typeof b=="function"&&(md(t,a,b,r),f.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(b=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),b!==f.state&&pd.enqueueReplaceState(f,f.state,null),Xs(t,r,f,c),Ks(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){f=t.stateNode;var N=t.memoizedProps,k=or(a,N);f.props=k;var V=f.context,Z=a.contextType;b=Ur,typeof Z=="object"&&Z!==null&&(b=Vt(Z));var ne=a.getDerivedStateFromProps;Z=typeof ne=="function"||typeof f.getSnapshotBeforeUpdate=="function",N=t.pendingProps!==N,Z||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(N||V!==b)&&Cg(t,f,r,b),pl=!1;var $=t.memoizedState;f.state=$,Xs(t,r,f,c),Ks(),V=t.memoizedState,N||$!==V||pl?(typeof ne=="function"&&(md(t,a,ne,r),V=t.memoizedState),(k=pl||jg(t,a,k,r,$,V,b))?(Z||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=V),f.props=r,f.state=V,f.context=b,r=k):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{f=t.stateNode,Yu(e,t),b=t.memoizedProps,Z=or(a,b),f.props=Z,ne=t.pendingProps,$=f.context,V=a.contextType,k=Ur,typeof V=="object"&&V!==null&&(k=Vt(V)),N=a.getDerivedStateFromProps,(V=typeof N=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(b!==ne||$!==k)&&Cg(t,f,r,k),pl=!1,$=t.memoizedState,f.state=$,Xs(t,r,f,c),Ks();var F=t.memoizedState;b!==ne||$!==F||pl||e!==null&&e.dependencies!==null&&si(e.dependencies)?(typeof N=="function"&&(md(t,a,N,r),F=t.memoizedState),(Z=pl||jg(t,a,Z,r,$,F,k)||e!==null&&e.dependencies!==null&&si(e.dependencies))?(V||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(r,F,k),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(r,F,k)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||b===e.memoizedProps&&$===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&$===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=F),f.props=r,f.state=F,f.context=k,r=Z):(typeof f.componentDidUpdate!="function"||b===e.memoizedProps&&$===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&$===e.memoizedState||(t.flags|=1024),r=!1)}return f=r,Ei(e,t),r=(t.flags&128)!==0,f||r?(f=t.stateNode,a=r&&typeof a.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&r?(t.child=rr(t,e.child,null,c),t.child=rr(t,null,a,c)):Gt(e,t,a,c),t.memoizedState=f.state,e=t.child):e=Ba(e,t,c),e}function Hg(e,t,a,r){return Wl(),t.flags|=256,Gt(e,t,a,r),t.child}var yd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function bd(e){return{baseLanes:e,cachePool:Tp()}}function Sd(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Rn),e}function Pg(e,t,a){var r=t.pendingProps,c=!1,f=(t.flags&128)!==0,b;if((b=f)||(b=e!==null&&e.memoizedState===null?!1:(wt.current&2)!==0),b&&(c=!0,t.flags&=-129),b=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ve){if(c?xl(t):yl(),(e=ft)?(e=Xv(e,In),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:dl!==null?{id:ha,overflow:ma}:null,retryLane:536870912,hydrationErrors:null},a=yp(e),a.return=t,t.child=a,It=t,ft=null)):e=null,e===null)throw hl(t);return af(e)?t.lanes=32:t.lanes=536870912,null}var N=r.children;return r=r.fallback,c?(yl(),c=t.mode,N=Ni({mode:"hidden",children:N},c),r=Jl(r,c,a,null),N.return=t,r.return=t,N.sibling=r,t.child=N,r=t.child,r.memoizedState=bd(a),r.childLanes=Sd(e,b,a),t.memoizedState=yd,Ws(null,r)):(xl(t),wd(t,N))}var k=e.memoizedState;if(k!==null&&(N=k.dehydrated,N!==null)){if(f)t.flags&256?(xl(t),t.flags&=-257,t=jd(e,t,a)):t.memoizedState!==null?(yl(),t.child=e.child,t.flags|=128,t=null):(yl(),N=r.fallback,c=t.mode,r=Ni({mode:"visible",children:r.children},c),N=Jl(N,c,a,null),N.flags|=2,r.return=t,N.return=t,r.sibling=N,t.child=r,rr(t,e.child,null,a),r=t.child,r.memoizedState=bd(a),r.childLanes=Sd(e,b,a),t.memoizedState=yd,t=Ws(null,r));else if(xl(t),af(N)){if(b=N.nextSibling&&N.nextSibling.dataset,b)var V=b.dgst;b=V,r=Error(i(419)),r.stack="",r.digest=b,qs({value:r,source:null,stack:null}),t=jd(e,t,a)}else if(At||qr(e,t,a,!1),b=(a&e.childLanes)!==0,At||b){if(b=ut,b!==null&&(r=na(b,a),r!==0&&r!==k.retryLane))throw k.retryLane=r,Zl(e,r),cn(b,e,r),vd;nf(N)||zi(),t=jd(e,t,a)}else nf(N)?(t.flags|=192,t.child=e.child,t=null):(e=k.treeContext,ft=Gn(N.nextSibling),It=t,Ve=!0,fl=null,In=!1,e!==null&&wp(t,e),t=wd(t,r.children),t.flags|=4096);return t}return c?(yl(),N=r.fallback,c=t.mode,k=e.child,V=k.sibling,r=_a(k,{mode:"hidden",children:r.children}),r.subtreeFlags=k.subtreeFlags&65011712,V!==null?N=_a(V,N):(N=Jl(N,c,a,null),N.flags|=2),N.return=t,r.return=t,r.sibling=N,t.child=r,Ws(null,r),r=t.child,N=e.child.memoizedState,N===null?N=bd(a):(c=N.cachePool,c!==null?(k=Rt._currentValue,c=c.parent!==k?{parent:k,pool:k}:c):c=Tp(),N={baseLanes:N.baseLanes|a,cachePool:c}),r.memoizedState=N,r.childLanes=Sd(e,b,a),t.memoizedState=yd,Ws(e.child,r)):(xl(t),a=e.child,e=a.sibling,a=_a(a,{mode:"visible",children:r.children}),a.return=t,a.sibling=null,e!==null&&(b=t.deletions,b===null?(t.deletions=[e],t.flags|=16):b.push(e)),t.child=a,t.memoizedState=null,a)}function wd(e,t){return t=Ni({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ni(e,t){return e=jn(22,e,null,t),e.lanes=0,e}function jd(e,t,a){return rr(t,e.child,null,a),e=wd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function qg(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Bu(e.return,t,a)}function Cd(e,t,a,r,c,f){var b=e.memoizedState;b===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:c,treeForkCount:f}:(b.isBackwards=t,b.rendering=null,b.renderingStartTime=0,b.last=r,b.tail=a,b.tailMode=c,b.treeForkCount=f)}function Ig(e,t,a){var r=t.pendingProps,c=r.revealOrder,f=r.tail;r=r.children;var b=wt.current,N=(b&2)!==0;if(N?(b=b&1|2,t.flags|=128):b&=1,Q(wt,b),Gt(e,t,r,a),r=Ve?Ps:0,!N&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&qg(e,a,t);else if(e.tag===19)qg(e,a,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(c){case"forwards":for(a=t.child,c=null;a!==null;)e=a.alternate,e!==null&&mi(e)===null&&(c=a),a=a.sibling;a=c,a===null?(c=t.child,t.child=null):(c=a.sibling,a.sibling=null),Cd(t,!1,c,a,f,r);break;case"backwards":case"unstable_legacy-backwards":for(a=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&mi(e)===null){t.child=c;break}e=c.sibling,c.sibling=a,a=c,c=e}Cd(t,!0,a,null,f,r);break;case"together":Cd(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Ba(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),wl|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(qr(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,a=_a(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=_a(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Ed(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&si(e)))}function tw(e,t,a){switch(t.tag){case 3:ie(t,t.stateNode.containerInfo),ml(t,Rt,e.memoizedState.cache),Wl();break;case 27:case 5:Ce(t);break;case 4:ie(t,t.stateNode.containerInfo);break;case 10:ml(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Qu(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(xl(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Pg(e,t,a):(xl(t),e=Ba(e,t,a),e!==null?e.sibling:null);xl(t);break;case 19:var c=(e.flags&128)!==0;if(r=(a&t.childLanes)!==0,r||(qr(e,t,a,!1),r=(a&t.childLanes)!==0),c){if(r)return Ig(e,t,a);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),Q(wt,wt.current),r)break;return null;case 22:return t.lanes=0,kg(e,t,a,t.pendingProps);case 24:ml(t,Rt,e.memoizedState.cache)}return Ba(e,t,a)}function Vg(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)At=!0;else{if(!Ed(e,a)&&(t.flags&128)===0)return At=!1,tw(e,t,a);At=(e.flags&131072)!==0}else At=!1,Ve&&(t.flags&1048576)!==0&&Sp(t,Ps,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=ar(t.elementType),t.type=e,typeof e=="function")Mu(e)?(r=or(e,r),t.tag=1,t=Bg(null,t,e,r,a)):(t.tag=0,t=xd(null,t,e,r,a));else{if(e!=null){var c=e.$$typeof;if(c===D){t.tag=11,t=Dg(null,t,e,r,a);break e}else if(c===B){t.tag=14,t=_g(null,t,e,r,a);break e}}throw t=J(e)||e,Error(i(306,t,""))}}return t;case 0:return xd(e,t,t.type,t.pendingProps,a);case 1:return r=t.type,c=or(r,t.pendingProps),Bg(e,t,r,c,a);case 3:e:{if(ie(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var f=t.memoizedState;c=f.element,Yu(e,t),Xs(t,r,null,a);var b=t.memoizedState;if(r=b.cache,ml(t,Rt,r),r!==f.cache&&Hu(t,[Rt],a,!0),Ks(),r=b.element,f.isDehydrated)if(f={element:r,isDehydrated:!1,cache:b.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=Hg(e,t,r,a);break e}else if(r!==c){c=Hn(Error(i(424)),t),qs(c),t=Hg(e,t,r,a);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(ft=Gn(e.firstChild),It=t,Ve=!0,fl=null,In=!0,a=kp(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(Wl(),r===c){t=Ba(e,t,a);break e}Gt(e,t,r,a)}t=t.child}return t;case 26:return Ei(e,t),e===null?(a=ex(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ve||(a=t.type,e=t.pendingProps,r=Ii(be.current).createElement(a),r[qt]=t,r[nn]=e,Yt(r,a,e),zt(r),t.stateNode=r):t.memoizedState=ex(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ce(t),e===null&&Ve&&(r=t.stateNode=Zv(t.type,t.pendingProps,be.current),It=t,In=!0,c=ft,Rl(t.type)?(lf=c,ft=Gn(r.firstChild)):ft=c),Gt(e,t,t.pendingProps.children,a),Ei(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ve&&((c=r=ft)&&(r=Dw(r,t.type,t.pendingProps,In),r!==null?(t.stateNode=r,It=t,ft=Gn(r.firstChild),In=!1,c=!0):c=!1),c||hl(t)),Ce(t),c=t.type,f=t.pendingProps,b=e!==null?e.memoizedProps:null,r=f.children,Wd(c,f)?r=null:b!==null&&Wd(c,b)&&(t.flags|=32),t.memoizedState!==null&&(c=Ju(e,t,$S,null,null,a),po._currentValue=c),Ei(e,t),Gt(e,t,r,a),t.child;case 6:return e===null&&Ve&&((e=a=ft)&&(a=_w(a,t.pendingProps,In),a!==null?(t.stateNode=a,It=t,ft=null,e=!0):e=!1),e||hl(t)),null;case 13:return Pg(e,t,a);case 4:return ie(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=rr(t,null,r,a):Gt(e,t,r,a),t.child;case 11:return Dg(e,t,t.type,t.pendingProps,a);case 7:return Gt(e,t,t.pendingProps,a),t.child;case 8:return Gt(e,t,t.pendingProps.children,a),t.child;case 12:return Gt(e,t,t.pendingProps.children,a),t.child;case 10:return r=t.pendingProps,ml(t,t.type,r.value),Gt(e,t,r.children,a),t.child;case 9:return c=t.type._context,r=t.pendingProps.children,tr(t),c=Vt(c),r=r(c),t.flags|=1,Gt(e,t,r,a),t.child;case 14:return _g(e,t,t.type,t.pendingProps,a);case 15:return Og(e,t,t.type,t.pendingProps,a);case 19:return Ig(e,t,a);case 31:return ew(e,t,a);case 22:return kg(e,t,a,t.pendingProps);case 24:return tr(t),r=Vt(Rt),e===null?(c=Iu(),c===null&&(c=ut,f=Pu(),c.pooledCache=f,f.refCount++,f!==null&&(c.pooledCacheLanes|=a),c=f),t.memoizedState={parent:r,cache:c},Gu(t),ml(t,Rt,c)):((e.lanes&a)!==0&&(Yu(e,t),Xs(t,null,null,a),Ks()),c=e.memoizedState,f=t.memoizedState,c.parent!==r?(c={parent:r,cache:r},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),ml(t,Rt,r)):(r=f.cache,ml(t,Rt,r),r!==c.cache&&Hu(t,[Rt],a,!0))),Gt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Ha(e){e.flags|=4}function Nd(e,t,a,r,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(gv())e.flags|=8192;else throw lr=ui,Vu}else e.flags&=-16777217}function Gg(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!rx(t))if(gv())e.flags|=8192;else throw lr=ui,Vu}function Ri(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?ct():536870912,e.lanes|=t,Wr|=t)}function eo(e,t){if(!Ve)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ht(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,r=0;if(t)for(var c=e.child;c!==null;)a|=c.lanes|c.childLanes,r|=c.subtreeFlags&65011712,r|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)a|=c.lanes|c.childLanes,r|=c.subtreeFlags,r|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=r,e.childLanes=a,t}function nw(e,t,a){var r=t.pendingProps;switch(ku(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ht(t),null;case 1:return ht(t),null;case 3:return a=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),za(Rt),me(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Pr(t)?Ha(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Lu())),ht(t),null;case 26:var c=t.type,f=t.memoizedState;return e===null?(Ha(t),f!==null?(ht(t),Gg(t,f)):(ht(t),Nd(t,c,null,r,a))):f?f!==e.memoizedState?(Ha(t),ht(t),Gg(t,f)):(ht(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Ha(t),ht(t),Nd(t,c,e,r,a)),null;case 27:if(Me(t),a=be.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ha(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return ht(t),null}e=re.current,Pr(t)?jp(t):(e=Zv(c,r,a),t.stateNode=e,Ha(t))}return ht(t),null;case 5:if(Me(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ha(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return ht(t),null}if(f=re.current,Pr(t))jp(t);else{var b=Ii(be.current);switch(f){case 1:f=b.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:f=b.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":f=b.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":f=b.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":f=b.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof r.is=="string"?b.createElement("select",{is:r.is}):b.createElement("select"),r.multiple?f.multiple=!0:r.size&&(f.size=r.size);break;default:f=typeof r.is=="string"?b.createElement(c,{is:r.is}):b.createElement(c)}}f[qt]=t,f[nn]=r;e:for(b=t.child;b!==null;){if(b.tag===5||b.tag===6)f.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===t)break e;for(;b.sibling===null;){if(b.return===null||b.return===t)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}t.stateNode=f;e:switch(Yt(f,c,r),c){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Ha(t)}}return ht(t),Nd(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ha(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(i(166));if(e=be.current,Pr(t)){if(e=t.stateNode,a=t.memoizedProps,r=null,c=It,c!==null)switch(c.tag){case 27:case 5:r=c.memoizedProps}e[qt]=t,e=!!(e.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||Pv(e.nodeValue,a)),e||hl(t,!0)}else e=Ii(e).createTextNode(r),e[qt]=t,t.stateNode=e}return ht(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(r=Pr(t),a!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(557));e[qt]=t}else Wl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ht(t),e=!1}else a=Lu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(En(t),t):(En(t),null);if((t.flags&128)!==0)throw Error(i(558))}return ht(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Pr(t),r!==null&&r.dehydrated!==null){if(e===null){if(!c)throw Error(i(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));c[qt]=t}else Wl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ht(t),c=!1}else c=Lu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(En(t),t):(En(t),null)}return En(t),(t.flags&128)!==0?(t.lanes=a,t):(a=r!==null,e=e!==null&&e.memoizedState!==null,a&&(r=t.child,c=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(c=r.alternate.memoizedState.cachePool.pool),f=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(f=r.memoizedState.cachePool.pool),f!==c&&(r.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Ri(t,t.updateQueue),ht(t),null);case 4:return me(),e===null&&Xd(t.stateNode.containerInfo),ht(t),null;case 10:return za(t.type),ht(t),null;case 19:if(P(wt),r=t.memoizedState,r===null)return ht(t),null;if(c=(t.flags&128)!==0,f=r.rendering,f===null)if(c)eo(r,!1);else{if(bt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=mi(e),f!==null){for(t.flags|=128,eo(r,!1),e=f.updateQueue,t.updateQueue=e,Ri(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)xp(a,e),a=a.sibling;return Q(wt,wt.current&1|2),Ve&&Oa(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&St()>_i&&(t.flags|=128,c=!0,eo(r,!1),t.lanes=4194304)}else{if(!c)if(e=mi(f),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,Ri(t,e),eo(r,!0),r.tail===null&&r.tailMode==="hidden"&&!f.alternate&&!Ve)return ht(t),null}else 2*St()-r.renderingStartTime>_i&&a!==536870912&&(t.flags|=128,c=!0,eo(r,!1),t.lanes=4194304);r.isBackwards?(f.sibling=t.child,t.child=f):(e=r.last,e!==null?e.sibling=f:t.child=f,r.last=f)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=St(),e.sibling=null,a=wt.current,Q(wt,c?a&1|2:a&1),Ve&&Oa(t,r.treeForkCount),e):(ht(t),null);case 22:case 23:return En(t),Fu(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(a&536870912)!==0&&(t.flags&128)===0&&(ht(t),t.subtreeFlags&6&&(t.flags|=8192)):ht(t),a=t.updateQueue,a!==null&&Ri(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==a&&(t.flags|=2048),e!==null&&P(nr),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),za(Rt),ht(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function aw(e,t){switch(ku(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return za(Rt),me(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Me(t),null;case 31:if(t.memoizedState!==null){if(En(t),t.alternate===null)throw Error(i(340));Wl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(En(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Wl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return P(wt),null;case 4:return me(),null;case 10:return za(t.type),null;case 22:case 23:return En(t),Fu(),e!==null&&P(nr),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return za(Rt),null;case 25:return null;default:return null}}function Yg(e,t){switch(ku(t),t.tag){case 3:za(Rt),me();break;case 26:case 27:case 5:Me(t);break;case 4:me();break;case 31:t.memoizedState!==null&&En(t);break;case 13:En(t);break;case 19:P(wt);break;case 10:za(t.type);break;case 22:case 23:En(t),Fu(),e!==null&&P(nr);break;case 24:za(Rt)}}function to(e,t){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var c=r.next;a=c;do{if((a.tag&e)===e){r=void 0;var f=a.create,b=a.inst;r=f(),b.destroy=r}a=a.next}while(a!==c)}}catch(N){nt(t,t.return,N)}}function bl(e,t,a){try{var r=t.updateQueue,c=r!==null?r.lastEffect:null;if(c!==null){var f=c.next;r=f;do{if((r.tag&e)===e){var b=r.inst,N=b.destroy;if(N!==void 0){b.destroy=void 0,c=t;var k=a,V=N;try{V()}catch(Z){nt(c,k,Z)}}}r=r.next}while(r!==f)}}catch(Z){nt(t,t.return,Z)}}function $g(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Lp(t,a)}catch(r){nt(e,e.return,r)}}}function Kg(e,t,a){a.props=or(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(r){nt(e,t,r)}}function no(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof a=="function"?e.refCleanup=a(r):a.current=r}}catch(c){nt(e,t,c)}}function pa(e,t){var a=e.ref,r=e.refCleanup;if(a!==null)if(typeof r=="function")try{r()}catch(c){nt(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(c){nt(e,t,c)}else a.current=null}function Xg(e){var t=e.type,a=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break e;case"img":a.src?r.src=a.src:a.srcSet&&(r.srcset=a.srcSet)}}catch(c){nt(e,e.return,c)}}function Rd(e,t,a){try{var r=e.stateNode;Ew(r,e.type,a,t),r[nn]=t}catch(c){nt(e,e.return,c)}}function Fg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Rl(e.type)||e.tag===4}function Td(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Fg(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&&Rl(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 Ad(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Ma));else if(r!==4&&(r===27&&Rl(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Ad(e,t,a),e=e.sibling;e!==null;)Ad(e,t,a),e=e.sibling}function Ti(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(r!==4&&(r===27&&Rl(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Ti(e,t,a),e=e.sibling;e!==null;)Ti(e,t,a),e=e.sibling}function Qg(e){var t=e.stateNode,a=e.memoizedProps;try{for(var r=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);Yt(t,r,a),t[qt]=e,t[nn]=a}catch(f){nt(e,e.return,f)}}var Pa=!1,Mt=!1,Md=!1,Zg=typeof WeakSet=="function"?WeakSet:Set,Lt=null;function lw(e,t){if(e=e.containerInfo,Zd=Fi,e=cp(e),ju(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var c=r.anchorOffset,f=r.focusNode;r=r.focusOffset;try{a.nodeType,f.nodeType}catch{a=null;break e}var b=0,N=-1,k=-1,V=0,Z=0,ne=e,$=null;t:for(;;){for(var F;ne!==a||c!==0&&ne.nodeType!==3||(N=b+c),ne!==f||r!==0&&ne.nodeType!==3||(k=b+r),ne.nodeType===3&&(b+=ne.nodeValue.length),(F=ne.firstChild)!==null;)$=ne,ne=F;for(;;){if(ne===e)break t;if($===a&&++V===c&&(N=b),$===f&&++Z===r&&(k=b),(F=ne.nextSibling)!==null)break;ne=$,$=ne.parentNode}ne=F}a=N===-1||k===-1?null:{start:N,end:k}}else a=null}a=a||{start:0,end:0}}else a=null;for(Jd={focusedElem:e,selectionRange:a},Fi=!1,Lt=t;Lt!==null;)if(t=Lt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Lt=e;else for(;Lt!==null;){switch(t=Lt,f=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(a=0;a<e.length;a++)c=e[a],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,a=t,c=f.memoizedProps,f=f.memoizedState,r=a.stateNode;try{var ve=or(a.type,c);e=r.getSnapshotBeforeUpdate(ve,f),r.__reactInternalSnapshotBeforeUpdate=e}catch(Ne){nt(a,a.return,Ne)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)tf(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":tf(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(i(163))}if(e=t.sibling,e!==null){e.return=t.return,Lt=e;break}Lt=t.return}}function Jg(e,t,a){var r=a.flags;switch(a.tag){case 0:case 11:case 15:Ia(e,a),r&4&&to(5,a);break;case 1:if(Ia(e,a),r&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(b){nt(a,a.return,b)}else{var c=or(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(b){nt(a,a.return,b)}}r&64&&$g(a),r&512&&no(a,a.return);break;case 3:if(Ia(e,a),r&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{Lp(e,t)}catch(b){nt(a,a.return,b)}}break;case 27:t===null&&r&4&&Qg(a);case 26:case 5:Ia(e,a),t===null&&r&4&&Xg(a),r&512&&no(a,a.return);break;case 12:Ia(e,a);break;case 31:Ia(e,a),r&4&&tv(e,a);break;case 13:Ia(e,a),r&4&&nv(e,a),r&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=hw.bind(null,a),Ow(e,a))));break;case 22:if(r=a.memoizedState!==null||Pa,!r){t=t!==null&&t.memoizedState!==null||Mt,c=Pa;var f=Mt;Pa=r,(Mt=t)&&!f?Va(e,a,(a.subtreeFlags&8772)!==0):Ia(e,a),Pa=c,Mt=f}break;case 30:break;default:Ia(e,a)}}function Wg(e){var t=e.alternate;t!==null&&(e.alternate=null,Wg(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 vt=null,ln=!1;function qa(e,t,a){for(a=a.child;a!==null;)ev(e,t,a),a=a.sibling}function ev(e,t,a){if(Et&&typeof Et.onCommitFiberUnmount=="function")try{Et.onCommitFiberUnmount(Ta,a)}catch{}switch(a.tag){case 26:Mt||pa(a,t),qa(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Mt||pa(a,t);var r=vt,c=ln;Rl(a.type)&&(vt=a.stateNode,ln=!1),qa(e,t,a),fo(a.stateNode),vt=r,ln=c;break;case 5:Mt||pa(a,t);case 6:if(r=vt,c=ln,vt=null,qa(e,t,a),vt=r,ln=c,vt!==null)if(ln)try{(vt.nodeType===9?vt.body:vt.nodeName==="HTML"?vt.ownerDocument.body:vt).removeChild(a.stateNode)}catch(f){nt(a,t,f)}else try{vt.removeChild(a.stateNode)}catch(f){nt(a,t,f)}break;case 18:vt!==null&&(ln?(e=vt,$v(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),os(e)):$v(vt,a.stateNode));break;case 4:r=vt,c=ln,vt=a.stateNode.containerInfo,ln=!0,qa(e,t,a),vt=r,ln=c;break;case 0:case 11:case 14:case 15:bl(2,a,t),Mt||bl(4,a,t),qa(e,t,a);break;case 1:Mt||(pa(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"&&Kg(a,t,r)),qa(e,t,a);break;case 21:qa(e,t,a);break;case 22:Mt=(r=Mt)||a.memoizedState!==null,qa(e,t,a),Mt=r;break;default:qa(e,t,a)}}function tv(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{os(e)}catch(a){nt(t,t.return,a)}}}function nv(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{os(e)}catch(a){nt(t,t.return,a)}}function rw(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Zg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Zg),t;default:throw Error(i(435,e.tag))}}function Ai(e,t){var a=rw(e);t.forEach(function(r){if(!a.has(r)){a.add(r);var c=mw.bind(null,e,r);r.then(c,c)}})}function rn(e,t){var a=t.deletions;if(a!==null)for(var r=0;r<a.length;r++){var c=a[r],f=e,b=t,N=b;e:for(;N!==null;){switch(N.tag){case 27:if(Rl(N.type)){vt=N.stateNode,ln=!1;break e}break;case 5:vt=N.stateNode,ln=!1;break e;case 3:case 4:vt=N.stateNode.containerInfo,ln=!0;break e}N=N.return}if(vt===null)throw Error(i(160));ev(f,b,c),vt=null,ln=!1,f=c.alternate,f!==null&&(f.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)av(t,e),t=t.sibling}var la=null;function av(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:rn(t,e),sn(e),r&4&&(bl(3,e,e.return),to(3,e),bl(5,e,e.return));break;case 1:rn(t,e),sn(e),r&512&&(Mt||a===null||pa(a,a.return)),r&64&&Pa&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?r:a.concat(r))));break;case 26:var c=la;if(rn(t,e),sn(e),r&512&&(Mt||a===null||pa(a,a.return)),r&4){var f=a!==null?a.memoizedState:null;if(r=e.memoizedState,a===null)if(r===null)if(e.stateNode===null){e:{r=e.type,a=e.memoizedProps,c=c.ownerDocument||c;t:switch(r){case"title":f=c.getElementsByTagName("title")[0],(!f||f[As]||f[qt]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=c.createElement(r),c.head.insertBefore(f,c.querySelector("head > title"))),Yt(f,r,a),f[qt]=e,zt(f),r=f;break e;case"link":var b=ax("link","href",c).get(r+(a.href||""));if(b){for(var N=0;N<b.length;N++)if(f=b[N],f.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&f.getAttribute("rel")===(a.rel==null?null:a.rel)&&f.getAttribute("title")===(a.title==null?null:a.title)&&f.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){b.splice(N,1);break t}}f=c.createElement(r),Yt(f,r,a),c.head.appendChild(f);break;case"meta":if(b=ax("meta","content",c).get(r+(a.content||""))){for(N=0;N<b.length;N++)if(f=b[N],f.getAttribute("content")===(a.content==null?null:""+a.content)&&f.getAttribute("name")===(a.name==null?null:a.name)&&f.getAttribute("property")===(a.property==null?null:a.property)&&f.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&f.getAttribute("charset")===(a.charSet==null?null:a.charSet)){b.splice(N,1);break t}}f=c.createElement(r),Yt(f,r,a),c.head.appendChild(f);break;default:throw Error(i(468,r))}f[qt]=e,zt(f),r=f}e.stateNode=r}else lx(c,e.type,e.stateNode);else e.stateNode=nx(c,r,e.memoizedProps);else f!==r?(f===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):f.count--,r===null?lx(c,e.type,e.stateNode):nx(c,r,e.memoizedProps)):r===null&&e.stateNode!==null&&Rd(e,e.memoizedProps,a.memoizedProps)}break;case 27:rn(t,e),sn(e),r&512&&(Mt||a===null||pa(a,a.return)),a!==null&&r&4&&Rd(e,e.memoizedProps,a.memoizedProps);break;case 5:if(rn(t,e),sn(e),r&512&&(Mt||a===null||pa(a,a.return)),e.flags&32){c=e.stateNode;try{Mr(c,"")}catch(ve){nt(e,e.return,ve)}}r&4&&e.stateNode!=null&&(c=e.memoizedProps,Rd(e,c,a!==null?a.memoizedProps:c)),r&1024&&(Md=!0);break;case 6:if(rn(t,e),sn(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,a=e.stateNode;try{a.nodeValue=r}catch(ve){nt(e,e.return,ve)}}break;case 3:if(Yi=null,c=la,la=Vi(t.containerInfo),rn(t,e),la=c,sn(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{os(t.containerInfo)}catch(ve){nt(e,e.return,ve)}Md&&(Md=!1,lv(e));break;case 4:r=la,la=Vi(e.stateNode.containerInfo),rn(t,e),sn(e),la=r;break;case 12:rn(t,e),sn(e);break;case 31:rn(t,e),sn(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ai(e,r)));break;case 13:rn(t,e),sn(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Di=St()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ai(e,r)));break;case 22:c=e.memoizedState!==null;var k=a!==null&&a.memoizedState!==null,V=Pa,Z=Mt;if(Pa=V||c,Mt=Z||k,rn(t,e),Mt=Z,Pa=V,sn(e),r&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(a===null||k||Pa||Mt||ir(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){k=a=t;try{if(f=k.stateNode,c)b=f.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{N=k.stateNode;var ne=k.memoizedProps.style,$=ne!=null&&ne.hasOwnProperty("display")?ne.display:null;N.style.display=$==null||typeof $=="boolean"?"":(""+$).trim()}}catch(ve){nt(k,k.return,ve)}}}else if(t.tag===6){if(a===null){k=t;try{k.stateNode.nodeValue=c?"":k.memoizedProps}catch(ve){nt(k,k.return,ve)}}}else if(t.tag===18){if(a===null){k=t;try{var F=k.stateNode;c?Kv(F,!0):Kv(k.stateNode,!1)}catch(ve){nt(k,k.return,ve)}}}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;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(a=r.retryQueue,a!==null&&(r.retryQueue=null,Ai(e,a))));break;case 19:rn(t,e),sn(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ai(e,r)));break;case 30:break;case 21:break;default:rn(t,e),sn(e)}}function sn(e){var t=e.flags;if(t&2){try{for(var a,r=e.return;r!==null;){if(Fg(r)){a=r;break}r=r.return}if(a==null)throw Error(i(160));switch(a.tag){case 27:var c=a.stateNode,f=Td(e);Ti(e,f,c);break;case 5:var b=a.stateNode;a.flags&32&&(Mr(b,""),a.flags&=-33);var N=Td(e);Ti(e,N,b);break;case 3:case 4:var k=a.stateNode.containerInfo,V=Td(e);Ad(e,V,k);break;default:throw Error(i(161))}}catch(Z){nt(e,e.return,Z)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function lv(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;lv(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ia(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Jg(e,t.alternate,t),t=t.sibling}function ir(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:bl(4,t,t.return),ir(t);break;case 1:pa(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Kg(t,t.return,a),ir(t);break;case 27:fo(t.stateNode);case 26:case 5:pa(t,t.return),ir(t);break;case 22:t.memoizedState===null&&ir(t);break;case 30:ir(t);break;default:ir(t)}e=e.sibling}}function Va(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,c=e,f=t,b=f.flags;switch(f.tag){case 0:case 11:case 15:Va(c,f,a),to(4,f);break;case 1:if(Va(c,f,a),r=f,c=r.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(V){nt(r,r.return,V)}if(r=f,c=r.updateQueue,c!==null){var N=r.stateNode;try{var k=c.shared.hiddenCallbacks;if(k!==null)for(c.shared.hiddenCallbacks=null,c=0;c<k.length;c++)zp(k[c],N)}catch(V){nt(r,r.return,V)}}a&&b&64&&$g(f),no(f,f.return);break;case 27:Qg(f);case 26:case 5:Va(c,f,a),a&&r===null&&b&4&&Xg(f),no(f,f.return);break;case 12:Va(c,f,a);break;case 31:Va(c,f,a),a&&b&4&&tv(c,f);break;case 13:Va(c,f,a),a&&b&4&&nv(c,f);break;case 22:f.memoizedState===null&&Va(c,f,a),no(f,f.return);break;case 30:break;default:Va(c,f,a)}t=t.sibling}}function Dd(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Is(a))}function _d(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Is(e))}function ra(e,t,a,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)rv(e,t,a,r),t=t.sibling}function rv(e,t,a,r){var c=t.flags;switch(t.tag){case 0:case 11:case 15:ra(e,t,a,r),c&2048&&to(9,t);break;case 1:ra(e,t,a,r);break;case 3:ra(e,t,a,r),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Is(e)));break;case 12:if(c&2048){ra(e,t,a,r),e=t.stateNode;try{var f=t.memoizedProps,b=f.id,N=f.onPostCommit;typeof N=="function"&&N(b,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(k){nt(t,t.return,k)}}else ra(e,t,a,r);break;case 31:ra(e,t,a,r);break;case 13:ra(e,t,a,r);break;case 23:break;case 22:f=t.stateNode,b=t.alternate,t.memoizedState!==null?f._visibility&2?ra(e,t,a,r):ao(e,t):f._visibility&2?ra(e,t,a,r):(f._visibility|=2,Qr(e,t,a,r,(t.subtreeFlags&10256)!==0||!1)),c&2048&&Dd(b,t);break;case 24:ra(e,t,a,r),c&2048&&_d(t.alternate,t);break;default:ra(e,t,a,r)}}function Qr(e,t,a,r,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,b=t,N=a,k=r,V=b.flags;switch(b.tag){case 0:case 11:case 15:Qr(f,b,N,k,c),to(8,b);break;case 23:break;case 22:var Z=b.stateNode;b.memoizedState!==null?Z._visibility&2?Qr(f,b,N,k,c):ao(f,b):(Z._visibility|=2,Qr(f,b,N,k,c)),c&&V&2048&&Dd(b.alternate,b);break;case 24:Qr(f,b,N,k,c),c&&V&2048&&_d(b.alternate,b);break;default:Qr(f,b,N,k,c)}t=t.sibling}}function ao(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,r=t,c=r.flags;switch(r.tag){case 22:ao(a,r),c&2048&&Dd(r.alternate,r);break;case 24:ao(a,r),c&2048&&_d(r.alternate,r);break;default:ao(a,r)}t=t.sibling}}var lo=8192;function Zr(e,t,a){if(e.subtreeFlags&lo)for(e=e.child;e!==null;)sv(e,t,a),e=e.sibling}function sv(e,t,a){switch(e.tag){case 26:Zr(e,t,a),e.flags&lo&&e.memoizedState!==null&&Yw(a,la,e.memoizedState,e.memoizedProps);break;case 5:Zr(e,t,a);break;case 3:case 4:var r=la;la=Vi(e.stateNode.containerInfo),Zr(e,t,a),la=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=lo,lo=16777216,Zr(e,t,a),lo=r):Zr(e,t,a));break;default:Zr(e,t,a)}}function ov(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 ro(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];Lt=r,cv(r,e)}ov(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)iv(e),e=e.sibling}function iv(e){switch(e.tag){case 0:case 11:case 15:ro(e),e.flags&2048&&bl(9,e,e.return);break;case 3:ro(e);break;case 12:ro(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Mi(e)):ro(e);break;default:ro(e)}}function Mi(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];Lt=r,cv(r,e)}ov(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:bl(8,t,t.return),Mi(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Mi(t));break;default:Mi(t)}e=e.sibling}}function cv(e,t){for(;Lt!==null;){var a=Lt;switch(a.tag){case 0:case 11:case 15:bl(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var r=a.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Is(a.memoizedState.cache)}if(r=a.child,r!==null)r.return=a,Lt=r;else e:for(a=e;Lt!==null;){r=Lt;var c=r.sibling,f=r.return;if(Wg(r),r===a){Lt=null;break e}if(c!==null){c.return=f,Lt=c;break e}Lt=f}}}var sw={getCacheForType:function(e){var t=Vt(Rt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Vt(Rt).controller.signal}},ow=typeof WeakMap=="function"?WeakMap:Map,Fe=0,ut=null,Be=null,qe=0,tt=0,Nn=null,Sl=!1,Jr=!1,Od=!1,Ga=0,bt=0,wl=0,cr=0,kd=0,Rn=0,Wr=0,so=null,on=null,zd=!1,Di=0,uv=0,_i=1/0,Oi=null,jl=null,_t=0,Cl=null,es=null,Ya=0,Ld=0,Ud=null,dv=null,oo=0,Bd=null;function Tn(){return(Fe&2)!==0&&qe!==0?qe&-qe:U.T!==null?Gd():Rm()}function fv(){if(Rn===0)if((qe&536870912)===0||Ve){var e=wr;wr<<=1,(wr&3932160)===0&&(wr=262144),Rn=e}else Rn=536870912;return e=Cn.current,e!==null&&(e.flags|=32),Rn}function cn(e,t,a){(e===ut&&(tt===2||tt===9)||e.cancelPendingCommit!==null)&&(ts(e,0),El(e,qe,Rn,!1)),Pt(e,a),((Fe&2)===0||e!==ut)&&(e===ut&&((Fe&2)===0&&(cr|=a),bt===4&&El(e,qe,Rn,!1)),ga(e))}function hv(e,t,a){if((Fe&6)!==0)throw Error(i(327));var r=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Te(e,t),c=r?uw(e,t):Pd(e,t,!0),f=r;do{if(c===0){Jr&&!r&&El(e,t,0,!1);break}else{if(a=e.current.alternate,f&&!iw(a)){c=Pd(e,t,!1),f=!1;continue}if(c===2){if(f=t,e.errorRecoveryDisabledLanes&f)var b=0;else b=e.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){t=b;e:{var N=e;c=so;var k=N.current.memoizedState.isDehydrated;if(k&&(ts(N,b).flags|=256),b=Pd(N,b,!1),b!==2){if(Od&&!k){N.errorRecoveryDisabledLanes|=f,cr|=f,c=4;break e}f=on,on=c,f!==null&&(on===null?on=f:on.push.apply(on,f))}c=b}if(f=!1,c!==2)continue}}if(c===1){ts(e,0),El(e,t,0,!0);break}e:{switch(r=e,f=c,f){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:El(r,t,Rn,!Sl);break e;case 2:on=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(c=Di+300-St(),10<c)){if(El(r,t,Rn,!Sl),jr(r,0,!0)!==0)break e;Ya=t,r.timeoutHandle=Gv(mv.bind(null,r,a,on,Oi,zd,t,Rn,cr,Wr,Sl,f,"Throttled",-0,0),c);break e}mv(r,a,on,Oi,zd,t,Rn,cr,Wr,Sl,f,null,-0,0)}}break}while(!0);ga(e)}function mv(e,t,a,r,c,f,b,N,k,V,Z,ne,$,F){if(e.timeoutHandle=-1,ne=t.subtreeFlags,ne&8192||(ne&16785408)===16785408){ne={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ma},sv(t,f,ne);var ve=(f&62914560)===f?Di-St():(f&4194048)===f?uv-St():0;if(ve=$w(ne,ve),ve!==null){Ya=f,e.cancelPendingCommit=ve(wv.bind(null,e,t,f,a,r,c,b,N,k,Z,ne,null,$,F)),El(e,f,b,!V);return}}wv(e,t,f,a,r,c,b,N,k)}function iw(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var r=0;r<a.length;r++){var c=a[r],f=c.getSnapshot;c=c.value;try{if(!wn(f(),c))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;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 El(e,t,a,r){t&=~kd,t&=~cr,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var c=t;0<c;){var f=31-Nt(c),b=1<<f;r[f]=-1,c&=~b}a!==0&&fa(e,a,t)}function ki(){return(Fe&6)===0?(io(0),!1):!0}function Hd(){if(Be!==null){if(tt===0)var e=Be.return;else e=Be,ka=er=null,td(e),Yr=null,Gs=0,e=Be;for(;e!==null;)Yg(e.alternate,e),e=e.return;Be=null}}function ts(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Tw(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Ya=0,Hd(),ut=e,Be=a=_a(e.current,null),qe=t,tt=0,Nn=null,Sl=!1,Jr=Te(e,t),Od=!1,Wr=Rn=kd=cr=wl=bt=0,on=so=null,zd=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var c=31-Nt(r),f=1<<c;t|=e[c],r&=~f}return Ga=t,ti(),a}function pv(e,t){_e=null,U.H=Js,t===Gr||t===ci?(t=Dp(),tt=3):t===Vu?(t=Dp(),tt=4):tt=t===vd?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Nn=t,Be===null&&(bt=1,ji(e,Hn(t,e.current)))}function gv(){var e=Cn.current;return e===null?!0:(qe&4194048)===qe?Vn===null:(qe&62914560)===qe||(qe&536870912)!==0?e===Vn:!1}function vv(){var e=U.H;return U.H=Js,e===null?Js:e}function xv(){var e=U.A;return U.A=sw,e}function zi(){bt=4,Sl||(qe&4194048)!==qe&&Cn.current!==null||(Jr=!0),(wl&134217727)===0&&(cr&134217727)===0||ut===null||El(ut,qe,Rn,!1)}function Pd(e,t,a){var r=Fe;Fe|=2;var c=vv(),f=xv();(ut!==e||qe!==t)&&(Oi=null,ts(e,t)),t=!1;var b=bt;e:do try{if(tt!==0&&Be!==null){var N=Be,k=Nn;switch(tt){case 8:Hd(),b=6;break e;case 3:case 2:case 9:case 6:Cn.current===null&&(t=!0);var V=tt;if(tt=0,Nn=null,ns(e,N,k,V),a&&Jr){b=0;break e}break;default:V=tt,tt=0,Nn=null,ns(e,N,k,V)}}cw(),b=bt;break}catch(Z){pv(e,Z)}while(!0);return t&&e.shellSuspendCounter++,ka=er=null,Fe=r,U.H=c,U.A=f,Be===null&&(ut=null,qe=0,ti()),b}function cw(){for(;Be!==null;)yv(Be)}function uw(e,t){var a=Fe;Fe|=2;var r=vv(),c=xv();ut!==e||qe!==t?(Oi=null,_i=St()+500,ts(e,t)):Jr=Te(e,t);e:do try{if(tt!==0&&Be!==null){t=Be;var f=Nn;t:switch(tt){case 1:tt=0,Nn=null,ns(e,t,f,1);break;case 2:case 9:if(Ap(f)){tt=0,Nn=null,bv(t);break}t=function(){tt!==2&&tt!==9||ut!==e||(tt=7),ga(e)},f.then(t,t);break e;case 3:tt=7;break e;case 4:tt=5;break e;case 7:Ap(f)?(tt=0,Nn=null,bv(t)):(tt=0,Nn=null,ns(e,t,f,7));break;case 5:var b=null;switch(Be.tag){case 26:b=Be.memoizedState;case 5:case 27:var N=Be;if(b?rx(b):N.stateNode.complete){tt=0,Nn=null;var k=N.sibling;if(k!==null)Be=k;else{var V=N.return;V!==null?(Be=V,Li(V)):Be=null}break t}}tt=0,Nn=null,ns(e,t,f,5);break;case 6:tt=0,Nn=null,ns(e,t,f,6);break;case 8:Hd(),bt=6;break e;default:throw Error(i(462))}}dw();break}catch(Z){pv(e,Z)}while(!0);return ka=er=null,U.H=r,U.A=c,Fe=a,Be!==null?0:(ut=null,qe=0,ti(),bt)}function dw(){for(;Be!==null&&!ea();)yv(Be)}function yv(e){var t=Vg(e.alternate,e,Ga);e.memoizedProps=e.pendingProps,t===null?Li(e):Be=t}function bv(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Ug(a,t,t.pendingProps,t.type,void 0,qe);break;case 11:t=Ug(a,t,t.pendingProps,t.type.render,t.ref,qe);break;case 5:td(t);default:Yg(a,t),t=Be=xp(t,Ga),t=Vg(a,t,Ga)}e.memoizedProps=e.pendingProps,t===null?Li(e):Be=t}function ns(e,t,a,r){ka=er=null,td(t),Yr=null,Gs=0;var c=t.return;try{if(WS(e,c,t,a,qe)){bt=1,ji(e,Hn(a,e.current)),Be=null;return}}catch(f){if(c!==null)throw Be=c,f;bt=1,ji(e,Hn(a,e.current)),Be=null;return}t.flags&32768?(Ve||r===1?e=!0:Jr||(qe&536870912)!==0?e=!1:(Sl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Cn.current,r!==null&&r.tag===13&&(r.flags|=16384))),Sv(t,e)):Li(t)}function Li(e){var t=e;do{if((t.flags&32768)!==0){Sv(t,Sl);return}e=t.return;var a=nw(t.alternate,t,Ga);if(a!==null){Be=a;return}if(t=t.sibling,t!==null){Be=t;return}Be=t=e}while(t!==null);bt===0&&(bt=5)}function Sv(e,t){do{var a=aw(e.alternate,e);if(a!==null){a.flags&=32767,Be=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Be=e;return}Be=e=a}while(e!==null);bt=6,Be=null}function wv(e,t,a,r,c,f,b,N,k){e.cancelPendingCommit=null;do Ui();while(_t!==0);if((Fe&6)!==0)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(f=t.lanes|t.childLanes,f|=Tu,da(e,a,f,b,N,k),e===ut&&(Be=ut=null,qe=0),es=t,Cl=e,Ya=a,Ld=f,Ud=c,dv=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,pw(Ra,function(){return Rv(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=U.T,U.T=null,c=Y.p,Y.p=2,b=Fe,Fe|=4;try{lw(e,t,a)}finally{Fe=b,Y.p=c,U.T=r}}_t=1,jv(),Cv(),Ev()}}function jv(){if(_t===1){_t=0;var e=Cl,t=es,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=U.T,U.T=null;var r=Y.p;Y.p=2;var c=Fe;Fe|=4;try{av(t,e);var f=Jd,b=cp(e.containerInfo),N=f.focusedElem,k=f.selectionRange;if(b!==N&&N&&N.ownerDocument&&ip(N.ownerDocument.documentElement,N)){if(k!==null&&ju(N)){var V=k.start,Z=k.end;if(Z===void 0&&(Z=V),"selectionStart"in N)N.selectionStart=V,N.selectionEnd=Math.min(Z,N.value.length);else{var ne=N.ownerDocument||document,$=ne&&ne.defaultView||window;if($.getSelection){var F=$.getSelection(),ve=N.textContent.length,Ne=Math.min(k.start,ve),st=k.end===void 0?Ne:Math.min(k.end,ve);!F.extend&&Ne>st&&(b=st,st=Ne,Ne=b);var H=op(N,Ne),L=op(N,st);if(H&&L&&(F.rangeCount!==1||F.anchorNode!==H.node||F.anchorOffset!==H.offset||F.focusNode!==L.node||F.focusOffset!==L.offset)){var I=ne.createRange();I.setStart(H.node,H.offset),F.removeAllRanges(),Ne>st?(F.addRange(I),F.extend(L.node,L.offset)):(I.setEnd(L.node,L.offset),F.addRange(I))}}}}for(ne=[],F=N;F=F.parentNode;)F.nodeType===1&&ne.push({element:F,left:F.scrollLeft,top:F.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<ne.length;N++){var ee=ne[N];ee.element.scrollLeft=ee.left,ee.element.scrollTop=ee.top}}Fi=!!Zd,Jd=Zd=null}finally{Fe=c,Y.p=r,U.T=a}}e.current=t,_t=2}}function Cv(){if(_t===2){_t=0;var e=Cl,t=es,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=U.T,U.T=null;var r=Y.p;Y.p=2;var c=Fe;Fe|=4;try{Jg(e,t.alternate,t)}finally{Fe=c,Y.p=r,U.T=a}}_t=3}}function Ev(){if(_t===4||_t===3){_t=0,Qt();var e=Cl,t=es,a=Ya,r=dv;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?_t=5:(_t=0,es=Cl=null,Nv(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(jl=null),lu(a),t=t.stateNode,Et&&typeof Et.onCommitFiberRoot=="function")try{Et.onCommitFiberRoot(Ta,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=U.T,c=Y.p,Y.p=2,U.T=null;try{for(var f=e.onRecoverableError,b=0;b<r.length;b++){var N=r[b];f(N.value,{componentStack:N.stack})}}finally{U.T=t,Y.p=c}}(Ya&3)!==0&&Ui(),ga(e),c=e.pendingLanes,(a&261930)!==0&&(c&42)!==0?e===Bd?oo++:(oo=0,Bd=e):oo=0,io(0)}}function Nv(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Is(t)))}function Ui(){return jv(),Cv(),Ev(),Rv()}function Rv(){if(_t!==5)return!1;var e=Cl,t=Ld;Ld=0;var a=lu(Ya),r=U.T,c=Y.p;try{Y.p=32>a?32:a,U.T=null,a=Ud,Ud=null;var f=Cl,b=Ya;if(_t=0,es=Cl=null,Ya=0,(Fe&6)!==0)throw Error(i(331));var N=Fe;if(Fe|=4,iv(f.current),rv(f,f.current,b,a),Fe=N,io(0,!1),Et&&typeof Et.onPostCommitFiberRoot=="function")try{Et.onPostCommitFiberRoot(Ta,f)}catch{}return!0}finally{Y.p=c,U.T=r,Nv(e,t)}}function Tv(e,t,a){t=Hn(a,t),t=gd(e.stateNode,t,2),e=vl(e,t,2),e!==null&&(Pt(e,2),ga(e))}function nt(e,t,a){if(e.tag===3)Tv(e,e,a);else for(;t!==null;){if(t.tag===3){Tv(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(jl===null||!jl.has(r))){e=Hn(a,e),a=Ag(2),r=vl(t,a,2),r!==null&&(Mg(a,r,t,e),Pt(r,2),ga(r));break}}t=t.return}}function qd(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new ow;var c=new Set;r.set(t,c)}else c=r.get(t),c===void 0&&(c=new Set,r.set(t,c));c.has(a)||(Od=!0,c.add(a),e=fw.bind(null,e,t,a),t.then(e,e))}function fw(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,ut===e&&(qe&a)===a&&(bt===4||bt===3&&(qe&62914560)===qe&&300>St()-Di?(Fe&2)===0&&ts(e,0):kd|=a,Wr===qe&&(Wr=0)),ga(e)}function Av(e,t){t===0&&(t=ct()),e=Zl(e,t),e!==null&&(Pt(e,t),ga(e))}function hw(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Av(e,a)}function mw(e,t){var a=0;switch(e.tag){case 31:case 13:var r=e.stateNode,c=e.memoizedState;c!==null&&(a=c.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Av(e,a)}function pw(e,t){return Ft(e,t)}var Bi=null,as=null,Id=!1,Hi=!1,Vd=!1,Nl=0;function ga(e){e!==as&&e.next===null&&(as===null?Bi=as=e:as=as.next=e),Hi=!0,Id||(Id=!0,vw())}function io(e,t){if(!Vd&&Hi){Vd=!0;do for(var a=!1,r=Bi;r!==null;){if(e!==0){var c=r.pendingLanes;if(c===0)var f=0;else{var b=r.suspendedLanes,N=r.pingedLanes;f=(1<<31-Nt(42|e)+1)-1,f&=c&~(b&~N),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(a=!0,Ov(r,f))}else f=qe,f=jr(r,r===ut?f:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(f&3)===0||Te(r,f)||(a=!0,Ov(r,f));r=r.next}while(a);Vd=!1}}function gw(){Mv()}function Mv(){Hi=Id=!1;var e=0;Nl!==0&&Rw()&&(e=Nl);for(var t=St(),a=null,r=Bi;r!==null;){var c=r.next,f=Dv(r,t);f===0?(r.next=null,a===null?Bi=c:a.next=c,c===null&&(as=a)):(a=r,(e!==0||(f&3)!==0)&&(Hi=!0)),r=c}_t!==0&&_t!==5||io(e),Nl!==0&&(Nl=0)}function Dv(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,c=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var b=31-Nt(f),N=1<<b,k=c[b];k===-1?((N&a)===0||(N&r)!==0)&&(c[b]=Qe(N,t)):k<=t&&(e.expiredLanes|=N),f&=~N}if(t=ut,a=qe,a=jr(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,a===0||e===t&&(tt===2||tt===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&bn(r),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Te(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(r!==null&&bn(r),lu(a)){case 2:case 8:a=Zt;break;case 32:a=Ra;break;case 268435456:a=Yl;break;default:a=Ra}return r=_v.bind(null,e),a=Ft(a,r),e.callbackPriority=t,e.callbackNode=a,t}return r!==null&&r!==null&&bn(r),e.callbackPriority=2,e.callbackNode=null,2}function _v(e,t){if(_t!==0&&_t!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Ui()&&e.callbackNode!==a)return null;var r=qe;return r=jr(e,e===ut?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(hv(e,r,t),Dv(e,St()),e.callbackNode!=null&&e.callbackNode===a?_v.bind(null,e):null)}function Ov(e,t){if(Ui())return null;hv(e,t,!0)}function vw(){Aw(function(){(Fe&6)!==0?Ft(Ct,gw):Mv()})}function Gd(){if(Nl===0){var e=Ir;e===0&&(e=$l,$l<<=1,($l&261888)===0&&($l=256)),Nl=e}return Nl}function kv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ko(""+e)}function zv(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function xw(e,t,a,r,c){if(t==="submit"&&a&&a.stateNode===c){var f=kv((c[nn]||null).action),b=r.submitter;b&&(t=(t=b[nn]||null)?kv(t.formAction):b.getAttribute("formAction"),t!==null&&(f=t,b=null));var N=new Zo("action","action",null,r,c);e.push({event:N,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Nl!==0){var k=b?zv(c,b):new FormData(c);ud(a,{pending:!0,data:k,method:c.method,action:f},null,k)}}else typeof f=="function"&&(N.preventDefault(),k=b?zv(c,b):new FormData(c),ud(a,{pending:!0,data:k,method:c.method,action:f},f,k))},currentTarget:c}]})}}for(var Yd=0;Yd<Ru.length;Yd++){var $d=Ru[Yd],yw=$d.toLowerCase(),bw=$d[0].toUpperCase()+$d.slice(1);aa(yw,"on"+bw)}aa(fp,"onAnimationEnd"),aa(hp,"onAnimationIteration"),aa(mp,"onAnimationStart"),aa("dblclick","onDoubleClick"),aa("focusin","onFocus"),aa("focusout","onBlur"),aa(LS,"onTransitionRun"),aa(US,"onTransitionStart"),aa(BS,"onTransitionCancel"),aa(pp,"onTransitionEnd"),Tr("onMouseEnter",["mouseout","mouseover"]),Tr("onMouseLeave",["mouseout","mouseover"]),Tr("onPointerEnter",["pointerout","pointerover"]),Tr("onPointerLeave",["pointerout","pointerover"]),Kl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Kl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Kl("onBeforeInput",["compositionend","keypress","textInput","paste"]),Kl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Kl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Kl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var co="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(" "),Sw=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(co));function Lv(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var r=e[a],c=r.event;r=r.listeners;e:{var f=void 0;if(t)for(var b=r.length-1;0<=b;b--){var N=r[b],k=N.instance,V=N.currentTarget;if(N=N.listener,k!==f&&c.isPropagationStopped())break e;f=N,c.currentTarget=V;try{f(c)}catch(Z){ei(Z)}c.currentTarget=null,f=k}else for(b=0;b<r.length;b++){if(N=r[b],k=N.instance,V=N.currentTarget,N=N.listener,k!==f&&c.isPropagationStopped())break e;f=N,c.currentTarget=V;try{f(c)}catch(Z){ei(Z)}c.currentTarget=null,f=k}}}}function He(e,t){var a=t[ru];a===void 0&&(a=t[ru]=new Set);var r=e+"__bubble";a.has(r)||(Uv(t,e,2,!1),a.add(r))}function Kd(e,t,a){var r=0;t&&(r|=4),Uv(a,e,r,t)}var Pi="_reactListening"+Math.random().toString(36).slice(2);function Xd(e){if(!e[Pi]){e[Pi]=!0,Mm.forEach(function(a){a!=="selectionchange"&&(Sw.has(a)||Kd(a,!1,e),Kd(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Pi]||(t[Pi]=!0,Kd("selectionchange",!1,t))}}function Uv(e,t,a,r){switch(fx(t)){case 2:var c=Fw;break;case 8:c=Qw;break;default:c=uf}a=c.bind(null,t,a,e),c=void 0,!mu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),r?c!==void 0?e.addEventListener(t,a,{capture:!0,passive:c}):e.addEventListener(t,a,!0):c!==void 0?e.addEventListener(t,a,{passive:c}):e.addEventListener(t,a,!1)}function Fd(e,t,a,r,c){var f=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var b=r.tag;if(b===3||b===4){var N=r.stateNode.containerInfo;if(N===c)break;if(b===4)for(b=r.return;b!==null;){var k=b.tag;if((k===3||k===4)&&b.stateNode.containerInfo===c)return;b=b.return}for(;N!==null;){if(b=Er(N),b===null)return;if(k=b.tag,k===5||k===6||k===26||k===27){r=f=b;continue e}N=N.parentNode}}r=r.return}Im(function(){var V=f,Z=fu(a),ne=[];e:{var $=gp.get(e);if($!==void 0){var F=Zo,ve=e;switch(e){case"keypress":if(Fo(a)===0)break e;case"keydown":case"keyup":F=mS;break;case"focusin":ve="focus",F=xu;break;case"focusout":ve="blur",F=xu;break;case"beforeblur":case"afterblur":F=xu;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":F=Ym;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":F=nS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":F=vS;break;case fp:case hp:case mp:F=rS;break;case pp:F=yS;break;case"scroll":case"scrollend":F=eS;break;case"wheel":F=SS;break;case"copy":case"cut":case"paste":F=oS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":F=Km;break;case"toggle":case"beforetoggle":F=jS}var Ne=(t&4)!==0,st=!Ne&&(e==="scroll"||e==="scrollend"),H=Ne?$!==null?$+"Capture":null:$;Ne=[];for(var L=V,I;L!==null;){var ee=L;if(I=ee.stateNode,ee=ee.tag,ee!==5&&ee!==26&&ee!==27||I===null||H===null||(ee=Ds(L,H),ee!=null&&Ne.push(uo(L,ee,I))),st)break;L=L.return}0<Ne.length&&($=new F($,ve,null,a,Z),ne.push({event:$,listeners:Ne}))}}if((t&7)===0){e:{if($=e==="mouseover"||e==="pointerover",F=e==="mouseout"||e==="pointerout",$&&a!==du&&(ve=a.relatedTarget||a.fromElement)&&(Er(ve)||ve[Cr]))break e;if((F||$)&&($=Z.window===Z?Z:($=Z.ownerDocument)?$.defaultView||$.parentWindow:window,F?(ve=a.relatedTarget||a.toElement,F=V,ve=ve?Er(ve):null,ve!==null&&(st=d(ve),Ne=ve.tag,ve!==st||Ne!==5&&Ne!==27&&Ne!==6)&&(ve=null)):(F=null,ve=V),F!==ve)){if(Ne=Ym,ee="onMouseLeave",H="onMouseEnter",L="mouse",(e==="pointerout"||e==="pointerover")&&(Ne=Km,ee="onPointerLeave",H="onPointerEnter",L="pointer"),st=F==null?$:Ms(F),I=ve==null?$:Ms(ve),$=new Ne(ee,L+"leave",F,a,Z),$.target=st,$.relatedTarget=I,ee=null,Er(Z)===V&&(Ne=new Ne(H,L+"enter",ve,a,Z),Ne.target=I,Ne.relatedTarget=st,ee=Ne),st=ee,F&&ve)t:{for(Ne=ww,H=F,L=ve,I=0,ee=H;ee;ee=Ne(ee))I++;ee=0;for(var we=L;we;we=Ne(we))ee++;for(;0<I-ee;)H=Ne(H),I--;for(;0<ee-I;)L=Ne(L),ee--;for(;I--;){if(H===L||L!==null&&H===L.alternate){Ne=H;break t}H=Ne(H),L=Ne(L)}Ne=null}else Ne=null;F!==null&&Bv(ne,$,F,Ne,!1),ve!==null&&st!==null&&Bv(ne,st,ve,Ne,!0)}}e:{if($=V?Ms(V):window,F=$.nodeName&&$.nodeName.toLowerCase(),F==="select"||F==="input"&&$.type==="file")var $e=tp;else if(Wm($))if(np)$e=OS;else{$e=DS;var ye=MS}else F=$.nodeName,!F||F.toLowerCase()!=="input"||$.type!=="checkbox"&&$.type!=="radio"?V&&uu(V.elementType)&&($e=tp):$e=_S;if($e&&($e=$e(e,V))){ep(ne,$e,a,Z);break e}ye&&ye(e,$,V),e==="focusout"&&V&&$.type==="number"&&V.memoizedProps.value!=null&&cu($,"number",$.value)}switch(ye=V?Ms(V):window,e){case"focusin":(Wm(ye)||ye.contentEditable==="true")&&(kr=ye,Cu=V,Hs=null);break;case"focusout":Hs=Cu=kr=null;break;case"mousedown":Eu=!0;break;case"contextmenu":case"mouseup":case"dragend":Eu=!1,up(ne,a,Z);break;case"selectionchange":if(zS)break;case"keydown":case"keyup":up(ne,a,Z)}var ke;if(bu)e:{switch(e){case"compositionstart":var Ie="onCompositionStart";break e;case"compositionend":Ie="onCompositionEnd";break e;case"compositionupdate":Ie="onCompositionUpdate";break e}Ie=void 0}else Or?Zm(e,a)&&(Ie="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Ie="onCompositionStart");Ie&&(Xm&&a.locale!=="ko"&&(Or||Ie!=="onCompositionStart"?Ie==="onCompositionEnd"&&Or&&(ke=Vm()):(ul=Z,pu="value"in ul?ul.value:ul.textContent,Or=!0)),ye=qi(V,Ie),0<ye.length&&(Ie=new $m(Ie,e,null,a,Z),ne.push({event:Ie,listeners:ye}),ke?Ie.data=ke:(ke=Jm(a),ke!==null&&(Ie.data=ke)))),(ke=ES?NS(e,a):RS(e,a))&&(Ie=qi(V,"onBeforeInput"),0<Ie.length&&(ye=new $m("onBeforeInput","beforeinput",null,a,Z),ne.push({event:ye,listeners:Ie}),ye.data=ke)),xw(ne,e,V,a,Z)}Lv(ne,t)})}function uo(e,t,a){return{instance:e,listener:t,currentTarget:a}}function qi(e,t){for(var a=t+"Capture",r=[];e!==null;){var c=e,f=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||f===null||(c=Ds(e,a),c!=null&&r.unshift(uo(e,c,f)),c=Ds(e,t),c!=null&&r.push(uo(e,c,f))),e.tag===3)return r;e=e.return}return[]}function ww(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Bv(e,t,a,r,c){for(var f=t._reactName,b=[];a!==null&&a!==r;){var N=a,k=N.alternate,V=N.stateNode;if(N=N.tag,k!==null&&k===r)break;N!==5&&N!==26&&N!==27||V===null||(k=V,c?(V=Ds(a,f),V!=null&&b.unshift(uo(a,V,k))):c||(V=Ds(a,f),V!=null&&b.push(uo(a,V,k)))),a=a.return}b.length!==0&&e.push({event:t,listeners:b})}var jw=/\r\n?/g,Cw=/\u0000|\uFFFD/g;function Hv(e){return(typeof e=="string"?e:""+e).replace(jw,`
|
|
49
|
+
`).replace(Cw,"")}function Pv(e,t){return t=Hv(t),Hv(e)===t}function rt(e,t,a,r,c,f){switch(a){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||Mr(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&Mr(e,""+r);break;case"className":Yo(e,"class",r);break;case"tabIndex":Yo(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Yo(e,a,r);break;case"style":Pm(e,r,f);break;case"data":if(t!=="object"){Yo(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=Ko(""+r),e.setAttribute(a,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(a,"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 f=="function"&&(a==="formAction"?(t!=="input"&&rt(e,t,"name",c.name,c,null),rt(e,t,"formEncType",c.formEncType,c,null),rt(e,t,"formMethod",c.formMethod,c,null),rt(e,t,"formTarget",c.formTarget,c,null)):(rt(e,t,"encType",c.encType,c,null),rt(e,t,"method",c.method,c,null),rt(e,t,"target",c.target,c,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=Ko(""+r),e.setAttribute(a,r);break;case"onClick":r!=null&&(e.onclick=Ma);break;case"onScroll":r!=null&&He("scroll",e);break;case"onScrollEnd":r!=null&&He("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(i(61));if(a=r.__html,a!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}a=Ko(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""+r):e.removeAttribute(a);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":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":r===!0?e.setAttribute(a,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,r):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(a,r):e.removeAttribute(a);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(a):e.setAttribute(a,r);break;case"popover":He("beforetoggle",e),He("toggle",e),Go(e,"popover",r);break;case"xlinkActuate":Aa(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Aa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Aa(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Aa(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Aa(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Aa(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Aa(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Aa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Aa(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Go(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=J1.get(a)||a,Go(e,a,r))}}function Qd(e,t,a,r,c,f){switch(a){case"style":Pm(e,r,f);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(i(61));if(a=r.__html,a!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"children":typeof r=="string"?Mr(e,r):(typeof r=="number"||typeof r=="bigint")&&Mr(e,""+r);break;case"onScroll":r!=null&&He("scroll",e);break;case"onScrollEnd":r!=null&&He("scrollend",e);break;case"onClick":r!=null&&(e.onclick=Ma);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Dm.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(c=a.endsWith("Capture"),t=a.slice(2,c?a.length-7:void 0),f=e[nn]||null,f=f!=null?f[a]:null,typeof f=="function"&&e.removeEventListener(t,f,c),typeof r=="function")){typeof f!="function"&&f!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,r,c);break e}a in e?e[a]=r:r===!0?e.setAttribute(a,""):Go(e,a,r)}}}function Yt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":He("error",e),He("load",e);var r=!1,c=!1,f;for(f in a)if(a.hasOwnProperty(f)){var b=a[f];if(b!=null)switch(f){case"src":r=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:rt(e,t,f,b,a,null)}}c&&rt(e,t,"srcSet",a.srcSet,a,null),r&&rt(e,t,"src",a.src,a,null);return;case"input":He("invalid",e);var N=f=b=c=null,k=null,V=null;for(r in a)if(a.hasOwnProperty(r)){var Z=a[r];if(Z!=null)switch(r){case"name":c=Z;break;case"type":b=Z;break;case"checked":k=Z;break;case"defaultChecked":V=Z;break;case"value":f=Z;break;case"defaultValue":N=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(i(137,t));break;default:rt(e,t,r,Z,a,null)}}Lm(e,f,N,k,V,b,c,!1);return;case"select":He("invalid",e),r=b=f=null;for(c in a)if(a.hasOwnProperty(c)&&(N=a[c],N!=null))switch(c){case"value":f=N;break;case"defaultValue":b=N;break;case"multiple":r=N;default:rt(e,t,c,N,a,null)}t=f,a=b,e.multiple=!!r,t!=null?Ar(e,!!r,t,!1):a!=null&&Ar(e,!!r,a,!0);return;case"textarea":He("invalid",e),f=c=r=null;for(b in a)if(a.hasOwnProperty(b)&&(N=a[b],N!=null))switch(b){case"value":r=N;break;case"defaultValue":c=N;break;case"children":f=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(i(91));break;default:rt(e,t,b,N,a,null)}Bm(e,r,c,f);return;case"option":for(k in a)if(a.hasOwnProperty(k)&&(r=a[k],r!=null))switch(k){case"selected":e.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:rt(e,t,k,r,a,null)}return;case"dialog":He("beforetoggle",e),He("toggle",e),He("cancel",e),He("close",e);break;case"iframe":case"object":He("load",e);break;case"video":case"audio":for(r=0;r<co.length;r++)He(co[r],e);break;case"image":He("error",e),He("load",e);break;case"details":He("toggle",e);break;case"embed":case"source":case"link":He("error",e),He("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(V in a)if(a.hasOwnProperty(V)&&(r=a[V],r!=null))switch(V){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:rt(e,t,V,r,a,null)}return;default:if(uu(t)){for(Z in a)a.hasOwnProperty(Z)&&(r=a[Z],r!==void 0&&Qd(e,t,Z,r,a,void 0));return}}for(N in a)a.hasOwnProperty(N)&&(r=a[N],r!=null&&rt(e,t,N,r,a,null))}function Ew(e,t,a,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,f=null,b=null,N=null,k=null,V=null,Z=null;for(F in a){var ne=a[F];if(a.hasOwnProperty(F)&&ne!=null)switch(F){case"checked":break;case"value":break;case"defaultValue":k=ne;default:r.hasOwnProperty(F)||rt(e,t,F,null,r,ne)}}for(var $ in r){var F=r[$];if(ne=a[$],r.hasOwnProperty($)&&(F!=null||ne!=null))switch($){case"type":f=F;break;case"name":c=F;break;case"checked":V=F;break;case"defaultChecked":Z=F;break;case"value":b=F;break;case"defaultValue":N=F;break;case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(i(137,t));break;default:F!==ne&&rt(e,t,$,F,r,ne)}}iu(e,b,N,k,V,Z,f,c);return;case"select":F=b=N=$=null;for(f in a)if(k=a[f],a.hasOwnProperty(f)&&k!=null)switch(f){case"value":break;case"multiple":F=k;default:r.hasOwnProperty(f)||rt(e,t,f,null,r,k)}for(c in r)if(f=r[c],k=a[c],r.hasOwnProperty(c)&&(f!=null||k!=null))switch(c){case"value":$=f;break;case"defaultValue":N=f;break;case"multiple":b=f;default:f!==k&&rt(e,t,c,f,r,k)}t=N,a=b,r=F,$!=null?Ar(e,!!a,$,!1):!!r!=!!a&&(t!=null?Ar(e,!!a,t,!0):Ar(e,!!a,a?[]:"",!1));return;case"textarea":F=$=null;for(N in a)if(c=a[N],a.hasOwnProperty(N)&&c!=null&&!r.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:rt(e,t,N,null,r,c)}for(b in r)if(c=r[b],f=a[b],r.hasOwnProperty(b)&&(c!=null||f!=null))switch(b){case"value":$=c;break;case"defaultValue":F=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(i(91));break;default:c!==f&&rt(e,t,b,c,r,f)}Um(e,$,F);return;case"option":for(var ve in a)if($=a[ve],a.hasOwnProperty(ve)&&$!=null&&!r.hasOwnProperty(ve))switch(ve){case"selected":e.selected=!1;break;default:rt(e,t,ve,null,r,$)}for(k in r)if($=r[k],F=a[k],r.hasOwnProperty(k)&&$!==F&&($!=null||F!=null))switch(k){case"selected":e.selected=$&&typeof $!="function"&&typeof $!="symbol";break;default:rt(e,t,k,$,r,F)}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 Ne in a)$=a[Ne],a.hasOwnProperty(Ne)&&$!=null&&!r.hasOwnProperty(Ne)&&rt(e,t,Ne,null,r,$);for(V in r)if($=r[V],F=a[V],r.hasOwnProperty(V)&&$!==F&&($!=null||F!=null))switch(V){case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(i(137,t));break;default:rt(e,t,V,$,r,F)}return;default:if(uu(t)){for(var st in a)$=a[st],a.hasOwnProperty(st)&&$!==void 0&&!r.hasOwnProperty(st)&&Qd(e,t,st,void 0,r,$);for(Z in r)$=r[Z],F=a[Z],!r.hasOwnProperty(Z)||$===F||$===void 0&&F===void 0||Qd(e,t,Z,$,r,F);return}}for(var H in a)$=a[H],a.hasOwnProperty(H)&&$!=null&&!r.hasOwnProperty(H)&&rt(e,t,H,null,r,$);for(ne in r)$=r[ne],F=a[ne],!r.hasOwnProperty(ne)||$===F||$==null&&F==null||rt(e,t,ne,$,r,F)}function qv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Nw(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),r=0;r<a.length;r++){var c=a[r],f=c.transferSize,b=c.initiatorType,N=c.duration;if(f&&N&&qv(b)){for(b=0,N=c.responseEnd,r+=1;r<a.length;r++){var k=a[r],V=k.startTime;if(V>N)break;var Z=k.transferSize,ne=k.initiatorType;Z&&qv(ne)&&(k=k.responseEnd,b+=Z*(k<N?1:(N-V)/(k-V)))}if(--r,t+=8*(f+b)/(c.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 Zd=null,Jd=null;function Ii(e){return e.nodeType===9?e:e.ownerDocument}function Iv(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 Vv(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 Wd(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 ef=null;function Rw(){var e=window.event;return e&&e.type==="popstate"?e===ef?!1:(ef=e,!0):(ef=null,!1)}var Gv=typeof setTimeout=="function"?setTimeout:void 0,Tw=typeof clearTimeout=="function"?clearTimeout:void 0,Yv=typeof Promise=="function"?Promise:void 0,Aw=typeof queueMicrotask=="function"?queueMicrotask:typeof Yv<"u"?function(e){return Yv.resolve(null).then(e).catch(Mw)}:Gv;function Mw(e){setTimeout(function(){throw e})}function Rl(e){return e==="head"}function $v(e,t){var a=t,r=0;do{var c=a.nextSibling;if(e.removeChild(a),c&&c.nodeType===8)if(a=c.data,a==="/$"||a==="/&"){if(r===0){e.removeChild(c),os(t);return}r--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")r++;else if(a==="html")fo(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,fo(a);for(var f=a.firstChild;f;){var b=f.nextSibling,N=f.nodeName;f[As]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&f.rel.toLowerCase()==="stylesheet"||a.removeChild(f),f=b}}else a==="body"&&fo(e.ownerDocument.body);a=c}while(a);os(t)}function Kv(e,t){var a=e;e=0;do{var r=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),r&&r.nodeType===8)if(a=r.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=r}while(a)}function tf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":tf(a),su(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function Dw(e,t,a,r){for(;e.nodeType===1;){var c=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[As])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(f=e.getAttribute("rel"),f==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(f!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(f=e.getAttribute("src"),(f!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&f&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var f=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===f)return e}else return e;if(e=Gn(e.nextSibling),e===null)break}return null}function _w(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Gn(e.nextSibling),e===null))return null;return e}function Xv(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Gn(e.nextSibling),e===null))return null;return e}function nf(e){return e.data==="$?"||e.data==="$~"}function af(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Ow(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var r=function(){t(),a.removeEventListener("DOMContentLoaded",r)};a.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function Gn(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 lf=null;function Fv(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return Gn(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function Qv(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function Zv(e,t,a){switch(t=Ii(a),e){case"html":if(e=t.documentElement,!e)throw Error(i(452));return e;case"head":if(e=t.head,!e)throw Error(i(453));return e;case"body":if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function fo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);su(e)}var Yn=new Map,Jv=new Set;function Vi(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var $a=Y.d;Y.d={f:kw,r:zw,D:Lw,C:Uw,L:Bw,m:Hw,X:qw,S:Pw,M:Iw};function kw(){var e=$a.f(),t=ki();return e||t}function zw(e){var t=Nr(e);t!==null&&t.tag===5&&t.type==="form"?pg(t):$a.r(e)}var ls=typeof document>"u"?null:document;function Wv(e,t,a){var r=ls;if(r&&typeof t=="string"&&t){var c=Un(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof a=="string"&&(c+='[crossorigin="'+a+'"]'),Jv.has(c)||(Jv.add(c),e={rel:e,crossOrigin:a,href:t},r.querySelector(c)===null&&(t=r.createElement("link"),Yt(t,"link",e),zt(t),r.head.appendChild(t)))}}function Lw(e){$a.D(e),Wv("dns-prefetch",e,null)}function Uw(e,t){$a.C(e,t),Wv("preconnect",e,t)}function Bw(e,t,a){$a.L(e,t,a);var r=ls;if(r&&e&&t){var c='link[rel="preload"][as="'+Un(t)+'"]';t==="image"&&a&&a.imageSrcSet?(c+='[imagesrcset="'+Un(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(c+='[imagesizes="'+Un(a.imageSizes)+'"]')):c+='[href="'+Un(e)+'"]';var f=c;switch(t){case"style":f=rs(e);break;case"script":f=ss(e)}Yn.has(f)||(e=y({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Yn.set(f,e),r.querySelector(c)!==null||t==="style"&&r.querySelector(ho(f))||t==="script"&&r.querySelector(mo(f))||(t=r.createElement("link"),Yt(t,"link",e),zt(t),r.head.appendChild(t)))}}function Hw(e,t){$a.m(e,t);var a=ls;if(a&&e){var r=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+Un(r)+'"][href="'+Un(e)+'"]',f=c;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=ss(e)}if(!Yn.has(f)&&(e=y({rel:"modulepreload",href:e},t),Yn.set(f,e),a.querySelector(c)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(mo(f)))return}r=a.createElement("link"),Yt(r,"link",e),zt(r),a.head.appendChild(r)}}}function Pw(e,t,a){$a.S(e,t,a);var r=ls;if(r&&e){var c=Rr(r).hoistableStyles,f=rs(e);t=t||"default";var b=c.get(f);if(!b){var N={loading:0,preload:null};if(b=r.querySelector(ho(f)))N.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Yn.get(f))&&rf(e,a);var k=b=r.createElement("link");zt(k),Yt(k,"link",e),k._p=new Promise(function(V,Z){k.onload=V,k.onerror=Z}),k.addEventListener("load",function(){N.loading|=1}),k.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Gi(b,t,r)}b={type:"stylesheet",instance:b,count:1,state:N},c.set(f,b)}}}function qw(e,t){$a.X(e,t);var a=ls;if(a&&e){var r=Rr(a).hoistableScripts,c=ss(e),f=r.get(c);f||(f=a.querySelector(mo(c)),f||(e=y({src:e,async:!0},t),(t=Yn.get(c))&&sf(e,t),f=a.createElement("script"),zt(f),Yt(f,"link",e),a.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},r.set(c,f))}}function Iw(e,t){$a.M(e,t);var a=ls;if(a&&e){var r=Rr(a).hoistableScripts,c=ss(e),f=r.get(c);f||(f=a.querySelector(mo(c)),f||(e=y({src:e,async:!0,type:"module"},t),(t=Yn.get(c))&&sf(e,t),f=a.createElement("script"),zt(f),Yt(f,"link",e),a.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},r.set(c,f))}}function ex(e,t,a,r){var c=(c=be.current)?Vi(c):null;if(!c)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=rs(a.href),a=Rr(c).hoistableStyles,r=a.get(t),r||(r={type:"style",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=rs(a.href);var f=Rr(c).hoistableStyles,b=f.get(e);if(b||(c=c.ownerDocument||c,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,b),(f=c.querySelector(ho(e)))&&!f._p&&(b.instance=f,b.state.loading=5),Yn.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Yn.set(e,a),f||Vw(c,e,a,b.state))),t&&r===null)throw Error(i(528,""));return b}if(t&&r!==null)throw Error(i(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ss(a),a=Rr(c).hoistableScripts,r=a.get(t),r||(r={type:"script",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function rs(e){return'href="'+Un(e)+'"'}function ho(e){return'link[rel="stylesheet"]['+e+"]"}function tx(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function Vw(e,t,a,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),Yt(t,"link",a),zt(t),e.head.appendChild(t))}function ss(e){return'[src="'+Un(e)+'"]'}function mo(e){return"script[async]"+e}function nx(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+Un(a.href)+'"]');if(r)return t.instance=r,zt(r),r;var c=y({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),zt(r),Yt(r,"style",c),Gi(r,a.precedence,e),t.instance=r;case"stylesheet":c=rs(a.href);var f=e.querySelector(ho(c));if(f)return t.state.loading|=4,t.instance=f,zt(f),f;r=tx(a),(c=Yn.get(c))&&rf(r,c),f=(e.ownerDocument||e).createElement("link"),zt(f);var b=f;return b._p=new Promise(function(N,k){b.onload=N,b.onerror=k}),Yt(f,"link",r),t.state.loading|=4,Gi(f,a.precedence,e),t.instance=f;case"script":return f=ss(a.src),(c=e.querySelector(mo(f)))?(t.instance=c,zt(c),c):(r=a,(c=Yn.get(f))&&(r=y({},a),sf(r,c)),e=e.ownerDocument||e,c=e.createElement("script"),zt(c),Yt(c,"link",r),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(i(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Gi(r,a.precedence,e));return t.instance}function Gi(e,t,a){for(var r=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=r.length?r[r.length-1]:null,f=c,b=0;b<r.length;b++){var N=r[b];if(N.dataset.precedence===t)f=N;else if(f!==c)break}f?f.parentNode.insertBefore(e,f.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function rf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function sf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Yi=null;function ax(e,t,a){if(Yi===null){var r=new Map,c=Yi=new Map;c.set(a,r)}else c=Yi,r=c.get(a),r||(r=new Map,c.set(a,r));if(r.has(e))return r;for(r.set(e,null),a=a.getElementsByTagName(e),c=0;c<a.length;c++){var f=a[c];if(!(f[As]||f[qt]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var b=f.getAttribute(t)||"";b=e+b;var N=r.get(b);N?N.push(f):r.set(b,[f])}}return r}function lx(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function Gw(e,t,a){if(a===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 rx(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Yw(e,t,a,r){if(a.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var c=rs(r.href),f=t.querySelector(ho(c));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=$i.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=f,zt(f);return}f=t.ownerDocument||t,r=tx(r),(c=Yn.get(c))&&rf(r,c),f=f.createElement("link"),zt(f);var b=f;b._p=new Promise(function(N,k){b.onload=N,b.onerror=k}),Yt(f,"link",r),a.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=$i.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var of=0;function $w(e,t){return e.stylesheets&&e.count===0&&Xi(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var r=setTimeout(function(){if(e.stylesheets&&Xi(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&of===0&&(of=62500*Nw());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xi(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>of?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(c)}}:null}function $i(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xi(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ki=null;function Xi(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ki=new Map,t.forEach(Kw,e),Ki=null,$i.call(e))}function Kw(e,t){if(!(t.state.loading&4)){var a=Ki.get(e);if(a)var r=a.get(null);else{a=new Map,Ki.set(e,a);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<c.length;f++){var b=c[f];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(a.set(b.dataset.precedence,b),r=b)}r&&a.set(null,r)}c=t.instance,b=c.getAttribute("data-precedence"),f=a.get(b)||r,f===r&&a.set(null,c),a.set(b,c),this.count++,r=$i.bind(this),c.addEventListener("load",r),c.addEventListener("error",r),f?f.parentNode.insertBefore(c,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var po={$$typeof:T,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function Xw(e,t,a,r,c,f,b,N,k){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=Jt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Jt(0),this.hiddenUpdates=Jt(null),this.identifierPrefix=r,this.onUncaughtError=c,this.onCaughtError=f,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=k,this.incompleteTransitions=new Map}function sx(e,t,a,r,c,f,b,N,k,V,Z,ne){return e=new Xw(e,t,a,b,k,V,Z,ne,N),t=1,f===!0&&(t|=24),f=jn(3,null,null,t),e.current=f,f.stateNode=e,t=Pu(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:r,isDehydrated:a,cache:t},Gu(f),e}function ox(e){return e?(e=Ur,e):Ur}function ix(e,t,a,r,c,f){c=ox(c),r.context===null?r.context=c:r.pendingContext=c,r=gl(t),r.payload={element:a},f=f===void 0?null:f,f!==null&&(r.callback=f),a=vl(e,r,t),a!==null&&(cn(a,e,t),$s(a,e,t))}function cx(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function cf(e,t){cx(e,t),(e=e.alternate)&&cx(e,t)}function ux(e){if(e.tag===13||e.tag===31){var t=Zl(e,67108864);t!==null&&cn(t,e,67108864),cf(e,67108864)}}function dx(e){if(e.tag===13||e.tag===31){var t=Tn();t=au(t);var a=Zl(e,t);a!==null&&cn(a,e,t),cf(e,t)}}var Fi=!0;function Fw(e,t,a,r){var c=U.T;U.T=null;var f=Y.p;try{Y.p=2,uf(e,t,a,r)}finally{Y.p=f,U.T=c}}function Qw(e,t,a,r){var c=U.T;U.T=null;var f=Y.p;try{Y.p=8,uf(e,t,a,r)}finally{Y.p=f,U.T=c}}function uf(e,t,a,r){if(Fi){var c=df(r);if(c===null)Fd(e,t,r,Qi,a),hx(e,r);else if(Jw(c,e,t,a,r))r.stopPropagation();else if(hx(e,r),t&4&&-1<Zw.indexOf(e)){for(;c!==null;){var f=Nr(c);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var b=$t(f.pendingLanes);if(b!==0){var N=f;for(N.pendingLanes|=2,N.entangledLanes|=2;b;){var k=1<<31-Nt(b);N.entanglements[1]|=k,b&=~k}ga(f),(Fe&6)===0&&(_i=St()+500,io(0))}}break;case 31:case 13:N=Zl(f,2),N!==null&&cn(N,f,2),ki(),cf(f,2)}if(f=df(r),f===null&&Fd(e,t,r,Qi,a),f===c)break;c=f}c!==null&&r.stopPropagation()}else Fd(e,t,r,null,a)}}function df(e){return e=fu(e),ff(e)}var Qi=null;function ff(e){if(Qi=null,e=Er(e),e!==null){var t=d(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=h(t),e!==null)return e;e=null}else if(a===31){if(e=p(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Qi=e,null}function fx(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(Sn()){case Ct:return 2;case Zt:return 8;case Ra:case Ts:return 32;case Yl:return 268435456;default:return 32}default:return 32}}var hf=!1,Tl=null,Al=null,Ml=null,go=new Map,vo=new Map,Dl=[],Zw="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 hx(e,t){switch(e){case"focusin":case"focusout":Tl=null;break;case"dragenter":case"dragleave":Al=null;break;case"mouseover":case"mouseout":Ml=null;break;case"pointerover":case"pointerout":go.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":vo.delete(t.pointerId)}}function xo(e,t,a,r,c,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:a,eventSystemFlags:r,nativeEvent:f,targetContainers:[c]},t!==null&&(t=Nr(t),t!==null&&ux(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function Jw(e,t,a,r,c){switch(t){case"focusin":return Tl=xo(Tl,e,t,a,r,c),!0;case"dragenter":return Al=xo(Al,e,t,a,r,c),!0;case"mouseover":return Ml=xo(Ml,e,t,a,r,c),!0;case"pointerover":var f=c.pointerId;return go.set(f,xo(go.get(f)||null,e,t,a,r,c)),!0;case"gotpointercapture":return f=c.pointerId,vo.set(f,xo(vo.get(f)||null,e,t,a,r,c)),!0}return!1}function mx(e){var t=Er(e.target);if(t!==null){var a=d(t);if(a!==null){if(t=a.tag,t===13){if(t=h(a),t!==null){e.blockedOn=t,Tm(e.priority,function(){dx(a)});return}}else if(t===31){if(t=p(a),t!==null){e.blockedOn=t,Tm(e.priority,function(){dx(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Zi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=df(e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);du=r,a.target.dispatchEvent(r),du=null}else return t=Nr(a),t!==null&&ux(t),e.blockedOn=a,!1;t.shift()}return!0}function px(e,t,a){Zi(e)&&a.delete(t)}function Ww(){hf=!1,Tl!==null&&Zi(Tl)&&(Tl=null),Al!==null&&Zi(Al)&&(Al=null),Ml!==null&&Zi(Ml)&&(Ml=null),go.forEach(px),vo.forEach(px)}function Ji(e,t){e.blockedOn===t&&(e.blockedOn=null,hf||(hf=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Ww)))}var Wi=null;function gx(e){Wi!==e&&(Wi=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Wi===e&&(Wi=null);for(var t=0;t<e.length;t+=3){var a=e[t],r=e[t+1],c=e[t+2];if(typeof r!="function"){if(ff(r||a)===null)continue;break}var f=Nr(a);f!==null&&(e.splice(t,3),t-=3,ud(f,{pending:!0,data:c,method:a.method,action:r},r,c))}}))}function os(e){function t(k){return Ji(k,e)}Tl!==null&&Ji(Tl,e),Al!==null&&Ji(Al,e),Ml!==null&&Ji(Ml,e),go.forEach(t),vo.forEach(t);for(var a=0;a<Dl.length;a++){var r=Dl[a];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Dl.length&&(a=Dl[0],a.blockedOn===null);)mx(a),a.blockedOn===null&&Dl.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(r=0;r<a.length;r+=3){var c=a[r],f=a[r+1],b=c[nn]||null;if(typeof f=="function")b||gx(a);else if(b){var N=null;if(f&&f.hasAttribute("formAction")){if(c=f,b=f[nn]||null)N=b.formAction;else if(ff(c)!==null)continue}else N=b.action;typeof N=="function"?a[r+1]=N:(a.splice(r,3),r-=3),gx(a)}}}function vx(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(b){return c=b})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),r||setTimeout(a,20)}function a(){if(!r&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function mf(e){this._internalRoot=e}ec.prototype.render=mf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var a=t.current,r=Tn();ix(a,r,e,t,null,null)},ec.prototype.unmount=mf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ix(e.current,2,null,e,null,null),ki(),t[Cr]=null}};function ec(e){this._internalRoot=e}ec.prototype.unstable_scheduleHydration=function(e){if(e){var t=Rm();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Dl.length&&t!==0&&t<Dl[a].priority;a++);Dl.splice(a,0,e),a===0&&mx(e)}};var xx=l.version;if(xx!=="19.2.8")throw Error(i(527,xx,"19.2.8"));Y.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=v(t),e=e!==null?x(e):null,e=e===null?null:e.stateNode,e};var ej={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var tc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tc.isDisabled&&tc.supportsFiber)try{Ta=tc.inject(ej),Et=tc}catch{}}return bo.createRoot=function(e,t){if(!u(e))throw Error(i(299));var a=!1,r="",c=Eg,f=Ng,b=Rg;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(b=t.onRecoverableError)),t=sx(e,1,!1,null,null,a,r,null,c,f,b,vx),e[Cr]=t.current,Xd(e),new mf(t)},bo.hydrateRoot=function(e,t,a){if(!u(e))throw Error(i(299));var r=!1,c="",f=Eg,b=Ng,N=Rg,k=null;return a!=null&&(a.unstable_strictMode===!0&&(r=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(f=a.onUncaughtError),a.onCaughtError!==void 0&&(b=a.onCaughtError),a.onRecoverableError!==void 0&&(N=a.onRecoverableError),a.formState!==void 0&&(k=a.formState)),t=sx(e,1,!0,t,a??null,r,c,k,f,b,N,vx),t.context=ox(null),a=t.current,r=Tn(),r=au(r),c=gl(r),c.callback=null,vl(a,c,r),a=r,t.current.lanes=a,Pt(t,a),ga(t),e[Cr]=t.current,Xd(e),new ec(t)},bo.version="19.2.8",bo}var Dx;function uj(){if(Dx)return xf.exports;Dx=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),xf.exports=cj(),xf.exports}var dj=uj();const fj=xh(dj);/**
|
|
50
|
+
* react-router v7.18.2
|
|
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 bh=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,jy=/^[\\/]{2}/;function hj(n,l){return l+n.replace(/\\/g,"/")}var _x="popstate";function Ox(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function mj(n={}){function l(i,u){var v;let d=(v=u.state)==null?void 0:v.masked,{pathname:h,search:p,hash:g}=d||i.location;return Pf("",{pathname:h,search:p,hash:g},u.state&&u.state.usr||null,u.state&&u.state.key||"default",d?{pathname:i.location.pathname,search:i.location.search,hash:i.location.hash}:void 0)}function o(i,u){return typeof u=="string"?u:No(u)}return gj(l,o,null,n)}function xt(n,l){if(n===!1||n===null||typeof n>"u")throw new Error(l)}function Fn(n,l){if(!n){typeof console<"u"&&console.warn(l);try{throw new Error(l)}catch{}}}function pj(){return Math.random().toString(36).substring(2,10)}function kx(n,l){return{usr:n.state,key:n.key,idx:l,masked:n.mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function Pf(n,l,o=null,i,u){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof l=="string"?xs(l):l,state:o,key:l&&l.key||i||pj(),mask:u}}function No({pathname:n="/",search:l="",hash:o=""}){return l&&l!=="?"&&(n+=l.charAt(0)==="?"?l:"?"+l),o&&o!=="#"&&(n+=o.charAt(0)==="#"?o:"#"+o),n}function xs(n){let l={};if(n){let o=n.indexOf("#");o>=0&&(l.hash=n.substring(o),n=n.substring(0,o));let i=n.indexOf("?");i>=0&&(l.search=n.substring(i),n=n.substring(0,i)),n&&(l.pathname=n)}return l}function gj(n,l,o,i={}){let{window:u=document.defaultView,v5Compat:d=!1}=i,h=u.history,p="POP",g=null,v=x();v==null&&(v=0,h.replaceState({...h.state,idx:v},""));function x(){return(h.state||{idx:null}).idx}function y(){p="POP";let j=x(),R=j==null?null:j-v;v=j,g&&g({action:p,location:E.location,delta:R})}function S(j,R){p="PUSH";let A=Ox(j)?j:Pf(E.location,j,R);v=x()+1;let T=kx(A,v),D=E.createHref(A.mask||A);try{h.pushState(T,"",D)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;u.location.assign(D)}d&&g&&g({action:p,location:E.location,delta:1})}function w(j,R){p="REPLACE";let A=Ox(j)?j:Pf(E.location,j,R);v=x();let T=kx(A,v),D=E.createHref(A.mask||A);h.replaceState(T,"",D),d&&g&&g({action:p,location:E.location,delta:0})}function C(j){return vj(u,j)}let E={get action(){return p},get location(){return n(u,h)},listen(j){if(g)throw new Error("A history only accepts one active listener");return u.addEventListener(_x,y),g=j,()=>{u.removeEventListener(_x,y),g=null}},createHref(j){return l(u,j)},createURL:C,encodeLocation(j){let R=C(j);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:S,replace:w,go(j){return h.go(j)}};return E}function vj(n,l,o=!1){let i="http://localhost";n&&(i=n.location.origin!=="null"?n.location.origin:n.location.href),xt(i,"No window.location.(origin|href) available to create URL");let u=typeof l=="string"?l:No(l);return u=u.replace(/ $/,"%20"),!o&&jy.test(u)&&(u=i+u),new URL(u,i)}function Cy(n,l,o="/"){return xj(n,l,o,!1)}function xj(n,l,o,i,u){let d=typeof l=="string"?xs(l):l,h=Wa(d.pathname||"/",o);if(h==null)return null;let p=yj(n),g=null,v=Mj(h);for(let x=0;g==null&&x<p.length;++x)g=Aj(p[x],v,i);return g}function yj(n){let l=Ey(n);return bj(l),l}function Ey(n,l=[],o=[],i="",u=!1){let d=(h,p,g=u,v)=>{let x={relativePath:v===void 0?h.path||"":v,caseSensitive:h.caseSensitive===!0,childrenIndex:p,route:h};if(x.relativePath.startsWith("/")){if(!x.relativePath.startsWith(i)&&g)return;xt(x.relativePath.startsWith(i),`Absolute route path "${x.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),x.relativePath=x.relativePath.slice(i.length)}let y=ia([i,x.relativePath]),S=o.concat(x);h.children&&h.children.length>0&&(xt(h.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),Ey(h.children,l,S,y,g)),!(h.path==null&&!h.index)&&l.push({path:y,score:Rj(y,h.index),routesMeta:S.map((w,C)=>{let[E,j]=Ty(w.relativePath,w.caseSensitive,C===S.length-1);return{...w,matcher:E,compiledParams:j}})})};return n.forEach((h,p)=>{var g;if(h.path===""||!((g=h.path)!=null&&g.includes("?")))d(h,p);else for(let v of Ny(h.path))d(h,p,!0,v)}),l}function Ny(n){let l=n.split("/");if(l.length===0)return[];let[o,...i]=l,u=o.endsWith("?"),d=o.replace(/\?$/,"");if(i.length===0)return u?[d,""]:[d];let h=Ny(i.join("/")),p=[];return p.push(...h.map(g=>g===""?d:[d,g].join("/"))),u&&p.push(...h),p.map(g=>n.startsWith("/")&&g===""?"/":g)}function bj(n){n.sort((l,o)=>l.score!==o.score?o.score-l.score:Tj(l.routesMeta.map(i=>i.childrenIndex),o.routesMeta.map(i=>i.childrenIndex)))}var Sj=/^:[\w-]+$/,wj=3,jj=2,Cj=1,Ej=10,Nj=-2,zx=n=>n==="*";function Rj(n,l){let o=n.split("/"),i=o.length;return o.some(zx)&&(i+=Nj),l&&(i+=jj),o.filter(u=>!zx(u)).reduce((u,d)=>u+(Sj.test(d)?wj:d===""?Cj:Ej),i)}function Tj(n,l){return n.length===l.length&&n.slice(0,-1).every((i,u)=>i===l[u])?n[n.length-1]-l[l.length-1]:0}function Aj(n,l,o=!1){let{routesMeta:i}=n,u={},d="/",h=[];for(let p=0;p<i.length;++p){let g=i[p],v=p===i.length-1,x=d==="/"?l:l.slice(d.length)||"/",y={path:g.relativePath,caseSensitive:g.caseSensitive,end:v},S=g.matcher&&g.compiledParams?Ry(y,x,g.matcher,g.compiledParams):wc(y,x),w=g.route;if(!S&&v&&o&&!i[i.length-1].route.index&&(S=wc({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},x)),!S)return null;Object.assign(u,S.params),h.push({params:u,pathname:ia([d,S.pathname]),pathnameBase:Oj(ia([d,S.pathnameBase])),route:w}),S.pathnameBase!=="/"&&(d=ia([d,S.pathnameBase]))}return h}function wc(n,l){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[o,i]=Ty(n.path,n.caseSensitive,n.end);return Ry(n,l,o,i)}function Ry(n,l,o,i){let u=l.match(o);if(!u)return null;let d=u[0],h=d.replace(/(.)\/+$/,"$1"),p=u.slice(1);return{params:i.reduce((v,{paramName:x,isOptional:y},S)=>{if(x==="*"){let C=p[S]||"";h=d.slice(0,d.length-C.length).replace(/(.)\/+$/,"$1")}const w=p[S];return y&&!w?v[x]=void 0:v[x]=(w||"").replace(/%2F/g,"/"),v},{}),pathname:d,pathnameBase:h,pattern:n}}function Ty(n,l=!1,o=!0){Fn(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let i=[],u="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(h,p,g,v,x)=>{if(i.push({paramName:p,isOptional:g!=null}),g){let y=x.charAt(v+h.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(i.push({paramName:"*"}),u+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):o?u+="\\/*$":n!==""&&n!=="/"&&(u+="(?:(?=\\/|$))"),[new RegExp(u,l?void 0:"i"),i]}function Mj(n){try{return n.split("/").map(l=>decodeURIComponent(l).replace(/\//g,"%2F")).join("/")}catch(l){return Fn(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${l}).`),n}}function Wa(n,l){if(l==="/")return n;if(!n.toLowerCase().startsWith(l.toLowerCase()))return null;let o=l.endsWith("/")?l.length-1:l.length,i=n.charAt(o);return i&&i!=="/"?null:n.slice(o)||"/"}function Dj(n,l="/"){let{pathname:o,search:i="",hash:u=""}=typeof n=="string"?xs(n):n,d;return o?(o=Ay(o),o.startsWith("/")?d=Lx(o.substring(1),"/"):d=Lx(o,l)):d=l,{pathname:d,search:kj(i),hash:zj(u)}}function Lx(n,l){let o=jc(l).split("/");return n.split("/").forEach(u=>{u===".."?o.length>1&&o.pop():u!=="."&&o.push(u)}),o.length>1?o.join("/"):"/"}function wf(n,l,o,i){return`Cannot include a '${n}' character in a manually specified \`to.${l}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${o}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function _j(n){return n.filter((l,o)=>o===0||l.route.path&&l.route.path.length>0)}function Sh(n){let l=_j(n);return l.map((o,i)=>i===l.length-1?o.pathname:o.pathnameBase)}function Ac(n,l,o,i=!1){let u;typeof n=="string"?u=xs(n):(u={...n},xt(!u.pathname||!u.pathname.includes("?"),wf("?","pathname","search",u)),xt(!u.pathname||!u.pathname.includes("#"),wf("#","pathname","hash",u)),xt(!u.search||!u.search.includes("#"),wf("#","search","hash",u)));let d=n===""||u.pathname==="",h=d?"/":u.pathname,p;if(h==null)p=o;else{let y=l.length-1;if(!i&&h.startsWith("..")){let S=h.split("/");for(;S[0]==="..";)S.shift(),y-=1;u.pathname=S.join("/")}p=y>=0?l[y]:"/"}let g=Dj(u,p),v=h&&h!=="/"&&h.endsWith("/"),x=(d||h===".")&&o.endsWith("/");return!g.pathname.endsWith("/")&&(v||x)&&(g.pathname+="/"),g}var Ay=n=>n.replace(/[\\/]{2,}/g,"/"),ia=n=>Ay(n.join("/")),jc=n=>n.replace(/\/+$/,""),Oj=n=>jc(n).replace(/^\/*/,"/"),kj=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,zj=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,Lj=class{constructor(n,l,o,i=!1){this.status=n,this.statusText=l||"",this.internal=i,o instanceof Error?(this.data=o.toString(),this.error=o):this.data=o}};function Uj(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function Bj(n){let l=n.map(o=>o.route.path).filter(Boolean);return ia(l)||"/"}var My=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Dy(n,l){let o=n;if(typeof o!="string"||!bh.test(o))return{absoluteURL:void 0,isExternal:!1,to:o};let i=o,u=!1;if(My)try{let d=new URL(window.location.href),h=jy.test(o)?new URL(hj(o,d.protocol)):new URL(o),p=Wa(h.pathname,l);h.origin===d.origin&&p!=null?o=p+h.search+h.hash:u=!0}catch{Fn(!1,`<Link to="${o}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:u,to:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var _y=["POST","PUT","PATCH","DELETE"];new Set(_y);var Hj=["GET",..._y];new Set(Hj);var Pj=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function qj(n){try{return Pj.includes(new URL(n).protocol)}catch{return!1}}var ys=m.createContext(null);ys.displayName="DataRouter";var Mc=m.createContext(null);Mc.displayName="DataRouterState";var Oy=m.createContext(!1);function Ij(){return m.useContext(Oy)}var ky=m.createContext({isTransitioning:!1});ky.displayName="ViewTransition";var Vj=m.createContext(new Map);Vj.displayName="Fetchers";var Gj=m.createContext(null);Gj.displayName="Await";var kn=m.createContext(null);kn.displayName="Navigation";var _o=m.createContext(null);_o.displayName="Location";var Ea=m.createContext({outlet:null,matches:[],isDataRoute:!1});Ea.displayName="Route";var wh=m.createContext(null);wh.displayName="RouteError";var zy="REACT_ROUTER_ERROR",Yj="REDIRECT",$j="ROUTE_ERROR_RESPONSE";function Kj(n){if(n.startsWith(`${zy}:${Yj}:{`))try{let l=JSON.parse(n.slice(28));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string"&&typeof l.location=="string"&&typeof l.reloadDocument=="boolean"&&typeof l.replace=="boolean")return l}catch{}}function Xj(n){if(n.startsWith(`${zy}:${$j}:{`))try{let l=JSON.parse(n.slice(40));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string")return new Lj(l.status,l.statusText,l.data)}catch{}}function Fj(n,{relative:l}={}){xt(bs(),"useHref() may be used only in the context of a <Router> component.");let{basename:o,navigator:i}=m.useContext(kn),{hash:u,pathname:d,search:h}=ko(n,{relative:l}),p=d;return o!=="/"&&(p=d==="/"?o:ia([o,d])),i.createHref({pathname:p,search:h,hash:u})}function bs(){return m.useContext(_o)!=null}function xn(){return xt(bs(),"useLocation() may be used only in the context of a <Router> component."),m.useContext(_o).location}var Ly="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Uy(n){m.useContext(kn).static||m.useLayoutEffect(n)}function Oo(){let{isDataRoute:n}=m.useContext(Ea);return n?i2():Qj()}function Qj(){xt(bs(),"useNavigate() may be used only in the context of a <Router> component.");let n=m.useContext(ys),{basename:l,navigator:o}=m.useContext(kn),{matches:i}=m.useContext(Ea),{pathname:u}=xn(),d=JSON.stringify(Sh(i)),h=m.useRef(!1);return Uy(()=>{h.current=!0}),m.useCallback((g,v={})=>{if(Fn(h.current,Ly),!h.current)return;if(typeof g=="number"){o.go(g);return}let x=Ac(g,JSON.parse(d),u,v.relative==="path");n==null&&l!=="/"&&(x.pathname=x.pathname==="/"?l:ia([l,x.pathname])),(v.replace?o.replace:o.push)(x,v.state,v)},[l,o,d,u,n])}m.createContext(null);function ko(n,{relative:l}={}){let{matches:o}=m.useContext(Ea),{pathname:i}=xn(),u=JSON.stringify(Sh(o));return m.useMemo(()=>Ac(n,JSON.parse(u),i,l==="path"),[n,u,i,l])}function Zj(n,l){return By(n,l)}function By(n,l,o){var j;xt(bs(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=m.useContext(kn),{matches:u}=m.useContext(Ea),d=u[u.length-1],h=d?d.params:{},p=d?d.pathname:"/",g=d?d.pathnameBase:"/",v=d&&d.route;{let R=v&&v.path||"";Py(p,!v||R.endsWith("*")||R.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${R}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
59
|
+
|
|
60
|
+
Please change the parent <Route path="${R}"> to <Route path="${R==="/"?"*":`${R}/*`}">.`)}let x=xn(),y;if(l){let R=typeof l=="string"?xs(l):l;xt(g==="/"||((j=R.pathname)==null?void 0:j.startsWith(g)),`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 "${g}" but pathname "${R.pathname}" was given in the \`location\` prop.`),y=R}else y=x;let S=y.pathname||"/",w=S;if(g!=="/"){let R=g.replace(/^\//,"").split("/");w="/"+S.replace(/^\//,"").split("/").slice(R.length).join("/")}let C=o&&o.state.matches.length?o.state.matches.map(R=>Object.assign(R,{route:o.manifest[R.route.id]||R.route})):Cy(n,{pathname:w});Fn(v||C!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),Fn(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.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 E=n2(C&&C.map(R=>Object.assign({},R,{params:Object.assign({},h,R.params),pathname:ia([g,i.encodeLocation?i.encodeLocation(R.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?g:ia([g,i.encodeLocation?i.encodeLocation(R.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),u,o);return l&&E?m.createElement(_o.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...y},navigationType:"POP"}},E):E}function Jj(){let n=o2(),l=Uj(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),o=n instanceof Error?n.stack:null,i="rgba(200,200,200, 0.5)",u={padding:"0.5rem",backgroundColor:i},d={padding:"2px 4px",backgroundColor:i},h=null;return console.error("Error handled by React Router default ErrorBoundary:",n),h=m.createElement(m.Fragment,null,m.createElement("p",null,"💿 Hey developer 👋"),m.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",m.createElement("code",{style:d},"ErrorBoundary")," or"," ",m.createElement("code",{style:d},"errorElement")," prop on your route.")),m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},l),o?m.createElement("pre",{style:u},o):null,h)}var Wj=m.createElement(Jj,null),Hy=class extends m.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,l){return l.location!==n.location||l.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:l.error,location:l.location,revalidation:n.revalidation||l.revalidation}}componentDidCatch(n,l){this.props.onError?this.props.onError(n,l):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const o=Xj(n.digest);o&&(n=o)}let l=n!==void 0?m.createElement(Ea.Provider,{value:this.props.routeContext},m.createElement(wh.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?m.createElement(e2,{error:n},l):l}};Hy.contextType=Oy;var jf=new WeakMap;function e2({children:n,error:l}){let{basename:o}=m.useContext(kn);if(typeof l=="object"&&l&&"digest"in l&&typeof l.digest=="string"){let i=Kj(l.digest);if(i){let u=jf.get(l);if(u)throw u;let d=Dy(i.location,o),h=d.absoluteURL||d.to;if(qj(h))throw new Error("Invalid redirect location");if(My&&!jf.get(l))if(d.isExternal||i.reloadDocument)window.location.href=h;else{const p=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(d.to,{replace:i.replace}));throw jf.set(l,p),p}return m.createElement("meta",{httpEquiv:"refresh",content:`0;url=${h}`})}}return n}function t2({routeContext:n,match:l,children:o}){let i=m.useContext(ys);return i&&i.static&&i.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=l.route.id),m.createElement(Ea.Provider,{value:n},o)}function n2(n,l=[],o){let i=o==null?void 0:o.state;if(n==null){if(!i)return null;if(i.errors)n=i.matches;else if(l.length===0&&!i.initialized&&i.matches.length>0)n=i.matches;else return null}let u=n,d=i==null?void 0:i.errors;if(d!=null){let x=u.findIndex(y=>y.route.id&&(d==null?void 0:d[y.route.id])!==void 0);xt(x>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(d).join(",")}`),u=u.slice(0,Math.min(u.length,x+1))}let h=!1,p=-1;if(o&&i){h=i.renderFallback;for(let x=0;x<u.length;x++){let y=u[x];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(p=x),y.route.id){let{loaderData:S,errors:w}=i,C=y.route.loader&&!S.hasOwnProperty(y.route.id)&&(!w||w[y.route.id]===void 0);if(y.route.lazy||C){o.isStatic&&(h=!0),p>=0?u=u.slice(0,p+1):u=[u[0]];break}}}}let g=o==null?void 0:o.onError,v=i&&g?(x,y)=>{var S,w;g(x,{location:i.location,params:((w=(S=i.matches)==null?void 0:S[0])==null?void 0:w.params)??{},pattern:Bj(i.matches),errorInfo:y})}:void 0;return u.reduceRight((x,y,S)=>{let w,C=!1,E=null,j=null;i&&(w=d&&y.route.id?d[y.route.id]:void 0,E=y.route.errorElement||Wj,h&&(p<0&&S===0?(Py("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),C=!0,j=null):p===S&&(C=!0,j=y.route.hydrateFallbackElement||null)));let R=l.concat(u.slice(0,S+1)),A=()=>{let T;return w?T=E:C?T=j:y.route.Component?T=m.createElement(y.route.Component,null):y.route.element?T=y.route.element:T=x,m.createElement(t2,{match:y,routeContext:{outlet:x,matches:R,isDataRoute:i!=null},children:T})};return i&&(y.route.ErrorBoundary||y.route.errorElement||S===0)?m.createElement(Hy,{location:i.location,revalidation:i.revalidation,component:E,error:w,children:A(),routeContext:{outlet:null,matches:R,isDataRoute:!0},onError:v}):A()},null)}function jh(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function a2(n){let l=m.useContext(ys);return xt(l,jh(n)),l}function l2(n){let l=m.useContext(Mc);return xt(l,jh(n)),l}function r2(n){let l=m.useContext(Ea);return xt(l,jh(n)),l}function Ch(n){let l=r2(n),o=l.matches[l.matches.length-1];return xt(o.route.id,`${n} can only be used on routes that contain a unique "id"`),o.route.id}function s2(){return Ch("useRouteId")}function o2(){var i;let n=m.useContext(wh),l=l2("useRouteError"),o=Ch("useRouteError");return n!==void 0?n:(i=l.errors)==null?void 0:i[o]}function i2(){let{router:n}=a2("useNavigate"),l=Ch("useNavigate"),o=m.useRef(!1);return Uy(()=>{o.current=!0}),m.useCallback(async(u,d={})=>{Fn(o.current,Ly),o.current&&(typeof u=="number"?await n.navigate(u):await n.navigate(u,{fromRouteId:l,...d}))},[n,l])}var Ux={};function Py(n,l,o){!l&&!Ux[n]&&(Ux[n]=!0,Fn(!1,o))}m.memo(c2);function c2({routes:n,manifest:l,future:o,state:i,isStatic:u,onError:d}){return By(n,void 0,{manifest:l,state:i,isStatic:u,onError:d})}function qf({to:n,replace:l,state:o,relative:i}){xt(bs(),"<Navigate> may be used only in the context of a <Router> component.");let{static:u}=m.useContext(kn);Fn(!u,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:d}=m.useContext(Ea),{pathname:h}=xn(),p=Oo(),g=Ac(n,Sh(d),h,i==="path"),v=JSON.stringify(g);return m.useEffect(()=>{p(JSON.parse(v),{replace:l,state:o,relative:i})},[p,v,i,l,o]),null}function un(n){xt(!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 u2({basename:n="/",children:l=null,location:o,navigationType:i="POP",navigator:u,static:d=!1,useTransitions:h}){xt(!bs(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=n.replace(/^\/*/,"/"),g=m.useMemo(()=>({basename:p,navigator:u,static:d,useTransitions:h,future:{}}),[p,u,d,h]);typeof o=="string"&&(o=xs(o));let{pathname:v="/",search:x="",hash:y="",state:S=null,key:w="default",mask:C}=o,E=m.useMemo(()=>{let j=Wa(v,p);return j==null?null:{location:{pathname:j,search:x,hash:y,state:S,key:w,mask:C},navigationType:i}},[p,v,x,y,S,w,i,C]);return Fn(E!=null,`<Router basename="${p}"> is not able to match the URL "${v}${x}${y}" because it does not start with the basename, so the <Router> won't render anything.`),E==null?null:m.createElement(kn.Provider,{value:g},m.createElement(_o.Provider,{children:l,value:E}))}function qy({children:n,location:l}){return Zj(If(n),l)}function If(n,l=[]){let o=[];return m.Children.forEach(n,(i,u)=>{if(!m.isValidElement(i))return;let d=[...l,u];if(i.type===m.Fragment){o.push.apply(o,If(i.props.children,d));return}xt(i.type===un,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),xt(!i.props.index||!i.props.children,"An index route cannot have child routes.");let h={id:i.props.id||d.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,middleware:i.props.middleware,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(h.children=If(i.props.children,d)),o.push(h)}),o}var gc="get",vc="application/x-www-form-urlencoded";function Dc(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function d2(n){return Dc(n)&&n.tagName.toLowerCase()==="button"}function f2(n){return Dc(n)&&n.tagName.toLowerCase()==="form"}function h2(n){return Dc(n)&&n.tagName.toLowerCase()==="input"}function m2(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function p2(n,l){return n.button===0&&(!l||l==="_self")&&!m2(n)}function Vf(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((l,o)=>{let i=n[o];return l.concat(Array.isArray(i)?i.map(u=>[o,u]):[[o,i]])},[]))}function g2(n,l){let o=Vf(n);return l&&l.forEach((i,u)=>{o.has(u)||l.getAll(u).forEach(d=>{o.append(u,d)})}),o}var nc=null;function v2(){if(nc===null)try{new FormData(document.createElement("form"),0),nc=!1}catch{nc=!0}return nc}var x2=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Cf(n){return n!=null&&!x2.has(n)?(Fn(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${vc}"`),null):n}function y2(n,l){let o,i,u,d,h;if(f2(n)){let p=n.getAttribute("action");i=p?Wa(p,l):null,o=n.getAttribute("method")||gc,u=Cf(n.getAttribute("enctype"))||vc,d=new FormData(n)}else if(d2(n)||h2(n)&&(n.type==="submit"||n.type==="image")){let p=n.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=n.getAttribute("formaction")||p.getAttribute("action");if(i=g?Wa(g,l):null,o=n.getAttribute("formmethod")||p.getAttribute("method")||gc,u=Cf(n.getAttribute("formenctype"))||Cf(p.getAttribute("enctype"))||vc,d=new FormData(p,n),!v2()){let{name:v,type:x,value:y}=n;if(x==="image"){let S=v?`${v}.`:"";d.append(`${S}x`,"0"),d.append(`${S}y`,"0")}else v&&d.append(v,y)}}else{if(Dc(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');o=gc,i=null,u=vc,h=n}return d&&u==="text/plain"&&(h=d,d=void 0),{action:i,method:o.toLowerCase(),encType:u,formData:d,body:h}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Eh(n,l){if(n===!1||n===null||typeof n>"u")throw new Error(l)}function Iy(n,l,o,i){let u=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return o?u.pathname.endsWith("/")?u.pathname=`${u.pathname}_.${i}`:u.pathname=`${u.pathname}.${i}`:u.pathname==="/"?u.pathname=`_root.${i}`:l&&Wa(u.pathname,l)==="/"?u.pathname=`${jc(l)}/_root.${i}`:u.pathname=`${jc(u.pathname)}.${i}`,u}async function b2(n,l){if(n.id in l)return l[n.id];try{let o=await import(n.module);return l[n.id]=o,o}catch(o){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(o),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function S2(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function w2(n,l,o){let i=await Promise.all(n.map(async u=>{let d=l.routes[u.route.id];if(d){let h=await b2(d,o);return h.links?h.links():[]}return[]}));return N2(i.flat(1).filter(S2).filter(u=>u.rel==="stylesheet"||u.rel==="preload").map(u=>u.rel==="stylesheet"?{...u,rel:"prefetch",as:"style"}:{...u,rel:"prefetch"}))}function Bx(n,l,o,i,u,d){let h=(g,v)=>o[v]?g.route.id!==o[v].route.id:!0,p=(g,v)=>{var x;return o[v].pathname!==g.pathname||((x=o[v].route.path)==null?void 0:x.endsWith("*"))&&o[v].params["*"]!==g.params["*"]};return d==="assets"?l.filter((g,v)=>h(g,v)||p(g,v)):d==="data"?l.filter((g,v)=>{var y;let x=i.routes[g.route.id];if(!x||!x.hasLoader)return!1;if(h(g,v)||p(g,v))return!0;if(g.route.shouldRevalidate){let S=g.route.shouldRevalidate({currentUrl:new URL(u.pathname+u.search+u.hash,window.origin),currentParams:((y=o[0])==null?void 0:y.params)||{},nextUrl:new URL(n,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof S=="boolean")return S}return!0}):[]}function j2(n,l,{includeHydrateFallback:o}={}){return C2(n.map(i=>{let u=l.routes[i.route.id];if(!u)return[];let d=[u.module];return u.clientActionModule&&(d=d.concat(u.clientActionModule)),u.clientLoaderModule&&(d=d.concat(u.clientLoaderModule)),o&&u.hydrateFallbackModule&&(d=d.concat(u.hydrateFallbackModule)),u.imports&&(d=d.concat(u.imports)),d}).flat(1))}function C2(n){return[...new Set(n)]}function E2(n){let l={},o=Object.keys(n).sort();for(let i of o)l[i]=n[i];return l}function N2(n,l){let o=new Set;return new Set(l),n.reduce((i,u)=>{let d=JSON.stringify(E2(u));return o.has(d)||(o.add(d),i.push({key:d,link:u})),i},[])}function Nh(){let n=m.useContext(ys);return Eh(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function R2(){let n=m.useContext(Mc);return Eh(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var Rh=m.createContext(void 0);Rh.displayName="FrameworkContext";function _c(){let n=m.useContext(Rh);return Eh(n,"You must render this element inside a <HydratedRouter> element"),n}function T2(n,l){let o=m.useContext(Rh),[i,u]=m.useState(!1),[d,h]=m.useState(!1),{onFocus:p,onBlur:g,onMouseEnter:v,onMouseLeave:x,onTouchStart:y}=l,S=m.useRef(null);m.useEffect(()=>{if(n==="render"&&h(!0),n==="viewport"){let E=R=>{R.forEach(A=>{h(A.isIntersecting)})},j=new IntersectionObserver(E,{threshold:.5});return S.current&&j.observe(S.current),()=>{j.disconnect()}}},[n]),m.useEffect(()=>{if(i){let E=setTimeout(()=>{h(!0)},100);return()=>{clearTimeout(E)}}},[i]);let w=()=>{u(!0)},C=()=>{u(!1),h(!1)};return o?n!=="intent"?[d,S,{}]:[d,S,{onFocus:So(p,w),onBlur:So(g,C),onMouseEnter:So(v,w),onMouseLeave:So(x,C),onTouchStart:So(y,w)}]:[!1,S,{}]}function So(n,l){return o=>{n&&n(o),o.defaultPrevented||l(o)}}function A2({page:n,...l}){let o=Ij(),{nonce:i}=_c(),{router:u}=Nh(),d=m.useMemo(()=>Cy(u.routes,n,u.basename),[u.routes,n,u.basename]);return d?(l.nonce==null&&i&&(l={...l,nonce:i}),o?m.createElement(D2,{page:n,matches:d,...l}):m.createElement(_2,{page:n,matches:d,...l})):null}function M2(n){let{manifest:l,routeModules:o}=_c(),[i,u]=m.useState([]);return m.useEffect(()=>{let d=!1;return w2(n,l,o).then(h=>{d||u(h)}),()=>{d=!0}},[n,l,o]),i}function D2({page:n,matches:l,...o}){let i=xn(),{future:u}=_c(),{basename:d}=Nh(),h=m.useMemo(()=>{if(n===i.pathname+i.search+i.hash)return[];let p=Iy(n,d,u.v8_trailingSlashAwareDataRequests,"rsc"),g=!1,v=[];for(let x of l)typeof x.route.shouldRevalidate=="function"?g=!0:v.push(x.route.id);return g&&v.length>0&&p.searchParams.set("_routes",v.join(",")),[p.pathname+p.search]},[d,u.v8_trailingSlashAwareDataRequests,n,i,l]);return m.createElement(m.Fragment,null,h.map(p=>m.createElement("link",{key:p,rel:"prefetch",as:"fetch",href:p,...o})))}function _2({page:n,matches:l,...o}){let i=xn(),{future:u,manifest:d,routeModules:h}=_c(),{basename:p}=Nh(),{loaderData:g,matches:v}=R2(),x=m.useMemo(()=>Bx(n,l,v,d,i,"data"),[n,l,v,d,i]),y=m.useMemo(()=>Bx(n,l,v,d,i,"assets"),[n,l,v,d,i]),S=m.useMemo(()=>{if(n===i.pathname+i.search+i.hash)return[];let E=new Set,j=!1;if(l.forEach(A=>{var D;let T=d.routes[A.route.id];!T||!T.hasLoader||(!x.some(O=>O.route.id===A.route.id)&&A.route.id in g&&((D=h[A.route.id])!=null&&D.shouldRevalidate)||T.hasClientLoader?j=!0:E.add(A.route.id))}),E.size===0)return[];let R=Iy(n,p,u.v8_trailingSlashAwareDataRequests,"data");return j&&E.size>0&&R.searchParams.set("_routes",l.filter(A=>E.has(A.route.id)).map(A=>A.route.id).join(",")),[R.pathname+R.search]},[p,u.v8_trailingSlashAwareDataRequests,g,i,d,x,l,n,h]),w=m.useMemo(()=>j2(y,d),[y,d]),C=M2(y);return m.createElement(m.Fragment,null,S.map(E=>m.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...o})),w.map(E=>m.createElement("link",{key:E,rel:"modulepreload",href:E,...o})),C.map(({key:E,link:j})=>m.createElement("link",{key:E,nonce:o.nonce,...j,crossOrigin:j.crossOrigin??o.crossOrigin})))}function O2(...n){return l=>{n.forEach(o=>{typeof o=="function"?o(l):o!=null&&(o.current=l)})}}var k2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{k2&&(window.__reactRouterVersion="7.18.2")}catch{}function z2({basename:n,children:l,useTransitions:o,window:i}){let u=m.useRef();u.current==null&&(u.current=mj({window:i,v5Compat:!0}));let d=u.current,[h,p]=m.useState({action:d.action,location:d.location}),g=m.useCallback(v=>{o===!1?p(v):m.startTransition(()=>p(v))},[o]);return m.useLayoutEffect(()=>d.listen(g),[d,g]),m.createElement(u2,{basename:n,children:l,location:h.location,navigationType:h.action,navigator:d,useTransitions:o})}var fr=m.forwardRef(function({onClick:l,discover:o="render",prefetch:i="none",relative:u,reloadDocument:d,replace:h,mask:p,state:g,target:v,to:x,preventScrollReset:y,viewTransition:S,defaultShouldRevalidate:w,...C},E){let{basename:j,navigator:R,useTransitions:A}=m.useContext(kn),T=typeof x=="string"&&bh.test(x),D=Dy(x,j);x=D.to;let O=Fj(x,{relative:u}),M=xn(),B=null;if(p){let ce=Ac(p,[],M.mask?M.mask.pathname:"/",!0);j!=="/"&&(ce.pathname=ce.pathname==="/"?j:ia([j,ce.pathname])),B=R.createHref(ce)}let[z,K,oe]=T2(i,C),X=B2(x,{replace:h,mask:p,state:g,target:v,preventScrollReset:y,relative:u,viewTransition:S,defaultShouldRevalidate:w,useTransitions:A});function q(ce){l&&l(ce),ce.defaultPrevented||X(ce)}let le=!(D.isExternal||d),J=m.createElement("a",{...C,...oe,href:(le?B:void 0)||D.absoluteURL||O,onClick:le?q:l,ref:O2(E,K),target:v,"data-discover":!T&&o==="render"?"true":void 0});return z&&!T?m.createElement(m.Fragment,null,J,m.createElement(A2,{page:O})):J});fr.displayName="Link";var Vy=m.forwardRef(function({"aria-current":l="page",caseSensitive:o=!1,className:i="",end:u=!1,style:d,to:h,viewTransition:p,children:g,...v},x){let y=ko(h,{relative:v.relative}),S=xn(),w=m.useContext(Mc),{navigator:C,basename:E}=m.useContext(kn),j=w!=null&&G2(y)&&p===!0,R=C.encodeLocation?C.encodeLocation(y).pathname:y.pathname,A=S.pathname,T=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;o||(A=A.toLowerCase(),T=T?T.toLowerCase():null,R=R.toLowerCase()),T&&E&&(T=Wa(T,E)||T);const D=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let O=A===R||!u&&A.startsWith(R)&&A.charAt(D)==="/",M=T!=null&&(T===R||!u&&T.startsWith(R)&&T.charAt(R.length)==="/"),B={isActive:O,isPending:M,isTransitioning:j},z=O?l:void 0,K;typeof i=="function"?K=i(B):K=[i,O?"active":null,M?"pending":null,j?"transitioning":null].filter(Boolean).join(" ");let oe=typeof d=="function"?d(B):d;return m.createElement(fr,{...v,"aria-current":z,className:K,ref:x,style:oe,to:h,viewTransition:p},typeof g=="function"?g(B):g)});Vy.displayName="NavLink";var L2=m.forwardRef(({discover:n="render",fetcherKey:l,navigate:o,reloadDocument:i,replace:u,state:d,method:h=gc,action:p,onSubmit:g,relative:v,preventScrollReset:x,viewTransition:y,defaultShouldRevalidate:S,...w},C)=>{let{useTransitions:E}=m.useContext(kn),j=I2(),R=V2(p,{relative:v}),A=h.toLowerCase()==="get"?"get":"post",T=typeof p=="string"&&bh.test(p),D=O=>{if(g&&g(O),O.defaultPrevented)return;O.preventDefault();let M=O.nativeEvent.submitter,B=(M==null?void 0:M.getAttribute("formmethod"))||h,z=()=>j(M||O.currentTarget,{fetcherKey:l,method:B,navigate:o,replace:u,state:d,relative:v,preventScrollReset:x,viewTransition:y,defaultShouldRevalidate:S});E&&o!==!1?m.startTransition(()=>z()):z()};return m.createElement("form",{ref:C,method:A,action:R,onSubmit:i?g:D,...w,"data-discover":!T&&n==="render"?"true":void 0})});L2.displayName="Form";function U2(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Gy(n){let l=m.useContext(ys);return xt(l,U2(n)),l}function B2(n,{target:l,replace:o,mask:i,state:u,preventScrollReset:d,relative:h,viewTransition:p,defaultShouldRevalidate:g,useTransitions:v}={}){let x=Oo(),y=xn(),S=ko(n,{relative:h});return m.useCallback(w=>{if(p2(w,l)){w.preventDefault();let C=o!==void 0?o:No(y)===No(S),E=()=>x(n,{replace:C,mask:i,state:u,preventScrollReset:d,relative:h,viewTransition:p,defaultShouldRevalidate:g});v?m.startTransition(()=>E()):E()}},[y,x,S,o,i,u,l,n,d,h,p,g,v])}function H2(n){Fn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let l=m.useRef(Vf(n)),o=m.useRef(!1),i=xn(),u=m.useMemo(()=>g2(i.search,o.current?null:l.current),[i.search]),d=Oo(),h=m.useCallback((p,g)=>{const v=Vf(typeof p=="function"?p(new URLSearchParams(u)):p);o.current=!0,d("?"+v,g)},[d,u]);return[u,h]}var P2=0,q2=()=>`__${String(++P2)}__`;function I2(){let{router:n}=Gy("useSubmit"),{basename:l}=m.useContext(kn),o=s2(),i=n.fetch,u=n.navigate;return m.useCallback(async(d,h={})=>{let{action:p,method:g,encType:v,formData:x,body:y}=y2(d,l);if(h.navigate===!1){let S=h.fetcherKey||q2();await i(S,o,h.action||p,{defaultShouldRevalidate:h.defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:x,body:y,formMethod:h.method||g,formEncType:h.encType||v,flushSync:h.flushSync})}else await u(h.action||p,{defaultShouldRevalidate:h.defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:x,body:y,formMethod:h.method||g,formEncType:h.encType||v,replace:h.replace,state:h.state,fromRouteId:o,flushSync:h.flushSync,viewTransition:h.viewTransition})},[i,u,l,o])}function V2(n,{relative:l}={}){let{basename:o}=m.useContext(kn),i=m.useContext(Ea);xt(i,"useFormAction must be used inside a RouteContext");let[u]=i.matches.slice(-1),d={...ko(n||".",{relative:l})},h=xn();if(n==null){d.search=h.search;let p=new URLSearchParams(d.search),g=p.getAll("index");if(g.some(x=>x==="")){p.delete("index"),g.filter(y=>y).forEach(y=>p.append("index",y));let x=p.toString();d.search=x?`?${x}`:""}}return(!n||n===".")&&u.route.index&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),o!=="/"&&(d.pathname=d.pathname==="/"?o:ia([o,d.pathname])),No(d)}function G2(n,{relative:l}={}){let o=m.useContext(ky);xt(o!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=Gy("useViewTransitionState"),u=ko(n,{relative:l});if(!o.isTransitioning)return!1;let d=Wa(o.currentLocation.pathname,i)||o.currentLocation.pathname,h=Wa(o.nextLocation.pathname,i)||o.nextLocation.pathname;return wc(u.pathname,h)!=null||wc(u.pathname,d)!=null}var Ss=wy();const Y2=xh(Ss),$2="";class K2 extends Error{constructor(l,o,i){var u;super(typeof i=="object"&&i&&"error"in i?String(((u=i.error)==null?void 0:u.message)??i):"Request failed"),this.status=l,this.type=o,this.body=i}}async function wo(n,l,o,i){var g;const u=o!==void 0,d=await fetch(`${$2}${l}`,{method:n,headers:{...u?{"content-type":"application/json"}:{},...(i==null?void 0:i.headers)??{}},body:u?JSON.stringify(o):void 0,credentials:"include",...i}),h=await d.text();let p;try{p=h?JSON.parse(h):void 0}catch{p=h}if(!d.ok)throw new K2(d.status,typeof p=="object"&&p&&"error"in p?String(((g=p.error)==null?void 0:g.type)??"error"):"error",p);return p}const Se={get:(n,l)=>wo("GET",n,void 0,l),post:(n,l,o)=>wo("POST",n,l,o),patch:(n,l,o)=>wo("PATCH",n,l,o),put:(n,l,o)=>wo("PUT",n,l,o),del:n=>wo("DELETE",n)},Yy=m.createContext(void 0);function X2({children:n}){const[l,o]=m.useState(null),[i,u]=m.useState(!0),d=m.useCallback(async()=>{try{const g=await Se.get("/api/admin/me");o(g)}catch{o(null)}finally{u(!1)}},[]);m.useEffect(()=>{d()},[d]);const h=m.useCallback(async(g,v,x,y)=>{const S={username:g,password:v};x&&(S.totp=x),y&&(S.recoveryCode=y);try{const w=await Se.post("/api/admin/login",S);return o({id:"admin",username:w.username,totpEnabled:w.totpEnabled}),{totpRequired:!1}}catch(w){const C=w.status,E=w.type;if(C===401&&E==="totp_required")return{totpRequired:!0};throw w}},[]),p=m.useCallback(async()=>{await Se.post("/api/admin/logout"),o(null)},[]);return s.jsx(Yy.Provider,{value:{user:l,loading:i,login:h,logout:p,refresh:d},children:n})}function Th(){const n=m.useContext(Yy);if(!n)throw new Error("useAuth must be inside AuthProvider");return n}/**
|
|
61
|
+
* @license lucide-react v0.469.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 F2=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),$y=(...n)=>n.filter((l,o,i)=>!!l&&l.trim()!==""&&i.indexOf(l)===o).join(" ").trim();/**
|
|
66
|
+
* @license lucide-react v0.469.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
|
+
*/var Q2={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"};/**
|
|
71
|
+
* @license lucide-react v0.469.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 Z2=m.forwardRef(({color:n="currentColor",size:l=24,strokeWidth:o=2,absoluteStrokeWidth:i,className:u="",children:d,iconNode:h,...p},g)=>m.createElement("svg",{ref:g,...Q2,width:l,height:l,stroke:n,strokeWidth:i?Number(o)*24/Number(l):o,className:$y("lucide",u),...p},[...h.map(([v,x])=>m.createElement(v,x)),...Array.isArray(d)?d:[d]]));/**
|
|
76
|
+
* @license lucide-react v0.469.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 Oe=(n,l)=>{const o=m.forwardRef(({className:i,...u},d)=>m.createElement(Z2,{ref:d,iconNode:l,className:$y(`lucide-${F2(n)}`,i),...u}));return o.displayName=`${n}`,o};/**
|
|
81
|
+
* @license lucide-react v0.469.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
|
+
*/const Ky=Oe("Activity",[["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"}]]);/**
|
|
86
|
+
* @license lucide-react v0.469.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 J2=Oe("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/**
|
|
91
|
+
* @license lucide-react v0.469.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 W2=Oe("Bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);/**
|
|
96
|
+
* @license lucide-react v0.469.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 eC=Oe("Boxes",[["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"}]]);/**
|
|
101
|
+
* @license lucide-react v0.469.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 Xy=Oe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
106
|
+
* @license lucide-react v0.469.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 tC=Oe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
111
|
+
* @license lucide-react v0.469.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 nC=Oe("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);/**
|
|
116
|
+
* @license lucide-react v0.469.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 Oc=Oe("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
121
|
+
* @license lucide-react v0.469.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 aC=Oe("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
126
|
+
* @license lucide-react v0.469.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 lC=Oe("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
131
|
+
* @license lucide-react v0.469.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 rC=Oe("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
|
|
136
|
+
* @license lucide-react v0.469.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 sC=Oe("Cog",[["path",{d:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",key:"sobvz5"}],["path",{d:"M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",key:"11i496"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}]]);/**
|
|
141
|
+
* @license lucide-react v0.469.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 Ef=Oe("Copy",[["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"}]]);/**
|
|
146
|
+
* @license lucide-react v0.469.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 oC=Oe("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
|
|
151
|
+
* @license lucide-react v0.469.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 iC=Oe("Database",[["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"}]]);/**
|
|
156
|
+
* @license lucide-react v0.469.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 Fy=Oe("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
161
|
+
* @license lucide-react v0.469.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 cC=Oe("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
166
|
+
* @license lucide-react v0.469.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 uC=Oe("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
171
|
+
* @license lucide-react v0.469.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 dC=Oe("FlaskConical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]);/**
|
|
176
|
+
* @license lucide-react v0.469.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 Qy=Oe("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
|
|
181
|
+
* @license lucide-react v0.469.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 Zy=Oe("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
|
|
186
|
+
* @license lucide-react v0.469.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 Jy=Oe("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
|
|
191
|
+
* @license lucide-react v0.469.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 Eo=Oe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
196
|
+
* @license lucide-react v0.469.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 fC=Oe("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
|
|
201
|
+
* @license lucide-react v0.469.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 hC=Oe("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
|
|
206
|
+
* @license lucide-react v0.469.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 mC=Oe("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
211
|
+
* @license lucide-react v0.469.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 Wy=Oe("Network",[["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"}]]);/**
|
|
216
|
+
* @license lucide-react v0.469.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 pC=Oe("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
221
|
+
* @license lucide-react v0.469.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 gC=Oe("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
226
|
+
* @license lucide-react v0.469.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 zo=Oe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
231
|
+
* @license lucide-react v0.469.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 vC=Oe("Route",[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]]);/**
|
|
236
|
+
* @license lucide-react v0.469.0 - ISC
|
|
237
|
+
*
|
|
238
|
+
* This source code is licensed under the ISC license.
|
|
239
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
+
*/const xC=Oe("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/**
|
|
241
|
+
* @license lucide-react v0.469.0 - ISC
|
|
242
|
+
*
|
|
243
|
+
* This source code is licensed under the ISC license.
|
|
244
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
+
*/const eb=Oe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
246
|
+
* @license lucide-react v0.469.0 - ISC
|
|
247
|
+
*
|
|
248
|
+
* This source code is licensed under the ISC license.
|
|
249
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
+
*/const yC=Oe("ShieldCheck",[["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"}]]);/**
|
|
251
|
+
* @license lucide-react v0.469.0 - ISC
|
|
252
|
+
*
|
|
253
|
+
* This source code is licensed under the ISC license.
|
|
254
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
+
*/const bC=Oe("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
|
|
256
|
+
* @license lucide-react v0.469.0 - ISC
|
|
257
|
+
*
|
|
258
|
+
* This source code is licensed under the ISC license.
|
|
259
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
+
*/const SC=Oe("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
|
|
261
|
+
* @license lucide-react v0.469.0 - ISC
|
|
262
|
+
*
|
|
263
|
+
* This source code is licensed under the ISC license.
|
|
264
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
+
*/const wC=Oe("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
|
|
266
|
+
* @license lucide-react v0.469.0 - ISC
|
|
267
|
+
*
|
|
268
|
+
* This source code is licensed under the ISC license.
|
|
269
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
+
*/const kc=Oe("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
271
|
+
* @license lucide-react v0.469.0 - ISC
|
|
272
|
+
*
|
|
273
|
+
* This source code is licensed under the ISC license.
|
|
274
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
+
*/const jC=Oe("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
|
|
276
|
+
* @license lucide-react v0.469.0 - ISC
|
|
277
|
+
*
|
|
278
|
+
* This source code is licensed under the ISC license.
|
|
279
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
+
*/const CC=Oe("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
|
|
281
|
+
* @license lucide-react v0.469.0 - ISC
|
|
282
|
+
*
|
|
283
|
+
* This source code is licensed under the ISC license.
|
|
284
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
285
|
+
*/const zc=Oe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
286
|
+
* @license lucide-react v0.469.0 - ISC
|
|
287
|
+
*
|
|
288
|
+
* This source code is licensed under the ISC license.
|
|
289
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
290
|
+
*/const EC=Oe("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function tb(n){var l,o,i="";if(typeof n=="string"||typeof n=="number")i+=n;else if(typeof n=="object")if(Array.isArray(n)){var u=n.length;for(l=0;l<u;l++)n[l]&&(o=tb(n[l]))&&(i&&(i+=" "),i+=o)}else for(o in n)n[o]&&(i&&(i+=" "),i+=o);return i}function nb(){for(var n,l,o=0,i="",u=arguments.length;o<u;o++)(n=arguments[o])&&(l=tb(n))&&(i&&(i+=" "),i+=l);return i}const Ah="-",NC=n=>{const l=TC(n),{conflictingClassGroups:o,conflictingClassGroupModifiers:i}=n;return{getClassGroupId:h=>{const p=h.split(Ah);return p[0]===""&&p.length!==1&&p.shift(),ab(p,l)||RC(h)},getConflictingClassGroupIds:(h,p)=>{const g=o[h]||[];return p&&i[h]?[...g,...i[h]]:g}}},ab=(n,l)=>{var h;if(n.length===0)return l.classGroupId;const o=n[0],i=l.nextPart.get(o),u=i?ab(n.slice(1),i):void 0;if(u)return u;if(l.validators.length===0)return;const d=n.join(Ah);return(h=l.validators.find(({validator:p})=>p(d)))==null?void 0:h.classGroupId},Hx=/^\[(.+)\]$/,RC=n=>{if(Hx.test(n)){const l=Hx.exec(n)[1],o=l==null?void 0:l.substring(0,l.indexOf(":"));if(o)return"arbitrary.."+o}},TC=n=>{const{theme:l,prefix:o}=n,i={nextPart:new Map,validators:[]};return MC(Object.entries(n.classGroups),o).forEach(([d,h])=>{Gf(h,i,d,l)}),i},Gf=(n,l,o,i)=>{n.forEach(u=>{if(typeof u=="string"){const d=u===""?l:Px(l,u);d.classGroupId=o;return}if(typeof u=="function"){if(AC(u)){Gf(u(i),l,o,i);return}l.validators.push({validator:u,classGroupId:o});return}Object.entries(u).forEach(([d,h])=>{Gf(h,Px(l,d),o,i)})})},Px=(n,l)=>{let o=n;return l.split(Ah).forEach(i=>{o.nextPart.has(i)||o.nextPart.set(i,{nextPart:new Map,validators:[]}),o=o.nextPart.get(i)}),o},AC=n=>n.isThemeGetter,MC=(n,l)=>l?n.map(([o,i])=>{const u=i.map(d=>typeof d=="string"?l+d:typeof d=="object"?Object.fromEntries(Object.entries(d).map(([h,p])=>[l+h,p])):d);return[o,u]}):n,DC=n=>{if(n<1)return{get:()=>{},set:()=>{}};let l=0,o=new Map,i=new Map;const u=(d,h)=>{o.set(d,h),l++,l>n&&(l=0,i=o,o=new Map)};return{get(d){let h=o.get(d);if(h!==void 0)return h;if((h=i.get(d))!==void 0)return u(d,h),h},set(d,h){o.has(d)?o.set(d,h):u(d,h)}}},lb="!",_C=n=>{const{separator:l,experimentalParseClassName:o}=n,i=l.length===1,u=l[0],d=l.length,h=p=>{const g=[];let v=0,x=0,y;for(let j=0;j<p.length;j++){let R=p[j];if(v===0){if(R===u&&(i||p.slice(j,j+d)===l)){g.push(p.slice(x,j)),x=j+d;continue}if(R==="/"){y=j;continue}}R==="["?v++:R==="]"&&v--}const S=g.length===0?p:p.substring(x),w=S.startsWith(lb),C=w?S.substring(1):S,E=y&&y>x?y-x:void 0;return{modifiers:g,hasImportantModifier:w,baseClassName:C,maybePostfixModifierPosition:E}};return o?p=>o({className:p,parseClassName:h}):h},OC=n=>{if(n.length<=1)return n;const l=[];let o=[];return n.forEach(i=>{i[0]==="["?(l.push(...o.sort(),i),o=[]):o.push(i)}),l.push(...o.sort()),l},kC=n=>({cache:DC(n.cacheSize),parseClassName:_C(n),...NC(n)}),zC=/\s+/,LC=(n,l)=>{const{parseClassName:o,getClassGroupId:i,getConflictingClassGroupIds:u}=l,d=[],h=n.trim().split(zC);let p="";for(let g=h.length-1;g>=0;g-=1){const v=h[g],{modifiers:x,hasImportantModifier:y,baseClassName:S,maybePostfixModifierPosition:w}=o(v);let C=!!w,E=i(C?S.substring(0,w):S);if(!E){if(!C){p=v+(p.length>0?" "+p:p);continue}if(E=i(S),!E){p=v+(p.length>0?" "+p:p);continue}C=!1}const j=OC(x).join(":"),R=y?j+lb:j,A=R+E;if(d.includes(A))continue;d.push(A);const T=u(E,C);for(let D=0;D<T.length;++D){const O=T[D];d.push(R+O)}p=v+(p.length>0?" "+p:p)}return p};function UC(){let n=0,l,o,i="";for(;n<arguments.length;)(l=arguments[n++])&&(o=rb(l))&&(i&&(i+=" "),i+=o);return i}const rb=n=>{if(typeof n=="string")return n;let l,o="";for(let i=0;i<n.length;i++)n[i]&&(l=rb(n[i]))&&(o&&(o+=" "),o+=l);return o};function BC(n,...l){let o,i,u,d=h;function h(g){const v=l.reduce((x,y)=>y(x),n());return o=kC(v),i=o.cache.get,u=o.cache.set,d=p,p(g)}function p(g){const v=i(g);if(v)return v;const x=LC(g,o);return u(g,x),x}return function(){return d(UC.apply(null,arguments))}}const mt=n=>{const l=o=>o[n]||[];return l.isThemeGetter=!0,l},sb=/^\[(?:([a-z-]+):)?(.+)\]$/i,HC=/^\d+\/\d+$/,PC=new Set(["px","full","screen"]),qC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,IC=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,VC=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,GC=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,YC=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ka=n=>hs(n)||PC.has(n)||HC.test(n),Ol=n=>ws(n,"length",WC),hs=n=>!!n&&!Number.isNaN(Number(n)),Nf=n=>ws(n,"number",hs),jo=n=>!!n&&Number.isInteger(Number(n)),$C=n=>n.endsWith("%")&&hs(n.slice(0,-1)),ze=n=>sb.test(n),kl=n=>qC.test(n),KC=new Set(["length","size","percentage"]),XC=n=>ws(n,KC,ob),FC=n=>ws(n,"position",ob),QC=new Set(["image","url"]),ZC=n=>ws(n,QC,tE),JC=n=>ws(n,"",eE),Co=()=>!0,ws=(n,l,o)=>{const i=sb.exec(n);return i?i[1]?typeof l=="string"?i[1]===l:l.has(i[1]):o(i[2]):!1},WC=n=>IC.test(n)&&!VC.test(n),ob=()=>!1,eE=n=>GC.test(n),tE=n=>YC.test(n),nE=()=>{const n=mt("colors"),l=mt("spacing"),o=mt("blur"),i=mt("brightness"),u=mt("borderColor"),d=mt("borderRadius"),h=mt("borderSpacing"),p=mt("borderWidth"),g=mt("contrast"),v=mt("grayscale"),x=mt("hueRotate"),y=mt("invert"),S=mt("gap"),w=mt("gradientColorStops"),C=mt("gradientColorStopPositions"),E=mt("inset"),j=mt("margin"),R=mt("opacity"),A=mt("padding"),T=mt("saturate"),D=mt("scale"),O=mt("sepia"),M=mt("skew"),B=mt("space"),z=mt("translate"),K=()=>["auto","contain","none"],oe=()=>["auto","hidden","clip","visible","scroll"],X=()=>["auto",ze,l],q=()=>[ze,l],le=()=>["",Ka,Ol],J=()=>["auto",hs,ze],ce=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],U=()=>["solid","dashed","dotted","double","none"],Y=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ae=()=>["start","end","center","between","around","evenly","stretch"],W=()=>["","0",ze],te=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>[hs,ze];return{cacheSize:500,separator:":",theme:{colors:[Co],spacing:[Ka,Ol],blur:["none","",kl,ze],brightness:_(),borderColor:[n],borderRadius:["none","","full",kl,ze],borderSpacing:q(),borderWidth:le(),contrast:_(),grayscale:W(),hueRotate:_(),invert:W(),gap:q(),gradientColorStops:[n],gradientColorStopPositions:[$C,Ol],inset:X(),margin:X(),opacity:_(),padding:q(),saturate:_(),scale:_(),sepia:W(),skew:_(),space:q(),translate:q()},classGroups:{aspect:[{aspect:["auto","square","video",ze]}],container:["container"],columns:[{columns:[kl]}],"break-after":[{"break-after":te()}],"break-before":[{"break-before":te()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ce(),ze]}],overflow:[{overflow:oe()}],"overflow-x":[{"overflow-x":oe()}],"overflow-y":[{"overflow-y":oe()}],overscroll:[{overscroll:K()}],"overscroll-x":[{"overscroll-x":K()}],"overscroll-y":[{"overscroll-y":K()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[E]}],"inset-x":[{"inset-x":[E]}],"inset-y":[{"inset-y":[E]}],start:[{start:[E]}],end:[{end:[E]}],top:[{top:[E]}],right:[{right:[E]}],bottom:[{bottom:[E]}],left:[{left:[E]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",jo,ze]}],basis:[{basis:X()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ze]}],grow:[{grow:W()}],shrink:[{shrink:W()}],order:[{order:["first","last","none",jo,ze]}],"grid-cols":[{"grid-cols":[Co]}],"col-start-end":[{col:["auto",{span:["full",jo,ze]},ze]}],"col-start":[{"col-start":J()}],"col-end":[{"col-end":J()}],"grid-rows":[{"grid-rows":[Co]}],"row-start-end":[{row:["auto",{span:[jo,ze]},ze]}],"row-start":[{"row-start":J()}],"row-end":[{"row-end":J()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ze]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ze]}],gap:[{gap:[S]}],"gap-x":[{"gap-x":[S]}],"gap-y":[{"gap-y":[S]}],"justify-content":[{justify:["normal",...ae()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ae(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ae(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[A]}],px:[{px:[A]}],py:[{py:[A]}],ps:[{ps:[A]}],pe:[{pe:[A]}],pt:[{pt:[A]}],pr:[{pr:[A]}],pb:[{pb:[A]}],pl:[{pl:[A]}],m:[{m:[j]}],mx:[{mx:[j]}],my:[{my:[j]}],ms:[{ms:[j]}],me:[{me:[j]}],mt:[{mt:[j]}],mr:[{mr:[j]}],mb:[{mb:[j]}],ml:[{ml:[j]}],"space-x":[{"space-x":[B]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[B]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ze,l]}],"min-w":[{"min-w":[ze,l,"min","max","fit"]}],"max-w":[{"max-w":[ze,l,"none","full","min","max","fit","prose",{screen:[kl]},kl]}],h:[{h:[ze,l,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ze,l,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ze,l,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ze,l,"auto","min","max","fit"]}],"font-size":[{text:["base",kl,Ol]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Nf]}],"font-family":[{font:[Co]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ze]}],"line-clamp":[{"line-clamp":["none",hs,Nf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ka,ze]}],"list-image":[{"list-image":["none",ze]}],"list-style-type":[{list:["none","disc","decimal",ze]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[n]}],"placeholder-opacity":[{"placeholder-opacity":[R]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[n]}],"text-opacity":[{"text-opacity":[R]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ka,Ol]}],"underline-offset":[{"underline-offset":["auto",Ka,ze]}],"text-decoration-color":[{decoration:[n]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:q()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ze]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ze]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[R]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ce(),FC]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",XC]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ZC]}],"bg-color":[{bg:[n]}],"gradient-from-pos":[{from:[C]}],"gradient-via-pos":[{via:[C]}],"gradient-to-pos":[{to:[C]}],"gradient-from":[{from:[w]}],"gradient-via":[{via:[w]}],"gradient-to":[{to:[w]}],rounded:[{rounded:[d]}],"rounded-s":[{"rounded-s":[d]}],"rounded-e":[{"rounded-e":[d]}],"rounded-t":[{"rounded-t":[d]}],"rounded-r":[{"rounded-r":[d]}],"rounded-b":[{"rounded-b":[d]}],"rounded-l":[{"rounded-l":[d]}],"rounded-ss":[{"rounded-ss":[d]}],"rounded-se":[{"rounded-se":[d]}],"rounded-ee":[{"rounded-ee":[d]}],"rounded-es":[{"rounded-es":[d]}],"rounded-tl":[{"rounded-tl":[d]}],"rounded-tr":[{"rounded-tr":[d]}],"rounded-br":[{"rounded-br":[d]}],"rounded-bl":[{"rounded-bl":[d]}],"border-w":[{border:[p]}],"border-w-x":[{"border-x":[p]}],"border-w-y":[{"border-y":[p]}],"border-w-s":[{"border-s":[p]}],"border-w-e":[{"border-e":[p]}],"border-w-t":[{"border-t":[p]}],"border-w-r":[{"border-r":[p]}],"border-w-b":[{"border-b":[p]}],"border-w-l":[{"border-l":[p]}],"border-opacity":[{"border-opacity":[R]}],"border-style":[{border:[...U(),"hidden"]}],"divide-x":[{"divide-x":[p]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[p]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[R]}],"divide-style":[{divide:U()}],"border-color":[{border:[u]}],"border-color-x":[{"border-x":[u]}],"border-color-y":[{"border-y":[u]}],"border-color-s":[{"border-s":[u]}],"border-color-e":[{"border-e":[u]}],"border-color-t":[{"border-t":[u]}],"border-color-r":[{"border-r":[u]}],"border-color-b":[{"border-b":[u]}],"border-color-l":[{"border-l":[u]}],"divide-color":[{divide:[u]}],"outline-style":[{outline:["",...U()]}],"outline-offset":[{"outline-offset":[Ka,ze]}],"outline-w":[{outline:[Ka,Ol]}],"outline-color":[{outline:[n]}],"ring-w":[{ring:le()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[n]}],"ring-opacity":[{"ring-opacity":[R]}],"ring-offset-w":[{"ring-offset":[Ka,Ol]}],"ring-offset-color":[{"ring-offset":[n]}],shadow:[{shadow:["","inner","none",kl,JC]}],"shadow-color":[{shadow:[Co]}],opacity:[{opacity:[R]}],"mix-blend":[{"mix-blend":[...Y(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Y()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[i]}],contrast:[{contrast:[g]}],"drop-shadow":[{"drop-shadow":["","none",kl,ze]}],grayscale:[{grayscale:[v]}],"hue-rotate":[{"hue-rotate":[x]}],invert:[{invert:[y]}],saturate:[{saturate:[T]}],sepia:[{sepia:[O]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[i]}],"backdrop-contrast":[{"backdrop-contrast":[g]}],"backdrop-grayscale":[{"backdrop-grayscale":[v]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[x]}],"backdrop-invert":[{"backdrop-invert":[y]}],"backdrop-opacity":[{"backdrop-opacity":[R]}],"backdrop-saturate":[{"backdrop-saturate":[T]}],"backdrop-sepia":[{"backdrop-sepia":[O]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[h]}],"border-spacing-x":[{"border-spacing-x":[h]}],"border-spacing-y":[{"border-spacing-y":[h]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ze]}],duration:[{duration:_()}],ease:[{ease:["linear","in","out","in-out",ze]}],delay:[{delay:_()}],animate:[{animate:["none","spin","ping","pulse","bounce",ze]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[D]}],"scale-x":[{"scale-x":[D]}],"scale-y":[{"scale-y":[D]}],rotate:[{rotate:[jo,ze]}],"translate-x":[{"translate-x":[z]}],"translate-y":[{"translate-y":[z]}],"skew-x":[{"skew-x":[M]}],"skew-y":[{"skew-y":[M]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ze]}],accent:[{accent:["auto",n]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ze]}],"caret-color":[{caret:[n]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":q()}],"scroll-mx":[{"scroll-mx":q()}],"scroll-my":[{"scroll-my":q()}],"scroll-ms":[{"scroll-ms":q()}],"scroll-me":[{"scroll-me":q()}],"scroll-mt":[{"scroll-mt":q()}],"scroll-mr":[{"scroll-mr":q()}],"scroll-mb":[{"scroll-mb":q()}],"scroll-ml":[{"scroll-ml":q()}],"scroll-p":[{"scroll-p":q()}],"scroll-px":[{"scroll-px":q()}],"scroll-py":[{"scroll-py":q()}],"scroll-ps":[{"scroll-ps":q()}],"scroll-pe":[{"scroll-pe":q()}],"scroll-pt":[{"scroll-pt":q()}],"scroll-pr":[{"scroll-pr":q()}],"scroll-pb":[{"scroll-pb":q()}],"scroll-pl":[{"scroll-pl":q()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ze]}],fill:[{fill:[n,"none"]}],"stroke-w":[{stroke:[Ka,Ol,Nf]}],stroke:[{stroke:[n,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},aE=BC(nE);function Ee(...n){return aE(nb(n))}function Ot(n,l="—"){return n==null||Number.isNaN(n)?l:n.toLocaleString()}function Lc(n,l=1,o="—"){return n==null||Number.isNaN(n)?o:`${(n*100).toFixed(l)}%`}function hr(n){return n?n<1e3?`${Math.round(n)} ms`:`${(n/1e3).toFixed(2)} s`:"—"}function Mh(n){if(!n)return"—";try{return new Date(n).toLocaleString()}catch{return n}}function lE(n,l=8){return n?n.length>l?`${n.slice(0,l)}…`:n:"—"}function rE(n){if(!n)return"—";const l=Date.now()-new Date(n).getTime();if(!Number.isFinite(l)||l<0)return"—";const o=Math.floor(l/1e3);if(o<60)return`${o}s ago`;const i=Math.floor(o/60);if(i<60)return`${i}m ago`;const u=Math.floor(i/60);return u<24?`${u}h ago`:`${Math.floor(u/24)}d ago`}const sE=[{to:"/",label:"Dashboard",icon:Qy,end:!0},{to:"/providers",label:"Providers",icon:Wy},{to:"/models",label:"Models",icon:eC},{to:"/combos",label:"Combos",icon:Jy},{to:"/aliases",label:"Aliases",icon:rC},{to:"/api-keys",label:"API Keys",icon:Zy},{to:"/requests",label:"Requests",icon:Ky},{to:"/statistics",label:"Statistics",icon:uC},{to:"/audit",label:"Audit Logs",icon:xC},{to:"/settings",label:"Settings",icon:sC}];function oE(){const[n,l]=m.useState(null);return m.useEffect(()=>{let o=!1;return fetch("/api/admin/settings/system",{credentials:"include"}).then(i=>i.ok?i.json():null).then(i=>{!o&&(i!=null&&i.appVersion)&&l(i.appVersion)}).catch(()=>{}),()=>{o=!0}},[]),s.jsxs("aside",{className:"hidden w-60 shrink-0 border-r bg-sidebar text-sidebar-foreground md:flex md:flex-col",children:[s.jsxs("div",{className:"flex h-14 items-center gap-2 border-b px-4",children:[s.jsx("img",{src:"/logo.png",alt:"LateDev Router",className:"h-7 w-7 object-contain"}),s.jsx("div",{className:"font-semibold tracking-tight",children:"LateDev Router"})]}),s.jsx("nav",{className:"flex-1 space-y-0.5 p-2",children:sE.map(o=>s.jsxs(Vy,{to:o.to,end:o.end,className:({isActive:i})=>Ee("flex items-center gap-2 rounded-md px-3 py-2 text-sm transition-colors",i?"bg-primary/10 text-primary font-medium":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:[s.jsx(o.icon,{className:"h-4 w-4"}),o.label]},o.to))}),s.jsxs("div",{className:"border-t p-3 text-xs text-muted-foreground flex items-center gap-2",children:[s.jsx(yC,{className:"h-3.5 w-3.5 text-primary"})," ",n?`v${n}`:"v…"]})]})}var iE=Object.defineProperty,Dh=(n,l)=>iE(n,"name",{value:l,configurable:!0});function Yf(n,l){if(typeof n=="function")return n(l);n!=null&&(n.current=l)}Dh(Yf,"setRef");function ib(...n){return l=>{let o=!1;const i=n.map(u=>{const d=Yf(u,l);return!o&&typeof d=="function"&&(o=!0),d});if(o)return()=>{for(let u=0;u<i.length;u++){const d=i[u];typeof d=="function"?d():Yf(n[u],null)}}}}Dh(ib,"composeRefs");function Ge(...n){return m.useCallback(ib(...n),n)}Dh(Ge,"useComposedRefs");var cE=Object.defineProperty,ca=(n,l)=>cE(n,"name",{value:l,configurable:!0});function Sa(n){const l=m.forwardRef((o,i)=>{let{children:u,...d}=o,h=null,p=!1;const g=[];$f(u)&&typeof ac=="function"&&(u=ac(u._payload)),m.Children.forEach(u,S=>{var w;if(hb(S)){p=!0;const C=S;let E="child"in C.props?C.props.child:C.props.children;$f(E)&&typeof ac=="function"&&(E=ac(E._payload)),h=dE(C,E),g.push((w=h==null?void 0:h.props)==null?void 0:w.children)}else g.push(S)}),h?h=m.cloneElement(h,void 0,g):!p&&m.Children.count(u)===1&&m.isValidElement(u)&&(h=u);const v=h?fb(h):void 0,x=Ge(i,v);if(!h){if(u||u===0)throw new Error(p?mE(n):hE(n));return u}const y=db(d,h.props??{});return h.type!==m.Fragment&&(y.ref=i?x:v),m.cloneElement(h,y)});return l.displayName=`${n}.Slot`,l}ca(Sa,"createSlot");var uE=Sa("Slot"),cb=Symbol.for("radix.slottable");function ub(n){const l=ca(o=>"child"in o?o.children(o.child):o.children,"Slottable");return l.displayName=`${n}.Slottable`,l.__radixId=cb,l}ca(ub,"createSlottable");var dE=ca((n,l)=>{if("child"in n.props){const o=n.props.child;return m.isValidElement(o)?m.cloneElement(o,void 0,n.props.children(o.props.children)):null}return m.isValidElement(l)?l:null},"getSlottableElementFromSlottable");function db(n,l){const o={...l};for(const i in l){const u=n[i],d=l[i];/^on[A-Z]/.test(i)?u&&d?o[i]=(...p)=>{const g=d(...p);return u(...p),g}:u&&(o[i]=u):i==="style"?o[i]={...u,...d}:i==="className"&&(o[i]=[u,d].filter(Boolean).join(" "))}return{...n,...o}}ca(db,"mergeProps");function fb(n){var i,u;let l=(i=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:i.get,o=l&&"isReactWarning"in l&&l.isReactWarning;return o?n.ref:(l=(u=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:u.get,o=l&&"isReactWarning"in l&&l.isReactWarning,o?n.props.ref:n.props.ref||n.ref)}ca(fb,"getElementRef");function hb(n){return m.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===cb}ca(hb,"isSlottable");var fE=Symbol.for("react.lazy");function $f(n){return n!=null&&typeof n=="object"&&"$$typeof"in n&&n.$$typeof===fE&&"_payload"in n&&mb(n._payload)}ca($f,"isLazyComponent");function mb(n){return typeof n=="object"&&n!==null&&"then"in n}ca(mb,"isPromiseLike");var hE=ca(n=>`${n} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),mE=ca(n=>`${n} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),ac=vs[" use ".trim().toString()];const qx=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,Ix=nb,pb=(n,l)=>o=>{var i;if((l==null?void 0:l.variants)==null)return Ix(n,o==null?void 0:o.class,o==null?void 0:o.className);const{variants:u,defaultVariants:d}=l,h=Object.keys(u).map(v=>{const x=o==null?void 0:o[v],y=d==null?void 0:d[v];if(x===null)return null;const S=qx(x)||qx(y);return u[v][S]}),p=o&&Object.entries(o).reduce((v,x)=>{let[y,S]=x;return S===void 0||(v[y]=S),v},{}),g=l==null||(i=l.compoundVariants)===null||i===void 0?void 0:i.reduce((v,x)=>{let{class:y,className:S,...w}=x;return Object.entries(w).every(C=>{let[E,j]=C;return Array.isArray(j)?j.includes({...d,...p}[E]):{...d,...p}[E]===j})?[...v,y,S]:v},[]);return Ix(n,h,g,o==null?void 0:o.class,o==null?void 0:o.className)},pE=pb("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-6",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),de=m.forwardRef(({className:n,variant:l,size:o,asChild:i=!1,...u},d)=>{const h=i?uE:"button";return s.jsx(h,{className:Ee(pE({variant:l,size:o,className:n})),ref:d,...u})});de.displayName="Button";const gb=m.createContext(void 0);function gE({children:n,defaultTheme:l="system",storageKey:o="latedev-theme"}){const[i,u]=m.useState(()=>localStorage.getItem(o)||l);m.useEffect(()=>{const h=window.document.documentElement;if(h.classList.remove("light","dark"),i==="system"){const p=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";h.classList.add(p);return}h.classList.add(i)},[i]);const d={theme:i,setTheme:h=>{localStorage.setItem(o,h),u(h)}};return s.jsx(gb.Provider,{value:d,children:n})}function vE(){const n=m.useContext(gb);if(!n)throw new Error("useTheme must be used within ThemeProvider");return n}var xE=Object.defineProperty,js=(n,l)=>xE(n,"name",{value:l,configurable:!0}),vb=!!(typeof window<"u"&&window.document&&window.document.createElement);function je(n,l,{checkForDefaultPrevented:o=!0}={}){return js(function(u){if(n==null||n(u),o===!1||!u||!u.defaultPrevented)return l==null?void 0:l(u)},"handleEvent")}js(je,"composeEventHandlers");function yE(n){var l;if(!vb)throw new Error("Cannot access window outside of the DOM");return((l=n==null?void 0:n.ownerDocument)==null?void 0:l.defaultView)??window}js(yE,"getOwnerWindow");function Kf(n){if(!vb)throw new Error("Cannot access document outside of the DOM");return(n==null?void 0:n.ownerDocument)??document}js(Kf,"getOwnerDocument");function xb(n,l=!1){const{activeElement:o}=Kf(n);if(!(o!=null&&o.nodeName))return null;if(yb(o)&&o.contentDocument)return xb(o.contentDocument.body,l);if(l){const i=o.getAttribute("aria-activedescendant");if(i){const u=Kf(o).getElementById(i);if(u)return u}}return o}js(xb,"getActiveElement");function yb(n){return n.tagName==="IFRAME"}js(yb,"isFrame");var bE=Object.defineProperty,$n=(n,l)=>bE(n,"name",{value:l,configurable:!0});function SE(n,l){const o=m.createContext(l);o.displayName=n+"Context";const i=$n(d=>{const{children:h,...p}=d,g=m.useMemo(()=>p,Object.values(p));return s.jsx(o.Provider,{value:g,children:h})},"Provider");i.displayName=n+"Provider";function u(d,h={}){const{optional:p=!1}=h,g=m.useContext(o);if(g)return g;if(l!==void 0)return l;if(!p)throw new Error(`\`${d}\` must be used within \`${n}\``)}return $n(u,"useContext"),[i,u]}$n(SE,"createContext");function yn(n,l=[]){let o=[];function i(d,h){const p=m.createContext(h);p.displayName=d+"Context";const g=o.length;o=[...o,h];const v=$n(y=>{var R;const{scope:S,children:w,...C}=y,E=((R=S==null?void 0:S[n])==null?void 0:R[g])||p,j=m.useMemo(()=>C,Object.values(C));return s.jsx(E.Provider,{value:j,children:w})},"Provider");v.displayName=d+"Provider";function x(y,S,w={}){var R;const{optional:C=!1}=w,E=((R=S==null?void 0:S[n])==null?void 0:R[g])||p,j=m.useContext(E);if(j)return j;if(h!==void 0)return h;if(!C)throw new Error(`\`${y}\` must be used within \`${d}\``)}return $n(x,"useContext"),[v,x]}$n(i,"createContext");const u=$n(()=>{const d=o.map(h=>m.createContext(h));return $n(function(p){const g=(p==null?void 0:p[n])||d;return m.useMemo(()=>({[`__scope${n}`]:{...p,[n]:g}}),[p,g])},"useScope")},"createScope");return u.scopeName=n,[i,bb(u,...l)]}$n(yn,"createContextScope");function bb(...n){const l=n[0];if(n.length===1)return l;const o=$n(()=>{const i=n.map(u=>({useScope:u(),scopeName:u.scopeName}));return $n(function(d){const h=i.reduce((p,{useScope:g,scopeName:v})=>{const y=g(d)[`__scope${v}`];return{...p,...y}},{});return m.useMemo(()=>({[`__scope${l.scopeName}`]:h}),[h])},"useComposedScopes")},"createScope");return o.scopeName=l.scopeName,o}$n(bb,"composeContextScopes");var kt=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},wE=Object.defineProperty,jE=(n,l)=>wE(n,"name",{value:l,configurable:!0}),Vx=vs[" useEffectEvent ".trim().toString()],Gx=vs[" useInsertionEffect ".trim().toString()];function Sb(n){if(typeof Vx=="function")return Vx(n);const l=m.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Gx=="function"?Gx(()=>{l.current=n}):kt(()=>{l.current=n}),m.useMemo(()=>((...o)=>{var i;return(i=l.current)==null?void 0:i.call(l,...o)}),[])}jE(Sb,"useEffectEvent");var CE=Object.defineProperty,Lo=(n,l)=>CE(n,"name",{value:l,configurable:!0}),EE=vs[" useInsertionEffect ".trim().toString()]||kt;function el({prop:n,defaultProp:l,onChange:o=Lo(()=>{},"onChange"),caller:i}){const[u,d,h]=wb({defaultProp:l,onChange:o}),p=n!==void 0,g=p?n:u,v=m.useCallback(x=>{var y;if(p){const S=jb(x)?x(n):x;S!==n&&((y=h.current)==null||y.call(h,S))}else d(x)},[p,n,d,h]);return[g,v]}Lo(el,"useControllableState");function wb({defaultProp:n,onChange:l}){const[o,i]=m.useState(n),u=m.useRef(o),d=m.useRef(l);return EE(()=>{d.current=l},[l]),m.useEffect(()=>{var h;u.current!==o&&((h=d.current)==null||h.call(d,o),u.current=o)},[o,u]),[o,i,d]}Lo(wb,"useUncontrolledState");function jb(n){return typeof n=="function"}Lo(jb,"isFunction");var Yx=Symbol("RADIX:SYNC_STATE");function NE(n,l,o,i){const{prop:u,defaultProp:d,onChange:h,caller:p}=l,g=u!==void 0,v=Sb(h),x=[{...o,state:d}];i&&x.push(i);const[y,S]=m.useReducer((j,R)=>{if(R.type===Yx)return{...j,state:R.state};const A=n(j,R);return g&&!Object.is(A.state,j.state)&&v(A.state),A},...x),w=y.state,C=m.useRef(w);m.useEffect(()=>{C.current!==w&&(C.current=w,g||v(w))},[w,C,g]);const E=m.useMemo(()=>u!==void 0?{...y,state:u}:y,[y,u]);return m.useEffect(()=>{g&&!Object.is(u,y.state)&&S({type:Yx,state:u})},[u,y.state,g]),[E,S]}Lo(NE,"useControllableStateReducer");var RE=Object.defineProperty,TE=(n,l)=>RE(n,"name",{value:l,configurable:!0}),AE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Pe=AE.reduce((n,l)=>{const o=Sa(`Primitive.${l}`),i=m.forwardRef((u,d)=>{const{asChild:h,...p}=u,g=h?o:l;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(g,{...p,ref:d})});return i.displayName=`Primitive.${l}`,{...n,[l]:i}},{});function _h(n,l){n&&Ss.flushSync(()=>n.dispatchEvent(l))}TE(_h,"dispatchDiscreteCustomEvent");var ME=Object.defineProperty,Bt=(n,l)=>ME(n,"name",{value:l,configurable:!0});function Uc(n){const l=n+"CollectionProvider",[o,i]=yn(l),[u,d]=o(l,{collectionRef:{current:null},itemMap:new Map}),h=Bt(E=>{const{scope:j,children:R}=E,A=m.useRef(null),T=m.useRef(new Map).current;return s.jsx(u,{scope:j,itemMap:T,collectionRef:A,children:R})},"CollectionProvider");h.displayName=l;const p=n+"CollectionSlot",g=Sa(p),v=m.forwardRef((E,j)=>{const{scope:R,children:A}=E,T=d(p,R),D=Ge(j,T.collectionRef);return s.jsx(g,{ref:D,children:A})});v.displayName=p;const x=n+"CollectionItemSlot",y="data-radix-collection-item",S=Sa(x),w=m.forwardRef((E,j)=>{const{scope:R,children:A,...T}=E,D=m.useRef(null),O=Ge(j,D),M=d(x,R);return m.useEffect(()=>(M.itemMap.set(D,{ref:D,...T}),()=>void M.itemMap.delete(D))),s.jsx(S,{[y]:"",ref:O,children:A})});w.displayName=x;function C(E){const j=d(n+"CollectionConsumer",E);return m.useCallback(()=>{const A=j.collectionRef.current;if(!A)return[];const T=Array.from(A.querySelectorAll(`[${y}]`));return Array.from(j.itemMap.values()).sort((M,B)=>T.indexOf(M.ref.current)-T.indexOf(B.ref.current))},[j.collectionRef,j.itemMap])}return Bt(C,"useCollection"),[{Provider:h,Slot:v,ItemSlot:w},C,i]}Bt(Uc,"createCollection");var $x=new WeakMap,Dt,An,Rf=(An=class extends Map{constructor(o){super(o);Sx(this,Dt);pf(this,Dt,[...super.keys()]),$x.set(this,!0)}set(o,i){return $x.get(this)&&(this.has(o)?Kt(this,Dt)[Kt(this,Dt).indexOf(o)]=o:Kt(this,Dt).push(o)),super.set(o,i),this}insert(o,i,u){const d=this.has(i),h=Kt(this,Dt).length,p=Oh(o);let g=p>=0?p:h+p;const v=g<0||g>=h?-1:g;if(v===this.size||d&&v===this.size-1||v===-1)return this.set(i,u),this;const x=this.size+(d?0:1);p<0&&g++;const y=[...Kt(this,Dt)];let S,w=!1;for(let C=g;C<x;C++)if(g===C){let E=y[C];y[C]===i&&(E=y[C+1]),d&&this.delete(i),S=this.get(E),this.set(i,u)}else{!w&&y[C-1]===i&&(w=!0);const E=y[w?C:C-1],j=S;S=this.get(E),this.delete(E),this.set(E,j)}return this}with(o,i,u){const d=new An(this);return d.insert(o,i,u),d}before(o){const i=Kt(this,Dt).indexOf(o)-1;if(!(i<0))return this.entryAt(i)}setBefore(o,i,u){const d=Kt(this,Dt).indexOf(o);return d===-1?this:this.insert(d,i,u)}after(o){let i=Kt(this,Dt).indexOf(o);if(i=i===-1||i===this.size-1?-1:i+1,i!==-1)return this.entryAt(i)}setAfter(o,i,u){const d=Kt(this,Dt).indexOf(o);return d===-1?this:this.insert(d+1,i,u)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return pf(this,Dt,[]),super.clear()}delete(o){const i=super.delete(o);return i&&Kt(this,Dt).splice(Kt(this,Dt).indexOf(o),1),i}deleteAt(o){const i=this.keyAt(o);return i!==void 0?this.delete(i):!1}at(o){const i=xc(Kt(this,Dt),o);if(i!==void 0)return this.get(i)}entryAt(o){const i=xc(Kt(this,Dt),o);if(i!==void 0)return[i,this.get(i)]}indexOf(o){return Kt(this,Dt).indexOf(o)}keyAt(o){return xc(Kt(this,Dt),o)}from(o,i){const u=this.indexOf(o);if(u===-1)return;let d=u+i;return d<0&&(d=0),d>=this.size&&(d=this.size-1),this.at(d)}keyFrom(o,i){const u=this.indexOf(o);if(u===-1)return;let d=u+i;return d<0&&(d=0),d>=this.size&&(d=this.size-1),this.keyAt(d)}find(o,i){let u=0;for(const d of this){if(Reflect.apply(o,i,[d,u,this]))return d;u++}}findIndex(o,i){let u=0;for(const d of this){if(Reflect.apply(o,i,[d,u,this]))return u;u++}return-1}filter(o,i){const u=[];let d=0;for(const h of this)Reflect.apply(o,i,[h,d,this])&&u.push(h),d++;return new An(u)}map(o,i){const u=[];let d=0;for(const h of this)u.push([h[0],Reflect.apply(o,i,[h,d,this])]),d++;return new An(u)}reduce(...o){const[i,u]=o;let d=0,h=u??this.at(0);for(const p of this)d===0&&o.length===1?h=p:h=Reflect.apply(i,this,[h,p,d,this]),d++;return h}reduceRight(...o){const[i,u]=o;let d=u??this.at(-1);for(let h=this.size-1;h>=0;h--){const p=this.at(h);h===this.size-1&&o.length===1?d=p:d=Reflect.apply(i,this,[d,p,h,this])}return d}toSorted(o){const i=[...this.entries()].sort(o);return new An(i)}toReversed(){const o=new An;for(let i=this.size-1;i>=0;i--){const u=this.keyAt(i),d=this.get(u);o.set(u,d)}return o}toSpliced(...o){const i=[...this.entries()];return i.splice(...o),new An(i)}slice(o,i){const u=new An;let d=this.size-1;if(o===void 0)return u;o<0&&(o=o+this.size),i!==void 0&&i>0&&(d=i-1);for(let h=o;h<=d;h++){const p=this.keyAt(h),g=this.get(p);u.set(p,g)}return u}every(o,i){let u=0;for(const d of this){if(!Reflect.apply(o,i,[d,u,this]))return!1;u++}return!0}some(o,i){let u=0;for(const d of this){if(Reflect.apply(o,i,[d,u,this]))return!0;u++}return!1}},Dt=new WeakMap,Bt(An,"OrderedDict"),An);function xc(n,l){if("at"in Array.prototype)return Array.prototype.at.call(n,l);const o=Cb(n,l);return o===-1?void 0:n[o]}Bt(xc,"at");function Cb(n,l){const o=n.length,i=Oh(l),u=i>=0?i:o+i;return u<0||u>=o?-1:u}Bt(Cb,"toSafeIndex");function Oh(n){return n!==n||n===0?0:Math.trunc(n)}Bt(Oh,"toSafeInteger");function DE(n){const l=n+"CollectionProvider",[o,i]=yn(l),[u,d]=o(l,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Rf,setItemMap:Bt(()=>{},"setItemMap")}),h=Bt(({state:T,...D})=>T?s.jsx(g,{...D,state:T}):s.jsx(p,{...D}),"CollectionProvider");h.displayName=l;const p=Bt(T=>{const D=j();return s.jsx(g,{...T,state:D})},"CollectionInit");p.displayName=l+"Init";const g=Bt(T=>{const{scope:D,children:O,state:M}=T,B=m.useRef(null),[z,K]=m.useState(null),oe=Ge(B,K),[X,q]=M;return m.useEffect(()=>{if(!z)return;const le=Rb(()=>{});return le.observe(z,{childList:!0,subtree:!0}),()=>{le.disconnect()}},[z]),s.jsx(u,{scope:D,itemMap:X,setItemMap:q,collectionRef:oe,collectionRefObject:B,collectionElement:z,children:O})},"CollectionProviderImpl");g.displayName=l+"Impl";const v=n+"CollectionSlot",x=Sa(v),y=m.forwardRef((T,D)=>{const{scope:O,children:M}=T,B=d(v,O),z=Ge(D,B.collectionRef);return s.jsx(x,{ref:z,children:M})});y.displayName=v;const S=n+"CollectionItemSlot",w="data-radix-collection-item",C=Sa(S),E=m.forwardRef((T,D)=>{const{scope:O,children:M,...B}=T,z=m.useRef(null),[K,oe]=m.useState(null),X=Ge(D,z,oe),q=d(S,O),{setItemMap:le}=q,J=m.useRef(B);Eb(J.current,B)||(J.current=B);const ce=J.current;return m.useEffect(()=>{const U=ce;return le(Y=>K?Y.has(K)?Y.set(K,{...U,element:K}).toSorted(Xf):(Y.set(K,{...U,element:K}),Y.toSorted(Xf)):Y),()=>{le(Y=>!K||!Y.has(K)?Y:(Y.delete(K),new Rf(Y)))}},[K,ce,le]),s.jsx(C,{[w]:"",ref:X,children:M})});E.displayName=S;function j(){return m.useState(new Rf)}Bt(j,"useInitCollection");function R(T){const{itemMap:D}=d(n+"CollectionConsumer",T);return D}return Bt(R,"useCollection"),[{Provider:h,Slot:y,ItemSlot:E},{createCollectionScope:i,useCollection:R,useInitCollection:j}]}Bt(DE,"createCollection");function Eb(n,l){if(n===l)return!0;if(typeof n!="object"||typeof l!="object"||n==null||l==null)return!1;const o=Object.keys(n),i=Object.keys(l);if(o.length!==i.length)return!1;for(const u of o)if(!Object.prototype.hasOwnProperty.call(l,u)||n[u]!==l[u])return!1;return!0}Bt(Eb,"shallowEqual");function Nb(n,l){return!!(l.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING)}Bt(Nb,"isElementPreceding");function Xf(n,l){return!n[1].element||!l[1].element?0:Nb(n[1].element,l[1].element)?-1:1}Bt(Xf,"sortByDocumentPosition");function Rb(n){return new MutationObserver(o=>{for(const i of o)if(i.type==="childList"){n();return}})}Bt(Rb,"getChildListObserver");var _E=Object.defineProperty,OE=(n,l)=>_E(n,"name",{value:l,configurable:!0}),kE=m.createContext(void 0);function Uo(n){const l=m.useContext(kE);return n||l||"ltr"}OE(Uo,"useDirection");var zE=Object.defineProperty,LE=(n,l)=>zE(n,"name",{value:l,configurable:!0});function Qn(n){const l=m.useRef(n);return m.useEffect(()=>{l.current=n}),m.useMemo(()=>((...o)=>{var i;return(i=l.current)==null?void 0:i.call(l,...o)}),[])}LE(Qn,"useCallbackRef");var UE=Object.defineProperty,Ut=(n,l)=>UE(n,"name",{value:l,configurable:!0}),Ff="dismissableLayer.update",BE="dismissableLayer.pointerDownOutside",HE="dismissableLayer.focusOutside",Kx,Tb=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Bc=m.forwardRef(Ut(function(l,o){const{disableOutsidePointerEvents:i=!1,deferPointerDownOutside:u=!1,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:g,onDismiss:v,...x}=l,y=m.useContext(Tb),[S,w]=m.useState(null),C=(S==null?void 0:S.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,E]=m.useState({}),j=Ge(o,w),R=Array.from(y.layers),[A]=[...y.layersWithOutsidePointerEventsDisabled].slice(-1),T=A?R.indexOf(A):-1,D=S?R.indexOf(S):-1,O=y.layersWithOutsidePointerEventsDisabled.size>0,M=D>=T,B=m.useRef(!1),z=Mb(q=>{h==null||h(q),g==null||g(q),q.defaultPrevented||v==null||v()},{ownerDocument:C,deferPointerDownOutside:u,isDeferredPointerDownOutsideRef:B,dismissableSurfaces:y.dismissableSurfaces,shouldHandlePointerDownOutside:m.useCallback(q=>{if(!(q instanceof Node))return!1;const le=[...y.branches].some(J=>J.contains(q));return M&&!le},[y.branches,M])}),K=Db(q=>{if(u&&B.current)return;const le=q.target;[...y.branches].some(ce=>ce.contains(le))||(p==null||p(q),g==null||g(q),q.defaultPrevented||v==null||v())},C),oe=S?D===R.length-1:!1,X=Qn(q=>{q.key==="Escape"&&(d==null||d(q),!q.defaultPrevented&&v&&(q.preventDefault(),v()))});return m.useEffect(()=>{if(oe)return C.addEventListener("keydown",X,{capture:!0}),()=>C.removeEventListener("keydown",X,{capture:!0})},[C,oe,X]),m.useEffect(()=>{if(S)return i&&(y.layersWithOutsidePointerEventsDisabled.size===0&&(Kx=C.body.style.pointerEvents,C.body.style.pointerEvents="none"),y.layersWithOutsidePointerEventsDisabled.add(S)),y.layers.add(S),Qf(),()=>{i&&(y.layersWithOutsidePointerEventsDisabled.delete(S),y.layersWithOutsidePointerEventsDisabled.size===0&&(C.body.style.pointerEvents=Kx))}},[S,C,i,y]),m.useEffect(()=>()=>{S&&(y.layers.delete(S),y.layersWithOutsidePointerEventsDisabled.delete(S),Qf())},[S,y]),m.useEffect(()=>{const q=Ut(()=>E({}),"handleUpdate");return document.addEventListener(Ff,q),()=>document.removeEventListener(Ff,q)},[]),s.jsx(Pe.div,{...x,ref:j,style:{pointerEvents:O?M?"auto":"none":void 0,...l.style},onFocusCapture:je(l.onFocusCapture,K.onFocusCapture),onBlurCapture:je(l.onBlurCapture,K.onBlurCapture),onPointerDownCapture:je(l.onPointerDownCapture,z.onPointerDownCapture)})},"DismissableLayer"));function Ab(){const n=m.useContext(Tb),[l,o]=m.useState(null);return m.useEffect(()=>{if(l)return n.dismissableSurfaces.add(l),()=>{n.dismissableSurfaces.delete(l)}},[l,n.dismissableSurfaces]),o}Ut(Ab,"useDismissableLayerSurface");var PE=Ut(()=>!0,"IS_TRUE");function Mb(n,l){const{ownerDocument:o=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:u,dismissableSurfaces:d,shouldHandlePointerDownOutside:h=PE}=l,p=Qn(n),g=m.useRef(!1),v=m.useRef(!1),x=m.useRef(new Map),y=m.useRef(()=>{});return m.useEffect(()=>{function S(){v.current=!1,u.current=!1,x.current.clear()}Ut(S,"resetOutsideInteraction");function w(){return Array.from(x.current.values()).some(Boolean)}Ut(w,"isOutsideInteractionIntercepted");function C(T){if(!v.current)return;const D=T.target;D instanceof Node&&[...d].some(M=>M.contains(D))||x.current.set(T.type,!0),T.type==="click"&&window.setTimeout(()=>{v.current&&y.current()},0)}Ut(C,"handleInteractionCapture");function E(T){v.current&&x.current.set(T.type,!1)}Ut(E,"handleInteractionBubble");const j=Ut(T=>{if(T.target&&!g.current){let D=function(){o.removeEventListener("click",y.current);const M=w();S(),M||kh(BE,p,O,{discrete:!0})};if(Ut(D,"handleAndDispatchPointerDownOutsideEvent"),!h(T.target)){o.removeEventListener("click",y.current),S(),g.current=!1;return}const O={originalEvent:T};v.current=!0,u.current=i&&T.button===0,x.current.clear(),!i||T.button!==0?D():(o.removeEventListener("click",y.current),y.current=D,o.addEventListener("click",y.current,{once:!0}))}else o.removeEventListener("click",y.current),S();g.current=!1},"handlePointerDown"),R=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const T of R)o.addEventListener(T,C,!0),o.addEventListener(T,E);const A=window.setTimeout(()=>{o.addEventListener("pointerdown",j)},0);return()=>{window.clearTimeout(A),o.removeEventListener("pointerdown",j),o.removeEventListener("click",y.current);for(const T of R)o.removeEventListener(T,C,!0),o.removeEventListener(T,E)}},[o,p,i,u,d,h]),{onPointerDownCapture:Ut(()=>g.current=!0,"onPointerDownCapture")}}Ut(Mb,"usePointerDownOutside");function Db(n,l=globalThis==null?void 0:globalThis.document){const o=Qn(n),i=m.useRef(!1);return m.useEffect(()=>{const u=Ut(d=>{d.target&&!i.current&&kh(HE,o,{originalEvent:d},{discrete:!1})},"handleFocus");return l.addEventListener("focusin",u),()=>l.removeEventListener("focusin",u)},[l,o]),{onFocusCapture:Ut(()=>i.current=!0,"onFocusCapture"),onBlurCapture:Ut(()=>i.current=!1,"onBlurCapture")}}Ut(Db,"useFocusOutside");function Qf(){const n=new CustomEvent(Ff);document.dispatchEvent(n)}Ut(Qf,"dispatchUpdate");function kh(n,l,o,{discrete:i}){const u=o.originalEvent.target,d=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:o});l&&u.addEventListener(n,l,{once:!0}),i?_h(u,d):u.dispatchEvent(d)}Ut(kh,"handleAndDispatchCustomEvent");var qE=Object.defineProperty,zh=(n,l)=>qE(n,"name",{value:l,configurable:!0}),lc=0,va=null;function IE(n){return Bo(),n.children}zh(IE,"FocusGuards");function Bo(){m.useEffect(()=>{va||(va={start:Zf(),end:Zf()});const{start:n,end:l}=va;return document.body.firstElementChild!==n&&document.body.insertAdjacentElement("afterbegin",n),document.body.lastElementChild!==l&&document.body.insertAdjacentElement("beforeend",l),lc++,()=>{lc===1&&(va==null||va.start.remove(),va==null||va.end.remove(),va=null),lc=Math.max(0,lc-1)}},[])}zh(Bo,"useFocusGuards");function Zf(){const n=document.createElement("span");return n.setAttribute("data-radix-focus-guard",""),n.tabIndex=0,n.style.outline="none",n.style.opacity="0",n.style.position="fixed",n.style.pointerEvents="none",n}zh(Zf,"createFocusGuard");var VE=Object.defineProperty,en=(n,l)=>VE(n,"name",{value:l,configurable:!0}),Tf="focusScope.autoFocusOnMount",Af="focusScope.autoFocusOnUnmount",Xx={bubbles:!1,cancelable:!0},Lh=m.forwardRef(en(function(l,o){const{loop:i=!1,trapped:u=!1,onMountAutoFocus:d,onUnmountAutoFocus:h,...p}=l,[g,v]=m.useState(null),x=Qn(d),y=Qn(h),S=m.useRef(null),w=Ge(o,v),C=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(u){let j=function(D){if(C.paused||!g)return;const O=D.target;g.contains(O)?S.current=O:Xa(S.current,{select:!0})},R=function(D){if(C.paused||!g)return;const O=D.relatedTarget;O!==null&&(g.contains(O)||Xa(S.current,{select:!0}))},A=function(D){if(document.activeElement===document.body)for(const M of D)M.removedNodes.length>0&&Xa(g)};en(j,"handleFocusIn"),en(R,"handleFocusOut"),en(A,"handleMutations"),document.addEventListener("focusin",j),document.addEventListener("focusout",R);const T=new MutationObserver(A);return g&&T.observe(g,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",R),T.disconnect()}}},[u,g,C.paused]),m.useEffect(()=>{if(g){Fx.add(C);const j=document.activeElement;if(!g.contains(j)){const A=new CustomEvent(Tf,Xx);g.addEventListener(Tf,x),g.dispatchEvent(A),A.defaultPrevented||(_b(Ub(Uh(g)),{select:!0}),document.activeElement===j&&Xa(g))}return()=>{g.removeEventListener(Tf,x),setTimeout(()=>{const A=new CustomEvent(Af,Xx);g.addEventListener(Af,y),g.dispatchEvent(A),A.defaultPrevented||Xa(j??document.body,{select:!0}),g.removeEventListener(Af,y),Fx.remove(C)},0)}}},[g,x,y,C]);const E=m.useCallback(j=>{if(!i&&!u||C.paused)return;const R=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,A=document.activeElement;if(R&&A){const T=j.currentTarget,[D,O]=Ob(T);D&&O?!j.shiftKey&&A===O?(j.preventDefault(),i&&Xa(D,{select:!0})):j.shiftKey&&A===D&&(j.preventDefault(),i&&Xa(O,{select:!0})):A===T&&j.preventDefault()}},[i,u,C.paused]);return s.jsx(Pe.div,{tabIndex:-1,...p,ref:w,onKeyDown:E})},"FocusScope"));function _b(n,{select:l=!1}={}){const o=document.activeElement;for(const i of n)if(Xa(i,{select:l}),document.activeElement!==o)return}en(_b,"focusFirst");function Ob(n){const l=Uh(n),o=Jf(l,n),i=Jf(l.reverse(),n);return[o,i]}en(Ob,"getTabbableEdges");function Uh(n){const l=[],o=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:en(i=>{const u=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||u?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;o.nextNode();)l.push(o.currentNode);return l}en(Uh,"getTabbableCandidates");function Jf(n,l){const o=typeof l.checkVisibility=="function"&&l.checkVisibility({checkVisibilityCSS:!0});for(const i of n)if(!(o?!i.checkVisibility({checkVisibilityCSS:!0}):kb(i,{upTo:l})))return i}en(Jf,"findVisible");function kb(n,{upTo:l}){if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(l!==void 0&&n===l)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1}en(kb,"isHidden");function zb(n){return n instanceof HTMLInputElement&&"select"in n}en(zb,"isSelectableInput");function Xa(n,{select:l=!1}={}){if(n&&n.focus){const o=document.activeElement;n.focus({preventScroll:!0}),n!==o&&zb(n)&&l&&n.select()}}en(Xa,"focus");var Fx=Lb();function Lb(){let n=[];return{add(l){const o=n[0];l!==o&&(o==null||o.pause()),n=Wf(n,l),n.unshift(l)},remove(l){var o;n=Wf(n,l),(o=n[0])==null||o.resume()}}}en(Lb,"createFocusScopesStack");function Wf(n,l){const o=[...n],i=o.indexOf(l);return i!==-1&&o.splice(i,1),o}en(Wf,"arrayRemove");function Ub(n){return n.filter(l=>l.tagName!=="A")}en(Ub,"removeLinks");var GE=Object.defineProperty,YE=(n,l)=>GE(n,"name",{value:l,configurable:!0}),$E=vs[" useId ".trim().toString()]||(()=>{}),KE=0;function ba(n){const[l,o]=m.useState($E());return kt(()=>{n||o(i=>i??String(KE++))},[n]),n||(l?`radix-${l}`:"")}YE(ba,"useId");const XE=["top","right","bottom","left"],Pl=Math.min,Qa=Math.max,Cc=Math.round,rc=Math.floor,Za=n=>({x:n,y:n}),FE={left:"right",right:"left",bottom:"top",top:"bottom"};function Bb(n,l,o){return Qa(n,Pl(l,o))}function tl(n,l){return typeof n=="function"?n(l):n}function ql(n){return n.split("-")[0]}function Cs(n){return n.split("-")[1]}function Bh(n){return n==="x"?"y":"x"}function Hh(n){return n==="y"?"height":"width"}function ya(n){const l=n[0];return l==="t"||l==="b"?"y":"x"}function Ph(n){return Bh(ya(n))}function QE(n,l,o){o===void 0&&(o=!1);const i=Cs(n),u=Ph(n),d=Hh(u);let h=u==="x"?i===(o?"end":"start")?"right":"left":i==="start"?"bottom":"top";return l.reference[d]>l.floating[d]&&(h=Ec(h)),[h,Ec(h)]}function ZE(n){const l=Ec(n);return[eh(n),l,eh(l)]}function eh(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}const Qx=["left","right"],Zx=["right","left"],JE=["top","bottom"],WE=["bottom","top"];function eN(n,l,o){switch(n){case"top":case"bottom":return o?l?Zx:Qx:l?Qx:Zx;case"left":case"right":return l?JE:WE;default:return[]}}function tN(n,l,o,i){const u=Cs(n);let d=eN(ql(n),o==="start",i);return u&&(d=d.map(h=>h+"-"+u),l&&(d=d.concat(d.map(eh)))),d}function Ec(n){const l=ql(n);return FE[l]+n.slice(l.length)}function nN(n){var l,o,i,u;return{top:(l=n.top)!=null?l:0,right:(o=n.right)!=null?o:0,bottom:(i=n.bottom)!=null?i:0,left:(u=n.left)!=null?u:0}}function Hb(n){return typeof n!="number"?nN(n):{top:n,right:n,bottom:n,left:n}}function Nc(n){const{x:l,y:o,width:i,height:u}=n;return{width:i,height:u,top:o,left:l,right:l+i,bottom:o+u,x:l,y:o}}function Jx(n,l,o){let{reference:i,floating:u}=n;const d=ya(l),h=Ph(l),p=Hh(h),g=ql(l),v=d==="y",x=i.x+i.width/2-u.width/2,y=i.y+i.height/2-u.height/2,S=i[p]/2-u[p]/2;let w;switch(g){case"top":w={x,y:i.y-u.height};break;case"bottom":w={x,y:i.y+i.height};break;case"right":w={x:i.x+i.width,y};break;case"left":w={x:i.x-u.width,y};break;default:w={x:i.x,y:i.y}}const C=Cs(l);return C&&(w[h]+=S*(C==="end"?1:-1)*(o&&v?-1:1)),w}async function aN(n,l){var o;l===void 0&&(l={});const{x:i,y:u,platform:d,rects:h,elements:p,strategy:g}=n,{boundary:v="clippingAncestors",rootBoundary:x="viewport",elementContext:y="floating",altBoundary:S=!1,padding:w=0}=tl(l,n),C=Hb(w),j=p[S?y==="floating"?"reference":"floating":y],R=Nc(await d.getClippingRect({element:(o=await(d.isElement==null?void 0:d.isElement(j)))==null||o?j:j.contextElement||await(d.getDocumentElement==null?void 0:d.getDocumentElement(p.floating)),boundary:v,rootBoundary:x,strategy:g})),A=y==="floating"?{x:i,y:u,width:h.floating.width,height:h.floating.height}:h.reference,T=await(d.getOffsetParent==null?void 0:d.getOffsetParent(p.floating)),D=await(d.isElement==null?void 0:d.isElement(T))&&await(d.getScale==null?void 0:d.getScale(T))||{x:1,y:1},O=Nc(d.convertOffsetParentRelativeRectToViewportRelativeRect?await d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:A,offsetParent:T,strategy:g}):A);return{top:(R.top-O.top+C.top)/D.y,bottom:(O.bottom-R.bottom+C.bottom)/D.y,left:(R.left-O.left+C.left)/D.x,right:(O.right-R.right+C.right)/D.x}}const lN=50,rN=async(n,l,o)=>{const{placement:i="bottom",strategy:u="absolute",middleware:d=[],platform:h}=o,p=h.detectOverflow?h:{...h,detectOverflow:aN},g=await(h.isRTL==null?void 0:h.isRTL(l));let v=await h.getElementRects({reference:n,floating:l,strategy:u}),{x,y}=Jx(v,i,g),S=i,w=0;const C={};for(let E=0;E<d.length;E++){const j=d[E];if(!j)continue;const{name:R,fn:A}=j,{x:T,y:D,data:O,reset:M}=await A({x,y,initialPlacement:i,placement:S,strategy:u,middlewareData:C,rects:v,platform:p,elements:{reference:n,floating:l}});x=T??x,y=D??y,C[R]={...C[R],...O},M&&w<lN&&(w++,typeof M=="object"&&(M.placement&&(S=M.placement),M.rects&&(v=M.rects===!0?await h.getElementRects({reference:n,floating:l,strategy:u}):M.rects),{x,y}=Jx(v,S,g)),E=-1)}return{x,y,placement:S,strategy:u,middlewareData:C}},sN=n=>({name:"arrow",options:n,async fn(l){const{x:o,y:i,placement:u,rects:d,platform:h,elements:p,middlewareData:g}=l,{element:v,padding:x=0}=tl(n,l)||{};if(v==null)return{};const y=Hb(x),S={x:o,y:i},w=Ph(u),C=Hh(w),E=await h.getDimensions(v),j=w==="y",R=j?"top":"left",A=j?"bottom":"right",T=j?"clientHeight":"clientWidth",D=d.reference[C]+d.reference[w]-S[w]-d.floating[C],O=S[w]-d.reference[w],M=await(h.getOffsetParent==null?void 0:h.getOffsetParent(v));let B=M?M[T]:0;(!B||!await(h.isElement==null?void 0:h.isElement(M)))&&(B=p.floating[T]||d.floating[C]);const z=D/2-O/2,K=B/2-E[C]/2-1,oe=Pl(y[R],K),X=Pl(y[A],K),q=B-E[C]-X,le=B/2-E[C]/2+z,J=Bb(oe,le,q),ce=!g.arrow&&Cs(u)!=null&&le!==J&&d.reference[C]/2-(le<oe?oe:X)-E[C]/2<0,U=ce?le<oe?le-oe:le-q:0;return{[w]:S[w]+U,data:{[w]:J,centerOffset:le-J-U,...ce&&{alignmentOffset:U}},reset:ce}}}),oN=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(l){var o,i;const{placement:u,middlewareData:d,rects:h,initialPlacement:p,platform:g,elements:v}=l,{mainAxis:x=!0,crossAxis:y=!0,fallbackPlacements:S,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:E=!0,...j}=tl(n,l);if((o=d.arrow)!=null&&o.alignmentOffset)return{};const R=ql(u),A=ya(p),T=ql(p)===p,D=await(g.isRTL==null?void 0:g.isRTL(v.floating)),O=S||(T||!E?[Ec(p)]:ZE(p)),M=C!=="none";!S&&M&&O.push(...tN(p,E,C,D));const B=[p,...O],z=await g.detectOverflow(l,j),K=[];let oe=((i=d.flip)==null?void 0:i.overflows)||[];if(x&&K.push(z[R]),y){const J=QE(u,h,D);K.push(z[J[0]],z[J[1]])}if(oe=[...oe,{placement:u,overflows:K}],!K.every(J=>J<=0)){var X,q;const J=(((X=d.flip)==null?void 0:X.index)||0)+1,ce=B[J];if(ce&&(!(y==="alignment"?A!==ya(ce):!1)||oe.every(ae=>ya(ae.placement)===A?ae.overflows[0]>0:!0)))return{data:{index:J,overflows:oe},reset:{placement:ce}};let U=(q=oe.filter(Y=>Y.overflows[0]<=0).sort((Y,ae)=>Y.overflows[1]-ae.overflows[1])[0])==null?void 0:q.placement;if(!U)switch(w){case"bestFit":{var le;const Y=(le=oe.filter(ae=>{if(M){const W=ya(ae.placement);return W===A||W==="y"}return!0}).map(ae=>[ae.placement,ae.overflows.filter(W=>W>0).reduce((W,te)=>W+te,0)]).sort((ae,W)=>ae[1]-W[1])[0])==null?void 0:le[0];Y&&(U=Y);break}case"initialPlacement":U=p;break}if(u!==U)return{reset:{placement:U}}}return{}}}};function Wx(n,l){return{top:n.top-l.height,right:n.right-l.width,bottom:n.bottom-l.height,left:n.left-l.width}}function ey(n){return XE.some(l=>n[l]>=0)}const iN=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(l){const{rects:o,platform:i}=l,{strategy:u="referenceHidden",...d}=tl(n,l);switch(u){case"referenceHidden":{const h=await i.detectOverflow(l,{...d,elementContext:"reference"}),p=Wx(h,o.reference);return{data:{referenceHiddenOffsets:p,referenceHidden:ey(p)}}}case"escaped":{const h=await i.detectOverflow(l,{...d,altBoundary:!0}),p=Wx(h,o.floating);return{data:{escapedOffsets:p,escaped:ey(p)}}}default:return{}}}}},Pb=new Set(["left","top"]);async function cN(n,l){const{placement:o,platform:i,elements:u}=n,d=await(i.isRTL==null?void 0:i.isRTL(u.floating)),h=ql(o),p=Cs(o),g=ya(o)==="y",v=Pb.has(h)?-1:1,x=d&&g?-1:1,y=tl(l,n);let{mainAxis:S,crossAxis:w,alignmentAxis:C}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return p&&typeof C=="number"&&(w=p==="end"?C*-1:C),g?{x:w*x,y:S*v}:{x:S*v,y:w*x}}const uN=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(l){var o,i;const{x:u,y:d,placement:h,middlewareData:p}=l,g=await cN(l,n);return h===((o=p.offset)==null?void 0:o.placement)&&(i=p.arrow)!=null&&i.alignmentOffset?{}:{x:u+g.x,y:d+g.y,data:{...g,placement:h}}}}},dN=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(l){const{x:o,y:i,placement:u,platform:d}=l,{mainAxis:h=!0,crossAxis:p=!1,limiter:g={fn:A=>{let{x:T,y:D}=A;return{x:T,y:D}}},...v}=tl(n,l),x={x:o,y:i},y=await d.detectOverflow(l,v),S=ya(u),w=Bh(S);let C=x[w],E=x[S];const j=(A,T)=>Bb(T+y[A==="y"?"top":"left"],T,T-y[A==="y"?"bottom":"right"]);h&&(C=j(w,C)),p&&(E=j(S,E));const R=g.fn({...l,[w]:C,[S]:E});return{...R,data:{x:R.x-o,y:R.y-i,enabled:{[w]:h,[S]:p}}}}}},fN=function(n){return n===void 0&&(n={}),{options:n,fn(l){var o,i;const{x:u,y:d,placement:h,rects:p,middlewareData:g}=l,{offset:v=0,mainAxis:x=!0,crossAxis:y=!0}=tl(n,l),S={x:u,y:d},w=ya(h),C=Bh(w);let E=S[C],j=S[w];const R=tl(v,l),A=typeof R=="number"?{mainAxis:R,crossAxis:0}:{mainAxis:(o=R.mainAxis)!=null?o:0,crossAxis:(i=R.crossAxis)!=null?i:0};if(x){const O=C==="y"?"height":"width",M=p.reference[C]-p.floating[O]+A.mainAxis,B=p.reference[C]+p.reference[O]-A.mainAxis;E<M?E=M:E>B&&(E=B)}if(y){var T,D;const O=C==="y"?"width":"height",M=Pb.has(ql(h)),B=p.reference[w]-p.floating[O]+(M&&((T=g.offset)==null?void 0:T[w])||0)+(M?0:A.crossAxis),z=p.reference[w]+p.reference[O]+(M?0:((D=g.offset)==null?void 0:D[w])||0)-(M?A.crossAxis:0);j<B?j=B:j>z&&(j=z)}return{[C]:E,[w]:j}}}},hN=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(l){const{placement:o,rects:i,platform:u,elements:d}=l,{apply:h=()=>{},...p}=tl(n,l),g=await u.detectOverflow(l,p),v=ql(o),x=Cs(o),y=ya(o)==="y",{width:S,height:w}=i.floating;let C,E;v==="top"||v==="bottom"?(C=v,E=x===(await(u.isRTL==null?void 0:u.isRTL(d.floating))?"start":"end")?"left":"right"):(E=v,C=x==="end"?"top":"bottom");const j=w-g.top-g.bottom,R=S-g.left-g.right,A=Pl(w-g[C],j),T=Pl(S-g[E],R),D=l.middlewareData.shift,O=!D;let M=A,B=T;D!=null&&D.enabled.x&&(B=R),D!=null&&D.enabled.y&&(M=j),O&&!x&&(y?B=S-2*Qa(g.left,g.right):M=w-2*Qa(g.top,g.bottom)),await h({...l,availableWidth:B,availableHeight:M});const z=await u.getDimensions(d.floating);return S!==z.width||w!==z.height?{reset:{rects:!0}}:{}}}};function Hc(){return typeof window<"u"}function Es(n){return qb(n)?(n.nodeName||"").toLowerCase():"#document"}function vn(n){var l;return(n==null||(l=n.ownerDocument)==null?void 0:l.defaultView)||window}function ll(n){var l;return(l=(qb(n)?n.ownerDocument:n.document)||window.document)==null?void 0:l.documentElement}function qb(n){return Hc()?n instanceof Node||n instanceof vn(n).Node:!1}function wa(n){return Hc()?n instanceof Element||n instanceof vn(n).Element:!1}function Vl(n){return Hc()?n instanceof HTMLElement||n instanceof vn(n).HTMLElement:!1}function ty(n){return!Hc()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof vn(n).ShadowRoot}function Pc(n){const{overflow:l,overflowX:o,overflowY:i,display:u}=ja(n);return/auto|scroll|overlay|hidden|clip/.test(l+i+o)&&u!=="inline"&&u!=="contents"}function mN(n){return/^(table|td|th)$/.test(Es(n))}function qc(n){try{if(n.matches(":popover-open"))return!0}catch{}try{return n.matches(":modal")}catch{return!1}}const pN=/transform|translate|scale|rotate|perspective|filter/,gN=/paint|layout|strict|content/,ur=n=>!!n&&n!=="none";let Mf;function qh(n){const l=wa(n)?ja(n):n;return ur(l.transform)||ur(l.translate)||ur(l.scale)||ur(l.rotate)||ur(l.perspective)||!Ih()&&(ur(l.backdropFilter)||ur(l.filter))||pN.test(l.willChange||"")||gN.test(l.contain||"")}function vN(n){let l=mr(n);for(;Vl(l)&&!Ro(l);){if(qh(l))return l;if(qc(l))return null;l=mr(l)}return null}function Ih(){return Mf==null&&(Mf=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Mf}function Ro(n){return/^(html|body|#document)$/.test(Es(n))}function ja(n){return vn(n).getComputedStyle(n)}function Ic(n){return wa(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function mr(n){if(Es(n)==="html")return n;const l=n.assignedSlot||n.parentNode||ty(n)&&n.host||ll(n);return ty(l)?l.host:l}function Ib(n){const l=mr(n);return Ro(l)?(n.ownerDocument||n).body:Vl(l)&&Pc(l)?l:Ib(l)}function To(n,l,o){var i;l===void 0&&(l=[]),o===void 0&&(o=!0);const u=Ib(n),d=u===((i=n.ownerDocument)==null?void 0:i.body),h=vn(u);if(d){const p=th(h);return l.concat(h,h.visualViewport||[],Pc(u)?u:[],p&&o?To(p):[])}else return l.concat(u,To(u,[],o))}function th(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Vb(n){const l=ja(n);let o=parseFloat(l.width)||0,i=parseFloat(l.height)||0;const u=Vl(n),d=u?n.offsetWidth:o,h=u?n.offsetHeight:i,p=Cc(o)!==d||Cc(i)!==h;return p&&(o=d,i=h),{width:o,height:i,$:p}}function Vh(n){return wa(n)?n:n.contextElement}function ms(n){const l=Vh(n);if(!Vl(l))return Za(1);const o=l.getBoundingClientRect(),{width:i,height:u,$:d}=Vb(l);let h=(d?Cc(o.width):o.width)/i,p=(d?Cc(o.height):o.height)/u;return(!h||!Number.isFinite(h))&&(h=1),(!p||!Number.isFinite(p))&&(p=1),{x:h,y:p}}const xN=Za(0);function Gb(n){const l=vn(n);return!Ih()||!l.visualViewport?xN:{x:l.visualViewport.offsetLeft,y:l.visualViewport.offsetTop}}function yN(n,l,o){return l===void 0&&(l=!1),!!o&&l&&o===vn(n)}function pr(n,l,o,i){l===void 0&&(l=!1),o===void 0&&(o=!1);const u=n.getBoundingClientRect(),d=Vh(n);let h=Za(1);l&&(i?wa(i)&&(h=ms(i)):h=ms(n));const p=yN(d,o,i)?Gb(d):Za(0);let g=(u.left+p.x)/h.x,v=(u.top+p.y)/h.y,x=u.width/h.x,y=u.height/h.y;if(d&&i){const S=vn(d),w=wa(i)?vn(i):i;let C=S,E=th(C);for(;E&&w!==C;){const j=ms(E),R=E.getBoundingClientRect(),A=ja(E),T=R.left+(E.clientLeft+parseFloat(A.paddingLeft))*j.x,D=R.top+(E.clientTop+parseFloat(A.paddingTop))*j.y;g*=j.x,v*=j.y,x*=j.x,y*=j.y,g+=T,v+=D,C=vn(E),E=th(C)}}return Nc({width:x,height:y,x:g,y:v})}function Vc(n,l){const o=Ic(n).scrollLeft;return l?l.left+o:pr(ll(n)).left+o}function Yb(n,l){const o=n.getBoundingClientRect(),i=o.left+l.scrollLeft-Vc(n,o),u=o.top+l.scrollTop;return{x:i,y:u}}function bN(n){let{elements:l,rect:o,offsetParent:i,strategy:u}=n;const d=u==="fixed",h=ll(i),p=l?qc(l.floating):!1;if(i===h||p&&d)return o;let g={scrollLeft:0,scrollTop:0},v=Za(1);const x=Za(0),y=Vl(i);if((y||!d)&&((Es(i)!=="body"||Pc(h))&&(g=Ic(i)),y)){const w=pr(i);v=ms(i),x.x=w.x+i.clientLeft,x.y=w.y+i.clientTop}const S=h&&!y&&!d?Yb(h,g):Za(0);return{width:o.width*v.x,height:o.height*v.y,x:o.x*v.x-g.scrollLeft*v.x+x.x+S.x,y:o.y*v.y-g.scrollTop*v.y+x.y+S.y}}function SN(n){return n.getClientRects?Array.from(n.getClientRects()):[]}function wN(n){const l=Ic(n),o=n.ownerDocument.body,i=Qa(n.scrollWidth,n.clientWidth,o.scrollWidth,o.clientWidth),u=Qa(n.scrollHeight,n.clientHeight,o.scrollHeight,o.clientHeight);let d=-l.scrollLeft+Vc(n);const h=-l.scrollTop;return ja(o).direction==="rtl"&&(d+=Qa(n.clientWidth,o.clientWidth)-i),{width:i,height:u,x:d,y:h}}const jN=25;function CN(n,l,o){o===void 0&&(o="viewport");const i=o==="layoutViewport",u=vn(n),d=ll(n),h=u.visualViewport;let p=d.clientWidth,g=d.clientHeight,v=0,x=0;if(h){const S=!Ih()||l==="fixed";i?S||(v=-h.offsetLeft,x=-h.offsetTop):(p=h.width,g=h.height,S&&(v=h.offsetLeft,x=h.offsetTop))}if(Vc(d)<=0){const S=d.ownerDocument,w=S.body,C=getComputedStyle(w),E=S.compatMode==="CSS1Compat"&&parseFloat(C.marginLeft)+parseFloat(C.marginRight)||0,j=Math.abs(d.clientWidth-w.clientWidth-E),R=getComputedStyle(d).scrollbarGutter==="stable both-edges"?j/2:j;R<=jN&&(p-=R)}return{width:p,height:g,x:v,y:x}}function EN(n,l){const o=pr(n,!0,l==="fixed"),i=o.top+n.clientTop,u=o.left+n.clientLeft,d=ms(n),h=n.clientWidth*d.x,p=n.clientHeight*d.y,g=u*d.x,v=i*d.y;return{width:h,height:p,x:g,y:v}}function ny(n,l,o){let i;if(l==="viewport"||l==="layoutViewport")i=CN(n,o,l);else if(l==="document")i=wN(ll(n));else if(wa(l))i=EN(l,o);else{const u=Gb(n);i={x:l.x-u.x,y:l.y-u.y,width:l.width,height:l.height}}return Nc(i)}function NN(n,l){const o=l.get(n);if(o)return o;let i=To(n,[],!1).filter(p=>wa(p)&&Es(p)!=="body"),u=null;const d=ja(n).position==="fixed";let h=d?mr(n):n;for(;wa(h)&&!Ro(h);){const p=ja(h),g=qh(h),v=u?u.position:d?"fixed":"";!g&&(v==="fixed"||v==="absolute"&&p.position==="static")?i=i.filter(y=>y!==h):u=p,h=mr(h)}return l.set(n,i),i}function RN(n){let{element:l,boundary:o,rootBoundary:i,strategy:u}=n;const h=[...o==="clippingAncestors"?qc(l)?[]:NN(l,this._c):[].concat(o),i],p=ny(l,h[0],u);let g=p.top,v=p.right,x=p.bottom,y=p.left;for(let S=1;S<h.length;S++){const w=ny(l,h[S],u);g=Qa(w.top,g),v=Pl(w.right,v),x=Pl(w.bottom,x),y=Qa(w.left,y)}return{width:v-y,height:x-g,x:y,y:g}}function TN(n){const{width:l,height:o}=Vb(n);return{width:l,height:o}}function AN(n,l,o){const i=Vl(l),u=ll(l),d=o==="fixed",h=pr(n,!0,d,l);let p={scrollLeft:0,scrollTop:0};const g=Za(0);if((i||!d)&&((Es(l)!=="body"||Pc(u))&&(p=Ic(l)),i)){const S=pr(l,!0,d,l);g.x=S.x+l.clientLeft,g.y=S.y+l.clientTop}!i&&u&&(g.x=Vc(u));const v=u&&!i&&!d?Yb(u,p):Za(0),x=h.left+p.scrollLeft-g.x-v.x,y=h.top+p.scrollTop-g.y-v.y;return{x,y,width:h.width,height:h.height}}function Df(n){return ja(n).position==="static"}function ay(n,l){if(!Vl(n)||ja(n).position==="fixed")return null;if(l)return l(n);let o=n.offsetParent;return ll(n)===o&&(o=o.ownerDocument.body),o}function $b(n,l){const o=vn(n);if(qc(n))return o;if(!Vl(n)){let u=mr(n);for(;u&&!Ro(u);){if(wa(u)&&!Df(u))return u;u=mr(u)}return o}let i=ay(n,l);for(;i&&mN(i)&&Df(i);)i=ay(i,l);return i&&Ro(i)&&Df(i)&&!qh(i)?o:i||vN(n)||o}const MN=async function(n){const l=this.getOffsetParent||$b,o=this.getDimensions,i=await o(n.floating);return{reference:AN(n.reference,await l(n.floating),n.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function DN(n){return ja(n).direction==="rtl"}const _N={convertOffsetParentRelativeRectToViewportRelativeRect:bN,getDocumentElement:ll,getClippingRect:RN,getOffsetParent:$b,getElementRects:MN,getClientRects:SN,getDimensions:TN,getScale:ms,isElement:wa,isRTL:DN};function Kb(n,l){return n.x===l.x&&n.y===l.y&&n.width===l.width&&n.height===l.height}function ON(n,l,o){let i=null,u;const d=ll(n);function h(){var x;clearTimeout(u),(x=i)==null||x.disconnect(),i=null}function p(x,y){x===void 0&&(x=!1),y===void 0&&(y=1),h();const S=n.getBoundingClientRect(),{left:w,top:C,width:E,height:j}=S;if(x||l(),!E||!j)return;const R=rc(C),A=rc(d.clientWidth-(w+E)),T=rc(d.clientHeight-(C+j)),D=rc(w),M={rootMargin:-R+"px "+-A+"px "+-T+"px "+-D+"px",threshold:Qa(0,Pl(1,y))||1};let B=!0;function z(K){const oe=K[0].intersectionRatio;if(!Kb(S,n.getBoundingClientRect()))return p();if(oe!==y){if(!B)return p();oe?p(!1,oe):u=setTimeout(()=>{p(!1,1e-7)},1e3)}B=!1}try{i=new IntersectionObserver(z,{...M,root:d.ownerDocument})}catch{i=new IntersectionObserver(z,M)}i.observe(n)}const g=vn(n),v=()=>p(o);return g.addEventListener("resize",v),p(!0),()=>{g.removeEventListener("resize",v),h()}}function kN(n,l,o,i){i===void 0&&(i={});const{ancestorScroll:u=!0,ancestorResize:d=!0,elementResize:h=typeof ResizeObserver=="function",layoutShift:p=typeof IntersectionObserver=="function",animationFrame:g=!1}=i,v=Vh(n),x=u||d?[...v?To(v):[],...l?To(l):[]]:[];x.forEach(R=>{u&&R.addEventListener("scroll",o),d&&R.addEventListener("resize",o)});const y=v&&p?ON(v,o,d):null;let S=-1,w=null;h&&(w=new ResizeObserver(R=>{let[A]=R;A&&A.target===v&&w&&l&&(w.unobserve(l),cancelAnimationFrame(S),S=requestAnimationFrame(()=>{var T;(T=w)==null||T.observe(l)})),o()}),v&&!g&&w.observe(v),l&&w.observe(l));let C,E=g?pr(n):null;g&&j();function j(){const R=pr(n);E&&!Kb(E,R)&&o(),E=R,C=requestAnimationFrame(j)}return o(),()=>{var R;x.forEach(A=>{u&&A.removeEventListener("scroll",o),d&&A.removeEventListener("resize",o)}),y==null||y(),(R=w)==null||R.disconnect(),w=null,g&&cancelAnimationFrame(C)}}const zN=uN,LN=dN,UN=oN,BN=hN,HN=iN,ly=sN,PN=fN,qN=(n,l,o)=>{const i=new Map,u=o??{},d={..._N,...u.platform,_c:i};return rN(n,l,{...u,platform:d})};var IN=typeof document<"u",VN=function(){},yc=IN?m.useLayoutEffect:VN;function Rc(n,l){if(n===l)return!0;if(typeof n!=typeof l)return!1;if(typeof n=="function"&&n.toString()===l.toString())return!0;let o,i,u;if(n&&l&&typeof n=="object"){if(Array.isArray(n)){if(o=n.length,o!==l.length)return!1;for(i=o;i--!==0;)if(!Rc(n[i],l[i]))return!1;return!0}if(u=Object.keys(n),o=u.length,o!==Object.keys(l).length)return!1;for(i=o;i--!==0;)if(!{}.hasOwnProperty.call(l,u[i]))return!1;for(i=o;i--!==0;){const d=u[i];if(!(d==="_owner"&&n.$$typeof)&&!Rc(n[d],l[d]))return!1}return!0}return n!==n&&l!==l}function Xb(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function ry(n,l){const o=Xb(n);return Math.round(l*o)/o}function _f(n){const l=m.useRef(n);return yc(()=>{l.current=n}),l}function GN(n){n===void 0&&(n={});const{placement:l="bottom",strategy:o="absolute",middleware:i=[],platform:u,elements:{reference:d,floating:h}={},transform:p=!0,whileElementsMounted:g,open:v}=n,[x,y]=m.useState({x:0,y:0,strategy:o,placement:l,middlewareData:{},isPositioned:!1}),[S,w]=m.useState(i);Rc(S,i)||w(i);const[C,E]=m.useState(null),[j,R]=m.useState(null),A=m.useCallback(ae=>{ae!==M.current&&(M.current=ae,E(ae))},[]),T=m.useCallback(ae=>{ae!==B.current&&(B.current=ae,R(ae))},[]),D=d||C,O=h||j,M=m.useRef(null),B=m.useRef(null),z=m.useRef(x),K=g!=null,oe=_f(g),X=_f(u),q=_f(v),le=m.useCallback(()=>{if(!M.current||!B.current)return;const ae={placement:l,strategy:o,middleware:S};X.current&&(ae.platform=X.current),qN(M.current,B.current,ae).then(W=>{const te={...W,isPositioned:q.current!==!1};J.current&&!Rc(z.current,te)&&(z.current=te,Ss.flushSync(()=>{y(te)}))})},[S,l,o,X,q]);yc(()=>{v===!1&&z.current.isPositioned&&(z.current.isPositioned=!1,y(ae=>({...ae,isPositioned:!1})))},[v]);const J=m.useRef(!1);yc(()=>(J.current=!0,()=>{J.current=!1}),[]),yc(()=>{if(D&&(M.current=D),O&&(B.current=O),D&&O){if(oe.current)return oe.current(D,O,le);le()}},[D,O,le,oe,K]);const ce=m.useMemo(()=>({reference:M,floating:B,setReference:A,setFloating:T}),[A,T]),U=m.useMemo(()=>({reference:D,floating:O}),[D,O]),Y=m.useMemo(()=>{const ae={position:o,left:0,top:0};if(!U.floating)return ae;const W=ry(U.floating,x.x),te=ry(U.floating,x.y);return p?{...ae,transform:"translate("+W+"px, "+te+"px)",...Xb(U.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:W,top:te}},[o,p,U.floating,x.x,x.y]);return m.useMemo(()=>({...x,update:le,refs:ce,elements:U,floatingStyles:Y}),[x,le,ce,U,Y])}const YN=n=>{function l(o){return{}.hasOwnProperty.call(o,"current")}return{name:"arrow",options:n,fn(o){const{element:i,padding:u}=typeof n=="function"?n(o):n;return i&&l(i)?i.current!=null?ly({element:i.current,padding:u}).fn(o):{}:i?ly({element:i,padding:u}).fn(o):{}}}},$N=(n,l)=>{const o=zN(n);return{name:o.name,fn:o.fn,options:[n,l]}},KN=(n,l)=>{const o=LN(n);return{name:o.name,fn:o.fn,options:[n,l]}},XN=(n,l)=>({fn:PN(n).fn,options:[n,l]}),FN=(n,l)=>{const o=UN(n);return{name:o.name,fn:o.fn,options:[n,l]}},QN=(n,l)=>{const o=BN(n);return{name:o.name,fn:o.fn,options:[n,l]}},ZN=(n,l)=>{const o=HN(n);return{name:o.name,fn:o.fn,options:[n,l]}},JN=(n,l)=>{const o=YN(n);return{name:o.name,fn:o.fn,options:[n,l]}};var WN=Object.defineProperty,eR=(n,l)=>WN(n,"name",{value:l,configurable:!0});function Gc(n){const[l,o]=m.useState(void 0);return kt(()=>{if(n){o({width:n.offsetWidth,height:n.offsetHeight});const i=new ResizeObserver(u=>{if(!Array.isArray(u)||!u.length)return;const d=u[0];let h,p;if("borderBoxSize"in d){const g=d.borderBoxSize,v=Array.isArray(g)?g[0]:g;h=v.inlineSize,p=v.blockSize}else h=n.offsetWidth,p=n.offsetHeight;o({width:h,height:p})});return i.observe(n,{box:"border-box"}),()=>i.unobserve(n)}else o(void 0)},[n]),l}eR(Gc,"useSize");var tR=Object.defineProperty,Bl=(n,l)=>tR(n,"name",{value:l,configurable:!0}),Fb="Popper",[Qb,Ns]=yn(Fb),[nR,Zb]=Qb(Fb),aR=Bl(n=>{const{__scopePopper:l,children:o}=n,[i,u]=m.useState(null),[d,h]=m.useState(void 0);return s.jsx(nR,{scope:l,anchor:i,onAnchorChange:u,placementState:d,setPlacementState:h,children:o})},"Popper"),lR="PopperAnchor",rR=m.forwardRef(Bl(function(l,o){const{__scopePopper:i,virtualRef:u,...d}=l,h=Zb(lR,i),p=m.useRef(null),g=h.onAnchorChange,v=m.useCallback(E=>{p.current=E,E&&g(E)},[g]),x=Ge(o,v),y=m.useRef(null);m.useEffect(()=>{if(!u)return;const E=y.current;y.current=u.current,E!==y.current&&g(y.current)});const S=h.placementState&&Yc(h.placementState),w=S==null?void 0:S[0],C=S==null?void 0:S[1];return u?null:s.jsx(Pe.div,{"data-radix-popper-side":w,"data-radix-popper-align":C,...d,ref:x})},"PopperAnchor")),Jb="PopperContent",[sR,I_]=Qb(Jb),oR=m.forwardRef(Bl(function(l,o){var me,Ce,Me,Ae,Le,pt,gt;const{__scopePopper:i,side:u="bottom",sideOffset:d=0,align:h="center",alignOffset:p=0,arrowPadding:g=0,avoidCollisions:v=!0,collisionBoundary:x=[],collisionPadding:y=0,sticky:S="partial",hideWhenDetached:w=!1,updatePositionStrategy:C="optimized",onPlaced:E,...j}=l,R=Zb(Jb,i),[A,T]=m.useState(null),D=Ge(o,T),[O,M]=m.useState(null),B=Gc(O),z=(B==null?void 0:B.width)??0,K=(B==null?void 0:B.height)??0,oe=u+(h!=="center"?"-"+h:""),X=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},q=Array.isArray(x)?x:[x],le=q.length>0,J={padding:X,boundary:q.filter(Wb),altBoundary:le},{refs:ce,floatingStyles:U,placement:Y,isPositioned:ae,middlewareData:W}=GN({strategy:"fixed",placement:oe,whileElementsMounted:Bl((...se)=>kN(...se,{animationFrame:C==="always"}),"whileElementsMounted"),elements:{reference:R.anchor},middleware:[$N({mainAxis:d+K,alignmentAxis:p}),v&&KN({mainAxis:!0,crossAxis:!1,limiter:S==="partial"?XN():void 0,...J}),v&&FN({...J}),QN({...J,apply:Bl(({elements:se,rects:Ue,availableWidth:Ye,availableHeight:Ht})=>{const{width:Ft,height:bn}=Ue.reference,ea=se.floating.style;ea.setProperty("--radix-popper-available-width",`${Ye}px`),ea.setProperty("--radix-popper-available-height",`${Ht}px`),ea.setProperty("--radix-popper-anchor-width",`${Ft}px`),ea.setProperty("--radix-popper-anchor-height",`${bn}px`)},"apply")}),O&&JN({element:O,padding:g}),iR({arrowWidth:z,arrowHeight:K}),w&&ZN({strategy:"referenceHidden",...J,boundary:le?J.boundary:void 0})]}),te=R.setPlacementState;kt(()=>(te(Y),()=>{te(void 0)}),[Y,te]);const[_,P]=Yc(Y),Q=Qn(E);kt(()=>{ae&&(Q==null||Q())},[ae,Q]);const re=(me=W.arrow)==null?void 0:me.x,fe=(Ce=W.arrow)==null?void 0:Ce.y,be=((Me=W.arrow)==null?void 0:Me.centerOffset)!==0,[G,ie]=m.useState();return kt(()=>{A&&ie(window.getComputedStyle(A).zIndex)},[A]),s.jsx("div",{ref:ce.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:ae?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[(Ae=W.transformOrigin)==null?void 0:Ae.x,(Le=W.transformOrigin)==null?void 0:Le.y].join(" "),...((pt=W.hide)==null?void 0:pt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:l.dir,children:s.jsx(sR,{scope:i,placedSide:_,placedAlign:P,onArrowChange:M,arrowX:re,arrowY:fe,shouldHideArrow:be,children:s.jsx(Pe.div,{"data-side":_,"data-align":P,...j,ref:D,style:{...j.style,animation:ae?(gt=j.style)==null?void 0:gt.animation:"none"}})})})},"PopperContent"));function Wb(n){return n!==null}Bl(Wb,"isNotNull");var iR=Bl(n=>({name:"transformOrigin",options:n,fn(l){var j,R,A;const{placement:o,rects:i,middlewareData:u}=l,h=((j=u.arrow)==null?void 0:j.centerOffset)!==0,p=h?0:n.arrowWidth,g=h?0:n.arrowHeight,[v,x]=Yc(o),y={start:"0%",center:"50%",end:"100%"}[x],S=(((R=u.arrow)==null?void 0:R.x)??0)+p/2,w=(((A=u.arrow)==null?void 0:A.y)??0)+g/2;let C="",E="";return v==="bottom"?(C=h?y:`${S}px`,E=`${-g}px`):v==="top"?(C=h?y:`${S}px`,E=`${i.floating.height+g}px`):v==="right"?(C=`${-g}px`,E=h?y:`${w}px`):v==="left"&&(C=`${i.floating.width+g}px`,E=h?y:`${w}px`),{data:{x:C,y:E}}}}),"transformOrigin");function Yc(n){const[l,o="center"]=n.split("-");return[l,o]}Bl(Yc,"getSideAndAlignFromPlacement");var e0=aR,t0=rR,Gh=oR,cR=Object.defineProperty,uR=(n,l)=>cR(n,"name",{value:l,configurable:!0}),Yh=m.forwardRef(uR(function(l,o){var g;const{container:i,...u}=l,[d,h]=m.useState(!1);kt(()=>h(!0),[]);const p=i||d&&((g=globalThis==null?void 0:globalThis.document)==null?void 0:g.body);return p?Ss.createPortal(s.jsx(Pe.div,{...u,ref:o}),p):null},"Portal")),dR=Object.defineProperty,nl=(n,l)=>dR(n,"name",{value:l,configurable:!0});function n0(n,l){return m.useReducer((o,i)=>l[o][i]??o,n)}nl(n0,"useStateMachine");var rl=nl(n=>{const{present:l,children:o}=n,i=a0(l),u=typeof o=="function"?o({present:i.isPresent}):m.Children.only(o),d=l0(i.ref,r0(u));return typeof o=="function"||i.isPresent?m.cloneElement(u,{ref:d}):null},"Presence");function a0(n){const[l,o]=m.useState(),i=m.useRef(null),u=m.useRef(n),d=m.useRef("none"),h=m.useRef(void 0),p=n?"mounted":"unmounted",[g,v]=n0(p,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{g==="mounted"?(d.current=h.current??ds(i.current),h.current=void 0):d.current="none"},[g]),kt(()=>{const x=i.current,y=u.current;if(y!==n){const w=d.current,C=ds(x);n?(h.current=C,v("MOUNT")):C==="none"||(x==null?void 0:x.display)==="none"?v("UNMOUNT"):v(y&&w!==C?"ANIMATION_OUT":"UNMOUNT"),u.current=n}},[n,v]),kt(()=>{if(l){let x;const y=l.ownerDocument.defaultView??window,S=nl(C=>{const j=ds(i.current).includes(CSS.escape(C.animationName));if(C.target===l&&j&&(v("ANIMATION_END"),!u.current)){const R=l.style.animationFillMode;l.style.animationFillMode="forwards",x=y.setTimeout(()=>{l.style.animationFillMode==="forwards"&&(l.style.animationFillMode=R)})}},"handleAnimationEnd"),w=nl(C=>{C.target===l&&(d.current=ds(i.current))},"handleAnimationStart");return l.addEventListener("animationstart",w),l.addEventListener("animationcancel",S),l.addEventListener("animationend",S),()=>{y.clearTimeout(x),l.removeEventListener("animationstart",w),l.removeEventListener("animationcancel",S),l.removeEventListener("animationend",S)}}else v("ANIMATION_END")},[l,v]),{isPresent:["mounted","unmountSuspended"].includes(g),ref:m.useCallback(x=>{if(x){const y=getComputedStyle(x);i.current=y,h.current=ds(y)}else i.current=null;o(x)},[])}}nl(a0,"usePresence");function nh(n,l){if(typeof n=="function")return n(l);n!=null&&(n.current=l)}nl(nh,"setRef");function l0(...n){const l=m.useRef(n);return l.current=n,m.useCallback(o=>{const i=l.current;let u=!1;const d=i.map(h=>{const p=nh(h,o);return!u&&typeof p=="function"&&(u=!0),p});if(u)return()=>{for(let h=0;h<d.length;h++){const p=d[h];typeof p=="function"?p():nh(i[h],null)}}},[])}nl(l0,"useStableComposedRefs");function ds(n){return(n==null?void 0:n.animationName)||"none"}nl(ds,"getAnimationName");function r0(n){var i,u;let l=(i=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:i.get,o=l&&"isReactWarning"in l&&l.isReactWarning;return o?n.ref:(l=(u=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:u.get,o=l&&"isReactWarning"in l&&l.isReactWarning,o?n.props.ref:n.props.ref||n.ref)}nl(r0,"getElementRef");var fR=Object.defineProperty,$h=(n,l)=>fR(n,"name",{value:l,configurable:!0}),Of=!1;function s0(){const[n,l]=m.useState(Of);return m.useEffect(()=>{Of||(Of=!0,l(!0))},[]),n}$h(s0,"useIsHydrated");var o0=vs[" useSyncExternalStore ".trim().toString()];function i0(){return()=>{}}$h(i0,"subscribe");function c0(){return o0(i0,()=>!0,()=>!1)}$h(c0,"useIsHydratedModern");var hR=typeof o0=="function"?c0:s0,mR=Object.defineProperty,vr=(n,l)=>mR(n,"name",{value:l,configurable:!0}),kf="rovingFocusGroup.onEntryFocus",pR={bubbles:!1,cancelable:!0},$c="RovingFocusGroup",[ah,u0,gR]=Uc($c),[vR,Kc]=yn($c,[gR]),[xR,yR]=vR($c),bR=m.forwardRef(vr(function(l,o){return s.jsx(ah.Provider,{scope:l.__scopeRovingFocusGroup,children:s.jsx(ah.Slot,{scope:l.__scopeRovingFocusGroup,children:s.jsx(SR,{...l,ref:o})})})},"RovingFocusGroup")),SR=m.forwardRef(vr(function(l,o){const{__scopeRovingFocusGroup:i,orientation:u,loop:d=!1,dir:h,currentTabStopId:p,defaultCurrentTabStopId:g,onCurrentTabStopIdChange:v,onEntryFocus:x,preventScrollOnEntryFocus:y=!1,...S}=l,w=m.useRef(null),C=Ge(o,w),E=Uo(h),[j,R]=el({prop:p,defaultProp:g??null,onChange:v,caller:$c}),[A,T]=m.useState(!1),D=Qn(x),O=u0(i),M=m.useRef(!1),[B,z]=m.useState(0);return m.useEffect(()=>{const K=w.current;if(K)return K.addEventListener(kf,D),()=>K.removeEventListener(kf,D)},[D]),s.jsx(xR,{scope:i,orientation:u,dir:E,loop:d,currentTabStopId:j,onItemFocus:m.useCallback(K=>R(K),[R]),onItemShiftTab:m.useCallback(()=>T(!0),[]),onFocusableItemAdd:m.useCallback(()=>z(K=>K+1),[]),onFocusableItemRemove:m.useCallback(()=>z(K=>K-1),[]),children:s.jsx(Pe.div,{tabIndex:A||B===0?-1:0,"data-orientation":u,...S,ref:C,style:{outline:"none",...l.style},onMouseDown:je(l.onMouseDown,()=>{M.current=!0}),onFocus:je(l.onFocus,K=>{const oe=!M.current;if(K.target===K.currentTarget&&oe&&!A){const X=new CustomEvent(kf,pR);if(K.currentTarget.dispatchEvent(X),!X.defaultPrevented){const q=O().filter(Y=>Y.focusable),le=q.find(Y=>Y.active),J=q.find(Y=>Y.id===j),U=[le,J,...q].filter(Boolean).map(Y=>Y.ref.current);Kh(U,y)}}M.current=!1}),onBlur:je(l.onBlur,()=>T(!1))})})},"RovingFocusGroupImpl")),wR="RovingFocusGroupItem",jR=m.forwardRef(vr(function(l,o){const{__scopeRovingFocusGroup:i,focusable:u=!0,active:d=!1,tabStopId:h,children:p,...g}=l,v=ba(),x=h||v,y=yR(wR,i),S=y.currentTabStopId===x,w=u0(i),{onFocusableItemAdd:C,onFocusableItemRemove:E,currentTabStopId:j}=y,R=hR();return kt(()=>{if(!(!R||!u))return C(),()=>E()},[R,u,C,E]),m.useEffect(()=>{if(!(R||!u))return C(),()=>E()},[R,u,C,E]),s.jsx(ah.ItemSlot,{scope:i,id:x,focusable:u,active:d,children:s.jsx(Pe.span,{tabIndex:S?0:-1,"data-orientation":y.orientation,...g,ref:o,onMouseDown:je(l.onMouseDown,A=>{u?y.onItemFocus(x):A.preventDefault()}),onFocus:je(l.onFocus,()=>y.onItemFocus(x)),onKeyDown:je(l.onKeyDown,A=>{if(A.key==="Tab"&&A.shiftKey){y.onItemShiftTab();return}if(A.target!==A.currentTarget)return;const T=f0(A,y.orientation,y.dir);if(T!==void 0){if(A.metaKey||A.ctrlKey||A.altKey||A.shiftKey)return;A.preventDefault();let O=w().filter(M=>M.focusable).map(M=>M.ref.current);if(T==="last")O.reverse();else if(T==="prev"||T==="next"){T==="prev"&&O.reverse();const M=O.indexOf(A.currentTarget);O=y.loop?h0(O,M+1):O.slice(M+1)}setTimeout(()=>Kh(O))}}),children:typeof p=="function"?p({isCurrentTabStop:S,hasTabStop:j!=null}):p})})},"RovingFocusGroupItem")),CR={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function d0(n,l){return l!=="rtl"?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}vr(d0,"getDirectionAwareKey");function f0(n,l,o){const i=d0(n.key,o);if(!(l==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(l==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return CR[i]}vr(f0,"getFocusIntent");function Kh(n,l=!1){const o=document.activeElement;for(const i of n)if(i===o||(i.focus({preventScroll:l}),document.activeElement!==o))return}vr(Kh,"focusFirst");function h0(n,l){return n.map((o,i)=>n[(l+i)%n.length])}vr(h0,"wrapArray");var m0=bR,p0=jR,ER=function(n){if(typeof document>"u")return null;var l=Array.isArray(n)?n[0]:n;return l.ownerDocument.body},is=new WeakMap,sc=new WeakMap,oc={},zf=0,g0=function(n){return n&&(n.host||g0(n.parentNode))},NR=function(n,l){return l.map(function(o){if(n.contains(o))return o;var i=g0(o);return i&&n.contains(i)?i:(console.error("aria-hidden",o,"in not contained inside",n,". Doing nothing"),null)}).filter(function(o){return!!o})},RR=function(n,l,o,i){var u=NR(l,Array.isArray(n)?n:[n]);oc[o]||(oc[o]=new WeakMap);var d=oc[o],h=[],p=new Set,g=new Set(u),v=function(y){!y||p.has(y)||(p.add(y),v(y.parentNode))};u.forEach(v);var x=function(y){!y||g.has(y)||Array.prototype.forEach.call(y.children,function(S){if(p.has(S))x(S);else try{var w=S.getAttribute(i),C=w!==null&&w!=="false",E=(is.get(S)||0)+1,j=(d.get(S)||0)+1;is.set(S,E),d.set(S,j),h.push(S),E===1&&C&&sc.set(S,!0),j===1&&S.setAttribute(o,"true"),C||S.setAttribute(i,"true")}catch(R){console.error("aria-hidden: cannot operate on ",S,R)}})};return x(l),p.clear(),zf++,function(){h.forEach(function(y){var S=is.get(y)-1,w=d.get(y)-1;is.set(y,S),d.set(y,w),S||(sc.has(y)||y.removeAttribute(i),sc.delete(y)),w||y.removeAttribute(o)}),zf--,zf||(is=new WeakMap,is=new WeakMap,sc=new WeakMap,oc={})}},Xh=function(n,l,o){o===void 0&&(o="data-aria-hidden");var i=Array.from(Array.isArray(n)?n:[n]),u=ER(n);return u?(i.push.apply(i,Array.from(u.querySelectorAll("[aria-live], script"))),RR(i,u,o,"aria-hidden")):function(){return null}},xa=function(){return xa=Object.assign||function(l){for(var o,i=1,u=arguments.length;i<u;i++){o=arguments[i];for(var d in o)Object.prototype.hasOwnProperty.call(o,d)&&(l[d]=o[d])}return l},xa.apply(this,arguments)};function v0(n,l){var o={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&l.indexOf(i)<0&&(o[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var u=0,i=Object.getOwnPropertySymbols(n);u<i.length;u++)l.indexOf(i[u])<0&&Object.prototype.propertyIsEnumerable.call(n,i[u])&&(o[i[u]]=n[i[u]]);return o}function TR(n,l,o){if(o||arguments.length===2)for(var i=0,u=l.length,d;i<u;i++)(d||!(i in l))&&(d||(d=Array.prototype.slice.call(l,0,i)),d[i]=l[i]);return n.concat(d||Array.prototype.slice.call(l))}var bc="right-scroll-bar-position",Sc="width-before-scroll-bar",AR="with-scroll-bars-hidden",MR="--removed-body-scroll-bar-size";function Lf(n,l){return typeof n=="function"?n(l):n&&(n.current=l),n}function DR(n,l){var o=m.useState(function(){return{value:n,callback:l,facade:{get current(){return o.value},set current(i){var u=o.value;u!==i&&(o.value=i,o.callback(i,u))}}}})[0];return o.callback=l,o.facade}var _R=typeof window<"u"?m.useLayoutEffect:m.useEffect,sy=new WeakMap;function OR(n,l){var o=DR(null,function(i){return n.forEach(function(u){return Lf(u,i)})});return _R(function(){var i=sy.get(o);if(i){var u=new Set(i),d=new Set(n),h=o.current;u.forEach(function(p){d.has(p)||Lf(p,null)}),d.forEach(function(p){u.has(p)||Lf(p,h)})}sy.set(o,n)},[n]),o}function kR(n){return n}function zR(n,l){l===void 0&&(l=kR);var o=[],i=!1,u={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return o.length?o[o.length-1]:n},useMedium:function(d){var h=l(d,i);return o.push(h),function(){o=o.filter(function(p){return p!==h})}},assignSyncMedium:function(d){for(i=!0;o.length;){var h=o;o=[],h.forEach(d)}o={push:function(p){return d(p)},filter:function(){return o}}},assignMedium:function(d){i=!0;var h=[];if(o.length){var p=o;o=[],p.forEach(d),h=o}var g=function(){var x=h;h=[],x.forEach(d)},v=function(){return Promise.resolve().then(g)};v(),o={push:function(x){h.push(x),v()},filter:function(x){return h=h.filter(x),o}}}};return u}function LR(n){n===void 0&&(n={});var l=zR(null);return l.options=xa({async:!0,ssr:!1},n),l}var x0=function(n){var l=n.sideCar,o=v0(n,["sideCar"]);if(!l)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=l.read();if(!i)throw new Error("Sidecar medium not found");return m.createElement(i,xa({},o))};x0.isSideCarExport=!0;function UR(n,l){return n.useMedium(l),x0}var y0=LR(),Uf=function(){},Xc=m.forwardRef(function(n,l){var o=m.useRef(null),i=m.useState({onScrollCapture:Uf,onWheelCapture:Uf,onTouchMoveCapture:Uf}),u=i[0],d=i[1],h=n.forwardProps,p=n.children,g=n.className,v=n.removeScrollBar,x=n.enabled,y=n.shards,S=n.sideCar,w=n.noRelative,C=n.noIsolation,E=n.inert,j=n.allowPinchZoom,R=n.as,A=R===void 0?"div":R,T=n.gapMode,D=v0(n,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=S,M=OR([o,l]),B=xa(xa({},D),u);return m.createElement(m.Fragment,null,x&&m.createElement(O,{sideCar:y0,removeScrollBar:v,shards:y,noRelative:w,noIsolation:C,inert:E,setCallbacks:d,allowPinchZoom:!!j,lockRef:o,gapMode:T}),h?m.cloneElement(m.Children.only(p),xa(xa({},B),{ref:M})):m.createElement(A,xa({},B,{className:g,ref:M}),p))});Xc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Xc.classNames={fullWidth:Sc,zeroRight:bc};var BR=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function HR(){if(!document)return null;var n=document.createElement("style");n.type="text/css";var l=BR();return l&&n.setAttribute("nonce",l),n}function PR(n,l){n.styleSheet?n.styleSheet.cssText=l:n.appendChild(document.createTextNode(l))}function qR(n){var l=document.head||document.getElementsByTagName("head")[0];l.appendChild(n)}var IR=function(){var n=0,l=null;return{add:function(o){n==0&&(l=HR())&&(PR(l,o),qR(l)),n++},remove:function(){n--,!n&&l&&(l.parentNode&&l.parentNode.removeChild(l),l=null)}}},VR=function(){var n=IR();return function(l,o){m.useEffect(function(){return n.add(l),function(){n.remove()}},[l&&o])}},b0=function(){var n=VR(),l=function(o){var i=o.styles,u=o.dynamic;return n(i,u),null};return l},GR={left:0,top:0,right:0,gap:0},Bf=function(n){return parseInt(n||"",10)||0},YR=function(n){var l=window.getComputedStyle(document.body),o=l[n==="padding"?"paddingLeft":"marginLeft"],i=l[n==="padding"?"paddingTop":"marginTop"],u=l[n==="padding"?"paddingRight":"marginRight"];return[Bf(o),Bf(i),Bf(u)]},$R=function(n){if(n===void 0&&(n="margin"),typeof window>"u")return GR;var l=YR(n),o=document.documentElement.clientWidth,i=window.innerWidth;return{left:l[0],top:l[1],right:l[2],gap:Math.max(0,i-o+l[2]-l[0])}},KR=b0(),ps="data-scroll-locked",XR=function(n,l,o,i){var u=n.left,d=n.top,h=n.right,p=n.gap;return o===void 0&&(o="margin"),`
|
|
291
|
+
.`.concat(AR,` {
|
|
292
|
+
overflow: hidden `).concat(i,`;
|
|
293
|
+
padding-right: `).concat(p,"px ").concat(i,`;
|
|
294
|
+
}
|
|
295
|
+
body[`).concat(ps,`] {
|
|
296
|
+
overflow: hidden `).concat(i,`;
|
|
297
|
+
overscroll-behavior: contain;
|
|
298
|
+
`).concat([l&&"position: relative ".concat(i,";"),o==="margin"&&`
|
|
299
|
+
padding-left: `.concat(u,`px;
|
|
300
|
+
padding-top: `).concat(d,`px;
|
|
301
|
+
padding-right: `).concat(h,`px;
|
|
302
|
+
margin-left:0;
|
|
303
|
+
margin-top:0;
|
|
304
|
+
margin-right: `).concat(p,"px ").concat(i,`;
|
|
305
|
+
`),o==="padding"&&"padding-right: ".concat(p,"px ").concat(i,";")].filter(Boolean).join(""),`
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.`).concat(bc,` {
|
|
309
|
+
right: `).concat(p,"px ").concat(i,`;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.`).concat(Sc,` {
|
|
313
|
+
margin-right: `).concat(p,"px ").concat(i,`;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.`).concat(bc," .").concat(bc,` {
|
|
317
|
+
right: 0 `).concat(i,`;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.`).concat(Sc," .").concat(Sc,` {
|
|
321
|
+
margin-right: 0 `).concat(i,`;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
body[`).concat(ps,`] {
|
|
325
|
+
`).concat(MR,": ").concat(p,`px;
|
|
326
|
+
}
|
|
327
|
+
`)},oy=function(){var n=parseInt(document.body.getAttribute(ps)||"0",10);return isFinite(n)?n:0},FR=function(){m.useEffect(function(){return document.body.setAttribute(ps,(oy()+1).toString()),function(){var n=oy()-1;n<=0?document.body.removeAttribute(ps):document.body.setAttribute(ps,n.toString())}},[])},QR=function(n){var l=n.noRelative,o=n.noImportant,i=n.gapMode,u=i===void 0?"margin":i;FR();var d=m.useMemo(function(){return $R(u)},[u]);return m.createElement(KR,{styles:XR(d,!l,u,o?"":"!important")})},lh=!1;if(typeof window<"u")try{var ic=Object.defineProperty({},"passive",{get:function(){return lh=!0,!0}});window.addEventListener("test",ic,ic),window.removeEventListener("test",ic,ic)}catch{lh=!1}var cs=lh?{passive:!1}:!1,ZR=function(n){return n.tagName==="TEXTAREA"},S0=function(n,l){if(!(n instanceof Element))return!1;var o=window.getComputedStyle(n);return o[l]!=="hidden"&&!(o.overflowY===o.overflowX&&!ZR(n)&&o[l]==="visible")},JR=function(n){return S0(n,"overflowY")},WR=function(n){return S0(n,"overflowX")},iy=function(n,l){var o=l.ownerDocument,i=l;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var u=w0(n,i);if(u){var d=j0(n,i),h=d[1],p=d[2];if(h>p)return!0}i=i.parentNode}while(i&&i!==o.body);return!1},eT=function(n){var l=n.scrollTop,o=n.scrollHeight,i=n.clientHeight;return[l,o,i]},tT=function(n){var l=n.scrollLeft,o=n.scrollWidth,i=n.clientWidth;return[l,o,i]},w0=function(n,l){return n==="v"?JR(l):WR(l)},j0=function(n,l){return n==="v"?eT(l):tT(l)},nT=function(n,l){return n==="h"&&l==="rtl"?-1:1},aT=function(n,l,o,i,u){var d=nT(n,window.getComputedStyle(l).direction),h=d*i,p=o.target,g=l.contains(p),v=!1,x=h>0,y=0,S=0;do{if(!p)break;var w=j0(n,p),C=w[0],E=w[1],j=w[2],R=E-j-d*C;(C||R)&&w0(n,p)&&(y+=R,S+=C);var A=p.parentNode;p=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}while(!g&&p!==document.body||g&&(l.contains(p)||l===p));return(x&&Math.abs(y)<1||!x&&Math.abs(S)<1)&&(v=!0),v},cc=function(n){return"changedTouches"in n?[n.changedTouches[0].clientX,n.changedTouches[0].clientY]:[0,0]},cy=function(n){return[n.deltaX,n.deltaY]},uy=function(n){return n&&"current"in n?n.current:n},lT=function(n,l){return n[0]===l[0]&&n[1]===l[1]},rT=function(n){return`
|
|
328
|
+
.block-interactivity-`.concat(n,` {pointer-events: none;}
|
|
329
|
+
.allow-interactivity-`).concat(n,` {pointer-events: all;}
|
|
330
|
+
`)},sT=0,us=[];function oT(n){var l=m.useRef([]),o=m.useRef([0,0]),i=m.useRef(),u=m.useState(sT++)[0],d=m.useState(b0)[0],h=m.useRef(n);m.useEffect(function(){h.current=n},[n]),m.useEffect(function(){if(n.inert){document.body.classList.add("block-interactivity-".concat(u));var E=TR([n.lockRef.current],(n.shards||[]).map(uy),!0).filter(Boolean);return E.forEach(function(j){return j.classList.add("allow-interactivity-".concat(u))}),function(){document.body.classList.remove("block-interactivity-".concat(u)),E.forEach(function(j){return j.classList.remove("allow-interactivity-".concat(u))})}}},[n.inert,n.lockRef.current,n.shards]);var p=m.useCallback(function(E,j){if("touches"in E&&E.touches.length===2||E.type==="wheel"&&E.ctrlKey)return!h.current.allowPinchZoom;var R=cc(E),A=o.current,T="deltaX"in E?E.deltaX:A[0]-R[0],D="deltaY"in E?E.deltaY:A[1]-R[1],O,M=E.target,B=Math.abs(T)>Math.abs(D)?"h":"v";if("touches"in E&&B==="h"&&M.type==="range")return!1;var z=window.getSelection(),K=z&&z.anchorNode,oe=K?K===M||K.contains(M):!1;if(oe)return!1;var X=iy(B,M);if(!X)return!0;if(X?O=B:(O=B==="v"?"h":"v",X=iy(B,M)),!X)return!1;if(!i.current&&"changedTouches"in E&&(T||D)&&(i.current=O),!O)return!0;var q=i.current||O;return aT(q,j,E,q==="h"?T:D)},[]),g=m.useCallback(function(E){var j=E;if(!(!us.length||us[us.length-1]!==d)){var R="deltaY"in j?cy(j):cc(j),A=l.current.filter(function(O){return O.name===j.type&&(O.target===j.target||j.target===O.shadowParent)&&lT(O.delta,R)})[0];if(A&&A.should){j.cancelable&&j.preventDefault();return}if(!A){var T=(h.current.shards||[]).map(uy).filter(Boolean).filter(function(O){return O.contains(j.target)}),D=T.length>0?p(j,T[0]):!h.current.noIsolation;D&&j.cancelable&&j.preventDefault()}}},[]),v=m.useCallback(function(E,j,R,A){var T={name:E,delta:j,target:R,should:A,shadowParent:iT(R)};l.current.push(T),setTimeout(function(){l.current=l.current.filter(function(D){return D!==T})},1)},[]),x=m.useCallback(function(E){o.current=cc(E),i.current=void 0},[]),y=m.useCallback(function(E){v(E.type,cy(E),E.target,p(E,n.lockRef.current))},[]),S=m.useCallback(function(E){v(E.type,cc(E),E.target,p(E,n.lockRef.current))},[]);m.useEffect(function(){return us.push(d),n.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:S}),document.addEventListener("wheel",g,cs),document.addEventListener("touchmove",g,cs),document.addEventListener("touchstart",x,cs),function(){us=us.filter(function(E){return E!==d}),document.removeEventListener("wheel",g,cs),document.removeEventListener("touchmove",g,cs),document.removeEventListener("touchstart",x,cs)}},[]);var w=n.removeScrollBar,C=n.inert;return m.createElement(m.Fragment,null,C?m.createElement(d,{styles:rT(u)}):null,w?m.createElement(QR,{noRelative:n.noRelative,gapMode:n.gapMode}):null)}function iT(n){for(var l=null;n!==null;)n instanceof ShadowRoot&&(l=n.host,n=n.host),n=n.parentNode;return l}const cT=UR(y0,oT);var Fc=m.forwardRef(function(n,l){return m.createElement(Xc,xa({},n,{ref:l,sideCar:cT}))});Fc.classNames=Xc.classNames;var uT=Object.defineProperty,dt=(n,l)=>uT(n,"name",{value:l,configurable:!0}),dT=["Enter"," "],fT=["ArrowDown","PageUp","Home"],C0=["ArrowUp","PageDown","End"],hT=[...fT,...C0],Qc="Menu",[rh,mT,pT]=Uc(Qc),[xr,E0]=yn(Qc,[pT,Ns,Kc]),Fh=Ns(),N0=Kc(),[gT,Ho]=xr(Qc),[vT,Qh]=xr(Qc),xT=dt(n=>{const{__scopeMenu:l,open:o=!1,children:i,dir:u,onOpenChange:d,modal:h=!0}=n,p=Fh(l),[g,v]=m.useState(null),x=m.useRef(!1),y=Qn(d),S=Uo(u);return m.useEffect(()=>{const w=dt(()=>{x.current=!0,document.addEventListener("pointerdown",C,{capture:!0,once:!0}),document.addEventListener("pointermove",C,{capture:!0,once:!0})},"handleKeyDown"),C=dt(()=>x.current=!1,"handlePointer");return document.addEventListener("keydown",w,{capture:!0}),()=>{document.removeEventListener("keydown",w,{capture:!0}),document.removeEventListener("pointerdown",C,{capture:!0}),document.removeEventListener("pointermove",C,{capture:!0})}},[]),m.useEffect(()=>{if(!o)return;const w=dt(()=>y(!1),"handleBlur");return window.addEventListener("blur",w),()=>window.removeEventListener("blur",w)},[o,y]),s.jsx(e0,{...p,children:s.jsx(gT,{scope:l,open:o,onOpenChange:y,content:g,onContentChange:v,children:s.jsx(vT,{scope:l,onClose:m.useCallback(()=>y(!1),[y]),isUsingKeyboardRef:x,dir:S,modal:h,children:i})})})},"Menu"),yT=m.forwardRef(dt(function(l,o){const{__scopeMenu:i,...u}=l,d=Fh(i);return s.jsx(t0,{...d,...u,ref:o})},"MenuAnchor")),R0="MenuPortal",[bT,ST]=xr(R0,{forceMount:void 0}),wT=dt(n=>{const{__scopeMenu:l,forceMount:o,children:i,container:u}=n,d=Ho(R0,l);return s.jsx(bT,{scope:l,forceMount:o,children:s.jsx(rl,{present:o||d.open,children:s.jsx(Yh,{asChild:!0,container:u,children:i})})})},"MenuPortal"),Hl="MenuContent",[jT,T0]=xr(Hl),CT=m.forwardRef(dt(function(l,o){const i=ST(Hl,l.__scopeMenu),{forceMount:u=i.forceMount,...d}=l,h=Ho(Hl,l.__scopeMenu),p=Qh(Hl,l.__scopeMenu);return s.jsx(rh.Provider,{scope:l.__scopeMenu,children:s.jsx(rl,{present:u||h.open,children:s.jsx(rh.Slot,{scope:l.__scopeMenu,children:p.modal?s.jsx(ET,{...d,ref:o}):s.jsx(NT,{...d,ref:o})})})})},"MenuContent")),ET=m.forwardRef(dt(function(l,o){const i=Ho(Hl,l.__scopeMenu),u=m.useRef(null),d=Ge(o,u);return m.useEffect(()=>{const h=u.current;if(h)return Xh(h)},[]),s.jsx(A0,{...l,ref:d,trapFocus:i.open,disableOutsidePointerEvents:i.open,disableOutsideScroll:!0,onFocusOutside:je(l.onFocusOutside,h=>h.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentModal")),NT=m.forwardRef(dt(function(l,o){const i=Ho(Hl,l.__scopeMenu);return s.jsx(A0,{...l,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentNonModal")),RT=Sa("MenuContent.ScrollLock"),A0=m.forwardRef(dt(function(l,o){const{__scopeMenu:i,loop:u=!1,trapFocus:d,onOpenAutoFocus:h,onCloseAutoFocus:p,disableOutsidePointerEvents:g,onEntryFocus:v,onEscapeKeyDown:x,onPointerDownOutside:y,onFocusOutside:S,onInteractOutside:w,onDismiss:C,disableOutsideScroll:E,...j}=l,R=Ho(Hl,i),A=Qh(Hl,i),T=Fh(i),D=N0(i),O=mT(i),[M,B]=m.useState(null),z=m.useRef(null),K=Ge(o,z,R.onContentChange),oe=m.useRef(0),X=m.useRef(""),q=m.useRef(0),le=m.useRef(null),J=m.useRef("right"),ce=m.useRef(0),U=E?Fc:m.Fragment,Y=E?{as:RT,allowPinchZoom:!0}:void 0,ae=dt(te=>{var ie,me;const _=X.current+te,P=O().filter(Ce=>!Ce.disabled),Q=document.activeElement,re=(ie=P.find(Ce=>Ce.ref.current===Q))==null?void 0:ie.textValue,fe=P.map(Ce=>Ce.textValue),be=k0(fe,_,re),G=(me=P.find(Ce=>Ce.textValue===be))==null?void 0:me.ref.current;dt((function Ce(Me){X.current=Me,window.clearTimeout(oe.current),Me!==""&&(oe.current=window.setTimeout(()=>Ce(""),1e3))}),"updateSearch")(_),G&&setTimeout(()=>G.focus())},"handleTypeaheadSearch");m.useEffect(()=>()=>window.clearTimeout(oe.current),[]),Bo();const W=m.useCallback(te=>{var P,Q;return J.current===((P=le.current)==null?void 0:P.side)&&L0(te,(Q=le.current)==null?void 0:Q.area)},[]);return s.jsx(jT,{scope:i,searchRef:X,onItemEnter:m.useCallback(te=>{W(te)&&te.preventDefault()},[W]),onItemLeave:m.useCallback(te=>{var _;W(te)||((_=z.current)==null||_.focus(),B(null))},[W]),onTriggerLeave:m.useCallback(te=>{W(te)&&te.preventDefault()},[W]),pointerGraceTimerRef:q,onPointerGraceIntentChange:m.useCallback(te=>{le.current=te},[]),children:s.jsx(U,{...Y,children:s.jsx(Lh,{asChild:!0,trapped:d,onMountAutoFocus:je(h,te=>{var _;te.preventDefault(),(_=z.current)==null||_.focus({preventScroll:!0})}),onUnmountAutoFocus:p,children:s.jsx(Bc,{asChild:!0,disableOutsidePointerEvents:g,onEscapeKeyDown:x,onPointerDownOutside:y,onFocusOutside:S,onInteractOutside:w,onDismiss:C,children:s.jsx(m0,{asChild:!0,...D,dir:A.dir,orientation:"vertical",loop:u,currentTabStopId:M,onCurrentTabStopIdChange:B,onEntryFocus:je(v,te=>{A.isUsingKeyboardRef.current||te.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(Gh,{role:"menu","aria-orientation":"vertical","data-state":M0(R.open),"data-radix-menu-content":"",dir:A.dir,...T,...j,ref:K,style:{outline:"none",...j.style},onKeyDown:je(j.onKeyDown,te=>{const P=te.target.closest("[data-radix-menu-content]")===te.currentTarget,Q=te.ctrlKey||te.altKey||te.metaKey,re=te.key.length===1;P&&(te.key==="Tab"&&te.preventDefault(),!Q&&re&&ae(te.key));const fe=z.current;if(te.target!==fe||!hT.includes(te.key))return;te.preventDefault();const G=O().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);C0.includes(te.key)&&G.reverse(),_0(G)}),onBlur:je(l.onBlur,te=>{te.currentTarget.contains(te.target)||(window.clearTimeout(oe.current),X.current="")}),onPointerMove:je(l.onPointerMove,Tc(te=>{const _=te.target,P=ce.current!==te.clientX;if(te.currentTarget.contains(_)&&P){const Q=te.clientX>ce.current?"right":"left";J.current=Q,ce.current=te.clientX}}))})})})})})})},"MenuContentImpl")),TT=m.forwardRef(dt(function(l,o){const{__scopeMenu:i,...u}=l;return s.jsx(Pe.div,{...u,ref:o})},"MenuLabel")),sh="MenuItem",dy="menu.itemSelect",AT=m.forwardRef(dt(function(l,o){const{disabled:i=!1,onSelect:u,...d}=l,h=m.useRef(null),p=Qh(sh,l.__scopeMenu),g=T0(sh,l.__scopeMenu),v=Ge(o,h),x=m.useRef(!1),y=dt(()=>{const S=h.current;if(!i&&S){const w=new CustomEvent(dy,{bubbles:!0,cancelable:!0});S.addEventListener(dy,C=>u==null?void 0:u(C),{once:!0}),_h(S,w),w.defaultPrevented?x.current=!1:p.onClose()}},"handleSelect");return s.jsx(MT,{...d,ref:v,disabled:i,onClick:je(l.onClick,y),onPointerDown:S=>{var w;(w=l.onPointerDown)==null||w.call(l,S),x.current=!0},onPointerUp:je(l.onPointerUp,S=>{var w;x.current||(w=S.currentTarget)==null||w.click()}),onKeyDown:je(l.onKeyDown,S=>{i||S.target!==S.currentTarget||g.searchRef.current!==""&&S.key===" "||dT.includes(S.key)&&(S.currentTarget.click(),S.preventDefault())})})},"MenuItem")),MT=m.forwardRef(dt(function(l,o){const{__scopeMenu:i,disabled:u=!1,textValue:d,...h}=l,p=T0(sh,i),g=N0(i),v=m.useRef(null),x=Ge(o,v),[y,S]=m.useState(!1),[w,C]=m.useState("");return m.useEffect(()=>{const E=v.current;E&&C((E.textContent??"").trim())},[h.children]),s.jsx(rh.ItemSlot,{scope:i,disabled:u,textValue:d??w,children:s.jsx(p0,{asChild:!0,...g,focusable:!u,children:s.jsx(Pe.div,{role:"menuitem","data-highlighted":y?"":void 0,"aria-disabled":u||void 0,"data-disabled":u?"":void 0,...h,ref:x,onPointerMove:je(l.onPointerMove,Tc(E=>{u?p.onItemLeave(E):(p.onItemEnter(E),E.defaultPrevented||E.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:je(l.onPointerLeave,Tc(E=>p.onItemLeave(E))),onFocus:je(l.onFocus,()=>S(!0)),onBlur:je(l.onBlur,()=>S(!1))})})})},"MenuItemImpl")),DT="MenuRadioGroup",[V_,G_]=xr(DT,{value:void 0,onValueChange:dt(()=>{},"onValueChange")}),_T="MenuItemIndicator",[Y_,$_]=xr(_T,{checked:!1}),OT=m.forwardRef(dt(function(l,o){const{__scopeMenu:i,...u}=l;return s.jsx(Pe.div,{role:"separator","aria-orientation":"horizontal",...u,ref:o})},"MenuSeparator")),kT="MenuSub",[K_,X_]=xr(kT);function M0(n){return n?"open":"closed"}dt(M0,"getOpenState");function D0(n){return n==="indeterminate"}dt(D0,"isIndeterminate");function zT(n){return D0(n)?"indeterminate":n?"checked":"unchecked"}dt(zT,"getCheckedState");function _0(n){const l=document.activeElement;for(const o of n)if(o===l||(o.focus(),document.activeElement!==l))return}dt(_0,"focusFirst");function O0(n,l){return n.map((o,i)=>n[(l+i)%n.length])}dt(O0,"wrapArray");function k0(n,l,o){const u=l.length>1&&Array.from(l).every(v=>v===l[0])?l[0]:l,d=o?n.indexOf(o):-1;let h=O0(n,Math.max(d,0));u.length===1&&(h=h.filter(v=>v!==o));const g=h.find(v=>v.toLowerCase().startsWith(u.toLowerCase()));return g!==o?g:void 0}dt(k0,"getNextMatch");function z0(n,l){const{x:o,y:i}=n;let u=!1;for(let d=0,h=l.length-1;d<l.length;h=d++){const p=l[d],g=l[h],v=p.x,x=p.y,y=g.x,S=g.y;x>i!=S>i&&o<(y-v)*(i-x)/(S-x)+v&&(u=!u)}return u}dt(z0,"isPointInPolygon");function L0(n,l){if(!l)return!1;const o={x:n.clientX,y:n.clientY};return z0(o,l)}dt(L0,"isPointerInGraceArea");function Tc(n){return l=>l.pointerType==="mouse"?n(l):void 0}dt(Tc,"whenMouse");var LT=xT,UT=yT,BT=wT,HT=CT,PT=TT,qT=AT,IT=OT,VT=Object.defineProperty,yr=(n,l)=>VT(n,"name",{value:l,configurable:!0}),Zh="DropdownMenu",[GT,F_]=yn(Zh,[E0]),br=E0(),[YT,U0]=GT(Zh),$T=yr(n=>{const{__scopeDropdownMenu:l,children:o,dir:i,open:u,defaultOpen:d,onOpenChange:h,modal:p=!0}=n,g=br(l),v=m.useRef(null),[x,y]=el({prop:u,defaultProp:d??!1,onChange:h,caller:Zh});return s.jsx(YT,{scope:l,triggerId:ba(),triggerRef:v,contentId:ba(),open:x,onOpenChange:y,onOpenToggle:m.useCallback(()=>y(S=>!S),[y]),modal:p,children:s.jsx(LT,{...g,open:x,onOpenChange:y,dir:i,modal:p,children:o})})},"DropdownMenu"),KT="DropdownMenuTrigger",XT=m.forwardRef(yr(function(l,o){const{__scopeDropdownMenu:i,disabled:u=!1,...d}=l,h=U0(KT,i),p=br(i),g=Ge(o,h.triggerRef);return s.jsx(UT,{asChild:!0,...p,children:s.jsx(Pe.button,{type:"button",id:h.triggerId,"aria-haspopup":"menu","aria-expanded":h.open,"aria-controls":h.open?h.contentId:void 0,"data-state":h.open?"open":"closed","data-disabled":u?"":void 0,disabled:u,...d,ref:g,onPointerDown:je(l.onPointerDown,v=>{!u&&v.button===0&&v.ctrlKey===!1&&(h.onOpenToggle(),h.open||v.preventDefault())}),onKeyDown:je(l.onKeyDown,v=>{u||(["Enter"," "].includes(v.key)&&h.onOpenToggle(),v.key==="ArrowDown"&&h.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(v.key)&&v.preventDefault())})})})},"DropdownMenuTrigger")),FT=yr(n=>{const{__scopeDropdownMenu:l,...o}=n,i=br(l);return s.jsx(BT,{...i,...o})},"DropdownMenuPortal"),QT="DropdownMenuContent",ZT=m.forwardRef(yr(function(l,o){const{__scopeDropdownMenu:i,...u}=l,d=U0(QT,i),h=br(i),p=m.useRef(!1);return s.jsx(HT,{id:d.contentId,"aria-labelledby":d.triggerId,...h,...u,ref:o,onCloseAutoFocus:je(l.onCloseAutoFocus,g=>{var v;p.current||(v=d.triggerRef.current)==null||v.focus(),p.current=!1,g.preventDefault()}),onInteractOutside:je(l.onInteractOutside,g=>{const v=g.detail.originalEvent,x=v.button===0&&v.ctrlKey===!0,y=v.button===2||x;(!d.modal||y)&&(p.current=!0)}),style:{...l.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),JT=m.forwardRef(yr(function(l,o){const{__scopeDropdownMenu:i,...u}=l,d=br(i);return s.jsx(PT,{...d,...u,ref:o})},"DropdownMenuLabel")),WT=m.forwardRef(yr(function(l,o){const{__scopeDropdownMenu:i,...u}=l,d=br(i);return s.jsx(qT,{...d,...u,ref:o})},"DropdownMenuItem")),eA=m.forwardRef(yr(function(l,o){const{__scopeDropdownMenu:i,...u}=l,d=br(i);return s.jsx(IT,{...d,...u,ref:o})},"DropdownMenuSeparator")),tA=$T,nA=XT,aA=FT,B0=ZT,H0=JT,P0=WT,q0=eA;const lA=tA,rA=nA,I0=m.forwardRef(({className:n,sideOffset:l=4,...o},i)=>s.jsx(aA,{children:s.jsx(B0,{ref:i,sideOffset:l,className:Ee("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",n),...o})}));I0.displayName=B0.displayName;const V0=m.forwardRef(({className:n,inset:l,...o},i)=>s.jsx(P0,{ref:i,className:Ee("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",l&&"pl-8",n),...o}));V0.displayName=P0.displayName;const sA=m.forwardRef(({className:n,...l},o)=>s.jsx(H0,{ref:o,className:Ee("px-2 py-1.5 text-sm font-semibold",n),...l}));sA.displayName=H0.displayName;const oA=m.forwardRef(({className:n,...l},o)=>s.jsx(q0,{ref:o,className:Ee("-mx-1 my-1 h-px bg-muted",n),...l}));oA.displayName=q0.displayName;function iA(){const{theme:n,setTheme:l}=vE(),{user:o,logout:i}=Th(),[u,d]=m.useState(!1),[h,p]=m.useState(null),g=Oo(),v=n==="light"?wC:n==="dark"?mC:hC;return m.useEffect(()=>{Se.get("/api/admin/update/check?force=1").then(x=>p(x)).catch(()=>{})},[]),s.jsxs("header",{className:"flex h-14 items-center justify-between border-b bg-background px-4",children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:"Admin"}),s.jsxs("div",{className:"flex items-center gap-2",children:[(h==null?void 0:h.hasUpdate)&&s.jsxs(de,{variant:"ghost",size:"sm",title:`New version available: v${h.latestVersion} — go to Settings → System to update`,onClick:()=>g("/settings?tab=system"),children:[s.jsx(nC,{className:"mr-1 h-4 w-4 text-blue-500"}),"Update v",h.latestVersion]}),s.jsx(de,{variant:"ghost",size:"icon",onClick:()=>l(n==="dark"?"light":"dark"),children:s.jsx(v,{className:"h-4 w-4"})}),s.jsxs(lA,{open:u,onOpenChange:d,children:[s.jsx(rA,{asChild:!0,children:s.jsx(de,{variant:"ghost",children:(o==null?void 0:o.username)??"admin"})}),s.jsx(I0,{align:"end",children:s.jsxs(V0,{onClick:()=>void i(),children:[s.jsx(fC,{className:"mr-2 h-4 w-4"})," Sign out"]})})]})]})]})}const Re=m.forwardRef(({className:n,type:l,...o},i)=>s.jsx("input",{type:l,className:Ee("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",n),ref:i,...o}));Re.displayName="Input";var cA=Object.defineProperty,uA=(n,l)=>cA(n,"name",{value:l,configurable:!0}),dA=m.forwardRef(uA(function(l,o){return s.jsx(Pe.label,{...l,ref:o,onMouseDown:i=>{var d;i.target.closest("button, input, select, textarea")||((d=l.onMouseDown)==null||d.call(l,i),!i.defaultPrevented&&i.detail>1&&i.preventDefault())}})},"Label")),G0=dA;const xe=m.forwardRef(({className:n,...l},o)=>s.jsx(G0,{ref:o,className:Ee("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",n),...l}));xe.displayName=G0.displayName;const Ze=m.forwardRef(({className:n,...l},o)=>s.jsx("div",{ref:o,className:Ee("rounded-lg border bg-card text-card-foreground shadow-sm",n),...l}));Ze.displayName="Card";const Je=m.forwardRef(({className:n,...l},o)=>s.jsx("div",{ref:o,className:Ee("flex flex-col space-y-1.5 p-6",n),...l}));Je.displayName="CardHeader";const We=m.forwardRef(({className:n,...l},o)=>s.jsx("h3",{ref:o,className:Ee("text-lg font-semibold leading-none tracking-tight",n),...l}));We.displayName="CardTitle";const fn=m.forwardRef(({className:n,...l},o)=>s.jsx("p",{ref:o,className:Ee("text-sm text-muted-foreground",n),...l}));fn.displayName="CardDescription";const et=m.forwardRef(({className:n,...l},o)=>s.jsx("div",{ref:o,className:Ee("p-6 pt-0",n),...l}));et.displayName="CardContent";const Y0=m.forwardRef(({className:n,...l},o)=>s.jsx("div",{ref:o,className:Ee("flex items-center p-6 pt-0",n),...l}));Y0.displayName="CardFooter";var fA=n=>{switch(n){case"success":return pA;case"info":return vA;case"warning":return gA;case"error":return xA;default:return null}},hA=Array(12).fill(0),mA=({visible:n,className:l})=>ue.createElement("div",{className:["sonner-loading-wrapper",l].filter(Boolean).join(" "),"data-visible":n},ue.createElement("div",{className:"sonner-spinner"},hA.map((o,i)=>ue.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),pA=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),gA=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ue.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),vA=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),xA=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),yA=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ue.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ue.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),bA=()=>{let[n,l]=ue.useState(document.hidden);return ue.useEffect(()=>{let o=()=>{l(document.hidden)};return document.addEventListener("visibilitychange",o),()=>window.removeEventListener("visibilitychange",o)},[]),n},oh=1,SA=class{constructor(){this.subscribe=n=>(this.subscribers.push(n),()=>{let l=this.subscribers.indexOf(n);this.subscribers.splice(l,1)}),this.publish=n=>{this.subscribers.forEach(l=>l(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n]},this.create=n=>{var l;let{message:o,...i}=n,u=typeof(n==null?void 0:n.id)=="number"||((l=n.id)==null?void 0:l.length)>0?n.id:oh++,d=this.toasts.find(p=>p.id===u),h=n.dismissible===void 0?!0:n.dismissible;return this.dismissedToasts.has(u)&&this.dismissedToasts.delete(u),d?this.toasts=this.toasts.map(p=>p.id===u?(this.publish({...p,...n,id:u,title:o}),{...p,...n,id:u,dismissible:h,title:o}):p):this.addToast({title:o,...i,dismissible:h,id:u}),u},this.dismiss=n=>(this.dismissedToasts.add(n),n||this.toasts.forEach(l=>{this.subscribers.forEach(o=>o({id:l.id,dismiss:!0}))}),this.subscribers.forEach(l=>l({id:n,dismiss:!0})),n),this.message=(n,l)=>this.create({...l,message:n}),this.error=(n,l)=>this.create({...l,message:n,type:"error"}),this.success=(n,l)=>this.create({...l,type:"success",message:n}),this.info=(n,l)=>this.create({...l,type:"info",message:n}),this.warning=(n,l)=>this.create({...l,type:"warning",message:n}),this.loading=(n,l)=>this.create({...l,type:"loading",message:n}),this.promise=(n,l)=>{if(!l)return;let o;l.loading!==void 0&&(o=this.create({...l,promise:n,type:"loading",message:l.loading,description:typeof l.description!="function"?l.description:void 0}));let i=n instanceof Promise?n:n(),u=o!==void 0,d,h=i.then(async g=>{if(d=["resolve",g],ue.isValidElement(g))u=!1,this.create({id:o,type:"default",message:g});else if(jA(g)&&!g.ok){u=!1;let v=typeof l.error=="function"?await l.error(`HTTP error! status: ${g.status}`):l.error,x=typeof l.description=="function"?await l.description(`HTTP error! status: ${g.status}`):l.description;this.create({id:o,type:"error",message:v,description:x})}else if(l.success!==void 0){u=!1;let v=typeof l.success=="function"?await l.success(g):l.success,x=typeof l.description=="function"?await l.description(g):l.description;this.create({id:o,type:"success",message:v,description:x})}}).catch(async g=>{if(d=["reject",g],l.error!==void 0){u=!1;let v=typeof l.error=="function"?await l.error(g):l.error,x=typeof l.description=="function"?await l.description(g):l.description;this.create({id:o,type:"error",message:v,description:x})}}).finally(()=>{var g;u&&(this.dismiss(o),o=void 0),(g=l.finally)==null||g.call(l)}),p=()=>new Promise((g,v)=>h.then(()=>d[0]==="reject"?v(d[1]):g(d[1])).catch(v));return typeof o!="string"&&typeof o!="number"?{unwrap:p}:Object.assign(o,{unwrap:p})},this.custom=(n,l)=>{let o=(l==null?void 0:l.id)||oh++;return this.create({jsx:n(o),id:o,...l}),o},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},dn=new SA,wA=(n,l)=>{let o=(l==null?void 0:l.id)||oh++;return dn.addToast({title:n,...l,id:o}),o},jA=n=>n&&typeof n=="object"&&"ok"in n&&typeof n.ok=="boolean"&&"status"in n&&typeof n.status=="number",CA=wA,EA=()=>dn.toasts,NA=()=>dn.getActiveToasts(),pe=Object.assign(CA,{success:dn.success,info:dn.info,warning:dn.warning,error:dn.error,custom:dn.custom,message:dn.message,promise:dn.promise,dismiss:dn.dismiss,loading:dn.loading},{getHistory:EA,getToasts:NA});function RA(n,{insertAt:l}={}){if(typeof document>"u")return;let o=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",l==="top"&&o.firstChild?o.insertBefore(i,o.firstChild):o.appendChild(i),i.styleSheet?i.styleSheet.cssText=n:i.appendChild(document.createTextNode(n))}RA(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
331
|
+
`);function uc(n){return n.label!==void 0}var TA=3,AA="32px",MA="16px",fy=4e3,DA=356,_A=14,OA=20,kA=200;function sa(...n){return n.filter(Boolean).join(" ")}function zA(n){let[l,o]=n.split("-"),i=[];return l&&i.push(l),o&&i.push(o),i}var LA=n=>{var l,o,i,u,d,h,p,g,v,x,y;let{invert:S,toast:w,unstyled:C,interacting:E,setHeights:j,visibleToasts:R,heights:A,index:T,toasts:D,expanded:O,removeToast:M,defaultRichColors:B,closeButton:z,style:K,cancelButtonStyle:oe,actionButtonStyle:X,className:q="",descriptionClassName:le="",duration:J,position:ce,gap:U,loadingIcon:Y,expandByDefault:ae,classNames:W,icons:te,closeButtonAriaLabel:_="Close toast",pauseWhenPageIsHidden:P}=n,[Q,re]=ue.useState(null),[fe,be]=ue.useState(null),[G,ie]=ue.useState(!1),[me,Ce]=ue.useState(!1),[Me,Ae]=ue.useState(!1),[Le,pt]=ue.useState(!1),[gt,se]=ue.useState(!1),[Ue,Ye]=ue.useState(0),[Ht,Ft]=ue.useState(0),bn=ue.useRef(w.duration||J||fy),ea=ue.useRef(null),Qt=ue.useRef(null),St=T===0,Sn=T+1<=R,Ct=w.type,Zt=w.dismissible!==!1,Ra=w.className||"",Ts=w.descriptionClassName||"",Yl=ue.useMemo(()=>A.findIndex(Te=>Te.toastId===w.id)||0,[A,w.id]),eu=ue.useMemo(()=>{var Te;return(Te=w.closeButton)!=null?Te:z},[w.closeButton,z]),Io=ue.useMemo(()=>w.duration||J||fy,[w.duration,J]),Ta=ue.useRef(0),Et=ue.useRef(0),ta=ue.useRef(0),Nt=ue.useRef(null),[tu,nu]=ce.split("-"),Vo=ue.useMemo(()=>A.reduce((Te,Qe,ct)=>ct>=Yl?Te:Te+Qe.height,0),[A,Yl]),$l=bA(),wr=w.invert||S,il=Ct==="loading";Et.current=ue.useMemo(()=>Yl*U+Vo,[Yl,Vo]),ue.useEffect(()=>{bn.current=Io},[Io]),ue.useEffect(()=>{ie(!0)},[]),ue.useEffect(()=>{let Te=Qt.current;if(Te){let Qe=Te.getBoundingClientRect().height;return Ft(Qe),j(ct=>[{toastId:w.id,height:Qe,position:w.position},...ct]),()=>j(ct=>ct.filter(Jt=>Jt.toastId!==w.id))}},[j,w.id]),ue.useLayoutEffect(()=>{if(!G)return;let Te=Qt.current,Qe=Te.style.height;Te.style.height="auto";let ct=Te.getBoundingClientRect().height;Te.style.height=Qe,Ft(ct),j(Jt=>Jt.find(Pt=>Pt.toastId===w.id)?Jt.map(Pt=>Pt.toastId===w.id?{...Pt,height:ct}:Pt):[{toastId:w.id,height:ct,position:w.position},...Jt])},[G,w.title,w.description,j,w.id]);let $t=ue.useCallback(()=>{Ce(!0),Ye(Et.current),j(Te=>Te.filter(Qe=>Qe.toastId!==w.id)),setTimeout(()=>{M(w)},kA)},[w,M,j,Et]);ue.useEffect(()=>{if(w.promise&&Ct==="loading"||w.duration===1/0||w.type==="loading")return;let Te;return O||E||P&&$l?(()=>{if(ta.current<Ta.current){let Qe=new Date().getTime()-Ta.current;bn.current=bn.current-Qe}ta.current=new Date().getTime()})():bn.current!==1/0&&(Ta.current=new Date().getTime(),Te=setTimeout(()=>{var Qe;(Qe=w.onAutoClose)==null||Qe.call(w,w),$t()},bn.current)),()=>clearTimeout(Te)},[O,E,w,Ct,P,$l,$t]),ue.useEffect(()=>{w.delete&&$t()},[$t,w.delete]);function jr(){var Te,Qe,ct;return te!=null&&te.loading?ue.createElement("div",{className:sa(W==null?void 0:W.loader,(Te=w==null?void 0:w.classNames)==null?void 0:Te.loader,"sonner-loader"),"data-visible":Ct==="loading"},te.loading):Y?ue.createElement("div",{className:sa(W==null?void 0:W.loader,(Qe=w==null?void 0:w.classNames)==null?void 0:Qe.loader,"sonner-loader"),"data-visible":Ct==="loading"},Y):ue.createElement(mA,{className:sa(W==null?void 0:W.loader,(ct=w==null?void 0:w.classNames)==null?void 0:ct.loader),visible:Ct==="loading"})}return ue.createElement("li",{tabIndex:0,ref:Qt,className:sa(q,Ra,W==null?void 0:W.toast,(l=w==null?void 0:w.classNames)==null?void 0:l.toast,W==null?void 0:W.default,W==null?void 0:W[Ct],(o=w==null?void 0:w.classNames)==null?void 0:o[Ct]),"data-sonner-toast":"","data-rich-colors":(i=w.richColors)!=null?i:B,"data-styled":!(w.jsx||w.unstyled||C),"data-mounted":G,"data-promise":!!w.promise,"data-swiped":gt,"data-removed":me,"data-visible":Sn,"data-y-position":tu,"data-x-position":nu,"data-index":T,"data-front":St,"data-swiping":Me,"data-dismissible":Zt,"data-type":Ct,"data-invert":wr,"data-swipe-out":Le,"data-swipe-direction":fe,"data-expanded":!!(O||ae&&G),style:{"--index":T,"--toasts-before":T,"--z-index":D.length-T,"--offset":`${me?Ue:Et.current}px`,"--initial-height":ae?"auto":`${Ht}px`,...K,...w.style},onDragEnd:()=>{Ae(!1),re(null),Nt.current=null},onPointerDown:Te=>{il||!Zt||(ea.current=new Date,Ye(Et.current),Te.target.setPointerCapture(Te.pointerId),Te.target.tagName!=="BUTTON"&&(Ae(!0),Nt.current={x:Te.clientX,y:Te.clientY}))},onPointerUp:()=>{var Te,Qe,ct,Jt;if(Le||!Zt)return;Nt.current=null;let Pt=Number(((Te=Qt.current)==null?void 0:Te.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),da=Number(((Qe=Qt.current)==null?void 0:Qe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),fa=new Date().getTime()-((ct=ea.current)==null?void 0:ct.getTime()),tn=Q==="x"?Pt:da,na=Math.abs(tn)/fa;if(Math.abs(tn)>=OA||na>.11){Ye(Et.current),(Jt=w.onDismiss)==null||Jt.call(w,w),be(Q==="x"?Pt>0?"right":"left":da>0?"down":"up"),$t(),pt(!0),se(!1);return}Ae(!1),re(null)},onPointerMove:Te=>{var Qe,ct,Jt,Pt;if(!Nt.current||!Zt||((Qe=window.getSelection())==null?void 0:Qe.toString().length)>0)return;let da=Te.clientY-Nt.current.y,fa=Te.clientX-Nt.current.x,tn=(ct=n.swipeDirections)!=null?ct:zA(ce);!Q&&(Math.abs(fa)>1||Math.abs(da)>1)&&re(Math.abs(fa)>Math.abs(da)?"x":"y");let na={x:0,y:0};Q==="y"?(tn.includes("top")||tn.includes("bottom"))&&(tn.includes("top")&&da<0||tn.includes("bottom")&&da>0)&&(na.y=da):Q==="x"&&(tn.includes("left")||tn.includes("right"))&&(tn.includes("left")&&fa<0||tn.includes("right")&&fa>0)&&(na.x=fa),(Math.abs(na.x)>0||Math.abs(na.y)>0)&&se(!0),(Jt=Qt.current)==null||Jt.style.setProperty("--swipe-amount-x",`${na.x}px`),(Pt=Qt.current)==null||Pt.style.setProperty("--swipe-amount-y",`${na.y}px`)}},eu&&!w.jsx?ue.createElement("button",{"aria-label":_,"data-disabled":il,"data-close-button":!0,onClick:il||!Zt?()=>{}:()=>{var Te;$t(),(Te=w.onDismiss)==null||Te.call(w,w)},className:sa(W==null?void 0:W.closeButton,(u=w==null?void 0:w.classNames)==null?void 0:u.closeButton)},(d=te==null?void 0:te.close)!=null?d:yA):null,w.jsx||m.isValidElement(w.title)?w.jsx?w.jsx:typeof w.title=="function"?w.title():w.title:ue.createElement(ue.Fragment,null,Ct||w.icon||w.promise?ue.createElement("div",{"data-icon":"",className:sa(W==null?void 0:W.icon,(h=w==null?void 0:w.classNames)==null?void 0:h.icon)},w.promise||w.type==="loading"&&!w.icon?w.icon||jr():null,w.type!=="loading"?w.icon||(te==null?void 0:te[Ct])||fA(Ct):null):null,ue.createElement("div",{"data-content":"",className:sa(W==null?void 0:W.content,(p=w==null?void 0:w.classNames)==null?void 0:p.content)},ue.createElement("div",{"data-title":"",className:sa(W==null?void 0:W.title,(g=w==null?void 0:w.classNames)==null?void 0:g.title)},typeof w.title=="function"?w.title():w.title),w.description?ue.createElement("div",{"data-description":"",className:sa(le,Ts,W==null?void 0:W.description,(v=w==null?void 0:w.classNames)==null?void 0:v.description)},typeof w.description=="function"?w.description():w.description):null),m.isValidElement(w.cancel)?w.cancel:w.cancel&&uc(w.cancel)?ue.createElement("button",{"data-button":!0,"data-cancel":!0,style:w.cancelButtonStyle||oe,onClick:Te=>{var Qe,ct;uc(w.cancel)&&Zt&&((ct=(Qe=w.cancel).onClick)==null||ct.call(Qe,Te),$t())},className:sa(W==null?void 0:W.cancelButton,(x=w==null?void 0:w.classNames)==null?void 0:x.cancelButton)},w.cancel.label):null,m.isValidElement(w.action)?w.action:w.action&&uc(w.action)?ue.createElement("button",{"data-button":!0,"data-action":!0,style:w.actionButtonStyle||X,onClick:Te=>{var Qe,ct;uc(w.action)&&((ct=(Qe=w.action).onClick)==null||ct.call(Qe,Te),!Te.defaultPrevented&&$t())},className:sa(W==null?void 0:W.actionButton,(y=w==null?void 0:w.classNames)==null?void 0:y.actionButton)},w.action.label):null))};function hy(){if(typeof window>"u"||typeof document>"u")return"ltr";let n=document.documentElement.getAttribute("dir");return n==="auto"||!n?window.getComputedStyle(document.documentElement).direction:n}function UA(n,l){let o={};return[n,l].forEach((i,u)=>{let d=u===1,h=d?"--mobile-offset":"--offset",p=d?MA:AA;function g(v){["top","right","bottom","left"].forEach(x=>{o[`${h}-${x}`]=typeof v=="number"?`${v}px`:v})}typeof i=="number"||typeof i=="string"?g(i):typeof i=="object"?["top","right","bottom","left"].forEach(v=>{i[v]===void 0?o[`${h}-${v}`]=p:o[`${h}-${v}`]=typeof i[v]=="number"?`${i[v]}px`:i[v]}):g(p)}),o}var BA=m.forwardRef(function(n,l){let{invert:o,position:i="bottom-right",hotkey:u=["altKey","KeyT"],expand:d,closeButton:h,className:p,offset:g,mobileOffset:v,theme:x="light",richColors:y,duration:S,style:w,visibleToasts:C=TA,toastOptions:E,dir:j=hy(),gap:R=_A,loadingIcon:A,icons:T,containerAriaLabel:D="Notifications",pauseWhenPageIsHidden:O}=n,[M,B]=ue.useState([]),z=ue.useMemo(()=>Array.from(new Set([i].concat(M.filter(P=>P.position).map(P=>P.position)))),[M,i]),[K,oe]=ue.useState([]),[X,q]=ue.useState(!1),[le,J]=ue.useState(!1),[ce,U]=ue.useState(x!=="system"?x:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Y=ue.useRef(null),ae=u.join("+").replace(/Key/g,"").replace(/Digit/g,""),W=ue.useRef(null),te=ue.useRef(!1),_=ue.useCallback(P=>{B(Q=>{var re;return(re=Q.find(fe=>fe.id===P.id))!=null&&re.delete||dn.dismiss(P.id),Q.filter(({id:fe})=>fe!==P.id)})},[]);return ue.useEffect(()=>dn.subscribe(P=>{if(P.dismiss){B(Q=>Q.map(re=>re.id===P.id?{...re,delete:!0}:re));return}setTimeout(()=>{Y2.flushSync(()=>{B(Q=>{let re=Q.findIndex(fe=>fe.id===P.id);return re!==-1?[...Q.slice(0,re),{...Q[re],...P},...Q.slice(re+1)]:[P,...Q]})})})}),[]),ue.useEffect(()=>{if(x!=="system"){U(x);return}if(x==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?U("dark"):U("light")),typeof window>"u")return;let P=window.matchMedia("(prefers-color-scheme: dark)");try{P.addEventListener("change",({matches:Q})=>{U(Q?"dark":"light")})}catch{P.addListener(({matches:re})=>{try{U(re?"dark":"light")}catch(fe){console.error(fe)}})}},[x]),ue.useEffect(()=>{M.length<=1&&q(!1)},[M]),ue.useEffect(()=>{let P=Q=>{var re,fe;u.every(be=>Q[be]||Q.code===be)&&(q(!0),(re=Y.current)==null||re.focus()),Q.code==="Escape"&&(document.activeElement===Y.current||(fe=Y.current)!=null&&fe.contains(document.activeElement))&&q(!1)};return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[u]),ue.useEffect(()=>{if(Y.current)return()=>{W.current&&(W.current.focus({preventScroll:!0}),W.current=null,te.current=!1)}},[Y.current]),ue.createElement("section",{ref:l,"aria-label":`${D} ${ae}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},z.map((P,Q)=>{var re;let[fe,be]=P.split("-");return M.length?ue.createElement("ol",{key:P,dir:j==="auto"?hy():j,tabIndex:-1,ref:Y,className:p,"data-sonner-toaster":!0,"data-theme":ce,"data-y-position":fe,"data-lifted":X&&M.length>1&&!d,"data-x-position":be,style:{"--front-toast-height":`${((re=K[0])==null?void 0:re.height)||0}px`,"--width":`${DA}px`,"--gap":`${R}px`,...w,...UA(g,v)},onBlur:G=>{te.current&&!G.currentTarget.contains(G.relatedTarget)&&(te.current=!1,W.current&&(W.current.focus({preventScroll:!0}),W.current=null))},onFocus:G=>{G.target instanceof HTMLElement&&G.target.dataset.dismissible==="false"||te.current||(te.current=!0,W.current=G.relatedTarget)},onMouseEnter:()=>q(!0),onMouseMove:()=>q(!0),onMouseLeave:()=>{le||q(!1)},onDragEnd:()=>q(!1),onPointerDown:G=>{G.target instanceof HTMLElement&&G.target.dataset.dismissible==="false"||J(!0)},onPointerUp:()=>J(!1)},M.filter(G=>!G.position&&Q===0||G.position===P).map((G,ie)=>{var me,Ce;return ue.createElement(LA,{key:G.id,icons:T,index:ie,toast:G,defaultRichColors:y,duration:(me=E==null?void 0:E.duration)!=null?me:S,className:E==null?void 0:E.className,descriptionClassName:E==null?void 0:E.descriptionClassName,invert:o,visibleToasts:C,closeButton:(Ce=E==null?void 0:E.closeButton)!=null?Ce:h,interacting:le,position:P,style:E==null?void 0:E.style,unstyled:E==null?void 0:E.unstyled,classNames:E==null?void 0:E.classNames,cancelButtonStyle:E==null?void 0:E.cancelButtonStyle,actionButtonStyle:E==null?void 0:E.actionButtonStyle,removeToast:_,toasts:M.filter(Me=>Me.position==G.position),heights:K.filter(Me=>Me.position==G.position),setHeights:oe,expandByDefault:d,gap:R,loadingIcon:A,expanded:X,pauseWhenPageIsHidden:O,swipeDirections:n.swipeDirections})})):null}))});function HA(){const{login:n}=Th(),[l,o]=m.useState("admin"),[i,u]=m.useState(""),[d,h]=m.useState(""),[p,g]=m.useState(""),[v,x]=m.useState(!1),[y,S]=m.useState(!1),w=Oo(),C=xn();return s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:s.jsxs(Ze,{className:"w-full max-w-sm",children:[s.jsxs(Je,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("img",{src:"/logo.png",alt:"LateDev Router",className:"h-8 w-8 object-contain"}),s.jsx(We,{children:"Sign in"})]}),s.jsx(fn,{children:"Enter your admin credentials."})]}),s.jsxs(et,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(xe,{children:"Username"}),s.jsx(Re,{value:l,onChange:E=>o(E.target.value),autoFocus:!0})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(xe,{children:"Password"}),s.jsx(Re,{type:"password",value:i,onChange:E=>u(E.target.value)})]}),v&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(xe,{children:"2FA code (or recovery code)"}),s.jsx(Re,{value:d,onChange:E=>h(E.target.value),placeholder:"123456",maxLength:6})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(xe,{children:"Recovery code (alternative)"}),s.jsx(Re,{value:p,onChange:E=>g(E.target.value),placeholder:"ABCD12-EF3456"})]})]})]}),s.jsx("div",{className:"px-6 pb-6",children:s.jsx(de,{className:"w-full",disabled:y,onClick:async()=>{var E,j;S(!0);try{if((await n(l,i,d||void 0,p||void 0)).totpRequired){x(!0);return}const A=((j=(E=C.state)==null?void 0:E.from)==null?void 0:j.pathname)??"/";w(A,{replace:!0})}catch(R){pe.error(R.message)}finally{S(!1)}},children:"Sign in"})})]})})}function PA(){const[n,l]=m.useState("admin"),[o,i]=m.useState(""),[u,d]=m.useState(""),[h,p]=m.useState(!1),[g,v]=m.useState(!0),[x,y]=m.useState(null),[S,w]=m.useState(""),[C,E]=m.useState(!1);m.useEffect(()=>{Se.get("/api/admin/setup/status").then(A=>v(!A.masterKeyConfigured)).catch(()=>v(!0))},[]);const j=!g||u.trim().length>=32,R=!h&&o.length>=12&&j;return s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:s.jsxs(Ze,{className:"w-full max-w-md",children:[s.jsxs(Je,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("img",{src:"/logo.png",alt:"LateDev Router",className:"h-8 w-8 object-contain rounded"}),s.jsx(We,{children:"Welcome to LateDev Router"})]}),s.jsx(fn,{children:"Set up the administrator account to get started."})]}),s.jsxs(et,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(xe,{children:"Username"}),s.jsx(Re,{value:n,onChange:A=>l(A.target.value)})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(xe,{children:"Password (12+ chars)"}),s.jsx(Re,{type:"password",value:o,onChange:A=>i(A.target.value)})]}),g&&s.jsxs("div",{className:"space-y-1",children:[s.jsx(xe,{children:"Master encryption key (required, 32+ chars)"}),s.jsx(Re,{type:"password",value:u,onChange:A=>d(A.target.value),placeholder:"Paste or generate a 32+ character key"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Provider API keys are encrypted with this key (AES-256-GCM). Store it somewhere safe — if it is lost, stored provider credentials cannot be recovered. Generate one with:"," ",s.jsx("code",{className:"break-all",children:`node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"`})]})]})]}),s.jsxs(Y0,{className:"flex-col items-stretch gap-4",children:[s.jsx(de,{disabled:!R,onClick:async()=>{p(!0);try{await Se.post("/api/admin/setup",{username:n,password:o,setupMasterKey:g?u.trim():void 0}),pe.success("Admin account created"),window.location.assign("/login")}catch(A){pe.error(A.message)}finally{p(!1)}},children:"Create admin"}),s.jsxs("div",{className:"border-t pt-4 space-y-2",children:[s.jsx(xe,{children:"Import existing database"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Use this to restore the administrator account, password, TOTP settings, providers, models, and master key from a backup without setting up again. Enter the same 6-digit backup passphrase used when the file was created."}),s.jsx(Re,{type:"file",accept:".json,application/json",onChange:A=>{var T;return y(((T=A.target.files)==null?void 0:T[0])??null)}}),s.jsx(Re,{inputMode:"numeric",maxLength:6,value:S,onChange:A=>w(A.target.value.replace(/\D/g,"")),placeholder:"Backup passphrase (6 digits)"}),s.jsx(de,{variant:"outline",disabled:!x||S.length!==6||C,onClick:async()=>{var A,T;if(x){E(!0);try{const D=JSON.parse(await x.text()),O=await fetch("/api/admin/backup/restore",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({backup:D,passphrase:S})});if(!O.ok)throw new Error(((T=(A=await O.json())==null?void 0:A.error)==null?void 0:T.message)??"Import failed");pe.success("Database imported"),window.location.assign("/login")}catch(D){pe.error(D.message)}finally{E(!1)}}},children:"Import database"})]})]})]})})}function Na({title:n,description:l,actions:o,className:i}){return s.jsxs("div",{className:Ee("mb-6 flex items-start justify-between gap-4",i),children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:n}),l&&s.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:l})]}),o&&s.jsx("div",{className:"flex items-center gap-2",children:o})]})}const qA=pb("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",success:"border-transparent bg-emerald-600 text-white",warning:"border-transparent bg-amber-500 text-white",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function at({className:n,variant:l,...o}){return s.jsx("div",{className:Ee(qA({variant:l}),n),...o})}function IA(){const[n,l]=m.useState(null);return m.useEffect(()=>{Se.get("/api/admin/dashboard").then(l).catch(()=>l(null))},[]),n?s.jsxs("div",{children:[s.jsx(Na,{title:"Dashboard",description:"Operational summary for today",actions:s.jsxs("div",{className:"flex gap-2",children:[s.jsx(de,{asChild:!0,variant:"outline",size:"sm",children:s.jsxs(fr,{to:"/providers",children:[s.jsx(zo,{className:"mr-1 h-4 w-4"})," Provider"]})}),s.jsx(de,{asChild:!0,variant:"outline",size:"sm",children:s.jsxs(fr,{to:"/combos",children:[s.jsx(Jy,{className:"mr-1 h-4 w-4"})," Combo"]})}),s.jsx(de,{asChild:!0,variant:"outline",size:"sm",children:s.jsxs(fr,{to:"/api-keys",children:[s.jsx(Zy,{className:"mr-1 h-4 w-4"})," API Key"]})})]})}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[s.jsxs(Ze,{children:[s.jsx(Je,{className:"pb-1",children:s.jsx(We,{className:"text-sm text-muted-foreground",children:"Requests today"})}),s.jsx(et,{className:"text-2xl font-semibold",children:Ot(n.today.total)})]}),s.jsxs(Ze,{children:[s.jsx(Je,{className:"pb-1",children:s.jsx(We,{className:"text-sm text-muted-foreground",children:"Success rate"})}),s.jsx(et,{className:"text-2xl font-semibold",children:n.today.total?Lc(n.today.success/n.today.total):"—"})]}),s.jsxs(Ze,{children:[s.jsx(Je,{className:"pb-1",children:s.jsx(We,{className:"text-sm text-muted-foreground",children:"Failed"})}),s.jsx(et,{className:"text-2xl font-semibold",children:Ot(n.today.failed)})]}),s.jsxs(Ze,{children:[s.jsx(Je,{className:"pb-1",children:s.jsx(We,{className:"text-sm text-muted-foreground",children:"Tokens today"})}),s.jsx(et,{className:"text-2xl font-semibold",children:Ot(n.today.totalTokens)})]})]}),s.jsxs("div",{className:"mt-6 grid gap-4 lg:grid-cols-2",children:[s.jsxs(Ze,{children:[s.jsxs(Je,{children:[s.jsx(We,{className:"text-base",children:"Provider health"}),s.jsxs(fn,{children:[n.providers.length," configured"]})]}),s.jsxs(et,{className:"space-y-2",children:[n.providers.length===0&&s.jsxs("p",{className:"text-sm text-muted-foreground",children:["No providers yet. ",s.jsx(fr,{to:"/providers",className:"text-primary",children:"Add one"}),"."]}),n.providers.map(o=>s.jsxs("div",{className:"flex items-center justify-between rounded border p-2 text-sm",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Wy,{className:"h-4 w-4 text-muted-foreground"}),s.jsx("span",{className:"font-medium",children:o.name}),s.jsx("span",{className:"text-xs text-muted-foreground",children:o.slug}),s.jsx(at,{variant:"outline",className:"ml-2",children:o.type})]}),s.jsx(at,{variant:o.health==="healthy"?"success":o.health==="down"?"destructive":"secondary",children:o.health})]},o.id))]})]}),s.jsxs(Ze,{children:[s.jsxs(Je,{children:[s.jsx(We,{className:"text-base",children:"Recent failures"}),s.jsx(fn,{children:"Today"})]}),s.jsxs(et,{className:"space-y-1 text-sm",children:[n.recentFailures.length===0&&s.jsx("p",{className:"text-muted-foreground",children:"No failures today."}),n.recentFailures.map(o=>{var i;return s.jsxs("div",{className:"flex items-center justify-between border-b py-1 last:border-0",children:[s.jsxs("div",{children:[s.jsx("span",{className:"font-mono text-xs",children:o.requestedModel}),s.jsxs("div",{className:"text-xs text-muted-foreground",children:[o.errorType??`HTTP ${o.httpStatus}`," — ",(i=o.errorMessage)==null?void 0:i.slice(0,60)]})]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:Mh(o.createdAt)})]},o.id)})]})]})]})]}):s.jsx("div",{className:"text-muted-foreground",children:"Loading…"})}const Zn=m.forwardRef(({className:n,...l},o)=>s.jsx("div",{className:"relative w-full overflow-auto",children:s.jsx("table",{ref:o,className:Ee("w-full caption-bottom text-sm",n),...l})}));Zn.displayName="Table";const Jn=m.forwardRef(({className:n,...l},o)=>s.jsx("thead",{ref:o,className:Ee("[&_tr]:border-b",n),...l}));Jn.displayName="TableHeader";const Wn=m.forwardRef(({className:n,...l},o)=>s.jsx("tbody",{ref:o,className:Ee("[&_tr:last-child]:border-0",n),...l}));Wn.displayName="TableBody";const Xe=m.forwardRef(({className:n,...l},o)=>s.jsx("tr",{ref:o,className:Ee("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",n),...l}));Xe.displayName="TableRow";const ge=m.forwardRef(({className:n,...l},o)=>s.jsx("th",{ref:o,className:Ee("h-10 px-2 text-left align-middle font-medium text-muted-foreground",n),...l}));ge.displayName="TableHead";const he=m.forwardRef(({className:n,...l},o)=>s.jsx("td",{ref:o,className:Ee("p-2 align-middle",n),...l}));he.displayName="TableCell";var VA=Object.defineProperty,zn=(n,l)=>VA(n,"name",{value:l,configurable:!0}),Jh="Dialog",[$0,K0]=yn(Jh),[GA,ua]=$0(Jh),X0=zn(n=>{const{__scopeDialog:l,children:o,open:i,defaultOpen:u,onOpenChange:d,modal:h=!0}=n,p=m.useRef(null),g=m.useRef(null),[v,x]=el({prop:i,defaultProp:u??!1,onChange:d,caller:Jh}),[y,S]=m.useState(0),[w,C]=m.useState(0);return s.jsx(GA,{scope:l,triggerRef:p,contentRef:g,contentId:ba(),titleId:ba(),descriptionId:ba(),titlePresent:y>0,descriptionPresent:w>0,setTitleCount:S,setDescriptionCount:C,open:v,onOpenChange:x,onOpenToggle:m.useCallback(()=>x(E=>!E),[x]),modal:h,children:o})},"Dialog"),YA="DialogTrigger",F0=m.forwardRef(zn(function(l,o){const{__scopeDialog:i,...u}=l,d=ua(YA,i),h=Ge(o,d.triggerRef);return s.jsx(Pe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":d.open,"aria-controls":d.open?d.contentId:void 0,"data-state":Zc(d.open),...u,ref:h,onClick:je(l.onClick,d.onOpenToggle)})},"DialogTrigger")),Q0="DialogPortal",[$A,Z0]=$0(Q0,{forceMount:void 0}),J0=zn(n=>{const{__scopeDialog:l,forceMount:o,children:i,container:u}=n,d=ua(Q0,l);return s.jsx($A,{scope:l,forceMount:o,children:m.Children.map(i,h=>s.jsx(rl,{present:o||d.open,children:s.jsx(Yh,{asChild:!0,container:u,children:h})}))})},"DialogPortal"),ih="DialogOverlay",Wh=m.forwardRef(zn(function(l,o){const i=Z0(ih,l.__scopeDialog),{forceMount:u=i.forceMount,...d}=l,h=ua(ih,l.__scopeDialog);return h.modal?s.jsx(rl,{present:u||h.open,children:s.jsx(XA,{...d,ref:o})}):null},"DialogOverlay")),KA=Sa("DialogOverlay.RemoveScroll"),XA=m.forwardRef(zn(function(l,o){const{__scopeDialog:i,...u}=l,d=ua(ih,i),h=Ab(),p=Ge(o,h);return s.jsx(Fc,{as:KA,allowPinchZoom:!0,shards:[d.contentRef],children:s.jsx(Pe.div,{"data-state":Zc(d.open),...u,ref:p,style:{pointerEvents:"auto",...u.style}})})},"DialogOverlayImpl")),Ao="DialogContent",em=m.forwardRef(zn(function(l,o){const i=Z0(Ao,l.__scopeDialog),{forceMount:u=i.forceMount,...d}=l,h=ua(Ao,l.__scopeDialog);return s.jsx(rl,{present:u||h.open,children:h.modal?s.jsx(FA,{...d,ref:o}):s.jsx(QA,{...d,ref:o})})},"DialogContent")),FA=m.forwardRef(zn(function(l,o){const i=ua(Ao,l.__scopeDialog),u=m.useRef(null),d=Ge(o,i.contentRef,u);return m.useEffect(()=>{const h=u.current;if(h)return Xh(h)},[]),s.jsx(W0,{...l,ref:d,trapFocus:i.open,disableOutsidePointerEvents:i.open,onCloseAutoFocus:je(l.onCloseAutoFocus,h=>{var p;h.preventDefault(),(p=i.triggerRef.current)==null||p.focus()}),onPointerDownOutside:je(l.onPointerDownOutside,h=>{const p=h.detail.originalEvent,g=p.button===0&&p.ctrlKey===!0;(p.button===2||g)&&h.preventDefault()}),onFocusOutside:je(l.onFocusOutside,h=>h.preventDefault())})},"DialogContentModal")),QA=m.forwardRef(zn(function(l,o){const i=ua(Ao,l.__scopeDialog),u=m.useRef(!1),d=m.useRef(!1);return s.jsx(W0,{...l,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:h=>{var p,g;(p=l.onCloseAutoFocus)==null||p.call(l,h),h.defaultPrevented||(u.current||(g=i.triggerRef.current)==null||g.focus(),h.preventDefault()),u.current=!1,d.current=!1},onInteractOutside:h=>{var v,x;(v=l.onInteractOutside)==null||v.call(l,h),h.defaultPrevented||(u.current=!0,h.detail.originalEvent.type==="pointerdown"&&(d.current=!0));const p=h.target;((x=i.triggerRef.current)==null?void 0:x.contains(p))&&h.preventDefault(),h.detail.originalEvent.type==="focusin"&&d.current&&h.preventDefault()}})},"DialogContentNonModal")),W0=m.forwardRef(zn(function(l,o){const{__scopeDialog:i,trapFocus:u,onOpenAutoFocus:d,onCloseAutoFocus:h,...p}=l,g=ua(Ao,i);return Bo(),s.jsx(s.Fragment,{children:s.jsx(Lh,{asChild:!0,loop:!0,trapped:u,onMountAutoFocus:d,onUnmountAutoFocus:h,children:s.jsx(Bc,{role:"dialog",id:g.contentId,"aria-describedby":g.descriptionPresent?g.descriptionId:void 0,"aria-labelledby":g.titlePresent?g.titleId:void 0,"data-state":Zc(g.open),...p,ref:o,deferPointerDownOutside:!0,onDismiss:()=>g.onOpenChange(!1)})})})},"DialogContentImpl")),ZA="DialogTitle",tm=m.forwardRef(zn(function(l,o){const{__scopeDialog:i,...u}=l,d=ua(ZA,i),{setTitleCount:h}=d;return kt(()=>(h(p=>p+1),()=>h(p=>p-1)),[h]),s.jsx(Pe.h2,{id:d.titleId,...u,ref:o})},"DialogTitle")),JA="DialogDescription",nm=m.forwardRef(zn(function(l,o){const{__scopeDialog:i,...u}=l,d=ua(JA,i),{setDescriptionCount:h}=d;return kt(()=>(h(p=>p+1),()=>h(p=>p-1)),[h]),s.jsx(Pe.p,{id:d.descriptionId,...u,ref:o})},"DialogDescription")),WA="DialogClose",am=m.forwardRef(zn(function(l,o){const{__scopeDialog:i,...u}=l,d=ua(WA,i);return s.jsx(Pe.button,{type:"button",...u,ref:o,onClick:je(l.onClick,()=>d.onOpenChange(!1))})},"DialogClose"));function Zc(n){return n?"open":"closed"}zn(Zc,"getState");const Mn=X0,Po=F0,eM=J0,e1=m.forwardRef(({className:n,...l},o)=>s.jsx(Wh,{ref:o,className:Ee("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",n),...l}));e1.displayName=Wh.displayName;const hn=m.forwardRef(({className:n,children:l,...o},i)=>s.jsxs(eM,{children:[s.jsx(e1,{}),s.jsxs(em,{ref:i,className:Ee("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 sm:rounded-lg",n),...o,children:[l,s.jsxs(am,{className:"absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100",children:[s.jsx(zc,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));hn.displayName=em.displayName;const mn=({className:n,...l})=>s.jsx("div",{className:Ee("flex flex-col space-y-1.5 text-center sm:text-left",n),...l});mn.displayName="DialogHeader";const Dn=({className:n,...l})=>s.jsx("div",{className:Ee("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...l});Dn.displayName="DialogFooter";const pn=m.forwardRef(({className:n,...l},o)=>s.jsx(tm,{ref:o,className:Ee("text-lg font-semibold leading-none tracking-tight",n),...l}));pn.displayName=tm.displayName;const ch=m.forwardRef(({className:n,...l},o)=>s.jsx(nm,{ref:o,className:Ee("text-sm text-muted-foreground",n),...l}));ch.displayName=nm.displayName;var tM=Object.defineProperty,sl=(n,l)=>tM(n,"name",{value:l,configurable:!0}),nM="AlertDialog",[aM,Q_]=yn(nM,[K0]),ol=K0(),lM=sl(n=>{const{__scopeAlertDialog:l,...o}=n,i=ol(l);return s.jsx(X0,{...i,...o,modal:!0})},"AlertDialog"),rM=m.forwardRef(sl(function(l,o){const{__scopeAlertDialog:i,...u}=l,d=ol(i);return s.jsx(F0,{...d,...u,ref:o})},"AlertDialogTrigger")),sM=sl(n=>{const{__scopeAlertDialog:l,...o}=n,i=ol(l);return s.jsx(J0,{...i,...o})},"AlertDialogPortal"),oM=m.forwardRef(sl(function(l,o){const{__scopeAlertDialog:i,...u}=l,d=ol(i);return s.jsx(Wh,{...d,...u,ref:o})},"AlertDialogOverlay")),iM="AlertDialogContent",[cM,uM]=aM(iM),dM=m.forwardRef(sl(function(l,o){const{__scopeAlertDialog:i,children:u,...d}=l,h=ol(i),p=m.useRef(null),g=Ge(o,p),v=m.useRef(null);return s.jsx(cM,{scope:i,cancelRef:v,children:s.jsx(em,{role:"alertdialog",...h,...d,ref:g,onOpenAutoFocus:je(d.onOpenAutoFocus,x=>{var y;x.preventDefault(),(y=v.current)==null||y.focus({preventScroll:!0})}),onPointerDownOutside:x=>x.preventDefault(),onInteractOutside:x=>x.preventDefault(),children:u})})},"AlertDialogContent")),fM=m.forwardRef(sl(function(l,o){const{__scopeAlertDialog:i,...u}=l,d=ol(i);return s.jsx(tm,{...d,...u,ref:o})},"AlertDialogTitle")),hM=m.forwardRef(sl(function(l,o){const{__scopeAlertDialog:i,...u}=l,d=ol(i);return s.jsx(nm,{...d,...u,ref:o})},"AlertDialogDescription")),mM=m.forwardRef(sl(function(l,o){const{__scopeAlertDialog:i,...u}=l,d=ol(i);return s.jsx(am,{...d,...u,ref:o})},"AlertDialogAction")),pM="AlertDialogCancel",gM=m.forwardRef(sl(function(l,o){const{__scopeAlertDialog:i,...u}=l,{cancelRef:d}=uM(pM,i),h=ol(i),p=Ge(o,d);return s.jsx(am,{...h,...u,ref:p})},"AlertDialogCancel")),vM=lM,xM=rM,yM=sM,t1=oM,n1=dM,a1=mM,l1=gM,r1=fM,s1=hM;const o1=vM,bM=xM,SM=yM,i1=m.forwardRef(({className:n,...l},o)=>s.jsx(t1,{ref:o,className:Ee("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",n),...l}));i1.displayName=t1.displayName;const lm=m.forwardRef(({className:n,...l},o)=>s.jsxs(SM,{children:[s.jsx(i1,{}),s.jsx(n1,{ref:o,className:Ee("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg sm:max-w-[425px]",n),...l})]}));lm.displayName=n1.displayName;const c1=({className:n,...l})=>s.jsx("div",{className:Ee("flex flex-col space-y-2 text-center sm:text-left",n),...l}),u1=({className:n,...l})=>s.jsx("div",{className:Ee("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...l}),rm=m.forwardRef(({className:n,...l},o)=>s.jsx(r1,{ref:o,className:Ee("text-lg font-semibold",n),...l}));rm.displayName=r1.displayName;const sm=m.forwardRef(({className:n,...l},o)=>s.jsx(s1,{ref:o,className:Ee("text-sm text-muted-foreground",n),...l}));sm.displayName=s1.displayName;const om=m.forwardRef(({className:n,...l},o)=>s.jsx(a1,{ref:o,className:Ee("inline-flex h-9 items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90",n),...l}));om.displayName=a1.displayName;const im=m.forwardRef(({className:n,...l},o)=>s.jsx(l1,{ref:o,className:Ee("inline-flex h-9 items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium hover:bg-accent",n),...l}));im.displayName=l1.displayName;var wM=Object.defineProperty,jM=(n,l)=>wM(n,"name",{value:l,configurable:!0});function uh(n,[l,o]){return Math.min(o,Math.max(l,n))}jM(uh,"clamp");var CM=Object.defineProperty,EM=(n,l)=>CM(n,"name",{value:l,configurable:!0});function d1(n){const l=m.useRef({value:n,previous:n});return m.useMemo(()=>(l.current.value!==n&&(l.current.previous=l.current.value,l.current.value=n),l.current.previous),[n])}EM(d1,"usePrevious");var NM=Object.defineProperty,RM=(n,l)=>NM(n,"name",{value:l,configurable:!0}),f1=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),TM=m.forwardRef(RM(function(l,o){return s.jsx(Pe.span,{...l,ref:o,style:{...f1,...l.style}})},"VisuallyHidden")),AM=TM,MM=Object.defineProperty,it=(n,l)=>MM(n,"name",{value:l,configurable:!0}),DM=[" ","Enter","ArrowUp","ArrowDown"],_M=[" ","Enter"],gs="Select",[Jc,cm,OM]=Uc(gs),[Sr,Z_]=yn(gs,[OM,Ns]),um=Ns(),[kM,Gl]=Sr(gs),[zM,LM]=Sr(gs);function h1(n){const{__scopeSelect:l,children:o,open:i,defaultOpen:u,onOpenChange:d,value:h,defaultValue:p,onValueChange:g,dir:v,name:x,autoComplete:y,disabled:S,required:w,form:C,internal_do_not_use_render:E}=n,j=um(l),[R,A]=m.useState(null),[T,D]=m.useState(null),[O,M]=m.useState(!1),B=Uo(v),[z,K]=el({prop:i,defaultProp:u??!1,onChange:d,caller:gs}),[oe,X]=el({prop:h,defaultProp:p,onChange:g,caller:gs}),q=m.useRef(null),le=m.useRef(oe);m.useEffect(()=>{const P=C?R==null?void 0:R.ownerDocument.getElementById(C):R==null?void 0:R.form;if(P instanceof HTMLFormElement){const Q=it(()=>X(le.current),"reset");return P.addEventListener("reset",Q),()=>P.removeEventListener("reset",Q)}},[C,R,X]);const J=R?!!C||!!R.closest("form"):!0,[ce,U]=m.useState(new Set),Y=ba(),ae=Array.from(ce).map(P=>P.props.value).join(";"),W=m.useCallback(P=>{U(Q=>new Set(Q).add(P))},[]),te=m.useCallback(P=>{U(Q=>{const re=new Set(Q);return re.delete(P),re})},[]),_={required:w,trigger:R,onTriggerChange:A,valueNode:T,onValueNodeChange:D,valueNodeHasChildren:O,onValueNodeHasChildrenChange:M,contentId:Y,value:oe,onValueChange:X,open:z,onOpenChange:K,dir:B,triggerPointerDownPosRef:q,disabled:S,name:x,autoComplete:y,form:C,nativeOptions:ce,nativeSelectKey:ae,isFormControl:J};return s.jsx(e0,{...j,children:s.jsx(kM,{scope:l,..._,children:s.jsx(Jc.Provider,{scope:l,children:s.jsx(zM,{scope:l,onNativeOptionAdd:W,onNativeOptionRemove:te,children:y1(E)?E(_):o})})})})}it(h1,"SelectProvider");var UM=it(n=>{const{__scopeSelect:l,children:o,...i}=n;return s.jsx(h1,{__scopeSelect:l,...i,internal_do_not_use_render:({isFormControl:u})=>s.jsxs(s.Fragment,{children:[o,u?s.jsx(rD,{__scopeSelect:l}):null]})})},"Select"),BM="SelectTrigger",m1=m.forwardRef(it(function(l,o){const{__scopeSelect:i,disabled:u=!1,...d}=l,h=um(i),p=Gl(BM,i),g=p.disabled||u,v=Ge(o,p.onTriggerChange),x=cm(i),y=m.useRef("touch"),[S,w,C]=dm(j=>{const R=x().filter(D=>!D.disabled),A=R.find(D=>D.value===p.value),T=fm(R,j,A);T!==void 0&&p.onValueChange(T.value)}),E=it(j=>{g||(p.onOpenChange(!0),C()),j&&(p.triggerPointerDownPosRef.current={x:Math.round(j.pageX),y:Math.round(j.pageY)})},"handleOpen");return s.jsx(t0,{asChild:!0,...h,children:s.jsx(Pe.button,{type:"button",role:"combobox","aria-controls":p.open?p.contentId:void 0,"aria-expanded":p.open,"aria-required":p.required,"aria-autocomplete":"none",dir:p.dir,"data-state":p.open?"open":"closed",disabled:g,"data-disabled":g?"":void 0,"data-placeholder":qo(p.value)?"":void 0,...d,ref:v,onClick:je(d.onClick,j=>{j.currentTarget.focus(),y.current!=="mouse"&&E(j)}),onPointerDown:je(d.onPointerDown,j=>{y.current=j.pointerType;const R=j.target;R.hasPointerCapture(j.pointerId)&&R.releasePointerCapture(j.pointerId),j.button===0&&j.ctrlKey===!1&&j.pointerType==="mouse"&&(E(j),j.preventDefault())}),onKeyDown:je(d.onKeyDown,j=>{const R=S.current!=="";!(j.ctrlKey||j.altKey||j.metaKey)&&j.key.length===1&&w(j.key),!(R&&j.key===" ")&&DM.includes(j.key)&&(E(),j.preventDefault())})})})},"SelectTrigger")),HM="SelectValue",PM=m.forwardRef(it(function(l,o){const{__scopeSelect:i,className:u,style:d,children:h,placeholder:p="",...g}=l,v=Gl(HM,i),{onValueNodeHasChildrenChange:x}=v,y=h!==void 0,S=Ge(o,v.onValueNodeChange);kt(()=>{x(y)},[x,y]);const w=qo(v.value);return s.jsx(Pe.span,{...g,asChild:w?!1:g.asChild,ref:S,style:{pointerEvents:"none"},children:s.jsx(m.Fragment,{children:w?p:h},w?"placeholder":"value")})},"SelectValue")),qM=m.forwardRef(it(function(l,o){const{__scopeSelect:i,children:u,...d}=l;return s.jsx(Pe.span,{"aria-hidden":!0,...d,ref:o,children:u||"▼"})},"SelectIcon")),IM="SelectPortal",[VM,GM]=Sr(IM,{forceMount:void 0}),YM=it(n=>{const{__scopeSelect:l,forceMount:o,...i}=n;return s.jsx(VM,{scope:n.__scopeSelect,forceMount:o,children:s.jsx(Yh,{asChild:!0,...i})})},"SelectPortal"),gr="SelectContent",p1=m.forwardRef(it(function(l,o){const i=GM(gr,l.__scopeSelect),{forceMount:u=i.forceMount,...d}=l,h=Gl(gr,l.__scopeSelect),[p,g]=m.useState();return kt(()=>{g(new DocumentFragment)},[]),s.jsx(rl,{present:u||h.open,children:({present:v})=>v?s.jsx(XM,{...d,ref:o}):s.jsx($M,{...d,fragment:p})})},"SelectContent")),$M=m.forwardRef(it(function(l,o){const{__scopeSelect:i,children:u,fragment:d}=l;return d?Ss.createPortal(s.jsx(g1,{scope:i,children:s.jsx(Jc.Slot,{scope:i,children:s.jsx("div",{ref:o,children:u})})}),d):null},"SelectContentFragment")),oa=10,[g1,Wc]=Sr(gr),KM=Sa("SelectContent.RemoveScroll"),XM=m.forwardRef(it(function(l,o){const{__scopeSelect:i}=l,{position:u="item-aligned",onCloseAutoFocus:d,onEscapeKeyDown:h,onPointerDownOutside:p,side:g,sideOffset:v,align:x,alignOffset:y,arrowPadding:S,collisionBoundary:w,collisionPadding:C,sticky:E,hideWhenDetached:j,avoidCollisions:R,...A}=l,T=Gl(gr,i),[D,O]=m.useState(null),[M,B]=m.useState(null),z=Ge(o,O),[K,oe]=m.useState(null),[X,q]=m.useState(null),le=cm(i),[J,ce]=m.useState(!1),U=m.useRef(!1);m.useEffect(()=>{if(D)return Xh(D)},[D]),Bo();const Y=m.useCallback(ie=>{const[me,...Ce]=le().map(Le=>Le.ref.current),[Me]=Ce.slice(-1),Ae=document.activeElement;for(const Le of ie)if(Le===Ae||(Le==null||Le.scrollIntoView({block:"nearest"}),Le===me&&M&&(M.scrollTop=0),Le===Me&&M&&(M.scrollTop=M.scrollHeight),Le==null||Le.focus(),document.activeElement!==Ae))return},[le,M]),ae=m.useCallback(()=>Y([K,D]),[Y,K,D]);m.useEffect(()=>{J&&ae()},[J,ae]);const{onOpenChange:W,triggerPointerDownPosRef:te}=T;m.useEffect(()=>{if(D){let ie={x:0,y:0};const me=it(Me=>{var Ae,Le;ie={x:Math.abs(Math.round(Me.pageX)-(((Ae=te.current)==null?void 0:Ae.x)??0)),y:Math.abs(Math.round(Me.pageY)-(((Le=te.current)==null?void 0:Le.y)??0))}},"handlePointerMove"),Ce=it(Me=>{ie.x<=10&&ie.y<=10?Me.preventDefault():Me.composedPath().includes(D)||W(!1),document.removeEventListener("pointermove",me),te.current=null},"handlePointerUp");return te.current!==null&&(document.addEventListener("pointermove",me),document.addEventListener("pointerup",Ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",me),document.removeEventListener("pointerup",Ce,{capture:!0})}}},[D,W,te]),m.useEffect(()=>{const ie=it(()=>W(!1),"close");return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[W]);const[_,P]=dm(ie=>{const me=le().filter(Ae=>!Ae.disabled),Ce=me.find(Ae=>Ae.ref.current===document.activeElement),Me=fm(me,ie,Ce);Me&&setTimeout(()=>{var Ae;return(Ae=Me.ref.current)==null?void 0:Ae.focus()})}),Q=m.useCallback((ie,me,Ce)=>{const Me=!U.current&&!Ce;(T.value!==void 0&&T.value===me||Me)&&(oe(ie),Me&&(U.current=!0))},[T.value]),re=m.useCallback(()=>D==null?void 0:D.focus(),[D]),fe=m.useCallback((ie,me,Ce)=>{const Me=!U.current&&!Ce;(T.value!==void 0&&T.value===me||Me)&&q(ie)},[T.value]),be=u==="popper"?my:FM,G=be===my?{side:g,sideOffset:v,align:x,alignOffset:y,arrowPadding:S,collisionBoundary:w,collisionPadding:C,sticky:E,hideWhenDetached:j,avoidCollisions:R}:{};return s.jsx(g1,{scope:i,content:D,viewport:M,onViewportChange:B,itemRefCallback:Q,selectedItem:K,onItemLeave:re,itemTextRefCallback:fe,focusSelectedItem:ae,selectedItemText:X,position:u,isPositioned:J,searchRef:_,children:s.jsx(Fc,{as:KM,allowPinchZoom:!0,children:s.jsx(Lh,{asChild:!0,trapped:T.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:je(d,ie=>{var me;(me=T.trigger)==null||me.focus({preventScroll:!0}),ie.preventDefault()}),children:s.jsx(Bc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:s.jsx(be,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:ie=>ie.preventDefault(),...A,...G,onPlaced:()=>ce(!0),ref:z,style:{display:"flex",flexDirection:"column",outline:"none",...A.style},onKeyDown:je(A.onKeyDown,ie=>{const me=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),!me&&ie.key.length===1&&P(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let Me=le().filter(Ae=>!Ae.disabled).map(Ae=>Ae.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(Me=Me.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const Ae=ie.target,Le=Me.indexOf(Ae);Me=Me.slice(Le+1)}setTimeout(()=>Y(Me)),ie.preventDefault()}})})})})})})},"SelectContentImpl")),FM=m.forwardRef(it(function(l,o){const{__scopeSelect:i,onPlaced:u,...d}=l,h=Gl(gr,i),p=Wc(gr,i),[g,v]=m.useState(null),[x,y]=m.useState(null),S=Ge(o,y),w=cm(i),C=m.useRef(!1),E=m.useRef(!0),{viewport:j,selectedItem:R,selectedItemText:A,focusSelectedItem:T}=p,D=m.useCallback(()=>{if(h.trigger&&h.valueNode&&g&&x&&j&&R&&A){const z=h.trigger.getBoundingClientRect(),K=x.getBoundingClientRect(),oe=h.valueNode.getBoundingClientRect(),X=A.getBoundingClientRect();if(h.dir!=="rtl"){const Ae=X.left-K.left,Le=oe.left-Ae,pt=z.left-Le,gt=z.width+pt,se=Math.max(gt,K.width),Ue=window.innerWidth-oa,Ye=uh(Le,[oa,Math.max(oa,Ue-se)]);g.style.minWidth=gt+"px",g.style.left=Ye+"px"}else{const Ae=K.right-X.right,Le=window.innerWidth-oe.right-Ae,pt=window.innerWidth-z.right-Le,gt=z.width+pt,se=Math.max(gt,K.width),Ue=window.innerWidth-oa,Ye=uh(Le,[oa,Math.max(oa,Ue-se)]);g.style.minWidth=gt+"px",g.style.right=Ye+"px"}const q=w(),le=window.innerHeight-oa*2,J=j.scrollHeight,ce=window.getComputedStyle(x),U=parseInt(ce.borderTopWidth,10),Y=parseInt(ce.paddingTop,10),ae=parseInt(ce.borderBottomWidth,10),W=parseInt(ce.paddingBottom,10),te=U+Y+J+W+ae,_=Math.min(R.offsetHeight*5,te),P=window.getComputedStyle(j),Q=parseInt(P.paddingTop,10),re=parseInt(P.paddingBottom,10),fe=z.top+z.height/2-oa,be=le-fe,G=R.offsetHeight/2,ie=R.offsetTop+G,me=U+Y+ie,Ce=te-me;if(me<=fe){const Ae=q.length>0&&R===q[q.length-1].ref.current;g.style.bottom="0px";const Le=x.clientHeight-j.offsetTop-j.offsetHeight,pt=Math.max(be,G+(Ae?re:0)+Le+ae),gt=me+pt;g.style.height=gt+"px"}else{const Ae=q.length>0&&R===q[0].ref.current;g.style.top="0px";const pt=Math.max(fe,U+j.offsetTop+(Ae?Q:0)+G)+Ce;g.style.height=pt+"px",j.scrollTop=me-fe+j.offsetTop}g.style.margin=`${oa}px 0`,g.style.minHeight=_+"px",g.style.maxHeight=le+"px",u==null||u(),requestAnimationFrame(()=>C.current=!0)}},[w,h.trigger,h.valueNode,g,x,j,R,A,h.dir,u]);kt(()=>D(),[D]);const[O,M]=m.useState();kt(()=>{x&&M(window.getComputedStyle(x).zIndex)},[x]);const B=m.useCallback(z=>{z&&E.current===!0&&(D(),T==null||T(),E.current=!1)},[D,T]);return s.jsx(QM,{scope:i,contentWrapper:g,shouldExpandOnScrollRef:C,onScrollButtonChange:B,children:s.jsx("div",{ref:v,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:O},children:s.jsx(Pe.div,{...d,ref:S,style:{boxSizing:"border-box",maxHeight:"100%",...d.style}})})})},"SelectItemAlignedPosition")),my=m.forwardRef(it(function(l,o){const{__scopeSelect:i,align:u="start",collisionPadding:d=oa,...h}=l,p=um(i);return s.jsx(Gh,{...p,...h,ref:o,align:u,collisionPadding:d,style:{boxSizing:"border-box",...h.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[QM,ZM]=Sr(gr,{}),py="SelectViewport",JM=m.forwardRef(it(function(l,o){const{__scopeSelect:i,nonce:u,...d}=l,h=Wc(py,i),p=ZM(py,i),g=Ge(o,h.onViewportChange),v=m.useRef(0);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:u}),s.jsx(Jc.Slot,{scope:i,children:s.jsx(Pe.div,{"data-radix-select-viewport":"",role:"presentation",...d,ref:g,style:{position:"relative",flex:1,overflow:"hidden auto",...d.style},onScroll:je(d.onScroll,x=>{const y=x.currentTarget,{contentWrapper:S,shouldExpandOnScrollRef:w}=p;if(w!=null&&w.current&&S){const C=Math.abs(v.current-y.scrollTop);if(C>0){const E=window.innerHeight-oa*2,j=parseFloat(S.style.minHeight),R=parseFloat(S.style.height),A=Math.max(j,R);if(A<E){const T=A+C,D=Math.min(E,T),O=T-D;S.style.height=D+"px",S.style.bottom==="0px"&&(y.scrollTop=O>0?O:0,S.style.justifyContent="flex-end")}}}v.current=y.scrollTop})})})]})},"SelectViewport")),WM="SelectGroup",[J_,W_]=Sr(WM),dh="SelectItem",[eD,v1]=Sr(dh),x1=m.forwardRef(it(function(l,o){const{__scopeSelect:i,value:u,disabled:d=!1,textValue:h,...p}=l,g=Gl(dh,i),v=Wc(dh,i),x=g.value===u,[y,S]=m.useState(h??""),[w,C]=m.useState(!1),E=Qn(D=>{var O;return(O=v.itemRefCallback)==null?void 0:O.call(v,D,u,d)}),j=Ge(o,E),R=ba(),A=m.useRef("touch"),T=it(()=>{d||(g.onValueChange(u),g.onOpenChange(!1))},"handleSelect");return s.jsx(eD,{scope:i,value:u,disabled:d,textId:R,isSelected:x,onItemTextChange:m.useCallback(D=>{S(O=>O||((D==null?void 0:D.textContent)??"").trim())},[]),children:s.jsx(Jc.ItemSlot,{scope:i,value:u,disabled:d,textValue:y,children:s.jsx(Pe.div,{role:"option","aria-labelledby":R,"data-highlighted":w?"":void 0,"aria-selected":x&&w,"data-state":x?"checked":"unchecked","aria-disabled":d||void 0,"data-disabled":d?"":void 0,tabIndex:d?void 0:-1,...p,ref:j,onFocus:je(p.onFocus,()=>C(!0)),onBlur:je(p.onBlur,()=>C(!1)),onClick:je(p.onClick,()=>{A.current!=="mouse"&&T()}),onPointerUp:je(p.onPointerUp,()=>{A.current==="mouse"&&T()}),onPointerDown:je(p.onPointerDown,D=>{A.current=D.pointerType}),onPointerMove:je(p.onPointerMove,D=>{var O;A.current=D.pointerType,d?(O=v.onItemLeave)==null||O.call(v):A.current==="mouse"&&D.currentTarget.focus({preventScroll:!0})}),onPointerLeave:je(p.onPointerLeave,D=>{var O;D.currentTarget===document.activeElement&&((O=v.onItemLeave)==null||O.call(v))}),onKeyDown:je(p.onKeyDown,D=>{var M;d||D.target!==D.currentTarget||((M=v.searchRef)==null?void 0:M.current)!==""&&D.key===" "||(_M.includes(D.key)&&T(),D.key===" "&&D.preventDefault())})})})})},"SelectItem")),dc="SelectItemText",tD=m.forwardRef(it(function(l,o){const{__scopeSelect:i,className:u,style:d,...h}=l,p=Gl(dc,i),g=Wc(dc,i),v=v1(dc,i),x=LM(dc,i),[y,S]=m.useState(null),w=Qn(T=>{var D;return(D=g.itemTextRefCallback)==null?void 0:D.call(g,T,v.value,v.disabled)}),C=Ge(o,S,v.onItemTextChange,w),E=y==null?void 0:y.textContent,j=m.useMemo(()=>s.jsx("option",{value:v.value,disabled:v.disabled,children:E},v.value),[v.disabled,v.value,E]),{onNativeOptionAdd:R,onNativeOptionRemove:A}=x;return kt(()=>(R(j),()=>A(j)),[R,A,j]),s.jsxs(s.Fragment,{children:[s.jsx(Pe.span,{id:v.textId,...h,ref:C}),v.isSelected&&p.valueNode&&!p.valueNodeHasChildren&&!qo(p.value)?Ss.createPortal(h.children,p.valueNode):null]})},"SelectItemText")),nD="SelectItemIndicator",aD=m.forwardRef(it(function(l,o){const{__scopeSelect:i,...u}=l;return v1(nD,i).isSelected?s.jsx(Pe.span,{"aria-hidden":!0,...u,ref:o}):null},"SelectItemIndicator")),lD="SelectBubbleInput",rD=m.forwardRef(it(function({__scopeSelect:l,...o},i){const u=Gl(lD,l),{value:d,onValueChange:h,required:p,disabled:g,name:v,autoComplete:x,form:y}=u,{nativeOptions:S,nativeSelectKey:w}=u,C=m.useRef(null),E=Ge(i,C),j=d??"",R=d1(j),A=Array.from(S).some(T=>(T.props.value??"")==="");return m.useEffect(()=>{const T=C.current;if(!T)return;const D=window.HTMLSelectElement.prototype,M=Object.getOwnPropertyDescriptor(D,"value").set;if(R!==j&&M){const B=new Event("change",{bubbles:!0});M.call(T,j),T.dispatchEvent(B)}},[R,j]),s.jsxs(Pe.select,{"aria-hidden":!0,required:p,tabIndex:-1,name:v,autoComplete:x,disabled:g,form:y,onChange:T=>h(T.target.value),...o,style:{...f1,...o.style},ref:E,defaultValue:j,children:[qo(d)&&!A?s.jsx("option",{value:""}):null,Array.from(S)]},w)},"SelectBubbleInput"));function y1(n){return typeof n=="function"}it(y1,"isFunction");function qo(n){return n===""||n===void 0}it(qo,"shouldShowPlaceholder");function dm(n){const l=Qn(n),o=m.useRef(""),i=m.useRef(0),u=m.useCallback(h=>{const p=o.current+h;l(p),it((function g(v){o.current=v,window.clearTimeout(i.current),v!==""&&(i.current=window.setTimeout(()=>g(""),1e3))}),"updateSearch")(p)},[l]),d=m.useCallback(()=>{o.current="",window.clearTimeout(i.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(i.current),[]),[o,u,d]}it(dm,"useTypeaheadSearch");function fm(n,l,o){const u=l.length>1&&Array.from(l).every(v=>v===l[0])?l[0]:l,d=o?n.indexOf(o):-1;let h=b1(n,Math.max(d,0));u.length===1&&(h=h.filter(v=>v!==o));const g=h.find(v=>v.textValue.toLowerCase().startsWith(u.toLowerCase()));return g!==o?g:void 0}it(fm,"findNextItem");function b1(n,l){return n.map((o,i)=>n[(l+i)%n.length])}it(b1,"wrapArray");const Kn=UM,Xn=PM,_n=m.forwardRef(({className:n,children:l,...o},i)=>s.jsxs(m1,{ref:i,className:Ee("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",n),...o,children:[l,s.jsx(qM,{asChild:!0,children:s.jsx(tC,{className:"h-4 w-4 opacity-50"})})]}));_n.displayName=m1.displayName;const On=m.forwardRef(({className:n,children:l,position:o="popper",...i},u)=>s.jsx(YM,{children:s.jsx(p1,{ref:u,className:Ee("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",n),position:o,...i,children:s.jsx(JM,{className:Ee("p-1",o==="popper"&&"w-full min-w-[var(--radix-select-trigger-width)]"),children:l})})}));On.displayName=p1.displayName;const ot=m.forwardRef(({className:n,children:l,...o},i)=>s.jsxs(x1,{ref:i,className:Ee("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n),...o,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(aD,{children:s.jsx(Xy,{className:"h-4 w-4"})})}),s.jsx(tD,{children:l})]}));ot.displayName=x1.displayName;var sD=Object.defineProperty,Il=(n,l)=>sD(n,"name",{value:l,configurable:!0}),hm="Switch",[oD,eO]=yn(hm),[iD,mm]=oD(hm);function S1(n){const{__scopeSwitch:l,checked:o,children:i,defaultChecked:u,disabled:d,form:h,name:p,onCheckedChange:g,required:v,value:x="on",internal_do_not_use_render:y}=n,[S,w]=el({prop:o,defaultProp:u??!1,onChange:g,caller:hm}),[C,E]=m.useState(null),[j,R]=m.useState(null),A=m.useRef(!1),[T,D]=m.useReducer(B=>B+1,0),O=C?!!h||!!C.closest("form"):!0,M={checked:S,setChecked:w,disabled:d,control:C,setControl:E,name:p,form:h,value:x,hasConsumerStoppedPropagationRef:A,userInteractionCount:T,onUserInteraction:D,required:v,defaultChecked:u,isFormControl:O,bubbleInput:j,setBubbleInput:R};return s.jsx(iD,{scope:l,...M,children:j1(y)?y(M):i})}Il(S1,"SwitchProvider");var cD="SwitchTrigger",uD=m.forwardRef(Il(function({__scopeSwitch:l,onClick:o,...i},u){const{control:d,form:h,value:p,disabled:g,checked:v,required:x,setControl:y,setChecked:S,hasConsumerStoppedPropagationRef:w,onUserInteraction:C,isFormControl:E,bubbleInput:j}=mm(cD,l),R=Ge(u,y),A=m.useRef(v);return m.useEffect(()=>{const T=h?d==null?void 0:d.ownerDocument.getElementById(h):d==null?void 0:d.form;if(T instanceof HTMLFormElement){const D=Il(()=>S(A.current),"reset");return T.addEventListener("reset",D),()=>T.removeEventListener("reset",D)}},[d,h,S]),s.jsx(Pe.button,{type:"button",role:"switch","aria-checked":v,"aria-required":x,"data-state":pm(v),"data-disabled":g?"":void 0,disabled:g,value:p,...i,ref:R,onClick:je(o,T=>{C(),S(D=>!D),j&&E&&(w.current=T.isPropagationStopped(),w.current||T.stopPropagation())})})},"SwitchTrigger")),w1=m.forwardRef(Il(function(l,o){const{__scopeSwitch:i,name:u,checked:d,defaultChecked:h,required:p,disabled:g,value:v,onCheckedChange:x,form:y,...S}=l;return s.jsx(S1,{__scopeSwitch:i,checked:d,defaultChecked:h,disabled:g,required:p,onCheckedChange:x,name:u,form:y,value:v,internal_do_not_use_render:({isFormControl:w})=>s.jsxs(s.Fragment,{children:[s.jsx(uD,{...S,ref:o,__scopeSwitch:i}),w&&s.jsx(mD,{__scopeSwitch:i})]})})},"Switch")),dD="SwitchThumb",fD=m.forwardRef(Il(function(l,o){const{__scopeSwitch:i,...u}=l,d=mm(dD,i);return s.jsx(Pe.span,{"data-state":pm(d.checked),"data-disabled":d.disabled?"":void 0,...u,ref:o})},"SwitchThumb")),hD="SwitchBubbleInput",mD=m.forwardRef(Il(function({__scopeSwitch:l,onClick:o,...i},u){const{control:d,hasConsumerStoppedPropagationRef:h,userInteractionCount:p,checked:g,defaultChecked:v,required:x,disabled:y,name:S,value:w,form:C,bubbleInput:E,setBubbleInput:j}=mm(hD,l),R=Ge(u,j),A=Gc(d),T=m.useRef(!1),D=m.useRef(g),O=m.useRef(p);m.useEffect(()=>{const B=E;if(!B)return;const z=window.HTMLInputElement.prototype,oe=Object.getOwnPropertyDescriptor(z,"checked").set,X=p!==O.current;O.current=p;const q=D.current!==g;D.current=g;const le=!(X&&h.current);if(q&&oe){T.current=!X;const J=new Event("click",{bubbles:le});oe.call(B,g),B.dispatchEvent(J),T.current=!1}},[E,g,h,p]);const M=m.useRef(g);return s.jsx(Pe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:v??M.current,required:x,disabled:y,name:S,value:w,form:C,...i,tabIndex:-1,ref:R,onClick:je(o,B=>{T.current&&B.stopPropagation()}),style:{...i.style,...A,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function j1(n){return typeof n=="function"}Il(j1,"isFunction");function pm(n){return n?"checked":"unchecked"}Il(pm,"getState");const Ca=m.forwardRef(({className:n,...l},o)=>s.jsx(w1,{className:Ee("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",n),...l,ref:o,children:s.jsx(fD,{className:Ee("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Ca.displayName=w1.displayName;const dr={name:"",slug:"",type:"openai",baseUrl:"https://api.openai.com",apiKey:"",customHeaders:"",enabled:!0};function pD(){const[n,l]=m.useState([]),[o,i]=m.useState(!1),[u,d]=m.useState(dr),[h,p]=m.useState(!1),[g,v]=m.useState(null),[x,y]=m.useState(null),[S,w]=m.useState(dr),[C,E]=m.useState(null),[j,R]=m.useState(!1),A=()=>Se.get("/api/admin/providers").then(z=>l(z.providers));m.useEffect(()=>{A()},[]);const T=async()=>{p(!0);try{let z;if(u.customHeaders.trim())try{z=JSON.parse(u.customHeaders)}catch{throw new Error("Custom headers must be valid JSON object")}await Se.post("/api/admin/providers",{name:u.name,slug:u.slug||void 0,type:u.type,baseUrl:u.baseUrl,apiKey:u.apiKey,customHeaders:z,enabled:u.enabled}),pe.success("Provider created"),i(!1),d(dr),A()}catch(z){pe.error(z.message)}finally{p(!1)}},D=async z=>{v(z);try{const K=await Se.post(`/api/admin/providers/${z}/test`);pe.success(K.ok?`Connection OK: ${K.detail}`:`Failed: ${K.detail}`),A()}catch(K){pe.error(K.message)}finally{v(null)}},O=z=>{y(z.id),w({...dr,name:z.name,slug:z.slug||"",type:z.type,baseUrl:z.baseUrl,apiKey:"",customHeaders:"",enabled:z.enabled})},M=async()=>{if(x){p(!0);try{let z;if(S.customHeaders.trim())try{z=JSON.parse(S.customHeaders)}catch{throw new Error("Custom headers must be valid JSON object")}await Se.patch("/api/admin/providers",{id:x,name:S.name,slug:S.slug||void 0,type:S.type,baseUrl:S.baseUrl,apiKey:S.apiKey||void 0,customHeaders:z,enabled:S.enabled}),pe.success("Provider updated"),y(null),w(dr),A()}catch(z){pe.error(z.message)}finally{p(!1)}}},B=async z=>{R(!0);try{await Se.del(`/api/admin/providers/${z}`),pe.success("Provider removed"),A()}catch(K){pe.error(K.message)}finally{R(!1),E(null)}};return s.jsxs("div",{children:[s.jsx(Na,{title:"Providers",description:"Upstream LLM providers and their credentials",actions:s.jsxs(Mn,{open:o,onOpenChange:i,children:[s.jsx(Po,{asChild:!0,children:s.jsxs(de,{children:[s.jsx(zo,{className:"mr-1 h-4 w-4"})," Add provider"]})}),s.jsxs(hn,{children:[s.jsx(mn,{children:s.jsx(pn,{children:"New provider"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(xe,{children:"Name"}),s.jsx(Re,{value:u.name,onChange:z=>d({...u,name:z.target.value})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Slug (optional)"}),s.jsx(Re,{value:u.slug,onChange:z=>d({...u,slug:z.target.value})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Type"}),s.jsxs(Kn,{value:u.type,onValueChange:z=>d({...u,type:z}),children:[s.jsx(_n,{children:s.jsx(Xn,{})}),s.jsxs(On,{children:[s.jsx(ot,{value:"openai",children:"OpenAI-compatible"}),s.jsx(ot,{value:"anthropic",children:"Anthropic-compatible"})]})]})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Base URL"}),s.jsx(Re,{value:u.baseUrl,onChange:z=>d({...u,baseUrl:z.target.value})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"API key"}),s.jsx(Re,{type:"password",value:u.apiKey,onChange:z=>d({...u,apiKey:z.target.value})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Custom headers (JSON)"}),s.jsx(Re,{value:u.customHeaders,onChange:z=>d({...u,customHeaders:z.target.value}),placeholder:'{"X-Org":"acme"}'})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ca,{checked:u.enabled,onCheckedChange:z=>d({...u,enabled:z})}),s.jsx(xe,{children:"Enabled"})]})]}),s.jsxs(Dn,{children:[s.jsx(de,{variant:"outline",onClick:()=>i(!1),children:"Cancel"}),s.jsx(de,{disabled:h||!u.name||!u.apiKey,onClick:T,children:"Create"})]})]})]})}),s.jsxs(Ze,{children:[s.jsxs(Je,{children:[s.jsx(We,{className:"text-base",children:"All providers"}),s.jsxs(fn,{children:[n.length," total"]})]}),s.jsx(et,{children:s.jsxs(Zn,{children:[s.jsx(Jn,{children:s.jsxs(Xe,{children:[s.jsx(ge,{children:"Name"}),s.jsx(ge,{children:"Type"}),s.jsx(ge,{children:"Base URL"}),s.jsx(ge,{children:"Models"}),s.jsx(ge,{children:"Health"}),s.jsx(ge,{children:"Enabled"}),s.jsx(ge,{className:"text-right",children:"Actions"})]})}),s.jsxs(Wn,{children:[n.length===0&&s.jsx(Xe,{children:s.jsx(he,{colSpan:7,className:"text-center text-muted-foreground",children:"No providers yet."})}),n.map(z=>s.jsxs(Xe,{children:[s.jsxs(he,{className:"font-medium",children:[z.name," ",s.jsx("span",{className:"text-xs text-muted-foreground",children:z.slug})]}),s.jsx(he,{children:s.jsx(at,{variant:"outline",children:z.type})}),s.jsx(he,{className:"text-xs text-muted-foreground",children:z.baseUrl}),s.jsx(he,{children:z.modelCount}),s.jsx(he,{children:s.jsx(at,{variant:z.health==="healthy"?"success":z.health==="down"?"destructive":"secondary",children:z.health})}),s.jsx(he,{children:z.enabled?"Yes":"No"}),s.jsx(he,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end gap-1",children:[s.jsx(de,{size:"sm",variant:"outline",disabled:g===z.id,onClick:()=>D(z.id),children:s.jsx(gC,{className:"h-3 w-3"})}),s.jsx(de,{size:"sm",variant:"outline",onClick:()=>O(z),children:"✎"}),s.jsx(de,{size:"sm",variant:"outline",onClick:()=>E(z.id),children:s.jsx(kc,{className:"h-3 w-3"})})]})})]},z.id))]})]})})]}),s.jsx(Mn,{open:!!x,onOpenChange:z=>{z||(y(null),w(dr))},children:s.jsxs(hn,{children:[s.jsx(mn,{children:s.jsx(pn,{children:"Edit provider"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(xe,{children:"Name"}),s.jsx(Re,{value:S.name,onChange:z=>w({...S,name:z.target.value})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Slug (optional)"}),s.jsx(Re,{value:S.slug,onChange:z=>w({...S,slug:z.target.value})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Type"}),s.jsxs(Kn,{value:S.type,onValueChange:z=>w({...S,type:z}),children:[s.jsx(_n,{children:s.jsx(Xn,{})}),s.jsxs(On,{children:[s.jsx(ot,{value:"openai",children:"OpenAI-compatible"}),s.jsx(ot,{value:"anthropic",children:"Anthropic-compatible"})]})]})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Base URL"}),s.jsx(Re,{value:S.baseUrl,onChange:z=>w({...S,baseUrl:z.target.value})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"API key (leave empty to keep current)"}),s.jsx(Re,{type:"password",value:S.apiKey,onChange:z=>w({...S,apiKey:z.target.value})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Custom headers (JSON)"}),s.jsx(Re,{value:S.customHeaders,onChange:z=>w({...S,customHeaders:z.target.value}),placeholder:'{"X-Org":"acme"}'})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ca,{checked:S.enabled,onCheckedChange:z=>w({...S,enabled:z})}),s.jsx(xe,{children:"Enabled"})]})]}),s.jsxs(Dn,{children:[s.jsx(de,{variant:"outline",onClick:()=>{y(null),w(dr)},children:"Cancel"}),s.jsx(de,{disabled:h||!S.name,onClick:M,children:"Save changes"})]})]})}),s.jsx(o1,{open:!!C,onOpenChange:z=>{z||E(null)},children:s.jsxs(lm,{children:[s.jsxs(c1,{children:[s.jsx(rm,{children:"Delete provider?"}),s.jsx(sm,{children:"This will soft-disable the provider if models depend on it."})]}),s.jsxs(u1,{children:[s.jsx(im,{children:"Cancel"}),s.jsx(om,{disabled:j,onClick:z=>{C&&(z.preventDefault(),B(C))},children:j?"Deleting…":"Delete"})]})]})})]})}var gD=Object.defineProperty,al=(n,l)=>gD(n,"name",{value:l,configurable:!0}),gm="Checkbox",[vD,tO]=yn(gm),[xD,vm]=vD(gm);function C1(n){const{__scopeCheckbox:l,checked:o,children:i,defaultChecked:u,disabled:d,form:h,name:p,onCheckedChange:g,required:v,value:x="on",internal_do_not_use_render:y}=n,[S,w]=el({prop:o,defaultProp:u??!1,onChange:g,caller:gm}),[C,E]=m.useState(null),[j,R]=m.useState(null),A=m.useRef(!1),[T,D]=m.useReducer(B=>B+1,0),O=C?!!h||!!C.closest("form"):!0,M={checked:S,disabled:d,setChecked:w,control:C,setControl:E,name:p,form:h,value:x,hasConsumerStoppedPropagationRef:A,userInteractionCount:T,onUserInteraction:D,required:v,defaultChecked:Ja(u)?!1:u,isFormControl:O,bubbleInput:j,setBubbleInput:R};return s.jsx(xD,{scope:l,...M,children:N1(y)?y(M):i})}al(C1,"CheckboxProvider");var yD="CheckboxTrigger",bD=m.forwardRef(al(function({__scopeCheckbox:l,onKeyDown:o,onClick:i,...u},d){const{control:h,value:p,disabled:g,checked:v,required:x,setControl:y,setChecked:S,hasConsumerStoppedPropagationRef:w,onUserInteraction:C,isFormControl:E,bubbleInput:j}=vm(yD,l),R=Ge(d,y),A=m.useRef(v);return m.useEffect(()=>{const T=h==null?void 0:h.form;if(T){const D=al(()=>S(A.current),"reset");return T.addEventListener("reset",D),()=>T.removeEventListener("reset",D)}},[h,S]),s.jsx(Pe.button,{type:"button",role:"checkbox","aria-checked":Ja(v)?"mixed":v,"aria-required":x,"data-state":xm(v),"data-disabled":g?"":void 0,disabled:g,value:p,...u,ref:R,onKeyDown:je(o,T=>{T.key==="Enter"&&T.preventDefault()}),onClick:je(i,T=>{C(),S(D=>Ja(D)?!0:!D),j&&E&&(w.current=T.isPropagationStopped(),w.current||T.stopPropagation())})})},"CheckboxTrigger")),E1=m.forwardRef(al(function(l,o){const{__scopeCheckbox:i,name:u,checked:d,defaultChecked:h,required:p,disabled:g,value:v,onCheckedChange:x,form:y,...S}=l;return s.jsx(C1,{__scopeCheckbox:i,checked:d,defaultChecked:h,disabled:g,required:p,onCheckedChange:x,name:u,form:y,value:v,internal_do_not_use_render:({isFormControl:w})=>s.jsxs(s.Fragment,{children:[s.jsx(bD,{...S,ref:o,__scopeCheckbox:i}),w&&s.jsx(CD,{__scopeCheckbox:i})]})})},"Checkbox")),SD="CheckboxIndicator",wD=m.forwardRef(al(function(l,o){const{__scopeCheckbox:i,forceMount:u,...d}=l,h=vm(SD,i);return s.jsx(rl,{present:u||Ja(h.checked)||h.checked===!0,children:s.jsx(Pe.span,{"data-state":xm(h.checked),"data-disabled":h.disabled?"":void 0,...d,ref:o,style:{pointerEvents:"none",...l.style}})})},"CheckboxIndicator")),jD="CheckboxBubbleInput",CD=m.forwardRef(al(function({__scopeCheckbox:l,onClick:o,...i},u){const{control:d,hasConsumerStoppedPropagationRef:h,userInteractionCount:p,checked:g,defaultChecked:v,required:x,disabled:y,name:S,value:w,form:C,bubbleInput:E,setBubbleInput:j}=vm(jD,l),R=Ge(u,j),A=Gc(d),T=m.useRef(!1),D=m.useRef(g),O=m.useRef(p);m.useEffect(()=>{const B=E;if(!B)return;const z=window.HTMLInputElement.prototype,oe=Object.getOwnPropertyDescriptor(z,"checked").set,X=p!==O.current;O.current=p;const q=D.current!==g;D.current=g;const le=!(X&&h.current);if(q&&oe){T.current=!X;const J=new Event("click",{bubbles:le});B.indeterminate=Ja(g),oe.call(B,Ja(g)?!1:g),B.dispatchEvent(J),T.current=!1}},[E,g,h,p]);const M=m.useRef(Ja(g)?!1:g);return s.jsx(Pe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:v??M.current,required:x,disabled:y,name:S,value:w,form:C,...i,tabIndex:-1,ref:R,onClick:je(o,B=>{T.current&&B.stopPropagation()}),style:{...i.style,...A,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function N1(n){return typeof n=="function"}al(N1,"isFunction");function Ja(n){return n==="indeterminate"}al(Ja,"isIndeterminate");function xm(n){return Ja(n)?"indeterminate":n?"checked":"unchecked"}al(xm,"getState");const ym=m.forwardRef(({className:n,...l},o)=>s.jsx(E1,{ref:o,className:Ee("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",n),...l,children:s.jsx(wD,{className:Ee("flex items-center justify-center text-current"),children:s.jsx(Xy,{className:"h-3.5 w-3.5"})})}));ym.displayName=E1.displayName;const fh=["image_input","audio_input","tools","structured_output","reasoning","chat","streaming"],ED=["unknown","yes","no"];function ND(n,l){return n[l]===!0?"yes":n[l]===!1?"no":"unknown"}function RD(n){const l={};for(const o of fh)l[o]=n[o]==="yes"?!0:n[o]==="no"?!1:null;return l}function TD(){const[n,l]=m.useState([]),[o,i]=m.useState([]),[u,d]=m.useState("all"),[h,p]=m.useState(!1),[g,v]=m.useState(""),[x,y]=m.useState([]),[S,w]=m.useState(new Set),[C,E]=m.useState(!1),[j,R]=m.useState(""),[A,T]=m.useState(""),[D,O]=m.useState(null),[M,B]=m.useState(!1),[z,K]=m.useState(null),[oe,X]=m.useState(null),[q,le]=m.useState(null),[J,ce]=m.useState({}),[U,Y]=m.useState(!1),ae=G=>{const ie={};for(const me of fh)ie[me]=ND(G.capabilities,me);ce(ie),le(G)},W=async()=>{if(q){Y(!0);try{await Se.patch("/api/admin/models",{id:q.id,capabilities:RD(J)}),pe.success("Capabilities updated"),le(null),te()}catch(G){pe.error(G.message)}finally{Y(!1)}}},te=async()=>{const[G,ie]=await Promise.all([Se.get("/api/admin/models"),Se.get("/api/admin/providers")]);l(G.models),i(ie.providers)};m.useEffect(()=>{te()},[]);const _=n.filter(G=>!(u!=="all"&&G.providerId!==u||j&&!G.publicModelId.toLowerCase().includes(j.toLowerCase()))),P=x.filter(G=>{if(!A)return!0;const ie=A.toLowerCase();return G.upstreamId.toLowerCase().includes(ie)||G.displayName.toLowerCase().includes(ie)}),Q=async()=>{if(g){E(!0);try{const G=await Se.post(`/api/admin/providers/${g}/discover`);y(G.models),w(new Set)}catch(G){pe.error(G.message)}finally{E(!1)}}},re=async()=>{if(S.size!==0)try{const G=await Se.post("/api/admin/models/import",{providerId:g,modelIds:Array.from(S)});pe.success(`Imported ${G.imported} of ${G.requested}`),p(!1),y([]),w(new Set),te()}catch(G){pe.error(G.message)}},fe=async()=>{if(oe)try{await Se.del(`/api/admin/models/${oe.id}`),pe.success("Model deleted"),X(null),te()}catch(G){pe.error(G.message)}},be=async G=>{var me,Ce,Me;O(G),B(!0);const ie=Date.now();K({phase:"streaming",startedAt:ie,text:"",progress:{}});try{const Ae=await globalThis.fetch(`/api/admin/models/${G}/test-stream`,{method:"POST",headers:{"content-type":"application/json"},credentials:"include",body:"{}"});if(!Ae.ok){const Ye=await Ae.text().catch(()=>"");K({phase:"error",model:G,error:`HTTP ${Ae.status}: ${Ye}`});return}const Le=(me=Ae.body)==null?void 0:me.getReader();if(!Le){K({phase:"error",model:G,error:"No response body"});return}const pt=new TextDecoder;let gt="",se="",Ue=!1;for(;!Ue;){const{value:Ye,done:Ht}=await Le.read();Ue=Ht,Ye&&(gt+=pt.decode(Ye,{stream:!0}));let Ft;for(;(Ft=gt.indexOf(`
|
|
332
|
+
|
|
333
|
+
`))>=0;){const bn=gt.slice(0,Ft);gt=gt.slice(Ft+2);const ea=bn.split(`
|
|
334
|
+
`);let Qt="",St="";for(const Sn of ea)Sn.startsWith("event: ")?Qt=Sn.slice(7):Sn.startsWith("data: ")&&(St=Sn.slice(6));if(St){if(Qt===""||Qt==="message")try{const Ct=(Ce=JSON.parse(St).choices)==null?void 0:Ce[0];(Me=Ct==null?void 0:Ct.delta)!=null&&Me.content&&(se+=Ct.delta.content),K(Zt=>{if(!Zt||Zt.phase!=="streaming")return Zt;const Ra=Date.now()-ie,Ts=Zt.progress.ttftMs??Ra;return{...Zt,text:se,progress:{ttftMs:Ts,elapsedMs:Ra}}})}catch{}if(Qt==="test_meta")try{const Sn=JSON.parse(St);K({phase:"done",model:G,result:Sn,text:se})}catch{}if(Qt==="test_error")try{const Sn=JSON.parse(St);K({phase:"error",model:G,error:Sn.message})}catch{}}}}K(Ye=>!Ye||Ye.phase==="streaming"?{phase:"error",model:G,error:"Stream ended unexpectedly"}:Ye)}catch(Ae){K({phase:"error",model:G,error:Ae.message})}finally{O(null)}};return s.jsxs("div",{children:[s.jsx(Na,{title:"Models",description:"Physical models imported from providers",actions:s.jsxs(Mn,{open:h,onOpenChange:p,children:[s.jsx(Po,{asChild:!0,children:s.jsxs(de,{variant:"outline",children:[s.jsx(Fy,{className:"mr-1 h-4 w-4"})," Fetch models"]})}),s.jsxs(hn,{className:"max-w-2xl",children:[s.jsx(mn,{children:s.jsx(pn,{children:"Discover models"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsx("div",{className:"flex-1",children:s.jsxs(Kn,{value:g,onValueChange:v,children:[s.jsx(_n,{children:s.jsx(Xn,{placeholder:"Choose provider"})}),s.jsx(On,{children:o.map(G=>s.jsx(ot,{value:G.id,children:G.name},G.id))})]})}),s.jsx(de,{onClick:Q,disabled:!g||C,children:C?"Fetching…":"Fetch"})]}),x.length>0&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("div",{className:"flex items-center gap-2 flex-1",children:s.jsxs("div",{className:"relative flex-1",children:[s.jsx(eb,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),s.jsx(Re,{className:"pl-8",placeholder:"Search models…",value:A,onChange:G=>T(G.target.value)}),A&&s.jsx("button",{className:"absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",onClick:()=>T(""),children:s.jsx(zc,{className:"h-4 w-4"})})]})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:"text-sm text-muted-foreground",children:[P.length," / ",x.length," · ",S.size," selected"]}),s.jsx(de,{variant:"outline",size:"sm",onClick:()=>w(new Set(P.filter(G=>!G.alreadyImported).map(G=>G.upstreamId))),children:"Select All (new)"}),s.jsx(de,{variant:"outline",size:"sm",onClick:()=>w(new Set),children:"Clear"})]})]}),s.jsx("div",{className:"max-h-80 space-y-1 overflow-auto rounded border p-2",children:P.length===0&&x.length>0?s.jsx("div",{className:"text-center text-sm text-muted-foreground py-4",children:"No models match your search."}):P.map(G=>s.jsxs("label",{className:"flex items-center gap-2 rounded p-1 text-sm hover:bg-accent",children:[s.jsx(ym,{checked:S.has(G.upstreamId),onCheckedChange:ie=>{const me=new Set(S);ie?me.add(G.upstreamId):me.delete(G.upstreamId),w(me)}}),s.jsx("span",{className:"font-mono text-xs",children:G.upstreamId}),G.alreadyImported&&s.jsx(at,{variant:"secondary",children:"imported"})]},G.upstreamId))})]})]}),s.jsxs(Dn,{children:[s.jsx(de,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),s.jsxs(de,{disabled:S.size===0,onClick:re,children:["Import ",S.size||""]})]})]})]})}),s.jsxs(Ze,{children:[s.jsxs(Je,{children:[s.jsx(We,{className:"text-base",children:"All models"}),s.jsxs(fn,{children:[n.length," total"]})]}),s.jsxs(et,{children:[s.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[s.jsxs(Kn,{value:u,onValueChange:d,children:[s.jsx(_n,{className:"w-56",children:s.jsx(Xn,{})}),s.jsxs(On,{children:[s.jsx(ot,{value:"all",children:"All providers"}),o.map(G=>s.jsx(ot,{value:G.id,children:G.name},G.id))]})]}),s.jsx(Re,{className:"max-w-xs",placeholder:"Search public ID",value:j,onChange:G=>R(G.target.value)})]}),s.jsxs(Zn,{children:[s.jsx(Jn,{children:s.jsxs(Xe,{children:[s.jsx(ge,{children:"Public ID"}),s.jsx(ge,{children:"Provider"}),s.jsx(ge,{children:"Upstream ID"}),s.jsx(ge,{children:"Capabilities"}),s.jsx(ge,{children:"Available"}),s.jsx(ge,{children:"Enabled"}),s.jsx(ge,{})]})}),s.jsxs(Wn,{children:[_.length===0&&s.jsx(Xe,{children:s.jsx(he,{colSpan:7,className:"text-center text-muted-foreground",children:"No models"})}),_.map(G=>s.jsxs(Xe,{children:[s.jsx(he,{className:"font-mono text-xs",children:G.publicModelId}),s.jsx(he,{children:G.providerSlug}),s.jsx(he,{className:"text-xs text-muted-foreground",children:G.upstreamModelId}),s.jsx(he,{className:"space-x-1",children:Object.entries(G.capabilities).filter(([,ie])=>ie===!0).slice(0,4).map(([ie])=>s.jsx(at,{variant:"outline",className:"mr-1",children:ie},ie))}),s.jsx(he,{children:G.upstreamAvailable?s.jsx(at,{variant:"success",children:"up"}):s.jsx(at,{variant:"destructive",children:"down"})}),s.jsx(he,{children:G.enabled?"Yes":"No"}),s.jsx(he,{className:"text-right",children:s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[s.jsxs(de,{size:"sm",variant:"outline",onClick:()=>ae(G),disabled:D!==null,children:[s.jsx(bC,{className:"h-3.5 w-3.5"})," Capabilities"]}),s.jsxs(de,{size:"sm",variant:"outline",onClick:()=>void be(G.id),disabled:D!==null,children:[D===G.id?s.jsx(Eo,{className:"h-3.5 w-3.5 animate-spin"}):s.jsx(dC,{className:"h-3.5 w-3.5"})," Test"]}),s.jsxs(de,{size:"sm",variant:"destructive",onClick:()=>X(G),disabled:D!==null,children:[s.jsx(kc,{className:"h-3.5 w-3.5"})," Xoá"]})]})})]},G.id))]})]})]})]}),s.jsx(Mn,{open:!!oe,onOpenChange:G=>{G||X(null)},children:s.jsxs(hn,{className:"max-w-md",children:[s.jsx(mn,{children:s.jsx(pn,{children:"Xoá model"})}),s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsxs("p",{children:["Bạn có chắc muốn xoá model ",s.jsx("span",{className:"font-mono",children:oe==null?void 0:oe.publicModelId}),"?"]}),s.jsx("p",{className:"text-muted-foreground",children:"Model đang được dùng trong combo sẽ bị soft-disable (vô hiệu hoá) thay vì xoá hẳn, để giữ lịch sử và tham chiếu combo."})]}),s.jsxs(Dn,{children:[s.jsx(de,{variant:"outline",onClick:()=>X(null),children:"Huỷ"}),s.jsx(de,{variant:"destructive",onClick:fe,children:"Xoá"})]})]})}),s.jsx(Mn,{open:q!==null,onOpenChange:G=>{G||le(null)},children:s.jsxs(hn,{className:"max-w-lg",children:[s.jsx(mn,{children:s.jsxs(pn,{children:["Capabilities — ",q==null?void 0:q.publicModelId]})}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs("p",{className:"text-xs text-muted-foreground",children:[s.jsx("strong",{children:"Unknown"})," means the router has no verified answer and will attempt the request."," ",s.jsx("strong",{children:"No"})," blocks requests needing that capability (HTTP 400/502 before any upstream call)."]}),fh.map(G=>{var me;const ie=(me=q==null?void 0:q.discoveredCapabilities)==null?void 0:me[G];return s.jsxs("div",{className:"flex items-center justify-between gap-3 rounded px-1 py-1 text-sm hover:bg-accent",children:[s.jsxs("span",{className:"flex items-baseline gap-2",children:[s.jsx("code",{className:"text-xs",children:G}),s.jsx("span",{className:"text-xs text-muted-foreground",children:ie===void 0?"discovered: unknown":`discovered: ${String(ie)}`})]}),s.jsx("div",{className:"flex gap-1",children:ED.map(Ce=>s.jsx(de,{size:"sm",variant:J[G]===Ce?"default":"outline",onClick:()=>ce(Me=>({...Me,[G]:Ce})),children:Ce==="unknown"?"Unknown":Ce==="yes"?"Yes":"No"},Ce))})]},G)})]}),s.jsxs(Dn,{children:[s.jsx(de,{variant:"outline",onClick:()=>le(null),children:"Huỷ"}),s.jsx(de,{onClick:W,disabled:U,children:U?"Saving…":"Lưu"})]})]})}),s.jsx(Mn,{open:M,onOpenChange:B,children:s.jsxs(hn,{className:"max-w-2xl",children:[s.jsx(mn,{children:s.jsx(pn,{children:"Kết quả test model"})}),z&&z.phase==="streaming"&&s.jsxs("div",{className:"space-y-3 text-sm",children:[s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(Eo,{className:"h-4 w-4 animate-spin"})," Đang stream…",s.jsxs("span",{className:"font-mono text-xs text-muted-foreground/60",children:["TTFT ",z.progress.ttftMs!=null?`${z.progress.ttftMs} ms`:"…"]}),s.jsxs("span",{className:"font-mono text-xs text-muted-foreground/60",children:["· ",z.progress.elapsedMs!=null?`${z.progress.elapsedMs} ms`:"…"]})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Phản hồi (streaming)"}),s.jsxs("div",{className:"max-h-60 overflow-auto whitespace-pre-wrap rounded border bg-muted p-3 font-mono text-xs",children:[z.text||s.jsx("span",{className:"text-muted-foreground/60 animate-pulse",children:"waiting for first token…"}),z.phase==="streaming"&&s.jsx("span",{className:"ml-0.5 inline-block h-3.5 w-1.5 animate-pulse bg-primary/70"})]})]})]}),z&&z.phase==="done"&&s.jsxs("div",{className:"space-y-3 text-sm",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[s.jsx(at,{variant:z.result.success?"success":"destructive",children:z.result.success?"Thành công":"Thất bại"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Thời gian phản hồi"}),s.jsxs("div",{className:"font-mono",children:[z.result.latencyMs," ms"]})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"TTFT"}),s.jsx("div",{className:"font-mono",children:z.result.ttftMs!=null?`${z.result.ttftMs} ms`:"—"})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Tokens (in / out)"}),s.jsxs("div",{className:"font-mono",children:[z.result.usage.input," / ",z.result.usage.output]})]})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Phản hồi của model"}),s.jsx("div",{className:"max-h-60 overflow-auto whitespace-pre-wrap rounded border bg-muted p-3 font-mono text-xs",children:z.text||z.result.text||"(trống)"})]}),z.result.attempts.length>0&&s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Attempts"}),s.jsx("div",{className:"space-y-1",children:z.result.attempts.map((G,ie)=>s.jsxs("div",{className:"flex items-center gap-2 rounded border p-2 text-xs",children:[s.jsx(at,{variant:G.success?"success":"destructive",children:G.success?"OK":"FAIL"}),s.jsxs("span",{className:"font-mono",children:[G.providerName," / ",G.modelId]}),s.jsxs("span",{className:"text-muted-foreground",children:[G.latencyMs," ms"]}),G.failureReason&&s.jsx("span",{className:"text-destructive",children:G.failureReason})]},ie))})]})]}),z&&z.phase==="error"&&s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsx(at,{variant:"destructive",children:"Thất bại"}),s.jsx("p",{className:"text-destructive",children:z.error})]}),s.jsx(Dn,{children:s.jsx(de,{variant:"outline",onClick:()=>B(!1),children:"Đóng"})})]})})]})}function AD(){const[n,l]=m.useState([]),[o,i]=m.useState([]),[u,d]=m.useState(!1),[h,p]=m.useState(!1),[g,v]=m.useState(null),[x,y]=m.useState(!1),[S,w]=m.useState(!1),[C,E]=m.useState({name:"",slug:"",mode:"fallback",enabled:!0,members:[]}),[j,R]=m.useState({name:"",slug:"",mode:"fallback",enabled:!0,members:[]}),A=async()=>{const[X,q]=await Promise.all([Se.get("/api/admin/combos"),Se.get("/api/admin/models")]);l(X.combos),i(q.models)};m.useEffect(()=>{A()},[]);const T=X=>{E(q=>({...q,members:[...q.members,{modelId:X,weight:1,position:q.members.length,enabled:!0}]}))},D=X=>{E(q=>({...q,members:q.members.filter((le,J)=>J!==X).map((le,J)=>({...le,position:J}))}))},O=async()=>{if(C.members.length===0){pe.error("Add at least one member");return}y(!0);try{await Se.post("/api/admin/combos",{name:C.name,slug:C.slug||void 0,mode:C.mode,enabled:C.enabled,members:C.members}),pe.success("Combo created"),d(!1),E({name:"",slug:"",mode:"fallback",enabled:!0,members:[]}),A()}catch(X){pe.error(X.message)}finally{y(!1)}},M=async X=>{try{const le=(await Se.get(`/api/admin/combos/${X.id}`)).combo;v(le.id),R({name:le.name,slug:le.publicModelId.startsWith("combo/")?le.slug:"",mode:le.mode,enabled:le.enabled,members:le.members.map(J=>({modelId:J.modelId,weight:J.weight,position:J.position,enabled:J.enabled}))}),p(!0)}catch(q){pe.error(q.message)}},B=async()=>{if(g){if(j.members.length===0){pe.error("Add at least one member");return}w(!0);try{await Se.patch("/api/admin/combos",{id:g,name:j.name,slug:j.slug||void 0,mode:j.mode,enabled:j.enabled,members:j.members}),pe.success("Combo updated"),p(!1),v(null),A()}catch(X){pe.error(X.message)}finally{w(!1)}}},z=X=>{R(q=>({...q,members:[...q.members,{modelId:X,weight:1,position:q.members.length,enabled:!0}]}))},K=X=>{R(q=>({...q,members:q.members.filter((le,J)=>J!==X).map((le,J)=>({...le,position:J}))}))},oe=async X=>{if(confirm("Delete this combo?"))try{await Se.del(`/api/admin/combos/${X}`),pe.success("Combo removed"),A()}catch(q){pe.error(q.message)}};return s.jsxs("div",{children:[s.jsx(Na,{title:"Combos",description:"Virtual models combining physical models",actions:s.jsxs(Mn,{open:u,onOpenChange:d,children:[s.jsx(Po,{asChild:!0,children:s.jsxs(de,{children:[s.jsx(zo,{className:"mr-1 h-4 w-4"})," New combo"]})}),s.jsxs(hn,{className:"max-w-2xl",children:[s.jsx(mn,{children:s.jsx(pn,{children:"New combo"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(xe,{children:"Name"}),s.jsx(Re,{value:C.name,onChange:X=>E({...C,name:X.target.value})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Slug (optional — empty uses the name as the model ID)"}),s.jsx(Re,{value:C.slug,onChange:X=>E({...C,slug:X.target.value}),placeholder:"empty → gpt-5.5 · set → combo/gpt-5.5"})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Mode"}),s.jsxs(Kn,{value:C.mode,onValueChange:X=>E({...C,mode:X}),children:[s.jsx(_n,{children:s.jsx(Xn,{})}),s.jsxs(On,{children:[s.jsx(ot,{value:"fallback",children:"Fallback (ordered)"}),s.jsx(ot,{value:"weighted_round_robin",children:"Weighted round-robin"})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ca,{checked:C.enabled,onCheckedChange:X=>E({...C,enabled:X})}),s.jsx(xe,{children:"Enabled"})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Members"}),s.jsx(gy,{models:o,addedIds:C.members.map(X=>X.modelId),onAdd:T}),s.jsx("div",{className:"mt-2 space-y-1",children:C.members.map((X,q)=>{var le;return s.jsxs("div",{className:"flex items-center gap-2 rounded border p-2 text-sm",children:[s.jsx("span",{className:"font-mono text-xs",children:(le=o.find(J=>J.id===X.modelId))==null?void 0:le.publicModelId}),s.jsx(Re,{type:"number",min:1,value:X.weight,onChange:J=>{const ce=Number(J.target.value);E(U=>({...U,members:U.members.map((Y,ae)=>ae===q?{...Y,weight:ce}:Y)}))},className:"w-20"}),s.jsx(de,{size:"sm",variant:"outline",onClick:()=>D(q),children:"Remove"})]},q)})})]})]}),s.jsxs(Dn,{children:[s.jsx(de,{variant:"outline",onClick:()=>d(!1),children:"Cancel"}),s.jsx(de,{disabled:!C.name||x,onClick:O,children:x?"Creating…":"Create"})]})]})]})}),s.jsxs(Ze,{children:[s.jsxs(Je,{children:[s.jsx(We,{className:"text-base",children:"All combos"}),s.jsxs(fn,{children:[n.length," total"]})]}),s.jsx(et,{children:s.jsxs(Zn,{children:[s.jsx(Jn,{children:s.jsxs(Xe,{children:[s.jsx(ge,{children:"Public ID"}),s.jsx(ge,{children:"Mode"}),s.jsx(ge,{children:"Members"}),s.jsx(ge,{children:"Healthy"}),s.jsx(ge,{children:"Enabled"}),s.jsx(ge,{})]})}),s.jsxs(Wn,{children:[n.length===0&&s.jsx(Xe,{children:s.jsx(he,{colSpan:6,className:"text-center text-muted-foreground",children:"No combos yet."})}),n.map(X=>s.jsxs(Xe,{children:[s.jsx(he,{className:"font-mono text-xs",children:X.publicModelId}),s.jsx(he,{children:s.jsx(at,{variant:"outline",children:X.mode})}),s.jsx(he,{children:X.memberCount}),s.jsx(he,{children:X.healthyMemberCount}),s.jsx(he,{children:X.enabled?"Yes":"No"}),s.jsx(he,{className:"text-right",children:s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[s.jsxs(de,{size:"sm",variant:"outline",onClick:()=>void M(X),children:[s.jsx(SC,{className:"h-3.5 w-3.5"})," Sửa"]}),s.jsxs(de,{size:"sm",variant:"destructive",onClick:()=>oe(X.id),children:[s.jsx(kc,{className:"h-3.5 w-3.5"})," Xoá"]})]})})]},X.id))]})]})})]}),s.jsx(Mn,{open:h,onOpenChange:p,children:s.jsxs(hn,{className:"max-w-2xl",children:[s.jsx(mn,{children:s.jsx(pn,{children:"Edit combo"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(xe,{children:"Name"}),s.jsx(Re,{value:j.name,onChange:X=>R({...j,name:X.target.value})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Slug (optional — leave empty to use the name as the model ID)"}),s.jsx(Re,{value:j.slug,onChange:X=>R({...j,slug:X.target.value}),placeholder:"empty → gpt-5.5 · set → combo/gpt-5.5"})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Mode"}),s.jsxs(Kn,{value:j.mode,onValueChange:X=>R({...j,mode:X}),children:[s.jsx(_n,{children:s.jsx(Xn,{})}),s.jsxs(On,{children:[s.jsx(ot,{value:"fallback",children:"Fallback (ordered)"}),s.jsx(ot,{value:"weighted_round_robin",children:"Weighted round-robin"})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ca,{checked:j.enabled,onCheckedChange:X=>R({...j,enabled:X})}),s.jsx(xe,{children:"Enabled"})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Members"}),s.jsx(gy,{models:o,addedIds:j.members.map(X=>X.modelId),onAdd:z}),s.jsx("div",{className:"mt-2 space-y-1",children:j.members.map((X,q)=>{var le;return s.jsxs("div",{className:"flex items-center gap-2 rounded border p-2 text-sm",children:[s.jsx("span",{className:"font-mono text-xs",children:(le=o.find(J=>J.id===X.modelId))==null?void 0:le.publicModelId}),s.jsx(Re,{type:"number",min:1,value:X.weight,onChange:J=>{const ce=Number(J.target.value);R(U=>({...U,members:U.members.map((Y,ae)=>ae===q?{...Y,weight:ce}:Y)}))},className:"w-20"}),s.jsx(de,{size:"sm",variant:"outline",onClick:()=>K(q),children:"Remove"})]},q)})})]})]}),s.jsxs(Dn,{children:[s.jsx(de,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),s.jsx(de,{disabled:!j.name||S,onClick:B,children:S?"Saving…":"Save"})]})]})})]})}function gy({models:n,addedIds:l,onAdd:o}){const[i,u]=m.useState(""),h=(i?n.filter(p=>{const g=i.toLowerCase();return p.publicModelId.toLowerCase().includes(g)||p.displayName.toLowerCase().includes(g)}):n).filter(p=>!l.includes(p.id));return s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"relative",children:[s.jsx(eb,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),s.jsx(Re,{className:"pl-8",placeholder:"Search models…",value:i,onChange:p=>u(p.target.value)}),i&&s.jsx("button",{className:"absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",onClick:()=>u(""),children:s.jsx(zc,{className:"h-4 w-4"})})]}),h.length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No models match."}):s.jsx("div",{className:"max-h-40 space-y-1 overflow-auto rounded border p-1",children:h.map(p=>s.jsxs("div",{className:"flex items-center justify-between rounded p-1 text-sm hover:bg-accent",children:[s.jsx("span",{className:"font-mono text-xs",children:p.publicModelId}),s.jsx(de,{size:"sm",variant:"ghost",onClick:()=>o(p.id),children:"+ Add"})]},p.id))})]})}function MD(){const[n,l]=m.useState([]),[o,i]=m.useState([]),[u,d]=m.useState([]),[h,p]=m.useState(!1),[g,v]=m.useState({alias:"",targetKind:"model",targetId:"",enabled:!0}),x=async()=>{const[S,w,C]=await Promise.all([Se.get("/api/admin/aliases"),Se.get("/api/admin/models"),Se.get("/api/admin/combos")]);l(S.aliases),i(w.models),d(C.combos)};m.useEffect(()=>{x()},[]);const y=async()=>{try{await Se.post("/api/admin/aliases",g),pe.success("Alias created"),p(!1),v({alias:"",targetKind:"model",targetId:"",enabled:!0}),x()}catch(S){pe.error(S.message)}};return s.jsxs("div",{children:[s.jsx(Na,{title:"Aliases",description:"Stable client-visible names for models or combos",actions:s.jsxs(Mn,{open:h,onOpenChange:p,children:[s.jsx(Po,{asChild:!0,children:s.jsxs(de,{children:[s.jsx(zo,{className:"mr-1 h-4 w-4"})," New alias"]})}),s.jsxs(hn,{children:[s.jsx(mn,{children:s.jsx(pn,{children:"New alias"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(xe,{children:"Alias"}),s.jsx(Re,{value:g.alias,onChange:S=>v({...g,alias:S.target.value}),placeholder:"coding"})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Target type"}),s.jsxs(Kn,{value:g.targetKind,onValueChange:S=>v({...g,targetKind:S}),children:[s.jsx(_n,{children:s.jsx(Xn,{})}),s.jsxs(On,{children:[s.jsx(ot,{value:"model",children:"Model"}),s.jsx(ot,{value:"combo",children:"Combo"})]})]})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Target"}),s.jsxs(Kn,{value:g.targetId,onValueChange:S=>v({...g,targetId:S}),children:[s.jsx(_n,{children:s.jsx(Xn,{placeholder:"Choose target"})}),s.jsx(On,{children:(g.targetKind==="model"?o:u).map(S=>s.jsx(ot,{value:S.id,children:S.publicModelId},S.id))})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ca,{checked:g.enabled,onCheckedChange:S=>v({...g,enabled:S})}),s.jsx(xe,{children:"Enabled"})]})]}),s.jsxs(Dn,{children:[s.jsx(de,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),s.jsx(de,{disabled:!g.alias||!g.targetId,onClick:y,children:"Create"})]})]})]})}),s.jsxs(Ze,{children:[s.jsxs(Je,{children:[s.jsx(We,{className:"text-base",children:"All aliases"}),s.jsxs(fn,{children:[n.length," total"]})]}),s.jsx(et,{children:s.jsxs(Zn,{children:[s.jsx(Jn,{children:s.jsxs(Xe,{children:[s.jsx(ge,{children:"Alias"}),s.jsx(ge,{children:"Target"}),s.jsx(ge,{children:"Type"}),s.jsx(ge,{children:"Enabled"}),s.jsx(ge,{})]})}),s.jsxs(Wn,{children:[n.length===0&&s.jsx(Xe,{children:s.jsx(he,{colSpan:5,className:"text-center text-muted-foreground",children:"No aliases yet."})}),n.map(S=>s.jsxs(Xe,{children:[s.jsx(he,{className:"font-mono text-xs",children:S.alias}),s.jsx(he,{className:"font-mono text-xs",children:S.targetName??S.targetId}),s.jsx(he,{children:s.jsx(at,{variant:"outline",children:S.targetKind})}),s.jsx(he,{children:S.enabled?"Yes":"No"}),s.jsx(he,{className:"text-right",children:s.jsx(de,{size:"sm",variant:"outline",onClick:async()=>{await Se.del(`/api/admin/aliases/${S.id}`),pe.success("Removed"),x()},children:"Delete"})})]},S.id))]})]})})]})]})}function DD(){const[n,l]=m.useState([]),[o,i]=m.useState([]),[u,d]=m.useState([]),[h,p]=m.useState(!1),[g,v]=m.useState(null),[x,y]=m.useState(null),[S,w]=m.useState(null),[C,E]=m.useState({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""}),j=async()=>{const[M,B,z]=await Promise.all([Se.get("/api/admin/api-keys"),Se.get("/api/admin/models"),Se.get("/api/admin/combos")]);l(M.apiKeys),i(B.models),d(z.combos)};m.useEffect(()=>{j()},[]);const R=async()=>{try{if(g){await Se.patch("/api/admin/api-keys",{id:g,name:C.name,expiresAt:C.expiresAt||null,allowAllModels:C.allowAll,permissions:C.allowAll?[]:C.permissions,rpmLimit:C.rpmLimit?Number(C.rpmLimit):null,tpmLimit:C.tpmLimit?Number(C.tpmLimit):null,maxConcurrent:C.concurrency?Number(C.concurrency):null}),p(!1),v(null),E({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""}),pe.success("Key updated"),j();return}const M=await Se.post("/api/admin/api-keys",{name:C.name,expiresAt:C.expiresAt||null,allowAllModels:C.allowAll,permissions:C.allowAll?void 0:C.permissions,rpmLimit:C.rpmLimit?Number(C.rpmLimit):null,tpmLimit:C.tpmLimit?Number(C.tpmLimit):null,maxConcurrent:C.concurrency?Number(C.concurrency):null,...C.customSecret.trim()?{secret:C.customSecret.trim()}:{}});p(!1),y({secret:M.secret,name:M.name}),E({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""}),j()}catch(M){pe.error(M.message)}},A=async M=>{try{const z=((await Se.get(`/api/admin/api-keys/${M.id}`)).apiKey.permissions??[]).filter(K=>K.targetKind==="model"||K.targetKind==="combo");v(M.id),E({name:M.name,expiresAt:M.expiresAt?M.expiresAt.slice(0,16):"",allowAll:M.allowAllModels,permissions:z,rpmLimit:M.rpmLimit!=null?String(M.rpmLimit):"",tpmLimit:M.tpmLimit!=null?String(M.tpmLimit):"",concurrency:M.concurrencyLimit!=null?String(M.concurrencyLimit):"",customSecret:""}),p(!0)}catch(B){pe.error(B.message)}},T=()=>{p(!1),v(null),E({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""})},D=async(M,B)=>{try{await Se.patch("/api/admin/api-keys",{id:M,enabled:!B}),pe.success(B?"Key disabled":"Key enabled"),j()}catch(z){pe.error(z.message)}},O=async M=>{if(window.confirm("Delete this API key? This cannot be undone."))try{await Se.del(`/api/admin/api-keys/${M}`),pe.success("Key deleted"),j()}catch(B){pe.error(B.message)}};return s.jsxs("div",{children:[s.jsx(Na,{title:"API Keys",description:"Gateway bearer keys for client applications",actions:s.jsxs(Mn,{open:h,onOpenChange:M=>{M?p(!0):T()},children:[s.jsx(Po,{asChild:!0,children:s.jsxs(de,{children:[s.jsx(zo,{className:"mr-1 h-4 w-4"})," New key"]})}),s.jsxs(hn,{className:"max-w-2xl",children:[s.jsx(mn,{children:s.jsx(pn,{children:g?"Edit API key":"New API key"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(xe,{children:"Name"}),s.jsx(Re,{value:C.name,onChange:M=>E({...C,name:M.target.value})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Expires (optional)"}),s.jsx(Re,{type:"datetime-local",value:C.expiresAt,onChange:M=>E({...C,expiresAt:M.target.value})})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[s.jsxs("div",{children:[s.jsx(xe,{children:"RPM limit"}),s.jsx(Re,{value:C.rpmLimit,onChange:M=>E({...C,rpmLimit:M.target.value}),type:"number"})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"TPM limit"}),s.jsx(Re,{value:C.tpmLimit,onChange:M=>E({...C,tpmLimit:M.target.value}),type:"number"})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Concurrency"}),s.jsx(Re,{value:C.concurrency,onChange:M=>E({...C,concurrency:M.target.value}),type:"number"})]})]}),!g&&s.jsxs("div",{children:[s.jsx(xe,{children:"Key value (optional)"}),s.jsx(Re,{value:C.customSecret,onChange:M=>E({...C,customSecret:M.target.value}),placeholder:"Leave empty to auto-generate ld-…"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"If provided, this exact value is stored as the key. Otherwise a random ld-… key is generated."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ca,{checked:C.allowAll,onCheckedChange:M=>E({...C,allowAll:M})}),s.jsx(xe,{children:"Allow all current and future models"})]}),!C.allowAll&&s.jsxs("div",{children:[s.jsx(xe,{children:"Scope"}),s.jsx("div",{className:"max-h-48 space-y-1 overflow-auto rounded border p-2",children:[...o.map(M=>({targetKind:"model",targetId:M.id,label:M.publicModelId})),...u.map(M=>({targetKind:"combo",targetId:M.id,label:M.publicModelId}))].map(M=>{const B=C.permissions.some(z=>z.targetKind===M.targetKind&&z.targetId===M.targetId);return s.jsxs("label",{className:"flex items-center gap-2 rounded p-1 text-sm hover:bg-accent",children:[s.jsx(ym,{checked:B,onCheckedChange:z=>{E(K=>({...K,permissions:z?[...K.permissions,{targetKind:M.targetKind,targetId:M.targetId}]:K.permissions.filter(oe=>!(oe.targetKind===M.targetKind&&oe.targetId===M.targetId))}))}}),s.jsx("span",{className:"font-mono text-xs",children:M.label}),s.jsx(at,{variant:"outline",className:"ml-1",children:M.targetKind})]},`${M.targetKind}:${M.targetId}`)})})]})]}),s.jsxs(Dn,{children:[s.jsx(de,{variant:"outline",onClick:T,children:"Cancel"}),s.jsx(de,{disabled:!C.name,onClick:R,children:g?"Save changes":"Create"})]})]})]})}),s.jsxs(Ze,{children:[s.jsxs(Je,{children:[s.jsx(We,{className:"text-base",children:"All keys"}),s.jsxs(fn,{children:[n.length," total"]})]}),s.jsx(et,{children:s.jsxs(Zn,{children:[s.jsx(Jn,{children:s.jsxs(Xe,{children:[s.jsx(ge,{children:"Name"}),s.jsx(ge,{children:"Prefix"}),s.jsx(ge,{children:"Status"}),s.jsx(ge,{children:"Scope"}),s.jsx(ge,{children:"RPM/TPM/Conc"}),s.jsx(ge,{})]})}),s.jsxs(Wn,{children:[n.length===0&&s.jsx(Xe,{children:s.jsx(he,{colSpan:6,className:"text-center text-muted-foreground",children:"No API keys yet."})}),n.map(M=>s.jsxs(Xe,{children:[s.jsx(he,{className:"font-medium",children:M.name}),s.jsxs(he,{className:"font-mono text-xs",children:[M.keyPrefix,"…"]}),s.jsx(he,{children:M.enabled?s.jsx(at,{variant:"success",children:"enabled"}):s.jsx(at,{variant:"destructive",children:"disabled"})}),s.jsx(he,{children:M.allowAllModels?"all":`${M.modelScopeCount} scoped`}),s.jsx(he,{className:"text-xs",children:[M.rpmLimit,M.tpmLimit,M.concurrencyLimit].map((B,z)=>B?["","RPM","TPM","Conc"][z+1]:null).filter(Boolean).join(" / ")||"—"}),s.jsx(he,{className:"text-right",children:s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[M.secret&&s.jsxs(s.Fragment,{children:[s.jsx(de,{size:"sm",variant:"ghost",title:"Copy secret",onClick:()=>{navigator.clipboard.writeText(M.secret),pe.success("Copied")},children:s.jsx(Ef,{className:"h-3.5 w-3.5"})}),s.jsx(de,{size:"sm",variant:"ghost",title:"Show secret",onClick:()=>w({secret:M.secret,name:M.name}),children:s.jsx(cC,{className:"h-3.5 w-3.5"})})]}),s.jsx(de,{size:"sm",variant:"ghost",title:"Edit",onClick:()=>void A(M),children:s.jsx(pC,{className:"h-3.5 w-3.5"})}),s.jsxs(de,{size:"sm",variant:"outline",onClick:()=>D(M.id,M.enabled),children:[M.enabled?s.jsx(J2,{className:"mr-1 h-3.5 w-3.5"}):s.jsx(Oc,{className:"mr-1 h-3.5 w-3.5"}),M.enabled?"Disable":"Enable"]}),s.jsx(de,{size:"sm",variant:"destructive",onClick:()=>O(M.id),children:s.jsx(kc,{className:"h-3.5 w-3.5"})})]})})]},M.id))]})]})})]}),s.jsx(Mn,{open:!!x,onOpenChange:M=>{M||y(null)},children:s.jsxs(hn,{children:[s.jsxs(mn,{children:[s.jsx(pn,{children:"API key created"}),s.jsx(ch,{children:"Copy now — this secret will not be shown again."})]}),s.jsx("div",{className:"rounded border bg-muted p-3 font-mono text-xs break-all",children:x==null?void 0:x.secret}),s.jsxs(Dn,{children:[s.jsxs(de,{onClick:()=>{x&&(navigator.clipboard.writeText(x.secret),pe.success("Copied"))},children:[s.jsx(Ef,{className:"mr-1 h-4 w-4"})," Copy"]}),s.jsx(de,{variant:"outline",onClick:()=>y(null),children:"I have saved it"})]})]})}),s.jsx(Mn,{open:!!S,onOpenChange:M=>{M||w(null)},children:s.jsxs(hn,{children:[s.jsxs(mn,{children:[s.jsxs(pn,{children:["API key: ",S==null?void 0:S.name]}),s.jsx(ch,{children:"Full secret for this key, readable any time."})]}),s.jsx("div",{className:"rounded border bg-muted p-3 font-mono text-xs break-all",children:S==null?void 0:S.secret}),s.jsxs(Dn,{children:[s.jsxs(de,{onClick:()=>{S&&(navigator.clipboard.writeText(S.secret),pe.success("Copied"))},children:[s.jsx(Ef,{className:"mr-1 h-4 w-4"})," Copy"]}),s.jsx(de,{variant:"outline",onClick:()=>w(null),children:"Close"})]})]})})]})}const _D=3e3;function OD(n,l){return!(l.success!=="all"&&n.success!==(l.success==="true")||l.protocol!=="all"&&n.protocol!==l.protocol||l.streaming!=="all"&&n.streaming!==(l.streaming==="true")||l.model&&!n.requestedModel.toLowerCase().includes(l.model.toLowerCase()))}function kD(){const[n,l]=m.useState([]),[o,i]=m.useState(0),[u,d]=m.useState(0),[h,p]=m.useState({success:"all",protocol:"all",streaming:"all",model:""}),[g,v]=m.useState(null),[x,y]=m.useState(null),[S,w]=m.useState(0),C=50,E=m.useRef(Date.now()),j=m.useRef(new Set),R=m.useRef(h);R.current=h;const A=m.useRef(u);A.current=u;const T=m.useCallback(async()=>{const O=new URLSearchParams;O.set("limit",String(C)),O.set("offset",String(u)),h.success!=="all"&&O.set("success",h.success),h.protocol!=="all"&&O.set("protocol",h.protocol),h.streaming!=="all"&&O.set("streaming",h.streaming),h.model&&O.set("requestedModel",h.model);const M=await Se.get(`/api/admin/requests?${O.toString()}`);l(M.requests),i(M.total);for(const B of M.requests)j.current.add(B.id)},[u,h]);m.useEffect(()=>{T()},[T]),m.useEffect(()=>{w(0)},[u,h]),m.useEffect(()=>{let O=!1,M=null;const B=new Set,z=()=>{O||(M=new EventSource(`/api/admin/requests/stream?since=${E.current}`),M.addEventListener("request",K=>{if(!O)try{const oe=JSON.parse(K.data),X=new Date(oe.createdAt).getTime();if(Number.isFinite(X)&&(E.current=Math.max(E.current,X)),j.current.has(oe.id))return;j.current.add(oe.id),w(q=>q+1),A.current===0&&OD(oe,R.current)&&(l(q=>q.some(le=>le.id===oe.id)?q:[oe,...q].slice(0,C)),i(q=>q+1))}catch{}}),M.onerror=()=>{M==null||M.close(),M=null,O||B.add(setTimeout(z,_D))})};return z(),()=>{O=!0,M==null||M.close();for(const K of B)clearTimeout(K);B.clear()}},[]);const D=async O=>{v(O);const M=await Se.get(`/api/admin/requests/${O}`);y(M)};return s.jsxs("div",{children:[s.jsx(Na,{title:"Requests",description:`${o} matching · live updates`}),s.jsxs(Ze,{children:[s.jsxs(Je,{children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs(Kn,{value:h.success,onValueChange:O=>{d(0),p({...h,success:O})},children:[s.jsx(_n,{className:"w-36",children:s.jsx(Xn,{})}),s.jsxs(On,{children:[s.jsx(ot,{value:"all",children:"All"}),s.jsx(ot,{value:"true",children:"Success"}),s.jsx(ot,{value:"false",children:"Failed"})]})]}),s.jsxs(Kn,{value:h.protocol,onValueChange:O=>{d(0),p({...h,protocol:O})},children:[s.jsx(_n,{className:"w-32",children:s.jsx(Xn,{})}),s.jsxs(On,{children:[s.jsx(ot,{value:"all",children:"Any protocol"}),s.jsx(ot,{value:"openai",children:"OpenAI"}),s.jsx(ot,{value:"anthropic",children:"Anthropic"})]})]}),s.jsxs(Kn,{value:h.streaming,onValueChange:O=>{d(0),p({...h,streaming:O})},children:[s.jsx(_n,{className:"w-32",children:s.jsx(Xn,{})}),s.jsxs(On,{children:[s.jsx(ot,{value:"all",children:"Any"}),s.jsx(ot,{value:"true",children:"Streaming"}),s.jsx(ot,{value:"false",children:"Non-stream"})]})]}),s.jsx(Re,{className:"max-w-xs",placeholder:"Model contains…",value:h.model,onChange:O=>{d(0),p({...h,model:O.target.value})}}),S>0&&s.jsxs(de,{size:"sm",variant:"secondary",onClick:()=>{w(0),T()},children:[S," new request",S>1?"s":""," — refresh"]})]}),s.jsx(We,{className:"mt-3 text-base",children:"Results"})]}),s.jsxs(et,{children:[s.jsxs(Zn,{children:[s.jsx(Jn,{children:s.jsxs(Xe,{children:[s.jsx(ge,{children:"Time"}),s.jsx(ge,{children:"Status"}),s.jsx(ge,{children:"Requested"}),s.jsx(ge,{children:"Final"}),s.jsx(ge,{children:"Tokens"}),s.jsx(ge,{children:"Latency"}),s.jsx(ge,{children:"Attempts"}),s.jsx(ge,{children:"Key"}),s.jsx(ge,{children:"IP"}),s.jsx(ge,{})]})}),s.jsxs(Wn,{children:[n.length===0&&s.jsx(Xe,{children:s.jsx(he,{colSpan:10,className:"text-center text-muted-foreground",children:"No requests yet."})}),n.map(O=>s.jsxs(Xe,{className:"cursor-pointer",onClick:()=>D(O.id),children:[s.jsx(he,{className:"text-xs",children:Mh(O.createdAt)}),s.jsx(he,{children:O.success?s.jsx(at,{variant:"success",children:O.httpStatus}):s.jsx(at,{variant:"destructive",children:O.httpStatus})}),s.jsx(he,{className:"font-mono text-xs",children:O.requestedModel}),s.jsx(he,{className:"font-mono text-xs text-muted-foreground",children:O.finalModelPublicId??"—"}),s.jsxs(he,{className:"text-xs",children:[Ot(O.inputTokens+O.outputTokens)," ",O.cacheReadTokens?s.jsxs("span",{className:"text-amber-600",children:["(+",O.cacheReadTokens," cache)"]}):null]}),s.jsxs(he,{className:"text-xs",children:[hr(O.totalLatencyMs),O.ttftMs?s.jsxs("span",{className:"text-muted-foreground",children:[" · ttft ",O.ttftMs,"ms"]}):null]}),s.jsxs(he,{className:"text-xs",children:[O.attemptsCount,O.gatewayCacheHit?s.jsx(at,{variant:"secondary",className:"ml-1",children:"cache"}):null]}),s.jsx(he,{className:"text-xs",children:O.apiKeyName??"—"}),s.jsx(he,{className:"text-xs",children:O.clientIp}),s.jsx(he,{className:"text-right",children:s.jsx(de,{size:"sm",variant:"ghost",children:"View"})})]},O.id))]})]}),s.jsxs("div",{className:"mt-3 flex items-center justify-between",children:[s.jsxs("span",{className:"text-xs text-muted-foreground",children:["Showing ",u+1,"–",Math.min(u+C,o)," of ",o]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(de,{size:"sm",variant:"outline",disabled:u===0,onClick:()=>d(Math.max(0,u-C)),children:"Prev"}),s.jsx(de,{size:"sm",variant:"outline",disabled:u+C>=o,onClick:()=>d(u+C),children:"Next"})]})]})]})]}),s.jsx(Mn,{open:!!g,onOpenChange:O=>{O||(v(null),y(null))},children:s.jsxs(hn,{className:"max-w-3xl",children:[s.jsx(mn,{children:s.jsxs(pn,{children:["Request ",lE(g,16)]})}),x?s.jsxs("div",{className:"space-y-3 text-sm",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Status"}),x.request.success?s.jsx(at,{variant:"success",children:x.request.httpStatus}):s.jsx(at,{variant:"destructive",children:x.request.httpStatus})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Latency"}),hr(x.request.totalLatencyMs)]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Tokens"}),"in ",Ot(x.request.inputTokens)," · out ",Ot(x.request.outputTokens)," · cache ",Ot(x.request.cacheReadTokens)]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Attempts"}),x.request.attemptsCount]})]}),x.request.errorType&&s.jsxs("div",{className:"rounded border border-destructive/40 bg-destructive/10 p-2",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Error"}),s.jsxs("div",{className:"font-mono text-xs",children:[x.request.errorType,": ",x.request.errorMessage]})]}),x.request.requestPayload&&s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Request content"}),s.jsx("pre",{className:"max-h-60 overflow-auto rounded bg-muted p-2 font-mono text-xs whitespace-pre-wrap",children:x.request.requestPayload})]}),x.request.responsePayload&&s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Response content"}),s.jsx("pre",{className:"max-h-60 overflow-auto rounded bg-muted p-2 font-mono text-xs whitespace-pre-wrap",children:x.request.responsePayload})]}),x.attempts.length>0&&s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Attempts"}),s.jsxs(Zn,{children:[s.jsx(Jn,{children:s.jsxs(Xe,{children:[s.jsx(ge,{children:"#"}),s.jsx(ge,{children:"Provider"}),s.jsx(ge,{children:"Model"}),s.jsx(ge,{children:"Status"}),s.jsx(ge,{children:"Latency"}),s.jsx(ge,{children:"Reason"})]})}),s.jsx(Wn,{children:x.attempts.map(O=>s.jsxs(Xe,{children:[s.jsx(he,{children:O.attemptNumber}),s.jsx(he,{children:O.providerName}),s.jsx(he,{className:"font-mono text-xs",children:O.modelPublicId}),s.jsx(he,{children:O.success?s.jsx(at,{variant:"success",children:String(O.statusCode??"OK")}):s.jsx(at,{variant:"destructive",children:String(O.statusCode??"err")})}),s.jsx(he,{className:"text-xs",children:hr(O.latencyMs)}),s.jsx(he,{className:"text-xs",children:O.failureReason??O.selectionReason})]},O.id))})]})]})]}):s.jsx("div",{className:"text-muted-foreground",children:"Loading…"})]})})]})}var zD=Object.defineProperty,Rs=(n,l)=>zD(n,"name",{value:l,configurable:!0}),bm="Tabs",[LD,nO]=yn(bm,[Kc]),R1=Kc(),[UD,Sm]=LD(bm),BD=m.forwardRef(Rs(function(l,o){const{__scopeTabs:i,value:u,onValueChange:d,defaultValue:h,orientation:p="horizontal",dir:g,activationMode:v="automatic",...x}=l,y=Uo(g),[S,w]=el({prop:u,onChange:d,defaultProp:h??"",caller:bm});return s.jsx(UD,{scope:i,baseId:ba(),value:S,onValueChange:w,orientation:p,dir:y,activationMode:v,children:s.jsx(Pe.div,{dir:y,"data-orientation":p,...x,ref:o})})},"Tabs")),HD="TabsList",PD=m.forwardRef(Rs(function(l,o){const{__scopeTabs:i,loop:u=!0,...d}=l,h=Sm(HD,i),p=R1(i);return s.jsx(m0,{asChild:!0,...p,orientation:h.orientation,dir:h.dir,loop:u,children:s.jsx(Pe.div,{role:"tablist","aria-orientation":h.orientation,...d,ref:o})})},"TabsList")),qD="TabsTrigger",ID=m.forwardRef(Rs(function(l,o){const{__scopeTabs:i,value:u,disabled:d=!1,...h}=l,p=Sm(qD,i),g=R1(i),v=wm(p.baseId,u),x=jm(p.baseId,u),y=u===p.value;return s.jsx(p0,{asChild:!0,...g,focusable:!d,active:y,children:s.jsx(Pe.button,{type:"button",role:"tab","aria-selected":y,"aria-controls":x,"data-state":y?"active":"inactive","data-disabled":d?"":void 0,disabled:d,id:v,...h,ref:o,onMouseDown:je(l.onMouseDown,S=>{!d&&S.button===0&&S.ctrlKey===!1?p.onValueChange(u):S.preventDefault()}),onKeyDown:je(l.onKeyDown,S=>{d||S.target!==S.currentTarget||[" ","Enter"].includes(S.key)&&p.onValueChange(u)}),onFocus:je(l.onFocus,()=>{const S=p.activationMode!=="manual";!y&&!d&&S&&p.onValueChange(u)})})})},"TabsTrigger")),VD="TabsContent",GD=m.forwardRef(Rs(function(l,o){const{__scopeTabs:i,value:u,forceMount:d,children:h,...p}=l,g=Sm(VD,i),v=wm(g.baseId,u),x=jm(g.baseId,u),y=u===g.value,S=m.useRef(y);return m.useEffect(()=>{const w=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(w)},[]),s.jsx(rl,{present:d||y,children:({present:w})=>s.jsx(Pe.div,{"data-state":y?"active":"inactive","data-orientation":g.orientation,role:"tabpanel","aria-labelledby":v,hidden:!w,id:x,tabIndex:0,...p,ref:o,style:{...l.style,animationDuration:S.current?"0s":void 0},children:w&&h})})},"TabsContent"));function wm(n,l){return`${n}-trigger-${l}`}Rs(wm,"makeTriggerId");function jm(n,l){return`${n}-content-${l}`}Rs(jm,"makeContentId");var YD=BD,T1=PD,A1=ID,M1=GD;const D1=YD,Cm=m.forwardRef(({className:n,...l},o)=>s.jsx(T1,{ref:o,className:Ee("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",n),...l}));Cm.displayName=T1.displayName;const Fa=m.forwardRef(({className:n,...l},o)=>s.jsx(A1,{ref:o,className:Ee("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",n),...l}));Fa.displayName=A1.displayName;const fs=m.forwardRef(({className:n,...l},o)=>s.jsx(M1,{ref:o,className:Ee("mt-2 ring-offset-background focus-visible:outline-none",n),...l}));fs.displayName=M1.displayName;const $D=3e3,KD=1600,XD=10,FD=3,QD=12,ZD=10*6e4;function JD(n,l){return{...n,totalRequests:n.totalRequests+1,successfulRequests:n.successfulRequests+(l.success?1:0),failedRequests:n.failedRequests+(l.success?0:1),successRate:n.totalRequests+1?(n.successfulRequests+(l.success?1:0))/(n.totalRequests+1):0,inputTokens:n.inputTokens+l.inputTokens,outputTokens:n.outputTokens+l.outputTokens,totalTokens:n.totalTokens+l.inputTokens+l.outputTokens,cacheReadTokens:n.cacheReadTokens+l.cacheReadTokens,averageLatencyMs:(n.averageLatencyMs*n.totalRequests+l.totalLatencyMs)/(n.totalRequests+1)}}function WD(n){const[l,o]=m.useState(null),[i,u]=m.useState(null),[d,h]=m.useState([]),[p,g]=m.useState([]),[v,x]=m.useState([]),[y,S]=m.useState([]),[w,C]=m.useState(!0),[E,j]=m.useState(null),R=m.useRef([]),A=m.useRef(null),T=m.useRef(new Set),D=m.useRef(Date.now()),O=m.useRef(0),M=m.useRef([]),B=m.useRef([]);return m.useEffect(()=>{let z=!1;return C(!0),j(null),T.current=new Set,D.current=Date.now(),Se.get(`/api/admin/stats?preset=${n}`).then(K=>{if(!z){o(K),u(K.summary),A.current=K.summary,h(K.recent),g(K.providers),R.current=K.providers;for(const oe of K.recent)T.current.add(oe.id);C(!1)}}).catch(K=>{z||(j(K.message),C(!1))}),()=>{z=!0}},[n]),m.useEffect(()=>{let z=!1,K=null;const oe=new Set,X=()=>{z||(K=new EventSource(`/api/admin/requests/stream?since=${D.current}`),K.addEventListener("request",le=>{if(!z)try{const J=JSON.parse(le.data),ce=new Date(J.createdAt).getTime();if(Number.isFinite(ce)&&(D.current=Math.max(D.current,ce)),T.current.has(J.id))return;if(T.current.add(J.id),A.current&&u(JD(A.current,J)),h(U=>U.some(Y=>Y.id===J.id)?U:[J,...U].slice(0,XD)),J.providerId){R.current=R.current.map(W=>W.id===J.providerId?{...W,requests:W.requests+1,errorRate:W.requests+1?(W.errorRate*W.requests+(J.success?0:1))/(W.requests+1):0}:W),g(R.current);const U=`p${++O.current}`,Y={id:U,providerId:J.providerId,success:J.success};M.current=[...M.current.slice(-(FD*4)),Y],x(M.current);const ae=setTimeout(()=>{M.current=M.current.filter(W=>W.id!==U),x(M.current)},KD);oe.add(ae)}B.current.some(U=>U.id===J.id)&&(B.current=B.current.filter(U=>U.id!==J.id),S(B.current))}catch{}}),K.addEventListener("request_started",le=>{if(!z)try{const J=JSON.parse(le.data);if(!J.providerId||J.providerId==="")return;B.current=[...B.current.filter(ce=>ce.id!==J.requestId).slice(-(QD-1)),{id:J.requestId,providerId:J.providerId,startedAt:Date.now(),ttftMs:J.ttftMs??0}],S(B.current)}catch{}}),K.onerror=()=>{K==null||K.close(),K=null,z||oe.add(setTimeout(X,$D))})};X();const q=setInterval(()=>{const le=Date.now()-ZD;B.current.some(J=>J.startedAt<le)&&(B.current=B.current.filter(J=>J.startedAt>=le),S(B.current))},3e4);return()=>{z=!0,K==null||K.close();for(const le of oe)clearTimeout(le);oe.clear(),clearInterval(q)}},[]),m.useEffect(()=>{const z=setInterval(()=>{Se.get("/api/admin/providers").then(K=>{const oe=new Map(K.providers.map(X=>[X.id,X]));R.current=R.current.map(X=>{const q=oe.get(X.id);return q?{...X,health:q.health,enabled:q.enabled}:X}),g(R.current)}).catch(()=>{})},3e4);return()=>clearInterval(z)},[]),{snapshot:l,live:i??(l==null?void 0:l.summary)??e_,recent:d,providers:p,pulses:v,activeRoutes:y,loading:w,error:E}}const e_={totalRequests:0,successfulRequests:0,failedRequests:0,successRate:0,inputTokens:0,outputTokens:0,totalTokens:0,cacheReadTokens:0,cacheWriteTokens:0,reasoningTokens:0,averageLatencyMs:0,p95LatencyMs:0,averageTtftMs:null,p95TtftMs:null,cacheHitRate:0,gatewayCacheHitRate:0,fallbackRate:0};function _1({data:n,className:l,strokeClass:o="stroke-primary",fillClass:i}){if(n.length===0)return s.jsx("svg",{className:Ee("h-6 w-20",l),viewBox:"0 0 80 24"});const h=Math.max(...n),p=Math.min(...n),g=h-p||1,x=n.map((y,S)=>{const w=S/(n.length-1)*78+1,C=22-(y-p)/g*20;return`${w.toFixed(1)},${C.toFixed(1)}`}).join(" ");return s.jsxs("svg",{className:Ee("h-6 w-20",l),viewBox:"0 0 80 24",preserveAspectRatio:"none",children:[i&&s.jsx("polygon",{points:`1,23 ${x} 79,23`,className:i}),s.jsx("polyline",{points:x,fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:o})]})}function t_(n,l,o){const i=performance.now();let u=0;const d=h=>{const p=Math.min((h-i)/l,1),g=Math.round(n*p);g!==u&&(u=g,o(g)),p<1&&requestAnimationFrame(d)};requestAnimationFrame(d)}function n_({delta:n,inverse:l}){if(Math.abs(n)<.005)return null;const o=n>0,i=l?!o:o,u=`${(Math.abs(n)*100).toFixed(1)}%`;return s.jsxs("span",{className:Ee("ml-1.5 inline-flex items-center rounded-full px-1.5 py-0.5 text-[10px] font-semibold leading-none",i?"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-300":"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300"),children:[s.jsx("span",{className:"mr-0.5",children:o?"▲":"▼"}),u]})}function zl({icon:n,label:l,value:o,format:i="number",delta:u,deltaInverse:d,sparkData:h,sparkStroke:p}){const[g,v]=m.useState(0),x=m.useRef(0);m.useEffect(()=>{const S=x.current,w=o;x.current=o,S!==w&&t_(Math.abs(w-S),600,C=>v(S+(w>S?C:-C)))},[o]);const y=i==="percent"?Lc(g):i==="latency"?hr(g):Ot(Math.round(g));return s.jsxs(Ze,{children:[s.jsxs(Je,{className:"flex flex-row items-center justify-between pb-1",children:[s.jsxs(We,{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:[s.jsx(n,{className:"h-4 w-4"}),l]}),u!==void 0&&s.jsx(n_,{delta:u,inverse:d})]}),s.jsxs(et,{className:"flex items-end justify-between",children:[s.jsx("span",{className:"text-2xl font-semibold tabular-nums",children:y}),h&&h.length>1&&s.jsx(_1,{data:h,strokeClass:p??"stroke-primary",fillClass:"fill-primary/10"})]})]})}const O1=1e3,vy=380,fc=60,Ll=O1/2,Ul=720,Hf=62,a_=260;function l_(n){return n==="healthy"?"fill-emerald-400":n==="degraded"?"fill-amber-400":"fill-red-400"}function hc(n,l,o,i){const u=n+(o-n)*.45,d=n+(o-n)*.55;return`M${n},${l} C${u},${l} ${d},${i} ${o},${i}`}function r_({liveRequests:n,successRate:l,providers:o,pulses:i,activeRoutes:u}){const d=vy/2,h=d,p=Math.max(1,o.reduce((x,y)=>x+y.requests,0)),g=new Set(u.map(x=>x.providerId)),v=g.size>0;return s.jsxs(Ze,{children:[s.jsx(Je,{className:"pb-2",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(We,{className:"text-base",children:"Real-time Request Routing"}),s.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-emerald-400"})," healthy"]}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-400"})," degraded"]}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-red-400"})," down"]})]})]})}),s.jsx(et,{className:"pt-0",children:s.jsx("div",{className:"relative w-full",children:s.jsxs("svg",{viewBox:`0 0 ${O1} ${vy}`,className:"w-full h-auto",preserveAspectRatio:"xMidYMid meet",children:[s.jsx("defs",{children:s.jsxs("filter",{id:"glow",x:"-50%",y:"-50%",width:"200%",height:"200%",children:[s.jsx("feGaussianBlur",{stdDeviation:"3",result:"blur"}),s.jsxs("feMerge",{children:[s.jsx("feMergeNode",{in:"blur"}),s.jsx("feMergeNode",{in:"SourceGraphic"})]})]})}),o.map(x=>{const S=60+o.indexOf(x)*Hf,w=x.requests/p,C=Math.max(1.5,Math.min(6,2+w*8)),E=g.has(x.id);return s.jsxs("g",{children:[E&&s.jsx("path",{d:hc(Ll,d,Ul-20,S),fill:"none",stroke:"hsl(var(--primary) / 0.25)",strokeWidth:C+6,strokeLinecap:"round"}),s.jsx("path",{d:hc(Ll,d,Ul-20,S),fill:"none",stroke:E?"hsl(var(--primary))":"hsl(var(--border))",strokeWidth:E?C+1:C,strokeLinecap:"round",opacity:E?.95:.6,className:E?"route-active":void 0})]},x.id)}),s.jsx("path",{d:hc(fc+30,h,Ll-30,d),fill:"none",stroke:v?"hsl(var(--primary))":"hsl(var(--border))",strokeWidth:3,strokeLinecap:"round",strokeDasharray:"6 3",opacity:v?.9:.5,className:v?"route-active":void 0}),i.map(x=>{const y=o.findIndex(E=>E.id===x.providerId);if(y===-1)return null;const S=60+y*Hf,w=hc(Ll,d,Ul-20,S),C=x.success?"var(--primary)":"#f87171";return s.jsxs("g",{filter:"url(#glow)",children:[s.jsx("circle",{r:5,fill:C,opacity:.9,children:s.jsx("animateMotion",{dur:"1.4s",fill:"freeze",path:w})}),s.jsx("circle",{r:9,fill:C,opacity:.25,children:s.jsx("animateMotion",{dur:"1.4s",fill:"freeze",path:w})})]},x.id)}),s.jsx("circle",{cx:fc,cy:h,r:28,fill:"hsl(var(--card))",stroke:"hsl(var(--border))",strokeWidth:1.5}),s.jsx("text",{x:fc,y:h-4,textAnchor:"middle",className:"fill-foreground",fontSize:12,fontWeight:600,children:xy(n)}),s.jsx("text",{x:fc,y:h+10,textAnchor:"middle",className:"fill-muted-foreground",fontSize:9,children:"requests"}),s.jsx("circle",{cx:Ll,cy:d,r:36,fill:"hsl(var(--card))",stroke:"var(--primary)",strokeWidth:2}),s.jsx("image",{x:Ll-12,y:d-16,width:24,height:24,href:"/logo.png"}),s.jsx("text",{x:Ll,y:d+28,textAnchor:"middle",className:"fill-muted-foreground",fontSize:9,children:"AI Gateway"}),s.jsxs("text",{x:Ll,y:d+38,textAnchor:"middle",className:"fill-emerald-500",fontSize:10,fontWeight:600,children:[(l*100).toFixed(1),"%"]}),o.map((x,y)=>{const S=60+y*Hf,w=x.requests/p,C=!x.enabled||x.requests===0;return s.jsxs("g",{opacity:C?.4:1,children:[s.jsx("rect",{x:Ul-20,y:S-14,width:a_,height:50,rx:8,fill:"hsl(var(--card))",stroke:"hsl(var(--border))",strokeWidth:1}),s.jsx("circle",{cx:Ul-6,cy:S+10,r:4,className:l_(x.health)}),s.jsx("text",{x:Ul+6,y:S-2,className:"fill-foreground",fontSize:12,fontWeight:500,children:x.name}),s.jsxs("text",{x:Ul+6,y:S+12,className:"fill-muted-foreground",fontSize:10,children:[x.modelCount," model",x.modelCount!==1?"s":""," · ",xy(x.requests)," req"]}),s.jsxs("text",{x:Ul+6,y:S+25,className:"fill-muted-foreground",fontSize:10,children:[(w*100).toFixed(1),"% traffic · ",x.avgLatencyMs<1e3?`${Math.round(x.avgLatencyMs)}ms`:`${(x.avgLatencyMs/1e3).toFixed(1)}s`," avg",x.errorRate>0&&s.jsxs("tspan",{className:"fill-red-500",children:[" · ",(x.errorRate*100).toFixed(0),"% err"]})]})]},x.id)})]})})})]})}function xy(n){return n>=1e6?`${(n/1e6).toFixed(1)}M`:n>=1e3?`${(n/1e3).toFixed(1)}K`:String(n)}function s_({rows:n}){return s.jsxs(Ze,{children:[s.jsx(Je,{className:"pb-2",children:s.jsx(We,{className:"text-base",children:"Recent Requests"})}),s.jsx(et,{children:n.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"No requests yet — traffic will appear here live."}):s.jsxs(Zn,{children:[s.jsx(Jn,{children:s.jsxs(Xe,{children:[s.jsx(ge,{children:"Model"}),s.jsx(ge,{children:"Provider"}),s.jsx(ge,{children:"Tokens"}),s.jsx(ge,{children:"Status"}),s.jsx(ge,{children:"Time"})]})}),s.jsx(Wn,{children:n.map(l=>s.jsxs(Xe,{children:[s.jsx(he,{className:"font-mono text-xs",children:l.requestedModel}),s.jsx(he,{className:"text-xs text-muted-foreground",children:l.providerName??"—"}),s.jsxs(he,{className:"text-xs",children:[s.jsxs("span",{className:"font-mono",children:["in ",Ot(l.inputTokens)," · out ",Ot(l.outputTokens)]}),l.cacheReadTokens>0&&s.jsxs("span",{className:"ml-1 text-amber-600",children:["(+",Ot(l.cacheReadTokens)," cache)"]})]}),s.jsx(he,{children:s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[s.jsx("span",{className:l.success?"h-2 w-2 rounded-full bg-emerald-400":"h-2 w-2 rounded-full bg-red-400"}),s.jsx("span",{className:"text-xs",children:l.success?l.httpStatus:`${l.httpStatus} err`})]})}),s.jsx(he,{className:"text-xs text-muted-foreground",children:rE(l.createdAt)})]},l.id))})]})})]})}const hh=34,yy=2*Math.PI*hh;function o_(n){return n>=.95?{stroke:"#4ade80",text:"text-emerald-500"}:n>=.8?{stroke:"#fbbf24",text:"text-amber-500"}:{stroke:"#f87171",text:"text-red-500"}}function i_({successRate:n,averageLatencyMs:l,latencySpark:o}){const{stroke:i,text:u}=o_(n),d=Math.min(1,Math.max(0,n)),h=yy*(1-d);return s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.jsxs(Ze,{children:[s.jsx(Je,{className:"pb-2",children:s.jsx(We,{className:"text-base",children:"Success Rate"})}),s.jsxs(et,{className:"flex items-center gap-4",children:[s.jsxs("div",{className:"relative h-20 w-20",children:[s.jsxs("svg",{viewBox:"0 0 80 80",className:"h-20 w-20 -rotate-90",children:[s.jsx("circle",{cx:"40",cy:"40",r:hh,fill:"none",stroke:"hsl(var(--border))",strokeWidth:7}),s.jsx("circle",{cx:"40",cy:"40",r:hh,fill:"none",stroke:i,strokeWidth:7,strokeLinecap:"round",strokeDasharray:yy,strokeDashoffset:h,style:{transition:"stroke-dashoffset 0.6s ease, stroke 0.4s ease"}})]}),s.jsx("span",{className:`absolute inset-0 flex items-center justify-center text-sm font-semibold tabular-nums ${u}`,children:Lc(n)})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Share of requests that completed successfully over the selected window. Updated in real time."})]})]}),s.jsxs(Ze,{children:[s.jsx(Je,{className:"pb-2",children:s.jsx(We,{className:"text-base",children:"Average Latency"})}),s.jsxs(et,{className:"flex items-end justify-between",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-2xl font-semibold tabular-nums",children:hr(l)}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Live average across the selected window"})]}),s.jsx(_1,{data:o,strokeClass:"stroke-amber-500",fillClass:"fill-amber-500/10",className:"h-10 w-28"})]})]})]})}function c_(){const[n,l]=m.useState("7d"),{snapshot:o,live:i,recent:u,providers:d,pulses:h,activeRoutes:p,loading:g,error:v}=WD(n);if(g)return s.jsx("div",{className:"text-muted-foreground",children:"Loading…"});if(v||!o)return s.jsxs("div",{className:"text-destructive",children:["Failed to load statistics: ",v??"unknown error"]});const x=i,y=o.previous,S=o.series;function w(j,R){return R>0?(j-R)/R:void 0}const C=S.map(j=>j.requests),E=S.map(j=>j.avgLatency);return s.jsxs("div",{children:[s.jsx(Na,{title:"Statistics",description:"Real-time monitoring dashboard",actions:s.jsx(D1,{value:n,onValueChange:j=>void l(j),children:s.jsxs(Cm,{children:[s.jsx(Fa,{value:"today",children:"Today"}),s.jsx(Fa,{value:"7d",children:"7 days"}),s.jsx(Fa,{value:"30d",children:"30 days"})]})})}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[s.jsx(zl,{icon:Ky,label:"Requests",value:x.totalRequests,delta:w(x.totalRequests,y.totalRequests),sparkData:C}),s.jsx(zl,{icon:Oc,label:"Success rate",format:"percent",value:x.successRate,delta:w(x.successRate,y.successRate),sparkData:C,sparkStroke:"stroke-emerald-500"}),s.jsx(zl,{icon:oC,label:"Total tokens",value:x.totalTokens,delta:w(x.totalTokens,y.totalTokens),sparkData:S.map(j=>j.inputTokens+j.outputTokens)}),s.jsx(zl,{icon:iC,label:"Cache hit rate",format:"percent",value:x.cacheHitRate,delta:w(x.cacheHitRate,y.cacheHitRate),sparkData:S.map(j=>j.cacheRead)}),s.jsx(zl,{icon:lC,label:"Avg latency",format:"latency",value:x.averageLatencyMs,delta:w(x.averageLatencyMs,y.averageLatencyMs),deltaInverse:!0,sparkData:E,sparkStroke:"stroke-amber-500"}),s.jsx(zl,{icon:Qy,label:"p95 latency",format:"latency",value:x.p95LatencyMs}),s.jsx(zl,{icon:jC,label:"Avg TTFT",format:"latency",value:x.averageTtftMs??0}),s.jsx(zl,{icon:vC,label:"Fallback rate",format:"percent",value:x.fallbackRate,delta:w(x.fallbackRate,y.fallbackRate),deltaInverse:!0})]}),s.jsx("div",{className:"mt-6",children:s.jsx(r_,{liveRequests:x.totalRequests,successRate:x.successRate,providers:d,pulses:h,activeRoutes:p})}),s.jsxs("div",{className:"mt-6 grid gap-4 lg:grid-cols-3",children:[s.jsx("div",{className:"lg:col-span-2",children:s.jsx(s_,{rows:u})}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs(Ze,{children:[s.jsx(Je,{className:"pb-2",children:s.jsx(We,{className:"text-base",children:"Top Models"})}),s.jsx(et,{children:s.jsxs(Zn,{children:[s.jsx(Jn,{children:s.jsxs(Xe,{children:[s.jsx(ge,{children:"Model"}),s.jsx(ge,{children:"Req"}),s.jsx(ge,{children:"Errors"}),s.jsx(ge,{children:"Tokens"})]})}),s.jsxs(Wn,{children:[o.topModels.length===0&&s.jsx(Xe,{children:s.jsx(he,{colSpan:4,className:"text-muted-foreground text-center",children:"No data"})}),o.topModels.map(j=>s.jsxs(Xe,{children:[s.jsx(he,{className:"font-mono text-xs",children:j.publicId}),s.jsx(he,{className:"text-xs",children:Ot(j.requests)}),s.jsx(he,{className:"text-xs",children:s.jsx("span",{className:j.errorRate>.1?"text-destructive":"text-muted-foreground",children:Lc(j.errorRate)})}),s.jsx(he,{className:"text-xs",children:Ot(j.totalTokens)})]},j.publicId))]})]})})]}),s.jsxs(Ze,{children:[s.jsx(Je,{className:"pb-2",children:s.jsx(We,{className:"text-base",children:"Top API Keys"})}),s.jsx(et,{children:s.jsxs(Zn,{children:[s.jsx(Jn,{children:s.jsxs(Xe,{children:[s.jsx(ge,{children:"Key"}),s.jsx(ge,{children:"Requests"}),s.jsx(ge,{children:"Tokens"})]})}),s.jsxs(Wn,{children:[o.topApiKeys.length===0&&s.jsx(Xe,{children:s.jsx(he,{colSpan:3,className:"text-muted-foreground text-center",children:"No data"})}),o.topApiKeys.map((j,R)=>s.jsxs(Xe,{children:[s.jsx(he,{className:"text-xs",children:j.name}),s.jsx(he,{className:"text-xs",children:Ot(j.requests)}),s.jsx(he,{className:"text-xs",children:Ot(j.totalTokens)})]},R))]})]})})]})]})]}),s.jsx("div",{className:"mt-6",children:s.jsx(i_,{successRate:x.successRate,averageLatencyMs:x.averageLatencyMs,latencySpark:E})})]})}function u_(){const[n,l]=m.useState([]),[o,i]=m.useState(0);return m.useEffect(()=>{Se.get("/api/admin/audit?limit=200").then(u=>{l(u.rows),i(u.total)})},[]),s.jsxs("div",{children:[s.jsx(Na,{title:"Audit Logs",description:`${o} entries · immutable`}),s.jsxs(Ze,{children:[s.jsx(Je,{children:s.jsx(We,{className:"text-base",children:"All entries"})}),s.jsx(et,{children:s.jsxs(Zn,{children:[s.jsx(Jn,{children:s.jsxs(Xe,{children:[s.jsx(ge,{children:"Time"}),s.jsx(ge,{children:"Action"}),s.jsx(ge,{children:"Status"}),s.jsx(ge,{children:"Target"}),s.jsx(ge,{children:"IP"}),s.jsx(ge,{children:"Actor"})]})}),s.jsxs(Wn,{children:[n.length===0&&s.jsx(Xe,{children:s.jsx(he,{colSpan:6,className:"text-center text-muted-foreground",children:"No audit events yet."})}),n.map(u=>s.jsxs(Xe,{children:[s.jsx(he,{className:"text-xs",children:Mh(u.createdAt)}),s.jsx(he,{className:"font-mono text-xs",children:u.action}),s.jsx(he,{children:u.success?s.jsx(at,{variant:"success",children:"ok"}):s.jsx(at,{variant:"destructive",children:"fail"})}),s.jsx(he,{className:"text-xs",children:u.targetName??u.targetId??"—"}),s.jsx(he,{className:"text-xs",children:u.ip}),s.jsx(he,{className:"text-xs",children:u.actor})]},u.id))]})]})})]})]})}const mh={enabled:!0,sound:!0};let Mo=mh,ph=!1,mc=null;const gh=new Set;function k1(){for(const n of gh)n()}function z1(n=!1){return ph&&!n?Promise.resolve():(!n&&mc||(mc=(async()=>{try{const l=await Se.get("/api/admin/settings");Mo={enabled:l.settings.notificationsEnabled??mh.enabled,sound:l.settings.notificationSoundEnabled??mh.sound},ph=!0,k1()}catch{}})()),mc)}async function by(n){const l={};n.enabled!==void 0&&(l.notificationsEnabled=n.enabled),n.sound!==void 0&&(l.notificationSoundEnabled=n.sound),await Se.patch("/api/admin/settings",l),Mo={...Mo,...n},ph=!0,k1()}function d_(n){return gh.add(n),()=>gh.delete(n)}function L1(){return m.useSyncExternalStore(d_,()=>Mo,()=>Mo)}const vh=m.forwardRef(({className:n,...l},o)=>s.jsx("textarea",{ref:o,className:Ee("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",n),...l}));vh.displayName="Textarea";function f_(){const[n]=H2(),[l,o]=m.useState(null),[i,u]=m.useState(null),[d,h]=m.useState({current:"",next:""}),[p,g]=m.useState(""),[v,x]=m.useState(""),[y,S]=m.useState(null),[w,C]=m.useState(!1),[E,j]=m.useState("idle"),[R,A]=m.useState(null),T=async(se=!1)=>{j("checking"),A(null);try{const Ue=await Se.get(`/api/admin/update/check${se?"?force=1":""}`);S(Ue),j("idle")}catch(Ue){A(Ue.message),j("error")}},D=async()=>{C(!0),j("installing"),A(null);try{const se=await Se.post("/api/admin/update/run");j("restarting"),pe.success(se.message||"Update started — the gateway will restart shortly.");const Ue=setInterval(()=>{fetch("/health").then(Ye=>{Ye.ok&&(clearInterval(Ue),window.location.reload())}).catch(()=>{})},3e3);setTimeout(()=>clearInterval(Ue),12e4)}catch(se){pe.error(se.message),A(se.message),j("error")}finally{C(!1)}},[O,M]=m.useState("disabled"),[B,z]=m.useState(""),[K,oe]=m.useState(""),[X,q]=m.useState(""),[le,J]=m.useState([]),[ce,U]=m.useState(""),[Y,ae]=m.useState(""),[W,te]=m.useState(!1),[_,P]=m.useState(null),[Q,re]=m.useState(""),[fe,be]=m.useState(""),[G,ie]=m.useState(""),me=async()=>{const se=await Se.get("/api/admin/settings");o(se.settings),g(se.settings.adminIpAllow??""),x(se.settings.adminIpBlock??"");const Ue=await Se.get("/api/admin/settings/system");u(Ue);try{const Ye=await Se.get("/api/admin/me");M(Ye.totpEnabled?"enabled":"disabled")}catch{}};if(m.useEffect(()=>{z1(!0)},[]),m.useEffect(()=>{me(),T(!0)},[]),!l)return s.jsx("div",{className:"text-muted-foreground",children:"Loading…"});const Ce=async se=>{try{await Se.patch("/api/admin/settings",se),pe.success("Saved"),me()}catch(Ue){pe.error(Ue.message)}},Me=async()=>{try{const se=await Se.post("/api/admin/account/totp/begin");z(se.secret),oe(se.qr),M("setup"),pe.info("Scan the QR code with your authenticator app")}catch(se){pe.error(se.message)}},Ae=async()=>{if(!X||X.length!==6){pe.error("Enter a 6-digit code");return}try{const se=await Se.post("/api/admin/account/totp/verify",{code:X});J(se.recoveryCodes),M("showingRecovery"),pe.success("TOTP enabled successfully")}catch(se){pe.error(se.message)}},Le=async()=>{if(!ce){pe.error("Enter your password");return}if(!Y){pe.error("Enter a TOTP code or recovery code");return}try{await Se.post("/api/admin/account/totp/disable",{password:ce,totp:Y}),M("disabled"),U(""),ae(""),pe.success("TOTP disabled"),me()}catch(se){pe.error(se.message)}},pt=async()=>{te(!0);try{const se=await Se.post("/api/admin/account/totp/recovery/regenerate",{password:ce,totp:Y});J(se.recoveryCodes),M("showingRecovery"),pe.success("Recovery codes regenerated")}catch(se){pe.error(se.message)}te(!1)},gt=n.get("tab")||"logging";return s.jsxs("div",{children:[s.jsx(Na,{title:"Settings",description:"Logging, security, backup, and system info"}),s.jsxs(D1,{defaultValue:gt,children:[s.jsxs(Cm,{children:[s.jsx(Fa,{value:"logging",children:"Logging"}),s.jsx(Fa,{value:"access",children:"Access Control"}),s.jsx(Fa,{value:"security",children:"Security"}),s.jsx(Fa,{value:"backup",children:"Backup"}),s.jsx(Fa,{value:"system",children:"System"})]}),s.jsx(fs,{value:"logging",children:s.jsxs(Ze,{children:[s.jsx(Je,{children:s.jsx(We,{className:"text-base",children:"Logging policy"})}),s.jsxs(et,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(xe,{children:"Request-content logging"}),s.jsxs(Kn,{value:l.contentLogMode,onValueChange:se=>Ce({contentLogMode:se}),children:[s.jsx(_n,{children:s.jsx(Xn,{})}),s.jsxs(On,{children:[s.jsx(ot,{value:"off",children:"Off"}),s.jsx(ot,{value:"metadata",children:"Metadata only (default)"}),s.jsx(ot,{value:"prompt",children:"Prompt (sanitized)"}),s.jsx(ot,{value:"prompt_and_response",children:"Prompt + response (sanitized)"})]})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(xe,{children:"Retention (days)"}),s.jsx(Re,{type:"number",min:1,max:3650,value:l.retentionDays,onChange:se=>Ce({retentionDays:Number(se.target.value)})})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(xe,{children:"Database size limit (MB)"}),s.jsx(Re,{type:"number",min:64,value:l.dbSizeLimitMb,onChange:se=>Ce({dbSizeLimitMb:Number(se.target.value)})})]}),s.jsx("div",{className:"flex items-center gap-2 pt-2",children:s.jsx(de,{onClick:async()=>{const se=await Se.post("/api/admin/settings/cleanup");pe.success(`Deleted ${se.deletedRequests} old requests`)},children:"Run cleanup now"})})]})]})}),s.jsx(fs,{value:"access",children:s.jsxs(Ze,{children:[s.jsxs(Je,{children:[s.jsx(We,{className:"text-base",children:"IP access control"}),s.jsx(fn,{children:"Allowlist / Blocklist for this admin website (not model traffic)"})]}),s.jsxs(et,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(xe,{children:"Allow only these IPs"}),s.jsx(vh,{placeholder:`192.168.1.0/24
|
|
335
|
+
10.0.0.1`,value:p,onChange:se=>g(se.target.value)}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Newlines-delimited CIDR ranges (IPv4 only). Leave empty = no allow restrictions. When you save a non-empty list, your current IP is auto-added to prevent lockout."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(xe,{children:"Block these IPs"}),s.jsx(vh,{placeholder:"192.168.1.100",value:v,onChange:se=>x(se.target.value)}),s.jsx("p",{className:"text-xs text-muted-foreground",children:'Newlines-delimited CIDR ranges (IPv4 only). Blocked IPs are rejected with "Không có quyền truy cập" before any login page.'})]}),s.jsx(de,{onClick:()=>{const se={};p!==((l==null?void 0:l.adminIpAllow)??"")&&(se.adminIpAllow=p||null),v!==((l==null?void 0:l.adminIpBlock)??"")&&(se.adminIpBlock=v||null),Se.patch("/api/admin/settings",se).then(Ue=>{pe.success("Saved"+(Ue.addedIp?` — added your IP: ${Ue.addedIp}`:"")),me(),g(""),x("")}).catch(Ue=>pe.error(Ue.message))},children:"Save access control"}),s.jsxs("div",{className:"rounded bg-amber-50 border border-amber-200 p-3 dark:bg-amber-950/20 dark:border-amber-800",children:[s.jsx("p",{className:"text-sm font-medium text-amber-900 dark:text-amber-200",children:"⚠️ If you enable an allow list, you cannot access the gateway unless your IP matches."}),s.jsx("p",{className:"text-xs text-amber-800 dark:text-amber-300",children:"The server automatically adds your current IP when you save — but if you configure it from a different machine, that machine will be locked out immediately."})]})]})]})}),s.jsx(fs,{value:"security",children:s.jsxs(Ze,{children:[s.jsxs(Je,{children:[s.jsx(We,{className:"text-base",children:"Security"}),s.jsx(fn,{children:"Change password, 2FA, and trusted proxy configuration"})]}),s.jsxs(et,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(xe,{children:"Trusted proxy hops"}),s.jsx(Re,{type:"number",min:0,max:8,value:l.trustProxyHops,onChange:se=>Ce({trustProxyHops:Number(se.target.value)})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"0 = never trust X-Forwarded-For (direct exposure). 1+ only when behind a single trusted reverse proxy."})]}),s.jsxs("div",{className:"space-y-2 border-t pt-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(xe,{className:"text-base",children:"TOTP 2FA"}),O==="enabled"?s.jsx("span",{className:"rounded bg-green-100 px-2 py-0.5 text-xs font-medium text-green-800 dark:bg-green-900 dark:text-green-200",children:"Enabled"}):null,O==="disabled"?s.jsx("span",{className:"rounded bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground",children:"Disabled"}):null]}),O==="disabled"&&s.jsx(de,{variant:"outline",onClick:Me,children:"Enable TOTP"}),O==="setup"&&s.jsxs("div",{className:"space-y-3 rounded border p-3",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Scan this QR code with your authenticator app, or enter the secret manually."}),K&&s.jsx("img",{src:K,alt:"TOTP QR code",className:"h-40 w-40"}),s.jsxs("div",{className:"text-xs font-mono text-muted-foreground",children:["Secret: ",B]}),s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(xe,{children:"Verify code"}),s.jsx(Re,{value:X,onChange:se=>q(se.target.value),placeholder:"123456",maxLength:6})]}),s.jsx(de,{disabled:X.length<6,onClick:Ae,children:"Verify & enable"})]})]}),O==="showingRecovery"&&s.jsxs("div",{className:"space-y-3 rounded border border-amber-500/40 bg-amber-50 p-3 dark:bg-amber-950/20",children:[s.jsx("p",{className:"text-sm font-medium",children:"Recovery codes — save these now!"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Each code can be used once to log in without your TOTP device. They will not be shown again."}),s.jsx("div",{className:"space-y-1",children:le.map((se,Ue)=>s.jsx("div",{className:"font-mono text-xs",children:se},Ue))}),s.jsx(de,{onClick:()=>{M("enabled"),pe.success("Recovery codes saved")},children:"I have saved them"})]}),O==="enabled"&&s.jsxs("div",{className:"space-y-3 rounded border p-3",children:[s.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[s.jsxs("div",{children:[s.jsx(xe,{children:"Password"}),s.jsx(Re,{type:"password",value:ce,onChange:se=>U(se.target.value),placeholder:"Current password"})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"TOTP code"}),s.jsx(Re,{value:Y,onChange:se=>ae(se.target.value),placeholder:"123456",maxLength:6})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(de,{variant:"outline",size:"sm",disabled:W||!ce||Y.length<6,onClick:pt,children:"Regenerate recovery codes"}),s.jsx(de,{variant:"destructive",size:"sm",disabled:!ce||Y.length<6,onClick:Le,children:"Disable TOTP"})]})]})]}),s.jsxs("div",{className:"space-y-2 border-t pt-4",children:[s.jsx(xe,{children:"Change password"}),s.jsx(Re,{type:"password",placeholder:"Current password",value:d.current,onChange:se=>h({...d,current:se.target.value})}),s.jsx(Re,{type:"password",placeholder:"New password (12+ chars)",value:d.next,onChange:se=>h({...d,next:se.target.value})}),s.jsx(de,{disabled:!d.current||d.next.length<12,onClick:async()=>{try{await Se.post("/api/admin/account/password",{currentPassword:d.current,newPassword:d.next}),pe.success("Password changed"),h({current:"",next:""})}catch(se){pe.error(se.message)}},children:"Change password"})]})]})]})}),s.jsx(fs,{value:"backup",children:s.jsxs(Ze,{children:[s.jsxs(Je,{children:[s.jsx(We,{className:"text-base",children:"Backup & restore"}),s.jsx(fn,{children:"Download a snapshot or restore from a previous backup"})]}),s.jsxs(et,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-2 rounded border p-3",children:[s.jsx(xe,{children:"Backup passphrase (6 digits)"}),s.jsx(Re,{inputMode:"numeric",maxLength:6,value:Q,onChange:se=>re(se.target.value.replace(/\D/g,"")),placeholder:"123456"}),s.jsx(Re,{inputMode:"numeric",maxLength:6,value:fe,onChange:se=>be(se.target.value.replace(/\D/g,"")),placeholder:"Repeat passphrase"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"This passphrase encrypts the master key inside the backup. You must enter the same 6 digits when importing on a new instance. Without it, encrypted provider credentials cannot be recovered."})]}),s.jsx(de,{disabled:Q.length!==6||Q!==fe,onClick:async()=>{try{const se=await fetch("/api/admin/backup/create",{method:"POST",credentials:"include",headers:{"content-type":"application/json"},body:JSON.stringify({passphrase:Q})});if(!se.ok)throw new Error("Backup failed");const Ue=await se.blob(),Ye=URL.createObjectURL(Ue),Ht=document.createElement("a");Ht.href=Ye,Ht.download="latedev-backup.json",Ht.click(),URL.revokeObjectURL(Ye),pe.success("Backup downloaded"),re(""),be("")}catch(se){pe.error(se.message)}},children:"Download backup"}),s.jsxs("div",{className:"space-y-2 rounded border p-3",children:[s.jsx(xe,{children:"Backup passphrase for restore"}),s.jsx(Re,{inputMode:"numeric",maxLength:6,value:G,onChange:se=>ie(se.target.value.replace(/\D/g,"")),placeholder:"123456"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Use the 6-digit passphrase entered when the backup was created. It is required to restore the master key and administrator access."})]}),s.jsxs(o1,{open:_!==null,onOpenChange:se=>{se||P(null)},children:[s.jsx(bM,{asChild:!0,children:s.jsxs("div",{children:[s.jsx(xe,{children:"Restore from backup file"}),s.jsx(Re,{type:"file",accept:".json,application/json","data-testid":"restore-file",onChange:se=>{var Ye;const Ue=(Ye=se.target.files)==null?void 0:Ye[0];P(Ue??null)}})]})}),s.jsxs(lm,{children:[s.jsxs(c1,{children:[s.jsx(rm,{children:"Restore backup?"}),s.jsxs(sm,{children:["Restoring will replace the entire current database with the selected backup (",(_==null?void 0:_.name)??"file","). This cannot be undone. A snapshot of the current database is kept for rollback only if validation fails."]})]}),s.jsxs(u1,{children:[s.jsx(im,{children:"Cancel"}),s.jsx(om,{onClick:async()=>{var Ue,Ye;const se=_;if(se)try{const Ht=JSON.parse(await se.text()),Ft=await fetch("/api/admin/backup/restore",{method:"POST",credentials:"include",headers:{"content-type":"application/json"},body:JSON.stringify({backup:Ht,passphrase:G})});if(!Ft.ok)throw new Error(((Ye=(Ue=await Ft.json())==null?void 0:Ue.error)==null?void 0:Ye.message)??"Restore failed");pe.success("Restored. Reloading…"),P(null),setTimeout(()=>location.reload(),600)}catch(Ht){pe.error(Ht.message)}},children:"Restore"})]})]})]})]})]})}),s.jsxs(fs,{value:"system",children:[s.jsxs(Ze,{children:[s.jsx(Je,{children:s.jsx(We,{className:"text-base",children:"System"})}),s.jsxs(et,{className:"space-y-2 text-sm",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"App version:"})," ",i==null?void 0:i.appVersion]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Data directory:"})," ",s.jsx("span",{className:"font-mono",children:i==null?void 0:i.dataDir})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Encryption:"})," ",i!=null&&i.masterKeyConfigured?"Configured":"Not configured"," (v",i==null?void 0:i.masterKeyVersion,")"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Environment:"})," ",i==null?void 0:i.environment]}),s.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[s.jsx(Ca,{checked:l.gatewayCacheEnabled,onCheckedChange:se=>Ce({gatewayCacheEnabled:se})}),s.jsx(xe,{children:"Gateway response cache (disabled by default)"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsxs("div",{children:[s.jsx(xe,{children:"Cache TTL (s)"}),s.jsx(Re,{type:"number",min:1,value:l.gatewayCacheDefaultTtlSeconds,onChange:se=>Ce({gatewayCacheDefaultTtlSeconds:Number(se.target.value)})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Cache max size (MB)"}),s.jsx(Re,{type:"number",min:1,value:l.gatewayCacheMaxSizeMb,onChange:se=>Ce({gatewayCacheMaxSizeMb:Number(se.target.value)})})]})]}),s.jsx(de,{variant:"outline",onClick:async()=>{const se=await Se.post("/api/admin/settings/cache/clear");pe.success(`Cleared ${se.deleted} entries`)},children:"Clear gateway cache"})]})]}),s.jsx(h_,{}),s.jsxs(Ze,{className:"mt-4",children:[s.jsxs(Je,{children:[s.jsx(We,{className:"text-base",children:"Updates"}),s.jsx(fn,{children:"Automatic updates from the npm registry"})]}),s.jsxs(et,{className:"space-y-3 text-sm",children:[E==="checking"&&!y&&s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(Eo,{className:"h-4 w-4 animate-spin"})," Checking for updates…"]}),y&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Current version"}),s.jsxs("div",{className:"font-mono",children:["v",y.currentVersion]})]}),s.jsx("span",{className:"text-muted-foreground",children:"→"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Latest version"}),s.jsx("div",{className:"font-mono",children:y.latestVersion?`v${y.latestVersion}`:"—"})]}),y.status.docker?s.jsx(at,{variant:"secondary",children:y.status.watchtower?"Docker + Watchtower":"Docker"}):y.latestVersion===null?s.jsx(at,{variant:"secondary",children:"Registry unreachable"}):y.hasUpdate?s.jsx(at,{variant:"success",children:"Update available"}):s.jsxs(at,{variant:"outline",children:[s.jsx(Oc,{className:"mr-1 h-3 w-3"})," Up to date"]})]}),y.status.docker&&y.status.watchtower&&y.watchtowerReachable&&s.jsx("p",{className:"text-muted-foreground",children:"Watchtower pulls new images automatically every hour — or use Update now for an instant update."}),y.status.docker&&y.status.watchtower&&y.watchtowerReachable===!1&&s.jsxs("p",{className:"text-muted-foreground",children:["The Watchtower sidecar is configured but not running — start it with ",s.jsx("code",{className:"rounded bg-muted px-1 text-xs",children:"docker compose --profile updater up -d"}),"."]}),y.status.docker&&!y.status.watchtower&&s.jsx("p",{className:"text-muted-foreground",children:y.status.reason??"This instance runs in Docker — update by pulling the new image tag."}),!y.status.docker&&y.latestVersion===null&&s.jsxs("p",{className:"text-muted-foreground",children:["Could not reach the npm registry (offline or blocked). ",R&&s.jsx("span",{className:"text-destructive",children:R})]}),E==="installing"&&s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(Eo,{className:"h-4 w-4 animate-spin"})," Applying the update… this can take a minute."]}),E==="restarting"&&s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(Eo,{className:"h-4 w-4 animate-spin"})," Update applied — the gateway is restarting on the new version. This page reloads automatically."]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[y.hasUpdate&&E==="idle"&&(!y.status.docker||y.status.watchtower&&y.watchtowerReachable!==!1)&&s.jsxs(de,{disabled:w||y.status.docker&&y.watchtowerReachable===!1,onClick:D,children:[s.jsx(Fy,{className:"mr-1 h-4 w-4"})," Update now"]}),y.hasUpdate&&y.changelogUrl&&s.jsx(de,{variant:"outline",asChild:!0,children:s.jsx("a",{href:y.changelogUrl,target:"_blank",rel:"noreferrer",children:"View changes"})}),E==="idle"&&s.jsx(de,{variant:"ghost",disabled:w,onClick:()=>T(!0),children:"Check again"})]})]})]})]})]})]})]})}function h_(){const n=L1();return s.jsxs(Ze,{className:"mt-4",children:[s.jsx(Je,{children:s.jsxs(We,{className:"text-base flex items-center gap-2",children:[s.jsx(W2,{className:"h-4 w-4"})," Notifications"]})}),s.jsxs(et,{className:"space-y-3 text-sm",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{children:"Show request notifications"}),s.jsx(Ca,{checked:n.enabled,onCheckedChange:l=>void by({enabled:l})})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(CC,{className:"h-3 w-3"})," Play notification sound"]}),s.jsx(Ca,{checked:n.sound,onCheckedChange:l=>void by({sound:l})})]}),s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Notifications are disabled while muted. Changes apply immediately."})]})]})}function m_({items:n,onDismiss:l}){return n.length?s.jsx("div",{className:"fixed top-16 right-4 z-50 flex max-h-[calc(100vh-8rem)] w-80 flex-col gap-2 overflow-y-auto",children:n.map(o=>{const i=!o.success,u=o.success&&o.totalLatencyMs>15e3,d=Ee("rounded-md border shadow-lg transition-all",i&&"bg-destructive text-destructive-foreground border-destructive",u&&"bg-amber-500/90 text-amber-950 border-amber-600/50",!i&&!u&&"bg-card text-card-foreground border-border");return s.jsxs(fr,{to:"/requests",className:Ee("block shrink-0 p-3 hover:opacity-95",d),children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[i?s.jsx(aC,{className:"h-4 w-4 shrink-0"}):o.success?s.jsx(Oc,{className:"h-4 w-4 shrink-0"}):s.jsx(EC,{className:"h-4 w-4 shrink-0 opacity-70"}),s.jsx("div",{className:"min-w-0 truncate text-sm font-medium",title:o.requestedModel,children:o.requestedModel})]}),s.jsx("button",{className:"shrink-0 opacity-60 hover:opacity-100",onClick:h=>{h.preventDefault(),h.stopPropagation(),l(o.id)},"aria-label":"Dismiss",type:"button",children:s.jsx(zc,{className:"h-3.5 w-3.5"})})]}),s.jsxs("div",{className:"mt-1 text-xs",children:[o.success?"Thành công":"Thất bại",!o.success&&o.errorType&&s.jsx("span",{className:"ml-1 inline-block rounded bg-black/15 px-1 py-0.5 align-text-bottom text-[10px]",children:o.errorType})]}),s.jsxs("div",{className:"mt-1 text-[11px] opacity-90",children:["in ",Ot(o.inputTokens)," · out ",Ot(o.outputTokens),(o.cacheReadTokens>0||o.cacheWriteTokens>0)&&s.jsxs(s.Fragment,{children:[" · cache ",o.cacheReadTokens>0&&s.jsxs("span",{children:["r",Ot(o.cacheReadTokens)]}),o.cacheReadTokens>0&&o.cacheWriteTokens>0&&"/",o.cacheWriteTokens>0&&s.jsxs("span",{children:["w",Ot(o.cacheWriteTokens)]})]})]}),s.jsxs("div",{className:"mt-1 text-[11px] opacity-90",children:[hr(o.totalLatencyMs),o.ttftMs!=null&&o.ttftMs>=0&&s.jsxs("span",{children:[" · TTFT ",hr(o.ttftMs)]})]})]},o.id)})}):null}const p_=5e3,g_=8,v_=3e3;let pc=null;function x_(){try{pc||(pc=new Audio("/notification.mp3")),pc.currentTime=0,pc.play().catch(()=>{})}catch{}}function y_(){const[n,l]=m.useState([]),o=m.useRef(null),i=m.useRef(new Map),u=m.useRef(Date.now()),d=m.useRef(new Set),h=L1(),p=m.useRef(h.sound);p.current=h.sound,m.useEffect(()=>{z1()},[]);const g=h.enabled;return m.useEffect(()=>{var w;if(!g){(w=o.current)==null||w.close(),o.current=null;const C=i.current;for(const E of C.values())clearTimeout(E);C.clear(),l([]);return}let x=!1;const y=i.current,S=()=>{if(x)return;const C=new EventSource(`/api/admin/requests/stream?since=${u.current}`);o.current=C,C.addEventListener("request",E=>{if(!x)try{const j=JSON.parse(E.data),R=new Date(j.createdAt).getTime();if(Number.isFinite(R)&&(u.current=Math.max(u.current,R)),d.current.has(j.id))return;d.current.add(j.id),l(T=>T.some(D=>D.id===j.id)?T:[j,...T].slice(0,g_));const A=setTimeout(()=>{l(T=>T.filter(D=>D.id!==j.id)),y.delete(j.id)},p_);y.set(j.id,A),p.current&&x_()}catch{}}),C.onerror=()=>{C.close(),o.current=null,x||setTimeout(S,v_)}};return S(),()=>{var C;x=!0,(C=o.current)==null||C.close(),o.current=null;for(const E of y.values())clearTimeout(E);y.clear()}},[g]),{items:n,dismiss:x=>{const y=i.current.get(x);y&&(clearTimeout(y),i.current.delete(x)),l(S=>S.filter(w=>w.id!==x))}}}function b_({children:n}){const{user:l,loading:o}=Th(),i=xn();return o?s.jsx("div",{className:"flex h-screen items-center justify-center text-muted-foreground",children:"Loading…"}):l?s.jsx(s.Fragment,{children:n}):s.jsx(qf,{to:"/login",state:{from:i},replace:!0})}function S_(){const{items:n,dismiss:l}=y_();return s.jsxs("div",{className:"flex h-screen bg-background text-foreground",children:[s.jsx(oE,{}),s.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[s.jsx(iA,{}),s.jsx("main",{className:"flex-1 overflow-auto p-6",children:s.jsxs(qy,{children:[s.jsx(un,{index:!0,element:s.jsx(IA,{})}),s.jsx(un,{path:"/providers",element:s.jsx(pD,{})}),s.jsx(un,{path:"/models",element:s.jsx(TD,{})}),s.jsx(un,{path:"/combos",element:s.jsx(AD,{})}),s.jsx(un,{path:"/aliases",element:s.jsx(MD,{})}),s.jsx(un,{path:"/api-keys",element:s.jsx(DD,{})}),s.jsx(un,{path:"/requests",element:s.jsx(kD,{})}),s.jsx(un,{path:"/statistics",element:s.jsx(c_,{})}),s.jsx(un,{path:"/audit",element:s.jsx(u_,{})}),s.jsx(un,{path:"/settings/*",element:s.jsx(f_,{})})]})})]}),s.jsx(m_,{items:n,onDismiss:l})]})}function w_({children:n}){const[l,o]=m.useState(null),i=xn();return m.useEffect(()=>{Se.get("/api/admin/setup/status").then(u=>o(u.setupComplete)).catch(()=>o(!0))},[]),l===null?s.jsx("div",{className:"flex h-screen items-center justify-center text-muted-foreground",children:"Loading…"}):!l&&i.pathname!=="/setup"?s.jsx(qf,{to:"/setup",replace:!0}):l&&i.pathname==="/setup"?s.jsx(qf,{to:"/",replace:!0}):s.jsx(s.Fragment,{children:n})}function j_(){return s.jsx(X2,{children:s.jsx(w_,{children:s.jsxs(qy,{children:[s.jsx(un,{path:"/setup",element:s.jsx(PA,{})}),s.jsx(un,{path:"/login",element:s.jsx(HA,{})}),s.jsx(un,{path:"/*",element:s.jsx(b_,{children:s.jsx(S_,{})})})]})})})}const C_=BA;var E_=Object.defineProperty,gn=(n,l)=>E_(n,"name",{value:l,configurable:!0}),[Em,aO]=yn("Tooltip",[Ns]),N_=Ns(),R_="TooltipProvider",T_=700,Sy="tooltip.open",[A_,M_]=Em(R_),D_=gn(n=>{const{__scopeTooltip:l,delayDuration:o=T_,skipDelayDuration:i=300,disableHoverableContent:u=!1,children:d}=n,h=m.useRef(!0),p=m.useRef(!1),g=m.useRef(0);return m.useEffect(()=>{const v=g.current;return()=>window.clearTimeout(v)},[]),s.jsx(A_,{scope:l,isOpenDelayedRef:h,delayDuration:o,onOpen:m.useCallback(()=>{i<=0||(window.clearTimeout(g.current),h.current=!1)},[i]),onClose:m.useCallback(()=>{i<=0||(window.clearTimeout(g.current),g.current=window.setTimeout(()=>h.current=!0,i))},[i]),isPointerInTransitRef:p,onPointerInTransitChange:m.useCallback(v=>{p.current=v},[]),disableHoverableContent:u,children:d})},"TooltipProvider"),__="Tooltip",[lO,Nm]=Em(__),O_="TooltipPortal",[rO,k_]=Em(O_,{forceMount:void 0}),Do="TooltipContent",z_=m.forwardRef(gn(function(l,o){const i=k_(Do,l.__scopeTooltip),{forceMount:u=i.forceMount,side:d="top",...h}=l,p=Nm(Do,l.__scopeTooltip);return s.jsx(rl,{present:u||p.open,children:p.disableHoverableContent?s.jsx(U1,{side:d,...h,ref:o}):s.jsx(L_,{side:d,...h,ref:o})})},"TooltipContent")),L_=m.forwardRef(gn(function(l,o){const i=Nm(Do,l.__scopeTooltip),u=M_(Do,l.__scopeTooltip),d=m.useRef(null),h=Ge(o,d),[p,g]=m.useState(null),{trigger:v,onClose:x}=i,y=d.current,{onPointerInTransitChange:S}=u,w=m.useCallback(()=>{g(null),S(!1)},[S]),C=m.useCallback((E,j)=>{const R=E.currentTarget,A={x:E.clientX,y:E.clientY},T=B1(A,R.getBoundingClientRect()),D=H1(A,T),O=P1(j.getBoundingClientRect()),M=I1([...D,...O]);g(M),S(!0)},[S]);return m.useEffect(()=>()=>w(),[w]),m.useEffect(()=>{if(v&&y){const E=gn(R=>C(R,y),"handleTriggerLeave"),j=gn(R=>C(R,v),"handleContentLeave");return v.addEventListener("pointerleave",E),y.addEventListener("pointerleave",j),()=>{v.removeEventListener("pointerleave",E),y.removeEventListener("pointerleave",j)}}},[v,y,C,w]),m.useEffect(()=>{if(p){const E=gn(j=>{const R=j.target,A={x:j.clientX,y:j.clientY},T=(v==null?void 0:v.contains(R))||(y==null?void 0:y.contains(R)),D=!q1(A,p);T?w():D&&(w(),x())},"handleTrackPointerGrace");return document.addEventListener("pointermove",E),()=>document.removeEventListener("pointermove",E)}},[v,y,p,x,w]),s.jsx(U1,{...l,ref:h})},"TooltipContentHoverable")),U_=ub("TooltipContent"),U1=m.forwardRef(gn(function(l,o){const{__scopeTooltip:i,children:u,"aria-label":d,id:h,onEscapeKeyDown:p,onPointerDownOutside:g,...v}=l,x=Nm(Do,i),y=N_(i),{onClose:S}=x;m.useEffect(()=>(document.addEventListener(Sy,S),()=>document.removeEventListener(Sy,S)),[S]),m.useEffect(()=>{if(x.trigger){const C=gn(E=>{E.target instanceof Node&&E.target.contains(x.trigger)&&S()},"handleScroll");return window.addEventListener("scroll",C,{capture:!0}),()=>window.removeEventListener("scroll",C,{capture:!0})}},[x.trigger,S]);const{setContentId:w}=x;return kt(()=>(w(h),()=>{w(void 0)}),[h,w]),s.jsx(Bc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:p,onPointerDownOutside:g,onFocusOutside:C=>C.preventDefault(),onDismiss:S,children:s.jsxs(Gh,{"data-state":x.stateAttribute,role:d?void 0:"tooltip",id:d?void 0:x.contentId,...y,...v,ref:o,style:{...v.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[s.jsx(U_,{children:u}),d?s.jsx(AM,{id:x.contentId,role:"tooltip",children:d}):null]})})},"TooltipContentImpl"));function B1(n,l){const o=Math.abs(l.top-n.y),i=Math.abs(l.bottom-n.y),u=Math.abs(l.right-n.x),d=Math.abs(l.left-n.x);switch(Math.min(o,i,u,d)){case d:return"left";case u:return"right";case o:return"top";case i:return"bottom";default:throw new Error("unreachable")}}gn(B1,"getExitSideFromRect");function H1(n,l,o=5){const i=[];switch(l){case"top":i.push({x:n.x-o,y:n.y+o},{x:n.x+o,y:n.y+o});break;case"bottom":i.push({x:n.x-o,y:n.y-o},{x:n.x+o,y:n.y-o});break;case"left":i.push({x:n.x+o,y:n.y-o},{x:n.x+o,y:n.y+o});break;case"right":i.push({x:n.x-o,y:n.y-o},{x:n.x-o,y:n.y+o});break}return i}gn(H1,"getPaddedExitPoints");function P1(n){const{top:l,right:o,bottom:i,left:u}=n;return[{x:u,y:l},{x:o,y:l},{x:o,y:i},{x:u,y:i}]}gn(P1,"getPointsFromRect");function q1(n,l){const{x:o,y:i}=n;let u=!1;for(let d=0,h=l.length-1;d<l.length;h=d++){const p=l[d],g=l[h],v=p.x,x=p.y,y=g.x,S=g.y;x>i!=S>i&&o<(y-v)*(i-x)/(S-x)+v&&(u=!u)}return u}gn(q1,"isPointInPolygon");function I1(n){const l=n.slice();return l.sort((o,i)=>o.x<i.x?-1:o.x>i.x?1:o.y<i.y?-1:o.y>i.y?1:0),V1(l)}gn(I1,"getHull");function V1(n){if(n.length<=1)return n.slice();const l=[];for(let i=0;i<n.length;i++){const u=n[i];for(;l.length>=2;){const d=l[l.length-1],h=l[l.length-2];if((d.x-h.x)*(u.y-h.y)>=(d.y-h.y)*(u.x-h.x))l.pop();else break}l.push(u)}l.pop();const o=[];for(let i=n.length-1;i>=0;i--){const u=n[i];for(;o.length>=2;){const d=o[o.length-1],h=o[o.length-2];if((d.x-h.x)*(u.y-h.y)>=(d.y-h.y)*(u.x-h.x))o.pop();else break}o.push(u)}return o.pop(),l.length===1&&o.length===1&&l[0].x===o[0].x&&l[0].y===o[0].y?l:l.concat(o)}gn(V1,"getHullPresorted");var B_=D_,G1=z_;const H_=B_,P_=m.forwardRef(({className:n,sideOffset:l=4,...o},i)=>s.jsx(G1,{ref:i,sideOffset:l,className:Ee("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95",n),...o}));P_.displayName=G1.displayName;fj.createRoot(document.getElementById("root")).render(s.jsx(ue.StrictMode,{children:s.jsx(gE,{defaultTheme:"dark",storageKey:"latedev-theme",children:s.jsxs(H_,{children:[s.jsx(z2,{children:s.jsx(j_,{})}),s.jsx(C_,{position:"top-right"})]})})}));
|