@auxiora/dashboard 1.10.12 → 1.10.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +48 -0
- package/dist/router.js.map +1 -1
- package/dist-ui/assets/index-CEc8TZwK.js +60 -0
- package/dist-ui/index.html +1 -1
- package/package.json +5 -4
- package/dist-ui/assets/index-CtZWMVgG.js +0 -60
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))o(f);new MutationObserver(f=>{for(const m of f)if(m.type==="childList")for(const p of m.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&o(p)}).observe(document,{childList:!0,subtree:!0});function u(f){const m={};return f.integrity&&(m.integrity=f.integrity),f.referrerPolicy&&(m.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?m.credentials="include":f.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function o(f){if(f.ep)return;f.ep=!0;const m=u(f);fetch(f.href,m)}})();var mu={exports:{}},js={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Dh;function ov(){if(Dh)return js;Dh=1;var s=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function u(o,f,m){var p=null;if(m!==void 0&&(p=""+m),f.key!==void 0&&(p=""+f.key),"key"in f){m={};for(var x in f)x!=="key"&&(m[x]=f[x])}else m=f;return f=m.ref,{$$typeof:s,type:o,key:p,ref:f!==void 0?f:null,props:m}}return js.Fragment=r,js.jsx=u,js.jsxs=u,js}var zh;function dv(){return zh||(zh=1,mu.exports=ov()),mu.exports}var n=dv(),pu={exports:{}},je={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var kh;function fv(){if(kh)return je;kh=1;var s=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),p=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),S=Symbol.iterator;function T(C){return C===null||typeof C!="object"?null:(C=S&&C[S]||C["@@iterator"],typeof C=="function"?C:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D=Object.assign,O={};function E(C,L,le){this.props=C,this.context=L,this.refs=O,this.updater=le||A}E.prototype.isReactComponent={},E.prototype.setState=function(C,L){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,L,"setState")},E.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function R(){}R.prototype=E.prototype;function _(C,L,le){this.props=C,this.context=L,this.refs=O,this.updater=le||A}var K=_.prototype=new R;K.constructor=_,D(K,E.prototype),K.isPureReactComponent=!0;var Q=Array.isArray;function Z(){}var F={H:null,A:null,T:null,S:null},Y=Object.prototype.hasOwnProperty;function te(C,L,le){var re=le.ref;return{$$typeof:s,type:C,key:L,ref:re!==void 0?re:null,props:le}}function ce(C,L){return te(C.type,L,C.props)}function ie(C){return typeof C=="object"&&C!==null&&C.$$typeof===s}function he(C){var L={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(le){return L[le]})}var ee=/\/+/g;function oe(C,L){return typeof C=="object"&&C!==null&&C.key!=null?he(""+C.key):L.toString(36)}function ve(C){switch(C.status){case"fulfilled":return C.value;case"rejected":throw C.reason;default:switch(typeof C.status=="string"?C.then(Z,Z):(C.status="pending",C.then(function(L){C.status==="pending"&&(C.status="fulfilled",C.value=L)},function(L){C.status==="pending"&&(C.status="rejected",C.reason=L)})),C.status){case"fulfilled":return C.value;case"rejected":throw C.reason}}throw C}function H(C,L,le,re,xe){var be=typeof C;(be==="undefined"||be==="boolean")&&(C=null);var Ce=!1;if(C===null)Ce=!0;else switch(be){case"bigint":case"string":case"number":Ce=!0;break;case"object":switch(C.$$typeof){case s:case r:Ce=!0;break;case b:return Ce=C._init,H(Ce(C._payload),L,le,re,xe)}}if(Ce)return xe=xe(C),Ce=re===""?"."+oe(C,0):re,Q(xe)?(le="",Ce!=null&&(le=Ce.replace(ee,"$&/")+"/"),H(xe,L,le,"",function(X){return X})):xe!=null&&(ie(xe)&&(xe=ce(xe,le+(xe.key==null||C&&C.key===xe.key?"":(""+xe.key).replace(ee,"$&/")+"/")+Ce)),L.push(xe)),1;Ce=0;var Pe=re===""?".":re+":";if(Q(C))for(var W=0;W<C.length;W++)re=C[W],be=Pe+oe(re,W),Ce+=H(re,L,le,be,xe);else if(W=T(C),typeof W=="function")for(C=W.call(C),W=0;!(re=C.next()).done;)re=re.value,be=Pe+oe(re,W++),Ce+=H(re,L,le,be,xe);else if(be==="object"){if(typeof C.then=="function")return H(ve(C),L,le,re,xe);throw L=String(C),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.")}return Ce}function J(C,L,le){if(C==null)return C;var re=[],xe=0;return H(C,re,"","",function(be){return L.call(le,be,xe++)}),re}function ne(C){if(C._status===-1){var L=C._result;L=L(),L.then(function(le){(C._status===0||C._status===-1)&&(C._status=1,C._result=le)},function(le){(C._status===0||C._status===-1)&&(C._status=2,C._result=le)}),C._status===-1&&(C._status=0,C._result=L)}if(C._status===1)return C._result.default;throw C._result}var P=typeof reportError=="function"?reportError:function(C){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var L=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(L))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",C);return}console.error(C)},de={map:J,forEach:function(C,L,le){J(C,function(){L.apply(this,arguments)},le)},count:function(C){var L=0;return J(C,function(){L++}),L},toArray:function(C){return J(C,function(L){return L})||[]},only:function(C){if(!ie(C))throw Error("React.Children.only expected to receive a single React element child.");return C}};return je.Activity=j,je.Children=de,je.Component=E,je.Fragment=u,je.Profiler=f,je.PureComponent=_,je.StrictMode=o,je.Suspense=y,je.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=F,je.__COMPILER_RUNTIME={__proto__:null,c:function(C){return F.H.useMemoCache(C)}},je.cache=function(C){return function(){return C.apply(null,arguments)}},je.cacheSignal=function(){return null},je.cloneElement=function(C,L,le){if(C==null)throw Error("The argument must be a React element, but you passed "+C+".");var re=D({},C.props),xe=C.key;if(L!=null)for(be in L.key!==void 0&&(xe=""+L.key),L)!Y.call(L,be)||be==="key"||be==="__self"||be==="__source"||be==="ref"&&L.ref===void 0||(re[be]=L[be]);var be=arguments.length-2;if(be===1)re.children=le;else if(1<be){for(var Ce=Array(be),Pe=0;Pe<be;Pe++)Ce[Pe]=arguments[Pe+2];re.children=Ce}return te(C.type,xe,re)},je.createContext=function(C){return C={$$typeof:p,_currentValue:C,_currentValue2:C,_threadCount:0,Provider:null,Consumer:null},C.Provider=C,C.Consumer={$$typeof:m,_context:C},C},je.createElement=function(C,L,le){var re,xe={},be=null;if(L!=null)for(re in L.key!==void 0&&(be=""+L.key),L)Y.call(L,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(xe[re]=L[re]);var Ce=arguments.length-2;if(Ce===1)xe.children=le;else if(1<Ce){for(var Pe=Array(Ce),W=0;W<Ce;W++)Pe[W]=arguments[W+2];xe.children=Pe}if(C&&C.defaultProps)for(re in Ce=C.defaultProps,Ce)xe[re]===void 0&&(xe[re]=Ce[re]);return te(C,be,xe)},je.createRef=function(){return{current:null}},je.forwardRef=function(C){return{$$typeof:x,render:C}},je.isValidElement=ie,je.lazy=function(C){return{$$typeof:b,_payload:{_status:-1,_result:C},_init:ne}},je.memo=function(C,L){return{$$typeof:g,type:C,compare:L===void 0?null:L}},je.startTransition=function(C){var L=F.T,le={};F.T=le;try{var re=C(),xe=F.S;xe!==null&&xe(le,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(Z,P)}catch(be){P(be)}finally{L!==null&&le.types!==null&&(L.types=le.types),F.T=L}},je.unstable_useCacheRefresh=function(){return F.H.useCacheRefresh()},je.use=function(C){return F.H.use(C)},je.useActionState=function(C,L,le){return F.H.useActionState(C,L,le)},je.useCallback=function(C,L){return F.H.useCallback(C,L)},je.useContext=function(C){return F.H.useContext(C)},je.useDebugValue=function(){},je.useDeferredValue=function(C,L){return F.H.useDeferredValue(C,L)},je.useEffect=function(C,L){return F.H.useEffect(C,L)},je.useEffectEvent=function(C){return F.H.useEffectEvent(C)},je.useId=function(){return F.H.useId()},je.useImperativeHandle=function(C,L,le){return F.H.useImperativeHandle(C,L,le)},je.useInsertionEffect=function(C,L){return F.H.useInsertionEffect(C,L)},je.useLayoutEffect=function(C,L){return F.H.useLayoutEffect(C,L)},je.useMemo=function(C,L){return F.H.useMemo(C,L)},je.useOptimistic=function(C,L){return F.H.useOptimistic(C,L)},je.useReducer=function(C,L,le){return F.H.useReducer(C,L,le)},je.useRef=function(C){return F.H.useRef(C)},je.useState=function(C){return F.H.useState(C)},je.useSyncExternalStore=function(C,L,le){return F.H.useSyncExternalStore(C,L,le)},je.useTransition=function(){return F.H.useTransition()},je.version="19.2.4",je}var _h;function Du(){return _h||(_h=1,pu.exports=fv()),pu.exports}var h=Du(),gu={exports:{}},Ss={},vu={exports:{}},yu={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var Uh;function hv(){return Uh||(Uh=1,(function(s){function r(H,J){var ne=H.length;H.push(J);e:for(;0<ne;){var P=ne-1>>>1,de=H[P];if(0<f(de,J))H[P]=J,H[ne]=de,ne=P;else break e}}function u(H){return H.length===0?null:H[0]}function o(H){if(H.length===0)return null;var J=H[0],ne=H.pop();if(ne!==J){H[0]=ne;e:for(var P=0,de=H.length,C=de>>>1;P<C;){var L=2*(P+1)-1,le=H[L],re=L+1,xe=H[re];if(0>f(le,ne))re<de&&0>f(xe,le)?(H[P]=xe,H[re]=ne,P=re):(H[P]=le,H[L]=ne,P=L);else if(re<de&&0>f(xe,ne))H[P]=xe,H[re]=ne,P=re;else break e}}return J}function f(H,J){var ne=H.sortIndex-J.sortIndex;return ne!==0?ne:H.id-J.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;s.unstable_now=function(){return m.now()}}else{var p=Date,x=p.now();s.unstable_now=function(){return p.now()-x}}var y=[],g=[],b=1,j=null,S=3,T=!1,A=!1,D=!1,O=!1,E=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function K(H){for(var J=u(g);J!==null;){if(J.callback===null)o(g);else if(J.startTime<=H)o(g),J.sortIndex=J.expirationTime,r(y,J);else break;J=u(g)}}function Q(H){if(D=!1,K(H),!A)if(u(y)!==null)A=!0,Z||(Z=!0,he());else{var J=u(g);J!==null&&ve(Q,J.startTime-H)}}var Z=!1,F=-1,Y=5,te=-1;function ce(){return O?!0:!(s.unstable_now()-te<Y)}function ie(){if(O=!1,Z){var H=s.unstable_now();te=H;var J=!0;try{e:{A=!1,D&&(D=!1,R(F),F=-1),T=!0;var ne=S;try{t:{for(K(H),j=u(y);j!==null&&!(j.expirationTime>H&&ce());){var P=j.callback;if(typeof P=="function"){j.callback=null,S=j.priorityLevel;var de=P(j.expirationTime<=H);if(H=s.unstable_now(),typeof de=="function"){j.callback=de,K(H),J=!0;break t}j===u(y)&&o(y),K(H)}else o(y);j=u(y)}if(j!==null)J=!0;else{var C=u(g);C!==null&&ve(Q,C.startTime-H),J=!1}}break e}finally{j=null,S=ne,T=!1}J=void 0}}finally{J?he():Z=!1}}}var he;if(typeof _=="function")he=function(){_(ie)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,oe=ee.port2;ee.port1.onmessage=ie,he=function(){oe.postMessage(null)}}else he=function(){E(ie,0)};function ve(H,J){F=E(function(){H(s.unstable_now())},J)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(H){H.callback=null},s.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Y=0<H?Math.floor(1e3/H):5},s.unstable_getCurrentPriorityLevel=function(){return S},s.unstable_next=function(H){switch(S){case 1:case 2:case 3:var J=3;break;default:J=S}var ne=S;S=J;try{return H()}finally{S=ne}},s.unstable_requestPaint=function(){O=!0},s.unstable_runWithPriority=function(H,J){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var ne=S;S=H;try{return J()}finally{S=ne}},s.unstable_scheduleCallback=function(H,J,ne){var P=s.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?P+ne:P):ne=P,H){case 1:var de=-1;break;case 2:de=250;break;case 5:de=1073741823;break;case 4:de=1e4;break;default:de=5e3}return de=ne+de,H={id:b++,callback:J,priorityLevel:H,startTime:ne,expirationTime:de,sortIndex:-1},ne>P?(H.sortIndex=ne,r(g,H),u(y)===null&&H===u(g)&&(D?(R(F),F=-1):D=!0,ve(Q,ne-P))):(H.sortIndex=de,r(y,H),A||T||(A=!0,Z||(Z=!0,he()))),H},s.unstable_shouldYield=ce,s.unstable_wrapCallback=function(H){var J=S;return function(){var ne=S;S=J;try{return H.apply(this,arguments)}finally{S=ne}}}})(yu)),yu}var Lh;function mv(){return Lh||(Lh=1,vu.exports=hv()),vu.exports}var xu={exports:{}},yt={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var Bh;function pv(){if(Bh)return yt;Bh=1;var s=Du();function r(y){var g="https://react.dev/errors/"+y;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)g+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+y+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(){}var o={d:{f:u,r:function(){throw Error(r(522))},D:u,C:u,L:u,m:u,X:u,S:u,M:u},p:0,findDOMNode:null},f=Symbol.for("react.portal");function m(y,g,b){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:j==null?null:""+j,children:y,containerInfo:g,implementation:b}}var p=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function x(y,g){if(y==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return yt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,yt.createPortal=function(y,g){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(r(299));return m(y,g,null,b)},yt.flushSync=function(y){var g=p.T,b=o.p;try{if(p.T=null,o.p=2,y)return y()}finally{p.T=g,o.p=b,o.d.f()}},yt.preconnect=function(y,g){typeof y=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,o.d.C(y,g))},yt.prefetchDNS=function(y){typeof y=="string"&&o.d.D(y)},yt.preinit=function(y,g){if(typeof y=="string"&&g&&typeof g.as=="string"){var b=g.as,j=x(b,g.crossOrigin),S=typeof g.integrity=="string"?g.integrity:void 0,T=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;b==="style"?o.d.S(y,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:j,integrity:S,fetchPriority:T}):b==="script"&&o.d.X(y,{crossOrigin:j,integrity:S,fetchPriority:T,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},yt.preinitModule=function(y,g){if(typeof y=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var b=x(g.as,g.crossOrigin);o.d.M(y,{crossOrigin:b,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&o.d.M(y)},yt.preload=function(y,g){if(typeof y=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var b=g.as,j=x(b,g.crossOrigin);o.d.L(y,b,{crossOrigin:j,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},yt.preloadModule=function(y,g){if(typeof y=="string")if(g){var b=x(g.as,g.crossOrigin);o.d.m(y,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:b,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else o.d.m(y)},yt.requestFormReset=function(y){o.d.r(y)},yt.unstable_batchedUpdates=function(y,g){return y(g)},yt.useFormState=function(y,g,b){return p.H.useFormState(y,g,b)},yt.useFormStatus=function(){return p.H.useHostTransitionStatus()},yt.version="19.2.4",yt}var Hh;function om(){if(Hh)return xu.exports;Hh=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(r){console.error(r)}}return s(),xu.exports=pv(),xu.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var qh;function gv(){if(qh)return Ss;qh=1;var s=mv(),r=Du(),u=om();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function f(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function m(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function p(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function x(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function y(e){if(m(e)!==e)throw Error(o(188))}function g(e){var t=e.alternate;if(!t){if(t=m(e),t===null)throw Error(o(188));return t!==e?null:e}for(var a=e,l=t;;){var i=a.return;if(i===null)break;var c=i.alternate;if(c===null){if(l=i.return,l!==null){a=l;continue}break}if(i.child===c.child){for(c=i.child;c;){if(c===a)return y(i),e;if(c===l)return y(i),t;c=c.sibling}throw Error(o(188))}if(a.return!==l.return)a=i,l=c;else{for(var d=!1,v=i.child;v;){if(v===a){d=!0,a=i,l=c;break}if(v===l){d=!0,l=i,a=c;break}v=v.sibling}if(!d){for(v=c.child;v;){if(v===a){d=!0,a=c,l=i;break}if(v===l){d=!0,l=c,a=i;break}v=v.sibling}if(!d)throw Error(o(189))}}if(a.alternate!==l)throw Error(o(190))}if(a.tag!==3)throw Error(o(188));return a.stateNode.current===a?e:t}function b(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=b(e),t!==null)return t;e=e.sibling}return null}var j=Object.assign,S=Symbol.for("react.element"),T=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),_=Symbol.for("react.context"),K=Symbol.for("react.forward_ref"),Q=Symbol.for("react.suspense"),Z=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),te=Symbol.for("react.activity"),ce=Symbol.for("react.memo_cache_sentinel"),ie=Symbol.iterator;function he(e){return e===null||typeof e!="object"?null:(e=ie&&e[ie]||e["@@iterator"],typeof e=="function"?e:null)}var ee=Symbol.for("react.client.reference");function oe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ee?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case D:return"Fragment";case E:return"Profiler";case O:return"StrictMode";case Q:return"Suspense";case Z:return"SuspenseList";case te:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case A:return"Portal";case _:return e.displayName||"Context";case R:return(e._context.displayName||"Context")+".Consumer";case K:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case F:return t=e.displayName||null,t!==null?t:oe(e.type)||"Memo";case Y:t=e._payload,e=e._init;try{return oe(e(t))}catch{}}return null}var ve=Array.isArray,H=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=u.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},P=[],de=-1;function C(e){return{current:e}}function L(e){0>de||(e.current=P[de],P[de]=null,de--)}function le(e,t){de++,P[de]=e.current,e.current=t}var re=C(null),xe=C(null),be=C(null),Ce=C(null);function Pe(e,t){switch(le(be,t),le(xe,e),le(re,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?th(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=th(t),e=ah(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}L(re),le(re,e)}function W(){L(re),L(xe),L(be)}function X(e){e.memoizedState!==null&&le(Ce,e);var t=re.current,a=ah(t,e.type);t!==a&&(le(xe,e),le(re,a))}function ge(e){xe.current===e&&(L(re),L(xe)),Ce.current===e&&(L(Ce),vs._currentValue=ne)}var qe,Xe;function lt(e){if(qe===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);qe=t&&t[1]||"",Xe=-1<a.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+qe+e+Xe}var Et=!1;function pa(e,t){if(!e||Et)return"";Et=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var $=function(){throw Error()};if(Object.defineProperty($.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct($,[])}catch(q){var B=q}Reflect.construct(e,[],$)}else{try{$.call()}catch(q){B=q}e.call($.prototype)}}else{try{throw Error()}catch(q){B=q}($=e())&&typeof $.catch=="function"&&$.catch(function(){})}}catch(q){if(q&&B&&typeof q.stack=="string")return[q.stack,B.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=l.DetermineComponentFrameRoot(),d=c[0],v=c[1];if(d&&v){var N=d.split(`
|
|
44
|
+
`),U=v.split(`
|
|
45
|
+
`);for(i=l=0;l<N.length&&!N[l].includes("DetermineComponentFrameRoot");)l++;for(;i<U.length&&!U[i].includes("DetermineComponentFrameRoot");)i++;if(l===N.length||i===U.length)for(l=N.length-1,i=U.length-1;1<=l&&0<=i&&N[l]!==U[i];)i--;for(;1<=l&&0<=i;l--,i--)if(N[l]!==U[i]){if(l!==1||i!==1)do if(l--,i--,0>i||N[l]!==U[i]){var G=`
|
|
46
|
+
`+N[l].replace(" at new "," at ");return e.displayName&&G.includes("<anonymous>")&&(G=G.replace("<anonymous>",e.displayName)),G}while(1<=l&&0<=i);break}}}finally{Et=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?lt(a):""}function qa(e,t){switch(e.tag){case 26:case 27:case 5:return lt(e.type);case 16:return lt("Lazy");case 13:return e.child!==t&&t!==null?lt("Suspense Fallback"):lt("Suspense");case 19:return lt("SuspenseList");case 0:case 15:return pa(e.type,!1);case 11:return pa(e.type.render,!1);case 1:return pa(e.type,!0);case 31:return lt("Activity");default:return""}}function xt(e){try{var t="",a=null;do t+=qa(e,a),a=e,e=e.return;while(e);return t}catch(l){return`
|
|
47
|
+
Error generating stack: `+l.message+`
|
|
48
|
+
`+l.stack}}var _e=Object.prototype.hasOwnProperty,hl=s.unstable_scheduleCallback,ml=s.unstable_cancelCallback,$t=s.unstable_shouldYield,Ms=s.unstable_requestPaint,vt=s.unstable_now,tc=s.unstable_getCurrentPriorityLevel,Tn=s.unstable_ImmediatePriority,An=s.unstable_UserBlockingPriority,Ll=s.unstable_NormalPriority,ac=s.unstable_LowPriority,Rs=s.unstable_IdlePriority,lc=s.log,nc=s.unstable_setDisableYieldValue,Ya=null,bt=null;function ra(e){if(typeof lc=="function"&&nc(e),bt&&typeof bt.setStrictMode=="function")try{bt.setStrictMode(Ya,e)}catch{}}var jt=Math.clz32?Math.clz32:ic,sc=Math.log,Ds=Math.LN2;function ic(e){return e>>>=0,e===0?32:31-(sc(e)/Ds|0)|0}var pl=256,gl=262144,vl=4194304;function ua(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 yl(e,t,a){var l=e.pendingLanes;if(l===0)return 0;var i=0,c=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var v=l&134217727;return v!==0?(l=v&~c,l!==0?i=ua(l):(d&=v,d!==0?i=ua(d):a||(a=v&~e,a!==0&&(i=ua(a))))):(v=l&~c,v!==0?i=ua(v):d!==0?i=ua(d):a||(a=l&~e,a!==0&&(i=ua(a)))),i===0?0:t!==0&&t!==i&&(t&c)===0&&(c=i&-i,a=t&-t,c>=a||c===32&&(a&4194048)!==0)?t:i}function M(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ae(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 me(){var e=vl;return vl<<=1,(vl&62914560)===0&&(vl=4194304),e}function De(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Be(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function wt(e,t,a,l,i,c){var d=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var v=e.entanglements,N=e.expirationTimes,U=e.hiddenUpdates;for(a=d&~a;0<a;){var G=31-jt(a),$=1<<G;v[G]=0,N[G]=-1;var B=U[G];if(B!==null)for(U[G]=null,G=0;G<B.length;G++){var q=B[G];q!==null&&(q.lane&=-536870913)}a&=~$}l!==0&&On(e,l,0),c!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=c&~(d&~t))}function On(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-jt(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|a&261930}function Mn(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var l=31-jt(a),i=1<<l;i&t|e[l]&t&&(e[l]|=t),a&=~i}}function Rn(e,t){var a=t&-t;return a=(a&42)!==0?1:Bl(a),(a&(e.suspendedLanes|t))!==0?0:a}function Bl(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 Hl(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Dn(){var e=J.p;return e!==0?e:(e=window.event,e===void 0?32:Eh(e.type))}function zn(e,t){var a=J.p;try{return J.p=e,t()}finally{J.p=a}}var la=Math.random().toString(36).slice(2),nt="__reactFiber$"+la,we="__reactProps$"+la,ze="__reactContainer$"+la,Ee="__reactEvents$"+la,Qt="__reactListeners$"+la,ga="__reactHandles$"+la,Tt="__reactResources$"+la,St="__reactMarker$"+la;function ql(e){delete e[nt],delete e[we],delete e[Ee],delete e[Qt],delete e[ga]}function Ut(e){var t=e[nt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[ze]||a[nt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=uh(e);e!==null;){if(a=e[nt])return a;e=uh(e)}return t}e=a,a=e.parentNode}return null}function va(e){if(e=e[nt]||e[ze]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ga(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function At(e){var t=e[Tt];return t||(t=e[Tt]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function dt(e){e[St]=!0}var Yu=new Set,Gu={};function xl(e,t){Yl(e,t),Yl(e+"Capture",t)}function Yl(e,t){for(Gu[e]=t,e=0;e<t.length;e++)Yu.add(t[e])}var tp=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]*$"),Xu={},Vu={};function ap(e){return _e.call(Vu,e)?!0:_e.call(Xu,e)?!1:tp.test(e)?Vu[e]=!0:(Xu[e]=!0,!1)}function zs(e,t,a){if(ap(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function ks(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function ya(e,t,a,l){if(l===null)e.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+l)}}function Kt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function $u(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function lp(e,t,a){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var i=l.get,c=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(d){a=""+d,c.call(this,d)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return a},setValue:function(d){a=""+d},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function cc(e){if(!e._valueTracker){var t=$u(e)?"checked":"value";e._valueTracker=lp(e,t,""+e[t])}}function Qu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),l="";return e&&(l=$u(e)?e.checked?"true":"false":e.value),e=l,e!==a?(t.setValue(e),!0):!1}function _s(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 np=/[\n"\\]/g;function Zt(e){return e.replace(np,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function rc(e,t,a,l,i,c,d,v){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),t!=null?d==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Kt(t)):e.value!==""+Kt(t)&&(e.value=""+Kt(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?uc(e,d,Kt(t)):a!=null?uc(e,d,Kt(a)):l!=null&&e.removeAttribute("value"),i==null&&c!=null&&(e.defaultChecked=!!c),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.name=""+Kt(v):e.removeAttribute("name")}function Ku(e,t,a,l,i,c,d,v){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||a!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){cc(e);return}a=a!=null?""+Kt(a):"",t=t!=null?""+Kt(t):a,v||t===e.value||(e.value=t),e.defaultValue=t}l=l??i,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=v?e.checked:!!l,e.defaultChecked=!!l,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),cc(e)}function uc(e,t,a){t==="number"&&_s(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Gl(e,t,a,l){if(e=e.options,t){t={};for(var i=0;i<a.length;i++)t["$"+a[i]]=!0;for(a=0;a<e.length;a++)i=t.hasOwnProperty("$"+e[a].value),e[a].selected!==i&&(e[a].selected=i),i&&l&&(e[a].defaultSelected=!0)}else{for(a=""+Kt(a),t=null,i=0;i<e.length;i++){if(e[i].value===a){e[i].selected=!0,l&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Zu(e,t,a){if(t!=null&&(t=""+Kt(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Kt(a):""}function Ju(e,t,a,l){if(t==null){if(l!=null){if(a!=null)throw Error(o(92));if(ve(l)){if(1<l.length)throw Error(o(93));l=l[0]}a=l}a==null&&(a=""),t=a}a=Kt(t),e.defaultValue=a,l=e.textContent,l===a&&l!==""&&l!==null&&(e.value=l),cc(e)}function Xl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var sp=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 Wu(e,t,a){var l=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,a):typeof a!="number"||a===0||sp.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Fu(e,t,a){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,a!=null){for(var l in a)!a.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var i in t)l=t[i],t.hasOwnProperty(i)&&a[i]!==l&&Wu(e,i,l)}else for(var c in t)t.hasOwnProperty(c)&&Wu(e,c,t[c])}function oc(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 ip=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"]]),cp=/^[\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 Us(e){return cp.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function xa(){}var dc=null;function fc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Vl=null,$l=null;function Pu(e){var t=va(e);if(t&&(e=t.stateNode)){var a=e[we]||null;e:switch(e=t.stateNode,t.type){case"input":if(rc(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Zt(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var l=a[t];if(l!==e&&l.form===e.form){var i=l[we]||null;if(!i)throw Error(o(90));rc(l,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<a.length;t++)l=a[t],l.form===e.form&&Qu(l)}break e;case"textarea":Zu(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Gl(e,!!a.multiple,t,!1)}}}var hc=!1;function Iu(e,t,a){if(hc)return e(t,a);hc=!0;try{var l=e(t);return l}finally{if(hc=!1,(Vl!==null||$l!==null)&&(Ni(),Vl&&(t=Vl,e=$l,$l=Vl=null,Pu(t),e)))for(t=0;t<e.length;t++)Pu(e[t])}}function kn(e,t){var a=e.stateNode;if(a===null)return null;var l=a[we]||null;if(l===null)return null;a=l[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":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(o(231,t,typeof a));return a}var ba=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),mc=!1;if(ba)try{var _n={};Object.defineProperty(_n,"passive",{get:function(){mc=!0}}),window.addEventListener("test",_n,_n),window.removeEventListener("test",_n,_n)}catch{mc=!1}var Xa=null,pc=null,Ls=null;function eo(){if(Ls)return Ls;var e,t=pc,a=t.length,l,i="value"in Xa?Xa.value:Xa.textContent,c=i.length;for(e=0;e<a&&t[e]===i[e];e++);var d=a-e;for(l=1;l<=d&&t[a-l]===i[c-l];l++);return Ls=i.slice(e,1<l?1-l:void 0)}function Bs(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 Hs(){return!0}function to(){return!1}function Ot(e){function t(a,l,i,c,d){this._reactName=a,this._targetInst=i,this.type=l,this.nativeEvent=c,this.target=d,this.currentTarget=null;for(var v in e)e.hasOwnProperty(v)&&(a=e[v],this[v]=a?a(c):c[v]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?Hs:to,this.isPropagationStopped=to,this}return j(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Hs)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Hs)},persist:function(){},isPersistent:Hs}),t}var bl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},qs=Ot(bl),Un=j({},bl,{view:0,detail:0}),rp=Ot(Un),gc,vc,Ln,Ys=j({},Un,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xc,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!==Ln&&(Ln&&e.type==="mousemove"?(gc=e.screenX-Ln.screenX,vc=e.screenY-Ln.screenY):vc=gc=0,Ln=e),gc)},movementY:function(e){return"movementY"in e?e.movementY:vc}}),ao=Ot(Ys),up=j({},Ys,{dataTransfer:0}),op=Ot(up),dp=j({},Un,{relatedTarget:0}),yc=Ot(dp),fp=j({},bl,{animationName:0,elapsedTime:0,pseudoElement:0}),hp=Ot(fp),mp=j({},bl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),pp=Ot(mp),gp=j({},bl,{data:0}),lo=Ot(gp),vp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},yp={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"},xp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function bp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=xp[e])?!!t[e]:!1}function xc(){return bp}var jp=j({},Un,{key:function(e){if(e.key){var t=vp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Bs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?yp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xc,charCode:function(e){return e.type==="keypress"?Bs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Bs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Sp=Ot(jp),Np=j({},Ys,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),no=Ot(Np),Cp=j({},Un,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xc}),Ep=Ot(Cp),wp=j({},bl,{propertyName:0,elapsedTime:0,pseudoElement:0}),Tp=Ot(wp),Ap=j({},Ys,{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}),Op=Ot(Ap),Mp=j({},bl,{newState:0,oldState:0}),Rp=Ot(Mp),Dp=[9,13,27,32],bc=ba&&"CompositionEvent"in window,Bn=null;ba&&"documentMode"in document&&(Bn=document.documentMode);var zp=ba&&"TextEvent"in window&&!Bn,so=ba&&(!bc||Bn&&8<Bn&&11>=Bn),io=" ",co=!1;function ro(e,t){switch(e){case"keyup":return Dp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function uo(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ql=!1;function kp(e,t){switch(e){case"compositionend":return uo(t);case"keypress":return t.which!==32?null:(co=!0,io);case"textInput":return e=t.data,e===io&&co?null:e;default:return null}}function _p(e,t){if(Ql)return e==="compositionend"||!bc&&ro(e,t)?(e=eo(),Ls=pc=Xa=null,Ql=!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 so&&t.locale!=="ko"?null:t.data;default:return null}}var Up={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 oo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Up[e.type]:t==="textarea"}function fo(e,t,a,l){Vl?$l?$l.push(l):$l=[l]:Vl=l,t=Mi(t,"onChange"),0<t.length&&(a=new qs("onChange","change",null,a,l),e.push({event:a,listeners:t}))}var Hn=null,qn=null;function Lp(e){Jf(e,0)}function Gs(e){var t=Ga(e);if(Qu(t))return e}function ho(e,t){if(e==="change")return t}var mo=!1;if(ba){var jc;if(ba){var Sc="oninput"in document;if(!Sc){var po=document.createElement("div");po.setAttribute("oninput","return;"),Sc=typeof po.oninput=="function"}jc=Sc}else jc=!1;mo=jc&&(!document.documentMode||9<document.documentMode)}function go(){Hn&&(Hn.detachEvent("onpropertychange",vo),qn=Hn=null)}function vo(e){if(e.propertyName==="value"&&Gs(qn)){var t=[];fo(t,qn,e,fc(e)),Iu(Lp,t)}}function Bp(e,t,a){e==="focusin"?(go(),Hn=t,qn=a,Hn.attachEvent("onpropertychange",vo)):e==="focusout"&&go()}function Hp(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Gs(qn)}function qp(e,t){if(e==="click")return Gs(t)}function Yp(e,t){if(e==="input"||e==="change")return Gs(t)}function Gp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Lt=typeof Object.is=="function"?Object.is:Gp;function Yn(e,t){if(Lt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),l=Object.keys(t);if(a.length!==l.length)return!1;for(l=0;l<a.length;l++){var i=a[l];if(!_e.call(t,i)||!Lt(e[i],t[i]))return!1}return!0}function yo(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function xo(e,t){var a=yo(e);e=0;for(var l;a;){if(a.nodeType===3){if(l=e+a.textContent.length,e<=t&&l>=t)return{node:a,offset:t-e};e=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=yo(a)}}function bo(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?bo(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function jo(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=_s(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=_s(e.document)}return t}function Nc(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 Xp=ba&&"documentMode"in document&&11>=document.documentMode,Kl=null,Cc=null,Gn=null,Ec=!1;function So(e,t,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Ec||Kl==null||Kl!==_s(l)||(l=Kl,"selectionStart"in l&&Nc(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Gn&&Yn(Gn,l)||(Gn=l,l=Mi(Cc,"onSelect"),0<l.length&&(t=new qs("onSelect","select",null,t,a),e.push({event:t,listeners:l}),t.target=Kl)))}function jl(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Zl={animationend:jl("Animation","AnimationEnd"),animationiteration:jl("Animation","AnimationIteration"),animationstart:jl("Animation","AnimationStart"),transitionrun:jl("Transition","TransitionRun"),transitionstart:jl("Transition","TransitionStart"),transitioncancel:jl("Transition","TransitionCancel"),transitionend:jl("Transition","TransitionEnd")},wc={},No={};ba&&(No=document.createElement("div").style,"AnimationEvent"in window||(delete Zl.animationend.animation,delete Zl.animationiteration.animation,delete Zl.animationstart.animation),"TransitionEvent"in window||delete Zl.transitionend.transition);function Sl(e){if(wc[e])return wc[e];if(!Zl[e])return e;var t=Zl[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in No)return wc[e]=t[a];return e}var Co=Sl("animationend"),Eo=Sl("animationiteration"),wo=Sl("animationstart"),Vp=Sl("transitionrun"),$p=Sl("transitionstart"),Qp=Sl("transitioncancel"),To=Sl("transitionend"),Ao=new Map,Tc="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(" ");Tc.push("scrollEnd");function na(e,t){Ao.set(e,t),xl(t,[e])}var Xs=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)},Jt=[],Jl=0,Ac=0;function Vs(){for(var e=Jl,t=Ac=Jl=0;t<e;){var a=Jt[t];Jt[t++]=null;var l=Jt[t];Jt[t++]=null;var i=Jt[t];Jt[t++]=null;var c=Jt[t];if(Jt[t++]=null,l!==null&&i!==null){var d=l.pending;d===null?i.next=i:(i.next=d.next,d.next=i),l.pending=i}c!==0&&Oo(a,i,c)}}function $s(e,t,a,l){Jt[Jl++]=e,Jt[Jl++]=t,Jt[Jl++]=a,Jt[Jl++]=l,Ac|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Oc(e,t,a,l){return $s(e,t,a,l),Qs(e)}function Nl(e,t){return $s(e,null,null,t),Qs(e)}function Oo(e,t,a){e.lanes|=a;var l=e.alternate;l!==null&&(l.lanes|=a);for(var i=!1,c=e.return;c!==null;)c.childLanes|=a,l=c.alternate,l!==null&&(l.childLanes|=a),c.tag===22&&(e=c.stateNode,e===null||e._visibility&1||(i=!0)),e=c,c=c.return;return e.tag===3?(c=e.stateNode,i&&t!==null&&(i=31-jt(a),e=c.hiddenUpdates,l=e[i],l===null?e[i]=[t]:l.push(t),t.lane=a|536870912),c):null}function Qs(e){if(50<os)throw os=0,Br=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Wl={};function Kp(e,t,a,l){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bt(e,t,a,l){return new Kp(e,t,a,l)}function Mc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ja(e,t){var a=e.alternate;return a===null?(a=Bt(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Mo(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ks(e,t,a,l,i,c){var d=0;if(l=e,typeof e=="function")Mc(e)&&(d=1);else if(typeof e=="string")d=Pg(e,a,re.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case te:return e=Bt(31,a,t,i),e.elementType=te,e.lanes=c,e;case D:return Cl(a.children,i,c,t);case O:d=8,i|=24;break;case E:return e=Bt(12,a,t,i|2),e.elementType=E,e.lanes=c,e;case Q:return e=Bt(13,a,t,i),e.elementType=Q,e.lanes=c,e;case Z:return e=Bt(19,a,t,i),e.elementType=Z,e.lanes=c,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case _:d=10;break e;case R:d=9;break e;case K:d=11;break e;case F:d=14;break e;case Y:d=16,l=null;break e}d=29,a=Error(o(130,e===null?"null":typeof e,"")),l=null}return t=Bt(d,a,t,i),t.elementType=e,t.type=l,t.lanes=c,t}function Cl(e,t,a,l){return e=Bt(7,e,l,t),e.lanes=a,e}function Rc(e,t,a){return e=Bt(6,e,null,t),e.lanes=a,e}function Ro(e){var t=Bt(18,null,null,0);return t.stateNode=e,t}function Dc(e,t,a){return t=Bt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Do=new WeakMap;function Wt(e,t){if(typeof e=="object"&&e!==null){var a=Do.get(e);return a!==void 0?a:(t={value:e,source:t,stack:xt(t)},Do.set(e,t),t)}return{value:e,source:t,stack:xt(t)}}var Fl=[],Pl=0,Zs=null,Xn=0,Ft=[],Pt=0,Va=null,oa=1,da="";function Sa(e,t){Fl[Pl++]=Xn,Fl[Pl++]=Zs,Zs=e,Xn=t}function zo(e,t,a){Ft[Pt++]=oa,Ft[Pt++]=da,Ft[Pt++]=Va,Va=e;var l=oa;e=da;var i=32-jt(l)-1;l&=~(1<<i),a+=1;var c=32-jt(t)+i;if(30<c){var d=i-i%5;c=(l&(1<<d)-1).toString(32),l>>=d,i-=d,oa=1<<32-jt(t)+i|a<<i|l,da=c+e}else oa=1<<c|a<<i|l,da=e}function zc(e){e.return!==null&&(Sa(e,1),zo(e,1,0))}function kc(e){for(;e===Zs;)Zs=Fl[--Pl],Fl[Pl]=null,Xn=Fl[--Pl],Fl[Pl]=null;for(;e===Va;)Va=Ft[--Pt],Ft[Pt]=null,da=Ft[--Pt],Ft[Pt]=null,oa=Ft[--Pt],Ft[Pt]=null}function ko(e,t){Ft[Pt++]=oa,Ft[Pt++]=da,Ft[Pt++]=Va,oa=t.id,da=t.overflow,Va=e}var ht=null,Ze=null,Re=!1,$a=null,It=!1,_c=Error(o(519));function Qa(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Vn(Wt(t,e)),_c}function _o(e){var t=e.stateNode,a=e.type,l=e.memoizedProps;switch(t[nt]=e,t[we]=l,a){case"dialog":Ae("cancel",t),Ae("close",t);break;case"iframe":case"object":case"embed":Ae("load",t);break;case"video":case"audio":for(a=0;a<fs.length;a++)Ae(fs[a],t);break;case"source":Ae("error",t);break;case"img":case"image":case"link":Ae("error",t),Ae("load",t);break;case"details":Ae("toggle",t);break;case"input":Ae("invalid",t),Ku(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Ae("invalid",t);break;case"textarea":Ae("invalid",t),Ju(t,l.value,l.defaultValue,l.children)}a=l.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||l.suppressHydrationWarning===!0||If(t.textContent,a)?(l.popover!=null&&(Ae("beforetoggle",t),Ae("toggle",t)),l.onScroll!=null&&Ae("scroll",t),l.onScrollEnd!=null&&Ae("scrollend",t),l.onClick!=null&&(t.onclick=xa),t=!0):t=!1,t||Qa(e,!0)}function Uo(e){for(ht=e.return;ht;)switch(ht.tag){case 5:case 31:case 13:It=!1;return;case 27:case 3:It=!0;return;default:ht=ht.return}}function Il(e){if(e!==ht)return!1;if(!Re)return Uo(e),Re=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Ir(e.type,e.memoizedProps)),a=!a),a&&Ze&&Qa(e),Uo(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Ze=rh(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Ze=rh(e)}else t===27?(t=Ze,il(e.type)?(e=nu,nu=null,Ze=e):Ze=t):Ze=ht?ta(e.stateNode.nextSibling):null;return!0}function El(){Ze=ht=null,Re=!1}function Uc(){var e=$a;return e!==null&&(zt===null?zt=e:zt.push.apply(zt,e),$a=null),e}function Vn(e){$a===null?$a=[e]:$a.push(e)}var Lc=C(null),wl=null,Na=null;function Ka(e,t,a){le(Lc,t._currentValue),t._currentValue=a}function Ca(e){e._currentValue=Lc.current,L(Lc)}function Bc(e,t,a){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===a)break;e=e.return}}function Hc(e,t,a,l){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var c=i.dependencies;if(c!==null){var d=i.child;c=c.firstContext;e:for(;c!==null;){var v=c;c=i;for(var N=0;N<t.length;N++)if(v.context===t[N]){c.lanes|=a,v=c.alternate,v!==null&&(v.lanes|=a),Bc(c.return,a,e),l||(d=null);break e}c=v.next}}else if(i.tag===18){if(d=i.return,d===null)throw Error(o(341));d.lanes|=a,c=d.alternate,c!==null&&(c.lanes|=a),Bc(d,a,e),d=null}else d=i.child;if(d!==null)d.return=i;else for(d=i;d!==null;){if(d===e){d=null;break}if(i=d.sibling,i!==null){i.return=d.return,d=i;break}d=d.return}i=d}}function en(e,t,a,l){e=null;for(var i=t,c=!1;i!==null;){if(!c){if((i.flags&524288)!==0)c=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var d=i.alternate;if(d===null)throw Error(o(387));if(d=d.memoizedProps,d!==null){var v=i.type;Lt(i.pendingProps.value,d.value)||(e!==null?e.push(v):e=[v])}}else if(i===Ce.current){if(d=i.alternate,d===null)throw Error(o(387));d.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(vs):e=[vs])}i=i.return}e!==null&&Hc(t,e,a,l),t.flags|=262144}function Js(e){for(e=e.firstContext;e!==null;){if(!Lt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Tl(e){wl=e,Na=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function mt(e){return Lo(wl,e)}function Ws(e,t){return wl===null&&Tl(e),Lo(e,t)}function Lo(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Na===null){if(e===null)throw Error(o(308));Na=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Na=Na.next=t;return a}var Zp=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},Jp=s.unstable_scheduleCallback,Wp=s.unstable_NormalPriority,st={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function qc(){return{controller:new Zp,data:new Map,refCount:0}}function $n(e){e.refCount--,e.refCount===0&&Jp(Wp,function(){e.controller.abort()})}var Qn=null,Yc=0,tn=0,an=null;function Fp(e,t){if(Qn===null){var a=Qn=[];Yc=0,tn=Vr(),an={status:"pending",value:void 0,then:function(l){a.push(l)}}}return Yc++,t.then(Bo,Bo),t}function Bo(){if(--Yc===0&&Qn!==null){an!==null&&(an.status="fulfilled");var e=Qn;Qn=null,tn=0,an=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Pp(e,t){var a=[],l={status:"pending",value:null,reason:null,then:function(i){a.push(i)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var i=0;i<a.length;i++)(0,a[i])(t)},function(i){for(l.status="rejected",l.reason=i,i=0;i<a.length;i++)(0,a[i])(void 0)}),l}var Ho=H.S;H.S=function(e,t){Nf=vt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Fp(e,t),Ho!==null&&Ho(e,t)};var Al=C(null);function Gc(){var e=Al.current;return e!==null?e:Ke.pooledCache}function Fs(e,t){t===null?le(Al,Al.current):le(Al,t.pool)}function qo(){var e=Gc();return e===null?null:{parent:st._currentValue,pool:e}}var ln=Error(o(460)),Xc=Error(o(474)),Ps=Error(o(542)),Is={then:function(){}};function Yo(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Go(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(xa,xa),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Vo(e),e;default:if(typeof t.status=="string")t.then(xa,xa);else{if(e=Ke,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=l}},function(l){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Vo(e),e}throw Ml=t,ln}}function Ol(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Ml=a,ln):a}}var Ml=null;function Xo(){if(Ml===null)throw Error(o(459));var e=Ml;return Ml=null,e}function Vo(e){if(e===ln||e===Ps)throw Error(o(483))}var nn=null,Kn=0;function ei(e){var t=Kn;return Kn+=1,nn===null&&(nn=[]),Go(nn,e,t)}function Zn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ti(e,t){throw t.$$typeof===S?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function $o(e){function t(z,w){if(e){var k=z.deletions;k===null?(z.deletions=[w],z.flags|=16):k.push(w)}}function a(z,w){if(!e)return null;for(;w!==null;)t(z,w),w=w.sibling;return null}function l(z){for(var w=new Map;z!==null;)z.key!==null?w.set(z.key,z):w.set(z.index,z),z=z.sibling;return w}function i(z,w){return z=ja(z,w),z.index=0,z.sibling=null,z}function c(z,w,k){return z.index=k,e?(k=z.alternate,k!==null?(k=k.index,k<w?(z.flags|=67108866,w):k):(z.flags|=67108866,w)):(z.flags|=1048576,w)}function d(z){return e&&z.alternate===null&&(z.flags|=67108866),z}function v(z,w,k,V){return w===null||w.tag!==6?(w=Rc(k,z.mode,V),w.return=z,w):(w=i(w,k),w.return=z,w)}function N(z,w,k,V){var pe=k.type;return pe===D?G(z,w,k.props.children,V,k.key):w!==null&&(w.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===Y&&Ol(pe)===w.type)?(w=i(w,k.props),Zn(w,k),w.return=z,w):(w=Ks(k.type,k.key,k.props,null,z.mode,V),Zn(w,k),w.return=z,w)}function U(z,w,k,V){return w===null||w.tag!==4||w.stateNode.containerInfo!==k.containerInfo||w.stateNode.implementation!==k.implementation?(w=Dc(k,z.mode,V),w.return=z,w):(w=i(w,k.children||[]),w.return=z,w)}function G(z,w,k,V,pe){return w===null||w.tag!==7?(w=Cl(k,z.mode,V,pe),w.return=z,w):(w=i(w,k),w.return=z,w)}function $(z,w,k){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return w=Rc(""+w,z.mode,k),w.return=z,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case T:return k=Ks(w.type,w.key,w.props,null,z.mode,k),Zn(k,w),k.return=z,k;case A:return w=Dc(w,z.mode,k),w.return=z,w;case Y:return w=Ol(w),$(z,w,k)}if(ve(w)||he(w))return w=Cl(w,z.mode,k,null),w.return=z,w;if(typeof w.then=="function")return $(z,ei(w),k);if(w.$$typeof===_)return $(z,Ws(z,w),k);ti(z,w)}return null}function B(z,w,k,V){var pe=w!==null?w.key:null;if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return pe!==null?null:v(z,w,""+k,V);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case T:return k.key===pe?N(z,w,k,V):null;case A:return k.key===pe?U(z,w,k,V):null;case Y:return k=Ol(k),B(z,w,k,V)}if(ve(k)||he(k))return pe!==null?null:G(z,w,k,V,null);if(typeof k.then=="function")return B(z,w,ei(k),V);if(k.$$typeof===_)return B(z,w,Ws(z,k),V);ti(z,k)}return null}function q(z,w,k,V,pe){if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return z=z.get(k)||null,v(w,z,""+V,pe);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case T:return z=z.get(V.key===null?k:V.key)||null,N(w,z,V,pe);case A:return z=z.get(V.key===null?k:V.key)||null,U(w,z,V,pe);case Y:return V=Ol(V),q(z,w,k,V,pe)}if(ve(V)||he(V))return z=z.get(k)||null,G(w,z,V,pe,null);if(typeof V.then=="function")return q(z,w,k,ei(V),pe);if(V.$$typeof===_)return q(z,w,k,Ws(w,V),pe);ti(w,V)}return null}function ue(z,w,k,V){for(var pe=null,Ue=null,fe=w,Ne=w=0,Me=null;fe!==null&&Ne<k.length;Ne++){fe.index>Ne?(Me=fe,fe=null):Me=fe.sibling;var Le=B(z,fe,k[Ne],V);if(Le===null){fe===null&&(fe=Me);break}e&&fe&&Le.alternate===null&&t(z,fe),w=c(Le,w,Ne),Ue===null?pe=Le:Ue.sibling=Le,Ue=Le,fe=Me}if(Ne===k.length)return a(z,fe),Re&&Sa(z,Ne),pe;if(fe===null){for(;Ne<k.length;Ne++)fe=$(z,k[Ne],V),fe!==null&&(w=c(fe,w,Ne),Ue===null?pe=fe:Ue.sibling=fe,Ue=fe);return Re&&Sa(z,Ne),pe}for(fe=l(fe);Ne<k.length;Ne++)Me=q(fe,z,Ne,k[Ne],V),Me!==null&&(e&&Me.alternate!==null&&fe.delete(Me.key===null?Ne:Me.key),w=c(Me,w,Ne),Ue===null?pe=Me:Ue.sibling=Me,Ue=Me);return e&&fe.forEach(function(dl){return t(z,dl)}),Re&&Sa(z,Ne),pe}function ye(z,w,k,V){if(k==null)throw Error(o(151));for(var pe=null,Ue=null,fe=w,Ne=w=0,Me=null,Le=k.next();fe!==null&&!Le.done;Ne++,Le=k.next()){fe.index>Ne?(Me=fe,fe=null):Me=fe.sibling;var dl=B(z,fe,Le.value,V);if(dl===null){fe===null&&(fe=Me);break}e&&fe&&dl.alternate===null&&t(z,fe),w=c(dl,w,Ne),Ue===null?pe=dl:Ue.sibling=dl,Ue=dl,fe=Me}if(Le.done)return a(z,fe),Re&&Sa(z,Ne),pe;if(fe===null){for(;!Le.done;Ne++,Le=k.next())Le=$(z,Le.value,V),Le!==null&&(w=c(Le,w,Ne),Ue===null?pe=Le:Ue.sibling=Le,Ue=Le);return Re&&Sa(z,Ne),pe}for(fe=l(fe);!Le.done;Ne++,Le=k.next())Le=q(fe,z,Ne,Le.value,V),Le!==null&&(e&&Le.alternate!==null&&fe.delete(Le.key===null?Ne:Le.key),w=c(Le,w,Ne),Ue===null?pe=Le:Ue.sibling=Le,Ue=Le);return e&&fe.forEach(function(uv){return t(z,uv)}),Re&&Sa(z,Ne),pe}function Qe(z,w,k,V){if(typeof k=="object"&&k!==null&&k.type===D&&k.key===null&&(k=k.props.children),typeof k=="object"&&k!==null){switch(k.$$typeof){case T:e:{for(var pe=k.key;w!==null;){if(w.key===pe){if(pe=k.type,pe===D){if(w.tag===7){a(z,w.sibling),V=i(w,k.props.children),V.return=z,z=V;break e}}else if(w.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===Y&&Ol(pe)===w.type){a(z,w.sibling),V=i(w,k.props),Zn(V,k),V.return=z,z=V;break e}a(z,w);break}else t(z,w);w=w.sibling}k.type===D?(V=Cl(k.props.children,z.mode,V,k.key),V.return=z,z=V):(V=Ks(k.type,k.key,k.props,null,z.mode,V),Zn(V,k),V.return=z,z=V)}return d(z);case A:e:{for(pe=k.key;w!==null;){if(w.key===pe)if(w.tag===4&&w.stateNode.containerInfo===k.containerInfo&&w.stateNode.implementation===k.implementation){a(z,w.sibling),V=i(w,k.children||[]),V.return=z,z=V;break e}else{a(z,w);break}else t(z,w);w=w.sibling}V=Dc(k,z.mode,V),V.return=z,z=V}return d(z);case Y:return k=Ol(k),Qe(z,w,k,V)}if(ve(k))return ue(z,w,k,V);if(he(k)){if(pe=he(k),typeof pe!="function")throw Error(o(150));return k=pe.call(k),ye(z,w,k,V)}if(typeof k.then=="function")return Qe(z,w,ei(k),V);if(k.$$typeof===_)return Qe(z,w,Ws(z,k),V);ti(z,k)}return typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint"?(k=""+k,w!==null&&w.tag===6?(a(z,w.sibling),V=i(w,k),V.return=z,z=V):(a(z,w),V=Rc(k,z.mode,V),V.return=z,z=V),d(z)):a(z,w)}return function(z,w,k,V){try{Kn=0;var pe=Qe(z,w,k,V);return nn=null,pe}catch(fe){if(fe===ln||fe===Ps)throw fe;var Ue=Bt(29,fe,null,z.mode);return Ue.lanes=V,Ue.return=z,Ue}finally{}}}var Rl=$o(!0),Qo=$o(!1),Za=!1;function Vc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $c(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 Ja(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Wa(e,t,a){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(He&2)!==0){var i=l.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),l.pending=t,t=Qs(e),Oo(e,null,a),t}return $s(e,l,t,a),Qs(e)}function Jn(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,Mn(e,a)}}function Qc(e,t){var a=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var i=null,c=null;if(a=a.firstBaseUpdate,a!==null){do{var d={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};c===null?i=c=d:c=c.next=d,a=a.next}while(a!==null);c===null?i=c=t:c=c.next=t}else i=c=t;a={baseState:l.baseState,firstBaseUpdate:i,lastBaseUpdate:c,shared:l.shared,callbacks:l.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Kc=!1;function Wn(){if(Kc){var e=an;if(e!==null)throw e}}function Fn(e,t,a,l){Kc=!1;var i=e.updateQueue;Za=!1;var c=i.firstBaseUpdate,d=i.lastBaseUpdate,v=i.shared.pending;if(v!==null){i.shared.pending=null;var N=v,U=N.next;N.next=null,d===null?c=U:d.next=U,d=N;var G=e.alternate;G!==null&&(G=G.updateQueue,v=G.lastBaseUpdate,v!==d&&(v===null?G.firstBaseUpdate=U:v.next=U,G.lastBaseUpdate=N))}if(c!==null){var $=i.baseState;d=0,G=U=N=null,v=c;do{var B=v.lane&-536870913,q=B!==v.lane;if(q?(Oe&B)===B:(l&B)===B){B!==0&&B===tn&&(Kc=!0),G!==null&&(G=G.next={lane:0,tag:v.tag,payload:v.payload,callback:null,next:null});e:{var ue=e,ye=v;B=t;var Qe=a;switch(ye.tag){case 1:if(ue=ye.payload,typeof ue=="function"){$=ue.call(Qe,$,B);break e}$=ue;break e;case 3:ue.flags=ue.flags&-65537|128;case 0:if(ue=ye.payload,B=typeof ue=="function"?ue.call(Qe,$,B):ue,B==null)break e;$=j({},$,B);break e;case 2:Za=!0}}B=v.callback,B!==null&&(e.flags|=64,q&&(e.flags|=8192),q=i.callbacks,q===null?i.callbacks=[B]:q.push(B))}else q={lane:B,tag:v.tag,payload:v.payload,callback:v.callback,next:null},G===null?(U=G=q,N=$):G=G.next=q,d|=B;if(v=v.next,v===null){if(v=i.shared.pending,v===null)break;q=v,v=q.next,q.next=null,i.lastBaseUpdate=q,i.shared.pending=null}}while(!0);G===null&&(N=$),i.baseState=N,i.firstBaseUpdate=U,i.lastBaseUpdate=G,c===null&&(i.shared.lanes=0),tl|=d,e.lanes=d,e.memoizedState=$}}function Ko(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Zo(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Ko(a[e],t)}var sn=C(null),ai=C(0);function Jo(e,t){e=za,le(ai,e),le(sn,t),za=e|t.baseLanes}function Zc(){le(ai,za),le(sn,sn.current)}function Jc(){za=ai.current,L(sn),L(ai)}var Ht=C(null),ea=null;function Fa(e){var t=e.alternate;le(tt,tt.current&1),le(Ht,e),ea===null&&(t===null||sn.current!==null||t.memoizedState!==null)&&(ea=e)}function Wc(e){le(tt,tt.current),le(Ht,e),ea===null&&(ea=e)}function Wo(e){e.tag===22?(le(tt,tt.current),le(Ht,e),ea===null&&(ea=e)):Pa()}function Pa(){le(tt,tt.current),le(Ht,Ht.current)}function qt(e){L(Ht),ea===e&&(ea=null),L(tt)}var tt=C(0);function li(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||au(a)||lu(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ea=0,Se=null,Ve=null,it=null,ni=!1,cn=!1,Dl=!1,si=0,Pn=0,rn=null,Ip=0;function Ie(){throw Error(o(321))}function Fc(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Lt(e[a],t[a]))return!1;return!0}function Pc(e,t,a,l,i,c){return Ea=c,Se=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,H.H=e===null||e.memoizedState===null?zd:hr,Dl=!1,c=a(l,i),Dl=!1,cn&&(c=Po(t,a,l,i)),Fo(e),c}function Fo(e){H.H=ts;var t=Ve!==null&&Ve.next!==null;if(Ea=0,it=Ve=Se=null,ni=!1,Pn=0,rn=null,t)throw Error(o(300));e===null||ct||(e=e.dependencies,e!==null&&Js(e)&&(ct=!0))}function Po(e,t,a,l){Se=e;var i=0;do{if(cn&&(rn=null),Pn=0,cn=!1,25<=i)throw Error(o(301));if(i+=1,it=Ve=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}H.H=kd,c=t(a,l)}while(cn);return c}function eg(){var e=H.H,t=e.useState()[0];return t=typeof t.then=="function"?In(t):t,e=e.useState()[0],(Ve!==null?Ve.memoizedState:null)!==e&&(Se.flags|=1024),t}function Ic(){var e=si!==0;return si=0,e}function er(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function tr(e){if(ni){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ni=!1}Ea=0,it=Ve=Se=null,cn=!1,Pn=si=0,rn=null}function Nt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return it===null?Se.memoizedState=it=e:it=it.next=e,it}function at(){if(Ve===null){var e=Se.alternate;e=e!==null?e.memoizedState:null}else e=Ve.next;var t=it===null?Se.memoizedState:it.next;if(t!==null)it=t,Ve=e;else{if(e===null)throw Se.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},it===null?Se.memoizedState=it=e:it=it.next=e}return it}function ii(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function In(e){var t=Pn;return Pn+=1,rn===null&&(rn=[]),e=Go(rn,e,t),t=Se,(it===null?t.memoizedState:it.next)===null&&(t=t.alternate,H.H=t===null||t.memoizedState===null?zd:hr),e}function ci(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return In(e);if(e.$$typeof===_)return mt(e)}throw Error(o(438,String(e)))}function ar(e){var t=null,a=Se.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var l=Se.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=ii(),Se.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),l=0;l<e;l++)a[l]=ce;return t.index++,a}function wa(e,t){return typeof t=="function"?t(e):t}function ri(e){var t=at();return lr(t,Ve,e)}function lr(e,t,a){var l=e.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=a;var i=e.baseQueue,c=l.pending;if(c!==null){if(i!==null){var d=i.next;i.next=c.next,c.next=d}t.baseQueue=i=c,l.pending=null}if(c=e.baseState,i===null)e.memoizedState=c;else{t=i.next;var v=d=null,N=null,U=t,G=!1;do{var $=U.lane&-536870913;if($!==U.lane?(Oe&$)===$:(Ea&$)===$){var B=U.revertLane;if(B===0)N!==null&&(N=N.next={lane:0,revertLane:0,gesture:null,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null}),$===tn&&(G=!0);else if((Ea&B)===B){U=U.next,B===tn&&(G=!0);continue}else $={lane:0,revertLane:U.revertLane,gesture:null,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null},N===null?(v=N=$,d=c):N=N.next=$,Se.lanes|=B,tl|=B;$=U.action,Dl&&a(c,$),c=U.hasEagerState?U.eagerState:a(c,$)}else B={lane:$,revertLane:U.revertLane,gesture:U.gesture,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null},N===null?(v=N=B,d=c):N=N.next=B,Se.lanes|=$,tl|=$;U=U.next}while(U!==null&&U!==t);if(N===null?d=c:N.next=v,!Lt(c,e.memoizedState)&&(ct=!0,G&&(a=an,a!==null)))throw a;e.memoizedState=c,e.baseState=d,e.baseQueue=N,l.lastRenderedState=c}return i===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function nr(e){var t=at(),a=t.queue;if(a===null)throw Error(o(311));a.lastRenderedReducer=e;var l=a.dispatch,i=a.pending,c=t.memoizedState;if(i!==null){a.pending=null;var d=i=i.next;do c=e(c,d.action),d=d.next;while(d!==i);Lt(c,t.memoizedState)||(ct=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),a.lastRenderedState=c}return[c,l]}function Io(e,t,a){var l=Se,i=at(),c=Re;if(c){if(a===void 0)throw Error(o(407));a=a()}else a=t();var d=!Lt((Ve||i).memoizedState,a);if(d&&(i.memoizedState=a,ct=!0),i=i.queue,cr(ad.bind(null,l,i,e),[e]),i.getSnapshot!==t||d||it!==null&&it.memoizedState.tag&1){if(l.flags|=2048,un(9,{destroy:void 0},td.bind(null,l,i,a,t),null),Ke===null)throw Error(o(349));c||(Ea&127)!==0||ed(l,t,a)}return a}function ed(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Se.updateQueue,t===null?(t=ii(),Se.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function td(e,t,a,l){t.value=a,t.getSnapshot=l,ld(t)&&nd(e)}function ad(e,t,a){return a(function(){ld(t)&&nd(e)})}function ld(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Lt(e,a)}catch{return!0}}function nd(e){var t=Nl(e,2);t!==null&&kt(t,e,2)}function sr(e){var t=Nt();if(typeof e=="function"){var a=e;if(e=a(),Dl){ra(!0);try{a()}finally{ra(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:wa,lastRenderedState:e},t}function sd(e,t,a,l){return e.baseState=a,lr(e,Ve,typeof l=="function"?l:wa)}function tg(e,t,a,l,i){if(di(e))throw Error(o(485));if(e=t.action,e!==null){var c={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(d){c.listeners.push(d)}};H.T!==null?a(!0):c.isTransition=!1,l(c),a=t.pending,a===null?(c.next=t.pending=c,id(t,c)):(c.next=a.next,t.pending=a.next=c)}}function id(e,t){var a=t.action,l=t.payload,i=e.state;if(t.isTransition){var c=H.T,d={};H.T=d;try{var v=a(i,l),N=H.S;N!==null&&N(d,v),cd(e,t,v)}catch(U){ir(e,t,U)}finally{c!==null&&d.types!==null&&(c.types=d.types),H.T=c}}else try{c=a(i,l),cd(e,t,c)}catch(U){ir(e,t,U)}}function cd(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(l){rd(e,t,l)},function(l){return ir(e,t,l)}):rd(e,t,a)}function rd(e,t,a){t.status="fulfilled",t.value=a,ud(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,id(e,a)))}function ir(e,t,a){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=a,ud(t),t=t.next;while(t!==l)}e.action=null}function ud(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function od(e,t){return t}function dd(e,t){if(Re){var a=Ke.formState;if(a!==null){e:{var l=Se;if(Re){if(Ze){t:{for(var i=Ze,c=It;i.nodeType!==8;){if(!c){i=null;break t}if(i=ta(i.nextSibling),i===null){i=null;break t}}c=i.data,i=c==="F!"||c==="F"?i:null}if(i){Ze=ta(i.nextSibling),l=i.data==="F!";break e}}Qa(l)}l=!1}l&&(t=a[0])}}return a=Nt(),a.memoizedState=a.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:od,lastRenderedState:t},a.queue=l,a=Md.bind(null,Se,l),l.dispatch=a,l=sr(!1),c=fr.bind(null,Se,!1,l.queue),l=Nt(),i={state:t,dispatch:null,action:e,pending:null},l.queue=i,a=tg.bind(null,Se,i,c,a),i.dispatch=a,l.memoizedState=e,[t,a,!1]}function fd(e){var t=at();return hd(t,Ve,e)}function hd(e,t,a){if(t=lr(e,t,od)[0],e=ri(wa)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=In(t)}catch(d){throw d===ln?Ps:d}else l=t;t=at();var i=t.queue,c=i.dispatch;return a!==t.memoizedState&&(Se.flags|=2048,un(9,{destroy:void 0},ag.bind(null,i,a),null)),[l,c,e]}function ag(e,t){e.action=t}function md(e){var t=at(),a=Ve;if(a!==null)return hd(t,a,e);at(),t=t.memoizedState,a=at();var l=a.queue.dispatch;return a.memoizedState=e,[t,l,!1]}function un(e,t,a,l){return e={tag:e,create:a,deps:l,inst:t,next:null},t=Se.updateQueue,t===null&&(t=ii(),Se.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(l=a.next,a.next=e,e.next=l,t.lastEffect=e),e}function pd(){return at().memoizedState}function ui(e,t,a,l){var i=Nt();Se.flags|=e,i.memoizedState=un(1|t,{destroy:void 0},a,l===void 0?null:l)}function oi(e,t,a,l){var i=at();l=l===void 0?null:l;var c=i.memoizedState.inst;Ve!==null&&l!==null&&Fc(l,Ve.memoizedState.deps)?i.memoizedState=un(t,c,a,l):(Se.flags|=e,i.memoizedState=un(1|t,c,a,l))}function gd(e,t){ui(8390656,8,e,t)}function cr(e,t){oi(2048,8,e,t)}function lg(e){Se.flags|=4;var t=Se.updateQueue;if(t===null)t=ii(),Se.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function vd(e){var t=at().memoizedState;return lg({ref:t,nextImpl:e}),function(){if((He&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function yd(e,t){return oi(4,2,e,t)}function xd(e,t){return oi(4,4,e,t)}function bd(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function jd(e,t,a){a=a!=null?a.concat([e]):null,oi(4,4,bd.bind(null,t,e),a)}function rr(){}function Sd(e,t){var a=at();t=t===void 0?null:t;var l=a.memoizedState;return t!==null&&Fc(t,l[1])?l[0]:(a.memoizedState=[e,t],e)}function Nd(e,t){var a=at();t=t===void 0?null:t;var l=a.memoizedState;if(t!==null&&Fc(t,l[1]))return l[0];if(l=e(),Dl){ra(!0);try{e()}finally{ra(!1)}}return a.memoizedState=[l,t],l}function ur(e,t,a){return a===void 0||(Ea&1073741824)!==0&&(Oe&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=Ef(),Se.lanes|=e,tl|=e,a)}function Cd(e,t,a,l){return Lt(a,t)?a:sn.current!==null?(e=ur(e,a,l),Lt(e,t)||(ct=!0),e):(Ea&42)===0||(Ea&1073741824)!==0&&(Oe&261930)===0?(ct=!0,e.memoizedState=a):(e=Ef(),Se.lanes|=e,tl|=e,t)}function Ed(e,t,a,l,i){var c=J.p;J.p=c!==0&&8>c?c:8;var d=H.T,v={};H.T=v,fr(e,!1,t,a);try{var N=i(),U=H.S;if(U!==null&&U(v,N),N!==null&&typeof N=="object"&&typeof N.then=="function"){var G=Pp(N,l);es(e,t,G,Xt(e))}else es(e,t,l,Xt(e))}catch($){es(e,t,{then:function(){},status:"rejected",reason:$},Xt())}finally{J.p=c,d!==null&&v.types!==null&&(d.types=v.types),H.T=d}}function ng(){}function or(e,t,a,l){if(e.tag!==5)throw Error(o(476));var i=wd(e).queue;Ed(e,i,t,ne,a===null?ng:function(){return Td(e),a(l)})}function wd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wa,lastRenderedState:ne},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wa,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Td(e){var t=wd(e);t.next===null&&(t=e.alternate.memoizedState),es(e,t.next.queue,{},Xt())}function dr(){return mt(vs)}function Ad(){return at().memoizedState}function Od(){return at().memoizedState}function sg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Xt();e=Ja(a);var l=Wa(t,e,a);l!==null&&(kt(l,t,a),Jn(l,t,a)),t={cache:qc()},e.payload=t;return}t=t.return}}function ig(e,t,a){var l=Xt();a={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},di(e)?Rd(t,a):(a=Oc(e,t,a,l),a!==null&&(kt(a,e,l),Dd(a,t,l)))}function Md(e,t,a){var l=Xt();es(e,t,a,l)}function es(e,t,a,l){var i={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(di(e))Rd(t,i);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var d=t.lastRenderedState,v=c(d,a);if(i.hasEagerState=!0,i.eagerState=v,Lt(v,d))return $s(e,t,i,0),Ke===null&&Vs(),!1}catch{}finally{}if(a=Oc(e,t,i,l),a!==null)return kt(a,e,l),Dd(a,t,l),!0}return!1}function fr(e,t,a,l){if(l={lane:2,revertLane:Vr(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},di(e)){if(t)throw Error(o(479))}else t=Oc(e,a,l,2),t!==null&&kt(t,e,2)}function di(e){var t=e.alternate;return e===Se||t!==null&&t===Se}function Rd(e,t){cn=ni=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Dd(e,t,a){if((a&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,Mn(e,a)}}var ts={readContext:mt,use:ci,useCallback:Ie,useContext:Ie,useEffect:Ie,useImperativeHandle:Ie,useLayoutEffect:Ie,useInsertionEffect:Ie,useMemo:Ie,useReducer:Ie,useRef:Ie,useState:Ie,useDebugValue:Ie,useDeferredValue:Ie,useTransition:Ie,useSyncExternalStore:Ie,useId:Ie,useHostTransitionStatus:Ie,useFormState:Ie,useActionState:Ie,useOptimistic:Ie,useMemoCache:Ie,useCacheRefresh:Ie};ts.useEffectEvent=Ie;var zd={readContext:mt,use:ci,useCallback:function(e,t){return Nt().memoizedState=[e,t===void 0?null:t],e},useContext:mt,useEffect:gd,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,ui(4194308,4,bd.bind(null,t,e),a)},useLayoutEffect:function(e,t){return ui(4194308,4,e,t)},useInsertionEffect:function(e,t){ui(4,2,e,t)},useMemo:function(e,t){var a=Nt();t=t===void 0?null:t;var l=e();if(Dl){ra(!0);try{e()}finally{ra(!1)}}return a.memoizedState=[l,t],l},useReducer:function(e,t,a){var l=Nt();if(a!==void 0){var i=a(t);if(Dl){ra(!0);try{a(t)}finally{ra(!1)}}}else i=t;return l.memoizedState=l.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},l.queue=e,e=e.dispatch=ig.bind(null,Se,e),[l.memoizedState,e]},useRef:function(e){var t=Nt();return e={current:e},t.memoizedState=e},useState:function(e){e=sr(e);var t=e.queue,a=Md.bind(null,Se,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:rr,useDeferredValue:function(e,t){var a=Nt();return ur(a,e,t)},useTransition:function(){var e=sr(!1);return e=Ed.bind(null,Se,e.queue,!0,!1),Nt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var l=Se,i=Nt();if(Re){if(a===void 0)throw Error(o(407));a=a()}else{if(a=t(),Ke===null)throw Error(o(349));(Oe&127)!==0||ed(l,t,a)}i.memoizedState=a;var c={value:a,getSnapshot:t};return i.queue=c,gd(ad.bind(null,l,c,e),[e]),l.flags|=2048,un(9,{destroy:void 0},td.bind(null,l,c,a,t),null),a},useId:function(){var e=Nt(),t=Ke.identifierPrefix;if(Re){var a=da,l=oa;a=(l&~(1<<32-jt(l)-1)).toString(32)+a,t="_"+t+"R_"+a,a=si++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=Ip++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:dr,useFormState:dd,useActionState:dd,useOptimistic:function(e){var t=Nt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=fr.bind(null,Se,!0,a),a.dispatch=t,[e,t]},useMemoCache:ar,useCacheRefresh:function(){return Nt().memoizedState=sg.bind(null,Se)},useEffectEvent:function(e){var t=Nt(),a={impl:e};return t.memoizedState=a,function(){if((He&2)!==0)throw Error(o(440));return a.impl.apply(void 0,arguments)}}},hr={readContext:mt,use:ci,useCallback:Sd,useContext:mt,useEffect:cr,useImperativeHandle:jd,useInsertionEffect:yd,useLayoutEffect:xd,useMemo:Nd,useReducer:ri,useRef:pd,useState:function(){return ri(wa)},useDebugValue:rr,useDeferredValue:function(e,t){var a=at();return Cd(a,Ve.memoizedState,e,t)},useTransition:function(){var e=ri(wa)[0],t=at().memoizedState;return[typeof e=="boolean"?e:In(e),t]},useSyncExternalStore:Io,useId:Ad,useHostTransitionStatus:dr,useFormState:fd,useActionState:fd,useOptimistic:function(e,t){var a=at();return sd(a,Ve,e,t)},useMemoCache:ar,useCacheRefresh:Od};hr.useEffectEvent=vd;var kd={readContext:mt,use:ci,useCallback:Sd,useContext:mt,useEffect:cr,useImperativeHandle:jd,useInsertionEffect:yd,useLayoutEffect:xd,useMemo:Nd,useReducer:nr,useRef:pd,useState:function(){return nr(wa)},useDebugValue:rr,useDeferredValue:function(e,t){var a=at();return Ve===null?ur(a,e,t):Cd(a,Ve.memoizedState,e,t)},useTransition:function(){var e=nr(wa)[0],t=at().memoizedState;return[typeof e=="boolean"?e:In(e),t]},useSyncExternalStore:Io,useId:Ad,useHostTransitionStatus:dr,useFormState:md,useActionState:md,useOptimistic:function(e,t){var a=at();return Ve!==null?sd(a,Ve,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:ar,useCacheRefresh:Od};kd.useEffectEvent=vd;function mr(e,t,a,l){t=e.memoizedState,a=a(l,t),a=a==null?t:j({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var pr={enqueueSetState:function(e,t,a){e=e._reactInternals;var l=Xt(),i=Ja(l);i.payload=t,a!=null&&(i.callback=a),t=Wa(e,i,l),t!==null&&(kt(t,e,l),Jn(t,e,l))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var l=Xt(),i=Ja(l);i.tag=1,i.payload=t,a!=null&&(i.callback=a),t=Wa(e,i,l),t!==null&&(kt(t,e,l),Jn(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Xt(),l=Ja(a);l.tag=2,t!=null&&(l.callback=t),t=Wa(e,l,a),t!==null&&(kt(t,e,a),Jn(t,e,a))}};function _d(e,t,a,l,i,c,d){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,c,d):t.prototype&&t.prototype.isPureReactComponent?!Yn(a,l)||!Yn(i,c):!0}function Ud(e,t,a,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,l),t.state!==e&&pr.enqueueReplaceState(t,t.state,null)}function zl(e,t){var a=t;if("ref"in t){a={};for(var l in t)l!=="ref"&&(a[l]=t[l])}if(e=e.defaultProps){a===t&&(a=j({},a));for(var i in e)a[i]===void 0&&(a[i]=e[i])}return a}function Ld(e){Xs(e)}function Bd(e){console.error(e)}function Hd(e){Xs(e)}function fi(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function qd(e,t,a){try{var l=e.onCaughtError;l(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function gr(e,t,a){return a=Ja(a),a.tag=3,a.payload={element:null},a.callback=function(){fi(e,t)},a}function Yd(e){return e=Ja(e),e.tag=3,e}function Gd(e,t,a,l){var i=a.type.getDerivedStateFromError;if(typeof i=="function"){var c=l.value;e.payload=function(){return i(c)},e.callback=function(){qd(t,a,l)}}var d=a.stateNode;d!==null&&typeof d.componentDidCatch=="function"&&(e.callback=function(){qd(t,a,l),typeof i!="function"&&(al===null?al=new Set([this]):al.add(this));var v=l.stack;this.componentDidCatch(l.value,{componentStack:v!==null?v:""})})}function cg(e,t,a,l,i){if(a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=a.alternate,t!==null&&en(t,a,i,!0),a=Ht.current,a!==null){switch(a.tag){case 31:case 13:return ea===null?Ci():a.alternate===null&&et===0&&(et=3),a.flags&=-257,a.flags|=65536,a.lanes=i,l===Is?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([l]):t.add(l),Yr(e,l,i)),!1;case 22:return a.flags|=65536,l===Is?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([l]):a.add(l)),Yr(e,l,i)),!1}throw Error(o(435,a.tag))}return Yr(e,l,i),Ci(),!1}if(Re)return t=Ht.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,l!==_c&&(e=Error(o(422),{cause:l}),Vn(Wt(e,a)))):(l!==_c&&(t=Error(o(423),{cause:l}),Vn(Wt(t,a))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,l=Wt(l,a),i=gr(e.stateNode,l,i),Qc(e,i),et!==4&&(et=2)),!1;var c=Error(o(520),{cause:l});if(c=Wt(c,a),us===null?us=[c]:us.push(c),et!==4&&(et=2),t===null)return!0;l=Wt(l,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=i&-i,a.lanes|=e,e=gr(a.stateNode,l,e),Qc(a,e),!1;case 1:if(t=a.type,c=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(al===null||!al.has(c))))return a.flags|=65536,i&=-i,a.lanes|=i,i=Yd(i),Gd(i,e,a,l),Qc(a,i),!1}a=a.return}while(a!==null);return!1}var vr=Error(o(461)),ct=!1;function pt(e,t,a,l){t.child=e===null?Qo(t,null,a,l):Rl(t,e.child,a,l)}function Xd(e,t,a,l,i){a=a.render;var c=t.ref;if("ref"in l){var d={};for(var v in l)v!=="ref"&&(d[v]=l[v])}else d=l;return Tl(t),l=Pc(e,t,a,d,c,i),v=Ic(),e!==null&&!ct?(er(e,t,i),Ta(e,t,i)):(Re&&v&&zc(t),t.flags|=1,pt(e,t,l,i),t.child)}function Vd(e,t,a,l,i){if(e===null){var c=a.type;return typeof c=="function"&&!Mc(c)&&c.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=c,$d(e,t,c,l,i)):(e=Ks(a.type,null,l,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!Er(e,i)){var d=c.memoizedProps;if(a=a.compare,a=a!==null?a:Yn,a(d,l)&&e.ref===t.ref)return Ta(e,t,i)}return t.flags|=1,e=ja(c,l),e.ref=t.ref,e.return=t,t.child=e}function $d(e,t,a,l,i){if(e!==null){var c=e.memoizedProps;if(Yn(c,l)&&e.ref===t.ref)if(ct=!1,t.pendingProps=l=c,Er(e,i))(e.flags&131072)!==0&&(ct=!0);else return t.lanes=e.lanes,Ta(e,t,i)}return yr(e,t,a,l,i)}function Qd(e,t,a,l){var i=l.children,c=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(c=c!==null?c.baseLanes|a:a,e!==null){for(l=t.child=e.child,i=0;l!==null;)i=i|l.lanes|l.childLanes,l=l.sibling;l=i&~c}else l=0,t.child=null;return Kd(e,t,c,a,l)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Fs(t,c!==null?c.cachePool:null),c!==null?Jo(t,c):Zc(),Wo(t);else return l=t.lanes=536870912,Kd(e,t,c!==null?c.baseLanes|a:a,a,l)}else c!==null?(Fs(t,c.cachePool),Jo(t,c),Pa(),t.memoizedState=null):(e!==null&&Fs(t,null),Zc(),Pa());return pt(e,t,i,a),t.child}function as(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Kd(e,t,a,l,i){var c=Gc();return c=c===null?null:{parent:st._currentValue,pool:c},t.memoizedState={baseLanes:a,cachePool:c},e!==null&&Fs(t,null),Zc(),Wo(t),e!==null&&en(e,t,l,!0),t.childLanes=i,null}function hi(e,t){return t=pi({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Zd(e,t,a){return Rl(t,e.child,null,a),e=hi(t,t.pendingProps),e.flags|=2,qt(t),t.memoizedState=null,e}function rg(e,t,a){var l=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Re){if(l.mode==="hidden")return e=hi(t,l),t.lanes=536870912,as(null,e);if(Wc(t),(e=Ze)?(e=ch(e,It),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Va!==null?{id:oa,overflow:da}:null,retryLane:536870912,hydrationErrors:null},a=Ro(e),a.return=t,t.child=a,ht=t,Ze=null)):e=null,e===null)throw Qa(t);return t.lanes=536870912,null}return hi(t,l)}var c=e.memoizedState;if(c!==null){var d=c.dehydrated;if(Wc(t),i)if(t.flags&256)t.flags&=-257,t=Zd(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(ct||en(e,t,a,!1),i=(a&e.childLanes)!==0,ct||i){if(l=Ke,l!==null&&(d=Rn(l,a),d!==0&&d!==c.retryLane))throw c.retryLane=d,Nl(e,d),kt(l,e,d),vr;Ci(),t=Zd(e,t,a)}else e=c.treeContext,Ze=ta(d.nextSibling),ht=t,Re=!0,$a=null,It=!1,e!==null&&ko(t,e),t=hi(t,l),t.flags|=4096;return t}return e=ja(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function mi(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(o(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function yr(e,t,a,l,i){return Tl(t),a=Pc(e,t,a,l,void 0,i),l=Ic(),e!==null&&!ct?(er(e,t,i),Ta(e,t,i)):(Re&&l&&zc(t),t.flags|=1,pt(e,t,a,i),t.child)}function Jd(e,t,a,l,i,c){return Tl(t),t.updateQueue=null,a=Po(t,l,a,i),Fo(e),l=Ic(),e!==null&&!ct?(er(e,t,c),Ta(e,t,c)):(Re&&l&&zc(t),t.flags|=1,pt(e,t,a,c),t.child)}function Wd(e,t,a,l,i){if(Tl(t),t.stateNode===null){var c=Wl,d=a.contextType;typeof d=="object"&&d!==null&&(c=mt(d)),c=new a(l,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=pr,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=l,c.state=t.memoizedState,c.refs={},Vc(t),d=a.contextType,c.context=typeof d=="object"&&d!==null?mt(d):Wl,c.state=t.memoizedState,d=a.getDerivedStateFromProps,typeof d=="function"&&(mr(t,a,d,l),c.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(d=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),d!==c.state&&pr.enqueueReplaceState(c,c.state,null),Fn(t,l,c,i),Wn(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){c=t.stateNode;var v=t.memoizedProps,N=zl(a,v);c.props=N;var U=c.context,G=a.contextType;d=Wl,typeof G=="object"&&G!==null&&(d=mt(G));var $=a.getDerivedStateFromProps;G=typeof $=="function"||typeof c.getSnapshotBeforeUpdate=="function",v=t.pendingProps!==v,G||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(v||U!==d)&&Ud(t,c,l,d),Za=!1;var B=t.memoizedState;c.state=B,Fn(t,l,c,i),Wn(),U=t.memoizedState,v||B!==U||Za?(typeof $=="function"&&(mr(t,a,$,l),U=t.memoizedState),(N=Za||_d(t,a,N,l,B,U,d))?(G||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=U),c.props=l,c.state=U,c.context=d,l=N):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{c=t.stateNode,$c(e,t),d=t.memoizedProps,G=zl(a,d),c.props=G,$=t.pendingProps,B=c.context,U=a.contextType,N=Wl,typeof U=="object"&&U!==null&&(N=mt(U)),v=a.getDerivedStateFromProps,(U=typeof v=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(d!==$||B!==N)&&Ud(t,c,l,N),Za=!1,B=t.memoizedState,c.state=B,Fn(t,l,c,i),Wn();var q=t.memoizedState;d!==$||B!==q||Za||e!==null&&e.dependencies!==null&&Js(e.dependencies)?(typeof v=="function"&&(mr(t,a,v,l),q=t.memoizedState),(G=Za||_d(t,a,G,l,B,q,N)||e!==null&&e.dependencies!==null&&Js(e.dependencies))?(U||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(l,q,N),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(l,q,N)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||d===e.memoizedProps&&B===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&B===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=q),c.props=l,c.state=q,c.context=N,l=G):(typeof c.componentDidUpdate!="function"||d===e.memoizedProps&&B===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&B===e.memoizedState||(t.flags|=1024),l=!1)}return c=l,mi(e,t),l=(t.flags&128)!==0,c||l?(c=t.stateNode,a=l&&typeof a.getDerivedStateFromError!="function"?null:c.render(),t.flags|=1,e!==null&&l?(t.child=Rl(t,e.child,null,i),t.child=Rl(t,null,a,i)):pt(e,t,a,i),t.memoizedState=c.state,e=t.child):e=Ta(e,t,i),e}function Fd(e,t,a,l){return El(),t.flags|=256,pt(e,t,a,l),t.child}var xr={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function br(e){return{baseLanes:e,cachePool:qo()}}function jr(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Gt),e}function Pd(e,t,a){var l=t.pendingProps,i=!1,c=(t.flags&128)!==0,d;if((d=c)||(d=e!==null&&e.memoizedState===null?!1:(tt.current&2)!==0),d&&(i=!0,t.flags&=-129),d=(t.flags&32)!==0,t.flags&=-33,e===null){if(Re){if(i?Fa(t):Pa(),(e=Ze)?(e=ch(e,It),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Va!==null?{id:oa,overflow:da}:null,retryLane:536870912,hydrationErrors:null},a=Ro(e),a.return=t,t.child=a,ht=t,Ze=null)):e=null,e===null)throw Qa(t);return lu(e)?t.lanes=32:t.lanes=536870912,null}var v=l.children;return l=l.fallback,i?(Pa(),i=t.mode,v=pi({mode:"hidden",children:v},i),l=Cl(l,i,a,null),v.return=t,l.return=t,v.sibling=l,t.child=v,l=t.child,l.memoizedState=br(a),l.childLanes=jr(e,d,a),t.memoizedState=xr,as(null,l)):(Fa(t),Sr(t,v))}var N=e.memoizedState;if(N!==null&&(v=N.dehydrated,v!==null)){if(c)t.flags&256?(Fa(t),t.flags&=-257,t=Nr(e,t,a)):t.memoizedState!==null?(Pa(),t.child=e.child,t.flags|=128,t=null):(Pa(),v=l.fallback,i=t.mode,l=pi({mode:"visible",children:l.children},i),v=Cl(v,i,a,null),v.flags|=2,l.return=t,v.return=t,l.sibling=v,t.child=l,Rl(t,e.child,null,a),l=t.child,l.memoizedState=br(a),l.childLanes=jr(e,d,a),t.memoizedState=xr,t=as(null,l));else if(Fa(t),lu(v)){if(d=v.nextSibling&&v.nextSibling.dataset,d)var U=d.dgst;d=U,l=Error(o(419)),l.stack="",l.digest=d,Vn({value:l,source:null,stack:null}),t=Nr(e,t,a)}else if(ct||en(e,t,a,!1),d=(a&e.childLanes)!==0,ct||d){if(d=Ke,d!==null&&(l=Rn(d,a),l!==0&&l!==N.retryLane))throw N.retryLane=l,Nl(e,l),kt(d,e,l),vr;au(v)||Ci(),t=Nr(e,t,a)}else au(v)?(t.flags|=192,t.child=e.child,t=null):(e=N.treeContext,Ze=ta(v.nextSibling),ht=t,Re=!0,$a=null,It=!1,e!==null&&ko(t,e),t=Sr(t,l.children),t.flags|=4096);return t}return i?(Pa(),v=l.fallback,i=t.mode,N=e.child,U=N.sibling,l=ja(N,{mode:"hidden",children:l.children}),l.subtreeFlags=N.subtreeFlags&65011712,U!==null?v=ja(U,v):(v=Cl(v,i,a,null),v.flags|=2),v.return=t,l.return=t,l.sibling=v,t.child=l,as(null,l),l=t.child,v=e.child.memoizedState,v===null?v=br(a):(i=v.cachePool,i!==null?(N=st._currentValue,i=i.parent!==N?{parent:N,pool:N}:i):i=qo(),v={baseLanes:v.baseLanes|a,cachePool:i}),l.memoizedState=v,l.childLanes=jr(e,d,a),t.memoizedState=xr,as(e.child,l)):(Fa(t),a=e.child,e=a.sibling,a=ja(a,{mode:"visible",children:l.children}),a.return=t,a.sibling=null,e!==null&&(d=t.deletions,d===null?(t.deletions=[e],t.flags|=16):d.push(e)),t.child=a,t.memoizedState=null,a)}function Sr(e,t){return t=pi({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function pi(e,t){return e=Bt(22,e,null,t),e.lanes=0,e}function Nr(e,t,a){return Rl(t,e.child,null,a),e=Sr(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Id(e,t,a){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),Bc(e.return,t,a)}function Cr(e,t,a,l,i,c){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:a,tailMode:i,treeForkCount:c}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=l,d.tail=a,d.tailMode=i,d.treeForkCount=c)}function ef(e,t,a){var l=t.pendingProps,i=l.revealOrder,c=l.tail;l=l.children;var d=tt.current,v=(d&2)!==0;if(v?(d=d&1|2,t.flags|=128):d&=1,le(tt,d),pt(e,t,l,a),l=Re?Xn:0,!v&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Id(e,a,t);else if(e.tag===19)Id(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case"forwards":for(a=t.child,i=null;a!==null;)e=a.alternate,e!==null&&li(e)===null&&(i=a),a=a.sibling;a=i,a===null?(i=t.child,t.child=null):(i=a.sibling,a.sibling=null),Cr(t,!1,i,a,c,l);break;case"backwards":case"unstable_legacy-backwards":for(a=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&li(e)===null){t.child=i;break}e=i.sibling,i.sibling=a,a=i,i=e}Cr(t,!0,a,null,c,l);break;case"together":Cr(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function Ta(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),tl|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(en(e,t,a,!1),(a&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,a=ja(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=ja(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Er(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Js(e)))}function ug(e,t,a){switch(t.tag){case 3:Pe(t,t.stateNode.containerInfo),Ka(t,st,e.memoizedState.cache),El();break;case 27:case 5:X(t);break;case 4:Pe(t,t.stateNode.containerInfo);break;case 10:Ka(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Wc(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(Fa(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Pd(e,t,a):(Fa(t),e=Ta(e,t,a),e!==null?e.sibling:null);Fa(t);break;case 19:var i=(e.flags&128)!==0;if(l=(a&t.childLanes)!==0,l||(en(e,t,a,!1),l=(a&t.childLanes)!==0),i){if(l)return ef(e,t,a);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),le(tt,tt.current),l)break;return null;case 22:return t.lanes=0,Qd(e,t,a,t.pendingProps);case 24:Ka(t,st,e.memoizedState.cache)}return Ta(e,t,a)}function tf(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)ct=!0;else{if(!Er(e,a)&&(t.flags&128)===0)return ct=!1,ug(e,t,a);ct=(e.flags&131072)!==0}else ct=!1,Re&&(t.flags&1048576)!==0&&zo(t,Xn,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=Ol(t.elementType),t.type=e,typeof e=="function")Mc(e)?(l=zl(e,l),t.tag=1,t=Wd(null,t,e,l,a)):(t.tag=0,t=yr(null,t,e,l,a));else{if(e!=null){var i=e.$$typeof;if(i===K){t.tag=11,t=Xd(null,t,e,l,a);break e}else if(i===F){t.tag=14,t=Vd(null,t,e,l,a);break e}}throw t=oe(e)||e,Error(o(306,t,""))}}return t;case 0:return yr(e,t,t.type,t.pendingProps,a);case 1:return l=t.type,i=zl(l,t.pendingProps),Wd(e,t,l,i,a);case 3:e:{if(Pe(t,t.stateNode.containerInfo),e===null)throw Error(o(387));l=t.pendingProps;var c=t.memoizedState;i=c.element,$c(e,t),Fn(t,l,null,a);var d=t.memoizedState;if(l=d.cache,Ka(t,st,l),l!==c.cache&&Hc(t,[st],a,!0),Wn(),l=d.element,c.isDehydrated)if(c={element:l,isDehydrated:!1,cache:d.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=Fd(e,t,l,a);break e}else if(l!==i){i=Wt(Error(o(424)),t),Vn(i),t=Fd(e,t,l,a);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Ze=ta(e.firstChild),ht=t,Re=!0,$a=null,It=!0,a=Qo(t,null,l,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(El(),l===i){t=Ta(e,t,a);break e}pt(e,t,l,a)}t=t.child}return t;case 26:return mi(e,t),e===null?(a=hh(t.type,null,t.pendingProps,null))?t.memoizedState=a:Re||(a=t.type,e=t.pendingProps,l=Ri(be.current).createElement(a),l[nt]=t,l[we]=e,gt(l,a,e),dt(l),t.stateNode=l):t.memoizedState=hh(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return X(t),e===null&&Re&&(l=t.stateNode=oh(t.type,t.pendingProps,be.current),ht=t,It=!0,i=Ze,il(t.type)?(nu=i,Ze=ta(l.firstChild)):Ze=i),pt(e,t,t.pendingProps.children,a),mi(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Re&&((i=l=Ze)&&(l=Hg(l,t.type,t.pendingProps,It),l!==null?(t.stateNode=l,ht=t,Ze=ta(l.firstChild),It=!1,i=!0):i=!1),i||Qa(t)),X(t),i=t.type,c=t.pendingProps,d=e!==null?e.memoizedProps:null,l=c.children,Ir(i,c)?l=null:d!==null&&Ir(i,d)&&(t.flags|=32),t.memoizedState!==null&&(i=Pc(e,t,eg,null,null,a),vs._currentValue=i),mi(e,t),pt(e,t,l,a),t.child;case 6:return e===null&&Re&&((e=a=Ze)&&(a=qg(a,t.pendingProps,It),a!==null?(t.stateNode=a,ht=t,Ze=null,e=!0):e=!1),e||Qa(t)),null;case 13:return Pd(e,t,a);case 4:return Pe(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Rl(t,null,l,a):pt(e,t,l,a),t.child;case 11:return Xd(e,t,t.type,t.pendingProps,a);case 7:return pt(e,t,t.pendingProps,a),t.child;case 8:return pt(e,t,t.pendingProps.children,a),t.child;case 12:return pt(e,t,t.pendingProps.children,a),t.child;case 10:return l=t.pendingProps,Ka(t,t.type,l.value),pt(e,t,l.children,a),t.child;case 9:return i=t.type._context,l=t.pendingProps.children,Tl(t),i=mt(i),l=l(i),t.flags|=1,pt(e,t,l,a),t.child;case 14:return Vd(e,t,t.type,t.pendingProps,a);case 15:return $d(e,t,t.type,t.pendingProps,a);case 19:return ef(e,t,a);case 31:return rg(e,t,a);case 22:return Qd(e,t,a,t.pendingProps);case 24:return Tl(t),l=mt(st),e===null?(i=Gc(),i===null&&(i=Ke,c=qc(),i.pooledCache=c,c.refCount++,c!==null&&(i.pooledCacheLanes|=a),i=c),t.memoizedState={parent:l,cache:i},Vc(t),Ka(t,st,i)):((e.lanes&a)!==0&&($c(e,t),Fn(t,null,null,a),Wn()),i=e.memoizedState,c=t.memoizedState,i.parent!==l?(i={parent:l,cache:l},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Ka(t,st,l)):(l=c.cache,Ka(t,st,l),l!==i.cache&&Hc(t,[st],a,!0))),pt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Aa(e){e.flags|=4}function wr(e,t,a,l,i){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Of())e.flags|=8192;else throw Ml=Is,Xc}else e.flags&=-16777217}function af(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!yh(t))if(Of())e.flags|=8192;else throw Ml=Is,Xc}function gi(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?me():536870912,e.lanes|=t,hn|=t)}function ls(e,t){if(!Re)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function Je(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,l=0;if(t)for(var i=e.child;i!==null;)a|=i.lanes|i.childLanes,l|=i.subtreeFlags&65011712,l|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)a|=i.lanes|i.childLanes,l|=i.subtreeFlags,l|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=l,e.childLanes=a,t}function og(e,t,a){var l=t.pendingProps;switch(kc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Je(t),null;case 1:return Je(t),null;case 3:return a=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Ca(st),W(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Il(t)?Aa(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Uc())),Je(t),null;case 26:var i=t.type,c=t.memoizedState;return e===null?(Aa(t),c!==null?(Je(t),af(t,c)):(Je(t),wr(t,i,null,l,a))):c?c!==e.memoizedState?(Aa(t),Je(t),af(t,c)):(Je(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&Aa(t),Je(t),wr(t,i,e,l,a)),null;case 27:if(ge(t),a=be.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Aa(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return Je(t),null}e=re.current,Il(t)?_o(t):(e=oh(i,l,a),t.stateNode=e,Aa(t))}return Je(t),null;case 5:if(ge(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Aa(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return Je(t),null}if(c=re.current,Il(t))_o(t);else{var d=Ri(be.current);switch(c){case 1:c=d.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:c=d.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":c=d.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":c=d.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":c=d.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof l.is=="string"?d.createElement("select",{is:l.is}):d.createElement("select"),l.multiple?c.multiple=!0:l.size&&(c.size=l.size);break;default:c=typeof l.is=="string"?d.createElement(i,{is:l.is}):d.createElement(i)}}c[nt]=t,c[we]=l;e:for(d=t.child;d!==null;){if(d.tag===5||d.tag===6)c.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}t.stateNode=c;e:switch(gt(c,i,l),i){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Aa(t)}}return Je(t),wr(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&Aa(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(o(166));if(e=be.current,Il(t)){if(e=t.stateNode,a=t.memoizedProps,l=null,i=ht,i!==null)switch(i.tag){case 27:case 5:l=i.memoizedProps}e[nt]=t,e=!!(e.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||If(e.nodeValue,a)),e||Qa(t,!0)}else e=Ri(e).createTextNode(l),e[nt]=t,t.stateNode=e}return Je(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(l=Il(t),a!==null){if(e===null){if(!l)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[nt]=t}else El(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Je(t),e=!1}else a=Uc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(qt(t),t):(qt(t),null);if((t.flags&128)!==0)throw Error(o(558))}return Je(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Il(t),l!==null&&l.dehydrated!==null){if(e===null){if(!i)throw Error(o(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(o(317));i[nt]=t}else El(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Je(t),i=!1}else i=Uc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(qt(t),t):(qt(t),null)}return qt(t),(t.flags&128)!==0?(t.lanes=a,t):(a=l!==null,e=e!==null&&e.memoizedState!==null,a&&(l=t.child,i=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(i=l.alternate.memoizedState.cachePool.pool),c=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(c=l.memoizedState.cachePool.pool),c!==i&&(l.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),gi(t,t.updateQueue),Je(t),null);case 4:return W(),e===null&&Zr(t.stateNode.containerInfo),Je(t),null;case 10:return Ca(t.type),Je(t),null;case 19:if(L(tt),l=t.memoizedState,l===null)return Je(t),null;if(i=(t.flags&128)!==0,c=l.rendering,c===null)if(i)ls(l,!1);else{if(et!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=li(e),c!==null){for(t.flags|=128,ls(l,!1),e=c.updateQueue,t.updateQueue=e,gi(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Mo(a,e),a=a.sibling;return le(tt,tt.current&1|2),Re&&Sa(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&vt()>ji&&(t.flags|=128,i=!0,ls(l,!1),t.lanes=4194304)}else{if(!i)if(e=li(c),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,gi(t,e),ls(l,!0),l.tail===null&&l.tailMode==="hidden"&&!c.alternate&&!Re)return Je(t),null}else 2*vt()-l.renderingStartTime>ji&&a!==536870912&&(t.flags|=128,i=!0,ls(l,!1),t.lanes=4194304);l.isBackwards?(c.sibling=t.child,t.child=c):(e=l.last,e!==null?e.sibling=c:t.child=c,l.last=c)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=vt(),e.sibling=null,a=tt.current,le(tt,i?a&1|2:a&1),Re&&Sa(t,l.treeForkCount),e):(Je(t),null);case 22:case 23:return qt(t),Jc(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(a&536870912)!==0&&(t.flags&128)===0&&(Je(t),t.subtreeFlags&6&&(t.flags|=8192)):Je(t),a=t.updateQueue,a!==null&&gi(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==a&&(t.flags|=2048),e!==null&&L(Al),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Ca(st),Je(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function dg(e,t){switch(kc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ca(st),W(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ge(t),null;case 31:if(t.memoizedState!==null){if(qt(t),t.alternate===null)throw Error(o(340));El()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(qt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));El()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return L(tt),null;case 4:return W(),null;case 10:return Ca(t.type),null;case 22:case 23:return qt(t),Jc(),e!==null&&L(Al),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ca(st),null;case 25:return null;default:return null}}function lf(e,t){switch(kc(t),t.tag){case 3:Ca(st),W();break;case 26:case 27:case 5:ge(t);break;case 4:W();break;case 31:t.memoizedState!==null&&qt(t);break;case 13:qt(t);break;case 19:L(tt);break;case 10:Ca(t.type);break;case 22:case 23:qt(t),Jc(),e!==null&&L(Al);break;case 24:Ca(st)}}function ns(e,t){try{var a=t.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var i=l.next;a=i;do{if((a.tag&e)===e){l=void 0;var c=a.create,d=a.inst;l=c(),d.destroy=l}a=a.next}while(a!==i)}}catch(v){Ge(t,t.return,v)}}function Ia(e,t,a){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var c=i.next;l=c;do{if((l.tag&e)===e){var d=l.inst,v=d.destroy;if(v!==void 0){d.destroy=void 0,i=t;var N=a,U=v;try{U()}catch(G){Ge(i,N,G)}}}l=l.next}while(l!==c)}}catch(G){Ge(t,t.return,G)}}function nf(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Zo(t,a)}catch(l){Ge(e,e.return,l)}}}function sf(e,t,a){a.props=zl(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(l){Ge(e,t,l)}}function ss(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof a=="function"?e.refCleanup=a(l):a.current=l}}catch(i){Ge(e,t,i)}}function fa(e,t){var a=e.ref,l=e.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(i){Ge(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(i){Ge(e,t,i)}else a.current=null}function cf(e){var t=e.type,a=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(i){Ge(e,e.return,i)}}function Tr(e,t,a){try{var l=e.stateNode;zg(l,e.type,a,t),l[we]=t}catch(i){Ge(e,e.return,i)}}function rf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&il(e.type)||e.tag===4}function Ar(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||rf(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&&il(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 Or(e,t,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=xa));else if(l!==4&&(l===27&&il(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Or(e,t,a),e=e.sibling;e!==null;)Or(e,t,a),e=e.sibling}function vi(e,t,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(l!==4&&(l===27&&il(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(vi(e,t,a),e=e.sibling;e!==null;)vi(e,t,a),e=e.sibling}function uf(e){var t=e.stateNode,a=e.memoizedProps;try{for(var l=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);gt(t,l,a),t[nt]=e,t[we]=a}catch(c){Ge(e,e.return,c)}}var Oa=!1,rt=!1,Mr=!1,of=typeof WeakSet=="function"?WeakSet:Set,ft=null;function fg(e,t){if(e=e.containerInfo,Fr=Bi,e=jo(e),Nc(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var i=l.anchorOffset,c=l.focusNode;l=l.focusOffset;try{a.nodeType,c.nodeType}catch{a=null;break e}var d=0,v=-1,N=-1,U=0,G=0,$=e,B=null;t:for(;;){for(var q;$!==a||i!==0&&$.nodeType!==3||(v=d+i),$!==c||l!==0&&$.nodeType!==3||(N=d+l),$.nodeType===3&&(d+=$.nodeValue.length),(q=$.firstChild)!==null;)B=$,$=q;for(;;){if($===e)break t;if(B===a&&++U===i&&(v=d),B===c&&++G===l&&(N=d),(q=$.nextSibling)!==null)break;$=B,B=$.parentNode}$=q}a=v===-1||N===-1?null:{start:v,end:N}}else a=null}a=a||{start:0,end:0}}else a=null;for(Pr={focusedElem:e,selectionRange:a},Bi=!1,ft=t;ft!==null;)if(t=ft,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ft=e;else for(;ft!==null;){switch(t=ft,c=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)i=e[a],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&c!==null){e=void 0,a=t,i=c.memoizedProps,c=c.memoizedState,l=a.stateNode;try{var ue=zl(a.type,i);e=l.getSnapshotBeforeUpdate(ue,c),l.__reactInternalSnapshotBeforeUpdate=e}catch(ye){Ge(a,a.return,ye)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)tu(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":tu(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,ft=e;break}ft=t.return}}function df(e,t,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:Ra(e,a),l&4&&ns(5,a);break;case 1:if(Ra(e,a),l&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(d){Ge(a,a.return,d)}else{var i=zl(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(d){Ge(a,a.return,d)}}l&64&&nf(a),l&512&&ss(a,a.return);break;case 3:if(Ra(e,a),l&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{Zo(e,t)}catch(d){Ge(a,a.return,d)}}break;case 27:t===null&&l&4&&uf(a);case 26:case 5:Ra(e,a),t===null&&l&4&&cf(a),l&512&&ss(a,a.return);break;case 12:Ra(e,a);break;case 31:Ra(e,a),l&4&&mf(e,a);break;case 13:Ra(e,a),l&4&&pf(e,a),l&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=jg.bind(null,a),Yg(e,a))));break;case 22:if(l=a.memoizedState!==null||Oa,!l){t=t!==null&&t.memoizedState!==null||rt,i=Oa;var c=rt;Oa=l,(rt=t)&&!c?Da(e,a,(a.subtreeFlags&8772)!==0):Ra(e,a),Oa=i,rt=c}break;case 30:break;default:Ra(e,a)}}function ff(e){var t=e.alternate;t!==null&&(e.alternate=null,ff(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ql(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 We=null,Mt=!1;function Ma(e,t,a){for(a=a.child;a!==null;)hf(e,t,a),a=a.sibling}function hf(e,t,a){if(bt&&typeof bt.onCommitFiberUnmount=="function")try{bt.onCommitFiberUnmount(Ya,a)}catch{}switch(a.tag){case 26:rt||fa(a,t),Ma(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:rt||fa(a,t);var l=We,i=Mt;il(a.type)&&(We=a.stateNode,Mt=!1),Ma(e,t,a),ms(a.stateNode),We=l,Mt=i;break;case 5:rt||fa(a,t);case 6:if(l=We,i=Mt,We=null,Ma(e,t,a),We=l,Mt=i,We!==null)if(Mt)try{(We.nodeType===9?We.body:We.nodeName==="HTML"?We.ownerDocument.body:We).removeChild(a.stateNode)}catch(c){Ge(a,t,c)}else try{We.removeChild(a.stateNode)}catch(c){Ge(a,t,c)}break;case 18:We!==null&&(Mt?(e=We,sh(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),jn(e)):sh(We,a.stateNode));break;case 4:l=We,i=Mt,We=a.stateNode.containerInfo,Mt=!0,Ma(e,t,a),We=l,Mt=i;break;case 0:case 11:case 14:case 15:Ia(2,a,t),rt||Ia(4,a,t),Ma(e,t,a);break;case 1:rt||(fa(a,t),l=a.stateNode,typeof l.componentWillUnmount=="function"&&sf(a,t,l)),Ma(e,t,a);break;case 21:Ma(e,t,a);break;case 22:rt=(l=rt)||a.memoizedState!==null,Ma(e,t,a),rt=l;break;default:Ma(e,t,a)}}function mf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{jn(e)}catch(a){Ge(t,t.return,a)}}}function pf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{jn(e)}catch(a){Ge(t,t.return,a)}}function hg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new of),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new of),t;default:throw Error(o(435,e.tag))}}function yi(e,t){var a=hg(e);t.forEach(function(l){if(!a.has(l)){a.add(l);var i=Sg.bind(null,e,l);l.then(i,i)}})}function Rt(e,t){var a=t.deletions;if(a!==null)for(var l=0;l<a.length;l++){var i=a[l],c=e,d=t,v=d;e:for(;v!==null;){switch(v.tag){case 27:if(il(v.type)){We=v.stateNode,Mt=!1;break e}break;case 5:We=v.stateNode,Mt=!1;break e;case 3:case 4:We=v.stateNode.containerInfo,Mt=!0;break e}v=v.return}if(We===null)throw Error(o(160));hf(c,d,i),We=null,Mt=!1,c=i.alternate,c!==null&&(c.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)gf(t,e),t=t.sibling}var sa=null;function gf(e,t){var a=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Rt(t,e),Dt(e),l&4&&(Ia(3,e,e.return),ns(3,e),Ia(5,e,e.return));break;case 1:Rt(t,e),Dt(e),l&512&&(rt||a===null||fa(a,a.return)),l&64&&Oa&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?l:a.concat(l))));break;case 26:var i=sa;if(Rt(t,e),Dt(e),l&512&&(rt||a===null||fa(a,a.return)),l&4){var c=a!==null?a.memoizedState:null;if(l=e.memoizedState,a===null)if(l===null)if(e.stateNode===null){e:{l=e.type,a=e.memoizedProps,i=i.ownerDocument||i;t:switch(l){case"title":c=i.getElementsByTagName("title")[0],(!c||c[St]||c[nt]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=i.createElement(l),i.head.insertBefore(c,i.querySelector("head > title"))),gt(c,l,a),c[nt]=e,dt(c),l=c;break e;case"link":var d=gh("link","href",i).get(l+(a.href||""));if(d){for(var v=0;v<d.length;v++)if(c=d[v],c.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&c.getAttribute("rel")===(a.rel==null?null:a.rel)&&c.getAttribute("title")===(a.title==null?null:a.title)&&c.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){d.splice(v,1);break t}}c=i.createElement(l),gt(c,l,a),i.head.appendChild(c);break;case"meta":if(d=gh("meta","content",i).get(l+(a.content||""))){for(v=0;v<d.length;v++)if(c=d[v],c.getAttribute("content")===(a.content==null?null:""+a.content)&&c.getAttribute("name")===(a.name==null?null:a.name)&&c.getAttribute("property")===(a.property==null?null:a.property)&&c.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&c.getAttribute("charset")===(a.charSet==null?null:a.charSet)){d.splice(v,1);break t}}c=i.createElement(l),gt(c,l,a),i.head.appendChild(c);break;default:throw Error(o(468,l))}c[nt]=e,dt(c),l=c}e.stateNode=l}else vh(i,e.type,e.stateNode);else e.stateNode=ph(i,l,e.memoizedProps);else c!==l?(c===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):c.count--,l===null?vh(i,e.type,e.stateNode):ph(i,l,e.memoizedProps)):l===null&&e.stateNode!==null&&Tr(e,e.memoizedProps,a.memoizedProps)}break;case 27:Rt(t,e),Dt(e),l&512&&(rt||a===null||fa(a,a.return)),a!==null&&l&4&&Tr(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Rt(t,e),Dt(e),l&512&&(rt||a===null||fa(a,a.return)),e.flags&32){i=e.stateNode;try{Xl(i,"")}catch(ue){Ge(e,e.return,ue)}}l&4&&e.stateNode!=null&&(i=e.memoizedProps,Tr(e,i,a!==null?a.memoizedProps:i)),l&1024&&(Mr=!0);break;case 6:if(Rt(t,e),Dt(e),l&4){if(e.stateNode===null)throw Error(o(162));l=e.memoizedProps,a=e.stateNode;try{a.nodeValue=l}catch(ue){Ge(e,e.return,ue)}}break;case 3:if(ki=null,i=sa,sa=Di(t.containerInfo),Rt(t,e),sa=i,Dt(e),l&4&&a!==null&&a.memoizedState.isDehydrated)try{jn(t.containerInfo)}catch(ue){Ge(e,e.return,ue)}Mr&&(Mr=!1,vf(e));break;case 4:l=sa,sa=Di(e.stateNode.containerInfo),Rt(t,e),Dt(e),sa=l;break;case 12:Rt(t,e),Dt(e);break;case 31:Rt(t,e),Dt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,yi(e,l)));break;case 13:Rt(t,e),Dt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(bi=vt()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,yi(e,l)));break;case 22:i=e.memoizedState!==null;var N=a!==null&&a.memoizedState!==null,U=Oa,G=rt;if(Oa=U||i,rt=G||N,Rt(t,e),rt=G,Oa=U,Dt(e),l&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(a===null||N||Oa||rt||kl(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){N=a=t;try{if(c=N.stateNode,i)d=c.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none";else{v=N.stateNode;var $=N.memoizedProps.style,B=$!=null&&$.hasOwnProperty("display")?$.display:null;v.style.display=B==null||typeof B=="boolean"?"":(""+B).trim()}}catch(ue){Ge(N,N.return,ue)}}}else if(t.tag===6){if(a===null){N=t;try{N.stateNode.nodeValue=i?"":N.memoizedProps}catch(ue){Ge(N,N.return,ue)}}}else if(t.tag===18){if(a===null){N=t;try{var q=N.stateNode;i?ih(q,!0):ih(N.stateNode,!1)}catch(ue){Ge(N,N.return,ue)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(a=l.retryQueue,a!==null&&(l.retryQueue=null,yi(e,a))));break;case 19:Rt(t,e),Dt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,yi(e,l)));break;case 30:break;case 21:break;default:Rt(t,e),Dt(e)}}function Dt(e){var t=e.flags;if(t&2){try{for(var a,l=e.return;l!==null;){if(rf(l)){a=l;break}l=l.return}if(a==null)throw Error(o(160));switch(a.tag){case 27:var i=a.stateNode,c=Ar(e);vi(e,c,i);break;case 5:var d=a.stateNode;a.flags&32&&(Xl(d,""),a.flags&=-33);var v=Ar(e);vi(e,v,d);break;case 3:case 4:var N=a.stateNode.containerInfo,U=Ar(e);Or(e,U,N);break;default:throw Error(o(161))}}catch(G){Ge(e,e.return,G)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function vf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;vf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ra(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)df(e,t.alternate,t),t=t.sibling}function kl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ia(4,t,t.return),kl(t);break;case 1:fa(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&sf(t,t.return,a),kl(t);break;case 27:ms(t.stateNode);case 26:case 5:fa(t,t.return),kl(t);break;case 22:t.memoizedState===null&&kl(t);break;case 30:kl(t);break;default:kl(t)}e=e.sibling}}function Da(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,i=e,c=t,d=c.flags;switch(c.tag){case 0:case 11:case 15:Da(i,c,a),ns(4,c);break;case 1:if(Da(i,c,a),l=c,i=l.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(U){Ge(l,l.return,U)}if(l=c,i=l.updateQueue,i!==null){var v=l.stateNode;try{var N=i.shared.hiddenCallbacks;if(N!==null)for(i.shared.hiddenCallbacks=null,i=0;i<N.length;i++)Ko(N[i],v)}catch(U){Ge(l,l.return,U)}}a&&d&64&&nf(c),ss(c,c.return);break;case 27:uf(c);case 26:case 5:Da(i,c,a),a&&l===null&&d&4&&cf(c),ss(c,c.return);break;case 12:Da(i,c,a);break;case 31:Da(i,c,a),a&&d&4&&mf(i,c);break;case 13:Da(i,c,a),a&&d&4&&pf(i,c);break;case 22:c.memoizedState===null&&Da(i,c,a),ss(c,c.return);break;case 30:break;default:Da(i,c,a)}t=t.sibling}}function Rr(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&$n(a))}function Dr(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&$n(e))}function ia(e,t,a,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)yf(e,t,a,l),t=t.sibling}function yf(e,t,a,l){var i=t.flags;switch(t.tag){case 0:case 11:case 15:ia(e,t,a,l),i&2048&&ns(9,t);break;case 1:ia(e,t,a,l);break;case 3:ia(e,t,a,l),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&$n(e)));break;case 12:if(i&2048){ia(e,t,a,l),e=t.stateNode;try{var c=t.memoizedProps,d=c.id,v=c.onPostCommit;typeof v=="function"&&v(d,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(N){Ge(t,t.return,N)}}else ia(e,t,a,l);break;case 31:ia(e,t,a,l);break;case 13:ia(e,t,a,l);break;case 23:break;case 22:c=t.stateNode,d=t.alternate,t.memoizedState!==null?c._visibility&2?ia(e,t,a,l):is(e,t):c._visibility&2?ia(e,t,a,l):(c._visibility|=2,on(e,t,a,l,(t.subtreeFlags&10256)!==0||!1)),i&2048&&Rr(d,t);break;case 24:ia(e,t,a,l),i&2048&&Dr(t.alternate,t);break;default:ia(e,t,a,l)}}function on(e,t,a,l,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,d=t,v=a,N=l,U=d.flags;switch(d.tag){case 0:case 11:case 15:on(c,d,v,N,i),ns(8,d);break;case 23:break;case 22:var G=d.stateNode;d.memoizedState!==null?G._visibility&2?on(c,d,v,N,i):is(c,d):(G._visibility|=2,on(c,d,v,N,i)),i&&U&2048&&Rr(d.alternate,d);break;case 24:on(c,d,v,N,i),i&&U&2048&&Dr(d.alternate,d);break;default:on(c,d,v,N,i)}t=t.sibling}}function is(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,l=t,i=l.flags;switch(l.tag){case 22:is(a,l),i&2048&&Rr(l.alternate,l);break;case 24:is(a,l),i&2048&&Dr(l.alternate,l);break;default:is(a,l)}t=t.sibling}}var cs=8192;function dn(e,t,a){if(e.subtreeFlags&cs)for(e=e.child;e!==null;)xf(e,t,a),e=e.sibling}function xf(e,t,a){switch(e.tag){case 26:dn(e,t,a),e.flags&cs&&e.memoizedState!==null&&Ig(a,sa,e.memoizedState,e.memoizedProps);break;case 5:dn(e,t,a);break;case 3:case 4:var l=sa;sa=Di(e.stateNode.containerInfo),dn(e,t,a),sa=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=cs,cs=16777216,dn(e,t,a),cs=l):dn(e,t,a));break;default:dn(e,t,a)}}function bf(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 rs(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var l=t[a];ft=l,Sf(l,e)}bf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)jf(e),e=e.sibling}function jf(e){switch(e.tag){case 0:case 11:case 15:rs(e),e.flags&2048&&Ia(9,e,e.return);break;case 3:rs(e);break;case 12:rs(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,xi(e)):rs(e);break;default:rs(e)}}function xi(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var l=t[a];ft=l,Sf(l,e)}bf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ia(8,t,t.return),xi(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,xi(t));break;default:xi(t)}e=e.sibling}}function Sf(e,t){for(;ft!==null;){var a=ft;switch(a.tag){case 0:case 11:case 15:Ia(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var l=a.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:$n(a.memoizedState.cache)}if(l=a.child,l!==null)l.return=a,ft=l;else e:for(a=e;ft!==null;){l=ft;var i=l.sibling,c=l.return;if(ff(l),l===a){ft=null;break e}if(i!==null){i.return=c,ft=i;break e}ft=c}}}var mg={getCacheForType:function(e){var t=mt(st),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return mt(st).controller.signal}},pg=typeof WeakMap=="function"?WeakMap:Map,He=0,Ke=null,Te=null,Oe=0,Ye=0,Yt=null,el=!1,fn=!1,zr=!1,za=0,et=0,tl=0,_l=0,kr=0,Gt=0,hn=0,us=null,zt=null,_r=!1,bi=0,Nf=0,ji=1/0,Si=null,al=null,ot=0,ll=null,mn=null,ka=0,Ur=0,Lr=null,Cf=null,os=0,Br=null;function Xt(){return(He&2)!==0&&Oe!==0?Oe&-Oe:H.T!==null?Vr():Dn()}function Ef(){if(Gt===0)if((Oe&536870912)===0||Re){var e=gl;gl<<=1,(gl&3932160)===0&&(gl=262144),Gt=e}else Gt=536870912;return e=Ht.current,e!==null&&(e.flags|=32),Gt}function kt(e,t,a){(e===Ke&&(Ye===2||Ye===9)||e.cancelPendingCommit!==null)&&(pn(e,0),nl(e,Oe,Gt,!1)),Be(e,a),((He&2)===0||e!==Ke)&&(e===Ke&&((He&2)===0&&(_l|=a),et===4&&nl(e,Oe,Gt,!1)),ha(e))}function wf(e,t,a){if((He&6)!==0)throw Error(o(327));var l=!a&&(t&127)===0&&(t&e.expiredLanes)===0||M(e,t),i=l?yg(e,t):qr(e,t,!0),c=l;do{if(i===0){fn&&!l&&nl(e,t,0,!1);break}else{if(a=e.current.alternate,c&&!gg(a)){i=qr(e,t,!1),c=!1;continue}if(i===2){if(c=t,e.errorRecoveryDisabledLanes&c)var d=0;else d=e.pendingLanes&-536870913,d=d!==0?d:d&536870912?536870912:0;if(d!==0){t=d;e:{var v=e;i=us;var N=v.current.memoizedState.isDehydrated;if(N&&(pn(v,d).flags|=256),d=qr(v,d,!1),d!==2){if(zr&&!N){v.errorRecoveryDisabledLanes|=c,_l|=c,i=4;break e}c=zt,zt=i,c!==null&&(zt===null?zt=c:zt.push.apply(zt,c))}i=d}if(c=!1,i!==2)continue}}if(i===1){pn(e,0),nl(e,t,0,!0);break}e:{switch(l=e,c=i,c){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:nl(l,t,Gt,!el);break e;case 2:zt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(i=bi+300-vt(),10<i)){if(nl(l,t,Gt,!el),yl(l,0,!0)!==0)break e;ka=t,l.timeoutHandle=lh(Tf.bind(null,l,a,zt,Si,_r,t,Gt,_l,hn,el,c,"Throttled",-0,0),i);break e}Tf(l,a,zt,Si,_r,t,Gt,_l,hn,el,c,null,-0,0)}}break}while(!0);ha(e)}function Tf(e,t,a,l,i,c,d,v,N,U,G,$,B,q){if(e.timeoutHandle=-1,$=t.subtreeFlags,$&8192||($&16785408)===16785408){$={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:xa},xf(t,c,$);var ue=(c&62914560)===c?bi-vt():(c&4194048)===c?Nf-vt():0;if(ue=ev($,ue),ue!==null){ka=c,e.cancelPendingCommit=ue(_f.bind(null,e,t,c,a,l,i,d,v,N,G,$,null,B,q)),nl(e,c,d,!U);return}}_f(e,t,c,a,l,i,d,v,N)}function gg(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var l=0;l<a.length;l++){var i=a[l],c=i.getSnapshot;i=i.value;try{if(!Lt(c(),i))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function nl(e,t,a,l){t&=~kr,t&=~_l,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var i=t;0<i;){var c=31-jt(i),d=1<<c;l[c]=-1,i&=~d}a!==0&&On(e,a,t)}function Ni(){return(He&6)===0?(ds(0),!1):!0}function Hr(){if(Te!==null){if(Ye===0)var e=Te.return;else e=Te,Na=wl=null,tr(e),nn=null,Kn=0,e=Te;for(;e!==null;)lf(e.alternate,e),e=e.return;Te=null}}function pn(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Ug(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),ka=0,Hr(),Ke=e,Te=a=ja(e.current,null),Oe=t,Ye=0,Yt=null,el=!1,fn=M(e,t),zr=!1,hn=Gt=kr=_l=tl=et=0,zt=us=null,_r=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var i=31-jt(l),c=1<<i;t|=e[i],l&=~c}return za=t,Vs(),a}function Af(e,t){Se=null,H.H=ts,t===ln||t===Ps?(t=Xo(),Ye=3):t===Xc?(t=Xo(),Ye=4):Ye=t===vr?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Yt=t,Te===null&&(et=1,fi(e,Wt(t,e.current)))}function Of(){var e=Ht.current;return e===null?!0:(Oe&4194048)===Oe?ea===null:(Oe&62914560)===Oe||(Oe&536870912)!==0?e===ea:!1}function Mf(){var e=H.H;return H.H=ts,e===null?ts:e}function Rf(){var e=H.A;return H.A=mg,e}function Ci(){et=4,el||(Oe&4194048)!==Oe&&Ht.current!==null||(fn=!0),(tl&134217727)===0&&(_l&134217727)===0||Ke===null||nl(Ke,Oe,Gt,!1)}function qr(e,t,a){var l=He;He|=2;var i=Mf(),c=Rf();(Ke!==e||Oe!==t)&&(Si=null,pn(e,t)),t=!1;var d=et;e:do try{if(Ye!==0&&Te!==null){var v=Te,N=Yt;switch(Ye){case 8:Hr(),d=6;break e;case 3:case 2:case 9:case 6:Ht.current===null&&(t=!0);var U=Ye;if(Ye=0,Yt=null,gn(e,v,N,U),a&&fn){d=0;break e}break;default:U=Ye,Ye=0,Yt=null,gn(e,v,N,U)}}vg(),d=et;break}catch(G){Af(e,G)}while(!0);return t&&e.shellSuspendCounter++,Na=wl=null,He=l,H.H=i,H.A=c,Te===null&&(Ke=null,Oe=0,Vs()),d}function vg(){for(;Te!==null;)Df(Te)}function yg(e,t){var a=He;He|=2;var l=Mf(),i=Rf();Ke!==e||Oe!==t?(Si=null,ji=vt()+500,pn(e,t)):fn=M(e,t);e:do try{if(Ye!==0&&Te!==null){t=Te;var c=Yt;t:switch(Ye){case 1:Ye=0,Yt=null,gn(e,t,c,1);break;case 2:case 9:if(Yo(c)){Ye=0,Yt=null,zf(t);break}t=function(){Ye!==2&&Ye!==9||Ke!==e||(Ye=7),ha(e)},c.then(t,t);break e;case 3:Ye=7;break e;case 4:Ye=5;break e;case 7:Yo(c)?(Ye=0,Yt=null,zf(t)):(Ye=0,Yt=null,gn(e,t,c,7));break;case 5:var d=null;switch(Te.tag){case 26:d=Te.memoizedState;case 5:case 27:var v=Te;if(d?yh(d):v.stateNode.complete){Ye=0,Yt=null;var N=v.sibling;if(N!==null)Te=N;else{var U=v.return;U!==null?(Te=U,Ei(U)):Te=null}break t}}Ye=0,Yt=null,gn(e,t,c,5);break;case 6:Ye=0,Yt=null,gn(e,t,c,6);break;case 8:Hr(),et=6;break e;default:throw Error(o(462))}}xg();break}catch(G){Af(e,G)}while(!0);return Na=wl=null,H.H=l,H.A=i,He=a,Te!==null?0:(Ke=null,Oe=0,Vs(),et)}function xg(){for(;Te!==null&&!$t();)Df(Te)}function Df(e){var t=tf(e.alternate,e,za);e.memoizedProps=e.pendingProps,t===null?Ei(e):Te=t}function zf(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Jd(a,t,t.pendingProps,t.type,void 0,Oe);break;case 11:t=Jd(a,t,t.pendingProps,t.type.render,t.ref,Oe);break;case 5:tr(t);default:lf(a,t),t=Te=Mo(t,za),t=tf(a,t,za)}e.memoizedProps=e.pendingProps,t===null?Ei(e):Te=t}function gn(e,t,a,l){Na=wl=null,tr(t),nn=null,Kn=0;var i=t.return;try{if(cg(e,i,t,a,Oe)){et=1,fi(e,Wt(a,e.current)),Te=null;return}}catch(c){if(i!==null)throw Te=i,c;et=1,fi(e,Wt(a,e.current)),Te=null;return}t.flags&32768?(Re||l===1?e=!0:fn||(Oe&536870912)!==0?e=!1:(el=e=!0,(l===2||l===9||l===3||l===6)&&(l=Ht.current,l!==null&&l.tag===13&&(l.flags|=16384))),kf(t,e)):Ei(t)}function Ei(e){var t=e;do{if((t.flags&32768)!==0){kf(t,el);return}e=t.return;var a=og(t.alternate,t,za);if(a!==null){Te=a;return}if(t=t.sibling,t!==null){Te=t;return}Te=t=e}while(t!==null);et===0&&(et=5)}function kf(e,t){do{var a=dg(e.alternate,e);if(a!==null){a.flags&=32767,Te=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Te=e;return}Te=e=a}while(e!==null);et=6,Te=null}function _f(e,t,a,l,i,c,d,v,N){e.cancelPendingCommit=null;do wi();while(ot!==0);if((He&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(c=t.lanes|t.childLanes,c|=Ac,wt(e,a,c,d,v,N),e===Ke&&(Te=Ke=null,Oe=0),mn=t,ll=e,ka=a,Ur=c,Lr=i,Cf=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Ng(Ll,function(){return qf(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=H.T,H.T=null,i=J.p,J.p=2,d=He,He|=4;try{fg(e,t,a)}finally{He=d,J.p=i,H.T=l}}ot=1,Uf(),Lf(),Bf()}}function Uf(){if(ot===1){ot=0;var e=ll,t=mn,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=H.T,H.T=null;var l=J.p;J.p=2;var i=He;He|=4;try{gf(t,e);var c=Pr,d=jo(e.containerInfo),v=c.focusedElem,N=c.selectionRange;if(d!==v&&v&&v.ownerDocument&&bo(v.ownerDocument.documentElement,v)){if(N!==null&&Nc(v)){var U=N.start,G=N.end;if(G===void 0&&(G=U),"selectionStart"in v)v.selectionStart=U,v.selectionEnd=Math.min(G,v.value.length);else{var $=v.ownerDocument||document,B=$&&$.defaultView||window;if(B.getSelection){var q=B.getSelection(),ue=v.textContent.length,ye=Math.min(N.start,ue),Qe=N.end===void 0?ye:Math.min(N.end,ue);!q.extend&&ye>Qe&&(d=Qe,Qe=ye,ye=d);var z=xo(v,ye),w=xo(v,Qe);if(z&&w&&(q.rangeCount!==1||q.anchorNode!==z.node||q.anchorOffset!==z.offset||q.focusNode!==w.node||q.focusOffset!==w.offset)){var k=$.createRange();k.setStart(z.node,z.offset),q.removeAllRanges(),ye>Qe?(q.addRange(k),q.extend(w.node,w.offset)):(k.setEnd(w.node,w.offset),q.addRange(k))}}}}for($=[],q=v;q=q.parentNode;)q.nodeType===1&&$.push({element:q,left:q.scrollLeft,top:q.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;v<$.length;v++){var V=$[v];V.element.scrollLeft=V.left,V.element.scrollTop=V.top}}Bi=!!Fr,Pr=Fr=null}finally{He=i,J.p=l,H.T=a}}e.current=t,ot=2}}function Lf(){if(ot===2){ot=0;var e=ll,t=mn,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=H.T,H.T=null;var l=J.p;J.p=2;var i=He;He|=4;try{df(e,t.alternate,t)}finally{He=i,J.p=l,H.T=a}}ot=3}}function Bf(){if(ot===4||ot===3){ot=0,Ms();var e=ll,t=mn,a=ka,l=Cf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?ot=5:(ot=0,mn=ll=null,Hf(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(al=null),Hl(a),t=t.stateNode,bt&&typeof bt.onCommitFiberRoot=="function")try{bt.onCommitFiberRoot(Ya,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=H.T,i=J.p,J.p=2,H.T=null;try{for(var c=e.onRecoverableError,d=0;d<l.length;d++){var v=l[d];c(v.value,{componentStack:v.stack})}}finally{H.T=t,J.p=i}}(ka&3)!==0&&wi(),ha(e),i=e.pendingLanes,(a&261930)!==0&&(i&42)!==0?e===Br?os++:(os=0,Br=e):os=0,ds(0)}}function Hf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,$n(t)))}function wi(){return Uf(),Lf(),Bf(),qf()}function qf(){if(ot!==5)return!1;var e=ll,t=Ur;Ur=0;var a=Hl(ka),l=H.T,i=J.p;try{J.p=32>a?32:a,H.T=null,a=Lr,Lr=null;var c=ll,d=ka;if(ot=0,mn=ll=null,ka=0,(He&6)!==0)throw Error(o(331));var v=He;if(He|=4,jf(c.current),yf(c,c.current,d,a),He=v,ds(0,!1),bt&&typeof bt.onPostCommitFiberRoot=="function")try{bt.onPostCommitFiberRoot(Ya,c)}catch{}return!0}finally{J.p=i,H.T=l,Hf(e,t)}}function Yf(e,t,a){t=Wt(a,t),t=gr(e.stateNode,t,2),e=Wa(e,t,2),e!==null&&(Be(e,2),ha(e))}function Ge(e,t,a){if(e.tag===3)Yf(e,e,a);else for(;t!==null;){if(t.tag===3){Yf(t,e,a);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(al===null||!al.has(l))){e=Wt(a,e),a=Yd(2),l=Wa(t,a,2),l!==null&&(Gd(a,l,t,e),Be(l,2),ha(l));break}}t=t.return}}function Yr(e,t,a){var l=e.pingCache;if(l===null){l=e.pingCache=new pg;var i=new Set;l.set(t,i)}else i=l.get(t),i===void 0&&(i=new Set,l.set(t,i));i.has(a)||(zr=!0,i.add(a),e=bg.bind(null,e,t,a),t.then(e,e))}function bg(e,t,a){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Ke===e&&(Oe&a)===a&&(et===4||et===3&&(Oe&62914560)===Oe&&300>vt()-bi?(He&2)===0&&pn(e,0):kr|=a,hn===Oe&&(hn=0)),ha(e)}function Gf(e,t){t===0&&(t=me()),e=Nl(e,t),e!==null&&(Be(e,t),ha(e))}function jg(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Gf(e,a)}function Sg(e,t){var a=0;switch(e.tag){case 31:case 13:var l=e.stateNode,i=e.memoizedState;i!==null&&(a=i.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(t),Gf(e,a)}function Ng(e,t){return hl(e,t)}var Ti=null,vn=null,Gr=!1,Ai=!1,Xr=!1,sl=0;function ha(e){e!==vn&&e.next===null&&(vn===null?Ti=vn=e:vn=vn.next=e),Ai=!0,Gr||(Gr=!0,Eg())}function ds(e,t){if(!Xr&&Ai){Xr=!0;do for(var a=!1,l=Ti;l!==null;){if(e!==0){var i=l.pendingLanes;if(i===0)var c=0;else{var d=l.suspendedLanes,v=l.pingedLanes;c=(1<<31-jt(42|e)+1)-1,c&=i&~(d&~v),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(a=!0,Qf(l,c))}else c=Oe,c=yl(l,l===Ke?c:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(c&3)===0||M(l,c)||(a=!0,Qf(l,c));l=l.next}while(a);Xr=!1}}function Cg(){Xf()}function Xf(){Ai=Gr=!1;var e=0;sl!==0&&_g()&&(e=sl);for(var t=vt(),a=null,l=Ti;l!==null;){var i=l.next,c=Vf(l,t);c===0?(l.next=null,a===null?Ti=i:a.next=i,i===null&&(vn=a)):(a=l,(e!==0||(c&3)!==0)&&(Ai=!0)),l=i}ot!==0&&ot!==5||ds(e),sl!==0&&(sl=0)}function Vf(e,t){for(var a=e.suspendedLanes,l=e.pingedLanes,i=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var d=31-jt(c),v=1<<d,N=i[d];N===-1?((v&a)===0||(v&l)!==0)&&(i[d]=ae(v,t)):N<=t&&(e.expiredLanes|=v),c&=~v}if(t=Ke,a=Oe,a=yl(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,a===0||e===t&&(Ye===2||Ye===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&ml(l),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||M(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(l!==null&&ml(l),Hl(a)){case 2:case 8:a=An;break;case 32:a=Ll;break;case 268435456:a=Rs;break;default:a=Ll}return l=$f.bind(null,e),a=hl(a,l),e.callbackPriority=t,e.callbackNode=a,t}return l!==null&&l!==null&&ml(l),e.callbackPriority=2,e.callbackNode=null,2}function $f(e,t){if(ot!==0&&ot!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(wi()&&e.callbackNode!==a)return null;var l=Oe;return l=yl(e,e===Ke?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(wf(e,l,t),Vf(e,vt()),e.callbackNode!=null&&e.callbackNode===a?$f.bind(null,e):null)}function Qf(e,t){if(wi())return null;wf(e,t,!0)}function Eg(){Lg(function(){(He&6)!==0?hl(Tn,Cg):Xf()})}function Vr(){if(sl===0){var e=tn;e===0&&(e=pl,pl<<=1,(pl&261888)===0&&(pl=256)),sl=e}return sl}function Kf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Us(""+e)}function Zf(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function wg(e,t,a,l,i){if(t==="submit"&&a&&a.stateNode===i){var c=Kf((i[we]||null).action),d=l.submitter;d&&(t=(t=d[we]||null)?Kf(t.formAction):d.getAttribute("formAction"),t!==null&&(c=t,d=null));var v=new qs("action","action",null,l,i);e.push({event:v,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(sl!==0){var N=d?Zf(i,d):new FormData(i);or(a,{pending:!0,data:N,method:i.method,action:c},null,N)}}else typeof c=="function"&&(v.preventDefault(),N=d?Zf(i,d):new FormData(i),or(a,{pending:!0,data:N,method:i.method,action:c},c,N))},currentTarget:i}]})}}for(var $r=0;$r<Tc.length;$r++){var Qr=Tc[$r],Tg=Qr.toLowerCase(),Ag=Qr[0].toUpperCase()+Qr.slice(1);na(Tg,"on"+Ag)}na(Co,"onAnimationEnd"),na(Eo,"onAnimationIteration"),na(wo,"onAnimationStart"),na("dblclick","onDoubleClick"),na("focusin","onFocus"),na("focusout","onBlur"),na(Vp,"onTransitionRun"),na($p,"onTransitionStart"),na(Qp,"onTransitionCancel"),na(To,"onTransitionEnd"),Yl("onMouseEnter",["mouseout","mouseover"]),Yl("onMouseLeave",["mouseout","mouseover"]),Yl("onPointerEnter",["pointerout","pointerover"]),Yl("onPointerLeave",["pointerout","pointerover"]),xl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),xl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),xl("onBeforeInput",["compositionend","keypress","textInput","paste"]),xl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),xl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),xl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fs="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(" "),Og=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(fs));function Jf(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var l=e[a],i=l.event;l=l.listeners;e:{var c=void 0;if(t)for(var d=l.length-1;0<=d;d--){var v=l[d],N=v.instance,U=v.currentTarget;if(v=v.listener,N!==c&&i.isPropagationStopped())break e;c=v,i.currentTarget=U;try{c(i)}catch(G){Xs(G)}i.currentTarget=null,c=N}else for(d=0;d<l.length;d++){if(v=l[d],N=v.instance,U=v.currentTarget,v=v.listener,N!==c&&i.isPropagationStopped())break e;c=v,i.currentTarget=U;try{c(i)}catch(G){Xs(G)}i.currentTarget=null,c=N}}}}function Ae(e,t){var a=t[Ee];a===void 0&&(a=t[Ee]=new Set);var l=e+"__bubble";a.has(l)||(Wf(t,e,2,!1),a.add(l))}function Kr(e,t,a){var l=0;t&&(l|=4),Wf(a,e,l,t)}var Oi="_reactListening"+Math.random().toString(36).slice(2);function Zr(e){if(!e[Oi]){e[Oi]=!0,Yu.forEach(function(a){a!=="selectionchange"&&(Og.has(a)||Kr(a,!1,e),Kr(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Oi]||(t[Oi]=!0,Kr("selectionchange",!1,t))}}function Wf(e,t,a,l){switch(Eh(t)){case 2:var i=lv;break;case 8:i=nv;break;default:i=uu}a=i.bind(null,t,a,e),i=void 0,!mc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),l?i!==void 0?e.addEventListener(t,a,{capture:!0,passive:i}):e.addEventListener(t,a,!0):i!==void 0?e.addEventListener(t,a,{passive:i}):e.addEventListener(t,a,!1)}function Jr(e,t,a,l,i){var c=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var d=l.tag;if(d===3||d===4){var v=l.stateNode.containerInfo;if(v===i)break;if(d===4)for(d=l.return;d!==null;){var N=d.tag;if((N===3||N===4)&&d.stateNode.containerInfo===i)return;d=d.return}for(;v!==null;){if(d=Ut(v),d===null)return;if(N=d.tag,N===5||N===6||N===26||N===27){l=c=d;continue e}v=v.parentNode}}l=l.return}Iu(function(){var U=c,G=fc(a),$=[];e:{var B=Ao.get(e);if(B!==void 0){var q=qs,ue=e;switch(e){case"keypress":if(Bs(a)===0)break e;case"keydown":case"keyup":q=Sp;break;case"focusin":ue="focus",q=yc;break;case"focusout":ue="blur",q=yc;break;case"beforeblur":case"afterblur":q=yc;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":q=ao;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":q=op;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":q=Ep;break;case Co:case Eo:case wo:q=hp;break;case To:q=Tp;break;case"scroll":case"scrollend":q=rp;break;case"wheel":q=Op;break;case"copy":case"cut":case"paste":q=pp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":q=no;break;case"toggle":case"beforetoggle":q=Rp}var ye=(t&4)!==0,Qe=!ye&&(e==="scroll"||e==="scrollend"),z=ye?B!==null?B+"Capture":null:B;ye=[];for(var w=U,k;w!==null;){var V=w;if(k=V.stateNode,V=V.tag,V!==5&&V!==26&&V!==27||k===null||z===null||(V=kn(w,z),V!=null&&ye.push(hs(w,V,k))),Qe)break;w=w.return}0<ye.length&&(B=new q(B,ue,null,a,G),$.push({event:B,listeners:ye}))}}if((t&7)===0){e:{if(B=e==="mouseover"||e==="pointerover",q=e==="mouseout"||e==="pointerout",B&&a!==dc&&(ue=a.relatedTarget||a.fromElement)&&(Ut(ue)||ue[ze]))break e;if((q||B)&&(B=G.window===G?G:(B=G.ownerDocument)?B.defaultView||B.parentWindow:window,q?(ue=a.relatedTarget||a.toElement,q=U,ue=ue?Ut(ue):null,ue!==null&&(Qe=m(ue),ye=ue.tag,ue!==Qe||ye!==5&&ye!==27&&ye!==6)&&(ue=null)):(q=null,ue=U),q!==ue)){if(ye=ao,V="onMouseLeave",z="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(ye=no,V="onPointerLeave",z="onPointerEnter",w="pointer"),Qe=q==null?B:Ga(q),k=ue==null?B:Ga(ue),B=new ye(V,w+"leave",q,a,G),B.target=Qe,B.relatedTarget=k,V=null,Ut(G)===U&&(ye=new ye(z,w+"enter",ue,a,G),ye.target=k,ye.relatedTarget=Qe,V=ye),Qe=V,q&&ue)t:{for(ye=Mg,z=q,w=ue,k=0,V=z;V;V=ye(V))k++;V=0;for(var pe=w;pe;pe=ye(pe))V++;for(;0<k-V;)z=ye(z),k--;for(;0<V-k;)w=ye(w),V--;for(;k--;){if(z===w||w!==null&&z===w.alternate){ye=z;break t}z=ye(z),w=ye(w)}ye=null}else ye=null;q!==null&&Ff($,B,q,ye,!1),ue!==null&&Qe!==null&&Ff($,Qe,ue,ye,!0)}}e:{if(B=U?Ga(U):window,q=B.nodeName&&B.nodeName.toLowerCase(),q==="select"||q==="input"&&B.type==="file")var Ue=ho;else if(oo(B))if(mo)Ue=Yp;else{Ue=Hp;var fe=Bp}else q=B.nodeName,!q||q.toLowerCase()!=="input"||B.type!=="checkbox"&&B.type!=="radio"?U&&oc(U.elementType)&&(Ue=ho):Ue=qp;if(Ue&&(Ue=Ue(e,U))){fo($,Ue,a,G);break e}fe&&fe(e,B,U),e==="focusout"&&U&&B.type==="number"&&U.memoizedProps.value!=null&&uc(B,"number",B.value)}switch(fe=U?Ga(U):window,e){case"focusin":(oo(fe)||fe.contentEditable==="true")&&(Kl=fe,Cc=U,Gn=null);break;case"focusout":Gn=Cc=Kl=null;break;case"mousedown":Ec=!0;break;case"contextmenu":case"mouseup":case"dragend":Ec=!1,So($,a,G);break;case"selectionchange":if(Xp)break;case"keydown":case"keyup":So($,a,G)}var Ne;if(bc)e:{switch(e){case"compositionstart":var Me="onCompositionStart";break e;case"compositionend":Me="onCompositionEnd";break e;case"compositionupdate":Me="onCompositionUpdate";break e}Me=void 0}else Ql?ro(e,a)&&(Me="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Me="onCompositionStart");Me&&(so&&a.locale!=="ko"&&(Ql||Me!=="onCompositionStart"?Me==="onCompositionEnd"&&Ql&&(Ne=eo()):(Xa=G,pc="value"in Xa?Xa.value:Xa.textContent,Ql=!0)),fe=Mi(U,Me),0<fe.length&&(Me=new lo(Me,e,null,a,G),$.push({event:Me,listeners:fe}),Ne?Me.data=Ne:(Ne=uo(a),Ne!==null&&(Me.data=Ne)))),(Ne=zp?kp(e,a):_p(e,a))&&(Me=Mi(U,"onBeforeInput"),0<Me.length&&(fe=new lo("onBeforeInput","beforeinput",null,a,G),$.push({event:fe,listeners:Me}),fe.data=Ne)),wg($,e,U,a,G)}Jf($,t)})}function hs(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Mi(e,t){for(var a=t+"Capture",l=[];e!==null;){var i=e,c=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||c===null||(i=kn(e,a),i!=null&&l.unshift(hs(e,i,c)),i=kn(e,t),i!=null&&l.push(hs(e,i,c))),e.tag===3)return l;e=e.return}return[]}function Mg(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Ff(e,t,a,l,i){for(var c=t._reactName,d=[];a!==null&&a!==l;){var v=a,N=v.alternate,U=v.stateNode;if(v=v.tag,N!==null&&N===l)break;v!==5&&v!==26&&v!==27||U===null||(N=U,i?(U=kn(a,c),U!=null&&d.unshift(hs(a,U,N))):i||(U=kn(a,c),U!=null&&d.push(hs(a,U,N)))),a=a.return}d.length!==0&&e.push({event:t,listeners:d})}var Rg=/\r\n?/g,Dg=/\u0000|\uFFFD/g;function Pf(e){return(typeof e=="string"?e:""+e).replace(Rg,`
|
|
49
|
+
`).replace(Dg,"")}function If(e,t){return t=Pf(t),Pf(e)===t}function $e(e,t,a,l,i,c){switch(a){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||Xl(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&Xl(e,""+l);break;case"className":ks(e,"class",l);break;case"tabIndex":ks(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":ks(e,a,l);break;case"style":Fu(e,l,c);break;case"data":if(t!=="object"){ks(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=Us(""+l),e.setAttribute(a,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof c=="function"&&(a==="formAction"?(t!=="input"&&$e(e,t,"name",i.name,i,null),$e(e,t,"formEncType",i.formEncType,i,null),$e(e,t,"formMethod",i.formMethod,i,null),$e(e,t,"formTarget",i.formTarget,i,null)):($e(e,t,"encType",i.encType,i,null),$e(e,t,"method",i.method,i,null),$e(e,t,"target",i.target,i,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=Us(""+l),e.setAttribute(a,l);break;case"onClick":l!=null&&(e.onclick=xa);break;case"onScroll":l!=null&&Ae("scroll",e);break;case"onScrollEnd":l!=null&&Ae("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(a=l.__html,a!=null){if(i.children!=null)throw Error(o(60));e.innerHTML=a}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}a=Us(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,""+l):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":l===!0?e.setAttribute(a,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,l):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(a,l):e.removeAttribute(a);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(a):e.setAttribute(a,l);break;case"popover":Ae("beforetoggle",e),Ae("toggle",e),zs(e,"popover",l);break;case"xlinkActuate":ya(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":ya(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":ya(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":ya(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":ya(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":ya(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":ya(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":ya(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":ya(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":zs(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=ip.get(a)||a,zs(e,a,l))}}function Wr(e,t,a,l,i,c){switch(a){case"style":Fu(e,l,c);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(a=l.__html,a!=null){if(i.children!=null)throw Error(o(60));e.innerHTML=a}}break;case"children":typeof l=="string"?Xl(e,l):(typeof l=="number"||typeof l=="bigint")&&Xl(e,""+l);break;case"onScroll":l!=null&&Ae("scroll",e);break;case"onScrollEnd":l!=null&&Ae("scrollend",e);break;case"onClick":l!=null&&(e.onclick=xa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Gu.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(i=a.endsWith("Capture"),t=a.slice(2,i?a.length-7:void 0),c=e[we]||null,c=c!=null?c[a]:null,typeof c=="function"&&e.removeEventListener(t,c,i),typeof l=="function")){typeof c!="function"&&c!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,l,i);break e}a in e?e[a]=l:l===!0?e.setAttribute(a,""):zs(e,a,l)}}}function gt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ae("error",e),Ae("load",e);var l=!1,i=!1,c;for(c in a)if(a.hasOwnProperty(c)){var d=a[c];if(d!=null)switch(c){case"src":l=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:$e(e,t,c,d,a,null)}}i&&$e(e,t,"srcSet",a.srcSet,a,null),l&&$e(e,t,"src",a.src,a,null);return;case"input":Ae("invalid",e);var v=c=d=i=null,N=null,U=null;for(l in a)if(a.hasOwnProperty(l)){var G=a[l];if(G!=null)switch(l){case"name":i=G;break;case"type":d=G;break;case"checked":N=G;break;case"defaultChecked":U=G;break;case"value":c=G;break;case"defaultValue":v=G;break;case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(o(137,t));break;default:$e(e,t,l,G,a,null)}}Ku(e,c,v,N,U,d,i,!1);return;case"select":Ae("invalid",e),l=d=c=null;for(i in a)if(a.hasOwnProperty(i)&&(v=a[i],v!=null))switch(i){case"value":c=v;break;case"defaultValue":d=v;break;case"multiple":l=v;default:$e(e,t,i,v,a,null)}t=c,a=d,e.multiple=!!l,t!=null?Gl(e,!!l,t,!1):a!=null&&Gl(e,!!l,a,!0);return;case"textarea":Ae("invalid",e),c=i=l=null;for(d in a)if(a.hasOwnProperty(d)&&(v=a[d],v!=null))switch(d){case"value":l=v;break;case"defaultValue":i=v;break;case"children":c=v;break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(o(91));break;default:$e(e,t,d,v,a,null)}Ju(e,l,i,c);return;case"option":for(N in a)if(a.hasOwnProperty(N)&&(l=a[N],l!=null))switch(N){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:$e(e,t,N,l,a,null)}return;case"dialog":Ae("beforetoggle",e),Ae("toggle",e),Ae("cancel",e),Ae("close",e);break;case"iframe":case"object":Ae("load",e);break;case"video":case"audio":for(l=0;l<fs.length;l++)Ae(fs[l],e);break;case"image":Ae("error",e),Ae("load",e);break;case"details":Ae("toggle",e);break;case"embed":case"source":case"link":Ae("error",e),Ae("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(U in a)if(a.hasOwnProperty(U)&&(l=a[U],l!=null))switch(U){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:$e(e,t,U,l,a,null)}return;default:if(oc(t)){for(G in a)a.hasOwnProperty(G)&&(l=a[G],l!==void 0&&Wr(e,t,G,l,a,void 0));return}}for(v in a)a.hasOwnProperty(v)&&(l=a[v],l!=null&&$e(e,t,v,l,a,null))}function zg(e,t,a,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,c=null,d=null,v=null,N=null,U=null,G=null;for(q in a){var $=a[q];if(a.hasOwnProperty(q)&&$!=null)switch(q){case"checked":break;case"value":break;case"defaultValue":N=$;default:l.hasOwnProperty(q)||$e(e,t,q,null,l,$)}}for(var B in l){var q=l[B];if($=a[B],l.hasOwnProperty(B)&&(q!=null||$!=null))switch(B){case"type":c=q;break;case"name":i=q;break;case"checked":U=q;break;case"defaultChecked":G=q;break;case"value":d=q;break;case"defaultValue":v=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(o(137,t));break;default:q!==$&&$e(e,t,B,q,l,$)}}rc(e,d,v,N,U,G,c,i);return;case"select":q=d=v=B=null;for(c in a)if(N=a[c],a.hasOwnProperty(c)&&N!=null)switch(c){case"value":break;case"multiple":q=N;default:l.hasOwnProperty(c)||$e(e,t,c,null,l,N)}for(i in l)if(c=l[i],N=a[i],l.hasOwnProperty(i)&&(c!=null||N!=null))switch(i){case"value":B=c;break;case"defaultValue":v=c;break;case"multiple":d=c;default:c!==N&&$e(e,t,i,c,l,N)}t=v,a=d,l=q,B!=null?Gl(e,!!a,B,!1):!!l!=!!a&&(t!=null?Gl(e,!!a,t,!0):Gl(e,!!a,a?[]:"",!1));return;case"textarea":q=B=null;for(v in a)if(i=a[v],a.hasOwnProperty(v)&&i!=null&&!l.hasOwnProperty(v))switch(v){case"value":break;case"children":break;default:$e(e,t,v,null,l,i)}for(d in l)if(i=l[d],c=a[d],l.hasOwnProperty(d)&&(i!=null||c!=null))switch(d){case"value":B=i;break;case"defaultValue":q=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(o(91));break;default:i!==c&&$e(e,t,d,i,l,c)}Zu(e,B,q);return;case"option":for(var ue in a)if(B=a[ue],a.hasOwnProperty(ue)&&B!=null&&!l.hasOwnProperty(ue))switch(ue){case"selected":e.selected=!1;break;default:$e(e,t,ue,null,l,B)}for(N in l)if(B=l[N],q=a[N],l.hasOwnProperty(N)&&B!==q&&(B!=null||q!=null))switch(N){case"selected":e.selected=B&&typeof B!="function"&&typeof B!="symbol";break;default:$e(e,t,N,B,l,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 ye in a)B=a[ye],a.hasOwnProperty(ye)&&B!=null&&!l.hasOwnProperty(ye)&&$e(e,t,ye,null,l,B);for(U in l)if(B=l[U],q=a[U],l.hasOwnProperty(U)&&B!==q&&(B!=null||q!=null))switch(U){case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(o(137,t));break;default:$e(e,t,U,B,l,q)}return;default:if(oc(t)){for(var Qe in a)B=a[Qe],a.hasOwnProperty(Qe)&&B!==void 0&&!l.hasOwnProperty(Qe)&&Wr(e,t,Qe,void 0,l,B);for(G in l)B=l[G],q=a[G],!l.hasOwnProperty(G)||B===q||B===void 0&&q===void 0||Wr(e,t,G,B,l,q);return}}for(var z in a)B=a[z],a.hasOwnProperty(z)&&B!=null&&!l.hasOwnProperty(z)&&$e(e,t,z,null,l,B);for($ in l)B=l[$],q=a[$],!l.hasOwnProperty($)||B===q||B==null&&q==null||$e(e,t,$,B,l,q)}function eh(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function kg(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),l=0;l<a.length;l++){var i=a[l],c=i.transferSize,d=i.initiatorType,v=i.duration;if(c&&v&&eh(d)){for(d=0,v=i.responseEnd,l+=1;l<a.length;l++){var N=a[l],U=N.startTime;if(U>v)break;var G=N.transferSize,$=N.initiatorType;G&&eh($)&&(N=N.responseEnd,d+=G*(N<v?1:(v-U)/(N-U)))}if(--l,t+=8*(c+d)/(i.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 Fr=null,Pr=null;function Ri(e){return e.nodeType===9?e:e.ownerDocument}function th(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 ah(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 Ir(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 eu=null;function _g(){var e=window.event;return e&&e.type==="popstate"?e===eu?!1:(eu=e,!0):(eu=null,!1)}var lh=typeof setTimeout=="function"?setTimeout:void 0,Ug=typeof clearTimeout=="function"?clearTimeout:void 0,nh=typeof Promise=="function"?Promise:void 0,Lg=typeof queueMicrotask=="function"?queueMicrotask:typeof nh<"u"?function(e){return nh.resolve(null).then(e).catch(Bg)}:lh;function Bg(e){setTimeout(function(){throw e})}function il(e){return e==="head"}function sh(e,t){var a=t,l=0;do{var i=a.nextSibling;if(e.removeChild(a),i&&i.nodeType===8)if(a=i.data,a==="/$"||a==="/&"){if(l===0){e.removeChild(i),jn(t);return}l--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")l++;else if(a==="html")ms(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,ms(a);for(var c=a.firstChild;c;){var d=c.nextSibling,v=c.nodeName;c[St]||v==="SCRIPT"||v==="STYLE"||v==="LINK"&&c.rel.toLowerCase()==="stylesheet"||a.removeChild(c),c=d}}else a==="body"&&ms(e.ownerDocument.body);a=i}while(a);jn(t)}function ih(e,t){var a=e;e=0;do{var l=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),l&&l.nodeType===8)if(a=l.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=l}while(a)}function tu(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":tu(a),ql(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function Hg(e,t,a,l){for(;e.nodeType===1;){var i=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[St])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(c=e.getAttribute("rel"),c==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(c!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(c=e.getAttribute("src"),(c!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&c&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var c=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===c)return e}else return e;if(e=ta(e.nextSibling),e===null)break}return null}function qg(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=ta(e.nextSibling),e===null))return null;return e}function ch(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ta(e.nextSibling),e===null))return null;return e}function au(e){return e.data==="$?"||e.data==="$~"}function lu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Yg(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var l=function(){t(),a.removeEventListener("DOMContentLoaded",l)};a.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function ta(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 rh(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return ta(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function uh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function oh(e,t,a){switch(t=Ri(a),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 ms(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ql(e)}var aa=new Map,dh=new Set;function Di(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _a=J.d;J.d={f:Gg,r:Xg,D:Vg,C:$g,L:Qg,m:Kg,X:Jg,S:Zg,M:Wg};function Gg(){var e=_a.f(),t=Ni();return e||t}function Xg(e){var t=va(e);t!==null&&t.tag===5&&t.type==="form"?Td(t):_a.r(e)}var yn=typeof document>"u"?null:document;function fh(e,t,a){var l=yn;if(l&&typeof t=="string"&&t){var i=Zt(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof a=="string"&&(i+='[crossorigin="'+a+'"]'),dh.has(i)||(dh.add(i),e={rel:e,crossOrigin:a,href:t},l.querySelector(i)===null&&(t=l.createElement("link"),gt(t,"link",e),dt(t),l.head.appendChild(t)))}}function Vg(e){_a.D(e),fh("dns-prefetch",e,null)}function $g(e,t){_a.C(e,t),fh("preconnect",e,t)}function Qg(e,t,a){_a.L(e,t,a);var l=yn;if(l&&e&&t){var i='link[rel="preload"][as="'+Zt(t)+'"]';t==="image"&&a&&a.imageSrcSet?(i+='[imagesrcset="'+Zt(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(i+='[imagesizes="'+Zt(a.imageSizes)+'"]')):i+='[href="'+Zt(e)+'"]';var c=i;switch(t){case"style":c=xn(e);break;case"script":c=bn(e)}aa.has(c)||(e=j({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),aa.set(c,e),l.querySelector(i)!==null||t==="style"&&l.querySelector(ps(c))||t==="script"&&l.querySelector(gs(c))||(t=l.createElement("link"),gt(t,"link",e),dt(t),l.head.appendChild(t)))}}function Kg(e,t){_a.m(e,t);var a=yn;if(a&&e){var l=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+Zt(l)+'"][href="'+Zt(e)+'"]',c=i;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=bn(e)}if(!aa.has(c)&&(e=j({rel:"modulepreload",href:e},t),aa.set(c,e),a.querySelector(i)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(gs(c)))return}l=a.createElement("link"),gt(l,"link",e),dt(l),a.head.appendChild(l)}}}function Zg(e,t,a){_a.S(e,t,a);var l=yn;if(l&&e){var i=At(l).hoistableStyles,c=xn(e);t=t||"default";var d=i.get(c);if(!d){var v={loading:0,preload:null};if(d=l.querySelector(ps(c)))v.loading=5;else{e=j({rel:"stylesheet",href:e,"data-precedence":t},a),(a=aa.get(c))&&su(e,a);var N=d=l.createElement("link");dt(N),gt(N,"link",e),N._p=new Promise(function(U,G){N.onload=U,N.onerror=G}),N.addEventListener("load",function(){v.loading|=1}),N.addEventListener("error",function(){v.loading|=2}),v.loading|=4,zi(d,t,l)}d={type:"stylesheet",instance:d,count:1,state:v},i.set(c,d)}}}function Jg(e,t){_a.X(e,t);var a=yn;if(a&&e){var l=At(a).hoistableScripts,i=bn(e),c=l.get(i);c||(c=a.querySelector(gs(i)),c||(e=j({src:e,async:!0},t),(t=aa.get(i))&&iu(e,t),c=a.createElement("script"),dt(c),gt(c,"link",e),a.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},l.set(i,c))}}function Wg(e,t){_a.M(e,t);var a=yn;if(a&&e){var l=At(a).hoistableScripts,i=bn(e),c=l.get(i);c||(c=a.querySelector(gs(i)),c||(e=j({src:e,async:!0,type:"module"},t),(t=aa.get(i))&&iu(e,t),c=a.createElement("script"),dt(c),gt(c,"link",e),a.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},l.set(i,c))}}function hh(e,t,a,l){var i=(i=be.current)?Di(i):null;if(!i)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=xn(a.href),a=At(i).hoistableStyles,l=a.get(t),l||(l={type:"style",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=xn(a.href);var c=At(i).hoistableStyles,d=c.get(e);if(d||(i=i.ownerDocument||i,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,d),(c=i.querySelector(ps(e)))&&!c._p&&(d.instance=c,d.state.loading=5),aa.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},aa.set(e,a),c||Fg(i,e,a,d.state))),t&&l===null)throw Error(o(528,""));return d}if(t&&l!==null)throw Error(o(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=bn(a),a=At(i).hoistableScripts,l=a.get(t),l||(l={type:"script",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function xn(e){return'href="'+Zt(e)+'"'}function ps(e){return'link[rel="stylesheet"]['+e+"]"}function mh(e){return j({},e,{"data-precedence":e.precedence,precedence:null})}function Fg(e,t,a,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),gt(t,"link",a),dt(t),e.head.appendChild(t))}function bn(e){return'[src="'+Zt(e)+'"]'}function gs(e){return"script[async]"+e}function ph(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Zt(a.href)+'"]');if(l)return t.instance=l,dt(l),l;var i=j({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),dt(l),gt(l,"style",i),zi(l,a.precedence,e),t.instance=l;case"stylesheet":i=xn(a.href);var c=e.querySelector(ps(i));if(c)return t.state.loading|=4,t.instance=c,dt(c),c;l=mh(a),(i=aa.get(i))&&su(l,i),c=(e.ownerDocument||e).createElement("link"),dt(c);var d=c;return d._p=new Promise(function(v,N){d.onload=v,d.onerror=N}),gt(c,"link",l),t.state.loading|=4,zi(c,a.precedence,e),t.instance=c;case"script":return c=bn(a.src),(i=e.querySelector(gs(c)))?(t.instance=i,dt(i),i):(l=a,(i=aa.get(c))&&(l=j({},a),iu(l,i)),e=e.ownerDocument||e,i=e.createElement("script"),dt(i),gt(i,"link",l),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,zi(l,a.precedence,e));return t.instance}function zi(e,t,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=l.length?l[l.length-1]:null,c=i,d=0;d<l.length;d++){var v=l[d];if(v.dataset.precedence===t)c=v;else if(c!==i)break}c?c.parentNode.insertBefore(e,c.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function su(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function iu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ki=null;function gh(e,t,a){if(ki===null){var l=new Map,i=ki=new Map;i.set(a,l)}else i=ki,l=i.get(a),l||(l=new Map,i.set(a,l));if(l.has(e))return l;for(l.set(e,null),a=a.getElementsByTagName(e),i=0;i<a.length;i++){var c=a[i];if(!(c[St]||c[nt]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var d=c.getAttribute(t)||"";d=e+d;var v=l.get(d);v?v.push(c):l.set(d,[c])}}return l}function vh(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function Pg(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function yh(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Ig(e,t,a,l){if(a.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var i=xn(l.href),c=t.querySelector(ps(i));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=_i.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=c,dt(c);return}c=t.ownerDocument||t,l=mh(l),(i=aa.get(i))&&su(l,i),c=c.createElement("link"),dt(c);var d=c;d._p=new Promise(function(v,N){d.onload=v,d.onerror=N}),gt(c,"link",l),a.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=_i.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var cu=0;function ev(e,t){return e.stylesheets&&e.count===0&&Li(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var l=setTimeout(function(){if(e.stylesheets&&Li(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&cu===0&&(cu=62500*kg());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Li(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>cu?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(i)}}:null}function _i(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Li(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ui=null;function Li(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ui=new Map,t.forEach(tv,e),Ui=null,_i.call(e))}function tv(e,t){if(!(t.state.loading&4)){var a=Ui.get(e);if(a)var l=a.get(null);else{a=new Map,Ui.set(e,a);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<i.length;c++){var d=i[c];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(a.set(d.dataset.precedence,d),l=d)}l&&a.set(null,l)}i=t.instance,d=i.getAttribute("data-precedence"),c=a.get(d)||l,c===l&&a.set(null,i),a.set(d,i),this.count++,l=_i.bind(this),i.addEventListener("load",l),i.addEventListener("error",l),c?c.parentNode.insertBefore(i,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var vs={$$typeof:_,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function av(e,t,a,l,i,c,d,v,N){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=De(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=De(0),this.hiddenUpdates=De(null),this.identifierPrefix=l,this.onUncaughtError=i,this.onCaughtError=c,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=N,this.incompleteTransitions=new Map}function xh(e,t,a,l,i,c,d,v,N,U,G,$){return e=new av(e,t,a,d,N,U,G,$,v),t=1,c===!0&&(t|=24),c=Bt(3,null,null,t),e.current=c,c.stateNode=e,t=qc(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:l,isDehydrated:a,cache:t},Vc(c),e}function bh(e){return e?(e=Wl,e):Wl}function jh(e,t,a,l,i,c){i=bh(i),l.context===null?l.context=i:l.pendingContext=i,l=Ja(t),l.payload={element:a},c=c===void 0?null:c,c!==null&&(l.callback=c),a=Wa(e,l,t),a!==null&&(kt(a,e,t),Jn(a,e,t))}function Sh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function ru(e,t){Sh(e,t),(e=e.alternate)&&Sh(e,t)}function Nh(e){if(e.tag===13||e.tag===31){var t=Nl(e,67108864);t!==null&&kt(t,e,67108864),ru(e,67108864)}}function Ch(e){if(e.tag===13||e.tag===31){var t=Xt();t=Bl(t);var a=Nl(e,t);a!==null&&kt(a,e,t),ru(e,t)}}var Bi=!0;function lv(e,t,a,l){var i=H.T;H.T=null;var c=J.p;try{J.p=2,uu(e,t,a,l)}finally{J.p=c,H.T=i}}function nv(e,t,a,l){var i=H.T;H.T=null;var c=J.p;try{J.p=8,uu(e,t,a,l)}finally{J.p=c,H.T=i}}function uu(e,t,a,l){if(Bi){var i=ou(l);if(i===null)Jr(e,t,l,Hi,a),wh(e,l);else if(iv(i,e,t,a,l))l.stopPropagation();else if(wh(e,l),t&4&&-1<sv.indexOf(e)){for(;i!==null;){var c=va(i);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var d=ua(c.pendingLanes);if(d!==0){var v=c;for(v.pendingLanes|=2,v.entangledLanes|=2;d;){var N=1<<31-jt(d);v.entanglements[1]|=N,d&=~N}ha(c),(He&6)===0&&(ji=vt()+500,ds(0))}}break;case 31:case 13:v=Nl(c,2),v!==null&&kt(v,c,2),Ni(),ru(c,2)}if(c=ou(l),c===null&&Jr(e,t,l,Hi,a),c===i)break;i=c}i!==null&&l.stopPropagation()}else Jr(e,t,l,null,a)}}function ou(e){return e=fc(e),du(e)}var Hi=null;function du(e){if(Hi=null,e=Ut(e),e!==null){var t=m(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=p(t),e!==null)return e;e=null}else if(a===31){if(e=x(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Hi=e,null}function Eh(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(tc()){case Tn:return 2;case An:return 8;case Ll:case ac:return 32;case Rs:return 268435456;default:return 32}default:return 32}}var fu=!1,cl=null,rl=null,ul=null,ys=new Map,xs=new Map,ol=[],sv="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 wh(e,t){switch(e){case"focusin":case"focusout":cl=null;break;case"dragenter":case"dragleave":rl=null;break;case"mouseover":case"mouseout":ul=null;break;case"pointerover":case"pointerout":ys.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":xs.delete(t.pointerId)}}function bs(e,t,a,l,i,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:a,eventSystemFlags:l,nativeEvent:c,targetContainers:[i]},t!==null&&(t=va(t),t!==null&&Nh(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function iv(e,t,a,l,i){switch(t){case"focusin":return cl=bs(cl,e,t,a,l,i),!0;case"dragenter":return rl=bs(rl,e,t,a,l,i),!0;case"mouseover":return ul=bs(ul,e,t,a,l,i),!0;case"pointerover":var c=i.pointerId;return ys.set(c,bs(ys.get(c)||null,e,t,a,l,i)),!0;case"gotpointercapture":return c=i.pointerId,xs.set(c,bs(xs.get(c)||null,e,t,a,l,i)),!0}return!1}function Th(e){var t=Ut(e.target);if(t!==null){var a=m(t);if(a!==null){if(t=a.tag,t===13){if(t=p(a),t!==null){e.blockedOn=t,zn(e.priority,function(){Ch(a)});return}}else if(t===31){if(t=x(a),t!==null){e.blockedOn=t,zn(e.priority,function(){Ch(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function qi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=ou(e.nativeEvent);if(a===null){a=e.nativeEvent;var l=new a.constructor(a.type,a);dc=l,a.target.dispatchEvent(l),dc=null}else return t=va(a),t!==null&&Nh(t),e.blockedOn=a,!1;t.shift()}return!0}function Ah(e,t,a){qi(e)&&a.delete(t)}function cv(){fu=!1,cl!==null&&qi(cl)&&(cl=null),rl!==null&&qi(rl)&&(rl=null),ul!==null&&qi(ul)&&(ul=null),ys.forEach(Ah),xs.forEach(Ah)}function Yi(e,t){e.blockedOn===t&&(e.blockedOn=null,fu||(fu=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,cv)))}var Gi=null;function Oh(e){Gi!==e&&(Gi=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){Gi===e&&(Gi=null);for(var t=0;t<e.length;t+=3){var a=e[t],l=e[t+1],i=e[t+2];if(typeof l!="function"){if(du(l||a)===null)continue;break}var c=va(a);c!==null&&(e.splice(t,3),t-=3,or(c,{pending:!0,data:i,method:a.method,action:l},l,i))}}))}function jn(e){function t(N){return Yi(N,e)}cl!==null&&Yi(cl,e),rl!==null&&Yi(rl,e),ul!==null&&Yi(ul,e),ys.forEach(t),xs.forEach(t);for(var a=0;a<ol.length;a++){var l=ol[a];l.blockedOn===e&&(l.blockedOn=null)}for(;0<ol.length&&(a=ol[0],a.blockedOn===null);)Th(a),a.blockedOn===null&&ol.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(l=0;l<a.length;l+=3){var i=a[l],c=a[l+1],d=i[we]||null;if(typeof c=="function")d||Oh(a);else if(d){var v=null;if(c&&c.hasAttribute("formAction")){if(i=c,d=c[we]||null)v=d.formAction;else if(du(i)!==null)continue}else v=d.action;typeof v=="function"?a[l+1]=v:(a.splice(l,3),l-=3),Oh(a)}}}function Mh(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(d){return i=d})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),l||setTimeout(a,20)}function a(){if(!l&&!navigation.transition){var c=navigation.currentEntry;c&&c.url!=null&&navigation.navigate(c.url,{state:c.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),i!==null&&(i(),i=null)}}}function hu(e){this._internalRoot=e}Xi.prototype.render=hu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var a=t.current,l=Xt();jh(a,l,e,t,null,null)},Xi.prototype.unmount=hu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;jh(e.current,2,null,e,null,null),Ni(),t[ze]=null}};function Xi(e){this._internalRoot=e}Xi.prototype.unstable_scheduleHydration=function(e){if(e){var t=Dn();e={blockedOn:null,target:e,priority:t};for(var a=0;a<ol.length&&t!==0&&t<ol[a].priority;a++);ol.splice(a,0,e),a===0&&Th(e)}};var Rh=r.version;if(Rh!=="19.2.4")throw Error(o(527,Rh,"19.2.4"));J.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=g(t),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var rv={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Vi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vi.isDisabled&&Vi.supportsFiber)try{Ya=Vi.inject(rv),bt=Vi}catch{}}return Ss.createRoot=function(e,t){if(!f(e))throw Error(o(299));var a=!1,l="",i=Ld,c=Bd,d=Hd;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=xh(e,1,!1,null,null,a,l,null,i,c,d,Mh),e[ze]=t.current,Zr(e),new hu(t)},Ss.hydrateRoot=function(e,t,a){if(!f(e))throw Error(o(299));var l=!1,i="",c=Ld,d=Bd,v=Hd,N=null;return a!=null&&(a.unstable_strictMode===!0&&(l=!0),a.identifierPrefix!==void 0&&(i=a.identifierPrefix),a.onUncaughtError!==void 0&&(c=a.onUncaughtError),a.onCaughtError!==void 0&&(d=a.onCaughtError),a.onRecoverableError!==void 0&&(v=a.onRecoverableError),a.formState!==void 0&&(N=a.formState)),t=xh(e,1,!0,t,a??null,l,i,N,c,d,v,Mh),t.context=bh(null),a=t.current,l=Xt(),l=Bl(l),i=Ja(l),i.callback=null,Wa(a,i,l),a=l,t.current.lanes=a,Be(t,a),ha(t),e[ze]=t.current,Zr(e),new Xi(t)},Ss.version="19.2.4",Ss}var Yh;function vv(){if(Yh)return gu.exports;Yh=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(r){console.error(r)}}return s(),gu.exports=gv(),gu.exports}var yv=vv();/**
|
|
50
|
+
* react-router v7.13.0
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/var Gh="popstate";function xv(s={}){function r(o,f){let{pathname:m,search:p,hash:x}=o.location;return Ou("",{pathname:m,search:p,hash:x},f.state&&f.state.usr||null,f.state&&f.state.key||"default")}function u(o,f){return typeof f=="string"?f:ws(f)}return jv(r,u,null,s)}function Fe(s,r){if(s===!1||s===null||typeof s>"u")throw new Error(r)}function ca(s,r){if(!s){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function bv(){return Math.random().toString(36).substring(2,10)}function Xh(s,r){return{usr:s.state,key:s.key,idx:r}}function Ou(s,r,u=null,o){return{pathname:typeof s=="string"?s:s.pathname,search:"",hash:"",...typeof r=="string"?Cn(r):r,state:u,key:r&&r.key||o||bv()}}function ws({pathname:s="/",search:r="",hash:u=""}){return r&&r!=="?"&&(s+=r.charAt(0)==="?"?r:"?"+r),u&&u!=="#"&&(s+=u.charAt(0)==="#"?u:"#"+u),s}function Cn(s){let r={};if(s){let u=s.indexOf("#");u>=0&&(r.hash=s.substring(u),s=s.substring(0,u));let o=s.indexOf("?");o>=0&&(r.search=s.substring(o),s=s.substring(0,o)),s&&(r.pathname=s)}return r}function jv(s,r,u,o={}){let{window:f=document.defaultView,v5Compat:m=!1}=o,p=f.history,x="POP",y=null,g=b();g==null&&(g=0,p.replaceState({...p.state,idx:g},""));function b(){return(p.state||{idx:null}).idx}function j(){x="POP";let O=b(),E=O==null?null:O-g;g=O,y&&y({action:x,location:D.location,delta:E})}function S(O,E){x="PUSH";let R=Ou(D.location,O,E);g=b()+1;let _=Xh(R,g),K=D.createHref(R);try{p.pushState(_,"",K)}catch(Q){if(Q instanceof DOMException&&Q.name==="DataCloneError")throw Q;f.location.assign(K)}m&&y&&y({action:x,location:D.location,delta:1})}function T(O,E){x="REPLACE";let R=Ou(D.location,O,E);g=b();let _=Xh(R,g),K=D.createHref(R);p.replaceState(_,"",K),m&&y&&y({action:x,location:D.location,delta:0})}function A(O){return Sv(O)}let D={get action(){return x},get location(){return s(f,p)},listen(O){if(y)throw new Error("A history only accepts one active listener");return f.addEventListener(Gh,j),y=O,()=>{f.removeEventListener(Gh,j),y=null}},createHref(O){return r(f,O)},createURL:A,encodeLocation(O){let E=A(O);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:S,replace:T,go(O){return p.go(O)}};return D}function Sv(s,r=!1){let u="http://localhost";typeof window<"u"&&(u=window.location.origin!=="null"?window.location.origin:window.location.href),Fe(u,"No window.location.(origin|href) available to create URL");let o=typeof s=="string"?s:ws(s);return o=o.replace(/ $/,"%20"),!r&&o.startsWith("//")&&(o=u+o),new URL(o,u)}function dm(s,r,u="/"){return Nv(s,r,u,!1)}function Nv(s,r,u,o){let f=typeof r=="string"?Cn(r):r,m=Ba(f.pathname||"/",u);if(m==null)return null;let p=fm(s);Cv(p);let x=null;for(let y=0;x==null&&y<p.length;++y){let g=_v(m);x=zv(p[y],g,o)}return x}function fm(s,r=[],u=[],o="",f=!1){let m=(p,x,y=f,g)=>{let b={relativePath:g===void 0?p.path||"":g,caseSensitive:p.caseSensitive===!0,childrenIndex:x,route:p};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(o)&&y)return;Fe(b.relativePath.startsWith(o),`Absolute route path "${b.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(o.length)}let j=La([o,b.relativePath]),S=u.concat(b);p.children&&p.children.length>0&&(Fe(p.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${j}".`),fm(p.children,r,S,j,y)),!(p.path==null&&!p.index)&&r.push({path:j,score:Rv(j,p.index),routesMeta:S})};return s.forEach((p,x)=>{var y;if(p.path===""||!((y=p.path)!=null&&y.includes("?")))m(p,x);else for(let g of hm(p.path))m(p,x,!0,g)}),r}function hm(s){let r=s.split("/");if(r.length===0)return[];let[u,...o]=r,f=u.endsWith("?"),m=u.replace(/\?$/,"");if(o.length===0)return f?[m,""]:[m];let p=hm(o.join("/")),x=[];return x.push(...p.map(y=>y===""?m:[m,y].join("/"))),f&&x.push(...p),x.map(y=>s.startsWith("/")&&y===""?"/":y)}function Cv(s){s.sort((r,u)=>r.score!==u.score?u.score-r.score:Dv(r.routesMeta.map(o=>o.childrenIndex),u.routesMeta.map(o=>o.childrenIndex)))}var Ev=/^:[\w-]+$/,wv=3,Tv=2,Av=1,Ov=10,Mv=-2,Vh=s=>s==="*";function Rv(s,r){let u=s.split("/"),o=u.length;return u.some(Vh)&&(o+=Mv),r&&(o+=Tv),u.filter(f=>!Vh(f)).reduce((f,m)=>f+(Ev.test(m)?wv:m===""?Av:Ov),o)}function Dv(s,r){return s.length===r.length&&s.slice(0,-1).every((o,f)=>o===r[f])?s[s.length-1]-r[r.length-1]:0}function zv(s,r,u=!1){let{routesMeta:o}=s,f={},m="/",p=[];for(let x=0;x<o.length;++x){let y=o[x],g=x===o.length-1,b=m==="/"?r:r.slice(m.length)||"/",j=Fi({path:y.relativePath,caseSensitive:y.caseSensitive,end:g},b),S=y.route;if(!j&&g&&u&&!o[o.length-1].route.index&&(j=Fi({path:y.relativePath,caseSensitive:y.caseSensitive,end:!1},b)),!j)return null;Object.assign(f,j.params),p.push({params:f,pathname:La([m,j.pathname]),pathnameBase:Hv(La([m,j.pathnameBase])),route:S}),j.pathnameBase!=="/"&&(m=La([m,j.pathnameBase]))}return p}function Fi(s,r){typeof s=="string"&&(s={path:s,caseSensitive:!1,end:!0});let[u,o]=kv(s.path,s.caseSensitive,s.end),f=r.match(u);if(!f)return null;let m=f[0],p=m.replace(/(.)\/+$/,"$1"),x=f.slice(1);return{params:o.reduce((g,{paramName:b,isOptional:j},S)=>{if(b==="*"){let A=x[S]||"";p=m.slice(0,m.length-A.length).replace(/(.)\/+$/,"$1")}const T=x[S];return j&&!T?g[b]=void 0:g[b]=(T||"").replace(/%2F/g,"/"),g},{}),pathname:m,pathnameBase:p,pattern:s}}function kv(s,r=!1,u=!0){ca(s==="*"||!s.endsWith("*")||s.endsWith("/*"),`Route path "${s}" will be treated as if it were "${s.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${s.replace(/\*$/,"/*")}".`);let o=[],f="^"+s.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(p,x,y)=>(o.push({paramName:x,isOptional:y!=null}),y?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return s.endsWith("*")?(o.push({paramName:"*"}),f+=s==="*"||s==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):u?f+="\\/*$":s!==""&&s!=="/"&&(f+="(?:(?=\\/|$))"),[new RegExp(f,r?void 0:"i"),o]}function _v(s){try{return s.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return ca(!1,`The URL path "${s}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${r}).`),s}}function Ba(s,r){if(r==="/")return s;if(!s.toLowerCase().startsWith(r.toLowerCase()))return null;let u=r.endsWith("/")?r.length-1:r.length,o=s.charAt(u);return o&&o!=="/"?null:s.slice(u)||"/"}var Uv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Lv(s,r="/"){let{pathname:u,search:o="",hash:f=""}=typeof s=="string"?Cn(s):s,m;return u?(u=u.replace(/\/\/+/g,"/"),u.startsWith("/")?m=$h(u.substring(1),"/"):m=$h(u,r)):m=r,{pathname:m,search:qv(o),hash:Yv(f)}}function $h(s,r){let u=r.replace(/\/+$/,"").split("/");return s.split("/").forEach(f=>{f===".."?u.length>1&&u.pop():f!=="."&&u.push(f)}),u.length>1?u.join("/"):"/"}function bu(s,r,u,o){return`Cannot include a '${s}' character in a manually specified \`to.${r}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${u}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Bv(s){return s.filter((r,u)=>u===0||r.route.path&&r.route.path.length>0)}function zu(s){let r=Bv(s);return r.map((u,o)=>o===r.length-1?u.pathname:u.pathnameBase)}function ku(s,r,u,o=!1){let f;typeof s=="string"?f=Cn(s):(f={...s},Fe(!f.pathname||!f.pathname.includes("?"),bu("?","pathname","search",f)),Fe(!f.pathname||!f.pathname.includes("#"),bu("#","pathname","hash",f)),Fe(!f.search||!f.search.includes("#"),bu("#","search","hash",f)));let m=s===""||f.pathname==="",p=m?"/":f.pathname,x;if(p==null)x=u;else{let j=r.length-1;if(!o&&p.startsWith("..")){let S=p.split("/");for(;S[0]==="..";)S.shift(),j-=1;f.pathname=S.join("/")}x=j>=0?r[j]:"/"}let y=Lv(f,x),g=p&&p!=="/"&&p.endsWith("/"),b=(m||p===".")&&u.endsWith("/");return!y.pathname.endsWith("/")&&(g||b)&&(y.pathname+="/"),y}var La=s=>s.join("/").replace(/\/\/+/g,"/"),Hv=s=>s.replace(/\/+$/,"").replace(/^\/*/,"/"),qv=s=>!s||s==="?"?"":s.startsWith("?")?s:"?"+s,Yv=s=>!s||s==="#"?"":s.startsWith("#")?s:"#"+s,Gv=class{constructor(s,r,u,o=!1){this.status=s,this.statusText=r||"",this.internal=o,u instanceof Error?(this.data=u.toString(),this.error=u):this.data=u}};function Xv(s){return s!=null&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.internal=="boolean"&&"data"in s}function Vv(s){return s.map(r=>r.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var mm=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function pm(s,r){let u=s;if(typeof u!="string"||!Uv.test(u))return{absoluteURL:void 0,isExternal:!1,to:u};let o=u,f=!1;if(mm)try{let m=new URL(window.location.href),p=u.startsWith("//")?new URL(m.protocol+u):new URL(u),x=Ba(p.pathname,r);p.origin===m.origin&&x!=null?u=x+p.search+p.hash:f=!0}catch{ca(!1,`<Link to="${u}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:f,to:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var gm=["POST","PUT","PATCH","DELETE"];new Set(gm);var $v=["GET",...gm];new Set($v);var En=h.createContext(null);En.displayName="DataRouter";var Ii=h.createContext(null);Ii.displayName="DataRouterState";var Qv=h.createContext(!1),vm=h.createContext({isTransitioning:!1});vm.displayName="ViewTransition";var Kv=h.createContext(new Map);Kv.displayName="Fetchers";var Zv=h.createContext(null);Zv.displayName="Await";var Vt=h.createContext(null);Vt.displayName="Navigation";var Ts=h.createContext(null);Ts.displayName="Location";var ma=h.createContext({outlet:null,matches:[],isDataRoute:!1});ma.displayName="Route";var _u=h.createContext(null);_u.displayName="RouteError";var ym="REACT_ROUTER_ERROR",Jv="REDIRECT",Wv="ROUTE_ERROR_RESPONSE";function Fv(s){if(s.startsWith(`${ym}:${Jv}:{`))try{let r=JSON.parse(s.slice(28));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.location=="string"&&typeof r.reloadDocument=="boolean"&&typeof r.replace=="boolean")return r}catch{}}function Pv(s){if(s.startsWith(`${ym}:${Wv}:{`))try{let r=JSON.parse(s.slice(40));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string")return new Gv(r.status,r.statusText,r.data)}catch{}}function Iv(s,{relative:r}={}){Fe(wn(),"useHref() may be used only in the context of a <Router> component.");let{basename:u,navigator:o}=h.useContext(Vt),{hash:f,pathname:m,search:p}=As(s,{relative:r}),x=m;return u!=="/"&&(x=m==="/"?u:La([u,m])),o.createHref({pathname:x,search:p,hash:f})}function wn(){return h.useContext(Ts)!=null}function fl(){return Fe(wn(),"useLocation() may be used only in the context of a <Router> component."),h.useContext(Ts).location}var xm="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function bm(s){h.useContext(Vt).static||h.useLayoutEffect(s)}function Ct(){let{isDataRoute:s}=h.useContext(ma);return s?fy():ey()}function ey(){Fe(wn(),"useNavigate() may be used only in the context of a <Router> component.");let s=h.useContext(En),{basename:r,navigator:u}=h.useContext(Vt),{matches:o}=h.useContext(ma),{pathname:f}=fl(),m=JSON.stringify(zu(o)),p=h.useRef(!1);return bm(()=>{p.current=!0}),h.useCallback((y,g={})=>{if(ca(p.current,xm),!p.current)return;if(typeof y=="number"){u.go(y);return}let b=ku(y,JSON.parse(m),f,g.relative==="path");s==null&&r!=="/"&&(b.pathname=b.pathname==="/"?r:La([r,b.pathname])),(g.replace?u.replace:u.push)(b,g.state,g)},[r,u,m,f,s])}h.createContext(null);function As(s,{relative:r}={}){let{matches:u}=h.useContext(ma),{pathname:o}=fl(),f=JSON.stringify(zu(u));return h.useMemo(()=>ku(s,JSON.parse(f),o,r==="path"),[s,f,o,r])}function ty(s,r){return jm(s,r)}function jm(s,r,u,o,f){var R;Fe(wn(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:m}=h.useContext(Vt),{matches:p}=h.useContext(ma),x=p[p.length-1],y=x?x.params:{},g=x?x.pathname:"/",b=x?x.pathnameBase:"/",j=x&&x.route;{let _=j&&j.path||"";Nm(g,!j||_.endsWith("*")||_.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${g}" (under <Route path="${_}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
59
|
+
|
|
60
|
+
Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}/*`}">.`)}let S=fl(),T;if(r){let _=typeof r=="string"?Cn(r):r;Fe(b==="/"||((R=_.pathname)==null?void 0:R.startsWith(b)),`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 "${b}" but pathname "${_.pathname}" was given in the \`location\` prop.`),T=_}else T=S;let A=T.pathname||"/",D=A;if(b!=="/"){let _=b.replace(/^\//,"").split("/");D="/"+A.replace(/^\//,"").split("/").slice(_.length).join("/")}let O=dm(s,{pathname:D});ca(j||O!=null,`No routes matched location "${T.pathname}${T.search}${T.hash}" `),ca(O==null||O[O.length-1].route.element!==void 0||O[O.length-1].route.Component!==void 0||O[O.length-1].route.lazy!==void 0,`Matched leaf route at location "${T.pathname}${T.search}${T.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let E=iy(O&&O.map(_=>Object.assign({},_,{params:Object.assign({},y,_.params),pathname:La([b,m.encodeLocation?m.encodeLocation(_.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?b:La([b,m.encodeLocation?m.encodeLocation(_.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathnameBase])})),p,u,o,f);return r&&E?h.createElement(Ts.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...T},navigationType:"POP"}},E):E}function ay(){let s=dy(),r=Xv(s)?`${s.status} ${s.statusText}`:s instanceof Error?s.message:JSON.stringify(s),u=s instanceof Error?s.stack:null,o="rgba(200,200,200, 0.5)",f={padding:"0.5rem",backgroundColor:o},m={padding:"2px 4px",backgroundColor:o},p=null;return console.error("Error handled by React Router default ErrorBoundary:",s),p=h.createElement(h.Fragment,null,h.createElement("p",null,"💿 Hey developer 👋"),h.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",h.createElement("code",{style:m},"ErrorBoundary")," or"," ",h.createElement("code",{style:m},"errorElement")," prop on your route.")),h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},r),u?h.createElement("pre",{style:f},u):null,p)}var ly=h.createElement(ay,null),Sm=class extends h.Component{constructor(s){super(s),this.state={location:s.location,revalidation:s.revalidation,error:s.error}}static getDerivedStateFromError(s){return{error:s}}static getDerivedStateFromProps(s,r){return r.location!==s.location||r.revalidation!=="idle"&&s.revalidation==="idle"?{error:s.error,location:s.location,revalidation:s.revalidation}:{error:s.error!==void 0?s.error:r.error,location:r.location,revalidation:s.revalidation||r.revalidation}}componentDidCatch(s,r){this.props.onError?this.props.onError(s,r):console.error("React Router caught the following error during render",s)}render(){let s=this.state.error;if(this.context&&typeof s=="object"&&s&&"digest"in s&&typeof s.digest=="string"){const u=Pv(s.digest);u&&(s=u)}let r=s!==void 0?h.createElement(ma.Provider,{value:this.props.routeContext},h.createElement(_u.Provider,{value:s,children:this.props.component})):this.props.children;return this.context?h.createElement(ny,{error:s},r):r}};Sm.contextType=Qv;var ju=new WeakMap;function ny({children:s,error:r}){let{basename:u}=h.useContext(Vt);if(typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){let o=Fv(r.digest);if(o){let f=ju.get(r);if(f)throw f;let m=pm(o.location,u);if(mm&&!ju.get(r))if(m.isExternal||o.reloadDocument)window.location.href=m.absoluteURL||m.to;else{const p=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(m.to,{replace:o.replace}));throw ju.set(r,p),p}return h.createElement("meta",{httpEquiv:"refresh",content:`0;url=${m.absoluteURL||m.to}`})}}return s}function sy({routeContext:s,match:r,children:u}){let o=h.useContext(En);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),h.createElement(ma.Provider,{value:s},u)}function iy(s,r=[],u=null,o=null,f=null){if(s==null){if(!u)return null;if(u.errors)s=u.matches;else if(r.length===0&&!u.initialized&&u.matches.length>0)s=u.matches;else return null}let m=s,p=u==null?void 0:u.errors;if(p!=null){let b=m.findIndex(j=>j.route.id&&(p==null?void 0:p[j.route.id])!==void 0);Fe(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(p).join(",")}`),m=m.slice(0,Math.min(m.length,b+1))}let x=!1,y=-1;if(u)for(let b=0;b<m.length;b++){let j=m[b];if((j.route.HydrateFallback||j.route.hydrateFallbackElement)&&(y=b),j.route.id){let{loaderData:S,errors:T}=u,A=j.route.loader&&!S.hasOwnProperty(j.route.id)&&(!T||T[j.route.id]===void 0);if(j.route.lazy||A){x=!0,y>=0?m=m.slice(0,y+1):m=[m[0]];break}}}let g=u&&o?(b,j)=>{var S,T;o(b,{location:u.location,params:((T=(S=u.matches)==null?void 0:S[0])==null?void 0:T.params)??{},unstable_pattern:Vv(u.matches),errorInfo:j})}:void 0;return m.reduceRight((b,j,S)=>{let T,A=!1,D=null,O=null;u&&(T=p&&j.route.id?p[j.route.id]:void 0,D=j.route.errorElement||ly,x&&(y<0&&S===0?(Nm("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),A=!0,O=null):y===S&&(A=!0,O=j.route.hydrateFallbackElement||null)));let E=r.concat(m.slice(0,S+1)),R=()=>{let _;return T?_=D:A?_=O:j.route.Component?_=h.createElement(j.route.Component,null):j.route.element?_=j.route.element:_=b,h.createElement(sy,{match:j,routeContext:{outlet:b,matches:E,isDataRoute:u!=null},children:_})};return u&&(j.route.ErrorBoundary||j.route.errorElement||S===0)?h.createElement(Sm,{location:u.location,revalidation:u.revalidation,component:D,error:T,children:R(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:g}):R()},null)}function Uu(s){return`${s} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function cy(s){let r=h.useContext(En);return Fe(r,Uu(s)),r}function ry(s){let r=h.useContext(Ii);return Fe(r,Uu(s)),r}function uy(s){let r=h.useContext(ma);return Fe(r,Uu(s)),r}function Lu(s){let r=uy(s),u=r.matches[r.matches.length-1];return Fe(u.route.id,`${s} can only be used on routes that contain a unique "id"`),u.route.id}function oy(){return Lu("useRouteId")}function dy(){var o;let s=h.useContext(_u),r=ry("useRouteError"),u=Lu("useRouteError");return s!==void 0?s:(o=r.errors)==null?void 0:o[u]}function fy(){let{router:s}=cy("useNavigate"),r=Lu("useNavigate"),u=h.useRef(!1);return bm(()=>{u.current=!0}),h.useCallback(async(f,m={})=>{ca(u.current,xm),u.current&&(typeof f=="number"?await s.navigate(f):await s.navigate(f,{fromRouteId:r,...m}))},[s,r])}var Qh={};function Nm(s,r,u){!r&&!Qh[s]&&(Qh[s]=!0,ca(!1,u))}h.memo(hy);function hy({routes:s,future:r,state:u,onError:o}){return jm(s,void 0,u,o,r)}function Kh({to:s,replace:r,state:u,relative:o}){Fe(wn(),"<Navigate> may be used only in the context of a <Router> component.");let{static:f}=h.useContext(Vt);ca(!f,"<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:m}=h.useContext(ma),{pathname:p}=fl(),x=Ct(),y=ku(s,zu(m),p,o==="path"),g=JSON.stringify(y);return h.useEffect(()=>{x(JSON.parse(g),{replace:r,state:u,relative:o})},[x,g,o,r,u]),null}function ke(s){Fe(!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 my({basename:s="/",children:r=null,location:u,navigationType:o="POP",navigator:f,static:m=!1,unstable_useTransitions:p}){Fe(!wn(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let x=s.replace(/^\/*/,"/"),y=h.useMemo(()=>({basename:x,navigator:f,static:m,unstable_useTransitions:p,future:{}}),[x,f,m,p]);typeof u=="string"&&(u=Cn(u));let{pathname:g="/",search:b="",hash:j="",state:S=null,key:T="default"}=u,A=h.useMemo(()=>{let D=Ba(g,x);return D==null?null:{location:{pathname:D,search:b,hash:j,state:S,key:T},navigationType:o}},[x,g,b,j,S,T,o]);return ca(A!=null,`<Router basename="${x}"> is not able to match the URL "${g}${b}${j}" because it does not start with the basename, so the <Router> won't render anything.`),A==null?null:h.createElement(Vt.Provider,{value:y},h.createElement(Ts.Provider,{children:r,value:A}))}function py({children:s,location:r}){return ty(Mu(s),r)}function Mu(s,r=[]){let u=[];return h.Children.forEach(s,(o,f)=>{if(!h.isValidElement(o))return;let m=[...r,f];if(o.type===h.Fragment){u.push.apply(u,Mu(o.props.children,m));return}Fe(o.type===ke,`[${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>`),Fe(!o.props.index||!o.props.children,"An index route cannot have child routes.");let p={id:o.props.id||m.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&&(p.children=Mu(o.props.children,m)),u.push(p)}),u}var Ji="get",Wi="application/x-www-form-urlencoded";function ec(s){return typeof HTMLElement<"u"&&s instanceof HTMLElement}function gy(s){return ec(s)&&s.tagName.toLowerCase()==="button"}function vy(s){return ec(s)&&s.tagName.toLowerCase()==="form"}function yy(s){return ec(s)&&s.tagName.toLowerCase()==="input"}function xy(s){return!!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)}function by(s,r){return s.button===0&&(!r||r==="_self")&&!xy(s)}var $i=null;function jy(){if($i===null)try{new FormData(document.createElement("form"),0),$i=!1}catch{$i=!0}return $i}var Sy=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Su(s){return s!=null&&!Sy.has(s)?(ca(!1,`"${s}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Wi}"`),null):s}function Ny(s,r){let u,o,f,m,p;if(vy(s)){let x=s.getAttribute("action");o=x?Ba(x,r):null,u=s.getAttribute("method")||Ji,f=Su(s.getAttribute("enctype"))||Wi,m=new FormData(s)}else if(gy(s)||yy(s)&&(s.type==="submit"||s.type==="image")){let x=s.form;if(x==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let y=s.getAttribute("formaction")||x.getAttribute("action");if(o=y?Ba(y,r):null,u=s.getAttribute("formmethod")||x.getAttribute("method")||Ji,f=Su(s.getAttribute("formenctype"))||Su(x.getAttribute("enctype"))||Wi,m=new FormData(x,s),!jy()){let{name:g,type:b,value:j}=s;if(b==="image"){let S=g?`${g}.`:"";m.append(`${S}x`,"0"),m.append(`${S}y`,"0")}else g&&m.append(g,j)}}else{if(ec(s))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');u=Ji,o=null,f=Wi,p=s}return m&&f==="text/plain"&&(p=m,m=void 0),{action:o,method:u.toLowerCase(),encType:f,formData:m,body:p}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Bu(s,r){if(s===!1||s===null||typeof s>"u")throw new Error(r)}function Cy(s,r,u,o){let f=typeof s=="string"?new URL(s,typeof window>"u"?"server://singlefetch/":window.location.origin):s;return u?f.pathname.endsWith("/")?f.pathname=`${f.pathname}_.${o}`:f.pathname=`${f.pathname}.${o}`:f.pathname==="/"?f.pathname=`_root.${o}`:r&&Ba(f.pathname,r)==="/"?f.pathname=`${r.replace(/\/$/,"")}/_root.${o}`:f.pathname=`${f.pathname.replace(/\/$/,"")}.${o}`,f}async function Ey(s,r){if(s.id in r)return r[s.id];try{let u=await import(s.module);return r[s.id]=u,u}catch(u){return console.error(`Error loading route module \`${s.module}\`, reloading page...`),console.error(u),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function wy(s){return s==null?!1:s.href==null?s.rel==="preload"&&typeof s.imageSrcSet=="string"&&typeof s.imageSizes=="string":typeof s.rel=="string"&&typeof s.href=="string"}async function Ty(s,r,u){let o=await Promise.all(s.map(async f=>{let m=r.routes[f.route.id];if(m){let p=await Ey(m,u);return p.links?p.links():[]}return[]}));return Ry(o.flat(1).filter(wy).filter(f=>f.rel==="stylesheet"||f.rel==="preload").map(f=>f.rel==="stylesheet"?{...f,rel:"prefetch",as:"style"}:{...f,rel:"prefetch"}))}function Zh(s,r,u,o,f,m){let p=(y,g)=>u[g]?y.route.id!==u[g].route.id:!0,x=(y,g)=>{var b;return u[g].pathname!==y.pathname||((b=u[g].route.path)==null?void 0:b.endsWith("*"))&&u[g].params["*"]!==y.params["*"]};return m==="assets"?r.filter((y,g)=>p(y,g)||x(y,g)):m==="data"?r.filter((y,g)=>{var j;let b=o.routes[y.route.id];if(!b||!b.hasLoader)return!1;if(p(y,g)||x(y,g))return!0;if(y.route.shouldRevalidate){let S=y.route.shouldRevalidate({currentUrl:new URL(f.pathname+f.search+f.hash,window.origin),currentParams:((j=u[0])==null?void 0:j.params)||{},nextUrl:new URL(s,window.origin),nextParams:y.params,defaultShouldRevalidate:!0});if(typeof S=="boolean")return S}return!0}):[]}function Ay(s,r,{includeHydrateFallback:u}={}){return Oy(s.map(o=>{let f=r.routes[o.route.id];if(!f)return[];let m=[f.module];return f.clientActionModule&&(m=m.concat(f.clientActionModule)),f.clientLoaderModule&&(m=m.concat(f.clientLoaderModule)),u&&f.hydrateFallbackModule&&(m=m.concat(f.hydrateFallbackModule)),f.imports&&(m=m.concat(f.imports)),m}).flat(1))}function Oy(s){return[...new Set(s)]}function My(s){let r={},u=Object.keys(s).sort();for(let o of u)r[o]=s[o];return r}function Ry(s,r){let u=new Set;return new Set(r),s.reduce((o,f)=>{let m=JSON.stringify(My(f));return u.has(m)||(u.add(m),o.push({key:m,link:f})),o},[])}function Cm(){let s=h.useContext(En);return Bu(s,"You must render this element inside a <DataRouterContext.Provider> element"),s}function Dy(){let s=h.useContext(Ii);return Bu(s,"You must render this element inside a <DataRouterStateContext.Provider> element"),s}var Hu=h.createContext(void 0);Hu.displayName="FrameworkContext";function Em(){let s=h.useContext(Hu);return Bu(s,"You must render this element inside a <HydratedRouter> element"),s}function zy(s,r){let u=h.useContext(Hu),[o,f]=h.useState(!1),[m,p]=h.useState(!1),{onFocus:x,onBlur:y,onMouseEnter:g,onMouseLeave:b,onTouchStart:j}=r,S=h.useRef(null);h.useEffect(()=>{if(s==="render"&&p(!0),s==="viewport"){let D=E=>{E.forEach(R=>{p(R.isIntersecting)})},O=new IntersectionObserver(D,{threshold:.5});return S.current&&O.observe(S.current),()=>{O.disconnect()}}},[s]),h.useEffect(()=>{if(o){let D=setTimeout(()=>{p(!0)},100);return()=>{clearTimeout(D)}}},[o]);let T=()=>{f(!0)},A=()=>{f(!1),p(!1)};return u?s!=="intent"?[m,S,{}]:[m,S,{onFocus:Ns(x,T),onBlur:Ns(y,A),onMouseEnter:Ns(g,T),onMouseLeave:Ns(b,A),onTouchStart:Ns(j,T)}]:[!1,S,{}]}function Ns(s,r){return u=>{s&&s(u),u.defaultPrevented||r(u)}}function ky({page:s,...r}){let{router:u}=Cm(),o=h.useMemo(()=>dm(u.routes,s,u.basename),[u.routes,s,u.basename]);return o?h.createElement(Uy,{page:s,matches:o,...r}):null}function _y(s){let{manifest:r,routeModules:u}=Em(),[o,f]=h.useState([]);return h.useEffect(()=>{let m=!1;return Ty(s,r,u).then(p=>{m||f(p)}),()=>{m=!0}},[s,r,u]),o}function Uy({page:s,matches:r,...u}){let o=fl(),{future:f,manifest:m,routeModules:p}=Em(),{basename:x}=Cm(),{loaderData:y,matches:g}=Dy(),b=h.useMemo(()=>Zh(s,r,g,m,o,"data"),[s,r,g,m,o]),j=h.useMemo(()=>Zh(s,r,g,m,o,"assets"),[s,r,g,m,o]),S=h.useMemo(()=>{if(s===o.pathname+o.search+o.hash)return[];let D=new Set,O=!1;if(r.forEach(R=>{var K;let _=m.routes[R.route.id];!_||!_.hasLoader||(!b.some(Q=>Q.route.id===R.route.id)&&R.route.id in y&&((K=p[R.route.id])!=null&&K.shouldRevalidate)||_.hasClientLoader?O=!0:D.add(R.route.id))}),D.size===0)return[];let E=Cy(s,x,f.unstable_trailingSlashAwareDataRequests,"data");return O&&D.size>0&&E.searchParams.set("_routes",r.filter(R=>D.has(R.route.id)).map(R=>R.route.id).join(",")),[E.pathname+E.search]},[x,f.unstable_trailingSlashAwareDataRequests,y,o,m,b,r,s,p]),T=h.useMemo(()=>Ay(j,m),[j,m]),A=_y(j);return h.createElement(h.Fragment,null,S.map(D=>h.createElement("link",{key:D,rel:"prefetch",as:"fetch",href:D,...u})),T.map(D=>h.createElement("link",{key:D,rel:"modulepreload",href:D,...u})),A.map(({key:D,link:O})=>h.createElement("link",{key:D,nonce:u.nonce,...O,crossOrigin:O.crossOrigin??u.crossOrigin})))}function Ly(...s){return r=>{s.forEach(u=>{typeof u=="function"?u(r):u!=null&&(u.current=r)})}}var By=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{By&&(window.__reactRouterVersion="7.13.0")}catch{}function Hy({basename:s,children:r,unstable_useTransitions:u,window:o}){let f=h.useRef();f.current==null&&(f.current=xv({window:o,v5Compat:!0}));let m=f.current,[p,x]=h.useState({action:m.action,location:m.location}),y=h.useCallback(g=>{u===!1?x(g):h.startTransition(()=>x(g))},[u]);return h.useLayoutEffect(()=>m.listen(y),[m,y]),h.createElement(my,{basename:s,children:r,location:p.location,navigationType:p.action,navigator:m,unstable_useTransitions:u})}var wm=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Tm=h.forwardRef(function({onClick:r,discover:u="render",prefetch:o="none",relative:f,reloadDocument:m,replace:p,state:x,target:y,to:g,preventScrollReset:b,viewTransition:j,unstable_defaultShouldRevalidate:S,...T},A){let{basename:D,unstable_useTransitions:O}=h.useContext(Vt),E=typeof g=="string"&&wm.test(g),R=pm(g,D);g=R.to;let _=Iv(g,{relative:f}),[K,Q,Z]=zy(o,T),F=Xy(g,{replace:p,state:x,target:y,preventScrollReset:b,relative:f,viewTransition:j,unstable_defaultShouldRevalidate:S,unstable_useTransitions:O});function Y(ce){r&&r(ce),ce.defaultPrevented||F(ce)}let te=h.createElement("a",{...T,...Z,href:R.absoluteURL||_,onClick:R.isExternal||m?r:Y,ref:Ly(A,Q),target:y,"data-discover":!E&&u==="render"?"true":void 0});return K&&!E?h.createElement(h.Fragment,null,te,h.createElement(ky,{page:_})):te});Tm.displayName="Link";var qy=h.forwardRef(function({"aria-current":r="page",caseSensitive:u=!1,className:o="",end:f=!1,style:m,to:p,viewTransition:x,children:y,...g},b){let j=As(p,{relative:g.relative}),S=fl(),T=h.useContext(Ii),{navigator:A,basename:D}=h.useContext(Vt),O=T!=null&&Zy(j)&&x===!0,E=A.encodeLocation?A.encodeLocation(j).pathname:j.pathname,R=S.pathname,_=T&&T.navigation&&T.navigation.location?T.navigation.location.pathname:null;u||(R=R.toLowerCase(),_=_?_.toLowerCase():null,E=E.toLowerCase()),_&&D&&(_=Ba(_,D)||_);const K=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let Q=R===E||!f&&R.startsWith(E)&&R.charAt(K)==="/",Z=_!=null&&(_===E||!f&&_.startsWith(E)&&_.charAt(E.length)==="/"),F={isActive:Q,isPending:Z,isTransitioning:O},Y=Q?r:void 0,te;typeof o=="function"?te=o(F):te=[o,Q?"active":null,Z?"pending":null,O?"transitioning":null].filter(Boolean).join(" ");let ce=typeof m=="function"?m(F):m;return h.createElement(Tm,{...g,"aria-current":Y,className:te,ref:b,style:ce,to:p,viewTransition:x},typeof y=="function"?y(F):y)});qy.displayName="NavLink";var Yy=h.forwardRef(({discover:s="render",fetcherKey:r,navigate:u,reloadDocument:o,replace:f,state:m,method:p=Ji,action:x,onSubmit:y,relative:g,preventScrollReset:b,viewTransition:j,unstable_defaultShouldRevalidate:S,...T},A)=>{let{unstable_useTransitions:D}=h.useContext(Vt),O=Qy(),E=Ky(x,{relative:g}),R=p.toLowerCase()==="get"?"get":"post",_=typeof x=="string"&&wm.test(x),K=Q=>{if(y&&y(Q),Q.defaultPrevented)return;Q.preventDefault();let Z=Q.nativeEvent.submitter,F=(Z==null?void 0:Z.getAttribute("formmethod"))||p,Y=()=>O(Z||Q.currentTarget,{fetcherKey:r,method:F,navigate:u,replace:f,state:m,relative:g,preventScrollReset:b,viewTransition:j,unstable_defaultShouldRevalidate:S});D&&u!==!1?h.startTransition(()=>Y()):Y()};return h.createElement("form",{ref:A,method:R,action:E,onSubmit:o?y:K,...T,"data-discover":!_&&s==="render"?"true":void 0})});Yy.displayName="Form";function Gy(s){return`${s} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Am(s){let r=h.useContext(En);return Fe(r,Gy(s)),r}function Xy(s,{target:r,replace:u,state:o,preventScrollReset:f,relative:m,viewTransition:p,unstable_defaultShouldRevalidate:x,unstable_useTransitions:y}={}){let g=Ct(),b=fl(),j=As(s,{relative:m});return h.useCallback(S=>{if(by(S,r)){S.preventDefault();let T=u!==void 0?u:ws(b)===ws(j),A=()=>g(s,{replace:T,state:o,preventScrollReset:f,relative:m,viewTransition:p,unstable_defaultShouldRevalidate:x});y?h.startTransition(()=>A()):A()}},[b,g,j,u,o,r,s,f,m,p,x,y])}var Vy=0,$y=()=>`__${String(++Vy)}__`;function Qy(){let{router:s}=Am("useSubmit"),{basename:r}=h.useContext(Vt),u=oy(),o=s.fetch,f=s.navigate;return h.useCallback(async(m,p={})=>{let{action:x,method:y,encType:g,formData:b,body:j}=Ny(m,r);if(p.navigate===!1){let S=p.fetcherKey||$y();await o(S,u,p.action||x,{unstable_defaultShouldRevalidate:p.unstable_defaultShouldRevalidate,preventScrollReset:p.preventScrollReset,formData:b,body:j,formMethod:p.method||y,formEncType:p.encType||g,flushSync:p.flushSync})}else await f(p.action||x,{unstable_defaultShouldRevalidate:p.unstable_defaultShouldRevalidate,preventScrollReset:p.preventScrollReset,formData:b,body:j,formMethod:p.method||y,formEncType:p.encType||g,replace:p.replace,state:p.state,fromRouteId:u,flushSync:p.flushSync,viewTransition:p.viewTransition})},[o,f,r,u])}function Ky(s,{relative:r}={}){let{basename:u}=h.useContext(Vt),o=h.useContext(ma);Fe(o,"useFormAction must be used inside a RouteContext");let[f]=o.matches.slice(-1),m={...As(s||".",{relative:r})},p=fl();if(s==null){m.search=p.search;let x=new URLSearchParams(m.search),y=x.getAll("index");if(y.some(b=>b==="")){x.delete("index"),y.filter(j=>j).forEach(j=>x.append("index",j));let b=x.toString();m.search=b?`?${b}`:""}}return(!s||s===".")&&f.route.index&&(m.search=m.search?m.search.replace(/^\?/,"?index&"):"?index"),u!=="/"&&(m.pathname=m.pathname==="/"?u:La([u,m.pathname])),ws(m)}function Zy(s,{relative:r}={}){let u=h.useContext(vm);Fe(u!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=Am("useViewTransitionState"),f=As(s,{relative:r});if(!u.isTransitioning)return!1;let m=Ba(u.currentLocation.pathname,o)||u.currentLocation.pathname,p=Ba(u.nextLocation.pathname,o)||u.nextLocation.pathname;return Fi(f.pathname,p)!=null||Fi(f.pathname,m)!=null}var Jy=om();const Wy=["nebula","monolith","signal","polar","neon","terra"],Fy=[{id:"nebula",name:"Nebula",description:"Glassmorphism command center",mode:"dark",colors:["#080b16","#8b5cf6","#10b981","#f0f0f5"]},{id:"monolith",name:"Monolith",description:"Cinematic ultra-minimal",mode:"dark",colors:["#000000","#7c3aed","#ffffff","#404040"]},{id:"signal",name:"Signal",description:"Warm sci-fi terminal",mode:"dark",colors:["#0c0c0c","#f59e0b","#22c55e","#e8e4dd"]},{id:"polar",name:"Polar",description:"Premium light mode",mode:"light",colors:["#ffffff","#3b82f6","#059669","#111827"]},{id:"neon",name:"Neon",description:"Cyberpunk vivid",mode:"dark",colors:["#09090b","#06b6d4","#ec4899","#22c55e"]},{id:"terra",name:"Terra",description:"Warm organic dark",mode:"dark",colors:["#1a1612","#c97b5c","#8faa7b","#e8e0d4"]}],Om=h.createContext({theme:"nebula",setTheme:()=>{}});function Py({children:s}){const[r,u]=h.useState(()=>{const f=localStorage.getItem("auxiora-theme");return f&&Wy.includes(f)?f:"nebula"}),o=h.useCallback(f=>{u(f),localStorage.setItem("auxiora-theme",f),document.documentElement.setAttribute("data-theme",f)},[]);return h.useEffect(()=>{document.documentElement.setAttribute("data-theme",r)},[]),n.jsx(Om.Provider,{value:{theme:r,setTheme:o},children:s})}function qu(){return h.useContext(Om)}const Iy="/api/v1/dashboard";async function se(s,r){const u=await fetch(`${Iy}${s}`,{credentials:"include",headers:{"Content-Type":"application/json"},...r});if(u.status===401)throw window.location.href="/dashboard/login",new Error("Unauthorized");if(!u.ok){const o=await u.json().catch(()=>({}));throw new Error(o.error||`HTTP ${u.status}`)}return u.json()}const ex="/api/v1/marketplace";async function Sn(s,r){const u=await fetch(`${ex}${s}`,{credentials:"include",headers:{"Content-Type":"application/json"},...r});if(u.status===401)throw window.location.href="/dashboard/login",new Error("Unauthorized");if(!u.ok){const o=await u.json().catch(()=>({}));throw new Error(o.error||`HTTP ${u.status}`)}return u.json()}const I={checkAuth:()=>se("/auth/check"),login:s=>se("/auth/login",{method:"POST",body:JSON.stringify({password:s})}),logout:()=>se("/auth/logout",{method:"POST"}),getBehaviors:()=>se("/behaviors"),patchBehavior:(s,r)=>se(`/behaviors/${s}`,{method:"PATCH",body:JSON.stringify(r)}),deleteBehavior:s=>se(`/behaviors/${s}`,{method:"DELETE"}),createBehavior:s=>se("/behaviors",{method:"POST",body:JSON.stringify(s)}),getWebhooks:()=>se("/webhooks"),patchWebhook:(s,r)=>se(`/webhooks/${s}`,{method:"PATCH",body:JSON.stringify(r)}),deleteWebhook:s=>se(`/webhooks/${s}`,{method:"DELETE"}),createWebhook:s=>se("/webhooks",{method:"POST",body:JSON.stringify(s)}),getSessions:()=>se("/sessions"),getAudit:s=>{const r=new URLSearchParams;s!=null&&s.type&&r.set("type",s.type),s!=null&&s.limit&&r.set("limit",String(s.limit));const u=r.toString();return se(`/audit${u?`?${u}`:""}`)},getStatus:()=>se("/status"),getActiveAgents:()=>se("/status/agents"),getHealthState:()=>se("/status/health"),getCapabilities:()=>se("/status/capabilities"),getSetupStatus:()=>se("/setup/status"),setupVault:s=>se("/setup/vault",{method:"POST",body:JSON.stringify({password:s})}),setupDashboardPassword:s=>se("/setup/dashboard-password",{method:"POST",body:JSON.stringify({password:s})}),setupIdentity:(s,r,u)=>se("/setup/identity",{method:"POST",body:JSON.stringify({name:s,pronouns:r,vibe:u})}),getSetupTemplates:()=>se("/setup/templates"),setupPersonality:s=>se("/setup/personality",{method:"POST",body:JSON.stringify({template:s})}),setupProvider:(s,r,u)=>se("/setup/provider",{method:"POST",body:JSON.stringify({provider:s,apiKey:r,endpoint:u})}),setupProviders:s=>se("/setup/provider",{method:"POST",body:JSON.stringify({providers:s})}),setupChannels:s=>se("/setup/channels",{method:"POST",body:JSON.stringify({channels:s})}),completeSetup:()=>se("/setup/complete",{method:"POST"}),getModels:()=>se("/models"),getIdentity:()=>se("/identity"),updateIdentity:(s,r)=>se("/identity",{method:"POST",body:JSON.stringify({name:s,pronouns:r})}),getPersonality:()=>se("/personality"),getTemplates:()=>se("/personality/templates"),updatePersonality:s=>se("/personality",{method:"POST",body:JSON.stringify({template:s})}),getPersonalityFull:()=>se("/personality/full"),updatePersonalityFull:s=>se("/personality/full",{method:"PUT",body:JSON.stringify(s)}),updateProvider:(s,r,u)=>se("/provider",{method:"POST",body:JSON.stringify({provider:s,apiKey:r,endpoint:u})}),configureProvider:(s,r,u)=>se("/provider/configure",{method:"POST",body:JSON.stringify({provider:s,apiKey:r,endpoint:u})}),startClaudeOAuth:()=>se("/provider/claude-oauth/start",{method:"POST"}),completeClaudeOAuth:s=>se("/provider/claude-oauth/callback",{method:"POST",body:JSON.stringify({code:s})}),disconnectClaudeOAuth:()=>se("/provider/claude-oauth/disconnect",{method:"POST"}),getClaudeOAuthStatus:()=>se("/provider/claude-oauth/status"),updateRouting:(s,r)=>se("/provider/routing",{method:"POST",body:JSON.stringify({primary:s,fallback:r})}),setProviderModel:(s,r)=>se("/provider/model",{method:"POST",body:JSON.stringify({provider:s,model:r})}),getSessionMessages:()=>se("/session/messages"),getChannels:()=>se("/channels"),updateChannels:s=>se("/channels",{method:"POST",body:JSON.stringify({channels:s})}),changeDashboardPassword:(s,r)=>se("/security/dashboard-password",{method:"POST",body:JSON.stringify({oldPassword:s,newPassword:r})}),changeVaultPassword:s=>se("/security/vault-password",{method:"POST",body:JSON.stringify({newPassword:s})}),getSealStatus:()=>se("/security/seal/status"),enableSeal:(s,r)=>se("/security/seal",{method:"POST",body:JSON.stringify({password:s,pin:r})}),disableSeal:()=>se("/security/seal",{method:"DELETE"}),getConnectorStatus:s=>se(`/connectors/${s}/status`),saveConnectorCredentials:(s,r,u)=>se(`/connectors/${s}/credentials`,{method:"POST",body:JSON.stringify({clientId:r,clientSecret:u})}),disconnectConnector:s=>se(`/connectors/${s}/disconnect`,{method:"POST"}),getAmbientConfig:()=>se("/ambient/config"),updateAmbientConfig:s=>se("/ambient/config",{method:"POST",body:JSON.stringify(s)}),getPersonalityEngine:()=>se("/personality/engine"),setPersonalityEngine:s=>se("/personality/engine",{method:"PUT",body:JSON.stringify({engine:s})}),updateChatPersonality:(s,r)=>se(`/chats/${s}`,{method:"PATCH",body:JSON.stringify({personality:r})}),getArchitectPreferences:()=>se("/architect/preferences"),updateArchitectPreference:(s,r)=>se("/architect/preferences",{method:"PATCH",body:JSON.stringify({key:s,value:r})}),clearArchitectData:()=>se("/architect/data",{method:"DELETE"}),exportArchitectData:()=>se("/architect/data/export"),getAppearance:()=>se("/appearance"),updateAppearance:s=>se("/appearance",{method:"POST",body:JSON.stringify({theme:s})}),getChats:s=>se(`/chats${s?"?archived=true":""}`),createNewChat:s=>se("/chats",{method:"POST",body:JSON.stringify({title:s})}),getChatMessages:s=>se(`/chats/${s}/messages`),renameChat:(s,r)=>se(`/chats/${s}`,{method:"PATCH",body:JSON.stringify({title:r})}),archiveChat:s=>se(`/chats/${s}`,{method:"PATCH",body:JSON.stringify({archived:!0})}),deleteChatThread:s=>se(`/chats/${s}`,{method:"DELETE"}),getNotifications:()=>se("/notifications"),dismissNotification:s=>se(`/notifications/${s}/dismiss`,{method:"POST"}),getNotificationPreferences:()=>se("/notifications/preferences"),updateNotificationPreferences:s=>se("/notifications/preferences",{method:"POST",body:JSON.stringify(s)}),getUserModel:()=>fetch("/api/v1/user-model",{credentials:"include"}).then(async s=>{if(!s.ok){const r=await s.json().catch(()=>({}));throw new Error(r.error||`HTTP ${s.status}`)}return s.json()}),getMemories:s=>{const r=s?`?category=${encodeURIComponent(s)}`:"";return se(`/memories${r}`)},searchMemories:s=>se(`/memories/search?q=${encodeURIComponent(s)}`),deleteMemory:s=>se(`/memories/${encodeURIComponent(s)}`,{method:"DELETE"}),updateMemory:(s,r)=>se(`/memories/${encodeURIComponent(s)}`,{method:"PATCH",body:JSON.stringify(r)}),exportMemories:()=>se("/memories/export"),forgetTopic:s=>se("/forget",{method:"POST",body:JSON.stringify({topic:s})}),exportPersonalization:()=>se("/export/personalization"),searchPlugins:(s={})=>{const r=new URLSearchParams;s.q&&r.set("q",s.q),s.author&&r.set("author",s.author),s.keywords&&r.set("keywords",s.keywords),s.sort&&r.set("sort",s.sort),s.limit&&r.set("limit",String(s.limit)),s.offset&&r.set("offset",String(s.offset));const u=r.toString();return Sn(`/plugins/search${u?`?${u}`:""}`)},getPlugin:s=>Sn(`/plugins/${encodeURIComponent(s)}`),installPlugin:(s,r)=>Sn("/plugins/install",{method:"POST",body:JSON.stringify({name:s,version:r})}),searchPersonalities:(s={})=>{const r=new URLSearchParams;s.q&&r.set("q",s.q),s.author&&r.set("author",s.author),s.sort&&r.set("sort",s.sort),s.limit&&r.set("limit",String(s.limit)),s.offset&&r.set("offset",String(s.offset));const u=r.toString();return Sn(`/personalities/search${u?`?${u}`:""}`)},getMarketplacePersonality:s=>Sn(`/personalities/${encodeURIComponent(s)}`),installPersonality:(s,r)=>Sn("/personalities/install",{method:"POST",body:JSON.stringify({name:s,version:r})}),getJobStats:()=>fetch("/api/v1/jobs/status",{credentials:"include"}).then(s=>s.json()),getJobList:s=>{const r=new URLSearchParams;s!=null&&s.status&&r.set("status",s.status),s!=null&&s.type&&r.set("type",s.type),s!=null&&s.limit&&r.set("limit",String(s.limit));const u=r.toString();return fetch(`/api/v1/jobs/list${u?`?${u}`:""}`,{credentials:"include"}).then(o=>o.json())},retryJob:s=>fetch(`/api/v1/jobs/${encodeURIComponent(s)}/retry`,{method:"POST",credentials:"include"}).then(r=>r.json())};async function tx(){const s=await fetch("/api/v1/features/status",{credentials:"include"});if(!s.ok)throw new Error(`HTTP ${s.status}`);return s.json()}function ut(s,r=[]){const[u,o]=h.useState(null),[f,m]=h.useState(!0),[p,x]=h.useState(null),y=h.useCallback(()=>{m(!0),s().then(g=>{o(g),x(null)}).catch(g=>x(g.message)).finally(()=>m(!1))},r);return h.useEffect(()=>{y()},[y]),{data:u,loading:f,error:p,refresh:y}}function Os(s,r=1e4){h.useEffect(()=>{const u=setInterval(s,r);return()=>clearInterval(u)},[s,r])}const Mm="auxiora-windows",Rm="auxiora-snap-grid",Nu=360,Cu=240,ax=600,lx=500,Jh=30,nx=36,Wh=100,Cs=40;function Qi(s,r){return Math.round(s/r)*r}function Ru(s,r,u,o){const f=typeof window<"u"?window.innerWidth:1920,m=typeof window<"u"?window.innerHeight:1080;return{x:Math.max(Wh-u,Math.min(s,f-Wh)),y:Math.max(0,Math.min(r,m-nx))}}function sx(){try{const s=localStorage.getItem(Mm);if(!s)return new Map;const r=JSON.parse(s),u=new Map(Object.entries(r));for(const[o,f]of u){const m=Ru(f.x,f.y,f.width,f.height);(m.x!==f.x||m.y!==f.y)&&u.set(o,{...f,x:m.x,y:m.y})}return u}catch{return new Map}}function ix(s){const r=Object.fromEntries(s);localStorage.setItem(Mm,JSON.stringify(r))}function Eu(s){let r=0;for(const u of s.values())u.zIndex>r&&(r=u.zIndex);return r+1}function cx(){try{return localStorage.getItem(Rm)==="1"}catch{return!1}}function rx(){const[s,r]=h.useState(sx),[u,o]=h.useState(cx),f=h.useCallback(A=>{r(D=>{const O=A(D);return ix(O),O})},[]),m=h.useCallback((A,D,O,E)=>{f(R=>{if(R.has(A)){const Y=new Map(R),te=Y.get(A);return Y.set(A,{...te,zIndex:Eu(Y),minimized:!1}),Y}const _=new Map(R),K=_.size,Q=Math.max(Nu,O??ax),Z=Math.max(Cu,E??lx),F=Ru(80+K%8*Jh,60+K%8*Jh,Q);return _.set(A,{id:A,title:D,x:F.x,y:F.y,width:Q,height:Z,zIndex:Eu(_),minimized:!1,maximized:!1}),_})},[f]),p=h.useCallback(A=>{f(D=>{const O=new Map(D);return O.delete(A),O})},[f]),x=h.useCallback(A=>{f(D=>{const O=D.get(A);if(!O)return D;const E=new Map(D);return E.set(A,{...O,zIndex:Eu(E)}),E})},[f]),y=h.useCallback(()=>{o(A=>{const D=!A;try{localStorage.setItem(Rm,D?"1":"0")}catch{}return D})},[]),g=h.useCallback((A,D,O)=>{f(E=>{const R=E.get(A);if(!R)return E;const _=u?Qi(D,Cs):D,K=u?Qi(O,Cs):O,Q=Ru(_,K,R.width,R.height),Z=new Map(E);return Z.set(A,{...R,x:Q.x,y:Q.y}),Z})},[f,u]),b=h.useCallback((A,D,O)=>{f(E=>{const R=E.get(A);if(!R)return E;const _=u?Qi(Math.max(Nu,D),Cs):Math.max(Nu,D),K=u?Qi(Math.max(Cu,O),Cs):Math.max(Cu,O),Q=new Map(E);return Q.set(A,{...R,width:_,height:K}),Q})},[f,u]),j=h.useCallback(A=>{f(D=>{const O=D.get(A);if(!O)return D;const E=new Map(D);return E.set(A,{...O,minimized:!O.minimized}),E})},[f]),S=h.useCallback(A=>{f(D=>{const O=D.get(A);if(!O)return D;const E=new Map(D);return E.set(A,{...O,maximized:!O.maximized}),E})},[f]),T=h.useMemo(()=>{let A=-1,D=null;for(const O of s.values())!O.minimized&&O.zIndex>A&&(A=O.zIndex,D=O.id);return D},[s]);return{windows:s,activeWindowId:T,snapEnabled:u,gridSize:Cs,openWindow:m,closeWindow:p,focusWindow:x,moveWindow:g,resizeWindow:b,toggleMinimize:j,toggleMaximize:S,toggleSnap:y}}const ux=["n","s","e","w","ne","nw","se","sw"];function ox({id:s,title:r,x:u,y:o,width:f,height:m,zIndex:p,minimized:x,maximized:y,focused:g,onClose:b,onFocus:j,onMinimize:S,onMaximize:T,onMove:A,onResize:D,children:O}){const E=h.useRef(null),R=h.useCallback(Z=>{if(y)return;Z.preventDefault(),j();const F=Z.clientX,Y=Z.clientY;E.current={startX:F,startY:Y,origX:u,origY:o};const te=ie=>{if(!E.current)return;const he=ie.clientX-E.current.startX,ee=ie.clientY-E.current.startY;A(E.current.origX+he,E.current.origY+ee)},ce=()=>{E.current=null,document.removeEventListener("mousemove",te),document.removeEventListener("mouseup",ce)};document.addEventListener("mousemove",te),document.addEventListener("mouseup",ce)},[y,u,o,j,A]),_=h.useCallback((Z,F)=>{if(y)return;F.preventDefault(),F.stopPropagation(),j();const Y=F.clientX,te=F.clientY,ce=u,ie=o,he=f,ee=m,oe=H=>{const J=H.clientX-Y,ne=H.clientY-te;let P=ce,de=ie,C=he,L=ee;Z.includes("e")&&(C=he+J),Z.includes("w")&&(C=he-J,P=ce+J),Z.includes("s")&&(L=ee+ne),Z.includes("n")&&(L=ee-ne,de=ie+ne),D(C,L),(Z.includes("w")||Z.includes("n"))&&A(P,de)},ve=()=>{document.removeEventListener("mousemove",oe),document.removeEventListener("mouseup",ve)};document.addEventListener("mousemove",oe),document.addEventListener("mouseup",ve)},[y,u,o,f,m,j,D,A]);if(x)return null;const K=y?{zIndex:p,inset:"0",width:"100%",height:"100%"}:{left:`${u}px`,top:`${o}px`,width:`${f}px`,height:`${m}px`,zIndex:p},Q=["window","glass-mid"];return g&&Q.push("focused"),y&&Q.push("maximized"),n.jsxs("div",{className:Q.join(" "),style:K,onMouseDown:j,"data-window-id":s,children:[!y&&ux.map(Z=>n.jsx("div",{className:`window-resize window-resize-${Z}`,onMouseDown:F=>_(Z,F)},Z)),n.jsxs("div",{className:"window-titlebar",onMouseDown:R,children:[n.jsxs("div",{className:"window-traffic-lights",children:[n.jsx("button",{type:"button",className:"window-traffic-light close","aria-label":"Close window",onClick:Z=>{Z.stopPropagation(),b()}}),n.jsx("button",{type:"button",className:"window-traffic-light minimize","aria-label":"Minimize window",onClick:Z=>{Z.stopPropagation(),S()}}),n.jsx("button",{type:"button",className:"window-traffic-light maximize","aria-label":"Maximize window",onClick:Z=>{Z.stopPropagation(),T()}})]}),n.jsx("span",{className:"window-title",children:r})]}),n.jsx("div",{className:"window-body",children:O})]})}function dx({items:s,openWindows:r,onOpen:u}){const o=h.useRef(null),f=h.useCallback(p=>{const x=o.current;if(!x)return;const y=x.querySelectorAll(".dock-icon-wrapper"),g=p.clientX;y.forEach(b=>{const j=b.getBoundingClientRect(),S=j.left+j.width/2,T=Math.abs(g-S);b.classList.remove("mag-center","mag-near","mag-far"),T<25?b.classList.add("mag-center"):T<60?b.classList.add("mag-near"):T<100&&b.classList.add("mag-far")})},[]),m=h.useCallback(()=>{const p=o.current;p&&p.querySelectorAll(".dock-icon-wrapper").forEach(x=>{x.classList.remove("mag-center","mag-near","mag-far")})},[]);return n.jsx("div",{className:"dock-container",ref:o,onMouseMove:f,onMouseLeave:m,children:s.map(p=>n.jsxs("div",{className:"dock-icon-wrapper",children:[n.jsx("div",{className:"dock-tooltip",children:p.label}),n.jsx("button",{type:"button",className:"dock-icon","aria-label":`Open ${p.label}`,onClick:()=>u(p.id),children:p.icon}),n.jsx("div",{className:`dock-icon-dot${r.has(p.id)?" active":""}`})]},p.id))})}function fx(){const[s,r]=h.useState([]),u=h.useRef(new Set),o=h.useCallback(async()=>{try{const m=await fetch("/api/v1/tool-approvals/pending");if(!m.ok)return;const p=await m.json();r(p.filter(x=>!u.current.has(x.id)))}catch{}},[]);h.useEffect(()=>{o();const m=setInterval(o,3e3);return()=>clearInterval(m)},[o]);const f=h.useCallback(async(m,p)=>{u.current.add(m),r(x=>x.filter(y=>y.id!==m));try{await fetch(`/api/v1/tool-approvals/${m}/resolve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({approved:p})})}catch{}},[]);return s.length===0?null:n.jsx("div",{className:"ab-banner",children:s.map(m=>n.jsxs("div",{className:"ab-item",children:[n.jsx("span",{className:"ab-tool",children:m.toolName}),n.jsx("span",{className:"ab-args",children:JSON.stringify(m.args)}),n.jsx("button",{className:"ab-approve",onClick:()=>f(m.id,!0),children:"Approve"}),n.jsx("button",{className:"ab-deny",onClick:()=>f(m.id,!1),children:"Deny"})]},m.id))})}const hx={"behavior.executed":s=>s.success?"Behavior ran successfully":`Behavior failed: ${s.error??"unknown"}`,"behavior.created":()=>"Behavior created","behavior.updated":()=>"Behavior updated","behavior.deleted":()=>"Behavior deleted","behavior.paused":()=>"Behavior paused","behavior.failed":s=>`Behavior failed: ${s.error??"unknown"}`,"message.received":s=>`Message received on ${s.channelType??"unknown"}`,"message.sent":s=>`Message sent to ${s.channelType??"unknown"}`,"message.filtered":()=>"Message filtered","channel.connected":s=>`${s.channelType??"Channel"} connected`,"channel.disconnected":s=>`${s.channelType??"Channel"} disconnected`,"channel.error":s=>`${s.channelType??"Channel"} error`,"webhook.triggered":s=>`Webhook triggered: ${s.path??""}`,"webhook.received":()=>"Webhook received","webhook.created":()=>"Webhook created","webhook.deleted":()=>"Webhook deleted","webhook.error":s=>`Webhook error: ${s.error??"unknown"}`,"system.startup":()=>"System started","system.shutdown":()=>"System shut down","system.error":s=>`System error: ${s.error??"unknown"}`,"auth.login":()=>"Login","auth.logout":()=>"Logout"},mx={behavior:"var(--accent)",message:"#3b82f6",channel:"var(--success)",webhook:"#f97316",system:"var(--text-secondary)",auth:"var(--danger)"};function px(s){return s.split(".")[0]}function gx(s,r){const u=hx[s];return u?u(r):s.replace(/\./g," ").replace(/\b\w/g,o=>o.toUpperCase())}function vx(s){const r=(Date.now()-new Date(s).getTime())/1e3;return r<60?"just now":r<3600?`${Math.floor(r/60)}m ago`:r<86400?`${Math.floor(r/3600)}h ago`:`${Math.floor(r/86400)}d ago`}const Fh=100;function yx(){const[s,r]=h.useState([]),u=h.useRef(null);return h.useEffect(()=>{I.getAudit({limit:50}).then(o=>{if(o.data){const f=["behavior.","message.","channel.","webhook.","system.","auth.login","auth.logout"],m=o.data.filter(p=>f.some(x=>p.event.startsWith(x))).reverse();r(m)}}).catch(()=>{})},[]),h.useEffect(()=>{const o=window.location.protocol==="https:"?"wss:":"ws:",f=window.location.host,m=new WebSocket(`${o}//${f}/`);return u.current=m,m.onmessage=p=>{try{const x=JSON.parse(p.data);x.type==="activity"&&x.payload&&r(y=>{const g=[x.payload,...y];return g.length>Fh?g.slice(0,Fh):g})}catch{}},()=>{m.close()}},[]),n.jsxs("div",{className:"activity-feed",children:[n.jsx("h3",{className:"mc-section-title",children:"Live Activity"}),n.jsxs("div",{className:"activity-feed-list",children:[s.length===0&&n.jsx("div",{className:"activity-empty",children:"No recent activity"}),s.map((o,f)=>{const m=px(o.event),p=mx[m]??"var(--text-secondary)";return n.jsxs("div",{className:"activity-item",children:[n.jsx("span",{className:"activity-dot",style:{background:p}}),n.jsx("span",{className:"activity-label",children:gx(o.event,o.details)}),n.jsx("span",{className:"activity-time",children:vx(o.timestamp)})]},`${o.sequence}-${f}`)})]})]})}const xx={discord:"Discord",telegram:"Telegram",slack:"Slack",webchat:"Web"};function bx(s){const r=Date.now()-new Date(s).getTime(),u=Math.floor(r/1e3);return u<60?`${u}s`:`${Math.floor(u/60)}m ${u%60}s`}function jx(){const[s,r]=h.useState([]),u=h.useRef(null),o=h.useRef(null),[,f]=h.useState(0);return h.useEffect(()=>{I.getActiveAgents().then(m=>{m.data&&r(m.data)}).catch(()=>{})},[]),h.useEffect(()=>{const m=window.location.protocol==="https:"?"wss:":"ws:",p=window.location.host,x=new WebSocket(`${m}//${p}/`);return u.current=x,x.onmessage=y=>{try{const g=JSON.parse(y.data);g.type==="agent_start"&&g.payload?r(b=>[...b,g.payload]):g.type==="agent_end"&&g.payload&&r(b=>b.filter(j=>j.id!==g.payload.id))}catch{}},()=>{x.close()}},[]),h.useEffect(()=>(o.current=setInterval(()=>f(m=>m+1),1e3),()=>{o.current&&clearInterval(o.current)}),[]),n.jsxs("div",{className:"agent-activity",children:[n.jsx("h3",{className:"mc-section-title",children:"Active Now"}),s.length===0?n.jsx("div",{className:"agent-activity-quiet",children:"All quiet"}):n.jsx("div",{className:"agent-activity-list",children:s.map(m=>n.jsxs("div",{className:"agent-activity-card",children:[n.jsx("span",{className:"agent-pulse"}),n.jsxs("div",{className:"agent-activity-info",children:[n.jsx("span",{className:"agent-activity-desc",children:m.description}),n.jsxs("span",{className:"agent-activity-meta",children:[m.channelType&&n.jsx("span",{className:"agent-channel-badge",children:xx[m.channelType]??m.channelType}),n.jsx("span",{className:"agent-activity-type",children:m.type}),n.jsx("span",{className:"agent-activity-elapsed",children:bx(m.startedAt)})]})]})]},m.id))})]})}function Sx(s){const r=(Date.now()-new Date(s).getTime())/1e3;return r<60?"just now":r<3600?`${Math.floor(r/60)}m ago`:r<86400?`${Math.floor(r/3600)}h ago`:`${Math.floor(r/86400)}d ago`}function Ph(s){return s.status==="paused"&&s.failCount>=s.maxFailures?"var(--danger)":s.status==="paused"?"var(--text-secondary)":s.failCount>0?"var(--warning)":"var(--success)"}function Nx(s){return s.status==="paused"&&s.failCount>=s.maxFailures?"Auto-paused":s.status==="paused"?"Paused":s.failCount>0?`${s.failCount} failures`:"Healthy"}const Cx={scheduled:"Sched",monitor:"Monitor","one-shot":"Once"};function Ex(){const[s,r]=h.useState([]),u=h.useRef(null);return h.useEffect(()=>{I.getBehaviors().then(o=>{o.data&&r(o.data.filter(f=>f.status!=="deleted"))}).catch(()=>{})},[]),h.useEffect(()=>{const o=window.location.protocol==="https:"?"wss:":"ws:",f=window.location.host,m=new WebSocket(`${o}//${f}/`);return u.current=m,m.onmessage=p=>{var x,y;try{const g=JSON.parse(p.data);g.type==="activity"&&((y=(x=g.payload)==null?void 0:x.event)!=null&&y.startsWith("behavior."))&&I.getBehaviors().then(b=>{b.data&&r(b.data.filter(j=>j.status!=="deleted"))}).catch(()=>{})}catch{}},()=>{m.close()}},[]),n.jsxs("div",{className:"behavior-health",children:[n.jsx("h3",{className:"mc-section-title",children:"Behavior Health"}),s.length===0&&n.jsx("div",{className:"bh-empty",children:"No behaviors configured"}),n.jsx("div",{className:"bh-list",children:s.map(o=>n.jsxs("div",{className:"bh-card",children:[n.jsxs("div",{className:"bh-card-header",children:[n.jsx("span",{className:"bh-dot",style:{background:Ph(o)}}),n.jsx("span",{className:"bh-action",children:o.action.length>60?o.action.slice(0,57)+"...":o.action}),n.jsx("span",{className:"bh-type-badge",children:Cx[o.type]??o.type})]}),n.jsxs("div",{className:"bh-card-meta",children:[n.jsx("span",{className:"bh-health-label",style:{color:Ph(o)},children:Nx(o)}),n.jsxs("span",{className:"bh-stat",children:[o.runCount," runs"]}),o.lastRun&&n.jsx("span",{className:"bh-stat",children:Sx(o.lastRun)})]}),o.lastResult&&n.jsx("div",{className:"bh-result",children:o.lastResult.length>120?o.lastResult.slice(0,117)+"...":o.lastResult})]},o.id))})]})}function Dm(){var y,g,b,j,S,T,A,D,O;const{data:s,refresh:r}=ut(()=>I.getStatus(),[]),{data:u,refresh:o}=ut(()=>I.getModels(),[]),{data:f,refresh:m}=ut(()=>I.getHealthState(),[]);Os(()=>{r(),o(),m()});const p=s==null?void 0:s.data,x=((g=(y=u==null?void 0:u.providers)==null?void 0:y.find(E=>E.available))==null?void 0:g.displayName)??"None";return n.jsxs("div",{className:"page",children:[n.jsx("h2",{children:"Mission Control"}),n.jsxs("div",{className:"status-grid",children:[n.jsxs("div",{className:"status-card",children:[n.jsx("h3",{children:"Connections"}),n.jsx("div",{className:"value",children:(p==null?void 0:p.connections)??0}),n.jsx("div",{className:"sub",children:"Active sessions"})]}),n.jsxs("div",{className:"status-card",children:[n.jsx("h3",{children:"Provider"}),n.jsx("div",{className:"value",children:x}),n.jsx("div",{className:"sub",children:((b=p==null?void 0:p.activeModel)==null?void 0:b.model)??"unknown"})]}),n.jsxs("div",{className:"status-card",children:[n.jsx("h3",{children:"Uptime"}),n.jsx("div",{className:"value",children:p?wx(p.uptime):"-"}),n.jsx("div",{className:"sub",children:"Since last restart"})]}),n.jsxs("div",{className:"status-card",children:[n.jsx("h3",{children:"Health"}),n.jsxs("div",{className:"value",children:[n.jsx("span",{className:`health-dot health-${((j=f==null?void 0:f.data)==null?void 0:j.overall)??"unknown"}`}),Tx(((S=f==null?void 0:f.data)==null?void 0:S.overall)??"unknown")]}),n.jsxs("div",{className:"sub",children:[((A=(T=f==null?void 0:f.data)==null?void 0:T.issues)==null?void 0:A.length)??0," issues"]})]})]}),((O=(D=f==null?void 0:f.data)==null?void 0:D.issues)==null?void 0:O.length)>0&&n.jsx("div",{className:"health-alerts",children:f.data.issues.map(E=>n.jsxs("div",{className:`health-alert health-alert-${E.severity}`,children:[n.jsx("span",{className:"health-alert-text",children:E.description}),E.suggestedFix&&n.jsx("span",{className:"health-alert-fix",children:E.suggestedFix})]},E.id))}),n.jsxs("div",{className:"mc-columns",children:[n.jsxs("div",{className:"mc-left",children:[n.jsx(jx,{}),n.jsx(Ex,{})]}),n.jsx("div",{className:"mc-right",children:n.jsx(yx,{})})]})]})}function wx(s){const r=Math.floor(s/3600),u=Math.floor(s%3600/60);return r>0?`${r}h ${u}m`:`${u}m`}function Tx(s){return s.charAt(0).toUpperCase()+s.slice(1)}const _t={security_review:{icon:"🛡️",label:"Security Review",description:"Adversarial analysis, threat modeling, vulnerability assessment",colorClass:"context-red"},crisis_management:{icon:"🚨",label:"Crisis",description:"Incidents, breaches, outages, urgent response",colorClass:"context-red"},code_engineering:{icon:"💻",label:"Engineering",description:"Writing, reviewing, and optimizing code",colorClass:"context-blue"},architecture_design:{icon:"🏗️",label:"Architecture",description:"System design, patterns, trade-off analysis",colorClass:"context-blue"},debugging:{icon:"🐛",label:"Debugging",description:"Finding and fixing bugs, tracing errors",colorClass:"context-blue"},team_leadership:{icon:"👥",label:"Team Leadership",description:"Managing teams, culture, performance, hiring",colorClass:"context-green"},one_on_one:{icon:"🤝",label:"One-on-One",description:"Coaching, feedback, career development conversations",colorClass:"context-green"},sales_pitch:{icon:"📈",label:"Sales",description:"Pitching, proposals, value positioning, closing",colorClass:"context-purple"},negotiation:{icon:"⚖️",label:"Negotiation",description:"Contract terms, compensation, vendor discussions",colorClass:"context-purple"},marketing_content:{icon:"📣",label:"Marketing",description:"Positioning, messaging, audience building, campaigns",colorClass:"context-purple"},strategic_planning:{icon:"🎯",label:"Strategy",description:"Roadmaps, priorities, resource allocation, OKRs",colorClass:"context-orange"},decision_making:{icon:"⚖️",label:"Decision",description:"Weighing options, trade-offs, choosing between paths",colorClass:"context-orange"},creative_work:{icon:"💡",label:"Creative",description:"Brainstorming, ideation, creative problem solving",colorClass:"context-teal"},writing_content:{icon:"✍️",label:"Writing",description:"Blog posts, articles, documentation, drafting",colorClass:"context-teal"},learning_research:{icon:"📚",label:"Learning",description:"Understanding concepts, deep dives, research",colorClass:"context-gray"},personal_development:{icon:"🌱",label:"Growth",description:"Career planning, skills, growth, interviews",colorClass:"context-gray"},general:{icon:"💬",label:"General",description:"General conversation and assistance",colorClass:"context-gray"}},Nn=Object.keys(_t),zm={stressed:"· Under Pressure",frustrated:"· Working Through It",uncertain:"· Exploring",excited:"· Energized",celebratory:"· Celebrating"};function Ax({context:s,onOverride:r,showOverrideMenu:u,onToggleOverrideMenu:o}){const f=_t[s.domain],m=zm[s.emotionalRegister];return n.jsxs("div",{className:"context-indicator-wrapper",children:[n.jsxs("button",{type:"button",className:`context-indicator ${f.colorClass}`,onClick:o,"aria-label":`Context: ${f.label}`,"aria-expanded":u,"aria-haspopup":"menu",children:[n.jsx("span",{className:"context-indicator-icon","aria-hidden":"true",children:f.icon}),n.jsx("span",{className:"context-indicator-label",children:f.label}),m&&n.jsx("span",{className:"context-indicator-emotion",children:m})]}),u&&n.jsx("ul",{className:"context-override-menu",role:"menu",children:Nn.map(p=>{const x=_t[p];return n.jsx("li",{role:"none",children:n.jsxs("button",{type:"button",role:"menuitem",className:`context-override-item ${p===s.domain?"active":""}`,onClick:()=>r(p),children:[n.jsx("span",{"aria-hidden":"true",children:x.icon})," ",x.label]})},p)})})]})}function Ox(s){return s.replace(/([A-Z])/g," $1").replace(/^./,r=>r.toUpperCase()).trim()}const Mx=10,Rx=29;function Dx({sources:s,context:r,isOpen:u,onClose:o,weights:f}){const[m,p]=h.useState(new Set),[x,y]=h.useState(!1);if(!u)return null;const g=_t[r.domain],b=zm[r.emotionalRegister],j=x?s:s.slice(0,Mx);function S(A){p(D=>{const O=new Set(D);return O.has(A)?O.delete(A):O.add(A),O})}function T(A){return f==null?void 0:f[A]}return n.jsxs("div",{className:"sources-panel",role:"dialog","aria-label":"What shaped this response",children:[n.jsxs("div",{className:"sources-panel-header",children:[n.jsxs("span",{className:"sources-panel-title",children:["🧠"," What shaped this response"]}),n.jsx("button",{type:"button",className:"sources-panel-close",onClick:o,"aria-label":"Close sources panel",children:"✕"})]}),n.jsxs("div",{className:"sources-panel-context",children:[n.jsx("span",{"aria-hidden":"true",children:g.icon})," ",g.label,b&&n.jsx("span",{className:"sources-panel-emotion",children:b})]}),n.jsx("ul",{className:"sources-trait-list",children:j.map(A=>{const D=m.has(A.traitKey),O=T(A.traitKey);return n.jsxs("li",{className:"sources-trait-item",children:[n.jsxs("button",{type:"button",className:"sources-trait-header",onClick:()=>S(A.traitKey),"aria-expanded":D,children:[n.jsx("span",{className:"sources-trait-arrow",children:D?"▾":"▸"}),n.jsx("span",{className:"sources-trait-name",children:Ox(A.traitKey)}),O!=null&&n.jsxs("span",{className:"sources-trait-weight",children:[n.jsx("span",{className:"sources-trait-weight-bar",style:{width:`${Math.round(O*100)}%`},"aria-label":`Weight: ${Math.round(O*100)}%`}),n.jsxs("span",{className:"sources-trait-weight-value",children:[Math.round(O*100),"%"]})]})]}),n.jsx("div",{className:"sources-trait-source",children:n.jsx("strong",{children:A.sourceName})}),D&&n.jsxs("div",{className:"sources-trait-details",children:[n.jsx("div",{className:"sources-trait-work",children:A.sourceWork}),n.jsx("blockquote",{className:"sources-trait-instruction",children:A.behavioralInstruction}),n.jsxs("div",{className:"sources-trait-evidence",children:["Evidence: ",A.evidenceSummary]})]})]},A.traitKey)})}),n.jsxs("div",{className:"sources-panel-footer",children:[n.jsxs("span",{className:"sources-panel-count",children:["Showing top ",j.length," of ",Rx," active traits"]}),n.jsx("button",{type:"button",className:"sources-panel-toggle",onClick:()=>y(A=>!A),children:x?"Show fewer":"Show all"})]})]})}function zx({sources:s,context:r,weights:u}){const[o,f]=h.useState(!1),m=h.useRef(null);return h.useEffect(()=>{if(!o)return;const p=x=>{m.current&&!m.current.contains(x.target)&&f(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[o]),s.length===0?null:n.jsxs("div",{className:"sources-button-container",ref:m,children:[n.jsxs("button",{type:"button",className:"sources-button",onClick:()=>f(p=>!p),"aria-label":"View sources",children:[n.jsx("span",{"aria-hidden":"true",children:"🧠"})," ",n.jsx("span",{className:"sources-button-label",children:"Sources"})]}),n.jsx(Dx,{sources:s,context:r,isOpen:o,onClose:()=>f(!1),weights:u})]})}function kx({currentDomain:s,onSelect:r,onClose:u,isOpen:o}){const[f,m]=h.useState(null),[p,x]=h.useState(-1),y=h.useRef(null),g=h.useRef([]);h.useEffect(()=>{o&&(m(null),x(-1))},[o]),h.useEffect(()=>{if(!o)return;function A(D){y.current&&!y.current.contains(D.target)&&u()}return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[o,u]);const b=h.useCallback(A=>{var D,O;if(f){A.key==="Escape"&&(m(null),A.preventDefault());return}switch(A.key){case"Escape":u(),A.preventDefault();break;case"ArrowDown":{const E=p<Nn.length-1?p+1:0;x(E),(D=g.current[E])==null||D.focus(),A.preventDefault();break}case"ArrowUp":{const E=p>0?p-1:Nn.length-1;x(E),(O=g.current[E])==null||O.focus(),A.preventDefault();break}case"Enter":p>=0&&(j(Nn[p]),A.preventDefault());break}},[p,u,f]);function j(A){m(A)}function S(A){f&&(r(f,A),m(null))}if(!o)return null;const T=_t[s];return n.jsxs("div",{ref:y,className:"context-override-popover",role:"dialog","aria-label":"Override context",onKeyDown:b,children:[n.jsx("div",{className:"context-override-header",children:n.jsxs("span",{className:"context-override-detected",children:["Detected: ",n.jsx("span",{"aria-hidden":"true",children:T.icon})," ",T.label]})}),f?n.jsxs("div",{className:"context-override-scope",role:"group","aria-label":"Apply scope",children:[n.jsxs("div",{className:"context-override-scope-label",children:["Apply ",n.jsx("strong",{children:_t[f].label})," to:"]}),n.jsxs("button",{type:"button",className:"context-override-scope-btn",onClick:()=>S("message"),children:["This message",n.jsx("span",{className:"context-override-scope-hint",children:"Auto-detection resumes after"})]}),n.jsxs("button",{type:"button",className:"context-override-scope-btn",onClick:()=>S("conversation"),children:["This conversation",n.jsx("span",{className:"context-override-scope-hint",children:"Stays until you change it"})]}),n.jsx("button",{type:"button",className:"context-override-scope-back",onClick:()=>m(null),children:"Back"})]}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"context-override-subheader",children:"Switch context:"}),n.jsx("ul",{className:"context-override-list",role:"listbox","aria-label":"Available contexts",children:Nn.map((A,D)=>{const O=_t[A],E=A===s;return n.jsx("li",{role:"none",children:n.jsxs("button",{ref:R=>{g.current[D]=R},type:"button",role:"option","aria-selected":E,className:`context-override-domain-item ${E?"detected":""}`,onClick:()=>j(A),tabIndex:p===D?0:-1,children:[n.jsx("span",{className:"context-override-domain-icon","aria-hidden":"true",children:O.icon}),n.jsxs("span",{className:"context-override-domain-text",children:[n.jsxs("span",{className:"context-override-domain-label",children:[O.label,E&&n.jsx("span",{className:"context-override-detected-badge",children:"detected"})]}),n.jsx("span",{className:"context-override-domain-desc",children:O.description})]})]})},A)})})]})]})}function _x({recommendation:s,onAccept:r,onDismiss:u,autoDismissMs:o=1e4}){const[f,m]=h.useState(!0),p=h.useRef(null),x=h.useRef(!1);if(h.useEffect(()=>{if(!(o<=0))return p.current=setTimeout(()=>{x.current||(m(!1),u())},o),()=>{p.current&&clearTimeout(p.current)}},[o,u]),!f)return null;const y=_t[s.suggestedDomain],g=()=>{x.current=!0,p.current&&clearTimeout(p.current),m(!1),r(s.suggestedDomain)},b=()=>{x.current=!0,p.current&&clearTimeout(p.current),m(!1),u()};return n.jsxs("div",{className:"context-recommendation",role:"status","aria-live":"polite",children:[n.jsx("span",{className:"context-recommendation-icon","aria-hidden":"true",children:y.icon}),n.jsxs("span",{className:"context-recommendation-text",children:[n.jsx("strong",{children:"Suggestion:"})," Switch to ",y.label,"?"," ",n.jsx("span",{className:"context-recommendation-reason",children:s.reason})]}),n.jsx("button",{type:"button",className:"context-recommendation-accept",onClick:g,children:"Switch"}),n.jsx("button",{type:"button",className:"context-recommendation-dismiss",onClick:b,"aria-label":"Dismiss suggestion",children:"✕"})]})}const Ux={tool_result:"🔧",memory_recall:"🧠",knowledge_graph:"🌐",user_data:"👤",model_generation:"🤖"};function Lx({meta:s}){const[r,u]=h.useState(!1);if(!s)return null;const o=s.model.tokens.input+s.model.tokens.output,f=s.confidence.level==="high"?"🟢":s.confidence.level==="medium"?"🟡":"🔴",m=s.personality.knowledgeBoundary;return n.jsxs("div",{className:`transparency-footer confidence-${s.confidence.level}`,children:[n.jsxs("button",{className:"transparency-toggle",onClick:()=>u(!r),"aria-expanded":r,children:[n.jsxs("span",{className:"transparency-summary",children:[f," ",n.jsx("span",{children:s.confidence.level.charAt(0).toUpperCase()+s.confidence.level.slice(1)})," ","(",s.confidence.score,")",m&&n.jsxs("span",{className:"kb-warning",children:[" ","⚠"," Topic previously corrected (",m.corrections,"x)"]})," · ",s.model.model," · ",o," tokens"," · ","$",s.model.cost.total.toFixed(3),s.personality.domain!=="general"&&n.jsxs(n.Fragment,{children:[" · ",s.personality.domain.replace(/_/g," ")]})]}),n.jsx("span",{className:"tf-expand-icon",children:r?"▲":"▼"})]}),r&&n.jsxs("div",{className:"transparency-details",children:[n.jsxs("div",{className:"tf-section",children:[n.jsx("strong",{className:"tf-section-title",children:"Confidence"}),n.jsxs("div",{children:["Score: ",s.confidence.score," (",s.confidence.level.charAt(0).toUpperCase()+s.confidence.level.slice(1),")"]}),s.confidence.factors.map((p,x)=>n.jsxs("div",{className:p.impact==="positive"?"tf-factor-positive":"tf-factor-negative",children:[p.impact==="positive"?" + ":" - ",p.signal,": ",p.detail]},x))]}),n.jsxs("div",{className:"tf-section",children:[n.jsx("strong",{className:"tf-section-title",children:"Sources"}),s.sources.map((p,x)=>n.jsxs("div",{className:"tf-source-line",children:[Ux[p.type]??"❓"," ",p.label," (",p.confidence.toFixed(2),")"]},x))]}),n.jsxs("div",{className:"tf-section tf-section-last",children:[n.jsx("strong",{className:"tf-section-title",children:"Processing"}),n.jsxs("div",{children:["Model: ",s.model.provider," / ",s.model.model]}),n.jsxs("div",{children:["Tokens: ",s.model.tokens.input," in / ",s.model.tokens.output," out"]}),n.jsxs("div",{children:["Cost: $",s.model.cost.input.toFixed(4)," in / $",s.model.cost.output.toFixed(4)," out = $",s.model.cost.total.toFixed(4)," total"]}),n.jsxs("div",{children:["Latency: ",s.model.latencyMs.toLocaleString(),"ms"]}),n.jsxs("div",{children:["Finish: ",s.model.finishReason]}),s.trace.enrichmentStages.length>0&&n.jsxs("div",{children:["Stages: ",s.trace.enrichmentStages.join(" → ")]}),s.trace.toolsUsed.length>0&&n.jsxs("div",{children:["Tools: ",s.trace.toolsUsed.join(", ")]}),n.jsxs("div",{children:["Domain: ",s.personality.domain]}),n.jsxs("div",{children:["Register: ",s.personality.emotionalRegister]}),s.personality.activeTraits.length>0&&n.jsxs("div",{children:["Traits: ",s.personality.activeTraits.map(p=>`${p.name} (${p.weight.toFixed(2)})`).join(", ")]})]})]})]})}const Bx={tool_result:"🔧",memory_recall:"🧠",knowledge_graph:"🌐",user_data:"👤",model_generation:"🤖"};function Hx(s){return s==="high"?"pp-confidence-badge pp-badge-green":s==="medium"?"pp-confidence-badge pp-badge-amber":"pp-confidence-badge pp-badge-red"}function qx({meta:s,onClose:r}){const u=s.personality.knowledgeBoundary;return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"pp-overlay",onClick:r}),n.jsxs("div",{className:"pp-panel",children:[n.jsxs("div",{className:"pp-header",children:[n.jsx("span",{className:"pp-header-title",children:"Why did I say that?"}),n.jsx("button",{className:"pp-close-btn",onClick:r,"aria-label":"close",children:"X"})]}),n.jsxs("div",{className:"pp-body",children:[n.jsxs("div",{className:"pp-section",children:[n.jsx("div",{className:"pp-section-title",children:"Confidence Breakdown"}),n.jsxs("div",{className:"pp-confidence-row",children:[n.jsx("span",{className:Hx(s.confidence.level),children:s.confidence.score}),n.jsx("span",{className:"pp-confidence-level",children:s.confidence.level.charAt(0).toUpperCase()+s.confidence.level.slice(1)})]}),s.confidence.factors.map((o,f)=>n.jsxs("div",{className:"pp-factor",children:[n.jsx("span",{className:"pp-factor-icon",children:o.impact==="positive"?"+":"-"}),n.jsx("span",{className:"pp-factor-signal",children:o.signal}),n.jsx("span",{className:"pp-factor-detail",children:o.detail})]},f))]}),n.jsxs("div",{className:"pp-section",children:[n.jsx("div",{className:"pp-section-title",children:"Source Attribution"}),s.sources.map((o,f)=>n.jsxs("div",{className:"pp-source-row",children:[n.jsx("span",{className:"pp-source-icon",children:Bx[o.type]??"❓"}),n.jsx("span",{className:"pp-source-label",children:o.label}),n.jsx("div",{className:"pp-source-bar-track",children:n.jsx("div",{className:"pp-source-bar",style:{width:`${Math.round(o.confidence*100)}%`}})}),n.jsx("span",{className:"pp-source-conf",children:o.confidence.toFixed(2)})]},f))]}),n.jsxs("div",{className:"pp-section",children:[n.jsx("div",{className:"pp-section-title",children:"Personality Influence"}),n.jsxs("div",{className:"pp-detail-row",children:[n.jsx("span",{className:"pp-detail-label",children:"Domain"}),n.jsx("span",{className:"pp-detail-value",children:s.personality.domain.replace(/_/g," ")})]}),n.jsxs("div",{className:"pp-detail-row",children:[n.jsx("span",{className:"pp-detail-label",children:"Register"}),n.jsx("span",{className:"pp-detail-value",children:s.personality.emotionalRegister})]}),s.personality.activeTraits.map((o,f)=>n.jsxs("div",{className:"pp-trait-row",children:[n.jsx("span",{className:"pp-trait-name",children:o.name}),n.jsx("div",{className:"pp-trait-bar-track",children:n.jsx("div",{className:"pp-trait-bar",style:{width:`${Math.round(o.weight*100)}%`}})}),n.jsx("span",{className:"pp-trait-weight",children:o.weight.toFixed(2)})]},f)),u&&n.jsxs("div",{className:"pp-kb-warning",children:["⚠"," Knowledge boundary: ",u.topic," (corrected ",u.corrections,"x)"]})]}),n.jsxs("div",{className:"pp-section",children:[n.jsx("div",{className:"pp-section-title",children:"Processing Pipeline"}),n.jsx("div",{className:"pp-pipeline",children:s.trace.enrichmentStages.map((o,f)=>n.jsxs("span",{className:"pp-pipeline-node",children:[f>0&&n.jsx("span",{className:"pp-pipeline-arrow",children:"→"}),n.jsx("span",{className:"pp-pipeline-stage",children:o})]},f))}),s.trace.toolsUsed.length>0&&n.jsxs("div",{className:"pp-detail-row",children:[n.jsx("span",{className:"pp-detail-label",children:"Tools"}),n.jsx("span",{className:"pp-detail-value",children:s.trace.toolsUsed.join(", ")})]}),n.jsxs("div",{className:"pp-detail-row",children:[n.jsx("span",{className:"pp-detail-label",children:"Model"}),n.jsxs("span",{className:"pp-detail-value",children:[s.model.provider," / ",s.model.model]})]}),n.jsxs("div",{className:"pp-detail-row",children:[n.jsx("span",{className:"pp-detail-label",children:"Latency"}),n.jsxs("span",{className:"pp-detail-value",children:[s.model.latencyMs.toLocaleString(),"ms"]})]}),n.jsxs("div",{className:"pp-detail-row",children:[n.jsx("span",{className:"pp-detail-label",children:"Tokens"}),n.jsxs("span",{className:"pp-detail-value",children:[s.model.tokens.input," in / ",s.model.tokens.output," out"]})]})]})]}),n.jsxs("div",{className:"pp-footer",children:["Total processing: ",s.trace.processingMs,"ms"]})]})]})}function Yx({tokens:s,cost:r,latencyMs:u}){const o=s.input+s.output;return o===0?null:n.jsxs("div",{className:"token-cost-badge",children:[n.jsxs("span",{className:"badge-item badge-tokens",title:`${s.input.toLocaleString()} in / ${s.output.toLocaleString()} out`,children:[o.toLocaleString()," tok"]}),n.jsxs("span",{className:"badge-item badge-cost",title:`$${r.input.toFixed(4)} in / $${r.output.toFixed(4)} out`,children:["$",r.total.toFixed(3)]}),n.jsxs("span",{className:"badge-item badge-latency",children:[u.toLocaleString(),"ms"]})]})}const Gx=[{command:"/help",description:"Show available commands"},{command:"/status",description:"Show system status"},{command:"/new",description:"Start a new session"},{command:"/reset",description:"Clear current session"},{command:"/mode",description:"Show current mode"},{command:"/mode auto",description:"Auto-detect mode from messages"},{command:"/mode off",description:"Disable modes for this session"},{command:"/mode operator",description:"Fast, action-oriented execution"},{command:"/mode analyst",description:"Deep reasoning and analysis"},{command:"/mode advisor",description:"Strategic guidance and decisions"},{command:"/mode writer",description:"Creative and polished writing"},{command:"/mode socratic",description:"Question-based learning"},{command:"/mode legal",description:"Legal research and analysis"},{command:"/mode roast",description:"Playful, witty critique"},{command:"/mode companion",description:"Warm, supportive conversation"}];function Xx(s){return s.startsWith("claude-opus-4-6")?"Claude Opus 4.6":s.startsWith("claude-sonnet-4-5")?"Claude Sonnet 4.5":s.startsWith("claude-haiku-4-5")?"Claude Haiku 4.5":s.startsWith("claude-opus-4")?"Claude Opus 4":s.startsWith("claude-sonnet-4")?"Claude Sonnet 4":s.startsWith("claude-3-5-haiku")?"Claude Haiku 3.5":s.startsWith("claude-3-5-sonnet")?"Claude Sonnet 3.5":s.startsWith("claude-3-opus")?"Claude Opus 3":s==="gpt-4o"?"GPT-4o":s==="gpt-4o-mini"?"GPT-4o Mini":s==="gpt-4-turbo"?"GPT-4 Turbo":s.startsWith("o1")||s.startsWith("o3")?s.toUpperCase():s.startsWith("gemini-")?s.replace("gemini-","Gemini "):s}function Vx(s){const r=Date.now()-s,u=Math.floor(r/6e4);if(u<1)return"Just now";if(u<60)return`${u}m ago`;const o=Math.floor(u/60);if(o<24)return`${o}h ago`;const f=Math.floor(o/24);return f<7?`${f}d ago`:new Date(s).toLocaleDateString()}function $x(s){let r=s.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");return r=r.replace(/```(\w*)\n([\s\S]*?)```/g,(u,o,f)=>`<div class="code-block">${o?`<div class="code-header"><span class="code-lang">${o}</span><button class="code-copy" onclick="navigator.clipboard.writeText(this.closest('.code-block').querySelector('code').textContent)">Copy</button></div>`:`<div class="code-header"><button class="code-copy" onclick="navigator.clipboard.writeText(this.closest('.code-block').querySelector('code').textContent)">Copy</button></div>`}<pre><code>${f}</code></pre></div>`).replace(/`([^`]+)`/g,"<code>$1</code>").replace(/^### (.+)$/gm,"<h4>$1</h4>").replace(/^## (.+)$/gm,"<h3>$1</h3>").replace(/^# (.+)$/gm,"<h2>$1</h2>").replace(/\*\*\*(.+?)\*\*\*/g,"<strong><em>$1</em></strong>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/^---$/gm,"<hr/>").replace(/^[-*] (.+)$/gm,"<li>$1</li>"),r=r.replace(/((?:<li>.*<\/li>\n?)+)/g,"<ul>$1</ul>"),r=r.replace(/\n\n+/g,"</p><p>"),r=r.replace(/\n/g,"<br/>"),r=`<p>${r}</p>`,r=r.replace(/<p><\/p>/g,"").replace(/<p>(<h[234]>)/g,"$1").replace(/(<\/h[234]>)<\/p>/g,"$1").replace(/<p>(<pre>)/g,"$1").replace(/(<\/pre>)<\/p>/g,"$1").replace(/<p>(<div class="code-block">)/g,"$1").replace(/(<\/div>)<\/p>/g,"$1").replace(/<p>(<ul>)/g,"$1").replace(/(<\/ul>)<\/p>/g,"$1").replace(/<p>(<hr\/>)/g,"$1").replace(/(<hr\/>)<\/p>/g,"$1"),r}function km(){var pl,gl,vl,ua,yl;const[s,r]=h.useState([]),[u,o]=h.useState(""),[f,m]=h.useState(!1),[p,x]=h.useState(!1),[y,g]=h.useState(""),[b,j]=h.useState(null),[S,T]=h.useState(""),[A,D]=h.useState("auto"),[O,E]=h.useState(0),[R,_]=h.useState(!1),[K,Q]=h.useState(!1),[Z,F]=h.useState([]),[Y,te]=h.useState(null),[ce,ie]=h.useState(!0),[he,ee]=h.useState(null),[oe,ve]=h.useState(null),[H,J]=h.useState(""),[ne,P]=h.useState(null),de=h.useRef(null);h.useEffect(()=>{if(!ne||!de.current)return;const M=de.current,ae=M.getBoundingClientRect();let{x:me,y:De}=ne,Be=!1;ae.bottom>window.innerHeight&&(De=Math.max(4,ne.y-ae.height),Be=!0),ae.right>window.innerWidth&&(me=Math.max(4,ne.x-ae.width),Be=!0),Be&&(M.style.top=`${De}px`,M.style.left=`${me}px`)},[ne]);const[C,L]=h.useState(void 0),[le,re]=h.useState("standard"),[xe,be]=h.useState(null),[Ce,Pe]=h.useState(null),W=h.useRef(null),X=h.useRef(null),ge=h.useRef(null),qe=h.useRef(!0),Xe=h.useRef(""),lt=h.useRef(0),Et=h.useRef(0),pa=h.useRef(null),qa=h.useRef(null),xt=h.useRef(null);ut(()=>I.getStatus(),[]);const{data:_e}=ut(()=>I.getModels(),[]),{data:hl}=ut(()=>I.getIdentity(),[]),{data:ml}=ut(()=>I.getPersonality(),[]);h.useEffect(()=>{xt.current=Y},[Y]),h.useEffect(()=>{I.getPersonalityEngine().then(M=>{var ae;(ae=M.data)!=null&&ae.engine&&re(M.data.engine)}).catch(()=>{})},[]),h.useEffect(()=>{I.getChats().then(async M=>{if(M.data&&M.data.length>0)F(M.data.map(ae=>{var me;return{id:ae.id,title:ae.title,updatedAt:ae.updatedAt,personality:(me=ae.metadata)==null?void 0:me.personality}})),te(M.data[0].id);else{const me=(await I.createNewChat()).data;F([{id:me.id,title:me.title,updatedAt:me.updatedAt}]),te(me.id),Q(!0)}}).catch(()=>{})},[]),h.useEffect(()=>{if(!Y){L(void 0);return}const M=Z.find(ae=>ae.id===Y);L(M==null?void 0:M.personality)},[Y,Z]),h.useEffect(()=>{if(p&&(Et.current=0,x(!1),Xe.current=""),!Y){r([]),Q(!0);return}Q(!1),I.getChatMessages(Y).then(M=>{M.data?r(M.data.map(ae=>({id:ae.id,role:ae.role,content:ae.content}))):r([]),Q(!0),requestAnimationFrame(()=>{var ae;(ae=X.current)==null||ae.scrollIntoView()})}).catch(()=>{r([]),Q(!0)})},[Y]),h.useEffect(()=>{if(s.length===0)return;const M=s[s.length-1];if(M.role!=="assistant")return;const ae=M.content.match(/Switched to \*\*(\w+)\*\* mode/);if(ae){D(ae[1].toLowerCase());return}if(M.content.includes("Mode set to **auto**")){D("auto");return}M.content.includes("Modes disabled")&&D("off")},[s]);const $t=h.useMemo(()=>{if(!u.startsWith("/"))return[];const M=u.toLowerCase();return Gx.filter(ae=>ae.command.startsWith(M))},[u]);h.useEffect(()=>{_($t.length>0&&u.startsWith("/")),E(0)},[$t,u]),h.useEffect(()=>{if(!R||!qa.current)return;const M=qa.current.children[O];M==null||M.scrollIntoView({block:"nearest"})},[O,R]);const Ms=h.useCallback(()=>{var M;qe.current&&((M=X.current)==null||M.scrollIntoView({behavior:"auto"}))},[]);h.useEffect(()=>{const M=ge.current;if(!M)return;const ae=De=>{De.deltaY<0&&(qe.current=!1)},me=()=>{const{scrollTop:De,scrollHeight:Be,clientHeight:wt}=M;Be-De-wt<40&&(qe.current=!0)};return M.addEventListener("wheel",ae,{passive:!0}),M.addEventListener("scroll",me,{passive:!0}),()=>{M.removeEventListener("wheel",ae),M.removeEventListener("scroll",me)}},[]),h.useEffect(()=>{Ms()},[s,Ms]),h.useEffect(()=>{if(!ne)return;const M=()=>P(null);return document.addEventListener("click",M),()=>document.removeEventListener("click",M)},[ne]),h.useEffect(()=>{const M=window.location.protocol==="https:"?"wss:":"ws:",ae=window.location.host,me=new WebSocket(`${M}//${ae}/`);return W.current=me,me.onopen=()=>m(!0),me.onclose=()=>{m(!1),x(!1)},me.onmessage=De=>{var Be,wt,On,Mn,Rn,Bl,Hl,Dn,zn,la,nt;try{const we=JSON.parse(De.data);switch(we.type){case"connected":case"auth_success":break;case"chunk":if(g(""),lt.current!==Et.current||we.id!=null&&String(we.id)!==String(Et.current))break;Xe.current+=((Be=we.payload)==null?void 0:Be.content)??"",r(ze=>{const Ee=ze[ze.length-1];return(Ee==null?void 0:Ee.role)==="assistant"&&Ee.id===`resp-${Et.current}`?[...ze.slice(0,-1),{...Ee,content:Xe.current}]:[...ze,{id:`resp-${Et.current}`,role:"assistant",content:Xe.current}]});break;case"message":((wt=we.payload)==null?void 0:wt.role)==="assistant"&&r(ze=>[...ze,{id:`msg-${Date.now()}`,role:"assistant",content:we.payload.content}]);break;case"tool_use":{const ze=((On=we.payload)==null?void 0:On.tool)??"tool",Ee=(Mn=we.payload)==null?void 0:Mn.params;let ga={web_browser:"Reading web page",browser_navigate:"Navigating browser",browser_click:"Clicking element",browser_type:"Typing text",browser_screenshot:"Taking screenshot",browser_extract:"Extracting data",browse:"Browsing",bash:"Running command",file_read:"Reading file",file_write:"Writing file",file_list:"Listing files"}[ze]||`Using ${ze}`;if(ze==="bash"&&(Ee!=null&&Ee.command)){const Tt=String(Ee.command);ga=`Running: ${Tt.length>60?Tt.slice(0,57)+"...":Tt}`}else if((ze==="web_browser"||ze==="browse")&&(Ee!=null&&Ee.url))try{ga=`Reading ${new URL(String(Ee.url)).hostname}`}catch{}else ze==="file_read"&&(Ee!=null&&Ee.path)&&(ga=`Reading ${String(Ee.path).split("/").pop()}`);g(ga);break}case"tool_result":g("");break;case"status":g(((Rn=we.payload)==null?void 0:Rn.message)??"Processing");break;case"done":{if(x(!1),g(""),Xe.current="",lt.current!==Et.current||we.id!=null&&String(we.id)!==String(Et.current))break;const ze=(Bl=we.payload)==null?void 0:Bl.routing,Ee=(Hl=we.payload)==null?void 0:Hl.architect,Qt={};if(ze){const Tt=ze.model?`${ze.provider}/${ze.model}`:ze.provider;T(Tt),Qt.model=Tt}Ee&&(Qt.detectedContext=Ee.detectedContext,Qt.activeTraits=Ee.activeTraits,Qt.traitWeights=Ee.traitWeights,Qt.recommendation=Ee.recommendation);const ga=(Dn=we.payload)==null?void 0:Dn.transparency;if(ga&&(Qt.transparency=ga),Object.keys(Qt).length>0){const Tt=we.id!=null?String(we.id):null;r(St=>{const ql=Tt?`resp-${Tt}`:null;let Ut=-1;for(let At=St.length-1;At>=0;At--)if(ql?St[At].id===ql:St[At].role==="assistant"){Ut=At;break}if(Ut===-1)return St;const va=St[Ut];if(va.role!=="assistant")return St;const Ga=St.slice(0,Ut).reverse().find(At=>At.role==="user");return Ga&&(Qt.userMessage=Ga.content),[...St.slice(0,Ut),{...va,...Qt},...St.slice(Ut+1)]})}break}case"chat_created":(zn=we.payload)!=null&&zn.chatId&&(te(we.payload.chatId),I.getChats().then(ze=>{ze.data&&F(ze.data.map(Ee=>({id:Ee.id,title:Ee.title,updatedAt:Ee.updatedAt})))}).catch(()=>{}));break;case"chat_titled":(la=we.payload)!=null&&la.chatId&&((nt=we.payload)!=null&&nt.title)&&F(ze=>ze.map(Ee=>Ee.id===we.payload.chatId?{...Ee,title:we.payload.title}:Ee));break;case"error":x(!1),g(""),Xe.current="",r(ze=>{var Ee;return[...ze,{id:`err-${Date.now()}`,role:"error",content:((Ee=we.payload)==null?void 0:Ee.message)??"Unknown error"}]});break}}catch{}},()=>{me.close()}},[]);const vt=[];if(_e!=null&&_e.providers)for(const M of _e.providers)M.available&&M.models&&vt.push({provider:M.name,displayName:M.displayName||M.name,models:Object.keys(M.models)});const tc=M=>{if(!M){j(null);return}const[ae,...me]=M.split("/");j({provider:ae,model:me.join("/")})},Tn=()=>{if(!u.trim()||!W.current||!f)return;const M=u.trim(),ae=++lt.current;Et.current=ae,r(De=>[...De,{id:`user-${ae}`,role:"user",content:M}]),o(""),x(!0),Xe.current="",qe.current=!0;const me={content:M};b&&(me.provider=b.provider,me.model=b.model),xt.current&&(me.chatId=xt.current),W.current.send(JSON.stringify({type:"message",id:String(ae),payload:me}))},An=h.useCallback((M,ae,me)=>{be(null),ae==="conversation"&&(Pe(M),W.current&&f&&W.current.send(JSON.stringify({type:"message",id:String(++lt.current),payload:{content:`/context-override ${M}`,chatId:xt.current}}))),r(De=>{const Be=De.find(wt=>wt.id===me);return Be!=null&&Be.detectedContext&&Be.userMessage&&Be.detectedContext.domain!==M&&W.current&&f&&W.current.send(JSON.stringify({type:"architect_correction",payload:{userMessage:Be.userMessage,detectedDomain:Be.detectedContext.domain,correctedDomain:M}})),De.map(wt=>wt.id===me&&wt.detectedContext?{...wt,detectedContext:{...wt.detectedContext,domain:M},recommendation:void 0}:wt)})},[f]),Ll=h.useCallback((M,ae)=>{r(me=>{const De=me.find(Be=>Be.id===M);return De!=null&&De.detectedContext&&De.userMessage&&De.detectedContext.domain!==ae&&W.current&&f&&W.current.send(JSON.stringify({type:"architect_correction",payload:{userMessage:De.userMessage,detectedDomain:De.detectedContext.domain,correctedDomain:ae}})),me.map(Be=>Be.id===M?{...Be,detectedContext:Be.detectedContext?{...Be.detectedContext,domain:ae}:Be.detectedContext,recommendation:void 0}:Be)})},[f]),ac=h.useCallback(M=>{r(ae=>ae.map(me=>me.id===M?{...me,recommendation:void 0}:me))},[]),Rs=h.useCallback(()=>{Pe(null),W.current&&f&&W.current.send(JSON.stringify({type:"message",id:String(++lt.current),payload:{content:"/context-override clear",chatId:xt.current}}))},[f]),lc=h.useCallback(async M=>{if(!Y)return;const ae=M||void 0;try{await I.updateChatPersonality(Y,M||"standard"),L(ae),F(me=>me.map(De=>De.id===Y?{...De,personality:ae}:De))}catch{}},[Y]),nc=async()=>{var M;try{const me=(await I.createNewChat()).data;F(De=>[{id:me.id,title:me.title,updatedAt:me.updatedAt},...De]),te(me.id),r([]),Pe(null),be(null),Q(!0),(M=pa.current)==null||M.focus()}catch{}},Ya=async M=>{if(!H.trim()){ve(null);return}try{await I.renameChat(M,H.trim()),F(ae=>ae.map(me=>me.id===M?{...me,title:H.trim()}:me))}catch{}ve(null)},bt=async M=>{try{await I.deleteChatThread(M),F(ae=>ae.filter(me=>me.id!==M)),Y===M&&(te(null),r([]))}catch{}P(null)},ra=async M=>{try{await I.archiveChat(M),F(ae=>ae.filter(me=>me.id!==M)),Y===M&&(te(null),r([]))}catch{}P(null)},jt=A==="auto"?"Auto":A==="off"?"Off":A.charAt(0).toUpperCase()+A.slice(1),sc=((pl=hl==null?void 0:hl.data)==null?void 0:pl.name)??"Auxiora",Ds=((vl=(gl=ml==null?void 0:ml.data)==null?void 0:gl.template)==null?void 0:vl.name)??null,ic=M=>({__html:$x(M)});return n.jsxs("div",{className:"page",children:[n.jsx("h2",{children:"Chat"}),n.jsxs("div",{className:"chat-layout",children:[n.jsxs("div",{className:`chat-sidebar${ce?"":" closed"}`,children:[n.jsxs("div",{className:"chat-sidebar-header",children:[n.jsx("button",{className:"new-chat-btn",onClick:nc,children:"+ New Chat"}),n.jsx("button",{className:"sidebar-toggle",onClick:()=>ie(M=>!M),title:ce?"Hide sidebar":"Show sidebar",children:ce?"«":"»"})]}),ce&&n.jsxs("div",{className:"chat-sidebar-list",children:[Z.map(M=>n.jsx("div",{className:`chat-sidebar-item${Y===M.id?" active":""}`,onClick:()=>{oe!==M.id&&te(M.id)},onContextMenu:ae=>{ae.preventDefault(),P({chatId:M.id,x:ae.clientX,y:ae.clientY})},children:oe===M.id?n.jsx("input",{className:"chat-rename-input",value:H,onChange:ae=>J(ae.target.value),onKeyDown:ae=>{ae.key==="Enter"&&Ya(M.id),ae.key==="Escape"&&ve(null)},onBlur:()=>Ya(M.id),autoFocus:!0}):n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"chat-sidebar-title",children:M.title}),n.jsx("span",{className:"chat-sidebar-time",children:Vx(M.updatedAt)})]})},M.id)),Z.length===0&&n.jsx("div",{className:"chat-sidebar-empty",children:"No chats yet"})]})]}),ne&&Jy.createPortal(n.jsxs("div",{ref:de,className:"chat-context-menu",style:{position:"fixed",top:ne.y,left:ne.x},children:[n.jsx("button",{onClick:()=>{const M=Z.find(ae=>ae.id===ne.chatId);J((M==null?void 0:M.title)??""),ve(ne.chatId),P(null)},children:"Rename"}),n.jsx("button",{onClick:()=>ra(ne.chatId),children:"Archive"}),n.jsx("button",{className:"danger",onClick:()=>bt(ne.chatId),children:"Delete"})]}),document.body),n.jsxs("div",{className:"chat-container",children:[n.jsxs("div",{className:"chat-status",children:[n.jsxs("span",{className:"chat-status-left",children:[n.jsx("span",{className:"chat-status-dot","data-connected":f}),n.jsx("span",{className:"chat-agent-name",children:sc}),n.jsx("span",{className:"chat-status-sep"}),n.jsxs("span",{className:"chat-status-label",children:["Mode: ",n.jsx("strong",{children:jt})]}),n.jsx("span",{className:"chat-status-sep"}),n.jsxs("span",{className:"chat-status-label",children:["Engine:"," ",n.jsxs("select",{className:"chat-personality-select",value:C??"",onChange:M=>lc(M.target.value),title:"Per-chat personality engine",children:[n.jsxs("option",{value:"",children:["Global (",le==="the-architect"?"Architect":"Standard",")"]}),n.jsx("option",{value:"standard",children:"Standard"}),n.jsx("option",{value:"the-architect",children:"The Architect"})]})]}),Ds&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"chat-status-sep"}),n.jsxs("span",{className:"chat-status-label",children:["Personality: ",n.jsx("strong",{children:Ds})]})]})]}),n.jsxs("span",{className:"chat-status-right",children:[n.jsx("button",{className:"sidebar-toggle-inline",onClick:()=>ie(M=>!M),title:ce?"Hide sidebar":"Show sidebar",children:"☰"}),n.jsx("div",{className:"model-selector",children:n.jsxs("select",{value:b?`${b.provider}/${b.model}`:"",onChange:M=>tc(M.target.value),children:[n.jsx("option",{value:"",children:"Auto (router)"}),vt.map(M=>n.jsx("optgroup",{label:M.displayName,children:M.models.map(ae=>n.jsx("option",{value:`${M.provider}/${ae}`,children:Xx(ae)},`${M.provider}/${ae}`))},M.provider))]})})]})]}),n.jsxs("div",{className:"chat-messages",ref:ge,children:[!Y&&n.jsx("div",{style:{textAlign:"center",color:"var(--text-secondary)",padding:"2rem"},children:"Select a chat or create a new one"}),Y&&!K&&n.jsx("div",{style:{textAlign:"center",color:"var(--text-secondary)",padding:"2rem"},children:"Loading..."}),Y&&K&&s.length===0&&n.jsx("div",{style:{textAlign:"center",color:"var(--text-secondary)",padding:"2rem"},children:"Send a message to start chatting"}),Ce&&n.jsxs("div",{className:"context-override-banner",children:[n.jsxs("span",{children:["Context locked to ",((ua=_t[Ce])==null?void 0:ua.icon)??"🔒"," ",((yl=_t[Ce])==null?void 0:yl.label)??Ce]}),n.jsx("button",{className:"context-override-unlock",onClick:Rs,"aria-label":"Clear context override",children:"Tap to unlock"})]}),s.map(M=>n.jsxs("div",{className:`chat-message ${M.role}`,children:[M.role==="assistant"&&M.detectedContext&&n.jsxs("div",{className:"chat-context-row",children:[n.jsx(Ax,{context:M.detectedContext,onOverride:ae=>An(ae,"message",M.id)}),n.jsx("button",{className:"context-override-trigger",onClick:()=>be(xe===M.id?null:M.id),"aria-label":"Override context",children:"✎"}),n.jsx(kx,{isOpen:xe===M.id,currentDomain:M.detectedContext.domain,onSelect:(ae,me)=>An(ae,me,M.id),onClose:()=>be(null)})]}),M.role==="assistant"&&M.recommendation&&n.jsx(_x,{recommendation:M.recommendation,onAccept:ae=>Ll(M.id,ae),onDismiss:()=>ac(M.id)}),M.role==="assistant"?n.jsx("div",{className:"chat-markdown",dangerouslySetInnerHTML:ic(M.content)}):M.content,M.role==="assistant"&&M.activeTraits&&M.activeTraits.length>0&&n.jsx(zx,{sources:M.activeTraits,context:M.detectedContext,weights:M.traitWeights}),M.role==="assistant"&&M.transparency&&n.jsxs("div",{className:"chat-message-meta",children:[n.jsx(Yx,{tokens:M.transparency.model.tokens,cost:M.transparency.model.cost,latencyMs:M.transparency.model.latencyMs}),M.model&&n.jsx("span",{className:"model-label",children:M.model})]}),M.role==="assistant"&&!M.transparency&&M.model&&n.jsx("div",{className:"model-label",children:M.model}),M.role==="assistant"&&M.transparency&&n.jsx(Lx,{meta:M.transparency}),M.role==="assistant"&&M.transparency&&n.jsx("button",{className:"pp-trigger-btn",onClick:()=>ee(M.id),children:"Why?"})]},M.id)),p&&y&&n.jsxs("div",{className:"chat-tool-status",children:[n.jsx("span",{className:"tool-status-dot"}),y,"..."]}),n.jsx("div",{ref:X})]}),he&&(()=>{const M=s.find(ae=>ae.id===he);return M!=null&&M.transparency?n.jsx(qx,{meta:M.transparency,onClose:()=>ee(null)}):null})(),n.jsxs("div",{className:"chat-input-area",children:[n.jsxs("div",{className:"chat-input-wrapper",children:[R&&$t.length>0&&n.jsx("div",{className:"slash-autocomplete",ref:qa,children:$t.map((M,ae)=>n.jsxs("div",{className:`slash-ac-item${ae===O?" selected":""}`,onMouseEnter:()=>E(ae),onMouseDown:me=>{var De;me.preventDefault(),o(M.command),_(!1),(De=pa.current)==null||De.focus()},children:[n.jsx("span",{className:"slash-ac-cmd",children:M.command}),n.jsx("span",{className:"slash-ac-desc",children:M.description})]},M.command))}),n.jsx("input",{ref:pa,type:"text",value:u,onChange:M=>o(M.target.value),onKeyDown:M=>{if(R&&$t.length>0){if(M.key==="ArrowDown"){M.preventDefault(),E(ae=>(ae+1)%$t.length);return}if(M.key==="ArrowUp"){M.preventDefault(),E(ae=>(ae-1+$t.length)%$t.length);return}if(M.key==="Tab"||M.key==="Enter"&&$t.length>1){M.preventDefault(),o($t[O].command),_(!1);return}if(M.key==="Escape"){M.preventDefault(),_(!1);return}}M.key==="Enter"&&Tn()},placeholder:Y?f?"Type / for commands...":"Connecting...":"Select or create a chat...",disabled:!f||!Y})]}),n.jsx("button",{onClick:Tn,disabled:!f||!u.trim()||!Y,children:"Send"})]})]})]})]})}const Qx={active:"badge-green",paused:"badge-yellow",deleted:"badge-red",enabled:"badge-green",disabled:"badge-gray"};function _m({status:s}){const r=Qx[s]||"badge-gray";return n.jsx("span",{className:`badge ${r}`,children:s})}const Um=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],wu=Intl.DateTimeFormat().resolvedOptions().timeZone;function Kx(s,r,u,o,f){if(s==="custom")return f;if(s==="hourly")return"0 * * * *";if(s==="every-n-hours")return`0 */${u} * * *`;const[m,p]=r.split(":").map(Number),x=isNaN(p)?0:p,y=isNaN(m)?8:m;return s==="daily"?`${x} ${y} * * *`:s==="weekday"?`${x} ${y} * * 1-5`:s==="weekly"?`${x} ${y} * * ${o}`:f}function Lm(s){const r=s.trim().split(/\s+/);if(r.length!==5)return{freq:"custom",time:"08:00",everyNHours:2,weekday:1};const[u,o,f,m,p]=r;if(u==="0"&&o==="*"&&f==="*"&&m==="*"&&p==="*")return{freq:"hourly",time:"08:00",everyNHours:2,weekday:1};const x=o.match(/^\*\/(\d+)$/);if(u==="0"&&x&&f==="*"&&m==="*"&&p==="*")return{freq:"every-n-hours",time:"08:00",everyNHours:parseInt(x[1],10),weekday:1};const y=parseInt(u,10),g=parseInt(o,10);if(isNaN(y)||isNaN(g))return{freq:"custom",time:"08:00",everyNHours:2,weekday:1};const b=`${String(g).padStart(2,"0")}:${String(y).padStart(2,"0")}`;if(f==="*"&&m==="*"&&p==="*")return{freq:"daily",time:b,everyNHours:2,weekday:1};if(f==="*"&&m==="*"&&p==="1-5")return{freq:"weekday",time:b,everyNHours:2,weekday:1};const j=parseInt(p,10);return f==="*"&&m==="*"&&!isNaN(j)&&j>=0&&j<=6?{freq:"weekly",time:b,everyNHours:2,weekday:j}:{freq:"custom",time:b,everyNHours:2,weekday:1}}function Ih(s){const r=Lm(s);switch(r.freq){case"daily":return`Daily at ${r.time}`;case"weekday":return`Weekdays at ${r.time}`;case"hourly":return"Every hour";case"every-n-hours":return`Every ${r.everyNHours}h`;case"weekly":return`${Um[r.weekday]}s at ${r.time}`;default:return s}}function Bm(){const{data:s,refresh:r}=ut(()=>I.getBehaviors(),[]);Os(r);const[u,o]=h.useState("closed"),[f,m]=h.useState(null),[p,x]=h.useState("scheduled"),[y,g]=h.useState(""),[b,j]=h.useState("daily"),[S,T]=h.useState("08:00"),[A,D]=h.useState(2),[O,E]=h.useState(1),[R,_]=h.useState(""),[K,Q]=h.useState(wu),[Z,F]=h.useState(5),[Y,te]=h.useState(""),[ce,ie]=h.useState(""),[he,ee]=h.useState(!1),[oe,ve]=h.useState(""),[H,J]=h.useState(""),ne=(s==null?void 0:s.data)??[],P=h.useMemo(()=>Kx(b,S,A,O,R),[b,S,A,O,R]),de=W=>{var X,ge;return(X=W.schedule)!=null&&X.cron?Ih(W.schedule.cron):W.polling?`Every ${Math.round(W.polling.intervalMs/6e4)}m`:(ge=W.delay)!=null&&ge.fireAt?new Date(W.delay.fireAt).toLocaleString():"-"},C=async W=>{try{const X=W.status==="active"?"paused":"active";await I.patchBehavior(W.id,{status:X}),r()}catch(X){alert(X.message||"Failed to update behavior")}},L=async W=>{var X;if(confirm(`Delete behavior "${(X=W.action)==null?void 0:X.slice(0,40)}"?`))try{await I.deleteBehavior(W.id),r()}catch(ge){alert(ge.message||"Failed to delete behavior")}},le=()=>{m(null),x("scheduled"),g(""),j("daily"),T("08:00"),D(2),E(1),_(""),Q(wu),F(5),te(""),ie(""),ve(""),J("")},re=()=>{le(),o("create")},xe=W=>{var X,ge,qe;if(m(W.id),x(W.type??"scheduled"),g(W.action??""),(X=W.schedule)!=null&&X.cron){const Xe=Lm(W.schedule.cron);j(Xe.freq),T(Xe.time),D(Xe.everyNHours),E(Xe.weekday),_(Xe.freq==="custom"?W.schedule.cron:"")}if(Q(((ge=W.schedule)==null?void 0:ge.timezone)??wu),W.polling&&(F(Math.round(W.polling.intervalMs/6e4)),te(W.polling.condition??"")),(qe=W.delay)!=null&&qe.fireAt){const Xe=new Date(W.delay.fireAt);ie(Xe.toISOString().slice(0,16))}ve(""),J(""),o("edit")},be=()=>{le(),o("closed")},Ce=async W=>{W.preventDefault(),ve(""),J(""),ee(!0);try{const X={action:y};p==="scheduled"?(X.cron=P,X.timezone=K):p==="monitor"?(X.intervalMinutes=Z,X.condition=Y):p==="one-shot"&&(X.runAt=ce),u==="edit"&&f?(await I.patchBehavior(f,X),J("Behavior updated")):(X.type=p,await I.createBehavior(X),J("Behavior created")),le(),o("closed"),r()}catch(X){ve(X.message||`Failed to ${u==="edit"?"update":"create"} behavior`)}finally{ee(!1)}},Pe=b==="daily"||b==="weekday"||b==="weekly";return n.jsxs("div",{className:"page",children:[n.jsx("h2",{children:"Behaviors"}),n.jsx("div",{className:"create-form-toggle",children:n.jsx("button",{className:"btn-sm",onClick:()=>u!=="closed"?be():re(),children:u!=="closed"?"Cancel":"New Behavior"})}),u!=="closed"&&n.jsx("div",{className:"create-form",children:n.jsxs("form",{onSubmit:Ce,children:[n.jsx("h3",{children:u==="edit"?"Edit Behavior":"New Behavior"}),u==="create"&&n.jsxs(n.Fragment,{children:[n.jsx("label",{children:"Type"}),n.jsxs("select",{value:p,onChange:W=>x(W.target.value),children:[n.jsx("option",{value:"scheduled",children:"Scheduled"}),n.jsx("option",{value:"monitor",children:"Monitor (polling)"}),n.jsx("option",{value:"one-shot",children:"One-shot (run once)"})]})]}),n.jsx("label",{children:"Action"}),n.jsx("textarea",{value:y,onChange:W=>g(W.target.value),placeholder:"What should the agent do?",required:!0,rows:3}),p==="scheduled"&&n.jsxs("div",{className:"create-form-group",children:[n.jsx("label",{children:"How often?"}),n.jsxs("select",{value:b,onChange:W=>j(W.target.value),children:[n.jsx("option",{value:"daily",children:"Every day"}),n.jsx("option",{value:"weekday",children:"Every weekday (Mon-Fri)"}),n.jsx("option",{value:"weekly",children:"Once a week"}),n.jsx("option",{value:"hourly",children:"Every hour"}),n.jsx("option",{value:"every-n-hours",children:"Every few hours"}),n.jsx("option",{value:"custom",children:"Custom (cron)"})]}),b==="weekly"&&n.jsxs(n.Fragment,{children:[n.jsx("label",{children:"Day of week"}),n.jsx("select",{value:O,onChange:W=>E(Number(W.target.value)),children:Um.map((W,X)=>n.jsx("option",{value:X,children:W},X))})]}),Pe&&n.jsxs(n.Fragment,{children:[n.jsx("label",{children:"Time"}),n.jsx("input",{type:"time",value:S,onChange:W=>T(W.target.value),required:!0})]}),b==="every-n-hours"&&n.jsxs(n.Fragment,{children:[n.jsx("label",{children:"Every how many hours?"}),n.jsx("input",{type:"number",value:A,onChange:W=>D(Number(W.target.value)),min:1,max:23,required:!0})]}),b==="custom"&&n.jsxs(n.Fragment,{children:[n.jsx("label",{children:"Cron expression"}),n.jsx("input",{type:"text",value:R,onChange:W=>_(W.target.value),placeholder:"0 8 * * *",required:!0})]}),n.jsx("label",{children:"Timezone"}),n.jsx("input",{type:"text",value:K,onChange:W=>Q(W.target.value)}),n.jsxs("div",{className:"form-hint",children:["Schedule: ",n.jsx("strong",{children:Ih(P)})," (",K,")"]})]}),p==="monitor"&&n.jsxs("div",{className:"create-form-group",children:[n.jsx("label",{children:"Check every (minutes)"}),n.jsx("input",{type:"number",value:Z,onChange:W=>F(Number(W.target.value)),min:1,required:!0}),n.jsx("label",{children:"Condition"}),n.jsx("textarea",{value:Y,onChange:W=>te(W.target.value),placeholder:"When should this trigger?",required:!0,rows:2})]}),p==="one-shot"&&n.jsxs("div",{className:"create-form-group",children:[n.jsx("label",{children:"Run at"}),n.jsx("input",{type:"datetime-local",value:ce,onChange:W=>ie(W.target.value),required:!0})]}),oe&&n.jsx("div",{className:"error",children:oe}),H&&n.jsx("div",{className:"settings-success",children:H}),n.jsx("button",{type:"submit",className:"settings-btn",disabled:he||!y,children:he?"Saving...":u==="edit"?"Save Changes":"Create Behavior"})]})}),ne.length===0?n.jsx("div",{className:"bv-empty",children:"No behaviors configured yet."}):n.jsx("div",{className:"bv-list",children:ne.map(W=>n.jsxs("div",{className:`bv-card ${W.status==="paused"?"bv-card--paused":""}`,children:[n.jsxs("div",{className:"bv-card-main",children:[n.jsx("div",{className:"bv-card-action",children:W.action}),n.jsxs("div",{className:"bv-card-meta",children:[n.jsx("span",{className:"bv-card-schedule",children:de(W)}),n.jsx(_m,{status:W.status}),n.jsx("span",{className:"bv-card-type",children:W.type})]}),n.jsxs("div",{className:"bv-card-stats",children:[n.jsxs("span",{children:[W.runCount??0," run",(W.runCount??0)!==1?"s":""]}),(W.failCount??0)>0&&n.jsxs("span",{className:"bv-card-fails",children:[W.failCount," failed"]}),W.lastRun&&n.jsxs("span",{className:"bv-card-lastrun",children:["Last: ",new Date(W.lastRun).toLocaleString()]})]})]}),n.jsxs("div",{className:"bv-card-actions",children:[n.jsx("button",{className:"btn-sm",onClick:()=>xe(W),children:"Edit"}),n.jsx("button",{className:"btn-sm",onClick:()=>C(W),children:W.status==="active"?"Pause":"Resume"}),n.jsx("button",{className:"btn-sm btn-danger",onClick:()=>L(W),children:"Delete"})]})]},W.id))})]})}function Hm({columns:s,rows:r,keyField:u,actions:o}){return n.jsxs("table",{className:"data-table",children:[n.jsx("thead",{children:n.jsxs("tr",{children:[s.map(f=>n.jsx("th",{children:f.label},f.key)),o&&n.jsx("th",{children:"Actions"})]})}),n.jsx("tbody",{children:r.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:s.length+(o?1:0),className:"empty-row",children:"No data"})}):r.map(f=>n.jsxs("tr",{children:[s.map(m=>n.jsx("td",{children:m.render?m.render(f):String(f[m.key]??"")},m.key)),o&&n.jsx("td",{className:"actions-cell",children:o(f)})]},f[u]))})]})}function qm(){const{data:s,refresh:r}=ut(()=>I.getWebhooks(),[]),{data:u}=ut(()=>I.getBehaviors(),[]);Os(r);const o=(s==null?void 0:s.data)??[],f=(u==null?void 0:u.data)??[],[m,p]=h.useState(!1),[x,y]=h.useState(""),[g,b]=h.useState(""),[j,S]=h.useState(""),[T,A]=h.useState(!1),[D,O]=h.useState(""),[E,R]=h.useState(""),_=[{key:"name",label:"Name"},{key:"type",label:"Type"},{key:"enabled",label:"Status",render:Y=>n.jsx(_m,{status:Y.enabled?"enabled":"disabled"})},{key:"behaviorId",label:"Behavior",render:Y=>Y.behaviorId||"-"},{key:"createdAt",label:"Created",render:Y=>new Date(Y.createdAt).toLocaleDateString()}],K=async Y=>{try{await I.patchWebhook(Y.id,{enabled:!Y.enabled}),r()}catch(te){alert(te.message||"Failed to update webhook")}},Q=async Y=>{if(confirm(`Delete webhook "${Y.name}"?`))try{await I.deleteWebhook(Y.id),r()}catch(te){alert(te.message||"Failed to delete webhook")}},Z=()=>{y(""),b(""),S(""),O(""),R("")},F=async Y=>{Y.preventDefault(),O(""),R(""),A(!0);try{const te={name:x,secret:g};j&&(te.behaviorId=j),await I.createWebhook(te);const ce=`${window.location.origin}/api/v1/webhooks/custom/${x}`;R(ce),Z(),p(!1),r()}catch(te){O(te.message||"Failed to create webhook")}finally{A(!1)}};return n.jsxs("div",{className:"page",children:[n.jsx("h2",{children:"Webhooks"}),n.jsx("div",{className:"create-form-toggle",children:n.jsx("button",{className:"btn-sm",onClick:()=>{p(!m),m&&Z()},children:m?"Cancel":"New Webhook"})}),E&&n.jsxs("div",{className:"create-form-success",children:["Webhook created. URL: ",n.jsx("code",{children:E})]}),m&&n.jsx("div",{className:"create-form",children:n.jsxs("form",{onSubmit:F,children:[n.jsx("label",{children:"Name"}),n.jsx("input",{type:"text",value:x,onChange:Y=>y(Y.target.value),placeholder:"my-webhook",pattern:"[a-zA-Z0-9_-]+",title:"URL-safe: letters, numbers, hyphens, underscores",required:!0}),n.jsx("label",{children:"Secret"}),n.jsx("input",{type:"password",value:g,onChange:Y=>b(Y.target.value),placeholder:"HMAC signing key",required:!0}),n.jsx("label",{children:"Behavior (optional)"}),n.jsxs("select",{value:j,onChange:Y=>S(Y.target.value),children:[n.jsx("option",{value:"",children:"None"}),f.map(Y=>{var te;return n.jsx("option",{value:Y.id,children:((te=Y.action)==null?void 0:te.slice(0,50))||Y.id},Y.id)})]}),D&&n.jsx("div",{className:"error",children:D}),n.jsx("button",{type:"submit",className:"settings-btn",disabled:T||!x||!g,children:T?"Creating...":"Create Webhook"})]})}),n.jsx(Hm,{columns:_,rows:o,keyField:"id",actions:Y=>n.jsxs(n.Fragment,{children:[n.jsx("button",{className:"btn-sm",onClick:()=>K(Y),children:Y.enabled?"Disable":"Enable"}),n.jsx("button",{className:"btn-sm btn-danger",onClick:()=>Q(Y),children:"Delete"})]})})]})}const Zx=["professional","apologetic","matter_of_fact","self_deprecating","gentle","detailed","encouraging","terse","educational"],Jx=["she/her","he/him","they/them","it/its"],Wx=["greeting","farewell","thinking","success","error"],Fx=[{key:"warmth",label:"Warmth",low:"Reserved",high:"Warm"},{key:"directness",label:"Directness",low:"Gentle",high:"Direct"},{key:"humor",label:"Humor",low:"Serious",high:"Playful"},{key:"formality",label:"Formality",low:"Casual",high:"Formal"}];function Tu({tags:s,onChange:r,placeholder:u}){const[o,f]=h.useState(""),m=x=>{if(x.key==="Enter"){x.preventDefault();const y=o.trim();y&&!s.includes(y)&&r([...s,y]),f("")}else x.key==="Backspace"&&o===""&&s.length>0&&r(s.slice(0,-1))},p=x=>{r(s.filter((y,g)=>g!==x))};return n.jsxs("div",{className:"tag-input-container",children:[n.jsx("div",{className:"tag-list",children:s.map((x,y)=>n.jsxs("span",{className:"tag",children:[x,n.jsx("button",{type:"button",className:"tag-remove",onClick:()=>p(y),"aria-label":`Remove ${x}`,children:"x"})]},y))}),n.jsx("input",{className:"tag-input",type:"text",value:o,onChange:x=>f(x.target.value),onKeyDown:m,placeholder:u??"Type and press Enter"})]})}function Px({label:s,low:r,high:u,value:o,onChange:f}){const m=Math.round(o*100);return n.jsxs("div",{className:"tone-slider",children:[n.jsxs("div",{className:"tone-slider-header",children:[n.jsx("span",{className:"tone-label",children:s}),n.jsxs("span",{className:"tone-value",children:[m,"%"]})]}),n.jsxs("div",{className:"tone-slider-row",children:[n.jsx("span",{className:"tone-extreme",children:r}),n.jsx("input",{className:"slider",type:"range",min:0,max:100,value:m,onChange:p=>f(Number(p.target.value)/100)}),n.jsx("span",{className:"tone-extreme",children:u})]})]})}const Ix={name:"",pronouns:"they/them",avatar:null,vibe:"",tone:{warmth:.5,directness:.5,humor:.5,formality:.5},errorStyle:"professional",expertise:[],catchphrases:{greeting:"",farewell:"",thinking:"",success:"",error:""},boundaries:{neverJokeAbout:[],neverAdviseOn:[]},customInstructions:"",soulContent:null,activeTemplate:null};function Ym(){const[s,r]=h.useState(null),[u,o]=h.useState(Ix),[f,m]=h.useState(null),[p,x]=h.useState(!1),[y,g]=h.useState(!1),[b,j]=h.useState(""),[S,T]=h.useState(""),[A,D]=h.useState("");h.useEffect(()=>{I.getPersonalityFull().then(ee=>{var H,J,ne,P,de,C,L;const oe=ee.data,ve={name:oe.name??"",pronouns:oe.pronouns??"they/them",avatar:oe.avatar??null,vibe:oe.vibe??"",tone:oe.tone??{warmth:.5,directness:.5,humor:.5,formality:.5},errorStyle:oe.errorStyle??"professional",expertise:oe.expertise??[],catchphrases:{greeting:((H=oe.catchphrases)==null?void 0:H.greeting)??"",farewell:((J=oe.catchphrases)==null?void 0:J.farewell)??"",thinking:((ne=oe.catchphrases)==null?void 0:ne.thinking)??"",success:((P=oe.catchphrases)==null?void 0:P.success)??"",error:((de=oe.catchphrases)==null?void 0:de.error)??""},boundaries:{neverJokeAbout:((C=oe.boundaries)==null?void 0:C.neverJokeAbout)??[],neverAdviseOn:((L=oe.boundaries)==null?void 0:L.neverAdviseOn)??[]},customInstructions:oe.customInstructions??"",soulContent:oe.soulContent??null,activeTemplate:oe.activeTemplate??null};o(ve),r(ve),m(ve.activeTemplate)}).catch(ee=>D(ee.message))},[]);const{data:O,loading:E}=ut(()=>I.getTemplates(),[]),R=(O==null?void 0:O.data)??[],K=h.useCallback(()=>s?f!==s.activeTemplate?!0:JSON.stringify(u)!==JSON.stringify(s):!1,[u,s,f])(),Q=(ee,oe)=>{o(ve=>({...ve,[ee]:oe}))},Z=(ee,oe)=>{o(ve=>({...ve,tone:{...ve.tone,[ee]:oe}}))},F=(ee,oe)=>{o(ve=>({...ve,catchphrases:{...ve.catchphrases,[ee]:oe}}))},Y=(ee,oe)=>{o(ve=>({...ve,boundaries:{...ve.boundaries,[ee]:oe}}))},te=async()=>{g(!0),T(""),j("");try{const ee={name:u.name,pronouns:u.pronouns,avatar:u.avatar,vibe:u.vibe,tone:u.tone,errorStyle:u.errorStyle,expertise:u.expertise,catchphrases:u.catchphrases,boundaries:u.boundaries,customInstructions:u.customInstructions,soulContent:u.soulContent};f!==(s==null?void 0:s.activeTemplate)&&(ee.activeTemplate=f),await I.updatePersonalityFull(ee);const oe={...u,activeTemplate:f};r(oe),j("Personality settings saved successfully")}catch(ee){T(ee instanceof Error?ee.message:"Failed to save")}finally{g(!1)}},[ce,ie]=h.useState(!1);if(h.useEffect(()=>{if(!u.avatar){ie(!1);return}try{new URL(u.avatar),ie(!0)}catch{ie(!1)}},[u.avatar]),A)return n.jsx("div",{className:"page",children:n.jsxs("div",{className:"error",children:["Failed to load personality data: ",A]})});if(!s)return n.jsx("div",{className:"page",children:n.jsx("p",{children:"Loading personality settings..."})});const he=n.jsx("button",{className:"settings-btn",onClick:te,disabled:y||!K,children:y?"Saving...":"Save Changes"});return n.jsxs("div",{className:"page",children:[n.jsxs("div",{className:"page-header",children:[n.jsx("h2",{children:"Personality Editor"}),K&&he]}),b&&n.jsx("div",{className:"settings-success",children:b}),S&&n.jsx("div",{className:"error",children:S}),n.jsxs("div",{className:"settings-form",children:[n.jsxs("div",{className:"editor-section",children:[n.jsx("h3",{children:"Identity"}),n.jsxs("div",{className:"form-grid",children:[n.jsxs("div",{className:"form-field",children:[n.jsx("label",{children:"Name"}),n.jsx("input",{type:"text",value:u.name,onChange:ee=>Q("name",ee.target.value),placeholder:"Agent name"})]}),n.jsxs("div",{className:"form-field",children:[n.jsx("label",{children:"Pronouns"}),n.jsx("select",{value:u.pronouns,onChange:ee=>Q("pronouns",ee.target.value),children:Jx.map(ee=>n.jsx("option",{value:ee,children:ee},ee))})]}),n.jsxs("div",{className:"form-field full-width",children:[n.jsx("label",{children:"Vibe"}),n.jsx("input",{type:"text",value:u.vibe,onChange:ee=>{ee.target.value.length<=200&&Q("vibe",ee.target.value)},placeholder:"A short description of the assistant's personality vibe",maxLength:200}),n.jsxs("span",{className:"field-hint",children:[u.vibe.length,"/200 characters"]})]}),n.jsxs("div",{className:"form-field full-width",children:[n.jsx("label",{children:"Avatar URL"}),n.jsx("input",{type:"text",value:u.avatar??"",onChange:ee=>Q("avatar",ee.target.value||null),placeholder:"https://example.com/avatar.png"}),ce&&u.avatar&&n.jsx("img",{src:u.avatar,alt:"Avatar preview",style:{width:64,height:64,borderRadius:8,marginTop:8,objectFit:"cover"},onError:()=>ie(!1)})]})]})]}),n.jsxs("div",{className:"editor-section",children:[n.jsx("h3",{children:"Tone"}),n.jsx("div",{className:"tone-sliders",children:Fx.map(ee=>n.jsx(Px,{label:ee.label,low:ee.low,high:ee.high,value:u.tone[ee.key],onChange:oe=>Z(ee.key,oe)},ee.key))})]}),n.jsxs("div",{className:"editor-section",children:[n.jsx("h3",{children:"Quick Start Templates"}),E&&n.jsx("p",{children:"Loading templates..."}),n.jsx("div",{className:"template-grid",children:R.map(ee=>n.jsxs("div",{className:`template-card${f===ee.id?" selected":""}`,onClick:()=>m(ee.id),children:[n.jsx("h4",{children:ee.name}),n.jsx("p",{children:ee.description})]},ee.id))})]}),n.jsxs("div",{className:"editor-section",children:[n.jsx("h3",{children:"Behavior"}),n.jsxs("div",{className:"form-grid",children:[n.jsxs("div",{className:"form-field",children:[n.jsx("label",{children:"Error Style"}),n.jsx("select",{value:u.errorStyle,onChange:ee=>Q("errorStyle",ee.target.value),children:Zx.map(ee=>n.jsx("option",{value:ee,children:ee.replace(/_/g," ")},ee))})]}),n.jsxs("div",{className:"form-field full-width",children:[n.jsx("label",{children:"Expertise Areas"}),n.jsx(Tu,{tags:u.expertise,onChange:ee=>Q("expertise",ee),placeholder:"Add expertise area and press Enter"})]}),n.jsxs("div",{className:"form-field full-width",children:[n.jsx("label",{children:"Catchphrases"}),n.jsx("div",{className:"catchphrase-grid",children:Wx.map(ee=>n.jsxs("div",{className:"catchphrase-row",children:[n.jsx("span",{className:"catchphrase-label",children:ee}),n.jsx("input",{type:"text",value:u.catchphrases[ee]??"",onChange:oe=>F(ee,oe.target.value),placeholder:`${ee} phrase`})]},ee))})]}),n.jsxs("div",{className:"form-field full-width",children:[n.jsx("label",{children:"Never Joke About"}),n.jsx(Tu,{tags:u.boundaries.neverJokeAbout,onChange:ee=>Y("neverJokeAbout",ee),placeholder:"Add topic and press Enter"})]}),n.jsxs("div",{className:"form-field full-width",children:[n.jsx("label",{children:"Never Advise On"}),n.jsx(Tu,{tags:u.boundaries.neverAdviseOn,onChange:ee=>Y("neverAdviseOn",ee),placeholder:"Add topic and press Enter"})]})]})]}),n.jsxs("div",{className:"editor-section",children:[n.jsx("h3",{children:"Custom Instructions"}),n.jsxs("div",{className:"form-field full-width",children:[n.jsx("textarea",{className:"custom-instructions-textarea",rows:6,value:u.customInstructions,onChange:ee=>{ee.target.value.length<=4e3&&Q("customInstructions",ee.target.value)},maxLength:4e3,placeholder:"Add any custom instructions for the assistant..."}),n.jsxs("span",{className:"field-hint",children:[u.customInstructions.length,"/4000 characters. These instructions are always included in the system prompt and guide the assistant's overall behavior."]})]})]}),n.jsxs("div",{className:"editor-section",children:[n.jsxs("h3",{children:["Advanced",n.jsxs("button",{type:"button",className:"section-toggle",onClick:()=>x(!p),children:[p?"Hide":"Show"," Raw SOUL.md"]})]}),p&&n.jsxs(n.Fragment,{children:[n.jsx("p",{className:"field-hint",style:{marginBottom:"0.5rem"},children:"Warning: selecting a template will overwrite manual edits to this content."}),n.jsx("textarea",{className:"soul-editor-textarea",rows:16,value:u.soulContent??"",onChange:ee=>Q("soulContent",ee.target.value||null),placeholder:"Raw SOUL.md content...",style:{fontFamily:"monospace"}})]})]}),K&&n.jsx("div",{className:"editor-footer",children:he})]})]})}const Ki=[{id:"anthropic",label:"Anthropic (Claude)",needsKey:!0},{id:"claudeOAuth",label:"Claude (OAuth)",needsKey:!1,needsOAuth:!0},{id:"openai",label:"OpenAI",needsKey:!0},{id:"google",label:"Google (Gemini)",needsKey:!0},{id:"ollama",label:"Ollama (Local)",needsKey:!1,needsEndpoint:!0},{id:"groq",label:"Groq",needsKey:!0},{id:"deepseek",label:"DeepSeek",needsKey:!0},{id:"cohere",label:"Cohere",needsKey:!0},{id:"xai",label:"xAI (Grok)",needsKey:!0},{id:"openaiCompatible",label:"OpenAI-Compatible",needsKey:!0,needsEndpoint:!0},{id:"openrouter",label:"OpenRouter",needsKey:!0},{id:"huggingface",label:"HuggingFace",needsKey:!0}];function Es(s){return s.startsWith("claude-opus-4-6")?"Claude Opus 4.6":s.startsWith("claude-sonnet-4-5")?"Claude Sonnet 4.5":s.startsWith("claude-haiku-4-5")?"Claude Haiku 4.5":s.startsWith("claude-opus-4")?"Claude Opus 4":s.startsWith("claude-sonnet-4")?"Claude Sonnet 4":s.startsWith("claude-3-5-haiku")?"Claude Haiku 3.5":s.startsWith("claude-3-5-sonnet")?"Claude Sonnet 3.5":s.startsWith("claude-3-opus")?"Claude Opus 3":s==="gpt-4o"?"GPT-4o":s==="gpt-4o-mini"?"GPT-4o Mini":s==="gpt-4-turbo"?"GPT-4 Turbo":s.startsWith("o1")||s.startsWith("o3")?s.toUpperCase():s.startsWith("gemini-")?s.replace("gemini-","Gemini "):s}function Gm(){const{data:s,refresh:r}=ut(()=>I.getModels(),[]),[u,o]=h.useState(null),[f,m]=h.useState(!1),[p,x]=h.useState(""),[y,g]=h.useState(""),[b,j]=h.useState(!1),[S,T]=h.useState(""),[A,D]=h.useState(!1),[O,E]=h.useState(!1),[R,_]=h.useState(""),[K,Q]=h.useState(""),[Z,F]=h.useState(!1),[Y,te]=h.useState(""),[ce,ie]=h.useState(""),[he,ee]=h.useState(""),[oe,ve]=h.useState(!1),H=(s==null?void 0:s.providers)??[],J=(s==null?void 0:s.routing)??{enabled:!1,primary:"",fallback:""},ne=(s==null?void 0:s.cost)??{today:0,thisMonth:0,isOverBudget:!1,warningThresholdReached:!1};h.useEffect(()=>{J.primary&&_(J.primary),J.fallback&&Q(J.fallback)},[J.primary,J.fallback]),h.useEffect(()=>{I.getClaudeOAuthStatus().then(X=>E(X.connected)).catch(X=>console.error("Failed to check OAuth status:",X))},[]);const P=new Set(H.filter(X=>X.available).map(X=>X.name)),de=X=>{const ge=H.find(qe=>qe.name===X);return ge!=null&&ge.models?Object.keys(ge.models):[]},C=[];for(const X of H){if(!X.available||!X.models)continue;const ge=Ki.find(qe=>qe.id===X.name);for(const qe of Object.keys(X.models))C.push({provider:X.name,providerLabel:(ge==null?void 0:ge.label)??X.displayName??X.name,model:qe})}const L=X=>{u===X?o(null):(o(X),te(""),ie(""),ee(""),g(""),x(""))},le=async X=>{m(!0),g(""),x("");try{const ge=Ki.find(qe=>qe.id===X);await I.configureProvider(X,ge!=null&&ge.needsKey&&Y||void 0,ge!=null&&ge.needsEndpoint&&ce||void 0),he&&await I.setProviderModel(X,he),x(`${(ge==null?void 0:ge.label)??X} configured successfully`),te(""),await r()}catch(ge){g(ge.message)}finally{m(!1)}},re=async()=>{j(!0),g(""),x("");try{const{authUrl:X}=await I.startClaudeOAuth();window.open(X,"_blank"),D(!0)}catch(X){g(X instanceof Error?X.message:"Failed to start OAuth")}finally{j(!1)}},xe=async()=>{if(S.trim()){m(!0),g(""),x("");try{await I.completeClaudeOAuth(S.trim()),x("Claude OAuth connected successfully"),D(!1),T(""),E(!0),await r()}catch(X){g(X instanceof Error?X.message:"Failed to complete OAuth")}finally{m(!1)}}},be=async()=>{m(!0),g(""),x("");try{await I.disconnectClaudeOAuth(),x("Claude OAuth disconnected"),E(!1),await r()}catch(X){g(X instanceof Error?X.message:"Failed to disconnect OAuth")}finally{m(!1)}},Ce=async()=>{F(!0),g(""),x("");try{await I.updateRouting(R,K||void 0),x("Routing updated"),await r()}catch(X){g(X.message)}finally{F(!1)}},Pe=async X=>{if(!X)return;const[ge,...qe]=X.split("/"),Xe=qe.join("/");ve(!0),g(""),x("");try{await I.setProviderModel(ge,Xe),ge!==J.primary&&await I.updateRouting(ge,J.primary||void 0),x(`Switched to ${Es(Xe)}`),await r()}catch(lt){g(lt.message)}finally{ve(!1)}},W=H.filter(X=>X.available);return n.jsxs("div",{className:"page",children:[n.jsx("h2",{children:"Providers"}),C.length>0&&n.jsxs("div",{className:"settings-section",children:[n.jsx("h3",{children:"Active Model"}),n.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"0.85rem",marginBottom:"0.75rem"},children:"Choose which AI model to use. This changes the default for all new messages."}),n.jsx("div",{className:"routing-config",children:n.jsxs("div",{className:"routing-field",style:{flex:2},children:[n.jsx("label",{children:"Model"}),n.jsxs("select",{onChange:X=>Pe(X.target.value),disabled:oe,defaultValue:"",children:[n.jsx("option",{value:"",disabled:!0,children:"Select a model..."}),W.map(X=>{const ge=de(X.name);if(ge.length===0)return null;const qe=Ki.find(Xe=>Xe.id===X.name);return n.jsx("optgroup",{label:(qe==null?void 0:qe.label)??X.displayName??X.name,children:ge.map(Xe=>n.jsx("option",{value:`${X.name}/${Xe}`,children:Es(Xe)},`${X.name}/${Xe}`))},X.name)})]})]})}),p&&n.jsx("div",{className:"settings-success",children:p}),y&&n.jsx("div",{className:"error",children:y})]}),W.length>1&&n.jsxs("div",{className:"settings-section",children:[n.jsx("h3",{children:"Provider Routing"}),n.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"0.85rem",marginBottom:"0.75rem"},children:"Set primary and fallback providers. Fallback is used when the primary is unavailable."}),n.jsxs("div",{className:"routing-config",children:[n.jsxs("div",{className:"routing-field",children:[n.jsx("label",{children:"Primary Provider"}),n.jsxs("select",{value:R,onChange:X=>_(X.target.value),children:[n.jsx("option",{value:"",children:"Select..."}),W.map(X=>n.jsx("option",{value:X.name,children:X.displayName||X.name},X.name))]})]}),n.jsxs("div",{className:"routing-field",children:[n.jsx("label",{children:"Fallback Provider"}),n.jsxs("select",{value:K,onChange:X=>Q(X.target.value),children:[n.jsx("option",{value:"",children:"None"}),W.filter(X=>X.name!==R).map(X=>n.jsx("option",{value:X.name,children:X.displayName||X.name},X.name))]})]}),n.jsx("button",{onClick:Ce,disabled:Z||!R,children:Z?"Saving...":"Save Routing"})]})]}),n.jsxs("div",{className:"settings-section",children:[n.jsx("h3",{children:"Usage"}),n.jsxs("div",{className:"cost-summary",children:[n.jsxs("div",{className:`cost-box${ne.isOverBudget?" over-budget":""}`,children:[n.jsx("h4",{children:"Today"}),n.jsxs("div",{className:"cost-value",children:["$",ne.today.toFixed(2)]})]}),n.jsxs("div",{className:`cost-box${ne.isOverBudget?" over-budget":""}`,children:[n.jsx("h4",{children:"This Month"}),n.jsxs("div",{className:"cost-value",children:["$",ne.thisMonth.toFixed(2)]})]}),n.jsxs("div",{className:"cost-box",children:[n.jsx("h4",{children:"Budget Status"}),n.jsx("div",{className:"cost-value",style:{fontSize:"0.95rem"},children:ne.isOverBudget?"Over Budget":ne.warningThresholdReached?"Warning":"OK"})]})]})]}),n.jsxs("div",{className:"settings-section",children:[n.jsx("h3",{children:"Manage Providers"}),n.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"0.85rem",marginBottom:"0.75rem"},children:"Click a card to configure API keys and endpoints."}),n.jsx("div",{className:"provider-grid",children:Ki.map(X=>{const ge=H.find(_e=>_e.name===X.id),qe=P.has(X.id),lt=X.id==="claudeOAuth"?O:qe,Et=J.primary===X.id,pa=J.fallback===X.id,qa=u===X.id,xt=de(X.id);return n.jsxs("div",{className:`provider-card${lt?" configured":""}${qa?" expanded":""}`,onClick:()=>L(X.id),children:[n.jsxs("div",{className:"provider-card-header",children:[n.jsxs("h3",{children:[n.jsx("span",{className:`status-dot ${lt?"active":"inactive"}`}),lt&&(ge!=null&&ge.displayName)?ge.displayName:X.label]}),n.jsxs("div",{className:"provider-badges",children:[Et&&n.jsx("span",{className:"badge-pill badge-primary",children:"Primary"}),pa&&n.jsx("span",{className:"badge-pill badge-fallback",children:"Fallback"})]})]}),n.jsxs("div",{className:"provider-model",children:[lt?xt.length>0?xt.map(_e=>Es(_e)).join(", "):"Active":"Not configured",(ge==null?void 0:ge.credentialSource)==="claude-cli"&&n.jsx("span",{style:{marginLeft:"0.5rem",fontSize:"0.75rem",color:"var(--accent)"},children:"(Claude Code CLI)"}),(ge==null?void 0:ge.credentialSource)==="oauth"&&n.jsx("span",{style:{marginLeft:"0.5rem",fontSize:"0.75rem",color:"var(--accent)"},children:"(OAuth)"})]}),qa&&n.jsx("div",{className:"provider-expand",onClick:_e=>_e.stopPropagation(),children:X.needsOAuth?n.jsx(n.Fragment,{children:O?n.jsxs(n.Fragment,{children:[n.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"0.85rem",marginBottom:"0.75rem"},children:"Connected via Claude OAuth. Your Claude Pro/Max subscription is being used."}),xt.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("label",{children:"Default Model"}),n.jsxs("select",{value:he,onChange:_e=>ee(_e.target.value),children:[n.jsx("option",{value:"",children:"Keep current"}),xt.map(_e=>n.jsx("option",{value:_e,children:Es(_e)},_e))]})]}),n.jsx("div",{className:"provider-actions",children:n.jsx("button",{className:"btn-save",onClick:be,disabled:f,style:{background:"var(--error, #e74c3c)"},children:f?"Disconnecting...":"Disconnect"})})]}):A?n.jsxs(n.Fragment,{children:[n.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"0.85rem",marginBottom:"0.75rem"},children:"Authorize in the browser tab that opened, then paste the code below."}),n.jsx("label",{children:"Authorization Code"}),n.jsx("input",{type:"text",value:S,onChange:_e=>T(_e.target.value),placeholder:"Paste the code from claude.ai",autoFocus:!0}),n.jsxs("div",{className:"provider-actions",children:[n.jsx("button",{className:"btn-save",onClick:xe,disabled:f||!S.trim(),children:f?"Connecting...":"Complete Connection"}),n.jsx("button",{onClick:()=>{D(!1),T("")},style:{marginLeft:"0.5rem"},children:"Cancel"})]})]}):n.jsxs(n.Fragment,{children:[n.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"0.85rem",marginBottom:"0.75rem"},children:"Connect your Claude Pro or Max subscription. No API key needed."}),n.jsx("div",{className:"provider-actions",children:n.jsx("button",{className:"btn-save",onClick:re,disabled:b,children:b?"Opening...":"Connect with Claude"})})]})}):n.jsxs(n.Fragment,{children:[X.needsKey&&n.jsxs(n.Fragment,{children:[n.jsx("label",{children:"API Key"}),n.jsx("input",{type:"password",value:Y,onChange:_e=>te(_e.target.value),placeholder:qe?"•••••••• (leave blank to keep)":"Enter API key"})]}),X.needsEndpoint&&n.jsxs(n.Fragment,{children:[n.jsx("label",{children:"Endpoint URL"}),n.jsx("input",{type:"text",value:ce,onChange:_e=>ie(_e.target.value),placeholder:X.id==="ollama"?"http://localhost:11434":"https://..."})]}),xt.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("label",{children:"Default Model"}),n.jsxs("select",{value:he,onChange:_e=>ee(_e.target.value),children:[n.jsx("option",{value:"",children:"Keep current"}),xt.map(_e=>n.jsx("option",{value:_e,children:Es(_e)},_e))]})]}),n.jsx("div",{className:"provider-actions",children:n.jsx("button",{className:"btn-save",onClick:()=>le(X.id),disabled:f||!Y&&X.needsKey&&!qe&&!X.needsEndpoint,children:f?"Saving...":"Save"})})]})})]},X.id)})})]})]})}const em=[{type:"discord",label:"Discord",fields:[{key:"botToken",label:"Bot Token",secret:!0}]},{type:"telegram",label:"Telegram",fields:[{key:"botToken",label:"Bot Token",secret:!0}]},{type:"slack",label:"Slack",fields:[{key:"botToken",label:"Bot Token",secret:!0},{key:"appToken",label:"App Token",secret:!0}]},{type:"twilio",label:"Twilio",fields:[{key:"accountSid",label:"Account SID",secret:!1},{key:"authToken",label:"Auth Token",secret:!0}]},{type:"matrix",label:"Matrix",fields:[{key:"accessToken",label:"Access Token",secret:!0}]},{type:"email",label:"Email",fields:[{key:"imapHost",label:"IMAP Host",secret:!1},{key:"imapPort",label:"IMAP Port",secret:!1},{key:"smtpHost",label:"SMTP Host",secret:!1},{key:"smtpPort",label:"SMTP Port",secret:!1},{key:"email",label:"Email Address",secret:!1},{key:"password",label:"Password (App Password for Gmail)",secret:!0}]}];function Xm(){var D,O;const{data:s}=ut(()=>I.getChannels(),[]),r=((D=s==null?void 0:s.data)==null?void 0:D.connected)??[],u=((O=s==null?void 0:s.data)==null?void 0:O.configured)??[],[o,f]=h.useState({}),[m,p]=h.useState(!1),[x,y]=h.useState(""),[g,b]=h.useState(""),j=E=>{if(o[E])return o[E];const R=u.find(_=>_.type===E);return{enabled:(R==null?void 0:R.enabled)??!1,credentials:{}}},S=E=>{const R=j(E);f(_=>({..._,[E]:{...R,enabled:!R.enabled}}))},T=(E,R,_)=>{const K=j(E);f(Q=>({...Q,[E]:{...K,credentials:{...K.credentials,[R]:_}}}))},A=async()=>{p(!0),b(""),y("");try{const E=em.filter(R=>j(R.type).enabled||Object.values(j(R.type).credentials).some(_=>_)).map(R=>{const _=j(R.type),K={};for(const[Q,Z]of Object.entries(_.credentials))Z&&(K[Q]=Z);return{type:R.type,enabled:_.enabled,...Object.keys(K).length>0?{credentials:K}:{}}});await I.updateChannels(E),y("Channels updated successfully")}catch(E){b(E.message)}finally{p(!1)}};return n.jsxs("div",{className:"page",children:[n.jsx("h2",{children:"Channels"}),n.jsx("div",{className:"channel-grid",children:em.map(E=>{const R=j(E.type),_=r.includes(E.type);return n.jsxs("div",{className:"channel-card",children:[n.jsxs("div",{className:"channel-card-header",children:[n.jsx("h3",{children:E.label}),n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"},children:[_?n.jsx("span",{className:"badge badge-green",children:"Connected"}):R.enabled&&n.jsx("span",{className:"badge badge-yellow",children:"Configured"}),n.jsx("div",{className:`toggle${R.enabled?" active":""}`,onClick:()=>S(E.type)})]})]}),R.enabled&&n.jsx("div",{className:"channel-card-fields",children:E.fields.map(K=>n.jsxs("div",{children:[n.jsx("label",{children:K.label}),n.jsx("input",{type:K.secret?"password":"text",value:R.credentials[K.key]??"",onChange:Q=>T(E.type,K.key,Q.target.value),placeholder:_?"(configured)":`Enter ${K.label.toLowerCase()}`})]},K.key))})]},E.type)})}),n.jsx("button",{className:"settings-btn",onClick:A,disabled:m,children:m?"Saving...":"Save Changes"}),x&&n.jsx("div",{className:"settings-success",children:x}),g&&n.jsx("div",{className:"error",children:g})]})}function eb(s){if(s.length===0)return{label:"",color:"transparent",width:"0%"};if(s.length<8)return{label:"Too short",color:"var(--danger)",width:"25%"};const r=/[A-Z]/.test(s),u=/[a-z]/.test(s),o=/[0-9]/.test(s),f=/[^A-Za-z0-9]/.test(s),m=[r,u,o,f].filter(Boolean).length;return s.length>=12&&m>=3?{label:"Strong",color:"var(--success)",width:"100%"}:{label:"Fair",color:"var(--warning)",width:"60%"}}function Pi({password:s}){const r=eb(s);return s?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"password-strength",children:n.jsx("div",{className:"password-strength-bar",style:{width:r.width,background:r.color}})}),n.jsx("div",{className:"password-strength-label",style:{color:r.color},children:r.label})]}):null}function Vm(){const[s,r]=h.useState(""),[u,o]=h.useState(""),[f,m]=h.useState(""),[p,x]=h.useState(!1),[y,g]=h.useState(""),[b,j]=h.useState(""),[S,T]=h.useState(""),[A,D]=h.useState(""),[O,E]=h.useState(!1),[R,_]=h.useState(""),[K,Q]=h.useState(""),[Z,F]=h.useState(null),[Y,te]=h.useState(""),[ce,ie]=h.useState(""),[he,ee]=h.useState(!1),[oe,ve]=h.useState(""),[H,J]=h.useState("");h.useEffect(()=>{I.getSealStatus().then(F).catch(()=>F({sealed:!1,pinRequired:!1}))},[]);const ne=async L=>{if(L.preventDefault(),j(""),g(""),u!==f){j("New passwords do not match");return}if(u.length<8){j("Password must be at least 8 characters");return}x(!0);try{await I.changeDashboardPassword(s,u),g("Mission Control password changed"),r(""),o(""),m("")}catch(le){j(le.message)}finally{x(!1)}},P=async L=>{if(L.preventDefault(),Q(""),_(""),S!==A){Q("New passwords do not match");return}if(S.length<8){Q("Password must be at least 8 characters");return}E(!0);try{await I.changeVaultPassword(S),_("Vault password changed"),T(""),D("")}catch(le){Q(le.message)}finally{E(!1)}},de=async L=>{if(L.preventDefault(),J(""),ve(""),!Y){J("Vault password is required");return}if(ce&&ce.length<4){J("PIN must be at least 4 characters");return}ee(!0);try{await I.enableSeal(Y,ce||void 0),ve("Auto-unseal enabled"),te(""),ie(""),F({sealed:!0,pinRequired:ce.length>0})}catch(le){J(le.message)}finally{ee(!1)}},C=async()=>{J(""),ve(""),ee(!0);try{await I.disableSeal(),ve("Auto-unseal disabled"),F({sealed:!1,pinRequired:!1})}catch(L){J(L.message)}finally{ee(!1)}};return n.jsxs("div",{className:"page",children:[n.jsx("h2",{children:"Security"}),n.jsxs("div",{className:"settings-section",children:[n.jsx("h3",{children:"Change Mission Control Password"}),n.jsxs("form",{className:"settings-form",onSubmit:ne,children:[n.jsx("label",{children:"Current Password"}),n.jsx("input",{type:"password",value:s,onChange:L=>r(L.target.value)}),n.jsx("label",{children:"New Password"}),n.jsx("input",{type:"password",value:u,onChange:L=>o(L.target.value)}),n.jsx(Pi,{password:u}),n.jsx("label",{children:"Confirm New Password"}),n.jsx("input",{type:"password",value:f,onChange:L=>m(L.target.value)}),n.jsx("button",{className:"settings-btn",type:"submit",disabled:p||!s||!u,children:p?"Saving...":"Change Password"}),y&&n.jsx("div",{className:"settings-success",children:y}),b&&n.jsx("div",{className:"error",children:b})]})]}),n.jsxs("div",{className:"settings-section",children:[n.jsx("h3",{children:"Change Vault Password"}),n.jsxs("form",{className:"settings-form",onSubmit:P,children:[n.jsx("label",{children:"New Vault Password"}),n.jsx("input",{type:"password",value:S,onChange:L=>T(L.target.value)}),n.jsx(Pi,{password:S}),n.jsx("label",{children:"Confirm New Password"}),n.jsx("input",{type:"password",value:A,onChange:L=>D(L.target.value)}),n.jsx("button",{className:"settings-btn",type:"submit",disabled:O||!S,children:O?"Saving...":"Change Vault Password"}),R&&n.jsx("div",{className:"settings-success",children:R}),K&&n.jsx("div",{className:"error",children:K})]})]}),n.jsxs("div",{className:"settings-section",children:[n.jsx("h3",{children:"Auto-Unseal"}),n.jsx("p",{className:"settings-info",children:"When enabled, the vault automatically unlocks on restart using this machine's identity. No plaintext password is stored on disk. Optionally add a PIN for extra security."}),Z===null?n.jsx("p",{children:"Loading..."}):Z.sealed?n.jsxs("div",{children:[n.jsxs("p",{children:["Status: ",n.jsx("strong",{children:"Enabled"}),Z.pinRequired?" (PIN required)":" (no PIN)"]}),n.jsx("button",{className:"settings-btn",onClick:C,disabled:he,children:he?"Disabling...":"Disable Auto-Unseal"})]}):n.jsxs("form",{className:"settings-form",onSubmit:de,children:[n.jsx("label",{children:"Vault Password"}),n.jsx("input",{type:"password",value:Y,onChange:L=>te(L.target.value),placeholder:"Enter vault password to verify"}),n.jsx("label",{children:"PIN (optional, 4+ characters)"}),n.jsx("input",{type:"password",value:ce,onChange:L=>ie(L.target.value),placeholder:"Leave empty for machine-only binding"}),n.jsx("button",{className:"settings-btn",type:"submit",disabled:he||!Y,children:he?"Enabling...":"Enable Auto-Unseal"})]}),oe&&n.jsx("div",{className:"settings-success",children:oe}),H&&n.jsx("div",{className:"error",children:H})]})]})}function $m({selected:s,onSelect:r}){const{theme:u,setTheme:o}=qu(),f=s??u,m=p=>{o(p),r==null||r(p)};return n.jsx("div",{className:"theme-grid",children:Fy.map(p=>n.jsxs("div",{className:`theme-card${f===p.id?" selected":""}`,onClick:()=>m(p.id),children:[n.jsx("div",{className:"theme-swatches",children:p.colors.map((x,y)=>n.jsx("div",{className:"theme-swatch",style:{background:x}},y))}),n.jsxs("div",{className:"theme-info",children:[n.jsx("h3",{children:p.name}),n.jsx("span",{className:`theme-mode-badge ${p.mode}`,children:p.mode})]}),n.jsx("p",{className:"theme-description",children:p.description})]},p.id))})}function Qm(){const{theme:s,setTheme:r}=qu(),[u,o]=h.useState(!1),[f,m]=h.useState(""),[p,x]=h.useState(""),[y,g]=h.useState(null);h.useEffect(()=>{I.getAppearance().then(S=>{const T=S.data.theme;g(T)}).catch(()=>{g(s)})},[]);const b=y!==null&&s!==y,j=async()=>{o(!0),x(""),m("");try{await I.updateAppearance(s),g(s),m("Theme updated successfully")}catch(S){x(S instanceof Error?S.message:"Failed to save theme")}finally{o(!1)}};return n.jsxs("div",{className:"page",children:[n.jsx("h2",{children:"Appearance"}),n.jsx("p",{style:{color:"var(--text-secondary)",marginBottom:"1.5rem"},children:"Choose your theme. Changes preview instantly."}),n.jsx($m,{}),b&&n.jsx("button",{className:"btn-primary",onClick:j,disabled:u,style:{marginTop:"1.5rem"},children:u?"Saving...":"Save Theme"}),f&&n.jsx("p",{className:"success",style:{marginTop:"0.75rem"},children:f}),p&&n.jsx("p",{className:"error",style:{marginTop:"0.75rem"},children:p})]})}const tm=[{id:"google-workspace",name:"Google Workspace",description:"Gmail, Google Calendar, and Google Drive",scopes:"Email summaries, calendar awareness, drive file access",setupUrl:"https://console.cloud.google.com/apis/credentials",instructions:["Go to Google Cloud Console > APIs & Services > Credentials","Create an OAuth 2.0 Client ID (Web application type)","Add authorized redirect URI: {callbackUrl}","Enable Gmail API, Google Calendar API, and Google Drive API"]}];function Km(){const[s,r]=h.useState({}),[u,o]=h.useState(""),[f,m]=h.useState(""),[p,x]=h.useState(""),[y,g]=h.useState(""),[b,j]=h.useState(null),S=`${window.location.origin}/api/v1/dashboard/connectors/google-workspace/callback`;h.useEffect(()=>{T()},[]);async function T(){for(const E of tm){r(R=>({...R,[E.id]:{...R[E.id],loading:!0,hasCredentials:!1,connected:!1}}));try{const R=await I.getConnectorStatus(E.id);r(_=>({..._,[E.id]:{hasCredentials:R.data.hasCredentials,connected:R.data.connected,expiresAt:R.data.expiresAt,loading:!1}}))}catch{r(R=>({...R,[E.id]:{hasCredentials:!1,connected:!1,loading:!1}}))}}}async function A(E){if(!u||!f){x("Both Client ID and Client Secret are required");return}x("");try{await I.saveConnectorCredentials(E,u,f),g('Credentials saved. Click "Connect" to authorize.'),o(""),m(""),j(null),T()}catch(R){x(R instanceof Error?R.message:"Failed to save credentials")}}function D(E){window.location.href=`/api/v1/dashboard/connectors/${E}/auth`}async function O(E){try{await I.disconnectConnector(E),g("Disconnected successfully"),T()}catch(R){x(R instanceof Error?R.message:"Failed to disconnect")}}return n.jsxs("div",{className:"page",children:[n.jsx("h2",{children:"Connections"}),n.jsxs("div",{className:"settings-form",children:[y&&n.jsx("div",{className:"settings-success",onClick:()=>g(""),children:y}),p&&n.jsx("div",{className:"error",children:p}),tm.map(E=>{const R=s[E.id],_=R==null?void 0:R.connected,K=R==null?void 0:R.hasCredentials;return n.jsxs("div",{className:"settings-section",children:[n.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[n.jsxs("div",{children:[n.jsx("h3",{children:E.name}),n.jsx("span",{style:{fontSize:"0.85rem",color:"var(--text-secondary)"},children:E.description})]}),n.jsx("span",{className:_?"badge badge-green":"badge badge-gray",children:R!=null&&R.loading?"Checking...":_?"Connected":"Not connected"})]}),n.jsxs("p",{style:{fontSize:"0.8rem",color:"var(--text-secondary)",margin:"0.5rem 0"},children:["Enables: ",E.scopes]}),_?n.jsxs("div",{style:{display:"flex",gap:"0.5rem",marginTop:"1rem",alignItems:"center"},children:[(R==null?void 0:R.expiresAt)&&n.jsxs("span",{style:{fontSize:"0.75rem",color:"var(--text-secondary)"},children:["Token expires: ",new Date(R.expiresAt).toLocaleDateString()]}),n.jsx("button",{type:"button",className:"btn-sm",onClick:()=>D(E.id),children:"Reconnect"}),n.jsx("button",{type:"button",className:"btn-sm btn-danger",onClick:()=>O(E.id),children:"Disconnect"})]}):K?n.jsxs("div",{style:{display:"flex",gap:"0.5rem",marginTop:"1rem"},children:[n.jsx("button",{type:"button",className:"settings-btn",onClick:()=>D(E.id),children:"Connect"}),n.jsx("button",{type:"button",className:"btn-sm",onClick:()=>j(E.id),children:"Update Credentials"})]}):n.jsx("div",{style:{marginTop:"1rem"},children:b!==E.id?n.jsx("button",{type:"button",className:"settings-btn",onClick:()=>j(E.id),children:"Set Up"}):null}),b===E.id&&n.jsxs("div",{style:{marginTop:"1rem",padding:"1rem",background:"var(--bg-hover)",borderRadius:"var(--radius)",border:"1px solid var(--border)"},children:[n.jsx("h4",{style:{margin:"0 0 0.75rem",fontFamily:"var(--font-display)",fontWeight:600},children:"Setup Instructions"}),n.jsx("ol",{style:{fontSize:"0.8rem",color:"var(--text-secondary)",paddingLeft:"1.25rem",margin:"0 0 1rem"},children:E.instructions.map((Q,Z)=>n.jsx("li",{style:{marginBottom:"0.35rem"},children:Q.replace("{callbackUrl}",S)},Z))}),n.jsxs("div",{style:{fontSize:"0.75rem",color:"var(--text-secondary)",marginBottom:"1rem",wordBreak:"break-all"},children:["Redirect URI: ",n.jsx("code",{style:{fontFamily:"var(--font-mono)",background:"var(--accent-subtle)",color:"var(--accent)",padding:"0.15rem 0.35rem",borderRadius:"4px",fontSize:"0.82em"},children:S})]}),n.jsx("label",{children:"Client ID"}),n.jsx("input",{type:"text",value:u,onChange:Q=>o(Q.target.value),placeholder:"your-client-id.apps.googleusercontent.com"}),n.jsx("label",{children:"Client Secret"}),n.jsx("input",{type:"password",value:f,onChange:Q=>m(Q.target.value),placeholder:"GOCSPX-..."}),n.jsxs("div",{style:{display:"flex",gap:"0.5rem",marginTop:"0.5rem"},children:[n.jsx("button",{type:"button",className:"settings-btn",onClick:()=>A(E.id),children:"Save & Connect"}),n.jsx("button",{type:"button",className:"btn-sm",onClick:()=>{j(null),x("")},children:"Cancel"})]})]})]},E.id)})]})]})}const tb=["Calendar","Email","Tasks","Patterns"],Ul={morningBriefing:{enabled:!0,time:"08:00",categories:["Calendar","Email"]},eveningSummary:{enabled:!1,time:"18:00"},deliveryChannel:"all"};function Zm(){const{data:s,loading:r}=ut(()=>I.getAmbientConfig(),[]),[u,o]=h.useState(Ul),[f,m]=h.useState(!1),[p,x]=h.useState(""),[y,g]=h.useState("");h.useEffect(()=>{var S,T,A,D,O;s!=null&&s.data&&o({morningBriefing:{enabled:((S=s.data.morningBriefing)==null?void 0:S.enabled)??Ul.morningBriefing.enabled,time:((T=s.data.morningBriefing)==null?void 0:T.time)??Ul.morningBriefing.time,categories:((A=s.data.morningBriefing)==null?void 0:A.categories)??Ul.morningBriefing.categories},eveningSummary:{enabled:((D=s.data.eveningSummary)==null?void 0:D.enabled)??Ul.eveningSummary.enabled,time:((O=s.data.eveningSummary)==null?void 0:O.time)??Ul.eveningSummary.time},deliveryChannel:s.data.deliveryChannel??Ul.deliveryChannel})},[s]);const b=S=>{o(T=>{const A=T.morningBriefing.categories,D=A.includes(S)?A.filter(O=>O!==S):[...A,S];return{...T,morningBriefing:{...T.morningBriefing,categories:D}}})},j=async()=>{m(!0),g(""),x("");try{await I.updateAmbientConfig(u),x("Ambient settings saved successfully")}catch(S){g(S instanceof Error?S.message:"Failed to save settings")}finally{m(!1)}};return r?null:n.jsxs("div",{className:"page",children:[n.jsx("h2",{children:"Ambient Intelligence"}),n.jsxs("div",{className:"settings-form",children:[n.jsxs("div",{className:"settings-section",children:[n.jsx("h3",{children:"Morning Briefing"}),n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem",marginBottom:"1rem"},children:[n.jsx("div",{className:`toggle${u.morningBriefing.enabled?" active":""}`,onClick:()=>o(S=>({...S,morningBriefing:{...S.morningBriefing,enabled:!S.morningBriefing.enabled}}))}),n.jsx("span",{style:{fontSize:"0.85rem",color:"var(--text-secondary)"},children:u.morningBriefing.enabled?"Enabled":"Disabled"})]}),u.morningBriefing.enabled&&n.jsxs(n.Fragment,{children:[n.jsx("label",{children:"Delivery Time"}),n.jsx("input",{type:"time",value:u.morningBriefing.time,onChange:S=>o(T=>({...T,morningBriefing:{...T.morningBriefing,time:S.target.value}}))}),n.jsx("label",{children:"Categories"}),n.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"0.5rem",marginBottom:"1rem"},children:tb.map(S=>n.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"0.4rem",cursor:"pointer",fontSize:"0.85rem"},children:[n.jsx("input",{type:"checkbox",checked:u.morningBriefing.categories.includes(S),onChange:()=>b(S),style:{width:"auto",marginBottom:0}}),S]},S))})]})]}),n.jsxs("div",{className:"settings-section",children:[n.jsx("h3",{children:"Evening Summary"}),n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem",marginBottom:"1rem"},children:[n.jsx("div",{className:`toggle${u.eveningSummary.enabled?" active":""}`,onClick:()=>o(S=>({...S,eveningSummary:{...S.eveningSummary,enabled:!S.eveningSummary.enabled}}))}),n.jsx("span",{style:{fontSize:"0.85rem",color:"var(--text-secondary)"},children:u.eveningSummary.enabled?"Enabled":"Disabled"})]}),u.eveningSummary.enabled&&n.jsxs(n.Fragment,{children:[n.jsx("label",{children:"Delivery Time"}),n.jsx("input",{type:"time",value:u.eveningSummary.time,onChange:S=>o(T=>({...T,eveningSummary:{...T.eveningSummary,time:S.target.value}}))})]})]}),n.jsxs("div",{className:"settings-section",children:[n.jsx("label",{children:"Delivery Channel"}),n.jsxs("select",{value:u.deliveryChannel,onChange:S=>o(T=>({...T,deliveryChannel:S.target.value})),children:[n.jsx("option",{value:"all",children:"All connected channels"}),n.jsx("option",{value:"webchat",children:"Webchat only"}),n.jsx("option",{value:"discord",children:"Discord"}),n.jsx("option",{value:"telegram",children:"Telegram"}),n.jsx("option",{value:"slack",children:"Slack"}),n.jsx("option",{value:"email",children:"Email"})]})]}),n.jsx("button",{className:"settings-btn",onClick:j,disabled:f,children:f?"Saving...":"Save Settings"}),p&&n.jsx("div",{className:"settings-success",children:p}),y&&n.jsx("div",{className:"error",children:y})]})]})}function ab({loadPreferences:s,updatePreference:r,clearData:u,exportData:o,getEngine:f,setEngine:m}){const[p,x]=h.useState(null),[y,g]=h.useState(!0),[b,j]=h.useState(!1),[S,T]=h.useState(!1),[A,D]=h.useState(""),[O,E]=h.useState(!1);h.useEffect(()=>{s().then(te=>{x(te),g(!1)}).catch(()=>g(!1)),f&&f().then(te=>E(te==="the-architect")).catch(()=>{})},[s,f]);const R=h.useCallback(async()=>{if(!m)return;j(!0);const te=O?"standard":"the-architect";try{await m(te),E(!O),D(te==="the-architect"?"Architect engine enabled":"Architect engine disabled"),setTimeout(()=>D(""),3e3)}finally{j(!1)}},[O,m]),_=h.useCallback(async(te,ce)=>{if(p){j(!0);try{await r(te,ce),x({...p,[te]:ce})}finally{j(!1)}}},[p,r]),K=h.useCallback(async te=>{if(!p)return;j(!0);const ce=te==="auto"?null:te;try{await r("defaultContext",ce),x({...p,defaultContext:ce})}finally{j(!1)}},[p,r]),Q=h.useCallback(async()=>{j(!0);try{await u(),x(await s()),T(!1),D("Learning data cleared"),setTimeout(()=>D(""),3e3)}finally{j(!1)}},[u,s]),Z=h.useCallback(async()=>{try{const te=await o(),ce=new Blob([te],{type:"application/json"}),ie=URL.createObjectURL(ce),he=document.createElement("a");he.href=ie,he.download=`architect-data-${new Date().toISOString().slice(0,10)}.json`,he.click(),URL.revokeObjectURL(ie),D("Data exported"),setTimeout(()=>D(""),3e3)}catch{D("Export failed"),setTimeout(()=>D(""),3e3)}},[o]);if(y)return null;if(!p)return n.jsx("div",{className:"error",children:"Failed to load preferences"});const F=p.totalInteractions,Y=Object.entries(p.contextUsageHistory).filter(([,te])=>te>0).sort(([,te],[,ce])=>ce-te);return n.jsxs("div",{className:"settings-form",children:[A&&n.jsx("div",{className:"settings-success",role:"status",children:A}),m&&n.jsxs("div",{className:"settings-section",children:[n.jsx("h3",{children:"Engine"}),n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[n.jsx("div",{className:`toggle${O?" active":""}`,onClick:()=>!b&&R(),style:b?{opacity:.5,pointerEvents:"none"}:void 0}),n.jsx("span",{style:{fontSize:"0.85rem",color:"var(--text-primary)"},children:O?"Architect engine enabled (global default)":"Architect engine disabled"})]}),n.jsx("p",{style:{fontSize:"0.8rem",color:"var(--text-secondary)",marginTop:"0.5rem"},children:"Controls the default personality for new chats. Individual chats can override this."})]}),n.jsxs("div",{className:"settings-section",children:[n.jsx("h3",{children:"Display"}),n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem",marginBottom:"0.75rem"},children:[n.jsx("div",{className:`toggle${p.showContextIndicator?" active":""}`,onClick:()=>!b&&_("showContextIndicator",!p.showContextIndicator),style:b?{opacity:.5,pointerEvents:"none"}:void 0}),n.jsx("span",{style:{fontSize:"0.85rem",color:"var(--text-primary)"},children:"Show context indicator"})]}),n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem",marginBottom:"0.75rem"},children:[n.jsx("div",{className:`toggle${p.showSourcesButton?" active":""}`,onClick:()=>!b&&_("showSourcesButton",!p.showSourcesButton),style:b?{opacity:.5,pointerEvents:"none"}:void 0}),n.jsx("span",{style:{fontSize:"0.85rem",color:"var(--text-primary)"},children:"Show sources button"})]}),n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[n.jsx("div",{className:`toggle${p.autoDetectContext?" active":""}`,onClick:()=>!b&&_("autoDetectContext",!p.autoDetectContext),style:b?{opacity:.5,pointerEvents:"none"}:void 0}),n.jsx("span",{style:{fontSize:"0.85rem",color:"var(--text-primary)"},children:"Auto-detect context"})]})]}),n.jsxs("div",{className:"settings-section",children:[n.jsx("h3",{children:"Default Context"}),n.jsx("label",{children:"Context domain"}),n.jsxs("select",{value:p.defaultContext??"auto",onChange:te=>K(te.target.value),disabled:b,children:[n.jsx("option",{value:"auto",children:"Auto (detect from message)"}),Nn.map(te=>n.jsxs("option",{value:te,children:[_t[te].icon," ",_t[te].label]},te))]})]}),n.jsxs("div",{className:"settings-section",children:[n.jsx("h3",{children:"Detection Stats"}),n.jsx("div",{className:"status-grid",style:{marginBottom:"1rem"},children:n.jsxs("div",{className:"status-card",children:[n.jsx("h3",{children:"Total"}),n.jsx("div",{className:"value",children:F}),n.jsx("div",{className:"sub",children:"interactions"})]})}),Y.length>0&&n.jsx("div",{className:"domain-stats-list",children:Y.map(([te,ce])=>{var oe,ve,H;const ie=F>0?Math.round(ce/F*100):0,he=((oe=Y[0])==null?void 0:oe[1])??1,ee=Math.max(4,Math.round(ce/he*100));return n.jsxs("div",{className:"domain-stat-row",children:[n.jsxs("span",{className:"domain-stat-label",children:[(ve=_t[te])==null?void 0:ve.icon," ",((H=_t[te])==null?void 0:H.label)??te]}),n.jsx("span",{className:"domain-stat-bar-track",children:n.jsx("span",{className:"domain-stat-bar-fill",style:{width:`${ee}%`}})}),n.jsx("span",{className:"domain-stat-count",children:ce}),n.jsxs("span",{className:"domain-stat-pct",children:[ie,"%"]})]},te)})}),Y.length===0&&n.jsx("p",{style:{fontSize:"0.85rem",color:"var(--text-secondary)"},children:"No interactions recorded yet. Context stats will appear here as you use The Architect."})]}),n.jsxs("div",{className:"settings-section",style:{borderBottom:"none"},children:[n.jsx("h3",{children:"Data Management"}),n.jsxs("div",{style:{display:"flex",gap:"0.5rem",flexWrap:"wrap",alignItems:"center"},children:[S?n.jsxs(n.Fragment,{children:[n.jsx("span",{style:{fontSize:"0.85rem",color:"var(--danger)",marginRight:"0.25rem"},children:"Clear all learning data? This cannot be undone."}),n.jsx("button",{className:"btn-sm btn-danger",onClick:Q,disabled:b,children:"Confirm"}),n.jsx("button",{className:"btn-sm",onClick:()=>T(!1),disabled:b,children:"Cancel"})]}):n.jsx("button",{className:"btn-sm btn-danger",onClick:()=>T(!0),disabled:b,children:"Clear learning data"}),n.jsx("button",{className:"btn-sm",onClick:Z,disabled:b,children:"Export data"})]})]})]})}function Jm(){return n.jsxs("div",{className:"page",children:[n.jsx("h2",{children:"The Architect"}),n.jsx(ab,{loadPreferences:async()=>(await I.getArchitectPreferences()).data,updatePreference:async(s,r)=>{await I.updateArchitectPreference(s,r)},clearData:async()=>{await I.clearArchitectData()},exportData:async()=>(await I.exportArchitectData()).data,getEngine:async()=>(await I.getPersonalityEngine()).data.engine,setEngine:async s=>{await I.setPersonalityEngine(s)}})]})}function Zi(s){return new Date(s).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function lb(s){return new Date(s).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function nb({trend:s}){return s==="improving"?n.jsx("span",{className:"up-trend-arrow",children:"▲"}):s==="declining"?n.jsx("span",{className:"up-trend-decline",children:"▼"}):n.jsx("span",{className:"up-trend-flat",children:"▬"})}function Wm(){const[s,r]=h.useState(null),[u,o]=h.useState(!0),[f,m]=h.useState(null);function p(){o(!0),m(null),I.getUserModel().then(y=>{r(y),o(!1)}).catch(y=>{const g=y instanceof Error?y.message:String(y);g.includes("not available")||g.includes("404")?m("Not enough data yet. Keep chatting and check back later!"):m(g),o(!1)})}if(h.useEffect(()=>{p()},[]),u)return n.jsx("div",{className:"up-page",children:n.jsx("div",{className:"up-loading",children:"Loading user profile..."})});if(f)return n.jsxs("div",{className:"up-page",children:[n.jsx("div",{className:"up-header",children:n.jsx("h2",{className:"up-title",children:"What do you know about me?"})}),n.jsx("div",{className:"up-empty",children:f})]});if(!s)return null;const x=Date.now();return n.jsxs("div",{className:"up-page",children:[n.jsxs("div",{className:"up-header",children:[n.jsx("h2",{className:"up-title",children:"What do you know about me?"}),n.jsxs("div",{className:"up-header-right",children:[n.jsxs("span",{className:"up-synthesized",children:["Synthesized ",lb(s.synthesizedAt)]}),n.jsx("button",{className:"up-refresh-btn",onClick:p,children:"Refresh"})]})]}),s.narrative&&n.jsx("section",{className:"up-section",children:n.jsx("p",{className:"up-narrative",children:s.narrative})}),s.topDomains&&s.topDomains.length>0&&n.jsxs("section",{className:"up-section",children:[n.jsx("h3",{className:"up-section-title",children:"Domain Expertise"}),n.jsx("div",{className:"up-domain-grid",children:s.topDomains.map(y=>n.jsxs("div",{className:"up-domain-card",children:[n.jsx("div",{className:"up-domain-name",children:y.domain}),n.jsx("div",{className:"up-domain-bar-track",children:n.jsx("div",{className:"up-domain-bar-fill",style:{width:`${Math.round(y.share*100)}%`}})}),n.jsxs("div",{className:"up-domain-stats",children:[n.jsxs("span",{className:"up-domain-share",children:[Math.round(y.share*100),"%"]}),y.satisfactionRate!==null&&n.jsxs("span",{className:"up-domain-satisfaction",children:[Math.round(y.satisfactionRate*100),"% satisfied"]})]})]},y.domain))})]}),s.communicationStyle&&n.jsxs("section",{className:"up-section",children:[n.jsx("h3",{className:"up-section-title",children:"Communication Style"}),n.jsxs("div",{className:"up-comm-labels",children:[n.jsx("span",{className:"up-comm-badge",children:s.communicationStyle.verbosityLabel}),n.jsx("span",{className:"up-comm-badge",children:s.communicationStyle.toneLabel})]}),n.jsx("div",{className:"up-comm-bars",children:[{label:"Verbosity",value:s.communicationStyle.verbosityPreference},{label:"Warmth",value:s.communicationStyle.warmthPreference},{label:"Humor",value:s.communicationStyle.humorPreference}].map(y=>n.jsxs("div",{className:"up-comm-row",children:[n.jsx("span",{className:"up-comm-label",children:y.label}),n.jsx("div",{className:"up-comm-track",children:n.jsx("div",{className:"up-comm-fill",style:{width:`${Math.round(Math.min(1,Math.max(0,y.value))*100)}%`}})}),n.jsx("span",{className:"up-comm-value",children:y.value.toFixed(2)})]},y.label))})]}),s.satisfaction&&n.jsxs("section",{className:"up-section",children:[n.jsx("h3",{className:"up-section-title",children:"Satisfaction"}),n.jsxs("div",{className:"up-satisfaction-header",children:[n.jsx(nb,{trend:s.satisfaction.overallTrend}),n.jsx("span",{className:"up-satisfaction-trend",children:s.satisfaction.overallTrend}),n.jsxs("span",{className:"up-satisfaction-count",children:[s.satisfaction.totalFeedback," feedback items"]})]}),s.satisfaction.strongDomains.length>0&&n.jsxs("div",{className:"up-satisfaction-group",children:[n.jsx("span",{className:"up-satisfaction-label",children:"Strong:"}),s.satisfaction.strongDomains.map(y=>n.jsx("span",{className:"up-tag up-tag-strong",children:y},y))]}),s.satisfaction.weakDomains.length>0&&n.jsxs("div",{className:"up-satisfaction-group",children:[n.jsx("span",{className:"up-satisfaction-label",children:"Needs work:"}),s.satisfaction.weakDomains.map(y=>n.jsx("span",{className:"up-tag up-tag-weak",children:y},y))]})]}),s.activeDecisions&&s.activeDecisions.length>0&&n.jsxs("section",{className:"up-section",children:[n.jsx("h3",{className:"up-section-title",children:"Active Decisions"}),n.jsx("div",{className:"up-decision-list",children:s.activeDecisions.map(y=>n.jsxs("div",{className:"up-decision-card",children:[n.jsx("div",{className:"up-decision-summary",children:y.summary}),n.jsxs("div",{className:"up-decision-meta",children:[n.jsx("span",{className:"up-decision-date",children:Zi(y.createdAt)}),y.tags.map(g=>n.jsx("span",{className:"up-tag",children:g},g))]})]},y.id))})]}),s.dueFollowUps&&s.dueFollowUps.length>0&&n.jsxs("section",{className:"up-section",children:[n.jsx("h3",{className:"up-section-title",children:"Due Follow-ups"}),n.jsx("div",{className:"up-decision-list",children:s.dueFollowUps.map(y=>{const g=y.followUpDate&&y.followUpDate<x;return n.jsxs("div",{className:`up-decision-card ${g?"up-overdue":""}`,children:[n.jsxs("div",{className:"up-decision-summary",children:[g&&n.jsx("span",{className:"up-overdue-badge",children:"Overdue"}),y.summary]}),n.jsxs("div",{className:"up-decision-meta",children:[y.followUpDate&&n.jsxs("span",{className:"up-decision-date",children:["Due ",Zi(y.followUpDate)]}),y.tags.map(b=>n.jsx("span",{className:"up-tag",children:b},b))]})]},y.id)})})]}),s.correctionSummary&&s.correctionSummary.totalCorrections>0&&n.jsxs("section",{className:"up-section",children:[n.jsx("h3",{className:"up-section-title",children:"Correction Patterns"}),n.jsxs("div",{className:"up-corrections-total",children:[s.correctionSummary.totalCorrections," total corrections"]}),s.correctionSummary.topPatterns.length>0&&n.jsx("div",{className:"up-corrections-list",children:s.correctionSummary.topPatterns.map((y,g)=>n.jsxs("div",{className:"up-correction-row",children:[n.jsx("span",{className:"up-correction-from",children:y.from}),n.jsx("span",{className:"up-correction-arrow",children:"→"}),n.jsx("span",{className:"up-correction-to",children:y.to}),n.jsxs("span",{className:"up-correction-count",children:[y.count,"x"]})]},g))})]}),n.jsxs("footer",{className:"up-footer",children:[n.jsxs("div",{className:"up-stat",children:[n.jsx("span",{className:"up-stat-label",children:"Interactions"}),n.jsx("span",{className:"up-stat-value",children:s.totalInteractions})]}),n.jsxs("div",{className:"up-stat",children:[n.jsx("span",{className:"up-stat-label",children:"First used"}),n.jsx("span",{className:"up-stat-value",children:Zi(s.firstUsed)})]}),n.jsxs("div",{className:"up-stat",children:[n.jsx("span",{className:"up-stat-label",children:"Last used"}),n.jsx("span",{className:"up-stat-value",children:Zi(s.lastUsed)})]})]})]})}const Ua={dnd:{enabled:!1,schedule:{start:"22:00",end:"08:00"}},urgencyKeywords:[],sources:{email:!0,calendar:!0,github:!0},soundEnabled:!0};function Fm(){const{data:s,loading:r}=ut(()=>I.getNotificationPreferences(),[]),{data:u,loading:o}=ut(()=>I.getNotifications(),[]),[f,m]=h.useState(Ua),[p,x]=h.useState([]),[y,g]=h.useState(!1),[b,j]=h.useState(""),[S,T]=h.useState(""),[A,D]=h.useState("");h.useEffect(()=>{var R,_,K,Q,Z,F,Y,te;if(s!=null&&s.data&&Object.keys(s.data).length>0){const ce=s.data,ie={dnd:{enabled:((R=ce.dnd)==null?void 0:R.enabled)??Ua.dnd.enabled,schedule:{start:((K=(_=ce.dnd)==null?void 0:_.schedule)==null?void 0:K.start)??Ua.dnd.schedule.start,end:((Z=(Q=ce.dnd)==null?void 0:Q.schedule)==null?void 0:Z.end)??Ua.dnd.schedule.end}},urgencyKeywords:ce.urgencyKeywords??Ua.urgencyKeywords,sources:{email:((F=ce.sources)==null?void 0:F.email)??Ua.sources.email,calendar:((Y=ce.sources)==null?void 0:Y.calendar)??Ua.sources.calendar,github:((te=ce.sources)==null?void 0:te.github)??Ua.sources.github},soundEnabled:ce.soundEnabled??Ua.soundEnabled};m(ie),D((ie.urgencyKeywords||[]).join(", "))}},[s]),h.useEffect(()=>{u!=null&&u.data&&x(u.data)},[u]);const O=async()=>{g(!0),T(""),j("");try{const R=A.split(",").map(_=>_.trim()).filter(Boolean);await I.updateNotificationPreferences({...f,urgencyKeywords:R}),j("Notification settings saved successfully")}catch(R){T(R instanceof Error?R.message:"Failed to save settings")}finally{g(!1)}},E=async R=>{try{await I.dismissNotification(R),x(_=>_.filter(K=>K.id!==R))}catch{}};return r||o?null:n.jsxs("div",{className:"page",children:[n.jsx("h2",{children:"Notification Settings"}),n.jsxs("div",{className:"settings-form",children:[n.jsxs("div",{className:"settings-section",children:[n.jsx("h3",{children:"Do Not Disturb"}),n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem",marginBottom:"1rem"},children:[n.jsx("div",{className:`toggle${f.dnd.enabled?" active":""}`,onClick:()=>m(R=>({...R,dnd:{...R.dnd,enabled:!R.dnd.enabled}}))}),n.jsx("span",{style:{fontSize:"0.85rem",color:"var(--text-secondary)"},children:f.dnd.enabled?"Enabled":"Disabled"})]}),f.dnd.enabled&&n.jsxs("div",{style:{display:"flex",gap:"1rem",alignItems:"center",marginBottom:"1rem"},children:[n.jsxs("div",{children:[n.jsx("label",{children:"Start"}),n.jsx("input",{type:"time",value:f.dnd.schedule.start,onChange:R=>m(_=>({..._,dnd:{..._.dnd,schedule:{..._.dnd.schedule,start:R.target.value}}}))})]}),n.jsxs("div",{children:[n.jsx("label",{children:"End"}),n.jsx("input",{type:"time",value:f.dnd.schedule.end,onChange:R=>m(_=>({..._,dnd:{..._.dnd,schedule:{..._.dnd.schedule,end:R.target.value}}}))})]})]})]}),n.jsxs("div",{className:"settings-section",children:[n.jsx("h3",{children:"Urgency Keywords"}),n.jsx("label",{children:"Comma-separated keywords that mark a notification as urgent"}),n.jsx("textarea",{rows:3,value:A,onChange:R=>D(R.target.value),placeholder:"urgent, critical, deadline, asap",style:{width:"100%",resize:"vertical"}})]}),n.jsxs("div",{className:"settings-section",children:[n.jsx("h3",{children:"Sources"}),n.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"0.5rem",marginBottom:"1rem"},children:["email","calendar","github"].map(R=>n.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"0.4rem",cursor:"pointer",fontSize:"0.85rem"},children:[n.jsx("input",{type:"checkbox",checked:f.sources[R],onChange:()=>m(_=>({..._,sources:{..._.sources,[R]:!_.sources[R]}})),style:{width:"auto",marginBottom:0}}),R.charAt(0).toUpperCase()+R.slice(1)]},R))})]}),n.jsxs("div",{className:"settings-section",children:[n.jsx("h3",{children:"Sound"}),n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem",marginBottom:"1rem"},children:[n.jsx("div",{className:`toggle${f.soundEnabled?" active":""}`,onClick:()=>m(R=>({...R,soundEnabled:!R.soundEnabled}))}),n.jsx("span",{style:{fontSize:"0.85rem",color:"var(--text-secondary)"},children:f.soundEnabled?"Enabled":"Disabled"})]})]}),n.jsx("button",{className:"settings-btn",onClick:O,disabled:y,children:y?"Saving...":"Save Settings"}),b&&n.jsx("div",{className:"settings-success",children:b}),S&&n.jsx("div",{className:"error",children:S}),p.length>0&&n.jsxs("div",{className:"settings-section",style:{marginTop:"2rem"},children:[n.jsx("h3",{children:"Recent Notifications"}),n.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.5rem"},children:p.map(R=>n.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"0.75rem",background:"var(--bg-secondary, #1a1a2e)",borderRadius:"6px"},children:[n.jsxs("div",{children:[n.jsx("div",{style:{fontWeight:500},children:R.title}),n.jsxs("div",{style:{fontSize:"0.8rem",color:"var(--text-secondary)"},children:[R.source," · ",new Date(R.timestamp).toLocaleString()]})]}),n.jsx("button",{className:"settings-btn",style:{padding:"0.25rem 0.75rem",fontSize:"0.8rem"},onClick:()=>E(R.id),children:"Dismiss"})]},R.id))})]})]})]})}const sb=["","behavior.","webhook.","voice.","system.","auth.","dashboard."];function Pm(){const[s,r]=h.useState(""),{data:u,refresh:o}=ut(()=>I.getAudit({type:s||void 0,limit:200}),[s]);Os(o);const f=(u==null?void 0:u.data)??[],m=[{key:"timestamp",label:"Time",render:p=>new Date(p.timestamp).toLocaleString()},{key:"event",label:"Event"},{key:"details",label:"Details",render:p=>JSON.stringify(p.details).slice(0,80)}];return n.jsxs("div",{className:"page",children:[n.jsx("h2",{children:"Audit Log"}),n.jsx("div",{className:"filters",children:n.jsxs("select",{value:s,onChange:p=>r(p.target.value),children:[n.jsx("option",{value:"",children:"All events"}),sb.filter(Boolean).map(p=>n.jsxs("option",{value:p,children:[p,"*"]},p))]})}),n.jsx(Hm,{columns:m,rows:f,keyField:"sequence"})]})}function ib({rating:s}){const r=Math.floor(s),u=s-r>=.5,o=5-r-(u?1:0);return n.jsxs("span",{className:"marketplace-card-rating",title:`${s.toFixed(1)} / 5`,children:["★".repeat(r),u?"½":"","☆".repeat(o)]})}function cb({item:s,onSelect:r,onInstall:u}){return n.jsxs("div",{className:"marketplace-card glass-mid",onClick:()=>r(s),children:[n.jsxs("div",{className:"marketplace-card-header",children:[n.jsx("span",{className:"marketplace-card-name",children:s.name}),n.jsxs("span",{className:"marketplace-card-version",children:["v",s.version]})]}),n.jsx("p",{className:"marketplace-card-author",children:s.author}),n.jsx("p",{className:"marketplace-card-desc",children:s.description}),n.jsxs("div",{className:"marketplace-card-footer",children:[n.jsxs("span",{className:"marketplace-card-stats",children:[n.jsx(ib,{rating:s.rating}),n.jsxs("span",{className:"marketplace-card-downloads",children:["↓"," ",s.downloads.toLocaleString()]})]}),n.jsx("button",{className:"marketplace-card-install",onClick:o=>{o.stopPropagation(),u(s)},children:"Install"})]})]})}function rb({item:s,onClose:r,onInstall:u}){return n.jsxs("div",{className:"marketplace-detail glass-mid",children:[n.jsxs("div",{className:"marketplace-detail-header",children:[n.jsxs("div",{children:[n.jsx("span",{className:"marketplace-detail-name",children:s.name}),n.jsxs("span",{className:"marketplace-detail-version",children:["v",s.version]})]}),n.jsxs("span",{className:"marketplace-detail-author",children:["by ",s.author]})]}),n.jsxs("div",{className:"marketplace-detail-stats",children:[n.jsxs("span",{children:["★".repeat(Math.floor(s.rating)),"☆".repeat(5-Math.floor(s.rating))," (",s.rating.toFixed(1),")"]}),n.jsxs("span",{children:["↓ ",s.downloads.toLocaleString()," downloads"]})]}),n.jsx("p",{className:"marketplace-detail-desc",children:s.description}),s.preview&&n.jsx("p",{className:"marketplace-detail-preview",children:s.preview}),s.tone&&n.jsxs("div",{className:"marketplace-detail-tone",children:[n.jsxs("span",{children:["Warmth: ",s.tone.warmth]}),n.jsxs("span",{children:["Humor: ",s.tone.humor]}),n.jsxs("span",{children:["Formality: ",s.tone.formality]})]}),n.jsxs("div",{className:"marketplace-detail-meta",children:[s.permissions&&s.permissions.length>0&&n.jsxs("div",{children:[n.jsx("strong",{children:"Permissions:"})," ",s.permissions.join(", ")]}),s.keywords&&s.keywords.length>0&&n.jsxs("div",{children:[n.jsx("strong",{children:"Keywords:"})," ",s.keywords.join(", ")]}),s.license&&n.jsxs("div",{children:[n.jsx("strong",{children:"License:"})," ",s.license]})]}),n.jsxs("div",{className:"marketplace-detail-actions",children:[n.jsx("button",{className:"btn-primary",onClick:()=>u(s),children:"Install"}),n.jsx("button",{className:"btn-secondary",onClick:r,children:"Close"})]})]})}function ub(){const[s,r]=h.useState("plugins"),[u,o]=h.useState(""),[f,m]=h.useState("downloads"),[p,x]=h.useState([]),[y,g]=h.useState([]),[b,j]=h.useState(0),[S,T]=h.useState(0),[A,D]=h.useState(null),[O,E]=h.useState(!1),R=18,_=h.useCallback(async()=>{E(!0);try{if(s==="plugins"){const Y=await I.searchPlugins({q:u||void 0,sort:f,limit:R,offset:S});x(Y.plugins),j(Y.total)}else{const Y=await I.searchPersonalities({q:u||void 0,sort:f,limit:R,offset:S});g(Y.personalities),j(Y.total)}}catch{}E(!1)},[s,u,f,S]);h.useEffect(()=>{_()},[_]);const K=async Y=>{try{s==="plugins"?await I.installPlugin(Y.name,Y.version):await I.installPersonality(Y.name,Y.version),_()}catch{}},Q=s==="plugins"?p:y,Z=Math.ceil(b/R),F=Math.floor(S/R)+1;return n.jsxs("div",{className:"marketplace",children:[n.jsxs("div",{className:"marketplace-toolbar",children:[n.jsxs("div",{className:"marketplace-tabs",children:[n.jsx("button",{className:`marketplace-tab ${s==="plugins"?"active":""}`,onClick:()=>{r("plugins"),T(0)},children:"Plugins"}),n.jsx("button",{className:`marketplace-tab ${s==="personalities"?"active":""}`,onClick:()=>{r("personalities"),T(0)},children:"Personalities"})]}),n.jsx("input",{className:"marketplace-search",type:"text",placeholder:"Search...",value:u,onChange:Y=>{o(Y.target.value),T(0)}})]}),O?n.jsx("div",{className:"marketplace-loading",children:"Loading..."}):n.jsxs("div",{className:"marketplace-grid",children:[Q.map(Y=>n.jsx(cb,{item:Y,onSelect:D,onInstall:K},Y.name)),Q.length===0&&n.jsx("div",{className:"marketplace-empty",children:"No results found."})]}),n.jsxs("div",{className:"marketplace-footer",children:[n.jsxs("select",{className:"marketplace-sort",value:f,onChange:Y=>m(Y.target.value),children:[n.jsx("option",{value:"downloads",children:"Downloads"}),n.jsx("option",{value:"rating",children:"Rating"}),n.jsx("option",{value:"name",children:"Name"}),n.jsx("option",{value:"updated",children:"Recently Updated"})]}),Z>1&&n.jsxs("div",{className:"marketplace-pagination",children:[n.jsx("button",{disabled:S===0,onClick:()=>T(Math.max(0,S-R)),children:"Prev"}),n.jsxs("span",{children:["Page ",F," of ",Z]}),n.jsx("button",{disabled:F>=Z,onClick:()=>T(S+R),children:"Next"})]})]}),A&&n.jsx("div",{className:"marketplace-overlay",onClick:()=>D(null),children:n.jsx("div",{onClick:Y=>Y.stopPropagation(),children:n.jsx(rb,{item:A,onClose:()=>D(null),onInstall:K})})})]})}function ob(){const[s,r]=h.useState([]),[u,o]=h.useState(null),[f,m]=h.useState(null),[p,x]=h.useState("unknown"),[y,g]=h.useState(!0);if(h.useEffect(()=>{Promise.all([I.getModels(),I.getHealthState()]).then(([j,S])=>{var A,D,O;r(j.providers),o(j.routing),m(j.cost);const T=(D=(A=S.data)==null?void 0:A.subsystems)==null?void 0:D.find(E=>E.name==="providers");x((T==null?void 0:T.status)??((O=S.data)==null?void 0:O.overall)??"unknown")}).catch(()=>{}).finally(()=>g(!1))},[]),y)return n.jsx("div",{className:"provider-health",children:n.jsx("p",{children:"Loading..."})});const b=p==="healthy"?"status-dot-green":p==="degraded"?"status-dot-yellow":"status-dot-red";return n.jsxs("div",{className:"provider-health",children:[n.jsxs("div",{className:"provider-health-header",children:[n.jsx("h3",{children:"Providers"}),n.jsx("span",{className:b})," ",n.jsx("span",{className:"provider-health-status",children:p})]}),n.jsx("div",{className:"provider-health-grid",children:s.map(j=>n.jsxs("div",{className:"provider-health-card glass-mid",children:[n.jsxs("div",{className:"provider-health-card-header",children:[n.jsx("strong",{children:j.displayName}),(u==null?void 0:u.primary)===j.name&&n.jsx("span",{className:"badge badge-green",children:"Primary"}),(u==null?void 0:u.fallback)===j.name&&n.jsx("span",{className:"badge badge-yellow",children:"Fallback"})]}),n.jsxs("div",{className:"provider-health-card-models",children:[Object.keys(j.models).length," model",Object.keys(j.models).length!==1?"s":"",Object.values(j.models).some(S=>S.isLocal)&&n.jsx("span",{className:"badge badge-gray",children:"Local"})]})]},j.name))}),f&&n.jsxs("div",{className:"provider-health-cost",children:[n.jsxs("div",{className:"provider-health-cost-item",children:[n.jsx("span",{className:"provider-health-cost-label",children:"Today"}),n.jsxs("span",{className:`provider-health-cost-value ${f.isOverBudget?"cost-over":""}`,children:["$",f.today.toFixed(2)]})]}),n.jsxs("div",{className:"provider-health-cost-item",children:[n.jsx("span",{className:"provider-health-cost-label",children:"This month"}),n.jsxs("span",{className:"provider-health-cost-value",children:["$",f.thisMonth.toFixed(2)]})]}),f.budgetRemaining!=null&&n.jsxs("div",{className:"provider-health-cost-item",children:[n.jsx("span",{className:"provider-health-cost-label",children:"Budget left"}),n.jsxs("span",{className:`provider-health-cost-value ${f.warningThresholdReached?"cost-warning":""}`,children:["$",f.budgetRemaining.toFixed(2)]})]})]})]})}function db(){const[s,r]=h.useState(null),[u,o]=h.useState([]),[f,m]=h.useState(!0),p=h.useCallback(async()=>{try{const[y,g]=await Promise.all([I.getJobStats(),I.getJobList({status:"dead",limit:50})]);r(y),o(g.data)}catch{}m(!1)},[]);h.useEffect(()=>{p()},[p]);const x=async y=>{try{await I.retryJob(y),p()}catch{}};return f?n.jsx("div",{className:"dlq-monitor",children:n.jsx("p",{children:"Loading..."})}):n.jsxs("div",{className:"dlq-monitor",children:[n.jsxs("div",{className:"dlq-header",children:[n.jsx("h3",{children:"Job Queue"}),n.jsx("button",{className:"dlq-refresh",onClick:p,children:"Refresh"})]}),s&&n.jsxs("div",{className:"dlq-stats",children:[n.jsxs("span",{className:"dlq-stat",children:[s.pending," pending"]}),n.jsxs("span",{className:"dlq-stat",children:[s.running," running"]}),n.jsxs("span",{className:"dlq-stat",children:[s.completed24h," completed (24h)"]}),n.jsxs("span",{className:"dlq-stat dlq-stat-warn",children:[s.failed24h," failed (24h)"]}),n.jsxs("span",{className:`dlq-stat ${s.dead>0?"dlq-stat-danger":""}`,children:[s.dead," dead"]})]}),u.length>0&&n.jsxs("div",{className:"dlq-list",children:[n.jsx("h4",{children:"Dead Jobs"}),n.jsxs("table",{className:"dlq-table",children:[n.jsx("thead",{children:n.jsxs("tr",{children:[n.jsx("th",{children:"Type"}),n.jsx("th",{children:"Error"}),n.jsx("th",{children:"Attempts"}),n.jsx("th",{children:"Age"}),n.jsx("th",{})]})}),n.jsx("tbody",{children:u.map(y=>n.jsxs("tr",{children:[n.jsx("td",{children:y.type}),n.jsx("td",{className:"dlq-error",children:String(y.result??"unknown")}),n.jsxs("td",{children:[y.attempt,"/",y.maxAttempts]}),n.jsx("td",{children:fb(y.createdAt)}),n.jsx("td",{children:n.jsx("button",{className:"dlq-retry-btn",onClick:()=>x(y.id),children:"Retry"})})]},y.id))})]})]}),u.length===0&&s&&s.dead===0&&n.jsx("p",{className:"dlq-empty",children:"No dead jobs. All clear."})]})}function fb(s){const r=Date.now()-s;return r<6e4?"<1m":r<36e5?`${Math.floor(r/6e4)}m`:r<864e5?`${Math.floor(r/36e5)}h`:`${Math.floor(r/864e5)}d`}function hb(){const[s,r]=h.useState([]),[u,o]=h.useState(!0),[f,m]=h.useState(null);if(h.useEffect(()=>{tx().then(g=>r(g.features)).catch(g=>m(g instanceof Error?g.message:String(g))).finally(()=>o(!1))},[]),u)return n.jsx("div",{className:"system-status",children:n.jsx("p",{children:"Loading..."})});if(f)return n.jsx("div",{className:"system-status",children:n.jsxs("p",{children:["Error: ",f]})});const p=s.filter(g=>g.enabled&&g.configured&&g.active),x=s.filter(g=>g.enabled&&!g.configured),y=s.filter(g=>!g.enabled);return n.jsxs("div",{className:"system-status",children:[n.jsx("h2",{children:"System Status"}),n.jsx(ob,{}),n.jsx(db,{}),n.jsxs("section",{className:"status-section-active",children:[n.jsxs("h3",{children:["Active (",p.length,")"]}),n.jsxs("div",{className:"status-grid",children:[p.map(g=>n.jsxs("div",{className:"status-card",children:[n.jsx("span",{className:"status-dot-green"}),n.jsxs("div",{className:"status-card-info",children:[n.jsx("strong",{children:g.name}),n.jsx("span",{className:"status-card-category",children:g.category})]})]},g.id)),p.length===0&&n.jsx("p",{className:"status-empty",children:"No active features"})]})]}),n.jsxs("section",{className:"status-section-ready",children:[n.jsxs("h3",{children:["Ready (",x.length,")"]}),n.jsxs("div",{className:"status-grid",children:[x.map(g=>n.jsxs("div",{className:"status-card",children:[n.jsx("span",{className:"status-dot-yellow"}),n.jsxs("div",{className:"status-card-info",children:[n.jsx("strong",{children:g.name}),n.jsx("span",{className:"status-card-category",children:g.category})]}),n.jsx("button",{className:"status-configure-btn",children:"Configure"})]},g.id)),x.length===0&&n.jsx("p",{className:"status-empty",children:"No features awaiting configuration"})]})]}),n.jsxs("section",{className:"status-section-available",children:[n.jsxs("h3",{children:["Available (",y.length,")"]}),n.jsxs("div",{className:"status-grid",children:[y.map(g=>n.jsxs("div",{className:"status-card",children:[n.jsx("span",{className:"status-dot-gray"}),n.jsxs("div",{className:"status-card-info",children:[n.jsx("strong",{children:g.name}),n.jsx("span",{className:"status-card-category",children:g.category})]})]},g.id)),y.length===0&&n.jsx("p",{className:"status-empty",children:"All features are enabled"})]})]})]})}const mb=["all","preference","fact","context","relationship","pattern","personality"],pb={preference:"mm-badge-accent",fact:"mm-badge-blue",context:"mm-badge-gray",relationship:"mm-badge-green",pattern:"mm-badge-amber",personality:"mm-badge-purple"};function am(s){return new Date(s).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Im(){const[s,r]=h.useState([]),[u,o]=h.useState(!0),[f,m]=h.useState(null),[p,x]=h.useState(""),[y,g]=h.useState("all"),[b,j]=h.useState(null),[S,T]=h.useState(null),[A,D]=h.useState(""),[O,E]=h.useState(0),[R,_]=h.useState(""),[K,Q]=h.useState(null),[Z,F]=h.useState(""),[Y,te]=h.useState(null),[ce,ie]=h.useState(!1),he=h.useCallback(()=>{o(!0),m(null);const P=y==="all"?void 0:y;(p?I.searchMemories(p):I.getMemories(P)).then(C=>{r(C.data),o(!1)}).catch(C=>{m(C instanceof Error?C.message:String(C)),o(!1)})},[y,p]);h.useEffect(()=>{he()},[he]);function ee(P){T(P.id),D(P.content),E(P.importance),_(P.tags.join(", "))}function oe(){T(null)}function ve(P){const de=R.split(",").map(C=>C.trim()).filter(Boolean);I.updateMemory(P,{content:A,importance:O,tags:de}).then(()=>{T(null),he()}).catch(C=>m(C instanceof Error?C.message:String(C)))}function H(P){I.deleteMemory(P).then(()=>{Q(null),he()}).catch(de=>m(de instanceof Error?de.message:String(de)))}function J(){Z.trim()&&(ie(!0),te(null),I.forgetTopic(Z.trim()).then(P=>{te(`Removed ${P.removed.memories} memories and ${P.removed.decisions} decisions.`),F(""),ie(!1),he()}).catch(P=>{te(P instanceof Error?P.message:String(P)),ie(!1)}))}function ne(){I.exportPersonalization().then(P=>{const de=new Blob([JSON.stringify(P,null,2)],{type:"application/json"}),C=URL.createObjectURL(de),L=document.createElement("a");L.href=C,L.download=`auxiora-export-${Date.now()}.json`,L.click(),URL.revokeObjectURL(C)}).catch(P=>m(P instanceof Error?P.message:String(P)))}return u?n.jsx("div",{className:"mm-page",children:n.jsx("div",{className:"mm-loading",children:"Loading memories..."})}):f?n.jsxs("div",{className:"mm-page",children:[n.jsx("div",{className:"mm-header",children:n.jsx("h2",{className:"mm-title",children:"Memories"})}),n.jsx("div",{className:"mm-error",children:f})]}):n.jsxs("div",{className:"mm-page",children:[n.jsxs("div",{className:"mm-header",children:[n.jsx("h2",{className:"mm-title",children:"Memories"}),n.jsx("input",{className:"mm-search",type:"text",placeholder:"Search memories...",value:p,onChange:P=>x(P.target.value)}),n.jsx("select",{className:"mm-filter",value:y,onChange:P=>g(P.target.value),children:mb.map(P=>n.jsx("option",{value:P,children:P==="all"?"All categories":P},P))})]}),s.length===0?n.jsx("div",{className:"mm-empty",children:"No memories yet"}):n.jsx("div",{className:"mm-grid",children:s.map(P=>n.jsx("div",{className:"mm-card",children:S===P.id?n.jsxs("div",{className:"mm-edit-form",children:[n.jsx("textarea",{className:"mm-edit-content",value:A,onChange:de=>D(de.target.value),rows:3}),n.jsxs("label",{className:"mm-edit-label",children:["Importance (",O.toFixed(2),")",n.jsx("input",{type:"range",min:"0",max:"1",step:"0.01",value:O,onChange:de=>E(Number(de.target.value)),className:"mm-edit-slider"})]}),n.jsxs("label",{className:"mm-edit-label",children:["Tags (comma-separated)",n.jsx("input",{type:"text",className:"mm-edit-tags-input",value:R,onChange:de=>_(de.target.value)})]}),n.jsxs("div",{className:"mm-edit-actions",children:[n.jsx("button",{className:"mm-btn mm-btn-save",onClick:()=>ve(P.id),children:"Save"}),n.jsx("button",{className:"mm-btn mm-btn-cancel",onClick:oe,children:"Cancel"})]})]}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:`mm-content ${b===P.id?"mm-content-expanded":""}`,onClick:()=>j(b===P.id?null:P.id),children:P.content}),n.jsxs("div",{className:"mm-meta-row",children:[n.jsx("span",{className:`mm-category-badge ${pb[P.category]||"mm-badge-gray"}`,children:P.category}),n.jsx("span",{className:"mm-source-badge",children:P.source})]}),n.jsx("div",{className:"mm-importance-track",children:n.jsx("div",{className:"mm-importance-bar","data-level":P.importance>=.7?"high":P.importance>=.4?"mid":"low",style:{width:`${Math.round(P.importance*100)}%`},role:"progressbar","aria-valuenow":P.importance,"aria-valuemin":0,"aria-valuemax":1,"aria-label":`Importance: ${Math.round(P.importance*100)}%`})}),P.tags.length>0&&n.jsx("div",{className:"mm-tags",children:P.tags.map(de=>n.jsx("span",{className:"mm-tag",children:de},de))}),n.jsxs("div",{className:"mm-timestamps",children:[n.jsxs("span",{children:["Created ",am(P.createdAt)]}),n.jsxs("span",{children:["Updated ",am(P.updatedAt)]})]}),n.jsx("div",{className:"mm-card-actions",children:K===P.id?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"mm-confirm-text",children:"Delete?"}),n.jsx("button",{className:"mm-btn mm-btn-danger",onClick:()=>H(P.id),children:"Yes"}),n.jsx("button",{className:"mm-btn mm-btn-cancel",onClick:()=>Q(null),children:"No"})]}):n.jsxs(n.Fragment,{children:[n.jsx("button",{className:"mm-btn mm-btn-edit",onClick:()=>ee(P),children:"Edit"}),n.jsx("button",{className:"mm-btn mm-btn-delete",onClick:()=>Q(P.id),children:"Delete"})]})})]})},P.id))}),n.jsxs("section",{className:"mm-forget-section",children:[n.jsx("h3",{className:"mm-section-title",children:"Selective Forgetting"}),n.jsx("p",{className:"mm-section-desc",children:"Remove all memories and decisions related to a topic."}),n.jsxs("div",{className:"mm-forget-row",children:[n.jsx("input",{className:"mm-forget-input",type:"text",placeholder:"Topic to forget...",value:Z,onChange:P=>F(P.target.value)}),n.jsx("button",{className:"mm-btn mm-btn-danger",onClick:J,disabled:ce||!Z.trim(),children:ce?"Forgetting...":"Forget"})]}),Y&&n.jsx("div",{className:"mm-forget-result",children:Y})]}),n.jsxs("section",{className:"mm-export-section",children:[n.jsx("h3",{className:"mm-section-title",children:"Export Data"}),n.jsx("p",{className:"mm-section-desc",children:"Download all personalization data as JSON."}),n.jsx("button",{className:"mm-btn mm-btn-export",onClick:ne,children:"Export All Data"})]})]})}function gb({scores:s,maxScore:r=100}){if(!s||Object.keys(s).length===0)return null;const u=Object.entries(s).sort((o,f)=>f[1]-o[1]);return n.jsx("div",{className:"bc-chart",children:u.map(([o,f])=>n.jsxs("div",{className:"bc-row",children:[n.jsx("span",{className:"bc-label",title:o,children:o}),n.jsx("div",{className:"bc-bar-track",children:n.jsx("div",{className:"bc-bar-fill",style:{width:`${Math.min(100,f/r*100)}%`}})}),n.jsx("span",{className:"bc-value",children:f.toFixed(1)})]},o))})}function vb(s){return s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${Math.round(s/1e3)}K`:String(s)}function lm(s){return s===0?"Free":s<.001?`$${s.toFixed(4)}`:`$${s.toFixed(3)}`}function yb(s){const r=Date.now()-s,u=Math.floor(r/6e4);if(u<1)return"just now";if(u<60)return`${u}m ago`;const o=Math.floor(u/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function nm(s){return s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:String(s)}function xb({model:s,onToggleEnabled:r}){const u=s.displayName||s.modelId,o=s.providerSource==="openrouter",f=s.providerSource==="huggingface";return n.jsxs("div",{className:`mc-card ${s.enabled?"":"mc-card-disabled"}`,children:[n.jsxs("div",{className:"mc-header",children:[n.jsx("span",{className:"mc-name",title:s.modelId,children:u}),n.jsx("span",{className:`mc-provider ${o?"mc-provider-openrouter":""} ${f?"mc-provider-hf":""}`,children:s.providerSource})]}),n.jsxs("div",{className:"mc-context",children:[n.jsx("span",{className:"mc-context-label",children:"Context"}),n.jsx("span",{className:"mc-context-value",children:vb(s.contextLength)})]}),n.jsxs("div",{className:"mc-capabilities",children:[s.supportsVision&&n.jsx("span",{className:"mc-badge mc-badge-blue",children:"Vision"}),s.supportsTools&&n.jsx("span",{className:"mc-badge mc-badge-green",children:"Tools"}),s.supportsStreaming&&n.jsx("span",{className:"mc-badge mc-badge-gray",children:"Streaming"}),s.supportsImageGen&&n.jsx("span",{className:"mc-badge mc-badge-purple",children:"ImageGen"})]}),(s.costPer1kInput>0||s.costPer1kOutput>0)&&n.jsxs("div",{className:"mc-cost",children:[n.jsxs("span",{className:"mc-cost-item",children:["In: ",lm(s.costPer1kInput),"/1K"]}),n.jsxs("span",{className:"mc-cost-item",children:["Out: ",lm(s.costPer1kOutput),"/1K"]})]}),s.strengths&&s.strengths.length>0&&n.jsx("div",{className:"mc-strengths",children:s.strengths.map(m=>n.jsx("span",{className:"mc-strength-pill",children:m},m))}),f&&n.jsxs("div",{className:"mc-hf-stats",children:[s.hfDownloads!=null&&n.jsxs("span",{className:"mc-hf-stat",title:"Downloads",children:["↓"," ",nm(s.hfDownloads)]}),s.hfLikes!=null&&n.jsxs("span",{className:"mc-hf-stat",title:"Likes",children:["♥"," ",nm(s.hfLikes)]}),s.hfTrendingScore!=null&&n.jsxs("span",{className:"mc-hf-stat",title:"Trending Score",children:["↑"," ",s.hfTrendingScore.toFixed(1)]})]}),s.hfBenchmarkScores&&Object.keys(s.hfBenchmarkScores).length>0&&n.jsx(gb,{scores:s.hfBenchmarkScores}),n.jsxs("div",{className:"mc-footer",children:[n.jsx("span",{className:"mc-refreshed",title:new Date(s.lastRefreshedAt).toLocaleString(),children:yb(s.lastRefreshedAt)}),n.jsx("button",{className:`mc-toggle ${s.enabled?"mc-toggle-on":"mc-toggle-off"}`,onClick:()=>r(s.id,!s.enabled),title:s.enabled?"Disable model":"Enable model",children:s.enabled?"Enabled":"Disabled"})]})]})}const bb=[{key:"all",label:"All Models"},{key:"openrouter",label:"OpenRouter"},{key:"huggingface",label:"HuggingFace"},{key:"trending",label:"Trending"}];function jb(){const[s,r]=h.useState("all"),[u,o]=h.useState([]),[f,m]=h.useState(""),[p,x]=h.useState(!1),[y,g]=h.useState(!1),[b,j]=h.useState(!1),[S,T]=h.useState(!1),[A,D]=h.useState(null),O=h.useCallback(async()=>{x(!0),D(null);try{let K;if(s==="trending")K="/api/v1/models/trending?limit=50";else{const Z=new URLSearchParams;s!=="all"&&Z.set("source",s),f&&Z.set("search",f),b&&Z.set("supportsVision","true"),S&&Z.set("supportsTools","true"),Z.set("limit","200"),K=`/api/v1/models/discovered?${Z}`}const Q=await fetch(K);if(Q.ok){const Z=await Q.json();o(Z.models||[])}else D(`Failed to load models (${Q.status})`)}catch{D("Failed to fetch models")}x(!1)},[s,f,b,S]);h.useEffect(()=>{O()},[O]);const E=async()=>{g(!0);try{await fetch("/api/v1/models/refresh",{method:"POST"}),setTimeout(()=>{O(),g(!1)},3e3)}catch{g(!1)}},R=async(K,Q)=>{try{await fetch("/api/v1/models/discovered/toggle",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:K,enabled:Q})}),o(Z=>Z.map(F=>F.id===K?{...F,enabled:Q}:F))}catch{}},_=K=>{r(K),m("")};return n.jsxs("div",{className:"me-page",children:[n.jsxs("div",{className:"me-header",children:[n.jsx("h2",{className:"me-title",children:"Model Explorer"}),n.jsxs("div",{className:"me-header-right",children:[n.jsxs("span",{className:"me-count",children:[u.length," model",u.length!==1?"s":""]}),n.jsx("button",{className:"me-refresh-btn",onClick:E,disabled:y,children:y?"Refreshing...":"Refresh"})]})]}),n.jsxs("div",{className:"me-toolbar",children:[n.jsx("div",{className:"me-tabs",children:bb.map(K=>n.jsx("button",{className:`me-tab ${s===K.key?"active":""}`,onClick:()=>_(K.key),children:K.label},K.key))}),s!=="trending"&&n.jsx("input",{className:"me-search",type:"text",placeholder:"Search models...",value:f,onChange:K=>m(K.target.value)})]}),s!=="trending"&&n.jsxs("div",{className:"me-filters",children:[n.jsxs("label",{className:"me-filter-check",children:[n.jsx("input",{type:"checkbox",checked:b,onChange:K=>j(K.target.checked)}),"Vision"]}),n.jsxs("label",{className:"me-filter-check",children:[n.jsx("input",{type:"checkbox",checked:S,onChange:K=>T(K.target.checked)}),"Tools"]})]}),p?n.jsx("div",{className:"me-loading",children:"Loading models..."}):A?n.jsx("div",{className:"me-error",children:A}):u.length===0?n.jsx("div",{className:"me-empty",children:"No models found. Try adjusting your filters or refreshing."}):n.jsx("div",{className:"me-grid",children:u.map(K=>n.jsx(xb,{model:K,onToggleEnabled:R},K.id))})]})}function Sb(){const[s,r]=h.useState([]),[u,o]=h.useState(!0),[f,m]=h.useState(""),[p,x]=h.useState(null),[y,g]=h.useState(!1),[b,j]=h.useState(new Map),S=h.useRef(null),T=h.useCallback(async()=>{o(!0),m("");try{const O=await fetch("/api/v1/canvas/sessions");if(!O.ok)throw new Error(`HTTP ${O.status}`);const E=await O.json();r(Array.isArray(E)?E:E.sessions??[])}catch(O){m(O instanceof Error?O.message:"Failed to load sessions")}finally{o(!1)}},[]);h.useEffect(()=>{T()},[T]);const A=h.useCallback(O=>{S.current&&(S.current.close(),S.current=null),x(O),j(new Map),g(!1);const R=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/v1/canvas/sessions/${O}/ws`,_=new WebSocket(R);S.current=_,_.addEventListener("open",()=>g(!0)),_.addEventListener("close",()=>g(!1)),_.addEventListener("error",()=>g(!1)),_.addEventListener("message",K=>{let Q;try{Q=JSON.parse(String(K.data))}catch{return}switch(Q.type){case"canvas:snapshot":j(new Map(Q.objects.map(Z=>[Z.id,Z])));break;case"object:added":case"object:updated":j(Z=>{const F=new Map(Z);return F.set(Q.object.id,Q.object),F});break;case"object:removed":j(Z=>{const F=new Map(Z);return F.delete(Q.id),F});break;case"canvas:cleared":j(new Map);break}})},[]),D=h.useCallback(()=>{S.current&&(S.current.close(),S.current=null),x(null),g(!1),j(new Map),T()},[T]);if(h.useEffect(()=>()=>{S.current&&(S.current.close(),S.current=null)},[]),p){const O=Array.from(b.values()).filter(E=>E.visible!==!1);return n.jsxs("div",{style:{padding:16},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:12},children:[n.jsx("button",{className:"btn btn-sm",onClick:D,children:"Back"}),n.jsxs("span",{style:{fontWeight:600},children:["Session: ",p]}),n.jsx("span",{className:`lc-status ${y?"lc-connected":"lc-disconnected"}`,children:y?"Connected":"Disconnected"})]}),n.jsxs("div",{className:"lc-canvas",style:{position:"relative",minHeight:400},children:[O.length===0&&n.jsx("p",{className:"lc-empty",style:{textAlign:"center"},children:"No objects on canvas"}),O.map(E=>n.jsxs("div",{className:"lc-obj",style:{position:"absolute",left:E.x,top:E.y,width:E.width,height:E.height},children:[E.type==="text"&&n.jsx("div",{className:"lc-text",children:E.content??""}),E.type==="image"&&n.jsx("img",{className:"lc-image",src:E.src,alt:E.alt??"",style:{width:"100%",height:"100%"}}),E.type==="widget"&&n.jsx("div",{className:"lc-text",children:E.content??`[widget ${E.id}]`}),E.type!=="text"&&E.type!=="image"&&E.type!=="widget"&&n.jsxs("div",{className:"lc-text",children:["[",E.type,"]"]})]},E.id))]})]})}return n.jsxs("div",{style:{padding:16},children:[n.jsx("h2",{style:{marginBottom:12},children:"Canvas Sessions"}),u&&n.jsx("p",{className:"lc-empty",children:"Loading sessions..."}),f&&n.jsx("p",{style:{color:"var(--error)"},children:f}),!u&&!f&&s.length===0&&n.jsx("p",{className:"lc-empty",children:"No canvas sessions available"}),!u&&s.length>0&&n.jsx("div",{className:"lc-sessions",children:s.map(O=>n.jsx("button",{className:"btn",onClick:()=>A(O.id),children:O.name??O.id},O.id))})]})}const ep=[{id:"chat",label:"Chat",icon:"💬",component:()=>n.jsx(km,{}),defaultWidth:860,defaultHeight:600},{id:"status",label:"System Status",icon:"📊",component:()=>n.jsx(hb,{}),defaultWidth:860,defaultHeight:640},{id:"overview",label:"Mission Control",icon:"🎯",component:()=>n.jsx(Dm,{}),defaultWidth:820,defaultHeight:600},{id:"architect",label:"The Architect",icon:"🏗️",component:()=>n.jsx(Jm,{}),defaultWidth:780,defaultHeight:600},{id:"profile",label:"About Me",icon:"👤",component:()=>n.jsx(Wm,{}),defaultWidth:780,defaultHeight:600},{id:"memories",label:"Memories",icon:"🧠",component:()=>n.jsx(Im,{}),defaultWidth:860,defaultHeight:640},{id:"behaviors",label:"Behaviors",icon:"🧩",component:()=>n.jsx(Bm,{}),defaultWidth:780,defaultHeight:560},{id:"webhooks",label:"Webhooks",icon:"🔗",component:()=>n.jsx(qm,{}),defaultWidth:780,defaultHeight:560},{id:"personality",label:"Personality",icon:"🎭",component:()=>n.jsx(Ym,{}),defaultWidth:680,defaultHeight:520},{id:"provider",label:"Provider",icon:"🔌",component:()=>n.jsx(Gm,{}),defaultWidth:680,defaultHeight:520},{id:"channels",label:"Channels",icon:"📡",component:()=>n.jsx(Xm,{}),defaultWidth:680,defaultHeight:520},{id:"connections",label:"Connections",icon:"🌐",component:()=>n.jsx(Km,{}),defaultWidth:780,defaultHeight:560},{id:"ambient",label:"Ambient",icon:"🌊",component:()=>n.jsx(Zm,{}),defaultWidth:680,defaultHeight:520},{id:"appearance",label:"Appearance",icon:"🎨",component:()=>n.jsx(Qm,{}),defaultWidth:680,defaultHeight:520},{id:"notifications",label:"Notifications",icon:"🔔",component:()=>n.jsx(Fm,{}),defaultWidth:680,defaultHeight:520},{id:"security",label:"Security",icon:"🛡️",component:()=>n.jsx(Vm,{}),defaultWidth:680,defaultHeight:520},{id:"marketplace",label:"Marketplace",icon:"🏪",component:()=>n.jsx(ub,{}),defaultWidth:900,defaultHeight:640},{id:"models",label:"Models",icon:"🤖",component:()=>n.jsx(jb,{}),defaultWidth:900,defaultHeight:650},{id:"canvas",label:"Canvas",icon:"🖌️",component:()=>n.jsx(Sb,{}),defaultWidth:900,defaultHeight:640},{id:"audit",label:"Audit Log",icon:"📋",component:()=>n.jsx(Pm,{}),defaultWidth:820,defaultHeight:600}],Au=new Map(ep.map(s=>[s.id,s])),Nb=ep.map(s=>({id:s.id,label:s.label,icon:s.icon}));function Cb(){const[s,r]=h.useState(()=>sm(new Date));return h.useEffect(()=>{const u=setInterval(()=>r(sm(new Date)),6e4);return()=>clearInterval(u)},[]),s}function sm(s){return s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function Eb(){var ce;const[s,r]=h.useState(!0),[u,o]=h.useState(!1),[f,m]=h.useState("Auxiora"),[p,x]=h.useState(""),y=Ct(),g=Cb();h.useEffect(()=>{I.getSetupStatus().then(ie=>{ie.agentName&&m(ie.agentName),ie.needsSetup?y("/setup",{replace:!0}):ie.vaultUnlocked?o(!0):y("/unlock",{replace:!0})}).catch(()=>{}).finally(()=>r(!1)),fetch("/health").then(ie=>ie.json()).then(ie=>{ie.version&&x(ie.version)}).catch(()=>{})},[]);const{refresh:b}=ut(()=>u?I.getStatus():Promise.resolve(null),[u]),{refresh:j}=ut(()=>u?I.getSessions():Promise.resolve(null),[u]);Os(()=>{u&&(b(),j())});const{windows:S,activeWindowId:T,snapEnabled:A,gridSize:D,openWindow:O,closeWindow:E,focusWindow:R,moveWindow:_,resizeWindow:K,toggleMinimize:Q,toggleMaximize:Z,toggleSnap:F}=rx(),Y=h.useMemo(()=>new Set(S.keys()),[S]),te=h.useCallback(ie=>{const he=Au.get(ie);he&&O(ie,he.label,he.defaultWidth,he.defaultHeight)},[O]);return s?null:n.jsxs("div",{className:"desktop-shell",children:[n.jsx("div",{className:"desktop-bg"}),n.jsxs("div",{className:"topbar",children:[n.jsx("div",{className:"topbar-left",children:n.jsx("span",{children:f})}),n.jsx("div",{className:"topbar-center",children:T&&((ce=Au.get(T))==null?void 0:ce.label)}),n.jsxs("div",{className:"topbar-right",children:[n.jsx("button",{className:`grid-toggle${A?" grid-toggle--active":""}`,onClick:F,title:A?"Disable snap to grid":"Enable snap to grid",children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:[n.jsx("rect",{x:"0.5",y:"0.5",width:"5",height:"5",rx:"0.5",stroke:"currentColor",strokeWidth:"1"}),n.jsx("rect",{x:"8.5",y:"0.5",width:"5",height:"5",rx:"0.5",stroke:"currentColor",strokeWidth:"1"}),n.jsx("rect",{x:"0.5",y:"8.5",width:"5",height:"5",rx:"0.5",stroke:"currentColor",strokeWidth:"1"}),n.jsx("rect",{x:"8.5",y:"8.5",width:"5",height:"5",rx:"0.5",stroke:"currentColor",strokeWidth:"1"})]})}),p&&n.jsxs("span",{style:{opacity:.5,marginRight:8,fontSize:"0.85em"},children:["v",p]}),n.jsx("span",{children:g})]})]}),n.jsx(fx,{}),n.jsxs("div",{style:{position:"relative",flex:1},children:[A&&n.jsx("div",{className:"grid-overlay",style:{backgroundSize:`${D}px ${D}px`}}),Array.from(S.values()).map(ie=>{const he=Au.get(ie.id);return he?n.jsx(ox,{id:ie.id,title:he.label,x:ie.x,y:ie.y,width:ie.width,height:ie.height,zIndex:ie.zIndex,minimized:ie.minimized,maximized:ie.maximized,focused:ie.id===T,onClose:()=>E(ie.id),onFocus:()=>R(ie.id),onMinimize:()=>Q(ie.id),onMaximize:()=>Z(ie.id),onMove:(ee,oe)=>_(ie.id,ee,oe),onResize:(ee,oe)=>K(ie.id,ee,oe),children:he.component()},ie.id):null})]}),n.jsx(dx,{items:Nb,openWindows:Y,onOpen:te})]})}function wb(){const[s,r]=h.useState(""),[u,o]=h.useState(""),[f,m]=h.useState(!1),[p,x]=h.useState(!0),[y,g]=h.useState("Auxiora"),b=Ct();h.useEffect(()=>{I.getSetupStatus().then(S=>{S.agentName&&g(S.agentName),S.needsSetup?b("/setup",{replace:!0}):S.vaultUnlocked||b("/unlock",{replace:!0})}).catch(()=>{}).finally(()=>x(!1))},[]);const j=async S=>{S.preventDefault(),m(!0),o("");try{await I.login(s),b("/")}catch(T){o(T.message||"Login failed")}finally{m(!1)}};return p?null:n.jsx("div",{className:"login-page",children:n.jsxs("div",{className:"login-card",children:[n.jsxs("h1",{children:[y," Mission Control"]}),n.jsxs("form",{onSubmit:j,children:[n.jsx("input",{type:"password",value:s,onChange:S=>r(S.target.value),placeholder:"Password",autoFocus:!0}),n.jsx("button",{type:"submit",disabled:f,children:f?"Logging in...":"Login"}),u&&n.jsx("p",{className:"error",children:u})]})]})})}function Tb(){const[s,r]=h.useState(""),[u,o]=h.useState(""),[f,m]=h.useState(!1),[p,x]=h.useState("Auxiora"),y=Ct();h.useEffect(()=>{I.getSetupStatus().then(b=>{b.agentName&&x(b.agentName)}).catch(()=>{})},[]);const g=async b=>{if(b.preventDefault(),!!s){m(!0),o("");try{await I.setupVault(s),y("/login",{replace:!0})}catch(j){o(j instanceof Error?j.message:"Wrong password")}finally{m(!1)}}};return n.jsx("div",{className:"login-page",children:n.jsxs("div",{className:"login-card",children:[n.jsx("h1",{children:"Unlock Vault"}),n.jsxs("p",{style:{color:"var(--text-secondary)",marginBottom:"1.5rem",fontSize:"0.9rem"},children:["Enter your vault password to start ",p,"."]}),n.jsxs("form",{onSubmit:g,children:[n.jsx("input",{type:"password",value:s,onChange:b=>r(b.target.value),placeholder:"Vault password",autoFocus:!0}),n.jsx("button",{type:"submit",disabled:f||!s,children:f?"Unlocking...":"Unlock"}),u&&n.jsx("p",{className:"error",children:u})]})]})})}function Ab(){const s=Ct();return n.jsx("div",{className:"setup-page",children:n.jsxs("div",{className:"setup-card",style:{textAlign:"center"},children:[n.jsx("h1",{children:"Welcome to Auxiora"}),n.jsx("p",{className:"subtitle",children:"Your personal AI assistant. Let's get you set up — it only takes a minute."}),n.jsx("button",{className:"setup-btn-primary",onClick:()=>s("/setup/vault"),children:"Get Started"})]})})}function Ha({currentStep:s,totalSteps:r=8}){return n.jsx("div",{className:"setup-progress",children:Array.from({length:r},(u,o)=>{const f=o+1,m=f<s,p=f===s;return n.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[o>0&&n.jsx("div",{className:`setup-progress-line${m||p?" completed":""}`}),n.jsx("div",{className:`setup-progress-step${p?" active":""}${m?" completed":""}`,children:m?"✓":f})]},f)})})}function Ob(){const[s,r]=h.useState(""),[u,o]=h.useState(""),[f,m]=h.useState(""),[p,x]=h.useState(!1),y=Ct(),g=async b=>{if(b.preventDefault(),s.length<8){m("Password must be at least 8 characters");return}if(s!==u){m("Passwords do not match");return}x(!0),m("");try{await I.setupVault(s),y("/setup/dashboard-password")}catch(j){m(j instanceof Error?j.message:"Failed to create vault")}finally{x(!1)}};return n.jsxs("div",{className:"setup-page",children:[n.jsx(Ha,{currentStep:1}),n.jsxs("div",{className:"setup-card",children:[n.jsx("h1",{children:"Create Vault Password"}),n.jsx("p",{className:"subtitle",children:"This password encrypts your secrets. Store it somewhere safe — it cannot be recovered."}),n.jsxs("form",{onSubmit:g,children:[n.jsx("label",{children:"Vault password"}),n.jsx("input",{type:"password",value:s,onChange:b=>r(b.target.value),autoFocus:!0}),n.jsx(Pi,{password:s}),n.jsx("label",{children:"Confirm password"}),n.jsx("input",{type:"password",value:u,onChange:b=>o(b.target.value)}),n.jsx("button",{type:"submit",className:"setup-btn-primary",disabled:p,children:p?"Creating...":"Create Vault"}),f&&n.jsx("p",{className:"error",children:f})]})]})]})}function Mb(){const[s,r]=h.useState(""),[u,o]=h.useState(""),[f,m]=h.useState(""),[p,x]=h.useState(!1),y=Ct(),g=async b=>{if(b.preventDefault(),s.length<8){m("Password must be at least 8 characters");return}if(s!==u){m("Passwords do not match");return}x(!0),m("");try{await I.setupDashboardPassword(s),y("/setup/identity")}catch(j){m(j instanceof Error?j.message:"Failed to set password")}finally{x(!1)}};return n.jsxs("div",{className:"setup-page",children:[n.jsx(Ha,{currentStep:2}),n.jsxs("div",{className:"setup-card",children:[n.jsx("h1",{children:"Mission Control Password"}),n.jsx("p",{className:"subtitle",children:"This password protects Mission Control. You'll use it to log in."}),n.jsxs("form",{onSubmit:g,children:[n.jsx("label",{children:"Password"}),n.jsx("input",{type:"password",value:s,onChange:b=>r(b.target.value),autoFocus:!0}),n.jsx(Pi,{password:s}),n.jsx("label",{children:"Confirm password"}),n.jsx("input",{type:"password",value:u,onChange:b=>o(b.target.value)}),n.jsx("button",{type:"submit",className:"setup-btn-primary",disabled:p,children:p?"Saving...":"Set Password"}),f&&n.jsx("p",{className:"error",children:f})]})]})]})}const im=["Nova","Atlas","Jasper","Echo","Sage","Onyx","Iris","Phoenix","Kai","Luna","Orion","Zephyr","Rune","Pixel","Nyx","Sol","Cleo","Juno","Vex","Aura"];function Rb(){const s=h.useMemo(()=>im[Math.floor(Math.random()*im.length)],[]),[r,u]=h.useState(""),[o,f]=h.useState("she/her"),[m,p]=h.useState(""),[x,y]=h.useState(""),[g,b]=h.useState(!1),j=Ct();h.useEffect(()=>{I.getSetupStatus().then(T=>{T.agentName&&T.agentName!=="Auxiora"&&u(T.agentName)}).catch(()=>{})},[]);const S=async T=>{T.preventDefault(),b(!0),y("");try{await I.setupIdentity(r||s,o,m||void 0),m&&localStorage.setItem("auxiora_setup_vibe",m),j("/setup/preferences")}catch(A){y(A instanceof Error?A.message:"Failed to save identity")}finally{b(!1)}};return n.jsxs("div",{className:"setup-page",children:[n.jsx(Ha,{currentStep:3}),n.jsxs("div",{className:"setup-card",children:[n.jsx("h1",{children:"Agent Identity"}),n.jsx("p",{className:"subtitle",children:"Give your AI assistant a name, pronouns, and vibe."}),n.jsxs("form",{onSubmit:S,children:[n.jsx("label",{children:"Agent name"}),n.jsx("input",{type:"text",value:r,onChange:T=>u(T.target.value),placeholder:s,autoFocus:!0}),n.jsx("label",{children:"Pronouns"}),n.jsxs("select",{value:o,onChange:T=>f(T.target.value),children:[n.jsx("option",{value:"she/her",children:"she/her"}),n.jsx("option",{value:"he/him",children:"he/him"}),n.jsx("option",{value:"they/them",children:"they/them"}),n.jsx("option",{value:"it/its",children:"it/its"})]}),n.jsx("label",{children:"Describe the vibe"}),n.jsx("textarea",{value:m,onChange:T=>p(T.target.value),placeholder:"e.g. chill and witty, professional and sharp, warm like a best friend",rows:3,style:{width:"100%",resize:"vertical"}}),n.jsx("button",{type:"submit",className:"setup-btn-primary",disabled:g,children:g?"Saving...":"Continue"}),x&&n.jsx("p",{className:"error",children:x})]})]})]})}const Db={chill:["chill","relaxed","laid-back","easygoing","calm"],professional:["professional","formal","precise","corporate","business"],friendly:["friendly","warm","kind","caring","supportive","best friend"],creative:["creative","imaginative","artistic","playful","quirky"],mentor:["mentor","teacher","guide","coach","wise"],technical:["technical","code","developer","engineer","hacker"]};function zb(s){const r=s.toLowerCase();for(const[u,o]of Object.entries(Db))if(o.some(f=>r.includes(f)))return u;return null}function kb(){const{data:s,loading:r,error:u}=ut(()=>I.getSetupTemplates(),[]),[o,f]=h.useState(""),[m,p]=h.useState(""),[x,y]=h.useState(!1),g=Ct(),b=h.useMemo(()=>{const S=localStorage.getItem("auxiora_setup_vibe");return S?(localStorage.removeItem("auxiora_setup_vibe"),zb(S)):null},[]),j=async S=>{f(S),y(!0),p("");try{await I.setupPersonality(S),g("/setup/appearance")}catch(T){p(T instanceof Error?T.message:"Failed to set personality"),y(!1)}};return n.jsxs("div",{className:"setup-page",children:[n.jsx(Ha,{currentStep:4}),n.jsxs("div",{className:"setup-card",style:{maxWidth:680},children:[n.jsx("h1",{children:"Personality"}),n.jsx("p",{className:"subtitle",children:"Choose a personality template for your assistant."}),r&&n.jsx("p",{style:{color:"var(--text-secondary)"},children:"Loading templates..."}),u&&n.jsx("p",{className:"error",children:u}),s&&n.jsx("div",{className:"template-grid",children:s.data.map(S=>n.jsxs("div",{className:`template-card${o===S.id?" selected":""}${b===S.id?" recommended":""}`,onClick:()=>!x&&j(S.id),children:[n.jsxs("h3",{children:[S.name,b===S.id&&n.jsx("span",{className:"badge badge-primary",style:{marginLeft:"0.5rem",fontSize:"0.6rem"},children:"Recommended"})]}),n.jsx("p",{children:S.description}),S.preview&&n.jsx("p",{style:{marginTop:"0.5rem",fontStyle:"italic",fontSize:"0.75rem"},children:S.preview})]},S.id))}),m&&n.jsx("p",{className:"error",children:m}),x&&n.jsx("p",{style:{color:"var(--text-secondary)",textAlign:"center"},children:"Saving..."})]})]})}const cm=[{name:"anthropic",label:"Anthropic (Claude)",keyPlaceholder:"sk-ant-...",keyLabel:"API Key"},{name:"openai",label:"OpenAI (GPT)",keyPlaceholder:"sk-...",keyLabel:"API Key"},{name:"google",label:"Google (Gemini)",keyPlaceholder:"AI...",keyLabel:"API Key"},{name:"groq",label:"Groq",keyPlaceholder:"gsk_...",keyLabel:"API Key"},{name:"deepseek",label:"DeepSeek",keyPlaceholder:"sk-...",keyLabel:"API Key"},{name:"xai",label:"xAI (Grok)",keyPlaceholder:"xai-...",keyLabel:"API Key"},{name:"cohere",label:"Cohere",keyPlaceholder:"...",keyLabel:"API Key"},{name:"replicate",label:"Replicate",keyPlaceholder:"r8_...",keyLabel:"API Token"},{name:"ollama",label:"Ollama (Local)",keyPlaceholder:"",keyLabel:"",isLocal:!0}];function _b(){const[s,r]=h.useState({}),[u,o]=h.useState("http://localhost:11434"),[f,m]=h.useState(""),[p,x]=h.useState(!1),y=Ct(),g=(S,T)=>{r(A=>({...A,[S]:T}))},b=Object.values(s).some(S=>S.trim())||s.ollama!==void 0,j=async S=>{var A;S.preventDefault(),x(!0),m("");const T=[];for(const D of cm){if(D.isLocal){s.ollama!==void 0&&T.push({name:"ollama",endpoint:u});continue}const O=(A=s[D.name])==null?void 0:A.trim();O&&T.push({name:D.name,apiKey:O})}if(T.length===0){m("Add at least one provider API key to continue"),x(!1);return}try{await I.setupProviders(T),y("/setup/channels")}catch(D){m(D instanceof Error?D.message:"Failed to configure providers")}finally{x(!1)}};return n.jsxs("div",{className:"setup-page",children:[n.jsx(Ha,{currentStep:6}),n.jsxs("div",{className:"setup-card",children:[n.jsx("h1",{children:"AI Providers"}),n.jsx("p",{className:"subtitle",children:"Add API keys for the providers you want to use. The first one with a key becomes the default. You can add more later in Settings."}),n.jsxs("form",{onSubmit:j,children:[cm.map(S=>n.jsxs("div",{className:"setup-provider-row",children:[n.jsx("label",{className:"setup-provider-label",children:S.label}),S.isLocal?n.jsxs("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"},children:[n.jsx("input",{type:"checkbox",checked:s.ollama!==void 0,onChange:T=>{T.target.checked?g("ollama","enabled"):r(A=>{const D={...A};return delete D.ollama,D})}}),n.jsx("input",{type:"text",value:u,onChange:T=>o(T.target.value),placeholder:"http://localhost:11434",disabled:s.ollama===void 0,style:{flex:1}})]}):n.jsx("input",{type:"password",value:s[S.name]||"",onChange:T=>g(S.name,T.target.value),placeholder:S.keyPlaceholder})]},S.name)),n.jsx("button",{type:"submit",className:"setup-btn-primary",disabled:p||!b,children:p?"Saving...":"Continue"}),f&&n.jsx("p",{className:"error",children:f})]})]})]})}const rm=[{type:"webchat",name:"Webchat",description:"Built-in, no setup needed",fields:[]},{type:"discord",name:"Discord",description:"Connect a Discord bot",fields:[{key:"botToken",label:"Bot Token",type:"password"}]},{type:"telegram",name:"Telegram",description:"Connect a Telegram bot",fields:[{key:"botToken",label:"Bot Token",type:"password"}]},{type:"slack",name:"Slack",description:"Connect to a Slack workspace",fields:[{key:"botToken",label:"Bot Token",type:"password"},{key:"appToken",label:"App Token",type:"password"}]},{type:"matrix",name:"Matrix",description:"Connect to a Matrix homeserver",fields:[{key:"homeserverUrl",label:"Homeserver URL",type:"text"},{key:"userId",label:"User ID",type:"text"},{key:"accessToken",label:"Access Token",type:"password"}]},{type:"signal",name:"Signal",description:"Connect via Signal CLI",fields:[{key:"cliEndpoint",label:"CLI Endpoint",type:"text"},{key:"phoneNumber",label:"Phone Number",type:"text"}]},{type:"teams",name:"Teams",description:"Connect to Microsoft Teams",fields:[{key:"appId",label:"App ID",type:"text"},{key:"appPassword",label:"App Password",type:"password"}]},{type:"whatsapp",name:"WhatsApp",description:"Connect via WhatsApp Business API",fields:[{key:"phoneNumberId",label:"Phone Number ID",type:"text"},{key:"accessToken",label:"Access Token",type:"password"},{key:"verifyToken",label:"Verify Token",type:"text"}]},{type:"twilio",name:"Twilio",description:"Connect via Twilio SMS",fields:[{key:"accountSid",label:"Account SID",type:"text"},{key:"authToken",label:"Auth Token",type:"password"},{key:"phoneNumber",label:"Phone Number",type:"text"}]},{type:"email",name:"Email",description:"Connect via IMAP/SMTP",fields:[{key:"imapHost",label:"IMAP Host",type:"text"},{key:"imapPort",label:"IMAP Port",type:"text"},{key:"smtpHost",label:"SMTP Host",type:"text"},{key:"smtpPort",label:"SMTP Port",type:"text"},{key:"email",label:"Email",type:"text"},{key:"password",label:"Password",type:"password"}]}];function Ub(){const[s,r]=h.useState({webchat:!0}),[u,o]=h.useState({}),[f,m]=h.useState(""),[p,x]=h.useState(!1),y=Ct(),g=S=>{S!=="webchat"&&r(T=>({...T,[S]:!T[S]}))},b=(S,T,A)=>{o(D=>({...D,[S]:{...D[S],[T]:A}}))},j=async()=>{x(!0),m("");try{const S=rm.filter(T=>s[T.type]).map(T=>({type:T.type,enabled:!0,credentials:u[T.type]}));await I.setupChannels(S),y("/setup/connections")}catch(S){m(S instanceof Error?S.message:"Failed to save channels")}finally{x(!1)}};return n.jsxs("div",{className:"setup-page",children:[n.jsx(Ha,{currentStep:7}),n.jsxs("div",{className:"setup-card",style:{maxWidth:720},children:[n.jsx("h1",{children:"Channels"}),n.jsx("p",{className:"subtitle",children:"Enable the messaging channels you want to connect."}),n.jsx("div",{className:"channel-grid",children:rm.map(S=>n.jsxs("div",{className:"channel-card",children:[n.jsxs("div",{className:"channel-card-header",children:[n.jsx("h3",{children:S.name}),S.type==="webchat"?n.jsx("span",{style:{fontSize:"0.75rem",color:"var(--success)"},children:"Always on"}):n.jsx("div",{className:`toggle${s[S.type]?" active":""}`,onClick:()=>g(S.type)})]}),n.jsx("p",{style:{fontSize:"0.8rem",color:"var(--text-secondary)",marginBottom:"0.5rem"},children:S.description}),s[S.type]&&S.fields.length>0&&n.jsx("div",{className:"channel-card-fields",children:S.fields.map(T=>{var A;return n.jsxs("div",{children:[n.jsx("label",{children:T.label}),n.jsx("input",{type:T.type,value:((A=u[S.type])==null?void 0:A[T.key])||"",onChange:D=>b(S.type,T.key,D.target.value)})]},T.key)})})]},S.type))}),n.jsx("button",{className:"setup-btn-primary",onClick:j,disabled:p,children:p?"Saving...":"Save & Continue"}),f&&n.jsx("p",{className:"error",children:f}),n.jsx("span",{className:"skip-link",onClick:()=>y("/setup/connections"),children:"Skip for now"})]})]})}function Lb(){const[s,r]=h.useState(""),[u,o]=h.useState(""),[f,m]=h.useState(""),[p,x]=h.useState(!1),y=Ct(),g=async()=>{if(!s||!u){m("Both Client ID and Client Secret are required");return}x(!0),m("");try{const b=await I.saveConnectorCredentials("google-workspace",s,u);b.oauthUrl?window.location.href=b.oauthUrl:y("/setup/complete")}catch(b){m(b instanceof Error?b.message:"Failed to save credentials")}finally{x(!1)}};return n.jsxs("div",{className:"setup-page",children:[n.jsx(Ha,{currentStep:8}),n.jsxs("div",{className:"setup-card",children:[n.jsx("h1",{children:"Connections"}),n.jsx("p",{className:"subtitle",children:"Connect external services for calendar, email, and task intelligence."}),n.jsxs("div",{className:"settings-section",children:[n.jsx("h3",{children:"Google Workspace"}),n.jsx("p",{style:{fontSize:"0.8rem",color:"var(--text-secondary)",marginBottom:"1rem"},children:"Connect your Google account to enable calendar awareness, email summaries, and task sync."}),n.jsx("label",{children:"Client ID"}),n.jsx("input",{type:"text",value:s,onChange:b=>r(b.target.value),placeholder:"your-client-id.apps.googleusercontent.com"}),n.jsx("label",{children:"Client Secret"}),n.jsx("input",{type:"password",value:u,onChange:b=>o(b.target.value),placeholder:"GOCSPX-..."}),n.jsx("button",{type:"button",className:"setup-btn-primary",onClick:g,disabled:p,children:p?"Connecting...":"Connect Google Account"}),f&&n.jsx("p",{className:"error",children:f})]}),n.jsx("button",{type:"button",className:"setup-btn-secondary",onClick:()=>y("/setup/complete"),children:"Continue without connecting"}),n.jsx("span",{className:"skip-link",onClick:()=>y("/setup/complete"),children:"Skip for now"})]})]})}function Bb(){const[s,r]=h.useState("");return h.useEffect(()=>{I.completeSetup().catch(u=>{r(u instanceof Error?u.message:"Failed to finalize setup")})},[]),n.jsx("div",{className:"setup-page",children:n.jsxs("div",{className:"setup-card",style:{textAlign:"center"},children:[n.jsx("div",{className:"setup-complete-check",children:"✓"}),n.jsx("h1",{children:"Setup Complete!"}),n.jsx("p",{className:"subtitle",children:"Your assistant is ready to go."}),s&&n.jsx("p",{className:"error",children:s}),n.jsxs("div",{className:"setup-complete-buttons",children:[n.jsx("button",{className:"setup-btn-primary",onClick:()=>{window.location.href="/"},children:"Open Chat"}),n.jsx("button",{className:"setup-btn-secondary",onClick:()=>{window.location.href="/dashboard"},children:"Go to Mission Control"})]})]})})}const um=[{id:"verbosity",label:"Preferred response style",trait:"verbosity",options:[{label:"Concise",value:-.2},{label:"Balanced",value:0},{label:"Detailed",value:.2}]},{id:"warmth",label:"Communication tone",trait:"warmth",options:[{label:"Analytical",value:-.15},{label:"Balanced",value:0},{label:"Warm",value:.2}]},{id:"humor",label:"Humor level",trait:"humor",options:[{label:"Serious",value:-.15},{label:"Occasional",value:0},{label:"Frequent",value:.2}]},{id:"formality",label:"Formality",trait:"formality",options:[{label:"Casual",value:-.2},{label:"Balanced",value:0},{label:"Formal",value:.2}]},{id:"depth",label:"Explanation depth",trait:"secondOrder",options:[{label:"Surface level",value:-.1},{label:"Standard",value:0},{label:"Deep analysis",value:.15}]}];function Hb(){const[s,r]=h.useState({}),[u,o]=h.useState(!1),[f,m]=h.useState(""),p=Ct(),x=(g,b)=>{r(j=>({...j,[g]:b}))},y=async()=>{o(!0),m("");try{const g=um.filter(b=>s[b.id]&&s[b.id]!==0);for(const b of g)await I.updateArchitectPreference(b.trait,s[b.id]);p("/setup/personality")}catch(g){m(g instanceof Error?g.message:"Failed to save preferences")}finally{o(!1)}};return n.jsxs("div",{className:"setup-page",children:[n.jsx(Ha,{currentStep:4}),n.jsxs("div",{className:"setup-card",children:[n.jsx("h1",{children:"Your Preferences"}),n.jsx("p",{className:"subtitle",children:"Help your assistant understand how you like to communicate. You can always change these later."}),n.jsx("div",{className:"preferences-questions",children:um.map(g=>n.jsxs("div",{className:"preferences-question",children:[n.jsx("label",{children:g.label}),n.jsx("div",{className:"preferences-options",children:g.options.map(b=>n.jsx("button",{className:`preferences-option ${s[g.id]===b.value?"active":""}`,onClick:()=>x(g.id,b.value),type:"button",children:b.label},b.label))})]},g.id))}),f&&n.jsx("p",{className:"error",children:f}),n.jsxs("div",{className:"preferences-actions",children:[n.jsx("button",{className:"setup-btn-secondary",onClick:()=>p("/setup/personality"),children:"Skip"}),n.jsx("button",{className:"setup-btn-primary",onClick:y,disabled:u,children:u?"Saving...":"Continue"})]})]})]})}function qb(){const{theme:s}=qu(),[r,u]=h.useState(""),[o,f]=h.useState(!1),m=Ct(),p=async()=>{f(!0),u("");try{await I.updateAppearance(s),m("/setup/provider")}catch(x){u(x instanceof Error?x.message:"Failed to save appearance"),f(!1)}};return n.jsxs("div",{className:"setup-page",children:[n.jsx(Ha,{currentStep:5}),n.jsxs("div",{className:"setup-card",style:{maxWidth:720},children:[n.jsx("h1",{children:"Appearance"}),n.jsx("p",{className:"subtitle",children:"Choose a visual theme for Mission Control. You can change this later in settings."}),n.jsx($m,{}),r&&n.jsx("p",{className:"error",children:r}),n.jsx("button",{className:"btn-primary",onClick:p,disabled:o,style:{marginTop:"1.5rem",width:"100%"},children:o?"Saving...":"Continue"})]})]})}function Yb(){return n.jsxs(py,{children:[n.jsx(ke,{path:"/login",element:n.jsx(wb,{})}),n.jsx(ke,{path:"/unlock",element:n.jsx(Tb,{})}),n.jsx(ke,{path:"/setup",element:n.jsx(Ab,{})}),n.jsx(ke,{path:"/setup/vault",element:n.jsx(Ob,{})}),n.jsx(ke,{path:"/setup/dashboard-password",element:n.jsx(Mb,{})}),n.jsx(ke,{path:"/setup/identity",element:n.jsx(Rb,{})}),n.jsx(ke,{path:"/setup/preferences",element:n.jsx(Hb,{})}),n.jsx(ke,{path:"/setup/personality",element:n.jsx(kb,{})}),n.jsx(ke,{path:"/setup/appearance",element:n.jsx(qb,{})}),n.jsx(ke,{path:"/setup/provider",element:n.jsx(_b,{})}),n.jsx(ke,{path:"/setup/channels",element:n.jsx(Ub,{})}),n.jsx(ke,{path:"/setup/connections",element:n.jsx(Lb,{})}),n.jsx(ke,{path:"/setup/complete",element:n.jsx(Bb,{})}),n.jsxs(ke,{element:n.jsx(Eb,{}),children:[n.jsx(ke,{index:!0,element:n.jsx(Dm,{})}),n.jsx(ke,{path:"chat",element:n.jsx(km,{})}),n.jsx(ke,{path:"behaviors",element:n.jsx(Bm,{})}),n.jsx(ke,{path:"webhooks",element:n.jsx(qm,{})}),n.jsx(ke,{path:"settings/personality",element:n.jsx(Ym,{})}),n.jsx(ke,{path:"settings/identity",element:n.jsx(Kh,{to:"/settings/personality",replace:!0})}),n.jsx(ke,{path:"settings/provider",element:n.jsx(Gm,{})}),n.jsx(ke,{path:"settings/channels",element:n.jsx(Xm,{})}),n.jsx(ke,{path:"settings/connections",element:n.jsx(Km,{})}),n.jsx(ke,{path:"settings/architect",element:n.jsx(Jm,{})}),n.jsx(ke,{path:"settings/ambient",element:n.jsx(Zm,{})}),n.jsx(ke,{path:"settings/appearance",element:n.jsx(Qm,{})}),n.jsx(ke,{path:"settings/notifications",element:n.jsx(Fm,{})}),n.jsx(ke,{path:"settings/security",element:n.jsx(Vm,{})}),n.jsx(ke,{path:"settings/audit",element:n.jsx(Pm,{})}),n.jsx(ke,{path:"profile",element:n.jsx(Wm,{})}),n.jsx(ke,{path:"memories",element:n.jsx(Im,{})})]}),n.jsx(ke,{path:"*",element:n.jsx(Kh,{to:"/",replace:!0})})]})}yv.createRoot(document.getElementById("root")).render(n.jsx(h.StrictMode,{children:n.jsx(Hy,{basename:"/dashboard",children:n.jsx(Py,{children:n.jsx(Yb,{})})})}));
|