524 lines
840 KiB
JavaScript
524 lines
840 KiB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/window-DQYDsu7Z.js","assets/core-DhEqZVGG.js"])))=>i.map(i=>d[i]);
|
||
var s2=Object.defineProperty;var i2=(e,a,r)=>a in e?s2(e,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[a]=r;var _t=(e,a,r)=>i2(e,typeof a!="symbol"?a+"":a,r);(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))i(c);new MutationObserver(c=>{for(const d of c)if(d.type==="childList")for(const u of d.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function r(c){const d={};return c.integrity&&(d.integrity=c.integrity),c.referrerPolicy&&(d.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?d.credentials="include":c.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function i(c){if(c.ep)return;c.ep=!0;const d=r(c);fetch(c.href,d)}})();function Ic(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var pf={exports:{}},ci={};/**
|
||
* @license React
|
||
* react-jsx-runtime.production.js
|
||
*
|
||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var dy;function o2(){if(dy)return ci;dy=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function r(i,c,d){var u=null;if(d!==void 0&&(u=""+d),c.key!==void 0&&(u=""+c.key),"key"in c){d={};for(var m in c)m!=="key"&&(d[m]=c[m])}else d=c;return c=d.ref,{$$typeof:e,type:i,key:u,ref:c!==void 0?c:null,props:d}}return ci.Fragment=a,ci.jsx=r,ci.jsxs=r,ci}var fy;function c2(){return fy||(fy=1,pf.exports=o2()),pf.exports}var l=c2(),mf={exports:{}},qe={};/**
|
||
* @license React
|
||
* react.production.js
|
||
*
|
||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var py;function u2(){if(py)return qe;py=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),u=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),v=Symbol.iterator;function k(z){return z===null||typeof z!="object"?null:(z=v&&z[v]||z["@@iterator"],typeof z=="function"?z:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,j={};function C(z,K,E){this.props=z,this.context=K,this.refs=j,this.updater=E||w}C.prototype.isReactComponent={},C.prototype.setState=function(z,K){if(typeof z!="object"&&typeof z!="function"&&z!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,z,K,"setState")},C.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function $(){}$.prototype=C.prototype;function M(z,K,E){this.props=z,this.context=K,this.refs=j,this.updater=E||w}var ee=M.prototype=new $;ee.constructor=M,T(ee,C.prototype),ee.isPureReactComponent=!0;var ne=Array.isArray;function A(){}var G={H:null,A:null,T:null,S:null},V=Object.prototype.hasOwnProperty;function oe(z,K,E){var pe=E.ref;return{$$typeof:e,type:z,key:K,ref:pe!==void 0?pe:null,props:E}}function Y(z,K){return oe(z.type,K,z.props)}function F(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function I(z){var K={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(E){return K[E]})}var Q=/\/+/g;function le(z,K){return typeof z=="object"&&z!==null&&z.key!=null?I(""+z.key):K.toString(36)}function B(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(A,A):(z.status="pending",z.then(function(K){z.status==="pending"&&(z.status="fulfilled",z.value=K)},function(K){z.status==="pending"&&(z.status="rejected",z.reason=K)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function L(z,K,E,pe,ke){var ve=typeof z;(ve==="undefined"||ve==="boolean")&&(z=null);var ze=!1;if(z===null)ze=!0;else switch(ve){case"bigint":case"string":case"number":ze=!0;break;case"object":switch(z.$$typeof){case e:case a:ze=!0;break;case y:return ze=z._init,L(ze(z._payload),K,E,pe,ke)}}if(ze)return ke=ke(z),ze=pe===""?"."+le(z,0):pe,ne(ke)?(E="",ze!=null&&(E=ze.replace(Q,"$&/")+"/"),L(ke,K,E,"",function(U){return U})):ke!=null&&(F(ke)&&(ke=Y(ke,E+(ke.key==null||z&&z.key===ke.key?"":(""+ke.key).replace(Q,"$&/")+"/")+ze)),K.push(ke)),1;ze=0;var me=pe===""?".":pe+":";if(ne(z))for(var D=0;D<z.length;D++)pe=z[D],ve=me+le(pe,D),ze+=L(pe,K,E,ve,ke);else if(D=k(z),typeof D=="function")for(z=D.call(z),D=0;!(pe=z.next()).done;)pe=pe.value,ve=me+le(pe,D++),ze+=L(pe,K,E,ve,ke);else if(ve==="object"){if(typeof z.then=="function")return L(B(z),K,E,pe,ke);throw K=String(z),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.")}return ze}function q(z,K,E){if(z==null)return z;var pe=[],ke=0;return L(z,pe,"","",function(ve){return K.call(E,ve,ke++)}),pe}function ce(z){if(z._status===-1){var K=z._result;K=K(),K.then(function(E){(z._status===0||z._status===-1)&&(z._status=1,z._result=E)},function(E){(z._status===0||z._status===-1)&&(z._status=2,z._result=E)}),z._status===-1&&(z._status=0,z._result=K)}if(z._status===1)return z._result.default;throw z._result}var ge=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var K=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent(K))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)},N={map:q,forEach:function(z,K,E){q(z,function(){K.apply(this,arguments)},E)},count:function(z){var K=0;return q(z,function(){K++}),K},toArray:function(z){return q(z,function(K){return K})||[]},only:function(z){if(!F(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return qe.Activity=x,qe.Children=N,qe.Component=C,qe.Fragment=r,qe.Profiler=c,qe.PureComponent=M,qe.StrictMode=i,qe.Suspense=p,qe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=G,qe.__COMPILER_RUNTIME={__proto__:null,c:function(z){return G.H.useMemoCache(z)}},qe.cache=function(z){return function(){return z.apply(null,arguments)}},qe.cacheSignal=function(){return null},qe.cloneElement=function(z,K,E){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var pe=T({},z.props),ke=z.key;if(K!=null)for(ve in K.key!==void 0&&(ke=""+K.key),K)!V.call(K,ve)||ve==="key"||ve==="__self"||ve==="__source"||ve==="ref"&&K.ref===void 0||(pe[ve]=K[ve]);var ve=arguments.length-2;if(ve===1)pe.children=E;else if(1<ve){for(var ze=Array(ve),me=0;me<ve;me++)ze[me]=arguments[me+2];pe.children=ze}return oe(z.type,ke,pe)},qe.createContext=function(z){return z={$$typeof:u,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:d,_context:z},z},qe.createElement=function(z,K,E){var pe,ke={},ve=null;if(K!=null)for(pe in K.key!==void 0&&(ve=""+K.key),K)V.call(K,pe)&&pe!=="key"&&pe!=="__self"&&pe!=="__source"&&(ke[pe]=K[pe]);var ze=arguments.length-2;if(ze===1)ke.children=E;else if(1<ze){for(var me=Array(ze),D=0;D<ze;D++)me[D]=arguments[D+2];ke.children=me}if(z&&z.defaultProps)for(pe in ze=z.defaultProps,ze)ke[pe]===void 0&&(ke[pe]=ze[pe]);return oe(z,ve,ke)},qe.createRef=function(){return{current:null}},qe.forwardRef=function(z){return{$$typeof:m,render:z}},qe.isValidElement=F,qe.lazy=function(z){return{$$typeof:y,_payload:{_status:-1,_result:z},_init:ce}},qe.memo=function(z,K){return{$$typeof:h,type:z,compare:K===void 0?null:K}},qe.startTransition=function(z){var K=G.T,E={};G.T=E;try{var pe=z(),ke=G.S;ke!==null&&ke(E,pe),typeof pe=="object"&&pe!==null&&typeof pe.then=="function"&&pe.then(A,ge)}catch(ve){ge(ve)}finally{K!==null&&E.types!==null&&(K.types=E.types),G.T=K}},qe.unstable_useCacheRefresh=function(){return G.H.useCacheRefresh()},qe.use=function(z){return G.H.use(z)},qe.useActionState=function(z,K,E){return G.H.useActionState(z,K,E)},qe.useCallback=function(z,K){return G.H.useCallback(z,K)},qe.useContext=function(z){return G.H.useContext(z)},qe.useDebugValue=function(){},qe.useDeferredValue=function(z,K){return G.H.useDeferredValue(z,K)},qe.useEffect=function(z,K){return G.H.useEffect(z,K)},qe.useEffectEvent=function(z){return G.H.useEffectEvent(z)},qe.useId=function(){return G.H.useId()},qe.useImperativeHandle=function(z,K,E){return G.H.useImperativeHandle(z,K,E)},qe.useInsertionEffect=function(z,K){return G.H.useInsertionEffect(z,K)},qe.useLayoutEffect=function(z,K){return G.H.useLayoutEffect(z,K)},qe.useMemo=function(z,K){return G.H.useMemo(z,K)},qe.useOptimistic=function(z,K){return G.H.useOptimistic(z,K)},qe.useReducer=function(z,K,E){return G.H.useReducer(z,K,E)},qe.useRef=function(z){return G.H.useRef(z)},qe.useState=function(z){return G.H.useState(z)},qe.useSyncExternalStore=function(z,K,E){return G.H.useSyncExternalStore(z,K,E)},qe.useTransition=function(){return G.H.useTransition()},qe.version="19.2.4",qe}var my;function Lp(){return my||(my=1,mf.exports=u2()),mf.exports}var b=Lp();const $p=Ic(b);var hf={exports:{}},ui={},gf={exports:{}},xf={};/**
|
||
* @license React
|
||
* scheduler.production.js
|
||
*
|
||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var hy;function d2(){return hy||(hy=1,(function(e){function a(L,q){var ce=L.length;L.push(q);e:for(;0<ce;){var ge=ce-1>>>1,N=L[ge];if(0<c(N,q))L[ge]=q,L[ce]=N,ce=ge;else break e}}function r(L){return L.length===0?null:L[0]}function i(L){if(L.length===0)return null;var q=L[0],ce=L.pop();if(ce!==q){L[0]=ce;e:for(var ge=0,N=L.length,z=N>>>1;ge<z;){var K=2*(ge+1)-1,E=L[K],pe=K+1,ke=L[pe];if(0>c(E,ce))pe<N&&0>c(ke,E)?(L[ge]=ke,L[pe]=ce,ge=pe):(L[ge]=E,L[K]=ce,ge=K);else if(pe<N&&0>c(ke,ce))L[ge]=ke,L[pe]=ce,ge=pe;else break e}}return q}function c(L,q){var ce=L.sortIndex-q.sortIndex;return ce!==0?ce:L.id-q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;e.unstable_now=function(){return d.now()}}else{var u=Date,m=u.now();e.unstable_now=function(){return u.now()-m}}var p=[],h=[],y=1,x=null,v=3,k=!1,w=!1,T=!1,j=!1,C=typeof setTimeout=="function"?setTimeout:null,$=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function ee(L){for(var q=r(h);q!==null;){if(q.callback===null)i(h);else if(q.startTime<=L)i(h),q.sortIndex=q.expirationTime,a(p,q);else break;q=r(h)}}function ne(L){if(T=!1,ee(L),!w)if(r(p)!==null)w=!0,A||(A=!0,I());else{var q=r(h);q!==null&&B(ne,q.startTime-L)}}var A=!1,G=-1,V=5,oe=-1;function Y(){return j?!0:!(e.unstable_now()-oe<V)}function F(){if(j=!1,A){var L=e.unstable_now();oe=L;var q=!0;try{e:{w=!1,T&&(T=!1,$(G),G=-1),k=!0;var ce=v;try{t:{for(ee(L),x=r(p);x!==null&&!(x.expirationTime>L&&Y());){var ge=x.callback;if(typeof ge=="function"){x.callback=null,v=x.priorityLevel;var N=ge(x.expirationTime<=L);if(L=e.unstable_now(),typeof N=="function"){x.callback=N,ee(L),q=!0;break t}x===r(p)&&i(p),ee(L)}else i(p);x=r(p)}if(x!==null)q=!0;else{var z=r(h);z!==null&&B(ne,z.startTime-L),q=!1}}break e}finally{x=null,v=ce,k=!1}q=void 0}}finally{q?I():A=!1}}}var I;if(typeof M=="function")I=function(){M(F)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,le=Q.port2;Q.port1.onmessage=F,I=function(){le.postMessage(null)}}else I=function(){C(F,0)};function B(L,q){G=C(function(){L(e.unstable_now())},q)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(L){L.callback=null},e.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):V=0<L?Math.floor(1e3/L):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(L){switch(v){case 1:case 2:case 3:var q=3;break;default:q=v}var ce=v;v=q;try{return L()}finally{v=ce}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(L,q){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var ce=v;v=L;try{return q()}finally{v=ce}},e.unstable_scheduleCallback=function(L,q,ce){var ge=e.unstable_now();switch(typeof ce=="object"&&ce!==null?(ce=ce.delay,ce=typeof ce=="number"&&0<ce?ge+ce:ge):ce=ge,L){case 1:var N=-1;break;case 2:N=250;break;case 5:N=1073741823;break;case 4:N=1e4;break;default:N=5e3}return N=ce+N,L={id:y++,callback:q,priorityLevel:L,startTime:ce,expirationTime:N,sortIndex:-1},ce>ge?(L.sortIndex=ce,a(h,L),r(p)===null&&L===r(h)&&(T?($(G),G=-1):T=!0,B(ne,ce-ge))):(L.sortIndex=N,a(p,L),w||k||(w=!0,A||(A=!0,I()))),L},e.unstable_shouldYield=Y,e.unstable_wrapCallback=function(L){var q=v;return function(){var ce=v;v=q;try{return L.apply(this,arguments)}finally{v=ce}}}})(xf)),xf}var gy;function f2(){return gy||(gy=1,gf.exports=d2()),gf.exports}var yf={exports:{}},tn={};/**
|
||
* @license React
|
||
* react-dom.production.js
|
||
*
|
||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var xy;function p2(){if(xy)return tn;xy=1;var e=Lp();function a(p){var h="https://react.dev/errors/"+p;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+p+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var i={d:{f:r,r:function(){throw Error(a(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},c=Symbol.for("react.portal");function d(p,h,y){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:x==null?null:""+x,children:p,containerInfo:h,implementation:y}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(p,h){if(p==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return tn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,tn.createPortal=function(p,h){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(a(299));return d(p,h,null,y)},tn.flushSync=function(p){var h=u.T,y=i.p;try{if(u.T=null,i.p=2,p)return p()}finally{u.T=h,i.p=y,i.d.f()}},tn.preconnect=function(p,h){typeof p=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,i.d.C(p,h))},tn.prefetchDNS=function(p){typeof p=="string"&&i.d.D(p)},tn.preinit=function(p,h){if(typeof p=="string"&&h&&typeof h.as=="string"){var y=h.as,x=m(y,h.crossOrigin),v=typeof h.integrity=="string"?h.integrity:void 0,k=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?i.d.S(p,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:x,integrity:v,fetchPriority:k}):y==="script"&&i.d.X(p,{crossOrigin:x,integrity:v,fetchPriority:k,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},tn.preinitModule=function(p,h){if(typeof p=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var y=m(h.as,h.crossOrigin);i.d.M(p,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&i.d.M(p)},tn.preload=function(p,h){if(typeof p=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var y=h.as,x=m(y,h.crossOrigin);i.d.L(p,y,{crossOrigin:x,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},tn.preloadModule=function(p,h){if(typeof p=="string")if(h){var y=m(h.as,h.crossOrigin);i.d.m(p,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else i.d.m(p)},tn.requestFormReset=function(p){i.d.r(p)},tn.unstable_batchedUpdates=function(p,h){return p(h)},tn.useFormState=function(p,h,y){return u.H.useFormState(p,h,y)},tn.useFormStatus=function(){return u.H.useHostTransitionStatus()},tn.version="19.2.4",tn}var yy;function vv(){if(yy)return yf.exports;yy=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(a){console.error(a)}}return e(),yf.exports=p2(),yf.exports}/**
|
||
* @license React
|
||
* react-dom-client.production.js
|
||
*
|
||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var by;function m2(){if(by)return ui;by=1;var e=f2(),a=Lp(),r=vv();function i(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)n+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function d(t){var n=t,s=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(s=n.return),t=n.return;while(t)}return n.tag===3?s:null}function u(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function m(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function p(t){if(d(t)!==t)throw Error(i(188))}function h(t){var n=t.alternate;if(!n){if(n=d(t),n===null)throw Error(i(188));return n!==t?null:t}for(var s=t,o=n;;){var f=s.return;if(f===null)break;var g=f.alternate;if(g===null){if(o=f.return,o!==null){s=o;continue}break}if(f.child===g.child){for(g=f.child;g;){if(g===s)return p(f),t;if(g===o)return p(f),n;g=g.sibling}throw Error(i(188))}if(s.return!==o.return)s=f,o=g;else{for(var _=!1,S=f.child;S;){if(S===s){_=!0,s=f,o=g;break}if(S===o){_=!0,o=f,s=g;break}S=S.sibling}if(!_){for(S=g.child;S;){if(S===s){_=!0,s=g,o=f;break}if(S===o){_=!0,o=g,s=f;break}S=S.sibling}if(!_)throw Error(i(189))}}if(s.alternate!==o)throw Error(i(190))}if(s.tag!==3)throw Error(i(188));return s.stateNode.current===s?t:n}function y(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=y(t),n!==null)return n;t=t.sibling}return null}var x=Object.assign,v=Symbol.for("react.element"),k=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),$=Symbol.for("react.consumer"),M=Symbol.for("react.context"),ee=Symbol.for("react.forward_ref"),ne=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),oe=Symbol.for("react.activity"),Y=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function I(t){return t===null||typeof t!="object"?null:(t=F&&t[F]||t["@@iterator"],typeof t=="function"?t:null)}var Q=Symbol.for("react.client.reference");function le(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Q?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case T:return"Fragment";case C:return"Profiler";case j:return"StrictMode";case ne:return"Suspense";case A:return"SuspenseList";case oe:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case w:return"Portal";case M:return t.displayName||"Context";case $:return(t._context.displayName||"Context")+".Consumer";case ee:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case G:return n=t.displayName||null,n!==null?n:le(t.type)||"Memo";case V:n=t._payload,t=t._init;try{return le(t(n))}catch{}}return null}var B=Array.isArray,L=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},ge=[],N=-1;function z(t){return{current:t}}function K(t){0>N||(t.current=ge[N],ge[N]=null,N--)}function E(t,n){N++,ge[N]=t.current,t.current=n}var pe=z(null),ke=z(null),ve=z(null),ze=z(null);function me(t,n){switch(E(ve,n),E(ke,t),E(pe,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?Rx(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=Rx(n),t=Ox(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}K(pe),E(pe,t)}function D(){K(pe),K(ke),K(ve)}function U(t){t.memoizedState!==null&&E(ze,t);var n=pe.current,s=Ox(n,t.type);n!==s&&(E(ke,t),E(pe,s))}function be(t){ke.current===t&&(K(pe),K(ke)),ze.current===t&&(K(ze),li._currentValue=ce)}var Ne,$e;function Ce(t){if(Ne===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);Ne=n&&n[1]||"",$e=-1<s.stack.indexOf(`
|
||
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
||
`+Ne+t+$e}var nt=!1;function Be(t,n){if(!t||nt)return"";nt=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(n){var fe=function(){throw Error()};if(Object.defineProperty(fe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(fe,[])}catch(ae){var te=ae}Reflect.construct(t,[],fe)}else{try{fe.call()}catch(ae){te=ae}t.call(fe.prototype)}}else{try{throw Error()}catch(ae){te=ae}(fe=t())&&typeof fe.catch=="function"&&fe.catch(function(){})}}catch(ae){if(ae&&te&&typeof ae.stack=="string")return[ae.stack,te.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=o.DetermineComponentFrameRoot(),_=g[0],S=g[1];if(_&&S){var O=_.split(`
|
||
`),W=S.split(`
|
||
`);for(f=o=0;o<O.length&&!O[o].includes("DetermineComponentFrameRoot");)o++;for(;f<W.length&&!W[f].includes("DetermineComponentFrameRoot");)f++;if(o===O.length||f===W.length)for(o=O.length-1,f=W.length-1;1<=o&&0<=f&&O[o]!==W[f];)f--;for(;1<=o&&0<=f;o--,f--)if(O[o]!==W[f]){if(o!==1||f!==1)do if(o--,f--,0>f||O[o]!==W[f]){var ie=`
|
||
`+O[o].replace(" at new "," at ");return t.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",t.displayName)),ie}while(1<=o&&0<=f);break}}}finally{nt=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?Ce(s):""}function Ve(t,n){switch(t.tag){case 26:case 27:case 5:return Ce(t.type);case 16:return Ce("Lazy");case 13:return t.child!==n&&n!==null?Ce("Suspense Fallback"):Ce("Suspense");case 19:return Ce("SuspenseList");case 0:case 15:return Be(t.type,!1);case 11:return Be(t.type.render,!1);case 1:return Be(t.type,!0);case 31:return Ce("Activity");default:return""}}function ct(t){try{var n="",s=null;do n+=Ve(t,s),s=t,t=t.return;while(t);return n}catch(o){return`
|
||
Error generating stack: `+o.message+`
|
||
`+o.stack}}var Ee=Object.prototype.hasOwnProperty,Et=e.unstable_scheduleCallback,ft=e.unstable_cancelCallback,vn=e.unstable_shouldYield,Pn=e.unstable_requestPaint,pt=e.unstable_now,Ft=e.unstable_getCurrentPriorityLevel,se=e.unstable_ImmediatePriority,he=e.unstable_UserBlockingPriority,Te=e.unstable_NormalPriority,X=e.unstable_LowPriority,re=e.unstable_IdlePriority,ue=e.log,Ue=e.unstable_setDisableYieldValue,Ae=null,Le=null;function je(t){if(typeof ue=="function"&&Ue(t),Le&&typeof Le.setStrictMode=="function")try{Le.setStrictMode(Ae,t)}catch{}}var Me=Math.clz32?Math.clz32:kn,Rt=Math.log,wt=Math.LN2;function kn(t){return t>>>=0,t===0?32:31-(Rt(t)/wt|0)|0}var Pt=256,ot=262144,Ke=4194304;function Xn(t){var n=t&42;if(n!==0)return n;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function He(t,n,s){var o=t.pendingLanes;if(o===0)return 0;var f=0,g=t.suspendedLanes,_=t.pingedLanes;t=t.warmLanes;var S=o&134217727;return S!==0?(o=S&~g,o!==0?f=Xn(o):(_&=S,_!==0?f=Xn(_):s||(s=S&~t,s!==0&&(f=Xn(s))))):(S=o&~g,S!==0?f=Xn(S):_!==0?f=Xn(_):s||(s=o&~t,s!==0&&(f=Xn(s)))),f===0?0:n!==0&&n!==f&&(n&g)===0&&(g=f&-f,s=n&-n,g>=s||g===32&&(s&4194048)!==0)?n:f}function Fa(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function hs(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 Ii(){var t=Ke;return Ke<<=1,(Ke&62914560)===0&&(Ke=4194304),t}function sa(t){for(var n=[],s=0;31>s;s++)n.push(t);return n}function Qn(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function su(t,n,s,o,f,g){var _=t.pendingLanes;t.pendingLanes=s,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=s,t.entangledLanes&=s,t.errorRecoveryDisabledLanes&=s,t.shellSuspendCounter=0;var S=t.entanglements,O=t.expirationTimes,W=t.hiddenUpdates;for(s=_&~s;0<s;){var ie=31-Me(s),fe=1<<ie;S[ie]=0,O[ie]=-1;var te=W[ie];if(te!==null)for(W[ie]=null,ie=0;ie<te.length;ie++){var ae=te[ie];ae!==null&&(ae.lane&=-536870913)}s&=~fe}o!==0&&Yi(t,o,0),g!==0&&f===0&&t.tag!==0&&(t.suspendedLanes|=g&~(_&~n))}function Yi(t,n,s){t.pendingLanes|=n,t.suspendedLanes&=~n;var o=31-Me(n);t.entangledLanes|=n,t.entanglements[o]=t.entanglements[o]|1073741824|s&261930}function ln(t,n){var s=t.entangledLanes|=n;for(t=t.entanglements;s;){var o=31-Me(s),f=1<<o;f&n|t[o]&n&&(t[o]|=n),s&=~f}}function Gi(t,n){var s=n&-n;return s=(s&42)!==0?1:gs(s),(s&(t.suspendedLanes|n))!==0?0:s}function gs(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function xs(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Vi(){var t=q.p;return t!==0?t:(t=window.event,t===void 0?32:ry(t.type))}function ol(t,n){var s=q.p;try{return q.p=t,n()}finally{q.p=s}}var Zn=Math.random().toString(36).slice(2),Ot="__reactFiber$"+Zn,Wt="__reactProps$"+Zn,ia="__reactContainer$"+Zn,cl="__reactEvents$"+Zn,ys="__reactListeners$"+Zn,Ki="__reactHandles$"+Zn,Pi="__reactResources$"+Zn,Ia="__reactMarker$"+Zn;function Xi(t){delete t[Ot],delete t[Wt],delete t[cl],delete t[ys],delete t[Ki]}function On(t){var n=t[Ot];if(n)return n;for(var s=t.parentNode;s;){if(n=s[ia]||s[Ot]){if(s=n.alternate,n.child!==null||s!==null&&s.child!==null)for(t=Fx(t);t!==null;){if(s=t[Ot])return s;t=Fx(t)}return n}t=s,s=t.parentNode}return null}function Ya(t){if(t=t[Ot]||t[ia]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function Nr(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(i(33))}function Ga(t){var n=t[Pi];return n||(n=t[Pi]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Lt(t){t[Ia]=!0}var Qi=new Set,Zi={};function oa(t,n){xa(t,n),xa(t+"Capture",n)}function xa(t,n){for(Zi[t]=n,t=0;t<n.length;t++)Qi.add(n[t])}var iu=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]*$"),Ji={},Wi={};function ou(t){return Ee.call(Wi,t)?!0:Ee.call(Ji,t)?!1:iu.test(t)?Wi[t]=!0:(Ji[t]=!0,!1)}function Cr(t,n,s){if(ou(n))if(s===null)t.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var o=n.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,""+s)}}function ul(t,n,s){if(s===null)t.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,""+s)}}function cn(t,n,s,o){if(o===null)t.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttributeNS(n,s,""+o)}}function un(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function eo(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function bs(t,n,s){var o=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var f=o.get,g=o.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return f.call(this)},set:function(_){s=""+_,g.call(this,_)}}),Object.defineProperty(t,n,{enumerable:o.enumerable}),{getValue:function(){return s},setValue:function(_){s=""+_},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function dl(t){if(!t._valueTracker){var n=eo(t)?"checked":"value";t._valueTracker=bs(t,n,""+t[n])}}function to(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var s=n.getValue(),o="";return t&&(o=eo(t)?t.checked?"true":"false":t.value),t=o,t!==s?(n.setValue(t),!0):!1}function Va(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var no=/[\n"\\]/g;function It(t){return t.replace(no,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function vs(t,n,s,o,f,g,_,S){t.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?t.type=_:t.removeAttribute("type"),n!=null?_==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+un(n)):t.value!==""+un(n)&&(t.value=""+un(n)):_!=="submit"&&_!=="reset"||t.removeAttribute("value"),n!=null?ks(t,_,un(n)):s!=null?ks(t,_,un(s)):o!=null&&t.removeAttribute("value"),f==null&&g!=null&&(t.defaultChecked=!!g),f!=null&&(t.checked=f&&typeof f!="function"&&typeof f!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?t.name=""+un(S):t.removeAttribute("name")}function ao(t,n,s,o,f,g,_,S){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(t.type=g),n!=null||s!=null){if(!(g!=="submit"&&g!=="reset"||n!=null)){dl(t);return}s=s!=null?""+un(s):"",n=n!=null?""+un(n):s,S||n===t.value||(t.value=n),t.defaultValue=n}o=o??f,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=S?t.checked:!!o,t.defaultChecked=!!o,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(t.name=_),dl(t)}function ks(t,n,s){n==="number"&&Va(t.ownerDocument)===t||t.defaultValue===""+s||(t.defaultValue=""+s)}function ya(t,n,s,o){if(t=t.options,n){n={};for(var f=0;f<s.length;f++)n["$"+s[f]]=!0;for(s=0;s<t.length;s++)f=n.hasOwnProperty("$"+t[s].value),t[s].selected!==f&&(t[s].selected=f),f&&o&&(t[s].defaultSelected=!0)}else{for(s=""+un(s),n=null,f=0;f<t.length;f++){if(t[f].value===s){t[f].selected=!0,o&&(t[f].defaultSelected=!0);return}n!==null||t[f].disabled||(n=t[f])}n!==null&&(n.selected=!0)}}function R(t,n,s){if(n!=null&&(n=""+un(n),n!==t.value&&(t.value=n),s==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=s!=null?""+un(s):""}function _e(t,n,s,o){if(n==null){if(o!=null){if(s!=null)throw Error(i(92));if(B(o)){if(1<o.length)throw Error(i(93));o=o[0]}s=o}s==null&&(s=""),n=s}s=un(n),t.defaultValue=s,o=t.textContent,o===s&&o!==""&&o!==null&&(t.value=o),dl(t)}function Fe(t,n){if(n){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=n;return}}t.textContent=n}var Tt=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 en(t,n,s){var o=n.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?o?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":o?t.setProperty(n,s):typeof s!="number"||s===0||Tt.has(n)?n==="float"?t.cssFloat=s:t[n]=(""+s).trim():t[n]=s+"px"}function Vt(t,n,s){if(n!=null&&typeof n!="object")throw Error(i(62));if(t=t.style,s!=null){for(var o in s)!s.hasOwnProperty(o)||n!=null&&n.hasOwnProperty(o)||(o.indexOf("--")===0?t.setProperty(o,""):o==="float"?t.cssFloat="":t[o]="");for(var f in n)o=n[f],n.hasOwnProperty(f)&&s[f]!==o&&en(t,f,o)}else for(var g in n)n.hasOwnProperty(g)&&en(t,g,n[g])}function _n(t){if(t.indexOf("-")===-1)return!1;switch(t){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 Er=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"]]),Jn=/^[\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 Tr(t){return Jn.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function ba(){}var cu=null;function uu(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var fl=null,pl=null;function zm(t){var n=Ya(t);if(n&&(t=n.stateNode)){var s=t[Wt]||null;e:switch(t=n.stateNode,n.type){case"input":if(vs(t,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),n=s.name,s.type==="radio"&&n!=null){for(s=t;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+It(""+n)+'"][type="radio"]'),n=0;n<s.length;n++){var o=s[n];if(o!==t&&o.form===t.form){var f=o[Wt]||null;if(!f)throw Error(i(90));vs(o,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(n=0;n<s.length;n++)o=s[n],o.form===t.form&&to(o)}break e;case"textarea":R(t,s.value,s.defaultValue);break e;case"select":n=s.value,n!=null&&ya(t,!!s.multiple,n,!1)}}}var du=!1;function Rm(t,n,s){if(du)return t(n,s);du=!0;try{var o=t(n);return o}finally{if(du=!1,(fl!==null||pl!==null)&&(Go(),fl&&(n=fl,t=pl,pl=fl=null,zm(n),t)))for(n=0;n<t.length;n++)zm(t[n])}}function _s(t,n){var s=t.stateNode;if(s===null)return null;var o=s[Wt]||null;if(o===null)return null;s=o[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(t=t.type,o=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!o;break e;default:t=!1}if(t)return null;if(s&&typeof s!="function")throw Error(i(231,n,typeof s));return s}var va=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fu=!1;if(va)try{var ws={};Object.defineProperty(ws,"passive",{get:function(){fu=!0}}),window.addEventListener("test",ws,ws),window.removeEventListener("test",ws,ws)}catch{fu=!1}var Ka=null,pu=null,ro=null;function Om(){if(ro)return ro;var t,n=pu,s=n.length,o,f="value"in Ka?Ka.value:Ka.textContent,g=f.length;for(t=0;t<s&&n[t]===f[t];t++);var _=s-t;for(o=1;o<=_&&n[s-o]===f[g-o];o++);return ro=f.slice(t,1<o?1-o:void 0)}function lo(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function so(){return!0}function Lm(){return!1}function dn(t){function n(s,o,f,g,_){this._reactName=s,this._targetInst=f,this.type=o,this.nativeEvent=g,this.target=_,this.currentTarget=null;for(var S in t)t.hasOwnProperty(S)&&(s=t[S],this[S]=s?s(g):g[S]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?so:Lm,this.isPropagationStopped=Lm,this}return x(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=so)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=so)},persist:function(){},isPersistent:so}),n}var Ar={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},io=dn(Ar),js=x({},Ar,{view:0,detail:0}),rk=dn(js),mu,hu,Ss,oo=x({},js,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xu,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Ss&&(Ss&&t.type==="mousemove"?(mu=t.screenX-Ss.screenX,hu=t.screenY-Ss.screenY):hu=mu=0,Ss=t),mu)},movementY:function(t){return"movementY"in t?t.movementY:hu}}),$m=dn(oo),lk=x({},oo,{dataTransfer:0}),sk=dn(lk),ik=x({},js,{relatedTarget:0}),gu=dn(ik),ok=x({},Ar,{animationName:0,elapsedTime:0,pseudoElement:0}),ck=dn(ok),uk=x({},Ar,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),dk=dn(uk),fk=x({},Ar,{data:0}),Bm=dn(fk),pk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},mk={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"},hk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function gk(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=hk[t])?!!n[t]:!1}function xu(){return gk}var xk=x({},js,{key:function(t){if(t.key){var n=pk[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=lo(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?mk[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xu,charCode:function(t){return t.type==="keypress"?lo(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?lo(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),yk=dn(xk),bk=x({},oo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Um=dn(bk),vk=x({},js,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xu}),kk=dn(vk),_k=x({},Ar,{propertyName:0,elapsedTime:0,pseudoElement:0}),wk=dn(_k),jk=x({},oo,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Sk=dn(jk),Nk=x({},Ar,{newState:0,oldState:0}),Ck=dn(Nk),Ek=[9,13,27,32],yu=va&&"CompositionEvent"in window,Ns=null;va&&"documentMode"in document&&(Ns=document.documentMode);var Tk=va&&"TextEvent"in window&&!Ns,Hm=va&&(!yu||Ns&&8<Ns&&11>=Ns),qm=" ",Fm=!1;function Im(t,n){switch(t){case"keyup":return Ek.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ym(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ml=!1;function Ak(t,n){switch(t){case"compositionend":return Ym(n);case"keypress":return n.which!==32?null:(Fm=!0,qm);case"textInput":return t=n.data,t===qm&&Fm?null:t;default:return null}}function Dk(t,n){if(ml)return t==="compositionend"||!yu&&Im(t,n)?(t=Om(),ro=pu=Ka=null,ml=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Hm&&n.locale!=="ko"?null:n.data;default:return null}}var Mk={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 Gm(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!Mk[t.type]:n==="textarea"}function Vm(t,n,s,o){fl?pl?pl.push(o):pl=[o]:fl=o,n=Jo(n,"onChange"),0<n.length&&(s=new io("onChange","change",null,s,o),t.push({event:s,listeners:n}))}var Cs=null,Es=null;function zk(t){Ex(t,0)}function co(t){var n=Nr(t);if(to(n))return t}function Km(t,n){if(t==="change")return n}var Pm=!1;if(va){var bu;if(va){var vu="oninput"in document;if(!vu){var Xm=document.createElement("div");Xm.setAttribute("oninput","return;"),vu=typeof Xm.oninput=="function"}bu=vu}else bu=!1;Pm=bu&&(!document.documentMode||9<document.documentMode)}function Qm(){Cs&&(Cs.detachEvent("onpropertychange",Zm),Es=Cs=null)}function Zm(t){if(t.propertyName==="value"&&co(Es)){var n=[];Vm(n,Es,t,uu(t)),Rm(zk,n)}}function Rk(t,n,s){t==="focusin"?(Qm(),Cs=n,Es=s,Cs.attachEvent("onpropertychange",Zm)):t==="focusout"&&Qm()}function Ok(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return co(Es)}function Lk(t,n){if(t==="click")return co(n)}function $k(t,n){if(t==="input"||t==="change")return co(n)}function Bk(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var wn=typeof Object.is=="function"?Object.is:Bk;function Ts(t,n){if(wn(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var s=Object.keys(t),o=Object.keys(n);if(s.length!==o.length)return!1;for(o=0;o<s.length;o++){var f=s[o];if(!Ee.call(n,f)||!wn(t[f],n[f]))return!1}return!0}function Jm(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Wm(t,n){var s=Jm(t);t=0;for(var o;s;){if(s.nodeType===3){if(o=t+s.textContent.length,t<=n&&o>=n)return{node:s,offset:n-t};t=o}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Jm(s)}}function eh(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?eh(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function th(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=Va(t.document);n instanceof t.HTMLIFrameElement;){try{var s=typeof n.contentWindow.location.href=="string"}catch{s=!1}if(s)t=n.contentWindow;else break;n=Va(t.document)}return n}function ku(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var Uk=va&&"documentMode"in document&&11>=document.documentMode,hl=null,_u=null,As=null,wu=!1;function nh(t,n,s){var o=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;wu||hl==null||hl!==Va(o)||(o=hl,"selectionStart"in o&&ku(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),As&&Ts(As,o)||(As=o,o=Jo(_u,"onSelect"),0<o.length&&(n=new io("onSelect","select",null,n,s),t.push({event:n,listeners:o}),n.target=hl)))}function Dr(t,n){var s={};return s[t.toLowerCase()]=n.toLowerCase(),s["Webkit"+t]="webkit"+n,s["Moz"+t]="moz"+n,s}var gl={animationend:Dr("Animation","AnimationEnd"),animationiteration:Dr("Animation","AnimationIteration"),animationstart:Dr("Animation","AnimationStart"),transitionrun:Dr("Transition","TransitionRun"),transitionstart:Dr("Transition","TransitionStart"),transitioncancel:Dr("Transition","TransitionCancel"),transitionend:Dr("Transition","TransitionEnd")},ju={},ah={};va&&(ah=document.createElement("div").style,"AnimationEvent"in window||(delete gl.animationend.animation,delete gl.animationiteration.animation,delete gl.animationstart.animation),"TransitionEvent"in window||delete gl.transitionend.transition);function Mr(t){if(ju[t])return ju[t];if(!gl[t])return t;var n=gl[t],s;for(s in n)if(n.hasOwnProperty(s)&&s in ah)return ju[t]=n[s];return t}var rh=Mr("animationend"),lh=Mr("animationiteration"),sh=Mr("animationstart"),Hk=Mr("transitionrun"),qk=Mr("transitionstart"),Fk=Mr("transitioncancel"),ih=Mr("transitionend"),oh=new Map,Su="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(" ");Su.push("scrollEnd");function Wn(t,n){oh.set(t,n),oa(n,[t])}var uo=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=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(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Ln=[],xl=0,Nu=0;function fo(){for(var t=xl,n=Nu=xl=0;n<t;){var s=Ln[n];Ln[n++]=null;var o=Ln[n];Ln[n++]=null;var f=Ln[n];Ln[n++]=null;var g=Ln[n];if(Ln[n++]=null,o!==null&&f!==null){var _=o.pending;_===null?f.next=f:(f.next=_.next,_.next=f),o.pending=f}g!==0&&ch(s,f,g)}}function po(t,n,s,o){Ln[xl++]=t,Ln[xl++]=n,Ln[xl++]=s,Ln[xl++]=o,Nu|=o,t.lanes|=o,t=t.alternate,t!==null&&(t.lanes|=o)}function Cu(t,n,s,o){return po(t,n,s,o),mo(t)}function zr(t,n){return po(t,null,null,n),mo(t)}function ch(t,n,s){t.lanes|=s;var o=t.alternate;o!==null&&(o.lanes|=s);for(var f=!1,g=t.return;g!==null;)g.childLanes|=s,o=g.alternate,o!==null&&(o.childLanes|=s),g.tag===22&&(t=g.stateNode,t===null||t._visibility&1||(f=!0)),t=g,g=g.return;return t.tag===3?(g=t.stateNode,f&&n!==null&&(f=31-Me(s),t=g.hiddenUpdates,o=t[f],o===null?t[f]=[n]:o.push(n),n.lane=s|536870912),g):null}function mo(t){if(50<Js)throw Js=0,Ld=null,Error(i(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var yl={};function Ik(t,n,s,o){this.tag=t,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=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jn(t,n,s,o){return new Ik(t,n,s,o)}function Eu(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ka(t,n){var s=t.alternate;return s===null?(s=jn(t.tag,n,t.key,t.mode),s.elementType=t.elementType,s.type=t.type,s.stateNode=t.stateNode,s.alternate=t,t.alternate=s):(s.pendingProps=n,s.type=t.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=t.flags&65011712,s.childLanes=t.childLanes,s.lanes=t.lanes,s.child=t.child,s.memoizedProps=t.memoizedProps,s.memoizedState=t.memoizedState,s.updateQueue=t.updateQueue,n=t.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},s.sibling=t.sibling,s.index=t.index,s.ref=t.ref,s.refCleanup=t.refCleanup,s}function uh(t,n){t.flags&=65011714;var s=t.alternate;return s===null?(t.childLanes=0,t.lanes=n,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=s.childLanes,t.lanes=s.lanes,t.child=s.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=s.memoizedProps,t.memoizedState=s.memoizedState,t.updateQueue=s.updateQueue,t.type=s.type,n=s.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function ho(t,n,s,o,f,g){var _=0;if(o=t,typeof t=="function")Eu(t)&&(_=1);else if(typeof t=="string")_=P_(t,s,pe.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case oe:return t=jn(31,s,n,f),t.elementType=oe,t.lanes=g,t;case T:return Rr(s.children,f,g,n);case j:_=8,f|=24;break;case C:return t=jn(12,s,n,f|2),t.elementType=C,t.lanes=g,t;case ne:return t=jn(13,s,n,f),t.elementType=ne,t.lanes=g,t;case A:return t=jn(19,s,n,f),t.elementType=A,t.lanes=g,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case M:_=10;break e;case $:_=9;break e;case ee:_=11;break e;case G:_=14;break e;case V:_=16,o=null;break e}_=29,s=Error(i(130,t===null?"null":typeof t,"")),o=null}return n=jn(_,s,n,f),n.elementType=t,n.type=o,n.lanes=g,n}function Rr(t,n,s,o){return t=jn(7,t,o,n),t.lanes=s,t}function Tu(t,n,s){return t=jn(6,t,null,n),t.lanes=s,t}function dh(t){var n=jn(18,null,null,0);return n.stateNode=t,n}function Au(t,n,s){return n=jn(4,t.children!==null?t.children:[],t.key,n),n.lanes=s,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var fh=new WeakMap;function $n(t,n){if(typeof t=="object"&&t!==null){var s=fh.get(t);return s!==void 0?s:(n={value:t,source:n,stack:ct(n)},fh.set(t,n),n)}return{value:t,source:n,stack:ct(n)}}var bl=[],vl=0,go=null,Ds=0,Bn=[],Un=0,Pa=null,ca=1,ua="";function _a(t,n){bl[vl++]=Ds,bl[vl++]=go,go=t,Ds=n}function ph(t,n,s){Bn[Un++]=ca,Bn[Un++]=ua,Bn[Un++]=Pa,Pa=t;var o=ca;t=ua;var f=32-Me(o)-1;o&=~(1<<f),s+=1;var g=32-Me(n)+f;if(30<g){var _=f-f%5;g=(o&(1<<_)-1).toString(32),o>>=_,f-=_,ca=1<<32-Me(n)+f|s<<f|o,ua=g+t}else ca=1<<g|s<<f|o,ua=t}function Du(t){t.return!==null&&(_a(t,1),ph(t,1,0))}function Mu(t){for(;t===go;)go=bl[--vl],bl[vl]=null,Ds=bl[--vl],bl[vl]=null;for(;t===Pa;)Pa=Bn[--Un],Bn[Un]=null,ua=Bn[--Un],Bn[Un]=null,ca=Bn[--Un],Bn[Un]=null}function mh(t,n){Bn[Un++]=ca,Bn[Un++]=ua,Bn[Un++]=Pa,ca=n.id,ua=n.overflow,Pa=t}var Xt=null,vt=null,tt=!1,Xa=null,Hn=!1,zu=Error(i(519));function Qa(t){var n=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ms($n(n,t)),zu}function hh(t){var n=t.stateNode,s=t.type,o=t.memoizedProps;switch(n[Ot]=t,n[Wt]=o,s){case"dialog":Xe("cancel",n),Xe("close",n);break;case"iframe":case"object":case"embed":Xe("load",n);break;case"video":case"audio":for(s=0;s<ei.length;s++)Xe(ei[s],n);break;case"source":Xe("error",n);break;case"img":case"image":case"link":Xe("error",n),Xe("load",n);break;case"details":Xe("toggle",n);break;case"input":Xe("invalid",n),ao(n,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Xe("invalid",n);break;case"textarea":Xe("invalid",n),_e(n,o.value,o.defaultValue,o.children)}s=o.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||n.textContent===""+s||o.suppressHydrationWarning===!0||Mx(n.textContent,s)?(o.popover!=null&&(Xe("beforetoggle",n),Xe("toggle",n)),o.onScroll!=null&&Xe("scroll",n),o.onScrollEnd!=null&&Xe("scrollend",n),o.onClick!=null&&(n.onclick=ba),n=!0):n=!1,n||Qa(t,!0)}function gh(t){for(Xt=t.return;Xt;)switch(Xt.tag){case 5:case 31:case 13:Hn=!1;return;case 27:case 3:Hn=!0;return;default:Xt=Xt.return}}function kl(t){if(t!==Xt)return!1;if(!tt)return gh(t),tt=!0,!1;var n=t.tag,s;if((s=n!==3&&n!==27)&&((s=n===5)&&(s=t.type,s=!(s!=="form"&&s!=="button")||Zd(t.type,t.memoizedProps)),s=!s),s&&vt&&Qa(t),gh(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(317));vt=qx(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(317));vt=qx(t)}else n===27?(n=vt,ur(t.type)?(t=nf,nf=null,vt=t):vt=n):vt=Xt?Fn(t.stateNode.nextSibling):null;return!0}function Or(){vt=Xt=null,tt=!1}function Ru(){var t=Xa;return t!==null&&(hn===null?hn=t:hn.push.apply(hn,t),Xa=null),t}function Ms(t){Xa===null?Xa=[t]:Xa.push(t)}var Ou=z(null),Lr=null,wa=null;function Za(t,n,s){E(Ou,n._currentValue),n._currentValue=s}function ja(t){t._currentValue=Ou.current,K(Ou)}function Lu(t,n,s){for(;t!==null;){var o=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,o!==null&&(o.childLanes|=n)):o!==null&&(o.childLanes&n)!==n&&(o.childLanes|=n),t===s)break;t=t.return}}function $u(t,n,s,o){var f=t.child;for(f!==null&&(f.return=t);f!==null;){var g=f.dependencies;if(g!==null){var _=f.child;g=g.firstContext;e:for(;g!==null;){var S=g;g=f;for(var O=0;O<n.length;O++)if(S.context===n[O]){g.lanes|=s,S=g.alternate,S!==null&&(S.lanes|=s),Lu(g.return,s,t),o||(_=null);break e}g=S.next}}else if(f.tag===18){if(_=f.return,_===null)throw Error(i(341));_.lanes|=s,g=_.alternate,g!==null&&(g.lanes|=s),Lu(_,s,t),_=null}else _=f.child;if(_!==null)_.return=f;else for(_=f;_!==null;){if(_===t){_=null;break}if(f=_.sibling,f!==null){f.return=_.return,_=f;break}_=_.return}f=_}}function _l(t,n,s,o){t=null;for(var f=n,g=!1;f!==null;){if(!g){if((f.flags&524288)!==0)g=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var _=f.alternate;if(_===null)throw Error(i(387));if(_=_.memoizedProps,_!==null){var S=f.type;wn(f.pendingProps.value,_.value)||(t!==null?t.push(S):t=[S])}}else if(f===ze.current){if(_=f.alternate,_===null)throw Error(i(387));_.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(t!==null?t.push(li):t=[li])}f=f.return}t!==null&&$u(n,t,s,o),n.flags|=262144}function xo(t){for(t=t.firstContext;t!==null;){if(!wn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function $r(t){Lr=t,wa=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Qt(t){return xh(Lr,t)}function yo(t,n){return Lr===null&&$r(t),xh(t,n)}function xh(t,n){var s=n._currentValue;if(n={context:n,memoizedValue:s,next:null},wa===null){if(t===null)throw Error(i(308));wa=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else wa=wa.next=n;return s}var Yk=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(s,o){t.push(o)}};this.abort=function(){n.aborted=!0,t.forEach(function(s){return s()})}},Gk=e.unstable_scheduleCallback,Vk=e.unstable_NormalPriority,$t={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Bu(){return{controller:new Yk,data:new Map,refCount:0}}function zs(t){t.refCount--,t.refCount===0&&Gk(Vk,function(){t.controller.abort()})}var Rs=null,Uu=0,wl=0,jl=null;function Kk(t,n){if(Rs===null){var s=Rs=[];Uu=0,wl=Fd(),jl={status:"pending",value:void 0,then:function(o){s.push(o)}}}return Uu++,n.then(yh,yh),n}function yh(){if(--Uu===0&&Rs!==null){jl!==null&&(jl.status="fulfilled");var t=Rs;Rs=null,wl=0,jl=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function Pk(t,n){var s=[],o={status:"pending",value:null,reason:null,then:function(f){s.push(f)}};return t.then(function(){o.status="fulfilled",o.value=n;for(var f=0;f<s.length;f++)(0,s[f])(n)},function(f){for(o.status="rejected",o.reason=f,f=0;f<s.length;f++)(0,s[f])(void 0)}),o}var bh=L.S;L.S=function(t,n){nx=pt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&Kk(t,n),bh!==null&&bh(t,n)};var Br=z(null);function Hu(){var t=Br.current;return t!==null?t:xt.pooledCache}function bo(t,n){n===null?E(Br,Br.current):E(Br,n.pool)}function vh(){var t=Hu();return t===null?null:{parent:$t._currentValue,pool:t}}var Sl=Error(i(460)),qu=Error(i(474)),vo=Error(i(542)),ko={then:function(){}};function kh(t){return t=t.status,t==="fulfilled"||t==="rejected"}function _h(t,n,s){switch(s=t[s],s===void 0?t.push(n):s!==n&&(n.then(ba,ba),n=s),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,jh(t),t;default:if(typeof n.status=="string")n.then(ba,ba);else{if(t=xt,t!==null&&100<t.shellSuspendCounter)throw Error(i(482));t=n,t.status="pending",t.then(function(o){if(n.status==="pending"){var f=n;f.status="fulfilled",f.value=o}},function(o){if(n.status==="pending"){var f=n;f.status="rejected",f.reason=o}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,jh(t),t}throw Hr=n,Sl}}function Ur(t){try{var n=t._init;return n(t._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Hr=s,Sl):s}}var Hr=null;function wh(){if(Hr===null)throw Error(i(459));var t=Hr;return Hr=null,t}function jh(t){if(t===Sl||t===vo)throw Error(i(483))}var Nl=null,Os=0;function _o(t){var n=Os;return Os+=1,Nl===null&&(Nl=[]),_h(Nl,t,n)}function Ls(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function wo(t,n){throw n.$$typeof===v?Error(i(525)):(t=Object.prototype.toString.call(n),Error(i(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function Sh(t){function n(P,H){if(t){var Z=P.deletions;Z===null?(P.deletions=[H],P.flags|=16):Z.push(H)}}function s(P,H){if(!t)return null;for(;H!==null;)n(P,H),H=H.sibling;return null}function o(P){for(var H=new Map;P!==null;)P.key!==null?H.set(P.key,P):H.set(P.index,P),P=P.sibling;return H}function f(P,H){return P=ka(P,H),P.index=0,P.sibling=null,P}function g(P,H,Z){return P.index=Z,t?(Z=P.alternate,Z!==null?(Z=Z.index,Z<H?(P.flags|=67108866,H):Z):(P.flags|=67108866,H)):(P.flags|=1048576,H)}function _(P){return t&&P.alternate===null&&(P.flags|=67108866),P}function S(P,H,Z,de){return H===null||H.tag!==6?(H=Tu(Z,P.mode,de),H.return=P,H):(H=f(H,Z),H.return=P,H)}function O(P,H,Z,de){var De=Z.type;return De===T?ie(P,H,Z.props.children,de,Z.key):H!==null&&(H.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===V&&Ur(De)===H.type)?(H=f(H,Z.props),Ls(H,Z),H.return=P,H):(H=ho(Z.type,Z.key,Z.props,null,P.mode,de),Ls(H,Z),H.return=P,H)}function W(P,H,Z,de){return H===null||H.tag!==4||H.stateNode.containerInfo!==Z.containerInfo||H.stateNode.implementation!==Z.implementation?(H=Au(Z,P.mode,de),H.return=P,H):(H=f(H,Z.children||[]),H.return=P,H)}function ie(P,H,Z,de,De){return H===null||H.tag!==7?(H=Rr(Z,P.mode,de,De),H.return=P,H):(H=f(H,Z),H.return=P,H)}function fe(P,H,Z){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=Tu(""+H,P.mode,Z),H.return=P,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case k:return Z=ho(H.type,H.key,H.props,null,P.mode,Z),Ls(Z,H),Z.return=P,Z;case w:return H=Au(H,P.mode,Z),H.return=P,H;case V:return H=Ur(H),fe(P,H,Z)}if(B(H)||I(H))return H=Rr(H,P.mode,Z,null),H.return=P,H;if(typeof H.then=="function")return fe(P,_o(H),Z);if(H.$$typeof===M)return fe(P,yo(P,H),Z);wo(P,H)}return null}function te(P,H,Z,de){var De=H!==null?H.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return De!==null?null:S(P,H,""+Z,de);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case k:return Z.key===De?O(P,H,Z,de):null;case w:return Z.key===De?W(P,H,Z,de):null;case V:return Z=Ur(Z),te(P,H,Z,de)}if(B(Z)||I(Z))return De!==null?null:ie(P,H,Z,de,null);if(typeof Z.then=="function")return te(P,H,_o(Z),de);if(Z.$$typeof===M)return te(P,H,yo(P,Z),de);wo(P,Z)}return null}function ae(P,H,Z,de,De){if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return P=P.get(Z)||null,S(H,P,""+de,De);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case k:return P=P.get(de.key===null?Z:de.key)||null,O(H,P,de,De);case w:return P=P.get(de.key===null?Z:de.key)||null,W(H,P,de,De);case V:return de=Ur(de),ae(P,H,Z,de,De)}if(B(de)||I(de))return P=P.get(Z)||null,ie(H,P,de,De,null);if(typeof de.then=="function")return ae(P,H,Z,_o(de),De);if(de.$$typeof===M)return ae(P,H,Z,yo(H,de),De);wo(H,de)}return null}function we(P,H,Z,de){for(var De=null,lt=null,Se=H,Ye=H=0,et=null;Se!==null&&Ye<Z.length;Ye++){Se.index>Ye?(et=Se,Se=null):et=Se.sibling;var st=te(P,Se,Z[Ye],de);if(st===null){Se===null&&(Se=et);break}t&&Se&&st.alternate===null&&n(P,Se),H=g(st,H,Ye),lt===null?De=st:lt.sibling=st,lt=st,Se=et}if(Ye===Z.length)return s(P,Se),tt&&_a(P,Ye),De;if(Se===null){for(;Ye<Z.length;Ye++)Se=fe(P,Z[Ye],de),Se!==null&&(H=g(Se,H,Ye),lt===null?De=Se:lt.sibling=Se,lt=Se);return tt&&_a(P,Ye),De}for(Se=o(Se);Ye<Z.length;Ye++)et=ae(Se,P,Ye,Z[Ye],de),et!==null&&(t&&et.alternate!==null&&Se.delete(et.key===null?Ye:et.key),H=g(et,H,Ye),lt===null?De=et:lt.sibling=et,lt=et);return t&&Se.forEach(function(hr){return n(P,hr)}),tt&&_a(P,Ye),De}function Oe(P,H,Z,de){if(Z==null)throw Error(i(151));for(var De=null,lt=null,Se=H,Ye=H=0,et=null,st=Z.next();Se!==null&&!st.done;Ye++,st=Z.next()){Se.index>Ye?(et=Se,Se=null):et=Se.sibling;var hr=te(P,Se,st.value,de);if(hr===null){Se===null&&(Se=et);break}t&&Se&&hr.alternate===null&&n(P,Se),H=g(hr,H,Ye),lt===null?De=hr:lt.sibling=hr,lt=hr,Se=et}if(st.done)return s(P,Se),tt&&_a(P,Ye),De;if(Se===null){for(;!st.done;Ye++,st=Z.next())st=fe(P,st.value,de),st!==null&&(H=g(st,H,Ye),lt===null?De=st:lt.sibling=st,lt=st);return tt&&_a(P,Ye),De}for(Se=o(Se);!st.done;Ye++,st=Z.next())st=ae(Se,P,Ye,st.value,de),st!==null&&(t&&st.alternate!==null&&Se.delete(st.key===null?Ye:st.key),H=g(st,H,Ye),lt===null?De=st:lt.sibling=st,lt=st);return t&&Se.forEach(function(l2){return n(P,l2)}),tt&&_a(P,Ye),De}function gt(P,H,Z,de){if(typeof Z=="object"&&Z!==null&&Z.type===T&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case k:e:{for(var De=Z.key;H!==null;){if(H.key===De){if(De=Z.type,De===T){if(H.tag===7){s(P,H.sibling),de=f(H,Z.props.children),de.return=P,P=de;break e}}else if(H.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===V&&Ur(De)===H.type){s(P,H.sibling),de=f(H,Z.props),Ls(de,Z),de.return=P,P=de;break e}s(P,H);break}else n(P,H);H=H.sibling}Z.type===T?(de=Rr(Z.props.children,P.mode,de,Z.key),de.return=P,P=de):(de=ho(Z.type,Z.key,Z.props,null,P.mode,de),Ls(de,Z),de.return=P,P=de)}return _(P);case w:e:{for(De=Z.key;H!==null;){if(H.key===De)if(H.tag===4&&H.stateNode.containerInfo===Z.containerInfo&&H.stateNode.implementation===Z.implementation){s(P,H.sibling),de=f(H,Z.children||[]),de.return=P,P=de;break e}else{s(P,H);break}else n(P,H);H=H.sibling}de=Au(Z,P.mode,de),de.return=P,P=de}return _(P);case V:return Z=Ur(Z),gt(P,H,Z,de)}if(B(Z))return we(P,H,Z,de);if(I(Z)){if(De=I(Z),typeof De!="function")throw Error(i(150));return Z=De.call(Z),Oe(P,H,Z,de)}if(typeof Z.then=="function")return gt(P,H,_o(Z),de);if(Z.$$typeof===M)return gt(P,H,yo(P,Z),de);wo(P,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,H!==null&&H.tag===6?(s(P,H.sibling),de=f(H,Z),de.return=P,P=de):(s(P,H),de=Tu(Z,P.mode,de),de.return=P,P=de),_(P)):s(P,H)}return function(P,H,Z,de){try{Os=0;var De=gt(P,H,Z,de);return Nl=null,De}catch(Se){if(Se===Sl||Se===vo)throw Se;var lt=jn(29,Se,null,P.mode);return lt.lanes=de,lt.return=P,lt}finally{}}}var qr=Sh(!0),Nh=Sh(!1),Ja=!1;function Fu(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Iu(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Wa(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function er(t,n,s){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(it&2)!==0){var f=o.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),o.pending=n,n=mo(t),ch(t,null,s),n}return po(t,o,n,s),mo(t)}function $s(t,n,s){if(n=n.updateQueue,n!==null&&(n=n.shared,(s&4194048)!==0)){var o=n.lanes;o&=t.pendingLanes,s|=o,n.lanes=s,ln(t,s)}}function Yu(t,n){var s=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,s===o)){var f=null,g=null;if(s=s.firstBaseUpdate,s!==null){do{var _={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};g===null?f=g=_:g=g.next=_,s=s.next}while(s!==null);g===null?f=g=n:g=g.next=n}else f=g=n;s={baseState:o.baseState,firstBaseUpdate:f,lastBaseUpdate:g,shared:o.shared,callbacks:o.callbacks},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=n:t.next=n,s.lastBaseUpdate=n}var Gu=!1;function Bs(){if(Gu){var t=jl;if(t!==null)throw t}}function Us(t,n,s,o){Gu=!1;var f=t.updateQueue;Ja=!1;var g=f.firstBaseUpdate,_=f.lastBaseUpdate,S=f.shared.pending;if(S!==null){f.shared.pending=null;var O=S,W=O.next;O.next=null,_===null?g=W:_.next=W,_=O;var ie=t.alternate;ie!==null&&(ie=ie.updateQueue,S=ie.lastBaseUpdate,S!==_&&(S===null?ie.firstBaseUpdate=W:S.next=W,ie.lastBaseUpdate=O))}if(g!==null){var fe=f.baseState;_=0,ie=W=O=null,S=g;do{var te=S.lane&-536870913,ae=te!==S.lane;if(ae?(We&te)===te:(o&te)===te){te!==0&&te===wl&&(Gu=!0),ie!==null&&(ie=ie.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var we=t,Oe=S;te=n;var gt=s;switch(Oe.tag){case 1:if(we=Oe.payload,typeof we=="function"){fe=we.call(gt,fe,te);break e}fe=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=Oe.payload,te=typeof we=="function"?we.call(gt,fe,te):we,te==null)break e;fe=x({},fe,te);break e;case 2:Ja=!0}}te=S.callback,te!==null&&(t.flags|=64,ae&&(t.flags|=8192),ae=f.callbacks,ae===null?f.callbacks=[te]:ae.push(te))}else ae={lane:te,tag:S.tag,payload:S.payload,callback:S.callback,next:null},ie===null?(W=ie=ae,O=fe):ie=ie.next=ae,_|=te;if(S=S.next,S===null){if(S=f.shared.pending,S===null)break;ae=S,S=ae.next,ae.next=null,f.lastBaseUpdate=ae,f.shared.pending=null}}while(!0);ie===null&&(O=fe),f.baseState=O,f.firstBaseUpdate=W,f.lastBaseUpdate=ie,g===null&&(f.shared.lanes=0),lr|=_,t.lanes=_,t.memoizedState=fe}}function Ch(t,n){if(typeof t!="function")throw Error(i(191,t));t.call(n)}function Eh(t,n){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;t<s.length;t++)Ch(s[t],n)}var Cl=z(null),jo=z(0);function Th(t,n){t=za,E(jo,t),E(Cl,n),za=t|n.baseLanes}function Vu(){E(jo,za),E(Cl,Cl.current)}function Ku(){za=jo.current,K(Cl),K(jo)}var Sn=z(null),qn=null;function tr(t){var n=t.alternate;E(Mt,Mt.current&1),E(Sn,t),qn===null&&(n===null||Cl.current!==null||n.memoizedState!==null)&&(qn=t)}function Pu(t){E(Mt,Mt.current),E(Sn,t),qn===null&&(qn=t)}function Ah(t){t.tag===22?(E(Mt,Mt.current),E(Sn,t),qn===null&&(qn=t)):nr()}function nr(){E(Mt,Mt.current),E(Sn,Sn.current)}function Nn(t){K(Sn),qn===t&&(qn=null),K(Mt)}var Mt=z(0);function So(t){for(var n=t;n!==null;){if(n.tag===13){var s=n.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||ef(s)||tf(s)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Sa=0,Ie=null,mt=null,Bt=null,No=!1,El=!1,Fr=!1,Co=0,Hs=0,Tl=null,Xk=0;function At(){throw Error(i(321))}function Xu(t,n){if(n===null)return!1;for(var s=0;s<n.length&&s<t.length;s++)if(!wn(t[s],n[s]))return!1;return!0}function Qu(t,n,s,o,f,g){return Sa=g,Ie=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,L.H=t===null||t.memoizedState===null?pg:dd,Fr=!1,g=s(o,f),Fr=!1,El&&(g=Mh(n,s,o,f)),Dh(t),g}function Dh(t){L.H=Is;var n=mt!==null&&mt.next!==null;if(Sa=0,Bt=mt=Ie=null,No=!1,Hs=0,Tl=null,n)throw Error(i(300));t===null||Ut||(t=t.dependencies,t!==null&&xo(t)&&(Ut=!0))}function Mh(t,n,s,o){Ie=t;var f=0;do{if(El&&(Tl=null),Hs=0,El=!1,25<=f)throw Error(i(301));if(f+=1,Bt=mt=null,t.updateQueue!=null){var g=t.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}L.H=mg,g=n(s,o)}while(El);return g}function Qk(){var t=L.H,n=t.useState()[0];return n=typeof n.then=="function"?qs(n):n,t=t.useState()[0],(mt!==null?mt.memoizedState:null)!==t&&(Ie.flags|=1024),n}function Zu(){var t=Co!==0;return Co=0,t}function Ju(t,n,s){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~s}function Wu(t){if(No){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}No=!1}Sa=0,Bt=mt=Ie=null,El=!1,Hs=Co=0,Tl=null}function sn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bt===null?Ie.memoizedState=Bt=t:Bt=Bt.next=t,Bt}function zt(){if(mt===null){var t=Ie.alternate;t=t!==null?t.memoizedState:null}else t=mt.next;var n=Bt===null?Ie.memoizedState:Bt.next;if(n!==null)Bt=n,mt=t;else{if(t===null)throw Ie.alternate===null?Error(i(467)):Error(i(310));mt=t,t={memoizedState:mt.memoizedState,baseState:mt.baseState,baseQueue:mt.baseQueue,queue:mt.queue,next:null},Bt===null?Ie.memoizedState=Bt=t:Bt=Bt.next=t}return Bt}function Eo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function qs(t){var n=Hs;return Hs+=1,Tl===null&&(Tl=[]),t=_h(Tl,t,n),n=Ie,(Bt===null?n.memoizedState:Bt.next)===null&&(n=n.alternate,L.H=n===null||n.memoizedState===null?pg:dd),t}function To(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return qs(t);if(t.$$typeof===M)return Qt(t)}throw Error(i(438,String(t)))}function ed(t){var n=null,s=Ie.updateQueue;if(s!==null&&(n=s.memoCache),n==null){var o=Ie.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(n={data:o.data.map(function(f){return f.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),s===null&&(s=Eo(),Ie.updateQueue=s),s.memoCache=n,s=n.data[n.index],s===void 0)for(s=n.data[n.index]=Array(t),o=0;o<t;o++)s[o]=Y;return n.index++,s}function Na(t,n){return typeof n=="function"?n(t):n}function Ao(t){var n=zt();return td(n,mt,t)}function td(t,n,s){var o=t.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=s;var f=t.baseQueue,g=o.pending;if(g!==null){if(f!==null){var _=f.next;f.next=g.next,g.next=_}n.baseQueue=f=g,o.pending=null}if(g=t.baseState,f===null)t.memoizedState=g;else{n=f.next;var S=_=null,O=null,W=n,ie=!1;do{var fe=W.lane&-536870913;if(fe!==W.lane?(We&fe)===fe:(Sa&fe)===fe){var te=W.revertLane;if(te===0)O!==null&&(O=O.next={lane:0,revertLane:0,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null}),fe===wl&&(ie=!0);else if((Sa&te)===te){W=W.next,te===wl&&(ie=!0);continue}else fe={lane:0,revertLane:W.revertLane,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},O===null?(S=O=fe,_=g):O=O.next=fe,Ie.lanes|=te,lr|=te;fe=W.action,Fr&&s(g,fe),g=W.hasEagerState?W.eagerState:s(g,fe)}else te={lane:fe,revertLane:W.revertLane,gesture:W.gesture,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},O===null?(S=O=te,_=g):O=O.next=te,Ie.lanes|=fe,lr|=fe;W=W.next}while(W!==null&&W!==n);if(O===null?_=g:O.next=S,!wn(g,t.memoizedState)&&(Ut=!0,ie&&(s=jl,s!==null)))throw s;t.memoizedState=g,t.baseState=_,t.baseQueue=O,o.lastRenderedState=g}return f===null&&(o.lanes=0),[t.memoizedState,o.dispatch]}function nd(t){var n=zt(),s=n.queue;if(s===null)throw Error(i(311));s.lastRenderedReducer=t;var o=s.dispatch,f=s.pending,g=n.memoizedState;if(f!==null){s.pending=null;var _=f=f.next;do g=t(g,_.action),_=_.next;while(_!==f);wn(g,n.memoizedState)||(Ut=!0),n.memoizedState=g,n.baseQueue===null&&(n.baseState=g),s.lastRenderedState=g}return[g,o]}function zh(t,n,s){var o=Ie,f=zt(),g=tt;if(g){if(s===void 0)throw Error(i(407));s=s()}else s=n();var _=!wn((mt||f).memoizedState,s);if(_&&(f.memoizedState=s,Ut=!0),f=f.queue,ld(Lh.bind(null,o,f,t),[t]),f.getSnapshot!==n||_||Bt!==null&&Bt.memoizedState.tag&1){if(o.flags|=2048,Al(9,{destroy:void 0},Oh.bind(null,o,f,s,n),null),xt===null)throw Error(i(349));g||(Sa&127)!==0||Rh(o,n,s)}return s}function Rh(t,n,s){t.flags|=16384,t={getSnapshot:n,value:s},n=Ie.updateQueue,n===null?(n=Eo(),Ie.updateQueue=n,n.stores=[t]):(s=n.stores,s===null?n.stores=[t]:s.push(t))}function Oh(t,n,s,o){n.value=s,n.getSnapshot=o,$h(n)&&Bh(t)}function Lh(t,n,s){return s(function(){$h(n)&&Bh(t)})}function $h(t){var n=t.getSnapshot;t=t.value;try{var s=n();return!wn(t,s)}catch{return!0}}function Bh(t){var n=zr(t,2);n!==null&&gn(n,t,2)}function ad(t){var n=sn();if(typeof t=="function"){var s=t;if(t=s(),Fr){je(!0);try{s()}finally{je(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Na,lastRenderedState:t},n}function Uh(t,n,s,o){return t.baseState=s,td(t,mt,typeof o=="function"?o:Na)}function Zk(t,n,s,o,f){if(zo(t))throw Error(i(485));if(t=n.action,t!==null){var g={payload:f,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){g.listeners.push(_)}};L.T!==null?s(!0):g.isTransition=!1,o(g),s=n.pending,s===null?(g.next=n.pending=g,Hh(n,g)):(g.next=s.next,n.pending=s.next=g)}}function Hh(t,n){var s=n.action,o=n.payload,f=t.state;if(n.isTransition){var g=L.T,_={};L.T=_;try{var S=s(f,o),O=L.S;O!==null&&O(_,S),qh(t,n,S)}catch(W){rd(t,n,W)}finally{g!==null&&_.types!==null&&(g.types=_.types),L.T=g}}else try{g=s(f,o),qh(t,n,g)}catch(W){rd(t,n,W)}}function qh(t,n,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(o){Fh(t,n,o)},function(o){return rd(t,n,o)}):Fh(t,n,s)}function Fh(t,n,s){n.status="fulfilled",n.value=s,Ih(n),t.state=s,n=t.pending,n!==null&&(s=n.next,s===n?t.pending=null:(s=s.next,n.next=s,Hh(t,s)))}function rd(t,n,s){var o=t.pending;if(t.pending=null,o!==null){o=o.next;do n.status="rejected",n.reason=s,Ih(n),n=n.next;while(n!==o)}t.action=null}function Ih(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function Yh(t,n){return n}function Gh(t,n){if(tt){var s=xt.formState;if(s!==null){e:{var o=Ie;if(tt){if(vt){t:{for(var f=vt,g=Hn;f.nodeType!==8;){if(!g){f=null;break t}if(f=Fn(f.nextSibling),f===null){f=null;break t}}g=f.data,f=g==="F!"||g==="F"?f:null}if(f){vt=Fn(f.nextSibling),o=f.data==="F!";break e}}Qa(o)}o=!1}o&&(n=s[0])}}return s=sn(),s.memoizedState=s.baseState=n,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yh,lastRenderedState:n},s.queue=o,s=ug.bind(null,Ie,o),o.dispatch=s,o=ad(!1),g=ud.bind(null,Ie,!1,o.queue),o=sn(),f={state:n,dispatch:null,action:t,pending:null},o.queue=f,s=Zk.bind(null,Ie,f,g,s),f.dispatch=s,o.memoizedState=t,[n,s,!1]}function Vh(t){var n=zt();return Kh(n,mt,t)}function Kh(t,n,s){if(n=td(t,n,Yh)[0],t=Ao(Na)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var o=qs(n)}catch(_){throw _===Sl?vo:_}else o=n;n=zt();var f=n.queue,g=f.dispatch;return s!==n.memoizedState&&(Ie.flags|=2048,Al(9,{destroy:void 0},Jk.bind(null,f,s),null)),[o,g,t]}function Jk(t,n){t.action=n}function Ph(t){var n=zt(),s=mt;if(s!==null)return Kh(n,s,t);zt(),n=n.memoizedState,s=zt();var o=s.queue.dispatch;return s.memoizedState=t,[n,o,!1]}function Al(t,n,s,o){return t={tag:t,create:s,deps:o,inst:n,next:null},n=Ie.updateQueue,n===null&&(n=Eo(),Ie.updateQueue=n),s=n.lastEffect,s===null?n.lastEffect=t.next=t:(o=s.next,s.next=t,t.next=o,n.lastEffect=t),t}function Xh(){return zt().memoizedState}function Do(t,n,s,o){var f=sn();Ie.flags|=t,f.memoizedState=Al(1|n,{destroy:void 0},s,o===void 0?null:o)}function Mo(t,n,s,o){var f=zt();o=o===void 0?null:o;var g=f.memoizedState.inst;mt!==null&&o!==null&&Xu(o,mt.memoizedState.deps)?f.memoizedState=Al(n,g,s,o):(Ie.flags|=t,f.memoizedState=Al(1|n,g,s,o))}function Qh(t,n){Do(8390656,8,t,n)}function ld(t,n){Mo(2048,8,t,n)}function Wk(t){Ie.flags|=4;var n=Ie.updateQueue;if(n===null)n=Eo(),Ie.updateQueue=n,n.events=[t];else{var s=n.events;s===null?n.events=[t]:s.push(t)}}function Zh(t){var n=zt().memoizedState;return Wk({ref:n,nextImpl:t}),function(){if((it&2)!==0)throw Error(i(440));return n.impl.apply(void 0,arguments)}}function Jh(t,n){return Mo(4,2,t,n)}function Wh(t,n){return Mo(4,4,t,n)}function eg(t,n){if(typeof n=="function"){t=t();var s=n(t);return function(){typeof s=="function"?s():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function tg(t,n,s){s=s!=null?s.concat([t]):null,Mo(4,4,eg.bind(null,n,t),s)}function sd(){}function ng(t,n){var s=zt();n=n===void 0?null:n;var o=s.memoizedState;return n!==null&&Xu(n,o[1])?o[0]:(s.memoizedState=[t,n],t)}function ag(t,n){var s=zt();n=n===void 0?null:n;var o=s.memoizedState;if(n!==null&&Xu(n,o[1]))return o[0];if(o=t(),Fr){je(!0);try{t()}finally{je(!1)}}return s.memoizedState=[o,n],o}function id(t,n,s){return s===void 0||(Sa&1073741824)!==0&&(We&261930)===0?t.memoizedState=n:(t.memoizedState=s,t=rx(),Ie.lanes|=t,lr|=t,s)}function rg(t,n,s,o){return wn(s,n)?s:Cl.current!==null?(t=id(t,s,o),wn(t,n)||(Ut=!0),t):(Sa&42)===0||(Sa&1073741824)!==0&&(We&261930)===0?(Ut=!0,t.memoizedState=s):(t=rx(),Ie.lanes|=t,lr|=t,n)}function lg(t,n,s,o,f){var g=q.p;q.p=g!==0&&8>g?g:8;var _=L.T,S={};L.T=S,ud(t,!1,n,s);try{var O=f(),W=L.S;if(W!==null&&W(S,O),O!==null&&typeof O=="object"&&typeof O.then=="function"){var ie=Pk(O,o);Fs(t,n,ie,Tn(t))}else Fs(t,n,o,Tn(t))}catch(fe){Fs(t,n,{then:function(){},status:"rejected",reason:fe},Tn())}finally{q.p=g,_!==null&&S.types!==null&&(_.types=S.types),L.T=_}}function e_(){}function od(t,n,s,o){if(t.tag!==5)throw Error(i(476));var f=sg(t).queue;lg(t,f,n,ce,s===null?e_:function(){return ig(t),s(o)})}function sg(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:ce,baseState:ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Na,lastRenderedState:ce},next:null};var s={};return n.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Na,lastRenderedState:s},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function ig(t){var n=sg(t);n.next===null&&(n=t.alternate.memoizedState),Fs(t,n.next.queue,{},Tn())}function cd(){return Qt(li)}function og(){return zt().memoizedState}function cg(){return zt().memoizedState}function t_(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var s=Tn();t=Wa(s);var o=er(n,t,s);o!==null&&(gn(o,n,s),$s(o,n,s)),n={cache:Bu()},t.payload=n;return}n=n.return}}function n_(t,n,s){var o=Tn();s={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},zo(t)?dg(n,s):(s=Cu(t,n,s,o),s!==null&&(gn(s,t,o),fg(s,n,o)))}function ug(t,n,s){var o=Tn();Fs(t,n,s,o)}function Fs(t,n,s,o){var f={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(zo(t))dg(n,f);else{var g=t.alternate;if(t.lanes===0&&(g===null||g.lanes===0)&&(g=n.lastRenderedReducer,g!==null))try{var _=n.lastRenderedState,S=g(_,s);if(f.hasEagerState=!0,f.eagerState=S,wn(S,_))return po(t,n,f,0),xt===null&&fo(),!1}catch{}finally{}if(s=Cu(t,n,f,o),s!==null)return gn(s,t,o),fg(s,n,o),!0}return!1}function ud(t,n,s,o){if(o={lane:2,revertLane:Fd(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},zo(t)){if(n)throw Error(i(479))}else n=Cu(t,s,o,2),n!==null&&gn(n,t,2)}function zo(t){var n=t.alternate;return t===Ie||n!==null&&n===Ie}function dg(t,n){El=No=!0;var s=t.pending;s===null?n.next=n:(n.next=s.next,s.next=n),t.pending=n}function fg(t,n,s){if((s&4194048)!==0){var o=n.lanes;o&=t.pendingLanes,s|=o,n.lanes=s,ln(t,s)}}var Is={readContext:Qt,use:To,useCallback:At,useContext:At,useEffect:At,useImperativeHandle:At,useLayoutEffect:At,useInsertionEffect:At,useMemo:At,useReducer:At,useRef:At,useState:At,useDebugValue:At,useDeferredValue:At,useTransition:At,useSyncExternalStore:At,useId:At,useHostTransitionStatus:At,useFormState:At,useActionState:At,useOptimistic:At,useMemoCache:At,useCacheRefresh:At};Is.useEffectEvent=At;var pg={readContext:Qt,use:To,useCallback:function(t,n){return sn().memoizedState=[t,n===void 0?null:n],t},useContext:Qt,useEffect:Qh,useImperativeHandle:function(t,n,s){s=s!=null?s.concat([t]):null,Do(4194308,4,eg.bind(null,n,t),s)},useLayoutEffect:function(t,n){return Do(4194308,4,t,n)},useInsertionEffect:function(t,n){Do(4,2,t,n)},useMemo:function(t,n){var s=sn();n=n===void 0?null:n;var o=t();if(Fr){je(!0);try{t()}finally{je(!1)}}return s.memoizedState=[o,n],o},useReducer:function(t,n,s){var o=sn();if(s!==void 0){var f=s(n);if(Fr){je(!0);try{s(n)}finally{je(!1)}}}else f=n;return o.memoizedState=o.baseState=f,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:f},o.queue=t,t=t.dispatch=n_.bind(null,Ie,t),[o.memoizedState,t]},useRef:function(t){var n=sn();return t={current:t},n.memoizedState=t},useState:function(t){t=ad(t);var n=t.queue,s=ug.bind(null,Ie,n);return n.dispatch=s,[t.memoizedState,s]},useDebugValue:sd,useDeferredValue:function(t,n){var s=sn();return id(s,t,n)},useTransition:function(){var t=ad(!1);return t=lg.bind(null,Ie,t.queue,!0,!1),sn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,s){var o=Ie,f=sn();if(tt){if(s===void 0)throw Error(i(407));s=s()}else{if(s=n(),xt===null)throw Error(i(349));(We&127)!==0||Rh(o,n,s)}f.memoizedState=s;var g={value:s,getSnapshot:n};return f.queue=g,Qh(Lh.bind(null,o,g,t),[t]),o.flags|=2048,Al(9,{destroy:void 0},Oh.bind(null,o,g,s,n),null),s},useId:function(){var t=sn(),n=xt.identifierPrefix;if(tt){var s=ua,o=ca;s=(o&~(1<<32-Me(o)-1)).toString(32)+s,n="_"+n+"R_"+s,s=Co++,0<s&&(n+="H"+s.toString(32)),n+="_"}else s=Xk++,n="_"+n+"r_"+s.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:cd,useFormState:Gh,useActionState:Gh,useOptimistic:function(t){var n=sn();n.memoizedState=n.baseState=t;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=s,n=ud.bind(null,Ie,!0,s),s.dispatch=n,[t,n]},useMemoCache:ed,useCacheRefresh:function(){return sn().memoizedState=t_.bind(null,Ie)},useEffectEvent:function(t){var n=sn(),s={impl:t};return n.memoizedState=s,function(){if((it&2)!==0)throw Error(i(440));return s.impl.apply(void 0,arguments)}}},dd={readContext:Qt,use:To,useCallback:ng,useContext:Qt,useEffect:ld,useImperativeHandle:tg,useInsertionEffect:Jh,useLayoutEffect:Wh,useMemo:ag,useReducer:Ao,useRef:Xh,useState:function(){return Ao(Na)},useDebugValue:sd,useDeferredValue:function(t,n){var s=zt();return rg(s,mt.memoizedState,t,n)},useTransition:function(){var t=Ao(Na)[0],n=zt().memoizedState;return[typeof t=="boolean"?t:qs(t),n]},useSyncExternalStore:zh,useId:og,useHostTransitionStatus:cd,useFormState:Vh,useActionState:Vh,useOptimistic:function(t,n){var s=zt();return Uh(s,mt,t,n)},useMemoCache:ed,useCacheRefresh:cg};dd.useEffectEvent=Zh;var mg={readContext:Qt,use:To,useCallback:ng,useContext:Qt,useEffect:ld,useImperativeHandle:tg,useInsertionEffect:Jh,useLayoutEffect:Wh,useMemo:ag,useReducer:nd,useRef:Xh,useState:function(){return nd(Na)},useDebugValue:sd,useDeferredValue:function(t,n){var s=zt();return mt===null?id(s,t,n):rg(s,mt.memoizedState,t,n)},useTransition:function(){var t=nd(Na)[0],n=zt().memoizedState;return[typeof t=="boolean"?t:qs(t),n]},useSyncExternalStore:zh,useId:og,useHostTransitionStatus:cd,useFormState:Ph,useActionState:Ph,useOptimistic:function(t,n){var s=zt();return mt!==null?Uh(s,mt,t,n):(s.baseState=t,[t,s.queue.dispatch])},useMemoCache:ed,useCacheRefresh:cg};mg.useEffectEvent=Zh;function fd(t,n,s,o){n=t.memoizedState,s=s(o,n),s=s==null?n:x({},n,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var pd={enqueueSetState:function(t,n,s){t=t._reactInternals;var o=Tn(),f=Wa(o);f.payload=n,s!=null&&(f.callback=s),n=er(t,f,o),n!==null&&(gn(n,t,o),$s(n,t,o))},enqueueReplaceState:function(t,n,s){t=t._reactInternals;var o=Tn(),f=Wa(o);f.tag=1,f.payload=n,s!=null&&(f.callback=s),n=er(t,f,o),n!==null&&(gn(n,t,o),$s(n,t,o))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var s=Tn(),o=Wa(s);o.tag=2,n!=null&&(o.callback=n),n=er(t,o,s),n!==null&&(gn(n,t,s),$s(n,t,s))}};function hg(t,n,s,o,f,g,_){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(o,g,_):n.prototype&&n.prototype.isPureReactComponent?!Ts(s,o)||!Ts(f,g):!0}function gg(t,n,s,o){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(s,o),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(s,o),n.state!==t&&pd.enqueueReplaceState(n,n.state,null)}function Ir(t,n){var s=n;if("ref"in n){s={};for(var o in n)o!=="ref"&&(s[o]=n[o])}if(t=t.defaultProps){s===n&&(s=x({},s));for(var f in t)s[f]===void 0&&(s[f]=t[f])}return s}function xg(t){uo(t)}function yg(t){console.error(t)}function bg(t){uo(t)}function Ro(t,n){try{var s=t.onUncaughtError;s(n.value,{componentStack:n.stack})}catch(o){setTimeout(function(){throw o})}}function vg(t,n,s){try{var o=t.onCaughtError;o(s.value,{componentStack:s.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function md(t,n,s){return s=Wa(s),s.tag=3,s.payload={element:null},s.callback=function(){Ro(t,n)},s}function kg(t){return t=Wa(t),t.tag=3,t}function _g(t,n,s,o){var f=s.type.getDerivedStateFromError;if(typeof f=="function"){var g=o.value;t.payload=function(){return f(g)},t.callback=function(){vg(n,s,o)}}var _=s.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(t.callback=function(){vg(n,s,o),typeof f!="function"&&(sr===null?sr=new Set([this]):sr.add(this));var S=o.stack;this.componentDidCatch(o.value,{componentStack:S!==null?S:""})})}function a_(t,n,s,o,f){if(s.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(n=s.alternate,n!==null&&_l(n,s,f,!0),s=Sn.current,s!==null){switch(s.tag){case 31:case 13:return qn===null?Vo():s.alternate===null&&Dt===0&&(Dt=3),s.flags&=-257,s.flags|=65536,s.lanes=f,o===ko?s.flags|=16384:(n=s.updateQueue,n===null?s.updateQueue=new Set([o]):n.add(o),Ud(t,o,f)),!1;case 22:return s.flags|=65536,o===ko?s.flags|=16384:(n=s.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([o])},s.updateQueue=n):(s=n.retryQueue,s===null?n.retryQueue=new Set([o]):s.add(o)),Ud(t,o,f)),!1}throw Error(i(435,s.tag))}return Ud(t,o,f),Vo(),!1}if(tt)return n=Sn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,o!==zu&&(t=Error(i(422),{cause:o}),Ms($n(t,s)))):(o!==zu&&(n=Error(i(423),{cause:o}),Ms($n(n,s))),t=t.current.alternate,t.flags|=65536,f&=-f,t.lanes|=f,o=$n(o,s),f=md(t.stateNode,o,f),Yu(t,f),Dt!==4&&(Dt=2)),!1;var g=Error(i(520),{cause:o});if(g=$n(g,s),Zs===null?Zs=[g]:Zs.push(g),Dt!==4&&(Dt=2),n===null)return!0;o=$n(o,s),s=n;do{switch(s.tag){case 3:return s.flags|=65536,t=f&-f,s.lanes|=t,t=md(s.stateNode,o,t),Yu(s,t),!1;case 1:if(n=s.type,g=s.stateNode,(s.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(sr===null||!sr.has(g))))return s.flags|=65536,f&=-f,s.lanes|=f,f=kg(f),_g(f,t,s,o),Yu(s,f),!1}s=s.return}while(s!==null);return!1}var hd=Error(i(461)),Ut=!1;function Zt(t,n,s,o){n.child=t===null?Nh(n,null,s,o):qr(n,t.child,s,o)}function wg(t,n,s,o,f){s=s.render;var g=n.ref;if("ref"in o){var _={};for(var S in o)S!=="ref"&&(_[S]=o[S])}else _=o;return $r(n),o=Qu(t,n,s,_,g,f),S=Zu(),t!==null&&!Ut?(Ju(t,n,f),Ca(t,n,f)):(tt&&S&&Du(n),n.flags|=1,Zt(t,n,o,f),n.child)}function jg(t,n,s,o,f){if(t===null){var g=s.type;return typeof g=="function"&&!Eu(g)&&g.defaultProps===void 0&&s.compare===null?(n.tag=15,n.type=g,Sg(t,n,g,o,f)):(t=ho(s.type,null,o,n,n.mode,f),t.ref=n.ref,t.return=n,n.child=t)}if(g=t.child,!wd(t,f)){var _=g.memoizedProps;if(s=s.compare,s=s!==null?s:Ts,s(_,o)&&t.ref===n.ref)return Ca(t,n,f)}return n.flags|=1,t=ka(g,o),t.ref=n.ref,t.return=n,n.child=t}function Sg(t,n,s,o,f){if(t!==null){var g=t.memoizedProps;if(Ts(g,o)&&t.ref===n.ref)if(Ut=!1,n.pendingProps=o=g,wd(t,f))(t.flags&131072)!==0&&(Ut=!0);else return n.lanes=t.lanes,Ca(t,n,f)}return gd(t,n,s,o,f)}function Ng(t,n,s,o){var f=o.children,g=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((n.flags&128)!==0){if(g=g!==null?g.baseLanes|s:s,t!==null){for(o=n.child=t.child,f=0;o!==null;)f=f|o.lanes|o.childLanes,o=o.sibling;o=f&~g}else o=0,n.child=null;return Cg(t,n,g,s,o)}if((s&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&bo(n,g!==null?g.cachePool:null),g!==null?Th(n,g):Vu(),Ah(n);else return o=n.lanes=536870912,Cg(t,n,g!==null?g.baseLanes|s:s,s,o)}else g!==null?(bo(n,g.cachePool),Th(n,g),nr(),n.memoizedState=null):(t!==null&&bo(n,null),Vu(),nr());return Zt(t,n,f,s),n.child}function Ys(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Cg(t,n,s,o,f){var g=Hu();return g=g===null?null:{parent:$t._currentValue,pool:g},n.memoizedState={baseLanes:s,cachePool:g},t!==null&&bo(n,null),Vu(),Ah(n),t!==null&&_l(t,n,o,!0),n.childLanes=f,null}function Oo(t,n){return n=$o({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function Eg(t,n,s){return qr(n,t.child,null,s),t=Oo(n,n.pendingProps),t.flags|=2,Nn(n),n.memoizedState=null,t}function r_(t,n,s){var o=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(tt){if(o.mode==="hidden")return t=Oo(n,o),n.lanes=536870912,Ys(null,t);if(Pu(n),(t=vt)?(t=Hx(t,Hn),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Pa!==null?{id:ca,overflow:ua}:null,retryLane:536870912,hydrationErrors:null},s=dh(t),s.return=n,n.child=s,Xt=n,vt=null)):t=null,t===null)throw Qa(n);return n.lanes=536870912,null}return Oo(n,o)}var g=t.memoizedState;if(g!==null){var _=g.dehydrated;if(Pu(n),f)if(n.flags&256)n.flags&=-257,n=Eg(t,n,s);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(i(558));else if(Ut||_l(t,n,s,!1),f=(s&t.childLanes)!==0,Ut||f){if(o=xt,o!==null&&(_=Gi(o,s),_!==0&&_!==g.retryLane))throw g.retryLane=_,zr(t,_),gn(o,t,_),hd;Vo(),n=Eg(t,n,s)}else t=g.treeContext,vt=Fn(_.nextSibling),Xt=n,tt=!0,Xa=null,Hn=!1,t!==null&&mh(n,t),n=Oo(n,o),n.flags|=4096;return n}return t=ka(t.child,{mode:o.mode,children:o.children}),t.ref=n.ref,n.child=t,t.return=n,t}function Lo(t,n){var s=n.ref;if(s===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(i(284));(t===null||t.ref!==s)&&(n.flags|=4194816)}}function gd(t,n,s,o,f){return $r(n),s=Qu(t,n,s,o,void 0,f),o=Zu(),t!==null&&!Ut?(Ju(t,n,f),Ca(t,n,f)):(tt&&o&&Du(n),n.flags|=1,Zt(t,n,s,f),n.child)}function Tg(t,n,s,o,f,g){return $r(n),n.updateQueue=null,s=Mh(n,o,s,f),Dh(t),o=Zu(),t!==null&&!Ut?(Ju(t,n,g),Ca(t,n,g)):(tt&&o&&Du(n),n.flags|=1,Zt(t,n,s,g),n.child)}function Ag(t,n,s,o,f){if($r(n),n.stateNode===null){var g=yl,_=s.contextType;typeof _=="object"&&_!==null&&(g=Qt(_)),g=new s(o,g),n.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=pd,n.stateNode=g,g._reactInternals=n,g=n.stateNode,g.props=o,g.state=n.memoizedState,g.refs={},Fu(n),_=s.contextType,g.context=typeof _=="object"&&_!==null?Qt(_):yl,g.state=n.memoizedState,_=s.getDerivedStateFromProps,typeof _=="function"&&(fd(n,s,_,o),g.state=n.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(_=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),_!==g.state&&pd.enqueueReplaceState(g,g.state,null),Us(n,o,g,f),Bs(),g.state=n.memoizedState),typeof g.componentDidMount=="function"&&(n.flags|=4194308),o=!0}else if(t===null){g=n.stateNode;var S=n.memoizedProps,O=Ir(s,S);g.props=O;var W=g.context,ie=s.contextType;_=yl,typeof ie=="object"&&ie!==null&&(_=Qt(ie));var fe=s.getDerivedStateFromProps;ie=typeof fe=="function"||typeof g.getSnapshotBeforeUpdate=="function",S=n.pendingProps!==S,ie||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(S||W!==_)&&gg(n,g,o,_),Ja=!1;var te=n.memoizedState;g.state=te,Us(n,o,g,f),Bs(),W=n.memoizedState,S||te!==W||Ja?(typeof fe=="function"&&(fd(n,s,fe,o),W=n.memoizedState),(O=Ja||hg(n,s,O,o,te,W,_))?(ie||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(n.flags|=4194308)):(typeof g.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=o,n.memoizedState=W),g.props=o,g.state=W,g.context=_,o=O):(typeof g.componentDidMount=="function"&&(n.flags|=4194308),o=!1)}else{g=n.stateNode,Iu(t,n),_=n.memoizedProps,ie=Ir(s,_),g.props=ie,fe=n.pendingProps,te=g.context,W=s.contextType,O=yl,typeof W=="object"&&W!==null&&(O=Qt(W)),S=s.getDerivedStateFromProps,(W=typeof S=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(_!==fe||te!==O)&&gg(n,g,o,O),Ja=!1,te=n.memoizedState,g.state=te,Us(n,o,g,f),Bs();var ae=n.memoizedState;_!==fe||te!==ae||Ja||t!==null&&t.dependencies!==null&&xo(t.dependencies)?(typeof S=="function"&&(fd(n,s,S,o),ae=n.memoizedState),(ie=Ja||hg(n,s,ie,o,te,ae,O)||t!==null&&t.dependencies!==null&&xo(t.dependencies))?(W||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(o,ae,O),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(o,ae,O)),typeof g.componentDidUpdate=="function"&&(n.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof g.componentDidUpdate!="function"||_===t.memoizedProps&&te===t.memoizedState||(n.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||_===t.memoizedProps&&te===t.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=ae),g.props=o,g.state=ae,g.context=O,o=ie):(typeof g.componentDidUpdate!="function"||_===t.memoizedProps&&te===t.memoizedState||(n.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||_===t.memoizedProps&&te===t.memoizedState||(n.flags|=1024),o=!1)}return g=o,Lo(t,n),o=(n.flags&128)!==0,g||o?(g=n.stateNode,s=o&&typeof s.getDerivedStateFromError!="function"?null:g.render(),n.flags|=1,t!==null&&o?(n.child=qr(n,t.child,null,f),n.child=qr(n,null,s,f)):Zt(t,n,s,f),n.memoizedState=g.state,t=n.child):t=Ca(t,n,f),t}function Dg(t,n,s,o){return Or(),n.flags|=256,Zt(t,n,s,o),n.child}var xd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function yd(t){return{baseLanes:t,cachePool:vh()}}function bd(t,n,s){return t=t!==null?t.childLanes&~s:0,n&&(t|=En),t}function Mg(t,n,s){var o=n.pendingProps,f=!1,g=(n.flags&128)!==0,_;if((_=g)||(_=t!==null&&t.memoizedState===null?!1:(Mt.current&2)!==0),_&&(f=!0,n.flags&=-129),_=(n.flags&32)!==0,n.flags&=-33,t===null){if(tt){if(f?tr(n):nr(),(t=vt)?(t=Hx(t,Hn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Pa!==null?{id:ca,overflow:ua}:null,retryLane:536870912,hydrationErrors:null},s=dh(t),s.return=n,n.child=s,Xt=n,vt=null)):t=null,t===null)throw Qa(n);return tf(t)?n.lanes=32:n.lanes=536870912,null}var S=o.children;return o=o.fallback,f?(nr(),f=n.mode,S=$o({mode:"hidden",children:S},f),o=Rr(o,f,s,null),S.return=n,o.return=n,S.sibling=o,n.child=S,o=n.child,o.memoizedState=yd(s),o.childLanes=bd(t,_,s),n.memoizedState=xd,Ys(null,o)):(tr(n),vd(n,S))}var O=t.memoizedState;if(O!==null&&(S=O.dehydrated,S!==null)){if(g)n.flags&256?(tr(n),n.flags&=-257,n=kd(t,n,s)):n.memoizedState!==null?(nr(),n.child=t.child,n.flags|=128,n=null):(nr(),S=o.fallback,f=n.mode,o=$o({mode:"visible",children:o.children},f),S=Rr(S,f,s,null),S.flags|=2,o.return=n,S.return=n,o.sibling=S,n.child=o,qr(n,t.child,null,s),o=n.child,o.memoizedState=yd(s),o.childLanes=bd(t,_,s),n.memoizedState=xd,n=Ys(null,o));else if(tr(n),tf(S)){if(_=S.nextSibling&&S.nextSibling.dataset,_)var W=_.dgst;_=W,o=Error(i(419)),o.stack="",o.digest=_,Ms({value:o,source:null,stack:null}),n=kd(t,n,s)}else if(Ut||_l(t,n,s,!1),_=(s&t.childLanes)!==0,Ut||_){if(_=xt,_!==null&&(o=Gi(_,s),o!==0&&o!==O.retryLane))throw O.retryLane=o,zr(t,o),gn(_,t,o),hd;ef(S)||Vo(),n=kd(t,n,s)}else ef(S)?(n.flags|=192,n.child=t.child,n=null):(t=O.treeContext,vt=Fn(S.nextSibling),Xt=n,tt=!0,Xa=null,Hn=!1,t!==null&&mh(n,t),n=vd(n,o.children),n.flags|=4096);return n}return f?(nr(),S=o.fallback,f=n.mode,O=t.child,W=O.sibling,o=ka(O,{mode:"hidden",children:o.children}),o.subtreeFlags=O.subtreeFlags&65011712,W!==null?S=ka(W,S):(S=Rr(S,f,s,null),S.flags|=2),S.return=n,o.return=n,o.sibling=S,n.child=o,Ys(null,o),o=n.child,S=t.child.memoizedState,S===null?S=yd(s):(f=S.cachePool,f!==null?(O=$t._currentValue,f=f.parent!==O?{parent:O,pool:O}:f):f=vh(),S={baseLanes:S.baseLanes|s,cachePool:f}),o.memoizedState=S,o.childLanes=bd(t,_,s),n.memoizedState=xd,Ys(t.child,o)):(tr(n),s=t.child,t=s.sibling,s=ka(s,{mode:"visible",children:o.children}),s.return=n,s.sibling=null,t!==null&&(_=n.deletions,_===null?(n.deletions=[t],n.flags|=16):_.push(t)),n.child=s,n.memoizedState=null,s)}function vd(t,n){return n=$o({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function $o(t,n){return t=jn(22,t,null,n),t.lanes=0,t}function kd(t,n,s){return qr(n,t.child,null,s),t=vd(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function zg(t,n,s){t.lanes|=n;var o=t.alternate;o!==null&&(o.lanes|=n),Lu(t.return,n,s)}function _d(t,n,s,o,f,g){var _=t.memoizedState;_===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:o,tail:s,tailMode:f,treeForkCount:g}:(_.isBackwards=n,_.rendering=null,_.renderingStartTime=0,_.last=o,_.tail=s,_.tailMode=f,_.treeForkCount=g)}function Rg(t,n,s){var o=n.pendingProps,f=o.revealOrder,g=o.tail;o=o.children;var _=Mt.current,S=(_&2)!==0;if(S?(_=_&1|2,n.flags|=128):_&=1,E(Mt,_),Zt(t,n,o,s),o=tt?Ds:0,!S&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&zg(t,s,n);else if(t.tag===19)zg(t,s,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(f){case"forwards":for(s=n.child,f=null;s!==null;)t=s.alternate,t!==null&&So(t)===null&&(f=s),s=s.sibling;s=f,s===null?(f=n.child,n.child=null):(f=s.sibling,s.sibling=null),_d(n,!1,f,s,g,o);break;case"backwards":case"unstable_legacy-backwards":for(s=null,f=n.child,n.child=null;f!==null;){if(t=f.alternate,t!==null&&So(t)===null){n.child=f;break}t=f.sibling,f.sibling=s,s=f,f=t}_d(n,!0,s,null,g,o);break;case"together":_d(n,!1,null,null,void 0,o);break;default:n.memoizedState=null}return n.child}function Ca(t,n,s){if(t!==null&&(n.dependencies=t.dependencies),lr|=n.lanes,(s&n.childLanes)===0)if(t!==null){if(_l(t,n,s,!1),(s&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error(i(153));if(n.child!==null){for(t=n.child,s=ka(t,t.pendingProps),n.child=s,s.return=n;t.sibling!==null;)t=t.sibling,s=s.sibling=ka(t,t.pendingProps),s.return=n;s.sibling=null}return n.child}function wd(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&xo(t)))}function l_(t,n,s){switch(n.tag){case 3:me(n,n.stateNode.containerInfo),Za(n,$t,t.memoizedState.cache),Or();break;case 27:case 5:U(n);break;case 4:me(n,n.stateNode.containerInfo);break;case 10:Za(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Pu(n),null;break;case 13:var o=n.memoizedState;if(o!==null)return o.dehydrated!==null?(tr(n),n.flags|=128,null):(s&n.child.childLanes)!==0?Mg(t,n,s):(tr(n),t=Ca(t,n,s),t!==null?t.sibling:null);tr(n);break;case 19:var f=(t.flags&128)!==0;if(o=(s&n.childLanes)!==0,o||(_l(t,n,s,!1),o=(s&n.childLanes)!==0),f){if(o)return Rg(t,n,s);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),E(Mt,Mt.current),o)break;return null;case 22:return n.lanes=0,Ng(t,n,s,n.pendingProps);case 24:Za(n,$t,t.memoizedState.cache)}return Ca(t,n,s)}function Og(t,n,s){if(t!==null)if(t.memoizedProps!==n.pendingProps)Ut=!0;else{if(!wd(t,s)&&(n.flags&128)===0)return Ut=!1,l_(t,n,s);Ut=(t.flags&131072)!==0}else Ut=!1,tt&&(n.flags&1048576)!==0&&ph(n,Ds,n.index);switch(n.lanes=0,n.tag){case 16:e:{var o=n.pendingProps;if(t=Ur(n.elementType),n.type=t,typeof t=="function")Eu(t)?(o=Ir(t,o),n.tag=1,n=Ag(null,n,t,o,s)):(n.tag=0,n=gd(null,n,t,o,s));else{if(t!=null){var f=t.$$typeof;if(f===ee){n.tag=11,n=wg(null,n,t,o,s);break e}else if(f===G){n.tag=14,n=jg(null,n,t,o,s);break e}}throw n=le(t)||t,Error(i(306,n,""))}}return n;case 0:return gd(t,n,n.type,n.pendingProps,s);case 1:return o=n.type,f=Ir(o,n.pendingProps),Ag(t,n,o,f,s);case 3:e:{if(me(n,n.stateNode.containerInfo),t===null)throw Error(i(387));o=n.pendingProps;var g=n.memoizedState;f=g.element,Iu(t,n),Us(n,o,null,s);var _=n.memoizedState;if(o=_.cache,Za(n,$t,o),o!==g.cache&&$u(n,[$t],s,!0),Bs(),o=_.element,g.isDehydrated)if(g={element:o,isDehydrated:!1,cache:_.cache},n.updateQueue.baseState=g,n.memoizedState=g,n.flags&256){n=Dg(t,n,o,s);break e}else if(o!==f){f=$n(Error(i(424)),n),Ms(f),n=Dg(t,n,o,s);break e}else{switch(t=n.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(vt=Fn(t.firstChild),Xt=n,tt=!0,Xa=null,Hn=!0,s=Nh(n,null,o,s),n.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(Or(),o===f){n=Ca(t,n,s);break e}Zt(t,n,o,s)}n=n.child}return n;case 26:return Lo(t,n),t===null?(s=Vx(n.type,null,n.pendingProps,null))?n.memoizedState=s:tt||(s=n.type,t=n.pendingProps,o=Wo(ve.current).createElement(s),o[Ot]=n,o[Wt]=t,Jt(o,s,t),Lt(o),n.stateNode=o):n.memoizedState=Vx(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return U(n),t===null&&tt&&(o=n.stateNode=Ix(n.type,n.pendingProps,ve.current),Xt=n,Hn=!0,f=vt,ur(n.type)?(nf=f,vt=Fn(o.firstChild)):vt=f),Zt(t,n,n.pendingProps.children,s),Lo(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&tt&&((f=o=vt)&&(o=O_(o,n.type,n.pendingProps,Hn),o!==null?(n.stateNode=o,Xt=n,vt=Fn(o.firstChild),Hn=!1,f=!0):f=!1),f||Qa(n)),U(n),f=n.type,g=n.pendingProps,_=t!==null?t.memoizedProps:null,o=g.children,Zd(f,g)?o=null:_!==null&&Zd(f,_)&&(n.flags|=32),n.memoizedState!==null&&(f=Qu(t,n,Qk,null,null,s),li._currentValue=f),Lo(t,n),Zt(t,n,o,s),n.child;case 6:return t===null&&tt&&((t=s=vt)&&(s=L_(s,n.pendingProps,Hn),s!==null?(n.stateNode=s,Xt=n,vt=null,t=!0):t=!1),t||Qa(n)),null;case 13:return Mg(t,n,s);case 4:return me(n,n.stateNode.containerInfo),o=n.pendingProps,t===null?n.child=qr(n,null,o,s):Zt(t,n,o,s),n.child;case 11:return wg(t,n,n.type,n.pendingProps,s);case 7:return Zt(t,n,n.pendingProps,s),n.child;case 8:return Zt(t,n,n.pendingProps.children,s),n.child;case 12:return Zt(t,n,n.pendingProps.children,s),n.child;case 10:return o=n.pendingProps,Za(n,n.type,o.value),Zt(t,n,o.children,s),n.child;case 9:return f=n.type._context,o=n.pendingProps.children,$r(n),f=Qt(f),o=o(f),n.flags|=1,Zt(t,n,o,s),n.child;case 14:return jg(t,n,n.type,n.pendingProps,s);case 15:return Sg(t,n,n.type,n.pendingProps,s);case 19:return Rg(t,n,s);case 31:return r_(t,n,s);case 22:return Ng(t,n,s,n.pendingProps);case 24:return $r(n),o=Qt($t),t===null?(f=Hu(),f===null&&(f=xt,g=Bu(),f.pooledCache=g,g.refCount++,g!==null&&(f.pooledCacheLanes|=s),f=g),n.memoizedState={parent:o,cache:f},Fu(n),Za(n,$t,f)):((t.lanes&s)!==0&&(Iu(t,n),Us(n,null,null,s),Bs()),f=t.memoizedState,g=n.memoizedState,f.parent!==o?(f={parent:o,cache:o},n.memoizedState=f,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=f),Za(n,$t,o)):(o=g.cache,Za(n,$t,o),o!==f.cache&&$u(n,[$t],s,!0))),Zt(t,n,n.pendingProps.children,s),n.child;case 29:throw n.pendingProps}throw Error(i(156,n.tag))}function Ea(t){t.flags|=4}function jd(t,n,s,o,f){if((n=(t.mode&32)!==0)&&(n=!1),n){if(t.flags|=16777216,(f&335544128)===f)if(t.stateNode.complete)t.flags|=8192;else if(ox())t.flags|=8192;else throw Hr=ko,qu}else t.flags&=-16777217}function Lg(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Zx(n))if(ox())t.flags|=8192;else throw Hr=ko,qu}function Bo(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?Ii():536870912,t.lanes|=n,Rl|=n)}function Gs(t,n){if(!tt)switch(t.tailMode){case"hidden":n=t.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t.tail=null:s.sibling=null;break;case"collapsed":s=t.tail;for(var o=null;s!==null;)s.alternate!==null&&(o=s),s=s.sibling;o===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:o.sibling=null}}function kt(t){var n=t.alternate!==null&&t.alternate.child===t.child,s=0,o=0;if(n)for(var f=t.child;f!==null;)s|=f.lanes|f.childLanes,o|=f.subtreeFlags&65011712,o|=f.flags&65011712,f.return=t,f=f.sibling;else for(f=t.child;f!==null;)s|=f.lanes|f.childLanes,o|=f.subtreeFlags,o|=f.flags,f.return=t,f=f.sibling;return t.subtreeFlags|=o,t.childLanes=s,n}function s_(t,n,s){var o=n.pendingProps;switch(Mu(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kt(n),null;case 1:return kt(n),null;case 3:return s=n.stateNode,o=null,t!==null&&(o=t.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),ja($t),D(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(kl(n)?Ea(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Ru())),kt(n),null;case 26:var f=n.type,g=n.memoizedState;return t===null?(Ea(n),g!==null?(kt(n),Lg(n,g)):(kt(n),jd(n,f,null,o,s))):g?g!==t.memoizedState?(Ea(n),kt(n),Lg(n,g)):(kt(n),n.flags&=-16777217):(t=t.memoizedProps,t!==o&&Ea(n),kt(n),jd(n,f,t,o,s)),null;case 27:if(be(n),s=ve.current,f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&Ea(n);else{if(!o){if(n.stateNode===null)throw Error(i(166));return kt(n),null}t=pe.current,kl(n)?hh(n):(t=Ix(f,o,s),n.stateNode=t,Ea(n))}return kt(n),null;case 5:if(be(n),f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&Ea(n);else{if(!o){if(n.stateNode===null)throw Error(i(166));return kt(n),null}if(g=pe.current,kl(n))hh(n);else{var _=Wo(ve.current);switch(g){case 1:g=_.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:g=_.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":g=_.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":g=_.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":g=_.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof o.is=="string"?_.createElement("select",{is:o.is}):_.createElement("select"),o.multiple?g.multiple=!0:o.size&&(g.size=o.size);break;default:g=typeof o.is=="string"?_.createElement(f,{is:o.is}):_.createElement(f)}}g[Ot]=n,g[Wt]=o;e:for(_=n.child;_!==null;){if(_.tag===5||_.tag===6)g.appendChild(_.stateNode);else if(_.tag!==4&&_.tag!==27&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===n)break e;for(;_.sibling===null;){if(_.return===null||_.return===n)break e;_=_.return}_.sibling.return=_.return,_=_.sibling}n.stateNode=g;e:switch(Jt(g,f,o),f){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&Ea(n)}}return kt(n),jd(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,s),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==o&&Ea(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(i(166));if(t=ve.current,kl(n)){if(t=n.stateNode,s=n.memoizedProps,o=null,f=Xt,f!==null)switch(f.tag){case 27:case 5:o=f.memoizedProps}t[Ot]=n,t=!!(t.nodeValue===s||o!==null&&o.suppressHydrationWarning===!0||Mx(t.nodeValue,s)),t||Qa(n,!0)}else t=Wo(t).createTextNode(o),t[Ot]=n,n.stateNode=t}return kt(n),null;case 31:if(s=n.memoizedState,t===null||t.memoizedState!==null){if(o=kl(n),s!==null){if(t===null){if(!o)throw Error(i(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(557));t[Ot]=n}else Or(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;kt(n),t=!1}else s=Ru(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),t=!0;if(!t)return n.flags&256?(Nn(n),n):(Nn(n),null);if((n.flags&128)!==0)throw Error(i(558))}return kt(n),null;case 13:if(o=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=kl(n),o!==null&&o.dehydrated!==null){if(t===null){if(!f)throw Error(i(318));if(f=n.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(i(317));f[Ot]=n}else Or(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;kt(n),f=!1}else f=Ru(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(Nn(n),n):(Nn(n),null)}return Nn(n),(n.flags&128)!==0?(n.lanes=s,n):(s=o!==null,t=t!==null&&t.memoizedState!==null,s&&(o=n.child,f=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(f=o.alternate.memoizedState.cachePool.pool),g=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(g=o.memoizedState.cachePool.pool),g!==f&&(o.flags|=2048)),s!==t&&s&&(n.child.flags|=8192),Bo(n,n.updateQueue),kt(n),null);case 4:return D(),t===null&&Vd(n.stateNode.containerInfo),kt(n),null;case 10:return ja(n.type),kt(n),null;case 19:if(K(Mt),o=n.memoizedState,o===null)return kt(n),null;if(f=(n.flags&128)!==0,g=o.rendering,g===null)if(f)Gs(o,!1);else{if(Dt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(g=So(t),g!==null){for(n.flags|=128,Gs(o,!1),t=g.updateQueue,n.updateQueue=t,Bo(n,t),n.subtreeFlags=0,t=s,s=n.child;s!==null;)uh(s,t),s=s.sibling;return E(Mt,Mt.current&1|2),tt&&_a(n,o.treeForkCount),n.child}t=t.sibling}o.tail!==null&&pt()>Io&&(n.flags|=128,f=!0,Gs(o,!1),n.lanes=4194304)}else{if(!f)if(t=So(g),t!==null){if(n.flags|=128,f=!0,t=t.updateQueue,n.updateQueue=t,Bo(n,t),Gs(o,!0),o.tail===null&&o.tailMode==="hidden"&&!g.alternate&&!tt)return kt(n),null}else 2*pt()-o.renderingStartTime>Io&&s!==536870912&&(n.flags|=128,f=!0,Gs(o,!1),n.lanes=4194304);o.isBackwards?(g.sibling=n.child,n.child=g):(t=o.last,t!==null?t.sibling=g:n.child=g,o.last=g)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=pt(),t.sibling=null,s=Mt.current,E(Mt,f?s&1|2:s&1),tt&&_a(n,o.treeForkCount),t):(kt(n),null);case 22:case 23:return Nn(n),Ku(),o=n.memoizedState!==null,t!==null?t.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(s&536870912)!==0&&(n.flags&128)===0&&(kt(n),n.subtreeFlags&6&&(n.flags|=8192)):kt(n),s=n.updateQueue,s!==null&&Bo(n,s.retryQueue),s=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==s&&(n.flags|=2048),t!==null&&K(Br),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),ja($t),kt(n),null;case 25:return null;case 30:return null}throw Error(i(156,n.tag))}function i_(t,n){switch(Mu(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return ja($t),D(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return be(n),null;case 31:if(n.memoizedState!==null){if(Nn(n),n.alternate===null)throw Error(i(340));Or()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(Nn(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(i(340));Or()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return K(Mt),null;case 4:return D(),null;case 10:return ja(n.type),null;case 22:case 23:return Nn(n),Ku(),t!==null&&K(Br),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return ja($t),null;case 25:return null;default:return null}}function $g(t,n){switch(Mu(n),n.tag){case 3:ja($t),D();break;case 26:case 27:case 5:be(n);break;case 4:D();break;case 31:n.memoizedState!==null&&Nn(n);break;case 13:Nn(n);break;case 19:K(Mt);break;case 10:ja(n.type);break;case 22:case 23:Nn(n),Ku(),t!==null&&K(Br);break;case 24:ja($t)}}function Vs(t,n){try{var s=n.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var f=o.next;s=f;do{if((s.tag&t)===t){o=void 0;var g=s.create,_=s.inst;o=g(),_.destroy=o}s=s.next}while(s!==f)}}catch(S){dt(n,n.return,S)}}function ar(t,n,s){try{var o=n.updateQueue,f=o!==null?o.lastEffect:null;if(f!==null){var g=f.next;o=g;do{if((o.tag&t)===t){var _=o.inst,S=_.destroy;if(S!==void 0){_.destroy=void 0,f=n;var O=s,W=S;try{W()}catch(ie){dt(f,O,ie)}}}o=o.next}while(o!==g)}}catch(ie){dt(n,n.return,ie)}}function Bg(t){var n=t.updateQueue;if(n!==null){var s=t.stateNode;try{Eh(n,s)}catch(o){dt(t,t.return,o)}}}function Ug(t,n,s){s.props=Ir(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(o){dt(t,n,o)}}function Ks(t,n){try{var s=t.ref;if(s!==null){switch(t.tag){case 26:case 27:case 5:var o=t.stateNode;break;case 30:o=t.stateNode;break;default:o=t.stateNode}typeof s=="function"?t.refCleanup=s(o):s.current=o}}catch(f){dt(t,n,f)}}function da(t,n){var s=t.ref,o=t.refCleanup;if(s!==null)if(typeof o=="function")try{o()}catch(f){dt(t,n,f)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(f){dt(t,n,f)}else s.current=null}function Hg(t){var n=t.type,s=t.memoizedProps,o=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":s.autoFocus&&o.focus();break e;case"img":s.src?o.src=s.src:s.srcSet&&(o.srcset=s.srcSet)}}catch(f){dt(t,t.return,f)}}function Sd(t,n,s){try{var o=t.stateNode;T_(o,t.type,s,n),o[Wt]=n}catch(f){dt(t,t.return,f)}}function qg(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ur(t.type)||t.tag===4}function Nd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||qg(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&ur(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Cd(t,n,s){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(t,n):(n=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,n.appendChild(t),s=s._reactRootContainer,s!=null||n.onclick!==null||(n.onclick=ba));else if(o!==4&&(o===27&&ur(t.type)&&(s=t.stateNode,n=null),t=t.child,t!==null))for(Cd(t,n,s),t=t.sibling;t!==null;)Cd(t,n,s),t=t.sibling}function Uo(t,n,s){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?s.insertBefore(t,n):s.appendChild(t);else if(o!==4&&(o===27&&ur(t.type)&&(s=t.stateNode),t=t.child,t!==null))for(Uo(t,n,s),t=t.sibling;t!==null;)Uo(t,n,s),t=t.sibling}function Fg(t){var n=t.stateNode,s=t.memoizedProps;try{for(var o=t.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);Jt(n,o,s),n[Ot]=t,n[Wt]=s}catch(g){dt(t,t.return,g)}}var Ta=!1,Ht=!1,Ed=!1,Ig=typeof WeakSet=="function"?WeakSet:Set,Kt=null;function o_(t,n){if(t=t.containerInfo,Xd=sc,t=th(t),ku(t)){if("selectionStart"in t)var s={start:t.selectionStart,end:t.selectionEnd};else e:{s=(s=t.ownerDocument)&&s.defaultView||window;var o=s.getSelection&&s.getSelection();if(o&&o.rangeCount!==0){s=o.anchorNode;var f=o.anchorOffset,g=o.focusNode;o=o.focusOffset;try{s.nodeType,g.nodeType}catch{s=null;break e}var _=0,S=-1,O=-1,W=0,ie=0,fe=t,te=null;t:for(;;){for(var ae;fe!==s||f!==0&&fe.nodeType!==3||(S=_+f),fe!==g||o!==0&&fe.nodeType!==3||(O=_+o),fe.nodeType===3&&(_+=fe.nodeValue.length),(ae=fe.firstChild)!==null;)te=fe,fe=ae;for(;;){if(fe===t)break t;if(te===s&&++W===f&&(S=_),te===g&&++ie===o&&(O=_),(ae=fe.nextSibling)!==null)break;fe=te,te=fe.parentNode}fe=ae}s=S===-1||O===-1?null:{start:S,end:O}}else s=null}s=s||{start:0,end:0}}else s=null;for(Qd={focusedElem:t,selectionRange:s},sc=!1,Kt=n;Kt!==null;)if(n=Kt,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,Kt=t;else for(;Kt!==null;){switch(n=Kt,g=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(s=0;s<t.length;s++)f=t[s],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&g!==null){t=void 0,s=n,f=g.memoizedProps,g=g.memoizedState,o=s.stateNode;try{var we=Ir(s.type,f);t=o.getSnapshotBeforeUpdate(we,g),o.__reactInternalSnapshotBeforeUpdate=t}catch(Oe){dt(s,s.return,Oe)}}break;case 3:if((t&1024)!==0){if(t=n.stateNode.containerInfo,s=t.nodeType,s===9)Wd(t);else if(s===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Wd(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(i(163))}if(t=n.sibling,t!==null){t.return=n.return,Kt=t;break}Kt=n.return}}function Yg(t,n,s){var o=s.flags;switch(s.tag){case 0:case 11:case 15:Da(t,s),o&4&&Vs(5,s);break;case 1:if(Da(t,s),o&4)if(t=s.stateNode,n===null)try{t.componentDidMount()}catch(_){dt(s,s.return,_)}else{var f=Ir(s.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(f,n,t.__reactInternalSnapshotBeforeUpdate)}catch(_){dt(s,s.return,_)}}o&64&&Bg(s),o&512&&Ks(s,s.return);break;case 3:if(Da(t,s),o&64&&(t=s.updateQueue,t!==null)){if(n=null,s.child!==null)switch(s.child.tag){case 27:case 5:n=s.child.stateNode;break;case 1:n=s.child.stateNode}try{Eh(t,n)}catch(_){dt(s,s.return,_)}}break;case 27:n===null&&o&4&&Fg(s);case 26:case 5:Da(t,s),n===null&&o&4&&Hg(s),o&512&&Ks(s,s.return);break;case 12:Da(t,s);break;case 31:Da(t,s),o&4&&Kg(t,s);break;case 13:Da(t,s),o&4&&Pg(t,s),o&64&&(t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(s=x_.bind(null,s),$_(t,s))));break;case 22:if(o=s.memoizedState!==null||Ta,!o){n=n!==null&&n.memoizedState!==null||Ht,f=Ta;var g=Ht;Ta=o,(Ht=n)&&!g?Ma(t,s,(s.subtreeFlags&8772)!==0):Da(t,s),Ta=f,Ht=g}break;case 30:break;default:Da(t,s)}}function Gg(t){var n=t.alternate;n!==null&&(t.alternate=null,Gg(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&Xi(n)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var jt=null,fn=!1;function Aa(t,n,s){for(s=s.child;s!==null;)Vg(t,n,s),s=s.sibling}function Vg(t,n,s){if(Le&&typeof Le.onCommitFiberUnmount=="function")try{Le.onCommitFiberUnmount(Ae,s)}catch{}switch(s.tag){case 26:Ht||da(s,n),Aa(t,n,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Ht||da(s,n);var o=jt,f=fn;ur(s.type)&&(jt=s.stateNode,fn=!1),Aa(t,n,s),ni(s.stateNode),jt=o,fn=f;break;case 5:Ht||da(s,n);case 6:if(o=jt,f=fn,jt=null,Aa(t,n,s),jt=o,fn=f,jt!==null)if(fn)try{(jt.nodeType===9?jt.body:jt.nodeName==="HTML"?jt.ownerDocument.body:jt).removeChild(s.stateNode)}catch(g){dt(s,n,g)}else try{jt.removeChild(s.stateNode)}catch(g){dt(s,n,g)}break;case 18:jt!==null&&(fn?(t=jt,Bx(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,s.stateNode),Fl(t)):Bx(jt,s.stateNode));break;case 4:o=jt,f=fn,jt=s.stateNode.containerInfo,fn=!0,Aa(t,n,s),jt=o,fn=f;break;case 0:case 11:case 14:case 15:ar(2,s,n),Ht||ar(4,s,n),Aa(t,n,s);break;case 1:Ht||(da(s,n),o=s.stateNode,typeof o.componentWillUnmount=="function"&&Ug(s,n,o)),Aa(t,n,s);break;case 21:Aa(t,n,s);break;case 22:Ht=(o=Ht)||s.memoizedState!==null,Aa(t,n,s),Ht=o;break;default:Aa(t,n,s)}}function Kg(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Fl(t)}catch(s){dt(n,n.return,s)}}}function Pg(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Fl(t)}catch(s){dt(n,n.return,s)}}function c_(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new Ig),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new Ig),n;default:throw Error(i(435,t.tag))}}function Ho(t,n){var s=c_(t);n.forEach(function(o){if(!s.has(o)){s.add(o);var f=y_.bind(null,t,o);o.then(f,f)}})}function pn(t,n){var s=n.deletions;if(s!==null)for(var o=0;o<s.length;o++){var f=s[o],g=t,_=n,S=_;e:for(;S!==null;){switch(S.tag){case 27:if(ur(S.type)){jt=S.stateNode,fn=!1;break e}break;case 5:jt=S.stateNode,fn=!1;break e;case 3:case 4:jt=S.stateNode.containerInfo,fn=!0;break e}S=S.return}if(jt===null)throw Error(i(160));Vg(g,_,f),jt=null,fn=!1,g=f.alternate,g!==null&&(g.return=null),f.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Xg(n,t),n=n.sibling}var ea=null;function Xg(t,n){var s=t.alternate,o=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:pn(n,t),mn(t),o&4&&(ar(3,t,t.return),Vs(3,t),ar(5,t,t.return));break;case 1:pn(n,t),mn(t),o&512&&(Ht||s===null||da(s,s.return)),o&64&&Ta&&(t=t.updateQueue,t!==null&&(o=t.callbacks,o!==null&&(s=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=s===null?o:s.concat(o))));break;case 26:var f=ea;if(pn(n,t),mn(t),o&512&&(Ht||s===null||da(s,s.return)),o&4){var g=s!==null?s.memoizedState:null;if(o=t.memoizedState,s===null)if(o===null)if(t.stateNode===null){e:{o=t.type,s=t.memoizedProps,f=f.ownerDocument||f;t:switch(o){case"title":g=f.getElementsByTagName("title")[0],(!g||g[Ia]||g[Ot]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=f.createElement(o),f.head.insertBefore(g,f.querySelector("head > title"))),Jt(g,o,s),g[Ot]=t,Lt(g),o=g;break e;case"link":var _=Xx("link","href",f).get(o+(s.href||""));if(_){for(var S=0;S<_.length;S++)if(g=_[S],g.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&g.getAttribute("rel")===(s.rel==null?null:s.rel)&&g.getAttribute("title")===(s.title==null?null:s.title)&&g.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){_.splice(S,1);break t}}g=f.createElement(o),Jt(g,o,s),f.head.appendChild(g);break;case"meta":if(_=Xx("meta","content",f).get(o+(s.content||""))){for(S=0;S<_.length;S++)if(g=_[S],g.getAttribute("content")===(s.content==null?null:""+s.content)&&g.getAttribute("name")===(s.name==null?null:s.name)&&g.getAttribute("property")===(s.property==null?null:s.property)&&g.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&g.getAttribute("charset")===(s.charSet==null?null:s.charSet)){_.splice(S,1);break t}}g=f.createElement(o),Jt(g,o,s),f.head.appendChild(g);break;default:throw Error(i(468,o))}g[Ot]=t,Lt(g),o=g}t.stateNode=o}else Qx(f,t.type,t.stateNode);else t.stateNode=Px(f,o,t.memoizedProps);else g!==o?(g===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):g.count--,o===null?Qx(f,t.type,t.stateNode):Px(f,o,t.memoizedProps)):o===null&&t.stateNode!==null&&Sd(t,t.memoizedProps,s.memoizedProps)}break;case 27:pn(n,t),mn(t),o&512&&(Ht||s===null||da(s,s.return)),s!==null&&o&4&&Sd(t,t.memoizedProps,s.memoizedProps);break;case 5:if(pn(n,t),mn(t),o&512&&(Ht||s===null||da(s,s.return)),t.flags&32){f=t.stateNode;try{Fe(f,"")}catch(we){dt(t,t.return,we)}}o&4&&t.stateNode!=null&&(f=t.memoizedProps,Sd(t,f,s!==null?s.memoizedProps:f)),o&1024&&(Ed=!0);break;case 6:if(pn(n,t),mn(t),o&4){if(t.stateNode===null)throw Error(i(162));o=t.memoizedProps,s=t.stateNode;try{s.nodeValue=o}catch(we){dt(t,t.return,we)}}break;case 3:if(nc=null,f=ea,ea=ec(n.containerInfo),pn(n,t),ea=f,mn(t),o&4&&s!==null&&s.memoizedState.isDehydrated)try{Fl(n.containerInfo)}catch(we){dt(t,t.return,we)}Ed&&(Ed=!1,Qg(t));break;case 4:o=ea,ea=ec(t.stateNode.containerInfo),pn(n,t),mn(t),ea=o;break;case 12:pn(n,t),mn(t);break;case 31:pn(n,t),mn(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Ho(t,o)));break;case 13:pn(n,t),mn(t),t.child.flags&8192&&t.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Fo=pt()),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Ho(t,o)));break;case 22:f=t.memoizedState!==null;var O=s!==null&&s.memoizedState!==null,W=Ta,ie=Ht;if(Ta=W||f,Ht=ie||O,pn(n,t),Ht=ie,Ta=W,mn(t),o&8192)e:for(n=t.stateNode,n._visibility=f?n._visibility&-2:n._visibility|1,f&&(s===null||O||Ta||Ht||Yr(t)),s=null,n=t;;){if(n.tag===5||n.tag===26){if(s===null){O=s=n;try{if(g=O.stateNode,f)_=g.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{S=O.stateNode;var fe=O.memoizedProps.style,te=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;S.style.display=te==null||typeof te=="boolean"?"":(""+te).trim()}}catch(we){dt(O,O.return,we)}}}else if(n.tag===6){if(s===null){O=n;try{O.stateNode.nodeValue=f?"":O.memoizedProps}catch(we){dt(O,O.return,we)}}}else if(n.tag===18){if(s===null){O=n;try{var ae=O.stateNode;f?Ux(ae,!0):Ux(O.stateNode,!1)}catch(we){dt(O,O.return,we)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===t)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break e;for(;n.sibling===null;){if(n.return===null||n.return===t)break e;s===n&&(s=null),n=n.return}s===n&&(s=null),n.sibling.return=n.return,n=n.sibling}o&4&&(o=t.updateQueue,o!==null&&(s=o.retryQueue,s!==null&&(o.retryQueue=null,Ho(t,s))));break;case 19:pn(n,t),mn(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Ho(t,o)));break;case 30:break;case 21:break;default:pn(n,t),mn(t)}}function mn(t){var n=t.flags;if(n&2){try{for(var s,o=t.return;o!==null;){if(qg(o)){s=o;break}o=o.return}if(s==null)throw Error(i(160));switch(s.tag){case 27:var f=s.stateNode,g=Nd(t);Uo(t,g,f);break;case 5:var _=s.stateNode;s.flags&32&&(Fe(_,""),s.flags&=-33);var S=Nd(t);Uo(t,S,_);break;case 3:case 4:var O=s.stateNode.containerInfo,W=Nd(t);Cd(t,W,O);break;default:throw Error(i(161))}}catch(ie){dt(t,t.return,ie)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function Qg(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;Qg(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function Da(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Yg(t,n.alternate,n),n=n.sibling}function Yr(t){for(t=t.child;t!==null;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:ar(4,n,n.return),Yr(n);break;case 1:da(n,n.return);var s=n.stateNode;typeof s.componentWillUnmount=="function"&&Ug(n,n.return,s),Yr(n);break;case 27:ni(n.stateNode);case 26:case 5:da(n,n.return),Yr(n);break;case 22:n.memoizedState===null&&Yr(n);break;case 30:Yr(n);break;default:Yr(n)}t=t.sibling}}function Ma(t,n,s){for(s=s&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var o=n.alternate,f=t,g=n,_=g.flags;switch(g.tag){case 0:case 11:case 15:Ma(f,g,s),Vs(4,g);break;case 1:if(Ma(f,g,s),o=g,f=o.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(W){dt(o,o.return,W)}if(o=g,f=o.updateQueue,f!==null){var S=o.stateNode;try{var O=f.shared.hiddenCallbacks;if(O!==null)for(f.shared.hiddenCallbacks=null,f=0;f<O.length;f++)Ch(O[f],S)}catch(W){dt(o,o.return,W)}}s&&_&64&&Bg(g),Ks(g,g.return);break;case 27:Fg(g);case 26:case 5:Ma(f,g,s),s&&o===null&&_&4&&Hg(g),Ks(g,g.return);break;case 12:Ma(f,g,s);break;case 31:Ma(f,g,s),s&&_&4&&Kg(f,g);break;case 13:Ma(f,g,s),s&&_&4&&Pg(f,g);break;case 22:g.memoizedState===null&&Ma(f,g,s),Ks(g,g.return);break;case 30:break;default:Ma(f,g,s)}n=n.sibling}}function Td(t,n){var s=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==s&&(t!=null&&t.refCount++,s!=null&&zs(s))}function Ad(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&zs(t))}function ta(t,n,s,o){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Zg(t,n,s,o),n=n.sibling}function Zg(t,n,s,o){var f=n.flags;switch(n.tag){case 0:case 11:case 15:ta(t,n,s,o),f&2048&&Vs(9,n);break;case 1:ta(t,n,s,o);break;case 3:ta(t,n,s,o),f&2048&&(t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&zs(t)));break;case 12:if(f&2048){ta(t,n,s,o),t=n.stateNode;try{var g=n.memoizedProps,_=g.id,S=g.onPostCommit;typeof S=="function"&&S(_,n.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(O){dt(n,n.return,O)}}else ta(t,n,s,o);break;case 31:ta(t,n,s,o);break;case 13:ta(t,n,s,o);break;case 23:break;case 22:g=n.stateNode,_=n.alternate,n.memoizedState!==null?g._visibility&2?ta(t,n,s,o):Ps(t,n):g._visibility&2?ta(t,n,s,o):(g._visibility|=2,Dl(t,n,s,o,(n.subtreeFlags&10256)!==0||!1)),f&2048&&Td(_,n);break;case 24:ta(t,n,s,o),f&2048&&Ad(n.alternate,n);break;default:ta(t,n,s,o)}}function Dl(t,n,s,o,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var g=t,_=n,S=s,O=o,W=_.flags;switch(_.tag){case 0:case 11:case 15:Dl(g,_,S,O,f),Vs(8,_);break;case 23:break;case 22:var ie=_.stateNode;_.memoizedState!==null?ie._visibility&2?Dl(g,_,S,O,f):Ps(g,_):(ie._visibility|=2,Dl(g,_,S,O,f)),f&&W&2048&&Td(_.alternate,_);break;case 24:Dl(g,_,S,O,f),f&&W&2048&&Ad(_.alternate,_);break;default:Dl(g,_,S,O,f)}n=n.sibling}}function Ps(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var s=t,o=n,f=o.flags;switch(o.tag){case 22:Ps(s,o),f&2048&&Td(o.alternate,o);break;case 24:Ps(s,o),f&2048&&Ad(o.alternate,o);break;default:Ps(s,o)}n=n.sibling}}var Xs=8192;function Ml(t,n,s){if(t.subtreeFlags&Xs)for(t=t.child;t!==null;)Jg(t,n,s),t=t.sibling}function Jg(t,n,s){switch(t.tag){case 26:Ml(t,n,s),t.flags&Xs&&t.memoizedState!==null&&X_(s,ea,t.memoizedState,t.memoizedProps);break;case 5:Ml(t,n,s);break;case 3:case 4:var o=ea;ea=ec(t.stateNode.containerInfo),Ml(t,n,s),ea=o;break;case 22:t.memoizedState===null&&(o=t.alternate,o!==null&&o.memoizedState!==null?(o=Xs,Xs=16777216,Ml(t,n,s),Xs=o):Ml(t,n,s));break;default:Ml(t,n,s)}}function Wg(t){var n=t.alternate;if(n!==null&&(t=n.child,t!==null)){n.child=null;do n=t.sibling,t.sibling=null,t=n;while(t!==null)}}function Qs(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var o=n[s];Kt=o,tx(o,t)}Wg(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)ex(t),t=t.sibling}function ex(t){switch(t.tag){case 0:case 11:case 15:Qs(t),t.flags&2048&&ar(9,t,t.return);break;case 3:Qs(t);break;case 12:Qs(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,qo(t)):Qs(t);break;default:Qs(t)}}function qo(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var o=n[s];Kt=o,tx(o,t)}Wg(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:ar(8,n,n.return),qo(n);break;case 22:s=n.stateNode,s._visibility&2&&(s._visibility&=-3,qo(n));break;default:qo(n)}t=t.sibling}}function tx(t,n){for(;Kt!==null;){var s=Kt;switch(s.tag){case 0:case 11:case 15:ar(8,s,n);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var o=s.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:zs(s.memoizedState.cache)}if(o=s.child,o!==null)o.return=s,Kt=o;else e:for(s=t;Kt!==null;){o=Kt;var f=o.sibling,g=o.return;if(Gg(o),o===s){Kt=null;break e}if(f!==null){f.return=g,Kt=f;break e}Kt=g}}}var u_={getCacheForType:function(t){var n=Qt($t),s=n.data.get(t);return s===void 0&&(s=t(),n.data.set(t,s)),s},cacheSignal:function(){return Qt($t).controller.signal}},d_=typeof WeakMap=="function"?WeakMap:Map,it=0,xt=null,Pe=null,We=0,ut=0,Cn=null,rr=!1,zl=!1,Dd=!1,za=0,Dt=0,lr=0,Gr=0,Md=0,En=0,Rl=0,Zs=null,hn=null,zd=!1,Fo=0,nx=0,Io=1/0,Yo=null,sr=null,Yt=0,ir=null,Ol=null,Ra=0,Rd=0,Od=null,ax=null,Js=0,Ld=null;function Tn(){return(it&2)!==0&&We!==0?We&-We:L.T!==null?Fd():Vi()}function rx(){if(En===0)if((We&536870912)===0||tt){var t=ot;ot<<=1,(ot&3932160)===0&&(ot=262144),En=t}else En=536870912;return t=Sn.current,t!==null&&(t.flags|=32),En}function gn(t,n,s){(t===xt&&(ut===2||ut===9)||t.cancelPendingCommit!==null)&&(Ll(t,0),or(t,We,En,!1)),Qn(t,s),((it&2)===0||t!==xt)&&(t===xt&&((it&2)===0&&(Gr|=s),Dt===4&&or(t,We,En,!1)),fa(t))}function lx(t,n,s){if((it&6)!==0)throw Error(i(327));var o=!s&&(n&127)===0&&(n&t.expiredLanes)===0||Fa(t,n),f=o?m_(t,n):Bd(t,n,!0),g=o;do{if(f===0){zl&&!o&&or(t,n,0,!1);break}else{if(s=t.current.alternate,g&&!f_(s)){f=Bd(t,n,!1),g=!1;continue}if(f===2){if(g=n,t.errorRecoveryDisabledLanes&g)var _=0;else _=t.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){n=_;e:{var S=t;f=Zs;var O=S.current.memoizedState.isDehydrated;if(O&&(Ll(S,_).flags|=256),_=Bd(S,_,!1),_!==2){if(Dd&&!O){S.errorRecoveryDisabledLanes|=g,Gr|=g,f=4;break e}g=hn,hn=f,g!==null&&(hn===null?hn=g:hn.push.apply(hn,g))}f=_}if(g=!1,f!==2)continue}}if(f===1){Ll(t,0),or(t,n,0,!0);break}e:{switch(o=t,g=f,g){case 0:case 1:throw Error(i(345));case 4:if((n&4194048)!==n)break;case 6:or(o,n,En,!rr);break e;case 2:hn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((n&62914560)===n&&(f=Fo+300-pt(),10<f)){if(or(o,n,En,!rr),He(o,0,!0)!==0)break e;Ra=n,o.timeoutHandle=Lx(sx.bind(null,o,s,hn,Yo,zd,n,En,Gr,Rl,rr,g,"Throttled",-0,0),f);break e}sx(o,s,hn,Yo,zd,n,En,Gr,Rl,rr,g,null,-0,0)}}break}while(!0);fa(t)}function sx(t,n,s,o,f,g,_,S,O,W,ie,fe,te,ae){if(t.timeoutHandle=-1,fe=n.subtreeFlags,fe&8192||(fe&16785408)===16785408){fe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ba},Jg(n,g,fe);var we=(g&62914560)===g?Fo-pt():(g&4194048)===g?nx-pt():0;if(we=Q_(fe,we),we!==null){Ra=g,t.cancelPendingCommit=we(mx.bind(null,t,n,g,s,o,f,_,S,O,ie,fe,null,te,ae)),or(t,g,_,!W);return}}mx(t,n,g,s,o,f,_,S,O)}function f_(t){for(var n=t;;){var s=n.tag;if((s===0||s===11||s===15)&&n.flags&16384&&(s=n.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var o=0;o<s.length;o++){var f=s[o],g=f.getSnapshot;f=f.value;try{if(!wn(g(),f))return!1}catch{return!1}}if(s=n.child,n.subtreeFlags&16384&&s!==null)s.return=n,n=s;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function or(t,n,s,o){n&=~Md,n&=~Gr,t.suspendedLanes|=n,t.pingedLanes&=~n,o&&(t.warmLanes|=n),o=t.expirationTimes;for(var f=n;0<f;){var g=31-Me(f),_=1<<g;o[g]=-1,f&=~_}s!==0&&Yi(t,s,n)}function Go(){return(it&6)===0?(Ws(0),!1):!0}function $d(){if(Pe!==null){if(ut===0)var t=Pe.return;else t=Pe,wa=Lr=null,Wu(t),Nl=null,Os=0,t=Pe;for(;t!==null;)$g(t.alternate,t),t=t.return;Pe=null}}function Ll(t,n){var s=t.timeoutHandle;s!==-1&&(t.timeoutHandle=-1,M_(s)),s=t.cancelPendingCommit,s!==null&&(t.cancelPendingCommit=null,s()),Ra=0,$d(),xt=t,Pe=s=ka(t.current,null),We=n,ut=0,Cn=null,rr=!1,zl=Fa(t,n),Dd=!1,Rl=En=Md=Gr=lr=Dt=0,hn=Zs=null,zd=!1,(n&8)!==0&&(n|=n&32);var o=t.entangledLanes;if(o!==0)for(t=t.entanglements,o&=n;0<o;){var f=31-Me(o),g=1<<f;n|=t[f],o&=~g}return za=n,fo(),s}function ix(t,n){Ie=null,L.H=Is,n===Sl||n===vo?(n=wh(),ut=3):n===qu?(n=wh(),ut=4):ut=n===hd?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Cn=n,Pe===null&&(Dt=1,Ro(t,$n(n,t.current)))}function ox(){var t=Sn.current;return t===null?!0:(We&4194048)===We?qn===null:(We&62914560)===We||(We&536870912)!==0?t===qn:!1}function cx(){var t=L.H;return L.H=Is,t===null?Is:t}function ux(){var t=L.A;return L.A=u_,t}function Vo(){Dt=4,rr||(We&4194048)!==We&&Sn.current!==null||(zl=!0),(lr&134217727)===0&&(Gr&134217727)===0||xt===null||or(xt,We,En,!1)}function Bd(t,n,s){var o=it;it|=2;var f=cx(),g=ux();(xt!==t||We!==n)&&(Yo=null,Ll(t,n)),n=!1;var _=Dt;e:do try{if(ut!==0&&Pe!==null){var S=Pe,O=Cn;switch(ut){case 8:$d(),_=6;break e;case 3:case 2:case 9:case 6:Sn.current===null&&(n=!0);var W=ut;if(ut=0,Cn=null,$l(t,S,O,W),s&&zl){_=0;break e}break;default:W=ut,ut=0,Cn=null,$l(t,S,O,W)}}p_(),_=Dt;break}catch(ie){ix(t,ie)}while(!0);return n&&t.shellSuspendCounter++,wa=Lr=null,it=o,L.H=f,L.A=g,Pe===null&&(xt=null,We=0,fo()),_}function p_(){for(;Pe!==null;)dx(Pe)}function m_(t,n){var s=it;it|=2;var o=cx(),f=ux();xt!==t||We!==n?(Yo=null,Io=pt()+500,Ll(t,n)):zl=Fa(t,n);e:do try{if(ut!==0&&Pe!==null){n=Pe;var g=Cn;t:switch(ut){case 1:ut=0,Cn=null,$l(t,n,g,1);break;case 2:case 9:if(kh(g)){ut=0,Cn=null,fx(n);break}n=function(){ut!==2&&ut!==9||xt!==t||(ut=7),fa(t)},g.then(n,n);break e;case 3:ut=7;break e;case 4:ut=5;break e;case 7:kh(g)?(ut=0,Cn=null,fx(n)):(ut=0,Cn=null,$l(t,n,g,7));break;case 5:var _=null;switch(Pe.tag){case 26:_=Pe.memoizedState;case 5:case 27:var S=Pe;if(_?Zx(_):S.stateNode.complete){ut=0,Cn=null;var O=S.sibling;if(O!==null)Pe=O;else{var W=S.return;W!==null?(Pe=W,Ko(W)):Pe=null}break t}}ut=0,Cn=null,$l(t,n,g,5);break;case 6:ut=0,Cn=null,$l(t,n,g,6);break;case 8:$d(),Dt=6;break e;default:throw Error(i(462))}}h_();break}catch(ie){ix(t,ie)}while(!0);return wa=Lr=null,L.H=o,L.A=f,it=s,Pe!==null?0:(xt=null,We=0,fo(),Dt)}function h_(){for(;Pe!==null&&!vn();)dx(Pe)}function dx(t){var n=Og(t.alternate,t,za);t.memoizedProps=t.pendingProps,n===null?Ko(t):Pe=n}function fx(t){var n=t,s=n.alternate;switch(n.tag){case 15:case 0:n=Tg(s,n,n.pendingProps,n.type,void 0,We);break;case 11:n=Tg(s,n,n.pendingProps,n.type.render,n.ref,We);break;case 5:Wu(n);default:$g(s,n),n=Pe=uh(n,za),n=Og(s,n,za)}t.memoizedProps=t.pendingProps,n===null?Ko(t):Pe=n}function $l(t,n,s,o){wa=Lr=null,Wu(n),Nl=null,Os=0;var f=n.return;try{if(a_(t,f,n,s,We)){Dt=1,Ro(t,$n(s,t.current)),Pe=null;return}}catch(g){if(f!==null)throw Pe=f,g;Dt=1,Ro(t,$n(s,t.current)),Pe=null;return}n.flags&32768?(tt||o===1?t=!0:zl||(We&536870912)!==0?t=!1:(rr=t=!0,(o===2||o===9||o===3||o===6)&&(o=Sn.current,o!==null&&o.tag===13&&(o.flags|=16384))),px(n,t)):Ko(n)}function Ko(t){var n=t;do{if((n.flags&32768)!==0){px(n,rr);return}t=n.return;var s=s_(n.alternate,n,za);if(s!==null){Pe=s;return}if(n=n.sibling,n!==null){Pe=n;return}Pe=n=t}while(n!==null);Dt===0&&(Dt=5)}function px(t,n){do{var s=i_(t.alternate,t);if(s!==null){s.flags&=32767,Pe=s;return}if(s=t.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!n&&(t=t.sibling,t!==null)){Pe=t;return}Pe=t=s}while(t!==null);Dt=6,Pe=null}function mx(t,n,s,o,f,g,_,S,O){t.cancelPendingCommit=null;do Po();while(Yt!==0);if((it&6)!==0)throw Error(i(327));if(n!==null){if(n===t.current)throw Error(i(177));if(g=n.lanes|n.childLanes,g|=Nu,su(t,s,g,_,S,O),t===xt&&(Pe=xt=null,We=0),Ol=n,ir=t,Ra=s,Rd=g,Od=f,ax=o,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,b_(Te,function(){return bx(),null})):(t.callbackNode=null,t.callbackPriority=0),o=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||o){o=L.T,L.T=null,f=q.p,q.p=2,_=it,it|=4;try{o_(t,n,s)}finally{it=_,q.p=f,L.T=o}}Yt=1,hx(),gx(),xx()}}function hx(){if(Yt===1){Yt=0;var t=ir,n=Ol,s=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||s){s=L.T,L.T=null;var o=q.p;q.p=2;var f=it;it|=4;try{Xg(n,t);var g=Qd,_=th(t.containerInfo),S=g.focusedElem,O=g.selectionRange;if(_!==S&&S&&S.ownerDocument&&eh(S.ownerDocument.documentElement,S)){if(O!==null&&ku(S)){var W=O.start,ie=O.end;if(ie===void 0&&(ie=W),"selectionStart"in S)S.selectionStart=W,S.selectionEnd=Math.min(ie,S.value.length);else{var fe=S.ownerDocument||document,te=fe&&fe.defaultView||window;if(te.getSelection){var ae=te.getSelection(),we=S.textContent.length,Oe=Math.min(O.start,we),gt=O.end===void 0?Oe:Math.min(O.end,we);!ae.extend&&Oe>gt&&(_=gt,gt=Oe,Oe=_);var P=Wm(S,Oe),H=Wm(S,gt);if(P&&H&&(ae.rangeCount!==1||ae.anchorNode!==P.node||ae.anchorOffset!==P.offset||ae.focusNode!==H.node||ae.focusOffset!==H.offset)){var Z=fe.createRange();Z.setStart(P.node,P.offset),ae.removeAllRanges(),Oe>gt?(ae.addRange(Z),ae.extend(H.node,H.offset)):(Z.setEnd(H.node,H.offset),ae.addRange(Z))}}}}for(fe=[],ae=S;ae=ae.parentNode;)ae.nodeType===1&&fe.push({element:ae,left:ae.scrollLeft,top:ae.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<fe.length;S++){var de=fe[S];de.element.scrollLeft=de.left,de.element.scrollTop=de.top}}sc=!!Xd,Qd=Xd=null}finally{it=f,q.p=o,L.T=s}}t.current=n,Yt=2}}function gx(){if(Yt===2){Yt=0;var t=ir,n=Ol,s=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||s){s=L.T,L.T=null;var o=q.p;q.p=2;var f=it;it|=4;try{Yg(t,n.alternate,n)}finally{it=f,q.p=o,L.T=s}}Yt=3}}function xx(){if(Yt===4||Yt===3){Yt=0,Pn();var t=ir,n=Ol,s=Ra,o=ax;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Yt=5:(Yt=0,Ol=ir=null,yx(t,t.pendingLanes));var f=t.pendingLanes;if(f===0&&(sr=null),xs(s),n=n.stateNode,Le&&typeof Le.onCommitFiberRoot=="function")try{Le.onCommitFiberRoot(Ae,n,void 0,(n.current.flags&128)===128)}catch{}if(o!==null){n=L.T,f=q.p,q.p=2,L.T=null;try{for(var g=t.onRecoverableError,_=0;_<o.length;_++){var S=o[_];g(S.value,{componentStack:S.stack})}}finally{L.T=n,q.p=f}}(Ra&3)!==0&&Po(),fa(t),f=t.pendingLanes,(s&261930)!==0&&(f&42)!==0?t===Ld?Js++:(Js=0,Ld=t):Js=0,Ws(0)}}function yx(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,zs(n)))}function Po(){return hx(),gx(),xx(),bx()}function bx(){if(Yt!==5)return!1;var t=ir,n=Rd;Rd=0;var s=xs(Ra),o=L.T,f=q.p;try{q.p=32>s?32:s,L.T=null,s=Od,Od=null;var g=ir,_=Ra;if(Yt=0,Ol=ir=null,Ra=0,(it&6)!==0)throw Error(i(331));var S=it;if(it|=4,ex(g.current),Zg(g,g.current,_,s),it=S,Ws(0,!1),Le&&typeof Le.onPostCommitFiberRoot=="function")try{Le.onPostCommitFiberRoot(Ae,g)}catch{}return!0}finally{q.p=f,L.T=o,yx(t,n)}}function vx(t,n,s){n=$n(s,n),n=md(t.stateNode,n,2),t=er(t,n,2),t!==null&&(Qn(t,2),fa(t))}function dt(t,n,s){if(t.tag===3)vx(t,t,s);else for(;n!==null;){if(n.tag===3){vx(n,t,s);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(sr===null||!sr.has(o))){t=$n(s,t),s=kg(2),o=er(n,s,2),o!==null&&(_g(s,o,n,t),Qn(o,2),fa(o));break}}n=n.return}}function Ud(t,n,s){var o=t.pingCache;if(o===null){o=t.pingCache=new d_;var f=new Set;o.set(n,f)}else f=o.get(n),f===void 0&&(f=new Set,o.set(n,f));f.has(s)||(Dd=!0,f.add(s),t=g_.bind(null,t,n,s),n.then(t,t))}function g_(t,n,s){var o=t.pingCache;o!==null&&o.delete(n),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,xt===t&&(We&s)===s&&(Dt===4||Dt===3&&(We&62914560)===We&&300>pt()-Fo?(it&2)===0&&Ll(t,0):Md|=s,Rl===We&&(Rl=0)),fa(t)}function kx(t,n){n===0&&(n=Ii()),t=zr(t,n),t!==null&&(Qn(t,n),fa(t))}function x_(t){var n=t.memoizedState,s=0;n!==null&&(s=n.retryLane),kx(t,s)}function y_(t,n){var s=0;switch(t.tag){case 31:case 13:var o=t.stateNode,f=t.memoizedState;f!==null&&(s=f.retryLane);break;case 19:o=t.stateNode;break;case 22:o=t.stateNode._retryCache;break;default:throw Error(i(314))}o!==null&&o.delete(n),kx(t,s)}function b_(t,n){return Et(t,n)}var Xo=null,Bl=null,Hd=!1,Qo=!1,qd=!1,cr=0;function fa(t){t!==Bl&&t.next===null&&(Bl===null?Xo=Bl=t:Bl=Bl.next=t),Qo=!0,Hd||(Hd=!0,k_())}function Ws(t,n){if(!qd&&Qo){qd=!0;do for(var s=!1,o=Xo;o!==null;){if(t!==0){var f=o.pendingLanes;if(f===0)var g=0;else{var _=o.suspendedLanes,S=o.pingedLanes;g=(1<<31-Me(42|t)+1)-1,g&=f&~(_&~S),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(s=!0,Sx(o,g))}else g=We,g=He(o,o===xt?g:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(g&3)===0||Fa(o,g)||(s=!0,Sx(o,g));o=o.next}while(s);qd=!1}}function v_(){_x()}function _x(){Qo=Hd=!1;var t=0;cr!==0&&D_()&&(t=cr);for(var n=pt(),s=null,o=Xo;o!==null;){var f=o.next,g=wx(o,n);g===0?(o.next=null,s===null?Xo=f:s.next=f,f===null&&(Bl=s)):(s=o,(t!==0||(g&3)!==0)&&(Qo=!0)),o=f}Yt!==0&&Yt!==5||Ws(t),cr!==0&&(cr=0)}function wx(t,n){for(var s=t.suspendedLanes,o=t.pingedLanes,f=t.expirationTimes,g=t.pendingLanes&-62914561;0<g;){var _=31-Me(g),S=1<<_,O=f[_];O===-1?((S&s)===0||(S&o)!==0)&&(f[_]=hs(S,n)):O<=n&&(t.expiredLanes|=S),g&=~S}if(n=xt,s=We,s=He(t,t===n?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o=t.callbackNode,s===0||t===n&&(ut===2||ut===9)||t.cancelPendingCommit!==null)return o!==null&&o!==null&&ft(o),t.callbackNode=null,t.callbackPriority=0;if((s&3)===0||Fa(t,s)){if(n=s&-s,n===t.callbackPriority)return n;switch(o!==null&&ft(o),xs(s)){case 2:case 8:s=he;break;case 32:s=Te;break;case 268435456:s=re;break;default:s=Te}return o=jx.bind(null,t),s=Et(s,o),t.callbackPriority=n,t.callbackNode=s,n}return o!==null&&o!==null&&ft(o),t.callbackPriority=2,t.callbackNode=null,2}function jx(t,n){if(Yt!==0&&Yt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var s=t.callbackNode;if(Po()&&t.callbackNode!==s)return null;var o=We;return o=He(t,t===xt?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o===0?null:(lx(t,o,n),wx(t,pt()),t.callbackNode!=null&&t.callbackNode===s?jx.bind(null,t):null)}function Sx(t,n){if(Po())return null;lx(t,n,!0)}function k_(){z_(function(){(it&6)!==0?Et(se,v_):_x()})}function Fd(){if(cr===0){var t=wl;t===0&&(t=Pt,Pt<<=1,(Pt&261888)===0&&(Pt=256)),cr=t}return cr}function Nx(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Tr(""+t)}function Cx(t,n){var s=n.ownerDocument.createElement("input");return s.name=n.name,s.value=n.value,t.id&&s.setAttribute("form",t.id),n.parentNode.insertBefore(s,n),t=new FormData(t),s.parentNode.removeChild(s),t}function __(t,n,s,o,f){if(n==="submit"&&s&&s.stateNode===f){var g=Nx((f[Wt]||null).action),_=o.submitter;_&&(n=(n=_[Wt]||null)?Nx(n.formAction):_.getAttribute("formAction"),n!==null&&(g=n,_=null));var S=new io("action","action",null,o,f);t.push({event:S,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(cr!==0){var O=_?Cx(f,_):new FormData(f);od(s,{pending:!0,data:O,method:f.method,action:g},null,O)}}else typeof g=="function"&&(S.preventDefault(),O=_?Cx(f,_):new FormData(f),od(s,{pending:!0,data:O,method:f.method,action:g},g,O))},currentTarget:f}]})}}for(var Id=0;Id<Su.length;Id++){var Yd=Su[Id],w_=Yd.toLowerCase(),j_=Yd[0].toUpperCase()+Yd.slice(1);Wn(w_,"on"+j_)}Wn(rh,"onAnimationEnd"),Wn(lh,"onAnimationIteration"),Wn(sh,"onAnimationStart"),Wn("dblclick","onDoubleClick"),Wn("focusin","onFocus"),Wn("focusout","onBlur"),Wn(Hk,"onTransitionRun"),Wn(qk,"onTransitionStart"),Wn(Fk,"onTransitionCancel"),Wn(ih,"onTransitionEnd"),xa("onMouseEnter",["mouseout","mouseover"]),xa("onMouseLeave",["mouseout","mouseover"]),xa("onPointerEnter",["pointerout","pointerover"]),xa("onPointerLeave",["pointerout","pointerover"]),oa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),oa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),oa("onBeforeInput",["compositionend","keypress","textInput","paste"]),oa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),oa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),oa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ei="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(" "),S_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ei));function Ex(t,n){n=(n&4)!==0;for(var s=0;s<t.length;s++){var o=t[s],f=o.event;o=o.listeners;e:{var g=void 0;if(n)for(var _=o.length-1;0<=_;_--){var S=o[_],O=S.instance,W=S.currentTarget;if(S=S.listener,O!==g&&f.isPropagationStopped())break e;g=S,f.currentTarget=W;try{g(f)}catch(ie){uo(ie)}f.currentTarget=null,g=O}else for(_=0;_<o.length;_++){if(S=o[_],O=S.instance,W=S.currentTarget,S=S.listener,O!==g&&f.isPropagationStopped())break e;g=S,f.currentTarget=W;try{g(f)}catch(ie){uo(ie)}f.currentTarget=null,g=O}}}}function Xe(t,n){var s=n[cl];s===void 0&&(s=n[cl]=new Set);var o=t+"__bubble";s.has(o)||(Tx(n,t,2,!1),s.add(o))}function Gd(t,n,s){var o=0;n&&(o|=4),Tx(s,t,o,n)}var Zo="_reactListening"+Math.random().toString(36).slice(2);function Vd(t){if(!t[Zo]){t[Zo]=!0,Qi.forEach(function(s){s!=="selectionchange"&&(S_.has(s)||Gd(s,!1,t),Gd(s,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[Zo]||(n[Zo]=!0,Gd("selectionchange",!1,n))}}function Tx(t,n,s,o){switch(ry(n)){case 2:var f=W_;break;case 8:f=e2;break;default:f=of}s=f.bind(null,n,s,t),f=void 0,!fu||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),o?f!==void 0?t.addEventListener(n,s,{capture:!0,passive:f}):t.addEventListener(n,s,!0):f!==void 0?t.addEventListener(n,s,{passive:f}):t.addEventListener(n,s,!1)}function Kd(t,n,s,o,f){var g=o;if((n&1)===0&&(n&2)===0&&o!==null)e:for(;;){if(o===null)return;var _=o.tag;if(_===3||_===4){var S=o.stateNode.containerInfo;if(S===f)break;if(_===4)for(_=o.return;_!==null;){var O=_.tag;if((O===3||O===4)&&_.stateNode.containerInfo===f)return;_=_.return}for(;S!==null;){if(_=On(S),_===null)return;if(O=_.tag,O===5||O===6||O===26||O===27){o=g=_;continue e}S=S.parentNode}}o=o.return}Rm(function(){var W=g,ie=uu(s),fe=[];e:{var te=oh.get(t);if(te!==void 0){var ae=io,we=t;switch(t){case"keypress":if(lo(s)===0)break e;case"keydown":case"keyup":ae=yk;break;case"focusin":we="focus",ae=gu;break;case"focusout":we="blur",ae=gu;break;case"beforeblur":case"afterblur":ae=gu;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":ae=$m;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ae=sk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ae=kk;break;case rh:case lh:case sh:ae=ck;break;case ih:ae=wk;break;case"scroll":case"scrollend":ae=rk;break;case"wheel":ae=Sk;break;case"copy":case"cut":case"paste":ae=dk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ae=Um;break;case"toggle":case"beforetoggle":ae=Ck}var Oe=(n&4)!==0,gt=!Oe&&(t==="scroll"||t==="scrollend"),P=Oe?te!==null?te+"Capture":null:te;Oe=[];for(var H=W,Z;H!==null;){var de=H;if(Z=de.stateNode,de=de.tag,de!==5&&de!==26&&de!==27||Z===null||P===null||(de=_s(H,P),de!=null&&Oe.push(ti(H,de,Z))),gt)break;H=H.return}0<Oe.length&&(te=new ae(te,we,null,s,ie),fe.push({event:te,listeners:Oe}))}}if((n&7)===0){e:{if(te=t==="mouseover"||t==="pointerover",ae=t==="mouseout"||t==="pointerout",te&&s!==cu&&(we=s.relatedTarget||s.fromElement)&&(On(we)||we[ia]))break e;if((ae||te)&&(te=ie.window===ie?ie:(te=ie.ownerDocument)?te.defaultView||te.parentWindow:window,ae?(we=s.relatedTarget||s.toElement,ae=W,we=we?On(we):null,we!==null&&(gt=d(we),Oe=we.tag,we!==gt||Oe!==5&&Oe!==27&&Oe!==6)&&(we=null)):(ae=null,we=W),ae!==we)){if(Oe=$m,de="onMouseLeave",P="onMouseEnter",H="mouse",(t==="pointerout"||t==="pointerover")&&(Oe=Um,de="onPointerLeave",P="onPointerEnter",H="pointer"),gt=ae==null?te:Nr(ae),Z=we==null?te:Nr(we),te=new Oe(de,H+"leave",ae,s,ie),te.target=gt,te.relatedTarget=Z,de=null,On(ie)===W&&(Oe=new Oe(P,H+"enter",we,s,ie),Oe.target=Z,Oe.relatedTarget=gt,de=Oe),gt=de,ae&&we)t:{for(Oe=N_,P=ae,H=we,Z=0,de=P;de;de=Oe(de))Z++;de=0;for(var De=H;De;De=Oe(De))de++;for(;0<Z-de;)P=Oe(P),Z--;for(;0<de-Z;)H=Oe(H),de--;for(;Z--;){if(P===H||H!==null&&P===H.alternate){Oe=P;break t}P=Oe(P),H=Oe(H)}Oe=null}else Oe=null;ae!==null&&Ax(fe,te,ae,Oe,!1),we!==null&>!==null&&Ax(fe,gt,we,Oe,!0)}}e:{if(te=W?Nr(W):window,ae=te.nodeName&&te.nodeName.toLowerCase(),ae==="select"||ae==="input"&&te.type==="file")var lt=Km;else if(Gm(te))if(Pm)lt=$k;else{lt=Ok;var Se=Rk}else ae=te.nodeName,!ae||ae.toLowerCase()!=="input"||te.type!=="checkbox"&&te.type!=="radio"?W&&_n(W.elementType)&&(lt=Km):lt=Lk;if(lt&&(lt=lt(t,W))){Vm(fe,lt,s,ie);break e}Se&&Se(t,te,W),t==="focusout"&&W&&te.type==="number"&&W.memoizedProps.value!=null&&ks(te,"number",te.value)}switch(Se=W?Nr(W):window,t){case"focusin":(Gm(Se)||Se.contentEditable==="true")&&(hl=Se,_u=W,As=null);break;case"focusout":As=_u=hl=null;break;case"mousedown":wu=!0;break;case"contextmenu":case"mouseup":case"dragend":wu=!1,nh(fe,s,ie);break;case"selectionchange":if(Uk)break;case"keydown":case"keyup":nh(fe,s,ie)}var Ye;if(yu)e:{switch(t){case"compositionstart":var et="onCompositionStart";break e;case"compositionend":et="onCompositionEnd";break e;case"compositionupdate":et="onCompositionUpdate";break e}et=void 0}else ml?Im(t,s)&&(et="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(et="onCompositionStart");et&&(Hm&&s.locale!=="ko"&&(ml||et!=="onCompositionStart"?et==="onCompositionEnd"&&ml&&(Ye=Om()):(Ka=ie,pu="value"in Ka?Ka.value:Ka.textContent,ml=!0)),Se=Jo(W,et),0<Se.length&&(et=new Bm(et,t,null,s,ie),fe.push({event:et,listeners:Se}),Ye?et.data=Ye:(Ye=Ym(s),Ye!==null&&(et.data=Ye)))),(Ye=Tk?Ak(t,s):Dk(t,s))&&(et=Jo(W,"onBeforeInput"),0<et.length&&(Se=new Bm("onBeforeInput","beforeinput",null,s,ie),fe.push({event:Se,listeners:et}),Se.data=Ye)),__(fe,t,W,s,ie)}Ex(fe,n)})}function ti(t,n,s){return{instance:t,listener:n,currentTarget:s}}function Jo(t,n){for(var s=n+"Capture",o=[];t!==null;){var f=t,g=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||g===null||(f=_s(t,s),f!=null&&o.unshift(ti(t,f,g)),f=_s(t,n),f!=null&&o.push(ti(t,f,g))),t.tag===3)return o;t=t.return}return[]}function N_(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Ax(t,n,s,o,f){for(var g=n._reactName,_=[];s!==null&&s!==o;){var S=s,O=S.alternate,W=S.stateNode;if(S=S.tag,O!==null&&O===o)break;S!==5&&S!==26&&S!==27||W===null||(O=W,f?(W=_s(s,g),W!=null&&_.unshift(ti(s,W,O))):f||(W=_s(s,g),W!=null&&_.push(ti(s,W,O)))),s=s.return}_.length!==0&&t.push({event:n,listeners:_})}var C_=/\r\n?/g,E_=/\u0000|\uFFFD/g;function Dx(t){return(typeof t=="string"?t:""+t).replace(C_,`
|
||
`).replace(E_,"")}function Mx(t,n){return n=Dx(n),Dx(t)===n}function ht(t,n,s,o,f,g){switch(s){case"children":typeof o=="string"?n==="body"||n==="textarea"&&o===""||Fe(t,o):(typeof o=="number"||typeof o=="bigint")&&n!=="body"&&Fe(t,""+o);break;case"className":ul(t,"class",o);break;case"tabIndex":ul(t,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":ul(t,s,o);break;case"style":Vt(t,o,g);break;case"data":if(n!=="object"){ul(t,"data",o);break}case"src":case"href":if(o===""&&(n!=="a"||s!=="href")){t.removeAttribute(s);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(s);break}o=Tr(""+o),t.setAttribute(s,o);break;case"action":case"formAction":if(typeof o=="function"){t.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 g=="function"&&(s==="formAction"?(n!=="input"&&ht(t,n,"name",f.name,f,null),ht(t,n,"formEncType",f.formEncType,f,null),ht(t,n,"formMethod",f.formMethod,f,null),ht(t,n,"formTarget",f.formTarget,f,null)):(ht(t,n,"encType",f.encType,f,null),ht(t,n,"method",f.method,f,null),ht(t,n,"target",f.target,f,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(s);break}o=Tr(""+o),t.setAttribute(s,o);break;case"onClick":o!=null&&(t.onclick=ba);break;case"onScroll":o!=null&&Xe("scroll",t);break;case"onScrollEnd":o!=null&&Xe("scrollend",t);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(i(61));if(s=o.__html,s!=null){if(f.children!=null)throw Error(i(60));t.innerHTML=s}}break;case"multiple":t.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":t.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){t.removeAttribute("xlink:href");break}s=Tr(""+o),t.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":o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(s,""+o):t.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":o&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(s,""):t.removeAttribute(s);break;case"capture":case"download":o===!0?t.setAttribute(s,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(s,o):t.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?t.setAttribute(s,o):t.removeAttribute(s);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?t.removeAttribute(s):t.setAttribute(s,o);break;case"popover":Xe("beforetoggle",t),Xe("toggle",t),Cr(t,"popover",o);break;case"xlinkActuate":cn(t,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":cn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":cn(t,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":cn(t,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":cn(t,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":cn(t,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":cn(t,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":cn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":cn(t,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Cr(t,"is",o);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=Er.get(s)||s,Cr(t,s,o))}}function Pd(t,n,s,o,f,g){switch(s){case"style":Vt(t,o,g);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(i(61));if(s=o.__html,s!=null){if(f.children!=null)throw Error(i(60));t.innerHTML=s}}break;case"children":typeof o=="string"?Fe(t,o):(typeof o=="number"||typeof o=="bigint")&&Fe(t,""+o);break;case"onScroll":o!=null&&Xe("scroll",t);break;case"onScrollEnd":o!=null&&Xe("scrollend",t);break;case"onClick":o!=null&&(t.onclick=ba);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Zi.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(f=s.endsWith("Capture"),n=s.slice(2,f?s.length-7:void 0),g=t[Wt]||null,g=g!=null?g[s]:null,typeof g=="function"&&t.removeEventListener(n,g,f),typeof o=="function")){typeof g!="function"&&g!==null&&(s in t?t[s]=null:t.hasAttribute(s)&&t.removeAttribute(s)),t.addEventListener(n,o,f);break e}s in t?t[s]=o:o===!0?t.setAttribute(s,""):Cr(t,s,o)}}}function Jt(t,n,s){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Xe("error",t),Xe("load",t);var o=!1,f=!1,g;for(g in s)if(s.hasOwnProperty(g)){var _=s[g];if(_!=null)switch(g){case"src":o=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:ht(t,n,g,_,s,null)}}f&&ht(t,n,"srcSet",s.srcSet,s,null),o&&ht(t,n,"src",s.src,s,null);return;case"input":Xe("invalid",t);var S=g=_=f=null,O=null,W=null;for(o in s)if(s.hasOwnProperty(o)){var ie=s[o];if(ie!=null)switch(o){case"name":f=ie;break;case"type":_=ie;break;case"checked":O=ie;break;case"defaultChecked":W=ie;break;case"value":g=ie;break;case"defaultValue":S=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(i(137,n));break;default:ht(t,n,o,ie,s,null)}}ao(t,g,S,O,W,_,f,!1);return;case"select":Xe("invalid",t),o=_=g=null;for(f in s)if(s.hasOwnProperty(f)&&(S=s[f],S!=null))switch(f){case"value":g=S;break;case"defaultValue":_=S;break;case"multiple":o=S;default:ht(t,n,f,S,s,null)}n=g,s=_,t.multiple=!!o,n!=null?ya(t,!!o,n,!1):s!=null&&ya(t,!!o,s,!0);return;case"textarea":Xe("invalid",t),g=f=o=null;for(_ in s)if(s.hasOwnProperty(_)&&(S=s[_],S!=null))switch(_){case"value":o=S;break;case"defaultValue":f=S;break;case"children":g=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(i(91));break;default:ht(t,n,_,S,s,null)}_e(t,o,f,g);return;case"option":for(O in s)if(s.hasOwnProperty(O)&&(o=s[O],o!=null))switch(O){case"selected":t.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:ht(t,n,O,o,s,null)}return;case"dialog":Xe("beforetoggle",t),Xe("toggle",t),Xe("cancel",t),Xe("close",t);break;case"iframe":case"object":Xe("load",t);break;case"video":case"audio":for(o=0;o<ei.length;o++)Xe(ei[o],t);break;case"image":Xe("error",t),Xe("load",t);break;case"details":Xe("toggle",t);break;case"embed":case"source":case"link":Xe("error",t),Xe("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(W in s)if(s.hasOwnProperty(W)&&(o=s[W],o!=null))switch(W){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:ht(t,n,W,o,s,null)}return;default:if(_n(n)){for(ie in s)s.hasOwnProperty(ie)&&(o=s[ie],o!==void 0&&Pd(t,n,ie,o,s,void 0));return}}for(S in s)s.hasOwnProperty(S)&&(o=s[S],o!=null&&ht(t,n,S,o,s,null))}function T_(t,n,s,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,g=null,_=null,S=null,O=null,W=null,ie=null;for(ae in s){var fe=s[ae];if(s.hasOwnProperty(ae)&&fe!=null)switch(ae){case"checked":break;case"value":break;case"defaultValue":O=fe;default:o.hasOwnProperty(ae)||ht(t,n,ae,null,o,fe)}}for(var te in o){var ae=o[te];if(fe=s[te],o.hasOwnProperty(te)&&(ae!=null||fe!=null))switch(te){case"type":g=ae;break;case"name":f=ae;break;case"checked":W=ae;break;case"defaultChecked":ie=ae;break;case"value":_=ae;break;case"defaultValue":S=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(i(137,n));break;default:ae!==fe&&ht(t,n,te,ae,o,fe)}}vs(t,_,S,O,W,ie,g,f);return;case"select":ae=_=S=te=null;for(g in s)if(O=s[g],s.hasOwnProperty(g)&&O!=null)switch(g){case"value":break;case"multiple":ae=O;default:o.hasOwnProperty(g)||ht(t,n,g,null,o,O)}for(f in o)if(g=o[f],O=s[f],o.hasOwnProperty(f)&&(g!=null||O!=null))switch(f){case"value":te=g;break;case"defaultValue":S=g;break;case"multiple":_=g;default:g!==O&&ht(t,n,f,g,o,O)}n=S,s=_,o=ae,te!=null?ya(t,!!s,te,!1):!!o!=!!s&&(n!=null?ya(t,!!s,n,!0):ya(t,!!s,s?[]:"",!1));return;case"textarea":ae=te=null;for(S in s)if(f=s[S],s.hasOwnProperty(S)&&f!=null&&!o.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:ht(t,n,S,null,o,f)}for(_ in o)if(f=o[_],g=s[_],o.hasOwnProperty(_)&&(f!=null||g!=null))switch(_){case"value":te=f;break;case"defaultValue":ae=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(i(91));break;default:f!==g&&ht(t,n,_,f,o,g)}R(t,te,ae);return;case"option":for(var we in s)if(te=s[we],s.hasOwnProperty(we)&&te!=null&&!o.hasOwnProperty(we))switch(we){case"selected":t.selected=!1;break;default:ht(t,n,we,null,o,te)}for(O in o)if(te=o[O],ae=s[O],o.hasOwnProperty(O)&&te!==ae&&(te!=null||ae!=null))switch(O){case"selected":t.selected=te&&typeof te!="function"&&typeof te!="symbol";break;default:ht(t,n,O,te,o,ae)}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 Oe in s)te=s[Oe],s.hasOwnProperty(Oe)&&te!=null&&!o.hasOwnProperty(Oe)&&ht(t,n,Oe,null,o,te);for(W in o)if(te=o[W],ae=s[W],o.hasOwnProperty(W)&&te!==ae&&(te!=null||ae!=null))switch(W){case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(i(137,n));break;default:ht(t,n,W,te,o,ae)}return;default:if(_n(n)){for(var gt in s)te=s[gt],s.hasOwnProperty(gt)&&te!==void 0&&!o.hasOwnProperty(gt)&&Pd(t,n,gt,void 0,o,te);for(ie in o)te=o[ie],ae=s[ie],!o.hasOwnProperty(ie)||te===ae||te===void 0&&ae===void 0||Pd(t,n,ie,te,o,ae);return}}for(var P in s)te=s[P],s.hasOwnProperty(P)&&te!=null&&!o.hasOwnProperty(P)&&ht(t,n,P,null,o,te);for(fe in o)te=o[fe],ae=s[fe],!o.hasOwnProperty(fe)||te===ae||te==null&&ae==null||ht(t,n,fe,te,o,ae)}function zx(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function A_(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,s=performance.getEntriesByType("resource"),o=0;o<s.length;o++){var f=s[o],g=f.transferSize,_=f.initiatorType,S=f.duration;if(g&&S&&zx(_)){for(_=0,S=f.responseEnd,o+=1;o<s.length;o++){var O=s[o],W=O.startTime;if(W>S)break;var ie=O.transferSize,fe=O.initiatorType;ie&&zx(fe)&&(O=O.responseEnd,_+=ie*(O<S?1:(S-W)/(O-W)))}if(--o,n+=8*(g+_)/(f.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Xd=null,Qd=null;function Wo(t){return t.nodeType===9?t:t.ownerDocument}function Rx(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Ox(t,n){if(t===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&n==="foreignObject"?0:t}function Zd(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Jd=null;function D_(){var t=window.event;return t&&t.type==="popstate"?t===Jd?!1:(Jd=t,!0):(Jd=null,!1)}var Lx=typeof setTimeout=="function"?setTimeout:void 0,M_=typeof clearTimeout=="function"?clearTimeout:void 0,$x=typeof Promise=="function"?Promise:void 0,z_=typeof queueMicrotask=="function"?queueMicrotask:typeof $x<"u"?function(t){return $x.resolve(null).then(t).catch(R_)}:Lx;function R_(t){setTimeout(function(){throw t})}function ur(t){return t==="head"}function Bx(t,n){var s=n,o=0;do{var f=s.nextSibling;if(t.removeChild(s),f&&f.nodeType===8)if(s=f.data,s==="/$"||s==="/&"){if(o===0){t.removeChild(f),Fl(n);return}o--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")o++;else if(s==="html")ni(t.ownerDocument.documentElement);else if(s==="head"){s=t.ownerDocument.head,ni(s);for(var g=s.firstChild;g;){var _=g.nextSibling,S=g.nodeName;g[Ia]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&g.rel.toLowerCase()==="stylesheet"||s.removeChild(g),g=_}}else s==="body"&&ni(t.ownerDocument.body);s=f}while(s);Fl(n)}function Ux(t,n){var s=t;t=0;do{var o=s.nextSibling;if(s.nodeType===1?n?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(n?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),o&&o.nodeType===8)if(s=o.data,s==="/$"){if(t===0)break;t--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||t++;s=o}while(s)}function Wd(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var s=n;switch(n=n.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Wd(s),Xi(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}t.removeChild(s)}}function O_(t,n,s,o){for(;t.nodeType===1;){var f=s;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!o&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(o){if(!t[Ia])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(g=t.getAttribute("rel"),g==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(g!==f.rel||t.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||t.getAttribute("title")!==(f.title==null?null:f.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(g=t.getAttribute("src"),(g!==(f.src==null?null:f.src)||t.getAttribute("type")!==(f.type==null?null:f.type)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&g&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var g=f.name==null?null:""+f.name;if(f.type==="hidden"&&t.getAttribute("name")===g)return t}else return t;if(t=Fn(t.nextSibling),t===null)break}return null}function L_(t,n,s){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=Fn(t.nextSibling),t===null))return null;return t}function Hx(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=Fn(t.nextSibling),t===null))return null;return t}function ef(t){return t.data==="$?"||t.data==="$~"}function tf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function $_(t,n){var s=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||s.readyState!=="loading")n();else{var o=function(){n(),s.removeEventListener("DOMContentLoaded",o)};s.addEventListener("DOMContentLoaded",o),t._reactRetry=o}}function Fn(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return t}var nf=null;function qx(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"||s==="/&"){if(n===0)return Fn(t.nextSibling);n--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||n++}t=t.nextSibling}return null}function Fx(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var s=t.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(n===0)return t;n--}else s!=="/$"&&s!=="/&"||n++}t=t.previousSibling}return null}function Ix(t,n,s){switch(n=Wo(s),t){case"html":if(t=n.documentElement,!t)throw Error(i(452));return t;case"head":if(t=n.head,!t)throw Error(i(453));return t;case"body":if(t=n.body,!t)throw Error(i(454));return t;default:throw Error(i(451))}}function ni(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Xi(t)}var In=new Map,Yx=new Set;function ec(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Oa=q.d;q.d={f:B_,r:U_,D:H_,C:q_,L:F_,m:I_,X:G_,S:Y_,M:V_};function B_(){var t=Oa.f(),n=Go();return t||n}function U_(t){var n=Ya(t);n!==null&&n.tag===5&&n.type==="form"?ig(n):Oa.r(t)}var Ul=typeof document>"u"?null:document;function Gx(t,n,s){var o=Ul;if(o&&typeof n=="string"&&n){var f=It(n);f='link[rel="'+t+'"][href="'+f+'"]',typeof s=="string"&&(f+='[crossorigin="'+s+'"]'),Yx.has(f)||(Yx.add(f),t={rel:t,crossOrigin:s,href:n},o.querySelector(f)===null&&(n=o.createElement("link"),Jt(n,"link",t),Lt(n),o.head.appendChild(n)))}}function H_(t){Oa.D(t),Gx("dns-prefetch",t,null)}function q_(t,n){Oa.C(t,n),Gx("preconnect",t,n)}function F_(t,n,s){Oa.L(t,n,s);var o=Ul;if(o&&t&&n){var f='link[rel="preload"][as="'+It(n)+'"]';n==="image"&&s&&s.imageSrcSet?(f+='[imagesrcset="'+It(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(f+='[imagesizes="'+It(s.imageSizes)+'"]')):f+='[href="'+It(t)+'"]';var g=f;switch(n){case"style":g=Hl(t);break;case"script":g=ql(t)}In.has(g)||(t=x({rel:"preload",href:n==="image"&&s&&s.imageSrcSet?void 0:t,as:n},s),In.set(g,t),o.querySelector(f)!==null||n==="style"&&o.querySelector(ai(g))||n==="script"&&o.querySelector(ri(g))||(n=o.createElement("link"),Jt(n,"link",t),Lt(n),o.head.appendChild(n)))}}function I_(t,n){Oa.m(t,n);var s=Ul;if(s&&t){var o=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+It(o)+'"][href="'+It(t)+'"]',g=f;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=ql(t)}if(!In.has(g)&&(t=x({rel:"modulepreload",href:t},n),In.set(g,t),s.querySelector(f)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(ri(g)))return}o=s.createElement("link"),Jt(o,"link",t),Lt(o),s.head.appendChild(o)}}}function Y_(t,n,s){Oa.S(t,n,s);var o=Ul;if(o&&t){var f=Ga(o).hoistableStyles,g=Hl(t);n=n||"default";var _=f.get(g);if(!_){var S={loading:0,preload:null};if(_=o.querySelector(ai(g)))S.loading=5;else{t=x({rel:"stylesheet",href:t,"data-precedence":n},s),(s=In.get(g))&&af(t,s);var O=_=o.createElement("link");Lt(O),Jt(O,"link",t),O._p=new Promise(function(W,ie){O.onload=W,O.onerror=ie}),O.addEventListener("load",function(){S.loading|=1}),O.addEventListener("error",function(){S.loading|=2}),S.loading|=4,tc(_,n,o)}_={type:"stylesheet",instance:_,count:1,state:S},f.set(g,_)}}}function G_(t,n){Oa.X(t,n);var s=Ul;if(s&&t){var o=Ga(s).hoistableScripts,f=ql(t),g=o.get(f);g||(g=s.querySelector(ri(f)),g||(t=x({src:t,async:!0},n),(n=In.get(f))&&rf(t,n),g=s.createElement("script"),Lt(g),Jt(g,"link",t),s.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},o.set(f,g))}}function V_(t,n){Oa.M(t,n);var s=Ul;if(s&&t){var o=Ga(s).hoistableScripts,f=ql(t),g=o.get(f);g||(g=s.querySelector(ri(f)),g||(t=x({src:t,async:!0,type:"module"},n),(n=In.get(f))&&rf(t,n),g=s.createElement("script"),Lt(g),Jt(g,"link",t),s.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},o.set(f,g))}}function Vx(t,n,s,o){var f=(f=ve.current)?ec(f):null;if(!f)throw Error(i(446));switch(t){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(n=Hl(s.href),s=Ga(f).hoistableStyles,o=s.get(n),o||(o={type:"style",instance:null,count:0,state:null},s.set(n,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){t=Hl(s.href);var g=Ga(f).hoistableStyles,_=g.get(t);if(_||(f=f.ownerDocument||f,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(t,_),(g=f.querySelector(ai(t)))&&!g._p&&(_.instance=g,_.state.loading=5),In.has(t)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},In.set(t,s),g||K_(f,t,s,_.state))),n&&o===null)throw Error(i(528,""));return _}if(n&&o!==null)throw Error(i(529,""));return null;case"script":return n=s.async,s=s.src,typeof s=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=ql(s),s=Ga(f).hoistableScripts,o=s.get(n),o||(o={type:"script",instance:null,count:0,state:null},s.set(n,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,t))}}function Hl(t){return'href="'+It(t)+'"'}function ai(t){return'link[rel="stylesheet"]['+t+"]"}function Kx(t){return x({},t,{"data-precedence":t.precedence,precedence:null})}function K_(t,n,s,o){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?o.loading=1:(n=t.createElement("link"),o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2}),Jt(n,"link",s),Lt(n),t.head.appendChild(n))}function ql(t){return'[src="'+It(t)+'"]'}function ri(t){return"script[async]"+t}function Px(t,n,s){if(n.count++,n.instance===null)switch(n.type){case"style":var o=t.querySelector('style[data-href~="'+It(s.href)+'"]');if(o)return n.instance=o,Lt(o),o;var f=x({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),Lt(o),Jt(o,"style",f),tc(o,s.precedence,t),n.instance=o;case"stylesheet":f=Hl(s.href);var g=t.querySelector(ai(f));if(g)return n.state.loading|=4,n.instance=g,Lt(g),g;o=Kx(s),(f=In.get(f))&&af(o,f),g=(t.ownerDocument||t).createElement("link"),Lt(g);var _=g;return _._p=new Promise(function(S,O){_.onload=S,_.onerror=O}),Jt(g,"link",o),n.state.loading|=4,tc(g,s.precedence,t),n.instance=g;case"script":return g=ql(s.src),(f=t.querySelector(ri(g)))?(n.instance=f,Lt(f),f):(o=s,(f=In.get(g))&&(o=x({},s),rf(o,f)),t=t.ownerDocument||t,f=t.createElement("script"),Lt(f),Jt(f,"link",o),t.head.appendChild(f),n.instance=f);case"void":return null;default:throw Error(i(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(o=n.instance,n.state.loading|=4,tc(o,s.precedence,t));return n.instance}function tc(t,n,s){for(var o=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=o.length?o[o.length-1]:null,g=f,_=0;_<o.length;_++){var S=o[_];if(S.dataset.precedence===n)g=S;else if(g!==f)break}g?g.parentNode.insertBefore(t,g.nextSibling):(n=s.nodeType===9?s.head:s,n.insertBefore(t,n.firstChild))}function af(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function rf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var nc=null;function Xx(t,n,s){if(nc===null){var o=new Map,f=nc=new Map;f.set(s,o)}else f=nc,o=f.get(s),o||(o=new Map,f.set(s,o));if(o.has(t))return o;for(o.set(t,null),s=s.getElementsByTagName(t),f=0;f<s.length;f++){var g=s[f];if(!(g[Ia]||g[Ot]||t==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var _=g.getAttribute(n)||"";_=t+_;var S=o.get(_);S?S.push(g):o.set(_,[g])}}return o}function Qx(t,n,s){t=t.ownerDocument||t,t.head.insertBefore(s,n==="title"?t.querySelector("head > title"):null)}function P_(t,n,s){if(s===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return t=n.disabled,typeof n.precedence=="string"&&t==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Zx(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function X_(t,n,s,o){if(s.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var f=Hl(o.href),g=n.querySelector(ai(f));if(g){n=g._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=ac.bind(t),n.then(t,t)),s.state.loading|=4,s.instance=g,Lt(g);return}g=n.ownerDocument||n,o=Kx(o),(f=In.get(f))&&af(o,f),g=g.createElement("link"),Lt(g);var _=g;_._p=new Promise(function(S,O){_.onload=S,_.onerror=O}),Jt(g,"link",o),s.instance=g}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(s,n),(n=s.state.preload)&&(s.state.loading&3)===0&&(t.count++,s=ac.bind(t),n.addEventListener("load",s),n.addEventListener("error",s))}}var lf=0;function Q_(t,n){return t.stylesheets&&t.count===0&&lc(t,t.stylesheets),0<t.count||0<t.imgCount?function(s){var o=setTimeout(function(){if(t.stylesheets&&lc(t,t.stylesheets),t.unsuspend){var g=t.unsuspend;t.unsuspend=null,g()}},6e4+n);0<t.imgBytes&&lf===0&&(lf=62500*A_());var f=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&lc(t,t.stylesheets),t.unsuspend)){var g=t.unsuspend;t.unsuspend=null,g()}},(t.imgBytes>lf?50:800)+n);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(f)}}:null}function ac(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)lc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var rc=null;function lc(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,rc=new Map,n.forEach(Z_,t),rc=null,ac.call(t))}function Z_(t,n){if(!(n.state.loading&4)){var s=rc.get(t);if(s)var o=s.get(null);else{s=new Map,rc.set(t,s);for(var f=t.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<f.length;g++){var _=f[g];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(s.set(_.dataset.precedence,_),o=_)}o&&s.set(null,o)}f=n.instance,_=f.getAttribute("data-precedence"),g=s.get(_)||o,g===o&&s.set(null,f),s.set(_,f),this.count++,o=ac.bind(this),f.addEventListener("load",o),f.addEventListener("error",o),g?g.parentNode.insertBefore(f,g.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(f,t.firstChild)),n.state.loading|=4}}var li={$$typeof:M,Provider:null,Consumer:null,_currentValue:ce,_currentValue2:ce,_threadCount:0};function J_(t,n,s,o,f,g,_,S,O){this.tag=1,this.containerInfo=t,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=sa(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=sa(0),this.hiddenUpdates=sa(null),this.identifierPrefix=o,this.onUncaughtError=f,this.onCaughtError=g,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=O,this.incompleteTransitions=new Map}function Jx(t,n,s,o,f,g,_,S,O,W,ie,fe){return t=new J_(t,n,s,_,O,W,ie,fe,S),n=1,g===!0&&(n|=24),g=jn(3,null,null,n),t.current=g,g.stateNode=t,n=Bu(),n.refCount++,t.pooledCache=n,n.refCount++,g.memoizedState={element:o,isDehydrated:s,cache:n},Fu(g),t}function Wx(t){return t?(t=yl,t):yl}function ey(t,n,s,o,f,g){f=Wx(f),o.context===null?o.context=f:o.pendingContext=f,o=Wa(n),o.payload={element:s},g=g===void 0?null:g,g!==null&&(o.callback=g),s=er(t,o,n),s!==null&&(gn(s,t,n),$s(s,t,n))}function ty(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<n?s:n}}function sf(t,n){ty(t,n),(t=t.alternate)&&ty(t,n)}function ny(t){if(t.tag===13||t.tag===31){var n=zr(t,67108864);n!==null&&gn(n,t,67108864),sf(t,67108864)}}function ay(t){if(t.tag===13||t.tag===31){var n=Tn();n=gs(n);var s=zr(t,n);s!==null&&gn(s,t,n),sf(t,n)}}var sc=!0;function W_(t,n,s,o){var f=L.T;L.T=null;var g=q.p;try{q.p=2,of(t,n,s,o)}finally{q.p=g,L.T=f}}function e2(t,n,s,o){var f=L.T;L.T=null;var g=q.p;try{q.p=8,of(t,n,s,o)}finally{q.p=g,L.T=f}}function of(t,n,s,o){if(sc){var f=cf(o);if(f===null)Kd(t,n,o,ic,s),ly(t,o);else if(n2(f,t,n,s,o))o.stopPropagation();else if(ly(t,o),n&4&&-1<t2.indexOf(t)){for(;f!==null;){var g=Ya(f);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var _=Xn(g.pendingLanes);if(_!==0){var S=g;for(S.pendingLanes|=2,S.entangledLanes|=2;_;){var O=1<<31-Me(_);S.entanglements[1]|=O,_&=~O}fa(g),(it&6)===0&&(Io=pt()+500,Ws(0))}}break;case 31:case 13:S=zr(g,2),S!==null&&gn(S,g,2),Go(),sf(g,2)}if(g=cf(o),g===null&&Kd(t,n,o,ic,s),g===f)break;f=g}f!==null&&o.stopPropagation()}else Kd(t,n,o,null,s)}}function cf(t){return t=uu(t),uf(t)}var ic=null;function uf(t){if(ic=null,t=On(t),t!==null){var n=d(t);if(n===null)t=null;else{var s=n.tag;if(s===13){if(t=u(n),t!==null)return t;t=null}else if(s===31){if(t=m(n),t!==null)return t;t=null}else if(s===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return ic=t,null}function ry(t){switch(t){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(Ft()){case se:return 2;case he:return 8;case Te:case X:return 32;case re:return 268435456;default:return 32}default:return 32}}var df=!1,dr=null,fr=null,pr=null,si=new Map,ii=new Map,mr=[],t2="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 ly(t,n){switch(t){case"focusin":case"focusout":dr=null;break;case"dragenter":case"dragleave":fr=null;break;case"mouseover":case"mouseout":pr=null;break;case"pointerover":case"pointerout":si.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":ii.delete(n.pointerId)}}function oi(t,n,s,o,f,g){return t===null||t.nativeEvent!==g?(t={blockedOn:n,domEventName:s,eventSystemFlags:o,nativeEvent:g,targetContainers:[f]},n!==null&&(n=Ya(n),n!==null&&ny(n)),t):(t.eventSystemFlags|=o,n=t.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),t)}function n2(t,n,s,o,f){switch(n){case"focusin":return dr=oi(dr,t,n,s,o,f),!0;case"dragenter":return fr=oi(fr,t,n,s,o,f),!0;case"mouseover":return pr=oi(pr,t,n,s,o,f),!0;case"pointerover":var g=f.pointerId;return si.set(g,oi(si.get(g)||null,t,n,s,o,f)),!0;case"gotpointercapture":return g=f.pointerId,ii.set(g,oi(ii.get(g)||null,t,n,s,o,f)),!0}return!1}function sy(t){var n=On(t.target);if(n!==null){var s=d(n);if(s!==null){if(n=s.tag,n===13){if(n=u(s),n!==null){t.blockedOn=n,ol(t.priority,function(){ay(s)});return}}else if(n===31){if(n=m(s),n!==null){t.blockedOn=n,ol(t.priority,function(){ay(s)});return}}else if(n===3&&s.stateNode.current.memoizedState.isDehydrated){t.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}t.blockedOn=null}function oc(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var s=cf(t.nativeEvent);if(s===null){s=t.nativeEvent;var o=new s.constructor(s.type,s);cu=o,s.target.dispatchEvent(o),cu=null}else return n=Ya(s),n!==null&&ny(n),t.blockedOn=s,!1;n.shift()}return!0}function iy(t,n,s){oc(t)&&s.delete(n)}function a2(){df=!1,dr!==null&&oc(dr)&&(dr=null),fr!==null&&oc(fr)&&(fr=null),pr!==null&&oc(pr)&&(pr=null),si.forEach(iy),ii.forEach(iy)}function cc(t,n){t.blockedOn===n&&(t.blockedOn=null,df||(df=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,a2)))}var uc=null;function oy(t){uc!==t&&(uc=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){uc===t&&(uc=null);for(var n=0;n<t.length;n+=3){var s=t[n],o=t[n+1],f=t[n+2];if(typeof o!="function"){if(uf(o||s)===null)continue;break}var g=Ya(s);g!==null&&(t.splice(n,3),n-=3,od(g,{pending:!0,data:f,method:s.method,action:o},o,f))}}))}function Fl(t){function n(O){return cc(O,t)}dr!==null&&cc(dr,t),fr!==null&&cc(fr,t),pr!==null&&cc(pr,t),si.forEach(n),ii.forEach(n);for(var s=0;s<mr.length;s++){var o=mr[s];o.blockedOn===t&&(o.blockedOn=null)}for(;0<mr.length&&(s=mr[0],s.blockedOn===null);)sy(s),s.blockedOn===null&&mr.shift();if(s=(t.ownerDocument||t).$$reactFormReplay,s!=null)for(o=0;o<s.length;o+=3){var f=s[o],g=s[o+1],_=f[Wt]||null;if(typeof g=="function")_||oy(s);else if(_){var S=null;if(g&&g.hasAttribute("formAction")){if(f=g,_=g[Wt]||null)S=_.formAction;else if(uf(f)!==null)continue}else S=_.action;typeof S=="function"?s[o+1]=S:(s.splice(o,3),o-=3),oy(s)}}}function cy(){function t(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(_){return f=_})},focusReset:"manual",scroll:"manual"})}function n(){f!==null&&(f(),f=null),o||setTimeout(s,20)}function s(){if(!o&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,f=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(s,100),function(){o=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),f!==null&&(f(),f=null)}}}function ff(t){this._internalRoot=t}dc.prototype.render=ff.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(i(409));var s=n.current,o=Tn();ey(s,o,t,n,null,null)},dc.prototype.unmount=ff.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;ey(t.current,2,null,t,null,null),Go(),n[ia]=null}};function dc(t){this._internalRoot=t}dc.prototype.unstable_scheduleHydration=function(t){if(t){var n=Vi();t={blockedOn:null,target:t,priority:n};for(var s=0;s<mr.length&&n!==0&&n<mr[s].priority;s++);mr.splice(s,0,t),s===0&&sy(t)}};var uy=a.version;if(uy!=="19.2.4")throw Error(i(527,uy,"19.2.4"));q.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(i(188)):(t=Object.keys(t).join(","),Error(i(268,t)));return t=h(n),t=t!==null?y(t):null,t=t===null?null:t.stateNode,t};var r2={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:L,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var fc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fc.isDisabled&&fc.supportsFiber)try{Ae=fc.inject(r2),Le=fc}catch{}}return ui.createRoot=function(t,n){if(!c(t))throw Error(i(299));var s=!1,o="",f=xg,g=yg,_=bg;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(g=n.onCaughtError),n.onRecoverableError!==void 0&&(_=n.onRecoverableError)),n=Jx(t,1,!1,null,null,s,o,null,f,g,_,cy),t[ia]=n.current,Vd(t),new ff(n)},ui.hydrateRoot=function(t,n,s){if(!c(t))throw Error(i(299));var o=!1,f="",g=xg,_=yg,S=bg,O=null;return s!=null&&(s.unstable_strictMode===!0&&(o=!0),s.identifierPrefix!==void 0&&(f=s.identifierPrefix),s.onUncaughtError!==void 0&&(g=s.onUncaughtError),s.onCaughtError!==void 0&&(_=s.onCaughtError),s.onRecoverableError!==void 0&&(S=s.onRecoverableError),s.formState!==void 0&&(O=s.formState)),n=Jx(t,1,!0,n,s??null,o,f,O,g,_,S,cy),n.context=Wx(null),s=n.current,o=Tn(),o=gs(o),f=Wa(o),f.callback=null,er(s,f,o),s=o,n.current.lanes=s,Qn(n,s),fa(n),t[ia]=n.current,Vd(t),new dc(n)},ui.version="19.2.4",ui}var vy;function h2(){if(vy)return hf.exports;vy=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(a){console.error(a)}}return e(),hf.exports=m2(),hf.exports}var g2=h2();const x2=Ic(g2);/**
|
||
* react-router v7.13.0
|
||
*
|
||
* Copyright (c) Remix Software Inc.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE.md file in the root directory of this source tree.
|
||
*
|
||
* @license MIT
|
||
*/var ky="popstate";function y2(e={}){function a(i,c){let{pathname:d,search:u,hash:m}=i.location;return Dc("",{pathname:d,search:u,hash:m},c.state&&c.state.usr||null,c.state&&c.state.key||"default")}function r(i,c){return typeof c=="string"?c:as(c)}return kv(a,r,null,e)}function b2(e={}){function a(c,d){let{pathname:u="/",search:m="",hash:p=""}=nl(c.location.hash.substring(1));return!u.startsWith("/")&&!u.startsWith(".")&&(u="/"+u),Dc("",{pathname:u,search:m,hash:p},d.state&&d.state.usr||null,d.state&&d.state.key||"default")}function r(c,d){let u=c.document.querySelector("base"),m="";if(u&&u.getAttribute("href")){let p=c.location.href,h=p.indexOf("#");m=h===-1?p:p.slice(0,h)}return m+"#"+(typeof d=="string"?d:as(d))}function i(c,d){Kn(c.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(d)})`)}return kv(a,r,i,e)}function St(e,a){if(e===!1||e===null||typeof e>"u")throw new Error(a)}function Kn(e,a){if(!e){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function v2(){return Math.random().toString(36).substring(2,10)}function _y(e,a){return{usr:e.state,key:e.key,idx:a}}function Dc(e,a,r=null,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof a=="string"?nl(a):a,state:r,key:a&&a.key||i||v2()}}function as({pathname:e="/",search:a="",hash:r=""}){return a&&a!=="?"&&(e+=a.charAt(0)==="?"?a:"?"+a),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function nl(e){let a={};if(e){let r=e.indexOf("#");r>=0&&(a.hash=e.substring(r),e=e.substring(0,r));let i=e.indexOf("?");i>=0&&(a.search=e.substring(i),e=e.substring(0,i)),e&&(a.pathname=e)}return a}function kv(e,a,r,i={}){let{window:c=document.defaultView,v5Compat:d=!1}=i,u=c.history,m="POP",p=null,h=y();h==null&&(h=0,u.replaceState({...u.state,idx:h},""));function y(){return(u.state||{idx:null}).idx}function x(){m="POP";let j=y(),C=j==null?null:j-h;h=j,p&&p({action:m,location:T.location,delta:C})}function v(j,C){m="PUSH";let $=Dc(T.location,j,C);r&&r($,j),h=y()+1;let M=_y($,h),ee=T.createHref($);try{u.pushState(M,"",ee)}catch(ne){if(ne instanceof DOMException&&ne.name==="DataCloneError")throw ne;c.location.assign(ee)}d&&p&&p({action:m,location:T.location,delta:1})}function k(j,C){m="REPLACE";let $=Dc(T.location,j,C);r&&r($,j),h=y();let M=_y($,h),ee=T.createHref($);u.replaceState(M,"",ee),d&&p&&p({action:m,location:T.location,delta:0})}function w(j){return k2(j)}let T={get action(){return m},get location(){return e(c,u)},listen(j){if(p)throw new Error("A history only accepts one active listener");return c.addEventListener(ky,x),p=j,()=>{c.removeEventListener(ky,x),p=null}},createHref(j){return a(c,j)},createURL:w,encodeLocation(j){let C=w(j);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:v,replace:k,go(j){return u.go(j)}};return T}function k2(e,a=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),St(r,"No window.location.(origin|href) available to create URL");let i=typeof e=="string"?e:as(e);return i=i.replace(/ $/,"%20"),!a&&i.startsWith("//")&&(i=r+i),new URL(i,r)}function _v(e,a,r="/"){return _2(e,a,r,!1)}function _2(e,a,r,i){let c=typeof a=="string"?nl(a):a,d=Ua(c.pathname||"/",r);if(d==null)return null;let u=wv(e);w2(u);let m=null;for(let p=0;m==null&&p<u.length;++p){let h=R2(d);m=M2(u[p],h,i)}return m}function wv(e,a=[],r=[],i="",c=!1){let d=(u,m,p=c,h)=>{let y={relativePath:h===void 0?u.path||"":h,caseSensitive:u.caseSensitive===!0,childrenIndex:m,route:u};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(i)&&p)return;St(y.relativePath.startsWith(i),`Absolute route path "${y.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(i.length)}let x=$a([i,y.relativePath]),v=r.concat(y);u.children&&u.children.length>0&&(St(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${x}".`),wv(u.children,a,v,x,p)),!(u.path==null&&!u.index)&&a.push({path:x,score:A2(x,u.index),routesMeta:v})};return e.forEach((u,m)=>{var p;if(u.path===""||!((p=u.path)!=null&&p.includes("?")))d(u,m);else for(let h of jv(u.path))d(u,m,!0,h)}),a}function jv(e){let a=e.split("/");if(a.length===0)return[];let[r,...i]=a,c=r.endsWith("?"),d=r.replace(/\?$/,"");if(i.length===0)return c?[d,""]:[d];let u=jv(i.join("/")),m=[];return m.push(...u.map(p=>p===""?d:[d,p].join("/"))),c&&m.push(...u),m.map(p=>e.startsWith("/")&&p===""?"/":p)}function w2(e){e.sort((a,r)=>a.score!==r.score?r.score-a.score:D2(a.routesMeta.map(i=>i.childrenIndex),r.routesMeta.map(i=>i.childrenIndex)))}var j2=/^:[\w-]+$/,S2=3,N2=2,C2=1,E2=10,T2=-2,wy=e=>e==="*";function A2(e,a){let r=e.split("/"),i=r.length;return r.some(wy)&&(i+=T2),a&&(i+=N2),r.filter(c=>!wy(c)).reduce((c,d)=>c+(j2.test(d)?S2:d===""?C2:E2),i)}function D2(e,a){return e.length===a.length&&e.slice(0,-1).every((i,c)=>i===a[c])?e[e.length-1]-a[a.length-1]:0}function M2(e,a,r=!1){let{routesMeta:i}=e,c={},d="/",u=[];for(let m=0;m<i.length;++m){let p=i[m],h=m===i.length-1,y=d==="/"?a:a.slice(d.length)||"/",x=Mc({path:p.relativePath,caseSensitive:p.caseSensitive,end:h},y),v=p.route;if(!x&&h&&r&&!i[i.length-1].route.index&&(x=Mc({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},y)),!x)return null;Object.assign(c,x.params),u.push({params:c,pathname:$a([d,x.pathname]),pathnameBase:B2($a([d,x.pathnameBase])),route:v}),x.pathnameBase!=="/"&&(d=$a([d,x.pathnameBase]))}return u}function Mc(e,a){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,i]=z2(e.path,e.caseSensitive,e.end),c=a.match(r);if(!c)return null;let d=c[0],u=d.replace(/(.)\/+$/,"$1"),m=c.slice(1);return{params:i.reduce((h,{paramName:y,isOptional:x},v)=>{if(y==="*"){let w=m[v]||"";u=d.slice(0,d.length-w.length).replace(/(.)\/+$/,"$1")}const k=m[v];return x&&!k?h[y]=void 0:h[y]=(k||"").replace(/%2F/g,"/"),h},{}),pathname:d,pathnameBase:u,pattern:e}}function z2(e,a=!1,r=!0){Kn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let i=[],c="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,m,p)=>(i.push({paramName:m,isOptional:p!=null}),p?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(i.push({paramName:"*"}),c+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?c+="\\/*$":e!==""&&e!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),i]}function R2(e){try{return e.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return Kn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${a}).`),e}}function Ua(e,a){if(a==="/")return e;if(!e.toLowerCase().startsWith(a.toLowerCase()))return null;let r=a.endsWith("/")?a.length-1:a.length,i=e.charAt(r);return i&&i!=="/"?null:e.slice(r)||"/"}var O2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function L2(e,a="/"){let{pathname:r,search:i="",hash:c=""}=typeof e=="string"?nl(e):e,d;return r?(r=r.replace(/\/\/+/g,"/"),r.startsWith("/")?d=jy(r.substring(1),"/"):d=jy(r,a)):d=a,{pathname:d,search:U2(i),hash:H2(c)}}function jy(e,a){let r=a.replace(/\/+$/,"").split("/");return e.split("/").forEach(c=>{c===".."?r.length>1&&r.pop():c!=="."&&r.push(c)}),r.length>1?r.join("/"):"/"}function bf(e,a,r,i){return`Cannot include a '${e}' character in a manually specified \`to.${a}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function $2(e){return e.filter((a,r)=>r===0||a.route.path&&a.route.path.length>0)}function Bp(e){let a=$2(e);return a.map((r,i)=>i===a.length-1?r.pathname:r.pathnameBase)}function Up(e,a,r,i=!1){let c;typeof e=="string"?c=nl(e):(c={...e},St(!c.pathname||!c.pathname.includes("?"),bf("?","pathname","search",c)),St(!c.pathname||!c.pathname.includes("#"),bf("#","pathname","hash",c)),St(!c.search||!c.search.includes("#"),bf("#","search","hash",c)));let d=e===""||c.pathname==="",u=d?"/":c.pathname,m;if(u==null)m=r;else{let x=a.length-1;if(!i&&u.startsWith("..")){let v=u.split("/");for(;v[0]==="..";)v.shift(),x-=1;c.pathname=v.join("/")}m=x>=0?a[x]:"/"}let p=L2(c,m),h=u&&u!=="/"&&u.endsWith("/"),y=(d||u===".")&&r.endsWith("/");return!p.pathname.endsWith("/")&&(h||y)&&(p.pathname+="/"),p}var $a=e=>e.join("/").replace(/\/\/+/g,"/"),B2=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),U2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,H2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,q2=class{constructor(e,a,r,i=!1){this.status=e,this.statusText=a||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function F2(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function I2(e){return e.map(a=>a.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Sv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Nv(e,a){let r=e;if(typeof r!="string"||!O2.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let i=r,c=!1;if(Sv)try{let d=new URL(window.location.href),u=r.startsWith("//")?new URL(d.protocol+r):new URL(r),m=Ua(u.pathname,a);u.origin===d.origin&&m!=null?r=m+u.search+u.hash:c=!0}catch{Kn(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:c,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Cv=["POST","PUT","PATCH","DELETE"];new Set(Cv);var Y2=["GET",...Cv];new Set(Y2);var cs=b.createContext(null);cs.displayName="DataRouter";var Yc=b.createContext(null);Yc.displayName="DataRouterState";var G2=b.createContext(!1),Ev=b.createContext({isTransitioning:!1});Ev.displayName="ViewTransition";var V2=b.createContext(new Map);V2.displayName="Fetchers";var K2=b.createContext(null);K2.displayName="Await";var zn=b.createContext(null);zn.displayName="Navigation";var Ri=b.createContext(null);Ri.displayName="Location";var la=b.createContext({outlet:null,matches:[],isDataRoute:!1});la.displayName="Route";var Hp=b.createContext(null);Hp.displayName="RouteError";var Tv="REACT_ROUTER_ERROR",P2="REDIRECT",X2="ROUTE_ERROR_RESPONSE";function Q2(e){if(e.startsWith(`${Tv}:${P2}:{`))try{let a=JSON.parse(e.slice(28));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.location=="string"&&typeof a.reloadDocument=="boolean"&&typeof a.replace=="boolean")return a}catch{}}function Z2(e){if(e.startsWith(`${Tv}:${X2}:{`))try{let a=JSON.parse(e.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new q2(a.status,a.statusText,a.data)}catch{}}function J2(e,{relative:a}={}){St(us(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:i}=b.useContext(zn),{hash:c,pathname:d,search:u}=Oi(e,{relative:a}),m=d;return r!=="/"&&(m=d==="/"?r:$a([r,d])),i.createHref({pathname:m,search:u,hash:c})}function us(){return b.useContext(Ri)!=null}function Rn(){return St(us(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(Ri).location}var Av="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Dv(e){b.useContext(zn).static||b.useLayoutEffect(e)}function Gc(){let{isDataRoute:e}=b.useContext(la);return e?pw():W2()}function W2(){St(us(),"useNavigate() may be used only in the context of a <Router> component.");let e=b.useContext(cs),{basename:a,navigator:r}=b.useContext(zn),{matches:i}=b.useContext(la),{pathname:c}=Rn(),d=JSON.stringify(Bp(i)),u=b.useRef(!1);return Dv(()=>{u.current=!0}),b.useCallback((p,h={})=>{if(Kn(u.current,Av),!u.current)return;if(typeof p=="number"){r.go(p);return}let y=Up(p,JSON.parse(d),c,h.relative==="path");e==null&&a!=="/"&&(y.pathname=y.pathname==="/"?a:$a([a,y.pathname])),(h.replace?r.replace:r.push)(y,h.state,h)},[a,r,d,c,e])}var ew=b.createContext(null);function tw(e){let a=b.useContext(la).outlet;return b.useMemo(()=>a&&b.createElement(ew.Provider,{value:e},a),[a,e])}function Oi(e,{relative:a}={}){let{matches:r}=b.useContext(la),{pathname:i}=Rn(),c=JSON.stringify(Bp(r));return b.useMemo(()=>Up(e,JSON.parse(c),i,a==="path"),[e,c,i,a])}function nw(e,a){return Mv(e,a)}function Mv(e,a,r,i,c){var $;St(us(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:d}=b.useContext(zn),{matches:u}=b.useContext(la),m=u[u.length-1],p=m?m.params:{},h=m?m.pathname:"/",y=m?m.pathnameBase:"/",x=m&&m.route;{let M=x&&x.path||"";Rv(h,!x||M.endsWith("*")||M.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${M}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
||
|
||
Please change the parent <Route path="${M}"> to <Route path="${M==="/"?"*":`${M}/*`}">.`)}let v=Rn(),k;if(a){let M=typeof a=="string"?nl(a):a;St(y==="/"||(($=M.pathname)==null?void 0:$.startsWith(y)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${y}" but pathname "${M.pathname}" was given in the \`location\` prop.`),k=M}else k=v;let w=k.pathname||"/",T=w;if(y!=="/"){let M=y.replace(/^\//,"").split("/");T="/"+w.replace(/^\//,"").split("/").slice(M.length).join("/")}let j=_v(e,{pathname:T});Kn(x||j!=null,`No routes matched location "${k.pathname}${k.search}${k.hash}" `),Kn(j==null||j[j.length-1].route.element!==void 0||j[j.length-1].route.Component!==void 0||j[j.length-1].route.lazy!==void 0,`Matched leaf route at location "${k.pathname}${k.search}${k.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 C=iw(j&&j.map(M=>Object.assign({},M,{params:Object.assign({},p,M.params),pathname:$a([y,d.encodeLocation?d.encodeLocation(M.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:M.pathname]),pathnameBase:M.pathnameBase==="/"?y:$a([y,d.encodeLocation?d.encodeLocation(M.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:M.pathnameBase])})),u,r,i,c);return a&&C?b.createElement(Ri.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...k},navigationType:"POP"}},C):C}function aw(){let e=fw(),a=F2(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:i},d={padding:"2px 4px",backgroundColor:i},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:d},"ErrorBoundary")," or"," ",b.createElement("code",{style:d},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},a),r?b.createElement("pre",{style:c},r):null,u)}var rw=b.createElement(aw,null),zv=class extends b.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,a){return a.location!==e.location||a.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:a.error,location:a.location,revalidation:e.revalidation||a.revalidation}}componentDidCatch(e,a){this.props.onError?this.props.onError(e,a):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=Z2(e.digest);r&&(e=r)}let a=e!==void 0?b.createElement(la.Provider,{value:this.props.routeContext},b.createElement(Hp.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?b.createElement(lw,{error:e},a):a}};zv.contextType=G2;var vf=new WeakMap;function lw({children:e,error:a}){let{basename:r}=b.useContext(zn);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let i=Q2(a.digest);if(i){let c=vf.get(a);if(c)throw c;let d=Nv(i.location,r);if(Sv&&!vf.get(a))if(d.isExternal||i.reloadDocument)window.location.href=d.absoluteURL||d.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(d.to,{replace:i.replace}));throw vf.set(a,u),u}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d.absoluteURL||d.to}`})}}return e}function sw({routeContext:e,match:a,children:r}){let i=b.useContext(cs);return i&&i.static&&i.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=a.route.id),b.createElement(la.Provider,{value:e},r)}function iw(e,a=[],r=null,i=null,c=null){if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(a.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let d=e,u=r==null?void 0:r.errors;if(u!=null){let y=d.findIndex(x=>x.route.id&&(u==null?void 0:u[x.route.id])!==void 0);St(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),d=d.slice(0,Math.min(d.length,y+1))}let m=!1,p=-1;if(r)for(let y=0;y<d.length;y++){let x=d[y];if((x.route.HydrateFallback||x.route.hydrateFallbackElement)&&(p=y),x.route.id){let{loaderData:v,errors:k}=r,w=x.route.loader&&!v.hasOwnProperty(x.route.id)&&(!k||k[x.route.id]===void 0);if(x.route.lazy||w){m=!0,p>=0?d=d.slice(0,p+1):d=[d[0]];break}}}let h=r&&i?(y,x)=>{var v,k;i(y,{location:r.location,params:((k=(v=r.matches)==null?void 0:v[0])==null?void 0:k.params)??{},unstable_pattern:I2(r.matches),errorInfo:x})}:void 0;return d.reduceRight((y,x,v)=>{let k,w=!1,T=null,j=null;r&&(k=u&&x.route.id?u[x.route.id]:void 0,T=x.route.errorElement||rw,m&&(p<0&&v===0?(Rv("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,j=null):p===v&&(w=!0,j=x.route.hydrateFallbackElement||null)));let C=a.concat(d.slice(0,v+1)),$=()=>{let M;return k?M=T:w?M=j:x.route.Component?M=b.createElement(x.route.Component,null):x.route.element?M=x.route.element:M=y,b.createElement(sw,{match:x,routeContext:{outlet:y,matches:C,isDataRoute:r!=null},children:M})};return r&&(x.route.ErrorBoundary||x.route.errorElement||v===0)?b.createElement(zv,{location:r.location,revalidation:r.revalidation,component:T,error:k,children:$(),routeContext:{outlet:null,matches:C,isDataRoute:!0},onError:h}):$()},null)}function qp(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ow(e){let a=b.useContext(cs);return St(a,qp(e)),a}function cw(e){let a=b.useContext(Yc);return St(a,qp(e)),a}function uw(e){let a=b.useContext(la);return St(a,qp(e)),a}function Fp(e){let a=uw(e),r=a.matches[a.matches.length-1];return St(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function dw(){return Fp("useRouteId")}function fw(){var i;let e=b.useContext(Hp),a=cw("useRouteError"),r=Fp("useRouteError");return e!==void 0?e:(i=a.errors)==null?void 0:i[r]}function pw(){let{router:e}=ow("useNavigate"),a=Fp("useNavigate"),r=b.useRef(!1);return Dv(()=>{r.current=!0}),b.useCallback(async(c,d={})=>{Kn(r.current,Av),r.current&&(typeof c=="number"?await e.navigate(c):await e.navigate(c,{fromRouteId:a,...d}))},[e,a])}var Sy={};function Rv(e,a,r){!a&&!Sy[e]&&(Sy[e]=!0,Kn(!1,r))}b.memo(mw);function mw({routes:e,future:a,state:r,onError:i}){return Mv(e,void 0,r,i,a)}function lp({to:e,replace:a,state:r,relative:i}){St(us(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=b.useContext(zn);Kn(!c,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:d}=b.useContext(la),{pathname:u}=Rn(),m=Gc(),p=Up(e,Bp(d),u,i==="path"),h=JSON.stringify(p);return b.useEffect(()=>{m(JSON.parse(h),{replace:a,state:r,relative:i})},[m,h,i,a,r]),null}function Ov(e){return tw(e.context)}function Gt(e){St(!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 Lv({basename:e="/",children:a=null,location:r,navigationType:i="POP",navigator:c,static:d=!1,unstable_useTransitions:u}){St(!us(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=e.replace(/^\/*/,"/"),p=b.useMemo(()=>({basename:m,navigator:c,static:d,unstable_useTransitions:u,future:{}}),[m,c,d,u]);typeof r=="string"&&(r=nl(r));let{pathname:h="/",search:y="",hash:x="",state:v=null,key:k="default"}=r,w=b.useMemo(()=>{let T=Ua(h,m);return T==null?null:{location:{pathname:T,search:y,hash:x,state:v,key:k},navigationType:i}},[m,h,y,x,v,k,i]);return Kn(w!=null,`<Router basename="${m}"> is not able to match the URL "${h}${y}${x}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:b.createElement(zn.Provider,{value:p},b.createElement(Ri.Provider,{children:a,value:w}))}function hw({children:e,location:a}){return nw(sp(e),a)}function sp(e,a=[]){let r=[];return b.Children.forEach(e,(i,c)=>{if(!b.isValidElement(i))return;let d=[...a,c];if(i.type===b.Fragment){r.push.apply(r,sp(i.props.children,d));return}St(i.type===Gt,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),St(!i.props.index||!i.props.children,"An index route cannot have child routes.");let u={id:i.props.id||d.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,middleware:i.props.middleware,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(u.children=sp(i.props.children,d)),r.push(u)}),r}var jc="get",Sc="application/x-www-form-urlencoded";function Vc(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function gw(e){return Vc(e)&&e.tagName.toLowerCase()==="button"}function xw(e){return Vc(e)&&e.tagName.toLowerCase()==="form"}function yw(e){return Vc(e)&&e.tagName.toLowerCase()==="input"}function bw(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function vw(e,a){return e.button===0&&(!a||a==="_self")&&!bw(e)}var pc=null;function kw(){if(pc===null)try{new FormData(document.createElement("form"),0),pc=!1}catch{pc=!0}return pc}var _w=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function kf(e){return e!=null&&!_w.has(e)?(Kn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Sc}"`),null):e}function ww(e,a){let r,i,c,d,u;if(xw(e)){let m=e.getAttribute("action");i=m?Ua(m,a):null,r=e.getAttribute("method")||jc,c=kf(e.getAttribute("enctype"))||Sc,d=new FormData(e)}else if(gw(e)||yw(e)&&(e.type==="submit"||e.type==="image")){let m=e.form;if(m==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=e.getAttribute("formaction")||m.getAttribute("action");if(i=p?Ua(p,a):null,r=e.getAttribute("formmethod")||m.getAttribute("method")||jc,c=kf(e.getAttribute("formenctype"))||kf(m.getAttribute("enctype"))||Sc,d=new FormData(m,e),!kw()){let{name:h,type:y,value:x}=e;if(y==="image"){let v=h?`${h}.`:"";d.append(`${v}x`,"0"),d.append(`${v}y`,"0")}else h&&d.append(h,x)}}else{if(Vc(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=jc,i=null,c=Sc,u=e}return d&&c==="text/plain"&&(u=d,d=void 0),{action:i,method:r.toLowerCase(),encType:c,formData:d,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Ip(e,a){if(e===!1||e===null||typeof e>"u")throw new Error(a)}function jw(e,a,r,i){let c=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${i}`:c.pathname=`${c.pathname}.${i}`:c.pathname==="/"?c.pathname=`_root.${i}`:a&&Ua(c.pathname,a)==="/"?c.pathname=`${a.replace(/\/$/,"")}/_root.${i}`:c.pathname=`${c.pathname.replace(/\/$/,"")}.${i}`,c}async function Sw(e,a){if(e.id in a)return a[e.id];try{let r=await import(e.module);return a[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Nw(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Cw(e,a,r){let i=await Promise.all(e.map(async c=>{let d=a.routes[c.route.id];if(d){let u=await Sw(d,r);return u.links?u.links():[]}return[]}));return Dw(i.flat(1).filter(Nw).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function Ny(e,a,r,i,c,d){let u=(p,h)=>r[h]?p.route.id!==r[h].route.id:!0,m=(p,h)=>{var y;return r[h].pathname!==p.pathname||((y=r[h].route.path)==null?void 0:y.endsWith("*"))&&r[h].params["*"]!==p.params["*"]};return d==="assets"?a.filter((p,h)=>u(p,h)||m(p,h)):d==="data"?a.filter((p,h)=>{var x;let y=i.routes[p.route.id];if(!y||!y.hasLoader)return!1;if(u(p,h)||m(p,h))return!0;if(p.route.shouldRevalidate){let v=p.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:((x=r[0])==null?void 0:x.params)||{},nextUrl:new URL(e,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function Ew(e,a,{includeHydrateFallback:r}={}){return Tw(e.map(i=>{let c=a.routes[i.route.id];if(!c)return[];let d=[c.module];return c.clientActionModule&&(d=d.concat(c.clientActionModule)),c.clientLoaderModule&&(d=d.concat(c.clientLoaderModule)),r&&c.hydrateFallbackModule&&(d=d.concat(c.hydrateFallbackModule)),c.imports&&(d=d.concat(c.imports)),d}).flat(1))}function Tw(e){return[...new Set(e)]}function Aw(e){let a={},r=Object.keys(e).sort();for(let i of r)a[i]=e[i];return a}function Dw(e,a){let r=new Set;return new Set(a),e.reduce((i,c)=>{let d=JSON.stringify(Aw(c));return r.has(d)||(r.add(d),i.push({key:d,link:c})),i},[])}function $v(){let e=b.useContext(cs);return Ip(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Mw(){let e=b.useContext(Yc);return Ip(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Yp=b.createContext(void 0);Yp.displayName="FrameworkContext";function Bv(){let e=b.useContext(Yp);return Ip(e,"You must render this element inside a <HydratedRouter> element"),e}function zw(e,a){let r=b.useContext(Yp),[i,c]=b.useState(!1),[d,u]=b.useState(!1),{onFocus:m,onBlur:p,onMouseEnter:h,onMouseLeave:y,onTouchStart:x}=a,v=b.useRef(null);b.useEffect(()=>{if(e==="render"&&u(!0),e==="viewport"){let T=C=>{C.forEach($=>{u($.isIntersecting)})},j=new IntersectionObserver(T,{threshold:.5});return v.current&&j.observe(v.current),()=>{j.disconnect()}}},[e]),b.useEffect(()=>{if(i){let T=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(T)}}},[i]);let k=()=>{c(!0)},w=()=>{c(!1),u(!1)};return r?e!=="intent"?[d,v,{}]:[d,v,{onFocus:di(m,k),onBlur:di(p,w),onMouseEnter:di(h,k),onMouseLeave:di(y,w),onTouchStart:di(x,k)}]:[!1,v,{}]}function di(e,a){return r=>{e&&e(r),r.defaultPrevented||a(r)}}function Rw({page:e,...a}){let{router:r}=$v(),i=b.useMemo(()=>_v(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?b.createElement(Lw,{page:e,matches:i,...a}):null}function Ow(e){let{manifest:a,routeModules:r}=Bv(),[i,c]=b.useState([]);return b.useEffect(()=>{let d=!1;return Cw(e,a,r).then(u=>{d||c(u)}),()=>{d=!0}},[e,a,r]),i}function Lw({page:e,matches:a,...r}){let i=Rn(),{future:c,manifest:d,routeModules:u}=Bv(),{basename:m}=$v(),{loaderData:p,matches:h}=Mw(),y=b.useMemo(()=>Ny(e,a,h,d,i,"data"),[e,a,h,d,i]),x=b.useMemo(()=>Ny(e,a,h,d,i,"assets"),[e,a,h,d,i]),v=b.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let T=new Set,j=!1;if(a.forEach($=>{var ee;let M=d.routes[$.route.id];!M||!M.hasLoader||(!y.some(ne=>ne.route.id===$.route.id)&&$.route.id in p&&((ee=u[$.route.id])!=null&&ee.shouldRevalidate)||M.hasClientLoader?j=!0:T.add($.route.id))}),T.size===0)return[];let C=jw(e,m,c.unstable_trailingSlashAwareDataRequests,"data");return j&&T.size>0&&C.searchParams.set("_routes",a.filter($=>T.has($.route.id)).map($=>$.route.id).join(",")),[C.pathname+C.search]},[m,c.unstable_trailingSlashAwareDataRequests,p,i,d,y,a,e,u]),k=b.useMemo(()=>Ew(x,d),[x,d]),w=Ow(x);return b.createElement(b.Fragment,null,v.map(T=>b.createElement("link",{key:T,rel:"prefetch",as:"fetch",href:T,...r})),k.map(T=>b.createElement("link",{key:T,rel:"modulepreload",href:T,...r})),w.map(({key:T,link:j})=>b.createElement("link",{key:T,nonce:r.nonce,...j,crossOrigin:j.crossOrigin??r.crossOrigin})))}function $w(...e){return a=>{e.forEach(r=>{typeof r=="function"?r(a):r!=null&&(r.current=a)})}}var Bw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Bw&&(window.__reactRouterVersion="7.13.0")}catch{}function Uw({basename:e,children:a,unstable_useTransitions:r,window:i}){let c=b.useRef();c.current==null&&(c.current=y2({window:i,v5Compat:!0}));let d=c.current,[u,m]=b.useState({action:d.action,location:d.location}),p=b.useCallback(h=>{r===!1?m(h):b.startTransition(()=>m(h))},[r]);return b.useLayoutEffect(()=>d.listen(p),[d,p]),b.createElement(Lv,{basename:e,children:a,location:u.location,navigationType:u.action,navigator:d,unstable_useTransitions:r})}function Hw({basename:e,children:a,unstable_useTransitions:r,window:i}){let c=b.useRef();c.current==null&&(c.current=b2({window:i,v5Compat:!0}));let d=c.current,[u,m]=b.useState({action:d.action,location:d.location}),p=b.useCallback(h=>{r===!1?m(h):b.startTransition(()=>m(h))},[r]);return b.useLayoutEffect(()=>d.listen(p),[d,p]),b.createElement(Lv,{basename:e,children:a,location:u.location,navigationType:u.action,navigator:d,unstable_useTransitions:r})}var Uv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Gp=b.forwardRef(function({onClick:a,discover:r="render",prefetch:i="none",relative:c,reloadDocument:d,replace:u,state:m,target:p,to:h,preventScrollReset:y,viewTransition:x,unstable_defaultShouldRevalidate:v,...k},w){let{basename:T,unstable_useTransitions:j}=b.useContext(zn),C=typeof h=="string"&&Uv.test(h),$=Nv(h,T);h=$.to;let M=J2(h,{relative:c}),[ee,ne,A]=zw(i,k),G=Iw(h,{replace:u,state:m,target:p,preventScrollReset:y,relative:c,viewTransition:x,unstable_defaultShouldRevalidate:v,unstable_useTransitions:j});function V(Y){a&&a(Y),Y.defaultPrevented||G(Y)}let oe=b.createElement("a",{...k,...A,href:$.absoluteURL||M,onClick:$.isExternal||d?a:V,ref:$w(w,ne),target:p,"data-discover":!C&&r==="render"?"true":void 0});return ee&&!C?b.createElement(b.Fragment,null,oe,b.createElement(Rw,{page:M})):oe});Gp.displayName="Link";var Hv=b.forwardRef(function({"aria-current":a="page",caseSensitive:r=!1,className:i="",end:c=!1,style:d,to:u,viewTransition:m,children:p,...h},y){let x=Oi(u,{relative:h.relative}),v=Rn(),k=b.useContext(Yc),{navigator:w,basename:T}=b.useContext(zn),j=k!=null&&Pw(x)&&m===!0,C=w.encodeLocation?w.encodeLocation(x).pathname:x.pathname,$=v.pathname,M=k&&k.navigation&&k.navigation.location?k.navigation.location.pathname:null;r||($=$.toLowerCase(),M=M?M.toLowerCase():null,C=C.toLowerCase()),M&&T&&(M=Ua(M,T)||M);const ee=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let ne=$===C||!c&&$.startsWith(C)&&$.charAt(ee)==="/",A=M!=null&&(M===C||!c&&M.startsWith(C)&&M.charAt(C.length)==="/"),G={isActive:ne,isPending:A,isTransitioning:j},V=ne?a:void 0,oe;typeof i=="function"?oe=i(G):oe=[i,ne?"active":null,A?"pending":null,j?"transitioning":null].filter(Boolean).join(" ");let Y=typeof d=="function"?d(G):d;return b.createElement(Gp,{...h,"aria-current":V,className:oe,ref:y,style:Y,to:u,viewTransition:m},typeof p=="function"?p(G):p)});Hv.displayName="NavLink";var qw=b.forwardRef(({discover:e="render",fetcherKey:a,navigate:r,reloadDocument:i,replace:c,state:d,method:u=jc,action:m,onSubmit:p,relative:h,preventScrollReset:y,viewTransition:x,unstable_defaultShouldRevalidate:v,...k},w)=>{let{unstable_useTransitions:T}=b.useContext(zn),j=Vw(),C=Kw(m,{relative:h}),$=u.toLowerCase()==="get"?"get":"post",M=typeof m=="string"&&Uv.test(m),ee=ne=>{if(p&&p(ne),ne.defaultPrevented)return;ne.preventDefault();let A=ne.nativeEvent.submitter,G=(A==null?void 0:A.getAttribute("formmethod"))||u,V=()=>j(A||ne.currentTarget,{fetcherKey:a,method:G,navigate:r,replace:c,state:d,relative:h,preventScrollReset:y,viewTransition:x,unstable_defaultShouldRevalidate:v});T&&r!==!1?b.startTransition(()=>V()):V()};return b.createElement("form",{ref:w,method:$,action:C,onSubmit:i?p:ee,...k,"data-discover":!M&&e==="render"?"true":void 0})});qw.displayName="Form";function Fw(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function qv(e){let a=b.useContext(cs);return St(a,Fw(e)),a}function Iw(e,{target:a,replace:r,state:i,preventScrollReset:c,relative:d,viewTransition:u,unstable_defaultShouldRevalidate:m,unstable_useTransitions:p}={}){let h=Gc(),y=Rn(),x=Oi(e,{relative:d});return b.useCallback(v=>{if(vw(v,a)){v.preventDefault();let k=r!==void 0?r:as(y)===as(x),w=()=>h(e,{replace:k,state:i,preventScrollReset:c,relative:d,viewTransition:u,unstable_defaultShouldRevalidate:m});p?b.startTransition(()=>w()):w()}},[y,h,x,r,i,a,e,c,d,u,m,p])}var Yw=0,Gw=()=>`__${String(++Yw)}__`;function Vw(){let{router:e}=qv("useSubmit"),{basename:a}=b.useContext(zn),r=dw(),i=e.fetch,c=e.navigate;return b.useCallback(async(d,u={})=>{let{action:m,method:p,encType:h,formData:y,body:x}=ww(d,a);if(u.navigate===!1){let v=u.fetcherKey||Gw();await i(v,r,u.action||m,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:y,body:x,formMethod:u.method||p,formEncType:u.encType||h,flushSync:u.flushSync})}else await c(u.action||m,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:y,body:x,formMethod:u.method||p,formEncType:u.encType||h,replace:u.replace,state:u.state,fromRouteId:r,flushSync:u.flushSync,viewTransition:u.viewTransition})},[i,c,a,r])}function Kw(e,{relative:a}={}){let{basename:r}=b.useContext(zn),i=b.useContext(la);St(i,"useFormAction must be used inside a RouteContext");let[c]=i.matches.slice(-1),d={...Oi(e||".",{relative:a})},u=Rn();if(e==null){d.search=u.search;let m=new URLSearchParams(d.search),p=m.getAll("index");if(p.some(y=>y==="")){m.delete("index"),p.filter(x=>x).forEach(x=>m.append("index",x));let y=m.toString();d.search=y?`?${y}`:""}}return(!e||e===".")&&c.route.index&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(d.pathname=d.pathname==="/"?r:$a([r,d.pathname])),as(d)}function Pw(e,{relative:a}={}){let r=b.useContext(Ev);St(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=qv("useViewTransitionState"),c=Oi(e,{relative:a});if(!r.isTransitioning)return!1;let d=Ua(r.currentLocation.pathname,i)||r.currentLocation.pathname,u=Ua(r.nextLocation.pathname,i)||r.nextLocation.pathname;return Mc(c.pathname,u)!=null||Mc(c.pathname,d)!=null}var Xw=vv();const Vp={system:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',inter:'"Inter", system-ui, sans-serif',segoe:'"Segoe UI", system-ui, sans-serif',sf:'-apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif'},Kp={jetbrains:'"JetBrains Mono", "Fira Code", "Cascadia Code", monospace',fira:'"Fira Code", "JetBrains Mono", "Cascadia Code", monospace',cascadia:'"Cascadia Code", "JetBrains Mono", "Fira Code", monospace',"system-mono":'ui-monospace, "SF Mono", "Cascadia Code", "Fira Code", monospace'},Fv=b.createContext({theme:"dark",accent:"cyan",colorTheme:"default-dark",uiFont:"system",monoFont:"jetbrains",uiFontSize:15,monoFontSize:14,resolvedTheme:"dark",setTheme:()=>{},setAccent:()=>{},setColorTheme:()=>{},setUiFont:()=>{},setMonoFont:()=>{},setUiFontSize:()=>{},setMonoFontSize:()=>{}});function nn(e,a,r,i,c,d,u,m,p,h,y){const x=parseInt(h.slice(1,3),16),v=parseInt(h.slice(3,5),16),k=parseInt(h.slice(5,7),16);return{"--pc-bg-base":e,"--color-scheme":"dark","--pc-bg-surface":a,"--pc-bg-elevated":r,"--pc-bg-input":i,"--pc-bg-sidebar":`${e}f2`,"--pc-bg-code":c,"--pc-border":"rgba(255,255,255,0.08)","--pc-border-strong":"rgba(255,255,255,0.12)","--pc-text-primary":d,"--pc-text-secondary":u,"--pc-text-muted":m,"--pc-text-faint":p,"--pc-scrollbar-thumb":p,"--pc-scrollbar-track":a,"--pc-scrollbar-thumb-hover":m,"--pc-hover":"rgba(255,255,255,0.05)","--pc-hover-strong":"rgba(255,255,255,0.08)","--pc-separator":"rgba(255,255,255,0.05)","--pc-accent":h,"--pc-accent-light":y,"--pc-accent-dim":`rgba(${x},${v},${k},0.3)`,"--pc-accent-glow":`rgba(${x},${v},${k},0.1)`,"--pc-accent-rgb":`${x},${v},${k}`}}function gr(e,a,r,i,c,d,u,m,p,h,y){const x=parseInt(h.slice(1,3),16),v=parseInt(h.slice(3,5),16),k=parseInt(h.slice(5,7),16);return{"--pc-bg-base":e,"--color-scheme":"light","--pc-bg-surface":a,"--pc-bg-elevated":r,"--pc-bg-input":i,"--pc-bg-sidebar":`${a}f2`,"--pc-bg-code":c,"--pc-border":"rgba(0,0,0,0.08)","--pc-border-strong":"rgba(0,0,0,0.12)","--pc-text-primary":d,"--pc-text-secondary":u,"--pc-text-muted":m,"--pc-text-faint":p,"--pc-scrollbar-thumb":p,"--pc-scrollbar-track":r,"--pc-scrollbar-thumb-hover":m,"--pc-hover":"rgba(0,0,0,0.04)","--pc-hover-strong":"rgba(0,0,0,0.07)","--pc-separator":"rgba(0,0,0,0.06)","--pc-accent":h,"--pc-accent-light":y,"--pc-accent-dim":`rgba(${x},${v},${k},0.25)`,"--pc-accent-glow":`rgba(${x},${v},${k},0.08)`,"--pc-accent-rgb":`${x},${v},${k}`}}const Nc=[{id:"default-dark",name:"Default Dark",scheme:"dark",preview:["#1e1e24","#22d3ee","#a78bfa","#f59e0b","#d4d4d8"],vars:nn("#1e1e24","#232329","#27272a","#1a1a20","#1a1a20","#d4d4d8","#a1a1aa","#71717a","#52525b","#22d3ee","#67e8f9")},{id:"default-light",name:"Default Light",scheme:"light",preview:["#f4f4f5","#22d3ee","#8b5cf6","#f59e0b","#18181b"],vars:gr("#f4f4f5","#ffffff","#e4e4e7","#ffffff","#f4f4f5","#18181b","#3f3f46","#71717a","#a1a1aa","#0891b2","#06b6d4")},{id:"oled-black",name:"OLED Black",scheme:"dark",preview:["#000000","#22d3ee","#8b5cf6","#10b981","#d4d4d8"],vars:nn("#000000","#0a0a0a","#141414","#0a0a0a","#0a0a0a","#d4d4d8","#a1a1aa","#71717a","#3f3f46","#22d3ee","#67e8f9")},{id:"nord-dark",name:"Nord Dark",scheme:"dark",preview:["#2e3440","#88c0d0","#81a1c1","#a3be8c","#eceff4"],vars:nn("#2e3440","#3b4252","#434c5e","#2e3440","#2e3440","#eceff4","#d8dee9","#7b88a1","#4c566a","#88c0d0","#8fbcbb")},{id:"nord-light",name:"Nord Light",scheme:"light",preview:["#eceff4","#5e81ac","#88c0d0","#a3be8c","#2e3440"],vars:gr("#eceff4","#e5e9f0","#d8dee9","#e5e9f0","#e5e9f0","#2e3440","#3b4252","#4c566a","#7b88a1","#5e81ac","#81a1c1")},{id:"dracula",name:"Dracula",scheme:"dark",preview:["#282a36","#bd93f9","#ff79c6","#50fa7b","#f8f8f2"],vars:nn("#282a36","#21222c","#343746","#1e1f29","#1e1f29","#f8f8f2","#c0c0d0","#6272a4","#44475a","#bd93f9","#caa9fa")},{id:"monokai",name:"Monokai",scheme:"dark",preview:["#272822","#f92672","#a6e22e","#e6db74","#f8f8f2"],vars:nn("#272822","#2d2e27","#3e3d32","#1e1f1c","#1e1f1c","#f8f8f2","#c0c0b0","#75715e","#49483e","#f92672","#fd5fa0")},{id:"solarized-dark",name:"Solarized Dark",scheme:"dark",preview:["#002b36","#268bd2","#2aa198","#b58900","#839496"],vars:nn("#002b36","#073642","#0a4050","#002028","#002028","#839496","#93a1a1","#657b83","#586e75","#268bd2","#6cb6e8")},{id:"solarized-light",name:"Solarized Light",scheme:"light",preview:["#fdf6e3","#268bd2","#2aa198","#b58900","#073642"],vars:gr("#fdf6e3","#eee8d5","#ddd6c1","#fdf6e3","#eee8d5","#073642","#586e75","#657b83","#93a1a1","#268bd2","#2aa198")},{id:"kanagawa-wave",name:"Kanagawa Wave",scheme:"dark",preview:["#1f1f28","#7e9cd8","#957fb8","#e6c384","#dcd7ba"],vars:nn("#1f1f28","#2a2a37","#363646","#16161d","#16161d","#dcd7ba","#c8c093","#727169","#54546d","#7e9cd8","#7fb4ca")},{id:"kanagawa-dragon",name:"Kanagawa Dragon",scheme:"dark",preview:["#181616","#8ba4b0","#a292a3","#c4b28a","#c5c9c5"],vars:nn("#181616","#201d1d","#2d2a2a","#12120f","#12120f","#c5c9c5","#a6a69c","#737c73","#625e5a","#8ba4b0","#9cabba")},{id:"kanagawa-lotus",name:"Kanagawa Lotus",scheme:"light",preview:["#f2ecbc","#4d699b","#b35b79","#836f4a","#1f1f28"],vars:gr("#f2ecbc","#e7dba0","#d5cea3","#f2ecbc","#e7dba0","#1f1f28","#545464","#716e61","#8a8980","#4d699b","#6693bf")},{id:"rose-pine",name:"Rosé Pine",scheme:"dark",preview:["#191724","#ebbcba","#c4a7e7","#f6c177","#e0def4"],vars:nn("#191724","#1f1d2e","#26233a","#13111e","#13111e","#e0def4","#908caa","#6e6a86","#524f67","#ebbcba","#f2d5ce")},{id:"rose-pine-moon",name:"Rosé Pine Moon",scheme:"dark",preview:["#232136","#ea9a97","#c4a7e7","#f6c177","#e0def4"],vars:nn("#232136","#2a273f","#393552","#1b1930","#1b1930","#e0def4","#908caa","#6e6a86","#44415a","#ea9a97","#f0b8b6")},{id:"rose-pine-dawn",name:"Rosé Pine Dawn",scheme:"light",preview:["#faf4ed","#d7827e","#907aa9","#ea9d34","#575279"],vars:gr("#faf4ed","#fffaf3","#f2e9de","#fffaf3","#f2e9de","#575279","#797593","#9893a5","#cecacd","#d7827e","#b4637a")},{id:"night-owl",name:"Night Owl",scheme:"dark",preview:["#011627","#82aaff","#c792ea","#addb67","#d6deeb"],vars:nn("#011627","#0b2942","#122d42","#010e1a","#010e1a","#d6deeb","#a7bbc7","#5f7e97","#37536b","#82aaff","#a0c4ff")},{id:"everforest-dark",name:"Everforest Dark",scheme:"dark",preview:["#2d353b","#a7c080","#83c092","#dbbc7f","#d3c6aa"],vars:nn("#2d353b","#343f44","#3d484d","#272e33","#272e33","#d3c6aa","#9da9a0","#7a8478","#56635f","#a7c080","#83c092")},{id:"everforest-light",name:"Everforest Light",scheme:"light",preview:["#fdf6e3","#8da101","#35a77c","#dfa000","#5c6a72"],vars:gr("#fdf6e3","#f3ead3","#e9dfc4","#f3ead3","#eee8d5","#5c6a72","#708089","#829181","#a6b0a0","#8da101","#93b259")},{id:"cobalt2",name:"Cobalt2",scheme:"dark",preview:["#193549","#ffc600","#ff9d00","#80ffbb","#ffffff"],vars:nn("#193549","#1f4662","#234d6e","#0d2b3e","#0d2b3e","#ffffff","#a0c4d8","#507a8f","#305a6f","#ffc600","#ffd740")},{id:"flexoki-dark",name:"Flexoki Dark",scheme:"dark",preview:["#100f0f","#ce5d97","#879a39","#da702c","#cecdc3"],vars:nn("#100f0f","#1c1b1a","#282726","#100f0f","#1c1b1a","#cecdc3","#b7b5ac","#878580","#575653","#ce5d97","#d68fb2")},{id:"flexoki-light",name:"Flexoki Light",scheme:"light",preview:["#fffcf0","#ce5d97","#879a39","#da702c","#100f0f"],vars:gr("#fffcf0","#f2f0e5","#e6e4d9","#fffcf0","#f2f0e5","#100f0f","#343331","#575653","#878580","#ce5d97","#a02f6f")},{id:"hacker-green",name:"Hacker Green",scheme:"dark",preview:["#0a0e0a","#00ff41","#00cc33","#008f11","#33ff66"],vars:nn("#0a0e0a","#0d120d","#121a12","#080c08","#080c08","#00ff41","#00cc33","#008f11","#005a0a","#00ff41","#33ff66")},{id:"material-dark",name:"Material Dark",scheme:"dark",preview:["#212121","#89ddff","#c792ea","#ffcb6b","#eeffff"],vars:nn("#212121","#292929","#333333","#1a1a1a","#1a1a1a","#eeffff","#b0bec5","#616161","#424242","#89ddff","#80cbc4")},{id:"material-light",name:"Material Light",scheme:"light",preview:["#fafafa","#6182b8","#7c4dff","#f76d47","#212121"],vars:gr("#fafafa","#ffffff","#eaeaea","#ffffff","#f5f5f5","#212121","#424242","#757575","#bdbdbd","#6182b8","#7c4dff")}],Wl=Object.fromEntries(Nc.map(e=>[e.id,e])),Iv="default-dark",Qw="default-light",Yv="zeroclaw-theme",Il={theme:"dark",accent:"cyan",colorTheme:"default-dark",uiFont:"system",monoFont:"jetbrains",uiFontSize:15,monoFontSize:14},Zw=["dark","light","oled","system"],Jw=["cyan","violet","emerald","amber","rose","blue"];function Ww(e){switch(e){case"light":return"default-light";case"oled":return"oled-black";default:return"default-dark"}}function ej(){try{const e=localStorage.getItem(Yv);if(e){const a=JSON.parse(e),r=Zw.includes(a.theme),i=Jw.includes(a.accent),c=Vp[a.uiFont]?a.uiFont:Il.uiFont,d=Kp[a.monoFont]?a.monoFont:Il.monoFont,u=Number.isFinite(a.uiFontSize)?Math.min(20,Math.max(12,Number(a.uiFontSize))):Il.uiFontSize,m=Number.isFinite(a.monoFontSize)?Math.min(20,Math.max(12,Number(a.monoFontSize))):Il.monoFontSize;let p=Il.colorTheme;if(a.colorTheme&&Wl[a.colorTheme]?p=a.colorTheme:r&&(p=Ww(a.theme)),r&&i)return{theme:a.theme,accent:a.accent,colorTheme:p,uiFont:c,monoFont:d,uiFontSize:u,monoFontSize:m}}}catch{}return Il}const tj="modulepreload",nj=function(e){return"/sgrobot-digital/"+e},Cy={},Pp=function(a,r,i){let c=Promise.resolve();if(r&&r.length>0){let u=function(h){return Promise.all(h.map(y=>Promise.resolve(y).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};document.getElementsByTagName("link");const m=document.querySelector("meta[property=csp-nonce]"),p=(m==null?void 0:m.nonce)||(m==null?void 0:m.getAttribute("nonce"));c=u(r.map(h=>{if(h=nj(h),h in Cy)return;Cy[h]=!0;const y=h.endsWith(".css"),x=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${x}`))return;const v=document.createElement("link");if(v.rel=y?"stylesheet":tj,y||(v.as="script"),v.crossOrigin="",v.href=h,p&&v.setAttribute("nonce",p),document.head.appendChild(v),y)return new Promise((k,w)=>{v.addEventListener("load",k),v.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${h}`)))})}))}function d(u){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=u,window.dispatchEvent(m),!m.defaultPrevented)throw u}return c.then(u=>{for(const m of u||[])m.status==="rejected"&&d(m.reason);return a().catch(d)})};let _f=null,Ey=!1;async function aj(){if(Ey)return _f;Ey=!0;try{const e=await Pp(()=>import("./window-DQYDsu7Z.js"),__vite__mapDeps([0,1]));return _f=async(a,r)=>{await e.getCurrentWindow().setSize(new e.LogicalSize(a,r))},_f}catch{return null}}async function Ty(e,a){const r=await aj();if(r)try{await r(e,a)}catch{}}let mc=null,Ay=!1;async function rj(){if(Ay)return mc;Ay=!0;try{mc=(await Pp(()=>import("./core-DhEqZVGG.js"),[])).invoke}catch{mc=null}return mc}async function lj(e){const a=await rj();if(a)try{await a("set_window_theme",{theme:e})}catch{}}const sj={cyan:{"--pc-accent":"#22d3ee","--pc-accent-light":"#67e8f9","--pc-accent-dim":"rgba(34,211,238,0.3)","--pc-accent-glow":"rgba(34,211,238,0.1)","--pc-accent-rgb":"34,211,238"},violet:{"--pc-accent":"#8b5cf6","--pc-accent-light":"#a78bfa","--pc-accent-dim":"rgba(139,92,246,0.3)","--pc-accent-glow":"rgba(139,92,246,0.1)","--pc-accent-rgb":"139,92,246"},emerald:{"--pc-accent":"#10b981","--pc-accent-light":"#34d399","--pc-accent-dim":"rgba(16,185,129,0.3)","--pc-accent-glow":"rgba(16,185,129,0.1)","--pc-accent-rgb":"16,185,129"},amber:{"--pc-accent":"#f59e0b","--pc-accent-light":"#fbbf24","--pc-accent-dim":"rgba(245,158,11,0.3)","--pc-accent-glow":"rgba(245,158,11,0.1)","--pc-accent-rgb":"245,158,11"},rose:{"--pc-accent":"#f43f5e","--pc-accent-light":"#fb7185","--pc-accent-dim":"rgba(244,63,94,0.3)","--pc-accent-glow":"rgba(244,63,94,0.1)","--pc-accent-rgb":"244,63,94"},blue:{"--pc-accent":"#3b82f6","--pc-accent-light":"#60a5fa","--pc-accent-dim":"rgba(59,130,246,0.3)","--pc-accent-glow":"rgba(59,130,246,0.1)","--pc-accent-rgb":"59,130,246"}};function ij(e){const a=document.documentElement;for(const[r,i]of Object.entries(e))r==="--color-scheme"?a.style.colorScheme=i:a.style.setProperty(r,i)}function Gv(e,a){if(e==="system"){const r=window.matchMedia("(prefers-color-scheme: light)").matches,i=Wl[a];return i&&(r&&i.scheme==="light"||!r&&i.scheme==="dark")?a:r?Qw:Iv}return e==="oled"?"oled-black":a}function oj(e,a){if(e==="oled")return"oled";const r=Gv(e,a),i=Wl[r];return(i==null?void 0:i.scheme)??"dark"}function cj(e,a,r,i){return{"--pc-font-ui":Vp[e],"--pc-font-mono":Kp[a],"--pc-font-size":`${r}px`,"--pc-font-size-mono":`${i}px`}}function uj({children:e}){const[a]=b.useState(ej),[r,i]=b.useState(a.theme),[c,d]=b.useState(a.accent),[u,m]=b.useState(a.colorTheme),[p,h]=b.useState(a.uiFont),[y,x]=b.useState(a.monoFont),[v,k]=b.useState(a.uiFontSize),[w,T]=b.useState(a.monoFontSize),j=b.useCallback(F=>{localStorage.setItem(Yv,JSON.stringify({theme:F.theme,accent:F.accent,colorTheme:F.colorTheme,uiFont:F.uiFont,monoFont:F.monoFont,uiFontSize:F.uiFontSize,monoFontSize:F.monoFontSize}))},[]),C=b.useCallback(F=>{const I=Gv(F.theme,F.colorTheme),Q=Wl[I],le=(Q==null?void 0:Q.vars)??Wl[Iv].vars;ij({...le,...sj[F.accent],...cj(F.uiFont,F.monoFont,F.uiFontSize,F.monoFontSize)})},[]),$=b.useCallback(F=>{i(F);const I={theme:F,accent:c,colorTheme:u,uiFont:p,monoFont:y,uiFontSize:v,monoFontSize:w};C(I),j(I)},[c,u,p,y,v,w,C,j]),M=b.useCallback(F=>{d(F);const I={theme:r,accent:F,colorTheme:u,uiFont:p,monoFont:y,uiFontSize:v,monoFontSize:w};C(I),j(I)},[r,u,p,y,v,w,C,j]),ee=b.useCallback(F=>{m(F);const I=Wl[F];let Q=r;I&&r!=="system"&&(F==="oled-black"?Q="oled":Q=I.scheme,i(Q));const le={theme:Q,accent:c,colorTheme:F,uiFont:p,monoFont:y,uiFontSize:v,monoFontSize:w};C(le),j(le)},[r,c,p,y,v,w,C,j]),ne=b.useCallback(F=>{h(F);const I={theme:r,accent:c,colorTheme:u,uiFont:F,monoFont:y,uiFontSize:v,monoFontSize:w};C(I),j(I)},[r,c,u,C,j,y,v,w]),A=b.useCallback(F=>{x(F);const I={theme:r,accent:c,colorTheme:u,uiFont:p,monoFont:F,uiFontSize:v,monoFontSize:w};C(I),j(I)},[r,c,u,C,j,p,v,w]),G=b.useCallback(F=>{const I=Math.min(20,Math.max(12,F));k(I);const Q={theme:r,accent:c,colorTheme:u,uiFont:p,monoFont:y,uiFontSize:I,monoFontSize:w};C(Q),j(Q)},[r,c,u,C,j,p,y,w]),V=b.useCallback(F=>{const I=Math.min(20,Math.max(12,F));T(I);const Q={theme:r,accent:c,colorTheme:u,uiFont:p,monoFont:y,uiFontSize:v,monoFontSize:I};C(Q),j(Q)},[r,c,u,C,j,p,y,v]);b.useEffect(()=>{C({theme:r,accent:c,colorTheme:u,uiFont:p,monoFont:y,uiFontSize:v,monoFontSize:w})},[]),b.useEffect(()=>{if(r!=="system")return;const F=window.matchMedia("(prefers-color-scheme: light)"),I=()=>C({theme:r,accent:c,colorTheme:u,uiFont:p,monoFont:y,uiFontSize:v,monoFontSize:w});return F.addEventListener("change",I),()=>F.removeEventListener("change",I)},[r,c,u,C,p,y,v,w]);const oe=oj(r,u);b.useEffect(()=>{lj(oe)},[oe]);const Y={theme:r,accent:c,colorTheme:u,uiFont:p,monoFont:y,uiFontSize:v,monoFontSize:w,resolvedTheme:oe,setTheme:$,setAccent:M,setColorTheme:ee,setUiFont:ne,setMonoFont:A,setUiFontSize:G,setMonoFontSize:V};return l.jsx(Fv.Provider,{value:Y,children:e})}function Vv(){try{return window.parent&&window.parent!==window?window.parent:null}catch{return null}}const Vn=()=>{if("__TAURI__"in window||"__TAURI_INTERNALS__"in window)return!0;const e=Vv();return!!(e&&("__TAURI__"in e||"__TAURI_INTERNALS__"in e))},dj=()=>{var e;return window.__ZEROCLAW_GATEWAY__??((e=Vv())==null?void 0:e.__ZEROCLAW_GATEWAY__)??"http://127.0.0.1:42617"},Kv="planb_layout_mode",Dy=640,Pv=b.createContext({mode:"wide",setMode:()=>{},toggleMode:()=>{}});function Xp(){return b.useContext(Pv)}function My(){try{const e=localStorage.getItem(Kv);if(e==="wide"||e==="compact")return e}catch{}return null}function zy(e){try{localStorage.setItem(Kv,e)}catch{}}function fj({children:e}){const[a,r]=b.useState(()=>{if(Vn())return"compact";const u=My();return u||(window.innerWidth<Dy?"compact":"wide")}),i=u=>{if(Vn()){u==="compact"?Ty(420,680):Ty(1100,750);return}try{u==="compact"?window.resizeTo(440,700):window.resizeTo(1100,750)}catch{}},c=b.useCallback(u=>{r(u),zy(u),i(u)},[]),d=b.useCallback(()=>{r(u=>{const m=u==="wide"?"compact":"wide";return zy(m),i(m),m})},[]);return b.useEffect(()=>{if(Vn()||My())return;const m=()=>{r(window.innerWidth<Dy?"compact":"wide")};return window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[]),l.jsx(Pv.Provider,{value:{mode:a,setMode:c,toggleMode:d},children:e})}/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const pj=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Xv=(...e)=>e.filter((a,r,i)=>!!a&&a.trim()!==""&&i.indexOf(a)===r).join(" ").trim();/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/var mj={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"};/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const hj=b.forwardRef(({color:e="currentColor",size:a=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:c="",children:d,iconNode:u,...m},p)=>b.createElement("svg",{ref:p,...mj,width:a,height:a,stroke:e,strokeWidth:i?Number(r)*24/Number(a):r,className:Xv("lucide",c),...m},[...u.map(([h,y])=>b.createElement(h,y)),...Array.isArray(d)?d:[d]]));/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const ye=(e,a)=>{const r=b.forwardRef(({className:i,...c},d)=>b.createElement(hj,{ref:d,iconNode:a,className:Xv(`lucide-${pj(e)}`,i),...c}));return r.displayName=`${e}`,r};/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const vi=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const gj=ye("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const xj=ye("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const yi=ye("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const yj=ye("Bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Zr=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Qv=ye("CalendarClock",[["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M17.5 17.5 16 16.3V14",key:"akvzfd"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const bj=ye("CaseSensitive",[["path",{d:"m3 15 4-8 4 8",key:"1vwr6u"}],["path",{d:"M4 13h6",key:"1r9ots"}],["circle",{cx:"18",cy:"12",r:"3",key:"1kchzo"}],["path",{d:"M21 9v6",key:"anns31"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const vj=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Li=ye("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Kc=ye("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Zv=ye("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const rs=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const $i=ye("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Jv=ye("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const ip=ye("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const al=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const op=ye("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ni=ye("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const kj=ye("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Qp=ye("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const _j=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const wj=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const jj=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const cp=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Sj=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Nj=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Cj=ye("FileClock",[["path",{d:"M16 22h2a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"37hlfg"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"8",cy:"16",r:"6",key:"10v15b"}],["path",{d:"M9.5 17.5 8 16.25V14",key:"1o80t2"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const wf=ye("FileSearch",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4.268 21a2 2 0 0 0 1.727 1H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"ms7g94"}],["path",{d:"m9 18-1.5-1.5",key:"1j6qii"}],["circle",{cx:"5",cy:"14",r:"3",key:"ufru5t"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ej=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Tj=ye("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ci=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const fi=ye("GitPullRequest",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["line",{x1:"6",x2:"6",y1:"9",y2:"21",key:"rroup"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const ls=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Aj=ye("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Dj=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Mj=ye("Laptop",[["path",{d:"M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16",key:"tarvll"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Zp=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const zj=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Rj=ye("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Jp=ye("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ry=ye("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Oj=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Lj=ye("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const $j=ye("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Bj=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Uj=ye("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const _r=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Hj=ye("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const qj=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Fj=ye("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Oy=ye("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Wp=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ij=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const ds=ye("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Bi=ye("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Wv=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const e1=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ba=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const up=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const t1=ye("Route",[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Yj=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const dp=ye("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Gj=ye("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const n1=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const ss=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Vj=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const a1=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Kj=ye("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Pj=ye("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Xj=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const em=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ly=ye("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const tm=ye("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const r1=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Qj=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const l1=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const nm=ye("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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ha=ye("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Zj=ye("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"}]]),am="zeroclaw_token";function is(){try{return localStorage.getItem(am)}catch{return null}}function s1(e){try{localStorage.setItem(am,e)}catch{}}function i1(){try{localStorage.removeItem(am)}catch{}}function jf(){const e=is();return e!==null&&e.length>0}const Jj="/sgrobot-digital/".replace(/\/+$/,""),Pc=(()=>{if(Vn())return"";const e=(window.__SGROBOT_BASE__??"").replace(/\/+$/,"");return e||Jj||""})(),rl=(()=>{if(Vn())return"";const e=(window.__SGROBOT_BASE__??"").replace(/\/+$/,"");return e||""})(),wr=()=>Vn()?dj():"",Wj=9e3,o1=2e4;class eS extends Error{constructor(){super("Unauthorized"),this.name="UnauthorizedError"}}async function Je(e,a={}){const{timeoutMs:r=Wj,...i}=a,c=is(),d=new Headers(i.headers),u=new AbortController;let m=!1;const p=window.setTimeout(()=>{m=!0,u.abort()},r),h=i.signal,y=()=>u.abort();h&&(h.aborted?u.abort():h.addEventListener("abort",y,{once:!0})),c&&d.set("Authorization",`Bearer ${c}`),i.body&&typeof i.body=="string"&&!d.has("Content-Type")&&d.set("Content-Type","application/json");let x;try{x=await fetch(`${wr()}${rl}${e}`,{...i,headers:d,signal:u.signal})}catch(v){throw v instanceof DOMException&&v.name==="AbortError"&&m?new Error(`API request timed out after ${r/1e3}s: ${e}`):v}finally{window.clearTimeout(p),h==null||h.removeEventListener("abort",y)}if(x.status===401)throw i1(),window.dispatchEvent(new Event("zeroclaw-unauthorized")),new eS;if(!x.ok){const v=await x.text().catch(()=>"");let k=v||x.statusText;if(v)try{const w=JSON.parse(v);typeof w.message=="string"&&w.message.trim()?k=w.message.trim():typeof w.error=="string"&&w.error.trim()&&(k=w.error.trim())}catch{k=v}throw new Error(`API ${x.status}: ${k}`)}if(x.status!==204)return x.json()}function Xc(e,a){if(e!==null&&typeof e=="object"&&!Array.isArray(e)&&a in e){const r=e[a];if(r!==void 0)return r}return e}async function tS(e){const a=await fetch(`${wr()}${rl}/pair`,{method:"POST",headers:{"X-Pairing-Code":e}});if(!a.ok){const i=await a.text().catch(()=>"");throw new Error(`Pairing failed (${a.status}): ${i||a.statusText}`)}const r=await a.json();return s1(r.token),r}async function nS(){const e=await fetch(`${wr()}${rl}/admin/paircode`);if(!e.ok)throw new Error(`Failed to fetch pairing code (${e.status})`);return e.json()}async function aS(){const e=await fetch(`${wr()}${rl}/health`);if(!e.ok)throw new Error(`Health check failed (${e.status})`);return e.json()}function rS(){return Je("/api/status")}function c1(){return Je("/api/config").then(e=>typeof e=="string"?e:e.content)}function lS(e,a="application/json"){return Je("/api/config",{method:"PUT",headers:{"Content-Type":a},body:e})}function Ei(){return Je("/api/scheduler/jobs").then(e=>Xc(e,"jobs"))}function sS(e){return Je(`/api/cron/${encodeURIComponent(e)}`,{method:"DELETE"})}function iS(e,a){return Je(`/api/cron/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(a)}).then(r=>typeof r.job=="object"?r.job:r)}function oS(e,a=20){const r=new URLSearchParams({limit:String(a)});return Je(`/api/cron/${encodeURIComponent(e)}/runs?${r}`).then(i=>Xc(i,"runs"))}function cS(){return Je("/api/cron/settings")}function uS(e){return Je("/api/cron/settings",{method:"PATCH",body:JSON.stringify(e)})}function dS(){return Je("/api/cost").then(e=>Xc(e,"cost"))}function rm(){return Je("/api/sessions").then(e=>e.sessions??[])}function fS(){return Je("/api/channels").then(e=>Xc(e,"channels"))}function pS(e,a){return Je("/api/browser/launch",{method:"POST",body:JSON.stringify({url:e||"",superrpa_path:""})})}function mS(){return Je("/api/browser/status")}function hS(e){return Je(`/api/browser/session/${encodeURIComponent(e)}/close`,{method:"POST"})}function gS(){return Je("/api/debug/plans")}function u1(e){return Je(`/api/sessions/${encodeURIComponent(e)}/messages`).then(a=>({messages:a.messages||[]}))}function Ti(e){return Je(`/api/plan/${encodeURIComponent(e)}/messages`).then(a=>({messages:a.messages||[]}))}function xS(){return Je("/api/route-decisions")}function yS(e){return Je("/api/ingress/route",{method:"POST",body:JSON.stringify(e)})}function ma(e){return Je("/api/governance/command",{method:"POST",body:JSON.stringify(e)})}function d1(){const e=Date.now();return ma({command_kind:"run_schedule_now",context_refs:{schedule_id:"scheduler-manual-check"},payload:{source:"scheduler-jobs-page"},correlation_id:`ui-run-schedule-now-${e}`,idempotency_key:`ui-run-schedule-now-${e}`})}function $y(e){return Je(`/api/plan/${encodeURIComponent(e)}/revisions`)}function bS(e="unread"){return Je(`/api/notifications?status=${encodeURIComponent(e)}`).then(a=>a.notifications??[])}function By(e){return Je(`/api/notifications/${encodeURIComponent(e)}/read`,{method:"POST"}).then(a=>a.ok??!1)}function Uy(e){return Je(`/api/notifications/${encodeURIComponent(e)}/dismiss`,{method:"POST"}).then(a=>a.ok??!1)}function lm(){return Je("/api/debug/store?limit=200")}function fp(e){const a=e?`?date=${encodeURIComponent(e)}`:"";return Je(`/api/digital-employee/workday${a}`,{timeoutMs:o1})}function Zl(e){return Je("/api/digital-employee/workday/actions",{method:"POST",body:JSON.stringify(e)})}function f1(e){return`${wr()}${rl}/api/digital-employee/reports/${encodeURIComponent(e)}/pdf`}function vS(e){return Je(`/api/debug/plan/${encodeURIComponent(e)}/dispatch`,{method:"POST",timeoutMs:o1})}function pp(){return Je("/api/debug/plans?limit=80").then(e=>e.plans??[])}function Hy(e,a=50){const r=new URLSearchParams({limit:String(a),q:e});return Je(`/api/debug/plans?${r}`).then(i=>i.plans??[])}function p1(){return Je("/api/debug/tasks?limit=80").then(e=>({tasks:e.tasks??[],runs:e.runs??[],total:e.total,truncated:e.truncated}))}function m1(e){const a=new URLSearchParams({limit:"50",plan_id:e});return Je(`/api/debug/tasks?${a}`).then(r=>({tasks:r.tasks??[],runs:r.runs??[],total:r.total,truncated:r.truncated}))}function zc(e){return Je(`/api/debug/plan/${encodeURIComponent(e)}/flow`)}function kS(e){return Je(`/api/debug/task/${encodeURIComponent(e)}/flow`)}function sm(){return Je("/api/skill").then(e=>e.skills??[])}function _S(e,a){return Je(`/api/skill/${encodeURIComponent(e)}/enabled`,{method:"POST",body:JSON.stringify({enabled:a})})}const qy={zh:{"nav.dashboard":"仪表盘","nav.plans":"计划","nav.execution":"执行","nav.governance":"治理","nav.scheduler":"调度器","nav.skills":"技能","nav.agent":"智能体","nav.tools":"工具","nav.cron":"Cron 任务","nav.integrations":"集成","nav.memory":"记忆","nav.config":"配置","nav.cost":"成本追踪","nav.logs":"日志","nav.devtools":"工具","nav.swimlane":"泳道","nav.doctor":"诊断","nav.canvas":"画布","planb.nav.chat":"对话","planb.nav.browser":"AI浏览器","planb.nav.monitor":"运行监测","planb.nav.dashboard":"仪表盘","planb.nav.settings":"设置","planb.nav.more":"更多工具","planb.layout.switch_to_wide":"切换到宽屏模式","planb.layout.switch_to_compact":"切换到紧凑模式","planb.layout.pop_out":"弹出独立窗口","planb.browser.title":"AI浏览器","planb.browser.subtitle":"启动 SuperRPA 浏览器自动化","planb.browser.launch":"启动浏览器","planb.browser.url_placeholder":"https://example.com","planb.browser.active_sessions":"活跃会话","planb.browser.no_sessions":"没有活跃的浏览器会话,在上方输入 URL 启动。","planb.browser.status_launching":"启动中","planb.browser.status_running":"运行中","planb.browser.status_idle":"空闲","planb.browser.status_error":"错误","planb.browser.status_stopped":"已停止","planb.browser.launch_error":"启动浏览器失败","planb.browser.close_error":"关闭会话失败","planb.browser.backend_not_configured":"SuperRPA 未配置,请设置 SGCLAW_SUPERRPA_PATH 环境变量。","planb.chat.welcome":"今天我能帮你什么?","planb.chat.placeholder":"问点什么...","planb.chat.sessions":"对话历史","planb.chat.new_chat":"新对话","planb.chat.no_sessions":"暂无对话历史","planb.chat.untitled":"未命名对话","planb.chat.thought":"思考","planb.chat.chip_browse":"浏览网页","planb.chat.chip_code":"写代码","planb.chat.chip_analyze":"分析数据","planb.chat.chip_plan":"帮我规划","planb.chat.regenerate":"重新生成","planb.settings.quick":"快速设置","planb.settings.advanced":"高级配置","planb.settings.quick_hint":"快速设置功能即将推出。现在请使用高级配置编辑器修改 TOML 配置。","planb.settings.open_advanced":"打开高级配置","dashboard.title":"仪表盘","dashboard.provider":"提供商","dashboard.model":"模型","dashboard.uptime":"运行时间","dashboard.temperature":"温度","dashboard.gateway_port":"网关端口","dashboard.memory_backend":"记忆后端","dashboard.paired":"已配对","dashboard.channels":"频道","dashboard.health":"健康状态","dashboard.status":"状态","dashboard.overview":"概览","dashboard.system_info":"系统信息","dashboard.quick_actions":"快速操作","agent.title":"智能体对话","agent.send":"发送","agent.placeholder":"输入消息...","agent.start_conversation":"发送消息开始对话","agent.type_message":"输入消息...","agent.connecting":"连接中...","agent.connected":"已连接","agent.disconnected":"已断开","agent.reconnecting":"重新连接中...","agent.thinking":"思考中...","agent.tool_call":"工具调用","agent.tool_result":"工具结果","agent.connection_error":"连接错误,正在尝试重连...","agent.tool_call_prefix":"[工具调用]","agent.tool_result_prefix":"[工具结果]","agent.error_prefix":"[错误]","agent.unknown_error":"未知错误","agent.send_error":"发送消息失败,请重试。","agent.copy_message":"复制消息","agent.connected_status":"已连接","agent.disconnected_status":"已断开","tools.title":"可用工具","tools.name":"名称","tools.description":"描述","tools.parameters":"参数","tools.search":"搜索工具...","tools.empty":"暂无可用工具。","tools.count":"工具总数","tools.agent_tools":"智能体工具箱","tools.cli_tools":"CLI 工具箱","tools.parameter_schema":"参数结构","tools.path":"路径","tools.version":"版本","tools.category":"类别","tools.load_error":"加载工具失败","cron.title":"定时任务","cron.scheduled_tasks":"定时任务","cron.add":"添加任务","cron.add_job":"添加任务","cron.add_modal_title":"添加 Cron 任务","cron.delete":"删除","cron.enable":"启用","cron.disable":"禁用","cron.name":"名称","cron.name_optional":"名称(可选)","cron.command":"命令","cron.command_required":"命令","cron.schedule":"计划","cron.schedule_required":"计划","cron.next_run":"下次执行","cron.last_run":"上次执行","cron.last_status":"上次状态","cron.enabled":"已启用","cron.enabled_status":"启用","cron.disabled_status":"禁用","cron.empty":"暂无定时任务。","cron.confirm_delete":"确定要删除此任务吗?","cron.load_error":"加载定时任务失败","cron.validation_error":"计划和命令是必需的。","cron.add_error":"添加任务失败","cron.delete_error":"删除任务失败","cron.cancel":"取消","cron.adding":"添加中...","cron.id":"ID","cron.actions":"操作","cron.loading_run_history":"加载运行历史...","cron.load_run_history_error":"加载运行历史失败","cron.no_runs":"暂无运行记录。","cron.recent_runs":"最近运行","cron.yes":"是","cron.no":"否","cron.edit":"编辑","cron.edit_modal_title":"编辑 Cron 任务","cron.edit_error":"更新任务失败","cron.saving":"保存中...","cron.save":"保存","integrations.title":"集成","integrations.available":"可用","integrations.active":"活跃","integrations.coming_soon":"即将推出","integrations.category":"类别","integrations.status":"状态","integrations.search":"搜索集成...","integrations.empty":"未找到集成。","integrations.activate":"激活","integrations.deactivate":"停用","integrations.load_error":"加载集成失败","integrations.status_active":"活跃","integrations.status_available":"可用","integrations.status_coming_soon":"即将推出","memory.title":"记忆存储","memory.memory_title":"记忆","memory.search":"搜索记忆...","memory.search_placeholder":"搜索记忆条目...","memory.add":"存储记忆","memory.add_memory":"添加记忆","memory.add_modal_title":"添加记忆","memory.delete":"删除","memory.key":"键","memory.key_required":"键","memory.content":"内容","memory.content_required":"内容","memory.category":"类别","memory.category_optional":"类别(可选)","memory.timestamp":"时间戳","memory.session":"会话","memory.score":"分数","memory.empty":"未找到记忆条目。","memory.confirm_delete":"确定要删除此记忆条目吗?","memory.all_categories":"所有类别","memory.search_button":"搜索","memory.load_error":"加载记忆失败","memory.saving":"保存中...","memory.validation_error":"键和内容是必需的。","memory.store_error":"保存记忆失败","memory.delete_error":"删除记忆失败","memory.delete_confirm":"删除?","memory.yes":"是","memory.no":"否","memory.cancel":"取消","config.title":"配置","config.save":"保存","config.saving":"保存中...","config.reset":"重置","config.saved":"配置保存成功。","config.error":"配置保存失败。","config.loading":"加载配置中...","config.editor_placeholder":"TOML 配置...","config.configuration_title":"配置","config.sensitive_title":"敏感字段已隐藏","config.sensitive_hint":"API 密钥、令牌和密码已隐藏以保护安全。要更新已隐藏的字段,请将整个隐藏值替换为您的新值。","config.save_success":"配置保存成功。","config.save_error":"保存配置失败","config.toml_label":"TOML 配置","config.lines":"行","cost.title":"成本追踪","cost.session":"会话成本","cost.daily":"每日成本","cost.monthly":"每月成本","cost.total_tokens":"总 Tokens","cost.request_count":"请求数","cost.by_model":"按模型统计","cost.model":"模型","cost.tokens":"Token","cost.requests":"请求","cost.usd":"成本(美元)","cost.load_error":"加载成本数据失败","cost.session_cost":"会话成本","cost.daily_cost":"每日成本","cost.monthly_cost":"每月成本","cost.total_requests":"总请求数","cost.token_statistics":"Token 统计","cost.avg_tokens_per_request":"平均 Token / 请求","cost.cost_per_1k_tokens":"每 1K Token 成本","cost.model_breakdown":"模型细分","cost.no_model_data":"没有模型数据可用。","cost.cost":"成本","cost.share":"占比","logs.title":"实时日志","logs.live_logs":"实时日志","logs.clear":"清除","logs.pause":"暂停","logs.resume":"继续","logs.filter":"筛选日志...","logs.filter_label":"筛选","logs.empty":"暂无日志条目。","logs.connected":"已连接","logs.disconnected":"已断开","logs.events":"事件","logs.jump_to_bottom":"跳转到底部","logs.paused_hint":"日志流已暂停。","logs.waiting_hint":"等待事件...","doctor.title":"系统诊断","doctor.diagnostics_title":"系统诊断","doctor.run":"运行诊断","doctor.run_diagnostics":"运行诊断","doctor.running":"正在运行诊断...","doctor.running_btn":"运行中...","doctor.running_desc":"正在运行诊断...","doctor.running_hint":"这可能需要几秒钟。","doctor.ok":"正常","doctor.warn":"警告","doctor.error":"错误","doctor.severity":"严重程度","doctor.category":"类别","doctor.message":"消息","doctor.empty":"尚未运行诊断。","doctor.summary":"诊断摘要","doctor.issues_found":"发现问题","doctor.warnings_summary":"警告","doctor.all_clear":"一切正常","doctor.system_diagnostics":"系统诊断","doctor.empty_hint":'点击"运行诊断"检查您的 ZeroClaw 安装。',"auth.pair":"配对设备","auth.pairing_code":"配对码","auth.pair_button":"配对","auth.logout":"退出","auth.pairing_success":"配对成功!","auth.pairing_failed":"配对失败,请重试。","auth.enter_code":"请输入配对码以连接到智能体。","common.loading":"加载中...","common.error":"发生错误。","common.retry":"重试","common.cancel":"取消","common.confirm":"确认","common.save":"保存","common.delete":"删除","common.edit":"编辑","common.close":"关闭","common.yes":"是","common.no":"否","common.search":"搜索...","common.no_data":"暂无数据。","common.refresh":"刷新","common.back":"返回","common.actions":"操作","common.name":"名称","common.description":"描述","common.status":"状态","common.created":"创建时间","common.updated":"更新时间","health.title":"系统健康","health.component":"组件","health.status":"状态","health.last_ok":"上次正常","health.last_error":"上次错误","health.restart_count":"重启次数","health.pid":"进程 ID","health.uptime":"运行时间","health.updated_at":"最后更新","dashboard.provider_model":"提供商 / 模型","dashboard.since_last_restart":"自上次重启","dashboard.paired_yes":"是","dashboard.paired_no":"否","dashboard.cost_overview":"成本概览","dashboard.active_channels":"活跃频道","dashboard.filter_active":"活跃","dashboard.filter_all":"全部","dashboard.no_active_channels":"没有活跃频道","dashboard.component_health":"组件健康","dashboard.load_error":"加载仪表盘失败","dashboard.session_label":"会话","dashboard.daily_label":"每日","dashboard.monthly_label":"每月","dashboard.total_tokens_label":"总 Tokens","dashboard.requests_label":"请求","dashboard.no_channels":"未配置频道","dashboard.active":"活跃","dashboard.inactive":"非活跃","dashboard.no_components":"没有组件报告","dashboard.restarts":"重启次数","dashboard.tab_overview":"概览","dashboard.tab_sessions":"会话","dashboard.tab_channels":"频道","dashboard.sessions_title":"活跃会话","dashboard.no_sessions":"没有活跃会话","dashboard.session_id":"会话 ID","dashboard.session_channel":"频道","dashboard.session_started":"开始时间","dashboard.session_last_activity":"最近活动","dashboard.session_status":"状态","dashboard.session_messages":"消息数","dashboard.session_details":"会话详情","dashboard.session_history":"查看历史","dashboard.channels_title":"频道状态","dashboard.no_channels_detail":"没有频道详情","dashboard.channel_type":"类型","dashboard.channel_messages":"消息数","dashboard.channel_last_message":"最近消息","dashboard.channel_config":"配置摘要","dashboard.channel_enabled":"已启用","dashboard.channel_disabled":"已禁用","dashboard.loading_sessions":"加载会话中...","dashboard.loading_channels":"加载频道中...","dashboard.load_sessions_error":"加载会话失败","dashboard.load_channels_error":"加载频道失败","dashboard.never":"从未","settings.title":"设置","settings.tab.appearance":"外观","settings.tab.typography":"排版","settings.appearance":"外观设置","settings.typography":"字体设置","settings.fontUi":"界面字体","settings.fontMono":"代码字体","settings.fontSize":"界面字号","settings.fontMonoSize":"代码字号","settings.preview":"预览","settings.previewText":"界面字体预览文本","settings.fontNote":"字体设置需要刷新页面后生效","settings.language":"界面语言","theme.mode":"主题模式","theme.accent":"强调色","theme.system":"跟随系统","theme.dark":"深色","theme.light":"浅色","theme.oled":"纯黑","console.nav.commandDeck":"指挥舱","console.nav.missionCenter":"任务中心","console.nav.skillLibrary":"技能库","console.nav.dailyReport":"日报","console.nav.settings":"设置","console.role.finance":"财务","console.role.engineering":"工程","console.role.executive":"管理","console.role.hr":"人事","console.role.sales":"销售","console.state.loading":"加载中...","console.state.empty":"暂无数据","console.state.backendDown":"后端服务不可达","console.state.partialData":"部分数据源加载失败","console.state.stale":"数据已过期","console.state.unauthorized":"未授权","console.action.refresh":"刷新","console.action.approve":"批准","console.action.reject":"驳回","console.action.retry":"重试","console.action.create":"新建任务","console.skill.capabilityLevel":"能力等级","console.skill.enable":"启用","console.skill.disable":"停用","console.skill.core":"核心","console.skill.standard":"标准","console.skill.specialized":"专业","console.skill.experimental":"实验","console.report.dailyTitle":"日报","console.report.sourceLinks":"数据来源","console.report.noEvents":"当日无执行记录"},en:{"nav.dashboard":"Dashboard","nav.plans":"Plans","nav.execution":"Execution","nav.governance":"Governance","nav.scheduler":"Scheduler","nav.skills":"Skills","nav.agent":"Agent","nav.tools":"Tools","nav.cron":"Cron Jobs","nav.integrations":"Integrations","nav.memory":"Memory","nav.config":"Configuration","nav.cost":"Cost Tracker","nav.logs":"Logs","nav.devtools":"Tools","nav.swimlane":"Swimlane","nav.doctor":"Doctor","nav.canvas":"Canvas","planb.nav.chat":"Chat","planb.nav.browser":"AI Browser","planb.nav.dashboard":"Dashboard","planb.nav.settings":"Settings","planb.nav.more":"More Tools","planb.layout.switch_to_wide":"Switch to Desktop","planb.layout.switch_to_compact":"Switch to Compact","planb.layout.pop_out":"Pop Out Window","planb.browser.title":"AI Browser","planb.browser.subtitle":"Launch SuperRPA browser automation","planb.browser.launch":"Launch Browser","planb.browser.url_placeholder":"https://example.com","planb.browser.active_sessions":"Active Sessions","planb.browser.no_sessions":"No active browser sessions. Launch one above.","planb.browser.status_launching":"Launching","planb.browser.status_running":"Running","planb.browser.status_idle":"Idle","planb.browser.status_error":"Error","planb.browser.status_stopped":"Stopped","planb.browser.launch_error":"Failed to launch browser","planb.browser.close_error":"Failed to close session","planb.browser.backend_not_configured":"SuperRPA is not configured. Set SGCLAW_SUPERRPA_PATH environment variable.","planb.chat.welcome":"How can I help you today?","planb.chat.placeholder":"Ask anything...","planb.chat.sessions":"Chat History","planb.chat.new_chat":"New Chat","planb.chat.no_sessions":"No chat history","planb.chat.untitled":"Untitled","planb.chat.thought":"Thought","planb.chat.chip_browse":"Browse Web","planb.chat.chip_code":"Write Code","planb.chat.chip_analyze":"Analyze Data","planb.chat.chip_plan":"Plan Project","planb.chat.regenerate":"Regenerate","planb.settings.quick":"Quick Settings","planb.settings.advanced":"Advanced","planb.settings.quick_hint":"Quick settings are coming soon. Use the advanced editor to modify TOML configuration for now.","planb.settings.open_advanced":"Open Advanced Editor","dashboard.title":"Dashboard","dashboard.provider":"Provider","dashboard.model":"Model","dashboard.uptime":"Uptime","dashboard.temperature":"Temperature","dashboard.gateway_port":"Gateway Port","dashboard.memory_backend":"Memory Backend","dashboard.paired":"Paired","dashboard.channels":"Channels","dashboard.health":"Health","dashboard.status":"Status","dashboard.overview":"Overview","dashboard.system_info":"System Information","dashboard.quick_actions":"Quick Actions","agent.title":"Agent Chat","agent.send":"Send","agent.placeholder":"Type a message...","agent.start_conversation":"Send a message to start the conversation","agent.type_message":"Type a message...","agent.connecting":"Connecting...","agent.connected":"Connected","agent.disconnected":"Disconnected","agent.reconnecting":"Reconnecting...","agent.thinking":"Thinking...","agent.tool_call":"Tool Call","agent.tool_result":"Tool Result","agent.connection_error":"Connection error. Attempting to reconnect...","agent.tool_call_prefix":"[Tool Call]","agent.tool_result_prefix":"[Tool Result]","agent.error_prefix":"[Error]","agent.unknown_error":"Unknown error","agent.send_error":"Failed to send message. Please try again.","agent.copy_message":"Copy message","agent.connected_status":"Connected","agent.disconnected_status":"Disconnected","tools.title":"Available Tools","tools.name":"Name","tools.description":"Description","tools.parameters":"Parameters","tools.search":"Search tools...","tools.empty":"No tools available.","tools.count":"Total tools","tools.agent_tools":"Agent Tools","tools.cli_tools":"CLI Tools","tools.parameter_schema":"Parameter Schema","tools.path":"Path","tools.version":"Version","tools.category":"Category","tools.load_error":"Failed to load tools","cron.title":"Scheduled Jobs","cron.scheduled_tasks":"Scheduled Tasks","cron.add":"Add Job","cron.add_job":"Add Job","cron.add_modal_title":"Add Cron Job","cron.delete":"Delete","cron.enable":"Enable","cron.disable":"Disable","cron.name":"Name","cron.name_optional":"Name (optional)","cron.command":"Command","cron.command_required":"Command","cron.schedule":"Schedule","cron.schedule_required":"Schedule","cron.next_run":"Next Run","cron.last_run":"Last Run","cron.last_status":"Last Status","cron.enabled":"Enabled","cron.enabled_status":"Enabled","cron.disabled_status":"Disabled","cron.empty":"No scheduled jobs.","cron.confirm_delete":"Are you sure you want to delete this job?","cron.load_error":"Failed to load cron jobs","cron.validation_error":"Schedule and command are required.","cron.add_error":"Failed to add job","cron.delete_error":"Failed to delete job","cron.cancel":"Cancel","cron.adding":"Adding...","cron.id":"ID","cron.actions":"Actions","cron.loading_run_history":"Loading run history...","cron.load_run_history_error":"Failed to load run history","cron.no_runs":"No runs recorded yet.","cron.recent_runs":"Recent Runs","cron.yes":"Yes","cron.no":"No","cron.edit":"Edit","cron.edit_modal_title":"Edit Cron Job","cron.edit_error":"Failed to update job","cron.saving":"Saving...","cron.save":"Save","integrations.title":"Integrations","integrations.available":"Available","integrations.active":"Active","integrations.coming_soon":"Coming Soon","integrations.category":"Category","integrations.status":"Status","integrations.search":"Search integrations...","integrations.empty":"No integrations found.","integrations.activate":"Activate","integrations.deactivate":"Deactivate","integrations.load_error":"Failed to load integrations","integrations.status_active":"Active","integrations.status_available":"Available","integrations.status_coming_soon":"Coming Soon","memory.title":"Memory Store","memory.memory_title":"Memory","memory.search":"Search memory...","memory.search_placeholder":"Search memory entries...","memory.add":"Store Memory","memory.add_memory":"Add Memory","memory.add_modal_title":"Add Memory","memory.delete":"Delete","memory.key":"Key","memory.key_required":"Key","memory.content":"Content","memory.content_required":"Content","memory.category":"Category","memory.category_optional":"Category (optional)","memory.timestamp":"Timestamp","memory.session":"Session","memory.score":"Score","memory.empty":"No memory entries found.","memory.confirm_delete":"Are you sure you want to delete this memory entry?","memory.all_categories":"All Categories","memory.search_button":"Search","memory.load_error":"Failed to load memory","memory.saving":"Saving...","memory.validation_error":"Key and content are required.","memory.store_error":"Failed to store memory","memory.delete_error":"Failed to delete memory","memory.delete_confirm":"Delete?","memory.yes":"Yes","memory.no":"No","memory.cancel":"Cancel","config.title":"Configuration","config.save":"Save","config.saving":"Saving...","config.reset":"Reset","config.saved":"Configuration saved successfully.","config.error":"Failed to save configuration.","config.loading":"Loading configuration...","config.editor_placeholder":"TOML configuration...","config.configuration_title":"Configuration","config.sensitive_title":"Sensitive fields are masked","config.sensitive_hint":"API keys, tokens, and passwords are hidden for security. To update a masked field, replace the entire masked value with your new value.","config.save_success":"Configuration saved successfully.","config.save_error":"Failed to save configuration","config.toml_label":"TOML Configuration","config.lines":"lines","cost.title":"Cost Tracker","cost.session":"Session Cost","cost.daily":"Daily Cost","cost.monthly":"Monthly Cost","cost.total_tokens":"Total Tokens","cost.request_count":"Requests","cost.by_model":"Cost by Model","cost.model":"Model","cost.tokens":"Tokens","cost.requests":"Requests","cost.usd":"Cost (USD)","cost.load_error":"Failed to load cost data","cost.session_cost":"Session Cost","cost.daily_cost":"Daily Cost","cost.monthly_cost":"Monthly Cost","cost.total_requests":"Total Requests","cost.token_statistics":"Token Statistics","cost.avg_tokens_per_request":"Avg Tokens / Request","cost.cost_per_1k_tokens":"Cost per 1K Tokens","cost.model_breakdown":"Model Breakdown","cost.no_model_data":"No model data available.","cost.cost":"Cost","cost.share":"Share","logs.title":"Live Logs","logs.live_logs":"Live Logs","logs.clear":"Clear","logs.pause":"Pause","logs.resume":"Resume","logs.filter":"Filter logs...","logs.filter_label":"Filter","logs.empty":"No log entries.","logs.connected":"Connected","logs.disconnected":"Disconnected","logs.events":"events","logs.jump_to_bottom":"Jump to bottom","logs.paused_hint":"Log streaming is paused.","logs.waiting_hint":"Waiting for events...","doctor.title":"System Diagnostics","doctor.diagnostics_title":"Diagnostics","doctor.run":"Run Diagnostics","doctor.run_diagnostics":"Run Diagnostics","doctor.running":"Running diagnostics...","doctor.running_btn":"Running...","doctor.running_desc":"Running diagnostics...","doctor.running_hint":"This may take a few seconds.","doctor.ok":"OK","doctor.warn":"Warning","doctor.error":"Error","doctor.severity":"Severity","doctor.category":"Category","doctor.message":"Message","doctor.empty":"No diagnostics have been run yet.","doctor.summary":"Diagnostic Summary","doctor.issues_found":"Issues Found","doctor.warnings_summary":"Warnings","doctor.all_clear":"All Clear","doctor.system_diagnostics":"System Diagnostics","doctor.empty_hint":'Click "Run Diagnostics" to check your ZeroClaw installation.',"auth.pair":"Pair Device","auth.pairing_code":"Pairing Code","auth.pair_button":"Pair","auth.logout":"Logout","auth.pairing_success":"Pairing successful!","auth.pairing_failed":"Pairing failed. Please try again.","auth.enter_code":"Enter your pairing code to connect to the agent.","common.loading":"Loading...","common.error":"An error occurred.","common.retry":"Retry","common.cancel":"Cancel","common.confirm":"Confirm","common.save":"Save","common.delete":"Delete","common.edit":"Edit","common.close":"Close","common.yes":"Yes","common.no":"No","common.search":"Search...","common.no_data":"No data available.","common.refresh":"Refresh","common.back":"Back","common.actions":"Actions","common.name":"Name","common.description":"Description","common.status":"Status","common.created":"Created","common.updated":"Updated","health.title":"System Health","health.component":"Component","health.status":"Status","health.last_ok":"Last OK","health.last_error":"Last Error","health.restart_count":"Restarts","health.pid":"Process ID","health.uptime":"Uptime","health.updated_at":"Last Updated","dashboard.provider_model":"Provider / Model","dashboard.since_last_restart":"Since last restart","dashboard.paired_yes":"Yes","dashboard.paired_no":"No","dashboard.cost_overview":"Cost Overview","dashboard.active_channels":"Active Channels","dashboard.filter_active":"Active","dashboard.filter_all":"All","dashboard.no_active_channels":"No active channels","dashboard.component_health":"Component Health","dashboard.load_error":"Failed to load dashboard","dashboard.session_label":"Session","dashboard.daily_label":"Daily","dashboard.monthly_label":"Monthly","dashboard.total_tokens_label":"Total Tokens","dashboard.requests_label":"Requests","dashboard.no_channels":"No channels configured","dashboard.active":"Active","dashboard.inactive":"Inactive","dashboard.no_components":"No components reporting","dashboard.restarts":"Restarts","dashboard.tab_overview":"Overview","dashboard.tab_sessions":"Sessions","dashboard.tab_channels":"Channels","dashboard.sessions_title":"Active Sessions","dashboard.no_sessions":"No active sessions","dashboard.session_id":"Session ID","dashboard.session_channel":"Channel","dashboard.session_started":"Started","dashboard.session_last_activity":"Last Activity","dashboard.session_status":"Status","dashboard.session_messages":"Messages","dashboard.session_details":"Session Details","dashboard.session_history":"View History","dashboard.channels_title":"Channel Status","dashboard.no_channels_detail":"No channel details available","dashboard.channel_type":"Type","dashboard.channel_messages":"Messages","dashboard.channel_last_message":"Last Message","dashboard.channel_config":"Configuration","dashboard.channel_enabled":"Enabled","dashboard.channel_disabled":"Disabled","dashboard.loading_sessions":"Loading sessions...","dashboard.loading_channels":"Loading channels...","dashboard.load_sessions_error":"Failed to load sessions","dashboard.load_channels_error":"Failed to load channels","dashboard.never":"Never","settings.title":"Settings","settings.tab.appearance":"Appearance","settings.tab.typography":"Typography","settings.appearance":"Appearance","settings.typography":"Typography","settings.fontUi":"UI Font","settings.fontMono":"Code Font","settings.fontSize":"UI Font Size","settings.fontMonoSize":"Code Font Size","settings.preview":"Preview","settings.previewText":"The quick brown fox jumps over the lazy dog.","settings.fontNote":"Font changes apply on page reload.","settings.language":"Language","theme.mode":"Theme Mode","theme.accent":"Accent Color","theme.system":"System","theme.dark":"Dark","theme.light":"Light","theme.oled":"OLED Black","console.nav.commandDeck":"Command Deck","console.nav.missionCenter":"Mission Center","console.nav.skillLibrary":"Skill Library","console.nav.dailyReport":"Daily Report","console.nav.settings":"Settings","console.role.finance":"Finance","console.role.engineering":"Engineering","console.role.executive":"Executive","console.role.hr":"HR","console.role.sales":"Sales","console.state.loading":"Loading...","console.state.empty":"No data","console.state.backendDown":"Backend unreachable","console.state.partialData":"Partial data loaded","console.state.stale":"Data stale","console.state.unauthorized":"Unauthorized","console.action.refresh":"Refresh","console.action.approve":"Approve","console.action.reject":"Reject","console.action.retry":"Retry","console.action.create":"Create","console.skill.capabilityLevel":"Capability Level","console.skill.enable":"Enable","console.skill.disable":"Disable","console.skill.core":"Core","console.skill.standard":"Standard","console.skill.specialized":"Specialized","console.skill.experimental":"Experimental","console.report.dailyTitle":"Daily Report","console.report.sourceLinks":"Source Links","console.report.noEvents":"No events today"},tr:{"nav.dashboard":"Kontrol Paneli","nav.plans":"Planlar","nav.execution":"Yürütme","nav.governance":"Yönetişim","nav.scheduler":"Zamanlayıcı","nav.skills":"Beceriler","nav.agent":"Ajan","nav.tools":"Araçlar","nav.cron":"Cron Görevleri","nav.integrations":"Entegrasyonlar","nav.memory":"Hafıza","nav.config":"Yapılandırma","nav.cost":"Maliyet Takibi","nav.logs":"Kayıtlar","nav.devtools":"Araçlar","nav.swimlane":"Yüzme Şeridi","nav.doctor":"Doktor","nav.canvas":"Tuval","planb.nav.chat":"Sohbet","planb.nav.browser":"AI Tarayıcı","planb.nav.dashboard":"Kontrol Paneli","planb.nav.settings":"Ayarlar","planb.nav.more":"Daha Fazla","planb.layout.switch_to_wide":"Masaüstüne Geç","planb.layout.switch_to_compact":"Kompakta Geç","planb.layout.pop_out":"Pencereyi Ayır","planb.browser.title":"AI Tarayıcı","planb.browser.subtitle":"SuperRPA tarayıcı otomasyonunu başlat","planb.browser.launch":"Tarayıcıyı Başlat","planb.browser.url_placeholder":"https://example.com","planb.browser.active_sessions":"Aktif Oturumlar","planb.browser.no_sessions":"Aktif tarayıcı oturumu yok.","planb.browser.status_launching":"Başlatılıyor","planb.browser.status_running":"Çalışıyor","planb.browser.status_idle":"Boşta","planb.browser.status_error":"Hata","planb.browser.status_stopped":"Durduruldu","planb.browser.launch_error":"Tarayıcı başlatılamadı","planb.browser.close_error":"Oturum kapatılamadı","planb.browser.backend_not_configured":"SuperRPA yapılandırılmamış.","planb.chat.welcome":"Bugün size nasıl yardımcı olabilirim?","planb.chat.placeholder":"Bir şey sor...","planb.chat.sessions":"Sohbet Geçmişi","planb.chat.new_chat":"Yeni Sohbet","planb.chat.no_sessions":"Sohbet geçmişi yok","planb.chat.untitled":"Başlıksız","planb.chat.thought":"Düşünce","planb.chat.chip_browse":"Webde Gezin","planb.chat.chip_code":"Kod Yaz","planb.chat.chip_analyze":"Veri Analizi","planb.chat.chip_plan":"Proje Planla","planb.chat.regenerate":"Yeniden Oluştur","planb.settings.quick":"Hızlı Ayarlar","planb.settings.advanced":"Gelişmiş","planb.settings.quick_hint":"Hızlı ayarlar yakında gelecek. Şimdilik gelişmiş düzenleyiciyi kullanın.","planb.settings.open_advanced":"Gelişmiş Düzenleyiciyi Aç","dashboard.title":"Kontrol Paneli","dashboard.provider":"Sağlayıcı","dashboard.model":"Model","dashboard.uptime":"Çalışma Süresi","dashboard.temperature":"Sıcaklık","dashboard.gateway_port":"Ağ Geçidi Portu","dashboard.locale":"Dil","dashboard.memory_backend":"Hafıza Motoru","dashboard.paired":"Eşleştirilmiş","dashboard.channels":"Kanallar","dashboard.health":"Sağlık","dashboard.status":"Durum","dashboard.overview":"Genel Bakış","dashboard.system_info":"Sistem Bilgisi","dashboard.quick_actions":"Hızlı İşlemler","dashboard.provider_model":"Sağlayıcı / Model","dashboard.since_last_restart":"Son Yeniden Başlatmadan Beri","dashboard.paired_yes":"Evet","dashboard.paired_no":"Hayır","dashboard.cost_overview":"Maliyet Genel Bakışı","dashboard.active_channels":"Aktif Kanallar","dashboard.filter_active":"Aktif","dashboard.filter_all":"Tümü","dashboard.no_active_channels":"Aktif kanal yok","dashboard.component_health":"Bileşen Sağlığı","dashboard.load_error":"Kontrol paneli yüklenemedi","dashboard.session_label":"Oturum","dashboard.daily_label":"Günlük","dashboard.monthly_label":"Aylık","dashboard.total_tokens_label":"Toplam Token","dashboard.requests_label":"İstekler","dashboard.no_channels":"Kanal yapılandırılmamış","dashboard.active":"Aktif","dashboard.inactive":"Aktif Değil","dashboard.no_components":"Bileşen raporlamıyor","dashboard.restarts":"Yeniden Başlatmalar","dashboard.tab_overview":"Genel Bakış","dashboard.tab_sessions":"Oturumlar","dashboard.tab_channels":"Kanallar","dashboard.sessions_title":"Aktif Oturumlar","dashboard.no_sessions":"Aktif oturum yok","dashboard.session_id":"Oturum Kimliği","dashboard.session_channel":"Kanal","dashboard.session_started":"Başlangıç","dashboard.session_last_activity":"Son Etkinlik","dashboard.session_status":"Durum","dashboard.session_messages":"Mesajlar","dashboard.session_details":"Oturum Ayrıntıları","dashboard.session_history":"Geçmişi Görüntüle","dashboard.channels_title":"Kanal Durumu","dashboard.no_channels_detail":"Kanal ayrıntısı yok","dashboard.channel_type":"Tür","dashboard.channel_messages":"Mesajlar","dashboard.channel_last_message":"Son Mesaj","dashboard.channel_config":"Yapılandırma","dashboard.channel_enabled":"Etkin","dashboard.channel_disabled":"Devre Dışı","dashboard.loading_sessions":"Oturumlar yükleniyor...","dashboard.loading_channels":"Kanallar yükleniyor...","dashboard.load_sessions_error":"Oturumlar yüklenemedi","dashboard.load_channels_error":"Kanallar yüklenemedi","dashboard.never":"Hiç","agent.title":"Ajan Sohbeti","agent.send":"Gönder","agent.placeholder":"Bir mesaj yazın...","agent.start_conversation":"Sohbeti başlatmak için mesaj gönderin","agent.type_message":"Bir mesaj yazın...","agent.connecting":"Bağlanıyor...","agent.connected":"Bağlandı","agent.disconnected":"Bağlantı kesildi","agent.reconnecting":"Yeniden bağlanıyor...","agent.thinking":"Düşünüyor...","agent.tool_call":"Araç Çağrısı","agent.tool_result":"Araç Sonucu","agent.connection_error":"Bağlantı hatası. Yeniden bağlanmaya çalışılıyor...","agent.tool_call_prefix":"[Araç Çağrısı]","agent.tool_result_prefix":"[Araç Sonucu]","agent.error_prefix":"[Hata]","agent.unknown_error":"Bilinmeyen hata","agent.send_error":"Mesaj gönderilemedi. Lütfen tekrar deneyin.","agent.copy_message":"Mesajı kopyala","agent.connected_status":"Bağlandı","agent.disconnected_status":"Bağlantı kesildi","tools.title":"Mevcut Araçlar","tools.name":"Ad","tools.description":"Açıklama","tools.parameters":"Parametreler","tools.search":"Araç ara...","tools.empty":"Araç bulunamadı.","tools.count":"Toplam araç","tools.agent_tools":"Ajan Araçları","tools.cli_tools":"CLI Araçları","tools.parameter_schema":"Parametre Şeması","tools.path":"Yol","tools.version":"Sürüm","tools.category":"Kategori","tools.load_error":"Araçlar yüklenemedi","cron.title":"Zamanlanmış Görevler","cron.scheduled_tasks":"Zamanlanmış Görevler","cron.add":"Görev Ekle","cron.add_job":"Görev Ekle","cron.add_modal_title":"Cron Görevi Ekle","cron.delete":"Sil","cron.enable":"Etkinleştir","cron.disable":"Devre Dışı Bırak","cron.name":"Ad","cron.name_optional":"Ad (isteğe bağlı)","cron.command":"Komut","cron.command_required":"Komut","cron.schedule":"Zamanlama","cron.schedule_required":"Zamanlama","cron.next_run":"Sonraki Çalıştırma","cron.last_run":"Son Çalıştırma","cron.last_status":"Son Durum","cron.enabled":"Etkin","cron.enabled_status":"Etkin","cron.disabled_status":"Devre Dışı","cron.empty":"Zamanlanmış görev bulunamadı.","cron.confirm_delete":"Bu görevi silmek istediğinizden emin misiniz?","cron.load_error":"Cron görevleri yüklenemedi","cron.validation_error":"Zamanlama ve komut gereklidir.","cron.add_error":"Görev eklenemedi","cron.delete_error":"Görev silinemedi","cron.cancel":"İptal","cron.adding":"Ekleniyor...","cron.id":"ID","cron.actions":"İşlemler","cron.loading_run_history":"Çalıştırma geçmişi yükleniyor...","cron.load_run_history_error":"Çalıştırma geçmişi yüklenemedi","cron.no_runs":"Henüz çalıştırma kaydı yok.","cron.recent_runs":"Son Çalıştırmalar","cron.yes":"Evet","cron.no":"Hayır","cron.edit":"Düzenle","cron.edit_modal_title":"Cron Görevini Düzenle","cron.edit_error":"Görev güncellenemedi","cron.saving":"Kaydediliyor...","cron.save":"Kaydet","integrations.title":"Entegrasyonlar","integrations.available":"Mevcut","integrations.active":"Aktif","integrations.coming_soon":"Yakında","integrations.category":"Kategori","integrations.status":"Durum","integrations.search":"Entegrasyon ara...","integrations.empty":"Entegrasyon bulunamadı.","integrations.activate":"Etkinleştir","integrations.deactivate":"Devre Dışı Bırak","integrations.load_error":"Entegrasyonlar yüklenemedi","integrations.all":"Tümü","integrations.status_active":"Aktif","integrations.status_available":"Mevcut","integrations.status_coming_soon":"Yakında","memory.title":"Hafıza Deposu","memory.memory_title":"Hafıza","memory.search":"Hafıza ara...","memory.search_placeholder":"Hafıza girişleri ara...","memory.add":"Hafıza Ekle","memory.add_memory":"Hafıza Ekle","memory.add_modal_title":"Hafıza Ekle","memory.delete":"Sil","memory.key":"Anahtar","memory.key_required":"Anahtar","memory.content":"İçerik","memory.content_required":"İçerik","memory.category":"Kategori","memory.category_optional":"Kategori (isteğe bağlı)","memory.timestamp":"Zaman Damgası","memory.session":"Oturum","memory.score":"Puan","memory.empty":"Hafıza girişi bulunamadı.","memory.confirm_delete":"Bu hafıza girişini silmek istediğinizden emin misiniz?","memory.all_categories":"Tüm Kategoriler","memory.search_button":"Ara","memory.load_error":"Hafıza yüklenemedi","memory.saving":"Kaydediliyor...","memory.validation_error":"Anahtar ve içerik gereklidir.","memory.store_error":"Hafıza kaydedilemedi","memory.delete_error":"Hafıza silinemedi","memory.delete_confirm":"Sil?","memory.yes":"Evet","memory.no":"Hayır","memory.cancel":"İptal","config.title":"Yapılandırma","config.save":"Kaydet","config.saving":"Kaydediliyor...","config.reset":"Sıfırla","config.saved":"Yapılandırma başarıyla kaydedildi.","config.error":"Yapılandırma kaydedilemedi.","config.loading":"Yapılandırma yükleniyor...","config.editor_placeholder":"TOML yapılandırması...","config.configuration_title":"Yapılandırma","config.sensitive_title":"Hassas alanlar gizlendi","config.sensitive_hint":"API anahtarları, belirteçler ve parolalar güvenlik için gizlendi. Maskeli bir alanı güncellemek için, tüm maskeli değeri yeni değerinizle değiştirin.","config.save_success":"Yapılandırma başarıyla kaydedildi.","config.save_error":"Yapılandırma kaydedilemedi","config.toml_label":"TOML Yapılandırması","config.lines":"satır","cost.title":"Maliyet Takibi","cost.session":"Oturum Maliyeti","cost.daily":"Günlük Maliyet","cost.monthly":"Aylık Maliyet","cost.total_tokens":"Toplam Token","cost.request_count":"İstek Sayısı","cost.by_model":"Modele Göre Maliyet","cost.model":"Model","cost.tokens":"Token","cost.requests":"İstekler","cost.usd":"Maliyet (USD)","cost.load_error":"Maliyet verileri yüklenemedi","cost.session_cost":"Oturum Maliyeti","cost.daily_cost":"Günlük Maliyet","cost.monthly_cost":"Aylık Maliyet","cost.total_requests":"Toplam İstek","cost.token_statistics":"Token İstatistikleri","cost.avg_tokens_per_request":"Ortalama Token / İstek","cost.cost_per_1k_tokens":"1K Token Başına Maliyet","cost.model_breakdown":"Model Detayı","cost.no_model_data":"Model verisi mevcut değil.","cost.cost":"Maliyet","cost.share":"Pay","logs.title":"Canlı Kayıtlar","logs.live_logs":"Canlı Kayıtlar","logs.clear":"Temizle","logs.pause":"Duraklat","logs.resume":"Devam Et","logs.filter":"Kayıtları filtrele...","logs.filter_label":"Filtre","logs.empty":"Kayıt girişi bulunamadı.","logs.connected":"Bağlandı","logs.disconnected":"Bağlantı kesildi","logs.events":"olay","logs.jump_to_bottom":"En alta atla","logs.paused_hint":"Kayıt akışı duraklatıldı.","logs.waiting_hint":"Olay bekleniyor...","doctor.title":"Sistem Tanıları","doctor.diagnostics_title":"Tanılar","doctor.run":"Tanı Çalıştır","doctor.run_diagnostics":"Tanı Çalıştır","doctor.running":"Tanı çalıştırılıyor...","doctor.running_btn":"Çalıştırılıyor...","doctor.running_desc":"Tanı çalıştırılıyor...","doctor.running_hint":"Bu birkaç saniye sürebilir.","doctor.ok":"Tamam","doctor.warn":"Uyarı","doctor.error":"Hata","doctor.severity":"Şiddet","doctor.category":"Kategori","doctor.message":"Mesaj","doctor.empty":"Henüz tanı çalıştırılmadı.","doctor.summary":"Tanı Özeti","doctor.issues_found":"Sorunlar Bulundu","doctor.warnings_summary":"Uyarılar","doctor.all_clear":"Her Şey Yolunda","doctor.system_diagnostics":"Sistem Tanıları","doctor.empty_hint":'ZeroClaw kurulumunuzu kontrol etmek için "Tanı Çalıştır" düğmesine tıklayın.',"auth.pair":"Cihaz Eşleştir","auth.pairing_code":"Eşleştirme Kodu","auth.pair_button":"Eşleştir","auth.logout":"Çıkış Yap","auth.pairing_success":"Eşleştirme başarılı!","auth.pairing_failed":"Eşleştirme başarısız. Lütfen tekrar deneyin.","auth.enter_code":"Akıllı birine bağlanmak için eşleştirme kodunuzu girin.","common.loading":"Yükleniyor...","common.error":"Bir hata oluştu.","common.retry":"Tekrar Dene","common.cancel":"İptal","common.confirm":"Onayla","common.save":"Kaydet","common.delete":"Sil","common.edit":"Düzenle","common.close":"Kapat","common.yes":"Evet","common.no":"Hayır","common.search":"Ara...","common.no_data":"Veri mevcut değil.","common.refresh":"Yenile","common.back":"Geri","common.actions":"İşlemler","common.name":"Ad","common.description":"Açıklama","common.status":"Durum","common.created":"Oluşturulma","common.updated":"Güncellenme","health.title":"Sistem Sağlığı","health.component":"Bileşen","health.status":"Durum","health.last_ok":"Son Başarılı","health.last_error":"Son Hata","health.restart_count":"Yeniden Başlatmalar","health.pid":"İşlem Kimliği","health.uptime":"Çalışma Süresi","health.updated_at":"Son Güncelleme","settings.title":"Ayarlar","settings.tab.appearance":"Görünüm","settings.tab.typography":"Tipografi","settings.appearance":"Görünüm","settings.typography":"Tipografi","settings.fontUi":"Arayüz Yazı Tipi","settings.fontMono":"Kod Yazı Tipi","settings.fontSize":"Arayüz Boyutu","settings.fontMonoSize":"Kod Boyutu","settings.preview":"Önizleme","settings.previewText":"Tembel köpek üzerinde hızlı kahverengi tilki zıplar.","settings.fontNote":"Yazı tipi değişiklikleri sayfa yeniden yüklendikten sonra geçerli olur.","settings.language":"Dil","theme.mode":"Tema Modu","theme.accent":"Vurgu Rengi","theme.system":"Sistem","theme.dark":"Koyu","theme.light":"Açık","theme.oled":"OLED Siyah","console.nav.commandDeck":"Command Deck","console.nav.missionCenter":"Mission Center","console.nav.skillLibrary":"Skill Library","console.nav.dailyReport":"Daily Report","console.nav.settings":"Settings","console.role.finance":"Finance","console.role.engineering":"Engineering","console.role.executive":"Executive","console.role.hr":"HR","console.role.sales":"Sales","console.state.loading":"Loading...","console.state.empty":"No data","console.state.backendDown":"Backend unreachable","console.state.partialData":"Partial data loaded","console.state.stale":"Data stale","console.state.unauthorized":"Unauthorized","console.action.refresh":"Refresh","console.action.approve":"Approve","console.action.reject":"Reject","console.action.retry":"Retry","console.action.create":"Create","console.skill.capabilityLevel":"Capability Level","console.skill.enable":"Enable","console.skill.disable":"Disable","console.skill.core":"Core","console.skill.standard":"Standard","console.skill.specialized":"Specialized","console.skill.experimental":"Experimental","console.report.dailyTitle":"Daily Report","console.report.sourceLinks":"Source Links","console.report.noEvents":"No events today"}};let h1="zh";function wS(e){h1=e}function J(e){var a;return((a=qy[h1])==null?void 0:a[e])??qy.en[e]??e}const jS="sgrobot:digital-close";function SS(){return Vn()?"#/digital":`${Pc||""}/digital`}function NS(){const[e,a]=b.useState(null);b.useEffect(()=>{const i=c=>{var d;c.origin===window.location.origin&&((d=c.data)==null?void 0:d.type)===jS&&a(null)};return window.addEventListener("message",i),()=>window.removeEventListener("message",i)},[]);const r=e?l.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-2 animate-fade-in",style:{background:"rgba(0,0,0,0.5)",backdropFilter:"blur(4px)"},onClick:()=>a(null),children:l.jsxs("div",{className:"relative w-[calc(100vw-16px)] max-w-[1760px] h-[calc(100vh-16px)] rounded-2xl overflow-hidden shadow-2xl animate-fade-in-scale",style:{background:"#fff"},onClick:i=>i.stopPropagation(),children:[l.jsx("iframe",{src:e.href,className:"h-full w-full border-0",title:e.label}),l.jsx("button",{type:"button","aria-label":"关闭数字员工弹窗",className:"de-digital-modal-close-hitbox",onClick:()=>a(null)})]})}):null;return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"space-y-1",children:l.jsxs("button",{type:"button",onClick:()=>{a({href:SS(),label:"数字员工"})},className:"flex items-center gap-3 px-3 py-2.5 rounded-2xl text-sm font-medium transition-all w-full text-left text-[var(--pc-text-muted)] hover:text-[var(--pc-text-secondary)] hover:bg-[var(--pc-hover)]",children:[l.jsx(Zp,{className:"h-5 w-5 flex-shrink-0"}),l.jsx("span",{className:"truncate",children:"打开数字员工"})]})}),r?Xw.createPortal(r,document.body):null]})}const CS=[{to:"/",icon:_r,labelKey:"planb.nav.chat",end:!0},{to:"/browser",icon:ls,labelKey:"planb.nav.browser"}],ES=[{to:"/dashboard",icon:Zp,label:"总览"},{to:"/plans",icon:Jp,label:"计划"},{to:"/execution",icon:ds,label:"执行"},{to:"/governance",icon:a1,label:"治理"},{to:"/scheduler",icon:Qv,labelKey:"nav.scheduler"},{to:"/cron",icon:Ni,labelKey:"nav.cron"},{to:"/skills",icon:Wv,label:"技能"},{to:"/logs",icon:dp,label:"日志"},{to:"/devtools",icon:nm,label:"工具"},{to:"/swimlane",icon:Ci,label:"泳道"},{to:"/config",icon:ss,labelKey:"planb.nav.settings"}];function Fy({item:e,onClose:a,idx:r}){const i=e.icon,c=e.label||(e.labelKey?J(e.labelKey):e.to);return l.jsx(Hv,{to:e.to,end:e.end,onClick:a,className:({isActive:d})=>["flex items-center gap-3 px-3 py-2.5 rounded-2xl text-sm font-medium transition-all group",d?"text-[var(--pc-accent-light)]":"text-[var(--pc-text-muted)] hover:text-[var(--pc-text-secondary)] hover:bg-[var(--pc-hover)]"].join(" "),style:({isActive:d})=>({animationDelay:`${r*30}ms`,...d?{background:"var(--pc-accent-glow)",border:"1px solid var(--pc-accent-dim)"}:{}}),children:({isActive:d})=>l.jsxs(l.Fragment,{children:[l.jsx(i,{className:`h-5 w-5 flex-shrink-0 transition-colors ${d?"text-[var(--pc-accent)]":"group-hover:text-[var(--pc-accent)]"}`}),l.jsx("span",{className:"truncate",children:c})]})},e.to)}function TS({open:e,onClose:a}){const[r,i]=b.useState(!1);return l.jsxs(l.Fragment,{children:[e&&l.jsx("div",{className:"md:hidden fixed inset-0 z-40 bg-black/60 backdrop-blur-sm transition-opacity",onClick:a,onKeyDown:c=>{c.key==="Escape"&&a()},role:"button",tabIndex:-1,"aria-label":"关闭菜单"}),l.jsxs("aside",{className:["fixed top-0 left-0 h-screen w-60 flex flex-col border-r z-50","max-md:-translate-x-full max-md:transition-transform max-md:duration-200 max-md:ease-out",e?"max-md:translate-x-0":""].join(" "),style:{background:"var(--pc-bg-base)",borderColor:"var(--pc-border)"},children:[l.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b h-14",style:{borderColor:"var(--pc-border)"},children:[l.jsxs("div",{className:"relative shrink-0",children:[l.jsx("div",{className:"absolute -inset-1.5 rounded-xl",style:{background:"linear-gradient(135deg, rgba(var(--pc-accent-rgb), 0.15), rgba(var(--pc-accent-rgb), 0.05))"}}),l.jsx("div",{className:"relative h-9 w-9 rounded-xl flex items-center justify-center",style:{background:"linear-gradient(135deg, var(--pc-accent), #6366f1)"},children:l.jsx("span",{className:"text-white text-xs font-bold",children:"sgR"})})]}),l.jsx("span",{className:"text-sm font-semibold tracking-wide",style:{color:"var(--pc-text-primary)"},children:"PlanB"})]}),l.jsxs("nav",{className:"flex-1 overflow-y-auto py-4 px-3 space-y-1",children:[l.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider px-3 py-1 mb-1",style:{color:"var(--pc-text-faint)"},children:"助手"}),CS.map((c,d)=>l.jsx(Fy,{item:c,onClose:a,idx:d},c.to)),l.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider px-3 py-1 mb-1 mt-3",style:{color:"var(--pc-text-faint)"},children:"数字员工"}),l.jsx(NS,{}),l.jsxs("button",{onClick:()=>i(!r),className:"w-full flex items-center gap-2 px-3 py-1.5 mt-3 mb-1 rounded-lg text-[10px] font-semibold uppercase tracking-wider transition-colors hover:bg-[var(--pc-hover)]",style:{color:"var(--pc-text-faint)"},children:[l.jsx(Kc,{className:`h-3 w-3 transition-transform ${r?"":"-rotate-90"}`}),"控制台"]}),r&&l.jsx("div",{className:"space-y-1 animate-fade-in",children:ES.map((c,d)=>l.jsx(Fy,{item:c,onClose:a,idx:d},c.to))})]}),l.jsx("div",{className:"px-5 py-4 border-t text-[10px] uppercase tracking-wider",style:{borderColor:"var(--pc-border)",color:"var(--pc-text-faint)"},children:"sgRobot"})]})]})}const g1=b.createContext(null);function AS({children:e}){const[a,r]=b.useState(is),[i,c]=b.useState(jf),[d,u]=b.useState(!0),[m,p]=b.useState(!jf());b.useEffect(()=>{if(jf())return;let v=!1;return aS().then(k=>{v||k.require_pairing||(u(!1),c(!0))}).catch(()=>{}).finally(()=>{v||p(!1)}),()=>{v=!0}},[]),b.useEffect(()=>{const v=k=>{if(k.key==="zeroclaw_token"){const w=is();r(w),c(w!==null&&w.length>0)}};return window.addEventListener("storage",v),()=>window.removeEventListener("storage",v)},[]);const h=b.useCallback(async v=>{const{token:k}=await tS(v);s1(k),r(k),c(!0)},[]),y=b.useCallback(()=>{i1(),r(null),c(!1)},[]),x={token:a,isAuthenticated:i,requiresPairing:d,loading:m,pair:h,logout:y};return $p.createElement(g1.Provider,{value:x},e)}function x1(){const e=b.useContext(g1);if(!e)throw new Error("useAuth must be used within an <AuthProvider>");return e}const DS=()=>b.useContext(Fv),MS=[{value:"system",icon:Mj,labelKey:"theme.system"},{value:"dark",icon:Fj,labelKey:"theme.dark"},{value:"light",icon:Pj,labelKey:"theme.light"},{value:"oled",icon:qj,labelKey:"theme.oled"}],zS=[{value:"cyan",color:"#22d3ee"},{value:"violet",color:"#8b5cf6"},{value:"emerald",color:"#10b981"},{value:"amber",color:"#f59e0b"},{value:"rose",color:"#f43f5e"},{value:"blue",color:"#3b82f6"}],RS=[{value:"system",label:"System",sample:"Segoe/UI"},{value:"inter",label:"Inter",sample:"Inter"},{value:"segoe",label:"Segoe UI",sample:"Segoe"},{value:"sf",label:"SF Pro",sample:"SF"}],OS=[{value:"jetbrains",label:"JetBrains Mono",sample:"JetBrains"},{value:"fira",label:"Fira Code",sample:"Fira"},{value:"cascadia",label:"Cascadia Code",sample:"Cascadia"},{value:"system-mono",label:"System mono",sample:"System"}],LS=[14,15,16,17,18],$S=[13,14,15,16,17];function hc({children:e}){return l.jsx("div",{className:"text-[10px] uppercase tracking-wider mb-2 mt-5 first:mt-0",style:{color:"var(--pc-text-faint)",fontWeight:600},children:e})}function Iy({theme:e,active:a,onClick:r}){const[i,c,d,u,m]=e.preview;return l.jsxs("button",{onClick:r,className:"flex flex-col gap-1.5 p-2 rounded-xl border transition-all text-left group",style:{borderColor:a?"var(--pc-accent)":"var(--pc-border)",background:a?"var(--pc-accent-glow)":"transparent",boxShadow:a?"0 0 12px var(--pc-accent-glow)":"none",minWidth:"110px"},"aria-pressed":a,children:[l.jsxs("div",{className:"w-full rounded-lg overflow-hidden",style:{background:i,border:`1px solid ${e.scheme==="dark"?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.08)"}`},children:[l.jsxs("div",{className:"flex gap-1 px-2 py-1.5",children:[l.jsx("span",{className:"w-[6px] h-[6px] rounded-full",style:{background:"#ff5f57"}}),l.jsx("span",{className:"w-[6px] h-[6px] rounded-full",style:{background:"#febc2e"}}),l.jsx("span",{className:"w-[6px] h-[6px] rounded-full",style:{background:"#28c840"}})]}),l.jsxs("div",{className:"px-2 pb-2 flex flex-col gap-[3px]",children:[l.jsxs("div",{className:"flex gap-1 items-center",children:[l.jsx("span",{className:"h-[3px] rounded-full",style:{background:c,width:"30%"}}),l.jsx("span",{className:"h-[3px] rounded-full",style:{background:m,width:"20%",opacity:.4}})]}),l.jsxs("div",{className:"flex gap-1 items-center",children:[l.jsx("span",{className:"h-[3px] rounded-full",style:{background:m,width:"15%",opacity:.3}}),l.jsx("span",{className:"h-[3px] rounded-full",style:{background:d,width:"25%"}}),l.jsx("span",{className:"h-[3px] rounded-full",style:{background:u,width:"18%"}})]}),l.jsxs("div",{className:"flex gap-1 items-center",children:[l.jsx("span",{className:"h-[3px] rounded-full",style:{background:u,width:"22%"}}),l.jsx("span",{className:"h-[3px] rounded-full",style:{background:m,width:"28%",opacity:.3}})]})]})]}),l.jsxs("div",{className:"flex items-center gap-1 px-0.5",children:[a&&l.jsx(Li,{size:10,style:{color:"var(--pc-accent)"}}),l.jsx("span",{className:"text-[10px] font-medium truncate",style:{color:a?"var(--pc-accent-light)":"var(--pc-text-muted)"},children:e.name})]})]})}function y1({open:e,onClose:a}){var ne;const{theme:r,accent:i,colorTheme:c,uiFont:d,monoFont:u,uiFontSize:m,monoFontSize:p,setTheme:h,setAccent:y,setColorTheme:x,setUiFont:v,setMonoFont:k,setUiFontSize:w,setMonoFontSize:T}=DS(),[j,C]=b.useState("appearance"),$=b.useMemo(()=>[{id:"appearance",label:J("settings.tab.appearance"),icon:ss},{id:"themes",label:"Themes",icon:Oy},{id:"typography",label:J("settings.tab.typography"),icon:Ly}],[]),M=b.useMemo(()=>Nc.filter(A=>A.scheme==="dark"),[]),ee=b.useMemo(()=>Nc.filter(A=>A.scheme==="light"),[]);return b.useEffect(()=>{if(!e)return;const A=G=>{G.key==="Escape"&&a()};return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)},[e,a]),e?l.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":J("settings.title"),className:"fixed inset-0 z-50 flex items-center justify-center",onClick:a,children:[l.jsx("div",{className:"absolute inset-0",style:{background:"rgba(0,0,0,0.6)",backdropFilter:"blur(8px)"}}),l.jsxs("div",{className:"relative w-full max-w-2xl mx-4 rounded-3xl border shadow-2xl animate-fade-in",style:{background:"var(--pc-bg-base)",borderColor:"var(--pc-border)"},onClick:A=>A.stopPropagation(),children:[l.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b",style:{borderColor:"var(--pc-border)"},children:[l.jsxs("div",{className:"flex items-center gap-2.5",children:[l.jsx(ss,{size:18,style:{color:"var(--pc-accent-light)"}}),l.jsx("h2",{className:"text-sm font-semibold",style:{color:"var(--pc-text-primary)"},children:J("settings.title")})]}),l.jsx("button",{onClick:a,className:"h-8 w-8 rounded-xl flex items-center justify-center transition-colors",style:{color:"var(--pc-text-muted)",background:"transparent",border:"none",cursor:"pointer"},onMouseEnter:A=>{A.currentTarget.style.color="var(--pc-text-primary)",A.currentTarget.style.background="var(--pc-hover)"},onMouseLeave:A=>{A.currentTarget.style.color="var(--pc-text-muted)",A.currentTarget.style.background="transparent"},"aria-label":"Close",children:l.jsx(Ha,{size:16})})]}),l.jsxs("div",{className:"px-6 py-4 max-h-[65vh] overflow-y-auto",children:[l.jsx("div",{className:"flex gap-2 mb-4",children:$.map(A=>l.jsxs("button",{onClick:()=>C(A.id),className:"flex-1 rounded-xl border px-3 py-2 text-xs font-medium transition-colors flex items-center justify-center gap-1.5",style:j===A.id?{borderColor:"var(--pc-accent-dim)",background:"var(--pc-accent-glow)",color:"var(--pc-accent-light)"}:{borderColor:"var(--pc-border)",color:"var(--pc-text-muted)",background:"transparent"},onMouseEnter:G=>{j!==A.id&&(G.currentTarget.style.background="var(--pc-hover)")},onMouseLeave:G=>{j!==A.id&&(G.currentTarget.style.background="transparent")},children:[l.jsx(A.icon,{size:13}),A.label]},A.id))}),j==="appearance"&&l.jsxs(l.Fragment,{children:[l.jsx(hc,{children:J("settings.appearance")}),l.jsxs("div",{className:"mb-3",children:[l.jsx("div",{className:"text-xs mb-2",style:{color:"var(--pc-text-secondary)"},children:J("theme.mode")}),l.jsx("div",{className:"flex gap-1.5",children:MS.map(A=>{const G=A.icon,V=r===A.value;return l.jsxs("button",{onClick:()=>h(A.value),"aria-pressed":V,className:"flex-1 flex flex-col items-center gap-1 py-2 rounded-xl border text-xs transition-all",style:V?{borderColor:"var(--pc-accent-dim)",background:"var(--pc-accent-glow)",color:"var(--pc-accent-light)"}:{borderColor:"var(--pc-border)",color:"var(--pc-text-muted)",background:"transparent"},onMouseEnter:oe=>{V||(oe.currentTarget.style.background="var(--pc-hover)")},onMouseLeave:oe=>{V||(oe.currentTarget.style.background="transparent")},children:[l.jsx(G,{size:16}),l.jsx("span",{children:J(A.labelKey)})]},A.value)})})]}),l.jsxs("div",{className:"mb-4",children:[l.jsx("div",{className:"text-xs mb-2",style:{color:"var(--pc-text-secondary)"},children:J("theme.accent")}),l.jsx("div",{className:"flex gap-2",children:zS.map(A=>l.jsx("button",{onClick:()=>y(A.value),className:"relative h-7 w-7 rounded-full transition-all flex items-center justify-center",style:{backgroundColor:A.color,border:i===A.value?`2px solid ${A.color}`:"2px solid transparent",boxShadow:i===A.value?`0 0 8px ${A.color}40`:"none"},"aria-pressed":i===A.value,"aria-label":`${A.value} accent`,children:i===A.value&&l.jsx(Li,{size:14,style:{color:"white"}})},A.value))})]})]}),j==="themes"&&l.jsxs(l.Fragment,{children:[l.jsx(hc,{children:"Dark Themes"}),l.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-4 gap-2 mb-4",children:M.map(A=>l.jsx(Iy,{theme:A,active:c===A.id,onClick:()=>x(A.id)},A.id))}),l.jsx(hc,{children:"Light Themes"}),l.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-4 gap-2 mb-4",children:ee.map(A=>l.jsx(Iy,{theme:A,active:c===A.id,onClick:()=>x(A.id)},A.id))}),l.jsx("div",{className:"rounded-2xl border p-3 mt-2",style:{background:"var(--pc-bg-surface)",borderColor:"var(--pc-border)"},children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Oy,{size:14,style:{color:"var(--pc-accent)"}}),l.jsx("span",{className:"text-xs font-medium",style:{color:"var(--pc-text-primary)"},children:((ne=Nc.find(A=>A.id===c))==null?void 0:ne.name)??"Default Dark"}),l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full",style:{background:"var(--pc-accent-glow)",color:"var(--pc-accent-light)"},children:"Active"})]})})]}),j==="typography"&&l.jsxs(l.Fragment,{children:[l.jsx(hc,{children:J("settings.typography")}),l.jsxs("div",{className:"mb-4",children:[l.jsxs("div",{className:"flex items-center gap-2 text-xs mb-2",style:{color:"var(--pc-text-secondary)"},children:[l.jsx(Ly,{size:14}),J("settings.fontUi")]}),l.jsx("div",{className:"flex flex-wrap gap-1.5",children:RS.map(A=>l.jsxs("button",{onClick:()=>v(A.value),className:"flex items-center gap-2 px-3 py-2 rounded-xl border text-xs transition-all",style:d===A.value?{borderColor:"var(--pc-accent-dim)",background:"var(--pc-accent-glow)",color:"var(--pc-accent-light)"}:{borderColor:"var(--pc-border)",color:"var(--pc-text-muted)",background:"transparent"},onMouseEnter:G=>{d!==A.value&&(G.currentTarget.style.background="var(--pc-hover)")},onMouseLeave:G=>{d!==A.value&&(G.currentTarget.style.background="transparent")},children:[l.jsx("span",{style:{fontSize:"14px",fontFamily:Vp[A.value]},children:A.sample}),l.jsx("span",{style:{fontSize:"11px",color:"var(--pc-text-faint)"},children:A.label})]},A.value))})]}),l.jsxs("div",{className:"mb-4",children:[l.jsxs("div",{className:"flex items-center gap-2 text-xs mb-2",style:{color:"var(--pc-text-secondary)"},children:[l.jsx(bj,{size:14}),J("settings.fontMono")]}),l.jsx("div",{className:"flex flex-wrap gap-1.5",children:OS.map(A=>l.jsxs("button",{onClick:()=>k(A.value),className:"flex items-center gap-2 px-3 py-2 rounded-xl border text-xs transition-all",style:u===A.value?{borderColor:"var(--pc-accent-dim)",background:"var(--pc-accent-glow)",color:"var(--pc-accent-light)"}:{borderColor:"var(--pc-border)",color:"var(--pc-text-muted)",background:"transparent"},onMouseEnter:G=>{u!==A.value&&(G.currentTarget.style.background="var(--pc-hover)")},onMouseLeave:G=>{u!==A.value&&(G.currentTarget.style.background="transparent")},children:[l.jsx("span",{style:{fontSize:"14px",fontFamily:Kp[A.value]},children:A.sample}),l.jsx("span",{style:{fontSize:"11px",color:"var(--pc-text-faint)"},children:A.label})]},A.value))})]}),l.jsxs("div",{className:"mb-4",children:[l.jsx("div",{className:"text-xs mb-2",style:{color:"var(--pc-text-secondary)"},children:J("settings.fontSize")}),l.jsx("div",{className:"flex gap-1.5 flex-wrap",children:LS.map(A=>l.jsxs("button",{onClick:()=>w(A),className:"px-3 py-1.5 rounded-lg border text-xs transition-all",style:m===A?{borderColor:"var(--pc-accent-dim)",background:"var(--pc-accent-glow)",color:"var(--pc-accent-light)"}:{borderColor:"var(--pc-border)",color:"var(--pc-text-muted)",background:"transparent"},onMouseEnter:G=>{m!==A&&(G.currentTarget.style.background="var(--pc-hover)")},onMouseLeave:G=>{m!==A&&(G.currentTarget.style.background="transparent")},children:[A,"px"]},A))})]}),l.jsxs("div",{className:"mb-4",children:[l.jsx("div",{className:"text-xs mb-2",style:{color:"var(--pc-text-secondary)"},children:J("settings.fontMonoSize")}),l.jsx("div",{className:"flex gap-1.5 flex-wrap",children:$S.map(A=>l.jsxs("button",{onClick:()=>T(A),className:"px-3 py-1.5 rounded-lg border text-xs transition-all",style:p===A?{borderColor:"var(--pc-accent-dim)",background:"var(--pc-accent-glow)",color:"var(--pc-accent-light)"}:{borderColor:"var(--pc-border)",color:"var(--pc-text-muted)",background:"transparent"},onMouseEnter:G=>{p!==A&&(G.currentTarget.style.background="var(--pc-hover)")},onMouseLeave:G=>{p!==A&&(G.currentTarget.style.background="transparent")},children:[A,"px"]},A))})]}),l.jsxs("div",{className:"rounded-2xl border p-3",style:{background:"var(--pc-bg-surface)",borderColor:"var(--pc-border)"},children:[l.jsx("div",{className:"text-[11px] uppercase tracking-wide mb-2",style:{color:"var(--pc-text-faint)"},children:J("settings.preview")}),l.jsx("div",{className:"text-sm mb-2",style:{color:"var(--pc-text-primary)",fontFamily:"var(--pc-font-ui)",fontSize:"var(--pc-font-size)"},children:J("settings.previewText")}),l.jsx("div",{className:"rounded-xl border p-2 text-[13px]",style:{fontFamily:"var(--pc-font-mono)",fontSize:"var(--pc-font-size-mono)",color:"var(--pc-text-primary)",borderColor:"var(--pc-border)",background:"var(--pc-bg-code)"},children:"const hello = 'ZeroClaw'; // typography preview"})]})]})]})]})]}):null}const BS={"/":"nav.dashboard","/dashboard":"nav.dashboard","/agent":"planb.nav.chat","/browser":"planb.nav.browser","/plans":"nav.plans","/execution":"nav.execution","/governance":"nav.governance","/scheduler":"nav.scheduler","/skills":"nav.skills","/tools":"nav.tools","/cron":"nav.cron","/integrations":"nav.integrations","/memory":"nav.memory","/config":"nav.config","/cost":"nav.cost","/logs":"nav.logs","/devtools":"nav.devtools","/swimlane":"nav.swimlane","/doctor":"nav.doctor","/canvas":"nav.canvas"};function US({onMenuToggle:e}){const a=Rn(),{logout:r}=x1(),[i,c]=b.useState(!1),{toggleMode:d}=Xp(),u=BS[a.pathname]??"nav.dashboard",m=J(u);return l.jsxs(l.Fragment,{children:[l.jsxs("header",{className:"h-14 flex items-center justify-between px-6 border-b animate-fade-in",style:{background:"var(--pc-bg-surface)",borderColor:"var(--pc-border)",backdropFilter:"blur(12px)"},children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("button",{type:"button",onClick:e,className:"md:hidden p-1.5 -ml-1.5 rounded-lg transition-colors duration-200",style:{color:"var(--pc-text-muted)"},onMouseEnter:p=>{p.currentTarget.style.color="var(--pc-text-primary)",p.currentTarget.style.background="var(--pc-hover)"},onMouseLeave:p=>{p.currentTarget.style.color="var(--pc-text-muted)",p.currentTarget.style.background="transparent"},"aria-label":"Open menu",children:l.jsx(Bj,{className:"h-5 w-5"})}),l.jsx("h1",{className:"h-9 leading-9 text-lg font-semibold tracking-tight",style:{color:"var(--pc-text-primary)"},children:m})]}),l.jsxs("div",{className:"flex items-center gap-2 h-9",children:[l.jsx("button",{type:"button",onClick:d,className:"h-9 w-9 flex items-center justify-center rounded-xl text-xs transition-all",style:{color:"var(--pc-text-muted)",background:"transparent",border:"none",cursor:"pointer"},onMouseEnter:p=>{p.currentTarget.style.color="var(--pc-text-primary)",p.currentTarget.style.background="var(--pc-hover)"},onMouseLeave:p=>{p.currentTarget.style.color="var(--pc-text-muted)",p.currentTarget.style.background="transparent"},"aria-label":J("planb.layout.switch_to_compact"),title:J("planb.layout.switch_to_compact"),children:l.jsx(Hj,{className:"h-3.5 w-3.5"})}),l.jsx("button",{type:"button",onClick:()=>c(!0),className:"h-9 w-9 flex items-center justify-center rounded-xl text-xs transition-all",style:{color:"var(--pc-text-muted)",background:"transparent",border:"none",cursor:"pointer"},onMouseEnter:p=>{p.currentTarget.style.color="var(--pc-text-primary)",p.currentTarget.style.background="var(--pc-hover)"},onMouseLeave:p=>{p.currentTarget.style.color="var(--pc-text-muted)",p.currentTarget.style.background="transparent"},"aria-label":J("settings.title"),children:l.jsx(ss,{className:"h-3.5 w-3.5"})}),l.jsxs("button",{type:"button",onClick:r,className:"h-9 px-3 rounded-xl text-xs transition-all flex items-center gap-1.5",style:{color:"var(--pc-text-muted)",background:"transparent",border:"none",cursor:"pointer"},onMouseEnter:p=>{p.currentTarget.style.color="#f87171",p.currentTarget.style.background="rgba(239, 68, 68, 0.08)"},onMouseLeave:p=>{p.currentTarget.style.color="var(--pc-text-muted)",p.currentTarget.style.background="transparent"},children:[l.jsx(Oj,{className:"h-3.5 w-3.5"}),l.jsx("span",{className:"hidden sm:inline",children:J("auth.logout")})]})]})]}),l.jsx(y1,{open:i,onClose:()=>c(!1)})]})}function HS(){const{pathname:e}=Rn(),[a,r]=b.useState(!1);return b.useEffect(()=>{r(!1)},[e]),l.jsxs("div",{className:"min-h-screen text-white",style:{background:"var(--pc-bg-base)"},children:[l.jsx(TS,{open:a,onClose:()=>r(!1)}),l.jsxs("div",{className:"md:ml-60 ml-0 flex flex-col flex-1 min-w-0 h-screen",children:[l.jsx(US,{onMenuToggle:()=>r(!0)}),l.jsx("main",{className:"flex-1 overflow-y-auto min-h-0 flex flex-col",children:l.jsx(yD,{children:l.jsx(Ov,{})},e)})]})]})}const qS=["width=420","height=680","left="+Math.max(0,(screen.width-420)/2),"top="+Math.max(0,(screen.height-680)/2),"toolbar=no","location=no","status=no","menubar=no","scrollbars=no","resizable=yes"].join(",");function FS({onPlanSidebarToggle:e}){const{toggleMode:a}=Xp(),r=Rn(),[i,c]=b.useState(!1),d=r.pathname.startsWith("/agent"),u=b.useCallback(()=>{const m=window.open(`${Pc}/popout`,"PlanBChat",qS);m&&m.focus()},[]);return l.jsxs(l.Fragment,{children:[l.jsxs("header",{className:"h-11 flex items-center justify-between px-4 border-b flex-shrink-0",style:{background:"var(--pc-bg-surface)",borderColor:"var(--pc-border)"},children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm font-semibold",style:{color:"var(--pc-text-primary)"},children:"PlanB"}),!d&&l.jsx("span",{className:"text-xs",style:{color:"var(--pc-text-muted)"},children:J("planb.nav.chat")})]}),l.jsxs("div",{className:"flex items-center gap-1",children:[e&&l.jsx("button",{type:"button",onClick:e,className:"h-8 w-8 flex items-center justify-center rounded-lg transition-colors",style:{color:"var(--pc-text-muted)"},onMouseEnter:m=>{m.currentTarget.style.color="var(--pc-text-primary)",m.currentTarget.style.background="var(--pc-hover)"},onMouseLeave:m=>{m.currentTarget.style.color="var(--pc-text-muted)",m.currentTarget.style.background="transparent"},"aria-label":"Plan 对话",title:"Plan 对话",children:l.jsx(Jp,{className:"h-3.5 w-3.5"})}),l.jsx("button",{type:"button",onClick:u,className:"h-8 w-8 flex items-center justify-center rounded-lg transition-colors",style:{color:"var(--pc-text-muted)"},onMouseEnter:m=>{m.currentTarget.style.color="var(--pc-text-primary)",m.currentTarget.style.background="var(--pc-hover)"},onMouseLeave:m=>{m.currentTarget.style.color="var(--pc-text-muted)",m.currentTarget.style.background="transparent"},"aria-label":J("planb.layout.pop_out"),title:J("planb.layout.pop_out"),children:l.jsx(Sj,{className:"h-3.5 w-3.5"})}),l.jsx("button",{type:"button",onClick:()=>c(!0),className:"h-8 w-8 flex items-center justify-center rounded-lg transition-colors",style:{color:"var(--pc-text-muted)"},onMouseEnter:m=>{m.currentTarget.style.color="var(--pc-text-primary)",m.currentTarget.style.background="var(--pc-hover)"},onMouseLeave:m=>{m.currentTarget.style.color="var(--pc-text-muted)",m.currentTarget.style.background="transparent"},"aria-label":J("settings.title"),children:l.jsx(ss,{className:"h-3.5 w-3.5"})}),l.jsx("button",{type:"button",onClick:a,className:"h-8 w-8 flex items-center justify-center rounded-lg transition-colors",style:{color:"var(--pc-text-muted)"},onMouseEnter:m=>{m.currentTarget.style.color="var(--pc-text-primary)",m.currentTarget.style.background="var(--pc-hover)"},onMouseLeave:m=>{m.currentTarget.style.color="var(--pc-text-muted)",m.currentTarget.style.background="transparent"},"aria-label":J("planb.layout.switch_to_wide"),title:J("planb.layout.switch_to_wide"),children:l.jsx($j,{className:"h-3.5 w-3.5"})})]})]}),l.jsx(y1,{open:i,onClose:()=>c(!1)})]})}const IS=["周日","周一","周二","周三","周四","周五","周六"];function Yy(e,a){return e.getFullYear()===a.getFullYear()&&e.getMonth()===a.getMonth()&&e.getDate()===a.getDate()}function Gy(e){return e<10?"0"+e:String(e)}function b1(e){if(!e)return"";const a=new Date(e);if(isNaN(a.getTime()))return"";const r=new Date,i=`${Gy(a.getHours())}:${Gy(a.getMinutes())}`;if(Yy(a,r))return`今天 ${i}`;const c=new Date(r);return c.setDate(c.getDate()-1),Yy(a,c)?`昨天 ${i}`:Math.floor((r.getTime()-a.getTime())/(1e3*60*60*24))<7&&a.getDay()!==r.getDay()?`${IS[a.getDay()]} ${i}`:a.getFullYear()===r.getFullYear()?`${a.getMonth()+1}月${a.getDate()}日`:`${a.getFullYear()}年${a.getMonth()+1}月${a.getDate()}日`}const YS={draft:"var(--pc-text-muted)",reviewing:"#f59e0b",approved:"#3b82f6",active:"var(--color-status-success)",blocked:"var(--color-status-error)",completed:"var(--pc-text-muted)",failed:"var(--color-status-error)",cancelled:"var(--pc-text-muted)",superseded:"var(--pc-text-muted)"};function GS({activePlanId:e,onSelectPlan:a}){const[r,i]=b.useState([]);b.useEffect(()=>{let u=!1;const m=async()=>{try{const h=await gS();u||i(h.plans||[])}catch{}};m();const p=setInterval(m,3e4);return()=>{u=!0,clearInterval(p)}},[]);const c=[...r].sort((u,m)=>{const p=["completed","failed","cancelled","superseded"].includes(u.status),h=["completed","failed","cancelled","superseded"].includes(m.status);return p!==h?p?1:-1:(m.created_at||"").localeCompare(u.created_at||"")});function d(u){let m=0,p=0;for(const h of u.steps||[])for(const y of h.tasks||[])m++,(y.status==="succeeded"||y.status==="completed")&&p++;return m>0?`${p}/${m}`:""}return l.jsxs("div",{className:"flex flex-col h-full",children:[l.jsx("div",{className:"px-4 py-3 border-b",style:{borderColor:"var(--pc-border)"},children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(_r,{className:"h-3.5 w-3.5",style:{color:"var(--pc-accent)"}}),l.jsx("span",{className:"text-xs font-semibold",style:{color:"var(--pc-text-primary)"},children:"Plan 对话"})]})}),l.jsx("div",{className:"flex-1 overflow-y-auto",children:c.length===0?l.jsx("div",{className:"p-4 text-center text-xs",style:{color:"var(--pc-text-muted)"},children:"暂无 Plan"}):c.map(u=>{const m=d(u),p=u.plan_id===e;return l.jsxs("button",{onClick:()=>a(u),className:"w-full text-left px-4 py-3 border-b transition-colors",style:{borderColor:"var(--pc-border)",background:p?"var(--pc-accent-dim)":"transparent"},onMouseEnter:h=>{p||(h.currentTarget.style.background="var(--pc-hover)")},onMouseLeave:h=>{p||(h.currentTarget.style.background="transparent")},children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx("span",{className:"h-2 w-2 rounded-full flex-shrink-0",style:{background:YS[u.status]||"var(--pc-text-muted)"}}),l.jsx("span",{className:"text-xs font-medium truncate",style:{color:"var(--pc-text-primary)"},children:u.title||u.plan_id})]}),l.jsxs("div",{className:"flex items-center gap-3 text-[10px]",style:{color:"var(--pc-text-muted)"},children:[l.jsx("span",{children:b1(u.created_at)}),m&&l.jsxs("span",{children:[m," steps"]})]})]},u.plan_id)})})]})}function VS(e,a){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const KS=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,PS=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,XS={};function Vy(e,a){return(XS.jsx?PS:KS).test(e)}const QS=/[ \t\n\f\r]/g;function ZS(e){return typeof e=="object"?e.type==="text"?Ky(e.value):!1:Ky(e)}function Ky(e){return e.replace(QS,"")===""}class Ui{constructor(a,r,i){this.normal=r,this.property=a,i&&(this.space=i)}}Ui.prototype.normal={};Ui.prototype.property={};Ui.prototype.space=void 0;function v1(e,a){const r={},i={};for(const c of e)Object.assign(r,c.property),Object.assign(i,c.normal);return new Ui(r,i,a)}function mp(e){return e.toLowerCase()}class bn{constructor(a,r){this.attribute=r,this.property=a}}bn.prototype.attribute="";bn.prototype.booleanish=!1;bn.prototype.boolean=!1;bn.prototype.commaOrSpaceSeparated=!1;bn.prototype.commaSeparated=!1;bn.prototype.defined=!1;bn.prototype.mustUseProperty=!1;bn.prototype.number=!1;bn.prototype.overloadedBoolean=!1;bn.prototype.property="";bn.prototype.spaceSeparated=!1;bn.prototype.space=void 0;let JS=0;const Ge=ll(),qt=ll(),hp=ll(),xe=ll(),bt=ll(),es=ll(),Dn=ll();function ll(){return 2**++JS}const gp=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ge,booleanish:qt,commaOrSpaceSeparated:Dn,commaSeparated:es,number:xe,overloadedBoolean:hp,spaceSeparated:bt},Symbol.toStringTag,{value:"Module"})),Sf=Object.keys(gp);class im extends bn{constructor(a,r,i,c){let d=-1;if(super(a,r),Py(this,"space",c),typeof i=="number")for(;++d<Sf.length;){const u=Sf[d];Py(this,Sf[d],(i&gp[u])===gp[u])}}}im.prototype.defined=!0;function Py(e,a,r){r&&(e[a]=r)}function fs(e){const a={},r={};for(const[i,c]of Object.entries(e.properties)){const d=new im(i,e.transform(e.attributes||{},i),c,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(d.mustUseProperty=!0),a[i]=d,r[mp(i)]=i,r[mp(d.attribute)]=i}return new Ui(a,r,e.space)}const k1=fs({properties:{ariaActiveDescendant:null,ariaAtomic:qt,ariaAutoComplete:null,ariaBusy:qt,ariaChecked:qt,ariaColCount:xe,ariaColIndex:xe,ariaColSpan:xe,ariaControls:bt,ariaCurrent:null,ariaDescribedBy:bt,ariaDetails:null,ariaDisabled:qt,ariaDropEffect:bt,ariaErrorMessage:null,ariaExpanded:qt,ariaFlowTo:bt,ariaGrabbed:qt,ariaHasPopup:null,ariaHidden:qt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:bt,ariaLevel:xe,ariaLive:null,ariaModal:qt,ariaMultiLine:qt,ariaMultiSelectable:qt,ariaOrientation:null,ariaOwns:bt,ariaPlaceholder:null,ariaPosInSet:xe,ariaPressed:qt,ariaReadOnly:qt,ariaRelevant:null,ariaRequired:qt,ariaRoleDescription:bt,ariaRowCount:xe,ariaRowIndex:xe,ariaRowSpan:xe,ariaSelected:qt,ariaSetSize:xe,ariaSort:null,ariaValueMax:xe,ariaValueMin:xe,ariaValueNow:xe,ariaValueText:null,role:null},transform(e,a){return a==="role"?a:"aria-"+a.slice(4).toLowerCase()}});function _1(e,a){return a in e?e[a]:a}function w1(e,a){return _1(e,a.toLowerCase())}const WS=fs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:es,acceptCharset:bt,accessKey:bt,action:null,allow:null,allowFullScreen:Ge,allowPaymentRequest:Ge,allowUserMedia:Ge,alt:null,as:null,async:Ge,autoCapitalize:null,autoComplete:bt,autoFocus:Ge,autoPlay:Ge,blocking:bt,capture:null,charSet:null,checked:Ge,cite:null,className:bt,cols:xe,colSpan:null,content:null,contentEditable:qt,controls:Ge,controlsList:bt,coords:xe|es,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ge,defer:Ge,dir:null,dirName:null,disabled:Ge,download:hp,draggable:qt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ge,formTarget:null,headers:bt,height:xe,hidden:hp,high:xe,href:null,hrefLang:null,htmlFor:bt,httpEquiv:bt,id:null,imageSizes:null,imageSrcSet:null,inert:Ge,inputMode:null,integrity:null,is:null,isMap:Ge,itemId:null,itemProp:bt,itemRef:bt,itemScope:Ge,itemType:bt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ge,low:xe,manifest:null,max:null,maxLength:xe,media:null,method:null,min:null,minLength:xe,multiple:Ge,muted:Ge,name:null,nonce:null,noModule:Ge,noValidate:Ge,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ge,optimum:xe,pattern:null,ping:bt,placeholder:null,playsInline:Ge,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ge,referrerPolicy:null,rel:bt,required:Ge,reversed:Ge,rows:xe,rowSpan:xe,sandbox:bt,scope:null,scoped:Ge,seamless:Ge,selected:Ge,shadowRootClonable:Ge,shadowRootDelegatesFocus:Ge,shadowRootMode:null,shape:null,size:xe,sizes:null,slot:null,span:xe,spellCheck:qt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:xe,step:null,style:null,tabIndex:xe,target:null,title:null,translate:null,type:null,typeMustMatch:Ge,useMap:null,value:qt,width:xe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:bt,axis:null,background:null,bgColor:null,border:xe,borderColor:null,bottomMargin:xe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ge,declare:Ge,event:null,face:null,frame:null,frameBorder:null,hSpace:xe,leftMargin:xe,link:null,longDesc:null,lowSrc:null,marginHeight:xe,marginWidth:xe,noResize:Ge,noHref:Ge,noShade:Ge,noWrap:Ge,object:null,profile:null,prompt:null,rev:null,rightMargin:xe,rules:null,scheme:null,scrolling:qt,standby:null,summary:null,text:null,topMargin:xe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:xe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ge,disableRemotePlayback:Ge,prefix:null,property:null,results:xe,security:null,unselectable:null},space:"html",transform:w1}),eN=fs({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Dn,accentHeight:xe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:xe,amplitude:xe,arabicForm:null,ascent:xe,attributeName:null,attributeType:null,azimuth:xe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:xe,by:null,calcMode:null,capHeight:xe,className:bt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:xe,diffuseConstant:xe,direction:null,display:null,dur:null,divisor:xe,dominantBaseline:null,download:Ge,dx:null,dy:null,edgeMode:null,editable:null,elevation:xe,enableBackground:null,end:null,event:null,exponent:xe,externalResourcesRequired:null,fill:null,fillOpacity:xe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:es,g2:es,glyphName:es,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:xe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:xe,horizOriginX:xe,horizOriginY:xe,id:null,ideographic:xe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:xe,k:xe,k1:xe,k2:xe,k3:xe,k4:xe,kernelMatrix:Dn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:xe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:xe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:xe,overlineThickness:xe,paintOrder:null,panose1:null,path:null,pathLength:xe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:bt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:xe,pointsAtY:xe,pointsAtZ:xe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Dn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Dn,rev:Dn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Dn,requiredFeatures:Dn,requiredFonts:Dn,requiredFormats:Dn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:xe,specularExponent:xe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:xe,strikethroughThickness:xe,string:null,stroke:null,strokeDashArray:Dn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:xe,strokeOpacity:xe,strokeWidth:null,style:null,surfaceScale:xe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Dn,tabIndex:xe,tableValues:null,target:null,targetX:xe,targetY:xe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Dn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:xe,underlineThickness:xe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:xe,values:null,vAlphabetic:xe,vMathematical:xe,vectorEffect:null,vHanging:xe,vIdeographic:xe,version:null,vertAdvY:xe,vertOriginX:xe,vertOriginY:xe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:xe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:_1}),j1=fs({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,a){return"xlink:"+a.slice(5).toLowerCase()}}),S1=fs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:w1}),N1=fs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,a){return"xml:"+a.slice(3).toLowerCase()}}),tN={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},nN=/[A-Z]/g,Xy=/-[a-z]/g,aN=/^data[-\w.:]+$/i;function rN(e,a){const r=mp(a);let i=a,c=bn;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&aN.test(a)){if(a.charAt(4)==="-"){const d=a.slice(5).replace(Xy,sN);i="data"+d.charAt(0).toUpperCase()+d.slice(1)}else{const d=a.slice(4);if(!Xy.test(d)){let u=d.replace(nN,lN);u.charAt(0)!=="-"&&(u="-"+u),a="data"+u}}c=im}return new c(i,a)}function lN(e){return"-"+e.toLowerCase()}function sN(e){return e.charAt(1).toUpperCase()}const iN=v1([k1,WS,j1,S1,N1],"html"),om=v1([k1,eN,j1,S1,N1],"svg");function oN(e){return e.join(" ").trim()}var Yl={},Nf,Qy;function cN(){if(Qy)return Nf;Qy=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,a=/\n/g,r=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,c=/^:\s*/,d=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,m=/^\s+|\s+$/g,p=`
|
||
`,h="/",y="*",x="",v="comment",k="declaration";function w(j,C){if(typeof j!="string")throw new TypeError("First argument must be a string");if(!j)return[];C=C||{};var $=1,M=1;function ee(le){var B=le.match(a);B&&($+=B.length);var L=le.lastIndexOf(p);M=~L?le.length-L:M+le.length}function ne(){var le={line:$,column:M};return function(B){return B.position=new A(le),oe(),B}}function A(le){this.start=le,this.end={line:$,column:M},this.source=C.source}A.prototype.content=j;function G(le){var B=new Error(C.source+":"+$+":"+M+": "+le);if(B.reason=le,B.filename=C.source,B.line=$,B.column=M,B.source=j,!C.silent)throw B}function V(le){var B=le.exec(j);if(B){var L=B[0];return ee(L),j=j.slice(L.length),B}}function oe(){V(r)}function Y(le){var B;for(le=le||[];B=F();)B!==!1&&le.push(B);return le}function F(){var le=ne();if(!(h!=j.charAt(0)||y!=j.charAt(1))){for(var B=2;x!=j.charAt(B)&&(y!=j.charAt(B)||h!=j.charAt(B+1));)++B;if(B+=2,x===j.charAt(B-1))return G("End of comment missing");var L=j.slice(2,B-2);return M+=2,ee(L),j=j.slice(B),M+=2,le({type:v,comment:L})}}function I(){var le=ne(),B=V(i);if(B){if(F(),!V(c))return G("property missing ':'");var L=V(d),q=le({type:k,property:T(B[0].replace(e,x)),value:L?T(L[0].replace(e,x)):x});return V(u),q}}function Q(){var le=[];Y(le);for(var B;B=I();)B!==!1&&(le.push(B),Y(le));return le}return oe(),Q()}function T(j){return j?j.replace(m,x):x}return Nf=w,Nf}var Zy;function uN(){if(Zy)return Yl;Zy=1;var e=Yl&&Yl.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Yl,"__esModule",{value:!0}),Yl.default=r;const a=e(cN());function r(i,c){let d=null;if(!i||typeof i!="string")return d;const u=(0,a.default)(i),m=typeof c=="function";return u.forEach(p=>{if(p.type!=="declaration")return;const{property:h,value:y}=p;m?c(h,y,p):y&&(d=d||{},d[h]=y)}),d}return Yl}var pi={},Jy;function dN(){if(Jy)return pi;Jy=1,Object.defineProperty(pi,"__esModule",{value:!0}),pi.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,a=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,c=/^-(ms)-/,d=function(h){return!h||r.test(h)||e.test(h)},u=function(h,y){return y.toUpperCase()},m=function(h,y){return"".concat(y,"-")},p=function(h,y){return y===void 0&&(y={}),d(h)?h:(h=h.toLowerCase(),y.reactCompat?h=h.replace(c,m):h=h.replace(i,m),h.replace(a,u))};return pi.camelCase=p,pi}var mi,Wy;function fN(){if(Wy)return mi;Wy=1;var e=mi&&mi.__importDefault||function(c){return c&&c.__esModule?c:{default:c}},a=e(uN()),r=dN();function i(c,d){var u={};return!c||typeof c!="string"||(0,a.default)(c,function(m,p){m&&p&&(u[(0,r.camelCase)(m,d)]=p)}),u}return i.default=i,mi=i,mi}var pN=fN();const mN=Ic(pN),C1=E1("end"),cm=E1("start");function E1(e){return a;function a(r){const i=r&&r.position&&r.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function hN(e){const a=cm(e),r=C1(e);if(a&&r)return{start:a,end:r}}function ki(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?eb(e.position):"start"in e||"end"in e?eb(e):"line"in e||"column"in e?xp(e):""}function xp(e){return tb(e&&e.line)+":"+tb(e&&e.column)}function eb(e){return xp(e&&e.start)+"-"+xp(e&&e.end)}function tb(e){return e&&typeof e=="number"?e:1}class rn extends Error{constructor(a,r,i){super(),typeof r=="string"&&(i=r,r=void 0);let c="",d={},u=!1;if(r&&("line"in r&&"column"in r?d={place:r}:"start"in r&&"end"in r?d={place:r}:"type"in r?d={ancestors:[r],place:r.position}:d={...r}),typeof a=="string"?c=a:!d.cause&&a&&(u=!0,c=a.message,d.cause=a),!d.ruleId&&!d.source&&typeof i=="string"){const p=i.indexOf(":");p===-1?d.ruleId=i:(d.source=i.slice(0,p),d.ruleId=i.slice(p+1))}if(!d.place&&d.ancestors&&d.ancestors){const p=d.ancestors[d.ancestors.length-1];p&&(d.place=p.position)}const m=d.place&&"start"in d.place?d.place.start:d.place;this.ancestors=d.ancestors||void 0,this.cause=d.cause||void 0,this.column=m?m.column:void 0,this.fatal=void 0,this.file="",this.message=c,this.line=m?m.line:void 0,this.name=ki(d.place)||"1:1",this.place=d.place||void 0,this.reason=this.message,this.ruleId=d.ruleId||void 0,this.source=d.source||void 0,this.stack=u&&d.cause&&typeof d.cause.stack=="string"?d.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}rn.prototype.file="";rn.prototype.name="";rn.prototype.reason="";rn.prototype.message="";rn.prototype.stack="";rn.prototype.column=void 0;rn.prototype.line=void 0;rn.prototype.ancestors=void 0;rn.prototype.cause=void 0;rn.prototype.fatal=void 0;rn.prototype.place=void 0;rn.prototype.ruleId=void 0;rn.prototype.source=void 0;const um={}.hasOwnProperty,gN=new Map,xN=/[A-Z]/g,yN=new Set(["table","tbody","thead","tfoot","tr"]),bN=new Set(["td","th"]),T1="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function vN(e,a){if(!a||a.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=a.filePath||void 0;let i;if(a.development){if(typeof a.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=EN(r,a.jsxDEV)}else{if(typeof a.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof a.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=CN(r,a.jsx,a.jsxs)}const c={Fragment:a.Fragment,ancestors:[],components:a.components||{},create:i,elementAttributeNameCase:a.elementAttributeNameCase||"react",evaluater:a.createEvaluater?a.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:a.ignoreInvalidStyle||!1,passKeys:a.passKeys!==!1,passNode:a.passNode||!1,schema:a.space==="svg"?om:iN,stylePropertyNameCase:a.stylePropertyNameCase||"dom",tableCellAlignToStyle:a.tableCellAlignToStyle!==!1},d=A1(c,e,void 0);return d&&typeof d!="string"?d:c.create(e,c.Fragment,{children:d||void 0},void 0)}function A1(e,a,r){if(a.type==="element")return kN(e,a,r);if(a.type==="mdxFlowExpression"||a.type==="mdxTextExpression")return _N(e,a);if(a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement")return jN(e,a,r);if(a.type==="mdxjsEsm")return wN(e,a);if(a.type==="root")return SN(e,a,r);if(a.type==="text")return NN(e,a)}function kN(e,a,r){const i=e.schema;let c=i;a.tagName.toLowerCase()==="svg"&&i.space==="html"&&(c=om,e.schema=c),e.ancestors.push(a);const d=M1(e,a.tagName,!1),u=TN(e,a);let m=fm(e,a);return yN.has(a.tagName)&&(m=m.filter(function(p){return typeof p=="string"?!ZS(p):!0})),D1(e,u,d,a),dm(u,m),e.ancestors.pop(),e.schema=i,e.create(a,d,u,r)}function _N(e,a){if(a.data&&a.data.estree&&e.evaluater){const i=a.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}Ai(e,a.position)}function wN(e,a){if(a.data&&a.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(a.data.estree);Ai(e,a.position)}function jN(e,a,r){const i=e.schema;let c=i;a.name==="svg"&&i.space==="html"&&(c=om,e.schema=c),e.ancestors.push(a);const d=a.name===null?e.Fragment:M1(e,a.name,!0),u=AN(e,a),m=fm(e,a);return D1(e,u,d,a),dm(u,m),e.ancestors.pop(),e.schema=i,e.create(a,d,u,r)}function SN(e,a,r){const i={};return dm(i,fm(e,a)),e.create(a,e.Fragment,i,r)}function NN(e,a){return a.value}function D1(e,a,r,i){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(a.node=i)}function dm(e,a){if(a.length>0){const r=a.length>1?a:a[0];r&&(e.children=r)}}function CN(e,a,r){return i;function i(c,d,u,m){const h=Array.isArray(u.children)?r:a;return m?h(d,u,m):h(d,u)}}function EN(e,a){return r;function r(i,c,d,u){const m=Array.isArray(d.children),p=cm(i);return a(c,d,u,m,{columnNumber:p?p.column-1:void 0,fileName:e,lineNumber:p?p.line:void 0},void 0)}}function TN(e,a){const r={};let i,c;for(c in a.properties)if(c!=="children"&&um.call(a.properties,c)){const d=DN(e,c,a.properties[c]);if(d){const[u,m]=d;e.tableCellAlignToStyle&&u==="align"&&typeof m=="string"&&bN.has(a.tagName)?i=m:r[u]=m}}if(i){const d=r.style||(r.style={});d[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return r}function AN(e,a){const r={};for(const i of a.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const d=i.data.estree.body[0];d.type;const u=d.expression;u.type;const m=u.properties[0];m.type,Object.assign(r,e.evaluater.evaluateExpression(m.argument))}else Ai(e,a.position);else{const c=i.name;let d;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const m=i.value.data.estree.body[0];m.type,d=e.evaluater.evaluateExpression(m.expression)}else Ai(e,a.position);else d=i.value===null?!0:i.value;r[c]=d}return r}function fm(e,a){const r=[];let i=-1;const c=e.passKeys?new Map:gN;for(;++i<a.children.length;){const d=a.children[i];let u;if(e.passKeys){const p=d.type==="element"?d.tagName:d.type==="mdxJsxFlowElement"||d.type==="mdxJsxTextElement"?d.name:void 0;if(p){const h=c.get(p)||0;u=p+"-"+h,c.set(p,h+1)}}const m=A1(e,d,u);m!==void 0&&r.push(m)}return r}function DN(e,a,r){const i=rN(e.schema,a);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=i.commaSeparated?VS(r):oN(r)),i.property==="style"){let c=typeof r=="object"?r:MN(e,String(r));return e.stylePropertyNameCase==="css"&&(c=zN(c)),["style",c]}return[e.elementAttributeNameCase==="react"&&i.space?tN[i.property]||i.property:i.attribute,r]}}function MN(e,a){try{return mN(a,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const i=r,c=new rn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw c.file=e.filePath||void 0,c.url=T1+"#cannot-parse-style-attribute",c}}function M1(e,a,r){let i;if(!r)i={type:"Literal",value:a};else if(a.includes(".")){const c=a.split(".");let d=-1,u;for(;++d<c.length;){const m=Vy(c[d])?{type:"Identifier",name:c[d]}:{type:"Literal",value:c[d]};u=u?{type:"MemberExpression",object:u,property:m,computed:!!(d&&m.type==="Literal"),optional:!1}:m}i=u}else i=Vy(a)&&!/^[a-z]/.test(a)?{type:"Identifier",name:a}:{type:"Literal",value:a};if(i.type==="Literal"){const c=i.value;return um.call(e.components,c)?e.components[c]:c}if(e.evaluater)return e.evaluater.evaluateExpression(i);Ai(e)}function Ai(e,a){const r=new rn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:a,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=T1+"#cannot-handle-mdx-estrees-without-createevaluater",r}function zN(e){const a={};let r;for(r in e)um.call(e,r)&&(a[RN(r)]=e[r]);return a}function RN(e){let a=e.replace(xN,ON);return a.slice(0,3)==="ms-"&&(a="-"+a),a}function ON(e){return"-"+e.toLowerCase()}const Cf={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},LN={};function pm(e,a){const r=LN,i=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,c=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return z1(e,i,c)}function z1(e,a,r){if($N(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(a&&"alt"in e&&e.alt)return e.alt;if("children"in e)return nb(e.children,a,r)}return Array.isArray(e)?nb(e,a,r):""}function nb(e,a,r){const i=[];let c=-1;for(;++c<e.length;)i[c]=z1(e[c],a,r);return i.join("")}function $N(e){return!!(e&&typeof e=="object")}const ab=document.createElement("i");function mm(e){const a="&"+e+";";ab.innerHTML=a;const r=ab.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===a?!1:r}function Mn(e,a,r,i){const c=e.length;let d=0,u;if(a<0?a=-a>c?0:c+a:a=a>c?c:a,r=r>0?r:0,i.length<1e4)u=Array.from(i),u.unshift(a,r),e.splice(...u);else for(r&&e.splice(a,r);d<i.length;)u=i.slice(d,d+1e4),u.unshift(a,0),e.splice(...u),d+=1e4,a+=1e4}function Gn(e,a){return e.length>0?(Mn(e,e.length,0,a),e):a}const rb={}.hasOwnProperty;function R1(e){const a={};let r=-1;for(;++r<e.length;)BN(a,e[r]);return a}function BN(e,a){let r;for(r in a){const c=(rb.call(e,r)?e[r]:void 0)||(e[r]={}),d=a[r];let u;if(d)for(u in d){rb.call(c,u)||(c[u]=[]);const m=d[u];UN(c[u],Array.isArray(m)?m:m?[m]:[])}}}function UN(e,a){let r=-1;const i=[];for(;++r<a.length;)(a[r].add==="after"?e:i).push(a[r]);Mn(e,0,0,i)}function O1(e,a){const r=Number.parseInt(e,a);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"<22>":String.fromCodePoint(r)}function aa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const on=Sr(/[A-Za-z]/),an=Sr(/[\dA-Za-z]/),HN=Sr(/[#-'*+\--9=?A-Z^-~]/);function Rc(e){return e!==null&&(e<32||e===127)}const yp=Sr(/\d/),qN=Sr(/[\dA-Fa-f]/),FN=Sr(/[!-/:-@[-`{-~]/);function Re(e){return e!==null&&e<-2}function yt(e){return e!==null&&(e<0||e===32)}function Ze(e){return e===-2||e===-1||e===32}const Qc=Sr(new RegExp("\\p{P}|\\p{S}","u")),Jr=Sr(/\s/);function Sr(e){return a;function a(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function ps(e){const a=[];let r=-1,i=0,c=0;for(;++r<e.length;){const d=e.charCodeAt(r);let u="";if(d===37&&an(e.charCodeAt(r+1))&&an(e.charCodeAt(r+2)))c=2;else if(d<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(d))||(u=String.fromCharCode(d));else if(d>55295&&d<57344){const m=e.charCodeAt(r+1);d<56320&&m>56319&&m<57344?(u=String.fromCharCode(d,m),c=1):u="<22>"}else u=String.fromCharCode(d);u&&(a.push(e.slice(i,r),encodeURIComponent(u)),i=r+c+1,u=""),c&&(r+=c,c=0)}return a.join("")+e.slice(i)}function at(e,a,r,i){const c=i?i-1:Number.POSITIVE_INFINITY;let d=0;return u;function u(p){return Ze(p)?(e.enter(r),m(p)):a(p)}function m(p){return Ze(p)&&d++<c?(e.consume(p),m):(e.exit(r),a(p))}}const IN={tokenize:YN};function YN(e){const a=e.attempt(this.parser.constructs.contentInitial,i,c);let r;return a;function i(m){if(m===null){e.consume(m);return}return e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),at(e,a,"linePrefix")}function c(m){return e.enter("paragraph"),d(m)}function d(m){const p=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=p),r=p,u(m)}function u(m){if(m===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(m);return}return Re(m)?(e.consume(m),e.exit("chunkText"),d):(e.consume(m),u)}}const GN={tokenize:VN},lb={tokenize:KN};function VN(e){const a=this,r=[];let i=0,c,d,u;return m;function m(M){if(i<r.length){const ee=r[i];return a.containerState=ee[1],e.attempt(ee[0].continuation,p,h)(M)}return h(M)}function p(M){if(i++,a.containerState._closeFlow){a.containerState._closeFlow=void 0,c&&$();const ee=a.events.length;let ne=ee,A;for(;ne--;)if(a.events[ne][0]==="exit"&&a.events[ne][1].type==="chunkFlow"){A=a.events[ne][1].end;break}C(i);let G=ee;for(;G<a.events.length;)a.events[G][1].end={...A},G++;return Mn(a.events,ne+1,0,a.events.slice(ee)),a.events.length=G,h(M)}return m(M)}function h(M){if(i===r.length){if(!c)return v(M);if(c.currentConstruct&&c.currentConstruct.concrete)return w(M);a.interrupt=!!(c.currentConstruct&&!c._gfmTableDynamicInterruptHack)}return a.containerState={},e.check(lb,y,x)(M)}function y(M){return c&&$(),C(i),v(M)}function x(M){return a.parser.lazy[a.now().line]=i!==r.length,u=a.now().offset,w(M)}function v(M){return a.containerState={},e.attempt(lb,k,w)(M)}function k(M){return i++,r.push([a.currentConstruct,a.containerState]),v(M)}function w(M){if(M===null){c&&$(),C(0),e.consume(M);return}return c=c||a.parser.flow(a.now()),e.enter("chunkFlow",{_tokenizer:c,contentType:"flow",previous:d}),T(M)}function T(M){if(M===null){j(e.exit("chunkFlow"),!0),C(0),e.consume(M);return}return Re(M)?(e.consume(M),j(e.exit("chunkFlow")),i=0,a.interrupt=void 0,m):(e.consume(M),T)}function j(M,ee){const ne=a.sliceStream(M);if(ee&&ne.push(null),M.previous=d,d&&(d.next=M),d=M,c.defineSkip(M.start),c.write(ne),a.parser.lazy[M.start.line]){let A=c.events.length;for(;A--;)if(c.events[A][1].start.offset<u&&(!c.events[A][1].end||c.events[A][1].end.offset>u))return;const G=a.events.length;let V=G,oe,Y;for(;V--;)if(a.events[V][0]==="exit"&&a.events[V][1].type==="chunkFlow"){if(oe){Y=a.events[V][1].end;break}oe=!0}for(C(i),A=G;A<a.events.length;)a.events[A][1].end={...Y},A++;Mn(a.events,V+1,0,a.events.slice(G)),a.events.length=A}}function C(M){let ee=r.length;for(;ee-- >M;){const ne=r[ee];a.containerState=ne[1],ne[0].exit.call(a,e)}r.length=M}function $(){c.write([null]),d=void 0,c=void 0,a.containerState._closeFlow=void 0}}function KN(e,a,r){return at(e,e.attempt(this.parser.constructs.document,a,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function os(e){if(e===null||yt(e)||Jr(e))return 1;if(Qc(e))return 2}function Zc(e,a,r){const i=[];let c=-1;for(;++c<e.length;){const d=e[c].resolveAll;d&&!i.includes(d)&&(a=d(a,r),i.push(d))}return a}const bp={name:"attention",resolveAll:PN,tokenize:XN};function PN(e,a){let r=-1,i,c,d,u,m,p,h,y;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(i=r;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&a.sliceSerialize(e[i][1]).charCodeAt(0)===a.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[i][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;p=e[i][1].end.offset-e[i][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const x={...e[i][1].end},v={...e[r][1].start};sb(x,-p),sb(v,p),u={type:p>1?"strongSequence":"emphasisSequence",start:x,end:{...e[i][1].end}},m={type:p>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:v},d={type:p>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[r][1].start}},c={type:p>1?"strong":"emphasis",start:{...u.start},end:{...m.end}},e[i][1].end={...u.start},e[r][1].start={...m.end},h=[],e[i][1].end.offset-e[i][1].start.offset&&(h=Gn(h,[["enter",e[i][1],a],["exit",e[i][1],a]])),h=Gn(h,[["enter",c,a],["enter",u,a],["exit",u,a],["enter",d,a]]),h=Gn(h,Zc(a.parser.constructs.insideSpan.null,e.slice(i+1,r),a)),h=Gn(h,[["exit",d,a],["enter",m,a],["exit",m,a],["exit",c,a]]),e[r][1].end.offset-e[r][1].start.offset?(y=2,h=Gn(h,[["enter",e[r][1],a],["exit",e[r][1],a]])):y=0,Mn(e,i-1,r-i+3,h),r=i+h.length-y-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function XN(e,a){const r=this.parser.constructs.attentionMarkers.null,i=this.previous,c=os(i);let d;return u;function u(p){return d=p,e.enter("attentionSequence"),m(p)}function m(p){if(p===d)return e.consume(p),m;const h=e.exit("attentionSequence"),y=os(p),x=!y||y===2&&c||r.includes(p),v=!c||c===2&&y||r.includes(i);return h._open=!!(d===42?x:x&&(c||!v)),h._close=!!(d===42?v:v&&(y||!x)),a(p)}}function sb(e,a){e.column+=a,e.offset+=a,e._bufferIndex+=a}const QN={name:"autolink",tokenize:ZN};function ZN(e,a,r){let i=0;return c;function c(k){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(k),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),d}function d(k){return on(k)?(e.consume(k),u):k===64?r(k):h(k)}function u(k){return k===43||k===45||k===46||an(k)?(i=1,m(k)):h(k)}function m(k){return k===58?(e.consume(k),i=0,p):(k===43||k===45||k===46||an(k))&&i++<32?(e.consume(k),m):(i=0,h(k))}function p(k){return k===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(k),e.exit("autolinkMarker"),e.exit("autolink"),a):k===null||k===32||k===60||Rc(k)?r(k):(e.consume(k),p)}function h(k){return k===64?(e.consume(k),y):HN(k)?(e.consume(k),h):r(k)}function y(k){return an(k)?x(k):r(k)}function x(k){return k===46?(e.consume(k),i=0,y):k===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(k),e.exit("autolinkMarker"),e.exit("autolink"),a):v(k)}function v(k){if((k===45||an(k))&&i++<63){const w=k===45?v:x;return e.consume(k),w}return r(k)}}const Hi={partial:!0,tokenize:JN};function JN(e,a,r){return i;function i(d){return Ze(d)?at(e,c,"linePrefix")(d):c(d)}function c(d){return d===null||Re(d)?a(d):r(d)}}const L1={continuation:{tokenize:eC},exit:tC,name:"blockQuote",tokenize:WN};function WN(e,a,r){const i=this;return c;function c(u){if(u===62){const m=i.containerState;return m.open||(e.enter("blockQuote",{_container:!0}),m.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),d}return r(u)}function d(u){return Ze(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),a):(e.exit("blockQuotePrefix"),a(u))}}function eC(e,a,r){const i=this;return c;function c(u){return Ze(u)?at(e,d,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):d(u)}function d(u){return e.attempt(L1,a,r)(u)}}function tC(e){e.exit("blockQuote")}const $1={name:"characterEscape",tokenize:nC};function nC(e,a,r){return i;function i(d){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(d),e.exit("escapeMarker"),c}function c(d){return FN(d)?(e.enter("characterEscapeValue"),e.consume(d),e.exit("characterEscapeValue"),e.exit("characterEscape"),a):r(d)}}const B1={name:"characterReference",tokenize:aC};function aC(e,a,r){const i=this;let c=0,d,u;return m;function m(x){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),p}function p(x){return x===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(x),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),d=31,u=an,y(x))}function h(x){return x===88||x===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(x),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),d=6,u=qN,y):(e.enter("characterReferenceValue"),d=7,u=yp,y(x))}function y(x){if(x===59&&c){const v=e.exit("characterReferenceValue");return u===an&&!mm(i.sliceSerialize(v))?r(x):(e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),e.exit("characterReference"),a)}return u(x)&&c++<d?(e.consume(x),y):r(x)}}const ib={partial:!0,tokenize:lC},ob={concrete:!0,name:"codeFenced",tokenize:rC};function rC(e,a,r){const i=this,c={partial:!0,tokenize:ne};let d=0,u=0,m;return p;function p(A){return h(A)}function h(A){const G=i.events[i.events.length-1];return d=G&&G[1].type==="linePrefix"?G[2].sliceSerialize(G[1],!0).length:0,m=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(A)}function y(A){return A===m?(u++,e.consume(A),y):u<3?r(A):(e.exit("codeFencedFenceSequence"),Ze(A)?at(e,x,"whitespace")(A):x(A))}function x(A){return A===null||Re(A)?(e.exit("codeFencedFence"),i.interrupt?a(A):e.check(ib,T,ee)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(A))}function v(A){return A===null||Re(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),x(A)):Ze(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),at(e,k,"whitespace")(A)):A===96&&A===m?r(A):(e.consume(A),v)}function k(A){return A===null||Re(A)?x(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(A))}function w(A){return A===null||Re(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),x(A)):A===96&&A===m?r(A):(e.consume(A),w)}function T(A){return e.attempt(c,ee,j)(A)}function j(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),C}function C(A){return d>0&&Ze(A)?at(e,$,"linePrefix",d+1)(A):$(A)}function $(A){return A===null||Re(A)?e.check(ib,T,ee)(A):(e.enter("codeFlowValue"),M(A))}function M(A){return A===null||Re(A)?(e.exit("codeFlowValue"),$(A)):(e.consume(A),M)}function ee(A){return e.exit("codeFenced"),a(A)}function ne(A,G,V){let oe=0;return Y;function Y(B){return A.enter("lineEnding"),A.consume(B),A.exit("lineEnding"),F}function F(B){return A.enter("codeFencedFence"),Ze(B)?at(A,I,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):I(B)}function I(B){return B===m?(A.enter("codeFencedFenceSequence"),Q(B)):V(B)}function Q(B){return B===m?(oe++,A.consume(B),Q):oe>=u?(A.exit("codeFencedFenceSequence"),Ze(B)?at(A,le,"whitespace")(B):le(B)):V(B)}function le(B){return B===null||Re(B)?(A.exit("codeFencedFence"),G(B)):V(B)}}}function lC(e,a,r){const i=this;return c;function c(u){return u===null?r(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),d)}function d(u){return i.parser.lazy[i.now().line]?r(u):a(u)}}const Ef={name:"codeIndented",tokenize:iC},sC={partial:!0,tokenize:oC};function iC(e,a,r){const i=this;return c;function c(h){return e.enter("codeIndented"),at(e,d,"linePrefix",5)(h)}function d(h){const y=i.events[i.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?u(h):r(h)}function u(h){return h===null?p(h):Re(h)?e.attempt(sC,u,p)(h):(e.enter("codeFlowValue"),m(h))}function m(h){return h===null||Re(h)?(e.exit("codeFlowValue"),u(h)):(e.consume(h),m)}function p(h){return e.exit("codeIndented"),a(h)}}function oC(e,a,r){const i=this;return c;function c(u){return i.parser.lazy[i.now().line]?r(u):Re(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),c):at(e,d,"linePrefix",5)(u)}function d(u){const m=i.events[i.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?a(u):Re(u)?c(u):r(u)}}const cC={name:"codeText",previous:dC,resolve:uC,tokenize:fC};function uC(e){let a=e.length-4,r=3,i,c;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[a][1].type==="lineEnding"||e[a][1].type==="space")){for(i=r;++i<a;)if(e[i][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[a][1].type="codeTextPadding",r+=2,a-=2;break}}for(i=r-1,a++;++i<=a;)c===void 0?i!==a&&e[i][1].type!=="lineEnding"&&(c=i):(i===a||e[i][1].type==="lineEnding")&&(e[c][1].type="codeTextData",i!==c+2&&(e[c][1].end=e[i-1][1].end,e.splice(c+2,i-c-2),a-=i-c-2,i=c+2),c=void 0);return e}function dC(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function fC(e,a,r){let i=0,c,d;return u;function u(x){return e.enter("codeText"),e.enter("codeTextSequence"),m(x)}function m(x){return x===96?(e.consume(x),i++,m):(e.exit("codeTextSequence"),p(x))}function p(x){return x===null?r(x):x===32?(e.enter("space"),e.consume(x),e.exit("space"),p):x===96?(d=e.enter("codeTextSequence"),c=0,y(x)):Re(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),p):(e.enter("codeTextData"),h(x))}function h(x){return x===null||x===32||x===96||Re(x)?(e.exit("codeTextData"),p(x)):(e.consume(x),h)}function y(x){return x===96?(e.consume(x),c++,y):c===i?(e.exit("codeTextSequence"),e.exit("codeText"),a(x)):(d.type="codeTextData",h(x))}}class pC{constructor(a){this.left=a?[...a]:[],this.right=[]}get(a){if(a<0||a>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+a+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return a<this.left.length?this.left[a]:this.right[this.right.length-a+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(a,r){const i=r??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(a,i):a>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-a+this.left.length).reverse():this.left.slice(a).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(a,r,i){const c=r||0;this.setCursor(Math.trunc(a));const d=this.right.splice(this.right.length-c,Number.POSITIVE_INFINITY);return i&&hi(this.left,i),d.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(a){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(a)}pushMany(a){this.setCursor(Number.POSITIVE_INFINITY),hi(this.left,a)}unshift(a){this.setCursor(0),this.right.push(a)}unshiftMany(a){this.setCursor(0),hi(this.right,a.reverse())}setCursor(a){if(!(a===this.left.length||a>this.left.length&&this.right.length===0||a<0&&this.left.length===0))if(a<this.left.length){const r=this.left.splice(a,Number.POSITIVE_INFINITY);hi(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-a,Number.POSITIVE_INFINITY);hi(this.left,r.reverse())}}}function hi(e,a){let r=0;if(a.length<1e4)e.push(...a);else for(;r<a.length;)e.push(...a.slice(r,r+1e4)),r+=1e4}function U1(e){const a={};let r=-1,i,c,d,u,m,p,h;const y=new pC(e);for(;++r<y.length;){for(;r in a;)r=a[r];if(i=y.get(r),r&&i[1].type==="chunkFlow"&&y.get(r-1)[1].type==="listItemPrefix"&&(p=i[1]._tokenizer.events,d=0,d<p.length&&p[d][1].type==="lineEndingBlank"&&(d+=2),d<p.length&&p[d][1].type==="content"))for(;++d<p.length&&p[d][1].type!=="content";)p[d][1].type==="chunkText"&&(p[d][1]._isInFirstContentOfListItem=!0,d++);if(i[0]==="enter")i[1].contentType&&(Object.assign(a,mC(y,r)),r=a[r],h=!0);else if(i[1]._container){for(d=r,c=void 0;d--;)if(u=y.get(d),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(c&&(y.get(c)[1].type="lineEndingBlank"),u[1].type="lineEnding",c=d);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;c&&(i[1].end={...y.get(c)[1].start},m=y.slice(c,r),m.unshift(i),y.splice(c,r-c+1,m))}}return Mn(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!h}function mC(e,a){const r=e.get(a)[1],i=e.get(a)[2];let c=a-1;const d=[];let u=r._tokenizer;u||(u=i.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const m=u.events,p=[],h={};let y,x,v=-1,k=r,w=0,T=0;const j=[T];for(;k;){for(;e.get(++c)[1]!==k;);d.push(c),k._tokenizer||(y=i.sliceStream(k),k.next||y.push(null),x&&u.defineSkip(k.start),k._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(y),k._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),x=k,k=k.next}for(k=r;++v<m.length;)m[v][0]==="exit"&&m[v-1][0]==="enter"&&m[v][1].type===m[v-1][1].type&&m[v][1].start.line!==m[v][1].end.line&&(T=v+1,j.push(T),k._tokenizer=void 0,k.previous=void 0,k=k.next);for(u.events=[],k?(k._tokenizer=void 0,k.previous=void 0):j.pop(),v=j.length;v--;){const C=m.slice(j[v],j[v+1]),$=d.pop();p.push([$,$+C.length-1]),e.splice($,2,C)}for(p.reverse(),v=-1;++v<p.length;)h[w+p[v][0]]=w+p[v][1],w+=p[v][1]-p[v][0]-1;return h}const hC={resolve:xC,tokenize:yC},gC={partial:!0,tokenize:bC};function xC(e){return U1(e),e}function yC(e,a){let r;return i;function i(m){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),c(m)}function c(m){return m===null?d(m):Re(m)?e.check(gC,u,d)(m):(e.consume(m),c)}function d(m){return e.exit("chunkContent"),e.exit("content"),a(m)}function u(m){return e.consume(m),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,c}}function bC(e,a,r){const i=this;return c;function c(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),at(e,d,"linePrefix")}function d(u){if(u===null||Re(u))return r(u);const m=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?a(u):e.interrupt(i.parser.constructs.flow,r,a)(u)}}function H1(e,a,r,i,c,d,u,m,p){const h=p||Number.POSITIVE_INFINITY;let y=0;return x;function x(C){return C===60?(e.enter(i),e.enter(c),e.enter(d),e.consume(C),e.exit(d),v):C===null||C===32||C===41||Rc(C)?r(C):(e.enter(i),e.enter(u),e.enter(m),e.enter("chunkString",{contentType:"string"}),T(C))}function v(C){return C===62?(e.enter(d),e.consume(C),e.exit(d),e.exit(c),e.exit(i),a):(e.enter(m),e.enter("chunkString",{contentType:"string"}),k(C))}function k(C){return C===62?(e.exit("chunkString"),e.exit(m),v(C)):C===null||C===60||Re(C)?r(C):(e.consume(C),C===92?w:k)}function w(C){return C===60||C===62||C===92?(e.consume(C),k):k(C)}function T(C){return!y&&(C===null||C===41||yt(C))?(e.exit("chunkString"),e.exit(m),e.exit(u),e.exit(i),a(C)):y<h&&C===40?(e.consume(C),y++,T):C===41?(e.consume(C),y--,T):C===null||C===32||C===40||Rc(C)?r(C):(e.consume(C),C===92?j:T)}function j(C){return C===40||C===41||C===92?(e.consume(C),T):T(C)}}function q1(e,a,r,i,c,d){const u=this;let m=0,p;return h;function h(k){return e.enter(i),e.enter(c),e.consume(k),e.exit(c),e.enter(d),y}function y(k){return m>999||k===null||k===91||k===93&&!p||k===94&&!m&&"_hiddenFootnoteSupport"in u.parser.constructs?r(k):k===93?(e.exit(d),e.enter(c),e.consume(k),e.exit(c),e.exit(i),a):Re(k)?(e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),y):(e.enter("chunkString",{contentType:"string"}),x(k))}function x(k){return k===null||k===91||k===93||Re(k)||m++>999?(e.exit("chunkString"),y(k)):(e.consume(k),p||(p=!Ze(k)),k===92?v:x)}function v(k){return k===91||k===92||k===93?(e.consume(k),m++,x):x(k)}}function F1(e,a,r,i,c,d){let u;return m;function m(v){return v===34||v===39||v===40?(e.enter(i),e.enter(c),e.consume(v),e.exit(c),u=v===40?41:v,p):r(v)}function p(v){return v===u?(e.enter(c),e.consume(v),e.exit(c),e.exit(i),a):(e.enter(d),h(v))}function h(v){return v===u?(e.exit(d),p(u)):v===null?r(v):Re(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),at(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(v))}function y(v){return v===u||v===null||Re(v)?(e.exit("chunkString"),h(v)):(e.consume(v),v===92?x:y)}function x(v){return v===u||v===92?(e.consume(v),y):y(v)}}function _i(e,a){let r;return i;function i(c){return Re(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),r=!0,i):Ze(c)?at(e,i,r?"linePrefix":"lineSuffix")(c):a(c)}}const vC={name:"definition",tokenize:_C},kC={partial:!0,tokenize:wC};function _C(e,a,r){const i=this;let c;return d;function d(k){return e.enter("definition"),u(k)}function u(k){return q1.call(i,e,m,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(k)}function m(k){return c=aa(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),p):r(k)}function p(k){return yt(k)?_i(e,h)(k):h(k)}function h(k){return H1(e,y,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(k)}function y(k){return e.attempt(kC,x,x)(k)}function x(k){return Ze(k)?at(e,v,"whitespace")(k):v(k)}function v(k){return k===null||Re(k)?(e.exit("definition"),i.parser.defined.push(c),a(k)):r(k)}}function wC(e,a,r){return i;function i(m){return yt(m)?_i(e,c)(m):r(m)}function c(m){return F1(e,d,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(m)}function d(m){return Ze(m)?at(e,u,"whitespace")(m):u(m)}function u(m){return m===null||Re(m)?a(m):r(m)}}const jC={name:"hardBreakEscape",tokenize:SC};function SC(e,a,r){return i;function i(d){return e.enter("hardBreakEscape"),e.consume(d),c}function c(d){return Re(d)?(e.exit("hardBreakEscape"),a(d)):r(d)}}const NC={name:"headingAtx",resolve:CC,tokenize:EC};function CC(e,a){let r=e.length-2,i=3,c,d;return e[i][1].type==="whitespace"&&(i+=2),r-2>i&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(i===r-1||r-4>i&&e[r-2][1].type==="whitespace")&&(r-=i+1===r?2:4),r>i&&(c={type:"atxHeadingText",start:e[i][1].start,end:e[r][1].end},d={type:"chunkText",start:e[i][1].start,end:e[r][1].end,contentType:"text"},Mn(e,i,r-i+1,[["enter",c,a],["enter",d,a],["exit",d,a],["exit",c,a]])),e}function EC(e,a,r){let i=0;return c;function c(y){return e.enter("atxHeading"),d(y)}function d(y){return e.enter("atxHeadingSequence"),u(y)}function u(y){return y===35&&i++<6?(e.consume(y),u):y===null||yt(y)?(e.exit("atxHeadingSequence"),m(y)):r(y)}function m(y){return y===35?(e.enter("atxHeadingSequence"),p(y)):y===null||Re(y)?(e.exit("atxHeading"),a(y)):Ze(y)?at(e,m,"whitespace")(y):(e.enter("atxHeadingText"),h(y))}function p(y){return y===35?(e.consume(y),p):(e.exit("atxHeadingSequence"),m(y))}function h(y){return y===null||y===35||yt(y)?(e.exit("atxHeadingText"),m(y)):(e.consume(y),h)}}const TC=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],cb=["pre","script","style","textarea"],AC={concrete:!0,name:"htmlFlow",resolveTo:zC,tokenize:RC},DC={partial:!0,tokenize:LC},MC={partial:!0,tokenize:OC};function zC(e){let a=e.length;for(;a--&&!(e[a][0]==="enter"&&e[a][1].type==="htmlFlow"););return a>1&&e[a-2][1].type==="linePrefix"&&(e[a][1].start=e[a-2][1].start,e[a+1][1].start=e[a-2][1].start,e.splice(a-2,2)),e}function RC(e,a,r){const i=this;let c,d,u,m,p;return h;function h(E){return y(E)}function y(E){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(E),x}function x(E){return E===33?(e.consume(E),v):E===47?(e.consume(E),d=!0,T):E===63?(e.consume(E),c=3,i.interrupt?a:N):on(E)?(e.consume(E),u=String.fromCharCode(E),j):r(E)}function v(E){return E===45?(e.consume(E),c=2,k):E===91?(e.consume(E),c=5,m=0,w):on(E)?(e.consume(E),c=4,i.interrupt?a:N):r(E)}function k(E){return E===45?(e.consume(E),i.interrupt?a:N):r(E)}function w(E){const pe="CDATA[";return E===pe.charCodeAt(m++)?(e.consume(E),m===pe.length?i.interrupt?a:I:w):r(E)}function T(E){return on(E)?(e.consume(E),u=String.fromCharCode(E),j):r(E)}function j(E){if(E===null||E===47||E===62||yt(E)){const pe=E===47,ke=u.toLowerCase();return!pe&&!d&&cb.includes(ke)?(c=1,i.interrupt?a(E):I(E)):TC.includes(u.toLowerCase())?(c=6,pe?(e.consume(E),C):i.interrupt?a(E):I(E)):(c=7,i.interrupt&&!i.parser.lazy[i.now().line]?r(E):d?$(E):M(E))}return E===45||an(E)?(e.consume(E),u+=String.fromCharCode(E),j):r(E)}function C(E){return E===62?(e.consume(E),i.interrupt?a:I):r(E)}function $(E){return Ze(E)?(e.consume(E),$):Y(E)}function M(E){return E===47?(e.consume(E),Y):E===58||E===95||on(E)?(e.consume(E),ee):Ze(E)?(e.consume(E),M):Y(E)}function ee(E){return E===45||E===46||E===58||E===95||an(E)?(e.consume(E),ee):ne(E)}function ne(E){return E===61?(e.consume(E),A):Ze(E)?(e.consume(E),ne):M(E)}function A(E){return E===null||E===60||E===61||E===62||E===96?r(E):E===34||E===39?(e.consume(E),p=E,G):Ze(E)?(e.consume(E),A):V(E)}function G(E){return E===p?(e.consume(E),p=null,oe):E===null||Re(E)?r(E):(e.consume(E),G)}function V(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||yt(E)?ne(E):(e.consume(E),V)}function oe(E){return E===47||E===62||Ze(E)?M(E):r(E)}function Y(E){return E===62?(e.consume(E),F):r(E)}function F(E){return E===null||Re(E)?I(E):Ze(E)?(e.consume(E),F):r(E)}function I(E){return E===45&&c===2?(e.consume(E),L):E===60&&c===1?(e.consume(E),q):E===62&&c===4?(e.consume(E),z):E===63&&c===3?(e.consume(E),N):E===93&&c===5?(e.consume(E),ge):Re(E)&&(c===6||c===7)?(e.exit("htmlFlowData"),e.check(DC,K,Q)(E)):E===null||Re(E)?(e.exit("htmlFlowData"),Q(E)):(e.consume(E),I)}function Q(E){return e.check(MC,le,K)(E)}function le(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),B}function B(E){return E===null||Re(E)?Q(E):(e.enter("htmlFlowData"),I(E))}function L(E){return E===45?(e.consume(E),N):I(E)}function q(E){return E===47?(e.consume(E),u="",ce):I(E)}function ce(E){if(E===62){const pe=u.toLowerCase();return cb.includes(pe)?(e.consume(E),z):I(E)}return on(E)&&u.length<8?(e.consume(E),u+=String.fromCharCode(E),ce):I(E)}function ge(E){return E===93?(e.consume(E),N):I(E)}function N(E){return E===62?(e.consume(E),z):E===45&&c===2?(e.consume(E),N):I(E)}function z(E){return E===null||Re(E)?(e.exit("htmlFlowData"),K(E)):(e.consume(E),z)}function K(E){return e.exit("htmlFlow"),a(E)}}function OC(e,a,r){const i=this;return c;function c(u){return Re(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),d):r(u)}function d(u){return i.parser.lazy[i.now().line]?r(u):a(u)}}function LC(e,a,r){return i;function i(c){return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),e.attempt(Hi,a,r)}}const $C={name:"htmlText",tokenize:BC};function BC(e,a,r){const i=this;let c,d,u;return m;function m(N){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(N),p}function p(N){return N===33?(e.consume(N),h):N===47?(e.consume(N),ne):N===63?(e.consume(N),M):on(N)?(e.consume(N),V):r(N)}function h(N){return N===45?(e.consume(N),y):N===91?(e.consume(N),d=0,w):on(N)?(e.consume(N),$):r(N)}function y(N){return N===45?(e.consume(N),k):r(N)}function x(N){return N===null?r(N):N===45?(e.consume(N),v):Re(N)?(u=x,q(N)):(e.consume(N),x)}function v(N){return N===45?(e.consume(N),k):x(N)}function k(N){return N===62?L(N):N===45?v(N):x(N)}function w(N){const z="CDATA[";return N===z.charCodeAt(d++)?(e.consume(N),d===z.length?T:w):r(N)}function T(N){return N===null?r(N):N===93?(e.consume(N),j):Re(N)?(u=T,q(N)):(e.consume(N),T)}function j(N){return N===93?(e.consume(N),C):T(N)}function C(N){return N===62?L(N):N===93?(e.consume(N),C):T(N)}function $(N){return N===null||N===62?L(N):Re(N)?(u=$,q(N)):(e.consume(N),$)}function M(N){return N===null?r(N):N===63?(e.consume(N),ee):Re(N)?(u=M,q(N)):(e.consume(N),M)}function ee(N){return N===62?L(N):M(N)}function ne(N){return on(N)?(e.consume(N),A):r(N)}function A(N){return N===45||an(N)?(e.consume(N),A):G(N)}function G(N){return Re(N)?(u=G,q(N)):Ze(N)?(e.consume(N),G):L(N)}function V(N){return N===45||an(N)?(e.consume(N),V):N===47||N===62||yt(N)?oe(N):r(N)}function oe(N){return N===47?(e.consume(N),L):N===58||N===95||on(N)?(e.consume(N),Y):Re(N)?(u=oe,q(N)):Ze(N)?(e.consume(N),oe):L(N)}function Y(N){return N===45||N===46||N===58||N===95||an(N)?(e.consume(N),Y):F(N)}function F(N){return N===61?(e.consume(N),I):Re(N)?(u=F,q(N)):Ze(N)?(e.consume(N),F):oe(N)}function I(N){return N===null||N===60||N===61||N===62||N===96?r(N):N===34||N===39?(e.consume(N),c=N,Q):Re(N)?(u=I,q(N)):Ze(N)?(e.consume(N),I):(e.consume(N),le)}function Q(N){return N===c?(e.consume(N),c=void 0,B):N===null?r(N):Re(N)?(u=Q,q(N)):(e.consume(N),Q)}function le(N){return N===null||N===34||N===39||N===60||N===61||N===96?r(N):N===47||N===62||yt(N)?oe(N):(e.consume(N),le)}function B(N){return N===47||N===62||yt(N)?oe(N):r(N)}function L(N){return N===62?(e.consume(N),e.exit("htmlTextData"),e.exit("htmlText"),a):r(N)}function q(N){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),ce}function ce(N){return Ze(N)?at(e,ge,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):ge(N)}function ge(N){return e.enter("htmlTextData"),u(N)}}const hm={name:"labelEnd",resolveAll:FC,resolveTo:IC,tokenize:YC},UC={tokenize:GC},HC={tokenize:VC},qC={tokenize:KC};function FC(e){let a=-1;const r=[];for(;++a<e.length;){const i=e[a][1];if(r.push(e[a]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const c=i.type==="labelImage"?4:2;i.type="data",a+=c}}return e.length!==r.length&&Mn(e,0,e.length,r),e}function IC(e,a){let r=e.length,i=0,c,d,u,m;for(;r--;)if(c=e[r][1],d){if(c.type==="link"||c.type==="labelLink"&&c._inactive)break;e[r][0]==="enter"&&c.type==="labelLink"&&(c._inactive=!0)}else if(u){if(e[r][0]==="enter"&&(c.type==="labelImage"||c.type==="labelLink")&&!c._balanced&&(d=r,c.type!=="labelLink")){i=2;break}}else c.type==="labelEnd"&&(u=r);const p={type:e[d][1].type==="labelLink"?"link":"image",start:{...e[d][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[d][1].start},end:{...e[u][1].end}},y={type:"labelText",start:{...e[d+i+2][1].end},end:{...e[u-2][1].start}};return m=[["enter",p,a],["enter",h,a]],m=Gn(m,e.slice(d+1,d+i+3)),m=Gn(m,[["enter",y,a]]),m=Gn(m,Zc(a.parser.constructs.insideSpan.null,e.slice(d+i+4,u-3),a)),m=Gn(m,[["exit",y,a],e[u-2],e[u-1],["exit",h,a]]),m=Gn(m,e.slice(u+1)),m=Gn(m,[["exit",p,a]]),Mn(e,d,e.length,m),e}function YC(e,a,r){const i=this;let c=i.events.length,d,u;for(;c--;)if((i.events[c][1].type==="labelImage"||i.events[c][1].type==="labelLink")&&!i.events[c][1]._balanced){d=i.events[c][1];break}return m;function m(v){return d?d._inactive?x(v):(u=i.parser.defined.includes(aa(i.sliceSerialize({start:d.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),p):r(v)}function p(v){return v===40?e.attempt(UC,y,u?y:x)(v):v===91?e.attempt(HC,y,u?h:x)(v):u?y(v):x(v)}function h(v){return e.attempt(qC,y,x)(v)}function y(v){return a(v)}function x(v){return d._balanced=!0,r(v)}}function GC(e,a,r){return i;function i(x){return e.enter("resource"),e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),c}function c(x){return yt(x)?_i(e,d)(x):d(x)}function d(x){return x===41?y(x):H1(e,u,m,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(x)}function u(x){return yt(x)?_i(e,p)(x):y(x)}function m(x){return r(x)}function p(x){return x===34||x===39||x===40?F1(e,h,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(x):y(x)}function h(x){return yt(x)?_i(e,y)(x):y(x)}function y(x){return x===41?(e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),e.exit("resource"),a):r(x)}}function VC(e,a,r){const i=this;return c;function c(m){return q1.call(i,e,d,u,"reference","referenceMarker","referenceString")(m)}function d(m){return i.parser.defined.includes(aa(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?a(m):r(m)}function u(m){return r(m)}}function KC(e,a,r){return i;function i(d){return e.enter("reference"),e.enter("referenceMarker"),e.consume(d),e.exit("referenceMarker"),c}function c(d){return d===93?(e.enter("referenceMarker"),e.consume(d),e.exit("referenceMarker"),e.exit("reference"),a):r(d)}}const PC={name:"labelStartImage",resolveAll:hm.resolveAll,tokenize:XC};function XC(e,a,r){const i=this;return c;function c(m){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(m),e.exit("labelImageMarker"),d}function d(m){return m===91?(e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelImage"),u):r(m)}function u(m){return m===94&&"_hiddenFootnoteSupport"in i.parser.constructs?r(m):a(m)}}const QC={name:"labelStartLink",resolveAll:hm.resolveAll,tokenize:ZC};function ZC(e,a,r){const i=this;return c;function c(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),d}function d(u){return u===94&&"_hiddenFootnoteSupport"in i.parser.constructs?r(u):a(u)}}const Tf={name:"lineEnding",tokenize:JC};function JC(e,a){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),at(e,a,"linePrefix")}}const Cc={name:"thematicBreak",tokenize:WC};function WC(e,a,r){let i=0,c;return d;function d(h){return e.enter("thematicBreak"),u(h)}function u(h){return c=h,m(h)}function m(h){return h===c?(e.enter("thematicBreakSequence"),p(h)):i>=3&&(h===null||Re(h))?(e.exit("thematicBreak"),a(h)):r(h)}function p(h){return h===c?(e.consume(h),i++,p):(e.exit("thematicBreakSequence"),Ze(h)?at(e,m,"whitespace")(h):m(h))}}const xn={continuation:{tokenize:a3},exit:l3,name:"list",tokenize:n3},e3={partial:!0,tokenize:s3},t3={partial:!0,tokenize:r3};function n3(e,a,r){const i=this,c=i.events[i.events.length-1];let d=c&&c[1].type==="linePrefix"?c[2].sliceSerialize(c[1],!0).length:0,u=0;return m;function m(k){const w=i.containerState.type||(k===42||k===43||k===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!i.containerState.marker||k===i.containerState.marker:yp(k)){if(i.containerState.type||(i.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),k===42||k===45?e.check(Cc,r,h)(k):h(k);if(!i.interrupt||k===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),p(k)}return r(k)}function p(k){return yp(k)&&++u<10?(e.consume(k),p):(!i.interrupt||u<2)&&(i.containerState.marker?k===i.containerState.marker:k===41||k===46)?(e.exit("listItemValue"),h(k)):r(k)}function h(k){return e.enter("listItemMarker"),e.consume(k),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||k,e.check(Hi,i.interrupt?r:y,e.attempt(e3,v,x))}function y(k){return i.containerState.initialBlankLine=!0,d++,v(k)}function x(k){return Ze(k)?(e.enter("listItemPrefixWhitespace"),e.consume(k),e.exit("listItemPrefixWhitespace"),v):r(k)}function v(k){return i.containerState.size=d+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,a(k)}}function a3(e,a,r){const i=this;return i.containerState._closeFlow=void 0,e.check(Hi,c,d);function c(m){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,at(e,a,"listItemIndent",i.containerState.size+1)(m)}function d(m){return i.containerState.furtherBlankLines||!Ze(m)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,u(m)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(t3,a,u)(m))}function u(m){return i.containerState._closeFlow=!0,i.interrupt=void 0,at(e,e.attempt(xn,a,r),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m)}}function r3(e,a,r){const i=this;return at(e,c,"listItemIndent",i.containerState.size+1);function c(d){const u=i.events[i.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===i.containerState.size?a(d):r(d)}}function l3(e){e.exit(this.containerState.type)}function s3(e,a,r){const i=this;return at(e,c,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function c(d){const u=i.events[i.events.length-1];return!Ze(d)&&u&&u[1].type==="listItemPrefixWhitespace"?a(d):r(d)}}const ub={name:"setextUnderline",resolveTo:i3,tokenize:o3};function i3(e,a){let r=e.length,i,c,d;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){i=r;break}e[r][1].type==="paragraph"&&(c=r)}else e[r][1].type==="content"&&e.splice(r,1),!d&&e[r][1].type==="definition"&&(d=r);const u={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[c][1].type="setextHeadingText",d?(e.splice(c,0,["enter",u,a]),e.splice(d+1,0,["exit",e[i][1],a]),e[i][1].end={...e[d][1].end}):e[i][1]=u,e.push(["exit",u,a]),e}function o3(e,a,r){const i=this;let c;return d;function d(h){let y=i.events.length,x;for(;y--;)if(i.events[y][1].type!=="lineEnding"&&i.events[y][1].type!=="linePrefix"&&i.events[y][1].type!=="content"){x=i.events[y][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||x)?(e.enter("setextHeadingLine"),c=h,u(h)):r(h)}function u(h){return e.enter("setextHeadingLineSequence"),m(h)}function m(h){return h===c?(e.consume(h),m):(e.exit("setextHeadingLineSequence"),Ze(h)?at(e,p,"lineSuffix")(h):p(h))}function p(h){return h===null||Re(h)?(e.exit("setextHeadingLine"),a(h)):r(h)}}const c3={tokenize:u3};function u3(e){const a=this,r=e.attempt(Hi,i,e.attempt(this.parser.constructs.flowInitial,c,at(e,e.attempt(this.parser.constructs.flow,c,e.attempt(hC,c)),"linePrefix")));return r;function i(d){if(d===null){e.consume(d);return}return e.enter("lineEndingBlank"),e.consume(d),e.exit("lineEndingBlank"),a.currentConstruct=void 0,r}function c(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),a.currentConstruct=void 0,r}}const d3={resolveAll:Y1()},f3=I1("string"),p3=I1("text");function I1(e){return{resolveAll:Y1(e==="text"?m3:void 0),tokenize:a};function a(r){const i=this,c=this.parser.constructs[e],d=r.attempt(c,u,m);return u;function u(y){return h(y)?d(y):m(y)}function m(y){if(y===null){r.consume(y);return}return r.enter("data"),r.consume(y),p}function p(y){return h(y)?(r.exit("data"),d(y)):(r.consume(y),p)}function h(y){if(y===null)return!0;const x=c[y];let v=-1;if(x)for(;++v<x.length;){const k=x[v];if(!k.previous||k.previous.call(i,i.previous))return!0}return!1}}}function Y1(e){return a;function a(r,i){let c=-1,d;for(;++c<=r.length;)d===void 0?r[c]&&r[c][1].type==="data"&&(d=c,c++):(!r[c]||r[c][1].type!=="data")&&(c!==d+2&&(r[d][1].end=r[c-1][1].end,r.splice(d+2,c-d-2),c=d+2),d=void 0);return e?e(r,i):r}}function m3(e,a){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const i=e[r-1][1],c=a.sliceStream(i);let d=c.length,u=-1,m=0,p;for(;d--;){const h=c[d];if(typeof h=="string"){for(u=h.length;h.charCodeAt(u-1)===32;)m++,u--;if(u)break;u=-1}else if(h===-2)p=!0,m++;else if(h!==-1){d++;break}}if(a._contentTypeTextTrailing&&r===e.length&&(m=0),m){const h={type:r===e.length||p||m<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:d?u:i.start._bufferIndex+u,_index:i.start._index+d,line:i.end.line,column:i.end.column-m,offset:i.end.offset-m},end:{...i.end}};i.end={...h.start},i.start.offset===i.end.offset?Object.assign(i,h):(e.splice(r,0,["enter",h,a],["exit",h,a]),r+=2)}r++}return e}const h3={42:xn,43:xn,45:xn,48:xn,49:xn,50:xn,51:xn,52:xn,53:xn,54:xn,55:xn,56:xn,57:xn,62:L1},g3={91:vC},x3={[-2]:Ef,[-1]:Ef,32:Ef},y3={35:NC,42:Cc,45:[ub,Cc],60:AC,61:ub,95:Cc,96:ob,126:ob},b3={38:B1,92:$1},v3={[-5]:Tf,[-4]:Tf,[-3]:Tf,33:PC,38:B1,42:bp,60:[QN,$C],91:QC,92:[jC,$1],93:hm,95:bp,96:cC},k3={null:[bp,d3]},_3={null:[42,95]},w3={null:[]},j3=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:_3,contentInitial:g3,disable:w3,document:h3,flow:y3,flowInitial:x3,insideSpan:k3,string:b3,text:v3},Symbol.toStringTag,{value:"Module"}));function S3(e,a,r){let i={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const c={},d=[];let u=[],m=[];const p={attempt:G(ne),check:G(A),consume:$,enter:M,exit:ee,interrupt:G(A,{interrupt:!0})},h={code:null,containerState:{},defineSkip:T,events:[],now:w,parser:e,previous:null,sliceSerialize:v,sliceStream:k,write:x};let y=a.tokenize.call(h,p);return a.resolveAll&&d.push(a),h;function x(F){return u=Gn(u,F),j(),u[u.length-1]!==null?[]:(V(a,0),h.events=Zc(d,h.events,h),h.events)}function v(F,I){return C3(k(F),I)}function k(F){return N3(u,F)}function w(){const{_bufferIndex:F,_index:I,line:Q,column:le,offset:B}=i;return{_bufferIndex:F,_index:I,line:Q,column:le,offset:B}}function T(F){c[F.line]=F.column,Y()}function j(){let F;for(;i._index<u.length;){const I=u[i._index];if(typeof I=="string")for(F=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===F&&i._bufferIndex<I.length;)C(I.charCodeAt(i._bufferIndex));else C(I)}}function C(F){y=y(F)}function $(F){Re(F)?(i.line++,i.column=1,i.offset+=F===-3?2:1,Y()):F!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===u[i._index].length&&(i._bufferIndex=-1,i._index++)),h.previous=F}function M(F,I){const Q=I||{};return Q.type=F,Q.start=w(),h.events.push(["enter",Q,h]),m.push(Q),Q}function ee(F){const I=m.pop();return I.end=w(),h.events.push(["exit",I,h]),I}function ne(F,I){V(F,I.from)}function A(F,I){I.restore()}function G(F,I){return Q;function Q(le,B,L){let q,ce,ge,N;return Array.isArray(le)?K(le):"tokenize"in le?K([le]):z(le);function z(ve){return ze;function ze(me){const D=me!==null&&ve[me],U=me!==null&&ve.null,be=[...Array.isArray(D)?D:D?[D]:[],...Array.isArray(U)?U:U?[U]:[]];return K(be)(me)}}function K(ve){return q=ve,ce=0,ve.length===0?L:E(ve[ce])}function E(ve){return ze;function ze(me){return N=oe(),ge=ve,ve.partial||(h.currentConstruct=ve),ve.name&&h.parser.constructs.disable.null.includes(ve.name)?ke():ve.tokenize.call(I?Object.assign(Object.create(h),I):h,p,pe,ke)(me)}}function pe(ve){return F(ge,N),B}function ke(ve){return N.restore(),++ce<q.length?E(q[ce]):L}}}function V(F,I){F.resolveAll&&!d.includes(F)&&d.push(F),F.resolve&&Mn(h.events,I,h.events.length-I,F.resolve(h.events.slice(I),h)),F.resolveTo&&(h.events=F.resolveTo(h.events,h))}function oe(){const F=w(),I=h.previous,Q=h.currentConstruct,le=h.events.length,B=Array.from(m);return{from:le,restore:L};function L(){i=F,h.previous=I,h.currentConstruct=Q,h.events.length=le,m=B,Y()}}function Y(){i.line in c&&i.column<2&&(i.column=c[i.line],i.offset+=c[i.line]-1)}}function N3(e,a){const r=a.start._index,i=a.start._bufferIndex,c=a.end._index,d=a.end._bufferIndex;let u;if(r===c)u=[e[r].slice(i,d)];else{if(u=e.slice(r,c),i>-1){const m=u[0];typeof m=="string"?u[0]=m.slice(i):u.shift()}d>0&&u.push(e[c].slice(0,d))}return u}function C3(e,a){let r=-1;const i=[];let c;for(;++r<e.length;){const d=e[r];let u;if(typeof d=="string")u=d;else switch(d){case-5:{u="\r";break}case-4:{u=`
|
||
`;break}case-3:{u=`\r
|
||
`;break}case-2:{u=a?" ":" ";break}case-1:{if(!a&&c)continue;u=" ";break}default:u=String.fromCharCode(d)}c=d===-2,i.push(u)}return i.join("")}function E3(e){const i={constructs:R1([j3,...(e||{}).extensions||[]]),content:c(IN),defined:[],document:c(GN),flow:c(c3),lazy:{},string:c(f3),text:c(p3)};return i;function c(d){return u;function u(m){return S3(i,d,m)}}}function T3(e){for(;!U1(e););return e}const db=/[\0\t\n\r]/g;function A3(){let e=1,a="",r=!0,i;return c;function c(d,u,m){const p=[];let h,y,x,v,k;for(d=a+(typeof d=="string"?d.toString():new TextDecoder(u||void 0).decode(d)),x=0,a="",r&&(d.charCodeAt(0)===65279&&x++,r=void 0);x<d.length;){if(db.lastIndex=x,h=db.exec(d),v=h&&h.index!==void 0?h.index:d.length,k=d.charCodeAt(v),!h){a=d.slice(x);break}if(k===10&&x===v&&i)p.push(-3),i=void 0;else switch(i&&(p.push(-5),i=void 0),x<v&&(p.push(d.slice(x,v)),e+=v-x),k){case 0:{p.push(65533),e++;break}case 9:{for(y=Math.ceil(e/4)*4,p.push(-2);e++<y;)p.push(-1);break}case 10:{p.push(-4),e=1;break}default:i=!0,e=1}x=v+1}return m&&(i&&p.push(-5),a&&p.push(a),p.push(null)),p}}const D3=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function M3(e){return e.replace(D3,z3)}function z3(e,a,r){if(a)return a;if(r.charCodeAt(0)===35){const c=r.charCodeAt(1),d=c===120||c===88;return O1(r.slice(d?2:1),d?16:10)}return mm(r)||e}const G1={}.hasOwnProperty;function R3(e,a,r){return a&&typeof a=="object"&&(r=a,a=void 0),O3(r)(T3(E3(r).document().write(A3()(e,a,!0))))}function O3(e){const a={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:d(Ee),autolinkProtocol:oe,autolinkEmail:oe,atxHeading:d(nt),blockQuote:d(U),characterEscape:oe,characterReference:oe,codeFenced:d(be),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:d(be,u),codeText:d(Ne,u),codeTextData:oe,data:oe,codeFlowValue:oe,definition:d($e),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:d(Ce),hardBreakEscape:d(Be),hardBreakTrailing:d(Be),htmlFlow:d(Ve,u),htmlFlowData:oe,htmlText:d(Ve,u),htmlTextData:oe,image:d(ct),label:u,link:d(Ee),listItem:d(ft),listItemValue:v,listOrdered:d(Et,x),listUnordered:d(Et),paragraph:d(vn),reference:E,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:d(nt),strong:d(Pn),thematicBreak:d(Ft)},exit:{atxHeading:p(),atxHeadingSequence:ne,autolink:p(),autolinkEmail:D,autolinkProtocol:me,blockQuote:p(),characterEscapeValue:Y,characterReferenceMarkerHexadecimal:ke,characterReferenceMarkerNumeric:ke,characterReferenceValue:ve,characterReference:ze,codeFenced:p(j),codeFencedFence:T,codeFencedFenceInfo:k,codeFencedFenceMeta:w,codeFlowValue:Y,codeIndented:p(C),codeText:p(B),codeTextData:Y,data:Y,definition:p(),definitionDestinationString:ee,definitionLabelString:$,definitionTitleString:M,emphasis:p(),hardBreakEscape:p(I),hardBreakTrailing:p(I),htmlFlow:p(Q),htmlFlowData:Y,htmlText:p(le),htmlTextData:Y,image:p(q),label:ge,labelText:ce,lineEnding:F,link:p(L),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:pe,resourceDestinationString:N,resourceTitleString:z,resource:K,setextHeading:p(V),setextHeadingLineSequence:G,setextHeadingText:A,strong:p(),thematicBreak:p()}};V1(a,(e||{}).mdastExtensions||[]);const r={};return i;function i(se){let he={type:"root",children:[]};const Te={stack:[he],tokenStack:[],config:a,enter:m,exit:h,buffer:u,resume:y,data:r},X=[];let re=-1;for(;++re<se.length;)if(se[re][1].type==="listOrdered"||se[re][1].type==="listUnordered")if(se[re][0]==="enter")X.push(re);else{const ue=X.pop();re=c(se,ue,re)}for(re=-1;++re<se.length;){const ue=a[se[re][0]];G1.call(ue,se[re][1].type)&&ue[se[re][1].type].call(Object.assign({sliceSerialize:se[re][2].sliceSerialize},Te),se[re][1])}if(Te.tokenStack.length>0){const ue=Te.tokenStack[Te.tokenStack.length-1];(ue[1]||fb).call(Te,void 0,ue[0])}for(he.position={start:xr(se.length>0?se[0][1].start:{line:1,column:1,offset:0}),end:xr(se.length>0?se[se.length-2][1].end:{line:1,column:1,offset:0})},re=-1;++re<a.transforms.length;)he=a.transforms[re](he)||he;return he}function c(se,he,Te){let X=he-1,re=-1,ue=!1,Ue,Ae,Le,je;for(;++X<=Te;){const Me=se[X];switch(Me[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Me[0]==="enter"?re++:re--,je=void 0;break}case"lineEndingBlank":{Me[0]==="enter"&&(Ue&&!je&&!re&&!Le&&(Le=X),je=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:je=void 0}if(!re&&Me[0]==="enter"&&Me[1].type==="listItemPrefix"||re===-1&&Me[0]==="exit"&&(Me[1].type==="listUnordered"||Me[1].type==="listOrdered")){if(Ue){let Rt=X;for(Ae=void 0;Rt--;){const wt=se[Rt];if(wt[1].type==="lineEnding"||wt[1].type==="lineEndingBlank"){if(wt[0]==="exit")continue;Ae&&(se[Ae][1].type="lineEndingBlank",ue=!0),wt[1].type="lineEnding",Ae=Rt}else if(!(wt[1].type==="linePrefix"||wt[1].type==="blockQuotePrefix"||wt[1].type==="blockQuotePrefixWhitespace"||wt[1].type==="blockQuoteMarker"||wt[1].type==="listItemIndent"))break}Le&&(!Ae||Le<Ae)&&(Ue._spread=!0),Ue.end=Object.assign({},Ae?se[Ae][1].start:Me[1].end),se.splice(Ae||X,0,["exit",Ue,Me[2]]),X++,Te++}if(Me[1].type==="listItemPrefix"){const Rt={type:"listItem",_spread:!1,start:Object.assign({},Me[1].start),end:void 0};Ue=Rt,se.splice(X,0,["enter",Rt,Me[2]]),X++,Te++,Le=void 0,je=!0}}}return se[he][1]._spread=ue,Te}function d(se,he){return Te;function Te(X){m.call(this,se(X),X),he&&he.call(this,X)}}function u(){this.stack.push({type:"fragment",children:[]})}function m(se,he,Te){this.stack[this.stack.length-1].children.push(se),this.stack.push(se),this.tokenStack.push([he,Te||void 0]),se.position={start:xr(he.start),end:void 0}}function p(se){return he;function he(Te){se&&se.call(this,Te),h.call(this,Te)}}function h(se,he){const Te=this.stack.pop(),X=this.tokenStack.pop();if(X)X[0].type!==se.type&&(he?he.call(this,se,X[0]):(X[1]||fb).call(this,se,X[0]));else throw new Error("Cannot close `"+se.type+"` ("+ki({start:se.start,end:se.end})+"): it’s not open");Te.position.end=xr(se.end)}function y(){return pm(this.stack.pop())}function x(){this.data.expectingFirstListItemValue=!0}function v(se){if(this.data.expectingFirstListItemValue){const he=this.stack[this.stack.length-2];he.start=Number.parseInt(this.sliceSerialize(se),10),this.data.expectingFirstListItemValue=void 0}}function k(){const se=this.resume(),he=this.stack[this.stack.length-1];he.lang=se}function w(){const se=this.resume(),he=this.stack[this.stack.length-1];he.meta=se}function T(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function j(){const se=this.resume(),he=this.stack[this.stack.length-1];he.value=se.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const se=this.resume(),he=this.stack[this.stack.length-1];he.value=se.replace(/(\r?\n|\r)$/g,"")}function $(se){const he=this.resume(),Te=this.stack[this.stack.length-1];Te.label=he,Te.identifier=aa(this.sliceSerialize(se)).toLowerCase()}function M(){const se=this.resume(),he=this.stack[this.stack.length-1];he.title=se}function ee(){const se=this.resume(),he=this.stack[this.stack.length-1];he.url=se}function ne(se){const he=this.stack[this.stack.length-1];if(!he.depth){const Te=this.sliceSerialize(se).length;he.depth=Te}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function G(se){const he=this.stack[this.stack.length-1];he.depth=this.sliceSerialize(se).codePointAt(0)===61?1:2}function V(){this.data.setextHeadingSlurpLineEnding=void 0}function oe(se){const Te=this.stack[this.stack.length-1].children;let X=Te[Te.length-1];(!X||X.type!=="text")&&(X=pt(),X.position={start:xr(se.start),end:void 0},Te.push(X)),this.stack.push(X)}function Y(se){const he=this.stack.pop();he.value+=this.sliceSerialize(se),he.position.end=xr(se.end)}function F(se){const he=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Te=he.children[he.children.length-1];Te.position.end=xr(se.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&a.canContainEols.includes(he.type)&&(oe.call(this,se),Y.call(this,se))}function I(){this.data.atHardBreak=!0}function Q(){const se=this.resume(),he=this.stack[this.stack.length-1];he.value=se}function le(){const se=this.resume(),he=this.stack[this.stack.length-1];he.value=se}function B(){const se=this.resume(),he=this.stack[this.stack.length-1];he.value=se}function L(){const se=this.stack[this.stack.length-1];if(this.data.inReference){const he=this.data.referenceType||"shortcut";se.type+="Reference",se.referenceType=he,delete se.url,delete se.title}else delete se.identifier,delete se.label;this.data.referenceType=void 0}function q(){const se=this.stack[this.stack.length-1];if(this.data.inReference){const he=this.data.referenceType||"shortcut";se.type+="Reference",se.referenceType=he,delete se.url,delete se.title}else delete se.identifier,delete se.label;this.data.referenceType=void 0}function ce(se){const he=this.sliceSerialize(se),Te=this.stack[this.stack.length-2];Te.label=M3(he),Te.identifier=aa(he).toLowerCase()}function ge(){const se=this.stack[this.stack.length-1],he=this.resume(),Te=this.stack[this.stack.length-1];if(this.data.inReference=!0,Te.type==="link"){const X=se.children;Te.children=X}else Te.alt=he}function N(){const se=this.resume(),he=this.stack[this.stack.length-1];he.url=se}function z(){const se=this.resume(),he=this.stack[this.stack.length-1];he.title=se}function K(){this.data.inReference=void 0}function E(){this.data.referenceType="collapsed"}function pe(se){const he=this.resume(),Te=this.stack[this.stack.length-1];Te.label=he,Te.identifier=aa(this.sliceSerialize(se)).toLowerCase(),this.data.referenceType="full"}function ke(se){this.data.characterReferenceType=se.type}function ve(se){const he=this.sliceSerialize(se),Te=this.data.characterReferenceType;let X;Te?(X=O1(he,Te==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):X=mm(he);const re=this.stack[this.stack.length-1];re.value+=X}function ze(se){const he=this.stack.pop();he.position.end=xr(se.end)}function me(se){Y.call(this,se);const he=this.stack[this.stack.length-1];he.url=this.sliceSerialize(se)}function D(se){Y.call(this,se);const he=this.stack[this.stack.length-1];he.url="mailto:"+this.sliceSerialize(se)}function U(){return{type:"blockquote",children:[]}}function be(){return{type:"code",lang:null,meta:null,value:""}}function Ne(){return{type:"inlineCode",value:""}}function $e(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ce(){return{type:"emphasis",children:[]}}function nt(){return{type:"heading",depth:0,children:[]}}function Be(){return{type:"break"}}function Ve(){return{type:"html",value:""}}function ct(){return{type:"image",title:null,url:"",alt:null}}function Ee(){return{type:"link",title:null,url:"",children:[]}}function Et(se){return{type:"list",ordered:se.type==="listOrdered",start:null,spread:se._spread,children:[]}}function ft(se){return{type:"listItem",spread:se._spread,checked:null,children:[]}}function vn(){return{type:"paragraph",children:[]}}function Pn(){return{type:"strong",children:[]}}function pt(){return{type:"text",value:""}}function Ft(){return{type:"thematicBreak"}}}function xr(e){return{line:e.line,column:e.column,offset:e.offset}}function V1(e,a){let r=-1;for(;++r<a.length;){const i=a[r];Array.isArray(i)?V1(e,i):L3(e,i)}}function L3(e,a){let r;for(r in a)if(G1.call(a,r))switch(r){case"canContainEols":{const i=a[r];i&&e[r].push(...i);break}case"transforms":{const i=a[r];i&&e[r].push(...i);break}case"enter":case"exit":{const i=a[r];i&&Object.assign(e[r],i);break}}}function fb(e,a){throw e?new Error("Cannot close `"+e.type+"` ("+ki({start:e.start,end:e.end})+"): a different token (`"+a.type+"`, "+ki({start:a.start,end:a.end})+") is open"):new Error("Cannot close document, a token (`"+a.type+"`, "+ki({start:a.start,end:a.end})+") is still open")}function $3(e){const a=this;a.parser=r;function r(i){return R3(i,{...a.data("settings"),...e,extensions:a.data("micromarkExtensions")||[],mdastExtensions:a.data("fromMarkdownExtensions")||[]})}}function B3(e,a){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(a),!0)};return e.patch(a,r),e.applyData(a,r)}function U3(e,a){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(a,r),[e.applyData(a,r),{type:"text",value:`
|
||
`}]}function H3(e,a){const r=a.value?a.value+`
|
||
`:"",i={},c=a.lang?a.lang.split(/\s+/):[];c.length>0&&(i.className=["language-"+c[0]]);let d={type:"element",tagName:"code",properties:i,children:[{type:"text",value:r}]};return a.meta&&(d.data={meta:a.meta}),e.patch(a,d),d=e.applyData(a,d),d={type:"element",tagName:"pre",properties:{},children:[d]},e.patch(a,d),d}function q3(e,a){const r={type:"element",tagName:"del",properties:{},children:e.all(a)};return e.patch(a,r),e.applyData(a,r)}function F3(e,a){const r={type:"element",tagName:"em",properties:{},children:e.all(a)};return e.patch(a,r),e.applyData(a,r)}function I3(e,a){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(a.identifier).toUpperCase(),c=ps(i.toLowerCase()),d=e.footnoteOrder.indexOf(i);let u,m=e.footnoteCounts.get(i);m===void 0?(m=0,e.footnoteOrder.push(i),u=e.footnoteOrder.length):u=d+1,m+=1,e.footnoteCounts.set(i,m);const p={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+c,id:r+"fnref-"+c+(m>1?"-"+m:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(a,p);const h={type:"element",tagName:"sup",properties:{},children:[p]};return e.patch(a,h),e.applyData(a,h)}function Y3(e,a){const r={type:"element",tagName:"h"+a.depth,properties:{},children:e.all(a)};return e.patch(a,r),e.applyData(a,r)}function G3(e,a){if(e.options.allowDangerousHtml){const r={type:"raw",value:a.value};return e.patch(a,r),e.applyData(a,r)}}function K1(e,a){const r=a.referenceType;let i="]";if(r==="collapsed"?i+="[]":r==="full"&&(i+="["+(a.label||a.identifier)+"]"),a.type==="imageReference")return[{type:"text",value:"!["+a.alt+i}];const c=e.all(a),d=c[0];d&&d.type==="text"?d.value="["+d.value:c.unshift({type:"text",value:"["});const u=c[c.length-1];return u&&u.type==="text"?u.value+=i:c.push({type:"text",value:i}),c}function V3(e,a){const r=String(a.identifier).toUpperCase(),i=e.definitionById.get(r);if(!i)return K1(e,a);const c={src:ps(i.url||""),alt:a.alt};i.title!==null&&i.title!==void 0&&(c.title=i.title);const d={type:"element",tagName:"img",properties:c,children:[]};return e.patch(a,d),e.applyData(a,d)}function K3(e,a){const r={src:ps(a.url)};a.alt!==null&&a.alt!==void 0&&(r.alt=a.alt),a.title!==null&&a.title!==void 0&&(r.title=a.title);const i={type:"element",tagName:"img",properties:r,children:[]};return e.patch(a,i),e.applyData(a,i)}function P3(e,a){const r={type:"text",value:a.value.replace(/\r?\n|\r/g," ")};e.patch(a,r);const i={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(a,i),e.applyData(a,i)}function X3(e,a){const r=String(a.identifier).toUpperCase(),i=e.definitionById.get(r);if(!i)return K1(e,a);const c={href:ps(i.url||"")};i.title!==null&&i.title!==void 0&&(c.title=i.title);const d={type:"element",tagName:"a",properties:c,children:e.all(a)};return e.patch(a,d),e.applyData(a,d)}function Q3(e,a){const r={href:ps(a.url)};a.title!==null&&a.title!==void 0&&(r.title=a.title);const i={type:"element",tagName:"a",properties:r,children:e.all(a)};return e.patch(a,i),e.applyData(a,i)}function Z3(e,a,r){const i=e.all(a),c=r?J3(r):P1(a),d={},u=[];if(typeof a.checked=="boolean"){const y=i[0];let x;y&&y.type==="element"&&y.tagName==="p"?x=y:(x={type:"element",tagName:"p",properties:{},children:[]},i.unshift(x)),x.children.length>0&&x.children.unshift({type:"text",value:" "}),x.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:a.checked,disabled:!0},children:[]}),d.className=["task-list-item"]}let m=-1;for(;++m<i.length;){const y=i[m];(c||m!==0||y.type!=="element"||y.tagName!=="p")&&u.push({type:"text",value:`
|
||
`}),y.type==="element"&&y.tagName==="p"&&!c?u.push(...y.children):u.push(y)}const p=i[i.length-1];p&&(c||p.type!=="element"||p.tagName!=="p")&&u.push({type:"text",value:`
|
||
`});const h={type:"element",tagName:"li",properties:d,children:u};return e.patch(a,h),e.applyData(a,h)}function J3(e){let a=!1;if(e.type==="list"){a=e.spread||!1;const r=e.children;let i=-1;for(;!a&&++i<r.length;)a=P1(r[i])}return a}function P1(e){const a=e.spread;return a??e.children.length>1}function W3(e,a){const r={},i=e.all(a);let c=-1;for(typeof a.start=="number"&&a.start!==1&&(r.start=a.start);++c<i.length;){const u=i[c];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const d={type:"element",tagName:a.ordered?"ol":"ul",properties:r,children:e.wrap(i,!0)};return e.patch(a,d),e.applyData(a,d)}function eE(e,a){const r={type:"element",tagName:"p",properties:{},children:e.all(a)};return e.patch(a,r),e.applyData(a,r)}function tE(e,a){const r={type:"root",children:e.wrap(e.all(a))};return e.patch(a,r),e.applyData(a,r)}function nE(e,a){const r={type:"element",tagName:"strong",properties:{},children:e.all(a)};return e.patch(a,r),e.applyData(a,r)}function aE(e,a){const r=e.all(a),i=r.shift(),c=[];if(i){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([i],!0)};e.patch(a.children[0],u),c.push(u)}if(r.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},m=cm(a.children[1]),p=C1(a.children[a.children.length-1]);m&&p&&(u.position={start:m,end:p}),c.push(u)}const d={type:"element",tagName:"table",properties:{},children:e.wrap(c,!0)};return e.patch(a,d),e.applyData(a,d)}function rE(e,a,r){const i=r?r.children:void 0,d=(i?i.indexOf(a):1)===0?"th":"td",u=r&&r.type==="table"?r.align:void 0,m=u?u.length:a.children.length;let p=-1;const h=[];for(;++p<m;){const x=a.children[p],v={},k=u?u[p]:void 0;k&&(v.align=k);let w={type:"element",tagName:d,properties:v,children:[]};x&&(w.children=e.all(x),e.patch(x,w),w=e.applyData(x,w)),h.push(w)}const y={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(a,y),e.applyData(a,y)}function lE(e,a){const r={type:"element",tagName:"td",properties:{},children:e.all(a)};return e.patch(a,r),e.applyData(a,r)}const pb=9,mb=32;function sE(e){const a=String(e),r=/\r?\n|\r/g;let i=r.exec(a),c=0;const d=[];for(;i;)d.push(hb(a.slice(c,i.index),c>0,!0),i[0]),c=i.index+i[0].length,i=r.exec(a);return d.push(hb(a.slice(c),c>0,!1)),d.join("")}function hb(e,a,r){let i=0,c=e.length;if(a){let d=e.codePointAt(i);for(;d===pb||d===mb;)i++,d=e.codePointAt(i)}if(r){let d=e.codePointAt(c-1);for(;d===pb||d===mb;)c--,d=e.codePointAt(c-1)}return c>i?e.slice(i,c):""}function iE(e,a){const r={type:"text",value:sE(String(a.value))};return e.patch(a,r),e.applyData(a,r)}function oE(e,a){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(a,r),e.applyData(a,r)}const cE={blockquote:B3,break:U3,code:H3,delete:q3,emphasis:F3,footnoteReference:I3,heading:Y3,html:G3,imageReference:V3,image:K3,inlineCode:P3,linkReference:X3,link:Q3,listItem:Z3,list:W3,paragraph:eE,root:tE,strong:nE,table:aE,tableCell:lE,tableRow:rE,text:iE,thematicBreak:oE,toml:gc,yaml:gc,definition:gc,footnoteDefinition:gc};function gc(){}const X1=-1,Jc=0,wi=1,Oc=2,gm=3,xm=4,ym=5,bm=6,Q1=7,Z1=8,gb=typeof self=="object"?self:globalThis,uE=(e,a)=>{const r=(c,d)=>(e.set(d,c),c),i=c=>{if(e.has(c))return e.get(c);const[d,u]=a[c];switch(d){case Jc:case X1:return r(u,c);case wi:{const m=r([],c);for(const p of u)m.push(i(p));return m}case Oc:{const m=r({},c);for(const[p,h]of u)m[i(p)]=i(h);return m}case gm:return r(new Date(u),c);case xm:{const{source:m,flags:p}=u;return r(new RegExp(m,p),c)}case ym:{const m=r(new Map,c);for(const[p,h]of u)m.set(i(p),i(h));return m}case bm:{const m=r(new Set,c);for(const p of u)m.add(i(p));return m}case Q1:{const{name:m,message:p}=u;return r(new gb[m](p),c)}case Z1:return r(BigInt(u),c);case"BigInt":return r(Object(BigInt(u)),c);case"ArrayBuffer":return r(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:m}=new Uint8Array(u);return r(new DataView(m),u)}}return r(new gb[d](u),c)};return i},xb=e=>uE(new Map,e)(0),Gl="",{toString:dE}={},{keys:fE}=Object,gi=e=>{const a=typeof e;if(a!=="object"||!e)return[Jc,a];const r=dE.call(e).slice(8,-1);switch(r){case"Array":return[wi,Gl];case"Object":return[Oc,Gl];case"Date":return[gm,Gl];case"RegExp":return[xm,Gl];case"Map":return[ym,Gl];case"Set":return[bm,Gl];case"DataView":return[wi,r]}return r.includes("Array")?[wi,r]:r.includes("Error")?[Q1,r]:[Oc,r]},xc=([e,a])=>e===Jc&&(a==="function"||a==="symbol"),pE=(e,a,r,i)=>{const c=(u,m)=>{const p=i.push(u)-1;return r.set(m,p),p},d=u=>{if(r.has(u))return r.get(u);let[m,p]=gi(u);switch(m){case Jc:{let y=u;switch(p){case"bigint":m=Z1,y=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+p);y=null;break;case"undefined":return c([X1],u)}return c([m,y],u)}case wi:{if(p){let v=u;return p==="DataView"?v=new Uint8Array(u.buffer):p==="ArrayBuffer"&&(v=new Uint8Array(u)),c([p,[...v]],u)}const y=[],x=c([m,y],u);for(const v of u)y.push(d(v));return x}case Oc:{if(p)switch(p){case"BigInt":return c([p,u.toString()],u);case"Boolean":case"Number":case"String":return c([p,u.valueOf()],u)}if(a&&"toJSON"in u)return d(u.toJSON());const y=[],x=c([m,y],u);for(const v of fE(u))(e||!xc(gi(u[v])))&&y.push([d(v),d(u[v])]);return x}case gm:return c([m,u.toISOString()],u);case xm:{const{source:y,flags:x}=u;return c([m,{source:y,flags:x}],u)}case ym:{const y=[],x=c([m,y],u);for(const[v,k]of u)(e||!(xc(gi(v))||xc(gi(k))))&&y.push([d(v),d(k)]);return x}case bm:{const y=[],x=c([m,y],u);for(const v of u)(e||!xc(gi(v)))&&y.push(d(v));return x}}const{message:h}=u;return c([m,{name:p,message:h}],u)};return d},yb=(e,{json:a,lossy:r}={})=>{const i=[];return pE(!(a||r),!!a,new Map,i)(e),i},Lc=typeof structuredClone=="function"?(e,a)=>a&&("json"in a||"lossy"in a)?xb(yb(e,a)):structuredClone(e):(e,a)=>xb(yb(e,a));function mE(e,a){const r=[{type:"text",value:"↩"}];return a>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(a)}]}),r}function hE(e,a){return"Back to reference "+(e+1)+(a>1?"-"+a:"")}function gE(e){const a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||mE,i=e.options.footnoteBackLabel||hE,c=e.options.footnoteLabel||"Footnotes",d=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},m=[];let p=-1;for(;++p<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[p]);if(!h)continue;const y=e.all(h),x=String(h.identifier).toUpperCase(),v=ps(x.toLowerCase());let k=0;const w=[],T=e.footnoteCounts.get(x);for(;T!==void 0&&++k<=T;){w.length>0&&w.push({type:"text",value:" "});let $=typeof r=="string"?r:r(p,k);typeof $=="string"&&($={type:"text",value:$}),w.push({type:"element",tagName:"a",properties:{href:"#"+a+"fnref-"+v+(k>1?"-"+k:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(p,k),className:["data-footnote-backref"]},children:Array.isArray($)?$:[$]})}const j=y[y.length-1];if(j&&j.type==="element"&&j.tagName==="p"){const $=j.children[j.children.length-1];$&&$.type==="text"?$.value+=" ":j.children.push({type:"text",value:" "}),j.children.push(...w)}else y.push(...w);const C={type:"element",tagName:"li",properties:{id:a+"fn-"+v},children:e.wrap(y,!0)};e.patch(h,C),m.push(C)}if(m.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:d,properties:{...Lc(u),id:"footnote-label"},children:[{type:"text",value:c}]},{type:"text",value:`
|
||
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(m,!0)},{type:"text",value:`
|
||
`}]}}const Wc=(function(e){if(e==null)return vE;if(typeof e=="function")return eu(e);if(typeof e=="object")return Array.isArray(e)?xE(e):yE(e);if(typeof e=="string")return bE(e);throw new Error("Expected function, string, or object as test")});function xE(e){const a=[];let r=-1;for(;++r<e.length;)a[r]=Wc(e[r]);return eu(i);function i(...c){let d=-1;for(;++d<a.length;)if(a[d].apply(this,c))return!0;return!1}}function yE(e){const a=e;return eu(r);function r(i){const c=i;let d;for(d in e)if(c[d]!==a[d])return!1;return!0}}function bE(e){return eu(a);function a(r){return r&&r.type===e}}function eu(e){return a;function a(r,i,c){return!!(kE(r)&&e.call(this,r,typeof i=="number"?i:void 0,c||void 0))}}function vE(){return!0}function kE(e){return e!==null&&typeof e=="object"&&"type"in e}const J1=[],_E=!0,vp=!1,wE="skip";function W1(e,a,r,i){let c;typeof a=="function"&&typeof r!="function"?(i=r,r=a):c=a;const d=Wc(c),u=i?-1:1;m(e,void 0,[])();function m(p,h,y){const x=p&&typeof p=="object"?p:{};if(typeof x.type=="string"){const k=typeof x.tagName=="string"?x.tagName:typeof x.name=="string"?x.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(p.type+(k?"<"+k+">":""))+")"})}return v;function v(){let k=J1,w,T,j;if((!a||d(p,h,y[y.length-1]||void 0))&&(k=jE(r(p,y)),k[0]===vp))return k;if("children"in p&&p.children){const C=p;if(C.children&&k[0]!==wE)for(T=(i?C.children.length:-1)+u,j=y.concat(C);T>-1&&T<C.children.length;){const $=C.children[T];if(w=m($,T,j)(),w[0]===vp)return w;T=typeof w[1]=="number"?w[1]:T+u}}return k}}}function jE(e){return Array.isArray(e)?e:typeof e=="number"?[_E,e]:e==null?J1:[e]}function vm(e,a,r,i){let c,d,u;typeof a=="function"&&typeof r!="function"?(d=void 0,u=a,c=r):(d=a,u=r,c=i),W1(e,d,m,c);function m(p,h){const y=h[h.length-1],x=y?y.children.indexOf(p):void 0;return u(p,x,y)}}const kp={}.hasOwnProperty,SE={};function NE(e,a){const r=a||SE,i=new Map,c=new Map,d=new Map,u={...cE,...r.handlers},m={all:h,applyData:EE,definitionById:i,footnoteById:c,footnoteCounts:d,footnoteOrder:[],handlers:u,one:p,options:r,patch:CE,wrap:AE};return vm(e,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const x=y.type==="definition"?i:c,v=String(y.identifier).toUpperCase();x.has(v)||x.set(v,y)}}),m;function p(y,x){const v=y.type,k=m.handlers[v];if(kp.call(m.handlers,v)&&k)return k(m,y,x);if(m.options.passThrough&&m.options.passThrough.includes(v)){if("children"in y){const{children:T,...j}=y,C=Lc(j);return C.children=m.all(y),C}return Lc(y)}return(m.options.unknownHandler||TE)(m,y,x)}function h(y){const x=[];if("children"in y){const v=y.children;let k=-1;for(;++k<v.length;){const w=m.one(v[k],y);if(w){if(k&&v[k-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=bb(w.value)),!Array.isArray(w)&&w.type==="element")){const T=w.children[0];T&&T.type==="text"&&(T.value=bb(T.value))}Array.isArray(w)?x.push(...w):x.push(w)}}}return x}}function CE(e,a){e.position&&(a.position=hN(e))}function EE(e,a){let r=a;if(e&&e.data){const i=e.data.hName,c=e.data.hChildren,d=e.data.hProperties;if(typeof i=="string")if(r.type==="element")r.tagName=i;else{const u="children"in r?r.children:[r];r={type:"element",tagName:i,properties:{},children:u}}r.type==="element"&&d&&Object.assign(r.properties,Lc(d)),"children"in r&&r.children&&c!==null&&c!==void 0&&(r.children=c)}return r}function TE(e,a){const r=a.data||{},i="value"in a&&!(kp.call(r,"hProperties")||kp.call(r,"hChildren"))?{type:"text",value:a.value}:{type:"element",tagName:"div",properties:{},children:e.all(a)};return e.patch(a,i),e.applyData(a,i)}function AE(e,a){const r=[];let i=-1;for(a&&r.push({type:"text",value:`
|
||
`});++i<e.length;)i&&r.push({type:"text",value:`
|
||
`}),r.push(e[i]);return a&&e.length>0&&r.push({type:"text",value:`
|
||
`}),r}function bb(e){let a=0,r=e.charCodeAt(a);for(;r===9||r===32;)a++,r=e.charCodeAt(a);return e.slice(a)}function vb(e,a){const r=NE(e,a),i=r.one(e,void 0),c=gE(r),d=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return c&&d.children.push({type:"text",value:`
|
||
`},c),d}function DE(e,a){return e&&"run"in e?async function(r,i){const c=vb(r,{file:i,...a});await e.run(c,i)}:function(r,i){return vb(r,{file:i,...e||a})}}function kb(e){if(e)throw e}var Af,_b;function ME(){if(_b)return Af;_b=1;var e=Object.prototype.hasOwnProperty,a=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,c=function(h){return typeof Array.isArray=="function"?Array.isArray(h):a.call(h)==="[object Array]"},d=function(h){if(!h||a.call(h)!=="[object Object]")return!1;var y=e.call(h,"constructor"),x=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!y&&!x)return!1;var v;for(v in h);return typeof v>"u"||e.call(h,v)},u=function(h,y){r&&y.name==="__proto__"?r(h,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):h[y.name]=y.newValue},m=function(h,y){if(y==="__proto__")if(e.call(h,y)){if(i)return i(h,y).value}else return;return h[y]};return Af=function p(){var h,y,x,v,k,w,T=arguments[0],j=1,C=arguments.length,$=!1;for(typeof T=="boolean"&&($=T,T=arguments[1]||{},j=2),(T==null||typeof T!="object"&&typeof T!="function")&&(T={});j<C;++j)if(h=arguments[j],h!=null)for(y in h)x=m(T,y),v=m(h,y),T!==v&&($&&v&&(d(v)||(k=c(v)))?(k?(k=!1,w=x&&c(x)?x:[]):w=x&&d(x)?x:{},u(T,{name:y,newValue:p($,w,v)})):typeof v<"u"&&u(T,{name:y,newValue:v}));return T},Af}var zE=ME();const Df=Ic(zE);function _p(e){if(typeof e!="object"||e===null)return!1;const a=Object.getPrototypeOf(e);return(a===null||a===Object.prototype||Object.getPrototypeOf(a)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function RE(){const e=[],a={run:r,use:i};return a;function r(...c){let d=-1;const u=c.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);m(null,...c);function m(p,...h){const y=e[++d];let x=-1;if(p){u(p);return}for(;++x<c.length;)(h[x]===null||h[x]===void 0)&&(h[x]=c[x]);c=h,y?OE(y,m)(...h):u(null,...h)}}function i(c){if(typeof c!="function")throw new TypeError("Expected `middelware` to be a function, not "+c);return e.push(c),a}}function OE(e,a){let r;return i;function i(...u){const m=e.length>u.length;let p;m&&u.push(c);try{p=e.apply(this,u)}catch(h){const y=h;if(m&&r)throw y;return c(y)}m||(p&&p.then&&typeof p.then=="function"?p.then(d,c):p instanceof Error?c(p):d(p))}function c(u,...m){r||(r=!0,a(u,...m))}function d(u){c(null,u)}}const pa={basename:LE,dirname:$E,extname:BE,join:UE,sep:"/"};function LE(e,a){if(a!==void 0&&typeof a!="string")throw new TypeError('"ext" argument must be a string');qi(e);let r=0,i=-1,c=e.length,d;if(a===void 0||a.length===0||a.length>e.length){for(;c--;)if(e.codePointAt(c)===47){if(d){r=c+1;break}}else i<0&&(d=!0,i=c+1);return i<0?"":e.slice(r,i)}if(a===e)return"";let u=-1,m=a.length-1;for(;c--;)if(e.codePointAt(c)===47){if(d){r=c+1;break}}else u<0&&(d=!0,u=c+1),m>-1&&(e.codePointAt(c)===a.codePointAt(m--)?m<0&&(i=c):(m=-1,i=u));return r===i?i=u:i<0&&(i=e.length),e.slice(r,i)}function $E(e){if(qi(e),e.length===0)return".";let a=-1,r=e.length,i;for(;--r;)if(e.codePointAt(r)===47){if(i){a=r;break}}else i||(i=!0);return a<0?e.codePointAt(0)===47?"/":".":a===1&&e.codePointAt(0)===47?"//":e.slice(0,a)}function BE(e){qi(e);let a=e.length,r=-1,i=0,c=-1,d=0,u;for(;a--;){const m=e.codePointAt(a);if(m===47){if(u){i=a+1;break}continue}r<0&&(u=!0,r=a+1),m===46?c<0?c=a:d!==1&&(d=1):c>-1&&(d=-1)}return c<0||r<0||d===0||d===1&&c===r-1&&c===i+1?"":e.slice(c,r)}function UE(...e){let a=-1,r;for(;++a<e.length;)qi(e[a]),e[a]&&(r=r===void 0?e[a]:r+"/"+e[a]);return r===void 0?".":HE(r)}function HE(e){qi(e);const a=e.codePointAt(0)===47;let r=qE(e,!a);return r.length===0&&!a&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),a?"/"+r:r}function qE(e,a){let r="",i=0,c=-1,d=0,u=-1,m,p;for(;++u<=e.length;){if(u<e.length)m=e.codePointAt(u);else{if(m===47)break;m=47}if(m===47){if(!(c===u-1||d===1))if(c!==u-1&&d===2){if(r.length<2||i!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(p=r.lastIndexOf("/"),p!==r.length-1){p<0?(r="",i=0):(r=r.slice(0,p),i=r.length-1-r.lastIndexOf("/")),c=u,d=0;continue}}else if(r.length>0){r="",i=0,c=u,d=0;continue}}a&&(r=r.length>0?r+"/..":"..",i=2)}else r.length>0?r+="/"+e.slice(c+1,u):r=e.slice(c+1,u),i=u-c-1;c=u,d=0}else m===46&&d>-1?d++:d=-1}return r}function qi(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const FE={cwd:IE};function IE(){return"/"}function wp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function YE(e){if(typeof e=="string")e=new URL(e);else if(!wp(e)){const a=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw a.code="ERR_INVALID_ARG_TYPE",a}if(e.protocol!=="file:"){const a=new TypeError("The URL must be of scheme file");throw a.code="ERR_INVALID_URL_SCHEME",a}return GE(e)}function GE(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const a=e.pathname;let r=-1;for(;++r<a.length;)if(a.codePointAt(r)===37&&a.codePointAt(r+1)===50){const i=a.codePointAt(r+2);if(i===70||i===102){const c=new TypeError("File URL path must not include encoded / characters");throw c.code="ERR_INVALID_FILE_URL_PATH",c}}return decodeURIComponent(a)}const Mf=["history","path","basename","stem","extname","dirname"];class e0{constructor(a){let r;a?wp(a)?r={path:a}:typeof a=="string"||VE(a)?r={value:a}:r=a:r={},this.cwd="cwd"in r?"":FE.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<Mf.length;){const d=Mf[i];d in r&&r[d]!==void 0&&r[d]!==null&&(this[d]=d==="history"?[...r[d]]:r[d])}let c;for(c in r)Mf.includes(c)||(this[c]=r[c])}get basename(){return typeof this.path=="string"?pa.basename(this.path):void 0}set basename(a){Rf(a,"basename"),zf(a,"basename"),this.path=pa.join(this.dirname||"",a)}get dirname(){return typeof this.path=="string"?pa.dirname(this.path):void 0}set dirname(a){wb(this.basename,"dirname"),this.path=pa.join(a||"",this.basename)}get extname(){return typeof this.path=="string"?pa.extname(this.path):void 0}set extname(a){if(zf(a,"extname"),wb(this.dirname,"extname"),a){if(a.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(a.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=pa.join(this.dirname,this.stem+(a||""))}get path(){return this.history[this.history.length-1]}set path(a){wp(a)&&(a=YE(a)),Rf(a,"path"),this.path!==a&&this.history.push(a)}get stem(){return typeof this.path=="string"?pa.basename(this.path,this.extname):void 0}set stem(a){Rf(a,"stem"),zf(a,"stem"),this.path=pa.join(this.dirname||"",a+(this.extname||""))}fail(a,r,i){const c=this.message(a,r,i);throw c.fatal=!0,c}info(a,r,i){const c=this.message(a,r,i);return c.fatal=void 0,c}message(a,r,i){const c=new rn(a,r,i);return this.path&&(c.name=this.path+":"+c.name,c.file=this.path),c.fatal=!1,this.messages.push(c),c}toString(a){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(a||void 0).decode(this.value)}}function zf(e,a){if(e&&e.includes(pa.sep))throw new Error("`"+a+"` cannot be a path: did not expect `"+pa.sep+"`")}function Rf(e,a){if(!e)throw new Error("`"+a+"` cannot be empty")}function wb(e,a){if(!e)throw new Error("Setting `"+a+"` requires `path` to be set too")}function VE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const KE=(function(e){const i=this.constructor.prototype,c=i[e],d=function(){return c.apply(d,arguments)};return Object.setPrototypeOf(d,i),d}),PE={}.hasOwnProperty;class km extends KE{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=RE()}copy(){const a=new km;let r=-1;for(;++r<this.attachers.length;){const i=this.attachers[r];a.use(...i)}return a.data(Df(!0,{},this.namespace)),a}data(a,r){return typeof a=="string"?arguments.length===2?($f("data",this.frozen),this.namespace[a]=r,this):PE.call(this.namespace,a)&&this.namespace[a]||void 0:a?($f("data",this.frozen),this.namespace=a,this):this.namespace}freeze(){if(this.frozen)return this;const a=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const c=r.call(a,...i);typeof c=="function"&&this.transformers.use(c)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(a){this.freeze();const r=yc(a),i=this.parser||this.Parser;return Of("parse",i),i(String(r),r)}process(a,r){const i=this;return this.freeze(),Of("process",this.parser||this.Parser),Lf("process",this.compiler||this.Compiler),r?c(void 0,r):new Promise(c);function c(d,u){const m=yc(a),p=i.parse(m);i.run(p,m,function(y,x,v){if(y||!x||!v)return h(y);const k=x,w=i.stringify(k,v);ZE(w)?v.value=w:v.result=w,h(y,v)});function h(y,x){y||!x?u(y):d?d(x):r(void 0,x)}}}processSync(a){let r=!1,i;return this.freeze(),Of("processSync",this.parser||this.Parser),Lf("processSync",this.compiler||this.Compiler),this.process(a,c),Sb("processSync","process",r),i;function c(d,u){r=!0,kb(d),i=u}}run(a,r,i){jb(a),this.freeze();const c=this.transformers;return!i&&typeof r=="function"&&(i=r,r=void 0),i?d(void 0,i):new Promise(d);function d(u,m){const p=yc(r);c.run(a,p,h);function h(y,x,v){const k=x||a;y?m(y):u?u(k):i(void 0,k,v)}}}runSync(a,r){let i=!1,c;return this.run(a,r,d),Sb("runSync","run",i),c;function d(u,m){kb(u),c=m,i=!0}}stringify(a,r){this.freeze();const i=yc(r),c=this.compiler||this.Compiler;return Lf("stringify",c),jb(a),c(a,i)}use(a,...r){const i=this.attachers,c=this.namespace;if($f("use",this.frozen),a!=null)if(typeof a=="function")p(a,r);else if(typeof a=="object")Array.isArray(a)?m(a):u(a);else throw new TypeError("Expected usable value, not `"+a+"`");return this;function d(h){if(typeof h=="function")p(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[y,...x]=h;p(y,x)}else u(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function u(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");m(h.plugins),h.settings&&(c.settings=Df(!0,c.settings,h.settings))}function m(h){let y=-1;if(h!=null)if(Array.isArray(h))for(;++y<h.length;){const x=h[y];d(x)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function p(h,y){let x=-1,v=-1;for(;++x<i.length;)if(i[x][0]===h){v=x;break}if(v===-1)i.push([h,...y]);else if(y.length>0){let[k,...w]=y;const T=i[v][1];_p(T)&&_p(k)&&(k=Df(!0,T,k)),i[v]=[h,k,...w]}}}}const XE=new km().freeze();function Of(e,a){if(typeof a!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Lf(e,a){if(typeof a!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function $f(e,a){if(a)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function jb(e){if(!_p(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Sb(e,a,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+a+"` instead")}function yc(e){return QE(e)?e:new e0(e)}function QE(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function ZE(e){return typeof e=="string"||JE(e)}function JE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const WE="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Nb=[],Cb={allowDangerousHtml:!0},e5=/^(https?|ircs?|mailto|xmpp)$/i,t5=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function _m(e){const a=n5(e),r=a5(e);return r5(a.runSync(a.parse(r),r),e)}function n5(e){const a=e.rehypePlugins||Nb,r=e.remarkPlugins||Nb,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Cb}:Cb;return XE().use($3).use(r).use(DE,i).use(a)}function a5(e){const a=e.children||"",r=new e0;return typeof a=="string"&&(r.value=a),r}function r5(e,a){const r=a.allowedElements,i=a.allowElement,c=a.components,d=a.disallowedElements,u=a.skipHtml,m=a.unwrapDisallowed,p=a.urlTransform||l5;for(const y of t5)Object.hasOwn(a,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+WE+y.id,void 0);return vm(e,h),vN(e,{Fragment:l.Fragment,components:c,ignoreInvalidStyle:!0,jsx:l.jsx,jsxs:l.jsxs,passKeys:!0,passNode:!0});function h(y,x,v){if(y.type==="raw"&&v&&typeof x=="number")return u?v.children.splice(x,1):v.children[x]={type:"text",value:y.value},x;if(y.type==="element"){let k;for(k in Cf)if(Object.hasOwn(Cf,k)&&Object.hasOwn(y.properties,k)){const w=y.properties[k],T=Cf[k];(T===null||T.includes(y.tagName))&&(y.properties[k]=p(String(w||""),k,y))}}if(y.type==="element"){let k=r?!r.includes(y.tagName):d?d.includes(y.tagName):!1;if(!k&&i&&typeof x=="number"&&(k=!i(y,x,v)),k&&v&&typeof x=="number")return m&&y.children?v.children.splice(x,1,...y.children):v.children.splice(x,1),x}}}function l5(e){const a=e.indexOf(":"),r=e.indexOf("?"),i=e.indexOf("#"),c=e.indexOf("/");return a===-1||c!==-1&&a>c||r!==-1&&a>r||i!==-1&&a>i||e5.test(e.slice(0,a))?e:""}function Eb(e,a){const r=String(e);if(typeof a!="string")throw new TypeError("Expected character");let i=0,c=r.indexOf(a);for(;c!==-1;)i++,c=r.indexOf(a,c+a.length);return i}function s5(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function i5(e,a,r){const c=Wc((r||{}).ignore||[]),d=o5(a);let u=-1;for(;++u<d.length;)W1(e,"text",m);function m(h,y){let x=-1,v;for(;++x<y.length;){const k=y[x],w=v?v.children:void 0;if(c(k,w?w.indexOf(k):void 0,v))return;v=k}if(v)return p(h,y)}function p(h,y){const x=y[y.length-1],v=d[u][0],k=d[u][1];let w=0;const j=x.children.indexOf(h);let C=!1,$=[];v.lastIndex=0;let M=v.exec(h.value);for(;M;){const ee=M.index,ne={index:M.index,input:M.input,stack:[...y,h]};let A=k(...M,ne);if(typeof A=="string"&&(A=A.length>0?{type:"text",value:A}:void 0),A===!1?v.lastIndex=ee+1:(w!==ee&&$.push({type:"text",value:h.value.slice(w,ee)}),Array.isArray(A)?$.push(...A):A&&$.push(A),w=ee+M[0].length,C=!0),!v.global)break;M=v.exec(h.value)}return C?(w<h.value.length&&$.push({type:"text",value:h.value.slice(w)}),x.children.splice(j,1,...$)):$=[h],j+$.length}}function o5(e){const a=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const r=!e[0]||Array.isArray(e[0])?e:[e];let i=-1;for(;++i<r.length;){const c=r[i];a.push([c5(c[0]),u5(c[1])])}return a}function c5(e){return typeof e=="string"?new RegExp(s5(e),"g"):e}function u5(e){return typeof e=="function"?e:function(){return e}}const Bf="phrasing",Uf=["autolink","link","image","label"];function d5(){return{transforms:[y5],enter:{literalAutolink:p5,literalAutolinkEmail:Hf,literalAutolinkHttp:Hf,literalAutolinkWww:Hf},exit:{literalAutolink:x5,literalAutolinkEmail:g5,literalAutolinkHttp:m5,literalAutolinkWww:h5}}}function f5(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Bf,notInConstruct:Uf},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Bf,notInConstruct:Uf},{character:":",before:"[ps]",after:"\\/",inConstruct:Bf,notInConstruct:Uf}]}}function p5(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Hf(e){this.config.enter.autolinkProtocol.call(this,e)}function m5(e){this.config.exit.autolinkProtocol.call(this,e)}function h5(e){this.config.exit.data.call(this,e);const a=this.stack[this.stack.length-1];a.type,a.url="http://"+this.sliceSerialize(e)}function g5(e){this.config.exit.autolinkEmail.call(this,e)}function x5(e){this.exit(e)}function y5(e){i5(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,b5],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),v5]],{ignore:["link","linkReference"]})}function b5(e,a,r,i,c){let d="";if(!t0(c)||(/^w/i.test(a)&&(r=a+r,a="",d="http://"),!k5(r)))return!1;const u=_5(r+i);if(!u[0])return!1;const m={type:"link",title:null,url:d+a+u[0],children:[{type:"text",value:a+u[0]}]};return u[1]?[m,{type:"text",value:u[1]}]:m}function v5(e,a,r,i){return!t0(i,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+a+"@"+r,children:[{type:"text",value:a+"@"+r}]}}function k5(e){const a=e.split(".");return!(a.length<2||a[a.length-1]&&(/_/.test(a[a.length-1])||!/[a-zA-Z\d]/.test(a[a.length-1]))||a[a.length-2]&&(/_/.test(a[a.length-2])||!/[a-zA-Z\d]/.test(a[a.length-2])))}function _5(e){const a=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!a)return[e,void 0];e=e.slice(0,a.index);let r=a[0],i=r.indexOf(")");const c=Eb(e,"(");let d=Eb(e,")");for(;i!==-1&&c>d;)e+=r.slice(0,i+1),r=r.slice(i+1),i=r.indexOf(")"),d++;return[e,r]}function t0(e,a){const r=e.input.charCodeAt(e.index-1);return(e.index===0||Jr(r)||Qc(r))&&(!a||r!==47)}n0.peek=D5;function w5(){this.buffer()}function j5(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function S5(){this.buffer()}function N5(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function C5(e){const a=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=aa(this.sliceSerialize(e)).toLowerCase(),r.label=a}function E5(e){this.exit(e)}function T5(e){const a=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=aa(this.sliceSerialize(e)).toLowerCase(),r.label=a}function A5(e){this.exit(e)}function D5(){return"["}function n0(e,a,r,i){const c=r.createTracker(i);let d=c.move("[^");const u=r.enter("footnoteReference"),m=r.enter("reference");return d+=c.move(r.safe(r.associationId(e),{after:"]",before:d})),m(),u(),d+=c.move("]"),d}function M5(){return{enter:{gfmFootnoteCallString:w5,gfmFootnoteCall:j5,gfmFootnoteDefinitionLabelString:S5,gfmFootnoteDefinition:N5},exit:{gfmFootnoteCallString:C5,gfmFootnoteCall:E5,gfmFootnoteDefinitionLabelString:T5,gfmFootnoteDefinition:A5}}}function z5(e){let a=!1;return e&&e.firstLineBlank&&(a=!0),{handlers:{footnoteDefinition:r,footnoteReference:n0},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(i,c,d,u){const m=d.createTracker(u);let p=m.move("[^");const h=d.enter("footnoteDefinition"),y=d.enter("label");return p+=m.move(d.safe(d.associationId(i),{before:p,after:"]"})),y(),p+=m.move("]:"),i.children&&i.children.length>0&&(m.shift(4),p+=m.move((a?`
|
||
`:" ")+d.indentLines(d.containerFlow(i,m.current()),a?a0:R5))),h(),p}}function R5(e,a,r){return a===0?e:a0(e,a,r)}function a0(e,a,r){return(r?"":" ")+e}const O5=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];r0.peek=H5;function L5(){return{canContainEols:["delete"],enter:{strikethrough:B5},exit:{strikethrough:U5}}}function $5(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:O5}],handlers:{delete:r0}}}function B5(e){this.enter({type:"delete",children:[]},e)}function U5(e){this.exit(e)}function r0(e,a,r,i){const c=r.createTracker(i),d=r.enter("strikethrough");let u=c.move("~~");return u+=r.containerPhrasing(e,{...c.current(),before:u,after:"~"}),u+=c.move("~~"),d(),u}function H5(){return"~"}function q5(e){return e.length}function F5(e,a){const r=a||{},i=(r.align||[]).concat(),c=r.stringLength||q5,d=[],u=[],m=[],p=[];let h=0,y=-1;for(;++y<e.length;){const T=[],j=[];let C=-1;for(e[y].length>h&&(h=e[y].length);++C<e[y].length;){const $=I5(e[y][C]);if(r.alignDelimiters!==!1){const M=c($);j[C]=M,(p[C]===void 0||M>p[C])&&(p[C]=M)}T.push($)}u[y]=T,m[y]=j}let x=-1;if(typeof i=="object"&&"length"in i)for(;++x<h;)d[x]=Tb(i[x]);else{const T=Tb(i);for(;++x<h;)d[x]=T}x=-1;const v=[],k=[];for(;++x<h;){const T=d[x];let j="",C="";T===99?(j=":",C=":"):T===108?j=":":T===114&&(C=":");let $=r.alignDelimiters===!1?1:Math.max(1,p[x]-j.length-C.length);const M=j+"-".repeat($)+C;r.alignDelimiters!==!1&&($=j.length+$+C.length,$>p[x]&&(p[x]=$),k[x]=$),v[x]=M}u.splice(1,0,v),m.splice(1,0,k),y=-1;const w=[];for(;++y<u.length;){const T=u[y],j=m[y];x=-1;const C=[];for(;++x<h;){const $=T[x]||"";let M="",ee="";if(r.alignDelimiters!==!1){const ne=p[x]-(j[x]||0),A=d[x];A===114?M=" ".repeat(ne):A===99?ne%2?(M=" ".repeat(ne/2+.5),ee=" ".repeat(ne/2-.5)):(M=" ".repeat(ne/2),ee=M):ee=" ".repeat(ne)}r.delimiterStart!==!1&&!x&&C.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&$==="")&&(r.delimiterStart!==!1||x)&&C.push(" "),r.alignDelimiters!==!1&&C.push(M),C.push($),r.alignDelimiters!==!1&&C.push(ee),r.padding!==!1&&C.push(" "),(r.delimiterEnd!==!1||x!==h-1)&&C.push("|")}w.push(r.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return w.join(`
|
||
`)}function I5(e){return e==null?"":String(e)}function Tb(e){const a=typeof e=="string"?e.codePointAt(0):0;return a===67||a===99?99:a===76||a===108?108:a===82||a===114?114:0}function Y5(e,a,r,i){const c=r.enter("blockquote"),d=r.createTracker(i);d.move("> "),d.shift(2);const u=r.indentLines(r.containerFlow(e,d.current()),G5);return c(),u}function G5(e,a,r){return">"+(r?"":" ")+e}function V5(e,a){return Ab(e,a.inConstruct,!0)&&!Ab(e,a.notInConstruct,!1)}function Ab(e,a,r){if(typeof a=="string"&&(a=[a]),!a||a.length===0)return r;let i=-1;for(;++i<a.length;)if(e.includes(a[i]))return!0;return!1}function Db(e,a,r,i){let c=-1;for(;++c<r.unsafe.length;)if(r.unsafe[c].character===`
|
||
`&&V5(r.stack,r.unsafe[c]))return/[ \t]/.test(i.before)?"":" ";return`\\
|
||
`}function K5(e,a){const r=String(e);let i=r.indexOf(a),c=i,d=0,u=0;if(typeof a!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===c?++d>u&&(u=d):d=1,c=i+a.length,i=r.indexOf(a,c);return u}function P5(e,a){return!!(a.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function X5(e){const a=e.options.fence||"`";if(a!=="`"&&a!=="~")throw new Error("Cannot serialize code with `"+a+"` for `options.fence`, expected `` ` `` or `~`");return a}function Q5(e,a,r,i){const c=X5(r),d=e.value||"",u=c==="`"?"GraveAccent":"Tilde";if(P5(e,r)){const x=r.enter("codeIndented"),v=r.indentLines(d,Z5);return x(),v}const m=r.createTracker(i),p=c.repeat(Math.max(K5(d,c)+1,3)),h=r.enter("codeFenced");let y=m.move(p);if(e.lang){const x=r.enter(`codeFencedLang${u}`);y+=m.move(r.safe(e.lang,{before:y,after:" ",encode:["`"],...m.current()})),x()}if(e.lang&&e.meta){const x=r.enter(`codeFencedMeta${u}`);y+=m.move(" "),y+=m.move(r.safe(e.meta,{before:y,after:`
|
||
`,encode:["`"],...m.current()})),x()}return y+=m.move(`
|
||
`),d&&(y+=m.move(d+`
|
||
`)),y+=m.move(p),h(),y}function Z5(e,a,r){return(r?"":" ")+e}function wm(e){const a=e.options.quote||'"';if(a!=='"'&&a!=="'")throw new Error("Cannot serialize title with `"+a+"` for `options.quote`, expected `\"`, or `'`");return a}function J5(e,a,r,i){const c=wm(r),d=c==='"'?"Quote":"Apostrophe",u=r.enter("definition");let m=r.enter("label");const p=r.createTracker(i);let h=p.move("[");return h+=p.move(r.safe(r.associationId(e),{before:h,after:"]",...p.current()})),h+=p.move("]: "),m(),!e.url||/[\0- \u007F]/.test(e.url)?(m=r.enter("destinationLiteral"),h+=p.move("<"),h+=p.move(r.safe(e.url,{before:h,after:">",...p.current()})),h+=p.move(">")):(m=r.enter("destinationRaw"),h+=p.move(r.safe(e.url,{before:h,after:e.title?" ":`
|
||
`,...p.current()}))),m(),e.title&&(m=r.enter(`title${d}`),h+=p.move(" "+c),h+=p.move(r.safe(e.title,{before:h,after:c,...p.current()})),h+=p.move(c),m()),u(),h}function W5(e){const a=e.options.emphasis||"*";if(a!=="*"&&a!=="_")throw new Error("Cannot serialize emphasis with `"+a+"` for `options.emphasis`, expected `*`, or `_`");return a}function Di(e){return"&#x"+e.toString(16).toUpperCase()+";"}function $c(e,a,r){const i=os(e),c=os(a);return i===void 0?c===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:c===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?c===void 0?{inside:!1,outside:!1}:c===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:c===void 0?{inside:!1,outside:!1}:c===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}l0.peek=e4;function l0(e,a,r,i){const c=W5(r),d=r.enter("emphasis"),u=r.createTracker(i),m=u.move(c);let p=u.move(r.containerPhrasing(e,{after:c,before:m,...u.current()}));const h=p.charCodeAt(0),y=$c(i.before.charCodeAt(i.before.length-1),h,c);y.inside&&(p=Di(h)+p.slice(1));const x=p.charCodeAt(p.length-1),v=$c(i.after.charCodeAt(0),x,c);v.inside&&(p=p.slice(0,-1)+Di(x));const k=u.move(c);return d(),r.attentionEncodeSurroundingInfo={after:v.outside,before:y.outside},m+p+k}function e4(e,a,r){return r.options.emphasis||"*"}function t4(e,a){let r=!1;return vm(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return r=!0,vp}),!!((!e.depth||e.depth<3)&&pm(e)&&(a.options.setext||r))}function n4(e,a,r,i){const c=Math.max(Math.min(6,e.depth||1),1),d=r.createTracker(i);if(t4(e,r)){const y=r.enter("headingSetext"),x=r.enter("phrasing"),v=r.containerPhrasing(e,{...d.current(),before:`
|
||
`,after:`
|
||
`});return x(),y(),v+`
|
||
`+(c===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(`
|
||
`))+1))}const u="#".repeat(c),m=r.enter("headingAtx"),p=r.enter("phrasing");d.move(u+" ");let h=r.containerPhrasing(e,{before:"# ",after:`
|
||
`,...d.current()});return/^[\t ]/.test(h)&&(h=Di(h.charCodeAt(0))+h.slice(1)),h=h?u+" "+h:u,r.options.closeAtx&&(h+=" "+u),p(),m(),h}s0.peek=a4;function s0(e){return e.value||""}function a4(){return"<"}i0.peek=r4;function i0(e,a,r,i){const c=wm(r),d=c==='"'?"Quote":"Apostrophe",u=r.enter("image");let m=r.enter("label");const p=r.createTracker(i);let h=p.move("![");return h+=p.move(r.safe(e.alt,{before:h,after:"]",...p.current()})),h+=p.move("]("),m(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(m=r.enter("destinationLiteral"),h+=p.move("<"),h+=p.move(r.safe(e.url,{before:h,after:">",...p.current()})),h+=p.move(">")):(m=r.enter("destinationRaw"),h+=p.move(r.safe(e.url,{before:h,after:e.title?" ":")",...p.current()}))),m(),e.title&&(m=r.enter(`title${d}`),h+=p.move(" "+c),h+=p.move(r.safe(e.title,{before:h,after:c,...p.current()})),h+=p.move(c),m()),h+=p.move(")"),u(),h}function r4(){return"!"}o0.peek=l4;function o0(e,a,r,i){const c=e.referenceType,d=r.enter("imageReference");let u=r.enter("label");const m=r.createTracker(i);let p=m.move("![");const h=r.safe(e.alt,{before:p,after:"]",...m.current()});p+=m.move(h+"]["),u();const y=r.stack;r.stack=[],u=r.enter("reference");const x=r.safe(r.associationId(e),{before:p,after:"]",...m.current()});return u(),r.stack=y,d(),c==="full"||!h||h!==x?p+=m.move(x+"]"):c==="shortcut"?p=p.slice(0,-1):p+=m.move("]"),p}function l4(){return"!"}c0.peek=s4;function c0(e,a,r){let i=e.value||"",c="`",d=-1;for(;new RegExp("(^|[^`])"+c+"([^`]|$)").test(i);)c+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++d<r.unsafe.length;){const u=r.unsafe[d],m=r.compilePattern(u);let p;if(u.atBreak)for(;p=m.exec(i);){let h=p.index;i.charCodeAt(h)===10&&i.charCodeAt(h-1)===13&&h--,i=i.slice(0,h)+" "+i.slice(p.index+1)}}return c+i+c}function s4(){return"`"}function u0(e,a){const r=pm(e);return!!(!a.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(r===e.url||"mailto:"+r===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}d0.peek=i4;function d0(e,a,r,i){const c=wm(r),d=c==='"'?"Quote":"Apostrophe",u=r.createTracker(i);let m,p;if(u0(e,r)){const y=r.stack;r.stack=[],m=r.enter("autolink");let x=u.move("<");return x+=u.move(r.containerPhrasing(e,{before:x,after:">",...u.current()})),x+=u.move(">"),m(),r.stack=y,x}m=r.enter("link"),p=r.enter("label");let h=u.move("[");return h+=u.move(r.containerPhrasing(e,{before:h,after:"](",...u.current()})),h+=u.move("]("),p(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(p=r.enter("destinationLiteral"),h+=u.move("<"),h+=u.move(r.safe(e.url,{before:h,after:">",...u.current()})),h+=u.move(">")):(p=r.enter("destinationRaw"),h+=u.move(r.safe(e.url,{before:h,after:e.title?" ":")",...u.current()}))),p(),e.title&&(p=r.enter(`title${d}`),h+=u.move(" "+c),h+=u.move(r.safe(e.title,{before:h,after:c,...u.current()})),h+=u.move(c),p()),h+=u.move(")"),m(),h}function i4(e,a,r){return u0(e,r)?"<":"["}f0.peek=o4;function f0(e,a,r,i){const c=e.referenceType,d=r.enter("linkReference");let u=r.enter("label");const m=r.createTracker(i);let p=m.move("[");const h=r.containerPhrasing(e,{before:p,after:"]",...m.current()});p+=m.move(h+"]["),u();const y=r.stack;r.stack=[],u=r.enter("reference");const x=r.safe(r.associationId(e),{before:p,after:"]",...m.current()});return u(),r.stack=y,d(),c==="full"||!h||h!==x?p+=m.move(x+"]"):c==="shortcut"?p=p.slice(0,-1):p+=m.move("]"),p}function o4(){return"["}function jm(e){const a=e.options.bullet||"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bullet`, expected `*`, `+`, or `-`");return a}function c4(e){const a=jm(e),r=e.options.bulletOther;if(!r)return a==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===a)throw new Error("Expected `bullet` (`"+a+"`) and `bulletOther` (`"+r+"`) to be different");return r}function u4(e){const a=e.options.bulletOrdered||".";if(a!=="."&&a!==")")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOrdered`, expected `.` or `)`");return a}function p0(e){const a=e.options.rule||"*";if(a!=="*"&&a!=="-"&&a!=="_")throw new Error("Cannot serialize rules with `"+a+"` for `options.rule`, expected `*`, `-`, or `_`");return a}function d4(e,a,r,i){const c=r.enter("list"),d=r.bulletCurrent;let u=e.ordered?u4(r):jm(r);const m=e.ordered?u==="."?")":".":c4(r);let p=a&&r.bulletLastUsed?u===r.bulletLastUsed:!1;if(!e.ordered){const y=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&y&&(!y.children||!y.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(p=!0),p0(r)===u&&y){let x=-1;for(;++x<e.children.length;){const v=e.children[x];if(v&&v.type==="listItem"&&v.children&&v.children[0]&&v.children[0].type==="thematicBreak"){p=!0;break}}}}p&&(u=m),r.bulletCurrent=u;const h=r.containerFlow(e,i);return r.bulletLastUsed=u,r.bulletCurrent=d,c(),h}function f4(e){const a=e.options.listItemIndent||"one";if(a!=="tab"&&a!=="one"&&a!=="mixed")throw new Error("Cannot serialize items with `"+a+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return a}function p4(e,a,r,i){const c=f4(r);let d=r.bulletCurrent||jm(r);a&&a.type==="list"&&a.ordered&&(d=(typeof a.start=="number"&&a.start>-1?a.start:1)+(r.options.incrementListMarker===!1?0:a.children.indexOf(e))+d);let u=d.length+1;(c==="tab"||c==="mixed"&&(a&&a.type==="list"&&a.spread||e.spread))&&(u=Math.ceil(u/4)*4);const m=r.createTracker(i);m.move(d+" ".repeat(u-d.length)),m.shift(u);const p=r.enter("listItem"),h=r.indentLines(r.containerFlow(e,m.current()),y);return p(),h;function y(x,v,k){return v?(k?"":" ".repeat(u))+x:(k?d:d+" ".repeat(u-d.length))+x}}function m4(e,a,r,i){const c=r.enter("paragraph"),d=r.enter("phrasing"),u=r.containerPhrasing(e,i);return d(),c(),u}const h4=Wc(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function g4(e,a,r,i){return(e.children.some(function(u){return h4(u)})?r.containerPhrasing:r.containerFlow).call(r,e,i)}function x4(e){const a=e.options.strong||"*";if(a!=="*"&&a!=="_")throw new Error("Cannot serialize strong with `"+a+"` for `options.strong`, expected `*`, or `_`");return a}m0.peek=y4;function m0(e,a,r,i){const c=x4(r),d=r.enter("strong"),u=r.createTracker(i),m=u.move(c+c);let p=u.move(r.containerPhrasing(e,{after:c,before:m,...u.current()}));const h=p.charCodeAt(0),y=$c(i.before.charCodeAt(i.before.length-1),h,c);y.inside&&(p=Di(h)+p.slice(1));const x=p.charCodeAt(p.length-1),v=$c(i.after.charCodeAt(0),x,c);v.inside&&(p=p.slice(0,-1)+Di(x));const k=u.move(c+c);return d(),r.attentionEncodeSurroundingInfo={after:v.outside,before:y.outside},m+p+k}function y4(e,a,r){return r.options.strong||"*"}function b4(e,a,r,i){return r.safe(e.value,i)}function v4(e){const a=e.options.ruleRepetition||3;if(a<3)throw new Error("Cannot serialize rules with repetition `"+a+"` for `options.ruleRepetition`, expected `3` or more");return a}function k4(e,a,r){const i=(p0(r)+(r.options.ruleSpaces?" ":"")).repeat(v4(r));return r.options.ruleSpaces?i.slice(0,-1):i}const h0={blockquote:Y5,break:Db,code:Q5,definition:J5,emphasis:l0,hardBreak:Db,heading:n4,html:s0,image:i0,imageReference:o0,inlineCode:c0,link:d0,linkReference:f0,list:d4,listItem:p4,paragraph:m4,root:g4,strong:m0,text:b4,thematicBreak:k4};function _4(){return{enter:{table:w4,tableData:Mb,tableHeader:Mb,tableRow:S4},exit:{codeText:N4,table:j4,tableData:qf,tableHeader:qf,tableRow:qf}}}function w4(e){const a=e._align;this.enter({type:"table",align:a.map(function(r){return r==="none"?null:r}),children:[]},e),this.data.inTable=!0}function j4(e){this.exit(e),this.data.inTable=void 0}function S4(e){this.enter({type:"tableRow",children:[]},e)}function qf(e){this.exit(e)}function Mb(e){this.enter({type:"tableCell",children:[]},e)}function N4(e){let a=this.resume();this.data.inTable&&(a=a.replace(/\\([\\|])/g,C4));const r=this.stack[this.stack.length-1];r.type,r.value=a,this.exit(e)}function C4(e,a){return a==="|"?a:e}function E4(e){const a=e||{},r=a.tableCellPadding,i=a.tablePipeAlign,c=a.stringLength,d=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
||
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:u,tableCell:p,tableRow:m}};function u(k,w,T,j){return h(y(k,T,j),k.align)}function m(k,w,T,j){const C=x(k,T,j),$=h([C]);return $.slice(0,$.indexOf(`
|
||
`))}function p(k,w,T,j){const C=T.enter("tableCell"),$=T.enter("phrasing"),M=T.containerPhrasing(k,{...j,before:d,after:d});return $(),C(),M}function h(k,w){return F5(k,{align:w,alignDelimiters:i,padding:r,stringLength:c})}function y(k,w,T){const j=k.children;let C=-1;const $=[],M=w.enter("table");for(;++C<j.length;)$[C]=x(j[C],w,T);return M(),$}function x(k,w,T){const j=k.children;let C=-1;const $=[],M=w.enter("tableRow");for(;++C<j.length;)$[C]=p(j[C],k,w,T);return M(),$}function v(k,w,T){let j=h0.inlineCode(k,w,T);return T.stack.includes("tableCell")&&(j=j.replace(/\|/g,"\\$&")),j}}function T4(){return{exit:{taskListCheckValueChecked:zb,taskListCheckValueUnchecked:zb,paragraph:D4}}}function A4(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:M4}}}function zb(e){const a=this.stack[this.stack.length-2];a.type,a.checked=e.type==="taskListCheckValueChecked"}function D4(e){const a=this.stack[this.stack.length-2];if(a&&a.type==="listItem"&&typeof a.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const i=r.children[0];if(i&&i.type==="text"){const c=a.children;let d=-1,u;for(;++d<c.length;){const m=c[d];if(m.type==="paragraph"){u=m;break}}u===r&&(i.value=i.value.slice(1),i.value.length===0?r.children.shift():r.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,r.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function M4(e,a,r,i){const c=e.children[0],d=typeof e.checked=="boolean"&&c&&c.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",m=r.createTracker(i);d&&m.move(u);let p=h0.listItem(e,a,r,{...i,...m.current()});return d&&(p=p.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),p;function h(y){return y+u}}function z4(){return[d5(),M5(),L5(),_4(),T4()]}function R4(e){return{extensions:[f5(),z5(e),$5(),E4(e),A4()]}}const O4={tokenize:q4,partial:!0},g0={tokenize:F4,partial:!0},x0={tokenize:I4,partial:!0},y0={tokenize:Y4,partial:!0},L4={tokenize:G4,partial:!0},b0={name:"wwwAutolink",tokenize:U4,previous:k0},v0={name:"protocolAutolink",tokenize:H4,previous:_0},qa={name:"emailAutolink",tokenize:B4,previous:w0},ga={};function $4(){return{text:ga}}let Vr=48;for(;Vr<123;)ga[Vr]=qa,Vr++,Vr===58?Vr=65:Vr===91&&(Vr=97);ga[43]=qa;ga[45]=qa;ga[46]=qa;ga[95]=qa;ga[72]=[qa,v0];ga[104]=[qa,v0];ga[87]=[qa,b0];ga[119]=[qa,b0];function B4(e,a,r){const i=this;let c,d;return u;function u(x){return!jp(x)||!w0.call(i,i.previous)||Sm(i.events)?r(x):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),m(x))}function m(x){return jp(x)?(e.consume(x),m):x===64?(e.consume(x),p):r(x)}function p(x){return x===46?e.check(L4,y,h)(x):x===45||x===95||an(x)?(d=!0,e.consume(x),p):y(x)}function h(x){return e.consume(x),c=!0,p}function y(x){return d&&c&&on(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),a(x)):r(x)}}function U4(e,a,r){const i=this;return c;function c(u){return u!==87&&u!==119||!k0.call(i,i.previous)||Sm(i.events)?r(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(O4,e.attempt(g0,e.attempt(x0,d),r),r)(u))}function d(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),a(u)}}function H4(e,a,r){const i=this;let c="",d=!1;return u;function u(x){return(x===72||x===104)&&_0.call(i,i.previous)&&!Sm(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),c+=String.fromCodePoint(x),e.consume(x),m):r(x)}function m(x){if(on(x)&&c.length<5)return c+=String.fromCodePoint(x),e.consume(x),m;if(x===58){const v=c.toLowerCase();if(v==="http"||v==="https")return e.consume(x),p}return r(x)}function p(x){return x===47?(e.consume(x),d?h:(d=!0,p)):r(x)}function h(x){return x===null||Rc(x)||yt(x)||Jr(x)||Qc(x)?r(x):e.attempt(g0,e.attempt(x0,y),r)(x)}function y(x){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),a(x)}}function q4(e,a,r){let i=0;return c;function c(u){return(u===87||u===119)&&i<3?(i++,e.consume(u),c):u===46&&i===3?(e.consume(u),d):r(u)}function d(u){return u===null?r(u):a(u)}}function F4(e,a,r){let i,c,d;return u;function u(h){return h===46||h===95?e.check(y0,p,m)(h):h===null||yt(h)||Jr(h)||h!==45&&Qc(h)?p(h):(d=!0,e.consume(h),u)}function m(h){return h===95?i=!0:(c=i,i=void 0),e.consume(h),u}function p(h){return c||i||!d?r(h):a(h)}}function I4(e,a){let r=0,i=0;return c;function c(u){return u===40?(r++,e.consume(u),c):u===41&&i<r?d(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(y0,a,d)(u):u===null||yt(u)||Jr(u)?a(u):(e.consume(u),c)}function d(u){return u===41&&i++,e.consume(u),c}}function Y4(e,a,r){return i;function i(m){return m===33||m===34||m===39||m===41||m===42||m===44||m===46||m===58||m===59||m===63||m===95||m===126?(e.consume(m),i):m===38?(e.consume(m),d):m===93?(e.consume(m),c):m===60||m===null||yt(m)||Jr(m)?a(m):r(m)}function c(m){return m===null||m===40||m===91||yt(m)||Jr(m)?a(m):i(m)}function d(m){return on(m)?u(m):r(m)}function u(m){return m===59?(e.consume(m),i):on(m)?(e.consume(m),u):r(m)}}function G4(e,a,r){return i;function i(d){return e.consume(d),c}function c(d){return an(d)?r(d):a(d)}}function k0(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||yt(e)}function _0(e){return!on(e)}function w0(e){return!(e===47||jp(e))}function jp(e){return e===43||e===45||e===46||e===95||an(e)}function Sm(e){let a=e.length,r=!1;for(;a--;){const i=e[a][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){r=!0;break}if(i._gfmAutolinkLiteralWalkedInto){r=!1;break}}return e.length>0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const V4={tokenize:eT,partial:!0};function K4(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Z4,continuation:{tokenize:J4},exit:W4}},text:{91:{name:"gfmFootnoteCall",tokenize:Q4},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:P4,resolveTo:X4}}}}function P4(e,a,r){const i=this;let c=i.events.length;const d=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let u;for(;c--;){const p=i.events[c][1];if(p.type==="labelImage"){u=p;break}if(p.type==="gfmFootnoteCall"||p.type==="labelLink"||p.type==="label"||p.type==="image"||p.type==="link")break}return m;function m(p){if(!u||!u._balanced)return r(p);const h=aa(i.sliceSerialize({start:u.end,end:i.now()}));return h.codePointAt(0)!==94||!d.includes(h.slice(1))?r(p):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),a(p))}}function X4(e,a){let r=e.length;for(;r--;)if(e[r][1].type==="labelImage"&&e[r][0]==="enter"){e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},c={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};c.end.column++,c.end.offset++,c.end._bufferIndex++;const d={type:"gfmFootnoteCallString",start:Object.assign({},c.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},d.start),end:Object.assign({},d.end)},m=[e[r+1],e[r+2],["enter",i,a],e[r+3],e[r+4],["enter",c,a],["exit",c,a],["enter",d,a],["enter",u,a],["exit",u,a],["exit",d,a],e[e.length-2],e[e.length-1],["exit",i,a]];return e.splice(r,e.length-r+1,...m),e}function Q4(e,a,r){const i=this,c=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let d=0,u;return m;function m(x){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),p}function p(x){return x!==94?r(x):(e.enter("gfmFootnoteCallMarker"),e.consume(x),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(x){if(d>999||x===93&&!u||x===null||x===91||yt(x))return r(x);if(x===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return c.includes(aa(i.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),a):r(x)}return yt(x)||(u=!0),d++,e.consume(x),x===92?y:h}function y(x){return x===91||x===92||x===93?(e.consume(x),d++,h):h(x)}}function Z4(e,a,r){const i=this,c=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let d,u=0,m;return p;function p(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",y):r(w)}function y(w){if(u>999||w===93&&!m||w===null||w===91||yt(w))return r(w);if(w===93){e.exit("chunkString");const T=e.exit("gfmFootnoteDefinitionLabelString");return d=aa(i.sliceSerialize(T)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return yt(w)||(m=!0),u++,e.consume(w),w===92?x:y}function x(w){return w===91||w===92||w===93?(e.consume(w),u++,y):y(w)}function v(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),c.includes(d)||c.push(d),at(e,k,"gfmFootnoteDefinitionWhitespace")):r(w)}function k(w){return a(w)}}function J4(e,a,r){return e.check(Hi,a,e.attempt(V4,a,r))}function W4(e){e.exit("gfmFootnoteDefinition")}function eT(e,a,r){const i=this;return at(e,c,"gfmFootnoteDefinitionIndent",5);function c(d){const u=i.events[i.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?a(d):r(d)}}function tT(e){let r=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:d,resolveAll:c};return r==null&&(r=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function c(u,m){let p=-1;for(;++p<u.length;)if(u[p][0]==="enter"&&u[p][1].type==="strikethroughSequenceTemporary"&&u[p][1]._close){let h=p;for(;h--;)if(u[h][0]==="exit"&&u[h][1].type==="strikethroughSequenceTemporary"&&u[h][1]._open&&u[p][1].end.offset-u[p][1].start.offset===u[h][1].end.offset-u[h][1].start.offset){u[p][1].type="strikethroughSequence",u[h][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},u[h][1].start),end:Object.assign({},u[p][1].end)},x={type:"strikethroughText",start:Object.assign({},u[h][1].end),end:Object.assign({},u[p][1].start)},v=[["enter",y,m],["enter",u[h][1],m],["exit",u[h][1],m],["enter",x,m]],k=m.parser.constructs.insideSpan.null;k&&Mn(v,v.length,0,Zc(k,u.slice(h+1,p),m)),Mn(v,v.length,0,[["exit",x,m],["enter",u[p][1],m],["exit",u[p][1],m],["exit",y,m]]),Mn(u,h-1,p-h+3,v),p=h+v.length-2;break}}for(p=-1;++p<u.length;)u[p][1].type==="strikethroughSequenceTemporary"&&(u[p][1].type="data");return u}function d(u,m,p){const h=this.previous,y=this.events;let x=0;return v;function v(w){return h===126&&y[y.length-1][1].type!=="characterEscape"?p(w):(u.enter("strikethroughSequenceTemporary"),k(w))}function k(w){const T=os(h);if(w===126)return x>1?p(w):(u.consume(w),x++,k);if(x<2&&!r)return p(w);const j=u.exit("strikethroughSequenceTemporary"),C=os(w);return j._open=!C||C===2&&!!T,j._close=!T||T===2&&!!C,m(w)}}}class nT{constructor(){this.map=[]}add(a,r,i){aT(this,a,r,i)}consume(a){if(this.map.sort(function(d,u){return d[0]-u[0]}),this.map.length===0)return;let r=this.map.length;const i=[];for(;r>0;)r-=1,i.push(a.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),a.length=this.map[r][0];i.push(a.slice()),a.length=0;let c=i.pop();for(;c;){for(const d of c)a.push(d);c=i.pop()}this.map.length=0}}function aT(e,a,r,i){let c=0;if(!(r===0&&i.length===0)){for(;c<e.map.length;){if(e.map[c][0]===a){e.map[c][1]+=r,e.map[c][2].push(...i);return}c+=1}e.map.push([a,r,i])}}function rT(e,a){let r=!1;const i=[];for(;a<e.length;){const c=e[a];if(r){if(c[0]==="enter")c[1].type==="tableContent"&&i.push(e[a+1][1].type==="tableDelimiterMarker"?"left":"none");else if(c[1].type==="tableContent"){if(e[a-1][1].type==="tableDelimiterMarker"){const d=i.length-1;i[d]=i[d]==="left"?"center":"right"}}else if(c[1].type==="tableDelimiterRow")break}else c[0]==="enter"&&c[1].type==="tableDelimiterRow"&&(r=!0);a+=1}return i}function lT(){return{flow:{null:{name:"table",tokenize:sT,resolveAll:iT}}}}function sT(e,a,r){const i=this;let c=0,d=0,u;return m;function m(Y){let F=i.events.length-1;for(;F>-1;){const le=i.events[F][1].type;if(le==="lineEnding"||le==="linePrefix")F--;else break}const I=F>-1?i.events[F][1].type:null,Q=I==="tableHead"||I==="tableRow"?A:p;return Q===A&&i.parser.lazy[i.now().line]?r(Y):Q(Y)}function p(Y){return e.enter("tableHead"),e.enter("tableRow"),h(Y)}function h(Y){return Y===124||(u=!0,d+=1),y(Y)}function y(Y){return Y===null?r(Y):Re(Y)?d>1?(d=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(Y),e.exit("lineEnding"),k):r(Y):Ze(Y)?at(e,y,"whitespace")(Y):(d+=1,u&&(u=!1,c+=1),Y===124?(e.enter("tableCellDivider"),e.consume(Y),e.exit("tableCellDivider"),u=!0,y):(e.enter("data"),x(Y)))}function x(Y){return Y===null||Y===124||yt(Y)?(e.exit("data"),y(Y)):(e.consume(Y),Y===92?v:x)}function v(Y){return Y===92||Y===124?(e.consume(Y),x):x(Y)}function k(Y){return i.interrupt=!1,i.parser.lazy[i.now().line]?r(Y):(e.enter("tableDelimiterRow"),u=!1,Ze(Y)?at(e,w,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):w(Y))}function w(Y){return Y===45||Y===58?j(Y):Y===124?(u=!0,e.enter("tableCellDivider"),e.consume(Y),e.exit("tableCellDivider"),T):ne(Y)}function T(Y){return Ze(Y)?at(e,j,"whitespace")(Y):j(Y)}function j(Y){return Y===58?(d+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(Y),e.exit("tableDelimiterMarker"),C):Y===45?(d+=1,C(Y)):Y===null||Re(Y)?ee(Y):ne(Y)}function C(Y){return Y===45?(e.enter("tableDelimiterFiller"),$(Y)):ne(Y)}function $(Y){return Y===45?(e.consume(Y),$):Y===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(Y),e.exit("tableDelimiterMarker"),M):(e.exit("tableDelimiterFiller"),M(Y))}function M(Y){return Ze(Y)?at(e,ee,"whitespace")(Y):ee(Y)}function ee(Y){return Y===124?w(Y):Y===null||Re(Y)?!u||c!==d?ne(Y):(e.exit("tableDelimiterRow"),e.exit("tableHead"),a(Y)):ne(Y)}function ne(Y){return r(Y)}function A(Y){return e.enter("tableRow"),G(Y)}function G(Y){return Y===124?(e.enter("tableCellDivider"),e.consume(Y),e.exit("tableCellDivider"),G):Y===null||Re(Y)?(e.exit("tableRow"),a(Y)):Ze(Y)?at(e,G,"whitespace")(Y):(e.enter("data"),V(Y))}function V(Y){return Y===null||Y===124||yt(Y)?(e.exit("data"),G(Y)):(e.consume(Y),Y===92?oe:V)}function oe(Y){return Y===92||Y===124?(e.consume(Y),V):V(Y)}}function iT(e,a){let r=-1,i=!0,c=0,d=[0,0,0,0],u=[0,0,0,0],m=!1,p=0,h,y,x;const v=new nT;for(;++r<e.length;){const k=e[r],w=k[1];k[0]==="enter"?w.type==="tableHead"?(m=!1,p!==0&&(Rb(v,a,p,h,y),y=void 0,p=0),h={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},v.add(r,0,[["enter",h,a]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(i=!0,x=void 0,d=[0,0,0,0],u=[0,r+1,0,0],m&&(m=!1,y={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},v.add(r,0,[["enter",y,a]])),c=w.type==="tableDelimiterRow"?2:y?3:1):c&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(i=!1,u[2]===0&&(d[1]!==0&&(u[0]=u[1],x=bc(v,a,d,c,void 0,x),d=[0,0,0,0]),u[2]=r)):w.type==="tableCellDivider"&&(i?i=!1:(d[1]!==0&&(u[0]=u[1],x=bc(v,a,d,c,void 0,x)),d=u,u=[d[1],r,0,0])):w.type==="tableHead"?(m=!0,p=r):w.type==="tableRow"||w.type==="tableDelimiterRow"?(p=r,d[1]!==0?(u[0]=u[1],x=bc(v,a,d,c,r,x)):u[1]!==0&&(x=bc(v,a,u,c,r,x)),c=0):c&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(u[3]=r)}for(p!==0&&Rb(v,a,p,h,y),v.consume(a.events),r=-1;++r<a.events.length;){const k=a.events[r];k[0]==="enter"&&k[1].type==="table"&&(k[1]._align=rT(a.events,r))}return e}function bc(e,a,r,i,c,d){const u=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",m="tableContent";r[0]!==0&&(d.end=Object.assign({},Xl(a.events,r[0])),e.add(r[0],0,[["exit",d,a]]));const p=Xl(a.events,r[1]);if(d={type:u,start:Object.assign({},p),end:Object.assign({},p)},e.add(r[1],0,[["enter",d,a]]),r[2]!==0){const h=Xl(a.events,r[2]),y=Xl(a.events,r[3]),x={type:m,start:Object.assign({},h),end:Object.assign({},y)};if(e.add(r[2],0,[["enter",x,a]]),i!==2){const v=a.events[r[2]],k=a.events[r[3]];if(v[1].end=Object.assign({},k[1].end),v[1].type="chunkText",v[1].contentType="text",r[3]>r[2]+1){const w=r[2]+1,T=r[3]-r[2]-1;e.add(w,T,[])}}e.add(r[3]+1,0,[["exit",x,a]])}return c!==void 0&&(d.end=Object.assign({},Xl(a.events,c)),e.add(c,0,[["exit",d,a]]),d=void 0),d}function Rb(e,a,r,i,c){const d=[],u=Xl(a.events,r);c&&(c.end=Object.assign({},u),d.push(["exit",c,a])),i.end=Object.assign({},u),d.push(["exit",i,a]),e.add(r+1,0,d)}function Xl(e,a){const r=e[a],i=r[0]==="enter"?"start":"end";return r[1][i]}const oT={name:"tasklistCheck",tokenize:uT};function cT(){return{text:{91:oT}}}function uT(e,a,r){const i=this;return c;function c(p){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?r(p):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(p),e.exit("taskListCheckMarker"),d)}function d(p){return yt(p)?(e.enter("taskListCheckValueUnchecked"),e.consume(p),e.exit("taskListCheckValueUnchecked"),u):p===88||p===120?(e.enter("taskListCheckValueChecked"),e.consume(p),e.exit("taskListCheckValueChecked"),u):r(p)}function u(p){return p===93?(e.enter("taskListCheckMarker"),e.consume(p),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),m):r(p)}function m(p){return Re(p)?a(p):Ze(p)?e.check({tokenize:dT},a,r)(p):r(p)}}function dT(e,a,r){return at(e,i,"whitespace");function i(c){return c===null?r(c):a(c)}}function fT(e){return R1([$4(),K4(),tT(e),lT(),cT()])}const pT={};function Nm(e){const a=this,r=e||pT,i=a.data(),c=i.micromarkExtensions||(i.micromarkExtensions=[]),d=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),u=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);c.push(fT(r)),d.push(z4()),u.push(R4(r))}function Qe(){if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID();const e=globalThis.crypto,a=new Uint8Array(16);e.getRandomValues(a),a[6]=a[6]&15|64,a[8]=a[8]&63|128;const r=Array.from(a,i=>i.toString(16).padStart(2,"0")).join("");return`${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20)}`}const mT=1e3,hT=3e4,Ob="zeroclaw_session_id";function gT(){let e=sessionStorage.getItem(Ob);return e||(e=Qe(),sessionStorage.setItem(Ob,e)),e}class Cm{constructor(a={}){_t(this,"ws",null);_t(this,"currentDelay");_t(this,"reconnectTimer",null);_t(this,"intentionallyClosed",!1);_t(this,"onMessage",null);_t(this,"onOpen",null);_t(this,"onClose",null);_t(this,"onError",null);_t(this,"baseUrl");_t(this,"reconnectDelay");_t(this,"maxReconnectDelay");_t(this,"autoReconnect");_t(this,"planId");let r;Vn()&&wr()?r=wr().replace(/^http/,"ws"):r=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`,this.baseUrl=a.baseUrl??r,this.reconnectDelay=a.reconnectDelay??mT,this.maxReconnectDelay=a.maxReconnectDelay??hT,this.autoReconnect=a.autoReconnect??!0,this.currentDelay=this.reconnectDelay,this.planId=a.planId}connect(){this.intentionallyClosed=!1,this.clearReconnectTimer();const a=is(),r=gT(),i=new URLSearchParams;a&&i.set("token",a),i.set("session_id",r),this.planId&&i.set("plan_id",this.planId);const c=`${this.baseUrl}${rl}/ws/chat?${i.toString()}`,d=["zeroclaw.v1"];a&&d.push(`bearer.${a}`),this.ws=new WebSocket(c,d),this.ws.onopen=()=>{var u;this.currentDelay=this.reconnectDelay,(u=this.onOpen)==null||u.call(this)},this.ws.onmessage=u=>{var m;try{const p=JSON.parse(u.data);(m=this.onMessage)==null||m.call(this,p)}catch{}},this.ws.onclose=u=>{var m;(m=this.onClose)==null||m.call(this,u),this.scheduleReconnect()},this.ws.onerror=u=>{var m;(m=this.onError)==null||m.call(this,u)}}setPlanId(a){this.planId=a??void 0}sendMessage(a,r={}){if(!this.ws||this.ws.readyState!==WebSocket.OPEN)throw new Error("WebSocket is not connected");const i={type:"message",content:a};this.planId&&(i.plan_id=this.planId),r.routeMode&&r.routeMode!=="auto"&&(i.route_mode=r.routeMode),this.ws.send(JSON.stringify(i))}disconnect(){if(this.intentionallyClosed=!0,this.clearReconnectTimer(),this.ws){const a=this.ws;if(this.ws=null,a.readyState===WebSocket.CONNECTING){a.onopen=()=>a.close(),a.onmessage=null,a.onerror=null,a.onclose=null;return}a.close()}}get connected(){var a;return((a=this.ws)==null?void 0:a.readyState)===WebSocket.OPEN}scheduleReconnect(){this.intentionallyClosed||!this.autoReconnect||(this.reconnectTimer=setTimeout(()=>{this.currentDelay=Math.min(this.currentDelay*2,this.maxReconnectDelay),this.connect()},this.currentDelay))}clearReconnectTimer(){this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}}const xT=[{value:"auto",label:"自动分流",title:"由后端 Context Binder 与 Intent Resolver 自动决定路线",icon:t1},{value:"chat",label:"仅聊天",title:"只做解释、讨论、总结或改写,不进入执行链路",icon:Uj},{value:"direct",label:"直接执行",title:"要求匹配单个原子 skill,创建 Task / Run / Event,不创建 Plan",icon:Zj},{value:"plan",label:"计划执行",title:"要求进入 PlanExecution,创建 Plan / Step / Task / Run / Event",icon:Rj}];function Em({value:e,onChange:a,onSend:r,connected:i,disabled:c,routeMode:d="auto",onRouteModeChange:u}){const m=b.useRef(null);b.useEffect(()=>{m.current&&(m.current.style.height="auto",m.current.style.height=`${Math.min(m.current.scrollHeight,200)}px`)},[e]);const p=y=>{y.key==="Enter"&&!y.shiftKey&&(y.preventDefault(),r())},h=y=>{a(y.target.value)};return l.jsxs("div",{className:"border-t px-4 py-3",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg-surface)"},children:[u&&l.jsx("div",{className:"max-w-3xl mx-auto mb-2",children:l.jsx("div",{className:"grid grid-cols-2 gap-1 rounded-lg border p-1 sm:grid-cols-4",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg-base)"},children:xT.map(y=>{const x=y.icon,v=d===y.value;return l.jsxs("button",{type:"button",title:y.title,"aria-pressed":v,onClick:()=>u(y.value),disabled:c,className:"min-w-0 flex items-center justify-center gap-1.5 rounded-md px-2 py-1.5 text-[11px] font-medium transition-all disabled:opacity-40",style:{background:v?"var(--pc-accent-glow)":"transparent",border:v?"1px solid var(--pc-accent-dim)":"1px solid transparent",color:v?"var(--pc-accent)":"var(--pc-text-muted)"},children:[l.jsx(x,{className:"h-3.5 w-3.5 shrink-0"}),l.jsx("span",{className:"truncate",children:y.label})]},y.value)})})}),l.jsxs("div",{className:"flex items-end gap-2 max-w-3xl mx-auto",children:[l.jsx("textarea",{ref:m,rows:1,value:e,onChange:h,onKeyDown:p,placeholder:J(i?"planb.chat.placeholder":"agent.connecting"),disabled:!i||c,className:"input-electric flex-1 px-4 text-sm resize-none disabled:opacity-40 rounded-2xl",style:{minHeight:"44px",maxHeight:"200px",paddingTop:"11px",paddingBottom:"11px"}}),l.jsx("button",{type:"button",onClick:r,disabled:!i||!e.trim()||c,className:"flex-shrink-0 rounded-full flex items-center justify-center transition-all",style:{width:"40px",height:"40px",background:i&&e.trim()?"var(--pc-accent)":"var(--pc-bg-elevated)",border:i&&e.trim()?"none":"1px solid var(--pc-border)",color:i&&e.trim()?"white":"var(--pc-text-faint)",opacity:i&&e.trim()?1:.5},children:l.jsx(n1,{className:"h-4 w-4"})})]})]})}const yT={draft:"Draft",reviewing:"Reviewing",approved:"Approved",active:"Active",blocked:"Blocked",completed:"Completed",failed:"Failed",cancelled:"Cancelled",superseded:"Superseded"};function bT(e){let a=0,r=0;for(const i of e.steps||[])for(const c of i.tasks||[])a++,(c.status==="succeeded"||c.status==="completed")&&r++;return{total:a,done:r}}function vT({plan:e,onBack:a}){const[r,i]=b.useState([]),[c,d]=b.useState(""),[u,m]=b.useState(!1),[p,h]=b.useState(!1),[y,x]=b.useState(null),[v,k]=b.useState(null),w=b.useRef(null),T=b.useRef(null),j=b.useRef(""),C=b.useRef(""),$=b.useRef(""),[M,ee]=b.useState(""),[ne,A]=b.useState("");b.useEffect(()=>{let F=!1;return i([]),Ti(e.plan_id).then(I=>{F||i((I.messages||[]).map(Q=>({id:Qe(),role:Q.role==="user"?"user":(Q.role==="assistant","system"),content:Q.content,timestamp:new Date})))}).catch(()=>{F||i([])}),()=>{F=!0}},[e.plan_id]),b.useEffect(()=>{const F=new Cm({planId:e.plan_id});return F.onOpen=()=>{h(!0),x(null)},F.onClose=I=>{h(!1),I.code!==1e3&&I.code!==1001&&x(`Connection closed (code: ${I.code})`)},F.onError=()=>x("Connection error"),F.onMessage=I=>{var Q,le;switch(I.type){case"thinking":m(!0),C.current+=I.content??"",A(C.current);break;case"chunk":m(!0),j.current+=I.content??"",ee(j.current);break;case"chunk_reset":$.current=C.current,j.current="",C.current="",ee(""),A("");break;case"message":case"done":{const B=I.full_response??I.content??j.current,L=$.current||C.current||void 0;B&&i(q=>[...q,{id:Qe(),role:"agent",content:B,thinking:L,markdown:!0,timestamp:new Date}]),j.current="",C.current="",$.current="",ee(""),A(""),m(!1);break}case"plan_msg_ack":break;case"plan_notification":i(B=>[...B,{id:Qe(),role:"system",content:I.content??"",timestamp:new Date}]);break;case"plan_need_input":i(B=>[...B,{id:Qe(),role:"system",content:I.question?`需要输入:${I.question}`:"需要用户输入",timestamp:new Date}]);break;case"plan_need_approval":i(B=>[...B,{id:Qe(),role:"system",content:I.action?`需要审批:${I.action}`:"需要用户审批",timestamp:new Date}]);break;case"governance":{const B=[I.message??"执行治理已受理",(Q=I.route_decision)!=null&&Q.route_kind?`分流:${I.route_decision.route_kind}`:null,I.created_plan_id?`计划:${I.created_plan_id}`:null,I.created_schedule_id?`调度:${I.created_schedule_id}`:null,(le=I.created_task_ids)!=null&&le.length?`任务:${I.created_task_ids.join(", ")}`:null].filter(Boolean);i(L=>[...L,{id:Qe(),role:"system",content:B.join(`
|
||
`),timestamp:new Date}]),j.current="",C.current="",$.current="",ee(""),A(""),m(!1);break}case"error":i(B=>[...B,{id:Qe(),role:"system",content:`Error: ${I.message??"Unknown error"}`,timestamp:new Date}]);break}},F.connect(),w.current=F,()=>{F.disconnect()}},[e.plan_id]),b.useEffect(()=>{var F;(F=T.current)==null||F.scrollIntoView({behavior:"smooth"})},[r,u]);const G=b.useCallback(()=>{var I;const F=c.trim();if(!(!F||!((I=w.current)!=null&&I.connected))){i(Q=>[...Q,{id:Qe(),role:"user",content:F,timestamp:new Date}]);try{w.current.sendMessage(F)}catch{x("Send failed")}d("")}},[c]),V=b.useCallback((F,I)=>{var le;const Q=()=>{k(F),setTimeout(()=>k(B=>B===F?null:B),2e3)};(le=navigator.clipboard)!=null&&le.writeText&&navigator.clipboard.writeText(I).then(Q).catch(()=>{})},[]),oe=bT(e),Y=e.status==="active"?"var(--color-status-success)":e.status==="blocked"?"var(--color-status-error)":e.status==="reviewing"?"#f59e0b":"var(--pc-text-muted)";return l.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[l.jsxs("div",{className:"px-4 py-3 border-b flex-shrink-0",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg-surface)"},children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx("button",{onClick:a,className:"h-6 w-6 flex items-center justify-center rounded",style:{color:"var(--pc-text-muted)"},children:l.jsx(xj,{className:"h-3.5 w-3.5"})}),l.jsx("span",{className:"text-sm font-semibold",style:{color:"var(--pc-text-primary)"},children:e.title||e.plan_id})]}),l.jsxs("div",{className:"flex items-center gap-3 text-[10px] ml-8",style:{color:"var(--pc-text-muted)"},children:[l.jsxs("span",{children:[b1(e.created_at)," 创建"]}),l.jsx("span",{style:{color:Y},children:yT[e.status]||e.status}),oe.total>0&&l.jsxs("span",{children:[oe.done,"/",oe.total," steps"]})]}),e.objective&&l.jsxs("div",{className:"text-[10px] ml-8 mt-0.5 truncate",style:{color:"var(--pc-text-faint)"},children:['"',e.objective,'"']})]}),y&&l.jsxs("div",{className:"px-3 py-1.5 border-b flex items-center gap-2 text-xs flex-shrink-0",style:{background:"rgba(239,68,68,0.08)",borderColor:"rgba(239,68,68,0.2)",color:"#f87171"},children:[l.jsx(rs,{className:"h-3.5 w-3.5 shrink-0"}),l.jsx("span",{className:"truncate",children:y}),l.jsx("button",{onClick:()=>x(null),className:"ml-auto shrink-0 text-xs underline",children:"Close"})]}),l.jsx("div",{className:"flex-1 overflow-y-auto px-3 min-h-0",children:r.length===0?l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx("p",{className:"text-xs",style:{color:"var(--pc-text-muted)"},children:"Plan 对话就绪 — 发送命令或消息与 PlanAgent 互动"})}):l.jsxs("div",{className:"py-3 space-y-3",children:[r.map(F=>l.jsxs("div",{className:`group flex items-start gap-2 ${F.role==="user"?"flex-row-reverse":""}`,children:[l.jsx("div",{className:"flex-shrink-0 w-7 h-7 rounded-lg flex items-center justify-center border",style:{background:F.role==="user"?"var(--pc-accent)":F.role==="system"?"var(--pc-bg-surface)":"var(--pc-bg-elevated)",borderColor:F.role==="user"?"var(--pc-accent)":"var(--pc-border)"},children:F.role==="user"?l.jsx(tm,{className:"h-3 w-3 text-white"}):F.role==="system"?l.jsx(rs,{className:"h-3 w-3",style:{color:"var(--pc-accent)"}}):l.jsx(Zr,{className:"h-3 w-3",style:{color:"var(--pc-accent)"}})}),l.jsxs("div",{className:"relative max-w-[85%] min-w-0",children:[l.jsxs("div",{className:"rounded-xl px-3 py-2 border",style:F.role==="user"?{background:"var(--pc-accent-glow)",borderColor:"var(--pc-accent-dim)",color:"var(--pc-text-primary)"}:F.role==="system"?{background:"var(--pc-bg-elevated)",borderColor:"rgba(167,139,250,0.2)",color:"var(--pc-text-muted)"}:{background:"var(--pc-bg-elevated)",borderColor:"var(--pc-border)",color:"var(--pc-text-primary)"},children:[F.thinking&&l.jsxs("details",{className:"mb-1.5",children:[l.jsx("summary",{className:"text-[11px] cursor-pointer select-none font-medium",style:{color:"var(--pc-text-muted)"},children:"Thought"}),l.jsx("pre",{className:"text-[10px] mt-1 whitespace-pre-wrap break-words overflow-auto max-h-36 p-1.5 rounded-lg",style:{color:"var(--pc-text-muted)",background:"var(--pc-bg-surface)"},children:F.thinking})]}),F.markdown?l.jsx("div",{className:"text-[13px] break-words leading-relaxed chat-markdown",children:l.jsx(_m,{remarkPlugins:[Nm],children:F.content})}):l.jsx("p",{className:"text-[13px] whitespace-pre-wrap break-words",children:F.content})]}),F.role==="agent"&&l.jsx("button",{onClick:()=>V(F.id,F.content),className:"absolute top-0.5 right-0.5 opacity-0 group-hover:opacity-100 transition-all p-1 rounded-lg",style:{background:"var(--pc-bg-elevated)",border:"1px solid var(--pc-border)",color:"var(--pc-text-muted)"},children:v===F.id?l.jsx(Li,{className:"h-2.5 w-2.5",style:{color:"#34d399"}}):l.jsx(Qp,{className:"h-2.5 w-2.5"})})]})]},F.id)),u&&l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx("div",{className:"flex-shrink-0 w-7 h-7 rounded-lg flex items-center justify-center border",style:{background:"var(--pc-bg-elevated)",borderColor:"var(--pc-border)"},children:l.jsx(Zr,{className:"h-3 w-3",style:{color:"var(--pc-accent)"}})}),l.jsxs("div",{className:"rounded-xl px-3 py-2 border max-w-[85%]",style:{background:"var(--pc-bg-elevated)",borderColor:"var(--pc-border)",color:"var(--pc-text-primary)"},children:[ne&&l.jsxs("details",{className:"mb-1.5",open:!M,children:[l.jsx("summary",{className:"text-[11px] cursor-pointer select-none font-medium",style:{color:"var(--pc-text-muted)"},children:"Thought"}),l.jsx("pre",{className:"text-[10px] mt-1 whitespace-pre-wrap break-words overflow-auto max-h-36 p-1.5 rounded-lg",style:{color:"var(--pc-text-muted)",background:"var(--pc-bg-surface)"},children:ne})]}),M?l.jsxs("p",{className:"text-[13px] whitespace-pre-wrap break-words",children:[M,l.jsx("span",{className:"inline-block w-0.5 h-3.5 ml-0.5 animate-pulse align-middle",style:{background:"var(--pc-accent)"}})]}):l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"bounce-dot w-1.5 h-1.5 rounded-full",style:{background:"var(--pc-accent)"}}),l.jsx("span",{className:"bounce-dot w-1.5 h-1.5 rounded-full",style:{background:"var(--pc-accent)"}}),l.jsx("span",{className:"bounce-dot w-1.5 h-1.5 rounded-full",style:{background:"var(--pc-accent)"}})]})]})]}),l.jsx("div",{ref:T})]})}),l.jsx(Em,{value:c,onChange:d,onSend:G,connected:p})]})}function kT(){const{mode:e}=Xp(),[a,r]=b.useState(!1),[i,c]=b.useState(null);return e==="compact"?i?l.jsx("div",{className:"min-h-screen",style:{background:"var(--pc-bg-base)"},children:l.jsx("div",{className:"mx-auto flex flex-col",style:{maxWidth:"420px",height:"100dvh"},children:l.jsx(vT,{plan:i,onBack:()=>c(null)})})}):l.jsx("div",{className:"min-h-screen",style:{background:"var(--pc-bg-base)"},children:l.jsxs("div",{className:"mx-auto flex flex-col",style:{maxWidth:"420px",height:"100dvh"},children:[l.jsx(FS,{onPlanSidebarToggle:()=>r(!a)}),l.jsx("main",{className:"flex-1 overflow-y-auto min-h-0 flex flex-col",children:a?l.jsx(GS,{activePlanId:(i==null?void 0:i.plan_id)??null,onSelectPlan:d=>{c(d),r(!1)}}):l.jsx(Ov,{})})]})}):l.jsx(HS,{})}const j0=b.createContext({getDraft:()=>"",setDraft:()=>{},clearDraft:()=>{}});function _T(){const e=b.useRef(new Map),a=b.useCallback(c=>e.current.get(c)??"",[]),r=b.useCallback((c,d)=>{e.current.set(c,d)},[]),i=b.useCallback(c=>{e.current.delete(c)},[]);return{getDraft:a,setDraft:r,clearDraft:i}}function S0(e){const{getDraft:a,setDraft:r,clearDraft:i}=b.useContext(j0);return{draft:a(e),saveDraft:c=>r(e,c),clearDraft:()=>i(e)}}const wT=[{icon:ls,labelKey:"planb.chat.chip_browse",message:"Browse the web for latest news"},{icon:kj,labelKey:"planb.chat.chip_code",message:"Write code to solve a problem"},{icon:vj,labelKey:"planb.chat.chip_analyze",message:"Analyze data and create charts"},{icon:zj,labelKey:"planb.chat.chip_plan",message:"Help me plan a project"}];function N0({onChipSelect:e}){return l.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center px-6 animate-fade-in",children:[l.jsx("div",{className:"h-20 w-20 rounded-3xl flex items-center justify-center mb-6 animate-float",style:{background:"linear-gradient(135deg, rgba(var(--pc-accent-rgb), 0.15), rgba(var(--pc-accent-rgb), 0.05))",boxShadow:"0 0 40px rgba(var(--pc-accent-rgb), 0.1)"},children:l.jsx(Zr,{className:"h-10 w-10",style:{color:"var(--pc-accent)"}})}),l.jsx("h1",{className:"text-2xl font-bold mb-1 animate-fade-in",style:{color:"var(--pc-text-primary)",background:"linear-gradient(135deg, var(--pc-accent-light), var(--pc-accent))",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"},children:"PlanB"}),l.jsx("p",{className:"text-sm mb-8",style:{color:"var(--pc-text-muted)"},children:J("planb.chat.welcome")}),l.jsx("div",{className:"grid grid-cols-2 gap-3 w-full max-w-sm",children:wT.map(({icon:a,labelKey:r,message:i})=>l.jsxs("button",{type:"button",onClick:()=>e(i),className:"flex flex-col items-center gap-2 p-4 rounded-2xl border transition-all text-left",style:{background:"var(--pc-bg-elevated)",borderColor:"var(--pc-border)"},onMouseEnter:c=>{c.currentTarget.style.borderColor="var(--pc-accent-dim)",c.currentTarget.style.background="var(--pc-accent-glow)"},onMouseLeave:c=>{c.currentTarget.style.borderColor="var(--pc-border)",c.currentTarget.style.background="var(--pc-bg-elevated)"},children:[l.jsx(a,{className:"h-6 w-6",style:{color:"var(--pc-accent)"}}),l.jsx("span",{className:"text-xs font-medium",style:{color:"var(--pc-text-secondary)"},children:J(r)})]},r))})]})}const jT=[{key:"all",label:"全部"},{key:"plan",label:"计划"},{key:"chat",label:"自由对话"}];function ST(e){if(!e)return"";const a=new Date(e);return Number.isNaN(a.getTime())?"":a.toLocaleString([],{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}function NT(e){const a=ST(e.updated_at),r=e.message_count?`${e.message_count} 条消息`:"";return[e.kind==="plan"?"计划会话":a?`最近 ${a}`:"",r].filter(Boolean).join(" · ")}function C0({open:e,onClose:a,sessions:r,activeId:i,onSelect:c,onNewChat:d}){const[u,m]=b.useState("all"),p=b.useMemo(()=>u==="all"?r:r.filter(h=>(h.kind??"chat")===u),[r,u]);return e?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-40 bg-black/30 backdrop-blur-sm transition-opacity",onClick:a,onKeyDown:h=>{h.key==="Escape"&&a()},role:"button",tabIndex:-1,"aria-label":"Close sessions"}),l.jsxs("div",{className:"fixed left-0 top-0 h-full w-80 z-50 border-r shadow-2xl animate-slide-in-left flex flex-col",style:{background:"var(--pc-bg-base)",borderColor:"var(--pc-border)"},children:[l.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b",style:{borderColor:"var(--pc-border)"},children:[l.jsx("h2",{className:"text-sm font-semibold",style:{color:"var(--pc-text-primary)"},children:J("planb.chat.sessions")}),l.jsx("button",{type:"button",onClick:a,className:"h-8 w-8 rounded-lg flex items-center justify-center transition-colors",style:{color:"var(--pc-text-muted)"},onMouseEnter:h=>{h.currentTarget.style.color="var(--pc-text-primary)",h.currentTarget.style.background="var(--pc-hover)"},onMouseLeave:h=>{h.currentTarget.style.color="var(--pc-text-muted)",h.currentTarget.style.background="transparent"},children:l.jsx(Ha,{className:"h-4 w-4"})})]}),l.jsx("div",{className:"px-3 pt-3 pb-2",children:l.jsxs("button",{type:"button",onClick:()=>{d(),a()},className:"flex items-center gap-2 w-full px-3 py-2 rounded-xl text-sm font-medium transition-all",style:{background:"var(--pc-accent-glow)",color:"var(--pc-accent-light)",border:"1px solid var(--pc-accent-dim)"},children:[l.jsx(Bi,{className:"h-4 w-4"}),J("planb.chat.new_chat")]})}),l.jsx("div",{className:"flex gap-1 px-3 pb-2",children:jT.map(({key:h,label:y})=>l.jsx("button",{type:"button",onClick:()=>m(h),className:"text-[10px] px-2.5 py-1 rounded-full font-medium transition-all",style:{background:u===h?"var(--pc-accent-glow)":"transparent",color:u===h?"var(--pc-accent-light)":"var(--pc-text-muted)",border:u===h?"1px solid var(--pc-accent-dim)":"1px solid transparent"},children:y},h))}),l.jsx("div",{className:"flex-1 overflow-y-auto px-3 pb-4 space-y-1",children:p.length===0?l.jsx("p",{className:"text-xs px-3 py-8 text-center",style:{color:"var(--pc-text-faint)"},children:J("planb.chat.no_sessions")}):p.map(h=>l.jsxs("button",{type:"button",onClick:()=>{c(h.id),a()},className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-xl text-left transition-all text-sm",style:{background:h.id===i?"var(--pc-accent-glow)":"transparent",border:h.id===i?"1px solid var(--pc-accent-dim)":"1px solid transparent",color:h.id===i?"var(--pc-accent-light)":"var(--pc-text-secondary)"},onMouseEnter:y=>{h.id!==i&&(y.currentTarget.style.background="var(--pc-hover)")},onMouseLeave:y=>{h.id!==i&&(y.currentTarget.style.background="transparent")},title:h.plan_id?`计划标识:${h.plan_id}`:`会话标识:${h.id}`,children:[h.kind==="plan"?l.jsx(Ci,{className:"h-4 w-4 flex-shrink-0",style:{color:"var(--pc-accent)"}}):l.jsx(_r,{className:"h-4 w-4 flex-shrink-0",style:{color:"var(--pc-text-muted)"}}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("p",{className:"truncate text-sm",children:h.name||J("planb.chat.untitled")}),h.kind==="plan"&&l.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded-full flex-shrink-0",style:{background:"var(--pc-accent-glow)",color:"var(--pc-accent)"},children:"计划"})]}),l.jsx("p",{className:"text-xs mt-0.5",style:{color:"var(--pc-text-faint)"},children:NT(h)})]}),h.has_pending_approval&&l.jsx("span",{className:"h-2 w-2 rounded-full flex-shrink-0",style:{background:"var(--color-status-error)",boxShadow:"0 0 4px var(--color-status-error)"}}),h.message_count!==void 0&&h.message_count>0&&l.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-full",style:{background:"var(--pc-bg-surface)",color:"var(--pc-text-faint)"},children:h.message_count})]},h.id))})]})]}):null}function CT({name:e,args:a,durationMs:r,variant:i="call",success:c}){const[d,u]=b.useState(!1),m=i==="result"?c===!1?"rgba(255,59,48,0.3)":"rgba(48,209,88,0.2)":"var(--pc-accent-dim)";return l.jsxs("div",{className:"rounded-xl border my-1.5 overflow-hidden text-xs",style:{borderColor:m,background:"var(--pc-bg-elevated)"},children:[l.jsxs("button",{onClick:()=>u(!d),className:"w-full flex items-center gap-2 px-3 py-2 hover:bg-[var(--pc-hover)] transition-colors text-left",children:[l.jsx(nm,{className:"h-3.5 w-3.5 shrink-0",style:{color:i==="result"?"#30d158":"var(--pc-accent)"}}),l.jsx("span",{className:"font-semibold",style:{color:"var(--pc-text-primary)"},children:e}),r!=null&&l.jsxs("span",{className:"text-[10px] ml-auto",style:{color:"var(--pc-text-faint)"},children:[r,"ms"]}),l.jsx(Kc,{className:`h-3 w-3 transition-transform ${d?"":"-rotate-90"}`,style:{color:"var(--pc-text-faint)"}})]}),d&&l.jsx("div",{className:"px-3 pb-2 space-y-1.5 border-t",style:{borderColor:"var(--pc-border)"},children:a&&l.jsxs("div",{children:[l.jsx("div",{className:"text-[10px] font-semibold uppercase mt-2 mb-0.5",style:{color:"var(--pc-text-faint)"},children:"Arguments"}),l.jsx("pre",{className:"text-[10px] p-2 rounded-lg overflow-x-auto font-mono",style:{background:"var(--pc-bg-base)",color:"var(--pc-text-muted)",maxHeight:120,overflowY:"auto"},children:typeof a=="string"?a:JSON.stringify(a,null,2)})]})})]})}function ET({output:e,success:a,previewLen:r=300}){const[i,c]=b.useState(!1),d=e.length>r;return l.jsxs("div",{className:"rounded-xl border my-1.5 overflow-hidden text-xs",style:{borderColor:a===!1?"rgba(255,59,48,0.3)":"rgba(48,209,88,0.2)",background:"var(--pc-bg-elevated)"},children:[l.jsxs("button",{onClick:()=>c(!i),className:"w-full flex items-center gap-2 px-3 py-2 hover:bg-[var(--pc-hover)] transition-colors text-left",children:[a===!1?l.jsx(al,{className:"h-3.5 w-3.5 shrink-0",style:{color:"#ff3b30"}}):l.jsx($i,{className:"h-3.5 w-3.5 shrink-0",style:{color:"#30d158"}}),l.jsx("span",{className:"font-semibold",style:{color:"var(--pc-text-primary)"},children:a===!1?"Failed":"Result"}),l.jsx("span",{className:"text-[10px] ml-auto truncate max-w-[60%]",style:{color:"var(--pc-text-faint)"},children:d&&!i?e.slice(0,r)+"...":e.slice(0,r)}),d&&l.jsx(Kc,{className:`h-3 w-3 shrink-0 transition-transform ${i?"":"-rotate-90"}`,style:{color:"var(--pc-text-faint)"}})]}),i&&d&&l.jsx("div",{className:"px-3 pb-2 border-t",style:{borderColor:"var(--pc-border)"},children:l.jsx("pre",{className:"text-[10px] p-2 rounded-lg overflow-x-auto font-mono whitespace-pre-wrap",style:{background:"var(--pc-bg-base)",color:"var(--pc-text-muted)",maxHeight:200,overflowY:"auto"},children:e})})]})}const TT="agent-chat",E0="sgrobot_chat_route_mode";function AT(){const e=localStorage.getItem(E0);return e==="chat"||e==="direct"||e==="plan"?e:"auto"}function DT(e){return e.filter(a=>{var r;return(r=a.content)==null?void 0:r.trim()}).map(a=>({id:Qe(),role:a.role==="user"?"user":"agent",content:a.content,markdown:a.role!=="user",timestamp:new Date}))}function MT(e){const a=(e??"").toLowerCase();return["completed","succeeded","success","finished"].includes(a)?"已完成":["running","active","leased","in_progress"].includes(a)?"执行中":["queued","pending","draft"].includes(a)?"排队中":["failed","error"].includes(a)?"失败":["paused","blocked"].includes(a)?"已暂停":e||"未知"}function zT(e,a){if(a.length===0)return`执行进度:${e}
|
||
- 正在准备任务`;const r=a.map(i=>`- ${i.title||"任务"}:${MT(i.status)}`);return`执行进度:${e}
|
||
${r.join(`
|
||
`)}`}function T0(e){return e?/^Session\s+/i.test(e)||/^对话\s+[0-9a-f]{6,}/i.test(e)||/^计划\s+[0-9a-f]{6,}/i.test(e)||e==="新对话":!0}function A0(e){if(!e)return"";const a=new Date(e);return Number.isNaN(a.getTime())?"":a.toLocaleString([],{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}function D0(e,a){if(e==="plan")return"未命名计划";const r=A0(a);return r?`${r} 的对话`:"未命名对话"}function Ff(e){var r,i;if(!e)return"新对话";const a=(r=e.name)==null?void 0:r.trim();return a&&!T0(a)?a:e.kind==="plan"&&((i=e.plan_title)!=null&&i.trim())?e.plan_title.trim():D0(e.kind,e.updated_at)}function RT(e){if(!e)return"未保存";const a=A0(e.updated_at),r=e.message_count?`${e.message_count} 条消息`:"";return e.kind==="plan"?[a||"计划会话",r].filter(Boolean).join(" · "):[a?`最近 ${a}`:"尚未保存",r].filter(Boolean).join(" · ")}function OT(){const{draft:e,saveDraft:a,clearDraft:r}=S0(TT),[i,c]=b.useState([]),[d,u]=b.useState(e),[m,p]=b.useState(()=>AT()),[h,y]=b.useState(!1),[x,v]=b.useState(!1),[k,w]=b.useState(null),[T,j]=b.useState(!1),[C,$]=b.useState([]),[M,ee]=b.useState(()=>sessionStorage.getItem("zeroclaw_session_id")),ne=b.useRef(null),A=b.useRef(null),[G,V]=b.useState([]),oe=b.useRef([]),[Y,F]=b.useState(null),I=G.filter(X=>X.kind==="need_approval"&&X.status==="unread"),Q=b.useCallback(X=>X.map(re=>({...re,has_pending_approval:re.kind==="plan"&&re.plan_id!=null&&oe.current.length>0&&oe.current.some(ue=>ue.plan_id===re.plan_id&&ue.kind==="need_approval"&&ue.status==="unread")})),[]);b.useEffect(()=>{oe.current=G,$(X=>Q(X))},[G,Q]);const le=b.useCallback(async()=>{try{const X=await bS("unread");V(re=>{const ue=new Set(re.map(Ae=>Ae.notification_id)),Ue=X.filter(Ae=>!ue.has(Ae.notification_id));return[...re,...Ue]})}catch{}},[]);b.useEffect(()=>{le()},[le]);const B=b.useCallback(async X=>{F(X);try{const re=G.find(Ae=>Ae.correlation_id===X&&Ae.kind==="need_approval"),ue=Date.now(),Ue=await ma({command_kind:"approve_approval",context_refs:{approval_id:X,...re!=null&&re.plan_id?{plan_id:re.plan_id}:{},...re!=null&&re.task_id?{task_id:re.task_id}:{}},payload:{source:"agent-chat-approval"},correlation_id:(re==null?void 0:re.correlation_id)||`ui-approve-approval-${ue}`,idempotency_key:`ui-approve-approval-${X}-${ue}`});if(!Ue.accepted)throw new Error(Ue.message||`command 未被接受:${Ue.command_id||"approve_approval"}`);re&&await By(re.notification_id).catch(()=>{}),V(Ae=>Ae.map(Le=>Le.correlation_id===X&&Le.kind==="need_approval"?{...Le,status:"resolved"}:Le))}catch{}finally{F(null)}},[G]),L=b.useCallback(async X=>{F(X);try{const re=G.find(Ae=>Ae.correlation_id===X&&Ae.kind==="need_approval"),ue=Date.now(),Ue=await ma({command_kind:"reject_approval",context_refs:{approval_id:X,...re!=null&&re.plan_id?{plan_id:re.plan_id}:{},...re!=null&&re.task_id?{task_id:re.task_id}:{}},payload:{source:"agent-chat-approval"},correlation_id:(re==null?void 0:re.correlation_id)||`ui-reject-approval-${ue}`,idempotency_key:`ui-reject-approval-${X}-${ue}`});if(!Ue.accepted)throw new Error(Ue.message||`command 未被接受:${Ue.command_id||"reject_approval"}`);re&&await Uy(re.notification_id).catch(()=>{}),V(Ae=>Ae.map(Le=>Le.correlation_id===X&&Le.kind==="need_approval"?{...Le,status:"resolved"}:Le))}catch{}finally{F(null)}},[G]),[q,ce]=b.useState({}),ge=b.useCallback(async X=>{var ue;const re=(ue=q[X])==null?void 0:ue.trim();if(re)try{const Ue=G.find(je=>je.notification_id===X);if(!Ue)return;const Ae=Date.now();(await ma({command_kind:"provide_task_input",context_refs:{task_id:Ue.task_id,...Ue.plan_id?{plan_id:Ue.plan_id}:{}},payload:{source:"agent-chat-need-input",notification_id:X,content:re},correlation_id:Ue.correlation_id||`ui-provide-input-${Ae}`,idempotency_key:`ui-provide-input-${X}-${Ae}`})).accepted&&(await By(X).catch(()=>{}),V(je=>je.map(Me=>Me.notification_id===X?{...Me,status:"resolved"}:Me)),ce(je=>{const Me={...je};return delete Me[X],Me}))}catch{}},[G,q]),N=b.useRef(null),[z,K]=b.useState(null),E=b.useRef(""),pe=b.useRef(""),ke=b.useRef(""),ve=b.useRef({}),[ze,me]=b.useState(""),[D,U]=b.useState(""),[be,Ne]=b.useState(!0),$e=b.useCallback(()=>{E.current="",pe.current="",ke.current="",me(""),U(""),y(!1),Ne(!1)},[]),Ce=b.useCallback(async(X,re)=>{A.current=X,c([]);try{const ue=(re==null?void 0:re.kind)==="plan"&&re.plan_id?await Ti(re.plan_id):await u1(X);if(A.current!==X)return;c(DT(ue.messages))}catch{A.current===X&&c([])}},[]),nt=b.useCallback(X=>{const re=ve.current[X];re&&(clearInterval(re),delete ve.current[X])},[]),Be=b.useCallback((X,re)=>{nt(X);let ue="",Ue=0;const Ae=async()=>{Ue+=1;try{const je=(await m1(X)).tasks.map(wt=>({title:wt.title,status:wt.status})),Me=zT(re,je);Me!==ue&&(ue=Me,c(wt=>[...wt,{id:Qe(),role:"agent",content:Me,timestamp:new Date}])),(je.length>0&&je.every(wt=>{const kn=wt.status.toLowerCase();return["finished","completed","succeeded","failed","error"].includes(kn)})||Ue>=30)&&nt(X)}catch{Ue>=3&&(c(Le=>[...Le,{id:Qe(),role:"agent",content:`执行进度:${re}
|
||
- 暂时无法读取进度,请稍后查看“执行”页面`,timestamp:new Date}]),nt(X))}};Ae(),ve.current[X]=setInterval(()=>{Ae()},2e3)},[nt]);b.useEffect(()=>{a(d)},[d,a]),b.useEffect(()=>{localStorage.setItem(E0,m)},[m]),b.useEffect(()=>{let X=!1;const re=async()=>{try{const Ue=await rm();if(X)return;const Ae=Ue.map(Le=>{var Pt;const je=Le.kind??"chat",Me=Le.session_id??"",Rt=Le.plan_title??null,wt=Le.last_activity??Le.started_at??Le.created_at,kn=Rt||D0(je,wt);return{id:Me,name:(Pt=Le.name)!=null&&Pt.trim()&&!T0(Le.name)?Le.name.trim():kn,kind:je,plan_id:Le.plan_id??null,plan_title:Rt,updated_at:wt,message_count:Le.message_count}});$(Q(Ae))}catch{}};re();const ue=setInterval(re,15e3);return()=>{X=!0,clearInterval(ue)}},[Q]),b.useEffect(()=>{$(X=>X.map(re=>({...re,has_pending_approval:re.kind==="plan"&&re.plan_id!=null&&G.some(ue=>ue.plan_id===re.plan_id&&ue.kind==="need_approval"&&ue.status==="unread")})))},[G]);const Ve=b.useRef(null),ct=b.useCallback(X=>{Ve.current&&(Ve.current.onMessage=null,Ve.current.onOpen=null,Ve.current.onClose=null,Ve.current.onError=null,Ve.current.disconnect()),ne.current=X??null;const re=new Cm({planId:X??void 0});re.onOpen=()=>{v(!0),w(null),le()},re.onClose=ue=>{v(!1),ue.code!==1e3&&ue.code!==1001&&w(`Connection closed (code: ${ue.code}).`)},re.onError=()=>{w(J("agent.connection_error"))},re.onMessage=ue=>{var Ue,Ae,Le;switch(ue.type){case"session_start":ue.session_id&&(ee(ue.session_id),sessionStorage.setItem("zeroclaw_session_id",ue.session_id));break;case"session_renamed":if(ue.session_id&&((Ue=ue.name)!=null&&Ue.trim())){const je=ue.name.trim(),Me=new Date().toISOString();$(Rt=>Rt.find(kn=>kn.id===ue.session_id)?Rt.map(kn=>kn.id===ue.session_id?{...kn,name:je,updated_at:Me}:kn):[{id:ue.session_id,name:je,kind:"chat",plan_id:null,updated_at:Me,message_count:1},...Rt])}break;case"connected":break;case"thinking":y(!0),pe.current+=ue.content??"",U(pe.current),Ne(!0);break;case"chunk":y(!0),E.current+=ue.content??"",me(E.current);break;case"chunk_reset":ke.current=pe.current,E.current="",pe.current="",me(""),U("");break;case"message":case"done":{const je=ue.full_response??ue.content??E.current,Me=ke.current||pe.current||void 0;je&&c(Rt=>[...Rt,{id:Qe(),role:"agent",content:je,thinking:Me,markdown:!0,timestamp:new Date}]),E.current="",pe.current="",ke.current="",me(""),U(""),y(!1),Ne(!1);break}case"tool_call":c(je=>[...je,{id:Qe(),role:"agent",content:`🔧 ${ue.name??"tool"}(${JSON.stringify(ue.args??{})})`,toolCall:{name:ue.name??"tool",args:ue.args},timestamp:new Date}]);break;case"tool_result":c(je=>[...je,{id:Qe(),role:"agent",content:ue.output??"",toolResult:{output:ue.output??"",success:!0},timestamp:new Date}]);break;case"plan_need_approval":V(je=>je.some(Me=>Me.correlation_id===ue.approval_id&&Me.kind==="need_approval")?je:[...je,{notification_id:Qe(),plan_id:ue.plan_id??"",task_id:ue.task_id??"",kind:"need_approval",title:"需要审批",body:ue.action??"",level:"action",status:"unread",correlation_id:ue.approval_id??"",created_at:new Date().toISOString()}]),c(je=>[...je,{id:Qe(),role:"agent",content:`⚠️ **需要审批**: ${ue.action??"未知操作"} (${ue.task_id??""})`,markdown:!0,timestamp:new Date}]);break;case"plan_notification":c(je=>[...je,{id:Qe(),role:"agent",content:`📢 ${ue.content??ue.message??""}`,timestamp:new Date}]);break;case"plan_need_input":c(je=>[...je,{id:Qe(),role:"agent",content:`❓ ${ue.question??"请提供更多信息"}`,timestamp:new Date}]);break;case"notification":ue.notification&&V(je=>je.some(Me=>Me.notification_id===ue.notification.notification_id)?je:[...je,ue.notification]);break;case"governance":{const je=[ue.message??"执行治理已受理",(Ae=ue.route_decision)!=null&&Ae.route_kind?`分流:${ue.route_decision.route_kind}`:null,ue.created_plan_id?`计划:${ue.created_plan_id}`:null,ue.created_schedule_id?`调度:${ue.created_schedule_id}`:null,(Le=ue.created_task_ids)!=null&&Le.length?`任务:${ue.created_task_ids.join(", ")}`:null].filter(Boolean);c(Me=>[...Me,{id:Qe(),role:"agent",content:je.join(`
|
||
`),timestamp:new Date}]),ue.created_plan_id&&Be(ue.created_plan_id,ue.created_plan_id),y(!1),$e();break}case"direct_task_created":y(!0);break;case"plan_created":c(je=>[...je,{id:Qe(),role:"agent",content:`已创建计划:${ue.title??ue.plan_id??"未命名计划"}
|
||
正在执行,后续进度会在这里更新。`,timestamp:new Date}]),ue.plan_id&&Be(ue.plan_id,ue.title??ue.plan_id),y(!1);break;case"ask":c(je=>[...je,{id:Qe(),role:"agent",content:ue.question??ue.message??"请补充信息。",timestamp:new Date}]),$e();break;case"error":c(je=>[...je,{id:Qe(),role:"agent",content:`❌ ${ue.message??J("agent.unknown_error")}`,timestamp:new Date}]),(ue.code==="AGENT_INIT_FAILED"||ue.code==="AUTH_ERROR"||ue.code==="PROVIDER_ERROR")&&w(`Configuration error: ${ue.message}`),y(!1),E.current="",pe.current="",me(""),U("");break}},re.connect(),Ve.current=re},[$e,le]);b.useEffect(()=>(ct(),()=>{var X;(X=Ve.current)==null||X.disconnect(),Object.values(ve.current).forEach(clearInterval),ve.current={}}),[ct]),b.useEffect(()=>{var X;(X=N.current)==null||X.scrollIntoView({behavior:"smooth"})},[i,h,ze]),b.useEffect(()=>{if(!M||A.current===M)return;const X=C.find(re=>re.id===M)??null;Ce(M,X)},[M,C,Ce]);const Ee=b.useMemo(()=>C.find(X=>X.id===M)??null,[M,C]),Et=!((Ee==null?void 0:Ee.kind)==="plan"&&Ee.plan_id),ft=Et?m:"auto",vn=b.useMemo(()=>C.filter(X=>X.id!==M).slice(0,3),[M,C]),Pn=b.useCallback(X=>{ee(X),sessionStorage.setItem("zeroclaw_session_id",X),$e();const re=C.find(ue=>ue.id===X)??null;Ce(X,re),ct(re==null?void 0:re.plan_id)},[$e,ct,Ce,C]),pt=b.useCallback(()=>{const X=Qe();ee(X),A.current=X,sessionStorage.setItem("zeroclaw_session_id",X),c([]),$e(),ct(null)},[$e,ct]),Ft=b.useCallback(()=>{var re;const X=d.trim();if(!(!X||!((re=Ve.current)!=null&&re.connected))){c(ue=>[...ue,{id:Qe(),role:"user",content:X,timestamp:new Date}]);try{Ve.current.sendMessage(X,{routeMode:ft}),y(!0),E.current="",pe.current="",ke.current="",me(""),U("")}catch{w(J("agent.send_error"))}u(""),r()}},[r,d,ft]),se=b.useCallback(X=>{var re;if(u(X),(re=Ve.current)!=null&&re.connected){c(ue=>[...ue,{id:Qe(),role:"user",content:X,timestamp:new Date}]);try{Ve.current.sendMessage(X,{routeMode:ft}),y(!0),E.current="",pe.current="",ke.current="",me(""),U("")}catch{w(J("agent.send_error"))}}},[ft]),he=b.useCallback((X,re)=>{var Ue;const ue=()=>{K(X),setTimeout(()=>K(Ae=>Ae===X?null:Ae),2e3)};(Ue=navigator.clipboard)!=null&&Ue.writeText?navigator.clipboard.writeText(re).then(ue).catch(()=>{Te(re)&&ue()}):Te(re)&&ue()},[]);function Te(X){const re=document.createElement("textarea");re.value=X,re.style.position="fixed",re.style.opacity="0",document.body.appendChild(re),re.select();try{return document.execCommand("copy"),!0}catch{return!1}finally{document.body.removeChild(re)}}return l.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[l.jsx(C0,{open:T,onClose:()=>j(!1),sessions:C,activeId:M,onSelect:Pn,onNewChat:pt}),I.length>0&&(()=>{const X=I[0];return l.jsxs("div",{className:"px-4 py-2.5 border-b flex items-center gap-3 text-sm animate-fade-in flex-wrap",style:{background:"rgba(255, 159, 10, 0.08)",borderColor:"rgba(255, 159, 10, 0.2)"},children:[l.jsx(Vj,{className:"h-4 w-4 flex-shrink-0",style:{color:"var(--color-status-warning)"}}),l.jsxs("span",{className:"text-xs font-medium",style:{color:"var(--color-status-warning)"},children:["待审批 (",I.length,")"]}),l.jsx("span",{className:"text-xs flex-1 truncate",style:{color:"var(--pc-text-muted)"},children:X.body??"未知操作"}),l.jsxs("button",{type:"button",disabled:Y!==null,onClick:()=>B(X.correlation_id),className:"flex items-center gap-1 text-[10px] px-2.5 py-1 rounded-full font-medium transition-all",style:{background:"rgba(48, 209, 88, 0.15)",color:"#30d158",border:"1px solid rgba(48, 209, 88, 0.3)"},children:[l.jsx($i,{className:"h-3 w-3"}),"批准"]}),l.jsxs("button",{type:"button",disabled:Y!==null,onClick:()=>L(X.correlation_id),className:"flex items-center gap-1 text-[10px] px-2.5 py-1 rounded-full font-medium transition-all",style:{background:"rgba(255, 59, 48, 0.1)",color:"var(--color-status-error)",border:"1px solid rgba(255, 59, 48, 0.3)"},children:[l.jsx(al,{className:"h-3 w-3"}),"拒绝"]})]})})(),k&&l.jsxs("div",{className:"px-4 py-2 border-b flex items-center gap-2 text-sm animate-fade-in",style:{background:"rgba(239, 68, 68, 0.08)",borderColor:"rgba(239, 68, 68, 0.2)",color:"#f87171"},children:[l.jsx(rs,{className:"h-4 w-4 shrink-0"}),k,l.jsx("button",{onClick:()=>w(null),className:"ml-auto text-xs underline",children:J("common.close")})]}),G.filter(X=>X.kind==="need_input"&&X.status==="unread").map(X=>{var re,ue;return l.jsxs("div",{className:"px-4 py-2.5 border-b flex items-center gap-3 text-sm animate-fade-in flex-wrap",style:{background:"rgba(0, 122, 255, 0.06)",borderColor:"rgba(0, 122, 255, 0.15)"},children:[l.jsx("span",{className:"text-xs font-medium",style:{color:"var(--pc-accent)"},children:X.title||"需要输入"}),l.jsx("span",{className:"text-xs flex-1 truncate",style:{color:"var(--pc-text-muted)"},children:X.body}),l.jsx("input",{type:"text",value:q[X.notification_id]??"",onChange:Ue=>ce(Ae=>({...Ae,[X.notification_id]:Ue.target.value})),placeholder:"输入回复...",className:"text-xs px-2 py-1 rounded border",style:{background:"var(--pc-bg-surface)",borderColor:"var(--pc-border)",color:"var(--pc-text-primary)",minWidth:"160px"},onKeyDown:Ue=>{Ue.key==="Enter"&&ge(X.notification_id)}}),l.jsx("button",{type:"button",onClick:()=>ge(X.notification_id),disabled:!((re=q[X.notification_id])!=null&&re.trim()),className:"text-[10px] px-2.5 py-1 rounded-full font-medium transition-all",style:{background:"rgba(0, 122, 255, 0.12)",color:"var(--pc-accent)",border:"1px solid rgba(0, 122, 255, 0.25)",opacity:(ue=q[X.notification_id])!=null&&ue.trim()?1:.5},children:"回复"}),l.jsx("button",{type:"button",onClick:()=>{Uy(X.notification_id),V(Ue=>Ue.map(Ae=>Ae.notification_id===X.notification_id?{...Ae,status:"dismissed"}:Ae))},className:"text-[10px] px-1.5 hover:underline",style:{color:"var(--pc-text-muted)"},children:J("common.close")})]},X.notification_id)}),l.jsx("div",{className:"px-4 py-2 border-b",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg-base)"},children:l.jsxs("div",{className:"max-w-3xl mx-auto flex items-center gap-2 min-w-0",children:[l.jsxs("button",{type:"button",onClick:()=>j(!0),className:"flex items-center gap-2 min-w-0 px-2.5 py-1.5 rounded-lg border text-left transition-all",style:{borderColor:"var(--pc-border)",color:"var(--pc-text-secondary)",background:"var(--pc-bg-surface)"},children:[(Ee==null?void 0:Ee.kind)==="plan"?l.jsx(Ci,{className:"h-3.5 w-3.5 flex-shrink-0",style:{color:"var(--pc-accent)"}}):l.jsx(_r,{className:"h-3.5 w-3.5 flex-shrink-0",style:{color:"var(--pc-text-muted)"}}),l.jsxs("span",{className:"min-w-0",children:[l.jsx("span",{className:"block text-xs font-medium truncate max-w-[220px]",children:Ff(Ee)}),l.jsx("span",{className:"block text-[10px] truncate max-w-[220px]",style:{color:"var(--pc-text-faint)"},children:RT(Ee)})]})]}),l.jsx("div",{className:"hidden md:flex flex-1 min-w-0 items-center gap-1 overflow-hidden",children:vn.map(X=>l.jsxs("button",{type:"button",onClick:()=>Pn(X.id),className:"flex items-center gap-1.5 min-w-0 max-w-[150px] px-2 py-1.5 rounded-lg text-xs border transition-all",style:{borderColor:"transparent",color:"var(--pc-text-muted)"},title:Ff(X),children:[X.kind==="plan"?l.jsx(Ci,{className:"h-3 w-3 flex-shrink-0"}):l.jsx(_r,{className:"h-3 w-3 flex-shrink-0"}),l.jsx("span",{className:"truncate",children:Ff(X)}),X.has_pending_approval&&l.jsx("span",{className:"h-1.5 w-1.5 rounded-full flex-shrink-0",style:{background:"var(--color-status-error)"}})]},X.id))}),l.jsxs("button",{type:"button",onClick:pt,className:"ml-auto flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border text-xs font-medium transition-all",style:{borderColor:"var(--pc-accent-dim)",color:"var(--pc-accent-light)",background:"var(--pc-accent-glow)"},children:[l.jsx(Bi,{className:"h-3.5 w-3.5"}),"新对话"]})]})}),l.jsx("div",{className:"flex-1 overflow-y-auto px-4",children:i.length===0?l.jsx(N0,{onChipSelect:se}):l.jsxs("div",{className:"max-w-3xl mx-auto py-4 space-y-4",children:[i.map((X,re)=>l.jsxs("div",{className:`group flex items-start gap-3 ${X.role==="user"?"flex-row-reverse animate-slide-in-right":"animate-slide-in-left"}`,style:{animationDelay:`${Math.min(re*20,150)}ms`},children:[l.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-xl flex items-center justify-center border",style:{background:X.role==="user"?"var(--pc-accent)":"var(--pc-bg-elevated)",borderColor:X.role==="user"?"var(--pc-accent)":"var(--pc-border)"},children:X.role==="user"?l.jsx(tm,{className:"h-3.5 w-3.5 text-white"}):l.jsx(Zr,{className:"h-3.5 w-3.5",style:{color:"var(--pc-accent)"}})}),l.jsxs("div",{className:"relative max-w-[80%] min-w-0",children:[l.jsxs("div",{className:"rounded-2xl px-4 py-3 border",style:X.role==="user"?{background:"var(--pc-accent-glow)",borderColor:"var(--pc-accent-dim)",color:"var(--pc-text-primary)"}:{background:"var(--pc-bg-elevated)",borderColor:"var(--pc-border)",color:"var(--pc-text-primary)"},children:[X.thinking&&l.jsxs("details",{className:"mb-2",children:[l.jsx("summary",{className:"text-xs cursor-pointer select-none font-medium",style:{color:"var(--pc-text-muted)"},children:J("planb.chat.thought")}),l.jsx("pre",{className:"text-xs mt-1.5 whitespace-pre-wrap break-words leading-relaxed overflow-auto max-h-48 p-2 rounded-lg",style:{color:"var(--pc-text-muted)",background:"var(--pc-bg-surface)"},children:X.thinking})]}),X.toolCall&&l.jsx(CT,{name:X.toolCall.name,args:X.toolCall.args}),X.toolResult&&l.jsx(ET,{output:X.toolResult.output,success:X.toolResult.success}),!X.toolCall&&!X.toolResult?X.markdown?l.jsx("div",{className:"text-sm break-words leading-relaxed chat-markdown",children:l.jsx(_m,{remarkPlugins:[Nm],children:X.content})}):l.jsx("p",{className:"text-sm whitespace-pre-wrap break-words leading-relaxed",children:X.content}):null,l.jsx("p",{className:"text-[10px] mt-1.5",style:{color:"var(--pc-text-faint)"},children:X.timestamp.toLocaleTimeString()})]}),l.jsx("button",{onClick:()=>he(X.id,X.content),"aria-label":J("agent.copy_message"),className:"absolute top-1 right-1 opacity-0 group-hover:opacity-100 transition-all p-1.5 rounded-xl",style:{background:"var(--pc-bg-elevated)",border:"1px solid var(--pc-border)",color:"var(--pc-text-muted)"},onMouseEnter:ue=>{ue.currentTarget.style.color="var(--pc-text-primary)",ue.currentTarget.style.borderColor="var(--pc-accent-dim)"},onMouseLeave:ue=>{ue.currentTarget.style.color="var(--pc-text-muted)",ue.currentTarget.style.borderColor="var(--pc-border)"},children:z===X.id?l.jsx(Li,{className:"h-3 w-3",style:{color:"#34d399"}}):l.jsx(Qp,{className:"h-3 w-3"})})]})]},X.id)),h&&l.jsxs("div",{className:"flex items-start gap-3 animate-fade-in",children:[l.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-xl flex items-center justify-center border",style:{background:"var(--pc-bg-elevated)",borderColor:"var(--pc-border)"},children:l.jsx(Zr,{className:"h-3.5 w-3.5",style:{color:"var(--pc-accent)"}})}),l.jsxs("div",{className:"rounded-2xl px-4 py-3 border max-w-[80%]",style:{background:"var(--pc-bg-elevated)",borderColor:"var(--pc-border)",color:"var(--pc-text-primary)"},children:[D&&l.jsxs("details",{className:"mb-2",open:be&&!ze,children:[l.jsxs("summary",{className:"text-xs cursor-pointer select-none font-medium",style:{color:"var(--pc-text-muted)"},children:[J("planb.chat.thought"),!ze&&l.jsx("span",{className:"ml-1 animate-pulse",children:"..."})]}),l.jsx("pre",{className:"text-xs mt-1.5 whitespace-pre-wrap break-words leading-relaxed overflow-auto max-h-48 p-2 rounded-lg",style:{color:"var(--pc-text-muted)",background:"var(--pc-bg-surface)"},children:D})]}),ze?l.jsxs("p",{className:"text-sm whitespace-pre-wrap break-words leading-relaxed",children:[ze,l.jsx("span",{className:"inline-block w-0.5 h-4 ml-0.5 animate-pulse align-middle",style:{background:"var(--pc-accent)"}})]}):D?null:l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"bounce-dot w-1.5 h-1.5 rounded-full",style:{background:"var(--pc-accent)"}}),l.jsx("span",{className:"bounce-dot w-1.5 h-1.5 rounded-full",style:{background:"var(--pc-accent)"}}),l.jsx("span",{className:"bounce-dot w-1.5 h-1.5 rounded-full",style:{background:"var(--pc-accent)"}})]})]})]}),l.jsx("div",{ref:N})]})}),l.jsx(Em,{value:d,onChange:u,onSend:Ft,connected:x,routeMode:ft,onRouteModeChange:Et?p:void 0}),l.jsxs("div",{className:"flex items-center justify-center pb-2 gap-2",children:[l.jsx("span",{className:"status-dot",style:x?{background:"var(--color-status-success)",boxShadow:"0 0 6px var(--color-status-success)"}:{background:"var(--color-status-error)",boxShadow:"0 0 6px var(--color-status-error)"}}),l.jsx("span",{className:"text-[10px]",style:{color:"var(--pc-text-faint)"},children:J(x?"agent.connected_status":"agent.disconnected_status")}),l.jsx("button",{type:"button",onClick:()=>j(!T),className:"text-[10px] ml-3 hover:underline",style:{color:"var(--pc-text-faint)"},children:J("planb.chat.sessions")})]})]})}function LT({connected:e,pages:a=[],stealthOk:r,cdpUrl:i="http://127.0.0.1:9222",bridgeUrl:c="http://127.0.0.1:9228",className:d=""}){return l.jsxs("div",{className:`rounded-2xl border p-4 ${d}`,style:{borderColor:"var(--pc-border)",background:"var(--pc-bg-elevated)"},children:[l.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[l.jsx(ls,{className:"h-4 w-4",style:{color:"var(--pc-accent)"}}),l.jsx("span",{className:"text-xs font-semibold",style:{color:"var(--pc-text-primary)"},children:"CDP Bridge"}),l.jsx("div",{className:"flex items-center gap-1 ml-auto",children:e?l.jsxs(l.Fragment,{children:[l.jsx(l1,{className:"h-3 w-3",style:{color:"#30d158"}}),l.jsx("span",{className:"text-[10px]",style:{color:"#30d158"},children:"已连接"})]}):l.jsxs(l.Fragment,{children:[l.jsx(Qj,{className:"h-3 w-3",style:{color:"#ff3b30"}}),l.jsx("span",{className:"text-[10px]",style:{color:"#ff3b30"},children:"未连接"})]})})]}),l.jsxs("div",{className:"text-[10px] space-y-1 font-mono",children:[l.jsxs("div",{className:"flex justify-between",children:[l.jsx("span",{style:{color:"var(--pc-text-faint)"},children:"CDP"}),l.jsx("span",{style:{color:"var(--pc-text-muted)"},children:i})]}),l.jsxs("div",{className:"flex justify-between",children:[l.jsx("span",{style:{color:"var(--pc-text-faint)"},children:"Bridge"}),l.jsx("span",{style:{color:"var(--pc-text-muted)"},children:c})]}),r!==void 0&&l.jsxs("div",{className:"flex justify-between",children:[l.jsx("span",{style:{color:"var(--pc-text-faint)"},children:"Stealth"}),l.jsxs("span",{style:{color:r?"#30d158":"#ff3b30"},children:[r?"webdriver=false":"未检测"," "]})]})]}),a.length>0&&l.jsxs("div",{className:"mt-3 pt-3 border-t",style:{borderColor:"var(--pc-border)"},children:[l.jsxs("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-2",style:{color:"var(--pc-text-faint)"},children:["页面 (",a.length,")"]}),a.map(u=>l.jsxs("div",{className:"text-[10px] py-1 border-b last:border-0",style:{borderColor:"var(--pc-border)"},children:[l.jsx("div",{className:"truncate font-medium",style:{color:"var(--pc-text-primary)"},title:u.title,children:u.title||u.url}),l.jsx("div",{className:"truncate font-mono",style:{color:"var(--pc-text-faint)"},title:u.url,children:u.url})]},u.id))]})]})}function $T(){const[e,a]=b.useState(""),[r,i]=b.useState([]),[c,d]=b.useState(!1),[u,m]=b.useState(null),[p,h]=b.useState(!0),[y,x]=b.useState(!1),[v,k]=b.useState([]),w=b.useCallback(async()=>{try{const C=await mS();i(C.sessions??[])}catch{}finally{h(!1)}},[]);b.useEffect(()=>{w();const C=setInterval(w,5e3);return()=>clearInterval(C)},[w]),b.useEffect(()=>{let C=!1;async function $(){try{const ee=await fetch("http://127.0.0.1:9228/health");if(C)return;if(ee.ok){x(!0);try{const ne=await fetch("http://127.0.0.1:9228/pages");if(!C&&ne.ok){const A=await ne.json();k(A.pages||[])}}catch{}}else x(!1)}catch{C||x(!1)}}$();const M=setInterval($,15e3);return()=>{C=!0,clearInterval(M)}},[]);const T=async()=>{d(!0),m(null);try{const C=await pS(e||void 0);i($=>[...$,{session_id:C.session_id,target_url:e,status:"launching",started_at:new Date().toISOString()}]),a("")}catch(C){m(C instanceof Error?C.message:J("planb.browser.launch_error"))}finally{d(!1)}},j=async C=>{try{await hS(C),i($=>$.filter(M=>M.session_id!==C))}catch{m(J("planb.browser.close_error"))}};return l.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[u&&l.jsxs("div",{className:"px-4 py-2 border-b flex items-center gap-2 text-sm",style:{background:"rgba(239, 68, 68, 0.08)",borderColor:"rgba(239, 68, 68, 0.2)",color:"#f87171"},children:[l.jsx(em,{className:"h-4 w-4 shrink-0"}),u,l.jsx("button",{onClick:()=>m(null),className:"ml-auto shrink-0",children:l.jsx(Ha,{className:"h-3.5 w-3.5"})})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[l.jsx("div",{className:"h-10 w-10 rounded-2xl flex items-center justify-center",style:{background:"var(--pc-accent-glow)"},children:l.jsx(ls,{className:"h-5 w-5",style:{color:"var(--pc-accent)"}})}),l.jsxs("div",{children:[l.jsx("h1",{className:"text-lg font-semibold",style:{color:"var(--pc-text-primary)"},children:J("planb.browser.title")}),l.jsx("p",{className:"text-xs",style:{color:"var(--pc-text-muted)"},children:J("planb.browser.subtitle")})]})]}),l.jsx("div",{className:"rounded-2xl border p-4 mb-6",style:{background:"var(--pc-bg-elevated)",borderColor:"var(--pc-border)"},children:l.jsxs("div",{className:"flex gap-3",children:[l.jsx("input",{type:"url",value:e,onChange:C=>a(C.target.value),placeholder:J("planb.browser.url_placeholder"),className:"input-electric flex-1 px-4 py-2.5 text-sm rounded-xl",onKeyDown:C=>{C.key==="Enter"&&T()}}),l.jsxs("button",{type:"button",onClick:T,disabled:c,className:"btn-electric px-5 py-2.5 rounded-xl text-sm font-medium flex items-center gap-2",children:[c?l.jsx(Ry,{className:"h-4 w-4 animate-spin"}):l.jsx(ds,{className:"h-4 w-4"}),J("planb.browser.launch")]})]})}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-sm font-medium mb-3",style:{color:"var(--pc-text-secondary)"},children:J("planb.browser.active_sessions")}),p?l.jsxs("div",{className:"flex items-center gap-2 py-8 justify-center",style:{color:"var(--pc-text-muted)"},children:[l.jsx(Ry,{className:"h-4 w-4 animate-spin"}),l.jsx("span",{className:"text-sm",children:J("common.loading")})]}):r.length===0?l.jsxs("div",{className:"py-12 text-center rounded-2xl border",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg-surface)"},children:[l.jsx(ls,{className:"h-8 w-8 mx-auto mb-2",style:{color:"var(--pc-text-faint)"}}),l.jsx("p",{className:"text-sm",style:{color:"var(--pc-text-muted)"},children:J("planb.browser.no_sessions")})]}):l.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:r.map(C=>l.jsxs("div",{className:"rounded-2xl border p-4 transition-all",style:{background:"var(--pc-bg-elevated)",borderColor:"var(--pc-border)"},children:[l.jsxs("div",{className:"flex items-center justify-between mb-3",children:[l.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs font-medium px-2 py-1 rounded-full",style:{background:C.status==="running"?"rgba(52, 211, 153, 0.1)":C.status==="error"?"rgba(239, 68, 68, 0.1)":"rgba(251, 191, 36, 0.1)",color:C.status==="running"?"#34d399":C.status==="error"?"#f87171":"#fbbf24"},children:[l.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{background:C.status==="running"?"#34d399":C.status==="error"?"#f87171":"#fbbf24"}}),J(`planb.browser.status_${C.status}`)]}),l.jsx("button",{type:"button",onClick:()=>j(C.session_id),className:"h-7 w-7 rounded-lg flex items-center justify-center transition-colors",style:{color:"var(--pc-text-faint)"},onMouseEnter:$=>{$.currentTarget.style.color="#f87171",$.currentTarget.style.background="rgba(239,68,68,0.1)"},onMouseLeave:$=>{$.currentTarget.style.color="var(--pc-text-faint)",$.currentTarget.style.background="transparent"},children:l.jsx(Ha,{className:"h-3.5 w-3.5"})})]}),l.jsx("p",{className:"text-sm font-mono mb-2 truncate",style:{color:"var(--pc-text-primary)"},children:C.target_url||"about:blank"}),l.jsxs("div",{className:"flex items-center gap-1.5 text-xs",style:{color:"var(--pc-text-faint)"},children:[l.jsx(Ni,{className:"h-3 w-3"}),new Date(C.started_at).toLocaleTimeString()]})]},C.session_id))})]}),l.jsx("div",{className:"mt-4",children:l.jsx(LT,{connected:y,pages:v,cdpUrl:"http://127.0.0.1:9222",bridgeUrl:"http://127.0.0.1:9228"})})]})]})}function Lb(e){return Array.isArray(e)?e:[]}function Ct(e,a=""){return typeof e=="string"?e:typeof e=="number"?String(e):a}function ms(e){return/[\u4e00-\u9fff]/.test(e)}const $b={queued:"排队中",ready:"就绪",idle:"待执行",pending:"待处理",pending_authorization:"待授权",waiting_input:"待输入",draft:"草稿",reviewing:"审核中",approved:"已批准",preparing:"准备中",running:"执行中",active:"运行中",blocked:"已阻塞",succeeded:"已完成",success:"成功",finished:"已完成",complete:"已完成",completed:"已完成",failed:"失败",error:"错误",cancelled:"已取消",canceled:"已取消",aborted:"已终止",rejected:"已拒绝",deferred:"已暂缓",dispatched:"已下发",scheduled:"已设置定时",enabled:"已启用",disabled:"已停用",paused:"已暂停",unknown:"未知"},Bb={plan:"计划",task:"任务",task_running:"处理中",task_done:"任务完成",run:"执行开始",run_done:"执行完成",skill_tool:"技能调用",artifact:"产物",task_summary:"结果",entered_session:"会话",start:"目标",RunStarted:"开始调用",RequestDispatched:"请求已发出",ResponseReceived:"收到返回",RunSkipped:"本次跳过",RunCompleted:"执行完成",waiting_for_authorization:"等待授权",pending_authorization:"等待授权",authorization_approved:"授权通过",authorization_rejected:"授权拒绝",authorization_deferred:"稍后处理",failed:"执行失败",completed:"执行完成"};function yn(e,a="未知"){const r=Ct(e).trim();if(!r)return a;const i=$b[r]??$b[r.toLowerCase()];return i||(ms(r)?r:a)}function BT(e){const a=Ct(e).trim();return a?Bb[a]??Bb[a.toLowerCase()]??(ms(a)?a:"事件"):"事件"}function Bc(e,a="暂无事件内容"){const r=Ct(e).trim();if(!r)return a;if(ms(r))return r;const i=yn(r,"");if(i)return i;const c=r.match(/^(Succeeded|Failed|Running|Completed)\s*\(attempt\s*#(\d+)\)$/i);return c?`${yn(c[1])}(第 ${c[2]} 次)`:/request failed/i.test(r)?"请求失败":/backend unavailable/i.test(r)?"后端服务不可达":/not found/i.test(r)?"未找到对应资源":a}function kr(e,a="未命名内容"){const r=Ct(e).trim();if(!r||/unnamed/i.test(r))return a;if(ms(r))return r;const i=yn(r,"");if(i)return i;const c=M0(r);return c||r}function Sp(e){return["succeeded","success","finished","complete","completed"].includes(e.toLowerCase())}function Np(e){return["failed","error","cancelled","canceled","aborted","rejected","deadletter"].includes(e.toLowerCase())}function UT(e,a){const r=Ct(e).trim().toLowerCase();return a.length===0?r||"pending":a.some(i=>Np(i.status))?"failed":a.some(i=>["running","active","leased"].includes(i.status.toLowerCase()))?"running":a.some(i=>["queued","ready","pending"].includes(i.status.toLowerCase()))?"queued":a.every(i=>Sp(i.status))?"succeeded":r||"pending"}function HT(e,a){const r=Ct(e,"unknown").trim().toLowerCase();return Sp(r)||Np(r)?r:a.some(i=>Np(i.status))?"failed":a.some(i=>["running","active","queued","leased"].includes(i.status.toLowerCase()))?"running":a.length>0&&a.every(i=>Sp(i.status))?"succeeded":r||"unknown"}function Ub(e){return e?e.map(a=>{const r=Ct(a.plan_id),c=Lb(a.steps).map(u=>{const p=Lb(u.tasks).map(h=>({id:Ct(h.task_id),title:kr(h.title,"子任务"),description:Ct(h.description),status:Ct(h.status,"pending"),assignedSkillId:h.assigned_skill_id?Ct(h.assigned_skill_id):null,startedAt:h.started_at?Ct(h.started_at):null,finishedAt:h.finished_at?Ct(h.finished_at):null}));return{id:Ct(u.step_id),title:kr(u.title,"任务步骤"),description:Ct(u.description),status:UT(u.status,p),preferredSkills:Array.isArray(u.preferred_skills)?u.preferred_skills:[],tasks:p}}),d=[];for(const u of c)for(const m of u.tasks)d.push(m.id);return{id:r,title:kr(a.title,"未命名任务"),objective:kr(a.objective||a.description,"暂无任务说明"),status:HT(a.status,c),createdAt:a.created_at?Ct(a.created_at):null,updatedAt:a.updated_at?Ct(a.updated_at):null,steps:c,sourceIds:{planId:r||void 0,taskIds:d}}}):[]}const If={"decision-analyzer":"决策分析","git-log-collector":"Git 日志采集","number-generator":"数据生成","office-export-xlsx":"Excel 导出","task-tracker":"任务跟踪","weekly-report-writer":"周报撰写","zhihu-hotlist-detail":"知乎热榜明细","zhihu-hotlist":"知乎热榜","tq-lineloss-report":"台区线损报表","archive-workorder-grid-push-monitor":"归档工单推送监控","available-balance-below-zero-monitor":"可用余额监控","command-center-fee-control-monitor":"费用管控监控","sgcc-todo-crawler":"SGCC 待办爬取","appointment-workorder-monitor":"约时工单监控","fault-location-monitor":"故障定位监控","fudian-failure-monitor":"复电失败监控","important-service-expiry-monitor":"服务到期预警","by-95598-customer-satisfaction-report":"95598 满意率日报","by-daily-report-statistics":"日报统计","by-fire-fault-monthly-report":"火警故障月报","by-risk-control-next-day-plan-report":"风控次日计划","by-risk-control-week-plan-report":"风控周计划","by-supervision-workorder-detail-report":"督办工单明细","age-file-encryption":"文件加解密","anonymous-file-upload":"匿名文件上传","browser-automation-agent":"浏览器自动化","bulk-github-star":"批量仓库标星","changelog-generator":"更新日志生成","code-reviewer":"代码审查","commit-automation":"自动提交","crypto-trading-signal":"交易信号分析","csv-to-json":"CSV 转 JSON","data-analysis":"数据分析","deep-research":"深度调研","dependency-updater":"依赖更新","deploy-automation":"自动部署","dns-lookup":"DNS 查询","document-generator":"文档生成","email-automation":"邮件自动化","file-converter":"文件格式转换","git-history-analyzer":"Git 历史分析","github-issue-manager":"Issue 管理","image-optimizer":"图片优化","json-schema-validator":"JSON Schema 校验","log-analyzer":"日志分析","markdown-to-pdf":"Markdown 转 PDF","meeting-summarizer":"会议纪要","news-aggregator":"新闻聚合","pdf-extractor":"PDF 提取","performance-profiler":"性能分析","pr-review-bot":"PR 审查","release-notes-generator":"发布说明生成","screenshot-automation":"截图自动化","search-engine-scraper":"搜索引擎抓取","sentiment-analysis":"情感分析","shell-command-runner":"命令执行","slack-notification":"Slack 通知","spreadsheet-generator":"电子表格生成","text-summarizer":"文本摘要","torrent-search":"资源搜索","translate-text":"文本翻译","web-scraper":"网页抓取","website-monitor":"网站监控","whitepaper-analyzer":"白皮书分析","xml-to-json":"XML 转 JSON"};function M0(e){if(If[e])return If[e];for(const[a,r]of Object.entries(If))if(e.includes(a)||a.includes(e))return r;return null}function Hb(e,a){const r=M0(e);return r||(ms(a)?a:"自动化技能")}const qb={"decision-analyzer":"数字化","git-log-collector":"数字化","number-generator":"数字化","office-export-xlsx":"办公","task-tracker":"办公","weekly-report-writer":"报表","zhihu-hotlist-detail":"数字化","zhihu-hotlist":"数字化","tq-lineloss-report":"报表","archive-workorder-grid-push-monitor":"监控巡检","available-balance-below-zero-monitor":"监控巡检","command-center-fee-control-monitor":"监控巡检","sgcc-todo-crawler":"监控巡检","appointment-workorder-monitor":"监控巡检","fault-location-monitor":"监控巡检","fudian-failure-monitor":"监控巡检","important-service-expiry-monitor":"监控巡检","by-95598-customer-satisfaction-report":"报表","by-daily-report-statistics":"报表","by-fire-fault-monthly-report":"报表","by-risk-control-next-day-plan-report":"报表","by-risk-control-week-plan-report":"报表","by-supervision-workorder-detail-report":"报表","age-file-encryption":"数字化","anonymous-file-upload":"通信","browser-automation-agent":"数字化","bulk-github-star":"发展","changelog-generator":"发展","chat-logger":"通信","check-crypto-address-balance":"财务","city-distance":"发展","city-tourism-website-builder":"营销","crawl-websites-at-scale":"数字化","csv-data-summarizer":"财务","d3js-data-visualization":"数字化","database-query-and-export":"数字化","file-tracker":"综合","free-geocoding-and-maps":"发展","free-translation-api":"综合","free-weather-data":"综合","generate-asset-price-chart":"财务","generate-qr-code-natively":"数字化","get-crypto-price":"财务","git-worktree-cli":"发展","github-stats":"发展","html-to-markdown":"数字化","image-compressor":"综合","json-to-csv":"数字化","llm-council":"数字化","markdown-table-generator":"综合","multi-format-converter":"综合","npm-package-info":"发展","pdf-generator":"综合","random-number-generator":"综合","readability-score":"综合","rss-feed-reader":"通信","sql-formatter":"数字化","text-diff":"综合","torrent-search":"通信","unit-converter":"综合","url-shortener":"通信","youtube-transcript":"通信","zip-extractor":"综合"};function qT(e){return qb[e]?qb[e]:"综合"}function FT(e,a,r){const i=Ct(a).trim();return i&&ms(i)?i:e.includes("monitor")?`${r}能力,用于按排班自动巡检并提示异常。`:e.includes("report")?`${r}能力,用于自动生成和整理业务报表。`:`${r}能力,可由数字员工按需执行或定时处理。`}function IT(e){return e?e.map(a=>{const r=Ct(a.skill_id,Ct(a.id));return{id:r,name:Hb(r,Ct(a.name,r)),version:a.version?Ct(a.version):null,enabled:!!a.enabled,description:FT(r,a.description,Hb(r,Ct(a.name,r))),category:qT(r),capabilityLevel:"standard",source:"skill-api"}}):[]}const YT="popout-chat",z0="planb_msgs_",R0="sgrobot_chat_route_mode";function GT(){const e=localStorage.getItem(R0);return e==="chat"||e==="direct"||e==="plan"?e:"auto"}function vc(e){try{const a=localStorage.getItem(z0+e);return a?JSON.parse(a).map(i=>({...i,timestamp:new Date(i.timestamp)})):[]}catch{return[]}}function Yf(e,a){try{localStorage.setItem(z0+e,JSON.stringify(a))}catch{}}function Gf(e,a){if(!e||typeof e!="object")return"";const r=e[a];return typeof r=="string"?r:""}function VT(e,a){const r=e||"tool";if(r==="read_skill"){const i=Gf(a,"name")||Gf(a,"skill")||Gf(a,"skill_name");return`读取技能说明:${kr(i,"自动化技能")}`}return r.includes("zhihu-hotlist")&&r.includes("extract_hotlist")?"调用技能:知乎热榜采集":r.includes("office-export-xlsx")&&r.includes("export_xlsx")?"调用技能:Excel 导出":r==="web_search_tool"?"检索热榜数据来源":r==="web_fetch"||r==="http_request"?"获取网页/API 数据":`调用工具:${kr(r,r)}`}function KT(e){var c,d;const a=(e||"").trim();if(!a)return"工具已返回空结果";if(a.startsWith("[skill]"))return"技能说明已读取";try{const u=JSON.parse(a);if(u&&typeof u=="object"){const m=u,p=Array.isArray(m.rows)?m.rows.length:void 0,h=typeof m.sheet_name=="string"?m.sheet_name:void 0,y=typeof m.source=="string"?m.source:void 0;if(typeof p=="number")return`${h?`${kr(h,h)}数据`:"数据"}采集完成:共 ${p} 条记录${y?`,来源:${y}`:""}`;if(typeof m.row_count=="number")return`数据处理完成:共 ${m.row_count} 条记录`}}catch{}const r=(c=a.match(/"row_count"\s*:\s*(\d+)/))==null?void 0:c[1],i=(d=a.match(/"output_path"\s*:\s*"([^"]+\.xlsx)"/))==null?void 0:d[1];return i?`产物生成:${i.replace(/\\\\/g,"\\")}${r?`,共 ${r} 条记录`:""}`:r?`数据处理完成:共 ${r} 条记录`:a.length>220?Bc(a,"工具已返回结果"):Bc(a,a)}function PT(e){return e.filter(a=>{var r;return(r=a.content)==null?void 0:r.trim()}).map(a=>({id:Qe(),role:a.role==="user"?"user":"agent",content:a.content,markdown:a.role!=="user",timestamp:new Date}))}function XT(e){return e?/^Session\s+/i.test(e)||/^对话\s+[0-9a-f]{6,}/i.test(e)||/^计划\s+[0-9a-f]{6,}/i.test(e)||e==="新对话":!0}function QT(e){if(!e)return"";const a=new Date(e);return Number.isNaN(a.getTime())?"":a.toLocaleString([],{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}function ZT(e,a){if(e==="plan")return"未命名计划";const r=QT(a);return r?`${r} 的对话`:"未命名对话"}function JT(){const{draft:e,saveDraft:a,clearDraft:r}=S0(YT),[i,c]=b.useState(()=>sessionStorage.getItem("zeroclaw_session_id")??null),[d,u]=b.useState(()=>{const D=sessionStorage.getItem("zeroclaw_session_id");return D?vc(D):[]}),[m,p]=b.useState(e),[h,y]=b.useState(()=>GT()),[x,v]=b.useState(!1),[k,w]=b.useState(!1),[T,j]=b.useState(null),[C,$]=b.useState(!1),[M,ee]=b.useState([]),ne=b.useRef(i);ne.current=i,b.useEffect(()=>{const D=ne.current??sessionStorage.getItem("zeroclaw_session_id")??"default";Yf(D,d)},[d]);const A=b.useRef(null),G=b.useRef(null),[V,oe]=b.useState(null),Y=b.useRef(""),F=b.useRef(""),I=b.useRef(""),[Q,le]=b.useState(""),[B,L]=b.useState(""),q=b.useRef(null);b.useEffect(()=>{a(m)},[m,a]),b.useEffect(()=>{localStorage.setItem(R0,h)},[h]),b.useEffect(()=>{let D=!1;const U=async()=>{try{const Ne=await rm();if(D)return;const $e=Ne.map(Ce=>{const nt=Ce.kind??"chat",Be=Ce.last_activity??Ce.started_at??Ce.created_at,Ve=Ce.plan_title??null,ct=Ce.name??"";return{id:Ce.session_id??Ce.id??"",name:ct.trim()&&!XT(ct)?ct.trim():Ve||ZT(nt,Be),kind:nt,plan_id:Ce.plan_id??null,plan_title:Ve,updated_at:Be,message_count:Ce.message_count}});ee($e)}catch{}};U();const be=setInterval(U,15e3);return()=>{D=!0,clearInterval(be)}},[]),b.useEffect(()=>{const D=new Cm;return D.onOpen=()=>{w(!0),j(null)},D.onClose=U=>{w(!1),U.code!==1e3&&U.code!==1001&&j(`Connection closed (code: ${U.code}).`)},D.onError=()=>j(J("agent.connection_error")),D.onMessage=U=>{var be,Ne,$e;switch(U.type){case"session_start":U.session_id&&(c(U.session_id),sessionStorage.setItem("zeroclaw_session_id",U.session_id));break;case"session_renamed":if(U.session_id&&((be=U.name)!=null&&be.trim())){const Ce=U.name.trim(),nt=new Date().toISOString();ee(Be=>Be.find(ct=>ct.id===U.session_id)?Be.map(ct=>ct.id===U.session_id?{...ct,name:Ce,updated_at:nt}:ct):[{id:U.session_id,name:Ce,kind:"chat",plan_id:null,updated_at:nt,message_count:1},...Be])}break;case"connected":break;case"thinking":v(!0),F.current+=U.content??"",L(F.current);break;case"chunk":v(!0),Y.current+=U.content??"",le(Y.current);break;case"chunk_reset":I.current=F.current,Y.current="",F.current="",le(""),L("");break;case"message":case"done":{const Ce=U.full_response??U.content??Y.current,nt=I.current||F.current||void 0;Ce&&u(Be=>[...Be,{id:Qe(),role:"agent",content:Ce,thinking:nt,markdown:!0,timestamp:new Date}]),Y.current="",F.current="",I.current="",le(""),L(""),v(!1);break}case"tool_call":u(Ce=>[...Ce,{id:Qe(),role:"agent",content:VT(U.name,U.args),timestamp:new Date}]);break;case"tool_result":u(Ce=>[...Ce,{id:Qe(),role:"agent",content:KT(U.output),timestamp:new Date}]);break;case"direct_task_created":v(!0);break;case"plan_created":u(Ce=>[...Ce,{id:Qe(),role:"agent",content:`已创建计划:${U.title??"未命名计划"}`,timestamp:new Date}]),v(!1);break;case"governance":{const Ce=[U.message??"执行治理已受理",(Ne=U.route_decision)!=null&&Ne.route_kind?`分流:${U.route_decision.route_kind}`:null,U.created_plan_id?`计划:${U.created_plan_id}`:null,U.created_schedule_id?`调度:${U.created_schedule_id}`:null,($e=U.created_task_ids)!=null&&$e.length?`任务:${U.created_task_ids.join(", ")}`:null].filter(Boolean);u(nt=>[...nt,{id:Qe(),role:"agent",content:Ce.join(`
|
||
`),timestamp:new Date}]),v(!1),Y.current="",F.current="",I.current="",le(""),L("");break}case"ask":u(Ce=>[...Ce,{id:Qe(),role:"agent",content:U.question??U.message??"请补充信息。",timestamp:new Date}]),v(!1),Y.current="",F.current="",I.current="",le(""),L("");break;case"error":u(Ce=>[...Ce,{id:Qe(),role:"agent",content:`错误:${U.message??J("agent.unknown_error")}`,timestamp:new Date}]),(U.code==="AGENT_INIT_FAILED"||U.code==="AUTH_ERROR"||U.code==="PROVIDER_ERROR")&&j(`Configuration error: ${U.message}`),v(!1),Y.current="",F.current="",le(""),L("");break}},D.connect(),A.current=D,()=>{D.disconnect()}},[]),b.useEffect(()=>{var D;(D=G.current)==null||D.scrollIntoView({behavior:"smooth"})},[d,x,Q]);const ce=b.useCallback(async(D,U)=>{q.current=D;try{const be=(U==null?void 0:U.kind)==="plan"&&U.plan_id?await Ti(U.plan_id):await u1(D);if(q.current!==D)return;const Ne=PT(be.messages);u(Ne.length>0?Ne:vc(D))}catch{q.current===D&&u(vc(D))}},[]);b.useEffect(()=>{if(!i||q.current===i)return;const D=M.find(U=>U.id===i)??null;ce(i,D)},[i,M,ce]);const ge=M.find(D=>D.id===i)??null,N=!((ge==null?void 0:ge.kind)==="plan"&&ge.plan_id),z=N?h:"auto",K=b.useCallback(()=>{var U;const D=m.trim();if(!(!D||!((U=A.current)!=null&&U.connected))){u(be=>[...be,{id:Qe(),role:"user",content:D,timestamp:new Date}]);try{A.current.sendMessage(D,{routeMode:z}),v(!0),Y.current="",F.current="",I.current="",le(""),L("")}catch{j(J("agent.send_error"))}p(""),r()}},[m,z,r]),E=b.useCallback(D=>{var U;if((U=A.current)!=null&&U.connected){u(be=>[...be,{id:Qe(),role:"user",content:D,timestamp:new Date}]);try{A.current.sendMessage(D,{routeMode:z}),v(!0)}catch{j(J("agent.send_error"))}}},[z]),pe=b.useCallback(D=>{const U=document.createElement("textarea");U.value=D,U.style.position="fixed",U.style.opacity="0",document.body.appendChild(U),U.select();try{return document.execCommand("copy"),!0}catch{return!1}finally{document.body.removeChild(U)}},[]),ke=b.useCallback((D,U)=>{var Ne;const be=()=>{oe(D),setTimeout(()=>oe($e=>$e===D?null:$e),2e3)};(Ne=navigator.clipboard)!=null&&Ne.writeText?navigator.clipboard.writeText(U).then(be).catch(()=>{pe(U)&&be()}):pe(U)&&be()},[pe]),ve=b.useCallback(D=>{var Ne,$e,Ce;const U=ne.current??sessionStorage.getItem("zeroclaw_session_id")??"default";Yf(U,d),c(D),sessionStorage.setItem("zeroclaw_session_id",D),u(vc(D));const be=M.find(nt=>nt.id===D)??null;ce(D,be),Y.current="",F.current="",I.current="",le(""),L(""),(Ne=A.current)==null||Ne.disconnect(),($e=A.current)==null||$e.setPlanId((be==null?void 0:be.plan_id)??null),(Ce=A.current)==null||Ce.connect()},[ce,d,M]),ze=b.useCallback(()=>{var be,Ne,$e;const D=ne.current??sessionStorage.getItem("zeroclaw_session_id")??"default";Yf(D,d);const U=Qe();c(U),q.current=U,sessionStorage.setItem("zeroclaw_session_id",U),u([]),Y.current="",F.current="",I.current="",le(""),L(""),(be=A.current)==null||be.disconnect(),(Ne=A.current)==null||Ne.setPlanId(null),($e=A.current)==null||$e.connect()},[d]),me=()=>{window.opener&&(window.opener.focus(),window.close())};return l.jsxs("div",{className:"flex flex-col h-screen overflow-hidden select-none",style:{background:"var(--pc-bg-base)"},onContextMenu:D=>D.preventDefault(),children:[l.jsxs("div",{className:"h-9 flex items-center justify-between px-3 flex-shrink-0 border-b",style:{background:"var(--pc-bg-surface)",borderColor:"var(--pc-border)",WebkitAppRegion:"drag"},children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(_r,{className:"h-3.5 w-3.5",style:{color:"var(--pc-accent)"}}),l.jsx("span",{className:"text-xs font-semibold",style:{color:"var(--pc-text-primary)"},children:"PlanB Chat"})]}),l.jsxs("div",{className:"flex items-center gap-1",style:{WebkitAppRegion:"no-drag"},children:[l.jsx("span",{className:"status-dot",style:k?{background:"var(--color-status-success)",boxShadow:"0 0 6px var(--color-status-success)"}:{background:"var(--color-status-error)",boxShadow:"0 0 6px var(--color-status-error)"}}),!window.opener&&l.jsx("span",{className:"text-[10px]",style:{color:"var(--pc-text-faint)"},children:J(k?"agent.connected_status":"agent.disconnected_status")}),l.jsx("button",{type:"button",onClick:()=>$(!C),className:"h-7 w-7 rounded-lg flex items-center justify-center transition-colors",style:{color:"var(--pc-text-muted)"},onMouseEnter:D=>{D.currentTarget.style.color="var(--pc-text-primary)",D.currentTarget.style.background="var(--pc-hover)"},onMouseLeave:D=>{D.currentTarget.style.color="var(--pc-text-muted)",D.currentTarget.style.background="transparent"},title:J("planb.chat.sessions"),children:l.jsx(_r,{className:"h-3 w-3"})}),window.opener&&l.jsx("button",{type:"button",onClick:me,className:"h-7 w-7 rounded-lg flex items-center justify-center transition-colors",style:{color:"var(--pc-text-muted)"},onMouseEnter:D=>{D.currentTarget.style.color="var(--pc-text-primary)",D.currentTarget.style.background="var(--pc-hover)"},onMouseLeave:D=>{D.currentTarget.style.color="var(--pc-text-muted)",D.currentTarget.style.background="transparent"},title:"Dock back",children:l.jsx(Ha,{className:"h-3 w-3"})})]})]}),l.jsx(C0,{open:C,onClose:()=>$(!1),sessions:M,activeId:i,onSelect:D=>ve(D),onNewChat:()=>ze()}),T&&l.jsxs("div",{className:"px-3 py-1.5 border-b flex items-center gap-2 text-xs animate-fade-in flex-shrink-0",style:{background:"rgba(239, 68, 68, 0.08)",borderColor:"rgba(239, 68, 68, 0.2)",color:"#f87171"},children:[l.jsx(rs,{className:"h-3.5 w-3.5 shrink-0"}),l.jsx("span",{className:"truncate",children:T}),l.jsx("button",{onClick:()=>j(null),className:"ml-auto shrink-0 text-xs underline",children:J("common.close")})]}),l.jsx("div",{className:"flex-1 overflow-y-auto px-3 min-h-0",children:d.length===0?l.jsx(N0,{onChipSelect:E}):l.jsxs("div",{className:"py-3 space-y-3",children:[d.map(D=>l.jsxs("div",{className:`group flex items-start gap-2 ${D.role==="user"?"flex-row-reverse":""}`,children:[l.jsx("div",{className:"flex-shrink-0 w-7 h-7 rounded-lg flex items-center justify-center border",style:{background:D.role==="user"?"var(--pc-accent)":"var(--pc-bg-elevated)",borderColor:D.role==="user"?"var(--pc-accent)":"var(--pc-border)"},children:D.role==="user"?l.jsx(tm,{className:"h-3 w-3 text-white"}):l.jsx(Zr,{className:"h-3 w-3",style:{color:"var(--pc-accent)"}})}),l.jsxs("div",{className:"relative max-w-[85%] min-w-0",children:[l.jsxs("div",{className:"rounded-xl px-3 py-2 border",style:D.role==="user"?{background:"var(--pc-accent-glow)",borderColor:"var(--pc-accent-dim)",color:"var(--pc-text-primary)"}:{background:"var(--pc-bg-elevated)",borderColor:"var(--pc-border)",color:"var(--pc-text-primary)"},children:[D.thinking&&l.jsxs("details",{className:"mb-1.5",children:[l.jsx("summary",{className:"text-[11px] cursor-pointer select-none font-medium",style:{color:"var(--pc-text-muted)"},children:J("planb.chat.thought")}),l.jsx("pre",{className:"text-[10px] mt-1 whitespace-pre-wrap break-words leading-relaxed overflow-auto max-h-36 p-1.5 rounded-lg",style:{color:"var(--pc-text-muted)",background:"var(--pc-bg-surface)"},children:D.thinking})]}),D.markdown?l.jsx("div",{className:"text-[13px] break-words leading-relaxed chat-markdown",children:l.jsx(_m,{remarkPlugins:[Nm],children:D.content})}):l.jsx("p",{className:"text-[13px] whitespace-pre-wrap break-words leading-relaxed",children:D.content})]}),l.jsx("button",{onClick:()=>ke(D.id,D.content),className:"absolute top-0.5 right-0.5 opacity-0 group-hover:opacity-100 transition-all p-1 rounded-lg",style:{background:"var(--pc-bg-elevated)",border:"1px solid var(--pc-border)",color:"var(--pc-text-muted)"},children:V===D.id?l.jsx(Li,{className:"h-2.5 w-2.5",style:{color:"#34d399"}}):l.jsx(Qp,{className:"h-2.5 w-2.5"})}),l.jsx("p",{className:`text-[10px] mt-1 ${D.role==="user"?"text-right":""}`,style:{color:"var(--pc-text-faint)"},children:D.timestamp.toLocaleTimeString()})]})]},D.id)),x&&l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx("div",{className:"flex-shrink-0 w-7 h-7 rounded-lg flex items-center justify-center border",style:{background:"var(--pc-bg-elevated)",borderColor:"var(--pc-border)"},children:l.jsx(Zr,{className:"h-3 w-3",style:{color:"var(--pc-accent)"}})}),l.jsxs("div",{className:"rounded-xl px-3 py-2 border max-w-[85%]",style:{background:"var(--pc-bg-elevated)",borderColor:"var(--pc-border)",color:"var(--pc-text-primary)"},children:[B&&l.jsxs("details",{className:"mb-1.5",open:!Q,children:[l.jsxs("summary",{className:"text-[11px] cursor-pointer select-none font-medium",style:{color:"var(--pc-text-muted)"},children:[J("planb.chat.thought"),!Q&&l.jsx("span",{className:"ml-1 animate-pulse",children:"..."})]}),l.jsx("pre",{className:"text-[10px] mt-1 whitespace-pre-wrap break-words leading-relaxed overflow-auto max-h-36 p-1.5 rounded-lg",style:{color:"var(--pc-text-muted)",background:"var(--pc-bg-surface)"},children:B})]}),Q?l.jsxs("p",{className:"text-[13px] whitespace-pre-wrap break-words leading-relaxed",children:[Q,l.jsx("span",{className:"inline-block w-0.5 h-3.5 ml-0.5 animate-pulse align-middle",style:{background:"var(--pc-accent)"}})]}):B?null:l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"bounce-dot w-1.5 h-1.5 rounded-full",style:{background:"var(--pc-accent)"}}),l.jsx("span",{className:"bounce-dot w-1.5 h-1.5 rounded-full",style:{background:"var(--pc-accent)"}}),l.jsx("span",{className:"bounce-dot w-1.5 h-1.5 rounded-full",style:{background:"var(--pc-accent)"}})]})]})]}),l.jsx("div",{ref:G})]})}),l.jsx(Em,{value:m,onChange:p,onSend:K,connected:k,routeMode:z,onRouteModeChange:N?y:void 0})]})}function sl({title:e,subtitle:a,icon:r,actions:i,className:c=""}){return l.jsxs("div",{className:`flex items-center gap-3 px-4 py-3 border-b ${c}`,style:{background:"var(--pc-bg-elevated)",borderColor:"var(--pc-border)"},children:[r&&l.jsx(r,{className:"h-5 w-5",style:{color:"var(--pc-accent)"}}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("h2",{className:"text-sm font-semibold truncate",style:{color:"var(--pc-text-primary)"},children:e}),a&&l.jsx("p",{className:"text-[11px] truncate",style:{color:"var(--pc-text-faint)"},children:a})]}),i&&l.jsx("div",{className:"flex items-center gap-2 shrink-0",children:i})]})}function Uc({items:e,selected:a,onChange:r,className:i=""}){return l.jsx("div",{className:`flex flex-wrap gap-1.5 ${i}`,children:e.map(c=>l.jsx("button",{onClick:()=>r(c.id),className:`text-[11px] px-3 py-1 rounded-full font-medium transition-all border whitespace-nowrap ${a===c.id?"text-white border-transparent":"hover:opacity-80"}`,style:a===c.id?{background:"var(--pc-accent)",borderColor:"var(--pc-accent)"}:{background:"var(--pc-hover)",borderColor:"var(--pc-border)",color:"var(--pc-text-muted)"},children:c.label},c.id))})}function ra({icon:e=Dj,message:a,action:r,className:i=""}){return l.jsxs("div",{className:`flex flex-col items-center justify-center py-16 px-4 ${i}`,style:{color:"var(--pc-text-muted)"},children:[l.jsx(e,{className:"h-12 w-12 mb-3 opacity-30"}),l.jsx("p",{className:"text-sm",children:a}),r&&l.jsx("button",{onClick:r.onClick,className:"btn-electric mt-4 px-4 py-2 text-xs font-medium",children:r.label})]})}function il({message:e,className:a=""}){return l.jsxs("div",{className:`flex flex-col items-center justify-center py-16 ${a}`,children:[l.jsx("div",{className:"h-10 w-10 border-2 rounded-full animate-spin",style:{borderColor:"var(--pc-border)",borderTopColor:"var(--pc-accent)"}}),e&&l.jsx("p",{className:"text-sm mt-3",style:{color:"var(--pc-text-muted)"},children:e})]})}function jr({message:e,onDismiss:a,className:r=""}){return l.jsxs("div",{className:`flex items-start gap-3 p-4 rounded-2xl text-sm border ${r}`,style:{background:"rgba(255,59,48,0.06)",borderColor:"rgba(255,59,48,0.2)",color:"#ff3b30"},role:"alert",children:[l.jsx("span",{className:"flex-1",children:e}),a&&l.jsx("button",{onClick:a,className:"shrink-0 p-0.5 rounded-full hover:bg-white/10 transition-colors","aria-label":"Dismiss",children:l.jsx(Ha,{className:"h-4 w-4"})})]})}const Fb=[{id:"tasks",label:"任务管理"},{id:"approvals",label:"审批队列"},{id:"cron",label:"定时任务"},{id:"store",label:"数据存储"},{id:"system",label:"系统信息"}],WT=["canonical_events","tasks","runs","plans","plan_steps","approvals","artifacts"];function O0(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function e6(e){if(e.expression)return e.expression;if(O0(e.schedule)){const a=e.schedule.expr??e.schedule.expression??e.schedule.cron;if(typeof a=="string"&&a.trim())return a}return typeof e.schedule=="string"&&e.schedule.trim()?e.schedule:"—"}function t6(e){for(const a of[e.schedule,e.delivery]){if(!O0(a))continue;const r=a.template_id??a.plan_template_id??a.templateId;if(typeof r=="string"&&r.trim())return r}return"—"}function n6(e){return e.map(a=>({...a,expression:e6(a),template:t6(a)}))}function a6(e){const a=[e.message,e.error?`error=${e.error}`:null].filter(Boolean);return a.length>0?a.join(";"):"Cron 检查未被治理命令接受"}function r6(e){if(e==null)return"";if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function l6(){var ee;const[e,a]=b.useState("tasks"),[r,i]=b.useState(null),[c,d]=b.useState([]),[u,m]=b.useState([]),[p,h]=b.useState(""),[y,x]=b.useState(!0),[v,k]=b.useState(null),[w,T]=b.useState("tasks"),j=b.useCallback(async()=>{try{const ne=await lm();i(ne),k(null)}catch(ne){k(ne instanceof Error?ne.message:"加载失败")}finally{x(!1)}},[]);b.useEffect(()=>{j()},[j]);const C=async()=>{try{d(await Ei())}catch{}},$=async()=>{try{h(await c1()),m(await sm())}catch{}},M=async()=>{var ne;try{const A=await d1();if(!A.accepted||A.error)throw new Error(a6(A));const G=typeof((ne=A.result)==null?void 0:ne.activated)=="number"?A.result.activated:0;alert(`已激活 ${G} 个计划`)}catch(A){alert(A instanceof Error?A.message:"Cron 检查失败")}};return y?l.jsx(il,{message:"加载中..."}):l.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[l.jsx(sl,{title:"开发者工具",subtitle:((ee=Fb.find(ne=>ne.id===e))==null?void 0:ee.label)||"",icon:nm,actions:l.jsx("button",{onClick:j,className:"p-2 rounded-lg transition-colors hover:bg-[var(--pc-hover)]",style:{color:"var(--pc-text-muted)"},title:"刷新",children:l.jsx(Ba,{className:"h-4 w-4"})})}),v&&l.jsx(jr,{message:v,onDismiss:()=>k(null)}),l.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[l.jsx("div",{className:"w-52 shrink-0 border-r overflow-y-auto py-2",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg-elevated)"},children:Fb.map(ne=>l.jsx("div",{onClick:()=>{a(ne.id),ne.id==="cron"&&C(),ne.id==="system"&&$()},className:"px-4 py-2.5 text-xs cursor-pointer transition-colors",style:{color:e===ne.id?"var(--pc-accent)":"var(--pc-text-muted)",background:e===ne.id?"var(--pc-accent-glow)":"transparent",fontWeight:e===ne.id?600:400},children:ne.label},ne.id))}),l.jsxs("div",{className:"flex-1 overflow-y-auto p-5",style:{background:"var(--pc-bg-base)"},children:[e==="tasks"&&l.jsx(xi,{title:"任务",rows:(r==null?void 0:r.tables.tasks)||[],cols:["task_id","status","plan_id","assigned_skill_id"]}),e==="approvals"&&l.jsx(xi,{title:"审批",rows:(r==null?void 0:r.tables.approvals)||[],cols:["approval_id","status","task_id"]}),e==="cron"&&l.jsxs("div",{children:[l.jsx("button",{onClick:M,className:"mb-3 px-3 py-1.5 rounded-full text-xs font-medium text-white",style:{background:"var(--pc-accent)"},children:"立即检查 Cron"}),l.jsx(xi,{title:"Cron 作业",rows:n6(c),cols:["id","name","expression","template","job_type","enabled","last_status"]})]}),e==="store"&&l.jsxs("div",{children:[l.jsx(Uc,{items:WT.map(ne=>({id:ne,label:ne})),selected:w,onChange:T}),l.jsx("div",{className:"mt-2",children:l.jsx(xi,{title:w,rows:(r==null?void 0:r.tables[w])||[],cols:[],maxRows:100})})]}),e==="system"&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"surface-panel p-4",children:[l.jsx("div",{className:"text-xs font-semibold mb-2",style:{color:"var(--pc-text-primary)"},children:"配置"}),l.jsx("pre",{className:"text-[10px] font-mono max-h-60 overflow-y-auto p-2 rounded-lg",style:{background:"var(--pc-bg-base)",color:"var(--pc-text-muted)"},children:p.slice(0,3e3)})]}),l.jsx(xi,{title:"技能",rows:u,cols:["skill_id","name","enabled"]})]})]})]})]})}function xi({title:e,rows:a,cols:r,maxRows:i=50}){const c=a.slice(-i),d=r.length>0?r:Object.keys(c[0]??{});return c.length===0?l.jsx(ra,{message:`${e||""} — 无数据`}):l.jsxs("div",{children:[e&&l.jsxs("div",{className:"text-[11px] font-semibold mb-2",style:{color:"var(--pc-text-faint)"},children:[e," (",a.length,")"]}),l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full border-collapse text-[10px] font-mono",children:[l.jsx("thead",{children:l.jsx("tr",{children:d.map(u=>l.jsx("th",{className:"sticky top-0 z-10 p-1.5 text-left text-[9px] font-semibold border-b",style:{background:"var(--pc-bg-elevated)",color:"var(--pc-text-faint)",borderColor:"var(--pc-border)"},children:u},u))})}),l.jsx("tbody",{children:c.map((u,m)=>l.jsx("tr",{className:"border-b",style:{borderColor:"var(--pc-border)"},children:d.map(p=>l.jsx(s6,{value:u[p]},p))},m))})]})})]})}function s6({value:e}){const a=r6(e);return l.jsx("td",{className:"p-1.5 max-w-[200px] truncate",style:{color:"var(--pc-text-muted)"},title:a,children:a.slice(0,60)})}const i6="admin",o6="demo123";function c6(){const[e,a]=b.useState(""),[r,i]=b.useState(""),[c,d]=b.useState(""),u=Gc(),m=p=>{p.preventDefault(),e===i6&&r===o6?(sessionStorage.setItem("sgrobot_logged_in","1"),u("/",{replace:!0})):d("账号或密码错误")};return l.jsx("div",{className:"min-h-screen flex items-center justify-center",style:{background:"var(--pc-bg-base)"},children:l.jsxs("div",{className:"w-full max-w-sm rounded-2xl border p-8 shadow-2xl",style:{background:"var(--pc-bg-surface)",borderColor:"var(--pc-border)"},children:[l.jsxs("div",{className:"text-center mb-8",children:[l.jsx("div",{className:"inline-flex h-12 w-12 items-center justify-center rounded-2xl mb-3",style:{background:"var(--pc-accent-glow)"},children:l.jsx("span",{className:"text-lg font-black tracking-tight",style:{color:"var(--pc-accent)"},children:"sgR"})}),l.jsx("h1",{className:"text-xl font-bold",style:{color:"var(--pc-text-primary)"},children:"sgRobot"}),l.jsx("p",{className:"text-xs mt-1",style:{color:"var(--pc-text-muted)"},children:"智能助手平台"})]}),l.jsxs("form",{onSubmit:m,className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs font-medium mb-1.5",style:{color:"var(--pc-text-secondary)"},children:"账号"}),l.jsx("input",{type:"text",value:e,onChange:p=>{a(p.target.value),d("")},placeholder:"请输入账号",className:"w-full h-10 px-3 rounded-xl text-sm border outline-none transition-colors",style:{background:"var(--pc-bg-elevated)",borderColor:"var(--pc-border)",color:"var(--pc-text-primary)"},onFocus:p=>{p.currentTarget.style.borderColor="var(--pc-accent)"},onBlur:p=>{p.currentTarget.style.borderColor="var(--pc-border)"},autoComplete:"username"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs font-medium mb-1.5",style:{color:"var(--pc-text-secondary)"},children:"密码"}),l.jsx("input",{type:"password",value:r,onChange:p=>{i(p.target.value),d("")},placeholder:"请输入密码",className:"w-full h-10 px-3 rounded-xl text-sm border outline-none transition-colors",style:{background:"var(--pc-bg-elevated)",borderColor:"var(--pc-border)",color:"var(--pc-text-primary)"},onFocus:p=>{p.currentTarget.style.borderColor="var(--pc-accent)"},onBlur:p=>{p.currentTarget.style.borderColor="var(--pc-border)"},autoComplete:"current-password"})]}),c&&l.jsx("p",{className:"text-xs text-center",style:{color:"#f87171"},children:c}),l.jsx("button",{type:"submit",className:"w-full h-10 rounded-xl text-sm font-semibold transition-all",style:{background:"var(--pc-accent)",color:"#fff"},onMouseEnter:p=>{p.currentTarget.style.opacity="0.9"},onMouseLeave:p=>{p.currentTarget.style.opacity="1"},children:"登录"})]})]})})}const u6=1e3,d6=3e4;class Cp{constructor(a={}){_t(this,"controller",null);_t(this,"reconnectTimer",null);_t(this,"currentDelay");_t(this,"intentionallyClosed",!1);_t(this,"onEvent",null);_t(this,"onError",null);_t(this,"onConnect",null);_t(this,"path");_t(this,"reconnectDelay");_t(this,"maxReconnectDelay");_t(this,"autoReconnect");this.path=a.path??`${wr()}${rl}/api/events`,this.reconnectDelay=a.reconnectDelay??u6,this.maxReconnectDelay=a.maxReconnectDelay??d6,this.autoReconnect=a.autoReconnect??!0,this.currentDelay=this.reconnectDelay}connect(){this.intentionallyClosed=!1,this.clearReconnectTimer(),this.controller=new AbortController;const a=is(),r={Accept:"text/event-stream"};a&&(r.Authorization=`Bearer ${a}`),fetch(this.path,{headers:r,signal:this.controller.signal}).then(i=>{var c;if(!i.ok)throw new Error(`SSE connection failed: ${i.status}`);if(!i.body)throw new Error("SSE response has no body");return this.currentDelay=this.reconnectDelay,(c=this.onConnect)==null||c.call(this),this.consumeStream(i.body)}).catch(i=>{var c;i instanceof DOMException&&i.name==="AbortError"||((c=this.onError)==null||c.call(this,i instanceof Error?i:new Error(String(i))),this.scheduleReconnect())})}disconnect(){this.intentionallyClosed=!0,this.clearReconnectTimer(),this.controller&&(this.controller.abort(),this.controller=null)}async consumeStream(a){var d;const r=a.getReader(),i=new TextDecoder;let c="";try{for(;;){const{done:u,value:m}=await r.read();if(u)break;c+=i.decode(m,{stream:!0});const p=c.split(`
|
||
|
||
`);c=p.pop()??"";for(const h of p)this.parseEvent(h)}}catch(u){if(u instanceof DOMException&&u.name==="AbortError")return;(d=this.onError)==null||d.call(this,u instanceof Error?u:new Error(String(u)))}finally{r.releaseLock()}this.scheduleReconnect()}parseEvent(a){var u;let r="message";const i=[];for(const m of a.split(`
|
||
`))m.startsWith("event:")?r=m.slice(6).trim():m.startsWith("data:")&&i.push(m.slice(5).trim());if(i.length===0)return;const c=i.join(`
|
||
`);let d;try{d=JSON.parse(c),d.type=d.type??r}catch{d={type:r,data:c}}(u=this.onEvent)==null||u.call(this,d)}scheduleReconnect(){this.intentionallyClosed||!this.autoReconnect||(this.reconnectTimer=setTimeout(()=>{this.currentDelay=Math.min(this.currentDelay*2,this.maxReconnectDelay),this.connect()},this.currentDelay))}clearReconnectTimer(){this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}}function L0(e={}){const{autoConnect:a=!0,maxEvents:r=500,filterTypes:i,...c}=e,d=b.useRef(null),[u,m]=b.useState("disconnected"),[p,h]=b.useState([]),y=b.useRef(i);y.current=i;const x=b.useRef(r);x.current=r;const v=b.useCallback(()=>(d.current||(d.current=new Cp(c)),d.current),[]);b.useEffect(()=>{const j=v();return j.onConnect=()=>{m("connected")},j.onEvent=C=>{y.current&&y.current.length>0&&!y.current.includes(C.type)||h($=>{const M=[...$,C];return M.length>x.current?M.slice(M.length-x.current):M})},j.onError=()=>{m("disconnected")},a&&(m("connecting"),j.connect()),()=>{j.disconnect(),d.current=null}},[v,a]);const k=b.useCallback(()=>{const j=v();m("connecting"),j.connect()},[v]),w=b.useCallback(()=>{v().disconnect(),m("disconnected")},[v]),T=b.useCallback(()=>{h([])},[]);return{events:p,status:u,connect:k,disconnect:w,clearEvents:T}}function f6(e){const a=Math.floor(e/86400),r=Math.floor(e%86400/3600),i=Math.floor(e%3600/60);return a>0?`${a}d ${r}h ${i}m`:r>0?`${r}h ${i}m`:`${i}m`}function p6(e){return`$${e.toFixed(4)}`}function m6(e){try{return new Date(e).toLocaleString()}catch{return e}}function Ep(e){try{const a=Date.now()-new Date(e).getTime(),r=Math.floor(a/1e3);if(r<60)return`${r}s ago`;const i=Math.floor(r/60);if(i<60)return`${i}m ago`;const c=Math.floor(i/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}catch{return e}}function ji(e){switch(e.toLowerCase()){case"ok":case"healthy":return"var(--color-status-success)";case"warn":case"warning":case"degraded":return"var(--color-status-warning)";default:return"var(--color-status-error)"}}function Tp(e){switch(e.toLowerCase()){case"ok":case"healthy":return"rgba(0, 230, 138, 0.2)";case"warn":case"warning":case"degraded":return"rgba(255, 170, 0, 0.2)";default:return"rgba(255, 68, 102, 0.2)"}}function $0(e){switch(e.toLowerCase()){case"ok":case"healthy":return"rgba(0, 230, 138, 0.05)";case"warn":case"warning":case"degraded":return"rgba(255, 170, 0, 0.05)";default:return"rgba(255, 68, 102, 0.05)"}}function kc(e){switch(e){case"active":return"var(--color-status-success)";case"idle":return"var(--color-status-warning)";default:return"var(--pc-text-faint)"}}const h6=[{icon:_j,accent:"var(--pc-accent)",labelKey:"dashboard.provider_model",getValue:e=>e.provider??"Unknown",getSub:e=>e.model??""},{icon:Ni,accent:"#34d399",labelKey:"dashboard.uptime",getValue:e=>f6(e.uptime_seconds),getSub:()=>J("dashboard.since_last_restart")},{icon:ls,accent:"#a78bfa",labelKey:"dashboard.gateway_port",getValue:e=>`:${e.gateway_port}`,getSub:()=>""},{icon:wj,accent:"#fbbf24",labelKey:"dashboard.memory_backend",getValue:e=>e.memory_backend,getSub:e=>`${J("dashboard.paired")}: ${e.paired?J("dashboard.paired_yes"):J("dashboard.paired_no")}`}],g6=[{id:"overview",labelKey:"dashboard.tab_overview",icon:Zp},{id:"sessions",labelKey:"dashboard.tab_sessions",icon:r1},{id:"channels",labelKey:"dashboard.tab_channels",icon:l1}];function x6({status:e,cost:a,showAllChannels:r,setShowAllChannels:i}){const c=Math.max(a.session_cost_usd,a.daily_cost_usd,a.monthly_cost_usd,.001);return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 stagger-children",children:h6.map(({icon:d,accent:u,labelKey:m,getValue:p,getSub:h})=>l.jsxs("div",{className:"card p-5 animate-slide-in-up",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[l.jsx("div",{className:"p-2 rounded-2xl",style:{background:"rgba(var(--pc-accent-rgb), 0.08)",color:u},children:l.jsx(d,{className:"h-5 w-5"})}),l.jsx("span",{className:"text-xs uppercase tracking-wider font-medium",style:{color:"var(--pc-text-muted)"},children:J(m)})]}),l.jsx("p",{className:"text-lg font-semibold truncate capitalize",style:{color:"var(--pc-text-primary)"},children:p(e)}),l.jsx("p",{className:"text-sm truncate",style:{color:"var(--pc-text-muted)"},children:h(e)})]},m))}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 stagger-children",children:[l.jsxs("div",{className:"card p-5 animate-slide-in-up",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-5",children:[l.jsx(jj,{className:"h-5 w-5",style:{color:"var(--pc-accent)"}}),l.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wider",style:{color:"var(--pc-text-primary)"},children:J("dashboard.cost_overview")})]}),l.jsx("div",{className:"space-y-4",children:[{label:J("dashboard.session_label"),value:a.session_cost_usd,color:"var(--pc-accent)"},{label:J("dashboard.daily_label"),value:a.daily_cost_usd,color:"#34d399"},{label:J("dashboard.monthly_label"),value:a.monthly_cost_usd,color:"#a78bfa"}].map(({label:d,value:u,color:m})=>l.jsxs("div",{children:[l.jsxs("div",{className:"flex justify-between text-sm mb-1.5",children:[l.jsx("span",{style:{color:"var(--pc-text-muted)"},children:d}),l.jsx("span",{className:"font-medium font-mono",style:{color:"var(--pc-text-primary)"},children:p6(u)})]}),l.jsx("div",{className:"w-full h-1.5 rounded-full overflow-hidden",style:{background:"var(--pc-hover)"},children:l.jsx("div",{className:"h-full rounded-full progress-bar-animated transition-all duration-700 ease-out",style:{width:`${Math.max(u/c*100,2)}%`,background:m}})})]},d))}),l.jsxs("div",{className:"mt-5 pt-4 border-t flex justify-between text-sm",style:{borderColor:"var(--pc-border)"},children:[l.jsx("span",{style:{color:"var(--pc-text-muted)"},children:J("dashboard.total_tokens_label")}),l.jsx("span",{className:"font-mono",style:{color:"var(--pc-text-primary)"},children:a.total_tokens.toLocaleString()})]}),l.jsxs("div",{className:"flex justify-between text-sm mt-1",children:[l.jsx("span",{style:{color:"var(--pc-text-muted)"},children:J("dashboard.requests_label")}),l.jsx("span",{className:"font-mono",style:{color:"var(--pc-text-primary)"},children:a.request_count.toLocaleString()})]})]}),l.jsxs("div",{className:"card p-5 animate-slide-in-up",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-5",children:[l.jsx(e1,{className:"h-5 w-5",style:{color:"var(--pc-accent)"}}),l.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wider",style:{color:"var(--pc-text-primary)"},children:J("dashboard.channels")}),l.jsx("button",{onClick:()=>i(d=>!d),className:"ml-auto flex items-center gap-1 rounded-full px-2.5 py-1 text-[10px] font-medium border transition-all",style:r?{background:"rgba(var(--pc-accent-rgb), 0.1)",borderColor:"rgba(var(--pc-accent-rgb), 0.3)",color:"var(--pc-accent-light)"}:{background:"rgba(0, 230, 138, 0.08)",borderColor:"rgba(0, 230, 138, 0.25)",color:"#34d399"},"aria-label":J(r?"dashboard.filter_active":"dashboard.filter_all"),children:J(r?"dashboard.filter_all":"dashboard.filter_active")})]}),l.jsx("div",{className:"space-y-2 overflow-y-auto max-h-48 pr-1",children:Object.entries(e.channels).length===0?l.jsx("p",{className:"text-sm",style:{color:"var(--pc-text-faint)"},children:J("dashboard.no_channels")}):(()=>{const d=Object.entries(e.channels).filter(([,u])=>r||u);return d.length===0?l.jsx("p",{className:"text-sm",style:{color:"var(--pc-text-faint)"},children:J("dashboard.no_active_channels")}):d.map(([u,m])=>l.jsxs("div",{className:"flex items-center justify-between py-2.5 px-3 rounded-xl transition-all",style:{background:"var(--pc-bg-elevated)"},onMouseEnter:p=>{p.currentTarget.style.background="var(--pc-hover)"},onMouseLeave:p=>{p.currentTarget.style.background="var(--pc-bg-elevated)"},children:[l.jsx("span",{className:"text-sm font-medium capitalize",style:{color:"var(--pc-text-primary)"},children:u}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"status-dot",style:m?{background:"var(--color-status-success)",boxShadow:"0 0 6px var(--color-status-success)"}:{background:"var(--pc-text-faint)"}}),l.jsx("span",{className:"text-xs",style:{color:"var(--pc-text-muted)"},children:J(m?"dashboard.active":"dashboard.inactive")})]})]},u))})()})]}),l.jsxs("div",{className:"card p-5 animate-slide-in-up",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-5",children:[l.jsx(vi,{className:"h-5 w-5",style:{color:"var(--pc-accent)"}}),l.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wider",style:{color:"var(--pc-text-primary)"},children:J("dashboard.component_health")})]}),l.jsx("div",{className:"grid grid-cols-2 gap-3",children:Object.entries(e.health.components).length===0?l.jsx("p",{className:"text-sm col-span-2",style:{color:"var(--pc-text-faint)"},children:J("dashboard.no_components")}):Object.entries(e.health.components).map(([d,u])=>l.jsxs("div",{className:"rounded-2xl p-3 transition-all",style:{border:`1px solid ${Tp(u.status)}`,background:$0(u.status)},onMouseEnter:m=>{m.currentTarget.style.transform="scale(1.02)"},onMouseLeave:m=>{m.currentTarget.style.transform="scale(1)"},children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx("span",{className:"status-dot",style:{background:ji(u.status),boxShadow:`0 0 6px ${ji(u.status)}`}}),l.jsx("span",{className:"text-sm font-medium truncate capitalize",style:{color:"var(--pc-text-primary)"},children:d})]}),l.jsx("p",{className:"text-xs capitalize",style:{color:"var(--pc-text-muted)"},children:u.status}),u.restart_count>0&&l.jsxs("p",{className:"text-xs mt-1",style:{color:"var(--color-status-warning)"},children:[J("dashboard.restarts"),": ",u.restart_count]})]},d))})]})]})]})}function y6(){const[e,a]=b.useState([]),[r,i]=b.useState(!0),[c,d]=b.useState(null),[u,m]=b.useState(null),{events:p}=L0({filterTypes:["session_update","session_created","session_closed"],autoConnect:!0}),h=b.useCallback(()=>{rm().then(y=>{a(y.map(x=>({...x,id:x.session_id,channel:x.channel??"",status:x.status??"closed",last_activity:x.last_activity??x.created_at??"",started_at:x.started_at??x.created_at??"",message_count:x.message_count??0}))),i(!1)}).catch(y=>{d(y.message),i(!1)})},[]);return b.useEffect(()=>{h()},[h]),b.useEffect(()=>{p.length!==0&&h()},[p.length,h]),r?l.jsx("div",{className:"flex items-center justify-center h-48",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"h-6 w-6 border-2 rounded-full animate-spin",style:{borderColor:"var(--pc-border)",borderTopColor:"var(--pc-accent)"}}),l.jsx("span",{className:"text-sm",style:{color:"var(--pc-text-muted)"},children:J("dashboard.loading_sessions")})]})}):c?l.jsxs("div",{className:"rounded-2xl border p-4",style:{background:"rgba(239, 68, 68, 0.08)",borderColor:"rgba(239, 68, 68, 0.2)",color:"#f87171"},children:[J("dashboard.load_sessions_error"),": ",c]}):l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[l.jsxs("div",{className:"lg:col-span-2 card p-5 animate-slide-in-up",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-5",children:[l.jsx(r1,{className:"h-5 w-5",style:{color:"var(--pc-accent)"}}),l.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wider",style:{color:"var(--pc-text-primary)"},children:J("dashboard.sessions_title")}),l.jsx("span",{className:"ml-auto text-xs font-mono px-2 py-0.5 rounded-full",style:{background:"rgba(var(--pc-accent-rgb), 0.1)",color:"var(--pc-accent)"},children:e.length})]}),e.length===0?l.jsx("p",{className:"text-sm py-8 text-center",style:{color:"var(--pc-text-faint)"},children:J("dashboard.no_sessions")}):l.jsx("div",{className:"space-y-2 overflow-y-auto max-h-96",children:e.map(y=>l.jsxs("button",{onClick:()=>m(y),className:"w-full text-left flex items-center justify-between py-3 px-4 rounded-xl transition-all",style:{background:(u==null?void 0:u.id)===y.id?"rgba(var(--pc-accent-rgb), 0.08)":"var(--pc-bg-elevated)",border:(u==null?void 0:u.id)===y.id?"1px solid rgba(var(--pc-accent-rgb), 0.2)":"1px solid transparent"},onMouseEnter:x=>{(u==null?void 0:u.id)!==y.id&&(x.currentTarget.style.background="var(--pc-hover)")},onMouseLeave:x=>{(u==null?void 0:u.id)!==y.id&&(x.currentTarget.style.background="var(--pc-bg-elevated)")},children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsxs("span",{className:"text-sm font-medium font-mono truncate",style:{color:"var(--pc-text-primary)"},children:[y.id.slice(0,8),"..."]}),l.jsx("span",{className:"text-[10px] uppercase font-medium px-2 py-0.5 rounded-full",style:{background:`${kc(y.status)}15`,color:kc(y.status)},children:y.status})]}),l.jsxs("div",{className:"flex items-center gap-3 text-xs",style:{color:"var(--pc-text-muted)"},children:[l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(Aj,{className:"h-3 w-3"}),y.channel]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(_r,{className:"h-3 w-3"}),y.message_count]}),l.jsx("span",{children:Ep(y.last_activity)})]})]}),l.jsx(Zv,{className:"h-4 w-4 flex-shrink-0",style:{color:"var(--pc-text-faint)"}})]},y.id))})]}),l.jsxs("div",{className:"card p-5 animate-slide-in-up",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-5",children:[l.jsx(vi,{className:"h-5 w-5",style:{color:"var(--pc-accent)"}}),l.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wider",style:{color:"var(--pc-text-primary)"},children:J("dashboard.session_details")})]}),u?l.jsxs("div",{className:"space-y-4",children:[[{label:J("dashboard.session_id"),value:u.id},{label:J("dashboard.session_channel"),value:u.channel},{label:J("dashboard.session_started"),value:m6(u.started_at)},{label:J("dashboard.session_last_activity"),value:Ep(u.last_activity)},{label:J("dashboard.session_status"),value:u.status},{label:J("dashboard.session_messages"),value:String(u.message_count)}].map(({label:y,value:x})=>l.jsxs("div",{children:[l.jsx("p",{className:"text-xs uppercase tracking-wider mb-1",style:{color:"var(--pc-text-faint)"},children:y}),l.jsx("p",{className:"text-sm font-medium capitalize truncate",style:{color:"var(--pc-text-primary)"},children:x})]},y)),l.jsx("div",{className:"pt-3 mt-3 border-t",style:{borderColor:"var(--pc-border)"},children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"status-dot",style:{background:kc(u.status),boxShadow:`0 0 6px ${kc(u.status)}`}}),l.jsx("span",{className:"text-xs capitalize",style:{color:"var(--pc-text-muted)"},children:u.status})]})})]}):l.jsx("p",{className:"text-sm py-8 text-center",style:{color:"var(--pc-text-faint)"},children:J("dashboard.session_history")})]})]})}function b6(){const[e,a]=b.useState([]),[r,i]=b.useState(!0),[c,d]=b.useState(null),{events:u}=L0({filterTypes:["channel_update","channel_status"],autoConnect:!0}),m=b.useCallback(()=>{fS().then(p=>{a(p),i(!1)}).catch(p=>{d(p.message),i(!1)})},[]);return b.useEffect(()=>{m()},[m]),b.useEffect(()=>{u.length!==0&&m()},[u.length,m]),r?l.jsx("div",{className:"flex items-center justify-center h-48",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"h-6 w-6 border-2 rounded-full animate-spin",style:{borderColor:"var(--pc-border)",borderTopColor:"var(--pc-accent)"}}),l.jsx("span",{className:"text-sm",style:{color:"var(--pc-text-muted)"},children:J("dashboard.loading_channels")})]})}):c?l.jsxs("div",{className:"rounded-2xl border p-4",style:{background:"rgba(239, 68, 68, 0.08)",borderColor:"rgba(239, 68, 68, 0.2)",color:"#f87171"},children:[J("dashboard.load_channels_error"),": ",c]}):e.length===0?l.jsx("div",{className:"card p-5 animate-slide-in-up",children:l.jsx("p",{className:"text-sm py-8 text-center",style:{color:"var(--pc-text-faint)"},children:J("dashboard.no_channels_detail")})}):l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 stagger-children",children:e.map(p=>l.jsxs("div",{className:"card p-5 animate-slide-in-up transition-all",style:{border:`1px solid ${Tp(p.health)}`,background:$0(p.health)},onMouseEnter:h=>{h.currentTarget.style.transform="translateY(-2px)",h.currentTarget.style.boxShadow=`0 4px 12px ${Tp(p.health)}`},onMouseLeave:h=>{h.currentTarget.style.transform="translateY(0)",h.currentTarget.style.boxShadow="none"},children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"p-2 rounded-2xl",style:{background:"rgba(var(--pc-accent-rgb), 0.08)",color:"var(--pc-accent)"},children:l.jsx(e1,{className:"h-5 w-5"})}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-semibold capitalize",style:{color:"var(--pc-text-primary)"},children:p.name}),l.jsx("span",{className:"text-xs",style:{color:"var(--pc-text-muted)"},children:p.type})]})]}),l.jsx("span",{className:"status-dot",style:{background:ji(p.health),boxShadow:`0 0 6px ${ji(p.health)}`}})]}),l.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[l.jsx("span",{className:"text-[10px] uppercase font-medium px-2 py-0.5 rounded-full",style:{background:p.status==="active"?"rgba(0, 230, 138, 0.1)":p.status==="error"?"rgba(255, 68, 102, 0.1)":"rgba(var(--pc-accent-rgb), 0.08)",color:p.status==="active"?"#34d399":p.status==="error"?"#f87171":"var(--pc-text-muted)"},children:p.status}),l.jsx("span",{className:"text-[10px] uppercase font-medium px-2 py-0.5 rounded-full",style:{background:p.enabled?"rgba(0, 230, 138, 0.1)":"rgba(255, 68, 102, 0.1)",color:p.enabled?"#34d399":"#f87171"},children:p.enabled?J("dashboard.channel_enabled"):J("dashboard.channel_disabled")})]}),l.jsxs("div",{className:"pt-3 border-t space-y-2",style:{borderColor:"var(--pc-border)"},children:[l.jsxs("div",{className:"flex justify-between text-xs",children:[l.jsx("span",{style:{color:"var(--pc-text-muted)"},children:J("dashboard.channel_messages")}),l.jsx("span",{className:"font-mono",style:{color:"var(--pc-text-primary)"},children:p.message_count.toLocaleString()})]}),l.jsxs("div",{className:"flex justify-between text-xs",children:[l.jsx("span",{style:{color:"var(--pc-text-muted)"},children:J("dashboard.channel_last_message")}),l.jsx("span",{className:"font-mono",style:{color:"var(--pc-text-primary)"},children:p.last_message_at?Ep(p.last_message_at):J("dashboard.never")})]}),l.jsxs("div",{className:"flex justify-between text-xs",children:[l.jsx("span",{style:{color:"var(--pc-text-muted)"},children:J("dashboard.health")}),l.jsx("span",{className:"capitalize",style:{color:ji(p.health)},children:p.health})]})]})]},p.name))})}function v6(){const[e,a]=b.useState(null),[r,i]=b.useState(null),[c,d]=b.useState(null),[u,m]=b.useState(!1),[p,h]=b.useState("overview");return b.useEffect(()=>{Promise.all([rS(),dS()]).then(([y,x])=>{a(y),i(x)}).catch(y=>d(y.message))},[]),c?l.jsx("div",{className:"p-6 animate-fade-in",children:l.jsxs("div",{className:"rounded-2xl border p-4",style:{background:"rgba(239, 68, 68, 0.08)",borderColor:"rgba(239, 68, 68, 0.2)",color:"#f87171"},children:[J("dashboard.load_error"),": ",c]})}):!e||!r?l.jsx("div",{className:"flex items-center justify-center h-64",children:l.jsx("div",{className:"h-8 w-8 border-2 rounded-full animate-spin",style:{borderColor:"var(--pc-border)",borderTopColor:"var(--pc-accent)"}})}):l.jsxs("div",{className:"p-6 space-y-6 animate-fade-in",children:[l.jsx("div",{className:"flex items-center gap-1 p-1 rounded-2xl",style:{background:"var(--pc-bg-elevated)"},children:g6.map(({id:y,labelKey:x,icon:v})=>l.jsxs("button",{onClick:()=>h(y),className:"flex items-center gap-2 px-4 py-2.5 rounded-xl text-sm font-medium transition-all",style:p===y?{background:"var(--pc-bg-primary)",color:"var(--pc-accent)",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.1)"}:{background:"transparent",color:"var(--pc-text-muted)"},onMouseEnter:k=>{p!==y&&(k.currentTarget.style.color="var(--pc-text-primary)")},onMouseLeave:k=>{p!==y&&(k.currentTarget.style.color="var(--pc-text-muted)")},children:[l.jsx(v,{className:"h-4 w-4"}),J(x)]},y))}),p==="overview"&&l.jsx(x6,{status:e,cost:r,showAllChannels:u,setShowAllChannels:m}),p==="sessions"&&l.jsx(y6,{}),p==="channels"&&l.jsx(b6,{})]})}const k6={draft:{bg:"rgba(255,159,10,.1)",text:"#ff9f0a"},reviewing:{bg:"rgba(255,159,10,.1)",text:"#ff9f0a"},approved:{bg:"rgba(48,209,88,.1)",text:"#30d158"},active:{bg:"rgba(0,113,227,.1)",text:"var(--pc-accent)"},blocked:{bg:"rgba(255,59,48,.1)",text:"#ff3b30"},completed:{bg:"rgba(48,209,88,.1)",text:"#30d158"},failed:{bg:"rgba(255,59,48,.1)",text:"#ff3b30"},cancelled:{bg:"rgba(255,59,48,.1)",text:"#ff3b30"},queued:{bg:"rgba(255,159,10,.1)",text:"#ff9f0a"},running:{bg:"rgba(0,113,227,.1)",text:"var(--pc-accent)"},succeeded:{bg:"rgba(48,209,88,.1)",text:"#30d158"},finished:{bg:"rgba(48,209,88,.1)",text:"#30d158"},paused:{bg:"rgba(255,159,10,.1)",text:"#ff9f0a"},leased:{bg:"rgba(255,159,10,.1)",text:"#ff9f0a"},ready:{bg:"rgba(142,142,147,.1)",text:"#8e8e93"},pending:{bg:"rgba(142,142,147,.1)",text:"#8e8e93"},waiting_input:{bg:"rgba(175,82,222,.1)",text:"#af52de"},approved_action:{bg:"rgba(48,209,88,.1)",text:"#30d158"},rejected:{bg:"rgba(255,59,48,.1)",text:"#ff3b30"},ok:{bg:"rgba(48,209,88,.1)",text:"#30d158"},error:{bg:"rgba(255,59,48,.1)",text:"#ff3b30"},warn:{bg:"rgba(255,159,10,.1)",text:"#ff9f0a"},info:{bg:"rgba(0,113,227,.1)",text:"var(--pc-accent)"}},Ib={sm:"text-[10px] px-1.5 py-0.5",md:"text-xs px-2 py-0.5",lg:"text-sm px-2.5 py-1"},_6={draft:"草稿",reviewing:"审核中",approved:"已批准",active:"执行中",completed:"已完成",failed:"失败",cancelled:"已取消",blocked:"已阻塞",queued:"排队",running:"运行中",succeeded:"成功",finished:"完成",paused:"已暂停",leased:"已租用",ready:"就绪",pending:"等待",waiting_input:"等待输入",ok:"正常",error:"错误",warn:"警告",info:"信息"};function Wr({status:e,size:a="md",className:r=""}){const i=(e||"").toLowerCase().replace(/[^a-z_]/g,""),c=k6[i]||{bg:"rgba(142,142,147,.1)",text:"#8e8e93"},d=_6[i]||e,u=Ib[a]||Ib.md;return l.jsx("span",{className:`inline-flex items-center rounded-full font-medium whitespace-nowrap ${u} ${r}`,style:{background:c.bg,color:c.text,border:`1px solid ${c.text}20`},children:d})}function Qr({title:e,rows:a,className:r=""}){return l.jsxs("div",{className:`rounded-2xl p-4 border ${r}`,style:{background:"var(--pc-bg-elevated)",borderColor:"var(--pc-border)"},children:[l.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-3",style:{color:"var(--pc-text-faint)"},children:e}),a.map((i,c)=>l.jsxs("div",{className:"flex justify-between items-center py-1.5 text-xs border-b last:border-b-0",style:{borderColor:"var(--pc-border)"},children:[l.jsx("span",{style:{color:"var(--pc-text-muted)"},children:i.label}),l.jsx("span",{className:"text-right max-w-[60%] truncate font-mono text-[11px]",style:{color:"var(--pc-text-primary)"},title:typeof i.value=="string"?i.value:void 0,children:i.value})]},c))]})}const w6={danger:{btn:"var(--color-status-error)",icon:"#ff3b30"},warning:{btn:"#ff9f0a",icon:"#ff9f0a"},normal:{btn:"var(--pc-accent)",icon:"var(--pc-accent)"}},j6={btn:"var(--pc-accent)",icon:"var(--pc-accent)"};function S6({open:e,title:a,message:r,confirmLabel:i="确认",cancelLabel:c="取消",variant:d="normal",onConfirm:u,onCancel:m}){if(!e)return null;const p=w6[d]??j6;return l.jsx("div",{className:"fixed inset-0 z-[300] flex items-center justify-center bg-black/40 backdrop-blur-sm animate-fade-in",onClick:m,children:l.jsxs("div",{className:"rounded-2xl p-6 w-full max-w-sm mx-4 animate-slide-up",style:{background:"var(--pc-bg-elevated)",border:"1px solid var(--pc-border)",boxShadow:"0 8px 40px rgba(0,0,0,.16)"},onClick:h=>h.stopPropagation(),role:"dialog","aria-modal":"true",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[l.jsx(em,{className:"h-6 w-6 shrink-0",style:{color:p.icon}}),l.jsx("h3",{className:"text-base font-semibold",style:{color:"var(--pc-text-primary)"},children:a})]}),l.jsx("p",{className:"text-sm mb-6",style:{color:"var(--pc-text-muted)"},children:r}),l.jsxs("div",{className:"flex justify-end gap-3",children:[l.jsx("button",{onClick:m,className:"px-4 py-2 text-sm font-medium rounded-xl transition-colors",style:{background:"var(--pc-hover)",color:"var(--pc-text-muted)"},children:c}),l.jsx("button",{onClick:u,className:"px-4 py-2 text-sm font-medium rounded-xl text-white transition-colors",style:{background:p.btn},children:i})]})]})})}function N6({plan:e,selected:a,onClick:r}){const i=e.steps||[],c=i.filter(p=>(p.tasks||[]).every(h=>h.status==="succeeded"||h.status==="finished")).length,d=i.some(p=>(p.tasks||[]).some(h=>h.status==="failed")),u=i.length>0?Math.round(c/i.length*100):0,m=c===i.length&&i.length>0?"#30d158":d?"#ff3b30":"#ff9f0a";return l.jsxs("div",{onClick:r,className:"rounded-xl p-3 mx-1.5 mb-1.5 cursor-pointer transition-all border hover:-translate-y-0.5",style:{background:a?"var(--pc-accent-glow)":"var(--pc-bg-elevated)",borderColor:a?"var(--pc-accent)":"var(--pc-border)",boxShadow:a?"0 2px 12px rgba(0,0,0,.06)":void 0},children:[l.jsx("div",{className:"text-[13px] font-semibold truncate",style:{color:"var(--pc-text-primary)"},children:e.title||e.plan_id||"未命名计划"}),l.jsxs("div",{className:"flex items-center gap-2 mt-1.5",children:[l.jsx(Wr,{status:e.status||"draft",size:"sm"}),l.jsxs("span",{className:"text-[10px]",style:{color:"var(--pc-text-faint)"},children:[c,"/",i.length," 步"]})]}),i.length>0&&l.jsx("div",{className:"h-1 mt-2 rounded-full overflow-hidden",style:{background:"var(--pc-border)"},children:l.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${u}%`,background:m}})})]})}const Yb={queued:"#ff9f0a",running:"var(--pc-accent)",succeeded:"#30d158",finished:"#30d158",failed:"#ff3b30",paused:"#ff9f0a",leased:"#ff9f0a",ready:"var(--pc-text-faint)"},C6={queued:"排队",running:"运行中",succeeded:"成功",finished:"完成",failed:"失败",paused:"已暂停",leased:"已租用",ready:"就绪"},E6={running:[{label:"暂停",action:"pause_task"},{label:"取消",action:"cancel_task"}],queued:[{label:"取消",action:"cancel_task"}],leased:[{label:"取消",action:"cancel_task"}],paused:[{label:"恢复",action:"resume_task"},{label:"取消",action:"cancel_task"}],failed:[{label:"重试",action:"retry_task"},{label:"取消",action:"cancel_task"}]};function T6({task:e,selected:a,onClick:r,onAction:i}){const c=e.status||"ready";return l.jsxs("div",{onClick:r,className:"flex items-center gap-2.5 py-2 pl-11 pr-3 text-[11px] cursor-pointer transition-colors border-b",style:{background:a?"var(--pc-accent-glow)":"transparent",borderColor:"var(--pc-border)"},children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full shrink-0",style:{background:Yb[c]||"var(--pc-text-faint)"}}),l.jsx("span",{className:"font-mono text-[10px] truncate flex-1",style:{color:"var(--pc-text-faint)"},children:e.task_id}),l.jsx("span",{className:"text-[10px] font-medium",style:{color:Yb[c]||"var(--pc-text-faint)"},children:C6[c]||c}),l.jsx("div",{className:"flex gap-1",children:(E6[c]||[]).map(d=>l.jsx("button",{onClick:u=>{u.stopPropagation(),i==null||i(e.task_id,d.action)},className:"text-[9px] px-2 py-0.5 rounded-lg font-medium transition-colors hover:bg-[var(--pc-accent)] hover:text-white",style:{background:"var(--pc-hover)",color:"var(--pc-text-muted)"},children:d.label},d.action))})]})}function A6({step:e,selectedTaskId:a,onSelectTask:r,onTaskAction:i}){const c=e.tasks||[],d=c.length>0&&c.every(x=>x.status==="succeeded"||x.status==="finished"),u=c.some(x=>x.status==="failed"),m=c.some(x=>x.status==="running"),p=c.some(x=>x.status==="queued"),h=d?"#30d158":u?"#ff3b30":m||p?"var(--pc-accent)":"transparent",y=d?"#30d158":u?"#ff3b30":m||p?"var(--pc-accent)":"var(--pc-text-faint)";return l.jsxs("div",{className:"mb-2.5",children:[l.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border transition-all",style:{borderLeft:`3px solid ${h}`,background:"var(--pc-bg-elevated)",borderColor:"var(--pc-border)"},children:[l.jsx("span",{className:"h-2.5 w-2.5 rounded-full shrink-0",style:{background:y,...m?{animation:"pulse 2s infinite"}:{}}}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-[13px] font-semibold truncate",style:{color:"var(--pc-text-primary)"},children:e.title||e.step_id}),l.jsxs("div",{className:"flex items-center gap-2 mt-1 flex-wrap",children:[(e.preferred_skills||[]).map(x=>l.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded font-medium",style:{background:"rgba(175,82,222,.1)",color:"#af52de"},children:x},x)),(e.depends_on||[]).length>0&&l.jsxs("span",{className:"text-[9px] px-1.5 py-0.5 rounded font-medium",style:{background:"rgba(255,159,10,.1)",color:"#ff9f0a"},children:["依赖: ",e.depends_on.join(", ")]})]})]})]}),c.map(x=>l.jsx(T6,{task:x,selected:a===x.task_id,onClick:()=>r(x.task_id),onAction:i},x.task_id))]})}function D6({open:e,onClose:a,onCreate:r,loading:i}){const[c,d]=b.useState(""),[u,m]=b.useState(""),[p,h]=b.useState([{title:"",skill:"agent"}]);if(!e)return null;function y(){h([...p,{title:"",skill:"agent"}])}function x(w){p.length<=1||h(p.filter((T,j)=>j!==w))}function v(w,T,j){const C=[...p],$=C[w];$&&(C[w]={...$,[T]:j},h(C))}function k(){c.trim()&&(r(c.trim(),u.trim(),p.filter(w=>w.title.trim())),d(""),m(""),h([{title:"",skill:"agent"}]))}return l.jsx("div",{className:"fixed inset-0 z-[300] flex items-center justify-center bg-black/40 backdrop-blur-sm animate-fade-in",onClick:a,children:l.jsxs("div",{className:"rounded-2xl p-6 w-full max-w-xl mx-4 max-h-[80vh] overflow-y-auto animate-slide-up",style:{background:"var(--pc-bg-elevated)",border:"1px solid var(--pc-border)",boxShadow:"0 8px 40px rgba(0,0,0,.16)"},onClick:w=>w.stopPropagation(),role:"dialog","aria-modal":"true",children:[l.jsx("h2",{className:"text-lg font-bold mb-5",style:{color:"var(--pc-text-primary)"},children:"新建计划"}),l.jsx("label",{className:"block text-[11px] font-semibold mb-1.5 mt-3 uppercase tracking-wider",style:{color:"var(--pc-text-faint)"},children:"计划名称"}),l.jsx("input",{className:"input-electric w-full px-3 py-2 text-sm",placeholder:"例如:化工厂每日检修管控",value:c,onChange:w=>d(w.target.value),autoFocus:!0}),l.jsx("label",{className:"block text-[11px] font-semibold mb-1.5 mt-3 uppercase tracking-wider",style:{color:"var(--pc-text-faint)"},children:"描述"}),l.jsx("textarea",{className:"input-electric w-full px-3 py-2 text-sm resize-y",placeholder:"描述此计划的目标...",value:u,onChange:w=>m(w.target.value),rows:2}),l.jsx("label",{className:"block text-[11px] font-semibold mb-1.5 mt-3 uppercase tracking-wider",style:{color:"var(--pc-text-faint)"},children:"步骤"}),l.jsx("div",{className:"space-y-2",children:p.map((w,T)=>l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("input",{className:"input-electric flex-[2] px-3 py-2 text-sm",placeholder:"步骤名称",value:w.title,onChange:j=>v(T,"title",j.target.value)}),l.jsx("input",{className:"input-electric flex-1 px-3 py-2 text-sm",placeholder:"技能",value:w.skill,onChange:j=>v(T,"skill",j.target.value)}),l.jsx("button",{onClick:()=>x(T),className:"p-1.5 rounded-lg transition-colors hover:bg-[var(--pc-hover)]",style:{color:"var(--pc-text-muted)"},title:"移除步骤",children:l.jsx(Ha,{className:"h-4 w-4"})})]},T))}),l.jsxs("button",{onClick:y,className:"mt-2 flex items-center gap-1 text-[11px] font-medium px-3 py-1.5 rounded-lg transition-colors",style:{color:"var(--pc-accent)",background:"var(--pc-accent-glow)"},children:[l.jsx(Bi,{className:"h-3 w-3"})," 添加步骤"]}),l.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[l.jsx("button",{onClick:a,className:"px-4 py-2 text-sm font-medium rounded-xl transition-colors",style:{background:"var(--pc-hover)",color:"var(--pc-text-muted)"},children:"取消"}),l.jsx("button",{onClick:k,disabled:!c.trim()||i,className:"px-4 py-2 text-sm font-medium rounded-xl text-white transition-colors disabled:opacity-50",style:{background:"var(--pc-accent)"},children:i?"创建中...":"创建并激活"})]})]})})}const M6=[{id:"all",label:"全部"},{id:"governance",label:"待治理"},{id:"active",label:"活跃计划"}],z6=[{id:"all",label:"全部"},{id:"active",label:"执行中"},{id:"draft",label:"草稿"},{id:"reviewing",label:"审核中"},{id:"approved",label:"已批准"},{id:"blocked",label:"已阻塞"},{id:"completed",label:"已完成"},{id:"failed",label:"失败"},{id:"cancelled",label:"已取消"}],R6={draft:[{label:"提交审核",commandKind:"submit_plan",variant:"var(--pc-accent)",icon:n1},{label:"取消计划",commandKind:"cancel_plan",variant:"var(--pc-text-muted)",icon:yi},{label:"提议变更",commandKind:"amend_plan",variant:"#5ac8fa",icon:fi}],reviewing:[{label:"批准",commandKind:"approve_plan",variant:"#30d158",icon:Jv},{label:"驳回",commandKind:"reject_plan",variant:"#ff9500",icon:al},{label:"提议变更",commandKind:"amend_plan",variant:"#5ac8fa",icon:fi}],approved:[{label:"激活执行",commandKind:"activate_plan",variant:"var(--pc-accent)",icon:ds},{label:"取消计划",commandKind:"cancel_plan",variant:"var(--pc-text-muted)",icon:yi},{label:"提议变更",commandKind:"amend_plan",variant:"#5ac8fa",icon:fi}],active:[{label:"暂停计划",commandKind:"pause_plan",variant:"#ff9500",icon:Wp},{label:"提议变更",commandKind:"amend_plan",variant:"#5ac8fa",icon:fi},{label:"取消计划",commandKind:"cancel_plan",variant:"var(--pc-text-muted)",icon:yi}],blocked:[{label:"恢复计划",commandKind:"resume_plan",variant:"var(--pc-accent)",icon:up},{label:"取消计划",commandKind:"cancel_plan",variant:"var(--pc-text-muted)",icon:yi},{label:"提议变更",commandKind:"amend_plan",variant:"#5ac8fa",icon:fi}],completed:[{label:"查看审计",commandKind:"view_audit",localOnly:!0,variant:"var(--pc-text-muted)",icon:wf}],failed:[{label:"查看审计",commandKind:"view_audit",localOnly:!0,variant:"var(--pc-text-muted)",icon:wf},{label:"提议重开",commandKind:"amend_plan",variant:"#ff9500",icon:up}],cancelled:[{label:"查看审计",commandKind:"view_audit",localOnly:!0,variant:"var(--pc-text-muted)",icon:wf}]};function Vl(e){return(e||"").slice(0,19)}function Vf(e){return(e||"").replace(/^.*T/,"").replace(/\.\d+Z?$/,"").slice(0,8)}function Gb(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function O6(e){return e==="amend_plan"?{source:"plans-page",summary:"前端发起计划变更提议"}:{source:"plans-page"}}function L6(e,a){const r=Date.now();return{command_kind:a,context_refs:{plan_id:e},payload:O6(a),idempotency_key:`ui-${a}-${e}-${r}`,correlation_id:`ui-${a}-${r}`}}const $6=new Set(["event_id","kind","occurred_at","message"]);function Ap(e){if(Gb(e.data))return e.data;if(Gb(e.payload))return e.payload;const a=Object.entries(e).filter(([r,i])=>!$6.has(r)&&i!==void 0&&i!==null);return a.length>0?Object.fromEntries(a):null}function B6(e){const a=Ap(e),r=[e.kind,e.event_type,a==null?void 0:a.event_type,a==null?void 0:a.command_kind].filter(Boolean).join(" ").toLowerCase();return r.includes("planamendmentproposed")||r.includes("amend")||r.includes("revision")}function La(e){return e==null||e===""?"—":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):JSON.stringify(e)}function U6(){const[e,a]=b.useState([]),[r,i]=b.useState([]),[c,d]=b.useState([]),[u,m]=b.useState(!0),[p,h]=b.useState(null),[y,x]=b.useState(""),[v,k]=b.useState("all"),[w,T]=b.useState("all"),[j,C]=b.useState(null),[$,M]=b.useState(null),[ee,ne]=b.useState(null),[A,G]=b.useState(null),[V,oe]=b.useState(!1),[Y,F]=b.useState(!1),[I,Q]=b.useState(null),le=b.useRef(null),B=b.useCallback(async()=>{try{a(await pp()),h(null)}catch(D){h(`计划列表加载失败:${D instanceof Error?D.message:"未知错误"}`)}finally{m(!1)}p1().then(D=>{i(D.tasks||[]),d(D.runs||[])}).catch(()=>{i([]),d([])})},[]);b.useEffect(()=>(B(),le.current=setInterval(B,1e4),()=>{le.current&&clearInterval(le.current)}),[B]);const L=b.useCallback(async D=>{C(D),M(null);try{ne(await zc(D))}catch{ne(null)}try{G(await $y(D))}catch{G(null)}try{a(await pp())}catch{}},[]),q=b.useCallback(D=>{M(U=>U===D?null:D)},[]),ce=async(D,U)=>{try{if(U.localOnly){Q(null),ne(await zc(D));try{G(await $y(D))}catch{G(null)}return}const be=await ma(L6(D,U.commandKind));if(!be.accepted)throw new Error(`command 未被接受:${be.command_id||U.commandKind}`);Q(null),await B(),j===D&&await L(D)}catch(be){h(be instanceof Error?be.message:"操作失败")}},ge=async(D,U)=>{try{const be=await ma({command_kind:U,context_refs:{task_id:D,...j?{plan_id:j}:{}},payload:{source:"plans-page-task-row"},idempotency_key:`ui-${U}-${D}-${Date.now()}`,correlation_id:`ui-${U}-${Date.now()}`});if(!be.accepted)throw new Error(`command 未被接受:${be.command_id||U}`);await B(),j&&await L(j)}catch(be){h(be instanceof Error?be.message:"操作失败")}},N=async(D,U,be)=>{var Ne;F(!0);try{const $e=Date.now(),Ce=await ma({command_kind:"create_plan",context_refs:{session_id:"plans-create"},payload:{source:"plans-page-create-modal",title:D,description:U,steps:be.map(Be=>({title:Be.title,description:"",skills:Be.skill?Be.skill.split(",").map(Ve=>Ve.trim()).filter(Boolean):[],depends_on:[]}))},idempotency_key:`ui-create-plan-${$e}`,correlation_id:`ui-create-plan-${$e}`});if(!Ce.accepted)throw new Error(`command 未被接受:${Ce.command_id||"create_plan"}`);const nt=typeof((Ne=Ce.result)==null?void 0:Ne.plan_id)=="string"?Ce.result.plan_id:null;oe(!1),await B(),nt&&setTimeout(()=>L(nt),500)}catch($e){h($e instanceof Error?$e.message:"创建失败")}finally{F(!1)}},z=e.filter(D=>{const U=y.toLowerCase();return U&&!(D.plan_id||"").toLowerCase().includes(U)&&!(D.title||"").toLowerCase().includes(U)||w!=="all"&&(D.status||"draft").toLowerCase()!==w?!1:v==="governance"?["draft","reviewing","approved"].includes((D.status||"").toLowerCase()):v==="active"?["active","blocked"].includes((D.status||"").toLowerCase()):!0}),K=e.find(D=>D.plan_id===j),E=r.find(D=>D.task_id===$),pe=c.filter(D=>D.task_id===$).sort((D,U)=>(U.created_at||"").localeCompare(D.created_at||"")),ke=((ee==null?void 0:ee.events)||[]).map(D=>D).filter(B6),ve=(A==null?void 0:A.revisions)||[],ze=ve.length>0||ke.some(D=>Ap(D)!==null);if(u)return l.jsx(il,{message:"加载计划..."});const me=(D,U)=>({[D]:U});return l.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[l.jsx(sl,{title:"计划编排",subtitle:`${z.length}/${e.length} 个计划`,icon:Jp,actions:l.jsxs(l.Fragment,{children:[l.jsx("button",{onClick:B,className:"p-2 rounded-lg transition-colors hover:bg-[var(--pc-hover)]",style:me("color","var(--pc-text-muted)"),title:"刷新",children:l.jsx(Ba,{className:"h-4 w-4"})}),l.jsxs("button",{onClick:()=>oe(!0),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-medium text-white transition-colors",style:me("background","var(--pc-accent)"),children:[l.jsx(Bi,{className:"h-3.5 w-3.5"})," 新建计划"]})]})}),p?l.jsx(jr,{message:p,onDismiss:()=>h(null)}):null,l.jsxs("div",{className:"px-4 py-2 flex items-center gap-2 border-b",style:me("borderColor","var(--pc-border)"),children:[l.jsx(Uc,{items:M6,selected:v,onChange:D=>k(D)}),l.jsx("div",{className:"w-px h-4 mx-1",style:me("background","var(--pc-border)")}),l.jsx(Uc,{items:z6,selected:w,onChange:T}),l.jsx("div",{className:"flex-1"}),l.jsx("input",{className:"input-electric w-48 px-3 py-1.5 text-xs",placeholder:"搜索...",value:y,onChange:D=>x(D.target.value)})]}),l.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[l.jsx("div",{className:"w-64 shrink-0 flex flex-col border-r overflow-hidden",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg-elevated)"},children:l.jsx("div",{className:"flex-1 overflow-y-auto py-2",children:z.length===0?l.jsx(ra,{message:y?"无匹配计划":"暂无计划"}):z.map(D=>l.jsx(N6,{plan:D,selected:j===D.plan_id,onClick:()=>L(D.plan_id)},D.plan_id))})}),l.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",style:me("background","var(--pc-bg-base)"),children:K?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center gap-3 px-5 py-3 border-b shrink-0",style:{background:"var(--pc-bg-elevated)",borderColor:"var(--pc-border)"},children:[l.jsx("h3",{className:"text-base font-bold truncate flex-1",style:me("color","var(--pc-text-primary)"),children:K.title||K.plan_id}),l.jsx(Wr,{status:K.status||"draft",size:"md"}),l.jsxs("span",{className:"text-[11px]",style:me("color","var(--pc-text-faint)"),children:[(K.steps||[]).length," 步骤"]}),l.jsx("div",{className:"w-px h-5 mx-1",style:me("background","var(--pc-border)")}),(R6[(K.status||"draft").toLowerCase()]||[]).map(D=>{const U=D.icon;return l.jsxs("button",{onClick:()=>{D.localOnly?ce(K.plan_id,D):Q({id:K.plan_id,action:D})},className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-[11px] font-medium text-white transition-colors",style:me("background",D.variant),title:D.commandKind,children:[l.jsx(U,{className:"h-3.5 w-3.5"}),D.label]},D.commandKind)})]}),K.objective?l.jsx("div",{className:"px-5 py-3 text-xs border-b",style:{color:"var(--pc-text-muted)",borderColor:"var(--pc-border)",background:"var(--pc-bg-elevated)"},children:K.objective}):null,l.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[l.jsxs("div",{className:"mb-4 p-4 rounded-xl border",style:{background:"var(--pc-bg-elevated)",borderColor:"var(--pc-border)"},children:[l.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[l.jsx(Cj,{className:"h-4 w-4",style:me("color","var(--pc-accent)")}),l.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider flex-1",style:me("color","var(--pc-text-faint)"),children:"计划修订 / 变更"}),l.jsx("span",{className:"text-[10px] px-2 py-0.5 rounded-full border",style:{color:ze?"#30d158":"var(--pc-text-muted)",borderColor:ze?"rgba(48, 209, 88, 0.28)":"var(--pc-border)",background:ze?"rgba(48, 209, 88, 0.08)":"transparent"},children:ve.length>0?"PlanRevision projection":ze?"事件修订数据":"暂无修订数据"})]}),ve.length>0?l.jsx("div",{className:"space-y-2",children:ve.map(D=>l.jsxs("div",{className:"rounded-lg border p-3 text-[11px]",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg-base)"},children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"font-mono font-semibold",style:me("color",D.revision_id===(A==null?void 0:A.current_revision_id)?"var(--pc-accent)":"var(--pc-text-secondary)"),children:D.revision_id}),l.jsx("span",{className:"ml-auto",style:me("color","var(--pc-text-faint)"),children:Vf(D.created_at)})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-2 mt-2",children:[l.jsxs("div",{children:[l.jsx("span",{style:me("color","var(--pc-text-faint)"),children:"父版本"}),l.jsx("span",{className:"ml-1 font-mono",style:me("color","var(--pc-text-secondary)"),children:La(D.parent_revision_id)})]}),l.jsxs("div",{children:[l.jsx("span",{style:me("color","var(--pc-text-faint)"),children:"状态"}),l.jsx("span",{className:"ml-1",style:me("color","var(--pc-text-secondary)"),children:La(D.status)})]}),l.jsxs("div",{children:[l.jsx("span",{style:me("color","var(--pc-text-faint)"),children:"步骤数"}),l.jsx("span",{className:"ml-1",style:me("color","var(--pc-text-secondary)"),children:La(D.step_count)})]}),l.jsxs("div",{children:[l.jsx("span",{style:me("color","var(--pc-text-faint)"),children:"作者"}),l.jsx("span",{className:"ml-1",style:me("color","var(--pc-text-secondary)"),children:La(D.author)})]}),l.jsxs("div",{className:"col-span-2",children:[l.jsx("span",{style:me("color","var(--pc-text-faint)"),children:"摘要"}),l.jsx("span",{className:"ml-1",style:me("color","var(--pc-text-secondary)"),children:La(D.change_summary)})]})]})]},D.revision_id))}):ke.length===0?l.jsx("div",{className:"text-xs leading-relaxed",style:me("color","var(--pc-text-muted)"),children:"当前 PlanRevision projection 和事件流均未包含修订记录。"}):l.jsx("div",{className:"space-y-2",children:ke.map(D=>{const U=Ap(D);return l.jsxs("div",{className:"rounded-lg border p-3 text-[11px]",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg-base)"},children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"font-semibold",style:me("color","var(--pc-accent)"),children:D.kind}),l.jsx("span",{className:"font-mono ml-auto",style:me("color","var(--pc-text-faint)"),children:Vf(D.occurred_at)})]}),D.message?l.jsx("div",{className:"mt-1 leading-relaxed",style:me("color","var(--pc-text-muted)"),children:D.message}):null,U?l.jsxs("div",{className:"grid grid-cols-2 gap-2 mt-2",children:[l.jsxs("div",{children:[l.jsx("span",{style:me("color","var(--pc-text-faint)"),children:"当前版本"}),l.jsx("span",{className:"ml-1 font-mono",style:me("color","var(--pc-text-secondary)"),children:La(U.current_revision??U.revision_id)})]}),l.jsxs("div",{children:[l.jsx("span",{style:me("color","var(--pc-text-faint)"),children:"父版本"}),l.jsx("span",{className:"ml-1 font-mono",style:me("color","var(--pc-text-secondary)"),children:La(U.parent_revision??U.parent_revision_id)})]}),l.jsxs("div",{className:"col-span-2",children:[l.jsx("span",{style:me("color","var(--pc-text-faint)"),children:"摘要"}),l.jsx("span",{className:"ml-1",style:me("color","var(--pc-text-secondary)"),children:La(U.change_summary??U.summary)})]}),l.jsxs("div",{className:"col-span-2",children:[l.jsx("span",{style:me("color","var(--pc-text-faint)"),children:"状态"}),l.jsx("span",{className:"ml-1",style:me("color","var(--pc-text-secondary)"),children:La(U.approval_status??U.status)})]})]}):l.jsx("div",{className:"mt-2 text-[11px]",style:me("color","var(--pc-text-muted)"),children:"已识别修订事件,但后端尚未暴露修订数据。"})]},D.event_id)})})]}),(K.steps||[]).length===0?l.jsx(ra,{message:"无步骤"}):(K.steps||[]).map(D=>l.jsx(A6,{step:D,selectedTaskId:$,onSelectTask:q,onTaskAction:ge},D.step_id)),ee!=null&&ee.events&&ee.events.length>0?l.jsxs("div",{className:"mt-4 p-4 rounded-xl border",style:{background:"var(--pc-bg-elevated)",borderColor:"var(--pc-border)"},children:[l.jsxs("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-3",style:me("color","var(--pc-text-faint)"),children:["事件记录 (",ee.events.length,")"]}),ee.events.map((D,U)=>l.jsxs("div",{className:"flex gap-2 py-1 text-[11px] border-b last:border-0",style:me("borderColor","var(--pc-border)"),children:[l.jsx("span",{className:"font-semibold shrink-0 w-[72px]",style:me("color","var(--pc-accent)"),children:D.kind}),l.jsx("span",{className:"flex-1 truncate",style:me("color","var(--pc-text-muted)"),children:D.message||""}),l.jsx("span",{className:"font-mono text-[9px] shrink-0",style:me("color","var(--pc-text-faint)"),children:Vf(D.occurred_at)})]},U))]}):null]})]}):l.jsx("div",{className:"flex-1 flex items-center justify-center",children:l.jsx(ra,{message:"选择左侧计划查看步骤与任务"})})}),$&&E?l.jsxs("div",{className:"w-80 shrink-0 flex flex-col border-l overflow-hidden",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg-elevated)"},children:[l.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b shrink-0",style:me("borderColor","var(--pc-border)"),children:[l.jsx("button",{onClick:()=>M(null),className:"text-xs font-medium hover:underline",style:me("color","var(--pc-accent)"),children:"← 返回计划"}),l.jsx("span",{className:"text-xs truncate flex-1 text-right",style:me("color","var(--pc-text-faint)"),children:E.task_id})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[l.jsx(Qr,{title:"基本信息",rows:[{label:"任务 ID",value:E.task_id},{label:"状态",value:l.jsx(Wr,{status:E.status,size:"sm"})},{label:"标题",value:E.title||"—"},{label:"技能",value:E.assigned_skill_id||"未分配"},{label:"步骤",value:E.step_id||"—"}]}),l.jsx(Qr,{title:"时间",rows:[{label:"创建",value:Vl(E.created_at)},{label:"更新",value:Vl(E.updated_at)},{label:"开始",value:Vl(E.started_at)||"—"},{label:"完成",value:Vl(E.finished_at)||"—"}]}),E.description?l.jsxs("div",{className:"surface-panel p-3 rounded-xl border text-xs",children:[l.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-1",style:me("color","var(--pc-text-faint)"),children:"指令 / 描述"}),l.jsx("div",{className:"whitespace-pre-wrap leading-relaxed",style:me("color","var(--pc-text-primary)"),children:E.description})]}):null,pe.length>0?l.jsxs("div",{className:"surface-panel p-3 rounded-xl border",children:[l.jsxs("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-2",style:me("color","var(--pc-text-faint)"),children:["执行记录 (",pe.length," 次)"]}),pe.map(D=>{const U=D.lifecycle==="Succeeded",be=D.lifecycle==="Failed",Ne=U?"#30d158":be?"#ff3b30":"var(--pc-accent)";return l.jsxs("div",{className:"p-2.5 mb-1.5 rounded-lg border-l-2 last:mb-0 text-[11px]",style:{borderColor:Ne,background:"var(--pc-bg-elevated)"},children:[l.jsxs("div",{className:"flex gap-2 items-center",children:[l.jsxs("span",{className:"font-bold",style:me("color",Ne),children:["#",D.attempt_no||"?"," ",D.lifecycle]}),l.jsx("span",{className:"font-mono text-[10px] ml-auto",style:me("color","var(--pc-text-faint)"),children:D.run_id})]}),l.jsxs("div",{className:"mt-0.5 font-mono text-[10px]",style:me("color","var(--pc-text-faint)"),children:[Vl(D.created_at),D.completed_at?` → ${Vl(D.completed_at)}`:""]})]},D.run_id)})]}):null]})]}):null]}),l.jsx(D6,{open:V,onClose:()=>oe(!1),onCreate:N,loading:Y}),l.jsx(S6,{open:!!I,title:`确认 ${(I==null?void 0:I.action.label)||""}`,message:`确定要对计划执行「${(I==null?void 0:I.action.label)||""}」操作吗?`,variant:(I==null?void 0:I.action.commandKind)==="cancel_plan"||(I==null?void 0:I.action.commandKind)==="reject_plan"?"warning":"normal",confirmLabel:(I==null?void 0:I.action.label)||"确认",onConfirm:()=>I&&ce(I.id,I.action),onCancel:()=>Q(null)})]})}const H6={任务系统:"var(--pc-accent)",执行器:"#30d158",计划引擎:"#af52de",定时调度:"#ff9f0a"};function B0({logs:e}){return e.length===0?l.jsx("p",{className:"text-xs py-4 text-center",style:{color:"var(--pc-text-faint)"},children:"暂无日志"}):l.jsx("div",{className:"space-y-0",children:e.map((a,r)=>{const i=H6[a.source]||"var(--pc-text-faint)";return l.jsxs("div",{children:[l.jsxs("div",{className:"flex gap-2.5 py-1.5 text-[11px] items-start border-b",style:{borderColor:"var(--pc-border)"},children:[l.jsx("span",{className:"font-semibold shrink-0 w-[56px] text-[10px]",style:{color:i},children:a.source}),l.jsx("span",{className:"font-medium shrink-0 w-[80px]",style:{color:"var(--pc-text-muted)"},children:a.kind}),l.jsx("span",{className:"flex-1 truncate",style:{color:"var(--pc-text-primary)"},children:a.msg}),l.jsx("span",{className:"font-mono text-[9px] shrink-0",style:{color:"var(--pc-text-faint)"},children:(a.time||"").slice(0,19)})]}),a.detail&&l.jsx("div",{className:"ml-[66px] text-[10px] py-0.5 font-mono",style:{color:"var(--pc-text-faint)"},children:a.detail})]},r)})})}const q6=[{id:"all",label:"全部"},{id:"queued",label:"排队"},{id:"running",label:"运行中"},{id:"succeeded",label:"成功"},{id:"failed",label:"失败"},{id:"paused",label:"已暂停"}],F6={direct_run:"DirectRun / 无计划任务",DirectRun:"DirectRun / 无计划任务",plan_execution:"PlanExecution / 计划任务",PlanExecution:"PlanExecution / 计划任务",scheduler:"定时调度 / Scheduler",cron:"定时调度 / Cron",manual:"人工触发"};function Dp(e){return typeof e.plan_id=="string"&&e.plan_id.trim().length>0}function Kf(e){return(typeof e.plan_id=="string"?e.plan_id.trim():"")||"DirectRun / 无计划任务"}function I6(e){return(e||"").slice(0,19)||"—"}function br(e){if(e==null||e==="")return"—";if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function vr(e,a){for(const r of a){const i=e[r];if(i!=null&&i!=="")return i}return null}function Y6(e){if(!Dp(e))return"DirectRun / 无计划任务";const a=vr(e,["route_kind","trigger_source","source"]);if(a==null||a==="")return"PlanExecution / 计划任务";const r=br(a);return F6[r]||r||"PlanExecution / 计划任务"}function G6(e){return e.find(a=>!a.completed_at&&!["Succeeded","Failed","Cancelled","Canceled"].includes(a.lifecycle))}function V6(e,a){const r=(e.status||"").toLowerCase(),i=G6(a),c=[];return["failed","cancelled","canceled"].includes(r)&&c.push({commandKind:"retry_task",label:"retry_task 重试任务",description:"重新排队,执行器接管后会创建新的 run attempt。",icon:up}),["queued","ready","leased","running","paused","failed","blocked"].includes(r)&&c.push({commandKind:"skip_task",label:"skip_task 跳过任务",description:"通过治理命令跳过当前任务;后端未接入时会显示失败。",icon:Kj,tone:"warning"}),["running","leased"].includes(r)&&c.push({commandKind:"pause_task",label:"pause_task 暂停任务",description:"暂停任务调度状态,不等同于取消 run。",icon:Wp,tone:"warning"}),r==="paused"&&c.push({commandKind:"resume_task",label:"resume_task 恢复任务",description:"恢复为等待执行器接管的队列状态。",icon:ds}),["queued","ready","leased","running","paused","failed","blocked"].includes(r)&&c.push({commandKind:"cancel_task",label:"cancel_task 取消任务",description:"取消任务本身,后续不应再产生新的执行尝试。",icon:yi,tone:"danger"}),i&&c.push({commandKind:"cancel_run",label:"cancel_run 取消本次执行",description:"只取消当前 run attempt;后端未接入时会显示失败。",icon:al,runId:i.run_id,tone:"danger"}),c}function K6(){const[e,a]=b.useState([]),[r,i]=b.useState([]),[c,d]=b.useState(!0),[u,m]=b.useState(null),[p,h]=b.useState(null),[y,x]=b.useState(null),[v,k]=b.useState("all"),[w,T]=b.useState(null),j=b.useRef(null),C=b.useCallback(async()=>{try{const V=await p1();a(V.tasks||[]),i(V.runs||[]),m(null)}catch(V){a([]),i([]),m(V instanceof Error?V.message:"任务数据加载失败")}finally{d(!1)}},[]);b.useEffect(()=>(C(),j.current=setInterval(C,1e4),()=>{j.current&&clearInterval(j.current)}),[C]);const $=v==="all"?e:e.filter(V=>V.status===v),M=e.find(V=>V.task_id===w),ee=r.filter(V=>V.task_id===w).sort((V,oe)=>(oe.created_at||"").localeCompare(V.created_at||"")),ne=M?V6(M,ee):[],A=b.useCallback(async(V,oe)=>{const Y=`${oe.commandKind}:${oe.runId||V.task_id}`;x(Y),h(null);try{const F=await ma({command_kind:oe.commandKind,context_refs:{task_id:V.task_id,...Dp(V)?{plan_id:V.plan_id}:{},...oe.runId?{run_id:oe.runId}:{}},payload:{source:"execution_monitor",requested_action:oe.commandKind},correlation_id:br(vr(V,["correlation_id","correlation"]))!=="—"?br(vr(V,["correlation_id","correlation"])):`ui-${V.task_id}-${Date.now()}`,idempotency_key:`ui-${oe.commandKind}-${oe.runId||V.task_id}-${Date.now()}`});if(!F.accepted)throw new Error(`command 未被接受:${F.command_id||oe.commandKind}`);await C()}catch(F){h(`${oe.commandKind} 执行失败:${F instanceof Error?F.message:"未知错误"}`)}finally{x(null)}},[C]),G=b.useCallback(()=>{if(!M)return[];const V=[];return V.push({time:M.created_at||"",source:"任务系统",kind:"创建",msg:"任务已创建",detail:`标题=${M.title||"-"}`}),M.updated_at&&V.push({time:M.updated_at,source:"任务系统",kind:"状态",msg:`任务状态 ${M.status}`,detail:`计划=${Kf(M)} 技能=${M.assigned_skill_id||"-"}`}),ee.length===0&&V.push({time:M.updated_at||M.created_at||"",source:"执行器",kind:"等待",msg:"等待执行器接管",detail:"当前任务尚未创建 run,这不是异常状态。"}),ee.forEach(oe=>{V.push({time:oe.created_at||"",source:"执行器",kind:`Run ${oe.lifecycle}`,msg:`第 ${oe.attempt_no||"?"} 次执行 ${oe.lifecycle}`,detail:`run_id=${oe.run_id}`}),oe.completed_at&&V.push({time:oe.completed_at,source:"执行器",kind:"Run 完成",msg:`第 ${oe.attempt_no||"?"} 次执行完成`,detail:`lifecycle=${oe.lifecycle}`})}),V.sort((oe,Y)=>(Y.time||"").localeCompare(oe.time||"")),V},[M,ee]);return c?l.jsx(il,{message:"加载任务..."}):l.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[l.jsx(sl,{title:"执行监控",subtitle:`${$.length} 个任务`,icon:ds,actions:l.jsx("button",{onClick:C,className:"p-2 rounded-lg transition-colors hover:bg-[var(--pc-hover)]",style:{color:"var(--pc-text-muted)"},title:"刷新",children:l.jsx(Ba,{className:"h-4 w-4"})})}),u&&l.jsxs("div",{className:"mx-4 mt-4",children:[l.jsx(jr,{message:`执行数据暂不可用:${u}`,onDismiss:()=>m(null)}),l.jsxs(Gp,{to:"/logs",className:"mt-2 inline-flex items-center gap-2 rounded-md border px-3 py-2 text-xs transition-colors hover:bg-[var(--pc-hover)]",style:{borderColor:"var(--pc-border)",color:"var(--pc-text-secondary)"},children:[l.jsx(Ej,{className:"h-3.5 w-3.5"}),"查看运行日志"]})]}),l.jsx("div",{className:"px-4 py-2 flex items-center gap-2 border-b",style:{borderColor:"var(--pc-border)"},children:l.jsx(Uc,{items:q6,selected:v,onChange:k})}),l.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[l.jsx("div",{className:"w-72 shrink-0 flex flex-col border-r overflow-hidden",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg-elevated)"},children:l.jsx("div",{className:"flex-1 overflow-y-auto py-2",children:$.length===0?l.jsx(ra,{message:u?"执行数据加载失败,无法显示任务列表":"暂无匹配任务"}):$.map(V=>l.jsxs("div",{onClick:()=>T(V.task_id===w?null:V.task_id),className:"rounded-xl p-3 mx-1.5 mb-1.5 cursor-pointer transition-all border hover:-translate-y-0.5",style:{background:w===V.task_id?"var(--pc-accent-glow)":"var(--pc-bg-elevated)",borderColor:w===V.task_id?"var(--pc-accent)":"var(--pc-border)"},children:[l.jsx("div",{className:"text-[13px] font-semibold truncate",style:{color:"var(--pc-text-primary)"},children:V.title||V.task_id}),l.jsxs("div",{className:"flex items-center gap-2 mt-1.5",children:[l.jsx(Wr,{status:V.status||"ready",size:"sm"}),l.jsx("span",{className:"text-[9px] truncate",style:{color:Dp(V)?"var(--pc-text-faint)":"var(--pc-accent)"},children:Kf(V)})]})]},V.task_id))})}),l.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",style:{background:"var(--pc-bg-base)"},children:M?l.jsxs("div",{className:"flex-1 overflow-y-auto p-5 space-y-4",children:[l.jsxs("div",{className:"flex flex-wrap gap-4",children:[l.jsx(Qr,{title:"Plan → Task → Run",rows:[{label:"Plan",value:Kf(M)},{label:"Task",value:l.jsxs("span",{style:{color:M.status==="succeeded"?"#30d158":M.status==="failed"?"#ff3b30":"var(--pc-accent)"},children:[M.task_id," (",M.status,")"]})},...ee.length===0?[{label:"Run",value:l.jsx("span",{style:{color:"var(--pc-text-muted)"},children:"等待执行器接管"})}]:ee.map(V=>({label:`Run #${V.attempt_no}`,value:l.jsx("span",{style:{color:V.lifecycle==="Succeeded"?"#30d158":V.lifecycle==="Failed"?"#ff3b30":"var(--pc-accent)"},children:V.lifecycle})}))]}),l.jsx(Qr,{title:"执行摘要",rows:[{label:"来源",value:Y6(M)},{label:"技能",value:M.assigned_skill_id||"未分配"},{label:"Run 次数",value:String(ee.length)},{label:"接管状态",value:ee.length===0?"等待执行器接管":"已创建 Run"},{label:"更新时间",value:I6(M.updated_at)}]}),l.jsx(Qr,{title:"治理上下文",rows:[{label:"Correlation",value:br(vr(M,["correlation_id","correlation"]))},{label:"Command",value:br(vr(M,["created_command_id","command_id","command_kind"]))},{label:"Cron",value:br(vr(M,["cron_job_id","schedule_id","scheduler_job_id"]))},{label:"Scheduler",value:br(vr(M,["scheduler_identity","scheduler_id"]))},{label:"触发",value:br(vr(M,["trigger_source","entrypoint","source"]))}]})]}),l.jsxs("div",{className:"p-4 rounded-xl border",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg-elevated)"},children:[l.jsx("div",{className:"text-xs font-bold mb-2",style:{color:"var(--pc-text-primary)"},children:"任务操作"}),l.jsx("div",{className:"flex flex-wrap gap-2",children:ne.length===0?l.jsx("span",{className:"text-xs",style:{color:"var(--pc-text-muted)"},children:"当前状态没有可用 command 操作"}):ne.map(V=>{const oe=V.icon,Y=`${V.commandKind}:${V.runId||M.task_id}`,F=V.tone==="danger"?"#ff3b30":V.tone==="warning"?"#ff9f0a":"var(--pc-accent)";return l.jsxs("button",{onClick:()=>A(M,V),disabled:y!==null,className:"inline-flex items-center gap-1.5 rounded-full border px-3 py-1.5 text-[11px] font-medium transition-colors disabled:opacity-50",style:{borderColor:F,color:F,background:"var(--pc-bg-base)"},title:V.description,children:[l.jsx(oe,{className:"h-3.5 w-3.5"}),y===Y?"执行中...":V.label]},Y)})}),l.jsx("div",{className:"mt-2 text-[11px] leading-relaxed",style:{color:"var(--pc-text-muted)"},children:"retry_task 会重新排队,后续由执行器创建新的 run attempt;cancel_task 作用于任务,cancel_run 只作用于当前执行尝试。"}),p?l.jsx("div",{className:"mt-3",children:l.jsx(jr,{message:p,onDismiss:()=>h(null)})}):null]}),l.jsxs("div",{className:"p-4 rounded-xl border",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg-elevated)"},children:[l.jsxs("div",{className:"text-xs font-bold mb-3",style:{color:"var(--pc-text-primary)"},children:["执行日志 (",G().length," 条)"]}),l.jsx(B0,{logs:G()})]})]}):l.jsx("div",{className:"flex-1 flex items-center justify-center",children:l.jsx(ra,{message:"选择左侧任务查看详情"})})})]})]})}const Vb={ChatOnly:"仅聊天",AskClarification:"澄清",ProjectionQuery:"查询投影",PlanControl:"计划控制",DirectRun:"直接执行",PlanExecution:"计划执行",RejectedByPolicy:"策略阻断"},Kb={chat:"聊天",query:"查询",control:"控制",execute:"执行",schedule:"定时",amend:"变更",approve:"审批",recover:"恢复",reject:"拒绝",Chat:"聊天",Query:"查询",Control:"控制",Execute:"执行",Schedule:"定时",Amend:"变更",Approve:"审批",Recover:"恢复",Reject:"拒绝"};function P6(e){if(!e)return"—";const a=new Date(e);return Number.isNaN(a.getTime())?e.slice(0,19):a.toLocaleString("zh-CN",{hour12:!1})}function Kr(e){return e&&e.trim()?e:"—"}function X6(e){return!e||Object.keys(e).length===0?"—":JSON.stringify(e,null,2)}function ts({value:e,tone:a="neutral"}){const i={neutral:{bg:"rgba(142,142,147,.1)",text:"#8e8e93",border:"rgba(142,142,147,.22)"},success:{bg:"rgba(48,209,88,.1)",text:"#30d158",border:"rgba(48,209,88,.22)"},warning:{bg:"rgba(255,159,10,.1)",text:"#ff9f0a",border:"rgba(255,159,10,.22)"},danger:{bg:"rgba(255,59,48,.1)",text:"#ff3b30",border:"rgba(255,59,48,.22)"},accent:{bg:"var(--pc-accent-glow)",text:"var(--pc-accent)",border:"var(--pc-accent-dim)"}}[a];return l.jsx("span",{className:"inline-flex max-w-full items-center rounded-full border px-2 py-0.5 text-[11px] font-medium",style:{background:i.bg,color:i.text,borderColor:i.border},children:l.jsx("span",{className:"truncate",children:e})})}function Q6(e){return e==="RejectedByPolicy"?"danger":e==="AskClarification"?"warning":e==="DirectRun"||e==="PlanExecution"?"accent":e==="ChatOnly"||e==="ProjectionQuery"||e==="PlanControl"?"success":"neutral"}function Z6(e){const a=(e||"").toLowerCase();return a.includes("allow")?"success":a.includes("reject")||a.includes("deny")||a.includes("block")?"danger":a.includes("review")||a.includes("warn")?"warning":"neutral"}function Pb({value:e}){return e==null?l.jsx(ts,{value:"未知"}):l.jsx(ts,{value:e?"是":"否",tone:e?"success":"neutral"})}function Xb({values:e,emptyLabel:a="—"}){const r=(e||[]).filter(Boolean);return r.length===0?l.jsx("span",{style:{color:"var(--pc-text-faint)"},children:a}):l.jsx("div",{className:"flex max-w-[280px] flex-wrap gap-1.5",children:r.map(i=>l.jsx(ts,{value:i},i))})}function J6(){const[e,a]=b.useState([]),[r,i]=b.useState(void 0),[c,d]=b.useState(!0),[u,m]=b.useState(!1),[p,h]=b.useState(null),y=b.useCallback(async()=>{m(!0);try{const T=await xS();a(T.decisions??[]),i(T.has_route_decision_state),h(null)}catch(T){h(T instanceof Error?`分流审计接口暂不可用:${T.message}`:"分流审计接口暂不可用:未知错误"),a([]),i(!1)}finally{d(!1),m(!1)}},[]);b.useEffect(()=>{y()},[y]);const x=b.useMemo(()=>[...e].sort((T,j)=>(j.recorded_at||"").localeCompare(T.recorded_at||"")),[e]),v=x.filter(T=>T.route_kind==="PlanExecution").length,k=x.filter(T=>T.route_kind==="DirectRun").length,w=x.filter(T=>T.route_kind==="RejectedByPolicy").length;return c?l.jsx(il,{message:"加载治理审计..."}):l.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[l.jsx(sl,{title:"执行治理",subtitle:`分流审计 / RouteDecisionTimeline · ${x.length} 条记录`,icon:a1,actions:l.jsx("button",{onClick:y,disabled:u,className:"p-2 rounded-lg transition-colors hover:bg-[var(--pc-hover)] disabled:opacity-50",style:{color:"var(--pc-text-muted)"},title:"刷新",children:l.jsx(Ba,{className:`h-4 w-4 ${u?"animate-spin":""}`})})}),p&&l.jsx("div",{className:"mx-4 mt-4",children:l.jsx(jr,{message:p,onDismiss:()=>h(null)})}),l.jsxs("div",{className:"grid grid-cols-2 gap-3 px-4 py-3 border-b md:grid-cols-4",style:{borderColor:"var(--pc-border)"},children:[l.jsxs("div",{className:"rounded-xl border px-3 py-2",style:{background:"var(--pc-bg-elevated)",borderColor:"var(--pc-border)"},children:[l.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--pc-text-faint)"},children:"记录数"}),l.jsx("div",{className:"mt-1 text-lg font-semibold",style:{color:"var(--pc-text-primary)"},children:x.length})]}),l.jsxs("div",{className:"rounded-xl border px-3 py-2",style:{background:"var(--pc-bg-elevated)",borderColor:"var(--pc-border)"},children:[l.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--pc-text-faint)"},children:"直接执行"}),l.jsx("div",{className:"mt-1 text-lg font-semibold",style:{color:"var(--pc-accent)"},children:k})]}),l.jsxs("div",{className:"rounded-xl border px-3 py-2",style:{background:"var(--pc-bg-elevated)",borderColor:"var(--pc-border)"},children:[l.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--pc-text-faint)"},children:"计划执行"}),l.jsx("div",{className:"mt-1 text-lg font-semibold",style:{color:"#30d158"},children:v})]}),l.jsxs("div",{className:"rounded-xl border px-3 py-2",style:{background:"var(--pc-bg-elevated)",borderColor:"var(--pc-border)"},children:[l.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--pc-text-faint)"},children:"策略阻断"}),l.jsx("div",{className:"mt-1 text-lg font-semibold",style:{color:w>0?"#ff3b30":"var(--pc-text-primary)"},children:w})]})]}),l.jsx("div",{className:"flex-1 overflow-hidden",style:{background:"var(--pc-bg-base)"},children:x.length===0?l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(ra,{icon:p?em:t1,message:p?"无法读取 GET /api/route-decisions,请确认后端接口已实现并可访问":r===!1?"后端尚未提供分流治理状态,或当前没有可恢复的 RouteDecision 记录":"暂无分流审计记录",action:{label:"重新加载",onClick:y}})}):l.jsx("div",{className:"h-full overflow-auto p-4",children:l.jsxs("table",{className:"min-w-[1680px] w-full border-separate border-spacing-0 text-left text-xs",children:[l.jsx("thead",{children:l.jsx("tr",{style:{color:"var(--pc-text-faint)"},children:["时间","入口","操作人","分流结果","意图","原因","候选能力","是否建计划","是否建任务执行","风险结果","command","correlation","context_refs"].map(T=>l.jsx("th",{className:"sticky top-0 z-10 border-b px-3 py-2 text-[10px] font-semibold uppercase tracking-wider",style:{background:"var(--pc-bg-elevated)",borderColor:"var(--pc-border)"},children:T},T))})}),l.jsx("tbody",{children:x.map((T,j)=>{const C=Kr(T.route_kind),$=Kr(T.intent_kind);return l.jsxs("tr",{className:"align-top transition-colors hover:bg-[var(--pc-hover)]",style:{color:"var(--pc-text-secondary)"},children:[l.jsx("td",{className:"border-b px-3 py-3 whitespace-nowrap",style:{borderColor:"var(--pc-border)"},children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(op,{className:"h-3.5 w-3.5 shrink-0",style:{color:"var(--pc-text-faint)"}}),l.jsx("span",{children:P6(T.recorded_at)})]})}),l.jsx("td",{className:"border-b px-3 py-3 whitespace-nowrap",style:{borderColor:"var(--pc-border)"},children:Kr(T.entrypoint)}),l.jsx("td",{className:"border-b px-3 py-3 whitespace-nowrap",style:{borderColor:"var(--pc-border)"},children:Kr(T.actor)}),l.jsx("td",{className:"border-b px-3 py-3",style:{borderColor:"var(--pc-border)"},children:l.jsxs("div",{className:"flex max-w-[160px] flex-col gap-1",children:[l.jsx(ts,{value:C,tone:Q6(T.route_kind)}),T.route_kind&&Vb[T.route_kind]?l.jsx("span",{className:"text-[10px]",style:{color:"var(--pc-text-faint)"},children:Vb[T.route_kind]}):null]})}),l.jsx("td",{className:"border-b px-3 py-3",style:{borderColor:"var(--pc-border)"},children:l.jsxs("div",{className:"flex max-w-[120px] flex-col gap-1",children:[l.jsx(ts,{value:$,tone:"accent"}),T.intent_kind&&Kb[T.intent_kind]?l.jsx("span",{className:"text-[10px]",style:{color:"var(--pc-text-faint)"},children:Kb[T.intent_kind]}):null]})}),l.jsx("td",{className:"border-b px-3 py-3",style:{borderColor:"var(--pc-border)"},children:l.jsx(Xb,{values:T.reason_codes})}),l.jsx("td",{className:"border-b px-3 py-3",style:{borderColor:"var(--pc-border)"},children:l.jsx(Xb,{values:T.candidate_skills})}),l.jsx("td",{className:"border-b px-3 py-3",style:{borderColor:"var(--pc-border)"},children:l.jsx(Pb,{value:T.creates_plan})}),l.jsx("td",{className:"border-b px-3 py-3",style:{borderColor:"var(--pc-border)"},children:l.jsx(Pb,{value:T.creates_task_run})}),l.jsx("td",{className:"border-b px-3 py-3",style:{borderColor:"var(--pc-border)"},children:l.jsx(ts,{value:Kr(T.policy_result),tone:Z6(T.policy_result)})}),l.jsx("td",{className:"border-b px-3 py-3 font-mono text-[11px] break-all",style:{borderColor:"var(--pc-border)",color:"var(--pc-text-muted)"},children:Kr(T.created_command_id)}),l.jsx("td",{className:"border-b px-3 py-3 font-mono text-[11px] break-all",style:{borderColor:"var(--pc-border)",color:"var(--pc-text-muted)"},children:Kr(T.correlation_id)}),l.jsx("td",{className:"border-b px-3 py-3",style:{borderColor:"var(--pc-border)"},children:l.jsx("pre",{className:"max-w-[260px] overflow-x-auto whitespace-pre-wrap break-all rounded-lg border p-2 font-mono text-[10px]",style:{background:"var(--pc-bg-elevated)",borderColor:"var(--pc-border)",color:"var(--pc-text-muted)"},children:X6(T.context_refs)})})]},T.id||`${T.correlation_id||T.created_command_id||"route"}-${j}`)})})]})})})]})}function U0(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Qb(e){if(!e)return"—";const a=new Date(e);return Number.isNaN(a.getTime())?e:a.toLocaleString()}function W6(e){return e?e.length>120?`${e.slice(0,117)}...`:e:"—"}function eA(e){if(e.expression)return e.expression;if(U0(e.schedule)){const a=e.schedule.expr??e.schedule.expression??e.schedule.cron;if(typeof a=="string")return a}return typeof e.schedule=="string"?e.schedule:"—"}function tA(e){const a=[e.schedule,e.delivery];for(const r of a){if(!U0(r))continue;const i=r.template_id??r.plan_template_id??r.templateId;if(typeof i=="string"&&i.trim())return i}return"后端尚未暴露"}function nA(e){const a=(e||"").toLowerCase();return["ok","success","succeeded"].includes(a)?{color:"#30d158",icon:Jv}:["error","failed","fail"].includes(a)?{color:"#ff3b30",icon:al}:{color:"#ff9500",icon:rs}}function aA(){const[e,a]=b.useState([]),[r,i]=b.useState(!0),[c,d]=b.useState(!1),[u,m]=b.useState(null),[p,h]=b.useState(null),y=b.useCallback(async()=>{try{const k=await Ei();a(k),m(null)}catch(k){m(`定时任务加载失败:${k instanceof Error?k.message:"未知错误"}`)}finally{i(!1)}},[]);b.useEffect(()=>{y()},[y]);const x=async()=>{var k;d(!0),h(null);try{const w=await d1();if(!w.accepted||w.error){const j=w.error?`治理命令返回错误:${w.error}`:`command 未被接受:${w.command_id||"run_schedule_now"}`;throw new Error(w.message||j)}const T=typeof((k=w.result)==null?void 0:k.activated)=="number"?w.result.activated:0;h(`定时检查完成,物化/激活 ${T} 个计划或任务。`),await y()}catch(w){m(`定时检查失败:${w instanceof Error?w.message:"未知错误"}`)}finally{d(!1)}};if(r)return l.jsx(il,{message:"加载定时任务..."});const v=(k,w)=>({[k]:w});return l.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[l.jsx(sl,{title:"定时任务",subtitle:`${e.length} 个调度注册记录`,icon:Qv,actions:l.jsxs(l.Fragment,{children:[l.jsx("button",{onClick:y,className:"p-2 rounded-lg transition-colors hover:bg-[var(--pc-hover)]",style:v("color","var(--pc-text-muted)"),title:"刷新",children:l.jsx(Ba,{className:"h-4 w-4"})}),l.jsxs("button",{onClick:x,disabled:c,className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-medium text-white transition-colors disabled:opacity-60",style:v("background","var(--pc-accent)"),children:[l.jsx(ip,{className:"h-3.5 w-3.5"}),c?"检查中...":"触发定时检查"]})]})}),u?l.jsx(jr,{message:u,onDismiss:()=>m(null)}):null,p?l.jsx("div",{className:"mx-4 mt-3 rounded-lg border px-3 py-2 text-xs",style:{color:"#30d158",borderColor:"rgba(48, 209, 88, 0.28)",background:"rgba(48, 209, 88, 0.08)"},children:p}):null,l.jsx("div",{className:"flex-1 overflow-auto p-4",children:e.length===0?l.jsx(ra,{message:"暂无定时任务注册记录"}):l.jsx("div",{className:"rounded-xl border overflow-hidden",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg-elevated)"},children:l.jsxs("table",{className:"w-full text-left text-xs",children:[l.jsx("thead",{style:{background:"var(--pc-bg-base)",color:"var(--pc-text-faint)"},children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-3 py-2 font-semibold",children:"调度 ID"}),l.jsx("th",{className:"px-3 py-2 font-semibold",children:"模板 ID"}),l.jsx("th",{className:"px-3 py-2 font-semibold",children:"cron 表达式"}),l.jsx("th",{className:"px-3 py-2 font-semibold",children:"下一次触发"}),l.jsx("th",{className:"px-3 py-2 font-semibold",children:"最近结果"}),l.jsx("th",{className:"px-3 py-2 font-semibold",children:"启用状态"})]})}),l.jsx("tbody",{children:e.map(k=>{const w=nA(k.last_status),T=w.icon;return l.jsxs("tr",{className:"border-t",style:v("borderColor","var(--pc-border)"),children:[l.jsxs("td",{className:"px-3 py-3 align-top",children:[l.jsx("div",{className:"font-mono",style:v("color","var(--pc-text-primary)"),children:k.id}),l.jsx("div",{className:"mt-1",style:v("color","var(--pc-text-faint)"),children:k.name||k.job_type||"schedule"})]}),l.jsx("td",{className:"px-3 py-3 align-top font-mono",style:v("color","var(--pc-text-secondary)"),children:tA(k)}),l.jsx("td",{className:"px-3 py-3 align-top font-mono",style:v("color","var(--pc-text-secondary)"),children:eA(k)}),l.jsx("td",{className:"px-3 py-3 align-top",style:v("color","var(--pc-text-muted)"),children:Qb(k.next_run)}),l.jsxs("td",{className:"px-3 py-3 align-top",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(T,{className:"h-3.5 w-3.5",style:v("color",w.color)}),l.jsx("span",{style:v("color","var(--pc-text-secondary)"),children:k.last_status||"未触发"})]}),l.jsx("div",{className:"mt-1 max-w-[260px] whitespace-nowrap overflow-hidden text-ellipsis",title:k.last_output||void 0,style:v("color","var(--pc-text-faint)"),children:W6(k.last_output)}),l.jsxs("div",{className:"mt-1",style:v("color","var(--pc-text-faint)"),children:["最近触发:",Qb(k.last_run)]})]}),l.jsx("td",{className:"px-3 py-3 align-top",children:l.jsx("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full border text-[11px] font-semibold",style:k.enabled?{color:"#30d158",borderColor:"rgba(48, 209, 88, 0.28)",background:"rgba(48, 209, 88, 0.08)"}:{color:"var(--pc-text-faint)",borderColor:"var(--pc-border)",background:"transparent"},children:k.enabled?"启用":"停用"})})]},k.id)})})]})})})]})}function H0(e){return e?new Date(e).toLocaleString():"-"}function rA(e){if(e==null)return"-";if(e<1e3)return`${e}ms`;const a=e/1e3;return a<60?`${a.toFixed(1)}s`:`${(a/60).toFixed(1)}m`}function lA(e,a,r){const i=(e||a||"scheduled-task").replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/^-+|-+$/g,"").toLowerCase(),c=Date.now().toString(36),d=r.replace(/[^a-zA-Z0-9_-]+/g,"-").slice(0,12);return`schedule-${i.slice(0,48)||"scheduled-task"}-${d||"cron"}-${c}`}function sA(e){const a=[e.message,e.error?`error=${e.error}`:null].filter(Boolean);return a.length>0?a.join(";"):J("cron.add_error")}function iA({jobId:e}){const[a,r]=b.useState([]),[i,c]=b.useState(!0),[d,u]=b.useState(null),m=b.useCallback(()=>{c(!0),u(null),oS(e,20).then(r).catch(p=>u(p.message)).finally(()=>c(!1))},[e]);return b.useEffect(()=>{m()},[m]),i?l.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 text-xs",style:{color:"var(--pc-text-muted)"},children:[l.jsx("div",{className:"h-4 w-4 border-2 rounded-full animate-spin",style:{borderColor:"var(--pc-border)",borderTopColor:"var(--pc-accent)"}}),"Loading run history..."]}):d?l.jsx("div",{className:"px-4 py-3",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("span",{className:"text-xs",style:{color:"var(--color-status-error)"},children:[J("cron.load_run_history_error"),": ",d]}),l.jsx("button",{onClick:m,className:"btn-icon",children:l.jsx(Ba,{className:"h-3.5 w-3.5"})})]})}):a.length===0?l.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[l.jsx("span",{className:"text-xs",style:{color:"var(--pc-text-faint)"},children:J("cron.no_runs")}),l.jsx("button",{onClick:m,className:"btn-icon",children:l.jsx(Ba,{className:"h-3.5 w-3.5"})})]}):l.jsxs("div",{className:"px-4 py-3",children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsxs("span",{className:"text-xs font-medium",style:{color:"var(--pc-text-secondary)"},children:[J("cron.recent_runs")," (",a.length,")"]}),l.jsx("button",{onClick:m,className:"btn-icon",title:"Refresh runs",children:l.jsx(Ba,{className:"h-3.5 w-3.5"})})]}),l.jsx("div",{className:"space-y-1.5 max-h-60 overflow-y-auto",children:a.map(p=>l.jsxs("div",{className:"rounded-xl px-3 py-2 text-xs border",style:{background:"var(--pc-bg-elevated)",borderColor:"var(--pc-border)"},children:[l.jsxs("div",{className:"flex items-center justify-between mb-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[p.status==="ok"?l.jsx($i,{className:"h-3.5 w-3.5",style:{color:"var(--color-status-success)"}}):l.jsx(al,{className:"h-3.5 w-3.5",style:{color:"var(--color-status-error)"}}),l.jsx("span",{style:{color:"var(--pc-text-secondary)"},children:p.status})]}),l.jsx("span",{style:{color:"var(--pc-text-muted)"},children:rA(p.duration_ms)})]}),l.jsx("div",{className:"flex items-center gap-3",style:{color:"var(--pc-text-muted)"},children:l.jsx("span",{children:H0(p.started_at)})}),p.output&&l.jsx("pre",{className:"mt-1.5 rounded-lg p-2 text-xs overflow-x-auto max-h-24 whitespace-pre-wrap break-words font-mono",style:{background:"var(--pc-bg-base)",color:"var(--pc-text-secondary)"},children:p.output})]},p.id))})]})}function oA(){const[e,a]=b.useState([]),[r,i]=b.useState(!0),[c,d]=b.useState(null),[u,m]=b.useState(null),[p,h]=b.useState(null),[y,x]=b.useState(null),[v,k]=b.useState(!1),[w,T]=b.useState(null),[j,C]=b.useState(""),[$,M]=b.useState(""),[ee,ne]=b.useState(""),[A,G]=b.useState(null),[V,oe]=b.useState(!1),Y=w!==null&&w!=="add",F=()=>{C(""),M(""),ne(""),G(null),T("add")},I=N=>{C(N.name??""),M(N.expression),ne(N.prompt??N.command),G(null),T(N)},Q=()=>{T(null),G(null)},le=()=>{i(!0),d(null),Ei().then(a).catch(N=>d(N instanceof Error?N.message:String(N))).finally(()=>i(!1))},B=()=>{cS().then(x).catch(()=>{})},L=async()=>{if(y){k(!0);try{const N=await uS({catch_up_on_startup:!y.catch_up_on_startup});x(N)}catch{}finally{k(!1)}}};b.useEffect(()=>{le(),B()},[]);const q=async()=>{if(!$.trim()||!ee.trim()){G(J("cron.validation_error"));return}oe(!0),G(null);try{if(Y){const N=await iS(w.id,{name:j.trim()||void 0,schedule:$.trim(),command:ee.trim()});a(z=>z.map(K=>K.id===N.id?N:K))}else{const N=lA(j,ee,$),z=await yS({entrypoint:"cron",actor:"cron-ui",text:ee.trim(),context_refs:{schedule_id:N},idempotency_key:`cron-ui:${N}`,correlation_id:`cron-ui:${N}`,payload:{schedule_id:N,name:j.trim()||N,schedule:$.trim(),expression:$.trim(),description:ee.trim(),prompt:ee.trim()}});if(!z.accepted||z.error||!z.created_schedule_id)throw new Error(sA(z));a(await Ei())}Q()}catch(N){G(N instanceof Error?N.message:J(Y?"cron.edit_error":"cron.add_error"))}finally{oe(!1)}},ce=async N=>{try{await sS(N),a(z=>z.filter(K=>K.id!==N))}catch(z){d(z instanceof Error?z.message:J("cron.delete_error"))}finally{m(null)}},ge=N=>{if(!N)return null;switch(N.toLowerCase()){case"ok":case"success":return l.jsx($i,{className:"h-4 w-4",style:{color:"var(--color-status-success)"}});case"error":case"failed":return l.jsx(al,{className:"h-4 w-4",style:{color:"var(--color-status-error)"}});default:return l.jsx(rs,{className:"h-4 w-4",style:{color:"var(--color-status-warning)"}})}};return c?l.jsx("div",{className:"p-6 animate-fade-in",children:l.jsxs("div",{className:"rounded-2xl border p-4",style:{background:"rgba(239, 68, 68, 0.08)",borderColor:"rgba(239, 68, 68, 0.2)",color:"#f87171"},children:[J("cron.load_error"),": ",c]})}):r?l.jsx("div",{className:"flex items-center justify-center h-64",children:l.jsx("div",{className:"h-8 w-8 border-2 rounded-full animate-spin",style:{borderColor:"var(--pc-border)",borderTopColor:"var(--pc-accent)"}})}):l.jsxs("div",{className:"flex flex-col h-full p-6 gap-6 animate-fade-in overflow-hidden",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Ni,{className:"h-5 w-5",style:{color:"var(--pc-accent)"}}),l.jsxs("h2",{className:"text-sm font-semibold uppercase tracking-wider",style:{color:"var(--pc-text-primary)"},children:[J("cron.scheduled_tasks")," (",e.length,")"]})]}),l.jsxs("button",{onClick:F,className:"btn-electric flex items-center gap-2 text-sm px-4 py-2",children:[l.jsx(Bi,{className:"h-4 w-4"}),J("cron.add_job")]})]}),y&&l.jsxs("div",{className:"glass-card px-4 py-3 flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-sm font-medium",style:{color:"var(--pc-text-primary)"},children:"Catch up missed jobs on startup"}),l.jsx("p",{className:"text-xs mt-0.5",style:{color:"var(--pc-text-muted)"},children:"Run all overdue jobs when ZeroClaw starts after downtime"})]}),l.jsx("button",{onClick:L,disabled:v,className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors duration-300 focus:outline-none ${y.catch_up_on_startup?"bg-[#0080ff]":"bg-[#1a1a3e]"}`,children:l.jsx("span",{className:`inline-block h-4 w-4 rounded-full bg-white transition-transform duration-300 ${y.catch_up_on_startup?"translate-x-6":"translate-x-1"}`})})]}),w!==null&&l.jsx("div",{className:"fixed inset-0 modal-backdrop flex items-center justify-center z-50",children:l.jsxs("div",{className:"surface-panel p-6 w-full max-w-md mx-4 animate-fade-in-scale",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("h3",{className:"text-lg font-semibold",style:{color:"var(--pc-text-primary)"},children:J(Y?"cron.edit_modal_title":"cron.add_modal_title")}),l.jsx("button",{onClick:Q,className:"btn-icon",children:l.jsx(Ha,{className:"h-5 w-5"})})]}),A&&l.jsx("div",{className:"mb-4 rounded-xl border p-3 text-sm animate-fade-in",style:{background:"rgba(239, 68, 68, 0.08)",borderColor:"rgba(239, 68, 68, 0.2)",color:"#f87171"},children:A}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs font-semibold mb-1.5 uppercase tracking-wider",style:{color:"var(--pc-text-secondary)"},children:J("cron.name_optional")}),l.jsx("input",{type:"text",value:j,onChange:N=>C(N.target.value),placeholder:"e.g. Daily cleanup",className:"input-electric w-full px-3 py-2.5 text-sm"})]}),l.jsxs("div",{children:[l.jsxs("label",{className:"block text-xs font-semibold mb-1.5 uppercase tracking-wider",style:{color:"var(--pc-text-secondary)"},children:[J("cron.schedule_required")," ",l.jsx("span",{style:{color:"var(--color-status-error)"},children:"*"})]}),l.jsx("input",{type:"text",value:$,onChange:N=>M(N.target.value),placeholder:"e.g. 0 0 * * * (cron expression)",className:"input-electric w-full px-3 py-2.5 text-sm"})]}),l.jsxs("div",{children:[l.jsxs("label",{className:"block text-xs font-semibold mb-1.5 uppercase tracking-wider",style:{color:"var(--pc-text-secondary)"},children:[J("cron.command_required")," ",l.jsx("span",{style:{color:"var(--color-status-error)"},children:"*"})]}),l.jsx("textarea",{value:ee,onChange:N=>ne(N.target.value),placeholder:"e.g. cleanup --older-than 7d",rows:4,className:"input-electric w-full px-3 py-2.5 text-sm resize-y"})]})]}),l.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[l.jsx("button",{onClick:Q,className:"btn-secondary px-4 py-2 text-sm font-medium",children:J("cron.cancel")}),l.jsx("button",{onClick:q,disabled:V,className:"btn-electric px-4 py-2 text-sm font-medium",children:J(V?Y?"cron.saving":"cron.adding":Y?"cron.save":"cron.add_job")})]})]})}),e.length===0?l.jsxs("div",{className:"card p-8 text-center",children:[l.jsx(Ni,{className:"h-10 w-10 mx-auto mb-3",style:{color:"var(--pc-text-faint)"}}),l.jsx("p",{style:{color:"var(--pc-text-muted)"},children:J("cron.empty")})]}):l.jsx("div",{className:"card overflow-auto rounded-2xl flex-1 min-h-0",children:l.jsxs("table",{className:"table-electric",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:J("cron.id")}),l.jsx("th",{children:J("cron.name")}),l.jsx("th",{children:J("cron.command")}),l.jsx("th",{children:J("cron.next_run")}),l.jsx("th",{children:J("cron.last_status")}),l.jsx("th",{children:J("cron.enabled")}),l.jsx("th",{className:"text-right",children:J("cron.actions")})]})}),l.jsx("tbody",{children:e.map(N=>l.jsxs($p.Fragment,{children:[l.jsxs("tr",{children:[l.jsx("td",{className:"font-mono text-xs",children:l.jsxs("button",{onClick:()=>h(z=>z===N.id?null:N.id),className:"flex items-center gap-1 btn-icon",title:"Toggle run history",children:[p===N.id?l.jsx(Kc,{className:"h-3.5 w-3.5"}):l.jsx(Zv,{className:"h-3.5 w-3.5"}),N.id.slice(0,8)]})}),l.jsx("td",{className:"font-medium text-sm",style:{color:"var(--pc-text-primary)"},children:N.name??"-"}),l.jsx("td",{className:"font-mono text-xs max-w-[200px] truncate",style:{color:"var(--pc-text-secondary)"},children:N.prompt??N.command}),l.jsx("td",{className:"text-xs",style:{color:"var(--pc-text-muted)"},children:H0(N.next_run)}),l.jsx("td",{children:l.jsxs("div",{className:"flex items-center gap-1.5",children:[ge(N.last_status),l.jsx("span",{className:"text-xs capitalize",style:{color:"var(--pc-text-secondary)"},children:N.last_status??"-"})]})}),l.jsx("td",{children:l.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-[10px] font-semibold border",style:N.enabled?{color:"var(--color-status-success)",borderColor:"rgba(0, 230, 138, 0.2)",background:"rgba(0, 230, 138, 0.06)"}:{color:"var(--pc-text-faint)",borderColor:"var(--pc-border)",background:"transparent"},children:N.enabled?J("cron.enabled_status"):J("cron.disabled_status")})}),l.jsx("td",{className:"text-right",children:l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[l.jsx("button",{onClick:()=>I(N),className:"btn-icon",title:J("cron.edit"),children:l.jsx(Ij,{className:"h-4 w-4"})}),u===N.id?l.jsxs("div",{className:"flex items-center justify-end gap-2 animate-fade-in",children:[l.jsx("span",{className:"text-xs",style:{color:"var(--color-status-error)"},children:J("cron.confirm_delete")}),l.jsx("button",{onClick:()=>ce(N.id),className:"text-xs font-medium",style:{color:"var(--color-status-error)"},children:J("cron.yes")}),l.jsx("button",{onClick:()=>m(null),className:"text-xs font-medium",style:{color:"var(--pc-text-muted)"},children:J("cron.no")})]}):l.jsx("button",{onClick:()=>m(N.id),className:"btn-icon",children:l.jsx(Xj,{className:"h-4 w-4"})})]})})]}),p===N.id&&l.jsx("tr",{children:l.jsx("td",{colSpan:7,style:{background:"var(--pc-bg-elevated)"},children:l.jsx(iA,{jobId:N.id})})})]},N.id))})]})})]})}function cA(){const[e,a]=b.useState([]),[r,i]=b.useState(null),[c,d]=b.useState(!0),[u,m]=b.useState(null),p=b.useCallback(async()=>{try{a(await sm()),m(null)}catch(y){m(y instanceof Error?y.message:"加载失败")}finally{d(!1)}},[]);b.useEffect(()=>{p()},[p]);const h=e.find(y=>y.skill_id===r);return c?l.jsx(il,{message:"加载技能..."}):l.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[l.jsx(sl,{title:"技能管理",subtitle:`${e.length} 个技能`,icon:Wv,actions:l.jsx("button",{onClick:p,className:"p-2 rounded-lg transition-colors hover:bg-[var(--pc-hover)]",style:{color:"var(--pc-text-muted)"},title:"刷新",children:l.jsx(Ba,{className:"h-4 w-4"})})}),u&&l.jsx(jr,{message:u,onDismiss:()=>m(null)}),l.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[l.jsx("div",{className:"w-72 shrink-0 flex flex-col border-r overflow-hidden",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg-elevated)"},children:l.jsx("div",{className:"flex-1 overflow-y-auto py-2",children:e.length===0?l.jsx(ra,{message:"无已注册技能"}):e.map(y=>l.jsxs("div",{onClick:()=>i(y.skill_id===r?null:y.skill_id),className:"rounded-xl p-3 mx-1.5 mb-1.5 cursor-pointer transition-all border hover:-translate-y-0.5",style:{background:r===y.skill_id?"var(--pc-accent-glow)":"var(--pc-bg-elevated)",borderColor:r===y.skill_id?"var(--pc-accent)":"var(--pc-border)"},children:[l.jsx("div",{className:"text-[13px] font-semibold truncate",style:{color:"var(--pc-text-primary)"},children:y.name||y.skill_id}),l.jsxs("div",{className:"flex items-center gap-2 mt-1.5",children:[l.jsx(Wr,{status:y.enabled?"ok":"error",size:"sm"}),l.jsxs("span",{className:"text-[9px]",style:{color:"var(--pc-text-faint)"},children:[y.skill_id," v",y.version||"?"]})]})]},y.skill_id))})}),l.jsx("div",{className:"flex-1 overflow-y-auto p-5",style:{background:"var(--pc-bg-base)"},children:h?l.jsxs("div",{className:"space-y-4 max-w-lg",children:[l.jsx(Qr,{title:"基本信息",rows:[{label:"技能 ID",value:h.skill_id},{label:"名称",value:h.name||h.skill_id},{label:"版本",value:`v${h.version||"?"}`},{label:"状态",value:l.jsx(Wr,{status:h.enabled?"ok":"error",size:"sm"})}]}),h.description&&l.jsx(Qr,{title:"描述",rows:[{label:"描述",value:h.description}]})]}):l.jsx("div",{className:"flex-1 flex items-center justify-center h-full",children:l.jsx(ra,{message:"选择左侧技能查看详情"})})})]})]})}function Zb(e){return e?new Date(e).toLocaleTimeString():new Date().toLocaleTimeString()}function uA(e){switch(e.toLowerCase()){case"error":return{color:"var(--color-status-error)",bg:"rgba(239, 68, 68, 0.06)",border:"rgba(239, 68, 68, 0.2)"};case"warn":case"warning":return{color:"var(--color-status-warning)",bg:"rgba(255, 170, 0, 0.06)",border:"rgba(255, 170, 0, 0.2)"};case"tool_call":case"tool_result":case"tool_call_start":return{color:"#a78bfa",bg:"rgba(167, 139, 250, 0.06)",border:"rgba(167, 139, 250, 0.2)"};case"llm_request":return{color:"#38bdf8",bg:"rgba(56, 189, 248, 0.06)",border:"rgba(56, 189, 248, 0.2)"};case"agent_start":case"agent_end":return{color:"#34d399",bg:"rgba(52, 211, 153, 0.06)",border:"rgba(52, 211, 153, 0.2)"};case"message":case"chat":return{color:"var(--pc-accent)",bg:"var(--pc-accent-glow)",border:"var(--pc-accent-dim)"};case"health":case"status":return{color:"var(--color-status-success)",bg:"rgba(0, 230, 138, 0.06)",border:"rgba(0, 230, 138, 0.2)"};default:return{color:"var(--pc-text-muted)",bg:"var(--pc-hover)",border:"var(--pc-border)"}}}function dA(e){switch(e.toUpperCase()){case"ERROR":return{color:"var(--color-status-error)",bg:"rgba(239, 68, 68, 0.06)",border:"rgba(239, 68, 68, 0.2)"};case"WARN":case"WARNING":return{color:"var(--color-status-warning)",bg:"rgba(255, 170, 0, 0.06)",border:"rgba(255, 170, 0, 0.2)"};case"INFO":return{color:"#3b82f6",bg:"rgba(59, 130, 246, 0.06)",border:"rgba(59, 130, 246, 0.2)"};case"DEBUG":return{color:"#8b5cf6",bg:"rgba(139, 92, 246, 0.06)",border:"rgba(139, 92, 246, 0.2)"};default:return{color:"var(--pc-text-muted)",bg:"var(--pc-hover)",border:"var(--pc-border)"}}}function fA(){const e=window.location.protocol==="https:"?"wss:":"ws:",a=window.location.hostname;return`${e}//${a==="localhost"||a==="127.0.0.1"?a:"127.0.0.1"}:50052/runtime`}function Jb(e){if(!e||typeof e!="object")return null;const a=e,r=a.message??a.content??a.data;return{type:String(a.level??a.type??"runtime"),timestamp:typeof a.timestamp=="string"?a.timestamp:void 0,message:typeof r=="string"?r:r==null?"":JSON.stringify(r),task_id:a.task_id,sequence:a.sequence,source:"runtime-ws",event_detail:a.event}}function pA(e){if(!e||typeof e!="object")return[];const a=e;if(a.type==="snapshot"&&Array.isArray(a.logs))return a.logs.flatMap(r=>{const i=Jb(r);return i?[i]:[]});if(a.type==="log_entry"){const r=Jb(a);return r?[r]:[]}return[]}function mA(e){const a=e.message??e.content??e.data,r=Object.fromEntries(Object.entries(e).filter(([d,u])=>!["type","timestamp","message","content","data"].includes(d)&&u!==void 0)),i=typeof a=="string"?a:a==null?"":JSON.stringify(a),c=Object.keys(r).length>0?JSON.stringify(r):"";return[i,c].filter(Boolean).join(" ")}function hA(){const[e,a]=b.useState([]),[r,i]=b.useState([]),[c,d]=b.useState("runtime"),[u,m]=b.useState([]),[p,h]=b.useState(null),[y,x]=b.useState(!1),[v,k]=b.useState(!1),[w,T]=b.useState(!0),[j,C]=b.useState(!1),[$,M]=b.useState(new Set),ee=b.useRef(null),ne=b.useRef(null),A=b.useRef(null),G=b.useRef(null),V=b.useRef(!1),oe=b.useRef(0),Y=b.useCallback((q,ce=!1)=>{V.current&&!ce||a(ge=>{const N=ce?[]:[...ge];for(const z of q)oe.current+=1,N.push({id:`log-${oe.current}`,event:z});return N.length>1e3?N.slice(-1e3):N})},[]);b.useEffect(()=>{V.current=y},[y]),b.useEffect(()=>{const q=new Cp;return q.onConnect=()=>{k(!0)},q.onError=()=>{k(!1)},q.onEvent=ce=>{V.current||Y([ce])},q.connect(),ne.current=q,()=>{q.disconnect()}},[Y]);const F=b.useCallback(q=>{V.current||i(ce=>{const ge=[...ce];for(const N of q)oe.current+=1,ge.push({id:`trace-${oe.current}`,event:N});return ge.length>1e3?ge.slice(-1e3):ge})},[]);b.useEffect(()=>{const q=new Cp({path:"/api/logs/stream"});return q.onConnect=()=>{k(!0)},q.onError=()=>{k(!1)},q.onEvent=ce=>{V.current||F([ce])},q.connect(),A.current=q,()=>{q.disconnect()}},[F]),b.useEffect(()=>{let q=!1,ce=null;const ge=()=>{const N=new WebSocket(fA());G.current=N,N.onopen=()=>{k(!0),N.send(JSON.stringify({type:"connect",client_name:"react-logs",client_version:"1.0.0"})),N.send(JSON.stringify({type:"list_logs",request_id:"react-logs-initial",limit:1e3}))},N.onmessage=z=>{try{const K=JSON.parse(z.data),E=pA(K);if(E.length===0)return;Y(E,K.type==="snapshot"&&K.request_id==="react-logs-initial")}catch{}},N.onerror=()=>{G.current===N&&k(!1)},N.onclose=()=>{G.current===N&&(G.current=null),q||(k(!1),ce=setTimeout(ge,3e3))}};return ge(),()=>{var N;q=!0,ce&&clearTimeout(ce),(N=G.current)==null||N.close(),G.current=null}},[Y]),b.useEffect(()=>{w&&ee.current&&(ee.current.scrollTop=ee.current.scrollHeight)},[e,w]),b.useEffect(()=>{if(c!=="business")return;let q=!1;async function ce(){try{const N=await lm();if(q)return;const z=[];(N.tables.tasks||[]).forEach(K=>{z.push({time:K.created_at||"",source:"任务系统",kind:"创建",msg:`Task ${K.title||K.task_id}`,detail:`plan=${K.plan_id||"-"}`})}),(N.tables.runs||[]).forEach(K=>{z.push({time:K.created_at||"",source:"执行器",kind:`Run ${K.lifecycle}`,msg:`Run #${K.attempt_no||"?"}`,detail:`run_id=${K.run_id}`})}),z.sort((K,E)=>(E.time||"").localeCompare(K.time||"")),m(z.slice(0,200)),h(null)}catch(N){if(q)return;m([]),h(N instanceof Error?N.message:"debug store 加载失败")}}ce();const ge=setInterval(ce,1e4);return()=>{q=!0,clearInterval(ge)}},[c]);const I=b.useCallback(()=>{if(!ee.current)return;const{scrollTop:q,scrollHeight:ce,clientHeight:ge}=ee.current,N=ce-q-ge<50;T(N)},[]),Q=()=>{ee.current&&(ee.current.scrollTop=ee.current.scrollHeight),T(!0)},le=Array.from(new Set(e.map(q=>q.event.type))).sort(),B=q=>{M(ce=>{const ge=new Set(ce);return ge.has(q)?ge.delete(q):ge.add(q),ge})},L=$.size===0?e:e.filter(q=>$.has(q.event.type));return l.jsxs("div",{className:"flex flex-col h-full",children:[l.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b animate-fade-in",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg-surface)"},children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(vi,{className:"h-5 w-5",style:{color:"var(--pc-accent)"}}),l.jsx("div",{className:"flex items-center gap-1 rounded-xl p-0.5",style:{background:"var(--pc-bg-base)",border:"1px solid var(--pc-border)"},children:["runtime","business","tracing"].map(q=>l.jsx("button",{onClick:()=>d(q),className:"px-3 py-1 rounded-lg text-[11px] font-medium transition-colors",style:{background:c===q?"var(--pc-accent)":"transparent",color:c===q?"#fff":"var(--pc-text-muted)"},children:q==="runtime"?"运行日志":q==="business"?"业务日志":"系统日志"},q))}),l.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wider",style:{color:"var(--pc-text-primary)"},children:c==="runtime"?J("logs.live_logs"):c==="business"?"业务日志":"系统日志"}),l.jsxs("span",{className:"text-[10px] font-mono ml-2",style:{color:"var(--pc-text-faint)"},children:[c==="tracing"?r.length:L.length," ",J("logs.events")]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{onClick:()=>x(!y),className:"btn-electric flex items-center gap-1.5 px-3 py-1.5 text-xs font-semibold",style:{background:y?"var(--color-status-success)":"var(--color-status-warning)",color:"white"},children:y?l.jsxs(l.Fragment,{children:[l.jsx(ds,{className:"h-3.5 w-3.5"})," ",J("logs.resume")]}):l.jsxs(l.Fragment,{children:[l.jsx(Wp,{className:"h-3.5 w-3.5"})," ",J("logs.pause")]})}),!w&&l.jsxs("button",{onClick:Q,className:"btn-electric flex items-center gap-1.5 px-3 py-1.5 text-xs font-semibold",children:[l.jsx(gj,{className:"h-3.5 w-3.5"}),J("logs.jump_to_bottom")]})]})]}),le.length>0&&l.jsxs("div",{className:"flex items-center gap-2 px-6 py-2 border-b overflow-x-auto",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg-base)"},children:[l.jsx(Tj,{className:"h-3.5 w-3.5 flex-shrink-0",style:{color:"var(--pc-text-faint)"}}),l.jsxs("span",{className:"text-[10px] uppercase tracking-wider flex-shrink-0",style:{color:"var(--pc-text-faint)"},children:[J("logs.filter_label"),":"]}),le.map(q=>l.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer flex-shrink-0",children:[l.jsx("input",{type:"checkbox",checked:$.has(q),onChange:()=>B(q),className:"rounded",style:{accentColor:"var(--pc-accent)"}}),l.jsx("span",{className:"text-[10px] capitalize",style:{color:"var(--pc-text-muted)"},children:q})]},q)),$.size>0&&l.jsx("button",{onClick:()=>M(new Set),className:"text-[10px] flex-shrink-0 ml-1 transition-colors",style:{color:"var(--pc-accent)"},children:J("logs.clear")})]}),c==="runtime"&&l.jsxs(l.Fragment,{children:[!j&&l.jsxs("div",{className:"flex items-start gap-3 px-6 py-3 border-b flex-shrink-0",style:{borderColor:"rgba(56, 189, 248, 0.2)",background:"rgba(56, 189, 248, 0.05)"},children:[l.jsxs("div",{className:"flex-1 text-xs",style:{color:"var(--pc-text-secondary)"},children:[l.jsx("span",{className:"font-semibold",style:{color:"#38bdf8"},children:"这里显示:"}),"运行时 WebSocket 的历史和实时执行日志,同时保留 SSE 推送的智能体活动。"]}),l.jsx("button",{onClick:()=>C(!0),className:"flex-shrink-0 text-[10px] btn-icon","aria-label":"关闭提示",style:{color:"var(--pc-text-faint)"},children:"✕"})]}),l.jsx("div",{ref:ee,onScroll:I,className:"flex-1 overflow-y-auto p-4 space-y-2 min-h-0",children:L.length===0?l.jsxs("div",{className:"flex flex-col items-center justify-center h-full animate-fade-in",style:{color:"var(--pc-text-muted)"},children:[l.jsx(vi,{className:"h-10 w-10 mb-3",style:{color:"var(--pc-text-faint)"}}),l.jsx("p",{className:"text-sm",children:J(y?"logs.paused_hint":"logs.waiting_hint")})]}):L.map(q=>{const{event:ce}=q,ge=uA(ce.type),N=mA(ce);return l.jsx("div",{className:"card rounded-xl p-3",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("span",{className:"text-[10px] font-mono whitespace-nowrap mt-0.5",style:{color:"var(--pc-text-faint)"},children:Zb(ce.timestamp)}),l.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-[10px] font-semibold border capitalize flex-shrink-0",style:ge,children:ce.type}),l.jsx("p",{className:"text-sm break-all min-w-0",style:{color:"var(--pc-text-secondary)"},children:N})]})},q.id)})})]}),c==="tracing"&&l.jsxs(l.Fragment,{children:[!j&&l.jsxs("div",{className:"flex items-start gap-3 px-6 py-3 border-b flex-shrink-0",style:{borderColor:"rgba(139, 92, 246, 0.2)",background:"rgba(139, 92, 246, 0.05)"},children:[l.jsxs("div",{className:"flex-1 text-xs",style:{color:"var(--pc-text-secondary)"},children:[l.jsx("span",{className:"font-semibold",style:{color:"#8b5cf6"},children:"这里显示:"}),"后端 tracing 系统日志实时流。包含所有 ",l.jsx("code",{children:"info!"}),"、",l.jsx("code",{children:"warn!"}),"、",l.jsx("code",{children:"error!"}),"、",l.jsx("code",{children:"debug!"})," 调用,按模块路径归类。"]}),l.jsx("button",{onClick:()=>C(!0),className:"flex-shrink-0 text-[10px] btn-icon","aria-label":"关闭提示",style:{color:"var(--pc-text-faint)"},children:"✕"})]}),l.jsx("div",{ref:ee,onScroll:I,className:"flex-1 overflow-y-auto p-4 space-y-2 min-h-0",children:r.length===0?l.jsxs("div",{className:"flex flex-col items-center justify-center h-full animate-fade-in",style:{color:"var(--pc-text-muted)"},children:[l.jsx(vi,{className:"h-10 w-10 mb-3",style:{color:"var(--pc-text-faint)"}}),l.jsx("p",{className:"text-sm",children:y?"已暂停 — 点击恢复接收系统日志":"等待系统日志... 确保以 RUST_LOG=info 启动后端"})]}):r.map(q=>{const{event:ce}=q,ge=String(ce.level??"").toUpperCase(),N=dA(ge),z=String(ce.target||""),K=typeof ce.message=="string"?ce.message:"",E=ce.fields&&typeof ce.fields=="object"?Object.entries(ce.fields).map(([ke,ve])=>`${ke}=${ve}`).join(" "):"",pe=ce.file?`${ce.file}${ce.line?":"+ce.line:""}`:"";return l.jsx("div",{className:"card rounded-xl p-3",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("span",{className:"text-[10px] font-mono whitespace-nowrap mt-0.5",style:{color:"var(--pc-text-faint)"},children:Zb(ce.timestamp)}),l.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-[10px] font-semibold border flex-shrink-0",style:N,children:ge}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:"text-xs font-mono break-all",style:{color:"var(--pc-text-muted)"},children:z}),l.jsx("p",{className:"text-sm break-all",style:{color:"var(--pc-text-secondary)"},children:[K,E,pe].filter(Boolean).join(" ")})]})]})},q.id)})})]}),c==="business"&&l.jsx("div",{className:"flex-1 overflow-y-auto p-4",style:{background:"var(--pc-bg-base)"},children:p?l.jsxs("div",{className:"flex flex-col items-center justify-center h-full px-4 text-center",style:{color:"var(--pc-text-muted)"},children:[l.jsx(dp,{className:"h-10 w-10 mb-3",style:{color:"var(--color-status-error)"}}),l.jsx("p",{className:"text-sm font-medium",style:{color:"var(--color-status-error)"},children:"业务日志加载失败"}),l.jsx("p",{className:"mt-2 max-w-xl text-xs",style:{color:"var(--pc-text-muted)"},children:p})]}):u.length===0?l.jsxs("div",{className:"flex flex-col items-center justify-center h-full",style:{color:"var(--pc-text-muted)"},children:[l.jsx(dp,{className:"h-10 w-10 mb-3",style:{color:"var(--pc-text-faint)"}}),l.jsx("p",{className:"text-sm",children:"暂无业务日志"})]}):l.jsxs("div",{className:"surface-panel p-4 rounded-2xl border",children:[l.jsxs("div",{className:"text-xs font-bold mb-3",style:{color:"var(--pc-text-primary)"},children:["业务日志 (",u.length," 条)"]}),l.jsx(B0,{logs:u})]})}),l.jsxs("div",{className:"flex items-center justify-center gap-2 px-6 py-2 border-t flex-shrink-0",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg-surface)"},children:[l.jsx("span",{className:"status-dot",style:v?{background:"var(--color-status-success)",boxShadow:"0 0 6px var(--color-status-success)"}:{background:"var(--color-status-error)",boxShadow:"0 0 6px var(--color-status-error)"}}),l.jsx("span",{className:"text-[10px]",style:{color:"var(--pc-text-faint)"},children:J(v?"logs.connected":"logs.disconnected")})]})]})}const gA=[{key:"task_receive",label:"任务接收",color:"blue"},{key:"skill_import",label:"技能导入",color:"cyan"},{key:"task_plan",label:"任务计划",color:"purple"},{key:"task_schedule",label:"任务调度",color:"orange"},{key:"task_execute",label:"任务执行",color:"blue"},{key:"llm_execution",label:"LLM 执行",color:"indigo"},{key:"fallback",label:"降级",color:"amber"},{key:"browser_action",label:"浏览器操作",color:"emerald"},{key:"model_reply",label:"模型回复",color:"green"},{key:"run_result",label:"执行结果",color:"green"},{key:"task_complete",label:"任务完成",color:"green"}],Pf={blue:"var(--pc-accent)",cyan:"#5ac8fa",purple:"#af52de",orange:"#ff9f0a",green:"#30d158",indigo:"#6366f1",amber:"#ff9f0a",emerald:"#10b981"};function xA(){var T;const[e,a]=b.useState([]),[r,i]=b.useState(!0),[c,d]=b.useState(null),[u,m]=b.useState(""),[p,h]=b.useState(null),y=b.useCallback(async()=>{try{const j=await lm();a((j.tables.tasks||[]).slice(-50).reverse()),d(null)}catch(j){d(j instanceof Error?j.message:"加载失败")}finally{i(!1)}},[]);b.useEffect(()=>{y()},[y]);const x=async j=>{try{let C;j.startsWith("plan")||j.startsWith("ws-plan")?C=await zc(j):C=await kS(j),h(C)}catch(C){d(C instanceof Error?C.message:"加载失败")}},v=(T=p==null?void 0:p.lanes)!=null&&T.length?p.lanes:gA,k={};v.forEach((j,C)=>{k[j.key]=C});const w=(p==null?void 0:p.steps)||[];return r?l.jsx(il,{message:"加载中..."}):l.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[l.jsx(sl,{title:"泳道图",subtitle:"任务/计划执行流程可视化",icon:Ci}),c&&l.jsx(jr,{message:c,onDismiss:()=>d(null)}),l.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[l.jsxs("div",{className:"w-64 shrink-0 flex flex-col border-r overflow-hidden",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg-elevated)"},children:[l.jsxs("div",{className:"p-3 border-b flex gap-2",style:{borderColor:"var(--pc-border)"},children:[l.jsx("input",{className:"input-electric flex-1 px-3 py-1.5 text-xs",placeholder:"输入 Task ID...",value:u,onChange:j=>m(j.target.value),onKeyDown:j=>{j.key==="Enter"&&x(u.trim())}}),l.jsx("button",{onClick:()=>x(u.trim()),className:"p-1.5 rounded-lg transition-colors hover:bg-[var(--pc-hover)]",style:{color:"var(--pc-accent)"},children:l.jsx(Gj,{className:"h-4 w-4"})})]}),l.jsx("div",{className:"flex-1 overflow-y-auto py-2",children:e.map(j=>l.jsxs("div",{onClick:()=>{m(j.task_id),x(j.task_id)},className:"rounded-lg p-2 mx-1.5 mb-1 cursor-pointer transition-colors hover:bg-[var(--pc-hover)]",style:{border:"1px solid var(--pc-border)"},children:[l.jsx("div",{className:"text-[11px] font-medium truncate",style:{color:"var(--pc-text-primary)"},children:j.title||j.task_id}),l.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[l.jsx(Wr,{status:j.status||"ready",size:"sm"}),l.jsx("span",{className:"text-[9px] font-mono truncate",style:{color:"var(--pc-text-faint)"},children:j.task_id})]})]},j.task_id))})]}),l.jsx("div",{className:"flex-1 overflow-auto p-4",style:{background:"var(--pc-bg-base)"},children:p?l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full border-collapse text-[10px]",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"sticky top-0 z-10 p-2 text-center text-[9px] font-semibold w-8",style:{background:"var(--pc-bg-elevated)",color:"var(--pc-text-faint)",borderBottom:"1px solid var(--pc-border)"},children:"#"}),v.map(j=>l.jsx("th",{className:"sticky top-0 z-10 p-2 text-center text-[9px] font-semibold",style:{background:"var(--pc-bg-elevated)",color:Pf[j.color]||"var(--pc-text-muted)",borderBottom:"1px solid var(--pc-border)"},children:j.label},j.key))]})}),l.jsx("tbody",{children:w.map((j,C)=>{const $=k[j.lane]??4;return l.jsxs("tr",{children:[l.jsx("td",{className:"text-center p-1.5",style:{color:"var(--pc-text-faint)"},children:C+1}),v.map((M,ee)=>l.jsx("td",{className:"p-1.5",children:ee===$&&l.jsxs("div",{className:"rounded-lg p-2 border-l-2 text-[10px]",style:{borderLeftColor:Pf[j.color||"blue"]||"var(--pc-accent)",background:"var(--pc-bg-elevated)",borderTop:"1px solid var(--pc-border)",borderRight:"1px solid var(--pc-border)",borderBottom:"1px solid var(--pc-border)"},children:[l.jsx("span",{className:"block text-[9px] font-semibold mb-0.5",style:{color:Pf[j.color||"blue"]},children:j.lane}),l.jsx("span",{style:{color:"var(--pc-text-primary)"},children:j.label}),j.sub_label&&l.jsx("div",{className:"text-[9px]",style:{color:"var(--pc-text-muted)"},children:j.sub_label}),l.jsx("div",{className:"text-[8px] mt-1 font-mono",style:{color:"var(--pc-text-faint)"},children:(j.timestamp||"").slice(0,19)})]})},M.key))]},C)})})]})}):l.jsx(ra,{message:"选择左侧 Task 或输入 ID 查看泳道图"})})]})]})}const Tm="http://127.0.0.1:8000/v1",Am="deepseek-v4-flash",Mp={baseUrl:Tm,model:Am,apiKey:""};function bi(e,a){return typeof e=="string"?e:a}function Jl(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Wb(e){try{const a=JSON.parse(e);return Jl(a)?a:{}}catch{return{}}}function yA(e){try{const a=Array.isArray(e.providers)?e.providers.filter(Jl):[],r=bi(e.activeProvider??e.active_provider,""),i=a.find(c=>c.id===r)||a[0]||{};return{baseUrl:bi(i.baseUrl??i.base_url??e.baseUrl??e.base_url,Tm),model:bi(i.model??e.model,Am),apiKey:bi(i.apiKey??i.api_key??e.apiKey??e.api_key,"")}}catch{return Mp}}function bA(e,a){const r={...a??{}},i=e.baseUrl.trim()||Tm,c=e.model.trim()||Am;if(r.baseUrl=i,r.model=c,r.apiKey=e.apiKey,Array.isArray(r.providers)){const d=r.providers.map(h=>Jl(h)?{...h}:h),u=bi(r.activeProvider??r.active_provider,"");let m=d.findIndex(h=>Jl(h)&&h.id===u);m<0&&(m=d.findIndex(Jl));const p=d[m];Jl(p)&&(p.baseUrl=i,p.model=c,p.apiKey=e.apiKey,d[m]=p,r.providers=d)}return`${JSON.stringify(r,null,2)}
|
||
`}function vA(){const[e,a]=b.useState(Mp),[r,i]=b.useState(null),[c,d]=b.useState(!0),[u,m]=b.useState(!1),[p,h]=b.useState(!1),[y,x]=b.useState("");b.useEffect(()=>{c1().then(j=>{const C=Wb(typeof j=="string"?j:"");i(C),a(yA(C))}).catch(()=>{i(null),a(Mp)}).finally(()=>d(!1))},[]);const v=async()=>{m(!0),x("");try{const j=bA(e,r);await lS(j),i(Wb(j)),h(!0),setTimeout(()=>h(!1),3e3)}catch(j){x(j instanceof Error?j.message:"保存失败")}finally{m(!1)}},k=j=>a(C=>({...C,...j}));if(c)return l.jsx("div",{className:"flex items-center justify-center h-64",children:l.jsx("div",{className:"h-8 w-8 border-2 rounded-full animate-spin",style:{borderColor:"var(--pc-border)",borderTopColor:"var(--pc-accent)"}})});const w="input-electric w-full px-4 py-3 rounded-xl text-sm",T="text-xs font-semibold mb-1.5 block";return l.jsxs("div",{className:"p-6 space-y-6 animate-fade-in max-w-2xl",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ss,{className:"h-5 w-5",style:{color:"var(--pc-accent)"}}),l.jsx("h2",{className:"text-sm font-semibold",style:{color:"var(--pc-text-primary)"},children:"设置"})]}),l.jsxs("button",{onClick:v,disabled:u,className:"btn-electric flex items-center gap-2 text-sm px-5 py-2.5",children:[l.jsx(Yj,{className:"h-4 w-4"}),u?"保存中...":"保存"]})]}),p&&l.jsxs("div",{className:"flex items-center gap-2 rounded-xl p-3 border animate-fade-in",style:{borderColor:"rgba(0, 230, 138, 0.2)",background:"rgba(0, 230, 138, 0.06)"},children:[l.jsx($i,{className:"h-4 w-4 flex-shrink-0",style:{color:"var(--color-status-success)"}}),l.jsx("span",{className:"text-sm",style:{color:"var(--color-status-success)"},children:"配置已保存并已热更新生效"})]}),y&&l.jsx("div",{className:"rounded-xl p-3 border text-sm",style:{borderColor:"rgba(255, 84, 84, 0.25)",background:"rgba(255, 84, 84, 0.08)",color:"var(--color-status-danger)"},children:y}),l.jsxs("div",{className:"card rounded-2xl p-6 space-y-5",children:[l.jsx("h3",{className:"text-sm font-semibold",style:{color:"var(--pc-text-primary)"},children:"内网模型"}),l.jsxs("div",{children:[l.jsx("label",{className:T,style:{color:"var(--pc-text-muted)"},children:"API 地址"}),l.jsx("input",{type:"text",value:e.baseUrl,onChange:j=>k({baseUrl:j.target.value}),placeholder:"http://内网模型服务/v1",className:`${w} font-mono`,style:{background:"var(--pc-bg-base)",color:"var(--pc-text-primary)",border:"1px solid var(--pc-border)"}})]}),l.jsxs("div",{children:[l.jsx("label",{className:T,style:{color:"var(--pc-text-muted)"},children:"模型名称"}),l.jsx("input",{type:"text",value:e.model,onChange:j=>k({model:j.target.value}),placeholder:"deepseek-v4-flash",className:w,style:{background:"var(--pc-bg-base)",color:"var(--pc-text-primary)",border:"1px solid var(--pc-border)"}})]}),l.jsxs("div",{children:[l.jsx("label",{className:T,style:{color:"var(--pc-text-muted)"},children:"API Key"}),l.jsx("input",{type:"text",value:e.apiKey,onChange:j=>k({apiKey:j.target.value}),placeholder:"按内网网关要求填写",className:`${w} font-mono`,style:{background:"var(--pc-bg-base)",color:"var(--pc-text-primary)",border:"1px solid var(--pc-border)"}})]})]})]})}const Hc={finance:{id:"finance",labelKey:"console.role.finance",density:"compact",tone:"strict",contentPriority:["audit","sources","exactNumbers"],motion:{defaultLevel:"none",allowParticles:!1,allowCelebrations:!1,allowDecorativeBadges:!1},actionPolicy:{requireConfirmationForDestructive:!0,showReversalHint:!0,preferOneClickApproval:!1},staleDataThresholdMs:3e4,cssVars:{"--role-accent":"#2563eb","--role-accent-soft":"rgba(37,99,235,0.12)","--role-surface-tint":"rgba(248,250,252,0.78)","--role-border":"rgba(37,99,235,0.22)","--role-focus-ring":"#1d4ed8"}},engineering:{id:"engineering",labelKey:"console.role.engineering",density:"compact",tone:"technical",contentPriority:["alarms","timestamps","reliability"],motion:{defaultLevel:"none",allowParticles:!1,allowCelebrations:!1,allowDecorativeBadges:!1},actionPolicy:{requireConfirmationForDestructive:!0,showReversalHint:!0,preferOneClickApproval:!1},staleDataThresholdMs:15e3,cssVars:{"--role-accent":"#0f766e","--role-accent-soft":"rgba(15,118,110,0.12)","--role-surface-tint":"rgba(240,253,250,0.72)","--role-border":"rgba(15,118,110,0.24)","--role-focus-ring":"#0f766e"}},executive:{id:"executive",labelKey:"console.role.executive",density:"presentation",tone:"executive",contentPriority:["kpi","approvals","exactNumbers"],motion:{defaultLevel:"minimal",allowParticles:!1,allowCelebrations:!1,allowDecorativeBadges:!1},actionPolicy:{requireConfirmationForDestructive:!0,showReversalHint:!0,preferOneClickApproval:!0},staleDataThresholdMs:6e4,cssVars:{"--role-accent":"#334155","--role-accent-soft":"rgba(51,65,85,0.10)","--role-surface-tint":"rgba(248,250,252,0.82)","--role-border":"rgba(51,65,85,0.20)","--role-focus-ring":"#475569"}},hr:{id:"hr",labelKey:"console.role.hr",density:"balanced",tone:"warm-professional",contentPriority:["queues","timestamps","approvals"],motion:{defaultLevel:"minimal",allowParticles:!1,allowCelebrations:!1,allowDecorativeBadges:!1},actionPolicy:{requireConfirmationForDestructive:!0,showReversalHint:!0,preferOneClickApproval:!1},staleDataThresholdMs:45e3,cssVars:{"--role-accent":"#7c3aed","--role-accent-soft":"rgba(124,58,237,0.10)","--role-surface-tint":"rgba(250,245,255,0.72)","--role-border":"rgba(124,58,237,0.20)","--role-focus-ring":"#6d28d9"}},sales:{id:"sales",labelKey:"console.role.sales",density:"balanced",tone:"warm-professional",contentPriority:["pipeline","sources","exactNumbers"],motion:{defaultLevel:"minimal",allowParticles:!1,allowCelebrations:!1,allowDecorativeBadges:!1},actionPolicy:{requireConfirmationForDestructive:!0,showReversalHint:!0,preferOneClickApproval:!1},staleDataThresholdMs:45e3,cssVars:{"--role-accent":"#b45309","--role-accent-soft":"rgba(180,83,9,0.10)","--role-surface-tint":"rgba(255,251,235,0.70)","--role-border":"rgba(180,83,9,0.20)","--role-focus-ring":"#92400e"}}},q0=b.createContext(null),F0="sgrobot-console-role";function kA(){try{const e=localStorage.getItem(F0);if(e&&e in Hc)return e}catch{}return"sales"}function _A({children:e}){const[a,r]=b.useState(kA),i=b.useCallback(d=>{r(d);try{localStorage.setItem(F0,d)}catch{}},[]),c=Hc[a];return l.jsx(q0.Provider,{value:{role:a,profile:c,setRole:i},children:l.jsx("div",{style:c.cssVars,"data-role":a,children:e})})}function wA(){const e=b.useContext(q0);if(!e)throw new Error("useRole must be used within RoleProvider");return e}function Xf({className:e=""}){return l.jsx("div",{className:`de-gem ${e}`,"aria-hidden":"true"})}function jA(){return l.jsxs("div",{className:"de-stage","aria-hidden":"true",children:[l.jsx("div",{className:"de-stage-glow"}),l.jsx("div",{className:"de-stage-layer de-stage-layer-1"}),l.jsx("div",{className:"de-stage-layer de-stage-layer-2"}),l.jsx("div",{className:"de-stage-layer de-stage-layer-3"})]})}function SA({avatarSrc:e,altText:a="数字员工",statusLabel:r}){return l.jsxs("div",{className:"de-avatar-container","aria-hidden":"true",children:[l.jsxs("div",{className:"de-avatar-glass-space",children:[l.jsxs("div",{className:"de-avatar-roof",children:[l.jsx("div",{className:"de-avatar-roof-face"}),l.jsx("div",{className:"de-avatar-roof-glow"})]}),l.jsx("div",{className:"de-avatar-glass-left"}),l.jsx("div",{className:"de-avatar-glass-right"}),l.jsx(Xf,{className:"de-gem-1"}),l.jsx(Xf,{className:"de-gem-2"}),l.jsx(Xf,{className:"de-gem-3"})]}),r&&l.jsx("div",{className:"de-avatar-state-label",children:r}),l.jsx("img",{src:e,alt:a,className:"de-avatar-img"}),l.jsx(jA,{})]})}const NA=Pc,CA=Vn()?"./digital-assets":`${NA}/digital-assets`,Pr=`${CA}/avatars`,EA="Asia/Shanghai",TA=["skill","browser","call","redial","evidence","decision","reporting"],AA=[{id:"all",label:"全部"},{id:"running",label:"执行中"},{id:"success",label:"已完成"},{id:"danger",label:"异常"}],I0="sgrobot:digital-workday-guide-dismissed-date",DA=80,ev=300,MA=[{title:"确认日期",body:"先确认今天的值班日期,避免把昨天或明天的任务混在一起。"},{title:"选择任务",body:"从岗位职责里勾选今天要执行的任务,未接入能力保持待扩展。"},{title:"任务执行",body:"点击任务执行后,数字员工开始按已选任务推进工作。"},{title:"查看过程",body:"右侧滚动显示运行明细,任务中心可继续查看明细。"}],zA={skill:{id:"skill",label:"查看Skill",shortLabel:"技能",phase:"查看Skill与计划",src:`${Pr}/states/employee-idle.png`,bubble:"我正在查看可用Skill、任务计划和今天要勾选的执行内容。"},browser:{id:"browser",label:"操作浏览器",shortLabel:"浏览器",phase:"操作浏览器执行",src:`${Pr}/states/employee-browser.png`,bubble:"我正在打开页面、读取信息、填写表单,并把执行过程同步到右侧。"},call:{id:"call",label:"电话外呼",shortLabel:"外呼",phase:"电话外呼与重拨",src:`${Pr}/states/employee-running.png`,bubble:"我正在按工单名单外呼现场人员,记录接通、未接通和后续重拨。"},redial:{id:"redial",label:"重拨跟进",shortLabel:"重拨",phase:"未接通人员重拨",src:`${Pr}/states/employee-redial.png`,bubble:"我正在跟进未接通人员,按间隔重拨并更新每个人的通知状态。"},evidence:{id:"evidence",label:"数据核验",shortLabel:"核验",phase:"核验执行证据",src:`${Pr}/states/employee-evidence.png`,bubble:"我正在核验页面数据、执行证据和任务结果,确认交付内容可信。"},decision:{id:"decision",label:"等待决策",shortLabel:"决策",phase:"等待人工确认",src:`${Pr}/states/employee-decision.png`,bubble:"我已完成前置处理,现在需要人工确认后再继续推进。"},reporting:{id:"reporting",label:"汇报成果",shortLabel:"汇报",phase:"汇报今日成果",src:`${Pr}/states/employee-reporting.png`,bubble:"我正在整理运行明细和日报,方便你直接查看成果和异常。"}};function zp(){const e=new Date;return[e.getFullYear(),String(e.getMonth()+1).padStart(2,"0"),String(e.getDate()).padStart(2,"0")].join("-")}function RA(e){return(e||zp()).split("-").join("/")}function Qf(e){return e==="success"?"de-badge-success":e==="danger"?"de-badge-danger":e==="warning"||e==="running"?"de-badge-warning":"de-badge-info"}function OA(e,a){const r=["de-template-card-row","de-duty-card","de-duty-card--compact"];return e.implemented||r.push("de-duty-card--disabled"),a&&r.push("de-duty-card--selected"),e.statusTone==="running"&&r.push("de-duty-card--running"),r.join(" ")}function ha(e){return String(e||"").replace(/\s+/g," ").trim()}function LA(e){if(!e)return"";if(e.expression)return e.expression;if(typeof e.schedule=="string")return e.schedule;if(e.schedule&&typeof e.schedule=="object"){const a=e.schedule,r=a.expr??a.expression??a.cron;if(typeof r=="string")return r}return""}function $A(e){const a=LA(e);if(!a)return"未定时";const r=a.trim().split(/\s+/),i=r[0]??"",c=r[1]??"";return r.length>=2&&/^\d+$/.test(i)&&/^\d+$/.test(c)?`已定时 ${c.padStart(2,"0")}:${i.padStart(2,"0")} 执行`:`调度注册 ${a}`}function qc(e,a){if(!e||typeof e!="object")return"";const r=e;for(const i of a){const c=r[i];if(typeof c=="string"&&c.trim())return c.trim()}return""}function Ql(e){const a=ha(e.template_id);if(a)return a;const r=qc(e.delivery,["template_id","plan_template_id","templateId"]);if(r)return r;const i=qc(e.schedule,["template_id","plan_template_id","templateId"]);return i||e.id.replace(/^schedule-/,"")}function BA(e,a,r){return e.has(a)||r?!0:Array.from(e).some(i=>Mi(i,a))}function Mi(e,a){return e.startsWith(`${a}-`)?/^-\d{8,}$/.test(e.slice(a.length)):!1}function UA(e,a,r){if(e.id===a||e.conversation_id===a||Mi(e.id,a)||e.conversation_id&&Mi(e.conversation_id,a))return!0;const i=ha(r).toLowerCase();return!!(i&&ha(e.title).toLowerCase()===i)}function Y0(e,a,r){const i=r.filter(c=>UA(c,e,a));return i.find(c=>c.selected)??i.find(c=>c.id===e||c.conversation_id===e)??i[0]??null}function HA(e,a){var r;return((r=Y0(e.id,e.title,a))==null?void 0:r.id)??e.id}function qA(e){return typeof e.step_count=="number"&&Number.isFinite(e.step_count)?e.step_count:Array.isArray(e.skill_ids)?e.skill_ids.length:0}function FA(e){const a=ha(e.trigger_kind||qc(e.schedule,["kind"])).toLowerCase();return a==="cron"?"定时任务":a==="webhook"?"触发任务":"手动任务"}function IA(e,a,r){const i=Ql(e),c=Y0(i,e.name,a),d=qA(e),u=Array.isArray(e.skill_ids)?e.skill_ids.length:d,m=(c==null?void 0:c.status)??e.last_status??(e.enabled?"plan_template":"disabled"),p=(c==null?void 0:c.status_label)??(e.enabled?FA(e):"已停用"),h=(c==null?void 0:c.status_tone)??(e.enabled?"info":"waiting");return{id:i,planId:i,title:ha(e.name)||i,summary:ha(e.prompt)||`任务:${i}`,implemented:e.enabled,selectable:!0,selected:r,status:m,statusLabel:p,statusTone:h,scheduleText:(c==null?void 0:c.schedule_text)??$A(e),resultText:(c==null?void 0:c.result_text)??`${d} 个步骤,${u} 个Skill`,conversationId:(c==null?void 0:c.conversation_id)??i,stepCount:d,taskCount:u,schedulerJob:e,source:"plan_template"}}function _c(e){return e.implemented}function wc(e){return e.implemented?"":"当前任务未接入执行能力。"}function YA(e,a){const r=`${e.conversation_id??""} ${e.plan_title} ${e.task_title} ${e.step_title??""} ${e.detail}`;return r.includes(a.id)||r.includes(a.title)}function GA(e,a){const r=a.filter(p=>YA(p,e)),i=r.filter(nu).length,c=r.filter(au).length,d=r.filter(tu).length,u=Math.max(r.length-i-c-d,0),m=r.length>0?r[r.length-1]:void 0;return{id:e.id,plan_id:e.planId,title:e.title,description:e.summary,selected:!0,total_count:r.length,success_count:i,failure_count:c,running_count:d,waiting_count:u,latest_status_label:(m==null?void 0:m.status_label)??e.statusLabel,latest_status_tone:(m==null?void 0:m.status_tone)??e.statusTone,business_summary:r.length>0?`${e.title} 今日执行 ${r.length} 次,成功 ${i} 次,失败 ${c} 次。`:`${e.title} 尚未产生执行记录。`,ai_summary:r.length>0?`${e.title} 今日执行 ${r.length} 次,成功 ${i} 次,失败 ${c} 次。`:`${e.title} 尚未产生执行记录。`}}function VA(e,a){const r=e.plan_id??"";return e.id===a.id||r===a.planId||Mi(e.id,a.id)||Mi(r,a.planId)?!0:ha(e.title).toLowerCase()===ha(a.title).toLowerCase()}function KA(e){return{id:e.id,time:e.time,task_name:e.plan_title,step_name:e.step_title,operation_name:e.task_title,status_label:e.status_label,status_tone:e.status_tone,business_detail:Ec(e),raw_detail:e.detail,updated_at:e.updated_at,conversation_id:e.conversation_id}}function tv(e){const[a="9",r="0"]=e.split(":"),i=Math.min(Math.max(Number(a)||9,0),23);return`${Math.min(Math.max(Number(r)||0,0),59)} ${i} * * *`}function nv(e){return e.status_label||e.status||"已同步"}function Fi(e){return String(e||"").replace(/\s+/g," ").trim()}function G0(e){const r=`${e.plan_title} ${e.step_title??""}`.match(/(?:^|\D)(\d{1,2})[::](\d{2})(?:\D|$)/);return r!=null&&r[1]&&r[2]?`${r[1].padStart(2,"0")}:${r[2]}`:Fi(e.time)||"即时触发"}function V0(e){const a=Fi(e);if(!a)return"";const r=new Date(a);if(Number.isNaN(r.getTime()))return"";const i=new Intl.DateTimeFormat("zh-CN",{timeZone:EA,month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).formatToParts(r),c=d=>{var u;return((u=i.find(m=>m.type===d))==null?void 0:u.value)??""};return`${c("month")}/${c("day")} ${c("hour")}:${c("minute")}`}function K0(e){const a=V0(e.updated_at);return a||Fi(e.time)||"待同步"}function PA(e){return V0(e.updated_at)||Fi(e.time)||"--:--"}function Ec(e){const a=Fi(e.detail).replace(/^触发来源[::]\s*$/u,"").replace(/触发来源[::]\s*(?=。|,|,|;|;|$)/u,"").trim();return a?/^runner unavailable/i.test(a)?"执行链路异常,点击查看详情。":a.length>72?`${a.slice(0,72)}...`:a:nu(e)?"真实事件已完成,结果详情未回传。":tu(e)?"真实事件执行中,等待结果回传。":au(e)?"执行异常,点击查看详情。":"结果详情待同步。"}function av(e){return`计划时间 ${G0(e)} · 执行时间 ${K0(e)}`}function XA(e,a){return a==="all"?!0:a==="running"?tu(e):a==="success"?nu(e):au(e)}function QA(e){return new Set(e.duties.filter(a=>a.selected).map(a=>a.id))}function rv(e){return["pending","requested"].includes(String(e||"").toLowerCase())}function lv(e){if(!(e instanceof Element))return!1;if(e.closest('button, a, input, select, textarea, [role="tab"]'))return!0;const a=e.closest('[role="button"]');return!!(a&&!a.classList.contains("de-workday-execution--clickable"))}function ZA(e,a){return e.length<=4?e:e.slice(a).concat(e.slice(0,a)).slice(0,4)}function tu(e){const a=`${e.status} ${e.status_tone}`.toLowerCase();return a.includes("running")||a.includes("execut")||a.includes("progress")}function nu(e){const a=`${e.status} ${e.status_tone}`.toLowerCase();return a.includes("success")||a.includes("complete")||a.includes("done")}function au(e){const a=`${e.status} ${e.status_tone}`.toLowerCase();return a.includes("danger")||a.includes("fail")||a.includes("error")||a.includes("异常")}function JA(e){const a=`${e.plan_title} ${e.task_title} ${e.step_title??""} ${e.detail}`.toLowerCase();return["外呼","电话","拨打","接通","未接通","重拨","人员"].some(r=>a.includes(r))}function WA(e){const a=`${e.plan_title} ${e.task_title} ${e.step_title??""} ${e.detail}`.toLowerCase();return["重拨","未接通","再拨","回拨","retry","callback"].some(r=>a.includes(r))}function e8(e){const a=`${e.plan_title} ${e.task_title} ${e.step_title??""} ${e.detail}`.toLowerCase();return["核验","校验","证据","汇总","报告","结果","交付","看板","同步"].some(r=>a.includes(r))}function t8(){if(typeof window>"u")return null;const e=new URLSearchParams(window.location.search).get("visual");return TA.includes(e)?e:null}function n8(e){return WA(e)?"redial":JA(e)?"call":e8(e)?"evidence":"browser"}function a8(e){return e.currentEvent?n8(e.currentEvent):!e.confirmed&&e.eventsCount===0?"skill":e.pendingDecisionCount>0?"decision":e.eventsCount>0?"browser":"skill"}const sv="真实审批链路待接入";function r8(){if(typeof window>"u")return null;try{return window.sessionStorage.getItem(I0)}catch{return null}}function l8(e){if(!(typeof window>"u"))try{window.sessionStorage.setItem(I0,e)}catch{}}function s8({onNavigate:e}){var ya;const[a,r]=b.useState(zp()),[i,c]=b.useState(null),[d,u]=b.useState([]),[m,p]=b.useState(new Set),[h,y]=b.useState(!0),[x,v]=b.useState(null),[k,w]=b.useState(null),[T,j]=b.useState(null),[C,$]=b.useState(null),[M,ee]=b.useState(!1),[ne,A]=b.useState("selected"),[G,V]=b.useState(0),[oe,Y]=b.useState(!1),[F,I]=b.useState(!1),[Q,le]=b.useState(!1),[B,L]=b.useState(null),[q,ce]=b.useState("all"),[ge,N]=b.useState(!1),[z,K]=b.useState(null),[E,pe]=b.useState(null),[ke,ve]=b.useState("09:00"),[ze,me]=b.useState(!1),[D,U]=b.useState(!1),[be,Ne]=b.useState({name:"",company:"",position:"",currentStatus:"working"}),[$e,Ce]=b.useState("18:00"),[nt,Be]=b.useState(!1),[Ve,ct]=b.useState(()=>r8()),Ee=b.useRef(!1),Et=b.useRef(!1);b.useEffect(()=>(Ee.current=!0,()=>{Ee.current=!1}),[]);const ft=b.useCallback(async()=>{let R=null,_e=null;const Fe=()=>{if(Et.current||!_e)return;const Vt=(R==null?void 0:R.source)==="live"?QA(R):new Set,_n=_e.map(Jn=>Ql(Jn)).filter(Jn=>BA(Vt,Jn)),Er=_n.length>0?_n:_e.slice(0,3).map(Jn=>Ql(Jn));p(new Set(Er))},Tt=fp(a).then(Vt=>{Ee.current&&(R=Vt,c(Vt),j(null),Fe())}).catch(Vt=>{Ee.current&&j(Vt instanceof Error?Vt.message:"数字员工首页数据同步失败")}),en=Ei().then(Vt=>{Ee.current&&(_e=Vt.filter(_n=>_n.job_type==="plan_template"||qc(_n.delivery,["mode"])==="plan_template"),u(_e),$(null),Fe())}).catch(Vt=>{Ee.current&&$(Vt instanceof Error?Vt.message:"任务加载失败")});await Promise.allSettled([Tt,en]),Ee.current&&y(!1)},[a]);b.useEffect(()=>{y(!0),ft()},[ft]),b.useEffect(()=>{const R=i!=null&&i.workday.confirmed?8e3:3e4,_e=window.setInterval(()=>{ft()},R);return()=>window.clearInterval(_e)},[ft,i==null?void 0:i.workday.confirmed]),b.useEffect(()=>{if(oe||F||Q||B!==null)return;const _e=window.setInterval(()=>{V(Fe=>{const Tt=(i==null?void 0:i.source)==="live"?i.events.length:0;return Tt>0?(Fe+1)%Tt:0})},3200);return()=>window.clearInterval(_e)},[Q,F,oe,B,i==null?void 0:i.events.length,i==null?void 0:i.source]);const vn=(i==null?void 0:i.source)==="live",Pn=b.useMemo(()=>vn?(i==null?void 0:i.duties)??[]:[],[vn,i==null?void 0:i.duties]),pt=b.useMemo(()=>d.slice().sort((R,_e)=>{const Fe=Ql(R),Tt=Ql(_e),en=m.has(Fe)?1:0,Vt=m.has(Tt)?1:0;if(en!==Vt)return Vt-en;const _n=new Date(R.next_run||"").getTime(),Er=new Date(_e.next_run||"").getTime(),Jn=Number.isFinite(_n),Tr=Number.isFinite(Er);return Jn!==Tr?Jn?-1:1:Jn&&Tr&&_n!==Er?_n-Er:ha(R.name).localeCompare(ha(_e.name),"zh-CN")}).map(R=>{const _e=Ql(R);return IA(R,Pn,m.has(_e))}),[Pn,d,m]),Ft=b.useMemo(()=>pt.filter(R=>m.has(R.id)),[pt,m]),se=b.useMemo(()=>Ft.map(R=>HA(R,Pn)),[Pn,Ft]),he=pt,Te=pt.filter(R=>!m.has(R.id)),X=ne==="selected"?Ft:ne==="pending"?Te:he,re=vn?(i==null?void 0:i.events)??[]:[],ue=ZA(re,G),Ue=re,Ae=(vn?(i==null?void 0:i.decisions)??[]:[]).filter(R=>rv(R.status)),Le=oe||F||Q||B!==null,je=b.useMemo(()=>re.filter(R=>XA(R,q)),[re,q]),Me=je.slice(0,ev),Rt=re.filter(tu),wt=re.filter(nu),kn=re.filter(au),Pt=ue[0]??Rt[0]??null,ot=i==null?void 0:i.employee,Ke=i==null?void 0:i.workday,Xn=i==null?void 0:i.delivery,He=vn?i==null?void 0:i.daily_report:void 0,Fa=vn?(ya=i==null?void 0:i.run_details)!=null&&ya.length?i.run_details:re.map(KA):[],hs=Fa.slice(0,DA),Ii=vn?(i==null?void 0:i.execution_summaries)??[]:[],sa=Ft.map(R=>Ii.find(_e=>VA(_e,R))??GA(R,re)),Qn=RA(a),su=ne==="all"?"全部任务":ne==="pending"?"待选择任务":"今日已选任务",Yi=ne==="all"?`总任务 ${he.length} 项,不代表当天都会执行。`:ne==="pending"?`当前日期 ${Qn} 还有 ${Te.length} 项未选择。`:`当前日期 ${Qn} 已选择 ${Ft.length} 项任务。`,ln=(He==null?void 0:He.status)==="ready"?He.totals:null,Gi=(ln==null?void 0:ln.task_count)??sa.length,gs=(ln==null?void 0:ln.execution_count)??sa.reduce((R,_e)=>R+_e.total_count,0),xs=(ln==null?void 0:ln.success_count)??sa.reduce((R,_e)=>R+_e.success_count,0),Vi=(ln==null?void 0:ln.failure_count)??sa.reduce((R,_e)=>R+_e.failure_count,0),ol=He?[He.summary,...He.detail_lines??[]].filter(R=>!!(R&&R.trim())):[],Zn=(He==null?void 0:He.status)==="ready"&&ol.length>0,Ot=(Ke==null?void 0:Ke.current_status)??(ot==null?void 0:ot.current_status)??"working",Wt=(Ke==null?void 0:Ke.current_status_label)??(ot==null?void 0:ot.current_status_label)??(Ot==="resting"?"休息中":"工作中"),ia=Ot==="resting",cl=(i==null?void 0:i.source)==="demo",ys=cl?"演示兜底":"真实数据",Ki=cl?"de-badge-warning":"de-badge-success",Pi=a8({confirmed:!!(Ke!=null&&Ke.confirmed),currentEvent:Pt,pendingDecisionCount:Ae.length,eventsCount:re.length}),Ia=t8(),On=zA[Ia??Pi],Ya=Ia||Pt||Ae.length>0?On.bubble:(Ke==null?void 0:Ke.bubble_text)??On.bubble,Nr=he.length>0?`已加载 ${he.length} 项任务,当前选择 ${Ft.length} 项;右侧展示真实执行状态、运行明细和日报。`:(Ke==null?void 0:Ke.summary)??"等待同步当天任务计划。",Ga=(Pt==null?void 0:Pt.task_title)??(Ke!=null&&Ke.confirmed?"等待下一条执行事件":"等待确认任务设置"),Lt=Pt?`${Pt.plan_title}:${Ec(Pt)}(${av(Pt)})`:"任务执行后会显示正在处理的任务、步骤或汇总动作。",Qi=Ae[0]?`等待人工确认:${Ae[0].title}`:Ke!=null&&Ke.confirmed?(Xn==null?void 0:Xn.lines[0])??"继续按计划轮询新工单,并把结果同步到运行明细。":"请先确认今天要执行的任务,确认后数字员工会开始执行。",Zi=!!(i&&!(Ke!=null&&Ke.confirmed));b.useEffect(()=>{if(!(h||!i)&&i.workday.confirmed){Be(!1);return}},[Ve,h,a,i]),b.useEffect(()=>{ot&&Ne({name:ot.name||"",company:ot.company||"",position:ot.position||ot.major||"",currentStatus:ot.current_status||(Ke==null?void 0:Ke.current_status)||"working"})},[ot,Ke==null?void 0:Ke.current_status]),b.useEffect(()=>{Ce((He==null?void 0:He.report_schedule_time)||"18:00")},[He==null?void 0:He.report_schedule_time]),b.useEffect(()=>{U(!1)},[a]);const oa=b.useCallback(R=>{!R.selectable||!R.implemented||(p(_e=>{const Fe=new Set(_e);return Fe.has(R.id)?Fe.delete(R.id):Fe.add(R.id),Fe}),Et.current=!0,ee(!0),w(null))},[]),xa=b.useCallback(async()=>{if(m.size===0){j("请至少选择一项今天要执行的任务。");return}if(ia){j("当前状态为休息中,请切换为工作中后再执行任务。");return}v("confirm_workday"),j(null),w(null);try{const R=await Zl({action:"confirm_workday",date:a,duty_ids:se});if(!Ee.current)return;c(R),p(new Set(m)),Et.current=!0,ee(!1),Be(!1),w("任务设置已确认,数字员工开始按任务执行。")}catch(R){Ee.current&&j(R instanceof Error?R.message:"确认任务设置失败")}finally{Ee.current&&v(null)}},[ia,a,m,se]),iu=b.useCallback(()=>{p(new Set),Et.current=!0,ee(!0),w("已一键取消当前选择,重新选择后点击任务执行生效。"),j(null)},[]),Ji=b.useCallback(async()=>{v("update_profile"),j(null),w(null);try{const R=await Zl({action:"update_profile",date:a,name:be.name,company:be.company,position:be.position,current_status:be.currentStatus});if(!Ee.current)return;c(R),me(!1),w("数字员工特性设置已保存。")}catch(R){Ee.current&&j(R instanceof Error?R.message:"保存特性设置失败")}finally{Ee.current&&v(null)}},[be,a]),Wi=b.useCallback(async()=>{v("update_report_schedule"),j(null),w(null);try{const R=await Zl({action:"update_report_schedule",date:a,report_schedule_time:$e});if(!Ee.current)return;c(R),w(`日报生成时间已设置为 ${$e}。`)}catch(R){Ee.current&&j(R instanceof Error?R.message:"设置日报时间失败")}finally{Ee.current&&v(null)}},[$e,a]),ou=b.useCallback(async()=>{var R,_e;v("generate_daily_report"),j(null),w(null);try{const Fe=await Zl({action:"generate_daily_report",date:a,duty_ids:se,report_schedule_time:$e});if(!Ee.current)return;const Tt=((R=Fe.daily_report)==null?void 0:R.status)==="ready"?Fe:await fp(a);if(!Ee.current)return;c(Tt),w("日报已生成,可下载 PDF。"),((_e=Tt.daily_report)==null?void 0:_e.status)==="ready"&&U(!0)}catch(Fe){Ee.current&&j(Fe instanceof Error?Fe.message:"生成日报失败")}finally{Ee.current&&v(null)}},[$e,a,m,se]),Cr=b.useCallback(()=>{window.open(f1(a),"_blank","noopener,noreferrer")},[a]),ul=b.useCallback(async(R,_e)=>{var Fe;v(`${R.id}:${_e}`),j(null),w(null);try{if(!Ee.current)return;const Tt=((Fe=R.actions.find(en=>en.id===_e))==null?void 0:Fe.label)??_e;w(`待实现:已触发“${Tt}”演示效果,${sv},未改动后端审批或执行状态。`)}catch(Tt){Ee.current&&j(Tt instanceof Error?Tt.message:"处理决策失败")}finally{Ee.current&&v(null)}},[]),cn=b.useCallback(R=>{e({tab:"missions",date:a,missionId:R.conversationId||R.id})},[e,a]),un=b.useCallback(async R=>{const _e=tv(ke),Fe=Date.now(),Tt=`digital-home-${R.planId}-${ke.replace(":","")}`;v(`schedule:${R.id}`),j(null),w(null);try{const en=await ma({command_kind:"create_schedule",context_refs:{plan_id:R.planId,schedule_id:Tt},payload:{source:"digital-home",plan_id:R.planId,name:`定时执行:${R.title}`,description:`按首页任务管理定时任务:${R.title}`,prompt:`请按计划执行:${R.title}。${R.summary}`,cron_expr:_e,schedule:_e},correlation_id:`digital-home-create-schedule-${R.planId}-${Fe}`,idempotency_key:`digital-home-create-schedule-${R.planId}-${ke}-${Fe}`});if(!en.accepted)throw new Error(en.message||`调度命令未被接受:${en.command_id||"create_schedule"}`);K(null),w(`已提交定时:${R.title},${ke} 按 cron 计划执行。`),await ft()}catch(en){Ee.current&&j(en instanceof Error?en.message:"定时执行失败")}finally{Ee.current&&v(null)}},[ft,ke]),eo=b.useCallback(async R=>{var _e;if(!_c(R)){j(wc(R)),w(null);return}v(`execute:${R.id}`),j(null),w(null);try{const Fe=await vS(R.planId);if(Fe.ok!==!0)throw new Error(Fe.error||"执行接口未接受请求");const Tt=((_e=Fe.dispatched_tasks)==null?void 0:_e.length)??0;pe(null),w(`已触发执行:${R.title},已派发 ${Tt} 个步骤。`),await ft()}catch(Fe){Ee.current&&j(Fe instanceof Error?Fe.message:"执行失败")}finally{Ee.current&&v(null)}},[ft]),bs=b.useCallback(()=>{Be(!1),ct(a),l8(a)},[a]),dl=b.useCallback((R,_e)=>{const Fe=m.has(R.id),Tt=wc(R);return l.jsxs("div",{className:`${OA(R,Fe)} ${_e==="guide"?"de-duty-card--guide":""}`,title:R.summary,children:[l.jsxs("label",{className:"de-task-manager-duty-check",children:[l.jsx("input",{type:"checkbox",checked:Fe,disabled:!R.selectable||!R.implemented,onChange:()=>oa(R)}),l.jsx("span",{children:Fe?"已选":R.implemented?"未选":"待扩展"})]}),l.jsxs("div",{className:"de-template-card-main",children:[l.jsxs("div",{className:"de-template-card-head",children:[l.jsx("span",{className:"de-template-card-name",children:R.title}),l.jsx("span",{className:`de-badge ${Qf(R.statusTone)}`,children:R.implemented?R.statusLabel:"待扩展"})]}),l.jsx("p",{className:"de-template-card-desc",children:R.summary}),l.jsxs("div",{className:"de-template-card-meta",children:[l.jsx("span",{children:R.scheduleText}),l.jsx("span",{children:R.resultText})]}),l.jsxs("div",{className:"de-duty-card-foot",children:[l.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:!R.implemented,onClick:()=>cn(R),children:"进入处理"}),l.jsxs("div",{className:"de-duty-card-actions",children:[l.jsxs("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:!R.implemented||x===`schedule:${R.id}`,onClick:()=>K(R),children:[l.jsx(op,{size:13,"aria-hidden":"true"}),l.jsx("span",{children:"定时"})]}),l.jsxs("button",{type:"button",className:"de-btn-primary de-btn-sm",disabled:!R.implemented||x===`execute:${R.id}`,title:Tt||"立即执行此任务",onClick:()=>pe(R),children:[l.jsx(ip,{size:13,"aria-hidden":"true"}),l.jsx("span",{children:"执行"})]})]}),!R.implemented&&l.jsx("span",{className:"de-duty-selected-mark",children:"待扩展"})]})]})]},`${_e}-${R.id}`)},[x,cn,m,oa]),to=b.useCallback(R=>{L(R),I(!0)},[]),Va=b.useCallback(()=>{L(null),I(!1)},[]),no=b.useCallback(()=>{le(!1),I(!1)},[]),It=b.useCallback(()=>{le(!0),I(!0)},[]),vs=b.useCallback(R=>{lv(R.target)||It()},[It]),ao=b.useCallback(R=>{R.key!=="Enter"&&R.key!==" "||lv(R.target)||(R.preventDefault(),It())},[It]),ks=b.useCallback(R=>{L(null),le(!1),I(!1),e({tab:"missions",date:a,missionId:R.conversation_id||R.id})},[e,a]);return l.jsxs("div",{className:"de-dashboard de-dashboard--compact",style:{position:"relative",height:"100%",minHeight:0,display:"flex",flexDirection:"column",overflow:"hidden"},children:[l.jsx("div",{className:"de-connection-layer","aria-hidden":"true",children:l.jsxs("svg",{className:"de-connection-svg",viewBox:"0 0 1200 800",preserveAspectRatio:"none",children:[l.jsxs("defs",{children:[l.jsxs("linearGradient",{id:"connGrad1",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[l.jsx("stop",{offset:"0%",stopColor:"rgba(79,172,254,0.25)"}),l.jsx("stop",{offset:"100%",stopColor:"rgba(0,242,254,0.1)"})]}),l.jsx("filter",{id:"connGlow",children:l.jsx("feGaussianBlur",{stdDeviation:"3"})})]}),l.jsx("path",{d:"M 80 180 Q 420 400, 580 350",stroke:"url(#connGrad1)",strokeWidth:"1.5",fill:"none",filter:"url(#connGlow)"}),l.jsx("path",{d:"M 120 620 Q 380 400, 560 380",stroke:"url(#connGrad1)",strokeWidth:"1.2",fill:"none",filter:"url(#connGlow)"}),l.jsx("path",{d:"M 640 360 Q 780 200, 1100 160",stroke:"url(#connGrad1)",strokeWidth:"1.3",fill:"none",filter:"url(#connGlow)"})]})}),l.jsxs("div",{className:"de-dashboard-content",children:[l.jsxs("div",{className:"de-dashboard-left",children:[l.jsxs("div",{className:"de-card de-person-card de-person-card--compact",children:[l.jsxs("div",{className:"de-card-title-bar",children:[l.jsx("span",{className:"de-card-title-bar-text",children:"数字员工"}),l.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",onClick:()=>me(!0),children:"特性设置"})]}),l.jsx("div",{className:"de-card-body",children:l.jsxs("div",{className:"de-info-grid",children:[l.jsxs("div",{className:"de-info-item",children:[l.jsx("label",{children:"姓名"}),l.jsx("span",{children:(ot==null?void 0:ot.name)??"同步中"})]}),l.jsxs("div",{className:"de-info-item",children:[l.jsx("label",{children:"单位"}),l.jsx("span",{children:(ot==null?void 0:ot.company)??"同步中"})]}),l.jsxs("div",{className:"de-info-item",children:[l.jsx("label",{children:"岗位"}),l.jsx("span",{children:(ot==null?void 0:ot.position)??(ot==null?void 0:ot.major)??"同步中"})]}),l.jsxs("div",{className:"de-info-item",children:[l.jsx("label",{children:"当前状态"}),l.jsx("span",{className:ia?"de-status-resting":"de-status-working",children:Wt})]})]})})]}),l.jsxs("div",{className:"de-card de-template-manager-card",children:[l.jsx("div",{className:"de-card-title-bar",children:l.jsx("span",{className:"de-card-title-bar-text",children:"任务设置"})}),l.jsxs("div",{className:"de-card-body de-template-manager-body",children:[l.jsxs("div",{className:"de-workday-toolbar",children:[l.jsxs("label",{children:[l.jsx("span",{children:"日期"}),l.jsx("input",{type:"date",value:a,onChange:R=>{Et.current=!1,ee(!1),w(null),r(R.target.value||zp())}})]}),l.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:h,onClick:()=>N(!0),children:"任务设置"})]}),(k||T||C||(i==null?void 0:i.demo_reason))&&l.jsx("div",{className:`de-schedule-result ${T?"de-schedule-result--error":"de-schedule-result--success"}`,style:{marginBottom:10},children:T||k||C||(i==null?void 0:i.demo_reason)}),M&&!k&&!T&&l.jsx("div",{className:"de-schedule-result de-schedule-result--success",style:{marginBottom:10},children:"当前选择尚未确认,自动刷新不会覆盖你的勾选。"}),l.jsxs("div",{className:"de-template-overview",children:[l.jsxs("button",{type:"button",className:`de-template-overview-item de-template-overview-item--total ${ne==="all"?"active":""}`,onClick:()=>A("all"),children:[l.jsx("span",{className:"de-template-overview-label",children:"总任务"}),l.jsx("span",{className:"de-template-overview-value",children:he.length})]}),l.jsxs("button",{type:"button",className:`de-template-overview-item de-template-overview-item--scheduled ${ne==="selected"?"active":""}`,onClick:()=>A("selected"),children:[l.jsx("span",{className:"de-template-overview-label",children:"已选择"}),l.jsx("span",{className:"de-template-overview-value",children:Ft.length})]}),l.jsxs("button",{type:"button",className:`de-template-overview-item de-template-overview-item--runnable ${ne==="pending"?"active":""}`,onClick:()=>A("pending"),children:[l.jsx("span",{className:"de-template-overview-label",children:"待选择"}),l.jsx("span",{className:"de-template-overview-value",children:Te.length})]})]}),l.jsxs("div",{className:"de-task-date-context",children:[l.jsxs("span",{children:["当前日期 ",Qn]}),l.jsx("em",{children:Yi}),l.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",onClick:iu,disabled:Ft.length===0,children:"一键取消"})]}),l.jsxs("div",{className:"de-task-manager-preview de-task-manager-preview-scroll de-template-task-list",children:[l.jsxs("div",{className:"de-task-manager-preview-head",children:[l.jsx("span",{children:Qn}),l.jsxs("strong",{children:[su," ",X.length]})]}),h?l.jsx("div",{className:"de-loading-skeleton",style:{height:96}}):pt.length===0?l.jsx("p",{className:"de-empty-text",children:"暂无任务,首页不会再展示硬编码任务。"}):X.length===0?l.jsx("p",{className:"de-empty-text",children:"当前筛选下暂无任务,点击总任务查看全部内容。"}):X.map(R=>l.jsxs("div",{className:`de-task-manager-preview-row ${m.has(R.id)?"is-selected":""}`,title:R.summary,children:[l.jsxs("button",{type:"button",className:"de-template-task-main",onClick:()=>cn(R),children:[l.jsx("strong",{children:R.title}),l.jsx("span",{children:R.resultText})]}),l.jsxs("div",{className:"de-template-item-actions",children:[l.jsxs("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:!R.implemented||x===`schedule:${R.id}`,onClick:()=>K(R),children:[l.jsx(op,{size:13,"aria-hidden":"true"}),l.jsx("span",{children:"定时"})]}),l.jsxs("button",{type:"button",className:"de-btn-primary de-btn-sm",disabled:!R.implemented||x===`execute:${R.id}`,title:wc(R)||"立即执行此任务",onClick:()=>pe(R),children:[l.jsx(ip,{size:13,"aria-hidden":"true"}),l.jsx("span",{children:"执行"})]})]})]},R.id))]})]})]})]}),l.jsxs("div",{className:"de-dashboard-center",style:{justifyContent:"center",padding:"0 0 16px",overflow:"visible"},children:[l.jsx("div",{className:"de-avatar-wrapper",style:{minHeight:470,maxWidth:560,transform:"translateY(-6px)",display:"flex",alignItems:"flex-end",justifyContent:"center"},children:l.jsx(SA,{avatarSrc:On.src,altText:`数字员工-${On.label}`,statusLabel:On.label})}),l.jsxs("div",{className:"de-speech-bubble de-speech-bubble--employee",style:{top:"38%",left:"29%",right:"auto",transform:"translateX(-50%)",width:268,padding:"10px 12px",zIndex:16},children:[l.jsx("span",{className:"de-speech-label",children:"数字员工播报"}),l.jsx("p",{className:"de-speech-text",children:Ya}),l.jsxs("button",{type:"button",className:"de-speech-workflow de-execution-detail-trigger",onClick:It,title:"打开运行明细",children:[l.jsx("span",{children:"当前动作"}),l.jsx("strong",{children:Ga}),l.jsx("small",{children:Lt}),l.jsx("span",{children:"下一步"}),l.jsx("small",{children:Qi})]})]})]}),l.jsx("div",{className:"de-dashboard-right",children:l.jsxs("div",{className:"de-right-panels",children:[l.jsxs("div",{className:"de-workbench de-workday-execution de-workday-execution--clickable",role:"button",tabIndex:0,"aria-label":"打开运行明细",title:"打开运行明细",onClick:vs,onKeyDown:ao,children:[l.jsxs("div",{className:"de-card-title-bar de-workbench-head de-workbench-head--bar",children:[l.jsx("div",{className:"de-workbench-title-row",children:l.jsx("h3",{children:"今日执行"})}),l.jsx("span",{className:`de-badge ${Ki}`,children:ys})]}),l.jsxs("div",{className:"de-workday-execution-body","aria-live":"polite",children:[l.jsxs("div",{className:"de-execution-status-strip",children:[l.jsxs("span",{children:[l.jsx("em",{children:"已选任务"}),l.jsx("strong",{children:Ft.length})]}),l.jsxs("span",{children:[l.jsx("em",{children:"运行记录"}),l.jsx("strong",{children:Ue.length})]}),l.jsxs("span",{children:[l.jsx("em",{children:"已完成"}),l.jsx("strong",{children:wt.length})]}),l.jsxs("span",{children:[l.jsx("em",{children:"异常"}),l.jsx("strong",{children:kn.length})]})]}),l.jsx("div",{className:"de-task-summary-scroll",children:l.jsx("div",{className:"de-task-summary-grid","aria-label":"任务执行汇总",children:sa.length===0?l.jsx("p",{className:"de-empty-text",children:"左侧选择任务后,这里会按任务生成执行次数和成功情况。"}):sa.map(R=>l.jsxs("button",{type:"button",className:`de-task-summary-card de-live-feed-row--${R.latest_status_tone||"info"}`,onClick:()=>cn(Ft.find(_e=>_e.id===R.id)??Ft[0]),title:[R.description,R.ai_summary||R.business_summary].filter(Boolean).join(`
|
||
`),children:[l.jsx("span",{className:"de-task-summary-title",children:R.title}),l.jsx("span",{className:`de-badge ${Qf(R.latest_status_tone)}`,children:R.latest_status_label}),l.jsxs("div",{className:"de-task-summary-counts",children:[l.jsxs("span",{children:[l.jsx("em",{children:"执行"}),l.jsx("strong",{children:R.total_count})]}),l.jsxs("span",{children:[l.jsx("em",{children:"成功"}),l.jsx("strong",{children:R.success_count})]}),l.jsxs("span",{children:[l.jsx("em",{children:"失败"}),l.jsx("strong",{children:R.failure_count})]})]})]},R.id))})}),l.jsxs("div",{className:"de-stage-feed-tools",children:[l.jsxs("span",{children:["展示 ",Ue.length," / 共 ",re.length," 条",Le?" · 已暂停":" · 自动滚动"]}),l.jsxs("div",{children:[l.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",onClick:()=>Y(R=>!R),children:oe?"继续滚动":"暂停滚动"}),l.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",onClick:It,children:"查看全部记录"})]})]}),l.jsxs("div",{className:"de-run-detail-panel",children:[l.jsxs("div",{className:"de-run-detail-head",children:[l.jsx("span",{children:"运行明细"}),l.jsxs("small",{children:["展示 ",hs.length," / 共 ",Fa.length," 条"]})]}),l.jsxs("div",{className:"de-run-detail-list de-run-detail-list-scroll","aria-label":"运行明细",children:[l.jsxs("div",{className:"de-run-detail-row de-run-detail-row--head",children:[l.jsx("span",{children:"时间"}),l.jsx("span",{children:"任务名称"}),l.jsx("span",{children:"步骤名称"}),l.jsx("span",{children:"执行状态"}),l.jsx("span",{children:"结果"})]}),hs.length===0?l.jsx("p",{className:"de-empty-text",children:"任务执行后,这里会滚动显示每个步骤的时间、任务、步骤和结果。"}):hs.map(R=>l.jsxs("button",{type:"button",className:`de-run-detail-row de-live-feed-row--${R.status_tone||"info"}`,onClick:()=>{const _e=re.find(Fe=>Fe.id===R.id);_e&&to(_e)},title:R.business_detail,children:[l.jsx("span",{children:PA(R)}),l.jsx("strong",{children:R.task_name}),l.jsx("span",{children:R.step_name||R.operation_name||"执行步骤"}),l.jsx("span",{children:l.jsx("i",{className:`de-badge ${Qf(R.status_tone)}`,children:R.status_label})}),l.jsx("em",{children:R.business_detail})]},R.id))]})]})]})]}),l.jsxs("div",{className:"de-report-summary",children:[l.jsxs("div",{className:"de-card-title-bar de-report-summary-head de-report-summary-head--bar",children:[l.jsx("div",{className:"de-report-summary-title-row",children:l.jsx("h3",{children:"日报生成"})}),l.jsx("span",{className:`de-report-badge ${(He==null?void 0:He.status)==="ready"?"de-report-badge--ready":"de-report-badge--waiting"}`,children:(He==null?void 0:He.status)==="ready"?"已生成":"待生成"})]}),l.jsxs("div",{className:"de-report-summary-body",children:[l.jsxs("div",{className:"de-report-schedule-row",children:[l.jsxs("label",{children:[l.jsx("span",{children:"生成时间"}),l.jsx("input",{type:"time",value:$e,onChange:R=>Ce(R.target.value||"18:00")})]}),l.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:x==="update_report_schedule",onClick:()=>{Wi()},children:"设置时间"}),l.jsx("button",{type:"button",className:"de-btn-primary de-btn-sm",disabled:x==="generate_daily_report",onClick:()=>{ou()},children:x==="generate_daily_report"?"生成中...":"生成日报"}),l.jsxs("button",{type:"button",className:"de-btn-secondary de-btn-sm de-report-preview-btn",disabled:!Zn,onClick:()=>U(!0),title:Zn?"预览日报文字内容":"生成日报后可预览文字内容",children:[l.jsx(Nj,{size:14,"aria-hidden":"true"}),"预览日报"]}),l.jsxs("button",{type:"button",className:"de-btn-secondary de-btn-sm de-report-download-btn",disabled:!(He!=null&&He.pdf_available),onClick:Cr,title:He!=null&&He.pdf_available?"下载日报 PDF":"生成日报后可下载日报 PDF",children:[l.jsx(cp,{size:14,"aria-hidden":"true"}),"下载日报"]})]}),l.jsxs("div",{className:"de-report-meta",children:[l.jsx("p",{children:(He==null?void 0:He.summary)??"点击生成日报后,AI 会基于当天所有任务写出总分结构日报。"}),((He==null?void 0:He.detail_lines)??[]).slice(0,3).map(R=>l.jsx("p",{children:R},R))]})]})]})]})})]}),D&&He&&l.jsx("div",{className:"de-task-manager-modal-overlay de-report-preview-overlay",role:"presentation",onClick:()=>U(!1),children:l.jsxs("div",{className:"de-report-preview-modal",role:"dialog","aria-modal":"true","aria-label":"日报预览",onClick:R=>R.stopPropagation(),children:[l.jsxs("div",{className:"de-task-manager-modal-head",children:[l.jsxs("div",{children:[l.jsx("span",{className:"de-drawer-eyebrow",children:"DAILY REPORT"}),l.jsx("h3",{children:He.title||"数字员工日报"}),l.jsxs("p",{children:[Qn," 生成时间 ",He.report_schedule_time,",来源:",He.generated_by==="ai"?"AI 生成":"规则兜底"]})]}),l.jsx("button",{type:"button",className:"de-schedule-close",onClick:()=>U(!1),children:"×"})]}),l.jsxs("div",{className:"de-report-preview-summary",children:[l.jsxs("div",{children:[l.jsx("span",{children:"任务总数"}),l.jsx("strong",{children:Gi})]}),l.jsxs("div",{children:[l.jsx("span",{children:"执行次数"}),l.jsx("strong",{children:gs})]}),l.jsxs("div",{children:[l.jsx("span",{children:"成功次数"}),l.jsx("strong",{children:xs})]}),l.jsxs("div",{children:[l.jsx("span",{children:"失败次数"}),l.jsx("strong",{children:Vi})]})]}),l.jsx("div",{className:"de-report-preview-content",children:ol.length===0?l.jsx("p",{className:"de-empty-text",children:"当前日报暂无可预览文字。"}):ol.map((R,_e)=>l.jsx("p",{children:R},`${_e}-${R}`))}),l.jsxs("div",{className:"de-event-modal-actions",children:[l.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",onClick:()=>U(!1),children:"关闭"}),l.jsxs("button",{type:"button",className:"de-btn-secondary de-btn-sm de-report-download-btn",disabled:!He.pdf_available,onClick:Cr,children:[l.jsx(cp,{size:14,"aria-hidden":"true"}),"下载日报"]})]})]})}),ze&&l.jsx("div",{className:"de-task-manager-modal-overlay",role:"presentation",onClick:()=>me(!1),children:l.jsxs("div",{className:"de-profile-settings-modal",role:"dialog","aria-modal":"true","aria-label":"数字员工特性设置",onClick:R=>R.stopPropagation(),children:[l.jsxs("div",{className:"de-task-manager-modal-head",children:[l.jsxs("div",{children:[l.jsx("span",{className:"de-drawer-eyebrow",children:"PROFILE"}),l.jsx("h3",{children:"特性设置"}),l.jsx("p",{children:"维护数字员工在首页展示的姓名、单位、岗位和当前状态。"})]}),l.jsx("button",{type:"button",className:"de-schedule-close",onClick:()=>me(!1),children:"×"})]}),l.jsxs("div",{className:"de-profile-settings-grid",children:[l.jsxs("label",{children:[l.jsx("span",{children:"姓名"}),l.jsx("input",{value:be.name,onChange:R=>Ne(_e=>({..._e,name:R.target.value}))})]}),l.jsxs("label",{children:[l.jsx("span",{children:"单位"}),l.jsx("input",{value:be.company,onChange:R=>Ne(_e=>({..._e,company:R.target.value}))})]}),l.jsxs("label",{children:[l.jsx("span",{children:"岗位"}),l.jsx("input",{value:be.position,onChange:R=>Ne(_e=>({..._e,position:R.target.value}))})]}),l.jsxs("div",{className:"de-profile-status-toggle",children:[l.jsx("span",{children:"当前状态"}),l.jsxs("div",{children:[l.jsx("button",{type:"button",className:be.currentStatus==="working"?"active":"",onClick:()=>Ne(R=>({...R,currentStatus:"working"})),children:"工作中"}),l.jsx("button",{type:"button",className:be.currentStatus==="resting"?"active":"",onClick:()=>Ne(R=>({...R,currentStatus:"resting"})),children:"休息中"})]})]})]}),l.jsxs("div",{className:"de-event-modal-actions",children:[l.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",onClick:()=>me(!1),children:"取消"}),l.jsx("button",{type:"button",className:"de-btn-primary de-btn-sm",disabled:x==="update_profile",onClick:()=>{Ji()},children:x==="update_profile"?"保存中...":"保存设置"})]})]})}),B&&l.jsx("div",{className:"de-task-manager-modal-overlay",role:"presentation",onClick:Va,children:l.jsxs("div",{className:"de-event-detail-modal",role:"dialog","aria-modal":"true","aria-label":"执行记录详情",onClick:R=>R.stopPropagation(),children:[l.jsxs("div",{className:"de-task-manager-modal-head",children:[l.jsxs("div",{children:[l.jsx("span",{className:"de-drawer-eyebrow",children:"EXECUTION DETAIL"}),l.jsx("h3",{children:"执行记录详情"}),l.jsx("p",{children:"这条记录已被锁定,滚动不会把它刷掉。"})]}),l.jsx("button",{type:"button",className:"de-schedule-close",onClick:Va,children:"×"})]}),l.jsxs("div",{className:"de-event-detail-grid",children:[l.jsxs("div",{children:[l.jsx("span",{children:"业务"}),l.jsx("strong",{children:B.plan_title})]}),l.jsxs("div",{children:[l.jsx("span",{children:"操作"}),l.jsx("strong",{children:B.task_title})]}),l.jsxs("div",{children:[l.jsx("span",{children:"状态"}),l.jsx("strong",{children:nv(B)})]}),l.jsxs("div",{children:[l.jsx("span",{children:"计划时间"}),l.jsx("strong",{children:G0(B)})]}),l.jsxs("div",{children:[l.jsx("span",{children:"执行时间"}),l.jsx("strong",{children:K0(B)})]}),l.jsxs("div",{children:[l.jsx("span",{children:"数据来源"}),l.jsx("strong",{children:ys})]})]}),l.jsxs("div",{className:"de-event-detail-result",children:[l.jsx("span",{children:"操作结果"}),l.jsx("p",{children:Ec(B)})]}),l.jsxs("div",{className:"de-event-modal-actions",children:[l.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",onClick:Va,children:"关闭"}),l.jsx("button",{type:"button",className:"de-btn-primary de-btn-sm",onClick:()=>ks(B),children:"打开任务中心详情"})]})]})}),Q&&l.jsx("div",{className:"de-task-manager-modal-overlay",role:"presentation",onClick:no,children:l.jsxs("div",{className:"de-event-history-modal",role:"dialog","aria-modal":"true","aria-label":"全部执行记录",onClick:R=>R.stopPropagation(),children:[l.jsxs("div",{className:"de-task-manager-modal-head",children:[l.jsxs("div",{children:[l.jsx("span",{className:"de-drawer-eyebrow",children:"EXECUTION HISTORY"}),l.jsx("h3",{children:"运行明细"}),l.jsxs("p",{children:["当前日期共 ",re.length," 条记录,本窗口展示最新 ",Math.min(je.length,ev)," 条。"]})]}),l.jsx("button",{type:"button",className:"de-schedule-close",onClick:no,children:"×"})]}),l.jsx("div",{className:"de-event-history-toolbar",children:AA.map(R=>l.jsx("button",{type:"button",className:`de-filter-chip ${q===R.id?"active":""}`,onClick:()=>ce(R.id),children:R.label},R.id))}),l.jsx("div",{className:"de-event-history-list",children:je.length===0?l.jsx("p",{className:"de-empty-text",children:"当前筛选下没有执行记录。"}):Me.map(R=>l.jsxs("button",{type:"button",className:`de-event-history-row de-live-feed-row--${R.status_tone||"info"}`,onClick:()=>{L(R),le(!1),I(!0)},children:[l.jsxs("span",{children:[l.jsx("em",{children:"业务"}),l.jsx("strong",{children:R.plan_title})]}),l.jsxs("span",{children:[l.jsx("em",{children:"操作"}),l.jsx("strong",{children:R.task_title})]}),l.jsxs("span",{children:[l.jsx("em",{children:"状态"}),l.jsx("strong",{children:nv(R)})]}),l.jsxs("span",{children:[l.jsx("em",{children:"操作结果"}),l.jsx("strong",{children:Ec(R)}),l.jsx("small",{children:av(R)})]})]},R.id))})]})}),z&&l.jsx("div",{className:"de-task-manager-modal-overlay de-plan-action-overlay",role:"presentation",onClick:()=>K(null),children:l.jsxs("div",{className:"de-plan-action-modal",role:"dialog","aria-modal":"true","aria-label":"定时任务",onClick:R=>R.stopPropagation(),children:[l.jsxs("div",{className:"de-task-manager-modal-head",children:[l.jsxs("div",{children:[l.jsx("span",{className:"de-drawer-eyebrow",children:"PLAN SCHEDULE"}),l.jsx("h3",{children:"定时任务"}),l.jsx("p",{children:"定时会把任务注册到后端调度链路,每天按设置时间自动派发。"})]}),l.jsx("button",{type:"button",className:"de-schedule-close",onClick:()=>K(null),children:"×"})]}),l.jsxs("div",{className:"de-plan-action-body",children:[l.jsxs("div",{className:"de-event-detail-result",children:[l.jsx("span",{children:"任务"}),l.jsx("p",{children:z.title})]}),l.jsxs("label",{className:"de-plan-action-field",children:[l.jsx("span",{children:"每日定时时间"}),l.jsx("input",{type:"time",value:ke,onChange:R=>ve(R.target.value||"09:00")})]}),l.jsxs("div",{className:"de-event-detail-grid de-plan-action-grid",children:[l.jsxs("div",{children:[l.jsx("span",{children:"调度注册"}),l.jsx("strong",{children:tv(ke)})]}),l.jsxs("div",{children:[l.jsx("span",{children:"任务步骤"}),l.jsxs("strong",{children:[z.stepCount," 步"]})]}),l.jsxs("div",{children:[l.jsx("span",{children:"执行步骤"}),l.jsxs("strong",{children:[z.taskCount," 项"]})]})]}),l.jsx("div",{className:"de-schedule-result de-schedule-result--success",children:"这里不是本地假定时;提交后如果后端调度链路不可用,会直接显示真实失败原因。"})]}),l.jsxs("div",{className:"de-event-modal-actions",children:[l.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",onClick:()=>K(null),children:"取消"}),l.jsx("button",{type:"button",className:"de-btn-primary de-btn-sm",disabled:x===`schedule:${z.id}`,onClick:()=>{un(z)},children:x===`schedule:${z.id}`?"注册中...":"确认定时"})]})]})}),E&&l.jsx("div",{className:"de-task-manager-modal-overlay de-plan-action-overlay",role:"presentation",onClick:()=>pe(null),children:l.jsxs("div",{className:"de-plan-action-modal",role:"dialog","aria-modal":"true","aria-label":"执行任务",onClick:R=>R.stopPropagation(),children:[l.jsxs("div",{className:"de-task-manager-modal-head",children:[l.jsxs("div",{children:[l.jsx("span",{className:"de-drawer-eyebrow",children:"PLAN EXECUTION"}),l.jsx("h3",{children:"执行任务"}),l.jsx("p",{children:"确认后立即创建并派发任务步骤,不需要先进入任务中心设置。"})]}),l.jsx("button",{type:"button",className:"de-schedule-close",onClick:()=>pe(null),children:"×"})]}),l.jsxs("div",{className:"de-plan-action-body",children:[l.jsxs("div",{className:"de-event-detail-result",children:[l.jsx("span",{children:"任务"}),l.jsx("p",{children:E.title})]}),l.jsxs("div",{className:"de-event-detail-grid de-plan-action-grid",children:[l.jsxs("div",{children:[l.jsx("span",{children:"当前状态"}),l.jsx("strong",{children:E.statusLabel})]}),l.jsxs("div",{children:[l.jsx("span",{children:"任务步骤"}),l.jsxs("strong",{children:[E.stepCount," 步"]})]}),l.jsxs("div",{children:[l.jsx("span",{children:"执行步骤"}),l.jsxs("strong",{children:[E.taskCount," 项"]})]})]}),l.jsx("div",{className:`de-schedule-result ${_c(E)?"de-schedule-result--success":"de-schedule-result--pending"}`,children:_c(E)?"确认后立即调用后端派发接口,按任务步骤进入真实执行链路。":wc(E)})]}),l.jsxs("div",{className:"de-event-modal-actions",children:[l.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",onClick:()=>pe(null),children:"取消"}),l.jsx("button",{type:"button",className:"de-btn-primary de-btn-sm",disabled:x===`execute:${E.id}`||!_c(E),onClick:()=>{eo(E)},children:x===`execute:${E.id}`?"触发中...":"确认执行"})]})]})}),nt&&Zi&&l.jsx("div",{className:"de-task-manager-modal-overlay de-workday-guide-overlay",role:"presentation",onClick:bs,children:l.jsxs("div",{className:"de-task-manager-modal de-workday-guide-modal",role:"dialog","aria-modal":"true","aria-label":"开始今天的任务",onClick:R=>R.stopPropagation(),children:[l.jsxs("div",{className:"de-task-manager-modal-head de-workday-guide-head",children:[l.jsxs("div",{children:[l.jsx("span",{className:"de-drawer-eyebrow",children:"WORKDAY START"}),l.jsx("h3",{children:"开始今天的任务"}),l.jsx("p",{children:"像值班员早上交接一样,先确认日期和执行内容,再让数字员工开始接单、外呼、汇总和汇报。"})]}),l.jsx("button",{type:"button",className:"de-schedule-close",onClick:bs,children:"×"})]}),l.jsx("div",{className:"de-workday-guide-steps","aria-label":"开工引导步骤",children:MA.map((R,_e)=>l.jsxs("div",{className:"de-workday-guide-step",children:[l.jsx("span",{children:_e+1}),l.jsx("strong",{children:R.title}),l.jsx("p",{children:R.body})]},R.title))}),l.jsxs("div",{className:"de-workday-guide-body",children:[l.jsxs("section",{className:"de-task-manager-column de-workday-guide-column",children:[l.jsxs("div",{className:"de-task-manager-section-head",children:[l.jsxs("div",{children:[l.jsx("strong",{children:"选择今天要执行的任务"}),l.jsxs("span",{children:[Ft.length," 项已选,",he.length," 项总任务,",Te.length," 项待选择"]})]}),l.jsx("span",{className:`de-badge ${Ki}`,children:ys})]}),l.jsx("div",{className:"de-workday-guide-duty-list",children:h?l.jsx("div",{className:"de-loading-skeleton",style:{height:220}}):pt.length===0?l.jsx("p",{className:"de-empty-text",children:"暂无任务,首页不再展示硬编码任务。请先在任务中心创建或同步。"}):pt.map(R=>dl(R,"guide"))})]}),l.jsxs("aside",{className:"de-workday-guide-side",children:[l.jsxs("div",{className:"de-workday-guide-summary",children:[l.jsx("span",{children:"日期"}),l.jsx("strong",{children:a}),l.jsx("p",{children:Nr})]}),l.jsxs("div",{className:"de-workday-guide-summary",children:[l.jsx("span",{children:"确认后会发生什么"}),l.jsx("strong",{children:"右侧进入执行滚动"}),l.jsx("p",{children:"首页会展示当前动作、下一步、操作状态和操作结果;需要人工决策时会在右侧停下来提示。"})]}),(T||M||(i==null?void 0:i.demo_reason))&&l.jsx("div",{className:`de-schedule-result ${T?"de-schedule-result--error":"de-schedule-result--success"}`,children:T||(M?"已调整任务勾选,点击确认后生效。":i==null?void 0:i.demo_reason)}),l.jsxs("div",{className:"de-workday-guide-actions",children:[l.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",onClick:bs,children:"稍后设置"}),l.jsx("button",{type:"button",className:"de-btn-primary de-btn-sm",disabled:x==="confirm_workday"||h,onClick:()=>{xa()},children:x==="confirm_workday"?"确认中...":"确认并开始任务"})]})]})]})]})}),ge&&l.jsx("div",{className:"de-task-manager-modal-overlay",role:"presentation",onClick:()=>N(!1),children:l.jsxs("div",{className:"de-task-manager-modal",role:"dialog","aria-modal":"true","aria-label":"任务设置",onClick:R=>R.stopPropagation(),children:[l.jsxs("div",{className:"de-task-manager-modal-head",children:[l.jsxs("div",{children:[l.jsx("span",{className:"de-drawer-eyebrow",children:"TASK MANAGER"}),l.jsx("h3",{children:"任务设置"}),l.jsx("p",{children:"像员工早上确认工作一样,勾选今天要执行的内容,必要时进入详情或处理待决策事项。"})]}),l.jsx("button",{type:"button",className:"de-schedule-close",onClick:()=>N(!1),children:"×"})]}),l.jsxs("div",{className:"de-task-manager-modal-body",children:[l.jsxs("section",{className:"de-task-manager-column de-task-manager-column--duties",children:[l.jsxs("div",{className:"de-task-manager-section-head",children:[l.jsxs("div",{children:[l.jsx("strong",{children:"任务设置清单"}),l.jsxs("span",{children:[Ft.length," 项已选,",he.length," 项总任务,",Te.length," 项待选择"]})]}),l.jsx("button",{type:"button",className:"de-btn-primary de-btn-sm",disabled:x==="confirm_workday"||h,onClick:()=>{xa()},children:x==="confirm_workday"?"确认中...":Ke!=null&&Ke.confirmed?"重新任务执行":"确认并开始任务"})]}),l.jsx("div",{className:"de-task-manager-duty-list",children:h?l.jsx("div",{className:"de-loading-skeleton",style:{height:180}}):pt.length===0?l.jsx("p",{className:"de-empty-text",children:"暂无任务,首页不会显示硬编码任务。可进入任务中心创建。"}):pt.map(R=>dl(R,"manager"))})]}),l.jsxs("aside",{className:"de-task-manager-column de-task-manager-column--actions",children:[l.jsx("div",{className:"de-task-manager-section-head",children:l.jsxs("div",{children:[l.jsx("strong",{children:"待解决事项"}),l.jsx("span",{children:Ae.length>0?`${Ae.length} 项需要人处理`:"暂无阻塞事项"})]})}),l.jsx("div",{className:"de-task-manager-decision-list",children:((i==null?void 0:i.decisions)??[]).length===0?l.jsx("p",{className:"de-empty-text",children:"没有需要你确认的事项。"}):((i==null?void 0:i.decisions)??[]).map(R=>l.jsxs("div",{className:"de-task-manager-decision-card",children:[l.jsxs("div",{className:"de-log-entry-meta",children:[l.jsx("strong",{children:R.title}),l.jsx("span",{children:R.status_label})]}),l.jsx("p",{children:R.scenario}),l.jsxs("div",{className:"de-decision-chain-note",children:[l.jsx("span",{className:"de-badge de-badge-warning",children:"待实现"}),l.jsx("span",{children:sv})]}),l.jsxs("div",{className:"de-workbench-actions",children:[R.actions.map(_e=>l.jsx("button",{type:"button",className:_e.tone==="primary"?"de-workbench-action-accent":"",disabled:x===`${R.id}:${_e.id}`||!rv(R.status),onClick:()=>{ul(R,_e.id)},children:x===`${R.id}:${_e.id}`?"处理中...":_e.label},_e.id)),l.jsx("button",{type:"button",onClick:()=>e({tab:"missions",date:a,missionId:R.id}),children:"查看上下文"})]})]},R.id))})]})]})]})})]})}function zi({children:e,className:a="",style:r}){return l.jsx("div",{className:`de-card ${a}`,style:r,children:e})}function ru({title:e,children:a}){return l.jsxs("div",{className:"de-card-title-bar",children:[l.jsx("span",{className:"de-card-title-bar-text",children:e}),a]})}const i8={info:"de-badge-info",success:"de-badge-success",warning:"de-badge-warning",danger:"de-badge-danger"};function Rp({variant:e,label:a}){return l.jsx("span",{className:`de-badge ${i8[e]}`,children:a})}function lu(e){return e.replace(/[^a-zA-Z0-9_-]/g,"_")}function o8(e){switch(e){case"succeeded":case"completed":return"success";case"failed":case"error":return"danger";case"running":case"active":return"info";default:return"warning"}}function c8(e){return["draft","reviewing","approved"].includes(e.toLowerCase())}function u8(e){const a=`${e.id} ${e.title} ${e.objective}`.toLowerCase();return a.includes("month")||a.includes("monthly")||a.includes("月")?"月度任务":a.includes("week")||a.includes("weekly")||a.includes("周")?"周任务":a.includes("临时")||a.includes("adhoc")||a.includes("hotlist")||a.includes("monitor")?"临时任务":"日常任务"}function el(e){return["succeeded","success","finished","complete","completed"].includes(e.toLowerCase())}function P0(e){return["failed","error","cancelled","canceled","aborted","rejected","deadletter"].includes(e.toLowerCase())}function d8(e){const a=e.steps.length;if(a===0)return yn(e.status);const r=e.steps.filter(u=>el(u.status)).length,i=e.steps.filter(u=>P0(u.status)).length,c=e.steps.filter(u=>["running","active","queued","leased"].includes(u.status.toLowerCase())).length,d=[`已完成 ${r}/${a}`];return i>0&&d.push(`失败 ${i}`),c>0&&i===0&&d.push(`处理中 ${c}`),d.join(",")}function f8(e){const a=e.steps.find(c=>P0(c.status));if(a)return`执行失败:${a.title}`;const r=e.steps.find(c=>["running","active"].includes(c.status.toLowerCase()));if(r)return`正在处理:${r.title}`;const i=e.steps.find(c=>!el(c.status));return i?`准备处理:${i.title}`:el(e.status)?"本轮任务已完成,等待你查看结果":e.status.toLowerCase()==="failed"?"执行遇到异常,等待你检查后重新执行":"等待你委托数字员工开始处理"}function p8(e,a){const r=e.status.toLowerCase();return r==="failed"||r==="error"?"查看详情后重新执行本任务":["running","active"].includes(r)?"等待完成或查看过程":el(r)?"查看产物,必要时重新执行":a?"确认目标后点击委托执行":"查看详情确认当前状态"}function m8(e){const a=`${e.title} ${e.objective}`.toLowerCase();return a.includes("excel")||a.includes("xlsx")||a.includes("导出")||a.includes("报表")?"导出报表":a.includes("brief")||a.includes("简报")||a.includes("日程")?"工作简报":a.includes("snapshot")||a.includes("快照")||a.includes("热榜")?"结果快照":el(e.status)?"查看完成结果":"完成后生成"}function X0(e){if(!e)return"";const a=new Date(e);return Number.isNaN(a.getTime())?"":[a.getFullYear(),String(a.getMonth()+1).padStart(2,"0"),String(a.getDate()).padStart(2,"0")].join("-")}function Q0(){return X0(new Date().toISOString())}function h8(e){if(!e)return"时间未记录";const a=new Date(e);return Number.isNaN(a.getTime())?"时间未记录":a.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit",hour12:!1})}function g8(e){if(!e)return"";const a=new Date(e);return Number.isNaN(a.getTime())?"":a.toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1})}function x8(e){const a=`${e.title} ${e.id}`.match(/(?:^|\D)(\d{1,2})[::](\d{2})(?:\D|$)/);if(!a)return null;const r=Number(a[1]),i=Number(a[2]);return!Number.isInteger(r)||!Number.isInteger(i)||r>23||i>59?null:`${String(r).padStart(2,"0")}:${String(i).padStart(2,"0")}`}function y8(e){return e.steps.flatMap(a=>a.tasks.flatMap(r=>[r.startedAt,r.finishedAt])).filter(a=>!!a)}function b8(e,a){return y8(e).filter(i=>X0(i)===a).sort((i,c)=>c.localeCompare(i))[0]??null}function v8(e,a){const r=b8(e,a);if(r)return`实际执行 ${h8(r)}`;const i=a===Q0()?"今日未执行":"当日未执行";return`计划执行 ${x8(e)||"待确认"};${i}`}function k8({mission:e,onSelect:a,onRun:r,onRestart:i,dateFilter:c,selected:d,focusLabel:u,running:m}){const p=c8(e.status),h=el(e.status)||e.steps.some(v=>el(v.status)),y=c||Q0(),x=g8(e.updatedAt||e.createdAt);return l.jsxs("div",{id:`mission-card-${lu(e.id)}`,className:`de-mission-card ${d?"de-mission-card--selected":""}`,onClick:()=>a(e),onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),a(e))},role:"button",tabIndex:0,children:[l.jsxs("div",{className:"de-mission-card-header",children:[l.jsx("span",{className:"de-mission-card-title",children:e.title}),l.jsxs("div",{className:"de-mission-card-badges",children:[u&&l.jsx("span",{className:"de-mission-card-focus-chip",children:u}),l.jsx(Rp,{variant:o8(e.status),label:yn(e.status)})]})]}),e.objective&&l.jsxs("p",{className:"de-mission-card-desc",children:["业务目标:",e.objective]}),l.jsxs("div",{className:"de-mission-card-meta",children:[l.jsxs("span",{children:["周期:",u8(e)]}),l.jsxs("span",{children:["当前进度:",d8(e)]}),x&&l.jsxs("span",{children:["同步于 ",x]})]}),l.jsx("div",{className:"de-mission-card-meta",children:l.jsx("span",{children:f8(e)})}),l.jsxs("div",{className:"de-mission-card-meta",children:[l.jsxs("span",{children:["下一步:",p8(e,p)]}),l.jsxs("span",{children:["产物入口:",m8(e)]})]}),l.jsxs("div",{className:"de-mission-card-actions",children:[l.jsxs("span",{className:"de-mission-card-time",children:[v8(e,y),h?";重新执行可能覆盖本任务结果":""]}),l.jsx("button",{type:"button",className:"de-btn-restart",disabled:m,onClick:v=>{v.stopPropagation(),m||i==null||i(e)},title:h?"重新执行本任务,可能覆盖已有结果":"重新执行本任务",children:"重新执行本任务"}),l.jsx("button",{type:"button",className:"de-btn-run",disabled:!p||m,onClick:v=>{v.stopPropagation(),p&&!m&&(r==null||r(e))},children:m?"执行中...":p?"委托执行":yn(e.status)})]})]})}function rt(e,a){const r=new Date;return r.setHours(e,a,0,0),r.toISOString()}function Nt(e,a,r,i,c,d,u){return{id:`${e}-${a}-task`,title:r,status:i,assignedSkillId:c,startedAt:d,finishedAt:u}}function Yn(e,a,r,i,c,d){return{id:e,title:a,objective:r,status:i,createdAt:rt(8,0),updatedAt:c,steps:d,sourceIds:{planId:e,taskIds:d.flatMap(u=>u.tasks.map(m=>m.id))}}}const _8=[{id:"whitecollar-day-browser-portal-check",name:"工作台巡检",version:"1.0.0",enabled:!0,description:"检查工作台首页、待办数量和重点入口是否可用。",category:"办公",capabilityLevel:"standard",source:"skill-api"},{id:"whitecollar-day-browser-inbox-triage",name:"收件箱分拣",version:"1.0.0",enabled:!0,description:"读取邮件和通知列表,按紧急程度整理待办。",category:"通信",capabilityLevel:"standard",source:"skill-api"},{id:"whitecollar-day-calendar-brief",name:"日程简报",version:"1.0.0",enabled:!0,description:"生成当日会议、回访和报表节点的时间提醒。",category:"办公",capabilityLevel:"standard",source:"skill-api"},{id:"whitecollar-day-browser-crm-followup",name:"客户跟进",version:"1.0.0",enabled:!0,description:"读取客户跟进页面,形成回访摘要和下一步建议。",category:"营销",capabilityLevel:"specialized",source:"skill-api"},{id:"whitecollar-day-browser-expense-approval",name:"费用审批核对",version:"1.0.0",enabled:!0,description:"检查待审批费用单,筛出异常和超限项。",category:"财务",capabilityLevel:"specialized",source:"skill-api"},{id:"whitecollar-day-sales-snapshot",name:"经营快照",version:"1.0.0",enabled:!0,description:"汇总客户、项目和当日经营看板。",category:"报表",capabilityLevel:"standard",source:"skill-api"},{id:"whitecollar-day-report-export",name:"报表导出",version:"1.0.0",enabled:!0,description:"整理并导出面向领导汇报的简版报表。",category:"报表",capabilityLevel:"standard",source:"skill-api"},{id:"whitecollar-day-browser-knowledge-check",name:"知识库核查",version:"1.0.0",enabled:!0,description:"检索知识库资料,确认制度和模板是否最新。",category:"数字化",capabilityLevel:"standard",source:"skill-api"},{id:"whitecollar-day-task-board-sync",name:"任务看板同步",version:"1.0.0",enabled:!0,description:"把今日处理结果同步到任务看板和协同清单。",category:"办公",capabilityLevel:"standard",source:"skill-api"},{id:"whitecollar-day-browser-day-close",name:"日终收口",version:"1.0.0",enabled:!0,description:"汇总今日动作、风险和明日重点。",category:"办公",capabilityLevel:"specialized",source:"skill-api"}],w8=[Yn("whitecollar-day","白领一天端到端验收","模拟业务人员一天内通过数字员工完成网页采集、客户回访、资料整理和日报输出。","active",rt(10,35),[{id:"contact",title:"读取供应商联系人",status:"completed",preferredSkills:["whitecollar-day-legacy-contact"],tasks:[Nt("whitecollar-day","contact","整理联系人名单","completed","whitecollar-day-legacy-contact",rt(8,30),rt(8,33))]},{id:"news",title:"读取行业动态",status:"completed",preferredSkills:["whitecollar-day-legacy-news"],tasks:[Nt("whitecollar-day","news","整理行业动态摘要","completed","whitecollar-day-legacy-news",rt(8,35),rt(8,41))]},{id:"form",title:"预填客户回访登记",status:"completed",preferredSkills:["whitecollar-day-legacy-form"],tasks:[Nt("whitecollar-day","form","填充回访登记表","completed","whitecollar-day-legacy-form",rt(8,45),rt(8,51))]},{id:"compare",title:"比对设备方案",status:"running",preferredSkills:["whitecollar-day-legacy-compare"],tasks:[Nt("whitecollar-day","compare","生成方案差异结论","running","whitecollar-day-legacy-compare",rt(10,28),null)]},{id:"todos",title:"读取待办系统",status:"pending",preferredSkills:["whitecollar-day-legacy-todos"],tasks:[Nt("whitecollar-day","todos","汇总个人待办","pending","whitecollar-day-legacy-todos",null,null)]},{id:"customers",title:"读取客户清单",status:"pending",preferredSkills:["whitecollar-day-legacy-customers"],tasks:[Nt("whitecollar-day","customers","提取重点客户","pending","whitecollar-day-legacy-customers",null,null)]},{id:"download",title:"识别最新资料下载链接",status:"pending",preferredSkills:["whitecollar-day-legacy-download"],tasks:[Nt("whitecollar-day","download","识别最新制度材料","pending","whitecollar-day-legacy-download",null,null)]},{id:"email",title:"生成客户跟进邮件",status:"pending",preferredSkills:["whitecollar-day-legacy-email"],tasks:[Nt("whitecollar-day","email","生成回访邮件草稿","pending","whitecollar-day-legacy-email",null,null)]},{id:"daily-report",title:"生成工作日报",status:"pending",preferredSkills:["whitecollar-day-legacy-daily-report"],tasks:[Nt("whitecollar-day","daily-report","生成工作日报","pending","whitecollar-day-legacy-daily-report",null,null)]},{id:"tomorrow-plan",title:"生成明日计划",status:"pending",preferredSkills:["whitecollar-day-legacy-tomorrow-plan"],tasks:[Nt("whitecollar-day","tomorrow-plan","整理明日计划","pending","whitecollar-day-legacy-tomorrow-plan",null,null)]}]),Yn("whitecollar-day-0830-browser-portal-check","白领一天 08:30 工作台巡检","巡检工作台首页、待办数量和关键入口状态。","completed",rt(8,34),[{id:"browser-portal-check",title:"浏览器工作台巡检",status:"completed",preferredSkills:["whitecollar-day-browser-portal-check"],tasks:[Nt("whitecollar-day-0830-browser-portal-check","browser-portal-check","检查门户首页与入口","completed","whitecollar-day-browser-portal-check",rt(8,30),rt(8,34))]}]),Yn("whitecollar-day-0900-browser-inbox-triage","白领一天 09:00 收件箱分拣","识别高优先级通知并形成今日待办。","completed",rt(9,6),[{id:"browser-inbox-triage",title:"浏览器收件箱分拣",status:"completed",preferredSkills:["whitecollar-day-browser-inbox-triage"],tasks:[Nt("whitecollar-day-0900-browser-inbox-triage","browser-inbox-triage","分拣通知与邮件","completed","whitecollar-day-browser-inbox-triage",rt(9,0),rt(9,6))]}]),Yn("whitecollar-day-0930-calendar-brief","白领一天 09:30 日程简报","整理会议、回访与汇报节点,形成上午排程。","completed",rt(9,32),[{id:"calendar-brief",title:"生成日程简报",status:"completed",preferredSkills:["whitecollar-day-calendar-brief"],tasks:[Nt("whitecollar-day-0930-calendar-brief","calendar-brief","整理今日日程","completed","whitecollar-day-calendar-brief",rt(9,30),rt(9,32))]}]),Yn("whitecollar-day-1030-browser-crm-followup","白领一天 10:30 客户跟进","汇总重点客户情况,生成下一步回访建议。","running",rt(10,35),[{id:"browser-crm-followup",title:"浏览器客户跟进",status:"running",preferredSkills:["whitecollar-day-browser-crm-followup"],tasks:[Nt("whitecollar-day-1030-browser-crm-followup","browser-crm-followup","提取客户回访摘要","running","whitecollar-day-browser-crm-followup",rt(10,30),null)]}]),Yn("whitecollar-day-1130-browser-expense-approval","白领一天 11:30 费用审批核对","检查待审批单据并输出异常说明。","approved",rt(11,20),[{id:"browser-expense-approval",title:"浏览器费用审批核对",status:"pending",preferredSkills:["whitecollar-day-browser-expense-approval"],tasks:[Nt("whitecollar-day-1130-browser-expense-approval","browser-expense-approval","核对费用审批单","pending","whitecollar-day-browser-expense-approval",null,null)]}]),Yn("whitecollar-day-1330-sales-snapshot","白领一天 13:30 经营快照","汇总客户、项目和经营看板,形成午后快照。","draft",rt(13,20),[{id:"sales-snapshot",title:"生成经营快照",status:"pending",preferredSkills:["whitecollar-day-sales-snapshot"],tasks:[Nt("whitecollar-day-1330-sales-snapshot","sales-snapshot","整理经营快照","pending","whitecollar-day-sales-snapshot",null,null)]}]),Yn("whitecollar-day-1430-report-export","白领一天 14:30 报表导出","导出领导汇报所需的简版统计报表。","draft",rt(14,10),[{id:"report-export",title:"导出汇报报表",status:"pending",preferredSkills:["whitecollar-day-report-export"],tasks:[Nt("whitecollar-day-1430-report-export","report-export","导出统计报表","pending","whitecollar-day-report-export",null,null)]}]),Yn("whitecollar-day-1530-browser-knowledge-check","白领一天 15:30 知识库核查","核查制度、模板与常见问题资料是否最新。","draft",rt(15,15),[{id:"browser-knowledge-check",title:"浏览器知识库核查",status:"pending",preferredSkills:["whitecollar-day-browser-knowledge-check"],tasks:[Nt("whitecollar-day-1530-browser-knowledge-check","browser-knowledge-check","核查知识库资料","pending","whitecollar-day-browser-knowledge-check",null,null)]}]),Yn("whitecollar-day-1630-task-board-sync","白领一天 16:30 任务看板同步","把今日处理结果同步到看板和协同清单。","draft",rt(16,10),[{id:"task-board-sync",title:"同步任务看板",status:"pending",preferredSkills:["whitecollar-day-task-board-sync"],tasks:[Nt("whitecollar-day-1630-task-board-sync","task-board-sync","同步任务状态","pending","whitecollar-day-task-board-sync",null,null)]}]),Yn("whitecollar-day-1730-browser-day-close","白领一天 17:30 日终收口","汇总今日成果、风险和明日重点,形成日终总结。","draft",rt(17,10),[{id:"task-board-sync",title:"同步任务看板",status:"pending",preferredSkills:["whitecollar-day-task-board-sync"],tasks:[Nt("whitecollar-day-1730-browser-day-close","task-board-sync","同步看板结果","pending","whitecollar-day-task-board-sync",null,null)]},{id:"browser-day-close",title:"浏览器日终收口",status:"pending",preferredSkills:["whitecollar-day-browser-day-close"],tasks:[Nt("whitecollar-day-1730-browser-day-close","browser-day-close","整理日终收口","pending","whitecollar-day-browser-day-close",null,null)]}]),Yn("zhihu-hotlist-monitor","知乎热榜采集","通过计划模板调用知乎热榜采集技能,导出表格文件并生成当天热点摘要。","approved",rt(10,12),[{id:"collect-zhihu",title:"采集知乎热榜",status:"pending",preferredSkills:["zhihu-hotlist"],tasks:[Nt("zhihu-hotlist-monitor","collect-zhihu","采集知乎热榜","pending","zhihu-hotlist",null,null)]},{id:"export-xlsx",title:"导出表格文件",status:"pending",preferredSkills:["office-export-xlsx"],tasks:[Nt("zhihu-hotlist-monitor","export-xlsx","导出热榜表格","pending","office-export-xlsx",null,null)]}])];function j8(e){return{...e,steps:e.steps.map(a=>({...a,preferredSkills:[...a.preferredSkills],tasks:a.tasks.map(r=>({...r}))})),sourceIds:{planId:e.sourceIds.planId,taskIds:[...e.sourceIds.taskIds]}}}function ns(){return w8.map(j8)}function iv(){return _8.map(e=>({...e}))}function S8(e){return e.flatMap(a=>a.steps.flatMap(r=>r.tasks.map(i=>({task_id:i.id,title:i.title,status:i.status,plan_id:a.id,step_id:r.id,assigned_skill_id:i.assignedSkillId||"",description:`${a.title} · ${r.title}`,created_at:a.createdAt||rt(8,0),updated_at:a.updatedAt||a.createdAt||rt(8,0),started_at:i.startedAt,finished_at:i.finishedAt}))))}function N8(e){return e.filter(a=>["completed","running"].includes(a.status)).map((a,r)=>({run_id:`demo-run-${r+1}`,task_id:a.task_id,plan_id:a.plan_id,attempt_no:1,lifecycle:a.status==="running"?"Running":"Succeeded",created_at:a.started_at||a.created_at,completed_at:a.finished_at}))}function C8(e){const a=e.steps.find(i=>i.status==="running")||e.steps.find(i=>i.status==="pending")||e.steps[0],r=[{event_id:`${e.id}-event-1`,kind:"entered_session",occurred_at:e.createdAt||rt(8,0),message:`已接收场景:${e.title}`},{event_id:`${e.id}-event-2`,kind:"start",occurred_at:e.updatedAt||e.createdAt||rt(8,0),message:`当前目标:${e.objective}`}];return a&&r.push({event_id:`${e.id}-event-3`,kind:e.status==="completed"?"completed":e.status==="approved"||e.status==="draft"?"pending_authorization":"RunStarted",occurred_at:e.updatedAt||e.createdAt||rt(8,0),message:`${a.title}`}),e.status==="completed"&&r.push({event_id:`${e.id}-event-4`,kind:"RunCompleted",occurred_at:e.updatedAt||e.createdAt||rt(8,0),message:"已完成本场景执行并回写结果。"}),r}function Zf(e){const a=e.steps.filter(c=>c.status==="completed").length,r=e.steps.find(c=>c.status==="running"),i=e.status==="completed"?`当前已完成全部 ${e.steps.length} 个步骤,结果已整理完毕。`:r?`当前正在处理“${r.title}”,已完成 ${a} 个步骤。`:"当前场景已准备就绪,可直接发起执行。";return[{role:"user",content:`请执行场景:${e.title}`},{role:"assistant",content:`已接收。业务目标:${e.objective}`},{role:"assistant",content:i}]}function Jf(e,a){return e.map(r=>r.id!==a?r:{...r,status:"running",updatedAt:new Date().toISOString(),steps:r.steps.map((i,c)=>({...i,status:c===0?"running":i.status==="completed"?"completed":"pending",tasks:i.tasks.map(d=>({...d,status:c===0?"running":d.status==="completed"?"completed":"pending",startedAt:c===0?new Date().toISOString():d.startedAt,finishedAt:c===0?null:d.finishedAt}))}))})}function Wf(e,a){return e.map(r=>r.id!==a?r:{...r,status:"completed",updatedAt:new Date().toISOString(),steps:r.steps.map(i=>({...i,status:"completed",tasks:i.tasks.map(c=>({...c,status:"completed",startedAt:c.startedAt||new Date().toISOString(),finishedAt:new Date().toISOString()}))}))})}function ov(e){switch(e){case"succeeded":case"completed":case"Succeeded":return"success";case"failed":return"danger";case"Failed":return"danger";case"running":case"active":case"Running":return"info";default:return"warning"}}function yr(e){return e?new Date(e).toLocaleString("zh-CN",{hour12:!1}):"未记录"}function cv(e){const a=`${e.id} ${e.title} ${e.objective}`.toLowerCase();return a.includes("month")||a.includes("monthly")||a.includes("月")?"月度任务":a.includes("week")||a.includes("weekly")||a.includes("周")?"周任务":a.includes("临时")||a.includes("adhoc")||a.includes("hotlist")||a.includes("monitor")?"临时任务":"日常任务"}function E8(e){return["succeeded","success","finished","complete","completed"].includes(e.toLowerCase())}function Si(e){return["failed","error","cancelled","canceled","aborted","rejected","deadletter"].includes(e.toLowerCase())}function uv(e){const a=e.steps.length;if(a===0)return yn(e.status);const r=e.steps.filter(u=>E8(u.status)).length,i=e.steps.filter(u=>Si(u.status)).length,c=e.steps.filter(u=>["running","active","queued","leased"].includes(u.status.toLowerCase())).length,d=[`已完成 ${r}/${a}`];return i>0&&d.push(`失败 ${i}`),c>0&&i===0&&d.push(`处理中 ${c}`),d.join(",")}function dv(e){return e.replace(/^启动计划:/,"接收委托:").replace(/^准备步骤:/,"准备工作:").replace(/^创建任务:/,"安排工作:").replace(/^任务失败:/,"工作失败:").replace(/^开始处理:/,"开始处理:").replace(/^完成任务:/,"完成工作:").replace(/^调用技能:/,"数字员工处理:").replace(/^执行开始:/,"开始执行:").replace(/^执行完成:/,"执行完成:").replace(/^执行失败:/,"执行失败:").replace(/,将使用[^,。]+/,"").replace(/,分配给[^,。]+/,"")}function Tc(e){return/失败|failed|error|timeout|unavailable/i.test(e)}function fv(e,a=""){return Tc(a)?"失败":e==="artifact"?"产物":e==="task_summary"?"结果":e==="task_running"||e==="run"?"处理中":e==="task_done"||e==="run_done"?"完成":"过程"}function T8(e){return e==="user"?"用户":e==="assistant"?"数字员工":e==="system"?"系统":"消息"}function ep(e){return kr(e||"",e||"自动化技能")}function A8(e,a,r){const i=a==="true"?"成功":"失败";return e.includes("zhihu-hotlist")&&e.includes("extract_hotlist")?`调用技能:知乎热榜采集,结果:${i},耗时 ${r}ms`:e.includes("office-export-xlsx")&&e.includes("export_xlsx")?`调用技能:Excel 导出,结果:${i},耗时 ${r}ms`:`调用技能:${e},结果:${i},耗时 ${r}ms`}function tp(e){return typeof e=="string"?e:""}function Fc(e){return e.occurred_at||""}function pv(e){return e.filter(a=>!!a).sort((a,r)=>a.localeCompare(r))[0]||null}function D8(e){var r;const a=new Map;for(const i of e){const c=((r=i.message.split(",结果:")[0])==null?void 0:r.split(",状态:")[0])||i.message,d=a.get(c);(!d||Fc(i).localeCompare(Fc(d))>0)&&a.set(c,i)}return Array.from(a.values())}function M8(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function mv(e){return e.replace(/\\\\/g,"\\")}function z8(e,a,r,i,c){const d=[],u=(p,h,y,x)=>{y.trim()&&d.push({event_id:x,kind:p,occurred_at:h??null,message:y})},m=(p,h,y,x)=>{let v=!1;try{const j=M8(JSON.parse(p));if(j){const C=typeof j.label=="string"?j.label.trim():"",$=j.value;C&&$!==void 0&&$!==null&&u("task_summary",h,`${C}:${String($)}`,`metric-${y}-${x}`);const M=typeof j.output_path=="string"?j.output_path.trim():"";M&&(v=!0,u("artifact",h,`产物生成:${mv(M)}`,`artifact-${y}-${x}`))}}catch{}const k=p.match(/"row_count"\s*:\s*(\d+)/);k!=null&&k[1]&&u("task_summary",h,`数据处理完成:共 ${k[1]} 条记录`,`rows-${y}-${x}`);const w=p.match(/"output_path"\s*:\s*"([^"]+\.(?:xlsx|xls|csv|json|html|pdf|png|jpg|jpeg|txt))"/i),T=w==null?void 0:w[1];T&&!v&&u("artifact",h,`产物生成:${mv(T)}`,`artifact-regex-${y}-${x}`)};if(u("plan",e.createdAt||e.updatedAt,`启动计划:${e.title},目标:${e.objective}`,`plan-${e.id}`),a.length===0)for(const p of e.steps){const h=p.preferredSkills.map(ep).join("、")||"自动化技能";u("task",e.updatedAt||e.createdAt,`准备步骤:${p.title},将使用 ${h}`,`step-${p.id}`)}for(const p of a){const h=ep(p.assigned_skill_id),y=r.filter(k=>k.task_id===p.task_id),x=pv(y.map(k=>k.created_at)),v=pv([p.created_at,p.started_at,x]);if(u("task",v,`创建任务:${p.title||"子任务"},分配给 ${h}`,`task-create-${p.task_id}`),p.started_at&&u("task_running",p.started_at,`开始处理:${p.title||"子任务"}`,`task-start-${p.task_id}`),p.finished_at){const k=Si(p.status)?"任务失败":"完成任务",w=Si(p.status)&&p.error_message?`,原因:${p.error_message}`:"";u("task_done",p.finished_at,`${k}:${p.title||"子任务"},状态:${yn(p.status)}${w}`,`task-finish-${p.task_id}`)}}for(const p of r){const h=a.find(k=>k.task_id===p.task_id),y=(h==null?void 0:h.title)||"任务执行",x=ep(p.skill_id||(h==null?void 0:h.assigned_skill_id));if(i.some(k=>(k.content||"").includes(`[Task ${p.task_id}] tool_call`))||u("skill_tool",p.created_at,`调用技能:${x},处理:${y}`,`run-skill-${p.run_id}`),u("run",p.created_at,`执行开始:${y},第 ${p.attempt_no||1} 次`,`run-start-${p.run_id}`),p.completed_at){const k=Si(p.lifecycle)?"执行失败":"执行完成";u("run_done",p.completed_at,`${k}:${y},结果:${yn(p.lifecycle)}`,`run-done-${p.run_id}`)}for(const[k,w]of(p.events||[]).entries())m(tp(w.message),w.occurred_at||p.completed_at||p.created_at,`run-${p.run_id}-${w.event_id||k}`,p.skill_id||(h==null?void 0:h.assigned_skill_id)||"run");for(const[k,w]of(p.artifacts||[]).entries()){const T=tp(w.uri),j=tp(w.name)||T;(T||j)&&u("artifact",p.completed_at||p.created_at,`产物生成:${j}${T&&T!==j?`(${T})`:""}`,`run-artifact-${p.run_id}-${k}`)}}for(const p of i){const h=p.content||"",y=h.match(/\[Task ([^\]]+)\] tool_call name=([^\s]+) success=(true|false) elapsed_ms=(\d+) args=(.*?) output=(.*)$/s);if(y){const v=y[1]||"",k=y[2]||"",w=y[3]||"false",T=y[4]||"0",j=y[6]||"";u("skill_tool",p.created_at,A8(k,w,T),`tool-${v}-${p.created_at}-${k}`),m(j,p.created_at,`message-${p.created_at}`,k);continue}const x=h.match(/共采集到\s*\**\s*(\d+)\s*条/);if(x!=null&&x[1]){u("task_summary",p.created_at,`采集完成:获得 ${x[1]} 条知乎热榜数据`,`summary-hotlist-${p.created_at}`);continue}h.includes("[Task ")&&h.includes("Excel")&&u("task_summary",p.created_at,"导出完成:Excel 文件已生成",`summary-excel-${p.created_at}`)}if(d.length<=1)for(const p of c||[])u(p.kind,p.occurred_at,Bc(p.message,p.message),p.event_id);return d.sort((p,h)=>(p.occurred_at||"").localeCompare(h.occurred_at||"")).slice(-40)}function R8({mission:e,onClose:a}){const[r,i]=b.useState([]),[c,d]=b.useState([]),[u,m]=b.useState(null),[p,h]=b.useState(!0),[y,x]=b.useState([]),[v,k]=b.useState(!1),[w,T]=b.useState(!1),[j,C]=b.useState(!1),[$,M]=b.useState(null),ee=e.sourceIds.planId||e.id;b.useEffect(()=>{let Q=!1;const le=()=>{h(!0),Promise.allSettled([m1(ee),zc(ee),Ti(ee)]).then(([L,q,ce])=>{var K;if(Q)return;const ge=ns().find(E=>E.id===ee),N=ge?S8([ge]):[],z=N.length>0?N8(N):[];L.status==="fulfilled"?(i(L.value.tasks&&L.value.tasks.length>0?L.value.tasks:N),d(L.value.runs&&L.value.runs.length>0?L.value.runs:z)):(i(N),d(z)),q.status==="fulfilled"&&((K=q.value)!=null&&K.events)&&q.value.events.length>0?m(q.value):m(ge?{events:C8(ge)}:null),ce.status==="fulfilled"&&ce.value.messages.length>0?x(ce.value.messages):x(ge?Zf(ge):[])}).finally(()=>{Q||h(!1)})};le();const B=window.setInterval(le,3e3);return()=>{Q=!0,window.clearInterval(B)}},[ee]),b.useEffect(()=>{x([]),k(!1),T(!1),M(null)},[ee]);const ne=async()=>{if(!j){k(!0),C(!0),M(null);try{const Q=await Ti(ee);if(Q.messages&&Q.messages.length>0)x(Q.messages);else{const le=ns().find(B=>B.id===ee);x(le?Zf(le):[])}}catch(Q){const le=ns().find(B=>B.id===ee);le?(x(Zf(le)),M(null)):(x([]),M(Q instanceof Error?Q.message:"读取会话失败"))}finally{C(!1)}}},A=b.useMemo(()=>{const Q=new Map;for(const le of c){const B=Q.get(le.task_id)||[];B.push(le),Q.set(le.task_id,B)}for(const le of Q.values())le.sort((B,L)=>(L.created_at||"").localeCompare(B.created_at||""));return Q},[c]),G=b.useMemo(()=>z8(e,r,c,y,u==null?void 0:u.events),[u==null?void 0:u.events,e,c,y,r]),V=b.useMemo(()=>G.filter(Q=>Q.kind!=="skill_tool").slice(-12),[G]),oe=b.useMemo(()=>{const Q=G.filter(q=>["artifact","task_summary"].includes(q.kind)),le=G.filter(q=>q.kind==="task_done"),B=D8(G.filter(q=>q.kind==="run_done")),L=le.length>0?le:B;return[...Q,...L].sort((q,ce)=>Fc(q).localeCompare(Fc(ce))).slice(-6)},[G]),Y=b.useMemo(()=>G.reduce((Q,le)=>le.occurred_at&&(!Q||le.occurred_at.localeCompare(Q)>0)?le.occurred_at:Q,null),[G]),F=e.updatedAt||Y,I=()=>{const Q=!w;T(Q),Q&&!v&&ne()};return l.jsxs("div",{className:"de-drawer",role:"dialog","aria-label":e.title,children:[l.jsxs("div",{className:"de-drawer-head",children:[l.jsxs("div",{className:"de-drawer-title-group",children:[l.jsx("span",{className:"de-drawer-eyebrow",children:"委托详情"}),l.jsx("h3",{children:e.title})]}),l.jsx("button",{className:"de-btn-secondary",onClick:a,"aria-label":"关闭",children:"✕"})]}),l.jsxs("div",{className:"de-drawer-status-line",children:[l.jsx(Rp,{variant:ov(e.status),label:yn(e.status)}),l.jsx("span",{className:"de-drawer-meta",children:cv(e)}),l.jsx("span",{className:"de-drawer-meta",children:uv(e)})]}),l.jsxs("div",{className:"de-drawer-timeline",children:[l.jsxs("section",{className:"de-detail-section",children:[l.jsx("div",{className:"de-detail-section-head",children:l.jsx("h4",{children:"委托概览"})}),l.jsxs("div",{className:"de-detail-kv",children:[l.jsx("span",{children:"业务目标"}),l.jsx("strong",{children:e.objective||"未填写"}),l.jsx("span",{children:"周期"}),l.jsx("strong",{children:cv(e)}),l.jsx("span",{children:"当前进度"}),l.jsx("strong",{children:uv(e)}),l.jsx("span",{children:"启动时间"}),l.jsx("strong",{children:yr(e.createdAt)}),l.jsx("span",{children:"状态"}),l.jsx("strong",{children:yn(e.status)}),l.jsx("span",{children:"更新时间"}),l.jsx("strong",{children:yr(F)})]})]}),l.jsxs("section",{className:"de-detail-section de-execution-chain",children:[l.jsxs("div",{className:"de-detail-section-head",children:[l.jsx("h4",{children:"业务过程"}),l.jsxs("span",{className:"de-chain-plan-id",children:["最近更新:",yr(F||e.createdAt)]})]}),p&&V.length===0?l.jsx("p",{className:"de-empty-text",children:"正在读取业务过程..."}):V.length===0?l.jsx("p",{className:"de-empty-text",children:"暂无业务过程。重新执行本任务后会显示处理进展。"}):l.jsx("div",{className:"de-chain-list",children:V.map(Q=>l.jsxs("div",{className:`de-chain-row de-chain-row--${Q.kind} ${Tc(Q.message)?"de-chain-row--danger":""}`,children:[l.jsx("strong",{children:fv(Q.kind,Q.message)}),l.jsx("span",{children:dv(Q.message)}),l.jsx("time",{children:yr(Q.occurred_at)})]},`chain-${Q.event_id}`))})]}),l.jsxs("section",{className:"de-detail-section",children:[l.jsx("h4",{children:"结果与产物"}),oe.length>0?l.jsx("div",{className:"de-event-list",children:[...oe].reverse().map(Q=>l.jsxs("div",{className:`de-event-row ${Tc(Q.message)?"de-event-row--danger":""}`,children:[l.jsx("strong",{children:fv(Q.kind,Q.message)}),l.jsx("span",{children:dv(Q.message)}),l.jsx("time",{children:yr(Q.occurred_at)})]},`result-${Q.event_id}`))}):l.jsx("p",{className:"de-empty-text",children:"任务完成后,这里会显示结果摘要和产物入口。"})]}),l.jsxs("section",{className:"de-detail-section",children:[l.jsx("h4",{children:"步骤进展"}),p?l.jsx("p",{className:"de-empty-text",children:"正在读取执行情况..."}):null,e.steps.length===0?l.jsx("p",{className:"de-empty-text",children:"暂无步骤进展"}):e.steps.map((Q,le)=>l.jsxs("div",{className:"de-step-node",children:[l.jsx("div",{className:`de-step-dot de-step-dot--${Q.status}`}),le<e.steps.length-1&&l.jsx("div",{className:"de-step-line"}),l.jsxs("div",{className:"de-step-content",children:[l.jsx("strong",{children:Q.title}),l.jsx("span",{children:yn(Q.status)})]})]},Q.id))]}),l.jsxs("section",{className:"de-detail-section",children:[l.jsxs("div",{className:"de-detail-section-head",children:[l.jsx("h4",{children:"高级详情"}),l.jsx("button",{className:"de-btn-secondary de-btn-sm",onClick:I,disabled:j,children:w?"收起":"展开"})]}),w?l.jsxs(l.Fragment,{children:[l.jsxs("section",{className:"de-detail-section",children:[l.jsxs("div",{className:"de-detail-section-head",children:[l.jsx("h4",{children:"技术链路"}),l.jsx("span",{className:"de-chain-plan-id",children:"仅用于排障"})]}),G.length>0?l.jsx("div",{className:"de-event-list",children:G.slice(-20).reverse().map(Q=>l.jsxs("div",{className:`de-event-row ${Tc(Q.message)?"de-event-row--danger":""}`,children:[l.jsx("strong",{children:BT(Q.kind)}),l.jsx("span",{children:Q.message}),l.jsx("time",{children:yr(Q.occurred_at)})]},Q.event_id))}):l.jsx("p",{className:"de-empty-text",children:"暂无事件日志"})]}),l.jsxs("section",{className:"de-detail-section",children:[l.jsxs("div",{className:"de-detail-section-head",children:[l.jsx("h4",{children:"会话记录"}),l.jsx("button",{className:"de-btn-secondary de-btn-sm",onClick:ne,disabled:j,children:"刷新"})]}),$?l.jsxs("p",{className:"de-empty-text",children:["会话读取失败:",$]}):j?l.jsx("p",{className:"de-empty-text",children:"正在读取会话..."}):y.length===0?l.jsx("p",{className:"de-empty-text",children:"暂无会话消息。"}):l.jsx("div",{className:"de-session-message-list",children:y.map((Q,le)=>l.jsxs("div",{className:`de-session-message de-session-message--${Q.role==="user"?"user":"agent"}`,children:[l.jsx("div",{className:"de-session-message-role",children:T8(Q.role)}),l.jsx("p",{children:Bc(Q.content,Q.content)})]},`${Q.role}-${le}`))})]}),l.jsxs("section",{className:"de-detail-section",children:[l.jsx("h4",{children:"任务与执行记录"}),r.length===0?l.jsx("p",{className:"de-empty-text",children:"暂无原始任务记录"}):r.map(Q=>{const le=A.get(Q.task_id)||[],B=le[0];return l.jsxs("div",{className:"de-task-run-card",children:[l.jsxs("div",{className:"de-task-run-head",children:[l.jsx("span",{children:Q.title||"子任务"}),l.jsx(Rp,{variant:ov(Q.status),label:yn(Q.status)})]}),l.jsxs("div",{className:"de-task-run-meta",children:[l.jsxs("span",{children:["skill_id:",Q.assigned_skill_id||"未分配"]}),l.jsxs("span",{children:["开始:",yr(Q.started_at)]}),l.jsxs("span",{children:["结束:",yr(Q.finished_at)]})]}),l.jsxs("div",{className:"de-task-run-meta",children:[l.jsxs("span",{children:["task_id:",Q.task_id]}),l.jsxs("span",{children:["执行记录:",le.length," 次"]}),B?l.jsxs("span",{children:["最近结果:",yn(B.lifecycle)]}):null]}),Si(Q.status)&&Q.error_message?l.jsxs("div",{className:"de-task-run-error",children:[l.jsx("strong",{children:"失败原因:"}),Q.error_message]}):null]},Q.task_id)})]})]}):l.jsx("p",{className:"de-empty-text",children:"默认隐藏排障信息;需要排障时可展开。"})]})]})]})}const Ac=["whitecollar-day","whitecollar-day-0830-browser-portal-check","whitecollar-day-0900-browser-inbox-triage","whitecollar-day-0930-calendar-brief","whitecollar-day-1030-browser-crm-followup","whitecollar-day-1130-browser-expense-approval","whitecollar-day-1330-sales-snapshot","whitecollar-day-1430-report-export","whitecollar-day-1530-browser-knowledge-check","whitecollar-day-1630-task-board-sync","whitecollar-day-1730-browser-day-close","zhihu-hotlist-monitor"],O8=[{key:"all",label:"全部委托"},{key:"daily",label:"日常任务"},{key:"weekly",label:"周任务"},{key:"monthly",label:"月度任务"},{key:"adhoc",label:"临时任务"}];function Op(e){const a=typeof e.updated_at=="string"?e.updated_at:typeof e.created_at=="string"?e.created_at:"",r=a?new Date(a).getTime():0;return Number.isFinite(r)?r:0}function tl(e){if(!e)return"";const a=new Date(e);return Number.isNaN(a.getTime())?"":[a.getFullYear(),String(a.getMonth()+1).padStart(2,"0"),String(a.getDate()).padStart(2,"0")].join("-")}function Xr(){return tl(new Date().toISOString())}function hv(e,a){const r=e?new Date(`${e}T12:00:00`):new Date;return Number.isNaN(r.getTime())?Xr():(r.setDate(r.getDate()+a),tl(r.toISOString()))}function Dm(e){const a=`${e.title} ${e.id}`.match(/(?:^|\D)(\d{1,2})[::](\d{2})(?:\D|$)/);if(!a)return null;const r=Number(a[1]),i=Number(a[2]);return!Number.isInteger(r)||!Number.isInteger(i)||r>23||i>59?null:{text:`${String(r).padStart(2,"0")}:${String(i).padStart(2,"0")}`,minutes:r*60+i}}function Mm(e){return e.steps.flatMap(a=>a.tasks.flatMap(r=>[r.startedAt,r.finishedAt])).filter(a=>!!a)}function L8(e,a){return Mm(e).map(tl).filter(Boolean).includes(a)||Dm(e)?!0:[e.updatedAt,e.createdAt].map(tl).includes(a)}function $8(e){return Dm(e)&&`${e.title}`.trim().toLowerCase()||e.id}function B8(e,a){return Mm(e).some(r=>tl(r)===a)}function gv(e,a){const r=B8(e,a)?1e4:0,i=Ac.includes(e.id)?1e3:0,c=[e.updatedAt,e.createdAt].map(tl).includes(a)?100:0;return r+i+c+Op({updated_at:e.updatedAt||"",created_at:e.createdAt||""})/1e13}function U8(e,a){const r=new Map;for(const i of e){const c=$8(i),d=r.get(c);(!d||gv(i,a)>gv(d,a))&&r.set(c,i)}return Array.from(r.values())}function xv(e,a){const r=Dm(e);if(r)return r.minutes;const i=Mm(e).filter(c=>tl(c)===a).sort();if(i[0]){const c=new Date(i[0]);return c.getHours()*60+c.getMinutes()}return 1440}function H8(e){const a=`${e.id} ${e.title} ${e.objective}`.toLowerCase();return a.includes("month")||a.includes("monthly")||a.includes("月")?"monthly":a.includes("week")||a.includes("weekly")||a.includes("周")?"weekly":a.includes("临时")||a.includes("adhoc")||a.includes("hotlist")||a.includes("monitor")?"adhoc":"daily"}async function Z0(e,a,r={}){const i=Date.now(),c=await ma({command_kind:e,context_refs:a,payload:{source:"digital-mission-center",...r},correlation_id:`mission-${e}-${i}`,idempotency_key:`mission-${e}-${Object.values(a).join("-")||"new"}-${i}`});if(!c.accepted)throw new Error(c.message||`command 未被接受:${c.command_id||e}`);return c}async function na(e,a,r={}){return Z0(a,{plan_id:e},r)}async function yv(e){const a=e.sourceIds.planId;if(!a)return null;const r=e.status.toLowerCase();if(r==="draft")await na(a,"submit_plan",{requested_action:"mission_dispatch"}),await na(a,"approve_plan",{requested_action:"mission_dispatch"});else if(r==="reviewing")await na(a,"approve_plan",{requested_action:"mission_dispatch"});else if(!["approved","active","running"].includes(r))return await na(a,"amend_plan",{requested_action:"reopen_for_execution",summary:"数字员工任务中心请求重新执行任务"}),null;return await na(a,"activate_plan",{requested_action:"mission_dispatch"}),a}function q8(e){const a=e.steps.map((r,i)=>{const c=new Set;r.preferredSkills.forEach(u=>{u.trim()&&c.add(u)}),r.tasks.forEach(u=>{var m;(m=u.assignedSkillId)!=null&&m.trim()&&c.add(u.assignedSkillId)});const d=[r.description,...r.tasks.map(u=>u.description),r.title,e.objective,e.title].find(u=>typeof u=="string"&&u.trim());return{title:r.title||`${e.title} 第 ${i+1} 步`,description:d||r.title||e.objective||e.title,skills:Array.from(c),depends_on:i===0?[]:[`step-${i}`]}}).filter(r=>r.skills.length>0);if(a.length===0)throw new Error("当前任务没有可复用的 skill,不能创建真实重新执行计划。");return a}function J0(e){return`${e.replace(/(\s*重新执行)+$/u,"").trim()||e} 重新执行`}async function F8(e){var c,d;const a=await Z0("create_plan",{session_id:"digital-mission-center",plan_id:e.sourceIds.planId||e.id},{requested_action:"mission_restart",title:J0(e.title),description:e.objective||e.title,steps:q8(e),original_plan_id:e.sourceIds.planId||e.id}),r=typeof((c=a.result)==null?void 0:c.plan_id)=="string"?a.result.plan_id:"";if(!r)throw new Error("重新执行计划已提交,但后端没有返回 plan_id。");const i=typeof((d=a.result)==null?void 0:d.status)=="string"?a.result.status.toLowerCase():"";return i==="draft"?(await na(r,"submit_plan",{requested_action:"mission_restart"}),await na(r,"approve_plan",{requested_action:"mission_restart"}),await na(r,"activate_plan",{requested_action:"mission_restart"})):i==="reviewing"?(await na(r,"approve_plan",{requested_action:"mission_restart"}),await na(r,"activate_plan",{requested_action:"mission_restart"})):i==="approved"&&await na(r,"activate_plan",{requested_action:"mission_restart"}),r}function I8({focusMissionId:e,focusTaskId:a,focusDate:r}){const i=r||Xr(),[c,d]=b.useState([]),[u,m]=b.useState(null),[p,h]=b.useState(!0),[y,x]=b.useState(!1),[v,k]=b.useState("all"),[w,T]=b.useState(()=>i),[j,C]=b.useState(!1),[$,M]=b.useState(null),[ee,ne]=b.useState(!1),[A,G]=b.useState(!1),[V,oe]=b.useState(null),[Y,F]=b.useState(null),[I,Q]=b.useState(null),le=b.useRef(null),B=b.useRef(!1);b.useEffect(()=>(B.current=!0,()=>{B.current=!1}),[]);const L=b.useCallback(async()=>{h(!0),x(!1);try{const D=await pp();if(!B.current)return[];const U=new Map,be=Be=>{const Ve=typeof Be.plan_id=="string"?Be.plan_id:"";Ve&&!U.has(Ve)&&U.set(Ve,Be)};(Array.isArray(D)?D:[]).forEach(be);const Ne=Ac.filter(Be=>!U.has(Be));if(Ne.length>0){const Be=await Promise.allSettled(Ne.map(async Ve=>({id:Ve,plans:await Hy(Ve,20)})));for(const Ve of Be)if(Ve.status==="fulfilled"){const ct=Ve.value.plans.find(Ee=>Ee.plan_id===Ve.value.id);ct&&be(ct)}}const $e=Ac.map(Be=>U.get(Be)).filter(Be=>!!Be),nt=[...[...U.entries()].filter(([Be])=>!Ac.includes(Be)).map(([,Be])=>Be).sort((Be,Ve)=>Op(Ve)-Op(Be)),...$e];if(nt.length>0){const Be=new Set(nt.map(Ee=>typeof Ee.plan_id=="string"?Ee.plan_id:"")),Ve=ns().filter(Ee=>!Be.has(Ee.id)).map(Ee=>({plan_id:Ee.id,title:Ee.title,objective:Ee.objective,status:Ee.status,created_at:Ee.createdAt||new Date().toISOString(),updated_at:Ee.updatedAt||Ee.createdAt||new Date().toISOString(),steps:Ee.steps.map(Et=>({step_id:Et.id,title:Et.title,description:Et.description,status:Et.status,preferred_skills:Et.preferredSkills,tasks:Et.tasks.map(ft=>({task_id:ft.id,title:ft.title,description:ft.description,status:ft.status,assigned_skill_id:ft.assignedSkillId,started_at:ft.startedAt,finished_at:ft.finishedAt}))}))})),ct=Ub([...nt,...Ve]);return G(!1),d(ct),ct}else{const Be=ns();return G(!0),d(Be),Be}}catch(D){if(!B.current)return[];console.error("[MissionCenter] fetch failed:",D);const U=ns();return G(!0),d(U),x(!1),U}finally{B.current&&h(!1)}},[]);b.useEffect(()=>{L()},[L]),b.useEffect(()=>{T(r||Xr()),C(!1)},[r]);const q=b.useCallback(D=>{m(D),F(D.id),window.setTimeout(()=>{var U;(U=le.current)==null||U.scrollIntoView({block:"start",inline:"nearest",behavior:"smooth"})},40)},[]),ce=b.useCallback(D=>{q(D),Q({kind:"selected",missionId:D.id,title:D.title,planId:D.sourceIds.planId})},[q]);b.useEffect(()=>{if(!e&&!a)return;const D=c.find(U=>U.id===e||U.sourceIds.planId===e||(a?U.sourceIds.taskIds.includes(a):!1));D&&(k("all"),ce(D),window.setTimeout(()=>{var U;(U=document.getElementById(`mission-card-${lu(D.id)}`))==null||U.scrollIntoView({block:"center",behavior:"smooth"})},80))},[e,a,c,ce]);const ge=b.useCallback(async D=>{if(M(D.id),x(!1),oe(null),A||!D.sourceIds.planId){d(U=>Jf(U,D.id)),m(U=>(U==null?void 0:U.id)!==D.id?U:Jf([U],D.id)[0]??U),window.setTimeout(()=>{B.current&&(d(U=>Wf(U,D.id)),m(U=>(U==null?void 0:U.id)!==D.id?U:Wf([U],D.id)[0]??U),M(null))},1200);return}try{const U=await yv(D),be=await L();if(k("all"),U){const Ne=be.find($e=>$e.id===U||$e.sourceIds.planId===U);if(Ne)q(Ne),Q({kind:"dispatched",missionId:Ne.id,title:Ne.title,planId:U});else{const $e=await Hy(U,5),Ce=Ub($e).find(nt=>nt.id===U);Ce?(q(Ce),Q({kind:"dispatched",missionId:Ce.id,title:Ce.title,planId:U})):m(null)}}else m(Ne=>(Ne==null?void 0:Ne.id)===D.id?null:Ne)}catch(U){console.error("[MissionCenter] dispatch failed:",U),x(!1),oe(U instanceof Error?U.message:"任务委托失败")}finally{M(null)}},[A,L,q]),N=b.useCallback(async D=>{if(M(D.id),x(!1),oe(null),A||!D.sourceIds.planId){await ge(D);return}try{const U=await F8(D),be=await L();k("all");const Ne=be.find($e=>$e.id===U||$e.sourceIds.planId===U);Ne?(q(Ne),Q({kind:"created",missionId:Ne.id,title:Ne.title,planId:U})):(F(U),Q({kind:"created",missionId:U,title:J0(D.title),planId:U}))}catch(U){console.error("[MissionCenter] restart failed:",U),x(!1),oe(U instanceof Error?U.message:"重新执行失败")}finally{M(null)}},[A,L,q,ge]),z=w||Xr(),K=U8(j?c:c.filter(D=>L8(D,z)),z),E=K.filter(D=>D.sourceIds.planId&&["draft","reviewing","approved"].includes(D.status.toLowerCase())),pe=b.useCallback(async()=>{if(E.length!==0){if(ne(!0),x(!1),A){let D=0;for(const U of E.slice(0,4))window.setTimeout(()=>{B.current&&(M(U.id),d(be=>Jf(be,U.id)))},D),D+=400,window.setTimeout(()=>{B.current&&d(be=>Wf(be,U.id))},D+900);window.setTimeout(()=>{B.current&&(M(null),ne(!1))},D+1200);return}try{for(const D of E)M(D.id),await yv(D);await L(),m(null)}catch(D){console.error("[MissionCenter] batch dispatch failed:",D),x(!1),oe(D instanceof Error?D.message:"批量委托失败")}finally{M(null),ne(!1)}}},[A,L,E]),ve=(v==="all"?K:K.filter(D=>H8(D)===v)).map((D,U)=>({mission:D,index:U})).sort((D,U)=>{const be=Ne=>(Ne.id===Y?2:0)+(Ne.id===(u==null?void 0:u.id)?1:0);return be(U.mission)-be(D.mission)||xv(D.mission,z)-xv(U.mission,z)||D.index-U.index}).map(({mission:D})=>D),ze=(I==null?void 0:I.kind)==="created"?"刚创建重新执行任务":(I==null?void 0:I.kind)==="dispatched"?"刚委托执行任务":"当前查看任务",me=D=>D.id!==Y?null:(I==null?void 0:I.missionId)===D.id&&I.kind==="created"?"刚创建":(I==null?void 0:I.missionId)===D.id&&I.kind==="dispatched"?"刚委托":"当前查看";return l.jsx("div",{className:"de-mission-center-page",children:l.jsxs("div",{className:"de-mission-center-layout",children:[l.jsx("div",{className:"de-mc-list",children:l.jsxs(zi,{children:[l.jsxs(ru,{title:"任务委托",children:[l.jsx("button",{onClick:pe,className:"de-btn-primary de-btn-sm",disabled:ee||E.length===0,children:ee?"委托中...":`委托可执行任务(${E.length})`}),l.jsx("button",{onClick:L,className:"de-btn-secondary de-btn-sm",children:J("console.action.refresh")})]}),l.jsxs("div",{className:"de-card-body",children:[A&&l.jsx("div",{className:"de-schedule-result de-schedule-result--success",style:{marginBottom:12},children:"当前展示为客户演示场景。真实任务未加载时,页面会自动使用“一天工作流”示例数据。"}),V&&l.jsx("div",{className:"de-schedule-result de-schedule-result--error",style:{marginBottom:12},children:V}),I&&l.jsxs("div",{className:"de-mission-focus-notice",children:[l.jsx("strong",{children:ze}),l.jsx("span",{children:I.title}),I.planId&&l.jsx("code",{children:I.planId})]}),l.jsxs("div",{className:"de-date-filter-row",children:[l.jsxs("label",{className:"de-date-filter-field",children:[l.jsx("span",{children:"选择日期"}),l.jsx("input",{type:"date",value:z,onChange:D=>{C(!1),T(D.target.value||Xr())}})]}),l.jsxs("div",{className:"de-date-filter-actions","aria-label":"日期切换",children:[l.jsx("button",{type:"button",className:"de-filter-chip",onClick:()=>{C(!1),T(hv(z,-1))},children:"前一天"}),l.jsx("button",{type:"button",className:"de-filter-chip active",onClick:()=>{C(!1),T(Xr())},children:"今天"}),l.jsx("button",{type:"button",className:"de-filter-chip",onClick:()=>{C(!1),T(hv(z,1))},children:"后一天"})]}),l.jsx("span",{className:"de-date-filter-summary",children:j?`全部 ${K.length} 项任务`:`${K.length} 项任务`})]}),l.jsx("div",{className:"de-filter-row",children:O8.map(D=>l.jsx("button",{className:`de-filter-chip ${v===D.key?"active":""}`,onClick:()=>k(D.key),children:D.label},D.key))}),p?l.jsx("div",{className:"de-loading-skeleton",style:{height:300}}):y?l.jsx("p",{className:"de-empty-text",children:J("console.state.backendDown")}):ve.length===0?l.jsxs("div",{className:"de-mission-empty-panel",children:[l.jsx("strong",{children:"当前日期暂无任务"}),l.jsx("p",{children:"这个日期没有匹配到任务记录,演示时可以切回演示日期,或临时查看全部任务。"}),l.jsxs("div",{className:"de-mission-empty-actions",children:[l.jsx("button",{type:"button",className:"de-btn-primary de-btn-sm",onClick:()=>{C(!0),k("all")},children:"查看全部任务"}),l.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",onClick:()=>{C(!1),T(r||Xr())},children:"返回演示日期"})]})]}):l.jsx("div",{className:"de-mc-card-list",children:ve.map(D=>l.jsx(k8,{mission:D,selected:(u==null?void 0:u.id)===D.id,focusLabel:me(D),dateFilter:z,running:$===D.id,onSelect:ce,onRun:ge,onRestart:N},D.id))})]})]})}),l.jsx("div",{className:"de-mc-detail",ref:le,children:u?l.jsx(R8,{mission:u,onClose:()=>m(null)}):l.jsx(zi,{children:l.jsx("div",{className:"de-card-body",children:l.jsxs("div",{className:"de-mission-empty-panel de-mission-empty-panel--detail",children:[l.jsx("strong",{children:"选择一个任务后,右侧会显示执行步骤、运行记录和交付结果。"}),l.jsx("p",{children:"后天演示建议先从左侧选择“自动外呼现场人员”或“接收约时工单”,让领导看到数字员工不是静态页面,而是在按流程接活、执行、反馈。"})]})})})})]})})}const Y8=[{value:"all",label:"全部任务"},{value:"daily",label:"日常任务"},{value:"weekly",label:"周任务"},{value:"monthly",label:"月度任务"},{value:"adhoc",label:"临时任务"}],G8={daily:"日常",weekly:"周",monthly:"月度",adhoc:"临时"};function W0(e){const a=`${e.id} ${e.name} ${e.description} ${e.category}`.toLowerCase();return/weekly|week|周/.test(a)?"weekly":/monthly|month|月报|月度/.test(a)?"monthly":/monitor|crawler|巡检|监控|待办|日程|日报|日终|收件箱|工作台|客户跟进/.test(a)?"daily":"adhoc"}function np(e){const a=`${e.id} ${e.name} ${e.description} ${e.category}`.toLowerCase();return e.capabilityLevel==="specialized"||e.capabilityLevel==="experimental"||/加密|深度|分析|自动化|部署|代码|审查|调研|批量|converter|crypto|github|deploy|review|research/.test(a)}function V8(e){const a=`${e.id} ${e.name} ${e.description} ${e.category}`.toLowerCase();return/日报|周报|报表|待办|日程|巡检|客户|知识库|经营|费用|收件箱|工作台/.test(a)}function K8(e){const a=e.name,r=`${e.id} ${e.name} ${e.description} ${e.category}`.toLowerCase();return/report|报表|日报|周报|月报|汇报/.test(r)?`自动整理${a}材料,减少手工汇总和重复填报。`:/monitor|巡检|监控|预警/.test(r)?`按约定频率完成${a},及时提示异常和遗漏。`:/todo|待办|task|看板|日程/.test(r)?`帮你梳理${a},把后续处理事项集中呈现。`:/客户|crm|回访|满意/.test(r)?"汇总客户相关信息,形成可直接跟进的处理建议。":/知识|文档|制度|模板/.test(r)?"查找和核对资料内容,减少人工翻找和版本确认。":e.description}function P8(e,a,r){return e.enabled?"已学习":e.enabled?r?"需确认后学习":a?"建议学习":"可学习":"暂不使用"}function X8({skill:e,recommended:a=!1,advanced:r=!1,selected:i=!1,updating:c=!1,onSelect:d,onToggle:u}){const m=W0(e),p=P8(e,a,r);return l.jsxs("div",{id:`skill-card-${lu(e.id)}`,className:`de-skill-card ${i?"de-skill-card--selected":""}`,role:"button",tabIndex:0,onClick:()=>d==null?void 0:d(e),onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),d==null||d(e))},children:[l.jsxs("div",{className:"de-skill-card-head",children:[l.jsx("span",{className:"de-skill-name",children:e.name}),l.jsx("span",{className:`de-skill-status ${e.enabled?"enabled":"disabled"}`,children:p})]}),l.jsx("p",{className:"de-skill-desc",children:K8(e)}),l.jsxs("div",{className:"de-skill-card-foot",children:[l.jsxs("span",{className:"de-skill-version",children:["适用任务:",G8[m]]}),l.jsx("button",{className:`de-skill-btn ${e.enabled?"de-skill-btn--danger":""}`,disabled:c,title:e.enabled?"暂时停用此技能,后续路由不会选择它。":"恢复使用此技能。",onClick:h=>{h.stopPropagation(),c||u==null||u(e)},children:c?"处理中...":e.enabled?"暂不使用":"恢复使用"})]})]})}function Q8({focusSkillId:e}){const[a,r]=b.useState([]),[i,c]=b.useState(!0),[d,u]=b.useState(!1),[m,p]=b.useState(""),[h,y]=b.useState("all"),[x,v]=b.useState(e??null),[k,w]=b.useState(null),[T,j]=b.useState(null),C=b.useRef(!1);b.useEffect(()=>(C.current=!0,()=>{C.current=!1}),[]);const $=b.useCallback(async()=>{c(!0),u(!1);try{const B=await sm();if(!C.current)return;r(Array.isArray(B)&&B.length>0?IT(B):iv())}catch(B){if(!C.current)return;console.error("[SkillLibrary] fetch failed:",B),r(iv()),u(!1)}finally{C.current&&c(!1)}},[]);b.useEffect(()=>{$()},[$]),b.useEffect(()=>{e&&(v(e),y("all"),p(""),window.setTimeout(()=>{var B;(B=document.getElementById(`skill-card-${lu(e)}`))==null||B.scrollIntoView({block:"center",behavior:"smooth"})},80))},[e,a.length]);const M=b.useCallback(async B=>{const L=!B.enabled;w(B.id),j(null);try{const q=await _S(B.id,L);if(!q.ok)throw new Error(q.error||"技能状态变更失败");r(ce=>ce.map(ge=>ge.id===B.id?{...ge,enabled:L}:ge)),v(B.id)}catch(q){j(q instanceof Error?q.message:"技能状态变更失败")}finally{w(null)}},[]),ee=a.filter(B=>h==="all"||W0(B)===h).filter(B=>!m||B.name.includes(m)||B.description.includes(m)||B.category.includes(m)),ne=ee.filter(np),A=new Set(ne.map(B=>B.id)),G=ee.filter(B=>B.enabled&&!A.has(B.id)),V=ee.filter(B=>!B.enabled&&V8(B)&&!np(B)),oe=ee.filter(B=>!B.enabled&&!np(B)),Y=(V.length>0?V:oe).slice(0,4),F=new Set(Y.map(B=>B.id)),I=oe.filter(B=>!F.has(B.id)),Q=[{key:"recommended",title:"推荐学习",hint:"优先补齐高频工作能力,适合让数字员工尽快接手重复事务。",skills:Y,emptyText:"暂无推荐学习项。"},{key:"learnable",title:"可学习技能",hint:"可纳入数字员工日常工作的业务能力,学习入口待接入后启用。",skills:I,emptyText:"当前没有可学习技能。"},{key:"learned",title:"已学技能",hint:"数字员工已经掌握并可被业务场景调用的能力。",skills:G,emptyText:"当前还没有已学习技能。"},{key:"advanced",title:"高级技能",hint:"适合有明确边界或需要确认后再交给数字员工处理的能力。",skills:ne,emptyText:"暂无高级技能。"}],le=B=>l.jsxs("section",{style:{display:"grid",gap:10},children:[l.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12},children:[l.jsxs("div",{children:[l.jsx("h3",{style:{margin:0,fontSize:16,color:"var(--de-text-primary)"},children:B.title}),l.jsx("p",{style:{margin:"4px 0 0",fontSize:12,color:"var(--de-text-muted)"},children:B.hint})]}),l.jsxs("span",{className:"de-capability-badge de-capability-standard",children:[B.skills.length," 项"]})]}),B.skills.length===0?l.jsx("p",{className:"de-empty-text",style:{margin:0},children:B.emptyText}):l.jsx("div",{className:"de-skill-grid",children:B.skills.map(L=>l.jsx(X8,{skill:L,recommended:B.key==="recommended",advanced:B.key==="advanced",selected:x===L.id,updating:k===L.id,onSelect:q=>v(q.id),onToggle:M},`${B.key}-${L.id}`))})]},B.key);return l.jsx("div",{style:{padding:"14px 18px"},children:l.jsxs(zi,{children:[l.jsx(ru,{title:"学习技能",children:l.jsx("button",{onClick:$,className:"de-btn-secondary de-btn-sm",children:"刷新"})}),l.jsxs("div",{className:"de-card-body",children:[T&&l.jsx("div",{className:"de-schedule-result de-schedule-result--error",style:{marginBottom:12},children:T}),l.jsxs("div",{className:"de-skill-toolbar",children:[l.jsx("input",{type:"text",className:"de-input",placeholder:"搜索业务能力...",value:m,onChange:B=>p(B.target.value)}),l.jsx("div",{className:"de-filter-row",children:Y8.map(B=>l.jsx("button",{className:`de-filter-chip ${h===B.value?"active":""}`,onClick:()=>y(B.value),children:B.label},B.value))})]}),i?l.jsx("div",{className:"de-loading-skeleton",style:{height:300}}):d?l.jsx("p",{className:"de-empty-text",children:"服务暂不可用,已保留本地示例供预览。"}):ee.length===0&&a.length>0?l.jsx("p",{className:"de-empty-text",children:"无匹配技能,请调整搜索或筛选条件"}):ee.length===0?l.jsx("p",{className:"de-empty-text",children:"暂无可展示的学习技能。"}):l.jsx("div",{style:{display:"grid",gap:18},children:Q.map(le)})]})]})})}const Z8={display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(260px, 1fr))",gap:12},ap={border:"1px solid var(--de-glass-border-lighter)",borderRadius:10,padding:"12px 14px",background:"linear-gradient(180deg, rgba(244,250,255,0.82), rgba(235,246,255,0.58))"};function J8(){const e=new Date;return[e.getFullYear(),String(e.getMonth()+1).padStart(2,"0"),String(e.getDate()).padStart(2,"0")].join("-")}function W8(e){return(e==null?void 0:e.status)==="ready"?"已生成":(e==null?void 0:e.status)==="generating"?"生成中":(e==null?void 0:e.status)==="failed"?"生成失败":"待生成"}function eD(e){return(e==null?void 0:e.status)==="ready"?"de-report-badge--ready":"de-report-badge--waiting"}function tD(e){return e?e.generated_by==="ai"?`AI 已生成日报${e.model?`:${e.model}`:""}`:"AI 不可用时已使用规则兜底生成日报":"AI 将基于当天任务和运行明细生成日报"}function nD(e){if(!e)return[];const a=e.duties.filter(r=>r.selected).map(r=>r.id);return a.length>0?a:e.duties.filter(r=>r.implemented).map(r=>r.id)}function aD(e){if(!e)return"暂未生成";const a=new Date(e);return Number.isNaN(a.getTime())?e:a.toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}function rD({sections:e}){return e.length===0?l.jsx("p",{className:"de-empty-text",style:{padding:"18px 0 6px"},children:"今天还没有可汇总的任务。"}):l.jsx("div",{className:"de-task-summary-grid","aria-label":"日报任务汇总",children:e.map(a=>l.jsxs("div",{className:`de-task-summary-card de-live-feed-row--${a.latest_status_tone||"info"}`,children:[l.jsx("span",{className:"de-task-summary-title",children:a.title}),l.jsx("span",{className:"de-badge de-badge-info",children:a.latest_status_label}),l.jsxs("strong",{children:["执行次数 ",a.total_count]}),l.jsxs("small",{children:["成功次数 ",a.success_count," · 失败次数 ",a.failure_count]}),l.jsx("em",{children:a.ai_summary||a.business_summary})]},a.id))})}function lD({details:e}){return e.length===0?l.jsx("p",{className:"de-empty-text",style:{padding:"18px 0 6px"},children:"任务执行后,这里会展示时间、任务、步骤和执行情况。"}):l.jsxs("div",{className:"de-run-detail-list de-run-detail-list-scroll","aria-label":"日报运行明细",children:[l.jsxs("div",{className:"de-run-detail-row de-run-detail-row--head",children:[l.jsx("span",{children:"时间"}),l.jsx("span",{children:"任务名称"}),l.jsx("span",{children:"步骤名称"}),l.jsx("span",{children:"执行状态"}),l.jsx("span",{children:"执行情况"})]}),e.map(a=>l.jsxs("div",{className:`de-run-detail-row de-live-feed-row--${a.status_tone||"info"}`,children:[l.jsx("span",{children:a.time||"--:--"}),l.jsx("strong",{children:a.task_name}),l.jsx("em",{children:a.step_name||a.operation_name||"任务执行"}),l.jsx("i",{className:"de-badge de-badge-info",children:a.status_label}),l.jsx("span",{children:a.business_detail})]},a.id))]})}function sD({focusSection:e}){const a=b.useMemo(()=>J8(),[]),[r,i]=b.useState(null),[c,d]=b.useState("18:00"),[u,m]=b.useState(!0),[p,h]=b.useState(null),[y,x]=b.useState(null),v=b.useRef(!1),k=(r==null?void 0:r.source)==="live",w=k?(r==null?void 0:r.daily_report)??null:null,T=k?(w==null?void 0:w.task_sections)??(r==null?void 0:r.execution_summaries)??[]:[],j=k?(r==null?void 0:r.run_details)??[]:[],C=k?null:(r==null?void 0:r.demo_reason)??"当前没有真实运行投影,日报区域暂不展示兜底数据。",$=(w==null?void 0:w.totals)??{task_count:T.length,execution_count:T.reduce((G,V)=>G+V.total_count,0),success_count:T.reduce((G,V)=>G+V.success_count,0),failure_count:T.reduce((G,V)=>G+V.failure_count,0),running_count:T.reduce((G,V)=>G+V.running_count,0)},M=b.useCallback(async()=>{var G;m(!0),x(null);try{const V=await fp(a);if(!v.current)return;i(V),d(V.source==="live"&&((G=V.daily_report)==null?void 0:G.report_schedule_time)||"18:00")}catch(V){if(!v.current)return;x(V instanceof Error?V.message:"日报数据加载失败")}finally{v.current&&m(!1)}},[a]);b.useEffect(()=>(v.current=!0,M(),()=>{v.current=!1}),[M]),b.useEffect(()=>{!e||u||window.setTimeout(()=>{var G;(G=document.getElementById(`report-section-${e}`))==null||G.scrollIntoView({block:"center",behavior:"smooth"})},80)},[e,u]);const ee=b.useCallback(async()=>{var G;h("update_report_schedule"),x(null);try{const V=await Zl({action:"update_report_schedule",date:a,report_schedule_time:c});if(!v.current)return;i(V),d(V.source==="live"&&((G=V.daily_report)==null?void 0:G.report_schedule_time)||c),x("日报生成时间已更新。")}catch(V){if(!v.current)return;x(V instanceof Error?V.message:"日报生成时间设置失败")}finally{v.current&&h(null)}},[c,a]),ne=b.useCallback(async()=>{var G;h("generate_daily_report"),x(null);try{const V=await Zl({action:"generate_daily_report",date:a,duty_ids:k?nD(r):[],report_schedule_time:c});if(!v.current)return;i(V),d(V.source==="live"&&((G=V.daily_report)==null?void 0:G.report_schedule_time)||c),x("日报已生成,可下载 PDF。")}catch(V){if(!v.current)return;x(V instanceof Error?V.message:"日报生成失败")}finally{v.current&&h(null)}},[k,r,c,a]),A=b.useCallback(()=>{window.open(f1(a),"_blank","noopener,noreferrer")},[a]);return l.jsx("div",{style:{padding:"14px 18px"},children:l.jsxs(zi,{children:[l.jsx(ru,{title:"日报生成",children:l.jsx("span",{className:"de-card-meta-text",children:a})}),l.jsx("div",{className:"de-card-body",children:u?l.jsx("div",{className:"de-loading-skeleton",style:{height:420}}):l.jsxs(l.Fragment,{children:[l.jsxs("section",{id:"report-section-today",className:"de-report-summary",style:{marginBottom:12},children:[l.jsxs("div",{className:"de-report-summary-head",children:[l.jsxs("div",{className:"de-report-summary-title-row",children:[l.jsx("h3",{children:(w==null?void 0:w.title)||"数字员工日报"}),l.jsx("p",{children:tD(w)})]}),l.jsx("span",{className:`de-report-badge ${eD(w)}`,children:W8(w)})]}),l.jsxs("div",{className:"de-report-summary-body",children:[l.jsxs("div",{className:"de-report-schedule-row",children:[l.jsxs("label",{children:[l.jsx("span",{children:"生成时间"}),l.jsx("input",{type:"time",value:c,onChange:G=>d(G.target.value||"18:00")})]}),l.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:p==="update_report_schedule",onClick:()=>{ee()},children:"设置时间"}),l.jsx("button",{type:"button",className:"de-btn-primary de-btn-sm",disabled:p==="generate_daily_report",onClick:()=>{ne()},children:p==="generate_daily_report"?"生成中...":"生成日报"}),l.jsxs("button",{type:"button",className:"de-btn-secondary de-btn-sm de-report-download-btn",disabled:!(w!=null&&w.pdf_available),onClick:A,title:w!=null&&w.pdf_available?"下载日报 PDF":"生成日报后可下载日报 PDF",children:[l.jsx(cp,{size:14,"aria-hidden":"true"}),"下载日报"]})]}),l.jsxs("div",{className:"de-report-metrics",children:[l.jsxs("div",{className:"de-report-metric",children:[l.jsx("span",{children:"任务总数"}),l.jsx("strong",{children:$.task_count})]}),l.jsxs("div",{className:"de-report-metric",children:[l.jsx("span",{children:"执行次数"}),l.jsx("strong",{children:$.execution_count})]}),l.jsxs("div",{className:"de-report-metric",children:[l.jsx("span",{children:"成功次数"}),l.jsx("strong",{children:$.success_count})]}),l.jsxs("div",{className:"de-report-metric",children:[l.jsx("span",{children:"失败次数"}),l.jsx("strong",{children:$.failure_count})]})]}),l.jsxs("div",{className:"de-report-meta",children:[l.jsx("p",{children:(w==null?void 0:w.summary)||"点击生成日报后,AI 会基于当天所有任务写出总分结构日报。"}),C?l.jsx("p",{children:C}):null,l.jsxs("p",{children:["计划生成时间:",c,";最近生成:",aD(w==null?void 0:w.generated_at)]}),y?l.jsx("p",{children:y}):null]})]})]}),l.jsxs("div",{style:Z8,children:[l.jsxs("section",{id:"report-section-tasks",style:ap,children:[l.jsx("h3",{className:"de-settings-heading",style:{marginTop:0},children:"任务汇总"}),l.jsx(rD,{sections:T})]}),l.jsxs("section",{id:"report-section-details",style:ap,children:[l.jsx("h3",{className:"de-settings-heading",style:{marginTop:0},children:"运行明细"}),l.jsx(lD,{details:j})]}),l.jsxs("section",{id:"report-section-summary",style:ap,children:[l.jsx("h3",{className:"de-settings-heading",style:{marginTop:0},children:"日报内容"}),((w==null?void 0:w.detail_lines)??[]).length===0?l.jsx("p",{className:"de-empty-text",style:{padding:"18px 0 6px"},children:"生成日报后会展示 AI 整理后的分项说明。"}):l.jsx("div",{className:"de-report-meta",children:((w==null?void 0:w.detail_lines)??[]).map(G=>l.jsx("p",{children:G},G))})]})]})]})})]})})}const iD=["sales","engineering","hr","finance","executive"],ek="sgrobot-role-preferences",rp={workStart:"09:00",workEnd:"18:00",notification:"system",reportTime:"17:30",avatarStyle:"professional",reminderLevel:"important"},oD={compact:"紧凑",balanced:"均衡",presentation:"汇报"},cD={display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(220px, 1fr))",gap:12},Kl={display:"flex",flexDirection:"column",gap:6,border:"1px solid var(--de-glass-border-lighter)",borderRadius:10,padding:"12px 14px",background:"linear-gradient(180deg, rgba(244,250,255,0.82), rgba(235,246,255,0.58))"},Pl={minHeight:34,borderRadius:8,border:"1px solid var(--de-glass-border-light)",background:"rgba(255,255,255,0.72)",color:"var(--de-text-primary)",padding:"0 10px"};function uD(){try{const e=localStorage.getItem(ek);return e?{...rp,...JSON.parse(e)}:rp}catch{return rp}}function dD(){const{role:e,profile:a,setRole:r}=wA(),[i,c]=b.useState(uD),[d,u]=b.useState(!1),m=b.useRef(null);b.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]);const p=()=>{u(!0),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>u(!1),2e3)},h=v=>{c(v);try{localStorage.setItem(ek,JSON.stringify(v))}catch{}p()},y=(v,k)=>{h({...i,[v]:k})},x=v=>{r(v),p()};return l.jsx("div",{style:{padding:"14px 18px"},children:l.jsxs(zi,{children:[l.jsx(ru,{title:"角色偏好",children:d&&l.jsx("span",{className:"de-card-meta-text",children:"已保存"})}),l.jsxs("div",{className:"de-card-body",children:[l.jsxs("section",{className:"de-settings-section",children:[l.jsx("h3",{className:"de-settings-heading",children:"数字员工角色"}),l.jsx("p",{className:"de-settings-desc",children:"选择日常协作身份,数字员工会按你的岗位重点调整提醒和汇总口径。"}),l.jsx("div",{className:"de-role-grid",children:iD.map(v=>l.jsxs("button",{className:`de-role-card ${e===v?"active":""}`,onClick:()=>x(v),children:[l.jsx("span",{className:"de-role-label",children:J(Hc[v].labelKey)}),l.jsxs("span",{className:"de-role-density",children:[oD[Hc[v].density]??"均衡","视图"]})]},v))})]}),l.jsxs("section",{className:"de-settings-section",children:[l.jsx("h3",{className:"de-settings-heading",children:"工作偏好"}),l.jsxs("div",{style:cD,children:[l.jsxs("label",{style:Kl,children:[l.jsx("span",{className:"de-role-label",children:"工作开始时间"}),l.jsx("input",{style:Pl,type:"time",value:i.workStart,onChange:v=>y("workStart",v.target.value)})]}),l.jsxs("label",{style:Kl,children:[l.jsx("span",{className:"de-role-label",children:"工作结束时间"}),l.jsx("input",{style:Pl,type:"time",value:i.workEnd,onChange:v=>y("workEnd",v.target.value)})]}),l.jsxs("label",{style:Kl,children:[l.jsx("span",{className:"de-role-label",children:"默认日报时间"}),l.jsx("input",{style:Pl,type:"time",value:i.reportTime,onChange:v=>y("reportTime",v.target.value)})]}),l.jsxs("label",{style:Kl,children:[l.jsx("span",{className:"de-role-label",children:"通知方式"}),l.jsxs("select",{style:Pl,value:i.notification,onChange:v=>y("notification",v.target.value),children:[l.jsx("option",{value:"system",children:"系统通知"}),l.jsx("option",{value:"email",children:"邮件提醒"}),l.jsx("option",{value:"silent",children:"只在页面显示"})]})]}),l.jsxs("label",{style:Kl,children:[l.jsx("span",{className:"de-role-label",children:"数字员工形象偏好"}),l.jsxs("select",{style:Pl,value:i.avatarStyle,onChange:v=>y("avatarStyle",v.target.value),children:[l.jsx("option",{value:"professional",children:"专业稳重"}),l.jsx("option",{value:"friendly",children:"亲和协作"}),l.jsx("option",{value:"concise",children:"简洁高效"})]})]}),l.jsxs("label",{style:Kl,children:[l.jsx("span",{className:"de-role-label",children:"任务提醒偏好"}),l.jsxs("select",{style:Pl,value:i.reminderLevel,onChange:v=>y("reminderLevel",v.target.value),children:[l.jsx("option",{value:"important",children:"只提醒重要事项"}),l.jsx("option",{value:"all",children:"所有进展都提醒"}),l.jsx("option",{value:"quiet",children:"尽量少打扰"})]})]})]})]}),l.jsxs("details",{className:"de-settings-section",style:{marginBottom:0},children:[l.jsx("summary",{className:"de-settings-heading",style:{cursor:"pointer"},children:"高级技术设置"}),l.jsxs("p",{className:"de-settings-desc",children:["默认隐藏,仅供技术人员排查使用。当前角色刷新阈值:",Math.round(a.staleDataThresholdMs/1e3)," 秒。"]})]})]})]})})}const tk=[{id:"home",label:"首页"},{id:"missions",label:"任务中心"},{id:"skills",label:"技能库"},{id:"reports",label:"日报"},{id:"settings",label:"设置"}],fD="sgrobot:digital-close";function nk(e){return!!(e&&tk.some(a=>a.id===e))}function pD(e){const a=e.split("/").filter(Boolean),r=a.length>0?a[a.length-1]:null;return nk(r)?r:null}function bv(e,a){const r=new URLSearchParams(a),i=r.get("tab");return{tab:nk(i)?i:pD(e)??"home",date:r.get("date"),missionId:r.get("mission"),taskId:r.get("task"),skillId:r.get("skill"),reportSection:r.get("section")}}function mD({target:e,onNavigate:a}){switch(e.tab){case"home":return l.jsx(s8,{onNavigate:a});case"missions":return l.jsx(I8,{focusMissionId:e.missionId,focusTaskId:e.taskId,focusDate:e.date});case"skills":return l.jsx(Q8,{focusSkillId:e.skillId});case"reports":return l.jsx(sD,{focusSection:e.reportSection});case"settings":return l.jsx(dD,{})}}function hD(){if(window.parent&&window.parent!==window){const e=window.location.origin==="null"?"*":window.location.origin;window.parent.postMessage({type:fD},e);return}if(Vn()){Pp(async()=>{const{getCurrentWindow:e}=await import("./window-DQYDsu7Z.js");return{getCurrentWindow:e}},__vite__mapDeps([0,1])).then(({getCurrentWindow:e})=>e().close()).catch(()=>window.close());return}window.close()}function gD(){const e=Rn(),a=Gc(),[r,i]=b.useState(()=>bv(e.pathname,e.search));b.useEffect(()=>{i(bv(e.pathname,e.search))},[e.pathname,e.search]);const c=b.useCallback(d=>{i(d);const u=new URLSearchParams;d.tab!=="home"&&u.set("tab",d.tab),d.date&&u.set("date",d.date),d.missionId&&u.set("mission",d.missionId),d.taskId&&u.set("task",d.taskId),d.skillId&&u.set("skill",d.skillId),d.reportSection&&u.set("section",d.reportSection),a({pathname:e.pathname,search:u.toString()?`?${u.toString()}`:""},{replace:!1})},[e.pathname,a]);return l.jsx(_A,{children:l.jsxs("div",{className:"de-shell",children:[l.jsx("header",{className:"de-header",children:l.jsxs("div",{className:"de-header-content",children:[l.jsxs("div",{className:"de-header-left",children:[l.jsx("div",{className:"de-header-accent-bar"}),l.jsx("h1",{className:"de-header-title",children:"智能数字人系统"})]}),l.jsx("div",{className:"de-header-center",children:tk.map(d=>l.jsx("button",{className:`de-nav-btn ${r.tab===d.id?"active":""}`,onClick:()=>c({tab:d.id}),children:l.jsx("span",{children:d.label})},d.id))}),l.jsxs("div",{className:"de-header-right",children:[l.jsx("span",{className:"de-header-welcome",children:"欢迎您,"}),l.jsx("span",{className:"de-header-username",children:"王琦"}),l.jsx("button",{type:"button",className:"de-header-icon",title:"消息",children:l.jsx(Lj,{size:16})}),l.jsx("button",{type:"button",className:"de-header-icon",title:"通知",children:l.jsx(yj,{size:16})}),l.jsx("button",{type:"button",className:"de-header-icon de-header-close",title:"关闭",onClick:hD,children:l.jsx(Ha,{size:17})})]})]})}),l.jsx("div",{className:"de-shell-body",children:l.jsx(mD,{target:r,onNavigate:c})})]})})}const xD=b.createContext({locale:"zh",setAppLocale:()=>{}});function ak(){return sessionStorage.getItem("sgrobot_logged_in")==="1"}function An({children:e}){const a=Rn();return ak()?l.jsx(l.Fragment,{children:e}):l.jsx(lp,{to:"/login",state:{from:a},replace:!0})}class yD extends b.Component{constructor(a){super(a),this.state={error:null}}static getDerivedStateFromError(a){return{error:a}}componentDidCatch(a,r){console.error("[sgRobot] Render error:",a,r.componentStack)}render(){return this.state.error?l.jsx("div",{className:"p-6",children:l.jsxs("div",{className:"card p-6 w-full max-w-lg",style:{borderColor:"rgba(239, 68, 68, 0.3)"},children:[l.jsx("h2",{className:"text-lg font-semibold mb-2",style:{color:"var(--color-status-error)"},children:"页面渲染失败"}),l.jsx("p",{className:"text-sm mb-4",style:{color:"var(--pc-text-muted)"},children:"前端组件出现异常,请查看浏览器控制台。"}),l.jsx("pre",{className:"text-xs rounded-lg p-3 overflow-x-auto whitespace-pre-wrap break-all font-mono",style:{background:"var(--pc-bg-base)",color:"var(--color-status-error)"},children:this.state.error.message}),l.jsx("button",{onClick:()=>this.setState({error:null}),className:"btn-electric mt-6 px-4 py-2 text-sm font-medium",children:"重试"})]})}):this.props.children}}function bD({onPair:e}){const[a,r]=b.useState(""),[i,c]=b.useState(""),[d,u]=b.useState(!1),[m,p]=b.useState(null),[h,y]=b.useState(!0);b.useEffect(()=>{let v=!1;return nS().then(k=>{!v&&k.pairing_code&&p(k.pairing_code)}).catch(()=>{}).finally(()=>{v||y(!1)}),()=>{v=!0}},[]);const x=async v=>{v.preventDefault(),u(!0),c("");try{await e(a)}catch(k){c(k instanceof Error?k.message:"配对失败")}finally{u(!1)}};return l.jsx("div",{className:"min-h-screen flex items-center justify-center",style:{background:"var(--pc-bg-base)"},children:l.jsxs("div",{className:"relative surface-panel p-8 w-full max-w-md animate-fade-in-scale",children:[l.jsxs("div",{className:"text-center mb-8",children:[l.jsx("div",{className:"mx-auto mb-4 h-20 w-20 rounded-2xl flex items-center justify-center animate-float",style:{background:"linear-gradient(135deg, var(--pc-accent), #6366f1)"},children:l.jsx("span",{className:"text-white text-3xl font-bold select-none",children:"sgR"})}),l.jsx("h1",{className:"text-2xl font-bold mb-2 text-gradient-blue",children:"sgRobot"}),l.jsx("p",{className:"text-sm",style:{color:"var(--pc-text-muted)"},children:m?"当前配对码":"请输入终端显示的配对码"})]}),!h&&m&&l.jsxs("div",{className:"mb-6 p-4 rounded-2xl text-center border",style:{background:"var(--pc-accent-glow)",borderColor:"var(--pc-accent-dim)"},children:[l.jsx("div",{className:"text-4xl font-mono font-bold tracking-[0.4em] py-2",style:{color:"var(--pc-text-primary)"},children:m}),l.jsx("p",{className:"text-xs mt-2",style:{color:"var(--pc-text-muted)"},children:"在下方或其他设备输入此配对码"})]}),l.jsxs("form",{onSubmit:x,children:[l.jsx("input",{type:"text",value:a,onChange:v=>r(v.target.value),placeholder:"6 位配对码",className:"input-electric w-full px-4 py-4 text-center text-2xl tracking-[0.3em] font-medium mb-4",maxLength:6,autoFocus:!0}),i&&l.jsx("p",{"aria-live":"polite",className:"text-sm mb-4 text-center animate-fade-in",style:{color:"var(--color-status-error)"},children:i}),l.jsx("button",{type:"submit",disabled:d||a.length<6,className:"btn-electric w-full py-3.5 text-sm font-semibold tracking-wide",children:d?l.jsxs("span",{className:"flex items-center justify-center gap-2",children:[l.jsx("span",{className:"h-4 w-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"配对中..."]}):"配对"})]})]})})}function vD(){const{isAuthenticated:e,requiresPairing:a,loading:r,pair:i,logout:c}=x1(),[d,u]=b.useState("zh"),m=_T(),p=h=>{u(h),wS(h)};return b.useEffect(()=>{const h=()=>{c()};return window.addEventListener("zeroclaw-unauthorized",h),()=>window.removeEventListener("zeroclaw-unauthorized",h)},[c]),r?l.jsx("div",{className:"min-h-screen flex items-center justify-center",style:{background:"var(--pc-bg-base)"},children:l.jsxs("div",{className:"flex flex-col items-center gap-4 animate-fade-in",children:[l.jsx("div",{className:"h-10 w-10 border-2 rounded-full animate-spin",style:{borderColor:"var(--pc-border)",borderTopColor:"var(--pc-accent)"}}),l.jsx("p",{className:"text-sm",style:{color:"var(--pc-text-muted)"},children:"正在连接..."})]})}):!e&&a?l.jsx(bD,{onPair:i}):l.jsx(j0.Provider,{value:m,children:l.jsx(xD.Provider,{value:{locale:d,setAppLocale:p},children:l.jsx(fj,{children:l.jsxs(hw,{children:[l.jsx(Gt,{path:"/popout",element:l.jsx(JT,{})}),l.jsx(Gt,{path:"/digital/*",element:l.jsx(gD,{})}),l.jsx(Gt,{path:"/login",element:ak()?l.jsx(lp,{to:"/",replace:!0}):l.jsx(c6,{})}),l.jsxs(Gt,{element:l.jsx(kT,{}),children:[l.jsx(Gt,{path:"/",element:l.jsx(An,{children:l.jsx(OT,{})})}),l.jsx(Gt,{path:"/browser",element:l.jsx(An,{children:l.jsx($T,{})})}),l.jsx(Gt,{path:"/dashboard",element:l.jsx(An,{children:l.jsx(v6,{})})}),l.jsx(Gt,{path:"/plans",element:l.jsx(An,{children:l.jsx(U6,{})})}),l.jsx(Gt,{path:"/execution",element:l.jsx(An,{children:l.jsx(K6,{})})}),l.jsx(Gt,{path:"/governance",element:l.jsx(An,{children:l.jsx(J6,{})})}),l.jsx(Gt,{path:"/scheduler",element:l.jsx(An,{children:l.jsx(aA,{})})}),l.jsx(Gt,{path:"/cron",element:l.jsx(An,{children:l.jsx(oA,{})})}),l.jsx(Gt,{path:"/skills",element:l.jsx(An,{children:l.jsx(cA,{})})}),l.jsx(Gt,{path:"/logs",element:l.jsx(An,{children:l.jsx(hA,{})})}),l.jsx(Gt,{path:"/swimlane",element:l.jsx(An,{children:l.jsx(xA,{})})}),l.jsx(Gt,{path:"/config",element:l.jsx(An,{children:l.jsx(vA,{})})}),l.jsx(Gt,{path:"/devtools",element:l.jsx(An,{children:l.jsx(l6,{})})}),l.jsx(Gt,{path:"*",element:l.jsx(lp,{to:"/",replace:!0})})]})]})})})})}function kD(){return l.jsx(AS,{children:l.jsx(uj,{children:l.jsx(vD,{})})})}const _D=Vn()?Hw:Uw,wD=Vn()?void 0:Pc||"/";x2.createRoot(document.getElementById("root")).render(l.jsx($p.StrictMode,{children:l.jsx(_D,{basename:wD,children:l.jsx(kD,{})})}));
|