nestor-sh 3.2.1 → 3.4.0
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/README.md +1 -1
- package/dist/nestor.mjs +254234 -104522
- package/dist/prompts/BOOTSTRAP.md +37 -0
- package/dist/prompts/ROLE_SWITCH.md +23 -0
- package/dist/prompts/SHARED_SOUL.md +37 -0
- package/dist/prompts/USER.md +20 -0
- package/dist/prompts/agents/ATLAS.md +40 -0
- package/dist/prompts/agents/FORGE.md +40 -0
- package/dist/prompts/agents/NEXUS.md +42 -0
- package/dist/prompts/agents/SENTINEL.md +40 -0
- package/dist/prompts/agents/SHADOW.md +41 -0
- package/dist/prompts/heartbeat/DEFAULT.md +12 -0
- package/dist/prompts/heartbeat/NEXUS_HEARTBEAT.md +33 -0
- package/dist/studio/assets/index-B5zLCypy.js +607 -0
- package/dist/studio/assets/index-BL3Mp7Cu.css +1 -0
- package/dist/studio/index.html +2 -2
- package/package.json +15 -10
- package/dist/studio/assets/index-0-6dEh2X.js +0 -597
- package/dist/studio/assets/index-B6rRdi4P.js +0 -594
- package/dist/studio/assets/index-BCVaIJnX.js +0 -596
- package/dist/studio/assets/index-BFlEVRQQ.js +0 -596
- package/dist/studio/assets/index-BYMzxJZS.css +0 -1
- package/dist/studio/assets/index-BbuSTZoY.js +0 -596
- package/dist/studio/assets/index-BetEyTVL.js +0 -597
- package/dist/studio/assets/index-BngOpby7.css +0 -1
- package/dist/studio/assets/index-CGns5m54.css +0 -1
- package/dist/studio/assets/index-CTXjJlEy.js +0 -597
- package/dist/studio/assets/index-CY_pWEqy.js +0 -594
- package/dist/studio/assets/index-CgYCHAo_.js +0 -596
- package/dist/studio/assets/index-Ch3VZ_6a.css +0 -1
- package/dist/studio/assets/index-CqlwLAqD.js +0 -596
- package/dist/studio/assets/index-CsqKxaaM.js +0 -592
- package/dist/studio/assets/index-Cw42VG9E.js +0 -596
- package/dist/studio/assets/index-DByWC64z.css +0 -1
- package/dist/studio/assets/index-DC96fYgh.css +0 -1
- package/dist/studio/assets/index-DyMdwDBt.css +0 -1
- package/dist/studio/assets/index-uxcAlR2S.js +0 -596
|
@@ -1,594 +0,0 @@
|
|
|
1
|
-
var ib=Object.defineProperty;var rb=(n,r,d)=>r in n?ib(n,r,{enumerable:!0,configurable:!0,writable:!0,value:d}):n[r]=d;var ud=(n,r,d)=>rb(n,typeof r!="symbol"?r+"":r,d);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const m of document.querySelectorAll('link[rel="modulepreload"]'))o(m);new MutationObserver(m=>{for(const f of m)if(f.type==="childList")for(const h of f.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&o(h)}).observe(document,{childList:!0,subtree:!0});function d(m){const f={};return m.integrity&&(f.integrity=m.integrity),m.referrerPolicy&&(f.referrerPolicy=m.referrerPolicy),m.crossOrigin==="use-credentials"?f.credentials="include":m.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function o(m){if(m.ep)return;m.ep=!0;const f=d(m);fetch(m.href,f)}})();var md={exports:{}},ql={};/**
|
|
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 ih;function cb(){if(ih)return ql;ih=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function d(o,m,f){var h=null;if(f!==void 0&&(h=""+f),m.key!==void 0&&(h=""+m.key),"key"in m){f={};for(var b in m)b!=="key"&&(f[b]=m[b])}else f=m;return m=f.ref,{$$typeof:n,type:o,key:h,ref:m!==void 0?m:null,props:f}}return ql.Fragment=r,ql.jsx=d,ql.jsxs=d,ql}var rh;function ob(){return rh||(rh=1,md.exports=cb()),md.exports}var t=ob(),xd={exports:{}},ve={};/**
|
|
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 ch;function db(){if(ch)return ve;ch=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),h=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),w=Symbol.iterator;function C(T){return T===null||typeof T!="object"?null:(T=w&&T[w]||T["@@iterator"],typeof T=="function"?T:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,S={};function z(T,X,ie){this.props=T,this.context=X,this.refs=S,this.updater=ie||k}z.prototype.isReactComponent={},z.prototype.setState=function(T,X){if(typeof T!="object"&&typeof T!="function"&&T!=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,T,X,"setState")},z.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function M(){}M.prototype=z.prototype;function O(T,X,ie){this.props=T,this.context=X,this.refs=S,this.updater=ie||k}var E=O.prototype=new M;E.constructor=O,N(E,z.prototype),E.isPureReactComponent=!0;var ae=Array.isArray;function ce(){}var H={H:null,A:null,T:null,S:null},G=Object.prototype.hasOwnProperty;function P(T,X,ie){var $=ie.ref;return{$$typeof:n,type:T,key:X,ref:$!==void 0?$:null,props:ie}}function W(T,X){return P(T.type,X,T.props)}function Q(T){return typeof T=="object"&&T!==null&&T.$$typeof===n}function le(T){var X={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(ie){return X[ie]})}var F=/\/+/g;function re(T,X){return typeof T=="object"&&T!==null&&T.key!=null?le(""+T.key):X.toString(36)}function he(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(ce,ce):(T.status="pending",T.then(function(X){T.status==="pending"&&(T.status="fulfilled",T.value=X)},function(X){T.status==="pending"&&(T.status="rejected",T.reason=X)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function K(T,X,ie,$,oe){var ue=typeof T;(ue==="undefined"||ue==="boolean")&&(T=null);var ge=!1;if(T===null)ge=!0;else switch(ue){case"bigint":case"string":case"number":ge=!0;break;case"object":switch(T.$$typeof){case n:case r:ge=!0;break;case j:return ge=T._init,K(ge(T._payload),X,ie,$,oe)}}if(ge)return oe=oe(T),ge=$===""?"."+re(T,0):$,ae(oe)?(ie="",ge!=null&&(ie=ge.replace(F,"$&/")+"/"),K(oe,X,ie,"",function(Xe){return Xe})):oe!=null&&(Q(oe)&&(oe=W(oe,ie+(oe.key==null||T&&T.key===oe.key?"":(""+oe.key).replace(F,"$&/")+"/")+ge)),X.push(oe)),1;ge=0;var we=$===""?".":$+":";if(ae(T))for(var be=0;be<T.length;be++)$=T[be],ue=we+re($,be),ge+=K($,X,ie,ue,oe);else if(be=C(T),typeof be=="function")for(T=be.call(T),be=0;!($=T.next()).done;)$=$.value,ue=we+re($,be++),ge+=K($,X,ie,ue,oe);else if(ue==="object"){if(typeof T.then=="function")return K(he(T),X,ie,$,oe);throw X=String(T),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return ge}function _(T,X,ie){if(T==null)return T;var $=[],oe=0;return K(T,$,"","",function(ue){return X.call(ie,ue,oe++)}),$}function Z(T){if(T._status===-1){var X=T._result;X=X(),X.then(function(ie){(T._status===0||T._status===-1)&&(T._status=1,T._result=ie)},function(ie){(T._status===0||T._status===-1)&&(T._status=2,T._result=ie)}),T._status===-1&&(T._status=0,T._result=X)}if(T._status===1)return T._result.default;throw T._result}var ne=typeof reportError=="function"?reportError:function(T){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof T=="object"&&T!==null&&typeof T.message=="string"?String(T.message):String(T),error:T});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",T);return}console.error(T)},xe={map:_,forEach:function(T,X,ie){_(T,function(){X.apply(this,arguments)},ie)},count:function(T){var X=0;return _(T,function(){X++}),X},toArray:function(T){return _(T,function(X){return X})||[]},only:function(T){if(!Q(T))throw Error("React.Children.only expected to receive a single React element child.");return T}};return ve.Activity=y,ve.Children=xe,ve.Component=z,ve.Fragment=d,ve.Profiler=m,ve.PureComponent=O,ve.StrictMode=o,ve.Suspense=g,ve.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=H,ve.__COMPILER_RUNTIME={__proto__:null,c:function(T){return H.H.useMemoCache(T)}},ve.cache=function(T){return function(){return T.apply(null,arguments)}},ve.cacheSignal=function(){return null},ve.cloneElement=function(T,X,ie){if(T==null)throw Error("The argument must be a React element, but you passed "+T+".");var $=N({},T.props),oe=T.key;if(X!=null)for(ue in X.key!==void 0&&(oe=""+X.key),X)!G.call(X,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&X.ref===void 0||($[ue]=X[ue]);var ue=arguments.length-2;if(ue===1)$.children=ie;else if(1<ue){for(var ge=Array(ue),we=0;we<ue;we++)ge[we]=arguments[we+2];$.children=ge}return P(T.type,oe,$)},ve.createContext=function(T){return T={$$typeof:h,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:f,_context:T},T},ve.createElement=function(T,X,ie){var $,oe={},ue=null;if(X!=null)for($ in X.key!==void 0&&(ue=""+X.key),X)G.call(X,$)&&$!=="key"&&$!=="__self"&&$!=="__source"&&(oe[$]=X[$]);var ge=arguments.length-2;if(ge===1)oe.children=ie;else if(1<ge){for(var we=Array(ge),be=0;be<ge;be++)we[be]=arguments[be+2];oe.children=we}if(T&&T.defaultProps)for($ in ge=T.defaultProps,ge)oe[$]===void 0&&(oe[$]=ge[$]);return P(T,ue,oe)},ve.createRef=function(){return{current:null}},ve.forwardRef=function(T){return{$$typeof:b,render:T}},ve.isValidElement=Q,ve.lazy=function(T){return{$$typeof:j,_payload:{_status:-1,_result:T},_init:Z}},ve.memo=function(T,X){return{$$typeof:p,type:T,compare:X===void 0?null:X}},ve.startTransition=function(T){var X=H.T,ie={};H.T=ie;try{var $=T(),oe=H.S;oe!==null&&oe(ie,$),typeof $=="object"&&$!==null&&typeof $.then=="function"&&$.then(ce,ne)}catch(ue){ne(ue)}finally{X!==null&&ie.types!==null&&(X.types=ie.types),H.T=X}},ve.unstable_useCacheRefresh=function(){return H.H.useCacheRefresh()},ve.use=function(T){return H.H.use(T)},ve.useActionState=function(T,X,ie){return H.H.useActionState(T,X,ie)},ve.useCallback=function(T,X){return H.H.useCallback(T,X)},ve.useContext=function(T){return H.H.useContext(T)},ve.useDebugValue=function(){},ve.useDeferredValue=function(T,X){return H.H.useDeferredValue(T,X)},ve.useEffect=function(T,X){return H.H.useEffect(T,X)},ve.useEffectEvent=function(T){return H.H.useEffectEvent(T)},ve.useId=function(){return H.H.useId()},ve.useImperativeHandle=function(T,X,ie){return H.H.useImperativeHandle(T,X,ie)},ve.useInsertionEffect=function(T,X){return H.H.useInsertionEffect(T,X)},ve.useLayoutEffect=function(T,X){return H.H.useLayoutEffect(T,X)},ve.useMemo=function(T,X){return H.H.useMemo(T,X)},ve.useOptimistic=function(T,X){return H.H.useOptimistic(T,X)},ve.useReducer=function(T,X,ie){return H.H.useReducer(T,X,ie)},ve.useRef=function(T){return H.H.useRef(T)},ve.useState=function(T){return H.H.useState(T)},ve.useSyncExternalStore=function(T,X,ie){return H.H.useSyncExternalStore(T,X,ie)},ve.useTransition=function(){return H.H.useTransition()},ve.version="19.2.4",ve}var oh;function $d(){return oh||(oh=1,xd.exports=db()),xd.exports}var u=$d(),fd={exports:{}},Gl={},hd={exports:{}},pd={};/**
|
|
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 dh;function ub(){return dh||(dh=1,(function(n){function r(K,_){var Z=K.length;K.push(_);e:for(;0<Z;){var ne=Z-1>>>1,xe=K[ne];if(0<m(xe,_))K[ne]=_,K[Z]=xe,Z=ne;else break e}}function d(K){return K.length===0?null:K[0]}function o(K){if(K.length===0)return null;var _=K[0],Z=K.pop();if(Z!==_){K[0]=Z;e:for(var ne=0,xe=K.length,T=xe>>>1;ne<T;){var X=2*(ne+1)-1,ie=K[X],$=X+1,oe=K[$];if(0>m(ie,Z))$<xe&&0>m(oe,ie)?(K[ne]=oe,K[$]=Z,ne=$):(K[ne]=ie,K[X]=Z,ne=X);else if($<xe&&0>m(oe,Z))K[ne]=oe,K[$]=Z,ne=$;else break e}}return _}function m(K,_){var Z=K.sortIndex-_.sortIndex;return Z!==0?Z:K.id-_.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;n.unstable_now=function(){return f.now()}}else{var h=Date,b=h.now();n.unstable_now=function(){return h.now()-b}}var g=[],p=[],j=1,y=null,w=3,C=!1,k=!1,N=!1,S=!1,z=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function E(K){for(var _=d(p);_!==null;){if(_.callback===null)o(p);else if(_.startTime<=K)o(p),_.sortIndex=_.expirationTime,r(g,_);else break;_=d(p)}}function ae(K){if(N=!1,E(K),!k)if(d(g)!==null)k=!0,ce||(ce=!0,le());else{var _=d(p);_!==null&&he(ae,_.startTime-K)}}var ce=!1,H=-1,G=5,P=-1;function W(){return S?!0:!(n.unstable_now()-P<G)}function Q(){if(S=!1,ce){var K=n.unstable_now();P=K;var _=!0;try{e:{k=!1,N&&(N=!1,M(H),H=-1),C=!0;var Z=w;try{t:{for(E(K),y=d(g);y!==null&&!(y.expirationTime>K&&W());){var ne=y.callback;if(typeof ne=="function"){y.callback=null,w=y.priorityLevel;var xe=ne(y.expirationTime<=K);if(K=n.unstable_now(),typeof xe=="function"){y.callback=xe,E(K),_=!0;break t}y===d(g)&&o(g),E(K)}else o(g);y=d(g)}if(y!==null)_=!0;else{var T=d(p);T!==null&&he(ae,T.startTime-K),_=!1}}break e}finally{y=null,w=Z,C=!1}_=void 0}}finally{_?le():ce=!1}}}var le;if(typeof O=="function")le=function(){O(Q)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,re=F.port2;F.port1.onmessage=Q,le=function(){re.postMessage(null)}}else le=function(){z(Q,0)};function he(K,_){H=z(function(){K(n.unstable_now())},_)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(K){K.callback=null},n.unstable_forceFrameRate=function(K){0>K||125<K?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):G=0<K?Math.floor(1e3/K):5},n.unstable_getCurrentPriorityLevel=function(){return w},n.unstable_next=function(K){switch(w){case 1:case 2:case 3:var _=3;break;default:_=w}var Z=w;w=_;try{return K()}finally{w=Z}},n.unstable_requestPaint=function(){S=!0},n.unstable_runWithPriority=function(K,_){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var Z=w;w=K;try{return _()}finally{w=Z}},n.unstable_scheduleCallback=function(K,_,Z){var ne=n.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?ne+Z:ne):Z=ne,K){case 1:var xe=-1;break;case 2:xe=250;break;case 5:xe=1073741823;break;case 4:xe=1e4;break;default:xe=5e3}return xe=Z+xe,K={id:j++,callback:_,priorityLevel:K,startTime:Z,expirationTime:xe,sortIndex:-1},Z>ne?(K.sortIndex=Z,r(p,K),d(g)===null&&K===d(p)&&(N?(M(H),H=-1):N=!0,he(ae,Z-ne))):(K.sortIndex=xe,r(g,K),k||C||(k=!0,ce||(ce=!0,le()))),K},n.unstable_shouldYield=W,n.unstable_wrapCallback=function(K){var _=w;return function(){var Z=w;w=_;try{return K.apply(this,arguments)}finally{w=Z}}}})(pd)),pd}var uh;function mb(){return uh||(uh=1,hd.exports=ub()),hd.exports}var gd={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 mh;function xb(){if(mh)return yt;mh=1;var n=$d();function r(g){var p="https://react.dev/errors/"+g;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var j=2;j<arguments.length;j++)p+="&args[]="+encodeURIComponent(arguments[j])}return"Minified React error #"+g+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(){}var o={d:{f:d,r:function(){throw Error(r(522))},D:d,C:d,L:d,m:d,X:d,S:d,M:d},p:0,findDOMNode:null},m=Symbol.for("react.portal");function f(g,p,j){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:m,key:y==null?null:""+y,children:g,containerInfo:p,implementation:j}}var h=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function b(g,p){if(g==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return yt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,yt.createPortal=function(g,p){var j=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(r(299));return f(g,p,null,j)},yt.flushSync=function(g){var p=h.T,j=o.p;try{if(h.T=null,o.p=2,g)return g()}finally{h.T=p,o.p=j,o.d.f()}},yt.preconnect=function(g,p){typeof g=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,o.d.C(g,p))},yt.prefetchDNS=function(g){typeof g=="string"&&o.d.D(g)},yt.preinit=function(g,p){if(typeof g=="string"&&p&&typeof p.as=="string"){var j=p.as,y=b(j,p.crossOrigin),w=typeof p.integrity=="string"?p.integrity:void 0,C=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;j==="style"?o.d.S(g,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:y,integrity:w,fetchPriority:C}):j==="script"&&o.d.X(g,{crossOrigin:y,integrity:w,fetchPriority:C,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},yt.preinitModule=function(g,p){if(typeof g=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var j=b(p.as,p.crossOrigin);o.d.M(g,{crossOrigin:j,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&o.d.M(g)},yt.preload=function(g,p){if(typeof g=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var j=p.as,y=b(j,p.crossOrigin);o.d.L(g,j,{crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},yt.preloadModule=function(g,p){if(typeof g=="string")if(p){var j=b(p.as,p.crossOrigin);o.d.m(g,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:j,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else o.d.m(g)},yt.requestFormReset=function(g){o.d.r(g)},yt.unstable_batchedUpdates=function(g,p){return g(p)},yt.useFormState=function(g,p,j){return h.H.useFormState(g,p,j)},yt.useFormStatus=function(){return h.H.useHostTransitionStatus()},yt.version="19.2.4",yt}var xh;function fb(){if(xh)return gd.exports;xh=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),gd.exports=xb(),gd.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 fh;function hb(){if(fh)return Gl;fh=1;var n=mb(),r=$d(),d=fb();function o(e){var a="https://react.dev/errors/"+e;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)a+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+e+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function m(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var a=e,s=e;if(e.alternate)for(;a.return;)a=a.return;else{e=a;do a=e,(a.flags&4098)!==0&&(s=a.return),e=a.return;while(e)}return a.tag===3?s:null}function h(e){if(e.tag===13){var a=e.memoizedState;if(a===null&&(e=e.alternate,e!==null&&(a=e.memoizedState)),a!==null)return a.dehydrated}return null}function b(e){if(e.tag===31){var a=e.memoizedState;if(a===null&&(e=e.alternate,e!==null&&(a=e.memoizedState)),a!==null)return a.dehydrated}return null}function g(e){if(f(e)!==e)throw Error(o(188))}function p(e){var a=e.alternate;if(!a){if(a=f(e),a===null)throw Error(o(188));return a!==e?null:e}for(var s=e,l=a;;){var i=s.return;if(i===null)break;var c=i.alternate;if(c===null){if(l=i.return,l!==null){s=l;continue}break}if(i.child===c.child){for(c=i.child;c;){if(c===s)return g(i),e;if(c===l)return g(i),a;c=c.sibling}throw Error(o(188))}if(s.return!==l.return)s=i,l=c;else{for(var x=!1,v=i.child;v;){if(v===s){x=!0,s=i,l=c;break}if(v===l){x=!0,l=i,s=c;break}v=v.sibling}if(!x){for(v=c.child;v;){if(v===s){x=!0,s=c,l=i;break}if(v===l){x=!0,l=c,s=i;break}v=v.sibling}if(!x)throw Error(o(189))}}if(s.alternate!==l)throw Error(o(190))}if(s.tag!==3)throw Error(o(188));return s.stateNode.current===s?e:a}function j(e){var a=e.tag;if(a===5||a===26||a===27||a===6)return e;for(e=e.child;e!==null;){if(a=j(e),a!==null)return a;e=e.sibling}return null}var y=Object.assign,w=Symbol.for("react.element"),C=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),O=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),ae=Symbol.for("react.suspense"),ce=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),W=Symbol.for("react.memo_cache_sentinel"),Q=Symbol.iterator;function le(e){return e===null||typeof e!="object"?null:(e=Q&&e[Q]||e["@@iterator"],typeof e=="function"?e:null)}var F=Symbol.for("react.client.reference");function re(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===F?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case N:return"Fragment";case z:return"Profiler";case S:return"StrictMode";case ae:return"Suspense";case ce:return"SuspenseList";case P:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case k:return"Portal";case O:return e.displayName||"Context";case M:return(e._context.displayName||"Context")+".Consumer";case E:var a=e.render;return e=e.displayName,e||(e=a.displayName||a.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case H:return a=e.displayName||null,a!==null?a:re(e.type)||"Memo";case G:a=e._payload,e=e._init;try{return re(e(a))}catch{}}return null}var he=Array.isArray,K=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_=d.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},ne=[],xe=-1;function T(e){return{current:e}}function X(e){0>xe||(e.current=ne[xe],ne[xe]=null,xe--)}function ie(e,a){xe++,ne[xe]=e.current,e.current=a}var $=T(null),oe=T(null),ue=T(null),ge=T(null);function we(e,a){switch(ie(ue,a),ie(oe,e),ie($,null),a.nodeType){case 9:case 11:e=(e=a.documentElement)&&(e=e.namespaceURI)?Ef(e):0;break;default:if(e=a.tagName,a=a.namespaceURI)a=Ef(a),e=Tf(a,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}X($),ie($,e)}function be(){X($),X(oe),X(ue)}function Xe(e){e.memoizedState!==null&&ie(ge,e);var a=$.current,s=Tf(a,e.type);a!==s&&(ie(oe,e),ie($,s))}function Ye(e){oe.current===e&&(X($),X(oe)),ge.current===e&&(X(ge),Ul._currentValue=Z)}var la,Is;function Dt(e){if(la===void 0)try{throw Error()}catch(s){var a=s.stack.trim().match(/\n( *(at )?)/);la=a&&a[1]||"",Is=-1<s.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+la+e+Is}var Xa=!1;function He(e,a){if(!e||Xa)return"";Xa=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(a){var I=function(){throw Error()};if(Object.defineProperty(I.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(I,[])}catch(V){var q=V}Reflect.construct(e,[],I)}else{try{I.call()}catch(V){q=V}e.call(I.prototype)}}else{try{throw Error()}catch(V){q=V}(I=e())&&typeof I.catch=="function"&&I.catch(function(){})}}catch(V){if(V&&q&&typeof V.stack=="string")return[V.stack,q.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(),x=c[0],v=c[1];if(x&&v){var A=x.split(`
|
|
44
|
-
`),B=v.split(`
|
|
45
|
-
`);for(i=l=0;l<A.length&&!A[l].includes("DetermineComponentFrameRoot");)l++;for(;i<B.length&&!B[i].includes("DetermineComponentFrameRoot");)i++;if(l===A.length||i===B.length)for(l=A.length-1,i=B.length-1;1<=l&&0<=i&&A[l]!==B[i];)i--;for(;1<=l&&0<=i;l--,i--)if(A[l]!==B[i]){if(l!==1||i!==1)do if(l--,i--,0>i||A[l]!==B[i]){var Y=`
|
|
46
|
-
`+A[l].replace(" at new "," at ");return e.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",e.displayName)),Y}while(1<=l&&0<=i);break}}}finally{Xa=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?Dt(s):""}function gt(e,a){switch(e.tag){case 26:case 27:case 5:return Dt(e.type);case 16:return Dt("Lazy");case 13:return e.child!==a&&a!==null?Dt("Suspense Fallback"):Dt("Suspense");case 19:return Dt("SuspenseList");case 0:case 15:return He(e.type,!1);case 11:return He(e.type.render,!1);case 1:return He(e.type,!0);case 31:return Dt("Activity");default:return""}}function L(e){try{var a="",s=null;do a+=gt(e,s),s=e,e=e.return;while(e);return a}catch(l){return`
|
|
47
|
-
Error generating stack: `+l.message+`
|
|
48
|
-
`+l.stack}}var ee=Object.prototype.hasOwnProperty,ye=n.unstable_scheduleCallback,Fe=n.unstable_cancelCallback,va=n.unstable_shouldYield,ja=n.unstable_requestPaint,bt=n.unstable_now,ni=n.unstable_getCurrentPriorityLevel,Zn=n.unstable_ImmediatePriority,li=n.unstable_UserBlockingPriority,Ps=n.unstable_NormalPriority,q0=n.unstable_LowPriority,cu=n.unstable_IdlePriority,G0=n.log,K0=n.unstable_setDisableYieldValue,Jn=null,Ot=null;function Qa(e){if(typeof G0=="function"&&K0(e),Ot&&typeof Ot.setStrictMode=="function")try{Ot.setStrictMode(Jn,e)}catch{}}var Lt=Math.clz32?Math.clz32:X0,V0=Math.log,Y0=Math.LN2;function X0(e){return e>>>=0,e===0?32:31-(V0(e)/Y0|0)|0}var ii=256,ri=262144,ci=4194304;function Ss(e){var a=e&42;if(a!==0)return a;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 oi(e,a,s){var l=e.pendingLanes;if(l===0)return 0;var i=0,c=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var v=l&134217727;return v!==0?(l=v&~c,l!==0?i=Ss(l):(x&=v,x!==0?i=Ss(x):s||(s=v&~e,s!==0&&(i=Ss(s))))):(v=l&~c,v!==0?i=Ss(v):x!==0?i=Ss(x):s||(s=l&~e,s!==0&&(i=Ss(s)))),i===0?0:a!==0&&a!==i&&(a&c)===0&&(c=i&-i,s=a&-a,c>=s||c===32&&(s&4194048)!==0)?a:i}function Fn(e,a){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&a)===0}function Q0(e,a){switch(e){case 1:case 2:case 4:case 8:case 64:return a+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 a+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 ou(){var e=ci;return ci<<=1,(ci&62914560)===0&&(ci=4194304),e}function Pr(e){for(var a=[],s=0;31>s;s++)a.push(e);return a}function In(e,a){e.pendingLanes|=a,a!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Z0(e,a,s,l,i,c){var x=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var v=e.entanglements,A=e.expirationTimes,B=e.hiddenUpdates;for(s=x&~s;0<s;){var Y=31-Lt(s),I=1<<Y;v[Y]=0,A[Y]=-1;var q=B[Y];if(q!==null)for(B[Y]=null,Y=0;Y<q.length;Y++){var V=q[Y];V!==null&&(V.lane&=-536870913)}s&=~I}l!==0&&du(e,l,0),c!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=c&~(x&~a))}function du(e,a,s){e.pendingLanes|=a,e.suspendedLanes&=~a;var l=31-Lt(a);e.entangledLanes|=a,e.entanglements[l]=e.entanglements[l]|1073741824|s&261930}function uu(e,a){var s=e.entangledLanes|=a;for(e=e.entanglements;s;){var l=31-Lt(s),i=1<<l;i&a|e[l]&a&&(e[l]|=a),s&=~i}}function mu(e,a){var s=a&-a;return s=(s&42)!==0?1:Wr(s),(s&(e.suspendedLanes|a))!==0?0:s}function Wr(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 ec(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function xu(){var e=_.p;return e!==0?e:(e=window.event,e===void 0?32:Wf(e.type))}function fu(e,a){var s=_.p;try{return _.p=e,a()}finally{_.p=s}}var Za=Math.random().toString(36).slice(2),dt="__reactFiber$"+Za,St="__reactProps$"+Za,Ws="__reactContainer$"+Za,tc="__reactEvents$"+Za,J0="__reactListeners$"+Za,F0="__reactHandles$"+Za,hu="__reactResources$"+Za,Pn="__reactMarker$"+Za;function ac(e){delete e[dt],delete e[St],delete e[tc],delete e[J0],delete e[F0]}function en(e){var a=e[dt];if(a)return a;for(var s=e.parentNode;s;){if(a=s[Ws]||s[dt]){if(s=a.alternate,a.child!==null||s!==null&&s.child!==null)for(e=Uf(e);e!==null;){if(s=e[dt])return s;e=Uf(e)}return a}e=s,s=e.parentNode}return null}function tn(e){if(e=e[dt]||e[Ws]){var a=e.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return e}return null}function Wn(e){var a=e.tag;if(a===5||a===26||a===27||a===6)return e.stateNode;throw Error(o(33))}function an(e){var a=e[hu];return a||(a=e[hu]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function it(e){e[Pn]=!0}var pu=new Set,gu={};function ks(e,a){sn(e,a),sn(e+"Capture",a)}function sn(e,a){for(gu[e]=a,e=0;e<a.length;e++)pu.add(a[e])}var I0=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]*$"),bu={},yu={};function P0(e){return ee.call(yu,e)?!0:ee.call(bu,e)?!1:I0.test(e)?yu[e]=!0:(bu[e]=!0,!1)}function di(e,a,s){if(P0(a))if(s===null)e.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(a);return;case"boolean":var l=a.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(a);return}}e.setAttribute(a,""+s)}}function ui(e,a,s){if(s===null)e.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttribute(a,""+s)}}function Na(e,a,s,l){if(l===null)e.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(a,s,""+l)}}function Xt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function vu(e){var a=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function W0(e,a,s){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,a);if(!e.hasOwnProperty(a)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var i=l.get,c=l.set;return Object.defineProperty(e,a,{configurable:!0,get:function(){return i.call(this)},set:function(x){s=""+x,c.call(this,x)}}),Object.defineProperty(e,a,{enumerable:l.enumerable}),{getValue:function(){return s},setValue:function(x){s=""+x},stopTracking:function(){e._valueTracker=null,delete e[a]}}}}function sc(e){if(!e._valueTracker){var a=vu(e)?"checked":"value";e._valueTracker=W0(e,a,""+e[a])}}function ju(e){if(!e)return!1;var a=e._valueTracker;if(!a)return!0;var s=a.getValue(),l="";return e&&(l=vu(e)?e.checked?"true":"false":e.value),e=l,e!==s?(a.setValue(e),!0):!1}function mi(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 ep=/[\n"\\]/g;function Qt(e){return e.replace(ep,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function nc(e,a,s,l,i,c,x,v){e.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.type=x:e.removeAttribute("type"),a!=null?x==="number"?(a===0&&e.value===""||e.value!=a)&&(e.value=""+Xt(a)):e.value!==""+Xt(a)&&(e.value=""+Xt(a)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),a!=null?lc(e,x,Xt(a)):s!=null?lc(e,x,Xt(s)):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=""+Xt(v):e.removeAttribute("name")}function Nu(e,a,s,l,i,c,x,v){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),a!=null||s!=null){if(!(c!=="submit"&&c!=="reset"||a!=null)){sc(e);return}s=s!=null?""+Xt(s):"",a=a!=null?""+Xt(a):s,v||a===e.value||(e.value=a),e.defaultValue=a}l=l??i,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=v?e.checked:!!l,e.defaultChecked=!!l,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x),sc(e)}function lc(e,a,s){a==="number"&&mi(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function nn(e,a,s,l){if(e=e.options,a){a={};for(var i=0;i<s.length;i++)a["$"+s[i]]=!0;for(s=0;s<e.length;s++)i=a.hasOwnProperty("$"+e[s].value),e[s].selected!==i&&(e[s].selected=i),i&&l&&(e[s].defaultSelected=!0)}else{for(s=""+Xt(s),a=null,i=0;i<e.length;i++){if(e[i].value===s){e[i].selected=!0,l&&(e[i].defaultSelected=!0);return}a!==null||e[i].disabled||(a=e[i])}a!==null&&(a.selected=!0)}}function wu(e,a,s){if(a!=null&&(a=""+Xt(a),a!==e.value&&(e.value=a),s==null)){e.defaultValue!==a&&(e.defaultValue=a);return}e.defaultValue=s!=null?""+Xt(s):""}function Su(e,a,s,l){if(a==null){if(l!=null){if(s!=null)throw Error(o(92));if(he(l)){if(1<l.length)throw Error(o(93));l=l[0]}s=l}s==null&&(s=""),a=s}s=Xt(a),e.defaultValue=s,l=e.textContent,l===s&&l!==""&&l!==null&&(e.value=l),sc(e)}function ln(e,a){if(a){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=a;return}}e.textContent=a}var tp=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 ku(e,a,s){var l=a.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?l?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="":l?e.setProperty(a,s):typeof s!="number"||s===0||tp.has(a)?a==="float"?e.cssFloat=s:e[a]=(""+s).trim():e[a]=s+"px"}function zu(e,a,s){if(a!=null&&typeof a!="object")throw Error(o(62));if(e=e.style,s!=null){for(var l in s)!s.hasOwnProperty(l)||a!=null&&a.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var i in a)l=a[i],a.hasOwnProperty(i)&&s[i]!==l&&ku(e,i,l)}else for(var c in a)a.hasOwnProperty(c)&&ku(e,c,a[c])}function ic(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 ap=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"]]),sp=/^[\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 xi(e){return sp.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function wa(){}var rc=null;function cc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var rn=null,cn=null;function Cu(e){var a=tn(e);if(a&&(e=a.stateNode)){var s=e[St]||null;e:switch(e=a.stateNode,a.type){case"input":if(nc(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),a=s.name,s.type==="radio"&&a!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Qt(""+a)+'"][type="radio"]'),a=0;a<s.length;a++){var l=s[a];if(l!==e&&l.form===e.form){var i=l[St]||null;if(!i)throw Error(o(90));nc(l,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(a=0;a<s.length;a++)l=s[a],l.form===e.form&&ju(l)}break e;case"textarea":wu(e,s.value,s.defaultValue);break e;case"select":a=s.value,a!=null&&nn(e,!!s.multiple,a,!1)}}}var oc=!1;function Au(e,a,s){if(oc)return e(a,s);oc=!0;try{var l=e(a);return l}finally{if(oc=!1,(rn!==null||cn!==null)&&(er(),rn&&(a=rn,e=cn,cn=rn=null,Cu(a),e)))for(a=0;a<e.length;a++)Cu(e[a])}}function el(e,a){var s=e.stateNode;if(s===null)return null;var l=s[St]||null;if(l===null)return null;s=l[a];e:switch(a){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(s&&typeof s!="function")throw Error(o(231,a,typeof s));return s}var Sa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),dc=!1;if(Sa)try{var tl={};Object.defineProperty(tl,"passive",{get:function(){dc=!0}}),window.addEventListener("test",tl,tl),window.removeEventListener("test",tl,tl)}catch{dc=!1}var Ja=null,uc=null,fi=null;function Eu(){if(fi)return fi;var e,a=uc,s=a.length,l,i="value"in Ja?Ja.value:Ja.textContent,c=i.length;for(e=0;e<s&&a[e]===i[e];e++);var x=s-e;for(l=1;l<=x&&a[s-l]===i[c-l];l++);return fi=i.slice(e,1<l?1-l:void 0)}function hi(e){var a=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&a===13&&(e=13)):e=a,e===10&&(e=13),32<=e||e===13?e:0}function pi(){return!0}function Tu(){return!1}function kt(e){function a(s,l,i,c,x){this._reactName=s,this._targetInst=i,this.type=l,this.nativeEvent=c,this.target=x,this.currentTarget=null;for(var v in e)e.hasOwnProperty(v)&&(s=e[v],this[v]=s?s(c):c[v]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?pi:Tu,this.isPropagationStopped=Tu,this}return y(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=pi)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=pi)},persist:function(){},isPersistent:pi}),a}var zs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gi=kt(zs),al=y({},zs,{view:0,detail:0}),np=kt(al),mc,xc,sl,bi=y({},al,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:hc,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!==sl&&(sl&&e.type==="mousemove"?(mc=e.screenX-sl.screenX,xc=e.screenY-sl.screenY):xc=mc=0,sl=e),mc)},movementY:function(e){return"movementY"in e?e.movementY:xc}}),Ru=kt(bi),lp=y({},bi,{dataTransfer:0}),ip=kt(lp),rp=y({},al,{relatedTarget:0}),fc=kt(rp),cp=y({},zs,{animationName:0,elapsedTime:0,pseudoElement:0}),op=kt(cp),dp=y({},zs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),up=kt(dp),mp=y({},zs,{data:0}),Mu=kt(mp),xp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},fp={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"},hp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function pp(e){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(e):(e=hp[e])?!!a[e]:!1}function hc(){return pp}var gp=y({},al,{key:function(e){if(e.key){var a=xp[e.key]||e.key;if(a!=="Unidentified")return a}return e.type==="keypress"?(e=hi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?fp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:hc,charCode:function(e){return e.type==="keypress"?hi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?hi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),bp=kt(gp),yp=y({},bi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Du=kt(yp),vp=y({},al,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:hc}),jp=kt(vp),Np=y({},zs,{propertyName:0,elapsedTime:0,pseudoElement:0}),wp=kt(Np),Sp=y({},bi,{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}),kp=kt(Sp),zp=y({},zs,{newState:0,oldState:0}),Cp=kt(zp),Ap=[9,13,27,32],pc=Sa&&"CompositionEvent"in window,nl=null;Sa&&"documentMode"in document&&(nl=document.documentMode);var Ep=Sa&&"TextEvent"in window&&!nl,Ou=Sa&&(!pc||nl&&8<nl&&11>=nl),Lu=" ",_u=!1;function Uu(e,a){switch(e){case"keyup":return Ap.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var on=!1;function Tp(e,a){switch(e){case"compositionend":return Bu(a);case"keypress":return a.which!==32?null:(_u=!0,Lu);case"textInput":return e=a.data,e===Lu&&_u?null:e;default:return null}}function Rp(e,a){if(on)return e==="compositionend"||!pc&&Uu(e,a)?(e=Eu(),fi=uc=Ja=null,on=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return Ou&&a.locale!=="ko"?null:a.data;default:return null}}var Mp={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 $u(e){var a=e&&e.nodeName&&e.nodeName.toLowerCase();return a==="input"?!!Mp[e.type]:a==="textarea"}function Hu(e,a,s,l){rn?cn?cn.push(l):cn=[l]:rn=l,a=rr(a,"onChange"),0<a.length&&(s=new gi("onChange","change",null,s,l),e.push({event:s,listeners:a}))}var ll=null,il=null;function Dp(e){wf(e,0)}function yi(e){var a=Wn(e);if(ju(a))return e}function qu(e,a){if(e==="change")return a}var Gu=!1;if(Sa){var gc;if(Sa){var bc="oninput"in document;if(!bc){var Ku=document.createElement("div");Ku.setAttribute("oninput","return;"),bc=typeof Ku.oninput=="function"}gc=bc}else gc=!1;Gu=gc&&(!document.documentMode||9<document.documentMode)}function Vu(){ll&&(ll.detachEvent("onpropertychange",Yu),il=ll=null)}function Yu(e){if(e.propertyName==="value"&&yi(il)){var a=[];Hu(a,il,e,cc(e)),Au(Dp,a)}}function Op(e,a,s){e==="focusin"?(Vu(),ll=a,il=s,ll.attachEvent("onpropertychange",Yu)):e==="focusout"&&Vu()}function Lp(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return yi(il)}function _p(e,a){if(e==="click")return yi(a)}function Up(e,a){if(e==="input"||e==="change")return yi(a)}function Bp(e,a){return e===a&&(e!==0||1/e===1/a)||e!==e&&a!==a}var _t=typeof Object.is=="function"?Object.is:Bp;function rl(e,a){if(_t(e,a))return!0;if(typeof e!="object"||e===null||typeof a!="object"||a===null)return!1;var s=Object.keys(e),l=Object.keys(a);if(s.length!==l.length)return!1;for(l=0;l<s.length;l++){var i=s[l];if(!ee.call(a,i)||!_t(e[i],a[i]))return!1}return!0}function Xu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Qu(e,a){var s=Xu(e);e=0;for(var l;s;){if(s.nodeType===3){if(l=e+s.textContent.length,e<=a&&l>=a)return{node:s,offset:a-e};e=l}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Xu(s)}}function Zu(e,a){return e&&a?e===a?!0:e&&e.nodeType===3?!1:a&&a.nodeType===3?Zu(e,a.parentNode):"contains"in e?e.contains(a):e.compareDocumentPosition?!!(e.compareDocumentPosition(a)&16):!1:!1}function Ju(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var a=mi(e.document);a instanceof e.HTMLIFrameElement;){try{var s=typeof a.contentWindow.location.href=="string"}catch{s=!1}if(s)e=a.contentWindow;else break;a=mi(e.document)}return a}function yc(e){var a=e&&e.nodeName&&e.nodeName.toLowerCase();return a&&(a==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||a==="textarea"||e.contentEditable==="true")}var $p=Sa&&"documentMode"in document&&11>=document.documentMode,dn=null,vc=null,cl=null,jc=!1;function Fu(e,a,s){var l=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;jc||dn==null||dn!==mi(l)||(l=dn,"selectionStart"in l&&yc(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}),cl&&rl(cl,l)||(cl=l,l=rr(vc,"onSelect"),0<l.length&&(a=new gi("onSelect","select",null,a,s),e.push({event:a,listeners:l}),a.target=dn)))}function Cs(e,a){var s={};return s[e.toLowerCase()]=a.toLowerCase(),s["Webkit"+e]="webkit"+a,s["Moz"+e]="moz"+a,s}var un={animationend:Cs("Animation","AnimationEnd"),animationiteration:Cs("Animation","AnimationIteration"),animationstart:Cs("Animation","AnimationStart"),transitionrun:Cs("Transition","TransitionRun"),transitionstart:Cs("Transition","TransitionStart"),transitioncancel:Cs("Transition","TransitionCancel"),transitionend:Cs("Transition","TransitionEnd")},Nc={},Iu={};Sa&&(Iu=document.createElement("div").style,"AnimationEvent"in window||(delete un.animationend.animation,delete un.animationiteration.animation,delete un.animationstart.animation),"TransitionEvent"in window||delete un.transitionend.transition);function As(e){if(Nc[e])return Nc[e];if(!un[e])return e;var a=un[e],s;for(s in a)if(a.hasOwnProperty(s)&&s in Iu)return Nc[e]=a[s];return e}var Pu=As("animationend"),Wu=As("animationiteration"),em=As("animationstart"),Hp=As("transitionrun"),qp=As("transitionstart"),Gp=As("transitioncancel"),tm=As("transitionend"),am=new Map,wc="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(" ");wc.push("scrollEnd");function ia(e,a){am.set(e,a),ks(a,[e])}var vi=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=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(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Zt=[],mn=0,Sc=0;function ji(){for(var e=mn,a=Sc=mn=0;a<e;){var s=Zt[a];Zt[a++]=null;var l=Zt[a];Zt[a++]=null;var i=Zt[a];Zt[a++]=null;var c=Zt[a];if(Zt[a++]=null,l!==null&&i!==null){var x=l.pending;x===null?i.next=i:(i.next=x.next,x.next=i),l.pending=i}c!==0&&sm(s,i,c)}}function Ni(e,a,s,l){Zt[mn++]=e,Zt[mn++]=a,Zt[mn++]=s,Zt[mn++]=l,Sc|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function kc(e,a,s,l){return Ni(e,a,s,l),wi(e)}function Es(e,a){return Ni(e,null,null,a),wi(e)}function sm(e,a,s){e.lanes|=s;var l=e.alternate;l!==null&&(l.lanes|=s);for(var i=!1,c=e.return;c!==null;)c.childLanes|=s,l=c.alternate,l!==null&&(l.childLanes|=s),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&&a!==null&&(i=31-Lt(s),e=c.hiddenUpdates,l=e[i],l===null?e[i]=[a]:l.push(a),a.lane=s|536870912),c):null}function wi(e){if(50<Tl)throw Tl=0,Lo=null,Error(o(185));for(var a=e.return;a!==null;)e=a,a=e.return;return e.tag===3?e.stateNode:null}var xn={};function Kp(e,a,s,l){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,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 Ut(e,a,s,l){return new Kp(e,a,s,l)}function zc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ka(e,a){var s=e.alternate;return s===null?(s=Ut(e.tag,a,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=a,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,a=e.dependencies,s.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function nm(e,a){e.flags&=65011714;var s=e.alternate;return s===null?(e.childLanes=0,e.lanes=a,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,a=s.dependencies,e.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),e}function Si(e,a,s,l,i,c){var x=0;if(l=e,typeof e=="function")zc(e)&&(x=1);else if(typeof e=="string")x=Zg(e,s,$.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case P:return e=Ut(31,s,a,i),e.elementType=P,e.lanes=c,e;case N:return Ts(s.children,i,c,a);case S:x=8,i|=24;break;case z:return e=Ut(12,s,a,i|2),e.elementType=z,e.lanes=c,e;case ae:return e=Ut(13,s,a,i),e.elementType=ae,e.lanes=c,e;case ce:return e=Ut(19,s,a,i),e.elementType=ce,e.lanes=c,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case O:x=10;break e;case M:x=9;break e;case E:x=11;break e;case H:x=14;break e;case G:x=16,l=null;break e}x=29,s=Error(o(130,e===null?"null":typeof e,"")),l=null}return a=Ut(x,s,a,i),a.elementType=e,a.type=l,a.lanes=c,a}function Ts(e,a,s,l){return e=Ut(7,e,l,a),e.lanes=s,e}function Cc(e,a,s){return e=Ut(6,e,null,a),e.lanes=s,e}function lm(e){var a=Ut(18,null,null,0);return a.stateNode=e,a}function Ac(e,a,s){return a=Ut(4,e.children!==null?e.children:[],e.key,a),a.lanes=s,a.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},a}var im=new WeakMap;function Jt(e,a){if(typeof e=="object"&&e!==null){var s=im.get(e);return s!==void 0?s:(a={value:e,source:a,stack:L(a)},im.set(e,a),a)}return{value:e,source:a,stack:L(a)}}var fn=[],hn=0,ki=null,ol=0,Ft=[],It=0,Fa=null,ua=1,ma="";function za(e,a){fn[hn++]=ol,fn[hn++]=ki,ki=e,ol=a}function rm(e,a,s){Ft[It++]=ua,Ft[It++]=ma,Ft[It++]=Fa,Fa=e;var l=ua;e=ma;var i=32-Lt(l)-1;l&=~(1<<i),s+=1;var c=32-Lt(a)+i;if(30<c){var x=i-i%5;c=(l&(1<<x)-1).toString(32),l>>=x,i-=x,ua=1<<32-Lt(a)+i|s<<i|l,ma=c+e}else ua=1<<c|s<<i|l,ma=e}function Ec(e){e.return!==null&&(za(e,1),rm(e,1,0))}function Tc(e){for(;e===ki;)ki=fn[--hn],fn[hn]=null,ol=fn[--hn],fn[hn]=null;for(;e===Fa;)Fa=Ft[--It],Ft[It]=null,ma=Ft[--It],Ft[It]=null,ua=Ft[--It],Ft[It]=null}function cm(e,a){Ft[It++]=ua,Ft[It++]=ma,Ft[It++]=Fa,ua=a.id,ma=a.overflow,Fa=e}var ut=null,qe=null,Ae=!1,Ia=null,Pt=!1,Rc=Error(o(519));function Pa(e){var a=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw dl(Jt(a,e)),Rc}function om(e){var a=e.stateNode,s=e.type,l=e.memoizedProps;switch(a[dt]=e,a[St]=l,s){case"dialog":ke("cancel",a),ke("close",a);break;case"iframe":case"object":case"embed":ke("load",a);break;case"video":case"audio":for(s=0;s<Ml.length;s++)ke(Ml[s],a);break;case"source":ke("error",a);break;case"img":case"image":case"link":ke("error",a),ke("load",a);break;case"details":ke("toggle",a);break;case"input":ke("invalid",a),Nu(a,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":ke("invalid",a);break;case"textarea":ke("invalid",a),Su(a,l.value,l.defaultValue,l.children)}s=l.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||a.textContent===""+s||l.suppressHydrationWarning===!0||Cf(a.textContent,s)?(l.popover!=null&&(ke("beforetoggle",a),ke("toggle",a)),l.onScroll!=null&&ke("scroll",a),l.onScrollEnd!=null&&ke("scrollend",a),l.onClick!=null&&(a.onclick=wa),a=!0):a=!1,a||Pa(e,!0)}function dm(e){for(ut=e.return;ut;)switch(ut.tag){case 5:case 31:case 13:Pt=!1;return;case 27:case 3:Pt=!0;return;default:ut=ut.return}}function pn(e){if(e!==ut)return!1;if(!Ae)return dm(e),Ae=!0,!1;var a=e.tag,s;if((s=a!==3&&a!==27)&&((s=a===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||Fo(e.type,e.memoizedProps)),s=!s),s&&qe&&Pa(e),dm(e),a===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));qe=_f(e)}else if(a===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));qe=_f(e)}else a===27?(a=qe,ms(e.type)?(e=td,td=null,qe=e):qe=a):qe=ut?ea(e.stateNode.nextSibling):null;return!0}function Rs(){qe=ut=null,Ae=!1}function Mc(){var e=Ia;return e!==null&&(Et===null?Et=e:Et.push.apply(Et,e),Ia=null),e}function dl(e){Ia===null?Ia=[e]:Ia.push(e)}var Dc=T(null),Ms=null,Ca=null;function Wa(e,a,s){ie(Dc,a._currentValue),a._currentValue=s}function Aa(e){e._currentValue=Dc.current,X(Dc)}function Oc(e,a,s){for(;e!==null;){var l=e.alternate;if((e.childLanes&a)!==a?(e.childLanes|=a,l!==null&&(l.childLanes|=a)):l!==null&&(l.childLanes&a)!==a&&(l.childLanes|=a),e===s)break;e=e.return}}function Lc(e,a,s,l){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var c=i.dependencies;if(c!==null){var x=i.child;c=c.firstContext;e:for(;c!==null;){var v=c;c=i;for(var A=0;A<a.length;A++)if(v.context===a[A]){c.lanes|=s,v=c.alternate,v!==null&&(v.lanes|=s),Oc(c.return,s,e),l||(x=null);break e}c=v.next}}else if(i.tag===18){if(x=i.return,x===null)throw Error(o(341));x.lanes|=s,c=x.alternate,c!==null&&(c.lanes|=s),Oc(x,s,e),x=null}else x=i.child;if(x!==null)x.return=i;else for(x=i;x!==null;){if(x===e){x=null;break}if(i=x.sibling,i!==null){i.return=x.return,x=i;break}x=x.return}i=x}}function gn(e,a,s,l){e=null;for(var i=a,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 x=i.alternate;if(x===null)throw Error(o(387));if(x=x.memoizedProps,x!==null){var v=i.type;_t(i.pendingProps.value,x.value)||(e!==null?e.push(v):e=[v])}}else if(i===ge.current){if(x=i.alternate,x===null)throw Error(o(387));x.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(Ul):e=[Ul])}i=i.return}e!==null&&Lc(a,e,s,l),a.flags|=262144}function zi(e){for(e=e.firstContext;e!==null;){if(!_t(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ds(e){Ms=e,Ca=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function mt(e){return um(Ms,e)}function Ci(e,a){return Ms===null&&Ds(e),um(e,a)}function um(e,a){var s=a._currentValue;if(a={context:a,memoizedValue:s,next:null},Ca===null){if(e===null)throw Error(o(308));Ca=a,e.dependencies={lanes:0,firstContext:a},e.flags|=524288}else Ca=Ca.next=a;return s}var Vp=typeof AbortController<"u"?AbortController:function(){var e=[],a=this.signal={aborted:!1,addEventListener:function(s,l){e.push(l)}};this.abort=function(){a.aborted=!0,e.forEach(function(s){return s()})}},Yp=n.unstable_scheduleCallback,Xp=n.unstable_NormalPriority,et={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function _c(){return{controller:new Vp,data:new Map,refCount:0}}function ul(e){e.refCount--,e.refCount===0&&Yp(Xp,function(){e.controller.abort()})}var ml=null,Uc=0,bn=0,yn=null;function Qp(e,a){if(ml===null){var s=ml=[];Uc=0,bn=qo(),yn={status:"pending",value:void 0,then:function(l){s.push(l)}}}return Uc++,a.then(mm,mm),a}function mm(){if(--Uc===0&&ml!==null){yn!==null&&(yn.status="fulfilled");var e=ml;ml=null,bn=0,yn=null;for(var a=0;a<e.length;a++)(0,e[a])()}}function Zp(e,a){var s=[],l={status:"pending",value:null,reason:null,then:function(i){s.push(i)}};return e.then(function(){l.status="fulfilled",l.value=a;for(var i=0;i<s.length;i++)(0,s[i])(a)},function(i){for(l.status="rejected",l.reason=i,i=0;i<s.length;i++)(0,s[i])(void 0)}),l}var xm=K.S;K.S=function(e,a){Fx=bt(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&Qp(e,a),xm!==null&&xm(e,a)};var Os=T(null);function Bc(){var e=Os.current;return e!==null?e:Be.pooledCache}function Ai(e,a){a===null?ie(Os,Os.current):ie(Os,a.pool)}function fm(){var e=Bc();return e===null?null:{parent:et._currentValue,pool:e}}var vn=Error(o(460)),$c=Error(o(474)),Ei=Error(o(542)),Ti={then:function(){}};function hm(e){return e=e.status,e==="fulfilled"||e==="rejected"}function pm(e,a,s){switch(s=e[s],s===void 0?e.push(a):s!==a&&(a.then(wa,wa),a=s),a.status){case"fulfilled":return a.value;case"rejected":throw e=a.reason,bm(e),e;default:if(typeof a.status=="string")a.then(wa,wa);else{if(e=Be,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=a,e.status="pending",e.then(function(l){if(a.status==="pending"){var i=a;i.status="fulfilled",i.value=l}},function(l){if(a.status==="pending"){var i=a;i.status="rejected",i.reason=l}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw e=a.reason,bm(e),e}throw _s=a,vn}}function Ls(e){try{var a=e._init;return a(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(_s=s,vn):s}}var _s=null;function gm(){if(_s===null)throw Error(o(459));var e=_s;return _s=null,e}function bm(e){if(e===vn||e===Ei)throw Error(o(483))}var jn=null,xl=0;function Ri(e){var a=xl;return xl+=1,jn===null&&(jn=[]),pm(jn,e,a)}function fl(e,a){a=a.props.ref,e.ref=a!==void 0?a:null}function Mi(e,a){throw a.$$typeof===w?Error(o(525)):(e=Object.prototype.toString.call(a),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":e)))}function ym(e){function a(D,R){if(e){var U=D.deletions;U===null?(D.deletions=[R],D.flags|=16):U.push(R)}}function s(D,R){if(!e)return null;for(;R!==null;)a(D,R),R=R.sibling;return null}function l(D){for(var R=new Map;D!==null;)D.key!==null?R.set(D.key,D):R.set(D.index,D),D=D.sibling;return R}function i(D,R){return D=ka(D,R),D.index=0,D.sibling=null,D}function c(D,R,U){return D.index=U,e?(U=D.alternate,U!==null?(U=U.index,U<R?(D.flags|=67108866,R):U):(D.flags|=67108866,R)):(D.flags|=1048576,R)}function x(D){return e&&D.alternate===null&&(D.flags|=67108866),D}function v(D,R,U,J){return R===null||R.tag!==6?(R=Cc(U,D.mode,J),R.return=D,R):(R=i(R,U),R.return=D,R)}function A(D,R,U,J){var fe=U.type;return fe===N?Y(D,R,U.props.children,J,U.key):R!==null&&(R.elementType===fe||typeof fe=="object"&&fe!==null&&fe.$$typeof===G&&Ls(fe)===R.type)?(R=i(R,U.props),fl(R,U),R.return=D,R):(R=Si(U.type,U.key,U.props,null,D.mode,J),fl(R,U),R.return=D,R)}function B(D,R,U,J){return R===null||R.tag!==4||R.stateNode.containerInfo!==U.containerInfo||R.stateNode.implementation!==U.implementation?(R=Ac(U,D.mode,J),R.return=D,R):(R=i(R,U.children||[]),R.return=D,R)}function Y(D,R,U,J,fe){return R===null||R.tag!==7?(R=Ts(U,D.mode,J,fe),R.return=D,R):(R=i(R,U),R.return=D,R)}function I(D,R,U){if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return R=Cc(""+R,D.mode,U),R.return=D,R;if(typeof R=="object"&&R!==null){switch(R.$$typeof){case C:return U=Si(R.type,R.key,R.props,null,D.mode,U),fl(U,R),U.return=D,U;case k:return R=Ac(R,D.mode,U),R.return=D,R;case G:return R=Ls(R),I(D,R,U)}if(he(R)||le(R))return R=Ts(R,D.mode,U,null),R.return=D,R;if(typeof R.then=="function")return I(D,Ri(R),U);if(R.$$typeof===O)return I(D,Ci(D,R),U);Mi(D,R)}return null}function q(D,R,U,J){var fe=R!==null?R.key:null;if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return fe!==null?null:v(D,R,""+U,J);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case C:return U.key===fe?A(D,R,U,J):null;case k:return U.key===fe?B(D,R,U,J):null;case G:return U=Ls(U),q(D,R,U,J)}if(he(U)||le(U))return fe!==null?null:Y(D,R,U,J,null);if(typeof U.then=="function")return q(D,R,Ri(U),J);if(U.$$typeof===O)return q(D,R,Ci(D,U),J);Mi(D,U)}return null}function V(D,R,U,J,fe){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return D=D.get(U)||null,v(R,D,""+J,fe);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case C:return D=D.get(J.key===null?U:J.key)||null,A(R,D,J,fe);case k:return D=D.get(J.key===null?U:J.key)||null,B(R,D,J,fe);case G:return J=Ls(J),V(D,R,U,J,fe)}if(he(J)||le(J))return D=D.get(U)||null,Y(R,D,J,fe,null);if(typeof J.then=="function")return V(D,R,U,Ri(J),fe);if(J.$$typeof===O)return V(D,R,U,Ci(R,J),fe);Mi(R,J)}return null}function de(D,R,U,J){for(var fe=null,Te=null,me=R,Ne=R=0,Ce=null;me!==null&&Ne<U.length;Ne++){me.index>Ne?(Ce=me,me=null):Ce=me.sibling;var Re=q(D,me,U[Ne],J);if(Re===null){me===null&&(me=Ce);break}e&&me&&Re.alternate===null&&a(D,me),R=c(Re,R,Ne),Te===null?fe=Re:Te.sibling=Re,Te=Re,me=Ce}if(Ne===U.length)return s(D,me),Ae&&za(D,Ne),fe;if(me===null){for(;Ne<U.length;Ne++)me=I(D,U[Ne],J),me!==null&&(R=c(me,R,Ne),Te===null?fe=me:Te.sibling=me,Te=me);return Ae&&za(D,Ne),fe}for(me=l(me);Ne<U.length;Ne++)Ce=V(me,D,Ne,U[Ne],J),Ce!==null&&(e&&Ce.alternate!==null&&me.delete(Ce.key===null?Ne:Ce.key),R=c(Ce,R,Ne),Te===null?fe=Ce:Te.sibling=Ce,Te=Ce);return e&&me.forEach(function(gs){return a(D,gs)}),Ae&&za(D,Ne),fe}function pe(D,R,U,J){if(U==null)throw Error(o(151));for(var fe=null,Te=null,me=R,Ne=R=0,Ce=null,Re=U.next();me!==null&&!Re.done;Ne++,Re=U.next()){me.index>Ne?(Ce=me,me=null):Ce=me.sibling;var gs=q(D,me,Re.value,J);if(gs===null){me===null&&(me=Ce);break}e&&me&&gs.alternate===null&&a(D,me),R=c(gs,R,Ne),Te===null?fe=gs:Te.sibling=gs,Te=gs,me=Ce}if(Re.done)return s(D,me),Ae&&za(D,Ne),fe;if(me===null){for(;!Re.done;Ne++,Re=U.next())Re=I(D,Re.value,J),Re!==null&&(R=c(Re,R,Ne),Te===null?fe=Re:Te.sibling=Re,Te=Re);return Ae&&za(D,Ne),fe}for(me=l(me);!Re.done;Ne++,Re=U.next())Re=V(me,D,Ne,Re.value,J),Re!==null&&(e&&Re.alternate!==null&&me.delete(Re.key===null?Ne:Re.key),R=c(Re,R,Ne),Te===null?fe=Re:Te.sibling=Re,Te=Re);return e&&me.forEach(function(lb){return a(D,lb)}),Ae&&za(D,Ne),fe}function Ue(D,R,U,J){if(typeof U=="object"&&U!==null&&U.type===N&&U.key===null&&(U=U.props.children),typeof U=="object"&&U!==null){switch(U.$$typeof){case C:e:{for(var fe=U.key;R!==null;){if(R.key===fe){if(fe=U.type,fe===N){if(R.tag===7){s(D,R.sibling),J=i(R,U.props.children),J.return=D,D=J;break e}}else if(R.elementType===fe||typeof fe=="object"&&fe!==null&&fe.$$typeof===G&&Ls(fe)===R.type){s(D,R.sibling),J=i(R,U.props),fl(J,U),J.return=D,D=J;break e}s(D,R);break}else a(D,R);R=R.sibling}U.type===N?(J=Ts(U.props.children,D.mode,J,U.key),J.return=D,D=J):(J=Si(U.type,U.key,U.props,null,D.mode,J),fl(J,U),J.return=D,D=J)}return x(D);case k:e:{for(fe=U.key;R!==null;){if(R.key===fe)if(R.tag===4&&R.stateNode.containerInfo===U.containerInfo&&R.stateNode.implementation===U.implementation){s(D,R.sibling),J=i(R,U.children||[]),J.return=D,D=J;break e}else{s(D,R);break}else a(D,R);R=R.sibling}J=Ac(U,D.mode,J),J.return=D,D=J}return x(D);case G:return U=Ls(U),Ue(D,R,U,J)}if(he(U))return de(D,R,U,J);if(le(U)){if(fe=le(U),typeof fe!="function")throw Error(o(150));return U=fe.call(U),pe(D,R,U,J)}if(typeof U.then=="function")return Ue(D,R,Ri(U),J);if(U.$$typeof===O)return Ue(D,R,Ci(D,U),J);Mi(D,U)}return typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint"?(U=""+U,R!==null&&R.tag===6?(s(D,R.sibling),J=i(R,U),J.return=D,D=J):(s(D,R),J=Cc(U,D.mode,J),J.return=D,D=J),x(D)):s(D,R)}return function(D,R,U,J){try{xl=0;var fe=Ue(D,R,U,J);return jn=null,fe}catch(me){if(me===vn||me===Ei)throw me;var Te=Ut(29,me,null,D.mode);return Te.lanes=J,Te.return=D,Te}finally{}}}var Us=ym(!0),vm=ym(!1),es=!1;function Hc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function qc(e,a){e=e.updateQueue,a.updateQueue===e&&(a.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ts(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function as(e,a,s){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Me&2)!==0){var i=l.pending;return i===null?a.next=a:(a.next=i.next,i.next=a),l.pending=a,a=wi(e),sm(e,null,s),a}return Ni(e,l,a,s),wi(e)}function hl(e,a,s){if(a=a.updateQueue,a!==null&&(a=a.shared,(s&4194048)!==0)){var l=a.lanes;l&=e.pendingLanes,s|=l,a.lanes=s,uu(e,s)}}function Gc(e,a){var s=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,s===l)){var i=null,c=null;if(s=s.firstBaseUpdate,s!==null){do{var x={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};c===null?i=c=x:c=c.next=x,s=s.next}while(s!==null);c===null?i=c=a:c=c.next=a}else i=c=a;s={baseState:l.baseState,firstBaseUpdate:i,lastBaseUpdate:c,shared:l.shared,callbacks:l.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=a:e.next=a,s.lastBaseUpdate=a}var Kc=!1;function pl(){if(Kc){var e=yn;if(e!==null)throw e}}function gl(e,a,s,l){Kc=!1;var i=e.updateQueue;es=!1;var c=i.firstBaseUpdate,x=i.lastBaseUpdate,v=i.shared.pending;if(v!==null){i.shared.pending=null;var A=v,B=A.next;A.next=null,x===null?c=B:x.next=B,x=A;var Y=e.alternate;Y!==null&&(Y=Y.updateQueue,v=Y.lastBaseUpdate,v!==x&&(v===null?Y.firstBaseUpdate=B:v.next=B,Y.lastBaseUpdate=A))}if(c!==null){var I=i.baseState;x=0,Y=B=A=null,v=c;do{var q=v.lane&-536870913,V=q!==v.lane;if(V?(ze&q)===q:(l&q)===q){q!==0&&q===bn&&(Kc=!0),Y!==null&&(Y=Y.next={lane:0,tag:v.tag,payload:v.payload,callback:null,next:null});e:{var de=e,pe=v;q=a;var Ue=s;switch(pe.tag){case 1:if(de=pe.payload,typeof de=="function"){I=de.call(Ue,I,q);break e}I=de;break e;case 3:de.flags=de.flags&-65537|128;case 0:if(de=pe.payload,q=typeof de=="function"?de.call(Ue,I,q):de,q==null)break e;I=y({},I,q);break e;case 2:es=!0}}q=v.callback,q!==null&&(e.flags|=64,V&&(e.flags|=8192),V=i.callbacks,V===null?i.callbacks=[q]:V.push(q))}else V={lane:q,tag:v.tag,payload:v.payload,callback:v.callback,next:null},Y===null?(B=Y=V,A=I):Y=Y.next=V,x|=q;if(v=v.next,v===null){if(v=i.shared.pending,v===null)break;V=v,v=V.next,V.next=null,i.lastBaseUpdate=V,i.shared.pending=null}}while(!0);Y===null&&(A=I),i.baseState=A,i.firstBaseUpdate=B,i.lastBaseUpdate=Y,c===null&&(i.shared.lanes=0),rs|=x,e.lanes=x,e.memoizedState=I}}function jm(e,a){if(typeof e!="function")throw Error(o(191,e));e.call(a)}function Nm(e,a){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)jm(s[e],a)}var Nn=T(null),Di=T(0);function wm(e,a){e=Ua,ie(Di,e),ie(Nn,a),Ua=e|a.baseLanes}function Vc(){ie(Di,Ua),ie(Nn,Nn.current)}function Yc(){Ua=Di.current,X(Nn),X(Di)}var Bt=T(null),Wt=null;function ss(e){var a=e.alternate;ie(Ie,Ie.current&1),ie(Bt,e),Wt===null&&(a===null||Nn.current!==null||a.memoizedState!==null)&&(Wt=e)}function Xc(e){ie(Ie,Ie.current),ie(Bt,e),Wt===null&&(Wt=e)}function Sm(e){e.tag===22?(ie(Ie,Ie.current),ie(Bt,e),Wt===null&&(Wt=e)):ns()}function ns(){ie(Ie,Ie.current),ie(Bt,Bt.current)}function $t(e){X(Bt),Wt===e&&(Wt=null),X(Ie)}var Ie=T(0);function Oi(e){for(var a=e;a!==null;){if(a.tag===13){var s=a.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Wo(s)||ed(s)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===e)break;for(;a.sibling===null;){if(a.return===null||a.return===e)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var Ea=0,je=null,Le=null,tt=null,Li=!1,wn=!1,Bs=!1,_i=0,bl=0,Sn=null,Jp=0;function Qe(){throw Error(o(321))}function Qc(e,a){if(a===null)return!1;for(var s=0;s<a.length&&s<e.length;s++)if(!_t(e[s],a[s]))return!1;return!0}function Zc(e,a,s,l,i,c){return Ea=c,je=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,K.H=e===null||e.memoizedState===null?rx:oo,Bs=!1,c=s(l,i),Bs=!1,wn&&(c=zm(a,s,l,i)),km(e),c}function km(e){K.H=jl;var a=Le!==null&&Le.next!==null;if(Ea=0,tt=Le=je=null,Li=!1,bl=0,Sn=null,a)throw Error(o(300));e===null||at||(e=e.dependencies,e!==null&&zi(e)&&(at=!0))}function zm(e,a,s,l){je=e;var i=0;do{if(wn&&(Sn=null),bl=0,wn=!1,25<=i)throw Error(o(301));if(i+=1,tt=Le=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}K.H=cx,c=a(s,l)}while(wn);return c}function Fp(){var e=K.H,a=e.useState()[0];return a=typeof a.then=="function"?yl(a):a,e=e.useState()[0],(Le!==null?Le.memoizedState:null)!==e&&(je.flags|=1024),a}function Jc(){var e=_i!==0;return _i=0,e}function Fc(e,a,s){a.updateQueue=e.updateQueue,a.flags&=-2053,e.lanes&=~s}function Ic(e){if(Li){for(e=e.memoizedState;e!==null;){var a=e.queue;a!==null&&(a.pending=null),e=e.next}Li=!1}Ea=0,tt=Le=je=null,wn=!1,bl=_i=0,Sn=null}function Nt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tt===null?je.memoizedState=tt=e:tt=tt.next=e,tt}function Pe(){if(Le===null){var e=je.alternate;e=e!==null?e.memoizedState:null}else e=Le.next;var a=tt===null?je.memoizedState:tt.next;if(a!==null)tt=a,Le=e;else{if(e===null)throw je.alternate===null?Error(o(467)):Error(o(310));Le=e,e={memoizedState:Le.memoizedState,baseState:Le.baseState,baseQueue:Le.baseQueue,queue:Le.queue,next:null},tt===null?je.memoizedState=tt=e:tt=tt.next=e}return tt}function Ui(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function yl(e){var a=bl;return bl+=1,Sn===null&&(Sn=[]),e=pm(Sn,e,a),a=je,(tt===null?a.memoizedState:tt.next)===null&&(a=a.alternate,K.H=a===null||a.memoizedState===null?rx:oo),e}function Bi(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return yl(e);if(e.$$typeof===O)return mt(e)}throw Error(o(438,String(e)))}function Pc(e){var a=null,s=je.updateQueue;if(s!==null&&(a=s.memoCache),a==null){var l=je.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(a={data:l.data.map(function(i){return i.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),s===null&&(s=Ui(),je.updateQueue=s),s.memoCache=a,s=a.data[a.index],s===void 0)for(s=a.data[a.index]=Array(e),l=0;l<e;l++)s[l]=W;return a.index++,s}function Ta(e,a){return typeof a=="function"?a(e):a}function $i(e){var a=Pe();return Wc(a,Le,e)}function Wc(e,a,s){var l=e.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=s;var i=e.baseQueue,c=l.pending;if(c!==null){if(i!==null){var x=i.next;i.next=c.next,c.next=x}a.baseQueue=i=c,l.pending=null}if(c=e.baseState,i===null)e.memoizedState=c;else{a=i.next;var v=x=null,A=null,B=a,Y=!1;do{var I=B.lane&-536870913;if(I!==B.lane?(ze&I)===I:(Ea&I)===I){var q=B.revertLane;if(q===0)A!==null&&(A=A.next={lane:0,revertLane:0,gesture:null,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null}),I===bn&&(Y=!0);else if((Ea&q)===q){B=B.next,q===bn&&(Y=!0);continue}else I={lane:0,revertLane:B.revertLane,gesture:null,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},A===null?(v=A=I,x=c):A=A.next=I,je.lanes|=q,rs|=q;I=B.action,Bs&&s(c,I),c=B.hasEagerState?B.eagerState:s(c,I)}else q={lane:I,revertLane:B.revertLane,gesture:B.gesture,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},A===null?(v=A=q,x=c):A=A.next=q,je.lanes|=I,rs|=I;B=B.next}while(B!==null&&B!==a);if(A===null?x=c:A.next=v,!_t(c,e.memoizedState)&&(at=!0,Y&&(s=yn,s!==null)))throw s;e.memoizedState=c,e.baseState=x,e.baseQueue=A,l.lastRenderedState=c}return i===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function eo(e){var a=Pe(),s=a.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=e;var l=s.dispatch,i=s.pending,c=a.memoizedState;if(i!==null){s.pending=null;var x=i=i.next;do c=e(c,x.action),x=x.next;while(x!==i);_t(c,a.memoizedState)||(at=!0),a.memoizedState=c,a.baseQueue===null&&(a.baseState=c),s.lastRenderedState=c}return[c,l]}function Cm(e,a,s){var l=je,i=Pe(),c=Ae;if(c){if(s===void 0)throw Error(o(407));s=s()}else s=a();var x=!_t((Le||i).memoizedState,s);if(x&&(i.memoizedState=s,at=!0),i=i.queue,so(Tm.bind(null,l,i,e),[e]),i.getSnapshot!==a||x||tt!==null&&tt.memoizedState.tag&1){if(l.flags|=2048,kn(9,{destroy:void 0},Em.bind(null,l,i,s,a),null),Be===null)throw Error(o(349));c||(Ea&127)!==0||Am(l,a,s)}return s}function Am(e,a,s){e.flags|=16384,e={getSnapshot:a,value:s},a=je.updateQueue,a===null?(a=Ui(),je.updateQueue=a,a.stores=[e]):(s=a.stores,s===null?a.stores=[e]:s.push(e))}function Em(e,a,s,l){a.value=s,a.getSnapshot=l,Rm(a)&&Mm(e)}function Tm(e,a,s){return s(function(){Rm(a)&&Mm(e)})}function Rm(e){var a=e.getSnapshot;e=e.value;try{var s=a();return!_t(e,s)}catch{return!0}}function Mm(e){var a=Es(e,2);a!==null&&Tt(a,e,2)}function to(e){var a=Nt();if(typeof e=="function"){var s=e;if(e=s(),Bs){Qa(!0);try{s()}finally{Qa(!1)}}}return a.memoizedState=a.baseState=e,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ta,lastRenderedState:e},a}function Dm(e,a,s,l){return e.baseState=s,Wc(e,Le,typeof l=="function"?l:Ta)}function Ip(e,a,s,l,i){if(Gi(e))throw Error(o(485));if(e=a.action,e!==null){var c={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){c.listeners.push(x)}};K.T!==null?s(!0):c.isTransition=!1,l(c),s=a.pending,s===null?(c.next=a.pending=c,Om(a,c)):(c.next=s.next,a.pending=s.next=c)}}function Om(e,a){var s=a.action,l=a.payload,i=e.state;if(a.isTransition){var c=K.T,x={};K.T=x;try{var v=s(i,l),A=K.S;A!==null&&A(x,v),Lm(e,a,v)}catch(B){ao(e,a,B)}finally{c!==null&&x.types!==null&&(c.types=x.types),K.T=c}}else try{c=s(i,l),Lm(e,a,c)}catch(B){ao(e,a,B)}}function Lm(e,a,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(l){_m(e,a,l)},function(l){return ao(e,a,l)}):_m(e,a,s)}function _m(e,a,s){a.status="fulfilled",a.value=s,Um(a),e.state=s,a=e.pending,a!==null&&(s=a.next,s===a?e.pending=null:(s=s.next,a.next=s,Om(e,s)))}function ao(e,a,s){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do a.status="rejected",a.reason=s,Um(a),a=a.next;while(a!==l)}e.action=null}function Um(e){e=e.listeners;for(var a=0;a<e.length;a++)(0,e[a])()}function Bm(e,a){return a}function $m(e,a){if(Ae){var s=Be.formState;if(s!==null){e:{var l=je;if(Ae){if(qe){t:{for(var i=qe,c=Pt;i.nodeType!==8;){if(!c){i=null;break t}if(i=ea(i.nextSibling),i===null){i=null;break t}}c=i.data,i=c==="F!"||c==="F"?i:null}if(i){qe=ea(i.nextSibling),l=i.data==="F!";break e}}Pa(l)}l=!1}l&&(a=s[0])}}return s=Nt(),s.memoizedState=s.baseState=a,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bm,lastRenderedState:a},s.queue=l,s=nx.bind(null,je,l),l.dispatch=s,l=to(!1),c=co.bind(null,je,!1,l.queue),l=Nt(),i={state:a,dispatch:null,action:e,pending:null},l.queue=i,s=Ip.bind(null,je,i,c,s),i.dispatch=s,l.memoizedState=e,[a,s,!1]}function Hm(e){var a=Pe();return qm(a,Le,e)}function qm(e,a,s){if(a=Wc(e,a,Bm)[0],e=$i(Ta)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var l=yl(a)}catch(x){throw x===vn?Ei:x}else l=a;a=Pe();var i=a.queue,c=i.dispatch;return s!==a.memoizedState&&(je.flags|=2048,kn(9,{destroy:void 0},Pp.bind(null,i,s),null)),[l,c,e]}function Pp(e,a){e.action=a}function Gm(e){var a=Pe(),s=Le;if(s!==null)return qm(a,s,e);Pe(),a=a.memoizedState,s=Pe();var l=s.queue.dispatch;return s.memoizedState=e,[a,l,!1]}function kn(e,a,s,l){return e={tag:e,create:s,deps:l,inst:a,next:null},a=je.updateQueue,a===null&&(a=Ui(),je.updateQueue=a),s=a.lastEffect,s===null?a.lastEffect=e.next=e:(l=s.next,s.next=e,e.next=l,a.lastEffect=e),e}function Km(){return Pe().memoizedState}function Hi(e,a,s,l){var i=Nt();je.flags|=e,i.memoizedState=kn(1|a,{destroy:void 0},s,l===void 0?null:l)}function qi(e,a,s,l){var i=Pe();l=l===void 0?null:l;var c=i.memoizedState.inst;Le!==null&&l!==null&&Qc(l,Le.memoizedState.deps)?i.memoizedState=kn(a,c,s,l):(je.flags|=e,i.memoizedState=kn(1|a,c,s,l))}function Vm(e,a){Hi(8390656,8,e,a)}function so(e,a){qi(2048,8,e,a)}function Wp(e){je.flags|=4;var a=je.updateQueue;if(a===null)a=Ui(),je.updateQueue=a,a.events=[e];else{var s=a.events;s===null?a.events=[e]:s.push(e)}}function Ym(e){var a=Pe().memoizedState;return Wp({ref:a,nextImpl:e}),function(){if((Me&2)!==0)throw Error(o(440));return a.impl.apply(void 0,arguments)}}function Xm(e,a){return qi(4,2,e,a)}function Qm(e,a){return qi(4,4,e,a)}function Zm(e,a){if(typeof a=="function"){e=e();var s=a(e);return function(){typeof s=="function"?s():a(null)}}if(a!=null)return e=e(),a.current=e,function(){a.current=null}}function Jm(e,a,s){s=s!=null?s.concat([e]):null,qi(4,4,Zm.bind(null,a,e),s)}function no(){}function Fm(e,a){var s=Pe();a=a===void 0?null:a;var l=s.memoizedState;return a!==null&&Qc(a,l[1])?l[0]:(s.memoizedState=[e,a],e)}function Im(e,a){var s=Pe();a=a===void 0?null:a;var l=s.memoizedState;if(a!==null&&Qc(a,l[1]))return l[0];if(l=e(),Bs){Qa(!0);try{e()}finally{Qa(!1)}}return s.memoizedState=[l,a],l}function lo(e,a,s){return s===void 0||(Ea&1073741824)!==0&&(ze&261930)===0?e.memoizedState=a:(e.memoizedState=s,e=Px(),je.lanes|=e,rs|=e,s)}function Pm(e,a,s,l){return _t(s,a)?s:Nn.current!==null?(e=lo(e,s,l),_t(e,a)||(at=!0),e):(Ea&42)===0||(Ea&1073741824)!==0&&(ze&261930)===0?(at=!0,e.memoizedState=s):(e=Px(),je.lanes|=e,rs|=e,a)}function Wm(e,a,s,l,i){var c=_.p;_.p=c!==0&&8>c?c:8;var x=K.T,v={};K.T=v,co(e,!1,a,s);try{var A=i(),B=K.S;if(B!==null&&B(v,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var Y=Zp(A,l);vl(e,a,Y,Gt(e))}else vl(e,a,l,Gt(e))}catch(I){vl(e,a,{then:function(){},status:"rejected",reason:I},Gt())}finally{_.p=c,x!==null&&v.types!==null&&(x.types=v.types),K.T=x}}function eg(){}function io(e,a,s,l){if(e.tag!==5)throw Error(o(476));var i=ex(e).queue;Wm(e,i,a,Z,s===null?eg:function(){return tx(e),s(l)})}function ex(e){var a=e.memoizedState;if(a!==null)return a;a={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ta,lastRenderedState:Z},next:null};var s={};return a.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ta,lastRenderedState:s},next:null},e.memoizedState=a,e=e.alternate,e!==null&&(e.memoizedState=a),a}function tx(e){var a=ex(e);a.next===null&&(a=e.alternate.memoizedState),vl(e,a.next.queue,{},Gt())}function ro(){return mt(Ul)}function ax(){return Pe().memoizedState}function sx(){return Pe().memoizedState}function tg(e){for(var a=e.return;a!==null;){switch(a.tag){case 24:case 3:var s=Gt();e=ts(s);var l=as(a,e,s);l!==null&&(Tt(l,a,s),hl(l,a,s)),a={cache:_c()},e.payload=a;return}a=a.return}}function ag(e,a,s){var l=Gt();s={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Gi(e)?lx(a,s):(s=kc(e,a,s,l),s!==null&&(Tt(s,e,l),ix(s,a,l)))}function nx(e,a,s){var l=Gt();vl(e,a,s,l)}function vl(e,a,s,l){var i={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Gi(e))lx(a,i);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=a.lastRenderedReducer,c!==null))try{var x=a.lastRenderedState,v=c(x,s);if(i.hasEagerState=!0,i.eagerState=v,_t(v,x))return Ni(e,a,i,0),Be===null&&ji(),!1}catch{}finally{}if(s=kc(e,a,i,l),s!==null)return Tt(s,e,l),ix(s,a,l),!0}return!1}function co(e,a,s,l){if(l={lane:2,revertLane:qo(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Gi(e)){if(a)throw Error(o(479))}else a=kc(e,s,l,2),a!==null&&Tt(a,e,2)}function Gi(e){var a=e.alternate;return e===je||a!==null&&a===je}function lx(e,a){wn=Li=!0;var s=e.pending;s===null?a.next=a:(a.next=s.next,s.next=a),e.pending=a}function ix(e,a,s){if((s&4194048)!==0){var l=a.lanes;l&=e.pendingLanes,s|=l,a.lanes=s,uu(e,s)}}var jl={readContext:mt,use:Bi,useCallback:Qe,useContext:Qe,useEffect:Qe,useImperativeHandle:Qe,useLayoutEffect:Qe,useInsertionEffect:Qe,useMemo:Qe,useReducer:Qe,useRef:Qe,useState:Qe,useDebugValue:Qe,useDeferredValue:Qe,useTransition:Qe,useSyncExternalStore:Qe,useId:Qe,useHostTransitionStatus:Qe,useFormState:Qe,useActionState:Qe,useOptimistic:Qe,useMemoCache:Qe,useCacheRefresh:Qe};jl.useEffectEvent=Qe;var rx={readContext:mt,use:Bi,useCallback:function(e,a){return Nt().memoizedState=[e,a===void 0?null:a],e},useContext:mt,useEffect:Vm,useImperativeHandle:function(e,a,s){s=s!=null?s.concat([e]):null,Hi(4194308,4,Zm.bind(null,a,e),s)},useLayoutEffect:function(e,a){return Hi(4194308,4,e,a)},useInsertionEffect:function(e,a){Hi(4,2,e,a)},useMemo:function(e,a){var s=Nt();a=a===void 0?null:a;var l=e();if(Bs){Qa(!0);try{e()}finally{Qa(!1)}}return s.memoizedState=[l,a],l},useReducer:function(e,a,s){var l=Nt();if(s!==void 0){var i=s(a);if(Bs){Qa(!0);try{s(a)}finally{Qa(!1)}}}else i=a;return l.memoizedState=l.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},l.queue=e,e=e.dispatch=ag.bind(null,je,e),[l.memoizedState,e]},useRef:function(e){var a=Nt();return e={current:e},a.memoizedState=e},useState:function(e){e=to(e);var a=e.queue,s=nx.bind(null,je,a);return a.dispatch=s,[e.memoizedState,s]},useDebugValue:no,useDeferredValue:function(e,a){var s=Nt();return lo(s,e,a)},useTransition:function(){var e=to(!1);return e=Wm.bind(null,je,e.queue,!0,!1),Nt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,a,s){var l=je,i=Nt();if(Ae){if(s===void 0)throw Error(o(407));s=s()}else{if(s=a(),Be===null)throw Error(o(349));(ze&127)!==0||Am(l,a,s)}i.memoizedState=s;var c={value:s,getSnapshot:a};return i.queue=c,Vm(Tm.bind(null,l,c,e),[e]),l.flags|=2048,kn(9,{destroy:void 0},Em.bind(null,l,c,s,a),null),s},useId:function(){var e=Nt(),a=Be.identifierPrefix;if(Ae){var s=ma,l=ua;s=(l&~(1<<32-Lt(l)-1)).toString(32)+s,a="_"+a+"R_"+s,s=_i++,0<s&&(a+="H"+s.toString(32)),a+="_"}else s=Jp++,a="_"+a+"r_"+s.toString(32)+"_";return e.memoizedState=a},useHostTransitionStatus:ro,useFormState:$m,useActionState:$m,useOptimistic:function(e){var a=Nt();a.memoizedState=a.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=s,a=co.bind(null,je,!0,s),s.dispatch=a,[e,a]},useMemoCache:Pc,useCacheRefresh:function(){return Nt().memoizedState=tg.bind(null,je)},useEffectEvent:function(e){var a=Nt(),s={impl:e};return a.memoizedState=s,function(){if((Me&2)!==0)throw Error(o(440));return s.impl.apply(void 0,arguments)}}},oo={readContext:mt,use:Bi,useCallback:Fm,useContext:mt,useEffect:so,useImperativeHandle:Jm,useInsertionEffect:Xm,useLayoutEffect:Qm,useMemo:Im,useReducer:$i,useRef:Km,useState:function(){return $i(Ta)},useDebugValue:no,useDeferredValue:function(e,a){var s=Pe();return Pm(s,Le.memoizedState,e,a)},useTransition:function(){var e=$i(Ta)[0],a=Pe().memoizedState;return[typeof e=="boolean"?e:yl(e),a]},useSyncExternalStore:Cm,useId:ax,useHostTransitionStatus:ro,useFormState:Hm,useActionState:Hm,useOptimistic:function(e,a){var s=Pe();return Dm(s,Le,e,a)},useMemoCache:Pc,useCacheRefresh:sx};oo.useEffectEvent=Ym;var cx={readContext:mt,use:Bi,useCallback:Fm,useContext:mt,useEffect:so,useImperativeHandle:Jm,useInsertionEffect:Xm,useLayoutEffect:Qm,useMemo:Im,useReducer:eo,useRef:Km,useState:function(){return eo(Ta)},useDebugValue:no,useDeferredValue:function(e,a){var s=Pe();return Le===null?lo(s,e,a):Pm(s,Le.memoizedState,e,a)},useTransition:function(){var e=eo(Ta)[0],a=Pe().memoizedState;return[typeof e=="boolean"?e:yl(e),a]},useSyncExternalStore:Cm,useId:ax,useHostTransitionStatus:ro,useFormState:Gm,useActionState:Gm,useOptimistic:function(e,a){var s=Pe();return Le!==null?Dm(s,Le,e,a):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:Pc,useCacheRefresh:sx};cx.useEffectEvent=Ym;function uo(e,a,s,l){a=e.memoizedState,s=s(l,a),s=s==null?a:y({},a,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var mo={enqueueSetState:function(e,a,s){e=e._reactInternals;var l=Gt(),i=ts(l);i.payload=a,s!=null&&(i.callback=s),a=as(e,i,l),a!==null&&(Tt(a,e,l),hl(a,e,l))},enqueueReplaceState:function(e,a,s){e=e._reactInternals;var l=Gt(),i=ts(l);i.tag=1,i.payload=a,s!=null&&(i.callback=s),a=as(e,i,l),a!==null&&(Tt(a,e,l),hl(a,e,l))},enqueueForceUpdate:function(e,a){e=e._reactInternals;var s=Gt(),l=ts(s);l.tag=2,a!=null&&(l.callback=a),a=as(e,l,s),a!==null&&(Tt(a,e,s),hl(a,e,s))}};function ox(e,a,s,l,i,c,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,c,x):a.prototype&&a.prototype.isPureReactComponent?!rl(s,l)||!rl(i,c):!0}function dx(e,a,s,l){e=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(s,l),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(s,l),a.state!==e&&mo.enqueueReplaceState(a,a.state,null)}function $s(e,a){var s=a;if("ref"in a){s={};for(var l in a)l!=="ref"&&(s[l]=a[l])}if(e=e.defaultProps){s===a&&(s=y({},s));for(var i in e)s[i]===void 0&&(s[i]=e[i])}return s}function ux(e){vi(e)}function mx(e){console.error(e)}function xx(e){vi(e)}function Ki(e,a){try{var s=e.onUncaughtError;s(a.value,{componentStack:a.stack})}catch(l){setTimeout(function(){throw l})}}function fx(e,a,s){try{var l=e.onCaughtError;l(s.value,{componentStack:s.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function xo(e,a,s){return s=ts(s),s.tag=3,s.payload={element:null},s.callback=function(){Ki(e,a)},s}function hx(e){return e=ts(e),e.tag=3,e}function px(e,a,s,l){var i=s.type.getDerivedStateFromError;if(typeof i=="function"){var c=l.value;e.payload=function(){return i(c)},e.callback=function(){fx(a,s,l)}}var x=s.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){fx(a,s,l),typeof i!="function"&&(cs===null?cs=new Set([this]):cs.add(this));var v=l.stack;this.componentDidCatch(l.value,{componentStack:v!==null?v:""})})}function sg(e,a,s,l,i){if(s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(a=s.alternate,a!==null&&gn(a,s,i,!0),s=Bt.current,s!==null){switch(s.tag){case 31:case 13:return Wt===null?tr():s.alternate===null&&Ze===0&&(Ze=3),s.flags&=-257,s.flags|=65536,s.lanes=i,l===Ti?s.flags|=16384:(a=s.updateQueue,a===null?s.updateQueue=new Set([l]):a.add(l),Bo(e,l,i)),!1;case 22:return s.flags|=65536,l===Ti?s.flags|=16384:(a=s.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([l])},s.updateQueue=a):(s=a.retryQueue,s===null?a.retryQueue=new Set([l]):s.add(l)),Bo(e,l,i)),!1}throw Error(o(435,s.tag))}return Bo(e,l,i),tr(),!1}if(Ae)return a=Bt.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=i,l!==Rc&&(e=Error(o(422),{cause:l}),dl(Jt(e,s)))):(l!==Rc&&(a=Error(o(423),{cause:l}),dl(Jt(a,s))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,l=Jt(l,s),i=xo(e.stateNode,l,i),Gc(e,i),Ze!==4&&(Ze=2)),!1;var c=Error(o(520),{cause:l});if(c=Jt(c,s),El===null?El=[c]:El.push(c),Ze!==4&&(Ze=2),a===null)return!0;l=Jt(l,s),s=a;do{switch(s.tag){case 3:return s.flags|=65536,e=i&-i,s.lanes|=e,e=xo(s.stateNode,l,e),Gc(s,e),!1;case 1:if(a=s.type,c=s.stateNode,(s.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(cs===null||!cs.has(c))))return s.flags|=65536,i&=-i,s.lanes|=i,i=hx(i),px(i,e,s,l),Gc(s,i),!1}s=s.return}while(s!==null);return!1}var fo=Error(o(461)),at=!1;function xt(e,a,s,l){a.child=e===null?vm(a,null,s,l):Us(a,e.child,s,l)}function gx(e,a,s,l,i){s=s.render;var c=a.ref;if("ref"in l){var x={};for(var v in l)v!=="ref"&&(x[v]=l[v])}else x=l;return Ds(a),l=Zc(e,a,s,x,c,i),v=Jc(),e!==null&&!at?(Fc(e,a,i),Ra(e,a,i)):(Ae&&v&&Ec(a),a.flags|=1,xt(e,a,l,i),a.child)}function bx(e,a,s,l,i){if(e===null){var c=s.type;return typeof c=="function"&&!zc(c)&&c.defaultProps===void 0&&s.compare===null?(a.tag=15,a.type=c,yx(e,a,c,l,i)):(e=Si(s.type,null,l,a,a.mode,i),e.ref=a.ref,e.return=a,a.child=e)}if(c=e.child,!No(e,i)){var x=c.memoizedProps;if(s=s.compare,s=s!==null?s:rl,s(x,l)&&e.ref===a.ref)return Ra(e,a,i)}return a.flags|=1,e=ka(c,l),e.ref=a.ref,e.return=a,a.child=e}function yx(e,a,s,l,i){if(e!==null){var c=e.memoizedProps;if(rl(c,l)&&e.ref===a.ref)if(at=!1,a.pendingProps=l=c,No(e,i))(e.flags&131072)!==0&&(at=!0);else return a.lanes=e.lanes,Ra(e,a,i)}return ho(e,a,s,l,i)}function vx(e,a,s,l){var i=l.children,c=e!==null?e.memoizedState:null;if(e===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((a.flags&128)!==0){if(c=c!==null?c.baseLanes|s:s,e!==null){for(l=a.child=e.child,i=0;l!==null;)i=i|l.lanes|l.childLanes,l=l.sibling;l=i&~c}else l=0,a.child=null;return jx(e,a,c,s,l)}if((s&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ai(a,c!==null?c.cachePool:null),c!==null?wm(a,c):Vc(),Sm(a);else return l=a.lanes=536870912,jx(e,a,c!==null?c.baseLanes|s:s,s,l)}else c!==null?(Ai(a,c.cachePool),wm(a,c),ns(),a.memoizedState=null):(e!==null&&Ai(a,null),Vc(),ns());return xt(e,a,i,s),a.child}function Nl(e,a){return e!==null&&e.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function jx(e,a,s,l,i){var c=Bc();return c=c===null?null:{parent:et._currentValue,pool:c},a.memoizedState={baseLanes:s,cachePool:c},e!==null&&Ai(a,null),Vc(),Sm(a),e!==null&&gn(e,a,l,!0),a.childLanes=i,null}function Vi(e,a){return a=Xi({mode:a.mode,children:a.children},e.mode),a.ref=e.ref,e.child=a,a.return=e,a}function Nx(e,a,s){return Us(a,e.child,null,s),e=Vi(a,a.pendingProps),e.flags|=2,$t(a),a.memoizedState=null,e}function ng(e,a,s){var l=a.pendingProps,i=(a.flags&128)!==0;if(a.flags&=-129,e===null){if(Ae){if(l.mode==="hidden")return e=Vi(a,l),a.lanes=536870912,Nl(null,e);if(Xc(a),(e=qe)?(e=Lf(e,Pt),e=e!==null&&e.data==="&"?e:null,e!==null&&(a.memoizedState={dehydrated:e,treeContext:Fa!==null?{id:ua,overflow:ma}:null,retryLane:536870912,hydrationErrors:null},s=lm(e),s.return=a,a.child=s,ut=a,qe=null)):e=null,e===null)throw Pa(a);return a.lanes=536870912,null}return Vi(a,l)}var c=e.memoizedState;if(c!==null){var x=c.dehydrated;if(Xc(a),i)if(a.flags&256)a.flags&=-257,a=Nx(e,a,s);else if(a.memoizedState!==null)a.child=e.child,a.flags|=128,a=null;else throw Error(o(558));else if(at||gn(e,a,s,!1),i=(s&e.childLanes)!==0,at||i){if(l=Be,l!==null&&(x=mu(l,s),x!==0&&x!==c.retryLane))throw c.retryLane=x,Es(e,x),Tt(l,e,x),fo;tr(),a=Nx(e,a,s)}else e=c.treeContext,qe=ea(x.nextSibling),ut=a,Ae=!0,Ia=null,Pt=!1,e!==null&&cm(a,e),a=Vi(a,l),a.flags|=4096;return a}return e=ka(e.child,{mode:l.mode,children:l.children}),e.ref=a.ref,a.child=e,e.return=a,e}function Yi(e,a){var s=a.ref;if(s===null)e!==null&&e.ref!==null&&(a.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(o(284));(e===null||e.ref!==s)&&(a.flags|=4194816)}}function ho(e,a,s,l,i){return Ds(a),s=Zc(e,a,s,l,void 0,i),l=Jc(),e!==null&&!at?(Fc(e,a,i),Ra(e,a,i)):(Ae&&l&&Ec(a),a.flags|=1,xt(e,a,s,i),a.child)}function wx(e,a,s,l,i,c){return Ds(a),a.updateQueue=null,s=zm(a,l,s,i),km(e),l=Jc(),e!==null&&!at?(Fc(e,a,c),Ra(e,a,c)):(Ae&&l&&Ec(a),a.flags|=1,xt(e,a,s,c),a.child)}function Sx(e,a,s,l,i){if(Ds(a),a.stateNode===null){var c=xn,x=s.contextType;typeof x=="object"&&x!==null&&(c=mt(x)),c=new s(l,c),a.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=mo,a.stateNode=c,c._reactInternals=a,c=a.stateNode,c.props=l,c.state=a.memoizedState,c.refs={},Hc(a),x=s.contextType,c.context=typeof x=="object"&&x!==null?mt(x):xn,c.state=a.memoizedState,x=s.getDerivedStateFromProps,typeof x=="function"&&(uo(a,s,x,l),c.state=a.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(x=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),x!==c.state&&mo.enqueueReplaceState(c,c.state,null),gl(a,l,c,i),pl(),c.state=a.memoizedState),typeof c.componentDidMount=="function"&&(a.flags|=4194308),l=!0}else if(e===null){c=a.stateNode;var v=a.memoizedProps,A=$s(s,v);c.props=A;var B=c.context,Y=s.contextType;x=xn,typeof Y=="object"&&Y!==null&&(x=mt(Y));var I=s.getDerivedStateFromProps;Y=typeof I=="function"||typeof c.getSnapshotBeforeUpdate=="function",v=a.pendingProps!==v,Y||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(v||B!==x)&&dx(a,c,l,x),es=!1;var q=a.memoizedState;c.state=q,gl(a,l,c,i),pl(),B=a.memoizedState,v||q!==B||es?(typeof I=="function"&&(uo(a,s,I,l),B=a.memoizedState),(A=es||ox(a,s,A,l,q,B,x))?(Y||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"&&(a.flags|=4194308)):(typeof c.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=l,a.memoizedState=B),c.props=l,c.state=B,c.context=x,l=A):(typeof c.componentDidMount=="function"&&(a.flags|=4194308),l=!1)}else{c=a.stateNode,qc(e,a),x=a.memoizedProps,Y=$s(s,x),c.props=Y,I=a.pendingProps,q=c.context,B=s.contextType,A=xn,typeof B=="object"&&B!==null&&(A=mt(B)),v=s.getDerivedStateFromProps,(B=typeof v=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(x!==I||q!==A)&&dx(a,c,l,A),es=!1,q=a.memoizedState,c.state=q,gl(a,l,c,i),pl();var V=a.memoizedState;x!==I||q!==V||es||e!==null&&e.dependencies!==null&&zi(e.dependencies)?(typeof v=="function"&&(uo(a,s,v,l),V=a.memoizedState),(Y=es||ox(a,s,Y,l,q,V,A)||e!==null&&e.dependencies!==null&&zi(e.dependencies))?(B||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(l,V,A),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(l,V,A)),typeof c.componentDidUpdate=="function"&&(a.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof c.componentDidUpdate!="function"||x===e.memoizedProps&&q===e.memoizedState||(a.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&q===e.memoizedState||(a.flags|=1024),a.memoizedProps=l,a.memoizedState=V),c.props=l,c.state=V,c.context=A,l=Y):(typeof c.componentDidUpdate!="function"||x===e.memoizedProps&&q===e.memoizedState||(a.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&q===e.memoizedState||(a.flags|=1024),l=!1)}return c=l,Yi(e,a),l=(a.flags&128)!==0,c||l?(c=a.stateNode,s=l&&typeof s.getDerivedStateFromError!="function"?null:c.render(),a.flags|=1,e!==null&&l?(a.child=Us(a,e.child,null,i),a.child=Us(a,null,s,i)):xt(e,a,s,i),a.memoizedState=c.state,e=a.child):e=Ra(e,a,i),e}function kx(e,a,s,l){return Rs(),a.flags|=256,xt(e,a,s,l),a.child}var po={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function go(e){return{baseLanes:e,cachePool:fm()}}function bo(e,a,s){return e=e!==null?e.childLanes&~s:0,a&&(e|=qt),e}function zx(e,a,s){var l=a.pendingProps,i=!1,c=(a.flags&128)!==0,x;if((x=c)||(x=e!==null&&e.memoizedState===null?!1:(Ie.current&2)!==0),x&&(i=!0,a.flags&=-129),x=(a.flags&32)!==0,a.flags&=-33,e===null){if(Ae){if(i?ss(a):ns(),(e=qe)?(e=Lf(e,Pt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(a.memoizedState={dehydrated:e,treeContext:Fa!==null?{id:ua,overflow:ma}:null,retryLane:536870912,hydrationErrors:null},s=lm(e),s.return=a,a.child=s,ut=a,qe=null)):e=null,e===null)throw Pa(a);return ed(e)?a.lanes=32:a.lanes=536870912,null}var v=l.children;return l=l.fallback,i?(ns(),i=a.mode,v=Xi({mode:"hidden",children:v},i),l=Ts(l,i,s,null),v.return=a,l.return=a,v.sibling=l,a.child=v,l=a.child,l.memoizedState=go(s),l.childLanes=bo(e,x,s),a.memoizedState=po,Nl(null,l)):(ss(a),yo(a,v))}var A=e.memoizedState;if(A!==null&&(v=A.dehydrated,v!==null)){if(c)a.flags&256?(ss(a),a.flags&=-257,a=vo(e,a,s)):a.memoizedState!==null?(ns(),a.child=e.child,a.flags|=128,a=null):(ns(),v=l.fallback,i=a.mode,l=Xi({mode:"visible",children:l.children},i),v=Ts(v,i,s,null),v.flags|=2,l.return=a,v.return=a,l.sibling=v,a.child=l,Us(a,e.child,null,s),l=a.child,l.memoizedState=go(s),l.childLanes=bo(e,x,s),a.memoizedState=po,a=Nl(null,l));else if(ss(a),ed(v)){if(x=v.nextSibling&&v.nextSibling.dataset,x)var B=x.dgst;x=B,l=Error(o(419)),l.stack="",l.digest=x,dl({value:l,source:null,stack:null}),a=vo(e,a,s)}else if(at||gn(e,a,s,!1),x=(s&e.childLanes)!==0,at||x){if(x=Be,x!==null&&(l=mu(x,s),l!==0&&l!==A.retryLane))throw A.retryLane=l,Es(e,l),Tt(x,e,l),fo;Wo(v)||tr(),a=vo(e,a,s)}else Wo(v)?(a.flags|=192,a.child=e.child,a=null):(e=A.treeContext,qe=ea(v.nextSibling),ut=a,Ae=!0,Ia=null,Pt=!1,e!==null&&cm(a,e),a=yo(a,l.children),a.flags|=4096);return a}return i?(ns(),v=l.fallback,i=a.mode,A=e.child,B=A.sibling,l=ka(A,{mode:"hidden",children:l.children}),l.subtreeFlags=A.subtreeFlags&65011712,B!==null?v=ka(B,v):(v=Ts(v,i,s,null),v.flags|=2),v.return=a,l.return=a,l.sibling=v,a.child=l,Nl(null,l),l=a.child,v=e.child.memoizedState,v===null?v=go(s):(i=v.cachePool,i!==null?(A=et._currentValue,i=i.parent!==A?{parent:A,pool:A}:i):i=fm(),v={baseLanes:v.baseLanes|s,cachePool:i}),l.memoizedState=v,l.childLanes=bo(e,x,s),a.memoizedState=po,Nl(e.child,l)):(ss(a),s=e.child,e=s.sibling,s=ka(s,{mode:"visible",children:l.children}),s.return=a,s.sibling=null,e!==null&&(x=a.deletions,x===null?(a.deletions=[e],a.flags|=16):x.push(e)),a.child=s,a.memoizedState=null,s)}function yo(e,a){return a=Xi({mode:"visible",children:a},e.mode),a.return=e,e.child=a}function Xi(e,a){return e=Ut(22,e,null,a),e.lanes=0,e}function vo(e,a,s){return Us(a,e.child,null,s),e=yo(a,a.pendingProps.children),e.flags|=2,a.memoizedState=null,e}function Cx(e,a,s){e.lanes|=a;var l=e.alternate;l!==null&&(l.lanes|=a),Oc(e.return,a,s)}function jo(e,a,s,l,i,c){var x=e.memoizedState;x===null?e.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:l,tail:s,tailMode:i,treeForkCount:c}:(x.isBackwards=a,x.rendering=null,x.renderingStartTime=0,x.last=l,x.tail=s,x.tailMode=i,x.treeForkCount=c)}function Ax(e,a,s){var l=a.pendingProps,i=l.revealOrder,c=l.tail;l=l.children;var x=Ie.current,v=(x&2)!==0;if(v?(x=x&1|2,a.flags|=128):x&=1,ie(Ie,x),xt(e,a,l,s),l=Ae?ol:0,!v&&e!==null&&(e.flags&128)!==0)e:for(e=a.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Cx(e,s,a);else if(e.tag===19)Cx(e,s,a);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===a)break e;for(;e.sibling===null;){if(e.return===null||e.return===a)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case"forwards":for(s=a.child,i=null;s!==null;)e=s.alternate,e!==null&&Oi(e)===null&&(i=s),s=s.sibling;s=i,s===null?(i=a.child,a.child=null):(i=s.sibling,s.sibling=null),jo(a,!1,i,s,c,l);break;case"backwards":case"unstable_legacy-backwards":for(s=null,i=a.child,a.child=null;i!==null;){if(e=i.alternate,e!==null&&Oi(e)===null){a.child=i;break}e=i.sibling,i.sibling=s,s=i,i=e}jo(a,!0,s,null,c,l);break;case"together":jo(a,!1,null,null,void 0,l);break;default:a.memoizedState=null}return a.child}function Ra(e,a,s){if(e!==null&&(a.dependencies=e.dependencies),rs|=a.lanes,(s&a.childLanes)===0)if(e!==null){if(gn(e,a,s,!1),(s&a.childLanes)===0)return null}else return null;if(e!==null&&a.child!==e.child)throw Error(o(153));if(a.child!==null){for(e=a.child,s=ka(e,e.pendingProps),a.child=s,s.return=a;e.sibling!==null;)e=e.sibling,s=s.sibling=ka(e,e.pendingProps),s.return=a;s.sibling=null}return a.child}function No(e,a){return(e.lanes&a)!==0?!0:(e=e.dependencies,!!(e!==null&&zi(e)))}function lg(e,a,s){switch(a.tag){case 3:we(a,a.stateNode.containerInfo),Wa(a,et,e.memoizedState.cache),Rs();break;case 27:case 5:Xe(a);break;case 4:we(a,a.stateNode.containerInfo);break;case 10:Wa(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,Xc(a),null;break;case 13:var l=a.memoizedState;if(l!==null)return l.dehydrated!==null?(ss(a),a.flags|=128,null):(s&a.child.childLanes)!==0?zx(e,a,s):(ss(a),e=Ra(e,a,s),e!==null?e.sibling:null);ss(a);break;case 19:var i=(e.flags&128)!==0;if(l=(s&a.childLanes)!==0,l||(gn(e,a,s,!1),l=(s&a.childLanes)!==0),i){if(l)return Ax(e,a,s);a.flags|=128}if(i=a.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ie(Ie,Ie.current),l)break;return null;case 22:return a.lanes=0,vx(e,a,s,a.pendingProps);case 24:Wa(a,et,e.memoizedState.cache)}return Ra(e,a,s)}function Ex(e,a,s){if(e!==null)if(e.memoizedProps!==a.pendingProps)at=!0;else{if(!No(e,s)&&(a.flags&128)===0)return at=!1,lg(e,a,s);at=(e.flags&131072)!==0}else at=!1,Ae&&(a.flags&1048576)!==0&&rm(a,ol,a.index);switch(a.lanes=0,a.tag){case 16:e:{var l=a.pendingProps;if(e=Ls(a.elementType),a.type=e,typeof e=="function")zc(e)?(l=$s(e,l),a.tag=1,a=Sx(null,a,e,l,s)):(a.tag=0,a=ho(null,a,e,l,s));else{if(e!=null){var i=e.$$typeof;if(i===E){a.tag=11,a=gx(null,a,e,l,s);break e}else if(i===H){a.tag=14,a=bx(null,a,e,l,s);break e}}throw a=re(e)||e,Error(o(306,a,""))}}return a;case 0:return ho(e,a,a.type,a.pendingProps,s);case 1:return l=a.type,i=$s(l,a.pendingProps),Sx(e,a,l,i,s);case 3:e:{if(we(a,a.stateNode.containerInfo),e===null)throw Error(o(387));l=a.pendingProps;var c=a.memoizedState;i=c.element,qc(e,a),gl(a,l,null,s);var x=a.memoizedState;if(l=x.cache,Wa(a,et,l),l!==c.cache&&Lc(a,[et],s,!0),pl(),l=x.element,c.isDehydrated)if(c={element:l,isDehydrated:!1,cache:x.cache},a.updateQueue.baseState=c,a.memoizedState=c,a.flags&256){a=kx(e,a,l,s);break e}else if(l!==i){i=Jt(Error(o(424)),a),dl(i),a=kx(e,a,l,s);break e}else{switch(e=a.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(qe=ea(e.firstChild),ut=a,Ae=!0,Ia=null,Pt=!0,s=vm(a,null,l,s),a.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(Rs(),l===i){a=Ra(e,a,s);break e}xt(e,a,l,s)}a=a.child}return a;case 26:return Yi(e,a),e===null?(s=qf(a.type,null,a.pendingProps,null))?a.memoizedState=s:Ae||(s=a.type,e=a.pendingProps,l=cr(ue.current).createElement(s),l[dt]=a,l[St]=e,ft(l,s,e),it(l),a.stateNode=l):a.memoizedState=qf(a.type,e.memoizedProps,a.pendingProps,e.memoizedState),null;case 27:return Xe(a),e===null&&Ae&&(l=a.stateNode=Bf(a.type,a.pendingProps,ue.current),ut=a,Pt=!0,i=qe,ms(a.type)?(td=i,qe=ea(l.firstChild)):qe=i),xt(e,a,a.pendingProps.children,s),Yi(e,a),e===null&&(a.flags|=4194304),a.child;case 5:return e===null&&Ae&&((i=l=qe)&&(l=Lg(l,a.type,a.pendingProps,Pt),l!==null?(a.stateNode=l,ut=a,qe=ea(l.firstChild),Pt=!1,i=!0):i=!1),i||Pa(a)),Xe(a),i=a.type,c=a.pendingProps,x=e!==null?e.memoizedProps:null,l=c.children,Fo(i,c)?l=null:x!==null&&Fo(i,x)&&(a.flags|=32),a.memoizedState!==null&&(i=Zc(e,a,Fp,null,null,s),Ul._currentValue=i),Yi(e,a),xt(e,a,l,s),a.child;case 6:return e===null&&Ae&&((e=s=qe)&&(s=_g(s,a.pendingProps,Pt),s!==null?(a.stateNode=s,ut=a,qe=null,e=!0):e=!1),e||Pa(a)),null;case 13:return zx(e,a,s);case 4:return we(a,a.stateNode.containerInfo),l=a.pendingProps,e===null?a.child=Us(a,null,l,s):xt(e,a,l,s),a.child;case 11:return gx(e,a,a.type,a.pendingProps,s);case 7:return xt(e,a,a.pendingProps,s),a.child;case 8:return xt(e,a,a.pendingProps.children,s),a.child;case 12:return xt(e,a,a.pendingProps.children,s),a.child;case 10:return l=a.pendingProps,Wa(a,a.type,l.value),xt(e,a,l.children,s),a.child;case 9:return i=a.type._context,l=a.pendingProps.children,Ds(a),i=mt(i),l=l(i),a.flags|=1,xt(e,a,l,s),a.child;case 14:return bx(e,a,a.type,a.pendingProps,s);case 15:return yx(e,a,a.type,a.pendingProps,s);case 19:return Ax(e,a,s);case 31:return ng(e,a,s);case 22:return vx(e,a,s,a.pendingProps);case 24:return Ds(a),l=mt(et),e===null?(i=Bc(),i===null&&(i=Be,c=_c(),i.pooledCache=c,c.refCount++,c!==null&&(i.pooledCacheLanes|=s),i=c),a.memoizedState={parent:l,cache:i},Hc(a),Wa(a,et,i)):((e.lanes&s)!==0&&(qc(e,a),gl(a,null,null,s),pl()),i=e.memoizedState,c=a.memoizedState,i.parent!==l?(i={parent:l,cache:l},a.memoizedState=i,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=i),Wa(a,et,l)):(l=c.cache,Wa(a,et,l),l!==i.cache&&Lc(a,[et],s,!0))),xt(e,a,a.pendingProps.children,s),a.child;case 29:throw a.pendingProps}throw Error(o(156,a.tag))}function Ma(e){e.flags|=4}function wo(e,a,s,l,i){if((a=(e.mode&32)!==0)&&(a=!1),a){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(af())e.flags|=8192;else throw _s=Ti,$c}else e.flags&=-16777217}function Tx(e,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Xf(a))if(af())e.flags|=8192;else throw _s=Ti,$c}function Qi(e,a){a!==null&&(e.flags|=4),e.flags&16384&&(a=e.tag!==22?ou():536870912,e.lanes|=a,En|=a)}function wl(e,a){if(!Ae)switch(e.tailMode){case"hidden":a=e.tail;for(var s=null;a!==null;)a.alternate!==null&&(s=a),a=a.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var l=null;s!==null;)s.alternate!==null&&(l=s),s=s.sibling;l===null?a||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function Ge(e){var a=e.alternate!==null&&e.alternate.child===e.child,s=0,l=0;if(a)for(var i=e.child;i!==null;)s|=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;)s|=i.lanes|i.childLanes,l|=i.subtreeFlags,l|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=l,e.childLanes=s,a}function ig(e,a,s){var l=a.pendingProps;switch(Tc(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ge(a),null;case 1:return Ge(a),null;case 3:return s=a.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),a.memoizedState.cache!==l&&(a.flags|=2048),Aa(et),be(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(pn(a)?Ma(a):e===null||e.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Mc())),Ge(a),null;case 26:var i=a.type,c=a.memoizedState;return e===null?(Ma(a),c!==null?(Ge(a),Tx(a,c)):(Ge(a),wo(a,i,null,l,s))):c?c!==e.memoizedState?(Ma(a),Ge(a),Tx(a,c)):(Ge(a),a.flags&=-16777217):(e=e.memoizedProps,e!==l&&Ma(a),Ge(a),wo(a,i,e,l,s)),null;case 27:if(Ye(a),s=ue.current,i=a.type,e!==null&&a.stateNode!=null)e.memoizedProps!==l&&Ma(a);else{if(!l){if(a.stateNode===null)throw Error(o(166));return Ge(a),null}e=$.current,pn(a)?om(a):(e=Bf(i,l,s),a.stateNode=e,Ma(a))}return Ge(a),null;case 5:if(Ye(a),i=a.type,e!==null&&a.stateNode!=null)e.memoizedProps!==l&&Ma(a);else{if(!l){if(a.stateNode===null)throw Error(o(166));return Ge(a),null}if(c=$.current,pn(a))om(a);else{var x=cr(ue.current);switch(c){case 1:c=x.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:c=x.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":c=x.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":c=x.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":c=x.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof l.is=="string"?x.createElement("select",{is:l.is}):x.createElement("select"),l.multiple?c.multiple=!0:l.size&&(c.size=l.size);break;default:c=typeof l.is=="string"?x.createElement(i,{is:l.is}):x.createElement(i)}}c[dt]=a,c[St]=l;e:for(x=a.child;x!==null;){if(x.tag===5||x.tag===6)c.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===a)break e;for(;x.sibling===null;){if(x.return===null||x.return===a)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}a.stateNode=c;e:switch(ft(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&&Ma(a)}}return Ge(a),wo(a,a.type,e===null?null:e.memoizedProps,a.pendingProps,s),null;case 6:if(e&&a.stateNode!=null)e.memoizedProps!==l&&Ma(a);else{if(typeof l!="string"&&a.stateNode===null)throw Error(o(166));if(e=ue.current,pn(a)){if(e=a.stateNode,s=a.memoizedProps,l=null,i=ut,i!==null)switch(i.tag){case 27:case 5:l=i.memoizedProps}e[dt]=a,e=!!(e.nodeValue===s||l!==null&&l.suppressHydrationWarning===!0||Cf(e.nodeValue,s)),e||Pa(a,!0)}else e=cr(e).createTextNode(l),e[dt]=a,a.stateNode=e}return Ge(a),null;case 31:if(s=a.memoizedState,e===null||e.memoizedState!==null){if(l=pn(a),s!==null){if(e===null){if(!l)throw Error(o(318));if(e=a.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[dt]=a}else Rs(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Ge(a),e=!1}else s=Mc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return a.flags&256?($t(a),a):($t(a),null);if((a.flags&128)!==0)throw Error(o(558))}return Ge(a),null;case 13:if(l=a.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=pn(a),l!==null&&l.dehydrated!==null){if(e===null){if(!i)throw Error(o(318));if(i=a.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(o(317));i[dt]=a}else Rs(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Ge(a),i=!1}else i=Mc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return a.flags&256?($t(a),a):($t(a),null)}return $t(a),(a.flags&128)!==0?(a.lanes=s,a):(s=l!==null,e=e!==null&&e.memoizedState!==null,s&&(l=a.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)),s!==e&&s&&(a.child.flags|=8192),Qi(a,a.updateQueue),Ge(a),null);case 4:return be(),e===null&&Yo(a.stateNode.containerInfo),Ge(a),null;case 10:return Aa(a.type),Ge(a),null;case 19:if(X(Ie),l=a.memoizedState,l===null)return Ge(a),null;if(i=(a.flags&128)!==0,c=l.rendering,c===null)if(i)wl(l,!1);else{if(Ze!==0||e!==null&&(e.flags&128)!==0)for(e=a.child;e!==null;){if(c=Oi(e),c!==null){for(a.flags|=128,wl(l,!1),e=c.updateQueue,a.updateQueue=e,Qi(a,e),a.subtreeFlags=0,e=s,s=a.child;s!==null;)nm(s,e),s=s.sibling;return ie(Ie,Ie.current&1|2),Ae&&za(a,l.treeForkCount),a.child}e=e.sibling}l.tail!==null&&bt()>Pi&&(a.flags|=128,i=!0,wl(l,!1),a.lanes=4194304)}else{if(!i)if(e=Oi(c),e!==null){if(a.flags|=128,i=!0,e=e.updateQueue,a.updateQueue=e,Qi(a,e),wl(l,!0),l.tail===null&&l.tailMode==="hidden"&&!c.alternate&&!Ae)return Ge(a),null}else 2*bt()-l.renderingStartTime>Pi&&s!==536870912&&(a.flags|=128,i=!0,wl(l,!1),a.lanes=4194304);l.isBackwards?(c.sibling=a.child,a.child=c):(e=l.last,e!==null?e.sibling=c:a.child=c,l.last=c)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=bt(),e.sibling=null,s=Ie.current,ie(Ie,i?s&1|2:s&1),Ae&&za(a,l.treeForkCount),e):(Ge(a),null);case 22:case 23:return $t(a),Yc(),l=a.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(a.flags|=8192):l&&(a.flags|=8192),l?(s&536870912)!==0&&(a.flags&128)===0&&(Ge(a),a.subtreeFlags&6&&(a.flags|=8192)):Ge(a),s=a.updateQueue,s!==null&&Qi(a,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),l=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(l=a.memoizedState.cachePool.pool),l!==s&&(a.flags|=2048),e!==null&&X(Os),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),a.memoizedState.cache!==s&&(a.flags|=2048),Aa(et),Ge(a),null;case 25:return null;case 30:return null}throw Error(o(156,a.tag))}function rg(e,a){switch(Tc(a),a.tag){case 1:return e=a.flags,e&65536?(a.flags=e&-65537|128,a):null;case 3:return Aa(et),be(),e=a.flags,(e&65536)!==0&&(e&128)===0?(a.flags=e&-65537|128,a):null;case 26:case 27:case 5:return Ye(a),null;case 31:if(a.memoizedState!==null){if($t(a),a.alternate===null)throw Error(o(340));Rs()}return e=a.flags,e&65536?(a.flags=e&-65537|128,a):null;case 13:if($t(a),e=a.memoizedState,e!==null&&e.dehydrated!==null){if(a.alternate===null)throw Error(o(340));Rs()}return e=a.flags,e&65536?(a.flags=e&-65537|128,a):null;case 19:return X(Ie),null;case 4:return be(),null;case 10:return Aa(a.type),null;case 22:case 23:return $t(a),Yc(),e!==null&&X(Os),e=a.flags,e&65536?(a.flags=e&-65537|128,a):null;case 24:return Aa(et),null;case 25:return null;default:return null}}function Rx(e,a){switch(Tc(a),a.tag){case 3:Aa(et),be();break;case 26:case 27:case 5:Ye(a);break;case 4:be();break;case 31:a.memoizedState!==null&&$t(a);break;case 13:$t(a);break;case 19:X(Ie);break;case 10:Aa(a.type);break;case 22:case 23:$t(a),Yc(),e!==null&&X(Os);break;case 24:Aa(et)}}function Sl(e,a){try{var s=a.updateQueue,l=s!==null?s.lastEffect:null;if(l!==null){var i=l.next;s=i;do{if((s.tag&e)===e){l=void 0;var c=s.create,x=s.inst;l=c(),x.destroy=l}s=s.next}while(s!==i)}}catch(v){Oe(a,a.return,v)}}function ls(e,a,s){try{var l=a.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var c=i.next;l=c;do{if((l.tag&e)===e){var x=l.inst,v=x.destroy;if(v!==void 0){x.destroy=void 0,i=a;var A=s,B=v;try{B()}catch(Y){Oe(i,A,Y)}}}l=l.next}while(l!==c)}}catch(Y){Oe(a,a.return,Y)}}function Mx(e){var a=e.updateQueue;if(a!==null){var s=e.stateNode;try{Nm(a,s)}catch(l){Oe(e,e.return,l)}}}function Dx(e,a,s){s.props=$s(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(l){Oe(e,a,l)}}function kl(e,a){try{var s=e.ref;if(s!==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 s=="function"?e.refCleanup=s(l):s.current=l}}catch(i){Oe(e,a,i)}}function xa(e,a){var s=e.ref,l=e.refCleanup;if(s!==null)if(typeof l=="function")try{l()}catch(i){Oe(e,a,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(i){Oe(e,a,i)}else s.current=null}function Ox(e){var a=e.type,s=e.memoizedProps,l=e.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":s.autoFocus&&l.focus();break e;case"img":s.src?l.src=s.src:s.srcSet&&(l.srcset=s.srcSet)}}catch(i){Oe(e,e.return,i)}}function So(e,a,s){try{var l=e.stateNode;Eg(l,e.type,s,a),l[St]=a}catch(i){Oe(e,e.return,i)}}function Lx(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ms(e.type)||e.tag===4}function ko(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Lx(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&&ms(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 zo(e,a,s){var l=e.tag;if(l===5||l===6)e=e.stateNode,a?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,a):(a=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,a.appendChild(e),s=s._reactRootContainer,s!=null||a.onclick!==null||(a.onclick=wa));else if(l!==4&&(l===27&&ms(e.type)&&(s=e.stateNode,a=null),e=e.child,e!==null))for(zo(e,a,s),e=e.sibling;e!==null;)zo(e,a,s),e=e.sibling}function Zi(e,a,s){var l=e.tag;if(l===5||l===6)e=e.stateNode,a?s.insertBefore(e,a):s.appendChild(e);else if(l!==4&&(l===27&&ms(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(Zi(e,a,s),e=e.sibling;e!==null;)Zi(e,a,s),e=e.sibling}function _x(e){var a=e.stateNode,s=e.memoizedProps;try{for(var l=e.type,i=a.attributes;i.length;)a.removeAttributeNode(i[0]);ft(a,l,s),a[dt]=e,a[St]=s}catch(c){Oe(e,e.return,c)}}var Da=!1,st=!1,Co=!1,Ux=typeof WeakSet=="function"?WeakSet:Set,rt=null;function cg(e,a){if(e=e.containerInfo,Zo=hr,e=Ju(e),yc(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var l=s.getSelection&&s.getSelection();if(l&&l.rangeCount!==0){s=l.anchorNode;var i=l.anchorOffset,c=l.focusNode;l=l.focusOffset;try{s.nodeType,c.nodeType}catch{s=null;break e}var x=0,v=-1,A=-1,B=0,Y=0,I=e,q=null;t:for(;;){for(var V;I!==s||i!==0&&I.nodeType!==3||(v=x+i),I!==c||l!==0&&I.nodeType!==3||(A=x+l),I.nodeType===3&&(x+=I.nodeValue.length),(V=I.firstChild)!==null;)q=I,I=V;for(;;){if(I===e)break t;if(q===s&&++B===i&&(v=x),q===c&&++Y===l&&(A=x),(V=I.nextSibling)!==null)break;I=q,q=I.parentNode}I=V}s=v===-1||A===-1?null:{start:v,end:A}}else s=null}s=s||{start:0,end:0}}else s=null;for(Jo={focusedElem:e,selectionRange:s},hr=!1,rt=a;rt!==null;)if(a=rt,e=a.child,(a.subtreeFlags&1028)!==0&&e!==null)e.return=a,rt=e;else for(;rt!==null;){switch(a=rt,c=a.alternate,e=a.flags,a.tag){case 0:if((e&4)!==0&&(e=a.updateQueue,e=e!==null?e.events:null,e!==null))for(s=0;s<e.length;s++)i=e[s],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&c!==null){e=void 0,s=a,i=c.memoizedProps,c=c.memoizedState,l=s.stateNode;try{var de=$s(s.type,i);e=l.getSnapshotBeforeUpdate(de,c),l.__reactInternalSnapshotBeforeUpdate=e}catch(pe){Oe(s,s.return,pe)}}break;case 3:if((e&1024)!==0){if(e=a.stateNode.containerInfo,s=e.nodeType,s===9)Po(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Po(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=a.sibling,e!==null){e.return=a.return,rt=e;break}rt=a.return}}function Bx(e,a,s){var l=s.flags;switch(s.tag){case 0:case 11:case 15:La(e,s),l&4&&Sl(5,s);break;case 1:if(La(e,s),l&4)if(e=s.stateNode,a===null)try{e.componentDidMount()}catch(x){Oe(s,s.return,x)}else{var i=$s(s.type,a.memoizedProps);a=a.memoizedState;try{e.componentDidUpdate(i,a,e.__reactInternalSnapshotBeforeUpdate)}catch(x){Oe(s,s.return,x)}}l&64&&Mx(s),l&512&&kl(s,s.return);break;case 3:if(La(e,s),l&64&&(e=s.updateQueue,e!==null)){if(a=null,s.child!==null)switch(s.child.tag){case 27:case 5:a=s.child.stateNode;break;case 1:a=s.child.stateNode}try{Nm(e,a)}catch(x){Oe(s,s.return,x)}}break;case 27:a===null&&l&4&&_x(s);case 26:case 5:La(e,s),a===null&&l&4&&Ox(s),l&512&&kl(s,s.return);break;case 12:La(e,s);break;case 31:La(e,s),l&4&&qx(e,s);break;case 13:La(e,s),l&4&&Gx(e,s),l&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=gg.bind(null,s),Ug(e,s))));break;case 22:if(l=s.memoizedState!==null||Da,!l){a=a!==null&&a.memoizedState!==null||st,i=Da;var c=st;Da=l,(st=a)&&!c?_a(e,s,(s.subtreeFlags&8772)!==0):La(e,s),Da=i,st=c}break;case 30:break;default:La(e,s)}}function $x(e){var a=e.alternate;a!==null&&(e.alternate=null,$x(a)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(a=e.stateNode,a!==null&&ac(a)),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 Ke=null,zt=!1;function Oa(e,a,s){for(s=s.child;s!==null;)Hx(e,a,s),s=s.sibling}function Hx(e,a,s){if(Ot&&typeof Ot.onCommitFiberUnmount=="function")try{Ot.onCommitFiberUnmount(Jn,s)}catch{}switch(s.tag){case 26:st||xa(s,a),Oa(e,a,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:st||xa(s,a);var l=Ke,i=zt;ms(s.type)&&(Ke=s.stateNode,zt=!1),Oa(e,a,s),Ol(s.stateNode),Ke=l,zt=i;break;case 5:st||xa(s,a);case 6:if(l=Ke,i=zt,Ke=null,Oa(e,a,s),Ke=l,zt=i,Ke!==null)if(zt)try{(Ke.nodeType===9?Ke.body:Ke.nodeName==="HTML"?Ke.ownerDocument.body:Ke).removeChild(s.stateNode)}catch(c){Oe(s,a,c)}else try{Ke.removeChild(s.stateNode)}catch(c){Oe(s,a,c)}break;case 18:Ke!==null&&(zt?(e=Ke,Df(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Un(e)):Df(Ke,s.stateNode));break;case 4:l=Ke,i=zt,Ke=s.stateNode.containerInfo,zt=!0,Oa(e,a,s),Ke=l,zt=i;break;case 0:case 11:case 14:case 15:ls(2,s,a),st||ls(4,s,a),Oa(e,a,s);break;case 1:st||(xa(s,a),l=s.stateNode,typeof l.componentWillUnmount=="function"&&Dx(s,a,l)),Oa(e,a,s);break;case 21:Oa(e,a,s);break;case 22:st=(l=st)||s.memoizedState!==null,Oa(e,a,s),st=l;break;default:Oa(e,a,s)}}function qx(e,a){if(a.memoizedState===null&&(e=a.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Un(e)}catch(s){Oe(a,a.return,s)}}}function Gx(e,a){if(a.memoizedState===null&&(e=a.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Un(e)}catch(s){Oe(a,a.return,s)}}function og(e){switch(e.tag){case 31:case 13:case 19:var a=e.stateNode;return a===null&&(a=e.stateNode=new Ux),a;case 22:return e=e.stateNode,a=e._retryCache,a===null&&(a=e._retryCache=new Ux),a;default:throw Error(o(435,e.tag))}}function Ji(e,a){var s=og(e);a.forEach(function(l){if(!s.has(l)){s.add(l);var i=bg.bind(null,e,l);l.then(i,i)}})}function Ct(e,a){var s=a.deletions;if(s!==null)for(var l=0;l<s.length;l++){var i=s[l],c=e,x=a,v=x;e:for(;v!==null;){switch(v.tag){case 27:if(ms(v.type)){Ke=v.stateNode,zt=!1;break e}break;case 5:Ke=v.stateNode,zt=!1;break e;case 3:case 4:Ke=v.stateNode.containerInfo,zt=!0;break e}v=v.return}if(Ke===null)throw Error(o(160));Hx(c,x,i),Ke=null,zt=!1,c=i.alternate,c!==null&&(c.return=null),i.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)Kx(a,e),a=a.sibling}var ra=null;function Kx(e,a){var s=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ct(a,e),At(e),l&4&&(ls(3,e,e.return),Sl(3,e),ls(5,e,e.return));break;case 1:Ct(a,e),At(e),l&512&&(st||s===null||xa(s,s.return)),l&64&&Da&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?l:s.concat(l))));break;case 26:var i=ra;if(Ct(a,e),At(e),l&512&&(st||s===null||xa(s,s.return)),l&4){var c=s!==null?s.memoizedState:null;if(l=e.memoizedState,s===null)if(l===null)if(e.stateNode===null){e:{l=e.type,s=e.memoizedProps,i=i.ownerDocument||i;t:switch(l){case"title":c=i.getElementsByTagName("title")[0],(!c||c[Pn]||c[dt]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=i.createElement(l),i.head.insertBefore(c,i.querySelector("head > title"))),ft(c,l,s),c[dt]=e,it(c),l=c;break e;case"link":var x=Vf("link","href",i).get(l+(s.href||""));if(x){for(var v=0;v<x.length;v++)if(c=x[v],c.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&c.getAttribute("rel")===(s.rel==null?null:s.rel)&&c.getAttribute("title")===(s.title==null?null:s.title)&&c.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){x.splice(v,1);break t}}c=i.createElement(l),ft(c,l,s),i.head.appendChild(c);break;case"meta":if(x=Vf("meta","content",i).get(l+(s.content||""))){for(v=0;v<x.length;v++)if(c=x[v],c.getAttribute("content")===(s.content==null?null:""+s.content)&&c.getAttribute("name")===(s.name==null?null:s.name)&&c.getAttribute("property")===(s.property==null?null:s.property)&&c.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&c.getAttribute("charset")===(s.charSet==null?null:s.charSet)){x.splice(v,1);break t}}c=i.createElement(l),ft(c,l,s),i.head.appendChild(c);break;default:throw Error(o(468,l))}c[dt]=e,it(c),l=c}e.stateNode=l}else Yf(i,e.type,e.stateNode);else e.stateNode=Kf(i,l,e.memoizedProps);else c!==l?(c===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):c.count--,l===null?Yf(i,e.type,e.stateNode):Kf(i,l,e.memoizedProps)):l===null&&e.stateNode!==null&&So(e,e.memoizedProps,s.memoizedProps)}break;case 27:Ct(a,e),At(e),l&512&&(st||s===null||xa(s,s.return)),s!==null&&l&4&&So(e,e.memoizedProps,s.memoizedProps);break;case 5:if(Ct(a,e),At(e),l&512&&(st||s===null||xa(s,s.return)),e.flags&32){i=e.stateNode;try{ln(i,"")}catch(de){Oe(e,e.return,de)}}l&4&&e.stateNode!=null&&(i=e.memoizedProps,So(e,i,s!==null?s.memoizedProps:i)),l&1024&&(Co=!0);break;case 6:if(Ct(a,e),At(e),l&4){if(e.stateNode===null)throw Error(o(162));l=e.memoizedProps,s=e.stateNode;try{s.nodeValue=l}catch(de){Oe(e,e.return,de)}}break;case 3:if(ur=null,i=ra,ra=or(a.containerInfo),Ct(a,e),ra=i,At(e),l&4&&s!==null&&s.memoizedState.isDehydrated)try{Un(a.containerInfo)}catch(de){Oe(e,e.return,de)}Co&&(Co=!1,Vx(e));break;case 4:l=ra,ra=or(e.stateNode.containerInfo),Ct(a,e),At(e),ra=l;break;case 12:Ct(a,e),At(e);break;case 31:Ct(a,e),At(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Ji(e,l)));break;case 13:Ct(a,e),At(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Ii=bt()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Ji(e,l)));break;case 22:i=e.memoizedState!==null;var A=s!==null&&s.memoizedState!==null,B=Da,Y=st;if(Da=B||i,st=Y||A,Ct(a,e),st=Y,Da=B,At(e),l&8192)e:for(a=e.stateNode,a._visibility=i?a._visibility&-2:a._visibility|1,i&&(s===null||A||Da||st||Hs(e)),s=null,a=e;;){if(a.tag===5||a.tag===26){if(s===null){A=s=a;try{if(c=A.stateNode,i)x=c.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{v=A.stateNode;var I=A.memoizedProps.style,q=I!=null&&I.hasOwnProperty("display")?I.display:null;v.style.display=q==null||typeof q=="boolean"?"":(""+q).trim()}}catch(de){Oe(A,A.return,de)}}}else if(a.tag===6){if(s===null){A=a;try{A.stateNode.nodeValue=i?"":A.memoizedProps}catch(de){Oe(A,A.return,de)}}}else if(a.tag===18){if(s===null){A=a;try{var V=A.stateNode;i?Of(V,!0):Of(A.stateNode,!1)}catch(de){Oe(A,A.return,de)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===e)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===e)break e;for(;a.sibling===null;){if(a.return===null||a.return===e)break e;s===a&&(s=null),a=a.return}s===a&&(s=null),a.sibling.return=a.return,a=a.sibling}l&4&&(l=e.updateQueue,l!==null&&(s=l.retryQueue,s!==null&&(l.retryQueue=null,Ji(e,s))));break;case 19:Ct(a,e),At(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Ji(e,l)));break;case 30:break;case 21:break;default:Ct(a,e),At(e)}}function At(e){var a=e.flags;if(a&2){try{for(var s,l=e.return;l!==null;){if(Lx(l)){s=l;break}l=l.return}if(s==null)throw Error(o(160));switch(s.tag){case 27:var i=s.stateNode,c=ko(e);Zi(e,c,i);break;case 5:var x=s.stateNode;s.flags&32&&(ln(x,""),s.flags&=-33);var v=ko(e);Zi(e,v,x);break;case 3:case 4:var A=s.stateNode.containerInfo,B=ko(e);zo(e,B,A);break;default:throw Error(o(161))}}catch(Y){Oe(e,e.return,Y)}e.flags&=-3}a&4096&&(e.flags&=-4097)}function Vx(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var a=e;Vx(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),e=e.sibling}}function La(e,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)Bx(e,a.alternate,a),a=a.sibling}function Hs(e){for(e=e.child;e!==null;){var a=e;switch(a.tag){case 0:case 11:case 14:case 15:ls(4,a,a.return),Hs(a);break;case 1:xa(a,a.return);var s=a.stateNode;typeof s.componentWillUnmount=="function"&&Dx(a,a.return,s),Hs(a);break;case 27:Ol(a.stateNode);case 26:case 5:xa(a,a.return),Hs(a);break;case 22:a.memoizedState===null&&Hs(a);break;case 30:Hs(a);break;default:Hs(a)}e=e.sibling}}function _a(e,a,s){for(s=s&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var l=a.alternate,i=e,c=a,x=c.flags;switch(c.tag){case 0:case 11:case 15:_a(i,c,s),Sl(4,c);break;case 1:if(_a(i,c,s),l=c,i=l.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(B){Oe(l,l.return,B)}if(l=c,i=l.updateQueue,i!==null){var v=l.stateNode;try{var A=i.shared.hiddenCallbacks;if(A!==null)for(i.shared.hiddenCallbacks=null,i=0;i<A.length;i++)jm(A[i],v)}catch(B){Oe(l,l.return,B)}}s&&x&64&&Mx(c),kl(c,c.return);break;case 27:_x(c);case 26:case 5:_a(i,c,s),s&&l===null&&x&4&&Ox(c),kl(c,c.return);break;case 12:_a(i,c,s);break;case 31:_a(i,c,s),s&&x&4&&qx(i,c);break;case 13:_a(i,c,s),s&&x&4&&Gx(i,c);break;case 22:c.memoizedState===null&&_a(i,c,s),kl(c,c.return);break;case 30:break;default:_a(i,c,s)}a=a.sibling}}function Ao(e,a){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(e=a.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&ul(s))}function Eo(e,a){e=null,a.alternate!==null&&(e=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==e&&(a.refCount++,e!=null&&ul(e))}function ca(e,a,s,l){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Yx(e,a,s,l),a=a.sibling}function Yx(e,a,s,l){var i=a.flags;switch(a.tag){case 0:case 11:case 15:ca(e,a,s,l),i&2048&&Sl(9,a);break;case 1:ca(e,a,s,l);break;case 3:ca(e,a,s,l),i&2048&&(e=null,a.alternate!==null&&(e=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==e&&(a.refCount++,e!=null&&ul(e)));break;case 12:if(i&2048){ca(e,a,s,l),e=a.stateNode;try{var c=a.memoizedProps,x=c.id,v=c.onPostCommit;typeof v=="function"&&v(x,a.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(A){Oe(a,a.return,A)}}else ca(e,a,s,l);break;case 31:ca(e,a,s,l);break;case 13:ca(e,a,s,l);break;case 23:break;case 22:c=a.stateNode,x=a.alternate,a.memoizedState!==null?c._visibility&2?ca(e,a,s,l):zl(e,a):c._visibility&2?ca(e,a,s,l):(c._visibility|=2,zn(e,a,s,l,(a.subtreeFlags&10256)!==0||!1)),i&2048&&Ao(x,a);break;case 24:ca(e,a,s,l),i&2048&&Eo(a.alternate,a);break;default:ca(e,a,s,l)}}function zn(e,a,s,l,i){for(i=i&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var c=e,x=a,v=s,A=l,B=x.flags;switch(x.tag){case 0:case 11:case 15:zn(c,x,v,A,i),Sl(8,x);break;case 23:break;case 22:var Y=x.stateNode;x.memoizedState!==null?Y._visibility&2?zn(c,x,v,A,i):zl(c,x):(Y._visibility|=2,zn(c,x,v,A,i)),i&&B&2048&&Ao(x.alternate,x);break;case 24:zn(c,x,v,A,i),i&&B&2048&&Eo(x.alternate,x);break;default:zn(c,x,v,A,i)}a=a.sibling}}function zl(e,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var s=e,l=a,i=l.flags;switch(l.tag){case 22:zl(s,l),i&2048&&Ao(l.alternate,l);break;case 24:zl(s,l),i&2048&&Eo(l.alternate,l);break;default:zl(s,l)}a=a.sibling}}var Cl=8192;function Cn(e,a,s){if(e.subtreeFlags&Cl)for(e=e.child;e!==null;)Xx(e,a,s),e=e.sibling}function Xx(e,a,s){switch(e.tag){case 26:Cn(e,a,s),e.flags&Cl&&e.memoizedState!==null&&Jg(s,ra,e.memoizedState,e.memoizedProps);break;case 5:Cn(e,a,s);break;case 3:case 4:var l=ra;ra=or(e.stateNode.containerInfo),Cn(e,a,s),ra=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Cl,Cl=16777216,Cn(e,a,s),Cl=l):Cn(e,a,s));break;default:Cn(e,a,s)}}function Qx(e){var a=e.alternate;if(a!==null&&(e=a.child,e!==null)){a.child=null;do a=e.sibling,e.sibling=null,e=a;while(e!==null)}}function Al(e){var a=e.deletions;if((e.flags&16)!==0){if(a!==null)for(var s=0;s<a.length;s++){var l=a[s];rt=l,Jx(l,e)}Qx(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Zx(e),e=e.sibling}function Zx(e){switch(e.tag){case 0:case 11:case 15:Al(e),e.flags&2048&&ls(9,e,e.return);break;case 3:Al(e);break;case 12:Al(e);break;case 22:var a=e.stateNode;e.memoizedState!==null&&a._visibility&2&&(e.return===null||e.return.tag!==13)?(a._visibility&=-3,Fi(e)):Al(e);break;default:Al(e)}}function Fi(e){var a=e.deletions;if((e.flags&16)!==0){if(a!==null)for(var s=0;s<a.length;s++){var l=a[s];rt=l,Jx(l,e)}Qx(e)}for(e=e.child;e!==null;){switch(a=e,a.tag){case 0:case 11:case 15:ls(8,a,a.return),Fi(a);break;case 22:s=a.stateNode,s._visibility&2&&(s._visibility&=-3,Fi(a));break;default:Fi(a)}e=e.sibling}}function Jx(e,a){for(;rt!==null;){var s=rt;switch(s.tag){case 0:case 11:case 15:ls(8,s,a);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var l=s.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:ul(s.memoizedState.cache)}if(l=s.child,l!==null)l.return=s,rt=l;else e:for(s=e;rt!==null;){l=rt;var i=l.sibling,c=l.return;if($x(l),l===s){rt=null;break e}if(i!==null){i.return=c,rt=i;break e}rt=c}}}var dg={getCacheForType:function(e){var a=mt(et),s=a.data.get(e);return s===void 0&&(s=e(),a.data.set(e,s)),s},cacheSignal:function(){return mt(et).controller.signal}},ug=typeof WeakMap=="function"?WeakMap:Map,Me=0,Be=null,Se=null,ze=0,De=0,Ht=null,is=!1,An=!1,To=!1,Ua=0,Ze=0,rs=0,qs=0,Ro=0,qt=0,En=0,El=null,Et=null,Mo=!1,Ii=0,Fx=0,Pi=1/0,Wi=null,cs=null,nt=0,os=null,Tn=null,Ba=0,Do=0,Oo=null,Ix=null,Tl=0,Lo=null;function Gt(){return(Me&2)!==0&&ze!==0?ze&-ze:K.T!==null?qo():xu()}function Px(){if(qt===0)if((ze&536870912)===0||Ae){var e=ri;ri<<=1,(ri&3932160)===0&&(ri=262144),qt=e}else qt=536870912;return e=Bt.current,e!==null&&(e.flags|=32),qt}function Tt(e,a,s){(e===Be&&(De===2||De===9)||e.cancelPendingCommit!==null)&&(Rn(e,0),ds(e,ze,qt,!1)),In(e,s),((Me&2)===0||e!==Be)&&(e===Be&&((Me&2)===0&&(qs|=s),Ze===4&&ds(e,ze,qt,!1)),fa(e))}function Wx(e,a,s){if((Me&6)!==0)throw Error(o(327));var l=!s&&(a&127)===0&&(a&e.expiredLanes)===0||Fn(e,a),i=l?fg(e,a):Uo(e,a,!0),c=l;do{if(i===0){An&&!l&&ds(e,a,0,!1);break}else{if(s=e.current.alternate,c&&!mg(s)){i=Uo(e,a,!1),c=!1;continue}if(i===2){if(c=a,e.errorRecoveryDisabledLanes&c)var x=0;else x=e.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){a=x;e:{var v=e;i=El;var A=v.current.memoizedState.isDehydrated;if(A&&(Rn(v,x).flags|=256),x=Uo(v,x,!1),x!==2){if(To&&!A){v.errorRecoveryDisabledLanes|=c,qs|=c,i=4;break e}c=Et,Et=i,c!==null&&(Et===null?Et=c:Et.push.apply(Et,c))}i=x}if(c=!1,i!==2)continue}}if(i===1){Rn(e,0),ds(e,a,0,!0);break}e:{switch(l=e,c=i,c){case 0:case 1:throw Error(o(345));case 4:if((a&4194048)!==a)break;case 6:ds(l,a,qt,!is);break e;case 2:Et=null;break;case 3:case 5:break;default:throw Error(o(329))}if((a&62914560)===a&&(i=Ii+300-bt(),10<i)){if(ds(l,a,qt,!is),oi(l,0,!0)!==0)break e;Ba=a,l.timeoutHandle=Rf(ef.bind(null,l,s,Et,Wi,Mo,a,qt,qs,En,is,c,"Throttled",-0,0),i);break e}ef(l,s,Et,Wi,Mo,a,qt,qs,En,is,c,null,-0,0)}}break}while(!0);fa(e)}function ef(e,a,s,l,i,c,x,v,A,B,Y,I,q,V){if(e.timeoutHandle=-1,I=a.subtreeFlags,I&8192||(I&16785408)===16785408){I={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:wa},Xx(a,c,I);var de=(c&62914560)===c?Ii-bt():(c&4194048)===c?Fx-bt():0;if(de=Fg(I,de),de!==null){Ba=c,e.cancelPendingCommit=de(of.bind(null,e,a,c,s,l,i,x,v,A,Y,I,null,q,V)),ds(e,c,x,!B);return}}of(e,a,c,s,l,i,x,v,A)}function mg(e){for(var a=e;;){var s=a.tag;if((s===0||s===11||s===15)&&a.flags&16384&&(s=a.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var l=0;l<s.length;l++){var i=s[l],c=i.getSnapshot;i=i.value;try{if(!_t(c(),i))return!1}catch{return!1}}if(s=a.child,a.subtreeFlags&16384&&s!==null)s.return=a,a=s;else{if(a===e)break;for(;a.sibling===null;){if(a.return===null||a.return===e)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function ds(e,a,s,l){a&=~Ro,a&=~qs,e.suspendedLanes|=a,e.pingedLanes&=~a,l&&(e.warmLanes|=a),l=e.expirationTimes;for(var i=a;0<i;){var c=31-Lt(i),x=1<<c;l[c]=-1,i&=~x}s!==0&&du(e,s,a)}function er(){return(Me&6)===0?(Rl(0),!1):!0}function _o(){if(Se!==null){if(De===0)var e=Se.return;else e=Se,Ca=Ms=null,Ic(e),jn=null,xl=0,e=Se;for(;e!==null;)Rx(e.alternate,e),e=e.return;Se=null}}function Rn(e,a){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,Mg(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),Ba=0,_o(),Be=e,Se=s=ka(e.current,null),ze=a,De=0,Ht=null,is=!1,An=Fn(e,a),To=!1,En=qt=Ro=qs=rs=Ze=0,Et=El=null,Mo=!1,(a&8)!==0&&(a|=a&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=a;0<l;){var i=31-Lt(l),c=1<<i;a|=e[i],l&=~c}return Ua=a,ji(),s}function tf(e,a){je=null,K.H=jl,a===vn||a===Ei?(a=gm(),De=3):a===$c?(a=gm(),De=4):De=a===fo?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,Ht=a,Se===null&&(Ze=1,Ki(e,Jt(a,e.current)))}function af(){var e=Bt.current;return e===null?!0:(ze&4194048)===ze?Wt===null:(ze&62914560)===ze||(ze&536870912)!==0?e===Wt:!1}function sf(){var e=K.H;return K.H=jl,e===null?jl:e}function nf(){var e=K.A;return K.A=dg,e}function tr(){Ze=4,is||(ze&4194048)!==ze&&Bt.current!==null||(An=!0),(rs&134217727)===0&&(qs&134217727)===0||Be===null||ds(Be,ze,qt,!1)}function Uo(e,a,s){var l=Me;Me|=2;var i=sf(),c=nf();(Be!==e||ze!==a)&&(Wi=null,Rn(e,a)),a=!1;var x=Ze;e:do try{if(De!==0&&Se!==null){var v=Se,A=Ht;switch(De){case 8:_o(),x=6;break e;case 3:case 2:case 9:case 6:Bt.current===null&&(a=!0);var B=De;if(De=0,Ht=null,Mn(e,v,A,B),s&&An){x=0;break e}break;default:B=De,De=0,Ht=null,Mn(e,v,A,B)}}xg(),x=Ze;break}catch(Y){tf(e,Y)}while(!0);return a&&e.shellSuspendCounter++,Ca=Ms=null,Me=l,K.H=i,K.A=c,Se===null&&(Be=null,ze=0,ji()),x}function xg(){for(;Se!==null;)lf(Se)}function fg(e,a){var s=Me;Me|=2;var l=sf(),i=nf();Be!==e||ze!==a?(Wi=null,Pi=bt()+500,Rn(e,a)):An=Fn(e,a);e:do try{if(De!==0&&Se!==null){a=Se;var c=Ht;t:switch(De){case 1:De=0,Ht=null,Mn(e,a,c,1);break;case 2:case 9:if(hm(c)){De=0,Ht=null,rf(a);break}a=function(){De!==2&&De!==9||Be!==e||(De=7),fa(e)},c.then(a,a);break e;case 3:De=7;break e;case 4:De=5;break e;case 7:hm(c)?(De=0,Ht=null,rf(a)):(De=0,Ht=null,Mn(e,a,c,7));break;case 5:var x=null;switch(Se.tag){case 26:x=Se.memoizedState;case 5:case 27:var v=Se;if(x?Xf(x):v.stateNode.complete){De=0,Ht=null;var A=v.sibling;if(A!==null)Se=A;else{var B=v.return;B!==null?(Se=B,ar(B)):Se=null}break t}}De=0,Ht=null,Mn(e,a,c,5);break;case 6:De=0,Ht=null,Mn(e,a,c,6);break;case 8:_o(),Ze=6;break e;default:throw Error(o(462))}}hg();break}catch(Y){tf(e,Y)}while(!0);return Ca=Ms=null,K.H=l,K.A=i,Me=s,Se!==null?0:(Be=null,ze=0,ji(),Ze)}function hg(){for(;Se!==null&&!va();)lf(Se)}function lf(e){var a=Ex(e.alternate,e,Ua);e.memoizedProps=e.pendingProps,a===null?ar(e):Se=a}function rf(e){var a=e,s=a.alternate;switch(a.tag){case 15:case 0:a=wx(s,a,a.pendingProps,a.type,void 0,ze);break;case 11:a=wx(s,a,a.pendingProps,a.type.render,a.ref,ze);break;case 5:Ic(a);default:Rx(s,a),a=Se=nm(a,Ua),a=Ex(s,a,Ua)}e.memoizedProps=e.pendingProps,a===null?ar(e):Se=a}function Mn(e,a,s,l){Ca=Ms=null,Ic(a),jn=null,xl=0;var i=a.return;try{if(sg(e,i,a,s,ze)){Ze=1,Ki(e,Jt(s,e.current)),Se=null;return}}catch(c){if(i!==null)throw Se=i,c;Ze=1,Ki(e,Jt(s,e.current)),Se=null;return}a.flags&32768?(Ae||l===1?e=!0:An||(ze&536870912)!==0?e=!1:(is=e=!0,(l===2||l===9||l===3||l===6)&&(l=Bt.current,l!==null&&l.tag===13&&(l.flags|=16384))),cf(a,e)):ar(a)}function ar(e){var a=e;do{if((a.flags&32768)!==0){cf(a,is);return}e=a.return;var s=ig(a.alternate,a,Ua);if(s!==null){Se=s;return}if(a=a.sibling,a!==null){Se=a;return}Se=a=e}while(a!==null);Ze===0&&(Ze=5)}function cf(e,a){do{var s=rg(e.alternate,e);if(s!==null){s.flags&=32767,Se=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!a&&(e=e.sibling,e!==null)){Se=e;return}Se=e=s}while(e!==null);Ze=6,Se=null}function of(e,a,s,l,i,c,x,v,A){e.cancelPendingCommit=null;do sr();while(nt!==0);if((Me&6)!==0)throw Error(o(327));if(a!==null){if(a===e.current)throw Error(o(177));if(c=a.lanes|a.childLanes,c|=Sc,Z0(e,s,c,x,v,A),e===Be&&(Se=Be=null,ze=0),Tn=a,os=e,Ba=s,Do=c,Oo=i,Ix=l,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,yg(Ps,function(){return ff(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||l){l=K.T,K.T=null,i=_.p,_.p=2,x=Me,Me|=4;try{cg(e,a,s)}finally{Me=x,_.p=i,K.T=l}}nt=1,df(),uf(),mf()}}function df(){if(nt===1){nt=0;var e=os,a=Tn,s=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||s){s=K.T,K.T=null;var l=_.p;_.p=2;var i=Me;Me|=4;try{Kx(a,e);var c=Jo,x=Ju(e.containerInfo),v=c.focusedElem,A=c.selectionRange;if(x!==v&&v&&v.ownerDocument&&Zu(v.ownerDocument.documentElement,v)){if(A!==null&&yc(v)){var B=A.start,Y=A.end;if(Y===void 0&&(Y=B),"selectionStart"in v)v.selectionStart=B,v.selectionEnd=Math.min(Y,v.value.length);else{var I=v.ownerDocument||document,q=I&&I.defaultView||window;if(q.getSelection){var V=q.getSelection(),de=v.textContent.length,pe=Math.min(A.start,de),Ue=A.end===void 0?pe:Math.min(A.end,de);!V.extend&&pe>Ue&&(x=Ue,Ue=pe,pe=x);var D=Qu(v,pe),R=Qu(v,Ue);if(D&&R&&(V.rangeCount!==1||V.anchorNode!==D.node||V.anchorOffset!==D.offset||V.focusNode!==R.node||V.focusOffset!==R.offset)){var U=I.createRange();U.setStart(D.node,D.offset),V.removeAllRanges(),pe>Ue?(V.addRange(U),V.extend(R.node,R.offset)):(U.setEnd(R.node,R.offset),V.addRange(U))}}}}for(I=[],V=v;V=V.parentNode;)V.nodeType===1&&I.push({element:V,left:V.scrollLeft,top:V.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;v<I.length;v++){var J=I[v];J.element.scrollLeft=J.left,J.element.scrollTop=J.top}}hr=!!Zo,Jo=Zo=null}finally{Me=i,_.p=l,K.T=s}}e.current=a,nt=2}}function uf(){if(nt===2){nt=0;var e=os,a=Tn,s=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||s){s=K.T,K.T=null;var l=_.p;_.p=2;var i=Me;Me|=4;try{Bx(e,a.alternate,a)}finally{Me=i,_.p=l,K.T=s}}nt=3}}function mf(){if(nt===4||nt===3){nt=0,ja();var e=os,a=Tn,s=Ba,l=Ix;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?nt=5:(nt=0,Tn=os=null,xf(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(cs=null),ec(s),a=a.stateNode,Ot&&typeof Ot.onCommitFiberRoot=="function")try{Ot.onCommitFiberRoot(Jn,a,void 0,(a.current.flags&128)===128)}catch{}if(l!==null){a=K.T,i=_.p,_.p=2,K.T=null;try{for(var c=e.onRecoverableError,x=0;x<l.length;x++){var v=l[x];c(v.value,{componentStack:v.stack})}}finally{K.T=a,_.p=i}}(Ba&3)!==0&&sr(),fa(e),i=e.pendingLanes,(s&261930)!==0&&(i&42)!==0?e===Lo?Tl++:(Tl=0,Lo=e):Tl=0,Rl(0)}}function xf(e,a){(e.pooledCacheLanes&=a)===0&&(a=e.pooledCache,a!=null&&(e.pooledCache=null,ul(a)))}function sr(){return df(),uf(),mf(),ff()}function ff(){if(nt!==5)return!1;var e=os,a=Do;Do=0;var s=ec(Ba),l=K.T,i=_.p;try{_.p=32>s?32:s,K.T=null,s=Oo,Oo=null;var c=os,x=Ba;if(nt=0,Tn=os=null,Ba=0,(Me&6)!==0)throw Error(o(331));var v=Me;if(Me|=4,Zx(c.current),Yx(c,c.current,x,s),Me=v,Rl(0,!1),Ot&&typeof Ot.onPostCommitFiberRoot=="function")try{Ot.onPostCommitFiberRoot(Jn,c)}catch{}return!0}finally{_.p=i,K.T=l,xf(e,a)}}function hf(e,a,s){a=Jt(s,a),a=xo(e.stateNode,a,2),e=as(e,a,2),e!==null&&(In(e,2),fa(e))}function Oe(e,a,s){if(e.tag===3)hf(e,e,s);else for(;a!==null;){if(a.tag===3){hf(a,e,s);break}else if(a.tag===1){var l=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(cs===null||!cs.has(l))){e=Jt(s,e),s=hx(2),l=as(a,s,2),l!==null&&(px(s,l,a,e),In(l,2),fa(l));break}}a=a.return}}function Bo(e,a,s){var l=e.pingCache;if(l===null){l=e.pingCache=new ug;var i=new Set;l.set(a,i)}else i=l.get(a),i===void 0&&(i=new Set,l.set(a,i));i.has(s)||(To=!0,i.add(s),e=pg.bind(null,e,a,s),a.then(e,e))}function pg(e,a,s){var l=e.pingCache;l!==null&&l.delete(a),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,Be===e&&(ze&s)===s&&(Ze===4||Ze===3&&(ze&62914560)===ze&&300>bt()-Ii?(Me&2)===0&&Rn(e,0):Ro|=s,En===ze&&(En=0)),fa(e)}function pf(e,a){a===0&&(a=ou()),e=Es(e,a),e!==null&&(In(e,a),fa(e))}function gg(e){var a=e.memoizedState,s=0;a!==null&&(s=a.retryLane),pf(e,s)}function bg(e,a){var s=0;switch(e.tag){case 31:case 13:var l=e.stateNode,i=e.memoizedState;i!==null&&(s=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(a),pf(e,s)}function yg(e,a){return ye(e,a)}var nr=null,Dn=null,$o=!1,lr=!1,Ho=!1,us=0;function fa(e){e!==Dn&&e.next===null&&(Dn===null?nr=Dn=e:Dn=Dn.next=e),lr=!0,$o||($o=!0,jg())}function Rl(e,a){if(!Ho&&lr){Ho=!0;do for(var s=!1,l=nr;l!==null;){if(e!==0){var i=l.pendingLanes;if(i===0)var c=0;else{var x=l.suspendedLanes,v=l.pingedLanes;c=(1<<31-Lt(42|e)+1)-1,c&=i&~(x&~v),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(s=!0,vf(l,c))}else c=ze,c=oi(l,l===Be?c:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(c&3)===0||Fn(l,c)||(s=!0,vf(l,c));l=l.next}while(s);Ho=!1}}function vg(){gf()}function gf(){lr=$o=!1;var e=0;us!==0&&Rg()&&(e=us);for(var a=bt(),s=null,l=nr;l!==null;){var i=l.next,c=bf(l,a);c===0?(l.next=null,s===null?nr=i:s.next=i,i===null&&(Dn=s)):(s=l,(e!==0||(c&3)!==0)&&(lr=!0)),l=i}nt!==0&&nt!==5||Rl(e),us!==0&&(us=0)}function bf(e,a){for(var s=e.suspendedLanes,l=e.pingedLanes,i=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var x=31-Lt(c),v=1<<x,A=i[x];A===-1?((v&s)===0||(v&l)!==0)&&(i[x]=Q0(v,a)):A<=a&&(e.expiredLanes|=v),c&=~v}if(a=Be,s=ze,s=oi(e,e===a?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,s===0||e===a&&(De===2||De===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&Fe(l),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||Fn(e,s)){if(a=s&-s,a===e.callbackPriority)return a;switch(l!==null&&Fe(l),ec(s)){case 2:case 8:s=li;break;case 32:s=Ps;break;case 268435456:s=cu;break;default:s=Ps}return l=yf.bind(null,e),s=ye(s,l),e.callbackPriority=a,e.callbackNode=s,a}return l!==null&&l!==null&&Fe(l),e.callbackPriority=2,e.callbackNode=null,2}function yf(e,a){if(nt!==0&&nt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(sr()&&e.callbackNode!==s)return null;var l=ze;return l=oi(e,e===Be?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Wx(e,l,a),bf(e,bt()),e.callbackNode!=null&&e.callbackNode===s?yf.bind(null,e):null)}function vf(e,a){if(sr())return null;Wx(e,a,!0)}function jg(){Dg(function(){(Me&6)!==0?ye(Zn,vg):gf()})}function qo(){if(us===0){var e=bn;e===0&&(e=ii,ii<<=1,(ii&261888)===0&&(ii=256)),us=e}return us}function jf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:xi(""+e)}function Nf(e,a){var s=a.ownerDocument.createElement("input");return s.name=a.name,s.value=a.value,e.id&&s.setAttribute("form",e.id),a.parentNode.insertBefore(s,a),e=new FormData(e),s.parentNode.removeChild(s),e}function Ng(e,a,s,l,i){if(a==="submit"&&s&&s.stateNode===i){var c=jf((i[St]||null).action),x=l.submitter;x&&(a=(a=x[St]||null)?jf(a.formAction):x.getAttribute("formAction"),a!==null&&(c=a,x=null));var v=new gi("action","action",null,l,i);e.push({event:v,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(us!==0){var A=x?Nf(i,x):new FormData(i);io(s,{pending:!0,data:A,method:i.method,action:c},null,A)}}else typeof c=="function"&&(v.preventDefault(),A=x?Nf(i,x):new FormData(i),io(s,{pending:!0,data:A,method:i.method,action:c},c,A))},currentTarget:i}]})}}for(var Go=0;Go<wc.length;Go++){var Ko=wc[Go],wg=Ko.toLowerCase(),Sg=Ko[0].toUpperCase()+Ko.slice(1);ia(wg,"on"+Sg)}ia(Pu,"onAnimationEnd"),ia(Wu,"onAnimationIteration"),ia(em,"onAnimationStart"),ia("dblclick","onDoubleClick"),ia("focusin","onFocus"),ia("focusout","onBlur"),ia(Hp,"onTransitionRun"),ia(qp,"onTransitionStart"),ia(Gp,"onTransitionCancel"),ia(tm,"onTransitionEnd"),sn("onMouseEnter",["mouseout","mouseover"]),sn("onMouseLeave",["mouseout","mouseover"]),sn("onPointerEnter",["pointerout","pointerover"]),sn("onPointerLeave",["pointerout","pointerover"]),ks("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ks("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ks("onBeforeInput",["compositionend","keypress","textInput","paste"]),ks("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ks("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ks("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ml="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(" "),kg=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ml));function wf(e,a){a=(a&4)!==0;for(var s=0;s<e.length;s++){var l=e[s],i=l.event;l=l.listeners;e:{var c=void 0;if(a)for(var x=l.length-1;0<=x;x--){var v=l[x],A=v.instance,B=v.currentTarget;if(v=v.listener,A!==c&&i.isPropagationStopped())break e;c=v,i.currentTarget=B;try{c(i)}catch(Y){vi(Y)}i.currentTarget=null,c=A}else for(x=0;x<l.length;x++){if(v=l[x],A=v.instance,B=v.currentTarget,v=v.listener,A!==c&&i.isPropagationStopped())break e;c=v,i.currentTarget=B;try{c(i)}catch(Y){vi(Y)}i.currentTarget=null,c=A}}}}function ke(e,a){var s=a[tc];s===void 0&&(s=a[tc]=new Set);var l=e+"__bubble";s.has(l)||(Sf(a,e,2,!1),s.add(l))}function Vo(e,a,s){var l=0;a&&(l|=4),Sf(s,e,l,a)}var ir="_reactListening"+Math.random().toString(36).slice(2);function Yo(e){if(!e[ir]){e[ir]=!0,pu.forEach(function(s){s!=="selectionchange"&&(kg.has(s)||Vo(s,!1,e),Vo(s,!0,e))});var a=e.nodeType===9?e:e.ownerDocument;a===null||a[ir]||(a[ir]=!0,Vo("selectionchange",!1,a))}}function Sf(e,a,s,l){switch(Wf(a)){case 2:var i=Wg;break;case 8:i=eb;break;default:i=id}s=i.bind(null,a,s,e),i=void 0,!dc||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(i=!0),l?i!==void 0?e.addEventListener(a,s,{capture:!0,passive:i}):e.addEventListener(a,s,!0):i!==void 0?e.addEventListener(a,s,{passive:i}):e.addEventListener(a,s,!1)}function Xo(e,a,s,l,i){var c=l;if((a&1)===0&&(a&2)===0&&l!==null)e:for(;;){if(l===null)return;var x=l.tag;if(x===3||x===4){var v=l.stateNode.containerInfo;if(v===i)break;if(x===4)for(x=l.return;x!==null;){var A=x.tag;if((A===3||A===4)&&x.stateNode.containerInfo===i)return;x=x.return}for(;v!==null;){if(x=en(v),x===null)return;if(A=x.tag,A===5||A===6||A===26||A===27){l=c=x;continue e}v=v.parentNode}}l=l.return}Au(function(){var B=c,Y=cc(s),I=[];e:{var q=am.get(e);if(q!==void 0){var V=gi,de=e;switch(e){case"keypress":if(hi(s)===0)break e;case"keydown":case"keyup":V=bp;break;case"focusin":de="focus",V=fc;break;case"focusout":de="blur",V=fc;break;case"beforeblur":case"afterblur":V=fc;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":V=Ru;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":V=ip;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":V=jp;break;case Pu:case Wu:case em:V=op;break;case tm:V=wp;break;case"scroll":case"scrollend":V=np;break;case"wheel":V=kp;break;case"copy":case"cut":case"paste":V=up;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":V=Du;break;case"toggle":case"beforetoggle":V=Cp}var pe=(a&4)!==0,Ue=!pe&&(e==="scroll"||e==="scrollend"),D=pe?q!==null?q+"Capture":null:q;pe=[];for(var R=B,U;R!==null;){var J=R;if(U=J.stateNode,J=J.tag,J!==5&&J!==26&&J!==27||U===null||D===null||(J=el(R,D),J!=null&&pe.push(Dl(R,J,U))),Ue)break;R=R.return}0<pe.length&&(q=new V(q,de,null,s,Y),I.push({event:q,listeners:pe}))}}if((a&7)===0){e:{if(q=e==="mouseover"||e==="pointerover",V=e==="mouseout"||e==="pointerout",q&&s!==rc&&(de=s.relatedTarget||s.fromElement)&&(en(de)||de[Ws]))break e;if((V||q)&&(q=Y.window===Y?Y:(q=Y.ownerDocument)?q.defaultView||q.parentWindow:window,V?(de=s.relatedTarget||s.toElement,V=B,de=de?en(de):null,de!==null&&(Ue=f(de),pe=de.tag,de!==Ue||pe!==5&&pe!==27&&pe!==6)&&(de=null)):(V=null,de=B),V!==de)){if(pe=Ru,J="onMouseLeave",D="onMouseEnter",R="mouse",(e==="pointerout"||e==="pointerover")&&(pe=Du,J="onPointerLeave",D="onPointerEnter",R="pointer"),Ue=V==null?q:Wn(V),U=de==null?q:Wn(de),q=new pe(J,R+"leave",V,s,Y),q.target=Ue,q.relatedTarget=U,J=null,en(Y)===B&&(pe=new pe(D,R+"enter",de,s,Y),pe.target=U,pe.relatedTarget=Ue,J=pe),Ue=J,V&&de)t:{for(pe=zg,D=V,R=de,U=0,J=D;J;J=pe(J))U++;J=0;for(var fe=R;fe;fe=pe(fe))J++;for(;0<U-J;)D=pe(D),U--;for(;0<J-U;)R=pe(R),J--;for(;U--;){if(D===R||R!==null&&D===R.alternate){pe=D;break t}D=pe(D),R=pe(R)}pe=null}else pe=null;V!==null&&kf(I,q,V,pe,!1),de!==null&&Ue!==null&&kf(I,Ue,de,pe,!0)}}e:{if(q=B?Wn(B):window,V=q.nodeName&&q.nodeName.toLowerCase(),V==="select"||V==="input"&&q.type==="file")var Te=qu;else if($u(q))if(Gu)Te=Up;else{Te=Lp;var me=Op}else V=q.nodeName,!V||V.toLowerCase()!=="input"||q.type!=="checkbox"&&q.type!=="radio"?B&&ic(B.elementType)&&(Te=qu):Te=_p;if(Te&&(Te=Te(e,B))){Hu(I,Te,s,Y);break e}me&&me(e,q,B),e==="focusout"&&B&&q.type==="number"&&B.memoizedProps.value!=null&&lc(q,"number",q.value)}switch(me=B?Wn(B):window,e){case"focusin":($u(me)||me.contentEditable==="true")&&(dn=me,vc=B,cl=null);break;case"focusout":cl=vc=dn=null;break;case"mousedown":jc=!0;break;case"contextmenu":case"mouseup":case"dragend":jc=!1,Fu(I,s,Y);break;case"selectionchange":if($p)break;case"keydown":case"keyup":Fu(I,s,Y)}var Ne;if(pc)e:{switch(e){case"compositionstart":var Ce="onCompositionStart";break e;case"compositionend":Ce="onCompositionEnd";break e;case"compositionupdate":Ce="onCompositionUpdate";break e}Ce=void 0}else on?Uu(e,s)&&(Ce="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Ce="onCompositionStart");Ce&&(Ou&&s.locale!=="ko"&&(on||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&on&&(Ne=Eu()):(Ja=Y,uc="value"in Ja?Ja.value:Ja.textContent,on=!0)),me=rr(B,Ce),0<me.length&&(Ce=new Mu(Ce,e,null,s,Y),I.push({event:Ce,listeners:me}),Ne?Ce.data=Ne:(Ne=Bu(s),Ne!==null&&(Ce.data=Ne)))),(Ne=Ep?Tp(e,s):Rp(e,s))&&(Ce=rr(B,"onBeforeInput"),0<Ce.length&&(me=new Mu("onBeforeInput","beforeinput",null,s,Y),I.push({event:me,listeners:Ce}),me.data=Ne)),Ng(I,e,B,s,Y)}wf(I,a)})}function Dl(e,a,s){return{instance:e,listener:a,currentTarget:s}}function rr(e,a){for(var s=a+"Capture",l=[];e!==null;){var i=e,c=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||c===null||(i=el(e,s),i!=null&&l.unshift(Dl(e,i,c)),i=el(e,a),i!=null&&l.push(Dl(e,i,c))),e.tag===3)return l;e=e.return}return[]}function zg(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function kf(e,a,s,l,i){for(var c=a._reactName,x=[];s!==null&&s!==l;){var v=s,A=v.alternate,B=v.stateNode;if(v=v.tag,A!==null&&A===l)break;v!==5&&v!==26&&v!==27||B===null||(A=B,i?(B=el(s,c),B!=null&&x.unshift(Dl(s,B,A))):i||(B=el(s,c),B!=null&&x.push(Dl(s,B,A)))),s=s.return}x.length!==0&&e.push({event:a,listeners:x})}var Cg=/\r\n?/g,Ag=/\u0000|\uFFFD/g;function zf(e){return(typeof e=="string"?e:""+e).replace(Cg,`
|
|
49
|
-
`).replace(Ag,"")}function Cf(e,a){return a=zf(a),zf(e)===a}function _e(e,a,s,l,i,c){switch(s){case"children":typeof l=="string"?a==="body"||a==="textarea"&&l===""||ln(e,l):(typeof l=="number"||typeof l=="bigint")&&a!=="body"&&ln(e,""+l);break;case"className":ui(e,"class",l);break;case"tabIndex":ui(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":ui(e,s,l);break;case"style":zu(e,l,c);break;case"data":if(a!=="object"){ui(e,"data",l);break}case"src":case"href":if(l===""&&(a!=="a"||s!=="href")){e.removeAttribute(s);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(s);break}l=xi(""+l),e.setAttribute(s,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(s,"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"&&(s==="formAction"?(a!=="input"&&_e(e,a,"name",i.name,i,null),_e(e,a,"formEncType",i.formEncType,i,null),_e(e,a,"formMethod",i.formMethod,i,null),_e(e,a,"formTarget",i.formTarget,i,null)):(_e(e,a,"encType",i.encType,i,null),_e(e,a,"method",i.method,i,null),_e(e,a,"target",i.target,i,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(s);break}l=xi(""+l),e.setAttribute(s,l);break;case"onClick":l!=null&&(e.onclick=wa);break;case"onScroll":l!=null&&ke("scroll",e);break;case"onScrollEnd":l!=null&&ke("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(s=l.__html,s!=null){if(i.children!=null)throw Error(o(60));e.innerHTML=s}}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}s=xi(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);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(s,""+l):e.removeAttribute(s);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(s,""):e.removeAttribute(s);break;case"capture":case"download":l===!0?e.setAttribute(s,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,l):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(s,l):e.removeAttribute(s);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(s):e.setAttribute(s,l);break;case"popover":ke("beforetoggle",e),ke("toggle",e),di(e,"popover",l);break;case"xlinkActuate":Na(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Na(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Na(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Na(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Na(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Na(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Na(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Na(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Na(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":di(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=ap.get(s)||s,di(e,s,l))}}function Qo(e,a,s,l,i,c){switch(s){case"style":zu(e,l,c);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(s=l.__html,s!=null){if(i.children!=null)throw Error(o(60));e.innerHTML=s}}break;case"children":typeof l=="string"?ln(e,l):(typeof l=="number"||typeof l=="bigint")&&ln(e,""+l);break;case"onScroll":l!=null&&ke("scroll",e);break;case"onScrollEnd":l!=null&&ke("scrollend",e);break;case"onClick":l!=null&&(e.onclick=wa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!gu.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(i=s.endsWith("Capture"),a=s.slice(2,i?s.length-7:void 0),c=e[St]||null,c=c!=null?c[s]:null,typeof c=="function"&&e.removeEventListener(a,c,i),typeof l=="function")){typeof c!="function"&&c!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(a,l,i);break e}s in e?e[s]=l:l===!0?e.setAttribute(s,""):di(e,s,l)}}}function ft(e,a,s){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ke("error",e),ke("load",e);var l=!1,i=!1,c;for(c in s)if(s.hasOwnProperty(c)){var x=s[c];if(x!=null)switch(c){case"src":l=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,a));default:_e(e,a,c,x,s,null)}}i&&_e(e,a,"srcSet",s.srcSet,s,null),l&&_e(e,a,"src",s.src,s,null);return;case"input":ke("invalid",e);var v=c=x=i=null,A=null,B=null;for(l in s)if(s.hasOwnProperty(l)){var Y=s[l];if(Y!=null)switch(l){case"name":i=Y;break;case"type":x=Y;break;case"checked":A=Y;break;case"defaultChecked":B=Y;break;case"value":c=Y;break;case"defaultValue":v=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(o(137,a));break;default:_e(e,a,l,Y,s,null)}}Nu(e,c,v,A,B,x,i,!1);return;case"select":ke("invalid",e),l=x=c=null;for(i in s)if(s.hasOwnProperty(i)&&(v=s[i],v!=null))switch(i){case"value":c=v;break;case"defaultValue":x=v;break;case"multiple":l=v;default:_e(e,a,i,v,s,null)}a=c,s=x,e.multiple=!!l,a!=null?nn(e,!!l,a,!1):s!=null&&nn(e,!!l,s,!0);return;case"textarea":ke("invalid",e),c=i=l=null;for(x in s)if(s.hasOwnProperty(x)&&(v=s[x],v!=null))switch(x){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,a,x,v,s,null)}Su(e,l,i,c);return;case"option":for(A in s)if(s.hasOwnProperty(A)&&(l=s[A],l!=null))switch(A){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:_e(e,a,A,l,s,null)}return;case"dialog":ke("beforetoggle",e),ke("toggle",e),ke("cancel",e),ke("close",e);break;case"iframe":case"object":ke("load",e);break;case"video":case"audio":for(l=0;l<Ml.length;l++)ke(Ml[l],e);break;case"image":ke("error",e),ke("load",e);break;case"details":ke("toggle",e);break;case"embed":case"source":case"link":ke("error",e),ke("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(B in s)if(s.hasOwnProperty(B)&&(l=s[B],l!=null))switch(B){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,a));default:_e(e,a,B,l,s,null)}return;default:if(ic(a)){for(Y in s)s.hasOwnProperty(Y)&&(l=s[Y],l!==void 0&&Qo(e,a,Y,l,s,void 0));return}}for(v in s)s.hasOwnProperty(v)&&(l=s[v],l!=null&&_e(e,a,v,l,s,null))}function Eg(e,a,s,l){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,c=null,x=null,v=null,A=null,B=null,Y=null;for(V in s){var I=s[V];if(s.hasOwnProperty(V)&&I!=null)switch(V){case"checked":break;case"value":break;case"defaultValue":A=I;default:l.hasOwnProperty(V)||_e(e,a,V,null,l,I)}}for(var q in l){var V=l[q];if(I=s[q],l.hasOwnProperty(q)&&(V!=null||I!=null))switch(q){case"type":c=V;break;case"name":i=V;break;case"checked":B=V;break;case"defaultChecked":Y=V;break;case"value":x=V;break;case"defaultValue":v=V;break;case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(o(137,a));break;default:V!==I&&_e(e,a,q,V,l,I)}}nc(e,x,v,A,B,Y,c,i);return;case"select":V=x=v=q=null;for(c in s)if(A=s[c],s.hasOwnProperty(c)&&A!=null)switch(c){case"value":break;case"multiple":V=A;default:l.hasOwnProperty(c)||_e(e,a,c,null,l,A)}for(i in l)if(c=l[i],A=s[i],l.hasOwnProperty(i)&&(c!=null||A!=null))switch(i){case"value":q=c;break;case"defaultValue":v=c;break;case"multiple":x=c;default:c!==A&&_e(e,a,i,c,l,A)}a=v,s=x,l=V,q!=null?nn(e,!!s,q,!1):!!l!=!!s&&(a!=null?nn(e,!!s,a,!0):nn(e,!!s,s?[]:"",!1));return;case"textarea":V=q=null;for(v in s)if(i=s[v],s.hasOwnProperty(v)&&i!=null&&!l.hasOwnProperty(v))switch(v){case"value":break;case"children":break;default:_e(e,a,v,null,l,i)}for(x in l)if(i=l[x],c=s[x],l.hasOwnProperty(x)&&(i!=null||c!=null))switch(x){case"value":q=i;break;case"defaultValue":V=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(o(91));break;default:i!==c&&_e(e,a,x,i,l,c)}wu(e,q,V);return;case"option":for(var de in s)if(q=s[de],s.hasOwnProperty(de)&&q!=null&&!l.hasOwnProperty(de))switch(de){case"selected":e.selected=!1;break;default:_e(e,a,de,null,l,q)}for(A in l)if(q=l[A],V=s[A],l.hasOwnProperty(A)&&q!==V&&(q!=null||V!=null))switch(A){case"selected":e.selected=q&&typeof q!="function"&&typeof q!="symbol";break;default:_e(e,a,A,q,l,V)}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 pe in s)q=s[pe],s.hasOwnProperty(pe)&&q!=null&&!l.hasOwnProperty(pe)&&_e(e,a,pe,null,l,q);for(B in l)if(q=l[B],V=s[B],l.hasOwnProperty(B)&&q!==V&&(q!=null||V!=null))switch(B){case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(o(137,a));break;default:_e(e,a,B,q,l,V)}return;default:if(ic(a)){for(var Ue in s)q=s[Ue],s.hasOwnProperty(Ue)&&q!==void 0&&!l.hasOwnProperty(Ue)&&Qo(e,a,Ue,void 0,l,q);for(Y in l)q=l[Y],V=s[Y],!l.hasOwnProperty(Y)||q===V||q===void 0&&V===void 0||Qo(e,a,Y,q,l,V);return}}for(var D in s)q=s[D],s.hasOwnProperty(D)&&q!=null&&!l.hasOwnProperty(D)&&_e(e,a,D,null,l,q);for(I in l)q=l[I],V=s[I],!l.hasOwnProperty(I)||q===V||q==null&&V==null||_e(e,a,I,q,l,V)}function Af(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Tg(){if(typeof performance.getEntriesByType=="function"){for(var e=0,a=0,s=performance.getEntriesByType("resource"),l=0;l<s.length;l++){var i=s[l],c=i.transferSize,x=i.initiatorType,v=i.duration;if(c&&v&&Af(x)){for(x=0,v=i.responseEnd,l+=1;l<s.length;l++){var A=s[l],B=A.startTime;if(B>v)break;var Y=A.transferSize,I=A.initiatorType;Y&&Af(I)&&(A=A.responseEnd,x+=Y*(A<v?1:(v-B)/(A-B)))}if(--l,a+=8*(c+x)/(i.duration/1e3),e++,10<e)break}}if(0<e)return a/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Zo=null,Jo=null;function cr(e){return e.nodeType===9?e:e.ownerDocument}function Ef(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 Tf(e,a){if(e===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&a==="foreignObject"?0:e}function Fo(e,a){return e==="textarea"||e==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var Io=null;function Rg(){var e=window.event;return e&&e.type==="popstate"?e===Io?!1:(Io=e,!0):(Io=null,!1)}var Rf=typeof setTimeout=="function"?setTimeout:void 0,Mg=typeof clearTimeout=="function"?clearTimeout:void 0,Mf=typeof Promise=="function"?Promise:void 0,Dg=typeof queueMicrotask=="function"?queueMicrotask:typeof Mf<"u"?function(e){return Mf.resolve(null).then(e).catch(Og)}:Rf;function Og(e){setTimeout(function(){throw e})}function ms(e){return e==="head"}function Df(e,a){var s=a,l=0;do{var i=s.nextSibling;if(e.removeChild(s),i&&i.nodeType===8)if(s=i.data,s==="/$"||s==="/&"){if(l===0){e.removeChild(i),Un(a);return}l--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")l++;else if(s==="html")Ol(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,Ol(s);for(var c=s.firstChild;c;){var x=c.nextSibling,v=c.nodeName;c[Pn]||v==="SCRIPT"||v==="STYLE"||v==="LINK"&&c.rel.toLowerCase()==="stylesheet"||s.removeChild(c),c=x}}else s==="body"&&Ol(e.ownerDocument.body);s=i}while(s);Un(a)}function Of(e,a){var s=e;e=0;do{var l=s.nextSibling;if(s.nodeType===1?a?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(a?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),l&&l.nodeType===8)if(s=l.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=l}while(s)}function Po(e){var a=e.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var s=a;switch(a=a.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Po(s),ac(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function Lg(e,a,s,l){for(;e.nodeType===1;){var i=s;if(e.nodeName.toLowerCase()!==a.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Pn])switch(a){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(a==="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=ea(e.nextSibling),e===null)break}return null}function _g(e,a,s){if(a==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=ea(e.nextSibling),e===null))return null;return e}function Lf(e,a){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=ea(e.nextSibling),e===null))return null;return e}function Wo(e){return e.data==="$?"||e.data==="$~"}function ed(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Ug(e,a){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=a;else if(e.data!=="$?"||s.readyState!=="loading")a();else{var l=function(){a(),s.removeEventListener("DOMContentLoaded",l)};s.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function ea(e){for(;e!=null;e=e.nextSibling){var a=e.nodeType;if(a===1||a===3)break;if(a===8){if(a=e.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return e}var td=null;function _f(e){e=e.nextSibling;for(var a=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(a===0)return ea(e.nextSibling);a--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||a++}e=e.nextSibling}return null}function Uf(e){e=e.previousSibling;for(var a=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(a===0)return e;a--}else s!=="/$"&&s!=="/&"||a++}e=e.previousSibling}return null}function Bf(e,a,s){switch(a=cr(s),e){case"html":if(e=a.documentElement,!e)throw Error(o(452));return e;case"head":if(e=a.head,!e)throw Error(o(453));return e;case"body":if(e=a.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function Ol(e){for(var a=e.attributes;a.length;)e.removeAttributeNode(a[0]);ac(e)}var ta=new Map,$f=new Set;function or(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var $a=_.d;_.d={f:Bg,r:$g,D:Hg,C:qg,L:Gg,m:Kg,X:Yg,S:Vg,M:Xg};function Bg(){var e=$a.f(),a=er();return e||a}function $g(e){var a=tn(e);a!==null&&a.tag===5&&a.type==="form"?tx(a):$a.r(e)}var On=typeof document>"u"?null:document;function Hf(e,a,s){var l=On;if(l&&typeof a=="string"&&a){var i=Qt(a);i='link[rel="'+e+'"][href="'+i+'"]',typeof s=="string"&&(i+='[crossorigin="'+s+'"]'),$f.has(i)||($f.add(i),e={rel:e,crossOrigin:s,href:a},l.querySelector(i)===null&&(a=l.createElement("link"),ft(a,"link",e),it(a),l.head.appendChild(a)))}}function Hg(e){$a.D(e),Hf("dns-prefetch",e,null)}function qg(e,a){$a.C(e,a),Hf("preconnect",e,a)}function Gg(e,a,s){$a.L(e,a,s);var l=On;if(l&&e&&a){var i='link[rel="preload"][as="'+Qt(a)+'"]';a==="image"&&s&&s.imageSrcSet?(i+='[imagesrcset="'+Qt(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(i+='[imagesizes="'+Qt(s.imageSizes)+'"]')):i+='[href="'+Qt(e)+'"]';var c=i;switch(a){case"style":c=Ln(e);break;case"script":c=_n(e)}ta.has(c)||(e=y({rel:"preload",href:a==="image"&&s&&s.imageSrcSet?void 0:e,as:a},s),ta.set(c,e),l.querySelector(i)!==null||a==="style"&&l.querySelector(Ll(c))||a==="script"&&l.querySelector(_l(c))||(a=l.createElement("link"),ft(a,"link",e),it(a),l.head.appendChild(a)))}}function Kg(e,a){$a.m(e,a);var s=On;if(s&&e){var l=a&&typeof a.as=="string"?a.as:"script",i='link[rel="modulepreload"][as="'+Qt(l)+'"][href="'+Qt(e)+'"]',c=i;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=_n(e)}if(!ta.has(c)&&(e=y({rel:"modulepreload",href:e},a),ta.set(c,e),s.querySelector(i)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(_l(c)))return}l=s.createElement("link"),ft(l,"link",e),it(l),s.head.appendChild(l)}}}function Vg(e,a,s){$a.S(e,a,s);var l=On;if(l&&e){var i=an(l).hoistableStyles,c=Ln(e);a=a||"default";var x=i.get(c);if(!x){var v={loading:0,preload:null};if(x=l.querySelector(Ll(c)))v.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":a},s),(s=ta.get(c))&&ad(e,s);var A=x=l.createElement("link");it(A),ft(A,"link",e),A._p=new Promise(function(B,Y){A.onload=B,A.onerror=Y}),A.addEventListener("load",function(){v.loading|=1}),A.addEventListener("error",function(){v.loading|=2}),v.loading|=4,dr(x,a,l)}x={type:"stylesheet",instance:x,count:1,state:v},i.set(c,x)}}}function Yg(e,a){$a.X(e,a);var s=On;if(s&&e){var l=an(s).hoistableScripts,i=_n(e),c=l.get(i);c||(c=s.querySelector(_l(i)),c||(e=y({src:e,async:!0},a),(a=ta.get(i))&&sd(e,a),c=s.createElement("script"),it(c),ft(c,"link",e),s.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},l.set(i,c))}}function Xg(e,a){$a.M(e,a);var s=On;if(s&&e){var l=an(s).hoistableScripts,i=_n(e),c=l.get(i);c||(c=s.querySelector(_l(i)),c||(e=y({src:e,async:!0,type:"module"},a),(a=ta.get(i))&&sd(e,a),c=s.createElement("script"),it(c),ft(c,"link",e),s.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},l.set(i,c))}}function qf(e,a,s,l){var i=(i=ue.current)?or(i):null;if(!i)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(a=Ln(s.href),s=an(i).hoistableStyles,l=s.get(a),l||(l={type:"style",instance:null,count:0,state:null},s.set(a,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=Ln(s.href);var c=an(i).hoistableStyles,x=c.get(e);if(x||(i=i.ownerDocument||i,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,x),(c=i.querySelector(Ll(e)))&&!c._p&&(x.instance=c,x.state.loading=5),ta.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},ta.set(e,s),c||Qg(i,e,s,x.state))),a&&l===null)throw Error(o(528,""));return x}if(a&&l!==null)throw Error(o(529,""));return null;case"script":return a=s.async,s=s.src,typeof s=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=_n(s),s=an(i).hoistableScripts,l=s.get(a),l||(l={type:"script",instance:null,count:0,state:null},s.set(a,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Ln(e){return'href="'+Qt(e)+'"'}function Ll(e){return'link[rel="stylesheet"]['+e+"]"}function Gf(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function Qg(e,a,s,l){e.querySelector('link[rel="preload"][as="style"]['+a+"]")?l.loading=1:(a=e.createElement("link"),l.preload=a,a.addEventListener("load",function(){return l.loading|=1}),a.addEventListener("error",function(){return l.loading|=2}),ft(a,"link",s),it(a),e.head.appendChild(a))}function _n(e){return'[src="'+Qt(e)+'"]'}function _l(e){return"script[async]"+e}function Kf(e,a,s){if(a.count++,a.instance===null)switch(a.type){case"style":var l=e.querySelector('style[data-href~="'+Qt(s.href)+'"]');if(l)return a.instance=l,it(l),l;var i=y({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),it(l),ft(l,"style",i),dr(l,s.precedence,e),a.instance=l;case"stylesheet":i=Ln(s.href);var c=e.querySelector(Ll(i));if(c)return a.state.loading|=4,a.instance=c,it(c),c;l=Gf(s),(i=ta.get(i))&&ad(l,i),c=(e.ownerDocument||e).createElement("link"),it(c);var x=c;return x._p=new Promise(function(v,A){x.onload=v,x.onerror=A}),ft(c,"link",l),a.state.loading|=4,dr(c,s.precedence,e),a.instance=c;case"script":return c=_n(s.src),(i=e.querySelector(_l(c)))?(a.instance=i,it(i),i):(l=s,(i=ta.get(c))&&(l=y({},s),sd(l,i)),e=e.ownerDocument||e,i=e.createElement("script"),it(i),ft(i,"link",l),e.head.appendChild(i),a.instance=i);case"void":return null;default:throw Error(o(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(l=a.instance,a.state.loading|=4,dr(l,s.precedence,e));return a.instance}function dr(e,a,s){for(var l=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=l.length?l[l.length-1]:null,c=i,x=0;x<l.length;x++){var v=l[x];if(v.dataset.precedence===a)c=v;else if(c!==i)break}c?c.parentNode.insertBefore(e,c.nextSibling):(a=s.nodeType===9?s.head:s,a.insertBefore(e,a.firstChild))}function ad(e,a){e.crossOrigin==null&&(e.crossOrigin=a.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=a.referrerPolicy),e.title==null&&(e.title=a.title)}function sd(e,a){e.crossOrigin==null&&(e.crossOrigin=a.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=a.referrerPolicy),e.integrity==null&&(e.integrity=a.integrity)}var ur=null;function Vf(e,a,s){if(ur===null){var l=new Map,i=ur=new Map;i.set(s,l)}else i=ur,l=i.get(s),l||(l=new Map,i.set(s,l));if(l.has(e))return l;for(l.set(e,null),s=s.getElementsByTagName(e),i=0;i<s.length;i++){var c=s[i];if(!(c[Pn]||c[dt]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var x=c.getAttribute(a)||"";x=e+x;var v=l.get(x);v?v.push(c):l.set(x,[c])}}return l}function Yf(e,a,s){e=e.ownerDocument||e,e.head.insertBefore(s,a==="title"?e.querySelector("head > title"):null)}function Zg(e,a,s){if(s===1||a.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;switch(a.rel){case"stylesheet":return e=a.disabled,typeof a.precedence=="string"&&e==null;default:return!0}case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function Xf(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Jg(e,a,s,l){if(s.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var i=Ln(l.href),c=a.querySelector(Ll(i));if(c){a=c._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(e.count++,e=mr.bind(e),a.then(e,e)),s.state.loading|=4,s.instance=c,it(c);return}c=a.ownerDocument||a,l=Gf(l),(i=ta.get(i))&&ad(l,i),c=c.createElement("link"),it(c);var x=c;x._p=new Promise(function(v,A){x.onload=v,x.onerror=A}),ft(c,"link",l),s.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,a),(a=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=mr.bind(e),a.addEventListener("load",s),a.addEventListener("error",s))}}var nd=0;function Fg(e,a){return e.stylesheets&&e.count===0&&fr(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var l=setTimeout(function(){if(e.stylesheets&&fr(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+a);0<e.imgBytes&&nd===0&&(nd=62500*Tg());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&fr(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>nd?50:800)+a);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(i)}}:null}function mr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)fr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var xr=null;function fr(e,a){e.stylesheets=null,e.unsuspend!==null&&(e.count++,xr=new Map,a.forEach(Ig,e),xr=null,mr.call(e))}function Ig(e,a){if(!(a.state.loading&4)){var s=xr.get(e);if(s)var l=s.get(null);else{s=new Map,xr.set(e,s);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<i.length;c++){var x=i[c];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(s.set(x.dataset.precedence,x),l=x)}l&&s.set(null,l)}i=a.instance,x=i.getAttribute("data-precedence"),c=s.get(x)||l,c===l&&s.set(null,i),s.set(x,i),this.count++,l=mr.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)),a.state.loading|=4}}var Ul={$$typeof:O,Provider:null,Consumer:null,_currentValue:Z,_currentValue2:Z,_threadCount:0};function Pg(e,a,s,l,i,c,x,v,A){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=Pr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pr(0),this.hiddenUpdates=Pr(null),this.identifierPrefix=l,this.onUncaughtError=i,this.onCaughtError=c,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=A,this.incompleteTransitions=new Map}function Qf(e,a,s,l,i,c,x,v,A,B,Y,I){return e=new Pg(e,a,s,x,A,B,Y,I,v),a=1,c===!0&&(a|=24),c=Ut(3,null,null,a),e.current=c,c.stateNode=e,a=_c(),a.refCount++,e.pooledCache=a,a.refCount++,c.memoizedState={element:l,isDehydrated:s,cache:a},Hc(c),e}function Zf(e){return e?(e=xn,e):xn}function Jf(e,a,s,l,i,c){i=Zf(i),l.context===null?l.context=i:l.pendingContext=i,l=ts(a),l.payload={element:s},c=c===void 0?null:c,c!==null&&(l.callback=c),s=as(e,l,a),s!==null&&(Tt(s,e,a),hl(s,e,a))}function Ff(e,a){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<a?s:a}}function ld(e,a){Ff(e,a),(e=e.alternate)&&Ff(e,a)}function If(e){if(e.tag===13||e.tag===31){var a=Es(e,67108864);a!==null&&Tt(a,e,67108864),ld(e,67108864)}}function Pf(e){if(e.tag===13||e.tag===31){var a=Gt();a=Wr(a);var s=Es(e,a);s!==null&&Tt(s,e,a),ld(e,a)}}var hr=!0;function Wg(e,a,s,l){var i=K.T;K.T=null;var c=_.p;try{_.p=2,id(e,a,s,l)}finally{_.p=c,K.T=i}}function eb(e,a,s,l){var i=K.T;K.T=null;var c=_.p;try{_.p=8,id(e,a,s,l)}finally{_.p=c,K.T=i}}function id(e,a,s,l){if(hr){var i=rd(l);if(i===null)Xo(e,a,l,pr,s),eh(e,l);else if(ab(i,e,a,s,l))l.stopPropagation();else if(eh(e,l),a&4&&-1<tb.indexOf(e)){for(;i!==null;){var c=tn(i);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var x=Ss(c.pendingLanes);if(x!==0){var v=c;for(v.pendingLanes|=2,v.entangledLanes|=2;x;){var A=1<<31-Lt(x);v.entanglements[1]|=A,x&=~A}fa(c),(Me&6)===0&&(Pi=bt()+500,Rl(0))}}break;case 31:case 13:v=Es(c,2),v!==null&&Tt(v,c,2),er(),ld(c,2)}if(c=rd(l),c===null&&Xo(e,a,l,pr,s),c===i)break;i=c}i!==null&&l.stopPropagation()}else Xo(e,a,l,null,s)}}function rd(e){return e=cc(e),cd(e)}var pr=null;function cd(e){if(pr=null,e=en(e),e!==null){var a=f(e);if(a===null)e=null;else{var s=a.tag;if(s===13){if(e=h(a),e!==null)return e;e=null}else if(s===31){if(e=b(a),e!==null)return e;e=null}else if(s===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;e=null}else a!==e&&(e=null)}}return pr=e,null}function Wf(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(ni()){case Zn:return 2;case li:return 8;case Ps:case q0:return 32;case cu:return 268435456;default:return 32}default:return 32}}var od=!1,xs=null,fs=null,hs=null,Bl=new Map,$l=new Map,ps=[],tb="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function eh(e,a){switch(e){case"focusin":case"focusout":xs=null;break;case"dragenter":case"dragleave":fs=null;break;case"mouseover":case"mouseout":hs=null;break;case"pointerover":case"pointerout":Bl.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":$l.delete(a.pointerId)}}function Hl(e,a,s,l,i,c){return e===null||e.nativeEvent!==c?(e={blockedOn:a,domEventName:s,eventSystemFlags:l,nativeEvent:c,targetContainers:[i]},a!==null&&(a=tn(a),a!==null&&If(a)),e):(e.eventSystemFlags|=l,a=e.targetContainers,i!==null&&a.indexOf(i)===-1&&a.push(i),e)}function ab(e,a,s,l,i){switch(a){case"focusin":return xs=Hl(xs,e,a,s,l,i),!0;case"dragenter":return fs=Hl(fs,e,a,s,l,i),!0;case"mouseover":return hs=Hl(hs,e,a,s,l,i),!0;case"pointerover":var c=i.pointerId;return Bl.set(c,Hl(Bl.get(c)||null,e,a,s,l,i)),!0;case"gotpointercapture":return c=i.pointerId,$l.set(c,Hl($l.get(c)||null,e,a,s,l,i)),!0}return!1}function th(e){var a=en(e.target);if(a!==null){var s=f(a);if(s!==null){if(a=s.tag,a===13){if(a=h(s),a!==null){e.blockedOn=a,fu(e.priority,function(){Pf(s)});return}}else if(a===31){if(a=b(s),a!==null){e.blockedOn=a,fu(e.priority,function(){Pf(s)});return}}else if(a===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function gr(e){if(e.blockedOn!==null)return!1;for(var a=e.targetContainers;0<a.length;){var s=rd(e.nativeEvent);if(s===null){s=e.nativeEvent;var l=new s.constructor(s.type,s);rc=l,s.target.dispatchEvent(l),rc=null}else return a=tn(s),a!==null&&If(a),e.blockedOn=s,!1;a.shift()}return!0}function ah(e,a,s){gr(e)&&s.delete(a)}function sb(){od=!1,xs!==null&&gr(xs)&&(xs=null),fs!==null&&gr(fs)&&(fs=null),hs!==null&&gr(hs)&&(hs=null),Bl.forEach(ah),$l.forEach(ah)}function br(e,a){e.blockedOn===a&&(e.blockedOn=null,od||(od=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,sb)))}var yr=null;function sh(e){yr!==e&&(yr=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){yr===e&&(yr=null);for(var a=0;a<e.length;a+=3){var s=e[a],l=e[a+1],i=e[a+2];if(typeof l!="function"){if(cd(l||s)===null)continue;break}var c=tn(s);c!==null&&(e.splice(a,3),a-=3,io(c,{pending:!0,data:i,method:s.method,action:l},l,i))}}))}function Un(e){function a(A){return br(A,e)}xs!==null&&br(xs,e),fs!==null&&br(fs,e),hs!==null&&br(hs,e),Bl.forEach(a),$l.forEach(a);for(var s=0;s<ps.length;s++){var l=ps[s];l.blockedOn===e&&(l.blockedOn=null)}for(;0<ps.length&&(s=ps[0],s.blockedOn===null);)th(s),s.blockedOn===null&&ps.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(l=0;l<s.length;l+=3){var i=s[l],c=s[l+1],x=i[St]||null;if(typeof c=="function")x||sh(s);else if(x){var v=null;if(c&&c.hasAttribute("formAction")){if(i=c,x=c[St]||null)v=x.formAction;else if(cd(i)!==null)continue}else v=x.action;typeof v=="function"?s[l+1]=v:(s.splice(l,3),l-=3),sh(s)}}}function nh(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(x){return i=x})},focusReset:"manual",scroll:"manual"})}function a(){i!==null&&(i(),i=null),l||setTimeout(s,20)}function s(){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",a),navigation.addEventListener("navigateerror",a),setTimeout(s,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),i!==null&&(i(),i=null)}}}function dd(e){this._internalRoot=e}vr.prototype.render=dd.prototype.render=function(e){var a=this._internalRoot;if(a===null)throw Error(o(409));var s=a.current,l=Gt();Jf(s,l,e,a,null,null)},vr.prototype.unmount=dd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var a=e.containerInfo;Jf(e.current,2,null,e,null,null),er(),a[Ws]=null}};function vr(e){this._internalRoot=e}vr.prototype.unstable_scheduleHydration=function(e){if(e){var a=xu();e={blockedOn:null,target:e,priority:a};for(var s=0;s<ps.length&&a!==0&&a<ps[s].priority;s++);ps.splice(s,0,e),s===0&&th(e)}};var lh=r.version;if(lh!=="19.2.4")throw Error(o(527,lh,"19.2.4"));_.findDOMNode=function(e){var a=e._reactInternals;if(a===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=p(a),e=e!==null?j(e):null,e=e===null?null:e.stateNode,e};var nb={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:K,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var jr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!jr.isDisabled&&jr.supportsFiber)try{Jn=jr.inject(nb),Ot=jr}catch{}}return Gl.createRoot=function(e,a){if(!m(e))throw Error(o(299));var s=!1,l="",i=ux,c=mx,x=xx;return a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(l=a.identifierPrefix),a.onUncaughtError!==void 0&&(i=a.onUncaughtError),a.onCaughtError!==void 0&&(c=a.onCaughtError),a.onRecoverableError!==void 0&&(x=a.onRecoverableError)),a=Qf(e,1,!1,null,null,s,l,null,i,c,x,nh),e[Ws]=a.current,Yo(e),new dd(a)},Gl.hydrateRoot=function(e,a,s){if(!m(e))throw Error(o(299));var l=!1,i="",c=ux,x=mx,v=xx,A=null;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(i=s.identifierPrefix),s.onUncaughtError!==void 0&&(c=s.onUncaughtError),s.onCaughtError!==void 0&&(x=s.onCaughtError),s.onRecoverableError!==void 0&&(v=s.onRecoverableError),s.formState!==void 0&&(A=s.formState)),a=Qf(e,1,!0,a,s??null,l,i,A,c,x,v,nh),a.context=Zf(null),s=a.current,l=Gt(),l=Wr(l),i=ts(l),i.callback=null,as(s,i,l),s=l,a.current.lanes=s,In(a,s),fa(a),e[Ws]=a.current,Yo(e),new vr(a)},Gl.version="19.2.4",Gl}var hh;function pb(){if(hh)return fd.exports;hh=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),fd.exports=hb(),fd.exports}var gb=pb();/**
|
|
50
|
-
* react-router v7.13.2
|
|
51
|
-
*
|
|
52
|
-
* Copyright (c) Remix Software Inc.
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the MIT license found in the
|
|
55
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
-
*
|
|
57
|
-
* @license MIT
|
|
58
|
-
*/var ph="popstate";function gh(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function bb(n={}){function r(o,m){var p;let f=(p=m.state)==null?void 0:p.masked,{pathname:h,search:b,hash:g}=f||o.location;return Ed("",{pathname:h,search:b,hash:g},m.state&&m.state.usr||null,m.state&&m.state.key||"default",f?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function d(o,m){return typeof m=="string"?m:Jl(m)}return vb(r,d,null,n)}function Ve(n,r){if(n===!1||n===null||typeof n>"u")throw new Error(r)}function sa(n,r){if(!n){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function yb(){return Math.random().toString(36).substring(2,10)}function bh(n,r){return{usr:n.state,key:n.key,idx:r,masked:n.unstable_mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function Ed(n,r,d=null,o,m){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof r=="string"?qn(r):r,state:d,key:r&&r.key||o||yb(),unstable_mask:m}}function Jl({pathname:n="/",search:r="",hash:d=""}){return r&&r!=="?"&&(n+=r.charAt(0)==="?"?r:"?"+r),d&&d!=="#"&&(n+=d.charAt(0)==="#"?d:"#"+d),n}function qn(n){let r={};if(n){let d=n.indexOf("#");d>=0&&(r.hash=n.substring(d),n=n.substring(0,d));let o=n.indexOf("?");o>=0&&(r.search=n.substring(o),n=n.substring(0,o)),n&&(r.pathname=n)}return r}function vb(n,r,d,o={}){let{window:m=document.defaultView,v5Compat:f=!1}=o,h=m.history,b="POP",g=null,p=j();p==null&&(p=0,h.replaceState({...h.state,idx:p},""));function j(){return(h.state||{idx:null}).idx}function y(){b="POP";let S=j(),z=S==null?null:S-p;p=S,g&&g({action:b,location:N.location,delta:z})}function w(S,z){b="PUSH";let M=gh(S)?S:Ed(N.location,S,z);p=j()+1;let O=bh(M,p),E=N.createHref(M.unstable_mask||M);try{h.pushState(O,"",E)}catch(ae){if(ae instanceof DOMException&&ae.name==="DataCloneError")throw ae;m.location.assign(E)}f&&g&&g({action:b,location:N.location,delta:1})}function C(S,z){b="REPLACE";let M=gh(S)?S:Ed(N.location,S,z);p=j();let O=bh(M,p),E=N.createHref(M.unstable_mask||M);h.replaceState(O,"",E),f&&g&&g({action:b,location:N.location,delta:0})}function k(S){return jb(S)}let N={get action(){return b},get location(){return n(m,h)},listen(S){if(g)throw new Error("A history only accepts one active listener");return m.addEventListener(ph,y),g=S,()=>{m.removeEventListener(ph,y),g=null}},createHref(S){return r(m,S)},createURL:k,encodeLocation(S){let z=k(S);return{pathname:z.pathname,search:z.search,hash:z.hash}},push:w,replace:C,go(S){return h.go(S)}};return N}function jb(n,r=!1){let d="http://localhost";typeof window<"u"&&(d=window.location.origin!=="null"?window.location.origin:window.location.href),Ve(d,"No window.location.(origin|href) available to create URL");let o=typeof n=="string"?n:Jl(n);return o=o.replace(/ $/,"%20"),!r&&o.startsWith("//")&&(o=d+o),new URL(o,d)}function Xh(n,r,d="/"){return Nb(n,r,d,!1)}function Nb(n,r,d,o){let m=typeof r=="string"?qn(r):r,f=Ga(m.pathname||"/",d);if(f==null)return null;let h=Qh(n);wb(h);let b=null;for(let g=0;b==null&&g<h.length;++g){let p=Ob(f);b=Mb(h[g],p,o)}return b}function Qh(n,r=[],d=[],o="",m=!1){let f=(h,b,g=m,p)=>{let j={relativePath:p===void 0?h.path||"":p,caseSensitive:h.caseSensitive===!0,childrenIndex:b,route:h};if(j.relativePath.startsWith("/")){if(!j.relativePath.startsWith(o)&&g)return;Ve(j.relativePath.startsWith(o),`Absolute route path "${j.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),j.relativePath=j.relativePath.slice(o.length)}let y=ha([o,j.relativePath]),w=d.concat(j);h.children&&h.children.length>0&&(Ve(h.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),Qh(h.children,r,w,y,g)),!(h.path==null&&!h.index)&&r.push({path:y,score:Tb(y,h.index),routesMeta:w})};return n.forEach((h,b)=>{var g;if(h.path===""||!((g=h.path)!=null&&g.includes("?")))f(h,b);else for(let p of Zh(h.path))f(h,b,!0,p)}),r}function Zh(n){let r=n.split("/");if(r.length===0)return[];let[d,...o]=r,m=d.endsWith("?"),f=d.replace(/\?$/,"");if(o.length===0)return m?[f,""]:[f];let h=Zh(o.join("/")),b=[];return b.push(...h.map(g=>g===""?f:[f,g].join("/"))),m&&b.push(...h),b.map(g=>n.startsWith("/")&&g===""?"/":g)}function wb(n){n.sort((r,d)=>r.score!==d.score?d.score-r.score:Rb(r.routesMeta.map(o=>o.childrenIndex),d.routesMeta.map(o=>o.childrenIndex)))}var Sb=/^:[\w-]+$/,kb=3,zb=2,Cb=1,Ab=10,Eb=-2,yh=n=>n==="*";function Tb(n,r){let d=n.split("/"),o=d.length;return d.some(yh)&&(o+=Eb),r&&(o+=zb),d.filter(m=>!yh(m)).reduce((m,f)=>m+(Sb.test(f)?kb:f===""?Cb:Ab),o)}function Rb(n,r){return n.length===r.length&&n.slice(0,-1).every((o,m)=>o===r[m])?n[n.length-1]-r[r.length-1]:0}function Mb(n,r,d=!1){let{routesMeta:o}=n,m={},f="/",h=[];for(let b=0;b<o.length;++b){let g=o[b],p=b===o.length-1,j=f==="/"?r:r.slice(f.length)||"/",y=Lr({path:g.relativePath,caseSensitive:g.caseSensitive,end:p},j),w=g.route;if(!y&&p&&d&&!o[o.length-1].route.index&&(y=Lr({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},j)),!y)return null;Object.assign(m,y.params),h.push({params:m,pathname:ha([f,y.pathname]),pathnameBase:Bb(ha([f,y.pathnameBase])),route:w}),y.pathnameBase!=="/"&&(f=ha([f,y.pathnameBase]))}return h}function Lr(n,r){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[d,o]=Db(n.path,n.caseSensitive,n.end),m=r.match(d);if(!m)return null;let f=m[0],h=f.replace(/(.)\/+$/,"$1"),b=m.slice(1);return{params:o.reduce((p,{paramName:j,isOptional:y},w)=>{if(j==="*"){let k=b[w]||"";h=f.slice(0,f.length-k.length).replace(/(.)\/+$/,"$1")}const C=b[w];return y&&!C?p[j]=void 0:p[j]=(C||"").replace(/%2F/g,"/"),p},{}),pathname:f,pathnameBase:h,pattern:n}}function Db(n,r=!1,d=!0){sa(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let o=[],m="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(h,b,g,p,j)=>{if(o.push({paramName:b,isOptional:g!=null}),g){let y=j.charAt(p+h.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(o.push({paramName:"*"}),m+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):d?m+="\\/*$":n!==""&&n!=="/"&&(m+="(?:(?=\\/|$))"),[new RegExp(m,r?void 0:"i"),o]}function Ob(n){try{return n.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return sa(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${r}).`),n}}function Ga(n,r){if(r==="/")return n;if(!n.toLowerCase().startsWith(r.toLowerCase()))return null;let d=r.endsWith("/")?r.length-1:r.length,o=n.charAt(d);return o&&o!=="/"?null:n.slice(d)||"/"}var Lb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function _b(n,r="/"){let{pathname:d,search:o="",hash:m=""}=typeof n=="string"?qn(n):n,f;return d?(d=d.replace(/\/\/+/g,"/"),d.startsWith("/")?f=vh(d.substring(1),"/"):f=vh(d,r)):f=r,{pathname:f,search:$b(o),hash:Hb(m)}}function vh(n,r){let d=r.replace(/\/+$/,"").split("/");return n.split("/").forEach(m=>{m===".."?d.length>1&&d.pop():m!=="."&&d.push(m)}),d.length>1?d.join("/"):"/"}function bd(n,r,d,o){return`Cannot include a '${n}' character in a manually specified \`to.${r}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${d}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Ub(n){return n.filter((r,d)=>d===0||r.route.path&&r.route.path.length>0)}function Hd(n){let r=Ub(n);return r.map((d,o)=>o===r.length-1?d.pathname:d.pathnameBase)}function Hr(n,r,d,o=!1){let m;typeof n=="string"?m=qn(n):(m={...n},Ve(!m.pathname||!m.pathname.includes("?"),bd("?","pathname","search",m)),Ve(!m.pathname||!m.pathname.includes("#"),bd("#","pathname","hash",m)),Ve(!m.search||!m.search.includes("#"),bd("#","search","hash",m)));let f=n===""||m.pathname==="",h=f?"/":m.pathname,b;if(h==null)b=d;else{let y=r.length-1;if(!o&&h.startsWith("..")){let w=h.split("/");for(;w[0]==="..";)w.shift(),y-=1;m.pathname=w.join("/")}b=y>=0?r[y]:"/"}let g=_b(m,b),p=h&&h!=="/"&&h.endsWith("/"),j=(f||h===".")&&d.endsWith("/");return!g.pathname.endsWith("/")&&(p||j)&&(g.pathname+="/"),g}var ha=n=>n.join("/").replace(/\/\/+/g,"/"),Bb=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),$b=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,Hb=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,qb=class{constructor(n,r,d,o=!1){this.status=n,this.statusText=r||"",this.internal=o,d instanceof Error?(this.data=d.toString(),this.error=d):this.data=d}};function Gb(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function Kb(n){return n.map(r=>r.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Jh=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Fh(n,r){let d=n;if(typeof d!="string"||!Lb.test(d))return{absoluteURL:void 0,isExternal:!1,to:d};let o=d,m=!1;if(Jh)try{let f=new URL(window.location.href),h=d.startsWith("//")?new URL(f.protocol+d):new URL(d),b=Ga(h.pathname,r);h.origin===f.origin&&b!=null?d=b+h.search+h.hash:m=!0}catch{sa(!1,`<Link to="${d}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:m,to:d}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Ih=["POST","PUT","PATCH","DELETE"];new Set(Ih);var Vb=["GET",...Ih];new Set(Vb);var Gn=u.createContext(null);Gn.displayName="DataRouter";var qr=u.createContext(null);qr.displayName="DataRouterState";var Yb=u.createContext(!1),Ph=u.createContext({isTransitioning:!1});Ph.displayName="ViewTransition";var Xb=u.createContext(new Map);Xb.displayName="Fetchers";var Qb=u.createContext(null);Qb.displayName="Await";var Vt=u.createContext(null);Vt.displayName="Navigation";var Wl=u.createContext(null);Wl.displayName="Location";var na=u.createContext({outlet:null,matches:[],isDataRoute:!1});na.displayName="Route";var qd=u.createContext(null);qd.displayName="RouteError";var Wh="REACT_ROUTER_ERROR",Zb="REDIRECT",Jb="ROUTE_ERROR_RESPONSE";function Fb(n){if(n.startsWith(`${Wh}:${Zb}:{`))try{let r=JSON.parse(n.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 Ib(n){if(n.startsWith(`${Wh}:${Jb}:{`))try{let r=JSON.parse(n.slice(40));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string")return new qb(r.status,r.statusText,r.data)}catch{}}function Pb(n,{relative:r}={}){Ve(Kn(),"useHref() may be used only in the context of a <Router> component.");let{basename:d,navigator:o}=u.useContext(Vt),{hash:m,pathname:f,search:h}=ei(n,{relative:r}),b=f;return d!=="/"&&(b=f==="/"?d:ha([d,f])),o.createHref({pathname:b,search:h,hash:m})}function Kn(){return u.useContext(Wl)!=null}function da(){return Ve(Kn(),"useLocation() may be used only in the context of a <Router> component."),u.useContext(Wl).location}var e0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function t0(n){u.useContext(Vt).static||u.useLayoutEffect(n)}function Rt(){let{isDataRoute:n}=u.useContext(na);return n?xy():Wb()}function Wb(){Ve(Kn(),"useNavigate() may be used only in the context of a <Router> component.");let n=u.useContext(Gn),{basename:r,navigator:d}=u.useContext(Vt),{matches:o}=u.useContext(na),{pathname:m}=da(),f=JSON.stringify(Hd(o)),h=u.useRef(!1);return t0(()=>{h.current=!0}),u.useCallback((g,p={})=>{if(sa(h.current,e0),!h.current)return;if(typeof g=="number"){d.go(g);return}let j=Hr(g,JSON.parse(f),m,p.relative==="path");n==null&&r!=="/"&&(j.pathname=j.pathname==="/"?r:ha([r,j.pathname])),(p.replace?d.replace:d.push)(j,p.state,p)},[r,d,f,m,n])}var ey=u.createContext(null);function ty(n){let r=u.useContext(na).outlet;return u.useMemo(()=>r&&u.createElement(ey.Provider,{value:n},r),[r,n])}function Vn(){let{matches:n}=u.useContext(na),r=n[n.length-1];return r?r.params:{}}function ei(n,{relative:r}={}){let{matches:d}=u.useContext(na),{pathname:o}=da(),m=JSON.stringify(Hd(d));return u.useMemo(()=>Hr(n,JSON.parse(m),o,r==="path"),[n,m,o,r])}function ay(n,r){return a0(n,r)}function a0(n,r,d){var S;Ve(Kn(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=u.useContext(Vt),{matches:m}=u.useContext(na),f=m[m.length-1],h=f?f.params:{},b=f?f.pathname:"/",g=f?f.pathnameBase:"/",p=f&&f.route;{let z=p&&p.path||"";n0(b,!p||z.endsWith("*")||z.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${b}" (under <Route path="${z}">) 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="${z}"> to <Route path="${z==="/"?"*":`${z}/*`}">.`)}let j=da(),y;if(r){let z=typeof r=="string"?qn(r):r;Ve(g==="/"||((S=z.pathname)==null?void 0:S.startsWith(g)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${g}" but pathname "${z.pathname}" was given in the \`location\` prop.`),y=z}else y=j;let w=y.pathname||"/",C=w;if(g!=="/"){let z=g.replace(/^\//,"").split("/");C="/"+w.replace(/^\//,"").split("/").slice(z.length).join("/")}let k=Xh(n,{pathname:C});sa(p||k!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),sa(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let N=ry(k&&k.map(z=>Object.assign({},z,{params:Object.assign({},h,z.params),pathname:ha([g,o.encodeLocation?o.encodeLocation(z.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:z.pathname]),pathnameBase:z.pathnameBase==="/"?g:ha([g,o.encodeLocation?o.encodeLocation(z.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:z.pathnameBase])})),m,d);return r&&N?u.createElement(Wl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...y},navigationType:"POP"}},N):N}function sy(){let n=my(),r=Gb(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),d=n instanceof Error?n.stack:null,o="rgba(200,200,200, 0.5)",m={padding:"0.5rem",backgroundColor:o},f={padding:"2px 4px",backgroundColor:o},h=null;return console.error("Error handled by React Router default ErrorBoundary:",n),h=u.createElement(u.Fragment,null,u.createElement("p",null,"💿 Hey developer 👋"),u.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",u.createElement("code",{style:f},"ErrorBoundary")," or"," ",u.createElement("code",{style:f},"errorElement")," prop on your route.")),u.createElement(u.Fragment,null,u.createElement("h2",null,"Unexpected Application Error!"),u.createElement("h3",{style:{fontStyle:"italic"}},r),d?u.createElement("pre",{style:m},d):null,h)}var ny=u.createElement(sy,null),s0=class extends u.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,r){return r.location!==n.location||r.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:r.error,location:r.location,revalidation:n.revalidation||r.revalidation}}componentDidCatch(n,r){this.props.onError?this.props.onError(n,r):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const d=Ib(n.digest);d&&(n=d)}let r=n!==void 0?u.createElement(na.Provider,{value:this.props.routeContext},u.createElement(qd.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?u.createElement(ly,{error:n},r):r}};s0.contextType=Yb;var yd=new WeakMap;function ly({children:n,error:r}){let{basename:d}=u.useContext(Vt);if(typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){let o=Fb(r.digest);if(o){let m=yd.get(r);if(m)throw m;let f=Fh(o.location,d);if(Jh&&!yd.get(r))if(f.isExternal||o.reloadDocument)window.location.href=f.absoluteURL||f.to;else{const h=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(f.to,{replace:o.replace}));throw yd.set(r,h),h}return u.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f.absoluteURL||f.to}`})}}return n}function iy({routeContext:n,match:r,children:d}){let o=u.useContext(Gn);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),u.createElement(na.Provider,{value:n},d)}function ry(n,r=[],d){let o=d==null?void 0:d.state;if(n==null){if(!o)return null;if(o.errors)n=o.matches;else if(r.length===0&&!o.initialized&&o.matches.length>0)n=o.matches;else return null}let m=n,f=o==null?void 0:o.errors;if(f!=null){let j=m.findIndex(y=>y.route.id&&(f==null?void 0:f[y.route.id])!==void 0);Ve(j>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),m=m.slice(0,Math.min(m.length,j+1))}let h=!1,b=-1;if(d&&o){h=o.renderFallback;for(let j=0;j<m.length;j++){let y=m[j];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(b=j),y.route.id){let{loaderData:w,errors:C}=o,k=y.route.loader&&!w.hasOwnProperty(y.route.id)&&(!C||C[y.route.id]===void 0);if(y.route.lazy||k){d.isStatic&&(h=!0),b>=0?m=m.slice(0,b+1):m=[m[0]];break}}}}let g=d==null?void 0:d.onError,p=o&&g?(j,y)=>{var w,C;g(j,{location:o.location,params:((C=(w=o.matches)==null?void 0:w[0])==null?void 0:C.params)??{},unstable_pattern:Kb(o.matches),errorInfo:y})}:void 0;return m.reduceRight((j,y,w)=>{let C,k=!1,N=null,S=null;o&&(C=f&&y.route.id?f[y.route.id]:void 0,N=y.route.errorElement||ny,h&&(b<0&&w===0?(n0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,S=null):b===w&&(k=!0,S=y.route.hydrateFallbackElement||null)));let z=r.concat(m.slice(0,w+1)),M=()=>{let O;return C?O=N:k?O=S:y.route.Component?O=u.createElement(y.route.Component,null):y.route.element?O=y.route.element:O=j,u.createElement(iy,{match:y,routeContext:{outlet:j,matches:z,isDataRoute:o!=null},children:O})};return o&&(y.route.ErrorBoundary||y.route.errorElement||w===0)?u.createElement(s0,{location:o.location,revalidation:o.revalidation,component:N,error:C,children:M(),routeContext:{outlet:null,matches:z,isDataRoute:!0},onError:p}):M()},null)}function Gd(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function cy(n){let r=u.useContext(Gn);return Ve(r,Gd(n)),r}function oy(n){let r=u.useContext(qr);return Ve(r,Gd(n)),r}function dy(n){let r=u.useContext(na);return Ve(r,Gd(n)),r}function Kd(n){let r=dy(n),d=r.matches[r.matches.length-1];return Ve(d.route.id,`${n} can only be used on routes that contain a unique "id"`),d.route.id}function uy(){return Kd("useRouteId")}function my(){var o;let n=u.useContext(qd),r=oy("useRouteError"),d=Kd("useRouteError");return n!==void 0?n:(o=r.errors)==null?void 0:o[d]}function xy(){let{router:n}=cy("useNavigate"),r=Kd("useNavigate"),d=u.useRef(!1);return t0(()=>{d.current=!0}),u.useCallback(async(m,f={})=>{sa(d.current,e0),d.current&&(typeof m=="number"?await n.navigate(m):await n.navigate(m,{fromRouteId:r,...f}))},[n,r])}var jh={};function n0(n,r,d){!r&&!jh[n]&&(jh[n]=!0,sa(!1,d))}u.memo(fy);function fy({routes:n,future:r,state:d,isStatic:o,onError:m}){return a0(n,void 0,{state:d,isStatic:o,onError:m})}function Nh({to:n,replace:r,state:d,relative:o}){Ve(Kn(),"<Navigate> may be used only in the context of a <Router> component.");let{static:m}=u.useContext(Vt);sa(!m,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:f}=u.useContext(na),{pathname:h}=da(),b=Rt(),g=Hr(n,Hd(f),h,o==="path"),p=JSON.stringify(g);return u.useEffect(()=>{b(JSON.parse(p),{replace:r,state:d,relative:o})},[b,p,o,r,d]),null}function hy(n){return ty(n.context)}function Ee(n){Ve(!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 py({basename:n="/",children:r=null,location:d,navigationType:o="POP",navigator:m,static:f=!1,unstable_useTransitions:h}){Ve(!Kn(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let b=n.replace(/^\/*/,"/"),g=u.useMemo(()=>({basename:b,navigator:m,static:f,unstable_useTransitions:h,future:{}}),[b,m,f,h]);typeof d=="string"&&(d=qn(d));let{pathname:p="/",search:j="",hash:y="",state:w=null,key:C="default",unstable_mask:k}=d,N=u.useMemo(()=>{let S=Ga(p,b);return S==null?null:{location:{pathname:S,search:j,hash:y,state:w,key:C,unstable_mask:k},navigationType:o}},[b,p,j,y,w,C,o,k]);return sa(N!=null,`<Router basename="${b}"> is not able to match the URL "${p}${j}${y}" because it does not start with the basename, so the <Router> won't render anything.`),N==null?null:u.createElement(Vt.Provider,{value:g},u.createElement(Wl.Provider,{children:r,value:N}))}function l0({children:n,location:r}){return ay(Td(n),r)}function Td(n,r=[]){let d=[];return u.Children.forEach(n,(o,m)=>{if(!u.isValidElement(o))return;let f=[...r,m];if(o.type===u.Fragment){d.push.apply(d,Td(o.props.children,f));return}Ve(o.type===Ee,`[${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>`),Ve(!o.props.index||!o.props.children,"An index route cannot have child routes.");let h={id:o.props.id||f.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(h.children=Td(o.props.children,f)),d.push(h)}),d}var Mr="get",Dr="application/x-www-form-urlencoded";function Gr(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function gy(n){return Gr(n)&&n.tagName.toLowerCase()==="button"}function by(n){return Gr(n)&&n.tagName.toLowerCase()==="form"}function yy(n){return Gr(n)&&n.tagName.toLowerCase()==="input"}function vy(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function jy(n,r){return n.button===0&&(!r||r==="_self")&&!vy(n)}function Rd(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((r,d)=>{let o=n[d];return r.concat(Array.isArray(o)?o.map(m=>[d,m]):[[d,o]])},[]))}function Ny(n,r){let d=Rd(n);return r&&r.forEach((o,m)=>{d.has(m)||r.getAll(m).forEach(f=>{d.append(m,f)})}),d}var Nr=null;function wy(){if(Nr===null)try{new FormData(document.createElement("form"),0),Nr=!1}catch{Nr=!0}return Nr}var Sy=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function vd(n){return n!=null&&!Sy.has(n)?(sa(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Dr}"`),null):n}function ky(n,r){let d,o,m,f,h;if(by(n)){let b=n.getAttribute("action");o=b?Ga(b,r):null,d=n.getAttribute("method")||Mr,m=vd(n.getAttribute("enctype"))||Dr,f=new FormData(n)}else if(gy(n)||yy(n)&&(n.type==="submit"||n.type==="image")){let b=n.form;if(b==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=n.getAttribute("formaction")||b.getAttribute("action");if(o=g?Ga(g,r):null,d=n.getAttribute("formmethod")||b.getAttribute("method")||Mr,m=vd(n.getAttribute("formenctype"))||vd(b.getAttribute("enctype"))||Dr,f=new FormData(b,n),!wy()){let{name:p,type:j,value:y}=n;if(j==="image"){let w=p?`${p}.`:"";f.append(`${w}x`,"0"),f.append(`${w}y`,"0")}else p&&f.append(p,y)}}else{if(Gr(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');d=Mr,o=null,m=Dr,h=n}return f&&m==="text/plain"&&(h=f,f=void 0),{action:o,method:d.toLowerCase(),encType:m,formData:f,body:h}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Vd(n,r){if(n===!1||n===null||typeof n>"u")throw new Error(r)}function zy(n,r,d,o){let m=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return d?m.pathname.endsWith("/")?m.pathname=`${m.pathname}_.${o}`:m.pathname=`${m.pathname}.${o}`:m.pathname==="/"?m.pathname=`_root.${o}`:r&&Ga(m.pathname,r)==="/"?m.pathname=`${r.replace(/\/$/,"")}/_root.${o}`:m.pathname=`${m.pathname.replace(/\/$/,"")}.${o}`,m}async function Cy(n,r){if(n.id in r)return r[n.id];try{let d=await import(n.module);return r[n.id]=d,d}catch(d){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(d),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Ay(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function Ey(n,r,d){let o=await Promise.all(n.map(async m=>{let f=r.routes[m.route.id];if(f){let h=await Cy(f,d);return h.links?h.links():[]}return[]}));return Dy(o.flat(1).filter(Ay).filter(m=>m.rel==="stylesheet"||m.rel==="preload").map(m=>m.rel==="stylesheet"?{...m,rel:"prefetch",as:"style"}:{...m,rel:"prefetch"}))}function wh(n,r,d,o,m,f){let h=(g,p)=>d[p]?g.route.id!==d[p].route.id:!0,b=(g,p)=>{var j;return d[p].pathname!==g.pathname||((j=d[p].route.path)==null?void 0:j.endsWith("*"))&&d[p].params["*"]!==g.params["*"]};return f==="assets"?r.filter((g,p)=>h(g,p)||b(g,p)):f==="data"?r.filter((g,p)=>{var y;let j=o.routes[g.route.id];if(!j||!j.hasLoader)return!1;if(h(g,p)||b(g,p))return!0;if(g.route.shouldRevalidate){let w=g.route.shouldRevalidate({currentUrl:new URL(m.pathname+m.search+m.hash,window.origin),currentParams:((y=d[0])==null?void 0:y.params)||{},nextUrl:new URL(n,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof w=="boolean")return w}return!0}):[]}function Ty(n,r,{includeHydrateFallback:d}={}){return Ry(n.map(o=>{let m=r.routes[o.route.id];if(!m)return[];let f=[m.module];return m.clientActionModule&&(f=f.concat(m.clientActionModule)),m.clientLoaderModule&&(f=f.concat(m.clientLoaderModule)),d&&m.hydrateFallbackModule&&(f=f.concat(m.hydrateFallbackModule)),m.imports&&(f=f.concat(m.imports)),f}).flat(1))}function Ry(n){return[...new Set(n)]}function My(n){let r={},d=Object.keys(n).sort();for(let o of d)r[o]=n[o];return r}function Dy(n,r){let d=new Set;return new Set(r),n.reduce((o,m)=>{let f=JSON.stringify(My(m));return d.has(f)||(d.add(f),o.push({key:f,link:m})),o},[])}function i0(){let n=u.useContext(Gn);return Vd(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function Oy(){let n=u.useContext(qr);return Vd(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var Yd=u.createContext(void 0);Yd.displayName="FrameworkContext";function r0(){let n=u.useContext(Yd);return Vd(n,"You must render this element inside a <HydratedRouter> element"),n}function Ly(n,r){let d=u.useContext(Yd),[o,m]=u.useState(!1),[f,h]=u.useState(!1),{onFocus:b,onBlur:g,onMouseEnter:p,onMouseLeave:j,onTouchStart:y}=r,w=u.useRef(null);u.useEffect(()=>{if(n==="render"&&h(!0),n==="viewport"){let N=z=>{z.forEach(M=>{h(M.isIntersecting)})},S=new IntersectionObserver(N,{threshold:.5});return w.current&&S.observe(w.current),()=>{S.disconnect()}}},[n]),u.useEffect(()=>{if(o){let N=setTimeout(()=>{h(!0)},100);return()=>{clearTimeout(N)}}},[o]);let C=()=>{m(!0)},k=()=>{m(!1),h(!1)};return d?n!=="intent"?[f,w,{}]:[f,w,{onFocus:Kl(b,C),onBlur:Kl(g,k),onMouseEnter:Kl(p,C),onMouseLeave:Kl(j,k),onTouchStart:Kl(y,C)}]:[!1,w,{}]}function Kl(n,r){return d=>{n&&n(d),d.defaultPrevented||r(d)}}function _y({page:n,...r}){let{router:d}=i0(),o=u.useMemo(()=>Xh(d.routes,n,d.basename),[d.routes,n,d.basename]);return o?u.createElement(By,{page:n,matches:o,...r}):null}function Uy(n){let{manifest:r,routeModules:d}=r0(),[o,m]=u.useState([]);return u.useEffect(()=>{let f=!1;return Ey(n,r,d).then(h=>{f||m(h)}),()=>{f=!0}},[n,r,d]),o}function By({page:n,matches:r,...d}){let o=da(),{future:m,manifest:f,routeModules:h}=r0(),{basename:b}=i0(),{loaderData:g,matches:p}=Oy(),j=u.useMemo(()=>wh(n,r,p,f,o,"data"),[n,r,p,f,o]),y=u.useMemo(()=>wh(n,r,p,f,o,"assets"),[n,r,p,f,o]),w=u.useMemo(()=>{if(n===o.pathname+o.search+o.hash)return[];let N=new Set,S=!1;if(r.forEach(M=>{var E;let O=f.routes[M.route.id];!O||!O.hasLoader||(!j.some(ae=>ae.route.id===M.route.id)&&M.route.id in g&&((E=h[M.route.id])!=null&&E.shouldRevalidate)||O.hasClientLoader?S=!0:N.add(M.route.id))}),N.size===0)return[];let z=zy(n,b,m.unstable_trailingSlashAwareDataRequests,"data");return S&&N.size>0&&z.searchParams.set("_routes",r.filter(M=>N.has(M.route.id)).map(M=>M.route.id).join(",")),[z.pathname+z.search]},[b,m.unstable_trailingSlashAwareDataRequests,g,o,f,j,r,n,h]),C=u.useMemo(()=>Ty(y,f),[y,f]),k=Uy(y);return u.createElement(u.Fragment,null,w.map(N=>u.createElement("link",{key:N,rel:"prefetch",as:"fetch",href:N,...d})),C.map(N=>u.createElement("link",{key:N,rel:"modulepreload",href:N,...d})),k.map(({key:N,link:S})=>u.createElement("link",{key:N,nonce:d.nonce,...S,crossOrigin:S.crossOrigin??d.crossOrigin})))}function $y(...n){return r=>{n.forEach(d=>{typeof d=="function"?d(r):d!=null&&(d.current=r)})}}var Hy=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Hy&&(window.__reactRouterVersion="7.13.2")}catch{}function qy({basename:n,children:r,unstable_useTransitions:d,window:o}){let m=u.useRef();m.current==null&&(m.current=bb({window:o,v5Compat:!0}));let f=m.current,[h,b]=u.useState({action:f.action,location:f.location}),g=u.useCallback(p=>{d===!1?b(p):u.startTransition(()=>b(p))},[d]);return u.useLayoutEffect(()=>f.listen(g),[f,g]),u.createElement(py,{basename:n,children:r,location:h.location,navigationType:h.action,navigator:f,unstable_useTransitions:d})}var c0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ha=u.forwardRef(function({onClick:r,discover:d="render",prefetch:o="none",relative:m,reloadDocument:f,replace:h,unstable_mask:b,state:g,target:p,to:j,preventScrollReset:y,viewTransition:w,unstable_defaultShouldRevalidate:C,...k},N){let{basename:S,navigator:z,unstable_useTransitions:M}=u.useContext(Vt),O=typeof j=="string"&&c0.test(j),E=Fh(j,S);j=E.to;let ae=Pb(j,{relative:m}),ce=da(),H=null;if(b){let he=Hr(b,[],ce.unstable_mask?ce.unstable_mask.pathname:"/",!0);S!=="/"&&(he.pathname=he.pathname==="/"?S:ha([S,he.pathname])),H=z.createHref(he)}let[G,P,W]=Ly(o,k),Q=Vy(j,{replace:h,unstable_mask:b,state:g,target:p,preventScrollReset:y,relative:m,viewTransition:w,unstable_defaultShouldRevalidate:C,unstable_useTransitions:M});function le(he){r&&r(he),he.defaultPrevented||Q(he)}let F=!(E.isExternal||f),re=u.createElement("a",{...k,...W,href:(F?H:void 0)||E.absoluteURL||ae,onClick:F?le:r,ref:$y(N,P),target:p,"data-discover":!O&&d==="render"?"true":void 0});return G&&!O?u.createElement(u.Fragment,null,re,u.createElement(_y,{page:ae})):re});Ha.displayName="Link";var Zl=u.forwardRef(function({"aria-current":r="page",caseSensitive:d=!1,className:o="",end:m=!1,style:f,to:h,viewTransition:b,children:g,...p},j){let y=ei(h,{relative:p.relative}),w=da(),C=u.useContext(qr),{navigator:k,basename:N}=u.useContext(Vt),S=C!=null&&Fy(y)&&b===!0,z=k.encodeLocation?k.encodeLocation(y).pathname:y.pathname,M=w.pathname,O=C&&C.navigation&&C.navigation.location?C.navigation.location.pathname:null;d||(M=M.toLowerCase(),O=O?O.toLowerCase():null,z=z.toLowerCase()),O&&N&&(O=Ga(O,N)||O);const E=z!=="/"&&z.endsWith("/")?z.length-1:z.length;let ae=M===z||!m&&M.startsWith(z)&&M.charAt(E)==="/",ce=O!=null&&(O===z||!m&&O.startsWith(z)&&O.charAt(z.length)==="/"),H={isActive:ae,isPending:ce,isTransitioning:S},G=ae?r:void 0,P;typeof o=="function"?P=o(H):P=[o,ae?"active":null,ce?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let W=typeof f=="function"?f(H):f;return u.createElement(Ha,{...p,"aria-current":G,className:P,ref:j,style:W,to:h,viewTransition:b},typeof g=="function"?g(H):g)});Zl.displayName="NavLink";var Gy=u.forwardRef(({discover:n="render",fetcherKey:r,navigate:d,reloadDocument:o,replace:m,state:f,method:h=Mr,action:b,onSubmit:g,relative:p,preventScrollReset:j,viewTransition:y,unstable_defaultShouldRevalidate:w,...C},k)=>{let{unstable_useTransitions:N}=u.useContext(Vt),S=Zy(),z=Jy(b,{relative:p}),M=h.toLowerCase()==="get"?"get":"post",O=typeof b=="string"&&c0.test(b),E=ae=>{if(g&&g(ae),ae.defaultPrevented)return;ae.preventDefault();let ce=ae.nativeEvent.submitter,H=(ce==null?void 0:ce.getAttribute("formmethod"))||h,G=()=>S(ce||ae.currentTarget,{fetcherKey:r,method:H,navigate:d,replace:m,state:f,relative:p,preventScrollReset:j,viewTransition:y,unstable_defaultShouldRevalidate:w});N&&d!==!1?u.startTransition(()=>G()):G()};return u.createElement("form",{ref:k,method:M,action:z,onSubmit:o?g:E,...C,"data-discover":!O&&n==="render"?"true":void 0})});Gy.displayName="Form";function Ky(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function o0(n){let r=u.useContext(Gn);return Ve(r,Ky(n)),r}function Vy(n,{target:r,replace:d,unstable_mask:o,state:m,preventScrollReset:f,relative:h,viewTransition:b,unstable_defaultShouldRevalidate:g,unstable_useTransitions:p}={}){let j=Rt(),y=da(),w=ei(n,{relative:h});return u.useCallback(C=>{if(jy(C,r)){C.preventDefault();let k=d!==void 0?d:Jl(y)===Jl(w),N=()=>j(n,{replace:k,unstable_mask:o,state:m,preventScrollReset:f,relative:h,viewTransition:b,unstable_defaultShouldRevalidate:g});p?u.startTransition(()=>N()):N()}},[y,j,w,d,o,m,r,n,f,h,b,g,p])}function Yy(n){sa(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let r=u.useRef(Rd(n)),d=u.useRef(!1),o=da(),m=u.useMemo(()=>Ny(o.search,d.current?null:r.current),[o.search]),f=Rt(),h=u.useCallback((b,g)=>{const p=Rd(typeof b=="function"?b(new URLSearchParams(m)):b);d.current=!0,f("?"+p,g)},[f,m]);return[m,h]}var Xy=0,Qy=()=>`__${String(++Xy)}__`;function Zy(){let{router:n}=o0("useSubmit"),{basename:r}=u.useContext(Vt),d=uy(),o=n.fetch,m=n.navigate;return u.useCallback(async(f,h={})=>{let{action:b,method:g,encType:p,formData:j,body:y}=ky(f,r);if(h.navigate===!1){let w=h.fetcherKey||Qy();await o(w,d,h.action||b,{unstable_defaultShouldRevalidate:h.unstable_defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:j,body:y,formMethod:h.method||g,formEncType:h.encType||p,flushSync:h.flushSync})}else await m(h.action||b,{unstable_defaultShouldRevalidate:h.unstable_defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:j,body:y,formMethod:h.method||g,formEncType:h.encType||p,replace:h.replace,state:h.state,fromRouteId:d,flushSync:h.flushSync,viewTransition:h.viewTransition})},[o,m,r,d])}function Jy(n,{relative:r}={}){let{basename:d}=u.useContext(Vt),o=u.useContext(na);Ve(o,"useFormAction must be used inside a RouteContext");let[m]=o.matches.slice(-1),f={...ei(n||".",{relative:r})},h=da();if(n==null){f.search=h.search;let b=new URLSearchParams(f.search),g=b.getAll("index");if(g.some(j=>j==="")){b.delete("index"),g.filter(y=>y).forEach(y=>b.append("index",y));let j=b.toString();f.search=j?`?${j}`:""}}return(!n||n===".")&&m.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),d!=="/"&&(f.pathname=f.pathname==="/"?d:ha([d,f.pathname])),Jl(f)}function Fy(n,{relative:r}={}){let d=u.useContext(Ph);Ve(d!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=o0("useViewTransitionState"),m=ei(n,{relative:r});if(!d.isTransitioning)return!1;let f=Ga(d.currentLocation.pathname,o)||d.currentLocation.pathname,h=Ga(d.nextLocation.pathname,o)||d.nextLocation.pathname;return Lr(m.pathname,h)!=null||Lr(m.pathname,f)!=null}/**
|
|
61
|
-
* @license lucide-react v0.468.0 - ISC
|
|
62
|
-
*
|
|
63
|
-
* This source code is licensed under the ISC license.
|
|
64
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
-
*/const Iy=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),d0=(...n)=>n.filter((r,d,o)=>!!r&&r.trim()!==""&&o.indexOf(r)===d).join(" ").trim();/**
|
|
66
|
-
* @license lucide-react v0.468.0 - ISC
|
|
67
|
-
*
|
|
68
|
-
* This source code is licensed under the ISC license.
|
|
69
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
-
*/var Py={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
71
|
-
* @license lucide-react v0.468.0 - ISC
|
|
72
|
-
*
|
|
73
|
-
* This source code is licensed under the ISC license.
|
|
74
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
-
*/const Wy=u.forwardRef(({color:n="currentColor",size:r=24,strokeWidth:d=2,absoluteStrokeWidth:o,className:m="",children:f,iconNode:h,...b},g)=>u.createElement("svg",{ref:g,...Py,width:r,height:r,stroke:n,strokeWidth:o?Number(d)*24/Number(r):d,className:d0("lucide",m),...b},[...h.map(([p,j])=>u.createElement(p,j)),...Array.isArray(f)?f:[f]]));/**
|
|
76
|
-
* @license lucide-react v0.468.0 - ISC
|
|
77
|
-
*
|
|
78
|
-
* This source code is licensed under the ISC license.
|
|
79
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
-
*/const te=(n,r)=>{const d=u.forwardRef(({className:o,...m},f)=>u.createElement(Wy,{ref:f,iconNode:r,className:d0(`lucide-${Iy(n)}`,o),...m}));return d.displayName=`${n}`,d};/**
|
|
81
|
-
* @license lucide-react v0.468.0 - ISC
|
|
82
|
-
*
|
|
83
|
-
* This source code is licensed under the ISC license.
|
|
84
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
-
*/const Kt=te("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
|
|
86
|
-
* @license lucide-react v0.468.0 - ISC
|
|
87
|
-
*
|
|
88
|
-
* This source code is licensed under the ISC license.
|
|
89
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
-
*/const Hn=te("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
91
|
-
* @license lucide-react v0.468.0 - ISC
|
|
92
|
-
*
|
|
93
|
-
* This source code is licensed under the ISC license.
|
|
94
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
-
*/const u0=te("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
96
|
-
* @license lucide-react v0.468.0 - ISC
|
|
97
|
-
*
|
|
98
|
-
* This source code is licensed under the ISC license.
|
|
99
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
-
*/const ev=te("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/**
|
|
101
|
-
* @license lucide-react v0.468.0 - ISC
|
|
102
|
-
*
|
|
103
|
-
* This source code is licensed under the ISC license.
|
|
104
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
-
*/const Ka=te("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
|
|
106
|
-
* @license lucide-react v0.468.0 - ISC
|
|
107
|
-
*
|
|
108
|
-
* This source code is licensed under the ISC license.
|
|
109
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
-
*/const Ks=te("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
|
|
111
|
-
* @license lucide-react v0.468.0 - ISC
|
|
112
|
-
*
|
|
113
|
-
* This source code is licensed under the ISC license.
|
|
114
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
-
*/const tv=te("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);/**
|
|
116
|
-
* @license lucide-react v0.468.0 - ISC
|
|
117
|
-
*
|
|
118
|
-
* This source code is licensed under the ISC license.
|
|
119
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
-
*/const m0=te("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);/**
|
|
121
|
-
* @license lucide-react v0.468.0 - ISC
|
|
122
|
-
*
|
|
123
|
-
* This source code is licensed under the ISC license.
|
|
124
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
-
*/const Xd=te("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
|
|
126
|
-
* @license lucide-react v0.468.0 - ISC
|
|
127
|
-
*
|
|
128
|
-
* This source code is licensed under the ISC license.
|
|
129
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
-
*/const av=te("Calculator",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["line",{x1:"8",x2:"16",y1:"6",y2:"6",key:"x4nwl0"}],["line",{x1:"16",x2:"16",y1:"14",y2:"18",key:"wjye3r"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M8 18h.01",key:"lrp35t"}]]);/**
|
|
131
|
-
* @license lucide-react v0.468.0 - ISC
|
|
132
|
-
*
|
|
133
|
-
* This source code is licensed under the ISC license.
|
|
134
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
-
*/const sv=te("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
|
|
136
|
-
* @license lucide-react v0.468.0 - ISC
|
|
137
|
-
*
|
|
138
|
-
* This source code is licensed under the ISC license.
|
|
139
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
-
*/const ga=te("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
|
|
141
|
-
* @license lucide-react v0.468.0 - ISC
|
|
142
|
-
*
|
|
143
|
-
* This source code is licensed under the ISC license.
|
|
144
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
-
*/const ht=te("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
146
|
-
* @license lucide-react v0.468.0 - ISC
|
|
147
|
-
*
|
|
148
|
-
* This source code is licensed under the ISC license.
|
|
149
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
-
*/const Va=te("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
151
|
-
* @license lucide-react v0.468.0 - ISC
|
|
152
|
-
*
|
|
153
|
-
* This source code is licensed under the ISC license.
|
|
154
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
-
*/const Sh=te("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
156
|
-
* @license lucide-react v0.468.0 - ISC
|
|
157
|
-
*
|
|
158
|
-
* This source code is licensed under the ISC license.
|
|
159
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
-
*/const aa=te("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
161
|
-
* @license lucide-react v0.468.0 - ISC
|
|
162
|
-
*
|
|
163
|
-
* This source code is licensed under the ISC license.
|
|
164
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
-
*/const Fl=te("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
166
|
-
* @license lucide-react v0.468.0 - ISC
|
|
167
|
-
*
|
|
168
|
-
* This source code is licensed under the ISC license.
|
|
169
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
-
*/const _r=te("CircleArrowRight",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"m12 16 4-4-4-4",key:"1i9zcv"}]]);/**
|
|
171
|
-
* @license lucide-react v0.468.0 - ISC
|
|
172
|
-
*
|
|
173
|
-
* This source code is licensed under the ISC license.
|
|
174
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
-
*/const ct=te("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
176
|
-
* @license lucide-react v0.468.0 - ISC
|
|
177
|
-
*
|
|
178
|
-
* This source code is licensed under the ISC license.
|
|
179
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
-
*/const Kr=te("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
181
|
-
* @license lucide-react v0.468.0 - ISC
|
|
182
|
-
*
|
|
183
|
-
* This source code is licensed under the ISC license.
|
|
184
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
-
*/const nv=te("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/**
|
|
186
|
-
* @license lucide-react v0.468.0 - ISC
|
|
187
|
-
*
|
|
188
|
-
* This source code is licensed under the ISC license.
|
|
189
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
-
*/const x0=te("CircleStop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]);/**
|
|
191
|
-
* @license lucide-react v0.468.0 - ISC
|
|
192
|
-
*
|
|
193
|
-
* This source code is licensed under the ISC license.
|
|
194
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
-
*/const wt=te("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
196
|
-
* @license lucide-react v0.468.0 - ISC
|
|
197
|
-
*
|
|
198
|
-
* This source code is licensed under the ISC license.
|
|
199
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
-
*/const jd=te("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
201
|
-
* @license lucide-react v0.468.0 - ISC
|
|
202
|
-
*
|
|
203
|
-
* This source code is licensed under the ISC license.
|
|
204
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
-
*/const lv=te("ClipboardList",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/**
|
|
206
|
-
* @license lucide-react v0.468.0 - ISC
|
|
207
|
-
*
|
|
208
|
-
* This source code is licensed under the ISC license.
|
|
209
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
-
*/const Ys=te("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
211
|
-
* @license lucide-react v0.468.0 - ISC
|
|
212
|
-
*
|
|
213
|
-
* This source code is licensed under the ISC license.
|
|
214
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
-
*/const iv=te("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
|
|
216
|
-
* @license lucide-react v0.468.0 - ISC
|
|
217
|
-
*
|
|
218
|
-
* This source code is licensed under the ISC license.
|
|
219
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
-
*/const rv=te("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
|
|
221
|
-
* @license lucide-react v0.468.0 - ISC
|
|
222
|
-
*
|
|
223
|
-
* This source code is licensed under the ISC license.
|
|
224
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
-
*/const f0=te("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
|
|
226
|
-
* @license lucide-react v0.468.0 - ISC
|
|
227
|
-
*
|
|
228
|
-
* This source code is licensed under the ISC license.
|
|
229
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
-
*/const ya=te("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/**
|
|
231
|
-
* @license lucide-react v0.468.0 - ISC
|
|
232
|
-
*
|
|
233
|
-
* This source code is licensed under the ISC license.
|
|
234
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
-
*/const Ur=te("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
236
|
-
* @license lucide-react v0.468.0 - ISC
|
|
237
|
-
*
|
|
238
|
-
* This source code is licensed under the ISC license.
|
|
239
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
-
*/const $n=te("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
|
241
|
-
* @license lucide-react v0.468.0 - ISC
|
|
242
|
-
*
|
|
243
|
-
* This source code is licensed under the ISC license.
|
|
244
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
-
*/const Qd=te("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
246
|
-
* @license lucide-react v0.468.0 - ISC
|
|
247
|
-
*
|
|
248
|
-
* This source code is licensed under the ISC license.
|
|
249
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
-
*/const Vr=te("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
251
|
-
* @license lucide-react v0.468.0 - ISC
|
|
252
|
-
*
|
|
253
|
-
* This source code is licensed under the ISC license.
|
|
254
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
-
*/const Zs=te("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
256
|
-
* @license lucide-react v0.468.0 - ISC
|
|
257
|
-
*
|
|
258
|
-
* This source code is licensed under the ISC license.
|
|
259
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
-
*/const h0=te("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
|
261
|
-
* @license lucide-react v0.468.0 - ISC
|
|
262
|
-
*
|
|
263
|
-
* This source code is licensed under the ISC license.
|
|
264
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
-
*/const kh=te("Flag",[["path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",key:"i9b6wo"}],["line",{x1:"4",x2:"4",y1:"22",y2:"15",key:"1cm3nv"}]]);/**
|
|
266
|
-
* @license lucide-react v0.468.0 - ISC
|
|
267
|
-
*
|
|
268
|
-
* This source code is licensed under the ISC license.
|
|
269
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
-
*/const Nd=te("FlaskConical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]);/**
|
|
271
|
-
* @license lucide-react v0.468.0 - ISC
|
|
272
|
-
*
|
|
273
|
-
* This source code is licensed under the ISC license.
|
|
274
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
-
*/const cv=te("FolderSearch",[["path",{d:"M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1",key:"1bw5m7"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}]]);/**
|
|
276
|
-
* @license lucide-react v0.468.0 - ISC
|
|
277
|
-
*
|
|
278
|
-
* This source code is licensed under the ISC license.
|
|
279
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
-
*/const Br=te("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
|
|
281
|
-
* @license lucide-react v0.468.0 - ISC
|
|
282
|
-
*
|
|
283
|
-
* This source code is licensed under the ISC license.
|
|
284
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
285
|
-
*/const Zd=te("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
|
|
286
|
-
* @license lucide-react v0.468.0 - ISC
|
|
287
|
-
*
|
|
288
|
-
* This source code is licensed under the ISC license.
|
|
289
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
290
|
-
*/const zh=te("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
|
|
291
|
-
* @license lucide-react v0.468.0 - ISC
|
|
292
|
-
*
|
|
293
|
-
* This source code is licensed under the ISC license.
|
|
294
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
295
|
-
*/const ov=te("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/**
|
|
296
|
-
* @license lucide-react v0.468.0 - ISC
|
|
297
|
-
*
|
|
298
|
-
* This source code is licensed under the ISC license.
|
|
299
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
300
|
-
*/const ti=te("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
|
|
301
|
-
* @license lucide-react v0.468.0 - ISC
|
|
302
|
-
*
|
|
303
|
-
* This source code is licensed under the ISC license.
|
|
304
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
305
|
-
*/const dv=te("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/**
|
|
306
|
-
* @license lucide-react v0.468.0 - ISC
|
|
307
|
-
*
|
|
308
|
-
* This source code is licensed under the ISC license.
|
|
309
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
310
|
-
*/const Jd=te("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
|
|
311
|
-
* @license lucide-react v0.468.0 - ISC
|
|
312
|
-
*
|
|
313
|
-
* This source code is licensed under the ISC license.
|
|
314
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
315
|
-
*/const Md=te("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
|
|
316
|
-
* @license lucide-react v0.468.0 - ISC
|
|
317
|
-
*
|
|
318
|
-
* This source code is licensed under the ISC license.
|
|
319
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
320
|
-
*/const ot=te("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
321
|
-
* @license lucide-react v0.468.0 - ISC
|
|
322
|
-
*
|
|
323
|
-
* This source code is licensed under the ISC license.
|
|
324
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
325
|
-
*/const uv=te("LockOpen",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]]);/**
|
|
326
|
-
* @license lucide-react v0.468.0 - ISC
|
|
327
|
-
*
|
|
328
|
-
* This source code is licensed under the ISC license.
|
|
329
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
330
|
-
*/const Dd=te("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
|
|
331
|
-
* @license lucide-react v0.468.0 - ISC
|
|
332
|
-
*
|
|
333
|
-
* This source code is licensed under the ISC license.
|
|
334
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
335
|
-
*/const mv=te("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/**
|
|
336
|
-
* @license lucide-react v0.468.0 - ISC
|
|
337
|
-
*
|
|
338
|
-
* This source code is licensed under the ISC license.
|
|
339
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
340
|
-
*/const xv=te("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
|
|
341
|
-
* @license lucide-react v0.468.0 - ISC
|
|
342
|
-
*
|
|
343
|
-
* This source code is licensed under the ISC license.
|
|
344
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
345
|
-
*/const fv=te("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
|
|
346
|
-
* @license lucide-react v0.468.0 - ISC
|
|
347
|
-
*
|
|
348
|
-
* This source code is licensed under the ISC license.
|
|
349
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
350
|
-
*/const js=te("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
|
|
351
|
-
* @license lucide-react v0.468.0 - ISC
|
|
352
|
-
*
|
|
353
|
-
* This source code is licensed under the ISC license.
|
|
354
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
355
|
-
*/const hv=te("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
|
|
356
|
-
* @license lucide-react v0.468.0 - ISC
|
|
357
|
-
*
|
|
358
|
-
* This source code is licensed under the ISC license.
|
|
359
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
360
|
-
*/const pv=te("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
|
|
361
|
-
* @license lucide-react v0.468.0 - ISC
|
|
362
|
-
*
|
|
363
|
-
* This source code is licensed under the ISC license.
|
|
364
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
365
|
-
*/const gv=te("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);/**
|
|
366
|
-
* @license lucide-react v0.468.0 - ISC
|
|
367
|
-
*
|
|
368
|
-
* This source code is licensed under the ISC license.
|
|
369
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
370
|
-
*/const bv=te("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
|
|
371
|
-
* @license lucide-react v0.468.0 - ISC
|
|
372
|
-
*
|
|
373
|
-
* This source code is licensed under the ISC license.
|
|
374
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
375
|
-
*/const Yr=te("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
|
|
376
|
-
* @license lucide-react v0.468.0 - ISC
|
|
377
|
-
*
|
|
378
|
-
* This source code is licensed under the ISC license.
|
|
379
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
380
|
-
*/const yv=te("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/**
|
|
381
|
-
* @license lucide-react v0.468.0 - ISC
|
|
382
|
-
*
|
|
383
|
-
* This source code is licensed under the ISC license.
|
|
384
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
385
|
-
*/const Fd=te("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
386
|
-
* @license lucide-react v0.468.0 - ISC
|
|
387
|
-
*
|
|
388
|
-
* This source code is licensed under the ISC license.
|
|
389
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
390
|
-
*/const jt=te("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
391
|
-
* @license lucide-react v0.468.0 - ISC
|
|
392
|
-
*
|
|
393
|
-
* This source code is licensed under the ISC license.
|
|
394
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
395
|
-
*/const pt=te("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
396
|
-
* @license lucide-react v0.468.0 - ISC
|
|
397
|
-
*
|
|
398
|
-
* This source code is licensed under the ISC license.
|
|
399
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
400
|
-
*/const Xr=te("Puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]);/**
|
|
401
|
-
* @license lucide-react v0.468.0 - ISC
|
|
402
|
-
*
|
|
403
|
-
* This source code is licensed under the ISC license.
|
|
404
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
405
|
-
*/const p0=te("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);/**
|
|
406
|
-
* @license lucide-react v0.468.0 - ISC
|
|
407
|
-
*
|
|
408
|
-
* This source code is licensed under the ISC license.
|
|
409
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
410
|
-
*/const Yt=te("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
411
|
-
* @license lucide-react v0.468.0 - ISC
|
|
412
|
-
*
|
|
413
|
-
* This source code is licensed under the ISC license.
|
|
414
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
415
|
-
*/const g0=te("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
|
416
|
-
* @license lucide-react v0.468.0 - ISC
|
|
417
|
-
*
|
|
418
|
-
* This source code is licensed under the ISC license.
|
|
419
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
420
|
-
*/const Qr=te("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
|
|
421
|
-
* @license lucide-react v0.468.0 - ISC
|
|
422
|
-
*
|
|
423
|
-
* This source code is licensed under the ISC license.
|
|
424
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
425
|
-
*/const Js=te("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
426
|
-
* @license lucide-react v0.468.0 - ISC
|
|
427
|
-
*
|
|
428
|
-
* This source code is licensed under the ISC license.
|
|
429
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
430
|
-
*/const b0=te("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
|
|
431
|
-
* @license lucide-react v0.468.0 - ISC
|
|
432
|
-
*
|
|
433
|
-
* This source code is licensed under the ISC license.
|
|
434
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
435
|
-
*/const Id=te("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
|
|
436
|
-
* @license lucide-react v0.468.0 - ISC
|
|
437
|
-
*
|
|
438
|
-
* This source code is licensed under the ISC license.
|
|
439
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
440
|
-
*/const Yn=te("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
441
|
-
* @license lucide-react v0.468.0 - ISC
|
|
442
|
-
*
|
|
443
|
-
* This source code is licensed under the ISC license.
|
|
444
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
445
|
-
*/const ba=te("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
|
|
446
|
-
* @license lucide-react v0.468.0 - ISC
|
|
447
|
-
*
|
|
448
|
-
* This source code is licensed under the ISC license.
|
|
449
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
450
|
-
*/const Pd=te("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
451
|
-
* @license lucide-react v0.468.0 - ISC
|
|
452
|
-
*
|
|
453
|
-
* This source code is licensed under the ISC license.
|
|
454
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
455
|
-
*/const Ns=te("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
|
|
456
|
-
* @license lucide-react v0.468.0 - ISC
|
|
457
|
-
*
|
|
458
|
-
* This source code is licensed under the ISC license.
|
|
459
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
460
|
-
*/const vv=te("SkipBack",[["polygon",{points:"19 20 9 12 19 4 19 20",key:"o2sva"}],["line",{x1:"5",x2:"5",y1:"19",y2:"5",key:"1ocqjk"}]]);/**
|
|
461
|
-
* @license lucide-react v0.468.0 - ISC
|
|
462
|
-
*
|
|
463
|
-
* This source code is licensed under the ISC license.
|
|
464
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
465
|
-
*/const jv=te("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);/**
|
|
466
|
-
* @license lucide-react v0.468.0 - ISC
|
|
467
|
-
*
|
|
468
|
-
* This source code is licensed under the ISC license.
|
|
469
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
470
|
-
*/const Nv=te("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
471
|
-
* @license lucide-react v0.468.0 - ISC
|
|
472
|
-
*
|
|
473
|
-
* This source code is licensed under the ISC license.
|
|
474
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
475
|
-
*/const wv=te("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
|
|
476
|
-
* @license lucide-react v0.468.0 - ISC
|
|
477
|
-
*
|
|
478
|
-
* This source code is licensed under the ISC license.
|
|
479
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
480
|
-
*/const Xs=te("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
|
|
481
|
-
* @license lucide-react v0.468.0 - ISC
|
|
482
|
-
*
|
|
483
|
-
* This source code is licensed under the ISC license.
|
|
484
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
485
|
-
*/const y0=te("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
486
|
-
* @license lucide-react v0.468.0 - ISC
|
|
487
|
-
*
|
|
488
|
-
* This source code is licensed under the ISC license.
|
|
489
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
490
|
-
*/const Il=te("TestTube",[["path",{d:"M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5c-1.4 0-2.5-1.1-2.5-2.5V2",key:"125lnx"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M14.5 16h-5",key:"1ox875"}]]);/**
|
|
491
|
-
* @license lucide-react v0.468.0 - ISC
|
|
492
|
-
*
|
|
493
|
-
* This source code is licensed under the ISC license.
|
|
494
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
495
|
-
*/const Od=te("ThumbsDown",[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]]);/**
|
|
496
|
-
* @license lucide-react v0.468.0 - ISC
|
|
497
|
-
*
|
|
498
|
-
* This source code is licensed under the ISC license.
|
|
499
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
500
|
-
*/const Pl=te("ThumbsUp",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]]);/**
|
|
501
|
-
* @license lucide-react v0.468.0 - ISC
|
|
502
|
-
*
|
|
503
|
-
* This source code is licensed under the ISC license.
|
|
504
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
505
|
-
*/const Sv=te("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/**
|
|
506
|
-
* @license lucide-react v0.468.0 - ISC
|
|
507
|
-
*
|
|
508
|
-
* This source code is licensed under the ISC license.
|
|
509
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
510
|
-
*/const kv=te("ToggleLeft",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"6",ry:"6",key:"f2vt7d"}],["circle",{cx:"8",cy:"12",r:"2",key:"1nvbw3"}]]);/**
|
|
511
|
-
* @license lucide-react v0.468.0 - ISC
|
|
512
|
-
*
|
|
513
|
-
* This source code is licensed under the ISC license.
|
|
514
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
515
|
-
*/const zv=te("ToggleRight",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"6",ry:"6",key:"f2vt7d"}],["circle",{cx:"16",cy:"12",r:"2",key:"4ma0v8"}]]);/**
|
|
516
|
-
* @license lucide-react v0.468.0 - ISC
|
|
517
|
-
*
|
|
518
|
-
* This source code is licensed under the ISC license.
|
|
519
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
520
|
-
*/const Mt=te("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
521
|
-
* @license lucide-react v0.468.0 - ISC
|
|
522
|
-
*
|
|
523
|
-
* This source code is licensed under the ISC license.
|
|
524
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
525
|
-
*/const Cv=te("TrendingDown",[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]]);/**
|
|
526
|
-
* @license lucide-react v0.468.0 - ISC
|
|
527
|
-
*
|
|
528
|
-
* This source code is licensed under the ISC license.
|
|
529
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
530
|
-
*/const Wd=te("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
|
|
531
|
-
* @license lucide-react v0.468.0 - ISC
|
|
532
|
-
*
|
|
533
|
-
* This source code is licensed under the ISC license.
|
|
534
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
535
|
-
*/const lt=te("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
536
|
-
* @license lucide-react v0.468.0 - ISC
|
|
537
|
-
*
|
|
538
|
-
* This source code is licensed under the ISC license.
|
|
539
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
540
|
-
*/const Bn=te("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);/**
|
|
541
|
-
* @license lucide-react v0.468.0 - ISC
|
|
542
|
-
*
|
|
543
|
-
* This source code is licensed under the ISC license.
|
|
544
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
545
|
-
*/const Av=te("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/**
|
|
546
|
-
* @license lucide-react v0.468.0 - ISC
|
|
547
|
-
*
|
|
548
|
-
* This source code is licensed under the ISC license.
|
|
549
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
550
|
-
*/const Xn=te("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
|
|
551
|
-
* @license lucide-react v0.468.0 - ISC
|
|
552
|
-
*
|
|
553
|
-
* This source code is licensed under the ISC license.
|
|
554
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
555
|
-
*/const Ev=te("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
556
|
-
* @license lucide-react v0.468.0 - ISC
|
|
557
|
-
*
|
|
558
|
-
* This source code is licensed under the ISC license.
|
|
559
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
560
|
-
*/const Tv=te("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);/**
|
|
561
|
-
* @license lucide-react v0.468.0 - ISC
|
|
562
|
-
*
|
|
563
|
-
* This source code is licensed under the ISC license.
|
|
564
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
565
|
-
*/const Qn=te("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
|
|
566
|
-
* @license lucide-react v0.468.0 - ISC
|
|
567
|
-
*
|
|
568
|
-
* This source code is licensed under the ISC license.
|
|
569
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
570
|
-
*/const Je=te("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
571
|
-
* @license lucide-react v0.468.0 - ISC
|
|
572
|
-
*
|
|
573
|
-
* This source code is licensed under the ISC license.
|
|
574
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
575
|
-
*/const qa=te("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),Ld={en:"English",fr:"Français",es:"Español",de:"Deutsch",pt:"Português",ja:"日本語",zh:"中文",ko:"한국어",ar:"العربية",ru:"Русский",it:"Italiano",nl:"Nederlands"},Rv=["ar"],Mv=Object.keys(Ld);function _d(n){return Mv.includes(n)}function Dv(n){if(!n)return"en";const r=n.toLowerCase();if(_d(r))return r;const d=r.split("-")[0];return _d(d)?d:"en"}const Ch={en:{"nav.missions":"Missions","nav.chat":"Chat","nav.history":"History","nav.dashboard":"Dashboard","nav.agents":"Agents","nav.workflows":"Workflows","nav.skills":"Skills","nav.runs":"Runs","nav.approvals":"Approvals","nav.handoffs":"Handoffs","nav.apiKeys":"API Keys","nav.settings":"Settings","nav.users":"Users","nav.prompts":"Prompts","dashboard.title":"Dashboard","dashboard.activeAgents":"Active Agents","dashboard.runningTasks":"Running Tasks","dashboard.costToday":"Cost Today","dashboard.skillsInstalled":"Skills Installed","dashboard.recentActivity":"Recent Activity","dashboard.quickActions":"Quick Actions","dashboard.systemHealth":"System Health","dashboard.createAgent":"Create Agent","dashboard.runWorkflow":"Run Workflow","dashboard.installSkill":"Install Skill","agents.title":"Agents","agents.create":"Create Agent","agents.empty":"No agents configured yet.","agents.emptyDesc":"Create your first AI agent to get started with automated tasks.","agent.overview":"Overview","agent.runs":"Runs","agent.events":"Events","agent.configuration":"Configuration","agent.budget":"Budget","agent.recentRuns":"Recent Runs","agent.delete":"Delete Agent","agent.start":"Start","agent.stop":"Stop","agent.run":"Run","workflows.title":"Workflows","workflows.create":"Create Workflow","workflows.empty":"No workflows defined yet.","workflows.emptyDesc":"Design your first workflow to orchestrate multiple agents.","workflows.nodes":"{count} nodes","workflows.edit":"Edit","workflow.editor":"Workflow Editor","workflow.addNode":"Add Node","workflow.save":"Save","workflow.run":"Run Workflow","skills.title":"Skills","skills.install":"Install Skill","skills.empty":"No skills installed yet.","skills.emptyDesc":"Browse and install skills to extend your agents' capabilities.","skills.scan":"Scan Directory","skills.source":"Source URL or path","runs.title":"Runs","runs.empty":"No runs recorded yet.","runs.emptyDesc":"Run an agent or workflow to see execution history.","runs.filter":"Filter","run.events":"Events","run.output":"Output","run.cost":"Cost Breakdown","run.duration":"Duration","approvals.title":"Approval Queue","approvals.empty":"No pending approvals.","approvals.emptyDesc":"All clear. Dangerous actions will appear here for review.","approvals.approve":"Approve","approvals.deny":"Deny","approvals.pending":"Pending","nav.analytics":"Analytics","nav.budget":"Budget","nav.traces":"Traces","nav.memory":"Memory","nav.goals":"Goals","nav.plans":"Plans","nav.guardrails":"Guardrails","analytics.title":"Cost Analytics","analytics.description":"Track spending, token usage, and budget utilization across agents.","analytics.totalSpend":"Total Spend","analytics.totalRuns":"Total Runs","analytics.avgCostPerRun":"Avg Cost/Run","analytics.monthlyEstimate":"Monthly Estimate","analytics.dailyCosts":"Daily Costs (30 days)","analytics.agentBreakdown":"Cost by Agent","analytics.modelBreakdown":"Cost by Model","analytics.budgetUtilization":"Budget Utilization","analytics.runs":"Runs","analytics.totalCost":"Total Cost","analytics.avgCost":"Avg Cost","analytics.model":"Model","analytics.tokens":"Tokens","analytics.cost":"Cost","analytics.noAgentData":"No agent cost data yet.","analytics.noModelData":"No model cost data yet.","settings.title":"Settings","settings.general":"General","settings.security":"Security","settings.llm":"LLM","settings.budget":"Budget","settings.save":"Save Changes","settings.saved":"Settings saved successfully.","settings.language":"Language","common.loading":"Loading...","common.error":"An error occurred.","common.retry":"Retry","common.cancel":"Cancel","common.save":"Save","common.delete":"Delete","common.close":"Close","common.search":"Search...","common.noResults":"No results found.","common.name":"Name","common.description":"Description","common.status":"Status","common.type":"Type","common.actions":"Actions","common.created":"Created","common.updated":"Updated","status.running":"Running","status.completed":"Completed","status.failed":"Failed","status.pending":"Pending","status.paused":"Paused","status.cancelled":"Cancelled","status.idle":"Idle","trust.builtin":"Built-in","trust.official":"Official","trust.trusted":"Trusted","trust.community":"Community","trust.local":"Local"},fr:{"nav.missions":"Missions","nav.chat":"Chat","nav.history":"Historique","nav.dashboard":"Tableau de bord","nav.agents":"Agents","nav.workflows":"Workflows","nav.skills":"Compétences","nav.runs":"Exécutions","nav.approvals":"Approbations","nav.handoffs":"Transferts","nav.apiKeys":"Clés API","nav.settings":"Paramètres","nav.users":"Utilisateurs","nav.prompts":"Prompts","dashboard.title":"Tableau de bord","dashboard.activeAgents":"Agents actifs","dashboard.runningTasks":"Tâches en cours","dashboard.costToday":"Coût aujourd'hui","dashboard.skillsInstalled":"Compétences installées","dashboard.recentActivity":"Activité récente","dashboard.quickActions":"Actions rapides","dashboard.systemHealth":"Santé système","dashboard.createAgent":"Créer un agent","dashboard.runWorkflow":"Lancer un workflow","dashboard.installSkill":"Installer une compétence","agents.title":"Agents","agents.create":"Créer un agent","agents.empty":"Aucun agent configuré.","agents.emptyDesc":"Créez votre premier agent IA pour automatiser vos tâches.","agent.overview":"Aperçu","agent.runs":"Exécutions","agent.events":"Événements","agent.configuration":"Configuration","agent.budget":"Budget","agent.recentRuns":"Exécutions récentes","agent.delete":"Supprimer l'agent","agent.start":"Démarrer","agent.stop":"Arrêter","agent.run":"Exécuter","workflows.title":"Workflows","workflows.create":"Créer un workflow","workflows.empty":"Aucun workflow défini.","workflows.emptyDesc":"Concevez votre premier workflow pour orchestrer vos agents.","workflows.nodes":"{count} nœuds","workflows.edit":"Modifier","workflow.editor":"Éditeur de workflow","workflow.addNode":"Ajouter un nœud","workflow.save":"Enregistrer","workflow.run":"Lancer le workflow","skills.title":"Compétences","skills.install":"Installer","skills.empty":"Aucune compétence installée.","skills.emptyDesc":"Parcourez et installez des compétences pour étendre les capacités de vos agents.","skills.scan":"Scanner un répertoire","skills.source":"URL ou chemin source","runs.title":"Exécutions","runs.empty":"Aucune exécution enregistrée.","runs.emptyDesc":"Lancez un agent ou un workflow pour voir l'historique.","runs.filter":"Filtrer","run.events":"Événements","run.output":"Sortie","run.cost":"Détail des coûts","run.duration":"Durée","approvals.title":"File d'approbation","approvals.empty":"Aucune approbation en attente.","approvals.emptyDesc":"Tout est clair. Les actions dangereuses apparaîtront ici.","approvals.approve":"Approuver","approvals.deny":"Refuser","approvals.pending":"En attente","nav.analytics":"Analytique","nav.budget":"Budget","nav.traces":"Traces","nav.memory":"Mémoire","nav.goals":"Objectifs","nav.plans":"Plans","nav.guardrails":"Garde-fous","analytics.title":"Analytique des coûts","analytics.description":"Suivez les dépenses, l'utilisation des tokens et le budget par agent.","analytics.totalSpend":"Dépense totale","analytics.totalRuns":"Total exécutions","analytics.avgCostPerRun":"Coût moyen/exéc.","analytics.monthlyEstimate":"Estimation mensuelle","analytics.dailyCosts":"Coûts quotidiens (30 jours)","analytics.agentBreakdown":"Coûts par agent","analytics.modelBreakdown":"Coûts par modèle","analytics.budgetUtilization":"Utilisation du budget","analytics.runs":"Exécutions","analytics.totalCost":"Coût total","analytics.avgCost":"Coût moyen","analytics.model":"Modèle","analytics.tokens":"Tokens","analytics.cost":"Coût","analytics.noAgentData":"Aucune donnée de coût par agent.","analytics.noModelData":"Aucune donnée de coût par modèle.","settings.title":"Paramètres","settings.general":"Général","settings.security":"Sécurité","settings.llm":"LLM","settings.budget":"Budget","settings.save":"Enregistrer","settings.saved":"Paramètres sauvegardés.","settings.language":"Langue","common.loading":"Chargement...","common.error":"Une erreur est survenue.","common.retry":"Réessayer","common.cancel":"Annuler","common.save":"Enregistrer","common.delete":"Supprimer","common.close":"Fermer","common.search":"Rechercher...","common.noResults":"Aucun résultat.","common.name":"Nom","common.description":"Description","common.status":"Statut","common.type":"Type","common.actions":"Actions","common.created":"Créé","common.updated":"Mis à jour","status.running":"En cours","status.completed":"Terminé","status.failed":"Échoué","status.pending":"En attente","status.paused":"En pause","status.cancelled":"Annulé","status.idle":"Inactif","trust.builtin":"Intégré","trust.official":"Officiel","trust.trusted":"Vérifié","trust.community":"Communautaire","trust.local":"Local"},es:{"nav.dashboard":"Panel","nav.agents":"Agentes","nav.workflows":"Flujos de trabajo","nav.skills":"Habilidades","nav.runs":"Ejecuciones","nav.approvals":"Aprobaciones","nav.handoffs":"Transferencias","nav.apiKeys":"Claves API","nav.settings":"Configuración","nav.users":"Usuarios","nav.prompts":"Prompts","dashboard.title":"Panel","dashboard.activeAgents":"Agentes activos","dashboard.runningTasks":"Tareas en ejecución","dashboard.costToday":"Coste hoy","dashboard.skillsInstalled":"Habilidades instaladas","dashboard.recentActivity":"Actividad reciente","dashboard.quickActions":"Acciones rápidas","dashboard.systemHealth":"Estado del sistema","dashboard.createAgent":"Crear agente","dashboard.runWorkflow":"Ejecutar flujo","dashboard.installSkill":"Instalar habilidad","agents.title":"Agentes","agents.create":"Crear agente","agents.empty":"No hay agentes configurados.","agents.emptyDesc":"Crea tu primer agente IA para empezar con tareas automatizadas.","agent.overview":"Resumen","agent.runs":"Ejecuciones","agent.events":"Eventos","agent.configuration":"Configuración","agent.budget":"Presupuesto","agent.recentRuns":"Ejecuciones recientes","agent.delete":"Eliminar agente","agent.start":"Iniciar","agent.stop":"Detener","agent.run":"Ejecutar","workflows.title":"Flujos de trabajo","workflows.create":"Crear flujo","workflows.empty":"No hay flujos definidos.","workflows.emptyDesc":"Diseña tu primer flujo de trabajo para orquestar múltiples agentes.","workflows.nodes":"{count} nodos","workflows.edit":"Editar","workflow.editor":"Editor de flujo","workflow.addNode":"Añadir nodo","workflow.save":"Guardar","workflow.run":"Ejecutar flujo","skills.title":"Habilidades","skills.install":"Instalar","skills.empty":"No hay habilidades instaladas.","skills.emptyDesc":"Explora e instala habilidades para ampliar las capacidades de tus agentes.","skills.scan":"Escanear directorio","skills.source":"URL o ruta de origen","runs.title":"Ejecuciones","runs.empty":"No hay ejecuciones registradas.","runs.emptyDesc":"Ejecuta un agente o flujo para ver el historial.","runs.filter":"Filtrar","run.events":"Eventos","run.output":"Salida","run.cost":"Desglose de costes","run.duration":"Duración","approvals.title":"Cola de aprobación","approvals.empty":"Sin aprobaciones pendientes.","approvals.emptyDesc":"Todo despejado. Las acciones peligrosas aparecerán aquí.","approvals.approve":"Aprobar","approvals.deny":"Denegar","approvals.pending":"Pendiente","nav.analytics":"Analíticas","nav.budget":"Presupuesto","nav.traces":"Trazas","nav.memory":"Memoria","nav.goals":"Objetivos","nav.plans":"Planes","nav.guardrails":"Salvaguardas","analytics.title":"Analíticas de coste","analytics.description":"Seguimiento de gastos, uso de tokens y presupuesto por agente.","analytics.totalSpend":"Gasto total","analytics.totalRuns":"Total ejecuciones","analytics.avgCostPerRun":"Coste medio/ejec.","analytics.monthlyEstimate":"Estimación mensual","analytics.dailyCosts":"Costes diarios (30 días)","analytics.agentBreakdown":"Coste por agente","analytics.modelBreakdown":"Coste por modelo","analytics.budgetUtilization":"Uso del presupuesto","analytics.runs":"Ejecuciones","analytics.totalCost":"Coste total","analytics.avgCost":"Coste medio","analytics.model":"Modelo","analytics.tokens":"Tokens","analytics.cost":"Coste","analytics.noAgentData":"Sin datos de coste por agente.","analytics.noModelData":"Sin datos de coste por modelo.","settings.title":"Configuración","settings.general":"General","settings.security":"Seguridad","settings.llm":"LLM","settings.budget":"Presupuesto","settings.save":"Guardar cambios","settings.saved":"Configuración guardada.","settings.language":"Idioma","common.loading":"Cargando...","common.error":"Se produjo un error.","common.retry":"Reintentar","common.cancel":"Cancelar","common.save":"Guardar","common.delete":"Eliminar","common.close":"Cerrar","common.search":"Buscar...","common.noResults":"Sin resultados.","common.name":"Nombre","common.description":"Descripción","common.status":"Estado","common.type":"Tipo","common.actions":"Acciones","common.created":"Creado","common.updated":"Actualizado","status.running":"En ejecución","status.completed":"Completado","status.failed":"Fallido","status.pending":"Pendiente","status.paused":"En pausa","status.cancelled":"Cancelado","status.idle":"Inactivo","trust.builtin":"Integrado","trust.official":"Oficial","trust.trusted":"Verificado","trust.community":"Comunidad","trust.local":"Local"},de:{"nav.dashboard":"Dashboard","nav.agents":"Agenten","nav.workflows":"Workflows","nav.skills":"Fähigkeiten","nav.runs":"Ausführungen","nav.approvals":"Genehmigungen","nav.handoffs":"Übergaben","nav.apiKeys":"API-Schlüssel","nav.settings":"Einstellungen","nav.users":"Benutzer","nav.prompts":"Prompts","dashboard.title":"Dashboard","dashboard.activeAgents":"Aktive Agenten","dashboard.runningTasks":"Laufende Aufgaben","dashboard.costToday":"Kosten heute","dashboard.skillsInstalled":"Installierte Fähigkeiten","dashboard.recentActivity":"Letzte Aktivität","dashboard.quickActions":"Schnellaktionen","dashboard.systemHealth":"Systemstatus","dashboard.createAgent":"Agent erstellen","dashboard.runWorkflow":"Workflow starten","dashboard.installSkill":"Fähigkeit installieren","agents.title":"Agenten","agents.create":"Agent erstellen","agents.empty":"Keine Agenten konfiguriert.","agents.emptyDesc":"Erstellen Sie Ihren ersten KI-Agenten für automatisierte Aufgaben.","agent.overview":"Übersicht","agent.runs":"Ausführungen","agent.events":"Ereignisse","agent.configuration":"Konfiguration","agent.budget":"Budget","agent.recentRuns":"Letzte Ausführungen","agent.delete":"Agent löschen","agent.start":"Starten","agent.stop":"Stoppen","agent.run":"Ausführen","workflows.title":"Workflows","workflows.create":"Workflow erstellen","workflows.empty":"Keine Workflows definiert.","workflows.emptyDesc":"Entwerfen Sie Ihren ersten Workflow zur Orchestrierung mehrerer Agenten.","workflows.nodes":"{count} Knoten","workflows.edit":"Bearbeiten","workflow.editor":"Workflow-Editor","workflow.addNode":"Knoten hinzufügen","workflow.save":"Speichern","workflow.run":"Workflow starten","skills.title":"Fähigkeiten","skills.install":"Installieren","skills.empty":"Keine Fähigkeiten installiert.","skills.emptyDesc":"Durchsuchen und installieren Sie Fähigkeiten, um die Möglichkeiten Ihrer Agenten zu erweitern.","skills.scan":"Verzeichnis scannen","skills.source":"Quell-URL oder -pfad","runs.title":"Ausführungen","runs.empty":"Keine Ausführungen aufgezeichnet.","runs.emptyDesc":"Starten Sie einen Agenten oder Workflow, um den Verlauf anzuzeigen.","runs.filter":"Filtern","run.events":"Ereignisse","run.output":"Ausgabe","run.cost":"Kostenaufschlüsselung","run.duration":"Dauer","approvals.title":"Genehmigungswarteschlange","approvals.empty":"Keine ausstehenden Genehmigungen.","approvals.emptyDesc":"Alles in Ordnung. Gefährliche Aktionen erscheinen hier zur Überprüfung.","approvals.approve":"Genehmigen","approvals.deny":"Ablehnen","approvals.pending":"Ausstehend","nav.analytics":"Analytik","nav.budget":"Budget","nav.traces":"Traces","nav.memory":"Speicher","nav.goals":"Ziele","nav.plans":"Pläne","nav.guardrails":"Leitplanken","analytics.title":"Kostenanalytik","analytics.description":"Ausgaben, Token-Nutzung und Budgetauslastung pro Agent verfolgen.","analytics.totalSpend":"Gesamtausgaben","analytics.totalRuns":"Gesamtausführungen","analytics.avgCostPerRun":"Ø Kosten/Ausf.","analytics.monthlyEstimate":"Monatliche Schätzung","analytics.dailyCosts":"Tägliche Kosten (30 Tage)","analytics.agentBreakdown":"Kosten pro Agent","analytics.modelBreakdown":"Kosten pro Modell","analytics.budgetUtilization":"Budgetauslastung","analytics.runs":"Ausführungen","analytics.totalCost":"Gesamtkosten","analytics.avgCost":"Ø Kosten","analytics.model":"Modell","analytics.tokens":"Tokens","analytics.cost":"Kosten","analytics.noAgentData":"Noch keine Kostendaten pro Agent.","analytics.noModelData":"Noch keine Kostendaten pro Modell.","settings.title":"Einstellungen","settings.general":"Allgemein","settings.security":"Sicherheit","settings.llm":"LLM","settings.budget":"Budget","settings.save":"Änderungen speichern","settings.saved":"Einstellungen gespeichert.","settings.language":"Sprache","common.loading":"Laden...","common.error":"Ein Fehler ist aufgetreten.","common.retry":"Erneut versuchen","common.cancel":"Abbrechen","common.save":"Speichern","common.delete":"Löschen","common.close":"Schließen","common.search":"Suchen...","common.noResults":"Keine Ergebnisse.","common.name":"Name","common.description":"Beschreibung","common.status":"Status","common.type":"Typ","common.actions":"Aktionen","common.created":"Erstellt","common.updated":"Aktualisiert","status.running":"Läuft","status.completed":"Abgeschlossen","status.failed":"Fehlgeschlagen","status.pending":"Ausstehend","status.paused":"Pausiert","status.cancelled":"Abgebrochen","status.idle":"Inaktiv","trust.builtin":"Integriert","trust.official":"Offiziell","trust.trusted":"Vertrauenswürdig","trust.community":"Community","trust.local":"Lokal"},pt:{"nav.dashboard":"Painel","nav.agents":"Agentes","nav.workflows":"Fluxos de trabalho","nav.skills":"Habilidades","nav.runs":"Execuções","nav.approvals":"Aprovações","nav.handoffs":"Transferências","nav.apiKeys":"Chaves API","nav.settings":"Configurações","nav.users":"Usuários","nav.prompts":"Prompts","dashboard.title":"Painel","dashboard.activeAgents":"Agentes ativos","dashboard.runningTasks":"Tarefas em execução","dashboard.costToday":"Custo hoje","dashboard.skillsInstalled":"Habilidades instaladas","dashboard.recentActivity":"Atividade recente","dashboard.quickActions":"Ações rápidas","dashboard.systemHealth":"Saúde do sistema","dashboard.createAgent":"Criar agente","dashboard.runWorkflow":"Executar fluxo","dashboard.installSkill":"Instalar habilidade","agents.title":"Agentes","agents.create":"Criar agente","agents.empty":"Nenhum agente configurado.","agents.emptyDesc":"Crie seu primeiro agente de IA para começar com tarefas automatizadas.","agent.overview":"Visão geral","agent.runs":"Execuções","agent.events":"Eventos","agent.configuration":"Configuração","agent.budget":"Orçamento","agent.recentRuns":"Execuções recentes","agent.delete":"Excluir agente","agent.start":"Iniciar","agent.stop":"Parar","agent.run":"Executar","workflows.title":"Fluxos de trabalho","workflows.create":"Criar fluxo","workflows.empty":"Nenhum fluxo definido.","workflows.emptyDesc":"Projete seu primeiro fluxo de trabalho para orquestrar múltiplos agentes.","workflows.nodes":"{count} nós","workflows.edit":"Editar","workflow.editor":"Editor de fluxo","workflow.addNode":"Adicionar nó","workflow.save":"Salvar","workflow.run":"Executar fluxo","skills.title":"Habilidades","skills.install":"Instalar","skills.empty":"Nenhuma habilidade instalada.","skills.emptyDesc":"Explore e instale habilidades para ampliar as capacidades dos seus agentes.","skills.scan":"Escanear diretório","skills.source":"URL ou caminho de origem","runs.title":"Execuções","runs.empty":"Nenhuma execução registrada.","runs.emptyDesc":"Execute um agente ou fluxo para ver o histórico.","runs.filter":"Filtrar","run.events":"Eventos","run.output":"Saída","run.cost":"Detalhamento de custos","run.duration":"Duração","approvals.title":"Fila de aprovação","approvals.empty":"Sem aprovações pendentes.","approvals.emptyDesc":"Tudo limpo. Ações perigosas aparecerão aqui para revisão.","approvals.approve":"Aprovar","approvals.deny":"Negar","approvals.pending":"Pendente","nav.analytics":"Análises","nav.budget":"Orçamento","nav.traces":"Rastros","nav.memory":"Memória","nav.goals":"Objetivos","nav.plans":"Planos","nav.guardrails":"Proteções","analytics.title":"Análise de custos","analytics.description":"Acompanhe gastos, uso de tokens e orçamento por agente.","analytics.totalSpend":"Gasto total","analytics.totalRuns":"Total de execuções","analytics.avgCostPerRun":"Custo médio/exec.","analytics.monthlyEstimate":"Estimativa mensal","analytics.dailyCosts":"Custos diários (30 dias)","analytics.agentBreakdown":"Custo por agente","analytics.modelBreakdown":"Custo por modelo","analytics.budgetUtilization":"Utilização do orçamento","analytics.runs":"Execuções","analytics.totalCost":"Custo total","analytics.avgCost":"Custo médio","analytics.model":"Modelo","analytics.tokens":"Tokens","analytics.cost":"Custo","analytics.noAgentData":"Sem dados de custo por agente.","analytics.noModelData":"Sem dados de custo por modelo.","settings.title":"Configurações","settings.general":"Geral","settings.security":"Segurança","settings.llm":"LLM","settings.budget":"Orçamento","settings.save":"Salvar alterações","settings.saved":"Configurações salvas.","settings.language":"Idioma","common.loading":"Carregando...","common.error":"Ocorreu um erro.","common.retry":"Tentar novamente","common.cancel":"Cancelar","common.save":"Salvar","common.delete":"Excluir","common.close":"Fechar","common.search":"Pesquisar...","common.noResults":"Nenhum resultado.","common.name":"Nome","common.description":"Descrição","common.status":"Status","common.type":"Tipo","common.actions":"Ações","common.created":"Criado","common.updated":"Atualizado","status.running":"Em execução","status.completed":"Concluído","status.failed":"Falhou","status.pending":"Pendente","status.paused":"Pausado","status.cancelled":"Cancelado","status.idle":"Inativo","trust.builtin":"Integrado","trust.official":"Oficial","trust.trusted":"Verificado","trust.community":"Comunidade","trust.local":"Local"},ja:{"nav.dashboard":"ダッシュボード","nav.agents":"エージェント","nav.workflows":"ワークフロー","nav.skills":"スキル","nav.runs":"実行履歴","nav.approvals":"承認","nav.handoffs":"引き継ぎ","nav.apiKeys":"APIキー","nav.settings":"設定","nav.users":"ユーザー","nav.prompts":"プロンプト","dashboard.title":"ダッシュボード","dashboard.activeAgents":"アクティブなエージェント","dashboard.runningTasks":"実行中のタスク","dashboard.costToday":"本日のコスト","dashboard.skillsInstalled":"インストール済みスキル","dashboard.recentActivity":"最近のアクティビティ","dashboard.quickActions":"クイックアクション","dashboard.systemHealth":"システム状態","dashboard.createAgent":"エージェント作成","dashboard.runWorkflow":"ワークフロー実行","dashboard.installSkill":"スキルインストール","agents.title":"エージェント","agents.create":"エージェント作成","agents.empty":"エージェントが構成されていません。","agents.emptyDesc":"最初のAIエージェントを作成して自動化タスクを始めましょう。","agent.overview":"概要","agent.runs":"実行履歴","agent.events":"イベント","agent.configuration":"構成","agent.budget":"予算","agent.recentRuns":"最近の実行","agent.delete":"エージェント削除","agent.start":"開始","agent.stop":"停止","agent.run":"実行","workflows.title":"ワークフロー","workflows.create":"ワークフロー作成","workflows.empty":"ワークフローが定義されていません。","workflows.emptyDesc":"最初のワークフローを設計して複数のエージェントをオーケストレーションしましょう。","workflows.nodes":"{count} ノード","workflows.edit":"編集","workflow.editor":"ワークフローエディタ","workflow.addNode":"ノード追加","workflow.save":"保存","workflow.run":"ワークフロー実行","skills.title":"スキル","skills.install":"インストール","skills.empty":"スキルがインストールされていません。","skills.emptyDesc":"スキルを参照・インストールしてエージェントの機能を拡張しましょう。","skills.scan":"ディレクトリスキャン","skills.source":"ソースURLまたはパス","runs.title":"実行履歴","runs.empty":"実行記録がありません。","runs.emptyDesc":"エージェントまたはワークフローを実行して履歴を確認しましょう。","runs.filter":"フィルター","run.events":"イベント","run.output":"出力","run.cost":"コスト内訳","run.duration":"所要時間","approvals.title":"承認キュー","approvals.empty":"保留中の承認はありません。","approvals.emptyDesc":"問題なし。危険なアクションはここに表示されます。","approvals.approve":"承認","approvals.deny":"拒否","approvals.pending":"保留中","nav.analytics":"アナリティクス","nav.budget":"予算","nav.traces":"トレース","nav.memory":"メモリ","nav.goals":"目標","nav.plans":"プラン","nav.guardrails":"ガードレール","analytics.title":"コスト分析","analytics.description":"エージェントごとの支出、トークン使用量、予算利用状況を追跡。","analytics.totalSpend":"総支出","analytics.totalRuns":"総実行数","analytics.avgCostPerRun":"平均コスト/実行","analytics.monthlyEstimate":"月間見積もり","analytics.dailyCosts":"日次コスト(30日間)","analytics.agentBreakdown":"エージェント別コスト","analytics.modelBreakdown":"モデル別コスト","analytics.budgetUtilization":"予算利用率","analytics.runs":"実行回数","analytics.totalCost":"総コスト","analytics.avgCost":"平均コスト","analytics.model":"モデル","analytics.tokens":"トークン","analytics.cost":"コスト","analytics.noAgentData":"エージェントコストデータがまだありません。","analytics.noModelData":"モデルコストデータがまだありません。","settings.title":"設定","settings.general":"一般","settings.security":"セキュリティ","settings.llm":"LLM","settings.budget":"予算","settings.save":"変更を保存","settings.saved":"設定が保存されました。","settings.language":"言語","common.loading":"読み込み中...","common.error":"エラーが発生しました。","common.retry":"再試行","common.cancel":"キャンセル","common.save":"保存","common.delete":"削除","common.close":"閉じる","common.search":"検索...","common.noResults":"結果が見つかりません。","common.name":"名前","common.description":"説明","common.status":"ステータス","common.type":"タイプ","common.actions":"アクション","common.created":"作成日","common.updated":"更新日","status.running":"実行中","status.completed":"完了","status.failed":"失敗","status.pending":"保留中","status.paused":"一時停止","status.cancelled":"キャンセル済み","status.idle":"アイドル","trust.builtin":"組み込み","trust.official":"公式","trust.trusted":"信頼済み","trust.community":"コミュニティ","trust.local":"ローカル"},zh:{"nav.dashboard":"仪表盘","nav.agents":"代理","nav.workflows":"工作流","nav.skills":"技能","nav.runs":"执行记录","nav.approvals":"审批","nav.handoffs":"交接","nav.apiKeys":"API密钥","nav.settings":"设置","nav.users":"用户","nav.prompts":"提示词","dashboard.title":"仪表盘","dashboard.activeAgents":"活跃代理","dashboard.runningTasks":"运行中的任务","dashboard.costToday":"今日费用","dashboard.skillsInstalled":"已安装技能","dashboard.recentActivity":"最近活动","dashboard.quickActions":"快捷操作","dashboard.systemHealth":"系统状态","dashboard.createAgent":"创建代理","dashboard.runWorkflow":"运行工作流","dashboard.installSkill":"安装技能","agents.title":"代理","agents.create":"创建代理","agents.empty":"尚无已配置的代理。","agents.emptyDesc":"创建您的第一个AI代理以开始自动化任务。","agent.overview":"概览","agent.runs":"执行记录","agent.events":"事件","agent.configuration":"配置","agent.budget":"预算","agent.recentRuns":"最近执行","agent.delete":"删除代理","agent.start":"启动","agent.stop":"停止","agent.run":"运行","workflows.title":"工作流","workflows.create":"创建工作流","workflows.empty":"尚无已定义的工作流。","workflows.emptyDesc":"设计您的第一个工作流以编排多个代理。","workflows.nodes":"{count} 个节点","workflows.edit":"编辑","workflow.editor":"工作流编辑器","workflow.addNode":"添加节点","workflow.save":"保存","workflow.run":"运行工作流","skills.title":"技能","skills.install":"安装","skills.empty":"尚无已安装的技能。","skills.emptyDesc":"浏览并安装技能以扩展代理的能力。","skills.scan":"扫描目录","skills.source":"源URL或路径","runs.title":"执行记录","runs.empty":"尚无执行记录。","runs.emptyDesc":"运行代理或工作流以查看执行历史。","runs.filter":"筛选","run.events":"事件","run.output":"输出","run.cost":"费用明细","run.duration":"持续时间","approvals.title":"审批队列","approvals.empty":"没有待审批项。","approvals.emptyDesc":"一切正常。危险操作将在此显示以供审查。","approvals.approve":"批准","approvals.deny":"拒绝","approvals.pending":"待处理","nav.analytics":"分析","nav.budget":"预算","nav.traces":"追踪","nav.memory":"记忆","nav.goals":"目标","nav.plans":"计划","nav.guardrails":"护栏","analytics.title":"费用分析","analytics.description":"追踪各代理的支出、令牌使用量和预算利用率。","analytics.totalSpend":"总支出","analytics.totalRuns":"总执行次数","analytics.avgCostPerRun":"平均费用/次","analytics.monthlyEstimate":"月度估算","analytics.dailyCosts":"每日费用(30天)","analytics.agentBreakdown":"按代理的费用","analytics.modelBreakdown":"按模型的费用","analytics.budgetUtilization":"预算利用率","analytics.runs":"执行次数","analytics.totalCost":"总费用","analytics.avgCost":"平均费用","analytics.model":"模型","analytics.tokens":"令牌","analytics.cost":"费用","analytics.noAgentData":"尚无代理费用数据。","analytics.noModelData":"尚无模型费用数据。","settings.title":"设置","settings.general":"通用","settings.security":"安全","settings.llm":"LLM","settings.budget":"预算","settings.save":"保存更改","settings.saved":"设置已保存。","settings.language":"语言","common.loading":"加载中...","common.error":"发生错误。","common.retry":"重试","common.cancel":"取消","common.save":"保存","common.delete":"删除","common.close":"关闭","common.search":"搜索...","common.noResults":"未找到结果。","common.name":"名称","common.description":"描述","common.status":"状态","common.type":"类型","common.actions":"操作","common.created":"创建时间","common.updated":"更新时间","status.running":"运行中","status.completed":"已完成","status.failed":"失败","status.pending":"待处理","status.paused":"已暂停","status.cancelled":"已取消","status.idle":"空闲","trust.builtin":"内置","trust.official":"官方","trust.trusted":"受信任","trust.community":"社区","trust.local":"本地"},ko:{"nav.dashboard":"대시보드","nav.agents":"에이전트","nav.workflows":"워크플로우","nav.skills":"스킬","nav.runs":"실행 기록","nav.approvals":"승인","nav.handoffs":"인수인계","nav.apiKeys":"API 키","nav.settings":"설정","nav.users":"사용자","nav.prompts":"프롬프트","dashboard.title":"대시보드","dashboard.activeAgents":"활성 에이전트","dashboard.runningTasks":"실행 중인 작업","dashboard.costToday":"오늘 비용","dashboard.skillsInstalled":"설치된 스킬","dashboard.recentActivity":"최근 활동","dashboard.quickActions":"빠른 작업","dashboard.systemHealth":"시스템 상태","dashboard.createAgent":"에이전트 생성","dashboard.runWorkflow":"워크플로우 실행","dashboard.installSkill":"스킬 설치","agents.title":"에이전트","agents.create":"에이전트 생성","agents.empty":"구성된 에이전트가 없습니다.","agents.emptyDesc":"첫 번째 AI 에이전트를 만들어 자동화 작업을 시작하세요.","agent.overview":"개요","agent.runs":"실행 기록","agent.events":"이벤트","agent.configuration":"구성","agent.budget":"예산","agent.recentRuns":"최근 실행","agent.delete":"에이전트 삭제","agent.start":"시작","agent.stop":"중지","agent.run":"실행","workflows.title":"워크플로우","workflows.create":"워크플로우 생성","workflows.empty":"정의된 워크플로우가 없습니다.","workflows.emptyDesc":"첫 번째 워크플로우를 설계하여 여러 에이전트를 조율하세요.","workflows.nodes":"{count}개 노드","workflows.edit":"편집","workflow.editor":"워크플로우 편집기","workflow.addNode":"노드 추가","workflow.save":"저장","workflow.run":"워크플로우 실행","skills.title":"스킬","skills.install":"설치","skills.empty":"설치된 스킬이 없습니다.","skills.emptyDesc":"스킬을 탐색하고 설치하여 에이전트의 기능을 확장하세요.","skills.scan":"디렉토리 스캔","skills.source":"소스 URL 또는 경로","runs.title":"실행 기록","runs.empty":"기록된 실행이 없습니다.","runs.emptyDesc":"에이전트 또는 워크플로우를 실행하여 실행 기록을 확인하세요.","runs.filter":"필터","run.events":"이벤트","run.output":"출력","run.cost":"비용 내역","run.duration":"소요 시간","approvals.title":"승인 대기열","approvals.empty":"대기 중인 승인이 없습니다.","approvals.emptyDesc":"문제 없음. 위험한 작업은 여기에 검토를 위해 표시됩니다.","approvals.approve":"승인","approvals.deny":"거부","approvals.pending":"대기 중","nav.analytics":"분석","nav.budget":"예산","nav.traces":"추적","nav.memory":"메모리","nav.goals":"목표","nav.plans":"계획","nav.guardrails":"가드레일","analytics.title":"비용 분석","analytics.description":"에이전트별 지출, 토큰 사용량 및 예산 활용도를 추적합니다.","analytics.totalSpend":"총 지출","analytics.totalRuns":"총 실행 수","analytics.avgCostPerRun":"평균 비용/실행","analytics.monthlyEstimate":"월간 추정","analytics.dailyCosts":"일별 비용 (30일)","analytics.agentBreakdown":"에이전트별 비용","analytics.modelBreakdown":"모델별 비용","analytics.budgetUtilization":"예산 활용률","analytics.runs":"실행 횟수","analytics.totalCost":"총 비용","analytics.avgCost":"평균 비용","analytics.model":"모델","analytics.tokens":"토큰","analytics.cost":"비용","analytics.noAgentData":"에이전트 비용 데이터가 없습니다.","analytics.noModelData":"모델 비용 데이터가 없습니다.","settings.title":"설정","settings.general":"일반","settings.security":"보안","settings.llm":"LLM","settings.budget":"예산","settings.save":"변경 사항 저장","settings.saved":"설정이 저장되었습니다.","settings.language":"언어","common.loading":"로딩 중...","common.error":"오류가 발생했습니다.","common.retry":"재시도","common.cancel":"취소","common.save":"저장","common.delete":"삭제","common.close":"닫기","common.search":"검색...","common.noResults":"결과를 찾을 수 없습니다.","common.name":"이름","common.description":"설명","common.status":"상태","common.type":"유형","common.actions":"작업","common.created":"생성일","common.updated":"수정일","status.running":"실행 중","status.completed":"완료","status.failed":"실패","status.pending":"대기 중","status.paused":"일시 중지","status.cancelled":"취소됨","status.idle":"유휴","trust.builtin":"내장","trust.official":"공식","trust.trusted":"신뢰됨","trust.community":"커뮤니티","trust.local":"로컬"},ar:{"nav.dashboard":"لوحة التحكم","nav.agents":"الوكلاء","nav.workflows":"مسارات العمل","nav.skills":"المهارات","nav.runs":"عمليات التنفيذ","nav.approvals":"الموافقات","nav.handoffs":"التسليمات","nav.apiKeys":"مفاتيح API","nav.settings":"الإعدادات","nav.users":"المستخدمون","nav.prompts":"التعليمات","dashboard.title":"لوحة التحكم","dashboard.activeAgents":"الوكلاء النشطون","dashboard.runningTasks":"المهام قيد التشغيل","dashboard.costToday":"تكلفة اليوم","dashboard.skillsInstalled":"المهارات المثبتة","dashboard.recentActivity":"النشاط الأخير","dashboard.quickActions":"إجراءات سريعة","dashboard.systemHealth":"حالة النظام","dashboard.createAgent":"إنشاء وكيل","dashboard.runWorkflow":"تشغيل مسار عمل","dashboard.installSkill":"تثبيت مهارة","agents.title":"الوكلاء","agents.create":"إنشاء وكيل","agents.empty":"لا توجد وكلاء مهيأة بعد.","agents.emptyDesc":"أنشئ أول وكيل ذكاء اصطناعي لبدء المهام الآلية.","agent.overview":"نظرة عامة","agent.runs":"عمليات التنفيذ","agent.events":"الأحداث","agent.configuration":"التكوين","agent.budget":"الميزانية","agent.recentRuns":"آخر عمليات التنفيذ","agent.delete":"حذف الوكيل","agent.start":"بدء","agent.stop":"إيقاف","agent.run":"تشغيل","workflows.title":"مسارات العمل","workflows.create":"إنشاء مسار عمل","workflows.empty":"لا توجد مسارات عمل معرّفة بعد.","workflows.emptyDesc":"صمّم أول مسار عمل لتنسيق عدة وكلاء.","workflows.nodes":"{count} عقدة","workflows.edit":"تعديل","workflow.editor":"محرر مسار العمل","workflow.addNode":"إضافة عقدة","workflow.save":"حفظ","workflow.run":"تشغيل مسار العمل","skills.title":"المهارات","skills.install":"تثبيت","skills.empty":"لا توجد مهارات مثبتة بعد.","skills.emptyDesc":"تصفّح وثبّت المهارات لتوسيع قدرات وكلائك.","skills.scan":"فحص المجلد","skills.source":"عنوان URL أو مسار المصدر","runs.title":"عمليات التنفيذ","runs.empty":"لا توجد عمليات تنفيذ مسجلة بعد.","runs.emptyDesc":"شغّل وكيلًا أو مسار عمل لعرض سجل التنفيذ.","runs.filter":"تصفية","run.events":"الأحداث","run.output":"المخرجات","run.cost":"تفصيل التكاليف","run.duration":"المدة","approvals.title":"قائمة الموافقات","approvals.empty":"لا توجد موافقات معلقة.","approvals.emptyDesc":"كل شيء على ما يرام. ستظهر الإجراءات الخطيرة هنا للمراجعة.","approvals.approve":"موافقة","approvals.deny":"رفض","approvals.pending":"معلّق","nav.analytics":"التحليلات","nav.budget":"الميزانية","nav.traces":"التتبع","nav.memory":"الذاكرة","nav.goals":"الأهداف","nav.plans":"الخطط","nav.guardrails":"الحواجز","analytics.title":"تحليل التكاليف","analytics.description":"تتبع الإنفاق واستخدام الرموز وميزانية كل وكيل.","analytics.totalSpend":"إجمالي الإنفاق","analytics.totalRuns":"إجمالي عمليات التنفيذ","analytics.avgCostPerRun":"متوسط التكلفة/تنفيذ","analytics.monthlyEstimate":"التقدير الشهري","analytics.dailyCosts":"التكاليف اليومية (30 يومًا)","analytics.agentBreakdown":"التكلفة حسب الوكيل","analytics.modelBreakdown":"التكلفة حسب النموذج","analytics.budgetUtilization":"استخدام الميزانية","analytics.runs":"عمليات التنفيذ","analytics.totalCost":"التكلفة الإجمالية","analytics.avgCost":"متوسط التكلفة","analytics.model":"النموذج","analytics.tokens":"الرموز","analytics.cost":"التكلفة","analytics.noAgentData":"لا توجد بيانات تكلفة للوكلاء بعد.","analytics.noModelData":"لا توجد بيانات تكلفة للنماذج بعد.","settings.title":"الإعدادات","settings.general":"عام","settings.security":"الأمان","settings.llm":"LLM","settings.budget":"الميزانية","settings.save":"حفظ التغييرات","settings.saved":"تم حفظ الإعدادات بنجاح.","settings.language":"اللغة","common.loading":"جارٍ التحميل...","common.error":"حدث خطأ.","common.retry":"إعادة المحاولة","common.cancel":"إلغاء","common.save":"حفظ","common.delete":"حذف","common.close":"إغلاق","common.search":"بحث...","common.noResults":"لم يتم العثور على نتائج.","common.name":"الاسم","common.description":"الوصف","common.status":"الحالة","common.type":"النوع","common.actions":"الإجراءات","common.created":"تاريخ الإنشاء","common.updated":"تاريخ التحديث","status.running":"قيد التشغيل","status.completed":"مكتمل","status.failed":"فشل","status.pending":"معلّق","status.paused":"متوقف مؤقتًا","status.cancelled":"ملغى","status.idle":"خامل","trust.builtin":"مدمج","trust.official":"رسمي","trust.trusted":"موثوق","trust.community":"مجتمعي","trust.local":"محلي"},ru:{"nav.dashboard":"Панель управления","nav.agents":"Агенты","nav.workflows":"Рабочие процессы","nav.skills":"Навыки","nav.runs":"Запуски","nav.approvals":"Одобрения","nav.handoffs":"Передачи","nav.apiKeys":"API-ключи","nav.settings":"Настройки","nav.users":"Пользователи","nav.prompts":"Промпты","dashboard.title":"Панель управления","dashboard.activeAgents":"Активные агенты","dashboard.runningTasks":"Запущенные задачи","dashboard.costToday":"Расходы сегодня","dashboard.skillsInstalled":"Установленные навыки","dashboard.recentActivity":"Последняя активность","dashboard.quickActions":"Быстрые действия","dashboard.systemHealth":"Состояние системы","dashboard.createAgent":"Создать агента","dashboard.runWorkflow":"Запустить процесс","dashboard.installSkill":"Установить навык","agents.title":"Агенты","agents.create":"Создать агента","agents.empty":"Нет настроенных агентов.","agents.emptyDesc":"Создайте первого ИИ-агента для автоматизации задач.","agent.overview":"Обзор","agent.runs":"Запуски","agent.events":"События","agent.configuration":"Конфигурация","agent.budget":"Бюджет","agent.recentRuns":"Последние запуски","agent.delete":"Удалить агента","agent.start":"Запустить","agent.stop":"Остановить","agent.run":"Выполнить","workflows.title":"Рабочие процессы","workflows.create":"Создать процесс","workflows.empty":"Нет определённых процессов.","workflows.emptyDesc":"Создайте первый рабочий процесс для оркестрации агентов.","workflows.nodes":"{count} узлов","workflows.edit":"Редактировать","workflow.editor":"Редактор процессов","workflow.addNode":"Добавить узел","workflow.save":"Сохранить","workflow.run":"Запустить процесс","skills.title":"Навыки","skills.install":"Установить","skills.empty":"Нет установленных навыков.","skills.emptyDesc":"Просматривайте и устанавливайте навыки для расширения возможностей агентов.","skills.scan":"Сканировать каталог","skills.source":"URL или путь к источнику","runs.title":"Запуски","runs.empty":"Нет записей о запусках.","runs.emptyDesc":"Запустите агента или процесс, чтобы увидеть историю выполнения.","runs.filter":"Фильтр","run.events":"События","run.output":"Вывод","run.cost":"Разбивка стоимости","run.duration":"Длительность","approvals.title":"Очередь одобрений","approvals.empty":"Нет ожидающих одобрений.","approvals.emptyDesc":"Всё в порядке. Опасные действия появятся здесь для проверки.","approvals.approve":"Одобрить","approvals.deny":"Отклонить","approvals.pending":"Ожидает","nav.analytics":"Аналитика","nav.budget":"Бюджет","nav.traces":"Трассировки","nav.memory":"Память","nav.goals":"Цели","nav.plans":"Планы","nav.guardrails":"Ограждения","analytics.title":"Аналитика расходов","analytics.description":"Отслеживание расходов, использования токенов и бюджета по агентам.","analytics.totalSpend":"Общие расходы","analytics.totalRuns":"Всего запусков","analytics.avgCostPerRun":"Ср. стоимость/запуск","analytics.monthlyEstimate":"Месячная оценка","analytics.dailyCosts":"Ежедневные расходы (30 дней)","analytics.agentBreakdown":"Расходы по агентам","analytics.modelBreakdown":"Расходы по моделям","analytics.budgetUtilization":"Использование бюджета","analytics.runs":"Запуски","analytics.totalCost":"Общая стоимость","analytics.avgCost":"Ср. стоимость","analytics.model":"Модель","analytics.tokens":"Токены","analytics.cost":"Стоимость","analytics.noAgentData":"Нет данных о расходах по агентам.","analytics.noModelData":"Нет данных о расходах по моделям.","settings.title":"Настройки","settings.general":"Общие","settings.security":"Безопасность","settings.llm":"LLM","settings.budget":"Бюджет","settings.save":"Сохранить изменения","settings.saved":"Настройки сохранены.","settings.language":"Язык","common.loading":"Загрузка...","common.error":"Произошла ошибка.","common.retry":"Повторить","common.cancel":"Отмена","common.save":"Сохранить","common.delete":"Удалить","common.close":"Закрыть","common.search":"Поиск...","common.noResults":"Результатов не найдено.","common.name":"Название","common.description":"Описание","common.status":"Статус","common.type":"Тип","common.actions":"Действия","common.created":"Создано","common.updated":"Обновлено","status.running":"Выполняется","status.completed":"Завершено","status.failed":"Ошибка","status.pending":"Ожидание","status.paused":"Пауза","status.cancelled":"Отменено","status.idle":"Простой","trust.builtin":"Встроенный","trust.official":"Официальный","trust.trusted":"Доверенный","trust.community":"Сообщество","trust.local":"Локальный"},it:{"nav.dashboard":"Pannello","nav.agents":"Agenti","nav.workflows":"Flussi di lavoro","nav.skills":"Competenze","nav.runs":"Esecuzioni","nav.approvals":"Approvazioni","nav.handoffs":"Passaggi","nav.apiKeys":"Chiavi API","nav.settings":"Impostazioni","nav.users":"Utenti","nav.prompts":"Prompt","dashboard.title":"Pannello","dashboard.activeAgents":"Agenti attivi","dashboard.runningTasks":"Attività in corso","dashboard.costToday":"Costo oggi","dashboard.skillsInstalled":"Competenze installate","dashboard.recentActivity":"Attività recente","dashboard.quickActions":"Azioni rapide","dashboard.systemHealth":"Stato del sistema","dashboard.createAgent":"Crea agente","dashboard.runWorkflow":"Esegui flusso","dashboard.installSkill":"Installa competenza","agents.title":"Agenti","agents.create":"Crea agente","agents.empty":"Nessun agente configurato.","agents.emptyDesc":"Crea il tuo primo agente IA per iniziare con le attività automatizzate.","agent.overview":"Panoramica","agent.runs":"Esecuzioni","agent.events":"Eventi","agent.configuration":"Configurazione","agent.budget":"Budget","agent.recentRuns":"Esecuzioni recenti","agent.delete":"Elimina agente","agent.start":"Avvia","agent.stop":"Arresta","agent.run":"Esegui","workflows.title":"Flussi di lavoro","workflows.create":"Crea flusso","workflows.empty":"Nessun flusso di lavoro definito.","workflows.emptyDesc":"Progetta il tuo primo flusso di lavoro per orchestrare più agenti.","workflows.nodes":"{count} nodi","workflows.edit":"Modifica","workflow.editor":"Editor del flusso","workflow.addNode":"Aggiungi nodo","workflow.save":"Salva","workflow.run":"Esegui flusso","skills.title":"Competenze","skills.install":"Installa","skills.empty":"Nessuna competenza installata.","skills.emptyDesc":"Esplora e installa competenze per ampliare le capacità dei tuoi agenti.","skills.scan":"Scansiona directory","skills.source":"URL o percorso sorgente","runs.title":"Esecuzioni","runs.empty":"Nessuna esecuzione registrata.","runs.emptyDesc":"Esegui un agente o un flusso per vedere la cronologia.","runs.filter":"Filtra","run.events":"Eventi","run.output":"Output","run.cost":"Dettaglio costi","run.duration":"Durata","approvals.title":"Coda di approvazione","approvals.empty":"Nessuna approvazione in sospeso.","approvals.emptyDesc":"Tutto a posto. Le azioni pericolose appariranno qui per la revisione.","approvals.approve":"Approva","approvals.deny":"Nega","approvals.pending":"In sospeso","nav.analytics":"Analisi","nav.budget":"Budget","nav.traces":"Tracce","nav.memory":"Memoria","nav.goals":"Obiettivi","nav.plans":"Piani","nav.guardrails":"Protezioni","analytics.title":"Analisi dei costi","analytics.description":"Monitora spese, utilizzo dei token e budget per agente.","analytics.totalSpend":"Spesa totale","analytics.totalRuns":"Esecuzioni totali","analytics.avgCostPerRun":"Costo medio/esec.","analytics.monthlyEstimate":"Stima mensile","analytics.dailyCosts":"Costi giornalieri (30 giorni)","analytics.agentBreakdown":"Costo per agente","analytics.modelBreakdown":"Costo per modello","analytics.budgetUtilization":"Utilizzo del budget","analytics.runs":"Esecuzioni","analytics.totalCost":"Costo totale","analytics.avgCost":"Costo medio","analytics.model":"Modello","analytics.tokens":"Token","analytics.cost":"Costo","analytics.noAgentData":"Nessun dato di costo per agente.","analytics.noModelData":"Nessun dato di costo per modello.","settings.title":"Impostazioni","settings.general":"Generale","settings.security":"Sicurezza","settings.llm":"LLM","settings.budget":"Budget","settings.save":"Salva modifiche","settings.saved":"Impostazioni salvate.","settings.language":"Lingua","common.loading":"Caricamento...","common.error":"Si è verificato un errore.","common.retry":"Riprova","common.cancel":"Annulla","common.save":"Salva","common.delete":"Elimina","common.close":"Chiudi","common.search":"Cerca...","common.noResults":"Nessun risultato.","common.name":"Nome","common.description":"Descrizione","common.status":"Stato","common.type":"Tipo","common.actions":"Azioni","common.created":"Creato","common.updated":"Aggiornato","status.running":"In esecuzione","status.completed":"Completato","status.failed":"Fallito","status.pending":"In sospeso","status.paused":"In pausa","status.cancelled":"Annullato","status.idle":"Inattivo","trust.builtin":"Integrato","trust.official":"Ufficiale","trust.trusted":"Affidabile","trust.community":"Comunità","trust.local":"Locale"},nl:{"nav.dashboard":"Dashboard","nav.agents":"Agents","nav.workflows":"Workflows","nav.skills":"Vaardigheden","nav.runs":"Uitvoeringen","nav.approvals":"Goedkeuringen","nav.handoffs":"Overdrachten","nav.apiKeys":"API-sleutels","nav.settings":"Instellingen","nav.users":"Gebruikers","nav.prompts":"Prompts","dashboard.title":"Dashboard","dashboard.activeAgents":"Actieve agents","dashboard.runningTasks":"Lopende taken","dashboard.costToday":"Kosten vandaag","dashboard.skillsInstalled":"Geïnstalleerde vaardigheden","dashboard.recentActivity":"Recente activiteit","dashboard.quickActions":"Snelle acties","dashboard.systemHealth":"Systeemstatus","dashboard.createAgent":"Agent aanmaken","dashboard.runWorkflow":"Workflow uitvoeren","dashboard.installSkill":"Vaardigheid installeren","agents.title":"Agents","agents.create":"Agent aanmaken","agents.empty":"Geen agents geconfigureerd.","agents.emptyDesc":"Maak uw eerste AI-agent aan om te beginnen met geautomatiseerde taken.","agent.overview":"Overzicht","agent.runs":"Uitvoeringen","agent.events":"Gebeurtenissen","agent.configuration":"Configuratie","agent.budget":"Budget","agent.recentRuns":"Recente uitvoeringen","agent.delete":"Agent verwijderen","agent.start":"Starten","agent.stop":"Stoppen","agent.run":"Uitvoeren","workflows.title":"Workflows","workflows.create":"Workflow aanmaken","workflows.empty":"Geen workflows gedefinieerd.","workflows.emptyDesc":"Ontwerp uw eerste workflow om meerdere agents te orkestreren.","workflows.nodes":"{count} knooppunten","workflows.edit":"Bewerken","workflow.editor":"Workflow-editor","workflow.addNode":"Knooppunt toevoegen","workflow.save":"Opslaan","workflow.run":"Workflow uitvoeren","skills.title":"Vaardigheden","skills.install":"Installeren","skills.empty":"Geen vaardigheden geïnstalleerd.","skills.emptyDesc":"Blader door en installeer vaardigheden om de mogelijkheden van uw agents uit te breiden.","skills.scan":"Map scannen","skills.source":"Bron-URL of pad","runs.title":"Uitvoeringen","runs.empty":"Geen uitvoeringen geregistreerd.","runs.emptyDesc":"Voer een agent of workflow uit om de uitvoeringsgeschiedenis te bekijken.","runs.filter":"Filteren","run.events":"Gebeurtenissen","run.output":"Uitvoer","run.cost":"Kostenoverzicht","run.duration":"Duur","approvals.title":"Goedkeuringswachtrij","approvals.empty":"Geen wachtende goedkeuringen.","approvals.emptyDesc":"Alles in orde. Gevaarlijke acties verschijnen hier ter beoordeling.","approvals.approve":"Goedkeuren","approvals.deny":"Weigeren","approvals.pending":"In afwachting","nav.analytics":"Analyse","nav.budget":"Budget","nav.traces":"Traces","nav.memory":"Geheugen","nav.goals":"Doelen","nav.plans":"Plannen","nav.guardrails":"Vangrails","analytics.title":"Kostenanalyse","analytics.description":"Volg uitgaven, tokengebruik en budgetbenutting per agent.","analytics.totalSpend":"Totale uitgaven","analytics.totalRuns":"Totaal uitvoeringen","analytics.avgCostPerRun":"Gem. kosten/uitv.","analytics.monthlyEstimate":"Maandelijkse schatting","analytics.dailyCosts":"Dagelijkse kosten (30 dagen)","analytics.agentBreakdown":"Kosten per agent","analytics.modelBreakdown":"Kosten per model","analytics.budgetUtilization":"Budgetbenutting","analytics.runs":"Uitvoeringen","analytics.totalCost":"Totale kosten","analytics.avgCost":"Gem. kosten","analytics.model":"Model","analytics.tokens":"Tokens","analytics.cost":"Kosten","analytics.noAgentData":"Nog geen kostengegevens per agent.","analytics.noModelData":"Nog geen kostengegevens per model.","settings.title":"Instellingen","settings.general":"Algemeen","settings.security":"Beveiliging","settings.llm":"LLM","settings.budget":"Budget","settings.save":"Wijzigingen opslaan","settings.saved":"Instellingen opgeslagen.","settings.language":"Taal","common.loading":"Laden...","common.error":"Er is een fout opgetreden.","common.retry":"Opnieuw proberen","common.cancel":"Annuleren","common.save":"Opslaan","common.delete":"Verwijderen","common.close":"Sluiten","common.search":"Zoeken...","common.noResults":"Geen resultaten gevonden.","common.name":"Naam","common.description":"Beschrijving","common.status":"Status","common.type":"Type","common.actions":"Acties","common.created":"Aangemaakt","common.updated":"Bijgewerkt","status.running":"Actief","status.completed":"Voltooid","status.failed":"Mislukt","status.pending":"In afwachting","status.paused":"Gepauzeerd","status.cancelled":"Geannuleerd","status.idle":"Inactief","trust.builtin":"Ingebouwd","trust.official":"Officieel","trust.trusted":"Vertrouwd","trust.community":"Community","trust.local":"Lokaal"}},v0=u.createContext({lang:"en",setLang:()=>{},t:n=>n,isRTL:!1});function Ov({children:n}){const[r,d]=u.useState(()=>{const h=localStorage.getItem("nestor_lang");return h&&_d(h)?h:Dv(navigator.language)}),o=Rv.includes(r);u.useEffect(()=>{document.documentElement.dir=o?"rtl":"ltr",document.documentElement.lang=r},[r,o]);const m=u.useCallback(h=>{d(h),localStorage.setItem("nestor_lang",h)},[]),f=u.useCallback((h,b)=>{var p;let g=((p=Ch[r])==null?void 0:p[h])??Ch.en[h]??h;if(b)for(const[j,y]of Object.entries(b))g=g.replace(`{${j}}`,String(y));return g},[r]);return t.jsx(v0.Provider,{value:{lang:r,setLang:m,t:f,isRTL:o},children:n})}function We(){return u.useContext(v0)}const Lv={admin:{agents:["create","read","update","delete","execute","admin"],workflows:["create","read","update","delete","execute","admin"],skills:["create","read","update","delete","admin"],settings:["read","update","admin"],users:["create","read","update","delete","admin"],prompts:["create","read","update","delete","admin"]},member:{agents:["create","read","update","execute"],workflows:["create","read","update","execute"],skills:["read","create"],settings:["read"],prompts:["read","create","update"]},viewer:{agents:["read"],workflows:["read"],skills:["read"],settings:["read"],prompts:["read"]}},j0=u.createContext({user:null,loading:!0,login:async()=>{},logout:async()=>{},register:async()=>{},isAdmin:!1,hasPermission:()=>!1}),_v="/api";function Uv(){const n=document.cookie.match(/(?:^|; )nestor-csrf=([^;]*)/);return n?decodeURIComponent(n[1]):null}async function Vl(n,r){var h;const d={"Content-Type":"application/json",...(r==null?void 0:r.headers)||{}},o=((r==null?void 0:r.method)||"GET").toUpperCase();if(o!=="GET"&&o!=="HEAD"){const b=Uv();b&&(d["X-CSRF-Token"]=b)}const m=await fetch(`${_v}${n}`,{credentials:"include",headers:d,...r}),f=await m.json().catch(()=>({}));if(!m.ok)throw new Error(((h=f==null?void 0:f.error)==null?void 0:h.message)||`Request failed (${m.status})`);return f}function Bv({children:n}){const[r,d]=u.useState(null),[o,m]=u.useState(!0);u.useEffect(()=>{Vl("/auth/me").then(j=>{var y;(y=j.data)!=null&&y.user&&typeof j.data.user=="object"&&d(j.data.user)}).catch(async()=>{try{(await Vl("/health")).status==="ok"&&d({id:"local",email:"admin@localhost",name:"Admin",role:"admin"})}catch{}}).finally(()=>m(!1))},[]);const f=u.useCallback(async(j,y)=>{const w=await Vl("/auth/login",{method:"POST",body:JSON.stringify({email:j,password:y})});d(w.data.user)},[]),h=u.useCallback(async()=>{await Vl("/auth/logout",{method:"POST"}).catch(()=>{}),d(null)},[]),b=u.useCallback(async(j,y,w)=>{await Vl("/auth/register",{method:"POST",body:JSON.stringify({email:j,password:y,name:w})})},[]),g=(r==null?void 0:r.role)==="admin",p=u.useCallback((j,y)=>{if(!r)return!1;const w=Lv[r.role];if(!w)return!1;const C=w[j];return C?C.includes(y)||C.includes("admin"):!1},[r]);return t.jsx(j0.Provider,{value:{user:r,loading:o,login:f,logout:h,register:b,isAdmin:g,hasPermission:p},children:n})}function ai(){return u.useContext(j0)}const $v=[{to:"/missions",icon:qa,labelKey:"nav.missions"},{to:"/chat",icon:js,labelKey:"nav.chat"},{to:"/agents",icon:Ka,labelKey:"nav.agents"},{to:"/workflows",icon:Br,labelKey:"nav.workflows"},{to:"/runs",icon:jt,labelKey:"nav.history"}],N0=[{key:"tools",label:"Tools",defaultOpen:!1,items:[{to:"/skills",icon:Xr,labelKey:"nav.skills"},{to:"/memory",icon:Ks,labelKey:"nav.memory"},{to:"/plans",icon:lv,labelKey:"nav.plans"},{to:"/guardrails",icon:Ns,labelKey:"nav.guardrails"}]},{key:"monitoring",label:"Monitoring",defaultOpen:!1,items:[{to:"/analytics",icon:ga,labelKey:"nav.analytics"},{to:"/budget",icon:ya,labelKey:"nav.budget"},{to:"/traces",icon:Kt,labelKey:"nav.traces"},{to:"/approvals",icon:Pd,labelKey:"nav.approvals"}]},{key:"advanced",label:"Advanced",defaultOpen:!1,items:[{to:"/goals",icon:Xs,labelKey:"nav.goals"},{to:"/handoffs",icon:_r,labelKey:"nav.handoffs"},{to:"/keys",icon:ti,labelKey:"nav.apiKeys"},{to:"/settings",icon:Yn,labelKey:"nav.settings"}]}],Hv=[{to:"/users",icon:Xn,labelKey:"nav.users"},{to:"/admin",icon:Yn,labelKey:"nav.admin"}],w0="nestor_sidebar_sections";function qv(){try{const r=localStorage.getItem(w0);if(r)return JSON.parse(r)}catch{}const n={};for(const r of N0)n[r.key]=r.defaultOpen;return n}function Gv(n){try{localStorage.setItem(w0,JSON.stringify(n))}catch{}}function Kv({onNavigate:n}){const{t:r}=We(),{user:d,isAdmin:o,logout:m}=ai(),[f,h]=u.useState(qv);u.useEffect(()=>{Gv(f)},[f]);const b=u.useCallback(p=>{h(j=>({...j,[p]:!j[p]}))},[]),g=({isActive:p})=>`flex items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium transition-colors ${p?"bg-purple-500/10 text-purple-400":"text-zinc-400 hover:bg-surface-hover hover:text-zinc-200"}`;return t.jsxs("aside",{className:"fixed inset-y-0 left-0 z-30 flex w-60 flex-col border-r border-border bg-surface",children:[t.jsxs("div",{className:"flex h-14 items-center gap-2.5 px-5 border-b border-border",children:[t.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-purple-600 text-white",children:t.jsx(qa,{className:"h-4 w-4"})}),t.jsxs("span",{className:"text-lg font-semibold text-white tracking-tight",children:["Nestor ",t.jsx("span",{className:"text-xs font-normal text-zinc-500",children:"Studio"})]})]}),t.jsxs("nav",{className:"flex-1 space-y-0.5 px-3 py-4 overflow-y-auto",children:[$v.map(p=>{const j=p.icon;return t.jsxs(Zl,{to:p.to,end:p.to==="/chat",onClick:n,className:g,children:[t.jsx(j,{className:"h-4 w-4 flex-shrink-0"}),r(p.labelKey)]},p.to)}),N0.map(p=>t.jsxs("div",{className:"mt-2",children:[t.jsxs("button",{onClick:()=>b(p.key),className:"flex items-center gap-2 w-full px-3 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-zinc-600 hover:text-zinc-400 transition-colors",children:[f[p.key]?t.jsx(Va,{className:"h-3 w-3"}):t.jsx(aa,{className:"h-3 w-3"}),p.label]}),f[p.key]&&t.jsx("div",{className:"space-y-0.5",children:p.items.map(j=>{const y=j.icon;return t.jsxs(Zl,{to:j.to,onClick:n,className:g,children:[t.jsx(y,{className:"h-4 w-4 flex-shrink-0"}),r(j.labelKey)]},j.to)})})]},p.key)),o&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"my-2 border-t border-border/50"}),t.jsx("div",{className:"px-3 py-1 text-[10px] font-semibold uppercase tracking-wider text-zinc-600",children:"Admin"}),Hv.map(p=>{const j=p.icon;return t.jsxs(Zl,{to:p.to,onClick:n,className:g,children:[t.jsx(j,{className:"h-4 w-4 flex-shrink-0"}),r(p.labelKey)]},p.to)})]})]}),t.jsxs("div",{className:"border-t border-border px-4 py-3",children:[d&&t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"truncate text-sm font-medium text-zinc-200",children:d.name}),t.jsx("p",{className:"truncate text-xs text-zinc-500",children:d.role})]}),t.jsx("button",{onClick:m,className:"rounded p-1.5 text-zinc-400 transition-colors hover:bg-surface-hover hover:text-zinc-200",title:"Sign out",children:t.jsx(xv,{className:"h-4 w-4"})})]}),t.jsx("p",{className:"mt-2 text-xs text-zinc-600",children:"Nestor v2.3.0"})]})]})}const Vv=["system","agents","runs","approvals"],Yv=10,Xv=1e3,Qv=3e4,Zv=3e4,Jv=200;function Fv(n,r,d){const o=Math.min(r*2**n,d),m=o*Math.random()*.25;return o+m}function Iv(){const n=window.location.protocol==="https:"?"wss:":"ws:",r=window.location.host,d=localStorage.getItem("nestor_token"),o=d?`?token=${encodeURIComponent(d)}`:"";return`${n}//${r}/ws${o}`}function eu(n=Vv,r){const{reconnect:d=!0,maxRetries:o=Yv,baseDelay:m=Xv,maxDelay:f=Qv}={},[h,b]=u.useState([]),[g,p]=u.useState("disconnected"),[j,y]=u.useState(0),w=u.useRef(null),C=u.useRef(),k=u.useRef(),N=u.useRef(n),S=u.useRef(!1),z=u.useRef(0);N.current=n;const M=u.useCallback(()=>{C.current&&(clearTimeout(C.current),C.current=void 0)},[]),O=u.useCallback(()=>{k.current&&(clearInterval(k.current),k.current=void 0)},[]),E=u.useCallback(le=>{O(),k.current=setInterval(()=>{le.readyState===WebSocket.OPEN&&le.send(JSON.stringify({type:"ping"}))},Zv)},[O]),ae=u.useCallback((le,F)=>{for(const re of F)le.readyState===WebSocket.OPEN&&le.send(JSON.stringify({type:"subscribe",channel:re}))},[]),ce=u.useCallback(le=>{if(!d||S.current)return;if(z.current>=o){console.warn(`[Nestor WS] Max retries (${o}) reached. Giving up.`),p("disconnected");return}const F=Fv(z.current,m,f);console.info(`[Nestor WS] Reconnecting in ${Math.round(F)}ms (attempt ${z.current+1}/${o})`),p("reconnecting"),M(),C.current=setTimeout(()=>{z.current+=1,y(z.current),le()},F)},[d,o,m,f,M]),H=u.useCallback(()=>{if(!(w.current&&(w.current.readyState===WebSocket.OPEN||w.current.readyState===WebSocket.CONNECTING)))try{const le=Iv(),F=new WebSocket(le);w.current=F,p("connecting"),F.onopen=()=>{console.info("[Nestor WS] Connected"),p("connected"),z.current=0,y(0),S.current=!1,ae(F,N.current),E(F)},F.onmessage=re=>{try{const he=JSON.parse(re.data);if(he.type==="ping"){F.send(JSON.stringify({type:"pong"}));return}if(he.type==="pong")return;if(he.type==="event"){const K=he;b(_=>[..._.slice(-(Jv-1)),K])}}catch{}},F.onclose=re=>{if(console.info(`[Nestor WS] Closed (code=${re.code}, reason=${re.reason||"none"})`),w.current=null,O(),S.current){p("disconnected");return}ce(H)},F.onerror=re=>{console.error("[Nestor WS] Error:",re),F.close()}}catch{ce(H)}},[ae,E,O,ce]);u.useEffect(()=>(S.current=!1,H(),()=>{S.current=!0,M(),O(),w.current&&(w.current.close(1e3,"Component unmount"),w.current=null)}),[H,M,O]),u.useEffect(()=>{const le=w.current;!le||le.readyState!==WebSocket.OPEN||ae(le,n)},[n,ae]);const G=u.useCallback(le=>{const F=w.current;F&&F.readyState===WebSocket.OPEN&&F.send(JSON.stringify({type:"subscribe",channel:le}))},[]),P=u.useCallback(le=>{const F=w.current;F&&F.readyState===WebSocket.OPEN&&F.send(JSON.stringify({type:"unsubscribe",channel:le}))},[]),W=u.useCallback(()=>{b([])},[]),Q=u.useCallback(()=>{S.current=!0,M(),O(),w.current&&(w.current.close(1e3,"Manual close"),w.current=null),p("disconnected")},[M,O]);return{events:h,connected:g==="connected",status:g,retryCount:j,subscribe:G,unsubscribe:P,clearEvents:W,close:Q}}const Pv="/api";class Wv extends Error{constructor(r,d,o){super(`API Error ${r}: ${d}`),this.status=r,this.statusText=d,this.body=o,this.name="ApiError"}}function ej(n){const r=document.cookie.match(new RegExp(`(?:^|; )${n}=([^;]*)`));return r?decodeURIComponent(r[1]):null}async function se(n,r={}){const d=`${Pv}${n}`,o={"Content-Type":"application/json",...r.headers},m=localStorage.getItem("nestor_token");m&&(o.Authorization=`Bearer ${m}`);const f=(r.method||"GET").toUpperCase();if(f!=="GET"&&f!=="HEAD"){const g=ej("nestor-csrf");g&&(o["X-CSRF-Token"]=g)}const h=localStorage.getItem("nestor_tenant_id");h&&(o["X-Tenant-ID"]=h);const b=await fetch(d,{...r,headers:o});if(!b.ok){let g;try{g=await b.json()}catch{g=await b.text()}throw new Wv(b.status,b.statusText,g)}if(b.status!==204)return b.json()}const ws={list:n=>{const r=new URLSearchParams;n!=null&&n.limit&&r.set("limit",String(n.limit)),n!=null&&n.offset&&r.set("offset",String(n.offset));const d=r.toString();return se(`/agents${d?`?${d}`:""}`)},get:n=>se(`/agents/${n}`),create:n=>se("/agents",{method:"POST",body:JSON.stringify(n)}),update:(n,r)=>se(`/agents/${n}`,{method:"PATCH",body:JSON.stringify(r)}),delete:n=>se(`/agents/${n}`,{method:"DELETE"}),run:(n,r)=>se(`/agents/${n}/run`,{method:"POST",body:JSON.stringify({prompt:r})}),getStatus:n=>se(`/agents/${n}/status`),start:(n,r="daemon")=>se(`/agents/${n}/start`,{method:"POST",body:JSON.stringify({mode:r})}),stop:n=>se(`/agents/${n}/stop`,{method:"POST"})},tu={list:n=>{const r=new URLSearchParams;n!=null&&n.limit&&r.set("limit",String(n.limit)),n!=null&&n.offset&&r.set("offset",String(n.offset));const d=r.toString();return se(`/workflows${d?`?${d}`:""}`)},get:n=>se(`/workflows/${n}`),create:n=>se("/workflows",{method:"POST",body:JSON.stringify(n)}),run:(n,r={})=>se(`/workflows/${n}/run`,{method:"POST",body:JSON.stringify({input:r})})},Vs={list:n=>{const r=new URLSearchParams;n!=null&&n.limit&&r.set("limit",String(n.limit)),n!=null&&n.offset&&r.set("offset",String(n.offset)),n!=null&&n.status&&r.set("status",n.status),n!=null&&n.agentId&&r.set("agentId",n.agentId),n!=null&&n.workflowId&&r.set("workflowId",n.workflowId);const d=r.toString();return se(`/runs${d?`?${d}`:""}`)},get:n=>se(`/runs/${n}`),getEvents:n=>se(`/runs/${n}/events`),abort:n=>se(`/runs/${n}/abort`,{method:"POST"}),delete:n=>se(`/runs/${n}`,{method:"DELETE"})},Or={list:n=>{const r=new URLSearchParams;n!=null&&n.limit&&r.set("limit",String(n.limit)),n!=null&&n.offset&&r.set("offset",String(n.offset));const d=r.toString();return se(`/skills${d?`?${d}`:""}`)},install:n=>se("/skills/install",{method:"POST",body:JSON.stringify(n)}),scan:n=>se("/skills/scan",{method:"POST",body:JSON.stringify({path:n})}),delete:n=>se(`/skills/${n}`,{method:"DELETE"})},pa={stats:()=>se("/system/stats"),health:()=>se("/health"),getConfig:()=>se("/system/config"),updateConfig:n=>se("/system/config",{method:"PUT",body:JSON.stringify(n)})},wr={summary:n=>{const r=new URLSearchParams;n!=null&&n.from&&r.set("from",String(n.from)),n!=null&&n.to&&r.set("to",String(n.to)),n!=null&&n.agentId&&r.set("agentId",n.agentId);const d=r.toString();return se(`/analytics/summary${d?`?${d}`:""}`)},daily:(n=30)=>se(`/analytics/daily?days=${n}`),budget:()=>se("/analytics/budget"),estimate:()=>se("/analytics/estimate"),agentBreakdown:n=>se(`/analytics/agents/${n}`),qualityOverview:(n=30)=>se(`/analytics/quality?days=${n}`),qualityAgent:(n,r=30)=>se(`/analytics/quality/${n}?days=${r}`)},wd={list:n=>{const r=new URLSearchParams;n!=null&&n.limit&&r.set("limit",String(n.limit)),n!=null&&n.status&&r.set("status",n.status);const d=r.toString();return se(`/traces${d?`?${d}`:""}`)},get:n=>se(`/traces/${n}`),clear:()=>se("/traces",{method:"DELETE"})},Ah={list:()=>se("/tenants"),get:n=>se(`/tenants/${n}`),create:n=>se("/tenants",{method:"POST",body:JSON.stringify(n)}),update:(n,r)=>se(`/tenants/${n}`,{method:"PUT",body:JSON.stringify(r)}),delete:n=>se(`/tenants/${n}`,{method:"DELETE"}),switch:n=>se(`/tenants/${n}/switch`,{method:"POST"})},Yl={tree:()=>se("/goals"),get:n=>se(`/goals/${n}`),create:n=>se("/goals",{method:"POST",body:JSON.stringify(n)}),update:(n,r)=>se(`/goals/${n}`,{method:"PUT",body:JSON.stringify(r)}),delete:n=>se(`/goals/${n}`,{method:"DELETE"}),ancestry:n=>se(`/goals/${n}/ancestry`),assign:(n,r)=>se(`/goals/${n}/assign/${r}`,{method:"POST"}),agentGoals:n=>se(`/agents/${n}/goals`)},Xl={list:n=>{const r=new URLSearchParams;n!=null&&n.status&&r.set("status",n.status),n!=null&&n.agentId&&r.set("agentId",n.agentId),n!=null&&n.type&&r.set("type",n.type),n!=null&&n.limit&&r.set("limit",String(n.limit)),n!=null&&n.offset&&r.set("offset",String(n.offset));const d=r.toString();return se(`/approvals${d?`?${d}`:""}`)},create:n=>se("/approvals",{method:"POST",body:JSON.stringify(n)}),get:n=>se(`/approvals/${n}`),approve:(n,r)=>se(`/approvals/${n}/approve`,{method:"POST",body:JSON.stringify({decidedBy:(r==null?void 0:r.reviewerId)??"user",comment:r==null?void 0:r.comment})}),reject:(n,r)=>se(`/approvals/${n}/reject`,{method:"POST",body:JSON.stringify({decidedBy:(r==null?void 0:r.reviewerId)??"user",reason:r==null?void 0:r.reason})}),history:n=>{const r=new URLSearchParams;n!=null&&n.limit&&r.set("limit",String(n.limit)),n!=null&&n.agentId&&r.set("agentId",n.agentId);const d=r.toString();return se(`/approvals/history${d?`?${d}`:""}`)},stats:()=>se("/approvals/stats")},Sd={forRun:n=>se(`/runs/${n}/annotations`),create:(n,r)=>se(`/runs/${n}/annotate`,{method:"POST",body:JSON.stringify(r)}),delete:n=>se(`/annotations/${n}`,{method:"DELETE"})},$r={list:n=>{const r=new URLSearchParams;n!=null&&n.status&&r.set("status",n.status);const d=r.toString();return se(`/handoffs${d?`?${d}`:""}`)},get:n=>se(`/handoffs/${n}`),create:(n,r)=>se(`/runs/${n}/handoff`,{method:"POST",body:JSON.stringify(r)}),resume:(n,r)=>se(`/handoffs/${n}/resume`,{method:"POST",body:JSON.stringify({humanResolution:r})})},vt={overview:()=>se("/admin/overview"),tenants:{list:()=>se("/tenants"),create:n=>se("/tenants",{method:"POST",body:JSON.stringify(n)}),get:n=>se(`/tenants/${n}`),update:(n,r)=>se(`/tenants/${n}`,{method:"PUT",body:JSON.stringify(r)})},users:{list:n=>{const r=new URLSearchParams;n!=null&&n.tenantId&&r.set("tenantId",n.tenantId),n!=null&&n.role&&r.set("role",n.role);const d=r.toString();return se(`/users${d?`?${d}`:""}`)},updateRole:(n,r)=>se(`/users/${n}`,{method:"PATCH",body:JSON.stringify({role:r})}),lock:n=>se(`/users/${n}`,{method:"PATCH",body:JSON.stringify({isActive:!1})}),unlock:n=>se(`/users/${n}`,{method:"PATCH",body:JSON.stringify({isActive:!0})})},system:{info:()=>se("/admin/system-info"),dbStats:()=>se("/admin/db-stats"),rateLimitStats:()=>se("/admin/rate-limit-stats")},audit:{query:n=>{const r=new URLSearchParams;n!=null&&n.userId&&r.set("userId",n.userId),n!=null&&n.resourceType&&r.set("resourceType",n.resourceType),n!=null&&n.action&&r.set("action",n.action),n!=null&&n.limit&&r.set("limit",String(n.limit));const d=r.toString();return se(`/users/audit${d?`?${d}`:""}`)},export:n=>se(`/users/audit?limit=10000&format=${n}`)},security:{failedLogins:(n=24)=>se(`/admin/security/failed-logins?hours=${n}`),lockedAccounts:()=>se("/admin/security/locked-accounts"),activeSessions:()=>se("/admin/security/active-sessions"),rateLimitViolations:(n=100)=>se(`/admin/security/rate-violations?limit=${n}`)}},Eh={status:()=>se("/providers/status"),test:n=>se("/providers/test",{method:"POST",body:JSON.stringify(n)})},oa={list:()=>se("/keys"),set:(n,r,d)=>se("/keys",{method:"POST",body:JSON.stringify({provider:n,key:r,label:d})}),remove:n=>se(`/keys/${n}`,{method:"DELETE"}),test:n=>se(`/keys/test/${n}`)},Ql={plan:(n,r)=>se("/missions/plan",{method:"POST",body:JSON.stringify({objective:n,...r})}),list:()=>se("/missions"),get:n=>se(`/missions/${n}`),getReport:(n,r)=>se(`/missions/${n}/report${r==="md"?"?format=md":""}`),cancel:n=>se(`/missions/${n}/cancel`,{method:"POST"})};function tj({onMenuClick:n,showMenu:r}){const{lang:d,setLang:o,t:m}=We(),{connected:f}=eu(),[h,b]=u.useState([]),[g,p]=u.useState(()=>localStorage.getItem("nestor_tenant_id")??"default"),[j,y]=u.useState(!1),[w,C]=u.useState(!1),k=u.useRef(null),N=u.useRef(null),S=h.find(E=>E.id===g)??null,z=u.useCallback(async()=>{try{const E=await Ah.list();b(E.data)}catch{}},[]);u.useEffect(()=>{z()},[z]),u.useEffect(()=>{const E=ae=>{k.current&&!k.current.contains(ae.target)&&y(!1),N.current&&!N.current.contains(ae.target)&&C(!1)};return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[]);const M=async E=>{try{await Ah.switch(E.id),localStorage.setItem("nestor_tenant_id",E.id),p(E.id),y(!1),window.location.reload()}catch(ae){console.error("Failed to switch tenant:",ae)}},O=Object.keys(Ld);return t.jsxs("header",{className:"header sticky top-0 z-20 flex h-14 items-center justify-between border-b border-border bg-[#0a0a0f]/80 px-6 backdrop-blur-sm",children:[t.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[r&&t.jsx("button",{onClick:n,className:"p-2 hover:bg-surface-hover rounded-lg transition-colors","aria-label":"Toggle menu",children:t.jsx(fv,{className:"h-5 w-5 text-zinc-400"})}),t.jsxs("div",{className:"relative max-w-md flex-1",children:[t.jsx(Js,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-zinc-500"}),t.jsx("input",{type:"text",placeholder:m("common.search"),className:"input pl-9 max-w-sm"})]})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[h.length>0&&t.jsxs("div",{className:"relative hidden sm:block",ref:k,children:[t.jsxs("button",{onClick:()=>y(!j),className:"flex items-center gap-2 rounded-lg border border-border bg-surface px-3 py-1.5 text-sm transition-colors hover:border-zinc-600",children:[t.jsx(Xd,{className:"h-3.5 w-3.5 text-indigo-400"}),t.jsx("span",{className:"text-zinc-200 max-w-[120px] truncate",children:(S==null?void 0:S.name)??"Default"}),t.jsx(Va,{className:`h-3.5 w-3.5 text-zinc-500 transition-transform ${j?"rotate-180":""}`})]}),j&&t.jsxs("div",{className:"absolute right-0 top-full mt-1 w-56 rounded-lg border border-border bg-surface shadow-xl z-50",children:[t.jsx("div",{className:"px-3 py-2 text-[10px] font-semibold uppercase tracking-wider text-zinc-600",children:"Switch Tenant"}),t.jsx("div",{className:"max-h-64 overflow-y-auto py-1",children:h.map(E=>t.jsxs("button",{onClick:()=>M(E),className:"flex w-full items-center gap-2 px-3 py-2 text-sm text-zinc-300 transition-colors hover:bg-surface-hover",children:[E.id===g?t.jsx(ht,{className:"h-3.5 w-3.5 text-indigo-400"}):t.jsx("div",{className:"h-3.5 w-3.5"}),t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx("div",{className:"font-medium",children:E.name}),t.jsx("div",{className:"text-xs text-zinc-500",children:E.slug})]})]},E.id))})]})]}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[f?t.jsx(Tv,{className:"h-4 w-4 text-green-400"}):t.jsx(Ev,{className:"h-4 w-4 text-zinc-500"}),t.jsx("span",{className:`text-xs hidden sm:inline ${f?"text-green-400":"text-zinc-500"}`,children:f?"Connected":"Offline"})]}),t.jsxs("div",{className:"relative",ref:N,children:[t.jsxs("button",{onClick:()=>C(!w),className:"btn-ghost btn-sm flex items-center gap-1.5",title:"Switch language",children:[t.jsx(Zd,{className:"h-4 w-4"}),t.jsx("span",{className:"text-xs uppercase",children:d}),t.jsx(Va,{className:`h-3 w-3 text-zinc-500 transition-transform ${w?"rotate-180":""}`})]}),w&&t.jsx("div",{className:"absolute right-0 top-full mt-1 w-48 rounded-lg border border-border bg-surface shadow-xl z-50 max-h-80 overflow-y-auto",children:O.map(E=>t.jsxs("button",{onClick:()=>{o(E),C(!1)},className:"flex w-full items-center gap-2 px-3 py-2 text-sm text-zinc-300 transition-colors hover:bg-surface-hover",children:[E===d?t.jsx(ht,{className:"h-3.5 w-3.5 text-indigo-400"}):t.jsx("div",{className:"h-3.5 w-3.5"}),t.jsx("span",{className:"flex-1 text-left",children:Ld[E]}),t.jsx("span",{className:"text-xs text-zinc-500 uppercase",children:E})]},E))})]})]})]})}const aj=[{to:"/",icon:js,labelKey:"nav.chat"},{to:"/agents",icon:Ka,labelKey:"nav.agents"},{to:"/dashboard",icon:Jd,labelKey:"nav.dashboard"},{to:"/runs",icon:jt,labelKey:"nav.history"},{to:"/settings",icon:Yn,labelKey:"nav.settings"}];function sj(){const{t:n}=We();return t.jsx("nav",{className:"mobile-bottom-nav",children:aj.map(r=>{const d=r.icon;return t.jsxs(Zl,{to:r.to,end:r.to==="/",className:({isActive:o})=>`mobile-bottom-nav-item ${o?"active":""}`,children:[t.jsx(d,{className:"h-5 w-5"}),t.jsx("span",{className:"mobile-bottom-nav-label",children:n(r.labelKey)})]},r.to)})})}function nj(){const[n,r]=u.useState(!1),[d,o]=u.useState(!1);u.useEffect(()=>{const f=()=>o(window.innerWidth<769);return f(),window.addEventListener("resize",f),()=>window.removeEventListener("resize",f)},[]);const m=()=>{d&&r(!1)};return t.jsxs("div",{className:"flex min-h-screen bg-[#0a0a0f]",children:[d&&n&&t.jsx("div",{className:"sidebar-overlay",onClick:()=>r(!1)}),t.jsx("div",{className:`sidebar ${d&&n?"open":""}`,children:t.jsx(Kv,{onNavigate:m})}),t.jsxs("div",{className:`flex flex-1 flex-col ${d?"":"pl-60"}`,children:[t.jsx(tj,{onMenuClick:()=>r(!n),showMenu:d}),t.jsx("main",{className:`main-content flex-1 p-6 ${d?"pb-20":""}`,children:t.jsx(hy,{})}),d&&t.jsx(sj,{})]})]})}class lj extends u.Component{constructor(){super(...arguments);ud(this,"state",{hasError:!1,error:null});ud(this,"handleReset",()=>{this.setState({hasError:!1,error:null})})}static getDerivedStateFromError(d){return{hasError:!0,error:d}}componentDidCatch(d,o){var m,f;console.error("[Nestor] UI Error:",d,o),(f=(m=this.props).onError)==null||f.call(m,d,o)}render(){var d;return this.state.hasError?this.props.fallback?this.props.fallback:t.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] p-8",children:[t.jsx("div",{className:"text-red-500 text-xl mb-4",children:"Something went wrong"}),t.jsx("pre",{className:"bg-gray-100 dark:bg-gray-800 p-4 rounded-lg text-sm max-w-lg overflow-auto mb-4",children:(d=this.state.error)==null?void 0:d.message}),t.jsx("button",{onClick:this.handleReset,className:"px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors",children:"Try Again"})]}):this.props.children}}function ij(){const n=Rt();return t.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[60vh] p-8 text-center",children:[t.jsx("div",{className:"w-16 h-16 mb-6 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:t.jsx("svg",{className:"w-8 h-8 text-red-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"})})}),t.jsx("h2",{className:"text-2xl font-semibold text-gray-900 dark:text-gray-100 mb-2",children:"Page Error"}),t.jsx("p",{className:"text-gray-500 dark:text-gray-400 mb-8 max-w-md",children:"An unexpected error occurred while rendering this page. The error has been logged for investigation."}),t.jsxs("div",{className:"flex gap-3",children:[t.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors",children:"Reload Page"}),t.jsx("button",{onClick:()=>n("/"),className:"px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors",children:"Go Home"})]})]})}const rj={node_started:{icon:jt,color:"text-blue-400"},node_completed:{icon:ct,color:"text-green-400"},node_failed:{icon:wt,color:"text-red-400"},tool_call_requested:{icon:qa,color:"text-amber-400"},tool_call_approved:{icon:ct,color:"text-green-400"},tool_call_denied:{icon:ba,color:"text-red-400"},tool_call_completed:{icon:ct,color:"text-emerald-400"},approval_requested:{icon:ba,color:"text-amber-400"},approval_resolved:{icon:ct,color:"text-green-400"},budget_warning:{icon:lt,color:"text-amber-400"},budget_exceeded:{icon:ya,color:"text-red-400"},run_paused:{icon:Yr,color:"text-blue-400"},run_resumed:{icon:g0,color:"text-blue-400"}};function cj(n){try{return new Date(n).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return n}}function oj(n,r){switch(n){case"node_started":return`Node started: ${r.nodeId??r.label??""}`;case"node_completed":return`Node completed: ${r.nodeId??r.label??""}`;case"node_failed":return`Node failed: ${r.error??r.nodeId??""}`;case"tool_call_requested":return`Tool call: ${r.toolName??""}`;case"tool_call_approved":return`Tool approved: ${r.toolName??""}`;case"tool_call_denied":return`Tool denied: ${r.toolName??""}`;case"tool_call_completed":return`Tool completed: ${r.toolName??""}`;case"approval_requested":return`Approval required: ${r.toolName??r.action??""}`;case"approval_resolved":return`Approval resolved: ${r.decision??""}`;case"budget_warning":return`Budget warning: ${r.percent??""}% used`;case"budget_exceeded":return"Budget exceeded";case"run_paused":return"Run paused";case"run_resumed":return"Run resumed";default:return n.replace(/_/g," ")}}function au({events:n,maxHeight:r="400px"}){return n.length===0?t.jsxs("div",{className:"flex items-center justify-center py-8 text-sm text-zinc-500",children:[t.jsx(Ys,{className:"mr-2 h-4 w-4"}),"Waiting for events..."]}):t.jsx("div",{className:"overflow-y-auto",style:{maxHeight:r},children:t.jsx("div",{className:"space-y-0.5",children:[...n].reverse().map(d=>{const o=rj[d.type]??{icon:qa,color:"text-zinc-400"},m=o.icon;return t.jsxs("div",{className:"flex items-start gap-3 rounded-lg px-3 py-2 hover:bg-surface-hover transition-colors",children:[t.jsx("div",{className:`mt-0.5 flex-shrink-0 ${o.color}`,children:t.jsx(m,{className:"h-4 w-4"})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"text-sm text-zinc-300 truncate",children:oj(d.type,d.data)}),d.nodeId&&t.jsxs("p",{className:"text-xs text-zinc-500 truncate",children:["Node: ",d.nodeId]})]}),t.jsx("time",{className:"flex-shrink-0 text-xs text-zinc-500",children:cj(d.timestamp)})]},d.id)})})})}function Sr({label:n,value:r,icon:d,color:o,bgColor:m}){return t.jsx("div",{className:"card",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-sm text-zinc-400",children:n}),t.jsx("p",{className:"mt-1 text-2xl font-semibold text-white",children:r})]}),t.jsx("div",{className:`flex h-11 w-11 items-center justify-center rounded-xl ${m}`,children:t.jsx(d,{className:`h-5 w-5 ${o}`})})]})})}function dj(){const{t:n}=We(),{events:r}=eu(),[d,o]=u.useState(null),[m,f]=u.useState("healthy"),[h,b]=u.useState(!0),[g,p]=u.useState(null);u.useEffect(()=>{pa.stats().then(k=>{o(k.data),f("healthy"),p(null)}).catch(k=>{f("down"),p(k instanceof Error?k.message:"Failed to connect to server")}).finally(()=>{b(!1)}),pa.health().then(k=>{f(k.status==="healthy"?"healthy":"degraded")}).catch(()=>{f("down")})},[]),u.useEffect(()=>{r.length!==0&&pa.stats().then(k=>o(k.data)).catch(()=>{})},[r.length]);const y={healthy:{icon:ct,color:"text-green-400",bg:"bg-green-500/10",label:"All systems operational"},degraded:{icon:lt,color:"text-amber-400",bg:"bg-amber-500/10",label:"Some services degraded"},down:{icon:wt,color:"text-red-400",bg:"bg-red-500/10",label:"Services unavailable"}}[m],w=y.icon,C=r.map((k,N)=>{var S;return{id:String(N),type:typeof k.data=="object"&&k.data!==null&&"kind"in k.data?k.data.kind:k.channel,data:k.data??{},timestamp:((S=k.data)==null?void 0:S.timestamp)??new Date().toISOString()}});return h?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})}):t.jsxs("div",{className:"space-y-6",children:[t.jsx("h1",{className:"text-2xl font-semibold text-white",children:n("dashboard.title")}),g&&t.jsxs("div",{className:"rounded-lg border border-red-500/20 bg-red-500/5 p-4 text-sm text-red-400",children:["Unable to connect to the Nestor server. Make sure the server is running.",t.jsx("span",{className:"ml-2 text-xs text-red-500/70",children:g})]}),t.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[t.jsx(Sr,{label:n("dashboard.activeAgents"),value:(d==null?void 0:d.agents.total)??0,icon:Ka,color:"text-indigo-400",bgColor:"bg-indigo-500/10"}),t.jsx(Sr,{label:n("dashboard.runningTasks"),value:(d==null?void 0:d.runs.running)??0,icon:jt,color:"text-emerald-400",bgColor:"bg-emerald-500/10"}),t.jsx(Sr,{label:n("dashboard.costToday"),value:"$0.00",icon:ya,color:"text-amber-400",bgColor:"bg-amber-500/10"}),t.jsx(Sr,{label:n("dashboard.skillsInstalled"),value:(d==null?void 0:d.skills.total)??0,icon:Xr,color:"text-violet-400",bgColor:"bg-violet-500/10"})]}),t.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-3",children:[t.jsxs("div",{className:"card lg:col-span-2",children:[t.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[t.jsx("h2",{className:"text-lg font-medium text-zinc-200",children:n("dashboard.recentActivity")}),t.jsx(Kt,{className:"h-4 w-4 text-zinc-500"})]}),t.jsx(au,{events:C,maxHeight:"300px"})]}),t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"card",children:[t.jsx("h2",{className:"mb-4 text-lg font-medium text-zinc-200",children:n("dashboard.quickActions")}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(Ha,{to:"/agents",className:"btn-secondary w-full justify-start",children:[t.jsx(pt,{className:"h-4 w-4"}),n("dashboard.createAgent")]}),t.jsxs(Ha,{to:"/workflows",className:"btn-secondary w-full justify-start",children:[t.jsx(Br,{className:"h-4 w-4"}),n("dashboard.runWorkflow")]}),t.jsxs(Ha,{to:"/skills",className:"btn-secondary w-full justify-start",children:[t.jsx(Ur,{className:"h-4 w-4"}),n("dashboard.installSkill")]})]})]}),t.jsxs("div",{className:"card",children:[t.jsx("h2",{className:"mb-4 text-lg font-medium text-zinc-200",children:n("dashboard.systemHealth")}),t.jsxs("div",{className:`flex items-center gap-3 rounded-lg p-3 ${y.bg}`,children:[t.jsx(w,{className:`h-5 w-5 ${y.color}`}),t.jsxs("div",{children:[t.jsx("p",{className:`text-sm font-medium ${y.color}`,children:y.label}),t.jsx("p",{className:"text-xs text-zinc-500",children:d?`${d.agents.total} agents | ${d.workflows.total} workflows | ${d.runs.today} runs today`:"Loading..."})]})]}),(d==null?void 0:d.server)&&t.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 text-xs",children:[t.jsxs("div",{className:"rounded bg-[#0a0a0f] p-2",children:[t.jsx("span",{className:"text-zinc-500",children:"Version"}),t.jsx("p",{className:"text-zinc-300 font-mono",children:d.server.version})]}),t.jsxs("div",{className:"rounded bg-[#0a0a0f] p-2",children:[t.jsx("span",{className:"text-zinc-500",children:"Uptime"}),t.jsxs("p",{className:"text-zinc-300 font-mono",children:[Math.floor(d.server.uptime/3600),"h ",Math.floor(d.server.uptime%3600/60),"m"]})]}),t.jsxs("div",{className:"rounded bg-[#0a0a0f] p-2",children:[t.jsx("span",{className:"text-zinc-500",children:"Memory (RSS)"}),t.jsxs("p",{className:"text-zinc-300 font-mono",children:[d.server.memoryUsage.rss," MB"]})]}),t.jsxs("div",{className:"rounded bg-[#0a0a0f] p-2",children:[t.jsx("span",{className:"text-zinc-500",children:"WS Connections"}),t.jsx("p",{className:"text-zinc-300 font-mono",children:d.websocket.connections})]})]})]})]})]})]})}function uj(){const[n,r]=u.useState([]),[d,o]=u.useState(!0),[m,f]=u.useState(null),h=u.useCallback(async()=>{o(!0),f(null);try{const b=await ws.list({limit:200});r(b.data)}catch(b){f(b instanceof Error?b.message:"Failed to fetch agents")}finally{o(!1)}},[]);return u.useEffect(()=>{h()},[h]),{agents:n,loading:d,error:m,refetch:h}}function mj(n){const[r,d]=u.useState(null),[o,m]=u.useState(!0),[f,h]=u.useState(null),b=u.useCallback(async()=>{if(n){m(!0),h(null);try{const g=await ws.get(n);d(g.data)}catch(g){h(g instanceof Error?g.message:"Failed to fetch agent")}finally{m(!1)}}},[n]);return u.useEffect(()=>{b()},[b]),{agent:r,loading:o,error:f,refetch:b}}const Th={running:{bg:"bg-emerald-500/10",text:"text-emerald-400",dot:"bg-emerald-400"},completed:{bg:"bg-green-500/10",text:"text-green-400",dot:"bg-green-400"},failed:{bg:"bg-red-500/10",text:"text-red-400",dot:"bg-red-400"},pending:{bg:"bg-amber-500/10",text:"text-amber-400",dot:"bg-amber-400"},paused:{bg:"bg-blue-500/10",text:"text-blue-400",dot:"bg-blue-400"},cancelled:{bg:"bg-zinc-500/10",text:"text-zinc-400",dot:"bg-zinc-400"},idle:{bg:"bg-zinc-500/10",text:"text-zinc-500",dot:"bg-zinc-500"}};function si({status:n,pulse:r}){const{t:d}=We(),o=Th[n]??Th.idle;return t.jsxs("span",{className:`badge ${o.bg} ${o.text}`,children:[t.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${o.dot} ${r&&n==="running"?"animate-pulse":""}`}),d(`status.${n}`)]})}const xj={builtin:{bg:"bg-indigo-500/10",text:"text-indigo-400"},official:{bg:"bg-blue-500/10",text:"text-blue-400"},trusted:{bg:"bg-emerald-500/10",text:"text-emerald-400"},community:{bg:"bg-amber-500/10",text:"text-amber-400"},local:{bg:"bg-zinc-500/10",text:"text-zinc-400"}};function su({level:n}){const{t:r}=We(),d=xj[n];return t.jsxs("span",{className:`badge ${d.bg} ${d.text}`,children:[n==="builtin"||n==="official"?t.jsx("svg",{className:"h-3 w-3",fill:"currentColor",viewBox:"0 0 20 20",children:t.jsx("path",{fillRule:"evenodd",d:"M6.267 3.455a3.066 3.066 0 001.745-.723 3.066 3.066 0 013.976 0 3.066 3.066 0 001.745.723 3.066 3.066 0 012.812 2.812c.051.643.304 1.254.723 1.745a3.066 3.066 0 010 3.976 3.066 3.066 0 00-.723 1.745 3.066 3.066 0 01-2.812 2.812 3.066 3.066 0 00-1.745.723 3.066 3.066 0 01-3.976 0 3.066 3.066 0 00-1.745-.723 3.066 3.066 0 01-2.812-2.812 3.066 3.066 0 00-.723-1.745 3.066 3.066 0 010-3.976 3.066 3.066 0 00.723-1.745 3.066 3.066 0 012.812-2.812zm7.44 5.252a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}):null,r(`trust.${n}`)]})}function S0({spent:n,limit:r,currency:d="$"}){const o=r>0?Math.min(n/r*100,100):0,m=o>=75,f=o>=90,h=f?"bg-red-500":m?"bg-amber-500":"bg-indigo-500";return t.jsxs("div",{className:"space-y-1.5",children:[t.jsxs("div",{className:"flex items-center justify-between text-xs",children:[t.jsxs("span",{className:"text-zinc-400",children:[d,n.toFixed(2)," / ",d,r.toFixed(2)]}),t.jsxs("span",{className:`font-medium ${f?"text-red-400":m?"text-amber-400":"text-zinc-400"}`,children:[o.toFixed(0),"%"]})]}),t.jsx("div",{className:"h-1.5 w-full rounded-full bg-zinc-800",children:t.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${h}`,style:{width:`${o}%`}})})]})}const fj={anthropic:Ka,openai:Ka,local:rv};function hj({agent:n,status:r="idle",budgetSpent:d=0,budgetLimit:o=10}){const m=fj[n.adapterType]??Ka;return t.jsxs(Ha,{to:`/agents/${n.id}`,className:"card group hover:border-indigo-500/30 hover:bg-surface-hover transition-all duration-200",children:[t.jsxs("div",{className:"flex items-start justify-between",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-indigo-500/10 text-indigo-400 group-hover:bg-indigo-500/20 transition-colors",children:t.jsx(m,{className:"h-5 w-5"})}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-medium text-zinc-200 group-hover:text-white transition-colors",children:n.name}),t.jsxs("p",{className:"text-xs text-zinc-500",children:[n.adapterType," ",n.adapterConfig.model?`/ ${n.adapterConfig.model}`:""]})]})]}),t.jsx(si,{status:r,pulse:!0})]}),n.description&&t.jsx("p",{className:"mt-3 text-sm text-zinc-400 line-clamp-2",children:n.description}),t.jsx("div",{className:"mt-4 flex items-center justify-between",children:t.jsx(su,{level:n.trustLevel})}),t.jsx("div",{className:"mt-3",children:t.jsx(S0,{spent:d,limit:o})})]})}function Qs({icon:n,title:r,description:d,action:o}){return t.jsxs("div",{className:"flex flex-col items-center justify-center py-16 px-4 text-center",children:[t.jsx("div",{className:"mb-4 rounded-2xl bg-surface p-4 text-zinc-500",children:n??t.jsx(ov,{className:"h-8 w-8"})}),t.jsx("h3",{className:"text-lg font-medium text-zinc-300",children:r}),d&&t.jsx("p",{className:"mt-1.5 max-w-sm text-sm text-zinc-500",children:d}),o&&t.jsx("div",{className:"mt-4",children:o})]})}function pj(){const{t:n}=We(),{agents:r,loading:d,error:o,refetch:m}=uj(),[f,h]=u.useState(!1),[b,g]=u.useState(!1),[p,j]=u.useState({name:"",description:"",adapterType:"anthropic",model:"",trustLevel:"community"}),y=async()=>{if(p.name.trim()){g(!0);try{await ws.create({name:p.name,description:p.description||void 0,adapterType:p.adapterType,adapterConfig:p.model?{model:p.model}:{},trustLevel:p.trustLevel}),h(!1),j({name:"",description:"",adapterType:"anthropic",model:"",trustLevel:"community"}),m()}catch(w){console.error("Failed to create agent:",w)}finally{g(!1)}}};return d?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})}):t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h1",{className:"text-2xl font-semibold text-white",children:n("agents.title")}),t.jsxs("button",{onClick:()=>h(!0),className:"btn-primary",children:[t.jsx(pt,{className:"h-4 w-4"}),n("agents.create")]})]}),o&&t.jsxs("div",{className:"rounded-lg border border-red-500/20 bg-red-500/5 p-4 text-sm text-red-400",children:[o,t.jsx("button",{onClick:m,className:"ml-3 underline",children:"Retry"})]}),r.length===0&&!o?t.jsx(Qs,{icon:t.jsx(Ka,{className:"h-8 w-8"}),title:n("agents.empty"),description:n("agents.emptyDesc"),action:t.jsxs("button",{onClick:()=>h(!0),className:"btn-primary",children:[t.jsx(pt,{className:"h-4 w-4"}),n("agents.create")]})}):t.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3",children:r.map(w=>t.jsx(hj,{agent:w},w.id))}),f&&t.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:t.jsxs("div",{className:"w-full max-w-lg rounded-2xl border border-border bg-surface p-6 shadow-2xl",children:[t.jsxs("div",{className:"flex items-center justify-between mb-5",children:[t.jsx("h2",{className:"text-lg font-semibold text-white",children:n("agents.create")}),t.jsx("button",{onClick:()=>h(!1),className:"btn-ghost btn-sm",children:t.jsx(Je,{className:"h-4 w-4"})})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"label",children:n("common.name")}),t.jsx("input",{className:"input",value:p.name,onChange:w=>j({...p,name:w.target.value}),placeholder:"My Agent"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"label",children:n("common.description")}),t.jsx("textarea",{className:"input min-h-[80px] resize-none",value:p.description,onChange:w=>j({...p,description:w.target.value}),placeholder:"What does this agent do?"})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"label",children:"Adapter"}),t.jsxs("select",{className:"input",value:p.adapterType,onChange:w=>j({...p,adapterType:w.target.value}),children:[t.jsx("option",{value:"anthropic",children:"Anthropic (Claude)"}),t.jsx("option",{value:"openai",children:"OpenAI (GPT)"}),t.jsx("option",{value:"gemini",children:"Google (Gemini)"}),t.jsx("option",{value:"grok",children:"xAI (Grok)"}),t.jsx("option",{value:"mistral",children:"Mistral AI"}),t.jsx("option",{value:"ollama",children:"Ollama (Local)"})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"label",children:"Model"}),t.jsx("input",{className:"input",value:p.model,onChange:w=>j({...p,model:w.target.value}),placeholder:"claude-sonnet-4-20250514"})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"label",children:"Trust Level"}),t.jsxs("select",{className:"input",value:p.trustLevel,onChange:w=>j({...p,trustLevel:w.target.value}),children:[t.jsx("option",{value:"builtin",children:"Built-in"}),t.jsx("option",{value:"official",children:"Official"}),t.jsx("option",{value:"trusted",children:"Trusted"}),t.jsx("option",{value:"community",children:"Community"}),t.jsx("option",{value:"local",children:"Local"})]})]})]}),t.jsxs("div",{className:"mt-6 flex justify-end gap-3",children:[t.jsx("button",{onClick:()=>h(!1),className:"btn-secondary",children:n("common.cancel")}),t.jsx("button",{onClick:y,disabled:!p.name.trim()||b,className:"btn-primary",children:n(b?"common.loading":"agents.create")})]})]})})]})}const gj="/api";async function bj(n){const r=localStorage.getItem("nestor_token"),d={"Content-Type":"application/json"};r&&(d.Authorization=`Bearer ${r}`);const o=localStorage.getItem("nestor_tenant_id");o&&(d["X-Tenant-ID"]=o);try{const m=await fetch(`${gj}/agents/${n}/quality`,{headers:d});return m.ok?(await m.json()).data??null:null}catch{return null}}function Rh(n){return`${(n*100).toFixed(0)}%`}function kr({icon:n,label:r,value:d,subtext:o,color:m}){return t.jsxs("div",{className:"rounded-lg bg-zinc-800/50 p-4 border border-zinc-700/50",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[t.jsx(n,{className:`h-4 w-4 ${m}`}),t.jsx("span",{className:"text-xs text-zinc-500 uppercase tracking-wide",children:r})]}),t.jsx("p",{className:`text-2xl font-bold ${m}`,children:d}),o&&t.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:o})]})}function yj({agentId:n}){const[r,d]=u.useState(null),[o,m]=u.useState(!0),f=u.useCallback(async()=>{m(!0);const N=await bj(n);d(N),m(!1)},[n]);if(u.useEffect(()=>{f()},[f]),o)return t.jsxs("div",{className:"card",children:[t.jsx("h2",{className:"mb-4 text-lg font-medium text-zinc-200",children:"Quality"}),t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})})]});if(!r)return t.jsxs("div",{className:"card",children:[t.jsx("h2",{className:"mb-4 text-lg font-medium text-zinc-200",children:"Quality"}),t.jsx("p",{className:"text-sm text-zinc-500",children:"No quality data available yet."})]});const h=r.satisfactionRate>=.8?"text-green-400":r.satisfactionRate>=.5?"text-yellow-400":"text-red-400",b=r.successRate>=.8?"text-green-400":r.successRate>=.5?"text-yellow-400":"text-red-400",g=r.recentFeedback.filter(N=>N.rating===1).length,p=r.recentFeedback.length,j=p>0?g/p:0,y=r.satisfactionRate,w=p<3?"stable":j>y+.1?"improving":j<y-.1?"declining":"stable",C=w==="improving"?Wd:w==="declining"?Cv:hv,k=w==="improving"?"text-green-400":w==="declining"?"text-red-400":"text-zinc-400";return t.jsxs("div",{className:"card",children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsx("h2",{className:"text-lg font-medium text-zinc-200",children:"Quality"}),t.jsxs("div",{className:`flex items-center gap-1 text-xs ${k}`,children:[t.jsx(C,{className:"h-3.5 w-3.5"}),t.jsx("span",{className:"capitalize",children:w})]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:[t.jsx(kr,{icon:Pl,label:"Satisfaction",value:Rh(r.satisfactionRate),subtext:`${r.positiveFeedback}/${r.totalFeedback} positive`,color:h}),t.jsx(kr,{icon:ct,label:"Success Rate",value:Rh(r.successRate),subtext:`${r.completedRuns} completed, ${r.failedRuns} failed`,color:b}),t.jsx(kr,{icon:ya,label:"Avg Cost / Run",value:`$${r.avgCostPerRun.toFixed(4)}`,subtext:`${r.totalRuns} total runs`,color:"text-blue-400"}),t.jsx(kr,{icon:ga,label:"Total Runs",value:r.totalRuns.toString(),subtext:`${r.totalFeedback} rated`,color:"text-indigo-400"})]}),r.recentFeedback.length>0&&t.jsxs("div",{className:"mt-4",children:[t.jsx("h3",{className:"text-xs font-medium text-zinc-500 uppercase tracking-wide mb-2",children:"Recent Feedback"}),t.jsx("div",{className:"space-y-1 max-h-40 overflow-y-auto",children:r.recentFeedback.slice(0,10).map((N,S)=>t.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[t.jsx("span",{className:N.rating===1?"text-green-400":"text-red-400",children:N.rating===1?"+":"-"}),t.jsx("span",{className:"text-zinc-400 flex-1",children:N.comment??(N.rating===1?"Positive":"Negative")}),t.jsx("span",{className:"text-zinc-600 shrink-0",children:new Date(N.createdAt).toLocaleDateString()})]},S))})]})]})}function vj({event:n}){switch(n.type){case"tool_start":return t.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-amber-500/20 bg-amber-500/5 px-3 py-1.5",children:[t.jsx(Qn,{className:"h-3.5 w-3.5 text-amber-400"}),t.jsx("span",{className:"text-xs text-amber-300 font-medium",children:n.name}),t.jsx(ot,{className:"h-3 w-3 text-amber-400 animate-spin"})]});case"tool_result":return t.jsxs("div",{className:`flex items-center gap-2 rounded-md border px-3 py-1.5 ${n.success?"border-emerald-500/20 bg-emerald-500/5":"border-red-500/20 bg-red-500/5"}`,children:[n.success?t.jsx(ct,{className:"h-3.5 w-3.5 text-emerald-400"}):t.jsx(wt,{className:"h-3.5 w-3.5 text-red-400"}),t.jsxs("span",{className:`text-xs font-medium ${n.success?"text-emerald-300":"text-red-300"}`,children:[n.name," ",n.success?"completed":"failed"]})]});case"reasoning":return t.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-yellow-500/20 bg-yellow-500/5 px-3 py-1.5",children:[t.jsx(Md,{className:"h-3.5 w-3.5 text-yellow-400 mt-0.5 shrink-0"}),t.jsxs("div",{className:"min-w-0",children:[n.phase&&t.jsx("span",{className:"text-[10px] uppercase text-yellow-600 font-mono",children:n.phase}),t.jsx("p",{className:"text-xs text-yellow-200/80 break-words",children:n.reasoning}),n.confidence!=null&&t.jsxs("span",{className:"text-[10px] text-yellow-600",children:["confidence: ",(n.confidence*100).toFixed(0),"%"]})]})]});case"error":return t.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-red-500/20 bg-red-500/5 px-3 py-1.5",children:[t.jsx(wt,{className:"h-3.5 w-3.5 text-red-400"}),t.jsx("span",{className:"text-xs text-red-300",children:n.text})]});default:return null}}function jj({runId:n,onComplete:r}){const[d,o]=u.useState(""),[m,f]=u.useState([]),[h,b]=u.useState(!0),g=u.useRef(null),p=u.useRef(0),{subscribe:j,unsubscribe:y,events:w,connected:C}=eu([`run:${n}`]);return u.useEffect(()=>(C&&j(`run:${n}`),()=>{y(`run:${n}`)}),[C,n,j,y]),u.useEffect(()=>{for(const k of w){if(k.channel!==`run:${n}`)continue;const N=k.data;if(!N||N.runId!==n)continue;const S=N.type,z=++p.current;switch(S){case"token":o(M=>M+(N.text??""));break;case"tool_start":f(M=>[...M,{id:z,type:"tool_start",name:N.name,args:N.args,timestamp:Date.now()}]);break;case"tool_result":f(M=>[...M,{id:z,type:"tool_result",name:N.name,result:N.result,success:N.success,timestamp:Date.now()}]);break;case"reasoning":{const M=N.entry;f(O=>[...O,{id:z,type:"reasoning",reasoning:(M==null?void 0:M.reasoning)??N.reasoning??"",phase:(M==null?void 0:M.phase)??void 0,confidence:(M==null?void 0:M.confidence)??void 0,timestamp:Date.now()}]);break}case"error":f(M=>[...M,{id:z,type:"error",text:N.message,timestamp:Date.now()}]);break;case"done":b(!1),r==null||r();break}}},[w,n,r]),u.useEffect(()=>{g.current&&(g.current.scrollTop=g.current.scrollHeight)},[d]),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(p0,{className:`h-3.5 w-3.5 ${h?"text-green-400 animate-pulse":"text-zinc-500"}`}),t.jsx("span",{className:"text-xs font-medium text-zinc-400",children:h?"Live Output":"Run Completed"}),!C&&t.jsx("span",{className:"text-[10px] text-red-400 ml-auto",children:"Disconnected"})]}),t.jsx("div",{ref:g,className:"bg-gray-900 p-4 rounded-lg max-h-96 overflow-y-auto whitespace-pre-wrap font-mono text-sm text-zinc-200 border border-zinc-700",children:d||t.jsx("span",{className:"text-zinc-500 italic",children:h?"Waiting for output...":"No output produced."})}),m.length>0&&t.jsx("div",{className:"space-y-2 max-h-60 overflow-y-auto",children:m.map(k=>t.jsx(vj,{event:k},k.id))})]})}function Nj(){const{id:n}=Vn(),r=Rt(),{t:d}=We(),{agent:o,loading:m,error:f}=mj(n),[h,b]=u.useState("overview"),[g,p]=u.useState(""),[j,y]=u.useState(!1),[w,C]=u.useState(null);if(m)return t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})});if(f||!o)return t.jsxs("div",{className:"flex flex-col items-center justify-center py-20",children:[t.jsx("p",{className:"text-red-400",children:f??"Agent not found"}),t.jsxs("button",{onClick:()=>r("/agents"),className:"btn-secondary mt-4",children:[t.jsx(Hn,{className:"h-4 w-4"})," Back to Agents"]})]});const k=async()=>{var z;if(!(!g.trim()||!n)){y(!0);try{const M=await ws.run(n,g),O=((z=M==null?void 0:M.data)==null?void 0:z.id)??null;C(O),p("")}catch(M){console.error("Run failed:",M)}finally{y(!1)}}},N=async()=>{if(n&&window.confirm(`Delete agent "${o.name}"?`))try{await ws.delete(n),r("/agents")}catch(z){console.error("Delete failed:",z)}},S=[{key:"overview",label:d("agent.overview"),icon:ga},{key:"quality",label:"Quality",icon:Kt},{key:"runs",label:d("agent.runs"),icon:jt},{key:"events",label:d("agent.events"),icon:Kt},{key:"configuration",label:d("agent.configuration"),icon:Yn}];return t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"flex items-start justify-between",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("button",{onClick:()=>r("/agents"),className:"btn-ghost btn-sm",children:t.jsx(Hn,{className:"h-4 w-4"})}),t.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-xl bg-indigo-500/10 text-indigo-400",children:t.jsx(Ka,{className:"h-6 w-6"})}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("h1",{className:"text-2xl font-semibold text-white",children:o.name}),t.jsx(si,{status:"idle"})]}),t.jsxs("p",{className:"text-sm text-zinc-400",children:[o.adapterType,o.adapterConfig.model?` / ${o.adapterConfig.model}`:"",t.jsx("span",{className:"mx-2 text-zinc-600",children:"|"}),t.jsx(su,{level:o.trustLevel})]})]})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("button",{className:"btn-secondary btn-sm",children:[t.jsx(jt,{className:"h-3.5 w-3.5"})," ",d("agent.start")]}),t.jsxs("button",{className:"btn-secondary btn-sm",children:[t.jsx(Nv,{className:"h-3.5 w-3.5"})," ",d("agent.stop")]}),t.jsxs("button",{onClick:N,className:"btn-danger btn-sm",children:[t.jsx(Mt,{className:"h-3.5 w-3.5"})," ",d("agent.delete")]})]})]}),t.jsx("div",{className:"card",children:t.jsxs("div",{className:"flex gap-3",children:[t.jsxs("div",{className:"relative flex-1",children:[t.jsx(y0,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-zinc-500"}),t.jsx("input",{className:"input pl-9",placeholder:"Enter a prompt to run this agent...",value:g,onChange:z=>p(z.target.value),onKeyDown:z=>z.key==="Enter"&&k()})]}),t.jsxs("button",{onClick:k,disabled:!g.trim()||j,className:"btn-primary",children:[t.jsx(jt,{className:"h-4 w-4"}),d(j?"common.loading":"agent.run")]})]})}),w&&t.jsxs("div",{className:"card",children:[t.jsxs("div",{className:"flex items-center justify-between mb-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(p0,{className:"h-4 w-4 text-green-400 animate-pulse"}),t.jsx("h3",{className:"text-sm font-medium text-zinc-200",children:"Live Output"}),t.jsxs("span",{className:"text-[10px] font-mono text-zinc-500",children:[w.slice(0,12),"..."]})]}),t.jsx("button",{onClick:()=>C(null),className:"text-xs text-zinc-500 hover:text-zinc-300 transition-colors",children:"Dismiss"})]}),t.jsx(jj,{runId:w,onComplete:()=>{}})]}),t.jsx("div",{className:"flex gap-1 border-b border-border",children:S.map(({key:z,label:M,icon:O})=>t.jsxs("button",{onClick:()=>b(z),className:`flex items-center gap-2 px-4 py-2.5 text-sm font-medium transition-colors border-b-2 ${h===z?"border-indigo-500 text-indigo-400":"border-transparent text-zinc-400 hover:text-zinc-200"}`,children:[t.jsx(O,{className:"h-4 w-4"}),M]},z))}),h==="quality"&&n&&t.jsx(yj,{agentId:n}),h==="overview"&&t.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2",children:[t.jsxs("div",{className:"card",children:[t.jsx("h3",{className:"mb-4 text-lg font-medium text-zinc-200",children:d("agent.budget")}),t.jsx(S0,{spent:0,limit:10}),t.jsxs("div",{className:"mt-4 grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"rounded-lg bg-[#0a0a0f] p-3",children:[t.jsx("p",{className:"text-xs text-zinc-500",children:"Total Spent"}),t.jsx("p",{className:"text-lg font-semibold text-white",children:"$0.00"})]}),t.jsxs("div",{className:"rounded-lg bg-[#0a0a0f] p-3",children:[t.jsx("p",{className:"text-xs text-zinc-500",children:"Runs Today"}),t.jsx("p",{className:"text-lg font-semibold text-white",children:"0"})]})]})]}),t.jsxs("div",{className:"card",children:[t.jsx("h3",{className:"mb-4 text-lg font-medium text-zinc-200",children:d("agent.recentRuns")}),t.jsx("p",{className:"text-sm text-zinc-500",children:"No runs recorded yet."})]}),o.description&&t.jsxs("div",{className:"card lg:col-span-2",children:[t.jsx("h3",{className:"mb-2 text-lg font-medium text-zinc-200",children:d("common.description")}),t.jsx("p",{className:"text-sm text-zinc-400",children:o.description})]})]}),h==="runs"&&t.jsx("div",{className:"card",children:t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-border text-left",children:[t.jsx("th",{className:"pb-3 pr-4 text-zinc-400 font-medium",children:"Run ID"}),t.jsx("th",{className:"pb-3 pr-4 text-zinc-400 font-medium",children:d("common.status")}),t.jsx("th",{className:"pb-3 pr-4 text-zinc-400 font-medium",children:d("run.duration")}),t.jsx("th",{className:"pb-3 pr-4 text-zinc-400 font-medium",children:"Cost"}),t.jsx("th",{className:"pb-3 text-zinc-400 font-medium",children:d("common.created")})]})}),t.jsx("tbody",{children:t.jsx("tr",{children:t.jsx("td",{colSpan:5,className:"py-8 text-center text-zinc-500",children:"No runs recorded for this agent."})})})]})})}),h==="events"&&t.jsx("div",{className:"card",children:t.jsx(au,{events:[],maxHeight:"500px"})}),h==="configuration"&&t.jsxs("div",{className:"card",children:[t.jsx("h3",{className:"mb-4 text-lg font-medium text-zinc-200",children:"Agent Configuration"}),t.jsx("pre",{className:"overflow-auto rounded-lg bg-[#0a0a0f] p-4 text-sm text-zinc-300",children:JSON.stringify(o,null,2)})]})]})}function wj(){const[n,r]=u.useState([]),[d,o]=u.useState(!0),[m,f]=u.useState(null),h=u.useCallback(async()=>{o(!0),f(null);try{const b=await tu.list({limit:200});r(b.data)}catch(b){f(b instanceof Error?b.message:"Failed to fetch workflows")}finally{o(!1)}},[]);return u.useEffect(()=>{h()},[h]),{workflows:n,loading:d,error:m,refetch:h}}function Sj(n){const[r,d]=u.useState(null),[o,m]=u.useState(!0),[f,h]=u.useState(null),b=u.useCallback(async()=>{if(n){m(!0),h(null);try{const g=await tu.get(n);d(g.data)}catch(g){h(g instanceof Error?g.message:"Failed to fetch workflow")}finally{m(!1)}}},[n]);return u.useEffect(()=>{b()},[b]),{workflow:r,loading:o,error:f,refetch:b}}function kj(){const{t:n}=We(),{workflows:r,loading:d,error:o,refetch:m}=wj(),[f,h]=u.useState(!1),[b,g]=u.useState(!1),[p,j]=u.useState({name:"",description:""}),y=async()=>{if(p.name.trim()){g(!0);try{const w={id:"start",type:"agent",label:"Start",config:{},next:[]};await tu.create({name:p.name,description:p.description||void 0,nodes:[w],entryNodeId:"start"}),h(!1),j({name:"",description:""}),m()}catch(w){console.error("Failed to create workflow:",w)}finally{g(!1)}}};return d?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})}):t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h1",{className:"text-2xl font-semibold text-white",children:n("workflows.title")}),t.jsxs("button",{onClick:()=>h(!0),className:"btn-primary",children:[t.jsx(pt,{className:"h-4 w-4"}),n("workflows.create")]})]}),o&&t.jsxs("div",{className:"rounded-lg border border-red-500/20 bg-red-500/5 p-4 text-sm text-red-400",children:[o,t.jsx("button",{onClick:m,className:"ml-3 underline",children:"Retry"})]}),r.length===0&&!o?t.jsx(Qs,{icon:t.jsx(Br,{className:"h-8 w-8"}),title:n("workflows.empty"),description:n("workflows.emptyDesc"),action:t.jsxs("button",{onClick:()=>h(!0),className:"btn-primary",children:[t.jsx(pt,{className:"h-4 w-4"}),n("workflows.create")]})}):t.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3",children:r.map(w=>t.jsxs("div",{className:"card group hover:border-indigo-500/30 transition-colors",children:[t.jsxs("div",{className:"flex items-start justify-between",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-blue-500/10 text-blue-400",children:t.jsx(Br,{className:"h-5 w-5"})}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-medium text-zinc-200",children:w.name}),t.jsxs("p",{className:"text-xs text-zinc-500",children:["v",w.currentVersion]})]})]}),t.jsx(si,{status:"idle"})]}),w.description&&t.jsx("p",{className:"mt-3 text-sm text-zinc-400 line-clamp-2",children:w.description}),t.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[t.jsxs("span",{className:"text-xs text-zinc-500",children:[n("common.updated"),": ",new Date(w.updatedAt).toLocaleDateString()]}),t.jsxs("div",{className:"flex gap-1.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[t.jsx(Ha,{to:`/workflows/${w.id}/edit`,className:"btn-ghost btn-sm",children:t.jsx(Fd,{className:"h-3.5 w-3.5"})}),t.jsx("button",{className:"btn-ghost btn-sm text-green-400",children:t.jsx(jt,{className:"h-3.5 w-3.5"})})]})]})]},w.id))}),f&&t.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:t.jsxs("div",{className:"w-full max-w-lg rounded-2xl border border-border bg-surface p-6 shadow-2xl",children:[t.jsxs("div",{className:"flex items-center justify-between mb-5",children:[t.jsx("h2",{className:"text-lg font-semibold text-white",children:n("workflows.create")}),t.jsx("button",{onClick:()=>h(!1),className:"btn-ghost btn-sm",children:t.jsx(Je,{className:"h-4 w-4"})})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"label",children:n("common.name")}),t.jsx("input",{className:"input",value:p.name,onChange:w=>j({...p,name:w.target.value}),placeholder:"My Workflow"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"label",children:n("common.description")}),t.jsx("textarea",{className:"input min-h-[80px] resize-none",value:p.description,onChange:w=>j({...p,description:w.target.value}),placeholder:"What does this workflow do?"})]})]}),t.jsxs("div",{className:"mt-6 flex justify-end gap-3",children:[t.jsx("button",{onClick:()=>h(!1),className:"btn-secondary",children:n("common.cancel")}),t.jsx("button",{onClick:y,disabled:!p.name.trim()||b,className:"btn-primary",children:n(b?"common.loading":"workflows.create")})]})]})})]})}const Mh={agent:"border-indigo-500 bg-indigo-500/10",tool:"border-emerald-500 bg-emerald-500/10",condition:"border-amber-500 bg-amber-500/10",parallel:"border-blue-500 bg-blue-500/10",loop:"border-violet-500 bg-violet-500/10",human:"border-rose-500 bg-rose-500/10"},zr={agent:"Agent",tool:"Tool",condition:"Condition",parallel:"Parallel",loop:"Loop",human:"Human"};function zj(n,r){var g;const d=new Map;if(n.length===0)return d;const o=new Set,m=[],f=new Map,h=r??((g=n[0])==null?void 0:g.id);for(h&&m.push({id:h,depth:0,index:0});m.length>0;){const{id:p,depth:j}=m.shift();if(o.has(p))continue;o.add(p);const y=f.get(j)??0;f.set(j,y+1),d.set(p,{x:80+y*220,y:60+j*120});const w=n.find(C=>C.id===p);if(w)for(const C of w.next)o.has(C)||m.push({id:C,depth:j+1,index:0})}let b=(f.get(0)??0)*220+80;for(const p of n)o.has(p.id)||(d.set(p.id,{x:b,y:60}),b+=220);return d}function Cj(){const{id:n}=Vn(),r=Rt(),{t:d}=We(),{workflow:o,loading:m,error:f}=Sj(n),[h,b]=u.useState([]),[g,p]=u.useState(),[j,y]=u.useState(null),[w,C]=u.useState(!1),[k,N]=u.useState({label:"",type:"agent"});u.useEffect(()=>{o!=null&&o.nodes&&(b(o.nodes),p(o.entryNodeId))},[o]);const S=u.useMemo(()=>zj(h,g),[h,g]),z=Math.max(800,...Array.from(S.values()).map(H=>H.x+200)),M=Math.max(400,...Array.from(S.values()).map(H=>H.y+100)),O=u.useMemo(()=>{const H=[];for(const G of h){const P=S.get(G.id);if(P)for(const W of G.next){const Q=S.get(W);Q&&H.push({from:P,to:Q,fromId:G.id,toId:W})}}return H},[h,S]),E=u.useCallback(()=>{if(!k.label.trim())return;const H=`node_${Date.now()}`;b(G=>[...G,{id:H,type:k.type,label:k.label,config:{},next:[]}]),h.length===0&&p(H),N({label:"",type:"agent"}),C(!1)},[k,h.length]),ae=u.useCallback(H=>{var G;b(P=>P.filter(Q=>Q.id!==H).map(Q=>({...Q,next:Q.next.filter(le=>le!==H)}))),j===H&&y(null),g===H&&p((G=h.find(P=>P.id!==H))==null?void 0:G.id)},[j,g,h]),ce=h.find(H=>H.id===j);return m?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})}):f?t.jsxs("div",{className:"flex flex-col items-center justify-center py-20",children:[t.jsx("p",{className:"text-red-400",children:f}),t.jsxs("button",{onClick:()=>r("/workflows"),className:"btn-secondary mt-4",children:[t.jsx(Hn,{className:"h-4 w-4"})," Back to Workflows"]})]}):t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("button",{onClick:()=>r("/workflows"),className:"btn-ghost btn-sm",children:t.jsx(Hn,{className:"h-4 w-4"})}),t.jsx("h1",{className:"text-2xl font-semibold text-white",children:(o==null?void 0:o.name)??d("workflow.editor")})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("button",{onClick:()=>C(!0),className:"btn-secondary btn-sm",children:[t.jsx(pt,{className:"h-3.5 w-3.5"})," ",d("workflow.addNode")]}),t.jsxs("button",{className:"btn-secondary btn-sm",children:[t.jsx(Qr,{className:"h-3.5 w-3.5"})," ",d("workflow.save")]}),t.jsxs("button",{className:"btn-primary btn-sm",children:[t.jsx(jt,{className:"h-3.5 w-3.5"})," ",d("workflow.run")]})]})]}),t.jsxs("div",{className:"flex gap-4",children:[t.jsxs("div",{className:"card flex-1 overflow-auto p-0",style:{minHeight:"500px"},children:[t.jsxs("svg",{width:z,height:M,className:"w-full",children:[O.map((H,G)=>{const P=H.from.x+80,W=H.from.y+40,Q=H.to.x+80,le=H.to.y,F=(W+le)/2;return t.jsx("path",{d:`M ${P} ${W} C ${P} ${F}, ${Q} ${F}, ${Q} ${le}`,fill:"none",stroke:"#2a2a35",strokeWidth:"2",markerEnd:"url(#arrowhead)"},G)}),t.jsx("defs",{children:t.jsx("marker",{id:"arrowhead",markerWidth:"8",markerHeight:"6",refX:"7",refY:"3",orient:"auto",children:t.jsx("polygon",{points:"0 0, 8 3, 0 6",fill:"#2a2a35"})})})]}),t.jsx("div",{className:"absolute inset-0",style:{width:z,height:M},children:h.map(H=>{const G=S.get(H.id);if(!G)return null;const P=H.id===g,W=H.id===j;return t.jsxs("div",{className:`absolute cursor-pointer rounded-lg border-2 px-4 py-2.5 text-sm transition-all ${Mh[H.type]} ${W?"ring-2 ring-indigo-500 ring-offset-2 ring-offset-[#0a0a0f]":""} ${P?"shadow-lg":""}`,style:{left:G.x,top:G.y,width:160},onClick:()=>y(H.id),children:[t.jsx("div",{className:"font-medium text-zinc-200 truncate",children:H.label}),t.jsx("div",{className:"text-xs text-zinc-500 mt-0.5",children:zr[H.type]}),P&&t.jsx("div",{className:"absolute -top-2 -right-2 h-4 w-4 rounded-full bg-indigo-500 border-2 border-[#0a0a0f]"})]},H.id)})}),h.length===0&&t.jsx("div",{className:"flex items-center justify-center h-full text-zinc-500 text-sm",children:"Add nodes to build your workflow DAG"})]}),ce&&t.jsxs("div",{className:"w-72 card space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h3",{className:"font-medium text-zinc-200",children:"Node Properties"}),t.jsx("button",{onClick:()=>y(null),className:"btn-ghost btn-sm",children:t.jsx(Je,{className:"h-3.5 w-3.5"})})]}),t.jsxs("div",{children:[t.jsx("label",{className:"label",children:"Label"}),t.jsx("input",{className:"input",value:ce.label,onChange:H=>b(G=>G.map(P=>P.id===ce.id?{...P,label:H.target.value}:P))})]}),t.jsxs("div",{children:[t.jsx("label",{className:"label",children:d("common.type")}),t.jsx("select",{className:"input",value:ce.type,onChange:H=>b(G=>G.map(P=>P.id===ce.id?{...P,type:H.target.value}:P)),children:Object.entries(zr).map(([H,G])=>t.jsx("option",{value:H,children:G},H))})]}),t.jsxs("div",{children:[t.jsx("label",{className:"label",children:"Agent ID"}),t.jsx("input",{className:"input",value:ce.agentId??"",onChange:H=>b(G=>G.map(P=>P.id===ce.id?{...P,agentId:H.target.value||void 0}:P)),placeholder:"Optional agent ID"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"label",children:"Connect to"}),t.jsxs("select",{className:"input",value:"",onChange:H=>{H.target.value&&b(G=>G.map(P=>P.id===ce.id&&!P.next.includes(H.target.value)?{...P,next:[...P.next,H.target.value]}:P))},children:[t.jsx("option",{value:"",children:"Select a node..."}),h.filter(H=>H.id!==ce.id&&!ce.next.includes(H.id)).map(H=>t.jsx("option",{value:H.id,children:H.label},H.id))]}),ce.next.length>0&&t.jsx("div",{className:"mt-2 space-y-1",children:ce.next.map(H=>{const G=h.find(P=>P.id===H);return t.jsxs("div",{className:"flex items-center justify-between rounded bg-[#0a0a0f] px-2 py-1 text-xs",children:[t.jsx("span",{className:"text-zinc-400",children:(G==null?void 0:G.label)??H}),t.jsx("button",{onClick:()=>b(P=>P.map(W=>W.id===ce.id?{...W,next:W.next.filter(Q=>Q!==H)}:W)),className:"text-zinc-500 hover:text-red-400",children:t.jsx(Je,{className:"h-3 w-3"})})]},H)})})]}),t.jsxs("button",{onClick:()=>ae(ce.id),className:"btn-danger w-full",children:[t.jsx(Mt,{className:"h-3.5 w-3.5"}),"Delete Node"]})]})]}),w&&t.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:t.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border bg-surface p-6 shadow-2xl",children:[t.jsxs("div",{className:"flex items-center justify-between mb-5",children:[t.jsx("h2",{className:"text-lg font-semibold text-white",children:d("workflow.addNode")}),t.jsx("button",{onClick:()=>C(!1),className:"btn-ghost btn-sm",children:t.jsx(Je,{className:"h-4 w-4"})})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"label",children:"Label"}),t.jsx("input",{className:"input",value:k.label,onChange:H=>N({...k,label:H.target.value}),placeholder:"Node label"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"label",children:d("common.type")}),t.jsx("div",{className:"grid grid-cols-3 gap-2",children:Object.keys(zr).map(H=>t.jsx("button",{onClick:()=>N({...k,type:H}),className:`rounded-lg border-2 p-2.5 text-center text-xs font-medium transition-colors ${k.type===H?Mh[H]:"border-border text-zinc-400 hover:border-zinc-600"}`,children:zr[H]},H))})]})]}),t.jsxs("div",{className:"mt-6 flex justify-end gap-3",children:[t.jsx("button",{onClick:()=>C(!1),className:"btn-secondary",children:d("common.cancel")}),t.jsx("button",{onClick:E,disabled:!k.label.trim(),className:"btn-primary",children:d("workflow.addNode")})]})]})})]})}function Aj(){const[n,r]=u.useState([]),[d,o]=u.useState(!0),[m,f]=u.useState(null),h=u.useCallback(async()=>{o(!0),f(null);try{const b=await Or.list({limit:200});r(b.data)}catch(b){f(b instanceof Error?b.message:"Failed to fetch skills")}finally{o(!1)}},[]);return u.useEffect(()=>{h()},[h]),{skills:n,loading:d,error:m,refetch:h}}function Ej({skill:n,onDelete:r}){return t.jsxs("div",{className:"card group hover:border-indigo-500/30 transition-colors",children:[t.jsxs("div",{className:"flex items-start justify-between",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-violet-500/10 text-violet-400",children:t.jsx(Xr,{className:"h-5 w-5"})}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-medium text-zinc-200",children:n.name}),t.jsxs("p",{className:"text-xs text-zinc-500",children:["v",n.version," by ",n.author]})]})]}),t.jsx(su,{level:n.trustLevel})]}),n.description&&t.jsx("p",{className:"mt-3 text-sm text-zinc-400 line-clamp-2",children:n.description}),t.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[t.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[n.tags.slice(0,3).map(d=>t.jsx("span",{className:"rounded-md bg-zinc-800 px-2 py-0.5 text-xs text-zinc-400",children:d},d)),n.tags.length>3&&t.jsxs("span",{className:"text-xs text-zinc-500",children:["+",n.tags.length-3]})]}),r&&t.jsx("button",{onClick:d=>{d.preventDefault(),r(n.id)},className:"btn-ghost btn-sm text-zinc-500 hover:text-red-400 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(Mt,{className:"h-3.5 w-3.5"})})]})]})}function Tj(){const{t:n}=We(),{skills:r,loading:d,error:o,refetch:m}=Aj(),[f,h]=u.useState(!1),[b,g]=u.useState(!1),[p,j]=u.useState(""),[y,w]=u.useState({source:"",type:"local",name:"",trustLevel:"community"}),[C,k]=u.useState(null),N=async()=>{if(y.source.trim()){g(!0);try{await Or.install({source:y.source,type:y.type,name:y.name||void 0,trustLevel:y.trustLevel}),h(!1),w({source:"",type:"local",name:"",trustLevel:"community"}),m()}catch(O){console.error("Failed to install skill:",O)}finally{g(!1)}}},S=async O=>{if(window.confirm("Remove this skill?"))try{await Or.delete(O),m()}catch(E){console.error("Failed to delete skill:",E)}},z=async()=>{if(y.source.trim())try{const O=await Or.scan(y.source);k(O)}catch(O){console.error("Scan failed:",O)}},M=r.filter(O=>!p||O.name.toLowerCase().includes(p.toLowerCase())||O.description.toLowerCase().includes(p.toLowerCase())||O.tags.some(E=>E.toLowerCase().includes(p.toLowerCase())));return d?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})}):t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h1",{className:"text-2xl font-semibold text-white",children:n("skills.title")}),t.jsxs("button",{onClick:()=>h(!0),className:"btn-primary",children:[t.jsx(pt,{className:"h-4 w-4"}),n("skills.install")]})]}),r.length>0&&t.jsxs("div",{className:"relative max-w-md",children:[t.jsx(Js,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-zinc-500"}),t.jsx("input",{type:"text",className:"input pl-9",placeholder:n("common.search"),value:p,onChange:O=>j(O.target.value)})]}),o&&t.jsxs("div",{className:"rounded-lg border border-red-500/20 bg-red-500/5 p-4 text-sm text-red-400",children:[o,t.jsx("button",{onClick:m,className:"ml-3 underline",children:"Retry"})]}),r.length===0&&!o?t.jsx(Qs,{icon:t.jsx(Xr,{className:"h-8 w-8"}),title:n("skills.empty"),description:n("skills.emptyDesc"),action:t.jsxs("button",{onClick:()=>h(!0),className:"btn-primary",children:[t.jsx(pt,{className:"h-4 w-4"}),n("skills.install")]})}):M.length===0?t.jsx("div",{className:"py-8 text-center text-sm text-zinc-500",children:n("common.noResults")}):t.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3",children:M.map(O=>t.jsx(Ej,{skill:O,onDelete:S},O.id))}),f&&t.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:t.jsxs("div",{className:"w-full max-w-lg rounded-2xl border border-border bg-surface p-6 shadow-2xl",children:[t.jsxs("div",{className:"flex items-center justify-between mb-5",children:[t.jsx("h2",{className:"text-lg font-semibold text-white",children:n("skills.install")}),t.jsx("button",{onClick:()=>{h(!1),k(null)},className:"btn-ghost btn-sm",children:t.jsx(Je,{className:"h-4 w-4"})})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"label",children:n("skills.source")}),t.jsx("input",{className:"input",value:y.source,onChange:O=>w({...y,source:O.target.value}),placeholder:"/path/to/skill or https://..."})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"label",children:n("common.type")}),t.jsxs("select",{className:"input",value:y.type,onChange:O=>w({...y,type:O.target.value}),children:[t.jsx("option",{value:"local",children:"Local"}),t.jsx("option",{value:"npm",children:"NPM"}),t.jsx("option",{value:"git",children:"Git"}),t.jsx("option",{value:"url",children:"URL"})]})]}),t.jsxs("div",{children:[t.jsxs("label",{className:"label",children:[n("common.name")," (optional)"]}),t.jsx("input",{className:"input",value:y.name,onChange:O=>w({...y,name:O.target.value}),placeholder:"my-skill"})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"label",children:"Trust Level"}),t.jsxs("select",{className:"input",value:y.trustLevel,onChange:O=>w({...y,trustLevel:O.target.value}),children:[t.jsx("option",{value:"builtin",children:"Built-in"}),t.jsx("option",{value:"official",children:"Official"}),t.jsx("option",{value:"trusted",children:"Trusted"}),t.jsx("option",{value:"community",children:"Community"}),t.jsx("option",{value:"local",children:"Local"})]})]}),C&&t.jsxs("div",{className:"rounded-lg bg-[#0a0a0f] p-4",children:[t.jsx("h4",{className:"text-sm font-medium text-zinc-300 mb-2",children:"Scan Results"}),t.jsx("pre",{className:"text-xs text-zinc-400 overflow-auto max-h-40",children:JSON.stringify(C,null,2)})]})]}),t.jsxs("div",{className:"mt-6 flex justify-between",children:[t.jsxs("button",{onClick:z,disabled:!y.source.trim(),className:"btn-secondary",children:[t.jsx(cv,{className:"h-4 w-4"}),n("skills.scan")]}),t.jsxs("div",{className:"flex gap-3",children:[t.jsx("button",{onClick:()=>{h(!1),k(null)},className:"btn-secondary",children:n("common.cancel")}),t.jsx("button",{onClick:N,disabled:!y.source.trim()||b,className:"btn-primary",children:n(b?"common.loading":"skills.install")})]})]})]})})]})}function Rj(){const{t:n}=We(),[r,d]=u.useState([]),[o,m]=u.useState(!0),[f,h]=u.useState(null),[b,g]=u.useState("all"),p=u.useCallback(async()=>{m(!0),h(null);try{const w={limit:100};b!=="all"&&(w.status=b);const C=await Vs.list(w);d(C.data)}catch(w){h(w instanceof Error?w.message:"Failed to fetch runs"),d([])}finally{m(!1)}},[b]);u.useEffect(()=>{p()},[p]);const j=async w=>{try{await Vs.abort(w),p()}catch(C){console.error("Abort failed:",C)}},y=async w=>{if(window.confirm("Delete this run record?"))try{await Vs.delete(w),d(C=>C.filter(k=>k.id!==w))}catch(C){console.error("Delete failed:",C)}};return o?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})}):t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h1",{className:"text-2xl font-semibold text-white",children:n("runs.title")}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("button",{onClick:p,className:"btn-ghost btn-sm",children:t.jsx(Yt,{className:"h-4 w-4"})}),t.jsx(h0,{className:"h-4 w-4 text-zinc-500"}),t.jsxs("select",{className:"input w-auto",value:b,onChange:w=>g(w.target.value),children:[t.jsx("option",{value:"all",children:"All Status"}),t.jsx("option",{value:"running",children:n("status.running")}),t.jsx("option",{value:"completed",children:n("status.completed")}),t.jsx("option",{value:"failed",children:n("status.failed")}),t.jsx("option",{value:"pending",children:n("status.pending")}),t.jsx("option",{value:"paused",children:n("status.paused")}),t.jsx("option",{value:"cancelled",children:n("status.cancelled")})]})]})]}),f&&t.jsxs("div",{className:"rounded-lg border border-red-500/20 bg-red-500/5 p-4 text-sm text-red-400",children:[f,t.jsx("button",{onClick:p,className:"ml-3 underline",children:n("common.retry")})]}),r.length===0&&!f?t.jsx(Qs,{icon:t.jsx(jt,{className:"h-8 w-8"}),title:n("runs.empty"),description:n("runs.emptyDesc")}):r.length>0?t.jsx("div",{className:"card overflow-hidden p-0",children:t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-border bg-surface",children:[t.jsx("th",{className:"px-5 py-3 text-left text-zinc-400 font-medium",children:"Run ID"}),t.jsx("th",{className:"px-5 py-3 text-left text-zinc-400 font-medium",children:"Workflow"}),t.jsx("th",{className:"px-5 py-3 text-left text-zinc-400 font-medium",children:n("common.status")}),t.jsx("th",{className:"px-5 py-3 text-left text-zinc-400 font-medium",children:"Started"}),t.jsx("th",{className:"px-5 py-3 text-left text-zinc-400 font-medium",children:n("run.duration")}),t.jsx("th",{className:"px-5 py-3 text-left text-zinc-400 font-medium",children:n("common.actions")})]})}),t.jsx("tbody",{children:r.map(w=>{var k;const C=w.completedAt&&w.startedAt?Math.round((new Date(w.completedAt).getTime()-new Date(w.startedAt).getTime())/1e3):null;return t.jsxs("tr",{className:"border-b border-border hover:bg-surface-hover transition-colors",children:[t.jsx("td",{className:"px-5 py-3",children:t.jsxs(Ha,{to:`/runs/${w.id}`,className:"text-indigo-400 hover:text-indigo-300 font-mono text-xs",children:[w.id.slice(0,8),"..."]})}),t.jsxs("td",{className:"px-5 py-3 text-zinc-300 font-mono text-xs",children:[((k=w.workflowId)==null?void 0:k.slice(0,8))??"—","..."]}),t.jsx("td",{className:"px-5 py-3",children:t.jsx(si,{status:w.status,pulse:!0})}),t.jsx("td",{className:"px-5 py-3 text-zinc-400 text-xs",children:new Date(w.startedAt).toLocaleString()}),t.jsx("td",{className:"px-5 py-3 text-zinc-400 text-xs",children:C!==null?`${C}s`:"—"}),t.jsx("td",{className:"px-5 py-3",children:t.jsxs("div",{className:"flex gap-1",children:[(w.status==="running"||w.status==="pending")&&t.jsx("button",{onClick:()=>j(w.id),className:"btn-ghost btn-sm text-amber-400",title:"Abort run",children:t.jsx(x0,{className:"h-3.5 w-3.5"})}),(w.status==="completed"||w.status==="failed"||w.status==="cancelled")&&t.jsx("button",{onClick:()=>y(w.id),className:"btn-ghost btn-sm text-zinc-400 hover:text-red-400",title:"Delete run",children:t.jsx(Mt,{className:"h-3.5 w-3.5"})})]})})]},w.id)})})]})})}):null]})}const k0="/api";async function Mj(n){const r=localStorage.getItem("nestor_token"),d={"Content-Type":"application/json"};r&&(d.Authorization=`Bearer ${r}`);const o=localStorage.getItem("nestor_tenant_id");o&&(d["X-Tenant-ID"]=o);const m=await fetch(`${k0}/runs/${n}/feedback`,{headers:d});return m.ok?(await m.json()).data??[]:[]}async function Dh(n,r,d,o){const m=localStorage.getItem("nestor_token"),f={"Content-Type":"application/json"};m&&(f.Authorization=`Bearer ${m}`);const h=localStorage.getItem("nestor_tenant_id");h&&(f["X-Tenant-ID"]=h),await fetch(`${k0}/runs/${n}/feedback`,{method:"POST",headers:f,body:JSON.stringify({rating:r,comment:d||void 0,agentId:o})})}function Dj({runId:n,agentId:r}){const[d,o]=u.useState([]),[m,f]=u.useState(!1),[h,b]=u.useState(null),[g,p]=u.useState(""),[j,y]=u.useState(!1),w=u.useCallback(async()=>{const N=await Mj(n);o(N),N.length>0&&(f(!0),b(N[0].rating))},[n]);u.useEffect(()=>{w()},[w]);const C=async N=>{m||(b(N),N===1?(await Dh(n,N,void 0,r),f(!0),w()):y(!0))},k=async()=>{h!==null&&(await Dh(n,h,g||void 0,r),f(!0),y(!1),w())};return t.jsxs("div",{className:"card",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h3",{className:"text-sm font-medium text-zinc-400",children:"Was this helpful?"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("button",{onClick:()=>C(1),disabled:m,className:`rounded-lg p-2 transition-colors ${h===1?"bg-green-500/20 text-green-400":m?"text-zinc-600 cursor-not-allowed":"text-zinc-400 hover:bg-green-500/10 hover:text-green-400"}`,title:"Helpful",children:t.jsx(Pl,{className:"h-5 w-5"})}),t.jsx("button",{onClick:()=>C(-1),disabled:m,className:`rounded-lg p-2 transition-colors ${h===-1?"bg-red-500/20 text-red-400":m?"text-zinc-600 cursor-not-allowed":"text-zinc-400 hover:bg-red-500/10 hover:text-red-400"}`,title:"Not helpful",children:t.jsx(Od,{className:"h-5 w-5"})})]})]}),j&&!m&&t.jsxs("div",{className:"mt-3 flex gap-2",children:[t.jsx("input",{type:"text",value:g,onChange:N=>p(N.target.value),placeholder:"What could be improved? (optional)",className:"flex-1 rounded-lg bg-zinc-800 px-3 py-2 text-sm text-zinc-200 placeholder-zinc-500 border border-zinc-700 focus:border-indigo-500 focus:outline-none",onKeyDown:N=>{N.key==="Enter"&&k()}}),t.jsx("button",{onClick:k,className:"rounded-lg bg-indigo-600 px-3 py-2 text-sm text-white hover:bg-indigo-500 transition-colors",children:t.jsx(b0,{className:"h-4 w-4"})})]}),m&&t.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:[h===1?"Thanks for the positive feedback!":"Thanks for your feedback.",d.length>0&&d[0].comment&&t.jsxs("span",{className:"text-zinc-600",children:[" — “",d[0].comment,"”"]})]})]})}const Oj={llm_request:{icon:Ks,color:"text-purple-400",bgColor:"bg-purple-500/10",label:"LLM Request"},llm_response:{icon:js,color:"text-blue-400",bgColor:"bg-blue-500/10",label:"LLM Response"},tool_call_requested:{icon:Qn,color:"text-amber-400",bgColor:"bg-amber-500/10",label:"Tool Call"},tool_call_completed:{icon:ct,color:"text-emerald-400",bgColor:"bg-emerald-500/10",label:"Tool Result"},tool_call_denied:{icon:wt,color:"text-red-400",bgColor:"bg-red-500/10",label:"Tool Denied"},node_started:{icon:jt,color:"text-blue-400",bgColor:"bg-blue-500/10",label:"Step Started"},node_completed:{icon:ct,color:"text-green-400",bgColor:"bg-green-500/10",label:"Step Completed"},node_failed:{icon:wt,color:"text-red-400",bgColor:"bg-red-500/10",label:"Step Failed"},thinking:{icon:Md,color:"text-yellow-400",bgColor:"bg-yellow-500/10",label:"Thinking"},reasoning:{icon:Md,color:"text-yellow-400",bgColor:"bg-yellow-500/10",label:"Reasoning"},approval_requested:{icon:ba,color:"text-amber-400",bgColor:"bg-amber-500/10",label:"Approval Requested"},budget_warning:{icon:lt,color:"text-amber-400",bgColor:"bg-amber-500/10",label:"Budget Warning"},budget_exceeded:{icon:ya,color:"text-red-400",bgColor:"bg-red-500/10",label:"Budget Exceeded"},error:{icon:lt,color:"text-red-400",bgColor:"bg-red-500/10",label:"Error"}},Lj={icon:jt,color:"text-zinc-400",bgColor:"bg-zinc-500/10",label:"Event"};function _j(n){try{return new Date(n).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}catch{return n}}function Oh(n,r){try{return new Date(r).getTime()-new Date(n).getTime()}catch{return 0}}function Uj(n){return n<1e3?`${n}ms`:n<6e4?`${(n/1e3).toFixed(1)}s`:`${Math.floor(n/6e4)}m ${Math.floor(n%6e4/1e3)}s`}function Bj(n){const r=n.data;if(!r)return"";if(typeof r.reasoning=="string")return r.reasoning;if(typeof r.content=="string")return r.content;if(typeof r.text=="string")return r.text;if(typeof r.output=="string")return r.output;if(typeof r.prompt=="string")return r.prompt;if(typeof r.error=="string")return r.error;if(typeof r.tool=="string"){const o=r.args?` (${JSON.stringify(r.args).slice(0,120)})`:"";return`${r.tool}${o}`}const d=JSON.stringify(r,null,2);return d.length>300?d.slice(0,300)+"...":d}function $j(n,r){let d=0;for(let o=0;o<=r&&o<n.length;o++){const m=n[o].data;typeof m.estimatedCostUsd=="number"?d=m.estimatedCostUsd:typeof m.cost=="number"&&(d+=m.cost)}return d}function Hj({runId:n}){const[r,d]=u.useState([]),[o,m]=u.useState(!0),[f,h]=u.useState(null),[b,g]=u.useState(-1),[p,j]=u.useState(!1),[y,w]=u.useState(1),C=u.useRef(null),k=u.useRef(null),N=u.useRef(new Map);u.useEffect(()=>{let W=!1;return m(!0),h(null),Vs.getEvents(n).then(Q=>{W||d(Q.data.sort((le,F)=>new Date(le.timestamp).getTime()-new Date(F.timestamp).getTime()))}).catch(Q=>{W||h(Q instanceof Error?Q.message:"Failed to load events")}).finally(()=>{W||m(!1)}),()=>{W=!0}},[n]);const S=u.useCallback(()=>{j(!1),C.current&&(clearTimeout(C.current),C.current=null)},[]),z=u.useCallback(()=>{g(W=>{const Q=W+1;if(Q>=r.length)return S(),W;const le=r[W]??r[0],F=r[Q];if(le&&F){const re=Oh(le.timestamp,F.timestamp),he=Math.max(50,Math.min(re/y,2e3/y));C.current=setTimeout(z,he)}return Q})},[r,y,S]),M=u.useCallback(()=>{r.length!==0&&(j(!0),g(W=>{const Q=W>=r.length-1?0:W,le=300/y;return C.current=setTimeout(z,le),Q}))},[r,y,z]),O=u.useCallback(()=>{p?S():M()},[p,S,M]),E=u.useCallback(()=>{S(),g(W=>Math.min(W+1,r.length-1))},[r.length,S]),ae=u.useCallback(()=>{S(),g(W=>Math.max(W-1,0))},[S]),ce=u.useCallback(W=>{S(),g(W)},[S]),H=u.useCallback(()=>{w(W=>{const Q=[1,2,4,8],le=Q.indexOf(W);return Q[(le+1)%Q.length]})},[]);if(u.useEffect(()=>{if(b>=0){const W=N.current.get(b);W==null||W.scrollIntoView({behavior:"smooth",block:"nearest"})}},[b]),u.useEffect(()=>()=>{C.current&&clearTimeout(C.current)},[]),o)return t.jsxs("div",{className:"flex items-center justify-center py-12",children:[t.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"}),t.jsx("span",{className:"ml-3 text-sm text-zinc-400",children:"Loading events..."})]});if(f)return t.jsx("div",{className:"rounded-lg border border-red-500/20 bg-red-500/5 p-4",children:t.jsx("p",{className:"text-sm text-red-400",children:f})});if(r.length===0)return t.jsx("div",{className:"rounded-lg border border-zinc-700 bg-zinc-800/50 p-6 text-center",children:t.jsx("p",{className:"text-sm text-zinc-500",children:"No events recorded for this run."})});const G=r.length>0?(b+1)/r.length*100:0,P=b>=0?$j(r,b):0;return t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-zinc-700 bg-zinc-800/80 px-4 py-3",children:[t.jsx("button",{onClick:ae,disabled:b<=0,className:"rounded p-1.5 text-zinc-400 transition-colors hover:bg-zinc-700 hover:text-white disabled:opacity-30 disabled:cursor-not-allowed",title:"Step backward",children:t.jsx(vv,{className:"h-4 w-4"})}),t.jsx("button",{onClick:O,className:"flex h-9 w-9 items-center justify-center rounded-full bg-indigo-600 text-white transition-colors hover:bg-indigo-500",title:p?"Pause":"Play",children:p?t.jsx(Yr,{className:"h-4 w-4"}):t.jsx(jt,{className:"h-4 w-4 ml-0.5"})}),t.jsx("button",{onClick:E,disabled:b>=r.length-1,className:"rounded p-1.5 text-zinc-400 transition-colors hover:bg-zinc-700 hover:text-white disabled:opacity-30 disabled:cursor-not-allowed",title:"Step forward",children:t.jsx(jv,{className:"h-4 w-4"})}),t.jsxs("button",{onClick:H,className:"rounded border border-zinc-600 px-2 py-1 text-xs font-mono text-zinc-300 transition-colors hover:bg-zinc-700",title:"Cycle playback speed",children:[y,"x"]}),t.jsx("div",{className:"flex-1 mx-2",children:t.jsxs("div",{className:"relative h-2 rounded-full bg-zinc-700 cursor-pointer",onClick:W=>{const Q=W.currentTarget.getBoundingClientRect(),le=(W.clientX-Q.left)/Q.width,F=Math.round(le*(r.length-1));ce(Math.max(0,Math.min(F,r.length-1)))},children:[t.jsx("div",{className:"absolute top-0 left-0 h-full rounded-full bg-indigo-500 transition-all duration-150",style:{width:`${G}%`}}),t.jsx("div",{className:"absolute top-1/2 -translate-y-1/2 h-3.5 w-3.5 rounded-full border-2 border-indigo-400 bg-zinc-900 transition-all duration-150",style:{left:`calc(${G}% - 7px)`}})]})}),t.jsxs("span",{className:"text-xs font-mono text-zinc-500 whitespace-nowrap",children:[b+1," / ",r.length]}),P>0&&t.jsxs("span",{className:"flex items-center gap-1 text-xs font-mono text-amber-400 whitespace-nowrap",children:[t.jsx(ya,{className:"h-3 w-3"}),P.toFixed(4)]})]}),t.jsx("div",{ref:k,className:"max-h-[600px] overflow-y-auto rounded-lg border border-zinc-700 bg-zinc-900/50",children:t.jsx("div",{className:"divide-y divide-zinc-800",children:r.map((W,Q)=>{const le=Oj[W.type]??Lj,F=le.icon,re=Q===b,he=b<0||Q<=b,K=Bj(W),_=Q>0?Oh(r[Q-1].timestamp,W.timestamp):0;return t.jsxs("div",{ref:Z=>{Z&&N.current.set(Q,Z)},className:`
|
|
576
|
-
flex items-start gap-3 px-4 py-3 cursor-pointer transition-all duration-200
|
|
577
|
-
${re?"bg-indigo-500/10 border-l-2 border-l-indigo-500":"border-l-2 border-l-transparent"}
|
|
578
|
-
${he?"opacity-100":"opacity-30"}
|
|
579
|
-
hover:bg-zinc-800/50
|
|
580
|
-
`,onClick:()=>ce(Q),children:[t.jsx("span",{className:"mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded text-[10px] font-mono text-zinc-600",children:Q+1}),t.jsx("div",{className:`mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded-lg ${le.bgColor}`,children:t.jsx(F,{className:`h-3.5 w-3.5 ${le.color}`})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:`text-xs font-medium ${le.color}`,children:le.label}),t.jsx("span",{className:"text-[10px] font-mono text-zinc-600",children:_j(W.timestamp)}),_>0&&t.jsxs("span",{className:"text-[10px] text-zinc-600",children:["+",Uj(_)]})]}),K&&he&&t.jsx("pre",{className:`mt-1 text-xs whitespace-pre-wrap break-words ${re?"text-zinc-200":"text-zinc-500"} max-h-40 overflow-hidden`,children:K.length>500?K.slice(0,500)+"...":K})]}),re&&t.jsx(aa,{className:"mt-1.5 h-3.5 w-3.5 shrink-0 text-indigo-400"})]},W.id)})})})]})}function qj(){const{id:n}=Vn(),r=Rt(),{t:d}=We(),[o,m]=u.useState(null),[f,h]=u.useState([]),[b,g]=u.useState([]),[p,j]=u.useState([]),[y,w]=u.useState(!0),[C,k]=u.useState(null),[N,S]=u.useState(null),[z,M]=u.useState(""),[O,E]=u.useState("details"),ae=u.useCallback(async()=>{if(n)try{const F=await Vs.get(n);m(F.data)}catch(F){k(F instanceof Error?F.message:"Failed to load run")}},[n]),ce=u.useCallback(async()=>{if(n)try{const F=await Vs.getEvents(n);h(F.data)}catch{}},[n]),H=u.useCallback(async()=>{if(n)try{const F=await Sd.forRun(n);g(F.data)}catch{}},[n]),G=u.useCallback(async()=>{if(n)try{const F=await $r.list();j(F.data.filter(re=>re.runId===n))}catch{}},[n]);u.useEffect(()=>{n&&(w(!0),k(null),Promise.all([ae(),ce(),H(),G()]).finally(()=>{w(!1)}))},[n,ae,ce,H,G]),u.useEffect(()=>{if(!o||o.status==="completed"||o.status==="failed"||o.status==="cancelled")return;const F=setInterval(()=>{ae(),ce()},3e3);return()=>clearInterval(F)},[o==null?void 0:o.status,ae,ce]);const P=async()=>{if(n)try{await Vs.abort(n),ae()}catch(F){console.error("Abort failed:",F)}};if(y)return t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})});if(C||!o)return t.jsxs("div",{className:"flex flex-col items-center justify-center py-20",children:[t.jsx("p",{className:"text-red-400",children:C??"Run not found"}),t.jsxs("button",{onClick:()=>r("/runs"),className:"btn-secondary mt-4",children:[t.jsx(Hn,{className:"h-4 w-4"})," Back to Runs"]})]});const W=o.completedAt&&o.startedAt?Math.round((new Date(o.completedAt).getTime()-new Date(o.startedAt).getTime())/1e3):null,Q=o.status==="completed"?t.jsx(ct,{className:"h-5 w-5 text-green-400"}):o.status==="failed"?t.jsx(wt,{className:"h-5 w-5 text-red-400"}):t.jsx(jt,{className:"h-5 w-5 text-blue-400"}),le=o.status==="running"||o.status==="pending";return t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"flex items-start justify-between",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("button",{onClick:()=>r("/runs"),className:"btn-ghost btn-sm",children:t.jsx(Hn,{className:"h-4 w-4"})}),t.jsxs("div",{className:"flex items-center gap-3",children:[Q,t.jsxs("div",{children:[t.jsxs("h1",{className:"text-2xl font-semibold text-white",children:["Run ",t.jsxs("span",{className:"font-mono text-lg text-zinc-400",children:[o.id.slice(0,12),"..."]})]}),t.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[t.jsx(si,{status:o.status,pulse:!0}),t.jsxs("span",{className:"text-xs text-zinc-500",children:["Started: ",new Date(o.startedAt).toLocaleString()]})]})]})]})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("button",{onClick:()=>{ae(),ce()},className:"btn-ghost btn-sm",children:t.jsx(Yt,{className:"h-3.5 w-3.5"})}),le&&t.jsxs("button",{onClick:P,className:"btn-danger btn-sm",children:[t.jsx(x0,{className:"h-3.5 w-3.5"})," Abort"]})]})]}),t.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[t.jsx("div",{className:"card",children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-blue-500/10",children:t.jsx(Sv,{className:"h-4 w-4 text-blue-400"})}),t.jsxs("div",{children:[t.jsx("p",{className:"text-xs text-zinc-500",children:d("run.duration")}),t.jsx("p",{className:"text-lg font-semibold text-white",children:W!==null?`${W}s`:"In progress..."})]})]})}),t.jsx("div",{className:"card",children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-amber-500/10",children:t.jsx(ya,{className:"h-4 w-4 text-amber-400"})}),t.jsxs("div",{children:[t.jsx("p",{className:"text-xs text-zinc-500",children:d("run.cost")}),t.jsx("p",{className:"text-lg font-semibold text-white",children:"$0.00"})]})]})}),t.jsx("div",{className:"card",children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-violet-500/10",children:t.jsx(Ys,{className:"h-4 w-4 text-violet-400"})}),t.jsxs("div",{children:[t.jsx("p",{className:"text-xs text-zinc-500",children:"Events"}),t.jsx("p",{className:"text-lg font-semibold text-white",children:f.length})]})]})})]}),t.jsxs("div",{className:"flex items-center gap-1 border-b border-zinc-700",children:[t.jsx("button",{onClick:()=>E("details"),className:`px-4 py-2 text-sm font-medium border-b-2 transition-colors ${O==="details"?"border-indigo-500 text-indigo-400":"border-transparent text-zinc-500 hover:text-zinc-300"}`,children:"Details"}),t.jsxs("button",{onClick:()=>E("replay"),className:`px-4 py-2 text-sm font-medium border-b-2 transition-colors flex items-center gap-1.5 ${O==="replay"?"border-indigo-500 text-indigo-400":"border-transparent text-zinc-500 hover:text-zinc-300"}`,children:[t.jsx(jt,{className:"h-3.5 w-3.5"}),"Replay"]})]}),O==="replay"&&t.jsx(Hj,{runId:n}),O==="details"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2",children:[t.jsx(Dj,{runId:n}),t.jsxs("div",{className:"card",children:[t.jsx("h2",{className:"mb-4 text-lg font-medium text-zinc-200",children:d("run.events")}),t.jsx(au,{events:f,maxHeight:"500px"})]}),t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"card",children:[t.jsx("h2",{className:"mb-4 text-lg font-medium text-zinc-200",children:d("run.output")}),o.output?t.jsx("pre",{className:"overflow-auto rounded-lg bg-[#0a0a0f] p-4 text-sm text-zinc-300 max-h-64",children:JSON.stringify(o.output,null,2)}):t.jsx("p",{className:"text-sm text-zinc-500",children:"No output available yet."})]}),o.error&&t.jsxs("div",{className:"card border-red-500/20",children:[t.jsx("h2",{className:"mb-2 text-lg font-medium text-red-400",children:"Error"}),t.jsx("pre",{className:"overflow-auto rounded-lg bg-red-500/5 p-4 text-sm text-red-300",children:o.error})]}),t.jsxs("div",{className:"card",children:[t.jsx("h2",{className:"mb-4 text-lg font-medium text-zinc-200",children:"Input"}),t.jsx("pre",{className:"overflow-auto rounded-lg bg-[#0a0a0f] p-4 text-sm text-zinc-300 max-h-40",children:JSON.stringify(o.input,null,2)})]})]})]}),p.filter(F=>F.status==="pending").map(F=>t.jsxs("div",{className:"card border-amber-500/30 bg-amber-500/5",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[t.jsx(_r,{className:"h-5 w-5 text-amber-400"}),t.jsx("h2",{className:"text-lg font-semibold text-amber-300",children:"Handoff Pending"})]}),t.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3 text-sm",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-xs text-zinc-500 mb-1",children:"Accomplished"}),t.jsx("p",{className:"text-zinc-300",children:F.accomplished})]}),t.jsxs("div",{children:[t.jsx("p",{className:"text-xs text-zinc-500 mb-1",children:"Blocking"}),t.jsx("p",{className:"text-red-400",children:F.blocking})]}),t.jsxs("div",{children:[t.jsx("p",{className:"text-xs text-zinc-500 mb-1",children:"Suggestions"}),t.jsx("p",{className:"text-zinc-300",children:F.suggestions})]})]}),t.jsxs("div",{className:"mt-4 flex items-center gap-2",children:[t.jsx("input",{type:"text",className:"flex-1 rounded-lg border border-zinc-700 bg-zinc-800 px-3 py-2 text-sm text-zinc-200 placeholder-zinc-500 focus:border-indigo-500 focus:outline-none",placeholder:"Describe how you resolved the blocking issue...",value:z,onChange:re=>M(re.target.value)}),t.jsx("button",{className:"btn-primary btn-sm",disabled:!z.trim(),onClick:async()=>{try{await $r.resume(F.id,z),M(""),G()}catch(re){console.error("Resume failed:",re)}},children:"Resume"})]})]},F.id)),t.jsxs("div",{className:"card",children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsx("h2",{className:"text-lg font-medium text-zinc-200",children:"Annotations"}),t.jsx("button",{className:"btn-ghost btn-sm",onClick:()=>S(N?null:{type:"note",content:""}),children:N?"Cancel":"+ Add"})]}),N&&t.jsxs("div",{className:"mb-4 rounded-lg border border-zinc-700 p-3 space-y-2",children:[t.jsx("div",{className:"flex gap-2",children:["good","bad","wrong_approach","note"].map(F=>{const re={good:t.jsx(Pl,{className:"h-3.5 w-3.5"}),bad:t.jsx(Od,{className:"h-3.5 w-3.5"}),wrong_approach:t.jsx(kh,{className:"h-3.5 w-3.5"}),note:t.jsx(js,{className:"h-3.5 w-3.5"})},he={good:"text-green-400 border-green-500/30",bad:"text-red-400 border-red-500/30",wrong_approach:"text-amber-400 border-amber-500/30",note:"text-blue-400 border-blue-500/30"};return t.jsxs("button",{className:`flex items-center gap-1.5 rounded-md border px-2 py-1 text-xs ${N.type===F?he[F]+" bg-zinc-800":"border-zinc-700 text-zinc-500 hover:text-zinc-300"}`,onClick:()=>S({...N,type:F}),children:[re[F]," ",F.replace("_"," ")]},F)})}),t.jsx("textarea",{className:"w-full rounded-lg border border-zinc-700 bg-zinc-800 px-3 py-2 text-sm text-zinc-200 placeholder-zinc-500 focus:border-indigo-500 focus:outline-none",rows:2,placeholder:"Add your annotation...",value:N.content,onChange:F=>S({...N,content:F.target.value})}),t.jsx("button",{className:"btn-primary btn-sm",disabled:!N.content.trim(),onClick:async()=>{if(!(!n||!N.content.trim()))try{await Sd.create(n,{type:N.type,content:N.content}),S(null),H()}catch(F){console.error("Failed to add annotation:",F)}},children:"Save Annotation"})]}),b.length===0?t.jsx("p",{className:"text-sm text-zinc-500",children:"No annotations yet."}):t.jsx("div",{className:"space-y-2",children:b.map(F=>{const re={good:"border-green-500/30 bg-green-500/5",bad:"border-red-500/30 bg-red-500/5",wrong_approach:"border-amber-500/30 bg-amber-500/5",note:"border-blue-500/30 bg-blue-500/5",handoff:"border-purple-500/30 bg-purple-500/5"},he={good:t.jsx(Pl,{className:"h-3.5 w-3.5 text-green-400"}),bad:t.jsx(Od,{className:"h-3.5 w-3.5 text-red-400"}),wrong_approach:t.jsx(kh,{className:"h-3.5 w-3.5 text-amber-400"}),note:t.jsx(js,{className:"h-3.5 w-3.5 text-blue-400"}),handoff:t.jsx(_r,{className:"h-3.5 w-3.5 text-purple-400"})};return t.jsxs("div",{className:`flex items-start gap-2 rounded-lg border p-2 text-sm ${re[F.type]??"border-zinc-700"}`,children:[t.jsx("span",{className:"mt-0.5",children:he[F.type]}),t.jsxs("div",{className:"flex-1",children:[t.jsx("p",{className:"text-zinc-300",children:F.content}),t.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[F.author," · ",new Date(F.createdAt).toLocaleString(),F.eventIndex!=null&&` · Event #${F.eventIndex}`]})]}),t.jsx("button",{className:"text-zinc-600 hover:text-red-400 transition-colors",title:"Delete annotation",onClick:async()=>{try{await Sd.delete(F.id),H()}catch(K){console.error("Delete failed:",K)}},children:t.jsx(wt,{className:"h-3.5 w-3.5"})})]},F.id)})})]})]})]})}function Gj(){const{t:n}=We(),[r,d]=u.useState("general"),[o,m]=u.useState(null),[f,h]=u.useState(!0),[b,g]=u.useState(!1),[p,j]=u.useState(!1),[y,w]=u.useState(null);u.useEffect(()=>{pa.getConfig().then(z=>m(z.data)).catch(()=>{m({server:{host:"127.0.0.1",port:3100},security:{defaultTrustLevel:"community",approvalMode:"manual",maxConcurrentRuns:10},budget:{enabled:!1,defaultMaxCostPerRunUsd:1,defaultMaxTokensPerRun:1e5,warningThresholdPercent:80},logging:{level:"info",format:"pretty"}})}).finally(()=>h(!1))},[]);const C=async()=>{if(o){g(!0),j(!1),w(null);try{const z=await pa.updateConfig(o);m(z.data),j(!0),setTimeout(()=>j(!1),3e3)}catch(z){w(z instanceof Error?z.message:"Failed to save")}finally{g(!1)}}},k=async()=>{h(!0);try{const z=await pa.getConfig();m(z.data),w(null)}catch{w("Failed to refresh config")}finally{h(!1)}},N=(z,M,O)=>{o&&m({...o,[z]:{...o[z],[M]:O}})},S=[{key:"general",label:n("settings.general")},{key:"security",label:n("settings.security")},{key:"budget",label:n("settings.budget")},{key:"apikeys",label:"API Keys"},{key:"studio",label:"Studio"}];return f?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})}):o?t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h1",{className:"text-2xl font-semibold text-white",children:n("settings.title")}),t.jsxs("div",{className:"flex items-center gap-3",children:[p&&t.jsxs("span",{className:"flex items-center gap-1.5 text-sm text-green-400",children:[t.jsx(ht,{className:"h-4 w-4"}),n("settings.saved")]}),y&&t.jsxs("span",{className:"flex items-center gap-1.5 text-sm text-red-400",children:[t.jsx(Fl,{className:"h-4 w-4"}),y]}),t.jsx("button",{onClick:k,className:"btn-ghost btn-sm",children:t.jsx(Yt,{className:"h-4 w-4"})}),t.jsxs("button",{onClick:C,disabled:b,className:"btn-primary",children:[t.jsx(Qr,{className:"h-4 w-4"}),n(b?"common.loading":"settings.save")]})]})]}),t.jsx("div",{className:"flex gap-1 border-b border-border",children:S.map(({key:z,label:M})=>t.jsx("button",{onClick:()=>d(z),className:`px-4 py-2.5 text-sm font-medium transition-colors border-b-2 ${r===z?"border-indigo-500 text-indigo-400":"border-transparent text-zinc-400 hover:text-zinc-200"}`,children:M},z))}),r==="general"&&t.jsxs("div",{className:"card space-y-6",children:[t.jsx("h2",{className:"text-lg font-medium text-zinc-200",children:"Server Configuration"}),t.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[t.jsxs("div",{children:[t.jsx("label",{className:"label",children:"Host"}),t.jsx("input",{className:"input",value:o.server.host,onChange:z=>N("server","host",z.target.value)})]}),t.jsxs("div",{children:[t.jsx("label",{className:"label",children:"Port"}),t.jsx("input",{className:"input",type:"number",value:o.server.port,onChange:z=>N("server","port",parseInt(z.target.value)||3100)})]})]}),t.jsx("h2",{className:"text-lg font-medium text-zinc-200 pt-4",children:"Logging"}),t.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[t.jsxs("div",{children:[t.jsx("label",{className:"label",children:"Level"}),t.jsxs("select",{className:"input",value:o.logging.level,onChange:z=>N("logging","level",z.target.value),children:[t.jsx("option",{value:"debug",children:"Debug"}),t.jsx("option",{value:"info",children:"Info"}),t.jsx("option",{value:"warn",children:"Warn"}),t.jsx("option",{value:"error",children:"Error"})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"label",children:"Format"}),t.jsxs("select",{className:"input",value:o.logging.format,onChange:z=>N("logging","format",z.target.value),children:[t.jsx("option",{value:"json",children:"JSON"}),t.jsx("option",{value:"pretty",children:"Pretty"})]})]})]})]}),r==="security"&&t.jsxs("div",{className:"card space-y-6",children:[t.jsx("h2",{className:"text-lg font-medium text-zinc-200",children:"Security Settings"}),t.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[t.jsxs("div",{children:[t.jsx("label",{className:"label",children:"Default Trust Level"}),t.jsxs("select",{className:"input",value:o.security.defaultTrustLevel,onChange:z=>N("security","defaultTrustLevel",z.target.value),children:[t.jsx("option",{value:"builtin",children:"Built-in"}),t.jsx("option",{value:"official",children:"Official"}),t.jsx("option",{value:"trusted",children:"Trusted"}),t.jsx("option",{value:"community",children:"Community"}),t.jsx("option",{value:"local",children:"Local"})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"label",children:"Approval Mode"}),t.jsxs("select",{className:"input",value:o.security.approvalMode,onChange:z=>N("security","approvalMode",z.target.value),children:[t.jsx("option",{value:"manual",children:"Manual"}),t.jsx("option",{value:"smart",children:"Smart"}),t.jsx("option",{value:"off",children:"Off"})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"label",children:"Max Concurrent Runs"}),t.jsx("input",{className:"input",type:"number",value:o.security.maxConcurrentRuns,onChange:z=>N("security","maxConcurrentRuns",parseInt(z.target.value)||10)})]})]})]}),r==="budget"&&t.jsxs("div",{className:"card space-y-6",children:[t.jsx("h2",{className:"text-lg font-medium text-zinc-200",children:"Budget Configuration"}),t.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[t.jsxs("label",{className:"relative inline-flex cursor-pointer items-center",children:[t.jsx("input",{type:"checkbox",checked:o.budget.enabled,onChange:z=>N("budget","enabled",z.target.checked),className:"peer sr-only"}),t.jsx("div",{className:"h-6 w-11 rounded-full bg-zinc-700 after:absolute after:left-[2px] after:top-0.5 after:h-5 after:w-5 after:rounded-full after:bg-white after:transition-all peer-checked:bg-indigo-600 peer-checked:after:translate-x-full"})]}),t.jsx("span",{className:"text-sm text-zinc-300",children:"Enable Budget Tracking"})]}),t.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[t.jsxs("div",{children:[t.jsx("label",{className:"label",children:"Default Max Cost Per Run (USD)"}),t.jsx("input",{className:"input",type:"number",step:"0.01",value:o.budget.defaultMaxCostPerRunUsd,onChange:z=>N("budget","defaultMaxCostPerRunUsd",parseFloat(z.target.value)||1)})]}),t.jsxs("div",{children:[t.jsx("label",{className:"label",children:"Default Max Tokens Per Run"}),t.jsx("input",{className:"input",type:"number",value:o.budget.defaultMaxTokensPerRun,onChange:z=>N("budget","defaultMaxTokensPerRun",parseInt(z.target.value)||1e5)})]}),t.jsxs("div",{children:[t.jsx("label",{className:"label",children:"Warning Threshold (%)"}),t.jsx("input",{className:"input",type:"number",min:0,max:100,value:o.budget.warningThresholdPercent,onChange:z=>N("budget","warningThresholdPercent",parseInt(z.target.value)||80)})]})]})]}),r==="apikeys"&&t.jsx(Kj,{}),r==="studio"&&t.jsxs("div",{className:"card space-y-6",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(pv,{className:"h-5 w-5 text-indigo-400"}),t.jsx("h2",{className:"text-lg font-medium text-zinc-200",children:"Studio Web UI"})]}),t.jsx("p",{className:"text-sm text-zinc-400",children:"The Studio web UI provides a browser-based dashboard for managing agents, workflows, and monitoring runs. You are currently viewing the Studio interface."}),t.jsxs("div",{className:"rounded-lg border border-border bg-zinc-900/50 p-4",children:[t.jsx("h3",{className:"text-sm font-medium text-zinc-200",children:"Current Configuration"}),t.jsx("pre",{className:"mt-2 text-xs text-zinc-400 overflow-auto max-h-40 rounded bg-[#0a0a0f] p-3",children:JSON.stringify(o,null,2)})]}),t.jsxs("div",{className:"text-xs text-zinc-500",children:["Changes are applied to the runtime config and take effect immediately. To persist changes across restarts, update the Nestor config file.",t.jsx("code",{className:"ml-1 rounded bg-zinc-800 px-1.5 py-0.5 text-zinc-300",children:"npx nestor-sh config edit"})]})]})]}):null}const Lh=[{id:"gemini",name:"Gemini",provider:"Google",emoji:"🔵",color:"text-blue-400",defaultModel:"gemini-2.5-flash",keyUrl:"https://aistudio.google.com/apikey",keyUrlLabel:"aistudio.google.com",needsKey:!0},{id:"claude",name:"Claude",provider:"Anthropic",emoji:"🟣",color:"text-purple-400",defaultModel:"claude-sonnet-4-6",keyUrl:"https://console.anthropic.com/settings/keys",keyUrlLabel:"console.anthropic.com",needsKey:!0},{id:"openai",name:"GPT-4o",provider:"OpenAI",emoji:"🟢",color:"text-green-400",defaultModel:"gpt-4o",keyUrl:"https://platform.openai.com/api-keys",keyUrlLabel:"platform.openai.com",needsKey:!0},{id:"grok",name:"Grok",provider:"xAI",emoji:"⚪",color:"text-zinc-300",defaultModel:"grok-3",keyUrl:"https://console.x.ai/",keyUrlLabel:"console.x.ai",needsKey:!0},{id:"mistral",name:"Mistral",provider:"Mistral AI",emoji:"🟠",color:"text-orange-400",defaultModel:"mistral-large-latest",keyUrl:"https://console.mistral.ai/api-keys",keyUrlLabel:"console.mistral.ai",needsKey:!0},{id:"ollama",name:"Ollama",provider:"Local",emoji:"🦙",color:"text-amber-400",defaultModel:"llama3.1",keyUrl:"https://ollama.ai/download",keyUrlLabel:"ollama.ai",needsKey:!1}];function Kj(){const[n,r]=u.useState([]),[d,o]=u.useState(!0),[m,f]=u.useState(null),[h,b]=u.useState(""),[g,p]=u.useState(!1),[j,y]=u.useState(null),[w,C]=u.useState(null),[k,N]=u.useState({}),S=u.useCallback(async()=>{try{const G=await oa.list();r(G.data)}catch{}finally{o(!1)}},[]);u.useEffect(()=>{S()},[S]);const z=G=>n.find(P=>P.provider===G),M=G=>{f(G),b(""),p(!1)},O=()=>{f(null),b(""),p(!1)},E=async G=>{if(h.trim()){y(G);try{await oa.set(G,h.trim()),f(null),b(""),await S()}catch{}finally{y(null)}}},ae=async G=>{C(G);try{const P=await oa.test(G);N(W=>({...W,[G]:P.data}))}catch(P){N(W=>({...W,[G]:{valid:!1,message:P instanceof Error?P.message:"Test failed"}}))}finally{C(null)}},ce=async G=>{try{await oa.remove(G),N(P=>{const W={...P};return delete W[G],W}),await S()}catch{}};if(d)return t.jsx("div",{className:"flex items-center justify-center py-16",children:t.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-purple-500 border-t-transparent"})});const H=n.filter(G=>G.configured).length;return t.jsxs("div",{className:"space-y-6",children:[t.jsx("div",{className:"rounded-xl border border-border bg-surface/50 p-4",children:t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx(Ns,{className:"h-5 w-5 text-purple-400 mt-0.5 flex-shrink-0"}),t.jsxs("div",{className:"text-xs text-zinc-400 space-y-1",children:[t.jsx("p",{children:"API keys are encrypted with AES-256-GCM and stored locally in the Nestor database. Keys set via environment variables take precedence over database-stored keys."}),t.jsxs("p",{className:"text-zinc-500",children:[H,"/",Lh.length," providers configured."]})]})]})}),t.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3",children:Lh.map(G=>{const P=z(G.id),W=(P==null?void 0:P.configured)??!1,Q=m===G.id,le=w===G.id,F=j===G.id,re=k[G.id];return t.jsxs("div",{className:`rounded-xl border bg-surface p-5 transition-all hover:shadow-lg hover:shadow-black/20 ${W?"border-border":"border-border/50"}`,children:[t.jsxs("div",{className:"flex items-start justify-between mb-3",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("span",{className:"text-2xl",children:G.emoji}),t.jsxs("div",{children:[t.jsx("h3",{className:"text-sm font-semibold text-white",children:G.name}),t.jsx("p",{className:"text-xs text-zinc-500",children:G.provider})]})]}),W?t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-green-500/10 px-2.5 py-0.5 text-xs font-medium text-green-400",children:[t.jsx(ht,{className:"h-3 w-3"}),"Configured"]}):t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-red-500/10 px-2.5 py-0.5 text-xs font-medium text-red-400",children:[t.jsx(Je,{className:"h-3 w-3"}),"Not set"]})]}),t.jsxs("p",{className:"text-xs text-zinc-500 mb-3",children:["Default model: ",t.jsx("code",{className:"text-zinc-400",children:G.defaultModel})]}),W&&(P==null?void 0:P.maskedKey)&&!Q&&t.jsxs("div",{className:"mb-3 rounded-lg bg-background/50 px-3 py-2",children:[t.jsx("p",{className:"font-mono text-xs text-zinc-400",children:P.maskedKey}),P.source==="env"&&t.jsx("p",{className:"text-[10px] text-yellow-500/80 mt-0.5",children:"From environment variable"}),P.source==="db"&&P.label&&t.jsx("p",{className:"text-[10px] text-zinc-600 mt-0.5",children:P.label})]}),Q&&t.jsxs("div",{className:"mb-3 space-y-2",children:[t.jsxs("div",{className:"relative",children:[t.jsx("input",{type:g?"text":"password",value:h,onChange:he=>b(he.target.value),placeholder:`Enter ${G.provider} API key`,className:"w-full rounded-lg border border-border bg-background px-3 py-2 pr-10 text-sm text-zinc-200 focus:border-purple-500 focus:outline-none placeholder:text-zinc-600",autoFocus:!0}),t.jsx("button",{type:"button",onClick:()=>p(!g),className:"absolute right-3 top-1/2 -translate-y-1/2 text-zinc-500 hover:text-zinc-300",children:g?t.jsx(Qd,{className:"h-3.5 w-3.5"}):t.jsx(Vr,{className:"h-3.5 w-3.5"})})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("button",{onClick:()=>E(G.id),disabled:!h.trim()||F,className:"inline-flex items-center gap-1.5 rounded-lg bg-purple-600 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-purple-700 disabled:opacity-50 disabled:cursor-not-allowed",children:[F?t.jsx(ot,{className:"h-3 w-3 animate-spin"}):t.jsx(ht,{className:"h-3 w-3"}),"Save"]}),t.jsx("button",{onClick:O,className:"inline-flex items-center gap-1.5 rounded-lg border border-border px-3 py-1.5 text-xs font-medium text-zinc-400 transition-colors hover:bg-surface-hover",children:"Cancel"})]})]}),re&&t.jsxs("div",{className:`mb-3 rounded-lg border p-2.5 text-xs ${re.valid?"border-green-500/20 bg-green-500/5 text-green-400":"border-red-500/20 bg-red-500/5 text-red-400"}`,children:[t.jsxs("div",{className:"flex items-center gap-1.5 font-medium",children:[re.valid?t.jsx(ht,{className:"h-3 w-3"}):t.jsx(Fl,{className:"h-3 w-3"}),re.valid?"Working":"Failed"]}),t.jsx("p",{className:"mt-0.5 text-[10px] opacity-80",children:re.message}),re.models&&re.models.length>0&&t.jsxs("div",{className:"mt-1.5 flex flex-wrap gap-1",children:[re.models.slice(0,4).map(he=>t.jsx("span",{className:"rounded bg-white/5 px-1.5 py-0.5 text-[9px] font-mono",children:he},he)),re.models.length>4&&t.jsxs("span",{className:"rounded bg-white/5 px-1.5 py-0.5 text-[9px]",children:["+",re.models.length-4]})]})]}),t.jsx("div",{className:"flex items-center gap-2",children:W&&!Q?t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:()=>ae(G.id),disabled:le,className:"inline-flex items-center gap-1.5 rounded-lg border border-border px-3 py-1.5 text-xs font-medium text-zinc-400 transition-colors hover:bg-surface-hover hover:text-zinc-200 disabled:opacity-50",children:[le?t.jsx(ot,{className:"h-3 w-3 animate-spin"}):t.jsx(Il,{className:"h-3 w-3"}),"Test"]}),G.needsKey&&t.jsxs("button",{onClick:()=>M(G.id),className:"inline-flex items-center gap-1.5 rounded-lg border border-border px-3 py-1.5 text-xs font-medium text-zinc-400 transition-colors hover:bg-surface-hover hover:text-zinc-200",children:[t.jsx(ti,{className:"h-3 w-3"}),"Edit"]}),(P==null?void 0:P.source)==="db"&&t.jsxs("button",{onClick:()=>ce(G.id),className:"inline-flex items-center gap-1.5 rounded-lg border border-red-500/20 px-3 py-1.5 text-xs font-medium text-red-400 transition-colors hover:bg-red-500/10",children:[t.jsx(Mt,{className:"h-3 w-3"}),"Remove"]})]}):Q?null:G.needsKey?t.jsxs("button",{onClick:()=>M(G.id),className:"inline-flex items-center gap-1.5 rounded-lg bg-purple-600 px-4 py-1.5 text-xs font-medium text-white transition-colors hover:bg-purple-700",children:[t.jsx(pt,{className:"h-3 w-3"}),"Add Key"]}):t.jsxs("button",{onClick:()=>ae(G.id),disabled:le,className:"inline-flex items-center gap-1.5 rounded-lg border border-border px-3 py-1.5 text-xs font-medium text-zinc-400 transition-colors hover:bg-surface-hover hover:text-zinc-200 disabled:opacity-50",children:[le?t.jsx(ot,{className:"h-3 w-3 animate-spin"}):t.jsx(Il,{className:"h-3 w-3"}),"Test Connection"]})}),t.jsx("div",{className:"mt-3 border-t border-border/50 pt-2.5",children:t.jsxs("a",{href:G.keyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-[10px] text-zinc-600 hover:text-zinc-400 transition-colors",children:[t.jsx($n,{className:"h-2.5 w-2.5"}),"Get API Key at ",G.keyUrlLabel]})})]},G.id)})})]})}const _h={low:{bg:"bg-green-500/10",text:"text-green-400",icon:Pd},medium:{bg:"bg-amber-500/10",text:"text-amber-400",icon:lt},high:{bg:"bg-orange-500/10",text:"text-orange-400",icon:ba},critical:{bg:"bg-red-500/10",text:"text-red-400",icon:ev}},nu={command:"Command",budget:"Budget",config:"Config",hire:"Hire",strategy:"Strategy",deploy:"Deploy",custom:"Custom"},Vj={pending:"bg-amber-500/10 text-amber-400",approved:"bg-green-500/10 text-green-400",rejected:"bg-red-500/10 text-red-400",expired:"bg-zinc-500/10 text-zinc-400"};function Uh({approval:n,onApprove:r,onReject:d,actionLoading:o,showActions:m}){const[f,h]=u.useState(""),b=_h[n.riskLevel]??_h.medium,g=b.icon,p=o===n.id;return t.jsx("div",{className:"card hover:border-amber-500/20 transition-colors",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:[t.jsx("div",{className:`flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-lg ${b.bg}`,children:t.jsx(g,{className:`h-5 w-5 ${b.text}`})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[t.jsx("span",{className:"font-medium text-zinc-200",children:n.title}),t.jsx("span",{className:`badge ${b.bg} ${b.text} uppercase text-[10px]`,children:n.riskLevel}),t.jsx("span",{className:"badge bg-zinc-700/50 text-zinc-400 text-[10px]",children:nu[n.type]??n.type}),n.status!=="pending"&&t.jsx("span",{className:`badge ${Vj[n.status]} uppercase text-[10px]`,children:n.status})]}),n.description&&t.jsx("p",{className:"mt-1 text-sm text-zinc-400",children:n.description}),t.jsxs("p",{className:"mt-1 text-sm text-zinc-500",children:["Agent: ",t.jsx("span",{className:"text-zinc-300",children:n.agentId})]}),Object.keys(n.payload).length>0&&t.jsx("pre",{className:"mt-2 max-h-24 overflow-auto rounded-lg bg-[#0a0a0f] p-3 text-xs text-zinc-400",children:JSON.stringify(n.payload,null,2)}),t.jsxs("div",{className:"mt-2 flex items-center gap-4 text-xs text-zinc-500",children:[t.jsx("span",{children:new Date(n.createdAt).toLocaleString()}),n.reviewerId&&t.jsxs("span",{children:["Reviewed by: ",t.jsx("span",{className:"text-zinc-400",children:n.reviewerId})]}),n.reviewComment&&t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx(js,{className:"h-3 w-3"}),n.reviewComment]})]})]})]}),m&&n.status==="pending"&&t.jsxs("div",{className:"flex flex-col gap-2 flex-shrink-0",children:[t.jsx("input",{type:"text",placeholder:"Comment...",value:f,onChange:j=>h(j.target.value),className:"input text-xs w-40"}),t.jsxs("button",{onClick:()=>r==null?void 0:r(n.id,f),disabled:p,className:"btn-primary btn-sm",children:[t.jsx(ht,{className:"h-3.5 w-3.5"}),"Approve"]}),t.jsxs("button",{onClick:()=>d==null?void 0:d(n.id,f),disabled:p,className:"btn-danger btn-sm",children:[t.jsx(Je,{className:"h-3.5 w-3.5"}),"Reject"]})]})]})})}function Yj({stats:n}){const d=n.pending+n.approved+n.rejected+n.expired>0?Math.round(n.approved/(n.approved+n.rejected||1)*100):0;return t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[t.jsxs("div",{className:"card text-center",children:[t.jsx("p",{className:"text-2xl font-bold text-amber-400",children:n.pending}),t.jsx("p",{className:"text-xs text-zinc-500",children:"Pending"})]}),t.jsxs("div",{className:"card text-center",children:[t.jsx("p",{className:"text-2xl font-bold text-green-400",children:n.approved}),t.jsx("p",{className:"text-xs text-zinc-500",children:"Approved"})]}),t.jsxs("div",{className:"card text-center",children:[t.jsx("p",{className:"text-2xl font-bold text-red-400",children:n.rejected}),t.jsx("p",{className:"text-xs text-zinc-500",children:"Rejected"})]}),t.jsxs("div",{className:"card text-center",children:[t.jsx("p",{className:"text-2xl font-bold text-zinc-400",children:n.expired}),t.jsx("p",{className:"text-xs text-zinc-500",children:"Expired"})]})]}),t.jsxs("div",{className:"card",children:[t.jsx("h3",{className:"text-sm font-medium text-zinc-300 mb-3",children:"Approval Rate"}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"flex-1 h-2 rounded-full bg-zinc-800",children:t.jsx("div",{className:"h-full rounded-full bg-green-500",style:{width:`${d}%`}})}),t.jsxs("span",{className:"text-sm font-medium text-zinc-300",children:[d,"%"]})]})]}),Object.keys(n.byType).length>0&&t.jsxs("div",{className:"card",children:[t.jsx("h3",{className:"text-sm font-medium text-zinc-300 mb-3",children:"By Type"}),t.jsx("div",{className:"space-y-2",children:Object.entries(n.byType).map(([o,m])=>t.jsxs("div",{className:"flex items-center justify-between text-sm",children:[t.jsx("span",{className:"text-zinc-400",children:nu[o]??o}),t.jsx("span",{className:"font-medium text-zinc-200",children:m})]},o))})]})]})}function Xj(){const{t:n}=We(),[r,d]=u.useState("pending"),[o,m]=u.useState([]),[f,h]=u.useState([]),[b,g]=u.useState(null),[p,j]=u.useState(!0),[y,w]=u.useState(null),[C,k]=u.useState(null),[N,S]=u.useState(""),[z,M]=u.useState(""),O=u.useCallback(async()=>{try{w(null);const G={status:"pending"};N&&(G.type=N);let W=(await Xl.list(G)).data;z&&(W=W.filter(Q=>Q.riskLevel===z)),m(W)}catch(G){w(G instanceof Error?G.message:"Failed to fetch approvals"),m([])}finally{j(!1)}},[N,z]),E=u.useCallback(async()=>{try{const G=await Xl.history({limit:100});h(G.data)}catch{h([])}},[]),ae=u.useCallback(async()=>{try{const G=await Xl.stats();g(G.data)}catch{g(null)}},[]);u.useEffect(()=>{r==="pending"?O():r==="history"?E():r==="stats"&&ae()},[r,O,E,ae]),u.useEffect(()=>{if(r==="pending"){const G=setInterval(O,5e3);return()=>clearInterval(G)}},[r,O]);const ce=async(G,P)=>{k(G);try{await Xl.approve(G,{comment:P||void 0}),m(W=>W.filter(Q=>Q.id!==G))}catch(W){console.error("Approve failed:",W)}finally{k(null)}},H=async(G,P)=>{k(G);try{await Xl.reject(G,{reason:P||void 0}),m(W=>W.filter(Q=>Q.id!==G))}catch(W){console.error("Reject failed:",W)}finally{k(null)}};return p&&r==="pending"?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})}):t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("h1",{className:"text-2xl font-semibold text-white",children:n("approvals.title")}),o.length>0&&r==="pending"&&t.jsxs("span",{className:"badge bg-amber-500/10 text-amber-400",children:[o.length," pending"]})]}),t.jsx("button",{onClick:()=>{r==="pending"?O():r==="history"?E():ae()},className:"btn-ghost btn-sm",children:t.jsx(Yt,{className:"h-4 w-4"})})]}),t.jsx("div",{className:"flex items-center gap-1 border-b border-border",children:[{key:"pending",label:"Pending",icon:ba},{key:"history",label:"History",icon:zh},{key:"stats",label:"Stats",icon:ga}].map(({key:G,label:P,icon:W})=>t.jsxs("button",{onClick:()=>d(G),className:`flex items-center gap-2 border-b-2 px-4 py-2.5 text-sm font-medium transition-colors ${r===G?"border-indigo-500 text-indigo-400":"border-transparent text-zinc-500 hover:text-zinc-300"}`,children:[t.jsx(W,{className:"h-4 w-4"}),P]},G))}),r==="pending"&&t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(h0,{className:"h-4 w-4 text-zinc-500"}),t.jsxs("select",{value:N,onChange:G=>S(G.target.value),className:"input text-sm w-40",children:[t.jsx("option",{value:"",children:"All Types"}),Object.entries(nu).map(([G,P])=>t.jsx("option",{value:G,children:P},G))]}),t.jsxs("select",{value:z,onChange:G=>M(G.target.value),className:"input text-sm w-40",children:[t.jsx("option",{value:"",children:"All Risk Levels"}),t.jsx("option",{value:"low",children:"Low"}),t.jsx("option",{value:"medium",children:"Medium"}),t.jsx("option",{value:"high",children:"High"}),t.jsx("option",{value:"critical",children:"Critical"})]})]}),y&&t.jsxs("div",{className:"rounded-lg border border-red-500/20 bg-red-500/5 p-4 text-sm text-red-400",children:[y,t.jsx("button",{onClick:O,className:"ml-3 underline",children:"Retry"})]}),r==="pending"&&(o.length===0&&!y?t.jsx(Qs,{icon:t.jsx(Pd,{className:"h-8 w-8"}),title:n("approvals.empty"),description:n("approvals.emptyDesc")}):t.jsx("div",{className:"space-y-3",children:o.map(G=>t.jsx(Uh,{approval:G,onApprove:ce,onReject:H,actionLoading:C,showActions:!0},G.id))})),r==="history"&&(f.length===0?t.jsx(Qs,{icon:t.jsx(zh,{className:"h-8 w-8"}),title:"No history",description:"Approval history will appear here after decisions are made."}):t.jsx("div",{className:"space-y-3",children:f.map(G=>t.jsx(Uh,{approval:G,actionLoading:null,showActions:!1},G.id))})),r==="stats"&&b&&t.jsx(Yj,{stats:b})]})}const Qj="/api";async function Zj(n=30){const r=localStorage.getItem("nestor_token"),d={"Content-Type":"application/json"};r&&(d.Authorization=`Bearer ${r}`);const o=localStorage.getItem("nestor_tenant_id");o&&(d["X-Tenant-ID"]=o);try{const m=await fetch(`${Qj}/analytics/quality?days=${n}`,{headers:d});return m.ok?(await m.json()).data??null:null}catch{return null}}function Zr(n){return`${(n*100).toFixed(0)}%`}function z0(n){return n>0?`+${(n*100).toFixed(0)}%`:`${(n*100).toFixed(0)}%`}function Cr({label:n,value:r,icon:d,color:o,bgColor:m,subtitle:f}){return t.jsx("div",{className:"card",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-sm text-zinc-400",children:n}),t.jsx("p",{className:"mt-1 text-2xl font-semibold text-white",children:r}),f&&t.jsx("p",{className:"mt-0.5 text-xs text-zinc-500",children:f})]}),t.jsx("div",{className:`flex h-11 w-11 items-center justify-center rounded-xl ${m}`,children:t.jsx(d,{className:`h-5 w-5 ${o}`})})]})})}function Jj({data:n}){return n.length===0?t.jsx("div",{className:"flex h-48 items-center justify-center text-zinc-500 text-sm",children:"No data available"}):t.jsx("div",{className:"flex items-end gap-1 h-48",children:n.map(r=>{const d=Math.max(r.successRate*100,2),o=r.successRate>=.8?"bg-emerald-500 hover:bg-emerald-400":r.successRate>=.5?"bg-amber-500 hover:bg-amber-400":"bg-red-500 hover:bg-red-400";return t.jsxs("div",{className:"flex-1 flex flex-col items-center min-w-0",children:[t.jsx("div",{className:`w-full rounded-t transition-all cursor-default min-h-[2px] ${o}`,style:{height:`${d}%`},title:`${r.date}: ${Zr(r.successRate)} (${r.completedRuns}/${r.totalRuns} runs)`}),t.jsx("span",{className:"text-[10px] text-zinc-500 mt-1 truncate w-full text-center",children:r.date.slice(5)})]},r.date)})})}function Fj({agents:n}){return n.length===0?t.jsx("p",{className:"text-zinc-500 text-sm",children:"No agent data available"}):t.jsx("div",{className:"space-y-2",children:n.map((r,d)=>{const o=r.score>=70?"text-emerald-400":r.score>=50?"text-amber-400":"text-red-400",m=r.score>=70?"bg-emerald-500":r.score>=50?"bg-amber-500":"bg-red-500";return t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsxs("span",{className:"w-6 text-xs text-zinc-500 text-right font-mono",children:["#",d+1]}),t.jsx("span",{className:"text-sm text-zinc-300 w-32 truncate",title:r.name,children:r.name}),t.jsx("div",{className:"flex-1 h-2 bg-zinc-800 rounded-full overflow-hidden",children:t.jsx("div",{className:`h-full rounded-full transition-all ${m}`,style:{width:`${Math.min(r.score,100)}%`}})}),t.jsx("span",{className:`text-xs font-medium w-12 text-right ${o}`,children:r.score.toFixed(0)}),t.jsx("span",{className:"text-xs text-zinc-500 w-16 text-right",children:Zr(r.successRate)})]},r.agentId)})})}function Ij({items:n}){return n.length===0?t.jsxs("div",{className:"flex items-center gap-2 text-sm text-zinc-500",children:[t.jsx(ct,{className:"h-4 w-4 text-emerald-500"}),"All agents performing well"]}):t.jsx("div",{className:"space-y-2",children:n.map(r=>t.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-lg bg-red-500/5 border border-red-500/20",children:[t.jsx(lt,{className:"h-4 w-4 text-red-400 shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("span",{className:"text-sm text-zinc-300 truncate block",children:r.name}),t.jsx("span",{className:"text-xs text-zinc-500",children:r.issue})]}),t.jsx("span",{className:"text-xs text-red-400 font-mono",children:typeof r.metric=="number"&&r.metric<=1?Zr(r.metric):z0(r.metric)})]},r.agentId))})}function Pj({tools:n}){if(n.length===0)return t.jsx("p",{className:"text-zinc-500 text-sm",children:"No tool usage data"});const r=Math.max(...n.map(d=>d.count),1);return t.jsx("div",{className:"space-y-2",children:n.slice(0,10).map(d=>{const o=d.failRate>=.3?"text-red-400":d.failRate>=.1?"text-amber-400":"text-zinc-500";return t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(Qn,{className:"h-3.5 w-3.5 text-zinc-500 shrink-0"}),t.jsx("span",{className:"text-xs text-zinc-300 w-32 truncate font-mono",title:d.name,children:d.name}),t.jsx("div",{className:"flex-1 h-1.5 bg-zinc-800 rounded-full overflow-hidden",children:t.jsx("div",{className:"h-full bg-indigo-500 rounded-full",style:{width:`${d.count/r*100}%`}})}),t.jsx("span",{className:"text-xs text-zinc-500 w-10 text-right",children:d.count}),t.jsxs("span",{className:`text-xs w-12 text-right ${o}`,children:[(d.failRate*100).toFixed(0),"% fail"]})]},d.name)})})}function Wj({errors:n}){return n.length===0?t.jsxs("div",{className:"flex items-center gap-2 text-sm text-zinc-500",children:[t.jsx(ct,{className:"h-4 w-4 text-emerald-500"}),"No recurring errors detected"]}):t.jsx("div",{className:"space-y-2",children:n.slice(0,8).map((r,d)=>t.jsxs("div",{className:"flex items-start gap-2 p-2 rounded-lg bg-zinc-800/50",children:[t.jsx(m0,{className:"h-3.5 w-3.5 text-red-400 shrink-0 mt-0.5"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-xs text-zinc-300 font-mono break-all line-clamp-2",children:r.pattern}),t.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[t.jsxs("span",{className:"text-[10px] text-zinc-500",children:[r.count," occurrences"]}),r.lastSeen&&t.jsxs("span",{className:"text-[10px] text-zinc-600",children:["Last: ",new Date(r.lastSeen).toLocaleDateString()]})]})]})]},d))})}function e1(){const[n,r]=u.useState(null),[d,o]=u.useState(!0),[m,f]=u.useState(null),[h,b]=u.useState(30);if(u.useEffect(()=>{async function j(){o(!0),f(null);const y=await Zj(h);y?r(y):f("Failed to load quality metrics"),o(!1)}j()},[h]),d)return t.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:t.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})});if(m||!n)return t.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-3",children:[t.jsx(lt,{className:"h-8 w-8 text-amber-500"}),t.jsx("p",{className:"text-zinc-400",children:m??"No data available"})]});const g=n.overallFeedbackScore>=0?"text-emerald-400":"text-red-400",p=n.overallSuccessRate>=.8?"text-emerald-400":n.overallSuccessRate>=.5?"text-amber-400":"text-red-400";return t.jsxs("div",{className:"space-y-6",children:[t.jsx("div",{className:"flex items-center gap-2",children:[7,14,30,90].map(j=>t.jsxs("button",{onClick:()=>b(j),className:`px-3 py-1 text-xs rounded-lg transition-colors ${h===j?"bg-indigo-500/20 text-indigo-400 border border-indigo-500/30":"bg-zinc-800/50 text-zinc-500 border border-zinc-700/50 hover:border-zinc-600"}`,children:[j,"d"]},j))}),t.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[t.jsx(Cr,{label:"Total Runs",value:String(n.totalRuns),icon:Kt,color:"text-blue-400",bgColor:"bg-blue-400/10",subtitle:`Last ${h} days`}),t.jsx(Cr,{label:"Success Rate",value:Zr(n.overallSuccessRate),icon:ct,color:p,bgColor:n.overallSuccessRate>=.8?"bg-emerald-400/10":"bg-amber-400/10"}),t.jsx(Cr,{label:"Feedback Score",value:z0(n.overallFeedbackScore),icon:Pl,color:g,bgColor:n.overallFeedbackScore>=0?"bg-emerald-400/10":"bg-red-400/10"}),t.jsx(Cr,{label:"Active Agents",value:`${n.activeAgents} / ${n.totalAgents}`,icon:Xn,color:"text-purple-400",bgColor:"bg-purple-400/10"})]}),t.jsxs("div",{className:"card",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[t.jsx(ga,{className:"h-4 w-4 text-zinc-400"}),t.jsx("h2",{className:"text-lg font-medium text-white",children:"Success Rate Trend"})]}),t.jsx(Jj,{data:n.dailySuccessRates})]}),t.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2",children:[t.jsxs("div",{className:"card",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[t.jsx(Wd,{className:"h-4 w-4 text-zinc-400"}),t.jsx("h2",{className:"text-lg font-medium text-white",children:"Top Performers"})]}),t.jsx(Fj,{agents:n.topPerformers})]}),t.jsxs("div",{className:"card",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[t.jsx(lt,{className:"h-4 w-4 text-zinc-400"}),t.jsx("h2",{className:"text-lg font-medium text-white",children:"Needs Attention"})]}),t.jsx(Ij,{items:n.needsAttention})]})]}),t.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2",children:[t.jsxs("div",{className:"card",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[t.jsx(Qn,{className:"h-4 w-4 text-zinc-400"}),t.jsx("h2",{className:"text-lg font-medium text-white",children:"Tool Performance"})]}),t.jsx(Pj,{tools:n.toolPerformance})]}),t.jsxs("div",{className:"card",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[t.jsx(m0,{className:"h-4 w-4 text-zinc-400"}),t.jsx("h2",{className:"text-lg font-medium text-white",children:"Error Patterns"})]}),t.jsx(Wj,{errors:n.errorPatterns})]})]})]})}function Ar({label:n,value:r,icon:d,color:o,bgColor:m,subtitle:f}){return t.jsx("div",{className:"card",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-sm text-zinc-400",children:n}),t.jsx("p",{className:"mt-1 text-2xl font-semibold text-white",children:r}),f&&t.jsx("p",{className:"mt-0.5 text-xs text-zinc-500",children:f})]}),t.jsx("div",{className:`flex h-11 w-11 items-center justify-center rounded-xl ${m}`,children:t.jsx(d,{className:`h-5 w-5 ${o}`})})]})})}function t1({data:n}){if(n.length===0)return t.jsx("div",{className:"flex h-48 items-center justify-center text-zinc-500 text-sm",children:"No cost data available"});const r=Math.max(...n.map(d=>d.costUsd),1e-4);return t.jsx("div",{className:"flex items-end gap-1 h-48",children:n.map(d=>t.jsxs("div",{className:"flex-1 flex flex-col items-center min-w-0",children:[t.jsx("div",{className:"w-full bg-indigo-500 rounded-t transition-all hover:bg-indigo-400 cursor-default min-h-[2px]",style:{height:`${Math.max(d.costUsd/r*100,1)}%`},title:`${d.date}: $${d.costUsd.toFixed(4)} (${d.runs} runs)`}),t.jsx("span",{className:"text-[10px] text-zinc-500 mt-1 truncate w-full text-center",children:d.date.slice(5)})]},d.date))})}function bs(n){return n<.01?`$${n.toFixed(4)}`:n<1?`$${n.toFixed(3)}`:`$${n.toFixed(2)}`}function Bh(n){return n>=1e6?`${(n/1e6).toFixed(1)}M`:n>=1e3?`${(n/1e3).toFixed(1)}K`:String(n)}function a1(){const{t:n}=We(),[r,d]=u.useState(null),[o,m]=u.useState([]),[f,h]=u.useState([]),[b,g]=u.useState(null),[p,j]=u.useState(!0),[y,w]=u.useState(null);if(u.useEffect(()=>{async function k(){try{j(!0),w(null);const[N,S,z,M]=await Promise.all([wr.summary(),wr.daily(30),wr.budget(),wr.estimate()]);d(N.data),m(S.data),h(z.data),g(M.data)}catch(N){w(N instanceof Error?N.message:"Failed to load analytics")}finally{j(!1)}}k()},[]),p)return t.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:t.jsx("p",{className:"text-zinc-400",children:n("common.loading")})});if(y)return t.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-3",children:[t.jsx(lt,{className:"h-8 w-8 text-amber-500"}),t.jsx("p",{className:"text-zinc-400",children:y})]});const C=r&&r.totalRuns>0?r.totalCostUsd/r.totalRuns:0;return t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[t.jsx(Ar,{label:n("analytics.totalSpend"),value:bs((r==null?void 0:r.totalCostUsd)??0),icon:ya,color:"text-emerald-400",bgColor:"bg-emerald-400/10"}),t.jsx(Ar,{label:n("analytics.totalRuns"),value:String((r==null?void 0:r.totalRuns)??0),icon:Kt,color:"text-blue-400",bgColor:"bg-blue-400/10",subtitle:`${Bh((r==null?void 0:r.totalTokens)??0)} tokens`}),t.jsx(Ar,{label:n("analytics.avgCostPerRun"),value:bs(C),icon:av,color:"text-amber-400",bgColor:"bg-amber-400/10"}),t.jsx(Ar,{label:n("analytics.monthlyEstimate"),value:bs((b==null?void 0:b.estimatedUsd)??0),icon:Wd,color:"text-purple-400",bgColor:"bg-purple-400/10",subtitle:b?`${b.confidence} confidence`:void 0})]}),t.jsxs("div",{className:"card",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[t.jsx(ga,{className:"h-4 w-4 text-zinc-400"}),t.jsx("h2",{className:"text-lg font-medium text-white",children:n("analytics.dailyCosts")})]}),t.jsx(t1,{data:o})]}),t.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2",children:[t.jsxs("div",{className:"card",children:[t.jsx("h2",{className:"text-lg font-medium text-white mb-4",children:n("analytics.agentBreakdown")}),r&&r.byAgent.length>0?t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-border text-zinc-400",children:[t.jsx("th",{className:"text-left pb-2 font-medium",children:n("common.name")}),t.jsx("th",{className:"text-right pb-2 font-medium",children:n("analytics.runs")}),t.jsx("th",{className:"text-right pb-2 font-medium",children:n("analytics.totalCost")}),t.jsx("th",{className:"text-right pb-2 font-medium",children:n("analytics.avgCost")})]})}),t.jsx("tbody",{children:r.byAgent.map(k=>t.jsxs("tr",{className:"border-b border-border/50 hover:bg-surface-hover",children:[t.jsx("td",{className:"py-2 text-white",children:k.agentName}),t.jsx("td",{className:"py-2 text-right text-zinc-300",children:k.runs}),t.jsx("td",{className:"py-2 text-right text-zinc-300",children:bs(k.costUsd)}),t.jsx("td",{className:"py-2 text-right text-zinc-300",children:bs(k.runs>0?k.costUsd/k.runs:0)})]},k.agentId))})]})}):t.jsx("p",{className:"text-zinc-500 text-sm",children:n("analytics.noAgentData")})]}),t.jsxs("div",{className:"card",children:[t.jsx("h2",{className:"text-lg font-medium text-white mb-4",children:n("analytics.modelBreakdown")}),r&&r.byModel.length>0?t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-border text-zinc-400",children:[t.jsx("th",{className:"text-left pb-2 font-medium",children:n("analytics.model")}),t.jsx("th",{className:"text-right pb-2 font-medium",children:n("analytics.tokens")}),t.jsx("th",{className:"text-right pb-2 font-medium",children:n("analytics.cost")})]})}),t.jsx("tbody",{children:r.byModel.map(k=>t.jsxs("tr",{className:"border-b border-border/50 hover:bg-surface-hover",children:[t.jsx("td",{className:"py-2 text-white font-mono text-xs",children:k.model}),t.jsx("td",{className:"py-2 text-right text-zinc-300",children:Bh(k.tokens)}),t.jsx("td",{className:"py-2 text-right text-zinc-300",children:bs(k.costUsd)})]},k.model))})]})}):t.jsx("p",{className:"text-zinc-500 text-sm",children:n("analytics.noModelData")})]})]}),f.length>0&&t.jsxs("div",{className:"card",children:[t.jsx("h2",{className:"text-lg font-medium text-white mb-4",children:n("analytics.budgetUtilization")}),t.jsx("div",{className:"space-y-3",children:f.map(k=>t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("span",{className:"text-sm text-zinc-300 w-32 truncate",children:k.name}),t.jsx("div",{className:"flex-1 h-2 bg-zinc-800 rounded-full overflow-hidden",children:t.jsx("div",{className:`h-full rounded-full transition-all ${k.percent>=90?"bg-red-500":k.percent>=70?"bg-amber-500":"bg-indigo-500"}`,style:{width:`${Math.min(k.percent,100)}%`}})}),t.jsxs("span",{className:"text-xs text-zinc-400 w-24 text-right",children:[bs(k.spentUsd)," / ",bs(k.budgetUsd)]}),t.jsxs("span",{className:`text-xs font-medium w-12 text-right ${k.percent>=90?"text-red-400":k.percent>=70?"text-amber-400":"text-zinc-400"}`,children:[k.percent.toFixed(0),"%"]})]},k.agentId))})]})]})}function s1(){const{t:n}=We(),[r,d]=u.useState("costs");return t.jsxs("div",{className:"space-y-6",children:[t.jsx("div",{className:"flex items-center justify-between",children:t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-semibold text-white",children:n("analytics.title")}),t.jsx("p",{className:"mt-1 text-sm text-zinc-400",children:n("analytics.description")})]})}),t.jsxs("div",{className:"flex items-center gap-1 border-b border-border",children:[t.jsx("button",{onClick:()=>d("costs"),className:`px-4 py-2 text-sm font-medium border-b-2 transition-colors ${r==="costs"?"border-indigo-500 text-indigo-400":"border-transparent text-zinc-400 hover:text-zinc-300 hover:border-zinc-600"}`,children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ya,{className:"h-4 w-4"}),"Costs"]})}),t.jsx("button",{onClick:()=>d("quality"),className:`px-4 py-2 text-sm font-medium border-b-2 transition-colors ${r==="quality"?"border-indigo-500 text-indigo-400":"border-transparent text-zinc-400 hover:text-zinc-300 hover:border-zinc-600"}`,children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ct,{className:"h-4 w-4"}),"Quality"]})})]}),r==="costs"&&t.jsx(a1,{}),r==="quality"&&t.jsx(e1,{})]})}function C0(n){return new Date(n).toLocaleString()}function lu(n){return n===void 0?"--":n<1e3?`${n}ms`:n<6e4?`${(n/1e3).toFixed(1)}s`:`${(n/6e4).toFixed(1)}m`}function iu(n){switch(n){case"ok":return t.jsx(ct,{className:"h-4 w-4 text-emerald-400"});case"error":return t.jsx(wt,{className:"h-4 w-4 text-red-400"});default:return t.jsx(lt,{className:"h-4 w-4 text-zinc-500"})}}function A0(n){const r={ok:"bg-emerald-500/10 text-emerald-400 border-emerald-500/20",error:"bg-red-500/10 text-red-400 border-red-500/20",unset:"bg-zinc-500/10 text-zinc-400 border-zinc-500/20"};return t.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium ${r[n]??r.unset}`,children:[iu(n),n]})}function n1({span:n,traceStart:r,traceDuration:d}){if(d===0)return null;const o=(n.startTime-r)/d*100,m=Math.max((n.durationMs??0)/d*100,.5),f=n.status==="error"?"bg-red-500":n.kind==="server"?"bg-indigo-500":n.kind==="client"?"bg-cyan-500":"bg-emerald-500";return t.jsx("div",{className:"relative h-5 w-full rounded bg-zinc-800/50",children:t.jsx("div",{className:`absolute top-0.5 h-4 rounded ${f} opacity-80`,style:{left:`${Math.min(o,99)}%`,width:`${Math.min(m,100-o)}%`}})})}function l1({span:n,depth:r,traceStart:d,traceDuration:o}){const[m,f]=u.useState(!1),h=Object.keys(n.attributes).length>0||n.events.length>0;return t.jsxs(t.Fragment,{children:[t.jsxs("tr",{className:"border-b border-zinc-800/50 hover:bg-zinc-800/30 cursor-pointer transition-colors",onClick:()=>h&&f(!m),children:[t.jsx("td",{className:"py-2 px-3 text-sm font-mono text-zinc-300 whitespace-nowrap",children:t.jsxs("div",{className:"flex items-center gap-1",style:{paddingLeft:`${r*16}px`},children:[h?m?t.jsx(Va,{className:"h-3 w-3 text-zinc-500"}):t.jsx(aa,{className:"h-3 w-3 text-zinc-500"}):t.jsx("span",{className:"w-3"}),iu(n.status),t.jsx("span",{className:"ml-1",children:n.name})]})}),t.jsx("td",{className:"py-2 px-3 text-xs text-zinc-500 whitespace-nowrap",children:n.kind}),t.jsx("td",{className:"py-2 px-3 text-xs text-zinc-400 font-mono whitespace-nowrap text-right",children:lu(n.durationMs)}),t.jsx("td",{className:"py-2 px-3 w-1/3",children:t.jsx(n1,{span:n,traceStart:d,traceDuration:o})})]}),m&&t.jsx("tr",{className:"border-b border-zinc-800/50",children:t.jsx("td",{colSpan:4,className:"px-6 py-3 bg-zinc-900/50",children:t.jsxs("div",{style:{paddingLeft:`${r*16+16}px`},children:[Object.keys(n.attributes).length>0&&t.jsxs("div",{className:"mb-2",children:[t.jsx("p",{className:"text-xs font-semibold text-zinc-500 uppercase mb-1",children:"Attributes"}),t.jsx("div",{className:"grid grid-cols-2 gap-x-4 gap-y-0.5",children:Object.entries(n.attributes).map(([b,g])=>t.jsxs("div",{className:"text-xs",children:[t.jsxs("span",{className:"text-zinc-500",children:[b,":"]})," ",t.jsx("span",{className:"text-zinc-300 font-mono",children:String(g)})]},b))})]}),n.events.length>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-xs font-semibold text-zinc-500 uppercase mb-1",children:"Events"}),n.events.map((b,g)=>t.jsxs("div",{className:"text-xs mb-1",children:[t.jsx("span",{className:"text-amber-400",children:b.name}),t.jsxs("span",{className:"text-zinc-600 ml-2",children:["+",b.time-n.startTime,"ms"]}),b.attributes&&Object.entries(b.attributes).map(([p,j])=>t.jsxs("span",{className:"text-zinc-500 ml-2",children:[p,"=",String(j)]},p))]},g))]})]})})})]})}function i1(n){const r=new Map,d=[];for(const o of n)r.set(o.spanId,{span:o,children:[]});for(const o of n){const m=r.get(o.spanId);o.parentSpanId&&r.has(o.parentSpanId)?r.get(o.parentSpanId).children.push(m):d.push(m)}return d}function E0(n,r=0){const d=[];for(const o of n)d.push({span:o.span,depth:r}),d.push(...E0(o.children,r+1));return d}function r1({trace:n}){const r=n.startTime,d=n.durationMs??1,o=i1(n.spans),m=E0(o);return t.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/50 overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between border-b border-zinc-800 px-4 py-3",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-sm font-semibold text-white",children:n.rootSpanName}),t.jsxs("p",{className:"text-xs text-zinc-500 mt-0.5",children:[C0(n.startTime)," · ",n.spanCount," spans · ",lu(n.durationMs)]})]}),A0(n.status)]}),t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"w-full min-w-[600px]",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-zinc-800 text-xs text-zinc-500 uppercase",children:[t.jsx("th",{className:"py-2 px-3 text-left font-medium",children:"Span"}),t.jsx("th",{className:"py-2 px-3 text-left font-medium w-16",children:"Kind"}),t.jsx("th",{className:"py-2 px-3 text-right font-medium w-20",children:"Duration"}),t.jsx("th",{className:"py-2 px-3 text-left font-medium w-1/3",children:"Timeline"})]})}),t.jsx("tbody",{children:m.map(({span:f,depth:h})=>t.jsx(l1,{span:f,depth:h,traceStart:r,traceDuration:d},f.spanId))})]})}),t.jsx("div",{className:"border-t border-zinc-800 px-4 py-2",children:t.jsxs("p",{className:"text-xs text-zinc-600 font-mono",children:["traceId: ",n.traceId]})})]})}function c1(){const[n,r]=u.useState([]),[d,o]=u.useState(null),[m,f]=u.useState(null),[h,b]=u.useState(!0),[g,p]=u.useState(!1),[j,y]=u.useState(null),w=u.useCallback(async()=>{b(!0),y(null);try{const N=await wd.list();r(N.data),p(N.meta.tracingEnabled)}catch(N){y(N instanceof Error?N.message:"Failed to load traces")}finally{b(!1)}},[]);u.useEffect(()=>{w()},[w]);const C=u.useCallback(async N=>{if(m===N){f(null),o(null);return}f(N);try{const S=await wd.get(N);o(S.data)}catch{o(null)}},[m]),k=async()=>{try{await wd.clear(),r([]),o(null),f(null)}catch{}};return t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-bold text-white",children:"Traces"}),t.jsx("p",{className:"mt-1 text-sm text-zinc-400",children:"Distributed tracing for agent runs, HTTP requests, and orchestrations."})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[!g&&t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-amber-500/20 bg-amber-500/10 px-3 py-1 text-xs font-medium text-amber-400",children:[t.jsx(lt,{className:"h-3 w-3"}),"Tracing disabled"]}),t.jsxs("button",{onClick:w,className:"inline-flex items-center gap-1.5 rounded-lg border border-zinc-700 bg-zinc-800 px-3 py-1.5 text-sm text-zinc-300 hover:bg-zinc-700 transition-colors",children:[t.jsx(Yt,{className:"h-3.5 w-3.5"}),"Refresh"]}),t.jsxs("button",{onClick:k,className:"inline-flex items-center gap-1.5 rounded-lg border border-zinc-700 bg-zinc-800 px-3 py-1.5 text-sm text-red-400 hover:bg-zinc-700 transition-colors",children:[t.jsx(Mt,{className:"h-3.5 w-3.5"}),"Clear"]})]})]}),j&&t.jsx("div",{className:"rounded-lg border border-red-500/20 bg-red-500/10 p-4",children:t.jsx("p",{className:"text-sm text-red-400",children:j})}),h&&t.jsx("div",{className:"flex items-center justify-center py-12",children:t.jsx("div",{className:"animate-spin h-6 w-6 border-2 border-indigo-500 border-t-transparent rounded-full"})}),!h&&n.length===0&&t.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[t.jsx(Kt,{className:"h-12 w-12 text-zinc-700 mb-4"}),t.jsx("h3",{className:"text-lg font-medium text-zinc-400",children:"No traces recorded"}),t.jsx("p",{className:"mt-1 text-sm text-zinc-600 max-w-md",children:g?"Traces will appear here as agents run and HTTP requests are processed.":"Enable tracing in your nestor.config.json to start recording traces."}),!g&&t.jsx("pre",{className:"mt-4 rounded-lg bg-zinc-900 border border-zinc-800 p-3 text-xs text-zinc-400 font-mono text-left",children:`{
|
|
581
|
-
"observability": {
|
|
582
|
-
"tracing": {
|
|
583
|
-
"enabled": true
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
}`})]}),!h&&n.length>0&&t.jsx("div",{className:"space-y-2",children:n.map(N=>t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>C(N.traceId),className:`w-full flex items-center justify-between rounded-lg border px-4 py-3 text-left transition-colors ${m===N.traceId?"border-indigo-500/30 bg-indigo-500/5":"border-zinc-800 bg-zinc-900/50 hover:bg-zinc-800/50"}`,children:[t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[m===N.traceId?t.jsx(Va,{className:"h-4 w-4 text-zinc-500 flex-shrink-0"}):t.jsx(aa,{className:"h-4 w-4 text-zinc-500 flex-shrink-0"}),iu(N.status),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm font-medium text-white truncate",children:N.rootSpanName}),t.jsx("p",{className:"text-xs text-zinc-500",children:C0(N.startTime)})]})]}),t.jsxs("div",{className:"flex items-center gap-4 flex-shrink-0",children:[t.jsxs("span",{className:"text-xs text-zinc-500",children:[N.spanCount," span",N.spanCount!==1?"s":""]}),t.jsx("span",{className:"text-xs font-mono text-zinc-400 w-16 text-right",children:lu(N.durationMs)}),A0(N.status)]})]}),m===N.traceId&&d&&t.jsx("div",{className:"mt-2 ml-4",children:t.jsx(r1,{trace:d})})]},N.traceId))})]})}function T0(){const{login:n,register:r}=ai(),d=Rt(),[o,m]=u.useState("login"),[f,h]=u.useState(""),[b,g]=u.useState(""),[p,j]=u.useState(""),[y,w]=u.useState(""),[C,k]=u.useState(!1),N=async S=>{S.preventDefault(),w(""),k(!0);try{o==="register"?(await r(f,b,p),await n(f,b)):await n(f,b),d("/",{replace:!0})}catch(z){w(z.message||"An error occurred.")}finally{k(!1)}};return t.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background px-4",children:t.jsxs("div",{className:"w-full max-w-sm",children:[t.jsxs("div",{className:"mb-8 flex flex-col items-center gap-3",children:[t.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-xl bg-indigo-600 text-white",children:t.jsx(qa,{className:"h-6 w-6"})}),t.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Nestor Studio"}),t.jsx("p",{className:"text-sm text-zinc-400",children:o==="login"?"Sign in to your account":"Create a new account"})]}),t.jsxs("form",{onSubmit:N,className:"space-y-4",children:[y&&t.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-red-500/30 bg-red-500/10 px-3 py-2 text-sm text-red-400",children:[t.jsx(Fl,{className:"h-4 w-4 flex-shrink-0"}),y]}),o==="register"&&t.jsxs("div",{children:[t.jsx("label",{className:"mb-1.5 block text-sm font-medium text-zinc-300",children:"Name"}),t.jsx("input",{type:"text",value:p,onChange:S=>j(S.target.value),required:!0,className:"w-full rounded-lg border border-border bg-surface px-3 py-2 text-sm text-white placeholder:text-zinc-500 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500",placeholder:"Your name"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"mb-1.5 block text-sm font-medium text-zinc-300",children:"Email"}),t.jsx("input",{type:"email",value:f,onChange:S=>h(S.target.value),required:!0,className:"w-full rounded-lg border border-border bg-surface px-3 py-2 text-sm text-white placeholder:text-zinc-500 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500",placeholder:"you@example.com"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"mb-1.5 block text-sm font-medium text-zinc-300",children:"Password"}),t.jsx("input",{type:"password",value:b,onChange:S=>g(S.target.value),required:!0,minLength:o==="register"?6:1,className:"w-full rounded-lg border border-border bg-surface px-3 py-2 text-sm text-white placeholder:text-zinc-500 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500",placeholder:o==="register"?"At least 6 characters":"Your password"})]}),t.jsx("button",{type:"submit",disabled:C,className:"flex w-full items-center justify-center gap-2 rounded-lg bg-indigo-600 px-4 py-2.5 text-sm font-medium text-white transition-colors hover:bg-indigo-700 disabled:opacity-50",children:C?"Please wait...":o==="login"?t.jsxs(t.Fragment,{children:[t.jsx(mv,{className:"h-4 w-4"})," Sign In"]}):t.jsxs(t.Fragment,{children:[t.jsx(Av,{className:"h-4 w-4"})," Create Account"]})})]}),t.jsx("div",{className:"mt-6 text-center",children:t.jsx("button",{type:"button",onClick:()=>{m(o==="login"?"register":"login"),w("")},className:"text-sm text-zinc-400 transition-colors hover:text-indigo-400",children:o==="login"?"Don't have an account? Register":"Already have an account? Sign in"})})]})})}function o1(){const{isAdmin:n}=ai(),[r,d]=u.useState([]),[o,m]=u.useState([]),[f,h]=u.useState("users"),[b,g]=u.useState(!0),[p,j]=u.useState(""),y=u.useCallback(async()=>{try{const N=await fetch("/api/users",{credentials:"include"}),S=await N.json();N.ok&&d(S.data||[])}catch{}},[]),w=u.useCallback(async()=>{try{const N=await fetch("/api/users/audit?limit=50",{credentials:"include"}),S=await N.json();N.ok&&m(S.data||[])}catch{}},[]);u.useEffect(()=>{g(!0),Promise.all([y(),w()]).finally(()=>g(!1))},[y,w]);const C=async(N,S)=>{var z;j("");try{const M=await fetch(`/api/users/${N}`,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({role:S})});if(!M.ok){const O=await M.json();throw new Error(((z=O.error)==null?void 0:z.message)||"Failed to update role.")}await y()}catch(M){j(M.message)}},k=async N=>{var S;if(confirm("Are you sure you want to delete this user?")){j("");try{const z=await fetch(`/api/users/${N}`,{method:"DELETE",credentials:"include"});if(!z.ok){const M=await z.json();throw new Error(((S=M.error)==null?void 0:S.message)||"Failed to delete user.")}await y()}catch(z){j(z.message)}}};return n?t.jsxs("div",{className:"space-y-6",children:[t.jsx("div",{className:"flex items-center justify-between",children:t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-semibold text-white",children:"User Management"}),t.jsx("p",{className:"mt-1 text-sm text-zinc-400",children:"Manage users, roles, and view audit log."})]})}),p&&t.jsx("div",{className:"rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-2 text-sm text-red-400",children:p}),t.jsxs("div",{className:"flex gap-1 border-b border-border",children:[t.jsxs("button",{onClick:()=>h("users"),className:`flex items-center gap-2 px-4 py-2 text-sm font-medium transition-colors ${f==="users"?"border-b-2 border-indigo-500 text-indigo-400":"text-zinc-400 hover:text-zinc-200"}`,children:[t.jsx(Xn,{className:"h-4 w-4"})," Users (",r.length,")"]}),t.jsxs("button",{onClick:()=>h("audit"),className:`flex items-center gap-2 px-4 py-2 text-sm font-medium transition-colors ${f==="audit"?"border-b-2 border-indigo-500 text-indigo-400":"text-zinc-400 hover:text-zinc-200"}`,children:[t.jsx(Zs,{className:"h-4 w-4"})," Audit Log"]})]}),b?t.jsx("div",{className:"text-center text-zinc-400 py-8",children:"Loading..."}):f==="users"?t.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-border bg-surface",children:[t.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Name"}),t.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Email"}),t.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Role"}),t.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Provider"}),t.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Last Login"}),t.jsx("th",{className:"px-4 py-3 text-right text-xs font-medium uppercase text-zinc-400",children:"Actions"})]})}),t.jsxs("tbody",{children:[r.map(N=>t.jsxs("tr",{className:"border-b border-border/50 hover:bg-surface-hover",children:[t.jsx("td",{className:"px-4 py-3 font-medium text-white",children:N.name}),t.jsx("td",{className:"px-4 py-3 text-zinc-300",children:N.email}),t.jsx("td",{className:"px-4 py-3",children:t.jsxs("select",{value:N.role,onChange:S=>C(N.id,S.target.value),className:"rounded border border-border bg-background px-2 py-1 text-xs text-white focus:outline-none",children:[t.jsx("option",{value:"admin",children:"Admin"}),t.jsx("option",{value:"member",children:"Member"}),t.jsx("option",{value:"viewer",children:"Viewer"})]})}),t.jsx("td",{className:"px-4 py-3 text-zinc-400",children:N.authProvider}),t.jsx("td",{className:"px-4 py-3 text-zinc-400",children:N.lastLoginAt?new Date(N.lastLoginAt*1e3).toLocaleString():"Never"}),t.jsx("td",{className:"px-4 py-3 text-right",children:t.jsx("button",{onClick:()=>k(N.id),className:"rounded p-1.5 text-zinc-400 transition-colors hover:bg-red-500/10 hover:text-red-400",title:"Delete user",children:t.jsx(Mt,{className:"h-4 w-4"})})})]},N.id)),r.length===0&&t.jsx("tr",{children:t.jsx("td",{colSpan:6,className:"px-4 py-8 text-center text-zinc-500",children:"No users found."})})]})]})}):t.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-border bg-surface",children:[t.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Time"}),t.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Action"}),t.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Resource"}),t.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"User"}),t.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Details"})]})}),t.jsxs("tbody",{children:[o.map(N=>{var S;return t.jsxs("tr",{className:"border-b border-border/50 hover:bg-surface-hover",children:[t.jsx("td",{className:"px-4 py-3 text-zinc-400 whitespace-nowrap",children:new Date(N.createdAt*1e3).toLocaleString()}),t.jsx("td",{className:"px-4 py-3 font-mono text-xs text-indigo-400",children:N.action}),t.jsx("td",{className:"px-4 py-3 text-zinc-300",children:N.resourceType&&t.jsxs("span",{children:[N.resourceType,N.resourceId?`/${N.resourceId.slice(0,8)}`:""]})}),t.jsx("td",{className:"px-4 py-3 text-zinc-400",children:((S=N.userId)==null?void 0:S.slice(0,8))||"-"}),t.jsx("td",{className:"px-4 py-3 text-xs text-zinc-500 max-w-xs truncate",children:N.details?JSON.stringify(N.details):"-"})]},N.id)}),o.length===0&&t.jsx("tr",{children:t.jsx("td",{colSpan:5,className:"px-4 py-8 text-center text-zinc-500",children:"No audit entries."})})]})]})})]}):t.jsxs("div",{className:"flex h-64 items-center justify-center text-zinc-400",children:[t.jsx(Ns,{className:"mr-2 h-5 w-5"})," Admin access required."]})}function kd({label:n,valueA:r,valueB:d,format:o}){const m=Math.max(r,d,.001);return t.jsxs("div",{className:"space-y-1",children:[t.jsx("div",{className:"text-xs text-zinc-400",children:n}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"w-12 text-right text-xs text-indigo-400",children:o(r)}),t.jsxs("div",{className:"flex-1 flex gap-0.5",children:[t.jsx("div",{className:"h-4 rounded-l bg-indigo-500/40",style:{width:`${r/m*50}%`}}),t.jsx("div",{className:"h-4 rounded-r bg-emerald-500/40",style:{width:`${d/m*50}%`}})]}),t.jsx("span",{className:"w-12 text-left text-xs text-emerald-400",children:o(d)})]})]})}function d1(){const{id:n}=Vn(),[r,d]=u.useState([]),[o,m]=u.useState([]),[f,h]=u.useState(!0),[b,g]=u.useState(""),[p,j]=u.useState(!1),[y,w]=u.useState(""),[C,k]=u.useState(""),[N,S]=u.useState(""),[z,M]=u.useState(""),[O,E]=u.useState(null),[ae,ce]=u.useState(!1),[H,G]=u.useState(""),[P,W]=u.useState(""),[Q,le]=u.useState(""),[F,re]=u.useState(50),[he,K]=u.useState([]),[_,Z]=u.useState({}),[ne,xe]=u.useState(!1),[T,X]=u.useState(""),[ie,$]=u.useState(""),[oe,ue]=u.useState(""),[ge,we]=u.useState(.5),be=u.useCallback(async()=>{if(n){try{const[L,ee,ye]=await Promise.all([fetch(`/api/agents/${n}/prompts`,{credentials:"include"}),fetch(`/api/agents/${n}/prompts/ab-tests`,{credentials:"include"}),fetch(`/api/agents/${n}/experiments`,{credentials:"include"})]),Fe=await L.json(),va=await ee.json(),ja=await ye.json();if(L.ok&&d(Fe.data||[]),ee.ok&&m(va.data||[]),ye.ok){const bt=ja.data||[];K(bt);for(const ni of bt)try{const Zn=await fetch(`/api/experiments/${ni.id}`,{credentials:"include"});if(Zn.ok){const li=await Zn.json();Z(Ps=>({...Ps,[ni.id]:li.data}))}}catch{}}}catch{}h(!1)}},[n]);u.useEffect(()=>{be()},[be]);const Xe=async()=>{var L;if(!(!n||!y.trim())){g("");try{const ee=await fetch(`/api/agents/${n}/prompts`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({systemPrompt:y,name:C||void 0})});if(!ee.ok){const ye=await ee.json();throw new Error(((L=ye.error)==null?void 0:L.message)||"Failed")}j(!1),w(""),k(""),await be()}catch(ee){g(ee.message)}}},Ye=async L=>{var ee;if(n){g("");try{const ye=await fetch(`/api/agents/${n}/prompts/${L}/activate`,{method:"PATCH",credentials:"include"});if(!ye.ok){const Fe=await ye.json();throw new Error(((ee=Fe.error)==null?void 0:ee.message)||"Failed")}await be()}catch(ye){g(ye.message)}}},la=async()=>{if(!(!n||!N||!z))try{const L=await fetch(`/api/agents/${n}/prompts/compare?a=${N}&b=${z}`,{credentials:"include"}),ee=await L.json();L.ok&&E(ee.data)}catch{}},Is=async()=>{var L;if(!(!n||!H||!P)){g("");try{const ee=await fetch(`/api/agents/${n}/prompts/ab-tests`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantAId:H,variantBId:P,name:Q||void 0,splitPercent:F})});if(!ee.ok){const ye=await ee.json();throw new Error(((L=ye.error)==null?void 0:L.message)||"Failed")}ce(!1),await be()}catch(ee){g(ee.message)}}},Dt=async(L,ee)=>{if(n)try{(await fetch(`/api/agents/${n}/prompts/ab-tests/${L}/complete`,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({winnerId:ee})})).ok&&await be()}catch{}},Xa=async()=>{if(n){g("");try{const L=r.find(Fe=>Fe.isActive);if(!L){g("No active version to rollback from.");return}const ee=r.indexOf(L),ye=r[ee+1];if(!ye){g("No previous version to rollback to.");return}await Ye(ye.id)}catch(L){g(L.message)}}},He=async()=>{var L;if(!(!n||!T||!ie)){g("");try{const ee=await fetch(`/api/agents/${n}/experiments`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:oe||`Experiment ${new Date().toISOString().slice(0,10)}`,variantAId:T,variantBId:ie,trafficSplit:ge})});if(!ee.ok){const ye=await ee.json();throw new Error(((L=ye.error)==null?void 0:L.message)||"Failed")}xe(!1),ue(""),X(""),$(""),await be()}catch(ee){g(ee.message)}}},gt=async(L,ee)=>{try{(await fetch(`/api/experiments/${L}/complete`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({winnerId:ee})})).ok&&await be()}catch{}};return f?t.jsx("div",{className:"flex h-64 items-center justify-center text-zinc-400",children:"Loading..."}):t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Prompt Versions"}),t.jsx("p",{className:"mt-1 text-sm text-zinc-400",children:"Manage, compare, and A/B test prompt versions for this agent."})]}),t.jsxs("div",{className:"flex gap-2",children:[r.length>=2&&t.jsxs("button",{onClick:Xa,className:"flex items-center gap-2 rounded-lg border border-border bg-surface px-3 py-2 text-sm text-zinc-300 hover:bg-surface-hover",children:[t.jsx(g0,{className:"h-4 w-4"})," Rollback"]}),t.jsxs("button",{onClick:()=>xe(!0),className:"flex items-center gap-2 rounded-lg border border-border bg-surface px-3 py-2 text-sm text-zinc-300 hover:bg-surface-hover",children:[t.jsx(Kt,{className:"h-4 w-4"})," New Experiment"]}),t.jsxs("button",{onClick:()=>ce(!0),className:"flex items-center gap-2 rounded-lg border border-border bg-surface px-3 py-2 text-sm text-zinc-300 hover:bg-surface-hover",children:[t.jsx(Nd,{className:"h-4 w-4"})," New A/B Test"]}),t.jsxs("button",{onClick:()=>j(!0),className:"flex items-center gap-2 rounded-lg bg-indigo-600 px-3 py-2 text-sm font-medium text-white hover:bg-indigo-700",children:[t.jsx(pt,{className:"h-4 w-4"})," New Version"]})]})]}),b&&t.jsx("div",{className:"rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-2 text-sm text-red-400",children:b}),p&&t.jsxs("div",{className:"rounded-lg border border-border bg-surface p-4 space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h3",{className:"text-sm font-medium text-white",children:"Create New Version"}),t.jsx("button",{onClick:()=>j(!1),className:"text-zinc-400 hover:text-white",children:t.jsx(Je,{className:"h-4 w-4"})})]}),t.jsx("input",{type:"text",value:C,onChange:L=>k(L.target.value),placeholder:"Version name (optional)",className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-white"}),t.jsx("textarea",{value:y,onChange:L=>w(L.target.value),placeholder:"System prompt...",rows:8,className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-white font-mono"}),t.jsx("button",{onClick:Xe,disabled:!y.trim(),className:"rounded-lg bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-700 disabled:opacity-50",children:"Create Version"})]}),t.jsxs("div",{className:"space-y-2",children:[r.map(L=>t.jsxs("div",{className:`rounded-lg border p-4 ${L.isActive?"border-indigo-500/50 bg-indigo-500/5":"border-border bg-surface"}`,children:[t.jsxs("div",{className:"flex items-start justify-between",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsxs("span",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-surface text-sm font-bold text-zinc-300",children:["v",L.version]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"font-medium text-white",children:L.name||`Version ${L.version}`}),L.isActive&&t.jsxs("span",{className:"flex items-center gap-1 rounded-full bg-green-500/20 px-2 py-0.5 text-xs text-green-400",children:[t.jsx(ct,{className:"h-3 w-3"})," Active"]})]}),t.jsxs("div",{className:"mt-1 flex items-center gap-4 text-xs text-zinc-400",children:[t.jsxs("span",{children:[L.totalRuns," runs"]}),t.jsxs("span",{children:["Score: ",L.performanceScore!=null?`${(L.performanceScore*100).toFixed(0)}%`:"N/A"]}),t.jsxs("span",{children:["Avg cost: $",L.avgCostUsd.toFixed(4)]}),t.jsxs("span",{children:["Avg duration: ",L.avgDurationMs.toFixed(0),"ms"]})]})]})]}),t.jsx("div",{className:"flex items-center gap-2",children:!L.isActive&&t.jsx("button",{onClick:()=>Ye(L.id),className:"rounded-lg border border-border px-3 py-1.5 text-xs text-zinc-300 hover:bg-surface-hover",children:"Activate"})})]}),t.jsx("div",{className:"mt-3 rounded-lg bg-background p-3",children:t.jsxs("pre",{className:"max-h-24 overflow-y-auto text-xs text-zinc-400 font-mono whitespace-pre-wrap",children:[L.systemPrompt.slice(0,500),L.systemPrompt.length>500?"...":""]})})]},L.id)),r.length===0&&t.jsxs("div",{className:"rounded-lg border border-border bg-surface p-8 text-center text-zinc-400",children:[t.jsx(Zs,{className:"mx-auto mb-2 h-8 w-8"}),"No prompt versions yet. Create your first version."]})]}),r.length>=2&&t.jsxs("div",{className:"rounded-lg border border-border bg-surface p-4 space-y-3",children:[t.jsxs("h3",{className:"flex items-center gap-2 text-sm font-medium text-white",children:[t.jsx(ga,{className:"h-4 w-4"})," Compare Versions"]}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsxs("select",{value:N,onChange:L=>S(L.target.value),className:"flex-1 rounded-lg border border-border bg-background px-3 py-2 text-sm text-white",children:[t.jsx("option",{value:"",children:"Select version A"}),r.map(L=>t.jsxs("option",{value:L.id,children:["v",L.version," - ",L.name||`Version ${L.version}`]},L.id))]}),t.jsx(u0,{className:"h-4 w-4 text-zinc-400 flex-shrink-0"}),t.jsxs("select",{value:z,onChange:L=>M(L.target.value),className:"flex-1 rounded-lg border border-border bg-background px-3 py-2 text-sm text-white",children:[t.jsx("option",{value:"",children:"Select version B"}),r.map(L=>t.jsxs("option",{value:L.id,children:["v",L.version," - ",L.name||`Version ${L.version}`]},L.id))]}),t.jsx("button",{onClick:la,disabled:!N||!z||N===z,className:"rounded-lg bg-indigo-600 px-4 py-2 text-sm text-white hover:bg-indigo-700 disabled:opacity-50",children:"Compare"})]}),O&&t.jsxs("div",{className:"grid grid-cols-2 gap-4 mt-4",children:[t.jsxs("div",{className:"rounded-lg border border-border bg-background p-3",children:[t.jsxs("h4",{className:"text-sm font-medium text-indigo-400 mb-2",children:["Variant A (v",O.variantA.version,")"]}),t.jsxs("div",{className:"space-y-1 text-xs",children:[t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-zinc-400",children:"Success Rate"}),t.jsxs("span",{className:"text-white",children:[(O.aSuccessRate*100).toFixed(1),"%"]})]}),t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-zinc-400",children:"Avg Cost"}),t.jsxs("span",{className:"text-white",children:["$",O.aCostAvg.toFixed(4)]})]}),t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-zinc-400",children:"Avg Duration"}),t.jsxs("span",{className:"text-white",children:[O.aDurationAvg.toFixed(0),"ms"]})]}),t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-zinc-400",children:"Total Runs"}),t.jsx("span",{className:"text-white",children:O.variantA.totalRuns})]})]})]}),t.jsxs("div",{className:"rounded-lg border border-border bg-background p-3",children:[t.jsxs("h4",{className:"text-sm font-medium text-emerald-400 mb-2",children:["Variant B (v",O.variantB.version,")"]}),t.jsxs("div",{className:"space-y-1 text-xs",children:[t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-zinc-400",children:"Success Rate"}),t.jsxs("span",{className:"text-white",children:[(O.bSuccessRate*100).toFixed(1),"%"]})]}),t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-zinc-400",children:"Avg Cost"}),t.jsxs("span",{className:"text-white",children:["$",O.bCostAvg.toFixed(4)]})]}),t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-zinc-400",children:"Avg Duration"}),t.jsxs("span",{className:"text-white",children:[O.bDurationAvg.toFixed(0),"ms"]})]}),t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-zinc-400",children:"Total Runs"}),t.jsx("span",{className:"text-white",children:O.variantB.totalRuns})]})]})]})]})]}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("h3",{className:"flex items-center gap-2 text-lg font-medium text-white",children:[t.jsx(Nd,{className:"h-5 w-5"})," A/B Tests"]}),ae&&t.jsxs("div",{className:"rounded-lg border border-border bg-surface p-4 space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h4",{className:"text-sm font-medium text-white",children:"New A/B Test"}),t.jsx("button",{onClick:()=>ce(!1),className:"text-zinc-400 hover:text-white",children:t.jsx(Je,{className:"h-4 w-4"})})]}),t.jsx("input",{type:"text",value:Q,onChange:L=>le(L.target.value),placeholder:"Test name (optional)",className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-white"}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("select",{value:H,onChange:L=>G(L.target.value),className:"rounded-lg border border-border bg-background px-3 py-2 text-sm text-white",children:[t.jsx("option",{value:"",children:"Variant A"}),r.map(L=>t.jsxs("option",{value:L.id,children:["v",L.version," - ",L.name||`Version ${L.version}`]},L.id))]}),t.jsxs("select",{value:P,onChange:L=>W(L.target.value),className:"rounded-lg border border-border bg-background px-3 py-2 text-sm text-white",children:[t.jsx("option",{value:"",children:"Variant B"}),r.map(L=>t.jsxs("option",{value:L.id,children:["v",L.version," - ",L.name||`Version ${L.version}`]},L.id))]})]}),t.jsxs("div",{children:[t.jsxs("label",{className:"text-xs text-zinc-400",children:["Traffic split: ",F,"% A / ",100-F,"% B"]}),t.jsx("input",{type:"range",min:10,max:90,value:F,onChange:L=>re(Number(L.target.value)),className:"w-full"})]}),t.jsx("button",{onClick:Is,disabled:!H||!P||H===P,className:"rounded-lg bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-700 disabled:opacity-50",children:"Start Test"})]}),o.map(L=>{const ee=r.find(Fe=>Fe.id===L.variantAId),ye=r.find(Fe=>Fe.id===L.variantBId);return t.jsxs("div",{className:"rounded-lg border border-border bg-surface p-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(Nd,{className:"h-4 w-4 text-indigo-400"}),t.jsx("span",{className:"font-medium text-white",children:L.name}),t.jsx("span",{className:`rounded-full px-2 py-0.5 text-xs ${L.status==="running"?"bg-green-500/20 text-green-400":L.status==="completed"?"bg-blue-500/20 text-blue-400":"bg-zinc-500/20 text-zinc-400"}`,children:L.status})]}),t.jsxs("span",{className:"text-xs text-zinc-400",children:[L.totalRuns," runs"]})]}),t.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-3 text-xs",children:[t.jsxs("div",{className:"rounded bg-background p-2",children:[t.jsxs("div",{className:"text-zinc-400",children:["Variant A (",L.splitPercent,"%)"]}),t.jsxs("div",{className:"text-white mt-1",children:["v",(ee==null?void 0:ee.version)??"?"," - ",(ee==null?void 0:ee.name)||"unnamed"]}),ee&&t.jsxs("div",{className:"text-zinc-400 mt-1",children:["Score: ",ee.performanceScore!=null?`${(ee.performanceScore*100).toFixed(0)}%`:"N/A"]})]}),t.jsxs("div",{className:"rounded bg-background p-2",children:[t.jsxs("div",{className:"text-zinc-400",children:["Variant B (",100-L.splitPercent,"%)"]}),t.jsxs("div",{className:"text-white mt-1",children:["v",(ye==null?void 0:ye.version)??"?"," - ",(ye==null?void 0:ye.name)||"unnamed"]}),ye&&t.jsxs("div",{className:"text-zinc-400 mt-1",children:["Score: ",ye.performanceScore!=null?`${(ye.performanceScore*100).toFixed(0)}%`:"N/A"]})]})]}),L.status==="running"&&ee&&ye&&t.jsxs("div",{className:"mt-3 flex gap-2",children:[t.jsxs("button",{onClick:()=>Dt(L.id,L.variantAId),className:"flex items-center gap-1 rounded-lg border border-border px-3 py-1.5 text-xs text-indigo-400 hover:bg-surface-hover",children:[t.jsx(Bn,{className:"h-3 w-3"})," A wins"]}),t.jsxs("button",{onClick:()=>Dt(L.id,L.variantBId),className:"flex items-center gap-1 rounded-lg border border-border px-3 py-1.5 text-xs text-emerald-400 hover:bg-surface-hover",children:[t.jsx(Bn,{className:"h-3 w-3"})," B wins"]})]}),L.winnerId&&t.jsxs("div",{className:"mt-2 flex items-center gap-1 text-xs text-yellow-400",children:[t.jsx(Bn,{className:"h-3 w-3"}),"Winner: v",L.winnerId===L.variantAId?ee==null?void 0:ee.version:ye==null?void 0:ye.version]})]},L.id)}),o.length===0&&!ae&&t.jsx("div",{className:"rounded-lg border border-border bg-surface p-6 text-center text-zinc-400 text-sm",children:"No A/B tests yet. Create one to compare prompt performance."})]}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("h3",{className:"flex items-center gap-2 text-lg font-medium text-white",children:[t.jsx(Kt,{className:"h-5 w-5"})," Experiments"]}),ne&&t.jsxs("div",{className:"rounded-lg border border-border bg-surface p-4 space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h4",{className:"text-sm font-medium text-white",children:"New Experiment"}),t.jsx("button",{onClick:()=>xe(!1),className:"text-zinc-400 hover:text-white",children:t.jsx(Je,{className:"h-4 w-4"})})]}),t.jsx("input",{type:"text",value:oe,onChange:L=>ue(L.target.value),placeholder:"Experiment name",className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-white"}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("select",{value:T,onChange:L=>X(L.target.value),className:"rounded-lg border border-border bg-background px-3 py-2 text-sm text-white",children:[t.jsx("option",{value:"",children:"Variant A"}),r.map(L=>t.jsxs("option",{value:L.id,children:["v",L.version," - ",L.name||`Version ${L.version}`]},L.id))]}),t.jsxs("select",{value:ie,onChange:L=>$(L.target.value),className:"rounded-lg border border-border bg-background px-3 py-2 text-sm text-white",children:[t.jsx("option",{value:"",children:"Variant B"}),r.map(L=>t.jsxs("option",{value:L.id,children:["v",L.version," - ",L.name||`Version ${L.version}`]},L.id))]})]}),t.jsxs("div",{children:[t.jsxs("label",{className:"text-xs text-zinc-400",children:["Traffic split: ",Math.round(ge*100),"% A / ",Math.round((1-ge)*100),"% B"]}),t.jsx("input",{type:"range",min:10,max:90,value:ge*100,onChange:L=>we(Number(L.target.value)/100),className:"w-full"})]}),t.jsx("button",{onClick:He,disabled:!T||!ie||T===ie,className:"rounded-lg bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-700 disabled:opacity-50",children:"Start Experiment"})]}),he.map(L=>{const ee=_[L.id];return t.jsxs("div",{className:"rounded-lg border border-border bg-surface p-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(Kt,{className:"h-4 w-4 text-indigo-400"}),t.jsx("span",{className:"font-medium text-white",children:L.name}),t.jsx("span",{className:`rounded-full px-2 py-0.5 text-xs ${L.status==="running"?"bg-green-500/20 text-green-400":L.status==="completed"?"bg-blue-500/20 text-blue-400":L.status==="paused"?"bg-yellow-500/20 text-yellow-400":"bg-zinc-500/20 text-zinc-400"}`,children:L.status})]}),t.jsxs("span",{className:"text-xs text-zinc-400",children:["Split: ",Math.round(L.trafficSplit*100),"% / ",Math.round((1-L.trafficSplit)*100),"%"]})]}),ee&&t.jsxs("div",{className:"mt-4 space-y-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"rounded-lg border border-indigo-500/20 bg-background p-3",children:[t.jsxs("h5",{className:"text-xs font-medium text-indigo-400 mb-2",children:["Variant A (v",ee.variantA.version.version,")"]}),t.jsxs("div",{className:"space-y-1 text-xs",children:[t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-zinc-400",children:"Runs"}),t.jsx("span",{className:"text-white",children:ee.variantA.runs})]}),t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-zinc-400",children:"Success Rate"}),t.jsxs("span",{className:"text-white",children:[(ee.variantA.successRate*100).toFixed(1),"%"]})]}),t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-zinc-400",children:"Avg Cost"}),t.jsxs("span",{className:"text-white",children:["$",ee.variantA.avgCostUsd.toFixed(4)]})]}),t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-zinc-400",children:"Avg Duration"}),t.jsxs("span",{className:"text-white",children:[ee.variantA.avgDurationMs.toFixed(0),"ms"]})]}),t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-zinc-400",children:"Avg Feedback"}),t.jsx("span",{className:"text-white",children:ee.variantA.avgFeedbackScore.toFixed(2)})]})]})]}),t.jsxs("div",{className:"rounded-lg border border-emerald-500/20 bg-background p-3",children:[t.jsxs("h5",{className:"text-xs font-medium text-emerald-400 mb-2",children:["Variant B (v",ee.variantB.version.version,")"]}),t.jsxs("div",{className:"space-y-1 text-xs",children:[t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-zinc-400",children:"Runs"}),t.jsx("span",{className:"text-white",children:ee.variantB.runs})]}),t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-zinc-400",children:"Success Rate"}),t.jsxs("span",{className:"text-white",children:[(ee.variantB.successRate*100).toFixed(1),"%"]})]}),t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-zinc-400",children:"Avg Cost"}),t.jsxs("span",{className:"text-white",children:["$",ee.variantB.avgCostUsd.toFixed(4)]})]}),t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-zinc-400",children:"Avg Duration"}),t.jsxs("span",{className:"text-white",children:[ee.variantB.avgDurationMs.toFixed(0),"ms"]})]}),t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-zinc-400",children:"Avg Feedback"}),t.jsx("span",{className:"text-white",children:ee.variantB.avgFeedbackScore.toFixed(2)})]})]})]})]}),t.jsxs("div",{className:"space-y-2 rounded-lg bg-background p-3",children:[t.jsxs("div",{className:"flex items-center justify-between text-xs mb-2",children:[t.jsx("span",{className:"text-indigo-400",children:"Variant A"}),t.jsx("span",{className:"text-emerald-400",children:"Variant B"})]}),t.jsx(kd,{label:"Success Rate",valueA:ee.variantA.successRate,valueB:ee.variantB.successRate,format:ye=>`${(ye*100).toFixed(0)}%`}),t.jsx(kd,{label:"Avg Cost",valueA:ee.variantA.avgCostUsd,valueB:ee.variantB.avgCostUsd,format:ye=>`$${ye.toFixed(3)}`}),t.jsx(kd,{label:"Duration",valueA:ee.variantA.avgDurationMs,valueB:ee.variantB.avgDurationMs,format:ye=>`${ye.toFixed(0)}ms`})]}),t.jsxs("div",{className:"flex items-center justify-between rounded-lg bg-background p-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ga,{className:"h-3.5 w-3.5 text-zinc-400"}),t.jsxs("span",{className:"text-zinc-400",children:["p-value: ",ee.statisticalSignificance.toFixed(4)]}),ee.statisticalSignificance<.05&&t.jsx("span",{className:"rounded-full bg-green-500/20 px-2 py-0.5 text-green-400",children:"Significant"})]}),t.jsx("span",{className:`font-medium ${ee.recommendation==="A"?"text-indigo-400":ee.recommendation==="B"?"text-emerald-400":"text-zinc-400"}`,children:ee.recommendation==="insufficient_data"?"Need more data":`Recommendation: Variant ${ee.recommendation}`})]}),L.status==="running"&&ee.variantA.runs>0&&ee.variantB.runs>0&&t.jsxs("div",{className:"flex gap-2",children:[t.jsxs("button",{onClick:()=>gt(L.id,L.variantAId),className:"flex items-center gap-1 rounded-lg border border-border px-3 py-1.5 text-xs text-indigo-400 hover:bg-surface-hover",children:[t.jsx(Bn,{className:"h-3 w-3"})," A wins"]}),t.jsxs("button",{onClick:()=>gt(L.id,L.variantBId),className:"flex items-center gap-1 rounded-lg border border-border px-3 py-1.5 text-xs text-emerald-400 hover:bg-surface-hover",children:[t.jsx(Bn,{className:"h-3 w-3"})," B wins"]})]}),L.winnerId&&t.jsxs("div",{className:"flex items-center gap-1 text-xs text-yellow-400",children:[t.jsx(Bn,{className:"h-3 w-3"}),"Winner: ",L.winnerId===L.variantAId?"Variant A":"Variant B"]})]}),!ee&&t.jsx("div",{className:"mt-3 text-xs text-zinc-500",children:"No runs yet. Run the agent to start collecting data."})]},L.id)}),he.length===0&&!ne&&t.jsx("div",{className:"rounded-lg border border-border bg-surface p-6 text-center text-zinc-400 text-sm",children:"No experiments yet. Create one to A/B test prompts with per-run metrics and statistical analysis."})]})]})}const R0="/api";async function Er(n){const r=localStorage.getItem("nestor_token"),d={"Content-Type":"application/json"};r&&(d.Authorization=`Bearer ${r}`);const o=await fetch(`${R0}${n}`,{headers:d});if(!o.ok)throw new Error(`API error: ${o.status}`);return o.json()}async function u1(n){const r=localStorage.getItem("nestor_token"),d={"Content-Type":"application/json"};r&&(d.Authorization=`Bearer ${r}`);const o=await fetch(`${R0}${n}`,{method:"DELETE",headers:d});if(!o.ok)throw new Error(`API error: ${o.status}`)}const m1={observation:"bg-blue-500/20 text-blue-400",fact:"bg-green-500/20 text-green-400",instruction:"bg-purple-500/20 text-purple-400",reflection:"bg-amber-500/20 text-amber-400"};function $h({type:n}){return t.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${m1[n]??"bg-zinc-500/20 text-zinc-400"}`,children:n})}function x1({value:n}){const r=Math.round(n*100),d=r>=80?"bg-red-500":r>=50?"bg-amber-500":"bg-green-500";return t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"h-1.5 w-16 rounded-full bg-zinc-700",children:t.jsx("div",{className:`h-full rounded-full ${d}`,style:{width:`${r}%`}})}),t.jsxs("span",{className:"text-xs text-zinc-500",children:[r,"%"]})]})}function Tr({label:n,value:r,icon:d}){return t.jsxs("div",{className:"rounded-lg border border-border bg-surface p-4",children:[t.jsxs("div",{className:"flex items-center gap-2 text-zinc-400",children:[t.jsx(d,{className:"h-4 w-4"}),t.jsx("span",{className:"text-xs font-medium uppercase tracking-wider",children:n})]}),t.jsx("p",{className:"mt-2 text-2xl font-semibold text-white",children:r})]})}function f1(){const{t:n}=We(),[r,d]=u.useState([]),[o,m]=u.useState([]),[f,h]=u.useState(null),[b,g]=u.useState(!0),[p,j]=u.useState(""),[y,w]=u.useState(""),[C,k]=u.useState(""),[N,S]=u.useState(null);u.useEffect(()=>{Er("/agents").then(E=>m(E.data)).catch(console.error)},[]);const z=u.useCallback(async()=>{g(!0);try{const E=new URLSearchParams;p&&E.set("q",p),y&&E.set("agentId",y),C&&E.set("type",C),E.set("limit","100");const ae=E.toString(),ce=await Er(`/memory?${ae}`);if(d(ce.data),y){const H=await Er(`/memory/stats/${y}`);h(H.data)}else if(o.length>0){let H=0,G=0;const P={};let W=!1;for(const Q of o)try{const le=await Er(`/memory/stats/${Q.id}`);H+=le.data.total,G+=le.data.avgImportance*le.data.total;for(const[F,re]of Object.entries(le.data.byType))P[F]=(P[F]??0)+re;le.data.fts5Available&&(W=!0)}catch{}h({total:H,byType:P,avgImportance:H>0?G/H:0,fts5Available:W})}}catch(E){console.error("Failed to load memories:",E)}finally{g(!1)}},[p,y,C,o]);u.useEffect(()=>{(o.length>0||y)&&z()},[z,o.length,y]);const M=async E=>{S(E);try{await u1(`/memory/${E}`),d(ae=>ae.filter(ce=>ce.id!==E))}catch(ae){console.error("Failed to delete memory:",ae)}finally{S(null)}},O=E=>{E.preventDefault(),z()};return t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(Ks,{className:"h-6 w-6 text-indigo-400"}),t.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Memory"})]}),(f==null?void 0:f.fts5Available)&&t.jsx("span",{className:"rounded-full bg-green-500/10 px-3 py-1 text-xs font-medium text-green-400",children:"FTS5 Active"})]}),f&&t.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-4",children:[t.jsx(Tr,{label:"Total Memories",value:f.total,icon:Ks}),t.jsx(Tr,{label:"Avg Importance",value:`${Math.round(f.avgImportance*100)}%`,icon:ga}),t.jsx(Tr,{label:"Types",value:Object.keys(f.byType).length,icon:wv}),t.jsx(Tr,{label:"Observations",value:f.byType.observation??0,icon:Ys})]}),f&&Object.keys(f.byType).length>0&&t.jsxs("div",{className:"rounded-lg border border-border bg-surface p-4",children:[t.jsx("h3",{className:"mb-3 text-sm font-medium text-zinc-400",children:"Distribution by Type"}),t.jsx("div",{className:"flex gap-4",children:Object.entries(f.byType).map(([E,ae])=>t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx($h,{type:E}),t.jsx("span",{className:"text-sm text-white",children:ae})]},E))})]}),t.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[t.jsxs("form",{onSubmit:O,className:"flex flex-1 gap-2",children:[t.jsxs("div",{className:"relative flex-1",children:[t.jsx(Js,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-zinc-500"}),t.jsx("input",{type:"text",value:p,onChange:E=>j(E.target.value),placeholder:"Search memories...",className:"w-full rounded-lg border border-border bg-surface py-2 pl-10 pr-4 text-sm text-white placeholder:text-zinc-500 focus:border-indigo-500 focus:outline-none"})]}),t.jsx("button",{type:"submit",className:"rounded-lg bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-500",children:"Search"})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsxs("select",{value:y,onChange:E=>w(E.target.value),className:"rounded-lg border border-border bg-surface px-3 py-2 text-sm text-white focus:border-indigo-500 focus:outline-none",children:[t.jsx("option",{value:"",children:"All Agents"}),o.map(E=>t.jsx("option",{value:E.id,children:E.name},E.id))]}),t.jsxs("select",{value:C,onChange:E=>k(E.target.value),className:"rounded-lg border border-border bg-surface px-3 py-2 text-sm text-white focus:border-indigo-500 focus:outline-none",children:[t.jsx("option",{value:"",children:"All Types"}),t.jsx("option",{value:"observation",children:"Observation"}),t.jsx("option",{value:"fact",children:"Fact"}),t.jsx("option",{value:"instruction",children:"Instruction"}),t.jsx("option",{value:"reflection",children:"Reflection"})]})]})]}),b?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})}):r.length===0?t.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-border bg-surface py-16",children:[t.jsx(Ks,{className:"h-12 w-12 text-zinc-600"}),t.jsx("p",{className:"mt-4 text-sm text-zinc-400",children:"No memories found"}),t.jsx("p",{className:"mt-1 text-xs text-zinc-500",children:"Memories are created when agents store observations, facts, and reflections."})]}):t.jsx("div",{className:"space-y-2",children:r.map(E=>t.jsx("div",{className:"group rounded-lg border border-border bg-surface p-4 transition-colors hover:border-border/80",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx($h,{type:E.memoryType}),t.jsx(x1,{value:E.importance}),t.jsxs("span",{className:"text-xs text-zinc-500",children:[new Date(E.createdAt*1e3).toLocaleDateString()," ",new Date(E.createdAt*1e3).toLocaleTimeString()]}),E.accessCount>0&&t.jsxs("span",{className:"text-xs text-zinc-600",children:["accessed ",E.accessCount,"x"]})]}),t.jsx("p",{className:"mt-2 text-sm text-zinc-200 leading-relaxed",children:E.content}),E.tags.length>0&&t.jsx("div",{className:"mt-2 flex flex-wrap gap-1",children:E.tags.map(ae=>t.jsxs("span",{className:"inline-flex items-center rounded bg-zinc-800 px-1.5 py-0.5 text-[10px] text-zinc-400",children:["#",ae]},ae))})]}),t.jsx("button",{onClick:()=>M(E.id),disabled:N===E.id,className:"rounded p-1.5 text-zinc-500 opacity-0 transition-all hover:bg-red-500/10 hover:text-red-400 group-hover:opacity-100 disabled:opacity-50",title:"Delete memory",children:N===E.id?t.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border border-red-400 border-t-transparent"}):t.jsx(Mt,{className:"h-4 w-4"})})]})},E.id))})]})}const h1="/api/budget";function p1(){const n={"Content-Type":"application/json"},r=localStorage.getItem("nestor_token");return r&&(n.Authorization=`Bearer ${r}`),n}async function ys(n,r){const d=await fetch(`${h1}${n}`,{...r,headers:p1()});if(!d.ok)throw new Error(`API error: ${d.status}`);if(d.status!==204)return d.json()}const Gs={listPolicies:()=>ys("/policies"),createPolicy:n=>ys("/policies",{method:"POST",body:JSON.stringify(n)}),updatePolicy:(n,r)=>ys(`/policies/${n}`,{method:"PUT",body:JSON.stringify(r)}),deletePolicy:n=>ys(`/policies/${n}`,{method:"DELETE"}),utilization:()=>ys("/utilization"),incidents:(n=50)=>ys(`/incidents?limit=${n}`),pauseAgent:n=>ys(`/agents/${n}/pause`,{method:"POST",body:"{}"}),resumeAgent:n=>ys(`/agents/${n}/resume`,{method:"POST",body:"{}"})};function Ud(n){return n<.01?`$${n.toFixed(4)}`:n<1?`$${n.toFixed(3)}`:`$${n.toFixed(2)}`}function M0(n){return new Date(n*1e3).toLocaleString()}function D0(n){switch(n){case"warning":return"text-amber-400";case"breach":return"text-red-400";case"pause":return"text-orange-400";case"resume":return"text-emerald-400";default:return"text-zinc-400"}}function g1(n){return n>=90?"bg-red-500":n>=70?"bg-amber-500":"bg-emerald-500"}function Hh({initial:n,onSave:r,onCancel:d}){const[o,m]=u.useState((n==null?void 0:n.name)??""),[f,h]=u.useState((n==null?void 0:n.scope)??"global"),[b,g]=u.useState((n==null?void 0:n.scopeId)??""),[p,j]=u.useState((n==null?void 0:n.window)??"monthly"),[y,w]=u.useState(String((n==null?void 0:n.limitUsd)??10)),[C,k]=u.useState(String((n==null?void 0:n.warningThresholdPercent)??80)),[N,S]=u.useState((n==null?void 0:n.action)??"stop"),[z,M]=u.useState((n==null?void 0:n.enabled)!==!1),O=E=>{E.preventDefault(),r({name:o,scope:f,scopeId:b||null,window:p,limitUsd:parseFloat(y)||10,warningThresholdPercent:parseFloat(C)||80,action:N,enabled:z})};return t.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",children:t.jsxs("div",{className:"w-full max-w-md rounded-xl border border-border bg-surface p-6",children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsx("h3",{className:"text-lg font-semibold text-white",children:n!=null&&n.id?"Edit Policy":"New Budget Policy"}),t.jsx("button",{onClick:d,className:"text-zinc-400 hover:text-white",children:t.jsx(Je,{className:"h-5 w-5"})})]}),t.jsxs("form",{onSubmit:O,className:"space-y-3",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs text-zinc-400 mb-1",children:"Name"}),t.jsx("input",{value:o,onChange:E=>m(E.target.value),required:!0,className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-white"})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs text-zinc-400 mb-1",children:"Scope"}),t.jsxs("select",{value:f,onChange:E=>h(E.target.value),className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-white",children:[t.jsx("option",{value:"global",children:"Global"}),t.jsx("option",{value:"agent",children:"Agent"}),t.jsx("option",{value:"workflow",children:"Workflow"}),t.jsx("option",{value:"tenant",children:"Tenant"})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs text-zinc-400 mb-1",children:"Scope ID"}),t.jsx("input",{value:b,onChange:E=>g(E.target.value),placeholder:"(optional)",className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-white"})]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs text-zinc-400 mb-1",children:"Window"}),t.jsxs("select",{value:p,onChange:E=>j(E.target.value),className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-white",children:[t.jsx("option",{value:"per_run",children:"Per Run"}),t.jsx("option",{value:"hourly",children:"Hourly"}),t.jsx("option",{value:"daily",children:"Daily"}),t.jsx("option",{value:"weekly",children:"Weekly"}),t.jsx("option",{value:"monthly",children:"Monthly"}),t.jsx("option",{value:"lifetime",children:"Lifetime"})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs text-zinc-400 mb-1",children:"Limit (USD)"}),t.jsx("input",{type:"number",step:"0.01",min:"0",value:y,onChange:E=>w(E.target.value),className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-white"})]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs text-zinc-400 mb-1",children:"Warning at (%)"}),t.jsx("input",{type:"number",step:"1",min:"0",max:"100",value:C,onChange:E=>k(E.target.value),className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-white"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs text-zinc-400 mb-1",children:"Action"}),t.jsxs("select",{value:N,onChange:E=>S(E.target.value),className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-white",children:[t.jsx("option",{value:"stop",children:"Stop"}),t.jsx("option",{value:"pause",children:"Pause"}),t.jsx("option",{value:"warn",children:"Warn"}),t.jsx("option",{value:"notify",children:"Notify"})]})]})]}),t.jsxs("label",{className:"flex items-center gap-2 text-sm text-zinc-300",children:[t.jsx("input",{type:"checkbox",checked:z,onChange:E=>M(E.target.checked),className:"rounded border-border"}),"Enabled"]}),t.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[t.jsx("button",{type:"button",onClick:d,className:"px-4 py-2 text-sm text-zinc-400 hover:text-white",children:"Cancel"}),t.jsx("button",{type:"submit",className:"rounded-lg bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-500",children:"Save"})]})]})]})})}function b1({report:n}){const r=n.policy;return t.jsxs("div",{className:"card",children:[t.jsxs("div",{className:"flex items-center justify-between mb-3",children:[t.jsxs("div",{children:[t.jsx("h4",{className:"text-sm font-medium text-white",children:r.name}),t.jsxs("p",{className:"text-xs text-zinc-500",children:[r.scope,r.scopeId?` / ${r.scopeId}`:""," · ",r.window," · ",r.action]})]}),t.jsx("span",{className:`text-xs font-medium ${r.enabled?"text-emerald-400":"text-zinc-500"}`,children:r.enabled?"Active":"Disabled"})]}),t.jsxs("div",{className:"mb-1 flex items-center justify-between text-xs text-zinc-400",children:[t.jsxs("span",{children:[Ud(n.spentUsd)," / ",Ud(r.limitUsd)]}),t.jsxs("span",{children:[n.utilizationPercent.toFixed(1),"%"]})]}),t.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full bg-zinc-800",children:t.jsx("div",{className:`h-full rounded-full transition-all ${g1(n.utilizationPercent)}`,style:{width:`${Math.min(100,n.utilizationPercent)}%`}})}),n.incidents.length>0&&t.jsxs("div",{className:"mt-2 text-xs text-zinc-500",children:["Last incident: ",t.jsx("span",{className:D0(n.incidents[0].type),children:n.incidents[0].type})," ",M0(n.incidents[0].createdAt)]})]})}function y1(){const{t:n}=We(),[r,d]=u.useState([]),[o,m]=u.useState([]),[f,h]=u.useState([]),[b,g]=u.useState(!0),[p,j]=u.useState(null),[y,w]=u.useState(!1),[C,k]=u.useState(null),N=u.useCallback(async()=>{try{g(!0),j(null);const[E,ae,ce]=await Promise.all([Gs.listPolicies(),Gs.utilization(),Gs.incidents(50)]);d(E.data),m(ae.data),h(ce.data)}catch(E){j(E instanceof Error?E.message:"Failed to load budget data")}finally{g(!1)}},[]);u.useEffect(()=>{N()},[N]);const S=async E=>{try{await Gs.createPolicy(E),w(!1),await N()}catch(ae){j(ae instanceof Error?ae.message:"Failed to create policy")}},z=async E=>{if(C)try{await Gs.updatePolicy(C.id,E),k(null),await N()}catch(ae){j(ae instanceof Error?ae.message:"Failed to update policy")}},M=async E=>{if(confirm("Delete this budget policy?"))try{await Gs.deletePolicy(E),await N()}catch(ae){j(ae instanceof Error?ae.message:"Failed to delete policy")}},O=async E=>{try{await Gs.resumeAgent(E),await N()}catch(ae){j(ae instanceof Error?ae.message:"Failed to resume agent")}};return b?t.jsx("div",{className:"flex h-64 items-center justify-center text-zinc-400",children:"Loading budget data..."}):t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-bold text-white",children:"Budget Management"}),t.jsx("p",{className:"text-sm text-zinc-400",children:"Scoped budget policies, utilization tracking, and cost control."})]}),t.jsxs("button",{onClick:()=>w(!0),className:"flex items-center gap-2 rounded-lg bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-500",children:[t.jsx(pt,{className:"h-4 w-4"})," New Policy"]})]}),p&&t.jsx("div",{className:"rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-3 text-sm text-red-400",children:p}),o.length>0&&t.jsxs("section",{children:[t.jsx("h2",{className:"mb-3 text-lg font-semibold text-white",children:"Utilization"}),t.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:o.map(E=>t.jsx(b1,{report:E},E.policy.id))})]}),t.jsxs("section",{children:[t.jsx("h2",{className:"mb-3 text-lg font-semibold text-white",children:"Policies"}),r.length===0?t.jsx("div",{className:"card text-center text-sm text-zinc-500 py-8",children:'No budget policies configured. Click "New Policy" to create one.'}):t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"w-full text-left text-sm",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-border text-zinc-500",children:[t.jsx("th",{className:"py-2 px-3 font-medium",children:"Name"}),t.jsx("th",{className:"py-2 px-3 font-medium",children:"Scope"}),t.jsx("th",{className:"py-2 px-3 font-medium",children:"Window"}),t.jsx("th",{className:"py-2 px-3 font-medium",children:"Limit"}),t.jsx("th",{className:"py-2 px-3 font-medium",children:"Action"}),t.jsx("th",{className:"py-2 px-3 font-medium",children:"Status"}),t.jsx("th",{className:"py-2 px-3 font-medium text-right",children:"Actions"})]})}),t.jsx("tbody",{children:r.map(E=>t.jsxs("tr",{className:"border-b border-border/50 hover:bg-surface-hover transition-colors",children:[t.jsx("td",{className:"py-2.5 px-3 text-white font-medium",children:E.name}),t.jsxs("td",{className:"py-2.5 px-3 text-zinc-300",children:[E.scope,E.scopeId?t.jsxs("span",{className:"text-zinc-500",children:[" / ",E.scopeId]}):""]}),t.jsx("td",{className:"py-2.5 px-3 text-zinc-300",children:E.window}),t.jsx("td",{className:"py-2.5 px-3 text-zinc-300",children:Ud(E.limitUsd)}),t.jsx("td",{className:"py-2.5 px-3",children:t.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${E.action==="stop"?"bg-red-500/10 text-red-400":E.action==="pause"?"bg-orange-500/10 text-orange-400":E.action==="warn"?"bg-amber-500/10 text-amber-400":"bg-blue-500/10 text-blue-400"}`,children:E.action})}),t.jsx("td",{className:"py-2.5 px-3",children:t.jsx("span",{className:`text-xs ${E.enabled?"text-emerald-400":"text-zinc-500"}`,children:E.enabled?"Enabled":"Disabled"})}),t.jsx("td",{className:"py-2.5 px-3 text-right",children:t.jsxs("div",{className:"flex items-center justify-end gap-1",children:[t.jsx("button",{onClick:()=>k(E),className:"p-1 text-zinc-400 hover:text-white",title:"Edit",children:t.jsx(yv,{className:"h-3.5 w-3.5"})}),t.jsx("button",{onClick:()=>M(E.id),className:"p-1 text-zinc-400 hover:text-red-400",title:"Delete",children:t.jsx(Mt,{className:"h-3.5 w-3.5"})})]})})]},E.id))})]})})]}),t.jsxs("section",{children:[t.jsx("h2",{className:"mb-3 text-lg font-semibold text-white",children:"Recent Incidents"}),f.length===0?t.jsx("div",{className:"card text-center text-sm text-zinc-500 py-6",children:"No budget incidents recorded."}):t.jsx("div",{className:"space-y-1",children:f.map(E=>t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border/30 bg-surface px-4 py-2.5 text-sm",children:[t.jsx("span",{className:`font-medium ${D0(E.type)}`,children:E.type.toUpperCase()}),t.jsx("span",{className:"flex-1 text-zinc-300 truncate",children:E.message}),E.agentId&&t.jsxs("span",{className:"text-xs text-zinc-500",children:["Agent: ",E.agentId.slice(0,8)]}),t.jsx("span",{className:"text-xs text-zinc-500",children:M0(E.createdAt)}),E.type==="pause"&&E.agentId&&t.jsxs("button",{onClick:()=>O(E.agentId),className:"flex items-center gap-1 rounded bg-emerald-600/20 px-2 py-1 text-xs text-emerald-400 hover:bg-emerald-600/30",children:[t.jsx(nv,{className:"h-3 w-3"})," Resume"]})]},E.id))})]}),y&&t.jsx(Hh,{onSave:S,onCancel:()=>w(!1)}),C&&t.jsx(Hh,{initial:C,onSave:z,onCancel:()=>k(null)})]})}const O0={mission:"Mission",objective:"Objective",key_result:"Key Result",task:"Task"},v1={mission:"bg-purple-500/10 text-purple-400 border-purple-500/20",objective:"bg-blue-500/10 text-blue-400 border-blue-500/20",key_result:"bg-cyan-500/10 text-cyan-400 border-cyan-500/20",task:"bg-green-500/10 text-green-400 border-green-500/20"},j1={active:Xs,completed:ht,paused:Yr,cancelled:Je},N1={active:"text-indigo-400",completed:"text-green-400",paused:"text-amber-400",cancelled:"text-zinc-500"};function L0({goal:n,depth:r,agents:d,onEdit:o,onDelete:m,onStatusChange:f}){const[h,b]=u.useState(r<2),g=n.children&&n.children.length>0,p=j1[n.status]??Xs,j=d.find(y=>y.id===n.ownerAgentId);return t.jsxs("div",{className:"group",children:[t.jsxs("div",{className:`flex items-center gap-2 rounded-lg px-3 py-2.5 transition-colors hover:bg-surface-hover ${r===0?"bg-surface border border-border":""}`,style:{paddingLeft:`${r*24+12}px`},children:[t.jsx("button",{onClick:()=>b(!h),className:`flex h-5 w-5 flex-shrink-0 items-center justify-center rounded transition-colors ${g?"text-zinc-400 hover:text-zinc-200":"text-transparent"}`,disabled:!g,children:g&&(h?t.jsx(Va,{className:"h-3.5 w-3.5"}):t.jsx(aa,{className:"h-3.5 w-3.5"}))}),t.jsx(p,{className:`h-4 w-4 flex-shrink-0 ${N1[n.status]}`}),t.jsx("span",{className:`inline-flex items-center rounded-md border px-1.5 py-0.5 text-[10px] font-medium uppercase ${v1[n.type]}`,children:O0[n.type]}),t.jsx("span",{className:"flex-1 truncate text-sm font-medium text-zinc-200",children:n.title}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"h-1.5 w-20 rounded-full bg-zinc-800",children:t.jsx("div",{className:"h-full rounded-full bg-indigo-500 transition-all",style:{width:`${n.progressPercent}%`}})}),t.jsxs("span",{className:"w-8 text-right text-xs text-zinc-500",children:[n.progressPercent,"%"]})]}),j&&t.jsxs("span",{className:"flex items-center gap-1 text-xs text-zinc-500",children:[t.jsx(Ka,{className:"h-3 w-3"}),j.name]}),n.dueDate&&t.jsxs("span",{className:"flex items-center gap-1 text-xs text-zinc-500",children:[t.jsx(sv,{className:"h-3 w-3"}),new Date(n.dueDate).toLocaleDateString()]}),t.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[n.status==="active"&&t.jsx("button",{onClick:()=>f(n.id,"completed"),className:"rounded p-1 text-zinc-500 hover:bg-green-500/10 hover:text-green-400",title:"Mark completed",children:t.jsx(ht,{className:"h-3.5 w-3.5"})}),n.status==="active"&&t.jsx("button",{onClick:()=>f(n.id,"paused"),className:"rounded p-1 text-zinc-500 hover:bg-amber-500/10 hover:text-amber-400",title:"Pause",children:t.jsx(Yr,{className:"h-3.5 w-3.5"})}),n.status==="paused"&&t.jsx("button",{onClick:()=>f(n.id,"active"),className:"rounded p-1 text-zinc-500 hover:bg-indigo-500/10 hover:text-indigo-400",title:"Resume",children:t.jsx(Xs,{className:"h-3.5 w-3.5"})}),t.jsx("button",{onClick:()=>o(n),className:"rounded p-1 text-zinc-500 hover:bg-surface-hover hover:text-zinc-200",title:"Edit",children:t.jsx(Fd,{className:"h-3.5 w-3.5"})}),t.jsx("button",{onClick:()=>m(n.id),className:"rounded p-1 text-zinc-500 hover:bg-red-500/10 hover:text-red-400",title:"Delete",children:t.jsx(Mt,{className:"h-3.5 w-3.5"})})]})]}),h&&g&&t.jsx("div",{children:n.children.map(y=>t.jsx(L0,{goal:y,depth:r+1,agents:d,onEdit:o,onDelete:m,onStatusChange:f},y.id))})]})}function w1({goal:n,parentGoals:r,agents:d,onSave:o,onClose:m}){const[f,h]=u.useState((n==null?void 0:n.title)??""),[b,g]=u.useState((n==null?void 0:n.description)??""),[p,j]=u.useState((n==null?void 0:n.type)??"task"),[y,w]=u.useState((n==null?void 0:n.parentId)??""),[C,k]=u.useState((n==null?void 0:n.ownerAgentId)??""),[N,S]=u.useState((n==null?void 0:n.priority)??5),[z,M]=u.useState((n==null?void 0:n.dueDate)??""),O=E=>{E.preventDefault(),o({title:f,description:b||void 0,type:p,parentId:y||null,ownerAgentId:C||void 0,priority:N,dueDate:z||void 0})};return t.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:t.jsxs("div",{className:"w-full max-w-lg rounded-xl border border-border bg-surface p-6 shadow-xl",children:[t.jsx("h2",{className:"text-lg font-semibold text-white mb-4",children:n?"Edit Goal":"Create Goal"}),t.jsxs("form",{onSubmit:O,className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-zinc-300 mb-1",children:"Title"}),t.jsx("input",{type:"text",value:f,onChange:E=>h(E.target.value),className:"input w-full",required:!0})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-zinc-300 mb-1",children:"Description"}),t.jsx("textarea",{value:b,onChange:E=>g(E.target.value),className:"input w-full h-20 resize-none"})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-zinc-300 mb-1",children:"Type"}),t.jsxs("select",{value:p,onChange:E=>j(E.target.value),className:"input w-full",children:[t.jsx("option",{value:"mission",children:"Mission"}),t.jsx("option",{value:"objective",children:"Objective"}),t.jsx("option",{value:"key_result",children:"Key Result"}),t.jsx("option",{value:"task",children:"Task"})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-zinc-300 mb-1",children:"Parent"}),t.jsxs("select",{value:y,onChange:E=>w(E.target.value),className:"input w-full",children:[t.jsx("option",{value:"",children:"None (root)"}),r.map(E=>t.jsxs("option",{value:E.id,children:["[",O0[E.type],"] ",E.title]},E.id))]})]})]}),t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-zinc-300 mb-1",children:"Priority (1-10)"}),t.jsx("input",{type:"number",min:1,max:10,value:N,onChange:E=>S(Number(E.target.value)),className:"input w-full"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-zinc-300 mb-1",children:"Assign Agent"}),t.jsxs("select",{value:C,onChange:E=>k(E.target.value),className:"input w-full",children:[t.jsx("option",{value:"",children:"Unassigned"}),d.map(E=>t.jsx("option",{value:E.id,children:E.name},E.id))]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-zinc-300 mb-1",children:"Due Date"}),t.jsx("input",{type:"date",value:z,onChange:E=>M(E.target.value),className:"input w-full"})]})]}),t.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[t.jsx("button",{type:"button",onClick:m,className:"btn-ghost",children:"Cancel"}),t.jsx("button",{type:"submit",className:"btn-primary",children:n?"Update":"Create"})]})]})]})})}function _0(n,r=[]){for(const d of n)r.push(d),d.children&&_0(d.children,r);return r}function S1(){const{t:n}=We(),[r,d]=u.useState([]),[o,m]=u.useState([]),[f,h]=u.useState(!0),[b,g]=u.useState(null),[p,j]=u.useState(null),y=u.useCallback(async()=>{try{g(null);const[S,z]=await Promise.all([Yl.tree(),ws.list()]);d(S.data),m(z.data)}catch(S){g(S instanceof Error?S.message:"Failed to fetch goals")}finally{h(!1)}},[]);u.useEffect(()=>{y()},[y]);const w=async S=>{try{p&&p!=="new"?await Yl.update(p.id,S):await Yl.create(S),j(null),y()}catch(z){console.error("Save failed:",z)}},C=async S=>{if(confirm("Delete this goal and all its children?"))try{await Yl.delete(S),y()}catch(z){console.error("Delete failed:",z)}},k=async(S,z)=>{try{await Yl.update(S,{status:z}),y()}catch(M){console.error("Status change failed:",M)}};if(f)return t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})});const N=_0(r);return t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Goals"}),r.length>0&&t.jsxs("span",{className:"badge bg-indigo-500/10 text-indigo-400",children:[N.length," total"]})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("button",{onClick:y,className:"btn-ghost btn-sm",children:t.jsx(Yt,{className:"h-4 w-4"})}),t.jsxs("button",{onClick:()=>j("new"),className:"btn-primary btn-sm",children:[t.jsx(pt,{className:"h-4 w-4"}),"New Goal"]})]})]}),b&&t.jsxs("div",{className:"rounded-lg border border-red-500/20 bg-red-500/5 p-4 text-sm text-red-400",children:[b,t.jsx("button",{onClick:y,className:"ml-3 underline",children:"Retry"})]}),r.length===0&&!b?t.jsx(Qs,{icon:t.jsx(Xs,{className:"h-8 w-8"}),title:"No goals yet",description:"Create a mission to get started with goal-driven AI agents."}):t.jsx("div",{className:"space-y-1",children:r.map(S=>t.jsx(L0,{goal:S,depth:0,agents:o,onEdit:z=>j(z),onDelete:C,onStatusChange:k},S.id))}),p!==null&&t.jsx(w1,{goal:p==="new"?null:p,parentGoals:N,agents:o,onSave:w,onClose:()=>j(null)})]})}function k1(){const n=Rt(),{t:r}=We(),[d,o]=u.useState([]),[m,f]=u.useState(!0),[h,b]=u.useState("pending"),[g,p]=u.useState({}),[j,y]=u.useState(null),w=u.useCallback(async()=>{try{const S=h==="all"?void 0:{status:h},z=await $r.list(S);o(z.data)}catch{}finally{f(!1)}},[h]);u.useEffect(()=>{f(!0),w()},[w]);const C=async S=>{var M;const z=(M=g[S.id])==null?void 0:M.trim();if(z){y(S.id);try{await $r.resume(S.id,z),p(O=>{const E={...O};return delete E[S.id],E}),w()}catch(O){console.error("Resume failed:",O)}finally{y(null)}}},k=S=>{switch(S){case"pending":return t.jsx(Ys,{className:"h-4 w-4 text-amber-400"});case"resumed":return t.jsx(ct,{className:"h-4 w-4 text-green-400"});case"expired":return t.jsx(wt,{className:"h-4 w-4 text-zinc-500"});default:return t.jsx(Ys,{className:"h-4 w-4 text-zinc-500"})}},N=S=>{const z={pending:"bg-amber-500/10 text-amber-400 border-amber-500/30",resumed:"bg-green-500/10 text-green-400 border-green-500/30",expired:"bg-zinc-500/10 text-zinc-400 border-zinc-500/30"};return t.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium ${z[S]??z.expired}`,children:[k(S),S]})};return m?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})}):t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(_r,{className:"h-6 w-6 text-amber-400"}),t.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Handoffs"})]}),t.jsx("div",{className:"flex items-center gap-2",children:t.jsx("button",{onClick:w,className:"btn-ghost btn-sm",children:t.jsx(Yt,{className:"h-3.5 w-3.5"})})})]}),t.jsx("div",{className:"flex gap-2",children:["pending","resumed","expired","all"].map(S=>t.jsx("button",{className:`rounded-lg px-3 py-1.5 text-sm font-medium transition-colors ${h===S?"bg-indigo-500/10 text-indigo-400 border border-indigo-500/30":"text-zinc-400 hover:text-zinc-200 border border-transparent"}`,onClick:()=>b(S),children:S.charAt(0).toUpperCase()+S.slice(1)},S))}),d.length===0?t.jsx("div",{className:"card",children:t.jsxs("p",{className:"text-sm text-zinc-500 text-center py-8",children:["No ",h==="all"?"":h+" ","handoffs found."]})}):t.jsx("div",{className:"space-y-4",children:d.map(S=>{var z;return t.jsxs("div",{className:`card ${S.status==="pending"?"border-amber-500/20":""}`,children:[t.jsxs("div",{className:"flex items-start justify-between mb-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[N(S.status),t.jsxs("span",{className:"text-xs text-zinc-500 font-mono",children:[S.id.slice(0,12),"..."]})]}),t.jsx("button",{className:"text-xs text-indigo-400 hover:text-indigo-300",onClick:()=>n(`/runs/${S.runId}`),children:"View Run"})]}),t.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-xs text-zinc-500 mb-1 font-medium",children:"Accomplished"}),t.jsx("p",{className:"text-sm text-zinc-300",children:S.accomplished})]}),t.jsxs("div",{children:[t.jsx("p",{className:"text-xs text-zinc-500 mb-1 font-medium",children:"Blocking"}),t.jsx("p",{className:"text-sm text-red-400",children:S.blocking})]}),t.jsxs("div",{children:[t.jsx("p",{className:"text-xs text-zinc-500 mb-1 font-medium",children:"Suggestions"}),t.jsx("p",{className:"text-sm text-zinc-300",children:S.suggestions})]})]}),t.jsxs("div",{className:"flex items-center gap-3 mt-3 text-xs text-zinc-500",children:[t.jsxs("span",{children:["Agent: ",S.agentId.slice(0,12),"..."]}),t.jsxs("span",{children:["Created: ",new Date(S.createdAt).toLocaleString()]}),S.resumedAt&&t.jsxs("span",{children:["Resumed: ",new Date(S.resumedAt).toLocaleString()]})]}),S.status==="pending"&&t.jsxs("div",{className:"mt-4 flex items-center gap-2 border-t border-zinc-800 pt-3",children:[t.jsx("input",{type:"text",className:"flex-1 rounded-lg border border-zinc-700 bg-zinc-800 px-3 py-2 text-sm text-zinc-200 placeholder-zinc-500 focus:border-indigo-500 focus:outline-none",placeholder:"Describe how you resolved the blocking issue...",value:g[S.id]??"",onChange:M=>p(O=>({...O,[S.id]:M.target.value}))}),t.jsx("button",{className:"btn-primary btn-sm",disabled:!((z=g[S.id])!=null&&z.trim())||j===S.id,onClick:()=>C(S),children:j===S.id?"Resuming...":"Resume"})]})]},S.id)})})]})}const qh={low:"bg-green-500/10 text-green-400 border-green-500/20",medium:"bg-yellow-500/10 text-yellow-400 border-yellow-500/20",high:"bg-orange-500/10 text-orange-400 border-orange-500/20",critical:"bg-red-500/10 text-red-400 border-red-500/20"};function z1({level:n}){return t.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium ${qh[n]??qh.low}`,children:[n==="critical"&&t.jsx(lt,{className:"h-3 w-3"}),n==="high"&&t.jsx(lt,{className:"h-3 w-3"}),n.toUpperCase()]})}const Jr="/api";async function zd(n){const r=localStorage.getItem("nestor_token"),d={"Content-Type":"application/json"};r&&(d.Authorization=`Bearer ${r}`);const o=await fetch(`${Jr}/plans/${n}`,{headers:d});if(!o.ok)throw new Error(`Failed to fetch plan: ${o.statusText}`);return(await o.json()).data}async function C1(n){const r=localStorage.getItem("nestor_token"),d={"Content-Type":"application/json"};r&&(d.Authorization=`Bearer ${r}`);const o=await fetch(`${Jr}/plans/${n}/execute`,{method:"POST",headers:d});if(!o.ok)throw new Error(`Failed to execute plan: ${o.statusText}`)}async function A1(n){const r=localStorage.getItem("nestor_token"),d={"Content-Type":"application/json"};r&&(d.Authorization=`Bearer ${r}`);const o=await fetch(`${Jr}/plans/${n}/cancel`,{method:"POST",headers:d});if(!o.ok)throw new Error(`Failed to cancel plan: ${o.statusText}`)}async function E1(){const n=localStorage.getItem("nestor_token"),r={"Content-Type":"application/json"};n&&(r.Authorization=`Bearer ${n}`);const d=await fetch(`${Jr}/plans?limit=50`,{headers:r});if(!d.ok)throw new Error(`Failed to fetch plans: ${d.statusText}`);return(await d.json()).data}function T1(){const[n,r]=u.useState([]),[d,o]=u.useState(!0),m=Rt();return u.useEffect(()=>{E1().then(r).catch(console.error).finally(()=>o(!1))},[]),d?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})}):t.jsxs("div",{className:"space-y-6",children:[t.jsx("div",{className:"flex items-center justify-between",children:t.jsx("h1",{className:"text-2xl font-bold text-white",children:"Dry-Run Plans"})}),n.length===0?t.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-border bg-surface p-12 text-center",children:[t.jsx(Ns,{className:"mb-4 h-12 w-12 text-zinc-600"}),t.jsxs("p",{className:"text-zinc-400",children:["No plans yet. Use the ",t.jsx("code",{className:"text-indigo-400",children:"/plan"})," command in the CLI or the API to create a dry-run plan."]})]}):t.jsx("div",{className:"space-y-3",children:n.map(f=>t.jsxs("button",{onClick:()=>m(`/plans/${f.id}`),className:"flex w-full items-center justify-between rounded-lg border border-border bg-surface p-4 text-left transition-colors hover:bg-surface-hover",children:[t.jsxs("div",{className:"flex-1",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsxs("span",{className:"text-sm font-medium text-white",children:[f.prompt.slice(0,80),f.prompt.length>80?"...":""]}),t.jsx("span",{className:`rounded-full px-2 py-0.5 text-xs font-medium ${f.status==="completed"?"bg-green-500/10 text-green-400":f.status==="executing"?"bg-blue-500/10 text-blue-400":f.status==="cancelled"?"bg-zinc-500/10 text-zinc-400":"bg-yellow-500/10 text-yellow-400"}`,children:f.status})]}),t.jsxs("div",{className:"mt-1 flex items-center gap-4 text-xs text-zinc-500",children:[t.jsxs("span",{children:[f.steps.length," step(s)"]}),t.jsxs("span",{children:["$",f.estimatedCostUsd.toFixed(4)]}),t.jsx("span",{children:new Date(f.createdAt).toLocaleString()})]})]}),t.jsx(aa,{className:"h-4 w-4 text-zinc-600"})]},f.id))})]})}function R1(){const{id:n}=Vn(),r=Rt(),[d,o]=u.useState(null),[m,f]=u.useState(!0),[h,b]=u.useState(!1),[g,p]=u.useState(-1);u.useEffect(()=>{n&&zd(n).then(o).catch(console.error).finally(()=>f(!1))},[n]);const j=async()=>{if(d){b(!0);try{await C1(d.id);for(let k=0;k<d.steps.length;k++)p(k),await new Promise(N=>setTimeout(N,500));p(d.steps.length);const C=await zd(d.id);o(C)}catch(C){console.error("Execute failed:",C)}finally{b(!1)}}},y=async()=>{if(d)try{await A1(d.id);const C=await zd(d.id);o(C)}catch(C){console.error("Cancel failed:",C)}};if(m)return t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})});if(!d)return t.jsx("div",{className:"py-20 text-center text-zinc-400",children:"Plan not found."});const w=d.status==="pending"||d.status==="approved";return t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("button",{onClick:()=>r("/plans"),className:"text-sm text-zinc-500 hover:text-zinc-300",children:"← Back to Plans"}),t.jsxs("h1",{className:"mt-1 text-2xl font-bold text-white",children:["Plan: ",d.id]}),t.jsx("p",{className:"mt-1 text-sm text-zinc-400",children:d.prompt})]}),t.jsx("div",{className:"flex gap-2",children:w&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:j,disabled:h,className:"flex items-center gap-2 rounded-lg bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-500 disabled:opacity-50",children:[t.jsx(jt,{className:"h-4 w-4"}),"Execute All"]}),t.jsxs("button",{onClick:y,className:"flex items-center gap-2 rounded-lg border border-border px-4 py-2 text-sm font-medium text-zinc-400 hover:text-white hover:border-zinc-600",children:[t.jsx(wt,{className:"h-4 w-4"}),"Cancel"]})]})})]}),t.jsxs("div",{className:"flex gap-4 rounded-lg border border-border bg-surface p-4 text-sm",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-zinc-500",children:"Status:"})," ",t.jsx("span",{className:"font-medium text-white",children:d.status})]}),t.jsxs("div",{children:[t.jsx("span",{className:"text-zinc-500",children:"Steps:"})," ",t.jsx("span",{className:"font-medium text-white",children:d.steps.length})]}),t.jsxs("div",{children:[t.jsx("span",{className:"text-zinc-500",children:"Est. Cost:"})," ",t.jsxs("span",{className:"font-medium text-white",children:["$",d.estimatedCostUsd.toFixed(4)]})]}),t.jsxs("div",{children:[t.jsx("span",{className:"text-zinc-500",children:"Iterations:"})," ",t.jsx("span",{className:"font-medium text-white",children:d.estimatedIterations})]})]}),t.jsx("div",{className:"space-y-2",children:d.steps.map((C,k)=>{const N=g===k,S=g>k,z=Object.entries(C.args).map(([M,O])=>`${M}: ${typeof O=="string"?O.slice(0,80):JSON.stringify(O).slice(0,80)}`).join(" | ");return t.jsxs("div",{className:`rounded-lg border p-4 transition-colors ${N?"border-indigo-500 bg-indigo-500/5":S?"border-green-500/30 bg-green-500/5":"border-border bg-surface"}`,children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:`flex h-7 w-7 items-center justify-center rounded-full text-xs font-bold ${S?"bg-green-500/20 text-green-400":N?"bg-indigo-500/20 text-indigo-400":"bg-zinc-800 text-zinc-400"}`,children:S?t.jsx(ct,{className:"h-4 w-4"}):k+1}),t.jsx("span",{className:"font-mono text-sm font-medium text-white",children:C.toolName}),t.jsx(z1,{level:C.riskLevel}),N&&t.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})]}),t.jsx("div",{className:"mt-2 pl-10 text-xs text-zinc-500 font-mono",children:z}),t.jsx("div",{className:"mt-1 pl-10 text-xs text-zinc-600 italic",children:C.mockResult})]},C.index)})})]})}const M1={file_pattern:"File Pattern",command_pattern:"Command Pattern",url_pattern:"URL Pattern",limit:"Limit"},D1={block:"bg-red-500/10 text-red-400 border-red-500/20",warn:"bg-yellow-500/10 text-yellow-400 border-yellow-500/20",approve:"bg-blue-500/10 text-blue-400 border-blue-500/20"},Fr="/api";function Ir(){const n={"Content-Type":"application/json"},r=localStorage.getItem("nestor_token");r&&(n.Authorization=`Bearer ${r}`);const d=localStorage.getItem("nestor_tenant_id");return d&&(n["X-Tenant-ID"]=d),n}async function O1(){const n=await fetch(`${Fr}/guardrails`,{headers:Ir()});if(!n.ok)throw new Error(`Failed to fetch guardrails: ${n.statusText}`);return(await n.json()).data}async function L1(n){const r=await fetch(`${Fr}/guardrails`,{method:"POST",headers:Ir(),body:JSON.stringify(n)});if(!r.ok)throw new Error(`Failed to create guardrail: ${r.statusText}`);return(await r.json()).data}async function Gh(n,r){const d=await fetch(`${Fr}/guardrails/${n}`,{method:"PUT",headers:Ir(),body:JSON.stringify(r)});if(!d.ok)throw new Error(`Failed to update guardrail: ${d.statusText}`)}async function _1(n){const r=await fetch(`${Fr}/guardrails/${n}`,{method:"DELETE",headers:Ir()});if(!r.ok)throw new Error(`Failed to delete guardrail: ${r.statusText}`)}function U1(){const[n,r]=u.useState([]),[d,o]=u.useState(!0),[m,f]=u.useState(!1),[h,b]=u.useState(null),[g,p]=u.useState({name:"",type:"command_pattern",pattern:"",action:"block",config:"{}",enabled:!0}),j=u.useCallback(()=>{o(!0),O1().then(r).catch(console.error).finally(()=>o(!1))},[]);u.useEffect(()=>{j()},[j]);const y=()=>{p({name:"",type:"command_pattern",pattern:"",action:"block",config:"{}",enabled:!0}),b(null),f(!1)},w=async()=>{if(!g.name.trim()||!g.pattern.trim())return;let S={};try{S=JSON.parse(g.config)}catch{}try{h?await Gh(h,{...g,config:S}):await L1({...g,config:S}),y(),j()}catch(z){console.error("Save failed:",z)}},C=async S=>{try{await Gh(S.id,{enabled:!S.enabled}),j()}catch(z){console.error("Toggle failed:",z)}},k=async S=>{try{await _1(S),j()}catch(z){console.error("Delete failed:",z)}},N=S=>{p({name:S.name,type:S.type,pattern:S.pattern,action:S.action,config:JSON.stringify(S.config,null,2),enabled:S.enabled}),b(S.id),f(!0)};return d?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})}):t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h1",{className:"text-2xl font-bold text-white",children:"Guardrails"}),t.jsxs("button",{onClick:()=>{y(),f(!0)},className:"flex items-center gap-2 rounded-lg bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-500",children:[t.jsx(pt,{className:"h-4 w-4"}),"Add Rule"]})]}),m&&t.jsxs("div",{className:"rounded-lg border border-border bg-surface p-5 space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-lg font-semibold text-white",children:h?"Edit Guardrail":"New Guardrail"}),t.jsx("button",{onClick:y,className:"text-zinc-500 hover:text-white",children:t.jsx(Je,{className:"h-4 w-4"})})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs font-medium text-zinc-400 mb-1",children:"Name"}),t.jsx("input",{value:g.name,onChange:S=>p(z=>({...z,name:S.target.value})),placeholder:"e.g., Block production DB access",className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-white placeholder:text-zinc-600 focus:border-indigo-500 focus:outline-none"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs font-medium text-zinc-400 mb-1",children:"Type"}),t.jsxs("select",{value:g.type,onChange:S=>p(z=>({...z,type:S.target.value})),className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-white focus:border-indigo-500 focus:outline-none",children:[t.jsx("option",{value:"command_pattern",children:"Command Pattern"}),t.jsx("option",{value:"file_pattern",children:"File Pattern"}),t.jsx("option",{value:"url_pattern",children:"URL Pattern"}),t.jsx("option",{value:"limit",children:"Limit"})]})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs font-medium text-zinc-400 mb-1",children:"Pattern (regex or substring)"}),t.jsx("input",{value:g.pattern,onChange:S=>p(z=>({...z,pattern:S.target.value})),placeholder:g.type==="limit"?"shell_exec":"e.g., rm\\s+-rf|DROP\\s+TABLE",className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-white font-mono placeholder:text-zinc-600 focus:border-indigo-500 focus:outline-none"})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs font-medium text-zinc-400 mb-1",children:"Action"}),t.jsxs("select",{value:g.action,onChange:S=>p(z=>({...z,action:S.target.value})),className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-white focus:border-indigo-500 focus:outline-none",children:[t.jsx("option",{value:"block",children:"Block"}),t.jsx("option",{value:"warn",children:"Warn"}),t.jsx("option",{value:"approve",children:"Require Approval"})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs font-medium text-zinc-400 mb-1",children:"Config (JSON)"}),t.jsx("input",{value:g.config,onChange:S=>p(z=>({...z,config:S.target.value})),placeholder:'e.g., {"maxPerRun": 5}',className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-white font-mono placeholder:text-zinc-600 focus:border-indigo-500 focus:outline-none"})]})]}),t.jsxs("div",{className:"flex items-center justify-between pt-2",children:[t.jsxs("label",{className:"flex items-center gap-2 text-sm text-zinc-400",children:[t.jsx("input",{type:"checkbox",checked:g.enabled,onChange:S=>p(z=>({...z,enabled:S.target.checked})),className:"rounded border-border"}),"Enabled"]}),t.jsx("button",{onClick:w,className:"rounded-lg bg-indigo-600 px-6 py-2 text-sm font-medium text-white hover:bg-indigo-500",children:h?"Update":"Create"})]})]}),n.length===0&&!m?t.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-border bg-surface p-12 text-center",children:[t.jsx(Ns,{className:"mb-4 h-12 w-12 text-zinc-600"}),t.jsx("p",{className:"text-zinc-400",children:"No guardrails configured."}),t.jsx("p",{className:"mt-1 text-sm text-zinc-600",children:"Add rules to control what tools can do -- block dangerous patterns, enforce limits, or require approval."})]}):t.jsx("div",{className:"space-y-2",children:n.map(S=>t.jsxs("div",{className:`flex items-center justify-between rounded-lg border p-4 transition-colors ${S.enabled?"border-border bg-surface":"border-border/50 bg-surface/50 opacity-60"}`,children:[t.jsxs("div",{className:"flex-1",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("span",{className:"text-sm font-medium text-white",children:S.name}),t.jsx("span",{className:"rounded-full bg-zinc-800 px-2 py-0.5 text-[10px] font-medium text-zinc-400",children:M1[S.type]??S.type}),t.jsx("span",{className:`rounded-full border px-2 py-0.5 text-[10px] font-medium ${D1[S.action]??""}`,children:S.action})]}),t.jsx("div",{className:"mt-1 font-mono text-xs text-zinc-500",children:S.pattern})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("button",{onClick:()=>C(S),className:"text-zinc-500 hover:text-white",title:S.enabled?"Disable":"Enable",children:S.enabled?t.jsx(zv,{className:"h-5 w-5 text-green-400"}):t.jsx(kv,{className:"h-5 w-5"})}),t.jsx("button",{onClick:()=>N(S),className:"text-zinc-500 hover:text-white",title:"Edit",children:t.jsx(Fd,{className:"h-4 w-4"})}),t.jsx("button",{onClick:()=>k(S.id),className:"text-zinc-500 hover:text-red-400",title:"Delete",children:t.jsx(Mt,{className:"h-4 w-4"})})]})]},S.id))})]})}const Kh={agent:t.jsx(tv,{className:"h-3 w-3"}),project:t.jsx(f0,{className:"h-3 w-3"}),global:t.jsx(Zd,{className:"h-3 w-3"})},Vh={agent:"bg-blue-500/20 text-blue-400",project:"bg-purple-500/20 text-purple-400",global:"bg-amber-500/20 text-amber-400"};function B1(){const{id:n}=Vn(),[r,d]=u.useState([]),[o,m]=u.useState(null),[f,h]=u.useState(!0),[b,g]=u.useState(""),[p,j]=u.useState(""),[y,w]=u.useState(""),[C,k]=u.useState(!1),[N,S]=u.useState(""),[z,M]=u.useState(""),[O,E]=u.useState("agent"),[ae,ce]=u.useState(.5),H=u.useCallback(async()=>{if(n){h(!0);try{const Q=new URLSearchParams;b&&Q.set("q",b),p&&Q.set("scope",p),Q.set("limit","100");const[le,F]=await Promise.all([fetch(`/api/agents/${n}/memory?${Q}`,{credentials:"include"}),fetch(`/api/agents/${n}/memory/stats`,{credentials:"include"})]);if(le.ok){const re=await le.json();d(re.data||[])}if(F.ok){const re=await F.json();m(re.data)}}catch{}h(!1)}},[n,b,p]);u.useEffect(()=>{H()},[H]);const G=Q=>{Q.preventDefault(),H()},P=async()=>{var Q;if(!(!n||!N.trim()||!z.trim())){w("");try{const le=await fetch(`/api/agents/${n}/memory`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:N,value:z,scope:O,importance:ae})});if(!le.ok){const F=await le.json();throw new Error(((Q=F.error)==null?void 0:Q.message)||"Failed")}k(!1),S(""),M(""),ce(.5),await H()}catch(le){w(le.message)}}},W=async Q=>{if(n)try{(await fetch(`/api/agents/${n}/memory/${encodeURIComponent(Q)}`,{method:"DELETE",credentials:"include"})).ok&&d(F=>F.filter(re=>re.key!==Q))}catch{}};return f?t.jsx("div",{className:"flex h-64 items-center justify-center text-zinc-400",children:"Loading..."}):t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(Ks,{className:"h-6 w-6 text-indigo-400"}),t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Agent Memory Store"}),t.jsx("p",{className:"mt-1 text-sm text-zinc-400",children:"Key-value memory entries with scope, importance, and FTS5 search."})]})]}),t.jsxs("button",{onClick:()=>k(!0),className:"flex items-center gap-2 rounded-lg bg-indigo-600 px-3 py-2 text-sm font-medium text-white hover:bg-indigo-700",children:[t.jsx(pt,{className:"h-4 w-4"})," Add Memory"]})]}),y&&t.jsx("div",{className:"rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-2 text-sm text-red-400",children:y}),o&&t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsxs("div",{className:"rounded-lg border border-border bg-surface p-4",children:[t.jsx("div",{className:"text-xs font-medium uppercase tracking-wider text-zinc-400",children:"Total Entries"}),t.jsx("p",{className:"mt-2 text-2xl font-semibold text-white",children:o.total})]}),t.jsxs("div",{className:"rounded-lg border border-border bg-surface p-4",children:[t.jsx("div",{className:"text-xs font-medium uppercase tracking-wider text-zinc-400",children:"Total Size"}),t.jsx("p",{className:"mt-2 text-2xl font-semibold text-white",children:o.totalSize>1024?`${(o.totalSize/1024).toFixed(1)} KB`:`${o.totalSize} B`})]}),t.jsxs("div",{className:"rounded-lg border border-border bg-surface p-4",children:[t.jsx("div",{className:"text-xs font-medium uppercase tracking-wider text-zinc-400",children:"By Scope"}),t.jsx("div",{className:"mt-2 flex gap-2",children:Object.entries(o.byScope).map(([Q,le])=>t.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium ${Vh[Q]??"bg-zinc-500/20 text-zinc-400"}`,children:[Kh[Q]," ",Q,": ",le]},Q))})]})]}),C&&t.jsxs("div",{className:"rounded-lg border border-border bg-surface p-4 space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h3",{className:"text-sm font-medium text-white",children:"Add Memory Entry"}),t.jsx("button",{onClick:()=>k(!1),className:"text-zinc-400 hover:text-white",children:t.jsx(Je,{className:"h-4 w-4"})})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsx("input",{type:"text",value:N,onChange:Q=>S(Q.target.value),placeholder:"Key (e.g. user_preference_language)",className:"rounded-lg border border-border bg-background px-3 py-2 text-sm text-white"}),t.jsxs("select",{value:O,onChange:Q=>E(Q.target.value),className:"rounded-lg border border-border bg-background px-3 py-2 text-sm text-white",children:[t.jsx("option",{value:"agent",children:"agent"}),t.jsx("option",{value:"project",children:"project"}),t.jsx("option",{value:"global",children:"global"})]})]}),t.jsx("textarea",{value:z,onChange:Q=>M(Q.target.value),placeholder:"Value...",rows:3,className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-white"}),t.jsxs("div",{children:[t.jsxs("label",{className:"text-xs text-zinc-400",children:["Importance: ",ae.toFixed(1)]}),t.jsx("input",{type:"range",min:0,max:100,value:ae*100,onChange:Q=>ce(Number(Q.target.value)/100),className:"w-full"})]}),t.jsx("button",{onClick:P,disabled:!N.trim()||!z.trim(),className:"rounded-lg bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-700 disabled:opacity-50",children:"Store Memory"})]}),t.jsxs("div",{className:"flex gap-3",children:[t.jsxs("form",{onSubmit:G,className:"flex flex-1 gap-2",children:[t.jsxs("div",{className:"relative flex-1",children:[t.jsx(Js,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-zinc-500"}),t.jsx("input",{type:"text",value:b,onChange:Q=>g(Q.target.value),placeholder:"Search by key or value...",className:"w-full rounded-lg border border-border bg-surface py-2 pl-10 pr-4 text-sm text-white placeholder:text-zinc-500 focus:border-indigo-500 focus:outline-none"})]}),t.jsx("button",{type:"submit",className:"rounded-lg bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-500",children:"Search"})]}),t.jsxs("select",{value:p,onChange:Q=>j(Q.target.value),className:"rounded-lg border border-border bg-surface px-3 py-2 text-sm text-white",children:[t.jsx("option",{value:"",children:"All Scopes"}),t.jsx("option",{value:"agent",children:"Agent"}),t.jsx("option",{value:"project",children:"Project"}),t.jsx("option",{value:"global",children:"Global"})]})]}),r.length===0?t.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-border bg-surface py-16",children:[t.jsx(dv,{className:"h-12 w-12 text-zinc-600"}),t.jsx("p",{className:"mt-4 text-sm text-zinc-400",children:"No memory entries found"}),t.jsx("p",{className:"mt-1 text-xs text-zinc-500",children:"Memory entries are key-value pairs that persist across agent runs."})]}):t.jsx("div",{className:"space-y-2",children:r.map(Q=>t.jsx("div",{className:"group rounded-lg border border-border bg-surface p-4 hover:border-border/80",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium ${Vh[Q.scope]??"bg-zinc-500/20 text-zinc-400"}`,children:[Kh[Q.scope]," ",Q.scope]}),t.jsx("span",{className:"font-mono text-sm font-medium text-indigo-400",children:Q.key}),t.jsxs("span",{className:"text-xs text-zinc-600",children:["importance: ",(Q.importance*100).toFixed(0),"%"]}),Q.accessCount>0&&t.jsxs("span",{className:"text-xs text-zinc-600",children:["accessed ",Q.accessCount,"x"]})]}),t.jsx("p",{className:"mt-2 text-sm text-zinc-200 leading-relaxed",children:Q.value}),t.jsxs("div",{className:"mt-1 flex items-center gap-3 text-xs text-zinc-500",children:[t.jsxs("span",{children:["Created: ",new Date(Q.createdAt).toLocaleString()]}),Q.expiresAt&&t.jsxs("span",{className:"text-yellow-500",children:["Expires: ",new Date(Q.expiresAt).toLocaleString()]})]})]}),t.jsx("button",{onClick:()=>W(Q.key),className:"rounded p-1.5 text-zinc-500 opacity-0 transition-all hover:bg-red-500/10 hover:text-red-400 group-hover:opacity-100",title:"Delete memory entry",children:t.jsx(Mt,{className:"h-4 w-4"})})]})},Q.id))})]})}function $1(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}function U0(n){const r=Math.floor(n/86400),d=Math.floor(n%86400/3600),o=Math.floor(n%3600/60);return r>0?`${r}d ${d}h ${o}m`:d>0?`${d}h ${o}m`:`${o}m`}function vs({label:n,value:r,icon:d,color:o="indigo"}){const m={indigo:"bg-indigo-500/10 text-indigo-400",green:"bg-green-500/10 text-green-400",amber:"bg-amber-500/10 text-amber-400",red:"bg-red-500/10 text-red-400",blue:"bg-blue-500/10 text-blue-400",zinc:"bg-zinc-500/10 text-zinc-400"};return t.jsxs("div",{className:"card flex items-center gap-4 p-4",children:[t.jsx("div",{className:`flex h-10 w-10 items-center justify-center rounded-lg ${m[o]??m.indigo}`,children:t.jsx(d,{className:"h-5 w-5"})}),t.jsxs("div",{children:[t.jsx("p",{className:"text-sm text-zinc-400",children:n}),t.jsx("p",{className:"text-xl font-semibold text-white",children:r})]})]})}function H1(){const[n,r]=u.useState(null),[d,o]=u.useState(null),[m,f]=u.useState(null),[h,b]=u.useState(!0),[g,p]=u.useState(""),j=u.useCallback(async()=>{b(!0),p("");try{const[y,w,C]=await Promise.allSettled([vt.overview(),pa.health(),pa.stats()]);y.status==="fulfilled"&&r(y.value.data),w.status==="fulfilled"&&o(w.value),C.status==="fulfilled"&&f(C.value.data)}catch(y){p(y.message||"Failed to load overview")}finally{b(!1)}},[]);return u.useEffect(()=>{j()},[j]),h?t.jsx(Fs,{}):g?t.jsx(Ya,{message:g,onRetry:j}):t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 lg:grid-cols-4",children:[t.jsx(vs,{label:"Tenants",value:(n==null?void 0:n.tenants)??0,icon:Xd,color:"indigo"}),t.jsx(vs,{label:"Users",value:(n==null?void 0:n.users)??0,icon:Xn,color:"blue"}),t.jsx(vs,{label:"Agents",value:(n==null?void 0:n.agents)??0,icon:Kt,color:"green"}),t.jsx(vs,{label:"Total Runs",value:(n==null?void 0:n.runs)??0,icon:Jd,color:"amber"})]}),t.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:[t.jsxs("div",{className:"card p-4 space-y-3",children:[t.jsx("h3",{className:"text-sm font-medium text-zinc-300",children:"System Health"}),t.jsxs("div",{className:"flex items-center gap-2",children:[(d==null?void 0:d.status)==="healthy"?t.jsx(Kr,{className:"h-5 w-5 text-green-400"}):t.jsx(lt,{className:"h-5 w-5 text-amber-400"}),t.jsx("span",{className:"text-sm text-zinc-200 capitalize",children:(d==null?void 0:d.status)??"Unknown"}),(d==null?void 0:d.uptime)!=null&&t.jsxs("span",{className:"ml-auto text-xs text-zinc-500",children:["Uptime: ",U0(d.uptime)]})]})]}),t.jsxs("div",{className:"card p-4 space-y-3",children:[t.jsx("h3",{className:"text-sm font-medium text-zinc-300",children:"Cost Summary"}),t.jsxs("p",{className:"text-2xl font-semibold text-white",children:["$",((n==null?void 0:n.totalCostUsd)??0).toFixed(4)]}),t.jsx("p",{className:"text-xs text-zinc-500",children:"Total cost across all tenants"})]})]}),m&&t.jsxs("div",{className:"card p-4 space-y-3",children:[t.jsx("h3",{className:"text-sm font-medium text-zinc-300",children:"Run Statistics"}),t.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-5",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-xs text-zinc-500",children:"Running"}),t.jsx("p",{className:"text-lg font-semibold text-indigo-400",children:m.runs.running})]}),t.jsxs("div",{children:[t.jsx("p",{className:"text-xs text-zinc-500",children:"Completed"}),t.jsx("p",{className:"text-lg font-semibold text-green-400",children:m.runs.completed})]}),t.jsxs("div",{children:[t.jsx("p",{className:"text-xs text-zinc-500",children:"Failed"}),t.jsx("p",{className:"text-lg font-semibold text-red-400",children:m.runs.failed})]}),t.jsxs("div",{children:[t.jsx("p",{className:"text-xs text-zinc-500",children:"Today"}),t.jsx("p",{className:"text-lg font-semibold text-amber-400",children:m.runs.today})]}),t.jsxs("div",{children:[t.jsx("p",{className:"text-xs text-zinc-500",children:"Pending Approvals"}),t.jsx("p",{className:"text-lg font-semibold text-zinc-300",children:m.approvals.pending})]})]})]})]})}function q1(){const[n,r]=u.useState([]),[d,o]=u.useState(!0),[m,f]=u.useState(""),[h,b]=u.useState(!1),[g,p]=u.useState({name:"",slug:"",description:""}),[j,y]=u.useState(!1),w=u.useCallback(async()=>{o(!0),f("");try{const k=await vt.tenants.list();r(k.data)}catch(k){f(k.message||"Failed to load tenants")}finally{o(!1)}},[]);u.useEffect(()=>{w()},[w]);const C=async()=>{if(!(!g.name||!g.slug)){y(!0);try{await vt.tenants.create(g),b(!1),p({name:"",slug:"",description:""}),await w()}catch(k){f(k.message||"Failed to create tenant")}finally{y(!1)}}};return d?t.jsx(Fs,{}):m&&n.length===0?t.jsx(Ya,{message:m,onRetry:w}):t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("p",{className:"text-sm text-zinc-400",children:[n.length," tenants"]}),t.jsxs("button",{onClick:()=>b(!0),className:"btn-primary btn-sm",children:[t.jsx(pt,{className:"h-4 w-4"})," Create Tenant"]})]}),m&&t.jsx(Ya,{message:m}),h&&t.jsxs("div",{className:"card p-4 space-y-3 border-indigo-500/30",children:[t.jsx("h3",{className:"text-sm font-medium text-zinc-200",children:"New Tenant"}),t.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[t.jsx("input",{className:"input",placeholder:"Tenant Name",value:g.name,onChange:k=>p({...g,name:k.target.value})}),t.jsx("input",{className:"input",placeholder:"slug (lowercase-with-dashes)",value:g.slug,onChange:k=>p({...g,slug:k.target.value})})]}),t.jsx("input",{className:"input",placeholder:"Description (optional)",value:g.description,onChange:k=>p({...g,description:k.target.value})}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("button",{onClick:C,disabled:j,className:"btn-primary btn-sm",children:j?"Creating...":"Create"}),t.jsx("button",{onClick:()=>b(!1),className:"btn-ghost btn-sm",children:"Cancel"})]})]}),t.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-border bg-surface",children:[t.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Name"}),t.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Slug"}),t.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Description"}),t.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Created"})]})}),t.jsxs("tbody",{children:[n.map(k=>t.jsxs("tr",{className:"border-b border-border/50 hover:bg-surface-hover",children:[t.jsx("td",{className:"px-4 py-3 font-medium text-white",children:k.name}),t.jsx("td",{className:"px-4 py-3 font-mono text-xs text-indigo-400",children:k.slug}),t.jsx("td",{className:"px-4 py-3 text-zinc-400 max-w-xs truncate",children:k.description||"-"}),t.jsx("td",{className:"px-4 py-3 text-zinc-500 text-xs",children:new Date(k.createdAt).toLocaleDateString()})]},k.id)),n.length===0&&t.jsx("tr",{children:t.jsx("td",{colSpan:4,className:"px-4 py-8 text-center text-zinc-500",children:"No tenants found."})})]})]})})]})}function G1(){const[n,r]=u.useState([]),[d,o]=u.useState(!0),[m,f]=u.useState(""),[h,b]=u.useState(""),[g,p]=u.useState(""),j=u.useCallback(async()=>{o(!0),f("");try{const k=await vt.users.list(h?{role:h}:void 0);r(k.data)}catch(k){f(k.message||"Failed to load users")}finally{o(!1)}},[h]);u.useEffect(()=>{j()},[j]);const y=async(k,N)=>{f("");try{await vt.users.updateRole(k,N),await j()}catch(S){f(S.message||"Failed to update role")}},w=async(k,N)=>{f("");try{N?await vt.users.lock(k):await vt.users.unlock(k),await j()}catch(S){f(S.message||"Failed to toggle lock status")}},C=n.filter(k=>{if(!g)return!0;const N=g.toLowerCase();return k.name.toLowerCase().includes(N)||k.email.toLowerCase().includes(N)});return d?t.jsx(Fs,{}):t.jsxs("div",{className:"space-y-4",children:[m&&t.jsx(Ya,{message:m}),t.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[t.jsxs("div",{className:"relative flex-1 min-w-[200px]",children:[t.jsx(Js,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-zinc-500"}),t.jsx("input",{className:"input pl-9",placeholder:"Search by name or email...",value:g,onChange:k=>p(k.target.value)})]}),t.jsxs("select",{className:"input w-auto",value:h,onChange:k=>b(k.target.value),children:[t.jsx("option",{value:"",children:"All Roles"}),t.jsx("option",{value:"admin",children:"Admin"}),t.jsx("option",{value:"manager",children:"Manager"}),t.jsx("option",{value:"member",children:"Member"}),t.jsx("option",{value:"viewer",children:"Viewer"})]}),t.jsx("button",{onClick:j,className:"btn-ghost btn-sm",children:t.jsx(Yt,{className:"h-4 w-4"})})]}),t.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-border bg-surface",children:[t.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Name"}),t.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Email"}),t.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Role"}),t.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Status"}),t.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Last Login"}),t.jsx("th",{className:"px-4 py-3 text-right text-xs font-medium uppercase text-zinc-400",children:"Actions"})]})}),t.jsxs("tbody",{children:[C.map(k=>t.jsxs("tr",{className:"border-b border-border/50 hover:bg-surface-hover",children:[t.jsx("td",{className:"px-4 py-3 font-medium text-white",children:k.name}),t.jsx("td",{className:"px-4 py-3 text-zinc-300",children:k.email}),t.jsx("td",{className:"px-4 py-3",children:t.jsxs("select",{value:k.role,onChange:N=>y(k.id,N.target.value),className:"rounded border border-border bg-background px-2 py-1 text-xs text-white focus:outline-none",children:[t.jsx("option",{value:"admin",children:"Admin"}),t.jsx("option",{value:"manager",children:"Manager"}),t.jsx("option",{value:"member",children:"Member"}),t.jsx("option",{value:"viewer",children:"Viewer"})]})}),t.jsx("td",{className:"px-4 py-3",children:t.jsx("span",{className:`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium ${k.isActive?"bg-green-500/10 text-green-400":"bg-red-500/10 text-red-400"}`,children:k.isActive?"Active":"Locked"})}),t.jsx("td",{className:"px-4 py-3 text-zinc-400 text-xs",children:k.lastLoginAt?new Date(k.lastLoginAt*1e3).toLocaleString():"Never"}),t.jsx("td",{className:"px-4 py-3 text-right",children:t.jsx("div",{className:"flex items-center justify-end gap-1",children:t.jsx("button",{onClick:()=>w(k.id,k.isActive),className:"rounded p-1.5 text-zinc-400 transition-colors hover:bg-zinc-700",title:k.isActive?"Lock account":"Unlock account",children:k.isActive?t.jsx(Dd,{className:"h-3.5 w-3.5"}):t.jsx(uv,{className:"h-3.5 w-3.5"})})})})]},k.id)),C.length===0&&t.jsx("tr",{children:t.jsx("td",{colSpan:6,className:"px-4 py-8 text-center text-zinc-500",children:"No users found."})})]})]})})]})}function K1(){const[n,r]=u.useState(null),[d,o]=u.useState(null),[m,f]=u.useState(null),[h,b]=u.useState(!0),[g,p]=u.useState(""),j=u.useCallback(async()=>{b(!0),p("");try{const[y,w,C]=await Promise.allSettled([vt.system.info(),vt.system.dbStats(),vt.system.rateLimitStats()]);y.status==="fulfilled"&&r(y.value.data),w.status==="fulfilled"&&o(w.value.data),C.status==="fulfilled"&&f(C.value.data)}catch(y){p(y.message||"Failed to load system info")}finally{b(!1)}},[]);return u.useEffect(()=>{j()},[j]),h?t.jsx(Fs,{}):g?t.jsx(Ya,{message:g,onRetry:j}):t.jsxs("div",{className:"space-y-6",children:[n&&t.jsxs("div",{className:"card p-4 space-y-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Id,{className:"h-4 w-4 text-indigo-400"}),t.jsx("h3",{className:"text-sm font-medium text-zinc-200",children:"Server Information"}),t.jsx("button",{onClick:j,className:"ml-auto btn-ghost btn-sm",children:t.jsx(Yt,{className:"h-3.5 w-3.5"})})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-xs text-zinc-500",children:"Version"}),t.jsx("p",{className:"text-sm font-medium text-zinc-200",children:n.version})]}),t.jsxs("div",{children:[t.jsx("p",{className:"text-xs text-zinc-500",children:"Node.js"}),t.jsx("p",{className:"text-sm font-medium text-zinc-200",children:n.nodeVersion})]}),t.jsxs("div",{children:[t.jsx("p",{className:"text-xs text-zinc-500",children:"Platform"}),t.jsxs("p",{className:"text-sm font-medium text-zinc-200",children:[n.platform," / ",n.arch]})]}),t.jsxs("div",{children:[t.jsx("p",{className:"text-xs text-zinc-500",children:"Uptime"}),t.jsx("p",{className:"text-sm font-medium text-zinc-200",children:U0(n.uptime)})]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4 pt-2",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-xs text-zinc-500",children:"RSS Memory"}),t.jsxs("p",{className:"text-sm font-medium text-zinc-200",children:[n.memory.rss," MB"]})]}),t.jsxs("div",{children:[t.jsx("p",{className:"text-xs text-zinc-500",children:"Heap Used"}),t.jsxs("p",{className:"text-sm font-medium text-zinc-200",children:[n.memory.heapUsed," MB"]})]}),t.jsxs("div",{children:[t.jsx("p",{className:"text-xs text-zinc-500",children:"Heap Total"}),t.jsxs("p",{className:"text-sm font-medium text-zinc-200",children:[n.memory.heapTotal," MB"]})]}),t.jsxs("div",{children:[t.jsx("p",{className:"text-xs text-zinc-500",children:"PID"}),t.jsx("p",{className:"text-sm font-medium text-zinc-200",children:n.pid})]})]})]}),d&&t.jsxs("div",{className:"card p-4 space-y-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(f0,{className:"h-4 w-4 text-green-400"}),t.jsx("h3",{className:"text-sm font-medium text-zinc-200",children:"Database Statistics"}),t.jsx("span",{className:"ml-auto text-xs text-zinc-500",children:$1(d.totalSize)})]}),t.jsx("div",{className:"overflow-x-auto rounded border border-border/50",children:t.jsxs("table",{className:"w-full text-xs",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-border/50 bg-background",children:[t.jsx("th",{className:"px-3 py-2 text-left font-medium text-zinc-400",children:"Table"}),t.jsx("th",{className:"px-3 py-2 text-right font-medium text-zinc-400",children:"Rows"})]})}),t.jsx("tbody",{children:d.tables.map(y=>t.jsxs("tr",{className:"border-b border-border/30",children:[t.jsx("td",{className:"px-3 py-1.5 font-mono text-zinc-300",children:y.name}),t.jsx("td",{className:"px-3 py-1.5 text-right text-zinc-400",children:y.rowCount.toLocaleString()})]},y.name))})]})})]}),m&&t.jsxs("div",{className:"card p-4 space-y-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Kt,{className:"h-4 w-4 text-amber-400"}),t.jsx("h3",{className:"text-sm font-medium text-zinc-200",children:"Rate Limit Counters"}),t.jsxs("span",{className:"ml-auto text-xs text-zinc-500",children:[m.totalKeys," active keys"]})]}),m.entries.length>0?t.jsx("div",{className:"overflow-x-auto rounded border border-border/50 max-h-60 overflow-y-auto",children:t.jsxs("table",{className:"w-full text-xs",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-border/50 bg-background sticky top-0",children:[t.jsx("th",{className:"px-3 py-2 text-left font-medium text-zinc-400",children:"Key"}),t.jsx("th",{className:"px-3 py-2 text-right font-medium text-zinc-400",children:"Count"}),t.jsx("th",{className:"px-3 py-2 text-right font-medium text-zinc-400",children:"Reset"})]})}),t.jsx("tbody",{children:m.entries.slice(0,50).map((y,w)=>t.jsxs("tr",{className:"border-b border-border/30",children:[t.jsx("td",{className:"px-3 py-1.5 font-mono text-zinc-300 max-w-xs truncate",children:y.key}),t.jsx("td",{className:"px-3 py-1.5 text-right text-zinc-400",children:y.count}),t.jsx("td",{className:"px-3 py-1.5 text-right text-zinc-500",children:new Date(y.resetAt).toLocaleTimeString()})]},w))})]})}):t.jsx("p",{className:"text-xs text-zinc-500",children:"No active rate limit counters."})]})]})}function V1(){const[n,r]=u.useState([]),[d,o]=u.useState(!0),[m,f]=u.useState(""),[h,b]=u.useState(""),[g,p]=u.useState(""),j=u.useCallback(async()=>{o(!0),f("");try{const w=await vt.audit.query({action:h||void 0,userId:g||void 0,limit:200});r(w.data)}catch(w){f(w.message||"Failed to load audit log")}finally{o(!1)}},[h,g]);u.useEffect(()=>{j()},[j]);const y=async w=>{try{const C=await vt.audit.export(w),k=w==="json"?JSON.stringify(C.data,null,2):Y1(C.data),N=new Blob([k],{type:w==="json"?"application/json":"text/csv"}),S=URL.createObjectURL(N),z=document.createElement("a");z.href=S,z.download=`audit-log.${w}`,z.click(),URL.revokeObjectURL(S)}catch(C){f(C.message||"Export failed")}};return d?t.jsx(Fs,{}):t.jsxs("div",{className:"space-y-4",children:[m&&t.jsx(Ya,{message:m}),t.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[t.jsx("input",{className:"input flex-1 min-w-[150px]",placeholder:"Filter by action...",value:h,onChange:w=>b(w.target.value)}),t.jsx("input",{className:"input flex-1 min-w-[150px]",placeholder:"Filter by actor ID...",value:g,onChange:w=>p(w.target.value)}),t.jsx("button",{onClick:j,className:"btn-ghost btn-sm",children:t.jsx(Yt,{className:"h-4 w-4"})}),t.jsxs("button",{onClick:()=>y("json"),className:"btn-ghost btn-sm",children:[t.jsx(Ur,{className:"h-4 w-4"})," JSON"]}),t.jsxs("button",{onClick:()=>y("csv"),className:"btn-ghost btn-sm",children:[t.jsx(Ur,{className:"h-4 w-4"})," CSV"]})]}),t.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-border bg-surface",children:[t.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Time"}),t.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Actor"}),t.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Action"}),t.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Resource"}),t.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"IP"}),t.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Details"})]})}),t.jsxs("tbody",{children:[n.map(w=>{var C;return t.jsxs("tr",{className:"border-b border-border/50 hover:bg-surface-hover",children:[t.jsx("td",{className:"px-4 py-2.5 text-zinc-400 text-xs whitespace-nowrap",children:new Date(w.createdAt*1e3).toLocaleString()}),t.jsx("td",{className:"px-4 py-2.5 text-zinc-300 text-xs font-mono",children:((C=w.userId)==null?void 0:C.slice(0,8))||"-"}),t.jsx("td",{className:"px-4 py-2.5 font-mono text-xs text-indigo-400",children:w.action}),t.jsx("td",{className:"px-4 py-2.5 text-zinc-300 text-xs",children:w.resourceType?`${w.resourceType}${w.resourceId?`/${w.resourceId.slice(0,8)}`:""}`:"-"}),t.jsx("td",{className:"px-4 py-2.5 text-zinc-500 text-xs",children:w.ipAddress||"-"}),t.jsx("td",{className:"px-4 py-2.5 text-xs text-zinc-500 max-w-[200px] truncate",children:w.details?JSON.stringify(w.details):"-"})]},w.id)}),n.length===0&&t.jsx("tr",{children:t.jsx("td",{colSpan:6,className:"px-4 py-8 text-center text-zinc-500",children:"No audit entries found."})})]})]})})]})}function Y1(n){const r="id,userId,action,resourceType,resourceId,ipAddress,createdAt,details",d=n.map(o=>[o.id,o.userId??"",o.action,o.resourceType??"",o.resourceId??"",o.ipAddress??"",new Date(o.createdAt*1e3).toISOString(),o.details?JSON.stringify(o.details).replace(/"/g,'""'):""].map(m=>`"${m}"`).join(","));return[r,...d].join(`
|
|
587
|
-
`)}function X1(){const[n,r]=u.useState([]),[d,o]=u.useState([]),[m,f]=u.useState([]),[h,b]=u.useState([]),[g,p]=u.useState(!0),[j,y]=u.useState(""),w=u.useCallback(async()=>{p(!0),y("");try{const[C,k,N,S]=await Promise.allSettled([vt.security.failedLogins(24),vt.security.lockedAccounts(),vt.security.activeSessions(),vt.security.rateLimitViolations(50)]);C.status==="fulfilled"&&r(C.value.data),k.status==="fulfilled"&&o(k.value.data),N.status==="fulfilled"&&f(N.value.data),S.status==="fulfilled"&&b(S.value.data)}catch(C){y(C.message||"Failed to load security data")}finally{p(!1)}},[]);return u.useEffect(()=>{w()},[w]),g?t.jsx(Fs,{}):j?t.jsx(Ya,{message:j,onRetry:w}):t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 lg:grid-cols-4",children:[t.jsx(vs,{label:"Failed Logins (24h)",value:n.reduce((C,k)=>C+k.count,0),icon:wt,color:"red"}),t.jsx(vs,{label:"Locked Accounts",value:d.length,icon:Dd,color:"amber"}),t.jsx(vs,{label:"Active Sessions",value:m.length,icon:Xn,color:"green"}),t.jsx(vs,{label:"Rate Violations",value:h.length,icon:ba,color:"red"})]}),t.jsxs("div",{className:"card p-4 space-y-3",children:[t.jsxs("h3",{className:"text-sm font-medium text-zinc-200 flex items-center gap-2",children:[t.jsx(wt,{className:"h-4 w-4 text-red-400"})," Failed Login Attempts (Last 24h)"]}),n.length>0?t.jsx("div",{className:"overflow-x-auto rounded border border-border/50",children:t.jsxs("table",{className:"w-full text-xs",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-border/50 bg-background",children:[t.jsx("th",{className:"px-3 py-2 text-left font-medium text-zinc-400",children:"Email"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium text-zinc-400",children:"IP"}),t.jsx("th",{className:"px-3 py-2 text-right font-medium text-zinc-400",children:"Attempts"}),t.jsx("th",{className:"px-3 py-2 text-right font-medium text-zinc-400",children:"First Seen"})]})}),t.jsx("tbody",{children:n.map((C,k)=>t.jsxs("tr",{className:"border-b border-border/30",children:[t.jsx("td",{className:"px-3 py-1.5 text-zinc-300",children:C.email}),t.jsx("td",{className:"px-3 py-1.5 font-mono text-zinc-400",children:C.ip}),t.jsx("td",{className:"px-3 py-1.5 text-right font-semibold text-red-400",children:C.count}),t.jsx("td",{className:"px-3 py-1.5 text-right text-zinc-500",children:new Date(C.timestamp).toLocaleString()})]},k))})]})}):t.jsx("p",{className:"text-xs text-zinc-500",children:"No failed login attempts in the last 24 hours."})]}),t.jsxs("div",{className:"card p-4 space-y-3",children:[t.jsxs("h3",{className:"text-sm font-medium text-zinc-200 flex items-center gap-2",children:[t.jsx(Dd,{className:"h-4 w-4 text-amber-400"})," Locked Accounts"]}),d.length>0?t.jsx("div",{className:"overflow-x-auto rounded border border-border/50",children:t.jsxs("table",{className:"w-full text-xs",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-border/50 bg-background",children:[t.jsx("th",{className:"px-3 py-2 text-left font-medium text-zinc-400",children:"Email"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium text-zinc-400",children:"Reason"}),t.jsx("th",{className:"px-3 py-2 text-right font-medium text-zinc-400",children:"Locked At"})]})}),t.jsx("tbody",{children:d.map((C,k)=>t.jsxs("tr",{className:"border-b border-border/30",children:[t.jsx("td",{className:"px-3 py-1.5 text-zinc-300",children:C.email}),t.jsx("td",{className:"px-3 py-1.5 text-zinc-400",children:C.reason}),t.jsx("td",{className:"px-3 py-1.5 text-right text-zinc-500",children:new Date(C.lockedAt).toLocaleString()})]},k))})]})}):t.jsx("p",{className:"text-xs text-zinc-500",children:"No locked accounts."})]}),t.jsxs("div",{className:"card p-4 space-y-3",children:[t.jsxs("h3",{className:"text-sm font-medium text-zinc-200 flex items-center gap-2",children:[t.jsx(Ys,{className:"h-4 w-4 text-green-400"})," Active Sessions (",m.length,")"]}),m.length>0?t.jsx("div",{className:"overflow-x-auto rounded border border-border/50 max-h-60 overflow-y-auto",children:t.jsxs("table",{className:"w-full text-xs",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-border/50 bg-background sticky top-0",children:[t.jsx("th",{className:"px-3 py-2 text-left font-medium text-zinc-400",children:"Email"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium text-zinc-400",children:"IP"}),t.jsx("th",{className:"px-3 py-2 text-right font-medium text-zinc-400",children:"Created"}),t.jsx("th",{className:"px-3 py-2 text-right font-medium text-zinc-400",children:"Expires"})]})}),t.jsx("tbody",{children:m.map((C,k)=>t.jsxs("tr",{className:"border-b border-border/30",children:[t.jsx("td",{className:"px-3 py-1.5 text-zinc-300",children:C.email}),t.jsx("td",{className:"px-3 py-1.5 font-mono text-zinc-400",children:C.ip}),t.jsx("td",{className:"px-3 py-1.5 text-right text-zinc-500",children:new Date(C.createdAt).toLocaleString()}),t.jsx("td",{className:"px-3 py-1.5 text-right text-zinc-500",children:new Date(C.expiresAt).toLocaleString()})]},k))})]})}):t.jsx("p",{className:"text-xs text-zinc-500",children:"No active sessions."})]}),t.jsxs("div",{className:"card p-4 space-y-3",children:[t.jsxs("h3",{className:"text-sm font-medium text-zinc-200 flex items-center gap-2",children:[t.jsx(ba,{className:"h-4 w-4 text-red-400"})," Recent Rate Limit Violations"]}),h.length>0?t.jsx("div",{className:"overflow-x-auto rounded border border-border/50 max-h-60 overflow-y-auto",children:t.jsxs("table",{className:"w-full text-xs",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-border/50 bg-background sticky top-0",children:[t.jsx("th",{className:"px-3 py-2 text-left font-medium text-zinc-400",children:"Time"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium text-zinc-400",children:"Tier"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium text-zinc-400",children:"IP"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium text-zinc-400",children:"User"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium text-zinc-400",children:"Endpoint"})]})}),t.jsx("tbody",{children:h.map((C,k)=>{var N;return t.jsxs("tr",{className:"border-b border-border/30",children:[t.jsx("td",{className:"px-3 py-1.5 text-zinc-400 whitespace-nowrap",children:new Date(C.timestamp).toLocaleString()}),t.jsx("td",{className:"px-3 py-1.5",children:t.jsx("span",{className:"rounded-full bg-red-500/10 px-1.5 py-0.5 text-red-400",children:C.tier})}),t.jsx("td",{className:"px-3 py-1.5 font-mono text-zinc-400",children:C.ip}),t.jsx("td",{className:"px-3 py-1.5 text-zinc-400",children:((N=C.userId)==null?void 0:N.slice(0,8))||"-"}),t.jsx("td",{className:"px-3 py-1.5 font-mono text-zinc-300 max-w-[200px] truncate",children:C.endpoint})]},k)})})]})}):t.jsx("p",{className:"text-xs text-zinc-500",children:"No rate limit violations recorded."})]})]})}function Q1(){const[n,r]=u.useState(null),[d,o]=u.useState(null),[m,f]=u.useState(!0),[h,b]=u.useState(!1),[g,p]=u.useState(""),[j,y]=u.useState(""),[w,C]=u.useState(!1),k=u.useCallback(async()=>{f(!0),p(""),y("");try{const M=await pa.getConfig();r(M.data),o(M.data),C(!1)}catch(M){p(M.message||"Failed to load configuration")}finally{f(!1)}},[]);u.useEffect(()=>{k()},[k]);const N=(M,O,E)=>{d&&(o({...d,[M]:{...d[M],[O]:E}}),C(!0),y(""))},S=async()=>{if(d){b(!0),p(""),y("");try{const M=await pa.updateConfig(d);r(M.data),o(M.data),C(!1),y("Configuration saved successfully.")}catch(M){p(M.message||"Failed to save configuration")}finally{b(!1)}}},z=()=>{n&&(o({...n}),C(!1),y(""))};return m?t.jsx(Fs,{}):g&&!d?t.jsx(Ya,{message:g,onRetry:k}):t.jsxs("div",{className:"space-y-6",children:[g&&t.jsx(Ya,{message:g}),j&&t.jsxs("div",{className:"rounded-lg border border-green-500/30 bg-green-500/10 px-4 py-3 text-sm text-green-400 flex items-center gap-2",children:[t.jsx(Kr,{className:"h-4 w-4 flex-shrink-0"}),j]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("p",{className:"text-sm text-zinc-400",children:"Runtime configuration (changes apply immediately)"}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("button",{onClick:k,className:"btn-ghost btn-sm",children:t.jsx(Yt,{className:"h-4 w-4"})}),t.jsx("button",{onClick:z,disabled:!w,className:"btn-secondary btn-sm",children:"Reset"}),t.jsxs("button",{onClick:S,disabled:!w||h,className:"btn-primary btn-sm",children:[t.jsx(Qr,{className:"h-4 w-4"})," ",h?"Saving...":"Save"]})]})]}),d&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"card p-4 space-y-3",children:[t.jsxs("h3",{className:"text-sm font-medium text-zinc-200 flex items-center gap-2",children:[t.jsx(Id,{className:"h-4 w-4 text-indigo-400"})," Server"]}),t.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[t.jsxs("div",{children:[t.jsx("label",{className:"label",children:"Host"}),t.jsx("input",{className:"input",value:d.server.host,onChange:M=>N("server","host",M.target.value)})]}),t.jsxs("div",{children:[t.jsx("label",{className:"label",children:"Port"}),t.jsx("input",{className:"input",type:"number",value:d.server.port,onChange:M=>N("server","port",parseInt(M.target.value)||0)})]})]})]}),t.jsxs("div",{className:"card p-4 space-y-3",children:[t.jsxs("h3",{className:"text-sm font-medium text-zinc-200 flex items-center gap-2",children:[t.jsx(ba,{className:"h-4 w-4 text-amber-400"})," Security"]}),t.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[t.jsxs("div",{children:[t.jsx("label",{className:"label",children:"Default Trust Level"}),t.jsxs("select",{className:"input",value:d.security.defaultTrustLevel,onChange:M=>N("security","defaultTrustLevel",M.target.value),children:[t.jsx("option",{value:"builtin",children:"Builtin"}),t.jsx("option",{value:"official",children:"Official"}),t.jsx("option",{value:"trusted",children:"Trusted"}),t.jsx("option",{value:"community",children:"Community"}),t.jsx("option",{value:"local",children:"Local"})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"label",children:"Approval Mode"}),t.jsxs("select",{className:"input",value:d.security.approvalMode,onChange:M=>N("security","approvalMode",M.target.value),children:[t.jsx("option",{value:"manual",children:"Manual"}),t.jsx("option",{value:"smart",children:"Smart"}),t.jsx("option",{value:"off",children:"Off"})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"label",children:"Max Concurrent Runs"}),t.jsx("input",{className:"input",type:"number",min:1,max:100,value:d.security.maxConcurrentRuns,onChange:M=>N("security","maxConcurrentRuns",parseInt(M.target.value)||1)})]})]})]}),t.jsxs("div",{className:"card p-4 space-y-3",children:[t.jsxs("h3",{className:"text-sm font-medium text-zinc-200 flex items-center gap-2",children:[t.jsx(Kt,{className:"h-4 w-4 text-green-400"})," Budget"]}),t.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"label",children:"Enabled"}),t.jsxs("select",{className:"input",value:d.budget.enabled?"true":"false",onChange:M=>N("budget","enabled",M.target.value==="true"),children:[t.jsx("option",{value:"true",children:"Yes"}),t.jsx("option",{value:"false",children:"No"})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"label",children:"Max Cost/Run (USD)"}),t.jsx("input",{className:"input",type:"number",step:"0.01",min:0,value:d.budget.defaultMaxCostPerRunUsd,onChange:M=>N("budget","defaultMaxCostPerRunUsd",parseFloat(M.target.value)||0)})]}),t.jsxs("div",{children:[t.jsx("label",{className:"label",children:"Max Tokens/Run"}),t.jsx("input",{className:"input",type:"number",min:0,value:d.budget.defaultMaxTokensPerRun,onChange:M=>N("budget","defaultMaxTokensPerRun",parseInt(M.target.value)||0)})]}),t.jsxs("div",{children:[t.jsx("label",{className:"label",children:"Warning Threshold %"}),t.jsx("input",{className:"input",type:"number",min:0,max:100,value:d.budget.warningThresholdPercent,onChange:M=>N("budget","warningThresholdPercent",parseInt(M.target.value)||0)})]})]})]}),t.jsxs("div",{className:"card p-4 space-y-3",children:[t.jsxs("h3",{className:"text-sm font-medium text-zinc-200 flex items-center gap-2",children:[t.jsx(Zs,{className:"h-4 w-4 text-blue-400"})," Logging"]}),t.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[t.jsxs("div",{children:[t.jsx("label",{className:"label",children:"Level"}),t.jsxs("select",{className:"input",value:d.logging.level,onChange:M=>N("logging","level",M.target.value),children:[t.jsx("option",{value:"debug",children:"Debug"}),t.jsx("option",{value:"info",children:"Info"}),t.jsx("option",{value:"warn",children:"Warn"}),t.jsx("option",{value:"error",children:"Error"})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"label",children:"Format"}),t.jsxs("select",{className:"input",value:d.logging.format,onChange:M=>N("logging","format",M.target.value),children:[t.jsx("option",{value:"json",children:"JSON"}),t.jsx("option",{value:"pretty",children:"Pretty"})]})]})]})]}),t.jsxs("div",{className:"card p-4 space-y-3",children:[t.jsx("h3",{className:"text-sm font-medium text-zinc-200",children:"Current Configuration (JSON)"}),t.jsx("pre",{className:"overflow-x-auto rounded border border-border/50 bg-background p-3 text-xs text-zinc-400 max-h-60 overflow-y-auto",children:JSON.stringify(d,null,2)})]})]})]})}function Fs(){return t.jsx("div",{className:"flex items-center justify-center py-16",children:t.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-500 border-t-transparent"})})}function Ya({message:n,onRetry:r}){return t.jsx("div",{className:"rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-3 text-sm text-red-400",children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(lt,{className:"h-4 w-4 flex-shrink-0"}),t.jsx("span",{children:n}),r&&t.jsx("button",{onClick:r,className:"ml-auto text-xs underline hover:text-red-300",children:"Retry"})]})})}const Z1=[{key:"overview",label:"Overview",icon:Jd},{key:"tenants",label:"Tenants",icon:Xd},{key:"users",label:"Users",icon:Xn},{key:"system",label:"System",icon:Id},{key:"audit",label:"Audit Log",icon:Zs},{key:"security",label:"Security",icon:ba},{key:"config",label:"Config",icon:Yn}];function J1(){const{isAdmin:n}=ai(),[r,d]=u.useState("overview");return n?t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Admin Dashboard"}),t.jsx("p",{className:"mt-1 text-sm text-zinc-400",children:"Multi-tenant administration and system monitoring."})]}),t.jsx("div",{className:"flex gap-1 border-b border-border overflow-x-auto",children:Z1.map(({key:o,label:m,icon:f})=>t.jsxs("button",{onClick:()=>d(o),className:`flex items-center gap-2 whitespace-nowrap px-4 py-2.5 text-sm font-medium transition-colors border-b-2 ${r===o?"border-indigo-500 text-indigo-400":"border-transparent text-zinc-400 hover:text-zinc-200"}`,children:[t.jsx(f,{className:"h-4 w-4"}),m]},o))}),r==="overview"&&t.jsx(H1,{}),r==="tenants"&&t.jsx(q1,{}),r==="users"&&t.jsx(G1,{}),r==="system"&&t.jsx(K1,{}),r==="audit"&&t.jsx(V1,{}),r==="security"&&t.jsx(X1,{}),r==="config"&&t.jsx(Q1,{})]}):t.jsxs("div",{className:"flex h-64 items-center justify-center text-zinc-400",children:[t.jsx(ba,{className:"mr-2 h-5 w-5"})," Admin access required."]})}function F1(n){switch(n){case"claude":return"claude-sonnet-4-20250514";case"openai":return"gpt-4o";case"gemini":return"gemini-2.5-flash";case"grok":return"grok-3";case"mistral":return"mistral-large-latest";case"ollama":return"llama3.1";default:return"claude-sonnet-4-20250514"}}function I1(n){return n.startsWith("file_")?t.jsx(Zs,{className:"h-3 w-3"}):n==="shell_exec"?t.jsx(y0,{className:"h-3 w-3"}):n==="web_fetch"?t.jsx(Zd,{className:"h-3 w-3"}):t.jsx(Qn,{className:"h-3 w-3"})}function B0(n,r){return n==="file_read"&&r.path?`Reading: ${r.path}`:n==="file_write"&&r.path?`Writing: ${r.path}`:n==="file_list"&&r.path?`Listing: ${r.path||"."}`:n==="shell_exec"&&r.command?`Running: ${String(r.command).substring(0,80)}`:n==="web_fetch"&&r.url?`Fetching: ${String(r.url).substring(0,80)}`:Object.entries(r).map(([o,m])=>`${o}=${JSON.stringify(m)}`).join(", ").substring(0,100)||"No arguments"}function P1(n,r=500){return n.length<=r?n:n.substring(0,r)+`
|
|
588
|
-
... (${n.length} chars total)`}function W1({tc:n}){const[r,d]=u.useState(!1),o=n.pending&&!n.output;return t.jsxs("div",{className:"mb-2 rounded-lg text-xs border border-border/50 overflow-hidden",children:[t.jsxs("button",{onClick:()=>d(!r),className:"w-full flex items-center gap-2 px-3 py-2 bg-zinc-800/50 hover:bg-zinc-800/80 transition-colors text-left",children:[r?t.jsx(Va,{className:"h-3 w-3 text-zinc-500 flex-shrink-0"}):t.jsx(aa,{className:"h-3 w-3 text-zinc-500 flex-shrink-0"}),t.jsx("span",{className:"text-amber-400 flex-shrink-0",children:I1(n.name)}),t.jsx("span",{className:"text-amber-300 font-mono font-medium",children:n.name}),t.jsx("span",{className:"text-zinc-500 truncate flex-1 ml-1",children:B0(n.name,n.args)}),o?t.jsx(ot,{className:"h-3 w-3 animate-spin text-blue-400 flex-shrink-0"}):n.success?t.jsx("span",{className:"text-green-400 flex-shrink-0 text-[10px] font-medium",children:"OK"}):t.jsx("span",{className:"text-red-400 flex-shrink-0 text-[10px] font-medium",children:"FAIL"})]}),r&&t.jsxs("div",{className:"px-3 py-2 bg-zinc-900/50 border-t border-border/30",children:[t.jsxs("div",{className:"mb-1.5",children:[t.jsx("span",{className:"text-zinc-500 text-[10px] uppercase tracking-wider",children:"Arguments"}),t.jsx("pre",{className:"mt-0.5 text-zinc-400 overflow-x-auto whitespace-pre-wrap text-[11px] font-mono",children:JSON.stringify(n.args,null,2)})]}),n.output&&t.jsxs("div",{children:[t.jsx("span",{className:"text-zinc-500 text-[10px] uppercase tracking-wider",children:"Output"}),t.jsx("pre",{className:`mt-0.5 overflow-x-auto whitespace-pre-wrap text-[11px] font-mono ${n.success?"text-zinc-400":"text-red-400"}`,children:P1(n.output)})]}),o&&t.jsxs("div",{className:"flex items-center gap-1.5 text-blue-400 mt-1",children:[t.jsx(ot,{className:"h-3 w-3 animate-spin"}),t.jsx("span",{className:"text-[11px]",children:"Executing..."})]})]})]})}function eN(n){return n==="critical"?"text-red-500 bg-red-500/10":n==="high"?"text-orange-400 bg-orange-400/10":n==="medium"?"text-yellow-400 bg-yellow-400/10":"text-green-400 bg-green-400/10"}function tN({steps:n}){const[r,d]=u.useState(!0);return t.jsxs("div",{className:"mb-3 rounded-lg border border-indigo-500/30 overflow-hidden",children:[t.jsxs("button",{onClick:()=>d(!r),className:"w-full flex items-center gap-2 px-3 py-2 bg-indigo-500/10 hover:bg-indigo-500/15 transition-colors text-left text-sm",children:[r?t.jsx(Va,{className:"h-3 w-3 text-indigo-400"}):t.jsx(aa,{className:"h-3 w-3 text-indigo-400"}),t.jsx("span",{className:"text-indigo-300 font-medium",children:"Dry-Run Plan"}),t.jsxs("span",{className:"text-zinc-500 text-xs",children:[n.length," step",n.length!==1?"s":""]})]}),r&&t.jsx("div",{className:"px-3 py-2 space-y-1.5 bg-zinc-900/30",children:n.map(o=>t.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[t.jsxs("span",{className:"text-zinc-500 font-mono w-4 text-right flex-shrink-0",children:[o.index+1,"."]}),t.jsx("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-medium flex-shrink-0 ${eN(o.riskLevel)}`,children:o.riskLevel.toUpperCase()}),t.jsx("span",{className:"text-amber-300 font-mono",children:o.toolName}),t.jsx("span",{className:"text-zinc-500 truncate",children:B0(o.toolName,o.args)})]},o.index))})]})}function aN({agent:n,onClose:r,onSave:d}){const[o,m]=u.useState(n.description||""),[f,h]=u.useState(!1),[b,g]=u.useState(""),p=u.useRef(null);u.useEffect(()=>{var y;(y=p.current)==null||y.focus()},[]);const j=async()=>{h(!0),g("");try{const y=await fetch(`/api/agents/${n.id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:o})});if(!y.ok){const C=await y.json().catch(()=>({error:"Failed to save"}));throw new Error(C.error||`HTTP ${y.status}`)}const w=await y.json();d(w.data)}catch(y){g(y instanceof Error?y.message:"Failed to save")}h(!1)};return u.useEffect(()=>{const y=w=>{w.key==="Escape"&&r()};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[r]),t.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:r,children:t.jsxs("div",{className:"bg-surface border border-border rounded-xl shadow-2xl w-full max-w-2xl max-h-[80vh] flex flex-col",onClick:y=>y.stopPropagation(),children:[t.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-sm font-semibold text-zinc-200",children:"System Prompt"}),t.jsxs("p",{className:"text-xs text-zinc-500 mt-0.5",children:[n.name," (",n.adapterType,")"]})]}),t.jsx("button",{onClick:r,className:"p-1.5 hover:bg-surface-hover rounded-lg transition-colors text-zinc-400 hover:text-zinc-200",children:t.jsx(Je,{className:"h-4 w-4"})})]}),t.jsx("div",{className:"flex-1 p-5 overflow-hidden",children:t.jsx("textarea",{ref:p,value:o,onChange:y=>m(y.target.value),className:"w-full h-full min-h-[300px] bg-background border border-border rounded-lg px-4 py-3 resize-none focus:outline-none focus:border-indigo-500 text-zinc-200 text-sm font-mono placeholder-zinc-600",placeholder:"You are a helpful AI assistant...",spellCheck:!1})}),t.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-t border-border",children:[t.jsxs("div",{className:"text-xs text-zinc-500",children:[o.length.toLocaleString()," chars",b&&t.jsx("span",{className:"text-red-400 ml-3",children:b})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("button",{onClick:r,className:"px-3 py-1.5 text-sm text-zinc-400 hover:text-zinc-200 transition-colors",children:"Cancel"}),t.jsxs("button",{onClick:j,disabled:f,className:"flex items-center gap-1.5 px-4 py-1.5 bg-indigo-600 hover:bg-indigo-700 disabled:opacity-50 rounded-lg text-sm font-medium transition-colors text-white",children:[f?t.jsx(ot,{className:"h-3 w-3 animate-spin"}):t.jsx(Qr,{className:"h-3 w-3"}),"Save"]})]})]})]})})}function sN(){var ie;const n=Rt(),[r,d]=u.useState([]),[o,m]=u.useState(null),[f,h]=u.useState([]),[b,g]=u.useState(null),[p,j]=u.useState([]),[y,w]=u.useState(""),[C,k]=u.useState(!1),[N,S]=u.useState(!0),[z,M]=u.useState(!1),[O,E]=u.useState([]),[ae,ce]=u.useState(!1),[H,G]=u.useState(null),[P,W]=u.useState(null),[Q,le]=u.useState(""),F=u.useRef(null),re=u.useRef(null),he=u.useRef(null);u.useEffect(()=>{var $;($=F.current)==null||$.scrollIntoView({behavior:"smooth"})},[p]),u.useEffect(()=>{const $=re.current;$&&($.style.height="48px",$.style.height=Math.min($.scrollHeight,200)+"px")},[y]);const K=u.useCallback($=>{const oe=$?`/api/chat/conversations?agentId=${encodeURIComponent($)}`:"/api/chat/conversations";fetch(oe).then(ue=>ue.json()).then(ue=>h(ue.data||[])).catch(()=>{})},[]);u.useEffect(()=>{fetch("/api/agents").then($=>$.json()).then($=>{const oe=$.data||[];d(oe),oe.length>0&&!o?(m(oe[0]),K(oe[0].id)):K()}).catch(()=>{})},[]),u.useEffect(()=>{o&&K(o.id)},[o==null?void 0:o.id,K]);const _=u.useCallback($=>{g($),fetch(`/api/chat/conversations/${$.id}`).then(oe=>oe.json()).then(oe=>{var ge;j(((ge=oe.data)==null?void 0:ge.messages)||[]);const ue=r.find(we=>{var be;return we.id===((be=oe.data)==null?void 0:be.agentId)});ue&&m(ue)}).catch(()=>{})},[r]),Z=u.useCallback(()=>{var $;g(null),j([]),M(!1),E([]),($=re.current)==null||$.focus()},[]),ne=u.useCallback(($,oe)=>{$.stopPropagation(),fetch(`/api/chat/conversations/${oe}`,{method:"DELETE"}).then(()=>{h(ue=>ue.filter(ge=>ge.id!==oe)),(b==null?void 0:b.id)===oe&&Z()}).catch(()=>{})},[b,Z]),xe=u.useCallback(async()=>{var ge;if(!y.trim()||!o||C)return;const $={role:"user",content:y.trim(),timestamp:Date.now()};le(y.trim()),W(null),j(we=>[...we,$]),w(""),k(!0);const oe={role:"assistant",content:"",timestamp:Date.now(),isStreaming:!0,toolCalls:[]};j(we=>[...we,oe]);const ue=new AbortController;he.current=ue;try{const we=await fetch(`/api/chat/${o.id}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:y.trim(),conversationId:b==null?void 0:b.id}),signal:ue.signal});if(!we.body)throw new Error("No response body");const be=we.body.getReader(),Xe=new TextDecoder;let Ye="";for(;;){const{done:la,value:Is}=await be.read();if(la)break;Ye+=Xe.decode(Is,{stream:!0});const Dt=Ye.split(`
|
|
589
|
-
`);Ye=Dt.pop()||"";for(const Xa of Dt){if(!Xa.startsWith("data: "))continue;let He;try{He=JSON.parse(Xa.slice(6))}catch{continue}switch(He.type){case"system":M(!0),E(He.tools||[]);break;case"token":j(gt=>{const L=[...gt],ee=L[L.length-1];return ee&&ee.role==="assistant"&&(L[L.length-1]={...ee,content:ee.content+He.text}),L});break;case"thinking":j(gt=>{const L=[...gt],ee=L[L.length-1];return ee&&ee.role==="assistant"&&(L[L.length-1]={...ee,thinking:(ee.thinking||"")+He.text}),L});break;case"tool_start":j(gt=>{const L=[...gt],ee=L[L.length-1];return ee&&ee.role==="assistant"&&(L[L.length-1]={...ee,toolCalls:[...ee.toolCalls||[],{name:He.name,args:He.args||{},output:"",success:!0,pending:!0}]}),L});break;case"tool_result":j(gt=>{var ye;const L=[...gt],ee=L[L.length-1];if(ee&&ee.role==="assistant"&&((ye=ee.toolCalls)!=null&&ye.length)){const Fe=[...ee.toolCalls];let va=-1;for(let ja=Fe.length-1;ja>=0;ja--)if(Fe[ja].name===He.name&&Fe[ja].pending){va=ja;break}va===-1&&(va=Fe.length-1),Fe[va]={...Fe[va],output:He.output,success:He.success,pending:!1},L[L.length-1]={...ee,toolCalls:Fe}}return L});break;case"done":j(gt=>{const L=[...gt],ee=L[L.length-1];return ee&&ee.role==="assistant"&&(L[L.length-1]={...ee,isStreaming:!1,usage:He.usage}),L}),He.conversationId&&!b&&(g({id:He.conversationId}),K(o==null?void 0:o.id));break;case"plan":He.plan&&He.plan.steps&&G(He.plan.steps);break;case"mission_suggestion":W({message:He.message,objective:Q});break;case"error":j(gt=>{const L=[...gt],ee=L[L.length-1];return ee&&ee.role==="assistant"&&(L[L.length-1]={...ee,content:ee.content?ee.content+`
|
|
590
|
-
|
|
591
|
-
Error: ${He.message}`:`Error: ${He.message}`,isStreaming:!1}),L});break;case"reasoning":break}}}}catch(we){if(we instanceof DOMException&&we.name==="AbortError")j(be=>{const Xe=[...be],Ye=Xe[Xe.length-1];return Ye&&Ye.role==="assistant"&&(Xe[Xe.length-1]={...Ye,isStreaming:!1}),Xe});else{const be=we instanceof Error?we.message:"Connection error";j(Xe=>{const Ye=[...Xe],la=Ye[Ye.length-1];return la&&la.role==="assistant"&&(Ye[Ye.length-1]={...la,content:`Connection error: ${be}`,isStreaming:!1}),Ye})}}he.current=null,k(!1),(ge=re.current)==null||ge.focus()},[y,o,C,b,K]),T=u.useCallback(()=>{var $;($=he.current)==null||$.abort()},[]),X=$=>{$.key==="Enter"&&!$.shiftKey&&($.preventDefault(),xe())};return t.jsxs("div",{className:"flex h-full bg-background",children:[N&&t.jsxs("div",{className:"w-64 border-r border-border flex flex-col bg-surface flex-shrink-0",children:[t.jsx("div",{className:"p-3 border-b border-border",children:t.jsxs("button",{onClick:Z,className:"w-full flex items-center justify-center gap-2 px-3 py-2 bg-indigo-600 hover:bg-indigo-700 rounded-lg text-sm font-medium transition-colors text-white",children:[t.jsx(pt,{className:"h-4 w-4"}),"New Chat"]})}),t.jsxs("div",{className:"flex-1 overflow-y-auto",children:[f.length===0&&t.jsx("p",{className:"px-3 py-4 text-xs text-zinc-500 text-center",children:"No conversations yet"}),f.map($=>t.jsxs("button",{onClick:()=>_($),className:`group w-full text-left px-3 py-2.5 text-sm hover:bg-surface-hover transition-colors flex items-center gap-2 ${(b==null?void 0:b.id)===$.id?"bg-indigo-500/10 text-indigo-400":"text-zinc-400"}`,children:[t.jsx(js,{className:"h-3.5 w-3.5 flex-shrink-0"}),t.jsx("span",{className:"truncate flex-1",children:$.title||"Untitled"}),t.jsx("button",{onClick:oe=>ne(oe,$.id),className:"opacity-0 group-hover:opacity-100 p-0.5 hover:text-red-400 transition-opacity",title:"Delete conversation",children:t.jsx(Mt,{className:"h-3 w-3"})})]},$.id))]})]}),t.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border bg-surface",children:[t.jsx("button",{onClick:()=>S(!N),className:"p-1.5 hover:bg-surface-hover rounded-lg transition-colors text-zinc-400 hover:text-zinc-200",title:N?"Hide sidebar":"Show sidebar",children:N?t.jsx(gv,{className:"h-4 w-4"}):t.jsx(bv,{className:"h-4 w-4"})}),t.jsx("select",{value:(o==null?void 0:o.id)||"",onChange:$=>{const oe=r.find(ue=>ue.id===$.target.value);oe&&m(oe)},className:"bg-background border border-border rounded-lg px-3 py-1.5 text-sm text-zinc-200 focus:outline-none focus:border-indigo-500",children:r.map($=>t.jsxs("option",{value:$.id,children:[$.name," (",$.adapterType,")"]},$.id))}),o&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-zinc-500",children:((ie=o.adapterConfig)==null?void 0:ie.model)||F1(o.adapterType)}),t.jsx("button",{onClick:()=>ce(!0),className:"p-1.5 hover:bg-surface-hover rounded-lg transition-colors text-zinc-500 hover:text-zinc-200",title:"Edit system prompt",children:t.jsx(Yn,{className:"h-3.5 w-3.5"})})]}),z&&t.jsxs("div",{className:"ml-auto flex items-center gap-1.5 text-xs text-amber-400/80",title:`Available tools: ${O.join(", ")}`,children:[t.jsx(Qn,{className:"h-3 w-3"}),t.jsxs("span",{children:[O.length," tools"]})]})]}),z&&t.jsxs("div",{className:"flex items-center gap-2 px-4 py-1.5 bg-amber-500/10 border-b border-amber-500/20 text-amber-400 text-xs",children:[t.jsx(lt,{className:"h-3 w-3 flex-shrink-0"}),t.jsx("span",{children:"Tools are auto-approved in chat mode. Shell commands and file operations execute without confirmation."})]}),t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-4 space-y-4",children:[p.length===0&&t.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-zinc-500",children:[t.jsx(js,{className:"h-12 w-12 mb-4 text-indigo-500/40"}),t.jsx("h2",{className:"text-xl font-semibold text-zinc-200 mb-2",children:"Start a conversation"}),t.jsxs("p",{className:"text-sm mb-6",children:["Type a message to chat with ",(o==null?void 0:o.name)||"your agent"]}),t.jsx("div",{className:"grid grid-cols-2 gap-2 max-w-md",children:["Review my code for bugs","Explain this codebase","Write unit tests","Help me refactor"].map($=>t.jsx("button",{onClick:()=>w($),className:"px-3 py-2 text-sm bg-surface hover:bg-surface-hover border border-border rounded-lg text-left text-zinc-300 transition-colors",children:$},$))})]}),p.map(($,oe)=>{var ue,ge,we;return t.jsx("div",{className:`flex ${$.role==="user"?"justify-end":"justify-start"}`,children:t.jsxs("div",{className:`max-w-[80%] rounded-2xl px-4 py-3 ${$.role==="user"?"bg-indigo-600 text-white":"bg-surface border border-border text-zinc-100"}`,children:[$.thinking&&t.jsxs("div",{className:"mb-2 px-2 py-1.5 bg-zinc-800/30 rounded-lg text-[11px] text-zinc-500 italic border border-zinc-700/30",children:[t.jsx("span",{className:"text-zinc-600 text-[10px] uppercase tracking-wider block mb-0.5",children:"Thinking"}),$.thinking.substring(0,300),$.thinking.length>300&&"..."]}),(ue=$.toolCalls)==null?void 0:ue.map((be,Xe)=>t.jsx(W1,{tc:be},Xe)),$.content&&((/(?:API[_\s]?KEY|api[_\s]?key).*(?:not set|not configured|missing|invalid|required)/i.test($.content)||/(?:ANTHROPIC|OPENAI|GEMINI|XAI|MISTRAL|GROK)_API_KEY/i.test($.content))&&$.role==="assistant"?t.jsxs("div",{className:"space-y-2",children:[t.jsx("div",{className:"whitespace-pre-wrap break-words",children:$.content}),t.jsxs(Ha,{to:"/keys",className:"inline-flex items-center gap-2 rounded-lg border border-purple-500/30 bg-purple-500/10 px-3 py-2 text-sm text-purple-400 hover:bg-purple-500/20 transition-colors",children:[t.jsx(ti,{className:"h-4 w-4"}),"Set up your API key"]})]}):t.jsx("div",{className:"whitespace-pre-wrap break-words",children:$.content})),$.isStreaming&&!$.content&&!((ge=$.toolCalls)!=null&&ge.length)&&t.jsxs("div",{className:"flex items-center gap-1.5 text-zinc-400",children:[t.jsx(ot,{className:"h-3 w-3 animate-spin"}),t.jsx("span",{className:"text-xs",children:"Thinking..."})]}),$.isStreaming&&!$.content&&(((we=$.toolCalls)==null?void 0:we.length)??0)>0&&t.jsxs("div",{className:"flex items-center gap-1.5 text-zinc-400 mt-1",children:[t.jsx(ot,{className:"h-3 w-3 animate-spin"}),t.jsx("span",{className:"text-xs",children:"Processing tools..."})]}),$.isStreaming&&$.content&&t.jsx("span",{className:"inline-block w-1.5 h-4 bg-indigo-400 animate-pulse ml-0.5 rounded-sm"}),$.usage&&($.usage.inputTokens>0||$.usage.outputTokens>0)&&t.jsxs("div",{className:"mt-1.5 text-[10px] text-zinc-500 flex items-center gap-2",children:[t.jsxs("span",{children:[$.usage.inputTokens+$.usage.outputTokens," tokens"]}),$.usage.costUsd>0&&t.jsxs("span",{children:["$",$.usage.costUsd.toFixed(4)]}),$.toolCalls&&$.toolCalls.length>0&&t.jsxs("span",{children:[$.toolCalls.length," tool call",$.toolCalls.length>1?"s":""]})]})]})},oe)}),H&&H.length>0&&t.jsx("div",{className:"flex justify-start",children:t.jsx("div",{className:"max-w-[80%]",children:t.jsx(tN,{steps:H})})}),P&&t.jsxs("div",{className:"mx-4 my-2 p-4 bg-purple-900/30 border border-purple-500/50 rounded-lg",children:[t.jsxs("p",{className:"text-sm text-purple-300",children:[t.jsx(Xs,{className:"inline h-4 w-4 mr-1.5 -mt-0.5"}),P.message]}),t.jsxs("div",{className:"mt-2 flex gap-2",children:[t.jsx("button",{onClick:()=>n(`/missions?objective=${encodeURIComponent(P.objective)}`),className:"px-3 py-1.5 bg-purple-600 hover:bg-purple-500 rounded text-sm text-white transition-colors",children:"Run as Mission"}),t.jsx("button",{onClick:()=>W(null),className:"px-3 py-1.5 bg-gray-700 hover:bg-gray-600 rounded text-sm text-zinc-200 transition-colors",children:"Continue in Chat"})]})]}),t.jsx("div",{ref:F})]}),t.jsxs("div",{className:"border-t border-border px-4 py-3 bg-surface",children:[t.jsxs("div",{className:"flex gap-2 items-end max-w-4xl mx-auto",children:[t.jsx("textarea",{ref:re,value:y,onChange:$=>w($.target.value),onKeyDown:X,placeholder:`Message ${(o==null?void 0:o.name)||"agent"}...`,rows:1,className:"flex-1 bg-background border border-border rounded-xl px-4 py-3 resize-none focus:outline-none focus:border-indigo-500 placeholder-zinc-500 text-zinc-200 text-sm",style:{minHeight:"48px",maxHeight:"200px"},disabled:C||!o}),C?t.jsx("button",{onClick:T,className:"px-4 py-3 bg-red-600 hover:bg-red-700 rounded-xl transition-colors text-white flex-shrink-0",title:"Stop generation",children:t.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor",children:t.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}):t.jsx("button",{onClick:xe,disabled:!y.trim()||!o,className:"px-4 py-3 bg-indigo-600 hover:bg-indigo-700 disabled:opacity-50 disabled:cursor-not-allowed rounded-xl transition-colors text-white flex-shrink-0",title:"Send message",children:t.jsx(b0,{className:"h-5 w-5"})})]}),!o&&r.length===0&&t.jsx("p",{className:"text-xs text-yellow-500 mt-2 text-center",children:"No agents configured. Create one first in the Agents page."})]})]}),ae&&o&&t.jsx(aN,{agent:o,onClose:()=>ce(!1),onSave:$=>{m($),d(oe=>oe.map(ue=>ue.id===$.id?$:ue)),ce(!1)}})]})}function nN(n){switch(n){case"osint":return t.jsx(Vr,{className:"h-4 w-4"});case"research":return t.jsx(Js,{className:"h-4 w-4"});case"code":return t.jsx(iv,{className:"h-4 w-4"});case"audit":return t.jsx(Ns,{className:"h-4 w-4"});case"analysis":return t.jsx(ga,{className:"h-4 w-4"});case"creation":return t.jsx(Zs,{className:"h-4 w-4"});default:return t.jsx(Ks,{className:"h-4 w-4"})}}function lN(n){switch(n){case"completed":return"text-green-400";case"in_progress":return"text-amber-400";case"failed":return"text-red-400";case"pending":return"text-zinc-500";case"skipped":return"text-zinc-600";default:return"text-zinc-400"}}function iN(n){switch(n){case"completed":return t.jsx(Kr,{className:"h-4 w-4 text-green-400"});case"in_progress":return t.jsx(ot,{className:"h-4 w-4 text-amber-400 animate-spin"});case"failed":return t.jsx(wt,{className:"h-4 w-4 text-red-400"});case"pending":return t.jsx(jd,{className:"h-4 w-4 text-zinc-600"});case"skipped":return t.jsx(jd,{className:"h-4 w-4 text-zinc-700"});default:return t.jsx(jd,{className:"h-4 w-4 text-zinc-600"})}}function ru(n){return n>=.8?"text-green-400":n>=.6?"text-amber-400":"text-red-400"}function $0(n){return n>=.8?"bg-green-500/10 border-green-500/20":n>=.6?"bg-amber-500/10 border-amber-500/20":"bg-red-500/10 border-red-500/20"}function Bd(n){switch(n){case"search":return"bg-blue-500/10 text-blue-400 border-blue-500/20";case"scrape":return"bg-emerald-500/10 text-emerald-400 border-emerald-500/20";case"analyze":return"bg-purple-500/10 text-purple-400 border-purple-500/20";case"create":return"bg-amber-500/10 text-amber-400 border-amber-500/20";case"validate":return"bg-cyan-500/10 text-cyan-400 border-cyan-500/20";default:return"bg-zinc-500/10 text-zinc-400 border-zinc-500/20"}}const rN=[{label:"OSINT investigation",prompt:"OSINT investigation on "},{label:"Security audit",prompt:"Security audit of "},{label:"Market analysis",prompt:"Market analysis of "},{label:"Build a landing page",prompt:"Build a landing page for "},{label:"Competitive research",prompt:"Competitive research on "},{label:"Code review",prompt:"Review all PRs from this week on "}];function Rr({label:n,score:r}){const d=Math.round(r*100);return t.jsxs("div",{className:`flex flex-col items-center rounded-lg border px-4 py-3 ${$0(r)}`,children:[t.jsx("span",{className:"text-[10px] uppercase tracking-wider text-zinc-500 mb-1",children:n}),t.jsxs("span",{className:`text-2xl font-bold tabular-nums ${ru(r)}`,children:[d,"%"]})]})}function cN({finding:n}){const[r,d]=u.useState(!1),o=Math.round(n.confidence*100);return t.jsxs("div",{className:"rounded-lg border border-border/50 bg-zinc-900/50 overflow-hidden",children:[t.jsxs("button",{onClick:()=>d(!r),className:"w-full flex items-start gap-2 px-3 py-2.5 text-left hover:bg-zinc-800/30 transition-colors",children:[t.jsx("span",{className:"mt-0.5 flex-shrink-0",children:r?t.jsx(Va,{className:"h-3.5 w-3.5 text-zinc-500"}):t.jsx(aa,{className:"h-3.5 w-3.5 text-zinc-500"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded border font-medium ${Bd(n.type)}`,children:n.type}),t.jsx("span",{className:"text-sm font-medium text-zinc-200 truncate",children:n.title})]}),t.jsxs("div",{className:"flex items-center gap-2 mt-1 text-[11px] text-zinc-500",children:[t.jsxs("span",{className:ru(n.confidence),children:[o,"% confidence"]}),n.source&&t.jsxs("span",{children:["via ",n.source]})]})]})]}),r&&t.jsxs("div",{className:"px-3 pb-3 pt-0 border-t border-border/30",children:[t.jsx("p",{className:"text-xs text-zinc-400 whitespace-pre-wrap mt-2",children:n.content}),n.sourceUrl&&t.jsx("a",{href:n.sourceUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-block mt-2 text-[11px] text-purple-400 hover:text-purple-300 underline",children:n.sourceUrl})]})]})}function oN({content:n}){const r=n.split(`
|
|
592
|
-
`),d=[];for(let o=0;o<r.length;o++){const m=r[o];if(o===0&&m==="---"){const f=r.indexOf("---",1);if(f>0){o=f;continue}}if(m.startsWith("# "))d.push(t.jsx("h1",{className:"text-xl font-bold text-zinc-100 mt-6 mb-2",children:m.slice(2)},o));else if(m.startsWith("## "))d.push(t.jsx("h2",{className:"text-lg font-semibold text-zinc-200 mt-5 mb-2",children:m.slice(3)},o));else if(m.startsWith("### "))d.push(t.jsx("h3",{className:"text-base font-semibold text-zinc-300 mt-4 mb-1",children:m.slice(4)},o));else if(m.startsWith("#### "))d.push(t.jsx("h4",{className:"text-sm font-semibold text-zinc-300 mt-3 mb-1",children:m.slice(5)},o));else if(m.startsWith("- ")||m.startsWith("* "))d.push(t.jsxs("div",{className:"flex gap-2 text-sm text-zinc-400 ml-2 my-0.5",children:[t.jsx("span",{className:"text-zinc-600 flex-shrink-0",children:"-"}),t.jsx("span",{children:Cd(m.slice(2))})]},o));else if(/^\d+\.\s/.test(m)){const f=m.match(/^(\d+)\.\s(.*)$/);f&&d.push(t.jsxs("div",{className:"flex gap-2 text-sm text-zinc-400 ml-2 my-0.5",children:[t.jsxs("span",{className:"text-zinc-600 flex-shrink-0 tabular-nums",children:[f[1],"."]}),t.jsx("span",{children:Cd(f[2])})]},o))}else m.startsWith("---")||m.startsWith("***")?d.push(t.jsx("hr",{className:"border-border/50 my-4"},o)):m.trim()===""?d.push(t.jsx("div",{className:"h-2"},o)):d.push(t.jsx("p",{className:"text-sm text-zinc-400 my-1",children:Cd(m)},o))}return t.jsx("div",{className:"space-y-0",children:d})}function Cd(n){return n.split(/(\*\*[^*]+\*\*)/g).map((d,o)=>{if(d.startsWith("**")&&d.endsWith("**"))return t.jsx("strong",{className:"text-zinc-200 font-semibold",children:d.slice(2,-2)},o);const m=/\[([^\]]+)\]\(([^)]+)\)/g,f=[];let h=0,b;for(;(b=m.exec(d))!==null;)b.index>h&&f.push(d.slice(h,b.index)),f.push(t.jsx("a",{href:b[2],target:"_blank",rel:"noopener noreferrer",className:"text-purple-400 hover:text-purple-300 underline",children:b[1]},`${o}-${b.index}`)),h=b.index+b[0].length;return h<d.length&&f.push(d.slice(h)),f.length>0?t.jsx("span",{children:f},o):d})}function dN({missions:n,selectedId:r,onSelect:d}){return n.length===0?null:t.jsxs("div",{className:"border-b border-border/50 pb-2 mb-4",children:[t.jsx("h3",{className:"text-[10px] uppercase tracking-wider text-zinc-600 px-1 mb-2",children:"Recent Missions"}),t.jsx("div",{className:"space-y-1 max-h-48 overflow-y-auto",children:n.slice(0,10).map(o=>t.jsx("button",{onClick:()=>d(o),className:`w-full text-left px-2 py-1.5 rounded text-xs transition-colors ${r===o.id?"bg-purple-500/10 text-purple-400":"text-zinc-500 hover:text-zinc-300 hover:bg-zinc-800/50"}`,children:t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:lN(o.status),children:o.status==="completed"?t.jsx(Kr,{className:"h-3 w-3"}):t.jsx(Ys,{className:"h-3 w-3"})}),t.jsx("span",{className:"truncate",children:o.title})]})},o.id))})]})}function uN(){const[n,r]=Yy(),[d,o]=u.useState("empty"),[m,f]=u.useState(""),[h,b]=u.useState(null),[g,p]=u.useState([]),[j,y]=u.useState(""),[w,C]=u.useState([]),[k,N]=u.useState(!1),[S,z]=u.useState(null),M=u.useRef(null),O=u.useRef(null),E=u.useRef(null),ae=u.useRef(!1);u.useEffect(()=>{Ql.list().then(_=>{C(_.data||[])}).catch(()=>{})},[]),u.useEffect(()=>{O.current&&(O.current.scrollTop=O.current.scrollHeight)},[g]),u.useEffect(()=>()=>{var _;(_=M.current)==null||_.close()},[]);const ce=u.useCallback(async _=>{var ne,xe;const Z=_??m;if(Z.trim()){o("planning"),y(""),p([]),b(null),N(!1);try{const T=await Ql.plan(Z.trim());b(T.data),o("planned")}catch(T){y(((xe=(ne=T==null?void 0:T.body)==null?void 0:ne.error)==null?void 0:xe.message)||T.message||"Planning failed"),o("error")}}},[m]);u.useEffect(()=>{if(ae.current)return;const _=n.get("objective");_&&!h&&(ae.current=!0,f(_),r({},{replace:!0}),ce(_))},[n,h,ce,r]);const H=u.useCallback(async()=>{var T;if(!h)return;o("executing"),p([]),N(!1),z(null);const _=localStorage.getItem("nestor_token"),Z=(T=document.cookie.match(/(?:^|; )nestor-csrf=([^;]*)/))==null?void 0:T[1],ne=localStorage.getItem("nestor_tenant_id"),xe={"Content-Type":"application/json"};_&&(xe.Authorization=`Bearer ${_}`),Z&&(xe["X-CSRF-Token"]=decodeURIComponent(Z)),ne&&(xe["X-Tenant-ID"]=ne);try{const X=await fetch(`/api/missions/${h.id}/execute`,{method:"POST",headers:xe});if(!X.ok||!X.body){y("Failed to start execution"),o("error");return}const ie=X.body.getReader(),$=new TextDecoder;let oe="";const ue=we=>{if(we.startsWith("data: "))try{const be=JSON.parse(we.slice(6));G(be)}catch{}};await(async()=>{for(;;){const{done:we,value:be}=await ie.read();if(we)break;oe+=$.decode(be,{stream:!0});const Xe=oe.split(`
|
|
593
|
-
`);oe=Xe.pop()||"";for(const Ye of Xe)ue(Ye.trim())}oe.trim()&&ue(oe.trim())})()}catch(X){y(X.message||"Execution failed"),o("error")}},[h]),G=u.useCallback(_=>{switch(_.type){case"status":b(Z=>Z&&{...Z,status:_.status}),_.status==="evaluating"&&o("evaluating");break;case"sub_objective_start":z(_.id),b(Z=>{if(!Z)return Z;const ne=Z.subObjectives.map(xe=>xe.id===_.id?{...xe,status:"in_progress"}:xe);return{...Z,subObjectives:ne}});break;case"sub_objective_complete":b(Z=>{if(!Z)return Z;const ne=Z.subObjectives.map(xe=>xe.id===_.id?{...xe,status:_.status}:xe);return{...Z,subObjectives:ne}});break;case"finding":p(Z=>[...Z,_]);break;case"evaluation":b(Z=>Z&&{...Z,evaluation:{completeness:_.completeness,accuracy:_.accuracy,depth:_.depth,relevance:_.relevance,overall:_.overall,gaps:_.gaps||[],recommendation:_.recommendation||"deliver",suggestedActions:_.suggestedActions||[]}});break;case"iteration":b(Z=>Z&&{...Z,iteration:_.iteration});break;case"budget_exhausted":break;case"complete":b(Z=>Z&&{...Z,status:_.status||"completed",spentUsd:_.cost||Z.spentUsd,iteration:_.iterations||Z.iteration}),_.missionId&&Ql.get(_.missionId).then(Z=>{b(Z.data)}).catch(()=>{}),o("complete"),Ql.list().then(Z=>C(Z.data||[])).catch(()=>{});break;case"error":y(_.message),o("error");break}},[]),P=u.useCallback(async()=>{if(h)try{await Ql.cancel(h.id),b(_=>_&&{..._,status:"cancelled"}),o("empty")}catch{}},[h]),W=u.useCallback(()=>{var _,Z;o("empty"),f(""),b(null),p([]),y(""),N(!1),z(null),(_=M.current)==null||_.close(),(Z=E.current)==null||Z.focus()},[]),Q=u.useCallback(_=>{b(_),f(_.objective),p((_.findings||[]).map(Z=>({id:Z.id,type:Z.type,title:Z.title,content:Z.content,confidence:Z.confidence,source:Z.source,sourceUrl:Z.sourceUrl}))),_.status==="completed"||_.status==="failed"?o("complete"):(_.status,o("planned"))},[]),le=u.useCallback(()=>{if(!(h!=null&&h.report))return;const _=new Blob([h.report],{type:"text/markdown"}),Z=URL.createObjectURL(_),ne=document.createElement("a");ne.href=Z,ne.download=`${h.title.replace(/[^a-zA-Z0-9]/g,"_")}_report.md`,ne.click(),URL.revokeObjectURL(Z)},[h]),F=u.useCallback(_=>{var Z;f(_),(Z=E.current)==null||Z.focus()},[]),re=(h==null?void 0:h.subObjectives.filter(_=>_.status==="completed").length)||0,he=(h==null?void 0:h.subObjectives.length)||1,K=Math.round(re/he*100);return t.jsx("div",{className:"flex h-full",children:t.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-3 h-14 px-6 border-b border-border bg-surface flex-shrink-0",children:[t.jsx(qa,{className:"h-5 w-5 text-purple-400"}),t.jsx("h1",{className:"text-lg font-semibold text-zinc-100",children:"Missions"}),h&&d!=="empty"&&t.jsxs("div",{className:"flex items-center gap-2 ml-auto text-xs text-zinc-500",children:[h.type&&t.jsxs("span",{className:`flex items-center gap-1 px-2 py-0.5 rounded border ${Bd(h.type)}`,children:[nN(h.type),h.type]}),t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx(ya,{className:"h-3 w-3"}),"$",h.spentUsd.toFixed(4)," / $",h.maxBudgetUsd.toFixed(2)]}),h.iteration>0&&t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx(Yt,{className:"h-3 w-3"}),"Iteration ",h.iteration,"/",h.maxIterations]}),t.jsx("button",{onClick:W,className:"ml-2 p-1 rounded text-zinc-500 hover:text-zinc-300 hover:bg-zinc-800 transition-colors",title:"New mission",children:t.jsx(Je,{className:"h-4 w-4"})})]})]}),d==="empty"&&t.jsx("div",{className:"flex-1 flex flex-col items-center justify-center px-6",children:t.jsxs("div",{className:"w-full max-w-2xl",children:[t.jsx("div",{className:"flex items-center justify-center mb-6",children:t.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-purple-600/20 border border-purple-500/20",children:t.jsx(qa,{className:"h-8 w-8 text-purple-400"})})}),t.jsx("h2",{className:"text-2xl font-bold text-zinc-100 text-center mb-2",children:"What's your mission?"}),t.jsx("p",{className:"text-sm text-zinc-500 text-center mb-8",children:"Autonomous AI agents will plan, execute, and deliver results."}),t.jsx(dN,{missions:w,selectedId:null,onSelect:Q}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("input",{ref:E,type:"text",value:m,onChange:_=>f(_.target.value),onKeyDown:_=>_.key==="Enter"&&ce(),placeholder:"Describe your mission objective...",className:"flex-1 rounded-lg border border-border bg-zinc-900 px-4 py-3 text-sm text-zinc-200 placeholder:text-zinc-600 focus:outline-none focus:ring-2 focus:ring-purple-500/40 focus:border-purple-500/40",autoFocus:!0}),t.jsxs("button",{onClick:()=>ce(),disabled:!m.trim(),className:"flex items-center gap-2 rounded-lg bg-purple-600 px-5 py-3 text-sm font-medium text-white hover:bg-purple-500 disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:[t.jsx(Xs,{className:"h-4 w-4"}),"Plan"]})]}),t.jsx("div",{className:"flex flex-wrap gap-2 mt-4 justify-center",children:rN.map(_=>t.jsx("button",{onClick:()=>F(_.prompt),className:"px-3 py-1.5 rounded-full border border-border/50 text-xs text-zinc-500 hover:text-zinc-300 hover:border-purple-500/30 hover:bg-purple-500/5 transition-colors",children:_.label},_.label))})]})}),d==="planning"&&t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6",children:[t.jsx(ot,{className:"h-10 w-10 text-purple-400 animate-spin mb-4"}),t.jsx("h2",{className:"text-lg font-semibold text-zinc-200 mb-1",children:"Analyzing objective..."}),t.jsx("p",{className:"text-sm text-zinc-500",children:"Decomposing into sub-objectives"})]}),d==="error"&&t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6",children:[t.jsx(lt,{className:"h-10 w-10 text-red-400 mb-4"}),t.jsx("h2",{className:"text-lg font-semibold text-zinc-200 mb-1",children:"Something went wrong"}),t.jsx("p",{className:"text-sm text-red-400/80 mb-4 max-w-md text-center",children:j}),t.jsx("button",{onClick:W,className:"px-4 py-2 rounded-lg border border-border text-sm text-zinc-300 hover:bg-zinc-800 transition-colors",children:"Try again"})]}),h&&(d==="planned"||d==="executing"||d==="evaluating"||d==="complete")&&t.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[t.jsxs("div",{className:"w-[420px] flex-shrink-0 border-r border-border overflow-y-auto p-4",children:[t.jsxs("div",{className:"mb-4",children:[t.jsx("h2",{className:"text-base font-semibold text-zinc-100 mb-1",children:h.title}),t.jsx("p",{className:"text-xs text-zinc-500 leading-relaxed",children:h.objective})]}),(d==="executing"||d==="evaluating")&&t.jsxs("div",{className:"mb-4",children:[t.jsxs("div",{className:"flex justify-between text-[10px] text-zinc-500 mb-1",children:[t.jsx("span",{children:"Progress"}),t.jsxs("span",{children:[K,"%"]})]}),t.jsx("div",{className:"h-1.5 bg-zinc-800 rounded-full overflow-hidden",children:t.jsx("div",{className:"h-full bg-purple-500 rounded-full transition-all duration-500",style:{width:`${K}%`}})})]}),t.jsx("div",{className:"space-y-1",children:h.subObjectives.map((_,Z)=>t.jsxs("div",{className:`flex items-start gap-3 px-3 py-2.5 rounded-lg transition-colors ${S===_.id?"bg-purple-500/10 border border-purple-500/20":"hover:bg-zinc-800/30"}`,children:[t.jsxs("div",{className:"flex flex-col items-center flex-shrink-0",children:[iN(_.status),Z<h.subObjectives.length-1&&t.jsx("div",{className:"w-px h-6 bg-border/50 mt-1"})]}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-sm font-medium text-zinc-200 truncate",children:_.name}),t.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded border ${Bd(_.type)}`,children:_.type})]}),t.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5 line-clamp-2",children:_.description}),_.findings.length>0&&t.jsxs("span",{className:"text-[10px] text-zinc-600 mt-1 inline-block",children:[_.findings.length," finding",_.findings.length!==1?"s":""]})]})]},_.id))}),t.jsxs("div",{className:"mt-6 space-y-2",children:[d==="planned"&&t.jsxs("div",{className:"flex gap-2",children:[t.jsxs("button",{onClick:H,className:"flex-1 flex items-center justify-center gap-2 rounded-lg bg-purple-600 px-4 py-2.5 text-sm font-medium text-white hover:bg-purple-500 transition-colors",children:[t.jsx(qa,{className:"h-4 w-4"}),"Execute Mission"]}),t.jsx("button",{onClick:P,className:"rounded-lg border border-border px-4 py-2.5 text-sm text-zinc-400 hover:text-zinc-200 hover:bg-zinc-800 transition-colors",children:"Cancel"})]}),d==="executing"&&t.jsxs("button",{onClick:P,className:"w-full flex items-center justify-center gap-2 rounded-lg border border-red-500/30 px-4 py-2.5 text-sm text-red-400 hover:bg-red-500/10 transition-colors",children:[t.jsx(wt,{className:"h-4 w-4"}),"Cancel Execution"]}),d==="evaluating"&&t.jsxs("div",{className:"flex items-center justify-center gap-2 text-sm text-amber-400 py-2",children:[t.jsx(ot,{className:"h-4 w-4 animate-spin"}),"Evaluating results..."]})]}),h.evaluation&&(d==="complete"||d==="evaluating")&&t.jsxs("div",{className:"mt-6",children:[t.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-zinc-500 mb-3",children:"Quality Evaluation"}),t.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[t.jsx(Rr,{label:"Completeness",score:h.evaluation.completeness}),t.jsx(Rr,{label:"Accuracy",score:h.evaluation.accuracy}),t.jsx(Rr,{label:"Depth",score:h.evaluation.depth}),t.jsx(Rr,{label:"Relevance",score:h.evaluation.relevance})]}),t.jsxs("div",{className:`mt-2 rounded-lg border p-3 text-center ${$0(h.evaluation.overall)}`,children:[t.jsx("span",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:"Overall"}),t.jsxs("div",{className:`text-3xl font-bold tabular-nums ${ru(h.evaluation.overall)}`,children:[Math.round(h.evaluation.overall*100),"%"]}),t.jsxs("div",{className:"text-xs text-zinc-500 mt-1 capitalize",children:["Recommendation: ",t.jsx("span",{className:h.evaluation.recommendation==="deliver"?"text-green-400":h.evaluation.recommendation==="iterate"?"text-amber-400":"text-red-400",children:h.evaluation.recommendation})]})]}),h.evaluation.gaps.length>0&&t.jsxs("div",{className:"mt-3",children:[t.jsx("h4",{className:"text-[10px] uppercase tracking-wider text-zinc-600 mb-1",children:"Gaps"}),h.evaluation.gaps.map((_,Z)=>t.jsxs("p",{className:"text-[11px] text-zinc-500 flex items-start gap-1 mt-0.5",children:[t.jsx(lt,{className:"h-3 w-3 text-amber-500/60 flex-shrink-0 mt-0.5"}),_]},Z))]})]}),d==="complete"&&h.report&&t.jsxs("div",{className:"mt-4 flex gap-2",children:[t.jsxs("button",{onClick:()=>N(!k),className:"flex-1 flex items-center justify-center gap-2 rounded-lg border border-border px-3 py-2 text-sm text-zinc-300 hover:bg-zinc-800 transition-colors",children:[t.jsx(Zs,{className:"h-4 w-4"}),k?"Hide Report":"View Report"]}),t.jsx("button",{onClick:le,className:"flex items-center justify-center gap-2 rounded-lg border border-border px-3 py-2 text-sm text-zinc-300 hover:bg-zinc-800 transition-colors",title:"Download as Markdown",children:t.jsx(Ur,{className:"h-4 w-4"})})]}),d==="complete"&&t.jsxs("button",{onClick:W,className:"mt-3 w-full flex items-center justify-center gap-2 rounded-lg bg-purple-600/20 border border-purple-500/20 px-4 py-2.5 text-sm text-purple-400 hover:bg-purple-600/30 transition-colors",children:[t.jsx(u0,{className:"h-4 w-4"}),"New Mission"]})]}),t.jsx("div",{className:"flex-1 overflow-y-auto p-4",ref:O,children:k&&h.report?t.jsxs("div",{className:"max-w-3xl mx-auto",children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsx("h3",{className:"text-sm font-semibold text-zinc-300",children:"Mission Report"}),t.jsx("button",{onClick:()=>N(!1),className:"text-zinc-500 hover:text-zinc-300",children:t.jsx(Je,{className:"h-4 w-4"})})]}),t.jsx("div",{className:"rounded-lg border border-border bg-zinc-900/50 p-6",children:t.jsx(oN,{content:h.report})})]}):t.jsxs(t.Fragment,{children:[t.jsxs("h3",{className:"text-xs font-semibold uppercase tracking-wider text-zinc-500 mb-3",children:["Findings",g.length>0&&t.jsxs("span",{className:"ml-2 text-zinc-600",children:["(",g.length,")"]})]}),g.length===0&&d==="planned"&&t.jsxs("div",{className:"flex flex-col items-center justify-center h-64 text-zinc-600",children:[t.jsx(Js,{className:"h-8 w-8 mb-2 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Findings will appear here during execution"})]}),g.length===0&&d==="executing"&&t.jsxs("div",{className:"flex flex-col items-center justify-center h-64 text-zinc-600",children:[t.jsx(ot,{className:"h-8 w-8 mb-2 animate-spin opacity-40"}),t.jsx("p",{className:"text-sm",children:"Agents are working..."})]}),t.jsx("div",{className:"space-y-2",children:g.map(_=>t.jsx(cN,{finding:_},_.id))})]})})]})]})})}const Yh=[{id:"claude",name:"Claude",provider:"Anthropic",emoji:"🟣",color:"text-purple-400",bgColor:"bg-purple-500/10",borderColor:"border-purple-500/30",keyUrl:"https://console.anthropic.com/settings/keys",keyUrlLabel:"console.anthropic.com",envVar:"ANTHROPIC_API_KEY",needsKey:!0},{id:"openai",name:"OpenAI",provider:"OpenAI",emoji:"🟢",color:"text-green-400",bgColor:"bg-green-500/10",borderColor:"border-green-500/30",keyUrl:"https://platform.openai.com/api-keys",keyUrlLabel:"platform.openai.com",envVar:"OPENAI_API_KEY",needsKey:!0},{id:"gemini",name:"Google Gemini",provider:"Google",emoji:"🔵",color:"text-blue-400",bgColor:"bg-blue-500/10",borderColor:"border-blue-500/30",keyUrl:"https://aistudio.google.com/apikey",keyUrlLabel:"aistudio.google.com",envVar:"GEMINI_API_KEY",needsKey:!0},{id:"grok",name:"Grok",provider:"xAI",emoji:"⚪",color:"text-zinc-300",bgColor:"bg-zinc-500/10",borderColor:"border-zinc-500/30",keyUrl:"https://console.x.ai/team/default/api-keys",keyUrlLabel:"console.x.ai",envVar:"XAI_API_KEY",needsKey:!0},{id:"mistral",name:"Mistral AI",provider:"Mistral",emoji:"🟠",color:"text-orange-400",bgColor:"bg-orange-500/10",borderColor:"border-orange-500/30",keyUrl:"https://console.mistral.ai/api-keys",keyUrlLabel:"console.mistral.ai",envVar:"MISTRAL_API_KEY",needsKey:!0},{id:"ollama",name:"Ollama",provider:"Local",emoji:"🟤",color:"text-amber-400",bgColor:"bg-amber-500/10",borderColor:"border-amber-500/30",keyUrl:"https://ollama.ai/download",keyUrlLabel:"ollama.ai",envVar:"",needsKey:!1}];function mN(n){if(!n)return"";const r=Date.now()-new Date(n+"Z").getTime(),d=Math.floor(r/6e4);if(d<1)return"Just now";if(d<60)return`${d}m ago`;const o=Math.floor(d/60);if(o<24)return`${o}h ago`;const m=Math.floor(o/24);return m<30?`${m}d ago`:new Date(n).toLocaleDateString()}function xN({entry:n}){return n.configured&&n.source==="db"?t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-green-500/10 px-2.5 py-0.5 text-xs font-medium text-green-400",children:[t.jsx(ht,{className:"h-3 w-3"}),"Configured"]}):n.configured&&n.source==="env"?t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-yellow-500/10 px-2.5 py-0.5 text-xs font-medium text-yellow-400",children:[t.jsx(lt,{className:"h-3 w-3"}),"From env"]}):n.provider==="ollama"&&n.configured?t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-blue-500/10 px-2.5 py-0.5 text-xs font-medium text-blue-400",children:[t.jsx(ht,{className:"h-3 w-3"}),"Local"]}):t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-red-500/10 px-2.5 py-0.5 text-xs font-medium text-red-400",children:[t.jsx(Je,{className:"h-3 w-3"}),"Not configured"]})}function fN({provider:n,onClose:r,onSaved:d}){const[o,m]=u.useState(""),[f,h]=u.useState(""),[b,g]=u.useState(!1),[p,j]=u.useState(!1),[y,w]=u.useState(!1),[C,k]=u.useState(null),[N,S]=u.useState(null),z=async()=>{if(o.trim()){w(!0),k(null),S(null);try{await oa.set(n.id,o.trim(),f||void 0);const O=await oa.test(n.id);k(O.data)}catch(O){S(O instanceof Error?O.message:"Test failed")}finally{w(!1)}}},M=async()=>{if(o.trim()){j(!0),S(null);try{await oa.set(n.id,o.trim(),f||void 0),d()}catch(O){S(O instanceof Error?O.message:"Failed to save")}finally{j(!1)}}};return t.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:t.jsxs("div",{className:"w-full max-w-lg rounded-2xl border border-border bg-surface p-6 shadow-2xl",children:[t.jsxs("div",{className:"flex items-center justify-between mb-6",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("span",{className:"text-2xl",children:n.emoji}),t.jsxs("div",{children:[t.jsx("h3",{className:"text-lg font-semibold text-white",children:n.name}),t.jsx("p",{className:"text-xs text-zinc-500",children:n.provider})]})]}),t.jsx("button",{onClick:r,className:"rounded-lg p-2 text-zinc-400 hover:bg-surface-hover hover:text-zinc-200",children:t.jsx(Je,{className:"h-5 w-5"})})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-zinc-300 mb-1.5",children:"API Key"}),t.jsxs("div",{className:"relative",children:[t.jsx("input",{type:b?"text":"password",value:o,onChange:O=>m(O.target.value),placeholder:`Enter your ${n.provider} API key`,className:"w-full rounded-lg border border-border bg-background px-4 py-2.5 pr-10 text-sm text-zinc-200 focus:border-purple-500 focus:outline-none placeholder:text-zinc-600",autoFocus:!0}),t.jsx("button",{type:"button",onClick:()=>g(!b),className:"absolute right-3 top-1/2 -translate-y-1/2 text-zinc-500 hover:text-zinc-300",children:b?t.jsx(Qd,{className:"h-4 w-4"}):t.jsx(Vr,{className:"h-4 w-4"})})]}),n.envVar&&t.jsxs("p",{className:"mt-1 text-xs text-zinc-600",children:["Env var: ",t.jsx("code",{className:"text-zinc-500",children:n.envVar})]})]}),t.jsxs("div",{children:[t.jsxs("label",{className:"block text-sm font-medium text-zinc-300 mb-1.5",children:["Label ",t.jsx("span",{className:"text-zinc-600",children:"(optional)"})]}),t.jsx("input",{type:"text",value:f,onChange:O=>h(O.target.value),placeholder:"e.g. Production key, Personal key",className:"w-full rounded-lg border border-border bg-background px-4 py-2.5 text-sm text-zinc-200 focus:border-purple-500 focus:outline-none placeholder:text-zinc-600"})]}),C&&t.jsxs("div",{className:`rounded-lg border p-3 ${C.valid?"border-green-500/30 bg-green-500/5 text-green-400":"border-red-500/30 bg-red-500/5 text-red-400"}`,children:[t.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[C.valid?t.jsx(ht,{className:"h-4 w-4"}):t.jsx(Je,{className:"h-4 w-4"}),C.valid?"Key is valid":"Key validation failed"]}),t.jsx("p",{className:"mt-1 text-xs opacity-80",children:C.message}),C.models&&C.models.length>0&&t.jsxs("div",{className:"mt-2 flex flex-wrap gap-1",children:[C.models.slice(0,6).map(O=>t.jsx("span",{className:"rounded-md bg-white/5 px-2 py-0.5 text-[10px] font-mono",children:O},O)),C.models.length>6&&t.jsxs("span",{className:"rounded-md bg-white/5 px-2 py-0.5 text-[10px]",children:["+",C.models.length-6," more"]})]})]}),N&&t.jsx("div",{className:"rounded-lg border border-red-500/30 bg-red-500/5 p-3 text-sm text-red-400",children:N}),t.jsxs("a",{href:n.keyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-xs text-purple-400 hover:text-purple-300 transition-colors",children:[t.jsx($n,{className:"h-3 w-3"}),"Get API key at ",n.keyUrlLabel]})]}),t.jsxs("div",{className:"mt-6 flex items-center justify-end gap-3",children:[t.jsxs("button",{onClick:z,disabled:!o.trim()||y,className:"inline-flex items-center gap-2 rounded-lg border border-border px-4 py-2 text-sm font-medium text-zinc-300 transition-colors hover:bg-surface-hover disabled:opacity-50 disabled:cursor-not-allowed",children:[y?t.jsx(ot,{className:"h-4 w-4 animate-spin"}):t.jsx(Il,{className:"h-4 w-4"}),"Test Key"]}),t.jsxs("button",{onClick:M,disabled:!o.trim()||p,className:"inline-flex items-center gap-2 rounded-lg bg-purple-600 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-purple-700 disabled:opacity-50 disabled:cursor-not-allowed",children:[p?t.jsx(ot,{className:"h-4 w-4 animate-spin"}):t.jsx(ht,{className:"h-4 w-4"}),"Save"]})]})]})})}function hN({meta:n,entry:r,onAdd:d,onTest:o,onRemove:m,testingProvider:f,testResult:h}){const b=(r==null?void 0:r.configured)??!1,g=f===n.id,p=(h==null?void 0:h.provider)===n.id?h.result:null;return t.jsxs("div",{className:`rounded-xl border ${b?n.borderColor:"border-border"} bg-surface p-5 transition-all hover:shadow-lg hover:shadow-black/20`,children:[t.jsxs("div",{className:"flex items-start justify-between mb-3",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("span",{className:"text-2xl",children:n.emoji}),t.jsxs("div",{children:[t.jsx("h3",{className:"text-sm font-semibold text-white",children:n.name}),t.jsx("p",{className:"text-xs text-zinc-500",children:n.provider})]})]}),r&&t.jsx(xN,{entry:r})]}),b&&(r==null?void 0:r.maskedKey)&&t.jsxs("div",{className:"mb-3 rounded-lg bg-background/50 px-3 py-2",children:[t.jsx("p",{className:"font-mono text-xs text-zinc-400",children:r.maskedKey}),r.label&&r.source==="db"&&t.jsx("p",{className:"text-[10px] text-zinc-600 mt-0.5",children:r.label}),r.updatedAt&&r.source==="db"&&t.jsxs("p",{className:"text-[10px] text-zinc-600 mt-0.5",children:["Updated ",mN(r.updatedAt)]}),r.source==="env"&&t.jsxs("p",{className:"text-[10px] text-yellow-500/80 mt-0.5",children:["Set via ",t.jsx("code",{className:"font-mono",children:n.envVar})," environment variable"]})]}),p&&t.jsxs("div",{className:`mb-3 rounded-lg border p-2.5 text-xs ${p.valid?"border-green-500/20 bg-green-500/5 text-green-400":"border-red-500/20 bg-red-500/5 text-red-400"}`,children:[t.jsxs("div",{className:"flex items-center gap-1.5 font-medium",children:[p.valid?t.jsx(ht,{className:"h-3 w-3"}):t.jsx(Je,{className:"h-3 w-3"}),p.valid?"Working":"Failed"]}),t.jsx("p",{className:"mt-0.5 text-[10px] opacity-80",children:p.message}),p.models&&p.models.length>0&&t.jsxs("div",{className:"mt-1.5 flex flex-wrap gap-1",children:[p.models.slice(0,4).map(j=>t.jsx("span",{className:"rounded bg-white/5 px-1.5 py-0.5 text-[9px] font-mono",children:j},j)),p.models.length>4&&t.jsxs("span",{className:"rounded bg-white/5 px-1.5 py-0.5 text-[9px]",children:["+",p.models.length-4]})]})]}),t.jsx("div",{className:"flex items-center gap-2",children:b?t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:o,disabled:g,className:"inline-flex items-center gap-1.5 rounded-lg border border-border px-3 py-1.5 text-xs font-medium text-zinc-400 transition-colors hover:bg-surface-hover hover:text-zinc-200 disabled:opacity-50",children:[g?t.jsx(ot,{className:"h-3 w-3 animate-spin"}):t.jsx(Il,{className:"h-3 w-3"}),"Test"]}),n.needsKey&&t.jsxs("button",{onClick:d,className:"inline-flex items-center gap-1.5 rounded-lg border border-border px-3 py-1.5 text-xs font-medium text-zinc-400 transition-colors hover:bg-surface-hover hover:text-zinc-200",children:[t.jsx(ti,{className:"h-3 w-3"}),"Edit"]}),(r==null?void 0:r.source)==="db"&&t.jsxs("button",{onClick:m,className:"inline-flex items-center gap-1.5 rounded-lg border border-red-500/20 px-3 py-1.5 text-xs font-medium text-red-400 transition-colors hover:bg-red-500/10",children:[t.jsx(Mt,{className:"h-3 w-3"}),"Remove"]})]}):t.jsxs("button",{onClick:d,className:"inline-flex items-center gap-1.5 rounded-lg bg-purple-600 px-4 py-1.5 text-xs font-medium text-white transition-colors hover:bg-purple-700",children:[t.jsx(pt,{className:"h-3 w-3"}),"Add Key"]})}),t.jsx("div",{className:"mt-3 border-t border-border/50 pt-2.5",children:t.jsxs("a",{href:n.keyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-[10px] text-zinc-600 hover:text-zinc-400 transition-colors",children:[t.jsx($n,{className:"h-2.5 w-2.5"}),n.keyUrlLabel]})})]})}function pN(){const[n,r]=u.useState([]),[d,o]=u.useState(!0),[m,f]=u.useState(null),[h,b]=u.useState(null),[g,p]=u.useState(null),j=u.useCallback(async()=>{try{const N=await oa.list();r(N.data)}catch{}finally{o(!1)}},[]);u.useEffect(()=>{j()},[j]);const y=async N=>{b(N),p(null);try{const S=await oa.test(N);p({provider:N,result:S.data})}catch(S){p({provider:N,result:{valid:!1,message:S instanceof Error?S.message:"Test failed"}})}finally{b(null)}},w=async N=>{try{await oa.remove(N),await j(),(g==null?void 0:g.provider)===N&&p(null)}catch{}},C=N=>n.find(S=>S.provider===N)||null,k=n.filter(N=>N.configured).length;return d?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-purple-500 border-t-transparent"})}):t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-xl bg-purple-500/10",children:t.jsx(ti,{className:"h-5 w-5 text-purple-400"})}),t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-semibold text-white",children:"API Keys"}),t.jsx("p",{className:"text-sm text-zinc-500",children:"Manage your LLM provider credentials securely."})]})]})}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-surface px-3 py-1.5 border border-border",children:[t.jsx(Ns,{className:"h-3.5 w-3.5 text-green-400"}),t.jsxs("span",{className:"text-xs text-zinc-400",children:[k,"/",Yh.length," configured"]})]}),t.jsxs("button",{onClick:()=>{o(!0),j()},className:"inline-flex items-center gap-1.5 rounded-lg border border-border px-3 py-1.5 text-xs text-zinc-400 hover:bg-surface-hover hover:text-zinc-200 transition-colors",children:[t.jsx(Yt,{className:"h-3 w-3"}),"Refresh"]})]})]}),t.jsx("div",{className:"rounded-xl border border-border bg-surface/50 p-4",children:t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx(Ns,{className:"h-5 w-5 text-purple-400 mt-0.5 flex-shrink-0"}),t.jsxs("div",{className:"text-xs text-zinc-400 space-y-1",children:[t.jsxs("p",{children:["API keys are encrypted with AES-256-GCM and stored locally in the Nestor database. The encryption key is derived from a master secret in ",t.jsx("code",{className:"text-zinc-300",children:"~/.nestor/.vault-key"}),"."]}),t.jsx("p",{children:"Keys set via environment variables take precedence over database-stored keys."})]})]})}),t.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3",children:Yh.map(N=>t.jsx(hN,{meta:N,entry:C(N.id),onAdd:()=>f(N),onTest:()=>y(N.id),onRemove:()=>w(N.id),testingProvider:h,testResult:g},N.id))}),m&&t.jsx(fN,{provider:m,onClose:()=>f(null),onSaved:()=>{f(null),j()}})]})}const Ad=[{id:"gemini",name:"Gemini",provider:"Google",description:"Multimodal AI with large context window",defaultModel:"gemini-2.5-flash",keyUrl:"https://aistudio.google.com/apikey",keyUrlLabel:"aistudio.google.com",emoji:"🔵",needsApiKey:!0},{id:"claude",name:"Claude",provider:"Anthropic",description:"Best for reasoning, analysis, and code generation",defaultModel:"claude-sonnet-4-6",keyUrl:"https://console.anthropic.com/settings/keys",keyUrlLabel:"console.anthropic.com",emoji:"🟣",needsApiKey:!0},{id:"openai",name:"GPT-4o",provider:"OpenAI",description:"Versatile model with strong general capabilities",defaultModel:"gpt-4o",keyUrl:"https://platform.openai.com/api-keys",keyUrlLabel:"platform.openai.com",emoji:"🟢",needsApiKey:!0},{id:"grok",name:"Grok",provider:"xAI",description:"Real-time knowledge with web access",defaultModel:"grok-3",keyUrl:"https://console.x.ai/",keyUrlLabel:"console.x.ai",emoji:"⚪",needsApiKey:!0},{id:"mistral",name:"Mistral",provider:"Mistral AI",description:"Efficient European AI with strong multilingual support",defaultModel:"mistral-large-latest",keyUrl:"https://console.mistral.ai/api-keys",keyUrlLabel:"console.mistral.ai",emoji:"🟠",needsApiKey:!0},{id:"ollama",name:"Ollama",provider:"Local",description:"Run open-source models locally, no API key needed",defaultModel:"llama3.1",keyUrl:"https://ollama.ai/download",keyUrlLabel:"ollama.ai",emoji:"🦙",needsApiKey:!1,note:"Free, runs on your machine"}];function gN(){var Z;const n=Rt(),[r,d]=u.useState(0),[o,m]=u.useState("gemini"),[f,h]=u.useState("gemini-2.5-flash"),[b,g]=u.useState(""),[p,j]=u.useState(!1),[y,w]=u.useState({}),[C,k]=u.useState(!0),[N,S]=u.useState(!1),[z,M]=u.useState(null),[O,E]=u.useState("my-agent"),[ae,ce]=u.useState("My first Nestor agent"),[H,G]=u.useState(!1),[P,W]=u.useState("");u.useEffect(()=>{Eh.status().then(ne=>{w(ne.data)}).catch(()=>{}).finally(()=>k(!1))},[]);const Q=u.useCallback(ne=>{m(ne);const xe=Ad.find(T=>T.id===ne);xe&&h(xe.defaultModel),g(""),j(!1),M(null)},[]),le=u.useCallback(()=>{d(ne=>Math.min(ne+1,2))},[]),F=u.useCallback(()=>{d(ne=>Math.max(ne-1,0))},[]),re=Ad.find(ne=>ne.id===o),he=((Z=y[o])==null?void 0:Z.configured)??!1,K=u.useCallback(async()=>{S(!0),M(null);try{const ne=await Eh.test({provider:o,apiKey:b.trim()||void 0,model:f});M(ne)}catch(ne){M({success:!1,message:ne instanceof Error?ne.message:"Connection test failed"})}finally{S(!1)}},[o,b,f]),_=u.useCallback(async()=>{if(!O.trim()){W("Please enter an agent name.");return}G(!0),W("");try{b.trim()&&(re!=null&&re.needsApiKey)&&await oa.set(o,b.trim(),"Onboarding key"),await ws.create({name:O.trim(),description:ae.trim()||void 0,adapterType:o,adapterConfig:{model:f},trustLevel:"trusted"}),localStorage.setItem("nestor_onboarding_complete","true"),n("/chat")}catch(ne){W(ne instanceof Error?ne.message:"Failed to create agent")}finally{G(!1)}},[O,ae,o,f,b,re,n]);return t.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:t.jsxs("div",{className:"w-full max-w-2xl",children:[t.jsx("div",{className:"flex items-center justify-center gap-2 mb-8",children:[0,1,2].map(ne=>t.jsx("div",{className:`h-1.5 rounded-full transition-all duration-500 ${ne===r?"w-10 bg-purple-500":ne<r?"w-10 bg-purple-500/40":"w-10 bg-zinc-700"}`},ne))}),t.jsx("div",{className:"relative overflow-hidden",children:t.jsxs("div",{className:"transition-all duration-500 ease-out",style:{transform:`translateX(${-r*100}%)`,width:"300%",display:"flex"},children:[t.jsx("div",{className:"w-1/3 flex-shrink-0 px-4",children:t.jsxs("div",{className:`text-center transition-opacity duration-300 ${r===0?"opacity-100":"opacity-0 pointer-events-none"}`,children:[t.jsx("div",{className:"flex justify-center mb-6",children:t.jsx("div",{className:"flex h-20 w-20 items-center justify-center rounded-2xl bg-purple-600 text-white shadow-lg shadow-purple-500/30",children:t.jsx(qa,{className:"h-10 w-10"})})}),t.jsx("h1",{className:"text-4xl font-bold text-white mb-3",children:"Welcome to Nestor"}),t.jsx("p",{className:"text-zinc-400 text-lg mb-2",children:"Your AI agent platform is ready."}),t.jsx("p",{className:"text-zinc-500 mb-12",children:"Let's create your first agent in 30 seconds."}),t.jsxs("button",{onClick:le,className:"inline-flex items-center gap-2 px-8 py-3.5 bg-purple-600 hover:bg-purple-700 text-white rounded-xl font-medium transition-all text-lg shadow-lg shadow-purple-500/25 hover:shadow-purple-500/40 hover:scale-[1.02] active:scale-[0.98]",children:["Get Started",t.jsx(aa,{className:"h-5 w-5"})]})]})}),t.jsx("div",{className:"w-1/3 flex-shrink-0 px-4",children:t.jsxs("div",{className:`transition-opacity duration-300 ${r===1?"opacity-100":"opacity-0 pointer-events-none"}`,children:[t.jsx("h2",{className:"text-2xl font-bold text-white mb-1 text-center",children:"Choose your AI provider"}),t.jsx("p",{className:"text-zinc-500 mb-6 text-center text-sm",children:"Select which LLM to power your agent"}),t.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3 mb-6",children:Ad.map(ne=>{var X;const xe=o===ne.id,T=((X=y[ne.id])==null?void 0:X.configured)??!1;return t.jsxs("button",{onClick:()=>Q(ne.id),className:`relative text-left p-4 rounded-xl border-2 transition-all duration-200 hover:scale-[1.02] ${xe?"border-purple-500 bg-purple-500/10 shadow-lg shadow-purple-500/10":"border-border bg-surface hover:border-zinc-600 hover:bg-surface-hover"}`,children:[T&&t.jsx("span",{className:"absolute top-2 right-2 text-green-400",title:"API key configured",children:t.jsx(ht,{className:"h-3.5 w-3.5"})}),t.jsx("div",{className:"text-lg mb-1",children:ne.emoji}),t.jsx("div",{className:"font-semibold text-sm text-zinc-100",children:ne.name}),t.jsx("div",{className:"text-[11px] text-zinc-500",children:ne.provider}),ne.note&&t.jsx("div",{className:"text-[10px] text-green-400/80 mt-1",children:ne.note}),ne.needsApiKey&&t.jsxs("a",{href:ne.keyUrl,target:"_blank",rel:"noopener noreferrer",onClick:ie=>ie.stopPropagation(),className:"inline-flex items-center gap-1 text-[10px] text-purple-400 hover:text-purple-300 mt-1.5 transition-colors",children:["Get API Key ",t.jsx($n,{className:"h-2.5 w-2.5"})]})]},ne.id)})}),t.jsxs("div",{className:"space-y-3",children:[(re==null?void 0:re.needsApiKey)&&t.jsxs("div",{children:[t.jsxs("label",{className:"block text-sm font-medium text-zinc-300 mb-1.5",children:["API Key",he&&t.jsxs("span",{className:"ml-2 text-xs text-green-400 font-normal",children:[t.jsx(ht,{className:"inline h-3 w-3 mr-0.5"}),"Already configured"]})]}),he?t.jsx("p",{className:"text-xs text-zinc-500 mb-2",children:"Your API key is already set. You can skip this field or enter a new key to update it."}):null,t.jsxs("div",{className:"relative",children:[t.jsx("input",{type:p?"text":"password",value:b,onChange:ne=>{g(ne.target.value),M(null)},className:"w-full bg-background border border-border rounded-lg px-3 py-2.5 pr-10 text-sm text-zinc-200 focus:outline-none focus:border-purple-500 placeholder-zinc-600 transition-colors",placeholder:`Enter your ${re.provider} API key`}),t.jsx("button",{type:"button",onClick:()=>j(!p),className:"absolute right-3 top-1/2 -translate-y-1/2 text-zinc-500 hover:text-zinc-300 transition-colors",children:p?t.jsx(Qd,{className:"h-4 w-4"}):t.jsx(Vr,{className:"h-4 w-4"})})]}),t.jsx("div",{className:"flex items-center justify-between mt-1.5",children:t.jsxs("a",{href:re.keyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-purple-400 hover:text-purple-300 transition-colors",children:["Get your API key ",t.jsx($n,{className:"h-3 w-3"})]})})]}),o==="ollama"&&t.jsxs("div",{className:"bg-surface border border-border rounded-lg p-4",children:[t.jsx("p",{className:"text-sm text-zinc-300 font-medium mb-1",children:"No API key needed"}),t.jsxs("p",{className:"text-xs text-zinc-400",children:["Make sure Ollama is running on ",t.jsx("code",{className:"text-zinc-300",children:"localhost:11434"})]}),t.jsxs("a",{href:"https://ollama.ai/download",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-purple-400 hover:text-purple-300 mt-2 transition-colors",children:["Download Ollama ",t.jsx($n,{className:"h-3 w-3"})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-zinc-300 mb-1",children:"Model"}),t.jsx("input",{type:"text",value:f,onChange:ne=>h(ne.target.value),className:"w-full bg-background border border-border rounded-lg px-3 py-2 text-sm text-zinc-200 focus:outline-none focus:border-purple-500 placeholder-zinc-600 transition-colors",placeholder:"e.g. gemini-2.5-flash"})]}),t.jsx("button",{onClick:K,disabled:N||!b.trim()&&(re==null?void 0:re.needsApiKey)&&!he,className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 rounded-lg border border-border text-sm font-medium text-zinc-300 transition-all hover:bg-surface-hover hover:text-white disabled:opacity-40 disabled:cursor-not-allowed",children:N?t.jsxs(t.Fragment,{children:[t.jsx(ot,{className:"h-4 w-4 animate-spin"}),"Testing connection..."]}):t.jsxs(t.Fragment,{children:[t.jsx(Il,{className:"h-4 w-4"}),"Test Connection"]})}),z&&t.jsx("div",{className:`rounded-lg border p-3 text-sm transition-all ${z.success?"border-green-500/30 bg-green-500/5 text-green-400":"border-red-500/30 bg-red-500/5 text-red-400"}`,children:t.jsxs("div",{className:"flex items-center gap-2 font-medium",children:[z.success?t.jsx(ht,{className:"h-4 w-4"}):t.jsx(Fl,{className:"h-4 w-4"}),z.message]})})]}),t.jsxs("div",{className:"flex justify-between mt-8",children:[t.jsxs("button",{onClick:F,className:"flex items-center gap-1 px-4 py-2 text-sm text-zinc-400 hover:text-zinc-200 transition-colors",children:[t.jsx(Sh,{className:"h-4 w-4"}),"Back"]}),t.jsxs("button",{onClick:le,className:"flex items-center gap-2 px-6 py-2.5 bg-purple-600 hover:bg-purple-700 text-white rounded-xl font-medium transition-all text-sm hover:shadow-lg hover:shadow-purple-500/20",children:["Continue",t.jsx(aa,{className:"h-4 w-4"})]})]})]})}),t.jsx("div",{className:"w-1/3 flex-shrink-0 px-4",children:t.jsxs("div",{className:`transition-opacity duration-300 ${r===2?"opacity-100":"opacity-0 pointer-events-none"}`,children:[t.jsx("h2",{className:"text-2xl font-bold text-white mb-1 text-center",children:"Name your agent"}),t.jsx("p",{className:"text-zinc-500 mb-6 text-center text-sm",children:"Almost there! Give your agent a name."}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-zinc-300 mb-1",children:"Agent name"}),t.jsx("input",{type:"text",value:O,onChange:ne=>E(ne.target.value),className:"w-full bg-background border border-border rounded-lg px-3 py-2.5 text-sm text-zinc-200 focus:outline-none focus:border-purple-500 placeholder-zinc-600 transition-colors",placeholder:"e.g. my-agent"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-zinc-300 mb-1",children:"Description"}),t.jsx("textarea",{value:ae,onChange:ne=>ce(ne.target.value),rows:2,className:"w-full bg-background border border-border rounded-lg px-3 py-2.5 text-sm text-zinc-200 focus:outline-none focus:border-purple-500 placeholder-zinc-600 resize-none transition-colors",placeholder:"What does this agent do?"})]}),t.jsxs("div",{className:"bg-surface border border-border rounded-xl p-4",children:[t.jsx("p",{className:"text-xs text-zinc-500 mb-2 font-medium uppercase tracking-wider",children:"Summary"}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsxs("p",{className:"text-sm text-zinc-300",children:[t.jsx("span",{className:"text-zinc-500",children:"Agent:"})," ",t.jsx("span",{className:"font-medium text-zinc-100",children:O||"—"})]}),t.jsxs("p",{className:"text-sm text-zinc-300",children:[t.jsx("span",{className:"text-zinc-500",children:"Provider:"})," ",t.jsx("span",{className:"text-purple-400",children:re==null?void 0:re.name})," ",t.jsxs("span",{className:"text-zinc-500",children:["(",f,")"]})]}),b.trim()&&(re==null?void 0:re.needsApiKey)&&t.jsxs("p",{className:"text-sm text-zinc-300",children:[t.jsx("span",{className:"text-zinc-500",children:"API Key:"})," ",t.jsx("span",{className:"text-green-400",children:"Will be saved securely"})]})]})]}),P&&t.jsxs("div",{className:"flex items-center gap-2 text-sm text-red-400",children:[t.jsx(Fl,{className:"h-4 w-4 flex-shrink-0"}),P]})]}),t.jsxs("div",{className:"flex justify-between mt-8",children:[t.jsxs("button",{onClick:F,className:"flex items-center gap-1 px-4 py-2 text-sm text-zinc-400 hover:text-zinc-200 transition-colors",children:[t.jsx(Sh,{className:"h-4 w-4"}),"Back"]}),t.jsx("button",{onClick:_,disabled:H||!O.trim(),className:"flex items-center gap-2 px-6 py-2.5 bg-purple-600 hover:bg-purple-700 disabled:opacity-50 disabled:cursor-not-allowed text-white rounded-xl font-medium transition-all text-sm shadow-lg shadow-purple-500/20 hover:shadow-purple-500/40 hover:scale-[1.02] active:scale-[0.98]",children:H?t.jsxs(t.Fragment,{children:[t.jsx(ot,{className:"h-4 w-4 animate-spin"}),"Creating..."]}):t.jsxs(t.Fragment,{children:["Create & Start Chatting",t.jsx(aa,{className:"h-4 w-4"})]})})]})]})})]})}),t.jsx("div",{className:"text-center mt-12",children:t.jsx("p",{className:"text-xs text-zinc-600",children:"You can always add more agents and change settings later."})})]})})}function bN({children:n}){const[r,d]=u.useState(!1),o=Rt(),m=da();return u.useEffect(()=>{if(m.pathname==="/onboarding"){d(!0);return}if(localStorage.getItem("nestor_onboarding_complete")==="true"||localStorage.getItem("nestor_onboarded")==="true"){d(!0);return}ws.list().then(f=>{!f.data||f.data.length===0?o("/onboarding"):localStorage.setItem("nestor_onboarding_complete","true"),d(!0)}).catch(()=>d(!0))},[m.pathname,o]),r?t.jsx(t.Fragment,{children:n}):t.jsx("div",{className:"flex items-center justify-center h-screen bg-background",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-2 border-purple-500 border-t-transparent"})})}function $e(n){return t.jsx(lj,{fallback:t.jsx(ij,{}),children:n})}function yN(){const{user:n,loading:r}=ai();return r?t.jsx("div",{className:"flex h-screen items-center justify-center bg-background text-zinc-400",children:"Loading..."}):n?t.jsx(bN,{children:t.jsxs(l0,{children:[t.jsx(Ee,{path:"/onboarding",element:t.jsx(gN,{})}),t.jsxs(Ee,{element:t.jsx(nj,{}),children:[t.jsx(Ee,{path:"/",element:t.jsx(Nh,{to:"/missions",replace:!0})}),t.jsx(Ee,{path:"/missions",element:$e(t.jsx(uN,{}))}),t.jsx(Ee,{path:"/chat",element:$e(t.jsx(sN,{}))}),t.jsx(Ee,{path:"/dashboard",element:$e(t.jsx(dj,{}))}),t.jsx(Ee,{path:"/agents",element:$e(t.jsx(pj,{}))}),t.jsx(Ee,{path:"/agents/:id",element:$e(t.jsx(Nj,{}))}),t.jsx(Ee,{path:"/agents/:id/prompts",element:$e(t.jsx(d1,{}))}),t.jsx(Ee,{path:"/agents/:id/memory-store",element:$e(t.jsx(B1,{}))}),t.jsx(Ee,{path:"/workflows",element:$e(t.jsx(kj,{}))}),t.jsx(Ee,{path:"/workflows/:id/edit",element:$e(t.jsx(Cj,{}))}),t.jsx(Ee,{path:"/skills",element:$e(t.jsx(Tj,{}))}),t.jsx(Ee,{path:"/runs",element:$e(t.jsx(Rj,{}))}),t.jsx(Ee,{path:"/runs/:id",element:$e(t.jsx(qj,{}))}),t.jsx(Ee,{path:"/goals",element:$e(t.jsx(S1,{}))}),t.jsx(Ee,{path:"/approvals",element:$e(t.jsx(Xj,{}))}),t.jsx(Ee,{path:"/handoffs",element:$e(t.jsx(k1,{}))}),t.jsx(Ee,{path:"/analytics",element:$e(t.jsx(s1,{}))}),t.jsx(Ee,{path:"/budget",element:$e(t.jsx(y1,{}))}),t.jsx(Ee,{path:"/traces",element:$e(t.jsx(c1,{}))}),t.jsx(Ee,{path:"/memory",element:$e(t.jsx(f1,{}))}),t.jsx(Ee,{path:"/users",element:$e(t.jsx(o1,{}))}),t.jsx(Ee,{path:"/plans",element:$e(t.jsx(T1,{}))}),t.jsx(Ee,{path:"/plans/:id",element:$e(t.jsx(R1,{}))}),t.jsx(Ee,{path:"/guardrails",element:$e(t.jsx(U1,{}))}),t.jsx(Ee,{path:"/admin",element:$e(t.jsx(J1,{}))}),t.jsx(Ee,{path:"/settings",element:$e(t.jsx(Gj,{}))}),t.jsx(Ee,{path:"/keys",element:$e(t.jsx(pN,{}))}),t.jsx(Ee,{path:"*",element:t.jsx(Nh,{to:"/missions",replace:!0})})]})]})}):t.jsx(T0,{})}function vN(){return t.jsx(Ov,{children:t.jsx(Bv,{children:t.jsxs(l0,{children:[t.jsx(Ee,{path:"/login",element:t.jsx(T0,{})}),t.jsx(Ee,{path:"/*",element:t.jsx(yN,{})})]})})})}const H0=document.getElementById("root");if(!H0)throw new Error("Root element not found");gb.createRoot(H0).render(t.jsx(u.StrictMode,{children:t.jsx(qy,{children:t.jsx(vN,{})})}));
|
|
594
|
-
//# sourceMappingURL=index-B6rRdi4P.js.map
|