@alexberardi/jarvis-admin 0.1.52 → 0.1.53

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 (36) hide show
  1. package/package.json +1 -1
  2. package/public/assets/index-BSTio8c-.css +1 -0
  3. package/public/assets/index-DWQc4gfz.js +18 -0
  4. package/public/index.html +2 -2
  5. package/server/dist/app.d.ts.map +1 -1
  6. package/server/dist/app.js +2 -0
  7. package/server/dist/app.js.map +1 -1
  8. package/server/dist/data/service-registry.json +3 -0
  9. package/server/dist/routes/install.d.ts.map +1 -1
  10. package/server/dist/routes/install.js +6 -16
  11. package/server/dist/routes/install.js.map +1 -1
  12. package/server/dist/routes/native-services.d.ts +3 -0
  13. package/server/dist/routes/native-services.d.ts.map +1 -0
  14. package/server/dist/routes/native-services.js +318 -0
  15. package/server/dist/routes/native-services.js.map +1 -0
  16. package/server/dist/services/generators/compose-generator.d.ts +8 -1
  17. package/server/dist/services/generators/compose-generator.d.ts.map +1 -1
  18. package/server/dist/services/generators/compose-generator.js +22 -4
  19. package/server/dist/services/generators/compose-generator.js.map +1 -1
  20. package/server/dist/services/generators/env-generator.d.ts.map +1 -1
  21. package/server/dist/services/generators/env-generator.js +15 -0
  22. package/server/dist/services/generators/env-generator.js.map +1 -1
  23. package/server/dist/services/host-platform.d.ts +5 -0
  24. package/server/dist/services/host-platform.d.ts.map +1 -0
  25. package/server/dist/services/host-platform.js +55 -0
  26. package/server/dist/services/host-platform.js.map +1 -0
  27. package/server/dist/services/upgrade/state-reconstructor.d.ts.map +1 -1
  28. package/server/dist/services/upgrade/state-reconstructor.js +13 -2
  29. package/server/dist/services/upgrade/state-reconstructor.js.map +1 -1
  30. package/server/dist/types/service-registry.d.ts +7 -0
  31. package/server/dist/types/service-registry.d.ts.map +1 -1
  32. package/server/dist/types/wizard.d.ts +7 -0
  33. package/server/dist/types/wizard.d.ts.map +1 -1
  34. package/server/src/data/service-registry.json +3 -0
  35. package/public/assets/index-CFk_6rti.js +0 -18
  36. package/public/assets/index-CMHLUK6S.css +0 -1
@@ -0,0 +1,18 @@
1
+ (function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))o(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const m of f.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&o(m)}).observe(document,{childList:!0,subtree:!0});function i(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function o(d){if(d.ep)return;d.ep=!0;const f=i(d);fetch(d.href,f)}})();function Qx(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var ku={exports:{}},os={};var Dp;function Ab(){if(Dp)return os;Dp=1;var a=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function i(o,d,f){var m=null;if(f!==void 0&&(m=""+f),d.key!==void 0&&(m=""+d.key),"key"in d){f={};for(var v in d)v!=="key"&&(f[v]=d[v])}else f=d;return d=f.ref,{$$typeof:a,type:o,key:m,ref:d!==void 0?d:null,props:f}}return os.Fragment=l,os.jsx=i,os.jsxs=i,os}var Lp;function kb(){return Lp||(Lp=1,ku.exports=Ab()),ku.exports}var s=kb(),Ou={exports:{}},we={};var Up;function Ob(){if(Up)return we;Up=1;var a=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),m=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),N=Symbol.iterator;function A(C){return C===null||typeof C!="object"?null:(C=N&&C[N]||C["@@iterator"],typeof C=="function"?C:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,R={};function O(C,Y,X){this.props=C,this.context=Y,this.refs=R,this.updater=X||j}O.prototype.isReactComponent={},O.prototype.setState=function(C,Y){if(typeof C!="object"&&typeof C!="function"&&C!=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,C,Y,"setState")},O.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function M(){}M.prototype=O.prototype;function V(C,Y,X){this.props=C,this.context=Y,this.refs=R,this.updater=X||j}var U=V.prototype=new M;U.constructor=V,E(U,O.prototype),U.isPureReactComponent=!0;var ne=Array.isArray;function W(){}var $={H:null,A:null,T:null,S:null},G=Object.prototype.hasOwnProperty;function se(C,Y,X){var I=X.ref;return{$$typeof:a,type:C,key:Y,ref:I!==void 0?I:null,props:X}}function je(C,Y){return se(C.type,Y,C.props)}function he(C){return typeof C=="object"&&C!==null&&C.$$typeof===a}function me(C){var Y={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(X){return Y[X]})}var Re=/\/+/g;function Ce(C,Y){return typeof C=="object"&&C!==null&&C.key!=null?me(""+C.key):Y.toString(36)}function ee(C){switch(C.status){case"fulfilled":return C.value;case"rejected":throw C.reason;default:switch(typeof C.status=="string"?C.then(W,W):(C.status="pending",C.then(function(Y){C.status==="pending"&&(C.status="fulfilled",C.value=Y)},function(Y){C.status==="pending"&&(C.status="rejected",C.reason=Y)})),C.status){case"fulfilled":return C.value;case"rejected":throw C.reason}}throw C}function w(C,Y,X,I,le){var Z=typeof C;(Z==="undefined"||Z==="boolean")&&(C=null);var ie=!1;if(C===null)ie=!0;else switch(Z){case"bigint":case"string":case"number":ie=!0;break;case"object":switch(C.$$typeof){case a:case l:ie=!0;break;case y:return ie=C._init,w(ie(C._payload),Y,X,I,le)}}if(ie)return le=le(C),ie=I===""?"."+Ce(C,0):I,ne(le)?(X="",ie!=null&&(X=ie.replace(Re,"$&/")+"/"),w(le,Y,X,"",function(ae){return ae})):le!=null&&(he(le)&&(le=je(le,X+(le.key==null||C&&C.key===le.key?"":(""+le.key).replace(Re,"$&/")+"/")+ie)),Y.push(le)),1;ie=0;var oe=I===""?".":I+":";if(ne(C))for(var B=0;B<C.length;B++)I=C[B],Z=oe+Ce(I,B),ie+=w(I,Y,X,Z,le);else if(B=A(C),typeof B=="function")for(C=B.call(C),B=0;!(I=C.next()).done;)I=I.value,Z=oe+Ce(I,B++),ie+=w(I,Y,X,Z,le);else if(Z==="object"){if(typeof C.then=="function")return w(ee(C),Y,X,I,le);throw Y=String(C),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return ie}function Q(C,Y,X){if(C==null)return C;var I=[],le=0;return w(C,I,"","",function(Z){return Y.call(X,Z,le++)}),I}function F(C){if(C._status===-1){var Y=C._result;Y=Y(),Y.then(function(X){(C._status===0||C._status===-1)&&(C._status=1,C._result=X)},function(X){(C._status===0||C._status===-1)&&(C._status=2,C._result=X)}),C._status===-1&&(C._status=0,C._result=Y)}if(C._status===1)return C._result.default;throw C._result}var xe=typeof reportError=="function"?reportError:function(C){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof C=="object"&&C!==null&&typeof C.message=="string"?String(C.message):String(C),error:C});if(!window.dispatchEvent(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",C);return}console.error(C)},ve={map:Q,forEach:function(C,Y,X){Q(C,function(){Y.apply(this,arguments)},X)},count:function(C){var Y=0;return Q(C,function(){Y++}),Y},toArray:function(C){return Q(C,function(Y){return Y})||[]},only:function(C){if(!he(C))throw Error("React.Children.only expected to receive a single React element child.");return C}};return we.Activity=x,we.Children=ve,we.Component=O,we.Fragment=i,we.Profiler=d,we.PureComponent=V,we.StrictMode=o,we.Suspense=g,we.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$,we.__COMPILER_RUNTIME={__proto__:null,c:function(C){return $.H.useMemoCache(C)}},we.cache=function(C){return function(){return C.apply(null,arguments)}},we.cacheSignal=function(){return null},we.cloneElement=function(C,Y,X){if(C==null)throw Error("The argument must be a React element, but you passed "+C+".");var I=E({},C.props),le=C.key;if(Y!=null)for(Z in Y.key!==void 0&&(le=""+Y.key),Y)!G.call(Y,Z)||Z==="key"||Z==="__self"||Z==="__source"||Z==="ref"&&Y.ref===void 0||(I[Z]=Y[Z]);var Z=arguments.length-2;if(Z===1)I.children=X;else if(1<Z){for(var ie=Array(Z),oe=0;oe<Z;oe++)ie[oe]=arguments[oe+2];I.children=ie}return se(C.type,le,I)},we.createContext=function(C){return C={$$typeof:m,_currentValue:C,_currentValue2:C,_threadCount:0,Provider:null,Consumer:null},C.Provider=C,C.Consumer={$$typeof:f,_context:C},C},we.createElement=function(C,Y,X){var I,le={},Z=null;if(Y!=null)for(I in Y.key!==void 0&&(Z=""+Y.key),Y)G.call(Y,I)&&I!=="key"&&I!=="__self"&&I!=="__source"&&(le[I]=Y[I]);var ie=arguments.length-2;if(ie===1)le.children=X;else if(1<ie){for(var oe=Array(ie),B=0;B<ie;B++)oe[B]=arguments[B+2];le.children=oe}if(C&&C.defaultProps)for(I in ie=C.defaultProps,ie)le[I]===void 0&&(le[I]=ie[I]);return se(C,Z,le)},we.createRef=function(){return{current:null}},we.forwardRef=function(C){return{$$typeof:v,render:C}},we.isValidElement=he,we.lazy=function(C){return{$$typeof:y,_payload:{_status:-1,_result:C},_init:F}},we.memo=function(C,Y){return{$$typeof:p,type:C,compare:Y===void 0?null:Y}},we.startTransition=function(C){var Y=$.T,X={};$.T=X;try{var I=C(),le=$.S;le!==null&&le(X,I),typeof I=="object"&&I!==null&&typeof I.then=="function"&&I.then(W,xe)}catch(Z){xe(Z)}finally{Y!==null&&X.types!==null&&(Y.types=X.types),$.T=Y}},we.unstable_useCacheRefresh=function(){return $.H.useCacheRefresh()},we.use=function(C){return $.H.use(C)},we.useActionState=function(C,Y,X){return $.H.useActionState(C,Y,X)},we.useCallback=function(C,Y){return $.H.useCallback(C,Y)},we.useContext=function(C){return $.H.useContext(C)},we.useDebugValue=function(){},we.useDeferredValue=function(C,Y){return $.H.useDeferredValue(C,Y)},we.useEffect=function(C,Y){return $.H.useEffect(C,Y)},we.useEffectEvent=function(C){return $.H.useEffectEvent(C)},we.useId=function(){return $.H.useId()},we.useImperativeHandle=function(C,Y,X){return $.H.useImperativeHandle(C,Y,X)},we.useInsertionEffect=function(C,Y){return $.H.useInsertionEffect(C,Y)},we.useLayoutEffect=function(C,Y){return $.H.useLayoutEffect(C,Y)},we.useMemo=function(C,Y){return $.H.useMemo(C,Y)},we.useOptimistic=function(C,Y){return $.H.useOptimistic(C,Y)},we.useReducer=function(C,Y,X){return $.H.useReducer(C,Y,X)},we.useRef=function(C){return $.H.useRef(C)},we.useState=function(C){return $.H.useState(C)},we.useSyncExternalStore=function(C,Y,X){return $.H.useSyncExternalStore(C,Y,X)},we.useTransition=function(){return $.H.useTransition()},we.version="19.2.4",we}var Bp;function pd(){return Bp||(Bp=1,Ou.exports=Ob()),Ou.exports}var S=pd();const re=Qx(S);var zu={exports:{}},cs={},Du={exports:{}},Lu={};var qp;function zb(){return qp||(qp=1,(function(a){function l(w,Q){var F=w.length;w.push(Q);e:for(;0<F;){var xe=F-1>>>1,ve=w[xe];if(0<d(ve,Q))w[xe]=Q,w[F]=ve,F=xe;else break e}}function i(w){return w.length===0?null:w[0]}function o(w){if(w.length===0)return null;var Q=w[0],F=w.pop();if(F!==Q){w[0]=F;e:for(var xe=0,ve=w.length,C=ve>>>1;xe<C;){var Y=2*(xe+1)-1,X=w[Y],I=Y+1,le=w[I];if(0>d(X,F))I<ve&&0>d(le,X)?(w[xe]=le,w[I]=F,xe=I):(w[xe]=X,w[Y]=F,xe=Y);else if(I<ve&&0>d(le,F))w[xe]=le,w[I]=F,xe=I;else break e}}return Q}function d(w,Q){var F=w.sortIndex-Q.sortIndex;return F!==0?F:w.id-Q.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;a.unstable_now=function(){return f.now()}}else{var m=Date,v=m.now();a.unstable_now=function(){return m.now()-v}}var g=[],p=[],y=1,x=null,N=3,A=!1,j=!1,E=!1,R=!1,O=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,V=typeof setImmediate<"u"?setImmediate:null;function U(w){for(var Q=i(p);Q!==null;){if(Q.callback===null)o(p);else if(Q.startTime<=w)o(p),Q.sortIndex=Q.expirationTime,l(g,Q);else break;Q=i(p)}}function ne(w){if(E=!1,U(w),!j)if(i(g)!==null)j=!0,W||(W=!0,me());else{var Q=i(p);Q!==null&&ee(ne,Q.startTime-w)}}var W=!1,$=-1,G=5,se=-1;function je(){return R?!0:!(a.unstable_now()-se<G)}function he(){if(R=!1,W){var w=a.unstable_now();se=w;var Q=!0;try{e:{j=!1,E&&(E=!1,M($),$=-1),A=!0;var F=N;try{t:{for(U(w),x=i(g);x!==null&&!(x.expirationTime>w&&je());){var xe=x.callback;if(typeof xe=="function"){x.callback=null,N=x.priorityLevel;var ve=xe(x.expirationTime<=w);if(w=a.unstable_now(),typeof ve=="function"){x.callback=ve,U(w),Q=!0;break t}x===i(g)&&o(g),U(w)}else o(g);x=i(g)}if(x!==null)Q=!0;else{var C=i(p);C!==null&&ee(ne,C.startTime-w),Q=!1}}break e}finally{x=null,N=F,A=!1}Q=void 0}}finally{Q?me():W=!1}}}var me;if(typeof V=="function")me=function(){V(he)};else if(typeof MessageChannel<"u"){var Re=new MessageChannel,Ce=Re.port2;Re.port1.onmessage=he,me=function(){Ce.postMessage(null)}}else me=function(){O(he,0)};function ee(w,Q){$=O(function(){w(a.unstable_now())},Q)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(w){w.callback=null},a.unstable_forceFrameRate=function(w){0>w||125<w?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):G=0<w?Math.floor(1e3/w):5},a.unstable_getCurrentPriorityLevel=function(){return N},a.unstable_next=function(w){switch(N){case 1:case 2:case 3:var Q=3;break;default:Q=N}var F=N;N=Q;try{return w()}finally{N=F}},a.unstable_requestPaint=function(){R=!0},a.unstable_runWithPriority=function(w,Q){switch(w){case 1:case 2:case 3:case 4:case 5:break;default:w=3}var F=N;N=w;try{return Q()}finally{N=F}},a.unstable_scheduleCallback=function(w,Q,F){var xe=a.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?xe+F:xe):F=xe,w){case 1:var ve=-1;break;case 2:ve=250;break;case 5:ve=1073741823;break;case 4:ve=1e4;break;default:ve=5e3}return ve=F+ve,w={id:y++,callback:Q,priorityLevel:w,startTime:F,expirationTime:ve,sortIndex:-1},F>xe?(w.sortIndex=F,l(p,w),i(g)===null&&w===i(p)&&(E?(M($),$=-1):E=!0,ee(ne,F-xe))):(w.sortIndex=ve,l(g,w),j||A||(j=!0,W||(W=!0,me()))),w},a.unstable_shouldYield=je,a.unstable_wrapCallback=function(w){var Q=N;return function(){var F=N;N=Q;try{return w.apply(this,arguments)}finally{N=F}}}})(Lu)),Lu}var Hp;function Db(){return Hp||(Hp=1,Du.exports=zb()),Du.exports}var Uu={exports:{}},Tt={};var Gp;function Lb(){if(Gp)return Tt;Gp=1;var a=pd();function l(g){var p="https://react.dev/errors/"+g;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)p+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+g+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var o={d:{f:i,r:function(){throw Error(l(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},d=Symbol.for("react.portal");function f(g,p,y){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:x==null?null:""+x,children:g,containerInfo:p,implementation:y}}var m=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function v(g,p){if(g==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Tt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,Tt.createPortal=function(g,p){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(l(299));return f(g,p,null,y)},Tt.flushSync=function(g){var p=m.T,y=o.p;try{if(m.T=null,o.p=2,g)return g()}finally{m.T=p,o.p=y,o.d.f()}},Tt.preconnect=function(g,p){typeof g=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,o.d.C(g,p))},Tt.prefetchDNS=function(g){typeof g=="string"&&o.d.D(g)},Tt.preinit=function(g,p){if(typeof g=="string"&&p&&typeof p.as=="string"){var y=p.as,x=v(y,p.crossOrigin),N=typeof p.integrity=="string"?p.integrity:void 0,A=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;y==="style"?o.d.S(g,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:x,integrity:N,fetchPriority:A}):y==="script"&&o.d.X(g,{crossOrigin:x,integrity:N,fetchPriority:A,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Tt.preinitModule=function(g,p){if(typeof g=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var y=v(p.as,p.crossOrigin);o.d.M(g,{crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&o.d.M(g)},Tt.preload=function(g,p){if(typeof g=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var y=p.as,x=v(y,p.crossOrigin);o.d.L(g,y,{crossOrigin:x,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Tt.preloadModule=function(g,p){if(typeof g=="string")if(p){var y=v(p.as,p.crossOrigin);o.d.m(g,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else o.d.m(g)},Tt.requestFormReset=function(g){o.d.r(g)},Tt.unstable_batchedUpdates=function(g,p){return g(p)},Tt.useFormState=function(g,p,y){return m.H.useFormState(g,p,y)},Tt.useFormStatus=function(){return m.H.useHostTransitionStatus()},Tt.version="19.2.4",Tt}var Qp;function Vx(){if(Qp)return Uu.exports;Qp=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(l){console.error(l)}}return a(),Uu.exports=Lb(),Uu.exports}var Vp;function Ub(){if(Vp)return cs;Vp=1;var a=Db(),l=pd(),i=Vx();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function m(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 v(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(f(e)!==e)throw Error(o(188))}function p(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(o(188));return t!==e?null:e}for(var n=e,r=t;;){var c=n.return;if(c===null)break;var u=c.alternate;if(u===null){if(r=c.return,r!==null){n=r;continue}break}if(c.child===u.child){for(u=c.child;u;){if(u===n)return g(c),e;if(u===r)return g(c),t;u=u.sibling}throw Error(o(188))}if(n.return!==r.return)n=c,r=u;else{for(var h=!1,b=c.child;b;){if(b===n){h=!0,n=c,r=u;break}if(b===r){h=!0,r=c,n=u;break}b=b.sibling}if(!h){for(b=u.child;b;){if(b===n){h=!0,n=u,r=c;break}if(b===r){h=!0,r=u,n=c;break}b=b.sibling}if(!h)throw Error(o(189))}}if(n.alternate!==r)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var x=Object.assign,N=Symbol.for("react.element"),A=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),V=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),ne=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),se=Symbol.for("react.activity"),je=Symbol.for("react.memo_cache_sentinel"),he=Symbol.iterator;function me(e){return e===null||typeof e!="object"?null:(e=he&&e[he]||e["@@iterator"],typeof e=="function"?e:null)}var Re=Symbol.for("react.client.reference");function Ce(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Re?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case O:return"Profiler";case R:return"StrictMode";case ne:return"Suspense";case W:return"SuspenseList";case se:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case j:return"Portal";case V:return e.displayName||"Context";case M:return(e._context.displayName||"Context")+".Consumer";case U:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case $:return t=e.displayName||null,t!==null?t:Ce(e.type)||"Memo";case G:t=e._payload,e=e._init;try{return Ce(e(t))}catch{}}return null}var ee=Array.isArray,w=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},xe=[],ve=-1;function C(e){return{current:e}}function Y(e){0>ve||(e.current=xe[ve],xe[ve]=null,ve--)}function X(e,t){ve++,xe[ve]=e.current,e.current=t}var I=C(null),le=C(null),Z=C(null),ie=C(null);function oe(e,t){switch(X(Z,t),X(le,e),X(I,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?rp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=rp(t),e=lp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Y(I),X(I,e)}function B(){Y(I),Y(le),Y(Z)}function ae(e){e.memoizedState!==null&&X(ie,e);var t=I.current,n=lp(t,e.type);t!==n&&(X(le,e),X(I,n))}function _e(e){le.current===e&&(Y(I),Y(le)),ie.current===e&&(Y(ie),rs._currentValue=F)}var Ae,va;function ot(e){if(Ae===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ae=t&&t[1]||"",va=-1<n.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+Ae+e+va}var zn=!1;function fr(e,t){if(!e||zn)return"";zn=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var P=function(){throw Error()};if(Object.defineProperty(P.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(P,[])}catch(q){var L=q}Reflect.construct(e,[],P)}else{try{P.call()}catch(q){L=q}e.call(P.prototype)}}else{try{throw Error()}catch(q){L=q}(P=e())&&typeof P.catch=="function"&&P.catch(function(){})}}catch(q){if(q&&L&&typeof q.stack=="string")return[q.stack,L.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=r.DetermineComponentFrameRoot(),h=u[0],b=u[1];if(h&&b){var T=h.split(`
4
+ `),D=b.split(`
5
+ `);for(c=r=0;r<T.length&&!T[r].includes("DetermineComponentFrameRoot");)r++;for(;c<D.length&&!D[c].includes("DetermineComponentFrameRoot");)c++;if(r===T.length||c===D.length)for(r=T.length-1,c=D.length-1;1<=r&&0<=c&&T[r]!==D[c];)c--;for(;1<=r&&0<=c;r--,c--)if(T[r]!==D[c]){if(r!==1||c!==1)do if(r--,c--,0>c||T[r]!==D[c]){var K=`
6
+ `+T[r].replace(" at new "," at ");return e.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",e.displayName)),K}while(1<=r&&0<=c);break}}}finally{zn=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?ot(n):""}function Dn(e,t){switch(e.tag){case 26:case 27:case 5:return ot(e.type);case 16:return ot("Lazy");case 13:return e.child!==t&&t!==null?ot("Suspense Fallback"):ot("Suspense");case 19:return ot("SuspenseList");case 0:case 15:return fr(e.type,!1);case 11:return fr(e.type.render,!1);case 1:return fr(e.type,!0);case 31:return ot("Activity");default:return""}}function hl(e){try{var t="",n=null;do t+=Dn(e,n),n=e,e=e.return;while(e);return t}catch(r){return`
7
+ Error generating stack: `+r.message+`
8
+ `+r.stack}}var Zt=Object.prototype.hasOwnProperty,pl=a.unstable_scheduleCallback,xl=a.unstable_cancelCallback,_t=a.unstable_shouldYield,an=a.unstable_requestPaint,Mt=a.unstable_now,bo=a.unstable_getCurrentPriorityLevel,Ln=a.unstable_ImmediatePriority,Ts=a.unstable_UserBlockingPriority,Un=a.unstable_NormalPriority,vl=a.unstable_LowPriority,za=a.unstable_IdlePriority,Rs=a.log,nn=a.unstable_setDisableYieldValue,Bn=null,At=null;function ga(e){if(typeof Rs=="function"&&nn(e),At&&typeof At.setStrictMode=="function")try{At.setStrictMode(Bn,e)}catch{}}var wt=Math.clz32?Math.clz32:Ta,So=Math.log,gl=Math.LN2;function Ta(e){return e>>>=0,e===0?32:31-(So(e)/gl|0)|0}var mr=256,hr=262144,qn=4194304;function Ra(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 Ne(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var c=0,u=e.suspendedLanes,h=e.pingedLanes;e=e.warmLanes;var b=r&134217727;return b!==0?(r=b&~u,r!==0?c=Ra(r):(h&=b,h!==0?c=Ra(h):n||(n=b&~e,n!==0&&(c=Ra(n))))):(b=r&~u,b!==0?c=Ra(b):h!==0?c=Ra(h):n||(n=r&~e,n!==0&&(c=Ra(n)))),c===0?0:t!==0&&t!==c&&(t&u)===0&&(u=c&-c,n=t&-t,u>=n||u===32&&(n&4194048)!==0)?t:c}function $e(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ft(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 Et(){var e=qn;return qn<<=1,(qn&62914560)===0&&(qn=4194304),e}function rn(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ie(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Dt(e,t,n,r,c,u){var h=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var b=e.entanglements,T=e.expirationTimes,D=e.hiddenUpdates;for(n=h&~n;0<n;){var K=31-wt(n),P=1<<K;b[K]=0,T[K]=-1;var L=D[K];if(L!==null)for(D[K]=null,K=0;K<L.length;K++){var q=L[K];q!==null&&(q.lane&=-536870913)}n&=~P}r!==0&&Hn(e,r,0),u!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=u&~(h&~t))}function Hn(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-wt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Lt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-wt(n),c=1<<r;c&t|e[r]&t&&(e[r]|=t),n&=~c}}function Ut(e,t){var n=t&-t;return n=(n&42)!==0?1:pr(n),(n&(e.suspendedLanes|t))!==0?0:n}function pr(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 ya(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function No(){var e=Q.p;return e!==0?e:(e=window.event,e===void 0?32:Cp(e.type))}function Vd(e,t){var n=Q.p;try{return Q.p=e,t()}finally{Q.p=n}}var ln=Math.random().toString(36).slice(2),gt="__reactFiber$"+ln,Bt="__reactProps$"+ln,xr="__reactContainer$"+ln,jo="__reactEvents$"+ln,bg="__reactListeners$"+ln,Sg="__reactHandles$"+ln,Fd="__reactResources$"+ln,yl="__reactMarker$"+ln;function wo(e){delete e[gt],delete e[Bt],delete e[jo],delete e[bg],delete e[Sg]}function vr(e){var t=e[gt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[xr]||n[gt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fp(e);e!==null;){if(n=e[gt])return n;e=fp(e)}return t}e=n,n=e.parentNode}return null}function gr(e){if(e=e[gt]||e[xr]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function bl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function yr(e){var t=e[Fd];return t||(t=e[Fd]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function mt(e){e[yl]=!0}var Yd=new Set,Xd={};function Gn(e,t){br(e,t),br(e+"Capture",t)}function br(e,t){for(Xd[e]=t,e=0;e<t.length;e++)Yd.add(t[e])}var Ng=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]*$"),Kd={},Zd={};function jg(e){return Zt.call(Zd,e)?!0:Zt.call(Kd,e)?!1:Ng.test(e)?Zd[e]=!0:(Kd[e]=!0,!1)}function Cs(e,t,n){if(jg(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function _s(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Da(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+r)}}function la(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function $d(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function wg(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var c=r.get,u=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(h){n=""+h,u.call(this,h)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(h){n=""+h},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Eo(e){if(!e._valueTracker){var t=$d(e)?"checked":"value";e._valueTracker=wg(e,t,""+e[t])}}function Jd(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=$d(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ms(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 Eg=/[\n"\\]/g;function sa(e){return e.replace(Eg,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function To(e,t,n,r,c,u,h,b){e.name="",h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?e.type=h:e.removeAttribute("type"),t!=null?h==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+la(t)):e.value!==""+la(t)&&(e.value=""+la(t)):h!=="submit"&&h!=="reset"||e.removeAttribute("value"),t!=null?Ro(e,h,la(t)):n!=null?Ro(e,h,la(n)):r!=null&&e.removeAttribute("value"),c==null&&u!=null&&(e.defaultChecked=!!u),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.name=""+la(b):e.removeAttribute("name")}function Pd(e,t,n,r,c,u,h,b){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||n!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){Eo(e);return}n=n!=null?""+la(n):"",t=t!=null?""+la(t):n,b||t===e.value||(e.value=t),e.defaultValue=t}r=r??c,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=b?e.checked:!!r,e.defaultChecked=!!r,h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.name=h),Eo(e)}function Ro(e,t,n){t==="number"&&Ms(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Sr(e,t,n,r){if(e=e.options,t){t={};for(var c=0;c<n.length;c++)t["$"+n[c]]=!0;for(n=0;n<e.length;n++)c=t.hasOwnProperty("$"+e[n].value),e[n].selected!==c&&(e[n].selected=c),c&&r&&(e[n].defaultSelected=!0)}else{for(n=""+la(n),t=null,c=0;c<e.length;c++){if(e[c].value===n){e[c].selected=!0,r&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function Id(e,t,n){if(t!=null&&(t=""+la(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+la(n):""}function Wd(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(o(92));if(ee(r)){if(1<r.length)throw Error(o(93));r=r[0]}n=r}n==null&&(n=""),t=n}n=la(t),e.defaultValue=n,r=e.textContent,r===n&&r!==""&&r!==null&&(e.value=r),Eo(e)}function Nr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Tg=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 ef(e,t,n){var r=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,n):typeof n!="number"||n===0||Tg.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function tf(e,t,n){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var c in t)r=t[c],t.hasOwnProperty(c)&&n[c]!==r&&ef(e,c,r)}else for(var u in t)t.hasOwnProperty(u)&&ef(e,u,t[u])}function Co(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 Rg=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"]]),Cg=/^[\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 As(e){return Cg.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function La(){}var _o=null;function Mo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var jr=null,wr=null;function af(e){var t=gr(e);if(t&&(e=t.stateNode)){var n=e[Bt]||null;e:switch(e=t.stateNode,t.type){case"input":if(To(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+sa(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var c=r[Bt]||null;if(!c)throw Error(o(90));To(r,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Jd(r)}break e;case"textarea":Id(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Sr(e,!!n.multiple,t,!1)}}}var Ao=!1;function nf(e,t,n){if(Ao)return e(t,n);Ao=!0;try{var r=e(t);return r}finally{if(Ao=!1,(jr!==null||wr!==null)&&(gi(),jr&&(t=jr,e=wr,wr=jr=null,af(t),e)))for(t=0;t<e.length;t++)af(e[t])}}function Sl(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Bt]||null;if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(o(231,t,typeof n));return n}var Ua=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ko=!1;if(Ua)try{var Nl={};Object.defineProperty(Nl,"passive",{get:function(){ko=!0}}),window.addEventListener("test",Nl,Nl),window.removeEventListener("test",Nl,Nl)}catch{ko=!1}var sn=null,Oo=null,ks=null;function rf(){if(ks)return ks;var e,t=Oo,n=t.length,r,c="value"in sn?sn.value:sn.textContent,u=c.length;for(e=0;e<n&&t[e]===c[e];e++);var h=n-e;for(r=1;r<=h&&t[n-r]===c[u-r];r++);return ks=c.slice(e,1<r?1-r:void 0)}function Os(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 zs(){return!0}function lf(){return!1}function qt(e){function t(n,r,c,u,h){this._reactName=n,this._targetInst=c,this.type=r,this.nativeEvent=u,this.target=h,this.currentTarget=null;for(var b in e)e.hasOwnProperty(b)&&(n=e[b],this[b]=n?n(u):u[b]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?zs:lf,this.isPropagationStopped=lf,this}return x(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=zs)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=zs)},persist:function(){},isPersistent:zs}),t}var Qn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ds=qt(Qn),jl=x({},Qn,{view:0,detail:0}),_g=qt(jl),zo,Do,wl,Ls=x({},jl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Uo,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!==wl&&(wl&&e.type==="mousemove"?(zo=e.screenX-wl.screenX,Do=e.screenY-wl.screenY):Do=zo=0,wl=e),zo)},movementY:function(e){return"movementY"in e?e.movementY:Do}}),sf=qt(Ls),Mg=x({},Ls,{dataTransfer:0}),Ag=qt(Mg),kg=x({},jl,{relatedTarget:0}),Lo=qt(kg),Og=x({},Qn,{animationName:0,elapsedTime:0,pseudoElement:0}),zg=qt(Og),Dg=x({},Qn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Lg=qt(Dg),Ug=x({},Qn,{data:0}),of=qt(Ug),Bg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qg={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"},Hg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Gg(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Hg[e])?!!t[e]:!1}function Uo(){return Gg}var Qg=x({},jl,{key:function(e){if(e.key){var t=Bg[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Os(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?qg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Uo,charCode:function(e){return e.type==="keypress"?Os(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Os(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Vg=qt(Qg),Fg=x({},Ls,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),cf=qt(Fg),Yg=x({},jl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Uo}),Xg=qt(Yg),Kg=x({},Qn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Zg=qt(Kg),$g=x({},Ls,{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}),Jg=qt($g),Pg=x({},Qn,{newState:0,oldState:0}),Ig=qt(Pg),Wg=[9,13,27,32],Bo=Ua&&"CompositionEvent"in window,El=null;Ua&&"documentMode"in document&&(El=document.documentMode);var ey=Ua&&"TextEvent"in window&&!El,uf=Ua&&(!Bo||El&&8<El&&11>=El),df=" ",ff=!1;function mf(e,t){switch(e){case"keyup":return Wg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Er=!1;function ty(e,t){switch(e){case"compositionend":return hf(t);case"keypress":return t.which!==32?null:(ff=!0,df);case"textInput":return e=t.data,e===df&&ff?null:e;default:return null}}function ay(e,t){if(Er)return e==="compositionend"||!Bo&&mf(e,t)?(e=rf(),ks=Oo=sn=null,Er=!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 uf&&t.locale!=="ko"?null:t.data;default:return null}}var ny={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 pf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ny[e.type]:t==="textarea"}function xf(e,t,n,r){jr?wr?wr.push(r):wr=[r]:jr=r,t=Ei(t,"onChange"),0<t.length&&(n=new Ds("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Tl=null,Rl=null;function ry(e){Ih(e,0)}function Us(e){var t=bl(e);if(Jd(t))return e}function vf(e,t){if(e==="change")return t}var gf=!1;if(Ua){var qo;if(Ua){var Ho="oninput"in document;if(!Ho){var yf=document.createElement("div");yf.setAttribute("oninput","return;"),Ho=typeof yf.oninput=="function"}qo=Ho}else qo=!1;gf=qo&&(!document.documentMode||9<document.documentMode)}function bf(){Tl&&(Tl.detachEvent("onpropertychange",Sf),Rl=Tl=null)}function Sf(e){if(e.propertyName==="value"&&Us(Rl)){var t=[];xf(t,Rl,e,Mo(e)),nf(ry,t)}}function ly(e,t,n){e==="focusin"?(bf(),Tl=t,Rl=n,Tl.attachEvent("onpropertychange",Sf)):e==="focusout"&&bf()}function sy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Us(Rl)}function iy(e,t){if(e==="click")return Us(t)}function oy(e,t){if(e==="input"||e==="change")return Us(t)}function cy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var $t=typeof Object.is=="function"?Object.is:cy;function Cl(e,t){if($t(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var c=n[r];if(!Zt.call(t,c)||!$t(e[c],t[c]))return!1}return!0}function Nf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function jf(e,t){var n=Nf(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Nf(n)}}function wf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?wf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ef(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ms(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ms(e.document)}return t}function Go(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 uy=Ua&&"documentMode"in document&&11>=document.documentMode,Tr=null,Qo=null,_l=null,Vo=!1;function Tf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Vo||Tr==null||Tr!==Ms(r)||(r=Tr,"selectionStart"in r&&Go(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),_l&&Cl(_l,r)||(_l=r,r=Ei(Qo,"onSelect"),0<r.length&&(t=new Ds("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Tr)))}function Vn(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Rr={animationend:Vn("Animation","AnimationEnd"),animationiteration:Vn("Animation","AnimationIteration"),animationstart:Vn("Animation","AnimationStart"),transitionrun:Vn("Transition","TransitionRun"),transitionstart:Vn("Transition","TransitionStart"),transitioncancel:Vn("Transition","TransitionCancel"),transitionend:Vn("Transition","TransitionEnd")},Fo={},Rf={};Ua&&(Rf=document.createElement("div").style,"AnimationEvent"in window||(delete Rr.animationend.animation,delete Rr.animationiteration.animation,delete Rr.animationstart.animation),"TransitionEvent"in window||delete Rr.transitionend.transition);function Fn(e){if(Fo[e])return Fo[e];if(!Rr[e])return e;var t=Rr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Rf)return Fo[e]=t[n];return e}var Cf=Fn("animationend"),_f=Fn("animationiteration"),Mf=Fn("animationstart"),dy=Fn("transitionrun"),fy=Fn("transitionstart"),my=Fn("transitioncancel"),Af=Fn("transitionend"),kf=new Map,Yo="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(" ");Yo.push("scrollEnd");function ba(e,t){kf.set(e,t),Gn(t,[e])}var Bs=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)},ia=[],Cr=0,Xo=0;function qs(){for(var e=Cr,t=Xo=Cr=0;t<e;){var n=ia[t];ia[t++]=null;var r=ia[t];ia[t++]=null;var c=ia[t];ia[t++]=null;var u=ia[t];if(ia[t++]=null,r!==null&&c!==null){var h=r.pending;h===null?c.next=c:(c.next=h.next,h.next=c),r.pending=c}u!==0&&Of(n,c,u)}}function Hs(e,t,n,r){ia[Cr++]=e,ia[Cr++]=t,ia[Cr++]=n,ia[Cr++]=r,Xo|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ko(e,t,n,r){return Hs(e,t,n,r),Gs(e)}function Yn(e,t){return Hs(e,null,null,t),Gs(e)}function Of(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var c=!1,u=e.return;u!==null;)u.childLanes|=n,r=u.alternate,r!==null&&(r.childLanes|=n),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(c=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,c&&t!==null&&(c=31-wt(n),e=u.hiddenUpdates,r=e[c],r===null?e[c]=[t]:r.push(t),t.lane=n|536870912),u):null}function Gs(e){if(50<Pl)throw Pl=0,au=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var _r={};function hy(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Jt(e,t,n,r){return new hy(e,t,n,r)}function Zo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ba(e,t){var n=e.alternate;return n===null?(n=Jt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function zf(e,t){e.flags&=65011714;var n=e.alternate;return n===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=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Qs(e,t,n,r,c,u){var h=0;if(r=e,typeof e=="function")Zo(e)&&(h=1);else if(typeof e=="string")h=yb(e,n,I.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case se:return e=Jt(31,n,t,c),e.elementType=se,e.lanes=u,e;case E:return Xn(n.children,c,u,t);case R:h=8,c|=24;break;case O:return e=Jt(12,n,t,c|2),e.elementType=O,e.lanes=u,e;case ne:return e=Jt(13,n,t,c),e.elementType=ne,e.lanes=u,e;case W:return e=Jt(19,n,t,c),e.elementType=W,e.lanes=u,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case V:h=10;break e;case M:h=9;break e;case U:h=11;break e;case $:h=14;break e;case G:h=16,r=null;break e}h=29,n=Error(o(130,e===null?"null":typeof e,"")),r=null}return t=Jt(h,n,t,c),t.elementType=e,t.type=r,t.lanes=u,t}function Xn(e,t,n,r){return e=Jt(7,e,r,t),e.lanes=n,e}function $o(e,t,n){return e=Jt(6,e,null,t),e.lanes=n,e}function Df(e){var t=Jt(18,null,null,0);return t.stateNode=e,t}function Jo(e,t,n){return t=Jt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Lf=new WeakMap;function oa(e,t){if(typeof e=="object"&&e!==null){var n=Lf.get(e);return n!==void 0?n:(t={value:e,source:t,stack:hl(t)},Lf.set(e,t),t)}return{value:e,source:t,stack:hl(t)}}var Mr=[],Ar=0,Vs=null,Ml=0,ca=[],ua=0,on=null,Ca=1,_a="";function qa(e,t){Mr[Ar++]=Ml,Mr[Ar++]=Vs,Vs=e,Ml=t}function Uf(e,t,n){ca[ua++]=Ca,ca[ua++]=_a,ca[ua++]=on,on=e;var r=Ca;e=_a;var c=32-wt(r)-1;r&=~(1<<c),n+=1;var u=32-wt(t)+c;if(30<u){var h=c-c%5;u=(r&(1<<h)-1).toString(32),r>>=h,c-=h,Ca=1<<32-wt(t)+c|n<<c|r,_a=u+e}else Ca=1<<u|n<<c|r,_a=e}function Po(e){e.return!==null&&(qa(e,1),Uf(e,1,0))}function Io(e){for(;e===Vs;)Vs=Mr[--Ar],Mr[Ar]=null,Ml=Mr[--Ar],Mr[Ar]=null;for(;e===on;)on=ca[--ua],ca[ua]=null,_a=ca[--ua],ca[ua]=null,Ca=ca[--ua],ca[ua]=null}function Bf(e,t){ca[ua++]=Ca,ca[ua++]=_a,ca[ua++]=on,Ca=t.id,_a=t.overflow,on=e}var yt=null,Ke=null,Ue=!1,cn=null,da=!1,Wo=Error(o(519));function un(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Al(oa(t,e)),Wo}function qf(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[gt]=e,t[Bt]=r,n){case"dialog":Oe("cancel",t),Oe("close",t);break;case"iframe":case"object":case"embed":Oe("load",t);break;case"video":case"audio":for(n=0;n<Wl.length;n++)Oe(Wl[n],t);break;case"source":Oe("error",t);break;case"img":case"image":case"link":Oe("error",t),Oe("load",t);break;case"details":Oe("toggle",t);break;case"input":Oe("invalid",t),Pd(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Oe("invalid",t);break;case"textarea":Oe("invalid",t),Wd(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||r.suppressHydrationWarning===!0||ap(t.textContent,n)?(r.popover!=null&&(Oe("beforetoggle",t),Oe("toggle",t)),r.onScroll!=null&&Oe("scroll",t),r.onScrollEnd!=null&&Oe("scrollend",t),r.onClick!=null&&(t.onclick=La),t=!0):t=!1,t||un(e,!0)}function Hf(e){for(yt=e.return;yt;)switch(yt.tag){case 5:case 31:case 13:da=!1;return;case 27:case 3:da=!0;return;default:yt=yt.return}}function kr(e){if(e!==yt)return!1;if(!Ue)return Hf(e),Ue=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||vu(e.type,e.memoizedProps)),n=!n),n&&Ke&&un(e),Hf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Ke=dp(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Ke=dp(e)}else t===27?(t=Ke,wn(e.type)?(e=Nu,Nu=null,Ke=e):Ke=t):Ke=yt?ma(e.stateNode.nextSibling):null;return!0}function Kn(){Ke=yt=null,Ue=!1}function ec(){var e=cn;return e!==null&&(Vt===null?Vt=e:Vt.push.apply(Vt,e),cn=null),e}function Al(e){cn===null?cn=[e]:cn.push(e)}var tc=C(null),Zn=null,Ha=null;function dn(e,t,n){X(tc,t._currentValue),t._currentValue=n}function Ga(e){e._currentValue=tc.current,Y(tc)}function ac(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function nc(e,t,n,r){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var u=c.dependencies;if(u!==null){var h=c.child;u=u.firstContext;e:for(;u!==null;){var b=u;u=c;for(var T=0;T<t.length;T++)if(b.context===t[T]){u.lanes|=n,b=u.alternate,b!==null&&(b.lanes|=n),ac(u.return,n,e),r||(h=null);break e}u=b.next}}else if(c.tag===18){if(h=c.return,h===null)throw Error(o(341));h.lanes|=n,u=h.alternate,u!==null&&(u.lanes|=n),ac(h,n,e),h=null}else h=c.child;if(h!==null)h.return=c;else for(h=c;h!==null;){if(h===e){h=null;break}if(c=h.sibling,c!==null){c.return=h.return,h=c;break}h=h.return}c=h}}function Or(e,t,n,r){e=null;for(var c=t,u=!1;c!==null;){if(!u){if((c.flags&524288)!==0)u=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var h=c.alternate;if(h===null)throw Error(o(387));if(h=h.memoizedProps,h!==null){var b=c.type;$t(c.pendingProps.value,h.value)||(e!==null?e.push(b):e=[b])}}else if(c===ie.current){if(h=c.alternate,h===null)throw Error(o(387));h.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(rs):e=[rs])}c=c.return}e!==null&&nc(t,e,n,r),t.flags|=262144}function Fs(e){for(e=e.firstContext;e!==null;){if(!$t(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function $n(e){Zn=e,Ha=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function bt(e){return Gf(Zn,e)}function Ys(e,t){return Zn===null&&$n(e),Gf(e,t)}function Gf(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ha===null){if(e===null)throw Error(o(308));Ha=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ha=Ha.next=t;return n}var py=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},xy=a.unstable_scheduleCallback,vy=a.unstable_NormalPriority,rt={$$typeof:V,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function rc(){return{controller:new py,data:new Map,refCount:0}}function kl(e){e.refCount--,e.refCount===0&&xy(vy,function(){e.controller.abort()})}var Ol=null,lc=0,zr=0,Dr=null;function gy(e,t){if(Ol===null){var n=Ol=[];lc=0,zr=ou(),Dr={status:"pending",value:void 0,then:function(r){n.push(r)}}}return lc++,t.then(Qf,Qf),t}function Qf(){if(--lc===0&&Ol!==null){Dr!==null&&(Dr.status="fulfilled");var e=Ol;Ol=null,zr=0,Dr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function yy(e,t){var n=[],r={status:"pending",value:null,reason:null,then:function(c){n.push(c)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var c=0;c<n.length;c++)(0,n[c])(t)},function(c){for(r.status="rejected",r.reason=c,c=0;c<n.length;c++)(0,n[c])(void 0)}),r}var Vf=w.S;w.S=function(e,t){Th=Mt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&gy(e,t),Vf!==null&&Vf(e,t)};var Jn=C(null);function sc(){var e=Jn.current;return e!==null?e:Xe.pooledCache}function Xs(e,t){t===null?X(Jn,Jn.current):X(Jn,t.pool)}function Ff(){var e=sc();return e===null?null:{parent:rt._currentValue,pool:e}}var Lr=Error(o(460)),ic=Error(o(474)),Ks=Error(o(542)),Zs={then:function(){}};function Yf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Xf(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(La,La),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Zf(e),e;default:if(typeof t.status=="string")t.then(La,La);else{if(e=Xe,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=r}},function(r){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Zf(e),e}throw In=t,Lr}}function Pn(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(In=n,Lr):n}}var In=null;function Kf(){if(In===null)throw Error(o(459));var e=In;return In=null,e}function Zf(e){if(e===Lr||e===Ks)throw Error(o(483))}var Ur=null,zl=0;function $s(e){var t=zl;return zl+=1,Ur===null&&(Ur=[]),Xf(Ur,e,t)}function Dl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Js(e,t){throw t.$$typeof===N?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function $f(e){function t(k,_){if(e){var z=k.deletions;z===null?(k.deletions=[_],k.flags|=16):z.push(_)}}function n(k,_){if(!e)return null;for(;_!==null;)t(k,_),_=_.sibling;return null}function r(k){for(var _=new Map;k!==null;)k.key!==null?_.set(k.key,k):_.set(k.index,k),k=k.sibling;return _}function c(k,_){return k=Ba(k,_),k.index=0,k.sibling=null,k}function u(k,_,z){return k.index=z,e?(z=k.alternate,z!==null?(z=z.index,z<_?(k.flags|=67108866,_):z):(k.flags|=67108866,_)):(k.flags|=1048576,_)}function h(k){return e&&k.alternate===null&&(k.flags|=67108866),k}function b(k,_,z,J){return _===null||_.tag!==6?(_=$o(z,k.mode,J),_.return=k,_):(_=c(_,z),_.return=k,_)}function T(k,_,z,J){var pe=z.type;return pe===E?K(k,_,z.props.children,J,z.key):_!==null&&(_.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===G&&Pn(pe)===_.type)?(_=c(_,z.props),Dl(_,z),_.return=k,_):(_=Qs(z.type,z.key,z.props,null,k.mode,J),Dl(_,z),_.return=k,_)}function D(k,_,z,J){return _===null||_.tag!==4||_.stateNode.containerInfo!==z.containerInfo||_.stateNode.implementation!==z.implementation?(_=Jo(z,k.mode,J),_.return=k,_):(_=c(_,z.children||[]),_.return=k,_)}function K(k,_,z,J,pe){return _===null||_.tag!==7?(_=Xn(z,k.mode,J,pe),_.return=k,_):(_=c(_,z),_.return=k,_)}function P(k,_,z){if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return _=$o(""+_,k.mode,z),_.return=k,_;if(typeof _=="object"&&_!==null){switch(_.$$typeof){case A:return z=Qs(_.type,_.key,_.props,null,k.mode,z),Dl(z,_),z.return=k,z;case j:return _=Jo(_,k.mode,z),_.return=k,_;case G:return _=Pn(_),P(k,_,z)}if(ee(_)||me(_))return _=Xn(_,k.mode,z,null),_.return=k,_;if(typeof _.then=="function")return P(k,$s(_),z);if(_.$$typeof===V)return P(k,Ys(k,_),z);Js(k,_)}return null}function L(k,_,z,J){var pe=_!==null?_.key:null;if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return pe!==null?null:b(k,_,""+z,J);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case A:return z.key===pe?T(k,_,z,J):null;case j:return z.key===pe?D(k,_,z,J):null;case G:return z=Pn(z),L(k,_,z,J)}if(ee(z)||me(z))return pe!==null?null:K(k,_,z,J,null);if(typeof z.then=="function")return L(k,_,$s(z),J);if(z.$$typeof===V)return L(k,_,Ys(k,z),J);Js(k,z)}return null}function q(k,_,z,J,pe){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return k=k.get(z)||null,b(_,k,""+J,pe);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case A:return k=k.get(J.key===null?z:J.key)||null,T(_,k,J,pe);case j:return k=k.get(J.key===null?z:J.key)||null,D(_,k,J,pe);case G:return J=Pn(J),q(k,_,z,J,pe)}if(ee(J)||me(J))return k=k.get(z)||null,K(_,k,J,pe,null);if(typeof J.then=="function")return q(k,_,z,$s(J),pe);if(J.$$typeof===V)return q(k,_,z,Ys(_,J),pe);Js(_,J)}return null}function ce(k,_,z,J){for(var pe=null,Be=null,fe=_,Te=_=0,Le=null;fe!==null&&Te<z.length;Te++){fe.index>Te?(Le=fe,fe=null):Le=fe.sibling;var qe=L(k,fe,z[Te],J);if(qe===null){fe===null&&(fe=Le);break}e&&fe&&qe.alternate===null&&t(k,fe),_=u(qe,_,Te),Be===null?pe=qe:Be.sibling=qe,Be=qe,fe=Le}if(Te===z.length)return n(k,fe),Ue&&qa(k,Te),pe;if(fe===null){for(;Te<z.length;Te++)fe=P(k,z[Te],J),fe!==null&&(_=u(fe,_,Te),Be===null?pe=fe:Be.sibling=fe,Be=fe);return Ue&&qa(k,Te),pe}for(fe=r(fe);Te<z.length;Te++)Le=q(fe,k,Te,z[Te],J),Le!==null&&(e&&Le.alternate!==null&&fe.delete(Le.key===null?Te:Le.key),_=u(Le,_,Te),Be===null?pe=Le:Be.sibling=Le,Be=Le);return e&&fe.forEach(function(_n){return t(k,_n)}),Ue&&qa(k,Te),pe}function ge(k,_,z,J){if(z==null)throw Error(o(151));for(var pe=null,Be=null,fe=_,Te=_=0,Le=null,qe=z.next();fe!==null&&!qe.done;Te++,qe=z.next()){fe.index>Te?(Le=fe,fe=null):Le=fe.sibling;var _n=L(k,fe,qe.value,J);if(_n===null){fe===null&&(fe=Le);break}e&&fe&&_n.alternate===null&&t(k,fe),_=u(_n,_,Te),Be===null?pe=_n:Be.sibling=_n,Be=_n,fe=Le}if(qe.done)return n(k,fe),Ue&&qa(k,Te),pe;if(fe===null){for(;!qe.done;Te++,qe=z.next())qe=P(k,qe.value,J),qe!==null&&(_=u(qe,_,Te),Be===null?pe=qe:Be.sibling=qe,Be=qe);return Ue&&qa(k,Te),pe}for(fe=r(fe);!qe.done;Te++,qe=z.next())qe=q(fe,k,Te,qe.value,J),qe!==null&&(e&&qe.alternate!==null&&fe.delete(qe.key===null?Te:qe.key),_=u(qe,_,Te),Be===null?pe=qe:Be.sibling=qe,Be=qe);return e&&fe.forEach(function(Mb){return t(k,Mb)}),Ue&&qa(k,Te),pe}function Ye(k,_,z,J){if(typeof z=="object"&&z!==null&&z.type===E&&z.key===null&&(z=z.props.children),typeof z=="object"&&z!==null){switch(z.$$typeof){case A:e:{for(var pe=z.key;_!==null;){if(_.key===pe){if(pe=z.type,pe===E){if(_.tag===7){n(k,_.sibling),J=c(_,z.props.children),J.return=k,k=J;break e}}else if(_.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===G&&Pn(pe)===_.type){n(k,_.sibling),J=c(_,z.props),Dl(J,z),J.return=k,k=J;break e}n(k,_);break}else t(k,_);_=_.sibling}z.type===E?(J=Xn(z.props.children,k.mode,J,z.key),J.return=k,k=J):(J=Qs(z.type,z.key,z.props,null,k.mode,J),Dl(J,z),J.return=k,k=J)}return h(k);case j:e:{for(pe=z.key;_!==null;){if(_.key===pe)if(_.tag===4&&_.stateNode.containerInfo===z.containerInfo&&_.stateNode.implementation===z.implementation){n(k,_.sibling),J=c(_,z.children||[]),J.return=k,k=J;break e}else{n(k,_);break}else t(k,_);_=_.sibling}J=Jo(z,k.mode,J),J.return=k,k=J}return h(k);case G:return z=Pn(z),Ye(k,_,z,J)}if(ee(z))return ce(k,_,z,J);if(me(z)){if(pe=me(z),typeof pe!="function")throw Error(o(150));return z=pe.call(z),ge(k,_,z,J)}if(typeof z.then=="function")return Ye(k,_,$s(z),J);if(z.$$typeof===V)return Ye(k,_,Ys(k,z),J);Js(k,z)}return typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint"?(z=""+z,_!==null&&_.tag===6?(n(k,_.sibling),J=c(_,z),J.return=k,k=J):(n(k,_),J=$o(z,k.mode,J),J.return=k,k=J),h(k)):n(k,_)}return function(k,_,z,J){try{zl=0;var pe=Ye(k,_,z,J);return Ur=null,pe}catch(fe){if(fe===Lr||fe===Ks)throw fe;var Be=Jt(29,fe,null,k.mode);return Be.lanes=J,Be.return=k,Be}}}var Wn=$f(!0),Jf=$f(!1),fn=!1;function oc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function cc(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 mn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function hn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(He&2)!==0){var c=r.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),r.pending=t,t=Gs(e),Of(e,null,n),t}return Hs(e,r,t,n),Gs(e)}function Ll(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Lt(e,n)}}function uc(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var c=null,u=null;if(n=n.firstBaseUpdate,n!==null){do{var h={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};u===null?c=u=h:u=u.next=h,n=n.next}while(n!==null);u===null?c=u=t:u=u.next=t}else c=u=t;n={baseState:r.baseState,firstBaseUpdate:c,lastBaseUpdate:u,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var dc=!1;function Ul(){if(dc){var e=Dr;if(e!==null)throw e}}function Bl(e,t,n,r){dc=!1;var c=e.updateQueue;fn=!1;var u=c.firstBaseUpdate,h=c.lastBaseUpdate,b=c.shared.pending;if(b!==null){c.shared.pending=null;var T=b,D=T.next;T.next=null,h===null?u=D:h.next=D,h=T;var K=e.alternate;K!==null&&(K=K.updateQueue,b=K.lastBaseUpdate,b!==h&&(b===null?K.firstBaseUpdate=D:b.next=D,K.lastBaseUpdate=T))}if(u!==null){var P=c.baseState;h=0,K=D=T=null,b=u;do{var L=b.lane&-536870913,q=L!==b.lane;if(q?(De&L)===L:(r&L)===L){L!==0&&L===zr&&(dc=!0),K!==null&&(K=K.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});e:{var ce=e,ge=b;L=t;var Ye=n;switch(ge.tag){case 1:if(ce=ge.payload,typeof ce=="function"){P=ce.call(Ye,P,L);break e}P=ce;break e;case 3:ce.flags=ce.flags&-65537|128;case 0:if(ce=ge.payload,L=typeof ce=="function"?ce.call(Ye,P,L):ce,L==null)break e;P=x({},P,L);break e;case 2:fn=!0}}L=b.callback,L!==null&&(e.flags|=64,q&&(e.flags|=8192),q=c.callbacks,q===null?c.callbacks=[L]:q.push(L))}else q={lane:L,tag:b.tag,payload:b.payload,callback:b.callback,next:null},K===null?(D=K=q,T=P):K=K.next=q,h|=L;if(b=b.next,b===null){if(b=c.shared.pending,b===null)break;q=b,b=q.next,q.next=null,c.lastBaseUpdate=q,c.shared.pending=null}}while(!0);K===null&&(T=P),c.baseState=T,c.firstBaseUpdate=D,c.lastBaseUpdate=K,u===null&&(c.shared.lanes=0),yn|=h,e.lanes=h,e.memoizedState=P}}function Pf(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function If(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Pf(n[e],t)}var Br=C(null),Ps=C(0);function Wf(e,t){e=Ja,X(Ps,e),X(Br,t),Ja=e|t.baseLanes}function fc(){X(Ps,Ja),X(Br,Br.current)}function mc(){Ja=Ps.current,Y(Br),Y(Ps)}var Pt=C(null),fa=null;function pn(e){var t=e.alternate;X(tt,tt.current&1),X(Pt,e),fa===null&&(t===null||Br.current!==null||t.memoizedState!==null)&&(fa=e)}function hc(e){X(tt,tt.current),X(Pt,e),fa===null&&(fa=e)}function em(e){e.tag===22?(X(tt,tt.current),X(Pt,e),fa===null&&(fa=e)):xn()}function xn(){X(tt,tt.current),X(Pt,Pt.current)}function It(e){Y(Pt),fa===e&&(fa=null),Y(tt)}var tt=C(0);function Is(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||bu(n)||Su(n)))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 Qa=0,Ee=null,Ve=null,lt=null,Ws=!1,qr=!1,er=!1,ei=0,ql=0,Hr=null,by=0;function We(){throw Error(o(321))}function pc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!$t(e[n],t[n]))return!1;return!0}function xc(e,t,n,r,c,u){return Qa=u,Ee=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,w.H=e===null||e.memoizedState===null?Um:Ac,er=!1,u=n(r,c),er=!1,qr&&(u=am(t,n,r,c)),tm(e),u}function tm(e){w.H=Ql;var t=Ve!==null&&Ve.next!==null;if(Qa=0,lt=Ve=Ee=null,Ws=!1,ql=0,Hr=null,t)throw Error(o(300));e===null||st||(e=e.dependencies,e!==null&&Fs(e)&&(st=!0))}function am(e,t,n,r){Ee=e;var c=0;do{if(qr&&(Hr=null),ql=0,qr=!1,25<=c)throw Error(o(301));if(c+=1,lt=Ve=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}w.H=Bm,u=t(n,r)}while(qr);return u}function Sy(){var e=w.H,t=e.useState()[0];return t=typeof t.then=="function"?Hl(t):t,e=e.useState()[0],(Ve!==null?Ve.memoizedState:null)!==e&&(Ee.flags|=1024),t}function vc(){var e=ei!==0;return ei=0,e}function gc(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function yc(e){if(Ws){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ws=!1}Qa=0,lt=Ve=Ee=null,qr=!1,ql=ei=0,Hr=null}function kt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lt===null?Ee.memoizedState=lt=e:lt=lt.next=e,lt}function at(){if(Ve===null){var e=Ee.alternate;e=e!==null?e.memoizedState:null}else e=Ve.next;var t=lt===null?Ee.memoizedState:lt.next;if(t!==null)lt=t,Ve=e;else{if(e===null)throw Ee.alternate===null?Error(o(467)):Error(o(310));Ve=e,e={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},lt===null?Ee.memoizedState=lt=e:lt=lt.next=e}return lt}function ti(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Hl(e){var t=ql;return ql+=1,Hr===null&&(Hr=[]),e=Xf(Hr,e,t),t=Ee,(lt===null?t.memoizedState:lt.next)===null&&(t=t.alternate,w.H=t===null||t.memoizedState===null?Um:Ac),e}function ai(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Hl(e);if(e.$$typeof===V)return bt(e)}throw Error(o(438,String(e)))}function bc(e){var t=null,n=Ee.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Ee.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=ti(),Ee.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=je;return t.index++,n}function Va(e,t){return typeof t=="function"?t(e):t}function ni(e){var t=at();return Sc(t,Ve,e)}function Sc(e,t,n){var r=e.queue;if(r===null)throw Error(o(311));r.lastRenderedReducer=n;var c=e.baseQueue,u=r.pending;if(u!==null){if(c!==null){var h=c.next;c.next=u.next,u.next=h}t.baseQueue=c=u,r.pending=null}if(u=e.baseState,c===null)e.memoizedState=u;else{t=c.next;var b=h=null,T=null,D=t,K=!1;do{var P=D.lane&-536870913;if(P!==D.lane?(De&P)===P:(Qa&P)===P){var L=D.revertLane;if(L===0)T!==null&&(T=T.next={lane:0,revertLane:0,gesture:null,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null}),P===zr&&(K=!0);else if((Qa&L)===L){D=D.next,L===zr&&(K=!0);continue}else P={lane:0,revertLane:D.revertLane,gesture:null,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null},T===null?(b=T=P,h=u):T=T.next=P,Ee.lanes|=L,yn|=L;P=D.action,er&&n(u,P),u=D.hasEagerState?D.eagerState:n(u,P)}else L={lane:P,revertLane:D.revertLane,gesture:D.gesture,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null},T===null?(b=T=L,h=u):T=T.next=L,Ee.lanes|=P,yn|=P;D=D.next}while(D!==null&&D!==t);if(T===null?h=u:T.next=b,!$t(u,e.memoizedState)&&(st=!0,K&&(n=Dr,n!==null)))throw n;e.memoizedState=u,e.baseState=h,e.baseQueue=T,r.lastRenderedState=u}return c===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Nc(e){var t=at(),n=t.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=e;var r=n.dispatch,c=n.pending,u=t.memoizedState;if(c!==null){n.pending=null;var h=c=c.next;do u=e(u,h.action),h=h.next;while(h!==c);$t(u,t.memoizedState)||(st=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),n.lastRenderedState=u}return[u,r]}function nm(e,t,n){var r=Ee,c=at(),u=Ue;if(u){if(n===void 0)throw Error(o(407));n=n()}else n=t();var h=!$t((Ve||c).memoizedState,n);if(h&&(c.memoizedState=n,st=!0),c=c.queue,Ec(sm.bind(null,r,c,e),[e]),c.getSnapshot!==t||h||lt!==null&&lt.memoizedState.tag&1){if(r.flags|=2048,Gr(9,{destroy:void 0},lm.bind(null,r,c,n,t),null),Xe===null)throw Error(o(349));u||(Qa&127)!==0||rm(r,t,n)}return n}function rm(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ee.updateQueue,t===null?(t=ti(),Ee.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function lm(e,t,n,r){t.value=n,t.getSnapshot=r,im(t)&&om(e)}function sm(e,t,n){return n(function(){im(t)&&om(e)})}function im(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!$t(e,n)}catch{return!0}}function om(e){var t=Yn(e,2);t!==null&&Ft(t,e,2)}function jc(e){var t=kt();if(typeof e=="function"){var n=e;if(e=n(),er){ga(!0);try{n()}finally{ga(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Va,lastRenderedState:e},t}function cm(e,t,n,r){return e.baseState=n,Sc(e,Ve,typeof r=="function"?r:Va)}function Ny(e,t,n,r,c){if(si(e))throw Error(o(485));if(e=t.action,e!==null){var u={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(h){u.listeners.push(h)}};w.T!==null?n(!0):u.isTransition=!1,r(u),n=t.pending,n===null?(u.next=t.pending=u,um(t,u)):(u.next=n.next,t.pending=n.next=u)}}function um(e,t){var n=t.action,r=t.payload,c=e.state;if(t.isTransition){var u=w.T,h={};w.T=h;try{var b=n(c,r),T=w.S;T!==null&&T(h,b),dm(e,t,b)}catch(D){wc(e,t,D)}finally{u!==null&&h.types!==null&&(u.types=h.types),w.T=u}}else try{u=n(c,r),dm(e,t,u)}catch(D){wc(e,t,D)}}function dm(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){fm(e,t,r)},function(r){return wc(e,t,r)}):fm(e,t,n)}function fm(e,t,n){t.status="fulfilled",t.value=n,mm(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,um(e,n)))}function wc(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=n,mm(t),t=t.next;while(t!==r)}e.action=null}function mm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function hm(e,t){return t}function pm(e,t){if(Ue){var n=Xe.formState;if(n!==null){e:{var r=Ee;if(Ue){if(Ke){t:{for(var c=Ke,u=da;c.nodeType!==8;){if(!u){c=null;break t}if(c=ma(c.nextSibling),c===null){c=null;break t}}u=c.data,c=u==="F!"||u==="F"?c:null}if(c){Ke=ma(c.nextSibling),r=c.data==="F!";break e}}un(r)}r=!1}r&&(t=n[0])}}return n=kt(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hm,lastRenderedState:t},n.queue=r,n=zm.bind(null,Ee,r),r.dispatch=n,r=jc(!1),u=Mc.bind(null,Ee,!1,r.queue),r=kt(),c={state:t,dispatch:null,action:e,pending:null},r.queue=c,n=Ny.bind(null,Ee,c,u,n),c.dispatch=n,r.memoizedState=e,[t,n,!1]}function xm(e){var t=at();return vm(t,Ve,e)}function vm(e,t,n){if(t=Sc(e,t,hm)[0],e=ni(Va)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Hl(t)}catch(h){throw h===Lr?Ks:h}else r=t;t=at();var c=t.queue,u=c.dispatch;return n!==t.memoizedState&&(Ee.flags|=2048,Gr(9,{destroy:void 0},jy.bind(null,c,n),null)),[r,u,e]}function jy(e,t){e.action=t}function gm(e){var t=at(),n=Ve;if(n!==null)return vm(t,n,e);at(),t=t.memoizedState,n=at();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Gr(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Ee.updateQueue,t===null&&(t=ti(),Ee.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ym(){return at().memoizedState}function ri(e,t,n,r){var c=kt();Ee.flags|=e,c.memoizedState=Gr(1|t,{destroy:void 0},n,r===void 0?null:r)}function li(e,t,n,r){var c=at();r=r===void 0?null:r;var u=c.memoizedState.inst;Ve!==null&&r!==null&&pc(r,Ve.memoizedState.deps)?c.memoizedState=Gr(t,u,n,r):(Ee.flags|=e,c.memoizedState=Gr(1|t,u,n,r))}function bm(e,t){ri(8390656,8,e,t)}function Ec(e,t){li(2048,8,e,t)}function wy(e){Ee.flags|=4;var t=Ee.updateQueue;if(t===null)t=ti(),Ee.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Sm(e){var t=at().memoizedState;return wy({ref:t,nextImpl:e}),function(){if((He&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Nm(e,t){return li(4,2,e,t)}function jm(e,t){return li(4,4,e,t)}function wm(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Em(e,t,n){n=n!=null?n.concat([e]):null,li(4,4,wm.bind(null,t,e),n)}function Tc(){}function Tm(e,t){var n=at();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&pc(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Rm(e,t){var n=at();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&pc(t,r[1]))return r[0];if(r=e(),er){ga(!0);try{e()}finally{ga(!1)}}return n.memoizedState=[r,t],r}function Rc(e,t,n){return n===void 0||(Qa&1073741824)!==0&&(De&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Ch(),Ee.lanes|=e,yn|=e,n)}function Cm(e,t,n,r){return $t(n,t)?n:Br.current!==null?(e=Rc(e,n,r),$t(e,t)||(st=!0),e):(Qa&42)===0||(Qa&1073741824)!==0&&(De&261930)===0?(st=!0,e.memoizedState=n):(e=Ch(),Ee.lanes|=e,yn|=e,t)}function _m(e,t,n,r,c){var u=Q.p;Q.p=u!==0&&8>u?u:8;var h=w.T,b={};w.T=b,Mc(e,!1,t,n);try{var T=c(),D=w.S;if(D!==null&&D(b,T),T!==null&&typeof T=="object"&&typeof T.then=="function"){var K=yy(T,r);Gl(e,t,K,ta(e))}else Gl(e,t,r,ta(e))}catch(P){Gl(e,t,{then:function(){},status:"rejected",reason:P},ta())}finally{Q.p=u,h!==null&&b.types!==null&&(h.types=b.types),w.T=h}}function Ey(){}function Cc(e,t,n,r){if(e.tag!==5)throw Error(o(476));var c=Mm(e).queue;_m(e,c,t,F,n===null?Ey:function(){return Am(e),n(r)})}function Mm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Va,lastRenderedState:F},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Va,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Am(e){var t=Mm(e);t.next===null&&(t=e.alternate.memoizedState),Gl(e,t.next.queue,{},ta())}function _c(){return bt(rs)}function km(){return at().memoizedState}function Om(){return at().memoizedState}function Ty(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=ta();e=mn(n);var r=hn(t,e,n);r!==null&&(Ft(r,t,n),Ll(r,t,n)),t={cache:rc()},e.payload=t;return}t=t.return}}function Ry(e,t,n){var r=ta();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},si(e)?Dm(t,n):(n=Ko(e,t,n,r),n!==null&&(Ft(n,e,r),Lm(n,t,r)))}function zm(e,t,n){var r=ta();Gl(e,t,n,r)}function Gl(e,t,n,r){var c={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(si(e))Dm(t,c);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var h=t.lastRenderedState,b=u(h,n);if(c.hasEagerState=!0,c.eagerState=b,$t(b,h))return Hs(e,t,c,0),Xe===null&&qs(),!1}catch{}if(n=Ko(e,t,c,r),n!==null)return Ft(n,e,r),Lm(n,t,r),!0}return!1}function Mc(e,t,n,r){if(r={lane:2,revertLane:ou(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},si(e)){if(t)throw Error(o(479))}else t=Ko(e,n,r,2),t!==null&&Ft(t,e,2)}function si(e){var t=e.alternate;return e===Ee||t!==null&&t===Ee}function Dm(e,t){qr=Ws=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Lm(e,t,n){if((n&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Lt(e,n)}}var Ql={readContext:bt,use:ai,useCallback:We,useContext:We,useEffect:We,useImperativeHandle:We,useLayoutEffect:We,useInsertionEffect:We,useMemo:We,useReducer:We,useRef:We,useState:We,useDebugValue:We,useDeferredValue:We,useTransition:We,useSyncExternalStore:We,useId:We,useHostTransitionStatus:We,useFormState:We,useActionState:We,useOptimistic:We,useMemoCache:We,useCacheRefresh:We};Ql.useEffectEvent=We;var Um={readContext:bt,use:ai,useCallback:function(e,t){return kt().memoizedState=[e,t===void 0?null:t],e},useContext:bt,useEffect:bm,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,ri(4194308,4,wm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ri(4194308,4,e,t)},useInsertionEffect:function(e,t){ri(4,2,e,t)},useMemo:function(e,t){var n=kt();t=t===void 0?null:t;var r=e();if(er){ga(!0);try{e()}finally{ga(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=kt();if(n!==void 0){var c=n(t);if(er){ga(!0);try{n(t)}finally{ga(!1)}}}else c=t;return r.memoizedState=r.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},r.queue=e,e=e.dispatch=Ry.bind(null,Ee,e),[r.memoizedState,e]},useRef:function(e){var t=kt();return e={current:e},t.memoizedState=e},useState:function(e){e=jc(e);var t=e.queue,n=zm.bind(null,Ee,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Tc,useDeferredValue:function(e,t){var n=kt();return Rc(n,e,t)},useTransition:function(){var e=jc(!1);return e=_m.bind(null,Ee,e.queue,!0,!1),kt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Ee,c=kt();if(Ue){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),Xe===null)throw Error(o(349));(De&127)!==0||rm(r,t,n)}c.memoizedState=n;var u={value:n,getSnapshot:t};return c.queue=u,bm(sm.bind(null,r,u,e),[e]),r.flags|=2048,Gr(9,{destroy:void 0},lm.bind(null,r,u,n,t),null),n},useId:function(){var e=kt(),t=Xe.identifierPrefix;if(Ue){var n=_a,r=Ca;n=(r&~(1<<32-wt(r)-1)).toString(32)+n,t="_"+t+"R_"+n,n=ei++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=by++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:_c,useFormState:pm,useActionState:pm,useOptimistic:function(e){var t=kt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Mc.bind(null,Ee,!0,n),n.dispatch=t,[e,t]},useMemoCache:bc,useCacheRefresh:function(){return kt().memoizedState=Ty.bind(null,Ee)},useEffectEvent:function(e){var t=kt(),n={impl:e};return t.memoizedState=n,function(){if((He&2)!==0)throw Error(o(440));return n.impl.apply(void 0,arguments)}}},Ac={readContext:bt,use:ai,useCallback:Tm,useContext:bt,useEffect:Ec,useImperativeHandle:Em,useInsertionEffect:Nm,useLayoutEffect:jm,useMemo:Rm,useReducer:ni,useRef:ym,useState:function(){return ni(Va)},useDebugValue:Tc,useDeferredValue:function(e,t){var n=at();return Cm(n,Ve.memoizedState,e,t)},useTransition:function(){var e=ni(Va)[0],t=at().memoizedState;return[typeof e=="boolean"?e:Hl(e),t]},useSyncExternalStore:nm,useId:km,useHostTransitionStatus:_c,useFormState:xm,useActionState:xm,useOptimistic:function(e,t){var n=at();return cm(n,Ve,e,t)},useMemoCache:bc,useCacheRefresh:Om};Ac.useEffectEvent=Sm;var Bm={readContext:bt,use:ai,useCallback:Tm,useContext:bt,useEffect:Ec,useImperativeHandle:Em,useInsertionEffect:Nm,useLayoutEffect:jm,useMemo:Rm,useReducer:Nc,useRef:ym,useState:function(){return Nc(Va)},useDebugValue:Tc,useDeferredValue:function(e,t){var n=at();return Ve===null?Rc(n,e,t):Cm(n,Ve.memoizedState,e,t)},useTransition:function(){var e=Nc(Va)[0],t=at().memoizedState;return[typeof e=="boolean"?e:Hl(e),t]},useSyncExternalStore:nm,useId:km,useHostTransitionStatus:_c,useFormState:gm,useActionState:gm,useOptimistic:function(e,t){var n=at();return Ve!==null?cm(n,Ve,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:bc,useCacheRefresh:Om};Bm.useEffectEvent=Sm;function kc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:x({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Oc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=ta(),c=mn(r);c.payload=t,n!=null&&(c.callback=n),t=hn(e,c,r),t!==null&&(Ft(t,e,r),Ll(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=ta(),c=mn(r);c.tag=1,c.payload=t,n!=null&&(c.callback=n),t=hn(e,c,r),t!==null&&(Ft(t,e,r),Ll(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ta(),r=mn(n);r.tag=2,t!=null&&(r.callback=t),t=hn(e,r,n),t!==null&&(Ft(t,e,n),Ll(t,e,n))}};function qm(e,t,n,r,c,u,h){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,u,h):t.prototype&&t.prototype.isPureReactComponent?!Cl(n,r)||!Cl(c,u):!0}function Hm(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Oc.enqueueReplaceState(t,t.state,null)}function tr(e,t){var n=t;if("ref"in t){n={};for(var r in t)r!=="ref"&&(n[r]=t[r])}if(e=e.defaultProps){n===t&&(n=x({},n));for(var c in e)n[c]===void 0&&(n[c]=e[c])}return n}function Gm(e){Bs(e)}function Qm(e){console.error(e)}function Vm(e){Bs(e)}function ii(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function Fm(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function zc(e,t,n){return n=mn(n),n.tag=3,n.payload={element:null},n.callback=function(){ii(e,t)},n}function Ym(e){return e=mn(e),e.tag=3,e}function Xm(e,t,n,r){var c=n.type.getDerivedStateFromError;if(typeof c=="function"){var u=r.value;e.payload=function(){return c(u)},e.callback=function(){Fm(t,n,r)}}var h=n.stateNode;h!==null&&typeof h.componentDidCatch=="function"&&(e.callback=function(){Fm(t,n,r),typeof c!="function"&&(bn===null?bn=new Set([this]):bn.add(this));var b=r.stack;this.componentDidCatch(r.value,{componentStack:b!==null?b:""})})}function Cy(e,t,n,r,c){if(n.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=n.alternate,t!==null&&Or(t,n,c,!0),n=Pt.current,n!==null){switch(n.tag){case 31:case 13:return fa===null?yi():n.alternate===null&&et===0&&(et=3),n.flags&=-257,n.flags|=65536,n.lanes=c,r===Zs?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),lu(e,r,c)),!1;case 22:return n.flags|=65536,r===Zs?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),lu(e,r,c)),!1}throw Error(o(435,n.tag))}return lu(e,r,c),yi(),!1}if(Ue)return t=Pt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,r!==Wo&&(e=Error(o(422),{cause:r}),Al(oa(e,n)))):(r!==Wo&&(t=Error(o(423),{cause:r}),Al(oa(t,n))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,r=oa(r,n),c=zc(e.stateNode,r,c),uc(e,c),et!==4&&(et=2)),!1;var u=Error(o(520),{cause:r});if(u=oa(u,n),Jl===null?Jl=[u]:Jl.push(u),et!==4&&(et=2),t===null)return!0;r=oa(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=c&-c,n.lanes|=e,e=zc(n.stateNode,r,e),uc(n,e),!1;case 1:if(t=n.type,u=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(bn===null||!bn.has(u))))return n.flags|=65536,c&=-c,n.lanes|=c,c=Ym(c),Xm(c,e,n,r),uc(n,c),!1}n=n.return}while(n!==null);return!1}var Dc=Error(o(461)),st=!1;function St(e,t,n,r){t.child=e===null?Jf(t,null,n,r):Wn(t,e.child,n,r)}function Km(e,t,n,r,c){n=n.render;var u=t.ref;if("ref"in r){var h={};for(var b in r)b!=="ref"&&(h[b]=r[b])}else h=r;return $n(t),r=xc(e,t,n,h,u,c),b=vc(),e!==null&&!st?(gc(e,t,c),Fa(e,t,c)):(Ue&&b&&Po(t),t.flags|=1,St(e,t,r,c),t.child)}function Zm(e,t,n,r,c){if(e===null){var u=n.type;return typeof u=="function"&&!Zo(u)&&u.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=u,$m(e,t,u,r,c)):(e=Qs(n.type,null,r,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!Vc(e,c)){var h=u.memoizedProps;if(n=n.compare,n=n!==null?n:Cl,n(h,r)&&e.ref===t.ref)return Fa(e,t,c)}return t.flags|=1,e=Ba(u,r),e.ref=t.ref,e.return=t,t.child=e}function $m(e,t,n,r,c){if(e!==null){var u=e.memoizedProps;if(Cl(u,r)&&e.ref===t.ref)if(st=!1,t.pendingProps=r=u,Vc(e,c))(e.flags&131072)!==0&&(st=!0);else return t.lanes=e.lanes,Fa(e,t,c)}return Lc(e,t,n,r,c)}function Jm(e,t,n,r){var c=r.children,u=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(u=u!==null?u.baseLanes|n:n,e!==null){for(r=t.child=e.child,c=0;r!==null;)c=c|r.lanes|r.childLanes,r=r.sibling;r=c&~u}else r=0,t.child=null;return Pm(e,t,u,n,r)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Xs(t,u!==null?u.cachePool:null),u!==null?Wf(t,u):fc(),em(t);else return r=t.lanes=536870912,Pm(e,t,u!==null?u.baseLanes|n:n,n,r)}else u!==null?(Xs(t,u.cachePool),Wf(t,u),xn(),t.memoizedState=null):(e!==null&&Xs(t,null),fc(),xn());return St(e,t,c,n),t.child}function Vl(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Pm(e,t,n,r,c){var u=sc();return u=u===null?null:{parent:rt._currentValue,pool:u},t.memoizedState={baseLanes:n,cachePool:u},e!==null&&Xs(t,null),fc(),em(t),e!==null&&Or(e,t,r,!0),t.childLanes=c,null}function oi(e,t){return t=ui({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Im(e,t,n){return Wn(t,e.child,null,n),e=oi(t,t.pendingProps),e.flags|=2,It(t),t.memoizedState=null,e}function _y(e,t,n){var r=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ue){if(r.mode==="hidden")return e=oi(t,r),t.lanes=536870912,Vl(null,e);if(hc(t),(e=Ke)?(e=up(e,da),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:on!==null?{id:Ca,overflow:_a}:null,retryLane:536870912,hydrationErrors:null},n=Df(e),n.return=t,t.child=n,yt=t,Ke=null)):e=null,e===null)throw un(t);return t.lanes=536870912,null}return oi(t,r)}var u=e.memoizedState;if(u!==null){var h=u.dehydrated;if(hc(t),c)if(t.flags&256)t.flags&=-257,t=Im(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(st||Or(e,t,n,!1),c=(n&e.childLanes)!==0,st||c){if(r=Xe,r!==null&&(h=Ut(r,n),h!==0&&h!==u.retryLane))throw u.retryLane=h,Yn(e,h),Ft(r,e,h),Dc;yi(),t=Im(e,t,n)}else e=u.treeContext,Ke=ma(h.nextSibling),yt=t,Ue=!0,cn=null,da=!1,e!==null&&Bf(t,e),t=oi(t,r),t.flags|=4096;return t}return e=Ba(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ci(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(o(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Lc(e,t,n,r,c){return $n(t),n=xc(e,t,n,r,void 0,c),r=vc(),e!==null&&!st?(gc(e,t,c),Fa(e,t,c)):(Ue&&r&&Po(t),t.flags|=1,St(e,t,n,c),t.child)}function Wm(e,t,n,r,c,u){return $n(t),t.updateQueue=null,n=am(t,r,n,c),tm(e),r=vc(),e!==null&&!st?(gc(e,t,u),Fa(e,t,u)):(Ue&&r&&Po(t),t.flags|=1,St(e,t,n,u),t.child)}function eh(e,t,n,r,c){if($n(t),t.stateNode===null){var u=_r,h=n.contextType;typeof h=="object"&&h!==null&&(u=bt(h)),u=new n(r,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Oc,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=r,u.state=t.memoizedState,u.refs={},oc(t),h=n.contextType,u.context=typeof h=="object"&&h!==null?bt(h):_r,u.state=t.memoizedState,h=n.getDerivedStateFromProps,typeof h=="function"&&(kc(t,n,h,r),u.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(h=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),h!==u.state&&Oc.enqueueReplaceState(u,u.state,null),Bl(t,r,u,c),Ul(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){u=t.stateNode;var b=t.memoizedProps,T=tr(n,b);u.props=T;var D=u.context,K=n.contextType;h=_r,typeof K=="object"&&K!==null&&(h=bt(K));var P=n.getDerivedStateFromProps;K=typeof P=="function"||typeof u.getSnapshotBeforeUpdate=="function",b=t.pendingProps!==b,K||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(b||D!==h)&&Hm(t,u,r,h),fn=!1;var L=t.memoizedState;u.state=L,Bl(t,r,u,c),Ul(),D=t.memoizedState,b||L!==D||fn?(typeof P=="function"&&(kc(t,n,P,r),D=t.memoizedState),(T=fn||qm(t,n,T,r,L,D,h))?(K||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=D),u.props=r,u.state=D,u.context=h,r=T):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{u=t.stateNode,cc(e,t),h=t.memoizedProps,K=tr(n,h),u.props=K,P=t.pendingProps,L=u.context,D=n.contextType,T=_r,typeof D=="object"&&D!==null&&(T=bt(D)),b=n.getDerivedStateFromProps,(D=typeof b=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(h!==P||L!==T)&&Hm(t,u,r,T),fn=!1,L=t.memoizedState,u.state=L,Bl(t,r,u,c),Ul();var q=t.memoizedState;h!==P||L!==q||fn||e!==null&&e.dependencies!==null&&Fs(e.dependencies)?(typeof b=="function"&&(kc(t,n,b,r),q=t.memoizedState),(K=fn||qm(t,n,K,r,L,q,T)||e!==null&&e.dependencies!==null&&Fs(e.dependencies))?(D||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(r,q,T),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(r,q,T)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||h===e.memoizedProps&&L===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&L===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=q),u.props=r,u.state=q,u.context=T,r=K):(typeof u.componentDidUpdate!="function"||h===e.memoizedProps&&L===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&L===e.memoizedState||(t.flags|=1024),r=!1)}return u=r,ci(e,t),r=(t.flags&128)!==0,u||r?(u=t.stateNode,n=r&&typeof n.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&r?(t.child=Wn(t,e.child,null,c),t.child=Wn(t,null,n,c)):St(e,t,n,c),t.memoizedState=u.state,e=t.child):e=Fa(e,t,c),e}function th(e,t,n,r){return Kn(),t.flags|=256,St(e,t,n,r),t.child}var Uc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Bc(e){return{baseLanes:e,cachePool:Ff()}}function qc(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=ea),e}function ah(e,t,n){var r=t.pendingProps,c=!1,u=(t.flags&128)!==0,h;if((h=u)||(h=e!==null&&e.memoizedState===null?!1:(tt.current&2)!==0),h&&(c=!0,t.flags&=-129),h=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ue){if(c?pn(t):xn(),(e=Ke)?(e=up(e,da),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:on!==null?{id:Ca,overflow:_a}:null,retryLane:536870912,hydrationErrors:null},n=Df(e),n.return=t,t.child=n,yt=t,Ke=null)):e=null,e===null)throw un(t);return Su(e)?t.lanes=32:t.lanes=536870912,null}var b=r.children;return r=r.fallback,c?(xn(),c=t.mode,b=ui({mode:"hidden",children:b},c),r=Xn(r,c,n,null),b.return=t,r.return=t,b.sibling=r,t.child=b,r=t.child,r.memoizedState=Bc(n),r.childLanes=qc(e,h,n),t.memoizedState=Uc,Vl(null,r)):(pn(t),Hc(t,b))}var T=e.memoizedState;if(T!==null&&(b=T.dehydrated,b!==null)){if(u)t.flags&256?(pn(t),t.flags&=-257,t=Gc(e,t,n)):t.memoizedState!==null?(xn(),t.child=e.child,t.flags|=128,t=null):(xn(),b=r.fallback,c=t.mode,r=ui({mode:"visible",children:r.children},c),b=Xn(b,c,n,null),b.flags|=2,r.return=t,b.return=t,r.sibling=b,t.child=r,Wn(t,e.child,null,n),r=t.child,r.memoizedState=Bc(n),r.childLanes=qc(e,h,n),t.memoizedState=Uc,t=Vl(null,r));else if(pn(t),Su(b)){if(h=b.nextSibling&&b.nextSibling.dataset,h)var D=h.dgst;h=D,r=Error(o(419)),r.stack="",r.digest=h,Al({value:r,source:null,stack:null}),t=Gc(e,t,n)}else if(st||Or(e,t,n,!1),h=(n&e.childLanes)!==0,st||h){if(h=Xe,h!==null&&(r=Ut(h,n),r!==0&&r!==T.retryLane))throw T.retryLane=r,Yn(e,r),Ft(h,e,r),Dc;bu(b)||yi(),t=Gc(e,t,n)}else bu(b)?(t.flags|=192,t.child=e.child,t=null):(e=T.treeContext,Ke=ma(b.nextSibling),yt=t,Ue=!0,cn=null,da=!1,e!==null&&Bf(t,e),t=Hc(t,r.children),t.flags|=4096);return t}return c?(xn(),b=r.fallback,c=t.mode,T=e.child,D=T.sibling,r=Ba(T,{mode:"hidden",children:r.children}),r.subtreeFlags=T.subtreeFlags&65011712,D!==null?b=Ba(D,b):(b=Xn(b,c,n,null),b.flags|=2),b.return=t,r.return=t,r.sibling=b,t.child=r,Vl(null,r),r=t.child,b=e.child.memoizedState,b===null?b=Bc(n):(c=b.cachePool,c!==null?(T=rt._currentValue,c=c.parent!==T?{parent:T,pool:T}:c):c=Ff(),b={baseLanes:b.baseLanes|n,cachePool:c}),r.memoizedState=b,r.childLanes=qc(e,h,n),t.memoizedState=Uc,Vl(e.child,r)):(pn(t),n=e.child,e=n.sibling,n=Ba(n,{mode:"visible",children:r.children}),n.return=t,n.sibling=null,e!==null&&(h=t.deletions,h===null?(t.deletions=[e],t.flags|=16):h.push(e)),t.child=n,t.memoizedState=null,n)}function Hc(e,t){return t=ui({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ui(e,t){return e=Jt(22,e,null,t),e.lanes=0,e}function Gc(e,t,n){return Wn(t,e.child,null,n),e=Hc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function nh(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ac(e.return,t,n)}function Qc(e,t,n,r,c,u){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:c,treeForkCount:u}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=r,h.tail=n,h.tailMode=c,h.treeForkCount=u)}function rh(e,t,n){var r=t.pendingProps,c=r.revealOrder,u=r.tail;r=r.children;var h=tt.current,b=(h&2)!==0;if(b?(h=h&1|2,t.flags|=128):h&=1,X(tt,h),St(e,t,r,n),r=Ue?Ml:0,!b&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&nh(e,n,t);else if(e.tag===19)nh(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"forwards":for(n=t.child,c=null;n!==null;)e=n.alternate,e!==null&&Is(e)===null&&(c=n),n=n.sibling;n=c,n===null?(c=t.child,t.child=null):(c=n.sibling,n.sibling=null),Qc(t,!1,c,n,u,r);break;case"backwards":case"unstable_legacy-backwards":for(n=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&Is(e)===null){t.child=c;break}e=c.sibling,c.sibling=n,n=c,c=e}Qc(t,!0,n,null,u,r);break;case"together":Qc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Fa(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),yn|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Or(e,t,n,!1),(n&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,n=Ba(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ba(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Vc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Fs(e)))}function My(e,t,n){switch(t.tag){case 3:oe(t,t.stateNode.containerInfo),dn(t,rt,e.memoizedState.cache),Kn();break;case 27:case 5:ae(t);break;case 4:oe(t,t.stateNode.containerInfo);break;case 10:dn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,hc(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(pn(t),t.flags|=128,null):(n&t.child.childLanes)!==0?ah(e,t,n):(pn(t),e=Fa(e,t,n),e!==null?e.sibling:null);pn(t);break;case 19:var c=(e.flags&128)!==0;if(r=(n&t.childLanes)!==0,r||(Or(e,t,n,!1),r=(n&t.childLanes)!==0),c){if(r)return rh(e,t,n);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),X(tt,tt.current),r)break;return null;case 22:return t.lanes=0,Jm(e,t,n,t.pendingProps);case 24:dn(t,rt,e.memoizedState.cache)}return Fa(e,t,n)}function lh(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)st=!0;else{if(!Vc(e,n)&&(t.flags&128)===0)return st=!1,My(e,t,n);st=(e.flags&131072)!==0}else st=!1,Ue&&(t.flags&1048576)!==0&&Uf(t,Ml,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=Pn(t.elementType),t.type=e,typeof e=="function")Zo(e)?(r=tr(e,r),t.tag=1,t=eh(null,t,e,r,n)):(t.tag=0,t=Lc(null,t,e,r,n));else{if(e!=null){var c=e.$$typeof;if(c===U){t.tag=11,t=Km(null,t,e,r,n);break e}else if(c===$){t.tag=14,t=Zm(null,t,e,r,n);break e}}throw t=Ce(e)||e,Error(o(306,t,""))}}return t;case 0:return Lc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,c=tr(r,t.pendingProps),eh(e,t,r,c,n);case 3:e:{if(oe(t,t.stateNode.containerInfo),e===null)throw Error(o(387));r=t.pendingProps;var u=t.memoizedState;c=u.element,cc(e,t),Bl(t,r,null,n);var h=t.memoizedState;if(r=h.cache,dn(t,rt,r),r!==u.cache&&nc(t,[rt],n,!0),Ul(),r=h.element,u.isDehydrated)if(u={element:r,isDehydrated:!1,cache:h.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=th(e,t,r,n);break e}else if(r!==c){c=oa(Error(o(424)),t),Al(c),t=th(e,t,r,n);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Ke=ma(e.firstChild),yt=t,Ue=!0,cn=null,da=!0,n=Jf(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Kn(),r===c){t=Fa(e,t,n);break e}St(e,t,r,n)}t=t.child}return t;case 26:return ci(e,t),e===null?(n=xp(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ue||(n=t.type,e=t.pendingProps,r=Ti(Z.current).createElement(n),r[gt]=t,r[Bt]=e,Nt(r,n,e),mt(r),t.stateNode=r):t.memoizedState=xp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ae(t),e===null&&Ue&&(r=t.stateNode=mp(t.type,t.pendingProps,Z.current),yt=t,da=!0,c=Ke,wn(t.type)?(Nu=c,Ke=ma(r.firstChild)):Ke=c),St(e,t,t.pendingProps.children,n),ci(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ue&&((c=r=Ke)&&(r=sb(r,t.type,t.pendingProps,da),r!==null?(t.stateNode=r,yt=t,Ke=ma(r.firstChild),da=!1,c=!0):c=!1),c||un(t)),ae(t),c=t.type,u=t.pendingProps,h=e!==null?e.memoizedProps:null,r=u.children,vu(c,u)?r=null:h!==null&&vu(c,h)&&(t.flags|=32),t.memoizedState!==null&&(c=xc(e,t,Sy,null,null,n),rs._currentValue=c),ci(e,t),St(e,t,r,n),t.child;case 6:return e===null&&Ue&&((e=n=Ke)&&(n=ib(n,t.pendingProps,da),n!==null?(t.stateNode=n,yt=t,Ke=null,e=!0):e=!1),e||un(t)),null;case 13:return ah(e,t,n);case 4:return oe(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Wn(t,null,r,n):St(e,t,r,n),t.child;case 11:return Km(e,t,t.type,t.pendingProps,n);case 7:return St(e,t,t.pendingProps,n),t.child;case 8:return St(e,t,t.pendingProps.children,n),t.child;case 12:return St(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,dn(t,t.type,r.value),St(e,t,r.children,n),t.child;case 9:return c=t.type._context,r=t.pendingProps.children,$n(t),c=bt(c),r=r(c),t.flags|=1,St(e,t,r,n),t.child;case 14:return Zm(e,t,t.type,t.pendingProps,n);case 15:return $m(e,t,t.type,t.pendingProps,n);case 19:return rh(e,t,n);case 31:return _y(e,t,n);case 22:return Jm(e,t,n,t.pendingProps);case 24:return $n(t),r=bt(rt),e===null?(c=sc(),c===null&&(c=Xe,u=rc(),c.pooledCache=u,u.refCount++,u!==null&&(c.pooledCacheLanes|=n),c=u),t.memoizedState={parent:r,cache:c},oc(t),dn(t,rt,c)):((e.lanes&n)!==0&&(cc(e,t),Bl(t,null,null,n),Ul()),c=e.memoizedState,u=t.memoizedState,c.parent!==r?(c={parent:r,cache:r},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),dn(t,rt,r)):(r=u.cache,dn(t,rt,r),r!==c.cache&&nc(t,[rt],n,!0))),St(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Ya(e){e.flags|=4}function Fc(e,t,n,r,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(kh())e.flags|=8192;else throw In=Zs,ic}else e.flags&=-16777217}function sh(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Sp(t))if(kh())e.flags|=8192;else throw In=Zs,ic}function di(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Et():536870912,e.lanes|=t,Yr|=t)}function Fl(e,t){if(!Ue)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ze(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var c=e.child;c!==null;)n|=c.lanes|c.childLanes,r|=c.subtreeFlags&65011712,r|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)n|=c.lanes|c.childLanes,r|=c.subtreeFlags,r|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Ay(e,t,n){var r=t.pendingProps;switch(Io(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ze(t),null;case 1:return Ze(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ga(rt),B(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(kr(t)?Ya(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ec())),Ze(t),null;case 26:var c=t.type,u=t.memoizedState;return e===null?(Ya(t),u!==null?(Ze(t),sh(t,u)):(Ze(t),Fc(t,c,null,r,n))):u?u!==e.memoizedState?(Ya(t),Ze(t),sh(t,u)):(Ze(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Ya(t),Ze(t),Fc(t,c,e,r,n)),null;case 27:if(_e(t),n=Z.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ya(t);else{if(!r){if(t.stateNode===null)throw Error(o(166));return Ze(t),null}e=I.current,kr(t)?qf(t):(e=mp(c,r,n),t.stateNode=e,Ya(t))}return Ze(t),null;case 5:if(_e(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ya(t);else{if(!r){if(t.stateNode===null)throw Error(o(166));return Ze(t),null}if(u=I.current,kr(t))qf(t);else{var h=Ti(Z.current);switch(u){case 1:u=h.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:u=h.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":u=h.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":u=h.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":u=h.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof r.is=="string"?h.createElement("select",{is:r.is}):h.createElement("select"),r.multiple?u.multiple=!0:r.size&&(u.size=r.size);break;default:u=typeof r.is=="string"?h.createElement(c,{is:r.is}):h.createElement(c)}}u[gt]=t,u[Bt]=r;e:for(h=t.child;h!==null;){if(h.tag===5||h.tag===6)u.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}t.stateNode=u;e:switch(Nt(u,c,r),c){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Ya(t)}}return Ze(t),Fc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ya(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(o(166));if(e=Z.current,kr(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,c=yt,c!==null)switch(c.tag){case 27:case 5:r=c.memoizedProps}e[gt]=t,e=!!(e.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||ap(e.nodeValue,n)),e||un(t,!0)}else e=Ti(e).createTextNode(r),e[gt]=t,t.stateNode=e}return Ze(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=kr(t),n!==null){if(e===null){if(!r)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[gt]=t}else Kn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ze(t),e=!1}else n=ec(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(It(t),t):(It(t),null);if((t.flags&128)!==0)throw Error(o(558))}return Ze(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=kr(t),r!==null&&r.dehydrated!==null){if(e===null){if(!c)throw Error(o(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(o(317));c[gt]=t}else Kn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ze(t),c=!1}else c=ec(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(It(t),t):(It(t),null)}return It(t),(t.flags&128)!==0?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,c=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(c=r.alternate.memoizedState.cachePool.pool),u=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),u!==c&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),di(t,t.updateQueue),Ze(t),null);case 4:return B(),e===null&&fu(t.stateNode.containerInfo),Ze(t),null;case 10:return Ga(t.type),Ze(t),null;case 19:if(Y(tt),r=t.memoizedState,r===null)return Ze(t),null;if(c=(t.flags&128)!==0,u=r.rendering,u===null)if(c)Fl(r,!1);else{if(et!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=Is(e),u!==null){for(t.flags|=128,Fl(r,!1),e=u.updateQueue,t.updateQueue=e,di(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)zf(n,e),n=n.sibling;return X(tt,tt.current&1|2),Ue&&qa(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Mt()>xi&&(t.flags|=128,c=!0,Fl(r,!1),t.lanes=4194304)}else{if(!c)if(e=Is(u),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,di(t,e),Fl(r,!0),r.tail===null&&r.tailMode==="hidden"&&!u.alternate&&!Ue)return Ze(t),null}else 2*Mt()-r.renderingStartTime>xi&&n!==536870912&&(t.flags|=128,c=!0,Fl(r,!1),t.lanes=4194304);r.isBackwards?(u.sibling=t.child,t.child=u):(e=r.last,e!==null?e.sibling=u:t.child=u,r.last=u)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Mt(),e.sibling=null,n=tt.current,X(tt,c?n&1|2:n&1),Ue&&qa(t,r.treeForkCount),e):(Ze(t),null);case 22:case 23:return It(t),mc(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(n&536870912)!==0&&(t.flags&128)===0&&(Ze(t),t.subtreeFlags&6&&(t.flags|=8192)):Ze(t),n=t.updateQueue,n!==null&&di(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&Y(Jn),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ga(rt),Ze(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function ky(e,t){switch(Io(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ga(rt),B(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return _e(t),null;case 31:if(t.memoizedState!==null){if(It(t),t.alternate===null)throw Error(o(340));Kn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(It(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Kn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Y(tt),null;case 4:return B(),null;case 10:return Ga(t.type),null;case 22:case 23:return It(t),mc(),e!==null&&Y(Jn),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ga(rt),null;case 25:return null;default:return null}}function ih(e,t){switch(Io(t),t.tag){case 3:Ga(rt),B();break;case 26:case 27:case 5:_e(t);break;case 4:B();break;case 31:t.memoizedState!==null&&It(t);break;case 13:It(t);break;case 19:Y(tt);break;case 10:Ga(t.type);break;case 22:case 23:It(t),mc(),e!==null&&Y(Jn);break;case 24:Ga(rt)}}function Yl(e,t){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var c=r.next;n=c;do{if((n.tag&e)===e){r=void 0;var u=n.create,h=n.inst;r=u(),h.destroy=r}n=n.next}while(n!==c)}}catch(b){Qe(t,t.return,b)}}function vn(e,t,n){try{var r=t.updateQueue,c=r!==null?r.lastEffect:null;if(c!==null){var u=c.next;r=u;do{if((r.tag&e)===e){var h=r.inst,b=h.destroy;if(b!==void 0){h.destroy=void 0,c=t;var T=n,D=b;try{D()}catch(K){Qe(c,T,K)}}}r=r.next}while(r!==u)}}catch(K){Qe(t,t.return,K)}}function oh(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{If(t,n)}catch(r){Qe(e,e.return,r)}}}function ch(e,t,n){n.props=tr(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){Qe(e,t,r)}}function Xl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n=="function"?e.refCleanup=n(r):n.current=r}}catch(c){Qe(e,t,c)}}function Ma(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r=="function")try{r()}catch(c){Qe(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(c){Qe(e,t,c)}else n.current=null}function uh(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(c){Qe(e,e.return,c)}}function Yc(e,t,n){try{var r=e.stateNode;eb(r,e.type,n,t),r[Bt]=t}catch(c){Qe(e,e.return,c)}}function dh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&wn(e.type)||e.tag===4}function Xc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||dh(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&&wn(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 Kc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=La));else if(r!==4&&(r===27&&wn(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Kc(e,t,n),e=e.sibling;e!==null;)Kc(e,t,n),e=e.sibling}function fi(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&wn(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(fi(e,t,n),e=e.sibling;e!==null;)fi(e,t,n),e=e.sibling}function fh(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);Nt(t,r,n),t[gt]=e,t[Bt]=n}catch(u){Qe(e,e.return,u)}}var Xa=!1,it=!1,Zc=!1,mh=typeof WeakSet=="function"?WeakSet:Set,ht=null;function Oy(e,t){if(e=e.containerInfo,pu=Oi,e=Ef(e),Go(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var c=r.anchorOffset,u=r.focusNode;r=r.focusOffset;try{n.nodeType,u.nodeType}catch{n=null;break e}var h=0,b=-1,T=-1,D=0,K=0,P=e,L=null;t:for(;;){for(var q;P!==n||c!==0&&P.nodeType!==3||(b=h+c),P!==u||r!==0&&P.nodeType!==3||(T=h+r),P.nodeType===3&&(h+=P.nodeValue.length),(q=P.firstChild)!==null;)L=P,P=q;for(;;){if(P===e)break t;if(L===n&&++D===c&&(b=h),L===u&&++K===r&&(T=h),(q=P.nextSibling)!==null)break;P=L,L=P.parentNode}P=q}n=b===-1||T===-1?null:{start:b,end:T}}else n=null}n=n||{start:0,end:0}}else n=null;for(xu={focusedElem:e,selectionRange:n},Oi=!1,ht=t;ht!==null;)if(t=ht,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ht=e;else for(;ht!==null;){switch(t=ht,u=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(n=0;n<e.length;n++)c=e[n],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&u!==null){e=void 0,n=t,c=u.memoizedProps,u=u.memoizedState,r=n.stateNode;try{var ce=tr(n.type,c);e=r.getSnapshotBeforeUpdate(ce,u),r.__reactInternalSnapshotBeforeUpdate=e}catch(ge){Qe(n,n.return,ge)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)yu(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":yu(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,ht=e;break}ht=t.return}}function hh(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Za(e,n),r&4&&Yl(5,n);break;case 1:if(Za(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(h){Qe(n,n.return,h)}else{var c=tr(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(h){Qe(n,n.return,h)}}r&64&&oh(n),r&512&&Xl(n,n.return);break;case 3:if(Za(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{If(e,t)}catch(h){Qe(n,n.return,h)}}break;case 27:t===null&&r&4&&fh(n);case 26:case 5:Za(e,n),t===null&&r&4&&uh(n),r&512&&Xl(n,n.return);break;case 12:Za(e,n);break;case 31:Za(e,n),r&4&&vh(e,n);break;case 13:Za(e,n),r&4&&gh(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Qy.bind(null,n),ob(e,n))));break;case 22:if(r=n.memoizedState!==null||Xa,!r){t=t!==null&&t.memoizedState!==null||it,c=Xa;var u=it;Xa=r,(it=t)&&!u?$a(e,n,(n.subtreeFlags&8772)!==0):Za(e,n),Xa=c,it=u}break;case 30:break;default:Za(e,n)}}function ph(e){var t=e.alternate;t!==null&&(e.alternate=null,ph(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&wo(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 Je=null,Ht=!1;function Ka(e,t,n){for(n=n.child;n!==null;)xh(e,t,n),n=n.sibling}function xh(e,t,n){if(At&&typeof At.onCommitFiberUnmount=="function")try{At.onCommitFiberUnmount(Bn,n)}catch{}switch(n.tag){case 26:it||Ma(n,t),Ka(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:it||Ma(n,t);var r=Je,c=Ht;wn(n.type)&&(Je=n.stateNode,Ht=!1),Ka(e,t,n),ts(n.stateNode),Je=r,Ht=c;break;case 5:it||Ma(n,t);case 6:if(r=Je,c=Ht,Je=null,Ka(e,t,n),Je=r,Ht=c,Je!==null)if(Ht)try{(Je.nodeType===9?Je.body:Je.nodeName==="HTML"?Je.ownerDocument.body:Je).removeChild(n.stateNode)}catch(u){Qe(n,t,u)}else try{Je.removeChild(n.stateNode)}catch(u){Qe(n,t,u)}break;case 18:Je!==null&&(Ht?(e=Je,op(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Wr(e)):op(Je,n.stateNode));break;case 4:r=Je,c=Ht,Je=n.stateNode.containerInfo,Ht=!0,Ka(e,t,n),Je=r,Ht=c;break;case 0:case 11:case 14:case 15:vn(2,n,t),it||vn(4,n,t),Ka(e,t,n);break;case 1:it||(Ma(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"&&ch(n,t,r)),Ka(e,t,n);break;case 21:Ka(e,t,n);break;case 22:it=(r=it)||n.memoizedState!==null,Ka(e,t,n),it=r;break;default:Ka(e,t,n)}}function vh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Wr(e)}catch(n){Qe(t,t.return,n)}}}function gh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Wr(e)}catch(n){Qe(t,t.return,n)}}function zy(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new mh),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new mh),t;default:throw Error(o(435,e.tag))}}function mi(e,t){var n=zy(e);t.forEach(function(r){if(!n.has(r)){n.add(r);var c=Vy.bind(null,e,r);r.then(c,c)}})}function Gt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var c=n[r],u=e,h=t,b=h;e:for(;b!==null;){switch(b.tag){case 27:if(wn(b.type)){Je=b.stateNode,Ht=!1;break e}break;case 5:Je=b.stateNode,Ht=!1;break e;case 3:case 4:Je=b.stateNode.containerInfo,Ht=!0;break e}b=b.return}if(Je===null)throw Error(o(160));xh(u,h,c),Je=null,Ht=!1,u=c.alternate,u!==null&&(u.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)yh(t,e),t=t.sibling}var Sa=null;function yh(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Gt(t,e),Qt(e),r&4&&(vn(3,e,e.return),Yl(3,e),vn(5,e,e.return));break;case 1:Gt(t,e),Qt(e),r&512&&(it||n===null||Ma(n,n.return)),r&64&&Xa&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var c=Sa;if(Gt(t,e),Qt(e),r&512&&(it||n===null||Ma(n,n.return)),r&4){var u=n!==null?n.memoizedState:null;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){e:{r=e.type,n=e.memoizedProps,c=c.ownerDocument||c;t:switch(r){case"title":u=c.getElementsByTagName("title")[0],(!u||u[yl]||u[gt]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=c.createElement(r),c.head.insertBefore(u,c.querySelector("head > title"))),Nt(u,r,n),u[gt]=e,mt(u),r=u;break e;case"link":var h=yp("link","href",c).get(r+(n.href||""));if(h){for(var b=0;b<h.length;b++)if(u=h[b],u.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&u.getAttribute("rel")===(n.rel==null?null:n.rel)&&u.getAttribute("title")===(n.title==null?null:n.title)&&u.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){h.splice(b,1);break t}}u=c.createElement(r),Nt(u,r,n),c.head.appendChild(u);break;case"meta":if(h=yp("meta","content",c).get(r+(n.content||""))){for(b=0;b<h.length;b++)if(u=h[b],u.getAttribute("content")===(n.content==null?null:""+n.content)&&u.getAttribute("name")===(n.name==null?null:n.name)&&u.getAttribute("property")===(n.property==null?null:n.property)&&u.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&u.getAttribute("charset")===(n.charSet==null?null:n.charSet)){h.splice(b,1);break t}}u=c.createElement(r),Nt(u,r,n),c.head.appendChild(u);break;default:throw Error(o(468,r))}u[gt]=e,mt(u),r=u}e.stateNode=r}else bp(c,e.type,e.stateNode);else e.stateNode=gp(c,r,e.memoizedProps);else u!==r?(u===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):u.count--,r===null?bp(c,e.type,e.stateNode):gp(c,r,e.memoizedProps)):r===null&&e.stateNode!==null&&Yc(e,e.memoizedProps,n.memoizedProps)}break;case 27:Gt(t,e),Qt(e),r&512&&(it||n===null||Ma(n,n.return)),n!==null&&r&4&&Yc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Gt(t,e),Qt(e),r&512&&(it||n===null||Ma(n,n.return)),e.flags&32){c=e.stateNode;try{Nr(c,"")}catch(ce){Qe(e,e.return,ce)}}r&4&&e.stateNode!=null&&(c=e.memoizedProps,Yc(e,c,n!==null?n.memoizedProps:c)),r&1024&&(Zc=!0);break;case 6:if(Gt(t,e),Qt(e),r&4){if(e.stateNode===null)throw Error(o(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(ce){Qe(e,e.return,ce)}}break;case 3:if(_i=null,c=Sa,Sa=Ri(t.containerInfo),Gt(t,e),Sa=c,Qt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Wr(t.containerInfo)}catch(ce){Qe(e,e.return,ce)}Zc&&(Zc=!1,bh(e));break;case 4:r=Sa,Sa=Ri(e.stateNode.containerInfo),Gt(t,e),Qt(e),Sa=r;break;case 12:Gt(t,e),Qt(e);break;case 31:Gt(t,e),Qt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,mi(e,r)));break;case 13:Gt(t,e),Qt(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(pi=Mt()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,mi(e,r)));break;case 22:c=e.memoizedState!==null;var T=n!==null&&n.memoizedState!==null,D=Xa,K=it;if(Xa=D||c,it=K||T,Gt(t,e),it=K,Xa=D,Qt(e),r&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(n===null||T||Xa||it||ar(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){T=n=t;try{if(u=T.stateNode,c)h=u.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none";else{b=T.stateNode;var P=T.memoizedProps.style,L=P!=null&&P.hasOwnProperty("display")?P.display:null;b.style.display=L==null||typeof L=="boolean"?"":(""+L).trim()}}catch(ce){Qe(T,T.return,ce)}}}else if(t.tag===6){if(n===null){T=t;try{T.stateNode.nodeValue=c?"":T.memoizedProps}catch(ce){Qe(T,T.return,ce)}}}else if(t.tag===18){if(n===null){T=t;try{var q=T.stateNode;c?cp(q,!0):cp(T.stateNode,!1)}catch(ce){Qe(T,T.return,ce)}}}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;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,mi(e,n))));break;case 19:Gt(t,e),Qt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,mi(e,r)));break;case 30:break;case 21:break;default:Gt(t,e),Qt(e)}}function Qt(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(dh(r)){n=r;break}r=r.return}if(n==null)throw Error(o(160));switch(n.tag){case 27:var c=n.stateNode,u=Xc(e);fi(e,u,c);break;case 5:var h=n.stateNode;n.flags&32&&(Nr(h,""),n.flags&=-33);var b=Xc(e);fi(e,b,h);break;case 3:case 4:var T=n.stateNode.containerInfo,D=Xc(e);Kc(e,D,T);break;default:throw Error(o(161))}}catch(K){Qe(e,e.return,K)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function bh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;bh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Za(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)hh(e,t.alternate,t),t=t.sibling}function ar(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:vn(4,t,t.return),ar(t);break;case 1:Ma(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&ch(t,t.return,n),ar(t);break;case 27:ts(t.stateNode);case 26:case 5:Ma(t,t.return),ar(t);break;case 22:t.memoizedState===null&&ar(t);break;case 30:ar(t);break;default:ar(t)}e=e.sibling}}function $a(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,c=e,u=t,h=u.flags;switch(u.tag){case 0:case 11:case 15:$a(c,u,n),Yl(4,u);break;case 1:if($a(c,u,n),r=u,c=r.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(D){Qe(r,r.return,D)}if(r=u,c=r.updateQueue,c!==null){var b=r.stateNode;try{var T=c.shared.hiddenCallbacks;if(T!==null)for(c.shared.hiddenCallbacks=null,c=0;c<T.length;c++)Pf(T[c],b)}catch(D){Qe(r,r.return,D)}}n&&h&64&&oh(u),Xl(u,u.return);break;case 27:fh(u);case 26:case 5:$a(c,u,n),n&&r===null&&h&4&&uh(u),Xl(u,u.return);break;case 12:$a(c,u,n);break;case 31:$a(c,u,n),n&&h&4&&vh(c,u);break;case 13:$a(c,u,n),n&&h&4&&gh(c,u);break;case 22:u.memoizedState===null&&$a(c,u,n),Xl(u,u.return);break;case 30:break;default:$a(c,u,n)}t=t.sibling}}function $c(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&kl(n))}function Jc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&kl(e))}function Na(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Sh(e,t,n,r),t=t.sibling}function Sh(e,t,n,r){var c=t.flags;switch(t.tag){case 0:case 11:case 15:Na(e,t,n,r),c&2048&&Yl(9,t);break;case 1:Na(e,t,n,r);break;case 3:Na(e,t,n,r),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&kl(e)));break;case 12:if(c&2048){Na(e,t,n,r),e=t.stateNode;try{var u=t.memoizedProps,h=u.id,b=u.onPostCommit;typeof b=="function"&&b(h,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(T){Qe(t,t.return,T)}}else Na(e,t,n,r);break;case 31:Na(e,t,n,r);break;case 13:Na(e,t,n,r);break;case 23:break;case 22:u=t.stateNode,h=t.alternate,t.memoizedState!==null?u._visibility&2?Na(e,t,n,r):Kl(e,t):u._visibility&2?Na(e,t,n,r):(u._visibility|=2,Qr(e,t,n,r,(t.subtreeFlags&10256)!==0||!1)),c&2048&&$c(h,t);break;case 24:Na(e,t,n,r),c&2048&&Jc(t.alternate,t);break;default:Na(e,t,n,r)}}function Qr(e,t,n,r,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var u=e,h=t,b=n,T=r,D=h.flags;switch(h.tag){case 0:case 11:case 15:Qr(u,h,b,T,c),Yl(8,h);break;case 23:break;case 22:var K=h.stateNode;h.memoizedState!==null?K._visibility&2?Qr(u,h,b,T,c):Kl(u,h):(K._visibility|=2,Qr(u,h,b,T,c)),c&&D&2048&&$c(h.alternate,h);break;case 24:Qr(u,h,b,T,c),c&&D&2048&&Jc(h.alternate,h);break;default:Qr(u,h,b,T,c)}t=t.sibling}}function Kl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,c=r.flags;switch(r.tag){case 22:Kl(n,r),c&2048&&$c(r.alternate,r);break;case 24:Kl(n,r),c&2048&&Jc(r.alternate,r);break;default:Kl(n,r)}t=t.sibling}}var Zl=8192;function Vr(e,t,n){if(e.subtreeFlags&Zl)for(e=e.child;e!==null;)Nh(e,t,n),e=e.sibling}function Nh(e,t,n){switch(e.tag){case 26:Vr(e,t,n),e.flags&Zl&&e.memoizedState!==null&&bb(n,Sa,e.memoizedState,e.memoizedProps);break;case 5:Vr(e,t,n);break;case 3:case 4:var r=Sa;Sa=Ri(e.stateNode.containerInfo),Vr(e,t,n),Sa=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Zl,Zl=16777216,Vr(e,t,n),Zl=r):Vr(e,t,n));break;default:Vr(e,t,n)}}function jh(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 $l(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ht=r,Eh(r,e)}jh(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)wh(e),e=e.sibling}function wh(e){switch(e.tag){case 0:case 11:case 15:$l(e),e.flags&2048&&vn(9,e,e.return);break;case 3:$l(e);break;case 12:$l(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,hi(e)):$l(e);break;default:$l(e)}}function hi(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ht=r,Eh(r,e)}jh(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:vn(8,t,t.return),hi(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,hi(t));break;default:hi(t)}e=e.sibling}}function Eh(e,t){for(;ht!==null;){var n=ht;switch(n.tag){case 0:case 11:case 15:vn(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:kl(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,ht=r;else e:for(n=e;ht!==null;){r=ht;var c=r.sibling,u=r.return;if(ph(r),r===n){ht=null;break e}if(c!==null){c.return=u,ht=c;break e}ht=u}}}var Dy={getCacheForType:function(e){var t=bt(rt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return bt(rt).controller.signal}},Ly=typeof WeakMap=="function"?WeakMap:Map,He=0,Xe=null,ke=null,De=0,Ge=0,Wt=null,gn=!1,Fr=!1,Pc=!1,Ja=0,et=0,yn=0,nr=0,Ic=0,ea=0,Yr=0,Jl=null,Vt=null,Wc=!1,pi=0,Th=0,xi=1/0,vi=null,bn=null,ct=0,Sn=null,Xr=null,Pa=0,eu=0,tu=null,Rh=null,Pl=0,au=null;function ta(){return(He&2)!==0&&De!==0?De&-De:w.T!==null?ou():No()}function Ch(){if(ea===0)if((De&536870912)===0||Ue){var e=hr;hr<<=1,(hr&3932160)===0&&(hr=262144),ea=e}else ea=536870912;return e=Pt.current,e!==null&&(e.flags|=32),ea}function Ft(e,t,n){(e===Xe&&(Ge===2||Ge===9)||e.cancelPendingCommit!==null)&&(Kr(e,0),Nn(e,De,ea,!1)),Ie(e,n),((He&2)===0||e!==Xe)&&(e===Xe&&((He&2)===0&&(nr|=n),et===4&&Nn(e,De,ea,!1)),Aa(e))}function _h(e,t,n){if((He&6)!==0)throw Error(o(327));var r=!n&&(t&127)===0&&(t&e.expiredLanes)===0||$e(e,t),c=r?qy(e,t):ru(e,t,!0),u=r;do{if(c===0){Fr&&!r&&Nn(e,t,0,!1);break}else{if(n=e.current.alternate,u&&!Uy(n)){c=ru(e,t,!1),u=!1;continue}if(c===2){if(u=t,e.errorRecoveryDisabledLanes&u)var h=0;else h=e.pendingLanes&-536870913,h=h!==0?h:h&536870912?536870912:0;if(h!==0){t=h;e:{var b=e;c=Jl;var T=b.current.memoizedState.isDehydrated;if(T&&(Kr(b,h).flags|=256),h=ru(b,h,!1),h!==2){if(Pc&&!T){b.errorRecoveryDisabledLanes|=u,nr|=u,c=4;break e}u=Vt,Vt=c,u!==null&&(Vt===null?Vt=u:Vt.push.apply(Vt,u))}c=h}if(u=!1,c!==2)continue}}if(c===1){Kr(e,0),Nn(e,t,0,!0);break}e:{switch(r=e,u=c,u){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:Nn(r,t,ea,!gn);break e;case 2:Vt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(c=pi+300-Mt(),10<c)){if(Nn(r,t,ea,!gn),Ne(r,0,!0)!==0)break e;Pa=t,r.timeoutHandle=sp(Mh.bind(null,r,n,Vt,vi,Wc,t,ea,nr,Yr,gn,u,"Throttled",-0,0),c);break e}Mh(r,n,Vt,vi,Wc,t,ea,nr,Yr,gn,u,null,-0,0)}}break}while(!0);Aa(e)}function Mh(e,t,n,r,c,u,h,b,T,D,K,P,L,q){if(e.timeoutHandle=-1,P=t.subtreeFlags,P&8192||(P&16785408)===16785408){P={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:La},Nh(t,u,P);var ce=(u&62914560)===u?pi-Mt():(u&4194048)===u?Th-Mt():0;if(ce=Sb(P,ce),ce!==null){Pa=u,e.cancelPendingCommit=ce(Bh.bind(null,e,t,u,n,r,c,h,b,T,K,P,null,L,q)),Nn(e,u,h,!D);return}}Bh(e,t,u,n,r,c,h,b,T)}function Uy(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var c=n[r],u=c.getSnapshot;c=c.value;try{if(!$t(u(),c))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 Nn(e,t,n,r){t&=~Ic,t&=~nr,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var c=t;0<c;){var u=31-wt(c),h=1<<u;r[u]=-1,c&=~h}n!==0&&Hn(e,n,t)}function gi(){return(He&6)===0?(Il(0),!1):!0}function nu(){if(ke!==null){if(Ge===0)var e=ke.return;else e=ke,Ha=Zn=null,yc(e),Ur=null,zl=0,e=ke;for(;e!==null;)ih(e.alternate,e),e=e.return;ke=null}}function Kr(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,nb(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Pa=0,nu(),Xe=e,ke=n=Ba(e.current,null),De=t,Ge=0,Wt=null,gn=!1,Fr=$e(e,t),Pc=!1,Yr=ea=Ic=nr=yn=et=0,Vt=Jl=null,Wc=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var c=31-wt(r),u=1<<c;t|=e[c],r&=~u}return Ja=t,qs(),n}function Ah(e,t){Ee=null,w.H=Ql,t===Lr||t===Ks?(t=Kf(),Ge=3):t===ic?(t=Kf(),Ge=4):Ge=t===Dc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Wt=t,ke===null&&(et=1,ii(e,oa(t,e.current)))}function kh(){var e=Pt.current;return e===null?!0:(De&4194048)===De?fa===null:(De&62914560)===De||(De&536870912)!==0?e===fa:!1}function Oh(){var e=w.H;return w.H=Ql,e===null?Ql:e}function zh(){var e=w.A;return w.A=Dy,e}function yi(){et=4,gn||(De&4194048)!==De&&Pt.current!==null||(Fr=!0),(yn&134217727)===0&&(nr&134217727)===0||Xe===null||Nn(Xe,De,ea,!1)}function ru(e,t,n){var r=He;He|=2;var c=Oh(),u=zh();(Xe!==e||De!==t)&&(vi=null,Kr(e,t)),t=!1;var h=et;e:do try{if(Ge!==0&&ke!==null){var b=ke,T=Wt;switch(Ge){case 8:nu(),h=6;break e;case 3:case 2:case 9:case 6:Pt.current===null&&(t=!0);var D=Ge;if(Ge=0,Wt=null,Zr(e,b,T,D),n&&Fr){h=0;break e}break;default:D=Ge,Ge=0,Wt=null,Zr(e,b,T,D)}}By(),h=et;break}catch(K){Ah(e,K)}while(!0);return t&&e.shellSuspendCounter++,Ha=Zn=null,He=r,w.H=c,w.A=u,ke===null&&(Xe=null,De=0,qs()),h}function By(){for(;ke!==null;)Dh(ke)}function qy(e,t){var n=He;He|=2;var r=Oh(),c=zh();Xe!==e||De!==t?(vi=null,xi=Mt()+500,Kr(e,t)):Fr=$e(e,t);e:do try{if(Ge!==0&&ke!==null){t=ke;var u=Wt;t:switch(Ge){case 1:Ge=0,Wt=null,Zr(e,t,u,1);break;case 2:case 9:if(Yf(u)){Ge=0,Wt=null,Lh(t);break}t=function(){Ge!==2&&Ge!==9||Xe!==e||(Ge=7),Aa(e)},u.then(t,t);break e;case 3:Ge=7;break e;case 4:Ge=5;break e;case 7:Yf(u)?(Ge=0,Wt=null,Lh(t)):(Ge=0,Wt=null,Zr(e,t,u,7));break;case 5:var h=null;switch(ke.tag){case 26:h=ke.memoizedState;case 5:case 27:var b=ke;if(h?Sp(h):b.stateNode.complete){Ge=0,Wt=null;var T=b.sibling;if(T!==null)ke=T;else{var D=b.return;D!==null?(ke=D,bi(D)):ke=null}break t}}Ge=0,Wt=null,Zr(e,t,u,5);break;case 6:Ge=0,Wt=null,Zr(e,t,u,6);break;case 8:nu(),et=6;break e;default:throw Error(o(462))}}Hy();break}catch(K){Ah(e,K)}while(!0);return Ha=Zn=null,w.H=r,w.A=c,He=n,ke!==null?0:(Xe=null,De=0,qs(),et)}function Hy(){for(;ke!==null&&!_t();)Dh(ke)}function Dh(e){var t=lh(e.alternate,e,Ja);e.memoizedProps=e.pendingProps,t===null?bi(e):ke=t}function Lh(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Wm(n,t,t.pendingProps,t.type,void 0,De);break;case 11:t=Wm(n,t,t.pendingProps,t.type.render,t.ref,De);break;case 5:yc(t);default:ih(n,t),t=ke=zf(t,Ja),t=lh(n,t,Ja)}e.memoizedProps=e.pendingProps,t===null?bi(e):ke=t}function Zr(e,t,n,r){Ha=Zn=null,yc(t),Ur=null,zl=0;var c=t.return;try{if(Cy(e,c,t,n,De)){et=1,ii(e,oa(n,e.current)),ke=null;return}}catch(u){if(c!==null)throw ke=c,u;et=1,ii(e,oa(n,e.current)),ke=null;return}t.flags&32768?(Ue||r===1?e=!0:Fr||(De&536870912)!==0?e=!1:(gn=e=!0,(r===2||r===9||r===3||r===6)&&(r=Pt.current,r!==null&&r.tag===13&&(r.flags|=16384))),Uh(t,e)):bi(t)}function bi(e){var t=e;do{if((t.flags&32768)!==0){Uh(t,gn);return}e=t.return;var n=Ay(t.alternate,t,Ja);if(n!==null){ke=n;return}if(t=t.sibling,t!==null){ke=t;return}ke=t=e}while(t!==null);et===0&&(et=5)}function Uh(e,t){do{var n=ky(e.alternate,e);if(n!==null){n.flags&=32767,ke=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ke=e;return}ke=e=n}while(e!==null);et=6,ke=null}function Bh(e,t,n,r,c,u,h,b,T){e.cancelPendingCommit=null;do Si();while(ct!==0);if((He&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(u=t.lanes|t.childLanes,u|=Xo,Dt(e,n,u,h,b,T),e===Xe&&(ke=Xe=null,De=0),Xr=t,Sn=e,Pa=n,eu=u,tu=c,Rh=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Fy(Un,function(){return Vh(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=w.T,w.T=null,c=Q.p,Q.p=2,h=He,He|=4;try{Oy(e,t,n)}finally{He=h,Q.p=c,w.T=r}}ct=1,qh(),Hh(),Gh()}}function qh(){if(ct===1){ct=0;var e=Sn,t=Xr,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=w.T,w.T=null;var r=Q.p;Q.p=2;var c=He;He|=4;try{yh(t,e);var u=xu,h=Ef(e.containerInfo),b=u.focusedElem,T=u.selectionRange;if(h!==b&&b&&b.ownerDocument&&wf(b.ownerDocument.documentElement,b)){if(T!==null&&Go(b)){var D=T.start,K=T.end;if(K===void 0&&(K=D),"selectionStart"in b)b.selectionStart=D,b.selectionEnd=Math.min(K,b.value.length);else{var P=b.ownerDocument||document,L=P&&P.defaultView||window;if(L.getSelection){var q=L.getSelection(),ce=b.textContent.length,ge=Math.min(T.start,ce),Ye=T.end===void 0?ge:Math.min(T.end,ce);!q.extend&&ge>Ye&&(h=Ye,Ye=ge,ge=h);var k=jf(b,ge),_=jf(b,Ye);if(k&&_&&(q.rangeCount!==1||q.anchorNode!==k.node||q.anchorOffset!==k.offset||q.focusNode!==_.node||q.focusOffset!==_.offset)){var z=P.createRange();z.setStart(k.node,k.offset),q.removeAllRanges(),ge>Ye?(q.addRange(z),q.extend(_.node,_.offset)):(z.setEnd(_.node,_.offset),q.addRange(z))}}}}for(P=[],q=b;q=q.parentNode;)q.nodeType===1&&P.push({element:q,left:q.scrollLeft,top:q.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;b<P.length;b++){var J=P[b];J.element.scrollLeft=J.left,J.element.scrollTop=J.top}}Oi=!!pu,xu=pu=null}finally{He=c,Q.p=r,w.T=n}}e.current=t,ct=2}}function Hh(){if(ct===2){ct=0;var e=Sn,t=Xr,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=w.T,w.T=null;var r=Q.p;Q.p=2;var c=He;He|=4;try{hh(e,t.alternate,t)}finally{He=c,Q.p=r,w.T=n}}ct=3}}function Gh(){if(ct===4||ct===3){ct=0,an();var e=Sn,t=Xr,n=Pa,r=Rh;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?ct=5:(ct=0,Xr=Sn=null,Qh(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(bn=null),ya(n),t=t.stateNode,At&&typeof At.onCommitFiberRoot=="function")try{At.onCommitFiberRoot(Bn,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=w.T,c=Q.p,Q.p=2,w.T=null;try{for(var u=e.onRecoverableError,h=0;h<r.length;h++){var b=r[h];u(b.value,{componentStack:b.stack})}}finally{w.T=t,Q.p=c}}(Pa&3)!==0&&Si(),Aa(e),c=e.pendingLanes,(n&261930)!==0&&(c&42)!==0?e===au?Pl++:(Pl=0,au=e):Pl=0,Il(0)}}function Qh(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,kl(t)))}function Si(){return qh(),Hh(),Gh(),Vh()}function Vh(){if(ct!==5)return!1;var e=Sn,t=eu;eu=0;var n=ya(Pa),r=w.T,c=Q.p;try{Q.p=32>n?32:n,w.T=null,n=tu,tu=null;var u=Sn,h=Pa;if(ct=0,Xr=Sn=null,Pa=0,(He&6)!==0)throw Error(o(331));var b=He;if(He|=4,wh(u.current),Sh(u,u.current,h,n),He=b,Il(0,!1),At&&typeof At.onPostCommitFiberRoot=="function")try{At.onPostCommitFiberRoot(Bn,u)}catch{}return!0}finally{Q.p=c,w.T=r,Qh(e,t)}}function Fh(e,t,n){t=oa(n,t),t=zc(e.stateNode,t,2),e=hn(e,t,2),e!==null&&(Ie(e,2),Aa(e))}function Qe(e,t,n){if(e.tag===3)Fh(e,e,n);else for(;t!==null;){if(t.tag===3){Fh(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(bn===null||!bn.has(r))){e=oa(n,e),n=Ym(2),r=hn(t,n,2),r!==null&&(Xm(n,r,t,e),Ie(r,2),Aa(r));break}}t=t.return}}function lu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ly;var c=new Set;r.set(t,c)}else c=r.get(t),c===void 0&&(c=new Set,r.set(t,c));c.has(n)||(Pc=!0,c.add(n),e=Gy.bind(null,e,t,n),t.then(e,e))}function Gy(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Xe===e&&(De&n)===n&&(et===4||et===3&&(De&62914560)===De&&300>Mt()-pi?(He&2)===0&&Kr(e,0):Ic|=n,Yr===De&&(Yr=0)),Aa(e)}function Yh(e,t){t===0&&(t=Et()),e=Yn(e,t),e!==null&&(Ie(e,t),Aa(e))}function Qy(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Yh(e,n)}function Vy(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,c=e.memoizedState;c!==null&&(n=c.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(o(314))}r!==null&&r.delete(t),Yh(e,n)}function Fy(e,t){return pl(e,t)}var Ni=null,$r=null,su=!1,ji=!1,iu=!1,jn=0;function Aa(e){e!==$r&&e.next===null&&($r===null?Ni=$r=e:$r=$r.next=e),ji=!0,su||(su=!0,Xy())}function Il(e,t){if(!iu&&ji){iu=!0;do for(var n=!1,r=Ni;r!==null;){if(e!==0){var c=r.pendingLanes;if(c===0)var u=0;else{var h=r.suspendedLanes,b=r.pingedLanes;u=(1<<31-wt(42|e)+1)-1,u&=c&~(h&~b),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(n=!0,$h(r,u))}else u=De,u=Ne(r,r===Xe?u:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(u&3)===0||$e(r,u)||(n=!0,$h(r,u));r=r.next}while(n);iu=!1}}function Yy(){Xh()}function Xh(){ji=su=!1;var e=0;jn!==0&&ab()&&(e=jn);for(var t=Mt(),n=null,r=Ni;r!==null;){var c=r.next,u=Kh(r,t);u===0?(r.next=null,n===null?Ni=c:n.next=c,c===null&&($r=n)):(n=r,(e!==0||(u&3)!==0)&&(ji=!0)),r=c}ct!==0&&ct!==5||Il(e),jn!==0&&(jn=0)}function Kh(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,c=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var h=31-wt(u),b=1<<h,T=c[h];T===-1?((b&n)===0||(b&r)!==0)&&(c[h]=ft(b,t)):T<=t&&(e.expiredLanes|=b),u&=~b}if(t=Xe,n=De,n=Ne(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Ge===2||Ge===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&xl(r),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||$e(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&xl(r),ya(n)){case 2:case 8:n=Ts;break;case 32:n=Un;break;case 268435456:n=za;break;default:n=Un}return r=Zh.bind(null,e),n=pl(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&xl(r),e.callbackPriority=2,e.callbackNode=null,2}function Zh(e,t){if(ct!==0&&ct!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Si()&&e.callbackNode!==n)return null;var r=De;return r=Ne(e,e===Xe?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(_h(e,r,t),Kh(e,Mt()),e.callbackNode!=null&&e.callbackNode===n?Zh.bind(null,e):null)}function $h(e,t){if(Si())return null;_h(e,t,!0)}function Xy(){rb(function(){(He&6)!==0?pl(Ln,Yy):Xh()})}function ou(){if(jn===0){var e=zr;e===0&&(e=mr,mr<<=1,(mr&261888)===0&&(mr=256)),jn=e}return jn}function Jh(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:As(""+e)}function Ph(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Ky(e,t,n,r,c){if(t==="submit"&&n&&n.stateNode===c){var u=Jh((c[Bt]||null).action),h=r.submitter;h&&(t=(t=h[Bt]||null)?Jh(t.formAction):h.getAttribute("formAction"),t!==null&&(u=t,h=null));var b=new Ds("action","action",null,r,c);e.push({event:b,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(jn!==0){var T=h?Ph(c,h):new FormData(c);Cc(n,{pending:!0,data:T,method:c.method,action:u},null,T)}}else typeof u=="function"&&(b.preventDefault(),T=h?Ph(c,h):new FormData(c),Cc(n,{pending:!0,data:T,method:c.method,action:u},u,T))},currentTarget:c}]})}}for(var cu=0;cu<Yo.length;cu++){var uu=Yo[cu],Zy=uu.toLowerCase(),$y=uu[0].toUpperCase()+uu.slice(1);ba(Zy,"on"+$y)}ba(Cf,"onAnimationEnd"),ba(_f,"onAnimationIteration"),ba(Mf,"onAnimationStart"),ba("dblclick","onDoubleClick"),ba("focusin","onFocus"),ba("focusout","onBlur"),ba(dy,"onTransitionRun"),ba(fy,"onTransitionStart"),ba(my,"onTransitionCancel"),ba(Af,"onTransitionEnd"),br("onMouseEnter",["mouseout","mouseover"]),br("onMouseLeave",["mouseout","mouseover"]),br("onPointerEnter",["pointerout","pointerover"]),br("onPointerLeave",["pointerout","pointerover"]),Gn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Gn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Gn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Gn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Gn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Gn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wl="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(" "),Jy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Wl));function Ih(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],c=r.event;r=r.listeners;e:{var u=void 0;if(t)for(var h=r.length-1;0<=h;h--){var b=r[h],T=b.instance,D=b.currentTarget;if(b=b.listener,T!==u&&c.isPropagationStopped())break e;u=b,c.currentTarget=D;try{u(c)}catch(K){Bs(K)}c.currentTarget=null,u=T}else for(h=0;h<r.length;h++){if(b=r[h],T=b.instance,D=b.currentTarget,b=b.listener,T!==u&&c.isPropagationStopped())break e;u=b,c.currentTarget=D;try{u(c)}catch(K){Bs(K)}c.currentTarget=null,u=T}}}}function Oe(e,t){var n=t[jo];n===void 0&&(n=t[jo]=new Set);var r=e+"__bubble";n.has(r)||(Wh(t,e,2,!1),n.add(r))}function du(e,t,n){var r=0;t&&(r|=4),Wh(n,e,r,t)}var wi="_reactListening"+Math.random().toString(36).slice(2);function fu(e){if(!e[wi]){e[wi]=!0,Yd.forEach(function(n){n!=="selectionchange"&&(Jy.has(n)||du(n,!1,e),du(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[wi]||(t[wi]=!0,du("selectionchange",!1,t))}}function Wh(e,t,n,r){switch(Cp(t)){case 2:var c=wb;break;case 8:c=Eb;break;default:c=Ru}n=c.bind(null,t,n,e),c=void 0,!ko||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),r?c!==void 0?e.addEventListener(t,n,{capture:!0,passive:c}):e.addEventListener(t,n,!0):c!==void 0?e.addEventListener(t,n,{passive:c}):e.addEventListener(t,n,!1)}function mu(e,t,n,r,c){var u=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var h=r.tag;if(h===3||h===4){var b=r.stateNode.containerInfo;if(b===c)break;if(h===4)for(h=r.return;h!==null;){var T=h.tag;if((T===3||T===4)&&h.stateNode.containerInfo===c)return;h=h.return}for(;b!==null;){if(h=vr(b),h===null)return;if(T=h.tag,T===5||T===6||T===26||T===27){r=u=h;continue e}b=b.parentNode}}r=r.return}nf(function(){var D=u,K=Mo(n),P=[];e:{var L=kf.get(e);if(L!==void 0){var q=Ds,ce=e;switch(e){case"keypress":if(Os(n)===0)break e;case"keydown":case"keyup":q=Vg;break;case"focusin":ce="focus",q=Lo;break;case"focusout":ce="blur",q=Lo;break;case"beforeblur":case"afterblur":q=Lo;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":q=sf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":q=Ag;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":q=Xg;break;case Cf:case _f:case Mf:q=zg;break;case Af:q=Zg;break;case"scroll":case"scrollend":q=_g;break;case"wheel":q=Jg;break;case"copy":case"cut":case"paste":q=Lg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":q=cf;break;case"toggle":case"beforetoggle":q=Ig}var ge=(t&4)!==0,Ye=!ge&&(e==="scroll"||e==="scrollend"),k=ge?L!==null?L+"Capture":null:L;ge=[];for(var _=D,z;_!==null;){var J=_;if(z=J.stateNode,J=J.tag,J!==5&&J!==26&&J!==27||z===null||k===null||(J=Sl(_,k),J!=null&&ge.push(es(_,J,z))),Ye)break;_=_.return}0<ge.length&&(L=new q(L,ce,null,n,K),P.push({event:L,listeners:ge}))}}if((t&7)===0){e:{if(L=e==="mouseover"||e==="pointerover",q=e==="mouseout"||e==="pointerout",L&&n!==_o&&(ce=n.relatedTarget||n.fromElement)&&(vr(ce)||ce[xr]))break e;if((q||L)&&(L=K.window===K?K:(L=K.ownerDocument)?L.defaultView||L.parentWindow:window,q?(ce=n.relatedTarget||n.toElement,q=D,ce=ce?vr(ce):null,ce!==null&&(Ye=f(ce),ge=ce.tag,ce!==Ye||ge!==5&&ge!==27&&ge!==6)&&(ce=null)):(q=null,ce=D),q!==ce)){if(ge=sf,J="onMouseLeave",k="onMouseEnter",_="mouse",(e==="pointerout"||e==="pointerover")&&(ge=cf,J="onPointerLeave",k="onPointerEnter",_="pointer"),Ye=q==null?L:bl(q),z=ce==null?L:bl(ce),L=new ge(J,_+"leave",q,n,K),L.target=Ye,L.relatedTarget=z,J=null,vr(K)===D&&(ge=new ge(k,_+"enter",ce,n,K),ge.target=z,ge.relatedTarget=Ye,J=ge),Ye=J,q&&ce)t:{for(ge=Py,k=q,_=ce,z=0,J=k;J;J=ge(J))z++;J=0;for(var pe=_;pe;pe=ge(pe))J++;for(;0<z-J;)k=ge(k),z--;for(;0<J-z;)_=ge(_),J--;for(;z--;){if(k===_||_!==null&&k===_.alternate){ge=k;break t}k=ge(k),_=ge(_)}ge=null}else ge=null;q!==null&&ep(P,L,q,ge,!1),ce!==null&&Ye!==null&&ep(P,Ye,ce,ge,!0)}}e:{if(L=D?bl(D):window,q=L.nodeName&&L.nodeName.toLowerCase(),q==="select"||q==="input"&&L.type==="file")var Be=vf;else if(pf(L))if(gf)Be=oy;else{Be=sy;var fe=ly}else q=L.nodeName,!q||q.toLowerCase()!=="input"||L.type!=="checkbox"&&L.type!=="radio"?D&&Co(D.elementType)&&(Be=vf):Be=iy;if(Be&&(Be=Be(e,D))){xf(P,Be,n,K);break e}fe&&fe(e,L,D),e==="focusout"&&D&&L.type==="number"&&D.memoizedProps.value!=null&&Ro(L,"number",L.value)}switch(fe=D?bl(D):window,e){case"focusin":(pf(fe)||fe.contentEditable==="true")&&(Tr=fe,Qo=D,_l=null);break;case"focusout":_l=Qo=Tr=null;break;case"mousedown":Vo=!0;break;case"contextmenu":case"mouseup":case"dragend":Vo=!1,Tf(P,n,K);break;case"selectionchange":if(uy)break;case"keydown":case"keyup":Tf(P,n,K)}var Te;if(Bo)e:{switch(e){case"compositionstart":var Le="onCompositionStart";break e;case"compositionend":Le="onCompositionEnd";break e;case"compositionupdate":Le="onCompositionUpdate";break e}Le=void 0}else Er?mf(e,n)&&(Le="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Le="onCompositionStart");Le&&(uf&&n.locale!=="ko"&&(Er||Le!=="onCompositionStart"?Le==="onCompositionEnd"&&Er&&(Te=rf()):(sn=K,Oo="value"in sn?sn.value:sn.textContent,Er=!0)),fe=Ei(D,Le),0<fe.length&&(Le=new of(Le,e,null,n,K),P.push({event:Le,listeners:fe}),Te?Le.data=Te:(Te=hf(n),Te!==null&&(Le.data=Te)))),(Te=ey?ty(e,n):ay(e,n))&&(Le=Ei(D,"onBeforeInput"),0<Le.length&&(fe=new of("onBeforeInput","beforeinput",null,n,K),P.push({event:fe,listeners:Le}),fe.data=Te)),Ky(P,e,D,n,K)}Ih(P,t)})}function es(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ei(e,t){for(var n=t+"Capture",r=[];e!==null;){var c=e,u=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||u===null||(c=Sl(e,n),c!=null&&r.unshift(es(e,c,u)),c=Sl(e,t),c!=null&&r.push(es(e,c,u))),e.tag===3)return r;e=e.return}return[]}function Py(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ep(e,t,n,r,c){for(var u=t._reactName,h=[];n!==null&&n!==r;){var b=n,T=b.alternate,D=b.stateNode;if(b=b.tag,T!==null&&T===r)break;b!==5&&b!==26&&b!==27||D===null||(T=D,c?(D=Sl(n,u),D!=null&&h.unshift(es(n,D,T))):c||(D=Sl(n,u),D!=null&&h.push(es(n,D,T)))),n=n.return}h.length!==0&&e.push({event:t,listeners:h})}var Iy=/\r\n?/g,Wy=/\u0000|\uFFFD/g;function tp(e){return(typeof e=="string"?e:""+e).replace(Iy,`
9
+ `).replace(Wy,"")}function ap(e,t){return t=tp(t),tp(e)===t}function Fe(e,t,n,r,c,u){switch(n){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||Nr(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&Nr(e,""+r);break;case"className":_s(e,"class",r);break;case"tabIndex":_s(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":_s(e,n,r);break;case"style":tf(e,r,u);break;case"data":if(t!=="object"){_s(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=As(""+r),e.setAttribute(n,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(n,"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 u=="function"&&(n==="formAction"?(t!=="input"&&Fe(e,t,"name",c.name,c,null),Fe(e,t,"formEncType",c.formEncType,c,null),Fe(e,t,"formMethod",c.formMethod,c,null),Fe(e,t,"formTarget",c.formTarget,c,null)):(Fe(e,t,"encType",c.encType,c,null),Fe(e,t,"method",c.method,c,null),Fe(e,t,"target",c.target,c,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=As(""+r),e.setAttribute(n,r);break;case"onClick":r!=null&&(e.onclick=La);break;case"onScroll":r!=null&&Oe("scroll",e);break;case"onScrollEnd":r!=null&&Oe("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(o(61));if(n=r.__html,n!=null){if(c.children!=null)throw Error(o(60));e.innerHTML=n}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}n=As(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""+r):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":r===!0?e.setAttribute(n,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,r):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case"popover":Oe("beforetoggle",e),Oe("toggle",e),Cs(e,"popover",r);break;case"xlinkActuate":Da(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Da(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Da(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Da(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Da(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Da(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Da(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Da(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Da(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Cs(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Rg.get(n)||n,Cs(e,n,r))}}function hu(e,t,n,r,c,u){switch(n){case"style":tf(e,r,u);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(o(61));if(n=r.__html,n!=null){if(c.children!=null)throw Error(o(60));e.innerHTML=n}}break;case"children":typeof r=="string"?Nr(e,r):(typeof r=="number"||typeof r=="bigint")&&Nr(e,""+r);break;case"onScroll":r!=null&&Oe("scroll",e);break;case"onScrollEnd":r!=null&&Oe("scrollend",e);break;case"onClick":r!=null&&(e.onclick=La);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Xd.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(c=n.endsWith("Capture"),t=n.slice(2,c?n.length-7:void 0),u=e[Bt]||null,u=u!=null?u[n]:null,typeof u=="function"&&e.removeEventListener(t,u,c),typeof r=="function")){typeof u!="function"&&u!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,c);break e}n in e?e[n]=r:r===!0?e.setAttribute(n,""):Cs(e,n,r)}}}function Nt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Oe("error",e),Oe("load",e);var r=!1,c=!1,u;for(u in n)if(n.hasOwnProperty(u)){var h=n[u];if(h!=null)switch(u){case"src":r=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Fe(e,t,u,h,n,null)}}c&&Fe(e,t,"srcSet",n.srcSet,n,null),r&&Fe(e,t,"src",n.src,n,null);return;case"input":Oe("invalid",e);var b=u=h=c=null,T=null,D=null;for(r in n)if(n.hasOwnProperty(r)){var K=n[r];if(K!=null)switch(r){case"name":c=K;break;case"type":h=K;break;case"checked":T=K;break;case"defaultChecked":D=K;break;case"value":u=K;break;case"defaultValue":b=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(o(137,t));break;default:Fe(e,t,r,K,n,null)}}Pd(e,u,b,T,D,h,c,!1);return;case"select":Oe("invalid",e),r=h=u=null;for(c in n)if(n.hasOwnProperty(c)&&(b=n[c],b!=null))switch(c){case"value":u=b;break;case"defaultValue":h=b;break;case"multiple":r=b;default:Fe(e,t,c,b,n,null)}t=u,n=h,e.multiple=!!r,t!=null?Sr(e,!!r,t,!1):n!=null&&Sr(e,!!r,n,!0);return;case"textarea":Oe("invalid",e),u=c=r=null;for(h in n)if(n.hasOwnProperty(h)&&(b=n[h],b!=null))switch(h){case"value":r=b;break;case"defaultValue":c=b;break;case"children":u=b;break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(o(91));break;default:Fe(e,t,h,b,n,null)}Wd(e,r,c,u);return;case"option":for(T in n)n.hasOwnProperty(T)&&(r=n[T],r!=null)&&(T==="selected"?e.selected=r&&typeof r!="function"&&typeof r!="symbol":Fe(e,t,T,r,n,null));return;case"dialog":Oe("beforetoggle",e),Oe("toggle",e),Oe("cancel",e),Oe("close",e);break;case"iframe":case"object":Oe("load",e);break;case"video":case"audio":for(r=0;r<Wl.length;r++)Oe(Wl[r],e);break;case"image":Oe("error",e),Oe("load",e);break;case"details":Oe("toggle",e);break;case"embed":case"source":case"link":Oe("error",e),Oe("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(D in n)if(n.hasOwnProperty(D)&&(r=n[D],r!=null))switch(D){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Fe(e,t,D,r,n,null)}return;default:if(Co(t)){for(K in n)n.hasOwnProperty(K)&&(r=n[K],r!==void 0&&hu(e,t,K,r,n,void 0));return}}for(b in n)n.hasOwnProperty(b)&&(r=n[b],r!=null&&Fe(e,t,b,r,n,null))}function eb(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,u=null,h=null,b=null,T=null,D=null,K=null;for(q in n){var P=n[q];if(n.hasOwnProperty(q)&&P!=null)switch(q){case"checked":break;case"value":break;case"defaultValue":T=P;default:r.hasOwnProperty(q)||Fe(e,t,q,null,r,P)}}for(var L in r){var q=r[L];if(P=n[L],r.hasOwnProperty(L)&&(q!=null||P!=null))switch(L){case"type":u=q;break;case"name":c=q;break;case"checked":D=q;break;case"defaultChecked":K=q;break;case"value":h=q;break;case"defaultValue":b=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(o(137,t));break;default:q!==P&&Fe(e,t,L,q,r,P)}}To(e,h,b,T,D,K,u,c);return;case"select":q=h=b=L=null;for(u in n)if(T=n[u],n.hasOwnProperty(u)&&T!=null)switch(u){case"value":break;case"multiple":q=T;default:r.hasOwnProperty(u)||Fe(e,t,u,null,r,T)}for(c in r)if(u=r[c],T=n[c],r.hasOwnProperty(c)&&(u!=null||T!=null))switch(c){case"value":L=u;break;case"defaultValue":b=u;break;case"multiple":h=u;default:u!==T&&Fe(e,t,c,u,r,T)}t=b,n=h,r=q,L!=null?Sr(e,!!n,L,!1):!!r!=!!n&&(t!=null?Sr(e,!!n,t,!0):Sr(e,!!n,n?[]:"",!1));return;case"textarea":q=L=null;for(b in n)if(c=n[b],n.hasOwnProperty(b)&&c!=null&&!r.hasOwnProperty(b))switch(b){case"value":break;case"children":break;default:Fe(e,t,b,null,r,c)}for(h in r)if(c=r[h],u=n[h],r.hasOwnProperty(h)&&(c!=null||u!=null))switch(h){case"value":L=c;break;case"defaultValue":q=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(o(91));break;default:c!==u&&Fe(e,t,h,c,r,u)}Id(e,L,q);return;case"option":for(var ce in n)L=n[ce],n.hasOwnProperty(ce)&&L!=null&&!r.hasOwnProperty(ce)&&(ce==="selected"?e.selected=!1:Fe(e,t,ce,null,r,L));for(T in r)L=r[T],q=n[T],r.hasOwnProperty(T)&&L!==q&&(L!=null||q!=null)&&(T==="selected"?e.selected=L&&typeof L!="function"&&typeof L!="symbol":Fe(e,t,T,L,r,q));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 ge in n)L=n[ge],n.hasOwnProperty(ge)&&L!=null&&!r.hasOwnProperty(ge)&&Fe(e,t,ge,null,r,L);for(D in r)if(L=r[D],q=n[D],r.hasOwnProperty(D)&&L!==q&&(L!=null||q!=null))switch(D){case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(o(137,t));break;default:Fe(e,t,D,L,r,q)}return;default:if(Co(t)){for(var Ye in n)L=n[Ye],n.hasOwnProperty(Ye)&&L!==void 0&&!r.hasOwnProperty(Ye)&&hu(e,t,Ye,void 0,r,L);for(K in r)L=r[K],q=n[K],!r.hasOwnProperty(K)||L===q||L===void 0&&q===void 0||hu(e,t,K,L,r,q);return}}for(var k in n)L=n[k],n.hasOwnProperty(k)&&L!=null&&!r.hasOwnProperty(k)&&Fe(e,t,k,null,r,L);for(P in r)L=r[P],q=n[P],!r.hasOwnProperty(P)||L===q||L==null&&q==null||Fe(e,t,P,L,r,q)}function np(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function tb(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),r=0;r<n.length;r++){var c=n[r],u=c.transferSize,h=c.initiatorType,b=c.duration;if(u&&b&&np(h)){for(h=0,b=c.responseEnd,r+=1;r<n.length;r++){var T=n[r],D=T.startTime;if(D>b)break;var K=T.transferSize,P=T.initiatorType;K&&np(P)&&(T=T.responseEnd,h+=K*(T<b?1:(b-D)/(T-D)))}if(--r,t+=8*(u+h)/(c.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var pu=null,xu=null;function Ti(e){return e.nodeType===9?e:e.ownerDocument}function rp(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 lp(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 vu(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 gu=null;function ab(){var e=window.event;return e&&e.type==="popstate"?e===gu?!1:(gu=e,!0):(gu=null,!1)}var sp=typeof setTimeout=="function"?setTimeout:void 0,nb=typeof clearTimeout=="function"?clearTimeout:void 0,ip=typeof Promise=="function"?Promise:void 0,rb=typeof queueMicrotask=="function"?queueMicrotask:typeof ip<"u"?function(e){return ip.resolve(null).then(e).catch(lb)}:sp;function lb(e){setTimeout(function(){throw e})}function wn(e){return e==="head"}function op(e,t){var n=t,r=0;do{var c=n.nextSibling;if(e.removeChild(n),c&&c.nodeType===8)if(n=c.data,n==="/$"||n==="/&"){if(r===0){e.removeChild(c),Wr(t);return}r--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")r++;else if(n==="html")ts(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,ts(n);for(var u=n.firstChild;u;){var h=u.nextSibling,b=u.nodeName;u[yl]||b==="SCRIPT"||b==="STYLE"||b==="LINK"&&u.rel.toLowerCase()==="stylesheet"||n.removeChild(u),u=h}}else n==="body"&&ts(e.ownerDocument.body);n=c}while(n);Wr(t)}function cp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=r}while(n)}function yu(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":yu(n),wo(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function sb(e,t,n,r){for(;e.nodeType===1;){var c=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[yl])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=ma(e.nextSibling),e===null)break}return null}function ib(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=ma(e.nextSibling),e===null))return null;return e}function up(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ma(e.nextSibling),e===null))return null;return e}function bu(e){return e.data==="$?"||e.data==="$~"}function Su(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function ob(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function ma(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 Nu=null;function dp(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return ma(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function fp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function mp(e,t,n){switch(t=Ti(n),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 ts(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);wo(e)}var ha=new Map,hp=new Set;function Ri(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ia=Q.d;Q.d={f:cb,r:ub,D:db,C:fb,L:mb,m:hb,X:xb,S:pb,M:vb};function cb(){var e=Ia.f(),t=gi();return e||t}function ub(e){var t=gr(e);t!==null&&t.tag===5&&t.type==="form"?Am(t):Ia.r(e)}var Jr=typeof document>"u"?null:document;function pp(e,t,n){var r=Jr;if(r&&typeof t=="string"&&t){var c=sa(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof n=="string"&&(c+='[crossorigin="'+n+'"]'),hp.has(c)||(hp.add(c),e={rel:e,crossOrigin:n,href:t},r.querySelector(c)===null&&(t=r.createElement("link"),Nt(t,"link",e),mt(t),r.head.appendChild(t)))}}function db(e){Ia.D(e),pp("dns-prefetch",e,null)}function fb(e,t){Ia.C(e,t),pp("preconnect",e,t)}function mb(e,t,n){Ia.L(e,t,n);var r=Jr;if(r&&e&&t){var c='link[rel="preload"][as="'+sa(t)+'"]';t==="image"&&n&&n.imageSrcSet?(c+='[imagesrcset="'+sa(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(c+='[imagesizes="'+sa(n.imageSizes)+'"]')):c+='[href="'+sa(e)+'"]';var u=c;switch(t){case"style":u=Pr(e);break;case"script":u=Ir(e)}ha.has(u)||(e=x({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),ha.set(u,e),r.querySelector(c)!==null||t==="style"&&r.querySelector(as(u))||t==="script"&&r.querySelector(ns(u))||(t=r.createElement("link"),Nt(t,"link",e),mt(t),r.head.appendChild(t)))}}function hb(e,t){Ia.m(e,t);var n=Jr;if(n&&e){var r=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+sa(r)+'"][href="'+sa(e)+'"]',u=c;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Ir(e)}if(!ha.has(u)&&(e=x({rel:"modulepreload",href:e},t),ha.set(u,e),n.querySelector(c)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(ns(u)))return}r=n.createElement("link"),Nt(r,"link",e),mt(r),n.head.appendChild(r)}}}function pb(e,t,n){Ia.S(e,t,n);var r=Jr;if(r&&e){var c=yr(r).hoistableStyles,u=Pr(e);t=t||"default";var h=c.get(u);if(!h){var b={loading:0,preload:null};if(h=r.querySelector(as(u)))b.loading=5;else{e=x({rel:"stylesheet",href:e,"data-precedence":t},n),(n=ha.get(u))&&ju(e,n);var T=h=r.createElement("link");mt(T),Nt(T,"link",e),T._p=new Promise(function(D,K){T.onload=D,T.onerror=K}),T.addEventListener("load",function(){b.loading|=1}),T.addEventListener("error",function(){b.loading|=2}),b.loading|=4,Ci(h,t,r)}h={type:"stylesheet",instance:h,count:1,state:b},c.set(u,h)}}}function xb(e,t){Ia.X(e,t);var n=Jr;if(n&&e){var r=yr(n).hoistableScripts,c=Ir(e),u=r.get(c);u||(u=n.querySelector(ns(c)),u||(e=x({src:e,async:!0},t),(t=ha.get(c))&&wu(e,t),u=n.createElement("script"),mt(u),Nt(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},r.set(c,u))}}function vb(e,t){Ia.M(e,t);var n=Jr;if(n&&e){var r=yr(n).hoistableScripts,c=Ir(e),u=r.get(c);u||(u=n.querySelector(ns(c)),u||(e=x({src:e,async:!0,type:"module"},t),(t=ha.get(c))&&wu(e,t),u=n.createElement("script"),mt(u),Nt(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},r.set(c,u))}}function xp(e,t,n,r){var c=(c=Z.current)?Ri(c):null;if(!c)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Pr(n.href),n=yr(c).hoistableStyles,r=n.get(t),r||(r={type:"style",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Pr(n.href);var u=yr(c).hoistableStyles,h=u.get(e);if(h||(c=c.ownerDocument||c,h={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,h),(u=c.querySelector(as(e)))&&!u._p&&(h.instance=u,h.state.loading=5),ha.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ha.set(e,n),u||gb(c,e,n,h.state))),t&&r===null)throw Error(o(528,""));return h}if(t&&r!==null)throw Error(o(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ir(n),n=yr(c).hoistableScripts,r=n.get(t),r||(r={type:"script",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Pr(e){return'href="'+sa(e)+'"'}function as(e){return'link[rel="stylesheet"]['+e+"]"}function vp(e){return x({},e,{"data-precedence":e.precedence,precedence:null})}function gb(e,t,n,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),Nt(t,"link",n),mt(t),e.head.appendChild(t))}function Ir(e){return'[src="'+sa(e)+'"]'}function ns(e){return"script[async]"+e}function gp(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+sa(n.href)+'"]');if(r)return t.instance=r,mt(r),r;var c=x({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),mt(r),Nt(r,"style",c),Ci(r,n.precedence,e),t.instance=r;case"stylesheet":c=Pr(n.href);var u=e.querySelector(as(c));if(u)return t.state.loading|=4,t.instance=u,mt(u),u;r=vp(n),(c=ha.get(c))&&ju(r,c),u=(e.ownerDocument||e).createElement("link"),mt(u);var h=u;return h._p=new Promise(function(b,T){h.onload=b,h.onerror=T}),Nt(u,"link",r),t.state.loading|=4,Ci(u,n.precedence,e),t.instance=u;case"script":return u=Ir(n.src),(c=e.querySelector(ns(u)))?(t.instance=c,mt(c),c):(r=n,(c=ha.get(u))&&(r=x({},n),wu(r,c)),e=e.ownerDocument||e,c=e.createElement("script"),mt(c),Nt(c,"link",r),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Ci(r,n.precedence,e));return t.instance}function Ci(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=r.length?r[r.length-1]:null,u=c,h=0;h<r.length;h++){var b=r[h];if(b.dataset.precedence===t)u=b;else if(u!==c)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function ju(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function wu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var _i=null;function yp(e,t,n){if(_i===null){var r=new Map,c=_i=new Map;c.set(n,r)}else c=_i,r=c.get(n),r||(r=new Map,c.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),c=0;c<n.length;c++){var u=n[c];if(!(u[yl]||u[gt]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var h=u.getAttribute(t)||"";h=e+h;var b=r.get(h);b?b.push(u):r.set(h,[u])}}return r}function bp(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function yb(e,t,n){if(n===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;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!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 Sp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function bb(e,t,n,r){if(n.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var c=Pr(r.href),u=t.querySelector(as(c));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Mi.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=u,mt(u);return}u=t.ownerDocument||t,r=vp(r),(c=ha.get(c))&&ju(r,c),u=u.createElement("link"),mt(u);var h=u;h._p=new Promise(function(b,T){h.onload=b,h.onerror=T}),Nt(u,"link",r),n.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Mi.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Eu=0;function Sb(e,t){return e.stylesheets&&e.count===0&&ki(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ki(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&Eu===0&&(Eu=62500*tb());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ki(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>Eu?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(c)}}:null}function Mi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ki(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ai=null;function ki(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ai=new Map,t.forEach(Nb,e),Ai=null,Mi.call(e))}function Nb(e,t){if(!(t.state.loading&4)){var n=Ai.get(e);if(n)var r=n.get(null);else{n=new Map,Ai.set(e,n);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<c.length;u++){var h=c[u];(h.nodeName==="LINK"||h.getAttribute("media")!=="not all")&&(n.set(h.dataset.precedence,h),r=h)}r&&n.set(null,r)}c=t.instance,h=c.getAttribute("data-precedence"),u=n.get(h)||r,u===r&&n.set(null,c),n.set(h,c),this.count++,r=Mi.bind(this),c.addEventListener("load",r),c.addEventListener("error",r),u?u.parentNode.insertBefore(c,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var rs={$$typeof:V,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function jb(e,t,n,r,c,u,h,b,T){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=rn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rn(0),this.hiddenUpdates=rn(null),this.identifierPrefix=r,this.onUncaughtError=c,this.onCaughtError=u,this.onRecoverableError=h,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=T,this.incompleteTransitions=new Map}function Np(e,t,n,r,c,u,h,b,T,D,K,P){return e=new jb(e,t,n,h,T,D,K,P,b),t=1,u===!0&&(t|=24),u=Jt(3,null,null,t),e.current=u,u.stateNode=e,t=rc(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:r,isDehydrated:n,cache:t},oc(u),e}function jp(e){return e?(e=_r,e):_r}function wp(e,t,n,r,c,u){c=jp(c),r.context===null?r.context=c:r.pendingContext=c,r=mn(t),r.payload={element:n},u=u===void 0?null:u,u!==null&&(r.callback=u),n=hn(e,r,t),n!==null&&(Ft(n,e,t),Ll(n,e,t))}function Ep(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Tu(e,t){Ep(e,t),(e=e.alternate)&&Ep(e,t)}function Tp(e){if(e.tag===13||e.tag===31){var t=Yn(e,67108864);t!==null&&Ft(t,e,67108864),Tu(e,67108864)}}function Rp(e){if(e.tag===13||e.tag===31){var t=ta();t=pr(t);var n=Yn(e,t);n!==null&&Ft(n,e,t),Tu(e,t)}}var Oi=!0;function wb(e,t,n,r){var c=w.T;w.T=null;var u=Q.p;try{Q.p=2,Ru(e,t,n,r)}finally{Q.p=u,w.T=c}}function Eb(e,t,n,r){var c=w.T;w.T=null;var u=Q.p;try{Q.p=8,Ru(e,t,n,r)}finally{Q.p=u,w.T=c}}function Ru(e,t,n,r){if(Oi){var c=Cu(r);if(c===null)mu(e,t,r,zi,n),_p(e,r);else if(Rb(c,e,t,n,r))r.stopPropagation();else if(_p(e,r),t&4&&-1<Tb.indexOf(e)){for(;c!==null;){var u=gr(c);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var h=Ra(u.pendingLanes);if(h!==0){var b=u;for(b.pendingLanes|=2,b.entangledLanes|=2;h;){var T=1<<31-wt(h);b.entanglements[1]|=T,h&=~T}Aa(u),(He&6)===0&&(xi=Mt()+500,Il(0))}}break;case 31:case 13:b=Yn(u,2),b!==null&&Ft(b,u,2),gi(),Tu(u,2)}if(u=Cu(r),u===null&&mu(e,t,r,zi,n),u===c)break;c=u}c!==null&&r.stopPropagation()}else mu(e,t,r,null,n)}}function Cu(e){return e=Mo(e),_u(e)}var zi=null;function _u(e){if(zi=null,e=vr(e),e!==null){var t=f(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=m(t),e!==null)return e;e=null}else if(n===31){if(e=v(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return zi=e,null}function Cp(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(bo()){case Ln:return 2;case Ts:return 8;case Un:case vl:return 32;case za:return 268435456;default:return 32}default:return 32}}var Mu=!1,En=null,Tn=null,Rn=null,ls=new Map,ss=new Map,Cn=[],Tb="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 _p(e,t){switch(e){case"focusin":case"focusout":En=null;break;case"dragenter":case"dragleave":Tn=null;break;case"mouseover":case"mouseout":Rn=null;break;case"pointerover":case"pointerout":ls.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ss.delete(t.pointerId)}}function is(e,t,n,r,c,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:u,targetContainers:[c]},t!==null&&(t=gr(t),t!==null&&Tp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function Rb(e,t,n,r,c){switch(t){case"focusin":return En=is(En,e,t,n,r,c),!0;case"dragenter":return Tn=is(Tn,e,t,n,r,c),!0;case"mouseover":return Rn=is(Rn,e,t,n,r,c),!0;case"pointerover":var u=c.pointerId;return ls.set(u,is(ls.get(u)||null,e,t,n,r,c)),!0;case"gotpointercapture":return u=c.pointerId,ss.set(u,is(ss.get(u)||null,e,t,n,r,c)),!0}return!1}function Mp(e){var t=vr(e.target);if(t!==null){var n=f(t);if(n!==null){if(t=n.tag,t===13){if(t=m(n),t!==null){e.blockedOn=t,Vd(e.priority,function(){Rp(n)});return}}else if(t===31){if(t=v(n),t!==null){e.blockedOn=t,Vd(e.priority,function(){Rp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Di(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Cu(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);_o=r,n.target.dispatchEvent(r),_o=null}else return t=gr(n),t!==null&&Tp(t),e.blockedOn=n,!1;t.shift()}return!0}function Ap(e,t,n){Di(e)&&n.delete(t)}function Cb(){Mu=!1,En!==null&&Di(En)&&(En=null),Tn!==null&&Di(Tn)&&(Tn=null),Rn!==null&&Di(Rn)&&(Rn=null),ls.forEach(Ap),ss.forEach(Ap)}function Li(e,t){e.blockedOn===t&&(e.blockedOn=null,Mu||(Mu=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,Cb)))}var Ui=null;function kp(e){Ui!==e&&(Ui=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){Ui===e&&(Ui=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],c=e[t+2];if(typeof r!="function"){if(_u(r||n)===null)continue;break}var u=gr(n);u!==null&&(e.splice(t,3),t-=3,Cc(u,{pending:!0,data:c,method:n.method,action:r},r,c))}}))}function Wr(e){function t(T){return Li(T,e)}En!==null&&Li(En,e),Tn!==null&&Li(Tn,e),Rn!==null&&Li(Rn,e),ls.forEach(t),ss.forEach(t);for(var n=0;n<Cn.length;n++){var r=Cn[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Cn.length&&(n=Cn[0],n.blockedOn===null);)Mp(n),n.blockedOn===null&&Cn.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var c=n[r],u=n[r+1],h=c[Bt]||null;if(typeof u=="function")h||kp(n);else if(h){var b=null;if(u&&u.hasAttribute("formAction")){if(c=u,h=u[Bt]||null)b=h.formAction;else if(_u(c)!==null)continue}else b=h.action;typeof b=="function"?n[r+1]=b:(n.splice(r,3),r-=3),kp(n)}}}function Op(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(h){return c=h})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var u=navigation.currentEntry;u&&u.url!=null&&navigation.navigate(u.url,{state:u.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function Au(e){this._internalRoot=e}Bi.prototype.render=Au.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current,r=ta();wp(n,r,e,t,null,null)},Bi.prototype.unmount=Au.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;wp(e.current,2,null,e,null,null),gi(),t[xr]=null}};function Bi(e){this._internalRoot=e}Bi.prototype.unstable_scheduleHydration=function(e){if(e){var t=No();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Cn.length&&t!==0&&t<Cn[n].priority;n++);Cn.splice(n,0,e),n===0&&Mp(e)}};var zp=l.version;if(zp!=="19.2.4")throw Error(o(527,zp,"19.2.4"));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=p(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var _b={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:w,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var qi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!qi.isDisabled&&qi.supportsFiber)try{Bn=qi.inject(_b),At=qi}catch{}}return cs.createRoot=function(e,t){if(!d(e))throw Error(o(299));var n=!1,r="",c=Gm,u=Qm,h=Vm;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(h=t.onRecoverableError)),t=Np(e,1,!1,null,null,n,r,null,c,u,h,Op),e[xr]=t.current,fu(e),new Au(t)},cs.hydrateRoot=function(e,t,n){if(!d(e))throw Error(o(299));var r=!1,c="",u=Gm,h=Qm,b=Vm,T=null;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(c=n.identifierPrefix),n.onUncaughtError!==void 0&&(u=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(b=n.onRecoverableError),n.formState!==void 0&&(T=n.formState)),t=Np(e,1,!0,t,n??null,r,c,T,u,h,b,Op),t.context=jp(null),n=t.current,r=ta(),r=pr(r),c=mn(r),c.callback=null,hn(n,c,r),n=r,t.current.lanes=n,Ie(t,n),Aa(t),e[xr]=t.current,fu(e),new Bi(t)},cs.version="19.2.4",cs}var Fp;function Bb(){if(Fp)return zu.exports;Fp=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(l){console.error(l)}}return a(),zu.exports=Ub(),zu.exports}var qb=Bb();var Yp="popstate";function Hb(a={}){function l(o,d){let{pathname:f,search:m,hash:v}=o.location;return Wu("",{pathname:f,search:m,hash:v},d.state&&d.state.usr||null,d.state&&d.state.key||"default")}function i(o,d){return typeof d=="string"?d:vs(d)}return Qb(l,i,null,a)}function Pe(a,l){if(a===!1||a===null||typeof a>"u")throw new Error(l)}function ja(a,l){if(!a){typeof console<"u"&&console.warn(l);try{throw new Error(l)}catch{}}}function Gb(){return Math.random().toString(36).substring(2,10)}function Xp(a,l){return{usr:a.state,key:a.key,idx:l}}function Wu(a,l,i=null,o){return{pathname:typeof a=="string"?a:a.pathname,search:"",hash:"",...typeof l=="string"?il(l):l,state:i,key:l&&l.key||o||Gb()}}function vs({pathname:a="/",search:l="",hash:i=""}){return l&&l!=="?"&&(a+=l.charAt(0)==="?"?l:"?"+l),i&&i!=="#"&&(a+=i.charAt(0)==="#"?i:"#"+i),a}function il(a){let l={};if(a){let i=a.indexOf("#");i>=0&&(l.hash=a.substring(i),a=a.substring(0,i));let o=a.indexOf("?");o>=0&&(l.search=a.substring(o),a=a.substring(0,o)),a&&(l.pathname=a)}return l}function Qb(a,l,i,o={}){let{window:d=document.defaultView,v5Compat:f=!1}=o,m=d.history,v="POP",g=null,p=y();p==null&&(p=0,m.replaceState({...m.state,idx:p},""));function y(){return(m.state||{idx:null}).idx}function x(){v="POP";let R=y(),O=R==null?null:R-p;p=R,g&&g({action:v,location:E.location,delta:O})}function N(R,O){v="PUSH";let M=Wu(E.location,R,O);p=y()+1;let V=Xp(M,p),U=E.createHref(M);try{m.pushState(V,"",U)}catch(ne){if(ne instanceof DOMException&&ne.name==="DataCloneError")throw ne;d.location.assign(U)}f&&g&&g({action:v,location:E.location,delta:1})}function A(R,O){v="REPLACE";let M=Wu(E.location,R,O);p=y();let V=Xp(M,p),U=E.createHref(M);m.replaceState(V,"",U),f&&g&&g({action:v,location:E.location,delta:0})}function j(R){return Vb(R)}let E={get action(){return v},get location(){return a(d,m)},listen(R){if(g)throw new Error("A history only accepts one active listener");return d.addEventListener(Yp,x),g=R,()=>{d.removeEventListener(Yp,x),g=null}},createHref(R){return l(d,R)},createURL:j,encodeLocation(R){let O=j(R);return{pathname:O.pathname,search:O.search,hash:O.hash}},push:N,replace:A,go(R){return m.go(R)}};return E}function Vb(a,l=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),Pe(i,"No window.location.(origin|href) available to create URL");let o=typeof a=="string"?a:vs(a);return o=o.replace(/ $/,"%20"),!l&&o.startsWith("//")&&(o=i+o),new URL(o,i)}function Fx(a,l,i="/"){return Fb(a,l,i,!1)}function Fb(a,l,i,o){let d=typeof l=="string"?il(l):l,f=tn(d.pathname||"/",i);if(f==null)return null;let m=Yx(a);Yb(m);let v=null;for(let g=0;v==null&&g<m.length;++g){let p=a0(f);v=e0(m[g],p,o)}return v}function Yx(a,l=[],i=[],o="",d=!1){let f=(m,v,g=d,p)=>{let y={relativePath:p===void 0?m.path||"":p,caseSensitive:m.caseSensitive===!0,childrenIndex:v,route:m};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(o)&&g)return;Pe(y.relativePath.startsWith(o),`Absolute route path "${y.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(o.length)}let x=en([o,y.relativePath]),N=i.concat(y);m.children&&m.children.length>0&&(Pe(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${x}".`),Yx(m.children,l,N,x,g)),!(m.path==null&&!m.index)&&l.push({path:x,score:Ib(x,m.index),routesMeta:N})};return a.forEach((m,v)=>{if(m.path===""||!m.path?.includes("?"))f(m,v);else for(let g of Xx(m.path))f(m,v,!0,g)}),l}function Xx(a){let l=a.split("/");if(l.length===0)return[];let[i,...o]=l,d=i.endsWith("?"),f=i.replace(/\?$/,"");if(o.length===0)return d?[f,""]:[f];let m=Xx(o.join("/")),v=[];return v.push(...m.map(g=>g===""?f:[f,g].join("/"))),d&&v.push(...m),v.map(g=>a.startsWith("/")&&g===""?"/":g)}function Yb(a){a.sort((l,i)=>l.score!==i.score?i.score-l.score:Wb(l.routesMeta.map(o=>o.childrenIndex),i.routesMeta.map(o=>o.childrenIndex)))}var Xb=/^:[\w-]+$/,Kb=3,Zb=2,$b=1,Jb=10,Pb=-2,Kp=a=>a==="*";function Ib(a,l){let i=a.split("/"),o=i.length;return i.some(Kp)&&(o+=Pb),l&&(o+=Zb),i.filter(d=>!Kp(d)).reduce((d,f)=>d+(Xb.test(f)?Kb:f===""?$b:Jb),o)}function Wb(a,l){return a.length===l.length&&a.slice(0,-1).every((o,d)=>o===l[d])?a[a.length-1]-l[l.length-1]:0}function e0(a,l,i=!1){let{routesMeta:o}=a,d={},f="/",m=[];for(let v=0;v<o.length;++v){let g=o[v],p=v===o.length-1,y=f==="/"?l:l.slice(f.length)||"/",x=to({path:g.relativePath,caseSensitive:g.caseSensitive,end:p},y),N=g.route;if(!x&&p&&i&&!o[o.length-1].route.index&&(x=to({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},y)),!x)return null;Object.assign(d,x.params),m.push({params:d,pathname:en([f,x.pathname]),pathnameBase:s0(en([f,x.pathnameBase])),route:N}),x.pathnameBase!=="/"&&(f=en([f,x.pathnameBase]))}return m}function to(a,l){typeof a=="string"&&(a={path:a,caseSensitive:!1,end:!0});let[i,o]=t0(a.path,a.caseSensitive,a.end),d=l.match(i);if(!d)return null;let f=d[0],m=f.replace(/(.)\/+$/,"$1"),v=d.slice(1);return{params:o.reduce((p,{paramName:y,isOptional:x},N)=>{if(y==="*"){let j=v[N]||"";m=f.slice(0,f.length-j.length).replace(/(.)\/+$/,"$1")}const A=v[N];return x&&!A?p[y]=void 0:p[y]=(A||"").replace(/%2F/g,"/"),p},{}),pathname:f,pathnameBase:m,pattern:a}}function t0(a,l=!1,i=!0){ja(a==="*"||!a.endsWith("*")||a.endsWith("/*"),`Route path "${a}" will be treated as if it were "${a.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${a.replace(/\*$/,"/*")}".`);let o=[],d="^"+a.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,v,g)=>(o.push({paramName:v,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return a.endsWith("*")?(o.push({paramName:"*"}),d+=a==="*"||a==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?d+="\\/*$":a!==""&&a!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,l?void 0:"i"),o]}function a0(a){try{return a.split("/").map(l=>decodeURIComponent(l).replace(/\//g,"%2F")).join("/")}catch(l){return ja(!1,`The URL path "${a}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${l}).`),a}}function tn(a,l){if(l==="/")return a;if(!a.toLowerCase().startsWith(l.toLowerCase()))return null;let i=l.endsWith("/")?l.length-1:l.length,o=a.charAt(i);return o&&o!=="/"?null:a.slice(i)||"/"}var n0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function r0(a,l="/"){let{pathname:i,search:o="",hash:d=""}=typeof a=="string"?il(a):a,f;return i?(i=i.replace(/\/\/+/g,"/"),i.startsWith("/")?f=Zp(i.substring(1),"/"):f=Zp(i,l)):f=l,{pathname:f,search:i0(o),hash:o0(d)}}function Zp(a,l){let i=l.replace(/\/+$/,"").split("/");return a.split("/").forEach(d=>{d===".."?i.length>1&&i.pop():d!=="."&&i.push(d)}),i.length>1?i.join("/"):"/"}function Bu(a,l,i,o){return`Cannot include a '${a}' character in a manually specified \`to.${l}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function l0(a){return a.filter((l,i)=>i===0||l.route.path&&l.route.path.length>0)}function xd(a){let l=l0(a);return l.map((i,o)=>o===l.length-1?i.pathname:i.pathnameBase)}function vd(a,l,i,o=!1){let d;typeof a=="string"?d=il(a):(d={...a},Pe(!d.pathname||!d.pathname.includes("?"),Bu("?","pathname","search",d)),Pe(!d.pathname||!d.pathname.includes("#"),Bu("#","pathname","hash",d)),Pe(!d.search||!d.search.includes("#"),Bu("#","search","hash",d)));let f=a===""||d.pathname==="",m=f?"/":d.pathname,v;if(m==null)v=i;else{let x=l.length-1;if(!o&&m.startsWith("..")){let N=m.split("/");for(;N[0]==="..";)N.shift(),x-=1;d.pathname=N.join("/")}v=x>=0?l[x]:"/"}let g=r0(d,v),p=m&&m!=="/"&&m.endsWith("/"),y=(f||m===".")&&i.endsWith("/");return!g.pathname.endsWith("/")&&(p||y)&&(g.pathname+="/"),g}var en=a=>a.join("/").replace(/\/\/+/g,"/"),s0=a=>a.replace(/\/+$/,"").replace(/^\/*/,"/"),i0=a=>!a||a==="?"?"":a.startsWith("?")?a:"?"+a,o0=a=>!a||a==="#"?"":a.startsWith("#")?a:"#"+a,c0=class{constructor(a,l,i,o=!1){this.status=a,this.statusText=l||"",this.internal=o,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function u0(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.internal=="boolean"&&"data"in a}function d0(a){return a.map(l=>l.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Kx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Zx(a,l){let i=a;if(typeof i!="string"||!n0.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let o=i,d=!1;if(Kx)try{let f=new URL(window.location.href),m=i.startsWith("//")?new URL(f.protocol+i):new URL(i),v=tn(m.pathname,l);m.origin===f.origin&&v!=null?i=v+m.search+m.hash:d=!0}catch{ja(!1,`<Link to="${i}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:d,to:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var $x=["POST","PUT","PATCH","DELETE"];new Set($x);var f0=["GET",...$x];new Set(f0);var ol=S.createContext(null);ol.displayName="DataRouter";var oo=S.createContext(null);oo.displayName="DataRouterState";var m0=S.createContext(!1),Jx=S.createContext({isTransitioning:!1});Jx.displayName="ViewTransition";var h0=S.createContext(new Map);h0.displayName="Fetchers";var p0=S.createContext(null);p0.displayName="Await";var ra=S.createContext(null);ra.displayName="Navigation";var ys=S.createContext(null);ys.displayName="Location";var xa=S.createContext({outlet:null,matches:[],isDataRoute:!1});xa.displayName="Route";var gd=S.createContext(null);gd.displayName="RouteError";var Px="REACT_ROUTER_ERROR",x0="REDIRECT",v0="ROUTE_ERROR_RESPONSE";function g0(a){if(a.startsWith(`${Px}:${x0}:{`))try{let l=JSON.parse(a.slice(28));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string"&&typeof l.location=="string"&&typeof l.reloadDocument=="boolean"&&typeof l.replace=="boolean")return l}catch{}}function y0(a){if(a.startsWith(`${Px}:${v0}:{`))try{let l=JSON.parse(a.slice(40));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string")return new c0(l.status,l.statusText,l.data)}catch{}}function b0(a,{relative:l}={}){Pe(cl(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:o}=S.useContext(ra),{hash:d,pathname:f,search:m}=bs(a,{relative:l}),v=f;return i!=="/"&&(v=f==="/"?i:en([i,f])),o.createHref({pathname:v,search:m,hash:d})}function cl(){return S.useContext(ys)!=null}function On(){return Pe(cl(),"useLocation() may be used only in the context of a <Router> component."),S.useContext(ys).location}var Ix="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Wx(a){S.useContext(ra).static||S.useLayoutEffect(a)}function wa(){let{isDataRoute:a}=S.useContext(xa);return a?L0():S0()}function S0(){Pe(cl(),"useNavigate() may be used only in the context of a <Router> component.");let a=S.useContext(ol),{basename:l,navigator:i}=S.useContext(ra),{matches:o}=S.useContext(xa),{pathname:d}=On(),f=JSON.stringify(xd(o)),m=S.useRef(!1);return Wx(()=>{m.current=!0}),S.useCallback((g,p={})=>{if(ja(m.current,Ix),!m.current)return;if(typeof g=="number"){i.go(g);return}let y=vd(g,JSON.parse(f),d,p.relative==="path");a==null&&l!=="/"&&(y.pathname=y.pathname==="/"?l:en([l,y.pathname])),(p.replace?i.replace:i.push)(y,p.state,p)},[l,i,f,d,a])}var N0=S.createContext(null);function j0(a){let l=S.useContext(xa).outlet;return S.useMemo(()=>l&&S.createElement(N0.Provider,{value:a},l),[l,a])}function w0(){let{matches:a}=S.useContext(xa),l=a[a.length-1];return l?l.params:{}}function bs(a,{relative:l}={}){let{matches:i}=S.useContext(xa),{pathname:o}=On(),d=JSON.stringify(xd(i));return S.useMemo(()=>vd(a,JSON.parse(d),o,l==="path"),[a,d,o,l])}function E0(a,l){return ev(a,l)}function ev(a,l,i,o,d){Pe(cl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:f}=S.useContext(ra),{matches:m}=S.useContext(xa),v=m[m.length-1],g=v?v.params:{},p=v?v.pathname:"/",y=v?v.pathnameBase:"/",x=v&&v.route;{let M=x&&x.path||"";av(p,!x||M.endsWith("*")||M.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${M}">) 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.
10
+
11
+ Please change the parent <Route path="${M}"> to <Route path="${M==="/"?"*":`${M}/*`}">.`)}let N=On(),A;if(l){let M=typeof l=="string"?il(l):l;Pe(y==="/"||M.pathname?.startsWith(y),`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 "${y}" but pathname "${M.pathname}" was given in the \`location\` prop.`),A=M}else A=N;let j=A.pathname||"/",E=j;if(y!=="/"){let M=y.replace(/^\//,"").split("/");E="/"+j.replace(/^\//,"").split("/").slice(M.length).join("/")}let R=Fx(a,{pathname:E});ja(x||R!=null,`No routes matched location "${A.pathname}${A.search}${A.hash}" `),ja(R==null||R[R.length-1].route.element!==void 0||R[R.length-1].route.Component!==void 0||R[R.length-1].route.lazy!==void 0,`Matched leaf route at location "${A.pathname}${A.search}${A.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 O=M0(R&&R.map(M=>Object.assign({},M,{params:Object.assign({},g,M.params),pathname:en([y,f.encodeLocation?f.encodeLocation(M.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:M.pathname]),pathnameBase:M.pathnameBase==="/"?y:en([y,f.encodeLocation?f.encodeLocation(M.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:M.pathnameBase])})),m,i,o,d);return l&&O?S.createElement(ys.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...A},navigationType:"POP"}},O):O}function T0(){let a=D0(),l=u0(a)?`${a.status} ${a.statusText}`:a instanceof Error?a.message:JSON.stringify(a),i=a instanceof Error?a.stack:null,o="rgba(200,200,200, 0.5)",d={padding:"0.5rem",backgroundColor:o},f={padding:"2px 4px",backgroundColor:o},m=null;return console.error("Error handled by React Router default ErrorBoundary:",a),m=S.createElement(S.Fragment,null,S.createElement("p",null,"💿 Hey developer 👋"),S.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",S.createElement("code",{style:f},"ErrorBoundary")," or"," ",S.createElement("code",{style:f},"errorElement")," prop on your route.")),S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},l),i?S.createElement("pre",{style:d},i):null,m)}var R0=S.createElement(T0,null),tv=class extends S.Component{constructor(a){super(a),this.state={location:a.location,revalidation:a.revalidation,error:a.error}}static getDerivedStateFromError(a){return{error:a}}static getDerivedStateFromProps(a,l){return l.location!==a.location||l.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:l.error,location:l.location,revalidation:a.revalidation||l.revalidation}}componentDidCatch(a,l){this.props.onError?this.props.onError(a,l):console.error("React Router caught the following error during render",a)}render(){let a=this.state.error;if(this.context&&typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){const i=y0(a.digest);i&&(a=i)}let l=a!==void 0?S.createElement(xa.Provider,{value:this.props.routeContext},S.createElement(gd.Provider,{value:a,children:this.props.component})):this.props.children;return this.context?S.createElement(C0,{error:a},l):l}};tv.contextType=m0;var qu=new WeakMap;function C0({children:a,error:l}){let{basename:i}=S.useContext(ra);if(typeof l=="object"&&l&&"digest"in l&&typeof l.digest=="string"){let o=g0(l.digest);if(o){let d=qu.get(l);if(d)throw d;let f=Zx(o.location,i);if(Kx&&!qu.get(l))if(f.isExternal||o.reloadDocument)window.location.href=f.absoluteURL||f.to;else{const m=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(f.to,{replace:o.replace}));throw qu.set(l,m),m}return S.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f.absoluteURL||f.to}`})}}return a}function _0({routeContext:a,match:l,children:i}){let o=S.useContext(ol);return o&&o.static&&o.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=l.route.id),S.createElement(xa.Provider,{value:a},i)}function M0(a,l=[],i=null,o=null,d=null){if(a==null){if(!i)return null;if(i.errors)a=i.matches;else if(l.length===0&&!i.initialized&&i.matches.length>0)a=i.matches;else return null}let f=a,m=i?.errors;if(m!=null){let y=f.findIndex(x=>x.route.id&&m?.[x.route.id]!==void 0);Pe(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(m).join(",")}`),f=f.slice(0,Math.min(f.length,y+1))}let v=!1,g=-1;if(i)for(let y=0;y<f.length;y++){let x=f[y];if((x.route.HydrateFallback||x.route.hydrateFallbackElement)&&(g=y),x.route.id){let{loaderData:N,errors:A}=i,j=x.route.loader&&!N.hasOwnProperty(x.route.id)&&(!A||A[x.route.id]===void 0);if(x.route.lazy||j){v=!0,g>=0?f=f.slice(0,g+1):f=[f[0]];break}}}let p=i&&o?(y,x)=>{o(y,{location:i.location,params:i.matches?.[0]?.params??{},unstable_pattern:d0(i.matches),errorInfo:x})}:void 0;return f.reduceRight((y,x,N)=>{let A,j=!1,E=null,R=null;i&&(A=m&&x.route.id?m[x.route.id]:void 0,E=x.route.errorElement||R0,v&&(g<0&&N===0?(av("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),j=!0,R=null):g===N&&(j=!0,R=x.route.hydrateFallbackElement||null)));let O=l.concat(f.slice(0,N+1)),M=()=>{let V;return A?V=E:j?V=R:x.route.Component?V=S.createElement(x.route.Component,null):x.route.element?V=x.route.element:V=y,S.createElement(_0,{match:x,routeContext:{outlet:y,matches:O,isDataRoute:i!=null},children:V})};return i&&(x.route.ErrorBoundary||x.route.errorElement||N===0)?S.createElement(tv,{location:i.location,revalidation:i.revalidation,component:E,error:A,children:M(),routeContext:{outlet:null,matches:O,isDataRoute:!0},onError:p}):M()},null)}function yd(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function A0(a){let l=S.useContext(ol);return Pe(l,yd(a)),l}function k0(a){let l=S.useContext(oo);return Pe(l,yd(a)),l}function O0(a){let l=S.useContext(xa);return Pe(l,yd(a)),l}function bd(a){let l=O0(a),i=l.matches[l.matches.length-1];return Pe(i.route.id,`${a} can only be used on routes that contain a unique "id"`),i.route.id}function z0(){return bd("useRouteId")}function D0(){let a=S.useContext(gd),l=k0("useRouteError"),i=bd("useRouteError");return a!==void 0?a:l.errors?.[i]}function L0(){let{router:a}=A0("useNavigate"),l=bd("useNavigate"),i=S.useRef(!1);return Wx(()=>{i.current=!0}),S.useCallback(async(d,f={})=>{ja(i.current,Ix),i.current&&(typeof d=="number"?await a.navigate(d):await a.navigate(d,{fromRouteId:l,...f}))},[a,l])}var $p={};function av(a,l,i){!l&&!$p[a]&&($p[a]=!0,ja(!1,i))}S.memo(U0);function U0({routes:a,future:l,state:i,onError:o}){return ev(a,void 0,i,o,l)}function ao({to:a,replace:l,state:i,relative:o}){Pe(cl(),"<Navigate> may be used only in the context of a <Router> component.");let{static:d}=S.useContext(ra);ja(!d,"<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:f}=S.useContext(xa),{pathname:m}=On(),v=wa(),g=vd(a,xd(f),m,o==="path"),p=JSON.stringify(g);return S.useEffect(()=>{v(JSON.parse(p),{replace:l,state:i,relative:o})},[v,p,o,l,i]),null}function B0(a){return j0(a.context)}function pt(a){Pe(!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 q0({basename:a="/",children:l=null,location:i,navigationType:o="POP",navigator:d,static:f=!1,unstable_useTransitions:m}){Pe(!cl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let v=a.replace(/^\/*/,"/"),g=S.useMemo(()=>({basename:v,navigator:d,static:f,unstable_useTransitions:m,future:{}}),[v,d,f,m]);typeof i=="string"&&(i=il(i));let{pathname:p="/",search:y="",hash:x="",state:N=null,key:A="default"}=i,j=S.useMemo(()=>{let E=tn(p,v);return E==null?null:{location:{pathname:E,search:y,hash:x,state:N,key:A},navigationType:o}},[v,p,y,x,N,A,o]);return ja(j!=null,`<Router basename="${v}"> is not able to match the URL "${p}${y}${x}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:S.createElement(ra.Provider,{value:g},S.createElement(ys.Provider,{children:l,value:j}))}function H0({children:a,location:l}){return E0(ed(a),l)}function ed(a,l=[]){let i=[];return S.Children.forEach(a,(o,d)=>{if(!S.isValidElement(o))return;let f=[...l,d];if(o.type===S.Fragment){i.push.apply(i,ed(o.props.children,f));return}Pe(o.type===pt,`[${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>`),Pe(!o.props.index||!o.props.children,"An index route cannot have child routes.");let m={id:o.props.id||f.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&&(m.children=ed(o.props.children,f)),i.push(m)}),i}var $i="get",Ji="application/x-www-form-urlencoded";function co(a){return typeof HTMLElement<"u"&&a instanceof HTMLElement}function G0(a){return co(a)&&a.tagName.toLowerCase()==="button"}function Q0(a){return co(a)&&a.tagName.toLowerCase()==="form"}function V0(a){return co(a)&&a.tagName.toLowerCase()==="input"}function F0(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}function Y0(a,l){return a.button===0&&(!l||l==="_self")&&!F0(a)}var Hi=null;function X0(){if(Hi===null)try{new FormData(document.createElement("form"),0),Hi=!1}catch{Hi=!0}return Hi}var K0=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Hu(a){return a!=null&&!K0.has(a)?(ja(!1,`"${a}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ji}"`),null):a}function Z0(a,l){let i,o,d,f,m;if(Q0(a)){let v=a.getAttribute("action");o=v?tn(v,l):null,i=a.getAttribute("method")||$i,d=Hu(a.getAttribute("enctype"))||Ji,f=new FormData(a)}else if(G0(a)||V0(a)&&(a.type==="submit"||a.type==="image")){let v=a.form;if(v==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=a.getAttribute("formaction")||v.getAttribute("action");if(o=g?tn(g,l):null,i=a.getAttribute("formmethod")||v.getAttribute("method")||$i,d=Hu(a.getAttribute("formenctype"))||Hu(v.getAttribute("enctype"))||Ji,f=new FormData(v,a),!X0()){let{name:p,type:y,value:x}=a;if(y==="image"){let N=p?`${p}.`:"";f.append(`${N}x`,"0"),f.append(`${N}y`,"0")}else p&&f.append(p,x)}}else{if(co(a))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=$i,o=null,d=Ji,m=a}return f&&d==="text/plain"&&(m=f,f=void 0),{action:o,method:i.toLowerCase(),encType:d,formData:f,body:m}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Sd(a,l){if(a===!1||a===null||typeof a>"u")throw new Error(l)}function $0(a,l,i,o){let d=typeof a=="string"?new URL(a,typeof window>"u"?"server://singlefetch/":window.location.origin):a;return i?d.pathname.endsWith("/")?d.pathname=`${d.pathname}_.${o}`:d.pathname=`${d.pathname}.${o}`:d.pathname==="/"?d.pathname=`_root.${o}`:l&&tn(d.pathname,l)==="/"?d.pathname=`${l.replace(/\/$/,"")}/_root.${o}`:d.pathname=`${d.pathname.replace(/\/$/,"")}.${o}`,d}async function J0(a,l){if(a.id in l)return l[a.id];try{let i=await import(a.module);return l[a.id]=i,i}catch(i){return console.error(`Error loading route module \`${a.module}\`, reloading page...`),console.error(i),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function P0(a){return a==null?!1:a.href==null?a.rel==="preload"&&typeof a.imageSrcSet=="string"&&typeof a.imageSizes=="string":typeof a.rel=="string"&&typeof a.href=="string"}async function I0(a,l,i){let o=await Promise.all(a.map(async d=>{let f=l.routes[d.route.id];if(f){let m=await J0(f,i);return m.links?m.links():[]}return[]}));return a1(o.flat(1).filter(P0).filter(d=>d.rel==="stylesheet"||d.rel==="preload").map(d=>d.rel==="stylesheet"?{...d,rel:"prefetch",as:"style"}:{...d,rel:"prefetch"}))}function Jp(a,l,i,o,d,f){let m=(g,p)=>i[p]?g.route.id!==i[p].route.id:!0,v=(g,p)=>i[p].pathname!==g.pathname||i[p].route.path?.endsWith("*")&&i[p].params["*"]!==g.params["*"];return f==="assets"?l.filter((g,p)=>m(g,p)||v(g,p)):f==="data"?l.filter((g,p)=>{let y=o.routes[g.route.id];if(!y||!y.hasLoader)return!1;if(m(g,p)||v(g,p))return!0;if(g.route.shouldRevalidate){let x=g.route.shouldRevalidate({currentUrl:new URL(d.pathname+d.search+d.hash,window.origin),currentParams:i[0]?.params||{},nextUrl:new URL(a,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function W0(a,l,{includeHydrateFallback:i}={}){return e1(a.map(o=>{let d=l.routes[o.route.id];if(!d)return[];let f=[d.module];return d.clientActionModule&&(f=f.concat(d.clientActionModule)),d.clientLoaderModule&&(f=f.concat(d.clientLoaderModule)),i&&d.hydrateFallbackModule&&(f=f.concat(d.hydrateFallbackModule)),d.imports&&(f=f.concat(d.imports)),f}).flat(1))}function e1(a){return[...new Set(a)]}function t1(a){let l={},i=Object.keys(a).sort();for(let o of i)l[o]=a[o];return l}function a1(a,l){let i=new Set;return new Set(l),a.reduce((o,d)=>{let f=JSON.stringify(t1(d));return i.has(f)||(i.add(f),o.push({key:f,link:d})),o},[])}function nv(){let a=S.useContext(ol);return Sd(a,"You must render this element inside a <DataRouterContext.Provider> element"),a}function n1(){let a=S.useContext(oo);return Sd(a,"You must render this element inside a <DataRouterStateContext.Provider> element"),a}var Nd=S.createContext(void 0);Nd.displayName="FrameworkContext";function rv(){let a=S.useContext(Nd);return Sd(a,"You must render this element inside a <HydratedRouter> element"),a}function r1(a,l){let i=S.useContext(Nd),[o,d]=S.useState(!1),[f,m]=S.useState(!1),{onFocus:v,onBlur:g,onMouseEnter:p,onMouseLeave:y,onTouchStart:x}=l,N=S.useRef(null);S.useEffect(()=>{if(a==="render"&&m(!0),a==="viewport"){let E=O=>{O.forEach(M=>{m(M.isIntersecting)})},R=new IntersectionObserver(E,{threshold:.5});return N.current&&R.observe(N.current),()=>{R.disconnect()}}},[a]),S.useEffect(()=>{if(o){let E=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(E)}}},[o]);let A=()=>{d(!0)},j=()=>{d(!1),m(!1)};return i?a!=="intent"?[f,N,{}]:[f,N,{onFocus:us(v,A),onBlur:us(g,j),onMouseEnter:us(p,A),onMouseLeave:us(y,j),onTouchStart:us(x,A)}]:[!1,N,{}]}function us(a,l){return i=>{a&&a(i),i.defaultPrevented||l(i)}}function l1({page:a,...l}){let{router:i}=nv(),o=S.useMemo(()=>Fx(i.routes,a,i.basename),[i.routes,a,i.basename]);return o?S.createElement(i1,{page:a,matches:o,...l}):null}function s1(a){let{manifest:l,routeModules:i}=rv(),[o,d]=S.useState([]);return S.useEffect(()=>{let f=!1;return I0(a,l,i).then(m=>{f||d(m)}),()=>{f=!0}},[a,l,i]),o}function i1({page:a,matches:l,...i}){let o=On(),{future:d,manifest:f,routeModules:m}=rv(),{basename:v}=nv(),{loaderData:g,matches:p}=n1(),y=S.useMemo(()=>Jp(a,l,p,f,o,"data"),[a,l,p,f,o]),x=S.useMemo(()=>Jp(a,l,p,f,o,"assets"),[a,l,p,f,o]),N=S.useMemo(()=>{if(a===o.pathname+o.search+o.hash)return[];let E=new Set,R=!1;if(l.forEach(M=>{let V=f.routes[M.route.id];!V||!V.hasLoader||(!y.some(U=>U.route.id===M.route.id)&&M.route.id in g&&m[M.route.id]?.shouldRevalidate||V.hasClientLoader?R=!0:E.add(M.route.id))}),E.size===0)return[];let O=$0(a,v,d.unstable_trailingSlashAwareDataRequests,"data");return R&&E.size>0&&O.searchParams.set("_routes",l.filter(M=>E.has(M.route.id)).map(M=>M.route.id).join(",")),[O.pathname+O.search]},[v,d.unstable_trailingSlashAwareDataRequests,g,o,f,y,l,a,m]),A=S.useMemo(()=>W0(x,f),[x,f]),j=s1(x);return S.createElement(S.Fragment,null,N.map(E=>S.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...i})),A.map(E=>S.createElement("link",{key:E,rel:"modulepreload",href:E,...i})),j.map(({key:E,link:R})=>S.createElement("link",{key:E,nonce:i.nonce,...R,crossOrigin:R.crossOrigin??i.crossOrigin})))}function o1(...a){return l=>{a.forEach(i=>{typeof i=="function"?i(l):i!=null&&(i.current=l)})}}var c1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{c1&&(window.__reactRouterVersion="7.13.0")}catch{}function u1({basename:a,children:l,unstable_useTransitions:i,window:o}){let d=S.useRef();d.current==null&&(d.current=Hb({window:o,v5Compat:!0}));let f=d.current,[m,v]=S.useState({action:f.action,location:f.location}),g=S.useCallback(p=>{i===!1?v(p):S.startTransition(()=>v(p))},[i]);return S.useLayoutEffect(()=>f.listen(g),[f,g]),S.createElement(q0,{basename:a,children:l,location:m.location,navigationType:m.action,navigator:f,unstable_useTransitions:i})}var lv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,jd=S.forwardRef(function({onClick:l,discover:i="render",prefetch:o="none",relative:d,reloadDocument:f,replace:m,state:v,target:g,to:p,preventScrollReset:y,viewTransition:x,unstable_defaultShouldRevalidate:N,...A},j){let{basename:E,unstable_useTransitions:R}=S.useContext(ra),O=typeof p=="string"&&lv.test(p),M=Zx(p,E);p=M.to;let V=b0(p,{relative:d}),[U,ne,W]=r1(o,A),$=m1(p,{replace:m,state:v,target:g,preventScrollReset:y,relative:d,viewTransition:x,unstable_defaultShouldRevalidate:N,unstable_useTransitions:R});function G(je){l&&l(je),je.defaultPrevented||$(je)}let se=S.createElement("a",{...A,...W,href:M.absoluteURL||V,onClick:M.isExternal||f?l:G,ref:o1(j,ne),target:g,"data-discover":!O&&i==="render"?"true":void 0});return U&&!O?S.createElement(S.Fragment,null,se,S.createElement(l1,{page:V})):se});jd.displayName="Link";var sv=S.forwardRef(function({"aria-current":l="page",caseSensitive:i=!1,className:o="",end:d=!1,style:f,to:m,viewTransition:v,children:g,...p},y){let x=bs(m,{relative:p.relative}),N=On(),A=S.useContext(oo),{navigator:j,basename:E}=S.useContext(ra),R=A!=null&&g1(x)&&v===!0,O=j.encodeLocation?j.encodeLocation(x).pathname:x.pathname,M=N.pathname,V=A&&A.navigation&&A.navigation.location?A.navigation.location.pathname:null;i||(M=M.toLowerCase(),V=V?V.toLowerCase():null,O=O.toLowerCase()),V&&E&&(V=tn(V,E)||V);const U=O!=="/"&&O.endsWith("/")?O.length-1:O.length;let ne=M===O||!d&&M.startsWith(O)&&M.charAt(U)==="/",W=V!=null&&(V===O||!d&&V.startsWith(O)&&V.charAt(O.length)==="/"),$={isActive:ne,isPending:W,isTransitioning:R},G=ne?l:void 0,se;typeof o=="function"?se=o($):se=[o,ne?"active":null,W?"pending":null,R?"transitioning":null].filter(Boolean).join(" ");let je=typeof f=="function"?f($):f;return S.createElement(jd,{...p,"aria-current":G,className:se,ref:y,style:je,to:m,viewTransition:v},typeof g=="function"?g($):g)});sv.displayName="NavLink";var d1=S.forwardRef(({discover:a="render",fetcherKey:l,navigate:i,reloadDocument:o,replace:d,state:f,method:m=$i,action:v,onSubmit:g,relative:p,preventScrollReset:y,viewTransition:x,unstable_defaultShouldRevalidate:N,...A},j)=>{let{unstable_useTransitions:E}=S.useContext(ra),R=x1(),O=v1(v,{relative:p}),M=m.toLowerCase()==="get"?"get":"post",V=typeof v=="string"&&lv.test(v),U=ne=>{if(g&&g(ne),ne.defaultPrevented)return;ne.preventDefault();let W=ne.nativeEvent.submitter,$=W?.getAttribute("formmethod")||m,G=()=>R(W||ne.currentTarget,{fetcherKey:l,method:$,navigate:i,replace:d,state:f,relative:p,preventScrollReset:y,viewTransition:x,unstable_defaultShouldRevalidate:N});E&&i!==!1?S.startTransition(()=>G()):G()};return S.createElement("form",{ref:j,method:M,action:O,onSubmit:o?g:U,...A,"data-discover":!V&&a==="render"?"true":void 0})});d1.displayName="Form";function f1(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function iv(a){let l=S.useContext(ol);return Pe(l,f1(a)),l}function m1(a,{target:l,replace:i,state:o,preventScrollReset:d,relative:f,viewTransition:m,unstable_defaultShouldRevalidate:v,unstable_useTransitions:g}={}){let p=wa(),y=On(),x=bs(a,{relative:f});return S.useCallback(N=>{if(Y0(N,l)){N.preventDefault();let A=i!==void 0?i:vs(y)===vs(x),j=()=>p(a,{replace:A,state:o,preventScrollReset:d,relative:f,viewTransition:m,unstable_defaultShouldRevalidate:v});g?S.startTransition(()=>j()):j()}},[y,p,x,i,o,l,a,d,f,m,v,g])}var h1=0,p1=()=>`__${String(++h1)}__`;function x1(){let{router:a}=iv("useSubmit"),{basename:l}=S.useContext(ra),i=z0(),o=a.fetch,d=a.navigate;return S.useCallback(async(f,m={})=>{let{action:v,method:g,encType:p,formData:y,body:x}=Z0(f,l);if(m.navigate===!1){let N=m.fetcherKey||p1();await o(N,i,m.action||v,{unstable_defaultShouldRevalidate:m.unstable_defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:y,body:x,formMethod:m.method||g,formEncType:m.encType||p,flushSync:m.flushSync})}else await d(m.action||v,{unstable_defaultShouldRevalidate:m.unstable_defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:y,body:x,formMethod:m.method||g,formEncType:m.encType||p,replace:m.replace,state:m.state,fromRouteId:i,flushSync:m.flushSync,viewTransition:m.viewTransition})},[o,d,l,i])}function v1(a,{relative:l}={}){let{basename:i}=S.useContext(ra),o=S.useContext(xa);Pe(o,"useFormAction must be used inside a RouteContext");let[d]=o.matches.slice(-1),f={...bs(a||".",{relative:l})},m=On();if(a==null){f.search=m.search;let v=new URLSearchParams(f.search),g=v.getAll("index");if(g.some(y=>y==="")){v.delete("index"),g.filter(x=>x).forEach(x=>v.append("index",x));let y=v.toString();f.search=y?`?${y}`:""}}return(!a||a===".")&&d.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(f.pathname=f.pathname==="/"?i:en([i,f.pathname])),vs(f)}function g1(a,{relative:l}={}){let i=S.useContext(Jx);Pe(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=iv("useViewTransitionState"),d=bs(a,{relative:l});if(!i.isTransitioning)return!1;let f=tn(i.currentLocation.pathname,o)||i.currentLocation.pathname,m=tn(i.nextLocation.pathname,o)||i.nextLocation.pathname;return to(d.pathname,m)!=null||to(d.pathname,f)!=null}var y1=Vx();const b1=Qx(y1);var ul=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(a){return this.listeners.add(a),this.onSubscribe(),()=>{this.listeners.delete(a),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},S1={setTimeout:(a,l)=>setTimeout(a,l),clearTimeout:a=>clearTimeout(a),setInterval:(a,l)=>setInterval(a,l),clearInterval:a=>clearInterval(a)},N1=class{#e=S1;#t=!1;setTimeoutProvider(a){this.#e=a}setTimeout(a,l){return this.#e.setTimeout(a,l)}clearTimeout(a){this.#e.clearTimeout(a)}setInterval(a,l){return this.#e.setInterval(a,l)}clearInterval(a){this.#e.clearInterval(a)}},lr=new N1;function j1(a){setTimeout(a,0)}var or=typeof window>"u"||"Deno"in globalThis;function Ot(){}function w1(a,l){return typeof a=="function"?a(l):a}function td(a){return typeof a=="number"&&a>=0&&a!==1/0}function ov(a,l){return Math.max(a+(l||0)-Date.now(),0)}function An(a,l){return typeof a=="function"?a(l):a}function pa(a,l){return typeof a=="function"?a(l):a}function Pp(a,l){const{type:i="all",exact:o,fetchStatus:d,predicate:f,queryKey:m,stale:v}=a;if(m){if(o){if(l.queryHash!==wd(m,l.options))return!1}else if(!gs(l.queryKey,m))return!1}if(i!=="all"){const g=l.isActive();if(i==="active"&&!g||i==="inactive"&&g)return!1}return!(typeof v=="boolean"&&l.isStale()!==v||d&&d!==l.state.fetchStatus||f&&!f(l))}function Ip(a,l){const{exact:i,status:o,predicate:d,mutationKey:f}=a;if(f){if(!l.options.mutationKey)return!1;if(i){if(cr(l.options.mutationKey)!==cr(f))return!1}else if(!gs(l.options.mutationKey,f))return!1}return!(o&&l.state.status!==o||d&&!d(l))}function wd(a,l){return(l?.queryKeyHashFn||cr)(a)}function cr(a){return JSON.stringify(a,(l,i)=>ad(i)?Object.keys(i).sort().reduce((o,d)=>(o[d]=i[d],o),{}):i)}function gs(a,l){return a===l?!0:typeof a!=typeof l?!1:a&&l&&typeof a=="object"&&typeof l=="object"?Object.keys(l).every(i=>gs(a[i],l[i])):!1}var E1=Object.prototype.hasOwnProperty;function cv(a,l,i=0){if(a===l)return a;if(i>500)return l;const o=Wp(a)&&Wp(l);if(!o&&!(ad(a)&&ad(l)))return l;const f=(o?a:Object.keys(a)).length,m=o?l:Object.keys(l),v=m.length,g=o?new Array(v):{};let p=0;for(let y=0;y<v;y++){const x=o?y:m[y],N=a[x],A=l[x];if(N===A){g[x]=N,(o?y<f:E1.call(a,x))&&p++;continue}if(N===null||A===null||typeof N!="object"||typeof A!="object"){g[x]=A;continue}const j=cv(N,A,i+1);g[x]=j,j===N&&p++}return f===v&&p===f?a:g}function no(a,l){if(!l||Object.keys(a).length!==Object.keys(l).length)return!1;for(const i in a)if(a[i]!==l[i])return!1;return!0}function Wp(a){return Array.isArray(a)&&a.length===Object.keys(a).length}function ad(a){if(!ex(a))return!1;const l=a.constructor;if(l===void 0)return!0;const i=l.prototype;return!(!ex(i)||!i.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(a)!==Object.prototype)}function ex(a){return Object.prototype.toString.call(a)==="[object Object]"}function T1(a){return new Promise(l=>{lr.setTimeout(l,a)})}function nd(a,l,i){return typeof i.structuralSharing=="function"?i.structuralSharing(a,l):i.structuralSharing!==!1?cv(a,l):l}function R1(a,l,i=0){const o=[...a,l];return i&&o.length>i?o.slice(1):o}function C1(a,l,i=0){const o=[l,...a];return i&&o.length>i?o.slice(0,-1):o}var Ed=Symbol();function uv(a,l){return!a.queryFn&&l?.initialPromise?()=>l.initialPromise:!a.queryFn||a.queryFn===Ed?()=>Promise.reject(new Error(`Missing queryFn: '${a.queryHash}'`)):a.queryFn}function Td(a,l){return typeof a=="function"?a(...l):!!a}function _1(a,l,i){let o=!1,d;return Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(d??=l(),o||(o=!0,d.aborted?i():d.addEventListener("abort",i,{once:!0})),d)}),a}var M1=class extends ul{#e;#t;#a;constructor(){super(),this.#a=a=>{if(!or&&window.addEventListener){const l=()=>a();return window.addEventListener("visibilitychange",l,!1),()=>{window.removeEventListener("visibilitychange",l)}}}}onSubscribe(){this.#t||this.setEventListener(this.#a)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(a){this.#a=a,this.#t?.(),this.#t=a(l=>{typeof l=="boolean"?this.setFocused(l):this.onFocus()})}setFocused(a){this.#e!==a&&(this.#e=a,this.onFocus())}onFocus(){const a=this.isFocused();this.listeners.forEach(l=>{l(a)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Rd=new M1;function rd(){let a,l;const i=new Promise((d,f)=>{a=d,l=f});i.status="pending",i.catch(()=>{});function o(d){Object.assign(i,d),delete i.resolve,delete i.reject}return i.resolve=d=>{o({status:"fulfilled",value:d}),a(d)},i.reject=d=>{o({status:"rejected",reason:d}),l(d)},i}var A1=j1;function k1(){let a=[],l=0,i=v=>{v()},o=v=>{v()},d=A1;const f=v=>{l?a.push(v):d(()=>{i(v)})},m=()=>{const v=a;a=[],v.length&&d(()=>{o(()=>{v.forEach(g=>{i(g)})})})};return{batch:v=>{let g;l++;try{g=v()}finally{l--,l||m()}return g},batchCalls:v=>(...g)=>{f(()=>{v(...g)})},schedule:f,setNotifyFunction:v=>{i=v},setBatchNotifyFunction:v=>{o=v},setScheduler:v=>{d=v}}}var dt=k1(),O1=class extends ul{#e=!0;#t;#a;constructor(){super(),this.#a=a=>{if(!or&&window.addEventListener){const l=()=>a(!0),i=()=>a(!1);return window.addEventListener("online",l,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",l),window.removeEventListener("offline",i)}}}}onSubscribe(){this.#t||this.setEventListener(this.#a)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(a){this.#a=a,this.#t?.(),this.#t=a(this.setOnline.bind(this))}setOnline(a){this.#e!==a&&(this.#e=a,this.listeners.forEach(i=>{i(a)}))}isOnline(){return this.#e}},ro=new O1;function z1(a){return Math.min(1e3*2**a,3e4)}function dv(a){return(a??"online")==="online"?ro.isOnline():!0}var ld=class extends Error{constructor(a){super("CancelledError"),this.revert=a?.revert,this.silent=a?.silent}};function fv(a){let l=!1,i=0,o;const d=rd(),f=()=>d.status!=="pending",m=E=>{if(!f()){const R=new ld(E);N(R),a.onCancel?.(R)}},v=()=>{l=!0},g=()=>{l=!1},p=()=>Rd.isFocused()&&(a.networkMode==="always"||ro.isOnline())&&a.canRun(),y=()=>dv(a.networkMode)&&a.canRun(),x=E=>{f()||(o?.(),d.resolve(E))},N=E=>{f()||(o?.(),d.reject(E))},A=()=>new Promise(E=>{o=R=>{(f()||p())&&E(R)},a.onPause?.()}).then(()=>{o=void 0,f()||a.onContinue?.()}),j=()=>{if(f())return;let E;const R=i===0?a.initialPromise:void 0;try{E=R??a.fn()}catch(O){E=Promise.reject(O)}Promise.resolve(E).then(x).catch(O=>{if(f())return;const M=a.retry??(or?0:3),V=a.retryDelay??z1,U=typeof V=="function"?V(i,O):V,ne=M===!0||typeof M=="number"&&i<M||typeof M=="function"&&M(i,O);if(l||!ne){N(O);return}i++,a.onFail?.(i,O),T1(U).then(()=>p()?void 0:A()).then(()=>{l?N(O):j()})})};return{promise:d,status:()=>d.status,cancel:m,continue:()=>(o?.(),d),cancelRetry:v,continueRetry:g,canStart:y,start:()=>(y()?j():A().then(j),d)}}var mv=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),td(this.gcTime)&&(this.#e=lr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(a){this.gcTime=Math.max(this.gcTime||0,a??(or?1/0:300*1e3))}clearGcTimeout(){this.#e&&(lr.clearTimeout(this.#e),this.#e=void 0)}},D1=class extends mv{#e;#t;#a;#r;#n;#s;#i;constructor(a){super(),this.#i=!1,this.#s=a.defaultOptions,this.setOptions(a.options),this.observers=[],this.#r=a.client,this.#a=this.#r.getQueryCache(),this.queryKey=a.queryKey,this.queryHash=a.queryHash,this.#e=ax(this.options),this.state=a.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#n?.promise}setOptions(a){if(this.options={...this.#s,...a},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const l=ax(this.options);l.data!==void 0&&(this.setState(tx(l.data,l.dataUpdatedAt)),this.#e=l)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#a.remove(this)}setData(a,l){const i=nd(this.state.data,a,this.options);return this.#l({data:i,type:"success",dataUpdatedAt:l?.updatedAt,manual:l?.manual}),i}setState(a,l){this.#l({type:"setState",state:a,setStateOptions:l})}cancel(a){const l=this.#n?.promise;return this.#n?.cancel(a),l?l.then(Ot).catch(Ot):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(a=>pa(a.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ed||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(a=>An(a.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(a=>a.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(a=0){return this.state.data===void 0?!0:a==="static"?!1:this.state.isInvalidated?!0:!ov(this.state.dataUpdatedAt,a)}onFocus(){this.observers.find(l=>l.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(l=>l.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(a){this.observers.includes(a)||(this.observers.push(a),this.clearGcTimeout(),this.#a.notify({type:"observerAdded",query:this,observer:a}))}removeObserver(a){this.observers.includes(a)&&(this.observers=this.observers.filter(l=>l!==a),this.observers.length||(this.#n&&(this.#i?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#a.notify({type:"observerRemoved",query:this,observer:a}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(a,l){if(this.state.fetchStatus!=="idle"&&this.#n?.status()!=="rejected"){if(this.state.data!==void 0&&l?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(a&&this.setOptions(a),!this.options.queryFn){const v=this.observers.find(g=>g.options.queryFn);v&&this.setOptions(v.options)}const i=new AbortController,o=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(this.#i=!0,i.signal)})},d=()=>{const v=uv(this.options,l),p=(()=>{const y={client:this.#r,queryKey:this.queryKey,meta:this.meta};return o(y),y})();return this.#i=!1,this.options.persister?this.options.persister(v,p,this):v(p)},m=(()=>{const v={fetchOptions:l,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:d};return o(v),v})();this.options.behavior?.onFetch(m,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==m.fetchOptions?.meta)&&this.#l({type:"fetch",meta:m.fetchOptions?.meta}),this.#n=fv({initialPromise:l?.initialPromise,fn:m.fetchFn,onCancel:v=>{v instanceof ld&&v.revert&&this.setState({...this.#t,fetchStatus:"idle"}),i.abort()},onFail:(v,g)=>{this.#l({type:"failed",failureCount:v,error:g})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:m.options.retry,retryDelay:m.options.retryDelay,networkMode:m.options.networkMode,canRun:()=>!0});try{const v=await this.#n.start();if(v===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(v),this.#a.config.onSuccess?.(v,this),this.#a.config.onSettled?.(v,this.state.error,this),v}catch(v){if(v instanceof ld){if(v.silent)return this.#n.promise;if(v.revert){if(this.state.data===void 0)throw v;return this.state.data}}throw this.#l({type:"error",error:v}),this.#a.config.onError?.(v,this),this.#a.config.onSettled?.(this.state.data,v,this),v}finally{this.scheduleGc()}}#l(a){const l=i=>{switch(a.type){case"failed":return{...i,fetchFailureCount:a.failureCount,fetchFailureReason:a.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...hv(i.data,this.options),fetchMeta:a.meta??null};case"success":const o={...i,...tx(a.data,a.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!a.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=a.manual?o:void 0,o;case"error":const d=a.error;return{...i,error:d,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:d,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...a.state}}};this.state=l(this.state),dt.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),this.#a.notify({query:this,type:"updated",action:a})})}};function hv(a,l){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:dv(l.networkMode)?"fetching":"paused",...a===void 0&&{error:null,status:"pending"}}}function tx(a,l){return{data:a,dataUpdatedAt:l??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ax(a){const l=typeof a.initialData=="function"?a.initialData():a.initialData,i=l!==void 0,o=i?typeof a.initialDataUpdatedAt=="function"?a.initialDataUpdatedAt():a.initialDataUpdatedAt:0;return{data:l,dataUpdateCount:0,dataUpdatedAt:i?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var L1=class extends ul{constructor(a,l){super(),this.options=l,this.#e=a,this.#l=null,this.#i=rd(),this.bindMethods(),this.setOptions(l)}#e;#t=void 0;#a=void 0;#r=void 0;#n;#s;#i;#l;#p;#f;#m;#c;#u;#o;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),nx(this.#t,this.options)?this.#d():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return sd(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return sd(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#S(),this.#t.removeObserver(this)}setOptions(a){const l=this.options,i=this.#t;if(this.options=this.#e.defaultQueryOptions(a),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof pa(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#N(),this.#t.setOptions(this.options),l._defaulted&&!no(this.options,l)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const o=this.hasListeners();o&&rx(this.#t,i,this.options,l)&&this.#d(),this.updateResult(),o&&(this.#t!==i||pa(this.options.enabled,this.#t)!==pa(l.enabled,this.#t)||An(this.options.staleTime,this.#t)!==An(l.staleTime,this.#t))&&this.#x();const d=this.#v();o&&(this.#t!==i||pa(this.options.enabled,this.#t)!==pa(l.enabled,this.#t)||d!==this.#o)&&this.#g(d)}getOptimisticResult(a){const l=this.#e.getQueryCache().build(this.#e,a),i=this.createResult(l,a);return B1(this,i)&&(this.#r=i,this.#s=this.options,this.#n=this.#t.state),i}getCurrentResult(){return this.#r}trackResult(a,l){return new Proxy(a,{get:(i,o)=>(this.trackProp(o),l?.(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#i.status==="pending"&&this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,o))})}trackProp(a){this.#h.add(a)}getCurrentQuery(){return this.#t}refetch({...a}={}){return this.fetch({...a})}fetchOptimistic(a){const l=this.#e.defaultQueryOptions(a),i=this.#e.getQueryCache().build(this.#e,l);return i.fetch().then(()=>this.createResult(i,l))}fetch(a){return this.#d({...a,cancelRefetch:a.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#d(a){this.#N();let l=this.#t.fetch(this.options,a);return a?.throwOnError||(l=l.catch(Ot)),l}#x(){this.#b();const a=An(this.options.staleTime,this.#t);if(or||this.#r.isStale||!td(a))return;const i=ov(this.#r.dataUpdatedAt,a)+1;this.#c=lr.setTimeout(()=>{this.#r.isStale||this.updateResult()},i)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#g(a){this.#S(),this.#o=a,!(or||pa(this.options.enabled,this.#t)===!1||!td(this.#o)||this.#o===0)&&(this.#u=lr.setInterval(()=>{(this.options.refetchIntervalInBackground||Rd.isFocused())&&this.#d()},this.#o))}#y(){this.#x(),this.#g(this.#v())}#b(){this.#c&&(lr.clearTimeout(this.#c),this.#c=void 0)}#S(){this.#u&&(lr.clearInterval(this.#u),this.#u=void 0)}createResult(a,l){const i=this.#t,o=this.options,d=this.#r,f=this.#n,m=this.#s,g=a!==i?a.state:this.#a,{state:p}=a;let y={...p},x=!1,N;if(l._optimisticResults){const G=this.hasListeners(),se=!G&&nx(a,l),je=G&&rx(a,i,l,o);(se||je)&&(y={...y,...hv(p.data,a.options)}),l._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:A,errorUpdatedAt:j,status:E}=y;N=y.data;let R=!1;if(l.placeholderData!==void 0&&N===void 0&&E==="pending"){let G;d?.isPlaceholderData&&l.placeholderData===m?.placeholderData?(G=d.data,R=!0):G=typeof l.placeholderData=="function"?l.placeholderData(this.#m?.state.data,this.#m):l.placeholderData,G!==void 0&&(E="success",N=nd(d?.data,G,l),x=!0)}if(l.select&&N!==void 0&&!R)if(d&&N===f?.data&&l.select===this.#p)N=this.#f;else try{this.#p=l.select,N=l.select(N),N=nd(d?.data,N,l),this.#f=N,this.#l=null}catch(G){this.#l=G}this.#l&&(A=this.#l,N=this.#f,j=Date.now(),E="error");const O=y.fetchStatus==="fetching",M=E==="pending",V=E==="error",U=M&&O,ne=N!==void 0,$={status:E,fetchStatus:y.fetchStatus,isPending:M,isSuccess:E==="success",isError:V,isInitialLoading:U,isLoading:U,data:N,dataUpdatedAt:y.dataUpdatedAt,error:A,errorUpdatedAt:j,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:y.dataUpdateCount>0||y.errorUpdateCount>0,isFetchedAfterMount:y.dataUpdateCount>g.dataUpdateCount||y.errorUpdateCount>g.errorUpdateCount,isFetching:O,isRefetching:O&&!M,isLoadingError:V&&!ne,isPaused:y.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:V&&ne,isStale:Cd(a,l),refetch:this.refetch,promise:this.#i,isEnabled:pa(l.enabled,a)!==!1};if(this.options.experimental_prefetchInRender){const G=$.data!==void 0,se=$.status==="error"&&!G,je=Re=>{se?Re.reject($.error):G&&Re.resolve($.data)},he=()=>{const Re=this.#i=$.promise=rd();je(Re)},me=this.#i;switch(me.status){case"pending":a.queryHash===i.queryHash&&je(me);break;case"fulfilled":(se||$.data!==me.value)&&he();break;case"rejected":(!se||$.error!==me.reason)&&he();break}}return $}updateResult(){const a=this.#r,l=this.createResult(this.#t,this.options);if(this.#n=this.#t.state,this.#s=this.options,this.#n.data!==void 0&&(this.#m=this.#t),no(l,a))return;this.#r=l;const i=()=>{if(!a)return!0;const{notifyOnChangeProps:o}=this.options,d=typeof o=="function"?o():o;if(d==="all"||!d&&!this.#h.size)return!0;const f=new Set(d??this.#h);return this.options.throwOnError&&f.add("error"),Object.keys(this.#r).some(m=>{const v=m;return this.#r[v]!==a[v]&&f.has(v)})};this.#j({listeners:i()})}#N(){const a=this.#e.getQueryCache().build(this.#e,this.options);if(a===this.#t)return;const l=this.#t;this.#t=a,this.#a=a.state,this.hasListeners()&&(l?.removeObserver(this),a.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#j(a){dt.batch(()=>{a.listeners&&this.listeners.forEach(l=>{l(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function U1(a,l){return pa(l.enabled,a)!==!1&&a.state.data===void 0&&!(a.state.status==="error"&&l.retryOnMount===!1)}function nx(a,l){return U1(a,l)||a.state.data!==void 0&&sd(a,l,l.refetchOnMount)}function sd(a,l,i){if(pa(l.enabled,a)!==!1&&An(l.staleTime,a)!=="static"){const o=typeof i=="function"?i(a):i;return o==="always"||o!==!1&&Cd(a,l)}return!1}function rx(a,l,i,o){return(a!==l||pa(o.enabled,a)===!1)&&(!i.suspense||a.state.status!=="error")&&Cd(a,i)}function Cd(a,l){return pa(l.enabled,a)!==!1&&a.isStaleByTime(An(l.staleTime,a))}function B1(a,l){return!no(a.getCurrentResult(),l)}function lx(a){return{onFetch:(l,i)=>{const o=l.options,d=l.fetchOptions?.meta?.fetchMore?.direction,f=l.state.data?.pages||[],m=l.state.data?.pageParams||[];let v={pages:[],pageParams:[]},g=0;const p=async()=>{let y=!1;const x=j=>{_1(j,()=>l.signal,()=>y=!0)},N=uv(l.options,l.fetchOptions),A=async(j,E,R)=>{if(y)return Promise.reject();if(E==null&&j.pages.length)return Promise.resolve(j);const M=(()=>{const W={client:l.client,queryKey:l.queryKey,pageParam:E,direction:R?"backward":"forward",meta:l.options.meta};return x(W),W})(),V=await N(M),{maxPages:U}=l.options,ne=R?C1:R1;return{pages:ne(j.pages,V,U),pageParams:ne(j.pageParams,E,U)}};if(d&&f.length){const j=d==="backward",E=j?q1:sx,R={pages:f,pageParams:m},O=E(o,R);v=await A(R,O,j)}else{const j=a??f.length;do{const E=g===0?m[0]??o.initialPageParam:sx(o,v);if(g>0&&E==null)break;v=await A(v,E),g++}while(g<j)}return v};l.options.persister?l.fetchFn=()=>l.options.persister?.(p,{client:l.client,queryKey:l.queryKey,meta:l.options.meta,signal:l.signal},i):l.fetchFn=p}}}function sx(a,{pages:l,pageParams:i}){const o=l.length-1;return l.length>0?a.getNextPageParam(l[o],l,i[o],i):void 0}function q1(a,{pages:l,pageParams:i}){return l.length>0?a.getPreviousPageParam?.(l[0],l,i[0],i):void 0}var H1=class extends mv{#e;#t;#a;#r;constructor(a){super(),this.#e=a.client,this.mutationId=a.mutationId,this.#a=a.mutationCache,this.#t=[],this.state=a.state||pv(),this.setOptions(a.options),this.scheduleGc()}setOptions(a){this.options=a,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(a){this.#t.includes(a)||(this.#t.push(a),this.clearGcTimeout(),this.#a.notify({type:"observerAdded",mutation:this,observer:a}))}removeObserver(a){this.#t=this.#t.filter(l=>l!==a),this.scheduleGc(),this.#a.notify({type:"observerRemoved",mutation:this,observer:a})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#a.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(a){const l=()=>{this.#n({type:"continue"})},i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=fv({fn:()=>this.options.mutationFn?this.options.mutationFn(a,i):Promise.reject(new Error("No mutationFn found")),onFail:(f,m)=>{this.#n({type:"failed",failureCount:f,error:m})},onPause:()=>{this.#n({type:"pause"})},onContinue:l,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#a.canRun(this)});const o=this.state.status==="pending",d=!this.#r.canStart();try{if(o)l();else{this.#n({type:"pending",variables:a,isPaused:d}),this.#a.config.onMutate&&await this.#a.config.onMutate(a,this,i);const m=await this.options.onMutate?.(a,i);m!==this.state.context&&this.#n({type:"pending",context:m,variables:a,isPaused:d})}const f=await this.#r.start();return await this.#a.config.onSuccess?.(f,a,this.state.context,this,i),await this.options.onSuccess?.(f,a,this.state.context,i),await this.#a.config.onSettled?.(f,null,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(f,null,a,this.state.context,i),this.#n({type:"success",data:f}),f}catch(f){try{await this.#a.config.onError?.(f,a,this.state.context,this,i)}catch(m){Promise.reject(m)}try{await this.options.onError?.(f,a,this.state.context,i)}catch(m){Promise.reject(m)}try{await this.#a.config.onSettled?.(void 0,f,this.state.variables,this.state.context,this,i)}catch(m){Promise.reject(m)}try{await this.options.onSettled?.(void 0,f,a,this.state.context,i)}catch(m){Promise.reject(m)}throw this.#n({type:"error",error:f}),f}finally{this.#a.runNext(this)}}#n(a){const l=i=>{switch(a.type){case"failed":return{...i,failureCount:a.failureCount,failureReason:a.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:a.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:a.isPaused,status:"pending",variables:a.variables,submittedAt:Date.now()};case"success":return{...i,data:a.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:a.error,failureCount:i.failureCount+1,failureReason:a.error,isPaused:!1,status:"error"}}};this.state=l(this.state),dt.batch(()=>{this.#t.forEach(i=>{i.onMutationUpdate(a)}),this.#a.notify({mutation:this,type:"updated",action:a})})}};function pv(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var G1=class extends ul{constructor(a={}){super(),this.config=a,this.#e=new Set,this.#t=new Map,this.#a=0}#e;#t;#a;build(a,l,i){const o=new H1({client:a,mutationCache:this,mutationId:++this.#a,options:a.defaultMutationOptions(l),state:i});return this.add(o),o}add(a){this.#e.add(a);const l=Gi(a);if(typeof l=="string"){const i=this.#t.get(l);i?i.push(a):this.#t.set(l,[a])}this.notify({type:"added",mutation:a})}remove(a){if(this.#e.delete(a)){const l=Gi(a);if(typeof l=="string"){const i=this.#t.get(l);if(i)if(i.length>1){const o=i.indexOf(a);o!==-1&&i.splice(o,1)}else i[0]===a&&this.#t.delete(l)}}this.notify({type:"removed",mutation:a})}canRun(a){const l=Gi(a);if(typeof l=="string"){const o=this.#t.get(l)?.find(d=>d.state.status==="pending");return!o||o===a}else return!0}runNext(a){const l=Gi(a);return typeof l=="string"?this.#t.get(l)?.find(o=>o!==a&&o.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){dt.batch(()=>{this.#e.forEach(a=>{this.notify({type:"removed",mutation:a})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(a){const l={exact:!0,...a};return this.getAll().find(i=>Ip(l,i))}findAll(a={}){return this.getAll().filter(l=>Ip(a,l))}notify(a){dt.batch(()=>{this.listeners.forEach(l=>{l(a)})})}resumePausedMutations(){const a=this.getAll().filter(l=>l.state.isPaused);return dt.batch(()=>Promise.all(a.map(l=>l.continue().catch(Ot))))}};function Gi(a){return a.options.scope?.id}var Q1=class extends ul{#e;#t=void 0;#a;#r;constructor(l,i){super(),this.#e=l,this.setOptions(i),this.bindMethods(),this.#n()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(l){const i=this.options;this.options=this.#e.defaultMutationOptions(l),no(this.options,i)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#a,observer:this}),i?.mutationKey&&this.options.mutationKey&&cr(i.mutationKey)!==cr(this.options.mutationKey)?this.reset():this.#a?.state.status==="pending"&&this.#a.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#a?.removeObserver(this)}onMutationUpdate(l){this.#n(),this.#s(l)}getCurrentResult(){return this.#t}reset(){this.#a?.removeObserver(this),this.#a=void 0,this.#n(),this.#s()}mutate(l,i){return this.#r=i,this.#a?.removeObserver(this),this.#a=this.#e.getMutationCache().build(this.#e,this.options),this.#a.addObserver(this),this.#a.execute(l)}#n(){const l=this.#a?.state??pv();this.#t={...l,isPending:l.status==="pending",isSuccess:l.status==="success",isError:l.status==="error",isIdle:l.status==="idle",mutate:this.mutate,reset:this.reset}}#s(l){dt.batch(()=>{if(this.#r&&this.hasListeners()){const i=this.#t.variables,o=this.#t.context,d={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(l?.type==="success"){try{this.#r.onSuccess?.(l.data,i,o,d)}catch(f){Promise.reject(f)}try{this.#r.onSettled?.(l.data,null,i,o,d)}catch(f){Promise.reject(f)}}else if(l?.type==="error"){try{this.#r.onError?.(l.error,i,o,d)}catch(f){Promise.reject(f)}try{this.#r.onSettled?.(void 0,l.error,i,o,d)}catch(f){Promise.reject(f)}}}this.listeners.forEach(i=>{i(this.#t)})})}},V1=class extends ul{constructor(a={}){super(),this.config=a,this.#e=new Map}#e;build(a,l,i){const o=l.queryKey,d=l.queryHash??wd(o,l);let f=this.get(d);return f||(f=new D1({client:a,queryKey:o,queryHash:d,options:a.defaultQueryOptions(l),state:i,defaultOptions:a.getQueryDefaults(o)}),this.add(f)),f}add(a){this.#e.has(a.queryHash)||(this.#e.set(a.queryHash,a),this.notify({type:"added",query:a}))}remove(a){const l=this.#e.get(a.queryHash);l&&(a.destroy(),l===a&&this.#e.delete(a.queryHash),this.notify({type:"removed",query:a}))}clear(){dt.batch(()=>{this.getAll().forEach(a=>{this.remove(a)})})}get(a){return this.#e.get(a)}getAll(){return[...this.#e.values()]}find(a){const l={exact:!0,...a};return this.getAll().find(i=>Pp(l,i))}findAll(a={}){const l=this.getAll();return Object.keys(a).length>0?l.filter(i=>Pp(a,i)):l}notify(a){dt.batch(()=>{this.listeners.forEach(l=>{l(a)})})}onFocus(){dt.batch(()=>{this.getAll().forEach(a=>{a.onFocus()})})}onOnline(){dt.batch(()=>{this.getAll().forEach(a=>{a.onOnline()})})}},F1=class{#e;#t;#a;#r;#n;#s;#i;#l;constructor(a={}){this.#e=a.queryCache||new V1,this.#t=a.mutationCache||new G1,this.#a=a.defaultOptions||{},this.#r=new Map,this.#n=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#i=Rd.subscribe(async a=>{a&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#l=ro.subscribe(async a=>{a&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#i?.(),this.#i=void 0,this.#l?.(),this.#l=void 0)}isFetching(a){return this.#e.findAll({...a,fetchStatus:"fetching"}).length}isMutating(a){return this.#t.findAll({...a,status:"pending"}).length}getQueryData(a){const l=this.defaultQueryOptions({queryKey:a});return this.#e.get(l.queryHash)?.state.data}ensureQueryData(a){const l=this.defaultQueryOptions(a),i=this.#e.build(this,l),o=i.state.data;return o===void 0?this.fetchQuery(a):(a.revalidateIfStale&&i.isStaleByTime(An(l.staleTime,i))&&this.prefetchQuery(l),Promise.resolve(o))}getQueriesData(a){return this.#e.findAll(a).map(({queryKey:l,state:i})=>{const o=i.data;return[l,o]})}setQueryData(a,l,i){const o=this.defaultQueryOptions({queryKey:a}),f=this.#e.get(o.queryHash)?.state.data,m=w1(l,f);if(m!==void 0)return this.#e.build(this,o).setData(m,{...i,manual:!0})}setQueriesData(a,l,i){return dt.batch(()=>this.#e.findAll(a).map(({queryKey:o})=>[o,this.setQueryData(o,l,i)]))}getQueryState(a){const l=this.defaultQueryOptions({queryKey:a});return this.#e.get(l.queryHash)?.state}removeQueries(a){const l=this.#e;dt.batch(()=>{l.findAll(a).forEach(i=>{l.remove(i)})})}resetQueries(a,l){const i=this.#e;return dt.batch(()=>(i.findAll(a).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...a},l)))}cancelQueries(a,l={}){const i={revert:!0,...l},o=dt.batch(()=>this.#e.findAll(a).map(d=>d.cancel(i)));return Promise.all(o).then(Ot).catch(Ot)}invalidateQueries(a,l={}){return dt.batch(()=>(this.#e.findAll(a).forEach(i=>{i.invalidate()}),a?.refetchType==="none"?Promise.resolve():this.refetchQueries({...a,type:a?.refetchType??a?.type??"active"},l)))}refetchQueries(a,l={}){const i={...l,cancelRefetch:l.cancelRefetch??!0},o=dt.batch(()=>this.#e.findAll(a).filter(d=>!d.isDisabled()&&!d.isStatic()).map(d=>{let f=d.fetch(void 0,i);return i.throwOnError||(f=f.catch(Ot)),d.state.fetchStatus==="paused"?Promise.resolve():f}));return Promise.all(o).then(Ot)}fetchQuery(a){const l=this.defaultQueryOptions(a);l.retry===void 0&&(l.retry=!1);const i=this.#e.build(this,l);return i.isStaleByTime(An(l.staleTime,i))?i.fetch(l):Promise.resolve(i.state.data)}prefetchQuery(a){return this.fetchQuery(a).then(Ot).catch(Ot)}fetchInfiniteQuery(a){return a.behavior=lx(a.pages),this.fetchQuery(a)}prefetchInfiniteQuery(a){return this.fetchInfiniteQuery(a).then(Ot).catch(Ot)}ensureInfiniteQueryData(a){return a.behavior=lx(a.pages),this.ensureQueryData(a)}resumePausedMutations(){return ro.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#a}setDefaultOptions(a){this.#a=a}setQueryDefaults(a,l){this.#r.set(cr(a),{queryKey:a,defaultOptions:l})}getQueryDefaults(a){const l=[...this.#r.values()],i={};return l.forEach(o=>{gs(a,o.queryKey)&&Object.assign(i,o.defaultOptions)}),i}setMutationDefaults(a,l){this.#n.set(cr(a),{mutationKey:a,defaultOptions:l})}getMutationDefaults(a){const l=[...this.#n.values()],i={};return l.forEach(o=>{gs(a,o.mutationKey)&&Object.assign(i,o.defaultOptions)}),i}defaultQueryOptions(a){if(a._defaulted)return a;const l={...this.#a.queries,...this.getQueryDefaults(a.queryKey),...a,_defaulted:!0};return l.queryHash||(l.queryHash=wd(l.queryKey,l)),l.refetchOnReconnect===void 0&&(l.refetchOnReconnect=l.networkMode!=="always"),l.throwOnError===void 0&&(l.throwOnError=!!l.suspense),!l.networkMode&&l.persister&&(l.networkMode="offlineFirst"),l.queryFn===Ed&&(l.enabled=!1),l}defaultMutationOptions(a){return a?._defaulted?a:{...this.#a.mutations,...a?.mutationKey&&this.getMutationDefaults(a.mutationKey),...a,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},xv=S.createContext(void 0),vt=a=>{const l=S.useContext(xv);if(!l)throw new Error("No QueryClient set, use QueryClientProvider to set one");return l},Y1=({client:a,children:l})=>(S.useEffect(()=>(a.mount(),()=>{a.unmount()}),[a]),s.jsx(xv.Provider,{value:a,children:l})),vv=S.createContext(!1),X1=()=>S.useContext(vv);vv.Provider;function K1(){let a=!1;return{clearReset:()=>{a=!1},reset:()=>{a=!0},isReset:()=>a}}var Z1=S.createContext(K1()),$1=()=>S.useContext(Z1),J1=(a,l,i)=>{const o=i?.state.error&&typeof a.throwOnError=="function"?Td(a.throwOnError,[i.state.error,i]):a.throwOnError;(a.suspense||a.experimental_prefetchInRender||o)&&(l.isReset()||(a.retryOnMount=!1))},P1=a=>{S.useEffect(()=>{a.clearReset()},[a])},I1=({result:a,errorResetBoundary:l,throwOnError:i,query:o,suspense:d})=>a.isError&&!l.isReset()&&!a.isFetching&&o&&(d&&a.data===void 0||Td(i,[a.error,o])),W1=a=>{if(a.suspense){const i=d=>d==="static"?d:Math.max(d??1e3,1e3),o=a.staleTime;a.staleTime=typeof o=="function"?(...d)=>i(o(...d)):i(o),typeof a.gcTime=="number"&&(a.gcTime=Math.max(a.gcTime,1e3))}},e2=(a,l)=>a.isLoading&&a.isFetching&&!l,t2=(a,l)=>a?.suspense&&l.isPending,ix=(a,l,i)=>l.fetchOptimistic(a).catch(()=>{i.clearReset()});function a2(a,l,i){const o=X1(),d=$1(),f=vt(),m=f.defaultQueryOptions(a);f.getDefaultOptions().queries?._experimental_beforeQuery?.(m);const v=f.getQueryCache().get(m.queryHash);m._optimisticResults=o?"isRestoring":"optimistic",W1(m),J1(m,d,v),P1(d);const g=!f.getQueryCache().get(m.queryHash),[p]=S.useState(()=>new l(f,m)),y=p.getOptimisticResult(m),x=!o&&a.subscribed!==!1;if(S.useSyncExternalStore(S.useCallback(N=>{const A=x?p.subscribe(dt.batchCalls(N)):Ot;return p.updateResult(),A},[p,x]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),S.useEffect(()=>{p.setOptions(m)},[m,p]),t2(m,y))throw ix(m,p,d);if(I1({result:y,errorResetBoundary:d,throwOnError:m.throwOnError,query:v,suspense:m.suspense}))throw y.error;return f.getDefaultOptions().queries?._experimental_afterQuery?.(m,y),m.experimental_prefetchInRender&&!or&&e2(y,o)&&(g?ix(m,p,d):v?.promise)?.catch(Ot).finally(()=>{p.updateResult()}),m.notifyOnChangeProps?y:p.trackResult(y)}function zt(a,l){return a2(a,L1)}function jt(a,l){const i=vt(),[o]=S.useState(()=>new Q1(i,a));S.useEffect(()=>{o.setOptions(a)},[o,a]);const d=S.useSyncExternalStore(S.useCallback(m=>o.subscribe(dt.batchCalls(m)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),f=S.useCallback((m,v)=>{o.mutate(m,v).catch(Ot)},[o]);if(d.error&&Td(o.options.throwOnError,[d.error]))throw d.error;return{...d,mutate:f,mutateAsync:d.mutate}}function n2(a){if(typeof document>"u")return;let l=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",l.appendChild(i),i.styleSheet?i.styleSheet.cssText=a:i.appendChild(document.createTextNode(a))}const r2=a=>{switch(a){case"success":return i2;case"info":return c2;case"warning":return o2;case"error":return u2;default:return null}},l2=Array(12).fill(0),s2=({visible:a,className:l})=>re.createElement("div",{className:["sonner-loading-wrapper",l].filter(Boolean).join(" "),"data-visible":a},re.createElement("div",{className:"sonner-spinner"},l2.map((i,o)=>re.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),i2=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},re.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"})),o2=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},re.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"})),c2=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},re.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"})),u2=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},re.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"})),d2=re.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"},re.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),re.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),f2=()=>{const[a,l]=re.useState(document.hidden);return re.useEffect(()=>{const i=()=>{l(document.hidden)};return document.addEventListener("visibilitychange",i),()=>window.removeEventListener("visibilitychange",i)},[]),a};let id=1;class m2{constructor(){this.subscribe=l=>(this.subscribers.push(l),()=>{const i=this.subscribers.indexOf(l);this.subscribers.splice(i,1)}),this.publish=l=>{this.subscribers.forEach(i=>i(l))},this.addToast=l=>{this.publish(l),this.toasts=[...this.toasts,l]},this.create=l=>{var i;const{message:o,...d}=l,f=typeof l?.id=="number"||((i=l.id)==null?void 0:i.length)>0?l.id:id++,m=this.toasts.find(g=>g.id===f),v=l.dismissible===void 0?!0:l.dismissible;return this.dismissedToasts.has(f)&&this.dismissedToasts.delete(f),m?this.toasts=this.toasts.map(g=>g.id===f?(this.publish({...g,...l,id:f,title:o}),{...g,...l,id:f,dismissible:v,title:o}):g):this.addToast({title:o,...d,dismissible:v,id:f}),f},this.dismiss=l=>(l?(this.dismissedToasts.add(l),requestAnimationFrame(()=>this.subscribers.forEach(i=>i({id:l,dismiss:!0})))):this.toasts.forEach(i=>{this.subscribers.forEach(o=>o({id:i.id,dismiss:!0}))}),l),this.message=(l,i)=>this.create({...i,message:l}),this.error=(l,i)=>this.create({...i,message:l,type:"error"}),this.success=(l,i)=>this.create({...i,type:"success",message:l}),this.info=(l,i)=>this.create({...i,type:"info",message:l}),this.warning=(l,i)=>this.create({...i,type:"warning",message:l}),this.loading=(l,i)=>this.create({...i,type:"loading",message:l}),this.promise=(l,i)=>{if(!i)return;let o;i.loading!==void 0&&(o=this.create({...i,promise:l,type:"loading",message:i.loading,description:typeof i.description!="function"?i.description:void 0}));const d=Promise.resolve(l instanceof Function?l():l);let f=o!==void 0,m;const v=d.then(async p=>{if(m=["resolve",p],re.isValidElement(p))f=!1,this.create({id:o,type:"default",message:p});else if(p2(p)&&!p.ok){f=!1;const x=typeof i.error=="function"?await i.error(`HTTP error! status: ${p.status}`):i.error,N=typeof i.description=="function"?await i.description(`HTTP error! status: ${p.status}`):i.description,j=typeof x=="object"&&!re.isValidElement(x)?x:{message:x};this.create({id:o,type:"error",description:N,...j})}else if(p instanceof Error){f=!1;const x=typeof i.error=="function"?await i.error(p):i.error,N=typeof i.description=="function"?await i.description(p):i.description,j=typeof x=="object"&&!re.isValidElement(x)?x:{message:x};this.create({id:o,type:"error",description:N,...j})}else if(i.success!==void 0){f=!1;const x=typeof i.success=="function"?await i.success(p):i.success,N=typeof i.description=="function"?await i.description(p):i.description,j=typeof x=="object"&&!re.isValidElement(x)?x:{message:x};this.create({id:o,type:"success",description:N,...j})}}).catch(async p=>{if(m=["reject",p],i.error!==void 0){f=!1;const y=typeof i.error=="function"?await i.error(p):i.error,x=typeof i.description=="function"?await i.description(p):i.description,A=typeof y=="object"&&!re.isValidElement(y)?y:{message:y};this.create({id:o,type:"error",description:x,...A})}}).finally(()=>{f&&(this.dismiss(o),o=void 0),i.finally==null||i.finally.call(i)}),g=()=>new Promise((p,y)=>v.then(()=>m[0]==="reject"?y(m[1]):p(m[1])).catch(y));return typeof o!="string"&&typeof o!="number"?{unwrap:g}:Object.assign(o,{unwrap:g})},this.custom=(l,i)=>{const o=i?.id||id++;return this.create({jsx:l(o),id:o,...i}),o},this.getActiveToasts=()=>this.toasts.filter(l=>!this.dismissedToasts.has(l.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Yt=new m2,h2=(a,l)=>{const i=l?.id||id++;return Yt.addToast({title:a,...l,id:i}),i},p2=a=>a&&typeof a=="object"&&"ok"in a&&typeof a.ok=="boolean"&&"status"in a&&typeof a.status=="number",x2=h2,v2=()=>Yt.toasts,g2=()=>Yt.getActiveToasts(),ze=Object.assign(x2,{success:Yt.success,info:Yt.info,warning:Yt.warning,error:Yt.error,custom:Yt.custom,message:Yt.message,promise:Yt.promise,dismiss:Yt.dismiss,loading:Yt.loading},{getHistory:v2,getToasts:g2});n2("[data-sonner-toaster][dir=ltr],html[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%)}[data-sonner-toaster][dir=rtl],html[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%)}[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:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[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);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[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 rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [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)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [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;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [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);background:var(--normal-bg);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-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[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}[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}[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,0)) translateX(var(--swipe-amount-x,0));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{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{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{from{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-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--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-sonner-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-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-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, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--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-sonner-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-sonner-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]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[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]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[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]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[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]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[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:first-child{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)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{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%)}");function Qi(a){return a.label!==void 0}const y2=3,b2="24px",S2="16px",ox=4e3,N2=356,j2=14,w2=45,E2=200;function ka(...a){return a.filter(Boolean).join(" ")}function T2(a){const[l,i]=a.split("-"),o=[];return l&&o.push(l),i&&o.push(i),o}const R2=a=>{var l,i,o,d,f,m,v,g,p;const{invert:y,toast:x,unstyled:N,interacting:A,setHeights:j,visibleToasts:E,heights:R,index:O,toasts:M,expanded:V,removeToast:U,defaultRichColors:ne,closeButton:W,style:$,cancelButtonStyle:G,actionButtonStyle:se,className:je="",descriptionClassName:he="",duration:me,position:Re,gap:Ce,expandByDefault:ee,classNames:w,icons:Q,closeButtonAriaLabel:F="Close toast"}=a,[xe,ve]=re.useState(null),[C,Y]=re.useState(null),[X,I]=re.useState(!1),[le,Z]=re.useState(!1),[ie,oe]=re.useState(!1),[B,ae]=re.useState(!1),[_e,Ae]=re.useState(!1),[va,ot]=re.useState(0),[zn,fr]=re.useState(0),Dn=re.useRef(x.duration||me||ox),hl=re.useRef(null),Zt=re.useRef(null),pl=O===0,xl=O+1<=E,_t=x.type,an=x.dismissible!==!1,Mt=x.className||"",bo=x.descriptionClassName||"",Ln=re.useMemo(()=>R.findIndex(Ne=>Ne.toastId===x.id)||0,[R,x.id]),Ts=re.useMemo(()=>{var Ne;return(Ne=x.closeButton)!=null?Ne:W},[x.closeButton,W]),Un=re.useMemo(()=>x.duration||me||ox,[x.duration,me]),vl=re.useRef(0),za=re.useRef(0),Rs=re.useRef(0),nn=re.useRef(null),[Bn,At]=Re.split("-"),ga=re.useMemo(()=>R.reduce((Ne,$e,ft)=>ft>=Ln?Ne:Ne+$e.height,0),[R,Ln]),wt=f2(),So=x.invert||y,gl=_t==="loading";za.current=re.useMemo(()=>Ln*Ce+ga,[Ln,ga]),re.useEffect(()=>{Dn.current=Un},[Un]),re.useEffect(()=>{I(!0)},[]),re.useEffect(()=>{const Ne=Zt.current;if(Ne){const $e=Ne.getBoundingClientRect().height;return fr($e),j(ft=>[{toastId:x.id,height:$e,position:x.position},...ft]),()=>j(ft=>ft.filter(Et=>Et.toastId!==x.id))}},[j,x.id]),re.useLayoutEffect(()=>{if(!X)return;const Ne=Zt.current,$e=Ne.style.height;Ne.style.height="auto";const ft=Ne.getBoundingClientRect().height;Ne.style.height=$e,fr(ft),j(Et=>Et.find(Ie=>Ie.toastId===x.id)?Et.map(Ie=>Ie.toastId===x.id?{...Ie,height:ft}:Ie):[{toastId:x.id,height:ft,position:x.position},...Et])},[X,x.title,x.description,j,x.id,x.jsx,x.action,x.cancel]);const Ta=re.useCallback(()=>{Z(!0),ot(za.current),j(Ne=>Ne.filter($e=>$e.toastId!==x.id)),setTimeout(()=>{U(x)},E2)},[x,U,j,za]);re.useEffect(()=>{if(x.promise&&_t==="loading"||x.duration===1/0||x.type==="loading")return;let Ne;return V||A||wt?(()=>{if(Rs.current<vl.current){const Et=new Date().getTime()-vl.current;Dn.current=Dn.current-Et}Rs.current=new Date().getTime()})():Dn.current!==1/0&&(vl.current=new Date().getTime(),Ne=setTimeout(()=>{x.onAutoClose==null||x.onAutoClose.call(x,x),Ta()},Dn.current)),()=>clearTimeout(Ne)},[V,A,x,_t,wt,Ta]),re.useEffect(()=>{x.delete&&(Ta(),x.onDismiss==null||x.onDismiss.call(x,x))},[Ta,x.delete]);function mr(){var Ne;if(Q?.loading){var $e;return re.createElement("div",{className:ka(w?.loader,x==null||($e=x.classNames)==null?void 0:$e.loader,"sonner-loader"),"data-visible":_t==="loading"},Q.loading)}return re.createElement(s2,{className:ka(w?.loader,x==null||(Ne=x.classNames)==null?void 0:Ne.loader),visible:_t==="loading"})}const hr=x.icon||Q?.[_t]||r2(_t);var qn,Ra;return re.createElement("li",{tabIndex:0,ref:Zt,className:ka(je,Mt,w?.toast,x==null||(l=x.classNames)==null?void 0:l.toast,w?.default,w?.[_t],x==null||(i=x.classNames)==null?void 0:i[_t]),"data-sonner-toast":"","data-rich-colors":(qn=x.richColors)!=null?qn:ne,"data-styled":!(x.jsx||x.unstyled||N),"data-mounted":X,"data-promise":!!x.promise,"data-swiped":_e,"data-removed":le,"data-visible":xl,"data-y-position":Bn,"data-x-position":At,"data-index":O,"data-front":pl,"data-swiping":ie,"data-dismissible":an,"data-type":_t,"data-invert":So,"data-swipe-out":B,"data-swipe-direction":C,"data-expanded":!!(V||ee&&X),"data-testid":x.testId,style:{"--index":O,"--toasts-before":O,"--z-index":M.length-O,"--offset":`${le?va:za.current}px`,"--initial-height":ee?"auto":`${zn}px`,...$,...x.style},onDragEnd:()=>{oe(!1),ve(null),nn.current=null},onPointerDown:Ne=>{Ne.button!==2&&(gl||!an||(hl.current=new Date,ot(za.current),Ne.target.setPointerCapture(Ne.pointerId),Ne.target.tagName!=="BUTTON"&&(oe(!0),nn.current={x:Ne.clientX,y:Ne.clientY})))},onPointerUp:()=>{var Ne,$e,ft;if(B||!an)return;nn.current=null;const Et=Number(((Ne=Zt.current)==null?void 0:Ne.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),rn=Number((($e=Zt.current)==null?void 0:$e.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ie=new Date().getTime()-((ft=hl.current)==null?void 0:ft.getTime()),Dt=xe==="x"?Et:rn,Hn=Math.abs(Dt)/Ie;if(Math.abs(Dt)>=w2||Hn>.11){ot(za.current),x.onDismiss==null||x.onDismiss.call(x,x),Y(xe==="x"?Et>0?"right":"left":rn>0?"down":"up"),Ta(),ae(!0);return}else{var Lt,Ut;(Lt=Zt.current)==null||Lt.style.setProperty("--swipe-amount-x","0px"),(Ut=Zt.current)==null||Ut.style.setProperty("--swipe-amount-y","0px")}Ae(!1),oe(!1),ve(null)},onPointerMove:Ne=>{var $e,ft,Et;if(!nn.current||!an||(($e=window.getSelection())==null?void 0:$e.toString().length)>0)return;const Ie=Ne.clientY-nn.current.y,Dt=Ne.clientX-nn.current.x;var Hn;const Lt=(Hn=a.swipeDirections)!=null?Hn:T2(Re);!xe&&(Math.abs(Dt)>1||Math.abs(Ie)>1)&&ve(Math.abs(Dt)>Math.abs(Ie)?"x":"y");let Ut={x:0,y:0};const pr=ya=>1/(1.5+Math.abs(ya)/20);if(xe==="y"){if(Lt.includes("top")||Lt.includes("bottom"))if(Lt.includes("top")&&Ie<0||Lt.includes("bottom")&&Ie>0)Ut.y=Ie;else{const ya=Ie*pr(Ie);Ut.y=Math.abs(ya)<Math.abs(Ie)?ya:Ie}}else if(xe==="x"&&(Lt.includes("left")||Lt.includes("right")))if(Lt.includes("left")&&Dt<0||Lt.includes("right")&&Dt>0)Ut.x=Dt;else{const ya=Dt*pr(Dt);Ut.x=Math.abs(ya)<Math.abs(Dt)?ya:Dt}(Math.abs(Ut.x)>0||Math.abs(Ut.y)>0)&&Ae(!0),(ft=Zt.current)==null||ft.style.setProperty("--swipe-amount-x",`${Ut.x}px`),(Et=Zt.current)==null||Et.style.setProperty("--swipe-amount-y",`${Ut.y}px`)}},Ts&&!x.jsx&&_t!=="loading"?re.createElement("button",{"aria-label":F,"data-disabled":gl,"data-close-button":!0,onClick:gl||!an?()=>{}:()=>{Ta(),x.onDismiss==null||x.onDismiss.call(x,x)},className:ka(w?.closeButton,x==null||(o=x.classNames)==null?void 0:o.closeButton)},(Ra=Q?.close)!=null?Ra:d2):null,(_t||x.icon||x.promise)&&x.icon!==null&&(Q?.[_t]!==null||x.icon)?re.createElement("div",{"data-icon":"",className:ka(w?.icon,x==null||(d=x.classNames)==null?void 0:d.icon)},x.promise||x.type==="loading"&&!x.icon?x.icon||mr():null,x.type!=="loading"?hr:null):null,re.createElement("div",{"data-content":"",className:ka(w?.content,x==null||(f=x.classNames)==null?void 0:f.content)},re.createElement("div",{"data-title":"",className:ka(w?.title,x==null||(m=x.classNames)==null?void 0:m.title)},x.jsx?x.jsx:typeof x.title=="function"?x.title():x.title),x.description?re.createElement("div",{"data-description":"",className:ka(he,bo,w?.description,x==null||(v=x.classNames)==null?void 0:v.description)},typeof x.description=="function"?x.description():x.description):null),re.isValidElement(x.cancel)?x.cancel:x.cancel&&Qi(x.cancel)?re.createElement("button",{"data-button":!0,"data-cancel":!0,style:x.cancelButtonStyle||G,onClick:Ne=>{Qi(x.cancel)&&an&&(x.cancel.onClick==null||x.cancel.onClick.call(x.cancel,Ne),Ta())},className:ka(w?.cancelButton,x==null||(g=x.classNames)==null?void 0:g.cancelButton)},x.cancel.label):null,re.isValidElement(x.action)?x.action:x.action&&Qi(x.action)?re.createElement("button",{"data-button":!0,"data-action":!0,style:x.actionButtonStyle||se,onClick:Ne=>{Qi(x.action)&&(x.action.onClick==null||x.action.onClick.call(x.action,Ne),!Ne.defaultPrevented&&Ta())},className:ka(w?.actionButton,x==null||(p=x.classNames)==null?void 0:p.actionButton)},x.action.label):null)};function cx(){if(typeof window>"u"||typeof document>"u")return"ltr";const a=document.documentElement.getAttribute("dir");return a==="auto"||!a?window.getComputedStyle(document.documentElement).direction:a}function C2(a,l){const i={};return[a,l].forEach((o,d)=>{const f=d===1,m=f?"--mobile-offset":"--offset",v=f?S2:b2;function g(p){["top","right","bottom","left"].forEach(y=>{i[`${m}-${y}`]=typeof p=="number"?`${p}px`:p})}typeof o=="number"||typeof o=="string"?g(o):typeof o=="object"?["top","right","bottom","left"].forEach(p=>{o[p]===void 0?i[`${m}-${p}`]=v:i[`${m}-${p}`]=typeof o[p]=="number"?`${o[p]}px`:o[p]}):g(v)}),i}const _2=re.forwardRef(function(l,i){const{id:o,invert:d,position:f="bottom-right",hotkey:m=["altKey","KeyT"],expand:v,closeButton:g,className:p,offset:y,mobileOffset:x,theme:N="light",richColors:A,duration:j,style:E,visibleToasts:R=y2,toastOptions:O,dir:M=cx(),gap:V=j2,icons:U,containerAriaLabel:ne="Notifications"}=l,[W,$]=re.useState([]),G=re.useMemo(()=>o?W.filter(X=>X.toasterId===o):W.filter(X=>!X.toasterId),[W,o]),se=re.useMemo(()=>Array.from(new Set([f].concat(G.filter(X=>X.position).map(X=>X.position)))),[G,f]),[je,he]=re.useState([]),[me,Re]=re.useState(!1),[Ce,ee]=re.useState(!1),[w,Q]=re.useState(N!=="system"?N:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),F=re.useRef(null),xe=m.join("+").replace(/Key/g,"").replace(/Digit/g,""),ve=re.useRef(null),C=re.useRef(!1),Y=re.useCallback(X=>{$(I=>{var le;return(le=I.find(Z=>Z.id===X.id))!=null&&le.delete||Yt.dismiss(X.id),I.filter(({id:Z})=>Z!==X.id)})},[]);return re.useEffect(()=>Yt.subscribe(X=>{if(X.dismiss){requestAnimationFrame(()=>{$(I=>I.map(le=>le.id===X.id?{...le,delete:!0}:le))});return}setTimeout(()=>{b1.flushSync(()=>{$(I=>{const le=I.findIndex(Z=>Z.id===X.id);return le!==-1?[...I.slice(0,le),{...I[le],...X},...I.slice(le+1)]:[X,...I]})})})}),[W]),re.useEffect(()=>{if(N!=="system"){Q(N);return}if(N==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Q("dark"):Q("light")),typeof window>"u")return;const X=window.matchMedia("(prefers-color-scheme: dark)");try{X.addEventListener("change",({matches:I})=>{Q(I?"dark":"light")})}catch{X.addListener(({matches:le})=>{try{Q(le?"dark":"light")}catch(Z){console.error(Z)}})}},[N]),re.useEffect(()=>{W.length<=1&&Re(!1)},[W]),re.useEffect(()=>{const X=I=>{var le;if(m.every(oe=>I[oe]||I.code===oe)){var ie;Re(!0),(ie=F.current)==null||ie.focus()}I.code==="Escape"&&(document.activeElement===F.current||(le=F.current)!=null&&le.contains(document.activeElement))&&Re(!1)};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[m]),re.useEffect(()=>{if(F.current)return()=>{ve.current&&(ve.current.focus({preventScroll:!0}),ve.current=null,C.current=!1)}},[F.current]),re.createElement("section",{ref:i,"aria-label":`${ne} ${xe}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},se.map((X,I)=>{var le;const[Z,ie]=X.split("-");return G.length?re.createElement("ol",{key:X,dir:M==="auto"?cx():M,tabIndex:-1,ref:F,className:p,"data-sonner-toaster":!0,"data-sonner-theme":w,"data-y-position":Z,"data-x-position":ie,style:{"--front-toast-height":`${((le=je[0])==null?void 0:le.height)||0}px`,"--width":`${N2}px`,"--gap":`${V}px`,...E,...C2(y,x)},onBlur:oe=>{C.current&&!oe.currentTarget.contains(oe.relatedTarget)&&(C.current=!1,ve.current&&(ve.current.focus({preventScroll:!0}),ve.current=null))},onFocus:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||C.current||(C.current=!0,ve.current=oe.relatedTarget)},onMouseEnter:()=>Re(!0),onMouseMove:()=>Re(!0),onMouseLeave:()=>{Ce||Re(!1)},onDragEnd:()=>Re(!1),onPointerDown:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||ee(!0)},onPointerUp:()=>ee(!1)},G.filter(oe=>!oe.position&&I===0||oe.position===X).map((oe,B)=>{var ae,_e;return re.createElement(R2,{key:oe.id,icons:U,index:B,toast:oe,defaultRichColors:A,duration:(ae=O?.duration)!=null?ae:j,className:O?.className,descriptionClassName:O?.descriptionClassName,invert:d,visibleToasts:R,closeButton:(_e=O?.closeButton)!=null?_e:g,interacting:Ce,position:X,style:O?.style,unstyled:O?.unstyled,classNames:O?.classNames,cancelButtonStyle:O?.cancelButtonStyle,actionButtonStyle:O?.actionButtonStyle,closeButtonAriaLabel:O?.closeButtonAriaLabel,removeToast:Y,toasts:G.filter(Ae=>Ae.position==oe.position),heights:je.filter(Ae=>Ae.position==oe.position),setHeights:he,expandByDefault:v,gap:V,expanded:me,swipeDirections:l.swipeDirections})})):null}))}),gv=S.createContext(void 0),yv="jarvis-admin-theme";function M2(){const a=localStorage.getItem(yv);return a==="light"||a==="dark"?a:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function A2({children:a}){const[l,i]=S.useState(M2);S.useEffect(()=>{document.documentElement.classList.toggle("dark",l==="dark"),localStorage.setItem(yv,l)},[l]);const o=S.useCallback(()=>{i(d=>d==="dark"?"light":"dark")},[]);return s.jsx(gv.Provider,{value:{theme:l,toggleTheme:o},children:a})}function k2(){const a=S.useContext(gv);if(!a)throw new Error("useTheme must be used within ThemeProvider");return a}function bv(a,l){return function(){return a.apply(l,arguments)}}const{toString:O2}=Object.prototype,{getPrototypeOf:_d}=Object,{iterator:uo,toStringTag:Sv}=Symbol,fo=(a=>l=>{const i=O2.call(l);return a[i]||(a[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Ea=a=>(a=a.toLowerCase(),l=>fo(l)===a),mo=a=>l=>typeof l===a,{isArray:dl}=Array,ll=mo("undefined");function Ss(a){return a!==null&&!ll(a)&&a.constructor!==null&&!ll(a.constructor)&&Xt(a.constructor.isBuffer)&&a.constructor.isBuffer(a)}const Nv=Ea("ArrayBuffer");function z2(a){let l;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?l=ArrayBuffer.isView(a):l=a&&a.buffer&&Nv(a.buffer),l}const D2=mo("string"),Xt=mo("function"),jv=mo("number"),Ns=a=>a!==null&&typeof a=="object",L2=a=>a===!0||a===!1,Pi=a=>{if(fo(a)!=="object")return!1;const l=_d(a);return(l===null||l===Object.prototype||Object.getPrototypeOf(l)===null)&&!(Sv in a)&&!(uo in a)},U2=a=>{if(!Ns(a)||Ss(a))return!1;try{return Object.keys(a).length===0&&Object.getPrototypeOf(a)===Object.prototype}catch{return!1}},B2=Ea("Date"),q2=Ea("File"),H2=Ea("Blob"),G2=Ea("FileList"),Q2=a=>Ns(a)&&Xt(a.pipe),V2=a=>{let l;return a&&(typeof FormData=="function"&&a instanceof FormData||Xt(a.append)&&((l=fo(a))==="formdata"||l==="object"&&Xt(a.toString)&&a.toString()==="[object FormData]"))},F2=Ea("URLSearchParams"),[Y2,X2,K2,Z2]=["ReadableStream","Request","Response","Headers"].map(Ea),$2=a=>a.trim?a.trim():a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function js(a,l,{allOwnKeys:i=!1}={}){if(a===null||typeof a>"u")return;let o,d;if(typeof a!="object"&&(a=[a]),dl(a))for(o=0,d=a.length;o<d;o++)l.call(null,a[o],o,a);else{if(Ss(a))return;const f=i?Object.getOwnPropertyNames(a):Object.keys(a),m=f.length;let v;for(o=0;o<m;o++)v=f[o],l.call(null,a[v],v,a)}}function wv(a,l){if(Ss(a))return null;l=l.toLowerCase();const i=Object.keys(a);let o=i.length,d;for(;o-- >0;)if(d=i[o],l===d.toLowerCase())return d;return null}const sr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ev=a=>!ll(a)&&a!==sr;function od(){const{caseless:a,skipUndefined:l}=Ev(this)&&this||{},i={},o=(d,f)=>{const m=a&&wv(i,f)||f;Pi(i[m])&&Pi(d)?i[m]=od(i[m],d):Pi(d)?i[m]=od({},d):dl(d)?i[m]=d.slice():(!l||!ll(d))&&(i[m]=d)};for(let d=0,f=arguments.length;d<f;d++)arguments[d]&&js(arguments[d],o);return i}const J2=(a,l,i,{allOwnKeys:o}={})=>(js(l,(d,f)=>{i&&Xt(d)?Object.defineProperty(a,f,{value:bv(d,i),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(a,f,{value:d,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:o}),a),P2=a=>(a.charCodeAt(0)===65279&&(a=a.slice(1)),a),I2=(a,l,i,o)=>{a.prototype=Object.create(l.prototype,o),Object.defineProperty(a.prototype,"constructor",{value:a,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(a,"super",{value:l.prototype}),i&&Object.assign(a.prototype,i)},W2=(a,l,i,o)=>{let d,f,m;const v={};if(l=l||{},a==null)return l;do{for(d=Object.getOwnPropertyNames(a),f=d.length;f-- >0;)m=d[f],(!o||o(m,a,l))&&!v[m]&&(l[m]=a[m],v[m]=!0);a=i!==!1&&_d(a)}while(a&&(!i||i(a,l))&&a!==Object.prototype);return l},eS=(a,l,i)=>{a=String(a),(i===void 0||i>a.length)&&(i=a.length),i-=l.length;const o=a.indexOf(l,i);return o!==-1&&o===i},tS=a=>{if(!a)return null;if(dl(a))return a;let l=a.length;if(!jv(l))return null;const i=new Array(l);for(;l-- >0;)i[l]=a[l];return i},aS=(a=>l=>a&&l instanceof a)(typeof Uint8Array<"u"&&_d(Uint8Array)),nS=(a,l)=>{const o=(a&&a[uo]).call(a);let d;for(;(d=o.next())&&!d.done;){const f=d.value;l.call(a,f[0],f[1])}},rS=(a,l)=>{let i;const o=[];for(;(i=a.exec(l))!==null;)o.push(i);return o},lS=Ea("HTMLFormElement"),sS=a=>a.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(i,o,d){return o.toUpperCase()+d}),ux=(({hasOwnProperty:a})=>(l,i)=>a.call(l,i))(Object.prototype),iS=Ea("RegExp"),Tv=(a,l)=>{const i=Object.getOwnPropertyDescriptors(a),o={};js(i,(d,f)=>{let m;(m=l(d,f,a))!==!1&&(o[f]=m||d)}),Object.defineProperties(a,o)},oS=a=>{Tv(a,(l,i)=>{if(Xt(a)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const o=a[i];if(Xt(o)){if(l.enumerable=!1,"writable"in l){l.writable=!1;return}l.set||(l.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},cS=(a,l)=>{const i={},o=d=>{d.forEach(f=>{i[f]=!0})};return dl(a)?o(a):o(String(a).split(l)),i},uS=()=>{},dS=(a,l)=>a!=null&&Number.isFinite(a=+a)?a:l;function fS(a){return!!(a&&Xt(a.append)&&a[Sv]==="FormData"&&a[uo])}const mS=a=>{const l=new Array(10),i=(o,d)=>{if(Ns(o)){if(l.indexOf(o)>=0)return;if(Ss(o))return o;if(!("toJSON"in o)){l[d]=o;const f=dl(o)?[]:{};return js(o,(m,v)=>{const g=i(m,d+1);!ll(g)&&(f[v]=g)}),l[d]=void 0,f}}return o};return i(a,0)},hS=Ea("AsyncFunction"),pS=a=>a&&(Ns(a)||Xt(a))&&Xt(a.then)&&Xt(a.catch),Rv=((a,l)=>a?setImmediate:l?((i,o)=>(sr.addEventListener("message",({source:d,data:f})=>{d===sr&&f===i&&o.length&&o.shift()()},!1),d=>{o.push(d),sr.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",Xt(sr.postMessage)),xS=typeof queueMicrotask<"u"?queueMicrotask.bind(sr):typeof process<"u"&&process.nextTick||Rv,vS=a=>a!=null&&Xt(a[uo]),H={isArray:dl,isArrayBuffer:Nv,isBuffer:Ss,isFormData:V2,isArrayBufferView:z2,isString:D2,isNumber:jv,isBoolean:L2,isObject:Ns,isPlainObject:Pi,isEmptyObject:U2,isReadableStream:Y2,isRequest:X2,isResponse:K2,isHeaders:Z2,isUndefined:ll,isDate:B2,isFile:q2,isBlob:H2,isRegExp:iS,isFunction:Xt,isStream:Q2,isURLSearchParams:F2,isTypedArray:aS,isFileList:G2,forEach:js,merge:od,extend:J2,trim:$2,stripBOM:P2,inherits:I2,toFlatObject:W2,kindOf:fo,kindOfTest:Ea,endsWith:eS,toArray:tS,forEachEntry:nS,matchAll:rS,isHTMLForm:lS,hasOwnProperty:ux,hasOwnProp:ux,reduceDescriptors:Tv,freezeMethods:oS,toObjectSet:cS,toCamelCase:sS,noop:uS,toFiniteNumber:dS,findKey:wv,global:sr,isContextDefined:Ev,isSpecCompliantForm:fS,toJSONObject:mS,isAsyncFn:hS,isThenable:pS,setImmediate:Rv,asap:xS,isIterable:vS};let be=class Cv extends Error{static from(l,i,o,d,f,m){const v=new Cv(l.message,i||l.code,o,d,f);return v.cause=l,v.name=l.name,m&&Object.assign(v,m),v}constructor(l,i,o,d,f){super(l),this.name="AxiosError",this.isAxiosError=!0,i&&(this.code=i),o&&(this.config=o),d&&(this.request=d),f&&(this.response=f,this.status=f.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:H.toJSONObject(this.config),code:this.code,status:this.status}}};be.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";be.ERR_BAD_OPTION="ERR_BAD_OPTION";be.ECONNABORTED="ECONNABORTED";be.ETIMEDOUT="ETIMEDOUT";be.ERR_NETWORK="ERR_NETWORK";be.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";be.ERR_DEPRECATED="ERR_DEPRECATED";be.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";be.ERR_BAD_REQUEST="ERR_BAD_REQUEST";be.ERR_CANCELED="ERR_CANCELED";be.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";be.ERR_INVALID_URL="ERR_INVALID_URL";const gS=null;function cd(a){return H.isPlainObject(a)||H.isArray(a)}function _v(a){return H.endsWith(a,"[]")?a.slice(0,-2):a}function dx(a,l,i){return a?a.concat(l).map(function(d,f){return d=_v(d),!i&&f?"["+d+"]":d}).join(i?".":""):l}function yS(a){return H.isArray(a)&&!a.some(cd)}const bS=H.toFlatObject(H,{},null,function(l){return/^is[A-Z]/.test(l)});function ho(a,l,i){if(!H.isObject(a))throw new TypeError("target must be an object");l=l||new FormData,i=H.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(E,R){return!H.isUndefined(R[E])});const o=i.metaTokens,d=i.visitor||y,f=i.dots,m=i.indexes,g=(i.Blob||typeof Blob<"u"&&Blob)&&H.isSpecCompliantForm(l);if(!H.isFunction(d))throw new TypeError("visitor must be a function");function p(j){if(j===null)return"";if(H.isDate(j))return j.toISOString();if(H.isBoolean(j))return j.toString();if(!g&&H.isBlob(j))throw new be("Blob is not supported. Use a Buffer instead.");return H.isArrayBuffer(j)||H.isTypedArray(j)?g&&typeof Blob=="function"?new Blob([j]):Buffer.from(j):j}function y(j,E,R){let O=j;if(j&&!R&&typeof j=="object"){if(H.endsWith(E,"{}"))E=o?E:E.slice(0,-2),j=JSON.stringify(j);else if(H.isArray(j)&&yS(j)||(H.isFileList(j)||H.endsWith(E,"[]"))&&(O=H.toArray(j)))return E=_v(E),O.forEach(function(V,U){!(H.isUndefined(V)||V===null)&&l.append(m===!0?dx([E],U,f):m===null?E:E+"[]",p(V))}),!1}return cd(j)?!0:(l.append(dx(R,E,f),p(j)),!1)}const x=[],N=Object.assign(bS,{defaultVisitor:y,convertValue:p,isVisitable:cd});function A(j,E){if(!H.isUndefined(j)){if(x.indexOf(j)!==-1)throw Error("Circular reference detected in "+E.join("."));x.push(j),H.forEach(j,function(O,M){(!(H.isUndefined(O)||O===null)&&d.call(l,O,H.isString(M)?M.trim():M,E,N))===!0&&A(O,E?E.concat(M):[M])}),x.pop()}}if(!H.isObject(a))throw new TypeError("data must be an object");return A(a),l}function fx(a){const l={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(a).replace(/[!'()~]|%20|%00/g,function(o){return l[o]})}function Md(a,l){this._pairs=[],a&&ho(a,this,l)}const Mv=Md.prototype;Mv.append=function(l,i){this._pairs.push([l,i])};Mv.toString=function(l){const i=l?function(o){return l.call(this,o,fx)}:fx;return this._pairs.map(function(d){return i(d[0])+"="+i(d[1])},"").join("&")};function SS(a){return encodeURIComponent(a).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Av(a,l,i){if(!l)return a;const o=i&&i.encode||SS,d=H.isFunction(i)?{serialize:i}:i,f=d&&d.serialize;let m;if(f?m=f(l,d):m=H.isURLSearchParams(l)?l.toString():new Md(l,d).toString(o),m){const v=a.indexOf("#");v!==-1&&(a=a.slice(0,v)),a+=(a.indexOf("?")===-1?"?":"&")+m}return a}class mx{constructor(){this.handlers=[]}use(l,i,o){return this.handlers.push({fulfilled:l,rejected:i,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(l){this.handlers[l]&&(this.handlers[l]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(l){H.forEach(this.handlers,function(o){o!==null&&l(o)})}}const kv={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},NS=typeof URLSearchParams<"u"?URLSearchParams:Md,jS=typeof FormData<"u"?FormData:null,wS=typeof Blob<"u"?Blob:null,ES={isBrowser:!0,classes:{URLSearchParams:NS,FormData:jS,Blob:wS},protocols:["http","https","file","blob","url","data"]},Ad=typeof window<"u"&&typeof document<"u",ud=typeof navigator=="object"&&navigator||void 0,TS=Ad&&(!ud||["ReactNative","NativeScript","NS"].indexOf(ud.product)<0),RS=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",CS=Ad&&window.location.href||"http://localhost",_S=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ad,hasStandardBrowserEnv:TS,hasStandardBrowserWebWorkerEnv:RS,navigator:ud,origin:CS},Symbol.toStringTag,{value:"Module"})),Rt={..._S,...ES};function MS(a,l){return ho(a,new Rt.classes.URLSearchParams,{visitor:function(i,o,d,f){return Rt.isNode&&H.isBuffer(i)?(this.append(o,i.toString("base64")),!1):f.defaultVisitor.apply(this,arguments)},...l})}function AS(a){return H.matchAll(/\w+|\[(\w*)]/g,a).map(l=>l[0]==="[]"?"":l[1]||l[0])}function kS(a){const l={},i=Object.keys(a);let o;const d=i.length;let f;for(o=0;o<d;o++)f=i[o],l[f]=a[f];return l}function Ov(a){function l(i,o,d,f){let m=i[f++];if(m==="__proto__")return!0;const v=Number.isFinite(+m),g=f>=i.length;return m=!m&&H.isArray(d)?d.length:m,g?(H.hasOwnProp(d,m)?d[m]=[d[m],o]:d[m]=o,!v):((!d[m]||!H.isObject(d[m]))&&(d[m]=[]),l(i,o,d[m],f)&&H.isArray(d[m])&&(d[m]=kS(d[m])),!v)}if(H.isFormData(a)&&H.isFunction(a.entries)){const i={};return H.forEachEntry(a,(o,d)=>{l(AS(o),d,i,0)}),i}return null}function OS(a,l,i){if(H.isString(a))try{return(l||JSON.parse)(a),H.trim(a)}catch(o){if(o.name!=="SyntaxError")throw o}return(i||JSON.stringify)(a)}const ws={transitional:kv,adapter:["xhr","http","fetch"],transformRequest:[function(l,i){const o=i.getContentType()||"",d=o.indexOf("application/json")>-1,f=H.isObject(l);if(f&&H.isHTMLForm(l)&&(l=new FormData(l)),H.isFormData(l))return d?JSON.stringify(Ov(l)):l;if(H.isArrayBuffer(l)||H.isBuffer(l)||H.isStream(l)||H.isFile(l)||H.isBlob(l)||H.isReadableStream(l))return l;if(H.isArrayBufferView(l))return l.buffer;if(H.isURLSearchParams(l))return i.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),l.toString();let v;if(f){if(o.indexOf("application/x-www-form-urlencoded")>-1)return MS(l,this.formSerializer).toString();if((v=H.isFileList(l))||o.indexOf("multipart/form-data")>-1){const g=this.env&&this.env.FormData;return ho(v?{"files[]":l}:l,g&&new g,this.formSerializer)}}return f||d?(i.setContentType("application/json",!1),OS(l)):l}],transformResponse:[function(l){const i=this.transitional||ws.transitional,o=i&&i.forcedJSONParsing,d=this.responseType==="json";if(H.isResponse(l)||H.isReadableStream(l))return l;if(l&&H.isString(l)&&(o&&!this.responseType||d)){const m=!(i&&i.silentJSONParsing)&&d;try{return JSON.parse(l,this.parseReviver)}catch(v){if(m)throw v.name==="SyntaxError"?be.from(v,be.ERR_BAD_RESPONSE,this,null,this.response):v}}return l}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Rt.classes.FormData,Blob:Rt.classes.Blob},validateStatus:function(l){return l>=200&&l<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};H.forEach(["delete","get","head","post","put","patch"],a=>{ws.headers[a]={}});const zS=H.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),DS=a=>{const l={};let i,o,d;return a&&a.split(`
12
+ `).forEach(function(m){d=m.indexOf(":"),i=m.substring(0,d).trim().toLowerCase(),o=m.substring(d+1).trim(),!(!i||l[i]&&zS[i])&&(i==="set-cookie"?l[i]?l[i].push(o):l[i]=[o]:l[i]=l[i]?l[i]+", "+o:o)}),l},hx=Symbol("internals");function ds(a){return a&&String(a).trim().toLowerCase()}function Ii(a){return a===!1||a==null?a:H.isArray(a)?a.map(Ii):String(a)}function LS(a){const l=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=i.exec(a);)l[o[1]]=o[2];return l}const US=a=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(a.trim());function Gu(a,l,i,o,d){if(H.isFunction(o))return o.call(this,l,i);if(d&&(l=i),!!H.isString(l)){if(H.isString(o))return l.indexOf(o)!==-1;if(H.isRegExp(o))return o.test(l)}}function BS(a){return a.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(l,i,o)=>i.toUpperCase()+o)}function qS(a,l){const i=H.toCamelCase(" "+l);["get","set","has"].forEach(o=>{Object.defineProperty(a,o+i,{value:function(d,f,m){return this[o].call(this,l,d,f,m)},configurable:!0})})}let Kt=class{constructor(l){l&&this.set(l)}set(l,i,o){const d=this;function f(v,g,p){const y=ds(g);if(!y)throw new Error("header name must be a non-empty string");const x=H.findKey(d,y);(!x||d[x]===void 0||p===!0||p===void 0&&d[x]!==!1)&&(d[x||g]=Ii(v))}const m=(v,g)=>H.forEach(v,(p,y)=>f(p,y,g));if(H.isPlainObject(l)||l instanceof this.constructor)m(l,i);else if(H.isString(l)&&(l=l.trim())&&!US(l))m(DS(l),i);else if(H.isObject(l)&&H.isIterable(l)){let v={},g,p;for(const y of l){if(!H.isArray(y))throw TypeError("Object iterator must return a key-value pair");v[p=y[0]]=(g=v[p])?H.isArray(g)?[...g,y[1]]:[g,y[1]]:y[1]}m(v,i)}else l!=null&&f(i,l,o);return this}get(l,i){if(l=ds(l),l){const o=H.findKey(this,l);if(o){const d=this[o];if(!i)return d;if(i===!0)return LS(d);if(H.isFunction(i))return i.call(this,d,o);if(H.isRegExp(i))return i.exec(d);throw new TypeError("parser must be boolean|regexp|function")}}}has(l,i){if(l=ds(l),l){const o=H.findKey(this,l);return!!(o&&this[o]!==void 0&&(!i||Gu(this,this[o],o,i)))}return!1}delete(l,i){const o=this;let d=!1;function f(m){if(m=ds(m),m){const v=H.findKey(o,m);v&&(!i||Gu(o,o[v],v,i))&&(delete o[v],d=!0)}}return H.isArray(l)?l.forEach(f):f(l),d}clear(l){const i=Object.keys(this);let o=i.length,d=!1;for(;o--;){const f=i[o];(!l||Gu(this,this[f],f,l,!0))&&(delete this[f],d=!0)}return d}normalize(l){const i=this,o={};return H.forEach(this,(d,f)=>{const m=H.findKey(o,f);if(m){i[m]=Ii(d),delete i[f];return}const v=l?BS(f):String(f).trim();v!==f&&delete i[f],i[v]=Ii(d),o[v]=!0}),this}concat(...l){return this.constructor.concat(this,...l)}toJSON(l){const i=Object.create(null);return H.forEach(this,(o,d)=>{o!=null&&o!==!1&&(i[d]=l&&H.isArray(o)?o.join(", "):o)}),i}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([l,i])=>l+": "+i).join(`
13
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(l){return l instanceof this?l:new this(l)}static concat(l,...i){const o=new this(l);return i.forEach(d=>o.set(d)),o}static accessor(l){const o=(this[hx]=this[hx]={accessors:{}}).accessors,d=this.prototype;function f(m){const v=ds(m);o[v]||(qS(d,m),o[v]=!0)}return H.isArray(l)?l.forEach(f):f(l),this}};Kt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);H.reduceDescriptors(Kt.prototype,({value:a},l)=>{let i=l[0].toUpperCase()+l.slice(1);return{get:()=>a,set(o){this[i]=o}}});H.freezeMethods(Kt);function Qu(a,l){const i=this||ws,o=l||i,d=Kt.from(o.headers);let f=o.data;return H.forEach(a,function(v){f=v.call(i,f,d.normalize(),l?l.status:void 0)}),d.normalize(),f}function zv(a){return!!(a&&a.__CANCEL__)}let Es=class extends be{constructor(l,i,o){super(l??"canceled",be.ERR_CANCELED,i,o),this.name="CanceledError",this.__CANCEL__=!0}};function Dv(a,l,i){const o=i.config.validateStatus;!i.status||!o||o(i.status)?a(i):l(new be("Request failed with status code "+i.status,[be.ERR_BAD_REQUEST,be.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function HS(a){const l=/^([-+\w]{1,25})(:?\/\/|:)/.exec(a);return l&&l[1]||""}function GS(a,l){a=a||10;const i=new Array(a),o=new Array(a);let d=0,f=0,m;return l=l!==void 0?l:1e3,function(g){const p=Date.now(),y=o[f];m||(m=p),i[d]=g,o[d]=p;let x=f,N=0;for(;x!==d;)N+=i[x++],x=x%a;if(d=(d+1)%a,d===f&&(f=(f+1)%a),p-m<l)return;const A=y&&p-y;return A?Math.round(N*1e3/A):void 0}}function QS(a,l){let i=0,o=1e3/l,d,f;const m=(p,y=Date.now())=>{i=y,d=null,f&&(clearTimeout(f),f=null),a(...p)};return[(...p)=>{const y=Date.now(),x=y-i;x>=o?m(p,y):(d=p,f||(f=setTimeout(()=>{f=null,m(d)},o-x)))},()=>d&&m(d)]}const lo=(a,l,i=3)=>{let o=0;const d=GS(50,250);return QS(f=>{const m=f.loaded,v=f.lengthComputable?f.total:void 0,g=m-o,p=d(g),y=m<=v;o=m;const x={loaded:m,total:v,progress:v?m/v:void 0,bytes:g,rate:p||void 0,estimated:p&&v&&y?(v-m)/p:void 0,event:f,lengthComputable:v!=null,[l?"download":"upload"]:!0};a(x)},i)},px=(a,l)=>{const i=a!=null;return[o=>l[0]({lengthComputable:i,total:a,loaded:o}),l[1]]},xx=a=>(...l)=>H.asap(()=>a(...l)),VS=Rt.hasStandardBrowserEnv?((a,l)=>i=>(i=new URL(i,Rt.origin),a.protocol===i.protocol&&a.host===i.host&&(l||a.port===i.port)))(new URL(Rt.origin),Rt.navigator&&/(msie|trident)/i.test(Rt.navigator.userAgent)):()=>!0,FS=Rt.hasStandardBrowserEnv?{write(a,l,i,o,d,f,m){if(typeof document>"u")return;const v=[`${a}=${encodeURIComponent(l)}`];H.isNumber(i)&&v.push(`expires=${new Date(i).toUTCString()}`),H.isString(o)&&v.push(`path=${o}`),H.isString(d)&&v.push(`domain=${d}`),f===!0&&v.push("secure"),H.isString(m)&&v.push(`SameSite=${m}`),document.cookie=v.join("; ")},read(a){if(typeof document>"u")return null;const l=document.cookie.match(new RegExp("(?:^|; )"+a+"=([^;]*)"));return l?decodeURIComponent(l[1]):null},remove(a){this.write(a,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function YS(a){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(a)}function XS(a,l){return l?a.replace(/\/?\/$/,"")+"/"+l.replace(/^\/+/,""):a}function Lv(a,l,i){let o=!YS(l);return a&&(o||i==!1)?XS(a,l):l}const vx=a=>a instanceof Kt?{...a}:a;function ur(a,l){l=l||{};const i={};function o(p,y,x,N){return H.isPlainObject(p)&&H.isPlainObject(y)?H.merge.call({caseless:N},p,y):H.isPlainObject(y)?H.merge({},y):H.isArray(y)?y.slice():y}function d(p,y,x,N){if(H.isUndefined(y)){if(!H.isUndefined(p))return o(void 0,p,x,N)}else return o(p,y,x,N)}function f(p,y){if(!H.isUndefined(y))return o(void 0,y)}function m(p,y){if(H.isUndefined(y)){if(!H.isUndefined(p))return o(void 0,p)}else return o(void 0,y)}function v(p,y,x){if(x in l)return o(p,y);if(x in a)return o(void 0,p)}const g={url:f,method:f,data:f,baseURL:m,transformRequest:m,transformResponse:m,paramsSerializer:m,timeout:m,timeoutMessage:m,withCredentials:m,withXSRFToken:m,adapter:m,responseType:m,xsrfCookieName:m,xsrfHeaderName:m,onUploadProgress:m,onDownloadProgress:m,decompress:m,maxContentLength:m,maxBodyLength:m,beforeRedirect:m,transport:m,httpAgent:m,httpsAgent:m,cancelToken:m,socketPath:m,responseEncoding:m,validateStatus:v,headers:(p,y,x)=>d(vx(p),vx(y),x,!0)};return H.forEach(Object.keys({...a,...l}),function(y){const x=g[y]||d,N=x(a[y],l[y],y);H.isUndefined(N)&&x!==v||(i[y]=N)}),i}const Uv=a=>{const l=ur({},a);let{data:i,withXSRFToken:o,xsrfHeaderName:d,xsrfCookieName:f,headers:m,auth:v}=l;if(l.headers=m=Kt.from(m),l.url=Av(Lv(l.baseURL,l.url,l.allowAbsoluteUrls),a.params,a.paramsSerializer),v&&m.set("Authorization","Basic "+btoa((v.username||"")+":"+(v.password?unescape(encodeURIComponent(v.password)):""))),H.isFormData(i)){if(Rt.hasStandardBrowserEnv||Rt.hasStandardBrowserWebWorkerEnv)m.setContentType(void 0);else if(H.isFunction(i.getHeaders)){const g=i.getHeaders(),p=["content-type","content-length"];Object.entries(g).forEach(([y,x])=>{p.includes(y.toLowerCase())&&m.set(y,x)})}}if(Rt.hasStandardBrowserEnv&&(o&&H.isFunction(o)&&(o=o(l)),o||o!==!1&&VS(l.url))){const g=d&&f&&FS.read(f);g&&m.set(d,g)}return l},KS=typeof XMLHttpRequest<"u",ZS=KS&&function(a){return new Promise(function(i,o){const d=Uv(a);let f=d.data;const m=Kt.from(d.headers).normalize();let{responseType:v,onUploadProgress:g,onDownloadProgress:p}=d,y,x,N,A,j;function E(){A&&A(),j&&j(),d.cancelToken&&d.cancelToken.unsubscribe(y),d.signal&&d.signal.removeEventListener("abort",y)}let R=new XMLHttpRequest;R.open(d.method.toUpperCase(),d.url,!0),R.timeout=d.timeout;function O(){if(!R)return;const V=Kt.from("getAllResponseHeaders"in R&&R.getAllResponseHeaders()),ne={data:!v||v==="text"||v==="json"?R.responseText:R.response,status:R.status,statusText:R.statusText,headers:V,config:a,request:R};Dv(function($){i($),E()},function($){o($),E()},ne),R=null}"onloadend"in R?R.onloadend=O:R.onreadystatechange=function(){!R||R.readyState!==4||R.status===0&&!(R.responseURL&&R.responseURL.indexOf("file:")===0)||setTimeout(O)},R.onabort=function(){R&&(o(new be("Request aborted",be.ECONNABORTED,a,R)),R=null)},R.onerror=function(U){const ne=U&&U.message?U.message:"Network Error",W=new be(ne,be.ERR_NETWORK,a,R);W.event=U||null,o(W),R=null},R.ontimeout=function(){let U=d.timeout?"timeout of "+d.timeout+"ms exceeded":"timeout exceeded";const ne=d.transitional||kv;d.timeoutErrorMessage&&(U=d.timeoutErrorMessage),o(new be(U,ne.clarifyTimeoutError?be.ETIMEDOUT:be.ECONNABORTED,a,R)),R=null},f===void 0&&m.setContentType(null),"setRequestHeader"in R&&H.forEach(m.toJSON(),function(U,ne){R.setRequestHeader(ne,U)}),H.isUndefined(d.withCredentials)||(R.withCredentials=!!d.withCredentials),v&&v!=="json"&&(R.responseType=d.responseType),p&&([N,j]=lo(p,!0),R.addEventListener("progress",N)),g&&R.upload&&([x,A]=lo(g),R.upload.addEventListener("progress",x),R.upload.addEventListener("loadend",A)),(d.cancelToken||d.signal)&&(y=V=>{R&&(o(!V||V.type?new Es(null,a,R):V),R.abort(),R=null)},d.cancelToken&&d.cancelToken.subscribe(y),d.signal&&(d.signal.aborted?y():d.signal.addEventListener("abort",y)));const M=HS(d.url);if(M&&Rt.protocols.indexOf(M)===-1){o(new be("Unsupported protocol "+M+":",be.ERR_BAD_REQUEST,a));return}R.send(f||null)})},$S=(a,l)=>{const{length:i}=a=a?a.filter(Boolean):[];if(l||i){let o=new AbortController,d;const f=function(p){if(!d){d=!0,v();const y=p instanceof Error?p:this.reason;o.abort(y instanceof be?y:new Es(y instanceof Error?y.message:y))}};let m=l&&setTimeout(()=>{m=null,f(new be(`timeout of ${l}ms exceeded`,be.ETIMEDOUT))},l);const v=()=>{a&&(m&&clearTimeout(m),m=null,a.forEach(p=>{p.unsubscribe?p.unsubscribe(f):p.removeEventListener("abort",f)}),a=null)};a.forEach(p=>p.addEventListener("abort",f));const{signal:g}=o;return g.unsubscribe=()=>H.asap(v),g}},JS=function*(a,l){let i=a.byteLength;if(i<l){yield a;return}let o=0,d;for(;o<i;)d=o+l,yield a.slice(o,d),o=d},PS=async function*(a,l){for await(const i of IS(a))yield*JS(i,l)},IS=async function*(a){if(a[Symbol.asyncIterator]){yield*a;return}const l=a.getReader();try{for(;;){const{done:i,value:o}=await l.read();if(i)break;yield o}}finally{await l.cancel()}},gx=(a,l,i,o)=>{const d=PS(a,l);let f=0,m,v=g=>{m||(m=!0,o&&o(g))};return new ReadableStream({async pull(g){try{const{done:p,value:y}=await d.next();if(p){v(),g.close();return}let x=y.byteLength;if(i){let N=f+=x;i(N)}g.enqueue(new Uint8Array(y))}catch(p){throw v(p),p}},cancel(g){return v(g),d.return()}},{highWaterMark:2})},yx=64*1024,{isFunction:Vi}=H,WS=(({Request:a,Response:l})=>({Request:a,Response:l}))(H.global),{ReadableStream:bx,TextEncoder:Sx}=H.global,Nx=(a,...l)=>{try{return!!a(...l)}catch{return!1}},eN=a=>{a=H.merge.call({skipUndefined:!0},WS,a);const{fetch:l,Request:i,Response:o}=a,d=l?Vi(l):typeof fetch=="function",f=Vi(i),m=Vi(o);if(!d)return!1;const v=d&&Vi(bx),g=d&&(typeof Sx=="function"?(j=>E=>j.encode(E))(new Sx):async j=>new Uint8Array(await new i(j).arrayBuffer())),p=f&&v&&Nx(()=>{let j=!1;const E=new i(Rt.origin,{body:new bx,method:"POST",get duplex(){return j=!0,"half"}}).headers.has("Content-Type");return j&&!E}),y=m&&v&&Nx(()=>H.isReadableStream(new o("").body)),x={stream:y&&(j=>j.body)};d&&["text","arrayBuffer","blob","formData","stream"].forEach(j=>{!x[j]&&(x[j]=(E,R)=>{let O=E&&E[j];if(O)return O.call(E);throw new be(`Response type '${j}' is not supported`,be.ERR_NOT_SUPPORT,R)})});const N=async j=>{if(j==null)return 0;if(H.isBlob(j))return j.size;if(H.isSpecCompliantForm(j))return(await new i(Rt.origin,{method:"POST",body:j}).arrayBuffer()).byteLength;if(H.isArrayBufferView(j)||H.isArrayBuffer(j))return j.byteLength;if(H.isURLSearchParams(j)&&(j=j+""),H.isString(j))return(await g(j)).byteLength},A=async(j,E)=>{const R=H.toFiniteNumber(j.getContentLength());return R??N(E)};return async j=>{let{url:E,method:R,data:O,signal:M,cancelToken:V,timeout:U,onDownloadProgress:ne,onUploadProgress:W,responseType:$,headers:G,withCredentials:se="same-origin",fetchOptions:je}=Uv(j),he=l||fetch;$=$?($+"").toLowerCase():"text";let me=$S([M,V&&V.toAbortSignal()],U),Re=null;const Ce=me&&me.unsubscribe&&(()=>{me.unsubscribe()});let ee;try{if(W&&p&&R!=="get"&&R!=="head"&&(ee=await A(G,O))!==0){let C=new i(E,{method:"POST",body:O,duplex:"half"}),Y;if(H.isFormData(O)&&(Y=C.headers.get("content-type"))&&G.setContentType(Y),C.body){const[X,I]=px(ee,lo(xx(W)));O=gx(C.body,yx,X,I)}}H.isString(se)||(se=se?"include":"omit");const w=f&&"credentials"in i.prototype,Q={...je,signal:me,method:R.toUpperCase(),headers:G.normalize().toJSON(),body:O,duplex:"half",credentials:w?se:void 0};Re=f&&new i(E,Q);let F=await(f?he(Re,je):he(E,Q));const xe=y&&($==="stream"||$==="response");if(y&&(ne||xe&&Ce)){const C={};["status","statusText","headers"].forEach(le=>{C[le]=F[le]});const Y=H.toFiniteNumber(F.headers.get("content-length")),[X,I]=ne&&px(Y,lo(xx(ne),!0))||[];F=new o(gx(F.body,yx,X,()=>{I&&I(),Ce&&Ce()}),C)}$=$||"text";let ve=await x[H.findKey(x,$)||"text"](F,j);return!xe&&Ce&&Ce(),await new Promise((C,Y)=>{Dv(C,Y,{data:ve,headers:Kt.from(F.headers),status:F.status,statusText:F.statusText,config:j,request:Re})})}catch(w){throw Ce&&Ce(),w&&w.name==="TypeError"&&/Load failed|fetch/i.test(w.message)?Object.assign(new be("Network Error",be.ERR_NETWORK,j,Re),{cause:w.cause||w}):be.from(w,w&&w.code,j,Re)}}},tN=new Map,Bv=a=>{let l=a&&a.env||{};const{fetch:i,Request:o,Response:d}=l,f=[o,d,i];let m=f.length,v=m,g,p,y=tN;for(;v--;)g=f[v],p=y.get(g),p===void 0&&y.set(g,p=v?new Map:eN(l)),y=p;return p};Bv();const kd={http:gS,xhr:ZS,fetch:{get:Bv}};H.forEach(kd,(a,l)=>{if(a){try{Object.defineProperty(a,"name",{value:l})}catch{}Object.defineProperty(a,"adapterName",{value:l})}});const jx=a=>`- ${a}`,aN=a=>H.isFunction(a)||a===null||a===!1;function nN(a,l){a=H.isArray(a)?a:[a];const{length:i}=a;let o,d;const f={};for(let m=0;m<i;m++){o=a[m];let v;if(d=o,!aN(o)&&(d=kd[(v=String(o)).toLowerCase()],d===void 0))throw new be(`Unknown adapter '${v}'`);if(d&&(H.isFunction(d)||(d=d.get(l))))break;f[v||"#"+m]=d}if(!d){const m=Object.entries(f).map(([g,p])=>`adapter ${g} `+(p===!1?"is not supported by the environment":"is not available in the build"));let v=i?m.length>1?`since :
14
+ `+m.map(jx).join(`
15
+ `):" "+jx(m[0]):"as no adapter specified";throw new be("There is no suitable adapter to dispatch the request "+v,"ERR_NOT_SUPPORT")}return d}const qv={getAdapter:nN,adapters:kd};function Vu(a){if(a.cancelToken&&a.cancelToken.throwIfRequested(),a.signal&&a.signal.aborted)throw new Es(null,a)}function wx(a){return Vu(a),a.headers=Kt.from(a.headers),a.data=Qu.call(a,a.transformRequest),["post","put","patch"].indexOf(a.method)!==-1&&a.headers.setContentType("application/x-www-form-urlencoded",!1),qv.getAdapter(a.adapter||ws.adapter,a)(a).then(function(o){return Vu(a),o.data=Qu.call(a,a.transformResponse,o),o.headers=Kt.from(o.headers),o},function(o){return zv(o)||(Vu(a),o&&o.response&&(o.response.data=Qu.call(a,a.transformResponse,o.response),o.response.headers=Kt.from(o.response.headers))),Promise.reject(o)})}const Hv="1.13.4",po={};["object","boolean","number","function","string","symbol"].forEach((a,l)=>{po[a]=function(o){return typeof o===a||"a"+(l<1?"n ":" ")+a}});const Ex={};po.transitional=function(l,i,o){function d(f,m){return"[Axios v"+Hv+"] Transitional option '"+f+"'"+m+(o?". "+o:"")}return(f,m,v)=>{if(l===!1)throw new be(d(m," has been removed"+(i?" in "+i:"")),be.ERR_DEPRECATED);return i&&!Ex[m]&&(Ex[m]=!0,console.warn(d(m," has been deprecated since v"+i+" and will be removed in the near future"))),l?l(f,m,v):!0}};po.spelling=function(l){return(i,o)=>(console.warn(`${o} is likely a misspelling of ${l}`),!0)};function rN(a,l,i){if(typeof a!="object")throw new be("options must be an object",be.ERR_BAD_OPTION_VALUE);const o=Object.keys(a);let d=o.length;for(;d-- >0;){const f=o[d],m=l[f];if(m){const v=a[f],g=v===void 0||m(v,f,a);if(g!==!0)throw new be("option "+f+" must be "+g,be.ERR_BAD_OPTION_VALUE);continue}if(i!==!0)throw new be("Unknown option "+f,be.ERR_BAD_OPTION)}}const Wi={assertOptions:rN,validators:po},Oa=Wi.validators;let ir=class{constructor(l){this.defaults=l||{},this.interceptors={request:new mx,response:new mx}}async request(l,i){try{return await this._request(l,i)}catch(o){if(o instanceof Error){let d={};Error.captureStackTrace?Error.captureStackTrace(d):d=new Error;const f=d.stack?d.stack.replace(/^.+\n/,""):"";try{o.stack?f&&!String(o.stack).endsWith(f.replace(/^.+\n.+\n/,""))&&(o.stack+=`
16
+ `+f):o.stack=f}catch{}}throw o}}_request(l,i){typeof l=="string"?(i=i||{},i.url=l):i=l||{},i=ur(this.defaults,i);const{transitional:o,paramsSerializer:d,headers:f}=i;o!==void 0&&Wi.assertOptions(o,{silentJSONParsing:Oa.transitional(Oa.boolean),forcedJSONParsing:Oa.transitional(Oa.boolean),clarifyTimeoutError:Oa.transitional(Oa.boolean)},!1),d!=null&&(H.isFunction(d)?i.paramsSerializer={serialize:d}:Wi.assertOptions(d,{encode:Oa.function,serialize:Oa.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),Wi.assertOptions(i,{baseUrl:Oa.spelling("baseURL"),withXsrfToken:Oa.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let m=f&&H.merge(f.common,f[i.method]);f&&H.forEach(["delete","get","head","post","put","patch","common"],j=>{delete f[j]}),i.headers=Kt.concat(m,f);const v=[];let g=!0;this.interceptors.request.forEach(function(E){typeof E.runWhen=="function"&&E.runWhen(i)===!1||(g=g&&E.synchronous,v.unshift(E.fulfilled,E.rejected))});const p=[];this.interceptors.response.forEach(function(E){p.push(E.fulfilled,E.rejected)});let y,x=0,N;if(!g){const j=[wx.bind(this),void 0];for(j.unshift(...v),j.push(...p),N=j.length,y=Promise.resolve(i);x<N;)y=y.then(j[x++],j[x++]);return y}N=v.length;let A=i;for(;x<N;){const j=v[x++],E=v[x++];try{A=j(A)}catch(R){E.call(this,R);break}}try{y=wx.call(this,A)}catch(j){return Promise.reject(j)}for(x=0,N=p.length;x<N;)y=y.then(p[x++],p[x++]);return y}getUri(l){l=ur(this.defaults,l);const i=Lv(l.baseURL,l.url,l.allowAbsoluteUrls);return Av(i,l.params,l.paramsSerializer)}};H.forEach(["delete","get","head","options"],function(l){ir.prototype[l]=function(i,o){return this.request(ur(o||{},{method:l,url:i,data:(o||{}).data}))}});H.forEach(["post","put","patch"],function(l){function i(o){return function(f,m,v){return this.request(ur(v||{},{method:l,headers:o?{"Content-Type":"multipart/form-data"}:{},url:f,data:m}))}}ir.prototype[l]=i(),ir.prototype[l+"Form"]=i(!0)});let lN=class Gv{constructor(l){if(typeof l!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(f){i=f});const o=this;this.promise.then(d=>{if(!o._listeners)return;let f=o._listeners.length;for(;f-- >0;)o._listeners[f](d);o._listeners=null}),this.promise.then=d=>{let f;const m=new Promise(v=>{o.subscribe(v),f=v}).then(d);return m.cancel=function(){o.unsubscribe(f)},m},l(function(f,m,v){o.reason||(o.reason=new Es(f,m,v),i(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(l){if(this.reason){l(this.reason);return}this._listeners?this._listeners.push(l):this._listeners=[l]}unsubscribe(l){if(!this._listeners)return;const i=this._listeners.indexOf(l);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){const l=new AbortController,i=o=>{l.abort(o)};return this.subscribe(i),l.signal.unsubscribe=()=>this.unsubscribe(i),l.signal}static source(){let l;return{token:new Gv(function(d){l=d}),cancel:l}}};function sN(a){return function(i){return a.apply(null,i)}}function iN(a){return H.isObject(a)&&a.isAxiosError===!0}const dd={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(dd).forEach(([a,l])=>{dd[l]=a});function Qv(a){const l=new ir(a),i=bv(ir.prototype.request,l);return H.extend(i,ir.prototype,l,{allOwnKeys:!0}),H.extend(i,l,null,{allOwnKeys:!0}),i.create=function(d){return Qv(ur(a,d))},i}const nt=Qv(ws);nt.Axios=ir;nt.CanceledError=Es;nt.CancelToken=lN;nt.isCancel=zv;nt.VERSION=Hv;nt.toFormData=ho;nt.AxiosError=be;nt.Cancel=nt.CanceledError;nt.all=function(l){return Promise.all(l)};nt.spread=sN;nt.isAxiosError=iN;nt.mergeConfig=ur;nt.AxiosHeaders=Kt;nt.formToJSON=a=>Ov(H.isHTMLForm(a)?new FormData(a):a);nt.getAdapter=qv.getAdapter;nt.HttpStatusCode=dd;nt.default=nt;const{Axios:L4,AxiosError:U4,CanceledError:B4,isCancel:q4,CancelToken:H4,VERSION:G4,all:Q4,Cancel:V4,isAxiosError:F4,spread:Y4,toFormData:X4,AxiosHeaders:K4,HttpStatusCode:Z4,formToJSON:$4,getAdapter:J4,mergeConfig:P4}=nt,ye=nt.create({baseURL:""});function nl(a){a?ye.defaults.headers.common.Authorization=`Bearer ${a}`:delete ye.defaults.headers.common.Authorization}let fd=null;function oN(a){fd=a}let Vv=null;function cN(a){Vv=a}ye.interceptors.request.use(a=>{if(!a.headers.Authorization){const l=localStorage.getItem("jarvis-admin:access_token")??localStorage.getItem("access_token");l&&(a.headers.Authorization=`Bearer ${l}`)}return a});ye.interceptors.response.use(a=>a,async a=>{const l=a.config;if(l.url?.startsWith("/api/auth/"))return Promise.reject(a);if(a.response?.status===401&&!l._retry&&fd){l._retry=!0;const i=await fd();if(i)return l.headers.Authorization=`Bearer ${i}`,ye(l);Vv?.()}return Promise.reject(a)});async function uN(){const{data:a}=await ye.get("/api/auth/setup-status");return a}async function Fv(a,l,i){const{data:o}=await ye.post("/api/auth/setup",{email:a,password:l,username:i});return o}async function dN(a,l){const{data:i}=await ye.post("/api/auth/login",{email:a,password:l});return i}async function fN(a){const{data:l}=await ye.post("/api/auth/refresh",{refresh_token:a});return l}const Yv=S.createContext(void 0),fs="jarvis-admin:access_token",el="jarvis-admin:refresh_token",Fi="jarvis-admin:user",mN=600*1e3;function hN({children:a}){const[l,i]=S.useState(()=>{const g=localStorage.getItem(fs),p=localStorage.getItem(el),y=localStorage.getItem(Fi);if(g&&p&&y)try{const x=JSON.parse(y);return nl(g),{user:x,accessToken:g,refreshToken:p,isAuthenticated:!0,isLoading:!1,error:null}}catch{}return{user:null,accessToken:null,refreshToken:null,isAuthenticated:!1,isLoading:!1,error:null}}),o=S.useCallback(()=>{localStorage.removeItem(fs),localStorage.removeItem(el),localStorage.removeItem(Fi),nl(null),i({user:null,accessToken:null,refreshToken:null,isAuthenticated:!1,isLoading:!1,error:null})},[]),d=S.useCallback(async()=>{const g=localStorage.getItem(el);if(!g)return null;try{const p=await fN(g),y=p.access_token,x=p.refresh_token??g;return localStorage.setItem(fs,y),localStorage.setItem(el,x),nl(y),i(N=>({...N,accessToken:y,refreshToken:x})),y}catch{return o(),null}},[o]);S.useEffect(()=>{oN(d),cN(o)},[d,o]),S.useEffect(()=>{if(!l.isAuthenticated)return;const g=setInterval(()=>{d()},mN);return()=>clearInterval(g)},[l.isAuthenticated,d]);const f=S.useCallback(async(g,p)=>{i(y=>({...y,error:null,isLoading:!0}));try{const y=await dN(g,p);if(!y.user.is_superuser){i(x=>({...x,isLoading:!1,error:"Admin access required. This account is not a superuser."}));return}localStorage.setItem(fs,y.access_token),localStorage.setItem(el,y.refresh_token),localStorage.setItem(Fi,JSON.stringify(y.user)),nl(y.access_token),i({user:y.user,accessToken:y.access_token,refreshToken:y.refresh_token,isAuthenticated:!0,isLoading:!1,error:null})}catch(y){const x=y?.response?.data?.detail??"Login failed";i(N=>({...N,isLoading:!1,error:x}))}},[]),m=S.useCallback(async(g,p,y)=>{i(x=>({...x,error:null,isLoading:!0}));try{const x=await Fv(g,p,y);localStorage.setItem(fs,x.access_token),localStorage.setItem(el,x.refresh_token),localStorage.setItem(Fi,JSON.stringify(x.user)),nl(x.access_token),i({user:x.user,accessToken:x.access_token,refreshToken:x.refresh_token,isAuthenticated:!0,isLoading:!1,error:null})}catch(x){const N=x?.response?.data?.detail??"Setup failed";i(A=>({...A,isLoading:!1,error:N}))}},[]),v=S.useMemo(()=>({state:l,login:f,setup:m,logout:o}),[l,f,m,o]);return s.jsx(Yv.Provider,{value:v,children:a})}function Od(){const a=S.useContext(Yv);if(!a)throw new Error("useAuth must be used within AuthProvider");return a}const Xv=(...a)=>a.filter((l,i,o)=>!!l&&l.trim()!==""&&o.indexOf(l)===i).join(" ").trim();const pN=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const xN=a=>a.replace(/^([A-Z])|[\s-_]+(\w)/g,(l,i,o)=>o?o.toUpperCase():i.toLowerCase());const Tx=a=>{const l=xN(a);return l.charAt(0).toUpperCase()+l.slice(1)};var vN={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"};const gN=a=>{for(const l in a)if(l.startsWith("aria-")||l==="role"||l==="title")return!0;return!1};const yN=S.forwardRef(({color:a="currentColor",size:l=24,strokeWidth:i=2,absoluteStrokeWidth:o,className:d="",children:f,iconNode:m,...v},g)=>S.createElement("svg",{ref:g,...vN,width:l,height:l,stroke:a,strokeWidth:o?Number(i)*24/Number(l):i,className:Xv("lucide",d),...!f&&!gN(v)&&{"aria-hidden":"true"},...v},[...m.map(([p,y])=>S.createElement(p,y)),...Array.isArray(f)?f:[f]]));const Se=(a,l)=>{const i=S.forwardRef(({className:o,...d},f)=>S.createElement(yN,{ref:f,iconNode:l,className:Xv(`lucide-${pN(Tx(a))}`,`lucide-${a}`,o),...d}));return i.displayName=Tx(a),i};const bN=[["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"}]],SN=Se("activity",bN);const NN=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],jN=Se("box",NN);const wN=[["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"}]],EN=Se("boxes",wN);const TN=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],md=Se("brain",TN);const RN=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],xo=Se("check",RN);const CN=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],zd=Se("chevron-down",CN);const _N=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Kv=Se("chevron-right",_N);const MN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Dd=Se("circle-alert",MN);const AN=[["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"}]],Zv=Se("circle-arrow-up",AN);const kN=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],ON=Se("circle-check-big",kN);const zN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],xt=Se("circle-check",zN);const DN=[["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"}]],ps=Se("circle-x",DN);const LN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],sl=Se("circle",LN);const UN=[["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"}]],$v=Se("copy",UN);const BN=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],kn=Se("cpu",BN);const qN=[["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"}]],HN=Se("database",qN);const GN=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],xs=Se("download",GN);const QN=[["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"}]],VN=Se("external-link",QN);const FN=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Jv=Se("file-text",FN);const YN=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]],Pv=Se("git-merge",YN);const XN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],KN=Se("globe",XN);const ZN=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],Ld=Se("hard-drive",ZN);const $N=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],JN=Se("info",$N);const PN=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],IN=Se("key",PN);const WN=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],ej=Se("layout-dashboard",WN);const tj=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aa=Se("loader-circle",tj);const aj=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Ud=Se("lock",aj);const nj=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],rj=Se("log-out",nj);const lj=[["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"}]],sj=Se("monitor",lj);const ij=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],oj=Se("moon",ij);const cj=[["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"}]],uj=Se("pencil",cj);const dj=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Iv=Se("play",dj);const fj=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],eo=Se("plus",fj);const mj=[["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"}]],Ct=Se("refresh-cw",mj);const hj=[["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"}]],vo=Se("rotate-ccw",hj);const pj=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Bd=Se("rotate-cw",pj);const xj=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],vj=Se("search",xj);const gj=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],qd=Se("server",gj);const yj=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Wv=Se("settings",yj);const bj=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Sj=Se("sparkles",bj);const Nj=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],jj=Se("square",Nj);const wj=[["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"}]],Ej=Se("sun",wj);const Tj=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],go=Se("trash-2",Tj);const Rj=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],na=Se("triangle-alert",Rj);const Cj=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Hd=Se("x",Cj);const _j=[["path",{d:"M10.513 4.856 13.12 2.17a.5.5 0 0 1 .86.46l-1.377 4.317",key:"193nxd"}],["path",{d:"M15.656 10H20a1 1 0 0 1 .78 1.63l-1.72 1.773",key:"27a7lr"}],["path",{d:"M16.273 16.273 10.88 21.83a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14H4a1 1 0 0 1-.78-1.63l4.507-4.643",key:"1e0qe9"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Mj=Se("zap-off",_j);const Aj=[["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"}]],so=Se("zap",Aj);function eg(a){var l,i,o="";if(typeof a=="string"||typeof a=="number")o+=a;else if(typeof a=="object")if(Array.isArray(a)){var d=a.length;for(l=0;l<d;l++)a[l]&&(i=eg(a[l]))&&(o&&(o+=" "),o+=i)}else for(i in a)a[i]&&(o&&(o+=" "),o+=i);return o}function kj(){for(var a,l,i=0,o="",d=arguments.length;i<d;i++)(a=arguments[i])&&(l=eg(a))&&(o&&(o+=" "),o+=l);return o}const Oj=(a,l)=>{const i=new Array(a.length+l.length);for(let o=0;o<a.length;o++)i[o]=a[o];for(let o=0;o<l.length;o++)i[a.length+o]=l[o];return i},zj=(a,l)=>({classGroupId:a,validator:l}),tg=(a=new Map,l=null,i)=>({nextPart:a,validators:l,classGroupId:i}),io="-",Rx=[],Dj="arbitrary..",Lj=a=>{const l=Bj(a),{conflictingClassGroups:i,conflictingClassGroupModifiers:o}=a;return{getClassGroupId:m=>{if(m.startsWith("[")&&m.endsWith("]"))return Uj(m);const v=m.split(io),g=v[0]===""&&v.length>1?1:0;return ag(v,g,l)},getConflictingClassGroupIds:(m,v)=>{if(v){const g=o[m],p=i[m];return g?p?Oj(p,g):g:p||Rx}return i[m]||Rx}}},ag=(a,l,i)=>{if(a.length-l===0)return i.classGroupId;const d=a[l],f=i.nextPart.get(d);if(f){const p=ag(a,l+1,f);if(p)return p}const m=i.validators;if(m===null)return;const v=l===0?a.join(io):a.slice(l).join(io),g=m.length;for(let p=0;p<g;p++){const y=m[p];if(y.validator(v))return y.classGroupId}},Uj=a=>a.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const l=a.slice(1,-1),i=l.indexOf(":"),o=l.slice(0,i);return o?Dj+o:void 0})(),Bj=a=>{const{theme:l,classGroups:i}=a;return qj(i,l)},qj=(a,l)=>{const i=tg();for(const o in a){const d=a[o];Gd(d,i,o,l)}return i},Gd=(a,l,i,o)=>{const d=a.length;for(let f=0;f<d;f++){const m=a[f];Hj(m,l,i,o)}},Hj=(a,l,i,o)=>{if(typeof a=="string"){Gj(a,l,i);return}if(typeof a=="function"){Qj(a,l,i,o);return}Vj(a,l,i,o)},Gj=(a,l,i)=>{const o=a===""?l:ng(l,a);o.classGroupId=i},Qj=(a,l,i,o)=>{if(Fj(a)){Gd(a(o),l,i,o);return}l.validators===null&&(l.validators=[]),l.validators.push(zj(i,a))},Vj=(a,l,i,o)=>{const d=Object.entries(a),f=d.length;for(let m=0;m<f;m++){const[v,g]=d[m];Gd(g,ng(l,v),i,o)}},ng=(a,l)=>{let i=a;const o=l.split(io),d=o.length;for(let f=0;f<d;f++){const m=o[f];let v=i.nextPart.get(m);v||(v=tg(),i.nextPart.set(m,v)),i=v}return i},Fj=a=>"isThemeGetter"in a&&a.isThemeGetter===!0,Yj=a=>{if(a<1)return{get:()=>{},set:()=>{}};let l=0,i=Object.create(null),o=Object.create(null);const d=(f,m)=>{i[f]=m,l++,l>a&&(l=0,o=i,i=Object.create(null))};return{get(f){let m=i[f];if(m!==void 0)return m;if((m=o[f])!==void 0)return d(f,m),m},set(f,m){f in i?i[f]=m:d(f,m)}}},hd="!",Cx=":",Xj=[],_x=(a,l,i,o,d)=>({modifiers:a,hasImportantModifier:l,baseClassName:i,maybePostfixModifierPosition:o,isExternal:d}),Kj=a=>{const{prefix:l,experimentalParseClassName:i}=a;let o=d=>{const f=[];let m=0,v=0,g=0,p;const y=d.length;for(let E=0;E<y;E++){const R=d[E];if(m===0&&v===0){if(R===Cx){f.push(d.slice(g,E)),g=E+1;continue}if(R==="/"){p=E;continue}}R==="["?m++:R==="]"?m--:R==="("?v++:R===")"&&v--}const x=f.length===0?d:d.slice(g);let N=x,A=!1;x.endsWith(hd)?(N=x.slice(0,-1),A=!0):x.startsWith(hd)&&(N=x.slice(1),A=!0);const j=p&&p>g?p-g:void 0;return _x(f,A,N,j)};if(l){const d=l+Cx,f=o;o=m=>m.startsWith(d)?f(m.slice(d.length)):_x(Xj,!1,m,void 0,!0)}if(i){const d=o;o=f=>i({className:f,parseClassName:d})}return o},Zj=a=>{const l=new Map;return a.orderSensitiveModifiers.forEach((i,o)=>{l.set(i,1e6+o)}),i=>{const o=[];let d=[];for(let f=0;f<i.length;f++){const m=i[f],v=m[0]==="[",g=l.has(m);v||g?(d.length>0&&(d.sort(),o.push(...d),d=[]),o.push(m)):d.push(m)}return d.length>0&&(d.sort(),o.push(...d)),o}},$j=a=>({cache:Yj(a.cacheSize),parseClassName:Kj(a),sortModifiers:Zj(a),...Lj(a)}),Jj=/\s+/,Pj=(a,l)=>{const{parseClassName:i,getClassGroupId:o,getConflictingClassGroupIds:d,sortModifiers:f}=l,m=[],v=a.trim().split(Jj);let g="";for(let p=v.length-1;p>=0;p-=1){const y=v[p],{isExternal:x,modifiers:N,hasImportantModifier:A,baseClassName:j,maybePostfixModifierPosition:E}=i(y);if(x){g=y+(g.length>0?" "+g:g);continue}let R=!!E,O=o(R?j.substring(0,E):j);if(!O){if(!R){g=y+(g.length>0?" "+g:g);continue}if(O=o(j),!O){g=y+(g.length>0?" "+g:g);continue}R=!1}const M=N.length===0?"":N.length===1?N[0]:f(N).join(":"),V=A?M+hd:M,U=V+O;if(m.indexOf(U)>-1)continue;m.push(U);const ne=d(O,R);for(let W=0;W<ne.length;++W){const $=ne[W];m.push(V+$)}g=y+(g.length>0?" "+g:g)}return g},Ij=(...a)=>{let l=0,i,o,d="";for(;l<a.length;)(i=a[l++])&&(o=rg(i))&&(d&&(d+=" "),d+=o);return d},rg=a=>{if(typeof a=="string")return a;let l,i="";for(let o=0;o<a.length;o++)a[o]&&(l=rg(a[o]))&&(i&&(i+=" "),i+=l);return i},Wj=(a,...l)=>{let i,o,d,f;const m=g=>{const p=l.reduce((y,x)=>x(y),a());return i=$j(p),o=i.cache.get,d=i.cache.set,f=v,v(g)},v=g=>{const p=o(g);if(p)return p;const y=Pj(g,i);return d(g,y),y};return f=m,(...g)=>f(Ij(...g))},ew=[],ut=a=>{const l=i=>i[a]||ew;return l.isThemeGetter=!0,l},lg=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,sg=/^\((?:(\w[\w-]*):)?(.+)\)$/i,tw=/^\d+\/\d+$/,aw=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,nw=/\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$/,rw=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,lw=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,sw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,tl=a=>tw.test(a),Me=a=>!!a&&!Number.isNaN(Number(a)),Mn=a=>!!a&&Number.isInteger(Number(a)),Fu=a=>a.endsWith("%")&&Me(a.slice(0,-1)),Wa=a=>aw.test(a),iw=()=>!0,ow=a=>nw.test(a)&&!rw.test(a),ig=()=>!1,cw=a=>lw.test(a),uw=a=>sw.test(a),dw=a=>!ue(a)&&!de(a),fw=a=>fl(a,ug,ig),ue=a=>lg.test(a),rr=a=>fl(a,dg,ow),Yu=a=>fl(a,vw,Me),Mx=a=>fl(a,og,ig),mw=a=>fl(a,cg,uw),Yi=a=>fl(a,fg,cw),de=a=>sg.test(a),ms=a=>ml(a,dg),hw=a=>ml(a,gw),Ax=a=>ml(a,og),pw=a=>ml(a,ug),xw=a=>ml(a,cg),Xi=a=>ml(a,fg,!0),fl=(a,l,i)=>{const o=lg.exec(a);return o?o[1]?l(o[1]):i(o[2]):!1},ml=(a,l,i=!1)=>{const o=sg.exec(a);return o?o[1]?l(o[1]):i:!1},og=a=>a==="position"||a==="percentage",cg=a=>a==="image"||a==="url",ug=a=>a==="length"||a==="size"||a==="bg-size",dg=a=>a==="length",vw=a=>a==="number",gw=a=>a==="family-name",fg=a=>a==="shadow",yw=()=>{const a=ut("color"),l=ut("font"),i=ut("text"),o=ut("font-weight"),d=ut("tracking"),f=ut("leading"),m=ut("breakpoint"),v=ut("container"),g=ut("spacing"),p=ut("radius"),y=ut("shadow"),x=ut("inset-shadow"),N=ut("text-shadow"),A=ut("drop-shadow"),j=ut("blur"),E=ut("perspective"),R=ut("aspect"),O=ut("ease"),M=ut("animate"),V=()=>["auto","avoid","all","avoid-page","page","left","right","column"],U=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],ne=()=>[...U(),de,ue],W=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto","contain","none"],G=()=>[de,ue,g],se=()=>[tl,"full","auto",...G()],je=()=>[Mn,"none","subgrid",de,ue],he=()=>["auto",{span:["full",Mn,de,ue]},Mn,de,ue],me=()=>[Mn,"auto",de,ue],Re=()=>["auto","min","max","fr",de,ue],Ce=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ee=()=>["start","end","center","stretch","center-safe","end-safe"],w=()=>["auto",...G()],Q=()=>[tl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...G()],F=()=>[a,de,ue],xe=()=>[...U(),Ax,Mx,{position:[de,ue]}],ve=()=>["no-repeat",{repeat:["","x","y","space","round"]}],C=()=>["auto","cover","contain",pw,fw,{size:[de,ue]}],Y=()=>[Fu,ms,rr],X=()=>["","none","full",p,de,ue],I=()=>["",Me,ms,rr],le=()=>["solid","dashed","dotted","double"],Z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ie=()=>[Me,Fu,Ax,Mx],oe=()=>["","none",j,de,ue],B=()=>["none",Me,de,ue],ae=()=>["none",Me,de,ue],_e=()=>[Me,de,ue],Ae=()=>[tl,"full",...G()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Wa],breakpoint:[Wa],color:[iw],container:[Wa],"drop-shadow":[Wa],ease:["in","out","in-out"],font:[dw],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Wa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Wa],shadow:[Wa],spacing:["px",Me],text:[Wa],"text-shadow":[Wa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",tl,ue,de,R]}],container:["container"],columns:[{columns:[Me,ue,de,v]}],"break-after":[{"break-after":V()}],"break-before":[{"break-before":V()}],"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"],sr:["sr-only","not-sr-only"],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:ne()}],overflow:[{overflow:W()}],"overflow-x":[{"overflow-x":W()}],"overflow-y":[{"overflow-y":W()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:se()}],"inset-x":[{"inset-x":se()}],"inset-y":[{"inset-y":se()}],start:[{start:se()}],end:[{end:se()}],top:[{top:se()}],right:[{right:se()}],bottom:[{bottom:se()}],left:[{left:se()}],visibility:["visible","invisible","collapse"],z:[{z:[Mn,"auto",de,ue]}],basis:[{basis:[tl,"full","auto",v,...G()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Me,tl,"auto","initial","none",ue]}],grow:[{grow:["",Me,de,ue]}],shrink:[{shrink:["",Me,de,ue]}],order:[{order:[Mn,"first","last","none",de,ue]}],"grid-cols":[{"grid-cols":je()}],"col-start-end":[{col:he()}],"col-start":[{"col-start":me()}],"col-end":[{"col-end":me()}],"grid-rows":[{"grid-rows":je()}],"row-start-end":[{row:he()}],"row-start":[{"row-start":me()}],"row-end":[{"row-end":me()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Re()}],"auto-rows":[{"auto-rows":Re()}],gap:[{gap:G()}],"gap-x":[{"gap-x":G()}],"gap-y":[{"gap-y":G()}],"justify-content":[{justify:[...Ce(),"normal"]}],"justify-items":[{"justify-items":[...ee(),"normal"]}],"justify-self":[{"justify-self":["auto",...ee()]}],"align-content":[{content:["normal",...Ce()]}],"align-items":[{items:[...ee(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ee(),{baseline:["","last"]}]}],"place-content":[{"place-content":Ce()}],"place-items":[{"place-items":[...ee(),"baseline"]}],"place-self":[{"place-self":["auto",...ee()]}],p:[{p:G()}],px:[{px:G()}],py:[{py:G()}],ps:[{ps:G()}],pe:[{pe:G()}],pt:[{pt:G()}],pr:[{pr:G()}],pb:[{pb:G()}],pl:[{pl:G()}],m:[{m:w()}],mx:[{mx:w()}],my:[{my:w()}],ms:[{ms:w()}],me:[{me:w()}],mt:[{mt:w()}],mr:[{mr:w()}],mb:[{mb:w()}],ml:[{ml:w()}],"space-x":[{"space-x":G()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":G()}],"space-y-reverse":["space-y-reverse"],size:[{size:Q()}],w:[{w:[v,"screen",...Q()]}],"min-w":[{"min-w":[v,"screen","none",...Q()]}],"max-w":[{"max-w":[v,"screen","none","prose",{screen:[m]},...Q()]}],h:[{h:["screen","lh",...Q()]}],"min-h":[{"min-h":["screen","lh","none",...Q()]}],"max-h":[{"max-h":["screen","lh",...Q()]}],"font-size":[{text:["base",i,ms,rr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,de,Yu]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Fu,ue]}],"font-family":[{font:[hw,ue,l]}],"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:[d,de,ue]}],"line-clamp":[{"line-clamp":[Me,"none",de,Yu]}],leading:[{leading:[f,...G()]}],"list-image":[{"list-image":["none",de,ue]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",de,ue]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:F()}],"text-color":[{text:F()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...le(),"wavy"]}],"text-decoration-thickness":[{decoration:[Me,"from-font","auto",de,rr]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[Me,"auto",de,ue]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:G()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",de,ue]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",de,ue]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:xe()}],"bg-repeat":[{bg:ve()}],"bg-size":[{bg:C()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Mn,de,ue],radial:["",de,ue],conic:[Mn,de,ue]},xw,mw]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:Y()}],"gradient-via-pos":[{via:Y()}],"gradient-to-pos":[{to:Y()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:X()}],"rounded-s":[{"rounded-s":X()}],"rounded-e":[{"rounded-e":X()}],"rounded-t":[{"rounded-t":X()}],"rounded-r":[{"rounded-r":X()}],"rounded-b":[{"rounded-b":X()}],"rounded-l":[{"rounded-l":X()}],"rounded-ss":[{"rounded-ss":X()}],"rounded-se":[{"rounded-se":X()}],"rounded-ee":[{"rounded-ee":X()}],"rounded-es":[{"rounded-es":X()}],"rounded-tl":[{"rounded-tl":X()}],"rounded-tr":[{"rounded-tr":X()}],"rounded-br":[{"rounded-br":X()}],"rounded-bl":[{"rounded-bl":X()}],"border-w":[{border:I()}],"border-w-x":[{"border-x":I()}],"border-w-y":[{"border-y":I()}],"border-w-s":[{"border-s":I()}],"border-w-e":[{"border-e":I()}],"border-w-t":[{"border-t":I()}],"border-w-r":[{"border-r":I()}],"border-w-b":[{"border-b":I()}],"border-w-l":[{"border-l":I()}],"divide-x":[{"divide-x":I()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":I()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...le(),"hidden","none"]}],"divide-style":[{divide:[...le(),"hidden","none"]}],"border-color":[{border:F()}],"border-color-x":[{"border-x":F()}],"border-color-y":[{"border-y":F()}],"border-color-s":[{"border-s":F()}],"border-color-e":[{"border-e":F()}],"border-color-t":[{"border-t":F()}],"border-color-r":[{"border-r":F()}],"border-color-b":[{"border-b":F()}],"border-color-l":[{"border-l":F()}],"divide-color":[{divide:F()}],"outline-style":[{outline:[...le(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Me,de,ue]}],"outline-w":[{outline:["",Me,ms,rr]}],"outline-color":[{outline:F()}],shadow:[{shadow:["","none",y,Xi,Yi]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":["none",x,Xi,Yi]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:I()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[Me,rr]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":I()}],"inset-ring-color":[{"inset-ring":F()}],"text-shadow":[{"text-shadow":["none",N,Xi,Yi]}],"text-shadow-color":[{"text-shadow":F()}],opacity:[{opacity:[Me,de,ue]}],"mix-blend":[{"mix-blend":[...Z(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Z()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Me]}],"mask-image-linear-from-pos":[{"mask-linear-from":ie()}],"mask-image-linear-to-pos":[{"mask-linear-to":ie()}],"mask-image-linear-from-color":[{"mask-linear-from":F()}],"mask-image-linear-to-color":[{"mask-linear-to":F()}],"mask-image-t-from-pos":[{"mask-t-from":ie()}],"mask-image-t-to-pos":[{"mask-t-to":ie()}],"mask-image-t-from-color":[{"mask-t-from":F()}],"mask-image-t-to-color":[{"mask-t-to":F()}],"mask-image-r-from-pos":[{"mask-r-from":ie()}],"mask-image-r-to-pos":[{"mask-r-to":ie()}],"mask-image-r-from-color":[{"mask-r-from":F()}],"mask-image-r-to-color":[{"mask-r-to":F()}],"mask-image-b-from-pos":[{"mask-b-from":ie()}],"mask-image-b-to-pos":[{"mask-b-to":ie()}],"mask-image-b-from-color":[{"mask-b-from":F()}],"mask-image-b-to-color":[{"mask-b-to":F()}],"mask-image-l-from-pos":[{"mask-l-from":ie()}],"mask-image-l-to-pos":[{"mask-l-to":ie()}],"mask-image-l-from-color":[{"mask-l-from":F()}],"mask-image-l-to-color":[{"mask-l-to":F()}],"mask-image-x-from-pos":[{"mask-x-from":ie()}],"mask-image-x-to-pos":[{"mask-x-to":ie()}],"mask-image-x-from-color":[{"mask-x-from":F()}],"mask-image-x-to-color":[{"mask-x-to":F()}],"mask-image-y-from-pos":[{"mask-y-from":ie()}],"mask-image-y-to-pos":[{"mask-y-to":ie()}],"mask-image-y-from-color":[{"mask-y-from":F()}],"mask-image-y-to-color":[{"mask-y-to":F()}],"mask-image-radial":[{"mask-radial":[de,ue]}],"mask-image-radial-from-pos":[{"mask-radial-from":ie()}],"mask-image-radial-to-pos":[{"mask-radial-to":ie()}],"mask-image-radial-from-color":[{"mask-radial-from":F()}],"mask-image-radial-to-color":[{"mask-radial-to":F()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":U()}],"mask-image-conic-pos":[{"mask-conic":[Me]}],"mask-image-conic-from-pos":[{"mask-conic-from":ie()}],"mask-image-conic-to-pos":[{"mask-conic-to":ie()}],"mask-image-conic-from-color":[{"mask-conic-from":F()}],"mask-image-conic-to-color":[{"mask-conic-to":F()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:xe()}],"mask-repeat":[{mask:ve()}],"mask-size":[{mask:C()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",de,ue]}],filter:[{filter:["","none",de,ue]}],blur:[{blur:oe()}],brightness:[{brightness:[Me,de,ue]}],contrast:[{contrast:[Me,de,ue]}],"drop-shadow":[{"drop-shadow":["","none",A,Xi,Yi]}],"drop-shadow-color":[{"drop-shadow":F()}],grayscale:[{grayscale:["",Me,de,ue]}],"hue-rotate":[{"hue-rotate":[Me,de,ue]}],invert:[{invert:["",Me,de,ue]}],saturate:[{saturate:[Me,de,ue]}],sepia:[{sepia:["",Me,de,ue]}],"backdrop-filter":[{"backdrop-filter":["","none",de,ue]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[Me,de,ue]}],"backdrop-contrast":[{"backdrop-contrast":[Me,de,ue]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Me,de,ue]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Me,de,ue]}],"backdrop-invert":[{"backdrop-invert":["",Me,de,ue]}],"backdrop-opacity":[{"backdrop-opacity":[Me,de,ue]}],"backdrop-saturate":[{"backdrop-saturate":[Me,de,ue]}],"backdrop-sepia":[{"backdrop-sepia":["",Me,de,ue]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":G()}],"border-spacing-x":[{"border-spacing-x":G()}],"border-spacing-y":[{"border-spacing-y":G()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",de,ue]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Me,"initial",de,ue]}],ease:[{ease:["linear","initial",O,de,ue]}],delay:[{delay:[Me,de,ue]}],animate:[{animate:["none",M,de,ue]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[E,de,ue]}],"perspective-origin":[{"perspective-origin":ne()}],rotate:[{rotate:B()}],"rotate-x":[{"rotate-x":B()}],"rotate-y":[{"rotate-y":B()}],"rotate-z":[{"rotate-z":B()}],scale:[{scale:ae()}],"scale-x":[{"scale-x":ae()}],"scale-y":[{"scale-y":ae()}],"scale-z":[{"scale-z":ae()}],"scale-3d":["scale-3d"],skew:[{skew:_e()}],"skew-x":[{"skew-x":_e()}],"skew-y":[{"skew-y":_e()}],transform:[{transform:[de,ue,"","none","gpu","cpu"]}],"transform-origin":[{origin:ne()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ae()}],"translate-x":[{"translate-x":Ae()}],"translate-y":[{"translate-y":Ae()}],"translate-z":[{"translate-z":Ae()}],"translate-none":["translate-none"],accent:[{accent:F()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:F()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],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",de,ue]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":G()}],"scroll-mx":[{"scroll-mx":G()}],"scroll-my":[{"scroll-my":G()}],"scroll-ms":[{"scroll-ms":G()}],"scroll-me":[{"scroll-me":G()}],"scroll-mt":[{"scroll-mt":G()}],"scroll-mr":[{"scroll-mr":G()}],"scroll-mb":[{"scroll-mb":G()}],"scroll-ml":[{"scroll-ml":G()}],"scroll-p":[{"scroll-p":G()}],"scroll-px":[{"scroll-px":G()}],"scroll-py":[{"scroll-py":G()}],"scroll-ps":[{"scroll-ps":G()}],"scroll-pe":[{"scroll-pe":G()}],"scroll-pt":[{"scroll-pt":G()}],"scroll-pr":[{"scroll-pr":G()}],"scroll-pb":[{"scroll-pb":G()}],"scroll-pl":[{"scroll-pl":G()}],"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",de,ue]}],fill:[{fill:["none",...F()]}],"stroke-w":[{stroke:[Me,ms,rr,Yu]}],stroke:[{stroke:["none",...F()]}],"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-x","border-w-y","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-x","border-color-y","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},bw=Wj(yw);function te(...a){return bw(kj(a))}async function Sw(){const{data:a}=await ye.get("/api/system/info");return a}function Nw(){return zt({queryKey:["system-info"],queryFn:Sw,staleTime:6e4})}function jw(a){const l=Math.floor(a/86400),i=Math.floor(a%86400/3600);if(l>0)return`${l}d ${i}h`;const o=Math.floor(a%3600/60);return i>0?`${i}h ${o}m`:`${o}m`}function ww(){const{data:a}=Nw();return a?s.jsxs("div",{className:"border-t border-[var(--color-border)] px-3 py-2 text-[10px] text-[var(--color-text-muted)]",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(kn,{size:10}),s.jsxs("span",{children:[a.cpuCount," cores"]}),s.jsx("span",{className:"mx-0.5",children:"|"}),s.jsx(Ld,{size:10}),s.jsxs("span",{children:[Math.round(a.totalMemoryMb/1024),"GB"]})]}),s.jsxs("div",{className:"mt-0.5",children:[a.hostname," · up ",jw(a.uptime)," · v",a.version]})]}):null}const Ew=[{label:"Dashboard",icon:ej,path:"/dashboard"},{label:"Settings",icon:Wv,path:"/settings"},{label:"Services",icon:qd,path:"/services"},{label:"Models",icon:jN,path:"/models"},{label:"Quick Sets",icon:so,path:"/quick-sets"},{label:"Traces",icon:SN,path:"/traces"},{label:"Nodes",icon:kn,path:"/nodes"},{label:"Native",icon:EN,path:"/native-services"}];function Tw(){return s.jsxs("aside",{className:"flex w-56 flex-col border-r border-[var(--color-border)] bg-[var(--color-surface)]",children:[s.jsx("div",{className:"flex h-14 items-center border-b border-[var(--color-border)] px-4",children:s.jsx("span",{className:"text-lg font-bold text-[var(--color-primary)]",children:"Jarvis"})}),s.jsx("nav",{className:"flex-1 space-y-1 p-2",children:Ew.map(a=>s.jsxs(sv,{to:a.path,className:({isActive:l})=>te("flex items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium transition-colors",l?"bg-[var(--color-primary)]/10 text-[var(--color-primary)]":"text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)] hover:text-[var(--color-text)]"),children:[s.jsx(a.icon,{size:18}),a.label]},a.path))}),s.jsx(ww,{})]})}function Rw(){const{state:a,logout:l}=Od(),{theme:i,toggleTheme:o}=k2();return s.jsxs("header",{className:"flex h-14 items-center justify-between border-b border-[var(--color-border)] bg-[var(--color-surface)] px-6",children:[s.jsx("h2",{className:"text-sm font-medium text-[var(--color-text-muted)]",children:"Admin Dashboard"}),s.jsxs("div",{className:"flex items-center gap-3",children:[a.user&&s.jsx("span",{className:"text-sm text-[var(--color-text-muted)]",children:a.user.email}),s.jsx("button",{onClick:o,className:"rounded-lg p-2 text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]",title:`Switch to ${i==="dark"?"light":"dark"} mode`,children:i==="dark"?s.jsx(Ej,{size:18}):s.jsx(oj,{size:18})}),s.jsx("button",{onClick:l,className:"rounded-lg p-2 text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)] hover:text-red-500",title:"Logout",children:s.jsx(rj,{size:18})})]})]})}function Cw(){const{state:a}=Od();return a.isLoading?s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--color-background)]",children:s.jsx("p",{className:"text-[var(--color-text-muted)]",children:"Loading..."})}):a.isAuthenticated?s.jsxs("div",{className:"flex h-screen bg-[var(--color-background)]",children:[s.jsx(Tw,{}),s.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[s.jsx(Rw,{}),s.jsx("main",{className:"flex-1 overflow-y-auto p-6",children:s.jsx(B0,{})})]})]}):s.jsx(ao,{to:"/login",replace:!0})}function _w(){const{state:a,login:l,setup:i}=Od(),o=wa(),[d,f]=S.useState("loading"),[m,v]=S.useState(""),[g,p]=S.useState(""),[y,x]=S.useState(""),[N,A]=S.useState(""),[j,E]=S.useState(null);if(S.useEffect(()=>{let U=!1;async function ne(){try{const{data:W}=await ye.get("/api/setup/status");if(!U&&!W.configured){o("/setup",{replace:!0});return}}catch{if(!U){o("/setup",{replace:!0});return}}try{const W=await uN();U||f(W.needs_setup?"setup":"login")}catch{U||f("login")}}return ne(),()=>{U=!0}},[o]),a.isAuthenticated)return s.jsx(ao,{to:"/settings",replace:!0});const R=U=>{U.preventDefault(),l(m,y)},O=U=>{if(U.preventDefault(),E(null),y!==N){E("Passwords do not match");return}if(y.length<8){E("Password must be at least 8 characters");return}i(m,y,g||void 0)},M=te("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2","text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]"),V=j??a.error;return d==="loading"?s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--color-background)]",children:s.jsx("div",{className:"w-full max-w-sm rounded-xl border border-[var(--color-border)] bg-[var(--color-surface)] p-8 shadow-lg",children:s.jsx("div",{className:"flex justify-center",children:s.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--color-border)] border-t-[var(--color-primary)]"})})})}):s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--color-background)]",children:s.jsx("div",{className:"w-full max-w-sm rounded-xl border border-[var(--color-border)] bg-[var(--color-surface)] p-8 shadow-lg",children:d==="setup"?s.jsxs(s.Fragment,{children:[s.jsx("h1",{className:"mb-1 text-center text-2xl font-bold text-[var(--color-text)]",children:"Welcome to Jarvis"}),s.jsx("p",{className:"mb-6 text-center text-sm text-[var(--color-text-muted)]",children:"Set up your first administrator account to get started."}),s.jsxs("form",{onSubmit:O,className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"email",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Email"}),s.jsx("input",{id:"email",type:"email",required:!0,autoComplete:"email",value:m,onChange:U=>v(U.target.value),className:M,placeholder:"admin@example.com"})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"username",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Username"}),s.jsx("input",{id:"username",type:"text",required:!0,autoComplete:"username",value:g,onChange:U=>p(U.target.value),className:M,placeholder:"admin"})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"password",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Password"}),s.jsx("input",{id:"password",type:"password",required:!0,minLength:8,autoComplete:"new-password",value:y,onChange:U=>x(U.target.value),className:M})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"confirm-password",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Confirm Password"}),s.jsx("input",{id:"confirm-password",type:"password",required:!0,minLength:8,autoComplete:"new-password",value:N,onChange:U=>A(U.target.value),className:M})]}),V&&s.jsx("p",{className:"rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-500",children:V}),s.jsx("button",{type:"submit",disabled:a.isLoading,className:te("w-full rounded-lg bg-[var(--color-primary)] px-4 py-2 font-medium text-white","hover:opacity-90 disabled:opacity-50","transition-opacity"),children:a.isLoading?"Creating account...":"Create Admin Account"})]})]}):s.jsxs(s.Fragment,{children:[s.jsx("h1",{className:"mb-6 text-center text-2xl font-bold text-[var(--color-text)]",children:"Jarvis Admin"}),s.jsxs("form",{onSubmit:R,className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"email",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Email"}),s.jsx("input",{id:"email",type:"email",required:!0,autoComplete:"email",value:m,onChange:U=>v(U.target.value),className:M,placeholder:"admin@example.com"})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"password",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Password"}),s.jsx("input",{id:"password",type:"password",required:!0,autoComplete:"current-password",value:y,onChange:U=>x(U.target.value),className:M})]}),V&&s.jsx("p",{className:"rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-500",children:V}),s.jsx("button",{type:"submit",disabled:a.isLoading,className:te("w-full rounded-lg bg-[var(--color-primary)] px-4 py-2 font-medium text-white","hover:opacity-90 disabled:opacity-50","transition-opacity"),children:a.isLoading?"Signing in...":"Sign in"})]})]})})})}async function Mw(){const{data:a}=await ye.get("/api/settings/");return a}async function Aw(a,l,i){const{data:o}=await ye.put(`/api/settings/${encodeURIComponent(a)}/${l}`,{value:i});return o}function kw(){return zt({queryKey:["settings"],queryFn:Mw,staleTime:3e4})}function Ow(){const a=vt();return jt({mutationFn:({serviceName:l,key:i,value:o})=>Aw(l,i,o),onSuccess:()=>{a.invalidateQueries({queryKey:["settings"]})}})}function zw({setting:a,onSave:l,onCancel:i,isSaving:o}){const[d,f]=S.useState(()=>a.value_type==="json"?JSON.stringify(a.value,null,2):a.value_type==="bool"?"":String(a.value??"")),[m,v]=S.useState(()=>!!a.value),[g,p]=S.useState(null),y=!!a.options?.length,x=y&&!a.options.includes(d),[N,A]=S.useState(x),j=R=>{R.preventDefault();let O;switch(a.value_type){case"bool":O=m;break;case"int":if(O=parseInt(d,10),isNaN(O)){p("Must be a whole number");return}p(null);break;case"float":if(O=parseFloat(d),isNaN(O)){p("Must be a number");return}p(null);break;case"json":try{O=JSON.parse(d),p(null)}catch{p("Invalid JSON");return}break;default:O=d}l(O)},E=te("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-1.5","text-sm text-[var(--color-text)] outline-none focus:ring-2 focus:ring-[var(--color-primary)]");return s.jsxs("form",{onSubmit:j,className:"flex items-center gap-2",children:[y?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("select",{value:N?"__other__":d,onChange:R=>{R.target.value==="__other__"?(A(!0),f("")):(A(!1),f(R.target.value))},className:te(E,"max-w-xs"),children:[a.options.map(R=>s.jsx("option",{value:String(R),children:String(R)},String(R))),s.jsx("option",{value:"__other__",children:"Other..."})]}),N&&s.jsx("input",{type:"text",value:d,onChange:R=>f(R.target.value),placeholder:"Custom value",className:te(E,"max-w-xs"),autoFocus:!0})]}):a.value_type==="bool"?s.jsx("button",{type:"button",onClick:()=>v(R=>!R),className:te("relative h-6 w-11 rounded-full transition-colors",m?"bg-[var(--color-primary)]":"bg-[var(--color-border)]"),children:s.jsx("span",{className:te("absolute left-0.5 top-0.5 h-5 w-5 rounded-full bg-white transition-transform",m&&"translate-x-5")})}):a.value_type==="json"?s.jsxs("div",{className:"flex-1",children:[s.jsx("textarea",{value:d,onChange:R=>{f(R.target.value),p(null)},rows:4,className:te(E,"font-mono text-xs")}),g&&s.jsx("p",{className:"mt-1 text-xs text-red-500",children:g})]}):s.jsxs("div",{children:[s.jsx("input",{type:a.value_type==="int"||a.value_type==="float"?"number":a.is_secret?"password":"text",step:a.value_type==="float"?"any":void 0,value:d,onChange:R=>{f(R.target.value),p(null)},className:te(E,"max-w-xs")}),g&&s.jsx("p",{className:"mt-1 text-xs text-red-500",children:g})]}),s.jsx("button",{type:"submit",disabled:o,className:"rounded-lg bg-[var(--color-primary)] px-3 py-1.5 text-xs font-medium text-white hover:opacity-90 disabled:opacity-50",children:o?"Saving...":"Save"}),s.jsx("button",{type:"button",onClick:i,className:"rounded-lg border border-[var(--color-border)] px-3 py-1.5 text-xs text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]",children:"Cancel"})]})}function Dw(a){return a.is_secret?"********":a.value===null||a.value===void 0?"(not set)":a.value_type==="json"?JSON.stringify(a.value):String(a.value)}const Lw={string:"bg-blue-500/10 text-blue-500",int:"bg-emerald-500/10 text-emerald-500",float:"bg-emerald-500/10 text-emerald-500",bool:"bg-amber-500/10 text-amber-500",json:"bg-purple-500/10 text-purple-500"};function Uw({setting:a,serviceName:l,onRestartService:i}){const[o,d]=S.useState(!1),f=Ow(),m=v=>{f.mutate({serviceName:l,key:a.key,value:v},{onSuccess:g=>{d(!1),g.requires_reload?ze.warning(`Setting updated. ${l} requires a restart to apply.`,i?{action:{label:"Restart",onClick:i}}:void 0):ze.success("Setting updated")},onError:g=>{ze.error(`Failed to update: ${g.message}`)}})};return s.jsxs("div",{className:"flex items-start justify-between gap-4 rounded-lg px-3 py-2 hover:bg-[var(--color-surface-alt)]",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("code",{className:"text-sm font-medium text-[var(--color-text)]",children:a.key}),s.jsx("span",{className:te("rounded px-1.5 py-0.5 text-[10px] font-medium",Lw[a.value_type]??"bg-gray-500/10 text-gray-500"),children:a.value_type}),a.from_db&&s.jsx("span",{title:"Stored in database",children:s.jsx(HN,{size:12,className:"text-[var(--color-tertiary)]"})}),a.requires_reload&&s.jsx("span",{title:"Requires service restart",children:s.jsx(na,{size:12,className:"text-amber-500"})})]}),a.description&&s.jsx("p",{className:"mt-0.5 text-xs text-[var(--color-text-muted)]",children:a.description}),o?s.jsx("div",{className:"mt-2",children:s.jsx(zw,{setting:a,onSave:m,onCancel:()=>d(!1),isSaving:f.isPending})}):s.jsx("p",{className:"mt-1 font-mono text-xs text-[var(--color-text-muted)]",children:Dw(a)})]}),!o&&s.jsx("button",{onClick:()=>d(!0),className:"shrink-0 rounded-lg p-1.5 text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)] hover:text-[var(--color-primary)]",title:"Edit",children:s.jsx(uj,{size:14})})]})}function Bw({category:a,settings:l,serviceName:i,onRestartService:o}){const[d,f]=S.useState(!0);return s.jsxs("div",{children:[s.jsxs("button",{onClick:()=>f(m=>!m),className:"flex w-full items-center gap-2 px-3 py-1.5 text-xs font-semibold uppercase tracking-wider text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:[d?s.jsx(zd,{size:14}):s.jsx(Kv,{size:14}),a,s.jsxs("span",{className:"font-normal",children:["(",l.length,")"]})]}),d&&s.jsx("div",{className:"space-y-0.5",children:l.map(m=>s.jsx(Uw,{setting:m,serviceName:i,onRestartService:o},m.key))})]})}async function qw(){const{data:a}=await ye.get("/api/containers");return a}async function Hw(a){const{data:l}=await ye.post(`/api/containers/${a}/restart`);return l}function mg(){return zt({queryKey:["containers"],queryFn:qw,staleTime:1e4,refetchInterval:1e4})}function hg(){const a=vt();return jt({mutationFn:l=>Hw(l),onSuccess:()=>{a.invalidateQueries({queryKey:["containers"]})}})}function Gw({result:a,defaultExpanded:l=!1}){const[i,o]=S.useState(l),{data:d}=mg(),f=hg(),m=S.useCallback(()=>{const g=d?.containers.find(p=>p.name.includes(a.service_name)||p.name.includes(a.service_name.replace("jarvis-","")));g?f.mutate(g.id,{onSuccess:()=>ze.success(`${a.service_name} is restarting...`),onError:p=>ze.error(`Restart failed: ${p.message}`)}):ze.error(`Could not find container for ${a.service_name}`)},[d,a.service_name,f]),v=S.useMemo(()=>{const g=new Map;for(const p of a.settings){const y=g.get(p.category)??[];g.set(p.category,[...y,p])}return g},[a]);return s.jsxs("div",{className:"overflow-hidden rounded-xl border border-[var(--color-border)] bg-[var(--color-surface)]",children:[s.jsxs("button",{onClick:()=>o(g=>!g),className:"flex w-full items-center gap-3 px-4 py-3 text-left hover:bg-[var(--color-surface-alt)]",children:[i?s.jsx(zd,{size:18,className:"text-[var(--color-text-muted)]"}):s.jsx(Kv,{size:18,className:"text-[var(--color-text-muted)]"}),s.jsx("span",{className:"font-medium text-[var(--color-text)]",children:a.service_name}),a.success?s.jsx(xt,{size:16,className:"text-[var(--color-secondary)]"}):s.jsx(ps,{size:16,className:"text-red-500"}),s.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:a.success?`${a.settings.length} settings`:a.error??"Error"}),a.latency_ms!=null&&s.jsxs("span",{className:te("ml-auto text-xs",a.latency_ms>500?"text-amber-500":"text-[var(--color-text-muted)]"),children:[Math.round(a.latency_ms),"ms"]})]}),i&&a.success&&s.jsx("div",{className:"space-y-2 border-t border-[var(--color-border)] px-2 py-3",children:[...v.entries()].map(([g,p])=>s.jsx(Bw,{category:g,settings:p,serviceName:a.service_name,onRestartService:m},g))}),i&&!a.success&&s.jsx("div",{className:"border-t border-[var(--color-border)] px-4 py-3",children:s.jsx("p",{className:"text-sm text-red-500",children:a.error??"Failed to fetch settings"})})]})}function Qw(){const{data:a,isLoading:l,isError:i,error:o,refetch:d,isFetching:f}=kw(),[m,v]=S.useState(""),g=S.useMemo(()=>{if(!a)return[];if(!m.trim())return a.services;const p=m.toLowerCase();return a.services.map(y=>({...y,settings:y.settings.filter(x=>x.key.toLowerCase().includes(p)||x.category.toLowerCase().includes(p)||(x.description?.toLowerCase().includes(p)??!1))})).filter(y=>y.settings.length>0||y.service_name.toLowerCase().includes(p))},[a,m]);return l?s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Ct,{className:"animate-spin text-[var(--color-primary)]",size:24})}):i?s.jsxs("div",{className:"py-20 text-center",children:[s.jsx("p",{className:"mb-2 text-red-500",children:"Failed to load settings"}),s.jsx("p",{className:"mb-4 text-sm text-[var(--color-text-muted)]",children:o?.message??"Unknown error"}),s.jsx("button",{onClick:()=>d(),className:"rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm text-white hover:opacity-90",children:"Retry"})]}):s.jsxs("div",{className:"mx-auto max-w-4xl space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h1",{className:"text-xl font-bold text-[var(--color-text)]",children:"Settings"}),s.jsxs("div",{className:"flex items-center gap-2 text-xs text-[var(--color-text-muted)]",children:[a&&s.jsxs("span",{children:[a.successful_services,"/",a.total_services," services"]}),s.jsx("button",{onClick:()=>d(),disabled:f,className:te("rounded-lg p-1.5 hover:bg-[var(--color-surface-alt)]",f&&"animate-spin"),title:"Refresh",children:s.jsx(Ct,{size:14})})]})]}),s.jsxs("div",{className:"relative",children:[s.jsx(vj,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-muted)]"}),s.jsx("input",{type:"text",value:m,onChange:p=>v(p.target.value),placeholder:"Search settings...",className:te("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] py-2 pl-9 pr-3","text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]")})]}),s.jsxs("div",{className:"space-y-3",children:[g.map((p,y)=>s.jsx(Gw,{result:p,defaultExpanded:y===0},p.service_name)),g.length===0&&s.jsx("p",{className:"py-8 text-center text-sm text-[var(--color-text-muted)]",children:m?"No settings match your search":"No services found"})]})]})}async function Vw(){const{data:a}=await ye.get("/api/services/registry");return a}async function Fw(a){const{data:l}=await ye.post("/api/services/register",a);return l}async function Yw(a){const{data:l}=await ye.post("/api/services/rotate-key",a);return l}async function Xw(a){const{data:l}=await ye.post("/api/services/probe",a);return l}async function Kw(a){const{data:l}=await ye.post("/api/services/register",{services:[{name:a.name,host:a.host,port:a.port,scheme:a.scheme,health_path:a.health_path,description:a.description}]});return l}async function Zw(a){await ye.delete(`/api/services/${encodeURIComponent(a)}`)}async function $w(){const{data:a}=await ye.get("/api/services/suggestions");return a}function Jw(){return zt({queryKey:["service-registry"],queryFn:Vw,staleTime:3e4})}function Pw(){const a=vt();return jt({mutationFn:Fw,onSuccess:()=>{a.invalidateQueries({queryKey:["service-registry"]})}})}function Iw(){const a=vt();return jt({mutationFn:Yw,onSuccess:()=>{a.invalidateQueries({queryKey:["service-registry"]})}})}function Ww(){const a=vt();return jt({mutationFn:Kw,onSuccess:()=>{a.invalidateQueries({queryKey:["service-registry"]})}})}function eE(){const a=vt();return jt({mutationFn:Zw,onSuccess:()=>{a.invalidateQueries({queryKey:["service-registry"]})}})}function tE(){return zt({queryKey:["service-suggestions"],queryFn:$w,staleTime:6e4})}function kx({ok:a,label:l}){return s.jsxs("span",{className:te("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium",a?"bg-green-500/10 text-green-600 dark:text-green-400":"bg-[var(--color-surface-alt)] text-[var(--color-text-muted)]"),children:[a?s.jsx(xo,{size:12}):s.jsx(Hd,{size:12}),l]})}function aE({status:a,error:l,latency:i}){return a==="idle"?null:a==="probing"?s.jsx("span",{className:"flex items-center gap-1 text-xs text-[var(--color-text-muted)]",children:s.jsx(aa,{size:12,className:"animate-spin"})}):a==="healthy"?s.jsxs("span",{className:"flex items-center gap-1 text-xs text-green-600 dark:text-green-400",children:[s.jsx(sl,{size:8,fill:"currentColor"}),i!=null&&`${i}ms`]}):s.jsxs("span",{className:"flex items-center gap-1 text-xs text-red-500",title:l,children:[s.jsx(sl,{size:8,fill:"currentColor"}),l||"Unreachable"]})}function nE({entry:a,checked:l,host:i,port:o,scheme:d,onToggle:f,onHostChange:m,onPortChange:v,onSchemeChange:g,onHostBlur:p,onPortBlur:y,onRotateKey:x,onDelete:N,disabled:A,rotating:j,deleting:E,healthStatus:R,healthError:O,healthLatency:M}){return s.jsxs("div",{className:te("flex flex-wrap items-center gap-3 rounded-lg border border-[var(--color-border)] p-3","bg-[var(--color-surface)] transition-colors",l&&"border-[var(--color-primary)]/30 bg-[var(--color-primary)]/5"),children:[s.jsx("input",{type:"checkbox",checked:l,onChange:f,disabled:A,className:"h-4 w-4 rounded border-[var(--color-border)] accent-[var(--color-primary)]"}),s.jsxs("div",{className:"min-w-[180px] flex-1",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-[var(--color-text)]",children:[a.name,a.custom&&s.jsx("span",{className:"rounded-full bg-blue-500/10 px-1.5 py-0.5 text-[10px] font-medium text-blue-600 dark:text-blue-400",children:"custom"})]}),s.jsx("div",{className:"text-xs text-[var(--color-text-muted)]",children:a.description})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(kx,{ok:a.config_registered,label:"Config"}),s.jsx(kx,{ok:a.auth_registered,label:"Auth"}),a.custom&&N&&s.jsxs("button",{onClick:N,disabled:A||E,className:te("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium","bg-red-500/10 text-red-600 dark:text-red-400","hover:bg-red-500/20","disabled:opacity-50"),title:"Remove custom service",children:[s.jsx(go,{size:12,className:E?"animate-spin":""}),"Remove"]}),a.auth_registered&&s.jsxs("button",{onClick:x,disabled:A||j,className:te("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium","bg-[var(--color-surface-alt)] text-[var(--color-text-muted)]","hover:bg-[var(--color-primary)]/10 hover:text-[var(--color-primary)]","disabled:opacity-50"),title:"Rotate app key",children:[s.jsx(Bd,{size:12,className:j?"animate-spin":""}),"Rotate Key"]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("select",{value:d,onChange:V=>g(V.target.value),disabled:A,className:te("rounded border px-1.5 py-1 text-xs font-mono",d==="https"?"border-green-500/40 bg-green-500/10 text-green-600 dark:text-green-400":d==="mqtt"||d==="mqtts"?"border-purple-500/40 bg-purple-500/10 text-purple-600 dark:text-purple-400":d==="ws"||d==="wss"?"border-blue-500/40 bg-blue-500/10 text-blue-600 dark:text-blue-400":"border-[var(--color-border)] bg-[var(--color-background)] text-[var(--color-text-muted)]","disabled:opacity-50"),title:"Scheme",children:[s.jsx("option",{value:"http",children:"http"}),s.jsx("option",{value:"https",children:"https"}),s.jsx("option",{value:"mqtt",children:"mqtt"}),s.jsx("option",{value:"mqtts",children:"mqtts"}),s.jsx("option",{value:"ws",children:"ws"}),s.jsx("option",{value:"wss",children:"wss"})]}),s.jsx("input",{type:"text",value:i,onChange:V=>m(V.target.value),onBlur:p,disabled:A,placeholder:"host",className:te("w-36 rounded border border-[var(--color-border)] bg-[var(--color-background)] px-2 py-1","text-xs text-[var(--color-text)] outline-none focus:ring-1 focus:ring-[var(--color-primary)]","disabled:opacity-50")}),s.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:":"}),s.jsx("input",{type:"number",value:o,onChange:V=>v(Number(V.target.value)),onBlur:y,disabled:A,className:te("w-20 rounded border border-[var(--color-border)] bg-[var(--color-background)] px-2 py-1","text-xs text-[var(--color-text)] outline-none focus:ring-1 focus:ring-[var(--color-primary)]","disabled:opacity-50")}),s.jsx(aE,{status:R,error:O,latency:M})]})]})}const Ox={name:"",host:"localhost",port:"",scheme:"http",health_path:"/health",description:""};function rE(){const{data:a,isLoading:l,isError:i,error:o,refetch:d,isFetching:f}=Jw(),m=Pw(),v=Iw(),g=Ww(),p=eE(),{data:y}=tE(),[x,N]=S.useState({}),[A,j]=S.useState(null),[E,R]=S.useState(null),[O,M]=S.useState(null),[V,U]=S.useState(null),[ne,W]=S.useState(null),[$,G]=S.useState({}),[se,je]=S.useState(!1),[he,me]=S.useState(Ox),[Re,Ce]=S.useState(!1),ee=S.useRef(null),w=S.useMemo(()=>new Set(a?.services.map(B=>B.name)??[]),[a]),Q=S.useMemo(()=>{const ae=(y?.suggestions??[]).filter(Ae=>!w.has(Ae.id));if(!he.name.trim())return ae;const _e=he.name.toLowerCase();return ae.filter(Ae=>Ae.id.toLowerCase().includes(_e)||Ae.name.toLowerCase().includes(_e)||Ae.description.toLowerCase().includes(_e))},[y,w,he.name]),F=S.useCallback(B=>{me({name:B.id,description:B.description,host:"localhost",port:String(B.port),scheme:"http",health_path:B.healthCheck}),Ce(!1)},[]);S.useEffect(()=>{const B=ae=>{ee.current&&!ee.current.contains(ae.target)&&Ce(!1)};return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[]);const xe=S.useCallback(B=>{if(x[B])return x[B];const ae=a?.services.find(_e=>_e.name===B);return ae?{checked:ae.config_registered,host:ae.current_host??"localhost",port:ae.current_port??ae.default_port,scheme:ae.current_scheme??"http"}:{checked:!1,host:"localhost",port:0,scheme:"http"}},[x,a]),ve=S.useCallback((B,ae)=>{N(_e=>{const Ae=_e[B]??{checked:!1,host:"localhost",port:0};return{..._e,[B]:{...Ae,...ae}}})},[]),C=S.useCallback(async(B,ae,_e,Ae,va="http")=>{if(!(!ae||!_e)){G(ot=>({...ot,[B]:{status:"probing"}}));try{const ot=await Xw({host:ae,port:_e,health_path:Ae,scheme:va});G(zn=>({...zn,[B]:{status:ot.healthy?"healthy":"unhealthy",error:ot.error??void 0,latency:ot.latency_ms??void 0}}))}catch{G(ot=>({...ot,[B]:{status:"unhealthy",error:"Request failed"}}))}}},[]),Y=S.useCallback(()=>{if(!a)return;const B=a.services.filter(ae=>xe(ae.name).checked).map(ae=>{const _e=xe(ae.name);return{name:ae.name,host:_e.host,port:_e.port,scheme:_e.scheme}});if(B.length===0){ze.error("No services selected");return}j(null),R(null),m.mutate({services:B},{onSuccess:ae=>{j(ae.results);const _e=ae.results.filter(va=>va.config_ok&&va.auth_ok).length,Ae=ae.results.length;_e===Ae?ze.success(`All ${Ae} services registered`):ze.warning(`${_e}/${Ae} services registered successfully`)},onError:ae=>{ze.error(`Registration failed: ${ae.message}`)}})},[a,xe,m]),X=S.useCallback(B=>{M(B),R(null),v.mutate({service_name:B},{onSuccess:ae=>{R(ae),M(null),ze.success(`Key rotated for ${B}`)},onError:ae=>{M(null),ze.error(`Key rotation failed: ${ae.message}`)}})},[v]),I=S.useCallback(B=>{U(B),p.mutate(B,{onSuccess:()=>{U(null),ze.success(`Removed ${B}`)},onError:ae=>{U(null),ze.error(`Failed to remove: ${ae.message}`)}})},[p]),le=S.useCallback(()=>{const B=parseInt(he.port,10);if(!he.name.trim()){ze.error("Service name is required");return}if(!B||B<1||B>65535){ze.error("Port must be between 1 and 65535");return}g.mutate({name:he.name.trim(),host:he.host.trim()||"localhost",port:B,scheme:he.scheme,health_path:he.health_path.trim()||"/health",description:he.description.trim()},{onSuccess:ae=>{const _e=ae.results[0];_e?.config_ok?(ze.success(`Added ${he.name.trim()}`),me(Ox),je(!1)):ze.error(`Failed to add: ${_e?.error??"Unknown error"}`)},onError:ae=>{ze.error(`Failed to add service: ${ae.message}`)}})},[he,g]),Z=S.useCallback(B=>{navigator.clipboard.writeText(B).then(()=>{W(B),setTimeout(()=>W(null),2e3)})},[]),ie=a?.services.filter(B=>xe(B.name).checked).length??0,oe=A?.some(B=>B.env_written)||E?.env_written===!0;return l?s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Ct,{className:"animate-spin text-[var(--color-primary)]",size:24})}):i?s.jsxs("div",{className:"py-20 text-center",children:[s.jsx("p",{className:"mb-2 text-red-500",children:"Failed to load service registry"}),s.jsx("p",{className:"mb-4 text-sm text-[var(--color-text-muted)]",children:o?.message??"Unknown error"}),s.jsx("button",{onClick:()=>d(),className:"rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm text-white hover:opacity-90",children:"Retry"})]}):s.jsxs("div",{className:"mx-auto max-w-4xl space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("h1",{className:"text-xl font-bold text-[var(--color-text)]",children:"Services"}),s.jsx("span",{className:"rounded-full bg-[var(--color-surface-alt)] px-2.5 py-0.5 text-xs font-medium text-[var(--color-text-muted)]",children:a?.services.length??0})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("button",{onClick:()=>je(B=>!B),className:te("flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium",se?"bg-[var(--color-surface-alt)] text-[var(--color-text)]":"bg-[var(--color-primary)] text-white hover:opacity-90"),children:[se?s.jsx(Hd,{size:14}):s.jsx(eo,{size:14}),se?"Cancel":"Add Service"]}),s.jsx("button",{onClick:()=>d(),disabled:f,className:te("rounded-lg p-1.5 text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]",f&&"animate-spin"),title:"Refresh",children:s.jsx(Ct,{size:14})})]})]}),se&&s.jsxs("div",{className:"rounded-lg border border-[var(--color-primary)]/30 bg-[var(--color-primary)]/5 p-4",children:[s.jsx("h2",{className:"mb-3 text-sm font-semibold text-[var(--color-text)]",children:"Add Service"}),s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsxs("div",{ref:ee,className:"relative",children:[s.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Service"}),s.jsxs("div",{className:"relative",children:[s.jsx("input",{type:"text",value:he.name,onChange:B=>{me(ae=>({...ae,name:B.target.value})),Ce(!0)},onFocus:()=>Ce(!0),placeholder:"Select or type a service name...",className:te("w-full rounded border border-[var(--color-border)] bg-[var(--color-background)] px-2.5 py-1.5 pr-8","text-sm text-[var(--color-text)] outline-none focus:ring-1 focus:ring-[var(--color-primary)]")}),s.jsx("button",{type:"button",onClick:()=>Ce(B=>!B),className:"absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:s.jsx(zd,{size:14})})]}),Re&&Q.length>0&&s.jsx("div",{className:"absolute z-10 mt-1 max-h-48 w-full overflow-y-auto rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] shadow-lg",children:Q.map(B=>s.jsxs("button",{type:"button",onClick:()=>F(B),className:"flex w-full flex-col px-3 py-2 text-left hover:bg-[var(--color-surface-alt)]",children:[s.jsxs("span",{className:"text-sm font-medium text-[var(--color-text)]",children:[B.name,s.jsxs("span",{className:"ml-2 font-normal text-[var(--color-text-muted)]",children:[":",B.port]})]}),s.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:B.description})]},B.id))})]}),s.jsxs("div",{children:[s.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Description"}),s.jsx("input",{type:"text",value:he.description,onChange:B=>me(ae=>({...ae,description:B.target.value})),placeholder:"e.g. Camera streaming via WebRTC",className:te("w-full rounded border border-[var(--color-border)] bg-[var(--color-background)] px-2.5 py-1.5","text-sm text-[var(--color-text)] outline-none focus:ring-1 focus:ring-[var(--color-primary)]")})]}),s.jsxs("div",{children:[s.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Host"}),s.jsx("input",{type:"text",value:he.host,onChange:B=>me(ae=>({...ae,host:B.target.value})),placeholder:"localhost",className:te("w-full rounded border border-[var(--color-border)] bg-[var(--color-background)] px-2.5 py-1.5","text-sm text-[var(--color-text)] outline-none focus:ring-1 focus:ring-[var(--color-primary)]")})]}),s.jsxs("div",{className:"flex gap-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Port"}),s.jsx("input",{type:"number",value:he.port,onChange:B=>me(ae=>({...ae,port:B.target.value})),placeholder:"e.g. 1984",className:te("w-full rounded border border-[var(--color-border)] bg-[var(--color-background)] px-2.5 py-1.5","text-sm text-[var(--color-text)] outline-none focus:ring-1 focus:ring-[var(--color-primary)]")})]}),s.jsxs("div",{className:"w-20",children:[s.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Scheme"}),s.jsxs("select",{value:he.scheme,onChange:B=>me(ae=>({...ae,scheme:B.target.value})),className:te("w-full rounded border border-[var(--color-border)] bg-[var(--color-background)] px-2 py-1.5","text-sm text-[var(--color-text)] outline-none focus:ring-1 focus:ring-[var(--color-primary)]"),children:[s.jsx("option",{value:"http",children:"http"}),s.jsx("option",{value:"https",children:"https"}),s.jsx("option",{value:"mqtt",children:"mqtt"}),s.jsx("option",{value:"mqtts",children:"mqtts"}),s.jsx("option",{value:"ws",children:"ws"}),s.jsx("option",{value:"wss",children:"wss"})]})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Health Path"}),s.jsx("input",{type:"text",value:he.health_path,onChange:B=>me(ae=>({...ae,health_path:B.target.value})),placeholder:"/health",className:te("w-full rounded border border-[var(--color-border)] bg-[var(--color-background)] px-2.5 py-1.5","text-sm text-[var(--color-text)] outline-none focus:ring-1 focus:ring-[var(--color-primary)]")})]})]}),s.jsx("div",{className:"mt-3 flex justify-end",children:s.jsx("button",{onClick:le,disabled:g.isPending||!he.name.trim()||!he.port,className:te("rounded-lg bg-[var(--color-primary)] px-4 py-1.5 text-sm font-medium text-white","hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50"),children:g.isPending?"Adding...":"Add Service"})})]}),s.jsx("div",{className:"space-y-2",children:a?.services.map(B=>{const ae=xe(B.name),_e=$[B.name]??{status:"idle"};return s.jsx(nE,{entry:B,checked:ae.checked,host:ae.host,port:ae.port,scheme:ae.scheme,onToggle:()=>{const Ae=!ae.checked;ve(B.name,{...ae,checked:Ae}),Ae?C(B.name,ae.host,ae.port,B.health_path,ae.scheme):G(va=>({...va,[B.name]:{status:"idle"}}))},onHostChange:Ae=>ve(B.name,{...ae,host:Ae}),onPortChange:Ae=>ve(B.name,{...ae,port:Ae}),onSchemeChange:Ae=>ve(B.name,{...ae,scheme:Ae}),onHostBlur:()=>{ae.checked&&C(B.name,ae.host,ae.port,B.health_path,ae.scheme)},onPortBlur:()=>{ae.checked&&C(B.name,ae.host,ae.port,B.health_path,ae.scheme)},onRotateKey:()=>X(B.name),onDelete:()=>I(B.name),disabled:m.isPending,rotating:O===B.name,deleting:V===B.name,healthStatus:_e.status,healthError:_e.error,healthLatency:_e.latency},B.name)})}),s.jsx("button",{onClick:Y,disabled:m.isPending||ie===0,className:te("rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm font-medium text-white","hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50"),children:m.isPending?"Registering...":`Register Selected (${ie})`}),E&&s.jsx(lE,{serviceName:E.service_name,appKey:E.app_key,envWritten:E.env_written,copiedKey:ne,onCopy:Z,label:"Rotated Key"}),A&&s.jsxs("div",{className:"space-y-2 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[s.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"Registration Results"}),A.map(B=>s.jsxs("div",{className:te("flex flex-wrap items-center gap-3 rounded-lg border p-3 text-sm",B.config_ok&&B.auth_ok?"border-green-500/20 bg-green-500/5":"border-yellow-500/20 bg-yellow-500/5"),children:[s.jsx("span",{className:"min-w-[180px] font-medium text-[var(--color-text)]",children:B.name}),s.jsxs("span",{className:te("text-xs",B.config_ok?"text-green-600 dark:text-green-400":"text-red-500"),children:["Config: ",B.config_ok?"OK":"Failed"]}),s.jsxs("span",{className:te("text-xs",B.auth_ok?"text-green-600 dark:text-green-400":"text-red-500"),children:["Auth: ",B.auth_ok?B.auth_created?"Created":"Exists":"Failed"]}),B.env_written!==null&&s.jsxs("span",{className:te("text-xs",B.env_written?"text-green-600 dark:text-green-400":"text-red-500"),children:[".env: ",B.env_written?"Written":"Failed"]}),B.error&&s.jsxs("span",{className:"flex items-center gap-1 text-xs text-yellow-600 dark:text-yellow-400",children:[s.jsx(na,{size:12}),B.error]}),B.auth_created&&B.app_key&&s.jsxs("div",{className:"mt-1 w-full",children:[s.jsxs("div",{className:"mb-1 flex items-center gap-1 text-xs font-medium text-yellow-600 dark:text-yellow-400",children:[s.jsx(na,{size:12}),"App key (shown once only):"]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("code",{className:"flex-1 overflow-x-auto rounded bg-[var(--color-background)] px-2 py-1 font-mono text-xs text-[var(--color-text)]",children:B.app_key}),s.jsx("button",{onClick:()=>Z(B.app_key),className:"rounded p-1 hover:bg-[var(--color-surface-alt)]",title:"Copy to clipboard",children:ne===B.app_key?s.jsx(xo,{size:14,className:"text-green-500"}):s.jsx($v,{size:14,className:"text-[var(--color-text-muted)]"})})]})]})]},B.name))]}),oe&&s.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-blue-500/20 bg-blue-500/5 p-3",children:[s.jsx(JN,{size:16,className:"mt-0.5 shrink-0 text-blue-500"}),s.jsx("p",{className:"text-sm text-[var(--color-text)]",children:"Services whose .env files were updated need to be restarted to pick up the new credentials. Restart each affected service's container or process."})]})]})}function lE({serviceName:a,appKey:l,envWritten:i,copiedKey:o,onCopy:d,label:f}){return s.jsxs("div",{className:"space-y-2 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[s.jsxs("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:[f,": ",a]}),s.jsxs("div",{className:"rounded-lg border border-green-500/20 bg-green-500/5 p-3",children:[i!==null&&s.jsxs("span",{className:te("mb-2 inline-block text-xs",i?"text-green-600 dark:text-green-400":"text-red-500"),children:[".env: ",i?"Written":"Failed"]}),s.jsxs("div",{children:[s.jsxs("div",{className:"mb-1 flex items-center gap-1 text-xs font-medium text-yellow-600 dark:text-yellow-400",children:[s.jsx(na,{size:12}),"New app key (shown once only):"]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("code",{className:"flex-1 overflow-x-auto rounded bg-[var(--color-background)] px-2 py-1 font-mono text-xs text-[var(--color-text)]",children:l}),s.jsx("button",{onClick:()=>d(l),className:"rounded p-1 hover:bg-[var(--color-surface-alt)]",title:"Copy to clipboard",children:o===l?s.jsx(xo,{size:14,className:"text-green-500"}):s.jsx($v,{size:14,className:"text-[var(--color-text-muted)]"})})]})]})]})]})}async function sE(){const{data:a}=await ye.get("/api/llm-setup/status");return a}async function iE(a){const{data:l}=await ye.post("/api/llm-setup/configure",{settings:a});return l}async function oE(a,l,i){const{data:o}=await ye.post("/api/llm-setup/download",{repo:a,filename:l,token:i});return o}function cE(){return zt({queryKey:["llm-status"],queryFn:sE,staleTime:3e4,retry:1})}function pg(){const a=vt();return jt({mutationFn:l=>iE(l),onSuccess:()=>{a.invalidateQueries({queryKey:["llm-status"]}),a.invalidateQueries({queryKey:["containers"]})}})}function uE(){return jt({mutationFn:({repo:a,filename:l,token:i})=>oE(a,l,i)})}async function Qd(){const{data:a}=await ye.get("/api/install/status");return a}async function dE(a){const l=a?.length?{services:a.join(",")}:{},{data:i}=await ye.get("/api/install/preflight",{params:l});return i}async function fE(){const{data:a}=await ye.get("/api/install/hardware");return a}async function zx(a){const{data:l}=await ye.post("/api/install/generate",a);return l}async function xg(){const{data:a}=await ye.get("/api/install/registry");return a}async function mE(){const{data:a}=await ye.get("/api/install/defaults");return a}const hE={running:"bg-emerald-500",exited:"bg-red-500",restarting:"bg-amber-500",paused:"bg-amber-500",created:"bg-gray-400",dead:"bg-red-700"};function pE(a){return a.match(/^Up (.+)$/)?.[1]??null}function Dx({container:a,onRestart:l,isRestarting:i}){const o=pE(a.status),d=a.ports.find(f=>f.public)?.public;return s.jsxs("div",{className:"overflow-hidden rounded-xl border border-[var(--color-border)] bg-[var(--color-surface)]",children:[s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[s.jsx("div",{className:te("h-2.5 w-2.5 rounded-full",hE[a.state]??"bg-gray-400")}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"truncate text-sm font-medium text-[var(--color-text)]",children:a.displayName??a.name}),a.description&&s.jsx("p",{className:"truncate text-xs text-[var(--color-text-muted)]",children:a.description})]}),s.jsx("span",{className:te("rounded-full px-2 py-0.5 text-xs font-medium",a.state==="running"?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400":"bg-red-500/10 text-red-600 dark:text-red-400"),children:a.state})]}),s.jsx("div",{className:"border-t border-[var(--color-border)] px-4 py-2",children:s.jsxs("div",{className:"flex items-center justify-between text-xs text-[var(--color-text-muted)]",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[o&&s.jsxs("span",{children:["Up ",o]}),d&&s.jsxs("span",{children:[":",d]})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[d&&s.jsx("a",{href:`http://localhost:${d}/health`,target:"_blank",rel:"noopener noreferrer",className:"rounded p-1 hover:bg-[var(--color-surface-alt)]",title:"Open health endpoint",children:s.jsx(VN,{size:13})}),s.jsx("button",{onClick:()=>l(a.id),disabled:i,className:te("rounded p-1 hover:bg-[var(--color-surface-alt)]",i&&"animate-spin"),title:"Restart",children:s.jsx(Bd,{size:13})})]})]})})]})}async function xE(){const{data:a}=await ye.get("/api/update/check");return a}function vg(){return zt({queryKey:["update-check"],queryFn:xE,staleTime:300*1e3,retry:1,refetchOnWindowFocus:!1})}const Lx="jarvis-update-dismissed-version";function Ux(){const a=wa(),{data:l}=vg(),[i,o]=S.useState(()=>l?.latestVersion?localStorage.getItem(Lx)===l.latestVersion:!1);return!l?.updateAvailable||i?null:s.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-green-500/30 bg-green-500/5 p-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Zv,{size:20,className:"text-green-500"}),s.jsxs("div",{children:[s.jsxs("p",{className:"text-sm font-medium text-[var(--color-text)]",children:["Jarvis v",l.latestVersion," available"]}),s.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["You have v",l.currentVersion]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[l.releaseUrl&&s.jsx("a",{href:l.releaseUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Release notes"}),s.jsx("button",{onClick:()=>{localStorage.setItem(Lx,l.latestVersion),o(!0)},className:"text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Dismiss"}),s.jsx("button",{onClick:()=>a("/update"),className:"rounded-lg bg-green-600 px-3 py-1.5 text-xs text-white hover:opacity-90",children:"Update"})]})]})}const Xu="jarvis-admin:llm-setup-dismissed";function vE(){const a=wa(),[l,i]=S.useState(!1),{data:o,isLoading:d,isError:f,error:m,refetch:v,isFetching:g}=mg(),p=hg(),y=cE(),[x,N]=S.useState(()=>!!localStorage.getItem(Xu));S.useEffect(()=>{Qd().then(M=>{M.deployMode==="compose-export"&&i(!0)}).catch(()=>{})},[]);const A=!!y.data&&!y.data.configured&&!x,j=M=>{p.mutate(M,{onSuccess:()=>ze.success("Container restart initiated"),onError:V=>ze.error(`Restart failed: ${V.message}`)})};if(l)return s.jsxs("div",{className:"mx-auto max-w-4xl space-y-4",children:[s.jsx("h1",{className:"text-xl font-bold text-[var(--color-text)]",children:"Dashboard"}),s.jsx(Ux,{}),A&&s.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-[var(--color-primary)]/30 bg-[var(--color-primary)]/5 p-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(md,{size:20,className:"text-[var(--color-primary)]"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"LLM not configured"}),s.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:"Set up a language model to enable voice command processing"})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{onClick:()=>{localStorage.setItem(Xu,"true"),N(!0)},className:"text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Dismiss"}),s.jsx("button",{onClick:()=>a("/llm-setup"),className:"rounded-lg bg-[var(--color-primary)] px-3 py-1.5 text-xs text-white hover:opacity-90",children:"Set up LLM"})]})]}),s.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-8 text-center",children:[s.jsx(qd,{size:32,className:"mx-auto mb-3 text-[var(--color-text-muted)]"}),s.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"Running in Docker Compose mode"}),s.jsx("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:"Container management is handled by your Docker environment (TrueNAS, Portainer, etc.). Use your platform's tools to view container status, logs, and restarts."})]})]});if(d)return s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Ct,{className:"animate-spin text-[var(--color-primary)]",size:24})});if(f)return s.jsxs("div",{className:"py-20 text-center",children:[s.jsx("p",{className:"mb-2 text-red-500",children:"Failed to load containers"}),s.jsx("p",{className:"mb-4 text-sm text-[var(--color-text-muted)]",children:m?.message??"Unknown error"}),s.jsx("button",{onClick:()=>v(),className:"rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm text-white hover:opacity-90",children:"Retry"})]});const E=o?.containers??[],R=E.filter(M=>M.state==="running"),O=E.filter(M=>M.state!=="running");return s.jsxs("div",{className:"mx-auto max-w-4xl space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h1",{className:"text-xl font-bold text-[var(--color-text)]",children:"Dashboard"}),s.jsxs("div",{className:"flex items-center gap-2 text-xs text-[var(--color-text-muted)]",children:[s.jsxs("span",{children:[R.length,"/",E.length," running"]}),s.jsx("button",{onClick:()=>v(),disabled:g,className:te("rounded-lg p-1.5 hover:bg-[var(--color-surface-alt)]",g&&"animate-spin"),title:"Refresh",children:s.jsx(Ct,{size:14})})]})]}),s.jsx(Ux,{}),A&&s.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-[var(--color-primary)]/30 bg-[var(--color-primary)]/5 p-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(md,{size:20,className:"text-[var(--color-primary)]"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"LLM not configured"}),s.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:"Set up a language model to enable voice command processing"})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{onClick:()=>{localStorage.setItem(Xu,"true"),N(!0)},className:"text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Dismiss"}),s.jsx("button",{onClick:()=>a("/llm-setup"),className:"rounded-lg bg-[var(--color-primary)] px-3 py-1.5 text-xs text-white hover:opacity-90",children:"Set up LLM"})]})]}),s.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Pv,{size:20,className:"text-[var(--color-text-muted)]"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"Sync compose to latest registry"}),s.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:"Regenerate docker-compose.yml and apply changes — adds new background workers and services without recreating unchanged containers"})]})]}),s.jsx("button",{onClick:()=>a("/reconcile"),className:"rounded-lg border border-[var(--color-border)] px-3 py-1.5 text-xs text-[var(--color-text)] hover:bg-[var(--color-surface-alt)]",children:"Sync now"})]}),E.length===0&&s.jsx("div",{className:"py-12 text-center",children:s.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:o?.error?o.error:"No Jarvis containers found. Is Docker running?"})}),R.length>0&&s.jsxs("div",{className:"space-y-2",children:[s.jsx("h2",{className:"text-xs font-semibold uppercase tracking-wider text-[var(--color-text-muted)]",children:"Running"}),s.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:R.map(M=>s.jsx(Dx,{container:M,onRestart:j,isRestarting:p.isPending&&p.variables===M.id},M.id))})]}),O.length>0&&s.jsxs("div",{className:"space-y-2",children:[s.jsx("h2",{className:"text-xs font-semibold uppercase tracking-wider text-[var(--color-text-muted)]",children:"Stopped"}),s.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:O.map(M=>s.jsx(Dx,{container:M,onRestart:j,isRestarting:p.isPending&&p.variables===M.id},M.id))})]})]})}async function gE(){const{data:a}=await ye.get("/api/nodes");return a}async function yE(a){const{data:l}=await ye.get(`/api/nodes/${a}/nodes`);return l}async function bE(a){const{data:l}=await ye.post(`/api/nodes/${a}/train-adapter`);return l}function SE(){return zt({queryKey:["households"],queryFn:gE,staleTime:3e4})}function NE(a){return zt({queryKey:["household-nodes",a],queryFn:()=>yE(a),enabled:!!a,staleTime:3e4})}function jE(){const a=vt();return jt({mutationFn:bE,onSuccess:()=>{a.invalidateQueries({queryKey:["household-nodes"]})}})}function wE({node:a,onTrain:l,isTraining:i}){return s.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(kn,{size:16,className:"text-[var(--color-text-muted)]"}),s.jsx("span",{className:"font-medium text-[var(--color-text)]",children:a.name})]}),s.jsxs("span",{className:te("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium",a.is_active?"bg-green-500/10 text-green-500":"bg-red-500/10 text-red-500"),children:[a.is_active?s.jsx(so,{size:10}):s.jsx(Mj,{size:10}),a.is_active?"Active":"Inactive"]})]}),s.jsxs("div",{className:"mt-3 space-y-1 text-xs text-[var(--color-text-muted)]",children:[s.jsxs("p",{children:[s.jsx("span",{className:"font-medium",children:"ID:"})," ",a.node_id]}),a.services.length>0&&s.jsxs("p",{children:[s.jsx("span",{className:"font-medium",children:"Services:"})," ",a.services.join(", ")]})]}),s.jsx("div",{className:"mt-4",children:s.jsx("button",{onClick:()=>l(a.node_id),disabled:i||!a.is_active,className:te("rounded-lg px-3 py-1.5 text-xs font-medium transition-colors",i||!a.is_active?"cursor-not-allowed bg-[var(--color-surface-alt)] text-[var(--color-text-muted)]":"bg-[var(--color-primary)] text-white hover:opacity-90"),children:i?s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx(Ct,{size:12,className:"animate-spin"}),"Training..."]}):"Train Adapter"})})]})}function EE({householdId:a,householdName:l}){const{data:i,isLoading:o,isError:d}=NE(a),f=jE(),m=v=>{f.mutate(v,{onSuccess:g=>ze.success(`Training triggered for ${v} (request: ${g.request_id.slice(0,8)}...)`),onError:g=>ze.error(`Training failed: ${g.message}`)})};return s.jsxs("div",{className:"space-y-2",children:[s.jsx("h2",{className:"text-xs font-semibold uppercase tracking-wider text-[var(--color-text-muted)]",children:l}),o&&s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(Ct,{className:"animate-spin text-[var(--color-primary)]",size:18})}),d&&s.jsx("p",{className:"py-4 text-center text-sm text-red-500",children:"Failed to load nodes"}),i&&i.length===0&&s.jsx("p",{className:"py-4 text-center text-sm text-[var(--color-text-muted)]",children:"No nodes registered in this household"}),i&&i.length>0&&s.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:i.map(v=>s.jsx(wE,{node:v,onTrain:m,isTraining:f.isPending&&f.variables===v.node_id},v.node_id))})]})}function TE(){const{data:a,isLoading:l,isError:i,error:o,refetch:d,isFetching:f}=SE();return l?s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Ct,{className:"animate-spin text-[var(--color-primary)]",size:24})}):i?s.jsxs("div",{className:"py-20 text-center",children:[s.jsx("p",{className:"mb-2 text-red-500",children:"Failed to load households"}),s.jsx("p",{className:"mb-4 text-sm text-[var(--color-text-muted)]",children:o?.message??"Unknown error"}),s.jsx("button",{onClick:()=>d(),className:"rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm text-white hover:opacity-90",children:"Retry"})]}):s.jsxs("div",{className:"mx-auto max-w-4xl space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h1",{className:"text-xl font-bold text-[var(--color-text)]",children:"Nodes"}),s.jsx("button",{onClick:()=>d(),disabled:f,className:te("rounded-lg p-1.5 hover:bg-[var(--color-surface-alt)]",f&&"animate-spin"),title:"Refresh",children:s.jsx(Ct,{size:14,className:"text-[var(--color-text-muted)]"})})]}),(!a||a.length===0)&&s.jsx("div",{className:"py-12 text-center",children:s.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"No households found. Register a household in jarvis-auth first."})}),a?.map(m=>s.jsx(EE,{householdId:m.id,householdName:m.name},m.id))]})}async function RE(){const{data:a}=await ye.get("/api/native-services");return a}async function CE(a){const{data:l}=await ye.post(`/api/native-services/${a}/restart`);return l}async function _E(a){const{data:l}=await ye.post(`/api/native-services/${a}/stop`);return l}async function ME(a){const{data:l}=await ye.post(`/api/native-services/${a}/uninstall`);return l}async function AE(a,l="stderr",i=200){const{data:o}=await ye.get(`/api/native-services/${a}/logs`,{params:{stream:l,lines:i}});return o}const yo=["native-services"];function kE(){return zt({queryKey:yo,queryFn:RE,staleTime:5e3,refetchInterval:5e3})}function OE(){const a=vt();return jt({mutationFn:l=>CE(l),onSuccess:()=>a.invalidateQueries({queryKey:yo})})}function zE(){const a=vt();return jt({mutationFn:l=>_E(l),onSuccess:()=>a.invalidateQueries({queryKey:yo})})}function DE(){const a=vt();return jt({mutationFn:l=>ME(l),onSuccess:()=>a.invalidateQueries({queryKey:yo})})}function LE(a,l,i){return zt({queryKey:["native-services-logs",a,l],queryFn:()=>AE(a,l,200),enabled:i,staleTime:3e3,refetchInterval:i?3e3:!1})}function UE(){const{data:a,isLoading:l,isError:i,error:o,refetch:d,isFetching:f}=kE();return l?s.jsx("div",{className:"p-6",children:s.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"Loading native services…"})}):i?s.jsx("div",{className:"p-6",children:s.jsx(qE,{message:o instanceof Error?o.message:String(o)})}):a?a.supported?s.jsxs("div",{className:"p-6",children:[s.jsxs("header",{className:"mb-4 flex items-start justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"Native Services"}),s.jsxs("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:["macOS LaunchAgents — these services run outside Docker so they can use the Apple GPU (MLX / Metal / MPS). Status reflects ",s.jsx("code",{children:"launchctl print"}),"."]})]}),s.jsxs("button",{type:"button",onClick:()=>d(),disabled:f,className:te("flex items-center gap-2 rounded-lg border border-[var(--color-border)] px-3 py-1.5 text-sm","hover:bg-[var(--color-surface-alt)] transition-colors",f&&"opacity-50"),children:[s.jsx(Ct,{size:14,className:f?"animate-spin":""}),"Refresh"]})]}),a.services.length===0?s.jsx("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:s.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"No native-capable services are registered. Re-run the install wizard to add them."})}):s.jsx("div",{className:"space-y-3",children:a.services.map(m=>s.jsx(BE,{service:m},m.id))})]}):s.jsxs("div",{className:"p-6",children:[s.jsxs("header",{className:"mb-4",children:[s.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"Native Services"}),s.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"Manage Jarvis services running as macOS LaunchAgents."})]}),s.jsx("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:s.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"Native services are only available on macOS. On Linux all services run in Docker."})})]}):null}function BE({service:a}){const l=OE(),i=zE(),o=DE(),[d,f]=S.useState(!1),[m,v]=S.useState("stderr"),g=LE(a.id,m,d),{status:p}=a;async function y(j,E){try{await j,ze.success(E)}catch(R){ze.error(R instanceof Error?R.message:String(R))}}async function x(){confirm(`Uninstall ${a.id}? The LaunchAgent will be removed; source files at ${p.sourceDir??"~/.jarvis/native"} stay on disk.`)&&await y(o.mutateAsync(a.id),`${a.id} uninstalled`)}const N=p.installed?p.running?`Running (pid ${p.pid??"?"})`:"Installed, stopped":"Not installed",A=p.installed?p.running?"bg-green-500":"bg-amber-500":"bg-[var(--color-text-muted)]/30";return s.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:te("h-2.5 w-2.5 shrink-0 rounded-full",A)}),s.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:a.name}),s.jsxs("span",{className:"text-xs text-[var(--color-text-muted)]",children:[":",p.port??a.port]}),s.jsx("code",{className:"text-xs text-[var(--color-text-muted)]",children:p.label})]}),s.jsxs("p",{className:"ml-5 mt-0.5 text-xs text-[var(--color-text-muted)]",children:[N,p.sourceDir&&s.jsxs("span",{className:"ml-2 opacity-60",children:["· ",p.sourceDir]})]})]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[p.installed&&s.jsxs(s.Fragment,{children:[p.running?s.jsx(hs,{icon:jj,label:"Stop",onClick:()=>y(i.mutateAsync(a.id),`${a.id} stopped`),disabled:i.isPending}):s.jsx(hs,{icon:Iv,label:"Start",onClick:()=>y(l.mutateAsync(a.id),`${a.id} started`),disabled:l.isPending}),p.running&&s.jsx(hs,{icon:Bd,label:"Restart",onClick:()=>y(l.mutateAsync(a.id),`${a.id} restarted`),disabled:l.isPending}),s.jsx(hs,{icon:Jv,label:d?"Hide logs":"Logs",onClick:()=>f(j=>!j)}),s.jsx(hs,{icon:go,label:"Uninstall",onClick:x,disabled:o.isPending,danger:!0})]}),!p.installed&&s.jsxs("span",{className:"flex items-center gap-1 text-xs text-[var(--color-text-muted)]",children:[s.jsx(kn,{size:12})," Re-run install wizard to enable"]})]})]}),d&&p.installed&&s.jsxs("div",{className:"border-t border-[var(--color-border)] bg-[var(--color-background)] p-3",children:[s.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[s.jsx(Bx,{active:m==="stderr",onClick:()=>v("stderr"),children:"stderr"}),s.jsx(Bx,{active:m==="stdout",onClick:()=>v("stdout"),children:"stdout"}),s.jsx("code",{className:"ml-2 text-xs text-[var(--color-text-muted)] opacity-60",children:g.data?.file})]}),s.jsx("pre",{className:"max-h-80 overflow-auto whitespace-pre-wrap rounded bg-[var(--color-surface-alt)] p-2 text-xs font-mono text-[var(--color-text)]",children:g.isLoading?"Loading…":g.isError?`Failed to load logs: ${g.error instanceof Error?g.error.message:String(g.error)}`:g.data?.content||"(empty)"})]})]})}function hs({icon:a,label:l,onClick:i,disabled:o,danger:d}){return s.jsxs("button",{type:"button",onClick:i,disabled:o,className:te("flex items-center gap-1.5 rounded-md border px-2.5 py-1 text-xs","transition-colors disabled:cursor-not-allowed disabled:opacity-50",d?"border-red-500/30 text-red-500 hover:bg-red-500/10":"border-[var(--color-border)] text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)] hover:text-[var(--color-text)]"),children:[s.jsx(a,{size:12}),l]})}function Bx({active:a,onClick:l,children:i}){return s.jsx("button",{type:"button",onClick:l,className:te("rounded px-2 py-0.5 text-xs",a?"bg-[var(--color-primary)] text-white":"border border-[var(--color-border)] text-[var(--color-text-muted)] hover:text-[var(--color-text)]"),children:i})}function qE({message:a}){return s.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-red-500/30 bg-red-500/10 px-3 py-2 text-sm text-red-500",children:[s.jsx(Dd,{size:14}),a]})}async function HE(){const{data:a}=await ye.get("/api/models/installed");return a.models}async function GE(a){const{data:l}=await ye.post("/api/models/download",a);return l}async function QE(a){await ye.delete(`/api/models/${encodeURIComponent(a)}`)}function VE(){return zt({queryKey:["models","installed"],queryFn:HE,staleTime:1e4})}function gg(){const a=vt();return jt({mutationFn:l=>GE(l),onSuccess:()=>{a.invalidateQueries({queryKey:["models","installed"]})}})}function FE(){const a=vt();return jt({mutationFn:l=>QE(l),onSuccess:()=>{a.invalidateQueries({queryKey:["models","installed"]})}})}const rl=[{id:"qwen3-4b",displayName:"Qwen 3 4B",hfRepoVllm:"Qwen/Qwen3-4B-AWQ",hfRepoGguf:"Qwen/Qwen3-4B-GGUF",ggufFilename:"Qwen3-4B-Q4_K_M.gguf",chatFormat:"qwen3",contextWindow:40960,sizeVllm:"2.5GB",sizeGguf:"2.5GB",vramMb:4096,gated:!1,quantization:"awq",promptProvider:"Qwen25MediumUntrained"},{id:"qwen3-8b",displayName:"Qwen 3 8B",hfRepoVllm:"Qwen/Qwen3-8B-AWQ",hfRepoGguf:"Qwen/Qwen3-8B-GGUF",ggufFilename:"Qwen3-8B-Q4_K_M.gguf",chatFormat:"qwen3",contextWindow:40960,sizeVllm:"5.7GB",sizeGguf:"5GB",vramMb:7168,gated:!1,quantization:"awq",promptProvider:"Qwen25MediumUntrained"},{id:"qwen3-14b",displayName:"Qwen 3 14B",hfRepoVllm:"Qwen/Qwen3-14B-AWQ",hfRepoGguf:"Qwen/Qwen3-14B-GGUF",ggufFilename:"Qwen3-14B-Q4_K_M.gguf",chatFormat:"qwen3",contextWindow:40960,sizeVllm:"9.4GB",sizeGguf:"9GB",vramMb:12288,gated:!1,quantization:"awq",promptProvider:"Qwen3LargeUntrained"},{id:"qwen25-7b",displayName:"Qwen 2.5 7B Instruct",hfRepoVllm:"Qwen/Qwen2.5-7B-Instruct-AWQ",hfRepoGguf:"Qwen/Qwen2.5-7B-Instruct-GGUF",ggufFilename:"qwen2.5-7b-instruct-q4_k_m.gguf",chatFormat:"chatml",contextWindow:32768,sizeVllm:"4.7GB",sizeGguf:"4.7GB",vramMb:6144,gated:!1,quantization:"awq",promptProvider:"Qwen25MediumUntrained"},{id:"llama-3.1-8b",displayName:"Llama 3.1 8B Instruct",hfRepoVllm:"hugging-quants/Meta-Llama-3.1-8B-Instruct-AWQ-INT4",hfRepoGguf:"lmstudio-community/Meta-Llama-3.1-8B-Instruct-GGUF",ggufFilename:"Meta-Llama-3.1-8B-Instruct-Q4_K_M.gguf",chatFormat:"llama-3",contextWindow:131072,sizeVllm:"5.4GB",sizeGguf:"5GB",vramMb:7168,gated:!1,quantization:"awq",promptProvider:"Llama31MediumUntrained"},{id:"hermes-3-8b",displayName:"Hermes 3 Llama 3.1 8B",hfRepoVllm:"solidrust/Hermes-3-Llama-3.1-8B-AWQ",hfRepoGguf:"NousResearch/Hermes-3-Llama-3.1-8B-GGUF",ggufFilename:"Hermes-3-Llama-3.1-8B.Q4_K_M.gguf",chatFormat:"chatml",contextWindow:131072,sizeVllm:"5.4GB",sizeGguf:"4.9GB",vramMb:7168,gated:!1,quantization:"awq",promptProvider:"HermesMediumUntrained"}];function YE(){const[a,l]=S.useState(""),[i,o]=S.useState(""),[d,f]=S.useState(""),[m,v]=S.useState(null),{data:g,isLoading:p}=VE(),y=gg(),x=FE();function N(E,R){const O=`${E}/${R??""}`;v(O),y.mutate({repo:E,filename:R||void 0,token:a||void 0},{onSuccess:M=>{ze.success(M.message),v(null)},onError:M=>{ze.error(M instanceof Error?M.message:"Download failed"),v(null)}})}function A(E){confirm(`Delete ${E}?`)&&x.mutate(E,{onSuccess:()=>ze.success(`Deleted ${E}`),onError:()=>ze.error("Failed to delete")})}function j(){i&&N(i,d)}return s.jsxs("div",{className:"mx-auto max-w-4xl space-y-8 p-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"Models"}),s.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"Manage LLM models on the inference server"})]}),s.jsxs("section",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx(IN,{size:16,className:"text-[var(--color-text-muted)]"}),s.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"HuggingFace Token"}),s.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"(optional, for gated models)"})]}),s.jsx("input",{type:"password",value:a,onChange:E=>l(E.target.value),placeholder:"hf_...",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]}),s.jsxs("section",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[s.jsx(Ld,{size:16,className:"text-[var(--color-text-muted)]"}),s.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"Installed Models"})]}),p?s.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"Loading..."}):g?.length?s.jsx("div",{className:"space-y-2",children:g.map(E=>s.jsxs("div",{className:"flex items-center justify-between rounded-md border border-[var(--color-border)] px-3 py-2",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:E.name}),s.jsx("span",{className:"ml-2 text-xs text-[var(--color-text-muted)]",children:E.sizeFormatted})]}),s.jsx("button",{onClick:()=>A(E.name),disabled:x.isPending,className:"rounded p-1 text-[var(--color-text-muted)] hover:bg-red-500/10 hover:text-red-500",children:s.jsx(go,{size:14})})]},E.name))}):s.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"No models installed yet"})]}),s.jsxs("section",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[s.jsx(Sj,{size:16,className:"text-[var(--color-text-muted)]"}),s.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"Suggested Models"})]}),s.jsx("div",{className:"space-y-3",children:rl.map(E=>{const R=g?.some(O=>O.name===E.ggufFilename||O.name.includes(E.ggufFilename));return s.jsxs("div",{className:"flex items-center justify-between rounded-md border border-[var(--color-border)] px-4 py-3",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:E.displayName}),s.jsxs("span",{className:"rounded bg-[var(--color-surface-alt)] px-1.5 py-0.5 text-xs text-[var(--color-text-muted)]",children:["~",E.sizeGguf]}),R&&s.jsx("span",{className:"rounded bg-green-500/10 px-1.5 py-0.5 text-xs text-green-500",children:"installed"})]}),s.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:[E.hfRepoGguf," / ",E.ggufFilename]}),s.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["Prompt provider: ",s.jsx("code",{className:"text-[var(--color-primary)]",children:E.promptProvider})]})]}),s.jsxs("button",{onClick:()=>N(E.hfRepoGguf,E.ggufFilename),disabled:m!==null,className:te("ml-4 flex items-center gap-1 rounded-md px-3 py-1.5 text-sm font-medium transition-colors",R?"border border-[var(--color-border)] text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]":"bg-[var(--color-primary)] text-white hover:opacity-90"),children:[s.jsx(xs,{size:14}),m===`${E.hfRepoGguf}/${E.ggufFilename}`?"Downloading...":R?"Re-download":"Download"]})]},E.id)})})]}),s.jsxs("section",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[s.jsx(xs,{size:16,className:"text-[var(--color-text-muted)]"}),s.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"Download from HuggingFace"})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Repository (e.g. Qwen/Qwen3-14B-GGUF)"}),s.jsx("input",{value:i,onChange:E=>o(E.target.value),placeholder:"owner/repo-name",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Filename (optional — downloads specific file instead of full repo)"}),s.jsx("input",{value:d,onChange:E=>f(E.target.value),placeholder:"model-name.gguf",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]}),s.jsxs("button",{onClick:j,disabled:!i||m!==null,className:"flex items-center gap-2 rounded-md bg-[var(--color-primary)] px-4 py-2 text-sm font-medium text-white transition-colors hover:opacity-90 disabled:opacity-50",children:[s.jsx(xs,{size:14}),m===`${i}/${d}`?"Downloading...":"Download"]})]})]})]})}async function XE(){const{data:a}=await ye.get("/api/quick-sets");return a}async function KE(a){const{data:l}=await ye.post("/api/quick-sets/apply",a);return l}async function ZE(a){const{data:l}=await ye.post("/api/quick-sets/custom",a);return l}async function $E(a){const{data:l}=await ye.delete(`/api/quick-sets/custom/${a}`);return l}function JE(){return zt({queryKey:["quick-sets"],queryFn:XE,staleTime:6e4})}function PE(){const a=vt();return jt({mutationFn:l=>KE(l),onSuccess:()=>{a.invalidateQueries({queryKey:["quick-sets"]}),a.invalidateQueries({queryKey:["settings"]}),a.invalidateQueries({queryKey:["llm-status"]}),a.invalidateQueries({queryKey:["containers"]})}})}function IE(){const a=vt();return jt({mutationFn:l=>ZE(l),onSuccess:()=>{a.invalidateQueries({queryKey:["quick-sets"]})}})}function WE(){const a=vt();return jt({mutationFn:l=>$E(l),onSuccess:()=>{a.invalidateQueries({queryKey:["quick-sets"]})}})}const qx=["GGUF","MLX","VLLM","TRANSFORMERS","REST"];function e4(){const{data:a,isLoading:l,error:i}=JE(),o=PE(),d=IE(),f=WE(),[m,v]=S.useState(null),[g,p]=S.useState(""),[y,x]=S.useState(""),[N,A]=S.useState(""),[j,E]=S.useState(""),[R,O]=S.useState(""),[M,V]=S.useState(new Set(["live"])),[U,ne]=S.useState(!1),[W,$]=S.useState(""),[G,se]=S.useState(""),[je,he]=S.useState(""),[me,Re]=S.useState(""),[Ce,ee]=S.useState("GGUF"),[w,Q]=S.useState(8192),F=a?.presets,xe=S.useMemo(()=>{if(!F)return new Map;const Z=new Map;for(const ie of F){const oe=ie.family||"Custom",B=Z.get(oe)??[];B.push(ie),Z.set(oe,B)}return Z},[F]);function ve(Z){if(m===Z.id){v(null);return}v(Z.id),p(a?.currentValues.modelName??""),A(Z.defaultBackend),E(Z.chatFormat),O(Z.promptProvider);const ie=a?.currentValues.contextWindow;x(ie&&ie>0?ie:Z.defaultContextWindow)}function C(Z){V(ie=>{const oe=new Set(ie);return oe.has(Z)?oe.size>1&&oe.delete(Z):oe.add(Z),oe})}function Y(){!m||!g.trim()||o.mutate({presetId:m,modelName:g.trim(),contextWindow:y?Number(y):void 0,backend:N,chatFormat:j,promptProvider:R,targets:Array.from(M)},{onSuccess:Z=>{Z.success?ze.success(Z.message):ze.warning(Z.message),v(null)},onError:Z=>{ze.error(Z.message||"Failed to apply preset")}})}function X(){!W.trim()||!je.trim()||!me.trim()||d.mutate({name:W.trim(),family:G.trim()||"Custom",chatFormat:je.trim(),promptProvider:me.trim(),defaultBackend:Ce,defaultContextWindow:w?Number(w):8192},{onSuccess:()=>{ze.success(`Created preset "${W.trim()}"`),ne(!1),$(""),se(""),he(""),Re(""),ee("GGUF"),Q(8192)},onError:Z=>{ze.error(Z.message||"Failed to create preset")}})}function I(Z){f.mutate(Z.id,{onSuccess:()=>{ze.success(`Deleted "${Z.name}"`),m===Z.id&&v(null)},onError:()=>ze.error("Failed to delete preset")})}const le=a?.presets.find(Z=>Z.id===m);return s.jsxs("div",{className:"mx-auto max-w-4xl space-y-8 p-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"Quick Sets"}),s.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"Select a model preset to auto-configure chat format, prompt provider, and backend"})]}),a?.currentValues.modelName&&s.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] px-4 py-3",children:[s.jsx(kn,{size:16,className:"text-[var(--color-primary)]"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"Current model"}),s.jsx("p",{className:"truncate text-sm font-medium text-[var(--color-text)]",children:a.currentValues.modelName})]}),a.currentValues.contextWindow>0&&s.jsxs("span",{className:"rounded bg-[var(--color-surface-alt)] px-2 py-0.5 text-xs text-[var(--color-text-muted)]",children:[a.currentValues.contextWindow.toLocaleString()," ctx"]})]}),l&&s.jsx("div",{className:"flex items-center justify-center py-12",children:s.jsx(Ct,{size:20,className:"animate-spin text-[var(--color-text-muted)]"})}),i&&s.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-red-500/30 bg-red-500/5 px-4 py-3",children:[s.jsx(na,{size:16,className:"text-red-500"}),s.jsx("span",{className:"text-sm text-red-500",children:"Failed to load presets"})]}),!l&&Array.from(xe.entries()).map(([Z,ie])=>s.jsxs("section",{children:[s.jsx("h2",{className:"mb-3 text-sm font-semibold text-[var(--color-text-muted)]",children:Z}),s.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:ie.map(oe=>s.jsxs("div",{className:te("relative rounded-lg border px-4 py-3 transition-colors",m===oe.id?"border-[var(--color-primary)] bg-[var(--color-primary)]/5":"border-[var(--color-border)] bg-[var(--color-surface)] hover:bg-[var(--color-surface-alt)]"),children:[s.jsxs("button",{onClick:()=>ve(oe),className:"w-full text-left",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:oe.name}),m===oe.id&&s.jsx(xo,{size:16,className:"text-[var(--color-primary)]"})]}),oe.description&&s.jsx("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:oe.description}),s.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[s.jsx("span",{className:"rounded bg-[var(--color-surface-alt)] px-1.5 py-0.5 text-xs text-[var(--color-text-muted)]",children:oe.chatFormat}),s.jsx("span",{className:"rounded bg-[var(--color-surface-alt)] px-1.5 py-0.5 text-xs text-[var(--color-text-muted)]",children:oe.defaultBackend})]})]}),oe.isCustom&&s.jsx("button",{onClick:()=>I(oe),disabled:f.isPending,className:"absolute right-2 top-2 rounded p-1 text-[var(--color-text-muted)] hover:bg-red-500/10 hover:text-red-500",title:"Delete custom preset",children:s.jsx(go,{size:14})})]},oe.id))})]},Z)),!l&&!U&&s.jsxs("button",{onClick:()=>ne(!0),className:"flex items-center gap-2 rounded-lg border border-dashed border-[var(--color-border)] px-4 py-3 text-sm text-[var(--color-text-muted)] transition-colors hover:border-[var(--color-primary)] hover:text-[var(--color-primary)]",children:[s.jsx(eo,{size:16}),"Create custom preset"]}),U&&s.jsxs("section",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[s.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(eo,{size:16,className:"text-[var(--color-primary)]"}),s.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"New Custom Preset"})]}),s.jsx("button",{onClick:()=>ne(!1),className:"rounded p-1 text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]",children:s.jsx(Hd,{size:16})})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsxs("div",{children:[s.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Name *"}),s.jsx("input",{type:"text",value:W,onChange:Z=>$(Z.target.value),placeholder:"My Custom Model",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Family"}),s.jsx("input",{type:"text",value:G,onChange:Z=>se(Z.target.value),placeholder:"Custom",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsxs("div",{children:[s.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Chat format *"}),s.jsx("input",{type:"text",value:je,onChange:Z=>he(Z.target.value),placeholder:"chatml",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Prompt provider *"}),s.jsx("input",{type:"text",value:me,onChange:Z=>Re(Z.target.value),placeholder:"Qwen25MediumUntrained",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsxs("div",{children:[s.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Default backend"}),s.jsx("select",{value:Ce,onChange:Z=>ee(Z.target.value),className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)]",children:qx.map(Z=>s.jsx("option",{value:Z,children:Z},Z))})]}),s.jsxs("div",{children:[s.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Default context window"}),s.jsx("input",{type:"number",value:w,onChange:Z=>Q(Z.target.value?parseInt(Z.target.value,10):""),placeholder:"8192",min:1,className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]})]}),s.jsxs("div",{className:"flex items-center gap-3 pt-1",children:[s.jsxs("button",{onClick:X,disabled:!W.trim()||!je.trim()||!me.trim()||d.isPending,className:"flex items-center gap-2 rounded-md bg-[var(--color-primary)] px-4 py-2 text-sm font-medium text-white transition-colors hover:opacity-90 disabled:opacity-50",children:[d.isPending?s.jsx(Ct,{size:14,className:"animate-spin"}):s.jsx(eo,{size:14}),d.isPending?"Creating...":"Create Preset"]}),s.jsx("button",{onClick:()=>ne(!1),className:"rounded-md px-3 py-2 text-sm text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]",children:"Cancel"})]})]})]}),le&&s.jsxs("section",{className:"rounded-lg border border-[var(--color-primary)]/30 bg-[var(--color-surface)] p-4",children:[s.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[s.jsx(so,{size:16,className:"text-[var(--color-primary)]"}),s.jsxs("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:["Apply: ",le.name]})]}),s.jsxs("div",{className:"mb-4",children:[s.jsx("span",{className:"mb-2 block text-xs font-medium text-[var(--color-text-muted)]",children:"Apply to"}),s.jsx("div",{className:"flex items-center gap-4",children:["live","background"].map(Z=>s.jsxs("label",{className:"flex items-center gap-2 text-sm text-[var(--color-text)]",children:[s.jsx("input",{type:"checkbox",checked:M.has(Z),onChange:()=>C(Z),className:"rounded border-[var(--color-border)] accent-[var(--color-primary)]"}),s.jsx("span",{className:"capitalize",children:Z})]},Z))})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Model file path"}),s.jsx("input",{type:"text",value:g,onChange:Z=>p(Z.target.value),placeholder:".models/model-name.gguf",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsxs("div",{children:[s.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Chat format"}),s.jsx("input",{type:"text",value:j,onChange:Z=>E(Z.target.value),placeholder:"chatml",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Prompt provider"}),s.jsx("input",{type:"text",value:R,onChange:Z=>O(Z.target.value),placeholder:"Qwen25MediumUntrained",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsxs("div",{children:[s.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Context window (tokens)"}),s.jsx("input",{type:"number",value:y,onChange:Z=>x(Z.target.value?parseInt(Z.target.value,10):""),placeholder:String(le.defaultContextWindow),min:1,className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Backend"}),s.jsx("select",{value:N,onChange:Z=>A(Z.target.value),className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 text-sm text-[var(--color-text)]",children:qx.map(Z=>s.jsx("option",{value:Z,children:Z},Z))})]})]})]}),s.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[s.jsxs("button",{onClick:Y,disabled:!g.trim()||o.isPending,className:"flex items-center gap-2 rounded-md bg-[var(--color-primary)] px-4 py-2 text-sm font-medium text-white transition-colors hover:opacity-90 disabled:opacity-50",children:[o.isPending?s.jsx(Ct,{size:14,className:"animate-spin"}):s.jsx(so,{size:14}),o.isPending?"Applying...":"Apply Settings"]}),s.jsx("button",{onClick:()=>v(null),className:"rounded-md px-3 py-2 text-sm text-[var(--color-text-muted)] hover:bg-[var(--color-surface-alt)]",children:"Cancel"})]})]})]})}const Ku={preflight:"Checking prerequisites",download:"Downloading update",binary:"Updating binary",restarting:"Restarting admin server",compose:"Updating configuration",pull:"Pulling images",restart:"Restarting services",verify:"Verifying health",done:"Complete"};function t4(){const a=wa(),{data:l,isLoading:i}=vg(),[o,d]=S.useState("idle"),[f,m]=S.useState([]),[v,g]=S.useState(null),p=S.useRef(null),y=S.useCallback(A=>{m(j=>[...j,A])},[]);S.useEffect(()=>{p.current&&(p.current.scrollTop=p.current.scrollHeight)},[f]);async function x(){d("preflight"),m([]),g(null);try{const A=localStorage.getItem("jarvis-admin:access_token")??localStorage.getItem("access_token"),j=await fetch("/api/update/apply",{method:"POST",headers:{Authorization:`Bearer ${A}`}});if(!j.ok||!j.body){const M=await j.text();throw new Error(M||`HTTP ${j.status}`)}const E=j.body.getReader(),R=new TextDecoder;let O="";for(;;){const{done:M,value:V}=await E.read();if(M)break;O+=R.decode(V,{stream:!0});const U=O.split(`
17
+ `);O=U.pop()??"";for(const ne of U)if(ne.startsWith("data: "))try{const W=JSON.parse(ne.slice(6));if(W.phase&&d(W.phase),W.message&&y({text:W.message,phase:W.phase}),W.stream&&W.text&&y({text:W.text.trim()}),W.restart){d("restarting"),y({text:"Admin server restarting with new version..."}),await a4(l?.latestVersion??""),d("done"),y({text:"Upgrade complete!"});return}if(W.done&&W.code!==0)throw new Error(W.error??"Upgrade failed");W.done&&W.code===0&&d("done")}catch(W){if(W instanceof SyntaxError)continue;throw W}}}catch(A){const j=A instanceof Error?A.message:String(A);g(j),d("error"),y({text:`Error: ${j}`})}}if(i)return s.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:s.jsx(aa,{size:24,className:"animate-spin text-[var(--color-primary)]"})});const N=Object.keys(Ku).filter(A=>{const j=Object.keys(Ku),E=j.indexOf(o);return j.indexOf(A)<E});return s.jsxs("div",{className:"mx-auto max-w-3xl space-y-6 p-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"Update Jarvis"}),l?.updateAvailable?s.jsxs("p",{className:"text-sm text-[var(--color-text-muted)]",children:["v",l.currentVersion," → v",l.latestVersion]}):s.jsxs("p",{className:"text-sm text-[var(--color-text-muted)]",children:["You're running the latest version (v",l?.currentVersion??"?",")"]})]}),o!=="idle"&&s.jsx("div",{className:"space-y-2 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:Object.entries(Ku).map(([A,j])=>{const E=A===o,R=N.includes(A),O=A===o&&o==="error";return s.jsxs("div",{className:"flex items-center gap-2",children:[R?s.jsx(xt,{size:16,className:"text-green-500"}):O?s.jsx(na,{size:16,className:"text-red-500"}):E?s.jsx(aa,{size:16,className:"animate-spin text-[var(--color-primary)]"}):s.jsx("div",{className:"h-4 w-4 rounded-full border border-[var(--color-border)]"}),s.jsx("span",{className:te("text-sm",E?"font-medium text-[var(--color-text)]":"text-[var(--color-text-muted)]",R&&"text-green-500"),children:j})]},A)})}),f.length>0&&s.jsx("div",{ref:p,className:"max-h-64 overflow-y-auto rounded-lg border border-[var(--color-border)] bg-[#0d1117] p-3 font-mono text-xs text-gray-300",children:f.map((A,j)=>s.jsx("div",{children:A.text},j))}),v&&s.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-red-500/10 px-3 py-2",children:[s.jsx(na,{size:14,className:"text-red-500"}),s.jsx("span",{className:"text-sm text-red-500",children:v})]}),s.jsxs("div",{className:"flex gap-3",children:[o==="idle"&&l?.updateAvailable&&s.jsxs("button",{onClick:x,className:"flex items-center gap-2 rounded-lg bg-green-600 px-4 py-2 text-sm font-medium text-white hover:opacity-90",children:[s.jsx(Zv,{size:16}),"Update to v",l.latestVersion]}),o==="done"&&s.jsxs("button",{onClick:()=>a("/dashboard"),className:"flex items-center gap-2 rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm font-medium text-white hover:opacity-90",children:[s.jsx(xt,{size:16}),"Go to Dashboard"]}),o==="error"&&s.jsxs("button",{onClick:x,className:"flex items-center gap-2 rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm font-medium text-white hover:opacity-90",children:[s.jsx(Ct,{size:16}),"Retry"]})]})]})}async function a4(a,l=6e4){const i=Date.now()+l;for(;Date.now()<i;){await new Promise(o=>setTimeout(o,2e3));try{const o=await fetch("/health");if(o.ok){const d=await o.json();if(d.version&&d.version!=="0.0.0-dev")return}}catch{}}throw new Error("Admin server did not restart within 60 seconds")}const Zu={regenerate:"Regenerating compose from registry",pull:"Pulling images for new release track",apply:"Applying changes (docker compose up)",done:"Complete"};function n4(){const a=wa(),l=localStorage.getItem("jarvis-admin:access_token")??localStorage.getItem("access_token"),[i,o]=S.useState("loading_options"),[d,f]=S.useState([]),[m,v]=S.useState(null),g=S.useRef(null),[p,y]=S.useState([]),[x,N]=S.useState(!1),[A,j]=S.useState("https://relay.jarvisautomation.io"),[E,R]=S.useState("/whisper-models/ggml-base.en.bin"),[O,M]=S.useState("stable"),V=S.useCallback($=>{f(G=>[...G,$])},[]);S.useEffect(()=>{g.current&&(g.current.scrollTop=g.current.scrollHeight)},[d]),S.useEffect(()=>{async function $(){try{const G=await fetch("/api/install/reconcile/options",{headers:{Authorization:`Bearer ${l}`}});if(!G.ok)throw new Error(`HTTP ${G.status}`);const se=await G.json();y(se.services),N(se.relayEnabled),j(se.relayUrl||"https://relay.jarvisautomation.io"),R(se.whisperModelPath||"/whisper-models/ggml-base.en.bin"),M(se.releaseTrack??"stable"),o("options")}catch(G){v(G instanceof Error?G.message:"Failed to load options"),o("error")}}$()},[l]);function U($){y(G=>G.map(se=>se.id===$?{...se,enabled:!se.enabled}:se))}async function ne(){o("regenerate"),f([]),v(null);const $=p.filter(G=>G.enabled).map(G=>G.id);try{const G=await fetch("/api/install/reconcile",{method:"POST",headers:{Authorization:`Bearer ${l}`,"Content-Type":"application/json"},body:JSON.stringify({enabledModules:$,relayEnabled:x,relayUrl:A,whisperModelPath:E,releaseTrack:O})});if(!G.ok||!G.body){const me=await G.text();throw new Error(me||`HTTP ${G.status}`)}const se=G.body.getReader(),je=new TextDecoder;let he="";for(;;){const{done:me,value:Re}=await se.read();if(me)break;he+=je.decode(Re,{stream:!0});const Ce=he.split(`
18
+ `);he=Ce.pop()??"";for(const ee of Ce)if(ee.startsWith("data: "))try{const w=JSON.parse(ee.slice(6));if(w.phase&&o(w.phase),w.message&&V({text:w.message,phase:w.phase}),w.stream&&w.text&&V({text:w.text.trim()}),w.done&&w.code!==0)throw new Error(w.message??"Reconcile failed")}catch(w){if(w instanceof SyntaxError)continue;throw w}}}catch(G){const se=G instanceof Error?G.message:String(G);v(se),o("error"),V({text:`Error: ${se}`})}}const W=Object.keys(Zu).filter($=>{const G=Object.keys(Zu),se=G.indexOf(i);return G.indexOf($)<se||i==="done"&&$==="done"});return s.jsxs("div",{className:"mx-auto max-w-3xl space-y-6 p-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"Sync Compose"}),s.jsxs("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:["Regenerate ",s.jsx("code",{className:"rounded bg-[var(--color-surface)] px-1.5 py-0.5 text-xs",children:"docker-compose.yml"})," from the latest service registry and apply changes to the running stack."]})]}),i==="loading_options"&&s.jsx("div",{className:"flex items-center justify-center py-12",children:s.jsx(aa,{size:32,className:"animate-spin text-[var(--color-primary)]"})}),i==="options"&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[s.jsx("h2",{className:"mb-3 text-sm font-semibold text-[var(--color-text)]",children:"Services"}),s.jsx("div",{className:"space-y-2",children:p.map($=>s.jsxs("button",{onClick:()=>U($.id),className:"flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left hover:bg-[var(--color-bg-secondary)] transition-colors",children:[$.enabled?s.jsx(xt,{size:18,className:"shrink-0 text-[var(--color-primary)]"}):s.jsx(sl,{size:18,className:"shrink-0 text-[var(--color-text-muted)]"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-[var(--color-text)]",children:$.name}),s.jsx("div",{className:"text-xs text-[var(--color-text-muted)]",children:$.description})]})]},$.id))})]}),s.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[s.jsx("h2",{className:"mb-3 text-sm font-semibold text-[var(--color-text)]",children:"Release Track"}),s.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-medium text-[var(--color-text)]",children:O==="dev"?"Dev":"Stable"}),s.jsx("div",{className:"text-xs text-[var(--color-text-muted)]",children:O==="dev"?"Using latest main branch builds (may be unstable)":"Using tagged releases"})]}),s.jsx("button",{type:"button",role:"switch","aria-checked":O==="dev",onClick:()=>M(O==="dev"?"stable":"dev"),className:`relative h-6 w-11 shrink-0 rounded-full transition-colors ${O==="dev"?"bg-amber-500":"bg-[var(--color-surface-alt)]"}`,children:s.jsx("span",{className:`absolute left-0.5 top-0.5 h-5 w-5 rounded-full bg-white transition-transform ${O==="dev"?"translate-x-5":"translate-x-0"}`})})]}),O==="dev"&&s.jsx("div",{className:"mx-3 mt-1 rounded-lg border border-amber-300 bg-amber-500/10 px-3 py-2 text-xs text-amber-400",children:"Switching tracks will pull all images and force-recreate containers."})]}),s.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[s.jsx("h2",{className:"mb-3 text-sm font-semibold text-[var(--color-text)]",children:"Integrations"}),s.jsxs("button",{onClick:()=>N(!x),className:"flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left hover:bg-[var(--color-bg-secondary)] transition-colors",children:[x?s.jsx(xt,{size:18,className:"shrink-0 text-[var(--color-primary)]"}):s.jsx(sl,{size:18,className:"shrink-0 text-[var(--color-text-muted)]"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-[var(--color-text)]",children:"Jarvis Relay"}),s.jsx("div",{className:"text-xs text-[var(--color-text-muted)]",children:"Routes OAuth callbacks through a cloud relay for external providers (Google, Spotify, etc.)"})]})]}),x&&s.jsxs("div",{className:"mt-2 px-3",children:[s.jsx("label",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:"Relay URL"}),s.jsx("input",{type:"url",value:A,onChange:$=>j($.target.value),placeholder:"https://relay.jarvisautomation.io",className:"mt-1 w-full rounded-md border border-[var(--color-border)] bg-[var(--color-bg)] px-3 py-1.5 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"})]})]}),p.some($=>$.id==="jarvis-whisper-api"&&$.enabled)&&s.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[s.jsx("h2",{className:"mb-3 text-sm font-semibold text-[var(--color-text)]",children:"Whisper"}),s.jsxs("div",{className:"px-3",children:[s.jsx("label",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:"Model path"}),s.jsx("input",{type:"text",value:E,onChange:$=>R($.target.value),placeholder:"/whisper-models/ggml-base.en.bin",className:"mt-1 w-full rounded-md border border-[var(--color-border)] bg-[var(--color-bg)] px-3 py-1.5 text-sm font-mono text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"}),s.jsxs("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:["Path inside the container. Place model files in ",s.jsx("code",{className:"rounded bg-[var(--color-bg)] px-1",children:"./whisper-models/"})," next to your compose file."]})]})]})]}),i!=="loading_options"&&i!=="options"&&s.jsx("div",{className:"space-y-2 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:Object.entries(Zu).map(([$,G])=>{const se=$===i,je=W.includes($),he=$===i&&i==="error";return s.jsxs("div",{className:"flex items-center gap-2",children:[je?s.jsx(xt,{size:16,className:"text-green-500"}):he?s.jsx(na,{size:16,className:"text-red-500"}):se?s.jsx(aa,{size:16,className:"animate-spin text-[var(--color-primary)]"}):s.jsx("div",{className:"h-4 w-4 rounded-full border border-[var(--color-border)]"}),s.jsx("span",{className:te("text-sm",se?"font-medium text-[var(--color-text)]":"text-[var(--color-text-muted)]",je&&"text-green-500"),children:G})]},$)})}),d.length>0&&s.jsx("div",{ref:g,className:"max-h-64 overflow-y-auto rounded-lg border border-[var(--color-border)] bg-[#0d1117] p-3 font-mono text-xs text-gray-300",children:d.map(($,G)=>s.jsx("div",{children:$.text},G))}),m&&s.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-red-500/10 px-3 py-2",children:[s.jsx(na,{size:14,className:"text-red-500"}),s.jsx("span",{className:"text-sm text-red-500",children:m})]}),s.jsxs("div",{className:"flex gap-3",children:[i==="options"&&s.jsxs("button",{onClick:ne,className:"flex items-center gap-2 rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm font-medium text-white hover:opacity-90",children:[s.jsx(Pv,{size:16}),"Sync now"]}),(i==="options"||i==="regenerate"||i==="apply"||i==="done")&&s.jsxs("button",{onClick:()=>a("/dashboard"),disabled:i==="regenerate"||i==="apply",className:"flex items-center gap-2 rounded-lg border border-[var(--color-border)] px-4 py-2 text-sm font-medium text-[var(--color-text)] hover:bg-[var(--color-surface-alt)] disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent",children:[s.jsx(xt,{size:16}),"Back to dashboard"]}),i==="error"&&s.jsxs("button",{onClick:ne,className:"flex items-center gap-2 rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm font-medium text-white hover:opacity-90",children:[s.jsx(Ct,{size:16}),"Retry"]})]})]})}async function r4(a={}){const{data:l}=await ye.get("/api/traces",{params:a});return l}async function l4(a){const{data:l}=await ye.get(`/api/traces/${a}`);return l}function s4(a){return a<1e3?`${Math.round(a)}ms`:`${(a/1e3).toFixed(1)}s`}function i4(a){return new Date(a).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function o4(){const a=wa(),[l,i]=S.useState(""),[o,d]=S.useState(""),{data:f,isLoading:m,error:v}=zt({queryKey:["traces",l,o],queryFn:()=>r4({limit:100,...l?{status:l}:{},...o?{source:o}:{}}),refetchInterval:1e4});return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"Request Traces"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("select",{className:"rounded border border-[var(--color-border)] bg-[var(--color-surface)] px-2 py-1 text-sm text-[var(--color-text)]",value:l,onChange:g=>i(g.target.value),children:[s.jsx("option",{value:"",children:"All statuses"}),s.jsx("option",{value:"ok",children:"OK"}),s.jsx("option",{value:"error",children:"Error"})]}),s.jsxs("select",{className:"rounded border border-[var(--color-border)] bg-[var(--color-surface)] px-2 py-1 text-sm text-[var(--color-text)]",value:o,onChange:g=>d(g.target.value),children:[s.jsx("option",{value:"",children:"All sources"}),s.jsx("option",{value:"node",children:"Node"}),s.jsx("option",{value:"mobile",children:"Mobile"})]})]})]}),m&&s.jsx("div",{className:"flex justify-center py-12",children:s.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-[var(--color-primary)] border-t-transparent"})}),v&&s.jsx("div",{className:"rounded-lg border border-red-300 bg-red-50 p-4 text-red-700 dark:border-red-700 dark:bg-red-900/20 dark:text-red-400",children:"Failed to load traces"}),f&&s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"text-sm text-[var(--color-text-muted)]",children:[f.total," traces"]}),s.jsx("div",{className:"overflow-x-auto rounded-lg border border-[var(--color-border)]",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-[var(--color-border)] bg-[var(--color-surface-alt)]",children:[s.jsx("th",{className:"px-3 py-2 text-left font-medium text-[var(--color-text-muted)]",children:"Time"}),s.jsx("th",{className:"px-3 py-2 text-left font-medium text-[var(--color-text-muted)]",children:"Source"}),s.jsx("th",{className:"px-3 py-2 text-left font-medium text-[var(--color-text-muted)]",children:"Command"}),s.jsx("th",{className:"px-3 py-2 text-right font-medium text-[var(--color-text-muted)]",children:"Duration"}),s.jsx("th",{className:"px-3 py-2 text-center font-medium text-[var(--color-text-muted)]",children:"Status"}),s.jsx("th",{className:"px-3 py-2 text-right font-medium text-[var(--color-text-muted)]",children:"Spans"})]})}),s.jsxs("tbody",{children:[f.traces.map(g=>s.jsxs("tr",{className:"border-b border-[var(--color-border)] cursor-pointer transition-colors hover:bg-[var(--color-surface-alt)]",onClick:()=>a(`/traces/${g.id}`),children:[s.jsx("td",{className:"px-3 py-2 text-[var(--color-text)] whitespace-nowrap",children:g.created_at?i4(g.created_at):"-"}),s.jsx("td",{className:"px-3 py-2 text-[var(--color-text-muted)]",children:s.jsxs("span",{className:"inline-flex items-center gap-1",children:[g.source==="mobile"?"📱":"🔊",g.source]})}),s.jsx("td",{className:"px-3 py-2 text-[var(--color-text)] max-w-xs truncate",children:g.user_command??"-"}),s.jsx("td",{className:"px-3 py-2 text-right text-[var(--color-text)] tabular-nums",children:s4(g.total_duration_ms)}),s.jsx("td",{className:"px-3 py-2 text-center",children:s.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${g.status==="ok"?"bg-green-500":"bg-red-500"}`})}),s.jsx("td",{className:"px-3 py-2 text-right text-[var(--color-text-muted)] tabular-nums",children:g.span_count})]},g.id)),f.traces.length===0&&s.jsx("tr",{children:s.jsx("td",{colSpan:6,className:"px-3 py-8 text-center text-[var(--color-text-muted)]",children:"No traces yet"})})]})]})})]})]})}function al(a){return a<1e3?`${Math.round(a)}ms`:`${(a/1e3).toFixed(1)}s`}const Hx={cc:"#9e9e9e",llm_proxy:"#42a5f5",node:"#66bb6a",tts:"#ffa726",whisper:"#ab47bc"},Gx={cc:"Command Center",llm_proxy:"LLM Proxy",node:"Node",tts:"TTS",whisper:"Whisper"};function c4(a){const l=a.filter(d=>d.duration_ms>0),i=l.filter(d=>!l.some(f=>f!==d&&d.start_ms<=f.start_ms&&d.end_ms>=f.end_ms&&f.duration_ms>0));i.sort((d,f)=>d.start_ms-f.start_ms);const o=[];for(const d of i){const f=o[o.length-1];f&&f.service===d.service?(f.duration_ms=Math.round((f.duration_ms+d.duration_ms)*10)/10,f.steps.push(d.name),d.status==="error"&&(f.status="error")):o.push({service:d.service,duration_ms:d.duration_ms,status:d.status,steps:[d.name]})}return o}function u4(){const{id:a}=w0(),l=wa(),[i,o]=S.useState(!1),[d,f]=S.useState(null),{data:m,isLoading:v,error:g}=zt({queryKey:["trace",a],queryFn:()=>l4(a),enabled:!!a}),p=S.useMemo(()=>m?c4(m.spans):[],[m]);return v?s.jsx("div",{className:"flex justify-center py-12",children:s.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-[var(--color-primary)] border-t-transparent"})}):g||!m?s.jsxs("div",{className:"space-y-4",children:[s.jsx("button",{className:"text-sm text-[var(--color-primary)] hover:underline",onClick:()=>l("/traces"),children:"Back to traces"}),s.jsx("div",{className:"rounded-lg border border-red-300 bg-red-50 p-4 text-red-700 dark:border-red-700 dark:bg-red-900/20 dark:text-red-400",children:"Trace not found"})]}):s.jsxs("div",{className:"space-y-6",children:[s.jsx("button",{className:"text-sm text-[var(--color-primary)] hover:underline",onClick:()=>l("/traces"),children:"Back to traces"}),s.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-lg font-bold text-[var(--color-text)]",children:m.user_command??"Request Trace"}),s.jsxs("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:[m.source==="mobile"?"📱 Mobile":"🔊 Node",m.node_id&&` (${m.node_id})`," · ",m.request_type," · ",m.created_at?new Date(m.created_at).toLocaleString():""]})]}),s.jsxs("div",{className:"text-right",children:[s.jsx("div",{className:"text-2xl font-bold tabular-nums text-[var(--color-text)]",children:al(m.total_duration_ms)}),s.jsxs("div",{className:"flex items-center justify-end gap-1 mt-1",children:[s.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${m.status==="ok"?"bg-green-500":"bg-red-500"}`}),s.jsx("span",{className:"text-sm text-[var(--color-text-muted)]",children:m.status})]})]})]}),m.error_message&&s.jsx("div",{className:"mt-3 rounded border border-red-300 bg-red-50 p-2 text-sm text-red-700 dark:border-red-700 dark:bg-red-900/20 dark:text-red-400",children:m.error_message}),s.jsx("p",{className:"mt-2 text-xs text-[var(--color-text-muted)] font-mono",children:m.conversation_id})]}),s.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[s.jsx("h2",{className:"mb-3 text-sm font-medium text-[var(--color-text-muted)]",children:"Service Flow"}),s.jsx("p",{className:"mb-4 text-xs text-[var(--color-text-muted)] opacity-60",children:p.map(y=>Gx[y.service]??y.service).join(" → ")}),s.jsx("div",{className:"space-y-2",children:p.map((y,x)=>{const N=Math.min(y.duration_ms/m.total_duration_ms*100,100),A=y.status==="error"?"#ef4444":Hx[y.service]??"#9e9e9e",j=Gx[y.service]??y.service;return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full shrink-0",style:{backgroundColor:A}}),s.jsx("span",{className:"w-32 text-sm text-[var(--color-text)] shrink-0",children:j}),s.jsxs("div",{className:"flex-1 h-6 rounded bg-[var(--color-surface-alt)] relative",children:[s.jsx("div",{className:"absolute top-0 left-0 h-full rounded",style:{width:`${Math.max(N,1)}%`,backgroundColor:A,opacity:.7}}),s.jsx("span",{className:"absolute inset-0 flex items-center px-2 text-xs text-[var(--color-text)] opacity-70",children:y.steps.join(", ")})]}),s.jsx("span",{className:"w-16 text-sm text-[var(--color-text)] text-right tabular-nums shrink-0",children:al(y.duration_ms)})]},`${y.service}-${x}`)})})]}),s.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[s.jsxs("button",{className:"text-sm text-[var(--color-text-muted)] hover:text-[var(--color-text)]",onClick:()=>{o(y=>!y),f(null)},children:[i?"Hide":"Show"," raw spans (",m.spans.length,")"]}),i&&s.jsx("div",{className:"mt-3 space-y-1",children:m.spans.map((y,x)=>{const N=Math.min(y.duration_ms/m.total_duration_ms*100,100),A=y.start_ms/m.total_duration_ms*100,j=y.status==="error"?"#ef4444":Hx[y.service]??"#9e9e9e",E=d===y;return s.jsxs("div",{className:`flex items-center gap-2 cursor-pointer rounded px-1 py-0.5 ${E?"bg-[var(--color-surface-alt)]":""}`,onClick:()=>f(E?null:y),children:[s.jsx("span",{className:"w-36 truncate text-xs text-[var(--color-text-muted)] text-right shrink-0",children:y.name}),s.jsx("div",{className:"flex-1 relative h-4 rounded bg-[var(--color-surface-alt)]",children:s.jsx("div",{className:"absolute top-0 h-full rounded",style:{left:`${A}%`,width:`${Math.max(N,.5)}%`,backgroundColor:j,minWidth:"2px"}})}),s.jsx("span",{className:"w-14 text-xs text-[var(--color-text-muted)] text-right shrink-0 tabular-nums",children:al(y.duration_ms)}),s.jsx("span",{className:"w-16 text-xs text-[var(--color-text-muted)] opacity-60 shrink-0",children:y.service})]},`${y.name}-${x}`)})}),d&&i&&s.jsx("div",{className:"mt-3 border-t border-[var(--color-border)] pt-3",children:s.jsxs("dl",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-sm max-w-md",children:[s.jsx("dt",{className:"text-[var(--color-text-muted)]",children:"Service"}),s.jsx("dd",{className:"text-[var(--color-text)]",children:d.service}),s.jsx("dt",{className:"text-[var(--color-text-muted)]",children:"Duration"}),s.jsx("dd",{className:"text-[var(--color-text)] tabular-nums",children:al(d.duration_ms)}),s.jsx("dt",{className:"text-[var(--color-text-muted)]",children:"Start"}),s.jsx("dd",{className:"text-[var(--color-text)] tabular-nums",children:al(d.start_ms)}),s.jsx("dt",{className:"text-[var(--color-text-muted)]",children:"End"}),s.jsx("dd",{className:"text-[var(--color-text)] tabular-nums",children:al(d.end_ms)}),s.jsx("dt",{className:"text-[var(--color-text-muted)]",children:"Status"}),s.jsx("dd",{className:d.status==="ok"?"text-green-600":"text-red-600",children:d.status}),Object.entries(d.metadata||{}).map(([y,x])=>s.jsxs("div",{className:"contents",children:[s.jsx("dt",{className:"text-[var(--color-text-muted)]",children:y}),s.jsx("dd",{className:"text-[var(--color-text)] tabular-nums",children:String(x)})]},y))]})})]})]})}function d4(){return s.jsxs("div",{className:"flex min-h-[60vh] flex-col items-center justify-center",children:[s.jsx("h1",{className:"mb-2 text-4xl font-bold text-[var(--color-text)]",children:"404"}),s.jsx("p",{className:"mb-4 text-[var(--color-text-muted)]",children:"Page not found"}),s.jsx(jd,{to:"/settings",className:"text-[var(--color-primary)] underline hover:opacity-80",children:"Go to Settings"})]})}const f4=7,m4={currentStep:0,totalSteps:f4,enabledModules:[],portOverrides:{},infraPortOverrides:{},secrets:{},dbUser:"jarvis",whisperModel:"base.en",whisperModelPath:"/whisper-models/ggml-base.en.bin",llmInterface:"Qwen25MediumUntrained",deploymentMode:"local",deploymentTarget:"standard",remoteLlmUrl:"",remoteWhisperUrl:"",platform:"linux",hardware:null,relayEnabled:!1,installRunning:!1,installComplete:!1,nativeServices:[]};function h4(a,l,i){return Math.max(l,Math.min(i,a))}function p4(a,l){switch(l.type){case"SET_STEP":return{...a,currentStep:h4(l.step,0,a.totalSteps-1)};case"NEXT_STEP":return{...a,currentStep:Math.min(a.currentStep+1,a.totalSteps-1)};case"PREV_STEP":return{...a,currentStep:Math.max(a.currentStep-1,0)};case"SET_ENABLED_MODULES":return{...a,enabledModules:l.modules};case"TOGGLE_MODULE":{if(l.enabled){const i=a.enabledModules.includes(l.serviceId)?a.enabledModules:[...a.enabledModules,l.serviceId];return{...a,enabledModules:i}}return{...a,enabledModules:a.enabledModules.filter(i=>i!==l.serviceId)}}case"SET_PORT_OVERRIDE":return{...a,portOverrides:{...a.portOverrides,[l.serviceId]:l.port}};case"SET_INFRA_PORT_OVERRIDE":return{...a,infraPortOverrides:{...a.infraPortOverrides,[l.infraId]:l.port}};case"SET_SECRET":return{...a,secrets:{...a.secrets,[l.name]:l.value}};case"SET_SECRETS":return{...a,secrets:l.secrets};case"SET_DB_USER":return{...a,dbUser:l.user};case"SET_WHISPER_MODEL":return{...a,whisperModel:l.model};case"SET_LLM_INTERFACE":return{...a,llmInterface:l.interfaceId};case"SET_DEPLOYMENT_MODE":return{...a,deploymentMode:l.mode};case"SET_DEPLOYMENT_TARGET":return{...a,deploymentTarget:l.target};case"SET_REMOTE_LLM_URL":return{...a,remoteLlmUrl:l.url};case"SET_REMOTE_WHISPER_URL":return{...a,remoteWhisperUrl:l.url};case"SET_PLATFORM":return{...a,platform:l.platform};case"SET_HARDWARE":return{...a,hardware:l.hardware,platform:l.hardware.platform};case"SET_RELAY_ENABLED":return{...a,relayEnabled:l.enabled};case"SET_INSTALL_RUNNING":return{...a,installRunning:l.running};case"SET_INSTALL_COMPLETE":return{...a,installRunning:!1,installComplete:!0};case"SET_NATIVE_SERVICES":return{...a,nativeServices:l.services};case"TOGGLE_NATIVE_SERVICE":{if(l.enabled){const i=a.nativeServices.includes(l.serviceId)?a.nativeServices:[...a.nativeServices,l.serviceId];return{...a,nativeServices:i}}return{...a,nativeServices:a.nativeServices.filter(i=>i!==l.serviceId)}}default:return a}}const yg=S.createContext(null);function x4({children:a}){const[l,i]=S.useReducer(p4,m4);return s.jsx(yg.Provider,{value:{state:l,dispatch:i},children:a})}function dr(){const a=S.useContext(yg);if(!a)throw new Error("useWizard must be used within a WizardProvider");return a}function v4(){const{state:a,dispatch:l}=dr(),[i,o]=S.useState(null),[d,f]=S.useState(!0),[m,v]=S.useState(!1);function g(){f(!0),v(!1),Qd().then(y=>{o(y);const x=y.reason==="docker_not_found";v(x),l(x?{type:"SET_INSTALL_RUNNING",running:!0}:{type:"SET_INSTALL_RUNNING",running:!1})}).catch(()=>{o({configured:!1,reason:"error"}),v(!0),l({type:"SET_INSTALL_RUNNING",running:!0})}).finally(()=>f(!1))}S.useEffect(()=>{g()},[]);const p=i&&i.reason!=="docker_not_found";return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Welcome to Jarvis"}),s.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"Let's get your personal voice assistant up and running. This wizard will guide you through selecting services, configuring hardware, and starting everything up."})]}),s.jsx("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:s.jsxs("div",{className:"flex items-center gap-3",children:[d?s.jsx(aa,{size:20,className:"animate-spin text-[var(--color-primary)]"}):p?s.jsx(xt,{size:20,className:"text-green-500"}):s.jsx(Dd,{size:20,className:"text-red-500"}),s.jsxs("div",{className:"flex-1",children:[s.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:d?"Checking Docker...":p?"Docker is running":"Docker not found"}),!d&&!p&&s.jsxs("div",{className:"mt-1 space-y-1",children:[s.jsx("p",{className:"text-xs text-red-400",children:"Docker is required to run Jarvis services."}),s.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["Install"," ",s.jsx("a",{href:"https://www.docker.com/products/docker-desktop/",target:"_blank",rel:"noopener noreferrer",className:"text-[var(--color-primary)] underline hover:no-underline",children:"Docker Desktop"})," ","for your platform, start it, then click Retry."]})]})]}),m&&!d&&s.jsxs("button",{type:"button",onClick:g,className:"flex items-center gap-1 rounded-md border border-[var(--color-border)] px-2 py-1 text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:[s.jsx(vo,{size:12}),"Retry"]})]})}),s.jsxs("div",{children:[s.jsx("label",{className:"mb-2 block text-sm font-medium text-[var(--color-text)]",children:"Deployment Mode"}),s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsxs("button",{type:"button",onClick:()=>l({type:"SET_DEPLOYMENT_MODE",mode:"local"}),className:te("flex flex-col items-center gap-2 rounded-lg border p-4 transition-colors",a.deploymentMode==="local"?"border-[var(--color-primary)] bg-[var(--color-primary)]/10":"border-[var(--color-border)] hover:border-[var(--color-primary)]/50"),children:[s.jsx(sj,{size:24,className:"text-[var(--color-primary)]"}),s.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:"Local"}),s.jsx("span",{className:"text-xs text-center text-[var(--color-text-muted)]",children:"Everything on this machine"})]}),s.jsxs("button",{type:"button",onClick:()=>l({type:"SET_DEPLOYMENT_MODE",mode:"remote-llm"}),className:te("flex flex-col items-center gap-2 rounded-lg border p-4 transition-colors",a.deploymentMode==="remote-llm"?"border-[var(--color-primary)] bg-[var(--color-primary)]/10":"border-[var(--color-border)] hover:border-[var(--color-primary)]/50"),children:[s.jsx(qd,{size:24,className:"text-[var(--color-primary)]"}),s.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:"Remote LLM"}),s.jsx("span",{className:"text-xs text-center text-[var(--color-text-muted)]",children:"LLM on separate GPU machine"})]})]})]})]})}const Ki=[{label:"None / CPU only",gpu:null,gpuType:"none",vramMb:null,backends:["gguf"],defaultBackend:"gguf"},{label:"NVIDIA RTX 4090 (24 GB)",gpu:"NVIDIA RTX 4090",gpuType:"nvidia",vramMb:24576,backends:["gguf","vllm"],defaultBackend:"gguf"},{label:"NVIDIA RTX 4080 (16 GB)",gpu:"NVIDIA RTX 4080",gpuType:"nvidia",vramMb:16384,backends:["gguf","vllm"],defaultBackend:"gguf"},{label:"NVIDIA RTX 4070 Ti (12 GB)",gpu:"NVIDIA RTX 4070 Ti",gpuType:"nvidia",vramMb:12288,backends:["gguf","vllm"],defaultBackend:"gguf"},{label:"NVIDIA RTX 3090 (24 GB)",gpu:"NVIDIA RTX 3090",gpuType:"nvidia",vramMb:24576,backends:["gguf","vllm"],defaultBackend:"gguf"},{label:"NVIDIA RTX 3080 (10 GB)",gpu:"NVIDIA RTX 3080",gpuType:"nvidia",vramMb:10240,backends:["gguf","vllm"],defaultBackend:"gguf"},{label:"NVIDIA RTX 3070 (8 GB)",gpu:"NVIDIA RTX 3070",gpuType:"nvidia",vramMb:8192,backends:["gguf","vllm"],defaultBackend:"gguf"},{label:"NVIDIA A100 (80 GB)",gpu:"NVIDIA A100",gpuType:"nvidia",vramMb:81920,backends:["gguf","vllm"],defaultBackend:"vllm"},{label:"NVIDIA A100 (40 GB)",gpu:"NVIDIA A100",gpuType:"nvidia",vramMb:40960,backends:["gguf","vllm"],defaultBackend:"vllm"},{label:"NVIDIA Tesla T4 (16 GB)",gpu:"NVIDIA Tesla T4",gpuType:"nvidia",vramMb:16384,backends:["gguf","vllm"],defaultBackend:"gguf"},{label:"AMD RX 9070 XT — Vulkan (16 GB)",gpu:"AMD RX 9070 XT",gpuType:"amd",vramMb:16384,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 9070 — Vulkan (12 GB)",gpu:"AMD RX 9070",gpuType:"amd",vramMb:12288,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 7900 XTX — Vulkan (24 GB)",gpu:"AMD RX 7900 XTX",gpuType:"amd",vramMb:24576,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 7900 XT — Vulkan (20 GB)",gpu:"AMD RX 7900 XT",gpuType:"amd",vramMb:20480,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 7800 XT — Vulkan (16 GB)",gpu:"AMD RX 7800 XT",gpuType:"amd",vramMb:16384,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 7600 — Vulkan (8 GB)",gpu:"AMD RX 7600",gpuType:"amd",vramMb:8192,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 9070 XT — ROCm (16 GB)",gpu:"AMD RX 9070 XT",gpuType:"amd-rocm",vramMb:16384,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 9070 — ROCm (12 GB)",gpu:"AMD RX 9070",gpuType:"amd-rocm",vramMb:12288,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 7900 XTX — ROCm (24 GB)",gpu:"AMD RX 7900 XTX",gpuType:"amd-rocm",vramMb:24576,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 7900 XT — ROCm (20 GB)",gpu:"AMD RX 7900 XT",gpuType:"amd-rocm",vramMb:20480,backends:["gguf"],defaultBackend:"gguf"},{label:"AMD RX 7800 XT — ROCm (16 GB)",gpu:"AMD RX 7800 XT",gpuType:"amd-rocm",vramMb:16384,backends:["gguf"],defaultBackend:"gguf"},{label:"Apple M4 Max (128 GB unified)",gpu:"Apple M4 Max",gpuType:"apple",vramMb:131072,backends:["gguf","mlx"],defaultBackend:"gguf"},{label:"Apple M4 Max (64 GB unified)",gpu:"Apple M4 Max",gpuType:"apple",vramMb:65536,backends:["gguf","mlx"],defaultBackend:"gguf"},{label:"Apple M4 Pro (48 GB unified)",gpu:"Apple M4 Pro",gpuType:"apple",vramMb:49152,backends:["gguf","mlx"],defaultBackend:"gguf"},{label:"Apple M4 Pro (24 GB unified)",gpu:"Apple M4 Pro",gpuType:"apple",vramMb:24576,backends:["gguf","mlx"],defaultBackend:"gguf"},{label:"Apple M2 Max (32 GB unified)",gpu:"Apple M2 Max",gpuType:"apple",vramMb:32768,backends:["gguf","mlx"],defaultBackend:"gguf"},{label:"Apple M2 Pro (16 GB unified)",gpu:"Apple M2 Pro",gpuType:"apple",vramMb:16384,backends:["gguf","mlx"],defaultBackend:"gguf"},{label:"Apple M1 (16 GB unified)",gpu:"Apple M1",gpuType:"apple",vramMb:16384,backends:["gguf","mlx"],defaultBackend:"gguf"},{label:"Apple M1 (8 GB unified)",gpu:"Apple M1",gpuType:"apple",vramMb:8192,backends:["gguf","mlx"],defaultBackend:"gguf"},{label:"Other (enter VRAM manually)",gpu:"Other",gpuType:"none",vramMb:null,backends:["gguf"],defaultBackend:"gguf"}];function g4(){const{state:a,dispatch:l}=dr(),[i,o]=S.useState(!a.hardware),[d,f]=S.useState(!1),[m,v]=S.useState(0),[g,p]=S.useState("");S.useEffect(()=>{a.hardware||fE().then(N=>{l({type:"SET_HARDWARE",hardware:N}),N.recommendedBackend==="remote"&&a.deploymentMode==="local"&&l({type:"SET_DEPLOYMENT_MODE",mode:"remote-llm"})}).catch(()=>{}).finally(()=>o(!1))},[]);function y(N,A){const j=Ki[N];if(!a.hardware)return;const E=j.gpu==="Other"?(parseInt(A??g,10)||0)*1024:j.vramMb,R={...a.hardware,gpuName:j.gpu,gpuVramMb:E||null,gpuType:j.gpuType,recommendedBackends:[...j.backends],recommendedBackend:j.defaultBackend};l({type:"SET_HARDWARE",hardware:R})}const x=a.hardware;return i?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[s.jsx(aa,{size:32,className:"animate-spin text-[var(--color-primary)]"}),s.jsx("p",{className:"mt-3 text-sm text-[var(--color-text-muted)]",children:"Detecting hardware..."})]}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Hardware Detection"}),s.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"We detected the following hardware. This determines which LLM backend to use."})]}),x&&s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 text-[var(--color-text-muted)]",children:[s.jsx(kn,{size:16}),s.jsx("span",{className:"text-xs font-medium uppercase",children:"Platform"})]}),s.jsxs("p",{className:"mt-1 text-sm font-medium text-[var(--color-text)]",children:[x.platform==="darwin"?"macOS":"Linux"," (",x.arch,")"]})]}),s.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 text-[var(--color-text-muted)]",children:[s.jsx(Ld,{size:16}),s.jsx("span",{className:"text-xs font-medium uppercase",children:"Memory"})]}),s.jsxs("p",{className:"mt-1 text-sm font-medium text-[var(--color-text)]",children:[x.totalMemoryGb," GB RAM"]})]}),s.jsxs("div",{className:"col-span-2 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 text-[var(--color-text-muted)]",children:[s.jsx(kn,{size:16}),s.jsx("span",{className:"text-xs font-medium uppercase",children:"GPU"})]}),s.jsx("p",{className:"mt-1 text-sm font-medium text-[var(--color-text)]",children:x.gpuName??"No GPU detected"}),x.gpuVramMb!=null&&x.gpuVramMb>0&&s.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:[Math.round(x.gpuVramMb/1024)," GB VRAM"]})]}),s.jsx("button",{type:"button",onClick:()=>f(!d),className:"text-xs font-medium text-[var(--color-primary)] hover:underline",children:d?"Cancel":"Override"})]}),d&&s.jsxs("div",{className:"mt-3 space-y-3 border-t border-[var(--color-border)] pt-3",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"gpu-select",className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Select GPU"}),s.jsx("select",{id:"gpu-select",value:m,onChange:N=>{const A=parseInt(N.target.value,10);v(A),Ki[A].gpu!=="Other"&&(y(A),f(!1))},className:te("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2","text-sm text-[var(--color-text)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]"),children:Ki.map((N,A)=>s.jsx("option",{value:A,children:N.label},`${N.label}-${A}`))})]}),Ki[m].gpu==="Other"&&s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx("label",{htmlFor:"custom-vram",className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"VRAM (GB)"}),s.jsx("input",{id:"custom-vram",type:"number",min:1,max:512,value:g,onChange:N=>p(N.target.value),placeholder:"e.g. 24",className:te("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2","text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]")})]}),s.jsx("button",{type:"button",disabled:!g||parseInt(g,10)<=0,onClick:()=>{y(m,g),f(!1)},className:te("rounded-lg px-4 py-2 text-sm font-medium","bg-[var(--color-primary)] text-white","disabled:cursor-not-allowed disabled:opacity-50"),children:"Apply"})]})]})]}),s.jsxs("div",{className:"col-span-2 rounded-lg border border-[var(--color-primary)]/30 bg-[var(--color-primary)]/5 p-4",children:[s.jsxs("p",{className:"text-sm font-medium text-[var(--color-text)]",children:["Recommended: ",s.jsx("span",{className:"text-[var(--color-primary)]",children:x.recommendedBackend.toUpperCase()})]}),x.recommendedBackends.length>1&&s.jsxs("p",{className:"mt-0.5 text-xs text-[var(--color-text-muted)]",children:["Available backends: ",x.recommendedBackends.join(", ")]})]})]}),a.deploymentMode==="remote-llm"&&s.jsxs("div",{className:"space-y-3",children:[s.jsx("h3",{className:"text-sm font-medium text-[var(--color-text)]",children:"Remote Service URLs"}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"remote-llm",className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"LLM Proxy URL"}),s.jsx("input",{id:"remote-llm",type:"url",value:a.remoteLlmUrl,onChange:N=>l({type:"SET_REMOTE_LLM_URL",url:N.target.value}),placeholder:"http://192.168.1.100:7704",className:te("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2","text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]")})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"remote-whisper",className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"Whisper URL (optional)"}),s.jsx("input",{id:"remote-whisper",type:"url",value:a.remoteWhisperUrl,onChange:N=>l({type:"SET_REMOTE_WHISPER_URL",url:N.target.value}),placeholder:"http://192.168.1.100:7706",className:te("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2","text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]")})]})]})]})}function y4(){const{state:a,dispatch:l}=dr(),[i,o]=S.useState(null),[d,f]=S.useState(!0);if(S.useEffect(()=>{Promise.all([xg(),mE()]).then(([p,y])=>{if(o(p),a.enabledModules.length===0&&l({type:"SET_ENABLED_MODULES",modules:y.enabledModules}),a.platform==="darwin"&&a.nativeServices.length===0){const x=p.services.filter(N=>N.nativeCapable).map(N=>N.id);x.length>0&&l({type:"SET_NATIVE_SERVICES",services:x})}}).catch(()=>{}).finally(()=>f(!1))},[]),d||!i)return s.jsx("div",{className:"flex items-center justify-center py-12",children:s.jsx(aa,{size:32,className:"animate-spin text-[var(--color-primary)]"})});const{core:m,recommended:v,optional:g}=b4(i.services);return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Select Services"}),s.jsxs("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:["Core services are always included. Toggle recommended and optional services.",a.platform==="darwin"&&s.jsxs(s.Fragment,{children:[" Services marked ",s.jsx("em",{children:"Native"})," can run as macOS LaunchAgents to use the Apple GPU."]})]})]}),s.jsx($u,{title:"Core",subtitle:"Always included",services:m,enabled:m.map(p=>p.id),nativeServices:a.nativeServices,platform:a.platform,locked:!0}),s.jsx($u,{title:"Recommended",subtitle:"Enabled by default",services:v,enabled:a.enabledModules,nativeServices:a.nativeServices,platform:a.platform,onToggle:(p,y)=>l({type:"TOGGLE_MODULE",serviceId:p,enabled:y}),onToggleNative:(p,y)=>l({type:"TOGGLE_NATIVE_SERVICE",serviceId:p,enabled:y})}),g.length>0&&s.jsx($u,{title:"Optional",subtitle:"Off by default",services:g,enabled:a.enabledModules,nativeServices:a.nativeServices,platform:a.platform,onToggle:(p,y)=>l({type:"TOGGLE_MODULE",serviceId:p,enabled:y}),onToggleNative:(p,y)=>l({type:"TOGGLE_NATIVE_SERVICE",serviceId:p,enabled:y})}),s.jsxs("div",{children:[s.jsxs("div",{className:"mb-2 flex items-baseline gap-2",children:[s.jsx("h3",{className:"text-sm font-medium text-[var(--color-text)]",children:"Integrations"}),s.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"Cloud services"})]}),s.jsxs("button",{type:"button",onClick:()=>l({type:"SET_RELAY_ENABLED",enabled:!a.relayEnabled}),className:te("flex w-full items-center gap-3 rounded-lg border px-3 py-2.5 text-left transition-colors",a.relayEnabled?"border-[var(--color-primary)]/30 bg-[var(--color-primary)]/5":"border-[var(--color-border)] hover:border-[var(--color-primary)]/30"),children:[a.relayEnabled?s.jsx(xt,{size:16,className:"shrink-0 text-[var(--color-primary)]"}):s.jsx(sl,{size:16,className:"shrink-0 text-[var(--color-text-muted)]"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:"Jarvis Relay"}),s.jsx(KN,{size:12,className:"text-[var(--color-text-muted)]"})]}),s.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:"Routes OAuth callbacks through a cloud relay for external providers (Google, Spotify, etc.)"})]})]})]})]})}function b4(a){return{core:a.filter(l=>l.category==="core"),recommended:a.filter(l=>l.category==="recommended"),optional:a.filter(l=>l.category==="optional")}}function $u({title:a,subtitle:l,services:i,enabled:o,nativeServices:d,locked:f,onToggle:m,onToggleNative:v,platform:g}){return s.jsxs("div",{children:[s.jsxs("div",{className:"mb-2 flex items-baseline gap-2",children:[s.jsx("h3",{className:"text-sm font-medium text-[var(--color-text)]",children:a}),s.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:l})]}),s.jsx("div",{className:"space-y-1",children:i.map(p=>{const y=o.includes(p.id),x=p.nativeCapable&&g==="darwin"&&y,N=d.includes(p.id);return s.jsxs("div",{className:te("rounded-lg border transition-colors",y?"border-[var(--color-primary)]/30 bg-[var(--color-primary)]/5":"border-[var(--color-border)]",!f&&!y&&"hover:border-[var(--color-primary)]/30"),children:[s.jsxs("button",{type:"button",disabled:f,onClick:()=>m?.(p.id,!y),className:te("flex w-full items-center gap-3 px-3 py-2.5 text-left",f&&"cursor-default"),children:[f?s.jsx(Ud,{size:16,className:"shrink-0 text-[var(--color-text-muted)]"}):y?s.jsx(xt,{size:16,className:"shrink-0 text-[var(--color-primary)]"}):s.jsx(sl,{size:16,className:"shrink-0 text-[var(--color-text-muted)]"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:p.name}),s.jsxs("span",{className:"text-xs text-[var(--color-text-muted)]",children:[":",p.port]}),p.nativeCapable&&g==="darwin"&&s.jsx("span",{className:"rounded bg-amber-500/10 px-1.5 py-0.5 text-[10px] font-medium text-amber-500",children:"Native"})]}),s.jsx("p",{className:"truncate text-xs text-[var(--color-text-muted)]",children:p.description})]})]}),x&&s.jsxs("button",{type:"button",onClick:()=>v?.(p.id,!N),className:te("flex w-full items-center gap-2 border-t border-[var(--color-border)]/50 px-3 py-2 text-left text-xs","hover:bg-[var(--color-surface-alt)] transition-colors"),children:[s.jsx(kn,{size:12,className:N?"text-amber-500":"text-[var(--color-text-muted)]"}),s.jsx("span",{className:N?"text-[var(--color-text)]":"text-[var(--color-text-muted)]",children:"Run natively via LaunchAgent"}),s.jsx("span",{className:"ml-auto text-[var(--color-text-muted)]",children:N?"On (uses Apple GPU)":"Off (runs in Docker)"})]})]},p.id)})})]})}function S4(){const{state:a}=dr(),[l,i]=S.useState(null);if(S.useEffect(()=>{xg().then(i).catch(()=>{})},[]),!l)return s.jsx("div",{className:"flex items-center justify-center py-12",children:s.jsx(aa,{size:32,className:"animate-spin text-[var(--color-primary)]"})});const o=l.services.filter(x=>x.category==="core"),d=l.services.filter(x=>x.category!=="core"&&a.enabledModules.includes(x.id)),f=[...o,...d],m=new Map;for(const x of f){const N=a.portOverrides[x.id]??x.port,A=m.get(N)??[];m.set(N,[...A,x.name])}const v=[...m.entries()].filter(([,x])=>x.length>1),g=f.filter(x=>x.database).length,p=f.filter(x=>a.nativeServices.includes(x.id)),y=f.filter(x=>!a.nativeServices.includes(x.id));return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Review Configuration"}),s.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"Review your selections before installing."})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[s.jsx(Ju,{label:"Docker Services",value:y.length}),s.jsx(Ju,{label:"Native Services",value:p.length}),s.jsx(Ju,{label:"Databases",value:g})]}),s.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:[s.jsx("p",{className:"text-xs font-medium uppercase text-[var(--color-text-muted)]",children:"Deployment Mode"}),s.jsx("p",{className:"mt-1 text-sm font-medium text-[var(--color-text)]",children:a.deploymentMode==="local"?"Local (all services on this machine)":"Remote LLM"}),a.deploymentMode==="remote-llm"&&a.remoteLlmUrl&&s.jsxs("p",{className:"mt-0.5 text-xs text-[var(--color-text-muted)]",children:["LLM: ",a.remoteLlmUrl]})]}),s.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] overflow-hidden",children:[s.jsx("div",{className:"border-b border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2",children:s.jsxs("span",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:["Services (",f.length,")"]})}),s.jsx("div",{className:"divide-y divide-[var(--color-border)]",children:f.map(x=>s.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(xt,{size:14,className:"text-green-500"}),s.jsx("span",{className:"text-sm text-[var(--color-text)]",children:x.name})]}),s.jsxs("span",{className:"text-xs text-[var(--color-text-muted)]",children:[":",a.portOverrides[x.id]??x.port]})]},x.id))})]}),a.relayEnabled&&s.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-4",children:[s.jsx("p",{className:"text-xs font-medium uppercase text-[var(--color-text-muted)]",children:"Jarvis Relay"}),s.jsx("p",{className:"mt-1 text-sm font-medium text-[var(--color-text)]",children:"Enabled"}),s.jsx("p",{className:"mt-0.5 text-xs text-[var(--color-text-muted)]",children:"https://relay.jarvisautomation.io"})]}),v.length>0&&s.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 p-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(na,{size:16,className:"text-amber-500"}),s.jsx("span",{className:"text-sm font-medium text-amber-500",children:"Port Conflicts"})]}),v.map(([x,N])=>s.jsxs("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:["Port ",x,": ",N.join(", ")]},x))]})]})}function Ju({label:a,value:l}){return s.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] p-3 text-center",children:[s.jsx("p",{className:"text-2xl font-bold text-[var(--color-primary)]",children:l}),s.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:a})]})}function Pu(){const[a,l]=S.useState({lines:[],running:!1,done:!1,exitCode:null,error:null,redirect:null}),i=S.useRef(null),o=S.useCallback((f,m)=>(i.current?.close(),l({lines:[],running:!0,done:!1,exitCode:null,error:null,redirect:null}),new Promise((v,g)=>{const p=new EventSource(f);i.current=p,p.onmessage=y=>{try{const x=JSON.parse(y.data);if(m&&m(x),"done"in x){if(l(N=>({...N,running:!1,done:!0,exitCode:x.code,redirect:x.redirect??null})),p.close(),x.code===0)v(x.code);else{const N=x.error?String(x.error):`Process exited with code ${x.code}`;g(new Error(N))}return}if("stream"in x&&"text"in x){const N={stream:x.stream,text:x.text,timestamp:Date.now()};l(A=>({...A,lines:[...A.lines,N]}))}}catch{}},p.onerror=()=>{const y=i.current===null;l(x=>({...x,running:!1,error:x.done?null:"Connection lost"})),p.close(),y||g(new Error("Connection lost"))}})),[]),d=S.useCallback(()=>{i.current?.close(),i.current=null,l(f=>({...f,running:!1}))},[]);return{...a,run:o,stop:d}}function Iu({lines:a,running:l,title:i,className:o}){const d=S.useRef(null),f=S.useRef(!0);S.useEffect(()=>{const v=d.current;!v||!f.current||(v.scrollTop=v.scrollHeight)},[a]);function m(){const v=d.current;if(!v)return;const g=v.scrollHeight-v.scrollTop-v.clientHeight;f.current=g<50}return s.jsxs("div",{className:te("flex flex-col rounded-lg border border-[var(--color-border)] overflow-hidden",o),children:[i&&s.jsxs("div",{className:"flex items-center gap-2 border-b border-[var(--color-border)] bg-[var(--color-surface)] px-3 py-2",children:[s.jsx("span",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:i}),l&&s.jsx("span",{className:"h-2 w-2 animate-pulse rounded-full bg-green-500"})]}),s.jsxs("div",{ref:d,onScroll:m,className:"h-64 overflow-y-auto bg-[#0d1117] p-3 font-mono text-xs leading-5",children:[a.length===0&&!l&&s.jsx("span",{className:"text-gray-500",children:"Waiting for output..."}),a.map((v,g)=>s.jsx("div",{className:te("whitespace-pre-wrap break-all",v.stream==="stderr"?"text-yellow-400":"text-gray-300"),children:v.text},g)),l&&s.jsx("span",{className:"inline-block h-4 w-1.5 animate-pulse bg-gray-400"})]})]})}function N4(){const{state:a,dispatch:l}=dr(),i=Pu(),o=Pu(),d=Pu(),[f,m]=S.useState("idle"),[v,g]=S.useState(null),[p,y]=S.useState(null),[x,N]=S.useState({}),[A,j]=S.useState({}),[E,R]=S.useState(null),[O,M]=S.useState(null),[V,U]=S.useState(null),[ne,W]=S.useState({});S.useEffect(()=>{const ee=o.redirect;if(f!=="done"||!ee)return;M(5);const w=setInterval(()=>{M(Q=>Q===null||Q<=1?(clearInterval(w),window.location.href=ee,0):Q-1)},1e3);return()=>clearInterval(w)},[f,o.redirect]);const $=S.useCallback(async()=>{m("preflight"),y(null),g(null);try{const ee=await dE(a.enabledModules);return y(ee),ee.canProceed?!0:(g("Pre-flight checks failed. Fix the issues above and retry."),m("error"),R("preflight"),!1)}catch(ee){return g(`Pre-flight check failed: ${ee instanceof Error?ee.message:String(ee)}`),m("error"),R("preflight"),!1}},[a.enabledModules]);async function G(){if(a.nativeServices.length!==0){m("native");for(const ee of a.nativeServices){U(ee);try{await d.run(`/api/native-services/${ee}/install`),W(w=>({...w,[ee]:{ok:!0}}))}catch(w){const Q=w instanceof Error?w.message:String(w);W(F=>({...F,[ee]:{ok:!1,error:Q}}))}}U(null)}}async function se(){g(null),N({}),R(null),W({}),l({type:"SET_INSTALL_RUNNING",running:!0});try{if(!await $()){l({type:"SET_INSTALL_RUNNING",running:!1});return}m("generating"),await zx(a),m("pulling"),await i.run("/api/install/pull"),m("starting"),await o.run("/api/install/start",w=>{if(w.phase==="health"&&typeof w.service=="string"&&N(Q=>({...Q,[w.service]:{healthy:w.healthy,error:w.error}})),w.serviceHealth&&typeof w.serviceHealth=="object"){const Q=w.serviceHealth;N(F=>({...F,...Q}))}}),await G(),m("done"),l({type:"SET_INSTALL_COMPLETE"})}catch(ee){g(ee instanceof Error?ee.message:String(ee)),m("error"),R(f),l({type:"SET_INSTALL_RUNNING",running:!1})}}async function je(){if(E==="preflight"){if(g(null),l({type:"SET_INSTALL_RUNNING",running:!0}),!await $()){l({type:"SET_INSTALL_RUNNING",running:!1});return}try{m("generating"),await zx(a),m("pulling"),await i.run("/api/install/pull"),m("starting"),await o.run("/api/install/start",w=>{if(w.phase==="health"&&typeof w.service=="string"&&N(Q=>({...Q,[w.service]:{healthy:w.healthy,error:w.error}})),w.serviceHealth&&typeof w.serviceHealth=="object"){const Q=w.serviceHealth;N(F=>({...F,...Q}))}}),await G(),m("done"),l({type:"SET_INSTALL_COMPLETE"})}catch(w){g(w instanceof Error?w.message:String(w)),m("error"),l({type:"SET_INSTALL_RUNNING",running:!1})}}else se()}async function he(ee){try{const w=await fetch(`/api/containers/${ee}/logs`);if(w.ok){const Q=await w.text();j(F=>({...F,[ee]:Q}))}else j(Q=>({...Q,[ee]:`Failed to fetch logs: HTTP ${w.status}`}))}catch(w){j(Q=>({...Q,[ee]:`Failed to fetch logs: ${w instanceof Error?w.message:String(w)}`}))}}const me=[{key:"preflight",label:"Pre-flight checks"},{key:"generating",label:"Generate configuration"},{key:"pulling",label:"Pull Docker images"},{key:"starting",label:"Start services"},...a.nativeServices.length>0?[{key:"native",label:`Install ${a.nativeServices.length} native service${a.nativeServices.length===1?"":"s"}`}]:[]],Ce=me.map(ee=>ee.key).indexOf(f);return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Install"}),s.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:f==="idle"?"Ready to install. This will pull Docker images and start all services.":f==="done"?o.redirect?`Installation complete! Redirecting to your admin dashboard in ${O??"..."}s...`:"Installation complete! All services are running.":f==="error"?"Installation encountered an error.":"Installing..."})]}),p&&s.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] overflow-hidden",children:[s.jsx("div",{className:"border-b border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2",children:s.jsx("span",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:"Pre-flight Checks"})}),s.jsx("div",{className:"divide-y divide-[var(--color-border)]",children:p.checks.map(ee=>s.jsx("div",{className:"flex items-center justify-between px-3 py-2",children:s.jsxs("div",{className:"flex items-center gap-2",children:[ee.status==="pass"?s.jsx(xt,{size:14,className:"text-green-500"}):ee.status==="warn"?s.jsx(na,{size:14,className:"text-amber-500"}):s.jsx(ps,{size:14,className:"text-red-500"}),s.jsxs("div",{children:[s.jsx("span",{className:"text-sm text-[var(--color-text)]",children:ee.name}),s.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:ee.message}),ee.details&&ee.status!=="pass"&&s.jsx("p",{className:"text-xs text-[var(--color-text-muted)] opacity-60",children:ee.details})]})]})},ee.name))})]}),s.jsx("div",{className:"space-y-2",children:me.map((ee,w)=>{const Q=ee.key===f,F=Ce>w||f==="done",xe=f==="error"&&ee.key===E;return s.jsxs("div",{className:"flex items-center gap-3",children:[F?s.jsx(xt,{size:18,className:"text-green-500"}):xe?s.jsx(ps,{size:18,className:"text-red-500"}):Q?s.jsx(aa,{size:18,className:"animate-spin text-[var(--color-primary)]"}):s.jsx("div",{className:"h-[18px] w-[18px] rounded-full border-2 border-[var(--color-border)]"}),s.jsx("span",{className:te("text-sm",F?"text-green-500":Q?"font-medium text-[var(--color-text)]":"text-[var(--color-text-muted)]"),children:ee.label})]},ee.key)})}),(f==="starting"||f==="done"||f==="error")&&Object.keys(x).length>0&&s.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] overflow-hidden",children:[s.jsx("div",{className:"border-b border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2",children:s.jsx("span",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:"Service Status"})}),s.jsx("div",{className:"divide-y divide-[var(--color-border)]",children:Object.entries(x).map(([ee,w])=>s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[s.jsx("span",{className:"text-sm text-[var(--color-text)]",children:ee}),s.jsxs("div",{className:"flex items-center gap-2",children:[!w.healthy&&s.jsxs("button",{type:"button",onClick:()=>he(ee),className:"flex items-center gap-1 text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:[s.jsx(Jv,{size:12}),"Logs"]}),w.healthy?s.jsx(xt,{size:14,className:"text-green-500"}):s.jsx(ps,{size:14,className:"text-red-500"})]})]}),w.error&&s.jsx("p",{className:"px-3 pb-2 text-xs text-red-400",children:w.error}),A[ee]&&s.jsx("div",{className:"mx-3 mb-2 max-h-32 overflow-auto rounded bg-[var(--color-background)] p-2 text-xs font-mono text-[var(--color-text-muted)]",children:s.jsx("pre",{className:"whitespace-pre-wrap",children:A[ee]})})]},ee))})]}),(i.lines.length>0||i.running)&&s.jsx(Iu,{lines:i.lines,running:i.running,title:"docker compose pull"}),(o.lines.length>0||o.running)&&s.jsx(Iu,{lines:o.lines,running:o.running,title:"docker compose up -d"}),(f==="native"||Object.keys(ne).length>0)&&s.jsxs("div",{className:"rounded-lg border border-[var(--color-border)] overflow-hidden",children:[s.jsx("div",{className:"border-b border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2",children:s.jsx("span",{className:"text-xs font-medium text-[var(--color-text-muted)]",children:"Native Services (LaunchAgents)"})}),s.jsx("div",{className:"divide-y divide-[var(--color-border)]",children:a.nativeServices.map(ee=>{const w=ne[ee],Q=V===ee&&f==="native";return s.jsxs("div",{className:"px-3 py-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-sm text-[var(--color-text)]",children:ee}),w?.ok?s.jsx(xt,{size:14,className:"text-green-500"}):w?s.jsx(ps,{size:14,className:"text-red-500"}):Q?s.jsx(aa,{size:14,className:"animate-spin text-[var(--color-primary)]"}):s.jsx("div",{className:"h-3 w-3 rounded-full border border-[var(--color-border)]"})]}),w?.error&&s.jsx("p",{className:"mt-1 text-xs text-red-400",children:w.error})]},ee)})})]}),(d.lines.length>0||d.running)&&s.jsx(Iu,{lines:d.lines,running:d.running,title:V?`deploy-launchd.sh (${V})`:"deploy-launchd.sh"}),v&&s.jsx("div",{className:"rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-500",children:v}),(f==="idle"||f==="error")&&s.jsxs("button",{type:"button",onClick:f==="error"?je:se,className:te("flex w-full items-center justify-center gap-2 rounded-lg bg-[var(--color-primary)] px-4 py-3 font-medium text-white","hover:opacity-90 transition-opacity"),children:[f==="error"?s.jsx(vo,{size:18}):s.jsx(Iv,{size:18}),f==="error"?"Retry Installation":"Start Installation"]})]})}function j4(){const{state:a,dispatch:l}=dr(),i=pg(),o=gg(),[d,f]=S.useState("select"),[m,v]=S.useState(null),[g,p]=S.useState("GGUF"),[y,x]=S.useState(""),[N,A]=S.useState(null);if(a.deploymentMode==="remote-llm")return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"LLM Configuration"}),s.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"Your LLM is configured to use a remote server."})]}),s.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-green-500/30 bg-green-500/5 p-4",children:[s.jsx(xt,{size:20,className:"text-green-500"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"Remote LLM configured"}),s.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:a.remoteLlmUrl})]})]})]});if(a.platform==="darwin")return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"LLM Configuration"}),s.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"On macOS, the LLM proxy runs natively to access Metal/MLX. Configure it from the dashboard after setup, or run it directly from the jarvis-llm-proxy-api directory."})]}),s.jsx("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 p-4 text-sm text-amber-500",children:"macOS native LLM proxy is not yet available as a pip package. Model download through this wizard requires the LLM proxy running in Docker."})]});const j=U=>{v(U),A(null),U.gated&&!y.trim()?f("token"):R(U,y.trim())},E=()=>{if(!y.trim()){A("HuggingFace token is required for gated models");return}m&&R(m,y)},R=async(U,ne)=>{f("downloading"),A(null);const W=g==="GGUF"?U.hfRepoGguf:U.hfRepoVllm,$=g==="GGUF"?U.ggufFilename:void 0;try{await o.mutateAsync({repo:W,filename:$,token:ne||void 0}),await O(U)}catch(G){A(`Download failed: ${G.message}`),f("select")}},O=async U=>{f("configuring");const W={"model.main.name":g==="GGUF"?`.models/${U.ggufFilename}`:`.models/${U.hfRepoVllm.split("/").pop()}`,"model.main.backend":g,"model.main.chat_format":U.chatFormat,"model.main.context_window":U.contextWindow,"llm.interface":U.promptProvider};g==="GGUF"&&(W["inference.gguf.n_gpu_layers"]=-1),g==="VLLM"&&U.quantization&&(W["inference.vllm.quantization"]=U.quantization);try{await i.mutateAsync(W),l({type:"SET_LLM_INTERFACE",interfaceId:U.promptProvider}),f("done")}catch($){A(`Configuration failed: ${$.message}`),f("select")}},M=a.hardware?.gpuVramMb,V=M?rl.filter(U=>U.vramMb<=M):rl;return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"LLM Setup"}),s.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:d==="done"?"Model configured. The LLM proxy is restarting with the new model.":"Select and download a language model for Jarvis."})]}),N&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-red-500/30 bg-red-500/10 p-3 text-sm text-red-500",children:[s.jsx(na,{size:16,className:"mt-0.5 shrink-0"}),N]}),m&&s.jsxs("button",{type:"button",onClick:()=>R(m,y),className:te("flex w-full items-center justify-center gap-2 rounded-lg border border-[var(--color-border)] px-4 py-2 text-sm","hover:bg-[var(--color-surface-alt)] transition-colors"),children:[s.jsx(vo,{size:14}),"Retry Download"]})]}),d==="select"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:"Backend"}),s.jsx("div",{className:"flex gap-2",children:["GGUF","VLLM"].map(U=>s.jsx("button",{type:"button",onClick:()=>p(U),className:te("rounded-md px-3 py-1 text-xs font-medium transition-colors",g===U?"bg-[var(--color-primary)] text-white":"bg-[var(--color-surface-alt)] text-[var(--color-text-muted)] hover:text-[var(--color-text)]"),children:U==="VLLM"?"vLLM":U},U))})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"hf-token",className:"mb-1 block text-xs text-[var(--color-text-muted)]",children:"HuggingFace Token (optional — speeds up downloads, required for gated models)"}),s.jsx("input",{id:"hf-token",type:"password",value:y,onChange:U=>x(U.target.value),placeholder:"hf_...",className:te("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2","text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]")})]}),s.jsxs("div",{className:"space-y-2",children:[V.map(U=>s.jsxs("button",{type:"button",onClick:()=>j(U),className:te("flex w-full items-center justify-between rounded-lg border border-[var(--color-border)] p-3 text-left transition-colors","hover:border-[var(--color-primary)] hover:bg-[var(--color-surface-alt)]"),children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:U.displayName}),U.gated&&s.jsxs("span",{className:"flex items-center gap-0.5 rounded bg-yellow-500/15 px-1.5 py-0.5 text-[10px] font-medium text-yellow-600 dark:text-yellow-400",children:[s.jsx(Ud,{size:10}),"Gated"]})]}),s.jsxs("p",{className:"mt-0.5 text-xs text-[var(--color-text-muted)]",children:[U.promptProvider," · ",U.contextWindow.toLocaleString()," ctx"]})]}),s.jsxs("span",{className:"text-xs text-[var(--color-text-muted)]",children:["~",g==="GGUF"?U.sizeGguf:U.sizeVllm]})]},U.id)),V.length===0&&s.jsxs("p",{className:"py-4 text-center text-sm text-[var(--color-text-muted)]",children:["No models fit your available VRAM (",M?Math.round(M/1024)+" GB":"unknown","). Consider using Remote LLM mode."]}),M&&V.length<rl.length&&s.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["Showing ",V.length," of ",rl.length," models that fit your ",Math.round(M/1024)," GB VRAM."]})]})]}),d==="token"&&m&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("p",{className:"text-sm text-[var(--color-text-muted)]",children:[s.jsx("strong",{children:m.displayName})," is a gated model. Accept the license on HuggingFace and paste your access token below."]}),s.jsx("input",{type:"password",value:y,onChange:U=>x(U.target.value),placeholder:"hf_...",className:te("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2","text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]")}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("button",{type:"button",onClick:()=>{f("select"),A(null)},className:"text-sm text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Back"}),s.jsx("button",{type:"button",onClick:E,className:"rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm text-white hover:opacity-90",children:"Download"})]})]}),d==="downloading"&&s.jsxs("div",{className:"flex flex-col items-center py-8",children:[s.jsx(xs,{className:"mb-4 animate-bounce text-[var(--color-primary)]",size:32}),s.jsxs("p",{className:"text-sm font-medium text-[var(--color-text)]",children:["Downloading ",m?.displayName,"..."]}),s.jsxs("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:["~",g==="GGUF"?m?.sizeGguf:m?.sizeVllm," · This may take several minutes"]})]}),d==="configuring"&&s.jsxs("div",{className:"flex flex-col items-center py-8",children:[s.jsx(aa,{className:"mb-4 animate-spin text-[var(--color-primary)]",size:32}),s.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"Configuring model and prompt provider..."})]}),d==="done"&&m&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-green-500/30 bg-green-500/5 p-4",children:[s.jsx(xt,{size:20,className:"text-green-500"}),s.jsxs("div",{children:[s.jsxs("p",{className:"text-sm font-medium text-[var(--color-text)]",children:[m.displayName," configured"]}),s.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["Backend: ",g," · Prompt provider: ",m.promptProvider]})]})]}),s.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["The LLM proxy is restarting with the new model. It may take a minute to load. Command Center will automatically use the ",s.jsx("strong",{children:m.promptProvider})," prompt provider for optimized command parsing."]})]})]})}function w4(){const[a,l]=S.useState(""),[i,o]=S.useState(""),[d,f]=S.useState(""),[m,v]=S.useState(""),[g,p]=S.useState(!1),[y,x]=S.useState(!1),[N,A]=S.useState(null),j=i===d,E=a&&i&&d&&m&&j&&!g;async function R(){if(E){p(!0),A(null);try{const M=await Fv(a,i,m);nl(M.access_token),localStorage.setItem("access_token",M.access_token),localStorage.setItem("refresh_token",M.refresh_token),x(!0)}catch(M){const V=M?.response?.data?.error??(M instanceof Error?M.message:"Failed to create account");A(V)}finally{p(!1)}}}if(y)return s.jsxs("div",{className:"space-y-6",children:[s.jsx("div",{children:s.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Account Created"})}),s.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-green-500/30 bg-green-500/5 p-4",children:[s.jsx(xt,{size:20,className:"text-green-500"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"Superuser account created"}),s.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:a})]})]}),s.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:`You're logged in. Click "Next" to configure your LLM model.`})]});const O=te("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-alt)] px-3 py-2","text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]");return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-bold text-[var(--color-text)]",children:"Create Account"}),s.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"Create your superuser account. This will be the admin for your Jarvis instance."})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"display-name",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Display Name"}),s.jsx("input",{id:"display-name",type:"text",value:m,onChange:M=>v(M.target.value),className:O,placeholder:"Alex"})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"email",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Email"}),s.jsx("input",{id:"email",type:"email",value:a,onChange:M=>l(M.target.value),className:O,placeholder:"admin@example.com"})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"password",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Password"}),s.jsx("input",{id:"password",type:"password",value:i,onChange:M=>o(M.target.value),className:O,placeholder:"Choose a strong password"})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"confirm-password",className:"mb-1 block text-sm text-[var(--color-text-muted)]",children:"Confirm Password"}),s.jsx("input",{id:"confirm-password",type:"password",value:d,onChange:M=>f(M.target.value),className:te(O,d&&!j&&"ring-2 ring-red-500"),placeholder:"Confirm password"}),d&&!j&&s.jsx("p",{className:"mt-1 text-xs text-red-500",children:"Passwords don't match"})]})]}),N&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-red-500/10 px-3 py-2",children:[s.jsx(Dd,{size:14,className:"text-red-500 shrink-0"}),s.jsx("span",{className:"text-sm text-red-500",children:N})]}),s.jsxs("button",{type:"button",onClick:R,disabled:!E,className:te("flex w-full items-center justify-center gap-2 rounded-lg border border-[var(--color-border)] px-4 py-2 text-sm","hover:bg-[var(--color-surface-alt)] transition-colors","disabled:opacity-50"),children:[s.jsx(vo,{size:14}),"Retry"]})]}),!N&&s.jsx("button",{type:"button",onClick:R,disabled:!E,className:te("w-full rounded-lg bg-[var(--color-primary)] px-4 py-2 font-medium text-white","hover:opacity-90 disabled:opacity-50 transition-opacity"),children:g?"Creating...":"Create Superuser Account"})]})}const Zi=[{label:"Welcome",component:v4},{label:"Hardware",component:g4},{label:"Services",component:y4},{label:"Review",component:S4},{label:"Install",component:N4},{label:"Account",component:w4},{label:"LLM",component:j4}],E4=5;function T4({skipToAccount:a}){const{state:l,dispatch:i}=dr();S.useEffect(()=>{a&&i({type:"SET_STEP",step:E4})},[a,i]);const o=wa(),d=Zi[l.currentStep].component,f=l.currentStep===0,m=l.currentStep===Zi.length-1,p=l.currentStep===4&&!l.installComplete,y=l.installRunning||p;function x(){m?o("/login"):i({type:"NEXT_STEP"})}function N(){i({type:"PREV_STEP"})}return s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--color-background)] p-4",children:s.jsxs("div",{className:"w-full max-w-2xl",children:[s.jsx("div",{className:"mb-6 flex items-center justify-center gap-1",children:Zi.map((A,j)=>s.jsxs("button",{type:"button",onClick:()=>!y&&i({type:"SET_STEP",step:j}),disabled:y,className:te("flex items-center gap-1",y&&"cursor-not-allowed"),children:[s.jsx("div",{className:te("flex h-7 w-7 items-center justify-center rounded-full text-xs font-medium transition-colors",j===l.currentStep?"bg-[var(--color-primary)] text-white":j<l.currentStep?"bg-[var(--color-primary)]/20 text-[var(--color-primary)]":"bg-[var(--color-surface-alt)] text-[var(--color-text-muted)]"),children:j+1}),s.jsx("span",{className:te("hidden text-xs sm:inline",j===l.currentStep?"font-medium text-[var(--color-text)]":"text-[var(--color-text-muted)]"),children:A.label}),j<Zi.length-1&&s.jsx("div",{className:te("mx-1 h-px w-4 sm:w-6",j<l.currentStep?"bg-[var(--color-primary)]/30":"bg-[var(--color-border)]")})]},A.label))}),s.jsx("div",{className:"rounded-xl border border-[var(--color-border)] bg-[var(--color-surface)] p-6 shadow-lg",children:s.jsx(d,{})}),s.jsxs("div",{className:"mt-4 flex justify-between",children:[s.jsx("button",{type:"button",onClick:N,disabled:f||y,className:te("rounded-lg border border-[var(--color-border)] px-4 py-2 text-sm","hover:bg-[var(--color-surface-alt)] transition-colors","disabled:invisible"),children:"Back"}),s.jsx("button",{type:"button",onClick:x,disabled:y,className:te("rounded-lg bg-[var(--color-primary)] px-6 py-2 text-sm font-medium text-white","hover:opacity-90 transition-opacity","disabled:opacity-50 disabled:cursor-not-allowed"),children:m?"Finish":"Next"})]})]})})}function R4({skipToAccount:a}){return s.jsx(x4,{children:s.jsx(T4,{skipToAccount:a})})}function C4(){const a=wa(),l=pg(),i=uE(),[o,d]=S.useState("select"),[f,m]=S.useState(null),[v,g]=S.useState("GGUF"),[p,y]=S.useState(""),[x,N]=S.useState(null),A=M=>{m(M),M.gated?d("token"):E(M,"")},j=()=>{if(!p.trim()){N("HuggingFace token is required for gated models");return}N(null),f&&E(f,p)},E=async(M,V)=>{d("download"),N(null);const U=v==="GGUF"?M.hfRepoGguf:M.hfRepoVllm,ne=v==="GGUF"?M.ggufFilename:void 0;try{await i.mutateAsync({repo:U,filename:ne,token:V||void 0}),R(M)}catch(W){N(`Download failed: ${W.message}`),d("select")}},R=async M=>{d("configure"),N(null);const U={"model.main.name":v==="GGUF"?`.models/${M.ggufFilename}`:`.models/${M.hfRepoVllm.split("/").pop()}`,"model.main.backend":v,"model.main.chat_format":M.chatFormat,"model.main.context_window":M.contextWindow};v==="GGUF"&&(U["inference.gguf.n_gpu_layers"]=-1),v==="VLLM"&&M.quantization&&(U["inference.vllm.quantization"]=M.quantization);try{await l.mutateAsync(U),d("done"),ze.success("LLM configured successfully")}catch(ne){N(`Configuration failed: ${ne.message}`),d("select")}},O=()=>{a("/dashboard")};return s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--color-bg)] p-4",children:s.jsxs("div",{className:"w-full max-w-2xl rounded-xl border border-[var(--color-border)] bg-[var(--color-surface)] p-8 shadow-lg",children:[s.jsxs("div",{className:"mb-8 text-center",children:[s.jsx(md,{className:"mx-auto mb-3 text-[var(--color-primary)]",size:40}),s.jsx("h1",{className:"text-2xl font-bold text-[var(--color-text)]",children:"LLM Setup"}),s.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"Configure a local language model for Jarvis"})]}),s.jsx("div",{className:"mb-8 flex items-center justify-center gap-2",children:["select","download","configure","done"].map((M,V)=>{const U=o==="token"?"select":o,ne=["select","download","configure","done"];return s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:te("h-2 w-2 rounded-full",U===M?"bg-[var(--color-primary)]":ne.indexOf(U)>V?"bg-green-500":"bg-[var(--color-border)]")}),V<3&&s.jsx("div",{className:"h-px w-8 bg-[var(--color-border)]"})]},M)})}),x&&s.jsxs("div",{className:"mb-6 flex items-start gap-2 rounded-lg border border-red-500/30 bg-red-500/10 p-3 text-sm text-red-500",children:[s.jsx(na,{size:16,className:"mt-0.5 shrink-0"}),x]}),o==="select"&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[s.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"Select a model"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{onClick:()=>g("GGUF"),className:te("rounded-md px-3 py-1 text-xs font-medium transition-colors",v==="GGUF"?"bg-[var(--color-primary)] text-white":"bg-[var(--color-surface-alt)] text-[var(--color-text-muted)] hover:text-[var(--color-text)]"),children:"GGUF"}),s.jsx("button",{onClick:()=>g("VLLM"),className:te("rounded-md px-3 py-1 text-xs font-medium transition-colors",v==="VLLM"?"bg-[var(--color-primary)] text-white":"bg-[var(--color-surface-alt)] text-[var(--color-text-muted)] hover:text-[var(--color-text)]"),children:"vLLM"})]})]}),s.jsx("div",{className:"grid gap-3",children:rl.map(M=>s.jsxs("button",{onClick:()=>A(M),className:te("flex items-center justify-between rounded-lg border border-[var(--color-border)] p-4 text-left transition-colors","hover:border-[var(--color-primary)] hover:bg-[var(--color-surface-alt)]"),children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"font-medium text-[var(--color-text)]",children:M.displayName}),M.gated&&s.jsxs("span",{className:"flex items-center gap-1 rounded bg-yellow-500/15 px-1.5 py-0.5 text-[10px] font-medium text-yellow-600 dark:text-yellow-400",children:[s.jsx(Ud,{size:10}),"Gated"]})]}),s.jsxs("p",{className:"mt-0.5 text-xs text-[var(--color-text-muted)]",children:[M.quantization?`${M.quantization.toUpperCase()} 4-bit`:M.chatFormat," · ",M.contextWindow.toLocaleString()," ctx"]})]}),s.jsxs("span",{className:"text-sm text-[var(--color-text-muted)]",children:["~",v==="GGUF"?M.sizeGguf:M.sizeVllm]})]},M.id))}),s.jsx("div",{className:"flex justify-end pt-2",children:s.jsx("button",{onClick:O,className:"text-sm text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Skip for now"})})]}),o==="token"&&f&&s.jsxs("div",{className:"space-y-4",children:[s.jsx("h2",{className:"text-sm font-semibold text-[var(--color-text)]",children:"HuggingFace Access Required"}),s.jsxs("p",{className:"text-sm text-[var(--color-text-muted)]",children:[s.jsx("strong",{children:f.displayName})," is a gated model. You need to:"]}),s.jsxs("ol",{className:"list-inside list-decimal space-y-1 text-sm text-[var(--color-text-muted)]",children:[s.jsx("li",{children:"Visit the model page on huggingface.co and accept the license agreement"}),s.jsx("li",{children:"Create an access token at huggingface.co/settings/tokens"}),s.jsx("li",{children:"Paste your token below"})]}),s.jsx("input",{type:"password",value:p,onChange:M=>y(M.target.value),placeholder:"hf_...",className:te("w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-bg)] px-3 py-2","text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","outline-none focus:ring-2 focus:ring-[var(--color-primary)]")}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("button",{onClick:()=>{d("select"),N(null)},className:"text-sm text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"Back"}),s.jsx("button",{onClick:j,className:"rounded-lg bg-[var(--color-primary)] px-4 py-2 text-sm text-white hover:opacity-90",children:"Continue"})]})]}),o==="download"&&s.jsxs("div",{className:"flex flex-col items-center py-8",children:[s.jsx(xs,{className:"mb-4 animate-bounce text-[var(--color-primary)]",size:32}),s.jsx("h2",{className:"text-lg font-semibold text-[var(--color-text)]",children:"Downloading model..."}),s.jsxs("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:[f?.displayName," ","(~",v==="GGUF"?f?.sizeGguf:f?.sizeVllm,")"]}),s.jsx("p",{className:"mt-4 text-xs text-[var(--color-text-muted)]",children:"This may take several minutes depending on your connection"})]}),o==="configure"&&s.jsxs("div",{className:"flex flex-col items-center py-8",children:[s.jsx(Wv,{className:"mb-4 animate-spin text-[var(--color-primary)]",size:32}),s.jsx("h2",{className:"text-lg font-semibold text-[var(--color-text)]",children:"Configuring..."}),s.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:"Writing settings and restarting LLM proxy"})]}),o==="done"&&s.jsxs("div",{className:"flex flex-col items-center py-8",children:[s.jsx(ON,{className:"mb-4 text-green-500",size:40}),s.jsx("h2",{className:"text-lg font-semibold text-[var(--color-text)]",children:"LLM Ready"}),s.jsxs("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:[f?.displayName," configured on ",v]}),s.jsx("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:"The model service is restarting. It may take a minute to load the model."}),s.jsx("button",{onClick:()=>a("/dashboard"),className:"mt-6 rounded-lg bg-[var(--color-primary)] px-6 py-2 text-sm text-white hover:opacity-90",children:"Go to Dashboard"})]}),(i.isPending||l.isPending)&&o!=="download"&&o!=="configure"&&s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:s.jsx(aa,{className:"animate-spin text-white",size:32})})]})})}const _4=new F1;function M4(){const[a,l]=S.useState(!0),[i,o]=S.useState(!1),[d,f]=S.useState(!1);return S.useEffect(()=>{Qd().then(m=>{m.state==="deployed-needs-account"?(f(!0),o(!0)):o(!m.configured)}).catch(()=>{o(!1)}).finally(()=>l(!1))},[]),a?s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--color-background)]",children:s.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--color-primary)] border-t-transparent"})}):s.jsxs(H0,{children:[s.jsx(pt,{path:"/setup",element:s.jsx(R4,{skipToAccount:d})}),s.jsx(pt,{path:"/login",element:s.jsx(_w,{})}),s.jsx(pt,{path:"/llm-setup",element:s.jsx(C4,{})}),s.jsxs(pt,{element:s.jsx(Cw,{}),children:[s.jsx(pt,{path:"/dashboard",element:s.jsx(vE,{})}),s.jsx(pt,{path:"/settings",element:s.jsx(Qw,{})}),s.jsx(pt,{path:"/services",element:s.jsx(rE,{})}),s.jsx(pt,{path:"/models",element:s.jsx(YE,{})}),s.jsx(pt,{path:"/quick-sets",element:s.jsx(e4,{})}),s.jsx(pt,{path:"/traces",element:s.jsx(o4,{})}),s.jsx(pt,{path:"/traces/:id",element:s.jsx(u4,{})}),s.jsx(pt,{path:"/update",element:s.jsx(t4,{})}),s.jsx(pt,{path:"/reconcile",element:s.jsx(n4,{})}),s.jsx(pt,{path:"/nodes",element:s.jsx(TE,{})}),s.jsx(pt,{path:"/native-services",element:s.jsx(UE,{})}),s.jsx(pt,{path:"/",element:i?s.jsx(ao,{to:"/setup",replace:!0}):s.jsx(ao,{to:"/dashboard",replace:!0})}),s.jsx(pt,{path:"*",element:s.jsx(d4,{})})]})]})}function A4(){return s.jsx(A2,{children:s.jsx(Y1,{client:_4,children:s.jsxs(hN,{children:[s.jsx(u1,{children:s.jsx(M4,{})}),s.jsx(_2,{position:"bottom-right",richColors:!0})]})})})}qb.createRoot(document.getElementById("root")).render(s.jsx(S.StrictMode,{children:s.jsx(A4,{})}));