ldrouter 1.17.0 → 1.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/server/providers/codex.js +78 -9
- package/dist/server/routes/admin/combos.js +4 -1
- package/dist/web/assets/index-DAzlm3Y6.js +391 -0
- package/dist/web/assets/index-Xccks9E5.css +1 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/index-DdtyoPpS.js +0 -391
- package/dist/web/assets/index-Drmqi8MO.css +0 -1
|
@@ -1,391 +0,0 @@
|
|
|
1
|
-
var Iy=n=>{throw TypeError(n)};var Py=(n,a,l)=>a.has(n)||Iy("Cannot "+l);var gn=(n,a,l)=>(Py(n,a,"read from private field"),l?l.call(n):a.get(n)),By=(n,a,l)=>a.has(n)?Iy("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(n):a.set(n,l),fh=(n,a,l,o)=>(Py(n,a,"write to private field"),o?o.call(n,l):a.set(n,l),l);function v2(n,a){for(var l=0;l<a.length;l++){const o=a[l];if(typeof o!="string"&&!Array.isArray(o)){for(const c in o)if(c!=="default"&&!(c in n)){const u=Object.getOwnPropertyDescriptor(o,c);u&&Object.defineProperty(n,c,u.get?u:{enumerable:!0,get:()=>o[c]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))o(c);new MutationObserver(c=>{for(const u of c)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&o(f)}).observe(document,{childList:!0,subtree:!0});function l(c){const u={};return c.integrity&&(u.integrity=c.integrity),c.referrerPolicy&&(u.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?u.credentials="include":c.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(c){if(c.ep)return;c.ep=!0;const u=l(c);fetch(c.href,u)}})();function Cm(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var hh={exports:{}},Qo={};/**
|
|
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 Hy;function x2(){if(Hy)return Qo;Hy=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function l(o,c,u){var f=null;if(u!==void 0&&(f=""+u),c.key!==void 0&&(f=""+c.key),"key"in c){u={};for(var p in c)p!=="key"&&(u[p]=c[p])}else u=c;return c=u.ref,{$$typeof:n,type:o,key:f,ref:c!==void 0?c:null,props:u}}return Qo.Fragment=a,Qo.jsx=l,Qo.jsxs=l,Qo}var qy;function y2(){return qy||(qy=1,hh.exports=x2()),hh.exports}var s=y2(),mh={exports:{}},ke={};/**
|
|
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 $y;function b2(){if($y)return ke;$y=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),f=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"),b=Symbol.iterator;function w(z){return z===null||typeof z!="object"?null:(z=b&&z[b]||z["@@iterator"],typeof z=="function"?z:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,C={};function R(z,L,F){this.props=z,this.context=L,this.refs=C,this.updater=F||N}R.prototype.isReactComponent={},R.prototype.setState=function(z,L){if(typeof z!="object"&&typeof z!="function"&&z!=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,z,L,"setState")},R.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function D(){}D.prototype=R.prototype;function A(z,L,F){this.props=z,this.context=L,this.refs=C,this.updater=F||N}var M=A.prototype=new D;M.constructor=A,S(M,R.prototype),M.isPureReactComponent=!0;var O=Array.isArray;function E(){}var _={H:null,A:null,T:null,S:null},U=Object.prototype.hasOwnProperty;function $(z,L,F){var se=F.ref;return{$$typeof:n,type:z,key:L,ref:se!==void 0?se:null,props:F}}function te(z,L){return $(z.type,L,z.props)}function V(z){return typeof z=="object"&&z!==null&&z.$$typeof===n}function H(z){var L={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(F){return L[F]})}var ae=/\/+/g;function ee(z,L){return typeof z=="object"&&z!==null&&z.key!=null?H(""+z.key):L.toString(36)}function B(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(E,E):(z.status="pending",z.then(function(L){z.status==="pending"&&(z.status="fulfilled",z.value=L)},function(L){z.status==="pending"&&(z.status="rejected",z.reason=L)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function k(z,L,F,se,pe){var ye=typeof z;(ye==="undefined"||ye==="boolean")&&(z=null);var G=!1;if(z===null)G=!0;else switch(ye){case"bigint":case"string":case"number":G=!0;break;case"object":switch(z.$$typeof){case n:case a:G=!0;break;case x:return G=z._init,k(G(z._payload),L,F,se,pe)}}if(G)return pe=pe(z),G=se===""?"."+ee(z,0):se,O(pe)?(F="",G!=null&&(F=G.replace(ae,"$&/")+"/"),k(pe,L,F,"",function(xe){return xe})):pe!=null&&(V(pe)&&(pe=te(pe,F+(pe.key==null||z&&z.key===pe.key?"":(""+pe.key).replace(ae,"$&/")+"/")+G)),L.push(pe)),1;G=0;var ue=se===""?".":se+":";if(O(z))for(var he=0;he<z.length;he++)se=z[he],ye=ue+ee(se,he),G+=k(se,L,F,ye,pe);else if(he=w(z),typeof he=="function")for(z=he.call(z),he=0;!(se=z.next()).done;)se=se.value,ye=ue+ee(se,he++),G+=k(se,L,F,ye,pe);else if(ye==="object"){if(typeof z.then=="function")return k(B(z),L,F,se,pe);throw L=String(z),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.")}return G}function q(z,L,F){if(z==null)return z;var se=[],pe=0;return k(z,se,"","",function(ye){return L.call(F,ye,pe++)}),se}function Z(z){if(z._status===-1){var L=z._result;L=L(),L.then(function(F){(z._status===0||z._status===-1)&&(z._status=1,z._result=F)},function(F){(z._status===0||z._status===-1)&&(z._status=2,z._result=F)}),z._status===-1&&(z._status=0,z._result=L)}if(z._status===1)return z._result.default;throw z._result}var J=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var L=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent(L))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)},ne={map:q,forEach:function(z,L,F){q(z,function(){L.apply(this,arguments)},F)},count:function(z){var L=0;return q(z,function(){L++}),L},toArray:function(z){return q(z,function(L){return L})||[]},only:function(z){if(!V(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return ke.Activity=y,ke.Children=ne,ke.Component=R,ke.Fragment=l,ke.Profiler=c,ke.PureComponent=A,ke.StrictMode=o,ke.Suspense=g,ke.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_,ke.__COMPILER_RUNTIME={__proto__:null,c:function(z){return _.H.useMemoCache(z)}},ke.cache=function(z){return function(){return z.apply(null,arguments)}},ke.cacheSignal=function(){return null},ke.cloneElement=function(z,L,F){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var se=S({},z.props),pe=z.key;if(L!=null)for(ye in L.key!==void 0&&(pe=""+L.key),L)!U.call(L,ye)||ye==="key"||ye==="__self"||ye==="__source"||ye==="ref"&&L.ref===void 0||(se[ye]=L[ye]);var ye=arguments.length-2;if(ye===1)se.children=F;else if(1<ye){for(var G=Array(ye),ue=0;ue<ye;ue++)G[ue]=arguments[ue+2];se.children=G}return $(z.type,pe,se)},ke.createContext=function(z){return z={$$typeof:f,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:u,_context:z},z},ke.createElement=function(z,L,F){var se,pe={},ye=null;if(L!=null)for(se in L.key!==void 0&&(ye=""+L.key),L)U.call(L,se)&&se!=="key"&&se!=="__self"&&se!=="__source"&&(pe[se]=L[se]);var G=arguments.length-2;if(G===1)pe.children=F;else if(1<G){for(var ue=Array(G),he=0;he<G;he++)ue[he]=arguments[he+2];pe.children=ue}if(z&&z.defaultProps)for(se in G=z.defaultProps,G)pe[se]===void 0&&(pe[se]=G[se]);return $(z,ye,pe)},ke.createRef=function(){return{current:null}},ke.forwardRef=function(z){return{$$typeof:p,render:z}},ke.isValidElement=V,ke.lazy=function(z){return{$$typeof:x,_payload:{_status:-1,_result:z},_init:Z}},ke.memo=function(z,L){return{$$typeof:v,type:z,compare:L===void 0?null:L}},ke.startTransition=function(z){var L=_.T,F={};_.T=F;try{var se=z(),pe=_.S;pe!==null&&pe(F,se),typeof se=="object"&&se!==null&&typeof se.then=="function"&&se.then(E,J)}catch(ye){J(ye)}finally{L!==null&&F.types!==null&&(L.types=F.types),_.T=L}},ke.unstable_useCacheRefresh=function(){return _.H.useCacheRefresh()},ke.use=function(z){return _.H.use(z)},ke.useActionState=function(z,L,F){return _.H.useActionState(z,L,F)},ke.useCallback=function(z,L){return _.H.useCallback(z,L)},ke.useContext=function(z){return _.H.useContext(z)},ke.useDebugValue=function(){},ke.useDeferredValue=function(z,L){return _.H.useDeferredValue(z,L)},ke.useEffect=function(z,L){return _.H.useEffect(z,L)},ke.useEffectEvent=function(z){return _.H.useEffectEvent(z)},ke.useId=function(){return _.H.useId()},ke.useImperativeHandle=function(z,L,F){return _.H.useImperativeHandle(z,L,F)},ke.useInsertionEffect=function(z,L){return _.H.useInsertionEffect(z,L)},ke.useLayoutEffect=function(z,L){return _.H.useLayoutEffect(z,L)},ke.useMemo=function(z,L){return _.H.useMemo(z,L)},ke.useOptimistic=function(z,L){return _.H.useOptimistic(z,L)},ke.useReducer=function(z,L,F){return _.H.useReducer(z,L,F)},ke.useRef=function(z){return _.H.useRef(z)},ke.useState=function(z){return _.H.useState(z)},ke.useSyncExternalStore=function(z,L,F){return _.H.useSyncExternalStore(z,L,F)},ke.useTransition=function(){return _.H.useTransition()},ke.version="19.2.8",ke}var Vy;function Nm(){return Vy||(Vy=1,mh.exports=b2()),mh.exports}var h=Nm();const me=Cm(h),Vl=v2({__proto__:null,default:me},[h]);var ph={exports:{}},Zo={},gh={exports:{}},vh={};/**
|
|
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 Yy;function w2(){return Yy||(Yy=1,(function(n){function a(k,q){var Z=k.length;k.push(q);e:for(;0<Z;){var J=Z-1>>>1,ne=k[J];if(0<c(ne,q))k[J]=q,k[Z]=ne,Z=J;else break e}}function l(k){return k.length===0?null:k[0]}function o(k){if(k.length===0)return null;var q=k[0],Z=k.pop();if(Z!==q){k[0]=Z;e:for(var J=0,ne=k.length,z=ne>>>1;J<z;){var L=2*(J+1)-1,F=k[L],se=L+1,pe=k[se];if(0>c(F,Z))se<ne&&0>c(pe,F)?(k[J]=pe,k[se]=Z,J=se):(k[J]=F,k[L]=Z,J=L);else if(se<ne&&0>c(pe,Z))k[J]=pe,k[se]=Z,J=se;else break e}}return q}function c(k,q){var Z=k.sortIndex-q.sortIndex;return Z!==0?Z:k.id-q.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;n.unstable_now=function(){return u.now()}}else{var f=Date,p=f.now();n.unstable_now=function(){return f.now()-p}}var g=[],v=[],x=1,y=null,b=3,w=!1,N=!1,S=!1,C=!1,R=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function M(k){for(var q=l(v);q!==null;){if(q.callback===null)o(v);else if(q.startTime<=k)o(v),q.sortIndex=q.expirationTime,a(g,q);else break;q=l(v)}}function O(k){if(S=!1,M(k),!N)if(l(g)!==null)N=!0,E||(E=!0,H());else{var q=l(v);q!==null&&B(O,q.startTime-k)}}var E=!1,_=-1,U=5,$=-1;function te(){return C?!0:!(n.unstable_now()-$<U)}function V(){if(C=!1,E){var k=n.unstable_now();$=k;var q=!0;try{e:{N=!1,S&&(S=!1,D(_),_=-1),w=!0;var Z=b;try{t:{for(M(k),y=l(g);y!==null&&!(y.expirationTime>k&&te());){var J=y.callback;if(typeof J=="function"){y.callback=null,b=y.priorityLevel;var ne=J(y.expirationTime<=k);if(k=n.unstable_now(),typeof ne=="function"){y.callback=ne,M(k),q=!0;break t}y===l(g)&&o(g),M(k)}else o(g);y=l(g)}if(y!==null)q=!0;else{var z=l(v);z!==null&&B(O,z.startTime-k),q=!1}}break e}finally{y=null,b=Z,w=!1}q=void 0}}finally{q?H():E=!1}}}var H;if(typeof A=="function")H=function(){A(V)};else if(typeof MessageChannel<"u"){var ae=new MessageChannel,ee=ae.port2;ae.port1.onmessage=V,H=function(){ee.postMessage(null)}}else H=function(){R(V,0)};function B(k,q){_=R(function(){k(n.unstable_now())},q)}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(k){k.callback=null},n.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<k?Math.floor(1e3/k):5},n.unstable_getCurrentPriorityLevel=function(){return b},n.unstable_next=function(k){switch(b){case 1:case 2:case 3:var q=3;break;default:q=b}var Z=b;b=q;try{return k()}finally{b=Z}},n.unstable_requestPaint=function(){C=!0},n.unstable_runWithPriority=function(k,q){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var Z=b;b=k;try{return q()}finally{b=Z}},n.unstable_scheduleCallback=function(k,q,Z){var J=n.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?J+Z:J):Z=J,k){case 1:var ne=-1;break;case 2:ne=250;break;case 5:ne=1073741823;break;case 4:ne=1e4;break;default:ne=5e3}return ne=Z+ne,k={id:x++,callback:q,priorityLevel:k,startTime:Z,expirationTime:ne,sortIndex:-1},Z>J?(k.sortIndex=Z,a(v,k),l(g)===null&&k===l(v)&&(S?(D(_),_=-1):S=!0,B(O,Z-J))):(k.sortIndex=ne,a(g,k),N||w||(N=!0,E||(E=!0,H()))),k},n.unstable_shouldYield=te,n.unstable_wrapCallback=function(k){var q=b;return function(){var Z=b;b=q;try{return k.apply(this,arguments)}finally{b=Z}}}})(vh)),vh}var Gy;function j2(){return Gy||(Gy=1,gh.exports=w2()),gh.exports}var xh={exports:{}},vn={};/**
|
|
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 Fy;function S2(){if(Fy)return vn;Fy=1;var n=Nm();function a(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 l(){}var o={d:{f:l,r:function(){throw Error(a(522))},D:l,C:l,L:l,m:l,X:l,S:l,M:l},p:0,findDOMNode:null},c=Symbol.for("react.portal");function u(g,v,x){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:y==null?null:""+y,children:g,containerInfo:v,implementation:x}}var f=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 vn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,vn.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(a(299));return u(g,v,null,x)},vn.flushSync=function(g){var v=f.T,x=o.p;try{if(f.T=null,o.p=2,g)return g()}finally{f.T=v,o.p=x,o.d.f()}},vn.preconnect=function(g,v){typeof g=="string"&&(v?(v=v.crossOrigin,v=typeof v=="string"?v==="use-credentials"?v:"":void 0):v=null,o.d.C(g,v))},vn.prefetchDNS=function(g){typeof g=="string"&&o.d.D(g)},vn.preinit=function(g,v){if(typeof g=="string"&&v&&typeof v.as=="string"){var x=v.as,y=p(x,v.crossOrigin),b=typeof v.integrity=="string"?v.integrity:void 0,w=typeof v.fetchPriority=="string"?v.fetchPriority:void 0;x==="style"?o.d.S(g,typeof v.precedence=="string"?v.precedence:void 0,{crossOrigin:y,integrity:b,fetchPriority:w}):x==="script"&&o.d.X(g,{crossOrigin:y,integrity:b,fetchPriority:w,nonce:typeof v.nonce=="string"?v.nonce:void 0})}},vn.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);o.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&&o.d.M(g)},vn.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);o.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})}},vn.preloadModule=function(g,v){if(typeof g=="string")if(v){var x=p(v.as,v.crossOrigin);o.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 o.d.m(g)},vn.requestFormReset=function(g){o.d.r(g)},vn.unstable_batchedUpdates=function(g,v){return g(v)},vn.useFormState=function(g,v,x){return f.H.useFormState(g,v,x)},vn.useFormStatus=function(){return f.H.useHostTransitionStatus()},vn.version="19.2.8",vn}var Xy;function a0(){if(Xy)return xh.exports;Xy=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(a){console.error(a)}}return n(),xh.exports=S2(),xh.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 Ky;function C2(){if(Ky)return Zo;Ky=1;var n=j2(),a=Nm(),l=a0();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r])}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 c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function f(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(u(e)!==e)throw Error(o(188))}function v(e){var t=e.alternate;if(!t){if(t=u(e),t===null)throw Error(o(188));return t!==e?null:e}for(var r=e,i=t;;){var d=r.return;if(d===null)break;var m=d.alternate;if(m===null){if(i=d.return,i!==null){r=i;continue}break}if(d.child===m.child){for(m=d.child;m;){if(m===r)return g(d),e;if(m===i)return g(d),t;m=m.sibling}throw Error(o(188))}if(r.return!==i.return)r=d,i=m;else{for(var j=!1,T=d.child;T;){if(T===r){j=!0,r=d,i=m;break}if(T===i){j=!0,i=d,r=m;break}T=T.sibling}if(!j){for(T=m.child;T;){if(T===r){j=!0,r=m,i=d;break}if(T===i){j=!0,i=m,r=d;break}T=T.sibling}if(!j)throw Error(o(189))}}if(r.alternate!==i)throw Error(o(190))}if(r.tag!==3)throw Error(o(188));return r.stateNode.current===r?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,b=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),D=Symbol.for("react.consumer"),A=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),te=Symbol.for("react.memo_cache_sentinel"),V=Symbol.iterator;function H(e){return e===null||typeof e!="object"?null:(e=V&&e[V]||e["@@iterator"],typeof e=="function"?e:null)}var ae=Symbol.for("react.client.reference");function ee(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ae?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case S:return"Fragment";case R:return"Profiler";case C:return"StrictMode";case O:return"Suspense";case E:return"SuspenseList";case $:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case N:return"Portal";case A:return e.displayName||"Context";case D:return(e._context.displayName||"Context")+".Consumer";case M:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case _:return t=e.displayName||null,t!==null?t:ee(e.type)||"Memo";case U:t=e._payload,e=e._init;try{return ee(e(t))}catch{}}return null}var B=Array.isArray,k=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},J=[],ne=-1;function z(e){return{current:e}}function L(e){0>ne||(e.current=J[ne],J[ne]=null,ne--)}function F(e,t){ne++,J[ne]=e.current,e.current=t}var se=z(null),pe=z(null),ye=z(null),G=z(null);function ue(e,t){switch(F(ye,t),F(pe,e),F(se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?oy(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=oy(t),e=iy(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}L(se),F(se,e)}function he(){L(se),L(pe),L(ye)}function xe(e){e.memoizedState!==null&&F(G,e);var t=se.current,r=iy(t,e.type);t!==r&&(F(pe,e),F(se,r))}function Ae(e){pe.current===e&&(L(se),L(pe)),G.current===e&&(L(G),Go._currentValue=Z)}var Ne,Oe;function Qe(e){if(Ne===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Ne=t&&t[1]||"",Oe=-1<r.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+Ne+e+Oe}var et=!1;function ce(e,t){if(!e||et)return"";et=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var oe=function(){throw Error()};if(Object.defineProperty(oe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(oe,[])}catch(W){var Q=W}Reflect.construct(e,[],oe)}else{try{oe.call()}catch(W){Q=W}e.call(oe.prototype)}}else{try{throw Error()}catch(W){Q=W}(oe=e())&&typeof oe.catch=="function"&&oe.catch(function(){})}}catch(W){if(W&&Q&&typeof W.stack=="string")return[W.stack,Q.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=i.DetermineComponentFrameRoot(),j=m[0],T=m[1];if(j&&T){var I=j.split(`
|
|
44
|
-
`),K=T.split(`
|
|
45
|
-
`);for(d=i=0;i<I.length&&!I[i].includes("DetermineComponentFrameRoot");)i++;for(;d<K.length&&!K[d].includes("DetermineComponentFrameRoot");)d++;if(i===I.length||d===K.length)for(i=I.length-1,d=K.length-1;1<=i&&0<=d&&I[i]!==K[d];)d--;for(;1<=i&&0<=d;i--,d--)if(I[i]!==K[d]){if(i!==1||d!==1)do if(i--,d--,0>d||I[i]!==K[d]){var re=`
|
|
46
|
-
`+I[i].replace(" at new "," at ");return e.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",e.displayName)),re}while(1<=i&&0<=d);break}}}finally{et=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?Qe(r):""}function Le(e,t){switch(e.tag){case 26:case 27:case 5:return Qe(e.type);case 16:return Qe("Lazy");case 13:return e.child!==t&&t!==null?Qe("Suspense Fallback"):Qe("Suspense");case 19:return Qe("SuspenseList");case 0:case 15:return ce(e.type,!1);case 11:return ce(e.type.render,!1);case 1:return ce(e.type,!0);case 31:return Qe("Activity");default:return""}}function qe(e){try{var t="",r=null;do t+=Le(e,r),r=e,e=e.return;while(e);return t}catch(i){return`
|
|
47
|
-
Error generating stack: `+i.message+`
|
|
48
|
-
`+i.stack}}var _t=Object.prototype.hasOwnProperty,St=n.unstable_scheduleCallback,Wt=n.unstable_cancelCallback,mn=n.unstable_shouldYield,en=n.unstable_requestPaint,Ct=n.unstable_now,xn=n.unstable_getCurrentPriorityLevel,At=n.unstable_ImmediatePriority,Mt=n.unstable_UserBlockingPriority,pn=n.unstable_NormalPriority,pa=n.unstable_LowPriority,Aa=n.unstable_IdlePriority,Wn=n.log,hs=n.unstable_setDisableYieldValue,ga=null,Dt=null;function yn(e){if(typeof Wn=="function"&&hs(e),Dt&&typeof Dt.setStrictMode=="function")try{Dt.setStrictMode(ga,e)}catch{}}var Tt=Math.clz32?Math.clz32:Gs,so=Math.log,Ys=Math.LN2;function Gs(e){return e>>>=0,e===0?32:31-(so(e)/Ys|0)|0}var Ya=256,Ar=262144,xt=4194304;function at(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 It(e,t,r){var i=e.pendingLanes;if(i===0)return 0;var d=0,m=e.suspendedLanes,j=e.pingedLanes;e=e.warmLanes;var T=i&134217727;return T!==0?(i=T&~m,i!==0?d=at(i):(j&=T,j!==0?d=at(j):r||(r=T&~e,r!==0&&(d=at(r))))):(T=i&~m,T!==0?d=at(T):j!==0?d=at(j):r||(r=i&~e,r!==0&&(d=at(r)))),d===0?0:t!==0&&t!==d&&(t&m)===0&&(m=d&-d,r=t&-t,m>=r||m===32&&(r&4194048)!==0)?t:d}function Ee(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function _e(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 Ue(){var e=xt;return xt<<=1,(xt&62914560)===0&&(xt=4194304),e}function vt(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Nt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ut(e,t,r,i,d,m){var j=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var T=e.entanglements,I=e.expirationTimes,K=e.hiddenUpdates;for(r=j&~r;0<r;){var re=31-Tt(r),oe=1<<re;T[re]=0,I[re]=-1;var Q=K[re];if(Q!==null)for(K[re]=null,re=0;re<Q.length;re++){var W=Q[re];W!==null&&(W.lane&=-536870913)}r&=~oe}i!==0&&Yt(e,i,0),m!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=m&~(j&~t))}function Yt(e,t,r){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-Tt(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|r&261930}function yt(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var i=31-Tt(r),d=1<<i;d&t|e[i]&t&&(e[i]|=t),r&=~d}}function zt(e,t){var r=t&-t;return r=(r&42)!==0?1:Ga(r),(r&(e.suspendedLanes|t))!==0?0:r}function Ga(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 Fa(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function va(){var e=q.p;return e!==0?e:(e=window.event,e===void 0?32:Dy(e.type))}function Mr(e,t){var r=q.p;try{return q.p=e,t()}finally{q.p=r}}var ea=Math.random().toString(36).slice(2),on="__reactFiber$"+ea,Cn="__reactProps$"+ea,Fs="__reactContainer$"+ea,nd="__reactEvents$"+ea,lS="__reactListeners$"+ea,oS="__reactHandles$"+ea,Xp="__reactResources$"+ea,lo="__reactMarker$"+ea;function ad(e){delete e[on],delete e[Cn],delete e[nd],delete e[lS],delete e[oS]}function Xs(e){var t=e[on];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Fs]||r[on]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=py(e);e!==null;){if(r=e[on])return r;e=py(e)}return t}e=r,r=e.parentNode}return null}function Ks(e){if(e=e[on]||e[Fs]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function oo(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Qs(e){var t=e[Xp];return t||(t=e[Xp]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function tn(e){e[lo]=!0}var Kp=new Set,Qp={};function ms(e,t){Zs(e,t),Zs(e+"Capture",t)}function Zs(e,t){for(Qp[e]=t,e=0;e<t.length;e++)Kp.add(t[e])}var iS=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]*$"),Zp={},Jp={};function cS(e){return _t.call(Jp,e)?!0:_t.call(Zp,e)?!1:iS.test(e)?Jp[e]=!0:(Zp[e]=!0,!1)}function Ei(e,t,r){if(cS(t))if(r===null)e.removeAttribute(t);else{switch(typeof r){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+r)}}function Ri(e,t,r){if(r===null)e.removeAttribute(t);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+r)}}function Xa(e,t,r,i){if(i===null)e.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(r);return}e.setAttributeNS(t,r,""+i)}}function ta(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Wp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function uS(e,t,r){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var d=i.get,m=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(j){r=""+j,m.call(this,j)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return r},setValue:function(j){r=""+j},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function rd(e){if(!e._valueTracker){var t=Wp(e)?"checked":"value";e._valueTracker=uS(e,t,""+e[t])}}function eg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),i="";return e&&(i=Wp(e)?e.checked?"true":"false":e.value),e=i,e!==r?(t.setValue(e),!0):!1}function Ti(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 dS=/[\n"\\]/g;function na(e){return e.replace(dS,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function sd(e,t,r,i,d,m,j,T){e.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?e.type=j:e.removeAttribute("type"),t!=null?j==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ta(t)):e.value!==""+ta(t)&&(e.value=""+ta(t)):j!=="submit"&&j!=="reset"||e.removeAttribute("value"),t!=null?ld(e,j,ta(t)):r!=null?ld(e,j,ta(r)):i!=null&&e.removeAttribute("value"),d==null&&m!=null&&(e.defaultChecked=!!m),d!=null&&(e.checked=d&&typeof d!="function"&&typeof d!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?e.name=""+ta(T):e.removeAttribute("name")}function tg(e,t,r,i,d,m,j,T){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(e.type=m),t!=null||r!=null){if(!(m!=="submit"&&m!=="reset"||t!=null)){rd(e);return}r=r!=null?""+ta(r):"",t=t!=null?""+ta(t):r,T||t===e.value||(e.value=t),e.defaultValue=t}i=i??d,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=T?e.checked:!!i,e.defaultChecked=!!i,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(e.name=j),rd(e)}function ld(e,t,r){t==="number"&&Ti(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function Js(e,t,r,i){if(e=e.options,t){t={};for(var d=0;d<r.length;d++)t["$"+r[d]]=!0;for(r=0;r<e.length;r++)d=t.hasOwnProperty("$"+e[r].value),e[r].selected!==d&&(e[r].selected=d),d&&i&&(e[r].defaultSelected=!0)}else{for(r=""+ta(r),t=null,d=0;d<e.length;d++){if(e[d].value===r){e[d].selected=!0,i&&(e[d].defaultSelected=!0);return}t!==null||e[d].disabled||(t=e[d])}t!==null&&(t.selected=!0)}}function ng(e,t,r){if(t!=null&&(t=""+ta(t),t!==e.value&&(e.value=t),r==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=r!=null?""+ta(r):""}function ag(e,t,r,i){if(t==null){if(i!=null){if(r!=null)throw Error(o(92));if(B(i)){if(1<i.length)throw Error(o(93));i=i[0]}r=i}r==null&&(r=""),t=r}r=ta(t),e.defaultValue=r,i=e.textContent,i===r&&i!==""&&i!==null&&(e.value=i),rd(e)}function Ws(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var fS=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 rg(e,t,r){var i=t.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,r):typeof r!="number"||r===0||fS.has(t)?t==="float"?e.cssFloat=r:e[t]=(""+r).trim():e[t]=r+"px"}function sg(e,t,r){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,r!=null){for(var i in r)!r.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var d in t)i=t[d],t.hasOwnProperty(d)&&r[d]!==i&&rg(e,d,i)}else for(var m in t)t.hasOwnProperty(m)&&rg(e,m,t[m])}function od(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 hS=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"]]),mS=/^[\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 Ai(e){return mS.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ka(){}var id=null;function cd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var el=null,tl=null;function lg(e){var t=Ks(e);if(t&&(e=t.stateNode)){var r=e[Cn]||null;e:switch(e=t.stateNode,t.type){case"input":if(sd(e,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+na(""+t)+'"][type="radio"]'),t=0;t<r.length;t++){var i=r[t];if(i!==e&&i.form===e.form){var d=i[Cn]||null;if(!d)throw Error(o(90));sd(i,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(t=0;t<r.length;t++)i=r[t],i.form===e.form&&eg(i)}break e;case"textarea":ng(e,r.value,r.defaultValue);break e;case"select":t=r.value,t!=null&&Js(e,!!r.multiple,t,!1)}}}var ud=!1;function og(e,t,r){if(ud)return e(t,r);ud=!0;try{var i=e(t);return i}finally{if(ud=!1,(el!==null||tl!==null)&&(gc(),el&&(t=el,e=tl,tl=el=null,lg(t),e)))for(t=0;t<e.length;t++)lg(e[t])}}function io(e,t){var r=e.stateNode;if(r===null)return null;var i=r[Cn]||null;if(i===null)return null;r=i[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":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(o(231,t,typeof r));return r}var Qa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),dd=!1;if(Qa)try{var co={};Object.defineProperty(co,"passive",{get:function(){dd=!0}}),window.addEventListener("test",co,co),window.removeEventListener("test",co,co)}catch{dd=!1}var Dr=null,fd=null,Mi=null;function ig(){if(Mi)return Mi;var e,t=fd,r=t.length,i,d="value"in Dr?Dr.value:Dr.textContent,m=d.length;for(e=0;e<r&&t[e]===d[e];e++);var j=r-e;for(i=1;i<=j&&t[r-i]===d[m-i];i++);return Mi=d.slice(e,1<i?1-i:void 0)}function Di(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 Oi(){return!0}function cg(){return!1}function Nn(e){function t(r,i,d,m,j){this._reactName=r,this._targetInst=d,this.type=i,this.nativeEvent=m,this.target=j,this.currentTarget=null;for(var T in e)e.hasOwnProperty(T)&&(r=e[T],this[T]=r?r(m):m[T]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?Oi:cg,this.isPropagationStopped=cg,this}return y(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Oi)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Oi)},persist:function(){},isPersistent:Oi}),t}var ps={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ki=Nn(ps),uo=y({},ps,{view:0,detail:0}),pS=Nn(uo),hd,md,fo,_i=y({},uo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:gd,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!==fo&&(fo&&e.type==="mousemove"?(hd=e.screenX-fo.screenX,md=e.screenY-fo.screenY):md=hd=0,fo=e),hd)},movementY:function(e){return"movementY"in e?e.movementY:md}}),ug=Nn(_i),gS=y({},_i,{dataTransfer:0}),vS=Nn(gS),xS=y({},uo,{relatedTarget:0}),pd=Nn(xS),yS=y({},ps,{animationName:0,elapsedTime:0,pseudoElement:0}),bS=Nn(yS),wS=y({},ps,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),jS=Nn(wS),SS=y({},ps,{data:0}),dg=Nn(SS),CS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},NS={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"},ES={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function RS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ES[e])?!!t[e]:!1}function gd(){return RS}var TS=y({},uo,{key:function(e){if(e.key){var t=CS[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Di(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?NS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:gd,charCode:function(e){return e.type==="keypress"?Di(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Di(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),AS=Nn(TS),MS=y({},_i,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),fg=Nn(MS),DS=y({},uo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:gd}),OS=Nn(DS),kS=y({},ps,{propertyName:0,elapsedTime:0,pseudoElement:0}),_S=Nn(kS),zS=y({},_i,{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}),LS=Nn(zS),US=y({},ps,{newState:0,oldState:0}),IS=Nn(US),PS=[9,13,27,32],vd=Qa&&"CompositionEvent"in window,ho=null;Qa&&"documentMode"in document&&(ho=document.documentMode);var BS=Qa&&"TextEvent"in window&&!ho,hg=Qa&&(!vd||ho&&8<ho&&11>=ho),mg=" ",pg=!1;function gg(e,t){switch(e){case"keyup":return PS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var nl=!1;function HS(e,t){switch(e){case"compositionend":return vg(t);case"keypress":return t.which!==32?null:(pg=!0,mg);case"textInput":return e=t.data,e===mg&&pg?null:e;default:return null}}function qS(e,t){if(nl)return e==="compositionend"||!vd&&gg(e,t)?(e=ig(),Mi=fd=Dr=null,nl=!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 hg&&t.locale!=="ko"?null:t.data;default:return null}}var $S={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 xg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!$S[e.type]:t==="textarea"}function yg(e,t,r,i){el?tl?tl.push(i):tl=[i]:el=i,t=Sc(t,"onChange"),0<t.length&&(r=new ki("onChange","change",null,r,i),e.push({event:r,listeners:t}))}var mo=null,po=null;function VS(e){ty(e,0)}function zi(e){var t=oo(e);if(eg(t))return e}function bg(e,t){if(e==="change")return t}var wg=!1;if(Qa){var xd;if(Qa){var yd="oninput"in document;if(!yd){var jg=document.createElement("div");jg.setAttribute("oninput","return;"),yd=typeof jg.oninput=="function"}xd=yd}else xd=!1;wg=xd&&(!document.documentMode||9<document.documentMode)}function Sg(){mo&&(mo.detachEvent("onpropertychange",Cg),po=mo=null)}function Cg(e){if(e.propertyName==="value"&&zi(po)){var t=[];yg(t,po,e,cd(e)),og(VS,t)}}function YS(e,t,r){e==="focusin"?(Sg(),mo=t,po=r,mo.attachEvent("onpropertychange",Cg)):e==="focusout"&&Sg()}function GS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return zi(po)}function FS(e,t){if(e==="click")return zi(t)}function XS(e,t){if(e==="input"||e==="change")return zi(t)}function KS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var $n=typeof Object.is=="function"?Object.is:KS;function go(e,t){if($n(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(i=0;i<r.length;i++){var d=r[i];if(!_t.call(t,d)||!$n(e[d],t[d]))return!1}return!0}function Ng(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Eg(e,t){var r=Ng(e);e=0;for(var i;r;){if(r.nodeType===3){if(i=e+r.textContent.length,e<=t&&i>=t)return{node:r,offset:t-e};e=i}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Ng(r)}}function Rg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Rg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Tg(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ti(e.document);t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Ti(e.document)}return t}function bd(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 QS=Qa&&"documentMode"in document&&11>=document.documentMode,al=null,wd=null,vo=null,jd=!1;function Ag(e,t,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;jd||al==null||al!==Ti(i)||(i=al,"selectionStart"in i&&bd(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),vo&&go(vo,i)||(vo=i,i=Sc(wd,"onSelect"),0<i.length&&(t=new ki("onSelect","select",null,t,r),e.push({event:t,listeners:i}),t.target=al)))}function gs(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var rl={animationend:gs("Animation","AnimationEnd"),animationiteration:gs("Animation","AnimationIteration"),animationstart:gs("Animation","AnimationStart"),transitionrun:gs("Transition","TransitionRun"),transitionstart:gs("Transition","TransitionStart"),transitioncancel:gs("Transition","TransitionCancel"),transitionend:gs("Transition","TransitionEnd")},Sd={},Mg={};Qa&&(Mg=document.createElement("div").style,"AnimationEvent"in window||(delete rl.animationend.animation,delete rl.animationiteration.animation,delete rl.animationstart.animation),"TransitionEvent"in window||delete rl.transitionend.transition);function vs(e){if(Sd[e])return Sd[e];if(!rl[e])return e;var t=rl[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Mg)return Sd[e]=t[r];return e}var Dg=vs("animationend"),Og=vs("animationiteration"),kg=vs("animationstart"),ZS=vs("transitionrun"),JS=vs("transitionstart"),WS=vs("transitioncancel"),_g=vs("transitionend"),zg=new Map,Cd="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(" ");Cd.push("scrollEnd");function xa(e,t){zg.set(e,t),ms(t,[e])}var Li=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)},aa=[],sl=0,Nd=0;function Ui(){for(var e=sl,t=Nd=sl=0;t<e;){var r=aa[t];aa[t++]=null;var i=aa[t];aa[t++]=null;var d=aa[t];aa[t++]=null;var m=aa[t];if(aa[t++]=null,i!==null&&d!==null){var j=i.pending;j===null?d.next=d:(d.next=j.next,j.next=d),i.pending=d}m!==0&&Lg(r,d,m)}}function Ii(e,t,r,i){aa[sl++]=e,aa[sl++]=t,aa[sl++]=r,aa[sl++]=i,Nd|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function Ed(e,t,r,i){return Ii(e,t,r,i),Pi(e)}function xs(e,t){return Ii(e,null,null,t),Pi(e)}function Lg(e,t,r){e.lanes|=r;var i=e.alternate;i!==null&&(i.lanes|=r);for(var d=!1,m=e.return;m!==null;)m.childLanes|=r,i=m.alternate,i!==null&&(i.childLanes|=r),m.tag===22&&(e=m.stateNode,e===null||e._visibility&1||(d=!0)),e=m,m=m.return;return e.tag===3?(m=e.stateNode,d&&t!==null&&(d=31-Tt(r),e=m.hiddenUpdates,i=e[d],i===null?e[d]=[t]:i.push(t),t.lane=r|536870912),m):null}function Pi(e){if(50<Po)throw Po=0,Lf=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ll={};function eC(e,t,r,i){this.tag=e,this.key=r,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=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Vn(e,t,r,i){return new eC(e,t,r,i)}function Rd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Za(e,t){var r=e.alternate;return r===null?(r=Vn(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&65011712,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r.refCleanup=e.refCleanup,r}function Ug(e,t){e.flags&=65011714;var r=e.alternate;return r===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=r.childLanes,e.lanes=r.lanes,e.child=r.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=r.memoizedProps,e.memoizedState=r.memoizedState,e.updateQueue=r.updateQueue,e.type=r.type,t=r.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Bi(e,t,r,i,d,m){var j=0;if(i=e,typeof e=="function")Rd(e)&&(j=1);else if(typeof e=="string")j=s2(e,r,se.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case $:return e=Vn(31,r,t,d),e.elementType=$,e.lanes=m,e;case S:return ys(r.children,d,m,t);case C:j=8,d|=24;break;case R:return e=Vn(12,r,t,d|2),e.elementType=R,e.lanes=m,e;case O:return e=Vn(13,r,t,d),e.elementType=O,e.lanes=m,e;case E:return e=Vn(19,r,t,d),e.elementType=E,e.lanes=m,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case A:j=10;break e;case D:j=9;break e;case M:j=11;break e;case _:j=14;break e;case U:j=16,i=null;break e}j=29,r=Error(o(130,e===null?"null":typeof e,"")),i=null}return t=Vn(j,r,t,d),t.elementType=e,t.type=i,t.lanes=m,t}function ys(e,t,r,i){return e=Vn(7,e,i,t),e.lanes=r,e}function Td(e,t,r){return e=Vn(6,e,null,t),e.lanes=r,e}function Ig(e){var t=Vn(18,null,null,0);return t.stateNode=e,t}function Ad(e,t,r){return t=Vn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Pg=new WeakMap;function ra(e,t){if(typeof e=="object"&&e!==null){var r=Pg.get(e);return r!==void 0?r:(t={value:e,source:t,stack:qe(t)},Pg.set(e,t),t)}return{value:e,source:t,stack:qe(t)}}var ol=[],il=0,Hi=null,xo=0,sa=[],la=0,Or=null,Ma=1,Da="";function Ja(e,t){ol[il++]=xo,ol[il++]=Hi,Hi=e,xo=t}function Bg(e,t,r){sa[la++]=Ma,sa[la++]=Da,sa[la++]=Or,Or=e;var i=Ma;e=Da;var d=32-Tt(i)-1;i&=~(1<<d),r+=1;var m=32-Tt(t)+d;if(30<m){var j=d-d%5;m=(i&(1<<j)-1).toString(32),i>>=j,d-=j,Ma=1<<32-Tt(t)+d|r<<d|i,Da=m+e}else Ma=1<<m|r<<d|i,Da=e}function Md(e){e.return!==null&&(Ja(e,1),Bg(e,1,0))}function Dd(e){for(;e===Hi;)Hi=ol[--il],ol[il]=null,xo=ol[--il],ol[il]=null;for(;e===Or;)Or=sa[--la],sa[la]=null,Da=sa[--la],sa[la]=null,Ma=sa[--la],sa[la]=null}function Hg(e,t){sa[la++]=Ma,sa[la++]=Da,sa[la++]=Or,Ma=t.id,Da=t.overflow,Or=e}var cn=null,bt=null,Xe=!1,kr=null,oa=!1,Od=Error(o(519));function _r(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw yo(ra(t,e)),Od}function qg(e){var t=e.stateNode,r=e.type,i=e.memoizedProps;switch(t[on]=e,t[Cn]=i,r){case"dialog":Ve("cancel",t),Ve("close",t);break;case"iframe":case"object":case"embed":Ve("load",t);break;case"video":case"audio":for(r=0;r<Ho.length;r++)Ve(Ho[r],t);break;case"source":Ve("error",t);break;case"img":case"image":case"link":Ve("error",t),Ve("load",t);break;case"details":Ve("toggle",t);break;case"input":Ve("invalid",t),tg(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":Ve("invalid",t);break;case"textarea":Ve("invalid",t),ag(t,i.value,i.defaultValue,i.children)}r=i.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||t.textContent===""+r||i.suppressHydrationWarning===!0||sy(t.textContent,r)?(i.popover!=null&&(Ve("beforetoggle",t),Ve("toggle",t)),i.onScroll!=null&&Ve("scroll",t),i.onScrollEnd!=null&&Ve("scrollend",t),i.onClick!=null&&(t.onclick=Ka),t=!0):t=!1,t||_r(e,!0)}function $g(e){for(cn=e.return;cn;)switch(cn.tag){case 5:case 31:case 13:oa=!1;return;case 27:case 3:oa=!0;return;default:cn=cn.return}}function cl(e){if(e!==cn)return!1;if(!Xe)return $g(e),Xe=!0,!1;var t=e.tag,r;if((r=t!==3&&t!==27)&&((r=t===5)&&(r=e.type,r=!(r!=="form"&&r!=="button")||Zf(e.type,e.memoizedProps)),r=!r),r&&bt&&_r(e),$g(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));bt=my(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));bt=my(e)}else t===27?(t=bt,Xr(e.type)?(e=nh,nh=null,bt=e):bt=t):bt=cn?ca(e.stateNode.nextSibling):null;return!0}function bs(){bt=cn=null,Xe=!1}function kd(){var e=kr;return e!==null&&(An===null?An=e:An.push.apply(An,e),kr=null),e}function yo(e){kr===null?kr=[e]:kr.push(e)}var _d=z(null),ws=null,Wa=null;function zr(e,t,r){F(_d,t._currentValue),t._currentValue=r}function er(e){e._currentValue=_d.current,L(_d)}function zd(e,t,r){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===r)break;e=e.return}}function Ld(e,t,r,i){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var m=d.dependencies;if(m!==null){var j=d.child;m=m.firstContext;e:for(;m!==null;){var T=m;m=d;for(var I=0;I<t.length;I++)if(T.context===t[I]){m.lanes|=r,T=m.alternate,T!==null&&(T.lanes|=r),zd(m.return,r,e),i||(j=null);break e}m=T.next}}else if(d.tag===18){if(j=d.return,j===null)throw Error(o(341));j.lanes|=r,m=j.alternate,m!==null&&(m.lanes|=r),zd(j,r,e),j=null}else j=d.child;if(j!==null)j.return=d;else for(j=d;j!==null;){if(j===e){j=null;break}if(d=j.sibling,d!==null){d.return=j.return,j=d;break}j=j.return}d=j}}function ul(e,t,r,i){e=null;for(var d=t,m=!1;d!==null;){if(!m){if((d.flags&524288)!==0)m=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var j=d.alternate;if(j===null)throw Error(o(387));if(j=j.memoizedProps,j!==null){var T=d.type;$n(d.pendingProps.value,j.value)||(e!==null?e.push(T):e=[T])}}else if(d===G.current){if(j=d.alternate,j===null)throw Error(o(387));j.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(Go):e=[Go])}d=d.return}e!==null&&Ld(t,e,r,i),t.flags|=262144}function qi(e){for(e=e.firstContext;e!==null;){if(!$n(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function js(e){ws=e,Wa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function un(e){return Vg(ws,e)}function $i(e,t){return ws===null&&js(e),Vg(e,t)}function Vg(e,t){var r=t._currentValue;if(t={context:t,memoizedValue:r,next:null},Wa===null){if(e===null)throw Error(o(308));Wa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Wa=Wa.next=t;return r}var tC=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(r,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(r){return r()})}},nC=n.unstable_scheduleCallback,aC=n.unstable_NormalPriority,Pt={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ud(){return{controller:new tC,data:new Map,refCount:0}}function bo(e){e.refCount--,e.refCount===0&&nC(aC,function(){e.controller.abort()})}var wo=null,Id=0,dl=0,fl=null;function rC(e,t){if(wo===null){var r=wo=[];Id=0,dl=qf(),fl={status:"pending",value:void 0,then:function(i){r.push(i)}}}return Id++,t.then(Yg,Yg),t}function Yg(){if(--Id===0&&wo!==null){fl!==null&&(fl.status="fulfilled");var e=wo;wo=null,dl=0,fl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function sC(e,t){var r=[],i={status:"pending",value:null,reason:null,then:function(d){r.push(d)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var d=0;d<r.length;d++)(0,r[d])(t)},function(d){for(i.status="rejected",i.reason=d,d=0;d<r.length;d++)(0,r[d])(void 0)}),i}var Gg=k.S;k.S=function(e,t){Ax=Ct(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&rC(e,t),Gg!==null&&Gg(e,t)};var Ss=z(null);function Pd(){var e=Ss.current;return e!==null?e:pt.pooledCache}function Vi(e,t){t===null?F(Ss,Ss.current):F(Ss,t.pool)}function Fg(){var e=Pd();return e===null?null:{parent:Pt._currentValue,pool:e}}var hl=Error(o(460)),Bd=Error(o(474)),Yi=Error(o(542)),Gi={then:function(){}};function Xg(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Kg(e,t,r){switch(r=e[r],r===void 0?e.push(t):r!==t&&(t.then(Ka,Ka),t=r),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Zg(e),e;default:if(typeof t.status=="string")t.then(Ka,Ka);else{if(e=pt,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var d=t;d.status="fulfilled",d.value=i}},function(i){if(t.status==="pending"){var d=t;d.status="rejected",d.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Zg(e),e}throw Ns=t,hl}}function Cs(e){try{var t=e._init;return t(e._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(Ns=r,hl):r}}var Ns=null;function Qg(){if(Ns===null)throw Error(o(459));var e=Ns;return Ns=null,e}function Zg(e){if(e===hl||e===Yi)throw Error(o(483))}var ml=null,jo=0;function Fi(e){var t=jo;return jo+=1,ml===null&&(ml=[]),Kg(ml,e,t)}function So(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Xi(e,t){throw t.$$typeof===b?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Jg(e){function t(Y,P){if(e){var X=Y.deletions;X===null?(Y.deletions=[P],Y.flags|=16):X.push(P)}}function r(Y,P){if(!e)return null;for(;P!==null;)t(Y,P),P=P.sibling;return null}function i(Y){for(var P=new Map;Y!==null;)Y.key!==null?P.set(Y.key,Y):P.set(Y.index,Y),Y=Y.sibling;return P}function d(Y,P){return Y=Za(Y,P),Y.index=0,Y.sibling=null,Y}function m(Y,P,X){return Y.index=X,e?(X=Y.alternate,X!==null?(X=X.index,X<P?(Y.flags|=67108866,P):X):(Y.flags|=67108866,P)):(Y.flags|=1048576,P)}function j(Y){return e&&Y.alternate===null&&(Y.flags|=67108866),Y}function T(Y,P,X,le){return P===null||P.tag!==6?(P=Td(X,Y.mode,le),P.return=Y,P):(P=d(P,X),P.return=Y,P)}function I(Y,P,X,le){var Te=X.type;return Te===S?re(Y,P,X.props.children,le,X.key):P!==null&&(P.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===U&&Cs(Te)===P.type)?(P=d(P,X.props),So(P,X),P.return=Y,P):(P=Bi(X.type,X.key,X.props,null,Y.mode,le),So(P,X),P.return=Y,P)}function K(Y,P,X,le){return P===null||P.tag!==4||P.stateNode.containerInfo!==X.containerInfo||P.stateNode.implementation!==X.implementation?(P=Ad(X,Y.mode,le),P.return=Y,P):(P=d(P,X.children||[]),P.return=Y,P)}function re(Y,P,X,le,Te){return P===null||P.tag!==7?(P=ys(X,Y.mode,le,Te),P.return=Y,P):(P=d(P,X),P.return=Y,P)}function oe(Y,P,X){if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return P=Td(""+P,Y.mode,X),P.return=Y,P;if(typeof P=="object"&&P!==null){switch(P.$$typeof){case w:return X=Bi(P.type,P.key,P.props,null,Y.mode,X),So(X,P),X.return=Y,X;case N:return P=Ad(P,Y.mode,X),P.return=Y,P;case U:return P=Cs(P),oe(Y,P,X)}if(B(P)||H(P))return P=ys(P,Y.mode,X,null),P.return=Y,P;if(typeof P.then=="function")return oe(Y,Fi(P),X);if(P.$$typeof===A)return oe(Y,$i(Y,P),X);Xi(Y,P)}return null}function Q(Y,P,X,le){var Te=P!==null?P.key:null;if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return Te!==null?null:T(Y,P,""+X,le);if(typeof X=="object"&&X!==null){switch(X.$$typeof){case w:return X.key===Te?I(Y,P,X,le):null;case N:return X.key===Te?K(Y,P,X,le):null;case U:return X=Cs(X),Q(Y,P,X,le)}if(B(X)||H(X))return Te!==null?null:re(Y,P,X,le,null);if(typeof X.then=="function")return Q(Y,P,Fi(X),le);if(X.$$typeof===A)return Q(Y,P,$i(Y,X),le);Xi(Y,X)}return null}function W(Y,P,X,le,Te){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return Y=Y.get(X)||null,T(P,Y,""+le,Te);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case w:return Y=Y.get(le.key===null?X:le.key)||null,I(P,Y,le,Te);case N:return Y=Y.get(le.key===null?X:le.key)||null,K(P,Y,le,Te);case U:return le=Cs(le),W(Y,P,X,le,Te)}if(B(le)||H(le))return Y=Y.get(X)||null,re(P,Y,le,Te,null);if(typeof le.then=="function")return W(Y,P,X,Fi(le),Te);if(le.$$typeof===A)return W(Y,P,X,$i(P,le),Te);Xi(P,le)}return null}function we(Y,P,X,le){for(var Te=null,Ze=null,je=P,Ie=P=0,Ge=null;je!==null&&Ie<X.length;Ie++){je.index>Ie?(Ge=je,je=null):Ge=je.sibling;var Je=Q(Y,je,X[Ie],le);if(Je===null){je===null&&(je=Ge);break}e&&je&&Je.alternate===null&&t(Y,je),P=m(Je,P,Ie),Ze===null?Te=Je:Ze.sibling=Je,Ze=Je,je=Ge}if(Ie===X.length)return r(Y,je),Xe&&Ja(Y,Ie),Te;if(je===null){for(;Ie<X.length;Ie++)je=oe(Y,X[Ie],le),je!==null&&(P=m(je,P,Ie),Ze===null?Te=je:Ze.sibling=je,Ze=je);return Xe&&Ja(Y,Ie),Te}for(je=i(je);Ie<X.length;Ie++)Ge=W(je,Y,Ie,X[Ie],le),Ge!==null&&(e&&Ge.alternate!==null&&je.delete(Ge.key===null?Ie:Ge.key),P=m(Ge,P,Ie),Ze===null?Te=Ge:Ze.sibling=Ge,Ze=Ge);return e&&je.forEach(function(Wr){return t(Y,Wr)}),Xe&&Ja(Y,Ie),Te}function De(Y,P,X,le){if(X==null)throw Error(o(151));for(var Te=null,Ze=null,je=P,Ie=P=0,Ge=null,Je=X.next();je!==null&&!Je.done;Ie++,Je=X.next()){je.index>Ie?(Ge=je,je=null):Ge=je.sibling;var Wr=Q(Y,je,Je.value,le);if(Wr===null){je===null&&(je=Ge);break}e&&je&&Wr.alternate===null&&t(Y,je),P=m(Wr,P,Ie),Ze===null?Te=Wr:Ze.sibling=Wr,Ze=Wr,je=Ge}if(Je.done)return r(Y,je),Xe&&Ja(Y,Ie),Te;if(je===null){for(;!Je.done;Ie++,Je=X.next())Je=oe(Y,Je.value,le),Je!==null&&(P=m(Je,P,Ie),Ze===null?Te=Je:Ze.sibling=Je,Ze=Je);return Xe&&Ja(Y,Ie),Te}for(je=i(je);!Je.done;Ie++,Je=X.next())Je=W(je,Y,Ie,Je.value,le),Je!==null&&(e&&Je.alternate!==null&&je.delete(Je.key===null?Ie:Je.key),P=m(Je,P,Ie),Ze===null?Te=Je:Ze.sibling=Je,Ze=Je);return e&&je.forEach(function(g2){return t(Y,g2)}),Xe&&Ja(Y,Ie),Te}function ht(Y,P,X,le){if(typeof X=="object"&&X!==null&&X.type===S&&X.key===null&&(X=X.props.children),typeof X=="object"&&X!==null){switch(X.$$typeof){case w:e:{for(var Te=X.key;P!==null;){if(P.key===Te){if(Te=X.type,Te===S){if(P.tag===7){r(Y,P.sibling),le=d(P,X.props.children),le.return=Y,Y=le;break e}}else if(P.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===U&&Cs(Te)===P.type){r(Y,P.sibling),le=d(P,X.props),So(le,X),le.return=Y,Y=le;break e}r(Y,P);break}else t(Y,P);P=P.sibling}X.type===S?(le=ys(X.props.children,Y.mode,le,X.key),le.return=Y,Y=le):(le=Bi(X.type,X.key,X.props,null,Y.mode,le),So(le,X),le.return=Y,Y=le)}return j(Y);case N:e:{for(Te=X.key;P!==null;){if(P.key===Te)if(P.tag===4&&P.stateNode.containerInfo===X.containerInfo&&P.stateNode.implementation===X.implementation){r(Y,P.sibling),le=d(P,X.children||[]),le.return=Y,Y=le;break e}else{r(Y,P);break}else t(Y,P);P=P.sibling}le=Ad(X,Y.mode,le),le.return=Y,Y=le}return j(Y);case U:return X=Cs(X),ht(Y,P,X,le)}if(B(X))return we(Y,P,X,le);if(H(X)){if(Te=H(X),typeof Te!="function")throw Error(o(150));return X=Te.call(X),De(Y,P,X,le)}if(typeof X.then=="function")return ht(Y,P,Fi(X),le);if(X.$$typeof===A)return ht(Y,P,$i(Y,X),le);Xi(Y,X)}return typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint"?(X=""+X,P!==null&&P.tag===6?(r(Y,P.sibling),le=d(P,X),le.return=Y,Y=le):(r(Y,P),le=Td(X,Y.mode,le),le.return=Y,Y=le),j(Y)):r(Y,P)}return function(Y,P,X,le){try{jo=0;var Te=ht(Y,P,X,le);return ml=null,Te}catch(je){if(je===hl||je===Yi)throw je;var Ze=Vn(29,je,null,Y.mode);return Ze.lanes=le,Ze.return=Y,Ze}finally{}}}var Es=Jg(!0),Wg=Jg(!1),Lr=!1;function Hd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function qd(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 Ur(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ir(e,t,r){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(tt&2)!==0){var d=i.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),i.pending=t,t=Pi(e),Lg(e,null,r),t}return Ii(e,i,t,r),Pi(e)}function Co(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,yt(e,r)}}function $d(e,t){var r=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,r===i)){var d=null,m=null;if(r=r.firstBaseUpdate,r!==null){do{var j={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};m===null?d=m=j:m=m.next=j,r=r.next}while(r!==null);m===null?d=m=t:m=m.next=t}else d=m=t;r={baseState:i.baseState,firstBaseUpdate:d,lastBaseUpdate:m,shared:i.shared,callbacks:i.callbacks},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}var Vd=!1;function No(){if(Vd){var e=fl;if(e!==null)throw e}}function Eo(e,t,r,i){Vd=!1;var d=e.updateQueue;Lr=!1;var m=d.firstBaseUpdate,j=d.lastBaseUpdate,T=d.shared.pending;if(T!==null){d.shared.pending=null;var I=T,K=I.next;I.next=null,j===null?m=K:j.next=K,j=I;var re=e.alternate;re!==null&&(re=re.updateQueue,T=re.lastBaseUpdate,T!==j&&(T===null?re.firstBaseUpdate=K:T.next=K,re.lastBaseUpdate=I))}if(m!==null){var oe=d.baseState;j=0,re=K=I=null,T=m;do{var Q=T.lane&-536870913,W=Q!==T.lane;if(W?(Ye&Q)===Q:(i&Q)===Q){Q!==0&&Q===dl&&(Vd=!0),re!==null&&(re=re.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var we=e,De=T;Q=t;var ht=r;switch(De.tag){case 1:if(we=De.payload,typeof we=="function"){oe=we.call(ht,oe,Q);break e}oe=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=De.payload,Q=typeof we=="function"?we.call(ht,oe,Q):we,Q==null)break e;oe=y({},oe,Q);break e;case 2:Lr=!0}}Q=T.callback,Q!==null&&(e.flags|=64,W&&(e.flags|=8192),W=d.callbacks,W===null?d.callbacks=[Q]:W.push(Q))}else W={lane:Q,tag:T.tag,payload:T.payload,callback:T.callback,next:null},re===null?(K=re=W,I=oe):re=re.next=W,j|=Q;if(T=T.next,T===null){if(T=d.shared.pending,T===null)break;W=T,T=W.next,W.next=null,d.lastBaseUpdate=W,d.shared.pending=null}}while(!0);re===null&&(I=oe),d.baseState=I,d.firstBaseUpdate=K,d.lastBaseUpdate=re,m===null&&(d.shared.lanes=0),$r|=j,e.lanes=j,e.memoizedState=oe}}function ev(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function tv(e,t){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;e<r.length;e++)ev(r[e],t)}var pl=z(null),Ki=z(0);function nv(e,t){e=cr,F(Ki,e),F(pl,t),cr=e|t.baseLanes}function Yd(){F(Ki,cr),F(pl,pl.current)}function Gd(){cr=Ki.current,L(pl),L(Ki)}var Yn=z(null),ia=null;function Pr(e){var t=e.alternate;F(Lt,Lt.current&1),F(Yn,e),ia===null&&(t===null||pl.current!==null||t.memoizedState!==null)&&(ia=e)}function Fd(e){F(Lt,Lt.current),F(Yn,e),ia===null&&(ia=e)}function av(e){e.tag===22?(F(Lt,Lt.current),F(Yn,e),ia===null&&(ia=e)):Br()}function Br(){F(Lt,Lt.current),F(Yn,Yn.current)}function Gn(e){L(Yn),ia===e&&(ia=null),L(Lt)}var Lt=z(0);function Qi(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||eh(r)||th(r)))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 tr=0,ze=null,dt=null,Bt=null,Zi=!1,gl=!1,Rs=!1,Ji=0,Ro=0,vl=null,lC=0;function Ot(){throw Error(o(321))}function Xd(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!$n(e[r],t[r]))return!1;return!0}function Kd(e,t,r,i,d,m){return tr=m,ze=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?Bv:df,Rs=!1,m=r(i,d),Rs=!1,gl&&(m=sv(t,r,i,d)),rv(e),m}function rv(e){k.H=Mo;var t=dt!==null&&dt.next!==null;if(tr=0,Bt=dt=ze=null,Zi=!1,Ro=0,vl=null,t)throw Error(o(300));e===null||Ht||(e=e.dependencies,e!==null&&qi(e)&&(Ht=!0))}function sv(e,t,r,i){ze=e;var d=0;do{if(gl&&(vl=null),Ro=0,gl=!1,25<=d)throw Error(o(301));if(d+=1,Bt=dt=null,e.updateQueue!=null){var m=e.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}k.H=Hv,m=t(r,i)}while(gl);return m}function oC(){var e=k.H,t=e.useState()[0];return t=typeof t.then=="function"?To(t):t,e=e.useState()[0],(dt!==null?dt.memoizedState:null)!==e&&(ze.flags|=1024),t}function Qd(){var e=Ji!==0;return Ji=0,e}function Zd(e,t,r){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r}function Jd(e){if(Zi){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Zi=!1}tr=0,Bt=dt=ze=null,gl=!1,Ro=Ji=0,vl=null}function bn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bt===null?ze.memoizedState=Bt=e:Bt=Bt.next=e,Bt}function Ut(){if(dt===null){var e=ze.alternate;e=e!==null?e.memoizedState:null}else e=dt.next;var t=Bt===null?ze.memoizedState:Bt.next;if(t!==null)Bt=t,dt=e;else{if(e===null)throw ze.alternate===null?Error(o(467)):Error(o(310));dt=e,e={memoizedState:dt.memoizedState,baseState:dt.baseState,baseQueue:dt.baseQueue,queue:dt.queue,next:null},Bt===null?ze.memoizedState=Bt=e:Bt=Bt.next=e}return Bt}function Wi(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function To(e){var t=Ro;return Ro+=1,vl===null&&(vl=[]),e=Kg(vl,e,t),t=ze,(Bt===null?t.memoizedState:Bt.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?Bv:df),e}function ec(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return To(e);if(e.$$typeof===A)return un(e)}throw Error(o(438,String(e)))}function Wd(e){var t=null,r=ze.updateQueue;if(r!==null&&(t=r.memoCache),t==null){var i=ze.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(d){return d.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),r===null&&(r=Wi(),ze.updateQueue=r),r.memoCache=t,r=t.data[t.index],r===void 0)for(r=t.data[t.index]=Array(e),i=0;i<e;i++)r[i]=te;return t.index++,r}function nr(e,t){return typeof t=="function"?t(e):t}function tc(e){var t=Ut();return ef(t,dt,e)}function ef(e,t,r){var i=e.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=r;var d=e.baseQueue,m=i.pending;if(m!==null){if(d!==null){var j=d.next;d.next=m.next,m.next=j}t.baseQueue=d=m,i.pending=null}if(m=e.baseState,d===null)e.memoizedState=m;else{t=d.next;var T=j=null,I=null,K=t,re=!1;do{var oe=K.lane&-536870913;if(oe!==K.lane?(Ye&oe)===oe:(tr&oe)===oe){var Q=K.revertLane;if(Q===0)I!==null&&(I=I.next={lane:0,revertLane:0,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null}),oe===dl&&(re=!0);else if((tr&Q)===Q){K=K.next,Q===dl&&(re=!0);continue}else oe={lane:0,revertLane:K.revertLane,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},I===null?(T=I=oe,j=m):I=I.next=oe,ze.lanes|=Q,$r|=Q;oe=K.action,Rs&&r(m,oe),m=K.hasEagerState?K.eagerState:r(m,oe)}else Q={lane:oe,revertLane:K.revertLane,gesture:K.gesture,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},I===null?(T=I=Q,j=m):I=I.next=Q,ze.lanes|=oe,$r|=oe;K=K.next}while(K!==null&&K!==t);if(I===null?j=m:I.next=T,!$n(m,e.memoizedState)&&(Ht=!0,re&&(r=fl,r!==null)))throw r;e.memoizedState=m,e.baseState=j,e.baseQueue=I,i.lastRenderedState=m}return d===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function tf(e){var t=Ut(),r=t.queue;if(r===null)throw Error(o(311));r.lastRenderedReducer=e;var i=r.dispatch,d=r.pending,m=t.memoizedState;if(d!==null){r.pending=null;var j=d=d.next;do m=e(m,j.action),j=j.next;while(j!==d);$n(m,t.memoizedState)||(Ht=!0),t.memoizedState=m,t.baseQueue===null&&(t.baseState=m),r.lastRenderedState=m}return[m,i]}function lv(e,t,r){var i=ze,d=Ut(),m=Xe;if(m){if(r===void 0)throw Error(o(407));r=r()}else r=t();var j=!$n((dt||d).memoizedState,r);if(j&&(d.memoizedState=r,Ht=!0),d=d.queue,rf(cv.bind(null,i,d,e),[e]),d.getSnapshot!==t||j||Bt!==null&&Bt.memoizedState.tag&1){if(i.flags|=2048,xl(9,{destroy:void 0},iv.bind(null,i,d,r,t),null),pt===null)throw Error(o(349));m||(tr&127)!==0||ov(i,t,r)}return r}function ov(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=ze.updateQueue,t===null?(t=Wi(),ze.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function iv(e,t,r,i){t.value=r,t.getSnapshot=i,uv(t)&&dv(e)}function cv(e,t,r){return r(function(){uv(t)&&dv(e)})}function uv(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!$n(e,r)}catch{return!0}}function dv(e){var t=xs(e,2);t!==null&&Mn(t,e,2)}function nf(e){var t=bn();if(typeof e=="function"){var r=e;if(e=r(),Rs){yn(!0);try{r()}finally{yn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:nr,lastRenderedState:e},t}function fv(e,t,r,i){return e.baseState=r,ef(e,dt,typeof i=="function"?i:nr)}function iC(e,t,r,i,d){if(rc(e))throw Error(o(485));if(e=t.action,e!==null){var m={payload:d,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(j){m.listeners.push(j)}};k.T!==null?r(!0):m.isTransition=!1,i(m),r=t.pending,r===null?(m.next=t.pending=m,hv(t,m)):(m.next=r.next,t.pending=r.next=m)}}function hv(e,t){var r=t.action,i=t.payload,d=e.state;if(t.isTransition){var m=k.T,j={};k.T=j;try{var T=r(d,i),I=k.S;I!==null&&I(j,T),mv(e,t,T)}catch(K){af(e,t,K)}finally{m!==null&&j.types!==null&&(m.types=j.types),k.T=m}}else try{m=r(d,i),mv(e,t,m)}catch(K){af(e,t,K)}}function mv(e,t,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(i){pv(e,t,i)},function(i){return af(e,t,i)}):pv(e,t,r)}function pv(e,t,r){t.status="fulfilled",t.value=r,gv(t),e.state=r,t=e.pending,t!==null&&(r=t.next,r===t?e.pending=null:(r=r.next,t.next=r,hv(e,r)))}function af(e,t,r){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=r,gv(t),t=t.next;while(t!==i)}e.action=null}function gv(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function vv(e,t){return t}function xv(e,t){if(Xe){var r=pt.formState;if(r!==null){e:{var i=ze;if(Xe){if(bt){t:{for(var d=bt,m=oa;d.nodeType!==8;){if(!m){d=null;break t}if(d=ca(d.nextSibling),d===null){d=null;break t}}m=d.data,d=m==="F!"||m==="F"?d:null}if(d){bt=ca(d.nextSibling),i=d.data==="F!";break e}}_r(i)}i=!1}i&&(t=r[0])}}return r=bn(),r.memoizedState=r.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vv,lastRenderedState:t},r.queue=i,r=Uv.bind(null,ze,i),i.dispatch=r,i=nf(!1),m=uf.bind(null,ze,!1,i.queue),i=bn(),d={state:t,dispatch:null,action:e,pending:null},i.queue=d,r=iC.bind(null,ze,d,m,r),d.dispatch=r,i.memoizedState=e,[t,r,!1]}function yv(e){var t=Ut();return bv(t,dt,e)}function bv(e,t,r){if(t=ef(e,t,vv)[0],e=tc(nr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=To(t)}catch(j){throw j===hl?Yi:j}else i=t;t=Ut();var d=t.queue,m=d.dispatch;return r!==t.memoizedState&&(ze.flags|=2048,xl(9,{destroy:void 0},cC.bind(null,d,r),null)),[i,m,e]}function cC(e,t){e.action=t}function wv(e){var t=Ut(),r=dt;if(r!==null)return bv(t,r,e);Ut(),t=t.memoizedState,r=Ut();var i=r.queue.dispatch;return r.memoizedState=e,[t,i,!1]}function xl(e,t,r,i){return e={tag:e,create:r,deps:i,inst:t,next:null},t=ze.updateQueue,t===null&&(t=Wi(),ze.updateQueue=t),r=t.lastEffect,r===null?t.lastEffect=e.next=e:(i=r.next,r.next=e,e.next=i,t.lastEffect=e),e}function jv(){return Ut().memoizedState}function nc(e,t,r,i){var d=bn();ze.flags|=e,d.memoizedState=xl(1|t,{destroy:void 0},r,i===void 0?null:i)}function ac(e,t,r,i){var d=Ut();i=i===void 0?null:i;var m=d.memoizedState.inst;dt!==null&&i!==null&&Xd(i,dt.memoizedState.deps)?d.memoizedState=xl(t,m,r,i):(ze.flags|=e,d.memoizedState=xl(1|t,m,r,i))}function Sv(e,t){nc(8390656,8,e,t)}function rf(e,t){ac(2048,8,e,t)}function uC(e){ze.flags|=4;var t=ze.updateQueue;if(t===null)t=Wi(),ze.updateQueue=t,t.events=[e];else{var r=t.events;r===null?t.events=[e]:r.push(e)}}function Cv(e){var t=Ut().memoizedState;return uC({ref:t,nextImpl:e}),function(){if((tt&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Nv(e,t){return ac(4,2,e,t)}function Ev(e,t){return ac(4,4,e,t)}function Rv(e,t){if(typeof t=="function"){e=e();var r=t(e);return function(){typeof r=="function"?r():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Tv(e,t,r){r=r!=null?r.concat([e]):null,ac(4,4,Rv.bind(null,t,e),r)}function sf(){}function Av(e,t){var r=Ut();t=t===void 0?null:t;var i=r.memoizedState;return t!==null&&Xd(t,i[1])?i[0]:(r.memoizedState=[e,t],e)}function Mv(e,t){var r=Ut();t=t===void 0?null:t;var i=r.memoizedState;if(t!==null&&Xd(t,i[1]))return i[0];if(i=e(),Rs){yn(!0);try{e()}finally{yn(!1)}}return r.memoizedState=[i,t],i}function lf(e,t,r){return r===void 0||(tr&1073741824)!==0&&(Ye&261930)===0?e.memoizedState=t:(e.memoizedState=r,e=Dx(),ze.lanes|=e,$r|=e,r)}function Dv(e,t,r,i){return $n(r,t)?r:pl.current!==null?(e=lf(e,r,i),$n(e,t)||(Ht=!0),e):(tr&42)===0||(tr&1073741824)!==0&&(Ye&261930)===0?(Ht=!0,e.memoizedState=r):(e=Dx(),ze.lanes|=e,$r|=e,t)}function Ov(e,t,r,i,d){var m=q.p;q.p=m!==0&&8>m?m:8;var j=k.T,T={};k.T=T,uf(e,!1,t,r);try{var I=d(),K=k.S;if(K!==null&&K(T,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var re=sC(I,i);Ao(e,t,re,Kn(e))}else Ao(e,t,i,Kn(e))}catch(oe){Ao(e,t,{then:function(){},status:"rejected",reason:oe},Kn())}finally{q.p=m,j!==null&&T.types!==null&&(j.types=T.types),k.T=j}}function dC(){}function of(e,t,r,i){if(e.tag!==5)throw Error(o(476));var d=kv(e).queue;Ov(e,d,t,Z,r===null?dC:function(){return _v(e),r(i)})}function kv(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:nr,lastRenderedState:Z},next:null};var r={};return t.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:nr,lastRenderedState:r},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function _v(e){var t=kv(e);t.next===null&&(t=e.alternate.memoizedState),Ao(e,t.next.queue,{},Kn())}function cf(){return un(Go)}function zv(){return Ut().memoizedState}function Lv(){return Ut().memoizedState}function fC(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var r=Kn();e=Ur(r);var i=Ir(t,e,r);i!==null&&(Mn(i,t,r),Co(i,t,r)),t={cache:Ud()},e.payload=t;return}t=t.return}}function hC(e,t,r){var i=Kn();r={lane:i,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},rc(e)?Iv(t,r):(r=Ed(e,t,r,i),r!==null&&(Mn(r,e,i),Pv(r,t,i)))}function Uv(e,t,r){var i=Kn();Ao(e,t,r,i)}function Ao(e,t,r,i){var d={lane:i,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(rc(e))Iv(t,d);else{var m=e.alternate;if(e.lanes===0&&(m===null||m.lanes===0)&&(m=t.lastRenderedReducer,m!==null))try{var j=t.lastRenderedState,T=m(j,r);if(d.hasEagerState=!0,d.eagerState=T,$n(T,j))return Ii(e,t,d,0),pt===null&&Ui(),!1}catch{}finally{}if(r=Ed(e,t,d,i),r!==null)return Mn(r,e,i),Pv(r,t,i),!0}return!1}function uf(e,t,r,i){if(i={lane:2,revertLane:qf(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},rc(e)){if(t)throw Error(o(479))}else t=Ed(e,r,i,2),t!==null&&Mn(t,e,2)}function rc(e){var t=e.alternate;return e===ze||t!==null&&t===ze}function Iv(e,t){gl=Zi=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Pv(e,t,r){if((r&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,yt(e,r)}}var Mo={readContext:un,use:ec,useCallback:Ot,useContext:Ot,useEffect:Ot,useImperativeHandle:Ot,useLayoutEffect:Ot,useInsertionEffect:Ot,useMemo:Ot,useReducer:Ot,useRef:Ot,useState:Ot,useDebugValue:Ot,useDeferredValue:Ot,useTransition:Ot,useSyncExternalStore:Ot,useId:Ot,useHostTransitionStatus:Ot,useFormState:Ot,useActionState:Ot,useOptimistic:Ot,useMemoCache:Ot,useCacheRefresh:Ot};Mo.useEffectEvent=Ot;var Bv={readContext:un,use:ec,useCallback:function(e,t){return bn().memoizedState=[e,t===void 0?null:t],e},useContext:un,useEffect:Sv,useImperativeHandle:function(e,t,r){r=r!=null?r.concat([e]):null,nc(4194308,4,Rv.bind(null,t,e),r)},useLayoutEffect:function(e,t){return nc(4194308,4,e,t)},useInsertionEffect:function(e,t){nc(4,2,e,t)},useMemo:function(e,t){var r=bn();t=t===void 0?null:t;var i=e();if(Rs){yn(!0);try{e()}finally{yn(!1)}}return r.memoizedState=[i,t],i},useReducer:function(e,t,r){var i=bn();if(r!==void 0){var d=r(t);if(Rs){yn(!0);try{r(t)}finally{yn(!1)}}}else d=t;return i.memoizedState=i.baseState=d,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:d},i.queue=e,e=e.dispatch=hC.bind(null,ze,e),[i.memoizedState,e]},useRef:function(e){var t=bn();return e={current:e},t.memoizedState=e},useState:function(e){e=nf(e);var t=e.queue,r=Uv.bind(null,ze,t);return t.dispatch=r,[e.memoizedState,r]},useDebugValue:sf,useDeferredValue:function(e,t){var r=bn();return lf(r,e,t)},useTransition:function(){var e=nf(!1);return e=Ov.bind(null,ze,e.queue,!0,!1),bn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,r){var i=ze,d=bn();if(Xe){if(r===void 0)throw Error(o(407));r=r()}else{if(r=t(),pt===null)throw Error(o(349));(Ye&127)!==0||ov(i,t,r)}d.memoizedState=r;var m={value:r,getSnapshot:t};return d.queue=m,Sv(cv.bind(null,i,m,e),[e]),i.flags|=2048,xl(9,{destroy:void 0},iv.bind(null,i,m,r,t),null),r},useId:function(){var e=bn(),t=pt.identifierPrefix;if(Xe){var r=Da,i=Ma;r=(i&~(1<<32-Tt(i)-1)).toString(32)+r,t="_"+t+"R_"+r,r=Ji++,0<r&&(t+="H"+r.toString(32)),t+="_"}else r=lC++,t="_"+t+"r_"+r.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:cf,useFormState:xv,useActionState:xv,useOptimistic:function(e){var t=bn();t.memoizedState=t.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=r,t=uf.bind(null,ze,!0,r),r.dispatch=t,[e,t]},useMemoCache:Wd,useCacheRefresh:function(){return bn().memoizedState=fC.bind(null,ze)},useEffectEvent:function(e){var t=bn(),r={impl:e};return t.memoizedState=r,function(){if((tt&2)!==0)throw Error(o(440));return r.impl.apply(void 0,arguments)}}},df={readContext:un,use:ec,useCallback:Av,useContext:un,useEffect:rf,useImperativeHandle:Tv,useInsertionEffect:Nv,useLayoutEffect:Ev,useMemo:Mv,useReducer:tc,useRef:jv,useState:function(){return tc(nr)},useDebugValue:sf,useDeferredValue:function(e,t){var r=Ut();return Dv(r,dt.memoizedState,e,t)},useTransition:function(){var e=tc(nr)[0],t=Ut().memoizedState;return[typeof e=="boolean"?e:To(e),t]},useSyncExternalStore:lv,useId:zv,useHostTransitionStatus:cf,useFormState:yv,useActionState:yv,useOptimistic:function(e,t){var r=Ut();return fv(r,dt,e,t)},useMemoCache:Wd,useCacheRefresh:Lv};df.useEffectEvent=Cv;var Hv={readContext:un,use:ec,useCallback:Av,useContext:un,useEffect:rf,useImperativeHandle:Tv,useInsertionEffect:Nv,useLayoutEffect:Ev,useMemo:Mv,useReducer:tf,useRef:jv,useState:function(){return tf(nr)},useDebugValue:sf,useDeferredValue:function(e,t){var r=Ut();return dt===null?lf(r,e,t):Dv(r,dt.memoizedState,e,t)},useTransition:function(){var e=tf(nr)[0],t=Ut().memoizedState;return[typeof e=="boolean"?e:To(e),t]},useSyncExternalStore:lv,useId:zv,useHostTransitionStatus:cf,useFormState:wv,useActionState:wv,useOptimistic:function(e,t){var r=Ut();return dt!==null?fv(r,dt,e,t):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:Wd,useCacheRefresh:Lv};Hv.useEffectEvent=Cv;function ff(e,t,r,i){t=e.memoizedState,r=r(i,t),r=r==null?t:y({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var hf={enqueueSetState:function(e,t,r){e=e._reactInternals;var i=Kn(),d=Ur(i);d.payload=t,r!=null&&(d.callback=r),t=Ir(e,d,i),t!==null&&(Mn(t,e,i),Co(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var i=Kn(),d=Ur(i);d.tag=1,d.payload=t,r!=null&&(d.callback=r),t=Ir(e,d,i),t!==null&&(Mn(t,e,i),Co(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Kn(),i=Ur(r);i.tag=2,t!=null&&(i.callback=t),t=Ir(e,i,r),t!==null&&(Mn(t,e,r),Co(t,e,r))}};function qv(e,t,r,i,d,m,j){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,m,j):t.prototype&&t.prototype.isPureReactComponent?!go(r,i)||!go(d,m):!0}function $v(e,t,r,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,i),t.state!==e&&hf.enqueueReplaceState(t,t.state,null)}function Ts(e,t){var r=t;if("ref"in t){r={};for(var i in t)i!=="ref"&&(r[i]=t[i])}if(e=e.defaultProps){r===t&&(r=y({},r));for(var d in e)r[d]===void 0&&(r[d]=e[d])}return r}function Vv(e){Li(e)}function Yv(e){console.error(e)}function Gv(e){Li(e)}function sc(e,t){try{var r=e.onUncaughtError;r(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function Fv(e,t,r){try{var i=e.onCaughtError;i(r.value,{componentStack:r.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function mf(e,t,r){return r=Ur(r),r.tag=3,r.payload={element:null},r.callback=function(){sc(e,t)},r}function Xv(e){return e=Ur(e),e.tag=3,e}function Kv(e,t,r,i){var d=r.type.getDerivedStateFromError;if(typeof d=="function"){var m=i.value;e.payload=function(){return d(m)},e.callback=function(){Fv(t,r,i)}}var j=r.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(e.callback=function(){Fv(t,r,i),typeof d!="function"&&(Vr===null?Vr=new Set([this]):Vr.add(this));var T=i.stack;this.componentDidCatch(i.value,{componentStack:T!==null?T:""})})}function mC(e,t,r,i,d){if(r.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=r.alternate,t!==null&&ul(t,r,d,!0),r=Yn.current,r!==null){switch(r.tag){case 31:case 13:return ia===null?vc():r.alternate===null&&kt===0&&(kt=3),r.flags&=-257,r.flags|=65536,r.lanes=d,i===Gi?r.flags|=16384:(t=r.updateQueue,t===null?r.updateQueue=new Set([i]):t.add(i),Pf(e,i,d)),!1;case 22:return r.flags|=65536,i===Gi?r.flags|=16384:(t=r.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},r.updateQueue=t):(r=t.retryQueue,r===null?t.retryQueue=new Set([i]):r.add(i)),Pf(e,i,d)),!1}throw Error(o(435,r.tag))}return Pf(e,i,d),vc(),!1}if(Xe)return t=Yn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=d,i!==Od&&(e=Error(o(422),{cause:i}),yo(ra(e,r)))):(i!==Od&&(t=Error(o(423),{cause:i}),yo(ra(t,r))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,i=ra(i,r),d=mf(e.stateNode,i,d),$d(e,d),kt!==4&&(kt=2)),!1;var m=Error(o(520),{cause:i});if(m=ra(m,r),Io===null?Io=[m]:Io.push(m),kt!==4&&(kt=2),t===null)return!0;i=ra(i,r),r=t;do{switch(r.tag){case 3:return r.flags|=65536,e=d&-d,r.lanes|=e,e=mf(r.stateNode,i,e),$d(r,e),!1;case 1:if(t=r.type,m=r.stateNode,(r.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Vr===null||!Vr.has(m))))return r.flags|=65536,d&=-d,r.lanes|=d,d=Xv(d),Kv(d,e,r,i),$d(r,d),!1}r=r.return}while(r!==null);return!1}var pf=Error(o(461)),Ht=!1;function dn(e,t,r,i){t.child=e===null?Wg(t,null,r,i):Es(t,e.child,r,i)}function Qv(e,t,r,i,d){r=r.render;var m=t.ref;if("ref"in i){var j={};for(var T in i)T!=="ref"&&(j[T]=i[T])}else j=i;return js(t),i=Kd(e,t,r,j,m,d),T=Qd(),e!==null&&!Ht?(Zd(e,t,d),ar(e,t,d)):(Xe&&T&&Md(t),t.flags|=1,dn(e,t,i,d),t.child)}function Zv(e,t,r,i,d){if(e===null){var m=r.type;return typeof m=="function"&&!Rd(m)&&m.defaultProps===void 0&&r.compare===null?(t.tag=15,t.type=m,Jv(e,t,m,i,d)):(e=Bi(r.type,null,i,t,t.mode,d),e.ref=t.ref,e.return=t,t.child=e)}if(m=e.child,!Sf(e,d)){var j=m.memoizedProps;if(r=r.compare,r=r!==null?r:go,r(j,i)&&e.ref===t.ref)return ar(e,t,d)}return t.flags|=1,e=Za(m,i),e.ref=t.ref,e.return=t,t.child=e}function Jv(e,t,r,i,d){if(e!==null){var m=e.memoizedProps;if(go(m,i)&&e.ref===t.ref)if(Ht=!1,t.pendingProps=i=m,Sf(e,d))(e.flags&131072)!==0&&(Ht=!0);else return t.lanes=e.lanes,ar(e,t,d)}return gf(e,t,r,i,d)}function Wv(e,t,r,i){var d=i.children,m=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((t.flags&128)!==0){if(m=m!==null?m.baseLanes|r:r,e!==null){for(i=t.child=e.child,d=0;i!==null;)d=d|i.lanes|i.childLanes,i=i.sibling;i=d&~m}else i=0,t.child=null;return ex(e,t,m,r,i)}if((r&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Vi(t,m!==null?m.cachePool:null),m!==null?nv(t,m):Yd(),av(t);else return i=t.lanes=536870912,ex(e,t,m!==null?m.baseLanes|r:r,r,i)}else m!==null?(Vi(t,m.cachePool),nv(t,m),Br(),t.memoizedState=null):(e!==null&&Vi(t,null),Yd(),Br());return dn(e,t,d,r),t.child}function Do(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ex(e,t,r,i,d){var m=Pd();return m=m===null?null:{parent:Pt._currentValue,pool:m},t.memoizedState={baseLanes:r,cachePool:m},e!==null&&Vi(t,null),Yd(),av(t),e!==null&&ul(e,t,i,!0),t.childLanes=d,null}function lc(e,t){return t=ic({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function tx(e,t,r){return Es(t,e.child,null,r),e=lc(t,t.pendingProps),e.flags|=2,Gn(t),t.memoizedState=null,e}function pC(e,t,r){var i=t.pendingProps,d=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Xe){if(i.mode==="hidden")return e=lc(t,i),t.lanes=536870912,Do(null,e);if(Fd(t),(e=bt)?(e=hy(e,oa),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Or!==null?{id:Ma,overflow:Da}:null,retryLane:536870912,hydrationErrors:null},r=Ig(e),r.return=t,t.child=r,cn=t,bt=null)):e=null,e===null)throw _r(t);return t.lanes=536870912,null}return lc(t,i)}var m=e.memoizedState;if(m!==null){var j=m.dehydrated;if(Fd(t),d)if(t.flags&256)t.flags&=-257,t=tx(e,t,r);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Ht||ul(e,t,r,!1),d=(r&e.childLanes)!==0,Ht||d){if(i=pt,i!==null&&(j=zt(i,r),j!==0&&j!==m.retryLane))throw m.retryLane=j,xs(e,j),Mn(i,e,j),pf;vc(),t=tx(e,t,r)}else e=m.treeContext,bt=ca(j.nextSibling),cn=t,Xe=!0,kr=null,oa=!1,e!==null&&Hg(t,e),t=lc(t,i),t.flags|=4096;return t}return e=Za(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function oc(e,t){var r=t.ref;if(r===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(o(284));(e===null||e.ref!==r)&&(t.flags|=4194816)}}function gf(e,t,r,i,d){return js(t),r=Kd(e,t,r,i,void 0,d),i=Qd(),e!==null&&!Ht?(Zd(e,t,d),ar(e,t,d)):(Xe&&i&&Md(t),t.flags|=1,dn(e,t,r,d),t.child)}function nx(e,t,r,i,d,m){return js(t),t.updateQueue=null,r=sv(t,i,r,d),rv(e),i=Qd(),e!==null&&!Ht?(Zd(e,t,m),ar(e,t,m)):(Xe&&i&&Md(t),t.flags|=1,dn(e,t,r,m),t.child)}function ax(e,t,r,i,d){if(js(t),t.stateNode===null){var m=ll,j=r.contextType;typeof j=="object"&&j!==null&&(m=un(j)),m=new r(i,m),t.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=hf,t.stateNode=m,m._reactInternals=t,m=t.stateNode,m.props=i,m.state=t.memoizedState,m.refs={},Hd(t),j=r.contextType,m.context=typeof j=="object"&&j!==null?un(j):ll,m.state=t.memoizedState,j=r.getDerivedStateFromProps,typeof j=="function"&&(ff(t,r,j,i),m.state=t.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(j=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),j!==m.state&&hf.enqueueReplaceState(m,m.state,null),Eo(t,i,m,d),No(),m.state=t.memoizedState),typeof m.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){m=t.stateNode;var T=t.memoizedProps,I=Ts(r,T);m.props=I;var K=m.context,re=r.contextType;j=ll,typeof re=="object"&&re!==null&&(j=un(re));var oe=r.getDerivedStateFromProps;re=typeof oe=="function"||typeof m.getSnapshotBeforeUpdate=="function",T=t.pendingProps!==T,re||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(T||K!==j)&&$v(t,m,i,j),Lr=!1;var Q=t.memoizedState;m.state=Q,Eo(t,i,m,d),No(),K=t.memoizedState,T||Q!==K||Lr?(typeof oe=="function"&&(ff(t,r,oe,i),K=t.memoizedState),(I=Lr||qv(t,r,I,i,Q,K,j))?(re||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(t.flags|=4194308)):(typeof m.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=K),m.props=i,m.state=K,m.context=j,i=I):(typeof m.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{m=t.stateNode,qd(e,t),j=t.memoizedProps,re=Ts(r,j),m.props=re,oe=t.pendingProps,Q=m.context,K=r.contextType,I=ll,typeof K=="object"&&K!==null&&(I=un(K)),T=r.getDerivedStateFromProps,(K=typeof T=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(j!==oe||Q!==I)&&$v(t,m,i,I),Lr=!1,Q=t.memoizedState,m.state=Q,Eo(t,i,m,d),No();var W=t.memoizedState;j!==oe||Q!==W||Lr||e!==null&&e.dependencies!==null&&qi(e.dependencies)?(typeof T=="function"&&(ff(t,r,T,i),W=t.memoizedState),(re=Lr||qv(t,r,re,i,Q,W,I)||e!==null&&e.dependencies!==null&&qi(e.dependencies))?(K||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(i,W,I),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(i,W,I)),typeof m.componentDidUpdate=="function"&&(t.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof m.componentDidUpdate!="function"||j===e.memoizedProps&&Q===e.memoizedState||(t.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||j===e.memoizedProps&&Q===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=W),m.props=i,m.state=W,m.context=I,i=re):(typeof m.componentDidUpdate!="function"||j===e.memoizedProps&&Q===e.memoizedState||(t.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||j===e.memoizedProps&&Q===e.memoizedState||(t.flags|=1024),i=!1)}return m=i,oc(e,t),i=(t.flags&128)!==0,m||i?(m=t.stateNode,r=i&&typeof r.getDerivedStateFromError!="function"?null:m.render(),t.flags|=1,e!==null&&i?(t.child=Es(t,e.child,null,d),t.child=Es(t,null,r,d)):dn(e,t,r,d),t.memoizedState=m.state,e=t.child):e=ar(e,t,d),e}function rx(e,t,r,i){return bs(),t.flags|=256,dn(e,t,r,i),t.child}var vf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xf(e){return{baseLanes:e,cachePool:Fg()}}function yf(e,t,r){return e=e!==null?e.childLanes&~r:0,t&&(e|=Xn),e}function sx(e,t,r){var i=t.pendingProps,d=!1,m=(t.flags&128)!==0,j;if((j=m)||(j=e!==null&&e.memoizedState===null?!1:(Lt.current&2)!==0),j&&(d=!0,t.flags&=-129),j=(t.flags&32)!==0,t.flags&=-33,e===null){if(Xe){if(d?Pr(t):Br(),(e=bt)?(e=hy(e,oa),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Or!==null?{id:Ma,overflow:Da}:null,retryLane:536870912,hydrationErrors:null},r=Ig(e),r.return=t,t.child=r,cn=t,bt=null)):e=null,e===null)throw _r(t);return th(e)?t.lanes=32:t.lanes=536870912,null}var T=i.children;return i=i.fallback,d?(Br(),d=t.mode,T=ic({mode:"hidden",children:T},d),i=ys(i,d,r,null),T.return=t,i.return=t,T.sibling=i,t.child=T,i=t.child,i.memoizedState=xf(r),i.childLanes=yf(e,j,r),t.memoizedState=vf,Do(null,i)):(Pr(t),bf(t,T))}var I=e.memoizedState;if(I!==null&&(T=I.dehydrated,T!==null)){if(m)t.flags&256?(Pr(t),t.flags&=-257,t=wf(e,t,r)):t.memoizedState!==null?(Br(),t.child=e.child,t.flags|=128,t=null):(Br(),T=i.fallback,d=t.mode,i=ic({mode:"visible",children:i.children},d),T=ys(T,d,r,null),T.flags|=2,i.return=t,T.return=t,i.sibling=T,t.child=i,Es(t,e.child,null,r),i=t.child,i.memoizedState=xf(r),i.childLanes=yf(e,j,r),t.memoizedState=vf,t=Do(null,i));else if(Pr(t),th(T)){if(j=T.nextSibling&&T.nextSibling.dataset,j)var K=j.dgst;j=K,i=Error(o(419)),i.stack="",i.digest=j,yo({value:i,source:null,stack:null}),t=wf(e,t,r)}else if(Ht||ul(e,t,r,!1),j=(r&e.childLanes)!==0,Ht||j){if(j=pt,j!==null&&(i=zt(j,r),i!==0&&i!==I.retryLane))throw I.retryLane=i,xs(e,i),Mn(j,e,i),pf;eh(T)||vc(),t=wf(e,t,r)}else eh(T)?(t.flags|=192,t.child=e.child,t=null):(e=I.treeContext,bt=ca(T.nextSibling),cn=t,Xe=!0,kr=null,oa=!1,e!==null&&Hg(t,e),t=bf(t,i.children),t.flags|=4096);return t}return d?(Br(),T=i.fallback,d=t.mode,I=e.child,K=I.sibling,i=Za(I,{mode:"hidden",children:i.children}),i.subtreeFlags=I.subtreeFlags&65011712,K!==null?T=Za(K,T):(T=ys(T,d,r,null),T.flags|=2),T.return=t,i.return=t,i.sibling=T,t.child=i,Do(null,i),i=t.child,T=e.child.memoizedState,T===null?T=xf(r):(d=T.cachePool,d!==null?(I=Pt._currentValue,d=d.parent!==I?{parent:I,pool:I}:d):d=Fg(),T={baseLanes:T.baseLanes|r,cachePool:d}),i.memoizedState=T,i.childLanes=yf(e,j,r),t.memoizedState=vf,Do(e.child,i)):(Pr(t),r=e.child,e=r.sibling,r=Za(r,{mode:"visible",children:i.children}),r.return=t,r.sibling=null,e!==null&&(j=t.deletions,j===null?(t.deletions=[e],t.flags|=16):j.push(e)),t.child=r,t.memoizedState=null,r)}function bf(e,t){return t=ic({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ic(e,t){return e=Vn(22,e,null,t),e.lanes=0,e}function wf(e,t,r){return Es(t,e.child,null,r),e=bf(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function lx(e,t,r){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),zd(e.return,t,r)}function jf(e,t,r,i,d,m){var j=e.memoizedState;j===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:d,treeForkCount:m}:(j.isBackwards=t,j.rendering=null,j.renderingStartTime=0,j.last=i,j.tail=r,j.tailMode=d,j.treeForkCount=m)}function ox(e,t,r){var i=t.pendingProps,d=i.revealOrder,m=i.tail;i=i.children;var j=Lt.current,T=(j&2)!==0;if(T?(j=j&1|2,t.flags|=128):j&=1,F(Lt,j),dn(e,t,i,r),i=Xe?xo:0,!T&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&lx(e,r,t);else if(e.tag===19)lx(e,r,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(d){case"forwards":for(r=t.child,d=null;r!==null;)e=r.alternate,e!==null&&Qi(e)===null&&(d=r),r=r.sibling;r=d,r===null?(d=t.child,t.child=null):(d=r.sibling,r.sibling=null),jf(t,!1,d,r,m,i);break;case"backwards":case"unstable_legacy-backwards":for(r=null,d=t.child,t.child=null;d!==null;){if(e=d.alternate,e!==null&&Qi(e)===null){t.child=d;break}e=d.sibling,d.sibling=r,r=d,d=e}jf(t,!0,r,null,m,i);break;case"together":jf(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function ar(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),$r|=t.lanes,(r&t.childLanes)===0)if(e!==null){if(ul(e,t,r,!1),(r&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,r=Za(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Za(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Sf(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&qi(e)))}function gC(e,t,r){switch(t.tag){case 3:ue(t,t.stateNode.containerInfo),zr(t,Pt,e.memoizedState.cache),bs();break;case 27:case 5:xe(t);break;case 4:ue(t,t.stateNode.containerInfo);break;case 10:zr(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Fd(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(Pr(t),t.flags|=128,null):(r&t.child.childLanes)!==0?sx(e,t,r):(Pr(t),e=ar(e,t,r),e!==null?e.sibling:null);Pr(t);break;case 19:var d=(e.flags&128)!==0;if(i=(r&t.childLanes)!==0,i||(ul(e,t,r,!1),i=(r&t.childLanes)!==0),d){if(i)return ox(e,t,r);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),F(Lt,Lt.current),i)break;return null;case 22:return t.lanes=0,Wv(e,t,r,t.pendingProps);case 24:zr(t,Pt,e.memoizedState.cache)}return ar(e,t,r)}function ix(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ht=!0;else{if(!Sf(e,r)&&(t.flags&128)===0)return Ht=!1,gC(e,t,r);Ht=(e.flags&131072)!==0}else Ht=!1,Xe&&(t.flags&1048576)!==0&&Bg(t,xo,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=Cs(t.elementType),t.type=e,typeof e=="function")Rd(e)?(i=Ts(e,i),t.tag=1,t=ax(null,t,e,i,r)):(t.tag=0,t=gf(null,t,e,i,r));else{if(e!=null){var d=e.$$typeof;if(d===M){t.tag=11,t=Qv(null,t,e,i,r);break e}else if(d===_){t.tag=14,t=Zv(null,t,e,i,r);break e}}throw t=ee(e)||e,Error(o(306,t,""))}}return t;case 0:return gf(e,t,t.type,t.pendingProps,r);case 1:return i=t.type,d=Ts(i,t.pendingProps),ax(e,t,i,d,r);case 3:e:{if(ue(t,t.stateNode.containerInfo),e===null)throw Error(o(387));i=t.pendingProps;var m=t.memoizedState;d=m.element,qd(e,t),Eo(t,i,null,r);var j=t.memoizedState;if(i=j.cache,zr(t,Pt,i),i!==m.cache&&Ld(t,[Pt],r,!0),No(),i=j.element,m.isDehydrated)if(m={element:i,isDehydrated:!1,cache:j.cache},t.updateQueue.baseState=m,t.memoizedState=m,t.flags&256){t=rx(e,t,i,r);break e}else if(i!==d){d=ra(Error(o(424)),t),yo(d),t=rx(e,t,i,r);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(bt=ca(e.firstChild),cn=t,Xe=!0,kr=null,oa=!0,r=Wg(t,null,i,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(bs(),i===d){t=ar(e,t,r);break e}dn(e,t,i,r)}t=t.child}return t;case 26:return oc(e,t),e===null?(r=yy(t.type,null,t.pendingProps,null))?t.memoizedState=r:Xe||(r=t.type,e=t.pendingProps,i=Cc(ye.current).createElement(r),i[on]=t,i[Cn]=e,fn(i,r,e),tn(i),t.stateNode=i):t.memoizedState=yy(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return xe(t),e===null&&Xe&&(i=t.stateNode=gy(t.type,t.pendingProps,ye.current),cn=t,oa=!0,d=bt,Xr(t.type)?(nh=d,bt=ca(i.firstChild)):bt=d),dn(e,t,t.pendingProps.children,r),oc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Xe&&((d=i=bt)&&(i=GC(i,t.type,t.pendingProps,oa),i!==null?(t.stateNode=i,cn=t,bt=ca(i.firstChild),oa=!1,d=!0):d=!1),d||_r(t)),xe(t),d=t.type,m=t.pendingProps,j=e!==null?e.memoizedProps:null,i=m.children,Zf(d,m)?i=null:j!==null&&Zf(d,j)&&(t.flags|=32),t.memoizedState!==null&&(d=Kd(e,t,oC,null,null,r),Go._currentValue=d),oc(e,t),dn(e,t,i,r),t.child;case 6:return e===null&&Xe&&((e=r=bt)&&(r=FC(r,t.pendingProps,oa),r!==null?(t.stateNode=r,cn=t,bt=null,e=!0):e=!1),e||_r(t)),null;case 13:return sx(e,t,r);case 4:return ue(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Es(t,null,i,r):dn(e,t,i,r),t.child;case 11:return Qv(e,t,t.type,t.pendingProps,r);case 7:return dn(e,t,t.pendingProps,r),t.child;case 8:return dn(e,t,t.pendingProps.children,r),t.child;case 12:return dn(e,t,t.pendingProps.children,r),t.child;case 10:return i=t.pendingProps,zr(t,t.type,i.value),dn(e,t,i.children,r),t.child;case 9:return d=t.type._context,i=t.pendingProps.children,js(t),d=un(d),i=i(d),t.flags|=1,dn(e,t,i,r),t.child;case 14:return Zv(e,t,t.type,t.pendingProps,r);case 15:return Jv(e,t,t.type,t.pendingProps,r);case 19:return ox(e,t,r);case 31:return pC(e,t,r);case 22:return Wv(e,t,r,t.pendingProps);case 24:return js(t),i=un(Pt),e===null?(d=Pd(),d===null&&(d=pt,m=Ud(),d.pooledCache=m,m.refCount++,m!==null&&(d.pooledCacheLanes|=r),d=m),t.memoizedState={parent:i,cache:d},Hd(t),zr(t,Pt,d)):((e.lanes&r)!==0&&(qd(e,t),Eo(t,null,null,r),No()),d=e.memoizedState,m=t.memoizedState,d.parent!==i?(d={parent:i,cache:i},t.memoizedState=d,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=d),zr(t,Pt,i)):(i=m.cache,zr(t,Pt,i),i!==d.cache&&Ld(t,[Pt],r,!0))),dn(e,t,t.pendingProps.children,r),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function rr(e){e.flags|=4}function Cf(e,t,r,i,d){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(d&335544128)===d)if(e.stateNode.complete)e.flags|=8192;else if(zx())e.flags|=8192;else throw Ns=Gi,Bd}else e.flags&=-16777217}function cx(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Cy(t))if(zx())e.flags|=8192;else throw Ns=Gi,Bd}function cc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ue():536870912,e.lanes|=t,jl|=t)}function Oo(e,t){if(!Xe)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function wt(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,i=0;if(t)for(var d=e.child;d!==null;)r|=d.lanes|d.childLanes,i|=d.subtreeFlags&65011712,i|=d.flags&65011712,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)r|=d.lanes|d.childLanes,i|=d.subtreeFlags,i|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=i,e.childLanes=r,t}function vC(e,t,r){var i=t.pendingProps;switch(Dd(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wt(t),null;case 1:return wt(t),null;case 3:return r=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),er(Pt),he(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(cl(t)?rr(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,kd())),wt(t),null;case 26:var d=t.type,m=t.memoizedState;return e===null?(rr(t),m!==null?(wt(t),cx(t,m)):(wt(t),Cf(t,d,null,i,r))):m?m!==e.memoizedState?(rr(t),wt(t),cx(t,m)):(wt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&rr(t),wt(t),Cf(t,d,e,i,r)),null;case 27:if(Ae(t),r=ye.current,d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&rr(t);else{if(!i){if(t.stateNode===null)throw Error(o(166));return wt(t),null}e=se.current,cl(t)?qg(t):(e=gy(d,i,r),t.stateNode=e,rr(t))}return wt(t),null;case 5:if(Ae(t),d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&rr(t);else{if(!i){if(t.stateNode===null)throw Error(o(166));return wt(t),null}if(m=se.current,cl(t))qg(t);else{var j=Cc(ye.current);switch(m){case 1:m=j.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:m=j.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":m=j.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":m=j.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":m=j.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof i.is=="string"?j.createElement("select",{is:i.is}):j.createElement("select"),i.multiple?m.multiple=!0:i.size&&(m.size=i.size);break;default:m=typeof i.is=="string"?j.createElement(d,{is:i.is}):j.createElement(d)}}m[on]=t,m[Cn]=i;e:for(j=t.child;j!==null;){if(j.tag===5||j.tag===6)m.appendChild(j.stateNode);else if(j.tag!==4&&j.tag!==27&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===t)break e;for(;j.sibling===null;){if(j.return===null||j.return===t)break e;j=j.return}j.sibling.return=j.return,j=j.sibling}t.stateNode=m;e:switch(fn(m,d,i),d){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&rr(t)}}return wt(t),Cf(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,r),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&rr(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(o(166));if(e=ye.current,cl(t)){if(e=t.stateNode,r=t.memoizedProps,i=null,d=cn,d!==null)switch(d.tag){case 27:case 5:i=d.memoizedProps}e[on]=t,e=!!(e.nodeValue===r||i!==null&&i.suppressHydrationWarning===!0||sy(e.nodeValue,r)),e||_r(t,!0)}else e=Cc(e).createTextNode(i),e[on]=t,t.stateNode=e}return wt(t),null;case 31:if(r=t.memoizedState,e===null||e.memoizedState!==null){if(i=cl(t),r!==null){if(e===null){if(!i)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[on]=t}else bs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;wt(t),e=!1}else r=kd(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return t.flags&256?(Gn(t),t):(Gn(t),null);if((t.flags&128)!==0)throw Error(o(558))}return wt(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=cl(t),i!==null&&i.dehydrated!==null){if(e===null){if(!d)throw Error(o(318));if(d=t.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(o(317));d[on]=t}else bs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;wt(t),d=!1}else d=kd(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return t.flags&256?(Gn(t),t):(Gn(t),null)}return Gn(t),(t.flags&128)!==0?(t.lanes=r,t):(r=i!==null,e=e!==null&&e.memoizedState!==null,r&&(i=t.child,d=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(d=i.alternate.memoizedState.cachePool.pool),m=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(m=i.memoizedState.cachePool.pool),m!==d&&(i.flags|=2048)),r!==e&&r&&(t.child.flags|=8192),cc(t,t.updateQueue),wt(t),null);case 4:return he(),e===null&&Gf(t.stateNode.containerInfo),wt(t),null;case 10:return er(t.type),wt(t),null;case 19:if(L(Lt),i=t.memoizedState,i===null)return wt(t),null;if(d=(t.flags&128)!==0,m=i.rendering,m===null)if(d)Oo(i,!1);else{if(kt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(m=Qi(e),m!==null){for(t.flags|=128,Oo(i,!1),e=m.updateQueue,t.updateQueue=e,cc(t,e),t.subtreeFlags=0,e=r,r=t.child;r!==null;)Ug(r,e),r=r.sibling;return F(Lt,Lt.current&1|2),Xe&&Ja(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&Ct()>mc&&(t.flags|=128,d=!0,Oo(i,!1),t.lanes=4194304)}else{if(!d)if(e=Qi(m),e!==null){if(t.flags|=128,d=!0,e=e.updateQueue,t.updateQueue=e,cc(t,e),Oo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!m.alternate&&!Xe)return wt(t),null}else 2*Ct()-i.renderingStartTime>mc&&r!==536870912&&(t.flags|=128,d=!0,Oo(i,!1),t.lanes=4194304);i.isBackwards?(m.sibling=t.child,t.child=m):(e=i.last,e!==null?e.sibling=m:t.child=m,i.last=m)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Ct(),e.sibling=null,r=Lt.current,F(Lt,d?r&1|2:r&1),Xe&&Ja(t,i.treeForkCount),e):(wt(t),null);case 22:case 23:return Gn(t),Gd(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(r&536870912)!==0&&(t.flags&128)===0&&(wt(t),t.subtreeFlags&6&&(t.flags|=8192)):wt(t),r=t.updateQueue,r!==null&&cc(t,r.retryQueue),r=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==r&&(t.flags|=2048),e!==null&&L(Ss),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),er(Pt),wt(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function xC(e,t){switch(Dd(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return er(Pt),he(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ae(t),null;case 31:if(t.memoizedState!==null){if(Gn(t),t.alternate===null)throw Error(o(340));bs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Gn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));bs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return L(Lt),null;case 4:return he(),null;case 10:return er(t.type),null;case 22:case 23:return Gn(t),Gd(),e!==null&&L(Ss),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return er(Pt),null;case 25:return null;default:return null}}function ux(e,t){switch(Dd(t),t.tag){case 3:er(Pt),he();break;case 26:case 27:case 5:Ae(t);break;case 4:he();break;case 31:t.memoizedState!==null&&Gn(t);break;case 13:Gn(t);break;case 19:L(Lt);break;case 10:er(t.type);break;case 22:case 23:Gn(t),Gd(),e!==null&&L(Ss);break;case 24:er(Pt)}}function ko(e,t){try{var r=t.updateQueue,i=r!==null?r.lastEffect:null;if(i!==null){var d=i.next;r=d;do{if((r.tag&e)===e){i=void 0;var m=r.create,j=r.inst;i=m(),j.destroy=i}r=r.next}while(r!==d)}}catch(T){ct(t,t.return,T)}}function Hr(e,t,r){try{var i=t.updateQueue,d=i!==null?i.lastEffect:null;if(d!==null){var m=d.next;i=m;do{if((i.tag&e)===e){var j=i.inst,T=j.destroy;if(T!==void 0){j.destroy=void 0,d=t;var I=r,K=T;try{K()}catch(re){ct(d,I,re)}}}i=i.next}while(i!==m)}}catch(re){ct(t,t.return,re)}}function dx(e){var t=e.updateQueue;if(t!==null){var r=e.stateNode;try{tv(t,r)}catch(i){ct(e,e.return,i)}}}function fx(e,t,r){r.props=Ts(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(i){ct(e,t,i)}}function _o(e,t){try{var r=e.ref;if(r!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof r=="function"?e.refCleanup=r(i):r.current=i}}catch(d){ct(e,t,d)}}function Oa(e,t){var r=e.ref,i=e.refCleanup;if(r!==null)if(typeof i=="function")try{i()}catch(d){ct(e,t,d)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(d){ct(e,t,d)}else r.current=null}function hx(e){var t=e.type,r=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":r.autoFocus&&i.focus();break e;case"img":r.src?i.src=r.src:r.srcSet&&(i.srcset=r.srcSet)}}catch(d){ct(e,e.return,d)}}function Nf(e,t,r){try{var i=e.stateNode;BC(i,e.type,r,t),i[Cn]=t}catch(d){ct(e,e.return,d)}}function mx(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Xr(e.type)||e.tag===4}function Ef(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||mx(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&&Xr(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 Rf(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(e,t):(t=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,t.appendChild(e),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Ka));else if(i!==4&&(i===27&&Xr(e.type)&&(r=e.stateNode,t=null),e=e.child,e!==null))for(Rf(e,t,r),e=e.sibling;e!==null;)Rf(e,t,r),e=e.sibling}function uc(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(i!==4&&(i===27&&Xr(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(uc(e,t,r),e=e.sibling;e!==null;)uc(e,t,r),e=e.sibling}function px(e){var t=e.stateNode,r=e.memoizedProps;try{for(var i=e.type,d=t.attributes;d.length;)t.removeAttributeNode(d[0]);fn(t,i,r),t[on]=e,t[Cn]=r}catch(m){ct(e,e.return,m)}}var sr=!1,qt=!1,Tf=!1,gx=typeof WeakSet=="function"?WeakSet:Set,nn=null;function yC(e,t){if(e=e.containerInfo,Kf=Dc,e=Tg(e),bd(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var d=i.anchorOffset,m=i.focusNode;i=i.focusOffset;try{r.nodeType,m.nodeType}catch{r=null;break e}var j=0,T=-1,I=-1,K=0,re=0,oe=e,Q=null;t:for(;;){for(var W;oe!==r||d!==0&&oe.nodeType!==3||(T=j+d),oe!==m||i!==0&&oe.nodeType!==3||(I=j+i),oe.nodeType===3&&(j+=oe.nodeValue.length),(W=oe.firstChild)!==null;)Q=oe,oe=W;for(;;){if(oe===e)break t;if(Q===r&&++K===d&&(T=j),Q===m&&++re===i&&(I=j),(W=oe.nextSibling)!==null)break;oe=Q,Q=oe.parentNode}oe=W}r=T===-1||I===-1?null:{start:T,end:I}}else r=null}r=r||{start:0,end:0}}else r=null;for(Qf={focusedElem:e,selectionRange:r},Dc=!1,nn=t;nn!==null;)if(t=nn,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,nn=e;else for(;nn!==null;){switch(t=nn,m=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(r=0;r<e.length;r++)d=e[r],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&m!==null){e=void 0,r=t,d=m.memoizedProps,m=m.memoizedState,i=r.stateNode;try{var we=Ts(r.type,d);e=i.getSnapshotBeforeUpdate(we,m),i.__reactInternalSnapshotBeforeUpdate=e}catch(De){ct(r,r.return,De)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,r=e.nodeType,r===9)Wf(e);else if(r===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Wf(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(o(163))}if(e=t.sibling,e!==null){e.return=t.return,nn=e;break}nn=t.return}}function vx(e,t,r){var i=r.flags;switch(r.tag){case 0:case 11:case 15:or(e,r),i&4&&ko(5,r);break;case 1:if(or(e,r),i&4)if(e=r.stateNode,t===null)try{e.componentDidMount()}catch(j){ct(r,r.return,j)}else{var d=Ts(r.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(d,t,e.__reactInternalSnapshotBeforeUpdate)}catch(j){ct(r,r.return,j)}}i&64&&dx(r),i&512&&_o(r,r.return);break;case 3:if(or(e,r),i&64&&(e=r.updateQueue,e!==null)){if(t=null,r.child!==null)switch(r.child.tag){case 27:case 5:t=r.child.stateNode;break;case 1:t=r.child.stateNode}try{tv(e,t)}catch(j){ct(r,r.return,j)}}break;case 27:t===null&&i&4&&px(r);case 26:case 5:or(e,r),t===null&&i&4&&hx(r),i&512&&_o(r,r.return);break;case 12:or(e,r);break;case 31:or(e,r),i&4&&bx(e,r);break;case 13:or(e,r),i&4&&wx(e,r),i&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=TC.bind(null,r),XC(e,r))));break;case 22:if(i=r.memoizedState!==null||sr,!i){t=t!==null&&t.memoizedState!==null||qt,d=sr;var m=qt;sr=i,(qt=t)&&!m?ir(e,r,(r.subtreeFlags&8772)!==0):or(e,r),sr=d,qt=m}break;case 30:break;default:or(e,r)}}function xx(e){var t=e.alternate;t!==null&&(e.alternate=null,xx(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ad(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 Et=null,En=!1;function lr(e,t,r){for(r=r.child;r!==null;)yx(e,t,r),r=r.sibling}function yx(e,t,r){if(Dt&&typeof Dt.onCommitFiberUnmount=="function")try{Dt.onCommitFiberUnmount(ga,r)}catch{}switch(r.tag){case 26:qt||Oa(r,t),lr(e,t,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:qt||Oa(r,t);var i=Et,d=En;Xr(r.type)&&(Et=r.stateNode,En=!1),lr(e,t,r),$o(r.stateNode),Et=i,En=d;break;case 5:qt||Oa(r,t);case 6:if(i=Et,d=En,Et=null,lr(e,t,r),Et=i,En=d,Et!==null)if(En)try{(Et.nodeType===9?Et.body:Et.nodeName==="HTML"?Et.ownerDocument.body:Et).removeChild(r.stateNode)}catch(m){ct(r,t,m)}else try{Et.removeChild(r.stateNode)}catch(m){ct(r,t,m)}break;case 18:Et!==null&&(En?(e=Et,dy(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,r.stateNode),Ml(e)):dy(Et,r.stateNode));break;case 4:i=Et,d=En,Et=r.stateNode.containerInfo,En=!0,lr(e,t,r),Et=i,En=d;break;case 0:case 11:case 14:case 15:Hr(2,r,t),qt||Hr(4,r,t),lr(e,t,r);break;case 1:qt||(Oa(r,t),i=r.stateNode,typeof i.componentWillUnmount=="function"&&fx(r,t,i)),lr(e,t,r);break;case 21:lr(e,t,r);break;case 22:qt=(i=qt)||r.memoizedState!==null,lr(e,t,r),qt=i;break;default:lr(e,t,r)}}function bx(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ml(e)}catch(r){ct(t,t.return,r)}}}function wx(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ml(e)}catch(r){ct(t,t.return,r)}}function bC(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new gx),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new gx),t;default:throw Error(o(435,e.tag))}}function dc(e,t){var r=bC(e);t.forEach(function(i){if(!r.has(i)){r.add(i);var d=AC.bind(null,e,i);i.then(d,d)}})}function Rn(e,t){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var d=r[i],m=e,j=t,T=j;e:for(;T!==null;){switch(T.tag){case 27:if(Xr(T.type)){Et=T.stateNode,En=!1;break e}break;case 5:Et=T.stateNode,En=!1;break e;case 3:case 4:Et=T.stateNode.containerInfo,En=!0;break e}T=T.return}if(Et===null)throw Error(o(160));yx(m,j,d),Et=null,En=!1,m=d.alternate,m!==null&&(m.return=null),d.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)jx(t,e),t=t.sibling}var ya=null;function jx(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Rn(t,e),Tn(e),i&4&&(Hr(3,e,e.return),ko(3,e),Hr(5,e,e.return));break;case 1:Rn(t,e),Tn(e),i&512&&(qt||r===null||Oa(r,r.return)),i&64&&sr&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(r=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=r===null?i:r.concat(i))));break;case 26:var d=ya;if(Rn(t,e),Tn(e),i&512&&(qt||r===null||Oa(r,r.return)),i&4){var m=r!==null?r.memoizedState:null;if(i=e.memoizedState,r===null)if(i===null)if(e.stateNode===null){e:{i=e.type,r=e.memoizedProps,d=d.ownerDocument||d;t:switch(i){case"title":m=d.getElementsByTagName("title")[0],(!m||m[lo]||m[on]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=d.createElement(i),d.head.insertBefore(m,d.querySelector("head > title"))),fn(m,i,r),m[on]=e,tn(m),i=m;break e;case"link":var j=jy("link","href",d).get(i+(r.href||""));if(j){for(var T=0;T<j.length;T++)if(m=j[T],m.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&m.getAttribute("rel")===(r.rel==null?null:r.rel)&&m.getAttribute("title")===(r.title==null?null:r.title)&&m.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){j.splice(T,1);break t}}m=d.createElement(i),fn(m,i,r),d.head.appendChild(m);break;case"meta":if(j=jy("meta","content",d).get(i+(r.content||""))){for(T=0;T<j.length;T++)if(m=j[T],m.getAttribute("content")===(r.content==null?null:""+r.content)&&m.getAttribute("name")===(r.name==null?null:r.name)&&m.getAttribute("property")===(r.property==null?null:r.property)&&m.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&m.getAttribute("charset")===(r.charSet==null?null:r.charSet)){j.splice(T,1);break t}}m=d.createElement(i),fn(m,i,r),d.head.appendChild(m);break;default:throw Error(o(468,i))}m[on]=e,tn(m),i=m}e.stateNode=i}else Sy(d,e.type,e.stateNode);else e.stateNode=wy(d,i,e.memoizedProps);else m!==i?(m===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):m.count--,i===null?Sy(d,e.type,e.stateNode):wy(d,i,e.memoizedProps)):i===null&&e.stateNode!==null&&Nf(e,e.memoizedProps,r.memoizedProps)}break;case 27:Rn(t,e),Tn(e),i&512&&(qt||r===null||Oa(r,r.return)),r!==null&&i&4&&Nf(e,e.memoizedProps,r.memoizedProps);break;case 5:if(Rn(t,e),Tn(e),i&512&&(qt||r===null||Oa(r,r.return)),e.flags&32){d=e.stateNode;try{Ws(d,"")}catch(we){ct(e,e.return,we)}}i&4&&e.stateNode!=null&&(d=e.memoizedProps,Nf(e,d,r!==null?r.memoizedProps:d)),i&1024&&(Tf=!0);break;case 6:if(Rn(t,e),Tn(e),i&4){if(e.stateNode===null)throw Error(o(162));i=e.memoizedProps,r=e.stateNode;try{r.nodeValue=i}catch(we){ct(e,e.return,we)}}break;case 3:if(Rc=null,d=ya,ya=Nc(t.containerInfo),Rn(t,e),ya=d,Tn(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Ml(t.containerInfo)}catch(we){ct(e,e.return,we)}Tf&&(Tf=!1,Sx(e));break;case 4:i=ya,ya=Nc(e.stateNode.containerInfo),Rn(t,e),Tn(e),ya=i;break;case 12:Rn(t,e),Tn(e);break;case 31:Rn(t,e),Tn(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,dc(e,i)));break;case 13:Rn(t,e),Tn(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(hc=Ct()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,dc(e,i)));break;case 22:d=e.memoizedState!==null;var I=r!==null&&r.memoizedState!==null,K=sr,re=qt;if(sr=K||d,qt=re||I,Rn(t,e),qt=re,sr=K,Tn(e),i&8192)e:for(t=e.stateNode,t._visibility=d?t._visibility&-2:t._visibility|1,d&&(r===null||I||sr||qt||As(e)),r=null,t=e;;){if(t.tag===5||t.tag===26){if(r===null){I=r=t;try{if(m=I.stateNode,d)j=m.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none";else{T=I.stateNode;var oe=I.memoizedProps.style,Q=oe!=null&&oe.hasOwnProperty("display")?oe.display:null;T.style.display=Q==null||typeof Q=="boolean"?"":(""+Q).trim()}}catch(we){ct(I,I.return,we)}}}else if(t.tag===6){if(r===null){I=t;try{I.stateNode.nodeValue=d?"":I.memoizedProps}catch(we){ct(I,I.return,we)}}}else if(t.tag===18){if(r===null){I=t;try{var W=I.stateNode;d?fy(W,!0):fy(I.stateNode,!1)}catch(we){ct(I,I.return,we)}}}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;r===t&&(r=null),t=t.return}r===t&&(r=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(r=i.retryQueue,r!==null&&(i.retryQueue=null,dc(e,r))));break;case 19:Rn(t,e),Tn(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,dc(e,i)));break;case 30:break;case 21:break;default:Rn(t,e),Tn(e)}}function Tn(e){var t=e.flags;if(t&2){try{for(var r,i=e.return;i!==null;){if(mx(i)){r=i;break}i=i.return}if(r==null)throw Error(o(160));switch(r.tag){case 27:var d=r.stateNode,m=Ef(e);uc(e,m,d);break;case 5:var j=r.stateNode;r.flags&32&&(Ws(j,""),r.flags&=-33);var T=Ef(e);uc(e,T,j);break;case 3:case 4:var I=r.stateNode.containerInfo,K=Ef(e);Rf(e,K,I);break;default:throw Error(o(161))}}catch(re){ct(e,e.return,re)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Sx(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Sx(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function or(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)vx(e,t.alternate,t),t=t.sibling}function As(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Hr(4,t,t.return),As(t);break;case 1:Oa(t,t.return);var r=t.stateNode;typeof r.componentWillUnmount=="function"&&fx(t,t.return,r),As(t);break;case 27:$o(t.stateNode);case 26:case 5:Oa(t,t.return),As(t);break;case 22:t.memoizedState===null&&As(t);break;case 30:As(t);break;default:As(t)}e=e.sibling}}function ir(e,t,r){for(r=r&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,d=e,m=t,j=m.flags;switch(m.tag){case 0:case 11:case 15:ir(d,m,r),ko(4,m);break;case 1:if(ir(d,m,r),i=m,d=i.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(K){ct(i,i.return,K)}if(i=m,d=i.updateQueue,d!==null){var T=i.stateNode;try{var I=d.shared.hiddenCallbacks;if(I!==null)for(d.shared.hiddenCallbacks=null,d=0;d<I.length;d++)ev(I[d],T)}catch(K){ct(i,i.return,K)}}r&&j&64&&dx(m),_o(m,m.return);break;case 27:px(m);case 26:case 5:ir(d,m,r),r&&i===null&&j&4&&hx(m),_o(m,m.return);break;case 12:ir(d,m,r);break;case 31:ir(d,m,r),r&&j&4&&bx(d,m);break;case 13:ir(d,m,r),r&&j&4&&wx(d,m);break;case 22:m.memoizedState===null&&ir(d,m,r),_o(m,m.return);break;case 30:break;default:ir(d,m,r)}t=t.sibling}}function Af(e,t){var r=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==r&&(e!=null&&e.refCount++,r!=null&&bo(r))}function Mf(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&bo(e))}function ba(e,t,r,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Cx(e,t,r,i),t=t.sibling}function Cx(e,t,r,i){var d=t.flags;switch(t.tag){case 0:case 11:case 15:ba(e,t,r,i),d&2048&&ko(9,t);break;case 1:ba(e,t,r,i);break;case 3:ba(e,t,r,i),d&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&bo(e)));break;case 12:if(d&2048){ba(e,t,r,i),e=t.stateNode;try{var m=t.memoizedProps,j=m.id,T=m.onPostCommit;typeof T=="function"&&T(j,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(I){ct(t,t.return,I)}}else ba(e,t,r,i);break;case 31:ba(e,t,r,i);break;case 13:ba(e,t,r,i);break;case 23:break;case 22:m=t.stateNode,j=t.alternate,t.memoizedState!==null?m._visibility&2?ba(e,t,r,i):zo(e,t):m._visibility&2?ba(e,t,r,i):(m._visibility|=2,yl(e,t,r,i,(t.subtreeFlags&10256)!==0||!1)),d&2048&&Af(j,t);break;case 24:ba(e,t,r,i),d&2048&&Mf(t.alternate,t);break;default:ba(e,t,r,i)}}function yl(e,t,r,i,d){for(d=d&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var m=e,j=t,T=r,I=i,K=j.flags;switch(j.tag){case 0:case 11:case 15:yl(m,j,T,I,d),ko(8,j);break;case 23:break;case 22:var re=j.stateNode;j.memoizedState!==null?re._visibility&2?yl(m,j,T,I,d):zo(m,j):(re._visibility|=2,yl(m,j,T,I,d)),d&&K&2048&&Af(j.alternate,j);break;case 24:yl(m,j,T,I,d),d&&K&2048&&Mf(j.alternate,j);break;default:yl(m,j,T,I,d)}t=t.sibling}}function zo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var r=e,i=t,d=i.flags;switch(i.tag){case 22:zo(r,i),d&2048&&Af(i.alternate,i);break;case 24:zo(r,i),d&2048&&Mf(i.alternate,i);break;default:zo(r,i)}t=t.sibling}}var Lo=8192;function bl(e,t,r){if(e.subtreeFlags&Lo)for(e=e.child;e!==null;)Nx(e,t,r),e=e.sibling}function Nx(e,t,r){switch(e.tag){case 26:bl(e,t,r),e.flags&Lo&&e.memoizedState!==null&&l2(r,ya,e.memoizedState,e.memoizedProps);break;case 5:bl(e,t,r);break;case 3:case 4:var i=ya;ya=Nc(e.stateNode.containerInfo),bl(e,t,r),ya=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=Lo,Lo=16777216,bl(e,t,r),Lo=i):bl(e,t,r));break;default:bl(e,t,r)}}function Ex(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 Uo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var r=0;r<t.length;r++){var i=t[r];nn=i,Tx(i,e)}Ex(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Rx(e),e=e.sibling}function Rx(e){switch(e.tag){case 0:case 11:case 15:Uo(e),e.flags&2048&&Hr(9,e,e.return);break;case 3:Uo(e);break;case 12:Uo(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,fc(e)):Uo(e);break;default:Uo(e)}}function fc(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var r=0;r<t.length;r++){var i=t[r];nn=i,Tx(i,e)}Ex(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Hr(8,t,t.return),fc(t);break;case 22:r=t.stateNode,r._visibility&2&&(r._visibility&=-3,fc(t));break;default:fc(t)}e=e.sibling}}function Tx(e,t){for(;nn!==null;){var r=nn;switch(r.tag){case 0:case 11:case 15:Hr(8,r,t);break;case 23:case 22:if(r.memoizedState!==null&&r.memoizedState.cachePool!==null){var i=r.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:bo(r.memoizedState.cache)}if(i=r.child,i!==null)i.return=r,nn=i;else e:for(r=e;nn!==null;){i=nn;var d=i.sibling,m=i.return;if(xx(i),i===r){nn=null;break e}if(d!==null){d.return=m,nn=d;break e}nn=m}}}var wC={getCacheForType:function(e){var t=un(Pt),r=t.data.get(e);return r===void 0&&(r=e(),t.data.set(e,r)),r},cacheSignal:function(){return un(Pt).controller.signal}},jC=typeof WeakMap=="function"?WeakMap:Map,tt=0,pt=null,$e=null,Ye=0,it=0,Fn=null,qr=!1,wl=!1,Df=!1,cr=0,kt=0,$r=0,Ms=0,Of=0,Xn=0,jl=0,Io=null,An=null,kf=!1,hc=0,Ax=0,mc=1/0,pc=null,Vr=null,Gt=0,Yr=null,Sl=null,ur=0,_f=0,zf=null,Mx=null,Po=0,Lf=null;function Kn(){return(tt&2)!==0&&Ye!==0?Ye&-Ye:k.T!==null?qf():va()}function Dx(){if(Xn===0)if((Ye&536870912)===0||Xe){var e=Ar;Ar<<=1,(Ar&3932160)===0&&(Ar=262144),Xn=e}else Xn=536870912;return e=Yn.current,e!==null&&(e.flags|=32),Xn}function Mn(e,t,r){(e===pt&&(it===2||it===9)||e.cancelPendingCommit!==null)&&(Cl(e,0),Gr(e,Ye,Xn,!1)),Nt(e,r),((tt&2)===0||e!==pt)&&(e===pt&&((tt&2)===0&&(Ms|=r),kt===4&&Gr(e,Ye,Xn,!1)),ka(e))}function Ox(e,t,r){if((tt&6)!==0)throw Error(o(327));var i=!r&&(t&127)===0&&(t&e.expiredLanes)===0||Ee(e,t),d=i?NC(e,t):If(e,t,!0),m=i;do{if(d===0){wl&&!i&&Gr(e,t,0,!1);break}else{if(r=e.current.alternate,m&&!SC(r)){d=If(e,t,!1),m=!1;continue}if(d===2){if(m=t,e.errorRecoveryDisabledLanes&m)var j=0;else j=e.pendingLanes&-536870913,j=j!==0?j:j&536870912?536870912:0;if(j!==0){t=j;e:{var T=e;d=Io;var I=T.current.memoizedState.isDehydrated;if(I&&(Cl(T,j).flags|=256),j=If(T,j,!1),j!==2){if(Df&&!I){T.errorRecoveryDisabledLanes|=m,Ms|=m,d=4;break e}m=An,An=d,m!==null&&(An===null?An=m:An.push.apply(An,m))}d=j}if(m=!1,d!==2)continue}}if(d===1){Cl(e,0),Gr(e,t,0,!0);break}e:{switch(i=e,m=d,m){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:Gr(i,t,Xn,!qr);break e;case 2:An=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(d=hc+300-Ct(),10<d)){if(Gr(i,t,Xn,!qr),It(i,0,!0)!==0)break e;ur=t,i.timeoutHandle=cy(kx.bind(null,i,r,An,pc,kf,t,Xn,Ms,jl,qr,m,"Throttled",-0,0),d);break e}kx(i,r,An,pc,kf,t,Xn,Ms,jl,qr,m,null,-0,0)}}break}while(!0);ka(e)}function kx(e,t,r,i,d,m,j,T,I,K,re,oe,Q,W){if(e.timeoutHandle=-1,oe=t.subtreeFlags,oe&8192||(oe&16785408)===16785408){oe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ka},Nx(t,m,oe);var we=(m&62914560)===m?hc-Ct():(m&4194048)===m?Ax-Ct():0;if(we=o2(oe,we),we!==null){ur=m,e.cancelPendingCommit=we(Hx.bind(null,e,t,m,r,i,d,j,T,I,re,oe,null,Q,W)),Gr(e,m,j,!K);return}}Hx(e,t,m,r,i,d,j,T,I)}function SC(e){for(var t=e;;){var r=t.tag;if((r===0||r===11||r===15)&&t.flags&16384&&(r=t.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var i=0;i<r.length;i++){var d=r[i],m=d.getSnapshot;d=d.value;try{if(!$n(m(),d))return!1}catch{return!1}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;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 Gr(e,t,r,i){t&=~Of,t&=~Ms,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var d=t;0<d;){var m=31-Tt(d),j=1<<m;i[m]=-1,d&=~j}r!==0&&Yt(e,r,t)}function gc(){return(tt&6)===0?(Bo(0),!1):!0}function Uf(){if($e!==null){if(it===0)var e=$e.return;else e=$e,Wa=ws=null,Jd(e),ml=null,jo=0,e=$e;for(;e!==null;)ux(e.alternate,e),e=e.return;$e=null}}function Cl(e,t){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,$C(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),ur=0,Uf(),pt=e,$e=r=Za(e.current,null),Ye=t,it=0,Fn=null,qr=!1,wl=Ee(e,t),Df=!1,jl=Xn=Of=Ms=$r=kt=0,An=Io=null,kf=!1,(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var d=31-Tt(i),m=1<<d;t|=e[d],i&=~m}return cr=t,Ui(),r}function _x(e,t){ze=null,k.H=Mo,t===hl||t===Yi?(t=Qg(),it=3):t===Bd?(t=Qg(),it=4):it=t===pf?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Fn=t,$e===null&&(kt=1,sc(e,ra(t,e.current)))}function zx(){var e=Yn.current;return e===null?!0:(Ye&4194048)===Ye?ia===null:(Ye&62914560)===Ye||(Ye&536870912)!==0?e===ia:!1}function Lx(){var e=k.H;return k.H=Mo,e===null?Mo:e}function Ux(){var e=k.A;return k.A=wC,e}function vc(){kt=4,qr||(Ye&4194048)!==Ye&&Yn.current!==null||(wl=!0),($r&134217727)===0&&(Ms&134217727)===0||pt===null||Gr(pt,Ye,Xn,!1)}function If(e,t,r){var i=tt;tt|=2;var d=Lx(),m=Ux();(pt!==e||Ye!==t)&&(pc=null,Cl(e,t)),t=!1;var j=kt;e:do try{if(it!==0&&$e!==null){var T=$e,I=Fn;switch(it){case 8:Uf(),j=6;break e;case 3:case 2:case 9:case 6:Yn.current===null&&(t=!0);var K=it;if(it=0,Fn=null,Nl(e,T,I,K),r&&wl){j=0;break e}break;default:K=it,it=0,Fn=null,Nl(e,T,I,K)}}CC(),j=kt;break}catch(re){_x(e,re)}while(!0);return t&&e.shellSuspendCounter++,Wa=ws=null,tt=i,k.H=d,k.A=m,$e===null&&(pt=null,Ye=0,Ui()),j}function CC(){for(;$e!==null;)Ix($e)}function NC(e,t){var r=tt;tt|=2;var i=Lx(),d=Ux();pt!==e||Ye!==t?(pc=null,mc=Ct()+500,Cl(e,t)):wl=Ee(e,t);e:do try{if(it!==0&&$e!==null){t=$e;var m=Fn;t:switch(it){case 1:it=0,Fn=null,Nl(e,t,m,1);break;case 2:case 9:if(Xg(m)){it=0,Fn=null,Px(t);break}t=function(){it!==2&&it!==9||pt!==e||(it=7),ka(e)},m.then(t,t);break e;case 3:it=7;break e;case 4:it=5;break e;case 7:Xg(m)?(it=0,Fn=null,Px(t)):(it=0,Fn=null,Nl(e,t,m,7));break;case 5:var j=null;switch($e.tag){case 26:j=$e.memoizedState;case 5:case 27:var T=$e;if(j?Cy(j):T.stateNode.complete){it=0,Fn=null;var I=T.sibling;if(I!==null)$e=I;else{var K=T.return;K!==null?($e=K,xc(K)):$e=null}break t}}it=0,Fn=null,Nl(e,t,m,5);break;case 6:it=0,Fn=null,Nl(e,t,m,6);break;case 8:Uf(),kt=6;break e;default:throw Error(o(462))}}EC();break}catch(re){_x(e,re)}while(!0);return Wa=ws=null,k.H=i,k.A=d,tt=r,$e!==null?0:(pt=null,Ye=0,Ui(),kt)}function EC(){for(;$e!==null&&!mn();)Ix($e)}function Ix(e){var t=ix(e.alternate,e,cr);e.memoizedProps=e.pendingProps,t===null?xc(e):$e=t}function Px(e){var t=e,r=t.alternate;switch(t.tag){case 15:case 0:t=nx(r,t,t.pendingProps,t.type,void 0,Ye);break;case 11:t=nx(r,t,t.pendingProps,t.type.render,t.ref,Ye);break;case 5:Jd(t);default:ux(r,t),t=$e=Ug(t,cr),t=ix(r,t,cr)}e.memoizedProps=e.pendingProps,t===null?xc(e):$e=t}function Nl(e,t,r,i){Wa=ws=null,Jd(t),ml=null,jo=0;var d=t.return;try{if(mC(e,d,t,r,Ye)){kt=1,sc(e,ra(r,e.current)),$e=null;return}}catch(m){if(d!==null)throw $e=d,m;kt=1,sc(e,ra(r,e.current)),$e=null;return}t.flags&32768?(Xe||i===1?e=!0:wl||(Ye&536870912)!==0?e=!1:(qr=e=!0,(i===2||i===9||i===3||i===6)&&(i=Yn.current,i!==null&&i.tag===13&&(i.flags|=16384))),Bx(t,e)):xc(t)}function xc(e){var t=e;do{if((t.flags&32768)!==0){Bx(t,qr);return}e=t.return;var r=vC(t.alternate,t,cr);if(r!==null){$e=r;return}if(t=t.sibling,t!==null){$e=t;return}$e=t=e}while(t!==null);kt===0&&(kt=5)}function Bx(e,t){do{var r=xC(e.alternate,e);if(r!==null){r.flags&=32767,$e=r;return}if(r=e.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!t&&(e=e.sibling,e!==null)){$e=e;return}$e=e=r}while(e!==null);kt=6,$e=null}function Hx(e,t,r,i,d,m,j,T,I){e.cancelPendingCommit=null;do yc();while(Gt!==0);if((tt&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(m=t.lanes|t.childLanes,m|=Nd,ut(e,r,m,j,T,I),e===pt&&($e=pt=null,Ye=0),Sl=t,Yr=e,ur=r,_f=m,zf=d,Mx=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,MC(pn,function(){return Gx(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=k.T,k.T=null,d=q.p,q.p=2,j=tt,tt|=4;try{yC(e,t,r)}finally{tt=j,q.p=d,k.T=i}}Gt=1,qx(),$x(),Vx()}}function qx(){if(Gt===1){Gt=0;var e=Yr,t=Sl,r=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||r){r=k.T,k.T=null;var i=q.p;q.p=2;var d=tt;tt|=4;try{jx(t,e);var m=Qf,j=Tg(e.containerInfo),T=m.focusedElem,I=m.selectionRange;if(j!==T&&T&&T.ownerDocument&&Rg(T.ownerDocument.documentElement,T)){if(I!==null&&bd(T)){var K=I.start,re=I.end;if(re===void 0&&(re=K),"selectionStart"in T)T.selectionStart=K,T.selectionEnd=Math.min(re,T.value.length);else{var oe=T.ownerDocument||document,Q=oe&&oe.defaultView||window;if(Q.getSelection){var W=Q.getSelection(),we=T.textContent.length,De=Math.min(I.start,we),ht=I.end===void 0?De:Math.min(I.end,we);!W.extend&&De>ht&&(j=ht,ht=De,De=j);var Y=Eg(T,De),P=Eg(T,ht);if(Y&&P&&(W.rangeCount!==1||W.anchorNode!==Y.node||W.anchorOffset!==Y.offset||W.focusNode!==P.node||W.focusOffset!==P.offset)){var X=oe.createRange();X.setStart(Y.node,Y.offset),W.removeAllRanges(),De>ht?(W.addRange(X),W.extend(P.node,P.offset)):(X.setEnd(P.node,P.offset),W.addRange(X))}}}}for(oe=[],W=T;W=W.parentNode;)W.nodeType===1&&oe.push({element:W,left:W.scrollLeft,top:W.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<oe.length;T++){var le=oe[T];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}Dc=!!Kf,Qf=Kf=null}finally{tt=d,q.p=i,k.T=r}}e.current=t,Gt=2}}function $x(){if(Gt===2){Gt=0;var e=Yr,t=Sl,r=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||r){r=k.T,k.T=null;var i=q.p;q.p=2;var d=tt;tt|=4;try{vx(e,t.alternate,t)}finally{tt=d,q.p=i,k.T=r}}Gt=3}}function Vx(){if(Gt===4||Gt===3){Gt=0,en();var e=Yr,t=Sl,r=ur,i=Mx;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Gt=5:(Gt=0,Sl=Yr=null,Yx(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(Vr=null),Fa(r),t=t.stateNode,Dt&&typeof Dt.onCommitFiberRoot=="function")try{Dt.onCommitFiberRoot(ga,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=k.T,d=q.p,q.p=2,k.T=null;try{for(var m=e.onRecoverableError,j=0;j<i.length;j++){var T=i[j];m(T.value,{componentStack:T.stack})}}finally{k.T=t,q.p=d}}(ur&3)!==0&&yc(),ka(e),d=e.pendingLanes,(r&261930)!==0&&(d&42)!==0?e===Lf?Po++:(Po=0,Lf=e):Po=0,Bo(0)}}function Yx(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,bo(t)))}function yc(){return qx(),$x(),Vx(),Gx()}function Gx(){if(Gt!==5)return!1;var e=Yr,t=_f;_f=0;var r=Fa(ur),i=k.T,d=q.p;try{q.p=32>r?32:r,k.T=null,r=zf,zf=null;var m=Yr,j=ur;if(Gt=0,Sl=Yr=null,ur=0,(tt&6)!==0)throw Error(o(331));var T=tt;if(tt|=4,Rx(m.current),Cx(m,m.current,j,r),tt=T,Bo(0,!1),Dt&&typeof Dt.onPostCommitFiberRoot=="function")try{Dt.onPostCommitFiberRoot(ga,m)}catch{}return!0}finally{q.p=d,k.T=i,Yx(e,t)}}function Fx(e,t,r){t=ra(r,t),t=mf(e.stateNode,t,2),e=Ir(e,t,2),e!==null&&(Nt(e,2),ka(e))}function ct(e,t,r){if(e.tag===3)Fx(e,e,r);else for(;t!==null;){if(t.tag===3){Fx(t,e,r);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Vr===null||!Vr.has(i))){e=ra(r,e),r=Xv(2),i=Ir(t,r,2),i!==null&&(Kv(r,i,t,e),Nt(i,2),ka(i));break}}t=t.return}}function Pf(e,t,r){var i=e.pingCache;if(i===null){i=e.pingCache=new jC;var d=new Set;i.set(t,d)}else d=i.get(t),d===void 0&&(d=new Set,i.set(t,d));d.has(r)||(Df=!0,d.add(r),e=RC.bind(null,e,t,r),t.then(e,e))}function RC(e,t,r){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,pt===e&&(Ye&r)===r&&(kt===4||kt===3&&(Ye&62914560)===Ye&&300>Ct()-hc?(tt&2)===0&&Cl(e,0):Of|=r,jl===Ye&&(jl=0)),ka(e)}function Xx(e,t){t===0&&(t=Ue()),e=xs(e,t),e!==null&&(Nt(e,t),ka(e))}function TC(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Xx(e,r)}function AC(e,t){var r=0;switch(e.tag){case 31:case 13:var i=e.stateNode,d=e.memoizedState;d!==null&&(r=d.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(o(314))}i!==null&&i.delete(t),Xx(e,r)}function MC(e,t){return St(e,t)}var bc=null,El=null,Bf=!1,wc=!1,Hf=!1,Fr=0;function ka(e){e!==El&&e.next===null&&(El===null?bc=El=e:El=El.next=e),wc=!0,Bf||(Bf=!0,OC())}function Bo(e,t){if(!Hf&&wc){Hf=!0;do for(var r=!1,i=bc;i!==null;){if(e!==0){var d=i.pendingLanes;if(d===0)var m=0;else{var j=i.suspendedLanes,T=i.pingedLanes;m=(1<<31-Tt(42|e)+1)-1,m&=d&~(j&~T),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(r=!0,Jx(i,m))}else m=Ye,m=It(i,i===pt?m:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(m&3)===0||Ee(i,m)||(r=!0,Jx(i,m));i=i.next}while(r);Hf=!1}}function DC(){Kx()}function Kx(){wc=Bf=!1;var e=0;Fr!==0&&qC()&&(e=Fr);for(var t=Ct(),r=null,i=bc;i!==null;){var d=i.next,m=Qx(i,t);m===0?(i.next=null,r===null?bc=d:r.next=d,d===null&&(El=r)):(r=i,(e!==0||(m&3)!==0)&&(wc=!0)),i=d}Gt!==0&&Gt!==5||Bo(e),Fr!==0&&(Fr=0)}function Qx(e,t){for(var r=e.suspendedLanes,i=e.pingedLanes,d=e.expirationTimes,m=e.pendingLanes&-62914561;0<m;){var j=31-Tt(m),T=1<<j,I=d[j];I===-1?((T&r)===0||(T&i)!==0)&&(d[j]=_e(T,t)):I<=t&&(e.expiredLanes|=T),m&=~T}if(t=pt,r=Ye,r=It(e,e===t?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,r===0||e===t&&(it===2||it===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&Wt(i),e.callbackNode=null,e.callbackPriority=0;if((r&3)===0||Ee(e,r)){if(t=r&-r,t===e.callbackPriority)return t;switch(i!==null&&Wt(i),Fa(r)){case 2:case 8:r=Mt;break;case 32:r=pn;break;case 268435456:r=Aa;break;default:r=pn}return i=Zx.bind(null,e),r=St(r,i),e.callbackPriority=t,e.callbackNode=r,t}return i!==null&&i!==null&&Wt(i),e.callbackPriority=2,e.callbackNode=null,2}function Zx(e,t){if(Gt!==0&&Gt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(yc()&&e.callbackNode!==r)return null;var i=Ye;return i=It(e,e===pt?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(Ox(e,i,t),Qx(e,Ct()),e.callbackNode!=null&&e.callbackNode===r?Zx.bind(null,e):null)}function Jx(e,t){if(yc())return null;Ox(e,t,!0)}function OC(){VC(function(){(tt&6)!==0?St(At,DC):Kx()})}function qf(){if(Fr===0){var e=dl;e===0&&(e=Ya,Ya<<=1,(Ya&261888)===0&&(Ya=256)),Fr=e}return Fr}function Wx(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ai(""+e)}function ey(e,t){var r=t.ownerDocument.createElement("input");return r.name=t.name,r.value=t.value,e.id&&r.setAttribute("form",e.id),t.parentNode.insertBefore(r,t),e=new FormData(e),r.parentNode.removeChild(r),e}function kC(e,t,r,i,d){if(t==="submit"&&r&&r.stateNode===d){var m=Wx((d[Cn]||null).action),j=i.submitter;j&&(t=(t=j[Cn]||null)?Wx(t.formAction):j.getAttribute("formAction"),t!==null&&(m=t,j=null));var T=new ki("action","action",null,i,d);e.push({event:T,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Fr!==0){var I=j?ey(d,j):new FormData(d);of(r,{pending:!0,data:I,method:d.method,action:m},null,I)}}else typeof m=="function"&&(T.preventDefault(),I=j?ey(d,j):new FormData(d),of(r,{pending:!0,data:I,method:d.method,action:m},m,I))},currentTarget:d}]})}}for(var $f=0;$f<Cd.length;$f++){var Vf=Cd[$f],_C=Vf.toLowerCase(),zC=Vf[0].toUpperCase()+Vf.slice(1);xa(_C,"on"+zC)}xa(Dg,"onAnimationEnd"),xa(Og,"onAnimationIteration"),xa(kg,"onAnimationStart"),xa("dblclick","onDoubleClick"),xa("focusin","onFocus"),xa("focusout","onBlur"),xa(ZS,"onTransitionRun"),xa(JS,"onTransitionStart"),xa(WS,"onTransitionCancel"),xa(_g,"onTransitionEnd"),Zs("onMouseEnter",["mouseout","mouseover"]),Zs("onMouseLeave",["mouseout","mouseover"]),Zs("onPointerEnter",["pointerout","pointerover"]),Zs("onPointerLeave",["pointerout","pointerover"]),ms("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ms("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ms("onBeforeInput",["compositionend","keypress","textInput","paste"]),ms("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ms("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ms("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ho="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(" "),LC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ho));function ty(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var i=e[r],d=i.event;i=i.listeners;e:{var m=void 0;if(t)for(var j=i.length-1;0<=j;j--){var T=i[j],I=T.instance,K=T.currentTarget;if(T=T.listener,I!==m&&d.isPropagationStopped())break e;m=T,d.currentTarget=K;try{m(d)}catch(re){Li(re)}d.currentTarget=null,m=I}else for(j=0;j<i.length;j++){if(T=i[j],I=T.instance,K=T.currentTarget,T=T.listener,I!==m&&d.isPropagationStopped())break e;m=T,d.currentTarget=K;try{m(d)}catch(re){Li(re)}d.currentTarget=null,m=I}}}}function Ve(e,t){var r=t[nd];r===void 0&&(r=t[nd]=new Set);var i=e+"__bubble";r.has(i)||(ny(t,e,2,!1),r.add(i))}function Yf(e,t,r){var i=0;t&&(i|=4),ny(r,e,i,t)}var jc="_reactListening"+Math.random().toString(36).slice(2);function Gf(e){if(!e[jc]){e[jc]=!0,Kp.forEach(function(r){r!=="selectionchange"&&(LC.has(r)||Yf(r,!1,e),Yf(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[jc]||(t[jc]=!0,Yf("selectionchange",!1,t))}}function ny(e,t,r,i){switch(Dy(t)){case 2:var d=u2;break;case 8:d=d2;break;default:d=oh}r=d.bind(null,t,r,e),d=void 0,!dd||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(d=!0),i?d!==void 0?e.addEventListener(t,r,{capture:!0,passive:d}):e.addEventListener(t,r,!0):d!==void 0?e.addEventListener(t,r,{passive:d}):e.addEventListener(t,r,!1)}function Ff(e,t,r,i,d){var m=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var j=i.tag;if(j===3||j===4){var T=i.stateNode.containerInfo;if(T===d)break;if(j===4)for(j=i.return;j!==null;){var I=j.tag;if((I===3||I===4)&&j.stateNode.containerInfo===d)return;j=j.return}for(;T!==null;){if(j=Xs(T),j===null)return;if(I=j.tag,I===5||I===6||I===26||I===27){i=m=j;continue e}T=T.parentNode}}i=i.return}og(function(){var K=m,re=cd(r),oe=[];e:{var Q=zg.get(e);if(Q!==void 0){var W=ki,we=e;switch(e){case"keypress":if(Di(r)===0)break e;case"keydown":case"keyup":W=AS;break;case"focusin":we="focus",W=pd;break;case"focusout":we="blur",W=pd;break;case"beforeblur":case"afterblur":W=pd;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":W=ug;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":W=vS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":W=OS;break;case Dg:case Og:case kg:W=bS;break;case _g:W=_S;break;case"scroll":case"scrollend":W=pS;break;case"wheel":W=LS;break;case"copy":case"cut":case"paste":W=jS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":W=fg;break;case"toggle":case"beforetoggle":W=IS}var De=(t&4)!==0,ht=!De&&(e==="scroll"||e==="scrollend"),Y=De?Q!==null?Q+"Capture":null:Q;De=[];for(var P=K,X;P!==null;){var le=P;if(X=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||X===null||Y===null||(le=io(P,Y),le!=null&&De.push(qo(P,le,X))),ht)break;P=P.return}0<De.length&&(Q=new W(Q,we,null,r,re),oe.push({event:Q,listeners:De}))}}if((t&7)===0){e:{if(Q=e==="mouseover"||e==="pointerover",W=e==="mouseout"||e==="pointerout",Q&&r!==id&&(we=r.relatedTarget||r.fromElement)&&(Xs(we)||we[Fs]))break e;if((W||Q)&&(Q=re.window===re?re:(Q=re.ownerDocument)?Q.defaultView||Q.parentWindow:window,W?(we=r.relatedTarget||r.toElement,W=K,we=we?Xs(we):null,we!==null&&(ht=u(we),De=we.tag,we!==ht||De!==5&&De!==27&&De!==6)&&(we=null)):(W=null,we=K),W!==we)){if(De=ug,le="onMouseLeave",Y="onMouseEnter",P="mouse",(e==="pointerout"||e==="pointerover")&&(De=fg,le="onPointerLeave",Y="onPointerEnter",P="pointer"),ht=W==null?Q:oo(W),X=we==null?Q:oo(we),Q=new De(le,P+"leave",W,r,re),Q.target=ht,Q.relatedTarget=X,le=null,Xs(re)===K&&(De=new De(Y,P+"enter",we,r,re),De.target=X,De.relatedTarget=ht,le=De),ht=le,W&&we)t:{for(De=UC,Y=W,P=we,X=0,le=Y;le;le=De(le))X++;le=0;for(var Te=P;Te;Te=De(Te))le++;for(;0<X-le;)Y=De(Y),X--;for(;0<le-X;)P=De(P),le--;for(;X--;){if(Y===P||P!==null&&Y===P.alternate){De=Y;break t}Y=De(Y),P=De(P)}De=null}else De=null;W!==null&&ay(oe,Q,W,De,!1),we!==null&&ht!==null&&ay(oe,ht,we,De,!0)}}e:{if(Q=K?oo(K):window,W=Q.nodeName&&Q.nodeName.toLowerCase(),W==="select"||W==="input"&&Q.type==="file")var Ze=bg;else if(xg(Q))if(wg)Ze=XS;else{Ze=GS;var je=YS}else W=Q.nodeName,!W||W.toLowerCase()!=="input"||Q.type!=="checkbox"&&Q.type!=="radio"?K&&od(K.elementType)&&(Ze=bg):Ze=FS;if(Ze&&(Ze=Ze(e,K))){yg(oe,Ze,r,re);break e}je&&je(e,Q,K),e==="focusout"&&K&&Q.type==="number"&&K.memoizedProps.value!=null&&ld(Q,"number",Q.value)}switch(je=K?oo(K):window,e){case"focusin":(xg(je)||je.contentEditable==="true")&&(al=je,wd=K,vo=null);break;case"focusout":vo=wd=al=null;break;case"mousedown":jd=!0;break;case"contextmenu":case"mouseup":case"dragend":jd=!1,Ag(oe,r,re);break;case"selectionchange":if(QS)break;case"keydown":case"keyup":Ag(oe,r,re)}var Ie;if(vd)e:{switch(e){case"compositionstart":var Ge="onCompositionStart";break e;case"compositionend":Ge="onCompositionEnd";break e;case"compositionupdate":Ge="onCompositionUpdate";break e}Ge=void 0}else nl?gg(e,r)&&(Ge="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(Ge="onCompositionStart");Ge&&(hg&&r.locale!=="ko"&&(nl||Ge!=="onCompositionStart"?Ge==="onCompositionEnd"&&nl&&(Ie=ig()):(Dr=re,fd="value"in Dr?Dr.value:Dr.textContent,nl=!0)),je=Sc(K,Ge),0<je.length&&(Ge=new dg(Ge,e,null,r,re),oe.push({event:Ge,listeners:je}),Ie?Ge.data=Ie:(Ie=vg(r),Ie!==null&&(Ge.data=Ie)))),(Ie=BS?HS(e,r):qS(e,r))&&(Ge=Sc(K,"onBeforeInput"),0<Ge.length&&(je=new dg("onBeforeInput","beforeinput",null,r,re),oe.push({event:je,listeners:Ge}),je.data=Ie)),kC(oe,e,K,r,re)}ty(oe,t)})}function qo(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Sc(e,t){for(var r=t+"Capture",i=[];e!==null;){var d=e,m=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||m===null||(d=io(e,r),d!=null&&i.unshift(qo(e,d,m)),d=io(e,t),d!=null&&i.push(qo(e,d,m))),e.tag===3)return i;e=e.return}return[]}function UC(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ay(e,t,r,i,d){for(var m=t._reactName,j=[];r!==null&&r!==i;){var T=r,I=T.alternate,K=T.stateNode;if(T=T.tag,I!==null&&I===i)break;T!==5&&T!==26&&T!==27||K===null||(I=K,d?(K=io(r,m),K!=null&&j.unshift(qo(r,K,I))):d||(K=io(r,m),K!=null&&j.push(qo(r,K,I)))),r=r.return}j.length!==0&&e.push({event:t,listeners:j})}var IC=/\r\n?/g,PC=/\u0000|\uFFFD/g;function ry(e){return(typeof e=="string"?e:""+e).replace(IC,`
|
|
49
|
-
`).replace(PC,"")}function sy(e,t){return t=ry(t),ry(e)===t}function ft(e,t,r,i,d,m){switch(r){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||Ws(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&Ws(e,""+i);break;case"className":Ri(e,"class",i);break;case"tabIndex":Ri(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Ri(e,r,i);break;case"style":sg(e,i,m);break;case"data":if(t!=="object"){Ri(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||r!=="href")){e.removeAttribute(r);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(r);break}i=Ai(""+i),e.setAttribute(r,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(r,"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 m=="function"&&(r==="formAction"?(t!=="input"&&ft(e,t,"name",d.name,d,null),ft(e,t,"formEncType",d.formEncType,d,null),ft(e,t,"formMethod",d.formMethod,d,null),ft(e,t,"formTarget",d.formTarget,d,null)):(ft(e,t,"encType",d.encType,d,null),ft(e,t,"method",d.method,d,null),ft(e,t,"target",d.target,d,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(r);break}i=Ai(""+i),e.setAttribute(r,i);break;case"onClick":i!=null&&(e.onclick=Ka);break;case"onScroll":i!=null&&Ve("scroll",e);break;case"onScrollEnd":i!=null&&Ve("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(o(61));if(r=i.__html,r!=null){if(d.children!=null)throw Error(o(60));e.innerHTML=r}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}r=Ai(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(r,""+i):e.removeAttribute(r);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":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(r,""):e.removeAttribute(r);break;case"capture":case"download":i===!0?e.setAttribute(r,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(r,i):e.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(r,i):e.removeAttribute(r);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(r):e.setAttribute(r,i);break;case"popover":Ve("beforetoggle",e),Ve("toggle",e),Ei(e,"popover",i);break;case"xlinkActuate":Xa(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Xa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Xa(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Xa(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Xa(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Xa(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Xa(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Xa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Xa(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Ei(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(r=hS.get(r)||r,Ei(e,r,i))}}function Xf(e,t,r,i,d,m){switch(r){case"style":sg(e,i,m);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(o(61));if(r=i.__html,r!=null){if(d.children!=null)throw Error(o(60));e.innerHTML=r}}break;case"children":typeof i=="string"?Ws(e,i):(typeof i=="number"||typeof i=="bigint")&&Ws(e,""+i);break;case"onScroll":i!=null&&Ve("scroll",e);break;case"onScrollEnd":i!=null&&Ve("scrollend",e);break;case"onClick":i!=null&&(e.onclick=Ka);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Qp.hasOwnProperty(r))e:{if(r[0]==="o"&&r[1]==="n"&&(d=r.endsWith("Capture"),t=r.slice(2,d?r.length-7:void 0),m=e[Cn]||null,m=m!=null?m[r]:null,typeof m=="function"&&e.removeEventListener(t,m,d),typeof i=="function")){typeof m!="function"&&m!==null&&(r in e?e[r]=null:e.hasAttribute(r)&&e.removeAttribute(r)),e.addEventListener(t,i,d);break e}r in e?e[r]=i:i===!0?e.setAttribute(r,""):Ei(e,r,i)}}}function fn(e,t,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ve("error",e),Ve("load",e);var i=!1,d=!1,m;for(m in r)if(r.hasOwnProperty(m)){var j=r[m];if(j!=null)switch(m){case"src":i=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:ft(e,t,m,j,r,null)}}d&&ft(e,t,"srcSet",r.srcSet,r,null),i&&ft(e,t,"src",r.src,r,null);return;case"input":Ve("invalid",e);var T=m=j=d=null,I=null,K=null;for(i in r)if(r.hasOwnProperty(i)){var re=r[i];if(re!=null)switch(i){case"name":d=re;break;case"type":j=re;break;case"checked":I=re;break;case"defaultChecked":K=re;break;case"value":m=re;break;case"defaultValue":T=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(o(137,t));break;default:ft(e,t,i,re,r,null)}}tg(e,m,T,I,K,j,d,!1);return;case"select":Ve("invalid",e),i=j=m=null;for(d in r)if(r.hasOwnProperty(d)&&(T=r[d],T!=null))switch(d){case"value":m=T;break;case"defaultValue":j=T;break;case"multiple":i=T;default:ft(e,t,d,T,r,null)}t=m,r=j,e.multiple=!!i,t!=null?Js(e,!!i,t,!1):r!=null&&Js(e,!!i,r,!0);return;case"textarea":Ve("invalid",e),m=d=i=null;for(j in r)if(r.hasOwnProperty(j)&&(T=r[j],T!=null))switch(j){case"value":i=T;break;case"defaultValue":d=T;break;case"children":m=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(o(91));break;default:ft(e,t,j,T,r,null)}ag(e,i,d,m);return;case"option":for(I in r)if(r.hasOwnProperty(I)&&(i=r[I],i!=null))switch(I){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:ft(e,t,I,i,r,null)}return;case"dialog":Ve("beforetoggle",e),Ve("toggle",e),Ve("cancel",e),Ve("close",e);break;case"iframe":case"object":Ve("load",e);break;case"video":case"audio":for(i=0;i<Ho.length;i++)Ve(Ho[i],e);break;case"image":Ve("error",e),Ve("load",e);break;case"details":Ve("toggle",e);break;case"embed":case"source":case"link":Ve("error",e),Ve("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(K in r)if(r.hasOwnProperty(K)&&(i=r[K],i!=null))switch(K){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:ft(e,t,K,i,r,null)}return;default:if(od(t)){for(re in r)r.hasOwnProperty(re)&&(i=r[re],i!==void 0&&Xf(e,t,re,i,r,void 0));return}}for(T in r)r.hasOwnProperty(T)&&(i=r[T],i!=null&&ft(e,t,T,i,r,null))}function BC(e,t,r,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,m=null,j=null,T=null,I=null,K=null,re=null;for(W in r){var oe=r[W];if(r.hasOwnProperty(W)&&oe!=null)switch(W){case"checked":break;case"value":break;case"defaultValue":I=oe;default:i.hasOwnProperty(W)||ft(e,t,W,null,i,oe)}}for(var Q in i){var W=i[Q];if(oe=r[Q],i.hasOwnProperty(Q)&&(W!=null||oe!=null))switch(Q){case"type":m=W;break;case"name":d=W;break;case"checked":K=W;break;case"defaultChecked":re=W;break;case"value":j=W;break;case"defaultValue":T=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(o(137,t));break;default:W!==oe&&ft(e,t,Q,W,i,oe)}}sd(e,j,T,I,K,re,m,d);return;case"select":W=j=T=Q=null;for(m in r)if(I=r[m],r.hasOwnProperty(m)&&I!=null)switch(m){case"value":break;case"multiple":W=I;default:i.hasOwnProperty(m)||ft(e,t,m,null,i,I)}for(d in i)if(m=i[d],I=r[d],i.hasOwnProperty(d)&&(m!=null||I!=null))switch(d){case"value":Q=m;break;case"defaultValue":T=m;break;case"multiple":j=m;default:m!==I&&ft(e,t,d,m,i,I)}t=T,r=j,i=W,Q!=null?Js(e,!!r,Q,!1):!!i!=!!r&&(t!=null?Js(e,!!r,t,!0):Js(e,!!r,r?[]:"",!1));return;case"textarea":W=Q=null;for(T in r)if(d=r[T],r.hasOwnProperty(T)&&d!=null&&!i.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:ft(e,t,T,null,i,d)}for(j in i)if(d=i[j],m=r[j],i.hasOwnProperty(j)&&(d!=null||m!=null))switch(j){case"value":Q=d;break;case"defaultValue":W=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(o(91));break;default:d!==m&&ft(e,t,j,d,i,m)}ng(e,Q,W);return;case"option":for(var we in r)if(Q=r[we],r.hasOwnProperty(we)&&Q!=null&&!i.hasOwnProperty(we))switch(we){case"selected":e.selected=!1;break;default:ft(e,t,we,null,i,Q)}for(I in i)if(Q=i[I],W=r[I],i.hasOwnProperty(I)&&Q!==W&&(Q!=null||W!=null))switch(I){case"selected":e.selected=Q&&typeof Q!="function"&&typeof Q!="symbol";break;default:ft(e,t,I,Q,i,W)}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 De in r)Q=r[De],r.hasOwnProperty(De)&&Q!=null&&!i.hasOwnProperty(De)&&ft(e,t,De,null,i,Q);for(K in i)if(Q=i[K],W=r[K],i.hasOwnProperty(K)&&Q!==W&&(Q!=null||W!=null))switch(K){case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(o(137,t));break;default:ft(e,t,K,Q,i,W)}return;default:if(od(t)){for(var ht in r)Q=r[ht],r.hasOwnProperty(ht)&&Q!==void 0&&!i.hasOwnProperty(ht)&&Xf(e,t,ht,void 0,i,Q);for(re in i)Q=i[re],W=r[re],!i.hasOwnProperty(re)||Q===W||Q===void 0&&W===void 0||Xf(e,t,re,Q,i,W);return}}for(var Y in r)Q=r[Y],r.hasOwnProperty(Y)&&Q!=null&&!i.hasOwnProperty(Y)&&ft(e,t,Y,null,i,Q);for(oe in i)Q=i[oe],W=r[oe],!i.hasOwnProperty(oe)||Q===W||Q==null&&W==null||ft(e,t,oe,Q,i,W)}function ly(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function HC(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,r=performance.getEntriesByType("resource"),i=0;i<r.length;i++){var d=r[i],m=d.transferSize,j=d.initiatorType,T=d.duration;if(m&&T&&ly(j)){for(j=0,T=d.responseEnd,i+=1;i<r.length;i++){var I=r[i],K=I.startTime;if(K>T)break;var re=I.transferSize,oe=I.initiatorType;re&&ly(oe)&&(I=I.responseEnd,j+=re*(I<T?1:(T-K)/(I-K)))}if(--i,t+=8*(m+j)/(d.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 Kf=null,Qf=null;function Cc(e){return e.nodeType===9?e:e.ownerDocument}function oy(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 iy(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 Zf(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 Jf=null;function qC(){var e=window.event;return e&&e.type==="popstate"?e===Jf?!1:(Jf=e,!0):(Jf=null,!1)}var cy=typeof setTimeout=="function"?setTimeout:void 0,$C=typeof clearTimeout=="function"?clearTimeout:void 0,uy=typeof Promise=="function"?Promise:void 0,VC=typeof queueMicrotask=="function"?queueMicrotask:typeof uy<"u"?function(e){return uy.resolve(null).then(e).catch(YC)}:cy;function YC(e){setTimeout(function(){throw e})}function Xr(e){return e==="head"}function dy(e,t){var r=t,i=0;do{var d=r.nextSibling;if(e.removeChild(r),d&&d.nodeType===8)if(r=d.data,r==="/$"||r==="/&"){if(i===0){e.removeChild(d),Ml(t);return}i--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")i++;else if(r==="html")$o(e.ownerDocument.documentElement);else if(r==="head"){r=e.ownerDocument.head,$o(r);for(var m=r.firstChild;m;){var j=m.nextSibling,T=m.nodeName;m[lo]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&m.rel.toLowerCase()==="stylesheet"||r.removeChild(m),m=j}}else r==="body"&&$o(e.ownerDocument.body);r=d}while(r);Ml(t)}function fy(e,t){var r=e;e=0;do{var i=r.nextSibling;if(r.nodeType===1?t?(r._stashedDisplay=r.style.display,r.style.display="none"):(r.style.display=r._stashedDisplay||"",r.getAttribute("style")===""&&r.removeAttribute("style")):r.nodeType===3&&(t?(r._stashedText=r.nodeValue,r.nodeValue=""):r.nodeValue=r._stashedText||""),i&&i.nodeType===8)if(r=i.data,r==="/$"){if(e===0)break;e--}else r!=="$"&&r!=="$?"&&r!=="$~"&&r!=="$!"||e++;r=i}while(r)}function Wf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var r=t;switch(t=t.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":Wf(r),ad(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function GC(e,t,r,i){for(;e.nodeType===1;){var d=r;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[lo])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(m=e.getAttribute("rel"),m==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(m!==d.rel||e.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||e.getAttribute("title")!==(d.title==null?null:d.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(m=e.getAttribute("src"),(m!==(d.src==null?null:d.src)||e.getAttribute("type")!==(d.type==null?null:d.type)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&m&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var m=d.name==null?null:""+d.name;if(d.type==="hidden"&&e.getAttribute("name")===m)return e}else return e;if(e=ca(e.nextSibling),e===null)break}return null}function FC(e,t,r){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=ca(e.nextSibling),e===null))return null;return e}function hy(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ca(e.nextSibling),e===null))return null;return e}function eh(e){return e.data==="$?"||e.data==="$~"}function th(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function XC(e,t){var r=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||r.readyState!=="loading")t();else{var i=function(){t(),r.removeEventListener("DOMContentLoaded",i)};r.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function ca(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 nh=null;function my(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"||r==="/&"){if(t===0)return ca(e.nextSibling);t--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||t++}e=e.nextSibling}return null}function py(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"){if(t===0)return e;t--}else r!=="/$"&&r!=="/&"||t++}e=e.previousSibling}return null}function gy(e,t,r){switch(t=Cc(r),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function $o(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ad(e)}var ua=new Map,vy=new Set;function Nc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var dr=q.d;q.d={f:KC,r:QC,D:ZC,C:JC,L:WC,m:e2,X:n2,S:t2,M:a2};function KC(){var e=dr.f(),t=gc();return e||t}function QC(e){var t=Ks(e);t!==null&&t.tag===5&&t.type==="form"?_v(t):dr.r(e)}var Rl=typeof document>"u"?null:document;function xy(e,t,r){var i=Rl;if(i&&typeof t=="string"&&t){var d=na(t);d='link[rel="'+e+'"][href="'+d+'"]',typeof r=="string"&&(d+='[crossorigin="'+r+'"]'),vy.has(d)||(vy.add(d),e={rel:e,crossOrigin:r,href:t},i.querySelector(d)===null&&(t=i.createElement("link"),fn(t,"link",e),tn(t),i.head.appendChild(t)))}}function ZC(e){dr.D(e),xy("dns-prefetch",e,null)}function JC(e,t){dr.C(e,t),xy("preconnect",e,t)}function WC(e,t,r){dr.L(e,t,r);var i=Rl;if(i&&e&&t){var d='link[rel="preload"][as="'+na(t)+'"]';t==="image"&&r&&r.imageSrcSet?(d+='[imagesrcset="'+na(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(d+='[imagesizes="'+na(r.imageSizes)+'"]')):d+='[href="'+na(e)+'"]';var m=d;switch(t){case"style":m=Tl(e);break;case"script":m=Al(e)}ua.has(m)||(e=y({rel:"preload",href:t==="image"&&r&&r.imageSrcSet?void 0:e,as:t},r),ua.set(m,e),i.querySelector(d)!==null||t==="style"&&i.querySelector(Vo(m))||t==="script"&&i.querySelector(Yo(m))||(t=i.createElement("link"),fn(t,"link",e),tn(t),i.head.appendChild(t)))}}function e2(e,t){dr.m(e,t);var r=Rl;if(r&&e){var i=t&&typeof t.as=="string"?t.as:"script",d='link[rel="modulepreload"][as="'+na(i)+'"][href="'+na(e)+'"]',m=d;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=Al(e)}if(!ua.has(m)&&(e=y({rel:"modulepreload",href:e},t),ua.set(m,e),r.querySelector(d)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(Yo(m)))return}i=r.createElement("link"),fn(i,"link",e),tn(i),r.head.appendChild(i)}}}function t2(e,t,r){dr.S(e,t,r);var i=Rl;if(i&&e){var d=Qs(i).hoistableStyles,m=Tl(e);t=t||"default";var j=d.get(m);if(!j){var T={loading:0,preload:null};if(j=i.querySelector(Vo(m)))T.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},r),(r=ua.get(m))&&ah(e,r);var I=j=i.createElement("link");tn(I),fn(I,"link",e),I._p=new Promise(function(K,re){I.onload=K,I.onerror=re}),I.addEventListener("load",function(){T.loading|=1}),I.addEventListener("error",function(){T.loading|=2}),T.loading|=4,Ec(j,t,i)}j={type:"stylesheet",instance:j,count:1,state:T},d.set(m,j)}}}function n2(e,t){dr.X(e,t);var r=Rl;if(r&&e){var i=Qs(r).hoistableScripts,d=Al(e),m=i.get(d);m||(m=r.querySelector(Yo(d)),m||(e=y({src:e,async:!0},t),(t=ua.get(d))&&rh(e,t),m=r.createElement("script"),tn(m),fn(m,"link",e),r.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},i.set(d,m))}}function a2(e,t){dr.M(e,t);var r=Rl;if(r&&e){var i=Qs(r).hoistableScripts,d=Al(e),m=i.get(d);m||(m=r.querySelector(Yo(d)),m||(e=y({src:e,async:!0,type:"module"},t),(t=ua.get(d))&&rh(e,t),m=r.createElement("script"),tn(m),fn(m,"link",e),r.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},i.set(d,m))}}function yy(e,t,r,i){var d=(d=ye.current)?Nc(d):null;if(!d)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(t=Tl(r.href),r=Qs(d).hoistableStyles,i=r.get(t),i||(i={type:"style",instance:null,count:0,state:null},r.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){e=Tl(r.href);var m=Qs(d).hoistableStyles,j=m.get(e);if(j||(d=d.ownerDocument||d,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(e,j),(m=d.querySelector(Vo(e)))&&!m._p&&(j.instance=m,j.state.loading=5),ua.has(e)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},ua.set(e,r),m||r2(d,e,r,j.state))),t&&i===null)throw Error(o(528,""));return j}if(t&&i!==null)throw Error(o(529,""));return null;case"script":return t=r.async,r=r.src,typeof r=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Al(r),r=Qs(d).hoistableScripts,i=r.get(t),i||(i={type:"script",instance:null,count:0,state:null},r.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Tl(e){return'href="'+na(e)+'"'}function Vo(e){return'link[rel="stylesheet"]['+e+"]"}function by(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function r2(e,t,r,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),fn(t,"link",r),tn(t),e.head.appendChild(t))}function Al(e){return'[src="'+na(e)+'"]'}function Yo(e){return"script[async]"+e}function wy(e,t,r){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+na(r.href)+'"]');if(i)return t.instance=i,tn(i),i;var d=y({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),tn(i),fn(i,"style",d),Ec(i,r.precedence,e),t.instance=i;case"stylesheet":d=Tl(r.href);var m=e.querySelector(Vo(d));if(m)return t.state.loading|=4,t.instance=m,tn(m),m;i=by(r),(d=ua.get(d))&&ah(i,d),m=(e.ownerDocument||e).createElement("link"),tn(m);var j=m;return j._p=new Promise(function(T,I){j.onload=T,j.onerror=I}),fn(m,"link",i),t.state.loading|=4,Ec(m,r.precedence,e),t.instance=m;case"script":return m=Al(r.src),(d=e.querySelector(Yo(m)))?(t.instance=d,tn(d),d):(i=r,(d=ua.get(m))&&(i=y({},r),rh(i,d)),e=e.ownerDocument||e,d=e.createElement("script"),tn(d),fn(d,"link",i),e.head.appendChild(d),t.instance=d);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,Ec(i,r.precedence,e));return t.instance}function Ec(e,t,r){for(var i=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=i.length?i[i.length-1]:null,m=d,j=0;j<i.length;j++){var T=i[j];if(T.dataset.precedence===t)m=T;else if(m!==d)break}m?m.parentNode.insertBefore(e,m.nextSibling):(t=r.nodeType===9?r.head:r,t.insertBefore(e,t.firstChild))}function ah(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function rh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Rc=null;function jy(e,t,r){if(Rc===null){var i=new Map,d=Rc=new Map;d.set(r,i)}else d=Rc,i=d.get(r),i||(i=new Map,d.set(r,i));if(i.has(e))return i;for(i.set(e,null),r=r.getElementsByTagName(e),d=0;d<r.length;d++){var m=r[d];if(!(m[lo]||m[on]||e==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var j=m.getAttribute(t)||"";j=e+j;var T=i.get(j);T?T.push(m):i.set(j,[m])}}return i}function Sy(e,t,r){e=e.ownerDocument||e,e.head.insertBefore(r,t==="title"?e.querySelector("head > title"):null)}function s2(e,t,r){if(r===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 Cy(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function l2(e,t,r,i){if(r.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var d=Tl(i.href),m=t.querySelector(Vo(d));if(m){t=m._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Tc.bind(e),t.then(e,e)),r.state.loading|=4,r.instance=m,tn(m);return}m=t.ownerDocument||t,i=by(i),(d=ua.get(d))&&ah(i,d),m=m.createElement("link"),tn(m);var j=m;j._p=new Promise(function(T,I){j.onload=T,j.onerror=I}),fn(m,"link",i),r.instance=m}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(r,t),(t=r.state.preload)&&(r.state.loading&3)===0&&(e.count++,r=Tc.bind(e),t.addEventListener("load",r),t.addEventListener("error",r))}}var sh=0;function o2(e,t){return e.stylesheets&&e.count===0&&Mc(e,e.stylesheets),0<e.count||0<e.imgCount?function(r){var i=setTimeout(function(){if(e.stylesheets&&Mc(e,e.stylesheets),e.unsuspend){var m=e.unsuspend;e.unsuspend=null,m()}},6e4+t);0<e.imgBytes&&sh===0&&(sh=62500*HC());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Mc(e,e.stylesheets),e.unsuspend)){var m=e.unsuspend;e.unsuspend=null,m()}},(e.imgBytes>sh?50:800)+t);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(d)}}:null}function Tc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Mc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ac=null;function Mc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ac=new Map,t.forEach(i2,e),Ac=null,Tc.call(e))}function i2(e,t){if(!(t.state.loading&4)){var r=Ac.get(e);if(r)var i=r.get(null);else{r=new Map,Ac.set(e,r);for(var d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<d.length;m++){var j=d[m];(j.nodeName==="LINK"||j.getAttribute("media")!=="not all")&&(r.set(j.dataset.precedence,j),i=j)}i&&r.set(null,i)}d=t.instance,j=d.getAttribute("data-precedence"),m=r.get(j)||i,m===i&&r.set(null,d),r.set(j,d),this.count++,i=Tc.bind(this),d.addEventListener("load",i),d.addEventListener("error",i),m?m.parentNode.insertBefore(d,m.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(d,e.firstChild)),t.state.loading|=4}}var Go={$$typeof:A,Provider:null,Consumer:null,_currentValue:Z,_currentValue2:Z,_threadCount:0};function c2(e,t,r,i,d,m,j,T,I){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=vt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vt(0),this.hiddenUpdates=vt(null),this.identifierPrefix=i,this.onUncaughtError=d,this.onCaughtError=m,this.onRecoverableError=j,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=I,this.incompleteTransitions=new Map}function Ny(e,t,r,i,d,m,j,T,I,K,re,oe){return e=new c2(e,t,r,j,I,K,re,oe,T),t=1,m===!0&&(t|=24),m=Vn(3,null,null,t),e.current=m,m.stateNode=e,t=Ud(),t.refCount++,e.pooledCache=t,t.refCount++,m.memoizedState={element:i,isDehydrated:r,cache:t},Hd(m),e}function Ey(e){return e?(e=ll,e):ll}function Ry(e,t,r,i,d,m){d=Ey(d),i.context===null?i.context=d:i.pendingContext=d,i=Ur(t),i.payload={element:r},m=m===void 0?null:m,m!==null&&(i.callback=m),r=Ir(e,i,t),r!==null&&(Mn(r,e,t),Co(r,e,t))}function Ty(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function lh(e,t){Ty(e,t),(e=e.alternate)&&Ty(e,t)}function Ay(e){if(e.tag===13||e.tag===31){var t=xs(e,67108864);t!==null&&Mn(t,e,67108864),lh(e,67108864)}}function My(e){if(e.tag===13||e.tag===31){var t=Kn();t=Ga(t);var r=xs(e,t);r!==null&&Mn(r,e,t),lh(e,t)}}var Dc=!0;function u2(e,t,r,i){var d=k.T;k.T=null;var m=q.p;try{q.p=2,oh(e,t,r,i)}finally{q.p=m,k.T=d}}function d2(e,t,r,i){var d=k.T;k.T=null;var m=q.p;try{q.p=8,oh(e,t,r,i)}finally{q.p=m,k.T=d}}function oh(e,t,r,i){if(Dc){var d=ih(i);if(d===null)Ff(e,t,i,Oc,r),Oy(e,i);else if(h2(d,e,t,r,i))i.stopPropagation();else if(Oy(e,i),t&4&&-1<f2.indexOf(e)){for(;d!==null;){var m=Ks(d);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var j=at(m.pendingLanes);if(j!==0){var T=m;for(T.pendingLanes|=2,T.entangledLanes|=2;j;){var I=1<<31-Tt(j);T.entanglements[1]|=I,j&=~I}ka(m),(tt&6)===0&&(mc=Ct()+500,Bo(0))}}break;case 31:case 13:T=xs(m,2),T!==null&&Mn(T,m,2),gc(),lh(m,2)}if(m=ih(i),m===null&&Ff(e,t,i,Oc,r),m===d)break;d=m}d!==null&&i.stopPropagation()}else Ff(e,t,i,null,r)}}function ih(e){return e=cd(e),ch(e)}var Oc=null;function ch(e){if(Oc=null,e=Xs(e),e!==null){var t=u(e);if(t===null)e=null;else{var r=t.tag;if(r===13){if(e=f(t),e!==null)return e;e=null}else if(r===31){if(e=p(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Oc=e,null}function Dy(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(xn()){case At:return 2;case Mt:return 8;case pn:case pa:return 32;case Aa:return 268435456;default:return 32}default:return 32}}var uh=!1,Kr=null,Qr=null,Zr=null,Fo=new Map,Xo=new Map,Jr=[],f2="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 Oy(e,t){switch(e){case"focusin":case"focusout":Kr=null;break;case"dragenter":case"dragleave":Qr=null;break;case"mouseover":case"mouseout":Zr=null;break;case"pointerover":case"pointerout":Fo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xo.delete(t.pointerId)}}function Ko(e,t,r,i,d,m){return e===null||e.nativeEvent!==m?(e={blockedOn:t,domEventName:r,eventSystemFlags:i,nativeEvent:m,targetContainers:[d]},t!==null&&(t=Ks(t),t!==null&&Ay(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function h2(e,t,r,i,d){switch(t){case"focusin":return Kr=Ko(Kr,e,t,r,i,d),!0;case"dragenter":return Qr=Ko(Qr,e,t,r,i,d),!0;case"mouseover":return Zr=Ko(Zr,e,t,r,i,d),!0;case"pointerover":var m=d.pointerId;return Fo.set(m,Ko(Fo.get(m)||null,e,t,r,i,d)),!0;case"gotpointercapture":return m=d.pointerId,Xo.set(m,Ko(Xo.get(m)||null,e,t,r,i,d)),!0}return!1}function ky(e){var t=Xs(e.target);if(t!==null){var r=u(t);if(r!==null){if(t=r.tag,t===13){if(t=f(r),t!==null){e.blockedOn=t,Mr(e.priority,function(){My(r)});return}}else if(t===31){if(t=p(r),t!==null){e.blockedOn=t,Mr(e.priority,function(){My(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function kc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=ih(e.nativeEvent);if(r===null){r=e.nativeEvent;var i=new r.constructor(r.type,r);id=i,r.target.dispatchEvent(i),id=null}else return t=Ks(r),t!==null&&Ay(t),e.blockedOn=r,!1;t.shift()}return!0}function _y(e,t,r){kc(e)&&r.delete(t)}function m2(){uh=!1,Kr!==null&&kc(Kr)&&(Kr=null),Qr!==null&&kc(Qr)&&(Qr=null),Zr!==null&&kc(Zr)&&(Zr=null),Fo.forEach(_y),Xo.forEach(_y)}function _c(e,t){e.blockedOn===t&&(e.blockedOn=null,uh||(uh=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,m2)))}var zc=null;function zy(e){zc!==e&&(zc=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){zc===e&&(zc=null);for(var t=0;t<e.length;t+=3){var r=e[t],i=e[t+1],d=e[t+2];if(typeof i!="function"){if(ch(i||r)===null)continue;break}var m=Ks(r);m!==null&&(e.splice(t,3),t-=3,of(m,{pending:!0,data:d,method:r.method,action:i},i,d))}}))}function Ml(e){function t(I){return _c(I,e)}Kr!==null&&_c(Kr,e),Qr!==null&&_c(Qr,e),Zr!==null&&_c(Zr,e),Fo.forEach(t),Xo.forEach(t);for(var r=0;r<Jr.length;r++){var i=Jr[r];i.blockedOn===e&&(i.blockedOn=null)}for(;0<Jr.length&&(r=Jr[0],r.blockedOn===null);)ky(r),r.blockedOn===null&&Jr.shift();if(r=(e.ownerDocument||e).$$reactFormReplay,r!=null)for(i=0;i<r.length;i+=3){var d=r[i],m=r[i+1],j=d[Cn]||null;if(typeof m=="function")j||zy(r);else if(j){var T=null;if(m&&m.hasAttribute("formAction")){if(d=m,j=m[Cn]||null)T=j.formAction;else if(ch(d)!==null)continue}else T=j.action;typeof T=="function"?r[i+1]=T:(r.splice(i,3),i-=3),zy(r)}}}function Ly(){function e(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(j){return d=j})},focusReset:"manual",scroll:"manual"})}function t(){d!==null&&(d(),d=null),i||setTimeout(r,20)}function r(){if(!i&&!navigation.transition){var m=navigation.currentEntry;m&&m.url!=null&&navigation.navigate(m.url,{state:m.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,d=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(r,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),d!==null&&(d(),d=null)}}}function dh(e){this._internalRoot=e}Lc.prototype.render=dh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var r=t.current,i=Kn();Ry(r,i,e,t,null,null)},Lc.prototype.unmount=dh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ry(e.current,2,null,e,null,null),gc(),t[Fs]=null}};function Lc(e){this._internalRoot=e}Lc.prototype.unstable_scheduleHydration=function(e){if(e){var t=va();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Jr.length&&t!==0&&t<Jr[r].priority;r++);Jr.splice(r,0,e),r===0&&ky(e)}};var Uy=a.version;if(Uy!=="19.2.8")throw Error(o(527,Uy,"19.2.8"));q.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=v(t),e=e!==null?x(e):null,e=e===null?null:e.stateNode,e};var p2={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Uc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Uc.isDisabled&&Uc.supportsFiber)try{ga=Uc.inject(p2),Dt=Uc}catch{}}return Zo.createRoot=function(e,t){if(!c(e))throw Error(o(299));var r=!1,i="",d=Vv,m=Yv,j=Gv;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(d=t.onUncaughtError),t.onCaughtError!==void 0&&(m=t.onCaughtError),t.onRecoverableError!==void 0&&(j=t.onRecoverableError)),t=Ny(e,1,!1,null,null,r,i,null,d,m,j,Ly),e[Fs]=t.current,Gf(e),new dh(t)},Zo.hydrateRoot=function(e,t,r){if(!c(e))throw Error(o(299));var i=!1,d="",m=Vv,j=Yv,T=Gv,I=null;return r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(d=r.identifierPrefix),r.onUncaughtError!==void 0&&(m=r.onUncaughtError),r.onCaughtError!==void 0&&(j=r.onCaughtError),r.onRecoverableError!==void 0&&(T=r.onRecoverableError),r.formState!==void 0&&(I=r.formState)),t=Ny(e,1,!0,t,r??null,i,d,I,m,j,T,Ly),t.context=Ey(null),r=t.current,i=Kn(),i=Ga(i),d=Ur(i),d.callback=null,Ir(r,d,i),r=i,t.current.lanes=r,Nt(t,r),ka(t),e[Fs]=t.current,Gf(e),new Lc(t)},Zo.version="19.2.8",Zo}var Qy;function N2(){if(Qy)return ph.exports;Qy=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(a){console.error(a)}}return n(),ph.exports=C2(),ph.exports}var E2=N2();const R2=Cm(E2);/**
|
|
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 Em=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,r0=/^[\\/]{2}/;function T2(n,a){return a+n.replace(/\\/g,"/")}var Zy="popstate";function Jy(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function A2(n={}){function a(o,c){var v;let u=(v=c.state)==null?void 0:v.masked,{pathname:f,search:p,hash:g}=u||o.location;return Hh("",{pathname:f,search:p,hash:g},c.state&&c.state.usr||null,c.state&&c.state.key||"default",u?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function l(o,c){return typeof c=="string"?c:ri(c)}return D2(a,l,null,n)}function Rt(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function ha(n,a){if(!n){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function M2(){return Math.random().toString(36).substring(2,10)}function Wy(n,a){return{usr:n.state,key:n.key,idx:a,masked:n.mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function Hh(n,a,l=null,o,c){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof a=="string"?Yl(a):a,state:l,key:a&&a.key||o||M2(),mask:c}}function ri({pathname:n="/",search:a="",hash:l=""}){return a&&a!=="?"&&(n+=a.charAt(0)==="?"?a:"?"+a),l&&l!=="#"&&(n+=l.charAt(0)==="#"?l:"#"+l),n}function Yl(n){let a={};if(n){let l=n.indexOf("#");l>=0&&(a.hash=n.substring(l),n=n.substring(0,l));let o=n.indexOf("?");o>=0&&(a.search=n.substring(o),n=n.substring(0,o)),n&&(a.pathname=n)}return a}function D2(n,a,l,o={}){let{window:c=document.defaultView,v5Compat:u=!1}=o,f=c.history,p="POP",g=null,v=x();v==null&&(v=0,f.replaceState({...f.state,idx:v},""));function x(){return(f.state||{idx:null}).idx}function y(){p="POP";let C=x(),R=C==null?null:C-v;v=C,g&&g({action:p,location:S.location,delta:R})}function b(C,R){p="PUSH";let D=Jy(C)?C:Hh(S.location,C,R);v=x()+1;let A=Wy(D,v),M=S.createHref(D.mask||D);try{f.pushState(A,"",M)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;c.location.assign(M)}u&&g&&g({action:p,location:S.location,delta:1})}function w(C,R){p="REPLACE";let D=Jy(C)?C:Hh(S.location,C,R);v=x();let A=Wy(D,v),M=S.createHref(D.mask||D);f.replaceState(A,"",M),u&&g&&g({action:p,location:S.location,delta:0})}function N(C){return O2(c,C)}let S={get action(){return p},get location(){return n(c,f)},listen(C){if(g)throw new Error("A history only accepts one active listener");return c.addEventListener(Zy,y),g=C,()=>{c.removeEventListener(Zy,y),g=null}},createHref(C){return a(c,C)},createURL:N,encodeLocation(C){let R=N(C);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:b,replace:w,go(C){return f.go(C)}};return S}function O2(n,a,l=!1){let o="http://localhost";n&&(o=n.location.origin!=="null"?n.location.origin:n.location.href),Rt(o,"No window.location.(origin|href) available to create URL");let c=typeof a=="string"?a:ri(a);return c=c.replace(/ $/,"%20"),!l&&r0.test(c)&&(c=o+c),new URL(c,o)}function s0(n,a,l="/"){return k2(n,a,l,!1)}function k2(n,a,l,o,c){let u=typeof a=="string"?Yl(a):a,f=yr(u.pathname||"/",l);if(f==null)return null;let p=_2(n),g=null,v=Y2(f);for(let x=0;g==null&&x<p.length;++x)g=V2(p[x],v,o);return g}function _2(n){let a=l0(n);return z2(a),a}function l0(n,a=[],l=[],o="",c=!1){let u=(f,p,g=c,v)=>{let x={relativePath:v===void 0?f.path||"":v,caseSensitive:f.caseSensitive===!0,childrenIndex:p,route:f};if(x.relativePath.startsWith("/")){if(!x.relativePath.startsWith(o)&&g)return;Rt(x.relativePath.startsWith(o),`Absolute route path "${x.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),x.relativePath=x.relativePath.slice(o.length)}let y=Ca([o,x.relativePath]),b=l.concat(x);f.children&&f.children.length>0&&(Rt(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),l0(f.children,a,b,y,g)),!(f.path==null&&!f.index)&&a.push({path:y,score:q2(y,f.index),routesMeta:b.map((w,N)=>{let[S,C]=c0(w.relativePath,w.caseSensitive,N===b.length-1);return{...w,matcher:S,compiledParams:C}})})};return n.forEach((f,p)=>{var g;if(f.path===""||!((g=f.path)!=null&&g.includes("?")))u(f,p);else for(let v of o0(f.path))u(f,p,!0,v)}),a}function o0(n){let a=n.split("/");if(a.length===0)return[];let[l,...o]=a,c=l.endsWith("?"),u=l.replace(/\?$/,"");if(o.length===0)return c?[u,""]:[u];let f=o0(o.join("/")),p=[];return p.push(...f.map(g=>g===""?u:[u,g].join("/"))),c&&p.push(...f),p.map(g=>n.startsWith("/")&&g===""?"/":g)}function z2(n){n.sort((a,l)=>a.score!==l.score?l.score-a.score:$2(a.routesMeta.map(o=>o.childrenIndex),l.routesMeta.map(o=>o.childrenIndex)))}var L2=/^:[\w-]+$/,U2=3,I2=2,P2=1,B2=10,H2=-2,eb=n=>n==="*";function q2(n,a){let l=n.split("/"),o=l.length;return l.some(eb)&&(o+=H2),a&&(o+=I2),l.filter(c=>!eb(c)).reduce((c,u)=>c+(L2.test(u)?U2:u===""?P2:B2),o)}function $2(n,a){return n.length===a.length&&n.slice(0,-1).every((o,c)=>o===a[c])?n[n.length-1]-a[a.length-1]:0}function V2(n,a,l=!1){let{routesMeta:o}=n,c={},u="/",f=[];for(let p=0;p<o.length;++p){let g=o[p],v=p===o.length-1,x=u==="/"?a:a.slice(u.length)||"/",y={path:g.relativePath,caseSensitive:g.caseSensitive,end:v},b=g.matcher&&g.compiledParams?i0(y,x,g.matcher,g.compiledParams):iu(y,x),w=g.route;if(!b&&v&&l&&!o[o.length-1].route.index&&(b=iu({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},x)),!b)return null;Object.assign(c,b.params),f.push({params:c,pathname:Ca([u,b.pathname]),pathnameBase:X2(Ca([u,b.pathnameBase])),route:w}),b.pathnameBase!=="/"&&(u=Ca([u,b.pathnameBase]))}return f}function iu(n,a){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[l,o]=c0(n.path,n.caseSensitive,n.end);return i0(n,a,l,o)}function i0(n,a,l,o){let c=a.match(l);if(!c)return null;let u=c[0],f=u.replace(/(.)\/+$/,"$1"),p=c.slice(1);return{params:o.reduce((v,{paramName:x,isOptional:y},b)=>{if(x==="*"){let N=p[b]||"";f=u.slice(0,u.length-N.length).replace(/(.)\/+$/,"$1")}const w=p[b];return y&&!w?v[x]=void 0:v[x]=(w||"").replace(/%2F/g,"/"),v},{}),pathname:u,pathnameBase:f,pattern:n}}function c0(n,a=!1,l=!0){ha(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 o=[],c="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,p,g,v,x)=>{if(o.push({paramName:p,isOptional:g!=null}),g){let y=x.charAt(v+f.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(o.push({paramName:"*"}),c+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?c+="\\/*$":n!==""&&n!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),o]}function Y2(n){try{return n.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return ha(!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 (${a}).`),n}}function yr(n,a){if(a==="/")return n;if(!n.toLowerCase().startsWith(a.toLowerCase()))return null;let l=a.endsWith("/")?a.length-1:a.length,o=n.charAt(l);return o&&o!=="/"?null:n.slice(l)||"/"}function G2(n,a="/"){let{pathname:l,search:o="",hash:c=""}=typeof n=="string"?Yl(n):n,u;return l?(l=u0(l),l.startsWith("/")?u=tb(l.substring(1),"/"):u=tb(l,a)):u=a,{pathname:u,search:K2(o),hash:Q2(c)}}function tb(n,a){let l=cu(a).split("/");return n.split("/").forEach(c=>{c===".."?l.length>1&&l.pop():c!=="."&&l.push(c)}),l.length>1?l.join("/"):"/"}function yh(n,a,l,o){return`Cannot include a '${n}' character in a manually specified \`to.${a}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${l}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function F2(n){return n.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function Rm(n){let a=F2(n);return a.map((l,o)=>o===a.length-1?l.pathname:l.pathnameBase)}function Su(n,a,l,o=!1){let c;typeof n=="string"?c=Yl(n):(c={...n},Rt(!c.pathname||!c.pathname.includes("?"),yh("?","pathname","search",c)),Rt(!c.pathname||!c.pathname.includes("#"),yh("#","pathname","hash",c)),Rt(!c.search||!c.search.includes("#"),yh("#","search","hash",c)));let u=n===""||c.pathname==="",f=u?"/":c.pathname,p;if(f==null)p=l;else{let y=a.length-1;if(!o&&f.startsWith("..")){let b=f.split("/");for(;b[0]==="..";)b.shift(),y-=1;c.pathname=b.join("/")}p=y>=0?a[y]:"/"}let g=G2(c,p),v=f&&f!=="/"&&f.endsWith("/"),x=(u||f===".")&&l.endsWith("/");return!g.pathname.endsWith("/")&&(v||x)&&(g.pathname+="/"),g}var u0=n=>n.replace(/[\\/]{2,}/g,"/"),Ca=n=>u0(n.join("/")),cu=n=>n.replace(/\/+$/,""),X2=n=>cu(n).replace(/^\/*/,"/"),K2=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,Q2=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,Z2=class{constructor(n,a,l,o=!1){this.status=n,this.statusText=a||"",this.internal=o,l instanceof Error?(this.data=l.toString(),this.error=l):this.data=l}};function J2(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function W2(n){let a=n.map(l=>l.route.path).filter(Boolean);return Ca(a)||"/"}var d0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function f0(n,a){let l=n;if(typeof l!="string"||!Em.test(l))return{absoluteURL:void 0,isExternal:!1,to:l};let o=l,c=!1;if(d0)try{let u=new URL(window.location.href),f=r0.test(l)?new URL(T2(l,u.protocol)):new URL(l),p=yr(f.pathname,a);f.origin===u.origin&&p!=null?l=p+f.search+f.hash:c=!0}catch{ha(!1,`<Link to="${l}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:c,to:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var h0=["POST","PUT","PATCH","DELETE"];new Set(h0);var eN=["GET",...h0];new Set(eN);var tN=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function nN(n){try{return tN.includes(new URL(n).protocol)}catch{return!1}}var Gl=h.createContext(null);Gl.displayName="DataRouter";var Cu=h.createContext(null);Cu.displayName="DataRouterState";var m0=h.createContext(!1);function aN(){return h.useContext(m0)}var p0=h.createContext({isTransitioning:!1});p0.displayName="ViewTransition";var rN=h.createContext(new Map);rN.displayName="Fetchers";var sN=h.createContext(null);sN.displayName="Await";var Zn=h.createContext(null);Zn.displayName="Navigation";var mi=h.createContext(null);mi.displayName="Location";var $a=h.createContext({outlet:null,matches:[],isDataRoute:!1});$a.displayName="Route";var Tm=h.createContext(null);Tm.displayName="RouteError";var g0="REACT_ROUTER_ERROR",lN="REDIRECT",oN="ROUTE_ERROR_RESPONSE";function iN(n){if(n.startsWith(`${g0}:${lN}:{`))try{let a=JSON.parse(n.slice(28));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.location=="string"&&typeof a.reloadDocument=="boolean"&&typeof a.replace=="boolean")return a}catch{}}function cN(n){if(n.startsWith(`${g0}:${oN}:{`))try{let a=JSON.parse(n.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new Z2(a.status,a.statusText,a.data)}catch{}}function uN(n,{relative:a}={}){Rt(Fl(),"useHref() may be used only in the context of a <Router> component.");let{basename:l,navigator:o}=h.useContext(Zn),{hash:c,pathname:u,search:f}=gi(n,{relative:a}),p=u;return l!=="/"&&(p=u==="/"?l:Ca([l,u])),o.createHref({pathname:p,search:f,hash:c})}function Fl(){return h.useContext(mi)!=null}function Bn(){return Rt(Fl(),"useLocation() may be used only in the context of a <Router> component."),h.useContext(mi).location}var v0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function x0(n){h.useContext(Zn).static||h.useLayoutEffect(n)}function pi(){let{isDataRoute:n}=h.useContext($a);return n?SN():dN()}function dN(){Rt(Fl(),"useNavigate() may be used only in the context of a <Router> component.");let n=h.useContext(Gl),{basename:a,navigator:l}=h.useContext(Zn),{matches:o}=h.useContext($a),{pathname:c}=Bn(),u=JSON.stringify(Rm(o)),f=h.useRef(!1);return x0(()=>{f.current=!0}),h.useCallback((g,v={})=>{if(ha(f.current,v0),!f.current)return;if(typeof g=="number"){l.go(g);return}let x=Su(g,JSON.parse(u),c,v.relative==="path");n==null&&a!=="/"&&(x.pathname=x.pathname==="/"?a:Ca([a,x.pathname])),(v.replace?l.replace:l.push)(x,v.state,v)},[a,l,u,c,n])}h.createContext(null);function gi(n,{relative:a}={}){let{matches:l}=h.useContext($a),{pathname:o}=Bn(),c=JSON.stringify(Rm(l));return h.useMemo(()=>Su(n,JSON.parse(c),o,a==="path"),[n,c,o,a])}function fN(n,a){return y0(n,a)}function y0(n,a,l){var C;Rt(Fl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=h.useContext(Zn),{matches:c}=h.useContext($a),u=c[c.length-1],f=u?u.params:{},p=u?u.pathname:"/",g=u?u.pathnameBase:"/",v=u&&u.route;{let R=v&&v.path||"";w0(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=Bn(),y;if(a){let R=typeof a=="string"?Yl(a):a;Rt(g==="/"||((C=R.pathname)==null?void 0:C.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 b=y.pathname||"/",w=b;if(g!=="/"){let R=g.replace(/^\//,"").split("/");w="/"+b.replace(/^\//,"").split("/").slice(R.length).join("/")}let N=l&&l.state.matches.length?l.state.matches.map(R=>Object.assign(R,{route:l.manifest[R.route.id]||R.route})):s0(n,{pathname:w});ha(v||N!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),ha(N==null||N[N.length-1].route.element!==void 0||N[N.length-1].route.Component!==void 0||N[N.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 S=vN(N&&N.map(R=>Object.assign({},R,{params:Object.assign({},f,R.params),pathname:Ca([g,o.encodeLocation?o.encodeLocation(R.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?g:Ca([g,o.encodeLocation?o.encodeLocation(R.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),c,l);return a&&S?h.createElement(mi.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...y},navigationType:"POP"}},S):S}function hN(){let n=jN(),a=J2(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),l=n instanceof Error?n.stack:null,o="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:o},u={padding:"2px 4px",backgroundColor:o},f=null;return console.error("Error handled by React Router default ErrorBoundary:",n),f=h.createElement(h.Fragment,null,h.createElement("p",null,"💿 Hey developer 👋"),h.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",h.createElement("code",{style:u},"ErrorBoundary")," or"," ",h.createElement("code",{style:u},"errorElement")," prop on your route.")),h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},a),l?h.createElement("pre",{style:c},l):null,f)}var mN=h.createElement(hN,null),b0=class extends h.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,a){return a.location!==n.location||a.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:a.error,location:a.location,revalidation:n.revalidation||a.revalidation}}componentDidCatch(n,a){this.props.onError?this.props.onError(n,a):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 l=cN(n.digest);l&&(n=l)}let a=n!==void 0?h.createElement($a.Provider,{value:this.props.routeContext},h.createElement(Tm.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?h.createElement(pN,{error:n},a):a}};b0.contextType=m0;var bh=new WeakMap;function pN({children:n,error:a}){let{basename:l}=h.useContext(Zn);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let o=iN(a.digest);if(o){let c=bh.get(a);if(c)throw c;let u=f0(o.location,l),f=u.absoluteURL||u.to;if(nN(f))throw new Error("Invalid redirect location");if(d0&&!bh.get(a))if(u.isExternal||o.reloadDocument)window.location.href=f;else{const p=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:o.replace}));throw bh.set(a,p),p}return h.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f}`})}}return n}function gN({routeContext:n,match:a,children:l}){let o=h.useContext(Gl);return o&&o.static&&o.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=a.route.id),h.createElement($a.Provider,{value:n},l)}function vN(n,a=[],l){let o=l==null?void 0:l.state;if(n==null){if(!o)return null;if(o.errors)n=o.matches;else if(a.length===0&&!o.initialized&&o.matches.length>0)n=o.matches;else return null}let c=n,u=o==null?void 0:o.errors;if(u!=null){let x=c.findIndex(y=>y.route.id&&(u==null?void 0:u[y.route.id])!==void 0);Rt(x>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),c=c.slice(0,Math.min(c.length,x+1))}let f=!1,p=-1;if(l&&o){f=o.renderFallback;for(let x=0;x<c.length;x++){let y=c[x];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(p=x),y.route.id){let{loaderData:b,errors:w}=o,N=y.route.loader&&!b.hasOwnProperty(y.route.id)&&(!w||w[y.route.id]===void 0);if(y.route.lazy||N){l.isStatic&&(f=!0),p>=0?c=c.slice(0,p+1):c=[c[0]];break}}}}let g=l==null?void 0:l.onError,v=o&&g?(x,y)=>{var b,w;g(x,{location:o.location,params:((w=(b=o.matches)==null?void 0:b[0])==null?void 0:w.params)??{},pattern:W2(o.matches),errorInfo:y})}:void 0;return c.reduceRight((x,y,b)=>{let w,N=!1,S=null,C=null;o&&(w=u&&y.route.id?u[y.route.id]:void 0,S=y.route.errorElement||mN,f&&(p<0&&b===0?(w0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),N=!0,C=null):p===b&&(N=!0,C=y.route.hydrateFallbackElement||null)));let R=a.concat(c.slice(0,b+1)),D=()=>{let A;return w?A=S:N?A=C:y.route.Component?A=h.createElement(y.route.Component,null):y.route.element?A=y.route.element:A=x,h.createElement(gN,{match:y,routeContext:{outlet:x,matches:R,isDataRoute:o!=null},children:A})};return o&&(y.route.ErrorBoundary||y.route.errorElement||b===0)?h.createElement(b0,{location:o.location,revalidation:o.revalidation,component:S,error:w,children:D(),routeContext:{outlet:null,matches:R,isDataRoute:!0},onError:v}):D()},null)}function Am(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function xN(n){let a=h.useContext(Gl);return Rt(a,Am(n)),a}function yN(n){let a=h.useContext(Cu);return Rt(a,Am(n)),a}function bN(n){let a=h.useContext($a);return Rt(a,Am(n)),a}function Mm(n){let a=bN(n),l=a.matches[a.matches.length-1];return Rt(l.route.id,`${n} can only be used on routes that contain a unique "id"`),l.route.id}function wN(){return Mm("useRouteId")}function jN(){var o;let n=h.useContext(Tm),a=yN("useRouteError"),l=Mm("useRouteError");return n!==void 0?n:(o=a.errors)==null?void 0:o[l]}function SN(){let{router:n}=xN("useNavigate"),a=Mm("useNavigate"),l=h.useRef(!1);return x0(()=>{l.current=!0}),h.useCallback(async(c,u={})=>{ha(l.current,v0),l.current&&(typeof c=="number"?await n.navigate(c):await n.navigate(c,{fromRouteId:a,...u}))},[n,a])}var nb={};function w0(n,a,l){!a&&!nb[n]&&(nb[n]=!0,ha(!1,l))}h.memo(CN);function CN({routes:n,manifest:a,future:l,state:o,isStatic:c,onError:u}){return y0(n,void 0,{manifest:a,state:o,isStatic:c,onError:u})}function qh({to:n,replace:a,state:l,relative:o}){Rt(Fl(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=h.useContext(Zn);ha(!c,"<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:u}=h.useContext($a),{pathname:f}=Bn(),p=pi(),g=Su(n,Rm(u),f,o==="path"),v=JSON.stringify(g);return h.useEffect(()=>{p(JSON.parse(v),{replace:a,state:l,relative:o})},[p,v,o,a,l]),null}function Dn(n){Rt(!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 NN({basename:n="/",children:a=null,location:l,navigationType:o="POP",navigator:c,static:u=!1,useTransitions:f}){Rt(!Fl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=n.replace(/^\/*/,"/"),g=h.useMemo(()=>({basename:p,navigator:c,static:u,useTransitions:f,future:{}}),[p,c,u,f]);typeof l=="string"&&(l=Yl(l));let{pathname:v="/",search:x="",hash:y="",state:b=null,key:w="default",mask:N}=l,S=h.useMemo(()=>{let C=yr(v,p);return C==null?null:{location:{pathname:C,search:x,hash:y,state:b,key:w,mask:N},navigationType:o}},[p,v,x,y,b,w,o,N]);return ha(S!=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.`),S==null?null:h.createElement(Zn.Provider,{value:g},h.createElement(mi.Provider,{children:a,value:S}))}function j0({children:n,location:a}){return fN($h(n),a)}function $h(n,a=[]){let l=[];return h.Children.forEach(n,(o,c)=>{if(!h.isValidElement(o))return;let u=[...a,c];if(o.type===h.Fragment){l.push.apply(l,$h(o.props.children,u));return}Rt(o.type===Dn,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Rt(!o.props.index||!o.props.children,"An index route cannot have child routes.");let f={id:o.props.id||u.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(f.children=$h(o.props.children,u)),l.push(f)}),l}var eu="get",tu="application/x-www-form-urlencoded";function Nu(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function EN(n){return Nu(n)&&n.tagName.toLowerCase()==="button"}function RN(n){return Nu(n)&&n.tagName.toLowerCase()==="form"}function TN(n){return Nu(n)&&n.tagName.toLowerCase()==="input"}function AN(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function MN(n,a){return n.button===0&&(!a||a==="_self")&&!AN(n)}function Vh(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((a,l)=>{let o=n[l];return a.concat(Array.isArray(o)?o.map(c=>[l,c]):[[l,o]])},[]))}function DN(n,a){let l=Vh(n);return a&&a.forEach((o,c)=>{l.has(c)||a.getAll(c).forEach(u=>{l.append(c,u)})}),l}var Ic=null;function ON(){if(Ic===null)try{new FormData(document.createElement("form"),0),Ic=!1}catch{Ic=!0}return Ic}var kN=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function wh(n){return n!=null&&!kN.has(n)?(ha(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${tu}"`),null):n}function _N(n,a){let l,o,c,u,f;if(RN(n)){let p=n.getAttribute("action");o=p?yr(p,a):null,l=n.getAttribute("method")||eu,c=wh(n.getAttribute("enctype"))||tu,u=new FormData(n)}else if(EN(n)||TN(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(o=g?yr(g,a):null,l=n.getAttribute("formmethod")||p.getAttribute("method")||eu,c=wh(n.getAttribute("formenctype"))||wh(p.getAttribute("enctype"))||tu,u=new FormData(p,n),!ON()){let{name:v,type:x,value:y}=n;if(x==="image"){let b=v?`${v}.`:"";u.append(`${b}x`,"0"),u.append(`${b}y`,"0")}else v&&u.append(v,y)}}else{if(Nu(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');l=eu,o=null,c=tu,f=n}return u&&c==="text/plain"&&(f=u,u=void 0),{action:o,method:l.toLowerCase(),encType:c,formData:u,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Dm(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function S0(n,a,l,o){let c=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return l?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${o}`:c.pathname=`${c.pathname}.${o}`:c.pathname==="/"?c.pathname=`_root.${o}`:a&&yr(c.pathname,a)==="/"?c.pathname=`${cu(a)}/_root.${o}`:c.pathname=`${cu(c.pathname)}.${o}`,c}async function zN(n,a){if(n.id in a)return a[n.id];try{let l=await import(n.module);return a[n.id]=l,l}catch(l){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(l),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function LN(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 UN(n,a,l){let o=await Promise.all(n.map(async c=>{let u=a.routes[c.route.id];if(u){let f=await zN(u,l);return f.links?f.links():[]}return[]}));return HN(o.flat(1).filter(LN).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function ab(n,a,l,o,c,u){let f=(g,v)=>l[v]?g.route.id!==l[v].route.id:!0,p=(g,v)=>{var x;return l[v].pathname!==g.pathname||((x=l[v].route.path)==null?void 0:x.endsWith("*"))&&l[v].params["*"]!==g.params["*"]};return u==="assets"?a.filter((g,v)=>f(g,v)||p(g,v)):u==="data"?a.filter((g,v)=>{var y;let x=o.routes[g.route.id];if(!x||!x.hasLoader)return!1;if(f(g,v)||p(g,v))return!0;if(g.route.shouldRevalidate){let b=g.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:((y=l[0])==null?void 0:y.params)||{},nextUrl:new URL(n,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function IN(n,a,{includeHydrateFallback:l}={}){return PN(n.map(o=>{let c=a.routes[o.route.id];if(!c)return[];let u=[c.module];return c.clientActionModule&&(u=u.concat(c.clientActionModule)),c.clientLoaderModule&&(u=u.concat(c.clientLoaderModule)),l&&c.hydrateFallbackModule&&(u=u.concat(c.hydrateFallbackModule)),c.imports&&(u=u.concat(c.imports)),u}).flat(1))}function PN(n){return[...new Set(n)]}function BN(n){let a={},l=Object.keys(n).sort();for(let o of l)a[o]=n[o];return a}function HN(n,a){let l=new Set;return new Set(a),n.reduce((o,c)=>{let u=JSON.stringify(BN(c));return l.has(u)||(l.add(u),o.push({key:u,link:c})),o},[])}function Om(){let n=h.useContext(Gl);return Dm(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function qN(){let n=h.useContext(Cu);return Dm(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var km=h.createContext(void 0);km.displayName="FrameworkContext";function Eu(){let n=h.useContext(km);return Dm(n,"You must render this element inside a <HydratedRouter> element"),n}function $N(n,a){let l=h.useContext(km),[o,c]=h.useState(!1),[u,f]=h.useState(!1),{onFocus:p,onBlur:g,onMouseEnter:v,onMouseLeave:x,onTouchStart:y}=a,b=h.useRef(null);h.useEffect(()=>{if(n==="render"&&f(!0),n==="viewport"){let S=R=>{R.forEach(D=>{f(D.isIntersecting)})},C=new IntersectionObserver(S,{threshold:.5});return b.current&&C.observe(b.current),()=>{C.disconnect()}}},[n]),h.useEffect(()=>{if(o){let S=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(S)}}},[o]);let w=()=>{c(!0)},N=()=>{c(!1),f(!1)};return l?n!=="intent"?[u,b,{}]:[u,b,{onFocus:Jo(p,w),onBlur:Jo(g,N),onMouseEnter:Jo(v,w),onMouseLeave:Jo(x,N),onTouchStart:Jo(y,w)}]:[!1,b,{}]}function Jo(n,a){return l=>{n&&n(l),l.defaultPrevented||a(l)}}function VN({page:n,...a}){let l=aN(),{nonce:o}=Eu(),{router:c}=Om(),u=h.useMemo(()=>s0(c.routes,n,c.basename),[c.routes,n,c.basename]);return u?(a.nonce==null&&o&&(a={...a,nonce:o}),l?h.createElement(GN,{page:n,matches:u,...a}):h.createElement(FN,{page:n,matches:u,...a})):null}function YN(n){let{manifest:a,routeModules:l}=Eu(),[o,c]=h.useState([]);return h.useEffect(()=>{let u=!1;return UN(n,a,l).then(f=>{u||c(f)}),()=>{u=!0}},[n,a,l]),o}function GN({page:n,matches:a,...l}){let o=Bn(),{future:c}=Eu(),{basename:u}=Om(),f=h.useMemo(()=>{if(n===o.pathname+o.search+o.hash)return[];let p=S0(n,u,c.v8_trailingSlashAwareDataRequests,"rsc"),g=!1,v=[];for(let x of a)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]},[u,c.v8_trailingSlashAwareDataRequests,n,o,a]);return h.createElement(h.Fragment,null,f.map(p=>h.createElement("link",{key:p,rel:"prefetch",as:"fetch",href:p,...l})))}function FN({page:n,matches:a,...l}){let o=Bn(),{future:c,manifest:u,routeModules:f}=Eu(),{basename:p}=Om(),{loaderData:g,matches:v}=qN(),x=h.useMemo(()=>ab(n,a,v,u,o,"data"),[n,a,v,u,o]),y=h.useMemo(()=>ab(n,a,v,u,o,"assets"),[n,a,v,u,o]),b=h.useMemo(()=>{if(n===o.pathname+o.search+o.hash)return[];let S=new Set,C=!1;if(a.forEach(D=>{var M;let A=u.routes[D.route.id];!A||!A.hasLoader||(!x.some(O=>O.route.id===D.route.id)&&D.route.id in g&&((M=f[D.route.id])!=null&&M.shouldRevalidate)||A.hasClientLoader?C=!0:S.add(D.route.id))}),S.size===0)return[];let R=S0(n,p,c.v8_trailingSlashAwareDataRequests,"data");return C&&S.size>0&&R.searchParams.set("_routes",a.filter(D=>S.has(D.route.id)).map(D=>D.route.id).join(",")),[R.pathname+R.search]},[p,c.v8_trailingSlashAwareDataRequests,g,o,u,x,a,n,f]),w=h.useMemo(()=>IN(y,u),[y,u]),N=YN(y);return h.createElement(h.Fragment,null,b.map(S=>h.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...l})),w.map(S=>h.createElement("link",{key:S,rel:"modulepreload",href:S,...l})),N.map(({key:S,link:C})=>h.createElement("link",{key:S,nonce:l.nonce,...C,crossOrigin:C.crossOrigin??l.crossOrigin})))}function XN(...n){return a=>{n.forEach(l=>{typeof l=="function"?l(a):l!=null&&(l.current=a)})}}var KN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{KN&&(window.__reactRouterVersion="7.18.2")}catch{}function QN({basename:n,children:a,useTransitions:l,window:o}){let c=h.useRef();c.current==null&&(c.current=A2({window:o,v5Compat:!0}));let u=c.current,[f,p]=h.useState({action:u.action,location:u.location}),g=h.useCallback(v=>{l===!1?p(v):h.startTransition(()=>p(v))},[l]);return h.useLayoutEffect(()=>u.listen(g),[u,g]),h.createElement(NN,{basename:n,children:a,location:f.location,navigationType:f.action,navigator:u,useTransitions:l})}var _s=h.forwardRef(function({onClick:a,discover:l="render",prefetch:o="none",relative:c,reloadDocument:u,replace:f,mask:p,state:g,target:v,to:x,preventScrollReset:y,viewTransition:b,defaultShouldRevalidate:w,...N},S){let{basename:C,navigator:R,useTransitions:D}=h.useContext(Zn),A=typeof x=="string"&&Em.test(x),M=f0(x,C);x=M.to;let O=uN(x,{relative:c}),E=Bn(),_=null;if(p){let B=Su(p,[],E.mask?E.mask.pathname:"/",!0);C!=="/"&&(B.pathname=B.pathname==="/"?C:Ca([C,B.pathname])),_=R.createHref(B)}let[U,$,te]=$N(o,N),V=WN(x,{replace:f,mask:p,state:g,target:v,preventScrollReset:y,relative:c,viewTransition:b,defaultShouldRevalidate:w,useTransitions:D});function H(B){a&&a(B),B.defaultPrevented||V(B)}let ae=!(M.isExternal||u),ee=h.createElement("a",{...N,...te,href:(ae?_:void 0)||M.absoluteURL||O,onClick:ae?H:a,ref:XN(S,$),target:v,"data-discover":!A&&l==="render"?"true":void 0});return U&&!A?h.createElement(h.Fragment,null,ee,h.createElement(VN,{page:O})):ee});_s.displayName="Link";var C0=h.forwardRef(function({"aria-current":a="page",caseSensitive:l=!1,className:o="",end:c=!1,style:u,to:f,viewTransition:p,children:g,...v},x){let y=gi(f,{relative:v.relative}),b=Bn(),w=h.useContext(Cu),{navigator:N,basename:S}=h.useContext(Zn),C=w!=null&&sE(y)&&p===!0,R=N.encodeLocation?N.encodeLocation(y).pathname:y.pathname,D=b.pathname,A=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;l||(D=D.toLowerCase(),A=A?A.toLowerCase():null,R=R.toLowerCase()),A&&S&&(A=yr(A,S)||A);const M=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let O=D===R||!c&&D.startsWith(R)&&D.charAt(M)==="/",E=A!=null&&(A===R||!c&&A.startsWith(R)&&A.charAt(R.length)==="/"),_={isActive:O,isPending:E,isTransitioning:C},U=O?a:void 0,$;typeof o=="function"?$=o(_):$=[o,O?"active":null,E?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let te=typeof u=="function"?u(_):u;return h.createElement(_s,{...v,"aria-current":U,className:$,ref:x,style:te,to:f,viewTransition:p},typeof g=="function"?g(_):g)});C0.displayName="NavLink";var ZN=h.forwardRef(({discover:n="render",fetcherKey:a,navigate:l,reloadDocument:o,replace:c,state:u,method:f=eu,action:p,onSubmit:g,relative:v,preventScrollReset:x,viewTransition:y,defaultShouldRevalidate:b,...w},N)=>{let{useTransitions:S}=h.useContext(Zn),C=aE(),R=rE(p,{relative:v}),D=f.toLowerCase()==="get"?"get":"post",A=typeof p=="string"&&Em.test(p),M=O=>{if(g&&g(O),O.defaultPrevented)return;O.preventDefault();let E=O.nativeEvent.submitter,_=(E==null?void 0:E.getAttribute("formmethod"))||f,U=()=>C(E||O.currentTarget,{fetcherKey:a,method:_,navigate:l,replace:c,state:u,relative:v,preventScrollReset:x,viewTransition:y,defaultShouldRevalidate:b});S&&l!==!1?h.startTransition(()=>U()):U()};return h.createElement("form",{ref:N,method:D,action:R,onSubmit:o?g:M,...w,"data-discover":!A&&n==="render"?"true":void 0})});ZN.displayName="Form";function JN(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function N0(n){let a=h.useContext(Gl);return Rt(a,JN(n)),a}function WN(n,{target:a,replace:l,mask:o,state:c,preventScrollReset:u,relative:f,viewTransition:p,defaultShouldRevalidate:g,useTransitions:v}={}){let x=pi(),y=Bn(),b=gi(n,{relative:f});return h.useCallback(w=>{if(MN(w,a)){w.preventDefault();let N=l!==void 0?l:ri(y)===ri(b),S=()=>x(n,{replace:N,mask:o,state:c,preventScrollReset:u,relative:f,viewTransition:p,defaultShouldRevalidate:g});v?h.startTransition(()=>S()):S()}},[y,x,b,l,o,c,a,n,u,f,p,g,v])}function eE(n){ha(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 a=h.useRef(Vh(n)),l=h.useRef(!1),o=Bn(),c=h.useMemo(()=>DN(o.search,l.current?null:a.current),[o.search]),u=pi(),f=h.useCallback((p,g)=>{const v=Vh(typeof p=="function"?p(new URLSearchParams(c)):p);l.current=!0,u("?"+v,g)},[u,c]);return[c,f]}var tE=0,nE=()=>`__${String(++tE)}__`;function aE(){let{router:n}=N0("useSubmit"),{basename:a}=h.useContext(Zn),l=wN(),o=n.fetch,c=n.navigate;return h.useCallback(async(u,f={})=>{let{action:p,method:g,encType:v,formData:x,body:y}=_N(u,a);if(f.navigate===!1){let b=f.fetcherKey||nE();await o(b,l,f.action||p,{defaultShouldRevalidate:f.defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:x,body:y,formMethod:f.method||g,formEncType:f.encType||v,flushSync:f.flushSync})}else await c(f.action||p,{defaultShouldRevalidate:f.defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:x,body:y,formMethod:f.method||g,formEncType:f.encType||v,replace:f.replace,state:f.state,fromRouteId:l,flushSync:f.flushSync,viewTransition:f.viewTransition})},[o,c,a,l])}function rE(n,{relative:a}={}){let{basename:l}=h.useContext(Zn),o=h.useContext($a);Rt(o,"useFormAction must be used inside a RouteContext");let[c]=o.matches.slice(-1),u={...gi(n||".",{relative:a})},f=Bn();if(n==null){u.search=f.search;let p=new URLSearchParams(u.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();u.search=x?`?${x}`:""}}return(!n||n===".")&&c.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),l!=="/"&&(u.pathname=u.pathname==="/"?l:Ca([l,u.pathname])),ri(u)}function sE(n,{relative:a}={}){let l=h.useContext(p0);Rt(l!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=N0("useViewTransitionState"),c=gi(n,{relative:a});if(!l.isTransitioning)return!1;let u=yr(l.currentLocation.pathname,o)||l.currentLocation.pathname,f=yr(l.nextLocation.pathname,o)||l.nextLocation.pathname;return iu(c.pathname,f)!=null||iu(c.pathname,u)!=null}var Sa=a0();const lE=Cm(Sa),Ru="",uu="x-csrf-token",rb=new Set(["/api/admin/login","/api/admin/setup"]);let zs=null,jh=null;async function _m(){return zs||(jh??(jh=fetch(`${Ru}/api/admin/csrf`,{credentials:"include"}).then(async n=>{if(!n.ok)throw new Error("Unable to acquire CSRF token");return zs=(await n.json()).csrfToken,zs}).finally(()=>{jh=null})),jh)}class zm extends Error{constructor(a,l,o){var c;super(typeof o=="object"&&o&&"error"in o?String(((c=o.error)==null?void 0:c.message)??o):"Request failed"),this.status=a,this.type=l,this.body=o}}async function E0(n){var o;const a=await n.text();let l;try{l=a?JSON.parse(a):void 0}catch{l=a}if(!n.ok)throw new zm(n.status,typeof l=="object"&&l&&"error"in l?String(((o=l.error)==null?void 0:o.type)??"error"):"error",l);return l}async function Ll(n,a,l,o,c=!0){const u=l!==void 0,f={...o==null?void 0:o.headers};u&&!f["content-type"]&&(f["content-type"]="application/json"),n!=="GET"&&n!=="HEAD"&&!rb.has(a)&&!f[uu]&&(f[uu]=await _m());const p=await fetch(`${Ru}${a}`,{...o,method:n,headers:f,body:u?JSON.stringify(l):void 0,credentials:"include"});try{return await E0(p)}catch(g){const v=g instanceof zm&&(g.status===401||g.status===403)&&(g.type==="authentication_error"||g.type==="csrf_error");if(c&&v&&n!=="GET"&&n!=="HEAD"&&!rb.has(a))return zs=null,Ll(n,a,l,o,!1);throw g}}async function R0(n,a,l=!0){const o=await fetch(`${Ru}${n}`,{method:"POST",headers:{[uu]:await _m()},body:a,credentials:"include"});try{return await E0(o)}catch(c){const u=c instanceof zm&&(c.status===401||c.status===403)&&(c.type==="authentication_error"||c.type==="csrf_error");if(l&&u)return zs=null,R0(n,a,!1);throw c}}async function du(n,a,l=!0){const o={...a==null?void 0:a.headers,[uu]:await _m()},c=await fetch(`${Ru}${n}`,{...a,headers:o,credentials:"include"});return l&&c.status===403?(zs=null,du(n,a,!1)):c}const ge={get:(n,a)=>Ll("GET",n,void 0,a),post:(n,a,l)=>Ll("POST",n,a,l),upload:R0,patch:(n,a,l)=>Ll("PATCH",n,a,l),put:(n,a,l)=>Ll("PUT",n,a,l),del:(n,a)=>Ll("DELETE",n,void 0,a)},T0=h.createContext(void 0);function oE({children:n}){const[a,l]=h.useState(null),[o,c]=h.useState(!0),u=h.useCallback(async()=>{try{const g=await ge.get("/api/admin/me");l(g)}catch{l(null)}finally{c(!1)}},[]);h.useEffect(()=>{u()},[u]);const f=h.useCallback(async(g,v,x,y)=>{const b={username:g,password:v};x&&(b.totp=x),y&&(b.recoveryCode=y);try{const w=await ge.post("/api/admin/login",b);return l({id:"admin",username:w.username,totpEnabled:w.totpEnabled}),{totpRequired:!1}}catch(w){const N=w.status,S=w.type;if(N===401&&S==="totp_required")return{totpRequired:!0};throw w}},[]),p=h.useCallback(async()=>{await ge.post("/api/admin/logout"),l(null)},[]);return s.jsx(T0.Provider,{value:{user:a,loading:o,login:f,logout:p,refresh:u},children:n})}function Lm(){const n=h.useContext(T0);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 iE=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),A0=(...n)=>n.filter((a,l,o)=>!!a&&a.trim()!==""&&o.indexOf(a)===l).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 cE={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
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 uE=h.forwardRef(({color:n="currentColor",size:a=24,strokeWidth:l=2,absoluteStrokeWidth:o,className:c="",children:u,iconNode:f,...p},g)=>h.createElement("svg",{ref:g,...cE,width:a,height:a,stroke:n,strokeWidth:o?Number(l)*24/Number(a):l,className:A0("lucide",c),...p},[...f.map(([v,x])=>h.createElement(v,x)),...Array.isArray(u)?u:[u]]));/**
|
|
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 Me=(n,a)=>{const l=h.forwardRef(({className:o,...c},u)=>h.createElement(uE,{ref:u,iconNode:a,className:A0(`lucide-${iE(n)}`,o),...c}));return l.displayName=`${n}`,l};/**
|
|
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 M0=Me("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 dE=Me("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 fE=Me("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 hE=Me("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 Um=Me("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 D0=Me("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 O0=Me("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
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 Im=Me("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
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 mE=Me("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"}]]);/**
|
|
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 Tu=Me("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
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 pE=Me("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"}]]);/**
|
|
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 gE=Me("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
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 vE=Me("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"}]]);/**
|
|
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 xE=Me("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"}]]);/**
|
|
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 nu=Me("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"}]]);/**
|
|
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 yE=Me("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"}]]);/**
|
|
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 bE=Me("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"}]]);/**
|
|
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 Pm=Me("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"}]]);/**
|
|
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 wE=Me("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
|
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 jE=Me("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"}]]);/**
|
|
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 SE=Me("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"}]]);/**
|
|
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 CE=Me("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"}]]);/**
|
|
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 k0=Me("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
|
|
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 _0=Me("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
|
|
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 z0=Me("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"}]]);/**
|
|
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 L0=Me("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"}]]);/**
|
|
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 NE=Me("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
|
|
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 pr=Me("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
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 EE=Me("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"}]]);/**
|
|
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 RE=Me("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"}]]);/**
|
|
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 TE=Me("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
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 U0=Me("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"}]]);/**
|
|
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 AE=Me("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"}]]);/**
|
|
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 ME=Me("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
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 Xl=Me("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
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 Bm=Me("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
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 DE=Me("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
|
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 OE=Me("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"}]]);/**
|
|
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 kE=Me("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"}]]);/**
|
|
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 Hm=Me("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
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 _E=Me("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
|
|
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 zE=Me("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"}]]);/**
|
|
291
|
-
* @license lucide-react v0.469.0 - ISC
|
|
292
|
-
*
|
|
293
|
-
* This source code is licensed under the ISC license.
|
|
294
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
295
|
-
*/const LE=Me("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"}]]);/**
|
|
296
|
-
* @license lucide-react v0.469.0 - ISC
|
|
297
|
-
*
|
|
298
|
-
* This source code is licensed under the ISC license.
|
|
299
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
300
|
-
*/const UE=Me("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"}]]);/**
|
|
301
|
-
* @license lucide-react v0.469.0 - ISC
|
|
302
|
-
*
|
|
303
|
-
* This source code is licensed under the ISC license.
|
|
304
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
305
|
-
*/const IE=Me("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"}]]);/**
|
|
306
|
-
* @license lucide-react v0.469.0 - ISC
|
|
307
|
-
*
|
|
308
|
-
* This source code is licensed under the ISC license.
|
|
309
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
310
|
-
*/const Kl=Me("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"}]]);/**
|
|
311
|
-
* @license lucide-react v0.469.0 - ISC
|
|
312
|
-
*
|
|
313
|
-
* This source code is licensed under the ISC license.
|
|
314
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
315
|
-
*/const PE=Me("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"}]]);/**
|
|
316
|
-
* @license lucide-react v0.469.0 - ISC
|
|
317
|
-
*
|
|
318
|
-
* This source code is licensed under the ISC license.
|
|
319
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
320
|
-
*/const I0=Me("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
|
|
321
|
-
* @license lucide-react v0.469.0 - ISC
|
|
322
|
-
*
|
|
323
|
-
* This source code is licensed under the ISC license.
|
|
324
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
325
|
-
*/const BE=Me("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/**
|
|
326
|
-
* @license lucide-react v0.469.0 - ISC
|
|
327
|
-
*
|
|
328
|
-
* This source code is licensed under the ISC license.
|
|
329
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
330
|
-
*/const HE=Me("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"}]]);/**
|
|
331
|
-
* @license lucide-react v0.469.0 - ISC
|
|
332
|
-
*
|
|
333
|
-
* This source code is licensed under the ISC license.
|
|
334
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
335
|
-
*/const Au=Me("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
336
|
-
* @license lucide-react v0.469.0 - ISC
|
|
337
|
-
*
|
|
338
|
-
* This source code is licensed under the ISC license.
|
|
339
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
340
|
-
*/const qE=Me("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 P0(n){var a,l,o="";if(typeof n=="string"||typeof n=="number")o+=n;else if(typeof n=="object")if(Array.isArray(n)){var c=n.length;for(a=0;a<c;a++)n[a]&&(l=P0(n[a]))&&(o&&(o+=" "),o+=l)}else for(l in n)n[l]&&(o&&(o+=" "),o+=l);return o}function B0(){for(var n,a,l=0,o="",c=arguments.length;l<c;l++)(n=arguments[l])&&(a=P0(n))&&(o&&(o+=" "),o+=a);return o}const qm="-",$E=n=>{const a=YE(n),{conflictingClassGroups:l,conflictingClassGroupModifiers:o}=n;return{getClassGroupId:f=>{const p=f.split(qm);return p[0]===""&&p.length!==1&&p.shift(),H0(p,a)||VE(f)},getConflictingClassGroupIds:(f,p)=>{const g=l[f]||[];return p&&o[f]?[...g,...o[f]]:g}}},H0=(n,a)=>{var f;if(n.length===0)return a.classGroupId;const l=n[0],o=a.nextPart.get(l),c=o?H0(n.slice(1),o):void 0;if(c)return c;if(a.validators.length===0)return;const u=n.join(qm);return(f=a.validators.find(({validator:p})=>p(u)))==null?void 0:f.classGroupId},sb=/^\[(.+)\]$/,VE=n=>{if(sb.test(n)){const a=sb.exec(n)[1],l=a==null?void 0:a.substring(0,a.indexOf(":"));if(l)return"arbitrary.."+l}},YE=n=>{const{theme:a,prefix:l}=n,o={nextPart:new Map,validators:[]};return FE(Object.entries(n.classGroups),l).forEach(([u,f])=>{Yh(f,o,u,a)}),o},Yh=(n,a,l,o)=>{n.forEach(c=>{if(typeof c=="string"){const u=c===""?a:lb(a,c);u.classGroupId=l;return}if(typeof c=="function"){if(GE(c)){Yh(c(o),a,l,o);return}a.validators.push({validator:c,classGroupId:l});return}Object.entries(c).forEach(([u,f])=>{Yh(f,lb(a,u),l,o)})})},lb=(n,a)=>{let l=n;return a.split(qm).forEach(o=>{l.nextPart.has(o)||l.nextPart.set(o,{nextPart:new Map,validators:[]}),l=l.nextPart.get(o)}),l},GE=n=>n.isThemeGetter,FE=(n,a)=>a?n.map(([l,o])=>{const c=o.map(u=>typeof u=="string"?a+u:typeof u=="object"?Object.fromEntries(Object.entries(u).map(([f,p])=>[a+f,p])):u);return[l,c]}):n,XE=n=>{if(n<1)return{get:()=>{},set:()=>{}};let a=0,l=new Map,o=new Map;const c=(u,f)=>{l.set(u,f),a++,a>n&&(a=0,o=l,l=new Map)};return{get(u){let f=l.get(u);if(f!==void 0)return f;if((f=o.get(u))!==void 0)return c(u,f),f},set(u,f){l.has(u)?l.set(u,f):c(u,f)}}},q0="!",KE=n=>{const{separator:a,experimentalParseClassName:l}=n,o=a.length===1,c=a[0],u=a.length,f=p=>{const g=[];let v=0,x=0,y;for(let C=0;C<p.length;C++){let R=p[C];if(v===0){if(R===c&&(o||p.slice(C,C+u)===a)){g.push(p.slice(x,C)),x=C+u;continue}if(R==="/"){y=C;continue}}R==="["?v++:R==="]"&&v--}const b=g.length===0?p:p.substring(x),w=b.startsWith(q0),N=w?b.substring(1):b,S=y&&y>x?y-x:void 0;return{modifiers:g,hasImportantModifier:w,baseClassName:N,maybePostfixModifierPosition:S}};return l?p=>l({className:p,parseClassName:f}):f},QE=n=>{if(n.length<=1)return n;const a=[];let l=[];return n.forEach(o=>{o[0]==="["?(a.push(...l.sort(),o),l=[]):l.push(o)}),a.push(...l.sort()),a},ZE=n=>({cache:XE(n.cacheSize),parseClassName:KE(n),...$E(n)}),JE=/\s+/,WE=(n,a)=>{const{parseClassName:l,getClassGroupId:o,getConflictingClassGroupIds:c}=a,u=[],f=n.trim().split(JE);let p="";for(let g=f.length-1;g>=0;g-=1){const v=f[g],{modifiers:x,hasImportantModifier:y,baseClassName:b,maybePostfixModifierPosition:w}=l(v);let N=!!w,S=o(N?b.substring(0,w):b);if(!S){if(!N){p=v+(p.length>0?" "+p:p);continue}if(S=o(b),!S){p=v+(p.length>0?" "+p:p);continue}N=!1}const C=QE(x).join(":"),R=y?C+q0:C,D=R+S;if(u.includes(D))continue;u.push(D);const A=c(S,N);for(let M=0;M<A.length;++M){const O=A[M];u.push(R+O)}p=v+(p.length>0?" "+p:p)}return p};function eR(){let n=0,a,l,o="";for(;n<arguments.length;)(a=arguments[n++])&&(l=$0(a))&&(o&&(o+=" "),o+=l);return o}const $0=n=>{if(typeof n=="string")return n;let a,l="";for(let o=0;o<n.length;o++)n[o]&&(a=$0(n[o]))&&(l&&(l+=" "),l+=a);return l};function tR(n,...a){let l,o,c,u=f;function f(g){const v=a.reduce((x,y)=>y(x),n());return l=ZE(v),o=l.cache.get,c=l.cache.set,u=p,p(g)}function p(g){const v=o(g);if(v)return v;const x=WE(g,l);return c(g,x),x}return function(){return u(eR.apply(null,arguments))}}const jt=n=>{const a=l=>l[n]||[];return a.isThemeGetter=!0,a},V0=/^\[(?:([a-z-]+):)?(.+)\]$/i,nR=/^\d+\/\d+$/,aR=new Set(["px","full","screen"]),rR=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,sR=/\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$/,lR=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,oR=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,iR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,fr=n=>Pl(n)||aR.has(n)||nR.test(n),es=n=>Ql(n,"length",gR),Pl=n=>!!n&&!Number.isNaN(Number(n)),Sh=n=>Ql(n,"number",Pl),Wo=n=>!!n&&Number.isInteger(Number(n)),cR=n=>n.endsWith("%")&&Pl(n.slice(0,-1)),Pe=n=>V0.test(n),ts=n=>rR.test(n),uR=new Set(["length","size","percentage"]),dR=n=>Ql(n,uR,Y0),fR=n=>Ql(n,"position",Y0),hR=new Set(["image","url"]),mR=n=>Ql(n,hR,xR),pR=n=>Ql(n,"",vR),ei=()=>!0,Ql=(n,a,l)=>{const o=V0.exec(n);return o?o[1]?typeof a=="string"?o[1]===a:a.has(o[1]):l(o[2]):!1},gR=n=>sR.test(n)&&!lR.test(n),Y0=()=>!1,vR=n=>oR.test(n),xR=n=>iR.test(n),yR=()=>{const n=jt("colors"),a=jt("spacing"),l=jt("blur"),o=jt("brightness"),c=jt("borderColor"),u=jt("borderRadius"),f=jt("borderSpacing"),p=jt("borderWidth"),g=jt("contrast"),v=jt("grayscale"),x=jt("hueRotate"),y=jt("invert"),b=jt("gap"),w=jt("gradientColorStops"),N=jt("gradientColorStopPositions"),S=jt("inset"),C=jt("margin"),R=jt("opacity"),D=jt("padding"),A=jt("saturate"),M=jt("scale"),O=jt("sepia"),E=jt("skew"),_=jt("space"),U=jt("translate"),$=()=>["auto","contain","none"],te=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto",Pe,a],H=()=>[Pe,a],ae=()=>["",fr,es],ee=()=>["auto",Pl,Pe],B=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],k=()=>["solid","dashed","dotted","double","none"],q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Z=()=>["start","end","center","between","around","evenly","stretch"],J=()=>["","0",Pe],ne=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>[Pl,Pe];return{cacheSize:500,separator:":",theme:{colors:[ei],spacing:[fr,es],blur:["none","",ts,Pe],brightness:z(),borderColor:[n],borderRadius:["none","","full",ts,Pe],borderSpacing:H(),borderWidth:ae(),contrast:z(),grayscale:J(),hueRotate:z(),invert:J(),gap:H(),gradientColorStops:[n],gradientColorStopPositions:[cR,es],inset:V(),margin:V(),opacity:z(),padding:H(),saturate:z(),scale:z(),sepia:J(),skew:z(),space:H(),translate:H()},classGroups:{aspect:[{aspect:["auto","square","video",Pe]}],container:["container"],columns:[{columns:[ts]}],"break-after":[{"break-after":ne()}],"break-before":[{"break-before":ne()}],"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:[...B(),Pe]}],overflow:[{overflow:te()}],"overflow-x":[{"overflow-x":te()}],"overflow-y":[{"overflow-y":te()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[S]}],"inset-x":[{"inset-x":[S]}],"inset-y":[{"inset-y":[S]}],start:[{start:[S]}],end:[{end:[S]}],top:[{top:[S]}],right:[{right:[S]}],bottom:[{bottom:[S]}],left:[{left:[S]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Wo,Pe]}],basis:[{basis:V()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Pe]}],grow:[{grow:J()}],shrink:[{shrink:J()}],order:[{order:["first","last","none",Wo,Pe]}],"grid-cols":[{"grid-cols":[ei]}],"col-start-end":[{col:["auto",{span:["full",Wo,Pe]},Pe]}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":[ei]}],"row-start-end":[{row:["auto",{span:[Wo,Pe]},Pe]}],"row-start":[{"row-start":ee()}],"row-end":[{"row-end":ee()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Pe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Pe]}],gap:[{gap:[b]}],"gap-x":[{"gap-x":[b]}],"gap-y":[{"gap-y":[b]}],"justify-content":[{justify:["normal",...Z()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Z(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Z(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[D]}],px:[{px:[D]}],py:[{py:[D]}],ps:[{ps:[D]}],pe:[{pe:[D]}],pt:[{pt:[D]}],pr:[{pr:[D]}],pb:[{pb:[D]}],pl:[{pl:[D]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[_]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[_]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Pe,a]}],"min-w":[{"min-w":[Pe,a,"min","max","fit"]}],"max-w":[{"max-w":[Pe,a,"none","full","min","max","fit","prose",{screen:[ts]},ts]}],h:[{h:[Pe,a,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Pe,a,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Pe,a,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Pe,a,"auto","min","max","fit"]}],"font-size":[{text:["base",ts,es]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Sh]}],"font-family":[{font:[ei]}],"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",Pe]}],"line-clamp":[{"line-clamp":["none",Pl,Sh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",fr,Pe]}],"list-image":[{"list-image":["none",Pe]}],"list-style-type":[{list:["none","disc","decimal",Pe]}],"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:[...k(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",fr,es]}],"underline-offset":[{"underline-offset":["auto",fr,Pe]}],"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:H()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Pe]}],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",Pe]}],"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:[...B(),fR]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",dR]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},mR]}],"bg-color":[{bg:[n]}],"gradient-from-pos":[{from:[N]}],"gradient-via-pos":[{via:[N]}],"gradient-to-pos":[{to:[N]}],"gradient-from":[{from:[w]}],"gradient-via":[{via:[w]}],"gradient-to":[{to:[w]}],rounded:[{rounded:[u]}],"rounded-s":[{"rounded-s":[u]}],"rounded-e":[{"rounded-e":[u]}],"rounded-t":[{"rounded-t":[u]}],"rounded-r":[{"rounded-r":[u]}],"rounded-b":[{"rounded-b":[u]}],"rounded-l":[{"rounded-l":[u]}],"rounded-ss":[{"rounded-ss":[u]}],"rounded-se":[{"rounded-se":[u]}],"rounded-ee":[{"rounded-ee":[u]}],"rounded-es":[{"rounded-es":[u]}],"rounded-tl":[{"rounded-tl":[u]}],"rounded-tr":[{"rounded-tr":[u]}],"rounded-br":[{"rounded-br":[u]}],"rounded-bl":[{"rounded-bl":[u]}],"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:[...k(),"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:k()}],"border-color":[{border:[c]}],"border-color-x":[{"border-x":[c]}],"border-color-y":[{"border-y":[c]}],"border-color-s":[{"border-s":[c]}],"border-color-e":[{"border-e":[c]}],"border-color-t":[{"border-t":[c]}],"border-color-r":[{"border-r":[c]}],"border-color-b":[{"border-b":[c]}],"border-color-l":[{"border-l":[c]}],"divide-color":[{divide:[c]}],"outline-style":[{outline:["",...k()]}],"outline-offset":[{"outline-offset":[fr,Pe]}],"outline-w":[{outline:[fr,es]}],"outline-color":[{outline:[n]}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[n]}],"ring-opacity":[{"ring-opacity":[R]}],"ring-offset-w":[{"ring-offset":[fr,es]}],"ring-offset-color":[{"ring-offset":[n]}],shadow:[{shadow:["","inner","none",ts,pR]}],"shadow-color":[{shadow:[ei]}],opacity:[{opacity:[R]}],"mix-blend":[{"mix-blend":[...q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":q()}],filter:[{filter:["","none"]}],blur:[{blur:[l]}],brightness:[{brightness:[o]}],contrast:[{contrast:[g]}],"drop-shadow":[{"drop-shadow":["","none",ts,Pe]}],grayscale:[{grayscale:[v]}],"hue-rotate":[{"hue-rotate":[x]}],invert:[{invert:[y]}],saturate:[{saturate:[A]}],sepia:[{sepia:[O]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[l]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"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":[A]}],"backdrop-sepia":[{"backdrop-sepia":[O]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[f]}],"border-spacing-x":[{"border-spacing-x":[f]}],"border-spacing-y":[{"border-spacing-y":[f]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Pe]}],duration:[{duration:z()}],ease:[{ease:["linear","in","out","in-out",Pe]}],delay:[{delay:z()}],animate:[{animate:["none","spin","ping","pulse","bounce",Pe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[M]}],"scale-x":[{"scale-x":[M]}],"scale-y":[{"scale-y":[M]}],rotate:[{rotate:[Wo,Pe]}],"translate-x":[{"translate-x":[U]}],"translate-y":[{"translate-y":[U]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Pe]}],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",Pe]}],"caret-color":[{caret:[n]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":H()}],"scroll-mx":[{"scroll-mx":H()}],"scroll-my":[{"scroll-my":H()}],"scroll-ms":[{"scroll-ms":H()}],"scroll-me":[{"scroll-me":H()}],"scroll-mt":[{"scroll-mt":H()}],"scroll-mr":[{"scroll-mr":H()}],"scroll-mb":[{"scroll-mb":H()}],"scroll-ml":[{"scroll-ml":H()}],"scroll-p":[{"scroll-p":H()}],"scroll-px":[{"scroll-px":H()}],"scroll-py":[{"scroll-py":H()}],"scroll-ps":[{"scroll-ps":H()}],"scroll-pe":[{"scroll-pe":H()}],"scroll-pt":[{"scroll-pt":H()}],"scroll-pr":[{"scroll-pr":H()}],"scroll-pb":[{"scroll-pb":H()}],"scroll-pl":[{"scroll-pl":H()}],"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",Pe]}],fill:[{fill:[n,"none"]}],"stroke-w":[{stroke:[fr,es,Sh]}],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"]}}},bR=tR(yR);function Re(...n){return bR(B0(n))}function Xt(n,a="—"){return n==null||Number.isNaN(n)?a:n.toLocaleString()}function Mu(n,a=1,l="—"){return n==null||Number.isNaN(n)?l:`${(n*100).toFixed(a)}%`}function Ls(n){return n?n<1e3?`${Math.round(n)} ms`:`${(n/1e3).toFixed(2)} s`:"—"}function $m(n){if(!n)return"—";try{return new Date(n).toLocaleString()}catch{return n}}function wR(n,a=8){return n?n.length>a?`${n.slice(0,a)}…`:n:"—"}function jR(n){if(!n)return"—";const a=Date.now()-new Date(n).getTime();if(!Number.isFinite(a)||a<0)return"—";const l=Math.floor(a/1e3);if(l<60)return`${l}s ago`;const o=Math.floor(l/60);if(o<60)return`${o}m ago`;const c=Math.floor(o/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}const SR=[{to:"/",label:"Dashboard",icon:k0,end:!0},{to:"/providers",label:"Providers",icon:U0},{to:"/models",label:"Models",icon:hE},{to:"/combos",label:"Combos",icon:L0},{to:"/aliases",label:"Aliases",icon:vE},{to:"/api-keys",label:"API Keys",icon:z0},{to:"/requests",label:"Requests",icon:M0},{to:"/statistics",label:"Statistics",icon:SE},{to:"/audit",label:"Audit Logs",icon:kE},{to:"/settings",label:"Settings",icon:xE}];function CR(){const[n,a]=h.useState(null);return h.useEffect(()=>{let l=!1;return fetch("/api/admin/settings/system",{credentials:"include"}).then(o=>o.ok?o.json():null).then(o=>{!l&&(o!=null&&o.appVersion)&&a(o.appVersion)}).catch(()=>{}),()=>{l=!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:SR.map(l=>s.jsxs(C0,{to:l.to,end:l.end,className:({isActive:o})=>Re("flex items-center gap-2 rounded-md px-3 py-2 text-sm transition-colors",o?"bg-primary/10 text-primary font-medium":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:[s.jsx(l.icon,{className:"h-4 w-4"}),l.label]},l.to))}),s.jsxs("div",{className:"border-t p-3 text-xs text-muted-foreground flex items-center gap-2",children:[s.jsx(zE,{className:"h-3.5 w-3.5 text-primary"})," ",n?`v${n}`:"v…"]})]})}var NR=Object.defineProperty,Vm=(n,a)=>NR(n,"name",{value:a,configurable:!0});function Gh(n,a){if(typeof n=="function")return n(a);n!=null&&(n.current=a)}Vm(Gh,"setRef");function G0(...n){return a=>{let l=!1;const o=n.map(c=>{const u=Gh(c,a);return!l&&typeof u=="function"&&(l=!0),u});if(l)return()=>{for(let c=0;c<o.length;c++){const u=o[c];typeof u=="function"?u():Gh(n[c],null)}}}}Vm(G0,"composeRefs");function Fe(...n){return h.useCallback(G0(...n),n)}Vm(Fe,"useComposedRefs");var ER=Object.defineProperty,Ra=(n,a)=>ER(n,"name",{value:a,configurable:!0});function Ua(n){const a=h.forwardRef((l,o)=>{let{children:c,...u}=l,f=null,p=!1;const g=[];Fh(c)&&typeof Pc=="function"&&(c=Pc(c._payload)),h.Children.forEach(c,b=>{var w;if(Z0(b)){p=!0;const N=b;let S="child"in N.props?N.props.child:N.props.children;Fh(S)&&typeof Pc=="function"&&(S=Pc(S._payload)),f=TR(N,S),g.push((w=f==null?void 0:f.props)==null?void 0:w.children)}else g.push(b)}),f?f=h.cloneElement(f,void 0,g):!p&&h.Children.count(c)===1&&h.isValidElement(c)&&(f=c);const v=f?Q0(f):void 0,x=Fe(o,v);if(!f){if(c||c===0)throw new Error(p?DR(n):MR(n));return c}const y=K0(u,f.props??{});return f.type!==h.Fragment&&(y.ref=o?x:v),h.cloneElement(f,y)});return a.displayName=`${n}.Slot`,a}Ra(Ua,"createSlot");var RR=Ua("Slot"),F0=Symbol.for("radix.slottable");function X0(n){const a=Ra(l=>"child"in l?l.children(l.child):l.children,"Slottable");return a.displayName=`${n}.Slottable`,a.__radixId=F0,a}Ra(X0,"createSlottable");var TR=Ra((n,a)=>{if("child"in n.props){const l=n.props.child;return h.isValidElement(l)?h.cloneElement(l,void 0,n.props.children(l.props.children)):null}return h.isValidElement(a)?a:null},"getSlottableElementFromSlottable");function K0(n,a){const l={...a};for(const o in a){const c=n[o],u=a[o];/^on[A-Z]/.test(o)?c&&u?l[o]=(...p)=>{const g=u(...p);return c(...p),g}:c&&(l[o]=c):o==="style"?l[o]={...c,...u}:o==="className"&&(l[o]=[c,u].filter(Boolean).join(" "))}return{...n,...l}}Ra(K0,"mergeProps");function Q0(n){var o,c;let a=(o=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?n.ref:(a=(c=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?n.props.ref:n.props.ref||n.ref)}Ra(Q0,"getElementRef");function Z0(n){return h.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===F0}Ra(Z0,"isSlottable");var AR=Symbol.for("react.lazy");function Fh(n){return n!=null&&typeof n=="object"&&"$$typeof"in n&&n.$$typeof===AR&&"_payload"in n&&J0(n._payload)}Ra(Fh,"isLazyComponent");function J0(n){return typeof n=="object"&&n!==null&&"then"in n}Ra(J0,"isPromiseLike");var MR=Ra(n=>`${n} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),DR=Ra(n=>`${n} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Pc=Vl[" use ".trim().toString()];const ob=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,ib=B0,W0=(n,a)=>l=>{var o;if((a==null?void 0:a.variants)==null)return ib(n,l==null?void 0:l.class,l==null?void 0:l.className);const{variants:c,defaultVariants:u}=a,f=Object.keys(c).map(v=>{const x=l==null?void 0:l[v],y=u==null?void 0:u[v];if(x===null)return null;const b=ob(x)||ob(y);return c[v][b]}),p=l&&Object.entries(l).reduce((v,x)=>{let[y,b]=x;return b===void 0||(v[y]=b),v},{}),g=a==null||(o=a.compoundVariants)===null||o===void 0?void 0:o.reduce((v,x)=>{let{class:y,className:b,...w}=x;return Object.entries(w).every(N=>{let[S,C]=N;return Array.isArray(C)?C.includes({...u,...p}[S]):{...u,...p}[S]===C})?[...v,y,b]:v},[]);return ib(n,f,g,l==null?void 0:l.class,l==null?void 0:l.className)},OR=W0("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"}}),ie=h.forwardRef(({className:n,variant:a,size:l,asChild:o=!1,...c},u)=>{const f=o?RR:"button";return s.jsx(f,{className:Re(OR({variant:a,size:l,className:n})),ref:u,...c})});ie.displayName="Button";const e1=h.createContext(void 0);function kR({children:n,defaultTheme:a="system",storageKey:l="latedev-theme"}){const[o,c]=h.useState(()=>localStorage.getItem(l)||a);h.useEffect(()=>{const f=window.document.documentElement;if(f.classList.remove("light","dark"),o==="system"){const p=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";f.classList.add(p);return}f.classList.add(o)},[o]);const u={theme:o,setTheme:f=>{localStorage.setItem(l,f),c(f)}};return s.jsx(e1.Provider,{value:u,children:n})}function _R(){const n=h.useContext(e1);if(!n)throw new Error("useTheme must be used within ThemeProvider");return n}var zR=Object.defineProperty,Zl=(n,a)=>zR(n,"name",{value:a,configurable:!0}),t1=!!(typeof window<"u"&&window.document&&window.document.createElement);function Se(n,a,{checkForDefaultPrevented:l=!0}={}){return Zl(function(c){if(n==null||n(c),l===!1||!c||!c.defaultPrevented)return a==null?void 0:a(c)},"handleEvent")}Zl(Se,"composeEventHandlers");function LR(n){var a;if(!t1)throw new Error("Cannot access window outside of the DOM");return((a=n==null?void 0:n.ownerDocument)==null?void 0:a.defaultView)??window}Zl(LR,"getOwnerWindow");function Xh(n){if(!t1)throw new Error("Cannot access document outside of the DOM");return(n==null?void 0:n.ownerDocument)??document}Zl(Xh,"getOwnerDocument");function n1(n,a=!1){const{activeElement:l}=Xh(n);if(!(l!=null&&l.nodeName))return null;if(a1(l)&&l.contentDocument)return n1(l.contentDocument.body,a);if(a){const o=l.getAttribute("aria-activedescendant");if(o){const c=Xh(l).getElementById(o);if(c)return c}}return l}Zl(n1,"getActiveElement");function a1(n){return n.tagName==="IFRAME"}Zl(a1,"isFrame");var UR=Object.defineProperty,fa=(n,a)=>UR(n,"name",{value:a,configurable:!0});function IR(n,a){const l=h.createContext(a);l.displayName=n+"Context";const o=fa(u=>{const{children:f,...p}=u,g=h.useMemo(()=>p,Object.values(p));return s.jsx(l.Provider,{value:g,children:f})},"Provider");o.displayName=n+"Provider";function c(u,f={}){const{optional:p=!1}=f,g=h.useContext(l);if(g)return g;if(a!==void 0)return a;if(!p)throw new Error(`\`${u}\` must be used within \`${n}\``)}return fa(c,"useContext"),[o,c]}fa(IR,"createContext");function Hn(n,a=[]){let l=[];function o(u,f){const p=h.createContext(f);p.displayName=u+"Context";const g=l.length;l=[...l,f];const v=fa(y=>{var R;const{scope:b,children:w,...N}=y,S=((R=b==null?void 0:b[n])==null?void 0:R[g])||p,C=h.useMemo(()=>N,Object.values(N));return s.jsx(S.Provider,{value:C,children:w})},"Provider");v.displayName=u+"Provider";function x(y,b,w={}){var R;const{optional:N=!1}=w,S=((R=b==null?void 0:b[n])==null?void 0:R[g])||p,C=h.useContext(S);if(C)return C;if(f!==void 0)return f;if(!N)throw new Error(`\`${y}\` must be used within \`${u}\``)}return fa(x,"useContext"),[v,x]}fa(o,"createContext");const c=fa(()=>{const u=l.map(f=>h.createContext(f));return fa(function(p){const g=(p==null?void 0:p[n])||u;return h.useMemo(()=>({[`__scope${n}`]:{...p,[n]:g}}),[p,g])},"useScope")},"createScope");return c.scopeName=n,[o,r1(c,...a)]}fa(Hn,"createContextScope");function r1(...n){const a=n[0];if(n.length===1)return a;const l=fa(()=>{const o=n.map(c=>({useScope:c(),scopeName:c.scopeName}));return fa(function(u){const f=o.reduce((p,{useScope:g,scopeName:v})=>{const y=g(u)[`__scope${v}`];return{...p,...y}},{});return h.useMemo(()=>({[`__scope${a.scopeName}`]:f}),[f])},"useComposedScopes")},"createScope");return l.scopeName=a.scopeName,l}fa(r1,"composeContextScopes");var Jt=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},PR=Object.defineProperty,BR=(n,a)=>PR(n,"name",{value:a,configurable:!0}),cb=Vl[" useEffectEvent ".trim().toString()],ub=Vl[" useInsertionEffect ".trim().toString()];function s1(n){if(typeof cb=="function")return cb(n);const a=h.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof ub=="function"?ub(()=>{a.current=n}):Jt(()=>{a.current=n}),h.useMemo(()=>((...l)=>{var o;return(o=a.current)==null?void 0:o.call(a,...l)}),[])}BR(s1,"useEffectEvent");var HR=Object.defineProperty,vi=(n,a)=>HR(n,"name",{value:a,configurable:!0}),qR=Vl[" useInsertionEffect ".trim().toString()]||Jt;function Ia({prop:n,defaultProp:a,onChange:l=vi(()=>{},"onChange"),caller:o}){const[c,u,f]=l1({defaultProp:a,onChange:l}),p=n!==void 0,g=p?n:c,v=h.useCallback(x=>{var y;if(p){const b=o1(x)?x(n):x;b!==n&&((y=f.current)==null||y.call(f,b))}else u(x)},[p,n,u,f]);return[g,v]}vi(Ia,"useControllableState");function l1({defaultProp:n,onChange:a}){const[l,o]=h.useState(n),c=h.useRef(l),u=h.useRef(a);return qR(()=>{u.current=a},[a]),h.useEffect(()=>{var f;c.current!==l&&((f=u.current)==null||f.call(u,l),c.current=l)},[l,c]),[l,o,u]}vi(l1,"useUncontrolledState");function o1(n){return typeof n=="function"}vi(o1,"isFunction");var db=Symbol("RADIX:SYNC_STATE");function $R(n,a,l,o){const{prop:c,defaultProp:u,onChange:f,caller:p}=a,g=c!==void 0,v=s1(f),x=[{...l,state:u}];o&&x.push(o);const[y,b]=h.useReducer((C,R)=>{if(R.type===db)return{...C,state:R.state};const D=n(C,R);return g&&!Object.is(D.state,C.state)&&v(D.state),D},...x),w=y.state,N=h.useRef(w);h.useEffect(()=>{N.current!==w&&(N.current=w,g||v(w))},[w,N,g]);const S=h.useMemo(()=>c!==void 0?{...y,state:c}:y,[y,c]);return h.useEffect(()=>{g&&!Object.is(c,y.state)&&b({type:db,state:c})},[c,y.state,g]),[S,b]}vi($R,"useControllableStateReducer");var VR=Object.defineProperty,YR=(n,a)=>VR(n,"name",{value:a,configurable:!0}),GR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],He=GR.reduce((n,a)=>{const l=Ua(`Primitive.${a}`),o=h.forwardRef((c,u)=>{const{asChild:f,...p}=c,g=f?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(g,{...p,ref:u})});return o.displayName=`Primitive.${a}`,{...n,[a]:o}},{});function Ym(n,a){n&&Sa.flushSync(()=>n.dispatchEvent(a))}YR(Ym,"dispatchDiscreteCustomEvent");var FR=Object.defineProperty,sn=(n,a)=>FR(n,"name",{value:a,configurable:!0});function Du(n){const a=n+"CollectionProvider",[l,o]=Hn(a),[c,u]=l(a,{collectionRef:{current:null},itemMap:new Map}),f=sn(S=>{const{scope:C,children:R}=S,D=h.useRef(null),A=h.useRef(new Map).current;return s.jsx(c,{scope:C,itemMap:A,collectionRef:D,children:R})},"CollectionProvider");f.displayName=a;const p=n+"CollectionSlot",g=Ua(p),v=h.forwardRef((S,C)=>{const{scope:R,children:D}=S,A=u(p,R),M=Fe(C,A.collectionRef);return s.jsx(g,{ref:M,children:D})});v.displayName=p;const x=n+"CollectionItemSlot",y="data-radix-collection-item",b=Ua(x),w=h.forwardRef((S,C)=>{const{scope:R,children:D,...A}=S,M=h.useRef(null),O=Fe(C,M),E=u(x,R);return h.useEffect(()=>(E.itemMap.set(M,{ref:M,...A}),()=>void E.itemMap.delete(M))),s.jsx(b,{[y]:"",ref:O,children:D})});w.displayName=x;function N(S){const C=u(n+"CollectionConsumer",S);return h.useCallback(()=>{const D=C.collectionRef.current;if(!D)return[];const A=Array.from(D.querySelectorAll(`[${y}]`));return Array.from(C.itemMap.values()).sort((E,_)=>A.indexOf(E.ref.current)-A.indexOf(_.ref.current))},[C.collectionRef,C.itemMap])}return sn(N,"useCollection"),[{Provider:f,Slot:v,ItemSlot:w},N,o]}sn(Du,"createCollection");var fb=new WeakMap,$t,Qn,Ch=(Qn=class extends Map{constructor(l){super(l);By(this,$t);fh(this,$t,[...super.keys()]),fb.set(this,!0)}set(l,o){return fb.get(this)&&(this.has(l)?gn(this,$t)[gn(this,$t).indexOf(l)]=l:gn(this,$t).push(l)),super.set(l,o),this}insert(l,o,c){const u=this.has(o),f=gn(this,$t).length,p=Gm(l);let g=p>=0?p:f+p;const v=g<0||g>=f?-1:g;if(v===this.size||u&&v===this.size-1||v===-1)return this.set(o,c),this;const x=this.size+(u?0:1);p<0&&g++;const y=[...gn(this,$t)];let b,w=!1;for(let N=g;N<x;N++)if(g===N){let S=y[N];y[N]===o&&(S=y[N+1]),u&&this.delete(o),b=this.get(S),this.set(o,c)}else{!w&&y[N-1]===o&&(w=!0);const S=y[w?N:N-1],C=b;b=this.get(S),this.delete(S),this.set(S,C)}return this}with(l,o,c){const u=new Qn(this);return u.insert(l,o,c),u}before(l){const o=gn(this,$t).indexOf(l)-1;if(!(o<0))return this.entryAt(o)}setBefore(l,o,c){const u=gn(this,$t).indexOf(l);return u===-1?this:this.insert(u,o,c)}after(l){let o=gn(this,$t).indexOf(l);if(o=o===-1||o===this.size-1?-1:o+1,o!==-1)return this.entryAt(o)}setAfter(l,o,c){const u=gn(this,$t).indexOf(l);return u===-1?this:this.insert(u+1,o,c)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return fh(this,$t,[]),super.clear()}delete(l){const o=super.delete(l);return o&&gn(this,$t).splice(gn(this,$t).indexOf(l),1),o}deleteAt(l){const o=this.keyAt(l);return o!==void 0?this.delete(o):!1}at(l){const o=au(gn(this,$t),l);if(o!==void 0)return this.get(o)}entryAt(l){const o=au(gn(this,$t),l);if(o!==void 0)return[o,this.get(o)]}indexOf(l){return gn(this,$t).indexOf(l)}keyAt(l){return au(gn(this,$t),l)}from(l,o){const c=this.indexOf(l);if(c===-1)return;let u=c+o;return u<0&&(u=0),u>=this.size&&(u=this.size-1),this.at(u)}keyFrom(l,o){const c=this.indexOf(l);if(c===-1)return;let u=c+o;return u<0&&(u=0),u>=this.size&&(u=this.size-1),this.keyAt(u)}find(l,o){let c=0;for(const u of this){if(Reflect.apply(l,o,[u,c,this]))return u;c++}}findIndex(l,o){let c=0;for(const u of this){if(Reflect.apply(l,o,[u,c,this]))return c;c++}return-1}filter(l,o){const c=[];let u=0;for(const f of this)Reflect.apply(l,o,[f,u,this])&&c.push(f),u++;return new Qn(c)}map(l,o){const c=[];let u=0;for(const f of this)c.push([f[0],Reflect.apply(l,o,[f,u,this])]),u++;return new Qn(c)}reduce(...l){const[o,c]=l;let u=0,f=c??this.at(0);for(const p of this)u===0&&l.length===1?f=p:f=Reflect.apply(o,this,[f,p,u,this]),u++;return f}reduceRight(...l){const[o,c]=l;let u=c??this.at(-1);for(let f=this.size-1;f>=0;f--){const p=this.at(f);f===this.size-1&&l.length===1?u=p:u=Reflect.apply(o,this,[u,p,f,this])}return u}toSorted(l){const o=[...this.entries()].sort(l);return new Qn(o)}toReversed(){const l=new Qn;for(let o=this.size-1;o>=0;o--){const c=this.keyAt(o),u=this.get(c);l.set(c,u)}return l}toSpliced(...l){const o=[...this.entries()];return o.splice(...l),new Qn(o)}slice(l,o){const c=new Qn;let u=this.size-1;if(l===void 0)return c;l<0&&(l=l+this.size),o!==void 0&&o>0&&(u=o-1);for(let f=l;f<=u;f++){const p=this.keyAt(f),g=this.get(p);c.set(p,g)}return c}every(l,o){let c=0;for(const u of this){if(!Reflect.apply(l,o,[u,c,this]))return!1;c++}return!0}some(l,o){let c=0;for(const u of this){if(Reflect.apply(l,o,[u,c,this]))return!0;c++}return!1}},$t=new WeakMap,sn(Qn,"OrderedDict"),Qn);function au(n,a){if("at"in Array.prototype)return Array.prototype.at.call(n,a);const l=i1(n,a);return l===-1?void 0:n[l]}sn(au,"at");function i1(n,a){const l=n.length,o=Gm(a),c=o>=0?o:l+o;return c<0||c>=l?-1:c}sn(i1,"toSafeIndex");function Gm(n){return n!==n||n===0?0:Math.trunc(n)}sn(Gm,"toSafeInteger");function XR(n){const a=n+"CollectionProvider",[l,o]=Hn(a),[c,u]=l(a,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Ch,setItemMap:sn(()=>{},"setItemMap")}),f=sn(({state:A,...M})=>A?s.jsx(g,{...M,state:A}):s.jsx(p,{...M}),"CollectionProvider");f.displayName=a;const p=sn(A=>{const M=C();return s.jsx(g,{...A,state:M})},"CollectionInit");p.displayName=a+"Init";const g=sn(A=>{const{scope:M,children:O,state:E}=A,_=h.useRef(null),[U,$]=h.useState(null),te=Fe(_,$),[V,H]=E;return h.useEffect(()=>{if(!U)return;const ae=d1(()=>{});return ae.observe(U,{childList:!0,subtree:!0}),()=>{ae.disconnect()}},[U]),s.jsx(c,{scope:M,itemMap:V,setItemMap:H,collectionRef:te,collectionRefObject:_,collectionElement:U,children:O})},"CollectionProviderImpl");g.displayName=a+"Impl";const v=n+"CollectionSlot",x=Ua(v),y=h.forwardRef((A,M)=>{const{scope:O,children:E}=A,_=u(v,O),U=Fe(M,_.collectionRef);return s.jsx(x,{ref:U,children:E})});y.displayName=v;const b=n+"CollectionItemSlot",w="data-radix-collection-item",N=Ua(b),S=h.forwardRef((A,M)=>{const{scope:O,children:E,..._}=A,U=h.useRef(null),[$,te]=h.useState(null),V=Fe(M,U,te),H=u(b,O),{setItemMap:ae}=H,ee=h.useRef(_);c1(ee.current,_)||(ee.current=_);const B=ee.current;return h.useEffect(()=>{const k=B;return ae(q=>$?q.has($)?q.set($,{...k,element:$}).toSorted(Kh):(q.set($,{...k,element:$}),q.toSorted(Kh)):q),()=>{ae(q=>!$||!q.has($)?q:(q.delete($),new Ch(q)))}},[$,B,ae]),s.jsx(N,{[w]:"",ref:V,children:E})});S.displayName=b;function C(){return h.useState(new Ch)}sn(C,"useInitCollection");function R(A){const{itemMap:M}=u(n+"CollectionConsumer",A);return M}return sn(R,"useCollection"),[{Provider:f,Slot:y,ItemSlot:S},{createCollectionScope:o,useCollection:R,useInitCollection:C}]}sn(XR,"createCollection");function c1(n,a){if(n===a)return!0;if(typeof n!="object"||typeof a!="object"||n==null||a==null)return!1;const l=Object.keys(n),o=Object.keys(a);if(l.length!==o.length)return!1;for(const c of l)if(!Object.prototype.hasOwnProperty.call(a,c)||n[c]!==a[c])return!1;return!0}sn(c1,"shallowEqual");function u1(n,a){return!!(a.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING)}sn(u1,"isElementPreceding");function Kh(n,a){return!n[1].element||!a[1].element?0:u1(n[1].element,a[1].element)?-1:1}sn(Kh,"sortByDocumentPosition");function d1(n){return new MutationObserver(l=>{for(const o of l)if(o.type==="childList"){n();return}})}sn(d1,"getChildListObserver");var KR=Object.defineProperty,QR=(n,a)=>KR(n,"name",{value:a,configurable:!0}),ZR=h.createContext(void 0);function xi(n){const a=h.useContext(ZR);return n||a||"ltr"}QR(xi,"useDirection");var JR=Object.defineProperty,WR=(n,a)=>JR(n,"name",{value:a,configurable:!0});function ma(n){const a=h.useRef(n);return h.useEffect(()=>{a.current=n}),h.useMemo(()=>((...l)=>{var o;return(o=a.current)==null?void 0:o.call(a,...l)}),[])}WR(ma,"useCallbackRef");var eT=Object.defineProperty,rn=(n,a)=>eT(n,"name",{value:a,configurable:!0}),Qh="dismissableLayer.update",tT="dismissableLayer.pointerDownOutside",nT="dismissableLayer.focusOutside",hb,f1=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ou=h.forwardRef(rn(function(a,l){const{disableOutsidePointerEvents:o=!1,deferPointerDownOutside:c=!1,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:g,onDismiss:v,...x}=a,y=h.useContext(f1),[b,w]=h.useState(null),N=(b==null?void 0:b.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,S]=h.useState({}),C=Fe(l,w),R=Array.from(y.layers),[D]=[...y.layersWithOutsidePointerEventsDisabled].slice(-1),A=D?R.indexOf(D):-1,M=b?R.indexOf(b):-1,O=y.layersWithOutsidePointerEventsDisabled.size>0,E=M>=A,_=h.useRef(!1),U=m1(H=>{f==null||f(H),g==null||g(H),H.defaultPrevented||v==null||v()},{ownerDocument:N,deferPointerDownOutside:c,isDeferredPointerDownOutsideRef:_,dismissableSurfaces:y.dismissableSurfaces,shouldHandlePointerDownOutside:h.useCallback(H=>{if(!(H instanceof Node))return!1;const ae=[...y.branches].some(ee=>ee.contains(H));return E&&!ae},[y.branches,E])}),$=p1(H=>{if(c&&_.current)return;const ae=H.target;[...y.branches].some(B=>B.contains(ae))||(p==null||p(H),g==null||g(H),H.defaultPrevented||v==null||v())},N),te=b?M===R.length-1:!1,V=ma(H=>{H.key==="Escape"&&(u==null||u(H),!H.defaultPrevented&&v&&(H.preventDefault(),v()))});return h.useEffect(()=>{if(te)return N.addEventListener("keydown",V,{capture:!0}),()=>N.removeEventListener("keydown",V,{capture:!0})},[N,te,V]),h.useEffect(()=>{if(b)return o&&(y.layersWithOutsidePointerEventsDisabled.size===0&&(hb=N.body.style.pointerEvents,N.body.style.pointerEvents="none"),y.layersWithOutsidePointerEventsDisabled.add(b)),y.layers.add(b),Zh(),()=>{o&&(y.layersWithOutsidePointerEventsDisabled.delete(b),y.layersWithOutsidePointerEventsDisabled.size===0&&(N.body.style.pointerEvents=hb))}},[b,N,o,y]),h.useEffect(()=>()=>{b&&(y.layers.delete(b),y.layersWithOutsidePointerEventsDisabled.delete(b),Zh())},[b,y]),h.useEffect(()=>{const H=rn(()=>S({}),"handleUpdate");return document.addEventListener(Qh,H),()=>document.removeEventListener(Qh,H)},[]),s.jsx(He.div,{...x,ref:C,style:{pointerEvents:O?E?"auto":"none":void 0,...a.style},onFocusCapture:Se(a.onFocusCapture,$.onFocusCapture),onBlurCapture:Se(a.onBlurCapture,$.onBlurCapture),onPointerDownCapture:Se(a.onPointerDownCapture,U.onPointerDownCapture)})},"DismissableLayer"));function h1(){const n=h.useContext(f1),[a,l]=h.useState(null);return h.useEffect(()=>{if(a)return n.dismissableSurfaces.add(a),()=>{n.dismissableSurfaces.delete(a)}},[a,n.dismissableSurfaces]),l}rn(h1,"useDismissableLayerSurface");var aT=rn(()=>!0,"IS_TRUE");function m1(n,a){const{ownerDocument:l=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:o=!1,isDeferredPointerDownOutsideRef:c,dismissableSurfaces:u,shouldHandlePointerDownOutside:f=aT}=a,p=ma(n),g=h.useRef(!1),v=h.useRef(!1),x=h.useRef(new Map),y=h.useRef(()=>{});return h.useEffect(()=>{function b(){v.current=!1,c.current=!1,x.current.clear()}rn(b,"resetOutsideInteraction");function w(){return Array.from(x.current.values()).some(Boolean)}rn(w,"isOutsideInteractionIntercepted");function N(A){if(!v.current)return;const M=A.target;M instanceof Node&&[...u].some(E=>E.contains(M))||x.current.set(A.type,!0),A.type==="click"&&window.setTimeout(()=>{v.current&&y.current()},0)}rn(N,"handleInteractionCapture");function S(A){v.current&&x.current.set(A.type,!1)}rn(S,"handleInteractionBubble");const C=rn(A=>{if(A.target&&!g.current){let M=function(){l.removeEventListener("click",y.current);const E=w();b(),E||Fm(tT,p,O,{discrete:!0})};if(rn(M,"handleAndDispatchPointerDownOutsideEvent"),!f(A.target)){l.removeEventListener("click",y.current),b(),g.current=!1;return}const O={originalEvent:A};v.current=!0,c.current=o&&A.button===0,x.current.clear(),!o||A.button!==0?M():(l.removeEventListener("click",y.current),y.current=M,l.addEventListener("click",y.current,{once:!0}))}else l.removeEventListener("click",y.current),b();g.current=!1},"handlePointerDown"),R=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const A of R)l.addEventListener(A,N,!0),l.addEventListener(A,S);const D=window.setTimeout(()=>{l.addEventListener("pointerdown",C)},0);return()=>{window.clearTimeout(D),l.removeEventListener("pointerdown",C),l.removeEventListener("click",y.current);for(const A of R)l.removeEventListener(A,N,!0),l.removeEventListener(A,S)}},[l,p,o,c,u,f]),{onPointerDownCapture:rn(()=>g.current=!0,"onPointerDownCapture")}}rn(m1,"usePointerDownOutside");function p1(n,a=globalThis==null?void 0:globalThis.document){const l=ma(n),o=h.useRef(!1);return h.useEffect(()=>{const c=rn(u=>{u.target&&!o.current&&Fm(nT,l,{originalEvent:u},{discrete:!1})},"handleFocus");return a.addEventListener("focusin",c),()=>a.removeEventListener("focusin",c)},[a,l]),{onFocusCapture:rn(()=>o.current=!0,"onFocusCapture"),onBlurCapture:rn(()=>o.current=!1,"onBlurCapture")}}rn(p1,"useFocusOutside");function Zh(){const n=new CustomEvent(Qh);document.dispatchEvent(n)}rn(Zh,"dispatchUpdate");function Fm(n,a,l,{discrete:o}){const c=l.originalEvent.target,u=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:l});a&&c.addEventListener(n,a,{once:!0}),o?Ym(c,u):c.dispatchEvent(u)}rn(Fm,"handleAndDispatchCustomEvent");var rT=Object.defineProperty,Xm=(n,a)=>rT(n,"name",{value:a,configurable:!0}),Bc=0,_a=null;function sT(n){return yi(),n.children}Xm(sT,"FocusGuards");function yi(){h.useEffect(()=>{_a||(_a={start:Jh(),end:Jh()});const{start:n,end:a}=_a;return document.body.firstElementChild!==n&&document.body.insertAdjacentElement("afterbegin",n),document.body.lastElementChild!==a&&document.body.insertAdjacentElement("beforeend",a),Bc++,()=>{Bc===1&&(_a==null||_a.start.remove(),_a==null||_a.end.remove(),_a=null),Bc=Math.max(0,Bc-1)}},[])}Xm(yi,"useFocusGuards");function Jh(){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}Xm(Jh,"createFocusGuard");var lT=Object.defineProperty,wn=(n,a)=>lT(n,"name",{value:a,configurable:!0}),Nh="focusScope.autoFocusOnMount",Eh="focusScope.autoFocusOnUnmount",mb={bubbles:!1,cancelable:!0},Km=h.forwardRef(wn(function(a,l){const{loop:o=!1,trapped:c=!1,onMountAutoFocus:u,onUnmountAutoFocus:f,...p}=a,[g,v]=h.useState(null),x=ma(u),y=ma(f),b=h.useRef(null),w=Fe(l,v),N=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(c){let C=function(M){if(N.paused||!g)return;const O=M.target;g.contains(O)?b.current=O:hr(b.current,{select:!0})},R=function(M){if(N.paused||!g)return;const O=M.relatedTarget;O!==null&&(g.contains(O)||hr(b.current,{select:!0}))},D=function(M){if(document.activeElement===document.body)for(const E of M)E.removedNodes.length>0&&hr(g)};wn(C,"handleFocusIn"),wn(R,"handleFocusOut"),wn(D,"handleMutations"),document.addEventListener("focusin",C),document.addEventListener("focusout",R);const A=new MutationObserver(D);return g&&A.observe(g,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",R),A.disconnect()}}},[c,g,N.paused]),h.useEffect(()=>{if(g){pb.add(N);const C=document.activeElement;if(!g.contains(C)){const D=new CustomEvent(Nh,mb);g.addEventListener(Nh,x),g.dispatchEvent(D),D.defaultPrevented||(g1(w1(Qm(g)),{select:!0}),document.activeElement===C&&hr(g))}return()=>{g.removeEventListener(Nh,x),setTimeout(()=>{const D=new CustomEvent(Eh,mb);g.addEventListener(Eh,y),g.dispatchEvent(D),D.defaultPrevented||hr(C??document.body,{select:!0}),g.removeEventListener(Eh,y),pb.remove(N)},0)}}},[g,x,y,N]);const S=h.useCallback(C=>{if(!o&&!c||N.paused)return;const R=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,D=document.activeElement;if(R&&D){const A=C.currentTarget,[M,O]=v1(A);M&&O?!C.shiftKey&&D===O?(C.preventDefault(),o&&hr(M,{select:!0})):C.shiftKey&&D===M&&(C.preventDefault(),o&&hr(O,{select:!0})):D===A&&C.preventDefault()}},[o,c,N.paused]);return s.jsx(He.div,{tabIndex:-1,...p,ref:w,onKeyDown:S})},"FocusScope"));function g1(n,{select:a=!1}={}){const l=document.activeElement;for(const o of n)if(hr(o,{select:a}),document.activeElement!==l)return}wn(g1,"focusFirst");function v1(n){const a=Qm(n),l=Wh(a,n),o=Wh(a.reverse(),n);return[l,o]}wn(v1,"getTabbableEdges");function Qm(n){const a=[],l=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:wn(o=>{const c=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||c?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;l.nextNode();)a.push(l.currentNode);return a}wn(Qm,"getTabbableCandidates");function Wh(n,a){const l=typeof a.checkVisibility=="function"&&a.checkVisibility({checkVisibilityCSS:!0});for(const o of n)if(!(l?!o.checkVisibility({checkVisibilityCSS:!0}):x1(o,{upTo:a})))return o}wn(Wh,"findVisible");function x1(n,{upTo:a}){if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(a!==void 0&&n===a)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1}wn(x1,"isHidden");function y1(n){return n instanceof HTMLInputElement&&"select"in n}wn(y1,"isSelectableInput");function hr(n,{select:a=!1}={}){if(n&&n.focus){const l=document.activeElement;n.focus({preventScroll:!0}),n!==l&&y1(n)&&a&&n.select()}}wn(hr,"focus");var pb=b1();function b1(){let n=[];return{add(a){const l=n[0];a!==l&&(l==null||l.pause()),n=em(n,a),n.unshift(a)},remove(a){var l;n=em(n,a),(l=n[0])==null||l.resume()}}}wn(b1,"createFocusScopesStack");function em(n,a){const l=[...n],o=l.indexOf(a);return o!==-1&&l.splice(o,1),l}wn(em,"arrayRemove");function w1(n){return n.filter(a=>a.tagName!=="A")}wn(w1,"removeLinks");var oT=Object.defineProperty,iT=(n,a)=>oT(n,"name",{value:a,configurable:!0}),cT=Vl[" useId ".trim().toString()]||(()=>{}),uT=0;function Na(n){const[a,l]=h.useState(cT());return Jt(()=>{n||l(o=>o??String(uT++))},[n]),n||(a?`radix-${a}`:"")}iT(Na,"useId");const dT=["top","right","bottom","left"],is=Math.min,gr=Math.max,fu=Math.round,Hc=Math.floor,vr=n=>({x:n,y:n}),fT={left:"right",right:"left",bottom:"top",top:"bottom"};function j1(n,a,l){return gr(n,is(a,l))}function br(n,a){return typeof n=="function"?n(a):n}function cs(n){return n.split("-")[0]}function Jl(n){return n.split("-")[1]}function Zm(n){return n==="x"?"y":"x"}function Jm(n){return n==="y"?"height":"width"}function La(n){const a=n[0];return a==="t"||a==="b"?"y":"x"}function Wm(n){return Zm(La(n))}function hT(n,a,l){l===void 0&&(l=!1);const o=Jl(n),c=Wm(n),u=Jm(c);let f=c==="x"?o===(l?"end":"start")?"right":"left":o==="start"?"bottom":"top";return a.reference[u]>a.floating[u]&&(f=hu(f)),[f,hu(f)]}function mT(n){const a=hu(n);return[tm(n),a,tm(a)]}function tm(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}const gb=["left","right"],vb=["right","left"],pT=["top","bottom"],gT=["bottom","top"];function vT(n,a,l){switch(n){case"top":case"bottom":return l?a?vb:gb:a?gb:vb;case"left":case"right":return a?pT:gT;default:return[]}}function xT(n,a,l,o){const c=Jl(n);let u=vT(cs(n),l==="start",o);return c&&(u=u.map(f=>f+"-"+c),a&&(u=u.concat(u.map(tm)))),u}function hu(n){const a=cs(n);return fT[a]+n.slice(a.length)}function yT(n){var a,l,o,c;return{top:(a=n.top)!=null?a:0,right:(l=n.right)!=null?l:0,bottom:(o=n.bottom)!=null?o:0,left:(c=n.left)!=null?c:0}}function S1(n){return typeof n!="number"?yT(n):{top:n,right:n,bottom:n,left:n}}function mu(n){const{x:a,y:l,width:o,height:c}=n;return{width:o,height:c,top:l,left:a,right:a+o,bottom:l+c,x:a,y:l}}function xb(n,a,l){let{reference:o,floating:c}=n;const u=La(a),f=Wm(a),p=Jm(f),g=cs(a),v=u==="y",x=o.x+o.width/2-c.width/2,y=o.y+o.height/2-c.height/2,b=o[p]/2-c[p]/2;let w;switch(g){case"top":w={x,y:o.y-c.height};break;case"bottom":w={x,y:o.y+o.height};break;case"right":w={x:o.x+o.width,y};break;case"left":w={x:o.x-c.width,y};break;default:w={x:o.x,y:o.y}}const N=Jl(a);return N&&(w[f]+=b*(N==="end"?1:-1)*(l&&v?-1:1)),w}async function bT(n,a){var l;a===void 0&&(a={});const{x:o,y:c,platform:u,rects:f,elements:p,strategy:g}=n,{boundary:v="clippingAncestors",rootBoundary:x="viewport",elementContext:y="floating",altBoundary:b=!1,padding:w=0}=br(a,n),N=S1(w),C=p[b?y==="floating"?"reference":"floating":y],R=mu(await u.getClippingRect({element:(l=await(u.isElement==null?void 0:u.isElement(C)))==null||l?C:C.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(p.floating)),boundary:v,rootBoundary:x,strategy:g})),D=y==="floating"?{x:o,y:c,width:f.floating.width,height:f.floating.height}:f.reference,A=await(u.getOffsetParent==null?void 0:u.getOffsetParent(p.floating)),M=await(u.isElement==null?void 0:u.isElement(A))&&await(u.getScale==null?void 0:u.getScale(A))||{x:1,y:1},O=mu(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:D,offsetParent:A,strategy:g}):D);return{top:(R.top-O.top+N.top)/M.y,bottom:(O.bottom-R.bottom+N.bottom)/M.y,left:(R.left-O.left+N.left)/M.x,right:(O.right-R.right+N.right)/M.x}}const wT=50,jT=async(n,a,l)=>{const{placement:o="bottom",strategy:c="absolute",middleware:u=[],platform:f}=l,p=f.detectOverflow?f:{...f,detectOverflow:bT},g=await(f.isRTL==null?void 0:f.isRTL(a));let v=await f.getElementRects({reference:n,floating:a,strategy:c}),{x,y}=xb(v,o,g),b=o,w=0;const N={};for(let S=0;S<u.length;S++){const C=u[S];if(!C)continue;const{name:R,fn:D}=C,{x:A,y:M,data:O,reset:E}=await D({x,y,initialPlacement:o,placement:b,strategy:c,middlewareData:N,rects:v,platform:p,elements:{reference:n,floating:a}});x=A??x,y=M??y,N[R]={...N[R],...O},E&&w<wT&&(w++,typeof E=="object"&&(E.placement&&(b=E.placement),E.rects&&(v=E.rects===!0?await f.getElementRects({reference:n,floating:a,strategy:c}):E.rects),{x,y}=xb(v,b,g)),S=-1)}return{x,y,placement:b,strategy:c,middlewareData:N}},ST=n=>({name:"arrow",options:n,async fn(a){const{x:l,y:o,placement:c,rects:u,platform:f,elements:p,middlewareData:g}=a,{element:v,padding:x=0}=br(n,a)||{};if(v==null)return{};const y=S1(x),b={x:l,y:o},w=Wm(c),N=Jm(w),S=await f.getDimensions(v),C=w==="y",R=C?"top":"left",D=C?"bottom":"right",A=C?"clientHeight":"clientWidth",M=u.reference[N]+u.reference[w]-b[w]-u.floating[N],O=b[w]-u.reference[w],E=await(f.getOffsetParent==null?void 0:f.getOffsetParent(v));let _=E?E[A]:0;(!_||!await(f.isElement==null?void 0:f.isElement(E)))&&(_=p.floating[A]||u.floating[N]);const U=M/2-O/2,$=_/2-S[N]/2-1,te=is(y[R],$),V=is(y[D],$),H=_-S[N]-V,ae=_/2-S[N]/2+U,ee=j1(te,ae,H),B=!g.arrow&&Jl(c)!=null&&ae!==ee&&u.reference[N]/2-(ae<te?te:V)-S[N]/2<0,k=B?ae<te?ae-te:ae-H:0;return{[w]:b[w]+k,data:{[w]:ee,centerOffset:ae-ee-k,...B&&{alignmentOffset:k}},reset:B}}}),CT=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(a){var l,o;const{placement:c,middlewareData:u,rects:f,initialPlacement:p,platform:g,elements:v}=a,{mainAxis:x=!0,crossAxis:y=!0,fallbackPlacements:b,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:N="none",flipAlignment:S=!0,...C}=br(n,a);if((l=u.arrow)!=null&&l.alignmentOffset)return{};const R=cs(c),D=La(p),A=cs(p)===p,M=await(g.isRTL==null?void 0:g.isRTL(v.floating)),O=b||(A||!S?[hu(p)]:mT(p)),E=N!=="none";!b&&E&&O.push(...xT(p,S,N,M));const _=[p,...O],U=await g.detectOverflow(a,C),$=[];let te=((o=u.flip)==null?void 0:o.overflows)||[];if(x&&$.push(U[R]),y){const ee=hT(c,f,M);$.push(U[ee[0]],U[ee[1]])}if(te=[...te,{placement:c,overflows:$}],!$.every(ee=>ee<=0)){var V,H;const ee=(((V=u.flip)==null?void 0:V.index)||0)+1,B=_[ee];if(B&&(!(y==="alignment"?D!==La(B):!1)||te.every(Z=>La(Z.placement)===D?Z.overflows[0]>0:!0)))return{data:{index:ee,overflows:te},reset:{placement:B}};let k=(H=te.filter(q=>q.overflows[0]<=0).sort((q,Z)=>q.overflows[1]-Z.overflows[1])[0])==null?void 0:H.placement;if(!k)switch(w){case"bestFit":{var ae;const q=(ae=te.filter(Z=>{if(E){const J=La(Z.placement);return J===D||J==="y"}return!0}).map(Z=>[Z.placement,Z.overflows.filter(J=>J>0).reduce((J,ne)=>J+ne,0)]).sort((Z,J)=>Z[1]-J[1])[0])==null?void 0:ae[0];q&&(k=q);break}case"initialPlacement":k=p;break}if(c!==k)return{reset:{placement:k}}}return{}}}};function yb(n,a){return{top:n.top-a.height,right:n.right-a.width,bottom:n.bottom-a.height,left:n.left-a.width}}function bb(n){return dT.some(a=>n[a]>=0)}const NT=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(a){const{rects:l,platform:o}=a,{strategy:c="referenceHidden",...u}=br(n,a);switch(c){case"referenceHidden":{const f=await o.detectOverflow(a,{...u,elementContext:"reference"}),p=yb(f,l.reference);return{data:{referenceHiddenOffsets:p,referenceHidden:bb(p)}}}case"escaped":{const f=await o.detectOverflow(a,{...u,altBoundary:!0}),p=yb(f,l.floating);return{data:{escapedOffsets:p,escaped:bb(p)}}}default:return{}}}}},C1=new Set(["left","top"]);async function ET(n,a){const{placement:l,platform:o,elements:c}=n,u=await(o.isRTL==null?void 0:o.isRTL(c.floating)),f=cs(l),p=Jl(l),g=La(l)==="y",v=C1.has(f)?-1:1,x=u&&g?-1:1,y=br(a,n);let{mainAxis:b,crossAxis:w,alignmentAxis:N}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return p&&typeof N=="number"&&(w=p==="end"?N*-1:N),g?{x:w*x,y:b*v}:{x:b*v,y:w*x}}const RT=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(a){var l,o;const{x:c,y:u,placement:f,middlewareData:p}=a,g=await ET(a,n);return f===((l=p.offset)==null?void 0:l.placement)&&(o=p.arrow)!=null&&o.alignmentOffset?{}:{x:c+g.x,y:u+g.y,data:{...g,placement:f}}}}},TT=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(a){const{x:l,y:o,placement:c,platform:u}=a,{mainAxis:f=!0,crossAxis:p=!1,limiter:g={fn:D=>{let{x:A,y:M}=D;return{x:A,y:M}}},...v}=br(n,a),x={x:l,y:o},y=await u.detectOverflow(a,v),b=La(c),w=Zm(b);let N=x[w],S=x[b];const C=(D,A)=>j1(A+y[D==="y"?"top":"left"],A,A-y[D==="y"?"bottom":"right"]);f&&(N=C(w,N)),p&&(S=C(b,S));const R=g.fn({...a,[w]:N,[b]:S});return{...R,data:{x:R.x-l,y:R.y-o,enabled:{[w]:f,[b]:p}}}}}},AT=function(n){return n===void 0&&(n={}),{options:n,fn(a){var l,o;const{x:c,y:u,placement:f,rects:p,middlewareData:g}=a,{offset:v=0,mainAxis:x=!0,crossAxis:y=!0}=br(n,a),b={x:c,y:u},w=La(f),N=Zm(w);let S=b[N],C=b[w];const R=br(v,a),D=typeof R=="number"?{mainAxis:R,crossAxis:0}:{mainAxis:(l=R.mainAxis)!=null?l:0,crossAxis:(o=R.crossAxis)!=null?o:0};if(x){const O=N==="y"?"height":"width",E=p.reference[N]-p.floating[O]+D.mainAxis,_=p.reference[N]+p.reference[O]-D.mainAxis;S<E?S=E:S>_&&(S=_)}if(y){var A,M;const O=N==="y"?"width":"height",E=C1.has(cs(f)),_=p.reference[w]-p.floating[O]+(E&&((A=g.offset)==null?void 0:A[w])||0)+(E?0:D.crossAxis),U=p.reference[w]+p.reference[O]+(E?0:((M=g.offset)==null?void 0:M[w])||0)-(E?D.crossAxis:0);C<_?C=_:C>U&&(C=U)}return{[N]:S,[w]:C}}}},MT=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(a){const{placement:l,rects:o,platform:c,elements:u}=a,{apply:f=()=>{},...p}=br(n,a),g=await c.detectOverflow(a,p),v=cs(l),x=Jl(l),y=La(l)==="y",{width:b,height:w}=o.floating;let N,S;v==="top"||v==="bottom"?(N=v,S=x===(await(c.isRTL==null?void 0:c.isRTL(u.floating))?"start":"end")?"left":"right"):(S=v,N=x==="end"?"top":"bottom");const C=w-g.top-g.bottom,R=b-g.left-g.right,D=is(w-g[N],C),A=is(b-g[S],R),M=a.middlewareData.shift,O=!M;let E=D,_=A;M!=null&&M.enabled.x&&(_=R),M!=null&&M.enabled.y&&(E=C),O&&!x&&(y?_=b-2*gr(g.left,g.right):E=w-2*gr(g.top,g.bottom)),await f({...a,availableWidth:_,availableHeight:E});const U=await c.getDimensions(u.floating);return b!==U.width||w!==U.height?{reset:{rects:!0}}:{}}}};function ku(){return typeof window<"u"}function Wl(n){return N1(n)?(n.nodeName||"").toLowerCase():"#document"}function _n(n){var a;return(n==null||(a=n.ownerDocument)==null?void 0:a.defaultView)||window}function Nr(n){var a;return(a=(N1(n)?n.ownerDocument:n.document)||window.document)==null?void 0:a.documentElement}function N1(n){return ku()?n instanceof Node||n instanceof _n(n).Node:!1}function Pa(n){return ku()?n instanceof Element||n instanceof _n(n).Element:!1}function ds(n){return ku()?n instanceof HTMLElement||n instanceof _n(n).HTMLElement:!1}function wb(n){return!ku()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof _n(n).ShadowRoot}function _u(n){const{overflow:a,overflowX:l,overflowY:o,display:c}=Ba(n);return/auto|scroll|overlay|hidden|clip/.test(a+o+l)&&c!=="inline"&&c!=="contents"}function DT(n){return/^(table|td|th)$/.test(Wl(n))}function zu(n){try{if(n.matches(":popover-open"))return!0}catch{}try{return n.matches(":modal")}catch{return!1}}const OT=/transform|translate|scale|rotate|perspective|filter/,kT=/paint|layout|strict|content/,Ds=n=>!!n&&n!=="none";let Rh;function ep(n){const a=Pa(n)?Ba(n):n;return Ds(a.transform)||Ds(a.translate)||Ds(a.scale)||Ds(a.rotate)||Ds(a.perspective)||!tp()&&(Ds(a.backdropFilter)||Ds(a.filter))||OT.test(a.willChange||"")||kT.test(a.contain||"")}function _T(n){let a=Us(n);for(;ds(a)&&!si(a);){if(ep(a))return a;if(zu(a))return null;a=Us(a)}return null}function tp(){return Rh==null&&(Rh=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Rh}function si(n){return/^(html|body|#document)$/.test(Wl(n))}function Ba(n){return _n(n).getComputedStyle(n)}function Lu(n){return Pa(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function Us(n){if(Wl(n)==="html")return n;const a=n.assignedSlot||n.parentNode||wb(n)&&n.host||Nr(n);return wb(a)?a.host:a}function E1(n){const a=Us(n);return si(a)?(n.ownerDocument||n).body:ds(a)&&_u(a)?a:E1(a)}function li(n,a,l){var o;a===void 0&&(a=[]),l===void 0&&(l=!0);const c=E1(n),u=c===((o=n.ownerDocument)==null?void 0:o.body),f=_n(c);if(u){const p=nm(f);return a.concat(f,f.visualViewport||[],_u(c)?c:[],p&&l?li(p):[])}else return a.concat(c,li(c,[],l))}function nm(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function R1(n){const a=Ba(n);let l=parseFloat(a.width)||0,o=parseFloat(a.height)||0;const c=ds(n),u=c?n.offsetWidth:l,f=c?n.offsetHeight:o,p=fu(l)!==u||fu(o)!==f;return p&&(l=u,o=f),{width:l,height:o,$:p}}function np(n){return Pa(n)?n:n.contextElement}function Bl(n){const a=np(n);if(!ds(a))return vr(1);const l=a.getBoundingClientRect(),{width:o,height:c,$:u}=R1(a);let f=(u?fu(l.width):l.width)/o,p=(u?fu(l.height):l.height)/c;return(!f||!Number.isFinite(f))&&(f=1),(!p||!Number.isFinite(p))&&(p=1),{x:f,y:p}}const zT=vr(0);function T1(n){const a=_n(n);return!tp()||!a.visualViewport?zT:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function LT(n,a,l){return a===void 0&&(a=!1),!!l&&a&&l===_n(n)}function Is(n,a,l,o){a===void 0&&(a=!1),l===void 0&&(l=!1);const c=n.getBoundingClientRect(),u=np(n);let f=vr(1);a&&(o?Pa(o)&&(f=Bl(o)):f=Bl(n));const p=LT(u,l,o)?T1(u):vr(0);let g=(c.left+p.x)/f.x,v=(c.top+p.y)/f.y,x=c.width/f.x,y=c.height/f.y;if(u&&o){const b=_n(u),w=Pa(o)?_n(o):o;let N=b,S=nm(N);for(;S&&w!==N;){const C=Bl(S),R=S.getBoundingClientRect(),D=Ba(S),A=R.left+(S.clientLeft+parseFloat(D.paddingLeft))*C.x,M=R.top+(S.clientTop+parseFloat(D.paddingTop))*C.y;g*=C.x,v*=C.y,x*=C.x,y*=C.y,g+=A,v+=M,N=_n(S),S=nm(N)}}return mu({width:x,height:y,x:g,y:v})}function Uu(n,a){const l=Lu(n).scrollLeft;return a?a.left+l:Is(Nr(n)).left+l}function A1(n,a){const l=n.getBoundingClientRect(),o=l.left+a.scrollLeft-Uu(n,l),c=l.top+a.scrollTop;return{x:o,y:c}}function UT(n){let{elements:a,rect:l,offsetParent:o,strategy:c}=n;const u=c==="fixed",f=Nr(o),p=a?zu(a.floating):!1;if(o===f||p&&u)return l;let g={scrollLeft:0,scrollTop:0},v=vr(1);const x=vr(0),y=ds(o);if((y||!u)&&((Wl(o)!=="body"||_u(f))&&(g=Lu(o)),y)){const w=Is(o);v=Bl(o),x.x=w.x+o.clientLeft,x.y=w.y+o.clientTop}const b=f&&!y&&!u?A1(f,g):vr(0);return{width:l.width*v.x,height:l.height*v.y,x:l.x*v.x-g.scrollLeft*v.x+x.x+b.x,y:l.y*v.y-g.scrollTop*v.y+x.y+b.y}}function IT(n){return n.getClientRects?Array.from(n.getClientRects()):[]}function PT(n){const a=Lu(n),l=n.ownerDocument.body,o=gr(n.scrollWidth,n.clientWidth,l.scrollWidth,l.clientWidth),c=gr(n.scrollHeight,n.clientHeight,l.scrollHeight,l.clientHeight);let u=-a.scrollLeft+Uu(n);const f=-a.scrollTop;return Ba(l).direction==="rtl"&&(u+=gr(n.clientWidth,l.clientWidth)-o),{width:o,height:c,x:u,y:f}}const BT=25;function HT(n,a,l){l===void 0&&(l="viewport");const o=l==="layoutViewport",c=_n(n),u=Nr(n),f=c.visualViewport;let p=u.clientWidth,g=u.clientHeight,v=0,x=0;if(f){const b=!tp()||a==="fixed";o?b||(v=-f.offsetLeft,x=-f.offsetTop):(p=f.width,g=f.height,b&&(v=f.offsetLeft,x=f.offsetTop))}if(Uu(u)<=0){const b=u.ownerDocument,w=b.body,N=getComputedStyle(w),S=b.compatMode==="CSS1Compat"&&parseFloat(N.marginLeft)+parseFloat(N.marginRight)||0,C=Math.abs(u.clientWidth-w.clientWidth-S),R=getComputedStyle(u).scrollbarGutter==="stable both-edges"?C/2:C;R<=BT&&(p-=R)}return{width:p,height:g,x:v,y:x}}function qT(n,a){const l=Is(n,!0,a==="fixed"),o=l.top+n.clientTop,c=l.left+n.clientLeft,u=Bl(n),f=n.clientWidth*u.x,p=n.clientHeight*u.y,g=c*u.x,v=o*u.y;return{width:f,height:p,x:g,y:v}}function jb(n,a,l){let o;if(a==="viewport"||a==="layoutViewport")o=HT(n,l,a);else if(a==="document")o=PT(Nr(n));else if(Pa(a))o=qT(a,l);else{const c=T1(n);o={x:a.x-c.x,y:a.y-c.y,width:a.width,height:a.height}}return mu(o)}function $T(n,a){const l=a.get(n);if(l)return l;let o=li(n,[],!1).filter(p=>Pa(p)&&Wl(p)!=="body"),c=null;const u=Ba(n).position==="fixed";let f=u?Us(n):n;for(;Pa(f)&&!si(f);){const p=Ba(f),g=ep(f),v=c?c.position:u?"fixed":"";!g&&(v==="fixed"||v==="absolute"&&p.position==="static")?o=o.filter(y=>y!==f):c=p,f=Us(f)}return a.set(n,o),o}function VT(n){let{element:a,boundary:l,rootBoundary:o,strategy:c}=n;const f=[...l==="clippingAncestors"?zu(a)?[]:$T(a,this._c):[].concat(l),o],p=jb(a,f[0],c);let g=p.top,v=p.right,x=p.bottom,y=p.left;for(let b=1;b<f.length;b++){const w=jb(a,f[b],c);g=gr(w.top,g),v=is(w.right,v),x=is(w.bottom,x),y=gr(w.left,y)}return{width:v-y,height:x-g,x:y,y:g}}function YT(n){const{width:a,height:l}=R1(n);return{width:a,height:l}}function GT(n,a,l){const o=ds(a),c=Nr(a),u=l==="fixed",f=Is(n,!0,u,a);let p={scrollLeft:0,scrollTop:0};const g=vr(0);if((o||!u)&&((Wl(a)!=="body"||_u(c))&&(p=Lu(a)),o)){const b=Is(a,!0,u,a);g.x=b.x+a.clientLeft,g.y=b.y+a.clientTop}!o&&c&&(g.x=Uu(c));const v=c&&!o&&!u?A1(c,p):vr(0),x=f.left+p.scrollLeft-g.x-v.x,y=f.top+p.scrollTop-g.y-v.y;return{x,y,width:f.width,height:f.height}}function Th(n){return Ba(n).position==="static"}function Sb(n,a){if(!ds(n)||Ba(n).position==="fixed")return null;if(a)return a(n);let l=n.offsetParent;return Nr(n)===l&&(l=l.ownerDocument.body),l}function M1(n,a){const l=_n(n);if(zu(n))return l;if(!ds(n)){let c=Us(n);for(;c&&!si(c);){if(Pa(c)&&!Th(c))return c;c=Us(c)}return l}let o=Sb(n,a);for(;o&&DT(o)&&Th(o);)o=Sb(o,a);return o&&si(o)&&Th(o)&&!ep(o)?l:o||_T(n)||l}const FT=async function(n){const a=this.getOffsetParent||M1,l=this.getDimensions,o=await l(n.floating);return{reference:GT(n.reference,await a(n.floating),n.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function XT(n){return Ba(n).direction==="rtl"}const KT={convertOffsetParentRelativeRectToViewportRelativeRect:UT,getDocumentElement:Nr,getClippingRect:VT,getOffsetParent:M1,getElementRects:FT,getClientRects:IT,getDimensions:YT,getScale:Bl,isElement:Pa,isRTL:XT};function D1(n,a){return n.x===a.x&&n.y===a.y&&n.width===a.width&&n.height===a.height}function QT(n,a,l){let o=null,c;const u=Nr(n);function f(){var x;clearTimeout(c),(x=o)==null||x.disconnect(),o=null}function p(x,y){x===void 0&&(x=!1),y===void 0&&(y=1),f();const b=n.getBoundingClientRect(),{left:w,top:N,width:S,height:C}=b;if(x||a(),!S||!C)return;const R=Hc(N),D=Hc(u.clientWidth-(w+S)),A=Hc(u.clientHeight-(N+C)),M=Hc(w),E={rootMargin:-R+"px "+-D+"px "+-A+"px "+-M+"px",threshold:gr(0,is(1,y))||1};let _=!0;function U($){const te=$[0].intersectionRatio;if(!D1(b,n.getBoundingClientRect()))return p();if(te!==y){if(!_)return p();te?p(!1,te):c=setTimeout(()=>{p(!1,1e-7)},1e3)}_=!1}try{o=new IntersectionObserver(U,{...E,root:u.ownerDocument})}catch{o=new IntersectionObserver(U,E)}o.observe(n)}const g=_n(n),v=()=>p(l);return g.addEventListener("resize",v),p(!0),()=>{g.removeEventListener("resize",v),f()}}function ZT(n,a,l,o){o===void 0&&(o={});const{ancestorScroll:c=!0,ancestorResize:u=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:p=typeof IntersectionObserver=="function",animationFrame:g=!1}=o,v=np(n),x=c||u?[...v?li(v):[],...a?li(a):[]]:[];x.forEach(R=>{c&&R.addEventListener("scroll",l),u&&R.addEventListener("resize",l)});const y=v&&p?QT(v,l,u):null;let b=-1,w=null;f&&(w=new ResizeObserver(R=>{let[D]=R;D&&D.target===v&&w&&a&&(w.unobserve(a),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var A;(A=w)==null||A.observe(a)})),l()}),v&&!g&&w.observe(v),a&&w.observe(a));let N,S=g?Is(n):null;g&&C();function C(){const R=Is(n);S&&!D1(S,R)&&l(),S=R,N=requestAnimationFrame(C)}return l(),()=>{var R;x.forEach(D=>{c&&D.removeEventListener("scroll",l),u&&D.removeEventListener("resize",l)}),y==null||y(),(R=w)==null||R.disconnect(),w=null,g&&cancelAnimationFrame(N)}}const JT=RT,WT=TT,eA=CT,tA=MT,nA=NT,Cb=ST,aA=AT,rA=(n,a,l)=>{const o=new Map,c=l??{},u={...KT,...c.platform,_c:o};return jT(n,a,{...c,platform:u})};var sA=typeof document<"u",lA=function(){},ru=sA?h.useLayoutEffect:lA;function pu(n,a){if(n===a)return!0;if(typeof n!=typeof a)return!1;if(typeof n=="function"&&n.toString()===a.toString())return!0;let l,o,c;if(n&&a&&typeof n=="object"){if(Array.isArray(n)){if(l=n.length,l!==a.length)return!1;for(o=l;o--!==0;)if(!pu(n[o],a[o]))return!1;return!0}if(c=Object.keys(n),l=c.length,l!==Object.keys(a).length)return!1;for(o=l;o--!==0;)if(!{}.hasOwnProperty.call(a,c[o]))return!1;for(o=l;o--!==0;){const u=c[o];if(!(u==="_owner"&&n.$$typeof)&&!pu(n[u],a[u]))return!1}return!0}return n!==n&&a!==a}function O1(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function Nb(n,a){const l=O1(n);return Math.round(a*l)/l}function Ah(n){const a=h.useRef(n);return ru(()=>{a.current=n}),a}function oA(n){n===void 0&&(n={});const{placement:a="bottom",strategy:l="absolute",middleware:o=[],platform:c,elements:{reference:u,floating:f}={},transform:p=!0,whileElementsMounted:g,open:v}=n,[x,y]=h.useState({x:0,y:0,strategy:l,placement:a,middlewareData:{},isPositioned:!1}),[b,w]=h.useState(o);pu(b,o)||w(o);const[N,S]=h.useState(null),[C,R]=h.useState(null),D=h.useCallback(Z=>{Z!==E.current&&(E.current=Z,S(Z))},[]),A=h.useCallback(Z=>{Z!==_.current&&(_.current=Z,R(Z))},[]),M=u||N,O=f||C,E=h.useRef(null),_=h.useRef(null),U=h.useRef(x),$=g!=null,te=Ah(g),V=Ah(c),H=Ah(v),ae=h.useCallback(()=>{if(!E.current||!_.current)return;const Z={placement:a,strategy:l,middleware:b};V.current&&(Z.platform=V.current),rA(E.current,_.current,Z).then(J=>{const ne={...J,isPositioned:H.current!==!1};ee.current&&!pu(U.current,ne)&&(U.current=ne,Sa.flushSync(()=>{y(ne)}))})},[b,a,l,V,H]);ru(()=>{v===!1&&U.current.isPositioned&&(U.current.isPositioned=!1,y(Z=>({...Z,isPositioned:!1})))},[v]);const ee=h.useRef(!1);ru(()=>(ee.current=!0,()=>{ee.current=!1}),[]),ru(()=>{if(M&&(E.current=M),O&&(_.current=O),M&&O){if(te.current)return te.current(M,O,ae);ae()}},[M,O,ae,te,$]);const B=h.useMemo(()=>({reference:E,floating:_,setReference:D,setFloating:A}),[D,A]),k=h.useMemo(()=>({reference:M,floating:O}),[M,O]),q=h.useMemo(()=>{const Z={position:l,left:0,top:0};if(!k.floating)return Z;const J=Nb(k.floating,x.x),ne=Nb(k.floating,x.y);return p?{...Z,transform:"translate("+J+"px, "+ne+"px)",...O1(k.floating)>=1.5&&{willChange:"transform"}}:{position:l,left:J,top:ne}},[l,p,k.floating,x.x,x.y]);return h.useMemo(()=>({...x,update:ae,refs:B,elements:k,floatingStyles:q}),[x,ae,B,k,q])}const iA=n=>{function a(l){return{}.hasOwnProperty.call(l,"current")}return{name:"arrow",options:n,fn(l){const{element:o,padding:c}=typeof n=="function"?n(l):n;return o&&a(o)?o.current!=null?Cb({element:o.current,padding:c}).fn(l):{}:o?Cb({element:o,padding:c}).fn(l):{}}}},cA=(n,a)=>{const l=JT(n);return{name:l.name,fn:l.fn,options:[n,a]}},uA=(n,a)=>{const l=WT(n);return{name:l.name,fn:l.fn,options:[n,a]}},dA=(n,a)=>({fn:aA(n).fn,options:[n,a]}),fA=(n,a)=>{const l=eA(n);return{name:l.name,fn:l.fn,options:[n,a]}},hA=(n,a)=>{const l=tA(n);return{name:l.name,fn:l.fn,options:[n,a]}},mA=(n,a)=>{const l=nA(n);return{name:l.name,fn:l.fn,options:[n,a]}},pA=(n,a)=>{const l=iA(n);return{name:l.name,fn:l.fn,options:[n,a]}};var gA=Object.defineProperty,vA=(n,a)=>gA(n,"name",{value:a,configurable:!0});function Iu(n){const[a,l]=h.useState(void 0);return Jt(()=>{if(n){l({width:n.offsetWidth,height:n.offsetHeight});const o=new ResizeObserver(c=>{if(!Array.isArray(c)||!c.length)return;const u=c[0];let f,p;if("borderBoxSize"in u){const g=u.borderBoxSize,v=Array.isArray(g)?g[0]:g;f=v.inlineSize,p=v.blockSize}else f=n.offsetWidth,p=n.offsetHeight;l({width:f,height:p})});return o.observe(n,{box:"border-box"}),()=>o.unobserve(n)}else l(void 0)},[n]),a}vA(Iu,"useSize");var xA=Object.defineProperty,ls=(n,a)=>xA(n,"name",{value:a,configurable:!0}),k1="Popper",[_1,eo]=Hn(k1),[yA,z1]=_1(k1),bA=ls(n=>{const{__scopePopper:a,children:l}=n,[o,c]=h.useState(null),[u,f]=h.useState(void 0);return s.jsx(yA,{scope:a,anchor:o,onAnchorChange:c,placementState:u,setPlacementState:f,children:l})},"Popper"),wA="PopperAnchor",jA=h.forwardRef(ls(function(a,l){const{__scopePopper:o,virtualRef:c,...u}=a,f=z1(wA,o),p=h.useRef(null),g=f.onAnchorChange,v=h.useCallback(S=>{p.current=S,S&&g(S)},[g]),x=Fe(l,v),y=h.useRef(null);h.useEffect(()=>{if(!c)return;const S=y.current;y.current=c.current,S!==y.current&&g(y.current)});const b=f.placementState&&Pu(f.placementState),w=b==null?void 0:b[0],N=b==null?void 0:b[1];return c?null:s.jsx(He.div,{"data-radix-popper-side":w,"data-radix-popper-align":N,...u,ref:x})},"PopperAnchor")),L1="PopperContent",[SA,l5]=_1(L1),CA=h.forwardRef(ls(function(a,l){var he,xe,Ae,Ne,Oe,Qe,et;const{__scopePopper:o,side:c="bottom",sideOffset:u=0,align:f="center",alignOffset:p=0,arrowPadding:g=0,avoidCollisions:v=!0,collisionBoundary:x=[],collisionPadding:y=0,sticky:b="partial",hideWhenDetached:w=!1,updatePositionStrategy:N="optimized",onPlaced:S,...C}=a,R=z1(L1,o),[D,A]=h.useState(null),M=Fe(l,A),[O,E]=h.useState(null),_=Iu(O),U=(_==null?void 0:_.width)??0,$=(_==null?void 0:_.height)??0,te=c+(f!=="center"?"-"+f:""),V=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},H=Array.isArray(x)?x:[x],ae=H.length>0,ee={padding:V,boundary:H.filter(U1),altBoundary:ae},{refs:B,floatingStyles:k,placement:q,isPositioned:Z,middlewareData:J}=oA({strategy:"fixed",placement:te,whileElementsMounted:ls((...ce)=>ZT(...ce,{animationFrame:N==="always"}),"whileElementsMounted"),elements:{reference:R.anchor},middleware:[cA({mainAxis:u+$,alignmentAxis:p}),v&&uA({mainAxis:!0,crossAxis:!1,limiter:b==="partial"?dA():void 0,...ee}),v&&fA({...ee}),hA({...ee,apply:ls(({elements:ce,rects:Le,availableWidth:qe,availableHeight:_t})=>{const{width:St,height:Wt}=Le.reference,mn=ce.floating.style;mn.setProperty("--radix-popper-available-width",`${qe}px`),mn.setProperty("--radix-popper-available-height",`${_t}px`),mn.setProperty("--radix-popper-anchor-width",`${St}px`),mn.setProperty("--radix-popper-anchor-height",`${Wt}px`)},"apply")}),O&&pA({element:O,padding:g}),NA({arrowWidth:U,arrowHeight:$}),w&&mA({strategy:"referenceHidden",...ee,boundary:ae?ee.boundary:void 0})]}),ne=R.setPlacementState;Jt(()=>(ne(q),()=>{ne(void 0)}),[q,ne]);const[z,L]=Pu(q),F=ma(S);Jt(()=>{Z&&(F==null||F())},[Z,F]);const se=(he=J.arrow)==null?void 0:he.x,pe=(xe=J.arrow)==null?void 0:xe.y,ye=((Ae=J.arrow)==null?void 0:Ae.centerOffset)!==0,[G,ue]=h.useState();return Jt(()=>{D&&ue(window.getComputedStyle(D).zIndex)},[D]),s.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...k,transform:Z?k.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[(Ne=J.transformOrigin)==null?void 0:Ne.x,(Oe=J.transformOrigin)==null?void 0:Oe.y].join(" "),...((Qe=J.hide)==null?void 0:Qe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:a.dir,children:s.jsx(SA,{scope:o,placedSide:z,placedAlign:L,onArrowChange:E,arrowX:se,arrowY:pe,shouldHideArrow:ye,children:s.jsx(He.div,{"data-side":z,"data-align":L,...C,ref:M,style:{...C.style,animation:Z?(et=C.style)==null?void 0:et.animation:"none"}})})})},"PopperContent"));function U1(n){return n!==null}ls(U1,"isNotNull");var NA=ls(n=>({name:"transformOrigin",options:n,fn(a){var C,R,D;const{placement:l,rects:o,middlewareData:c}=a,f=((C=c.arrow)==null?void 0:C.centerOffset)!==0,p=f?0:n.arrowWidth,g=f?0:n.arrowHeight,[v,x]=Pu(l),y={start:"0%",center:"50%",end:"100%"}[x],b=(((R=c.arrow)==null?void 0:R.x)??0)+p/2,w=(((D=c.arrow)==null?void 0:D.y)??0)+g/2;let N="",S="";return v==="bottom"?(N=f?y:`${b}px`,S=`${-g}px`):v==="top"?(N=f?y:`${b}px`,S=`${o.floating.height+g}px`):v==="right"?(N=`${-g}px`,S=f?y:`${w}px`):v==="left"&&(N=`${o.floating.width+g}px`,S=f?y:`${w}px`),{data:{x:N,y:S}}}}),"transformOrigin");function Pu(n){const[a,l="center"]=n.split("-");return[a,l]}ls(Pu,"getSideAndAlignFromPlacement");var ap=bA,rp=jA,sp=CA,EA=Object.defineProperty,RA=(n,a)=>EA(n,"name",{value:a,configurable:!0}),lp=h.forwardRef(RA(function(a,l){var g;const{container:o,...c}=a,[u,f]=h.useState(!1);Jt(()=>f(!0),[]);const p=o||u&&((g=globalThis==null?void 0:globalThis.document)==null?void 0:g.body);return p?Sa.createPortal(s.jsx(He.div,{...c,ref:l}),p):null},"Portal")),TA=Object.defineProperty,wr=(n,a)=>TA(n,"name",{value:a,configurable:!0});function I1(n,a){return h.useReducer((l,o)=>a[l][o]??l,n)}wr(I1,"useStateMachine");var Er=wr(n=>{const{present:a,children:l}=n,o=P1(a),c=typeof l=="function"?l({present:o.isPresent}):h.Children.only(l),u=B1(o.ref,H1(c));return typeof l=="function"||o.isPresent?h.cloneElement(c,{ref:u}):null},"Presence");function P1(n){const[a,l]=h.useState(),o=h.useRef(null),c=h.useRef(n),u=h.useRef("none"),f=h.useRef(void 0),p=n?"mounted":"unmounted",[g,v]=I1(p,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{g==="mounted"?(u.current=f.current??Ul(o.current),f.current=void 0):u.current="none"},[g]),Jt(()=>{const x=o.current,y=c.current;if(y!==n){const w=u.current,N=Ul(x);n?(f.current=N,v("MOUNT")):N==="none"||(x==null?void 0:x.display)==="none"?v("UNMOUNT"):v(y&&w!==N?"ANIMATION_OUT":"UNMOUNT"),c.current=n}},[n,v]),Jt(()=>{if(a){let x;const y=a.ownerDocument.defaultView??window,b=wr(N=>{const C=Ul(o.current).includes(CSS.escape(N.animationName));if(N.target===a&&C&&(v("ANIMATION_END"),!c.current)){const R=a.style.animationFillMode;a.style.animationFillMode="forwards",x=y.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=R)})}},"handleAnimationEnd"),w=wr(N=>{N.target===a&&(u.current=Ul(o.current))},"handleAnimationStart");return a.addEventListener("animationstart",w),a.addEventListener("animationcancel",b),a.addEventListener("animationend",b),()=>{y.clearTimeout(x),a.removeEventListener("animationstart",w),a.removeEventListener("animationcancel",b),a.removeEventListener("animationend",b)}}else v("ANIMATION_END")},[a,v]),{isPresent:["mounted","unmountSuspended"].includes(g),ref:h.useCallback(x=>{if(x){const y=getComputedStyle(x);o.current=y,f.current=Ul(y)}else o.current=null;l(x)},[])}}wr(P1,"usePresence");function am(n,a){if(typeof n=="function")return n(a);n!=null&&(n.current=a)}wr(am,"setRef");function B1(...n){const a=h.useRef(n);return a.current=n,h.useCallback(l=>{const o=a.current;let c=!1;const u=o.map(f=>{const p=am(f,l);return!c&&typeof p=="function"&&(c=!0),p});if(c)return()=>{for(let f=0;f<u.length;f++){const p=u[f];typeof p=="function"?p():am(o[f],null)}}},[])}wr(B1,"useStableComposedRefs");function Ul(n){return(n==null?void 0:n.animationName)||"none"}wr(Ul,"getAnimationName");function H1(n){var o,c;let a=(o=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?n.ref:(a=(c=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?n.props.ref:n.props.ref||n.ref)}wr(H1,"getElementRef");var AA=Object.defineProperty,op=(n,a)=>AA(n,"name",{value:a,configurable:!0}),Mh=!1;function q1(){const[n,a]=h.useState(Mh);return h.useEffect(()=>{Mh||(Mh=!0,a(!0))},[]),n}op(q1,"useIsHydrated");var $1=Vl[" useSyncExternalStore ".trim().toString()];function V1(){return()=>{}}op(V1,"subscribe");function Y1(){return $1(V1,()=>!0,()=>!1)}op(Y1,"useIsHydratedModern");var MA=typeof $1=="function"?Y1:q1,DA=Object.defineProperty,Bs=(n,a)=>DA(n,"name",{value:a,configurable:!0}),Dh="rovingFocusGroup.onEntryFocus",OA={bubbles:!1,cancelable:!0},Bu="RovingFocusGroup",[rm,G1,kA]=Du(Bu),[_A,Hu]=Hn(Bu,[kA]),[zA,LA]=_A(Bu),UA=h.forwardRef(Bs(function(a,l){return s.jsx(rm.Provider,{scope:a.__scopeRovingFocusGroup,children:s.jsx(rm.Slot,{scope:a.__scopeRovingFocusGroup,children:s.jsx(IA,{...a,ref:l})})})},"RovingFocusGroup")),IA=h.forwardRef(Bs(function(a,l){const{__scopeRovingFocusGroup:o,orientation:c,loop:u=!1,dir:f,currentTabStopId:p,defaultCurrentTabStopId:g,onCurrentTabStopIdChange:v,onEntryFocus:x,preventScrollOnEntryFocus:y=!1,...b}=a,w=h.useRef(null),N=Fe(l,w),S=xi(f),[C,R]=Ia({prop:p,defaultProp:g??null,onChange:v,caller:Bu}),[D,A]=h.useState(!1),M=ma(x),O=G1(o),E=h.useRef(!1),[_,U]=h.useState(0);return h.useEffect(()=>{const $=w.current;if($)return $.addEventListener(Dh,M),()=>$.removeEventListener(Dh,M)},[M]),s.jsx(zA,{scope:o,orientation:c,dir:S,loop:u,currentTabStopId:C,onItemFocus:h.useCallback($=>R($),[R]),onItemShiftTab:h.useCallback(()=>A(!0),[]),onFocusableItemAdd:h.useCallback(()=>U($=>$+1),[]),onFocusableItemRemove:h.useCallback(()=>U($=>$-1),[]),children:s.jsx(He.div,{tabIndex:D||_===0?-1:0,"data-orientation":c,...b,ref:N,style:{outline:"none",...a.style},onMouseDown:Se(a.onMouseDown,()=>{E.current=!0}),onFocus:Se(a.onFocus,$=>{const te=!E.current;if($.target===$.currentTarget&&te&&!D){const V=new CustomEvent(Dh,OA);if($.currentTarget.dispatchEvent(V),!V.defaultPrevented){const H=O().filter(q=>q.focusable),ae=H.find(q=>q.active),ee=H.find(q=>q.id===C),k=[ae,ee,...H].filter(Boolean).map(q=>q.ref.current);ip(k,y)}}E.current=!1}),onBlur:Se(a.onBlur,()=>A(!1))})})},"RovingFocusGroupImpl")),PA="RovingFocusGroupItem",BA=h.forwardRef(Bs(function(a,l){const{__scopeRovingFocusGroup:o,focusable:c=!0,active:u=!1,tabStopId:f,children:p,...g}=a,v=Na(),x=f||v,y=LA(PA,o),b=y.currentTabStopId===x,w=G1(o),{onFocusableItemAdd:N,onFocusableItemRemove:S,currentTabStopId:C}=y,R=MA();return Jt(()=>{if(!(!R||!c))return N(),()=>S()},[R,c,N,S]),h.useEffect(()=>{if(!(R||!c))return N(),()=>S()},[R,c,N,S]),s.jsx(rm.ItemSlot,{scope:o,id:x,focusable:c,active:u,children:s.jsx(He.span,{tabIndex:b?0:-1,"data-orientation":y.orientation,...g,ref:l,onMouseDown:Se(a.onMouseDown,D=>{c?y.onItemFocus(x):D.preventDefault()}),onFocus:Se(a.onFocus,()=>y.onItemFocus(x)),onKeyDown:Se(a.onKeyDown,D=>{if(D.key==="Tab"&&D.shiftKey){y.onItemShiftTab();return}if(D.target!==D.currentTarget)return;const A=X1(D,y.orientation,y.dir);if(A!==void 0){if(D.metaKey||D.ctrlKey||D.altKey||D.shiftKey)return;D.preventDefault();let O=w().filter(E=>E.focusable).map(E=>E.ref.current);if(A==="last")O.reverse();else if(A==="prev"||A==="next"){A==="prev"&&O.reverse();const E=O.indexOf(D.currentTarget);O=y.loop?K1(O,E+1):O.slice(E+1)}setTimeout(()=>ip(O))}}),children:typeof p=="function"?p({isCurrentTabStop:b,hasTabStop:C!=null}):p})})},"RovingFocusGroupItem")),HA={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function F1(n,a){return a!=="rtl"?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}Bs(F1,"getDirectionAwareKey");function X1(n,a,l){const o=F1(n.key,l);if(!(a==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(a==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return HA[o]}Bs(X1,"getFocusIntent");function ip(n,a=!1){const l=document.activeElement;for(const o of n)if(o===l||(o.focus({preventScroll:a}),document.activeElement!==l))return}Bs(ip,"focusFirst");function K1(n,a){return n.map((l,o)=>n[(a+o)%n.length])}Bs(K1,"wrapArray");var Q1=UA,Z1=BA,qA=function(n){if(typeof document>"u")return null;var a=Array.isArray(n)?n[0]:n;return a.ownerDocument.body},Dl=new WeakMap,qc=new WeakMap,$c={},Oh=0,J1=function(n){return n&&(n.host||J1(n.parentNode))},$A=function(n,a){return a.map(function(l){if(n.contains(l))return l;var o=J1(l);return o&&n.contains(o)?o:(console.error("aria-hidden",l,"in not contained inside",n,". Doing nothing"),null)}).filter(function(l){return!!l})},VA=function(n,a,l,o){var c=$A(a,Array.isArray(n)?n:[n]);$c[l]||($c[l]=new WeakMap);var u=$c[l],f=[],p=new Set,g=new Set(c),v=function(y){!y||p.has(y)||(p.add(y),v(y.parentNode))};c.forEach(v);var x=function(y){!y||g.has(y)||Array.prototype.forEach.call(y.children,function(b){if(p.has(b))x(b);else try{var w=b.getAttribute(o),N=w!==null&&w!=="false",S=(Dl.get(b)||0)+1,C=(u.get(b)||0)+1;Dl.set(b,S),u.set(b,C),f.push(b),S===1&&N&&qc.set(b,!0),C===1&&b.setAttribute(l,"true"),N||b.setAttribute(o,"true")}catch(R){console.error("aria-hidden: cannot operate on ",b,R)}})};return x(a),p.clear(),Oh++,function(){f.forEach(function(y){var b=Dl.get(y)-1,w=u.get(y)-1;Dl.set(y,b),u.set(y,w),b||(qc.has(y)||y.removeAttribute(o),qc.delete(y)),w||y.removeAttribute(l)}),Oh--,Oh||(Dl=new WeakMap,Dl=new WeakMap,qc=new WeakMap,$c={})}},cp=function(n,a,l){l===void 0&&(l="data-aria-hidden");var o=Array.from(Array.isArray(n)?n:[n]),c=qA(n);return c?(o.push.apply(o,Array.from(c.querySelectorAll("[aria-live], script"))),VA(o,c,l,"aria-hidden")):function(){return null}},za=function(){return za=Object.assign||function(a){for(var l,o=1,c=arguments.length;o<c;o++){l=arguments[o];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(a[u]=l[u])}return a},za.apply(this,arguments)};function W1(n,a){var l={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&a.indexOf(o)<0&&(l[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,o=Object.getOwnPropertySymbols(n);c<o.length;c++)a.indexOf(o[c])<0&&Object.prototype.propertyIsEnumerable.call(n,o[c])&&(l[o[c]]=n[o[c]]);return l}function YA(n,a,l){if(l||arguments.length===2)for(var o=0,c=a.length,u;o<c;o++)(u||!(o in a))&&(u||(u=Array.prototype.slice.call(a,0,o)),u[o]=a[o]);return n.concat(u||Array.prototype.slice.call(a))}var su="right-scroll-bar-position",lu="width-before-scroll-bar",GA="with-scroll-bars-hidden",FA="--removed-body-scroll-bar-size";function kh(n,a){return typeof n=="function"?n(a):n&&(n.current=a),n}function XA(n,a){var l=h.useState(function(){return{value:n,callback:a,facade:{get current(){return l.value},set current(o){var c=l.value;c!==o&&(l.value=o,l.callback(o,c))}}}})[0];return l.callback=a,l.facade}var KA=typeof window<"u"?h.useLayoutEffect:h.useEffect,Eb=new WeakMap;function QA(n,a){var l=XA(null,function(o){return n.forEach(function(c){return kh(c,o)})});return KA(function(){var o=Eb.get(l);if(o){var c=new Set(o),u=new Set(n),f=l.current;c.forEach(function(p){u.has(p)||kh(p,null)}),u.forEach(function(p){c.has(p)||kh(p,f)})}Eb.set(l,n)},[n]),l}function ZA(n){return n}function JA(n,a){a===void 0&&(a=ZA);var l=[],o=!1,c={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return l.length?l[l.length-1]:n},useMedium:function(u){var f=a(u,o);return l.push(f),function(){l=l.filter(function(p){return p!==f})}},assignSyncMedium:function(u){for(o=!0;l.length;){var f=l;l=[],f.forEach(u)}l={push:function(p){return u(p)},filter:function(){return l}}},assignMedium:function(u){o=!0;var f=[];if(l.length){var p=l;l=[],p.forEach(u),f=l}var g=function(){var x=f;f=[],x.forEach(u)},v=function(){return Promise.resolve().then(g)};v(),l={push:function(x){f.push(x),v()},filter:function(x){return f=f.filter(x),l}}}};return c}function WA(n){n===void 0&&(n={});var a=JA(null);return a.options=za({async:!0,ssr:!1},n),a}var ew=function(n){var a=n.sideCar,l=W1(n,["sideCar"]);if(!a)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=a.read();if(!o)throw new Error("Sidecar medium not found");return h.createElement(o,za({},l))};ew.isSideCarExport=!0;function eM(n,a){return n.useMedium(a),ew}var tw=WA(),_h=function(){},qu=h.forwardRef(function(n,a){var l=h.useRef(null),o=h.useState({onScrollCapture:_h,onWheelCapture:_h,onTouchMoveCapture:_h}),c=o[0],u=o[1],f=n.forwardProps,p=n.children,g=n.className,v=n.removeScrollBar,x=n.enabled,y=n.shards,b=n.sideCar,w=n.noRelative,N=n.noIsolation,S=n.inert,C=n.allowPinchZoom,R=n.as,D=R===void 0?"div":R,A=n.gapMode,M=W1(n,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=b,E=QA([l,a]),_=za(za({},M),c);return h.createElement(h.Fragment,null,x&&h.createElement(O,{sideCar:tw,removeScrollBar:v,shards:y,noRelative:w,noIsolation:N,inert:S,setCallbacks:u,allowPinchZoom:!!C,lockRef:l,gapMode:A}),f?h.cloneElement(h.Children.only(p),za(za({},_),{ref:E})):h.createElement(D,za({},_,{className:g,ref:E}),p))});qu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};qu.classNames={fullWidth:lu,zeroRight:su};var tM=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function nM(){if(!document)return null;var n=document.createElement("style");n.type="text/css";var a=tM();return a&&n.setAttribute("nonce",a),n}function aM(n,a){n.styleSheet?n.styleSheet.cssText=a:n.appendChild(document.createTextNode(a))}function rM(n){var a=document.head||document.getElementsByTagName("head")[0];a.appendChild(n)}var sM=function(){var n=0,a=null;return{add:function(l){n==0&&(a=nM())&&(aM(a,l),rM(a)),n++},remove:function(){n--,!n&&a&&(a.parentNode&&a.parentNode.removeChild(a),a=null)}}},lM=function(){var n=sM();return function(a,l){h.useEffect(function(){return n.add(a),function(){n.remove()}},[a&&l])}},nw=function(){var n=lM(),a=function(l){var o=l.styles,c=l.dynamic;return n(o,c),null};return a},oM={left:0,top:0,right:0,gap:0},zh=function(n){return parseInt(n||"",10)||0},iM=function(n){var a=window.getComputedStyle(document.body),l=a[n==="padding"?"paddingLeft":"marginLeft"],o=a[n==="padding"?"paddingTop":"marginTop"],c=a[n==="padding"?"paddingRight":"marginRight"];return[zh(l),zh(o),zh(c)]},cM=function(n){if(n===void 0&&(n="margin"),typeof window>"u")return oM;var a=iM(n),l=document.documentElement.clientWidth,o=window.innerWidth;return{left:a[0],top:a[1],right:a[2],gap:Math.max(0,o-l+a[2]-a[0])}},uM=nw(),Hl="data-scroll-locked",dM=function(n,a,l,o){var c=n.left,u=n.top,f=n.right,p=n.gap;return l===void 0&&(l="margin"),`
|
|
341
|
-
.`.concat(GA,` {
|
|
342
|
-
overflow: hidden `).concat(o,`;
|
|
343
|
-
padding-right: `).concat(p,"px ").concat(o,`;
|
|
344
|
-
}
|
|
345
|
-
body[`).concat(Hl,`] {
|
|
346
|
-
overflow: hidden `).concat(o,`;
|
|
347
|
-
overscroll-behavior: contain;
|
|
348
|
-
`).concat([a&&"position: relative ".concat(o,";"),l==="margin"&&`
|
|
349
|
-
padding-left: `.concat(c,`px;
|
|
350
|
-
padding-top: `).concat(u,`px;
|
|
351
|
-
padding-right: `).concat(f,`px;
|
|
352
|
-
margin-left:0;
|
|
353
|
-
margin-top:0;
|
|
354
|
-
margin-right: `).concat(p,"px ").concat(o,`;
|
|
355
|
-
`),l==="padding"&&"padding-right: ".concat(p,"px ").concat(o,";")].filter(Boolean).join(""),`
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
.`).concat(su,` {
|
|
359
|
-
right: `).concat(p,"px ").concat(o,`;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
.`).concat(lu,` {
|
|
363
|
-
margin-right: `).concat(p,"px ").concat(o,`;
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
.`).concat(su," .").concat(su,` {
|
|
367
|
-
right: 0 `).concat(o,`;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
.`).concat(lu," .").concat(lu,` {
|
|
371
|
-
margin-right: 0 `).concat(o,`;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
body[`).concat(Hl,`] {
|
|
375
|
-
`).concat(FA,": ").concat(p,`px;
|
|
376
|
-
}
|
|
377
|
-
`)},Rb=function(){var n=parseInt(document.body.getAttribute(Hl)||"0",10);return isFinite(n)?n:0},fM=function(){h.useEffect(function(){return document.body.setAttribute(Hl,(Rb()+1).toString()),function(){var n=Rb()-1;n<=0?document.body.removeAttribute(Hl):document.body.setAttribute(Hl,n.toString())}},[])},hM=function(n){var a=n.noRelative,l=n.noImportant,o=n.gapMode,c=o===void 0?"margin":o;fM();var u=h.useMemo(function(){return cM(c)},[c]);return h.createElement(uM,{styles:dM(u,!a,c,l?"":"!important")})},sm=!1;if(typeof window<"u")try{var Vc=Object.defineProperty({},"passive",{get:function(){return sm=!0,!0}});window.addEventListener("test",Vc,Vc),window.removeEventListener("test",Vc,Vc)}catch{sm=!1}var Ol=sm?{passive:!1}:!1,mM=function(n){return n.tagName==="TEXTAREA"},aw=function(n,a){if(!(n instanceof Element))return!1;var l=window.getComputedStyle(n);return l[a]!=="hidden"&&!(l.overflowY===l.overflowX&&!mM(n)&&l[a]==="visible")},pM=function(n){return aw(n,"overflowY")},gM=function(n){return aw(n,"overflowX")},Tb=function(n,a){var l=a.ownerDocument,o=a;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var c=rw(n,o);if(c){var u=sw(n,o),f=u[1],p=u[2];if(f>p)return!0}o=o.parentNode}while(o&&o!==l.body);return!1},vM=function(n){var a=n.scrollTop,l=n.scrollHeight,o=n.clientHeight;return[a,l,o]},xM=function(n){var a=n.scrollLeft,l=n.scrollWidth,o=n.clientWidth;return[a,l,o]},rw=function(n,a){return n==="v"?pM(a):gM(a)},sw=function(n,a){return n==="v"?vM(a):xM(a)},yM=function(n,a){return n==="h"&&a==="rtl"?-1:1},bM=function(n,a,l,o,c){var u=yM(n,window.getComputedStyle(a).direction),f=u*o,p=l.target,g=a.contains(p),v=!1,x=f>0,y=0,b=0;do{if(!p)break;var w=sw(n,p),N=w[0],S=w[1],C=w[2],R=S-C-u*N;(N||R)&&rw(n,p)&&(y+=R,b+=N);var D=p.parentNode;p=D&&D.nodeType===Node.DOCUMENT_FRAGMENT_NODE?D.host:D}while(!g&&p!==document.body||g&&(a.contains(p)||a===p));return(x&&Math.abs(y)<1||!x&&Math.abs(b)<1)&&(v=!0),v},Yc=function(n){return"changedTouches"in n?[n.changedTouches[0].clientX,n.changedTouches[0].clientY]:[0,0]},Ab=function(n){return[n.deltaX,n.deltaY]},Mb=function(n){return n&&"current"in n?n.current:n},wM=function(n,a){return n[0]===a[0]&&n[1]===a[1]},jM=function(n){return`
|
|
378
|
-
.block-interactivity-`.concat(n,` {pointer-events: none;}
|
|
379
|
-
.allow-interactivity-`).concat(n,` {pointer-events: all;}
|
|
380
|
-
`)},SM=0,kl=[];function CM(n){var a=h.useRef([]),l=h.useRef([0,0]),o=h.useRef(),c=h.useState(SM++)[0],u=h.useState(nw)[0],f=h.useRef(n);h.useEffect(function(){f.current=n},[n]),h.useEffect(function(){if(n.inert){document.body.classList.add("block-interactivity-".concat(c));var S=YA([n.lockRef.current],(n.shards||[]).map(Mb),!0).filter(Boolean);return S.forEach(function(C){return C.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),S.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(c))})}}},[n.inert,n.lockRef.current,n.shards]);var p=h.useCallback(function(S,C){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!f.current.allowPinchZoom;var R=Yc(S),D=l.current,A="deltaX"in S?S.deltaX:D[0]-R[0],M="deltaY"in S?S.deltaY:D[1]-R[1],O,E=S.target,_=Math.abs(A)>Math.abs(M)?"h":"v";if("touches"in S&&_==="h"&&E.type==="range")return!1;var U=window.getSelection(),$=U&&U.anchorNode,te=$?$===E||$.contains(E):!1;if(te)return!1;var V=Tb(_,E);if(!V)return!0;if(V?O=_:(O=_==="v"?"h":"v",V=Tb(_,E)),!V)return!1;if(!o.current&&"changedTouches"in S&&(A||M)&&(o.current=O),!O)return!0;var H=o.current||O;return bM(H,C,S,H==="h"?A:M)},[]),g=h.useCallback(function(S){var C=S;if(!(!kl.length||kl[kl.length-1]!==u)){var R="deltaY"in C?Ab(C):Yc(C),D=a.current.filter(function(O){return O.name===C.type&&(O.target===C.target||C.target===O.shadowParent)&&wM(O.delta,R)})[0];if(D&&D.should){C.cancelable&&C.preventDefault();return}if(!D){var A=(f.current.shards||[]).map(Mb).filter(Boolean).filter(function(O){return O.contains(C.target)}),M=A.length>0?p(C,A[0]):!f.current.noIsolation;M&&C.cancelable&&C.preventDefault()}}},[]),v=h.useCallback(function(S,C,R,D){var A={name:S,delta:C,target:R,should:D,shadowParent:NM(R)};a.current.push(A),setTimeout(function(){a.current=a.current.filter(function(M){return M!==A})},1)},[]),x=h.useCallback(function(S){l.current=Yc(S),o.current=void 0},[]),y=h.useCallback(function(S){v(S.type,Ab(S),S.target,p(S,n.lockRef.current))},[]),b=h.useCallback(function(S){v(S.type,Yc(S),S.target,p(S,n.lockRef.current))},[]);h.useEffect(function(){return kl.push(u),n.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:b}),document.addEventListener("wheel",g,Ol),document.addEventListener("touchmove",g,Ol),document.addEventListener("touchstart",x,Ol),function(){kl=kl.filter(function(S){return S!==u}),document.removeEventListener("wheel",g,Ol),document.removeEventListener("touchmove",g,Ol),document.removeEventListener("touchstart",x,Ol)}},[]);var w=n.removeScrollBar,N=n.inert;return h.createElement(h.Fragment,null,N?h.createElement(u,{styles:jM(c)}):null,w?h.createElement(hM,{noRelative:n.noRelative,gapMode:n.gapMode}):null)}function NM(n){for(var a=null;n!==null;)n instanceof ShadowRoot&&(a=n.host,n=n.host),n=n.parentNode;return a}const EM=eM(tw,CM);var $u=h.forwardRef(function(n,a){return h.createElement(qu,za({},n,{ref:a,sideCar:EM}))});$u.classNames=qu.classNames;var RM=Object.defineProperty,gt=(n,a)=>RM(n,"name",{value:a,configurable:!0}),TM=["Enter"," "],AM=["ArrowDown","PageUp","Home"],lw=["ArrowUp","PageDown","End"],MM=[...AM,...lw],Vu="Menu",[lm,DM,OM]=Du(Vu),[Hs,ow]=Hn(Vu,[OM,eo,Hu]),up=eo(),iw=Hu(),[kM,bi]=Hs(Vu),[_M,dp]=Hs(Vu),zM=gt(n=>{const{__scopeMenu:a,open:l=!1,children:o,dir:c,onOpenChange:u,modal:f=!0}=n,p=up(a),[g,v]=h.useState(null),x=h.useRef(!1),y=ma(u),b=xi(c);return h.useEffect(()=>{const w=gt(()=>{x.current=!0,document.addEventListener("pointerdown",N,{capture:!0,once:!0}),document.addEventListener("pointermove",N,{capture:!0,once:!0})},"handleKeyDown"),N=gt(()=>x.current=!1,"handlePointer");return document.addEventListener("keydown",w,{capture:!0}),()=>{document.removeEventListener("keydown",w,{capture:!0}),document.removeEventListener("pointerdown",N,{capture:!0}),document.removeEventListener("pointermove",N,{capture:!0})}},[]),h.useEffect(()=>{if(!l)return;const w=gt(()=>y(!1),"handleBlur");return window.addEventListener("blur",w),()=>window.removeEventListener("blur",w)},[l,y]),s.jsx(ap,{...p,children:s.jsx(kM,{scope:a,open:l,onOpenChange:y,content:g,onContentChange:v,children:s.jsx(_M,{scope:a,onClose:h.useCallback(()=>y(!1),[y]),isUsingKeyboardRef:x,dir:b,modal:f,children:o})})})},"Menu"),LM=h.forwardRef(gt(function(a,l){const{__scopeMenu:o,...c}=a,u=up(o);return s.jsx(rp,{...u,...c,ref:l})},"MenuAnchor")),cw="MenuPortal",[UM,IM]=Hs(cw,{forceMount:void 0}),PM=gt(n=>{const{__scopeMenu:a,forceMount:l,children:o,container:c}=n,u=bi(cw,a);return s.jsx(UM,{scope:a,forceMount:l,children:s.jsx(Er,{present:l||u.open,children:s.jsx(lp,{asChild:!0,container:c,children:o})})})},"MenuPortal"),os="MenuContent",[BM,uw]=Hs(os),HM=h.forwardRef(gt(function(a,l){const o=IM(os,a.__scopeMenu),{forceMount:c=o.forceMount,...u}=a,f=bi(os,a.__scopeMenu),p=dp(os,a.__scopeMenu);return s.jsx(lm.Provider,{scope:a.__scopeMenu,children:s.jsx(Er,{present:c||f.open,children:s.jsx(lm.Slot,{scope:a.__scopeMenu,children:p.modal?s.jsx(qM,{...u,ref:l}):s.jsx($M,{...u,ref:l})})})})},"MenuContent")),qM=h.forwardRef(gt(function(a,l){const o=bi(os,a.__scopeMenu),c=h.useRef(null),u=Fe(l,c);return h.useEffect(()=>{const f=c.current;if(f)return cp(f)},[]),s.jsx(dw,{...a,ref:u,trapFocus:o.open,disableOutsidePointerEvents:o.open,disableOutsideScroll:!0,onFocusOutside:Se(a.onFocusOutside,f=>f.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>o.onOpenChange(!1)})},"MenuRootContentModal")),$M=h.forwardRef(gt(function(a,l){const o=bi(os,a.__scopeMenu);return s.jsx(dw,{...a,ref:l,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>o.onOpenChange(!1)})},"MenuRootContentNonModal")),VM=Ua("MenuContent.ScrollLock"),dw=h.forwardRef(gt(function(a,l){const{__scopeMenu:o,loop:c=!1,trapFocus:u,onOpenAutoFocus:f,onCloseAutoFocus:p,disableOutsidePointerEvents:g,onEntryFocus:v,onEscapeKeyDown:x,onPointerDownOutside:y,onFocusOutside:b,onInteractOutside:w,onDismiss:N,disableOutsideScroll:S,...C}=a,R=bi(os,o),D=dp(os,o),A=up(o),M=iw(o),O=DM(o),[E,_]=h.useState(null),U=h.useRef(null),$=Fe(l,U,R.onContentChange),te=h.useRef(0),V=h.useRef(""),H=h.useRef(0),ae=h.useRef(null),ee=h.useRef("right"),B=h.useRef(0),k=S?$u:h.Fragment,q=S?{as:VM,allowPinchZoom:!0}:void 0,Z=gt(ne=>{var ue,he;const z=V.current+ne,L=O().filter(xe=>!xe.disabled),F=document.activeElement,se=(ue=L.find(xe=>xe.ref.current===F))==null?void 0:ue.textValue,pe=L.map(xe=>xe.textValue),ye=gw(pe,z,se),G=(he=L.find(xe=>xe.textValue===ye))==null?void 0:he.ref.current;gt((function xe(Ae){V.current=Ae,window.clearTimeout(te.current),Ae!==""&&(te.current=window.setTimeout(()=>xe(""),1e3))}),"updateSearch")(z),G&&setTimeout(()=>G.focus())},"handleTypeaheadSearch");h.useEffect(()=>()=>window.clearTimeout(te.current),[]),yi();const J=h.useCallback(ne=>{var L,F;return ee.current===((L=ae.current)==null?void 0:L.side)&&xw(ne,(F=ae.current)==null?void 0:F.area)},[]);return s.jsx(BM,{scope:o,searchRef:V,onItemEnter:h.useCallback(ne=>{J(ne)&&ne.preventDefault()},[J]),onItemLeave:h.useCallback(ne=>{var z;J(ne)||((z=U.current)==null||z.focus(),_(null))},[J]),onTriggerLeave:h.useCallback(ne=>{J(ne)&&ne.preventDefault()},[J]),pointerGraceTimerRef:H,onPointerGraceIntentChange:h.useCallback(ne=>{ae.current=ne},[]),children:s.jsx(k,{...q,children:s.jsx(Km,{asChild:!0,trapped:u,onMountAutoFocus:Se(f,ne=>{var z;ne.preventDefault(),(z=U.current)==null||z.focus({preventScroll:!0})}),onUnmountAutoFocus:p,children:s.jsx(Ou,{asChild:!0,disableOutsidePointerEvents:g,onEscapeKeyDown:x,onPointerDownOutside:y,onFocusOutside:b,onInteractOutside:w,onDismiss:N,children:s.jsx(Q1,{asChild:!0,...M,dir:D.dir,orientation:"vertical",loop:c,currentTabStopId:E,onCurrentTabStopIdChange:_,onEntryFocus:Se(v,ne=>{D.isUsingKeyboardRef.current||ne.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(sp,{role:"menu","aria-orientation":"vertical","data-state":fw(R.open),"data-radix-menu-content":"",dir:D.dir,...A,...C,ref:$,style:{outline:"none",...C.style},onKeyDown:Se(C.onKeyDown,ne=>{const L=ne.target.closest("[data-radix-menu-content]")===ne.currentTarget,F=ne.ctrlKey||ne.altKey||ne.metaKey,se=ne.key.length===1;L&&(ne.key==="Tab"&&ne.preventDefault(),!F&&se&&Z(ne.key));const pe=U.current;if(ne.target!==pe||!MM.includes(ne.key))return;ne.preventDefault();const G=O().filter(ue=>!ue.disabled).map(ue=>ue.ref.current);lw.includes(ne.key)&&G.reverse(),mw(G)}),onBlur:Se(a.onBlur,ne=>{ne.currentTarget.contains(ne.target)||(window.clearTimeout(te.current),V.current="")}),onPointerMove:Se(a.onPointerMove,gu(ne=>{const z=ne.target,L=B.current!==ne.clientX;if(ne.currentTarget.contains(z)&&L){const F=ne.clientX>B.current?"right":"left";ee.current=F,B.current=ne.clientX}}))})})})})})})},"MenuContentImpl")),YM=h.forwardRef(gt(function(a,l){const{__scopeMenu:o,...c}=a;return s.jsx(He.div,{...c,ref:l})},"MenuLabel")),om="MenuItem",Db="menu.itemSelect",GM=h.forwardRef(gt(function(a,l){const{disabled:o=!1,onSelect:c,...u}=a,f=h.useRef(null),p=dp(om,a.__scopeMenu),g=uw(om,a.__scopeMenu),v=Fe(l,f),x=h.useRef(!1),y=gt(()=>{const b=f.current;if(!o&&b){const w=new CustomEvent(Db,{bubbles:!0,cancelable:!0});b.addEventListener(Db,N=>c==null?void 0:c(N),{once:!0}),Ym(b,w),w.defaultPrevented?x.current=!1:p.onClose()}},"handleSelect");return s.jsx(FM,{...u,ref:v,disabled:o,onClick:Se(a.onClick,y),onPointerDown:b=>{var w;(w=a.onPointerDown)==null||w.call(a,b),x.current=!0},onPointerUp:Se(a.onPointerUp,b=>{var w;x.current||(w=b.currentTarget)==null||w.click()}),onKeyDown:Se(a.onKeyDown,b=>{o||b.target!==b.currentTarget||g.searchRef.current!==""&&b.key===" "||TM.includes(b.key)&&(b.currentTarget.click(),b.preventDefault())})})},"MenuItem")),FM=h.forwardRef(gt(function(a,l){const{__scopeMenu:o,disabled:c=!1,textValue:u,...f}=a,p=uw(om,o),g=iw(o),v=h.useRef(null),x=Fe(l,v),[y,b]=h.useState(!1),[w,N]=h.useState("");return h.useEffect(()=>{const S=v.current;S&&N((S.textContent??"").trim())},[f.children]),s.jsx(lm.ItemSlot,{scope:o,disabled:c,textValue:u??w,children:s.jsx(Z1,{asChild:!0,...g,focusable:!c,children:s.jsx(He.div,{role:"menuitem","data-highlighted":y?"":void 0,"aria-disabled":c||void 0,"data-disabled":c?"":void 0,...f,ref:x,onPointerMove:Se(a.onPointerMove,gu(S=>{c?p.onItemLeave(S):(p.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Se(a.onPointerLeave,gu(S=>p.onItemLeave(S))),onFocus:Se(a.onFocus,()=>b(!0)),onBlur:Se(a.onBlur,()=>b(!1))})})})},"MenuItemImpl")),XM="MenuRadioGroup",[o5,i5]=Hs(XM,{value:void 0,onValueChange:gt(()=>{},"onValueChange")}),KM="MenuItemIndicator",[c5,u5]=Hs(KM,{checked:!1}),QM=h.forwardRef(gt(function(a,l){const{__scopeMenu:o,...c}=a;return s.jsx(He.div,{role:"separator","aria-orientation":"horizontal",...c,ref:l})},"MenuSeparator")),ZM="MenuSub",[d5,f5]=Hs(ZM);function fw(n){return n?"open":"closed"}gt(fw,"getOpenState");function hw(n){return n==="indeterminate"}gt(hw,"isIndeterminate");function JM(n){return hw(n)?"indeterminate":n?"checked":"unchecked"}gt(JM,"getCheckedState");function mw(n){const a=document.activeElement;for(const l of n)if(l===a||(l.focus(),document.activeElement!==a))return}gt(mw,"focusFirst");function pw(n,a){return n.map((l,o)=>n[(a+o)%n.length])}gt(pw,"wrapArray");function gw(n,a,l){const c=a.length>1&&Array.from(a).every(v=>v===a[0])?a[0]:a,u=l?n.indexOf(l):-1;let f=pw(n,Math.max(u,0));c.length===1&&(f=f.filter(v=>v!==l));const g=f.find(v=>v.toLowerCase().startsWith(c.toLowerCase()));return g!==l?g:void 0}gt(gw,"getNextMatch");function vw(n,a){const{x:l,y:o}=n;let c=!1;for(let u=0,f=a.length-1;u<a.length;f=u++){const p=a[u],g=a[f],v=p.x,x=p.y,y=g.x,b=g.y;x>o!=b>o&&l<(y-v)*(o-x)/(b-x)+v&&(c=!c)}return c}gt(vw,"isPointInPolygon");function xw(n,a){if(!a)return!1;const l={x:n.clientX,y:n.clientY};return vw(l,a)}gt(xw,"isPointerInGraceArea");function gu(n){return a=>a.pointerType==="mouse"?n(a):void 0}gt(gu,"whenMouse");var WM=zM,eD=LM,tD=PM,nD=HM,aD=YM,rD=GM,sD=QM,lD=Object.defineProperty,qs=(n,a)=>lD(n,"name",{value:a,configurable:!0}),fp="DropdownMenu",[oD,h5]=Hn(fp,[ow]),$s=ow(),[iD,yw]=oD(fp),cD=qs(n=>{const{__scopeDropdownMenu:a,children:l,dir:o,open:c,defaultOpen:u,onOpenChange:f,modal:p=!0}=n,g=$s(a),v=h.useRef(null),[x,y]=Ia({prop:c,defaultProp:u??!1,onChange:f,caller:fp});return s.jsx(iD,{scope:a,triggerId:Na(),triggerRef:v,contentId:Na(),open:x,onOpenChange:y,onOpenToggle:h.useCallback(()=>y(b=>!b),[y]),modal:p,children:s.jsx(WM,{...g,open:x,onOpenChange:y,dir:o,modal:p,children:l})})},"DropdownMenu"),uD="DropdownMenuTrigger",dD=h.forwardRef(qs(function(a,l){const{__scopeDropdownMenu:o,disabled:c=!1,...u}=a,f=yw(uD,o),p=$s(o),g=Fe(l,f.triggerRef);return s.jsx(eD,{asChild:!0,...p,children:s.jsx(He.button,{type:"button",id:f.triggerId,"aria-haspopup":"menu","aria-expanded":f.open,"aria-controls":f.open?f.contentId:void 0,"data-state":f.open?"open":"closed","data-disabled":c?"":void 0,disabled:c,...u,ref:g,onPointerDown:Se(a.onPointerDown,v=>{!c&&v.button===0&&v.ctrlKey===!1&&(f.onOpenToggle(),f.open||v.preventDefault())}),onKeyDown:Se(a.onKeyDown,v=>{c||(["Enter"," "].includes(v.key)&&f.onOpenToggle(),v.key==="ArrowDown"&&f.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(v.key)&&v.preventDefault())})})})},"DropdownMenuTrigger")),fD=qs(n=>{const{__scopeDropdownMenu:a,...l}=n,o=$s(a);return s.jsx(tD,{...o,...l})},"DropdownMenuPortal"),hD="DropdownMenuContent",mD=h.forwardRef(qs(function(a,l){const{__scopeDropdownMenu:o,...c}=a,u=yw(hD,o),f=$s(o),p=h.useRef(!1);return s.jsx(nD,{id:u.contentId,"aria-labelledby":u.triggerId,...f,...c,ref:l,onCloseAutoFocus:Se(a.onCloseAutoFocus,g=>{var v;p.current||(v=u.triggerRef.current)==null||v.focus(),p.current=!1,g.preventDefault()}),onInteractOutside:Se(a.onInteractOutside,g=>{const v=g.detail.originalEvent,x=v.button===0&&v.ctrlKey===!0,y=v.button===2||x;(!u.modal||y)&&(p.current=!0)}),style:{...a.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")),pD=h.forwardRef(qs(function(a,l){const{__scopeDropdownMenu:o,...c}=a,u=$s(o);return s.jsx(aD,{...u,...c,ref:l})},"DropdownMenuLabel")),gD=h.forwardRef(qs(function(a,l){const{__scopeDropdownMenu:o,...c}=a,u=$s(o);return s.jsx(rD,{...u,...c,ref:l})},"DropdownMenuItem")),vD=h.forwardRef(qs(function(a,l){const{__scopeDropdownMenu:o,...c}=a,u=$s(o);return s.jsx(sD,{...u,...c,ref:l})},"DropdownMenuSeparator")),xD=cD,yD=dD,bD=fD,bw=mD,ww=pD,jw=gD,Sw=vD;const wD=xD,jD=yD,Cw=h.forwardRef(({className:n,sideOffset:a=4,...l},o)=>s.jsx(bD,{children:s.jsx(bw,{ref:o,sideOffset:a,className:Re("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",n),...l})}));Cw.displayName=bw.displayName;const Nw=h.forwardRef(({className:n,inset:a,...l},o)=>s.jsx(jw,{ref:o,className:Re("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",a&&"pl-8",n),...l}));Nw.displayName=jw.displayName;const SD=h.forwardRef(({className:n,...a},l)=>s.jsx(ww,{ref:l,className:Re("px-2 py-1.5 text-sm font-semibold",n),...a}));SD.displayName=ww.displayName;const CD=h.forwardRef(({className:n,...a},l)=>s.jsx(Sw,{ref:l,className:Re("-mx-1 my-1 h-px bg-muted",n),...a}));CD.displayName=Sw.displayName;function ND(){const{theme:n,setTheme:a}=_R(),{user:l,logout:o}=Lm(),[c,u]=h.useState(!1),[f,p]=h.useState(null),g=pi(),v=n==="light"?IE:n==="dark"?TE:RE;return h.useEffect(()=>{ge.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:[(f==null?void 0:f.hasUpdate)&&s.jsxs(ie,{variant:"ghost",size:"sm",title:`New version available: v${f.latestVersion} — go to Settings → System to update`,onClick:()=>g("/settings?tab=system"),children:[s.jsx(mE,{className:"mr-1 h-4 w-4 text-blue-500"}),"Update v",f.latestVersion]}),s.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>a(n==="dark"?"light":"dark"),children:s.jsx(v,{className:"h-4 w-4"})}),s.jsxs(wD,{open:c,onOpenChange:u,children:[s.jsx(jD,{asChild:!0,children:s.jsx(ie,{variant:"ghost",children:(l==null?void 0:l.username)??"admin"})}),s.jsx(Cw,{align:"end",children:s.jsxs(Nw,{onClick:()=>void o(),children:[s.jsx(EE,{className:"mr-2 h-4 w-4"})," Sign out"]})})]})]})]})}const Ce=h.forwardRef(({className:n,type:a,...l},o)=>s.jsx("input",{type:a,className:Re("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:o,...l}));Ce.displayName="Input";var ED=Object.defineProperty,RD=(n,a)=>ED(n,"name",{value:a,configurable:!0}),TD=h.forwardRef(RD(function(a,l){return s.jsx(He.label,{...a,ref:l,onMouseDown:o=>{var u;o.target.closest("button, input, select, textarea")||((u=a.onMouseDown)==null||u.call(a,o),!o.defaultPrevented&&o.detail>1&&o.preventDefault())}})},"Label")),Ew=TD;const be=h.forwardRef(({className:n,...a},l)=>s.jsx(Ew,{ref:l,className:Re("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",n),...a}));be.displayName=Ew.displayName;const rt=h.forwardRef(({className:n,...a},l)=>s.jsx("div",{ref:l,className:Re("rounded-lg border bg-card text-card-foreground shadow-sm",n),...a}));rt.displayName="Card";const st=h.forwardRef(({className:n,...a},l)=>s.jsx("div",{ref:l,className:Re("flex flex-col space-y-1.5 p-6",n),...a}));st.displayName="CardHeader";const lt=h.forwardRef(({className:n,...a},l)=>s.jsx("h3",{ref:l,className:Re("text-lg font-semibold leading-none tracking-tight",n),...a}));lt.displayName="CardTitle";const kn=h.forwardRef(({className:n,...a},l)=>s.jsx("p",{ref:l,className:Re("text-sm text-muted-foreground",n),...a}));kn.displayName="CardDescription";const ot=h.forwardRef(({className:n,...a},l)=>s.jsx("div",{ref:l,className:Re("p-6 pt-0",n),...a}));ot.displayName="CardContent";const Rw=h.forwardRef(({className:n,...a},l)=>s.jsx("div",{ref:l,className:Re("flex items-center p-6 pt-0",n),...a}));Rw.displayName="CardFooter";var AD=n=>{switch(n){case"success":return OD;case"info":return _D;case"warning":return kD;case"error":return zD;default:return null}},MD=Array(12).fill(0),DD=({visible:n,className:a})=>me.createElement("div",{className:["sonner-loading-wrapper",a].filter(Boolean).join(" "),"data-visible":n},me.createElement("div",{className:"sonner-spinner"},MD.map((l,o)=>me.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),OD=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},me.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"})),kD=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},me.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"})),_D=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},me.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"})),zD=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},me.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"})),LD=me.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"},me.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),me.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),UD=()=>{let[n,a]=me.useState(document.hidden);return me.useEffect(()=>{let l=()=>{a(document.hidden)};return document.addEventListener("visibilitychange",l),()=>window.removeEventListener("visibilitychange",l)},[]),n},im=1,ID=class{constructor(){this.subscribe=n=>(this.subscribers.push(n),()=>{let a=this.subscribers.indexOf(n);this.subscribers.splice(a,1)}),this.publish=n=>{this.subscribers.forEach(a=>a(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n]},this.create=n=>{var a;let{message:l,...o}=n,c=typeof(n==null?void 0:n.id)=="number"||((a=n.id)==null?void 0:a.length)>0?n.id:im++,u=this.toasts.find(p=>p.id===c),f=n.dismissible===void 0?!0:n.dismissible;return this.dismissedToasts.has(c)&&this.dismissedToasts.delete(c),u?this.toasts=this.toasts.map(p=>p.id===c?(this.publish({...p,...n,id:c,title:l}),{...p,...n,id:c,dismissible:f,title:l}):p):this.addToast({title:l,...o,dismissible:f,id:c}),c},this.dismiss=n=>(this.dismissedToasts.add(n),n||this.toasts.forEach(a=>{this.subscribers.forEach(l=>l({id:a.id,dismiss:!0}))}),this.subscribers.forEach(a=>a({id:n,dismiss:!0})),n),this.message=(n,a)=>this.create({...a,message:n}),this.error=(n,a)=>this.create({...a,message:n,type:"error"}),this.success=(n,a)=>this.create({...a,type:"success",message:n}),this.info=(n,a)=>this.create({...a,type:"info",message:n}),this.warning=(n,a)=>this.create({...a,type:"warning",message:n}),this.loading=(n,a)=>this.create({...a,type:"loading",message:n}),this.promise=(n,a)=>{if(!a)return;let l;a.loading!==void 0&&(l=this.create({...a,promise:n,type:"loading",message:a.loading,description:typeof a.description!="function"?a.description:void 0}));let o=n instanceof Promise?n:n(),c=l!==void 0,u,f=o.then(async g=>{if(u=["resolve",g],me.isValidElement(g))c=!1,this.create({id:l,type:"default",message:g});else if(BD(g)&&!g.ok){c=!1;let v=typeof a.error=="function"?await a.error(`HTTP error! status: ${g.status}`):a.error,x=typeof a.description=="function"?await a.description(`HTTP error! status: ${g.status}`):a.description;this.create({id:l,type:"error",message:v,description:x})}else if(a.success!==void 0){c=!1;let v=typeof a.success=="function"?await a.success(g):a.success,x=typeof a.description=="function"?await a.description(g):a.description;this.create({id:l,type:"success",message:v,description:x})}}).catch(async g=>{if(u=["reject",g],a.error!==void 0){c=!1;let v=typeof a.error=="function"?await a.error(g):a.error,x=typeof a.description=="function"?await a.description(g):a.description;this.create({id:l,type:"error",message:v,description:x})}}).finally(()=>{var g;c&&(this.dismiss(l),l=void 0),(g=a.finally)==null||g.call(a)}),p=()=>new Promise((g,v)=>f.then(()=>u[0]==="reject"?v(u[1]):g(u[1])).catch(v));return typeof l!="string"&&typeof l!="number"?{unwrap:p}:Object.assign(l,{unwrap:p})},this.custom=(n,a)=>{let l=(a==null?void 0:a.id)||im++;return this.create({jsx:n(l),id:l,...a}),l},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},On=new ID,PD=(n,a)=>{let l=(a==null?void 0:a.id)||im++;return On.addToast({title:n,...a,id:l}),l},BD=n=>n&&typeof n=="object"&&"ok"in n&&typeof n.ok=="boolean"&&"status"in n&&typeof n.status=="number",HD=PD,qD=()=>On.toasts,$D=()=>On.getActiveToasts(),de=Object.assign(HD,{success:On.success,info:On.info,warning:On.warning,error:On.error,custom:On.custom,message:On.message,promise:On.promise,dismiss:On.dismiss,loading:On.loading},{getHistory:qD,getToasts:$D});function VD(n,{insertAt:a}={}){if(typeof document>"u")return;let l=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",a==="top"&&l.firstChild?l.insertBefore(o,l.firstChild):l.appendChild(o),o.styleSheet?o.styleSheet.cssText=n:o.appendChild(document.createTextNode(n))}VD(`: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%)}
|
|
381
|
-
`);function Gc(n){return n.label!==void 0}var YD=3,GD="32px",FD="16px",Ob=4e3,XD=356,KD=14,QD=20,ZD=200;function wa(...n){return n.filter(Boolean).join(" ")}function JD(n){let[a,l]=n.split("-"),o=[];return a&&o.push(a),l&&o.push(l),o}var WD=n=>{var a,l,o,c,u,f,p,g,v,x,y;let{invert:b,toast:w,unstyled:N,interacting:S,setHeights:C,visibleToasts:R,heights:D,index:A,toasts:M,expanded:O,removeToast:E,defaultRichColors:_,closeButton:U,style:$,cancelButtonStyle:te,actionButtonStyle:V,className:H="",descriptionClassName:ae="",duration:ee,position:B,gap:k,loadingIcon:q,expandByDefault:Z,classNames:J,icons:ne,closeButtonAriaLabel:z="Close toast",pauseWhenPageIsHidden:L}=n,[F,se]=me.useState(null),[pe,ye]=me.useState(null),[G,ue]=me.useState(!1),[he,xe]=me.useState(!1),[Ae,Ne]=me.useState(!1),[Oe,Qe]=me.useState(!1),[et,ce]=me.useState(!1),[Le,qe]=me.useState(0),[_t,St]=me.useState(0),Wt=me.useRef(w.duration||ee||Ob),mn=me.useRef(null),en=me.useRef(null),Ct=A===0,xn=A+1<=R,At=w.type,Mt=w.dismissible!==!1,pn=w.className||"",pa=w.descriptionClassName||"",Aa=me.useMemo(()=>D.findIndex(Ee=>Ee.toastId===w.id)||0,[D,w.id]),Wn=me.useMemo(()=>{var Ee;return(Ee=w.closeButton)!=null?Ee:U},[w.closeButton,U]),hs=me.useMemo(()=>w.duration||ee||Ob,[w.duration,ee]),ga=me.useRef(0),Dt=me.useRef(0),yn=me.useRef(0),Tt=me.useRef(null),[so,Ys]=B.split("-"),Gs=me.useMemo(()=>D.reduce((Ee,_e,Ue)=>Ue>=Aa?Ee:Ee+_e.height,0),[D,Aa]),Ya=UD(),Ar=w.invert||b,xt=At==="loading";Dt.current=me.useMemo(()=>Aa*k+Gs,[Aa,Gs]),me.useEffect(()=>{Wt.current=hs},[hs]),me.useEffect(()=>{ue(!0)},[]),me.useEffect(()=>{let Ee=en.current;if(Ee){let _e=Ee.getBoundingClientRect().height;return St(_e),C(Ue=>[{toastId:w.id,height:_e,position:w.position},...Ue]),()=>C(Ue=>Ue.filter(vt=>vt.toastId!==w.id))}},[C,w.id]),me.useLayoutEffect(()=>{if(!G)return;let Ee=en.current,_e=Ee.style.height;Ee.style.height="auto";let Ue=Ee.getBoundingClientRect().height;Ee.style.height=_e,St(Ue),C(vt=>vt.find(Nt=>Nt.toastId===w.id)?vt.map(Nt=>Nt.toastId===w.id?{...Nt,height:Ue}:Nt):[{toastId:w.id,height:Ue,position:w.position},...vt])},[G,w.title,w.description,C,w.id]);let at=me.useCallback(()=>{xe(!0),qe(Dt.current),C(Ee=>Ee.filter(_e=>_e.toastId!==w.id)),setTimeout(()=>{E(w)},ZD)},[w,E,C,Dt]);me.useEffect(()=>{if(w.promise&&At==="loading"||w.duration===1/0||w.type==="loading")return;let Ee;return O||S||L&&Ya?(()=>{if(yn.current<ga.current){let _e=new Date().getTime()-ga.current;Wt.current=Wt.current-_e}yn.current=new Date().getTime()})():Wt.current!==1/0&&(ga.current=new Date().getTime(),Ee=setTimeout(()=>{var _e;(_e=w.onAutoClose)==null||_e.call(w,w),at()},Wt.current)),()=>clearTimeout(Ee)},[O,S,w,At,L,Ya,at]),me.useEffect(()=>{w.delete&&at()},[at,w.delete]);function It(){var Ee,_e,Ue;return ne!=null&&ne.loading?me.createElement("div",{className:wa(J==null?void 0:J.loader,(Ee=w==null?void 0:w.classNames)==null?void 0:Ee.loader,"sonner-loader"),"data-visible":At==="loading"},ne.loading):q?me.createElement("div",{className:wa(J==null?void 0:J.loader,(_e=w==null?void 0:w.classNames)==null?void 0:_e.loader,"sonner-loader"),"data-visible":At==="loading"},q):me.createElement(DD,{className:wa(J==null?void 0:J.loader,(Ue=w==null?void 0:w.classNames)==null?void 0:Ue.loader),visible:At==="loading"})}return me.createElement("li",{tabIndex:0,ref:en,className:wa(H,pn,J==null?void 0:J.toast,(a=w==null?void 0:w.classNames)==null?void 0:a.toast,J==null?void 0:J.default,J==null?void 0:J[At],(l=w==null?void 0:w.classNames)==null?void 0:l[At]),"data-sonner-toast":"","data-rich-colors":(o=w.richColors)!=null?o:_,"data-styled":!(w.jsx||w.unstyled||N),"data-mounted":G,"data-promise":!!w.promise,"data-swiped":et,"data-removed":he,"data-visible":xn,"data-y-position":so,"data-x-position":Ys,"data-index":A,"data-front":Ct,"data-swiping":Ae,"data-dismissible":Mt,"data-type":At,"data-invert":Ar,"data-swipe-out":Oe,"data-swipe-direction":pe,"data-expanded":!!(O||Z&&G),style:{"--index":A,"--toasts-before":A,"--z-index":M.length-A,"--offset":`${he?Le:Dt.current}px`,"--initial-height":Z?"auto":`${_t}px`,...$,...w.style},onDragEnd:()=>{Ne(!1),se(null),Tt.current=null},onPointerDown:Ee=>{xt||!Mt||(mn.current=new Date,qe(Dt.current),Ee.target.setPointerCapture(Ee.pointerId),Ee.target.tagName!=="BUTTON"&&(Ne(!0),Tt.current={x:Ee.clientX,y:Ee.clientY}))},onPointerUp:()=>{var Ee,_e,Ue,vt;if(Oe||!Mt)return;Tt.current=null;let Nt=Number(((Ee=en.current)==null?void 0:Ee.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ut=Number(((_e=en.current)==null?void 0:_e.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Yt=new Date().getTime()-((Ue=mn.current)==null?void 0:Ue.getTime()),yt=F==="x"?Nt:ut,zt=Math.abs(yt)/Yt;if(Math.abs(yt)>=QD||zt>.11){qe(Dt.current),(vt=w.onDismiss)==null||vt.call(w,w),ye(F==="x"?Nt>0?"right":"left":ut>0?"down":"up"),at(),Qe(!0),ce(!1);return}Ne(!1),se(null)},onPointerMove:Ee=>{var _e,Ue,vt,Nt;if(!Tt.current||!Mt||((_e=window.getSelection())==null?void 0:_e.toString().length)>0)return;let ut=Ee.clientY-Tt.current.y,Yt=Ee.clientX-Tt.current.x,yt=(Ue=n.swipeDirections)!=null?Ue:JD(B);!F&&(Math.abs(Yt)>1||Math.abs(ut)>1)&&se(Math.abs(Yt)>Math.abs(ut)?"x":"y");let zt={x:0,y:0};F==="y"?(yt.includes("top")||yt.includes("bottom"))&&(yt.includes("top")&&ut<0||yt.includes("bottom")&&ut>0)&&(zt.y=ut):F==="x"&&(yt.includes("left")||yt.includes("right"))&&(yt.includes("left")&&Yt<0||yt.includes("right")&&Yt>0)&&(zt.x=Yt),(Math.abs(zt.x)>0||Math.abs(zt.y)>0)&&ce(!0),(vt=en.current)==null||vt.style.setProperty("--swipe-amount-x",`${zt.x}px`),(Nt=en.current)==null||Nt.style.setProperty("--swipe-amount-y",`${zt.y}px`)}},Wn&&!w.jsx?me.createElement("button",{"aria-label":z,"data-disabled":xt,"data-close-button":!0,onClick:xt||!Mt?()=>{}:()=>{var Ee;at(),(Ee=w.onDismiss)==null||Ee.call(w,w)},className:wa(J==null?void 0:J.closeButton,(c=w==null?void 0:w.classNames)==null?void 0:c.closeButton)},(u=ne==null?void 0:ne.close)!=null?u:LD):null,w.jsx||h.isValidElement(w.title)?w.jsx?w.jsx:typeof w.title=="function"?w.title():w.title:me.createElement(me.Fragment,null,At||w.icon||w.promise?me.createElement("div",{"data-icon":"",className:wa(J==null?void 0:J.icon,(f=w==null?void 0:w.classNames)==null?void 0:f.icon)},w.promise||w.type==="loading"&&!w.icon?w.icon||It():null,w.type!=="loading"?w.icon||(ne==null?void 0:ne[At])||AD(At):null):null,me.createElement("div",{"data-content":"",className:wa(J==null?void 0:J.content,(p=w==null?void 0:w.classNames)==null?void 0:p.content)},me.createElement("div",{"data-title":"",className:wa(J==null?void 0:J.title,(g=w==null?void 0:w.classNames)==null?void 0:g.title)},typeof w.title=="function"?w.title():w.title),w.description?me.createElement("div",{"data-description":"",className:wa(ae,pa,J==null?void 0:J.description,(v=w==null?void 0:w.classNames)==null?void 0:v.description)},typeof w.description=="function"?w.description():w.description):null),h.isValidElement(w.cancel)?w.cancel:w.cancel&&Gc(w.cancel)?me.createElement("button",{"data-button":!0,"data-cancel":!0,style:w.cancelButtonStyle||te,onClick:Ee=>{var _e,Ue;Gc(w.cancel)&&Mt&&((Ue=(_e=w.cancel).onClick)==null||Ue.call(_e,Ee),at())},className:wa(J==null?void 0:J.cancelButton,(x=w==null?void 0:w.classNames)==null?void 0:x.cancelButton)},w.cancel.label):null,h.isValidElement(w.action)?w.action:w.action&&Gc(w.action)?me.createElement("button",{"data-button":!0,"data-action":!0,style:w.actionButtonStyle||V,onClick:Ee=>{var _e,Ue;Gc(w.action)&&((Ue=(_e=w.action).onClick)==null||Ue.call(_e,Ee),!Ee.defaultPrevented&&at())},className:wa(J==null?void 0:J.actionButton,(y=w==null?void 0:w.classNames)==null?void 0:y.actionButton)},w.action.label):null))};function kb(){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 eO(n,a){let l={};return[n,a].forEach((o,c)=>{let u=c===1,f=u?"--mobile-offset":"--offset",p=u?FD:GD;function g(v){["top","right","bottom","left"].forEach(x=>{l[`${f}-${x}`]=typeof v=="number"?`${v}px`:v})}typeof o=="number"||typeof o=="string"?g(o):typeof o=="object"?["top","right","bottom","left"].forEach(v=>{o[v]===void 0?l[`${f}-${v}`]=p:l[`${f}-${v}`]=typeof o[v]=="number"?`${o[v]}px`:o[v]}):g(p)}),l}var tO=h.forwardRef(function(n,a){let{invert:l,position:o="bottom-right",hotkey:c=["altKey","KeyT"],expand:u,closeButton:f,className:p,offset:g,mobileOffset:v,theme:x="light",richColors:y,duration:b,style:w,visibleToasts:N=YD,toastOptions:S,dir:C=kb(),gap:R=KD,loadingIcon:D,icons:A,containerAriaLabel:M="Notifications",pauseWhenPageIsHidden:O}=n,[E,_]=me.useState([]),U=me.useMemo(()=>Array.from(new Set([o].concat(E.filter(L=>L.position).map(L=>L.position)))),[E,o]),[$,te]=me.useState([]),[V,H]=me.useState(!1),[ae,ee]=me.useState(!1),[B,k]=me.useState(x!=="system"?x:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),q=me.useRef(null),Z=c.join("+").replace(/Key/g,"").replace(/Digit/g,""),J=me.useRef(null),ne=me.useRef(!1),z=me.useCallback(L=>{_(F=>{var se;return(se=F.find(pe=>pe.id===L.id))!=null&&se.delete||On.dismiss(L.id),F.filter(({id:pe})=>pe!==L.id)})},[]);return me.useEffect(()=>On.subscribe(L=>{if(L.dismiss){_(F=>F.map(se=>se.id===L.id?{...se,delete:!0}:se));return}setTimeout(()=>{lE.flushSync(()=>{_(F=>{let se=F.findIndex(pe=>pe.id===L.id);return se!==-1?[...F.slice(0,se),{...F[se],...L},...F.slice(se+1)]:[L,...F]})})})}),[]),me.useEffect(()=>{if(x!=="system"){k(x);return}if(x==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?k("dark"):k("light")),typeof window>"u")return;let L=window.matchMedia("(prefers-color-scheme: dark)");try{L.addEventListener("change",({matches:F})=>{k(F?"dark":"light")})}catch{L.addListener(({matches:se})=>{try{k(se?"dark":"light")}catch(pe){console.error(pe)}})}},[x]),me.useEffect(()=>{E.length<=1&&H(!1)},[E]),me.useEffect(()=>{let L=F=>{var se,pe;c.every(ye=>F[ye]||F.code===ye)&&(H(!0),(se=q.current)==null||se.focus()),F.code==="Escape"&&(document.activeElement===q.current||(pe=q.current)!=null&&pe.contains(document.activeElement))&&H(!1)};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[c]),me.useEffect(()=>{if(q.current)return()=>{J.current&&(J.current.focus({preventScroll:!0}),J.current=null,ne.current=!1)}},[q.current]),me.createElement("section",{ref:a,"aria-label":`${M} ${Z}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},U.map((L,F)=>{var se;let[pe,ye]=L.split("-");return E.length?me.createElement("ol",{key:L,dir:C==="auto"?kb():C,tabIndex:-1,ref:q,className:p,"data-sonner-toaster":!0,"data-theme":B,"data-y-position":pe,"data-lifted":V&&E.length>1&&!u,"data-x-position":ye,style:{"--front-toast-height":`${((se=$[0])==null?void 0:se.height)||0}px`,"--width":`${XD}px`,"--gap":`${R}px`,...w,...eO(g,v)},onBlur:G=>{ne.current&&!G.currentTarget.contains(G.relatedTarget)&&(ne.current=!1,J.current&&(J.current.focus({preventScroll:!0}),J.current=null))},onFocus:G=>{G.target instanceof HTMLElement&&G.target.dataset.dismissible==="false"||ne.current||(ne.current=!0,J.current=G.relatedTarget)},onMouseEnter:()=>H(!0),onMouseMove:()=>H(!0),onMouseLeave:()=>{ae||H(!1)},onDragEnd:()=>H(!1),onPointerDown:G=>{G.target instanceof HTMLElement&&G.target.dataset.dismissible==="false"||ee(!0)},onPointerUp:()=>ee(!1)},E.filter(G=>!G.position&&F===0||G.position===L).map((G,ue)=>{var he,xe;return me.createElement(WD,{key:G.id,icons:A,index:ue,toast:G,defaultRichColors:y,duration:(he=S==null?void 0:S.duration)!=null?he:b,className:S==null?void 0:S.className,descriptionClassName:S==null?void 0:S.descriptionClassName,invert:l,visibleToasts:N,closeButton:(xe=S==null?void 0:S.closeButton)!=null?xe:f,interacting:ae,position:L,style:S==null?void 0:S.style,unstyled:S==null?void 0:S.unstyled,classNames:S==null?void 0:S.classNames,cancelButtonStyle:S==null?void 0:S.cancelButtonStyle,actionButtonStyle:S==null?void 0:S.actionButtonStyle,removeToast:z,toasts:E.filter(Ae=>Ae.position==G.position),heights:$.filter(Ae=>Ae.position==G.position),setHeights:te,expandByDefault:u,gap:R,loadingIcon:D,expanded:V,pauseWhenPageIsHidden:O,swipeDirections:n.swipeDirections})})):null}))});function nO(){const{login:n}=Lm(),[a,l]=h.useState("admin"),[o,c]=h.useState(""),[u,f]=h.useState(""),[p,g]=h.useState(""),[v,x]=h.useState(!1),[y,b]=h.useState(!1),w=pi(),N=Bn();return s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:s.jsxs(rt,{className:"w-full max-w-sm",children:[s.jsxs(st,{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(lt,{children:"Sign in"})]}),s.jsx(kn,{children:"Enter your admin credentials."})]}),s.jsxs(ot,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Username"}),s.jsx(Ce,{value:a,onChange:S=>l(S.target.value),autoFocus:!0})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Password"}),s.jsx(Ce,{type:"password",value:o,onChange:S=>c(S.target.value)})]}),v&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"2FA code (or recovery code)"}),s.jsx(Ce,{value:u,onChange:S=>f(S.target.value),placeholder:"123456",maxLength:6})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Recovery code (alternative)"}),s.jsx(Ce,{value:p,onChange:S=>g(S.target.value),placeholder:"ABCD12-EF3456"})]})]})]}),s.jsx("div",{className:"px-6 pb-6",children:s.jsx(ie,{className:"w-full",disabled:y,onClick:async()=>{var S,C;b(!0);try{if((await n(a,o,u||void 0,p||void 0)).totpRequired){x(!0);return}const D=((C=(S=N.state)==null?void 0:S.from)==null?void 0:C.pathname)??"/";w(D,{replace:!0})}catch(R){de.error(R.message)}finally{b(!1)}},children:"Sign in"})})]})})}function aO(){const[n,a]=h.useState("admin"),[l,o]=h.useState(""),[c,u]=h.useState(""),[f,p]=h.useState(!1),[g,v]=h.useState(!0),[x,y]=h.useState(null),[b,w]=h.useState(""),[N,S]=h.useState(!1);h.useEffect(()=>{ge.get("/api/admin/setup/status").then(D=>v(!D.masterKeyConfigured)).catch(()=>v(!0))},[]);const C=!g||c.trim().length>=32,R=!f&&l.length>=12&&C;return s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:s.jsxs(rt,{className:"w-full max-w-md",children:[s.jsxs(st,{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(lt,{children:"Welcome to LateDev Router"})]}),s.jsx(kn,{children:"Set up the administrator account to get started."})]}),s.jsxs(ot,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Username"}),s.jsx(Ce,{value:n,onChange:D=>a(D.target.value)})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Password (12+ chars)"}),s.jsx(Ce,{type:"password",value:l,onChange:D=>o(D.target.value)})]}),g&&s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Master encryption key (required, 32+ chars)"}),s.jsx(Ce,{type:"password",value:c,onChange:D=>u(D.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(Rw,{className:"flex-col items-stretch gap-4",children:[s.jsx(ie,{disabled:!R,onClick:async()=>{p(!0);try{await ge.post("/api/admin/setup",{username:n,password:l,setupMasterKey:g?c.trim():void 0}),de.success("Admin account created"),window.location.assign("/login")}catch(D){de.error(D.message)}finally{p(!1)}},children:"Create admin"}),s.jsxs("div",{className:"border-t pt-4 space-y-2",children:[s.jsx(be,{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(Ce,{type:"file",accept:".json,application/json",onChange:D=>{var A;return y(((A=D.target.files)==null?void 0:A[0])??null)}}),s.jsx(Ce,{inputMode:"numeric",maxLength:6,value:b,onChange:D=>w(D.target.value.replace(/\D/g,"")),placeholder:"Backup passphrase (6 digits)"}),s.jsx(ie,{variant:"outline",disabled:!x||b.length!==6||N,onClick:async()=>{var D,A;if(x){S(!0);try{const M=JSON.parse(await x.text()),O=await fetch("/api/admin/backup/restore",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({backup:M,passphrase:b})});if(!O.ok)throw new Error(((A=(D=await O.json())==null?void 0:D.error)==null?void 0:A.message)??"Import failed");de.success("Database imported"),window.location.assign("/login")}catch(M){de.error(M.message)}finally{S(!1)}}},children:"Import database"})]})]})]})})}function Va({title:n,description:a,actions:l,className:o}){return s.jsxs("div",{className:Re("mb-6 flex items-start justify-between gap-4",o),children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:n}),a&&s.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:a})]}),l&&s.jsx("div",{className:"flex items-center gap-2",children:l})]})}const rO=W0("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 We({className:n,variant:a,...l}){return s.jsx("div",{className:Re(rO({variant:a}),n),...l})}function sO(){const[n,a]=h.useState(null);return h.useEffect(()=>{ge.get("/api/admin/dashboard").then(a).catch(()=>a(null))},[]),n?s.jsxs("div",{children:[s.jsx(Va,{title:"Dashboard",description:"Operational summary for today",actions:s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ie,{asChild:!0,variant:"outline",size:"sm",children:s.jsxs(_s,{to:"/providers",children:[s.jsx(Xl,{className:"mr-1 h-4 w-4"})," Provider"]})}),s.jsx(ie,{asChild:!0,variant:"outline",size:"sm",children:s.jsxs(_s,{to:"/combos",children:[s.jsx(L0,{className:"mr-1 h-4 w-4"})," Combo"]})}),s.jsx(ie,{asChild:!0,variant:"outline",size:"sm",children:s.jsxs(_s,{to:"/api-keys",children:[s.jsx(z0,{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(rt,{children:[s.jsx(st,{className:"pb-1",children:s.jsx(lt,{className:"text-sm text-muted-foreground",children:"Requests today"})}),s.jsx(ot,{className:"text-2xl font-semibold",children:Xt(n.today.total)})]}),s.jsxs(rt,{children:[s.jsx(st,{className:"pb-1",children:s.jsx(lt,{className:"text-sm text-muted-foreground",children:"Success rate"})}),s.jsx(ot,{className:"text-2xl font-semibold",children:n.today.total?Mu(n.today.success/n.today.total):"—"})]}),s.jsxs(rt,{children:[s.jsx(st,{className:"pb-1",children:s.jsx(lt,{className:"text-sm text-muted-foreground",children:"Failed"})}),s.jsx(ot,{className:"text-2xl font-semibold",children:Xt(n.today.failed)})]}),s.jsxs(rt,{children:[s.jsx(st,{className:"pb-1",children:s.jsx(lt,{className:"text-sm text-muted-foreground",children:"Tokens today"})}),s.jsx(ot,{className:"text-2xl font-semibold",children:Xt(n.today.totalTokens)})]})]}),s.jsxs("div",{className:"mt-6 grid gap-4 lg:grid-cols-2",children:[s.jsxs(rt,{children:[s.jsxs(st,{children:[s.jsx(lt,{className:"text-base",children:"Provider health"}),s.jsxs(kn,{children:[n.providers.length," configured"]})]}),s.jsxs(ot,{className:"space-y-2",children:[n.providers.length===0&&s.jsxs("p",{className:"text-sm text-muted-foreground",children:["No providers yet. ",s.jsx(_s,{to:"/providers",className:"text-primary",children:"Add one"}),"."]}),n.providers.map(l=>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(U0,{className:"h-4 w-4 text-muted-foreground"}),s.jsx("span",{className:"font-medium",children:l.name}),s.jsx("span",{className:"text-xs text-muted-foreground",children:l.slug}),s.jsx(We,{variant:"outline",className:"ml-2",children:l.type})]}),s.jsx(We,{variant:l.health==="healthy"?"success":l.health==="down"?"destructive":"secondary",children:l.health})]},l.id))]})]}),s.jsxs(rt,{children:[s.jsxs(st,{children:[s.jsx(lt,{className:"text-base",children:"Recent failures"}),s.jsx(kn,{children:"Today"})]}),s.jsxs(ot,{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(l=>{var o;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:l.requestedModel}),s.jsxs("div",{className:"text-xs text-muted-foreground",children:[l.errorType??`HTTP ${l.httpStatus}`," — ",(o=l.errorMessage)==null?void 0:o.slice(0,60)]})]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:$m(l.createdAt)})]},l.id)})]})]})]})]}):s.jsx("div",{className:"text-muted-foreground",children:"Loading…"})}const Un=h.forwardRef(({className:n,...a},l)=>s.jsx("div",{className:"relative w-full overflow-auto",children:s.jsx("table",{ref:l,className:Re("w-full caption-bottom text-sm",n),...a})}));Un.displayName="Table";const In=h.forwardRef(({className:n,...a},l)=>s.jsx("thead",{ref:l,className:Re("[&_tr]:border-b",n),...a}));In.displayName="TableHeader";const Pn=h.forwardRef(({className:n,...a},l)=>s.jsx("tbody",{ref:l,className:Re("[&_tr:last-child]:border-0",n),...a}));Pn.displayName="TableBody";const Be=h.forwardRef(({className:n,...a},l)=>s.jsx("tr",{ref:l,className:Re("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",n),...a}));Be.displayName="TableRow";const ve=h.forwardRef(({className:n,...a},l)=>s.jsx("th",{ref:l,className:Re("h-10 px-2 text-left align-middle font-medium text-muted-foreground",n),...a}));ve.displayName="TableHead";const fe=h.forwardRef(({className:n,...a},l)=>s.jsx("td",{ref:l,className:Re("p-2 align-middle",n),...a}));fe.displayName="TableCell";var lO=Object.defineProperty,Jn=(n,a)=>lO(n,"name",{value:a,configurable:!0}),hp="Dialog",[Tw,Aw]=Hn(hp),[oO,Ta]=Tw(hp),Mw=Jn(n=>{const{__scopeDialog:a,children:l,open:o,defaultOpen:c,onOpenChange:u,modal:f=!0}=n,p=h.useRef(null),g=h.useRef(null),[v,x]=Ia({prop:o,defaultProp:c??!1,onChange:u,caller:hp}),[y,b]=h.useState(0),[w,N]=h.useState(0);return s.jsx(oO,{scope:a,triggerRef:p,contentRef:g,contentId:Na(),titleId:Na(),descriptionId:Na(),titlePresent:y>0,descriptionPresent:w>0,setTitleCount:b,setDescriptionCount:N,open:v,onOpenChange:x,onOpenToggle:h.useCallback(()=>x(S=>!S),[x]),modal:f,children:l})},"Dialog"),iO="DialogTrigger",Dw=h.forwardRef(Jn(function(a,l){const{__scopeDialog:o,...c}=a,u=Ta(iO,o),f=Fe(l,u.triggerRef);return s.jsx(He.button,{type:"button","aria-haspopup":"dialog","aria-expanded":u.open,"aria-controls":u.open?u.contentId:void 0,"data-state":Yu(u.open),...c,ref:f,onClick:Se(a.onClick,u.onOpenToggle)})},"DialogTrigger")),Ow="DialogPortal",[cO,kw]=Tw(Ow,{forceMount:void 0}),_w=Jn(n=>{const{__scopeDialog:a,forceMount:l,children:o,container:c}=n,u=Ta(Ow,a);return s.jsx(cO,{scope:a,forceMount:l,children:h.Children.map(o,f=>s.jsx(Er,{present:l||u.open,children:s.jsx(lp,{asChild:!0,container:c,children:f})}))})},"DialogPortal"),cm="DialogOverlay",mp=h.forwardRef(Jn(function(a,l){const o=kw(cm,a.__scopeDialog),{forceMount:c=o.forceMount,...u}=a,f=Ta(cm,a.__scopeDialog);return f.modal?s.jsx(Er,{present:c||f.open,children:s.jsx(dO,{...u,ref:l})}):null},"DialogOverlay")),uO=Ua("DialogOverlay.RemoveScroll"),dO=h.forwardRef(Jn(function(a,l){const{__scopeDialog:o,...c}=a,u=Ta(cm,o),f=h1(),p=Fe(l,f);return s.jsx($u,{as:uO,allowPinchZoom:!0,shards:[u.contentRef],children:s.jsx(He.div,{"data-state":Yu(u.open),...c,ref:p,style:{pointerEvents:"auto",...c.style}})})},"DialogOverlayImpl")),oi="DialogContent",pp=h.forwardRef(Jn(function(a,l){const o=kw(oi,a.__scopeDialog),{forceMount:c=o.forceMount,...u}=a,f=Ta(oi,a.__scopeDialog);return s.jsx(Er,{present:c||f.open,children:f.modal?s.jsx(fO,{...u,ref:l}):s.jsx(hO,{...u,ref:l})})},"DialogContent")),fO=h.forwardRef(Jn(function(a,l){const o=Ta(oi,a.__scopeDialog),c=h.useRef(null),u=Fe(l,o.contentRef,c);return h.useEffect(()=>{const f=c.current;if(f)return cp(f)},[]),s.jsx(zw,{...a,ref:u,trapFocus:o.open,disableOutsidePointerEvents:o.open,onCloseAutoFocus:Se(a.onCloseAutoFocus,f=>{var p;f.preventDefault(),(p=o.triggerRef.current)==null||p.focus()}),onPointerDownOutside:Se(a.onPointerDownOutside,f=>{const p=f.detail.originalEvent,g=p.button===0&&p.ctrlKey===!0;(p.button===2||g)&&f.preventDefault()}),onFocusOutside:Se(a.onFocusOutside,f=>f.preventDefault())})},"DialogContentModal")),hO=h.forwardRef(Jn(function(a,l){const o=Ta(oi,a.__scopeDialog),c=h.useRef(!1),u=h.useRef(!1);return s.jsx(zw,{...a,ref:l,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:f=>{var p,g;(p=a.onCloseAutoFocus)==null||p.call(a,f),f.defaultPrevented||(c.current||(g=o.triggerRef.current)==null||g.focus(),f.preventDefault()),c.current=!1,u.current=!1},onInteractOutside:f=>{var v,x;(v=a.onInteractOutside)==null||v.call(a,f),f.defaultPrevented||(c.current=!0,f.detail.originalEvent.type==="pointerdown"&&(u.current=!0));const p=f.target;((x=o.triggerRef.current)==null?void 0:x.contains(p))&&f.preventDefault(),f.detail.originalEvent.type==="focusin"&&u.current&&f.preventDefault()}})},"DialogContentNonModal")),zw=h.forwardRef(Jn(function(a,l){const{__scopeDialog:o,trapFocus:c,onOpenAutoFocus:u,onCloseAutoFocus:f,...p}=a,g=Ta(oi,o);return yi(),s.jsx(s.Fragment,{children:s.jsx(Km,{asChild:!0,loop:!0,trapped:c,onMountAutoFocus:u,onUnmountAutoFocus:f,children:s.jsx(Ou,{role:"dialog",id:g.contentId,"aria-describedby":g.descriptionPresent?g.descriptionId:void 0,"aria-labelledby":g.titlePresent?g.titleId:void 0,"data-state":Yu(g.open),...p,ref:l,deferPointerDownOutside:!0,onDismiss:()=>g.onOpenChange(!1)})})})},"DialogContentImpl")),mO="DialogTitle",gp=h.forwardRef(Jn(function(a,l){const{__scopeDialog:o,...c}=a,u=Ta(mO,o),{setTitleCount:f}=u;return Jt(()=>(f(p=>p+1),()=>f(p=>p-1)),[f]),s.jsx(He.h2,{id:u.titleId,...c,ref:l})},"DialogTitle")),pO="DialogDescription",vp=h.forwardRef(Jn(function(a,l){const{__scopeDialog:o,...c}=a,u=Ta(pO,o),{setDescriptionCount:f}=u;return Jt(()=>(f(p=>p+1),()=>f(p=>p-1)),[f]),s.jsx(He.p,{id:u.descriptionId,...c,ref:l})},"DialogDescription")),gO="DialogClose",xp=h.forwardRef(Jn(function(a,l){const{__scopeDialog:o,...c}=a,u=Ta(gO,o);return s.jsx(He.button,{type:"button",...c,ref:l,onClick:Se(a.onClick,()=>u.onOpenChange(!1))})},"DialogClose"));function Yu(n){return n?"open":"closed"}Jn(Yu,"getState");const ln=Mw,wi=Dw,vO=_w,Lw=h.forwardRef(({className:n,...a},l)=>s.jsx(mp,{ref:l,className:Re("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),...a}));Lw.displayName=mp.displayName;const Kt=h.forwardRef(({className:n,children:a,...l},o)=>s.jsxs(vO,{children:[s.jsx(Lw,{}),s.jsxs(pp,{ref:o,className:Re("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),...l,children:[a,s.jsxs(xp,{className:"absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100",children:[s.jsx(Au,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Kt.displayName=pp.displayName;const Qt=({className:n,...a})=>s.jsx("div",{className:Re("flex flex-col space-y-1.5 text-center sm:text-left",n),...a});Qt.displayName="DialogHeader";const Vt=({className:n,...a})=>s.jsx("div",{className:Re("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...a});Vt.displayName="DialogFooter";const Zt=h.forwardRef(({className:n,...a},l)=>s.jsx(gp,{ref:l,className:Re("text-lg font-semibold leading-none tracking-tight",n),...a}));Zt.displayName=gp.displayName;const jr=h.forwardRef(({className:n,...a},l)=>s.jsx(vp,{ref:l,className:Re("text-sm text-muted-foreground",n),...a}));jr.displayName=vp.displayName;var xO=Object.defineProperty,Rr=(n,a)=>xO(n,"name",{value:a,configurable:!0}),yO="AlertDialog",[bO,m5]=Hn(yO,[Aw]),Tr=Aw(),wO=Rr(n=>{const{__scopeAlertDialog:a,...l}=n,o=Tr(a);return s.jsx(Mw,{...o,...l,modal:!0})},"AlertDialog"),jO=h.forwardRef(Rr(function(a,l){const{__scopeAlertDialog:o,...c}=a,u=Tr(o);return s.jsx(Dw,{...u,...c,ref:l})},"AlertDialogTrigger")),SO=Rr(n=>{const{__scopeAlertDialog:a,...l}=n,o=Tr(a);return s.jsx(_w,{...o,...l})},"AlertDialogPortal"),CO=h.forwardRef(Rr(function(a,l){const{__scopeAlertDialog:o,...c}=a,u=Tr(o);return s.jsx(mp,{...u,...c,ref:l})},"AlertDialogOverlay")),NO="AlertDialogContent",[EO,RO]=bO(NO),TO=h.forwardRef(Rr(function(a,l){const{__scopeAlertDialog:o,children:c,...u}=a,f=Tr(o),p=h.useRef(null),g=Fe(l,p),v=h.useRef(null);return s.jsx(EO,{scope:o,cancelRef:v,children:s.jsx(pp,{role:"alertdialog",...f,...u,ref:g,onOpenAutoFocus:Se(u.onOpenAutoFocus,x=>{var y;x.preventDefault(),(y=v.current)==null||y.focus({preventScroll:!0})}),onPointerDownOutside:x=>x.preventDefault(),onInteractOutside:x=>x.preventDefault(),children:c})})},"AlertDialogContent")),AO=h.forwardRef(Rr(function(a,l){const{__scopeAlertDialog:o,...c}=a,u=Tr(o);return s.jsx(gp,{...u,...c,ref:l})},"AlertDialogTitle")),MO=h.forwardRef(Rr(function(a,l){const{__scopeAlertDialog:o,...c}=a,u=Tr(o);return s.jsx(vp,{...u,...c,ref:l})},"AlertDialogDescription")),DO=h.forwardRef(Rr(function(a,l){const{__scopeAlertDialog:o,...c}=a,u=Tr(o);return s.jsx(xp,{...u,...c,ref:l})},"AlertDialogAction")),OO="AlertDialogCancel",kO=h.forwardRef(Rr(function(a,l){const{__scopeAlertDialog:o,...c}=a,{cancelRef:u}=RO(OO,o),f=Tr(o),p=Fe(l,u);return s.jsx(xp,{...f,...c,ref:p})},"AlertDialogCancel")),_O=wO,zO=jO,LO=SO,Uw=CO,Iw=TO,Pw=DO,Bw=kO,Hw=AO,qw=MO;const $w=_O,UO=zO,IO=LO,Vw=h.forwardRef(({className:n,...a},l)=>s.jsx(Uw,{ref:l,className:Re("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),...a}));Vw.displayName=Uw.displayName;const yp=h.forwardRef(({className:n,...a},l)=>s.jsxs(IO,{children:[s.jsx(Vw,{}),s.jsx(Iw,{ref:l,className:Re("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),...a})]}));yp.displayName=Iw.displayName;const Yw=({className:n,...a})=>s.jsx("div",{className:Re("flex flex-col space-y-2 text-center sm:text-left",n),...a}),Gw=({className:n,...a})=>s.jsx("div",{className:Re("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...a}),bp=h.forwardRef(({className:n,...a},l)=>s.jsx(Hw,{ref:l,className:Re("text-lg font-semibold",n),...a}));bp.displayName=Hw.displayName;const wp=h.forwardRef(({className:n,...a},l)=>s.jsx(qw,{ref:l,className:Re("text-sm text-muted-foreground",n),...a}));wp.displayName=qw.displayName;const jp=h.forwardRef(({className:n,...a},l)=>s.jsx(Pw,{ref:l,className:Re("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),...a}));jp.displayName=Pw.displayName;const Sp=h.forwardRef(({className:n,...a},l)=>s.jsx(Bw,{ref:l,className:Re("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),...a}));Sp.displayName=Bw.displayName;var PO=Object.defineProperty,BO=(n,a)=>PO(n,"name",{value:a,configurable:!0});function um(n,[a,l]){return Math.min(l,Math.max(a,n))}BO(um,"clamp");var HO=Object.defineProperty,qO=(n,a)=>HO(n,"name",{value:a,configurable:!0});function Fw(n){const a=h.useRef({value:n,previous:n});return h.useMemo(()=>(a.current.value!==n&&(a.current.previous=a.current.value,a.current.value=n),a.current.previous),[n])}qO(Fw,"usePrevious");var $O=Object.defineProperty,VO=(n,a)=>$O(n,"name",{value:a,configurable:!0}),Xw=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"}),YO=h.forwardRef(VO(function(a,l){return s.jsx(He.span,{...a,ref:l,style:{...Xw,...a.style}})},"VisuallyHidden")),GO=YO,FO=Object.defineProperty,mt=(n,a)=>FO(n,"name",{value:a,configurable:!0}),XO=[" ","Enter","ArrowUp","ArrowDown"],KO=[" ","Enter"],$l="Select",[Gu,Cp,QO]=Du($l),[Vs,p5]=Hn($l,[QO,eo]),Np=eo(),[ZO,fs]=Vs($l),[JO,WO]=Vs($l);function Kw(n){const{__scopeSelect:a,children:l,open:o,defaultOpen:c,onOpenChange:u,value:f,defaultValue:p,onValueChange:g,dir:v,name:x,autoComplete:y,disabled:b,required:w,form:N,internal_do_not_use_render:S}=n,C=Np(a),[R,D]=h.useState(null),[A,M]=h.useState(null),[O,E]=h.useState(!1),_=xi(v),[U,$]=Ia({prop:o,defaultProp:c??!1,onChange:u,caller:$l}),[te,V]=Ia({prop:f,defaultProp:p,onChange:g,caller:$l}),H=h.useRef(null),ae=h.useRef(te);h.useEffect(()=>{const L=N?R==null?void 0:R.ownerDocument.getElementById(N):R==null?void 0:R.form;if(L instanceof HTMLFormElement){const F=mt(()=>V(ae.current),"reset");return L.addEventListener("reset",F),()=>L.removeEventListener("reset",F)}},[N,R,V]);const ee=R?!!N||!!R.closest("form"):!0,[B,k]=h.useState(new Set),q=Na(),Z=Array.from(B).map(L=>L.props.value).join(";"),J=h.useCallback(L=>{k(F=>new Set(F).add(L))},[]),ne=h.useCallback(L=>{k(F=>{const se=new Set(F);return se.delete(L),se})},[]),z={required:w,trigger:R,onTriggerChange:D,valueNode:A,onValueNodeChange:M,valueNodeHasChildren:O,onValueNodeHasChildrenChange:E,contentId:q,value:te,onValueChange:V,open:U,onOpenChange:$,dir:_,triggerPointerDownPosRef:H,disabled:b,name:x,autoComplete:y,form:N,nativeOptions:B,nativeSelectKey:Z,isFormControl:ee};return s.jsx(ap,{...C,children:s.jsx(ZO,{scope:a,...z,children:s.jsx(Gu.Provider,{scope:a,children:s.jsx(JO,{scope:a,onNativeOptionAdd:J,onNativeOptionRemove:ne,children:tj(S)?S(z):l})})})})}mt(Kw,"SelectProvider");var ek=mt(n=>{const{__scopeSelect:a,children:l,...o}=n;return s.jsx(Kw,{__scopeSelect:a,...o,internal_do_not_use_render:({isFormControl:c})=>s.jsxs(s.Fragment,{children:[l,c?s.jsx(jk,{__scopeSelect:a}):null]})})},"Select"),tk="SelectTrigger",Qw=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,disabled:c=!1,...u}=a,f=Np(o),p=fs(tk,o),g=p.disabled||c,v=Fe(l,p.onTriggerChange),x=Cp(o),y=h.useRef("touch"),[b,w,N]=Ep(C=>{const R=x().filter(M=>!M.disabled),D=R.find(M=>M.value===p.value),A=Rp(R,C,D);A!==void 0&&p.onValueChange(A.value)}),S=mt(C=>{g||(p.onOpenChange(!0),N()),C&&(p.triggerPointerDownPosRef.current={x:Math.round(C.pageX),y:Math.round(C.pageY)})},"handleOpen");return s.jsx(rp,{asChild:!0,...f,children:s.jsx(He.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":ji(p.value)?"":void 0,...u,ref:v,onClick:Se(u.onClick,C=>{C.currentTarget.focus(),y.current!=="mouse"&&S(C)}),onPointerDown:Se(u.onPointerDown,C=>{y.current=C.pointerType;const R=C.target;R.hasPointerCapture(C.pointerId)&&R.releasePointerCapture(C.pointerId),C.button===0&&C.ctrlKey===!1&&C.pointerType==="mouse"&&(S(C),C.preventDefault())}),onKeyDown:Se(u.onKeyDown,C=>{const R=b.current!=="";!(C.ctrlKey||C.altKey||C.metaKey)&&C.key.length===1&&w(C.key),!(R&&C.key===" ")&&XO.includes(C.key)&&(S(),C.preventDefault())})})})},"SelectTrigger")),nk="SelectValue",ak=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,className:c,style:u,children:f,placeholder:p="",...g}=a,v=fs(nk,o),{onValueNodeHasChildrenChange:x}=v,y=f!==void 0,b=Fe(l,v.onValueNodeChange);Jt(()=>{x(y)},[x,y]);const w=ji(v.value);return s.jsx(He.span,{...g,asChild:w?!1:g.asChild,ref:b,style:{pointerEvents:"none"},children:s.jsx(h.Fragment,{children:w?p:f},w?"placeholder":"value")})},"SelectValue")),rk=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,children:c,...u}=a;return s.jsx(He.span,{"aria-hidden":!0,...u,ref:l,children:c||"▼"})},"SelectIcon")),sk="SelectPortal",[lk,ok]=Vs(sk,{forceMount:void 0}),ik=mt(n=>{const{__scopeSelect:a,forceMount:l,...o}=n;return s.jsx(lk,{scope:n.__scopeSelect,forceMount:l,children:s.jsx(lp,{asChild:!0,...o})})},"SelectPortal"),Ps="SelectContent",Zw=h.forwardRef(mt(function(a,l){const o=ok(Ps,a.__scopeSelect),{forceMount:c=o.forceMount,...u}=a,f=fs(Ps,a.__scopeSelect),[p,g]=h.useState();return Jt(()=>{g(new DocumentFragment)},[]),s.jsx(Er,{present:c||f.open,children:({present:v})=>v?s.jsx(dk,{...u,ref:l}):s.jsx(ck,{...u,fragment:p})})},"SelectContent")),ck=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,children:c,fragment:u}=a;return u?Sa.createPortal(s.jsx(Jw,{scope:o,children:s.jsx(Gu.Slot,{scope:o,children:s.jsx("div",{ref:l,children:c})})}),u):null},"SelectContentFragment")),ja=10,[Jw,Fu]=Vs(Ps),uk=Ua("SelectContent.RemoveScroll"),dk=h.forwardRef(mt(function(a,l){const{__scopeSelect:o}=a,{position:c="item-aligned",onCloseAutoFocus:u,onEscapeKeyDown:f,onPointerDownOutside:p,side:g,sideOffset:v,align:x,alignOffset:y,arrowPadding:b,collisionBoundary:w,collisionPadding:N,sticky:S,hideWhenDetached:C,avoidCollisions:R,...D}=a,A=fs(Ps,o),[M,O]=h.useState(null),[E,_]=h.useState(null),U=Fe(l,O),[$,te]=h.useState(null),[V,H]=h.useState(null),ae=Cp(o),[ee,B]=h.useState(!1),k=h.useRef(!1);h.useEffect(()=>{if(M)return cp(M)},[M]),yi();const q=h.useCallback(ue=>{const[he,...xe]=ae().map(Oe=>Oe.ref.current),[Ae]=xe.slice(-1),Ne=document.activeElement;for(const Oe of ue)if(Oe===Ne||(Oe==null||Oe.scrollIntoView({block:"nearest"}),Oe===he&&E&&(E.scrollTop=0),Oe===Ae&&E&&(E.scrollTop=E.scrollHeight),Oe==null||Oe.focus(),document.activeElement!==Ne))return},[ae,E]),Z=h.useCallback(()=>q([$,M]),[q,$,M]);h.useEffect(()=>{ee&&Z()},[ee,Z]);const{onOpenChange:J,triggerPointerDownPosRef:ne}=A;h.useEffect(()=>{if(M){let ue={x:0,y:0};const he=mt(Ae=>{var Ne,Oe;ue={x:Math.abs(Math.round(Ae.pageX)-(((Ne=ne.current)==null?void 0:Ne.x)??0)),y:Math.abs(Math.round(Ae.pageY)-(((Oe=ne.current)==null?void 0:Oe.y)??0))}},"handlePointerMove"),xe=mt(Ae=>{ue.x<=10&&ue.y<=10?Ae.preventDefault():Ae.composedPath().includes(M)||J(!1),document.removeEventListener("pointermove",he),ne.current=null},"handlePointerUp");return ne.current!==null&&(document.addEventListener("pointermove",he),document.addEventListener("pointerup",xe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",he),document.removeEventListener("pointerup",xe,{capture:!0})}}},[M,J,ne]),h.useEffect(()=>{const ue=mt(()=>J(!1),"close");return window.addEventListener("blur",ue),window.addEventListener("resize",ue),()=>{window.removeEventListener("blur",ue),window.removeEventListener("resize",ue)}},[J]);const[z,L]=Ep(ue=>{const he=ae().filter(Ne=>!Ne.disabled),xe=he.find(Ne=>Ne.ref.current===document.activeElement),Ae=Rp(he,ue,xe);Ae&&setTimeout(()=>{var Ne;return(Ne=Ae.ref.current)==null?void 0:Ne.focus()})}),F=h.useCallback((ue,he,xe)=>{const Ae=!k.current&&!xe;(A.value!==void 0&&A.value===he||Ae)&&(te(ue),Ae&&(k.current=!0))},[A.value]),se=h.useCallback(()=>M==null?void 0:M.focus(),[M]),pe=h.useCallback((ue,he,xe)=>{const Ae=!k.current&&!xe;(A.value!==void 0&&A.value===he||Ae)&&H(ue)},[A.value]),ye=c==="popper"?_b:fk,G=ye===_b?{side:g,sideOffset:v,align:x,alignOffset:y,arrowPadding:b,collisionBoundary:w,collisionPadding:N,sticky:S,hideWhenDetached:C,avoidCollisions:R}:{};return s.jsx(Jw,{scope:o,content:M,viewport:E,onViewportChange:_,itemRefCallback:F,selectedItem:$,onItemLeave:se,itemTextRefCallback:pe,focusSelectedItem:Z,selectedItemText:V,position:c,isPositioned:ee,searchRef:z,children:s.jsx($u,{as:uk,allowPinchZoom:!0,children:s.jsx(Km,{asChild:!0,trapped:A.open,onMountAutoFocus:ue=>{ue.preventDefault()},onUnmountAutoFocus:Se(u,ue=>{var he;(he=A.trigger)==null||he.focus({preventScroll:!0}),ue.preventDefault()}),children:s.jsx(Ou,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:ue=>ue.preventDefault(),onDismiss:()=>A.onOpenChange(!1),children:s.jsx(ye,{role:"listbox",id:A.contentId,"data-state":A.open?"open":"closed",dir:A.dir,onContextMenu:ue=>ue.preventDefault(),...D,...G,onPlaced:()=>B(!0),ref:U,style:{display:"flex",flexDirection:"column",outline:"none",...D.style},onKeyDown:Se(D.onKeyDown,ue=>{const he=ue.ctrlKey||ue.altKey||ue.metaKey;if(ue.key==="Tab"&&ue.preventDefault(),!he&&ue.key.length===1&&L(ue.key),["ArrowUp","ArrowDown","Home","End"].includes(ue.key)){let Ae=ae().filter(Ne=>!Ne.disabled).map(Ne=>Ne.ref.current);if(["ArrowUp","End"].includes(ue.key)&&(Ae=Ae.slice().reverse()),["ArrowUp","ArrowDown"].includes(ue.key)){const Ne=ue.target,Oe=Ae.indexOf(Ne);Ae=Ae.slice(Oe+1)}setTimeout(()=>q(Ae)),ue.preventDefault()}})})})})})})},"SelectContentImpl")),fk=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,onPlaced:c,...u}=a,f=fs(Ps,o),p=Fu(Ps,o),[g,v]=h.useState(null),[x,y]=h.useState(null),b=Fe(l,y),w=Cp(o),N=h.useRef(!1),S=h.useRef(!0),{viewport:C,selectedItem:R,selectedItemText:D,focusSelectedItem:A}=p,M=h.useCallback(()=>{if(f.trigger&&f.valueNode&&g&&x&&C&&R&&D){const U=f.trigger.getBoundingClientRect(),$=x.getBoundingClientRect(),te=f.valueNode.getBoundingClientRect(),V=D.getBoundingClientRect();if(f.dir!=="rtl"){const Ne=V.left-$.left,Oe=te.left-Ne,Qe=U.left-Oe,et=U.width+Qe,ce=Math.max(et,$.width),Le=window.innerWidth-ja,qe=um(Oe,[ja,Math.max(ja,Le-ce)]);g.style.minWidth=et+"px",g.style.left=qe+"px"}else{const Ne=$.right-V.right,Oe=window.innerWidth-te.right-Ne,Qe=window.innerWidth-U.right-Oe,et=U.width+Qe,ce=Math.max(et,$.width),Le=window.innerWidth-ja,qe=um(Oe,[ja,Math.max(ja,Le-ce)]);g.style.minWidth=et+"px",g.style.right=qe+"px"}const H=w(),ae=window.innerHeight-ja*2,ee=C.scrollHeight,B=window.getComputedStyle(x),k=parseInt(B.borderTopWidth,10),q=parseInt(B.paddingTop,10),Z=parseInt(B.borderBottomWidth,10),J=parseInt(B.paddingBottom,10),ne=k+q+ee+J+Z,z=Math.min(R.offsetHeight*5,ne),L=window.getComputedStyle(C),F=parseInt(L.paddingTop,10),se=parseInt(L.paddingBottom,10),pe=U.top+U.height/2-ja,ye=ae-pe,G=R.offsetHeight/2,ue=R.offsetTop+G,he=k+q+ue,xe=ne-he;if(he<=pe){const Ne=H.length>0&&R===H[H.length-1].ref.current;g.style.bottom="0px";const Oe=x.clientHeight-C.offsetTop-C.offsetHeight,Qe=Math.max(ye,G+(Ne?se:0)+Oe+Z),et=he+Qe;g.style.height=et+"px"}else{const Ne=H.length>0&&R===H[0].ref.current;g.style.top="0px";const Qe=Math.max(pe,k+C.offsetTop+(Ne?F:0)+G)+xe;g.style.height=Qe+"px",C.scrollTop=he-pe+C.offsetTop}g.style.margin=`${ja}px 0`,g.style.minHeight=z+"px",g.style.maxHeight=ae+"px",c==null||c(),requestAnimationFrame(()=>N.current=!0)}},[w,f.trigger,f.valueNode,g,x,C,R,D,f.dir,c]);Jt(()=>M(),[M]);const[O,E]=h.useState();Jt(()=>{x&&E(window.getComputedStyle(x).zIndex)},[x]);const _=h.useCallback(U=>{U&&S.current===!0&&(M(),A==null||A(),S.current=!1)},[M,A]);return s.jsx(hk,{scope:o,contentWrapper:g,shouldExpandOnScrollRef:N,onScrollButtonChange:_,children:s.jsx("div",{ref:v,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:O},children:s.jsx(He.div,{...u,ref:b,style:{boxSizing:"border-box",maxHeight:"100%",...u.style}})})})},"SelectItemAlignedPosition")),_b=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,align:c="start",collisionPadding:u=ja,...f}=a,p=Np(o);return s.jsx(sp,{...p,...f,ref:l,align:c,collisionPadding:u,style:{boxSizing:"border-box",...f.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")),[hk,mk]=Vs(Ps,{}),zb="SelectViewport",pk=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,nonce:c,...u}=a,f=Fu(zb,o),p=mk(zb,o),g=Fe(l,f.onViewportChange),v=h.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:c}),s.jsx(Gu.Slot,{scope:o,children:s.jsx(He.div,{"data-radix-select-viewport":"",role:"presentation",...u,ref:g,style:{position:"relative",flex:1,overflow:"hidden auto",...u.style},onScroll:Se(u.onScroll,x=>{const y=x.currentTarget,{contentWrapper:b,shouldExpandOnScrollRef:w}=p;if(w!=null&&w.current&&b){const N=Math.abs(v.current-y.scrollTop);if(N>0){const S=window.innerHeight-ja*2,C=parseFloat(b.style.minHeight),R=parseFloat(b.style.height),D=Math.max(C,R);if(D<S){const A=D+N,M=Math.min(S,A),O=A-M;b.style.height=M+"px",b.style.bottom==="0px"&&(y.scrollTop=O>0?O:0,b.style.justifyContent="flex-end")}}}v.current=y.scrollTop})})})]})},"SelectViewport")),gk="SelectGroup",[g5,v5]=Vs(gk),dm="SelectItem",[vk,Ww]=Vs(dm),ej=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,value:c,disabled:u=!1,textValue:f,...p}=a,g=fs(dm,o),v=Fu(dm,o),x=g.value===c,[y,b]=h.useState(f??""),[w,N]=h.useState(!1),S=ma(M=>{var O;return(O=v.itemRefCallback)==null?void 0:O.call(v,M,c,u)}),C=Fe(l,S),R=Na(),D=h.useRef("touch"),A=mt(()=>{u||(g.onValueChange(c),g.onOpenChange(!1))},"handleSelect");return s.jsx(vk,{scope:o,value:c,disabled:u,textId:R,isSelected:x,onItemTextChange:h.useCallback(M=>{b(O=>O||((M==null?void 0:M.textContent)??"").trim())},[]),children:s.jsx(Gu.ItemSlot,{scope:o,value:c,disabled:u,textValue:y,children:s.jsx(He.div,{role:"option","aria-labelledby":R,"data-highlighted":w?"":void 0,"aria-selected":x&&w,"data-state":x?"checked":"unchecked","aria-disabled":u||void 0,"data-disabled":u?"":void 0,tabIndex:u?void 0:-1,...p,ref:C,onFocus:Se(p.onFocus,()=>N(!0)),onBlur:Se(p.onBlur,()=>N(!1)),onClick:Se(p.onClick,()=>{D.current!=="mouse"&&A()}),onPointerUp:Se(p.onPointerUp,()=>{D.current==="mouse"&&A()}),onPointerDown:Se(p.onPointerDown,M=>{D.current=M.pointerType}),onPointerMove:Se(p.onPointerMove,M=>{var O;D.current=M.pointerType,u?(O=v.onItemLeave)==null||O.call(v):D.current==="mouse"&&M.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Se(p.onPointerLeave,M=>{var O;M.currentTarget===document.activeElement&&((O=v.onItemLeave)==null||O.call(v))}),onKeyDown:Se(p.onKeyDown,M=>{var E;u||M.target!==M.currentTarget||((E=v.searchRef)==null?void 0:E.current)!==""&&M.key===" "||(KO.includes(M.key)&&A(),M.key===" "&&M.preventDefault())})})})})},"SelectItem")),Fc="SelectItemText",xk=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,className:c,style:u,...f}=a,p=fs(Fc,o),g=Fu(Fc,o),v=Ww(Fc,o),x=WO(Fc,o),[y,b]=h.useState(null),w=ma(A=>{var M;return(M=g.itemTextRefCallback)==null?void 0:M.call(g,A,v.value,v.disabled)}),N=Fe(l,b,v.onItemTextChange,w),S=y==null?void 0:y.textContent,C=h.useMemo(()=>s.jsx("option",{value:v.value,disabled:v.disabled,children:S},v.value),[v.disabled,v.value,S]),{onNativeOptionAdd:R,onNativeOptionRemove:D}=x;return Jt(()=>(R(C),()=>D(C)),[R,D,C]),s.jsxs(s.Fragment,{children:[s.jsx(He.span,{id:v.textId,...f,ref:N}),v.isSelected&&p.valueNode&&!p.valueNodeHasChildren&&!ji(p.value)?Sa.createPortal(f.children,p.valueNode):null]})},"SelectItemText")),yk="SelectItemIndicator",bk=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,...c}=a;return Ww(yk,o).isSelected?s.jsx(He.span,{"aria-hidden":!0,...c,ref:l}):null},"SelectItemIndicator")),wk="SelectBubbleInput",jk=h.forwardRef(mt(function({__scopeSelect:a,...l},o){const c=fs(wk,a),{value:u,onValueChange:f,required:p,disabled:g,name:v,autoComplete:x,form:y}=c,{nativeOptions:b,nativeSelectKey:w}=c,N=h.useRef(null),S=Fe(o,N),C=u??"",R=Fw(C),D=Array.from(b).some(A=>(A.props.value??"")==="");return h.useEffect(()=>{const A=N.current;if(!A)return;const M=window.HTMLSelectElement.prototype,E=Object.getOwnPropertyDescriptor(M,"value").set;if(R!==C&&E){const _=new Event("change",{bubbles:!0});E.call(A,C),A.dispatchEvent(_)}},[R,C]),s.jsxs(He.select,{"aria-hidden":!0,required:p,tabIndex:-1,name:v,autoComplete:x,disabled:g,form:y,onChange:A=>f(A.target.value),...l,style:{...Xw,...l.style},ref:S,defaultValue:C,children:[ji(u)&&!D?s.jsx("option",{value:""}):null,Array.from(b)]},w)},"SelectBubbleInput"));function tj(n){return typeof n=="function"}mt(tj,"isFunction");function ji(n){return n===""||n===void 0}mt(ji,"shouldShowPlaceholder");function Ep(n){const a=ma(n),l=h.useRef(""),o=h.useRef(0),c=h.useCallback(f=>{const p=l.current+f;a(p),mt((function g(v){l.current=v,window.clearTimeout(o.current),v!==""&&(o.current=window.setTimeout(()=>g(""),1e3))}),"updateSearch")(p)},[a]),u=h.useCallback(()=>{l.current="",window.clearTimeout(o.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(o.current),[]),[l,c,u]}mt(Ep,"useTypeaheadSearch");function Rp(n,a,l){const c=a.length>1&&Array.from(a).every(v=>v===a[0])?a[0]:a,u=l?n.indexOf(l):-1;let f=nj(n,Math.max(u,0));c.length===1&&(f=f.filter(v=>v!==l));const g=f.find(v=>v.textValue.toLowerCase().startsWith(c.toLowerCase()));return g!==l?g:void 0}mt(Rp,"findNextItem");function nj(n,a){return n.map((l,o)=>n[(a+o)%n.length])}mt(nj,"wrapArray");const zn=ek,Ln=ak,jn=h.forwardRef(({className:n,children:a,...l},o)=>s.jsxs(Qw,{ref:o,className:Re("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),...l,children:[a,s.jsx(rk,{asChild:!0,children:s.jsx(D0,{className:"h-4 w-4 opacity-50"})})]}));jn.displayName=Qw.displayName;const Sn=h.forwardRef(({className:n,children:a,position:l="popper",...o},c)=>s.jsx(ik,{children:s.jsx(Zw,{ref:c,className:Re("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",n),position:l,...o,children:s.jsx(pk,{className:Re("p-1",l==="popper"&&"w-full min-w-[var(--radix-select-trigger-width)]"),children:a})})}));Sn.displayName=Zw.displayName;const nt=h.forwardRef(({className:n,children:a,...l},o)=>s.jsxs(ej,{ref:o,className:Re("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),...l,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(bk,{children:s.jsx(Um,{className:"h-4 w-4"})})}),s.jsx(xk,{children:a})]}));nt.displayName=ej.displayName;var Sk=Object.defineProperty,us=(n,a)=>Sk(n,"name",{value:a,configurable:!0}),Tp="Switch",[Ck,x5]=Hn(Tp),[Nk,Ap]=Ck(Tp);function aj(n){const{__scopeSwitch:a,checked:l,children:o,defaultChecked:c,disabled:u,form:f,name:p,onCheckedChange:g,required:v,value:x="on",internal_do_not_use_render:y}=n,[b,w]=Ia({prop:l,defaultProp:c??!1,onChange:g,caller:Tp}),[N,S]=h.useState(null),[C,R]=h.useState(null),D=h.useRef(!1),[A,M]=h.useReducer(_=>_+1,0),O=N?!!f||!!N.closest("form"):!0,E={checked:b,setChecked:w,disabled:u,control:N,setControl:S,name:p,form:f,value:x,hasConsumerStoppedPropagationRef:D,userInteractionCount:A,onUserInteraction:M,required:v,defaultChecked:c,isFormControl:O,bubbleInput:C,setBubbleInput:R};return s.jsx(Nk,{scope:a,...E,children:sj(y)?y(E):o})}us(aj,"SwitchProvider");var Ek="SwitchTrigger",Rk=h.forwardRef(us(function({__scopeSwitch:a,onClick:l,...o},c){const{control:u,form:f,value:p,disabled:g,checked:v,required:x,setControl:y,setChecked:b,hasConsumerStoppedPropagationRef:w,onUserInteraction:N,isFormControl:S,bubbleInput:C}=Ap(Ek,a),R=Fe(c,y),D=h.useRef(v);return h.useEffect(()=>{const A=f?u==null?void 0:u.ownerDocument.getElementById(f):u==null?void 0:u.form;if(A instanceof HTMLFormElement){const M=us(()=>b(D.current),"reset");return A.addEventListener("reset",M),()=>A.removeEventListener("reset",M)}},[u,f,b]),s.jsx(He.button,{type:"button",role:"switch","aria-checked":v,"aria-required":x,"data-state":Mp(v),"data-disabled":g?"":void 0,disabled:g,value:p,...o,ref:R,onClick:Se(l,A=>{N(),b(M=>!M),C&&S&&(w.current=A.isPropagationStopped(),w.current||A.stopPropagation())})})},"SwitchTrigger")),rj=h.forwardRef(us(function(a,l){const{__scopeSwitch:o,name:c,checked:u,defaultChecked:f,required:p,disabled:g,value:v,onCheckedChange:x,form:y,...b}=a;return s.jsx(aj,{__scopeSwitch:o,checked:u,defaultChecked:f,disabled:g,required:p,onCheckedChange:x,name:c,form:y,value:v,internal_do_not_use_render:({isFormControl:w})=>s.jsxs(s.Fragment,{children:[s.jsx(Rk,{...b,ref:l,__scopeSwitch:o}),w&&s.jsx(Dk,{__scopeSwitch:o})]})})},"Switch")),Tk="SwitchThumb",Ak=h.forwardRef(us(function(a,l){const{__scopeSwitch:o,...c}=a,u=Ap(Tk,o);return s.jsx(He.span,{"data-state":Mp(u.checked),"data-disabled":u.disabled?"":void 0,...c,ref:l})},"SwitchThumb")),Mk="SwitchBubbleInput",Dk=h.forwardRef(us(function({__scopeSwitch:a,onClick:l,...o},c){const{control:u,hasConsumerStoppedPropagationRef:f,userInteractionCount:p,checked:g,defaultChecked:v,required:x,disabled:y,name:b,value:w,form:N,bubbleInput:S,setBubbleInput:C}=Ap(Mk,a),R=Fe(c,C),D=Iu(u),A=h.useRef(!1),M=h.useRef(g),O=h.useRef(p);h.useEffect(()=>{const _=S;if(!_)return;const U=window.HTMLInputElement.prototype,te=Object.getOwnPropertyDescriptor(U,"checked").set,V=p!==O.current;O.current=p;const H=M.current!==g;M.current=g;const ae=!(V&&f.current);if(H&&te){A.current=!V;const ee=new Event("click",{bubbles:ae});te.call(_,g),_.dispatchEvent(ee),A.current=!1}},[S,g,f,p]);const E=h.useRef(g);return s.jsx(He.input,{type:"checkbox","aria-hidden":!0,defaultChecked:v??E.current,required:x,disabled:y,name:b,value:w,form:N,...o,tabIndex:-1,ref:R,onClick:Se(l,_=>{A.current&&_.stopPropagation()}),style:{...o.style,...D,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function sj(n){return typeof n=="function"}us(sj,"isFunction");function Mp(n){return n?"checked":"unchecked"}us(Mp,"getState");const Ha=h.forwardRef(({className:n,...a},l)=>s.jsx(rj,{className:Re("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),...a,ref:l,children:s.jsx(Ak,{className:Re("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")})}));Ha.displayName=rj.displayName;function Ok(){for(var n=arguments.length,a=new Array(n),l=0;l<n;l++)a[l]=arguments[l];return h.useMemo(()=>o=>{a.forEach(c=>c(o))},a)}const Xu=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function to(n){const a=Object.prototype.toString.call(n);return a==="[object Window]"||a==="[object global]"}function Dp(n){return"nodeType"in n}function qn(n){var a,l;return n?to(n)?n:Dp(n)&&(a=(l=n.ownerDocument)==null?void 0:l.defaultView)!=null?a:window:window}function Op(n){const{Document:a}=qn(n);return n instanceof a}function Si(n){return to(n)?!1:n instanceof qn(n).HTMLElement}function lj(n){return n instanceof qn(n).SVGElement}function no(n){return n?to(n)?n.document:Dp(n)?Op(n)?n:Si(n)||lj(n)?n.ownerDocument:document:document:document}const qa=Xu?h.useLayoutEffect:h.useEffect;function kp(n){const a=h.useRef(n);return qa(()=>{a.current=n}),h.useCallback(function(){for(var l=arguments.length,o=new Array(l),c=0;c<l;c++)o[c]=arguments[c];return a.current==null?void 0:a.current(...o)},[])}function kk(){const n=h.useRef(null),a=h.useCallback((o,c)=>{n.current=setInterval(o,c)},[]),l=h.useCallback(()=>{n.current!==null&&(clearInterval(n.current),n.current=null)},[]);return[a,l]}function ii(n,a){a===void 0&&(a=[n]);const l=h.useRef(n);return qa(()=>{l.current!==n&&(l.current=n)},a),l}function Ci(n,a){const l=h.useRef();return h.useMemo(()=>{const o=n(l.current);return l.current=o,o},[...a])}function vu(n){const a=kp(n),l=h.useRef(null),o=h.useCallback(c=>{c!==l.current&&(a==null||a(c,l.current)),l.current=c},[]);return[l,o]}function fm(n){const a=h.useRef();return h.useEffect(()=>{a.current=n},[n]),a.current}let Lh={};function Ni(n,a){return h.useMemo(()=>{if(a)return a;const l=Lh[n]==null?0:Lh[n]+1;return Lh[n]=l,n+"-"+l},[n,a])}function oj(n){return function(a){for(var l=arguments.length,o=new Array(l>1?l-1:0),c=1;c<l;c++)o[c-1]=arguments[c];return o.reduce((u,f)=>{const p=Object.entries(f);for(const[g,v]of p){const x=u[g];x!=null&&(u[g]=x+n*v)}return u},{...a})}}const ql=oj(1),ci=oj(-1);function _k(n){return"clientX"in n&&"clientY"in n}function _p(n){if(!n)return!1;const{KeyboardEvent:a}=qn(n.target);return a&&n instanceof a}function zk(n){if(!n)return!1;const{TouchEvent:a}=qn(n.target);return a&&n instanceof a}function hm(n){if(zk(n)){if(n.touches&&n.touches.length){const{clientX:a,clientY:l}=n.touches[0];return{x:a,y:l}}else if(n.changedTouches&&n.changedTouches.length){const{clientX:a,clientY:l}=n.changedTouches[0];return{x:a,y:l}}}return _k(n)?{x:n.clientX,y:n.clientY}:null}const xu=Object.freeze({Translate:{toString(n){if(!n)return;const{x:a,y:l}=n;return"translate3d("+(a?Math.round(a):0)+"px, "+(l?Math.round(l):0)+"px, 0)"}},Scale:{toString(n){if(!n)return;const{scaleX:a,scaleY:l}=n;return"scaleX("+a+") scaleY("+l+")"}},Transform:{toString(n){if(n)return[xu.Translate.toString(n),xu.Scale.toString(n)].join(" ")}},Transition:{toString(n){let{property:a,duration:l,easing:o}=n;return a+" "+l+"ms "+o}}}),Lb="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Lk(n){return n.matches(Lb)?n:n.querySelector(Lb)}const Uk={display:"none"};function Ik(n){let{id:a,value:l}=n;return me.createElement("div",{id:a,style:Uk},l)}function Pk(n){let{id:a,announcement:l,ariaLiveType:o="assertive"}=n;const c={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return me.createElement("div",{id:a,style:c,role:"status","aria-live":o,"aria-atomic":!0},l)}function Bk(){const[n,a]=h.useState("");return{announce:h.useCallback(o=>{o!=null&&a(o)},[]),announcement:n}}const ij=h.createContext(null);function Hk(n){const a=h.useContext(ij);h.useEffect(()=>{if(!a)throw new Error("useDndMonitor must be used within a children of <DndContext>");return a(n)},[n,a])}function qk(){const[n]=h.useState(()=>new Set),a=h.useCallback(o=>(n.add(o),()=>n.delete(o)),[n]);return[h.useCallback(o=>{let{type:c,event:u}=o;n.forEach(f=>{var p;return(p=f[c])==null?void 0:p.call(f,u)})},[n]),a]}const $k={draggable:`
|
|
382
|
-
To pick up a draggable item, press the space bar.
|
|
383
|
-
While dragging, use the arrow keys to move the item.
|
|
384
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
385
|
-
`},Vk={onDragStart(n){let{active:a}=n;return"Picked up draggable item "+a.id+"."},onDragOver(n){let{active:a,over:l}=n;return l?"Draggable item "+a.id+" was moved over droppable area "+l.id+".":"Draggable item "+a.id+" is no longer over a droppable area."},onDragEnd(n){let{active:a,over:l}=n;return l?"Draggable item "+a.id+" was dropped over droppable area "+l.id:"Draggable item "+a.id+" was dropped."},onDragCancel(n){let{active:a}=n;return"Dragging was cancelled. Draggable item "+a.id+" was dropped."}};function Yk(n){let{announcements:a=Vk,container:l,hiddenTextDescribedById:o,screenReaderInstructions:c=$k}=n;const{announce:u,announcement:f}=Bk(),p=Ni("DndLiveRegion"),[g,v]=h.useState(!1);if(h.useEffect(()=>{v(!0)},[]),Hk(h.useMemo(()=>({onDragStart(y){let{active:b}=y;u(a.onDragStart({active:b}))},onDragMove(y){let{active:b,over:w}=y;a.onDragMove&&u(a.onDragMove({active:b,over:w}))},onDragOver(y){let{active:b,over:w}=y;u(a.onDragOver({active:b,over:w}))},onDragEnd(y){let{active:b,over:w}=y;u(a.onDragEnd({active:b,over:w}))},onDragCancel(y){let{active:b,over:w}=y;u(a.onDragCancel({active:b,over:w}))}}),[u,a])),!g)return null;const x=me.createElement(me.Fragment,null,me.createElement(Ik,{id:o,value:c.draggable}),me.createElement(Pk,{id:p,announcement:f}));return l?Sa.createPortal(x,l):x}var Ft;(function(n){n.DragStart="dragStart",n.DragMove="dragMove",n.DragEnd="dragEnd",n.DragCancel="dragCancel",n.DragOver="dragOver",n.RegisterDroppable="registerDroppable",n.SetDroppableDisabled="setDroppableDisabled",n.UnregisterDroppable="unregisterDroppable"})(Ft||(Ft={}));function yu(){}function bu(n,a){return h.useMemo(()=>({sensor:n,options:a??{}}),[n,a])}function cj(){for(var n=arguments.length,a=new Array(n),l=0;l<n;l++)a[l]=arguments[l];return h.useMemo(()=>[...a].filter(o=>o!=null),[...a])}const Ea=Object.freeze({x:0,y:0});function uj(n,a){return Math.sqrt(Math.pow(n.x-a.x,2)+Math.pow(n.y-a.y,2))}function dj(n,a){let{data:{value:l}}=n,{data:{value:o}}=a;return l-o}function Gk(n,a){let{data:{value:l}}=n,{data:{value:o}}=a;return o-l}function Ub(n){let{left:a,top:l,height:o,width:c}=n;return[{x:a,y:l},{x:a+c,y:l},{x:a,y:l+o},{x:a+c,y:l+o}]}function fj(n,a){if(!n||n.length===0)return null;const[l]=n;return l[a]}function Ib(n,a,l){return a===void 0&&(a=n.left),l===void 0&&(l=n.top),{x:a+n.width*.5,y:l+n.height*.5}}const hj=n=>{let{collisionRect:a,droppableRects:l,droppableContainers:o}=n;const c=Ib(a,a.left,a.top),u=[];for(const f of o){const{id:p}=f,g=l.get(p);if(g){const v=uj(Ib(g),c);u.push({id:p,data:{droppableContainer:f,value:v}})}}return u.sort(dj)},Fk=n=>{let{collisionRect:a,droppableRects:l,droppableContainers:o}=n;const c=Ub(a),u=[];for(const f of o){const{id:p}=f,g=l.get(p);if(g){const v=Ub(g),x=c.reduce((b,w,N)=>b+uj(v[N],w),0),y=Number((x/4).toFixed(4));u.push({id:p,data:{droppableContainer:f,value:y}})}}return u.sort(dj)};function Xk(n,a){const l=Math.max(a.top,n.top),o=Math.max(a.left,n.left),c=Math.min(a.left+a.width,n.left+n.width),u=Math.min(a.top+a.height,n.top+n.height),f=c-o,p=u-l;if(o<c&&l<u){const g=a.width*a.height,v=n.width*n.height,x=f*p,y=x/(g+v-x);return Number(y.toFixed(4))}return 0}const Kk=n=>{let{collisionRect:a,droppableRects:l,droppableContainers:o}=n;const c=[];for(const u of o){const{id:f}=u,p=l.get(f);if(p){const g=Xk(p,a);g>0&&c.push({id:f,data:{droppableContainer:u,value:g}})}}return c.sort(Gk)};function Qk(n,a,l){return{...n,scaleX:a&&l?a.width/l.width:1,scaleY:a&&l?a.height/l.height:1}}function mj(n,a){return n&&a?{x:n.left-a.left,y:n.top-a.top}:Ea}function Zk(n){return function(l){for(var o=arguments.length,c=new Array(o>1?o-1:0),u=1;u<o;u++)c[u-1]=arguments[u];return c.reduce((f,p)=>({...f,top:f.top+n*p.y,bottom:f.bottom+n*p.y,left:f.left+n*p.x,right:f.right+n*p.x}),{...l})}}const Jk=Zk(1);function Wk(n){if(n.startsWith("matrix3d(")){const a=n.slice(9,-1).split(/, /);return{x:+a[12],y:+a[13],scaleX:+a[0],scaleY:+a[5]}}else if(n.startsWith("matrix(")){const a=n.slice(7,-1).split(/, /);return{x:+a[4],y:+a[5],scaleX:+a[0],scaleY:+a[3]}}return null}function e3(n,a,l){const o=Wk(a);if(!o)return n;const{scaleX:c,scaleY:u,x:f,y:p}=o,g=n.left-f-(1-c)*parseFloat(l),v=n.top-p-(1-u)*parseFloat(l.slice(l.indexOf(" ")+1)),x=c?n.width/c:n.width,y=u?n.height/u:n.height;return{width:x,height:y,top:v,right:g+x,bottom:v+y,left:g}}const t3={ignoreTransform:!1};function ao(n,a){a===void 0&&(a=t3);let l=n.getBoundingClientRect();if(a.ignoreTransform){const{transform:v,transformOrigin:x}=qn(n).getComputedStyle(n);v&&(l=e3(l,v,x))}const{top:o,left:c,width:u,height:f,bottom:p,right:g}=l;return{top:o,left:c,width:u,height:f,bottom:p,right:g}}function Pb(n){return ao(n,{ignoreTransform:!0})}function n3(n){const a=n.innerWidth,l=n.innerHeight;return{top:0,left:0,right:a,bottom:l,width:a,height:l}}function a3(n,a){return a===void 0&&(a=qn(n).getComputedStyle(n)),a.position==="fixed"}function r3(n,a){a===void 0&&(a=qn(n).getComputedStyle(n));const l=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(c=>{const u=a[c];return typeof u=="string"?l.test(u):!1})}function Ku(n,a){const l=[];function o(c){if(a!=null&&l.length>=a||!c)return l;if(Op(c)&&c.scrollingElement!=null&&!l.includes(c.scrollingElement))return l.push(c.scrollingElement),l;if(!Si(c)||lj(c)||l.includes(c))return l;const u=qn(n).getComputedStyle(c);return c!==n&&r3(c,u)&&l.push(c),a3(c,u)?l:o(c.parentNode)}return n?o(n):l}function pj(n){const[a]=Ku(n,1);return a??null}function Uh(n){return!Xu||!n?null:to(n)?n:Dp(n)?Op(n)||n===no(n).scrollingElement?window:Si(n)?n:null:null}function gj(n){return to(n)?n.scrollX:n.scrollLeft}function vj(n){return to(n)?n.scrollY:n.scrollTop}function mm(n){return{x:gj(n),y:vj(n)}}var an;(function(n){n[n.Forward=1]="Forward",n[n.Backward=-1]="Backward"})(an||(an={}));function xj(n){return!Xu||!n?!1:n===document.scrollingElement}function yj(n){const a={x:0,y:0},l=xj(n)?{height:window.innerHeight,width:window.innerWidth}:{height:n.clientHeight,width:n.clientWidth},o={x:n.scrollWidth-l.width,y:n.scrollHeight-l.height},c=n.scrollTop<=a.y,u=n.scrollLeft<=a.x,f=n.scrollTop>=o.y,p=n.scrollLeft>=o.x;return{isTop:c,isLeft:u,isBottom:f,isRight:p,maxScroll:o,minScroll:a}}const s3={x:.2,y:.2};function l3(n,a,l,o,c){let{top:u,left:f,right:p,bottom:g}=l;o===void 0&&(o=10),c===void 0&&(c=s3);const{isTop:v,isBottom:x,isLeft:y,isRight:b}=yj(n),w={x:0,y:0},N={x:0,y:0},S={height:a.height*c.y,width:a.width*c.x};return!v&&u<=a.top+S.height?(w.y=an.Backward,N.y=o*Math.abs((a.top+S.height-u)/S.height)):!x&&g>=a.bottom-S.height&&(w.y=an.Forward,N.y=o*Math.abs((a.bottom-S.height-g)/S.height)),!b&&p>=a.right-S.width?(w.x=an.Forward,N.x=o*Math.abs((a.right-S.width-p)/S.width)):!y&&f<=a.left+S.width&&(w.x=an.Backward,N.x=o*Math.abs((a.left+S.width-f)/S.width)),{direction:w,speed:N}}function o3(n){if(n===document.scrollingElement){const{innerWidth:u,innerHeight:f}=window;return{top:0,left:0,right:u,bottom:f,width:u,height:f}}const{top:a,left:l,right:o,bottom:c}=n.getBoundingClientRect();return{top:a,left:l,right:o,bottom:c,width:n.clientWidth,height:n.clientHeight}}function bj(n){return n.reduce((a,l)=>ql(a,mm(l)),Ea)}function i3(n){return n.reduce((a,l)=>a+gj(l),0)}function c3(n){return n.reduce((a,l)=>a+vj(l),0)}function u3(n,a){if(a===void 0&&(a=ao),!n)return;const{top:l,left:o,bottom:c,right:u}=a(n);pj(n)&&(c<=0||u<=0||l>=window.innerHeight||o>=window.innerWidth)&&n.scrollIntoView({block:"center",inline:"center"})}const d3=[["x",["left","right"],i3],["y",["top","bottom"],c3]];class zp{constructor(a,l){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const o=Ku(l),c=bj(o);this.rect={...a},this.width=a.width,this.height=a.height;for(const[u,f,p]of d3)for(const g of f)Object.defineProperty(this,g,{get:()=>{const v=p(o),x=c[u]-v;return this.rect[g]+x},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ti{constructor(a){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(l=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...l)})},this.target=a}add(a,l,o){var c;(c=this.target)==null||c.addEventListener(a,l,o),this.listeners.push([a,l,o])}}function f3(n){const{EventTarget:a}=qn(n);return n instanceof a?n:no(n)}function Ih(n,a){const l=Math.abs(n.x),o=Math.abs(n.y);return typeof a=="number"?Math.sqrt(l**2+o**2)>a:"x"in a&&"y"in a?l>a.x&&o>a.y:"x"in a?l>a.x:"y"in a?o>a.y:!1}var da;(function(n){n.Click="click",n.DragStart="dragstart",n.Keydown="keydown",n.ContextMenu="contextmenu",n.Resize="resize",n.SelectionChange="selectionchange",n.VisibilityChange="visibilitychange"})(da||(da={}));function Bb(n){n.preventDefault()}function h3(n){n.stopPropagation()}var Ke;(function(n){n.Space="Space",n.Down="ArrowDown",n.Right="ArrowRight",n.Left="ArrowLeft",n.Up="ArrowUp",n.Esc="Escape",n.Enter="Enter",n.Tab="Tab"})(Ke||(Ke={}));const wj={start:[Ke.Space,Ke.Enter],cancel:[Ke.Esc],end:[Ke.Space,Ke.Enter,Ke.Tab]},m3=(n,a)=>{let{currentCoordinates:l}=a;switch(n.code){case Ke.Right:return{...l,x:l.x+25};case Ke.Left:return{...l,x:l.x-25};case Ke.Down:return{...l,y:l.y+25};case Ke.Up:return{...l,y:l.y-25}}};class Qu{constructor(a){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=a;const{event:{target:l}}=a;this.props=a,this.listeners=new ti(no(l)),this.windowListeners=new ti(qn(l)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(da.Resize,this.handleCancel),this.windowListeners.add(da.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(da.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:a,onStart:l}=this.props,o=a.node.current;o&&u3(o),l(Ea)}handleKeyDown(a){if(_p(a)){const{active:l,context:o,options:c}=this.props,{keyboardCodes:u=wj,coordinateGetter:f=m3,scrollBehavior:p="smooth"}=c,{code:g}=a;if(u.end.includes(g)){this.handleEnd(a);return}if(u.cancel.includes(g)){this.handleCancel(a);return}const{collisionRect:v}=o.current,x=v?{x:v.left,y:v.top}:Ea;this.referenceCoordinates||(this.referenceCoordinates=x);const y=f(a,{active:l,context:o.current,currentCoordinates:x});if(y){const b=ci(y,x),w={x:0,y:0},{scrollableAncestors:N}=o.current;for(const S of N){const C=a.code,{isTop:R,isRight:D,isLeft:A,isBottom:M,maxScroll:O,minScroll:E}=yj(S),_=o3(S),U={x:Math.min(C===Ke.Right?_.right-_.width/2:_.right,Math.max(C===Ke.Right?_.left:_.left+_.width/2,y.x)),y:Math.min(C===Ke.Down?_.bottom-_.height/2:_.bottom,Math.max(C===Ke.Down?_.top:_.top+_.height/2,y.y))},$=C===Ke.Right&&!D||C===Ke.Left&&!A,te=C===Ke.Down&&!M||C===Ke.Up&&!R;if($&&U.x!==y.x){const V=S.scrollLeft+b.x,H=C===Ke.Right&&V<=O.x||C===Ke.Left&&V>=E.x;if(H&&!b.y){S.scrollTo({left:V,behavior:p});return}H?w.x=S.scrollLeft-V:w.x=C===Ke.Right?S.scrollLeft-O.x:S.scrollLeft-E.x,w.x&&S.scrollBy({left:-w.x,behavior:p});break}else if(te&&U.y!==y.y){const V=S.scrollTop+b.y,H=C===Ke.Down&&V<=O.y||C===Ke.Up&&V>=E.y;if(H&&!b.x){S.scrollTo({top:V,behavior:p});return}H?w.y=S.scrollTop-V:w.y=C===Ke.Down?S.scrollTop-O.y:S.scrollTop-E.y,w.y&&S.scrollBy({top:-w.y,behavior:p});break}}this.handleMove(a,ql(ci(y,this.referenceCoordinates),w))}}}handleMove(a,l){const{onMove:o}=this.props;a.preventDefault(),o(l)}handleEnd(a){const{onEnd:l}=this.props;a.preventDefault(),this.detach(),l()}handleCancel(a){const{onCancel:l}=this.props;a.preventDefault(),this.detach(),l()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Qu.activators=[{eventName:"onKeyDown",handler:(n,a,l)=>{let{keyboardCodes:o=wj,onActivation:c}=a,{active:u}=l;const{code:f}=n.nativeEvent;if(o.start.includes(f)){const p=u.activatorNode.current;return p&&n.target!==p?!1:(n.preventDefault(),c==null||c({event:n.nativeEvent}),!0)}return!1}}];function Hb(n){return!!(n&&"distance"in n)}function qb(n){return!!(n&&"delay"in n)}class Lp{constructor(a,l,o){var c;o===void 0&&(o=f3(a.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=a,this.events=l;const{event:u}=a,{target:f}=u;this.props=a,this.events=l,this.document=no(f),this.documentListeners=new ti(this.document),this.listeners=new ti(o),this.windowListeners=new ti(qn(f)),this.initialCoordinates=(c=hm(u))!=null?c:Ea,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:a,props:{options:{activationConstraint:l,bypassActivationConstraint:o}}}=this;if(this.listeners.add(a.move.name,this.handleMove,{passive:!1}),this.listeners.add(a.end.name,this.handleEnd),a.cancel&&this.listeners.add(a.cancel.name,this.handleCancel),this.windowListeners.add(da.Resize,this.handleCancel),this.windowListeners.add(da.DragStart,Bb),this.windowListeners.add(da.VisibilityChange,this.handleCancel),this.windowListeners.add(da.ContextMenu,Bb),this.documentListeners.add(da.Keydown,this.handleKeydown),l){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(qb(l)){this.timeoutId=setTimeout(this.handleStart,l.delay),this.handlePending(l);return}if(Hb(l)){this.handlePending(l);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(a,l){const{active:o,onPending:c}=this.props;c(o,a,this.initialCoordinates,l)}handleStart(){const{initialCoordinates:a}=this,{onStart:l}=this.props;a&&(this.activated=!0,this.documentListeners.add(da.Click,h3,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(da.SelectionChange,this.removeTextSelection),l(a))}handleMove(a){var l;const{activated:o,initialCoordinates:c,props:u}=this,{onMove:f,options:{activationConstraint:p}}=u;if(!c)return;const g=(l=hm(a))!=null?l:Ea,v=ci(c,g);if(!o&&p){if(Hb(p)){if(p.tolerance!=null&&Ih(v,p.tolerance))return this.handleCancel();if(Ih(v,p.distance))return this.handleStart()}if(qb(p)&&Ih(v,p.tolerance))return this.handleCancel();this.handlePending(p,v);return}a.cancelable&&a.preventDefault(),f(g)}handleEnd(){const{onAbort:a,onEnd:l}=this.props;this.detach(),this.activated||a(this.props.active),l()}handleCancel(){const{onAbort:a,onCancel:l}=this.props;this.detach(),this.activated||a(this.props.active),l()}handleKeydown(a){a.code===Ke.Esc&&this.handleCancel()}removeTextSelection(){var a;(a=this.document.getSelection())==null||a.removeAllRanges()}}const p3={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Zu extends Lp{constructor(a){const{event:l}=a,o=no(l.target);super(a,p3,o)}}Zu.activators=[{eventName:"onPointerDown",handler:(n,a)=>{let{nativeEvent:l}=n,{onActivation:o}=a;return!l.isPrimary||l.button!==0?!1:(o==null||o({event:l}),!0)}}];const g3={move:{name:"mousemove"},end:{name:"mouseup"}};var pm;(function(n){n[n.RightClick=2]="RightClick"})(pm||(pm={}));class v3 extends Lp{constructor(a){super(a,g3,no(a.event.target))}}v3.activators=[{eventName:"onMouseDown",handler:(n,a)=>{let{nativeEvent:l}=n,{onActivation:o}=a;return l.button===pm.RightClick?!1:(o==null||o({event:l}),!0)}}];const Ph={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class x3 extends Lp{constructor(a){super(a,Ph)}static setup(){return window.addEventListener(Ph.move.name,a,{capture:!1,passive:!1}),function(){window.removeEventListener(Ph.move.name,a)};function a(){}}}x3.activators=[{eventName:"onTouchStart",handler:(n,a)=>{let{nativeEvent:l}=n,{onActivation:o}=a;const{touches:c}=l;return c.length>1?!1:(o==null||o({event:l}),!0)}}];var ni;(function(n){n[n.Pointer=0]="Pointer",n[n.DraggableRect=1]="DraggableRect"})(ni||(ni={}));var wu;(function(n){n[n.TreeOrder=0]="TreeOrder",n[n.ReversedTreeOrder=1]="ReversedTreeOrder"})(wu||(wu={}));function y3(n){let{acceleration:a,activator:l=ni.Pointer,canScroll:o,draggingRect:c,enabled:u,interval:f=5,order:p=wu.TreeOrder,pointerCoordinates:g,scrollableAncestors:v,scrollableAncestorRects:x,delta:y,threshold:b}=n;const w=w3({delta:y,disabled:!u}),[N,S]=kk(),C=h.useRef({x:0,y:0}),R=h.useRef({x:0,y:0}),D=h.useMemo(()=>{switch(l){case ni.Pointer:return g?{top:g.y,bottom:g.y,left:g.x,right:g.x}:null;case ni.DraggableRect:return c}},[l,c,g]),A=h.useRef(null),M=h.useCallback(()=>{const E=A.current;if(!E)return;const _=C.current.x*R.current.x,U=C.current.y*R.current.y;E.scrollBy(_,U)},[]),O=h.useMemo(()=>p===wu.TreeOrder?[...v].reverse():v,[p,v]);h.useEffect(()=>{if(!u||!v.length||!D){S();return}for(const E of O){if((o==null?void 0:o(E))===!1)continue;const _=v.indexOf(E),U=x[_];if(!U)continue;const{direction:$,speed:te}=l3(E,U,D,a,b);for(const V of["x","y"])w[V][$[V]]||(te[V]=0,$[V]=0);if(te.x>0||te.y>0){S(),A.current=E,N(M,f),C.current=te,R.current=$;return}}C.current={x:0,y:0},R.current={x:0,y:0},S()},[a,M,o,S,u,f,JSON.stringify(D),JSON.stringify(w),N,v,O,x,JSON.stringify(b)])}const b3={x:{[an.Backward]:!1,[an.Forward]:!1},y:{[an.Backward]:!1,[an.Forward]:!1}};function w3(n){let{delta:a,disabled:l}=n;const o=fm(a);return Ci(c=>{if(l||!o||!c)return b3;const u={x:Math.sign(a.x-o.x),y:Math.sign(a.y-o.y)};return{x:{[an.Backward]:c.x[an.Backward]||u.x===-1,[an.Forward]:c.x[an.Forward]||u.x===1},y:{[an.Backward]:c.y[an.Backward]||u.y===-1,[an.Forward]:c.y[an.Forward]||u.y===1}}},[l,a,o])}function j3(n,a){const l=a!=null?n.get(a):void 0,o=l?l.node.current:null;return Ci(c=>{var u;return a==null?null:(u=o??c)!=null?u:null},[o,a])}function S3(n,a){return h.useMemo(()=>n.reduce((l,o)=>{const{sensor:c}=o,u=c.activators.map(f=>({eventName:f.eventName,handler:a(f.handler,o)}));return[...l,...u]},[]),[n,a])}var ui;(function(n){n[n.Always=0]="Always",n[n.BeforeDragging=1]="BeforeDragging",n[n.WhileDragging=2]="WhileDragging"})(ui||(ui={}));var gm;(function(n){n.Optimized="optimized"})(gm||(gm={}));const $b=new Map;function C3(n,a){let{dragging:l,dependencies:o,config:c}=a;const[u,f]=h.useState(null),{frequency:p,measure:g,strategy:v}=c,x=h.useRef(n),y=C(),b=ii(y),w=h.useCallback(function(R){R===void 0&&(R=[]),!b.current&&f(D=>D===null?R:D.concat(R.filter(A=>!D.includes(A))))},[b]),N=h.useRef(null),S=Ci(R=>{if(y&&!l)return $b;if(!R||R===$b||x.current!==n||u!=null){const D=new Map;for(let A of n){if(!A)continue;if(u&&u.length>0&&!u.includes(A.id)&&A.rect.current){D.set(A.id,A.rect.current);continue}const M=A.node.current,O=M?new zp(g(M),M):null;A.rect.current=O,O&&D.set(A.id,O)}return D}return R},[n,u,l,y,g]);return h.useEffect(()=>{x.current=n},[n]),h.useEffect(()=>{y||w()},[l,y]),h.useEffect(()=>{u&&u.length>0&&f(null)},[JSON.stringify(u)]),h.useEffect(()=>{y||typeof p!="number"||N.current!==null||(N.current=setTimeout(()=>{w(),N.current=null},p))},[p,y,w,...o]),{droppableRects:S,measureDroppableContainers:w,measuringScheduled:u!=null};function C(){switch(v){case ui.Always:return!1;case ui.BeforeDragging:return l;default:return!l}}}function jj(n,a){return Ci(l=>n?l||(typeof a=="function"?a(n):n):null,[a,n])}function N3(n,a){return jj(n,a)}function E3(n){let{callback:a,disabled:l}=n;const o=kp(a),c=h.useMemo(()=>{if(l||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:u}=window;return new u(o)},[o,l]);return h.useEffect(()=>()=>c==null?void 0:c.disconnect(),[c]),c}function Ju(n){let{callback:a,disabled:l}=n;const o=kp(a),c=h.useMemo(()=>{if(l||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:u}=window;return new u(o)},[l]);return h.useEffect(()=>()=>c==null?void 0:c.disconnect(),[c]),c}function R3(n){return new zp(ao(n),n)}function Vb(n,a,l){a===void 0&&(a=R3);const[o,c]=h.useState(null);function u(){c(g=>{if(!n)return null;if(n.isConnected===!1){var v;return(v=g??l)!=null?v:null}const x=a(n);return JSON.stringify(g)===JSON.stringify(x)?g:x})}const f=E3({callback(g){if(n)for(const v of g){const{type:x,target:y}=v;if(x==="childList"&&y instanceof HTMLElement&&y.contains(n)){u();break}}}}),p=Ju({callback:u});return qa(()=>{u(),n?(p==null||p.observe(n),f==null||f.observe(document.body,{childList:!0,subtree:!0})):(p==null||p.disconnect(),f==null||f.disconnect())},[n]),o}function T3(n){const a=jj(n);return mj(n,a)}const Yb=[];function A3(n){const a=h.useRef(n),l=Ci(o=>n?o&&o!==Yb&&n&&a.current&&n.parentNode===a.current.parentNode?o:Ku(n):Yb,[n]);return h.useEffect(()=>{a.current=n},[n]),l}function M3(n){const[a,l]=h.useState(null),o=h.useRef(n),c=h.useCallback(u=>{const f=Uh(u.target);f&&l(p=>p?(p.set(f,mm(f)),new Map(p)):null)},[]);return h.useEffect(()=>{const u=o.current;if(n!==u){f(u);const p=n.map(g=>{const v=Uh(g);return v?(v.addEventListener("scroll",c,{passive:!0}),[v,mm(v)]):null}).filter(g=>g!=null);l(p.length?new Map(p):null),o.current=n}return()=>{f(n),f(u)};function f(p){p.forEach(g=>{const v=Uh(g);v==null||v.removeEventListener("scroll",c)})}},[c,n]),h.useMemo(()=>n.length?a?Array.from(a.values()).reduce((u,f)=>ql(u,f),Ea):bj(n):Ea,[n,a])}function Gb(n,a){a===void 0&&(a=[]);const l=h.useRef(null);return h.useEffect(()=>{l.current=null},a),h.useEffect(()=>{const o=n!==Ea;o&&!l.current&&(l.current=n),!o&&l.current&&(l.current=null)},[n]),l.current?ci(n,l.current):Ea}function D3(n){h.useEffect(()=>{if(!Xu)return;const a=n.map(l=>{let{sensor:o}=l;return o.setup==null?void 0:o.setup()});return()=>{for(const l of a)l==null||l()}},n.map(a=>{let{sensor:l}=a;return l}))}function O3(n,a){return h.useMemo(()=>n.reduce((l,o)=>{let{eventName:c,handler:u}=o;return l[c]=f=>{u(f,a)},l},{}),[n,a])}function Sj(n){return h.useMemo(()=>n?n3(n):null,[n])}const Fb=[];function k3(n,a){a===void 0&&(a=ao);const[l]=n,o=Sj(l?qn(l):null),[c,u]=h.useState(Fb);function f(){u(()=>n.length?n.map(g=>xj(g)?o:new zp(a(g),g)):Fb)}const p=Ju({callback:f});return qa(()=>{p==null||p.disconnect(),f(),n.forEach(g=>p==null?void 0:p.observe(g))},[n]),c}function _3(n){if(!n)return null;if(n.children.length>1)return n;const a=n.children[0];return Si(a)?a:n}function z3(n){let{measure:a}=n;const[l,o]=h.useState(null),c=h.useCallback(v=>{for(const{target:x}of v)if(Si(x)){o(y=>{const b=a(x);return y?{...y,width:b.width,height:b.height}:b});break}},[a]),u=Ju({callback:c}),f=h.useCallback(v=>{const x=_3(v);u==null||u.disconnect(),x&&(u==null||u.observe(x)),o(x?a(x):null)},[a,u]),[p,g]=vu(f);return h.useMemo(()=>({nodeRef:p,rect:l,setRef:g}),[l,p,g])}const L3=[{sensor:Zu,options:{}},{sensor:Qu,options:{}}],U3={current:{}},ou={draggable:{measure:Pb},droppable:{measure:Pb,strategy:ui.WhileDragging,frequency:gm.Optimized},dragOverlay:{measure:ao}};class ai extends Map{get(a){var l;return a!=null&&(l=super.get(a))!=null?l:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(a=>{let{disabled:l}=a;return!l})}getNodeFor(a){var l,o;return(l=(o=this.get(a))==null?void 0:o.node.current)!=null?l:void 0}}const I3={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ai,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:yu},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ou,measureDroppableContainers:yu,windowRect:null,measuringScheduled:!1},P3={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:yu,draggableNodes:new Map,over:null,measureDroppableContainers:yu},Wu=h.createContext(P3),Cj=h.createContext(I3);function B3(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ai}}}function H3(n,a){switch(a.type){case Ft.DragStart:return{...n,draggable:{...n.draggable,initialCoordinates:a.initialCoordinates,active:a.active}};case Ft.DragMove:return n.draggable.active==null?n:{...n,draggable:{...n.draggable,translate:{x:a.coordinates.x-n.draggable.initialCoordinates.x,y:a.coordinates.y-n.draggable.initialCoordinates.y}}};case Ft.DragEnd:case Ft.DragCancel:return{...n,draggable:{...n.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Ft.RegisterDroppable:{const{element:l}=a,{id:o}=l,c=new ai(n.droppable.containers);return c.set(o,l),{...n,droppable:{...n.droppable,containers:c}}}case Ft.SetDroppableDisabled:{const{id:l,key:o,disabled:c}=a,u=n.droppable.containers.get(l);if(!u||o!==u.key)return n;const f=new ai(n.droppable.containers);return f.set(l,{...u,disabled:c}),{...n,droppable:{...n.droppable,containers:f}}}case Ft.UnregisterDroppable:{const{id:l,key:o}=a,c=n.droppable.containers.get(l);if(!c||o!==c.key)return n;const u=new ai(n.droppable.containers);return u.delete(l),{...n,droppable:{...n.droppable,containers:u}}}default:return n}}function q3(n){let{disabled:a}=n;const{active:l,activatorEvent:o,draggableNodes:c}=h.useContext(Wu),u=fm(o),f=fm(l==null?void 0:l.id);return h.useEffect(()=>{if(!a&&!o&&u&&f!=null){if(!_p(u)||document.activeElement===u.target)return;const p=c.get(f);if(!p)return;const{activatorNode:g,node:v}=p;if(!g.current&&!v.current)return;requestAnimationFrame(()=>{for(const x of[g.current,v.current]){if(!x)continue;const y=Lk(x);if(y){y.focus();break}}})}},[o,a,c,f,u]),null}function $3(n,a){let{transform:l,...o}=a;return n!=null&&n.length?n.reduce((c,u)=>u({transform:c,...o}),l):l}function V3(n){return h.useMemo(()=>({draggable:{...ou.draggable,...n==null?void 0:n.draggable},droppable:{...ou.droppable,...n==null?void 0:n.droppable},dragOverlay:{...ou.dragOverlay,...n==null?void 0:n.dragOverlay}}),[n==null?void 0:n.draggable,n==null?void 0:n.droppable,n==null?void 0:n.dragOverlay])}function Y3(n){let{activeNode:a,measure:l,initialRect:o,config:c=!0}=n;const u=h.useRef(!1),{x:f,y:p}=typeof c=="boolean"?{x:c,y:c}:c;qa(()=>{if(!f&&!p||!a){u.current=!1;return}if(u.current||!o)return;const v=a==null?void 0:a.node.current;if(!v||v.isConnected===!1)return;const x=l(v),y=mj(x,o);if(f||(y.x=0),p||(y.y=0),u.current=!0,Math.abs(y.x)>0||Math.abs(y.y)>0){const b=pj(v);b&&b.scrollBy({top:y.y,left:y.x})}},[a,f,p,o,l])}const Nj=h.createContext({...Ea,scaleX:1,scaleY:1});var ss;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Initializing=1]="Initializing",n[n.Initialized=2]="Initialized"})(ss||(ss={}));const Ej=h.memo(function(a){var l,o,c,u;let{id:f,accessibility:p,autoScroll:g=!0,children:v,sensors:x=L3,collisionDetection:y=Kk,measuring:b,modifiers:w,...N}=a;const S=h.useReducer(H3,void 0,B3),[C,R]=S,[D,A]=qk(),[M,O]=h.useState(ss.Uninitialized),E=M===ss.Initialized,{draggable:{active:_,nodes:U,translate:$},droppable:{containers:te}}=C,V=_!=null?U.get(_):null,H=h.useRef({initial:null,translated:null}),ae=h.useMemo(()=>{var xt;return _!=null?{id:_,data:(xt=V==null?void 0:V.data)!=null?xt:U3,rect:H}:null},[_,V]),ee=h.useRef(null),[B,k]=h.useState(null),[q,Z]=h.useState(null),J=ii(N,Object.values(N)),ne=Ni("DndDescribedBy",f),z=h.useMemo(()=>te.getEnabled(),[te]),L=V3(b),{droppableRects:F,measureDroppableContainers:se,measuringScheduled:pe}=C3(z,{dragging:E,dependencies:[$.x,$.y],config:L.droppable}),ye=j3(U,_),G=h.useMemo(()=>q?hm(q):null,[q]),ue=Ar(),he=N3(ye,L.draggable.measure);Y3({activeNode:_!=null?U.get(_):null,config:ue.layoutShiftCompensation,initialRect:he,measure:L.draggable.measure});const xe=Vb(ye,L.draggable.measure,he),Ae=Vb(ye?ye.parentElement:null),Ne=h.useRef({activatorEvent:null,active:null,activeNode:ye,collisionRect:null,collisions:null,droppableRects:F,draggableNodes:U,draggingNode:null,draggingNodeRect:null,droppableContainers:te,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Oe=te.getNodeFor((l=Ne.current.over)==null?void 0:l.id),Qe=z3({measure:L.dragOverlay.measure}),et=(o=Qe.nodeRef.current)!=null?o:ye,ce=E?(c=Qe.rect)!=null?c:xe:null,Le=!!(Qe.nodeRef.current&&Qe.rect),qe=T3(Le?null:xe),_t=Sj(et?qn(et):null),St=A3(E?Oe??ye:null),Wt=k3(St),mn=$3(w,{transform:{x:$.x-qe.x,y:$.y-qe.y,scaleX:1,scaleY:1},activatorEvent:q,active:ae,activeNodeRect:xe,containerNodeRect:Ae,draggingNodeRect:ce,over:Ne.current.over,overlayNodeRect:Qe.rect,scrollableAncestors:St,scrollableAncestorRects:Wt,windowRect:_t}),en=G?ql(G,$):null,Ct=M3(St),xn=Gb(Ct),At=Gb(Ct,[xe]),Mt=ql(mn,xn),pn=ce?Jk(ce,mn):null,pa=ae&&pn?y({active:ae,collisionRect:pn,droppableRects:F,droppableContainers:z,pointerCoordinates:en}):null,Aa=fj(pa,"id"),[Wn,hs]=h.useState(null),ga=Le?mn:ql(mn,At),Dt=Qk(ga,(u=Wn==null?void 0:Wn.rect)!=null?u:null,xe),yn=h.useRef(null),Tt=h.useCallback((xt,at)=>{let{sensor:It,options:Ee}=at;if(ee.current==null)return;const _e=U.get(ee.current);if(!_e)return;const Ue=xt.nativeEvent,vt=new It({active:ee.current,activeNode:_e,event:Ue,options:Ee,context:Ne,onAbort(ut){if(!U.get(ut))return;const{onDragAbort:yt}=J.current,zt={id:ut};yt==null||yt(zt),D({type:"onDragAbort",event:zt})},onPending(ut,Yt,yt,zt){if(!U.get(ut))return;const{onDragPending:Fa}=J.current,va={id:ut,constraint:Yt,initialCoordinates:yt,offset:zt};Fa==null||Fa(va),D({type:"onDragPending",event:va})},onStart(ut){const Yt=ee.current;if(Yt==null)return;const yt=U.get(Yt);if(!yt)return;const{onDragStart:zt}=J.current,Ga={activatorEvent:Ue,active:{id:Yt,data:yt.data,rect:H}};Sa.unstable_batchedUpdates(()=>{zt==null||zt(Ga),O(ss.Initializing),R({type:Ft.DragStart,initialCoordinates:ut,active:Yt}),D({type:"onDragStart",event:Ga}),k(yn.current),Z(Ue)})},onMove(ut){R({type:Ft.DragMove,coordinates:ut})},onEnd:Nt(Ft.DragEnd),onCancel:Nt(Ft.DragCancel)});yn.current=vt;function Nt(ut){return async function(){const{active:yt,collisions:zt,over:Ga,scrollAdjustedTranslate:Fa}=Ne.current;let va=null;if(yt&&Fa){const{cancelDrop:Mr}=J.current;va={activatorEvent:Ue,active:yt,collisions:zt,delta:Fa,over:Ga},ut===Ft.DragEnd&&typeof Mr=="function"&&await Promise.resolve(Mr(va))&&(ut=Ft.DragCancel)}ee.current=null,Sa.unstable_batchedUpdates(()=>{R({type:ut}),O(ss.Uninitialized),hs(null),k(null),Z(null),yn.current=null;const Mr=ut===Ft.DragEnd?"onDragEnd":"onDragCancel";if(va){const ea=J.current[Mr];ea==null||ea(va),D({type:Mr,event:va})}})}}},[U]),so=h.useCallback((xt,at)=>(It,Ee)=>{const _e=It.nativeEvent,Ue=U.get(Ee);if(ee.current!==null||!Ue||_e.dndKit||_e.defaultPrevented)return;const vt={active:Ue};xt(It,at.options,vt)===!0&&(_e.dndKit={capturedBy:at.sensor},ee.current=Ee,Tt(It,at))},[U,Tt]),Ys=S3(x,so);D3(x),qa(()=>{xe&&M===ss.Initializing&&O(ss.Initialized)},[xe,M]),h.useEffect(()=>{const{onDragMove:xt}=J.current,{active:at,activatorEvent:It,collisions:Ee,over:_e}=Ne.current;if(!at||!It)return;const Ue={active:at,activatorEvent:It,collisions:Ee,delta:{x:Mt.x,y:Mt.y},over:_e};Sa.unstable_batchedUpdates(()=>{xt==null||xt(Ue),D({type:"onDragMove",event:Ue})})},[Mt.x,Mt.y]),h.useEffect(()=>{const{active:xt,activatorEvent:at,collisions:It,droppableContainers:Ee,scrollAdjustedTranslate:_e}=Ne.current;if(!xt||ee.current==null||!at||!_e)return;const{onDragOver:Ue}=J.current,vt=Ee.get(Aa),Nt=vt&&vt.rect.current?{id:vt.id,rect:vt.rect.current,data:vt.data,disabled:vt.disabled}:null,ut={active:xt,activatorEvent:at,collisions:It,delta:{x:_e.x,y:_e.y},over:Nt};Sa.unstable_batchedUpdates(()=>{hs(Nt),Ue==null||Ue(ut),D({type:"onDragOver",event:ut})})},[Aa]),qa(()=>{Ne.current={activatorEvent:q,active:ae,activeNode:ye,collisionRect:pn,collisions:pa,droppableRects:F,draggableNodes:U,draggingNode:et,draggingNodeRect:ce,droppableContainers:te,over:Wn,scrollableAncestors:St,scrollAdjustedTranslate:Mt},H.current={initial:ce,translated:pn}},[ae,ye,pa,pn,U,et,ce,F,te,Wn,St,Mt]),y3({...ue,delta:$,draggingRect:pn,pointerCoordinates:en,scrollableAncestors:St,scrollableAncestorRects:Wt});const Gs=h.useMemo(()=>({active:ae,activeNode:ye,activeNodeRect:xe,activatorEvent:q,collisions:pa,containerNodeRect:Ae,dragOverlay:Qe,draggableNodes:U,droppableContainers:te,droppableRects:F,over:Wn,measureDroppableContainers:se,scrollableAncestors:St,scrollableAncestorRects:Wt,measuringConfiguration:L,measuringScheduled:pe,windowRect:_t}),[ae,ye,xe,q,pa,Ae,Qe,U,te,F,Wn,se,St,Wt,L,pe,_t]),Ya=h.useMemo(()=>({activatorEvent:q,activators:Ys,active:ae,activeNodeRect:xe,ariaDescribedById:{draggable:ne},dispatch:R,draggableNodes:U,over:Wn,measureDroppableContainers:se}),[q,Ys,ae,xe,R,ne,U,Wn,se]);return me.createElement(ij.Provider,{value:A},me.createElement(Wu.Provider,{value:Ya},me.createElement(Cj.Provider,{value:Gs},me.createElement(Nj.Provider,{value:Dt},v)),me.createElement(q3,{disabled:(p==null?void 0:p.restoreFocus)===!1})),me.createElement(Yk,{...p,hiddenTextDescribedById:ne}));function Ar(){const xt=(B==null?void 0:B.autoScrollEnabled)===!1,at=typeof g=="object"?g.enabled===!1:g===!1,It=E&&!xt&&!at;return typeof g=="object"?{...g,enabled:It}:{enabled:It}}}),G3=h.createContext(null),Xb="button",F3="Draggable";function X3(n){let{id:a,data:l,disabled:o=!1,attributes:c}=n;const u=Ni(F3),{activators:f,activatorEvent:p,active:g,activeNodeRect:v,ariaDescribedById:x,draggableNodes:y,over:b}=h.useContext(Wu),{role:w=Xb,roleDescription:N="draggable",tabIndex:S=0}=c??{},C=(g==null?void 0:g.id)===a,R=h.useContext(C?Nj:G3),[D,A]=vu(),[M,O]=vu(),E=O3(f,a),_=ii(l);qa(()=>(y.set(a,{id:a,key:u,node:D,activatorNode:M,data:_}),()=>{const $=y.get(a);$&&$.key===u&&y.delete(a)}),[y,a]);const U=h.useMemo(()=>({role:w,tabIndex:S,"aria-disabled":o,"aria-pressed":C&&w===Xb?!0:void 0,"aria-roledescription":N,"aria-describedby":x.draggable}),[o,w,S,C,N,x.draggable]);return{active:g,activatorEvent:p,activeNodeRect:v,attributes:U,isDragging:C,listeners:o?void 0:E,node:D,over:b,setNodeRef:A,setActivatorNodeRef:O,transform:R}}function K3(){return h.useContext(Cj)}const Q3="Droppable",Z3={timeout:25};function J3(n){let{data:a,disabled:l=!1,id:o,resizeObserverConfig:c}=n;const u=Ni(Q3),{active:f,dispatch:p,over:g,measureDroppableContainers:v}=h.useContext(Wu),x=h.useRef({disabled:l}),y=h.useRef(!1),b=h.useRef(null),w=h.useRef(null),{disabled:N,updateMeasurementsFor:S,timeout:C}={...Z3,...c},R=ii(S??o),D=h.useCallback(()=>{if(!y.current){y.current=!0;return}w.current!=null&&clearTimeout(w.current),w.current=setTimeout(()=>{v(Array.isArray(R.current)?R.current:[R.current]),w.current=null},C)},[C]),A=Ju({callback:D,disabled:N||!f}),M=h.useCallback((U,$)=>{A&&($&&(A.unobserve($),y.current=!1),U&&A.observe(U))},[A]),[O,E]=vu(M),_=ii(a);return h.useEffect(()=>{!A||!O.current||(A.disconnect(),y.current=!1,A.observe(O.current))},[O,A]),h.useEffect(()=>(p({type:Ft.RegisterDroppable,element:{id:o,key:u,disabled:l,node:O,rect:b,data:_}}),()=>p({type:Ft.UnregisterDroppable,key:u,id:o})),[o]),h.useEffect(()=>{l!==x.current.disabled&&(p({type:Ft.SetDroppableDisabled,id:o,key:u,disabled:l}),x.current.disabled=l)},[o,u,l,p]),{active:f,rect:b,isOver:(g==null?void 0:g.id)===o,node:O,over:g,setNodeRef:E}}function W3(n,a,l){const o={...n};return a.top+n.y<=l.top?o.y=l.top-a.top:a.bottom+n.y>=l.top+l.height&&(o.y=l.top+l.height-a.bottom),a.left+n.x<=l.left?o.x=l.left-a.left:a.right+n.x>=l.left+l.width&&(o.x=l.left+l.width-a.right),o}const Rj=n=>{let{containerNodeRect:a,draggingNodeRect:l,transform:o}=n;return!l||!a?o:W3(o,l,a)},Tj=n=>{let{transform:a}=n;return{...a,x:0}};function ed(n,a,l){const o=n.slice();return o.splice(l<0?o.length+l:l,0,o.splice(a,1)[0]),o}function e_(n,a){return n.reduce((l,o,c)=>{const u=a.get(o);return u&&(l[c]=u),l},Array(n.length))}function Xc(n){return n!==null&&n>=0}function t_(n,a){if(n===a)return!0;if(n.length!==a.length)return!1;for(let l=0;l<n.length;l++)if(n[l]!==a[l])return!1;return!0}function n_(n){return typeof n=="boolean"?{draggable:n,droppable:n}:n}const Aj=n=>{let{rects:a,activeIndex:l,overIndex:o,index:c}=n;const u=ed(a,o,l),f=a[c],p=u[c];return!p||!f?null:{x:p.left-f.left,y:p.top-f.top,scaleX:p.width/f.width,scaleY:p.height/f.height}},Kc={scaleX:1,scaleY:1},Mj=n=>{var a;let{activeIndex:l,activeNodeRect:o,index:c,rects:u,overIndex:f}=n;const p=(a=u[l])!=null?a:o;if(!p)return null;if(c===l){const v=u[f];return v?{x:0,y:l<f?v.top+v.height-(p.top+p.height):v.top-p.top,...Kc}:null}const g=a_(u,c,l);return c>l&&c<=f?{x:0,y:-p.height-g,...Kc}:c<l&&c>=f?{x:0,y:p.height+g,...Kc}:{x:0,y:0,...Kc}};function a_(n,a,l){const o=n[a],c=n[a-1],u=n[a+1];return o?l<a?c?o.top-(c.top+c.height):u?u.top-(o.top+o.height):0:u?u.top-(o.top+o.height):c?o.top-(c.top+c.height):0:0}const Dj="Sortable",Oj=me.createContext({activeIndex:-1,containerId:Dj,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Aj,disabled:{draggable:!1,droppable:!1}});function kj(n){let{children:a,id:l,items:o,strategy:c=Aj,disabled:u=!1}=n;const{active:f,dragOverlay:p,droppableRects:g,over:v,measureDroppableContainers:x}=K3(),y=Ni(Dj,l),b=p.rect!==null,w=h.useMemo(()=>o.map(E=>typeof E=="object"&&"id"in E?E.id:E),[o]),N=f!=null,S=f?w.indexOf(f.id):-1,C=v?w.indexOf(v.id):-1,R=h.useRef(w),D=!t_(w,R.current),A=C!==-1&&S===-1||D,M=n_(u);qa(()=>{D&&N&&x(w)},[D,w,N,x]),h.useEffect(()=>{R.current=w},[w]);const O=h.useMemo(()=>({activeIndex:S,containerId:y,disabled:M,disableTransforms:A,items:w,overIndex:C,useDragOverlay:b,sortedRects:e_(w,g),strategy:c}),[S,y,M.draggable,M.droppable,A,w,C,g,b,c]);return me.createElement(Oj.Provider,{value:O},a)}const r_=n=>{let{id:a,items:l,activeIndex:o,overIndex:c}=n;return ed(l,o,c).indexOf(a)},s_=n=>{let{containerId:a,isSorting:l,wasDragging:o,index:c,items:u,newIndex:f,previousItems:p,previousContainerId:g,transition:v}=n;return!v||!o||p!==u&&c===f?!1:l?!0:f!==c&&a===g},l_={duration:200,easing:"ease"},_j="transform",o_=xu.Transition.toString({property:_j,duration:0,easing:"linear"}),i_={roleDescription:"sortable"};function c_(n){let{disabled:a,index:l,node:o,rect:c}=n;const[u,f]=h.useState(null),p=h.useRef(l);return qa(()=>{if(!a&&l!==p.current&&o.current){const g=c.current;if(g){const v=ao(o.current,{ignoreTransform:!0}),x={x:g.left-v.left,y:g.top-v.top,scaleX:g.width/v.width,scaleY:g.height/v.height};(x.x||x.y)&&f(x)}}l!==p.current&&(p.current=l)},[a,l,o,c]),h.useEffect(()=>{u&&f(null)},[u]),u}function zj(n){let{animateLayoutChanges:a=s_,attributes:l,disabled:o,data:c,getNewIndex:u=r_,id:f,strategy:p,resizeObserverConfig:g,transition:v=l_}=n;const{items:x,containerId:y,activeIndex:b,disabled:w,disableTransforms:N,sortedRects:S,overIndex:C,useDragOverlay:R,strategy:D}=h.useContext(Oj),A=u_(o,w),M=x.indexOf(f),O=h.useMemo(()=>({sortable:{containerId:y,index:M,items:x},...c}),[y,c,M,x]),E=h.useMemo(()=>x.slice(x.indexOf(f)),[x,f]),{rect:_,node:U,isOver:$,setNodeRef:te}=J3({id:f,data:O,disabled:A.droppable,resizeObserverConfig:{updateMeasurementsFor:E,...g}}),{active:V,activatorEvent:H,activeNodeRect:ae,attributes:ee,setNodeRef:B,listeners:k,isDragging:q,over:Z,setActivatorNodeRef:J,transform:ne}=X3({id:f,data:O,attributes:{...i_,...l},disabled:A.draggable}),z=Ok(te,B),L=!!V,F=L&&!N&&Xc(b)&&Xc(C),se=!R&&q,pe=se&&F?ne:null,G=F?pe??(p??D)({rects:S,activeNodeRect:ae,activeIndex:b,overIndex:C,index:M}):null,ue=Xc(b)&&Xc(C)?u({id:f,items:x,activeIndex:b,overIndex:C}):M,he=V==null?void 0:V.id,xe=h.useRef({activeId:he,items:x,newIndex:ue,containerId:y}),Ae=x!==xe.current.items,Ne=a({active:V,containerId:y,isDragging:q,isSorting:L,id:f,index:M,items:x,newIndex:xe.current.newIndex,previousItems:xe.current.items,previousContainerId:xe.current.containerId,transition:v,wasDragging:xe.current.activeId!=null}),Oe=c_({disabled:!Ne,index:M,node:U,rect:_});return h.useEffect(()=>{L&&xe.current.newIndex!==ue&&(xe.current.newIndex=ue),y!==xe.current.containerId&&(xe.current.containerId=y),x!==xe.current.items&&(xe.current.items=x)},[L,ue,y,x]),h.useEffect(()=>{if(he===xe.current.activeId)return;if(he!=null&&xe.current.activeId==null){xe.current.activeId=he;return}const et=setTimeout(()=>{xe.current.activeId=he},50);return()=>clearTimeout(et)},[he]),{active:V,activeIndex:b,attributes:ee,data:O,rect:_,index:M,newIndex:ue,items:x,isOver:$,isSorting:L,isDragging:q,listeners:k,node:U,overIndex:C,over:Z,setNodeRef:z,setActivatorNodeRef:J,setDroppableNodeRef:te,setDraggableNodeRef:B,transform:Oe??G,transition:Qe()};function Qe(){if(Oe||Ae&&xe.current.newIndex===M)return o_;if(!(se&&!_p(H)||!v)&&(L||Ne))return xu.Transition.toString({...v,property:_j})}}function u_(n,a){var l,o;return typeof n=="boolean"?{draggable:n,droppable:!1}:{draggable:(l=n==null?void 0:n.draggable)!=null?l:a.draggable,droppable:(o=n==null?void 0:n.droppable)!=null?o:a.droppable}}function ju(n){if(!n)return!1;const a=n.data.current;return!!(a&&"sortable"in a&&typeof a.sortable=="object"&&"containerId"in a.sortable&&"items"in a.sortable&&"index"in a.sortable)}const d_=[Ke.Down,Ke.Right,Ke.Up,Ke.Left],Lj=(n,a)=>{let{context:{active:l,collisionRect:o,droppableRects:c,droppableContainers:u,over:f,scrollableAncestors:p}}=a;if(d_.includes(n.code)){if(n.preventDefault(),!l||!o)return;const g=[];u.getEnabled().forEach(y=>{if(!y||y!=null&&y.disabled)return;const b=c.get(y.id);if(b)switch(n.code){case Ke.Down:o.top<b.top&&g.push(y);break;case Ke.Up:o.top>b.top&&g.push(y);break;case Ke.Left:o.left>b.left&&g.push(y);break;case Ke.Right:o.left<b.left&&g.push(y);break}});const v=Fk({collisionRect:o,droppableRects:c,droppableContainers:g});let x=fj(v,"id");if(x===(f==null?void 0:f.id)&&v.length>1&&(x=v[1].id),x!=null){const y=u.get(l.id),b=u.get(x),w=b?c.get(b.id):null,N=b==null?void 0:b.node.current;if(N&&w&&y&&b){const C=Ku(N).some((E,_)=>p[_]!==E),R=Uj(y,b),D=f_(y,b),A=C||!R?{x:0,y:0}:{x:D?o.width-w.width:0,y:D?o.height-w.height:0},M={x:w.left,y:w.top};return A.x&&A.y?M:ci(M,A)}}}};function Uj(n,a){return!ju(n)||!ju(a)?!1:n.data.current.sortable.containerId===a.data.current.sortable.containerId}function f_(n,a){return!ju(n)||!ju(a)||!Uj(n,a)?!1:n.data.current.sortable.index<a.data.current.sortable.index}var h_=Object.defineProperty,Sr=(n,a)=>h_(n,"name",{value:a,configurable:!0}),Up="Checkbox",[m_,y5]=Hn(Up),[p_,Ip]=m_(Up);function Ij(n){const{__scopeCheckbox:a,checked:l,children:o,defaultChecked:c,disabled:u,form:f,name:p,onCheckedChange:g,required:v,value:x="on",internal_do_not_use_render:y}=n,[b,w]=Ia({prop:l,defaultProp:c??!1,onChange:g,caller:Up}),[N,S]=h.useState(null),[C,R]=h.useState(null),D=h.useRef(!1),[A,M]=h.useReducer(_=>_+1,0),O=N?!!f||!!N.closest("form"):!0,E={checked:b,disabled:u,setChecked:w,control:N,setControl:S,name:p,form:f,value:x,hasConsumerStoppedPropagationRef:D,userInteractionCount:A,onUserInteraction:M,required:v,defaultChecked:xr(c)?!1:c,isFormControl:O,bubbleInput:C,setBubbleInput:R};return s.jsx(p_,{scope:a,...E,children:Bj(y)?y(E):o})}Sr(Ij,"CheckboxProvider");var g_="CheckboxTrigger",v_=h.forwardRef(Sr(function({__scopeCheckbox:a,onKeyDown:l,onClick:o,...c},u){const{control:f,value:p,disabled:g,checked:v,required:x,setControl:y,setChecked:b,hasConsumerStoppedPropagationRef:w,onUserInteraction:N,isFormControl:S,bubbleInput:C}=Ip(g_,a),R=Fe(u,y),D=h.useRef(v);return h.useEffect(()=>{const A=f==null?void 0:f.form;if(A){const M=Sr(()=>b(D.current),"reset");return A.addEventListener("reset",M),()=>A.removeEventListener("reset",M)}},[f,b]),s.jsx(He.button,{type:"button",role:"checkbox","aria-checked":xr(v)?"mixed":v,"aria-required":x,"data-state":Pp(v),"data-disabled":g?"":void 0,disabled:g,value:p,...c,ref:R,onKeyDown:Se(l,A=>{A.key==="Enter"&&A.preventDefault()}),onClick:Se(o,A=>{N(),b(M=>xr(M)?!0:!M),C&&S&&(w.current=A.isPropagationStopped(),w.current||A.stopPropagation())})})},"CheckboxTrigger")),Pj=h.forwardRef(Sr(function(a,l){const{__scopeCheckbox:o,name:c,checked:u,defaultChecked:f,required:p,disabled:g,value:v,onCheckedChange:x,form:y,...b}=a;return s.jsx(Ij,{__scopeCheckbox:o,checked:u,defaultChecked:f,disabled:g,required:p,onCheckedChange:x,name:c,form:y,value:v,internal_do_not_use_render:({isFormControl:w})=>s.jsxs(s.Fragment,{children:[s.jsx(v_,{...b,ref:l,__scopeCheckbox:o}),w&&s.jsx(w_,{__scopeCheckbox:o})]})})},"Checkbox")),x_="CheckboxIndicator",y_=h.forwardRef(Sr(function(a,l){const{__scopeCheckbox:o,forceMount:c,...u}=a,f=Ip(x_,o);return s.jsx(Er,{present:c||xr(f.checked)||f.checked===!0,children:s.jsx(He.span,{"data-state":Pp(f.checked),"data-disabled":f.disabled?"":void 0,...u,ref:l,style:{pointerEvents:"none",...a.style}})})},"CheckboxIndicator")),b_="CheckboxBubbleInput",w_=h.forwardRef(Sr(function({__scopeCheckbox:a,onClick:l,...o},c){const{control:u,hasConsumerStoppedPropagationRef:f,userInteractionCount:p,checked:g,defaultChecked:v,required:x,disabled:y,name:b,value:w,form:N,bubbleInput:S,setBubbleInput:C}=Ip(b_,a),R=Fe(c,C),D=Iu(u),A=h.useRef(!1),M=h.useRef(g),O=h.useRef(p);h.useEffect(()=>{const _=S;if(!_)return;const U=window.HTMLInputElement.prototype,te=Object.getOwnPropertyDescriptor(U,"checked").set,V=p!==O.current;O.current=p;const H=M.current!==g;M.current=g;const ae=!(V&&f.current);if(H&&te){A.current=!V;const ee=new Event("click",{bubbles:ae});_.indeterminate=xr(g),te.call(_,xr(g)?!1:g),_.dispatchEvent(ee),A.current=!1}},[S,g,f,p]);const E=h.useRef(xr(g)?!1:g);return s.jsx(He.input,{type:"checkbox","aria-hidden":!0,defaultChecked:v??E.current,required:x,disabled:y,name:b,value:w,form:N,...o,tabIndex:-1,ref:R,onClick:Se(l,_=>{A.current&&_.stopPropagation()}),style:{...o.style,...D,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function Bj(n){return typeof n=="function"}Sr(Bj,"isFunction");function xr(n){return n==="indeterminate"}Sr(xr,"isIndeterminate");function Pp(n){return xr(n)?"indeterminate":n?"checked":"unchecked"}Sr(Pp,"getState");const Cr=h.forwardRef(({className:n,...a},l)=>s.jsx(Pj,{ref:l,className:Re("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),...a,children:s.jsx(y_,{className:Re("flex items-center justify-center text-current"),children:s.jsx(Um,{className:"h-3.5 w-3.5"})})}));Cr.displayName=Pj.displayName;function j_({value:n,className:a,indicatorClassName:l}){const o=Math.max(0,Math.min(100,Number.isFinite(n)?n:0));return s.jsx("div",{role:"progressbar","aria-valuenow":Math.round(o),"aria-valuemin":0,"aria-valuemax":100,className:Re("h-2 w-full overflow-hidden rounded-full bg-secondary",a),children:s.jsx("div",{className:Re("h-full w-full flex-1 bg-primary transition-all",l),style:{transform:`translateX(-${100-o}%)`}})})}var S_=Object.defineProperty,hn=(n,a)=>S_(n,"name",{value:a,configurable:!0}),[Bp,b5]=Hn("Tooltip",[eo]),Hp=eo(),C_="TooltipProvider",N_=700,vm="tooltip.open",[E_,qp]=Bp(C_),R_=hn(n=>{const{__scopeTooltip:a,delayDuration:l=N_,skipDelayDuration:o=300,disableHoverableContent:c=!1,children:u}=n,f=h.useRef(!0),p=h.useRef(!1),g=h.useRef(0);return h.useEffect(()=>{const v=g.current;return()=>window.clearTimeout(v)},[]),s.jsx(E_,{scope:a,isOpenDelayedRef:f,delayDuration:l,onOpen:h.useCallback(()=>{o<=0||(window.clearTimeout(g.current),f.current=!1)},[o]),onClose:h.useCallback(()=>{o<=0||(window.clearTimeout(g.current),g.current=window.setTimeout(()=>f.current=!0,o))},[o]),isPointerInTransitRef:p,onPointerInTransitChange:h.useCallback(v=>{p.current=v},[]),disableHoverableContent:c,children:u})},"TooltipProvider"),xm="Tooltip",[T_,td]=Bp(xm),A_=hn(n=>{const{__scopeTooltip:a,children:l,open:o,defaultOpen:c,onOpenChange:u,disableHoverableContent:f,delayDuration:p}=n,g=qp(xm,n.__scopeTooltip),v=Hp(a),[x,y]=h.useState(null),[b,w]=h.useState(void 0),N=Na(),S=h.useRef(0),C=f??g.disableHoverableContent,R=p??g.delayDuration,D=h.useRef(!1),[A,M]=Ia({prop:o,defaultProp:c??!1,onChange:hn(te=>{te?(g.onOpen(),document.dispatchEvent(new CustomEvent(vm))):g.onClose(),u==null||u(te)},"onChange"),caller:xm}),O=h.useMemo(()=>A?D.current?"delayed-open":"instant-open":"closed",[A]),E=h.useCallback(()=>{window.clearTimeout(S.current),S.current=0,D.current=!1,M(!0)},[M]),_=h.useCallback(()=>{window.clearTimeout(S.current),S.current=0,M(!1)},[M]),U=h.useCallback(()=>{window.clearTimeout(S.current),S.current=window.setTimeout(()=>{D.current=!0,M(!0),S.current=0},R)},[R,M]);h.useEffect(()=>()=>{S.current&&(window.clearTimeout(S.current),S.current=0)},[]);const $=b??N;return s.jsx(ap,{...v,children:s.jsx(T_,{scope:a,contentId:$,setContentId:w,open:A,stateAttribute:O,trigger:x,onTriggerChange:y,onTriggerEnter:h.useCallback(()=>{g.isOpenDelayedRef.current?U():E()},[g.isOpenDelayedRef,U,E]),onTriggerLeave:h.useCallback(()=>{C?_():(window.clearTimeout(S.current),S.current=0)},[_,C]),onOpen:E,onClose:_,disableHoverableContent:C,children:l})})},"Tooltip"),Kb="TooltipTrigger",M_=h.forwardRef(hn(function(a,l){const{__scopeTooltip:o,...c}=a,u=td(Kb,o),f=qp(Kb,o),p=Hp(o),g=h.useRef(null),v=Fe(l,g,u.onTriggerChange),x=h.useRef(!1),y=h.useRef(!1),b=h.useCallback(()=>x.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",b),[b]),s.jsx(rp,{asChild:!0,...p,children:s.jsx(He.button,{"aria-describedby":u.open?u.contentId:void 0,"data-state":u.stateAttribute,...c,ref:v,onPointerMove:Se(a.onPointerMove,w=>{w.pointerType!=="touch"&&!y.current&&!f.isPointerInTransitRef.current&&(u.onTriggerEnter(),y.current=!0)}),onPointerLeave:Se(a.onPointerLeave,()=>{u.onTriggerLeave(),y.current=!1}),onPointerDown:Se(a.onPointerDown,()=>{u.open&&u.onClose(),x.current=!0,document.addEventListener("pointerup",b,{once:!0})}),onFocus:Se(a.onFocus,()=>{x.current||u.onOpen()}),onBlur:Se(a.onBlur,u.onClose),onClick:Se(a.onClick,u.onClose)})})},"TooltipTrigger")),D_="TooltipPortal",[w5,O_]=Bp(D_,{forceMount:void 0}),di="TooltipContent",k_=h.forwardRef(hn(function(a,l){const o=O_(di,a.__scopeTooltip),{forceMount:c=o.forceMount,side:u="top",...f}=a,p=td(di,a.__scopeTooltip);return s.jsx(Er,{present:c||p.open,children:p.disableHoverableContent?s.jsx(Hj,{side:u,...f,ref:l}):s.jsx(__,{side:u,...f,ref:l})})},"TooltipContent")),__=h.forwardRef(hn(function(a,l){const o=td(di,a.__scopeTooltip),c=qp(di,a.__scopeTooltip),u=h.useRef(null),f=Fe(l,u),[p,g]=h.useState(null),{trigger:v,onClose:x}=o,y=u.current,{onPointerInTransitChange:b}=c,w=h.useCallback(()=>{g(null),b(!1)},[b]),N=h.useCallback((S,C)=>{const R=S.currentTarget,D={x:S.clientX,y:S.clientY},A=qj(D,R.getBoundingClientRect()),M=$j(D,A),O=Vj(C.getBoundingClientRect()),E=Gj([...M,...O]);g(E),b(!0)},[b]);return h.useEffect(()=>()=>w(),[w]),h.useEffect(()=>{if(v&&y){const S=hn(R=>N(R,y),"handleTriggerLeave"),C=hn(R=>N(R,v),"handleContentLeave");return v.addEventListener("pointerleave",S),y.addEventListener("pointerleave",C),()=>{v.removeEventListener("pointerleave",S),y.removeEventListener("pointerleave",C)}}},[v,y,N,w]),h.useEffect(()=>{if(p){const S=hn(C=>{const R=C.target,D={x:C.clientX,y:C.clientY},A=(v==null?void 0:v.contains(R))||(y==null?void 0:y.contains(R)),M=!Yj(D,p);A?w():M&&(w(),x())},"handleTrackPointerGrace");return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[v,y,p,x,w]),s.jsx(Hj,{...a,ref:f})},"TooltipContentHoverable")),z_=X0("TooltipContent"),Hj=h.forwardRef(hn(function(a,l){const{__scopeTooltip:o,children:c,"aria-label":u,id:f,onEscapeKeyDown:p,onPointerDownOutside:g,...v}=a,x=td(di,o),y=Hp(o),{onClose:b}=x;h.useEffect(()=>(document.addEventListener(vm,b),()=>document.removeEventListener(vm,b)),[b]),h.useEffect(()=>{if(x.trigger){const N=hn(S=>{S.target instanceof Node&&S.target.contains(x.trigger)&&b()},"handleScroll");return window.addEventListener("scroll",N,{capture:!0}),()=>window.removeEventListener("scroll",N,{capture:!0})}},[x.trigger,b]);const{setContentId:w}=x;return Jt(()=>(w(f),()=>{w(void 0)}),[f,w]),s.jsx(Ou,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:p,onPointerDownOutside:g,onFocusOutside:N=>N.preventDefault(),onDismiss:b,children:s.jsxs(sp,{"data-state":x.stateAttribute,role:u?void 0:"tooltip",id:u?void 0:x.contentId,...y,...v,ref:l,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(z_,{children:c}),u?s.jsx(GO,{id:x.contentId,role:"tooltip",children:u}):null]})})},"TooltipContentImpl"));function qj(n,a){const l=Math.abs(a.top-n.y),o=Math.abs(a.bottom-n.y),c=Math.abs(a.right-n.x),u=Math.abs(a.left-n.x);switch(Math.min(l,o,c,u)){case u:return"left";case c:return"right";case l:return"top";case o:return"bottom";default:throw new Error("unreachable")}}hn(qj,"getExitSideFromRect");function $j(n,a,l=5){const o=[];switch(a){case"top":o.push({x:n.x-l,y:n.y+l},{x:n.x+l,y:n.y+l});break;case"bottom":o.push({x:n.x-l,y:n.y-l},{x:n.x+l,y:n.y-l});break;case"left":o.push({x:n.x+l,y:n.y-l},{x:n.x+l,y:n.y+l});break;case"right":o.push({x:n.x-l,y:n.y-l},{x:n.x-l,y:n.y+l});break}return o}hn($j,"getPaddedExitPoints");function Vj(n){const{top:a,right:l,bottom:o,left:c}=n;return[{x:c,y:a},{x:l,y:a},{x:l,y:o},{x:c,y:o}]}hn(Vj,"getPointsFromRect");function Yj(n,a){const{x:l,y:o}=n;let c=!1;for(let u=0,f=a.length-1;u<a.length;f=u++){const p=a[u],g=a[f],v=p.x,x=p.y,y=g.x,b=g.y;x>o!=b>o&&l<(y-v)*(o-x)/(b-x)+v&&(c=!c)}return c}hn(Yj,"isPointInPolygon");function Gj(n){const a=n.slice();return a.sort((l,o)=>l.x<o.x?-1:l.x>o.x?1:l.y<o.y?-1:l.y>o.y?1:0),Fj(a)}hn(Gj,"getHull");function Fj(n){if(n.length<=1)return n.slice();const a=[];for(let o=0;o<n.length;o++){const c=n[o];for(;a.length>=2;){const u=a[a.length-1],f=a[a.length-2];if((u.x-f.x)*(c.y-f.y)>=(u.y-f.y)*(c.x-f.x))a.pop();else break}a.push(c)}a.pop();const l=[];for(let o=n.length-1;o>=0;o--){const c=n[o];for(;l.length>=2;){const u=l[l.length-1],f=l[l.length-2];if((u.x-f.x)*(c.y-f.y)>=(u.y-f.y)*(c.x-f.x))l.pop();else break}l.push(c)}return l.pop(),a.length===1&&l.length===1&&a[0].x===l[0].x&&a[0].y===l[0].y?a:a.concat(l)}hn(Fj,"getHullPresorted");var L_=R_,U_=A_,I_=M_,Xj=k_;const Kj=L_,_l=U_,zl=I_,ks=h.forwardRef(({className:n,sideOffset:a=4,...l},o)=>s.jsx(Xj,{ref:o,sideOffset:a,className:Re("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),...l}));ks.displayName=Xj.displayName;const fi=h.forwardRef(({className:n,...a},l)=>s.jsx("textarea",{ref:l,className:Re("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),...a}));fi.displayName="Textarea";function P_({providerId:n,open:a,onOpenChange:l,onImported:o}){const[c,u]=h.useState([]),[f,p]=h.useState(""),[g,v]=h.useState(null),[x,y]=h.useState([]),[b,w]=h.useState(!1),[N,S]=h.useState(""),C=E=>{const _=new FormData;return _.append("providerId",n),E&&_.append("selectedIndexes",JSON.stringify(E)),c.forEach(U=>_.append("file",U)),f.trim()&&_.append("text",f),_},R=async()=>{w(!0),S("");try{const E=await ge.upload("/api/admin/codex/accounts/preview",C());v(E),y(E.records.filter(_=>_.valid&&!_.duplicateOf).map(_=>_.index))}catch(E){S(E.message||"Unable to preview import")}finally{w(!1)}},D=async()=>{w(!0),S("");try{const E=await ge.upload("/api/admin/codex/accounts/import",C(x));l(!1),o(),u([]),p(""),v(null),y([]),de.success(`${E.added} added, ${E.updated} updated, ${E.failed} failed`)}catch(E){S(E.message||"Unable to import accounts")}finally{w(!1)}},A=(E,_)=>y(U=>_===!0?[...new Set([...U,E])]:U.filter($=>$!==E)),M=(g==null?void 0:g.records.filter(E=>E.valid&&!E.duplicateOf).map(E=>E.index))??[],O=M.length>0&&M.every(E=>x.includes(E));return s.jsx(ln,{open:a,onOpenChange:l,children:s.jsxs(Kt,{className:"max-w-3xl",children:[s.jsxs(Qt,{children:[s.jsx(Zt,{children:"Import Codex accounts"}),s.jsx(jr,{children:"Select JSON or JSONL files, or paste records. Secrets are submitted without being displayed in the preview."})]}),g?s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between rounded-md border p-3 text-sm",children:[s.jsxs("span",{children:[g.validCount," valid, ",g.invalidCount," invalid"]}),s.jsxs("label",{className:"flex items-center gap-2",children:[s.jsx(Cr,{checked:O,onCheckedChange:E=>y(E===!0?M:[]),"aria-label":"Select all valid accounts"})," Select all valid"]})]}),s.jsx("div",{className:"max-h-80 overflow-auto rounded-md border",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b text-left",children:[s.jsx("th",{className:"p-2",children:"Select"}),s.jsx("th",{className:"p-2",children:"Account"}),s.jsx("th",{className:"p-2",children:"Plan"}),s.jsx("th",{className:"p-2",children:"Expiry"}),s.jsx("th",{className:"p-2",children:"Result"})]})}),s.jsx("tbody",{children:g.records.map(E=>s.jsxs("tr",{className:"border-b last:border-0",children:[s.jsx("td",{className:"p-2",children:s.jsx(Cr,{checked:x.includes(E.index),disabled:!E.valid||!!E.duplicateOf,onCheckedChange:_=>A(E.index,_),"aria-label":`Select record ${E.index+1}`})}),s.jsxs("td",{className:"p-2",children:[s.jsx("div",{children:E.email||"Unknown email"}),s.jsxs("div",{className:"text-xs text-muted-foreground",children:[E.accountIdMasked||"No account ID",E.workspaceIdMasked?` · ${E.workspaceIdMasked}`:""]})]}),s.jsx("td",{className:"p-2",children:E.planType||"—"}),s.jsx("td",{className:"p-2",children:E.expiresAt?new Date(E.expiresAt).toLocaleDateString():"—"}),s.jsx("td",{className:"p-2",children:E.valid?E.duplicateOf?s.jsx("span",{className:"text-amber-600",children:"Duplicate"}):s.jsx("span",{className:"text-emerald-600",children:"Ready"}):s.jsx("span",{className:"text-destructive",children:E.error||"Invalid record"})})]},`${E.index}-${E.source??""}`))})]})}),N&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:N}),s.jsxs(Vt,{children:[s.jsx(ie,{variant:"outline",onClick:()=>v(null),children:"Back"}),s.jsx(ie,{disabled:b||x.length===0,onClick:()=>void D(),children:b?"Importing…":`Import ${x.length} account${x.length===1?"":"s"}`})]})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(be,{htmlFor:"codex-files",children:"JSON / JSONL files"}),s.jsx(Ce,{id:"codex-files",type:"file",accept:".json,.jsonl,application/json",multiple:!0,onChange:E=>u(Array.from(E.target.files??[]))})]}),s.jsxs("div",{children:[s.jsx(be,{htmlFor:"codex-paste",children:"Paste JSON / JSONL (optional)"}),s.jsx(fi,{id:"codex-paste",value:f,onChange:E=>p(E.target.value),placeholder:"Paste Codex export records here",className:"min-h-32 font-mono text-xs"})]}),N&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:N}),s.jsxs(Vt,{children:[s.jsx(ie,{variant:"outline",onClick:()=>l(!1),children:"Cancel"}),s.jsx(ie,{disabled:b||c.length===0&&!f.trim(),onClick:()=>void R(),children:b?"Reading…":"Preview import"})]})]})]})})}const B_="http://localhost:1455/auth/callback",H_="1455",q_="http://localhost:8791/oauth/codex/callback";function $_({providerId:n,providerName:a,open:l,onOpenChange:o,onConnected:c}){const[u,f]=h.useState(""),[p,g]=h.useState(""),[v,x]=h.useState(""),[y,b]=h.useState(!0),[w,N]=h.useState(!1),[S,C]=h.useState(""),[R,D]=h.useState(!1),[A,M]=h.useState(!1),O=h.useCallback(async()=>{b(!0),C(""),x("");try{const U=await ge.post("/api/admin/codex/oauth/start",{providerId:n});f(U.state),g(U.authorizeUrl)}catch(U){C(U.message||"Unable to start the Codex authorization flow")}finally{b(!1)}},[n]);h.useEffect(()=>{O()},[O]),h.useEffect(()=>{if(!u)return;const U=setInterval(()=>{ge.get(`/api/admin/codex/oauth/${u}`).then($=>M(!($!=null&&$.callbackReceived))).catch(()=>M(!0))},5e3);return()=>clearInterval(U)},[u]);const E=async()=>{N(!0),C("");try{const U=await ge.post("/api/admin/codex/oauth/complete",{providerId:n,state:u,callbackUrl:v});de.success(`Codex account ${U.status==="added"?"connected":"updated"}`),o(!1),c()}catch(U){C(U.message||"Unable to complete the Codex authorization")}finally{N(!1)}},_=async()=>{try{await navigator.clipboard.writeText(p),D(!0),setTimeout(()=>D(!1),2e3)}catch{C("Clipboard is unavailable — select the URL and copy it manually.")}};return s.jsx(ln,{open:l,onOpenChange:o,children:s.jsxs(Kt,{className:"max-w-2xl",children:[s.jsxs(Qt,{children:[s.jsx(Zt,{children:"Connect OpenAI Codex"}),s.jsxs(jr,{children:["Authorize a ChatGPT account for ",a,". The callback is captured on localhost:",H_," — nothing is sent anywhere else."]})]}),y?s.jsxs("p",{className:"flex items-center gap-2 py-6 text-sm text-muted-foreground",children:[s.jsx(pr,{className:"h-4 w-4 animate-spin"})," Starting authorization…"]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(pr,{className:"h-3.5 w-3.5 animate-spin"})," Waiting for popup authorization…"]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["The browser will try to hand the callback to ",s.jsx("code",{className:"font-mono",children:q_}),". Most browsers block that from a public origin — if the page fails to load, copy the address bar and paste it in step 2."]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(be,{children:"Step 1: Open this URL in your browser"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Ce,{readOnly:!0,className:"font-mono text-xs",value:p,onFocus:U=>U.currentTarget.select()}),s.jsx(ie,{type:"button",variant:"outline","aria-label":"Copy authorization URL",onClick:()=>void _(),children:R?s.jsx(Um,{className:"h-4 w-4"}):s.jsx(nu,{className:"h-4 w-4"})}),s.jsx(ie,{type:"button",variant:"outline","aria-label":"Open authorization URL",asChild:!0,children:s.jsx("a",{href:p,target:"_blank",rel:"noreferrer",children:s.jsx(wE,{className:"h-4 w-4"})})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(be,{htmlFor:"codex-callback",children:"Step 2: Paste the callback URL here"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"After authorization, copy the full URL from your browser — or just the authorization code."}),s.jsx(Ce,{id:"codex-callback",value:v,onChange:U=>x(U.target.value),placeholder:`${B_}?code=…`}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Or paste callback URL manually"})]}),S&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:S})]}),s.jsxs(Vt,{children:[s.jsx(ie,{variant:"outline",onClick:()=>o(!1),children:"Cancel"}),s.jsx(ie,{disabled:w||y||A&&!v.trim(),onClick:()=>void E(),children:w?s.jsxs(s.Fragment,{children:[s.jsx(pr,{className:"mr-1 h-4 w-4 animate-spin"})," Connecting…"]}):"Connect"})]})]})})}const V_=["10","25","50"];function Y_(n,a){if(!n)return"—";const l=Date.parse(n)-a;if(!Number.isFinite(l))return"—";if(l<=0)return"reset ready";const o=Math.floor(l/6e4);if(o<60)return`${o}m`;const c=Math.floor(o/60),u=o%60;return c<24?`${c}h ${u}m`:`${Math.floor(c/24)}d ${c%24}h`}function Qb(n,a,l){if(!n)return s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"});const o=n.remaining<=0;return s.jsxs("div",{className:"min-w-[9rem] space-y-1",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs",children:[s.jsxs("span",{className:o?"font-medium text-destructive":"text-muted-foreground",children:[l," ",Math.round(n.remaining),"% left"]}),s.jsx("span",{className:"tabular-nums text-muted-foreground",children:Y_(n.resetAt,a)})]}),s.jsx(j_,{value:n.used,indicatorClassName:o?"bg-destructive":n.remaining<30?"bg-amber-500":"bg-emerald-500"})]})}function G_({providerId:n,providerName:a}){const[l,o]=h.useState([]),[c,u]=h.useState(null),[f,p]=h.useState(!0),[g,v]=h.useState(!1),[x,y]=h.useState(!1),[b,w]=h.useState(1),[N,S]=h.useState("10"),[C,R]=h.useState(""),[D,A]=h.useState(()=>Date.now());h.useEffect(()=>{const k=setInterval(()=>A(Date.now()),3e4);return()=>clearInterval(k)},[]);const M=h.useCallback(async()=>{try{const k=await ge.get(`/api/admin/codex/accounts?providerId=${encodeURIComponent(n)}`);o(k.accounts)}catch(k){de.error(k.message||"Unable to load Codex accounts")}finally{p(!1)}},[n]);h.useEffect(()=>{M()},[M]);const O=async(k,q,Z)=>{u(k.id);try{await Z(),de.success(`${q}: ${k.email||k.accountIdMasked||k.id}`)}catch(J){de.error(J.message||`${q} failed`)}finally{u(null)}},E=(k,q)=>o(Z=>Z.map(J=>J.id===k?q:J)),_=(k,q)=>O(l.find(Z=>Z.id===k),"Updated",async()=>{E(k,(await ge.patch(`/api/admin/codex/accounts/${k}`,q)).account)}),U=l.filter(k=>{if(!C)return!0;const q=C.toLowerCase();return[k.email,k.accountIdMasked,k.workspaceIdMasked,k.planType].some(Z=>Z==null?void 0:Z.toLowerCase().includes(q))}),$=Number(N),te=Math.max(1,Math.ceil(U.length/$)),V=Math.min(b,te),H=U.slice((V-1)*$,V*$),ae=async()=>{u("all");try{await Promise.allSettled(l.map(k=>ge.post(`/api/admin/codex/accounts/${k.id}/usage`))),await M(),de.success("Usage refreshed for all accounts")}finally{u(null)}},ee=cj(bu(Zu,{activationConstraint:{distance:4}}),bu(Qu,{coordinateGetter:Lj})),B=async k=>{const{active:q,over:Z}=k;if(!Z||q.id===Z.id)return;const J=l.findIndex(F=>F.id===q.id),ne=l.findIndex(F=>F.id===Z.id);if(J<0||ne<0)return;const z=l,L=ed(l,J,ne);o(L);try{await ge.post("/api/admin/codex/accounts/reorder",{providerId:n,ids:L.map(F=>F.id)}),de.success("Routing order updated")}catch(F){o(z),de.error(F.message||"Unable to save the routing order")}};return s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-medium",children:"Codex accounts"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[l.length," account",l.length===1?"":"s"," · drag a row to set routing order · quotas come from the ChatGPT usage API"]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(Ce,{className:"h-8 w-40",placeholder:"Filter accounts…",value:C,onChange:k=>{R(k.target.value),w(1)}}),s.jsxs(ie,{size:"sm",variant:"outline",disabled:c!==null||l.length===0,onClick:()=>void ae(),children:[s.jsx(Bm,{className:"mr-1 h-3 w-3"})," Refresh all"]}),s.jsxs(ie,{size:"sm",variant:"outline",onClick:()=>y(!0),children:[s.jsx(NE,{className:"mr-1 h-4 w-4"})," Connect Codex"]}),s.jsxs(ie,{size:"sm",onClick:()=>v(!0),children:[s.jsx(I0,{className:"mr-1 h-4 w-4"})," Import accounts"]})]})]}),f?s.jsx("p",{className:"py-3 text-sm text-muted-foreground",children:"Loading Codex accounts…"}):l.length===0?s.jsx("p",{className:"py-3 text-sm text-muted-foreground",children:"No Codex accounts yet. Use Connect Codex to authorize one, or import existing account JSON."}):U.length===0?s.jsxs("p",{className:"py-3 text-sm text-muted-foreground",children:["No account matches “",C,"”."]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"overflow-x-auto rounded-md border",children:s.jsx(Kj,{delayDuration:200,children:s.jsx(Ej,{sensors:ee,collisionDetection:hj,onDragEnd:k=>void B(k),modifiers:[Tj,Rj],children:s.jsxs(Un,{children:[s.jsx(In,{children:s.jsxs(Be,{children:[s.jsx(ve,{className:"w-8"}),s.jsx(ve,{className:"text-xs",children:"Account"}),s.jsx(ve,{className:"text-xs",children:"Plan"}),s.jsx(ve,{className:"text-xs",children:"5h window"}),s.jsx(ve,{className:"text-xs",children:"Weekly"}),s.jsx(ve,{className:"text-xs",children:"Reset credits"}),s.jsx(ve,{className:"text-xs",children:"Auto-start 5h"}),s.jsx(ve,{className:"text-xs",children:"Token expiry"}),s.jsx(ve,{className:"text-xs",children:"Health"}),s.jsx(ve,{className:"text-right text-xs",children:"Actions"})]})}),s.jsx(kj,{items:H.map(k=>k.id),strategy:Mj,children:s.jsx(Pn,{children:H.map(k=>s.jsx(F_,{account:k,now:D,busy:c===k.id,onPatch:q=>void _(k.id,q),onUsage:q=>E(k.id,q),onDelete:()=>void O(k,"Deleted",()=>ge.del(`/api/admin/codex/accounts/${k.id}`)).then(()=>M())},k.id))})})]})})})}),s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 text-xs text-muted-foreground",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{children:"Rows per page"}),s.jsxs(zn,{value:N,onValueChange:k=>{S(k),w(1)},children:[s.jsx(jn,{className:"h-7 w-16",children:s.jsx(Ln,{})}),s.jsx(Sn,{children:V_.map(k=>s.jsx(nt,{value:k,children:k},k))})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{children:["Page ",V," of ",te]}),s.jsx(ie,{size:"sm",variant:"outline","aria-label":"Previous page",disabled:V<=1,onClick:()=>w(V-1),children:s.jsx(O0,{className:"h-3 w-3"})}),s.jsx(ie,{size:"sm",variant:"outline","aria-label":"Next page",disabled:V>=te,onClick:()=>w(V+1),children:s.jsx(Im,{className:"h-3 w-3"})})]})]})]}),g&&s.jsx(P_,{providerId:n,open:!0,onOpenChange:k=>{k||v(!1)},onImported:()=>void M()}),x&&s.jsx($_,{providerId:n,providerName:a||"this Codex provider",open:!0,onOpenChange:k=>{k||y(!1)},onConnected:()=>void M()})]})}function F_({account:n,now:a,busy:l,onPatch:o,onUsage:c,onDelete:u}){var A,M,O,E,_,U;const{attributes:f,listeners:p,setNodeRef:g,transform:v,transition:x,isDragging:y}=zj({id:n.id,disabled:l}),b=(M=(A=n.usage)==null?void 0:A.quotas)==null?void 0:M.session,w=(E=(O=n.usage)==null?void 0:O.quotas)==null?void 0:E.blocking,N=((_=n.usage)==null?void 0:_.resetCredits)??0,S=n.email||n.accountIdMasked||n.id,C=()=>void(async()=>{try{c((await ge.post(`/api/admin/codex/accounts/${n.id}/usage`)).account),de.success(`Usage refreshed: ${S}`)}catch($){de.error($.message||"Usage refresh failed")}})(),R=()=>{window.confirm(`Spend 1 weekly reset credit to restart the 5h window for ${S}?`)&&(async()=>{try{c((await ge.post(`/api/admin/codex/accounts/${n.id}/reset-quota`)).account),de.success(`Quota reset: ${S}`)}catch($){de.error($.message||"Quota reset failed")}})()},D=()=>void X_(`Test passed: ${S}`,()=>ge.post(`/api/admin/codex/accounts/${n.id}/test`));return s.jsxs(Be,{ref:g,style:{transform:v?`translate3d(${v.x}px, ${v.y}px, 0)`:void 0,transition:x},className:Re(n.enabled?void 0:"opacity-60",y&&"relative z-10 bg-muted/60 shadow-sm"),children:[s.jsx(fe,{className:"w-8 pr-0",children:s.jsx("button",{type:"button",...f,...p,"aria-label":`Reorder ${S}`,title:"Drag to change routing order",disabled:l,className:"cursor-grab touch-none rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-40 active:cursor-grabbing",children:s.jsx(_0,{className:"h-4 w-4"})})}),s.jsxs(fe,{children:[s.jsx("div",{className:"text-sm",children:n.email||"Unknown email"}),s.jsxs("div",{className:"text-xs text-muted-foreground",children:[n.accountIdMasked||"—",n.workspaceIdMasked?` · ${n.workspaceIdMasked}`:"",n.usageError?` · usage: ${n.usageError}`:""]})]}),s.jsx(fe,{className:"text-sm",children:((U=n.usage)==null?void 0:U.plan)||n.planType||"—"}),s.jsx(fe,{children:Qb(b,a,"5h")}),s.jsx(fe,{children:Qb(w,a,"Week")}),s.jsx(fe,{children:s.jsx("span",{className:`text-sm tabular-nums ${N>0?"font-medium":"text-muted-foreground"}`,children:N})}),s.jsx(fe,{children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(K_,{checked:n.autostart,disabled:l,onCheckedChange:$=>o({autostart:$}),label:`Auto-start 5h window for ${S}`}),s.jsxs(_l,{children:[s.jsx(zl,{asChild:!0,children:s.jsx("span",{className:"text-xs text-muted-foreground",children:n.lastPingAt?`pinged ${new Date(n.lastPingAt).toLocaleTimeString()}`:"never pinged"})}),s.jsx(ks,{className:"max-w-64",children:"Sends a tiny gpt-5.5 request right after the 5h window resets so the next window starts immediately. Consumes a small amount of quota."})]})]})}),s.jsx(fe,{className:"text-xs",children:new Date(n.tokenExpiresAt).toLocaleString()}),s.jsx(fe,{children:s.jsx(We,{variant:n.healthState==="healthy"?"success":n.healthState==="down"?"destructive":"secondary",children:n.healthState})}),s.jsx(fe,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end gap-1",children:[s.jsxs(_l,{children:[s.jsx(zl,{asChild:!0,children:s.jsx(ie,{size:"sm",variant:"outline","aria-label":`Refresh usage for ${S}`,disabled:l,onClick:C,children:s.jsx(Bm,{className:"h-3 w-3"})})}),s.jsx(ks,{children:"Refresh usage"})]}),s.jsxs(_l,{children:[s.jsx(zl,{asChild:!0,children:s.jsx(ie,{size:"sm",variant:"outline","aria-label":`Reset quota for ${S}`,disabled:l||N===0,onClick:R,children:s.jsx(DE,{className:"h-3 w-3"})})}),s.jsx(ks,{children:N===0?"No weekly reset credits available":"Reset quota (uses 1 credit)"})]}),s.jsxs(_l,{children:[s.jsx(zl,{asChild:!0,children:s.jsx(ie,{size:"sm",variant:"outline","aria-label":`Test Codex account ${S}`,disabled:l,onClick:D,children:s.jsx(_E,{className:"h-3 w-3"})})}),s.jsx(ks,{children:"Test connection"})]}),s.jsxs(_l,{children:[s.jsx(zl,{asChild:!0,children:s.jsx(ie,{size:"sm",variant:"outline","aria-pressed":!n.enabled,disabled:l,onClick:()=>o({enabled:!n.enabled}),children:n.enabled?"Disable":"Enable"})}),s.jsx(ks,{children:n.enabled?"Exclude from routing (keeps the account)":"Include in routing"})]}),s.jsxs(_l,{children:[s.jsx(zl,{asChild:!0,children:s.jsx(ie,{size:"sm",variant:"destructive","aria-label":`Delete Codex account ${S}`,disabled:l,onClick:()=>{window.confirm(`Permanently delete ${S}?
|
|
386
|
-
|
|
387
|
-
Stored Codex credentials are erased. Past request logs are kept, but lose the account reference.`)&&u()},children:s.jsx(Kl,{className:"h-3 w-3"})})}),s.jsx(ks,{children:"Delete account (permanent)"})]})]})})]})}async function X_(n,a){try{await a(),de.success(n)}catch(l){de.error(l.message||"Action failed")}}function K_({checked:n,disabled:a,onCheckedChange:l,label:o}){return s.jsx(Cr,{role:"switch","aria-label":o,"aria-checked":n,checked:n,disabled:a,onCheckedChange:c=>l(c===!0)})}function Q_({providerId:n,open:a,onOpenChange:l,onImported:o}){const[c,u]=h.useState([]),[f,p]=h.useState(""),[g,v]=h.useState(null),[x,y]=h.useState([]),[b,w]=h.useState(!1),[N,S]=h.useState(""),C=E=>{const _=new FormData;return _.append("providerId",n),E&&_.append("selectedIndexes",JSON.stringify(E)),c.forEach(U=>_.append("file",U)),f.trim()&&_.append("text",f),_},R=async()=>{w(!0),S("");try{const E=await ge.upload("/api/admin/qoder/accounts/preview",C());v(E),y(E.records.filter(_=>_.valid&&!_.duplicateOf).map(_=>_.index))}catch(E){S(E.message||"Unable to preview import")}finally{w(!1)}},D=async()=>{w(!0),S("");try{const E=await ge.upload("/api/admin/qoder/accounts/import",C(x));l(!1),o(),u([]),p(""),v(null),y([]),de.success(`${E.added} added, ${E.updated} updated, ${E.failed} failed`)}catch(E){S(E.message||"Unable to import tokens")}finally{w(!1)}},A=(E,_)=>y(U=>_===!0?[...new Set([...U,E])]:U.filter($=>$!==E)),M=(g==null?void 0:g.records.filter(E=>E.valid&&!E.duplicateOf).map(E=>E.index))??[],O=M.length>0&&M.every(E=>x.includes(E));return s.jsx(ln,{open:a,onOpenChange:l,children:s.jsxs(Kt,{className:"max-w-3xl",children:[s.jsxs(Qt,{children:[s.jsx(Zt,{children:"Import Qoder personal access tokens"}),s.jsx(jr,{children:"One token per line, or a .txt/.json file. Tokens are submitted without being displayed back."})]}),g?s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between rounded-md border p-3 text-sm",children:[s.jsxs("span",{children:[g.validCount," valid, ",g.invalidCount," invalid"]}),s.jsxs("label",{className:"flex items-center gap-2",children:[s.jsx(Cr,{checked:O,onCheckedChange:E=>y(E===!0?M:[]),"aria-label":"Select all valid tokens"})," Select all valid"]})]}),s.jsx("div",{className:"max-h-80 overflow-auto rounded-md border",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b text-left",children:[s.jsx("th",{className:"p-2",children:"Select"}),s.jsx("th",{className:"p-2",children:"Token"}),s.jsx("th",{className:"p-2",children:"Label"}),s.jsx("th",{className:"p-2",children:"Result"})]})}),s.jsx("tbody",{children:g.records.map(E=>s.jsxs("tr",{className:"border-b last:border-0",children:[s.jsx("td",{className:"p-2",children:s.jsx(Cr,{checked:x.includes(E.index),disabled:!E.valid||!!E.duplicateOf,onCheckedChange:_=>A(E.index,_),"aria-label":`Select record ${E.index+1}`})}),s.jsx("td",{className:"p-2 font-mono text-xs",children:E.personalTokenMasked||"—"}),s.jsx("td",{className:"p-2",children:E.label||"—"}),s.jsx("td",{className:"p-2",children:E.valid?E.duplicateOf?s.jsx("span",{className:"text-amber-600",children:"Already added"}):s.jsx("span",{className:"text-emerald-600",children:"Ready"}):s.jsx("span",{className:"text-destructive",children:E.error||"Invalid token"})})]},`${E.index}-${E.source??""}`))})]})}),N&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:N}),s.jsxs(Vt,{children:[s.jsx(ie,{variant:"outline",onClick:()=>v(null),children:"Back"}),s.jsx(ie,{disabled:b||x.length===0,onClick:()=>void D(),children:b?"Importing…":`Import ${x.length} token${x.length===1?"":"s"}`})]})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(be,{htmlFor:"qoder-files",children:"Token files (.txt / .json)"}),s.jsx(Ce,{id:"qoder-files",type:"file",accept:".txt,.json,.jsonl,text/plain,application/json",multiple:!0,onChange:E=>u(Array.from(E.target.files??[]))})]}),s.jsxs("div",{children:[s.jsx(be,{htmlFor:"qoder-paste",children:"Paste tokens (optional)"}),s.jsx(fi,{id:"qoder-paste",value:f,onChange:E=>p(E.target.value),placeholder:"pt-…",className:"min-h-32 font-mono text-xs"})]}),N&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:N}),s.jsxs(Vt,{children:[s.jsx(ie,{variant:"outline",onClick:()=>l(!1),children:"Cancel"}),s.jsx(ie,{disabled:b||c.length===0&&!f.trim(),onClick:()=>void R(),children:b?"Reading…":"Preview import"})]})]})]})})}const Z_=["10","25","50"];function Zb(n,a){if(!n)return"—";const l=Date.parse(n)-a;if(!Number.isFinite(l))return"—";if(l<=0)return"expired";const o=Math.floor(l/6e4);if(o<60)return`${o}m`;const c=Math.floor(o/60);return c<24?`${c}h ${o%60}m`:`${Math.floor(c/24)}d ${c%24}h`}function J_(n){const a=n==="healthy"?"default":n==="degraded"?"secondary":n==="down"?"destructive":"outline";return s.jsx(We,{variant:a,children:n})}function W_({providerId:n,providerName:a}){const[l,o]=h.useState([]),[c,u]=h.useState(null),[f,p]=h.useState(!0),[g,v]=h.useState(!1),[x,y]=h.useState(!1),[b,w]=h.useState(""),[N,S]=h.useState(""),[C,R]=h.useState(!1),[D,A]=h.useState(""),[M,O]=h.useState(1),[E,_]=h.useState("10"),[U,$]=h.useState(""),[te,V]=h.useState(()=>Date.now());h.useEffect(()=>{const L=setInterval(()=>V(Date.now()),3e4);return()=>clearInterval(L)},[]);const H=h.useCallback(async()=>{try{const L=await ge.get(`/api/admin/qoder/accounts?providerId=${encodeURIComponent(n)}`);o(L.accounts)}catch(L){de.error(L.message||"Unable to load Qoder accounts")}finally{p(!1)}},[n]);h.useEffect(()=>{H()},[H]);const ae=async(L,F,se)=>{u(L.id);try{await se(),de.success(`${F}: ${L.label||L.qoderUserIdMasked||L.id}`)}catch(pe){de.error(pe.message||`${F} failed`)}finally{u(null)}},ee=async()=>{R(!0),A("");try{const L=await ge.post("/api/admin/qoder/accounts",{providerId:n,personalToken:b,label:N.trim()||void 0});de.success(L.catalogError?"Account added, but the model catalog could not be fetched":"Account added"),y(!1),w(""),S(""),await H()}catch(L){A(L.message||"Unable to add the token")}finally{R(!1)}},B=l.filter(L=>{if(!U)return!0;const F=U.toLowerCase();return[L.label,L.email,L.qoderUserIdMasked].some(se=>se==null?void 0:se.toLowerCase().includes(F))}),k=Number(E),q=Math.max(1,Math.ceil(B.length/k)),Z=Math.min(M,q),J=B.slice((Z-1)*k,Z*k),ne=cj(bu(Zu,{activationConstraint:{distance:4}}),bu(Qu,{coordinateGetter:Lj})),z=async L=>{const{active:F,over:se}=L;if(!se||F.id===se.id)return;const pe=l.findIndex(he=>he.id===F.id),ye=l.findIndex(he=>he.id===se.id);if(pe<0||ye<0)return;const G=l,ue=ed(l,pe,ye);o(ue);try{await ge.post("/api/admin/qoder/accounts/reorder",{providerId:n,ids:ue.map(he=>he.id)}),de.success("Routing order updated")}catch(he){o(G),de.error(he.message||"Unable to save the routing order")}};return s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-medium",children:"Qoder accounts"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[l.length," account",l.length===1?"":"s"," · drag a row to set routing order · each account is one personal access token"]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(Ce,{className:"h-8 w-40",placeholder:"Filter accounts…",value:U,onChange:L=>{$(L.target.value),O(1)}}),s.jsxs(ie,{size:"sm",variant:"outline",disabled:c!==null||l.length===0,onClick:()=>void(async()=>{u("all");try{await Promise.allSettled(l.map(L=>ge.post(`/api/admin/qoder/accounts/${L.id}/catalog`))),await H(),de.success("Model catalogs refreshed")}finally{u(null)}})(),children:[s.jsx(Bm,{className:"mr-1 h-3 w-3"})," Refresh catalogs"]}),s.jsxs(ie,{size:"sm",variant:"outline",onClick:()=>v(!0),children:[s.jsx(I0,{className:"mr-1 h-4 w-4"})," Import tokens"]}),s.jsxs(ie,{size:"sm",onClick:()=>y(!0),children:[s.jsx(Xl,{className:"mr-1 h-4 w-4"})," Add token"]})]})]}),f?s.jsx("p",{className:"py-3 text-sm text-muted-foreground",children:"Loading Qoder accounts…"}):l.length===0?s.jsx("p",{className:"py-3 text-sm text-muted-foreground",children:"No Qoder accounts yet. Add a personal access token or import a list."}):B.length===0?s.jsxs("p",{className:"py-3 text-sm text-muted-foreground",children:["No account matches “",U,"”."]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"overflow-x-auto rounded-md border",children:s.jsx(Ej,{sensors:ne,collisionDetection:hj,onDragEnd:L=>void z(L),modifiers:[Tj,Rj],children:s.jsxs(Un,{children:[s.jsx(In,{children:s.jsxs(Be,{children:[s.jsx(ve,{className:"w-8"}),s.jsx(ve,{className:"text-xs",children:"Account"}),s.jsx(ve,{className:"text-xs",children:"User"}),s.jsx(ve,{className:"text-xs",children:"Job token"}),s.jsx(ve,{className:"text-xs",children:"Catalog"}),s.jsx(ve,{className:"text-xs",children:"Health"}),s.jsx(ve,{className:"text-xs",children:"Enabled"}),s.jsx(ve,{className:"text-right text-xs",children:"Actions"})]})}),s.jsx(kj,{items:J.map(L=>L.id),strategy:Mj,children:s.jsx(Pn,{children:J.map(L=>s.jsx(e4,{account:L,now:te,busy:c===L.id,onToggle:F=>void ae(L,F?"Enabled":"Disabled",()=>ge.patch(`/api/admin/qoder/accounts/${L.id}`,{enabled:F})).then(()=>H()),onDelete:()=>void ae(L,"Deleted",()=>ge.del(`/api/admin/qoder/accounts/${L.id}`)).then(()=>H()),onChanged:()=>void H()},L.id))})})]})})}),s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 text-xs text-muted-foreground",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{children:"Rows per page"}),s.jsxs(zn,{value:E,onValueChange:L=>{_(L),O(1)},children:[s.jsx(jn,{className:"h-7 w-16",children:s.jsx(Ln,{})}),s.jsx(Sn,{children:Z_.map(L=>s.jsx(nt,{value:L,children:L},L))})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{children:["Page ",Z," of ",q]}),s.jsx(ie,{size:"sm",variant:"outline","aria-label":"Previous page",disabled:Z<=1,onClick:()=>O(Z-1),children:s.jsx(O0,{className:"h-3 w-3"})}),s.jsx(ie,{size:"sm",variant:"outline","aria-label":"Next page",disabled:Z>=q,onClick:()=>O(Z+1),children:s.jsx(Im,{className:"h-3 w-3"})})]})]})]}),s.jsx(ln,{open:x,onOpenChange:y,children:s.jsxs(Kt,{children:[s.jsxs(Qt,{children:[s.jsx(Zt,{children:"Add a Qoder token"}),s.jsxs(jr,{children:["Paste a personal access token for ",a||"this provider",". It is exchanged immediately and stored encrypted."]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(be,{htmlFor:"qoder-token",children:"Personal access token"}),s.jsx(Ce,{id:"qoder-token",type:"password",value:b,onChange:L=>w(L.target.value),placeholder:"pt-…",className:"font-mono"})]}),s.jsxs("div",{children:[s.jsx(be,{htmlFor:"qoder-label",children:"Label (optional)"}),s.jsx(Ce,{id:"qoder-label",value:N,onChange:L=>S(L.target.value),placeholder:"Work account"})]}),D&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:D})]}),s.jsxs(Vt,{children:[s.jsx(ie,{variant:"outline",onClick:()=>y(!1),children:"Cancel"}),s.jsx(ie,{disabled:C||!b.trim(),onClick:()=>void ee(),children:C?"Verifying…":"Add token"})]})]})}),g&&s.jsx(Q_,{providerId:n,open:!0,onOpenChange:L=>{L||v(!1)},onImported:()=>void H()})]})}function e4({account:n,now:a,busy:l,onToggle:o,onDelete:c,onChanged:u}){const{attributes:f,listeners:p,setNodeRef:g,transform:v,transition:x,isDragging:y}=zj({id:n.id,disabled:l}),b=n.label||n.email||n.qoderUserIdMasked||n.id;return s.jsxs(Be,{ref:g,style:{transform:v?`translate3d(${v.x}px, ${v.y}px, 0)`:void 0,transition:x},className:Re(n.enabled?void 0:"opacity-60",y&&"relative z-10 bg-muted/60 shadow-sm"),children:[s.jsx(fe,{className:"w-8 pr-0",children:s.jsx("button",{className:"cursor-grab text-muted-foreground disabled:cursor-not-allowed","aria-label":`Reorder ${b}`,disabled:l,...f,...p,children:s.jsx(_0,{className:"h-4 w-4"})})}),s.jsxs(fe,{children:[s.jsx("div",{className:"text-sm",children:b}),n.email&&n.label&&s.jsx("div",{className:"text-xs text-muted-foreground",children:n.email}),n.lastError&&s.jsx("div",{className:"text-xs text-destructive",children:n.lastError})]}),s.jsx(fe,{className:"font-mono text-xs",children:n.qoderUserIdMasked||"—"}),s.jsx(fe,{className:"text-xs tabular-nums",children:Zb(n.jobTokenExpiresAt,a)}),s.jsx(fe,{className:"text-xs tabular-nums",children:n.catalogFetchedAt?`${Zb(n.catalogFetchedAt,a)} ago`:"never"}),s.jsx(fe,{children:J_(n.healthState)}),s.jsx(fe,{children:s.jsx(ie,{size:"sm",variant:n.enabled?"secondary":"outline",disabled:l,onClick:()=>o(!n.enabled),children:n.enabled?"Enabled":"Disabled"})}),s.jsx(fe,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end gap-1",children:[s.jsx(ie,{size:"sm",variant:"outline",disabled:l,onClick:()=>void(async()=>{try{const w=await ge.post(`/api/admin/qoder/accounts/${n.id}/test`);de[w.ok?"success":"error"](`${b}: ${w.detail}${w.modelCount===null?"":` (${w.modelCount} models)`}`),u()}catch(w){de.error(w.message||"Test failed")}})(),children:"Test"}),s.jsx(ie,{size:"sm",variant:"outline",disabled:l,onClick:()=>void(async()=>{try{const w=await ge.post(`/api/admin/qoder/accounts/${n.id}/catalog`);de.success(`${b}: ${w.modelCount} models`),u()}catch(w){de.error(w.message||"Catalog refresh failed")}})(),children:"Catalog"}),s.jsx(ie,{size:"sm",variant:"ghost","aria-label":`Delete ${b}`,disabled:l,onClick:()=>{window.confirm(`Delete the Qoder account ${b}? The stored token is removed permanently.`)&&c()},children:s.jsx(Kl,{className:"h-3 w-3"})})]})})]})}function t4({providerId:n,providerName:a,open:l,onOpenChange:o,onImported:c}){const[u,f]=h.useState([]),[p,g]=h.useState(new Set),[v,x]=h.useState(""),[y,b]=h.useState(!0),[w,N]=h.useState(!1),[S,C]=h.useState(""),R=h.useCallback(async()=>{b(!0),C("");try{const M=await ge.post(`/api/admin/providers/${n}/discover`);f(M.models),g(new Set(M.models.filter(O=>!O.alreadyImported).map(O=>O.upstreamId)))}catch(M){C(M.message||"Unable to fetch Codex models")}finally{b(!1)}},[n]);h.useEffect(()=>{R()},[R]);const D=u.filter(M=>!v||M.upstreamId.toLowerCase().includes(v.toLowerCase())||M.displayName.toLowerCase().includes(v.toLowerCase())),A=async()=>{N(!0),C("");try{const M=await ge.post("/api/admin/models/import",{providerId:n,modelIds:Array.from(p)});de.success(`Imported ${M.imported} of ${M.requested} Codex models`),o(!1),c()}catch(M){C(M.message||"Unable to import models")}finally{N(!1)}};return s.jsx(ln,{open:l,onOpenChange:o,children:s.jsxs(Kt,{className:"max-w-2xl",children:[s.jsxs(Qt,{children:[s.jsxs(Zt,{children:["Import models from ",a]}),s.jsx(jr,{children:"Models are read from the Codex account pool. Nothing is added until you confirm."})]}),y?s.jsxs("p",{className:"flex items-center gap-2 py-6 text-sm text-muted-foreground",children:[s.jsx(pr,{className:"h-4 w-4 animate-spin"})," Fetching models…"]}):s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(Hm,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),s.jsx(Ce,{className:"pl-8",placeholder:"Search models…",value:v,onChange:M=>x(M.target.value)})]}),s.jsxs("span",{className:"shrink-0 text-sm text-muted-foreground",children:[D.length," / ",u.length," · ",p.size," selected"]}),s.jsx(ie,{variant:"outline",size:"sm",onClick:()=>g(new Set(D.filter(M=>!M.alreadyImported).map(M=>M.upstreamId))),children:"Select All (new)"})]}),s.jsx("div",{className:"max-h-80 overflow-auto rounded-md border",children:D.length===0?s.jsx("p",{className:"p-4 text-sm text-muted-foreground",children:u.length===0?"The Codex account returned no models.":"No model matches your search."}):D.map(M=>s.jsxs("label",{className:"flex cursor-pointer items-center gap-3 border-b px-3 py-2 last:border-0 hover:bg-accent",children:[s.jsx(Cr,{checked:p.has(M.upstreamId),disabled:M.alreadyImported,onCheckedChange:O=>g(E=>{const _=new Set(E);return O===!0?_.add(M.upstreamId):_.delete(M.upstreamId),_})}),s.jsx("span",{className:"flex-1 text-sm",children:M.displayName}),s.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:M.upstreamId}),M.alreadyImported&&s.jsx(We,{variant:"secondary",children:"imported"})]},M.upstreamId))}),S&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:S})]}),s.jsxs(Vt,{children:[s.jsx(ie,{variant:"outline",onClick:()=>void R(),disabled:y,children:"Refetch"}),s.jsxs(ie,{disabled:w||p.size===0,onClick:()=>void A(),children:["Import ",p.size||""]})]})]})})}const Os={name:"",slug:"",type:"openai",baseUrl:"https://api.openai.com",apiKey:"",customHeaders:"",enabled:!0},n4={openai:"https://api.openai.com",anthropic:"https://api.anthropic.com"},a4=[{type:"codex",label:"Add Codex",hint:"Codex always talks to https://chatgpt.com — the OAuth backend does not exist on api.openai.com."},{type:"qoder",label:"Add Qoder",hint:"Qoder accounts authenticate with a PAT (pt-…) that you add after the provider exists."}];function r4(){const[n,a]=h.useState([]),[l,o]=h.useState(!1),[c,u]=h.useState(Os),[f,p]=h.useState(!1),[g,v]=h.useState(null),[x,y]=h.useState(null),[b,w]=h.useState(Os),[N,S]=h.useState(null),[C,R]=h.useState(!1),[D,A]=h.useState(null),[M,O]=h.useState({}),[E,_]=h.useState(null),U=async()=>{try{const B=await ge.get("/api/admin/providers");a(B.providers)}catch(B){de.error(B.message||"Unable to load providers")}};h.useEffect(()=>{U()},[]);const $=async()=>{p(!0);try{let B;if(c.customHeaders.trim())try{B=JSON.parse(c.customHeaders)}catch{throw new Error("Custom headers must be valid JSON object")}await ge.post("/api/admin/providers",{name:c.name,slug:c.slug||void 0,type:c.type,baseUrl:c.baseUrl,apiKey:c.apiKey,customHeaders:B,enabled:c.enabled}),de.success("Provider created"),o(!1),u(Os),U()}catch(B){de.error(B.message)}finally{p(!1)}},te=async B=>{_(B);try{await ge.post("/api/admin/providers",{type:B}),de.success(`${B==="codex"?"Codex":"Qoder"} provider created — add accounts next`);const k=await ge.get("/api/admin/providers");a(k.providers);const q=k.providers.find(Z=>Z.type===B);q&&O(Z=>({...Z,[q.id]:!0}))}catch(k){de.error(k.message)}finally{_(null)}},V=async B=>{v(B);try{const k=await ge.post(`/api/admin/providers/${B}/test`);de.success(k.ok?`Connection OK: ${k.detail}`:`Failed: ${k.detail}`),U()}catch(k){de.error(k.message)}finally{v(null)}},H=B=>{y(B.id),w({...Os,name:B.name,slug:B.slug||"",type:B.type,baseUrl:B.baseUrl,apiKey:"",customHeaders:"",enabled:B.enabled})},ae=async()=>{if(x){p(!0);try{let B;if(b.customHeaders.trim())try{B=JSON.parse(b.customHeaders)}catch{throw new Error("Custom headers must be valid JSON object")}await ge.patch("/api/admin/providers",{id:x,name:b.name,slug:b.slug||void 0,type:b.type,baseUrl:b.baseUrl,apiKey:b.apiKey||void 0,customHeaders:B,enabled:b.enabled}),de.success("Provider updated"),y(null),w(Os),U()}catch(B){de.error(B.message)}finally{p(!1)}}},ee=async B=>{R(!0);try{await ge.del(`/api/admin/providers/${B}`),de.success("Provider removed"),U()}catch(k){de.error(k.message)}finally{R(!1),S(null)}};return s.jsxs("div",{children:[s.jsx(Va,{title:"Providers",description:"Upstream LLM providers and their credentials",actions:s.jsxs("div",{className:"flex gap-2",children:[a4.map(B=>{const k=n.find(q=>q.type===B.type);return s.jsxs(ie,{variant:"outline",disabled:!!k||E===B.type,title:k?`${k.name} already exists`:B.hint,onClick:()=>void te(B.type),children:[s.jsx(Xl,{className:"mr-1 h-4 w-4"}),k?`${B.label} (added)`:B.label]},B.type)}),s.jsxs(ln,{open:l,onOpenChange:o,children:[s.jsx(wi,{asChild:!0,children:s.jsx(ie,{children:"Add compatible provider"})}),s.jsxs(Kt,{children:[s.jsxs(Qt,{children:[s.jsx(Zt,{children:"New provider"}),s.jsx(jr,{children:"API-key or compatible endpoint."})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(be,{htmlFor:"provider-name",children:"Name"}),s.jsx(Ce,{id:"provider-name",value:c.name,onChange:B=>u({...c,name:B.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{htmlFor:"provider-slug",children:"Slug (optional)"}),s.jsx(Ce,{id:"provider-slug",value:c.slug,onChange:B=>u({...c,slug:B.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Type"}),s.jsxs(zn,{value:c.type,onValueChange:B=>u(k=>({...k,type:B,baseUrl:n4[B]})),children:[s.jsx(jn,{children:s.jsx(Ln,{})}),s.jsxs(Sn,{children:[s.jsx(nt,{value:"openai",children:"OpenAI-compatible"}),s.jsx(nt,{value:"anthropic",children:"Anthropic-compatible"})]})]})]}),s.jsxs("div",{children:[s.jsx(be,{htmlFor:"provider-base-url",children:"Base URL"}),s.jsx(Ce,{id:"provider-base-url",value:c.baseUrl,onChange:B=>u({...c,baseUrl:B.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{htmlFor:"provider-api-key",children:"API key"}),s.jsx(Ce,{id:"provider-api-key",type:"password",value:c.apiKey,onChange:B=>u({...c,apiKey:B.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{htmlFor:"provider-headers",children:"Custom headers (JSON)"}),s.jsx(Ce,{id:"provider-headers",value:c.customHeaders,onChange:B=>u({...c,customHeaders:B.target.value}),placeholder:'{"X-Org":"acme"}'})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ha,{checked:c.enabled,onCheckedChange:B=>u({...c,enabled:B})}),s.jsx(be,{children:"Enabled"})]})]}),s.jsxs(Vt,{children:[s.jsx(ie,{variant:"outline",onClick:()=>o(!1),children:"Cancel"}),s.jsx(ie,{disabled:f||!c.name||!c.apiKey,onClick:$,children:f?"Creating…":"Create"})]})]})]})]})}),s.jsxs(rt,{children:[s.jsxs(st,{children:[s.jsx(lt,{className:"text-base",children:"All providers"}),s.jsxs(kn,{children:[n.length," total"]})]}),s.jsx(ot,{children:s.jsxs(Un,{children:[s.jsx(In,{children:s.jsxs(Be,{children:[s.jsx(ve,{children:"Name"}),s.jsx(ve,{children:"Type"}),s.jsx(ve,{children:"Base URL"}),s.jsx(ve,{children:"Models"}),s.jsx(ve,{children:"Health"}),s.jsx(ve,{children:"Enabled"}),s.jsx(ve,{className:"text-right",children:"Actions"})]})}),s.jsxs(Pn,{children:[n.length===0&&s.jsx(Be,{children:s.jsx(fe,{colSpan:7,className:"text-center text-muted-foreground",children:"No providers yet."})}),n.map(B=>s.jsxs(h.Fragment,{children:[s.jsxs(Be,{children:[s.jsxs(fe,{className:"font-medium",children:[B.name," ",s.jsx("span",{className:"text-xs text-muted-foreground",children:B.slug})]}),s.jsx(fe,{children:s.jsx(We,{variant:"outline",children:B.type})}),s.jsx(fe,{className:"text-xs text-muted-foreground",children:B.baseUrl}),s.jsx(fe,{children:B.modelCount}),s.jsx(fe,{children:s.jsx(We,{variant:B.health==="healthy"?"success":B.health==="down"?"destructive":"secondary",children:B.health})}),s.jsx(fe,{children:B.enabled?"Yes":"No"}),s.jsx(fe,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end gap-1",children:[(B.type==="codex"||B.type==="qoder")&&s.jsxs(s.Fragment,{children:[s.jsxs(ie,{size:"sm",variant:M[B.id]?"secondary":"outline","aria-expanded":!!M[B.id],onClick:()=>O(k=>({...k,[B.id]:!k[B.id]})),children:[M[B.id]?s.jsx(D0,{className:"h-3 w-3"}):s.jsx(Im,{className:"h-3 w-3"}),s.jsx("span",{className:"ml-1",children:"Accounts"})]}),s.jsxs(ie,{size:"sm",variant:"outline",onClick:()=>A(B),children:[s.jsx(Pm,{className:"mr-1 h-3 w-3"})," Import models"]})]}),s.jsx(ie,{size:"sm",variant:"outline",disabled:g===B.id,onClick:()=>V(B.id),children:s.jsx(ME,{className:"h-3 w-3"})}),s.jsx(ie,{size:"sm",variant:"outline",onClick:()=>H(B),children:"✎"}),s.jsx(ie,{size:"sm",variant:"outline",onClick:()=>S(B.id),children:s.jsx(Kl,{className:"h-3 w-3"})})]})})]}),B.type==="codex"&&M[B.id]&&s.jsx(Be,{children:s.jsx(fe,{colSpan:7,className:"bg-muted/30",children:s.jsx(G_,{providerId:B.id,providerName:B.name})})}),B.type==="qoder"&&M[B.id]&&s.jsx(Be,{children:s.jsx(fe,{colSpan:7,className:"bg-muted/30",children:s.jsx(W_,{providerId:B.id,providerName:B.name})})})]},B.id))]})]})})]}),D&&s.jsx(t4,{providerId:D.id,providerName:D.name,open:!0,onOpenChange:B=>{B||A(null)},onImported:()=>void U()}),s.jsx(ln,{open:!!x,onOpenChange:B=>{B||(y(null),w(Os))},children:s.jsxs(Kt,{children:[s.jsx(Qt,{children:s.jsx(Zt,{children:"Edit provider"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Name"}),s.jsx(Ce,{value:b.name,onChange:B=>w({...b,name:B.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Slug (optional)"}),s.jsx(Ce,{value:b.slug,onChange:B=>w({...b,slug:B.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Type"}),s.jsxs(zn,{value:b.type,onValueChange:B=>w({...b,type:B}),children:[s.jsx(jn,{children:s.jsx(Ln,{})}),s.jsxs(Sn,{children:[s.jsx(nt,{value:"openai",children:"OpenAI-compatible"}),s.jsx(nt,{value:"anthropic",children:"Anthropic-compatible"}),s.jsx(nt,{value:"codex",children:"Codex OAuth"})]})]})]}),b.type==="codex"?s.jsxs("p",{className:"rounded-md border border-dashed p-3 text-xs text-muted-foreground",children:[s.jsx(BE,{className:"mr-1 inline h-3 w-3"})," Codex credentials live in the account pool — manage them from the Accounts panel."]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx(be,{children:"Base URL"}),s.jsx(Ce,{value:b.baseUrl,onChange:B=>w({...b,baseUrl:B.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"API key (leave empty to keep current)"}),s.jsx(Ce,{type:"password",value:b.apiKey,onChange:B=>w({...b,apiKey:B.target.value})})]})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Custom headers (JSON)"}),s.jsx(Ce,{value:b.customHeaders,onChange:B=>w({...b,customHeaders:B.target.value}),placeholder:'{"X-Org":"acme"}'})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ha,{checked:b.enabled,onCheckedChange:B=>w({...b,enabled:B})}),s.jsx(be,{children:"Enabled"})]})]}),s.jsxs(Vt,{children:[s.jsx(ie,{variant:"outline",onClick:()=>{y(null),w(Os)},children:"Cancel"}),s.jsx(ie,{disabled:f||!b.name,onClick:ae,children:"Save changes"})]})]})}),s.jsx($w,{open:!!N,onOpenChange:B=>{B||S(null)},children:s.jsxs(yp,{children:[s.jsxs(Yw,{children:[s.jsx(bp,{children:"Delete provider?"}),s.jsx(wp,{children:"This will soft-disable the provider if models depend on it."})]}),s.jsxs(Gw,{children:[s.jsx(Sp,{children:"Cancel"}),s.jsx(jp,{disabled:C,onClick:B=>{N&&(B.preventDefault(),ee(N))},children:C?"Deleting…":"Delete"})]})]})})]})}const ym=["image_input","audio_input","tools","structured_output","reasoning","chat","streaming"],s4=["unknown","yes","no"];function l4(n,a){return n[a]===!0?"yes":n[a]===!1?"no":"unknown"}function o4(n){const a={};for(const l of ym)a[l]=n[l]==="yes"?!0:n[l]==="no"?!1:null;return a}function i4(){const[n,a]=h.useState([]),[l,o]=h.useState([]),[c,u]=h.useState("all"),[f,p]=h.useState(!1),[g,v]=h.useState(""),[x,y]=h.useState([]),[b,w]=h.useState(new Set),[N,S]=h.useState(!1),[C,R]=h.useState(""),[D,A]=h.useState(""),[M,O]=h.useState(null),[E,_]=h.useState(!1),[U,$]=h.useState(null),[te,V]=h.useState(null),[H,ae]=h.useState(null),[ee,B]=h.useState({}),[k,q]=h.useState(!1),Z=G=>{const ue={};for(const he of ym)ue[he]=l4(G.capabilities,he);B(ue),ae(G)},J=async()=>{if(H){q(!0);try{await ge.patch("/api/admin/models",{id:H.id,capabilities:o4(ee)}),de.success("Capabilities updated"),ae(null),ne()}catch(G){de.error(G.message)}finally{q(!1)}}},ne=async()=>{const[G,ue]=await Promise.all([ge.get("/api/admin/models"),ge.get("/api/admin/providers")]);a(G.models),o(ue.providers)};h.useEffect(()=>{ne()},[]);const z=n.filter(G=>!(c!=="all"&&G.providerId!==c||C&&!G.publicModelId.toLowerCase().includes(C.toLowerCase()))),L=x.filter(G=>{if(!D)return!0;const ue=D.toLowerCase();return G.upstreamId.toLowerCase().includes(ue)||G.displayName.toLowerCase().includes(ue)}),F=async()=>{if(g){S(!0);try{const G=await ge.post(`/api/admin/providers/${g}/discover`);y(G.models),w(new Set)}catch(G){de.error(G.message)}finally{S(!1)}}},se=async()=>{if(b.size!==0)try{const G=await ge.post("/api/admin/models/import",{providerId:g,modelIds:Array.from(b)});de.success(`Imported ${G.imported} of ${G.requested}`),p(!1),y([]),w(new Set),ne()}catch(G){de.error(G.message)}},pe=async()=>{if(te)try{await ge.del(`/api/admin/models/${te.id}`),de.success("Model deleted"),V(null),ne()}catch(G){de.error(G.message)}},ye=async G=>{var he,xe,Ae;O(G),_(!0);const ue=Date.now();$({phase:"streaming",startedAt:ue,text:"",progress:{}});try{const Ne=await du(`/api/admin/models/${G}/test-stream`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"});if(!Ne.ok){const qe=await Ne.text().catch(()=>"");$({phase:"error",model:G,error:`HTTP ${Ne.status}: ${qe}`});return}const Oe=(he=Ne.body)==null?void 0:he.getReader();if(!Oe){$({phase:"error",model:G,error:"No response body"});return}const Qe=new TextDecoder;let et="",ce="",Le=!1;for(;!Le;){const{value:qe,done:_t}=await Oe.read();Le=_t,qe&&(et+=Qe.decode(qe,{stream:!0}));let St;for(;(St=et.indexOf(`
|
|
388
|
-
|
|
389
|
-
`))>=0;){const Wt=et.slice(0,St);et=et.slice(St+2);const mn=Wt.split(`
|
|
390
|
-
`);let en="",Ct="";for(const xn of mn)xn.startsWith("event: ")?en=xn.slice(7):xn.startsWith("data: ")&&(Ct=xn.slice(6));if(Ct){if(en===""||en==="message")try{const At=(xe=JSON.parse(Ct).choices)==null?void 0:xe[0];(Ae=At==null?void 0:At.delta)!=null&&Ae.content&&(ce+=At.delta.content),$(Mt=>{if(!Mt||Mt.phase!=="streaming")return Mt;const pn=Date.now()-ue,pa=Mt.progress.ttftMs??pn;return{...Mt,text:ce,progress:{ttftMs:pa,elapsedMs:pn}}})}catch{}if(en==="test_meta")try{const xn=JSON.parse(Ct);$({phase:"done",model:G,result:xn,text:ce})}catch{}if(en==="test_error")try{const xn=JSON.parse(Ct);$({phase:"error",model:G,error:xn.message})}catch{}}}}$(qe=>!qe||qe.phase==="streaming"?{phase:"error",model:G,error:"Stream ended unexpectedly"}:qe)}catch(Ne){$({phase:"error",model:G,error:Ne.message})}finally{O(null)}};return s.jsxs("div",{children:[s.jsx(Va,{title:"Models",description:"Physical models imported from providers",actions:s.jsxs(ln,{open:f,onOpenChange:p,children:[s.jsx(wi,{asChild:!0,children:s.jsxs(ie,{variant:"outline",children:[s.jsx(Pm,{className:"mr-1 h-4 w-4"})," Fetch models"]})}),s.jsxs(Kt,{className:"max-w-2xl",children:[s.jsx(Qt,{children:s.jsx(Zt,{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(zn,{value:g,onValueChange:v,children:[s.jsx(jn,{children:s.jsx(Ln,{placeholder:"Choose provider"})}),s.jsx(Sn,{children:l.map(G=>s.jsx(nt,{value:G.id,children:G.name},G.id))})]})}),s.jsx(ie,{onClick:F,disabled:!g||N,children:N?"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(Hm,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),s.jsx(Ce,{className:"pl-8",placeholder:"Search models…",value:D,onChange:G=>A(G.target.value)}),D&&s.jsx("button",{className:"absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",onClick:()=>A(""),children:s.jsx(Au,{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:[L.length," / ",x.length," · ",b.size," selected"]}),s.jsx(ie,{variant:"outline",size:"sm",onClick:()=>w(new Set(L.filter(G=>!G.alreadyImported).map(G=>G.upstreamId))),children:"Select All (new)"}),s.jsx(ie,{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:L.length===0&&x.length>0?s.jsx("div",{className:"text-center text-sm text-muted-foreground py-4",children:"No models match your search."}):L.map(G=>s.jsxs("label",{className:"flex items-center gap-2 rounded p-1 text-sm hover:bg-accent",children:[s.jsx(Cr,{checked:b.has(G.upstreamId),onCheckedChange:ue=>{const he=new Set(b);ue?he.add(G.upstreamId):he.delete(G.upstreamId),w(he)}}),s.jsx("span",{className:"font-mono text-xs",children:G.upstreamId}),G.alreadyImported&&s.jsx(We,{variant:"secondary",children:"imported"})]},G.upstreamId))})]})]}),s.jsxs(Vt,{children:[s.jsx(ie,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),s.jsxs(ie,{disabled:b.size===0,onClick:se,children:["Import ",b.size||""]})]})]})]})}),s.jsxs(rt,{children:[s.jsxs(st,{children:[s.jsx(lt,{className:"text-base",children:"All models"}),s.jsxs(kn,{children:[n.length," total"]})]}),s.jsxs(ot,{children:[s.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[s.jsxs(zn,{value:c,onValueChange:u,children:[s.jsx(jn,{className:"w-56",children:s.jsx(Ln,{})}),s.jsxs(Sn,{children:[s.jsx(nt,{value:"all",children:"All providers"}),l.map(G=>s.jsx(nt,{value:G.id,children:G.name},G.id))]})]}),s.jsx(Ce,{className:"max-w-xs",placeholder:"Search public ID",value:C,onChange:G=>R(G.target.value)})]}),s.jsxs(Un,{children:[s.jsx(In,{children:s.jsxs(Be,{children:[s.jsx(ve,{children:"Public ID"}),s.jsx(ve,{children:"Provider"}),s.jsx(ve,{children:"Upstream ID"}),s.jsx(ve,{children:"Capabilities"}),s.jsx(ve,{children:"Available"}),s.jsx(ve,{children:"Enabled"}),s.jsx(ve,{})]})}),s.jsxs(Pn,{children:[z.length===0&&s.jsx(Be,{children:s.jsx(fe,{colSpan:7,className:"text-center text-muted-foreground",children:"No models"})}),z.map(G=>s.jsxs(Be,{children:[s.jsx(fe,{className:"font-mono text-xs",children:G.publicModelId}),s.jsx(fe,{children:G.providerSlug}),s.jsx(fe,{className:"text-xs text-muted-foreground",children:G.upstreamModelId}),s.jsx(fe,{className:"space-x-1",children:Object.entries(G.capabilities).filter(([,ue])=>ue===!0).slice(0,4).map(([ue])=>s.jsx(We,{variant:"outline",className:"mr-1",children:ue},ue))}),s.jsx(fe,{children:G.upstreamAvailable?s.jsx(We,{variant:"success",children:"up"}):s.jsx(We,{variant:"destructive",children:"down"})}),s.jsx(fe,{children:G.enabled?"Yes":"No"}),s.jsx(fe,{className:"text-right",children:s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[s.jsxs(ie,{size:"sm",variant:"outline",onClick:()=>Z(G),disabled:M!==null,children:[s.jsx(LE,{className:"h-3.5 w-3.5"})," Capabilities"]}),s.jsxs(ie,{size:"sm",variant:"outline",onClick:()=>void ye(G.id),disabled:M!==null,children:[M===G.id?s.jsx(pr,{className:"h-3.5 w-3.5 animate-spin"}):s.jsx(CE,{className:"h-3.5 w-3.5"})," Test"]}),s.jsxs(ie,{size:"sm",variant:"destructive",onClick:()=>V(G),disabled:M!==null,children:[s.jsx(Kl,{className:"h-3.5 w-3.5"})," Xoá"]})]})})]},G.id))]})]})]})]}),s.jsx(ln,{open:!!te,onOpenChange:G=>{G||V(null)},children:s.jsxs(Kt,{className:"max-w-md",children:[s.jsx(Qt,{children:s.jsx(Zt,{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:te==null?void 0:te.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(Vt,{children:[s.jsx(ie,{variant:"outline",onClick:()=>V(null),children:"Huỷ"}),s.jsx(ie,{variant:"destructive",onClick:pe,children:"Xoá"})]})]})}),s.jsx(ln,{open:H!==null,onOpenChange:G=>{G||ae(null)},children:s.jsxs(Kt,{className:"max-w-lg",children:[s.jsx(Qt,{children:s.jsxs(Zt,{children:["Capabilities — ",H==null?void 0:H.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)."]}),ym.map(G=>{var he;const ue=(he=H==null?void 0:H.discoveredCapabilities)==null?void 0:he[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:ue===void 0?"discovered: unknown":`discovered: ${String(ue)}`})]}),s.jsx("div",{className:"flex gap-1",children:s4.map(xe=>s.jsx(ie,{size:"sm",variant:ee[G]===xe?"default":"outline",onClick:()=>B(Ae=>({...Ae,[G]:xe})),children:xe==="unknown"?"Unknown":xe==="yes"?"Yes":"No"},xe))})]},G)})]}),s.jsxs(Vt,{children:[s.jsx(ie,{variant:"outline",onClick:()=>ae(null),children:"Huỷ"}),s.jsx(ie,{onClick:J,disabled:k,children:k?"Saving…":"Lưu"})]})]})}),s.jsx(ln,{open:E,onOpenChange:_,children:s.jsxs(Kt,{className:"max-w-2xl",children:[s.jsx(Qt,{children:s.jsx(Zt,{children:"Kết quả test model"})}),U&&U.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(pr,{className:"h-4 w-4 animate-spin"})," Đang stream…",s.jsxs("span",{className:"font-mono text-xs text-muted-foreground/60",children:["TTFT ",U.progress.ttftMs!=null?`${U.progress.ttftMs} ms`:"…"]}),s.jsxs("span",{className:"font-mono text-xs text-muted-foreground/60",children:["· ",U.progress.elapsedMs!=null?`${U.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:[U.text||s.jsx("span",{className:"text-muted-foreground/60 animate-pulse",children:"waiting for first token…"}),U.phase==="streaming"&&s.jsx("span",{className:"ml-0.5 inline-block h-3.5 w-1.5 animate-pulse bg-primary/70"})]})]})]}),U&&U.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(We,{variant:U.result.success?"success":"destructive",children:U.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:[U.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:U.result.ttftMs!=null?`${U.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:[U.result.usage.input," / ",U.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:U.text||U.result.text||"(trống)"})]}),U.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:U.result.attempts.map((G,ue)=>s.jsxs("div",{className:"flex items-center gap-2 rounded border p-2 text-xs",children:[s.jsx(We,{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})]},ue))})]})]}),U&&U.phase==="error"&&s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsx(We,{variant:"destructive",children:"Thất bại"}),s.jsx("p",{className:"text-destructive",children:U.error})]}),s.jsx(Vt,{children:s.jsx(ie,{variant:"outline",onClick:()=>_(!1),children:"Đóng"})})]})})]})}function c4(){const[n,a]=h.useState([]),[l,o]=h.useState([]),[c,u]=h.useState(!1),[f,p]=h.useState(!1),[g,v]=h.useState(null),[x,y]=h.useState(!1),[b,w]=h.useState(!1),[N,S]=h.useState({name:"",slug:"",mode:"fallback",enabled:!0,members:[]}),[C,R]=h.useState({name:"",slug:"",mode:"fallback",enabled:!0,members:[]}),D=async()=>{const[V,H]=await Promise.all([ge.get("/api/admin/combos"),ge.get("/api/admin/models")]);a(V.combos),o(H.models)};h.useEffect(()=>{D()},[]);const A=V=>{S(H=>({...H,members:[...H.members,{modelId:V,weight:1,position:H.members.length,enabled:!0}]}))},M=V=>{S(H=>({...H,members:H.members.filter((ae,ee)=>ee!==V).map((ae,ee)=>({...ae,position:ee}))}))},O=async()=>{if(N.members.length===0){de.error("Add at least one member");return}y(!0);try{await ge.post("/api/admin/combos",{name:N.name,slug:N.slug||void 0,mode:N.mode,enabled:N.enabled,members:N.members}),de.success("Combo created"),u(!1),S({name:"",slug:"",mode:"fallback",enabled:!0,members:[]}),D()}catch(V){de.error(V.message)}finally{y(!1)}},E=async V=>{try{const ae=(await ge.get(`/api/admin/combos/${V.id}`)).combo;v(ae.id),R({name:ae.name,slug:ae.publicModelId.startsWith("combo/")?ae.slug:"",mode:ae.mode,enabled:ae.enabled,members:ae.members.map(ee=>({modelId:ee.modelId,weight:ee.weight,position:ee.position,enabled:ee.enabled}))}),p(!0)}catch(H){de.error(H.message)}},_=async()=>{if(g){if(C.members.length===0){de.error("Add at least one member");return}w(!0);try{await ge.patch("/api/admin/combos",{id:g,name:C.name,slug:C.slug||void 0,mode:C.mode,enabled:C.enabled,members:C.members}),de.success("Combo updated"),p(!1),v(null),D()}catch(V){de.error(V.message)}finally{w(!1)}}},U=V=>{R(H=>({...H,members:[...H.members,{modelId:V,weight:1,position:H.members.length,enabled:!0}]}))},$=V=>{R(H=>({...H,members:H.members.filter((ae,ee)=>ee!==V).map((ae,ee)=>({...ae,position:ee}))}))},te=async V=>{if(confirm("Delete this combo?"))try{await ge.del(`/api/admin/combos/${V}`),de.success("Combo removed"),D()}catch(H){de.error(H.message)}};return s.jsxs("div",{children:[s.jsx(Va,{title:"Combos",description:"Virtual models combining physical models",actions:s.jsxs(ln,{open:c,onOpenChange:u,children:[s.jsx(wi,{asChild:!0,children:s.jsxs(ie,{children:[s.jsx(Xl,{className:"mr-1 h-4 w-4"})," New combo"]})}),s.jsxs(Kt,{className:"max-w-2xl",children:[s.jsx(Qt,{children:s.jsx(Zt,{children:"New combo"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Name"}),s.jsx(Ce,{value:N.name,onChange:V=>S({...N,name:V.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Slug (optional — empty uses the name as the model ID)"}),s.jsx(Ce,{value:N.slug,onChange:V=>S({...N,slug:V.target.value}),placeholder:"empty → gpt-5.5 · set → combo/gpt-5.5"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Mode"}),s.jsxs(zn,{value:N.mode,onValueChange:V=>S({...N,mode:V}),children:[s.jsx(jn,{children:s.jsx(Ln,{})}),s.jsxs(Sn,{children:[s.jsx(nt,{value:"fallback",children:"Fallback (ordered)"}),s.jsx(nt,{value:"weighted_round_robin",children:"Weighted round-robin"})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ha,{checked:N.enabled,onCheckedChange:V=>S({...N,enabled:V})}),s.jsx(be,{children:"Enabled"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Members"}),s.jsx(Jb,{models:l,addedIds:N.members.map(V=>V.modelId),onAdd:A}),s.jsx("div",{className:"mt-2 space-y-1",children:N.members.map((V,H)=>{var ae;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:(ae=l.find(ee=>ee.id===V.modelId))==null?void 0:ae.publicModelId}),s.jsx(Ce,{type:"number",min:1,value:V.weight,onChange:ee=>{const B=Number(ee.target.value);S(k=>({...k,members:k.members.map((q,Z)=>Z===H?{...q,weight:B}:q)}))},className:"w-20"}),s.jsx(ie,{size:"sm",variant:"outline",onClick:()=>M(H),children:"Remove"})]},H)})})]})]}),s.jsxs(Vt,{children:[s.jsx(ie,{variant:"outline",onClick:()=>u(!1),children:"Cancel"}),s.jsx(ie,{disabled:!N.name||x,onClick:O,children:x?"Creating…":"Create"})]})]})]})}),s.jsxs(rt,{children:[s.jsxs(st,{children:[s.jsx(lt,{className:"text-base",children:"All combos"}),s.jsxs(kn,{children:[n.length," total"]})]}),s.jsx(ot,{children:s.jsxs(Un,{children:[s.jsx(In,{children:s.jsxs(Be,{children:[s.jsx(ve,{children:"Public ID"}),s.jsx(ve,{children:"Mode"}),s.jsx(ve,{children:"Members"}),s.jsx(ve,{children:"Healthy"}),s.jsx(ve,{children:"Enabled"}),s.jsx(ve,{})]})}),s.jsxs(Pn,{children:[n.length===0&&s.jsx(Be,{children:s.jsx(fe,{colSpan:6,className:"text-center text-muted-foreground",children:"No combos yet."})}),n.map(V=>s.jsxs(Be,{children:[s.jsx(fe,{className:"font-mono text-xs",children:V.publicModelId}),s.jsx(fe,{children:s.jsx(We,{variant:"outline",children:V.mode})}),s.jsx(fe,{children:V.memberCount}),s.jsx(fe,{children:V.healthyMemberCount}),s.jsx(fe,{children:V.enabled?"Yes":"No"}),s.jsx(fe,{className:"text-right",children:s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[s.jsxs(ie,{size:"sm",variant:"outline",onClick:()=>void E(V),children:[s.jsx(UE,{className:"h-3.5 w-3.5"})," Sửa"]}),s.jsxs(ie,{size:"sm",variant:"destructive",onClick:()=>te(V.id),children:[s.jsx(Kl,{className:"h-3.5 w-3.5"})," Xoá"]})]})})]},V.id))]})]})})]}),s.jsx(ln,{open:f,onOpenChange:p,children:s.jsxs(Kt,{className:"max-w-2xl",children:[s.jsx(Qt,{children:s.jsx(Zt,{children:"Edit combo"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Name"}),s.jsx(Ce,{value:C.name,onChange:V=>R({...C,name:V.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Slug (optional — leave empty to use the name as the model ID)"}),s.jsx(Ce,{value:C.slug,onChange:V=>R({...C,slug:V.target.value}),placeholder:"empty → gpt-5.5 · set → combo/gpt-5.5"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Mode"}),s.jsxs(zn,{value:C.mode,onValueChange:V=>R({...C,mode:V}),children:[s.jsx(jn,{children:s.jsx(Ln,{})}),s.jsxs(Sn,{children:[s.jsx(nt,{value:"fallback",children:"Fallback (ordered)"}),s.jsx(nt,{value:"weighted_round_robin",children:"Weighted round-robin"})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ha,{checked:C.enabled,onCheckedChange:V=>R({...C,enabled:V})}),s.jsx(be,{children:"Enabled"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Members"}),s.jsx(Jb,{models:l,addedIds:C.members.map(V=>V.modelId),onAdd:U}),s.jsx("div",{className:"mt-2 space-y-1",children:C.members.map((V,H)=>{var ae;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:(ae=l.find(ee=>ee.id===V.modelId))==null?void 0:ae.publicModelId}),s.jsx(Ce,{type:"number",min:1,value:V.weight,onChange:ee=>{const B=Number(ee.target.value);R(k=>({...k,members:k.members.map((q,Z)=>Z===H?{...q,weight:B}:q)}))},className:"w-20"}),s.jsx(ie,{size:"sm",variant:"outline",onClick:()=>$(H),children:"Remove"})]},H)})})]})]}),s.jsxs(Vt,{children:[s.jsx(ie,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),s.jsx(ie,{disabled:!C.name||b,onClick:_,children:b?"Saving…":"Save"})]})]})})]})}function Jb({models:n,addedIds:a,onAdd:l}){const[o,c]=h.useState(""),f=(o?n.filter(p=>{const g=o.toLowerCase();return p.publicModelId.toLowerCase().includes(g)||p.displayName.toLowerCase().includes(g)}):n).filter(p=>!a.includes(p.id));return s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"relative",children:[s.jsx(Hm,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),s.jsx(Ce,{className:"pl-8",placeholder:"Search models…",value:o,onChange:p=>c(p.target.value)}),o&&s.jsx("button",{className:"absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",onClick:()=>c(""),children:s.jsx(Au,{className:"h-4 w-4"})})]}),f.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:f.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(ie,{size:"sm",variant:"ghost",onClick:()=>l(p.id),children:"+ Add"})]},p.id))})]})}function u4(){const[n,a]=h.useState([]),[l,o]=h.useState([]),[c,u]=h.useState([]),[f,p]=h.useState(!1),[g,v]=h.useState({alias:"",targetKind:"model",targetId:"",enabled:!0}),x=async()=>{const[b,w,N]=await Promise.all([ge.get("/api/admin/aliases"),ge.get("/api/admin/models"),ge.get("/api/admin/combos")]);a(b.aliases),o(w.models),u(N.combos)};h.useEffect(()=>{x()},[]);const y=async()=>{try{await ge.post("/api/admin/aliases",g),de.success("Alias created"),p(!1),v({alias:"",targetKind:"model",targetId:"",enabled:!0}),x()}catch(b){de.error(b.message)}};return s.jsxs("div",{children:[s.jsx(Va,{title:"Aliases",description:"Stable client-visible names for models or combos",actions:s.jsxs(ln,{open:f,onOpenChange:p,children:[s.jsx(wi,{asChild:!0,children:s.jsxs(ie,{children:[s.jsx(Xl,{className:"mr-1 h-4 w-4"})," New alias"]})}),s.jsxs(Kt,{children:[s.jsx(Qt,{children:s.jsx(Zt,{children:"New alias"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Alias"}),s.jsx(Ce,{value:g.alias,onChange:b=>v({...g,alias:b.target.value}),placeholder:"coding"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Target type"}),s.jsxs(zn,{value:g.targetKind,onValueChange:b=>v({...g,targetKind:b}),children:[s.jsx(jn,{children:s.jsx(Ln,{})}),s.jsxs(Sn,{children:[s.jsx(nt,{value:"model",children:"Model"}),s.jsx(nt,{value:"combo",children:"Combo"})]})]})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Target"}),s.jsxs(zn,{value:g.targetId,onValueChange:b=>v({...g,targetId:b}),children:[s.jsx(jn,{children:s.jsx(Ln,{placeholder:"Choose target"})}),s.jsx(Sn,{children:(g.targetKind==="model"?l:c).map(b=>s.jsx(nt,{value:b.id,children:b.publicModelId},b.id))})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ha,{checked:g.enabled,onCheckedChange:b=>v({...g,enabled:b})}),s.jsx(be,{children:"Enabled"})]})]}),s.jsxs(Vt,{children:[s.jsx(ie,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),s.jsx(ie,{disabled:!g.alias||!g.targetId,onClick:y,children:"Create"})]})]})]})}),s.jsxs(rt,{children:[s.jsxs(st,{children:[s.jsx(lt,{className:"text-base",children:"All aliases"}),s.jsxs(kn,{children:[n.length," total"]})]}),s.jsx(ot,{children:s.jsxs(Un,{children:[s.jsx(In,{children:s.jsxs(Be,{children:[s.jsx(ve,{children:"Alias"}),s.jsx(ve,{children:"Target"}),s.jsx(ve,{children:"Type"}),s.jsx(ve,{children:"Enabled"}),s.jsx(ve,{})]})}),s.jsxs(Pn,{children:[n.length===0&&s.jsx(Be,{children:s.jsx(fe,{colSpan:5,className:"text-center text-muted-foreground",children:"No aliases yet."})}),n.map(b=>s.jsxs(Be,{children:[s.jsx(fe,{className:"font-mono text-xs",children:b.alias}),s.jsx(fe,{className:"font-mono text-xs",children:b.targetName??b.targetId}),s.jsx(fe,{children:s.jsx(We,{variant:"outline",children:b.targetKind})}),s.jsx(fe,{children:b.enabled?"Yes":"No"}),s.jsx(fe,{className:"text-right",children:s.jsx(ie,{size:"sm",variant:"outline",onClick:async()=>{await ge.del(`/api/admin/aliases/${b.id}`),de.success("Removed"),x()},children:"Delete"})})]},b.id))]})]})})]})]})}function d4(){const[n,a]=h.useState([]),[l,o]=h.useState([]),[c,u]=h.useState([]),[f,p]=h.useState(!1),[g,v]=h.useState(null),[x,y]=h.useState(null),[b,w]=h.useState(null),[N,S]=h.useState({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""}),C=async()=>{const[E,_,U]=await Promise.all([ge.get("/api/admin/api-keys"),ge.get("/api/admin/models"),ge.get("/api/admin/combos")]);a(E.apiKeys),o(_.models),u(U.combos)};h.useEffect(()=>{C()},[]);const R=async()=>{try{if(g){await ge.patch("/api/admin/api-keys",{id:g,name:N.name,expiresAt:N.expiresAt||null,allowAllModels:N.allowAll,permissions:N.allowAll?[]:N.permissions,rpmLimit:N.rpmLimit?Number(N.rpmLimit):null,tpmLimit:N.tpmLimit?Number(N.tpmLimit):null,maxConcurrent:N.concurrency?Number(N.concurrency):null}),p(!1),v(null),S({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""}),de.success("Key updated"),C();return}const E=await ge.post("/api/admin/api-keys",{name:N.name,expiresAt:N.expiresAt||null,allowAllModels:N.allowAll,permissions:N.allowAll?void 0:N.permissions,rpmLimit:N.rpmLimit?Number(N.rpmLimit):null,tpmLimit:N.tpmLimit?Number(N.tpmLimit):null,maxConcurrent:N.concurrency?Number(N.concurrency):null,...N.customSecret.trim()?{secret:N.customSecret.trim()}:{}});p(!1),y({secret:E.secret,name:E.name}),S({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""}),C()}catch(E){de.error(E.message)}},D=async E=>{try{const U=((await ge.get(`/api/admin/api-keys/${E.id}`)).apiKey.permissions??[]).filter($=>$.targetKind==="model"||$.targetKind==="combo");v(E.id),S({name:E.name,expiresAt:E.expiresAt?E.expiresAt.slice(0,16):"",allowAll:E.allowAllModels,permissions:U,rpmLimit:E.rpmLimit!=null?String(E.rpmLimit):"",tpmLimit:E.tpmLimit!=null?String(E.tpmLimit):"",concurrency:E.concurrencyLimit!=null?String(E.concurrencyLimit):"",customSecret:""}),p(!0)}catch(_){de.error(_.message)}},A=()=>{p(!1),v(null),S({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""})},M=async(E,_)=>{try{await ge.patch("/api/admin/api-keys",{id:E,enabled:!_}),de.success(_?"Key disabled":"Key enabled"),C()}catch(U){de.error(U.message)}},O=async E=>{if(window.confirm("Delete this API key? This cannot be undone."))try{await ge.del(`/api/admin/api-keys/${E}`),de.success("Key deleted"),C()}catch(_){de.error(_.message)}};return s.jsxs("div",{children:[s.jsx(Va,{title:"API Keys",description:"Gateway bearer keys for client applications",actions:s.jsxs(ln,{open:f,onOpenChange:E=>{E?p(!0):A()},children:[s.jsx(wi,{asChild:!0,children:s.jsxs(ie,{children:[s.jsx(Xl,{className:"mr-1 h-4 w-4"})," New key"]})}),s.jsxs(Kt,{className:"max-w-2xl",children:[s.jsx(Qt,{children:s.jsx(Zt,{children:g?"Edit API key":"New API key"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Name"}),s.jsx(Ce,{value:N.name,onChange:E=>S({...N,name:E.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Expires (optional)"}),s.jsx(Ce,{type:"datetime-local",value:N.expiresAt,onChange:E=>S({...N,expiresAt:E.target.value})})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[s.jsxs("div",{children:[s.jsx(be,{children:"RPM limit"}),s.jsx(Ce,{value:N.rpmLimit,onChange:E=>S({...N,rpmLimit:E.target.value}),type:"number"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"TPM limit"}),s.jsx(Ce,{value:N.tpmLimit,onChange:E=>S({...N,tpmLimit:E.target.value}),type:"number"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Concurrency"}),s.jsx(Ce,{value:N.concurrency,onChange:E=>S({...N,concurrency:E.target.value}),type:"number"})]})]}),!g&&s.jsxs("div",{children:[s.jsx(be,{children:"Key value (optional)"}),s.jsx(Ce,{value:N.customSecret,onChange:E=>S({...N,customSecret:E.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(Ha,{checked:N.allowAll,onCheckedChange:E=>S({...N,allowAll:E})}),s.jsx(be,{children:"Allow all current and future models"})]}),!N.allowAll&&s.jsxs("div",{children:[s.jsx(be,{children:"Scope"}),s.jsx("div",{className:"max-h-48 space-y-1 overflow-auto rounded border p-2",children:[...l.map(E=>({targetKind:"model",targetId:E.id,label:E.publicModelId})),...c.map(E=>({targetKind:"combo",targetId:E.id,label:E.publicModelId}))].map(E=>{const _=N.permissions.some(U=>U.targetKind===E.targetKind&&U.targetId===E.targetId);return s.jsxs("label",{className:"flex items-center gap-2 rounded p-1 text-sm hover:bg-accent",children:[s.jsx(Cr,{checked:_,onCheckedChange:U=>{S($=>({...$,permissions:U?[...$.permissions,{targetKind:E.targetKind,targetId:E.targetId}]:$.permissions.filter(te=>!(te.targetKind===E.targetKind&&te.targetId===E.targetId))}))}}),s.jsx("span",{className:"font-mono text-xs",children:E.label}),s.jsx(We,{variant:"outline",className:"ml-1",children:E.targetKind})]},`${E.targetKind}:${E.targetId}`)})})]})]}),s.jsxs(Vt,{children:[s.jsx(ie,{variant:"outline",onClick:A,children:"Cancel"}),s.jsx(ie,{disabled:!N.name,onClick:R,children:g?"Save changes":"Create"})]})]})]})}),s.jsxs(rt,{children:[s.jsxs(st,{children:[s.jsx(lt,{className:"text-base",children:"All keys"}),s.jsxs(kn,{children:[n.length," total"]})]}),s.jsx(ot,{children:s.jsxs(Un,{children:[s.jsx(In,{children:s.jsxs(Be,{children:[s.jsx(ve,{children:"Name"}),s.jsx(ve,{children:"Prefix"}),s.jsx(ve,{children:"Status"}),s.jsx(ve,{children:"Scope"}),s.jsx(ve,{children:"RPM/TPM/Conc"}),s.jsx(ve,{})]})}),s.jsxs(Pn,{children:[n.length===0&&s.jsx(Be,{children:s.jsx(fe,{colSpan:6,className:"text-center text-muted-foreground",children:"No API keys yet."})}),n.map(E=>s.jsxs(Be,{children:[s.jsx(fe,{className:"font-medium",children:E.name}),s.jsxs(fe,{className:"font-mono text-xs",children:[E.keyPrefix,"…"]}),s.jsx(fe,{children:E.enabled?s.jsx(We,{variant:"success",children:"enabled"}):s.jsx(We,{variant:"destructive",children:"disabled"})}),s.jsx(fe,{children:E.allowAllModels?"all":`${E.modelScopeCount} scoped`}),s.jsx(fe,{className:"text-xs",children:[E.rpmLimit,E.tpmLimit,E.concurrencyLimit].map((_,U)=>_?["","RPM","TPM","Conc"][U+1]:null).filter(Boolean).join(" / ")||"—"}),s.jsx(fe,{className:"text-right",children:s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[E.secret&&s.jsxs(s.Fragment,{children:[s.jsx(ie,{size:"sm",variant:"ghost",title:"Copy secret",onClick:()=>{navigator.clipboard.writeText(E.secret),de.success("Copied")},children:s.jsx(nu,{className:"h-3.5 w-3.5"})}),s.jsx(ie,{size:"sm",variant:"ghost",title:"Show secret",onClick:()=>w({secret:E.secret,name:E.name}),children:s.jsx(jE,{className:"h-3.5 w-3.5"})})]}),s.jsx(ie,{size:"sm",variant:"ghost",title:"Edit",onClick:()=>void D(E),children:s.jsx(AE,{className:"h-3.5 w-3.5"})}),s.jsxs(ie,{size:"sm",variant:"outline",onClick:()=>M(E.id,E.enabled),children:[E.enabled?s.jsx(dE,{className:"mr-1 h-3.5 w-3.5"}):s.jsx(Tu,{className:"mr-1 h-3.5 w-3.5"}),E.enabled?"Disable":"Enable"]}),s.jsx(ie,{size:"sm",variant:"destructive",onClick:()=>O(E.id),children:s.jsx(Kl,{className:"h-3.5 w-3.5"})})]})})]},E.id))]})]})})]}),s.jsx(ln,{open:!!x,onOpenChange:E=>{E||y(null)},children:s.jsxs(Kt,{children:[s.jsxs(Qt,{children:[s.jsx(Zt,{children:"API key created"}),s.jsx(jr,{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(Vt,{children:[s.jsxs(ie,{onClick:()=>{x&&(navigator.clipboard.writeText(x.secret),de.success("Copied"))},children:[s.jsx(nu,{className:"mr-1 h-4 w-4"})," Copy"]}),s.jsx(ie,{variant:"outline",onClick:()=>y(null),children:"I have saved it"})]})]})}),s.jsx(ln,{open:!!b,onOpenChange:E=>{E||w(null)},children:s.jsxs(Kt,{children:[s.jsxs(Qt,{children:[s.jsxs(Zt,{children:["API key: ",b==null?void 0:b.name]}),s.jsx(jr,{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:b==null?void 0:b.secret}),s.jsxs(Vt,{children:[s.jsxs(ie,{onClick:()=>{b&&(navigator.clipboard.writeText(b.secret),de.success("Copied"))},children:[s.jsx(nu,{className:"mr-1 h-4 w-4"})," Copy"]}),s.jsx(ie,{variant:"outline",onClick:()=>w(null),children:"Close"})]})]})})]})}const f4=3e3;function h4(n,a){return!(a.success!=="all"&&n.success!==(a.success==="true")||a.protocol!=="all"&&n.protocol!==a.protocol||a.streaming!=="all"&&n.streaming!==(a.streaming==="true")||a.model&&!n.requestedModel.toLowerCase().includes(a.model.toLowerCase()))}function m4(){const[n,a]=h.useState([]),[l,o]=h.useState(0),[c,u]=h.useState(0),[f,p]=h.useState({success:"all",protocol:"all",streaming:"all",model:""}),[g,v]=h.useState(null),[x,y]=h.useState(null),[b,w]=h.useState(0),N=50,S=h.useRef(Date.now()),C=h.useRef(new Set),R=h.useRef(f);R.current=f;const D=h.useRef(c);D.current=c;const A=h.useCallback(async()=>{const O=new URLSearchParams;O.set("limit",String(N)),O.set("offset",String(c)),f.success!=="all"&&O.set("success",f.success),f.protocol!=="all"&&O.set("protocol",f.protocol),f.streaming!=="all"&&O.set("streaming",f.streaming),f.model&&O.set("requestedModel",f.model);const E=await ge.get(`/api/admin/requests?${O.toString()}`);a(E.requests),o(E.total);for(const _ of E.requests)C.current.add(_.id)},[c,f]);h.useEffect(()=>{A()},[A]),h.useEffect(()=>{w(0)},[c,f]),h.useEffect(()=>{let O=!1,E=null;const _=new Set,U=()=>{O||(E=new EventSource(`/api/admin/requests/stream?since=${S.current}`),E.addEventListener("request",$=>{if(!O)try{const te=JSON.parse($.data),V=new Date(te.createdAt).getTime();if(Number.isFinite(V)&&(S.current=Math.max(S.current,V)),C.current.has(te.id))return;C.current.add(te.id),w(H=>H+1),D.current===0&&h4(te,R.current)&&(a(H=>H.some(ae=>ae.id===te.id)?H:[te,...H].slice(0,N)),o(H=>H+1))}catch{}}),E.onerror=()=>{E==null||E.close(),E=null,O||_.add(setTimeout(U,f4))})};return U(),()=>{O=!0,E==null||E.close();for(const $ of _)clearTimeout($);_.clear()}},[]);const M=async O=>{v(O);const E=await ge.get(`/api/admin/requests/${O}`);y(E)};return s.jsxs("div",{children:[s.jsx(Va,{title:"Requests",description:`${l} matching · live updates`}),s.jsxs(rt,{children:[s.jsxs(st,{children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs(zn,{value:f.success,onValueChange:O=>{u(0),p({...f,success:O})},children:[s.jsx(jn,{className:"w-36",children:s.jsx(Ln,{})}),s.jsxs(Sn,{children:[s.jsx(nt,{value:"all",children:"All"}),s.jsx(nt,{value:"true",children:"Success"}),s.jsx(nt,{value:"false",children:"Failed"})]})]}),s.jsxs(zn,{value:f.protocol,onValueChange:O=>{u(0),p({...f,protocol:O})},children:[s.jsx(jn,{className:"w-32",children:s.jsx(Ln,{})}),s.jsxs(Sn,{children:[s.jsx(nt,{value:"all",children:"Any protocol"}),s.jsx(nt,{value:"openai",children:"OpenAI"}),s.jsx(nt,{value:"anthropic",children:"Anthropic"})]})]}),s.jsxs(zn,{value:f.streaming,onValueChange:O=>{u(0),p({...f,streaming:O})},children:[s.jsx(jn,{className:"w-32",children:s.jsx(Ln,{})}),s.jsxs(Sn,{children:[s.jsx(nt,{value:"all",children:"Any"}),s.jsx(nt,{value:"true",children:"Streaming"}),s.jsx(nt,{value:"false",children:"Non-stream"})]})]}),s.jsx(Ce,{className:"max-w-xs",placeholder:"Model contains…",value:f.model,onChange:O=>{u(0),p({...f,model:O.target.value})}}),b>0&&s.jsxs(ie,{size:"sm",variant:"secondary",onClick:()=>{w(0),A()},children:[b," new request",b>1?"s":""," — refresh"]})]}),s.jsx(lt,{className:"mt-3 text-base",children:"Results"})]}),s.jsxs(ot,{children:[s.jsxs(Un,{children:[s.jsx(In,{children:s.jsxs(Be,{children:[s.jsx(ve,{children:"Time"}),s.jsx(ve,{children:"Status"}),s.jsx(ve,{children:"Requested"}),s.jsx(ve,{children:"Final"}),s.jsx(ve,{children:"Tokens"}),s.jsx(ve,{children:"Latency"}),s.jsx(ve,{children:"Attempts"}),s.jsx(ve,{children:"Key"}),s.jsx(ve,{children:"IP"}),s.jsx(ve,{})]})}),s.jsxs(Pn,{children:[n.length===0&&s.jsx(Be,{children:s.jsx(fe,{colSpan:10,className:"text-center text-muted-foreground",children:"No requests yet."})}),n.map(O=>s.jsxs(Be,{className:"cursor-pointer",onClick:()=>M(O.id),children:[s.jsx(fe,{className:"text-xs",children:$m(O.createdAt)}),s.jsx(fe,{children:O.success?s.jsx(We,{variant:"success",children:O.httpStatus}):s.jsx(We,{variant:"destructive",children:O.httpStatus})}),s.jsx(fe,{className:"font-mono text-xs",children:O.requestedModel}),s.jsx(fe,{className:"font-mono text-xs text-muted-foreground",children:O.finalModelPublicId??"—"}),s.jsxs(fe,{className:"text-xs",children:[Xt(O.inputTokens+O.outputTokens)," ",O.cacheReadTokens?s.jsxs("span",{className:"text-amber-600",children:["(+",O.cacheReadTokens," cache)"]}):null]}),s.jsxs(fe,{className:"text-xs",children:[Ls(O.totalLatencyMs),O.ttftMs?s.jsxs("span",{className:"text-muted-foreground",children:[" · ttft ",O.ttftMs,"ms"]}):null]}),s.jsxs(fe,{className:"text-xs",children:[O.attemptsCount,O.gatewayCacheHit?s.jsx(We,{variant:"secondary",className:"ml-1",children:"cache"}):null]}),s.jsx(fe,{className:"text-xs",children:O.apiKeyName??"—"}),s.jsx(fe,{className:"text-xs",children:O.clientIp}),s.jsx(fe,{className:"text-right",children:s.jsx(ie,{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 ",c+1,"–",Math.min(c+N,l)," of ",l]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ie,{size:"sm",variant:"outline",disabled:c===0,onClick:()=>u(Math.max(0,c-N)),children:"Prev"}),s.jsx(ie,{size:"sm",variant:"outline",disabled:c+N>=l,onClick:()=>u(c+N),children:"Next"})]})]})]})]}),s.jsx(ln,{open:!!g,onOpenChange:O=>{O||(v(null),y(null))},children:s.jsxs(Kt,{className:"max-w-3xl",children:[s.jsx(Qt,{children:s.jsxs(Zt,{children:["Request ",wR(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(We,{variant:"success",children:x.request.httpStatus}):s.jsx(We,{variant:"destructive",children:x.request.httpStatus})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Latency"}),Ls(x.request.totalLatencyMs)]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Tokens"}),"in ",Xt(x.request.inputTokens)," · out ",Xt(x.request.outputTokens)," · cache ",Xt(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(Un,{children:[s.jsx(In,{children:s.jsxs(Be,{children:[s.jsx(ve,{children:"#"}),s.jsx(ve,{children:"Provider"}),s.jsx(ve,{children:"Model"}),s.jsx(ve,{children:"Status"}),s.jsx(ve,{children:"Latency"}),s.jsx(ve,{children:"Reason"})]})}),s.jsx(Pn,{children:x.attempts.map(O=>s.jsxs(Be,{children:[s.jsx(fe,{children:O.attemptNumber}),s.jsx(fe,{children:O.providerName}),s.jsx(fe,{className:"font-mono text-xs",children:O.modelPublicId}),s.jsx(fe,{children:O.success?s.jsx(We,{variant:"success",children:String(O.statusCode??"OK")}):s.jsx(We,{variant:"destructive",children:String(O.statusCode??"err")})}),s.jsx(fe,{className:"text-xs",children:Ls(O.latencyMs)}),s.jsx(fe,{className:"text-xs",children:O.failureReason??O.selectionReason})]},O.id))})]})]})]}):s.jsx("div",{className:"text-muted-foreground",children:"Loading…"})]})})]})}var p4=Object.defineProperty,ro=(n,a)=>p4(n,"name",{value:a,configurable:!0}),$p="Tabs",[g4,j5]=Hn($p,[Hu]),Qj=Hu(),[v4,Vp]=g4($p),x4=h.forwardRef(ro(function(a,l){const{__scopeTabs:o,value:c,onValueChange:u,defaultValue:f,orientation:p="horizontal",dir:g,activationMode:v="automatic",...x}=a,y=xi(g),[b,w]=Ia({prop:c,onChange:u,defaultProp:f??"",caller:$p});return s.jsx(v4,{scope:o,baseId:Na(),value:b,onValueChange:w,orientation:p,dir:y,activationMode:v,children:s.jsx(He.div,{dir:y,"data-orientation":p,...x,ref:l})})},"Tabs")),y4="TabsList",b4=h.forwardRef(ro(function(a,l){const{__scopeTabs:o,loop:c=!0,...u}=a,f=Vp(y4,o),p=Qj(o);return s.jsx(Q1,{asChild:!0,...p,orientation:f.orientation,dir:f.dir,loop:c,children:s.jsx(He.div,{role:"tablist","aria-orientation":f.orientation,...u,ref:l})})},"TabsList")),w4="TabsTrigger",j4=h.forwardRef(ro(function(a,l){const{__scopeTabs:o,value:c,disabled:u=!1,...f}=a,p=Vp(w4,o),g=Qj(o),v=Yp(p.baseId,c),x=Gp(p.baseId,c),y=c===p.value;return s.jsx(Z1,{asChild:!0,...g,focusable:!u,active:y,children:s.jsx(He.button,{type:"button",role:"tab","aria-selected":y,"aria-controls":x,"data-state":y?"active":"inactive","data-disabled":u?"":void 0,disabled:u,id:v,...f,ref:l,onMouseDown:Se(a.onMouseDown,b=>{!u&&b.button===0&&b.ctrlKey===!1?p.onValueChange(c):b.preventDefault()}),onKeyDown:Se(a.onKeyDown,b=>{u||b.target!==b.currentTarget||[" ","Enter"].includes(b.key)&&p.onValueChange(c)}),onFocus:Se(a.onFocus,()=>{const b=p.activationMode!=="manual";!y&&!u&&b&&p.onValueChange(c)})})})},"TabsTrigger")),S4="TabsContent",C4=h.forwardRef(ro(function(a,l){const{__scopeTabs:o,value:c,forceMount:u,children:f,...p}=a,g=Vp(S4,o),v=Yp(g.baseId,c),x=Gp(g.baseId,c),y=c===g.value,b=h.useRef(y);return h.useEffect(()=>{const w=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(w)},[]),s.jsx(Er,{present:u||y,children:({present:w})=>s.jsx(He.div,{"data-state":y?"active":"inactive","data-orientation":g.orientation,role:"tabpanel","aria-labelledby":v,hidden:!w,id:x,tabIndex:0,...p,ref:l,style:{...a.style,animationDuration:b.current?"0s":void 0},children:w&&f})})},"TabsContent"));function Yp(n,a){return`${n}-trigger-${a}`}ro(Yp,"makeTriggerId");function Gp(n,a){return`${n}-content-${a}`}ro(Gp,"makeContentId");var N4=x4,Zj=b4,Jj=j4,Wj=C4;const eS=N4,Fp=h.forwardRef(({className:n,...a},l)=>s.jsx(Zj,{ref:l,className:Re("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",n),...a}));Fp.displayName=Zj.displayName;const mr=h.forwardRef(({className:n,...a},l)=>s.jsx(Jj,{ref:l,className:Re("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),...a}));mr.displayName=Jj.displayName;const Il=h.forwardRef(({className:n,...a},l)=>s.jsx(Wj,{ref:l,className:Re("mt-2 ring-offset-background focus-visible:outline-none",n),...a}));Il.displayName=Wj.displayName;const E4=3e3,R4=1600,T4=10,A4=3,M4=12,D4=10*6e4;function O4(n,a){return{...n,totalRequests:n.totalRequests+1,successfulRequests:n.successfulRequests+(a.success?1:0),failedRequests:n.failedRequests+(a.success?0:1),successRate:n.totalRequests+1?(n.successfulRequests+(a.success?1:0))/(n.totalRequests+1):0,inputTokens:n.inputTokens+a.inputTokens,outputTokens:n.outputTokens+a.outputTokens,totalTokens:n.totalTokens+a.inputTokens+a.outputTokens,cacheReadTokens:n.cacheReadTokens+a.cacheReadTokens,averageLatencyMs:(n.averageLatencyMs*n.totalRequests+a.totalLatencyMs)/(n.totalRequests+1)}}function k4(n){const[a,l]=h.useState(null),[o,c]=h.useState(null),[u,f]=h.useState([]),[p,g]=h.useState([]),[v,x]=h.useState([]),[y,b]=h.useState([]),[w,N]=h.useState(!0),[S,C]=h.useState(null),R=h.useRef([]),D=h.useRef(null),A=h.useRef(new Set),M=h.useRef(Date.now()),O=h.useRef(0),E=h.useRef([]),_=h.useRef([]);return h.useEffect(()=>{let U=!1;return N(!0),C(null),A.current=new Set,M.current=Date.now(),ge.get(`/api/admin/stats?preset=${n}`).then($=>{if(!U){l($),c($.summary),D.current=$.summary,f($.recent),g($.providers),R.current=$.providers;for(const te of $.recent)A.current.add(te.id);N(!1)}}).catch($=>{U||(C($.message),N(!1))}),()=>{U=!0}},[n]),h.useEffect(()=>{let U=!1,$=null;const te=new Set,V=()=>{U||($=new EventSource(`/api/admin/requests/stream?since=${M.current}`),$.addEventListener("request",ae=>{if(!U)try{const ee=JSON.parse(ae.data),B=new Date(ee.createdAt).getTime();if(Number.isFinite(B)&&(M.current=Math.max(M.current,B)),A.current.has(ee.id))return;if(A.current.add(ee.id),D.current&&c(O4(D.current,ee)),f(k=>k.some(q=>q.id===ee.id)?k:[ee,...k].slice(0,T4)),ee.providerId){R.current=R.current.map(J=>J.id===ee.providerId?{...J,requests:J.requests+1,errorRate:J.requests+1?(J.errorRate*J.requests+(ee.success?0:1))/(J.requests+1):0}:J),g(R.current);const k=`p${++O.current}`,q={id:k,providerId:ee.providerId,success:ee.success};E.current=[...E.current.slice(-(A4*4)),q],x(E.current);const Z=setTimeout(()=>{E.current=E.current.filter(J=>J.id!==k),x(E.current)},R4);te.add(Z)}_.current.some(k=>k.id===ee.id)&&(_.current=_.current.filter(k=>k.id!==ee.id),b(_.current))}catch{}}),$.addEventListener("request_started",ae=>{if(!U)try{const ee=JSON.parse(ae.data);if(!ee.providerId||ee.providerId==="")return;_.current=[..._.current.filter(B=>B.id!==ee.requestId).slice(-(M4-1)),{id:ee.requestId,providerId:ee.providerId,startedAt:Date.now(),ttftMs:ee.ttftMs??0}],b(_.current)}catch{}}),$.onerror=()=>{$==null||$.close(),$=null,U||te.add(setTimeout(V,E4))})};V();const H=setInterval(()=>{const ae=Date.now()-D4;_.current.some(ee=>ee.startedAt<ae)&&(_.current=_.current.filter(ee=>ee.startedAt>=ae),b(_.current))},3e4);return()=>{U=!0,$==null||$.close();for(const ae of te)clearTimeout(ae);te.clear(),clearInterval(H)}},[]),h.useEffect(()=>{const U=setInterval(()=>{ge.get("/api/admin/providers").then($=>{const te=new Map($.providers.map(V=>[V.id,V]));R.current=R.current.map(V=>{const H=te.get(V.id);return H?{...V,health:H.health,enabled:H.enabled}:V}),g(R.current)}).catch(()=>{})},3e4);return()=>clearInterval(U)},[]),{snapshot:a,live:o??(a==null?void 0:a.summary)??_4,recent:u,providers:p,pulses:v,activeRoutes:y,loading:w,error:S}}const _4={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 tS({data:n,className:a,strokeClass:l="stroke-primary",fillClass:o}){if(n.length===0)return s.jsx("svg",{className:Re("h-6 w-20",a),viewBox:"0 0 80 24"});const f=Math.max(...n),p=Math.min(...n),g=f-p||1,x=n.map((y,b)=>{const w=b/(n.length-1)*78+1,N=22-(y-p)/g*20;return`${w.toFixed(1)},${N.toFixed(1)}`}).join(" ");return s.jsxs("svg",{className:Re("h-6 w-20",a),viewBox:"0 0 80 24",preserveAspectRatio:"none",children:[o&&s.jsx("polygon",{points:`1,23 ${x} 79,23`,className:o}),s.jsx("polyline",{points:x,fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:l})]})}function z4(n,a,l){const o=performance.now();let c=0;const u=f=>{const p=Math.min((f-o)/a,1),g=Math.round(n*p);g!==c&&(c=g,l(g)),p<1&&requestAnimationFrame(u)};requestAnimationFrame(u)}function L4({delta:n,inverse:a}){if(Math.abs(n)<.005)return null;const l=n>0,o=a?!l:l,c=`${(Math.abs(n)*100).toFixed(1)}%`;return s.jsxs("span",{className:Re("ml-1.5 inline-flex items-center rounded-full px-1.5 py-0.5 text-[10px] font-semibold leading-none",o?"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:l?"▲":"▼"}),c]})}function ns({icon:n,label:a,value:l,format:o="number",delta:c,deltaInverse:u,sparkData:f,sparkStroke:p}){const[g,v]=h.useState(0),x=h.useRef(0);h.useEffect(()=>{const b=x.current,w=l;x.current=l,b!==w&&z4(Math.abs(w-b),600,N=>v(b+(w>b?N:-N)))},[l]);const y=o==="percent"?Mu(g):o==="latency"?Ls(g):Xt(Math.round(g));return s.jsxs(rt,{children:[s.jsxs(st,{className:"flex flex-row items-center justify-between pb-1",children:[s.jsxs(lt,{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:[s.jsx(n,{className:"h-4 w-4"}),a]}),c!==void 0&&s.jsx(L4,{delta:c,inverse:u})]}),s.jsxs(ot,{className:"flex items-end justify-between",children:[s.jsx("span",{className:"text-2xl font-semibold tabular-nums",children:y}),f&&f.length>1&&s.jsx(tS,{data:f,strokeClass:p??"stroke-primary",fillClass:"fill-primary/10"})]})]})}const nS=1e3,Wb=380,Qc=60,as=nS/2,rs=720,Bh=62,U4=260;function I4(n){return n==="healthy"?"fill-emerald-400":n==="degraded"?"fill-amber-400":"fill-red-400"}function Zc(n,a,l,o){const c=n+(l-n)*.45,u=n+(l-n)*.55;return`M${n},${a} C${c},${a} ${u},${o} ${l},${o}`}function P4({liveRequests:n,successRate:a,providers:l,pulses:o,activeRoutes:c}){const u=Wb/2,f=u,p=Math.max(1,l.reduce((x,y)=>x+y.requests,0)),g=new Set(c.map(x=>x.providerId)),v=g.size>0;return s.jsxs(rt,{children:[s.jsx(st,{className:"pb-2",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(lt,{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(ot,{className:"pt-0",children:s.jsx("div",{className:"relative w-full",children:s.jsxs("svg",{viewBox:`0 0 ${nS} ${Wb}`,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"})]})]})}),l.map(x=>{const b=60+l.indexOf(x)*Bh,w=x.requests/p,N=Math.max(1.5,Math.min(6,2+w*8)),S=g.has(x.id);return s.jsxs("g",{children:[S&&s.jsx("path",{d:Zc(as,u,rs-20,b),fill:"none",stroke:"hsl(var(--primary) / 0.25)",strokeWidth:N+6,strokeLinecap:"round"}),s.jsx("path",{d:Zc(as,u,rs-20,b),fill:"none",stroke:S?"hsl(var(--primary))":"hsl(var(--border))",strokeWidth:S?N+1:N,strokeLinecap:"round",opacity:S?.95:.6,className:S?"route-active":void 0})]},x.id)}),s.jsx("path",{d:Zc(Qc+30,f,as-30,u),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}),o.map(x=>{const y=l.findIndex(S=>S.id===x.providerId);if(y===-1)return null;const b=60+y*Bh,w=Zc(as,u,rs-20,b),N=x.success?"var(--primary)":"#f87171";return s.jsxs("g",{filter:"url(#glow)",children:[s.jsx("circle",{r:5,fill:N,opacity:.9,children:s.jsx("animateMotion",{dur:"1.4s",fill:"freeze",path:w})}),s.jsx("circle",{r:9,fill:N,opacity:.25,children:s.jsx("animateMotion",{dur:"1.4s",fill:"freeze",path:w})})]},x.id)}),s.jsx("circle",{cx:Qc,cy:f,r:28,fill:"hsl(var(--card))",stroke:"hsl(var(--border))",strokeWidth:1.5}),s.jsx("text",{x:Qc,y:f-4,textAnchor:"middle",className:"fill-foreground",fontSize:12,fontWeight:600,children:e0(n)}),s.jsx("text",{x:Qc,y:f+10,textAnchor:"middle",className:"fill-muted-foreground",fontSize:9,children:"requests"}),s.jsx("circle",{cx:as,cy:u,r:36,fill:"hsl(var(--card))",stroke:"var(--primary)",strokeWidth:2}),s.jsx("image",{x:as-12,y:u-16,width:24,height:24,href:"/logo.png"}),s.jsx("text",{x:as,y:u+28,textAnchor:"middle",className:"fill-muted-foreground",fontSize:9,children:"AI Gateway"}),s.jsxs("text",{x:as,y:u+38,textAnchor:"middle",className:"fill-emerald-500",fontSize:10,fontWeight:600,children:[(a*100).toFixed(1),"%"]}),l.map((x,y)=>{const b=60+y*Bh,w=x.requests/p,N=!x.enabled||x.requests===0;return s.jsxs("g",{opacity:N?.4:1,children:[s.jsx("rect",{x:rs-20,y:b-14,width:U4,height:50,rx:8,fill:"hsl(var(--card))",stroke:"hsl(var(--border))",strokeWidth:1}),s.jsx("circle",{cx:rs-6,cy:b+10,r:4,className:I4(x.health)}),s.jsx("text",{x:rs+6,y:b-2,className:"fill-foreground",fontSize:12,fontWeight:500,children:x.name}),s.jsxs("text",{x:rs+6,y:b+12,className:"fill-muted-foreground",fontSize:10,children:[x.modelCount," model",x.modelCount!==1?"s":""," · ",e0(x.requests)," req"]}),s.jsxs("text",{x:rs+6,y:b+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 e0(n){return n>=1e6?`${(n/1e6).toFixed(1)}M`:n>=1e3?`${(n/1e3).toFixed(1)}K`:String(n)}function B4({rows:n}){return s.jsxs(rt,{children:[s.jsx(st,{className:"pb-2",children:s.jsx(lt,{className:"text-base",children:"Recent Requests"})}),s.jsx(ot,{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(Un,{children:[s.jsx(In,{children:s.jsxs(Be,{children:[s.jsx(ve,{children:"Model"}),s.jsx(ve,{children:"Provider"}),s.jsx(ve,{children:"Tokens"}),s.jsx(ve,{children:"Status"}),s.jsx(ve,{children:"Time"})]})}),s.jsx(Pn,{children:n.map(a=>s.jsxs(Be,{children:[s.jsx(fe,{className:"font-mono text-xs",children:a.requestedModel}),s.jsx(fe,{className:"text-xs text-muted-foreground",children:a.providerName??"—"}),s.jsxs(fe,{className:"text-xs",children:[s.jsxs("span",{className:"font-mono",children:["in ",Xt(a.inputTokens)," · out ",Xt(a.outputTokens)]}),a.cacheReadTokens>0&&s.jsxs("span",{className:"ml-1 text-amber-600",children:["(+",Xt(a.cacheReadTokens)," cache)"]})]}),s.jsx(fe,{children:s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[s.jsx("span",{className:a.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:a.success?a.httpStatus:`${a.httpStatus} err`})]})}),s.jsx(fe,{className:"text-xs text-muted-foreground",children:jR(a.createdAt)})]},a.id))})]})})]})}const bm=34,t0=2*Math.PI*bm;function H4(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 q4({successRate:n,averageLatencyMs:a,latencySpark:l}){const{stroke:o,text:c}=H4(n),u=Math.min(1,Math.max(0,n)),f=t0*(1-u);return s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.jsxs(rt,{children:[s.jsx(st,{className:"pb-2",children:s.jsx(lt,{className:"text-base",children:"Success Rate"})}),s.jsxs(ot,{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:bm,fill:"none",stroke:"hsl(var(--border))",strokeWidth:7}),s.jsx("circle",{cx:"40",cy:"40",r:bm,fill:"none",stroke:o,strokeWidth:7,strokeLinecap:"round",strokeDasharray:t0,strokeDashoffset:f,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 ${c}`,children:Mu(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(rt,{children:[s.jsx(st,{className:"pb-2",children:s.jsx(lt,{className:"text-base",children:"Average Latency"})}),s.jsxs(ot,{className:"flex items-end justify-between",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-2xl font-semibold tabular-nums",children:Ls(a)}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Live average across the selected window"})]}),s.jsx(tS,{data:l,strokeClass:"stroke-amber-500",fillClass:"fill-amber-500/10",className:"h-10 w-28"})]})]})]})}function $4(){const[n,a]=h.useState("7d"),{snapshot:l,live:o,recent:c,providers:u,pulses:f,activeRoutes:p,loading:g,error:v}=k4(n);if(g)return s.jsx("div",{className:"text-muted-foreground",children:"Loading…"});if(v||!l)return s.jsxs("div",{className:"text-destructive",children:["Failed to load statistics: ",v??"unknown error"]});const x=o,y=l.previous,b=l.series;function w(C,R){return R>0?(C-R)/R:void 0}const N=b.map(C=>C.requests),S=b.map(C=>C.avgLatency);return s.jsxs("div",{children:[s.jsx(Va,{title:"Statistics",description:"Real-time monitoring dashboard",actions:s.jsx(eS,{value:n,onValueChange:C=>void a(C),children:s.jsxs(Fp,{children:[s.jsx(mr,{value:"today",children:"Today"}),s.jsx(mr,{value:"7d",children:"7 days"}),s.jsx(mr,{value:"30d",children:"30 days"})]})})}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[s.jsx(ns,{icon:M0,label:"Requests",value:x.totalRequests,delta:w(x.totalRequests,y.totalRequests),sparkData:N}),s.jsx(ns,{icon:Tu,label:"Success rate",format:"percent",value:x.successRate,delta:w(x.successRate,y.successRate),sparkData:N,sparkStroke:"stroke-emerald-500"}),s.jsx(ns,{icon:yE,label:"Total tokens",value:x.totalTokens,delta:w(x.totalTokens,y.totalTokens),sparkData:b.map(C=>C.inputTokens+C.outputTokens)}),s.jsx(ns,{icon:bE,label:"Cache hit rate",format:"percent",value:x.cacheHitRate,delta:w(x.cacheHitRate,y.cacheHitRate),sparkData:b.map(C=>C.cacheRead)}),s.jsx(ns,{icon:gE,label:"Avg latency",format:"latency",value:x.averageLatencyMs,delta:w(x.averageLatencyMs,y.averageLatencyMs),deltaInverse:!0,sparkData:S,sparkStroke:"stroke-amber-500"}),s.jsx(ns,{icon:k0,label:"p95 latency",format:"latency",value:x.p95LatencyMs}),s.jsx(ns,{icon:PE,label:"Avg TTFT",format:"latency",value:x.averageTtftMs??0}),s.jsx(ns,{icon:OE,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(P4,{liveRequests:x.totalRequests,successRate:x.successRate,providers:u,pulses:f,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(B4,{rows:c})}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs(rt,{children:[s.jsx(st,{className:"pb-2",children:s.jsx(lt,{className:"text-base",children:"Top Models"})}),s.jsx(ot,{children:s.jsxs(Un,{children:[s.jsx(In,{children:s.jsxs(Be,{children:[s.jsx(ve,{children:"Model"}),s.jsx(ve,{children:"Req"}),s.jsx(ve,{children:"Errors"}),s.jsx(ve,{children:"Tokens"})]})}),s.jsxs(Pn,{children:[l.topModels.length===0&&s.jsx(Be,{children:s.jsx(fe,{colSpan:4,className:"text-muted-foreground text-center",children:"No data"})}),l.topModels.map(C=>s.jsxs(Be,{children:[s.jsx(fe,{className:"font-mono text-xs",children:C.publicId}),s.jsx(fe,{className:"text-xs",children:Xt(C.requests)}),s.jsx(fe,{className:"text-xs",children:s.jsx("span",{className:C.errorRate>.1?"text-destructive":"text-muted-foreground",children:Mu(C.errorRate)})}),s.jsx(fe,{className:"text-xs",children:Xt(C.totalTokens)})]},C.publicId))]})]})})]}),s.jsxs(rt,{children:[s.jsx(st,{className:"pb-2",children:s.jsx(lt,{className:"text-base",children:"Top API Keys"})}),s.jsx(ot,{children:s.jsxs(Un,{children:[s.jsx(In,{children:s.jsxs(Be,{children:[s.jsx(ve,{children:"Key"}),s.jsx(ve,{children:"Requests"}),s.jsx(ve,{children:"Tokens"})]})}),s.jsxs(Pn,{children:[l.topApiKeys.length===0&&s.jsx(Be,{children:s.jsx(fe,{colSpan:3,className:"text-muted-foreground text-center",children:"No data"})}),l.topApiKeys.map((C,R)=>s.jsxs(Be,{children:[s.jsx(fe,{className:"text-xs",children:C.name}),s.jsx(fe,{className:"text-xs",children:Xt(C.requests)}),s.jsx(fe,{className:"text-xs",children:Xt(C.totalTokens)})]},R))]})]})})]})]})]}),s.jsx("div",{className:"mt-6",children:s.jsx(q4,{successRate:x.successRate,averageLatencyMs:x.averageLatencyMs,latencySpark:S})})]})}function V4(){const[n,a]=h.useState([]),[l,o]=h.useState(0);return h.useEffect(()=>{ge.get("/api/admin/audit?limit=200").then(c=>{a(c.rows),o(c.total)})},[]),s.jsxs("div",{children:[s.jsx(Va,{title:"Audit Logs",description:`${l} entries · immutable`}),s.jsxs(rt,{children:[s.jsx(st,{children:s.jsx(lt,{className:"text-base",children:"All entries"})}),s.jsx(ot,{children:s.jsxs(Un,{children:[s.jsx(In,{children:s.jsxs(Be,{children:[s.jsx(ve,{children:"Time"}),s.jsx(ve,{children:"Action"}),s.jsx(ve,{children:"Status"}),s.jsx(ve,{children:"Target"}),s.jsx(ve,{children:"IP"}),s.jsx(ve,{children:"Actor"})]})}),s.jsxs(Pn,{children:[n.length===0&&s.jsx(Be,{children:s.jsx(fe,{colSpan:6,className:"text-center text-muted-foreground",children:"No audit events yet."})}),n.map(c=>s.jsxs(Be,{children:[s.jsx(fe,{className:"text-xs",children:$m(c.createdAt)}),s.jsx(fe,{className:"font-mono text-xs",children:c.action}),s.jsx(fe,{children:c.success?s.jsx(We,{variant:"success",children:"ok"}):s.jsx(We,{variant:"destructive",children:"fail"})}),s.jsx(fe,{className:"text-xs",children:c.targetName??c.targetId??"—"}),s.jsx(fe,{className:"text-xs",children:c.ip}),s.jsx(fe,{className:"text-xs",children:c.actor})]},c.id))]})]})})]})]})}const wm={enabled:!0,sound:!0};let hi=wm,jm=!1,Jc=null;const Sm=new Set;function aS(){for(const n of Sm)n()}function rS(n=!1){return jm&&!n?Promise.resolve():(!n&&Jc||(Jc=(async()=>{try{const a=await ge.get("/api/admin/settings");hi={enabled:a.settings.notificationsEnabled??wm.enabled,sound:a.settings.notificationSoundEnabled??wm.sound},jm=!0,aS()}catch{}})()),Jc)}async function n0(n){const a={};n.enabled!==void 0&&(a.notificationsEnabled=n.enabled),n.sound!==void 0&&(a.notificationSoundEnabled=n.sound),await ge.patch("/api/admin/settings",a),hi={...hi,...n},jm=!0,aS()}function Y4(n){return Sm.add(n),()=>Sm.delete(n)}function sS(){return h.useSyncExternalStore(Y4,()=>hi,()=>hi)}function G4(){const[n]=eE(),[a,l]=h.useState(null),[o,c]=h.useState(null),[u,f]=h.useState({current:"",next:""}),[p,g]=h.useState(""),[v,x]=h.useState(""),[y,b]=h.useState(null),[w,N]=h.useState(!1),[S,C]=h.useState("idle"),[R,D]=h.useState(null),A=async(ce=!1)=>{C("checking"),D(null);try{const Le=await ge.get(`/api/admin/update/check${ce?"?force=1":""}`);b(Le),C("idle")}catch(Le){D(Le.message),C("error")}},M=async()=>{N(!0),C("installing"),D(null);try{const ce=await ge.post("/api/admin/update/run");C("restarting"),de.success(ce.message||"Update started — the gateway will restart shortly.");const Le=setInterval(()=>{fetch("/health").then(qe=>{qe.ok&&(clearInterval(Le),window.location.reload())}).catch(()=>{})},3e3);setTimeout(()=>clearInterval(Le),12e4)}catch(ce){de.error(ce.message),D(ce.message),C("error")}finally{N(!1)}},[O,E]=h.useState("disabled"),[_,U]=h.useState(""),[$,te]=h.useState(""),[V,H]=h.useState(""),[ae,ee]=h.useState([]),[B,k]=h.useState(""),[q,Z]=h.useState(""),[J,ne]=h.useState(!1),[z,L]=h.useState(null),[F,se]=h.useState(""),[pe,ye]=h.useState(""),[G,ue]=h.useState(""),he=async()=>{const ce=await ge.get("/api/admin/settings");l(ce.settings),g(ce.settings.adminIpAllow??""),x(ce.settings.adminIpBlock??"");const Le=await ge.get("/api/admin/settings/system");c(Le);try{const qe=await ge.get("/api/admin/me");E(qe.totpEnabled?"enabled":"disabled")}catch{}};if(h.useEffect(()=>{rS(!0)},[]),h.useEffect(()=>{he(),A(!0)},[]),!a)return s.jsx("div",{className:"text-muted-foreground",children:"Loading…"});const xe=async ce=>{try{await ge.patch("/api/admin/settings",ce),de.success("Saved"),he()}catch(Le){de.error(Le.message)}},Ae=async()=>{try{const ce=await ge.post("/api/admin/account/totp/begin");U(ce.secret),te(ce.qr),E("setup"),de.info("Scan the QR code with your authenticator app")}catch(ce){de.error(ce.message)}},Ne=async()=>{if(!V||V.length!==6){de.error("Enter a 6-digit code");return}try{const ce=await ge.post("/api/admin/account/totp/verify",{code:V});ee(ce.recoveryCodes),E("showingRecovery"),de.success("TOTP enabled successfully")}catch(ce){de.error(ce.message)}},Oe=async()=>{if(!B){de.error("Enter your password");return}if(!q){de.error("Enter a TOTP code or recovery code");return}try{await ge.post("/api/admin/account/totp/disable",{password:B,totp:q}),E("disabled"),k(""),Z(""),de.success("TOTP disabled"),he()}catch(ce){de.error(ce.message)}},Qe=async()=>{ne(!0);try{const ce=await ge.post("/api/admin/account/totp/recovery/regenerate",{password:B,totp:q});ee(ce.recoveryCodes),E("showingRecovery"),de.success("Recovery codes regenerated")}catch(ce){de.error(ce.message)}ne(!1)},et=n.get("tab")||"logging";return s.jsxs("div",{children:[s.jsx(Va,{title:"Settings",description:"Logging, security, backup, and system info"}),s.jsxs(eS,{defaultValue:et,children:[s.jsxs(Fp,{children:[s.jsx(mr,{value:"logging",children:"Logging"}),s.jsx(mr,{value:"access",children:"Access Control"}),s.jsx(mr,{value:"security",children:"Security"}),s.jsx(mr,{value:"backup",children:"Backup"}),s.jsx(mr,{value:"system",children:"System"})]}),s.jsx(Il,{value:"logging",children:s.jsxs(rt,{children:[s.jsx(st,{children:s.jsx(lt,{className:"text-base",children:"Logging policy"})}),s.jsxs(ot,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Request-content logging"}),s.jsxs(zn,{value:a.contentLogMode,onValueChange:ce=>xe({contentLogMode:ce}),children:[s.jsx(jn,{children:s.jsx(Ln,{})}),s.jsxs(Sn,{children:[s.jsx(nt,{value:"off",children:"Off"}),s.jsx(nt,{value:"metadata",children:"Metadata only (default)"}),s.jsx(nt,{value:"prompt",children:"Prompt (sanitized)"}),s.jsx(nt,{value:"prompt_and_response",children:"Prompt + response (sanitized)"})]})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Retention (days)"}),s.jsx(Ce,{type:"number",min:1,max:3650,value:a.retentionDays,onChange:ce=>xe({retentionDays:Number(ce.target.value)})})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Database size limit (MB)"}),s.jsx(Ce,{type:"number",min:64,value:a.dbSizeLimitMb,onChange:ce=>xe({dbSizeLimitMb:Number(ce.target.value)})})]}),s.jsx("div",{className:"flex items-center gap-2 pt-2",children:s.jsx(ie,{onClick:async()=>{const ce=await ge.post("/api/admin/settings/cleanup");de.success(`Deleted ${ce.deletedRequests} old requests`)},children:"Run cleanup now"})})]})]})}),s.jsx(Il,{value:"access",children:s.jsxs(rt,{children:[s.jsxs(st,{children:[s.jsx(lt,{className:"text-base",children:"IP access control"}),s.jsx(kn,{children:"Allowlist / Blocklist for this admin website (not model traffic)"})]}),s.jsxs(ot,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(be,{children:"Allow only these IPs"}),s.jsx(fi,{placeholder:`192.168.1.0/24
|
|
391
|
-
10.0.0.1`,value:p,onChange:ce=>g(ce.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(be,{children:"Block these IPs"}),s.jsx(fi,{placeholder:"192.168.1.100",value:v,onChange:ce=>x(ce.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(ie,{onClick:()=>{const ce={};p!==((a==null?void 0:a.adminIpAllow)??"")&&(ce.adminIpAllow=p||null),v!==((a==null?void 0:a.adminIpBlock)??"")&&(ce.adminIpBlock=v||null),ge.patch("/api/admin/settings",ce).then(Le=>{de.success("Saved"+(Le.addedIp?` — added your IP: ${Le.addedIp}`:"")),he(),g(""),x("")}).catch(Le=>de.error(Le.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(Il,{value:"security",children:s.jsxs(rt,{children:[s.jsxs(st,{children:[s.jsx(lt,{className:"text-base",children:"Security"}),s.jsx(kn,{children:"Change password, 2FA, and trusted proxy configuration"})]}),s.jsxs(ot,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(be,{children:"Trusted proxy hops"}),s.jsx(Ce,{type:"number",min:0,max:8,value:a.trustProxyHops,onChange:ce=>xe({trustProxyHops:Number(ce.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(be,{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(ie,{variant:"outline",onClick:Ae,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."}),$&&s.jsx("img",{src:$,alt:"TOTP QR code",className:"h-40 w-40"}),s.jsxs("div",{className:"text-xs font-mono text-muted-foreground",children:["Secret: ",_]}),s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(be,{children:"Verify code"}),s.jsx(Ce,{value:V,onChange:ce=>H(ce.target.value),placeholder:"123456",maxLength:6})]}),s.jsx(ie,{disabled:V.length<6,onClick:Ne,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:ae.map((ce,Le)=>s.jsx("div",{className:"font-mono text-xs",children:ce},Le))}),s.jsx(ie,{onClick:()=>{E("enabled"),de.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(be,{children:"Password"}),s.jsx(Ce,{type:"password",value:B,onChange:ce=>k(ce.target.value),placeholder:"Current password"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"TOTP code"}),s.jsx(Ce,{value:q,onChange:ce=>Z(ce.target.value),placeholder:"123456",maxLength:6})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ie,{variant:"outline",size:"sm",disabled:J||!B||q.length<6,onClick:Qe,children:"Regenerate recovery codes"}),s.jsx(ie,{variant:"destructive",size:"sm",disabled:!B||q.length<6,onClick:Oe,children:"Disable TOTP"})]})]})]}),s.jsxs("div",{className:"space-y-2 border-t pt-4",children:[s.jsx(be,{children:"Change password"}),s.jsx(Ce,{type:"password",placeholder:"Current password",value:u.current,onChange:ce=>f({...u,current:ce.target.value})}),s.jsx(Ce,{type:"password",placeholder:"New password (12+ chars)",value:u.next,onChange:ce=>f({...u,next:ce.target.value})}),s.jsx(ie,{disabled:!u.current||u.next.length<12,onClick:async()=>{try{await ge.post("/api/admin/account/password",{currentPassword:u.current,newPassword:u.next}),de.success("Password changed"),f({current:"",next:""})}catch(ce){de.error(ce.message)}},children:"Change password"})]})]})]})}),s.jsx(Il,{value:"backup",children:s.jsxs(rt,{children:[s.jsxs(st,{children:[s.jsx(lt,{className:"text-base",children:"Backup & restore"}),s.jsx(kn,{children:"Download a snapshot or restore from a previous backup"})]}),s.jsxs(ot,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-2 rounded border p-3",children:[s.jsx(be,{children:"Backup passphrase (6 digits)"}),s.jsx(Ce,{inputMode:"numeric",maxLength:6,value:F,onChange:ce=>se(ce.target.value.replace(/\D/g,"")),placeholder:"123456"}),s.jsx(Ce,{inputMode:"numeric",maxLength:6,value:pe,onChange:ce=>ye(ce.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(ie,{disabled:F.length!==6||F!==pe,onClick:async()=>{try{const ce=await du("/api/admin/backup/create",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({passphrase:F})});if(!ce.ok)throw new Error("Backup failed");const Le=await ce.blob(),qe=URL.createObjectURL(Le),_t=document.createElement("a");_t.href=qe,_t.download="latedev-backup.json",_t.click(),URL.revokeObjectURL(qe),de.success("Backup downloaded"),se(""),ye("")}catch(ce){de.error(ce.message)}},children:"Download backup"}),s.jsxs("div",{className:"space-y-2 rounded border p-3",children:[s.jsx(be,{children:"Backup passphrase for restore"}),s.jsx(Ce,{inputMode:"numeric",maxLength:6,value:G,onChange:ce=>ue(ce.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($w,{open:z!==null,onOpenChange:ce=>{ce||L(null)},children:[s.jsx(UO,{asChild:!0,children:s.jsxs("div",{children:[s.jsx(be,{children:"Restore from backup file"}),s.jsx(Ce,{type:"file",accept:".json,application/json","data-testid":"restore-file",onChange:ce=>{var qe;const Le=(qe=ce.target.files)==null?void 0:qe[0];L(Le??null)}})]})}),s.jsxs(yp,{children:[s.jsxs(Yw,{children:[s.jsx(bp,{children:"Restore backup?"}),s.jsxs(wp,{children:["Restoring will replace the entire current database with the selected backup (",(z==null?void 0:z.name)??"file","). This cannot be undone. A snapshot of the current database is kept for rollback only if validation fails."]})]}),s.jsxs(Gw,{children:[s.jsx(Sp,{children:"Cancel"}),s.jsx(jp,{onClick:async()=>{var Le,qe;const ce=z;if(ce)try{const _t=JSON.parse(await ce.text()),St=await du("/api/admin/backup/restore",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({backup:_t,passphrase:G})});if(!St.ok)throw new Error(((qe=(Le=await St.json())==null?void 0:Le.error)==null?void 0:qe.message)??"Restore failed");de.success("Restored. Reloading…"),L(null),setTimeout(()=>location.reload(),600)}catch(_t){de.error(_t.message)}},children:"Restore"})]})]})]})]})]})}),s.jsxs(Il,{value:"system",children:[s.jsxs(rt,{children:[s.jsx(st,{children:s.jsx(lt,{className:"text-base",children:"System"})}),s.jsxs(ot,{className:"space-y-2 text-sm",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"App version:"})," ",o==null?void 0:o.appVersion]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Data directory:"})," ",s.jsx("span",{className:"font-mono",children:o==null?void 0:o.dataDir})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Encryption:"})," ",o!=null&&o.masterKeyConfigured?"Configured":"Not configured"," (v",o==null?void 0:o.masterKeyVersion,")"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Environment:"})," ",o==null?void 0:o.environment]}),s.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[s.jsx(Ha,{checked:a.gatewayCacheEnabled,onCheckedChange:ce=>xe({gatewayCacheEnabled:ce})}),s.jsx(be,{children:"Gateway response cache (disabled by default)"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Cache TTL (s)"}),s.jsx(Ce,{type:"number",min:1,value:a.gatewayCacheDefaultTtlSeconds,onChange:ce=>xe({gatewayCacheDefaultTtlSeconds:Number(ce.target.value)})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Cache max size (MB)"}),s.jsx(Ce,{type:"number",min:1,value:a.gatewayCacheMaxSizeMb,onChange:ce=>xe({gatewayCacheMaxSizeMb:Number(ce.target.value)})})]})]}),s.jsx(ie,{variant:"outline",onClick:async()=>{const ce=await ge.post("/api/admin/settings/cache/clear");de.success(`Cleared ${ce.deleted} entries`)},children:"Clear gateway cache"})]})]}),s.jsx(F4,{}),s.jsxs(rt,{className:"mt-4",children:[s.jsxs(st,{children:[s.jsx(lt,{className:"text-base",children:"Updates"}),s.jsx(kn,{children:"Automatic updates from the npm registry"})]}),s.jsxs(ot,{className:"space-y-3 text-sm",children:[S==="checking"&&!y&&s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(pr,{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(We,{variant:"secondary",children:y.status.watchtower?"Docker + Watchtower":"Docker"}):y.latestVersion===null?s.jsx(We,{variant:"secondary",children:"Registry unreachable"}):y.hasUpdate?s.jsx(We,{variant:"success",children:"Update available"}):s.jsxs(We,{variant:"outline",children:[s.jsx(Tu,{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})]}),S==="installing"&&s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(pr,{className:"h-4 w-4 animate-spin"})," Applying the update… this can take a minute."]}),S==="restarting"&&s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(pr,{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&&S==="idle"&&(!y.status.docker||y.status.watchtower&&y.watchtowerReachable!==!1)&&s.jsxs(ie,{disabled:w||y.status.docker&&y.watchtowerReachable===!1,onClick:M,children:[s.jsx(Pm,{className:"mr-1 h-4 w-4"})," Update now"]}),y.hasUpdate&&y.changelogUrl&&s.jsx(ie,{variant:"outline",asChild:!0,children:s.jsx("a",{href:y.changelogUrl,target:"_blank",rel:"noreferrer",children:"View changes"})}),S==="idle"&&s.jsx(ie,{variant:"ghost",disabled:w,onClick:()=>A(!0),children:"Check again"})]})]})]})]})]})]})]})}function F4(){const n=sS();return s.jsxs(rt,{className:"mt-4",children:[s.jsx(st,{children:s.jsxs(lt,{className:"text-base flex items-center gap-2",children:[s.jsx(fE,{className:"h-4 w-4"})," Notifications"]})}),s.jsxs(ot,{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(Ha,{checked:n.enabled,onCheckedChange:a=>void n0({enabled:a})})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(HE,{className:"h-3 w-3"})," Play notification sound"]}),s.jsx(Ha,{checked:n.sound,onCheckedChange:a=>void n0({sound:a})})]}),s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Notifications are disabled while muted. Changes apply immediately."})]})]})}function X4({items:n,onDismiss:a}){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(l=>{const o=!l.success,c=l.success&&l.totalLatencyMs>15e3,u=Re("rounded-md border shadow-lg transition-all",o&&"bg-destructive text-destructive-foreground border-destructive",c&&"bg-amber-500/90 text-amber-950 border-amber-600/50",!o&&!c&&"bg-card text-card-foreground border-border");return s.jsxs(_s,{to:"/requests",className:Re("block shrink-0 p-3 hover:opacity-95",u),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:[o?s.jsx(pE,{className:"h-4 w-4 shrink-0"}):l.success?s.jsx(Tu,{className:"h-4 w-4 shrink-0"}):s.jsx(qE,{className:"h-4 w-4 shrink-0 opacity-70"}),s.jsx("div",{className:"min-w-0 truncate text-sm font-medium",title:l.requestedModel,children:l.requestedModel})]}),s.jsx("button",{className:"shrink-0 opacity-60 hover:opacity-100",onClick:f=>{f.preventDefault(),f.stopPropagation(),a(l.id)},"aria-label":"Dismiss",type:"button",children:s.jsx(Au,{className:"h-3.5 w-3.5"})})]}),s.jsxs("div",{className:"mt-1 text-xs",children:[l.success?"Thành công":"Thất bại",!l.success&&l.errorType&&s.jsx("span",{className:"ml-1 inline-block rounded bg-black/15 px-1 py-0.5 align-text-bottom text-[10px]",children:l.errorType})]}),s.jsxs("div",{className:"mt-1 text-[11px] opacity-90",children:["in ",Xt(l.inputTokens)," · out ",Xt(l.outputTokens),(l.cacheReadTokens>0||l.cacheWriteTokens>0)&&s.jsxs(s.Fragment,{children:[" · cache ",l.cacheReadTokens>0&&s.jsxs("span",{children:["r",Xt(l.cacheReadTokens)]}),l.cacheReadTokens>0&&l.cacheWriteTokens>0&&"/",l.cacheWriteTokens>0&&s.jsxs("span",{children:["w",Xt(l.cacheWriteTokens)]})]})]}),s.jsxs("div",{className:"mt-1 text-[11px] opacity-90",children:[Ls(l.totalLatencyMs),l.ttftMs!=null&&l.ttftMs>=0&&s.jsxs("span",{children:[" · TTFT ",Ls(l.ttftMs)]})]})]},l.id)})}):null}const K4=5e3,Q4=8,Z4=3e3;let Wc=null;function J4(){try{Wc||(Wc=new Audio("/notification.mp3")),Wc.currentTime=0,Wc.play().catch(()=>{})}catch{}}function W4(){const[n,a]=h.useState([]),l=h.useRef(null),o=h.useRef(new Map),c=h.useRef(Date.now()),u=h.useRef(new Set),f=sS(),p=h.useRef(f.sound);p.current=f.sound,h.useEffect(()=>{rS()},[]);const g=f.enabled;return h.useEffect(()=>{var w;if(!g){(w=l.current)==null||w.close(),l.current=null;const N=o.current;for(const S of N.values())clearTimeout(S);N.clear(),a([]);return}let x=!1;const y=o.current,b=()=>{if(x)return;const N=new EventSource(`/api/admin/requests/stream?since=${c.current}`);l.current=N,N.addEventListener("request",S=>{if(!x)try{const C=JSON.parse(S.data),R=new Date(C.createdAt).getTime();if(Number.isFinite(R)&&(c.current=Math.max(c.current,R)),u.current.has(C.id))return;u.current.add(C.id),a(A=>A.some(M=>M.id===C.id)?A:[C,...A].slice(0,Q4));const D=setTimeout(()=>{a(A=>A.filter(M=>M.id!==C.id)),y.delete(C.id)},K4);y.set(C.id,D),p.current&&J4()}catch{}}),N.onerror=()=>{N.close(),l.current=null,x||setTimeout(b,Z4)}};return b(),()=>{var N;x=!0,(N=l.current)==null||N.close(),l.current=null;for(const S of y.values())clearTimeout(S);y.clear()}},[g]),{items:n,dismiss:x=>{const y=o.current.get(x);y&&(clearTimeout(y),o.current.delete(x)),a(b=>b.filter(w=>w.id!==x))}}}function e5({children:n}){const{user:a,loading:l}=Lm(),o=Bn();return l?s.jsx("div",{className:"flex h-screen items-center justify-center text-muted-foreground",children:"Loading…"}):a?s.jsx(s.Fragment,{children:n}):s.jsx(qh,{to:"/login",state:{from:o},replace:!0})}function t5(){const{items:n,dismiss:a}=W4();return s.jsxs("div",{className:"flex h-screen bg-background text-foreground",children:[s.jsx(CR,{}),s.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[s.jsx(ND,{}),s.jsx("main",{className:"flex-1 overflow-auto p-6",children:s.jsxs(j0,{children:[s.jsx(Dn,{index:!0,element:s.jsx(sO,{})}),s.jsx(Dn,{path:"/providers",element:s.jsx(r4,{})}),s.jsx(Dn,{path:"/models",element:s.jsx(i4,{})}),s.jsx(Dn,{path:"/combos",element:s.jsx(c4,{})}),s.jsx(Dn,{path:"/aliases",element:s.jsx(u4,{})}),s.jsx(Dn,{path:"/api-keys",element:s.jsx(d4,{})}),s.jsx(Dn,{path:"/requests",element:s.jsx(m4,{})}),s.jsx(Dn,{path:"/statistics",element:s.jsx($4,{})}),s.jsx(Dn,{path:"/audit",element:s.jsx(V4,{})}),s.jsx(Dn,{path:"/settings/*",element:s.jsx(G4,{})})]})})]}),s.jsx(X4,{items:n,onDismiss:a})]})}function n5({children:n}){const[a,l]=h.useState(null),o=Bn();return h.useEffect(()=>{ge.get("/api/admin/setup/status").then(c=>l(c.setupComplete)).catch(()=>l(!0))},[]),a===null?s.jsx("div",{className:"flex h-screen items-center justify-center text-muted-foreground",children:"Loading…"}):!a&&o.pathname!=="/setup"?s.jsx(qh,{to:"/setup",replace:!0}):a&&o.pathname==="/setup"?s.jsx(qh,{to:"/",replace:!0}):s.jsx(s.Fragment,{children:n})}function a5(){return s.jsx(oE,{children:s.jsx(n5,{children:s.jsxs(j0,{children:[s.jsx(Dn,{path:"/setup",element:s.jsx(aO,{})}),s.jsx(Dn,{path:"/login",element:s.jsx(nO,{})}),s.jsx(Dn,{path:"/*",element:s.jsx(e5,{children:s.jsx(t5,{})})})]})})})}const r5=tO;R2.createRoot(document.getElementById("root")).render(s.jsx(me.StrictMode,{children:s.jsx(kR,{defaultTheme:"dark",storageKey:"latedev-theme",children:s.jsxs(Kj,{children:[s.jsx(QN,{children:s.jsx(a5,{})}),s.jsx(r5,{position:"top-right"})]})})}));
|