ldrouter 1.16.3 → 1.16.5

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.
Files changed (33) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/README.md +23 -1
  3. package/dist/server/app.js +10 -1
  4. package/dist/server/auth/middleware.js +37 -1
  5. package/dist/server/db/index.js +5 -0
  6. package/dist/server/db/migrate.js +38 -5
  7. package/dist/server/db/repositories/codex-accounts.js +187 -0
  8. package/dist/server/db/schema.js +44 -3
  9. package/dist/server/gateway/runner.js +76 -11
  10. package/dist/server/providers/codex-autostart.js +98 -0
  11. package/dist/server/providers/codex-import.js +156 -0
  12. package/dist/server/providers/codex-oauth.js +77 -0
  13. package/dist/server/providers/codex-refresh.js +165 -0
  14. package/dist/server/providers/codex-usage.js +192 -0
  15. package/dist/server/providers/codex.js +186 -0
  16. package/dist/server/providers/index.js +5 -0
  17. package/dist/server/routes/admin/auth.js +4 -1
  18. package/dist/server/routes/admin/codex.js +331 -0
  19. package/dist/server/routes/admin/models.js +20 -3
  20. package/dist/server/routes/admin/providers.js +63 -20
  21. package/dist/server/routes/admin/requests.js +1 -0
  22. package/dist/server/routes/admin.js +12 -0
  23. package/dist/server/routing/capabilities.js +1 -0
  24. package/dist/server/routing/combo.js +20 -12
  25. package/dist/server/upstream/client.js +54 -38
  26. package/dist/web/assets/index-CkDJqDcS.js +391 -0
  27. package/dist/web/assets/index-Drmqi8MO.css +1 -0
  28. package/dist/web/index.html +2 -2
  29. package/migrations/0005_codex_accounts.sql +105 -0
  30. package/migrations/0006_codex_usage.sql +9 -0
  31. package/package.json +5 -1
  32. package/dist/web/assets/index-C5h2WXK5.css +0 -1
  33. package/dist/web/assets/index-CRnoua24.js +0 -335
@@ -0,0 +1,391 @@
1
+ var ky=n=>{throw TypeError(n)};var _y=(n,a,l)=>a.has(n)||ky("Cannot "+l);var pn=(n,a,l)=>(_y(n,a,"read from private field"),l?l.call(n):a.get(n)),zy=(n,a,l)=>a.has(n)?ky("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(n):a.set(n,l),lh=(n,a,l,o)=>(_y(n,a,"write to private field"),o?o.call(n,l):a.set(n,l),l);function a2(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 xm(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var sh={exports:{}},Xo={};/**
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 Ly;function r2(){if(Ly)return Xo;Ly=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 Xo.Fragment=a,Xo.jsx=l,Xo.jsxs=l,Xo}var Uy;function l2(){return Uy||(Uy=1,sh.exports=r2()),sh.exports}var s=l2(),oh={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 Iy;function s2(){if(Iy)return ke;Iy=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 E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,C={};function R(z,P,Z){this.props=z,this.context=P,this.refs=C,this.updater=Z||E}R.prototype.isReactComponent={},R.prototype.setState=function(z,P){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,P,"setState")},R.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function D(){}D.prototype=R.prototype;function A(z,P,Z){this.props=z,this.context=P,this.refs=C,this.updater=Z||E}var M=A.prototype=new D;M.constructor=A,j(M,R.prototype),M.isPureReactComponent=!0;var O=Array.isArray;function N(){}var k={H:null,A:null,T:null,S:null},U=Object.prototype.hasOwnProperty;function V(z,P,Z){var se=Z.ref;return{$$typeof:n,type:z,key:P,ref:se!==void 0?se:null,props:Z}}function te(z,P){return V(z.type,P,z.props)}function $(z){return typeof z=="object"&&z!==null&&z.$$typeof===n}function H(z){var P={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(Z){return P[Z]})}var I=/\/+/g;function Q(z,P){return typeof z=="object"&&z!==null&&z.key!=null?H(""+z.key):P.toString(36)}function de(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(N,N):(z.status="pending",z.then(function(P){z.status==="pending"&&(z.status="fulfilled",z.value=P)},function(P){z.status==="pending"&&(z.status="rejected",z.reason=P)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function _(z,P,Z,se,ge){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,_(G(z._payload),P,Z,se,ge)}}if(G)return ge=ge(z),G=se===""?"."+Q(z,0):se,O(ge)?(Z="",G!=null&&(Z=G.replace(I,"$&/")+"/"),_(ge,P,Z,"",function(pe){return pe})):ge!=null&&($(ge)&&(ge=te(ge,Z+(ge.key==null||z&&z.key===ge.key?"":(""+ge.key).replace(I,"$&/")+"/")+G)),P.push(ge)),1;G=0;var ie=se===""?".":se+":";if(O(z))for(var he=0;he<z.length;he++)se=z[he],ye=ie+Q(se,he),G+=_(se,P,Z,ye,ge);else if(he=w(z),typeof he=="function")for(z=he.call(z),he=0;!(se=z.next()).done;)se=se.value,ye=ie+Q(se,he++),G+=_(se,P,Z,ye,ge);else if(ye==="object"){if(typeof z.then=="function")return _(de(z),P,Z,se,ge);throw P=String(z),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return G}function q(z,P,Z){if(z==null)return z;var se=[],ge=0;return _(z,se,"","",function(ye){return P.call(Z,ye,ge++)}),se}function ee(z){if(z._status===-1){var P=z._result;P=P(),P.then(function(Z){(z._status===0||z._status===-1)&&(z._status=1,z._result=Z)},function(Z){(z._status===0||z._status===-1)&&(z._status=2,z._result=Z)}),z._status===-1&&(z._status=0,z._result=P)}if(z._status===1)return z._result.default;throw z._result}var W=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=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(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)},ne={map:q,forEach:function(z,P,Z){q(z,function(){P.apply(this,arguments)},Z)},count:function(z){var P=0;return q(z,function(){P++}),P},toArray:function(z){return q(z,function(P){return P})||[]},only:function(z){if(!$(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=k,ke.__COMPILER_RUNTIME={__proto__:null,c:function(z){return k.H.useMemoCache(z)}},ke.cache=function(z){return function(){return z.apply(null,arguments)}},ke.cacheSignal=function(){return null},ke.cloneElement=function(z,P,Z){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var se=j({},z.props),ge=z.key;if(P!=null)for(ye in P.key!==void 0&&(ge=""+P.key),P)!U.call(P,ye)||ye==="key"||ye==="__self"||ye==="__source"||ye==="ref"&&P.ref===void 0||(se[ye]=P[ye]);var ye=arguments.length-2;if(ye===1)se.children=Z;else if(1<ye){for(var G=Array(ye),ie=0;ie<ye;ie++)G[ie]=arguments[ie+2];se.children=G}return V(z.type,ge,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,P,Z){var se,ge={},ye=null;if(P!=null)for(se in P.key!==void 0&&(ye=""+P.key),P)U.call(P,se)&&se!=="key"&&se!=="__self"&&se!=="__source"&&(ge[se]=P[se]);var G=arguments.length-2;if(G===1)ge.children=Z;else if(1<G){for(var ie=Array(G),he=0;he<G;he++)ie[he]=arguments[he+2];ge.children=ie}if(z&&z.defaultProps)for(se in G=z.defaultProps,G)ge[se]===void 0&&(ge[se]=G[se]);return V(z,ye,ge)},ke.createRef=function(){return{current:null}},ke.forwardRef=function(z){return{$$typeof:p,render:z}},ke.isValidElement=$,ke.lazy=function(z){return{$$typeof:x,_payload:{_status:-1,_result:z},_init:ee}},ke.memo=function(z,P){return{$$typeof:v,type:z,compare:P===void 0?null:P}},ke.startTransition=function(z){var P=k.T,Z={};k.T=Z;try{var se=z(),ge=k.S;ge!==null&&ge(Z,se),typeof se=="object"&&se!==null&&typeof se.then=="function"&&se.then(N,W)}catch(ye){W(ye)}finally{P!==null&&Z.types!==null&&(P.types=Z.types),k.T=P}},ke.unstable_useCacheRefresh=function(){return k.H.useCacheRefresh()},ke.use=function(z){return k.H.use(z)},ke.useActionState=function(z,P,Z){return k.H.useActionState(z,P,Z)},ke.useCallback=function(z,P){return k.H.useCallback(z,P)},ke.useContext=function(z){return k.H.useContext(z)},ke.useDebugValue=function(){},ke.useDeferredValue=function(z,P){return k.H.useDeferredValue(z,P)},ke.useEffect=function(z,P){return k.H.useEffect(z,P)},ke.useEffectEvent=function(z){return k.H.useEffectEvent(z)},ke.useId=function(){return k.H.useId()},ke.useImperativeHandle=function(z,P,Z){return k.H.useImperativeHandle(z,P,Z)},ke.useInsertionEffect=function(z,P){return k.H.useInsertionEffect(z,P)},ke.useLayoutEffect=function(z,P){return k.H.useLayoutEffect(z,P)},ke.useMemo=function(z,P){return k.H.useMemo(z,P)},ke.useOptimistic=function(z,P){return k.H.useOptimistic(z,P)},ke.useReducer=function(z,P,Z){return k.H.useReducer(z,P,Z)},ke.useRef=function(z){return k.H.useRef(z)},ke.useState=function(z){return k.H.useState(z)},ke.useSyncExternalStore=function(z,P,Z){return k.H.useSyncExternalStore(z,P,Z)},ke.useTransition=function(){return k.H.useTransition()},ke.version="19.2.8",ke}var By;function ym(){return By||(By=1,oh.exports=s2()),oh.exports}var h=ym();const ue=xm(h),Vs=a2({__proto__:null,default:ue},[h]);var ih={exports:{}},Fo={},ch={exports:{}},uh={};/**
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 Py;function o2(){return Py||(Py=1,(function(n){function a(_,q){var ee=_.length;_.push(q);e:for(;0<ee;){var W=ee-1>>>1,ne=_[W];if(0<c(ne,q))_[W]=q,_[ee]=ne,ee=W;else break e}}function l(_){return _.length===0?null:_[0]}function o(_){if(_.length===0)return null;var q=_[0],ee=_.pop();if(ee!==q){_[0]=ee;e:for(var W=0,ne=_.length,z=ne>>>1;W<z;){var P=2*(W+1)-1,Z=_[P],se=P+1,ge=_[se];if(0>c(Z,ee))se<ne&&0>c(ge,Z)?(_[W]=ge,_[se]=ee,W=se):(_[W]=Z,_[P]=ee,W=P);else if(se<ne&&0>c(ge,ee))_[W]=ge,_[se]=ee,W=se;else break e}}return q}function c(_,q){var ee=_.sortIndex-q.sortIndex;return ee!==0?ee:_.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,E=!1,j=!1,C=!1,R=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function M(_){for(var q=l(v);q!==null;){if(q.callback===null)o(v);else if(q.startTime<=_)o(v),q.sortIndex=q.expirationTime,a(g,q);else break;q=l(v)}}function O(_){if(j=!1,M(_),!E)if(l(g)!==null)E=!0,N||(N=!0,H());else{var q=l(v);q!==null&&de(O,q.startTime-_)}}var N=!1,k=-1,U=5,V=-1;function te(){return C?!0:!(n.unstable_now()-V<U)}function $(){if(C=!1,N){var _=n.unstable_now();V=_;var q=!0;try{e:{E=!1,j&&(j=!1,D(k),k=-1),w=!0;var ee=b;try{t:{for(M(_),y=l(g);y!==null&&!(y.expirationTime>_&&te());){var W=y.callback;if(typeof W=="function"){y.callback=null,b=y.priorityLevel;var ne=W(y.expirationTime<=_);if(_=n.unstable_now(),typeof ne=="function"){y.callback=ne,M(_),q=!0;break t}y===l(g)&&o(g),M(_)}else o(g);y=l(g)}if(y!==null)q=!0;else{var z=l(v);z!==null&&de(O,z.startTime-_),q=!1}}break e}finally{y=null,b=ee,w=!1}q=void 0}}finally{q?H():N=!1}}}var H;if(typeof A=="function")H=function(){A($)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,Q=I.port2;I.port1.onmessage=$,H=function(){Q.postMessage(null)}}else H=function(){R($,0)};function de(_,q){k=R(function(){_(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(_){_.callback=null},n.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<_?Math.floor(1e3/_):5},n.unstable_getCurrentPriorityLevel=function(){return b},n.unstable_next=function(_){switch(b){case 1:case 2:case 3:var q=3;break;default:q=b}var ee=b;b=q;try{return _()}finally{b=ee}},n.unstable_requestPaint=function(){C=!0},n.unstable_runWithPriority=function(_,q){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var ee=b;b=_;try{return q()}finally{b=ee}},n.unstable_scheduleCallback=function(_,q,ee){var W=n.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?W+ee:W):ee=W,_){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=ee+ne,_={id:x++,callback:q,priorityLevel:_,startTime:ee,expirationTime:ne,sortIndex:-1},ee>W?(_.sortIndex=ee,a(v,_),l(g)===null&&_===l(v)&&(j?(D(k),k=-1):j=!0,de(O,ee-W))):(_.sortIndex=ne,a(g,_),E||w||(E=!0,N||(N=!0,H()))),_},n.unstable_shouldYield=te,n.unstable_wrapCallback=function(_){var q=b;return function(){var ee=b;b=q;try{return _.apply(this,arguments)}finally{b=ee}}}})(uh)),uh}var Hy;function i2(){return Hy||(Hy=1,ch.exports=o2()),ch.exports}var dh={exports:{}},gn={};/**
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 qy;function c2(){if(qy)return gn;qy=1;var n=ym();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 gn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,gn.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)},gn.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()}},gn.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))},gn.prefetchDNS=function(g){typeof g=="string"&&o.d.D(g)},gn.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})}},gn.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)},gn.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})}},gn.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)},gn.requestFormReset=function(g){o.d.r(g)},gn.unstable_batchedUpdates=function(g,v){return g(v)},gn.useFormState=function(g,v,x){return f.H.useFormState(g,v,x)},gn.useFormStatus=function(){return f.H.useHostTransitionStatus()},gn.version="19.2.8",gn}var $y;function Jb(){if($y)return dh.exports;$y=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(),dh.exports=c2(),dh.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 Vy;function u2(){if(Vy)return Fo;Vy=1;var n=i2(),a=ym(),l=Jb();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 S=!1,T=d.child;T;){if(T===r){S=!0,r=d,i=m;break}if(T===i){S=!0,i=d,r=m;break}T=T.sibling}if(!S){for(T=m.child;T;){if(T===r){S=!0,r=m,i=d;break}if(T===i){S=!0,i=m,r=d;break}T=T.sibling}if(!S)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"),E=Symbol.for("react.portal"),j=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"),N=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),te=Symbol.for("react.memo_cache_sentinel"),$=Symbol.iterator;function H(e){return e===null||typeof e!="object"?null:(e=$&&e[$]||e["@@iterator"],typeof e=="function"?e:null)}var I=Symbol.for("react.client.reference");function Q(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===I?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case j:return"Fragment";case R:return"Profiler";case C:return"StrictMode";case O:return"Suspense";case N:return"SuspenseList";case V:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case E: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 k:return t=e.displayName||null,t!==null?t:Q(e.type)||"Memo";case U:t=e._payload,e=e._init;try{return Q(e(t))}catch{}}return null}var de=Array.isArray,_=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,ee={pending:!1,data:null,method:null,action:null},W=[],ne=-1;function z(e){return{current:e}}function P(e){0>ne||(e.current=W[ne],W[ne]=null,ne--)}function Z(e,t){ne++,W[ne]=e.current,e.current=t}var se=z(null),ge=z(null),ye=z(null),G=z(null);function ie(e,t){switch(Z(ye,t),Z(ge,e),Z(se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ny(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ny(t),e=ay(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}P(se),Z(se,e)}function he(){P(se),P(ge),P(ye)}function pe(e){e.memoizedState!==null&&Z(G,e);var t=se.current,r=ay(t,e.type);t!==r&&(Z(ge,e),Z(se,r))}function Ae(e){ge.current===e&&(P(se),P(ge)),G.current===e&&(P(G),Vo._currentValue=ee)}var Ce,Oe;function Qe(e){if(Ce===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Ce=t&&t[1]||"",Oe=-1<r.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+Ce+e+Oe}var We=!1;function oe(e,t){if(!e||We)return"";We=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(J){var F=J}Reflect.construct(e,[],le)}else{try{le.call()}catch(J){F=J}e.call(le.prototype)}}else{try{throw Error()}catch(J){F=J}(le=e())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(J){if(J&&F&&typeof J.stack=="string")return[J.stack,F.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(),S=m[0],T=m[1];if(S&&T){var L=S.split(`
44
+ `),X=T.split(`
45
+ `);for(d=i=0;i<L.length&&!L[i].includes("DetermineComponentFrameRoot");)i++;for(;d<X.length&&!X[d].includes("DetermineComponentFrameRoot");)d++;if(i===L.length||d===X.length)for(i=L.length-1,d=X.length-1;1<=i&&0<=d&&L[i]!==X[d];)d--;for(;1<=i&&0<=d;i--,d--)if(L[i]!==X[d]){if(i!==1||d!==1)do if(i--,d--,0>d||L[i]!==X[d]){var ae=`
46
+ `+L[i].replace(" at new "," at ");return e.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",e.displayName)),ae}while(1<=i&&0<=d);break}}}finally{We=!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 oe(e.type,!1);case 11:return oe(e.type.render,!1);case 1:return oe(e.type,!0);case 31:return Qe("Activity");default:return""}}function He(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,jt=n.unstable_scheduleCallback,Ft=n.unstable_cancelCallback,hn=n.unstable_shouldYield,Qt=n.unstable_requestPaint,Ct=n.unstable_now,xn=n.unstable_getCurrentPriorityLevel,At=n.unstable_ImmediatePriority,Mt=n.unstable_UserBlockingPriority,mn=n.unstable_NormalPriority,pa=n.unstable_LowPriority,Aa=n.unstable_IdlePriority,Wn=n.log,dl=n.unstable_setDisableYieldValue,ga=null,Dt=null;function yn(e){if(typeof Wn=="function"&&dl(e),Dt&&typeof Dt.setStrictMode=="function")try{Dt.setStrictMode(ga,e)}catch{}}var Tt=Math.clz32?Math.clz32:Yl,ao=Math.log,Vl=Math.LN2;function Yl(e){return e>>>=0,e===0?32:31-(ao(e)/Vl|0)|0}var Ya=256,Rr=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,S=e.pingedLanes;e=e.warmLanes;var T=i&134217727;return T!==0?(i=T&~m,i!==0?d=at(i):(S&=T,S!==0?d=at(S):r||(r=T&~e,r!==0&&(d=at(r))))):(T=i&~m,T!==0?d=at(T):S!==0?d=at(S):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 Et(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 S=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,L=e.expirationTimes,X=e.hiddenUpdates;for(r=S&~r;0<r;){var ae=31-Tt(r),le=1<<ae;T[ae]=0,L[ae]=-1;var F=X[ae];if(F!==null)for(X[ae]=null,ae=0;ae<F.length;ae++){var J=F[ae];J!==null&&(J.lane&=-536870913)}r&=~le}i!==0&&Vt(e,i,0),m!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=m&~(S&~t))}function Vt(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 Ka(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:Ny(e.type))}function Tr(e,t){var r=q.p;try{return q.p=e,t()}finally{q.p=r}}var ea=Math.random().toString(36).slice(2),nn="__reactFiber$"+ea,Sn="__reactProps$"+ea,Gl="__reactContainer$"+ea,Fu="__reactEvents$"+ea,GS="__reactListeners$"+ea,KS="__reactHandles$"+ea,$p="__reactResources$"+ea,ro="__reactMarker$"+ea;function Qu(e){delete e[nn],delete e[Sn],delete e[Fu],delete e[GS],delete e[KS]}function Kl(e){var t=e[nn];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Gl]||r[nn]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=uy(e);e!==null;){if(r=e[nn])return r;e=uy(e)}return t}e=r,r=e.parentNode}return null}function Xl(e){if(e=e[nn]||e[Gl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function lo(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Fl(e){var t=e[$p];return t||(t=e[$p]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Zt(e){e[ro]=!0}var Vp=new Set,Yp={};function fl(e,t){Ql(e,t),Ql(e+"Capture",t)}function Ql(e,t){for(Yp[e]=t,e=0;e<t.length;e++)Vp.add(t[e])}var XS=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]*$"),Gp={},Kp={};function FS(e){return _t.call(Kp,e)?!0:_t.call(Gp,e)?!1:XS.test(e)?Kp[e]=!0:(Gp[e]=!0,!1)}function Ei(e,t,r){if(FS(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 Ni(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 Xp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function QS(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(S){r=""+S,m.call(this,S)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return r},setValue:function(S){r=""+S},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Zu(e){if(!e._valueTracker){var t=Xp(e)?"checked":"value";e._valueTracker=QS(e,t,""+e[t])}}function Fp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),i="";return e&&(i=Xp(e)?e.checked?"true":"false":e.value),e=i,e!==r?(t.setValue(e),!0):!1}function Ri(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 ZS=/[\n"\\]/g;function na(e){return e.replace(ZS,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ju(e,t,r,i,d,m,S,T){e.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.type=S:e.removeAttribute("type"),t!=null?S==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ta(t)):e.value!==""+ta(t)&&(e.value=""+ta(t)):S!=="submit"&&S!=="reset"||e.removeAttribute("value"),t!=null?Wu(e,S,ta(t)):r!=null?Wu(e,S,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 Qp(e,t,r,i,d,m,S,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)){Zu(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,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(e.name=S),Zu(e)}function Wu(e,t,r){t==="number"&&Ri(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function Zl(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 Zp(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 Jp(e,t,r,i){if(t==null){if(i!=null){if(r!=null)throw Error(o(92));if(de(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),Zu(e)}function Jl(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var JS=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 Wp(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||JS.has(t)?t==="float"?e.cssFloat=r:e[t]=(""+r).trim():e[t]=r+"px"}function eg(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&&Wp(e,d,i)}else for(var m in t)t.hasOwnProperty(m)&&Wp(e,m,t[m])}function ed(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 WS=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"]]),ej=/^[\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 Ti(e){return ej.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Fa(){}var td=null;function nd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Wl=null,es=null;function tg(e){var t=Xl(e);if(t&&(e=t.stateNode)){var r=e[Sn]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ju(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[Sn]||null;if(!d)throw Error(o(90));Ju(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&&Fp(i)}break e;case"textarea":Zp(e,r.value,r.defaultValue);break e;case"select":t=r.value,t!=null&&Zl(e,!!r.multiple,t,!1)}}}var ad=!1;function ng(e,t,r){if(ad)return e(t,r);ad=!0;try{var i=e(t);return i}finally{if(ad=!1,(Wl!==null||es!==null)&&(pc(),Wl&&(t=Wl,e=es,es=Wl=null,tg(t),e)))for(t=0;t<e.length;t++)tg(e[t])}}function so(e,t){var r=e.stateNode;if(r===null)return null;var i=r[Sn]||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"),rd=!1;if(Qa)try{var oo={};Object.defineProperty(oo,"passive",{get:function(){rd=!0}}),window.addEventListener("test",oo,oo),window.removeEventListener("test",oo,oo)}catch{rd=!1}var Ar=null,ld=null,Ai=null;function ag(){if(Ai)return Ai;var e,t=ld,r=t.length,i,d="value"in Ar?Ar.value:Ar.textContent,m=d.length;for(e=0;e<r&&t[e]===d[e];e++);var S=r-e;for(i=1;i<=S&&t[r-i]===d[m-i];i++);return Ai=d.slice(e,1<i?1-i:void 0)}function Mi(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 Di(){return!0}function rg(){return!1}function jn(e){function t(r,i,d,m,S){this._reactName=r,this._targetInst=d,this.type=i,this.nativeEvent=m,this.target=S,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)?Di:rg,this.isPropagationStopped=rg,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=Di)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Di)},persist:function(){},isPersistent:Di}),t}var hl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Oi=jn(hl),io=y({},hl,{view:0,detail:0}),tj=jn(io),sd,od,co,ki=y({},io,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:cd,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!==co&&(co&&e.type==="mousemove"?(sd=e.screenX-co.screenX,od=e.screenY-co.screenY):od=sd=0,co=e),sd)},movementY:function(e){return"movementY"in e?e.movementY:od}}),lg=jn(ki),nj=y({},ki,{dataTransfer:0}),aj=jn(nj),rj=y({},io,{relatedTarget:0}),id=jn(rj),lj=y({},hl,{animationName:0,elapsedTime:0,pseudoElement:0}),sj=jn(lj),oj=y({},hl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ij=jn(oj),cj=y({},hl,{data:0}),sg=jn(cj),uj={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},dj={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"},fj={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hj(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=fj[e])?!!t[e]:!1}function cd(){return hj}var mj=y({},io,{key:function(e){if(e.key){var t=uj[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Mi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?dj[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:cd,charCode:function(e){return e.type==="keypress"?Mi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Mi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),pj=jn(mj),gj=y({},ki,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),og=jn(gj),vj=y({},io,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:cd}),xj=jn(vj),yj=y({},hl,{propertyName:0,elapsedTime:0,pseudoElement:0}),bj=jn(yj),wj=y({},ki,{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}),Sj=jn(wj),jj=y({},hl,{newState:0,oldState:0}),Cj=jn(jj),Ej=[9,13,27,32],ud=Qa&&"CompositionEvent"in window,uo=null;Qa&&"documentMode"in document&&(uo=document.documentMode);var Nj=Qa&&"TextEvent"in window&&!uo,ig=Qa&&(!ud||uo&&8<uo&&11>=uo),cg=" ",ug=!1;function dg(e,t){switch(e){case"keyup":return Ej.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function fg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ts=!1;function Rj(e,t){switch(e){case"compositionend":return fg(t);case"keypress":return t.which!==32?null:(ug=!0,cg);case"textInput":return e=t.data,e===cg&&ug?null:e;default:return null}}function Tj(e,t){if(ts)return e==="compositionend"||!ud&&dg(e,t)?(e=ag(),Ai=ld=Ar=null,ts=!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 ig&&t.locale!=="ko"?null:t.data;default:return null}}var Aj={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 hg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Aj[e.type]:t==="textarea"}function mg(e,t,r,i){Wl?es?es.push(i):es=[i]:Wl=i,t=Sc(t,"onChange"),0<t.length&&(r=new Oi("onChange","change",null,r,i),e.push({event:r,listeners:t}))}var fo=null,ho=null;function Mj(e){Qx(e,0)}function _i(e){var t=lo(e);if(Fp(t))return e}function pg(e,t){if(e==="change")return t}var gg=!1;if(Qa){var dd;if(Qa){var fd="oninput"in document;if(!fd){var vg=document.createElement("div");vg.setAttribute("oninput","return;"),fd=typeof vg.oninput=="function"}dd=fd}else dd=!1;gg=dd&&(!document.documentMode||9<document.documentMode)}function xg(){fo&&(fo.detachEvent("onpropertychange",yg),ho=fo=null)}function yg(e){if(e.propertyName==="value"&&_i(ho)){var t=[];mg(t,ho,e,nd(e)),ng(Mj,t)}}function Dj(e,t,r){e==="focusin"?(xg(),fo=t,ho=r,fo.attachEvent("onpropertychange",yg)):e==="focusout"&&xg()}function Oj(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return _i(ho)}function kj(e,t){if(e==="click")return _i(t)}function _j(e,t){if(e==="input"||e==="change")return _i(t)}function zj(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var In=typeof Object.is=="function"?Object.is:zj;function mo(e,t){if(In(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)||!In(e[d],t[d]))return!1}return!0}function bg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function wg(e,t){var r=bg(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=bg(r)}}function Sg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Sg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function jg(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ri(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=Ri(e.document)}return t}function hd(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 Lj=Qa&&"documentMode"in document&&11>=document.documentMode,ns=null,md=null,po=null,pd=!1;function Cg(e,t,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;pd||ns==null||ns!==Ri(i)||(i=ns,"selectionStart"in i&&hd(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}),po&&mo(po,i)||(po=i,i=Sc(md,"onSelect"),0<i.length&&(t=new Oi("onSelect","select",null,t,r),e.push({event:t,listeners:i}),t.target=ns)))}function ml(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var as={animationend:ml("Animation","AnimationEnd"),animationiteration:ml("Animation","AnimationIteration"),animationstart:ml("Animation","AnimationStart"),transitionrun:ml("Transition","TransitionRun"),transitionstart:ml("Transition","TransitionStart"),transitioncancel:ml("Transition","TransitionCancel"),transitionend:ml("Transition","TransitionEnd")},gd={},Eg={};Qa&&(Eg=document.createElement("div").style,"AnimationEvent"in window||(delete as.animationend.animation,delete as.animationiteration.animation,delete as.animationstart.animation),"TransitionEvent"in window||delete as.transitionend.transition);function pl(e){if(gd[e])return gd[e];if(!as[e])return e;var t=as[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Eg)return gd[e]=t[r];return e}var Ng=pl("animationend"),Rg=pl("animationiteration"),Tg=pl("animationstart"),Uj=pl("transitionrun"),Ij=pl("transitionstart"),Bj=pl("transitioncancel"),Ag=pl("transitionend"),Mg=new Map,vd="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(" ");vd.push("scrollEnd");function xa(e,t){Mg.set(e,t),fl(t,[e])}var zi=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=[],rs=0,xd=0;function Li(){for(var e=rs,t=xd=rs=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 S=i.pending;S===null?d.next=d:(d.next=S.next,S.next=d),i.pending=d}m!==0&&Dg(r,d,m)}}function Ui(e,t,r,i){aa[rs++]=e,aa[rs++]=t,aa[rs++]=r,aa[rs++]=i,xd|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function yd(e,t,r,i){return Ui(e,t,r,i),Ii(e)}function gl(e,t){return Ui(e,null,null,t),Ii(e)}function Dg(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 Ii(e){if(50<Uo)throw Uo=0,Af=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ls={};function Pj(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 Bn(e,t,r,i){return new Pj(e,t,r,i)}function bd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Za(e,t){var r=e.alternate;return r===null?(r=Bn(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 Og(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 S=0;if(i=e,typeof e=="function")bd(e)&&(S=1);else if(typeof e=="string")S=YC(e,r,se.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case V:return e=Bn(31,r,t,d),e.elementType=V,e.lanes=m,e;case j:return vl(r.children,d,m,t);case C:S=8,d|=24;break;case R:return e=Bn(12,r,t,d|2),e.elementType=R,e.lanes=m,e;case O:return e=Bn(13,r,t,d),e.elementType=O,e.lanes=m,e;case N:return e=Bn(19,r,t,d),e.elementType=N,e.lanes=m,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case A:S=10;break e;case D:S=9;break e;case M:S=11;break e;case k:S=14;break e;case U:S=16,i=null;break e}S=29,r=Error(o(130,e===null?"null":typeof e,"")),i=null}return t=Bn(S,r,t,d),t.elementType=e,t.type=i,t.lanes=m,t}function vl(e,t,r,i){return e=Bn(7,e,i,t),e.lanes=r,e}function wd(e,t,r){return e=Bn(6,e,null,t),e.lanes=r,e}function kg(e){var t=Bn(18,null,null,0);return t.stateNode=e,t}function Sd(e,t,r){return t=Bn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var _g=new WeakMap;function ra(e,t){if(typeof e=="object"&&e!==null){var r=_g.get(e);return r!==void 0?r:(t={value:e,source:t,stack:He(t)},_g.set(e,t),t)}return{value:e,source:t,stack:He(t)}}var ss=[],os=0,Pi=null,go=0,la=[],sa=0,Mr=null,Ma=1,Da="";function Ja(e,t){ss[os++]=go,ss[os++]=Pi,Pi=e,go=t}function zg(e,t,r){la[sa++]=Ma,la[sa++]=Da,la[sa++]=Mr,Mr=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 S=d-d%5;m=(i&(1<<S)-1).toString(32),i>>=S,d-=S,Ma=1<<32-Tt(t)+d|r<<d|i,Da=m+e}else Ma=1<<m|r<<d|i,Da=e}function jd(e){e.return!==null&&(Ja(e,1),zg(e,1,0))}function Cd(e){for(;e===Pi;)Pi=ss[--os],ss[os]=null,go=ss[--os],ss[os]=null;for(;e===Mr;)Mr=la[--sa],la[sa]=null,Da=la[--sa],la[sa]=null,Ma=la[--sa],la[sa]=null}function Lg(e,t){la[sa++]=Ma,la[sa++]=Da,la[sa++]=Mr,Ma=t.id,Da=t.overflow,Mr=e}var an=null,bt=null,Ke=!1,Dr=null,oa=!1,Ed=Error(o(519));function Or(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw vo(ra(t,e)),Ed}function Ug(e){var t=e.stateNode,r=e.type,i=e.memoizedProps;switch(t[nn]=e,t[Sn]=i,r){case"dialog":$e("cancel",t),$e("close",t);break;case"iframe":case"object":case"embed":$e("load",t);break;case"video":case"audio":for(r=0;r<Bo.length;r++)$e(Bo[r],t);break;case"source":$e("error",t);break;case"img":case"image":case"link":$e("error",t),$e("load",t);break;case"details":$e("toggle",t);break;case"input":$e("invalid",t),Qp(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":$e("invalid",t);break;case"textarea":$e("invalid",t),Jp(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||ey(t.textContent,r)?(i.popover!=null&&($e("beforetoggle",t),$e("toggle",t)),i.onScroll!=null&&$e("scroll",t),i.onScrollEnd!=null&&$e("scrollend",t),i.onClick!=null&&(t.onclick=Fa),t=!0):t=!1,t||Or(e,!0)}function Ig(e){for(an=e.return;an;)switch(an.tag){case 5:case 31:case 13:oa=!1;return;case 27:case 3:oa=!0;return;default:an=an.return}}function is(e){if(e!==an)return!1;if(!Ke)return Ig(e),Ke=!0,!1;var t=e.tag,r;if((r=t!==3&&t!==27)&&((r=t===5)&&(r=e.type,r=!(r!=="form"&&r!=="button")||Vf(e.type,e.memoizedProps)),r=!r),r&&bt&&Or(e),Ig(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));bt=cy(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));bt=cy(e)}else t===27?(t=bt,Gr(e.type)?(e=Ff,Ff=null,bt=e):bt=t):bt=an?ca(e.stateNode.nextSibling):null;return!0}function xl(){bt=an=null,Ke=!1}function Nd(){var e=Dr;return e!==null&&(Rn===null?Rn=e:Rn.push.apply(Rn,e),Dr=null),e}function vo(e){Dr===null?Dr=[e]:Dr.push(e)}var Rd=z(null),yl=null,Wa=null;function kr(e,t,r){Z(Rd,t._currentValue),t._currentValue=r}function er(e){e._currentValue=Rd.current,P(Rd)}function Td(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 Ad(e,t,r,i){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var m=d.dependencies;if(m!==null){var S=d.child;m=m.firstContext;e:for(;m!==null;){var T=m;m=d;for(var L=0;L<t.length;L++)if(T.context===t[L]){m.lanes|=r,T=m.alternate,T!==null&&(T.lanes|=r),Td(m.return,r,e),i||(S=null);break e}m=T.next}}else if(d.tag===18){if(S=d.return,S===null)throw Error(o(341));S.lanes|=r,m=S.alternate,m!==null&&(m.lanes|=r),Td(S,r,e),S=null}else S=d.child;if(S!==null)S.return=d;else for(S=d;S!==null;){if(S===e){S=null;break}if(d=S.sibling,d!==null){d.return=S.return,S=d;break}S=S.return}d=S}}function cs(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 S=d.alternate;if(S===null)throw Error(o(387));if(S=S.memoizedProps,S!==null){var T=d.type;In(d.pendingProps.value,S.value)||(e!==null?e.push(T):e=[T])}}else if(d===G.current){if(S=d.alternate,S===null)throw Error(o(387));S.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(Vo):e=[Vo])}d=d.return}e!==null&&Ad(t,e,r,i),t.flags|=262144}function Hi(e){for(e=e.firstContext;e!==null;){if(!In(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function bl(e){yl=e,Wa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function rn(e){return Bg(yl,e)}function qi(e,t){return yl===null&&bl(e),Bg(e,t)}function Bg(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 Hj=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()})}},qj=n.unstable_scheduleCallback,$j=n.unstable_NormalPriority,Bt={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Md(){return{controller:new Hj,data:new Map,refCount:0}}function xo(e){e.refCount--,e.refCount===0&&qj($j,function(){e.controller.abort()})}var yo=null,Dd=0,us=0,ds=null;function Vj(e,t){if(yo===null){var r=yo=[];Dd=0,us=zf(),ds={status:"pending",value:void 0,then:function(i){r.push(i)}}}return Dd++,t.then(Pg,Pg),t}function Pg(){if(--Dd===0&&yo!==null){ds!==null&&(ds.status="fulfilled");var e=yo;yo=null,us=0,ds=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Yj(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 Hg=_.S;_.S=function(e,t){Cx=Ct(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Vj(e,t),Hg!==null&&Hg(e,t)};var wl=z(null);function Od(){var e=wl.current;return e!==null?e:pt.pooledCache}function $i(e,t){t===null?Z(wl,wl.current):Z(wl,t.pool)}function qg(){var e=Od();return e===null?null:{parent:Bt._currentValue,pool:e}}var fs=Error(o(460)),kd=Error(o(474)),Vi=Error(o(542)),Yi={then:function(){}};function $g(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Vg(e,t,r){switch(r=e[r],r===void 0?e.push(t):r!==t&&(t.then(Fa,Fa),t=r),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Gg(e),e;default:if(typeof t.status=="string")t.then(Fa,Fa);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,Gg(e),e}throw jl=t,fs}}function Sl(e){try{var t=e._init;return t(e._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(jl=r,fs):r}}var jl=null;function Yg(){if(jl===null)throw Error(o(459));var e=jl;return jl=null,e}function Gg(e){if(e===fs||e===Vi)throw Error(o(483))}var hs=null,bo=0;function Gi(e){var t=bo;return bo+=1,hs===null&&(hs=[]),Vg(hs,e,t)}function wo(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ki(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 Kg(e){function t(Y,B){if(e){var K=Y.deletions;K===null?(Y.deletions=[B],Y.flags|=16):K.push(B)}}function r(Y,B){if(!e)return null;for(;B!==null;)t(Y,B),B=B.sibling;return null}function i(Y){for(var B=new Map;Y!==null;)Y.key!==null?B.set(Y.key,Y):B.set(Y.index,Y),Y=Y.sibling;return B}function d(Y,B){return Y=Za(Y,B),Y.index=0,Y.sibling=null,Y}function m(Y,B,K){return Y.index=K,e?(K=Y.alternate,K!==null?(K=K.index,K<B?(Y.flags|=67108866,B):K):(Y.flags|=67108866,B)):(Y.flags|=1048576,B)}function S(Y){return e&&Y.alternate===null&&(Y.flags|=67108866),Y}function T(Y,B,K,re){return B===null||B.tag!==6?(B=wd(K,Y.mode,re),B.return=Y,B):(B=d(B,K),B.return=Y,B)}function L(Y,B,K,re){var Te=K.type;return Te===j?ae(Y,B,K.props.children,re,K.key):B!==null&&(B.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===U&&Sl(Te)===B.type)?(B=d(B,K.props),wo(B,K),B.return=Y,B):(B=Bi(K.type,K.key,K.props,null,Y.mode,re),wo(B,K),B.return=Y,B)}function X(Y,B,K,re){return B===null||B.tag!==4||B.stateNode.containerInfo!==K.containerInfo||B.stateNode.implementation!==K.implementation?(B=Sd(K,Y.mode,re),B.return=Y,B):(B=d(B,K.children||[]),B.return=Y,B)}function ae(Y,B,K,re,Te){return B===null||B.tag!==7?(B=vl(K,Y.mode,re,Te),B.return=Y,B):(B=d(B,K),B.return=Y,B)}function le(Y,B,K){if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return B=wd(""+B,Y.mode,K),B.return=Y,B;if(typeof B=="object"&&B!==null){switch(B.$$typeof){case w:return K=Bi(B.type,B.key,B.props,null,Y.mode,K),wo(K,B),K.return=Y,K;case E:return B=Sd(B,Y.mode,K),B.return=Y,B;case U:return B=Sl(B),le(Y,B,K)}if(de(B)||H(B))return B=vl(B,Y.mode,K,null),B.return=Y,B;if(typeof B.then=="function")return le(Y,Gi(B),K);if(B.$$typeof===A)return le(Y,qi(Y,B),K);Ki(Y,B)}return null}function F(Y,B,K,re){var Te=B!==null?B.key:null;if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return Te!==null?null:T(Y,B,""+K,re);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case w:return K.key===Te?L(Y,B,K,re):null;case E:return K.key===Te?X(Y,B,K,re):null;case U:return K=Sl(K),F(Y,B,K,re)}if(de(K)||H(K))return Te!==null?null:ae(Y,B,K,re,null);if(typeof K.then=="function")return F(Y,B,Gi(K),re);if(K.$$typeof===A)return F(Y,B,qi(Y,K),re);Ki(Y,K)}return null}function J(Y,B,K,re,Te){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return Y=Y.get(K)||null,T(B,Y,""+re,Te);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case w:return Y=Y.get(re.key===null?K:re.key)||null,L(B,Y,re,Te);case E:return Y=Y.get(re.key===null?K:re.key)||null,X(B,Y,re,Te);case U:return re=Sl(re),J(Y,B,K,re,Te)}if(de(re)||H(re))return Y=Y.get(K)||null,ae(B,Y,re,Te,null);if(typeof re.then=="function")return J(Y,B,K,Gi(re),Te);if(re.$$typeof===A)return J(Y,B,K,qi(B,re),Te);Ki(B,re)}return null}function we(Y,B,K,re){for(var Te=null,Ze=null,Se=B,Ie=B=0,Ye=null;Se!==null&&Ie<K.length;Ie++){Se.index>Ie?(Ye=Se,Se=null):Ye=Se.sibling;var Je=F(Y,Se,K[Ie],re);if(Je===null){Se===null&&(Se=Ye);break}e&&Se&&Je.alternate===null&&t(Y,Se),B=m(Je,B,Ie),Ze===null?Te=Je:Ze.sibling=Je,Ze=Je,Se=Ye}if(Ie===K.length)return r(Y,Se),Ke&&Ja(Y,Ie),Te;if(Se===null){for(;Ie<K.length;Ie++)Se=le(Y,K[Ie],re),Se!==null&&(B=m(Se,B,Ie),Ze===null?Te=Se:Ze.sibling=Se,Ze=Se);return Ke&&Ja(Y,Ie),Te}for(Se=i(Se);Ie<K.length;Ie++)Ye=J(Se,Y,Ie,K[Ie],re),Ye!==null&&(e&&Ye.alternate!==null&&Se.delete(Ye.key===null?Ie:Ye.key),B=m(Ye,B,Ie),Ze===null?Te=Ye:Ze.sibling=Ye,Ze=Ye);return e&&Se.forEach(function(Zr){return t(Y,Zr)}),Ke&&Ja(Y,Ie),Te}function De(Y,B,K,re){if(K==null)throw Error(o(151));for(var Te=null,Ze=null,Se=B,Ie=B=0,Ye=null,Je=K.next();Se!==null&&!Je.done;Ie++,Je=K.next()){Se.index>Ie?(Ye=Se,Se=null):Ye=Se.sibling;var Zr=F(Y,Se,Je.value,re);if(Zr===null){Se===null&&(Se=Ye);break}e&&Se&&Zr.alternate===null&&t(Y,Se),B=m(Zr,B,Ie),Ze===null?Te=Zr:Ze.sibling=Zr,Ze=Zr,Se=Ye}if(Je.done)return r(Y,Se),Ke&&Ja(Y,Ie),Te;if(Se===null){for(;!Je.done;Ie++,Je=K.next())Je=le(Y,Je.value,re),Je!==null&&(B=m(Je,B,Ie),Ze===null?Te=Je:Ze.sibling=Je,Ze=Je);return Ke&&Ja(Y,Ie),Te}for(Se=i(Se);!Je.done;Ie++,Je=K.next())Je=J(Se,Y,Ie,Je.value,re),Je!==null&&(e&&Je.alternate!==null&&Se.delete(Je.key===null?Ie:Je.key),B=m(Je,B,Ie),Ze===null?Te=Je:Ze.sibling=Je,Ze=Je);return e&&Se.forEach(function(n2){return t(Y,n2)}),Ke&&Ja(Y,Ie),Te}function ht(Y,B,K,re){if(typeof K=="object"&&K!==null&&K.type===j&&K.key===null&&(K=K.props.children),typeof K=="object"&&K!==null){switch(K.$$typeof){case w:e:{for(var Te=K.key;B!==null;){if(B.key===Te){if(Te=K.type,Te===j){if(B.tag===7){r(Y,B.sibling),re=d(B,K.props.children),re.return=Y,Y=re;break e}}else if(B.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===U&&Sl(Te)===B.type){r(Y,B.sibling),re=d(B,K.props),wo(re,K),re.return=Y,Y=re;break e}r(Y,B);break}else t(Y,B);B=B.sibling}K.type===j?(re=vl(K.props.children,Y.mode,re,K.key),re.return=Y,Y=re):(re=Bi(K.type,K.key,K.props,null,Y.mode,re),wo(re,K),re.return=Y,Y=re)}return S(Y);case E:e:{for(Te=K.key;B!==null;){if(B.key===Te)if(B.tag===4&&B.stateNode.containerInfo===K.containerInfo&&B.stateNode.implementation===K.implementation){r(Y,B.sibling),re=d(B,K.children||[]),re.return=Y,Y=re;break e}else{r(Y,B);break}else t(Y,B);B=B.sibling}re=Sd(K,Y.mode,re),re.return=Y,Y=re}return S(Y);case U:return K=Sl(K),ht(Y,B,K,re)}if(de(K))return we(Y,B,K,re);if(H(K)){if(Te=H(K),typeof Te!="function")throw Error(o(150));return K=Te.call(K),De(Y,B,K,re)}if(typeof K.then=="function")return ht(Y,B,Gi(K),re);if(K.$$typeof===A)return ht(Y,B,qi(Y,K),re);Ki(Y,K)}return typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint"?(K=""+K,B!==null&&B.tag===6?(r(Y,B.sibling),re=d(B,K),re.return=Y,Y=re):(r(Y,B),re=wd(K,Y.mode,re),re.return=Y,Y=re),S(Y)):r(Y,B)}return function(Y,B,K,re){try{bo=0;var Te=ht(Y,B,K,re);return hs=null,Te}catch(Se){if(Se===fs||Se===Vi)throw Se;var Ze=Bn(29,Se,null,Y.mode);return Ze.lanes=re,Ze.return=Y,Ze}finally{}}}var Cl=Kg(!0),Xg=Kg(!1),_r=!1;function _d(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function zd(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 zr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Lr(e,t,r){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(et&2)!==0){var d=i.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),i.pending=t,t=Ii(e),Dg(e,null,r),t}return Ui(e,i,t,r),Ii(e)}function So(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 Ld(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 S={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};m===null?d=m=S:m=m.next=S,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 Ud=!1;function jo(){if(Ud){var e=ds;if(e!==null)throw e}}function Co(e,t,r,i){Ud=!1;var d=e.updateQueue;_r=!1;var m=d.firstBaseUpdate,S=d.lastBaseUpdate,T=d.shared.pending;if(T!==null){d.shared.pending=null;var L=T,X=L.next;L.next=null,S===null?m=X:S.next=X,S=L;var ae=e.alternate;ae!==null&&(ae=ae.updateQueue,T=ae.lastBaseUpdate,T!==S&&(T===null?ae.firstBaseUpdate=X:T.next=X,ae.lastBaseUpdate=L))}if(m!==null){var le=d.baseState;S=0,ae=X=L=null,T=m;do{var F=T.lane&-536870913,J=F!==T.lane;if(J?(Ve&F)===F:(i&F)===F){F!==0&&F===us&&(Ud=!0),ae!==null&&(ae=ae.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var we=e,De=T;F=t;var ht=r;switch(De.tag){case 1:if(we=De.payload,typeof we=="function"){le=we.call(ht,le,F);break e}le=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=De.payload,F=typeof we=="function"?we.call(ht,le,F):we,F==null)break e;le=y({},le,F);break e;case 2:_r=!0}}F=T.callback,F!==null&&(e.flags|=64,J&&(e.flags|=8192),J=d.callbacks,J===null?d.callbacks=[F]:J.push(F))}else J={lane:F,tag:T.tag,payload:T.payload,callback:T.callback,next:null},ae===null?(X=ae=J,L=le):ae=ae.next=J,S|=F;if(T=T.next,T===null){if(T=d.shared.pending,T===null)break;J=T,T=J.next,J.next=null,d.lastBaseUpdate=J,d.shared.pending=null}}while(!0);ae===null&&(L=le),d.baseState=L,d.firstBaseUpdate=X,d.lastBaseUpdate=ae,m===null&&(d.shared.lanes=0),Hr|=S,e.lanes=S,e.memoizedState=le}}function Fg(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Qg(e,t){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;e<r.length;e++)Fg(r[e],t)}var ms=z(null),Xi=z(0);function Zg(e,t){e=cr,Z(Xi,e),Z(ms,t),cr=e|t.baseLanes}function Id(){Z(Xi,cr),Z(ms,ms.current)}function Bd(){cr=Xi.current,P(ms),P(Xi)}var Pn=z(null),ia=null;function Ur(e){var t=e.alternate;Z(Lt,Lt.current&1),Z(Pn,e),ia===null&&(t===null||ms.current!==null||t.memoizedState!==null)&&(ia=e)}function Pd(e){Z(Lt,Lt.current),Z(Pn,e),ia===null&&(ia=e)}function Jg(e){e.tag===22?(Z(Lt,Lt.current),Z(Pn,e),ia===null&&(ia=e)):Ir()}function Ir(){Z(Lt,Lt.current),Z(Pn,Pn.current)}function Hn(e){P(Pn),ia===e&&(ia=null),P(Lt)}var Lt=z(0);function Fi(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||Kf(r)||Xf(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,Pt=null,Qi=!1,ps=!1,El=!1,Zi=0,Eo=0,gs=null,Gj=0;function Ot(){throw Error(o(321))}function Hd(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!In(e[r],t[r]))return!1;return!0}function qd(e,t,r,i,d,m){return tr=m,ze=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,_.H=e===null||e.memoizedState===null?zv:af,El=!1,m=r(i,d),El=!1,ps&&(m=ev(t,r,i,d)),Wg(e),m}function Wg(e){_.H=To;var t=dt!==null&&dt.next!==null;if(tr=0,Pt=dt=ze=null,Qi=!1,Eo=0,gs=null,t)throw Error(o(300));e===null||Ht||(e=e.dependencies,e!==null&&Hi(e)&&(Ht=!0))}function ev(e,t,r,i){ze=e;var d=0;do{if(ps&&(gs=null),Eo=0,ps=!1,25<=d)throw Error(o(301));if(d+=1,Pt=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)}_.H=Lv,m=t(r,i)}while(ps);return m}function Kj(){var e=_.H,t=e.useState()[0];return t=typeof t.then=="function"?No(t):t,e=e.useState()[0],(dt!==null?dt.memoizedState:null)!==e&&(ze.flags|=1024),t}function $d(){var e=Zi!==0;return Zi=0,e}function Vd(e,t,r){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r}function Yd(e){if(Qi){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Qi=!1}tr=0,Pt=dt=ze=null,ps=!1,Eo=Zi=0,gs=null}function bn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pt===null?ze.memoizedState=Pt=e:Pt=Pt.next=e,Pt}function Ut(){if(dt===null){var e=ze.alternate;e=e!==null?e.memoizedState:null}else e=dt.next;var t=Pt===null?ze.memoizedState:Pt.next;if(t!==null)Pt=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},Pt===null?ze.memoizedState=Pt=e:Pt=Pt.next=e}return Pt}function Ji(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function No(e){var t=Eo;return Eo+=1,gs===null&&(gs=[]),e=Vg(gs,e,t),t=ze,(Pt===null?t.memoizedState:Pt.next)===null&&(t=t.alternate,_.H=t===null||t.memoizedState===null?zv:af),e}function Wi(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return No(e);if(e.$$typeof===A)return rn(e)}throw Error(o(438,String(e)))}function Gd(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=Ji(),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 ec(e){var t=Ut();return Kd(t,dt,e)}function Kd(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 S=d.next;d.next=m.next,m.next=S}t.baseQueue=d=m,i.pending=null}if(m=e.baseState,d===null)e.memoizedState=m;else{t=d.next;var T=S=null,L=null,X=t,ae=!1;do{var le=X.lane&-536870913;if(le!==X.lane?(Ve&le)===le:(tr&le)===le){var F=X.revertLane;if(F===0)L!==null&&(L=L.next={lane:0,revertLane:0,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null}),le===us&&(ae=!0);else if((tr&F)===F){X=X.next,F===us&&(ae=!0);continue}else le={lane:0,revertLane:X.revertLane,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},L===null?(T=L=le,S=m):L=L.next=le,ze.lanes|=F,Hr|=F;le=X.action,El&&r(m,le),m=X.hasEagerState?X.eagerState:r(m,le)}else F={lane:le,revertLane:X.revertLane,gesture:X.gesture,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},L===null?(T=L=F,S=m):L=L.next=F,ze.lanes|=le,Hr|=le;X=X.next}while(X!==null&&X!==t);if(L===null?S=m:L.next=T,!In(m,e.memoizedState)&&(Ht=!0,ae&&(r=ds,r!==null)))throw r;e.memoizedState=m,e.baseState=S,e.baseQueue=L,i.lastRenderedState=m}return d===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function Xd(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 S=d=d.next;do m=e(m,S.action),S=S.next;while(S!==d);In(m,t.memoizedState)||(Ht=!0),t.memoizedState=m,t.baseQueue===null&&(t.baseState=m),r.lastRenderedState=m}return[m,i]}function tv(e,t,r){var i=ze,d=Ut(),m=Ke;if(m){if(r===void 0)throw Error(o(407));r=r()}else r=t();var S=!In((dt||d).memoizedState,r);if(S&&(d.memoizedState=r,Ht=!0),d=d.queue,Zd(rv.bind(null,i,d,e),[e]),d.getSnapshot!==t||S||Pt!==null&&Pt.memoizedState.tag&1){if(i.flags|=2048,vs(9,{destroy:void 0},av.bind(null,i,d,r,t),null),pt===null)throw Error(o(349));m||(tr&127)!==0||nv(i,t,r)}return r}function nv(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=ze.updateQueue,t===null?(t=Ji(),ze.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function av(e,t,r,i){t.value=r,t.getSnapshot=i,lv(t)&&sv(e)}function rv(e,t,r){return r(function(){lv(t)&&sv(e)})}function lv(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!In(e,r)}catch{return!0}}function sv(e){var t=gl(e,2);t!==null&&Tn(t,e,2)}function Fd(e){var t=bn();if(typeof e=="function"){var r=e;if(e=r(),El){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 ov(e,t,r,i){return e.baseState=r,Kd(e,dt,typeof i=="function"?i:nr)}function Xj(e,t,r,i,d){if(ac(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(S){m.listeners.push(S)}};_.T!==null?r(!0):m.isTransition=!1,i(m),r=t.pending,r===null?(m.next=t.pending=m,iv(t,m)):(m.next=r.next,t.pending=r.next=m)}}function iv(e,t){var r=t.action,i=t.payload,d=e.state;if(t.isTransition){var m=_.T,S={};_.T=S;try{var T=r(d,i),L=_.S;L!==null&&L(S,T),cv(e,t,T)}catch(X){Qd(e,t,X)}finally{m!==null&&S.types!==null&&(m.types=S.types),_.T=m}}else try{m=r(d,i),cv(e,t,m)}catch(X){Qd(e,t,X)}}function cv(e,t,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(i){uv(e,t,i)},function(i){return Qd(e,t,i)}):uv(e,t,r)}function uv(e,t,r){t.status="fulfilled",t.value=r,dv(t),e.state=r,t=e.pending,t!==null&&(r=t.next,r===t?e.pending=null:(r=r.next,t.next=r,iv(e,r)))}function Qd(e,t,r){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=r,dv(t),t=t.next;while(t!==i)}e.action=null}function dv(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function fv(e,t){return t}function hv(e,t){if(Ke){var r=pt.formState;if(r!==null){e:{var i=ze;if(Ke){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}}Or(i)}i=!1}i&&(t=r[0])}}return r=bn(),r.memoizedState=r.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fv,lastRenderedState:t},r.queue=i,r=Ov.bind(null,ze,i),i.dispatch=r,i=Fd(!1),m=nf.bind(null,ze,!1,i.queue),i=bn(),d={state:t,dispatch:null,action:e,pending:null},i.queue=d,r=Xj.bind(null,ze,d,m,r),d.dispatch=r,i.memoizedState=e,[t,r,!1]}function mv(e){var t=Ut();return pv(t,dt,e)}function pv(e,t,r){if(t=Kd(e,t,fv)[0],e=ec(nr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=No(t)}catch(S){throw S===fs?Vi:S}else i=t;t=Ut();var d=t.queue,m=d.dispatch;return r!==t.memoizedState&&(ze.flags|=2048,vs(9,{destroy:void 0},Fj.bind(null,d,r),null)),[i,m,e]}function Fj(e,t){e.action=t}function gv(e){var t=Ut(),r=dt;if(r!==null)return pv(t,r,e);Ut(),t=t.memoizedState,r=Ut();var i=r.queue.dispatch;return r.memoizedState=e,[t,i,!1]}function vs(e,t,r,i){return e={tag:e,create:r,deps:i,inst:t,next:null},t=ze.updateQueue,t===null&&(t=Ji(),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 vv(){return Ut().memoizedState}function tc(e,t,r,i){var d=bn();ze.flags|=e,d.memoizedState=vs(1|t,{destroy:void 0},r,i===void 0?null:i)}function nc(e,t,r,i){var d=Ut();i=i===void 0?null:i;var m=d.memoizedState.inst;dt!==null&&i!==null&&Hd(i,dt.memoizedState.deps)?d.memoizedState=vs(t,m,r,i):(ze.flags|=e,d.memoizedState=vs(1|t,m,r,i))}function xv(e,t){tc(8390656,8,e,t)}function Zd(e,t){nc(2048,8,e,t)}function Qj(e){ze.flags|=4;var t=ze.updateQueue;if(t===null)t=Ji(),ze.updateQueue=t,t.events=[e];else{var r=t.events;r===null?t.events=[e]:r.push(e)}}function yv(e){var t=Ut().memoizedState;return Qj({ref:t,nextImpl:e}),function(){if((et&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function bv(e,t){return nc(4,2,e,t)}function wv(e,t){return nc(4,4,e,t)}function Sv(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 jv(e,t,r){r=r!=null?r.concat([e]):null,nc(4,4,Sv.bind(null,t,e),r)}function Jd(){}function Cv(e,t){var r=Ut();t=t===void 0?null:t;var i=r.memoizedState;return t!==null&&Hd(t,i[1])?i[0]:(r.memoizedState=[e,t],e)}function Ev(e,t){var r=Ut();t=t===void 0?null:t;var i=r.memoizedState;if(t!==null&&Hd(t,i[1]))return i[0];if(i=e(),El){yn(!0);try{e()}finally{yn(!1)}}return r.memoizedState=[i,t],i}function Wd(e,t,r){return r===void 0||(tr&1073741824)!==0&&(Ve&261930)===0?e.memoizedState=t:(e.memoizedState=r,e=Nx(),ze.lanes|=e,Hr|=e,r)}function Nv(e,t,r,i){return In(r,t)?r:ms.current!==null?(e=Wd(e,r,i),In(e,t)||(Ht=!0),e):(tr&42)===0||(tr&1073741824)!==0&&(Ve&261930)===0?(Ht=!0,e.memoizedState=r):(e=Nx(),ze.lanes|=e,Hr|=e,t)}function Rv(e,t,r,i,d){var m=q.p;q.p=m!==0&&8>m?m:8;var S=_.T,T={};_.T=T,nf(e,!1,t,r);try{var L=d(),X=_.S;if(X!==null&&X(T,L),L!==null&&typeof L=="object"&&typeof L.then=="function"){var ae=Yj(L,i);Ro(e,t,ae,Vn(e))}else Ro(e,t,i,Vn(e))}catch(le){Ro(e,t,{then:function(){},status:"rejected",reason:le},Vn())}finally{q.p=m,S!==null&&T.types!==null&&(S.types=T.types),_.T=S}}function Zj(){}function ef(e,t,r,i){if(e.tag!==5)throw Error(o(476));var d=Tv(e).queue;Rv(e,d,t,ee,r===null?Zj:function(){return Av(e),r(i)})}function Tv(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:nr,lastRenderedState:ee},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 Av(e){var t=Tv(e);t.next===null&&(t=e.alternate.memoizedState),Ro(e,t.next.queue,{},Vn())}function tf(){return rn(Vo)}function Mv(){return Ut().memoizedState}function Dv(){return Ut().memoizedState}function Jj(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var r=Vn();e=zr(r);var i=Lr(t,e,r);i!==null&&(Tn(i,t,r),So(i,t,r)),t={cache:Md()},e.payload=t;return}t=t.return}}function Wj(e,t,r){var i=Vn();r={lane:i,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ac(e)?kv(t,r):(r=yd(e,t,r,i),r!==null&&(Tn(r,e,i),_v(r,t,i)))}function Ov(e,t,r){var i=Vn();Ro(e,t,r,i)}function Ro(e,t,r,i){var d={lane:i,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(ac(e))kv(t,d);else{var m=e.alternate;if(e.lanes===0&&(m===null||m.lanes===0)&&(m=t.lastRenderedReducer,m!==null))try{var S=t.lastRenderedState,T=m(S,r);if(d.hasEagerState=!0,d.eagerState=T,In(T,S))return Ui(e,t,d,0),pt===null&&Li(),!1}catch{}finally{}if(r=yd(e,t,d,i),r!==null)return Tn(r,e,i),_v(r,t,i),!0}return!1}function nf(e,t,r,i){if(i={lane:2,revertLane:zf(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},ac(e)){if(t)throw Error(o(479))}else t=yd(e,r,i,2),t!==null&&Tn(t,e,2)}function ac(e){var t=e.alternate;return e===ze||t!==null&&t===ze}function kv(e,t){ps=Qi=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function _v(e,t,r){if((r&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,yt(e,r)}}var To={readContext:rn,use:Wi,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};To.useEffectEvent=Ot;var zv={readContext:rn,use:Wi,useCallback:function(e,t){return bn().memoizedState=[e,t===void 0?null:t],e},useContext:rn,useEffect:xv,useImperativeHandle:function(e,t,r){r=r!=null?r.concat([e]):null,tc(4194308,4,Sv.bind(null,t,e),r)},useLayoutEffect:function(e,t){return tc(4194308,4,e,t)},useInsertionEffect:function(e,t){tc(4,2,e,t)},useMemo:function(e,t){var r=bn();t=t===void 0?null:t;var i=e();if(El){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(El){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=Wj.bind(null,ze,e),[i.memoizedState,e]},useRef:function(e){var t=bn();return e={current:e},t.memoizedState=e},useState:function(e){e=Fd(e);var t=e.queue,r=Ov.bind(null,ze,t);return t.dispatch=r,[e.memoizedState,r]},useDebugValue:Jd,useDeferredValue:function(e,t){var r=bn();return Wd(r,e,t)},useTransition:function(){var e=Fd(!1);return e=Rv.bind(null,ze,e.queue,!0,!1),bn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,r){var i=ze,d=bn();if(Ke){if(r===void 0)throw Error(o(407));r=r()}else{if(r=t(),pt===null)throw Error(o(349));(Ve&127)!==0||nv(i,t,r)}d.memoizedState=r;var m={value:r,getSnapshot:t};return d.queue=m,xv(rv.bind(null,i,m,e),[e]),i.flags|=2048,vs(9,{destroy:void 0},av.bind(null,i,m,r,t),null),r},useId:function(){var e=bn(),t=pt.identifierPrefix;if(Ke){var r=Da,i=Ma;r=(i&~(1<<32-Tt(i)-1)).toString(32)+r,t="_"+t+"R_"+r,r=Zi++,0<r&&(t+="H"+r.toString(32)),t+="_"}else r=Gj++,t="_"+t+"r_"+r.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:tf,useFormState:hv,useActionState:hv,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=nf.bind(null,ze,!0,r),r.dispatch=t,[e,t]},useMemoCache:Gd,useCacheRefresh:function(){return bn().memoizedState=Jj.bind(null,ze)},useEffectEvent:function(e){var t=bn(),r={impl:e};return t.memoizedState=r,function(){if((et&2)!==0)throw Error(o(440));return r.impl.apply(void 0,arguments)}}},af={readContext:rn,use:Wi,useCallback:Cv,useContext:rn,useEffect:Zd,useImperativeHandle:jv,useInsertionEffect:bv,useLayoutEffect:wv,useMemo:Ev,useReducer:ec,useRef:vv,useState:function(){return ec(nr)},useDebugValue:Jd,useDeferredValue:function(e,t){var r=Ut();return Nv(r,dt.memoizedState,e,t)},useTransition:function(){var e=ec(nr)[0],t=Ut().memoizedState;return[typeof e=="boolean"?e:No(e),t]},useSyncExternalStore:tv,useId:Mv,useHostTransitionStatus:tf,useFormState:mv,useActionState:mv,useOptimistic:function(e,t){var r=Ut();return ov(r,dt,e,t)},useMemoCache:Gd,useCacheRefresh:Dv};af.useEffectEvent=yv;var Lv={readContext:rn,use:Wi,useCallback:Cv,useContext:rn,useEffect:Zd,useImperativeHandle:jv,useInsertionEffect:bv,useLayoutEffect:wv,useMemo:Ev,useReducer:Xd,useRef:vv,useState:function(){return Xd(nr)},useDebugValue:Jd,useDeferredValue:function(e,t){var r=Ut();return dt===null?Wd(r,e,t):Nv(r,dt.memoizedState,e,t)},useTransition:function(){var e=Xd(nr)[0],t=Ut().memoizedState;return[typeof e=="boolean"?e:No(e),t]},useSyncExternalStore:tv,useId:Mv,useHostTransitionStatus:tf,useFormState:gv,useActionState:gv,useOptimistic:function(e,t){var r=Ut();return dt!==null?ov(r,dt,e,t):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:Gd,useCacheRefresh:Dv};Lv.useEffectEvent=yv;function rf(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 lf={enqueueSetState:function(e,t,r){e=e._reactInternals;var i=Vn(),d=zr(i);d.payload=t,r!=null&&(d.callback=r),t=Lr(e,d,i),t!==null&&(Tn(t,e,i),So(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var i=Vn(),d=zr(i);d.tag=1,d.payload=t,r!=null&&(d.callback=r),t=Lr(e,d,i),t!==null&&(Tn(t,e,i),So(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Vn(),i=zr(r);i.tag=2,t!=null&&(i.callback=t),t=Lr(e,i,r),t!==null&&(Tn(t,e,r),So(t,e,r))}};function Uv(e,t,r,i,d,m,S){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,m,S):t.prototype&&t.prototype.isPureReactComponent?!mo(r,i)||!mo(d,m):!0}function Iv(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&&lf.enqueueReplaceState(t,t.state,null)}function Nl(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 Bv(e){zi(e)}function Pv(e){console.error(e)}function Hv(e){zi(e)}function rc(e,t){try{var r=e.onUncaughtError;r(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function qv(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 sf(e,t,r){return r=zr(r),r.tag=3,r.payload={element:null},r.callback=function(){rc(e,t)},r}function $v(e){return e=zr(e),e.tag=3,e}function Vv(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(){qv(t,r,i)}}var S=r.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(e.callback=function(){qv(t,r,i),typeof d!="function"&&(qr===null?qr=new Set([this]):qr.add(this));var T=i.stack;this.componentDidCatch(i.value,{componentStack:T!==null?T:""})})}function eC(e,t,r,i,d){if(r.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=r.alternate,t!==null&&cs(t,r,d,!0),r=Pn.current,r!==null){switch(r.tag){case 31:case 13:return ia===null?gc():r.alternate===null&&kt===0&&(kt=3),r.flags&=-257,r.flags|=65536,r.lanes=d,i===Yi?r.flags|=16384:(t=r.updateQueue,t===null?r.updateQueue=new Set([i]):t.add(i),Of(e,i,d)),!1;case 22:return r.flags|=65536,i===Yi?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)),Of(e,i,d)),!1}throw Error(o(435,r.tag))}return Of(e,i,d),gc(),!1}if(Ke)return t=Pn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=d,i!==Ed&&(e=Error(o(422),{cause:i}),vo(ra(e,r)))):(i!==Ed&&(t=Error(o(423),{cause:i}),vo(ra(t,r))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,i=ra(i,r),d=sf(e.stateNode,i,d),Ld(e,d),kt!==4&&(kt=2)),!1;var m=Error(o(520),{cause:i});if(m=ra(m,r),Lo===null?Lo=[m]:Lo.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=sf(r.stateNode,i,e),Ld(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"&&(qr===null||!qr.has(m))))return r.flags|=65536,d&=-d,r.lanes|=d,d=$v(d),Vv(d,e,r,i),Ld(r,d),!1}r=r.return}while(r!==null);return!1}var of=Error(o(461)),Ht=!1;function ln(e,t,r,i){t.child=e===null?Xg(t,null,r,i):Cl(t,e.child,r,i)}function Yv(e,t,r,i,d){r=r.render;var m=t.ref;if("ref"in i){var S={};for(var T in i)T!=="ref"&&(S[T]=i[T])}else S=i;return bl(t),i=qd(e,t,r,S,m,d),T=$d(),e!==null&&!Ht?(Vd(e,t,d),ar(e,t,d)):(Ke&&T&&jd(t),t.flags|=1,ln(e,t,i,d),t.child)}function Gv(e,t,r,i,d){if(e===null){var m=r.type;return typeof m=="function"&&!bd(m)&&m.defaultProps===void 0&&r.compare===null?(t.tag=15,t.type=m,Kv(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,!gf(e,d)){var S=m.memoizedProps;if(r=r.compare,r=r!==null?r:mo,r(S,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 Kv(e,t,r,i,d){if(e!==null){var m=e.memoizedProps;if(mo(m,i)&&e.ref===t.ref)if(Ht=!1,t.pendingProps=i=m,gf(e,d))(e.flags&131072)!==0&&(Ht=!0);else return t.lanes=e.lanes,ar(e,t,d)}return cf(e,t,r,i,d)}function Xv(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 Fv(e,t,m,r,i)}if((r&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&$i(t,m!==null?m.cachePool:null),m!==null?Zg(t,m):Id(),Jg(t);else return i=t.lanes=536870912,Fv(e,t,m!==null?m.baseLanes|r:r,r,i)}else m!==null?($i(t,m.cachePool),Zg(t,m),Ir(),t.memoizedState=null):(e!==null&&$i(t,null),Id(),Ir());return ln(e,t,d,r),t.child}function Ao(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Fv(e,t,r,i,d){var m=Od();return m=m===null?null:{parent:Bt._currentValue,pool:m},t.memoizedState={baseLanes:r,cachePool:m},e!==null&&$i(t,null),Id(),Jg(t),e!==null&&cs(e,t,i,!0),t.childLanes=d,null}function lc(e,t){return t=oc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Qv(e,t,r){return Cl(t,e.child,null,r),e=lc(t,t.pendingProps),e.flags|=2,Hn(t),t.memoizedState=null,e}function tC(e,t,r){var i=t.pendingProps,d=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ke){if(i.mode==="hidden")return e=lc(t,i),t.lanes=536870912,Ao(null,e);if(Pd(t),(e=bt)?(e=iy(e,oa),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Mr!==null?{id:Ma,overflow:Da}:null,retryLane:536870912,hydrationErrors:null},r=kg(e),r.return=t,t.child=r,an=t,bt=null)):e=null,e===null)throw Or(t);return t.lanes=536870912,null}return lc(t,i)}var m=e.memoizedState;if(m!==null){var S=m.dehydrated;if(Pd(t),d)if(t.flags&256)t.flags&=-257,t=Qv(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||cs(e,t,r,!1),d=(r&e.childLanes)!==0,Ht||d){if(i=pt,i!==null&&(S=zt(i,r),S!==0&&S!==m.retryLane))throw m.retryLane=S,gl(e,S),Tn(i,e,S),of;gc(),t=Qv(e,t,r)}else e=m.treeContext,bt=ca(S.nextSibling),an=t,Ke=!0,Dr=null,oa=!1,e!==null&&Lg(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 sc(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 cf(e,t,r,i,d){return bl(t),r=qd(e,t,r,i,void 0,d),i=$d(),e!==null&&!Ht?(Vd(e,t,d),ar(e,t,d)):(Ke&&i&&jd(t),t.flags|=1,ln(e,t,r,d),t.child)}function Zv(e,t,r,i,d,m){return bl(t),t.updateQueue=null,r=ev(t,i,r,d),Wg(e),i=$d(),e!==null&&!Ht?(Vd(e,t,m),ar(e,t,m)):(Ke&&i&&jd(t),t.flags|=1,ln(e,t,r,m),t.child)}function Jv(e,t,r,i,d){if(bl(t),t.stateNode===null){var m=ls,S=r.contextType;typeof S=="object"&&S!==null&&(m=rn(S)),m=new r(i,m),t.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=lf,t.stateNode=m,m._reactInternals=t,m=t.stateNode,m.props=i,m.state=t.memoizedState,m.refs={},_d(t),S=r.contextType,m.context=typeof S=="object"&&S!==null?rn(S):ls,m.state=t.memoizedState,S=r.getDerivedStateFromProps,typeof S=="function"&&(rf(t,r,S,i),m.state=t.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(S=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),S!==m.state&&lf.enqueueReplaceState(m,m.state,null),Co(t,i,m,d),jo(),m.state=t.memoizedState),typeof m.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){m=t.stateNode;var T=t.memoizedProps,L=Nl(r,T);m.props=L;var X=m.context,ae=r.contextType;S=ls,typeof ae=="object"&&ae!==null&&(S=rn(ae));var le=r.getDerivedStateFromProps;ae=typeof le=="function"||typeof m.getSnapshotBeforeUpdate=="function",T=t.pendingProps!==T,ae||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(T||X!==S)&&Iv(t,m,i,S),_r=!1;var F=t.memoizedState;m.state=F,Co(t,i,m,d),jo(),X=t.memoizedState,T||F!==X||_r?(typeof le=="function"&&(rf(t,r,le,i),X=t.memoizedState),(L=_r||Uv(t,r,L,i,F,X,S))?(ae||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=X),m.props=i,m.state=X,m.context=S,i=L):(typeof m.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{m=t.stateNode,zd(e,t),S=t.memoizedProps,ae=Nl(r,S),m.props=ae,le=t.pendingProps,F=m.context,X=r.contextType,L=ls,typeof X=="object"&&X!==null&&(L=rn(X)),T=r.getDerivedStateFromProps,(X=typeof T=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(S!==le||F!==L)&&Iv(t,m,i,L),_r=!1,F=t.memoizedState,m.state=F,Co(t,i,m,d),jo();var J=t.memoizedState;S!==le||F!==J||_r||e!==null&&e.dependencies!==null&&Hi(e.dependencies)?(typeof T=="function"&&(rf(t,r,T,i),J=t.memoizedState),(ae=_r||Uv(t,r,ae,i,F,J,L)||e!==null&&e.dependencies!==null&&Hi(e.dependencies))?(X||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(i,J,L),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(i,J,L)),typeof m.componentDidUpdate=="function"&&(t.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof m.componentDidUpdate!="function"||S===e.memoizedProps&&F===e.memoizedState||(t.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&F===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=J),m.props=i,m.state=J,m.context=L,i=ae):(typeof m.componentDidUpdate!="function"||S===e.memoizedProps&&F===e.memoizedState||(t.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&F===e.memoizedState||(t.flags|=1024),i=!1)}return m=i,sc(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=Cl(t,e.child,null,d),t.child=Cl(t,null,r,d)):ln(e,t,r,d),t.memoizedState=m.state,e=t.child):e=ar(e,t,d),e}function Wv(e,t,r,i){return xl(),t.flags|=256,ln(e,t,r,i),t.child}var uf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function df(e){return{baseLanes:e,cachePool:qg()}}function ff(e,t,r){return e=e!==null?e.childLanes&~r:0,t&&(e|=$n),e}function ex(e,t,r){var i=t.pendingProps,d=!1,m=(t.flags&128)!==0,S;if((S=m)||(S=e!==null&&e.memoizedState===null?!1:(Lt.current&2)!==0),S&&(d=!0,t.flags&=-129),S=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ke){if(d?Ur(t):Ir(),(e=bt)?(e=iy(e,oa),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Mr!==null?{id:Ma,overflow:Da}:null,retryLane:536870912,hydrationErrors:null},r=kg(e),r.return=t,t.child=r,an=t,bt=null)):e=null,e===null)throw Or(t);return Xf(e)?t.lanes=32:t.lanes=536870912,null}var T=i.children;return i=i.fallback,d?(Ir(),d=t.mode,T=oc({mode:"hidden",children:T},d),i=vl(i,d,r,null),T.return=t,i.return=t,T.sibling=i,t.child=T,i=t.child,i.memoizedState=df(r),i.childLanes=ff(e,S,r),t.memoizedState=uf,Ao(null,i)):(Ur(t),hf(t,T))}var L=e.memoizedState;if(L!==null&&(T=L.dehydrated,T!==null)){if(m)t.flags&256?(Ur(t),t.flags&=-257,t=mf(e,t,r)):t.memoizedState!==null?(Ir(),t.child=e.child,t.flags|=128,t=null):(Ir(),T=i.fallback,d=t.mode,i=oc({mode:"visible",children:i.children},d),T=vl(T,d,r,null),T.flags|=2,i.return=t,T.return=t,i.sibling=T,t.child=i,Cl(t,e.child,null,r),i=t.child,i.memoizedState=df(r),i.childLanes=ff(e,S,r),t.memoizedState=uf,t=Ao(null,i));else if(Ur(t),Xf(T)){if(S=T.nextSibling&&T.nextSibling.dataset,S)var X=S.dgst;S=X,i=Error(o(419)),i.stack="",i.digest=S,vo({value:i,source:null,stack:null}),t=mf(e,t,r)}else if(Ht||cs(e,t,r,!1),S=(r&e.childLanes)!==0,Ht||S){if(S=pt,S!==null&&(i=zt(S,r),i!==0&&i!==L.retryLane))throw L.retryLane=i,gl(e,i),Tn(S,e,i),of;Kf(T)||gc(),t=mf(e,t,r)}else Kf(T)?(t.flags|=192,t.child=e.child,t=null):(e=L.treeContext,bt=ca(T.nextSibling),an=t,Ke=!0,Dr=null,oa=!1,e!==null&&Lg(t,e),t=hf(t,i.children),t.flags|=4096);return t}return d?(Ir(),T=i.fallback,d=t.mode,L=e.child,X=L.sibling,i=Za(L,{mode:"hidden",children:i.children}),i.subtreeFlags=L.subtreeFlags&65011712,X!==null?T=Za(X,T):(T=vl(T,d,r,null),T.flags|=2),T.return=t,i.return=t,i.sibling=T,t.child=i,Ao(null,i),i=t.child,T=e.child.memoizedState,T===null?T=df(r):(d=T.cachePool,d!==null?(L=Bt._currentValue,d=d.parent!==L?{parent:L,pool:L}:d):d=qg(),T={baseLanes:T.baseLanes|r,cachePool:d}),i.memoizedState=T,i.childLanes=ff(e,S,r),t.memoizedState=uf,Ao(e.child,i)):(Ur(t),r=e.child,e=r.sibling,r=Za(r,{mode:"visible",children:i.children}),r.return=t,r.sibling=null,e!==null&&(S=t.deletions,S===null?(t.deletions=[e],t.flags|=16):S.push(e)),t.child=r,t.memoizedState=null,r)}function hf(e,t){return t=oc({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function oc(e,t){return e=Bn(22,e,null,t),e.lanes=0,e}function mf(e,t,r){return Cl(t,e.child,null,r),e=hf(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function tx(e,t,r){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Td(e.return,t,r)}function pf(e,t,r,i,d,m){var S=e.memoizedState;S===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:d,treeForkCount:m}:(S.isBackwards=t,S.rendering=null,S.renderingStartTime=0,S.last=i,S.tail=r,S.tailMode=d,S.treeForkCount=m)}function nx(e,t,r){var i=t.pendingProps,d=i.revealOrder,m=i.tail;i=i.children;var S=Lt.current,T=(S&2)!==0;if(T?(S=S&1|2,t.flags|=128):S&=1,Z(Lt,S),ln(e,t,i,r),i=Ke?go:0,!T&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&tx(e,r,t);else if(e.tag===19)tx(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&&Fi(e)===null&&(d=r),r=r.sibling;r=d,r===null?(d=t.child,t.child=null):(d=r.sibling,r.sibling=null),pf(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&&Fi(e)===null){t.child=d;break}e=d.sibling,d.sibling=r,r=d,d=e}pf(t,!0,r,null,m,i);break;case"together":pf(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),Hr|=t.lanes,(r&t.childLanes)===0)if(e!==null){if(cs(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 gf(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Hi(e)))}function nC(e,t,r){switch(t.tag){case 3:ie(t,t.stateNode.containerInfo),kr(t,Bt,e.memoizedState.cache),xl();break;case 27:case 5:pe(t);break;case 4:ie(t,t.stateNode.containerInfo);break;case 10:kr(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Pd(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(Ur(t),t.flags|=128,null):(r&t.child.childLanes)!==0?ex(e,t,r):(Ur(t),e=ar(e,t,r),e!==null?e.sibling:null);Ur(t);break;case 19:var d=(e.flags&128)!==0;if(i=(r&t.childLanes)!==0,i||(cs(e,t,r,!1),i=(r&t.childLanes)!==0),d){if(i)return nx(e,t,r);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),Z(Lt,Lt.current),i)break;return null;case 22:return t.lanes=0,Xv(e,t,r,t.pendingProps);case 24:kr(t,Bt,e.memoizedState.cache)}return ar(e,t,r)}function ax(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ht=!0;else{if(!gf(e,r)&&(t.flags&128)===0)return Ht=!1,nC(e,t,r);Ht=(e.flags&131072)!==0}else Ht=!1,Ke&&(t.flags&1048576)!==0&&zg(t,go,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=Sl(t.elementType),t.type=e,typeof e=="function")bd(e)?(i=Nl(e,i),t.tag=1,t=Jv(null,t,e,i,r)):(t.tag=0,t=cf(null,t,e,i,r));else{if(e!=null){var d=e.$$typeof;if(d===M){t.tag=11,t=Yv(null,t,e,i,r);break e}else if(d===k){t.tag=14,t=Gv(null,t,e,i,r);break e}}throw t=Q(e)||e,Error(o(306,t,""))}}return t;case 0:return cf(e,t,t.type,t.pendingProps,r);case 1:return i=t.type,d=Nl(i,t.pendingProps),Jv(e,t,i,d,r);case 3:e:{if(ie(t,t.stateNode.containerInfo),e===null)throw Error(o(387));i=t.pendingProps;var m=t.memoizedState;d=m.element,zd(e,t),Co(t,i,null,r);var S=t.memoizedState;if(i=S.cache,kr(t,Bt,i),i!==m.cache&&Ad(t,[Bt],r,!0),jo(),i=S.element,m.isDehydrated)if(m={element:i,isDehydrated:!1,cache:S.cache},t.updateQueue.baseState=m,t.memoizedState=m,t.flags&256){t=Wv(e,t,i,r);break e}else if(i!==d){d=ra(Error(o(424)),t),vo(d),t=Wv(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),an=t,Ke=!0,Dr=null,oa=!0,r=Xg(t,null,i,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(xl(),i===d){t=ar(e,t,r);break e}ln(e,t,i,r)}t=t.child}return t;case 26:return sc(e,t),e===null?(r=my(t.type,null,t.pendingProps,null))?t.memoizedState=r:Ke||(r=t.type,e=t.pendingProps,i=jc(ye.current).createElement(r),i[nn]=t,i[Sn]=e,sn(i,r,e),Zt(i),t.stateNode=i):t.memoizedState=my(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return pe(t),e===null&&Ke&&(i=t.stateNode=dy(t.type,t.pendingProps,ye.current),an=t,oa=!0,d=bt,Gr(t.type)?(Ff=d,bt=ca(i.firstChild)):bt=d),ln(e,t,t.pendingProps.children,r),sc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ke&&((d=i=bt)&&(i=OC(i,t.type,t.pendingProps,oa),i!==null?(t.stateNode=i,an=t,bt=ca(i.firstChild),oa=!1,d=!0):d=!1),d||Or(t)),pe(t),d=t.type,m=t.pendingProps,S=e!==null?e.memoizedProps:null,i=m.children,Vf(d,m)?i=null:S!==null&&Vf(d,S)&&(t.flags|=32),t.memoizedState!==null&&(d=qd(e,t,Kj,null,null,r),Vo._currentValue=d),sc(e,t),ln(e,t,i,r),t.child;case 6:return e===null&&Ke&&((e=r=bt)&&(r=kC(r,t.pendingProps,oa),r!==null?(t.stateNode=r,an=t,bt=null,e=!0):e=!1),e||Or(t)),null;case 13:return ex(e,t,r);case 4:return ie(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Cl(t,null,i,r):ln(e,t,i,r),t.child;case 11:return Yv(e,t,t.type,t.pendingProps,r);case 7:return ln(e,t,t.pendingProps,r),t.child;case 8:return ln(e,t,t.pendingProps.children,r),t.child;case 12:return ln(e,t,t.pendingProps.children,r),t.child;case 10:return i=t.pendingProps,kr(t,t.type,i.value),ln(e,t,i.children,r),t.child;case 9:return d=t.type._context,i=t.pendingProps.children,bl(t),d=rn(d),i=i(d),t.flags|=1,ln(e,t,i,r),t.child;case 14:return Gv(e,t,t.type,t.pendingProps,r);case 15:return Kv(e,t,t.type,t.pendingProps,r);case 19:return nx(e,t,r);case 31:return tC(e,t,r);case 22:return Xv(e,t,r,t.pendingProps);case 24:return bl(t),i=rn(Bt),e===null?(d=Od(),d===null&&(d=pt,m=Md(),d.pooledCache=m,m.refCount++,m!==null&&(d.pooledCacheLanes|=r),d=m),t.memoizedState={parent:i,cache:d},_d(t),kr(t,Bt,d)):((e.lanes&r)!==0&&(zd(e,t),Co(t,null,null,r),jo()),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),kr(t,Bt,i)):(i=m.cache,kr(t,Bt,i),i!==d.cache&&Ad(t,[Bt],r,!0))),ln(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 vf(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(Mx())e.flags|=8192;else throw jl=Yi,kd}else e.flags&=-16777217}function rx(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!yy(t))if(Mx())e.flags|=8192;else throw jl=Yi,kd}function ic(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ue():536870912,e.lanes|=t,ws|=t)}function Mo(e,t){if(!Ke)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 aC(e,t,r){var i=t.pendingProps;switch(Cd(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(Bt),he(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(is(t)?rr(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Nd())),wt(t),null;case 26:var d=t.type,m=t.memoizedState;return e===null?(rr(t),m!==null?(wt(t),rx(t,m)):(wt(t),vf(t,d,null,i,r))):m?m!==e.memoizedState?(rr(t),wt(t),rx(t,m)):(wt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&rr(t),wt(t),vf(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,is(t)?Ug(t):(e=dy(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,is(t))Ug(t);else{var S=jc(ye.current);switch(m){case 1:m=S.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:m=S.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":m=S.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":m=S.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":m=S.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof i.is=="string"?S.createElement("select",{is:i.is}):S.createElement("select"),i.multiple?m.multiple=!0:i.size&&(m.size=i.size);break;default:m=typeof i.is=="string"?S.createElement(d,{is:i.is}):S.createElement(d)}}m[nn]=t,m[Sn]=i;e:for(S=t.child;S!==null;){if(S.tag===5||S.tag===6)m.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===t)break e;for(;S.sibling===null;){if(S.return===null||S.return===t)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}t.stateNode=m;e:switch(sn(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),vf(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,is(t)){if(e=t.stateNode,r=t.memoizedProps,i=null,d=an,d!==null)switch(d.tag){case 27:case 5:i=d.memoizedProps}e[nn]=t,e=!!(e.nodeValue===r||i!==null&&i.suppressHydrationWarning===!0||ey(e.nodeValue,r)),e||Or(t,!0)}else e=jc(e).createTextNode(i),e[nn]=t,t.stateNode=e}return wt(t),null;case 31:if(r=t.memoizedState,e===null||e.memoizedState!==null){if(i=is(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[nn]=t}else xl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;wt(t),e=!1}else r=Nd(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return t.flags&256?(Hn(t),t):(Hn(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=is(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[nn]=t}else xl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;wt(t),d=!1}else d=Nd(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return t.flags&256?(Hn(t),t):(Hn(t),null)}return Hn(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),ic(t,t.updateQueue),wt(t),null);case 4:return he(),e===null&&Bf(t.stateNode.containerInfo),wt(t),null;case 10:return er(t.type),wt(t),null;case 19:if(P(Lt),i=t.memoizedState,i===null)return wt(t),null;if(d=(t.flags&128)!==0,m=i.rendering,m===null)if(d)Mo(i,!1);else{if(kt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(m=Fi(e),m!==null){for(t.flags|=128,Mo(i,!1),e=m.updateQueue,t.updateQueue=e,ic(t,e),t.subtreeFlags=0,e=r,r=t.child;r!==null;)Og(r,e),r=r.sibling;return Z(Lt,Lt.current&1|2),Ke&&Ja(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&Ct()>hc&&(t.flags|=128,d=!0,Mo(i,!1),t.lanes=4194304)}else{if(!d)if(e=Fi(m),e!==null){if(t.flags|=128,d=!0,e=e.updateQueue,t.updateQueue=e,ic(t,e),Mo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!m.alternate&&!Ke)return wt(t),null}else 2*Ct()-i.renderingStartTime>hc&&r!==536870912&&(t.flags|=128,d=!0,Mo(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,Z(Lt,d?r&1|2:r&1),Ke&&Ja(t,i.treeForkCount),e):(wt(t),null);case 22:case 23:return Hn(t),Bd(),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&&ic(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&&P(wl),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),er(Bt),wt(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function rC(e,t){switch(Cd(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return er(Bt),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(Hn(t),t.alternate===null)throw Error(o(340));xl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Hn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));xl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return P(Lt),null;case 4:return he(),null;case 10:return er(t.type),null;case 22:case 23:return Hn(t),Bd(),e!==null&&P(wl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return er(Bt),null;case 25:return null;default:return null}}function lx(e,t){switch(Cd(t),t.tag){case 3:er(Bt),he();break;case 26:case 27:case 5:Ae(t);break;case 4:he();break;case 31:t.memoizedState!==null&&Hn(t);break;case 13:Hn(t);break;case 19:P(Lt);break;case 10:er(t.type);break;case 22:case 23:Hn(t),Bd(),e!==null&&P(wl);break;case 24:er(Bt)}}function Do(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,S=r.inst;i=m(),S.destroy=i}r=r.next}while(r!==d)}}catch(T){ct(t,t.return,T)}}function Br(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 S=i.inst,T=S.destroy;if(T!==void 0){S.destroy=void 0,d=t;var L=r,X=T;try{X()}catch(ae){ct(d,L,ae)}}}i=i.next}while(i!==m)}}catch(ae){ct(t,t.return,ae)}}function sx(e){var t=e.updateQueue;if(t!==null){var r=e.stateNode;try{Qg(t,r)}catch(i){ct(e,e.return,i)}}}function ox(e,t,r){r.props=Nl(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(i){ct(e,t,i)}}function Oo(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 ix(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 xf(e,t,r){try{var i=e.stateNode;NC(i,e.type,r,t),i[Sn]=t}catch(d){ct(e,e.return,d)}}function cx(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Gr(e.type)||e.tag===4}function yf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||cx(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&&Gr(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 bf(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=Fa));else if(i!==4&&(i===27&&Gr(e.type)&&(r=e.stateNode,t=null),e=e.child,e!==null))for(bf(e,t,r),e=e.sibling;e!==null;)bf(e,t,r),e=e.sibling}function cc(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&&Gr(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(cc(e,t,r),e=e.sibling;e!==null;)cc(e,t,r),e=e.sibling}function ux(e){var t=e.stateNode,r=e.memoizedProps;try{for(var i=e.type,d=t.attributes;d.length;)t.removeAttributeNode(d[0]);sn(t,i,r),t[nn]=e,t[Sn]=r}catch(m){ct(e,e.return,m)}}var lr=!1,qt=!1,wf=!1,dx=typeof WeakSet=="function"?WeakSet:Set,Jt=null;function lC(e,t){if(e=e.containerInfo,qf=Mc,e=jg(e),hd(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 S=0,T=-1,L=-1,X=0,ae=0,le=e,F=null;t:for(;;){for(var J;le!==r||d!==0&&le.nodeType!==3||(T=S+d),le!==m||i!==0&&le.nodeType!==3||(L=S+i),le.nodeType===3&&(S+=le.nodeValue.length),(J=le.firstChild)!==null;)F=le,le=J;for(;;){if(le===e)break t;if(F===r&&++X===d&&(T=S),F===m&&++ae===i&&(L=S),(J=le.nextSibling)!==null)break;le=F,F=le.parentNode}le=J}r=T===-1||L===-1?null:{start:T,end:L}}else r=null}r=r||{start:0,end:0}}else r=null;for($f={focusedElem:e,selectionRange:r},Mc=!1,Jt=t;Jt!==null;)if(t=Jt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Jt=e;else for(;Jt!==null;){switch(t=Jt,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=Nl(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)Gf(e);else if(r===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Gf(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,Jt=e;break}Jt=t.return}}function fx(e,t,r){var i=r.flags;switch(r.tag){case 0:case 11:case 15:or(e,r),i&4&&Do(5,r);break;case 1:if(or(e,r),i&4)if(e=r.stateNode,t===null)try{e.componentDidMount()}catch(S){ct(r,r.return,S)}else{var d=Nl(r.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(d,t,e.__reactInternalSnapshotBeforeUpdate)}catch(S){ct(r,r.return,S)}}i&64&&sx(r),i&512&&Oo(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{Qg(e,t)}catch(S){ct(r,r.return,S)}}break;case 27:t===null&&i&4&&ux(r);case 26:case 5:or(e,r),t===null&&i&4&&ix(r),i&512&&Oo(r,r.return);break;case 12:or(e,r);break;case 31:or(e,r),i&4&&px(e,r);break;case 13:or(e,r),i&4&&gx(e,r),i&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=mC.bind(null,r),_C(e,r))));break;case 22:if(i=r.memoizedState!==null||lr,!i){t=t!==null&&t.memoizedState!==null||qt,d=lr;var m=qt;lr=i,(qt=t)&&!m?ir(e,r,(r.subtreeFlags&8772)!==0):or(e,r),lr=d,qt=m}break;case 30:break;default:or(e,r)}}function hx(e){var t=e.alternate;t!==null&&(e.alternate=null,hx(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Qu(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 Nt=null,Cn=!1;function sr(e,t,r){for(r=r.child;r!==null;)mx(e,t,r),r=r.sibling}function mx(e,t,r){if(Dt&&typeof Dt.onCommitFiberUnmount=="function")try{Dt.onCommitFiberUnmount(ga,r)}catch{}switch(r.tag){case 26:qt||Oa(r,t),sr(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=Nt,d=Cn;Gr(r.type)&&(Nt=r.stateNode,Cn=!1),sr(e,t,r),Ho(r.stateNode),Nt=i,Cn=d;break;case 5:qt||Oa(r,t);case 6:if(i=Nt,d=Cn,Nt=null,sr(e,t,r),Nt=i,Cn=d,Nt!==null)if(Cn)try{(Nt.nodeType===9?Nt.body:Nt.nodeName==="HTML"?Nt.ownerDocument.body:Nt).removeChild(r.stateNode)}catch(m){ct(r,t,m)}else try{Nt.removeChild(r.stateNode)}catch(m){ct(r,t,m)}break;case 18:Nt!==null&&(Cn?(e=Nt,sy(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,r.stateNode),As(e)):sy(Nt,r.stateNode));break;case 4:i=Nt,d=Cn,Nt=r.stateNode.containerInfo,Cn=!0,sr(e,t,r),Nt=i,Cn=d;break;case 0:case 11:case 14:case 15:Br(2,r,t),qt||Br(4,r,t),sr(e,t,r);break;case 1:qt||(Oa(r,t),i=r.stateNode,typeof i.componentWillUnmount=="function"&&ox(r,t,i)),sr(e,t,r);break;case 21:sr(e,t,r);break;case 22:qt=(i=qt)||r.memoizedState!==null,sr(e,t,r),qt=i;break;default:sr(e,t,r)}}function px(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{As(e)}catch(r){ct(t,t.return,r)}}}function gx(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{As(e)}catch(r){ct(t,t.return,r)}}function sC(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new dx),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new dx),t;default:throw Error(o(435,e.tag))}}function uc(e,t){var r=sC(e);t.forEach(function(i){if(!r.has(i)){r.add(i);var d=pC.bind(null,e,i);i.then(d,d)}})}function En(e,t){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var d=r[i],m=e,S=t,T=S;e:for(;T!==null;){switch(T.tag){case 27:if(Gr(T.type)){Nt=T.stateNode,Cn=!1;break e}break;case 5:Nt=T.stateNode,Cn=!1;break e;case 3:case 4:Nt=T.stateNode.containerInfo,Cn=!0;break e}T=T.return}if(Nt===null)throw Error(o(160));mx(m,S,d),Nt=null,Cn=!1,m=d.alternate,m!==null&&(m.return=null),d.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)vx(t,e),t=t.sibling}var ya=null;function vx(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:En(t,e),Nn(e),i&4&&(Br(3,e,e.return),Do(3,e),Br(5,e,e.return));break;case 1:En(t,e),Nn(e),i&512&&(qt||r===null||Oa(r,r.return)),i&64&&lr&&(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(En(t,e),Nn(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[ro]||m[nn]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=d.createElement(i),d.head.insertBefore(m,d.querySelector("head > title"))),sn(m,i,r),m[nn]=e,Zt(m),i=m;break e;case"link":var S=vy("link","href",d).get(i+(r.href||""));if(S){for(var T=0;T<S.length;T++)if(m=S[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)){S.splice(T,1);break t}}m=d.createElement(i),sn(m,i,r),d.head.appendChild(m);break;case"meta":if(S=vy("meta","content",d).get(i+(r.content||""))){for(T=0;T<S.length;T++)if(m=S[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)){S.splice(T,1);break t}}m=d.createElement(i),sn(m,i,r),d.head.appendChild(m);break;default:throw Error(o(468,i))}m[nn]=e,Zt(m),i=m}e.stateNode=i}else xy(d,e.type,e.stateNode);else e.stateNode=gy(d,i,e.memoizedProps);else m!==i?(m===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):m.count--,i===null?xy(d,e.type,e.stateNode):gy(d,i,e.memoizedProps)):i===null&&e.stateNode!==null&&xf(e,e.memoizedProps,r.memoizedProps)}break;case 27:En(t,e),Nn(e),i&512&&(qt||r===null||Oa(r,r.return)),r!==null&&i&4&&xf(e,e.memoizedProps,r.memoizedProps);break;case 5:if(En(t,e),Nn(e),i&512&&(qt||r===null||Oa(r,r.return)),e.flags&32){d=e.stateNode;try{Jl(d,"")}catch(we){ct(e,e.return,we)}}i&4&&e.stateNode!=null&&(d=e.memoizedProps,xf(e,d,r!==null?r.memoizedProps:d)),i&1024&&(wf=!0);break;case 6:if(En(t,e),Nn(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(Nc=null,d=ya,ya=Cc(t.containerInfo),En(t,e),ya=d,Nn(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{As(t.containerInfo)}catch(we){ct(e,e.return,we)}wf&&(wf=!1,xx(e));break;case 4:i=ya,ya=Cc(e.stateNode.containerInfo),En(t,e),Nn(e),ya=i;break;case 12:En(t,e),Nn(e);break;case 31:En(t,e),Nn(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,uc(e,i)));break;case 13:En(t,e),Nn(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(fc=Ct()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,uc(e,i)));break;case 22:d=e.memoizedState!==null;var L=r!==null&&r.memoizedState!==null,X=lr,ae=qt;if(lr=X||d,qt=ae||L,En(t,e),qt=ae,lr=X,Nn(e),i&8192)e:for(t=e.stateNode,t._visibility=d?t._visibility&-2:t._visibility|1,d&&(r===null||L||lr||qt||Rl(e)),r=null,t=e;;){if(t.tag===5||t.tag===26){if(r===null){L=r=t;try{if(m=L.stateNode,d)S=m.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{T=L.stateNode;var le=L.memoizedProps.style,F=le!=null&&le.hasOwnProperty("display")?le.display:null;T.style.display=F==null||typeof F=="boolean"?"":(""+F).trim()}}catch(we){ct(L,L.return,we)}}}else if(t.tag===6){if(r===null){L=t;try{L.stateNode.nodeValue=d?"":L.memoizedProps}catch(we){ct(L,L.return,we)}}}else if(t.tag===18){if(r===null){L=t;try{var J=L.stateNode;d?oy(J,!0):oy(L.stateNode,!1)}catch(we){ct(L,L.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,uc(e,r))));break;case 19:En(t,e),Nn(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,uc(e,i)));break;case 30:break;case 21:break;default:En(t,e),Nn(e)}}function Nn(e){var t=e.flags;if(t&2){try{for(var r,i=e.return;i!==null;){if(cx(i)){r=i;break}i=i.return}if(r==null)throw Error(o(160));switch(r.tag){case 27:var d=r.stateNode,m=yf(e);cc(e,m,d);break;case 5:var S=r.stateNode;r.flags&32&&(Jl(S,""),r.flags&=-33);var T=yf(e);cc(e,T,S);break;case 3:case 4:var L=r.stateNode.containerInfo,X=yf(e);bf(e,X,L);break;default:throw Error(o(161))}}catch(ae){ct(e,e.return,ae)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function xx(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;xx(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;)fx(e,t.alternate,t),t=t.sibling}function Rl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Br(4,t,t.return),Rl(t);break;case 1:Oa(t,t.return);var r=t.stateNode;typeof r.componentWillUnmount=="function"&&ox(t,t.return,r),Rl(t);break;case 27:Ho(t.stateNode);case 26:case 5:Oa(t,t.return),Rl(t);break;case 22:t.memoizedState===null&&Rl(t);break;case 30:Rl(t);break;default:Rl(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,S=m.flags;switch(m.tag){case 0:case 11:case 15:ir(d,m,r),Do(4,m);break;case 1:if(ir(d,m,r),i=m,d=i.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(X){ct(i,i.return,X)}if(i=m,d=i.updateQueue,d!==null){var T=i.stateNode;try{var L=d.shared.hiddenCallbacks;if(L!==null)for(d.shared.hiddenCallbacks=null,d=0;d<L.length;d++)Fg(L[d],T)}catch(X){ct(i,i.return,X)}}r&&S&64&&sx(m),Oo(m,m.return);break;case 27:ux(m);case 26:case 5:ir(d,m,r),r&&i===null&&S&4&&ix(m),Oo(m,m.return);break;case 12:ir(d,m,r);break;case 31:ir(d,m,r),r&&S&4&&px(d,m);break;case 13:ir(d,m,r),r&&S&4&&gx(d,m);break;case 22:m.memoizedState===null&&ir(d,m,r),Oo(m,m.return);break;case 30:break;default:ir(d,m,r)}t=t.sibling}}function Sf(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&&xo(r))}function jf(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&xo(e))}function ba(e,t,r,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)yx(e,t,r,i),t=t.sibling}function yx(e,t,r,i){var d=t.flags;switch(t.tag){case 0:case 11:case 15:ba(e,t,r,i),d&2048&&Do(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&&xo(e)));break;case 12:if(d&2048){ba(e,t,r,i),e=t.stateNode;try{var m=t.memoizedProps,S=m.id,T=m.onPostCommit;typeof T=="function"&&T(S,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(L){ct(t,t.return,L)}}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,S=t.alternate,t.memoizedState!==null?m._visibility&2?ba(e,t,r,i):ko(e,t):m._visibility&2?ba(e,t,r,i):(m._visibility|=2,xs(e,t,r,i,(t.subtreeFlags&10256)!==0||!1)),d&2048&&Sf(S,t);break;case 24:ba(e,t,r,i),d&2048&&jf(t.alternate,t);break;default:ba(e,t,r,i)}}function xs(e,t,r,i,d){for(d=d&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var m=e,S=t,T=r,L=i,X=S.flags;switch(S.tag){case 0:case 11:case 15:xs(m,S,T,L,d),Do(8,S);break;case 23:break;case 22:var ae=S.stateNode;S.memoizedState!==null?ae._visibility&2?xs(m,S,T,L,d):ko(m,S):(ae._visibility|=2,xs(m,S,T,L,d)),d&&X&2048&&Sf(S.alternate,S);break;case 24:xs(m,S,T,L,d),d&&X&2048&&jf(S.alternate,S);break;default:xs(m,S,T,L,d)}t=t.sibling}}function ko(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:ko(r,i),d&2048&&Sf(i.alternate,i);break;case 24:ko(r,i),d&2048&&jf(i.alternate,i);break;default:ko(r,i)}t=t.sibling}}var _o=8192;function ys(e,t,r){if(e.subtreeFlags&_o)for(e=e.child;e!==null;)bx(e,t,r),e=e.sibling}function bx(e,t,r){switch(e.tag){case 26:ys(e,t,r),e.flags&_o&&e.memoizedState!==null&&GC(r,ya,e.memoizedState,e.memoizedProps);break;case 5:ys(e,t,r);break;case 3:case 4:var i=ya;ya=Cc(e.stateNode.containerInfo),ys(e,t,r),ya=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=_o,_o=16777216,ys(e,t,r),_o=i):ys(e,t,r));break;default:ys(e,t,r)}}function wx(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 zo(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];Jt=i,jx(i,e)}wx(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Sx(e),e=e.sibling}function Sx(e){switch(e.tag){case 0:case 11:case 15:zo(e),e.flags&2048&&Br(9,e,e.return);break;case 3:zo(e);break;case 12:zo(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,dc(e)):zo(e);break;default:zo(e)}}function dc(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];Jt=i,jx(i,e)}wx(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Br(8,t,t.return),dc(t);break;case 22:r=t.stateNode,r._visibility&2&&(r._visibility&=-3,dc(t));break;default:dc(t)}e=e.sibling}}function jx(e,t){for(;Jt!==null;){var r=Jt;switch(r.tag){case 0:case 11:case 15:Br(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:xo(r.memoizedState.cache)}if(i=r.child,i!==null)i.return=r,Jt=i;else e:for(r=e;Jt!==null;){i=Jt;var d=i.sibling,m=i.return;if(hx(i),i===r){Jt=null;break e}if(d!==null){d.return=m,Jt=d;break e}Jt=m}}}var oC={getCacheForType:function(e){var t=rn(Bt),r=t.data.get(e);return r===void 0&&(r=e(),t.data.set(e,r)),r},cacheSignal:function(){return rn(Bt).controller.signal}},iC=typeof WeakMap=="function"?WeakMap:Map,et=0,pt=null,qe=null,Ve=0,it=0,qn=null,Pr=!1,bs=!1,Cf=!1,cr=0,kt=0,Hr=0,Tl=0,Ef=0,$n=0,ws=0,Lo=null,Rn=null,Nf=!1,fc=0,Cx=0,hc=1/0,mc=null,qr=null,Yt=0,$r=null,Ss=null,ur=0,Rf=0,Tf=null,Ex=null,Uo=0,Af=null;function Vn(){return(et&2)!==0&&Ve!==0?Ve&-Ve:_.T!==null?zf():va()}function Nx(){if($n===0)if((Ve&536870912)===0||Ke){var e=Rr;Rr<<=1,(Rr&3932160)===0&&(Rr=262144),$n=e}else $n=536870912;return e=Pn.current,e!==null&&(e.flags|=32),$n}function Tn(e,t,r){(e===pt&&(it===2||it===9)||e.cancelPendingCommit!==null)&&(js(e,0),Vr(e,Ve,$n,!1)),Et(e,r),((et&2)===0||e!==pt)&&(e===pt&&((et&2)===0&&(Tl|=r),kt===4&&Vr(e,Ve,$n,!1)),ka(e))}function Rx(e,t,r){if((et&6)!==0)throw Error(o(327));var i=!r&&(t&127)===0&&(t&e.expiredLanes)===0||Ee(e,t),d=i?dC(e,t):Df(e,t,!0),m=i;do{if(d===0){bs&&!i&&Vr(e,t,0,!1);break}else{if(r=e.current.alternate,m&&!cC(r)){d=Df(e,t,!1),m=!1;continue}if(d===2){if(m=t,e.errorRecoveryDisabledLanes&m)var S=0;else S=e.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){t=S;e:{var T=e;d=Lo;var L=T.current.memoizedState.isDehydrated;if(L&&(js(T,S).flags|=256),S=Df(T,S,!1),S!==2){if(Cf&&!L){T.errorRecoveryDisabledLanes|=m,Tl|=m,d=4;break e}m=Rn,Rn=d,m!==null&&(Rn===null?Rn=m:Rn.push.apply(Rn,m))}d=S}if(m=!1,d!==2)continue}}if(d===1){js(e,0),Vr(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:Vr(i,t,$n,!Pr);break e;case 2:Rn=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(d=fc+300-Ct(),10<d)){if(Vr(i,t,$n,!Pr),It(i,0,!0)!==0)break e;ur=t,i.timeoutHandle=ry(Tx.bind(null,i,r,Rn,mc,Nf,t,$n,Tl,ws,Pr,m,"Throttled",-0,0),d);break e}Tx(i,r,Rn,mc,Nf,t,$n,Tl,ws,Pr,m,null,-0,0)}}break}while(!0);ka(e)}function Tx(e,t,r,i,d,m,S,T,L,X,ae,le,F,J){if(e.timeoutHandle=-1,le=t.subtreeFlags,le&8192||(le&16785408)===16785408){le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Fa},bx(t,m,le);var we=(m&62914560)===m?fc-Ct():(m&4194048)===m?Cx-Ct():0;if(we=KC(le,we),we!==null){ur=m,e.cancelPendingCommit=we(Lx.bind(null,e,t,m,r,i,d,S,T,L,ae,le,null,F,J)),Vr(e,m,S,!X);return}}Lx(e,t,m,r,i,d,S,T,L)}function cC(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(!In(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 Vr(e,t,r,i){t&=~Ef,t&=~Tl,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var d=t;0<d;){var m=31-Tt(d),S=1<<m;i[m]=-1,d&=~S}r!==0&&Vt(e,r,t)}function pc(){return(et&6)===0?(Io(0),!1):!0}function Mf(){if(qe!==null){if(it===0)var e=qe.return;else e=qe,Wa=yl=null,Yd(e),hs=null,bo=0,e=qe;for(;e!==null;)lx(e.alternate,e),e=e.return;qe=null}}function js(e,t){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,AC(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),ur=0,Mf(),pt=e,qe=r=Za(e.current,null),Ve=t,it=0,qn=null,Pr=!1,bs=Ee(e,t),Cf=!1,ws=$n=Ef=Tl=Hr=kt=0,Rn=Lo=null,Nf=!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,Li(),r}function Ax(e,t){ze=null,_.H=To,t===fs||t===Vi?(t=Yg(),it=3):t===kd?(t=Yg(),it=4):it=t===of?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,qn=t,qe===null&&(kt=1,rc(e,ra(t,e.current)))}function Mx(){var e=Pn.current;return e===null?!0:(Ve&4194048)===Ve?ia===null:(Ve&62914560)===Ve||(Ve&536870912)!==0?e===ia:!1}function Dx(){var e=_.H;return _.H=To,e===null?To:e}function Ox(){var e=_.A;return _.A=oC,e}function gc(){kt=4,Pr||(Ve&4194048)!==Ve&&Pn.current!==null||(bs=!0),(Hr&134217727)===0&&(Tl&134217727)===0||pt===null||Vr(pt,Ve,$n,!1)}function Df(e,t,r){var i=et;et|=2;var d=Dx(),m=Ox();(pt!==e||Ve!==t)&&(mc=null,js(e,t)),t=!1;var S=kt;e:do try{if(it!==0&&qe!==null){var T=qe,L=qn;switch(it){case 8:Mf(),S=6;break e;case 3:case 2:case 9:case 6:Pn.current===null&&(t=!0);var X=it;if(it=0,qn=null,Cs(e,T,L,X),r&&bs){S=0;break e}break;default:X=it,it=0,qn=null,Cs(e,T,L,X)}}uC(),S=kt;break}catch(ae){Ax(e,ae)}while(!0);return t&&e.shellSuspendCounter++,Wa=yl=null,et=i,_.H=d,_.A=m,qe===null&&(pt=null,Ve=0,Li()),S}function uC(){for(;qe!==null;)kx(qe)}function dC(e,t){var r=et;et|=2;var i=Dx(),d=Ox();pt!==e||Ve!==t?(mc=null,hc=Ct()+500,js(e,t)):bs=Ee(e,t);e:do try{if(it!==0&&qe!==null){t=qe;var m=qn;t:switch(it){case 1:it=0,qn=null,Cs(e,t,m,1);break;case 2:case 9:if($g(m)){it=0,qn=null,_x(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:$g(m)?(it=0,qn=null,_x(t)):(it=0,qn=null,Cs(e,t,m,7));break;case 5:var S=null;switch(qe.tag){case 26:S=qe.memoizedState;case 5:case 27:var T=qe;if(S?yy(S):T.stateNode.complete){it=0,qn=null;var L=T.sibling;if(L!==null)qe=L;else{var X=T.return;X!==null?(qe=X,vc(X)):qe=null}break t}}it=0,qn=null,Cs(e,t,m,5);break;case 6:it=0,qn=null,Cs(e,t,m,6);break;case 8:Mf(),kt=6;break e;default:throw Error(o(462))}}fC();break}catch(ae){Ax(e,ae)}while(!0);return Wa=yl=null,_.H=i,_.A=d,et=r,qe!==null?0:(pt=null,Ve=0,Li(),kt)}function fC(){for(;qe!==null&&!hn();)kx(qe)}function kx(e){var t=ax(e.alternate,e,cr);e.memoizedProps=e.pendingProps,t===null?vc(e):qe=t}function _x(e){var t=e,r=t.alternate;switch(t.tag){case 15:case 0:t=Zv(r,t,t.pendingProps,t.type,void 0,Ve);break;case 11:t=Zv(r,t,t.pendingProps,t.type.render,t.ref,Ve);break;case 5:Yd(t);default:lx(r,t),t=qe=Og(t,cr),t=ax(r,t,cr)}e.memoizedProps=e.pendingProps,t===null?vc(e):qe=t}function Cs(e,t,r,i){Wa=yl=null,Yd(t),hs=null,bo=0;var d=t.return;try{if(eC(e,d,t,r,Ve)){kt=1,rc(e,ra(r,e.current)),qe=null;return}}catch(m){if(d!==null)throw qe=d,m;kt=1,rc(e,ra(r,e.current)),qe=null;return}t.flags&32768?(Ke||i===1?e=!0:bs||(Ve&536870912)!==0?e=!1:(Pr=e=!0,(i===2||i===9||i===3||i===6)&&(i=Pn.current,i!==null&&i.tag===13&&(i.flags|=16384))),zx(t,e)):vc(t)}function vc(e){var t=e;do{if((t.flags&32768)!==0){zx(t,Pr);return}e=t.return;var r=aC(t.alternate,t,cr);if(r!==null){qe=r;return}if(t=t.sibling,t!==null){qe=t;return}qe=t=e}while(t!==null);kt===0&&(kt=5)}function zx(e,t){do{var r=rC(e.alternate,e);if(r!==null){r.flags&=32767,qe=r;return}if(r=e.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!t&&(e=e.sibling,e!==null)){qe=e;return}qe=e=r}while(e!==null);kt=6,qe=null}function Lx(e,t,r,i,d,m,S,T,L){e.cancelPendingCommit=null;do xc();while(Yt!==0);if((et&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(m=t.lanes|t.childLanes,m|=xd,ut(e,r,m,S,T,L),e===pt&&(qe=pt=null,Ve=0),Ss=t,$r=e,ur=r,Rf=m,Tf=d,Ex=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,gC(mn,function(){return Hx(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=_.T,_.T=null,d=q.p,q.p=2,S=et,et|=4;try{lC(e,t,r)}finally{et=S,q.p=d,_.T=i}}Yt=1,Ux(),Ix(),Bx()}}function Ux(){if(Yt===1){Yt=0;var e=$r,t=Ss,r=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||r){r=_.T,_.T=null;var i=q.p;q.p=2;var d=et;et|=4;try{vx(t,e);var m=$f,S=jg(e.containerInfo),T=m.focusedElem,L=m.selectionRange;if(S!==T&&T&&T.ownerDocument&&Sg(T.ownerDocument.documentElement,T)){if(L!==null&&hd(T)){var X=L.start,ae=L.end;if(ae===void 0&&(ae=X),"selectionStart"in T)T.selectionStart=X,T.selectionEnd=Math.min(ae,T.value.length);else{var le=T.ownerDocument||document,F=le&&le.defaultView||window;if(F.getSelection){var J=F.getSelection(),we=T.textContent.length,De=Math.min(L.start,we),ht=L.end===void 0?De:Math.min(L.end,we);!J.extend&&De>ht&&(S=ht,ht=De,De=S);var Y=wg(T,De),B=wg(T,ht);if(Y&&B&&(J.rangeCount!==1||J.anchorNode!==Y.node||J.anchorOffset!==Y.offset||J.focusNode!==B.node||J.focusOffset!==B.offset)){var K=le.createRange();K.setStart(Y.node,Y.offset),J.removeAllRanges(),De>ht?(J.addRange(K),J.extend(B.node,B.offset)):(K.setEnd(B.node,B.offset),J.addRange(K))}}}}for(le=[],J=T;J=J.parentNode;)J.nodeType===1&&le.push({element:J,left:J.scrollLeft,top:J.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<le.length;T++){var re=le[T];re.element.scrollLeft=re.left,re.element.scrollTop=re.top}}Mc=!!qf,$f=qf=null}finally{et=d,q.p=i,_.T=r}}e.current=t,Yt=2}}function Ix(){if(Yt===2){Yt=0;var e=$r,t=Ss,r=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||r){r=_.T,_.T=null;var i=q.p;q.p=2;var d=et;et|=4;try{fx(e,t.alternate,t)}finally{et=d,q.p=i,_.T=r}}Yt=3}}function Bx(){if(Yt===4||Yt===3){Yt=0,Qt();var e=$r,t=Ss,r=ur,i=Ex;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Yt=5:(Yt=0,Ss=$r=null,Px(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(qr=null),Ka(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=_.T,d=q.p,q.p=2,_.T=null;try{for(var m=e.onRecoverableError,S=0;S<i.length;S++){var T=i[S];m(T.value,{componentStack:T.stack})}}finally{_.T=t,q.p=d}}(ur&3)!==0&&xc(),ka(e),d=e.pendingLanes,(r&261930)!==0&&(d&42)!==0?e===Af?Uo++:(Uo=0,Af=e):Uo=0,Io(0)}}function Px(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,xo(t)))}function xc(){return Ux(),Ix(),Bx(),Hx()}function Hx(){if(Yt!==5)return!1;var e=$r,t=Rf;Rf=0;var r=Ka(ur),i=_.T,d=q.p;try{q.p=32>r?32:r,_.T=null,r=Tf,Tf=null;var m=$r,S=ur;if(Yt=0,Ss=$r=null,ur=0,(et&6)!==0)throw Error(o(331));var T=et;if(et|=4,Sx(m.current),yx(m,m.current,S,r),et=T,Io(0,!1),Dt&&typeof Dt.onPostCommitFiberRoot=="function")try{Dt.onPostCommitFiberRoot(ga,m)}catch{}return!0}finally{q.p=d,_.T=i,Px(e,t)}}function qx(e,t,r){t=ra(r,t),t=sf(e.stateNode,t,2),e=Lr(e,t,2),e!==null&&(Et(e,2),ka(e))}function ct(e,t,r){if(e.tag===3)qx(e,e,r);else for(;t!==null;){if(t.tag===3){qx(t,e,r);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(qr===null||!qr.has(i))){e=ra(r,e),r=$v(2),i=Lr(t,r,2),i!==null&&(Vv(r,i,t,e),Et(i,2),ka(i));break}}t=t.return}}function Of(e,t,r){var i=e.pingCache;if(i===null){i=e.pingCache=new iC;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)||(Cf=!0,d.add(r),e=hC.bind(null,e,t,r),t.then(e,e))}function hC(e,t,r){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,pt===e&&(Ve&r)===r&&(kt===4||kt===3&&(Ve&62914560)===Ve&&300>Ct()-fc?(et&2)===0&&js(e,0):Ef|=r,ws===Ve&&(ws=0)),ka(e)}function $x(e,t){t===0&&(t=Ue()),e=gl(e,t),e!==null&&(Et(e,t),ka(e))}function mC(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),$x(e,r)}function pC(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),$x(e,r)}function gC(e,t){return jt(e,t)}var yc=null,Es=null,kf=!1,bc=!1,_f=!1,Yr=0;function ka(e){e!==Es&&e.next===null&&(Es===null?yc=Es=e:Es=Es.next=e),bc=!0,kf||(kf=!0,xC())}function Io(e,t){if(!_f&&bc){_f=!0;do for(var r=!1,i=yc;i!==null;){if(e!==0){var d=i.pendingLanes;if(d===0)var m=0;else{var S=i.suspendedLanes,T=i.pingedLanes;m=(1<<31-Tt(42|e)+1)-1,m&=d&~(S&~T),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(r=!0,Kx(i,m))}else m=Ve,m=It(i,i===pt?m:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(m&3)===0||Ee(i,m)||(r=!0,Kx(i,m));i=i.next}while(r);_f=!1}}function vC(){Vx()}function Vx(){bc=kf=!1;var e=0;Yr!==0&&TC()&&(e=Yr);for(var t=Ct(),r=null,i=yc;i!==null;){var d=i.next,m=Yx(i,t);m===0?(i.next=null,r===null?yc=d:r.next=d,d===null&&(Es=r)):(r=i,(e!==0||(m&3)!==0)&&(bc=!0)),i=d}Yt!==0&&Yt!==5||Io(e),Yr!==0&&(Yr=0)}function Yx(e,t){for(var r=e.suspendedLanes,i=e.pingedLanes,d=e.expirationTimes,m=e.pendingLanes&-62914561;0<m;){var S=31-Tt(m),T=1<<S,L=d[S];L===-1?((T&r)===0||(T&i)!==0)&&(d[S]=_e(T,t)):L<=t&&(e.expiredLanes|=T),m&=~T}if(t=pt,r=Ve,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&&Ft(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&&Ft(i),Ka(r)){case 2:case 8:r=Mt;break;case 32:r=mn;break;case 268435456:r=Aa;break;default:r=mn}return i=Gx.bind(null,e),r=jt(r,i),e.callbackPriority=t,e.callbackNode=r,t}return i!==null&&i!==null&&Ft(i),e.callbackPriority=2,e.callbackNode=null,2}function Gx(e,t){if(Yt!==0&&Yt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(xc()&&e.callbackNode!==r)return null;var i=Ve;return i=It(e,e===pt?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(Rx(e,i,t),Yx(e,Ct()),e.callbackNode!=null&&e.callbackNode===r?Gx.bind(null,e):null)}function Kx(e,t){if(xc())return null;Rx(e,t,!0)}function xC(){MC(function(){(et&6)!==0?jt(At,vC):Vx()})}function zf(){if(Yr===0){var e=us;e===0&&(e=Ya,Ya<<=1,(Ya&261888)===0&&(Ya=256)),Yr=e}return Yr}function Xx(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ti(""+e)}function Fx(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 yC(e,t,r,i,d){if(t==="submit"&&r&&r.stateNode===d){var m=Xx((d[Sn]||null).action),S=i.submitter;S&&(t=(t=S[Sn]||null)?Xx(t.formAction):S.getAttribute("formAction"),t!==null&&(m=t,S=null));var T=new Oi("action","action",null,i,d);e.push({event:T,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Yr!==0){var L=S?Fx(d,S):new FormData(d);ef(r,{pending:!0,data:L,method:d.method,action:m},null,L)}}else typeof m=="function"&&(T.preventDefault(),L=S?Fx(d,S):new FormData(d),ef(r,{pending:!0,data:L,method:d.method,action:m},m,L))},currentTarget:d}]})}}for(var Lf=0;Lf<vd.length;Lf++){var Uf=vd[Lf],bC=Uf.toLowerCase(),wC=Uf[0].toUpperCase()+Uf.slice(1);xa(bC,"on"+wC)}xa(Ng,"onAnimationEnd"),xa(Rg,"onAnimationIteration"),xa(Tg,"onAnimationStart"),xa("dblclick","onDoubleClick"),xa("focusin","onFocus"),xa("focusout","onBlur"),xa(Uj,"onTransitionRun"),xa(Ij,"onTransitionStart"),xa(Bj,"onTransitionCancel"),xa(Ag,"onTransitionEnd"),Ql("onMouseEnter",["mouseout","mouseover"]),Ql("onMouseLeave",["mouseout","mouseover"]),Ql("onPointerEnter",["pointerout","pointerover"]),Ql("onPointerLeave",["pointerout","pointerover"]),fl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),fl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),fl("onBeforeInput",["compositionend","keypress","textInput","paste"]),fl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),fl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),fl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Bo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),SC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Bo));function Qx(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 S=i.length-1;0<=S;S--){var T=i[S],L=T.instance,X=T.currentTarget;if(T=T.listener,L!==m&&d.isPropagationStopped())break e;m=T,d.currentTarget=X;try{m(d)}catch(ae){zi(ae)}d.currentTarget=null,m=L}else for(S=0;S<i.length;S++){if(T=i[S],L=T.instance,X=T.currentTarget,T=T.listener,L!==m&&d.isPropagationStopped())break e;m=T,d.currentTarget=X;try{m(d)}catch(ae){zi(ae)}d.currentTarget=null,m=L}}}}function $e(e,t){var r=t[Fu];r===void 0&&(r=t[Fu]=new Set);var i=e+"__bubble";r.has(i)||(Zx(t,e,2,!1),r.add(i))}function If(e,t,r){var i=0;t&&(i|=4),Zx(r,e,i,t)}var wc="_reactListening"+Math.random().toString(36).slice(2);function Bf(e){if(!e[wc]){e[wc]=!0,Vp.forEach(function(r){r!=="selectionchange"&&(SC.has(r)||If(r,!1,e),If(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[wc]||(t[wc]=!0,If("selectionchange",!1,t))}}function Zx(e,t,r,i){switch(Ny(t)){case 2:var d=QC;break;case 8:d=ZC;break;default:d=eh}r=d.bind(null,t,r,e),d=void 0,!rd||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 Pf(e,t,r,i,d){var m=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var S=i.tag;if(S===3||S===4){var T=i.stateNode.containerInfo;if(T===d)break;if(S===4)for(S=i.return;S!==null;){var L=S.tag;if((L===3||L===4)&&S.stateNode.containerInfo===d)return;S=S.return}for(;T!==null;){if(S=Kl(T),S===null)return;if(L=S.tag,L===5||L===6||L===26||L===27){i=m=S;continue e}T=T.parentNode}}i=i.return}ng(function(){var X=m,ae=nd(r),le=[];e:{var F=Mg.get(e);if(F!==void 0){var J=Oi,we=e;switch(e){case"keypress":if(Mi(r)===0)break e;case"keydown":case"keyup":J=pj;break;case"focusin":we="focus",J=id;break;case"focusout":we="blur",J=id;break;case"beforeblur":case"afterblur":J=id;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":J=lg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":J=aj;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":J=xj;break;case Ng:case Rg:case Tg:J=sj;break;case Ag:J=bj;break;case"scroll":case"scrollend":J=tj;break;case"wheel":J=Sj;break;case"copy":case"cut":case"paste":J=ij;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":J=og;break;case"toggle":case"beforetoggle":J=Cj}var De=(t&4)!==0,ht=!De&&(e==="scroll"||e==="scrollend"),Y=De?F!==null?F+"Capture":null:F;De=[];for(var B=X,K;B!==null;){var re=B;if(K=re.stateNode,re=re.tag,re!==5&&re!==26&&re!==27||K===null||Y===null||(re=so(B,Y),re!=null&&De.push(Po(B,re,K))),ht)break;B=B.return}0<De.length&&(F=new J(F,we,null,r,ae),le.push({event:F,listeners:De}))}}if((t&7)===0){e:{if(F=e==="mouseover"||e==="pointerover",J=e==="mouseout"||e==="pointerout",F&&r!==td&&(we=r.relatedTarget||r.fromElement)&&(Kl(we)||we[Gl]))break e;if((J||F)&&(F=ae.window===ae?ae:(F=ae.ownerDocument)?F.defaultView||F.parentWindow:window,J?(we=r.relatedTarget||r.toElement,J=X,we=we?Kl(we):null,we!==null&&(ht=u(we),De=we.tag,we!==ht||De!==5&&De!==27&&De!==6)&&(we=null)):(J=null,we=X),J!==we)){if(De=lg,re="onMouseLeave",Y="onMouseEnter",B="mouse",(e==="pointerout"||e==="pointerover")&&(De=og,re="onPointerLeave",Y="onPointerEnter",B="pointer"),ht=J==null?F:lo(J),K=we==null?F:lo(we),F=new De(re,B+"leave",J,r,ae),F.target=ht,F.relatedTarget=K,re=null,Kl(ae)===X&&(De=new De(Y,B+"enter",we,r,ae),De.target=K,De.relatedTarget=ht,re=De),ht=re,J&&we)t:{for(De=jC,Y=J,B=we,K=0,re=Y;re;re=De(re))K++;re=0;for(var Te=B;Te;Te=De(Te))re++;for(;0<K-re;)Y=De(Y),K--;for(;0<re-K;)B=De(B),re--;for(;K--;){if(Y===B||B!==null&&Y===B.alternate){De=Y;break t}Y=De(Y),B=De(B)}De=null}else De=null;J!==null&&Jx(le,F,J,De,!1),we!==null&&ht!==null&&Jx(le,ht,we,De,!0)}}e:{if(F=X?lo(X):window,J=F.nodeName&&F.nodeName.toLowerCase(),J==="select"||J==="input"&&F.type==="file")var Ze=pg;else if(hg(F))if(gg)Ze=_j;else{Ze=Oj;var Se=Dj}else J=F.nodeName,!J||J.toLowerCase()!=="input"||F.type!=="checkbox"&&F.type!=="radio"?X&&ed(X.elementType)&&(Ze=pg):Ze=kj;if(Ze&&(Ze=Ze(e,X))){mg(le,Ze,r,ae);break e}Se&&Se(e,F,X),e==="focusout"&&X&&F.type==="number"&&X.memoizedProps.value!=null&&Wu(F,"number",F.value)}switch(Se=X?lo(X):window,e){case"focusin":(hg(Se)||Se.contentEditable==="true")&&(ns=Se,md=X,po=null);break;case"focusout":po=md=ns=null;break;case"mousedown":pd=!0;break;case"contextmenu":case"mouseup":case"dragend":pd=!1,Cg(le,r,ae);break;case"selectionchange":if(Lj)break;case"keydown":case"keyup":Cg(le,r,ae)}var Ie;if(ud)e:{switch(e){case"compositionstart":var Ye="onCompositionStart";break e;case"compositionend":Ye="onCompositionEnd";break e;case"compositionupdate":Ye="onCompositionUpdate";break e}Ye=void 0}else ts?dg(e,r)&&(Ye="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(Ye="onCompositionStart");Ye&&(ig&&r.locale!=="ko"&&(ts||Ye!=="onCompositionStart"?Ye==="onCompositionEnd"&&ts&&(Ie=ag()):(Ar=ae,ld="value"in Ar?Ar.value:Ar.textContent,ts=!0)),Se=Sc(X,Ye),0<Se.length&&(Ye=new sg(Ye,e,null,r,ae),le.push({event:Ye,listeners:Se}),Ie?Ye.data=Ie:(Ie=fg(r),Ie!==null&&(Ye.data=Ie)))),(Ie=Nj?Rj(e,r):Tj(e,r))&&(Ye=Sc(X,"onBeforeInput"),0<Ye.length&&(Se=new sg("onBeforeInput","beforeinput",null,r,ae),le.push({event:Se,listeners:Ye}),Se.data=Ie)),yC(le,e,X,r,ae)}Qx(le,t)})}function Po(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=so(e,r),d!=null&&i.unshift(Po(e,d,m)),d=so(e,t),d!=null&&i.push(Po(e,d,m))),e.tag===3)return i;e=e.return}return[]}function jC(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Jx(e,t,r,i,d){for(var m=t._reactName,S=[];r!==null&&r!==i;){var T=r,L=T.alternate,X=T.stateNode;if(T=T.tag,L!==null&&L===i)break;T!==5&&T!==26&&T!==27||X===null||(L=X,d?(X=so(r,m),X!=null&&S.unshift(Po(r,X,L))):d||(X=so(r,m),X!=null&&S.push(Po(r,X,L)))),r=r.return}S.length!==0&&e.push({event:t,listeners:S})}var CC=/\r\n?/g,EC=/\u0000|\uFFFD/g;function Wx(e){return(typeof e=="string"?e:""+e).replace(CC,`
49
+ `).replace(EC,"")}function ey(e,t){return t=Wx(t),Wx(e)===t}function ft(e,t,r,i,d,m){switch(r){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||Jl(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&Jl(e,""+i);break;case"className":Ni(e,"class",i);break;case"tabIndex":Ni(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Ni(e,r,i);break;case"style":eg(e,i,m);break;case"data":if(t!=="object"){Ni(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=Ti(""+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=Ti(""+i),e.setAttribute(r,i);break;case"onClick":i!=null&&(e.onclick=Fa);break;case"onScroll":i!=null&&$e("scroll",e);break;case"onScrollEnd":i!=null&&$e("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=Ti(""+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":$e("beforetoggle",e),$e("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=WS.get(r)||r,Ei(e,r,i))}}function Hf(e,t,r,i,d,m){switch(r){case"style":eg(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"?Jl(e,i):(typeof i=="number"||typeof i=="bigint")&&Jl(e,""+i);break;case"onScroll":i!=null&&$e("scroll",e);break;case"onScrollEnd":i!=null&&$e("scrollend",e);break;case"onClick":i!=null&&(e.onclick=Fa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Yp.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[Sn]||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 sn(e,t,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":$e("error",e),$e("load",e);var i=!1,d=!1,m;for(m in r)if(r.hasOwnProperty(m)){var S=r[m];if(S!=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,S,r,null)}}d&&ft(e,t,"srcSet",r.srcSet,r,null),i&&ft(e,t,"src",r.src,r,null);return;case"input":$e("invalid",e);var T=m=S=d=null,L=null,X=null;for(i in r)if(r.hasOwnProperty(i)){var ae=r[i];if(ae!=null)switch(i){case"name":d=ae;break;case"type":S=ae;break;case"checked":L=ae;break;case"defaultChecked":X=ae;break;case"value":m=ae;break;case"defaultValue":T=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(o(137,t));break;default:ft(e,t,i,ae,r,null)}}Qp(e,m,T,L,X,S,d,!1);return;case"select":$e("invalid",e),i=S=m=null;for(d in r)if(r.hasOwnProperty(d)&&(T=r[d],T!=null))switch(d){case"value":m=T;break;case"defaultValue":S=T;break;case"multiple":i=T;default:ft(e,t,d,T,r,null)}t=m,r=S,e.multiple=!!i,t!=null?Zl(e,!!i,t,!1):r!=null&&Zl(e,!!i,r,!0);return;case"textarea":$e("invalid",e),m=d=i=null;for(S in r)if(r.hasOwnProperty(S)&&(T=r[S],T!=null))switch(S){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,S,T,r,null)}Jp(e,i,d,m);return;case"option":for(L in r)if(r.hasOwnProperty(L)&&(i=r[L],i!=null))switch(L){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:ft(e,t,L,i,r,null)}return;case"dialog":$e("beforetoggle",e),$e("toggle",e),$e("cancel",e),$e("close",e);break;case"iframe":case"object":$e("load",e);break;case"video":case"audio":for(i=0;i<Bo.length;i++)$e(Bo[i],e);break;case"image":$e("error",e),$e("load",e);break;case"details":$e("toggle",e);break;case"embed":case"source":case"link":$e("error",e),$e("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(X in r)if(r.hasOwnProperty(X)&&(i=r[X],i!=null))switch(X){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:ft(e,t,X,i,r,null)}return;default:if(ed(t)){for(ae in r)r.hasOwnProperty(ae)&&(i=r[ae],i!==void 0&&Hf(e,t,ae,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 NC(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,S=null,T=null,L=null,X=null,ae=null;for(J in r){var le=r[J];if(r.hasOwnProperty(J)&&le!=null)switch(J){case"checked":break;case"value":break;case"defaultValue":L=le;default:i.hasOwnProperty(J)||ft(e,t,J,null,i,le)}}for(var F in i){var J=i[F];if(le=r[F],i.hasOwnProperty(F)&&(J!=null||le!=null))switch(F){case"type":m=J;break;case"name":d=J;break;case"checked":X=J;break;case"defaultChecked":ae=J;break;case"value":S=J;break;case"defaultValue":T=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(o(137,t));break;default:J!==le&&ft(e,t,F,J,i,le)}}Ju(e,S,T,L,X,ae,m,d);return;case"select":J=S=T=F=null;for(m in r)if(L=r[m],r.hasOwnProperty(m)&&L!=null)switch(m){case"value":break;case"multiple":J=L;default:i.hasOwnProperty(m)||ft(e,t,m,null,i,L)}for(d in i)if(m=i[d],L=r[d],i.hasOwnProperty(d)&&(m!=null||L!=null))switch(d){case"value":F=m;break;case"defaultValue":T=m;break;case"multiple":S=m;default:m!==L&&ft(e,t,d,m,i,L)}t=T,r=S,i=J,F!=null?Zl(e,!!r,F,!1):!!i!=!!r&&(t!=null?Zl(e,!!r,t,!0):Zl(e,!!r,r?[]:"",!1));return;case"textarea":J=F=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(S in i)if(d=i[S],m=r[S],i.hasOwnProperty(S)&&(d!=null||m!=null))switch(S){case"value":F=d;break;case"defaultValue":J=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(o(91));break;default:d!==m&&ft(e,t,S,d,i,m)}Zp(e,F,J);return;case"option":for(var we in r)if(F=r[we],r.hasOwnProperty(we)&&F!=null&&!i.hasOwnProperty(we))switch(we){case"selected":e.selected=!1;break;default:ft(e,t,we,null,i,F)}for(L in i)if(F=i[L],J=r[L],i.hasOwnProperty(L)&&F!==J&&(F!=null||J!=null))switch(L){case"selected":e.selected=F&&typeof F!="function"&&typeof F!="symbol";break;default:ft(e,t,L,F,i,J)}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)F=r[De],r.hasOwnProperty(De)&&F!=null&&!i.hasOwnProperty(De)&&ft(e,t,De,null,i,F);for(X in i)if(F=i[X],J=r[X],i.hasOwnProperty(X)&&F!==J&&(F!=null||J!=null))switch(X){case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(o(137,t));break;default:ft(e,t,X,F,i,J)}return;default:if(ed(t)){for(var ht in r)F=r[ht],r.hasOwnProperty(ht)&&F!==void 0&&!i.hasOwnProperty(ht)&&Hf(e,t,ht,void 0,i,F);for(ae in i)F=i[ae],J=r[ae],!i.hasOwnProperty(ae)||F===J||F===void 0&&J===void 0||Hf(e,t,ae,F,i,J);return}}for(var Y in r)F=r[Y],r.hasOwnProperty(Y)&&F!=null&&!i.hasOwnProperty(Y)&&ft(e,t,Y,null,i,F);for(le in i)F=i[le],J=r[le],!i.hasOwnProperty(le)||F===J||F==null&&J==null||ft(e,t,le,F,i,J)}function ty(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function RC(){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,S=d.initiatorType,T=d.duration;if(m&&T&&ty(S)){for(S=0,T=d.responseEnd,i+=1;i<r.length;i++){var L=r[i],X=L.startTime;if(X>T)break;var ae=L.transferSize,le=L.initiatorType;ae&&ty(le)&&(L=L.responseEnd,S+=ae*(L<T?1:(T-X)/(L-X)))}if(--i,t+=8*(m+S)/(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 qf=null,$f=null;function jc(e){return e.nodeType===9?e:e.ownerDocument}function ny(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 ay(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 Vf(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 Yf=null;function TC(){var e=window.event;return e&&e.type==="popstate"?e===Yf?!1:(Yf=e,!0):(Yf=null,!1)}var ry=typeof setTimeout=="function"?setTimeout:void 0,AC=typeof clearTimeout=="function"?clearTimeout:void 0,ly=typeof Promise=="function"?Promise:void 0,MC=typeof queueMicrotask=="function"?queueMicrotask:typeof ly<"u"?function(e){return ly.resolve(null).then(e).catch(DC)}:ry;function DC(e){setTimeout(function(){throw e})}function Gr(e){return e==="head"}function sy(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),As(t);return}i--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")i++;else if(r==="html")Ho(e.ownerDocument.documentElement);else if(r==="head"){r=e.ownerDocument.head,Ho(r);for(var m=r.firstChild;m;){var S=m.nextSibling,T=m.nodeName;m[ro]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&m.rel.toLowerCase()==="stylesheet"||r.removeChild(m),m=S}}else r==="body"&&Ho(e.ownerDocument.body);r=d}while(r);As(t)}function oy(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 Gf(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":Gf(r),Qu(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function OC(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[ro])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 kC(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 iy(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 Kf(e){return e.data==="$?"||e.data==="$~"}function Xf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function _C(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 Ff=null;function cy(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 uy(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 dy(e,t,r){switch(t=jc(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 Ho(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Qu(e)}var ua=new Map,fy=new Set;function Cc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var dr=q.d;q.d={f:zC,r:LC,D:UC,C:IC,L:BC,m:PC,X:qC,S:HC,M:$C};function zC(){var e=dr.f(),t=pc();return e||t}function LC(e){var t=Xl(e);t!==null&&t.tag===5&&t.type==="form"?Av(t):dr.r(e)}var Ns=typeof document>"u"?null:document;function hy(e,t,r){var i=Ns;if(i&&typeof t=="string"&&t){var d=na(t);d='link[rel="'+e+'"][href="'+d+'"]',typeof r=="string"&&(d+='[crossorigin="'+r+'"]'),fy.has(d)||(fy.add(d),e={rel:e,crossOrigin:r,href:t},i.querySelector(d)===null&&(t=i.createElement("link"),sn(t,"link",e),Zt(t),i.head.appendChild(t)))}}function UC(e){dr.D(e),hy("dns-prefetch",e,null)}function IC(e,t){dr.C(e,t),hy("preconnect",e,t)}function BC(e,t,r){dr.L(e,t,r);var i=Ns;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=Rs(e);break;case"script":m=Ts(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(qo(m))||t==="script"&&i.querySelector($o(m))||(t=i.createElement("link"),sn(t,"link",e),Zt(t),i.head.appendChild(t)))}}function PC(e,t){dr.m(e,t);var r=Ns;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=Ts(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($o(m)))return}i=r.createElement("link"),sn(i,"link",e),Zt(i),r.head.appendChild(i)}}}function HC(e,t,r){dr.S(e,t,r);var i=Ns;if(i&&e){var d=Fl(i).hoistableStyles,m=Rs(e);t=t||"default";var S=d.get(m);if(!S){var T={loading:0,preload:null};if(S=i.querySelector(qo(m)))T.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},r),(r=ua.get(m))&&Qf(e,r);var L=S=i.createElement("link");Zt(L),sn(L,"link",e),L._p=new Promise(function(X,ae){L.onload=X,L.onerror=ae}),L.addEventListener("load",function(){T.loading|=1}),L.addEventListener("error",function(){T.loading|=2}),T.loading|=4,Ec(S,t,i)}S={type:"stylesheet",instance:S,count:1,state:T},d.set(m,S)}}}function qC(e,t){dr.X(e,t);var r=Ns;if(r&&e){var i=Fl(r).hoistableScripts,d=Ts(e),m=i.get(d);m||(m=r.querySelector($o(d)),m||(e=y({src:e,async:!0},t),(t=ua.get(d))&&Zf(e,t),m=r.createElement("script"),Zt(m),sn(m,"link",e),r.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},i.set(d,m))}}function $C(e,t){dr.M(e,t);var r=Ns;if(r&&e){var i=Fl(r).hoistableScripts,d=Ts(e),m=i.get(d);m||(m=r.querySelector($o(d)),m||(e=y({src:e,async:!0,type:"module"},t),(t=ua.get(d))&&Zf(e,t),m=r.createElement("script"),Zt(m),sn(m,"link",e),r.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},i.set(d,m))}}function my(e,t,r,i){var d=(d=ye.current)?Cc(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=Rs(r.href),r=Fl(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=Rs(r.href);var m=Fl(d).hoistableStyles,S=m.get(e);if(S||(d=d.ownerDocument||d,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(e,S),(m=d.querySelector(qo(e)))&&!m._p&&(S.instance=m,S.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||VC(d,e,r,S.state))),t&&i===null)throw Error(o(528,""));return S}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=Ts(r),r=Fl(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 Rs(e){return'href="'+na(e)+'"'}function qo(e){return'link[rel="stylesheet"]['+e+"]"}function py(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function VC(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}),sn(t,"link",r),Zt(t),e.head.appendChild(t))}function Ts(e){return'[src="'+na(e)+'"]'}function $o(e){return"script[async]"+e}function gy(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,Zt(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"),Zt(i),sn(i,"style",d),Ec(i,r.precedence,e),t.instance=i;case"stylesheet":d=Rs(r.href);var m=e.querySelector(qo(d));if(m)return t.state.loading|=4,t.instance=m,Zt(m),m;i=py(r),(d=ua.get(d))&&Qf(i,d),m=(e.ownerDocument||e).createElement("link"),Zt(m);var S=m;return S._p=new Promise(function(T,L){S.onload=T,S.onerror=L}),sn(m,"link",i),t.state.loading|=4,Ec(m,r.precedence,e),t.instance=m;case"script":return m=Ts(r.src),(d=e.querySelector($o(m)))?(t.instance=d,Zt(d),d):(i=r,(d=ua.get(m))&&(i=y({},r),Zf(i,d)),e=e.ownerDocument||e,d=e.createElement("script"),Zt(d),sn(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,S=0;S<i.length;S++){var T=i[S];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 Qf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Zf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Nc=null;function vy(e,t,r){if(Nc===null){var i=new Map,d=Nc=new Map;d.set(r,i)}else d=Nc,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[ro]||m[nn]||e==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var S=m.getAttribute(t)||"";S=e+S;var T=i.get(S);T?T.push(m):i.set(S,[m])}}return i}function xy(e,t,r){e=e.ownerDocument||e,e.head.insertBefore(r,t==="title"?e.querySelector("head > title"):null)}function YC(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 yy(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function GC(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=Rs(i.href),m=t.querySelector(qo(d));if(m){t=m._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Rc.bind(e),t.then(e,e)),r.state.loading|=4,r.instance=m,Zt(m);return}m=t.ownerDocument||t,i=py(i),(d=ua.get(d))&&Qf(i,d),m=m.createElement("link"),Zt(m);var S=m;S._p=new Promise(function(T,L){S.onload=T,S.onerror=L}),sn(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=Rc.bind(e),t.addEventListener("load",r),t.addEventListener("error",r))}}var Jf=0;function KC(e,t){return e.stylesheets&&e.count===0&&Ac(e,e.stylesheets),0<e.count||0<e.imgCount?function(r){var i=setTimeout(function(){if(e.stylesheets&&Ac(e,e.stylesheets),e.unsuspend){var m=e.unsuspend;e.unsuspend=null,m()}},6e4+t);0<e.imgBytes&&Jf===0&&(Jf=62500*RC());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ac(e,e.stylesheets),e.unsuspend)){var m=e.unsuspend;e.unsuspend=null,m()}},(e.imgBytes>Jf?50:800)+t);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(d)}}:null}function Rc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ac(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Tc=null;function Ac(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Tc=new Map,t.forEach(XC,e),Tc=null,Rc.call(e))}function XC(e,t){if(!(t.state.loading&4)){var r=Tc.get(e);if(r)var i=r.get(null);else{r=new Map,Tc.set(e,r);for(var d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<d.length;m++){var S=d[m];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(r.set(S.dataset.precedence,S),i=S)}i&&r.set(null,i)}d=t.instance,S=d.getAttribute("data-precedence"),m=r.get(S)||i,m===i&&r.set(null,d),r.set(S,d),this.count++,i=Rc.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 Vo={$$typeof:A,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function FC(e,t,r,i,d,m,S,T,L){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=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=L,this.incompleteTransitions=new Map}function by(e,t,r,i,d,m,S,T,L,X,ae,le){return e=new FC(e,t,r,S,L,X,ae,le,T),t=1,m===!0&&(t|=24),m=Bn(3,null,null,t),e.current=m,m.stateNode=e,t=Md(),t.refCount++,e.pooledCache=t,t.refCount++,m.memoizedState={element:i,isDehydrated:r,cache:t},_d(m),e}function wy(e){return e?(e=ls,e):ls}function Sy(e,t,r,i,d,m){d=wy(d),i.context===null?i.context=d:i.pendingContext=d,i=zr(t),i.payload={element:r},m=m===void 0?null:m,m!==null&&(i.callback=m),r=Lr(e,i,t),r!==null&&(Tn(r,e,t),So(r,e,t))}function jy(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Wf(e,t){jy(e,t),(e=e.alternate)&&jy(e,t)}function Cy(e){if(e.tag===13||e.tag===31){var t=gl(e,67108864);t!==null&&Tn(t,e,67108864),Wf(e,67108864)}}function Ey(e){if(e.tag===13||e.tag===31){var t=Vn();t=Ga(t);var r=gl(e,t);r!==null&&Tn(r,e,t),Wf(e,t)}}var Mc=!0;function QC(e,t,r,i){var d=_.T;_.T=null;var m=q.p;try{q.p=2,eh(e,t,r,i)}finally{q.p=m,_.T=d}}function ZC(e,t,r,i){var d=_.T;_.T=null;var m=q.p;try{q.p=8,eh(e,t,r,i)}finally{q.p=m,_.T=d}}function eh(e,t,r,i){if(Mc){var d=th(i);if(d===null)Pf(e,t,i,Dc,r),Ry(e,i);else if(WC(d,e,t,r,i))i.stopPropagation();else if(Ry(e,i),t&4&&-1<JC.indexOf(e)){for(;d!==null;){var m=Xl(d);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var S=at(m.pendingLanes);if(S!==0){var T=m;for(T.pendingLanes|=2,T.entangledLanes|=2;S;){var L=1<<31-Tt(S);T.entanglements[1]|=L,S&=~L}ka(m),(et&6)===0&&(hc=Ct()+500,Io(0))}}break;case 31:case 13:T=gl(m,2),T!==null&&Tn(T,m,2),pc(),Wf(m,2)}if(m=th(i),m===null&&Pf(e,t,i,Dc,r),m===d)break;d=m}d!==null&&i.stopPropagation()}else Pf(e,t,i,null,r)}}function th(e){return e=nd(e),nh(e)}var Dc=null;function nh(e){if(Dc=null,e=Kl(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 Dc=e,null}function Ny(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 mn:case pa:return 32;case Aa:return 268435456;default:return 32}default:return 32}}var ah=!1,Kr=null,Xr=null,Fr=null,Yo=new Map,Go=new Map,Qr=[],JC="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 Ry(e,t){switch(e){case"focusin":case"focusout":Kr=null;break;case"dragenter":case"dragleave":Xr=null;break;case"mouseover":case"mouseout":Fr=null;break;case"pointerover":case"pointerout":Yo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Go.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=Xl(t),t!==null&&Cy(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function WC(e,t,r,i,d){switch(t){case"focusin":return Kr=Ko(Kr,e,t,r,i,d),!0;case"dragenter":return Xr=Ko(Xr,e,t,r,i,d),!0;case"mouseover":return Fr=Ko(Fr,e,t,r,i,d),!0;case"pointerover":var m=d.pointerId;return Yo.set(m,Ko(Yo.get(m)||null,e,t,r,i,d)),!0;case"gotpointercapture":return m=d.pointerId,Go.set(m,Ko(Go.get(m)||null,e,t,r,i,d)),!0}return!1}function Ty(e){var t=Kl(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,Tr(e.priority,function(){Ey(r)});return}}else if(t===31){if(t=p(r),t!==null){e.blockedOn=t,Tr(e.priority,function(){Ey(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 Oc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=th(e.nativeEvent);if(r===null){r=e.nativeEvent;var i=new r.constructor(r.type,r);td=i,r.target.dispatchEvent(i),td=null}else return t=Xl(r),t!==null&&Cy(t),e.blockedOn=r,!1;t.shift()}return!0}function Ay(e,t,r){Oc(e)&&r.delete(t)}function e2(){ah=!1,Kr!==null&&Oc(Kr)&&(Kr=null),Xr!==null&&Oc(Xr)&&(Xr=null),Fr!==null&&Oc(Fr)&&(Fr=null),Yo.forEach(Ay),Go.forEach(Ay)}function kc(e,t){e.blockedOn===t&&(e.blockedOn=null,ah||(ah=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,e2)))}var _c=null;function My(e){_c!==e&&(_c=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){_c===e&&(_c=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(nh(i||r)===null)continue;break}var m=Xl(r);m!==null&&(e.splice(t,3),t-=3,ef(m,{pending:!0,data:d,method:r.method,action:i},i,d))}}))}function As(e){function t(L){return kc(L,e)}Kr!==null&&kc(Kr,e),Xr!==null&&kc(Xr,e),Fr!==null&&kc(Fr,e),Yo.forEach(t),Go.forEach(t);for(var r=0;r<Qr.length;r++){var i=Qr[r];i.blockedOn===e&&(i.blockedOn=null)}for(;0<Qr.length&&(r=Qr[0],r.blockedOn===null);)Ty(r),r.blockedOn===null&&Qr.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],S=d[Sn]||null;if(typeof m=="function")S||My(r);else if(S){var T=null;if(m&&m.hasAttribute("formAction")){if(d=m,S=m[Sn]||null)T=S.formAction;else if(nh(d)!==null)continue}else T=S.action;typeof T=="function"?r[i+1]=T:(r.splice(i,3),i-=3),My(r)}}}function Dy(){function e(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(S){return d=S})},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 rh(e){this._internalRoot=e}zc.prototype.render=rh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var r=t.current,i=Vn();Sy(r,i,e,t,null,null)},zc.prototype.unmount=rh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Sy(e.current,2,null,e,null,null),pc(),t[Gl]=null}};function zc(e){this._internalRoot=e}zc.prototype.unstable_scheduleHydration=function(e){if(e){var t=va();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Qr.length&&t!==0&&t<Qr[r].priority;r++);Qr.splice(r,0,e),r===0&&Ty(e)}};var Oy=a.version;if(Oy!=="19.2.8")throw Error(o(527,Oy,"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 t2={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:_,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Lc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Lc.isDisabled&&Lc.supportsFiber)try{ga=Lc.inject(t2),Dt=Lc}catch{}}return Fo.createRoot=function(e,t){if(!c(e))throw Error(o(299));var r=!1,i="",d=Bv,m=Pv,S=Hv;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&&(S=t.onRecoverableError)),t=by(e,1,!1,null,null,r,i,null,d,m,S,Dy),e[Gl]=t.current,Bf(e),new rh(t)},Fo.hydrateRoot=function(e,t,r){if(!c(e))throw Error(o(299));var i=!1,d="",m=Bv,S=Pv,T=Hv,L=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&&(S=r.onCaughtError),r.onRecoverableError!==void 0&&(T=r.onRecoverableError),r.formState!==void 0&&(L=r.formState)),t=by(e,1,!0,t,r??null,i,d,L,m,S,T,Dy),t.context=wy(null),r=t.current,i=Vn(),i=Ga(i),d=zr(i),d.callback=null,Lr(r,d,i),r=i,t.current.lanes=r,Et(t,r),ka(t),e[Gl]=t.current,Bf(e),new zc(t)},Fo.version="19.2.8",Fo}var Yy;function d2(){if(Yy)return ih.exports;Yy=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(),ih.exports=u2(),ih.exports}var f2=d2();const h2=xm(f2);/**
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 bm=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Wb=/^[\\/]{2}/;function m2(n,a){return a+n.replace(/\\/g,"/")}var Gy="popstate";function Ky(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function p2(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 _h("",{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:ni(c)}return v2(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 g2(){return Math.random().toString(36).substring(2,10)}function Xy(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 _h(n,a,l=null,o,c){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof a=="string"?Ys(a):a,state:l,key:a&&a.key||o||g2(),mask:c}}function ni({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 Ys(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 v2(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:j.location,delta:R})}function b(C,R){p="PUSH";let D=Ky(C)?C:_h(j.location,C,R);v=x()+1;let A=Xy(D,v),M=j.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:j.location,delta:1})}function w(C,R){p="REPLACE";let D=Ky(C)?C:_h(j.location,C,R);v=x();let A=Xy(D,v),M=j.createHref(D.mask||D);f.replaceState(A,"",M),u&&g&&g({action:p,location:j.location,delta:0})}function E(C){return x2(c,C)}let j={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(Gy,y),g=C,()=>{c.removeEventListener(Gy,y),g=null}},createHref(C){return a(c,C)},createURL:E,encodeLocation(C){let R=E(C);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:b,replace:w,go(C){return f.go(C)}};return j}function x2(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:ni(a);return c=c.replace(/ $/,"%20"),!l&&Wb.test(c)&&(c=o+c),new URL(c,o)}function e0(n,a,l="/"){return y2(n,a,l,!1)}function y2(n,a,l,o,c){let u=typeof a=="string"?Ys(a):a,f=yr(u.pathname||"/",l);if(f==null)return null;let p=b2(n),g=null,v=D2(f);for(let x=0;g==null&&x<p.length;++x)g=M2(p[x],v,o);return g}function b2(n){let a=t0(n);return w2(a),a}function t0(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}".`),t0(f.children,a,b,y,g)),!(f.path==null&&!f.index)&&a.push({path:y,score:T2(y,f.index),routesMeta:b.map((w,E)=>{let[j,C]=r0(w.relativePath,w.caseSensitive,E===b.length-1);return{...w,matcher:j,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 n0(f.path))u(f,p,!0,v)}),a}function n0(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=n0(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 w2(n){n.sort((a,l)=>a.score!==l.score?l.score-a.score:A2(a.routesMeta.map(o=>o.childrenIndex),l.routesMeta.map(o=>o.childrenIndex)))}var S2=/^:[\w-]+$/,j2=3,C2=2,E2=1,N2=10,R2=-2,Fy=n=>n==="*";function T2(n,a){let l=n.split("/"),o=l.length;return l.some(Fy)&&(o+=R2),a&&(o+=C2),l.filter(c=>!Fy(c)).reduce((c,u)=>c+(S2.test(u)?j2:u===""?E2:N2),o)}function A2(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 M2(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?a0(y,x,g.matcher,g.compiledParams):ou(y,x),w=g.route;if(!b&&v&&l&&!o[o.length-1].route.index&&(b=ou({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:_2(Ca([u,b.pathnameBase])),route:w}),b.pathnameBase!=="/"&&(u=Ca([u,b.pathnameBase]))}return f}function ou(n,a){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[l,o]=r0(n.path,n.caseSensitive,n.end);return a0(n,a,l,o)}function a0(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 E=p[b]||"";f=u.slice(0,u.length-E.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 r0(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 D2(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 O2(n,a="/"){let{pathname:l,search:o="",hash:c=""}=typeof n=="string"?Ys(n):n,u;return l?(l=l0(l),l.startsWith("/")?u=Qy(l.substring(1),"/"):u=Qy(l,a)):u=a,{pathname:u,search:z2(o),hash:L2(c)}}function Qy(n,a){let l=iu(a).split("/");return n.split("/").forEach(c=>{c===".."?l.length>1&&l.pop():c!=="."&&l.push(c)}),l.length>1?l.join("/"):"/"}function fh(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 k2(n){return n.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function wm(n){let a=k2(n);return a.map((l,o)=>o===a.length-1?l.pathname:l.pathnameBase)}function bu(n,a,l,o=!1){let c;typeof n=="string"?c=Ys(n):(c={...n},Rt(!c.pathname||!c.pathname.includes("?"),fh("?","pathname","search",c)),Rt(!c.pathname||!c.pathname.includes("#"),fh("#","pathname","hash",c)),Rt(!c.search||!c.search.includes("#"),fh("#","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=O2(c,p),v=f&&f!=="/"&&f.endsWith("/"),x=(u||f===".")&&l.endsWith("/");return!g.pathname.endsWith("/")&&(v||x)&&(g.pathname+="/"),g}var l0=n=>n.replace(/[\\/]{2,}/g,"/"),Ca=n=>l0(n.join("/")),iu=n=>n.replace(/\/+$/,""),_2=n=>iu(n).replace(/^\/*/,"/"),z2=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,L2=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,U2=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 I2(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function B2(n){let a=n.map(l=>l.route.path).filter(Boolean);return Ca(a)||"/"}var s0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function o0(n,a){let l=n;if(typeof l!="string"||!bm.test(l))return{absoluteURL:void 0,isExternal:!1,to:l};let o=l,c=!1;if(s0)try{let u=new URL(window.location.href),f=Wb.test(l)?new URL(m2(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 i0=["POST","PUT","PATCH","DELETE"];new Set(i0);var P2=["GET",...i0];new Set(P2);var H2=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function q2(n){try{return H2.includes(new URL(n).protocol)}catch{return!1}}var Gs=h.createContext(null);Gs.displayName="DataRouter";var wu=h.createContext(null);wu.displayName="DataRouterState";var c0=h.createContext(!1);function $2(){return h.useContext(c0)}var u0=h.createContext({isTransitioning:!1});u0.displayName="ViewTransition";var V2=h.createContext(new Map);V2.displayName="Fetchers";var Y2=h.createContext(null);Y2.displayName="Await";var Zn=h.createContext(null);Zn.displayName="Navigation";var di=h.createContext(null);di.displayName="Location";var $a=h.createContext({outlet:null,matches:[],isDataRoute:!1});$a.displayName="Route";var Sm=h.createContext(null);Sm.displayName="RouteError";var d0="REACT_ROUTER_ERROR",G2="REDIRECT",K2="ROUTE_ERROR_RESPONSE";function X2(n){if(n.startsWith(`${d0}:${G2}:{`))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 F2(n){if(n.startsWith(`${d0}:${K2}:{`))try{let a=JSON.parse(n.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new U2(a.status,a.statusText,a.data)}catch{}}function Q2(n,{relative:a}={}){Rt(Ks(),"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}=hi(n,{relative:a}),p=u;return l!=="/"&&(p=u==="/"?l:Ca([l,u])),o.createHref({pathname:p,search:f,hash:c})}function Ks(){return h.useContext(di)!=null}function zn(){return Rt(Ks(),"useLocation() may be used only in the context of a <Router> component."),h.useContext(di).location}var f0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function h0(n){h.useContext(Zn).static||h.useLayoutEffect(n)}function fi(){let{isDataRoute:n}=h.useContext($a);return n?cE():Z2()}function Z2(){Rt(Ks(),"useNavigate() may be used only in the context of a <Router> component.");let n=h.useContext(Gs),{basename:a,navigator:l}=h.useContext(Zn),{matches:o}=h.useContext($a),{pathname:c}=zn(),u=JSON.stringify(wm(o)),f=h.useRef(!1);return h0(()=>{f.current=!0}),h.useCallback((g,v={})=>{if(ha(f.current,f0),!f.current)return;if(typeof g=="number"){l.go(g);return}let x=bu(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 hi(n,{relative:a}={}){let{matches:l}=h.useContext($a),{pathname:o}=zn(),c=JSON.stringify(wm(l));return h.useMemo(()=>bu(n,JSON.parse(c),o,a==="path"),[n,c,o,a])}function J2(n,a){return m0(n,a)}function m0(n,a,l){var C;Rt(Ks(),"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||"";g0(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=zn(),y;if(a){let R=typeof a=="string"?Ys(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 E=l&&l.state.matches.length?l.state.matches.map(R=>Object.assign(R,{route:l.manifest[R.route.id]||R.route})):e0(n,{pathname:w});ha(v||E!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),ha(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.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 j=aE(E&&E.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&&j?h.createElement(di.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...y},navigationType:"POP"}},j):j}function W2(){let n=iE(),a=I2(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 eE=h.createElement(W2,null),p0=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=F2(n.digest);l&&(n=l)}let a=n!==void 0?h.createElement($a.Provider,{value:this.props.routeContext},h.createElement(Sm.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?h.createElement(tE,{error:n},a):a}};p0.contextType=c0;var hh=new WeakMap;function tE({children:n,error:a}){let{basename:l}=h.useContext(Zn);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let o=X2(a.digest);if(o){let c=hh.get(a);if(c)throw c;let u=o0(o.location,l),f=u.absoluteURL||u.to;if(q2(f))throw new Error("Invalid redirect location");if(s0&&!hh.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 hh.set(a,p),p}return h.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f}`})}}return n}function nE({routeContext:n,match:a,children:l}){let o=h.useContext(Gs);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 aE(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,E=y.route.loader&&!b.hasOwnProperty(y.route.id)&&(!w||w[y.route.id]===void 0);if(y.route.lazy||E){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:B2(o.matches),errorInfo:y})}:void 0;return c.reduceRight((x,y,b)=>{let w,E=!1,j=null,C=null;o&&(w=u&&y.route.id?u[y.route.id]:void 0,j=y.route.errorElement||eE,f&&(p<0&&b===0?(g0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,C=null):p===b&&(E=!0,C=y.route.hydrateFallbackElement||null)));let R=a.concat(c.slice(0,b+1)),D=()=>{let A;return w?A=j:E?A=C:y.route.Component?A=h.createElement(y.route.Component,null):y.route.element?A=y.route.element:A=x,h.createElement(nE,{match:y,routeContext:{outlet:x,matches:R,isDataRoute:o!=null},children:A})};return o&&(y.route.ErrorBoundary||y.route.errorElement||b===0)?h.createElement(p0,{location:o.location,revalidation:o.revalidation,component:j,error:w,children:D(),routeContext:{outlet:null,matches:R,isDataRoute:!0},onError:v}):D()},null)}function jm(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function rE(n){let a=h.useContext(Gs);return Rt(a,jm(n)),a}function lE(n){let a=h.useContext(wu);return Rt(a,jm(n)),a}function sE(n){let a=h.useContext($a);return Rt(a,jm(n)),a}function Cm(n){let a=sE(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 oE(){return Cm("useRouteId")}function iE(){var o;let n=h.useContext(Sm),a=lE("useRouteError"),l=Cm("useRouteError");return n!==void 0?n:(o=a.errors)==null?void 0:o[l]}function cE(){let{router:n}=rE("useNavigate"),a=Cm("useNavigate"),l=h.useRef(!1);return h0(()=>{l.current=!0}),h.useCallback(async(c,u={})=>{ha(l.current,f0),l.current&&(typeof c=="number"?await n.navigate(c):await n.navigate(c,{fromRouteId:a,...u}))},[n,a])}var Zy={};function g0(n,a,l){!a&&!Zy[n]&&(Zy[n]=!0,ha(!1,l))}h.memo(uE);function uE({routes:n,manifest:a,future:l,state:o,isStatic:c,onError:u}){return m0(n,void 0,{manifest:a,state:o,isStatic:c,onError:u})}function zh({to:n,replace:a,state:l,relative:o}){Rt(Ks(),"<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}=zn(),p=fi(),g=bu(n,wm(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 An(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 dE({basename:n="/",children:a=null,location:l,navigationType:o="POP",navigator:c,static:u=!1,useTransitions:f}){Rt(!Ks(),"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=Ys(l));let{pathname:v="/",search:x="",hash:y="",state:b=null,key:w="default",mask:E}=l,j=h.useMemo(()=>{let C=yr(v,p);return C==null?null:{location:{pathname:C,search:x,hash:y,state:b,key:w,mask:E},navigationType:o}},[p,v,x,y,b,w,o,E]);return ha(j!=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.`),j==null?null:h.createElement(Zn.Provider,{value:g},h.createElement(di.Provider,{children:a,value:j}))}function v0({children:n,location:a}){return J2(Lh(n),a)}function Lh(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,Lh(o.props.children,u));return}Rt(o.type===An,`[${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=Lh(o.props.children,u)),l.push(f)}),l}var Wc="get",eu="application/x-www-form-urlencoded";function Su(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function fE(n){return Su(n)&&n.tagName.toLowerCase()==="button"}function hE(n){return Su(n)&&n.tagName.toLowerCase()==="form"}function mE(n){return Su(n)&&n.tagName.toLowerCase()==="input"}function pE(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function gE(n,a){return n.button===0&&(!a||a==="_self")&&!pE(n)}function Uh(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 vE(n,a){let l=Uh(n);return a&&a.forEach((o,c)=>{l.has(c)||a.getAll(c).forEach(u=>{l.append(c,u)})}),l}var Uc=null;function xE(){if(Uc===null)try{new FormData(document.createElement("form"),0),Uc=!1}catch{Uc=!0}return Uc}var yE=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function mh(n){return n!=null&&!yE.has(n)?(ha(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${eu}"`),null):n}function bE(n,a){let l,o,c,u,f;if(hE(n)){let p=n.getAttribute("action");o=p?yr(p,a):null,l=n.getAttribute("method")||Wc,c=mh(n.getAttribute("enctype"))||eu,u=new FormData(n)}else if(fE(n)||mE(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")||Wc,c=mh(n.getAttribute("formenctype"))||mh(p.getAttribute("enctype"))||eu,u=new FormData(p,n),!xE()){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(Su(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');l=Wc,o=null,c=eu,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 Em(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function x0(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=`${iu(a)}/_root.${o}`:c.pathname=`${iu(c.pathname)}.${o}`,c}async function wE(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 SE(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 jE(n,a,l){let o=await Promise.all(n.map(async c=>{let u=a.routes[c.route.id];if(u){let f=await wE(u,l);return f.links?f.links():[]}return[]}));return RE(o.flat(1).filter(SE).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function Jy(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 CE(n,a,{includeHydrateFallback:l}={}){return EE(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 EE(n){return[...new Set(n)]}function NE(n){let a={},l=Object.keys(n).sort();for(let o of l)a[o]=n[o];return a}function RE(n,a){let l=new Set;return new Set(a),n.reduce((o,c)=>{let u=JSON.stringify(NE(c));return l.has(u)||(l.add(u),o.push({key:u,link:c})),o},[])}function Nm(){let n=h.useContext(Gs);return Em(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function TE(){let n=h.useContext(wu);return Em(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var Rm=h.createContext(void 0);Rm.displayName="FrameworkContext";function ju(){let n=h.useContext(Rm);return Em(n,"You must render this element inside a <HydratedRouter> element"),n}function AE(n,a){let l=h.useContext(Rm),[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 j=R=>{R.forEach(D=>{f(D.isIntersecting)})},C=new IntersectionObserver(j,{threshold:.5});return b.current&&C.observe(b.current),()=>{C.disconnect()}}},[n]),h.useEffect(()=>{if(o){let j=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(j)}}},[o]);let w=()=>{c(!0)},E=()=>{c(!1),f(!1)};return l?n!=="intent"?[u,b,{}]:[u,b,{onFocus:Qo(p,w),onBlur:Qo(g,E),onMouseEnter:Qo(v,w),onMouseLeave:Qo(x,E),onTouchStart:Qo(y,w)}]:[!1,b,{}]}function Qo(n,a){return l=>{n&&n(l),l.defaultPrevented||a(l)}}function ME({page:n,...a}){let l=$2(),{nonce:o}=ju(),{router:c}=Nm(),u=h.useMemo(()=>e0(c.routes,n,c.basename),[c.routes,n,c.basename]);return u?(a.nonce==null&&o&&(a={...a,nonce:o}),l?h.createElement(OE,{page:n,matches:u,...a}):h.createElement(kE,{page:n,matches:u,...a})):null}function DE(n){let{manifest:a,routeModules:l}=ju(),[o,c]=h.useState([]);return h.useEffect(()=>{let u=!1;return jE(n,a,l).then(f=>{u||c(f)}),()=>{u=!0}},[n,a,l]),o}function OE({page:n,matches:a,...l}){let o=zn(),{future:c}=ju(),{basename:u}=Nm(),f=h.useMemo(()=>{if(n===o.pathname+o.search+o.hash)return[];let p=x0(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 kE({page:n,matches:a,...l}){let o=zn(),{future:c,manifest:u,routeModules:f}=ju(),{basename:p}=Nm(),{loaderData:g,matches:v}=TE(),x=h.useMemo(()=>Jy(n,a,v,u,o,"data"),[n,a,v,u,o]),y=h.useMemo(()=>Jy(n,a,v,u,o,"assets"),[n,a,v,u,o]),b=h.useMemo(()=>{if(n===o.pathname+o.search+o.hash)return[];let j=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:j.add(D.route.id))}),j.size===0)return[];let R=x0(n,p,c.v8_trailingSlashAwareDataRequests,"data");return C&&j.size>0&&R.searchParams.set("_routes",a.filter(D=>j.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(()=>CE(y,u),[y,u]),E=DE(y);return h.createElement(h.Fragment,null,b.map(j=>h.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...l})),w.map(j=>h.createElement("link",{key:j,rel:"modulepreload",href:j,...l})),E.map(({key:j,link:C})=>h.createElement("link",{key:j,nonce:l.nonce,...C,crossOrigin:C.crossOrigin??l.crossOrigin})))}function _E(...n){return a=>{n.forEach(l=>{typeof l=="function"?l(a):l!=null&&(l.current=a)})}}var zE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{zE&&(window.__reactRouterVersion="7.18.2")}catch{}function LE({basename:n,children:a,useTransitions:l,window:o}){let c=h.useRef();c.current==null&&(c.current=p2({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(dE,{basename:n,children:a,location:f.location,navigationType:f.action,navigator:u,useTransitions:l})}var Ol=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,...E},j){let{basename:C,navigator:R,useTransitions:D}=h.useContext(Zn),A=typeof x=="string"&&bm.test(x),M=o0(x,C);x=M.to;let O=Q2(x,{relative:c}),N=zn(),k=null;if(p){let de=bu(p,[],N.mask?N.mask.pathname:"/",!0);C!=="/"&&(de.pathname=de.pathname==="/"?C:Ca([C,de.pathname])),k=R.createHref(de)}let[U,V,te]=AE(o,E),$=BE(x,{replace:f,mask:p,state:g,target:v,preventScrollReset:y,relative:c,viewTransition:b,defaultShouldRevalidate:w,useTransitions:D});function H(de){a&&a(de),de.defaultPrevented||$(de)}let I=!(M.isExternal||u),Q=h.createElement("a",{...E,...te,href:(I?k:void 0)||M.absoluteURL||O,onClick:I?H:a,ref:_E(j,V),target:v,"data-discover":!A&&l==="render"?"true":void 0});return U&&!A?h.createElement(h.Fragment,null,Q,h.createElement(ME,{page:O})):Q});Ol.displayName="Link";var y0=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=hi(f,{relative:v.relative}),b=zn(),w=h.useContext(wu),{navigator:E,basename:j}=h.useContext(Zn),C=w!=null&&YE(y)&&p===!0,R=E.encodeLocation?E.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&&j&&(A=yr(A,j)||A);const M=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let O=D===R||!c&&D.startsWith(R)&&D.charAt(M)==="/",N=A!=null&&(A===R||!c&&A.startsWith(R)&&A.charAt(R.length)==="/"),k={isActive:O,isPending:N,isTransitioning:C},U=O?a:void 0,V;typeof o=="function"?V=o(k):V=[o,O?"active":null,N?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let te=typeof u=="function"?u(k):u;return h.createElement(Ol,{...v,"aria-current":U,className:V,ref:x,style:te,to:f,viewTransition:p},typeof g=="function"?g(k):g)});y0.displayName="NavLink";var UE=h.forwardRef(({discover:n="render",fetcherKey:a,navigate:l,reloadDocument:o,replace:c,state:u,method:f=Wc,action:p,onSubmit:g,relative:v,preventScrollReset:x,viewTransition:y,defaultShouldRevalidate:b,...w},E)=>{let{useTransitions:j}=h.useContext(Zn),C=$E(),R=VE(p,{relative:v}),D=f.toLowerCase()==="get"?"get":"post",A=typeof p=="string"&&bm.test(p),M=O=>{if(g&&g(O),O.defaultPrevented)return;O.preventDefault();let N=O.nativeEvent.submitter,k=(N==null?void 0:N.getAttribute("formmethod"))||f,U=()=>C(N||O.currentTarget,{fetcherKey:a,method:k,navigate:l,replace:c,state:u,relative:v,preventScrollReset:x,viewTransition:y,defaultShouldRevalidate:b});j&&l!==!1?h.startTransition(()=>U()):U()};return h.createElement("form",{ref:E,method:D,action:R,onSubmit:o?g:M,...w,"data-discover":!A&&n==="render"?"true":void 0})});UE.displayName="Form";function IE(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function b0(n){let a=h.useContext(Gs);return Rt(a,IE(n)),a}function BE(n,{target:a,replace:l,mask:o,state:c,preventScrollReset:u,relative:f,viewTransition:p,defaultShouldRevalidate:g,useTransitions:v}={}){let x=fi(),y=zn(),b=hi(n,{relative:f});return h.useCallback(w=>{if(gE(w,a)){w.preventDefault();let E=l!==void 0?l:ni(y)===ni(b),j=()=>x(n,{replace:E,mask:o,state:c,preventScrollReset:u,relative:f,viewTransition:p,defaultShouldRevalidate:g});v?h.startTransition(()=>j()):j()}},[y,x,b,l,o,c,a,n,u,f,p,g,v])}function PE(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(Uh(n)),l=h.useRef(!1),o=zn(),c=h.useMemo(()=>vE(o.search,l.current?null:a.current),[o.search]),u=fi(),f=h.useCallback((p,g)=>{const v=Uh(typeof p=="function"?p(new URLSearchParams(c)):p);l.current=!0,u("?"+v,g)},[u,c]);return[c,f]}var HE=0,qE=()=>`__${String(++HE)}__`;function $E(){let{router:n}=b0("useSubmit"),{basename:a}=h.useContext(Zn),l=oE(),o=n.fetch,c=n.navigate;return h.useCallback(async(u,f={})=>{let{action:p,method:g,encType:v,formData:x,body:y}=bE(u,a);if(f.navigate===!1){let b=f.fetcherKey||qE();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 VE(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={...hi(n||".",{relative:a})},f=zn();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])),ni(u)}function YE(n,{relative:a}={}){let l=h.useContext(u0);Rt(l!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=b0("useViewTransitionState"),c=hi(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 ou(c.pathname,f)!=null||ou(c.pathname,u)!=null}var ja=Jb();const GE=xm(ja),Tm="",Ih="x-csrf-token",Wy=new Set(["/api/admin/login","/api/admin/setup"]);let Is=null,ph=null;async function w0(){return Is||(ph??(ph=fetch(`${Tm}/api/admin/csrf`,{credentials:"include"}).then(async n=>{if(!n.ok)throw new Error("Unable to acquire CSRF token");return Is=(await n.json()).csrfToken,Is}).finally(()=>{ph=null})),ph)}class Am 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 S0(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 Am(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 zs(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"&&!Wy.has(a)&&!f[Ih]&&(f[Ih]=await w0());const p=await fetch(`${Tm}${a}`,{...o,method:n,headers:f,body:u?JSON.stringify(l):void 0,credentials:"include"});try{return await S0(p)}catch(g){const v=g instanceof Am&&(g.status===401||g.status===403)&&(g.type==="authentication_error"||g.type==="csrf_error");if(c&&v&&n!=="GET"&&n!=="HEAD"&&!Wy.has(a))return Is=null,zs(n,a,l,o,!1);throw g}}async function j0(n,a,l=!0){const o=await fetch(`${Tm}${n}`,{method:"POST",headers:{[Ih]:await w0()},body:a,credentials:"include"});try{return await S0(o)}catch(c){const u=c instanceof Am&&(c.status===401||c.status===403)&&(c.type==="authentication_error"||c.type==="csrf_error");if(l&&u)return Is=null,j0(n,a,!1);throw c}}const xe={get:(n,a)=>zs("GET",n,void 0,a),post:(n,a,l)=>zs("POST",n,a,l),upload:j0,patch:(n,a,l)=>zs("PATCH",n,a,l),put:(n,a,l)=>zs("PUT",n,a,l),del:(n,a)=>zs("DELETE",n,void 0,a)},C0=h.createContext(void 0);function KE({children:n}){const[a,l]=h.useState(null),[o,c]=h.useState(!0),u=h.useCallback(async()=>{try{const g=await xe.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 xe.post("/api/admin/login",b);return l({id:"admin",username:w.username,totpEnabled:w.totpEnabled}),{totpRequired:!1}}catch(w){const E=w.status,j=w.type;if(E===401&&j==="totp_required")return{totpRequired:!0};throw w}},[]),p=h.useCallback(async()=>{await xe.post("/api/admin/logout"),l(null)},[]);return s.jsx(C0.Provider,{value:{user:a,loading:o,login:f,logout:p,refresh:u},children:n})}function Mm(){const n=h.useContext(C0);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 XE=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),E0=(...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 FE={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 QE=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,...FE,width:a,height:a,stroke:n,strokeWidth:o?Number(l)*24/Number(a):l,className:E0("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(QE,{ref:u,iconNode:a,className:E0(`lucide-${XE(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 N0=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 ZE=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 JE=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 WE=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 Dm=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 R0=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 eN=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 T0=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 tN=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 Cu=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 nN=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 aN=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 rN=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 lN=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 tu=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 sN=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 oN=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 Om=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 iN=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 cN=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 uN=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 dN=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 A0=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 fN=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 M0=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 D0=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 hN=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 mN=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 pN=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 gN=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 O0=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 vN=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 xN=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 mi=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 k0=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 yN=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 bN=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 wN=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 km=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 SN=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 jN=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 CN=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 EN=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 NN=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 pi=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 RN=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 TN=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 AN=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 MN=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 Eu=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 DN=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 _0(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=_0(n[a]))&&(o&&(o+=" "),o+=l)}else for(l in n)n[l]&&(o&&(o+=" "),o+=l);return o}function z0(){for(var n,a,l=0,o="",c=arguments.length;l<c;l++)(n=arguments[l])&&(a=_0(n))&&(o&&(o+=" "),o+=a);return o}const _m="-",ON=n=>{const a=_N(n),{conflictingClassGroups:l,conflictingClassGroupModifiers:o}=n;return{getClassGroupId:f=>{const p=f.split(_m);return p[0]===""&&p.length!==1&&p.shift(),L0(p,a)||kN(f)},getConflictingClassGroupIds:(f,p)=>{const g=l[f]||[];return p&&o[f]?[...g,...o[f]]:g}}},L0=(n,a)=>{var f;if(n.length===0)return a.classGroupId;const l=n[0],o=a.nextPart.get(l),c=o?L0(n.slice(1),o):void 0;if(c)return c;if(a.validators.length===0)return;const u=n.join(_m);return(f=a.validators.find(({validator:p})=>p(u)))==null?void 0:f.classGroupId},eb=/^\[(.+)\]$/,kN=n=>{if(eb.test(n)){const a=eb.exec(n)[1],l=a==null?void 0:a.substring(0,a.indexOf(":"));if(l)return"arbitrary.."+l}},_N=n=>{const{theme:a,prefix:l}=n,o={nextPart:new Map,validators:[]};return LN(Object.entries(n.classGroups),l).forEach(([u,f])=>{Bh(f,o,u,a)}),o},Bh=(n,a,l,o)=>{n.forEach(c=>{if(typeof c=="string"){const u=c===""?a:tb(a,c);u.classGroupId=l;return}if(typeof c=="function"){if(zN(c)){Bh(c(o),a,l,o);return}a.validators.push({validator:c,classGroupId:l});return}Object.entries(c).forEach(([u,f])=>{Bh(f,tb(a,u),l,o)})})},tb=(n,a)=>{let l=n;return a.split(_m).forEach(o=>{l.nextPart.has(o)||l.nextPart.set(o,{nextPart:new Map,validators:[]}),l=l.nextPart.get(o)}),l},zN=n=>n.isThemeGetter,LN=(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,UN=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)}}},U0="!",IN=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(U0),E=w?b.substring(1):b,j=y&&y>x?y-x:void 0;return{modifiers:g,hasImportantModifier:w,baseClassName:E,maybePostfixModifierPosition:j}};return l?p=>l({className:p,parseClassName:f}):f},BN=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},PN=n=>({cache:UN(n.cacheSize),parseClassName:IN(n),...ON(n)}),HN=/\s+/,qN=(n,a)=>{const{parseClassName:l,getClassGroupId:o,getConflictingClassGroupIds:c}=a,u=[],f=n.trim().split(HN);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 E=!!w,j=o(E?b.substring(0,w):b);if(!j){if(!E){p=v+(p.length>0?" "+p:p);continue}if(j=o(b),!j){p=v+(p.length>0?" "+p:p);continue}E=!1}const C=BN(x).join(":"),R=y?C+U0:C,D=R+j;if(u.includes(D))continue;u.push(D);const A=c(j,E);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 $N(){let n=0,a,l,o="";for(;n<arguments.length;)(a=arguments[n++])&&(l=I0(a))&&(o&&(o+=" "),o+=l);return o}const I0=n=>{if(typeof n=="string")return n;let a,l="";for(let o=0;o<n.length;o++)n[o]&&(a=I0(n[o]))&&(l&&(l+=" "),l+=a);return l};function VN(n,...a){let l,o,c,u=f;function f(g){const v=a.reduce((x,y)=>y(x),n());return l=PN(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=qN(g,l);return c(g,x),x}return function(){return u($N.apply(null,arguments))}}const St=n=>{const a=l=>l[n]||[];return a.isThemeGetter=!0,a},B0=/^\[(?:([a-z-]+):)?(.+)\]$/i,YN=/^\d+\/\d+$/,GN=new Set(["px","full","screen"]),KN=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,XN=/\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$/,FN=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,QN=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ZN=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,fr=n=>Bs(n)||GN.has(n)||YN.test(n),Jr=n=>Xs(n,"length",lR),Bs=n=>!!n&&!Number.isNaN(Number(n)),gh=n=>Xs(n,"number",Bs),Zo=n=>!!n&&Number.isInteger(Number(n)),JN=n=>n.endsWith("%")&&Bs(n.slice(0,-1)),Be=n=>B0.test(n),Wr=n=>KN.test(n),WN=new Set(["length","size","percentage"]),eR=n=>Xs(n,WN,P0),tR=n=>Xs(n,"position",P0),nR=new Set(["image","url"]),aR=n=>Xs(n,nR,oR),rR=n=>Xs(n,"",sR),Jo=()=>!0,Xs=(n,a,l)=>{const o=B0.exec(n);return o?o[1]?typeof a=="string"?o[1]===a:a.has(o[1]):l(o[2]):!1},lR=n=>XN.test(n)&&!FN.test(n),P0=()=>!1,sR=n=>QN.test(n),oR=n=>ZN.test(n),iR=()=>{const n=St("colors"),a=St("spacing"),l=St("blur"),o=St("brightness"),c=St("borderColor"),u=St("borderRadius"),f=St("borderSpacing"),p=St("borderWidth"),g=St("contrast"),v=St("grayscale"),x=St("hueRotate"),y=St("invert"),b=St("gap"),w=St("gradientColorStops"),E=St("gradientColorStopPositions"),j=St("inset"),C=St("margin"),R=St("opacity"),D=St("padding"),A=St("saturate"),M=St("scale"),O=St("sepia"),N=St("skew"),k=St("space"),U=St("translate"),V=()=>["auto","contain","none"],te=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto",Be,a],H=()=>[Be,a],I=()=>["",fr,Jr],Q=()=>["auto",Bs,Be],de=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],_=()=>["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"],ee=()=>["start","end","center","between","around","evenly","stretch"],W=()=>["","0",Be],ne=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>[Bs,Be];return{cacheSize:500,separator:":",theme:{colors:[Jo],spacing:[fr,Jr],blur:["none","",Wr,Be],brightness:z(),borderColor:[n],borderRadius:["none","","full",Wr,Be],borderSpacing:H(),borderWidth:I(),contrast:z(),grayscale:W(),hueRotate:z(),invert:W(),gap:H(),gradientColorStops:[n],gradientColorStopPositions:[JN,Jr],inset:$(),margin:$(),opacity:z(),padding:H(),saturate:z(),scale:z(),sepia:W(),skew:z(),space:H(),translate:H()},classGroups:{aspect:[{aspect:["auto","square","video",Be]}],container:["container"],columns:[{columns:[Wr]}],"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:[...de(),Be]}],overflow:[{overflow:te()}],"overflow-x":[{"overflow-x":te()}],"overflow-y":[{"overflow-y":te()}],overscroll:[{overscroll:V()}],"overscroll-x":[{"overscroll-x":V()}],"overscroll-y":[{"overscroll-y":V()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[j]}],"inset-x":[{"inset-x":[j]}],"inset-y":[{"inset-y":[j]}],start:[{start:[j]}],end:[{end:[j]}],top:[{top:[j]}],right:[{right:[j]}],bottom:[{bottom:[j]}],left:[{left:[j]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Zo,Be]}],basis:[{basis:$()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Be]}],grow:[{grow:W()}],shrink:[{shrink:W()}],order:[{order:["first","last","none",Zo,Be]}],"grid-cols":[{"grid-cols":[Jo]}],"col-start-end":[{col:["auto",{span:["full",Zo,Be]},Be]}],"col-start":[{"col-start":Q()}],"col-end":[{"col-end":Q()}],"grid-rows":[{"grid-rows":[Jo]}],"row-start-end":[{row:["auto",{span:[Zo,Be]},Be]}],"row-start":[{"row-start":Q()}],"row-end":[{"row-end":Q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Be]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Be]}],gap:[{gap:[b]}],"gap-x":[{"gap-x":[b]}],"gap-y":[{"gap-y":[b]}],"justify-content":[{justify:["normal",...ee()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ee(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ee(),"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":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Be,a]}],"min-w":[{"min-w":[Be,a,"min","max","fit"]}],"max-w":[{"max-w":[Be,a,"none","full","min","max","fit","prose",{screen:[Wr]},Wr]}],h:[{h:[Be,a,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Be,a,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Be,a,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Be,a,"auto","min","max","fit"]}],"font-size":[{text:["base",Wr,Jr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",gh]}],"font-family":[{font:[Jo]}],"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",Be]}],"line-clamp":[{"line-clamp":["none",Bs,gh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",fr,Be]}],"list-image":[{"list-image":["none",Be]}],"list-style-type":[{list:["none","disc","decimal",Be]}],"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:[..._(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",fr,Jr]}],"underline-offset":[{"underline-offset":["auto",fr,Be]}],"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",Be]}],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",Be]}],"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:[...de(),tR]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",eR]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},aR]}],"bg-color":[{bg:[n]}],"gradient-from-pos":[{from:[E]}],"gradient-via-pos":[{via:[E]}],"gradient-to-pos":[{to:[E]}],"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:[..._(),"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:_()}],"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:["",..._()]}],"outline-offset":[{"outline-offset":[fr,Be]}],"outline-w":[{outline:[fr,Jr]}],"outline-color":[{outline:[n]}],"ring-w":[{ring:I()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[n]}],"ring-opacity":[{"ring-opacity":[R]}],"ring-offset-w":[{"ring-offset":[fr,Jr]}],"ring-offset-color":[{"ring-offset":[n]}],shadow:[{shadow:["","inner","none",Wr,rR]}],"shadow-color":[{shadow:[Jo]}],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",Wr,Be]}],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",Be]}],duration:[{duration:z()}],ease:[{ease:["linear","in","out","in-out",Be]}],delay:[{delay:z()}],animate:[{animate:["none","spin","ping","pulse","bounce",Be]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[M]}],"scale-x":[{"scale-x":[M]}],"scale-y":[{"scale-y":[M]}],rotate:[{rotate:[Zo,Be]}],"translate-x":[{"translate-x":[U]}],"translate-y":[{"translate-y":[U]}],"skew-x":[{"skew-x":[N]}],"skew-y":[{"skew-y":[N]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Be]}],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",Be]}],"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",Be]}],fill:[{fill:[n,"none"]}],"stroke-w":[{stroke:[fr,Jr,gh]}],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"]}}},cR=VN(iR);function Ne(...n){return cR(z0(n))}function Kt(n,a="—"){return n==null||Number.isNaN(n)?a:n.toLocaleString()}function Nu(n,a=1,l="—"){return n==null||Number.isNaN(n)?l:`${(n*100).toFixed(a)}%`}function kl(n){return n?n<1e3?`${Math.round(n)} ms`:`${(n/1e3).toFixed(2)} s`:"—"}function zm(n){if(!n)return"—";try{return new Date(n).toLocaleString()}catch{return n}}function uR(n,a=8){return n?n.length>a?`${n.slice(0,a)}…`:n:"—"}function dR(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 fR=[{to:"/",label:"Dashboard",icon:A0,end:!0},{to:"/providers",label:"Providers",icon:O0},{to:"/models",label:"Models",icon:WE},{to:"/combos",label:"Combos",icon:D0},{to:"/aliases",label:"Aliases",icon:rN},{to:"/api-keys",label:"API Keys",icon:M0},{to:"/requests",label:"Requests",icon:N0},{to:"/statistics",label:"Statistics",icon:uN},{to:"/audit",label:"Audit Logs",icon:wN},{to:"/settings",label:"Settings",icon:lN}];function hR(){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:fR.map(l=>s.jsxs(y0,{to:l.to,end:l.end,className:({isActive:o})=>Ne("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(jN,{className:"h-3.5 w-3.5 text-primary"})," ",n?`v${n}`:"v…"]})]})}var mR=Object.defineProperty,Lm=(n,a)=>mR(n,"name",{value:a,configurable:!0});function Ph(n,a){if(typeof n=="function")return n(a);n!=null&&(n.current=a)}Lm(Ph,"setRef");function H0(...n){return a=>{let l=!1;const o=n.map(c=>{const u=Ph(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():Ph(n[c],null)}}}}Lm(H0,"composeRefs");function Ge(...n){return h.useCallback(H0(...n),n)}Lm(Ge,"useComposedRefs");var pR=Object.defineProperty,Ra=(n,a)=>pR(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=[];Hh(c)&&typeof Ic=="function"&&(c=Ic(c._payload)),h.Children.forEach(c,b=>{var w;if(G0(b)){p=!0;const E=b;let j="child"in E.props?E.props.child:E.props.children;Hh(j)&&typeof Ic=="function"&&(j=Ic(j._payload)),f=vR(E,j),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?Y0(f):void 0,x=Ge(o,v);if(!f){if(c||c===0)throw new Error(p?bR(n):yR(n));return c}const y=V0(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 gR=Ua("Slot"),q0=Symbol.for("radix.slottable");function $0(n){const a=Ra(l=>"child"in l?l.children(l.child):l.children,"Slottable");return a.displayName=`${n}.Slottable`,a.__radixId=q0,a}Ra($0,"createSlottable");var vR=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 V0(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(V0,"mergeProps");function Y0(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(Y0,"getElementRef");function G0(n){return h.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===q0}Ra(G0,"isSlottable");var xR=Symbol.for("react.lazy");function Hh(n){return n!=null&&typeof n=="object"&&"$$typeof"in n&&n.$$typeof===xR&&"_payload"in n&&K0(n._payload)}Ra(Hh,"isLazyComponent");function K0(n){return typeof n=="object"&&n!==null&&"then"in n}Ra(K0,"isPromiseLike");var yR=Ra(n=>`${n} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),bR=Ra(n=>`${n} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Ic=Vs[" use ".trim().toString()];const nb=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,ab=z0,X0=(n,a)=>l=>{var o;if((a==null?void 0:a.variants)==null)return ab(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=nb(x)||nb(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(E=>{let[j,C]=E;return Array.isArray(C)?C.includes({...u,...p}[j]):{...u,...p}[j]===C})?[...v,y,b]:v},[]);return ab(n,f,g,l==null?void 0:l.class,l==null?void 0:l.className)},wR=X0("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"}}),ce=h.forwardRef(({className:n,variant:a,size:l,asChild:o=!1,...c},u)=>{const f=o?gR:"button";return s.jsx(f,{className:Ne(wR({variant:a,size:l,className:n})),ref:u,...c})});ce.displayName="Button";const F0=h.createContext(void 0);function SR({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(F0.Provider,{value:u,children:n})}function jR(){const n=h.useContext(F0);if(!n)throw new Error("useTheme must be used within ThemeProvider");return n}var CR=Object.defineProperty,Fs=(n,a)=>CR(n,"name",{value:a,configurable:!0}),Q0=!!(typeof window<"u"&&window.document&&window.document.createElement);function je(n,a,{checkForDefaultPrevented:l=!0}={}){return Fs(function(c){if(n==null||n(c),l===!1||!c||!c.defaultPrevented)return a==null?void 0:a(c)},"handleEvent")}Fs(je,"composeEventHandlers");function ER(n){var a;if(!Q0)throw new Error("Cannot access window outside of the DOM");return((a=n==null?void 0:n.ownerDocument)==null?void 0:a.defaultView)??window}Fs(ER,"getOwnerWindow");function qh(n){if(!Q0)throw new Error("Cannot access document outside of the DOM");return(n==null?void 0:n.ownerDocument)??document}Fs(qh,"getOwnerDocument");function Z0(n,a=!1){const{activeElement:l}=qh(n);if(!(l!=null&&l.nodeName))return null;if(J0(l)&&l.contentDocument)return Z0(l.contentDocument.body,a);if(a){const o=l.getAttribute("aria-activedescendant");if(o){const c=qh(l).getElementById(o);if(c)return c}}return l}Fs(Z0,"getActiveElement");function J0(n){return n.tagName==="IFRAME"}Fs(J0,"isFrame");var NR=Object.defineProperty,fa=(n,a)=>NR(n,"name",{value:a,configurable:!0});function RR(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(RR,"createContext");function Ln(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,...E}=y,j=((R=b==null?void 0:b[n])==null?void 0:R[g])||p,C=h.useMemo(()=>E,Object.values(E));return s.jsx(j.Provider,{value:C,children:w})},"Provider");v.displayName=u+"Provider";function x(y,b,w={}){var R;const{optional:E=!1}=w,j=((R=b==null?void 0:b[n])==null?void 0:R[g])||p,C=h.useContext(j);if(C)return C;if(f!==void 0)return f;if(!E)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,W0(c,...a)]}fa(Ln,"createContextScope");function W0(...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(W0,"composeContextScopes");var Xt=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},TR=Object.defineProperty,AR=(n,a)=>TR(n,"name",{value:a,configurable:!0}),rb=Vs[" useEffectEvent ".trim().toString()],lb=Vs[" useInsertionEffect ".trim().toString()];function e1(n){if(typeof rb=="function")return rb(n);const a=h.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof lb=="function"?lb(()=>{a.current=n}):Xt(()=>{a.current=n}),h.useMemo(()=>((...l)=>{var o;return(o=a.current)==null?void 0:o.call(a,...l)}),[])}AR(e1,"useEffectEvent");var MR=Object.defineProperty,gi=(n,a)=>MR(n,"name",{value:a,configurable:!0}),DR=Vs[" useInsertionEffect ".trim().toString()]||Xt;function Ia({prop:n,defaultProp:a,onChange:l=gi(()=>{},"onChange"),caller:o}){const[c,u,f]=t1({defaultProp:a,onChange:l}),p=n!==void 0,g=p?n:c,v=h.useCallback(x=>{var y;if(p){const b=n1(x)?x(n):x;b!==n&&((y=f.current)==null||y.call(f,b))}else u(x)},[p,n,u,f]);return[g,v]}gi(Ia,"useControllableState");function t1({defaultProp:n,onChange:a}){const[l,o]=h.useState(n),c=h.useRef(l),u=h.useRef(a);return DR(()=>{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]}gi(t1,"useUncontrolledState");function n1(n){return typeof n=="function"}gi(n1,"isFunction");var sb=Symbol("RADIX:SYNC_STATE");function OR(n,a,l,o){const{prop:c,defaultProp:u,onChange:f,caller:p}=a,g=c!==void 0,v=e1(f),x=[{...l,state:u}];o&&x.push(o);const[y,b]=h.useReducer((C,R)=>{if(R.type===sb)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,E=h.useRef(w);h.useEffect(()=>{E.current!==w&&(E.current=w,g||v(w))},[w,E,g]);const j=h.useMemo(()=>c!==void 0?{...y,state:c}:y,[y,c]);return h.useEffect(()=>{g&&!Object.is(c,y.state)&&b({type:sb,state:c})},[c,y.state,g]),[j,b]}gi(OR,"useControllableStateReducer");var kR=Object.defineProperty,_R=(n,a)=>kR(n,"name",{value:a,configurable:!0}),zR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Pe=zR.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 Um(n,a){n&&ja.flushSync(()=>n.dispatchEvent(a))}_R(Um,"dispatchDiscreteCustomEvent");var LR=Object.defineProperty,tn=(n,a)=>LR(n,"name",{value:a,configurable:!0});function Ru(n){const a=n+"CollectionProvider",[l,o]=Ln(a),[c,u]=l(a,{collectionRef:{current:null},itemMap:new Map}),f=tn(j=>{const{scope:C,children:R}=j,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((j,C)=>{const{scope:R,children:D}=j,A=u(p,R),M=Ge(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((j,C)=>{const{scope:R,children:D,...A}=j,M=h.useRef(null),O=Ge(C,M),N=u(x,R);return h.useEffect(()=>(N.itemMap.set(M,{ref:M,...A}),()=>void N.itemMap.delete(M))),s.jsx(b,{[y]:"",ref:O,children:D})});w.displayName=x;function E(j){const C=u(n+"CollectionConsumer",j);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((N,k)=>A.indexOf(N.ref.current)-A.indexOf(k.ref.current))},[C.collectionRef,C.itemMap])}return tn(E,"useCollection"),[{Provider:f,Slot:v,ItemSlot:w},E,o]}tn(Ru,"createCollection");var ob=new WeakMap,$t,Yn,vh=(Yn=class extends Map{constructor(l){super(l);zy(this,$t);lh(this,$t,[...super.keys()]),ob.set(this,!0)}set(l,o){return ob.get(this)&&(this.has(l)?pn(this,$t)[pn(this,$t).indexOf(l)]=l:pn(this,$t).push(l)),super.set(l,o),this}insert(l,o,c){const u=this.has(o),f=pn(this,$t).length,p=Im(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=[...pn(this,$t)];let b,w=!1;for(let E=g;E<x;E++)if(g===E){let j=y[E];y[E]===o&&(j=y[E+1]),u&&this.delete(o),b=this.get(j),this.set(o,c)}else{!w&&y[E-1]===o&&(w=!0);const j=y[w?E:E-1],C=b;b=this.get(j),this.delete(j),this.set(j,C)}return this}with(l,o,c){const u=new Yn(this);return u.insert(l,o,c),u}before(l){const o=pn(this,$t).indexOf(l)-1;if(!(o<0))return this.entryAt(o)}setBefore(l,o,c){const u=pn(this,$t).indexOf(l);return u===-1?this:this.insert(u,o,c)}after(l){let o=pn(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=pn(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 lh(this,$t,[]),super.clear()}delete(l){const o=super.delete(l);return o&&pn(this,$t).splice(pn(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=nu(pn(this,$t),l);if(o!==void 0)return this.get(o)}entryAt(l){const o=nu(pn(this,$t),l);if(o!==void 0)return[o,this.get(o)]}indexOf(l){return pn(this,$t).indexOf(l)}keyAt(l){return nu(pn(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 Yn(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 Yn(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 Yn(o)}toReversed(){const l=new Yn;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 Yn(o)}slice(l,o){const c=new Yn;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,tn(Yn,"OrderedDict"),Yn);function nu(n,a){if("at"in Array.prototype)return Array.prototype.at.call(n,a);const l=a1(n,a);return l===-1?void 0:n[l]}tn(nu,"at");function a1(n,a){const l=n.length,o=Im(a),c=o>=0?o:l+o;return c<0||c>=l?-1:c}tn(a1,"toSafeIndex");function Im(n){return n!==n||n===0?0:Math.trunc(n)}tn(Im,"toSafeInteger");function UR(n){const a=n+"CollectionProvider",[l,o]=Ln(a),[c,u]=l(a,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new vh,setItemMap:tn(()=>{},"setItemMap")}),f=tn(({state:A,...M})=>A?s.jsx(g,{...M,state:A}):s.jsx(p,{...M}),"CollectionProvider");f.displayName=a;const p=tn(A=>{const M=C();return s.jsx(g,{...A,state:M})},"CollectionInit");p.displayName=a+"Init";const g=tn(A=>{const{scope:M,children:O,state:N}=A,k=h.useRef(null),[U,V]=h.useState(null),te=Ge(k,V),[$,H]=N;return h.useEffect(()=>{if(!U)return;const I=s1(()=>{});return I.observe(U,{childList:!0,subtree:!0}),()=>{I.disconnect()}},[U]),s.jsx(c,{scope:M,itemMap:$,setItemMap:H,collectionRef:te,collectionRefObject:k,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:N}=A,k=u(v,O),U=Ge(M,k.collectionRef);return s.jsx(x,{ref:U,children:N})});y.displayName=v;const b=n+"CollectionItemSlot",w="data-radix-collection-item",E=Ua(b),j=h.forwardRef((A,M)=>{const{scope:O,children:N,...k}=A,U=h.useRef(null),[V,te]=h.useState(null),$=Ge(M,U,te),H=u(b,O),{setItemMap:I}=H,Q=h.useRef(k);r1(Q.current,k)||(Q.current=k);const de=Q.current;return h.useEffect(()=>{const _=de;return I(q=>V?q.has(V)?q.set(V,{..._,element:V}).toSorted($h):(q.set(V,{..._,element:V}),q.toSorted($h)):q),()=>{I(q=>!V||!q.has(V)?q:(q.delete(V),new vh(q)))}},[V,de,I]),s.jsx(E,{[w]:"",ref:$,children:N})});j.displayName=b;function C(){return h.useState(new vh)}tn(C,"useInitCollection");function R(A){const{itemMap:M}=u(n+"CollectionConsumer",A);return M}return tn(R,"useCollection"),[{Provider:f,Slot:y,ItemSlot:j},{createCollectionScope:o,useCollection:R,useInitCollection:C}]}tn(UR,"createCollection");function r1(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}tn(r1,"shallowEqual");function l1(n,a){return!!(a.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING)}tn(l1,"isElementPreceding");function $h(n,a){return!n[1].element||!a[1].element?0:l1(n[1].element,a[1].element)?-1:1}tn($h,"sortByDocumentPosition");function s1(n){return new MutationObserver(l=>{for(const o of l)if(o.type==="childList"){n();return}})}tn(s1,"getChildListObserver");var IR=Object.defineProperty,BR=(n,a)=>IR(n,"name",{value:a,configurable:!0}),PR=h.createContext(void 0);function vi(n){const a=h.useContext(PR);return n||a||"ltr"}BR(vi,"useDirection");var HR=Object.defineProperty,qR=(n,a)=>HR(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)}),[])}qR(ma,"useCallbackRef");var $R=Object.defineProperty,en=(n,a)=>$R(n,"name",{value:a,configurable:!0}),Vh="dismissableLayer.update",VR="dismissableLayer.pointerDownOutside",YR="dismissableLayer.focusOutside",ib,o1=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Tu=h.forwardRef(en(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(o1),[b,w]=h.useState(null),E=(b==null?void 0:b.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,j]=h.useState({}),C=Ge(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,N=M>=A,k=h.useRef(!1),U=c1(H=>{f==null||f(H),g==null||g(H),H.defaultPrevented||v==null||v()},{ownerDocument:E,deferPointerDownOutside:c,isDeferredPointerDownOutsideRef:k,dismissableSurfaces:y.dismissableSurfaces,shouldHandlePointerDownOutside:h.useCallback(H=>{if(!(H instanceof Node))return!1;const I=[...y.branches].some(Q=>Q.contains(H));return N&&!I},[y.branches,N])}),V=u1(H=>{if(c&&k.current)return;const I=H.target;[...y.branches].some(de=>de.contains(I))||(p==null||p(H),g==null||g(H),H.defaultPrevented||v==null||v())},E),te=b?M===R.length-1:!1,$=ma(H=>{H.key==="Escape"&&(u==null||u(H),!H.defaultPrevented&&v&&(H.preventDefault(),v()))});return h.useEffect(()=>{if(te)return E.addEventListener("keydown",$,{capture:!0}),()=>E.removeEventListener("keydown",$,{capture:!0})},[E,te,$]),h.useEffect(()=>{if(b)return o&&(y.layersWithOutsidePointerEventsDisabled.size===0&&(ib=E.body.style.pointerEvents,E.body.style.pointerEvents="none"),y.layersWithOutsidePointerEventsDisabled.add(b)),y.layers.add(b),Yh(),()=>{o&&(y.layersWithOutsidePointerEventsDisabled.delete(b),y.layersWithOutsidePointerEventsDisabled.size===0&&(E.body.style.pointerEvents=ib))}},[b,E,o,y]),h.useEffect(()=>()=>{b&&(y.layers.delete(b),y.layersWithOutsidePointerEventsDisabled.delete(b),Yh())},[b,y]),h.useEffect(()=>{const H=en(()=>j({}),"handleUpdate");return document.addEventListener(Vh,H),()=>document.removeEventListener(Vh,H)},[]),s.jsx(Pe.div,{...x,ref:C,style:{pointerEvents:O?N?"auto":"none":void 0,...a.style},onFocusCapture:je(a.onFocusCapture,V.onFocusCapture),onBlurCapture:je(a.onBlurCapture,V.onBlurCapture),onPointerDownCapture:je(a.onPointerDownCapture,U.onPointerDownCapture)})},"DismissableLayer"));function i1(){const n=h.useContext(o1),[a,l]=h.useState(null);return h.useEffect(()=>{if(a)return n.dismissableSurfaces.add(a),()=>{n.dismissableSurfaces.delete(a)}},[a,n.dismissableSurfaces]),l}en(i1,"useDismissableLayerSurface");var GR=en(()=>!0,"IS_TRUE");function c1(n,a){const{ownerDocument:l=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:o=!1,isDeferredPointerDownOutsideRef:c,dismissableSurfaces:u,shouldHandlePointerDownOutside:f=GR}=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()}en(b,"resetOutsideInteraction");function w(){return Array.from(x.current.values()).some(Boolean)}en(w,"isOutsideInteractionIntercepted");function E(A){if(!v.current)return;const M=A.target;M instanceof Node&&[...u].some(N=>N.contains(M))||x.current.set(A.type,!0),A.type==="click"&&window.setTimeout(()=>{v.current&&y.current()},0)}en(E,"handleInteractionCapture");function j(A){v.current&&x.current.set(A.type,!1)}en(j,"handleInteractionBubble");const C=en(A=>{if(A.target&&!g.current){let M=function(){l.removeEventListener("click",y.current);const N=w();b(),N||Bm(VR,p,O,{discrete:!0})};if(en(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,E,!0),l.addEventListener(A,j);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,E,!0),l.removeEventListener(A,j)}},[l,p,o,c,u,f]),{onPointerDownCapture:en(()=>g.current=!0,"onPointerDownCapture")}}en(c1,"usePointerDownOutside");function u1(n,a=globalThis==null?void 0:globalThis.document){const l=ma(n),o=h.useRef(!1);return h.useEffect(()=>{const c=en(u=>{u.target&&!o.current&&Bm(YR,l,{originalEvent:u},{discrete:!1})},"handleFocus");return a.addEventListener("focusin",c),()=>a.removeEventListener("focusin",c)},[a,l]),{onFocusCapture:en(()=>o.current=!0,"onFocusCapture"),onBlurCapture:en(()=>o.current=!1,"onBlurCapture")}}en(u1,"useFocusOutside");function Yh(){const n=new CustomEvent(Vh);document.dispatchEvent(n)}en(Yh,"dispatchUpdate");function Bm(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?Um(c,u):c.dispatchEvent(u)}en(Bm,"handleAndDispatchCustomEvent");var KR=Object.defineProperty,Pm=(n,a)=>KR(n,"name",{value:a,configurable:!0}),Bc=0,_a=null;function XR(n){return xi(),n.children}Pm(XR,"FocusGuards");function xi(){h.useEffect(()=>{_a||(_a={start:Gh(),end:Gh()});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)}},[])}Pm(xi,"useFocusGuards");function Gh(){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}Pm(Gh,"createFocusGuard");var FR=Object.defineProperty,wn=(n,a)=>FR(n,"name",{value:a,configurable:!0}),xh="focusScope.autoFocusOnMount",yh="focusScope.autoFocusOnUnmount",cb={bubbles:!1,cancelable:!0},Hm=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=Ge(l,v),E=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(c){let C=function(M){if(E.paused||!g)return;const O=M.target;g.contains(O)?b.current=O:hr(b.current,{select:!0})},R=function(M){if(E.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 N of M)N.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,E.paused]),h.useEffect(()=>{if(g){ub.add(E);const C=document.activeElement;if(!g.contains(C)){const D=new CustomEvent(xh,cb);g.addEventListener(xh,x),g.dispatchEvent(D),D.defaultPrevented||(d1(g1(qm(g)),{select:!0}),document.activeElement===C&&hr(g))}return()=>{g.removeEventListener(xh,x),setTimeout(()=>{const D=new CustomEvent(yh,cb);g.addEventListener(yh,y),g.dispatchEvent(D),D.defaultPrevented||hr(C??document.body,{select:!0}),g.removeEventListener(yh,y),ub.remove(E)},0)}}},[g,x,y,E]);const j=h.useCallback(C=>{if(!o&&!c||E.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]=f1(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,E.paused]);return s.jsx(Pe.div,{tabIndex:-1,...p,ref:w,onKeyDown:j})},"FocusScope"));function d1(n,{select:a=!1}={}){const l=document.activeElement;for(const o of n)if(hr(o,{select:a}),document.activeElement!==l)return}wn(d1,"focusFirst");function f1(n){const a=qm(n),l=Kh(a,n),o=Kh(a.reverse(),n);return[l,o]}wn(f1,"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 Kh(n,a){const l=typeof a.checkVisibility=="function"&&a.checkVisibility({checkVisibilityCSS:!0});for(const o of n)if(!(l?!o.checkVisibility({checkVisibilityCSS:!0}):h1(o,{upTo:a})))return o}wn(Kh,"findVisible");function h1(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(h1,"isHidden");function m1(n){return n instanceof HTMLInputElement&&"select"in n}wn(m1,"isSelectableInput");function hr(n,{select:a=!1}={}){if(n&&n.focus){const l=document.activeElement;n.focus({preventScroll:!0}),n!==l&&m1(n)&&a&&n.select()}}wn(hr,"focus");var ub=p1();function p1(){let n=[];return{add(a){const l=n[0];a!==l&&(l==null||l.pause()),n=Xh(n,a),n.unshift(a)},remove(a){var l;n=Xh(n,a),(l=n[0])==null||l.resume()}}}wn(p1,"createFocusScopesStack");function Xh(n,a){const l=[...n],o=l.indexOf(a);return o!==-1&&l.splice(o,1),l}wn(Xh,"arrayRemove");function g1(n){return n.filter(a=>a.tagName!=="A")}wn(g1,"removeLinks");var QR=Object.defineProperty,ZR=(n,a)=>QR(n,"name",{value:a,configurable:!0}),JR=Vs[" useId ".trim().toString()]||(()=>{}),WR=0;function Ea(n){const[a,l]=h.useState(JR());return Xt(()=>{n||l(o=>o??String(WR++))},[n]),n||(a?`radix-${a}`:"")}ZR(Ea,"useId");const eT=["top","right","bottom","left"],sl=Math.min,gr=Math.max,cu=Math.round,Pc=Math.floor,vr=n=>({x:n,y:n}),tT={left:"right",right:"left",bottom:"top",top:"bottom"};function v1(n,a,l){return gr(n,sl(a,l))}function br(n,a){return typeof n=="function"?n(a):n}function ol(n){return n.split("-")[0]}function Qs(n){return n.split("-")[1]}function $m(n){return n==="x"?"y":"x"}function Vm(n){return n==="y"?"height":"width"}function La(n){const a=n[0];return a==="t"||a==="b"?"y":"x"}function Ym(n){return $m(La(n))}function nT(n,a,l){l===void 0&&(l=!1);const o=Qs(n),c=Ym(n),u=Vm(c);let f=c==="x"?o===(l?"end":"start")?"right":"left":o==="start"?"bottom":"top";return a.reference[u]>a.floating[u]&&(f=uu(f)),[f,uu(f)]}function aT(n){const a=uu(n);return[Fh(n),a,Fh(a)]}function Fh(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}const db=["left","right"],fb=["right","left"],rT=["top","bottom"],lT=["bottom","top"];function sT(n,a,l){switch(n){case"top":case"bottom":return l?a?fb:db:a?db:fb;case"left":case"right":return a?rT:lT;default:return[]}}function oT(n,a,l,o){const c=Qs(n);let u=sT(ol(n),l==="start",o);return c&&(u=u.map(f=>f+"-"+c),a&&(u=u.concat(u.map(Fh)))),u}function uu(n){const a=ol(n);return tT[a]+n.slice(a.length)}function iT(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 x1(n){return typeof n!="number"?iT(n):{top:n,right:n,bottom:n,left:n}}function du(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 hb(n,a,l){let{reference:o,floating:c}=n;const u=La(a),f=Ym(a),p=Vm(f),g=ol(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 E=Qs(a);return E&&(w[f]+=b*(E==="end"?1:-1)*(l&&v?-1:1)),w}async function cT(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),E=x1(w),C=p[b?y==="floating"?"reference":"floating":y],R=du(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=du(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:D,offsetParent:A,strategy:g}):D);return{top:(R.top-O.top+E.top)/M.y,bottom:(O.bottom-R.bottom+E.bottom)/M.y,left:(R.left-O.left+E.left)/M.x,right:(O.right-R.right+E.right)/M.x}}const uT=50,dT=async(n,a,l)=>{const{placement:o="bottom",strategy:c="absolute",middleware:u=[],platform:f}=l,p=f.detectOverflow?f:{...f,detectOverflow:cT},g=await(f.isRTL==null?void 0:f.isRTL(a));let v=await f.getElementRects({reference:n,floating:a,strategy:c}),{x,y}=hb(v,o,g),b=o,w=0;const E={};for(let j=0;j<u.length;j++){const C=u[j];if(!C)continue;const{name:R,fn:D}=C,{x:A,y:M,data:O,reset:N}=await D({x,y,initialPlacement:o,placement:b,strategy:c,middlewareData:E,rects:v,platform:p,elements:{reference:n,floating:a}});x=A??x,y=M??y,E[R]={...E[R],...O},N&&w<uT&&(w++,typeof N=="object"&&(N.placement&&(b=N.placement),N.rects&&(v=N.rects===!0?await f.getElementRects({reference:n,floating:a,strategy:c}):N.rects),{x,y}=hb(v,b,g)),j=-1)}return{x,y,placement:b,strategy:c,middlewareData:E}},fT=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=x1(x),b={x:l,y:o},w=Ym(c),E=Vm(w),j=await f.getDimensions(v),C=w==="y",R=C?"top":"left",D=C?"bottom":"right",A=C?"clientHeight":"clientWidth",M=u.reference[E]+u.reference[w]-b[w]-u.floating[E],O=b[w]-u.reference[w],N=await(f.getOffsetParent==null?void 0:f.getOffsetParent(v));let k=N?N[A]:0;(!k||!await(f.isElement==null?void 0:f.isElement(N)))&&(k=p.floating[A]||u.floating[E]);const U=M/2-O/2,V=k/2-j[E]/2-1,te=sl(y[R],V),$=sl(y[D],V),H=k-j[E]-$,I=k/2-j[E]/2+U,Q=v1(te,I,H),de=!g.arrow&&Qs(c)!=null&&I!==Q&&u.reference[E]/2-(I<te?te:$)-j[E]/2<0,_=de?I<te?I-te:I-H:0;return{[w]:b[w]+_,data:{[w]:Q,centerOffset:I-Q-_,...de&&{alignmentOffset:_}},reset:de}}}),hT=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:E="none",flipAlignment:j=!0,...C}=br(n,a);if((l=u.arrow)!=null&&l.alignmentOffset)return{};const R=ol(c),D=La(p),A=ol(p)===p,M=await(g.isRTL==null?void 0:g.isRTL(v.floating)),O=b||(A||!j?[uu(p)]:aT(p)),N=E!=="none";!b&&N&&O.push(...oT(p,j,E,M));const k=[p,...O],U=await g.detectOverflow(a,C),V=[];let te=((o=u.flip)==null?void 0:o.overflows)||[];if(x&&V.push(U[R]),y){const Q=nT(c,f,M);V.push(U[Q[0]],U[Q[1]])}if(te=[...te,{placement:c,overflows:V}],!V.every(Q=>Q<=0)){var $,H;const Q=((($=u.flip)==null?void 0:$.index)||0)+1,de=k[Q];if(de&&(!(y==="alignment"?D!==La(de):!1)||te.every(ee=>La(ee.placement)===D?ee.overflows[0]>0:!0)))return{data:{index:Q,overflows:te},reset:{placement:de}};let _=(H=te.filter(q=>q.overflows[0]<=0).sort((q,ee)=>q.overflows[1]-ee.overflows[1])[0])==null?void 0:H.placement;if(!_)switch(w){case"bestFit":{var I;const q=(I=te.filter(ee=>{if(N){const W=La(ee.placement);return W===D||W==="y"}return!0}).map(ee=>[ee.placement,ee.overflows.filter(W=>W>0).reduce((W,ne)=>W+ne,0)]).sort((ee,W)=>ee[1]-W[1])[0])==null?void 0:I[0];q&&(_=q);break}case"initialPlacement":_=p;break}if(c!==_)return{reset:{placement:_}}}return{}}}};function mb(n,a){return{top:n.top-a.height,right:n.right-a.width,bottom:n.bottom-a.height,left:n.left-a.width}}function pb(n){return eT.some(a=>n[a]>=0)}const mT=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=mb(f,l.reference);return{data:{referenceHiddenOffsets:p,referenceHidden:pb(p)}}}case"escaped":{const f=await o.detectOverflow(a,{...u,altBoundary:!0}),p=mb(f,l.floating);return{data:{escapedOffsets:p,escaped:pb(p)}}}default:return{}}}}},y1=new Set(["left","top"]);async function pT(n,a){const{placement:l,platform:o,elements:c}=n,u=await(o.isRTL==null?void 0:o.isRTL(c.floating)),f=ol(l),p=Qs(l),g=La(l)==="y",v=y1.has(f)?-1:1,x=u&&g?-1:1,y=br(a,n);let{mainAxis:b,crossAxis:w,alignmentAxis:E}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return p&&typeof E=="number"&&(w=p==="end"?E*-1:E),g?{x:w*x,y:b*v}:{x:b*v,y:w*x}}const gT=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 pT(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}}}}},vT=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=$m(b);let E=x[w],j=x[b];const C=(D,A)=>v1(A+y[D==="y"?"top":"left"],A,A-y[D==="y"?"bottom":"right"]);f&&(E=C(w,E)),p&&(j=C(b,j));const R=g.fn({...a,[w]:E,[b]:j});return{...R,data:{x:R.x-l,y:R.y-o,enabled:{[w]:f,[b]:p}}}}}},xT=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),E=$m(w);let j=b[E],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=E==="y"?"height":"width",N=p.reference[E]-p.floating[O]+D.mainAxis,k=p.reference[E]+p.reference[O]-D.mainAxis;j<N?j=N:j>k&&(j=k)}if(y){var A,M;const O=E==="y"?"width":"height",N=y1.has(ol(f)),k=p.reference[w]-p.floating[O]+(N&&((A=g.offset)==null?void 0:A[w])||0)+(N?0:D.crossAxis),U=p.reference[w]+p.reference[O]+(N?0:((M=g.offset)==null?void 0:M[w])||0)-(N?D.crossAxis:0);C<k?C=k:C>U&&(C=U)}return{[E]:j,[w]:C}}}},yT=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=ol(l),x=Qs(l),y=La(l)==="y",{width:b,height:w}=o.floating;let E,j;v==="top"||v==="bottom"?(E=v,j=x===(await(c.isRTL==null?void 0:c.isRTL(u.floating))?"start":"end")?"left":"right"):(j=v,E=x==="end"?"top":"bottom");const C=w-g.top-g.bottom,R=b-g.left-g.right,D=sl(w-g[E],C),A=sl(b-g[j],R),M=a.middlewareData.shift,O=!M;let N=D,k=A;M!=null&&M.enabled.x&&(k=R),M!=null&&M.enabled.y&&(N=C),O&&!x&&(y?k=b-2*gr(g.left,g.right):N=w-2*gr(g.top,g.bottom)),await f({...a,availableWidth:k,availableHeight:N});const U=await c.getDimensions(u.floating);return b!==U.width||w!==U.height?{reset:{rects:!0}}:{}}}};function Au(){return typeof window<"u"}function Zs(n){return b1(n)?(n.nodeName||"").toLowerCase():"#document"}function On(n){var a;return(n==null||(a=n.ownerDocument)==null?void 0:a.defaultView)||window}function jr(n){var a;return(a=(b1(n)?n.ownerDocument:n.document)||window.document)==null?void 0:a.documentElement}function b1(n){return Au()?n instanceof Node||n instanceof On(n).Node:!1}function Ba(n){return Au()?n instanceof Element||n instanceof On(n).Element:!1}function cl(n){return Au()?n instanceof HTMLElement||n instanceof On(n).HTMLElement:!1}function gb(n){return!Au()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof On(n).ShadowRoot}function Mu(n){const{overflow:a,overflowX:l,overflowY:o,display:c}=Pa(n);return/auto|scroll|overlay|hidden|clip/.test(a+o+l)&&c!=="inline"&&c!=="contents"}function bT(n){return/^(table|td|th)$/.test(Zs(n))}function Du(n){try{if(n.matches(":popover-open"))return!0}catch{}try{return n.matches(":modal")}catch{return!1}}const wT=/transform|translate|scale|rotate|perspective|filter/,ST=/paint|layout|strict|content/,Al=n=>!!n&&n!=="none";let bh;function Gm(n){const a=Ba(n)?Pa(n):n;return Al(a.transform)||Al(a.translate)||Al(a.scale)||Al(a.rotate)||Al(a.perspective)||!Km()&&(Al(a.backdropFilter)||Al(a.filter))||wT.test(a.willChange||"")||ST.test(a.contain||"")}function jT(n){let a=_l(n);for(;cl(a)&&!ai(a);){if(Gm(a))return a;if(Du(a))return null;a=_l(a)}return null}function Km(){return bh==null&&(bh=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),bh}function ai(n){return/^(html|body|#document)$/.test(Zs(n))}function Pa(n){return On(n).getComputedStyle(n)}function Ou(n){return Ba(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function _l(n){if(Zs(n)==="html")return n;const a=n.assignedSlot||n.parentNode||gb(n)&&n.host||jr(n);return gb(a)?a.host:a}function w1(n){const a=_l(n);return ai(a)?(n.ownerDocument||n).body:cl(a)&&Mu(a)?a:w1(a)}function ri(n,a,l){var o;a===void 0&&(a=[]),l===void 0&&(l=!0);const c=w1(n),u=c===((o=n.ownerDocument)==null?void 0:o.body),f=On(c);if(u){const p=Qh(f);return a.concat(f,f.visualViewport||[],Mu(c)?c:[],p&&l?ri(p):[])}else return a.concat(c,ri(c,[],l))}function Qh(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function S1(n){const a=Pa(n);let l=parseFloat(a.width)||0,o=parseFloat(a.height)||0;const c=cl(n),u=c?n.offsetWidth:l,f=c?n.offsetHeight:o,p=cu(l)!==u||cu(o)!==f;return p&&(l=u,o=f),{width:l,height:o,$:p}}function Xm(n){return Ba(n)?n:n.contextElement}function Ps(n){const a=Xm(n);if(!cl(a))return vr(1);const l=a.getBoundingClientRect(),{width:o,height:c,$:u}=S1(a);let f=(u?cu(l.width):l.width)/o,p=(u?cu(l.height):l.height)/c;return(!f||!Number.isFinite(f))&&(f=1),(!p||!Number.isFinite(p))&&(p=1),{x:f,y:p}}const CT=vr(0);function j1(n){const a=On(n);return!Km()||!a.visualViewport?CT:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function ET(n,a,l){return a===void 0&&(a=!1),!!l&&a&&l===On(n)}function zl(n,a,l,o){a===void 0&&(a=!1),l===void 0&&(l=!1);const c=n.getBoundingClientRect(),u=Xm(n);let f=vr(1);a&&(o?Ba(o)&&(f=Ps(o)):f=Ps(n));const p=ET(u,l,o)?j1(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=On(u),w=Ba(o)?On(o):o;let E=b,j=Qh(E);for(;j&&w!==E;){const C=Ps(j),R=j.getBoundingClientRect(),D=Pa(j),A=R.left+(j.clientLeft+parseFloat(D.paddingLeft))*C.x,M=R.top+(j.clientTop+parseFloat(D.paddingTop))*C.y;g*=C.x,v*=C.y,x*=C.x,y*=C.y,g+=A,v+=M,E=On(j),j=Qh(E)}}return du({width:x,height:y,x:g,y:v})}function ku(n,a){const l=Ou(n).scrollLeft;return a?a.left+l:zl(jr(n)).left+l}function C1(n,a){const l=n.getBoundingClientRect(),o=l.left+a.scrollLeft-ku(n,l),c=l.top+a.scrollTop;return{x:o,y:c}}function NT(n){let{elements:a,rect:l,offsetParent:o,strategy:c}=n;const u=c==="fixed",f=jr(o),p=a?Du(a.floating):!1;if(o===f||p&&u)return l;let g={scrollLeft:0,scrollTop:0},v=vr(1);const x=vr(0),y=cl(o);if((y||!u)&&((Zs(o)!=="body"||Mu(f))&&(g=Ou(o)),y)){const w=zl(o);v=Ps(o),x.x=w.x+o.clientLeft,x.y=w.y+o.clientTop}const b=f&&!y&&!u?C1(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 RT(n){return n.getClientRects?Array.from(n.getClientRects()):[]}function TT(n){const a=Ou(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+ku(n);const f=-a.scrollTop;return Pa(l).direction==="rtl"&&(u+=gr(n.clientWidth,l.clientWidth)-o),{width:o,height:c,x:u,y:f}}const AT=25;function MT(n,a,l){l===void 0&&(l="viewport");const o=l==="layoutViewport",c=On(n),u=jr(n),f=c.visualViewport;let p=u.clientWidth,g=u.clientHeight,v=0,x=0;if(f){const b=!Km()||a==="fixed";o?b||(v=-f.offsetLeft,x=-f.offsetTop):(p=f.width,g=f.height,b&&(v=f.offsetLeft,x=f.offsetTop))}if(ku(u)<=0){const b=u.ownerDocument,w=b.body,E=getComputedStyle(w),j=b.compatMode==="CSS1Compat"&&parseFloat(E.marginLeft)+parseFloat(E.marginRight)||0,C=Math.abs(u.clientWidth-w.clientWidth-j),R=getComputedStyle(u).scrollbarGutter==="stable both-edges"?C/2:C;R<=AT&&(p-=R)}return{width:p,height:g,x:v,y:x}}function DT(n,a){const l=zl(n,!0,a==="fixed"),o=l.top+n.clientTop,c=l.left+n.clientLeft,u=Ps(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 vb(n,a,l){let o;if(a==="viewport"||a==="layoutViewport")o=MT(n,l,a);else if(a==="document")o=TT(jr(n));else if(Ba(a))o=DT(a,l);else{const c=j1(n);o={x:a.x-c.x,y:a.y-c.y,width:a.width,height:a.height}}return du(o)}function OT(n,a){const l=a.get(n);if(l)return l;let o=ri(n,[],!1).filter(p=>Ba(p)&&Zs(p)!=="body"),c=null;const u=Pa(n).position==="fixed";let f=u?_l(n):n;for(;Ba(f)&&!ai(f);){const p=Pa(f),g=Gm(f),v=c?c.position:u?"fixed":"";!g&&(v==="fixed"||v==="absolute"&&p.position==="static")?o=o.filter(y=>y!==f):c=p,f=_l(f)}return a.set(n,o),o}function kT(n){let{element:a,boundary:l,rootBoundary:o,strategy:c}=n;const f=[...l==="clippingAncestors"?Du(a)?[]:OT(a,this._c):[].concat(l),o],p=vb(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=vb(a,f[b],c);g=gr(w.top,g),v=sl(w.right,v),x=sl(w.bottom,x),y=gr(w.left,y)}return{width:v-y,height:x-g,x:y,y:g}}function _T(n){const{width:a,height:l}=S1(n);return{width:a,height:l}}function zT(n,a,l){const o=cl(a),c=jr(a),u=l==="fixed",f=zl(n,!0,u,a);let p={scrollLeft:0,scrollTop:0};const g=vr(0);if((o||!u)&&((Zs(a)!=="body"||Mu(c))&&(p=Ou(a)),o)){const b=zl(a,!0,u,a);g.x=b.x+a.clientLeft,g.y=b.y+a.clientTop}!o&&c&&(g.x=ku(c));const v=c&&!o&&!u?C1(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 wh(n){return Pa(n).position==="static"}function xb(n,a){if(!cl(n)||Pa(n).position==="fixed")return null;if(a)return a(n);let l=n.offsetParent;return jr(n)===l&&(l=l.ownerDocument.body),l}function E1(n,a){const l=On(n);if(Du(n))return l;if(!cl(n)){let c=_l(n);for(;c&&!ai(c);){if(Ba(c)&&!wh(c))return c;c=_l(c)}return l}let o=xb(n,a);for(;o&&bT(o)&&wh(o);)o=xb(o,a);return o&&ai(o)&&wh(o)&&!Gm(o)?l:o||jT(n)||l}const LT=async function(n){const a=this.getOffsetParent||E1,l=this.getDimensions,o=await l(n.floating);return{reference:zT(n.reference,await a(n.floating),n.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function UT(n){return Pa(n).direction==="rtl"}const IT={convertOffsetParentRelativeRectToViewportRelativeRect:NT,getDocumentElement:jr,getClippingRect:kT,getOffsetParent:E1,getElementRects:LT,getClientRects:RT,getDimensions:_T,getScale:Ps,isElement:Ba,isRTL:UT};function N1(n,a){return n.x===a.x&&n.y===a.y&&n.width===a.width&&n.height===a.height}function BT(n,a,l){let o=null,c;const u=jr(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:E,width:j,height:C}=b;if(x||a(),!j||!C)return;const R=Pc(E),D=Pc(u.clientWidth-(w+j)),A=Pc(u.clientHeight-(E+C)),M=Pc(w),N={rootMargin:-R+"px "+-D+"px "+-A+"px "+-M+"px",threshold:gr(0,sl(1,y))||1};let k=!0;function U(V){const te=V[0].intersectionRatio;if(!N1(b,n.getBoundingClientRect()))return p();if(te!==y){if(!k)return p();te?p(!1,te):c=setTimeout(()=>{p(!1,1e-7)},1e3)}k=!1}try{o=new IntersectionObserver(U,{...N,root:u.ownerDocument})}catch{o=new IntersectionObserver(U,N)}o.observe(n)}const g=On(n),v=()=>p(l);return g.addEventListener("resize",v),p(!0),()=>{g.removeEventListener("resize",v),f()}}function PT(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=Xm(n),x=c||u?[...v?ri(v):[],...a?ri(a):[]]:[];x.forEach(R=>{c&&R.addEventListener("scroll",l),u&&R.addEventListener("resize",l)});const y=v&&p?BT(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 E,j=g?zl(n):null;g&&C();function C(){const R=zl(n);j&&!N1(j,R)&&l(),j=R,E=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(E)}}const HT=gT,qT=vT,$T=hT,VT=yT,YT=mT,yb=fT,GT=xT,KT=(n,a,l)=>{const o=new Map,c=l??{},u={...IT,...c.platform,_c:o};return dT(n,a,{...c,platform:u})};var XT=typeof document<"u",FT=function(){},au=XT?h.useLayoutEffect:FT;function fu(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(!fu(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)&&!fu(n[u],a[u]))return!1}return!0}return n!==n&&a!==a}function R1(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function bb(n,a){const l=R1(n);return Math.round(a*l)/l}function Sh(n){const a=h.useRef(n);return au(()=>{a.current=n}),a}function QT(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);fu(b,o)||w(o);const[E,j]=h.useState(null),[C,R]=h.useState(null),D=h.useCallback(ee=>{ee!==N.current&&(N.current=ee,j(ee))},[]),A=h.useCallback(ee=>{ee!==k.current&&(k.current=ee,R(ee))},[]),M=u||E,O=f||C,N=h.useRef(null),k=h.useRef(null),U=h.useRef(x),V=g!=null,te=Sh(g),$=Sh(c),H=Sh(v),I=h.useCallback(()=>{if(!N.current||!k.current)return;const ee={placement:a,strategy:l,middleware:b};$.current&&(ee.platform=$.current),KT(N.current,k.current,ee).then(W=>{const ne={...W,isPositioned:H.current!==!1};Q.current&&!fu(U.current,ne)&&(U.current=ne,ja.flushSync(()=>{y(ne)}))})},[b,a,l,$,H]);au(()=>{v===!1&&U.current.isPositioned&&(U.current.isPositioned=!1,y(ee=>({...ee,isPositioned:!1})))},[v]);const Q=h.useRef(!1);au(()=>(Q.current=!0,()=>{Q.current=!1}),[]),au(()=>{if(M&&(N.current=M),O&&(k.current=O),M&&O){if(te.current)return te.current(M,O,I);I()}},[M,O,I,te,V]);const de=h.useMemo(()=>({reference:N,floating:k,setReference:D,setFloating:A}),[D,A]),_=h.useMemo(()=>({reference:M,floating:O}),[M,O]),q=h.useMemo(()=>{const ee={position:l,left:0,top:0};if(!_.floating)return ee;const W=bb(_.floating,x.x),ne=bb(_.floating,x.y);return p?{...ee,transform:"translate("+W+"px, "+ne+"px)",...R1(_.floating)>=1.5&&{willChange:"transform"}}:{position:l,left:W,top:ne}},[l,p,_.floating,x.x,x.y]);return h.useMemo(()=>({...x,update:I,refs:de,elements:_,floatingStyles:q}),[x,I,de,_,q])}const ZT=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?yb({element:o.current,padding:c}).fn(l):{}:o?yb({element:o,padding:c}).fn(l):{}}}},JT=(n,a)=>{const l=HT(n);return{name:l.name,fn:l.fn,options:[n,a]}},WT=(n,a)=>{const l=qT(n);return{name:l.name,fn:l.fn,options:[n,a]}},eA=(n,a)=>({fn:GT(n).fn,options:[n,a]}),tA=(n,a)=>{const l=$T(n);return{name:l.name,fn:l.fn,options:[n,a]}},nA=(n,a)=>{const l=VT(n);return{name:l.name,fn:l.fn,options:[n,a]}},aA=(n,a)=>{const l=YT(n);return{name:l.name,fn:l.fn,options:[n,a]}},rA=(n,a)=>{const l=ZT(n);return{name:l.name,fn:l.fn,options:[n,a]}};var lA=Object.defineProperty,sA=(n,a)=>lA(n,"name",{value:a,configurable:!0});function _u(n){const[a,l]=h.useState(void 0);return Xt(()=>{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}sA(_u,"useSize");var oA=Object.defineProperty,rl=(n,a)=>oA(n,"name",{value:a,configurable:!0}),T1="Popper",[A1,Js]=Ln(T1),[iA,M1]=A1(T1),cA=rl(n=>{const{__scopePopper:a,children:l}=n,[o,c]=h.useState(null),[u,f]=h.useState(void 0);return s.jsx(iA,{scope:a,anchor:o,onAnchorChange:c,placementState:u,setPlacementState:f,children:l})},"Popper"),uA="PopperAnchor",dA=h.forwardRef(rl(function(a,l){const{__scopePopper:o,virtualRef:c,...u}=a,f=M1(uA,o),p=h.useRef(null),g=f.onAnchorChange,v=h.useCallback(j=>{p.current=j,j&&g(j)},[g]),x=Ge(l,v),y=h.useRef(null);h.useEffect(()=>{if(!c)return;const j=y.current;y.current=c.current,j!==y.current&&g(y.current)});const b=f.placementState&&zu(f.placementState),w=b==null?void 0:b[0],E=b==null?void 0:b[1];return c?null:s.jsx(Pe.div,{"data-radix-popper-side":w,"data-radix-popper-align":E,...u,ref:x})},"PopperAnchor")),D1="PopperContent",[fA,W4]=A1(D1),hA=h.forwardRef(rl(function(a,l){var he,pe,Ae,Ce,Oe,Qe,We;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:E="optimized",onPlaced:j,...C}=a,R=M1(D1,o),[D,A]=h.useState(null),M=Ge(l,A),[O,N]=h.useState(null),k=_u(O),U=(k==null?void 0:k.width)??0,V=(k==null?void 0:k.height)??0,te=c+(f!=="center"?"-"+f:""),$=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},H=Array.isArray(x)?x:[x],I=H.length>0,Q={padding:$,boundary:H.filter(O1),altBoundary:I},{refs:de,floatingStyles:_,placement:q,isPositioned:ee,middlewareData:W}=QT({strategy:"fixed",placement:te,whileElementsMounted:rl((...oe)=>PT(...oe,{animationFrame:E==="always"}),"whileElementsMounted"),elements:{reference:R.anchor},middleware:[JT({mainAxis:u+V,alignmentAxis:p}),v&&WT({mainAxis:!0,crossAxis:!1,limiter:b==="partial"?eA():void 0,...Q}),v&&tA({...Q}),nA({...Q,apply:rl(({elements:oe,rects:Le,availableWidth:He,availableHeight:_t})=>{const{width:jt,height:Ft}=Le.reference,hn=oe.floating.style;hn.setProperty("--radix-popper-available-width",`${He}px`),hn.setProperty("--radix-popper-available-height",`${_t}px`),hn.setProperty("--radix-popper-anchor-width",`${jt}px`),hn.setProperty("--radix-popper-anchor-height",`${Ft}px`)},"apply")}),O&&rA({element:O,padding:g}),mA({arrowWidth:U,arrowHeight:V}),w&&aA({strategy:"referenceHidden",...Q,boundary:I?Q.boundary:void 0})]}),ne=R.setPlacementState;Xt(()=>(ne(q),()=>{ne(void 0)}),[q,ne]);const[z,P]=zu(q),Z=ma(j);Xt(()=>{ee&&(Z==null||Z())},[ee,Z]);const se=(he=W.arrow)==null?void 0:he.x,ge=(pe=W.arrow)==null?void 0:pe.y,ye=((Ae=W.arrow)==null?void 0:Ae.centerOffset)!==0,[G,ie]=h.useState();return Xt(()=>{D&&ie(window.getComputedStyle(D).zIndex)},[D]),s.jsx("div",{ref:de.setFloating,"data-radix-popper-content-wrapper":"",style:{..._,transform:ee?_.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[(Ce=W.transformOrigin)==null?void 0:Ce.x,(Oe=W.transformOrigin)==null?void 0:Oe.y].join(" "),...((Qe=W.hide)==null?void 0:Qe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:a.dir,children:s.jsx(fA,{scope:o,placedSide:z,placedAlign:P,onArrowChange:N,arrowX:se,arrowY:ge,shouldHideArrow:ye,children:s.jsx(Pe.div,{"data-side":z,"data-align":P,...C,ref:M,style:{...C.style,animation:ee?(We=C.style)==null?void 0:We.animation:"none"}})})})},"PopperContent"));function O1(n){return n!==null}rl(O1,"isNotNull");var mA=rl(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]=zu(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 E="",j="";return v==="bottom"?(E=f?y:`${b}px`,j=`${-g}px`):v==="top"?(E=f?y:`${b}px`,j=`${o.floating.height+g}px`):v==="right"?(E=`${-g}px`,j=f?y:`${w}px`):v==="left"&&(E=`${o.floating.width+g}px`,j=f?y:`${w}px`),{data:{x:E,y:j}}}}),"transformOrigin");function zu(n){const[a,l="center"]=n.split("-");return[a,l]}rl(zu,"getSideAndAlignFromPlacement");var Fm=cA,Qm=dA,Zm=hA,pA=Object.defineProperty,gA=(n,a)=>pA(n,"name",{value:a,configurable:!0}),Jm=h.forwardRef(gA(function(a,l){var g;const{container:o,...c}=a,[u,f]=h.useState(!1);Xt(()=>f(!0),[]);const p=o||u&&((g=globalThis==null?void 0:globalThis.document)==null?void 0:g.body);return p?ja.createPortal(s.jsx(Pe.div,{...c,ref:l}),p):null},"Portal")),vA=Object.defineProperty,wr=(n,a)=>vA(n,"name",{value:a,configurable:!0});function k1(n,a){return h.useReducer((l,o)=>a[l][o]??l,n)}wr(k1,"useStateMachine");var Cr=wr(n=>{const{present:a,children:l}=n,o=_1(a),c=typeof l=="function"?l({present:o.isPresent}):h.Children.only(l),u=z1(o.ref,L1(c));return typeof l=="function"||o.isPresent?h.cloneElement(c,{ref:u}):null},"Presence");function _1(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]=k1(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??Ls(o.current),f.current=void 0):u.current="none"},[g]),Xt(()=>{const x=o.current,y=c.current;if(y!==n){const w=u.current,E=Ls(x);n?(f.current=E,v("MOUNT")):E==="none"||(x==null?void 0:x.display)==="none"?v("UNMOUNT"):v(y&&w!==E?"ANIMATION_OUT":"UNMOUNT"),c.current=n}},[n,v]),Xt(()=>{if(a){let x;const y=a.ownerDocument.defaultView??window,b=wr(E=>{const C=Ls(o.current).includes(CSS.escape(E.animationName));if(E.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(E=>{E.target===a&&(u.current=Ls(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=Ls(y)}else o.current=null;l(x)},[])}}wr(_1,"usePresence");function Zh(n,a){if(typeof n=="function")return n(a);n!=null&&(n.current=a)}wr(Zh,"setRef");function z1(...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=Zh(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():Zh(o[f],null)}}},[])}wr(z1,"useStableComposedRefs");function Ls(n){return(n==null?void 0:n.animationName)||"none"}wr(Ls,"getAnimationName");function L1(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(L1,"getElementRef");var xA=Object.defineProperty,Wm=(n,a)=>xA(n,"name",{value:a,configurable:!0}),jh=!1;function U1(){const[n,a]=h.useState(jh);return h.useEffect(()=>{jh||(jh=!0,a(!0))},[]),n}Wm(U1,"useIsHydrated");var I1=Vs[" useSyncExternalStore ".trim().toString()];function B1(){return()=>{}}Wm(B1,"subscribe");function P1(){return I1(B1,()=>!0,()=>!1)}Wm(P1,"useIsHydratedModern");var yA=typeof I1=="function"?P1:U1,bA=Object.defineProperty,Bl=(n,a)=>bA(n,"name",{value:a,configurable:!0}),Ch="rovingFocusGroup.onEntryFocus",wA={bubbles:!1,cancelable:!0},Lu="RovingFocusGroup",[Jh,H1,SA]=Ru(Lu),[jA,Uu]=Ln(Lu,[SA]),[CA,EA]=jA(Lu),NA=h.forwardRef(Bl(function(a,l){return s.jsx(Jh.Provider,{scope:a.__scopeRovingFocusGroup,children:s.jsx(Jh.Slot,{scope:a.__scopeRovingFocusGroup,children:s.jsx(RA,{...a,ref:l})})})},"RovingFocusGroup")),RA=h.forwardRef(Bl(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),E=Ge(l,w),j=vi(f),[C,R]=Ia({prop:p,defaultProp:g??null,onChange:v,caller:Lu}),[D,A]=h.useState(!1),M=ma(x),O=H1(o),N=h.useRef(!1),[k,U]=h.useState(0);return h.useEffect(()=>{const V=w.current;if(V)return V.addEventListener(Ch,M),()=>V.removeEventListener(Ch,M)},[M]),s.jsx(CA,{scope:o,orientation:c,dir:j,loop:u,currentTabStopId:C,onItemFocus:h.useCallback(V=>R(V),[R]),onItemShiftTab:h.useCallback(()=>A(!0),[]),onFocusableItemAdd:h.useCallback(()=>U(V=>V+1),[]),onFocusableItemRemove:h.useCallback(()=>U(V=>V-1),[]),children:s.jsx(Pe.div,{tabIndex:D||k===0?-1:0,"data-orientation":c,...b,ref:E,style:{outline:"none",...a.style},onMouseDown:je(a.onMouseDown,()=>{N.current=!0}),onFocus:je(a.onFocus,V=>{const te=!N.current;if(V.target===V.currentTarget&&te&&!D){const $=new CustomEvent(Ch,wA);if(V.currentTarget.dispatchEvent($),!$.defaultPrevented){const H=O().filter(q=>q.focusable),I=H.find(q=>q.active),Q=H.find(q=>q.id===C),_=[I,Q,...H].filter(Boolean).map(q=>q.ref.current);ep(_,y)}}N.current=!1}),onBlur:je(a.onBlur,()=>A(!1))})})},"RovingFocusGroupImpl")),TA="RovingFocusGroupItem",AA=h.forwardRef(Bl(function(a,l){const{__scopeRovingFocusGroup:o,focusable:c=!0,active:u=!1,tabStopId:f,children:p,...g}=a,v=Ea(),x=f||v,y=EA(TA,o),b=y.currentTabStopId===x,w=H1(o),{onFocusableItemAdd:E,onFocusableItemRemove:j,currentTabStopId:C}=y,R=yA();return Xt(()=>{if(!(!R||!c))return E(),()=>j()},[R,c,E,j]),h.useEffect(()=>{if(!(R||!c))return E(),()=>j()},[R,c,E,j]),s.jsx(Jh.ItemSlot,{scope:o,id:x,focusable:c,active:u,children:s.jsx(Pe.span,{tabIndex:b?0:-1,"data-orientation":y.orientation,...g,ref:l,onMouseDown:je(a.onMouseDown,D=>{c?y.onItemFocus(x):D.preventDefault()}),onFocus:je(a.onFocus,()=>y.onItemFocus(x)),onKeyDown:je(a.onKeyDown,D=>{if(D.key==="Tab"&&D.shiftKey){y.onItemShiftTab();return}if(D.target!==D.currentTarget)return;const A=$1(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(N=>N.focusable).map(N=>N.ref.current);if(A==="last")O.reverse();else if(A==="prev"||A==="next"){A==="prev"&&O.reverse();const N=O.indexOf(D.currentTarget);O=y.loop?V1(O,N+1):O.slice(N+1)}setTimeout(()=>ep(O))}}),children:typeof p=="function"?p({isCurrentTabStop:b,hasTabStop:C!=null}):p})})},"RovingFocusGroupItem")),MA={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function q1(n,a){return a!=="rtl"?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}Bl(q1,"getDirectionAwareKey");function $1(n,a,l){const o=q1(n.key,l);if(!(a==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(a==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return MA[o]}Bl($1,"getFocusIntent");function ep(n,a=!1){const l=document.activeElement;for(const o of n)if(o===l||(o.focus({preventScroll:a}),document.activeElement!==l))return}Bl(ep,"focusFirst");function V1(n,a){return n.map((l,o)=>n[(a+o)%n.length])}Bl(V1,"wrapArray");var Y1=NA,G1=AA,DA=function(n){if(typeof document>"u")return null;var a=Array.isArray(n)?n[0]:n;return a.ownerDocument.body},Ms=new WeakMap,Hc=new WeakMap,qc={},Eh=0,K1=function(n){return n&&(n.host||K1(n.parentNode))},OA=function(n,a){return a.map(function(l){if(n.contains(l))return l;var o=K1(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})},kA=function(n,a,l,o){var c=OA(a,Array.isArray(n)?n:[n]);qc[l]||(qc[l]=new WeakMap);var u=qc[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),E=w!==null&&w!=="false",j=(Ms.get(b)||0)+1,C=(u.get(b)||0)+1;Ms.set(b,j),u.set(b,C),f.push(b),j===1&&E&&Hc.set(b,!0),C===1&&b.setAttribute(l,"true"),E||b.setAttribute(o,"true")}catch(R){console.error("aria-hidden: cannot operate on ",b,R)}})};return x(a),p.clear(),Eh++,function(){f.forEach(function(y){var b=Ms.get(y)-1,w=u.get(y)-1;Ms.set(y,b),u.set(y,w),b||(Hc.has(y)||y.removeAttribute(o),Hc.delete(y)),w||y.removeAttribute(l)}),Eh--,Eh||(Ms=new WeakMap,Ms=new WeakMap,Hc=new WeakMap,qc={})}},tp=function(n,a,l){l===void 0&&(l="data-aria-hidden");var o=Array.from(Array.isArray(n)?n:[n]),c=DA(n);return c?(o.push.apply(o,Array.from(c.querySelectorAll("[aria-live], script"))),kA(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 X1(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 _A(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 ru="right-scroll-bar-position",lu="width-before-scroll-bar",zA="with-scroll-bars-hidden",LA="--removed-body-scroll-bar-size";function Nh(n,a){return typeof n=="function"?n(a):n&&(n.current=a),n}function UA(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 IA=typeof window<"u"?h.useLayoutEffect:h.useEffect,wb=new WeakMap;function BA(n,a){var l=UA(null,function(o){return n.forEach(function(c){return Nh(c,o)})});return IA(function(){var o=wb.get(l);if(o){var c=new Set(o),u=new Set(n),f=l.current;c.forEach(function(p){u.has(p)||Nh(p,null)}),u.forEach(function(p){c.has(p)||Nh(p,f)})}wb.set(l,n)},[n]),l}function PA(n){return n}function HA(n,a){a===void 0&&(a=PA);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 qA(n){n===void 0&&(n={});var a=HA(null);return a.options=za({async:!0,ssr:!1},n),a}var F1=function(n){var a=n.sideCar,l=X1(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))};F1.isSideCarExport=!0;function $A(n,a){return n.useMedium(a),F1}var Q1=qA(),Rh=function(){},Iu=h.forwardRef(function(n,a){var l=h.useRef(null),o=h.useState({onScrollCapture:Rh,onWheelCapture:Rh,onTouchMoveCapture:Rh}),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,E=n.noIsolation,j=n.inert,C=n.allowPinchZoom,R=n.as,D=R===void 0?"div":R,A=n.gapMode,M=X1(n,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=b,N=BA([l,a]),k=za(za({},M),c);return h.createElement(h.Fragment,null,x&&h.createElement(O,{sideCar:Q1,removeScrollBar:v,shards:y,noRelative:w,noIsolation:E,inert:j,setCallbacks:u,allowPinchZoom:!!C,lockRef:l,gapMode:A}),f?h.cloneElement(h.Children.only(p),za(za({},k),{ref:N})):h.createElement(D,za({},k,{className:g,ref:N}),p))});Iu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Iu.classNames={fullWidth:lu,zeroRight:ru};var VA=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function YA(){if(!document)return null;var n=document.createElement("style");n.type="text/css";var a=VA();return a&&n.setAttribute("nonce",a),n}function GA(n,a){n.styleSheet?n.styleSheet.cssText=a:n.appendChild(document.createTextNode(a))}function KA(n){var a=document.head||document.getElementsByTagName("head")[0];a.appendChild(n)}var XA=function(){var n=0,a=null;return{add:function(l){n==0&&(a=YA())&&(GA(a,l),KA(a)),n++},remove:function(){n--,!n&&a&&(a.parentNode&&a.parentNode.removeChild(a),a=null)}}},FA=function(){var n=XA();return function(a,l){h.useEffect(function(){return n.add(a),function(){n.remove()}},[a&&l])}},Z1=function(){var n=FA(),a=function(l){var o=l.styles,c=l.dynamic;return n(o,c),null};return a},QA={left:0,top:0,right:0,gap:0},Th=function(n){return parseInt(n||"",10)||0},ZA=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[Th(l),Th(o),Th(c)]},JA=function(n){if(n===void 0&&(n="margin"),typeof window>"u")return QA;var a=ZA(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])}},WA=Z1(),Hs="data-scroll-locked",eM=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(zA,` {
342
+ overflow: hidden `).concat(o,`;
343
+ padding-right: `).concat(p,"px ").concat(o,`;
344
+ }
345
+ body[`).concat(Hs,`] {
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(ru,` {
359
+ right: `).concat(p,"px ").concat(o,`;
360
+ }
361
+
362
+ .`).concat(lu,` {
363
+ margin-right: `).concat(p,"px ").concat(o,`;
364
+ }
365
+
366
+ .`).concat(ru," .").concat(ru,` {
367
+ right: 0 `).concat(o,`;
368
+ }
369
+
370
+ .`).concat(lu," .").concat(lu,` {
371
+ margin-right: 0 `).concat(o,`;
372
+ }
373
+
374
+ body[`).concat(Hs,`] {
375
+ `).concat(LA,": ").concat(p,`px;
376
+ }
377
+ `)},Sb=function(){var n=parseInt(document.body.getAttribute(Hs)||"0",10);return isFinite(n)?n:0},tM=function(){h.useEffect(function(){return document.body.setAttribute(Hs,(Sb()+1).toString()),function(){var n=Sb()-1;n<=0?document.body.removeAttribute(Hs):document.body.setAttribute(Hs,n.toString())}},[])},nM=function(n){var a=n.noRelative,l=n.noImportant,o=n.gapMode,c=o===void 0?"margin":o;tM();var u=h.useMemo(function(){return JA(c)},[c]);return h.createElement(WA,{styles:eM(u,!a,c,l?"":"!important")})},Wh=!1;if(typeof window<"u")try{var $c=Object.defineProperty({},"passive",{get:function(){return Wh=!0,!0}});window.addEventListener("test",$c,$c),window.removeEventListener("test",$c,$c)}catch{Wh=!1}var Ds=Wh?{passive:!1}:!1,aM=function(n){return n.tagName==="TEXTAREA"},J1=function(n,a){if(!(n instanceof Element))return!1;var l=window.getComputedStyle(n);return l[a]!=="hidden"&&!(l.overflowY===l.overflowX&&!aM(n)&&l[a]==="visible")},rM=function(n){return J1(n,"overflowY")},lM=function(n){return J1(n,"overflowX")},jb=function(n,a){var l=a.ownerDocument,o=a;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var c=W1(n,o);if(c){var u=ew(n,o),f=u[1],p=u[2];if(f>p)return!0}o=o.parentNode}while(o&&o!==l.body);return!1},sM=function(n){var a=n.scrollTop,l=n.scrollHeight,o=n.clientHeight;return[a,l,o]},oM=function(n){var a=n.scrollLeft,l=n.scrollWidth,o=n.clientWidth;return[a,l,o]},W1=function(n,a){return n==="v"?rM(a):lM(a)},ew=function(n,a){return n==="v"?sM(a):oM(a)},iM=function(n,a){return n==="h"&&a==="rtl"?-1:1},cM=function(n,a,l,o,c){var u=iM(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=ew(n,p),E=w[0],j=w[1],C=w[2],R=j-C-u*E;(E||R)&&W1(n,p)&&(y+=R,b+=E);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},Vc=function(n){return"changedTouches"in n?[n.changedTouches[0].clientX,n.changedTouches[0].clientY]:[0,0]},Cb=function(n){return[n.deltaX,n.deltaY]},Eb=function(n){return n&&"current"in n?n.current:n},uM=function(n,a){return n[0]===a[0]&&n[1]===a[1]},dM=function(n){return`
378
+ .block-interactivity-`.concat(n,` {pointer-events: none;}
379
+ .allow-interactivity-`).concat(n,` {pointer-events: all;}
380
+ `)},fM=0,Os=[];function hM(n){var a=h.useRef([]),l=h.useRef([0,0]),o=h.useRef(),c=h.useState(fM++)[0],u=h.useState(Z1)[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 j=_A([n.lockRef.current],(n.shards||[]).map(Eb),!0).filter(Boolean);return j.forEach(function(C){return C.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),j.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(c))})}}},[n.inert,n.lockRef.current,n.shards]);var p=h.useCallback(function(j,C){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!f.current.allowPinchZoom;var R=Vc(j),D=l.current,A="deltaX"in j?j.deltaX:D[0]-R[0],M="deltaY"in j?j.deltaY:D[1]-R[1],O,N=j.target,k=Math.abs(A)>Math.abs(M)?"h":"v";if("touches"in j&&k==="h"&&N.type==="range")return!1;var U=window.getSelection(),V=U&&U.anchorNode,te=V?V===N||V.contains(N):!1;if(te)return!1;var $=jb(k,N);if(!$)return!0;if($?O=k:(O=k==="v"?"h":"v",$=jb(k,N)),!$)return!1;if(!o.current&&"changedTouches"in j&&(A||M)&&(o.current=O),!O)return!0;var H=o.current||O;return cM(H,C,j,H==="h"?A:M)},[]),g=h.useCallback(function(j){var C=j;if(!(!Os.length||Os[Os.length-1]!==u)){var R="deltaY"in C?Cb(C):Vc(C),D=a.current.filter(function(O){return O.name===C.type&&(O.target===C.target||C.target===O.shadowParent)&&uM(O.delta,R)})[0];if(D&&D.should){C.cancelable&&C.preventDefault();return}if(!D){var A=(f.current.shards||[]).map(Eb).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(j,C,R,D){var A={name:j,delta:C,target:R,should:D,shadowParent:mM(R)};a.current.push(A),setTimeout(function(){a.current=a.current.filter(function(M){return M!==A})},1)},[]),x=h.useCallback(function(j){l.current=Vc(j),o.current=void 0},[]),y=h.useCallback(function(j){v(j.type,Cb(j),j.target,p(j,n.lockRef.current))},[]),b=h.useCallback(function(j){v(j.type,Vc(j),j.target,p(j,n.lockRef.current))},[]);h.useEffect(function(){return Os.push(u),n.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:b}),document.addEventListener("wheel",g,Ds),document.addEventListener("touchmove",g,Ds),document.addEventListener("touchstart",x,Ds),function(){Os=Os.filter(function(j){return j!==u}),document.removeEventListener("wheel",g,Ds),document.removeEventListener("touchmove",g,Ds),document.removeEventListener("touchstart",x,Ds)}},[]);var w=n.removeScrollBar,E=n.inert;return h.createElement(h.Fragment,null,E?h.createElement(u,{styles:dM(c)}):null,w?h.createElement(nM,{noRelative:n.noRelative,gapMode:n.gapMode}):null)}function mM(n){for(var a=null;n!==null;)n instanceof ShadowRoot&&(a=n.host,n=n.host),n=n.parentNode;return a}const pM=$A(Q1,hM);var Bu=h.forwardRef(function(n,a){return h.createElement(Iu,za({},n,{ref:a,sideCar:pM}))});Bu.classNames=Iu.classNames;var gM=Object.defineProperty,gt=(n,a)=>gM(n,"name",{value:a,configurable:!0}),vM=["Enter"," "],xM=["ArrowDown","PageUp","Home"],tw=["ArrowUp","PageDown","End"],yM=[...xM,...tw],Pu="Menu",[em,bM,wM]=Ru(Pu),[Pl,nw]=Ln(Pu,[wM,Js,Uu]),np=Js(),aw=Uu(),[SM,yi]=Pl(Pu),[jM,ap]=Pl(Pu),CM=gt(n=>{const{__scopeMenu:a,open:l=!1,children:o,dir:c,onOpenChange:u,modal:f=!0}=n,p=np(a),[g,v]=h.useState(null),x=h.useRef(!1),y=ma(u),b=vi(c);return h.useEffect(()=>{const w=gt(()=>{x.current=!0,document.addEventListener("pointerdown",E,{capture:!0,once:!0}),document.addEventListener("pointermove",E,{capture:!0,once:!0})},"handleKeyDown"),E=gt(()=>x.current=!1,"handlePointer");return document.addEventListener("keydown",w,{capture:!0}),()=>{document.removeEventListener("keydown",w,{capture:!0}),document.removeEventListener("pointerdown",E,{capture:!0}),document.removeEventListener("pointermove",E,{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(Fm,{...p,children:s.jsx(SM,{scope:a,open:l,onOpenChange:y,content:g,onContentChange:v,children:s.jsx(jM,{scope:a,onClose:h.useCallback(()=>y(!1),[y]),isUsingKeyboardRef:x,dir:b,modal:f,children:o})})})},"Menu"),EM=h.forwardRef(gt(function(a,l){const{__scopeMenu:o,...c}=a,u=np(o);return s.jsx(Qm,{...u,...c,ref:l})},"MenuAnchor")),rw="MenuPortal",[NM,RM]=Pl(rw,{forceMount:void 0}),TM=gt(n=>{const{__scopeMenu:a,forceMount:l,children:o,container:c}=n,u=yi(rw,a);return s.jsx(NM,{scope:a,forceMount:l,children:s.jsx(Cr,{present:l||u.open,children:s.jsx(Jm,{asChild:!0,container:c,children:o})})})},"MenuPortal"),ll="MenuContent",[AM,lw]=Pl(ll),MM=h.forwardRef(gt(function(a,l){const o=RM(ll,a.__scopeMenu),{forceMount:c=o.forceMount,...u}=a,f=yi(ll,a.__scopeMenu),p=ap(ll,a.__scopeMenu);return s.jsx(em.Provider,{scope:a.__scopeMenu,children:s.jsx(Cr,{present:c||f.open,children:s.jsx(em.Slot,{scope:a.__scopeMenu,children:p.modal?s.jsx(DM,{...u,ref:l}):s.jsx(OM,{...u,ref:l})})})})},"MenuContent")),DM=h.forwardRef(gt(function(a,l){const o=yi(ll,a.__scopeMenu),c=h.useRef(null),u=Ge(l,c);return h.useEffect(()=>{const f=c.current;if(f)return tp(f)},[]),s.jsx(sw,{...a,ref:u,trapFocus:o.open,disableOutsidePointerEvents:o.open,disableOutsideScroll:!0,onFocusOutside:je(a.onFocusOutside,f=>f.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>o.onOpenChange(!1)})},"MenuRootContentModal")),OM=h.forwardRef(gt(function(a,l){const o=yi(ll,a.__scopeMenu);return s.jsx(sw,{...a,ref:l,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>o.onOpenChange(!1)})},"MenuRootContentNonModal")),kM=Ua("MenuContent.ScrollLock"),sw=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:E,disableOutsideScroll:j,...C}=a,R=yi(ll,o),D=ap(ll,o),A=np(o),M=aw(o),O=bM(o),[N,k]=h.useState(null),U=h.useRef(null),V=Ge(l,U,R.onContentChange),te=h.useRef(0),$=h.useRef(""),H=h.useRef(0),I=h.useRef(null),Q=h.useRef("right"),de=h.useRef(0),_=j?Bu:h.Fragment,q=j?{as:kM,allowPinchZoom:!0}:void 0,ee=gt(ne=>{var ie,he;const z=$.current+ne,P=O().filter(pe=>!pe.disabled),Z=document.activeElement,se=(ie=P.find(pe=>pe.ref.current===Z))==null?void 0:ie.textValue,ge=P.map(pe=>pe.textValue),ye=dw(ge,z,se),G=(he=P.find(pe=>pe.textValue===ye))==null?void 0:he.ref.current;gt((function pe(Ae){$.current=Ae,window.clearTimeout(te.current),Ae!==""&&(te.current=window.setTimeout(()=>pe(""),1e3))}),"updateSearch")(z),G&&setTimeout(()=>G.focus())},"handleTypeaheadSearch");h.useEffect(()=>()=>window.clearTimeout(te.current),[]),xi();const W=h.useCallback(ne=>{var P,Z;return Q.current===((P=I.current)==null?void 0:P.side)&&hw(ne,(Z=I.current)==null?void 0:Z.area)},[]);return s.jsx(AM,{scope:o,searchRef:$,onItemEnter:h.useCallback(ne=>{W(ne)&&ne.preventDefault()},[W]),onItemLeave:h.useCallback(ne=>{var z;W(ne)||((z=U.current)==null||z.focus(),k(null))},[W]),onTriggerLeave:h.useCallback(ne=>{W(ne)&&ne.preventDefault()},[W]),pointerGraceTimerRef:H,onPointerGraceIntentChange:h.useCallback(ne=>{I.current=ne},[]),children:s.jsx(_,{...q,children:s.jsx(Hm,{asChild:!0,trapped:u,onMountAutoFocus:je(f,ne=>{var z;ne.preventDefault(),(z=U.current)==null||z.focus({preventScroll:!0})}),onUnmountAutoFocus:p,children:s.jsx(Tu,{asChild:!0,disableOutsidePointerEvents:g,onEscapeKeyDown:x,onPointerDownOutside:y,onFocusOutside:b,onInteractOutside:w,onDismiss:E,children:s.jsx(Y1,{asChild:!0,...M,dir:D.dir,orientation:"vertical",loop:c,currentTabStopId:N,onCurrentTabStopIdChange:k,onEntryFocus:je(v,ne=>{D.isUsingKeyboardRef.current||ne.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(Zm,{role:"menu","aria-orientation":"vertical","data-state":ow(R.open),"data-radix-menu-content":"",dir:D.dir,...A,...C,ref:V,style:{outline:"none",...C.style},onKeyDown:je(C.onKeyDown,ne=>{const P=ne.target.closest("[data-radix-menu-content]")===ne.currentTarget,Z=ne.ctrlKey||ne.altKey||ne.metaKey,se=ne.key.length===1;P&&(ne.key==="Tab"&&ne.preventDefault(),!Z&&se&&ee(ne.key));const ge=U.current;if(ne.target!==ge||!yM.includes(ne.key))return;ne.preventDefault();const G=O().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);tw.includes(ne.key)&&G.reverse(),cw(G)}),onBlur:je(a.onBlur,ne=>{ne.currentTarget.contains(ne.target)||(window.clearTimeout(te.current),$.current="")}),onPointerMove:je(a.onPointerMove,hu(ne=>{const z=ne.target,P=de.current!==ne.clientX;if(ne.currentTarget.contains(z)&&P){const Z=ne.clientX>de.current?"right":"left";Q.current=Z,de.current=ne.clientX}}))})})})})})})},"MenuContentImpl")),_M=h.forwardRef(gt(function(a,l){const{__scopeMenu:o,...c}=a;return s.jsx(Pe.div,{...c,ref:l})},"MenuLabel")),tm="MenuItem",Nb="menu.itemSelect",zM=h.forwardRef(gt(function(a,l){const{disabled:o=!1,onSelect:c,...u}=a,f=h.useRef(null),p=ap(tm,a.__scopeMenu),g=lw(tm,a.__scopeMenu),v=Ge(l,f),x=h.useRef(!1),y=gt(()=>{const b=f.current;if(!o&&b){const w=new CustomEvent(Nb,{bubbles:!0,cancelable:!0});b.addEventListener(Nb,E=>c==null?void 0:c(E),{once:!0}),Um(b,w),w.defaultPrevented?x.current=!1:p.onClose()}},"handleSelect");return s.jsx(LM,{...u,ref:v,disabled:o,onClick:je(a.onClick,y),onPointerDown:b=>{var w;(w=a.onPointerDown)==null||w.call(a,b),x.current=!0},onPointerUp:je(a.onPointerUp,b=>{var w;x.current||(w=b.currentTarget)==null||w.click()}),onKeyDown:je(a.onKeyDown,b=>{o||b.target!==b.currentTarget||g.searchRef.current!==""&&b.key===" "||vM.includes(b.key)&&(b.currentTarget.click(),b.preventDefault())})})},"MenuItem")),LM=h.forwardRef(gt(function(a,l){const{__scopeMenu:o,disabled:c=!1,textValue:u,...f}=a,p=lw(tm,o),g=aw(o),v=h.useRef(null),x=Ge(l,v),[y,b]=h.useState(!1),[w,E]=h.useState("");return h.useEffect(()=>{const j=v.current;j&&E((j.textContent??"").trim())},[f.children]),s.jsx(em.ItemSlot,{scope:o,disabled:c,textValue:u??w,children:s.jsx(G1,{asChild:!0,...g,focusable:!c,children:s.jsx(Pe.div,{role:"menuitem","data-highlighted":y?"":void 0,"aria-disabled":c||void 0,"data-disabled":c?"":void 0,...f,ref:x,onPointerMove:je(a.onPointerMove,hu(j=>{c?p.onItemLeave(j):(p.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:je(a.onPointerLeave,hu(j=>p.onItemLeave(j))),onFocus:je(a.onFocus,()=>b(!0)),onBlur:je(a.onBlur,()=>b(!1))})})})},"MenuItemImpl")),UM="MenuRadioGroup",[e5,t5]=Pl(UM,{value:void 0,onValueChange:gt(()=>{},"onValueChange")}),IM="MenuItemIndicator",[n5,a5]=Pl(IM,{checked:!1}),BM=h.forwardRef(gt(function(a,l){const{__scopeMenu:o,...c}=a;return s.jsx(Pe.div,{role:"separator","aria-orientation":"horizontal",...c,ref:l})},"MenuSeparator")),PM="MenuSub",[r5,l5]=Pl(PM);function ow(n){return n?"open":"closed"}gt(ow,"getOpenState");function iw(n){return n==="indeterminate"}gt(iw,"isIndeterminate");function HM(n){return iw(n)?"indeterminate":n?"checked":"unchecked"}gt(HM,"getCheckedState");function cw(n){const a=document.activeElement;for(const l of n)if(l===a||(l.focus(),document.activeElement!==a))return}gt(cw,"focusFirst");function uw(n,a){return n.map((l,o)=>n[(a+o)%n.length])}gt(uw,"wrapArray");function dw(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=uw(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(dw,"getNextMatch");function fw(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(fw,"isPointInPolygon");function hw(n,a){if(!a)return!1;const l={x:n.clientX,y:n.clientY};return fw(l,a)}gt(hw,"isPointerInGraceArea");function hu(n){return a=>a.pointerType==="mouse"?n(a):void 0}gt(hu,"whenMouse");var qM=CM,$M=EM,VM=TM,YM=MM,GM=_M,KM=zM,XM=BM,FM=Object.defineProperty,Hl=(n,a)=>FM(n,"name",{value:a,configurable:!0}),rp="DropdownMenu",[QM,s5]=Ln(rp,[nw]),ql=nw(),[ZM,mw]=QM(rp),JM=Hl(n=>{const{__scopeDropdownMenu:a,children:l,dir:o,open:c,defaultOpen:u,onOpenChange:f,modal:p=!0}=n,g=ql(a),v=h.useRef(null),[x,y]=Ia({prop:c,defaultProp:u??!1,onChange:f,caller:rp});return s.jsx(ZM,{scope:a,triggerId:Ea(),triggerRef:v,contentId:Ea(),open:x,onOpenChange:y,onOpenToggle:h.useCallback(()=>y(b=>!b),[y]),modal:p,children:s.jsx(qM,{...g,open:x,onOpenChange:y,dir:o,modal:p,children:l})})},"DropdownMenu"),WM="DropdownMenuTrigger",eD=h.forwardRef(Hl(function(a,l){const{__scopeDropdownMenu:o,disabled:c=!1,...u}=a,f=mw(WM,o),p=ql(o),g=Ge(l,f.triggerRef);return s.jsx($M,{asChild:!0,...p,children:s.jsx(Pe.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:je(a.onPointerDown,v=>{!c&&v.button===0&&v.ctrlKey===!1&&(f.onOpenToggle(),f.open||v.preventDefault())}),onKeyDown:je(a.onKeyDown,v=>{c||(["Enter"," "].includes(v.key)&&f.onOpenToggle(),v.key==="ArrowDown"&&f.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(v.key)&&v.preventDefault())})})})},"DropdownMenuTrigger")),tD=Hl(n=>{const{__scopeDropdownMenu:a,...l}=n,o=ql(a);return s.jsx(VM,{...o,...l})},"DropdownMenuPortal"),nD="DropdownMenuContent",aD=h.forwardRef(Hl(function(a,l){const{__scopeDropdownMenu:o,...c}=a,u=mw(nD,o),f=ql(o),p=h.useRef(!1);return s.jsx(YM,{id:u.contentId,"aria-labelledby":u.triggerId,...f,...c,ref:l,onCloseAutoFocus:je(a.onCloseAutoFocus,g=>{var v;p.current||(v=u.triggerRef.current)==null||v.focus(),p.current=!1,g.preventDefault()}),onInteractOutside:je(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")),rD=h.forwardRef(Hl(function(a,l){const{__scopeDropdownMenu:o,...c}=a,u=ql(o);return s.jsx(GM,{...u,...c,ref:l})},"DropdownMenuLabel")),lD=h.forwardRef(Hl(function(a,l){const{__scopeDropdownMenu:o,...c}=a,u=ql(o);return s.jsx(KM,{...u,...c,ref:l})},"DropdownMenuItem")),sD=h.forwardRef(Hl(function(a,l){const{__scopeDropdownMenu:o,...c}=a,u=ql(o);return s.jsx(XM,{...u,...c,ref:l})},"DropdownMenuSeparator")),oD=JM,iD=eD,cD=tD,pw=aD,gw=rD,vw=lD,xw=sD;const uD=oD,dD=iD,yw=h.forwardRef(({className:n,sideOffset:a=4,...l},o)=>s.jsx(cD,{children:s.jsx(pw,{ref:o,sideOffset:a,className:Ne("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",n),...l})}));yw.displayName=pw.displayName;const bw=h.forwardRef(({className:n,inset:a,...l},o)=>s.jsx(vw,{ref:o,className:Ne("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}));bw.displayName=vw.displayName;const fD=h.forwardRef(({className:n,...a},l)=>s.jsx(gw,{ref:l,className:Ne("px-2 py-1.5 text-sm font-semibold",n),...a}));fD.displayName=gw.displayName;const hD=h.forwardRef(({className:n,...a},l)=>s.jsx(xw,{ref:l,className:Ne("-mx-1 my-1 h-px bg-muted",n),...a}));hD.displayName=xw.displayName;function mD(){const{theme:n,setTheme:a}=jR(),{user:l,logout:o}=Mm(),[c,u]=h.useState(!1),[f,p]=h.useState(null),g=fi(),v=n==="light"?NN:n==="dark"?gN:pN;return h.useEffect(()=>{xe.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(ce,{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(tN,{className:"mr-1 h-4 w-4 text-blue-500"}),"Update v",f.latestVersion]}),s.jsx(ce,{variant:"ghost",size:"icon",onClick:()=>a(n==="dark"?"light":"dark"),children:s.jsx(v,{className:"h-4 w-4"})}),s.jsxs(uD,{open:c,onOpenChange:u,children:[s.jsx(dD,{asChild:!0,children:s.jsx(ce,{variant:"ghost",children:(l==null?void 0:l.username)??"admin"})}),s.jsx(yw,{align:"end",children:s.jsxs(bw,{onClick:()=>void o(),children:[s.jsx(mN,{className:"mr-2 h-4 w-4"})," Sign out"]})})]})]})]})}const Re=h.forwardRef(({className:n,type:a,...l},o)=>s.jsx("input",{type:a,className:Ne("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}));Re.displayName="Input";var pD=Object.defineProperty,gD=(n,a)=>pD(n,"name",{value:a,configurable:!0}),vD=h.forwardRef(gD(function(a,l){return s.jsx(Pe.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")),ww=vD;const be=h.forwardRef(({className:n,...a},l)=>s.jsx(ww,{ref:l,className:Ne("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",n),...a}));be.displayName=ww.displayName;const rt=h.forwardRef(({className:n,...a},l)=>s.jsx("div",{ref:l,className:Ne("rounded-lg border bg-card text-card-foreground shadow-sm",n),...a}));rt.displayName="Card";const lt=h.forwardRef(({className:n,...a},l)=>s.jsx("div",{ref:l,className:Ne("flex flex-col space-y-1.5 p-6",n),...a}));lt.displayName="CardHeader";const st=h.forwardRef(({className:n,...a},l)=>s.jsx("h3",{ref:l,className:Ne("text-lg font-semibold leading-none tracking-tight",n),...a}));st.displayName="CardTitle";const Dn=h.forwardRef(({className:n,...a},l)=>s.jsx("p",{ref:l,className:Ne("text-sm text-muted-foreground",n),...a}));Dn.displayName="CardDescription";const ot=h.forwardRef(({className:n,...a},l)=>s.jsx("div",{ref:l,className:Ne("p-6 pt-0",n),...a}));ot.displayName="CardContent";const Sw=h.forwardRef(({className:n,...a},l)=>s.jsx("div",{ref:l,className:Ne("flex items-center p-6 pt-0",n),...a}));Sw.displayName="CardFooter";var xD=n=>{switch(n){case"success":return wD;case"info":return jD;case"warning":return SD;case"error":return CD;default:return null}},yD=Array(12).fill(0),bD=({visible:n,className:a})=>ue.createElement("div",{className:["sonner-loading-wrapper",a].filter(Boolean).join(" "),"data-visible":n},ue.createElement("div",{className:"sonner-spinner"},yD.map((l,o)=>ue.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),wD=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),SD=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ue.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),jD=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),CD=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),ED=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ue.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ue.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),ND=()=>{let[n,a]=ue.useState(document.hidden);return ue.useEffect(()=>{let l=()=>{a(document.hidden)};return document.addEventListener("visibilitychange",l),()=>window.removeEventListener("visibilitychange",l)},[]),n},nm=1,RD=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:nm++,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],ue.isValidElement(g))c=!1,this.create({id:l,type:"default",message:g});else if(AD(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)||nm++;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}},Mn=new RD,TD=(n,a)=>{let l=(a==null?void 0:a.id)||nm++;return Mn.addToast({title:n,...a,id:l}),l},AD=n=>n&&typeof n=="object"&&"ok"in n&&typeof n.ok=="boolean"&&"status"in n&&typeof n.status=="number",MD=TD,DD=()=>Mn.toasts,OD=()=>Mn.getActiveToasts(),me=Object.assign(MD,{success:Mn.success,info:Mn.info,warning:Mn.warning,error:Mn.error,custom:Mn.custom,message:Mn.message,promise:Mn.promise,dismiss:Mn.dismiss,loading:Mn.loading},{getHistory:DD,getToasts:OD});function kD(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))}kD(`: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 Yc(n){return n.label!==void 0}var _D=3,zD="32px",LD="16px",Rb=4e3,UD=356,ID=14,BD=20,PD=200;function wa(...n){return n.filter(Boolean).join(" ")}function HD(n){let[a,l]=n.split("-"),o=[];return a&&o.push(a),l&&o.push(l),o}var qD=n=>{var a,l,o,c,u,f,p,g,v,x,y;let{invert:b,toast:w,unstyled:E,interacting:j,setHeights:C,visibleToasts:R,heights:D,index:A,toasts:M,expanded:O,removeToast:N,defaultRichColors:k,closeButton:U,style:V,cancelButtonStyle:te,actionButtonStyle:$,className:H="",descriptionClassName:I="",duration:Q,position:de,gap:_,loadingIcon:q,expandByDefault:ee,classNames:W,icons:ne,closeButtonAriaLabel:z="Close toast",pauseWhenPageIsHidden:P}=n,[Z,se]=ue.useState(null),[ge,ye]=ue.useState(null),[G,ie]=ue.useState(!1),[he,pe]=ue.useState(!1),[Ae,Ce]=ue.useState(!1),[Oe,Qe]=ue.useState(!1),[We,oe]=ue.useState(!1),[Le,He]=ue.useState(0),[_t,jt]=ue.useState(0),Ft=ue.useRef(w.duration||Q||Rb),hn=ue.useRef(null),Qt=ue.useRef(null),Ct=A===0,xn=A+1<=R,At=w.type,Mt=w.dismissible!==!1,mn=w.className||"",pa=w.descriptionClassName||"",Aa=ue.useMemo(()=>D.findIndex(Ee=>Ee.toastId===w.id)||0,[D,w.id]),Wn=ue.useMemo(()=>{var Ee;return(Ee=w.closeButton)!=null?Ee:U},[w.closeButton,U]),dl=ue.useMemo(()=>w.duration||Q||Rb,[w.duration,Q]),ga=ue.useRef(0),Dt=ue.useRef(0),yn=ue.useRef(0),Tt=ue.useRef(null),[ao,Vl]=de.split("-"),Yl=ue.useMemo(()=>D.reduce((Ee,_e,Ue)=>Ue>=Aa?Ee:Ee+_e.height,0),[D,Aa]),Ya=ND(),Rr=w.invert||b,xt=At==="loading";Dt.current=ue.useMemo(()=>Aa*_+Yl,[Aa,Yl]),ue.useEffect(()=>{Ft.current=dl},[dl]),ue.useEffect(()=>{ie(!0)},[]),ue.useEffect(()=>{let Ee=Qt.current;if(Ee){let _e=Ee.getBoundingClientRect().height;return jt(_e),C(Ue=>[{toastId:w.id,height:_e,position:w.position},...Ue]),()=>C(Ue=>Ue.filter(vt=>vt.toastId!==w.id))}},[C,w.id]),ue.useLayoutEffect(()=>{if(!G)return;let Ee=Qt.current,_e=Ee.style.height;Ee.style.height="auto";let Ue=Ee.getBoundingClientRect().height;Ee.style.height=_e,jt(Ue),C(vt=>vt.find(Et=>Et.toastId===w.id)?vt.map(Et=>Et.toastId===w.id?{...Et,height:Ue}:Et):[{toastId:w.id,height:Ue,position:w.position},...vt])},[G,w.title,w.description,C,w.id]);let at=ue.useCallback(()=>{pe(!0),He(Dt.current),C(Ee=>Ee.filter(_e=>_e.toastId!==w.id)),setTimeout(()=>{N(w)},PD)},[w,N,C,Dt]);ue.useEffect(()=>{if(w.promise&&At==="loading"||w.duration===1/0||w.type==="loading")return;let Ee;return O||j||P&&Ya?(()=>{if(yn.current<ga.current){let _e=new Date().getTime()-ga.current;Ft.current=Ft.current-_e}yn.current=new Date().getTime()})():Ft.current!==1/0&&(ga.current=new Date().getTime(),Ee=setTimeout(()=>{var _e;(_e=w.onAutoClose)==null||_e.call(w,w),at()},Ft.current)),()=>clearTimeout(Ee)},[O,j,w,At,P,Ya,at]),ue.useEffect(()=>{w.delete&&at()},[at,w.delete]);function It(){var Ee,_e,Ue;return ne!=null&&ne.loading?ue.createElement("div",{className:wa(W==null?void 0:W.loader,(Ee=w==null?void 0:w.classNames)==null?void 0:Ee.loader,"sonner-loader"),"data-visible":At==="loading"},ne.loading):q?ue.createElement("div",{className:wa(W==null?void 0:W.loader,(_e=w==null?void 0:w.classNames)==null?void 0:_e.loader,"sonner-loader"),"data-visible":At==="loading"},q):ue.createElement(bD,{className:wa(W==null?void 0:W.loader,(Ue=w==null?void 0:w.classNames)==null?void 0:Ue.loader),visible:At==="loading"})}return ue.createElement("li",{tabIndex:0,ref:Qt,className:wa(H,mn,W==null?void 0:W.toast,(a=w==null?void 0:w.classNames)==null?void 0:a.toast,W==null?void 0:W.default,W==null?void 0:W[At],(l=w==null?void 0:w.classNames)==null?void 0:l[At]),"data-sonner-toast":"","data-rich-colors":(o=w.richColors)!=null?o:k,"data-styled":!(w.jsx||w.unstyled||E),"data-mounted":G,"data-promise":!!w.promise,"data-swiped":We,"data-removed":he,"data-visible":xn,"data-y-position":ao,"data-x-position":Vl,"data-index":A,"data-front":Ct,"data-swiping":Ae,"data-dismissible":Mt,"data-type":At,"data-invert":Rr,"data-swipe-out":Oe,"data-swipe-direction":ge,"data-expanded":!!(O||ee&&G),style:{"--index":A,"--toasts-before":A,"--z-index":M.length-A,"--offset":`${he?Le:Dt.current}px`,"--initial-height":ee?"auto":`${_t}px`,...V,...w.style},onDragEnd:()=>{Ce(!1),se(null),Tt.current=null},onPointerDown:Ee=>{xt||!Mt||(hn.current=new Date,He(Dt.current),Ee.target.setPointerCapture(Ee.pointerId),Ee.target.tagName!=="BUTTON"&&(Ce(!0),Tt.current={x:Ee.clientX,y:Ee.clientY}))},onPointerUp:()=>{var Ee,_e,Ue,vt;if(Oe||!Mt)return;Tt.current=null;let Et=Number(((Ee=Qt.current)==null?void 0:Ee.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ut=Number(((_e=Qt.current)==null?void 0:_e.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Vt=new Date().getTime()-((Ue=hn.current)==null?void 0:Ue.getTime()),yt=Z==="x"?Et:ut,zt=Math.abs(yt)/Vt;if(Math.abs(yt)>=BD||zt>.11){He(Dt.current),(vt=w.onDismiss)==null||vt.call(w,w),ye(Z==="x"?Et>0?"right":"left":ut>0?"down":"up"),at(),Qe(!0),oe(!1);return}Ce(!1),se(null)},onPointerMove:Ee=>{var _e,Ue,vt,Et;if(!Tt.current||!Mt||((_e=window.getSelection())==null?void 0:_e.toString().length)>0)return;let ut=Ee.clientY-Tt.current.y,Vt=Ee.clientX-Tt.current.x,yt=(Ue=n.swipeDirections)!=null?Ue:HD(de);!Z&&(Math.abs(Vt)>1||Math.abs(ut)>1)&&se(Math.abs(Vt)>Math.abs(ut)?"x":"y");let zt={x:0,y:0};Z==="y"?(yt.includes("top")||yt.includes("bottom"))&&(yt.includes("top")&&ut<0||yt.includes("bottom")&&ut>0)&&(zt.y=ut):Z==="x"&&(yt.includes("left")||yt.includes("right"))&&(yt.includes("left")&&Vt<0||yt.includes("right")&&Vt>0)&&(zt.x=Vt),(Math.abs(zt.x)>0||Math.abs(zt.y)>0)&&oe(!0),(vt=Qt.current)==null||vt.style.setProperty("--swipe-amount-x",`${zt.x}px`),(Et=Qt.current)==null||Et.style.setProperty("--swipe-amount-y",`${zt.y}px`)}},Wn&&!w.jsx?ue.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(W==null?void 0:W.closeButton,(c=w==null?void 0:w.classNames)==null?void 0:c.closeButton)},(u=ne==null?void 0:ne.close)!=null?u:ED):null,w.jsx||h.isValidElement(w.title)?w.jsx?w.jsx:typeof w.title=="function"?w.title():w.title:ue.createElement(ue.Fragment,null,At||w.icon||w.promise?ue.createElement("div",{"data-icon":"",className:wa(W==null?void 0:W.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])||xD(At):null):null,ue.createElement("div",{"data-content":"",className:wa(W==null?void 0:W.content,(p=w==null?void 0:w.classNames)==null?void 0:p.content)},ue.createElement("div",{"data-title":"",className:wa(W==null?void 0:W.title,(g=w==null?void 0:w.classNames)==null?void 0:g.title)},typeof w.title=="function"?w.title():w.title),w.description?ue.createElement("div",{"data-description":"",className:wa(I,pa,W==null?void 0:W.description,(v=w==null?void 0:w.classNames)==null?void 0:v.description)},typeof w.description=="function"?w.description():w.description):null),h.isValidElement(w.cancel)?w.cancel:w.cancel&&Yc(w.cancel)?ue.createElement("button",{"data-button":!0,"data-cancel":!0,style:w.cancelButtonStyle||te,onClick:Ee=>{var _e,Ue;Yc(w.cancel)&&Mt&&((Ue=(_e=w.cancel).onClick)==null||Ue.call(_e,Ee),at())},className:wa(W==null?void 0:W.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&&Yc(w.action)?ue.createElement("button",{"data-button":!0,"data-action":!0,style:w.actionButtonStyle||$,onClick:Ee=>{var _e,Ue;Yc(w.action)&&((Ue=(_e=w.action).onClick)==null||Ue.call(_e,Ee),!Ee.defaultPrevented&&at())},className:wa(W==null?void 0:W.actionButton,(y=w==null?void 0:w.classNames)==null?void 0:y.actionButton)},w.action.label):null))};function Tb(){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 $D(n,a){let l={};return[n,a].forEach((o,c)=>{let u=c===1,f=u?"--mobile-offset":"--offset",p=u?LD:zD;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 VD=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:E=_D,toastOptions:j,dir:C=Tb(),gap:R=ID,loadingIcon:D,icons:A,containerAriaLabel:M="Notifications",pauseWhenPageIsHidden:O}=n,[N,k]=ue.useState([]),U=ue.useMemo(()=>Array.from(new Set([o].concat(N.filter(P=>P.position).map(P=>P.position)))),[N,o]),[V,te]=ue.useState([]),[$,H]=ue.useState(!1),[I,Q]=ue.useState(!1),[de,_]=ue.useState(x!=="system"?x:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),q=ue.useRef(null),ee=c.join("+").replace(/Key/g,"").replace(/Digit/g,""),W=ue.useRef(null),ne=ue.useRef(!1),z=ue.useCallback(P=>{k(Z=>{var se;return(se=Z.find(ge=>ge.id===P.id))!=null&&se.delete||Mn.dismiss(P.id),Z.filter(({id:ge})=>ge!==P.id)})},[]);return ue.useEffect(()=>Mn.subscribe(P=>{if(P.dismiss){k(Z=>Z.map(se=>se.id===P.id?{...se,delete:!0}:se));return}setTimeout(()=>{GE.flushSync(()=>{k(Z=>{let se=Z.findIndex(ge=>ge.id===P.id);return se!==-1?[...Z.slice(0,se),{...Z[se],...P},...Z.slice(se+1)]:[P,...Z]})})})}),[]),ue.useEffect(()=>{if(x!=="system"){_(x);return}if(x==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?_("dark"):_("light")),typeof window>"u")return;let P=window.matchMedia("(prefers-color-scheme: dark)");try{P.addEventListener("change",({matches:Z})=>{_(Z?"dark":"light")})}catch{P.addListener(({matches:se})=>{try{_(se?"dark":"light")}catch(ge){console.error(ge)}})}},[x]),ue.useEffect(()=>{N.length<=1&&H(!1)},[N]),ue.useEffect(()=>{let P=Z=>{var se,ge;c.every(ye=>Z[ye]||Z.code===ye)&&(H(!0),(se=q.current)==null||se.focus()),Z.code==="Escape"&&(document.activeElement===q.current||(ge=q.current)!=null&&ge.contains(document.activeElement))&&H(!1)};return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[c]),ue.useEffect(()=>{if(q.current)return()=>{W.current&&(W.current.focus({preventScroll:!0}),W.current=null,ne.current=!1)}},[q.current]),ue.createElement("section",{ref:a,"aria-label":`${M} ${ee}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},U.map((P,Z)=>{var se;let[ge,ye]=P.split("-");return N.length?ue.createElement("ol",{key:P,dir:C==="auto"?Tb():C,tabIndex:-1,ref:q,className:p,"data-sonner-toaster":!0,"data-theme":de,"data-y-position":ge,"data-lifted":$&&N.length>1&&!u,"data-x-position":ye,style:{"--front-toast-height":`${((se=V[0])==null?void 0:se.height)||0}px`,"--width":`${UD}px`,"--gap":`${R}px`,...w,...$D(g,v)},onBlur:G=>{ne.current&&!G.currentTarget.contains(G.relatedTarget)&&(ne.current=!1,W.current&&(W.current.focus({preventScroll:!0}),W.current=null))},onFocus:G=>{G.target instanceof HTMLElement&&G.target.dataset.dismissible==="false"||ne.current||(ne.current=!0,W.current=G.relatedTarget)},onMouseEnter:()=>H(!0),onMouseMove:()=>H(!0),onMouseLeave:()=>{I||H(!1)},onDragEnd:()=>H(!1),onPointerDown:G=>{G.target instanceof HTMLElement&&G.target.dataset.dismissible==="false"||Q(!0)},onPointerUp:()=>Q(!1)},N.filter(G=>!G.position&&Z===0||G.position===P).map((G,ie)=>{var he,pe;return ue.createElement(qD,{key:G.id,icons:A,index:ie,toast:G,defaultRichColors:y,duration:(he=j==null?void 0:j.duration)!=null?he:b,className:j==null?void 0:j.className,descriptionClassName:j==null?void 0:j.descriptionClassName,invert:l,visibleToasts:E,closeButton:(pe=j==null?void 0:j.closeButton)!=null?pe:f,interacting:I,position:P,style:j==null?void 0:j.style,unstyled:j==null?void 0:j.unstyled,classNames:j==null?void 0:j.classNames,cancelButtonStyle:j==null?void 0:j.cancelButtonStyle,actionButtonStyle:j==null?void 0:j.actionButtonStyle,removeToast:z,toasts:N.filter(Ae=>Ae.position==G.position),heights:V.filter(Ae=>Ae.position==G.position),setHeights:te,expandByDefault:u,gap:R,loadingIcon:D,expanded:$,pauseWhenPageIsHidden:O,swipeDirections:n.swipeDirections})})):null}))});function YD(){const{login:n}=Mm(),[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=fi(),E=zn();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(lt,{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(st,{children:"Sign in"})]}),s.jsx(Dn,{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(Re,{value:a,onChange:j=>l(j.target.value),autoFocus:!0})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Password"}),s.jsx(Re,{type:"password",value:o,onChange:j=>c(j.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(Re,{value:u,onChange:j=>f(j.target.value),placeholder:"123456",maxLength:6})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Recovery code (alternative)"}),s.jsx(Re,{value:p,onChange:j=>g(j.target.value),placeholder:"ABCD12-EF3456"})]})]})]}),s.jsx("div",{className:"px-6 pb-6",children:s.jsx(ce,{className:"w-full",disabled:y,onClick:async()=>{var j,C;b(!0);try{if((await n(a,o,u||void 0,p||void 0)).totpRequired){x(!0);return}const D=((C=(j=E.state)==null?void 0:j.from)==null?void 0:C.pathname)??"/";w(D,{replace:!0})}catch(R){me.error(R.message)}finally{b(!1)}},children:"Sign in"})})]})})}function GD(){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(""),[E,j]=h.useState(!1);h.useEffect(()=>{xe.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(lt,{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(st,{children:"Welcome to LateDev Router"})]}),s.jsx(Dn,{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(Re,{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(Re,{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(Re,{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(Sw,{className:"flex-col items-stretch gap-4",children:[s.jsx(ce,{disabled:!R,onClick:async()=>{p(!0);try{await xe.post("/api/admin/setup",{username:n,password:l,setupMasterKey:g?c.trim():void 0}),me.success("Admin account created"),window.location.assign("/login")}catch(D){me.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(Re,{type:"file",accept:".json,application/json",onChange:D=>{var A;return y(((A=D.target.files)==null?void 0:A[0])??null)}}),s.jsx(Re,{inputMode:"numeric",maxLength:6,value:b,onChange:D=>w(D.target.value.replace(/\D/g,"")),placeholder:"Backup passphrase (6 digits)"}),s.jsx(ce,{variant:"outline",disabled:!x||b.length!==6||E,onClick:async()=>{var D,A;if(x){j(!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");me.success("Database imported"),window.location.assign("/login")}catch(M){me.error(M.message)}finally{j(!1)}}},children:"Import database"})]})]})]})})}function Va({title:n,description:a,actions:l,className:o}){return s.jsxs("div",{className:Ne("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 KD=X0("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 nt({className:n,variant:a,...l}){return s.jsx("div",{className:Ne(KD({variant:a}),n),...l})}function XD(){const[n,a]=h.useState(null);return h.useEffect(()=>{xe.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(ce,{asChild:!0,variant:"outline",size:"sm",children:s.jsxs(Ol,{to:"/providers",children:[s.jsx(mi,{className:"mr-1 h-4 w-4"})," Provider"]})}),s.jsx(ce,{asChild:!0,variant:"outline",size:"sm",children:s.jsxs(Ol,{to:"/combos",children:[s.jsx(D0,{className:"mr-1 h-4 w-4"})," Combo"]})}),s.jsx(ce,{asChild:!0,variant:"outline",size:"sm",children:s.jsxs(Ol,{to:"/api-keys",children:[s.jsx(M0,{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(lt,{className:"pb-1",children:s.jsx(st,{className:"text-sm text-muted-foreground",children:"Requests today"})}),s.jsx(ot,{className:"text-2xl font-semibold",children:Kt(n.today.total)})]}),s.jsxs(rt,{children:[s.jsx(lt,{className:"pb-1",children:s.jsx(st,{className:"text-sm text-muted-foreground",children:"Success rate"})}),s.jsx(ot,{className:"text-2xl font-semibold",children:n.today.total?Nu(n.today.success/n.today.total):"—"})]}),s.jsxs(rt,{children:[s.jsx(lt,{className:"pb-1",children:s.jsx(st,{className:"text-sm text-muted-foreground",children:"Failed"})}),s.jsx(ot,{className:"text-2xl font-semibold",children:Kt(n.today.failed)})]}),s.jsxs(rt,{children:[s.jsx(lt,{className:"pb-1",children:s.jsx(st,{className:"text-sm text-muted-foreground",children:"Tokens today"})}),s.jsx(ot,{className:"text-2xl font-semibold",children:Kt(n.today.totalTokens)})]})]}),s.jsxs("div",{className:"mt-6 grid gap-4 lg:grid-cols-2",children:[s.jsxs(rt,{children:[s.jsxs(lt,{children:[s.jsx(st,{className:"text-base",children:"Provider health"}),s.jsxs(Dn,{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(Ol,{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(O0,{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(nt,{variant:"outline",className:"ml-2",children:l.type})]}),s.jsx(nt,{variant:l.health==="healthy"?"success":l.health==="down"?"destructive":"secondary",children:l.health})]},l.id))]})]}),s.jsxs(rt,{children:[s.jsxs(lt,{children:[s.jsx(st,{className:"text-base",children:"Recent failures"}),s.jsx(Dn,{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:zm(l.createdAt)})]},l.id)})]})]})]})]}):s.jsx("div",{className:"text-muted-foreground",children:"Loading…"})}const Xn=h.forwardRef(({className:n,...a},l)=>s.jsx("div",{className:"relative w-full overflow-auto",children:s.jsx("table",{ref:l,className:Ne("w-full caption-bottom text-sm",n),...a})}));Xn.displayName="Table";const Fn=h.forwardRef(({className:n,...a},l)=>s.jsx("thead",{ref:l,className:Ne("[&_tr]:border-b",n),...a}));Fn.displayName="TableHeader";const Qn=h.forwardRef(({className:n,...a},l)=>s.jsx("tbody",{ref:l,className:Ne("[&_tr:last-child]:border-0",n),...a}));Qn.displayName="TableBody";const Fe=h.forwardRef(({className:n,...a},l)=>s.jsx("tr",{ref:l,className:Ne("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",n),...a}));Fe.displayName="TableRow";const ve=h.forwardRef(({className:n,...a},l)=>s.jsx("th",{ref:l,className:Ne("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:Ne("p-2 align-middle",n),...a}));fe.displayName="TableCell";var FD=Object.defineProperty,Jn=(n,a)=>FD(n,"name",{value:a,configurable:!0}),lp="Dialog",[jw,Cw]=Ln(lp),[QD,Ta]=jw(lp),Ew=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:lp}),[y,b]=h.useState(0),[w,E]=h.useState(0);return s.jsx(QD,{scope:a,triggerRef:p,contentRef:g,contentId:Ea(),titleId:Ea(),descriptionId:Ea(),titlePresent:y>0,descriptionPresent:w>0,setTitleCount:b,setDescriptionCount:E,open:v,onOpenChange:x,onOpenToggle:h.useCallback(()=>x(j=>!j),[x]),modal:f,children:l})},"Dialog"),ZD="DialogTrigger",Nw=h.forwardRef(Jn(function(a,l){const{__scopeDialog:o,...c}=a,u=Ta(ZD,o),f=Ge(l,u.triggerRef);return s.jsx(Pe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":u.open,"aria-controls":u.open?u.contentId:void 0,"data-state":Hu(u.open),...c,ref:f,onClick:je(a.onClick,u.onOpenToggle)})},"DialogTrigger")),Rw="DialogPortal",[JD,Tw]=jw(Rw,{forceMount:void 0}),Aw=Jn(n=>{const{__scopeDialog:a,forceMount:l,children:o,container:c}=n,u=Ta(Rw,a);return s.jsx(JD,{scope:a,forceMount:l,children:h.Children.map(o,f=>s.jsx(Cr,{present:l||u.open,children:s.jsx(Jm,{asChild:!0,container:c,children:f})}))})},"DialogPortal"),am="DialogOverlay",sp=h.forwardRef(Jn(function(a,l){const o=Tw(am,a.__scopeDialog),{forceMount:c=o.forceMount,...u}=a,f=Ta(am,a.__scopeDialog);return f.modal?s.jsx(Cr,{present:c||f.open,children:s.jsx(eO,{...u,ref:l})}):null},"DialogOverlay")),WD=Ua("DialogOverlay.RemoveScroll"),eO=h.forwardRef(Jn(function(a,l){const{__scopeDialog:o,...c}=a,u=Ta(am,o),f=i1(),p=Ge(l,f);return s.jsx(Bu,{as:WD,allowPinchZoom:!0,shards:[u.contentRef],children:s.jsx(Pe.div,{"data-state":Hu(u.open),...c,ref:p,style:{pointerEvents:"auto",...c.style}})})},"DialogOverlayImpl")),li="DialogContent",op=h.forwardRef(Jn(function(a,l){const o=Tw(li,a.__scopeDialog),{forceMount:c=o.forceMount,...u}=a,f=Ta(li,a.__scopeDialog);return s.jsx(Cr,{present:c||f.open,children:f.modal?s.jsx(tO,{...u,ref:l}):s.jsx(nO,{...u,ref:l})})},"DialogContent")),tO=h.forwardRef(Jn(function(a,l){const o=Ta(li,a.__scopeDialog),c=h.useRef(null),u=Ge(l,o.contentRef,c);return h.useEffect(()=>{const f=c.current;if(f)return tp(f)},[]),s.jsx(Mw,{...a,ref:u,trapFocus:o.open,disableOutsidePointerEvents:o.open,onCloseAutoFocus:je(a.onCloseAutoFocus,f=>{var p;f.preventDefault(),(p=o.triggerRef.current)==null||p.focus()}),onPointerDownOutside:je(a.onPointerDownOutside,f=>{const p=f.detail.originalEvent,g=p.button===0&&p.ctrlKey===!0;(p.button===2||g)&&f.preventDefault()}),onFocusOutside:je(a.onFocusOutside,f=>f.preventDefault())})},"DialogContentModal")),nO=h.forwardRef(Jn(function(a,l){const o=Ta(li,a.__scopeDialog),c=h.useRef(!1),u=h.useRef(!1);return s.jsx(Mw,{...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")),Mw=h.forwardRef(Jn(function(a,l){const{__scopeDialog:o,trapFocus:c,onOpenAutoFocus:u,onCloseAutoFocus:f,...p}=a,g=Ta(li,o);return xi(),s.jsx(s.Fragment,{children:s.jsx(Hm,{asChild:!0,loop:!0,trapped:c,onMountAutoFocus:u,onUnmountAutoFocus:f,children:s.jsx(Tu,{role:"dialog",id:g.contentId,"aria-describedby":g.descriptionPresent?g.descriptionId:void 0,"aria-labelledby":g.titlePresent?g.titleId:void 0,"data-state":Hu(g.open),...p,ref:l,deferPointerDownOutside:!0,onDismiss:()=>g.onOpenChange(!1)})})})},"DialogContentImpl")),aO="DialogTitle",ip=h.forwardRef(Jn(function(a,l){const{__scopeDialog:o,...c}=a,u=Ta(aO,o),{setTitleCount:f}=u;return Xt(()=>(f(p=>p+1),()=>f(p=>p-1)),[f]),s.jsx(Pe.h2,{id:u.titleId,...c,ref:l})},"DialogTitle")),rO="DialogDescription",cp=h.forwardRef(Jn(function(a,l){const{__scopeDialog:o,...c}=a,u=Ta(rO,o),{setDescriptionCount:f}=u;return Xt(()=>(f(p=>p+1),()=>f(p=>p-1)),[f]),s.jsx(Pe.p,{id:u.descriptionId,...c,ref:l})},"DialogDescription")),lO="DialogClose",up=h.forwardRef(Jn(function(a,l){const{__scopeDialog:o,...c}=a,u=Ta(lO,o);return s.jsx(Pe.button,{type:"button",...c,ref:l,onClick:je(a.onClick,()=>u.onOpenChange(!1))})},"DialogClose"));function Hu(n){return n?"open":"closed"}Jn(Hu,"getState");const vn=Ew,bi=Nw,sO=Aw,Dw=h.forwardRef(({className:n,...a},l)=>s.jsx(sp,{ref:l,className:Ne("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}));Dw.displayName=sp.displayName;const on=h.forwardRef(({className:n,children:a,...l},o)=>s.jsxs(sO,{children:[s.jsx(Dw,{}),s.jsxs(op,{ref:o,className:Ne("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(up,{className:"absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100",children:[s.jsx(Eu,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));on.displayName=op.displayName;const cn=({className:n,...a})=>s.jsx("div",{className:Ne("flex flex-col space-y-1.5 text-center sm:text-left",n),...a});cn.displayName="DialogHeader";const un=({className:n,...a})=>s.jsx("div",{className:Ne("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...a});un.displayName="DialogFooter";const dn=h.forwardRef(({className:n,...a},l)=>s.jsx(ip,{ref:l,className:Ne("text-lg font-semibold leading-none tracking-tight",n),...a}));dn.displayName=ip.displayName;const Ll=h.forwardRef(({className:n,...a},l)=>s.jsx(cp,{ref:l,className:Ne("text-sm text-muted-foreground",n),...a}));Ll.displayName=cp.displayName;var oO=Object.defineProperty,Er=(n,a)=>oO(n,"name",{value:a,configurable:!0}),iO="AlertDialog",[cO,o5]=Ln(iO,[Cw]),Nr=Cw(),uO=Er(n=>{const{__scopeAlertDialog:a,...l}=n,o=Nr(a);return s.jsx(Ew,{...o,...l,modal:!0})},"AlertDialog"),dO=h.forwardRef(Er(function(a,l){const{__scopeAlertDialog:o,...c}=a,u=Nr(o);return s.jsx(Nw,{...u,...c,ref:l})},"AlertDialogTrigger")),fO=Er(n=>{const{__scopeAlertDialog:a,...l}=n,o=Nr(a);return s.jsx(Aw,{...o,...l})},"AlertDialogPortal"),hO=h.forwardRef(Er(function(a,l){const{__scopeAlertDialog:o,...c}=a,u=Nr(o);return s.jsx(sp,{...u,...c,ref:l})},"AlertDialogOverlay")),mO="AlertDialogContent",[pO,gO]=cO(mO),vO=h.forwardRef(Er(function(a,l){const{__scopeAlertDialog:o,children:c,...u}=a,f=Nr(o),p=h.useRef(null),g=Ge(l,p),v=h.useRef(null);return s.jsx(pO,{scope:o,cancelRef:v,children:s.jsx(op,{role:"alertdialog",...f,...u,ref:g,onOpenAutoFocus:je(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")),xO=h.forwardRef(Er(function(a,l){const{__scopeAlertDialog:o,...c}=a,u=Nr(o);return s.jsx(ip,{...u,...c,ref:l})},"AlertDialogTitle")),yO=h.forwardRef(Er(function(a,l){const{__scopeAlertDialog:o,...c}=a,u=Nr(o);return s.jsx(cp,{...u,...c,ref:l})},"AlertDialogDescription")),bO=h.forwardRef(Er(function(a,l){const{__scopeAlertDialog:o,...c}=a,u=Nr(o);return s.jsx(up,{...u,...c,ref:l})},"AlertDialogAction")),wO="AlertDialogCancel",SO=h.forwardRef(Er(function(a,l){const{__scopeAlertDialog:o,...c}=a,{cancelRef:u}=gO(wO,o),f=Nr(o),p=Ge(l,u);return s.jsx(up,{...f,...c,ref:p})},"AlertDialogCancel")),jO=uO,CO=dO,EO=fO,Ow=hO,kw=vO,_w=bO,zw=SO,Lw=xO,Uw=yO;const Iw=jO,NO=CO,RO=EO,Bw=h.forwardRef(({className:n,...a},l)=>s.jsx(Ow,{ref:l,className:Ne("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}));Bw.displayName=Ow.displayName;const dp=h.forwardRef(({className:n,...a},l)=>s.jsxs(RO,{children:[s.jsx(Bw,{}),s.jsx(kw,{ref:l,className:Ne("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})]}));dp.displayName=kw.displayName;const Pw=({className:n,...a})=>s.jsx("div",{className:Ne("flex flex-col space-y-2 text-center sm:text-left",n),...a}),Hw=({className:n,...a})=>s.jsx("div",{className:Ne("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...a}),fp=h.forwardRef(({className:n,...a},l)=>s.jsx(Lw,{ref:l,className:Ne("text-lg font-semibold",n),...a}));fp.displayName=Lw.displayName;const hp=h.forwardRef(({className:n,...a},l)=>s.jsx(Uw,{ref:l,className:Ne("text-sm text-muted-foreground",n),...a}));hp.displayName=Uw.displayName;const mp=h.forwardRef(({className:n,...a},l)=>s.jsx(_w,{ref:l,className:Ne("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}));mp.displayName=_w.displayName;const pp=h.forwardRef(({className:n,...a},l)=>s.jsx(zw,{ref:l,className:Ne("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}));pp.displayName=zw.displayName;var TO=Object.defineProperty,AO=(n,a)=>TO(n,"name",{value:a,configurable:!0});function rm(n,[a,l]){return Math.min(l,Math.max(a,n))}AO(rm,"clamp");var MO=Object.defineProperty,DO=(n,a)=>MO(n,"name",{value:a,configurable:!0});function qw(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])}DO(qw,"usePrevious");var OO=Object.defineProperty,kO=(n,a)=>OO(n,"name",{value:a,configurable:!0}),$w=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"}),_O=h.forwardRef(kO(function(a,l){return s.jsx(Pe.span,{...a,ref:l,style:{...$w,...a.style}})},"VisuallyHidden")),zO=_O,LO=Object.defineProperty,mt=(n,a)=>LO(n,"name",{value:a,configurable:!0}),UO=[" ","Enter","ArrowUp","ArrowDown"],IO=[" ","Enter"],$s="Select",[qu,gp,BO]=Ru($s),[$l,i5]=Ln($s,[BO,Js]),vp=Js(),[PO,ul]=$l($s),[HO,qO]=$l($s);function Vw(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:E,internal_do_not_use_render:j}=n,C=vp(a),[R,D]=h.useState(null),[A,M]=h.useState(null),[O,N]=h.useState(!1),k=vi(v),[U,V]=Ia({prop:o,defaultProp:c??!1,onChange:u,caller:$s}),[te,$]=Ia({prop:f,defaultProp:p,onChange:g,caller:$s}),H=h.useRef(null),I=h.useRef(te);h.useEffect(()=>{const P=E?R==null?void 0:R.ownerDocument.getElementById(E):R==null?void 0:R.form;if(P instanceof HTMLFormElement){const Z=mt(()=>$(I.current),"reset");return P.addEventListener("reset",Z),()=>P.removeEventListener("reset",Z)}},[E,R,$]);const Q=R?!!E||!!R.closest("form"):!0,[de,_]=h.useState(new Set),q=Ea(),ee=Array.from(de).map(P=>P.props.value).join(";"),W=h.useCallback(P=>{_(Z=>new Set(Z).add(P))},[]),ne=h.useCallback(P=>{_(Z=>{const se=new Set(Z);return se.delete(P),se})},[]),z={required:w,trigger:R,onTriggerChange:D,valueNode:A,onValueNodeChange:M,valueNodeHasChildren:O,onValueNodeHasChildrenChange:N,contentId:q,value:te,onValueChange:$,open:U,onOpenChange:V,dir:k,triggerPointerDownPosRef:H,disabled:b,name:x,autoComplete:y,form:E,nativeOptions:de,nativeSelectKey:ee,isFormControl:Q};return s.jsx(Fm,{...C,children:s.jsx(PO,{scope:a,...z,children:s.jsx(qu.Provider,{scope:a,children:s.jsx(HO,{scope:a,onNativeOptionAdd:W,onNativeOptionRemove:ne,children:Qw(j)?j(z):l})})})})}mt(Vw,"SelectProvider");var $O=mt(n=>{const{__scopeSelect:a,children:l,...o}=n;return s.jsx(Vw,{__scopeSelect:a,...o,internal_do_not_use_render:({isFormControl:c})=>s.jsxs(s.Fragment,{children:[l,c?s.jsx(d3,{__scopeSelect:a}):null]})})},"Select"),VO="SelectTrigger",Yw=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,disabled:c=!1,...u}=a,f=vp(o),p=ul(VO,o),g=p.disabled||c,v=Ge(l,p.onTriggerChange),x=gp(o),y=h.useRef("touch"),[b,w,E]=xp(C=>{const R=x().filter(M=>!M.disabled),D=R.find(M=>M.value===p.value),A=yp(R,C,D);A!==void 0&&p.onValueChange(A.value)}),j=mt(C=>{g||(p.onOpenChange(!0),E()),C&&(p.triggerPointerDownPosRef.current={x:Math.round(C.pageX),y:Math.round(C.pageY)})},"handleOpen");return s.jsx(Qm,{asChild:!0,...f,children:s.jsx(Pe.button,{type:"button",role:"combobox","aria-controls":p.open?p.contentId:void 0,"aria-expanded":p.open,"aria-required":p.required,"aria-autocomplete":"none",dir:p.dir,"data-state":p.open?"open":"closed",disabled:g,"data-disabled":g?"":void 0,"data-placeholder":wi(p.value)?"":void 0,...u,ref:v,onClick:je(u.onClick,C=>{C.currentTarget.focus(),y.current!=="mouse"&&j(C)}),onPointerDown:je(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"&&(j(C),C.preventDefault())}),onKeyDown:je(u.onKeyDown,C=>{const R=b.current!=="";!(C.ctrlKey||C.altKey||C.metaKey)&&C.key.length===1&&w(C.key),!(R&&C.key===" ")&&UO.includes(C.key)&&(j(),C.preventDefault())})})})},"SelectTrigger")),YO="SelectValue",GO=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,className:c,style:u,children:f,placeholder:p="",...g}=a,v=ul(YO,o),{onValueNodeHasChildrenChange:x}=v,y=f!==void 0,b=Ge(l,v.onValueNodeChange);Xt(()=>{x(y)},[x,y]);const w=wi(v.value);return s.jsx(Pe.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")),KO=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,children:c,...u}=a;return s.jsx(Pe.span,{"aria-hidden":!0,...u,ref:l,children:c||"▼"})},"SelectIcon")),XO="SelectPortal",[FO,QO]=$l(XO,{forceMount:void 0}),ZO=mt(n=>{const{__scopeSelect:a,forceMount:l,...o}=n;return s.jsx(FO,{scope:n.__scopeSelect,forceMount:l,children:s.jsx(Jm,{asChild:!0,...o})})},"SelectPortal"),Ul="SelectContent",Gw=h.forwardRef(mt(function(a,l){const o=QO(Ul,a.__scopeSelect),{forceMount:c=o.forceMount,...u}=a,f=ul(Ul,a.__scopeSelect),[p,g]=h.useState();return Xt(()=>{g(new DocumentFragment)},[]),s.jsx(Cr,{present:c||f.open,children:({present:v})=>v?s.jsx(e3,{...u,ref:l}):s.jsx(JO,{...u,fragment:p})})},"SelectContent")),JO=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,children:c,fragment:u}=a;return u?ja.createPortal(s.jsx(Kw,{scope:o,children:s.jsx(qu.Slot,{scope:o,children:s.jsx("div",{ref:l,children:c})})}),u):null},"SelectContentFragment")),Sa=10,[Kw,$u]=$l(Ul),WO=Ua("SelectContent.RemoveScroll"),e3=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:E,sticky:j,hideWhenDetached:C,avoidCollisions:R,...D}=a,A=ul(Ul,o),[M,O]=h.useState(null),[N,k]=h.useState(null),U=Ge(l,O),[V,te]=h.useState(null),[$,H]=h.useState(null),I=gp(o),[Q,de]=h.useState(!1),_=h.useRef(!1);h.useEffect(()=>{if(M)return tp(M)},[M]),xi();const q=h.useCallback(ie=>{const[he,...pe]=I().map(Oe=>Oe.ref.current),[Ae]=pe.slice(-1),Ce=document.activeElement;for(const Oe of ie)if(Oe===Ce||(Oe==null||Oe.scrollIntoView({block:"nearest"}),Oe===he&&N&&(N.scrollTop=0),Oe===Ae&&N&&(N.scrollTop=N.scrollHeight),Oe==null||Oe.focus(),document.activeElement!==Ce))return},[I,N]),ee=h.useCallback(()=>q([V,M]),[q,V,M]);h.useEffect(()=>{Q&&ee()},[Q,ee]);const{onOpenChange:W,triggerPointerDownPosRef:ne}=A;h.useEffect(()=>{if(M){let ie={x:0,y:0};const he=mt(Ae=>{var Ce,Oe;ie={x:Math.abs(Math.round(Ae.pageX)-(((Ce=ne.current)==null?void 0:Ce.x)??0)),y:Math.abs(Math.round(Ae.pageY)-(((Oe=ne.current)==null?void 0:Oe.y)??0))}},"handlePointerMove"),pe=mt(Ae=>{ie.x<=10&&ie.y<=10?Ae.preventDefault():Ae.composedPath().includes(M)||W(!1),document.removeEventListener("pointermove",he),ne.current=null},"handlePointerUp");return ne.current!==null&&(document.addEventListener("pointermove",he),document.addEventListener("pointerup",pe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",he),document.removeEventListener("pointerup",pe,{capture:!0})}}},[M,W,ne]),h.useEffect(()=>{const ie=mt(()=>W(!1),"close");return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[W]);const[z,P]=xp(ie=>{const he=I().filter(Ce=>!Ce.disabled),pe=he.find(Ce=>Ce.ref.current===document.activeElement),Ae=yp(he,ie,pe);Ae&&setTimeout(()=>{var Ce;return(Ce=Ae.ref.current)==null?void 0:Ce.focus()})}),Z=h.useCallback((ie,he,pe)=>{const Ae=!_.current&&!pe;(A.value!==void 0&&A.value===he||Ae)&&(te(ie),Ae&&(_.current=!0))},[A.value]),se=h.useCallback(()=>M==null?void 0:M.focus(),[M]),ge=h.useCallback((ie,he,pe)=>{const Ae=!_.current&&!pe;(A.value!==void 0&&A.value===he||Ae)&&H(ie)},[A.value]),ye=c==="popper"?Ab:t3,G=ye===Ab?{side:g,sideOffset:v,align:x,alignOffset:y,arrowPadding:b,collisionBoundary:w,collisionPadding:E,sticky:j,hideWhenDetached:C,avoidCollisions:R}:{};return s.jsx(Kw,{scope:o,content:M,viewport:N,onViewportChange:k,itemRefCallback:Z,selectedItem:V,onItemLeave:se,itemTextRefCallback:ge,focusSelectedItem:ee,selectedItemText:$,position:c,isPositioned:Q,searchRef:z,children:s.jsx(Bu,{as:WO,allowPinchZoom:!0,children:s.jsx(Hm,{asChild:!0,trapped:A.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:je(u,ie=>{var he;(he=A.trigger)==null||he.focus({preventScroll:!0}),ie.preventDefault()}),children:s.jsx(Tu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>A.onOpenChange(!1),children:s.jsx(ye,{role:"listbox",id:A.contentId,"data-state":A.open?"open":"closed",dir:A.dir,onContextMenu:ie=>ie.preventDefault(),...D,...G,onPlaced:()=>de(!0),ref:U,style:{display:"flex",flexDirection:"column",outline:"none",...D.style},onKeyDown:je(D.onKeyDown,ie=>{const he=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),!he&&ie.key.length===1&&P(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let Ae=I().filter(Ce=>!Ce.disabled).map(Ce=>Ce.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(Ae=Ae.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const Ce=ie.target,Oe=Ae.indexOf(Ce);Ae=Ae.slice(Oe+1)}setTimeout(()=>q(Ae)),ie.preventDefault()}})})})})})})},"SelectContentImpl")),t3=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,onPlaced:c,...u}=a,f=ul(Ul,o),p=$u(Ul,o),[g,v]=h.useState(null),[x,y]=h.useState(null),b=Ge(l,y),w=gp(o),E=h.useRef(!1),j=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(),V=x.getBoundingClientRect(),te=f.valueNode.getBoundingClientRect(),$=D.getBoundingClientRect();if(f.dir!=="rtl"){const Ce=$.left-V.left,Oe=te.left-Ce,Qe=U.left-Oe,We=U.width+Qe,oe=Math.max(We,V.width),Le=window.innerWidth-Sa,He=rm(Oe,[Sa,Math.max(Sa,Le-oe)]);g.style.minWidth=We+"px",g.style.left=He+"px"}else{const Ce=V.right-$.right,Oe=window.innerWidth-te.right-Ce,Qe=window.innerWidth-U.right-Oe,We=U.width+Qe,oe=Math.max(We,V.width),Le=window.innerWidth-Sa,He=rm(Oe,[Sa,Math.max(Sa,Le-oe)]);g.style.minWidth=We+"px",g.style.right=He+"px"}const H=w(),I=window.innerHeight-Sa*2,Q=C.scrollHeight,de=window.getComputedStyle(x),_=parseInt(de.borderTopWidth,10),q=parseInt(de.paddingTop,10),ee=parseInt(de.borderBottomWidth,10),W=parseInt(de.paddingBottom,10),ne=_+q+Q+W+ee,z=Math.min(R.offsetHeight*5,ne),P=window.getComputedStyle(C),Z=parseInt(P.paddingTop,10),se=parseInt(P.paddingBottom,10),ge=U.top+U.height/2-Sa,ye=I-ge,G=R.offsetHeight/2,ie=R.offsetTop+G,he=_+q+ie,pe=ne-he;if(he<=ge){const Ce=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+(Ce?se:0)+Oe+ee),We=he+Qe;g.style.height=We+"px"}else{const Ce=H.length>0&&R===H[0].ref.current;g.style.top="0px";const Qe=Math.max(ge,_+C.offsetTop+(Ce?Z:0)+G)+pe;g.style.height=Qe+"px",C.scrollTop=he-ge+C.offsetTop}g.style.margin=`${Sa}px 0`,g.style.minHeight=z+"px",g.style.maxHeight=I+"px",c==null||c(),requestAnimationFrame(()=>E.current=!0)}},[w,f.trigger,f.valueNode,g,x,C,R,D,f.dir,c]);Xt(()=>M(),[M]);const[O,N]=h.useState();Xt(()=>{x&&N(window.getComputedStyle(x).zIndex)},[x]);const k=h.useCallback(U=>{U&&j.current===!0&&(M(),A==null||A(),j.current=!1)},[M,A]);return s.jsx(n3,{scope:o,contentWrapper:g,shouldExpandOnScrollRef:E,onScrollButtonChange:k,children:s.jsx("div",{ref:v,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:O},children:s.jsx(Pe.div,{...u,ref:b,style:{boxSizing:"border-box",maxHeight:"100%",...u.style}})})})},"SelectItemAlignedPosition")),Ab=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,align:c="start",collisionPadding:u=Sa,...f}=a,p=vp(o);return s.jsx(Zm,{...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")),[n3,a3]=$l(Ul,{}),Mb="SelectViewport",r3=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,nonce:c,...u}=a,f=$u(Mb,o),p=a3(Mb,o),g=Ge(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(qu.Slot,{scope:o,children:s.jsx(Pe.div,{"data-radix-select-viewport":"",role:"presentation",...u,ref:g,style:{position:"relative",flex:1,overflow:"hidden auto",...u.style},onScroll:je(u.onScroll,x=>{const y=x.currentTarget,{contentWrapper:b,shouldExpandOnScrollRef:w}=p;if(w!=null&&w.current&&b){const E=Math.abs(v.current-y.scrollTop);if(E>0){const j=window.innerHeight-Sa*2,C=parseFloat(b.style.minHeight),R=parseFloat(b.style.height),D=Math.max(C,R);if(D<j){const A=D+E,M=Math.min(j,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")),l3="SelectGroup",[c5,u5]=$l(l3),lm="SelectItem",[s3,Xw]=$l(lm),Fw=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,value:c,disabled:u=!1,textValue:f,...p}=a,g=ul(lm,o),v=$u(lm,o),x=g.value===c,[y,b]=h.useState(f??""),[w,E]=h.useState(!1),j=ma(M=>{var O;return(O=v.itemRefCallback)==null?void 0:O.call(v,M,c,u)}),C=Ge(l,j),R=Ea(),D=h.useRef("touch"),A=mt(()=>{u||(g.onValueChange(c),g.onOpenChange(!1))},"handleSelect");return s.jsx(s3,{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(qu.ItemSlot,{scope:o,value:c,disabled:u,textValue:y,children:s.jsx(Pe.div,{role:"option","aria-labelledby":R,"data-highlighted":w?"":void 0,"aria-selected":x&&w,"data-state":x?"checked":"unchecked","aria-disabled":u||void 0,"data-disabled":u?"":void 0,tabIndex:u?void 0:-1,...p,ref:C,onFocus:je(p.onFocus,()=>E(!0)),onBlur:je(p.onBlur,()=>E(!1)),onClick:je(p.onClick,()=>{D.current!=="mouse"&&A()}),onPointerUp:je(p.onPointerUp,()=>{D.current==="mouse"&&A()}),onPointerDown:je(p.onPointerDown,M=>{D.current=M.pointerType}),onPointerMove:je(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:je(p.onPointerLeave,M=>{var O;M.currentTarget===document.activeElement&&((O=v.onItemLeave)==null||O.call(v))}),onKeyDown:je(p.onKeyDown,M=>{var N;u||M.target!==M.currentTarget||((N=v.searchRef)==null?void 0:N.current)!==""&&M.key===" "||(IO.includes(M.key)&&A(),M.key===" "&&M.preventDefault())})})})})},"SelectItem")),Gc="SelectItemText",o3=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,className:c,style:u,...f}=a,p=ul(Gc,o),g=$u(Gc,o),v=Xw(Gc,o),x=qO(Gc,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)}),E=Ge(l,b,v.onItemTextChange,w),j=y==null?void 0:y.textContent,C=h.useMemo(()=>s.jsx("option",{value:v.value,disabled:v.disabled,children:j},v.value),[v.disabled,v.value,j]),{onNativeOptionAdd:R,onNativeOptionRemove:D}=x;return Xt(()=>(R(C),()=>D(C)),[R,D,C]),s.jsxs(s.Fragment,{children:[s.jsx(Pe.span,{id:v.textId,...f,ref:E}),v.isSelected&&p.valueNode&&!p.valueNodeHasChildren&&!wi(p.value)?ja.createPortal(f.children,p.valueNode):null]})},"SelectItemText")),i3="SelectItemIndicator",c3=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,...c}=a;return Xw(i3,o).isSelected?s.jsx(Pe.span,{"aria-hidden":!0,...c,ref:l}):null},"SelectItemIndicator")),u3="SelectBubbleInput",d3=h.forwardRef(mt(function({__scopeSelect:a,...l},o){const c=ul(u3,a),{value:u,onValueChange:f,required:p,disabled:g,name:v,autoComplete:x,form:y}=c,{nativeOptions:b,nativeSelectKey:w}=c,E=h.useRef(null),j=Ge(o,E),C=u??"",R=qw(C),D=Array.from(b).some(A=>(A.props.value??"")==="");return h.useEffect(()=>{const A=E.current;if(!A)return;const M=window.HTMLSelectElement.prototype,N=Object.getOwnPropertyDescriptor(M,"value").set;if(R!==C&&N){const k=new Event("change",{bubbles:!0});N.call(A,C),A.dispatchEvent(k)}},[R,C]),s.jsxs(Pe.select,{"aria-hidden":!0,required:p,tabIndex:-1,name:v,autoComplete:x,disabled:g,form:y,onChange:A=>f(A.target.value),...l,style:{...$w,...l.style},ref:j,defaultValue:C,children:[wi(u)&&!D?s.jsx("option",{value:""}):null,Array.from(b)]},w)},"SelectBubbleInput"));function Qw(n){return typeof n=="function"}mt(Qw,"isFunction");function wi(n){return n===""||n===void 0}mt(wi,"shouldShowPlaceholder");function xp(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(xp,"useTypeaheadSearch");function yp(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=Zw(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(yp,"findNextItem");function Zw(n,a){return n.map((l,o)=>n[(a+o)%n.length])}mt(Zw,"wrapArray");const Gn=$O,Kn=GO,kn=h.forwardRef(({className:n,children:a,...l},o)=>s.jsxs(Yw,{ref:o,className:Ne("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(KO,{asChild:!0,children:s.jsx(R0,{className:"h-4 w-4 opacity-50"})})]}));kn.displayName=Yw.displayName;const _n=h.forwardRef(({className:n,children:a,position:l="popper",...o},c)=>s.jsx(ZO,{children:s.jsx(Gw,{ref:c,className:Ne("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(r3,{className:Ne("p-1",l==="popper"&&"w-full min-w-[var(--radix-select-trigger-width)]"),children:a})})}));_n.displayName=Gw.displayName;const tt=h.forwardRef(({className:n,children:a,...l},o)=>s.jsxs(Fw,{ref:o,className:Ne("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(c3,{children:s.jsx(Dm,{className:"h-4 w-4"})})}),s.jsx(o3,{children:a})]}));tt.displayName=Fw.displayName;var f3=Object.defineProperty,il=(n,a)=>f3(n,"name",{value:a,configurable:!0}),bp="Switch",[h3,d5]=Ln(bp),[m3,wp]=h3(bp);function Jw(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:bp}),[E,j]=h.useState(null),[C,R]=h.useState(null),D=h.useRef(!1),[A,M]=h.useReducer(k=>k+1,0),O=E?!!f||!!E.closest("form"):!0,N={checked:b,setChecked:w,disabled:u,control:E,setControl:j,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(m3,{scope:a,...N,children:eS(y)?y(N):o})}il(Jw,"SwitchProvider");var p3="SwitchTrigger",g3=h.forwardRef(il(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:E,isFormControl:j,bubbleInput:C}=wp(p3,a),R=Ge(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=il(()=>b(D.current),"reset");return A.addEventListener("reset",M),()=>A.removeEventListener("reset",M)}},[u,f,b]),s.jsx(Pe.button,{type:"button",role:"switch","aria-checked":v,"aria-required":x,"data-state":Sp(v),"data-disabled":g?"":void 0,disabled:g,value:p,...o,ref:R,onClick:je(l,A=>{E(),b(M=>!M),C&&j&&(w.current=A.isPropagationStopped(),w.current||A.stopPropagation())})})},"SwitchTrigger")),Ww=h.forwardRef(il(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(Jw,{__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(g3,{...b,ref:l,__scopeSwitch:o}),w&&s.jsx(b3,{__scopeSwitch:o})]})})},"Switch")),v3="SwitchThumb",x3=h.forwardRef(il(function(a,l){const{__scopeSwitch:o,...c}=a,u=wp(v3,o);return s.jsx(Pe.span,{"data-state":Sp(u.checked),"data-disabled":u.disabled?"":void 0,...c,ref:l})},"SwitchThumb")),y3="SwitchBubbleInput",b3=h.forwardRef(il(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:E,bubbleInput:j,setBubbleInput:C}=wp(y3,a),R=Ge(c,C),D=_u(u),A=h.useRef(!1),M=h.useRef(g),O=h.useRef(p);h.useEffect(()=>{const k=j;if(!k)return;const U=window.HTMLInputElement.prototype,te=Object.getOwnPropertyDescriptor(U,"checked").set,$=p!==O.current;O.current=p;const H=M.current!==g;M.current=g;const I=!($&&f.current);if(H&&te){A.current=!$;const Q=new Event("click",{bubbles:I});te.call(k,g),k.dispatchEvent(Q),A.current=!1}},[j,g,f,p]);const N=h.useRef(g);return s.jsx(Pe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:v??N.current,required:x,disabled:y,name:b,value:w,form:E,...o,tabIndex:-1,ref:R,onClick:je(l,k=>{A.current&&k.stopPropagation()}),style:{...o.style,...D,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function eS(n){return typeof n=="function"}il(eS,"isFunction");function Sp(n){return n?"checked":"unchecked"}il(Sp,"getState");const Ha=h.forwardRef(({className:n,...a},l)=>s.jsx(Ww,{className:Ne("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(x3,{className:Ne("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=Ww.displayName;function w3(){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 Vu=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ws(n){const a=Object.prototype.toString.call(n);return a==="[object Window]"||a==="[object global]"}function jp(n){return"nodeType"in n}function Un(n){var a,l;return n?Ws(n)?n:jp(n)&&(a=(l=n.ownerDocument)==null?void 0:l.defaultView)!=null?a:window:window}function Cp(n){const{Document:a}=Un(n);return n instanceof a}function Si(n){return Ws(n)?!1:n instanceof Un(n).HTMLElement}function tS(n){return n instanceof Un(n).SVGElement}function eo(n){return n?Ws(n)?n.document:jp(n)?Cp(n)?n:Si(n)||tS(n)?n.ownerDocument:document:document:document}const qa=Vu?h.useLayoutEffect:h.useEffect;function Ep(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 S3(){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 si(n,a){a===void 0&&(a=[n]);const l=h.useRef(n);return qa(()=>{l.current!==n&&(l.current=n)},a),l}function ji(n,a){const l=h.useRef();return h.useMemo(()=>{const o=n(l.current);return l.current=o,o},[...a])}function mu(n){const a=Ep(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 sm(n){const a=h.useRef();return h.useEffect(()=>{a.current=n},[n]),a.current}let Ah={};function Ci(n,a){return h.useMemo(()=>{if(a)return a;const l=Ah[n]==null?0:Ah[n]+1;return Ah[n]=l,n+"-"+l},[n,a])}function nS(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 qs=nS(1),oi=nS(-1);function j3(n){return"clientX"in n&&"clientY"in n}function Np(n){if(!n)return!1;const{KeyboardEvent:a}=Un(n.target);return a&&n instanceof a}function C3(n){if(!n)return!1;const{TouchEvent:a}=Un(n.target);return a&&n instanceof a}function om(n){if(C3(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 j3(n)?{x:n.clientX,y:n.clientY}:null}const pu=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[pu.Translate.toString(n),pu.Scale.toString(n)].join(" ")}},Transition:{toString(n){let{property:a,duration:l,easing:o}=n;return a+" "+l+"ms "+o}}}),Db="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function E3(n){return n.matches(Db)?n:n.querySelector(Db)}const N3={display:"none"};function R3(n){let{id:a,value:l}=n;return ue.createElement("div",{id:a,style:N3},l)}function T3(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 ue.createElement("div",{id:a,style:c,role:"status","aria-live":o,"aria-atomic":!0},l)}function A3(){const[n,a]=h.useState("");return{announce:h.useCallback(o=>{o!=null&&a(o)},[]),announcement:n}}const aS=h.createContext(null);function M3(n){const a=h.useContext(aS);h.useEffect(()=>{if(!a)throw new Error("useDndMonitor must be used within a children of <DndContext>");return a(n)},[n,a])}function D3(){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 O3={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
+ `},k3={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 _3(n){let{announcements:a=k3,container:l,hiddenTextDescribedById:o,screenReaderInstructions:c=O3}=n;const{announce:u,announcement:f}=A3(),p=Ci("DndLiveRegion"),[g,v]=h.useState(!1);if(h.useEffect(()=>{v(!0)},[]),M3(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=ue.createElement(ue.Fragment,null,ue.createElement(R3,{id:o,value:c.draggable}),ue.createElement(T3,{id:p,announcement:f}));return l?ja.createPortal(x,l):x}var Gt;(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"})(Gt||(Gt={}));function gu(){}function Ob(n,a){return h.useMemo(()=>({sensor:n,options:a??{}}),[n,a])}function z3(){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 Na=Object.freeze({x:0,y:0});function rS(n,a){return Math.sqrt(Math.pow(n.x-a.x,2)+Math.pow(n.y-a.y,2))}function lS(n,a){let{data:{value:l}}=n,{data:{value:o}}=a;return l-o}function L3(n,a){let{data:{value:l}}=n,{data:{value:o}}=a;return o-l}function kb(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 sS(n,a){if(!n||n.length===0)return null;const[l]=n;return l[a]}function _b(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 U3=n=>{let{collisionRect:a,droppableRects:l,droppableContainers:o}=n;const c=_b(a,a.left,a.top),u=[];for(const f of o){const{id:p}=f,g=l.get(p);if(g){const v=rS(_b(g),c);u.push({id:p,data:{droppableContainer:f,value:v}})}}return u.sort(lS)},I3=n=>{let{collisionRect:a,droppableRects:l,droppableContainers:o}=n;const c=kb(a),u=[];for(const f of o){const{id:p}=f,g=l.get(p);if(g){const v=kb(g),x=c.reduce((b,w,E)=>b+rS(v[E],w),0),y=Number((x/4).toFixed(4));u.push({id:p,data:{droppableContainer:f,value:y}})}}return u.sort(lS)};function B3(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 P3=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=B3(p,a);g>0&&c.push({id:f,data:{droppableContainer:u,value:g}})}}return c.sort(L3)};function H3(n,a,l){return{...n,scaleX:a&&l?a.width/l.width:1,scaleY:a&&l?a.height/l.height:1}}function oS(n,a){return n&&a?{x:n.left-a.left,y:n.top-a.top}:Na}function q3(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 $3=q3(1);function V3(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 Y3(n,a,l){const o=V3(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 G3={ignoreTransform:!1};function to(n,a){a===void 0&&(a=G3);let l=n.getBoundingClientRect();if(a.ignoreTransform){const{transform:v,transformOrigin:x}=Un(n).getComputedStyle(n);v&&(l=Y3(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 zb(n){return to(n,{ignoreTransform:!0})}function K3(n){const a=n.innerWidth,l=n.innerHeight;return{top:0,left:0,right:a,bottom:l,width:a,height:l}}function X3(n,a){return a===void 0&&(a=Un(n).getComputedStyle(n)),a.position==="fixed"}function F3(n,a){a===void 0&&(a=Un(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 Yu(n,a){const l=[];function o(c){if(a!=null&&l.length>=a||!c)return l;if(Cp(c)&&c.scrollingElement!=null&&!l.includes(c.scrollingElement))return l.push(c.scrollingElement),l;if(!Si(c)||tS(c)||l.includes(c))return l;const u=Un(n).getComputedStyle(c);return c!==n&&F3(c,u)&&l.push(c),X3(c,u)?l:o(c.parentNode)}return n?o(n):l}function iS(n){const[a]=Yu(n,1);return a??null}function Mh(n){return!Vu||!n?null:Ws(n)?n:jp(n)?Cp(n)||n===eo(n).scrollingElement?window:Si(n)?n:null:null}function cS(n){return Ws(n)?n.scrollX:n.scrollLeft}function uS(n){return Ws(n)?n.scrollY:n.scrollTop}function im(n){return{x:cS(n),y:uS(n)}}var Wt;(function(n){n[n.Forward=1]="Forward",n[n.Backward=-1]="Backward"})(Wt||(Wt={}));function dS(n){return!Vu||!n?!1:n===document.scrollingElement}function fS(n){const a={x:0,y:0},l=dS(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 Q3={x:.2,y:.2};function Z3(n,a,l,o,c){let{top:u,left:f,right:p,bottom:g}=l;o===void 0&&(o=10),c===void 0&&(c=Q3);const{isTop:v,isBottom:x,isLeft:y,isRight:b}=fS(n),w={x:0,y:0},E={x:0,y:0},j={height:a.height*c.y,width:a.width*c.x};return!v&&u<=a.top+j.height?(w.y=Wt.Backward,E.y=o*Math.abs((a.top+j.height-u)/j.height)):!x&&g>=a.bottom-j.height&&(w.y=Wt.Forward,E.y=o*Math.abs((a.bottom-j.height-g)/j.height)),!b&&p>=a.right-j.width?(w.x=Wt.Forward,E.x=o*Math.abs((a.right-j.width-p)/j.width)):!y&&f<=a.left+j.width&&(w.x=Wt.Backward,E.x=o*Math.abs((a.left+j.width-f)/j.width)),{direction:w,speed:E}}function J3(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 hS(n){return n.reduce((a,l)=>qs(a,im(l)),Na)}function W3(n){return n.reduce((a,l)=>a+cS(l),0)}function ek(n){return n.reduce((a,l)=>a+uS(l),0)}function tk(n,a){if(a===void 0&&(a=to),!n)return;const{top:l,left:o,bottom:c,right:u}=a(n);iS(n)&&(c<=0||u<=0||l>=window.innerHeight||o>=window.innerWidth)&&n.scrollIntoView({block:"center",inline:"center"})}const nk=[["x",["left","right"],W3],["y",["top","bottom"],ek]];class Rp{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=Yu(l),c=hS(o);this.rect={...a},this.width=a.width,this.height=a.height;for(const[u,f,p]of nk)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 Wo{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 ak(n){const{EventTarget:a}=Un(n);return n instanceof a?n:eo(n)}function Dh(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 Lb(n){n.preventDefault()}function rk(n){n.stopPropagation()}var Xe;(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"})(Xe||(Xe={}));const mS={start:[Xe.Space,Xe.Enter],cancel:[Xe.Esc],end:[Xe.Space,Xe.Enter,Xe.Tab]},lk=(n,a)=>{let{currentCoordinates:l}=a;switch(n.code){case Xe.Right:return{...l,x:l.x+25};case Xe.Left:return{...l,x:l.x-25};case Xe.Down:return{...l,y:l.y+25};case Xe.Up:return{...l,y:l.y-25}}};class Tp{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 Wo(eo(l)),this.windowListeners=new Wo(Un(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&&tk(o),l(Na)}handleKeyDown(a){if(Np(a)){const{active:l,context:o,options:c}=this.props,{keyboardCodes:u=mS,coordinateGetter:f=lk,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}:Na;this.referenceCoordinates||(this.referenceCoordinates=x);const y=f(a,{active:l,context:o.current,currentCoordinates:x});if(y){const b=oi(y,x),w={x:0,y:0},{scrollableAncestors:E}=o.current;for(const j of E){const C=a.code,{isTop:R,isRight:D,isLeft:A,isBottom:M,maxScroll:O,minScroll:N}=fS(j),k=J3(j),U={x:Math.min(C===Xe.Right?k.right-k.width/2:k.right,Math.max(C===Xe.Right?k.left:k.left+k.width/2,y.x)),y:Math.min(C===Xe.Down?k.bottom-k.height/2:k.bottom,Math.max(C===Xe.Down?k.top:k.top+k.height/2,y.y))},V=C===Xe.Right&&!D||C===Xe.Left&&!A,te=C===Xe.Down&&!M||C===Xe.Up&&!R;if(V&&U.x!==y.x){const $=j.scrollLeft+b.x,H=C===Xe.Right&&$<=O.x||C===Xe.Left&&$>=N.x;if(H&&!b.y){j.scrollTo({left:$,behavior:p});return}H?w.x=j.scrollLeft-$:w.x=C===Xe.Right?j.scrollLeft-O.x:j.scrollLeft-N.x,w.x&&j.scrollBy({left:-w.x,behavior:p});break}else if(te&&U.y!==y.y){const $=j.scrollTop+b.y,H=C===Xe.Down&&$<=O.y||C===Xe.Up&&$>=N.y;if(H&&!b.x){j.scrollTo({top:$,behavior:p});return}H?w.y=j.scrollTop-$:w.y=C===Xe.Down?j.scrollTop-O.y:j.scrollTop-N.y,w.y&&j.scrollBy({top:-w.y,behavior:p});break}}this.handleMove(a,qs(oi(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()}}Tp.activators=[{eventName:"onKeyDown",handler:(n,a,l)=>{let{keyboardCodes:o=mS,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 Ub(n){return!!(n&&"distance"in n)}function Ib(n){return!!(n&&"delay"in n)}class Ap{constructor(a,l,o){var c;o===void 0&&(o=ak(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=eo(f),this.documentListeners=new Wo(this.document),this.listeners=new Wo(o),this.windowListeners=new Wo(Un(f)),this.initialCoordinates=(c=om(u))!=null?c:Na,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,Lb),this.windowListeners.add(da.VisibilityChange,this.handleCancel),this.windowListeners.add(da.ContextMenu,Lb),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(Ib(l)){this.timeoutId=setTimeout(this.handleStart,l.delay),this.handlePending(l);return}if(Ub(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,rk,{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=om(a))!=null?l:Na,v=oi(c,g);if(!o&&p){if(Ub(p)){if(p.tolerance!=null&&Dh(v,p.tolerance))return this.handleCancel();if(Dh(v,p.distance))return this.handleStart()}if(Ib(p)&&Dh(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===Xe.Esc&&this.handleCancel()}removeTextSelection(){var a;(a=this.document.getSelection())==null||a.removeAllRanges()}}const sk={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Mp extends Ap{constructor(a){const{event:l}=a,o=eo(l.target);super(a,sk,o)}}Mp.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 ok={move:{name:"mousemove"},end:{name:"mouseup"}};var cm;(function(n){n[n.RightClick=2]="RightClick"})(cm||(cm={}));class ik extends Ap{constructor(a){super(a,ok,eo(a.event.target))}}ik.activators=[{eventName:"onMouseDown",handler:(n,a)=>{let{nativeEvent:l}=n,{onActivation:o}=a;return l.button===cm.RightClick?!1:(o==null||o({event:l}),!0)}}];const Oh={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class ck extends Ap{constructor(a){super(a,Oh)}static setup(){return window.addEventListener(Oh.move.name,a,{capture:!1,passive:!1}),function(){window.removeEventListener(Oh.move.name,a)};function a(){}}}ck.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 ei;(function(n){n[n.Pointer=0]="Pointer",n[n.DraggableRect=1]="DraggableRect"})(ei||(ei={}));var vu;(function(n){n[n.TreeOrder=0]="TreeOrder",n[n.ReversedTreeOrder=1]="ReversedTreeOrder"})(vu||(vu={}));function uk(n){let{acceleration:a,activator:l=ei.Pointer,canScroll:o,draggingRect:c,enabled:u,interval:f=5,order:p=vu.TreeOrder,pointerCoordinates:g,scrollableAncestors:v,scrollableAncestorRects:x,delta:y,threshold:b}=n;const w=fk({delta:y,disabled:!u}),[E,j]=S3(),C=h.useRef({x:0,y:0}),R=h.useRef({x:0,y:0}),D=h.useMemo(()=>{switch(l){case ei.Pointer:return g?{top:g.y,bottom:g.y,left:g.x,right:g.x}:null;case ei.DraggableRect:return c}},[l,c,g]),A=h.useRef(null),M=h.useCallback(()=>{const N=A.current;if(!N)return;const k=C.current.x*R.current.x,U=C.current.y*R.current.y;N.scrollBy(k,U)},[]),O=h.useMemo(()=>p===vu.TreeOrder?[...v].reverse():v,[p,v]);h.useEffect(()=>{if(!u||!v.length||!D){j();return}for(const N of O){if((o==null?void 0:o(N))===!1)continue;const k=v.indexOf(N),U=x[k];if(!U)continue;const{direction:V,speed:te}=Z3(N,U,D,a,b);for(const $ of["x","y"])w[$][V[$]]||(te[$]=0,V[$]=0);if(te.x>0||te.y>0){j(),A.current=N,E(M,f),C.current=te,R.current=V;return}}C.current={x:0,y:0},R.current={x:0,y:0},j()},[a,M,o,j,u,f,JSON.stringify(D),JSON.stringify(w),E,v,O,x,JSON.stringify(b)])}const dk={x:{[Wt.Backward]:!1,[Wt.Forward]:!1},y:{[Wt.Backward]:!1,[Wt.Forward]:!1}};function fk(n){let{delta:a,disabled:l}=n;const o=sm(a);return ji(c=>{if(l||!o||!c)return dk;const u={x:Math.sign(a.x-o.x),y:Math.sign(a.y-o.y)};return{x:{[Wt.Backward]:c.x[Wt.Backward]||u.x===-1,[Wt.Forward]:c.x[Wt.Forward]||u.x===1},y:{[Wt.Backward]:c.y[Wt.Backward]||u.y===-1,[Wt.Forward]:c.y[Wt.Forward]||u.y===1}}},[l,a,o])}function hk(n,a){const l=a!=null?n.get(a):void 0,o=l?l.node.current:null;return ji(c=>{var u;return a==null?null:(u=o??c)!=null?u:null},[o,a])}function mk(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 ii;(function(n){n[n.Always=0]="Always",n[n.BeforeDragging=1]="BeforeDragging",n[n.WhileDragging=2]="WhileDragging"})(ii||(ii={}));var um;(function(n){n.Optimized="optimized"})(um||(um={}));const Bb=new Map;function pk(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=si(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]),E=h.useRef(null),j=ji(R=>{if(y&&!l)return Bb;if(!R||R===Bb||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 Rp(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"||E.current!==null||(E.current=setTimeout(()=>{w(),E.current=null},p))},[p,y,w,...o]),{droppableRects:j,measureDroppableContainers:w,measuringScheduled:u!=null};function C(){switch(v){case ii.Always:return!1;case ii.BeforeDragging:return l;default:return!l}}}function pS(n,a){return ji(l=>n?l||(typeof a=="function"?a(n):n):null,[a,n])}function gk(n,a){return pS(n,a)}function vk(n){let{callback:a,disabled:l}=n;const o=Ep(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 Gu(n){let{callback:a,disabled:l}=n;const o=Ep(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 xk(n){return new Rp(to(n),n)}function Pb(n,a,l){a===void 0&&(a=xk);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=vk({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=Gu({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 yk(n){const a=pS(n);return oS(n,a)}const Hb=[];function bk(n){const a=h.useRef(n),l=ji(o=>n?o&&o!==Hb&&n&&a.current&&n.parentNode===a.current.parentNode?o:Yu(n):Hb,[n]);return h.useEffect(()=>{a.current=n},[n]),l}function wk(n){const[a,l]=h.useState(null),o=h.useRef(n),c=h.useCallback(u=>{const f=Mh(u.target);f&&l(p=>p?(p.set(f,im(f)),new Map(p)):null)},[]);return h.useEffect(()=>{const u=o.current;if(n!==u){f(u);const p=n.map(g=>{const v=Mh(g);return v?(v.addEventListener("scroll",c,{passive:!0}),[v,im(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=Mh(g);v==null||v.removeEventListener("scroll",c)})}},[c,n]),h.useMemo(()=>n.length?a?Array.from(a.values()).reduce((u,f)=>qs(u,f),Na):hS(n):Na,[n,a])}function qb(n,a){a===void 0&&(a=[]);const l=h.useRef(null);return h.useEffect(()=>{l.current=null},a),h.useEffect(()=>{const o=n!==Na;o&&!l.current&&(l.current=n),!o&&l.current&&(l.current=null)},[n]),l.current?oi(n,l.current):Na}function Sk(n){h.useEffect(()=>{if(!Vu)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 jk(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 gS(n){return h.useMemo(()=>n?K3(n):null,[n])}const $b=[];function Ck(n,a){a===void 0&&(a=to);const[l]=n,o=gS(l?Un(l):null),[c,u]=h.useState($b);function f(){u(()=>n.length?n.map(g=>dS(g)?o:new Rp(a(g),g)):$b)}const p=Gu({callback:f});return qa(()=>{p==null||p.disconnect(),f(),n.forEach(g=>p==null?void 0:p.observe(g))},[n]),c}function Ek(n){if(!n)return null;if(n.children.length>1)return n;const a=n.children[0];return Si(a)?a:n}function Nk(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=Gu({callback:c}),f=h.useCallback(v=>{const x=Ek(v);u==null||u.disconnect(),x&&(u==null||u.observe(x)),o(x?a(x):null)},[a,u]),[p,g]=mu(f);return h.useMemo(()=>({nodeRef:p,rect:l,setRef:g}),[l,p,g])}const Rk=[{sensor:Mp,options:{}},{sensor:Tp,options:{}}],Tk={current:{}},su={draggable:{measure:zb},droppable:{measure:zb,strategy:ii.WhileDragging,frequency:um.Optimized},dragOverlay:{measure:to}};class ti 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 Ak={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ti,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:gu},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:su,measureDroppableContainers:gu,windowRect:null,measuringScheduled:!1},Mk={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:gu,draggableNodes:new Map,over:null,measureDroppableContainers:gu},Ku=h.createContext(Mk),vS=h.createContext(Ak);function Dk(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ti}}}function Ok(n,a){switch(a.type){case Gt.DragStart:return{...n,draggable:{...n.draggable,initialCoordinates:a.initialCoordinates,active:a.active}};case Gt.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 Gt.DragEnd:case Gt.DragCancel:return{...n,draggable:{...n.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Gt.RegisterDroppable:{const{element:l}=a,{id:o}=l,c=new ti(n.droppable.containers);return c.set(o,l),{...n,droppable:{...n.droppable,containers:c}}}case Gt.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 ti(n.droppable.containers);return f.set(l,{...u,disabled:c}),{...n,droppable:{...n.droppable,containers:f}}}case Gt.UnregisterDroppable:{const{id:l,key:o}=a,c=n.droppable.containers.get(l);if(!c||o!==c.key)return n;const u=new ti(n.droppable.containers);return u.delete(l),{...n,droppable:{...n.droppable,containers:u}}}default:return n}}function kk(n){let{disabled:a}=n;const{active:l,activatorEvent:o,draggableNodes:c}=h.useContext(Ku),u=sm(o),f=sm(l==null?void 0:l.id);return h.useEffect(()=>{if(!a&&!o&&u&&f!=null){if(!Np(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=E3(x);if(y){y.focus();break}}})}},[o,a,c,f,u]),null}function _k(n,a){let{transform:l,...o}=a;return n!=null&&n.length?n.reduce((c,u)=>u({transform:c,...o}),l):l}function zk(n){return h.useMemo(()=>({draggable:{...su.draggable,...n==null?void 0:n.draggable},droppable:{...su.droppable,...n==null?void 0:n.droppable},dragOverlay:{...su.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 Lk(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=oS(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=iS(v);b&&b.scrollBy({top:y.y,left:y.x})}},[a,f,p,o,l])}const xS=h.createContext({...Na,scaleX:1,scaleY:1});var al;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Initializing=1]="Initializing",n[n.Initialized=2]="Initialized"})(al||(al={}));const Uk=h.memo(function(a){var l,o,c,u;let{id:f,accessibility:p,autoScroll:g=!0,children:v,sensors:x=Rk,collisionDetection:y=P3,measuring:b,modifiers:w,...E}=a;const j=h.useReducer(Ok,void 0,Dk),[C,R]=j,[D,A]=D3(),[M,O]=h.useState(al.Uninitialized),N=M===al.Initialized,{draggable:{active:k,nodes:U,translate:V},droppable:{containers:te}}=C,$=k!=null?U.get(k):null,H=h.useRef({initial:null,translated:null}),I=h.useMemo(()=>{var xt;return k!=null?{id:k,data:(xt=$==null?void 0:$.data)!=null?xt:Tk,rect:H}:null},[k,$]),Q=h.useRef(null),[de,_]=h.useState(null),[q,ee]=h.useState(null),W=si(E,Object.values(E)),ne=Ci("DndDescribedBy",f),z=h.useMemo(()=>te.getEnabled(),[te]),P=zk(b),{droppableRects:Z,measureDroppableContainers:se,measuringScheduled:ge}=pk(z,{dragging:N,dependencies:[V.x,V.y],config:P.droppable}),ye=hk(U,k),G=h.useMemo(()=>q?om(q):null,[q]),ie=Rr(),he=gk(ye,P.draggable.measure);Lk({activeNode:k!=null?U.get(k):null,config:ie.layoutShiftCompensation,initialRect:he,measure:P.draggable.measure});const pe=Pb(ye,P.draggable.measure,he),Ae=Pb(ye?ye.parentElement:null),Ce=h.useRef({activatorEvent:null,active:null,activeNode:ye,collisionRect:null,collisions:null,droppableRects:Z,draggableNodes:U,draggingNode:null,draggingNodeRect:null,droppableContainers:te,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Oe=te.getNodeFor((l=Ce.current.over)==null?void 0:l.id),Qe=Nk({measure:P.dragOverlay.measure}),We=(o=Qe.nodeRef.current)!=null?o:ye,oe=N?(c=Qe.rect)!=null?c:pe:null,Le=!!(Qe.nodeRef.current&&Qe.rect),He=yk(Le?null:pe),_t=gS(We?Un(We):null),jt=bk(N?Oe??ye:null),Ft=Ck(jt),hn=_k(w,{transform:{x:V.x-He.x,y:V.y-He.y,scaleX:1,scaleY:1},activatorEvent:q,active:I,activeNodeRect:pe,containerNodeRect:Ae,draggingNodeRect:oe,over:Ce.current.over,overlayNodeRect:Qe.rect,scrollableAncestors:jt,scrollableAncestorRects:Ft,windowRect:_t}),Qt=G?qs(G,V):null,Ct=wk(jt),xn=qb(Ct),At=qb(Ct,[pe]),Mt=qs(hn,xn),mn=oe?$3(oe,hn):null,pa=I&&mn?y({active:I,collisionRect:mn,droppableRects:Z,droppableContainers:z,pointerCoordinates:Qt}):null,Aa=sS(pa,"id"),[Wn,dl]=h.useState(null),ga=Le?hn:qs(hn,At),Dt=H3(ga,(u=Wn==null?void 0:Wn.rect)!=null?u:null,pe),yn=h.useRef(null),Tt=h.useCallback((xt,at)=>{let{sensor:It,options:Ee}=at;if(Q.current==null)return;const _e=U.get(Q.current);if(!_e)return;const Ue=xt.nativeEvent,vt=new It({active:Q.current,activeNode:_e,event:Ue,options:Ee,context:Ce,onAbort(ut){if(!U.get(ut))return;const{onDragAbort:yt}=W.current,zt={id:ut};yt==null||yt(zt),D({type:"onDragAbort",event:zt})},onPending(ut,Vt,yt,zt){if(!U.get(ut))return;const{onDragPending:Ka}=W.current,va={id:ut,constraint:Vt,initialCoordinates:yt,offset:zt};Ka==null||Ka(va),D({type:"onDragPending",event:va})},onStart(ut){const Vt=Q.current;if(Vt==null)return;const yt=U.get(Vt);if(!yt)return;const{onDragStart:zt}=W.current,Ga={activatorEvent:Ue,active:{id:Vt,data:yt.data,rect:H}};ja.unstable_batchedUpdates(()=>{zt==null||zt(Ga),O(al.Initializing),R({type:Gt.DragStart,initialCoordinates:ut,active:Vt}),D({type:"onDragStart",event:Ga}),_(yn.current),ee(Ue)})},onMove(ut){R({type:Gt.DragMove,coordinates:ut})},onEnd:Et(Gt.DragEnd),onCancel:Et(Gt.DragCancel)});yn.current=vt;function Et(ut){return async function(){const{active:yt,collisions:zt,over:Ga,scrollAdjustedTranslate:Ka}=Ce.current;let va=null;if(yt&&Ka){const{cancelDrop:Tr}=W.current;va={activatorEvent:Ue,active:yt,collisions:zt,delta:Ka,over:Ga},ut===Gt.DragEnd&&typeof Tr=="function"&&await Promise.resolve(Tr(va))&&(ut=Gt.DragCancel)}Q.current=null,ja.unstable_batchedUpdates(()=>{R({type:ut}),O(al.Uninitialized),dl(null),_(null),ee(null),yn.current=null;const Tr=ut===Gt.DragEnd?"onDragEnd":"onDragCancel";if(va){const ea=W.current[Tr];ea==null||ea(va),D({type:Tr,event:va})}})}}},[U]),ao=h.useCallback((xt,at)=>(It,Ee)=>{const _e=It.nativeEvent,Ue=U.get(Ee);if(Q.current!==null||!Ue||_e.dndKit||_e.defaultPrevented)return;const vt={active:Ue};xt(It,at.options,vt)===!0&&(_e.dndKit={capturedBy:at.sensor},Q.current=Ee,Tt(It,at))},[U,Tt]),Vl=mk(x,ao);Sk(x),qa(()=>{pe&&M===al.Initializing&&O(al.Initialized)},[pe,M]),h.useEffect(()=>{const{onDragMove:xt}=W.current,{active:at,activatorEvent:It,collisions:Ee,over:_e}=Ce.current;if(!at||!It)return;const Ue={active:at,activatorEvent:It,collisions:Ee,delta:{x:Mt.x,y:Mt.y},over:_e};ja.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}=Ce.current;if(!xt||Q.current==null||!at||!_e)return;const{onDragOver:Ue}=W.current,vt=Ee.get(Aa),Et=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:Et};ja.unstable_batchedUpdates(()=>{dl(Et),Ue==null||Ue(ut),D({type:"onDragOver",event:ut})})},[Aa]),qa(()=>{Ce.current={activatorEvent:q,active:I,activeNode:ye,collisionRect:mn,collisions:pa,droppableRects:Z,draggableNodes:U,draggingNode:We,draggingNodeRect:oe,droppableContainers:te,over:Wn,scrollableAncestors:jt,scrollAdjustedTranslate:Mt},H.current={initial:oe,translated:mn}},[I,ye,pa,mn,U,We,oe,Z,te,Wn,jt,Mt]),uk({...ie,delta:V,draggingRect:mn,pointerCoordinates:Qt,scrollableAncestors:jt,scrollableAncestorRects:Ft});const Yl=h.useMemo(()=>({active:I,activeNode:ye,activeNodeRect:pe,activatorEvent:q,collisions:pa,containerNodeRect:Ae,dragOverlay:Qe,draggableNodes:U,droppableContainers:te,droppableRects:Z,over:Wn,measureDroppableContainers:se,scrollableAncestors:jt,scrollableAncestorRects:Ft,measuringConfiguration:P,measuringScheduled:ge,windowRect:_t}),[I,ye,pe,q,pa,Ae,Qe,U,te,Z,Wn,se,jt,Ft,P,ge,_t]),Ya=h.useMemo(()=>({activatorEvent:q,activators:Vl,active:I,activeNodeRect:pe,ariaDescribedById:{draggable:ne},dispatch:R,draggableNodes:U,over:Wn,measureDroppableContainers:se}),[q,Vl,I,pe,R,ne,U,Wn,se]);return ue.createElement(aS.Provider,{value:A},ue.createElement(Ku.Provider,{value:Ya},ue.createElement(vS.Provider,{value:Yl},ue.createElement(xS.Provider,{value:Dt},v)),ue.createElement(kk,{disabled:(p==null?void 0:p.restoreFocus)===!1})),ue.createElement(_3,{...p,hiddenTextDescribedById:ne}));function Rr(){const xt=(de==null?void 0:de.autoScrollEnabled)===!1,at=typeof g=="object"?g.enabled===!1:g===!1,It=N&&!xt&&!at;return typeof g=="object"?{...g,enabled:It}:{enabled:It}}}),Ik=h.createContext(null),Vb="button",Bk="Draggable";function Pk(n){let{id:a,data:l,disabled:o=!1,attributes:c}=n;const u=Ci(Bk),{activators:f,activatorEvent:p,active:g,activeNodeRect:v,ariaDescribedById:x,draggableNodes:y,over:b}=h.useContext(Ku),{role:w=Vb,roleDescription:E="draggable",tabIndex:j=0}=c??{},C=(g==null?void 0:g.id)===a,R=h.useContext(C?xS:Ik),[D,A]=mu(),[M,O]=mu(),N=jk(f,a),k=si(l);qa(()=>(y.set(a,{id:a,key:u,node:D,activatorNode:M,data:k}),()=>{const V=y.get(a);V&&V.key===u&&y.delete(a)}),[y,a]);const U=h.useMemo(()=>({role:w,tabIndex:j,"aria-disabled":o,"aria-pressed":C&&w===Vb?!0:void 0,"aria-roledescription":E,"aria-describedby":x.draggable}),[o,w,j,C,E,x.draggable]);return{active:g,activatorEvent:p,activeNodeRect:v,attributes:U,isDragging:C,listeners:o?void 0:N,node:D,over:b,setNodeRef:A,setActivatorNodeRef:O,transform:R}}function Hk(){return h.useContext(vS)}const qk="Droppable",$k={timeout:25};function Vk(n){let{data:a,disabled:l=!1,id:o,resizeObserverConfig:c}=n;const u=Ci(qk),{active:f,dispatch:p,over:g,measureDroppableContainers:v}=h.useContext(Ku),x=h.useRef({disabled:l}),y=h.useRef(!1),b=h.useRef(null),w=h.useRef(null),{disabled:E,updateMeasurementsFor:j,timeout:C}={...$k,...c},R=si(j??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=Gu({callback:D,disabled:E||!f}),M=h.useCallback((U,V)=>{A&&(V&&(A.unobserve(V),y.current=!1),U&&A.observe(U))},[A]),[O,N]=mu(M),k=si(a);return h.useEffect(()=>{!A||!O.current||(A.disconnect(),y.current=!1,A.observe(O.current))},[O,A]),h.useEffect(()=>(p({type:Gt.RegisterDroppable,element:{id:o,key:u,disabled:l,node:O,rect:b,data:k}}),()=>p({type:Gt.UnregisterDroppable,key:u,id:o})),[o]),h.useEffect(()=>{l!==x.current.disabled&&(p({type:Gt.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:N}}function Yk(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 Gk=n=>{let{containerNodeRect:a,draggingNodeRect:l,transform:o}=n;return!l||!a?o:Yk(o,l,a)},Kk=n=>{let{transform:a}=n;return{...a,x:0}};function Dp(n,a,l){const o=n.slice();return o.splice(l<0?o.length+l:l,0,o.splice(a,1)[0]),o}function Xk(n,a){return n.reduce((l,o,c)=>{const u=a.get(o);return u&&(l[c]=u),l},Array(n.length))}function Kc(n){return n!==null&&n>=0}function Fk(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 Qk(n){return typeof n=="boolean"?{draggable:n,droppable:n}:n}const yS=n=>{let{rects:a,activeIndex:l,overIndex:o,index:c}=n;const u=Dp(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}},Xc={scaleX:1,scaleY:1},Zk=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,...Xc}:null}const g=Jk(u,c,l);return c>l&&c<=f?{x:0,y:-p.height-g,...Xc}:c<l&&c>=f?{x:0,y:p.height+g,...Xc}:{x:0,y:0,...Xc}};function Jk(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 bS="Sortable",wS=ue.createContext({activeIndex:-1,containerId:bS,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:yS,disabled:{draggable:!1,droppable:!1}});function Wk(n){let{children:a,id:l,items:o,strategy:c=yS,disabled:u=!1}=n;const{active:f,dragOverlay:p,droppableRects:g,over:v,measureDroppableContainers:x}=Hk(),y=Ci(bS,l),b=p.rect!==null,w=h.useMemo(()=>o.map(N=>typeof N=="object"&&"id"in N?N.id:N),[o]),E=f!=null,j=f?w.indexOf(f.id):-1,C=v?w.indexOf(v.id):-1,R=h.useRef(w),D=!Fk(w,R.current),A=C!==-1&&j===-1||D,M=Qk(u);qa(()=>{D&&E&&x(w)},[D,w,E,x]),h.useEffect(()=>{R.current=w},[w]);const O=h.useMemo(()=>({activeIndex:j,containerId:y,disabled:M,disableTransforms:A,items:w,overIndex:C,useDragOverlay:b,sortedRects:Xk(w,g),strategy:c}),[j,y,M.draggable,M.droppable,A,w,C,g,b,c]);return ue.createElement(wS.Provider,{value:O},a)}const e_=n=>{let{id:a,items:l,activeIndex:o,overIndex:c}=n;return Dp(l,o,c).indexOf(a)},t_=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},n_={duration:200,easing:"ease"},SS="transform",a_=pu.Transition.toString({property:SS,duration:0,easing:"linear"}),r_={roleDescription:"sortable"};function l_(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=to(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 s_(n){let{animateLayoutChanges:a=t_,attributes:l,disabled:o,data:c,getNewIndex:u=e_,id:f,strategy:p,resizeObserverConfig:g,transition:v=n_}=n;const{items:x,containerId:y,activeIndex:b,disabled:w,disableTransforms:E,sortedRects:j,overIndex:C,useDragOverlay:R,strategy:D}=h.useContext(wS),A=o_(o,w),M=x.indexOf(f),O=h.useMemo(()=>({sortable:{containerId:y,index:M,items:x},...c}),[y,c,M,x]),N=h.useMemo(()=>x.slice(x.indexOf(f)),[x,f]),{rect:k,node:U,isOver:V,setNodeRef:te}=Vk({id:f,data:O,disabled:A.droppable,resizeObserverConfig:{updateMeasurementsFor:N,...g}}),{active:$,activatorEvent:H,activeNodeRect:I,attributes:Q,setNodeRef:de,listeners:_,isDragging:q,over:ee,setActivatorNodeRef:W,transform:ne}=Pk({id:f,data:O,attributes:{...r_,...l},disabled:A.draggable}),z=w3(te,de),P=!!$,Z=P&&!E&&Kc(b)&&Kc(C),se=!R&&q,ge=se&&Z?ne:null,G=Z?ge??(p??D)({rects:j,activeNodeRect:I,activeIndex:b,overIndex:C,index:M}):null,ie=Kc(b)&&Kc(C)?u({id:f,items:x,activeIndex:b,overIndex:C}):M,he=$==null?void 0:$.id,pe=h.useRef({activeId:he,items:x,newIndex:ie,containerId:y}),Ae=x!==pe.current.items,Ce=a({active:$,containerId:y,isDragging:q,isSorting:P,id:f,index:M,items:x,newIndex:pe.current.newIndex,previousItems:pe.current.items,previousContainerId:pe.current.containerId,transition:v,wasDragging:pe.current.activeId!=null}),Oe=l_({disabled:!Ce,index:M,node:U,rect:k});return h.useEffect(()=>{P&&pe.current.newIndex!==ie&&(pe.current.newIndex=ie),y!==pe.current.containerId&&(pe.current.containerId=y),x!==pe.current.items&&(pe.current.items=x)},[P,ie,y,x]),h.useEffect(()=>{if(he===pe.current.activeId)return;if(he!=null&&pe.current.activeId==null){pe.current.activeId=he;return}const We=setTimeout(()=>{pe.current.activeId=he},50);return()=>clearTimeout(We)},[he]),{active:$,activeIndex:b,attributes:Q,data:O,rect:k,index:M,newIndex:ie,items:x,isOver:V,isSorting:P,isDragging:q,listeners:_,node:U,overIndex:C,over:ee,setNodeRef:z,setActivatorNodeRef:W,setDroppableNodeRef:te,setDraggableNodeRef:de,transform:Oe??G,transition:Qe()};function Qe(){if(Oe||Ae&&pe.current.newIndex===M)return a_;if(!(se&&!Np(H)||!v)&&(P||Ce))return pu.Transition.toString({...v,property:SS})}}function o_(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 xu(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 i_=[Xe.Down,Xe.Right,Xe.Up,Xe.Left],c_=(n,a)=>{let{context:{active:l,collisionRect:o,droppableRects:c,droppableContainers:u,over:f,scrollableAncestors:p}}=a;if(i_.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 Xe.Down:o.top<b.top&&g.push(y);break;case Xe.Up:o.top>b.top&&g.push(y);break;case Xe.Left:o.left>b.left&&g.push(y);break;case Xe.Right:o.left<b.left&&g.push(y);break}});const v=I3({collisionRect:o,droppableRects:c,droppableContainers:g});let x=sS(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,E=b==null?void 0:b.node.current;if(E&&w&&y&&b){const C=Yu(E).some((N,k)=>p[k]!==N),R=jS(y,b),D=u_(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:oi(M,A)}}}};function jS(n,a){return!xu(n)||!xu(a)?!1:n.data.current.sortable.containerId===a.data.current.sortable.containerId}function u_(n,a){return!xu(n)||!xu(a)||!jS(n,a)?!1:n.data.current.sortable.index<a.data.current.sortable.index}var d_=Object.defineProperty,Sr=(n,a)=>d_(n,"name",{value:a,configurable:!0}),Op="Checkbox",[f_,f5]=Ln(Op),[h_,kp]=f_(Op);function CS(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:Op}),[E,j]=h.useState(null),[C,R]=h.useState(null),D=h.useRef(!1),[A,M]=h.useReducer(k=>k+1,0),O=E?!!f||!!E.closest("form"):!0,N={checked:b,disabled:u,setChecked:w,control:E,setControl:j,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(h_,{scope:a,...N,children:NS(y)?y(N):o})}Sr(CS,"CheckboxProvider");var m_="CheckboxTrigger",p_=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:E,isFormControl:j,bubbleInput:C}=kp(m_,a),R=Ge(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(Pe.button,{type:"button",role:"checkbox","aria-checked":xr(v)?"mixed":v,"aria-required":x,"data-state":_p(v),"data-disabled":g?"":void 0,disabled:g,value:p,...c,ref:R,onKeyDown:je(l,A=>{A.key==="Enter"&&A.preventDefault()}),onClick:je(o,A=>{E(),b(M=>xr(M)?!0:!M),C&&j&&(w.current=A.isPropagationStopped(),w.current||A.stopPropagation())})})},"CheckboxTrigger")),ES=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(CS,{__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(p_,{...b,ref:l,__scopeCheckbox:o}),w&&s.jsx(y_,{__scopeCheckbox:o})]})})},"Checkbox")),g_="CheckboxIndicator",v_=h.forwardRef(Sr(function(a,l){const{__scopeCheckbox:o,forceMount:c,...u}=a,f=kp(g_,o);return s.jsx(Cr,{present:c||xr(f.checked)||f.checked===!0,children:s.jsx(Pe.span,{"data-state":_p(f.checked),"data-disabled":f.disabled?"":void 0,...u,ref:l,style:{pointerEvents:"none",...a.style}})})},"CheckboxIndicator")),x_="CheckboxBubbleInput",y_=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:E,bubbleInput:j,setBubbleInput:C}=kp(x_,a),R=Ge(c,C),D=_u(u),A=h.useRef(!1),M=h.useRef(g),O=h.useRef(p);h.useEffect(()=>{const k=j;if(!k)return;const U=window.HTMLInputElement.prototype,te=Object.getOwnPropertyDescriptor(U,"checked").set,$=p!==O.current;O.current=p;const H=M.current!==g;M.current=g;const I=!($&&f.current);if(H&&te){A.current=!$;const Q=new Event("click",{bubbles:I});k.indeterminate=xr(g),te.call(k,xr(g)?!1:g),k.dispatchEvent(Q),A.current=!1}},[j,g,f,p]);const N=h.useRef(xr(g)?!1:g);return s.jsx(Pe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:v??N.current,required:x,disabled:y,name:b,value:w,form:E,...o,tabIndex:-1,ref:R,onClick:je(l,k=>{A.current&&k.stopPropagation()}),style:{...o.style,...D,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function NS(n){return typeof n=="function"}Sr(NS,"isFunction");function xr(n){return n==="indeterminate"}Sr(xr,"isIndeterminate");function _p(n){return xr(n)?"indeterminate":n?"checked":"unchecked"}Sr(_p,"getState");const Il=h.forwardRef(({className:n,...a},l)=>s.jsx(ES,{ref:l,className:Ne("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(v_,{className:Ne("flex items-center justify-center text-current"),children:s.jsx(Dm,{className:"h-3.5 w-3.5"})})}));Il.displayName=ES.displayName;function b_({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:Ne("h-2 w-full overflow-hidden rounded-full bg-secondary",a),children:s.jsx("div",{className:Ne("h-full w-full flex-1 bg-primary transition-all",l),style:{transform:`translateX(-${100-o}%)`}})})}var w_=Object.defineProperty,fn=(n,a)=>w_(n,"name",{value:a,configurable:!0}),[zp,h5]=Ln("Tooltip",[Js]),Lp=Js(),S_="TooltipProvider",j_=700,dm="tooltip.open",[C_,Up]=zp(S_),E_=fn(n=>{const{__scopeTooltip:a,delayDuration:l=j_,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(C_,{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"),fm="Tooltip",[N_,Xu]=zp(fm),R_=fn(n=>{const{__scopeTooltip:a,children:l,open:o,defaultOpen:c,onOpenChange:u,disableHoverableContent:f,delayDuration:p}=n,g=Up(fm,n.__scopeTooltip),v=Lp(a),[x,y]=h.useState(null),[b,w]=h.useState(void 0),E=Ea(),j=h.useRef(0),C=f??g.disableHoverableContent,R=p??g.delayDuration,D=h.useRef(!1),[A,M]=Ia({prop:o,defaultProp:c??!1,onChange:fn(te=>{te?(g.onOpen(),document.dispatchEvent(new CustomEvent(dm))):g.onClose(),u==null||u(te)},"onChange"),caller:fm}),O=h.useMemo(()=>A?D.current?"delayed-open":"instant-open":"closed",[A]),N=h.useCallback(()=>{window.clearTimeout(j.current),j.current=0,D.current=!1,M(!0)},[M]),k=h.useCallback(()=>{window.clearTimeout(j.current),j.current=0,M(!1)},[M]),U=h.useCallback(()=>{window.clearTimeout(j.current),j.current=window.setTimeout(()=>{D.current=!0,M(!0),j.current=0},R)},[R,M]);h.useEffect(()=>()=>{j.current&&(window.clearTimeout(j.current),j.current=0)},[]);const V=b??E;return s.jsx(Fm,{...v,children:s.jsx(N_,{scope:a,contentId:V,setContentId:w,open:A,stateAttribute:O,trigger:x,onTriggerChange:y,onTriggerEnter:h.useCallback(()=>{g.isOpenDelayedRef.current?U():N()},[g.isOpenDelayedRef,U,N]),onTriggerLeave:h.useCallback(()=>{C?k():(window.clearTimeout(j.current),j.current=0)},[k,C]),onOpen:N,onClose:k,disableHoverableContent:C,children:l})})},"Tooltip"),Yb="TooltipTrigger",T_=h.forwardRef(fn(function(a,l){const{__scopeTooltip:o,...c}=a,u=Xu(Yb,o),f=Up(Yb,o),p=Lp(o),g=h.useRef(null),v=Ge(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(Qm,{asChild:!0,...p,children:s.jsx(Pe.button,{"aria-describedby":u.open?u.contentId:void 0,"data-state":u.stateAttribute,...c,ref:v,onPointerMove:je(a.onPointerMove,w=>{w.pointerType!=="touch"&&!y.current&&!f.isPointerInTransitRef.current&&(u.onTriggerEnter(),y.current=!0)}),onPointerLeave:je(a.onPointerLeave,()=>{u.onTriggerLeave(),y.current=!1}),onPointerDown:je(a.onPointerDown,()=>{u.open&&u.onClose(),x.current=!0,document.addEventListener("pointerup",b,{once:!0})}),onFocus:je(a.onFocus,()=>{x.current||u.onOpen()}),onBlur:je(a.onBlur,u.onClose),onClick:je(a.onClick,u.onClose)})})},"TooltipTrigger")),A_="TooltipPortal",[m5,M_]=zp(A_,{forceMount:void 0}),ci="TooltipContent",D_=h.forwardRef(fn(function(a,l){const o=M_(ci,a.__scopeTooltip),{forceMount:c=o.forceMount,side:u="top",...f}=a,p=Xu(ci,a.__scopeTooltip);return s.jsx(Cr,{present:c||p.open,children:p.disableHoverableContent?s.jsx(RS,{side:u,...f,ref:l}):s.jsx(O_,{side:u,...f,ref:l})})},"TooltipContent")),O_=h.forwardRef(fn(function(a,l){const o=Xu(ci,a.__scopeTooltip),c=Up(ci,a.__scopeTooltip),u=h.useRef(null),f=Ge(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]),E=h.useCallback((j,C)=>{const R=j.currentTarget,D={x:j.clientX,y:j.clientY},A=TS(D,R.getBoundingClientRect()),M=AS(D,A),O=MS(C.getBoundingClientRect()),N=OS([...M,...O]);g(N),b(!0)},[b]);return h.useEffect(()=>()=>w(),[w]),h.useEffect(()=>{if(v&&y){const j=fn(R=>E(R,y),"handleTriggerLeave"),C=fn(R=>E(R,v),"handleContentLeave");return v.addEventListener("pointerleave",j),y.addEventListener("pointerleave",C),()=>{v.removeEventListener("pointerleave",j),y.removeEventListener("pointerleave",C)}}},[v,y,E,w]),h.useEffect(()=>{if(p){const j=fn(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=!DS(D,p);A?w():M&&(w(),x())},"handleTrackPointerGrace");return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[v,y,p,x,w]),s.jsx(RS,{...a,ref:f})},"TooltipContentHoverable")),k_=$0("TooltipContent"),RS=h.forwardRef(fn(function(a,l){const{__scopeTooltip:o,children:c,"aria-label":u,id:f,onEscapeKeyDown:p,onPointerDownOutside:g,...v}=a,x=Xu(ci,o),y=Lp(o),{onClose:b}=x;h.useEffect(()=>(document.addEventListener(dm,b),()=>document.removeEventListener(dm,b)),[b]),h.useEffect(()=>{if(x.trigger){const E=fn(j=>{j.target instanceof Node&&j.target.contains(x.trigger)&&b()},"handleScroll");return window.addEventListener("scroll",E,{capture:!0}),()=>window.removeEventListener("scroll",E,{capture:!0})}},[x.trigger,b]);const{setContentId:w}=x;return Xt(()=>(w(f),()=>{w(void 0)}),[f,w]),s.jsx(Tu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:p,onPointerDownOutside:g,onFocusOutside:E=>E.preventDefault(),onDismiss:b,children:s.jsxs(Zm,{"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(k_,{children:c}),u?s.jsx(zO,{id:x.contentId,role:"tooltip",children:u}):null]})})},"TooltipContentImpl"));function TS(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")}}fn(TS,"getExitSideFromRect");function AS(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}fn(AS,"getPaddedExitPoints");function MS(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}]}fn(MS,"getPointsFromRect");function DS(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}fn(DS,"isPointInPolygon");function OS(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),kS(a)}fn(OS,"getHull");function kS(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)}fn(kS,"getHullPresorted");var __=E_,z_=R_,L_=T_,_S=D_;const zS=__,ks=z_,_s=L_,Dl=h.forwardRef(({className:n,sideOffset:a=4,...l},o)=>s.jsx(_S,{ref:o,sideOffset:a,className:Ne("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}));Dl.displayName=_S.displayName;const yu=h.forwardRef(({className:n,...a},l)=>s.jsx("textarea",{ref:l,className:Ne("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}));yu.displayName="Textarea";function U_({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),[E,j]=h.useState(""),C=N=>{const k=new FormData;return k.append("providerId",n),N&&k.append("selectedIndexes",JSON.stringify(N)),c.forEach(U=>k.append("file",U)),f.trim()&&k.append("text",f),k},R=async()=>{w(!0),j("");try{const N=await xe.upload("/api/admin/codex/accounts/preview",C());v(N),y(N.records.filter(k=>k.valid&&!k.duplicateOf).map(k=>k.index))}catch(N){j(N.message||"Unable to preview import")}finally{w(!1)}},D=async()=>{w(!0),j("");try{const N=await xe.upload("/api/admin/codex/accounts/import",C(x));l(!1),o(),u([]),p(""),v(null),y([]),me.success(`${N.added} added, ${N.updated} updated, ${N.failed} failed`)}catch(N){j(N.message||"Unable to import accounts")}finally{w(!1)}},A=(N,k)=>y(U=>k===!0?[...new Set([...U,N])]:U.filter(V=>V!==N)),M=(g==null?void 0:g.records.filter(N=>N.valid&&!N.duplicateOf).map(N=>N.index))??[],O=M.length>0&&M.every(N=>x.includes(N));return s.jsx(vn,{open:a,onOpenChange:l,children:s.jsxs(on,{className:"max-w-3xl",children:[s.jsxs(cn,{children:[s.jsx(dn,{children:"Import Codex accounts"}),s.jsx(Ll,{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(Il,{checked:O,onCheckedChange:N=>y(N===!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(N=>s.jsxs("tr",{className:"border-b last:border-0",children:[s.jsx("td",{className:"p-2",children:s.jsx(Il,{checked:x.includes(N.index),disabled:!N.valid||!!N.duplicateOf,onCheckedChange:k=>A(N.index,k),"aria-label":`Select record ${N.index+1}`})}),s.jsxs("td",{className:"p-2",children:[s.jsx("div",{children:N.email||"Unknown email"}),s.jsxs("div",{className:"text-xs text-muted-foreground",children:[N.accountIdMasked||"No account ID",N.workspaceIdMasked?` · ${N.workspaceIdMasked}`:""]})]}),s.jsx("td",{className:"p-2",children:N.planType||"—"}),s.jsx("td",{className:"p-2",children:N.expiresAt?new Date(N.expiresAt).toLocaleDateString():"—"}),s.jsx("td",{className:"p-2",children:N.valid?N.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:N.error||"Invalid record"})})]},`${N.index}-${N.source??""}`))})]})}),E&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:E}),s.jsxs(un,{children:[s.jsx(ce,{variant:"outline",onClick:()=>v(null),children:"Back"}),s.jsx(ce,{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(Re,{id:"codex-files",type:"file",accept:".json,.jsonl,application/json",multiple:!0,onChange:N=>u(Array.from(N.target.files??[]))})]}),s.jsxs("div",{children:[s.jsx(be,{htmlFor:"codex-paste",children:"Paste JSON / JSONL (optional)"}),s.jsx(yu,{id:"codex-paste",value:f,onChange:N=>p(N.target.value),placeholder:"Paste Codex export records here",className:"min-h-32 font-mono text-xs"})]}),E&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:E}),s.jsxs(un,{children:[s.jsx(ce,{variant:"outline",onClick:()=>l(!1),children:"Cancel"}),s.jsx(ce,{disabled:b||c.length===0&&!f.trim(),onClick:()=>void R(),children:b?"Reading…":"Preview import"})]})]})]})})}const I_="http://localhost:1455/auth/callback",B_="1455",P_="http://localhost:8791/oauth/codex/callback";function H_({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,E]=h.useState(!1),[j,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 xe.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(()=>{xe.get(`/api/admin/codex/oauth/${u}`).then(V=>M(!(V!=null&&V.callbackReceived))).catch(()=>M(!0))},5e3);return()=>clearInterval(U)},[u]);const N=async()=>{E(!0),C("");try{const U=await xe.post("/api/admin/codex/oauth/complete",{providerId:n,state:u,callbackUrl:v});me.success(`Codex account ${U.status==="added"?"connected":"updated"}`),o(!1),c()}catch(U){C(U.message||"Unable to complete the Codex authorization")}finally{E(!1)}},k=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(vn,{open:l,onOpenChange:o,children:s.jsxs(on,{className:"max-w-2xl",children:[s.jsxs(cn,{children:[s.jsx(dn,{children:"Connect OpenAI Codex"}),s.jsxs(Ll,{children:["Authorize a ChatGPT account for ",a,". The callback is captured on localhost:",B_," — 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:P_}),". 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(Re,{readOnly:!0,className:"font-mono text-xs",value:p,onFocus:U=>U.currentTarget.select()}),s.jsx(ce,{type:"button",variant:"outline","aria-label":"Copy authorization URL",onClick:()=>void k(),children:R?s.jsx(Dm,{className:"h-4 w-4"}):s.jsx(tu,{className:"h-4 w-4"})}),s.jsx(ce,{type:"button",variant:"outline","aria-label":"Open authorization URL",asChild:!0,children:s.jsx("a",{href:p,target:"_blank",rel:"noreferrer",children:s.jsx(iN,{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(Re,{id:"codex-callback",value:v,onChange:U=>x(U.target.value),placeholder:`${I_}?code=…`}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Or paste callback URL manually"})]}),j&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:j})]}),s.jsxs(un,{children:[s.jsx(ce,{variant:"outline",onClick:()=>o(!1),children:"Cancel"}),s.jsx(ce,{disabled:w||y||A&&!v.trim(),onClick:()=>void N(),children:w?s.jsxs(s.Fragment,{children:[s.jsx(pr,{className:"mr-1 h-4 w-4 animate-spin"})," Connecting…"]}):"Connect"})]})]})})}const q_=["10","25","50"];function $_(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 Gb(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:$_(n.resetAt,a)})]}),s.jsx(b_,{value:n.used,indicatorClassName:o?"bg-destructive":n.remaining<30?"bg-amber-500":"bg-emerald-500"})]})}function V_({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),[E,j]=h.useState("10"),[C,R]=h.useState(""),[D,A]=h.useState(()=>Date.now());h.useEffect(()=>{const _=setInterval(()=>A(Date.now()),3e4);return()=>clearInterval(_)},[]);const M=h.useCallback(async()=>{try{const _=await xe.get(`/api/admin/codex/accounts?providerId=${encodeURIComponent(n)}`);o(_.accounts)}catch(_){me.error(_.message||"Unable to load Codex accounts")}finally{p(!1)}},[n]);h.useEffect(()=>{M()},[M]);const O=async(_,q,ee)=>{u(_.id);try{await ee(),me.success(`${q}: ${_.email||_.accountIdMasked||_.id}`)}catch(W){me.error(W.message||`${q} failed`)}finally{u(null)}},N=(_,q)=>o(ee=>ee.map(W=>W.id===_?q:W)),k=(_,q)=>O(l.find(ee=>ee.id===_),"Updated",async()=>{N(_,(await xe.patch(`/api/admin/codex/accounts/${_}`,q)).account)}),U=l.filter(_=>{if(!C)return!0;const q=C.toLowerCase();return[_.email,_.accountIdMasked,_.workspaceIdMasked,_.planType].some(ee=>ee==null?void 0:ee.toLowerCase().includes(q))}),V=Number(E),te=Math.max(1,Math.ceil(U.length/V)),$=Math.min(b,te),H=U.slice(($-1)*V,$*V),I=async()=>{u("all");try{await Promise.allSettled(l.map(_=>xe.post(`/api/admin/codex/accounts/${_.id}/usage`))),await M(),me.success("Usage refreshed for all accounts")}finally{u(null)}},Q=z3(Ob(Mp,{activationConstraint:{distance:4}}),Ob(Tp,{coordinateGetter:c_})),de=async _=>{const{active:q,over:ee}=_;if(!ee||q.id===ee.id)return;const W=l.findIndex(Z=>Z.id===q.id),ne=l.findIndex(Z=>Z.id===ee.id);if(W<0||ne<0)return;const z=l,P=Dp(l,W,ne);o(P);try{await xe.post("/api/admin/codex/accounts/reorder",{providerId:n,ids:P.map(Z=>Z.id)}),me.success("Routing order updated")}catch(Z){o(z),me.error(Z.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(Re,{className:"h-8 w-40",placeholder:"Filter accounts…",value:C,onChange:_=>{R(_.target.value),w(1)}}),s.jsxs(ce,{size:"sm",variant:"outline",disabled:c!==null||l.length===0,onClick:()=>void I(),children:[s.jsx(k0,{className:"mr-1 h-3 w-3"})," Refresh all"]}),s.jsxs(ce,{size:"sm",variant:"outline",onClick:()=>y(!0),children:[s.jsx(hN,{className:"mr-1 h-4 w-4"})," Connect Codex"]}),s.jsxs(ce,{size:"sm",onClick:()=>v(!0),children:[s.jsx(TN,{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(zS,{delayDuration:200,children:s.jsx(Uk,{sensors:Q,collisionDetection:U3,onDragEnd:_=>void de(_),modifiers:[Kk,Gk],children:s.jsxs(Xn,{children:[s.jsx(Fn,{children:s.jsxs(Fe,{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(Wk,{items:H.map(_=>_.id),strategy:Zk,children:s.jsx(Qn,{children:H.map(_=>s.jsx(Y_,{account:_,now:D,busy:c===_.id,onPatch:q=>void k(_.id,q),onUsage:q=>N(_.id,q),onDelete:()=>void O(_,"Deleted",()=>xe.del(`/api/admin/codex/accounts/${_.id}`)).then(()=>M())},_.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(Gn,{value:E,onValueChange:_=>{j(_),w(1)},children:[s.jsx(kn,{className:"h-7 w-16",children:s.jsx(Kn,{})}),s.jsx(_n,{children:q_.map(_=>s.jsx(tt,{value:_,children:_},_))})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{children:["Page ",$," of ",te]}),s.jsx(ce,{size:"sm",variant:"outline","aria-label":"Previous page",disabled:$<=1,onClick:()=>w($-1),children:s.jsx(eN,{className:"h-3 w-3"})}),s.jsx(ce,{size:"sm",variant:"outline","aria-label":"Next page",disabled:$>=te,onClick:()=>w($+1),children:s.jsx(T0,{className:"h-3 w-3"})})]})]})]}),g&&s.jsx(U_,{providerId:n,open:!0,onOpenChange:_=>{_||v(!1)},onImported:()=>void M()}),x&&s.jsx(H_,{providerId:n,providerName:a||"this Codex provider",open:!0,onOpenChange:_=>{_||y(!1)},onConnected:()=>void M()})]})}function Y_({account:n,now:a,busy:l,onPatch:o,onUsage:c,onDelete:u}){var A,M,O,N,k,U;const{attributes:f,listeners:p,setNodeRef:g,transform:v,transition:x,isDragging:y}=s_({id:n.id,disabled:l}),b=(M=(A=n.usage)==null?void 0:A.quotas)==null?void 0:M.session,w=(N=(O=n.usage)==null?void 0:O.quotas)==null?void 0:N.blocking,E=((k=n.usage)==null?void 0:k.resetCredits)??0,j=n.email||n.accountIdMasked||n.id,C=()=>void(async()=>{try{c((await xe.post(`/api/admin/codex/accounts/${n.id}/usage`)).account),me.success(`Usage refreshed: ${j}`)}catch(V){me.error(V.message||"Usage refresh failed")}})(),R=()=>{window.confirm(`Spend 1 weekly reset credit to restart the 5h window for ${j}?`)&&(async()=>{try{c((await xe.post(`/api/admin/codex/accounts/${n.id}/reset-quota`)).account),me.success(`Quota reset: ${j}`)}catch(V){me.error(V.message||"Quota reset failed")}})()},D=()=>void G_(`Test passed: ${j}`,()=>xe.post(`/api/admin/codex/accounts/${n.id}/test`));return s.jsxs(Fe,{ref:g,style:{transform:v?`translate3d(${v.x}px, ${v.y}px, 0)`:void 0,transition:x},className:Ne(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 ${j}`,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(fN,{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:Gb(b,a,"5h")}),s.jsx(fe,{children:Gb(w,a,"Week")}),s.jsx(fe,{children:s.jsx("span",{className:`text-sm tabular-nums ${E>0?"font-medium":"text-muted-foreground"}`,children:E})}),s.jsx(fe,{children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(K_,{checked:n.autostart,disabled:l,onCheckedChange:V=>o({autostart:V}),label:`Auto-start 5h window for ${j}`}),s.jsxs(ks,{children:[s.jsx(_s,{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(Dl,{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(nt,{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(ks,{children:[s.jsx(_s,{asChild:!0,children:s.jsx(ce,{size:"sm",variant:"outline","aria-label":`Refresh usage for ${j}`,disabled:l,onClick:C,children:s.jsx(k0,{className:"h-3 w-3"})})}),s.jsx(Dl,{children:"Refresh usage"})]}),s.jsxs(ks,{children:[s.jsx(_s,{asChild:!0,children:s.jsx(ce,{size:"sm",variant:"outline","aria-label":`Reset quota for ${j}`,disabled:l||E===0,onClick:R,children:s.jsx(yN,{className:"h-3 w-3"})})}),s.jsx(Dl,{children:E===0?"No weekly reset credits available":"Reset quota (uses 1 credit)"})]}),s.jsxs(ks,{children:[s.jsx(_s,{asChild:!0,children:s.jsx(ce,{size:"sm",variant:"outline","aria-label":`Test Codex account ${j}`,disabled:l,onClick:D,children:s.jsx(SN,{className:"h-3 w-3"})})}),s.jsx(Dl,{children:"Test connection"})]}),s.jsxs(ks,{children:[s.jsx(_s,{asChild:!0,children:s.jsx(ce,{size:"sm",variant:"outline","aria-pressed":!n.enabled,disabled:l,onClick:()=>o({enabled:!n.enabled}),children:n.enabled?"Disable":"Enable"})}),s.jsx(Dl,{children:n.enabled?"Exclude from routing (keeps the account)":"Include in routing"})]}),s.jsxs(ks,{children:[s.jsx(_s,{asChild:!0,children:s.jsx(ce,{size:"sm",variant:"destructive","aria-label":`Delete Codex account ${j}`,disabled:l,onClick:()=>{window.confirm(`Permanently delete ${j}?
386
+
387
+ Stored Codex credentials are erased. Past request logs are kept, but lose the account reference.`)&&u()},children:s.jsx(pi,{className:"h-3 w-3"})})}),s.jsx(Dl,{children:"Delete account (permanent)"})]})]})})]})}async function G_(n,a){try{await a(),me.success(n)}catch(l){me.error(l.message||"Action failed")}}function K_({checked:n,disabled:a,onCheckedChange:l,label:o}){return s.jsx(Il,{role:"switch","aria-label":o,"aria-checked":n,checked:n,disabled:a,onCheckedChange:c=>l(c===!0)})}function X_({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,E]=h.useState(!1),[j,C]=h.useState(""),R=h.useCallback(async()=>{b(!0),C("");try{const M=await xe.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()=>{E(!0),C("");try{const M=await xe.post("/api/admin/models/import",{providerId:n,modelIds:Array.from(p)});me.success(`Imported ${M.imported} of ${M.requested} Codex models`),o(!1),c()}catch(M){C(M.message||"Unable to import models")}finally{E(!1)}};return s.jsx(vn,{open:l,onOpenChange:o,children:s.jsxs(on,{className:"max-w-2xl",children:[s.jsxs(cn,{children:[s.jsxs(dn,{children:["Import models from ",a]}),s.jsx(Ll,{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(km,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),s.jsx(Re,{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(ce,{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(Il,{checked:p.has(M.upstreamId),disabled:M.alreadyImported,onCheckedChange:O=>g(N=>{const k=new Set(N);return O===!0?k.add(M.upstreamId):k.delete(M.upstreamId),k})}),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(nt,{variant:"secondary",children:"imported"})]},M.upstreamId))}),j&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:j})]}),s.jsxs(un,{children:[s.jsx(ce,{variant:"outline",onClick:()=>void R(),disabled:y,children:"Refetch"}),s.jsxs(ce,{disabled:w||p.size===0,onClick:()=>void A(),children:["Import ",p.size||""]})]})]})})}const Ml={name:"",slug:"",type:"openai",baseUrl:"https://api.openai.com",apiKey:"",customHeaders:"",enabled:!0},F_="https://chatgpt.com",Q_={openai:"https://api.openai.com",anthropic:"https://api.anthropic.com",codex:F_};function Z_(){const[n,a]=h.useState([]),[l,o]=h.useState(!1),[c,u]=h.useState(Ml),[f,p]=h.useState(!1),[g,v]=h.useState(null),[x,y]=h.useState(null),[b,w]=h.useState(Ml),[E,j]=h.useState(null),[C,R]=h.useState(!1),[D,A]=h.useState(null),[M,O]=h.useState({}),N=c.type!=="codex",k=async()=>{try{const I=await xe.get("/api/admin/providers");a(I.providers)}catch(I){me.error(I.message||"Unable to load providers")}};h.useEffect(()=>{k()},[]);const U=async()=>{p(!0);try{let I;if(c.customHeaders.trim())try{I=JSON.parse(c.customHeaders)}catch{throw new Error("Custom headers must be valid JSON object")}await xe.post("/api/admin/providers",{name:c.name,slug:c.slug||void 0,type:c.type,baseUrl:c.baseUrl,apiKey:c.type==="codex"?void 0:c.apiKey,customHeaders:I,enabled:c.enabled}),me.success(c.type==="codex"?"Codex provider created — add accounts next":"Provider created"),o(!1),u(Ml);const Q=await xe.get("/api/admin/providers");a(Q.providers)}catch(I){me.error(I.message)}finally{p(!1)}},V=async I=>{v(I);try{const Q=await xe.post(`/api/admin/providers/${I}/test`);me.success(Q.ok?`Connection OK: ${Q.detail}`:`Failed: ${Q.detail}`),k()}catch(Q){me.error(Q.message)}finally{v(null)}},te=I=>{y(I.id),w({...Ml,name:I.name,slug:I.slug||"",type:I.type,baseUrl:I.baseUrl,apiKey:"",customHeaders:"",enabled:I.enabled})},$=async()=>{if(x){p(!0);try{let I;if(b.customHeaders.trim())try{I=JSON.parse(b.customHeaders)}catch{throw new Error("Custom headers must be valid JSON object")}await xe.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:I,enabled:b.enabled}),me.success("Provider updated"),y(null),w(Ml),k()}catch(I){me.error(I.message)}finally{p(!1)}}},H=async I=>{R(!0);try{await xe.del(`/api/admin/providers/${I}`),me.success("Provider removed"),k()}catch(Q){me.error(Q.message)}finally{R(!1),j(null)}};return s.jsxs("div",{children:[s.jsx(Va,{title:"Providers",description:"Upstream LLM providers and their credentials",actions:s.jsxs(vn,{open:l,onOpenChange:o,children:[s.jsx(bi,{asChild:!0,children:s.jsxs(ce,{children:[s.jsx(mi,{className:"mr-1 h-4 w-4"})," Add provider"]})}),s.jsxs(on,{children:[s.jsxs(cn,{children:[s.jsx(dn,{children:"New provider"}),s.jsx(Ll,{children:N?"API-key or compatible endpoint.":"Codex providers authenticate through imported ChatGPT accounts — no API key is stored."})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(be,{htmlFor:"provider-name",children:"Name"}),s.jsx(Re,{id:"provider-name",value:c.name,onChange:I=>u({...c,name:I.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{htmlFor:"provider-slug",children:"Slug (optional)"}),s.jsx(Re,{id:"provider-slug",value:c.slug,onChange:I=>u({...c,slug:I.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Type"}),s.jsxs(Gn,{value:c.type,onValueChange:I=>u(Q=>({...Q,type:I,baseUrl:Q_[I],apiKey:I==="codex"?"":Q.apiKey})),children:[s.jsx(kn,{children:s.jsx(Kn,{})}),s.jsxs(_n,{children:[s.jsx(tt,{value:"openai",children:"OpenAI-compatible"}),s.jsx(tt,{value:"anthropic",children:"Anthropic-compatible"}),s.jsx(tt,{value:"codex",children:"Codex OAuth"})]})]})]}),s.jsxs("div",{children:[s.jsx(be,{htmlFor:"provider-base-url",children:"Base URL"}),s.jsx(Re,{id:"provider-base-url",value:c.baseUrl,onChange:I=>u({...c,baseUrl:I.target.value})})]}),N?s.jsxs("div",{children:[s.jsx(be,{htmlFor:"provider-api-key",children:"API key"}),s.jsx(Re,{id:"provider-api-key",type:"password",value:c.apiKey,onChange:I=>u({...c,apiKey:I.target.value})})]}):s.jsxs("p",{className:"rounded-md border border-dashed p-3 text-xs text-muted-foreground",children:["After creating this provider, use ",s.jsx("span",{className:"font-medium",children:"Import accounts"})," on its row to add Codex OAuth credentials."]}),s.jsxs("div",{children:[s.jsx(be,{htmlFor:"provider-headers",children:"Custom headers (JSON)"}),s.jsx(Re,{id:"provider-headers",value:c.customHeaders,onChange:I=>u({...c,customHeaders:I.target.value}),placeholder:'{"X-Org":"acme"}'})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ha,{checked:c.enabled,onCheckedChange:I=>u({...c,enabled:I})}),s.jsx(be,{children:"Enabled"})]})]}),s.jsxs(un,{children:[s.jsx(ce,{variant:"outline",onClick:()=>o(!1),children:"Cancel"}),s.jsx(ce,{disabled:f||!c.name||N&&!c.apiKey,onClick:U,children:f?"Creating…":N?"Create":"Create and add accounts"})]})]})]})}),s.jsxs(rt,{children:[s.jsxs(lt,{children:[s.jsx(st,{className:"text-base",children:"All providers"}),s.jsxs(Dn,{children:[n.length," total"]})]}),s.jsx(ot,{children:s.jsxs(Xn,{children:[s.jsx(Fn,{children:s.jsxs(Fe,{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(Qn,{children:[n.length===0&&s.jsx(Fe,{children:s.jsx(fe,{colSpan:7,className:"text-center text-muted-foreground",children:"No providers yet."})}),n.map(I=>s.jsxs(h.Fragment,{children:[s.jsxs(Fe,{children:[s.jsxs(fe,{className:"font-medium",children:[I.name," ",s.jsx("span",{className:"text-xs text-muted-foreground",children:I.slug})]}),s.jsx(fe,{children:s.jsx(nt,{variant:"outline",children:I.type})}),s.jsx(fe,{className:"text-xs text-muted-foreground",children:I.baseUrl}),s.jsx(fe,{children:I.modelCount}),s.jsx(fe,{children:s.jsx(nt,{variant:I.health==="healthy"?"success":I.health==="down"?"destructive":"secondary",children:I.health})}),s.jsx(fe,{children:I.enabled?"Yes":"No"}),s.jsx(fe,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end gap-1",children:[I.type==="codex"&&s.jsxs(s.Fragment,{children:[s.jsxs(ce,{size:"sm",variant:M[I.id]?"secondary":"outline","aria-expanded":!!M[I.id],onClick:()=>O(Q=>({...Q,[I.id]:!Q[I.id]})),children:[M[I.id]?s.jsx(R0,{className:"h-3 w-3"}):s.jsx(T0,{className:"h-3 w-3"}),s.jsx("span",{className:"ml-1",children:"Accounts"})]}),s.jsxs(ce,{size:"sm",variant:"outline",onClick:()=>A(I),children:[s.jsx(Om,{className:"mr-1 h-3 w-3"})," Import models"]})]}),s.jsx(ce,{size:"sm",variant:"outline",disabled:g===I.id,onClick:()=>V(I.id),children:s.jsx(xN,{className:"h-3 w-3"})}),s.jsx(ce,{size:"sm",variant:"outline",onClick:()=>te(I),children:"✎"}),s.jsx(ce,{size:"sm",variant:"outline",onClick:()=>j(I.id),children:s.jsx(pi,{className:"h-3 w-3"})})]})})]}),I.type==="codex"&&M[I.id]&&s.jsx(Fe,{children:s.jsx(fe,{colSpan:7,className:"bg-muted/30",children:s.jsx(V_,{providerId:I.id,providerName:I.name})})})]},I.id))]})]})})]}),D&&s.jsx(X_,{providerId:D.id,providerName:D.name,open:!0,onOpenChange:I=>{I||A(null)},onImported:()=>void k()}),s.jsx(vn,{open:!!x,onOpenChange:I=>{I||(y(null),w(Ml))},children:s.jsxs(on,{children:[s.jsx(cn,{children:s.jsx(dn,{children:"Edit provider"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Name"}),s.jsx(Re,{value:b.name,onChange:I=>w({...b,name:I.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Slug (optional)"}),s.jsx(Re,{value:b.slug,onChange:I=>w({...b,slug:I.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Type"}),s.jsxs(Gn,{value:b.type,onValueChange:I=>w({...b,type:I}),children:[s.jsx(kn,{children:s.jsx(Kn,{})}),s.jsxs(_n,{children:[s.jsx(tt,{value:"openai",children:"OpenAI-compatible"}),s.jsx(tt,{value:"anthropic",children:"Anthropic-compatible"}),s.jsx(tt,{value:"codex",children:"Codex OAuth"})]})]})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Base URL"}),s.jsx(Re,{value:b.baseUrl,onChange:I=>w({...b,baseUrl:I.target.value})})]}),b.type==="codex"?s.jsxs("p",{className:"rounded-md border border-dashed p-3 text-xs text-muted-foreground",children:[s.jsx(AN,{className:"mr-1 inline h-3 w-3"})," Codex credentials live in the account pool — manage them from the Accounts panel."]}):s.jsxs("div",{children:[s.jsx(be,{children:"API key (leave empty to keep current)"}),s.jsx(Re,{type:"password",value:b.apiKey,onChange:I=>w({...b,apiKey:I.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Custom headers (JSON)"}),s.jsx(Re,{value:b.customHeaders,onChange:I=>w({...b,customHeaders:I.target.value}),placeholder:'{"X-Org":"acme"}'})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ha,{checked:b.enabled,onCheckedChange:I=>w({...b,enabled:I})}),s.jsx(be,{children:"Enabled"})]})]}),s.jsxs(un,{children:[s.jsx(ce,{variant:"outline",onClick:()=>{y(null),w(Ml)},children:"Cancel"}),s.jsx(ce,{disabled:f||!b.name,onClick:$,children:"Save changes"})]})]})}),s.jsx(Iw,{open:!!E,onOpenChange:I=>{I||j(null)},children:s.jsxs(dp,{children:[s.jsxs(Pw,{children:[s.jsx(fp,{children:"Delete provider?"}),s.jsx(hp,{children:"This will soft-disable the provider if models depend on it."})]}),s.jsxs(Hw,{children:[s.jsx(pp,{children:"Cancel"}),s.jsx(mp,{disabled:C,onClick:I=>{E&&(I.preventDefault(),H(E))},children:C?"Deleting…":"Delete"})]})]})})]})}const hm=["image_input","audio_input","tools","structured_output","reasoning","chat","streaming"],J_=["unknown","yes","no"];function W_(n,a){return n[a]===!0?"yes":n[a]===!1?"no":"unknown"}function e4(n){const a={};for(const l of hm)a[l]=n[l]==="yes"?!0:n[l]==="no"?!1:null;return a}function t4(){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),[E,j]=h.useState(!1),[C,R]=h.useState(""),[D,A]=h.useState(""),[M,O]=h.useState(null),[N,k]=h.useState(!1),[U,V]=h.useState(null),[te,$]=h.useState(null),[H,I]=h.useState(null),[Q,de]=h.useState({}),[_,q]=h.useState(!1),ee=G=>{const ie={};for(const he of hm)ie[he]=W_(G.capabilities,he);de(ie),I(G)},W=async()=>{if(H){q(!0);try{await xe.patch("/api/admin/models",{id:H.id,capabilities:e4(Q)}),me.success("Capabilities updated"),I(null),ne()}catch(G){me.error(G.message)}finally{q(!1)}}},ne=async()=>{const[G,ie]=await Promise.all([xe.get("/api/admin/models"),xe.get("/api/admin/providers")]);a(G.models),o(ie.providers)};h.useEffect(()=>{ne()},[]);const z=n.filter(G=>!(c!=="all"&&G.providerId!==c||C&&!G.publicModelId.toLowerCase().includes(C.toLowerCase()))),P=x.filter(G=>{if(!D)return!0;const ie=D.toLowerCase();return G.upstreamId.toLowerCase().includes(ie)||G.displayName.toLowerCase().includes(ie)}),Z=async()=>{if(g){j(!0);try{const G=await xe.post(`/api/admin/providers/${g}/discover`);y(G.models),w(new Set)}catch(G){me.error(G.message)}finally{j(!1)}}},se=async()=>{if(b.size!==0)try{const G=await xe.post("/api/admin/models/import",{providerId:g,modelIds:Array.from(b)});me.success(`Imported ${G.imported} of ${G.requested}`),p(!1),y([]),w(new Set),ne()}catch(G){me.error(G.message)}},ge=async()=>{if(te)try{await xe.del(`/api/admin/models/${te.id}`),me.success("Model deleted"),$(null),ne()}catch(G){me.error(G.message)}},ye=async G=>{var he,pe,Ae;O(G),k(!0);const ie=Date.now();V({phase:"streaming",startedAt:ie,text:"",progress:{}});try{const Ce=await globalThis.fetch(`/api/admin/models/${G}/test-stream`,{method:"POST",headers:{"content-type":"application/json"},credentials:"include",body:"{}"});if(!Ce.ok){const He=await Ce.text().catch(()=>"");V({phase:"error",model:G,error:`HTTP ${Ce.status}: ${He}`});return}const Oe=(he=Ce.body)==null?void 0:he.getReader();if(!Oe){V({phase:"error",model:G,error:"No response body"});return}const Qe=new TextDecoder;let We="",oe="",Le=!1;for(;!Le;){const{value:He,done:_t}=await Oe.read();Le=_t,He&&(We+=Qe.decode(He,{stream:!0}));let jt;for(;(jt=We.indexOf(`
388
+
389
+ `))>=0;){const Ft=We.slice(0,jt);We=We.slice(jt+2);const hn=Ft.split(`
390
+ `);let Qt="",Ct="";for(const xn of hn)xn.startsWith("event: ")?Qt=xn.slice(7):xn.startsWith("data: ")&&(Ct=xn.slice(6));if(Ct){if(Qt===""||Qt==="message")try{const At=(pe=JSON.parse(Ct).choices)==null?void 0:pe[0];(Ae=At==null?void 0:At.delta)!=null&&Ae.content&&(oe+=At.delta.content),V(Mt=>{if(!Mt||Mt.phase!=="streaming")return Mt;const mn=Date.now()-ie,pa=Mt.progress.ttftMs??mn;return{...Mt,text:oe,progress:{ttftMs:pa,elapsedMs:mn}}})}catch{}if(Qt==="test_meta")try{const xn=JSON.parse(Ct);V({phase:"done",model:G,result:xn,text:oe})}catch{}if(Qt==="test_error")try{const xn=JSON.parse(Ct);V({phase:"error",model:G,error:xn.message})}catch{}}}}V(He=>!He||He.phase==="streaming"?{phase:"error",model:G,error:"Stream ended unexpectedly"}:He)}catch(Ce){V({phase:"error",model:G,error:Ce.message})}finally{O(null)}};return s.jsxs("div",{children:[s.jsx(Va,{title:"Models",description:"Physical models imported from providers",actions:s.jsxs(vn,{open:f,onOpenChange:p,children:[s.jsx(bi,{asChild:!0,children:s.jsxs(ce,{variant:"outline",children:[s.jsx(Om,{className:"mr-1 h-4 w-4"})," Fetch models"]})}),s.jsxs(on,{className:"max-w-2xl",children:[s.jsx(cn,{children:s.jsx(dn,{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(Gn,{value:g,onValueChange:v,children:[s.jsx(kn,{children:s.jsx(Kn,{placeholder:"Choose provider"})}),s.jsx(_n,{children:l.map(G=>s.jsx(tt,{value:G.id,children:G.name},G.id))})]})}),s.jsx(ce,{onClick:Z,disabled:!g||E,children:E?"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(km,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),s.jsx(Re,{className:"pl-8",placeholder:"Search models…",value: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(Eu,{className:"h-4 w-4"})})]})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:"text-sm text-muted-foreground",children:[P.length," / ",x.length," · ",b.size," selected"]}),s.jsx(ce,{variant:"outline",size:"sm",onClick:()=>w(new Set(P.filter(G=>!G.alreadyImported).map(G=>G.upstreamId))),children:"Select All (new)"}),s.jsx(ce,{variant:"outline",size:"sm",onClick:()=>w(new Set),children:"Clear"})]})]}),s.jsx("div",{className:"max-h-80 space-y-1 overflow-auto rounded border p-2",children:P.length===0&&x.length>0?s.jsx("div",{className:"text-center text-sm text-muted-foreground py-4",children:"No models match your search."}):P.map(G=>s.jsxs("label",{className:"flex items-center gap-2 rounded p-1 text-sm hover:bg-accent",children:[s.jsx(Il,{checked:b.has(G.upstreamId),onCheckedChange:ie=>{const he=new Set(b);ie?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(nt,{variant:"secondary",children:"imported"})]},G.upstreamId))})]})]}),s.jsxs(un,{children:[s.jsx(ce,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),s.jsxs(ce,{disabled:b.size===0,onClick:se,children:["Import ",b.size||""]})]})]})]})}),s.jsxs(rt,{children:[s.jsxs(lt,{children:[s.jsx(st,{className:"text-base",children:"All models"}),s.jsxs(Dn,{children:[n.length," total"]})]}),s.jsxs(ot,{children:[s.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[s.jsxs(Gn,{value:c,onValueChange:u,children:[s.jsx(kn,{className:"w-56",children:s.jsx(Kn,{})}),s.jsxs(_n,{children:[s.jsx(tt,{value:"all",children:"All providers"}),l.map(G=>s.jsx(tt,{value:G.id,children:G.name},G.id))]})]}),s.jsx(Re,{className:"max-w-xs",placeholder:"Search public ID",value:C,onChange:G=>R(G.target.value)})]}),s.jsxs(Xn,{children:[s.jsx(Fn,{children:s.jsxs(Fe,{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(Qn,{children:[z.length===0&&s.jsx(Fe,{children:s.jsx(fe,{colSpan:7,className:"text-center text-muted-foreground",children:"No models"})}),z.map(G=>s.jsxs(Fe,{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(([,ie])=>ie===!0).slice(0,4).map(([ie])=>s.jsx(nt,{variant:"outline",className:"mr-1",children:ie},ie))}),s.jsx(fe,{children:G.upstreamAvailable?s.jsx(nt,{variant:"success",children:"up"}):s.jsx(nt,{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(ce,{size:"sm",variant:"outline",onClick:()=>ee(G),disabled:M!==null,children:[s.jsx(CN,{className:"h-3.5 w-3.5"})," Capabilities"]}),s.jsxs(ce,{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(dN,{className:"h-3.5 w-3.5"})," Test"]}),s.jsxs(ce,{size:"sm",variant:"destructive",onClick:()=>$(G),disabled:M!==null,children:[s.jsx(pi,{className:"h-3.5 w-3.5"})," Xoá"]})]})})]},G.id))]})]})]})]}),s.jsx(vn,{open:!!te,onOpenChange:G=>{G||$(null)},children:s.jsxs(on,{className:"max-w-md",children:[s.jsx(cn,{children:s.jsx(dn,{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(un,{children:[s.jsx(ce,{variant:"outline",onClick:()=>$(null),children:"Huỷ"}),s.jsx(ce,{variant:"destructive",onClick:ge,children:"Xoá"})]})]})}),s.jsx(vn,{open:H!==null,onOpenChange:G=>{G||I(null)},children:s.jsxs(on,{className:"max-w-lg",children:[s.jsx(cn,{children:s.jsxs(dn,{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)."]}),hm.map(G=>{var he;const ie=(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:ie===void 0?"discovered: unknown":`discovered: ${String(ie)}`})]}),s.jsx("div",{className:"flex gap-1",children:J_.map(pe=>s.jsx(ce,{size:"sm",variant:Q[G]===pe?"default":"outline",onClick:()=>de(Ae=>({...Ae,[G]:pe})),children:pe==="unknown"?"Unknown":pe==="yes"?"Yes":"No"},pe))})]},G)})]}),s.jsxs(un,{children:[s.jsx(ce,{variant:"outline",onClick:()=>I(null),children:"Huỷ"}),s.jsx(ce,{onClick:W,disabled:_,children:_?"Saving…":"Lưu"})]})]})}),s.jsx(vn,{open:N,onOpenChange:k,children:s.jsxs(on,{className:"max-w-2xl",children:[s.jsx(cn,{children:s.jsx(dn,{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(nt,{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,ie)=>s.jsxs("div",{className:"flex items-center gap-2 rounded border p-2 text-xs",children:[s.jsx(nt,{variant:G.success?"success":"destructive",children:G.success?"OK":"FAIL"}),s.jsxs("span",{className:"font-mono",children:[G.providerName," / ",G.modelId]}),s.jsxs("span",{className:"text-muted-foreground",children:[G.latencyMs," ms"]}),G.failureReason&&s.jsx("span",{className:"text-destructive",children:G.failureReason})]},ie))})]})]}),U&&U.phase==="error"&&s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsx(nt,{variant:"destructive",children:"Thất bại"}),s.jsx("p",{className:"text-destructive",children:U.error})]}),s.jsx(un,{children:s.jsx(ce,{variant:"outline",onClick:()=>k(!1),children:"Đóng"})})]})})]})}function n4(){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),[E,j]=h.useState({name:"",slug:"",mode:"fallback",enabled:!0,members:[]}),[C,R]=h.useState({name:"",slug:"",mode:"fallback",enabled:!0,members:[]}),D=async()=>{const[$,H]=await Promise.all([xe.get("/api/admin/combos"),xe.get("/api/admin/models")]);a($.combos),o(H.models)};h.useEffect(()=>{D()},[]);const A=$=>{j(H=>({...H,members:[...H.members,{modelId:$,weight:1,position:H.members.length,enabled:!0}]}))},M=$=>{j(H=>({...H,members:H.members.filter((I,Q)=>Q!==$).map((I,Q)=>({...I,position:Q}))}))},O=async()=>{if(E.members.length===0){me.error("Add at least one member");return}y(!0);try{await xe.post("/api/admin/combos",{name:E.name,slug:E.slug||void 0,mode:E.mode,enabled:E.enabled,members:E.members}),me.success("Combo created"),u(!1),j({name:"",slug:"",mode:"fallback",enabled:!0,members:[]}),D()}catch($){me.error($.message)}finally{y(!1)}},N=async $=>{try{const I=(await xe.get(`/api/admin/combos/${$.id}`)).combo;v(I.id),R({name:I.name,slug:I.publicModelId.startsWith("combo/")?I.slug:"",mode:I.mode,enabled:I.enabled,members:I.members.map(Q=>({modelId:Q.modelId,weight:Q.weight,position:Q.position,enabled:Q.enabled}))}),p(!0)}catch(H){me.error(H.message)}},k=async()=>{if(g){if(C.members.length===0){me.error("Add at least one member");return}w(!0);try{await xe.patch("/api/admin/combos",{id:g,name:C.name,slug:C.slug||void 0,mode:C.mode,enabled:C.enabled,members:C.members}),me.success("Combo updated"),p(!1),v(null),D()}catch($){me.error($.message)}finally{w(!1)}}},U=$=>{R(H=>({...H,members:[...H.members,{modelId:$,weight:1,position:H.members.length,enabled:!0}]}))},V=$=>{R(H=>({...H,members:H.members.filter((I,Q)=>Q!==$).map((I,Q)=>({...I,position:Q}))}))},te=async $=>{if(confirm("Delete this combo?"))try{await xe.del(`/api/admin/combos/${$}`),me.success("Combo removed"),D()}catch(H){me.error(H.message)}};return s.jsxs("div",{children:[s.jsx(Va,{title:"Combos",description:"Virtual models combining physical models",actions:s.jsxs(vn,{open:c,onOpenChange:u,children:[s.jsx(bi,{asChild:!0,children:s.jsxs(ce,{children:[s.jsx(mi,{className:"mr-1 h-4 w-4"})," New combo"]})}),s.jsxs(on,{className:"max-w-2xl",children:[s.jsx(cn,{children:s.jsx(dn,{children:"New combo"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Name"}),s.jsx(Re,{value:E.name,onChange:$=>j({...E,name:$.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Slug (optional — empty uses the name as the model ID)"}),s.jsx(Re,{value:E.slug,onChange:$=>j({...E,slug:$.target.value}),placeholder:"empty → gpt-5.5 · set → combo/gpt-5.5"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Mode"}),s.jsxs(Gn,{value:E.mode,onValueChange:$=>j({...E,mode:$}),children:[s.jsx(kn,{children:s.jsx(Kn,{})}),s.jsxs(_n,{children:[s.jsx(tt,{value:"fallback",children:"Fallback (ordered)"}),s.jsx(tt,{value:"weighted_round_robin",children:"Weighted round-robin"})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ha,{checked:E.enabled,onCheckedChange:$=>j({...E,enabled:$})}),s.jsx(be,{children:"Enabled"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Members"}),s.jsx(Kb,{models:l,addedIds:E.members.map($=>$.modelId),onAdd:A}),s.jsx("div",{className:"mt-2 space-y-1",children:E.members.map(($,H)=>{var I;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:(I=l.find(Q=>Q.id===$.modelId))==null?void 0:I.publicModelId}),s.jsx(Re,{type:"number",min:1,value:$.weight,onChange:Q=>{const de=Number(Q.target.value);j(_=>({..._,members:_.members.map((q,ee)=>ee===H?{...q,weight:de}:q)}))},className:"w-20"}),s.jsx(ce,{size:"sm",variant:"outline",onClick:()=>M(H),children:"Remove"})]},H)})})]})]}),s.jsxs(un,{children:[s.jsx(ce,{variant:"outline",onClick:()=>u(!1),children:"Cancel"}),s.jsx(ce,{disabled:!E.name||x,onClick:O,children:x?"Creating…":"Create"})]})]})]})}),s.jsxs(rt,{children:[s.jsxs(lt,{children:[s.jsx(st,{className:"text-base",children:"All combos"}),s.jsxs(Dn,{children:[n.length," total"]})]}),s.jsx(ot,{children:s.jsxs(Xn,{children:[s.jsx(Fn,{children:s.jsxs(Fe,{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(Qn,{children:[n.length===0&&s.jsx(Fe,{children:s.jsx(fe,{colSpan:6,className:"text-center text-muted-foreground",children:"No combos yet."})}),n.map($=>s.jsxs(Fe,{children:[s.jsx(fe,{className:"font-mono text-xs",children:$.publicModelId}),s.jsx(fe,{children:s.jsx(nt,{variant:"outline",children:$.mode})}),s.jsx(fe,{children:$.memberCount}),s.jsx(fe,{children:$.healthyMemberCount}),s.jsx(fe,{children:$.enabled?"Yes":"No"}),s.jsx(fe,{className:"text-right",children:s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[s.jsxs(ce,{size:"sm",variant:"outline",onClick:()=>void N($),children:[s.jsx(EN,{className:"h-3.5 w-3.5"})," Sửa"]}),s.jsxs(ce,{size:"sm",variant:"destructive",onClick:()=>te($.id),children:[s.jsx(pi,{className:"h-3.5 w-3.5"})," Xoá"]})]})})]},$.id))]})]})})]}),s.jsx(vn,{open:f,onOpenChange:p,children:s.jsxs(on,{className:"max-w-2xl",children:[s.jsx(cn,{children:s.jsx(dn,{children:"Edit combo"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Name"}),s.jsx(Re,{value:C.name,onChange:$=>R({...C,name:$.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Slug (optional — leave empty to use the name as the model ID)"}),s.jsx(Re,{value:C.slug,onChange:$=>R({...C,slug:$.target.value}),placeholder:"empty → gpt-5.5 · set → combo/gpt-5.5"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Mode"}),s.jsxs(Gn,{value:C.mode,onValueChange:$=>R({...C,mode:$}),children:[s.jsx(kn,{children:s.jsx(Kn,{})}),s.jsxs(_n,{children:[s.jsx(tt,{value:"fallback",children:"Fallback (ordered)"}),s.jsx(tt,{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:$=>R({...C,enabled:$})}),s.jsx(be,{children:"Enabled"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Members"}),s.jsx(Kb,{models:l,addedIds:C.members.map($=>$.modelId),onAdd:U}),s.jsx("div",{className:"mt-2 space-y-1",children:C.members.map(($,H)=>{var I;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:(I=l.find(Q=>Q.id===$.modelId))==null?void 0:I.publicModelId}),s.jsx(Re,{type:"number",min:1,value:$.weight,onChange:Q=>{const de=Number(Q.target.value);R(_=>({..._,members:_.members.map((q,ee)=>ee===H?{...q,weight:de}:q)}))},className:"w-20"}),s.jsx(ce,{size:"sm",variant:"outline",onClick:()=>V(H),children:"Remove"})]},H)})})]})]}),s.jsxs(un,{children:[s.jsx(ce,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),s.jsx(ce,{disabled:!C.name||b,onClick:k,children:b?"Saving…":"Save"})]})]})})]})}function Kb({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(km,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),s.jsx(Re,{className:"pl-8",placeholder:"Search models…",value: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(Eu,{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(ce,{size:"sm",variant:"ghost",onClick:()=>l(p.id),children:"+ Add"})]},p.id))})]})}function a4(){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,E]=await Promise.all([xe.get("/api/admin/aliases"),xe.get("/api/admin/models"),xe.get("/api/admin/combos")]);a(b.aliases),o(w.models),u(E.combos)};h.useEffect(()=>{x()},[]);const y=async()=>{try{await xe.post("/api/admin/aliases",g),me.success("Alias created"),p(!1),v({alias:"",targetKind:"model",targetId:"",enabled:!0}),x()}catch(b){me.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(vn,{open:f,onOpenChange:p,children:[s.jsx(bi,{asChild:!0,children:s.jsxs(ce,{children:[s.jsx(mi,{className:"mr-1 h-4 w-4"})," New alias"]})}),s.jsxs(on,{children:[s.jsx(cn,{children:s.jsx(dn,{children:"New alias"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Alias"}),s.jsx(Re,{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(Gn,{value:g.targetKind,onValueChange:b=>v({...g,targetKind:b}),children:[s.jsx(kn,{children:s.jsx(Kn,{})}),s.jsxs(_n,{children:[s.jsx(tt,{value:"model",children:"Model"}),s.jsx(tt,{value:"combo",children:"Combo"})]})]})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Target"}),s.jsxs(Gn,{value:g.targetId,onValueChange:b=>v({...g,targetId:b}),children:[s.jsx(kn,{children:s.jsx(Kn,{placeholder:"Choose target"})}),s.jsx(_n,{children:(g.targetKind==="model"?l:c).map(b=>s.jsx(tt,{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(un,{children:[s.jsx(ce,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),s.jsx(ce,{disabled:!g.alias||!g.targetId,onClick:y,children:"Create"})]})]})]})}),s.jsxs(rt,{children:[s.jsxs(lt,{children:[s.jsx(st,{className:"text-base",children:"All aliases"}),s.jsxs(Dn,{children:[n.length," total"]})]}),s.jsx(ot,{children:s.jsxs(Xn,{children:[s.jsx(Fn,{children:s.jsxs(Fe,{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(Qn,{children:[n.length===0&&s.jsx(Fe,{children:s.jsx(fe,{colSpan:5,className:"text-center text-muted-foreground",children:"No aliases yet."})}),n.map(b=>s.jsxs(Fe,{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(nt,{variant:"outline",children:b.targetKind})}),s.jsx(fe,{children:b.enabled?"Yes":"No"}),s.jsx(fe,{className:"text-right",children:s.jsx(ce,{size:"sm",variant:"outline",onClick:async()=>{await xe.del(`/api/admin/aliases/${b.id}`),me.success("Removed"),x()},children:"Delete"})})]},b.id))]})]})})]})]})}function r4(){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),[E,j]=h.useState({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""}),C=async()=>{const[N,k,U]=await Promise.all([xe.get("/api/admin/api-keys"),xe.get("/api/admin/models"),xe.get("/api/admin/combos")]);a(N.apiKeys),o(k.models),u(U.combos)};h.useEffect(()=>{C()},[]);const R=async()=>{try{if(g){await xe.patch("/api/admin/api-keys",{id:g,name:E.name,expiresAt:E.expiresAt||null,allowAllModels:E.allowAll,permissions:E.allowAll?[]:E.permissions,rpmLimit:E.rpmLimit?Number(E.rpmLimit):null,tpmLimit:E.tpmLimit?Number(E.tpmLimit):null,maxConcurrent:E.concurrency?Number(E.concurrency):null}),p(!1),v(null),j({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""}),me.success("Key updated"),C();return}const N=await xe.post("/api/admin/api-keys",{name:E.name,expiresAt:E.expiresAt||null,allowAllModels:E.allowAll,permissions:E.allowAll?void 0:E.permissions,rpmLimit:E.rpmLimit?Number(E.rpmLimit):null,tpmLimit:E.tpmLimit?Number(E.tpmLimit):null,maxConcurrent:E.concurrency?Number(E.concurrency):null,...E.customSecret.trim()?{secret:E.customSecret.trim()}:{}});p(!1),y({secret:N.secret,name:N.name}),j({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""}),C()}catch(N){me.error(N.message)}},D=async N=>{try{const U=((await xe.get(`/api/admin/api-keys/${N.id}`)).apiKey.permissions??[]).filter(V=>V.targetKind==="model"||V.targetKind==="combo");v(N.id),j({name:N.name,expiresAt:N.expiresAt?N.expiresAt.slice(0,16):"",allowAll:N.allowAllModels,permissions:U,rpmLimit:N.rpmLimit!=null?String(N.rpmLimit):"",tpmLimit:N.tpmLimit!=null?String(N.tpmLimit):"",concurrency:N.concurrencyLimit!=null?String(N.concurrencyLimit):"",customSecret:""}),p(!0)}catch(k){me.error(k.message)}},A=()=>{p(!1),v(null),j({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""})},M=async(N,k)=>{try{await xe.patch("/api/admin/api-keys",{id:N,enabled:!k}),me.success(k?"Key disabled":"Key enabled"),C()}catch(U){me.error(U.message)}},O=async N=>{if(window.confirm("Delete this API key? This cannot be undone."))try{await xe.del(`/api/admin/api-keys/${N}`),me.success("Key deleted"),C()}catch(k){me.error(k.message)}};return s.jsxs("div",{children:[s.jsx(Va,{title:"API Keys",description:"Gateway bearer keys for client applications",actions:s.jsxs(vn,{open:f,onOpenChange:N=>{N?p(!0):A()},children:[s.jsx(bi,{asChild:!0,children:s.jsxs(ce,{children:[s.jsx(mi,{className:"mr-1 h-4 w-4"})," New key"]})}),s.jsxs(on,{className:"max-w-2xl",children:[s.jsx(cn,{children:s.jsx(dn,{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(Re,{value:E.name,onChange:N=>j({...E,name:N.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Expires (optional)"}),s.jsx(Re,{type:"datetime-local",value:E.expiresAt,onChange:N=>j({...E,expiresAt:N.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(Re,{value:E.rpmLimit,onChange:N=>j({...E,rpmLimit:N.target.value}),type:"number"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"TPM limit"}),s.jsx(Re,{value:E.tpmLimit,onChange:N=>j({...E,tpmLimit:N.target.value}),type:"number"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Concurrency"}),s.jsx(Re,{value:E.concurrency,onChange:N=>j({...E,concurrency:N.target.value}),type:"number"})]})]}),!g&&s.jsxs("div",{children:[s.jsx(be,{children:"Key value (optional)"}),s.jsx(Re,{value:E.customSecret,onChange:N=>j({...E,customSecret:N.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:E.allowAll,onCheckedChange:N=>j({...E,allowAll:N})}),s.jsx(be,{children:"Allow all current and future models"})]}),!E.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(N=>({targetKind:"model",targetId:N.id,label:N.publicModelId})),...c.map(N=>({targetKind:"combo",targetId:N.id,label:N.publicModelId}))].map(N=>{const k=E.permissions.some(U=>U.targetKind===N.targetKind&&U.targetId===N.targetId);return s.jsxs("label",{className:"flex items-center gap-2 rounded p-1 text-sm hover:bg-accent",children:[s.jsx(Il,{checked:k,onCheckedChange:U=>{j(V=>({...V,permissions:U?[...V.permissions,{targetKind:N.targetKind,targetId:N.targetId}]:V.permissions.filter(te=>!(te.targetKind===N.targetKind&&te.targetId===N.targetId))}))}}),s.jsx("span",{className:"font-mono text-xs",children:N.label}),s.jsx(nt,{variant:"outline",className:"ml-1",children:N.targetKind})]},`${N.targetKind}:${N.targetId}`)})})]})]}),s.jsxs(un,{children:[s.jsx(ce,{variant:"outline",onClick:A,children:"Cancel"}),s.jsx(ce,{disabled:!E.name,onClick:R,children:g?"Save changes":"Create"})]})]})]})}),s.jsxs(rt,{children:[s.jsxs(lt,{children:[s.jsx(st,{className:"text-base",children:"All keys"}),s.jsxs(Dn,{children:[n.length," total"]})]}),s.jsx(ot,{children:s.jsxs(Xn,{children:[s.jsx(Fn,{children:s.jsxs(Fe,{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(Qn,{children:[n.length===0&&s.jsx(Fe,{children:s.jsx(fe,{colSpan:6,className:"text-center text-muted-foreground",children:"No API keys yet."})}),n.map(N=>s.jsxs(Fe,{children:[s.jsx(fe,{className:"font-medium",children:N.name}),s.jsxs(fe,{className:"font-mono text-xs",children:[N.keyPrefix,"…"]}),s.jsx(fe,{children:N.enabled?s.jsx(nt,{variant:"success",children:"enabled"}):s.jsx(nt,{variant:"destructive",children:"disabled"})}),s.jsx(fe,{children:N.allowAllModels?"all":`${N.modelScopeCount} scoped`}),s.jsx(fe,{className:"text-xs",children:[N.rpmLimit,N.tpmLimit,N.concurrencyLimit].map((k,U)=>k?["","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:[N.secret&&s.jsxs(s.Fragment,{children:[s.jsx(ce,{size:"sm",variant:"ghost",title:"Copy secret",onClick:()=>{navigator.clipboard.writeText(N.secret),me.success("Copied")},children:s.jsx(tu,{className:"h-3.5 w-3.5"})}),s.jsx(ce,{size:"sm",variant:"ghost",title:"Show secret",onClick:()=>w({secret:N.secret,name:N.name}),children:s.jsx(cN,{className:"h-3.5 w-3.5"})})]}),s.jsx(ce,{size:"sm",variant:"ghost",title:"Edit",onClick:()=>void D(N),children:s.jsx(vN,{className:"h-3.5 w-3.5"})}),s.jsxs(ce,{size:"sm",variant:"outline",onClick:()=>M(N.id,N.enabled),children:[N.enabled?s.jsx(ZE,{className:"mr-1 h-3.5 w-3.5"}):s.jsx(Cu,{className:"mr-1 h-3.5 w-3.5"}),N.enabled?"Disable":"Enable"]}),s.jsx(ce,{size:"sm",variant:"destructive",onClick:()=>O(N.id),children:s.jsx(pi,{className:"h-3.5 w-3.5"})})]})})]},N.id))]})]})})]}),s.jsx(vn,{open:!!x,onOpenChange:N=>{N||y(null)},children:s.jsxs(on,{children:[s.jsxs(cn,{children:[s.jsx(dn,{children:"API key created"}),s.jsx(Ll,{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(un,{children:[s.jsxs(ce,{onClick:()=>{x&&(navigator.clipboard.writeText(x.secret),me.success("Copied"))},children:[s.jsx(tu,{className:"mr-1 h-4 w-4"})," Copy"]}),s.jsx(ce,{variant:"outline",onClick:()=>y(null),children:"I have saved it"})]})]})}),s.jsx(vn,{open:!!b,onOpenChange:N=>{N||w(null)},children:s.jsxs(on,{children:[s.jsxs(cn,{children:[s.jsxs(dn,{children:["API key: ",b==null?void 0:b.name]}),s.jsx(Ll,{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(un,{children:[s.jsxs(ce,{onClick:()=>{b&&(navigator.clipboard.writeText(b.secret),me.success("Copied"))},children:[s.jsx(tu,{className:"mr-1 h-4 w-4"})," Copy"]}),s.jsx(ce,{variant:"outline",onClick:()=>w(null),children:"Close"})]})]})})]})}const l4=3e3;function s4(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 o4(){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),E=50,j=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(E)),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 N=await xe.get(`/api/admin/requests?${O.toString()}`);a(N.requests),o(N.total);for(const k of N.requests)C.current.add(k.id)},[c,f]);h.useEffect(()=>{A()},[A]),h.useEffect(()=>{w(0)},[c,f]),h.useEffect(()=>{let O=!1,N=null;const k=new Set,U=()=>{O||(N=new EventSource(`/api/admin/requests/stream?since=${j.current}`),N.addEventListener("request",V=>{if(!O)try{const te=JSON.parse(V.data),$=new Date(te.createdAt).getTime();if(Number.isFinite($)&&(j.current=Math.max(j.current,$)),C.current.has(te.id))return;C.current.add(te.id),w(H=>H+1),D.current===0&&s4(te,R.current)&&(a(H=>H.some(I=>I.id===te.id)?H:[te,...H].slice(0,E)),o(H=>H+1))}catch{}}),N.onerror=()=>{N==null||N.close(),N=null,O||k.add(setTimeout(U,l4))})};return U(),()=>{O=!0,N==null||N.close();for(const V of k)clearTimeout(V);k.clear()}},[]);const M=async O=>{v(O);const N=await xe.get(`/api/admin/requests/${O}`);y(N)};return s.jsxs("div",{children:[s.jsx(Va,{title:"Requests",description:`${l} matching · live updates`}),s.jsxs(rt,{children:[s.jsxs(lt,{children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs(Gn,{value:f.success,onValueChange:O=>{u(0),p({...f,success:O})},children:[s.jsx(kn,{className:"w-36",children:s.jsx(Kn,{})}),s.jsxs(_n,{children:[s.jsx(tt,{value:"all",children:"All"}),s.jsx(tt,{value:"true",children:"Success"}),s.jsx(tt,{value:"false",children:"Failed"})]})]}),s.jsxs(Gn,{value:f.protocol,onValueChange:O=>{u(0),p({...f,protocol:O})},children:[s.jsx(kn,{className:"w-32",children:s.jsx(Kn,{})}),s.jsxs(_n,{children:[s.jsx(tt,{value:"all",children:"Any protocol"}),s.jsx(tt,{value:"openai",children:"OpenAI"}),s.jsx(tt,{value:"anthropic",children:"Anthropic"})]})]}),s.jsxs(Gn,{value:f.streaming,onValueChange:O=>{u(0),p({...f,streaming:O})},children:[s.jsx(kn,{className:"w-32",children:s.jsx(Kn,{})}),s.jsxs(_n,{children:[s.jsx(tt,{value:"all",children:"Any"}),s.jsx(tt,{value:"true",children:"Streaming"}),s.jsx(tt,{value:"false",children:"Non-stream"})]})]}),s.jsx(Re,{className:"max-w-xs",placeholder:"Model contains…",value:f.model,onChange:O=>{u(0),p({...f,model:O.target.value})}}),b>0&&s.jsxs(ce,{size:"sm",variant:"secondary",onClick:()=>{w(0),A()},children:[b," new request",b>1?"s":""," — refresh"]})]}),s.jsx(st,{className:"mt-3 text-base",children:"Results"})]}),s.jsxs(ot,{children:[s.jsxs(Xn,{children:[s.jsx(Fn,{children:s.jsxs(Fe,{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(Qn,{children:[n.length===0&&s.jsx(Fe,{children:s.jsx(fe,{colSpan:10,className:"text-center text-muted-foreground",children:"No requests yet."})}),n.map(O=>s.jsxs(Fe,{className:"cursor-pointer",onClick:()=>M(O.id),children:[s.jsx(fe,{className:"text-xs",children:zm(O.createdAt)}),s.jsx(fe,{children:O.success?s.jsx(nt,{variant:"success",children:O.httpStatus}):s.jsx(nt,{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:[Kt(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:[kl(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(nt,{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(ce,{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+E,l)," of ",l]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ce,{size:"sm",variant:"outline",disabled:c===0,onClick:()=>u(Math.max(0,c-E)),children:"Prev"}),s.jsx(ce,{size:"sm",variant:"outline",disabled:c+E>=l,onClick:()=>u(c+E),children:"Next"})]})]})]})]}),s.jsx(vn,{open:!!g,onOpenChange:O=>{O||(v(null),y(null))},children:s.jsxs(on,{className:"max-w-3xl",children:[s.jsx(cn,{children:s.jsxs(dn,{children:["Request ",uR(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(nt,{variant:"success",children:x.request.httpStatus}):s.jsx(nt,{variant:"destructive",children:x.request.httpStatus})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Latency"}),kl(x.request.totalLatencyMs)]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Tokens"}),"in ",Kt(x.request.inputTokens)," · out ",Kt(x.request.outputTokens)," · cache ",Kt(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(Xn,{children:[s.jsx(Fn,{children:s.jsxs(Fe,{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(Qn,{children:x.attempts.map(O=>s.jsxs(Fe,{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(nt,{variant:"success",children:String(O.statusCode??"OK")}):s.jsx(nt,{variant:"destructive",children:String(O.statusCode??"err")})}),s.jsx(fe,{className:"text-xs",children:kl(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 i4=Object.defineProperty,no=(n,a)=>i4(n,"name",{value:a,configurable:!0}),Ip="Tabs",[c4,p5]=Ln(Ip,[Uu]),LS=Uu(),[u4,Bp]=c4(Ip),d4=h.forwardRef(no(function(a,l){const{__scopeTabs:o,value:c,onValueChange:u,defaultValue:f,orientation:p="horizontal",dir:g,activationMode:v="automatic",...x}=a,y=vi(g),[b,w]=Ia({prop:c,onChange:u,defaultProp:f??"",caller:Ip});return s.jsx(u4,{scope:o,baseId:Ea(),value:b,onValueChange:w,orientation:p,dir:y,activationMode:v,children:s.jsx(Pe.div,{dir:y,"data-orientation":p,...x,ref:l})})},"Tabs")),f4="TabsList",h4=h.forwardRef(no(function(a,l){const{__scopeTabs:o,loop:c=!0,...u}=a,f=Bp(f4,o),p=LS(o);return s.jsx(Y1,{asChild:!0,...p,orientation:f.orientation,dir:f.dir,loop:c,children:s.jsx(Pe.div,{role:"tablist","aria-orientation":f.orientation,...u,ref:l})})},"TabsList")),m4="TabsTrigger",p4=h.forwardRef(no(function(a,l){const{__scopeTabs:o,value:c,disabled:u=!1,...f}=a,p=Bp(m4,o),g=LS(o),v=Pp(p.baseId,c),x=Hp(p.baseId,c),y=c===p.value;return s.jsx(G1,{asChild:!0,...g,focusable:!u,active:y,children:s.jsx(Pe.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:je(a.onMouseDown,b=>{!u&&b.button===0&&b.ctrlKey===!1?p.onValueChange(c):b.preventDefault()}),onKeyDown:je(a.onKeyDown,b=>{u||b.target!==b.currentTarget||[" ","Enter"].includes(b.key)&&p.onValueChange(c)}),onFocus:je(a.onFocus,()=>{const b=p.activationMode!=="manual";!y&&!u&&b&&p.onValueChange(c)})})})},"TabsTrigger")),g4="TabsContent",v4=h.forwardRef(no(function(a,l){const{__scopeTabs:o,value:c,forceMount:u,children:f,...p}=a,g=Bp(g4,o),v=Pp(g.baseId,c),x=Hp(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(Cr,{present:u||y,children:({present:w})=>s.jsx(Pe.div,{"data-state":y?"active":"inactive","data-orientation":g.orientation,role:"tabpanel","aria-labelledby":v,hidden:!w,id:x,tabIndex:0,...p,ref:l,style:{...a.style,animationDuration:b.current?"0s":void 0},children:w&&f})})},"TabsContent"));function Pp(n,a){return`${n}-trigger-${a}`}no(Pp,"makeTriggerId");function Hp(n,a){return`${n}-content-${a}`}no(Hp,"makeContentId");var x4=d4,US=h4,IS=p4,BS=v4;const PS=x4,qp=h.forwardRef(({className:n,...a},l)=>s.jsx(US,{ref:l,className:Ne("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",n),...a}));qp.displayName=US.displayName;const mr=h.forwardRef(({className:n,...a},l)=>s.jsx(IS,{ref:l,className:Ne("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=IS.displayName;const Us=h.forwardRef(({className:n,...a},l)=>s.jsx(BS,{ref:l,className:Ne("mt-2 ring-offset-background focus-visible:outline-none",n),...a}));Us.displayName=BS.displayName;const y4=3e3,b4=1600,w4=10,S4=3,j4=12,C4=10*6e4;function E4(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 N4(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,E]=h.useState(!0),[j,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),N=h.useRef([]),k=h.useRef([]);return h.useEffect(()=>{let U=!1;return E(!0),C(null),A.current=new Set,M.current=Date.now(),xe.get(`/api/admin/stats?preset=${n}`).then(V=>{if(!U){l(V),c(V.summary),D.current=V.summary,f(V.recent),g(V.providers),R.current=V.providers;for(const te of V.recent)A.current.add(te.id);E(!1)}}).catch(V=>{U||(C(V.message),E(!1))}),()=>{U=!0}},[n]),h.useEffect(()=>{let U=!1,V=null;const te=new Set,$=()=>{U||(V=new EventSource(`/api/admin/requests/stream?since=${M.current}`),V.addEventListener("request",I=>{if(!U)try{const Q=JSON.parse(I.data),de=new Date(Q.createdAt).getTime();if(Number.isFinite(de)&&(M.current=Math.max(M.current,de)),A.current.has(Q.id))return;if(A.current.add(Q.id),D.current&&c(E4(D.current,Q)),f(_=>_.some(q=>q.id===Q.id)?_:[Q,..._].slice(0,w4)),Q.providerId){R.current=R.current.map(W=>W.id===Q.providerId?{...W,requests:W.requests+1,errorRate:W.requests+1?(W.errorRate*W.requests+(Q.success?0:1))/(W.requests+1):0}:W),g(R.current);const _=`p${++O.current}`,q={id:_,providerId:Q.providerId,success:Q.success};N.current=[...N.current.slice(-(S4*4)),q],x(N.current);const ee=setTimeout(()=>{N.current=N.current.filter(W=>W.id!==_),x(N.current)},b4);te.add(ee)}k.current.some(_=>_.id===Q.id)&&(k.current=k.current.filter(_=>_.id!==Q.id),b(k.current))}catch{}}),V.addEventListener("request_started",I=>{if(!U)try{const Q=JSON.parse(I.data);if(!Q.providerId||Q.providerId==="")return;k.current=[...k.current.filter(de=>de.id!==Q.requestId).slice(-(j4-1)),{id:Q.requestId,providerId:Q.providerId,startedAt:Date.now(),ttftMs:Q.ttftMs??0}],b(k.current)}catch{}}),V.onerror=()=>{V==null||V.close(),V=null,U||te.add(setTimeout($,y4))})};$();const H=setInterval(()=>{const I=Date.now()-C4;k.current.some(Q=>Q.startedAt<I)&&(k.current=k.current.filter(Q=>Q.startedAt>=I),b(k.current))},3e4);return()=>{U=!0,V==null||V.close();for(const I of te)clearTimeout(I);te.clear(),clearInterval(H)}},[]),h.useEffect(()=>{const U=setInterval(()=>{xe.get("/api/admin/providers").then(V=>{const te=new Map(V.providers.map($=>[$.id,$]));R.current=R.current.map($=>{const H=te.get($.id);return H?{...$,health:H.health,enabled:H.enabled}:$}),g(R.current)}).catch(()=>{})},3e4);return()=>clearInterval(U)},[]),{snapshot:a,live:o??(a==null?void 0:a.summary)??R4,recent:u,providers:p,pulses:v,activeRoutes:y,loading:w,error:j}}const R4={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 HS({data:n,className:a,strokeClass:l="stroke-primary",fillClass:o}){if(n.length===0)return s.jsx("svg",{className:Ne("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,E=22-(y-p)/g*20;return`${w.toFixed(1)},${E.toFixed(1)}`}).join(" ");return s.jsxs("svg",{className:Ne("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 T4(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 A4({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:Ne("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 el({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&&T4(Math.abs(w-b),600,E=>v(b+(w>b?E:-E)))},[l]);const y=o==="percent"?Nu(g):o==="latency"?kl(g):Kt(Math.round(g));return s.jsxs(rt,{children:[s.jsxs(lt,{className:"flex flex-row items-center justify-between pb-1",children:[s.jsxs(st,{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(A4,{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(HS,{data:f,strokeClass:p??"stroke-primary",fillClass:"fill-primary/10"})]})]})}const qS=1e3,Xb=380,Fc=60,tl=qS/2,nl=720,kh=62,M4=260;function D4(n){return n==="healthy"?"fill-emerald-400":n==="degraded"?"fill-amber-400":"fill-red-400"}function Qc(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 O4({liveRequests:n,successRate:a,providers:l,pulses:o,activeRoutes:c}){const u=Xb/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(lt,{className:"pb-2",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(st,{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 ${qS} ${Xb}`,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)*kh,w=x.requests/p,E=Math.max(1.5,Math.min(6,2+w*8)),j=g.has(x.id);return s.jsxs("g",{children:[j&&s.jsx("path",{d:Qc(tl,u,nl-20,b),fill:"none",stroke:"hsl(var(--primary) / 0.25)",strokeWidth:E+6,strokeLinecap:"round"}),s.jsx("path",{d:Qc(tl,u,nl-20,b),fill:"none",stroke:j?"hsl(var(--primary))":"hsl(var(--border))",strokeWidth:j?E+1:E,strokeLinecap:"round",opacity:j?.95:.6,className:j?"route-active":void 0})]},x.id)}),s.jsx("path",{d:Qc(Fc+30,f,tl-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(j=>j.id===x.providerId);if(y===-1)return null;const b=60+y*kh,w=Qc(tl,u,nl-20,b),E=x.success?"var(--primary)":"#f87171";return s.jsxs("g",{filter:"url(#glow)",children:[s.jsx("circle",{r:5,fill:E,opacity:.9,children:s.jsx("animateMotion",{dur:"1.4s",fill:"freeze",path:w})}),s.jsx("circle",{r:9,fill:E,opacity:.25,children:s.jsx("animateMotion",{dur:"1.4s",fill:"freeze",path:w})})]},x.id)}),s.jsx("circle",{cx:Fc,cy:f,r:28,fill:"hsl(var(--card))",stroke:"hsl(var(--border))",strokeWidth:1.5}),s.jsx("text",{x:Fc,y:f-4,textAnchor:"middle",className:"fill-foreground",fontSize:12,fontWeight:600,children:Fb(n)}),s.jsx("text",{x:Fc,y:f+10,textAnchor:"middle",className:"fill-muted-foreground",fontSize:9,children:"requests"}),s.jsx("circle",{cx:tl,cy:u,r:36,fill:"hsl(var(--card))",stroke:"var(--primary)",strokeWidth:2}),s.jsx("image",{x:tl-12,y:u-16,width:24,height:24,href:"/logo.png"}),s.jsx("text",{x:tl,y:u+28,textAnchor:"middle",className:"fill-muted-foreground",fontSize:9,children:"AI Gateway"}),s.jsxs("text",{x:tl,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*kh,w=x.requests/p,E=!x.enabled||x.requests===0;return s.jsxs("g",{opacity:E?.4:1,children:[s.jsx("rect",{x:nl-20,y:b-14,width:M4,height:50,rx:8,fill:"hsl(var(--card))",stroke:"hsl(var(--border))",strokeWidth:1}),s.jsx("circle",{cx:nl-6,cy:b+10,r:4,className:D4(x.health)}),s.jsx("text",{x:nl+6,y:b-2,className:"fill-foreground",fontSize:12,fontWeight:500,children:x.name}),s.jsxs("text",{x:nl+6,y:b+12,className:"fill-muted-foreground",fontSize:10,children:[x.modelCount," model",x.modelCount!==1?"s":""," · ",Fb(x.requests)," req"]}),s.jsxs("text",{x:nl+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 Fb(n){return n>=1e6?`${(n/1e6).toFixed(1)}M`:n>=1e3?`${(n/1e3).toFixed(1)}K`:String(n)}function k4({rows:n}){return s.jsxs(rt,{children:[s.jsx(lt,{className:"pb-2",children:s.jsx(st,{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(Xn,{children:[s.jsx(Fn,{children:s.jsxs(Fe,{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(Qn,{children:n.map(a=>s.jsxs(Fe,{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 ",Kt(a.inputTokens)," · out ",Kt(a.outputTokens)]}),a.cacheReadTokens>0&&s.jsxs("span",{className:"ml-1 text-amber-600",children:["(+",Kt(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:dR(a.createdAt)})]},a.id))})]})})]})}const mm=34,Qb=2*Math.PI*mm;function _4(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 z4({successRate:n,averageLatencyMs:a,latencySpark:l}){const{stroke:o,text:c}=_4(n),u=Math.min(1,Math.max(0,n)),f=Qb*(1-u);return s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.jsxs(rt,{children:[s.jsx(lt,{className:"pb-2",children:s.jsx(st,{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:mm,fill:"none",stroke:"hsl(var(--border))",strokeWidth:7}),s.jsx("circle",{cx:"40",cy:"40",r:mm,fill:"none",stroke:o,strokeWidth:7,strokeLinecap:"round",strokeDasharray:Qb,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:Nu(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(lt,{className:"pb-2",children:s.jsx(st,{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:kl(a)}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Live average across the selected window"})]}),s.jsx(HS,{data:l,strokeClass:"stroke-amber-500",fillClass:"fill-amber-500/10",className:"h-10 w-28"})]})]})]})}function L4(){const[n,a]=h.useState("7d"),{snapshot:l,live:o,recent:c,providers:u,pulses:f,activeRoutes:p,loading:g,error:v}=N4(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 E=b.map(C=>C.requests),j=b.map(C=>C.avgLatency);return s.jsxs("div",{children:[s.jsx(Va,{title:"Statistics",description:"Real-time monitoring dashboard",actions:s.jsx(PS,{value:n,onValueChange:C=>void a(C),children:s.jsxs(qp,{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(el,{icon:N0,label:"Requests",value:x.totalRequests,delta:w(x.totalRequests,y.totalRequests),sparkData:E}),s.jsx(el,{icon:Cu,label:"Success rate",format:"percent",value:x.successRate,delta:w(x.successRate,y.successRate),sparkData:E,sparkStroke:"stroke-emerald-500"}),s.jsx(el,{icon:sN,label:"Total tokens",value:x.totalTokens,delta:w(x.totalTokens,y.totalTokens),sparkData:b.map(C=>C.inputTokens+C.outputTokens)}),s.jsx(el,{icon:oN,label:"Cache hit rate",format:"percent",value:x.cacheHitRate,delta:w(x.cacheHitRate,y.cacheHitRate),sparkData:b.map(C=>C.cacheRead)}),s.jsx(el,{icon:aN,label:"Avg latency",format:"latency",value:x.averageLatencyMs,delta:w(x.averageLatencyMs,y.averageLatencyMs),deltaInverse:!0,sparkData:j,sparkStroke:"stroke-amber-500"}),s.jsx(el,{icon:A0,label:"p95 latency",format:"latency",value:x.p95LatencyMs}),s.jsx(el,{icon:RN,label:"Avg TTFT",format:"latency",value:x.averageTtftMs??0}),s.jsx(el,{icon:bN,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(O4,{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(k4,{rows:c})}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs(rt,{children:[s.jsx(lt,{className:"pb-2",children:s.jsx(st,{className:"text-base",children:"Top Models"})}),s.jsx(ot,{children:s.jsxs(Xn,{children:[s.jsx(Fn,{children:s.jsxs(Fe,{children:[s.jsx(ve,{children:"Model"}),s.jsx(ve,{children:"Req"}),s.jsx(ve,{children:"Errors"}),s.jsx(ve,{children:"Tokens"})]})}),s.jsxs(Qn,{children:[l.topModels.length===0&&s.jsx(Fe,{children:s.jsx(fe,{colSpan:4,className:"text-muted-foreground text-center",children:"No data"})}),l.topModels.map(C=>s.jsxs(Fe,{children:[s.jsx(fe,{className:"font-mono text-xs",children:C.publicId}),s.jsx(fe,{className:"text-xs",children:Kt(C.requests)}),s.jsx(fe,{className:"text-xs",children:s.jsx("span",{className:C.errorRate>.1?"text-destructive":"text-muted-foreground",children:Nu(C.errorRate)})}),s.jsx(fe,{className:"text-xs",children:Kt(C.totalTokens)})]},C.publicId))]})]})})]}),s.jsxs(rt,{children:[s.jsx(lt,{className:"pb-2",children:s.jsx(st,{className:"text-base",children:"Top API Keys"})}),s.jsx(ot,{children:s.jsxs(Xn,{children:[s.jsx(Fn,{children:s.jsxs(Fe,{children:[s.jsx(ve,{children:"Key"}),s.jsx(ve,{children:"Requests"}),s.jsx(ve,{children:"Tokens"})]})}),s.jsxs(Qn,{children:[l.topApiKeys.length===0&&s.jsx(Fe,{children:s.jsx(fe,{colSpan:3,className:"text-muted-foreground text-center",children:"No data"})}),l.topApiKeys.map((C,R)=>s.jsxs(Fe,{children:[s.jsx(fe,{className:"text-xs",children:C.name}),s.jsx(fe,{className:"text-xs",children:Kt(C.requests)}),s.jsx(fe,{className:"text-xs",children:Kt(C.totalTokens)})]},R))]})]})})]})]})]}),s.jsx("div",{className:"mt-6",children:s.jsx(z4,{successRate:x.successRate,averageLatencyMs:x.averageLatencyMs,latencySpark:j})})]})}function U4(){const[n,a]=h.useState([]),[l,o]=h.useState(0);return h.useEffect(()=>{xe.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(lt,{children:s.jsx(st,{className:"text-base",children:"All entries"})}),s.jsx(ot,{children:s.jsxs(Xn,{children:[s.jsx(Fn,{children:s.jsxs(Fe,{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(Qn,{children:[n.length===0&&s.jsx(Fe,{children:s.jsx(fe,{colSpan:6,className:"text-center text-muted-foreground",children:"No audit events yet."})}),n.map(c=>s.jsxs(Fe,{children:[s.jsx(fe,{className:"text-xs",children:zm(c.createdAt)}),s.jsx(fe,{className:"font-mono text-xs",children:c.action}),s.jsx(fe,{children:c.success?s.jsx(nt,{variant:"success",children:"ok"}):s.jsx(nt,{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 pm={enabled:!0,sound:!0};let ui=pm,gm=!1,Zc=null;const vm=new Set;function $S(){for(const n of vm)n()}function VS(n=!1){return gm&&!n?Promise.resolve():(!n&&Zc||(Zc=(async()=>{try{const a=await xe.get("/api/admin/settings");ui={enabled:a.settings.notificationsEnabled??pm.enabled,sound:a.settings.notificationSoundEnabled??pm.sound},gm=!0,$S()}catch{}})()),Zc)}async function Zb(n){const a={};n.enabled!==void 0&&(a.notificationsEnabled=n.enabled),n.sound!==void 0&&(a.notificationSoundEnabled=n.sound),await xe.patch("/api/admin/settings",a),ui={...ui,...n},gm=!0,$S()}function I4(n){return vm.add(n),()=>vm.delete(n)}function YS(){return h.useSyncExternalStore(I4,()=>ui,()=>ui)}function B4(){const[n]=PE(),[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,E]=h.useState(!1),[j,C]=h.useState("idle"),[R,D]=h.useState(null),A=async(oe=!1)=>{C("checking"),D(null);try{const Le=await xe.get(`/api/admin/update/check${oe?"?force=1":""}`);b(Le),C("idle")}catch(Le){D(Le.message),C("error")}},M=async()=>{E(!0),C("installing"),D(null);try{const oe=await xe.post("/api/admin/update/run");C("restarting"),me.success(oe.message||"Update started — the gateway will restart shortly.");const Le=setInterval(()=>{fetch("/health").then(He=>{He.ok&&(clearInterval(Le),window.location.reload())}).catch(()=>{})},3e3);setTimeout(()=>clearInterval(Le),12e4)}catch(oe){me.error(oe.message),D(oe.message),C("error")}finally{E(!1)}},[O,N]=h.useState("disabled"),[k,U]=h.useState(""),[V,te]=h.useState(""),[$,H]=h.useState(""),[I,Q]=h.useState([]),[de,_]=h.useState(""),[q,ee]=h.useState(""),[W,ne]=h.useState(!1),[z,P]=h.useState(null),[Z,se]=h.useState(""),[ge,ye]=h.useState(""),[G,ie]=h.useState(""),he=async()=>{const oe=await xe.get("/api/admin/settings");l(oe.settings),g(oe.settings.adminIpAllow??""),x(oe.settings.adminIpBlock??"");const Le=await xe.get("/api/admin/settings/system");c(Le);try{const He=await xe.get("/api/admin/me");N(He.totpEnabled?"enabled":"disabled")}catch{}};if(h.useEffect(()=>{VS(!0)},[]),h.useEffect(()=>{he(),A(!0)},[]),!a)return s.jsx("div",{className:"text-muted-foreground",children:"Loading…"});const pe=async oe=>{try{await xe.patch("/api/admin/settings",oe),me.success("Saved"),he()}catch(Le){me.error(Le.message)}},Ae=async()=>{try{const oe=await xe.post("/api/admin/account/totp/begin");U(oe.secret),te(oe.qr),N("setup"),me.info("Scan the QR code with your authenticator app")}catch(oe){me.error(oe.message)}},Ce=async()=>{if(!$||$.length!==6){me.error("Enter a 6-digit code");return}try{const oe=await xe.post("/api/admin/account/totp/verify",{code:$});Q(oe.recoveryCodes),N("showingRecovery"),me.success("TOTP enabled successfully")}catch(oe){me.error(oe.message)}},Oe=async()=>{if(!de){me.error("Enter your password");return}if(!q){me.error("Enter a TOTP code or recovery code");return}try{await xe.post("/api/admin/account/totp/disable",{password:de,totp:q}),N("disabled"),_(""),ee(""),me.success("TOTP disabled"),he()}catch(oe){me.error(oe.message)}},Qe=async()=>{ne(!0);try{const oe=await xe.post("/api/admin/account/totp/recovery/regenerate",{password:de,totp:q});Q(oe.recoveryCodes),N("showingRecovery"),me.success("Recovery codes regenerated")}catch(oe){me.error(oe.message)}ne(!1)},We=n.get("tab")||"logging";return s.jsxs("div",{children:[s.jsx(Va,{title:"Settings",description:"Logging, security, backup, and system info"}),s.jsxs(PS,{defaultValue:We,children:[s.jsxs(qp,{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(Us,{value:"logging",children:s.jsxs(rt,{children:[s.jsx(lt,{children:s.jsx(st,{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(Gn,{value:a.contentLogMode,onValueChange:oe=>pe({contentLogMode:oe}),children:[s.jsx(kn,{children:s.jsx(Kn,{})}),s.jsxs(_n,{children:[s.jsx(tt,{value:"off",children:"Off"}),s.jsx(tt,{value:"metadata",children:"Metadata only (default)"}),s.jsx(tt,{value:"prompt",children:"Prompt (sanitized)"}),s.jsx(tt,{value:"prompt_and_response",children:"Prompt + response (sanitized)"})]})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Retention (days)"}),s.jsx(Re,{type:"number",min:1,max:3650,value:a.retentionDays,onChange:oe=>pe({retentionDays:Number(oe.target.value)})})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Database size limit (MB)"}),s.jsx(Re,{type:"number",min:64,value:a.dbSizeLimitMb,onChange:oe=>pe({dbSizeLimitMb:Number(oe.target.value)})})]}),s.jsx("div",{className:"flex items-center gap-2 pt-2",children:s.jsx(ce,{onClick:async()=>{const oe=await xe.post("/api/admin/settings/cleanup");me.success(`Deleted ${oe.deletedRequests} old requests`)},children:"Run cleanup now"})})]})]})}),s.jsx(Us,{value:"access",children:s.jsxs(rt,{children:[s.jsxs(lt,{children:[s.jsx(st,{className:"text-base",children:"IP access control"}),s.jsx(Dn,{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(yu,{placeholder:`192.168.1.0/24
391
+ 10.0.0.1`,value:p,onChange:oe=>g(oe.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(yu,{placeholder:"192.168.1.100",value:v,onChange:oe=>x(oe.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(ce,{onClick:()=>{const oe={};p!==((a==null?void 0:a.adminIpAllow)??"")&&(oe.adminIpAllow=p||null),v!==((a==null?void 0:a.adminIpBlock)??"")&&(oe.adminIpBlock=v||null),xe.patch("/api/admin/settings",oe).then(Le=>{me.success("Saved"+(Le.addedIp?` — added your IP: ${Le.addedIp}`:"")),he(),g(""),x("")}).catch(Le=>me.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(Us,{value:"security",children:s.jsxs(rt,{children:[s.jsxs(lt,{children:[s.jsx(st,{className:"text-base",children:"Security"}),s.jsx(Dn,{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(Re,{type:"number",min:0,max:8,value:a.trustProxyHops,onChange:oe=>pe({trustProxyHops:Number(oe.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(ce,{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."}),V&&s.jsx("img",{src:V,alt:"TOTP QR code",className:"h-40 w-40"}),s.jsxs("div",{className:"text-xs font-mono text-muted-foreground",children:["Secret: ",k]}),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(Re,{value:$,onChange:oe=>H(oe.target.value),placeholder:"123456",maxLength:6})]}),s.jsx(ce,{disabled:$.length<6,onClick:Ce,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:I.map((oe,Le)=>s.jsx("div",{className:"font-mono text-xs",children:oe},Le))}),s.jsx(ce,{onClick:()=>{N("enabled"),me.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(Re,{type:"password",value:de,onChange:oe=>_(oe.target.value),placeholder:"Current password"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"TOTP code"}),s.jsx(Re,{value:q,onChange:oe=>ee(oe.target.value),placeholder:"123456",maxLength:6})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ce,{variant:"outline",size:"sm",disabled:W||!de||q.length<6,onClick:Qe,children:"Regenerate recovery codes"}),s.jsx(ce,{variant:"destructive",size:"sm",disabled:!de||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(Re,{type:"password",placeholder:"Current password",value:u.current,onChange:oe=>f({...u,current:oe.target.value})}),s.jsx(Re,{type:"password",placeholder:"New password (12+ chars)",value:u.next,onChange:oe=>f({...u,next:oe.target.value})}),s.jsx(ce,{disabled:!u.current||u.next.length<12,onClick:async()=>{try{await xe.post("/api/admin/account/password",{currentPassword:u.current,newPassword:u.next}),me.success("Password changed"),f({current:"",next:""})}catch(oe){me.error(oe.message)}},children:"Change password"})]})]})]})}),s.jsx(Us,{value:"backup",children:s.jsxs(rt,{children:[s.jsxs(lt,{children:[s.jsx(st,{className:"text-base",children:"Backup & restore"}),s.jsx(Dn,{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(Re,{inputMode:"numeric",maxLength:6,value:Z,onChange:oe=>se(oe.target.value.replace(/\D/g,"")),placeholder:"123456"}),s.jsx(Re,{inputMode:"numeric",maxLength:6,value:ge,onChange:oe=>ye(oe.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(ce,{disabled:Z.length!==6||Z!==ge,onClick:async()=>{try{const oe=await fetch("/api/admin/backup/create",{method:"POST",credentials:"include",headers:{"content-type":"application/json"},body:JSON.stringify({passphrase:Z})});if(!oe.ok)throw new Error("Backup failed");const Le=await oe.blob(),He=URL.createObjectURL(Le),_t=document.createElement("a");_t.href=He,_t.download="latedev-backup.json",_t.click(),URL.revokeObjectURL(He),me.success("Backup downloaded"),se(""),ye("")}catch(oe){me.error(oe.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(Re,{inputMode:"numeric",maxLength:6,value:G,onChange:oe=>ie(oe.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(Iw,{open:z!==null,onOpenChange:oe=>{oe||P(null)},children:[s.jsx(NO,{asChild:!0,children:s.jsxs("div",{children:[s.jsx(be,{children:"Restore from backup file"}),s.jsx(Re,{type:"file",accept:".json,application/json","data-testid":"restore-file",onChange:oe=>{var He;const Le=(He=oe.target.files)==null?void 0:He[0];P(Le??null)}})]})}),s.jsxs(dp,{children:[s.jsxs(Pw,{children:[s.jsx(fp,{children:"Restore backup?"}),s.jsxs(hp,{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(Hw,{children:[s.jsx(pp,{children:"Cancel"}),s.jsx(mp,{onClick:async()=>{var Le,He;const oe=z;if(oe)try{const _t=JSON.parse(await oe.text()),jt=await fetch("/api/admin/backup/restore",{method:"POST",credentials:"include",headers:{"content-type":"application/json"},body:JSON.stringify({backup:_t,passphrase:G})});if(!jt.ok)throw new Error(((He=(Le=await jt.json())==null?void 0:Le.error)==null?void 0:He.message)??"Restore failed");me.success("Restored. Reloading…"),P(null),setTimeout(()=>location.reload(),600)}catch(_t){me.error(_t.message)}},children:"Restore"})]})]})]})]})]})}),s.jsxs(Us,{value:"system",children:[s.jsxs(rt,{children:[s.jsx(lt,{children:s.jsx(st,{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:oe=>pe({gatewayCacheEnabled:oe})}),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(Re,{type:"number",min:1,value:a.gatewayCacheDefaultTtlSeconds,onChange:oe=>pe({gatewayCacheDefaultTtlSeconds:Number(oe.target.value)})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Cache max size (MB)"}),s.jsx(Re,{type:"number",min:1,value:a.gatewayCacheMaxSizeMb,onChange:oe=>pe({gatewayCacheMaxSizeMb:Number(oe.target.value)})})]})]}),s.jsx(ce,{variant:"outline",onClick:async()=>{const oe=await xe.post("/api/admin/settings/cache/clear");me.success(`Cleared ${oe.deleted} entries`)},children:"Clear gateway cache"})]})]}),s.jsx(P4,{}),s.jsxs(rt,{className:"mt-4",children:[s.jsxs(lt,{children:[s.jsx(st,{className:"text-base",children:"Updates"}),s.jsx(Dn,{children:"Automatic updates from the npm registry"})]}),s.jsxs(ot,{className:"space-y-3 text-sm",children:[j==="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(nt,{variant:"secondary",children:y.status.watchtower?"Docker + Watchtower":"Docker"}):y.latestVersion===null?s.jsx(nt,{variant:"secondary",children:"Registry unreachable"}):y.hasUpdate?s.jsx(nt,{variant:"success",children:"Update available"}):s.jsxs(nt,{variant:"outline",children:[s.jsx(Cu,{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})]}),j==="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."]}),j==="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&&j==="idle"&&(!y.status.docker||y.status.watchtower&&y.watchtowerReachable!==!1)&&s.jsxs(ce,{disabled:w||y.status.docker&&y.watchtowerReachable===!1,onClick:M,children:[s.jsx(Om,{className:"mr-1 h-4 w-4"})," Update now"]}),y.hasUpdate&&y.changelogUrl&&s.jsx(ce,{variant:"outline",asChild:!0,children:s.jsx("a",{href:y.changelogUrl,target:"_blank",rel:"noreferrer",children:"View changes"})}),j==="idle"&&s.jsx(ce,{variant:"ghost",disabled:w,onClick:()=>A(!0),children:"Check again"})]})]})]})]})]})]})]})}function P4(){const n=YS();return s.jsxs(rt,{className:"mt-4",children:[s.jsx(lt,{children:s.jsxs(st,{className:"text-base flex items-center gap-2",children:[s.jsx(JE,{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 Zb({enabled:a})})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(MN,{className:"h-3 w-3"})," Play notification sound"]}),s.jsx(Ha,{checked:n.sound,onCheckedChange:a=>void Zb({sound:a})})]}),s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Notifications are disabled while muted. Changes apply immediately."})]})]})}function H4({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=Ne("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(Ol,{to:"/requests",className:Ne("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(nN,{className:"h-4 w-4 shrink-0"}):l.success?s.jsx(Cu,{className:"h-4 w-4 shrink-0"}):s.jsx(DN,{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(Eu,{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 ",Kt(l.inputTokens)," · out ",Kt(l.outputTokens),(l.cacheReadTokens>0||l.cacheWriteTokens>0)&&s.jsxs(s.Fragment,{children:[" · cache ",l.cacheReadTokens>0&&s.jsxs("span",{children:["r",Kt(l.cacheReadTokens)]}),l.cacheReadTokens>0&&l.cacheWriteTokens>0&&"/",l.cacheWriteTokens>0&&s.jsxs("span",{children:["w",Kt(l.cacheWriteTokens)]})]})]}),s.jsxs("div",{className:"mt-1 text-[11px] opacity-90",children:[kl(l.totalLatencyMs),l.ttftMs!=null&&l.ttftMs>=0&&s.jsxs("span",{children:[" · TTFT ",kl(l.ttftMs)]})]})]},l.id)})}):null}const q4=5e3,$4=8,V4=3e3;let Jc=null;function Y4(){try{Jc||(Jc=new Audio("/notification.mp3")),Jc.currentTime=0,Jc.play().catch(()=>{})}catch{}}function G4(){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=YS(),p=h.useRef(f.sound);p.current=f.sound,h.useEffect(()=>{VS()},[]);const g=f.enabled;return h.useEffect(()=>{var w;if(!g){(w=l.current)==null||w.close(),l.current=null;const E=o.current;for(const j of E.values())clearTimeout(j);E.clear(),a([]);return}let x=!1;const y=o.current,b=()=>{if(x)return;const E=new EventSource(`/api/admin/requests/stream?since=${c.current}`);l.current=E,E.addEventListener("request",j=>{if(!x)try{const C=JSON.parse(j.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,$4));const D=setTimeout(()=>{a(A=>A.filter(M=>M.id!==C.id)),y.delete(C.id)},q4);y.set(C.id,D),p.current&&Y4()}catch{}}),E.onerror=()=>{E.close(),l.current=null,x||setTimeout(b,V4)}};return b(),()=>{var E;x=!0,(E=l.current)==null||E.close(),l.current=null;for(const j of y.values())clearTimeout(j);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 K4({children:n}){const{user:a,loading:l}=Mm(),o=zn();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(zh,{to:"/login",state:{from:o},replace:!0})}function X4(){const{items:n,dismiss:a}=G4();return s.jsxs("div",{className:"flex h-screen bg-background text-foreground",children:[s.jsx(hR,{}),s.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[s.jsx(mD,{}),s.jsx("main",{className:"flex-1 overflow-auto p-6",children:s.jsxs(v0,{children:[s.jsx(An,{index:!0,element:s.jsx(XD,{})}),s.jsx(An,{path:"/providers",element:s.jsx(Z_,{})}),s.jsx(An,{path:"/models",element:s.jsx(t4,{})}),s.jsx(An,{path:"/combos",element:s.jsx(n4,{})}),s.jsx(An,{path:"/aliases",element:s.jsx(a4,{})}),s.jsx(An,{path:"/api-keys",element:s.jsx(r4,{})}),s.jsx(An,{path:"/requests",element:s.jsx(o4,{})}),s.jsx(An,{path:"/statistics",element:s.jsx(L4,{})}),s.jsx(An,{path:"/audit",element:s.jsx(U4,{})}),s.jsx(An,{path:"/settings/*",element:s.jsx(B4,{})})]})})]}),s.jsx(H4,{items:n,onDismiss:a})]})}function F4({children:n}){const[a,l]=h.useState(null),o=zn();return h.useEffect(()=>{xe.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(zh,{to:"/setup",replace:!0}):a&&o.pathname==="/setup"?s.jsx(zh,{to:"/",replace:!0}):s.jsx(s.Fragment,{children:n})}function Q4(){return s.jsx(KE,{children:s.jsx(F4,{children:s.jsxs(v0,{children:[s.jsx(An,{path:"/setup",element:s.jsx(GD,{})}),s.jsx(An,{path:"/login",element:s.jsx(YD,{})}),s.jsx(An,{path:"/*",element:s.jsx(K4,{children:s.jsx(X4,{})})})]})})})}const Z4=VD;h2.createRoot(document.getElementById("root")).render(s.jsx(ue.StrictMode,{children:s.jsx(SR,{defaultTheme:"dark",storageKey:"latedev-theme",children:s.jsxs(zS,{children:[s.jsx(LE,{children:s.jsx(Q4,{})}),s.jsx(Z4,{position:"top-right"})]})})}));